diff --git a/.gitignore b/.gitignore
index c7f0539e..1831664f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@ node_modules/
npm-debug.log
coverage/
dist/
+.idea/
diff --git a/demo/package.json b/demo/package.json
index e9b37f94..b164c3d8 100644
--- a/demo/package.json
+++ b/demo/package.json
@@ -15,9 +15,11 @@
"vue-router": "^4.2.5"
},
"devDependencies": {
+ "@tsconfig/node22": "^22.0.0",
"@vitejs/plugin-vue": "^5.0.3",
"@vue/compiler-sfc": "^3.4.13",
"@vue/eslint-config-standard": "^8.0.1",
+ "@vue/tsconfig": "^0.7.0",
"autoprefixer": "^10.4.16",
"babel-eslint": "^10.1.0",
"eslint": "^8.56.0",
@@ -29,6 +31,10 @@
"eslint-plugin-vue": "^9.20.1",
"postcss": "^8.4.33",
"tailwindcss": "^3.4.1",
- "vite": "^5.0.11"
+ "unplugin-auto-import": "^19.2.0",
+ "unimport": "^5.0.1",
+ "vite": "^5.0.11",
+ "vue-tsc": "^2.2.10",
+ "typescript": "^5.1.3"
}
}
diff --git a/demo/src/views/directive/VTooltipDemo1.vue b/demo/src/views/directive/VTooltipDemo1.vue
index 5ca8a6b7..e178ca11 100644
--- a/demo/src/views/directive/VTooltipDemo1.vue
+++ b/demo/src/views/directive/VTooltipDemo1.vue
@@ -1,3 +1,6 @@
+
VTooltip Demo 1
diff --git a/demo/tsconfig.app.json b/demo/tsconfig.app.json
new file mode 100644
index 00000000..1e0cf793
--- /dev/null
+++ b/demo/tsconfig.app.json
@@ -0,0 +1,15 @@
+{
+ "extends": "@vue/tsconfig/tsconfig.dom.json",
+ "compilerOptions": {
+ "composite": true,
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
+
+ "baseUrl": ".",
+ "paths": {
+ "floating-vue/directives": ["../packages/floating-vue/src/directives.ts"],
+ "floating-vue": ["../packages/floating-vue/src/index.ts"]
+ }
+ },
+ "include": ["*.d.ts", "src/**/*", "src/**/*.vue"],
+ "exclude": ["src/**/__tests__/*"]
+}
diff --git a/demo/tsconfig.json b/demo/tsconfig.json
new file mode 100644
index 00000000..d85c910c
--- /dev/null
+++ b/demo/tsconfig.json
@@ -0,0 +1,11 @@
+{
+ "references": [
+ {
+ "path": "./tsconfig.node.json"
+ },
+ {
+ "path": "./tsconfig.app.json"
+ }
+ ],
+ "files": []
+}
diff --git a/demo/tsconfig.node.json b/demo/tsconfig.node.json
new file mode 100644
index 00000000..dc244f0a
--- /dev/null
+++ b/demo/tsconfig.node.json
@@ -0,0 +1,24 @@
+{
+ "extends": "@tsconfig/node22/tsconfig.json",
+ "compilerOptions": {
+ "composite": true,
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
+
+ "baseUrl": ".",
+ "module": "ESNext",
+ "moduleResolution": "Bundler",
+ "types": ["node"],
+ "paths": {
+ "floating-vue/directives": ["../packages/floating-vue/src/directives.ts"],
+ "floating-vue": ["../packages/floating-vue/src/index.ts"]
+ },
+ "noEmit": true
+ },
+ "include": [
+ "vite.config.*",
+ "vitest.config.*",
+ "cypress.config.*",
+ "nightwatch.conf.*",
+ "playwright.config.*"
+ ]
+}
diff --git a/demo/vite.config.ts b/demo/vite.config.ts
index 7c660f58..ec2b551e 100644
--- a/demo/vite.config.ts
+++ b/demo/vite.config.ts
@@ -1,8 +1,30 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
+import AutoImport from 'unplugin-auto-import/vite'
+import { FloatingVueDirectives } from 'floating-vue/unimport-presets'
+import { resolve } from 'node:path'
export default defineConfig({
+ resolve: {
+ alias: {
+ 'floating-vue/style.css': resolve('./node_modules/floating-vue/dist/style.css'),
+ 'floating-vue/dist/style.css': resolve('./node_modules/floating-vue/dist/style.css'),
+ 'floating-vue/components': resolve('./node_modules/floating-vue/components.mjs'),
+ 'floating-vue/directives': resolve('./node_modules/floating-vue/directives.mjs'),
+ 'floating-vue': resolve('./node_modules/floating-vue/dist/index.mjs'),
+ }
+ },
+ define: {
+ 'VERSION': JSON.stringify('0.0.0'),
+ },
plugins: [
vue(),
+ AutoImport({
+ imports: [
+ FloatingVueDirectives(),
+ ],
+ dts: true,
+ vueDirectives: true,
+ })
],
})
diff --git a/docs/.vitepress/components/theme-editor/ConfigEditor.vue b/docs/.vitepress/components/theme-editor/ConfigEditor.vue
index ab18cec9..d699d5fe 100644
--- a/docs/.vitepress/components/theme-editor/ConfigEditor.vue
+++ b/docs/.vitepress/components/theme-editor/ConfigEditor.vue
@@ -1,7 +1,7 @@