diff --git a/.babelrc b/.babelrc
deleted file mode 100644
index e10f6de..0000000
--- a/.babelrc
+++ /dev/null
@@ -1,39 +0,0 @@
-{
- "presets": [
- "minify",
- [
- "@babel/preset-env",
- {
- "modules": false
- }
- ]
- ],
- "plugins": [
- "@babel/plugin-syntax-dynamic-import",
- "@babel/plugin-syntax-import-meta",
- "@babel/plugin-proposal-class-properties",
- "@babel/plugin-proposal-json-strings",
- [
- "@babel/plugin-proposal-decorators",
- {
- "legacy": true
- }
- ],
- "@babel/plugin-proposal-function-sent",
- "@babel/plugin-proposal-export-namespace-from",
- "@babel/plugin-proposal-numeric-separator",
- "@babel/plugin-proposal-throw-expressions",
- "@babel/plugin-proposal-export-default-from",
- "@babel/plugin-proposal-logical-assignment-operators",
- "@babel/plugin-proposal-optional-chaining",
- [
- "@babel/plugin-proposal-pipeline-operator",
- {
- "proposal": "minimal"
- }
- ],
- "@babel/plugin-proposal-nullish-coalescing-operator",
- "@babel/plugin-proposal-do-expressions",
- "@babel/plugin-proposal-function-bind"
- ]
-}
diff --git a/.eslintignore b/.eslintignore
new file mode 100644
index 0000000..e3486df
--- /dev/null
+++ b/.eslintignore
@@ -0,0 +1,3 @@
+/dist/
+/dist_demo/
+/package/dist/
diff --git a/.eslintrc.js b/.eslintrc.js
new file mode 100644
index 0000000..3c50247
--- /dev/null
+++ b/.eslintrc.js
@@ -0,0 +1,38 @@
+module.exports = {
+ root: true,
+ extends: [
+ // https://eslint.vuejs.org/user-guide/#installation
+ // add more generic rulesets here, such as:
+ 'eslint:recommended',
+ '@vue/standard',
+ // 'plugin:vue/vue3-recommended',
+ 'plugin:vue/recommended', // Use this if you are using Vue.js 2.x.
+ ],
+ rules: {
+ 'space-before-function-paren': 'warn',
+ 'operator-linebreak': 'warn',
+ 'no-tabs': 'warn',
+ 'no-new': 'warn',
+ eqeqeq: 'warn',
+ indent: 'warn',
+ quotes: 'warn',
+ semi: 'warn',
+ 'vue/multi-word-component-names': 'off',
+ 'no-var': 'off',
+ // ...
+ 'vue/multiline-html-element-content-newline': 'off',
+ 'vue/first-attribute-linebreak': 'off',
+ 'vue/max-attributes-per-line': 'off',
+ 'vue/order-in-components': 'off',
+ 'vue/attributes-order': 'off',
+ 'vue/html-indent': 'off',
+ 'no-irregular-whitespace': 'off',
+ 'no-mixed-operators': 'off',
+ 'no-unused-vars': 'off',
+ 'prefer-const': 'off',
+ 'comma-dangle': 'off',
+ 'max-len': 'off',
+ 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off'
+ }
+}
diff --git a/.gitignore b/.gitignore
index 78b3be1..ed14191 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,8 @@
.DS_Store
node_modules*/
dist/
+dist_demo/
+package/
+*.tgz
npm-debug.log
yarn-error.log
diff --git a/README.md b/README.md
index 50db045..88815da 100644
--- a/README.md
+++ b/README.md
@@ -12,31 +12,19 @@ Live Demo & Documentation: https://fritx.github.io/vue-at
- [x] Plain-text based, no jQuery, no extra nodes
- [x] Content-Editable / Textarea
- [x] Avatars, custom templates
-- [x] Vue3 / Vue2 / Vue1
+- [x] Vite / Vue3 / Vue2 / Vue1
- [x] Vuetify / Element UI / Element Plus
-- [ ] Vue-CLI migration
-- [ ] Vite migration
+- [x] CommonJS / UMD Support
See also: [react-at](https://github.com/fritx/react-at)
-## Motivation
-
-[At.js](https://github.com/ichord/At.js) is awesome, but:
-
-- It is based on jQuery and jQuery-Caret.
-- It introduces extra node wrappers.
-- It could be unstable on content edit/copy/paste.
-
-Finally I ended up creating this.
-
for Vue3, read [this one](https://github.com/fritx/vue-at/tree/vue3#readme) instead.
```plain
-npm i vue-at@next # for Vue3 (branch wip-vue3)
-
-npm i vue-at@2.x # for Vue2 <----
-npm i vue-at@1.x # for Vue1 (branch vue1-legacy)
-npm i vue1-at # for Vue1 (branch vue1-new)
+npm i -S vue-at@next # for Vue3 (branch vue3)
+npm i -S vue-at@2.x # for Vue2 (branch vue2)
+npm i -S vue-at@1.x # for Vue1 (branch vue1-legacy)
+npm i -S vue1-at # for Vue1 (branch vue1-new)
```
```vue
@@ -44,13 +32,17 @@ npm i vue1-at # for Vue1 (branch vue1-new)