@witchcraft/editor 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "witchcraftEditor",
3
3
  "configKey": "witchcraftEditor",
4
- "version": "0.0.4",
4
+ "version": "0.0.6",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "unknown"
package/dist/module.mjs CHANGED
@@ -3,11 +3,6 @@ import { createResolver, defineNuxtModule, addComponentsDir, addImportsDir, addT
3
3
  import { defu } from 'defu';
4
4
  import fs from 'node:fs/promises';
5
5
 
6
- const dependencies = {
7
- "@witchcraft/ui": "^0.3.2"};
8
- const pkg = {
9
- dependencies: dependencies};
10
-
11
6
  const { resolve } = createResolver(import.meta.url);
12
7
  const module = defineNuxtModule({
13
8
  meta: {
@@ -19,7 +14,7 @@ const module = defineNuxtModule({
19
14
  },
20
15
  moduleDependencies: {
21
16
  "@witchcraft/ui/nuxt": {
22
- version: pkg.dependencies["@witchcraft/ui"]
17
+ version: "^0.3.2"
23
18
  }
24
19
  },
25
20
  async setup(options, nuxt) {
@@ -148,7 +148,7 @@
148
148
  :style="`
149
149
  left:${dropIndicator.x}px;
150
150
  top:calc(${dropIndicator.y}px ${dropIndicator.type !== 'before' ? `- (var(--pmDragDropIndicatorHeight, 5px))` : ''});
151
- width:${dropIndicator.width - dropIndicator.x}px;
151
+ width:calc(${dropIndicator.width}px);
152
152
  `"
153
153
  />
154
154
  </Teleport>
@@ -26,7 +26,7 @@
26
26
  contenteditable="false"
27
27
  >
28
28
  <div
29
- class="bg-neutral-100 dark:bg-neutral-900 flex p-1 gap-2 no-wrap justify-between align-center"
29
+ class="bg-neutral-100 dark:bg-neutral-900 flex p-1 gap-2 no-wrap justify-between items-center"
30
30
  contenteditable="false"
31
31
  >
32
32
  <div
@@ -11,12 +11,12 @@ export interface DropIndicator extends Point {
11
11
  export declare function createDropIndicator(
12
12
  /** The drop point information object. */
13
13
  dropInfo: DropInfo,
14
- /** The bounding rectangle of the element being dragged over. */
14
+ /** The bounding rectangle of the element being dragged over. It will be used for positioning the indicator and constraining it's width `(target.x < indicator < target.right)`. */
15
15
  targetRect: DOMRect,
16
16
  /**
17
- * The indentation of the dragged item.
17
+ * Determines the additional indentation to add when indicating a child drop operation. You normally want this to be the indentation of the dragged item.
18
18
  *
19
- * Can be gotten with {@link getElPropertyAsInt}
19
+ * Can be gotten with {@link getElPropertyAsInt}, see it for details.
20
20
  */
21
21
  indentX: number,
22
22
  /** Maximum width of the drop indicator. See {@link getElMaxVisualSize}. */
@@ -28,5 +28,9 @@ export function createDropIndicator(dropInfo, targetRect, indentX, maxWidth) {
28
28
  };
29
29
  }
30
30
  }
31
+ const rightDiff = dropIndicator.x + dropIndicator.width - targetRect.right;
32
+ if (rightDiff > 0) {
33
+ dropIndicator.width -= rightDiff;
34
+ }
31
35
  return dropIndicator;
32
36
  }
@@ -1 +1,4 @@
1
+ /**
2
+ * Returns any **pixel** css property as an integer.
3
+ */
1
4
  export declare function getElPropertyAsInt(el: HTMLElement, prop: string): number;
package/package.json CHANGED
@@ -1,237 +1,229 @@
1
1
  {
2
- "name": "@witchcraft/editor",
3
- "description": "Block base prosemirror editor with partial/full editable document embeds, infinite embeds, and document uploads.",
4
- "version": "0.0.4",
5
- "main": "./dist/runtime/main.lib.js",
6
- "type": "module",
7
- "sideEffects": false,
8
- "exports": {
9
- ".": {
10
- "types": "./dist/runtime/main.lib.d.ts",
11
- "import": "./dist/runtime/main.lib.js"
12
- },
13
- "./*": {
14
- "types": "./dist/runtime/*.d.ts",
15
- "import": "./dist/runtime/*.js"
16
- },
17
- "./assets/*": {
18
- "import": "./dist/runtime/assets/*"
19
- },
20
- "./components/*": {
21
- "types": "./dist/runtime/components/*/*.vue.d.ts",
22
- "import": "./dist/runtime/components/*/*.vue"
23
- },
24
- "./composables/*": {
25
- "types": "./dist/runtime/composables/*.d.ts",
26
- "import": "./dist/runtime/composables/*.js"
27
- },
28
- "./pm/features/Blocks/components/*": {
29
- "types": "./dist/runtime/pm/features/Blocks/components/*.vue.d.ts",
30
- "import": "./dist/runtime/pm/features/Blocks/components/*.vue"
31
- },
32
- "./pm/features/CodeBlock/components/*": {
33
- "types": "./dist/runtime/pm/features/CodeBlock/components/*.vue.d.ts",
34
- "import": "./dist/runtime/pm/features/CodeBlock/components/*.vue"
35
- },
36
- "./pm/features/EmbeddedDocument/components/*": {
37
- "types": "./dist/runtime/pm/features/EmbeddedDocument/components/*.vue.d.ts",
38
- "import": "./dist/runtime/pm/features/EmbeddedDocument/components/*.vue"
39
- },
40
- "./pm/features/FileLoader/components/*": {
41
- "types": "./dist/runtime/pm/features/FileLoader/components/*.vue.d.ts",
42
- "import": "./dist/runtime/pm/features/FileLoader/components/*.vue"
43
- },
44
- "./pm/features/Iframe/components/*": {
45
- "types": "./dist/runtime/pm/features/Iframe/components/*.vue.d.ts",
46
- "import": "./dist/runtime/pm/features/Iframe/components/*.vue"
47
- },
48
- "./pm/features/Menus/components/*": {
49
- "types": "./dist/runtime/pm/features/Menus/components/*.vue.d.ts",
50
- "import": "./dist/runtime/pm/features/Menus/components/*.vue"
51
- },
52
- "./pm/*": {
53
- "types": "./dist/runtime/pm/*.d.ts",
54
- "import": "./dist/runtime/pm/*.js"
55
- },
56
- "./nuxt": {
57
- "import": "./dist/module.mjs"
58
- },
59
- "./base.css": "./src/runtime/assets/base.css",
60
- "./utils.css": "./src/runtime/assets/utils.css",
61
- "./@types/*": "./@types/*"
62
- },
63
- "unbuild": {
64
- "failOnWarn": false
65
- },
66
- "scripts": {
67
- "prepare": "husky && pnpm nuxt-module-build prepare && pnpm build:only && cd playground && pnpm i --ignore-scripts --ignore-workspace",
68
- "build:only": "nuxt-module-build build",
69
- "build": "pnpm gen:highlightJsLangInfo && nuxt-module-build prepare && nuxt-module-build build && nuxi generate playground",
70
- "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
71
- "dev": "nuxi dev playground",
72
- "//dev:vite": "The module needs to be build, not stubbed, for vite's dev to work.",
73
- "dev:vite": "concurrently \"pnpm build\" \"vite --mode development --config vite.config.ts\"",
74
- "lint:eslint": "eslint \"{src,tests,playground/app}/**/*.{cjs,js,ts,vue}\" \"*.{cjs,js,ts}\" --max-warnings=0 --report-unused-disable-directives",
75
- "lint:commits": "commitlint --from-last-tag --to HEAD --verbose",
76
- "lint:imports": "echo not working madge --circular --extensions ts ./src",
77
- "lint": "pnpm lint:eslint && pnpm lint:types && pnpm lint:commits && pnpm lint:imports",
78
- "lint:types": "vue-tsc --noEmit",
79
- "test": "vitest",
80
- "test:watch": "vitest --watch",
81
- "doc": "typedoc",
82
- "doc:watch": "onchange -i \"src/**/*.ts\" \"typedoc.config.js\" -- pnpm doc",
83
- "doc:serve": "http-server docs --port=5001",
84
- "doc:dev": "concurrently \"pnpm doc:watch\" \"pnpm doc:serve\"",
85
- "doc:check-invalid": "typedoc --listInvalidSymbolLinks",
86
- "//actions:debug": "echo For debugging github build action locally with nektos/act. Requires act and docker. Note: Cache will never work locally because of https://github.com/nektos/act/issues/285",
87
- "actions:debug": "act -r -v -j release",
88
- "gen:highlightJsLangInfo": "node src/runtime/pm/features/CodeBlock/build/generateHighlightJsInfo.js"
89
- },
90
- "pnpm": {
91
- "overrides": {
92
- "@tiptap/pm": "^3.4.2",
93
- "@tiptap/vue-3": "^3.4.2",
94
- "@tiptap/core": "^3.4.2"
95
- }
96
- },
97
- "peerDependencies": {
98
- "@tiptap/core": "^3.4.2",
99
- "@tiptap/extension-blockquote": "^3.4.2",
100
- "@tiptap/extension-bold": "^3.4.2",
101
- "@tiptap/extension-code": "^3.4.2",
102
- "@tiptap/extension-code-block": "^3.4.2",
103
- "@tiptap/extension-code-block-lowlight": "^3.4.2",
104
- "@tiptap/extension-dropcursor": "^3.4.2",
105
- "@tiptap/extension-gapcursor": "^3.4.2",
106
- "@tiptap/extension-hard-break": "^3.4.2",
107
- "@tiptap/extension-heading": "^3.4.2",
108
- "@tiptap/extension-highlight": "^3.4.2",
109
- "@tiptap/extension-history": "^3.4.2",
110
- "@tiptap/extension-image": "^3.4.2",
111
- "@tiptap/extension-italic": "^3.4.2",
112
- "@tiptap/extension-link": "^3.4.2",
113
- "@tiptap/extension-paragraph": "^3.4.2",
114
- "@tiptap/extension-strike": "^3.4.2",
115
- "@tiptap/extension-subscript": "^3.4.2",
116
- "@tiptap/extension-superscript": "^3.4.2",
117
- "@tiptap/extension-table": "^3.4.2",
118
- "@tiptap/extension-table-cell": "^3.4.2",
119
- "@tiptap/extension-table-header": "^3.4.2",
120
- "@tiptap/extension-table-row": "^3.4.2",
121
- "@tiptap/extension-text": "^3.4.2",
122
- "@tiptap/extension-underline": "^3.4.2",
123
- "@tiptap/pm": "^3.4.2",
124
- "@tiptap/vue-3": "^3.4.2",
125
- "@witchcraft/ui": "^0.3.2",
126
- "tailwindcss": "^4.0.0",
127
- "vue": "^3.2.47"
128
- },
129
- "peerDependenciesMeta": {
130
- "@witchcraft/ui": {
131
- "optional": false
132
- },
133
- "tailwindcss": {
134
- "optional": false
135
- },
136
- "vue": {
137
- "optional": false
138
- }
139
- },
140
- "dependencies": {
141
- "@alanscodelog/eslint-config": "^6.3.1",
142
- "@alanscodelog/utils": "^6.0.2",
143
- "@commitlint/cli": "^19.8.1",
144
- "@fortawesome/fontawesome-svg-core": "^7.0.1",
145
- "@fortawesome/free-brands-svg-icons": "^7.0.1",
146
- "@fortawesome/free-regular-svg-icons": "^7.0.1",
147
- "@fortawesome/free-solid-svg-icons": "^7.0.1",
148
- "@nuxt/eslint-config": "^1.9.0",
149
- "@witchcraft/nuxt-utils": "^0.3.2",
150
- "@witchcraft/ui": "^0.3.2",
151
- "colord": "^2.9.3",
152
- "defu": "^6.1.4",
153
- "highlight.js": "^11.11.1",
154
- "lowlight": "^3.3.0",
155
- "metamorphosis": "^0.6.1",
156
- "mime": "^4.1.0",
157
- "nanoid": "^5.1.5",
158
- "reka-ui": "^2.5.0",
159
- "tailwind-merge": "^3.3.1",
160
- "unplugin-vue-components": "^29.1.0",
161
- "uuid": "^13.0.0",
162
- "y-prosemirror": "^1.3.7",
163
- "yjs": "^13.6.27"
164
- },
165
- "devDependencies": {
166
- "@alanscodelog/commitlint-config": "^3.1.2",
167
- "@alanscodelog/semantic-release-config": "^5.0.4",
168
- "@alanscodelog/tsconfigs": "^6.2.0",
169
- "@alanscodelog/vite-config": "^0.0.6",
170
- "@iconify/json": "^2.2.385",
171
- "@nuxt/kit": "^4.1.2",
172
- "@nuxt/module-builder": "^1.0.2",
173
- "@nuxt/schema": "^4.1.2",
174
- "@nuxt/types": "^2.18.1",
175
- "@playwright/test": "^1.54.0",
176
- "@rollup/plugin-dynamic-import-vars": "^2.1.5",
177
- "@tailwindcss/cli": "^4.1.13",
178
- "@tailwindcss/vite": "^4.1.13",
179
- "@testing-library/vue": "^8.1.0",
180
- "@types/node": "^24.5.1",
181
- "@vitejs/plugin-vue": "^6.0.1",
182
- "@vitest/browser": "^3.2.4",
183
- "@vitest/coverage-v8": "^3.2.4",
184
- "@witchcraft/ui": "^0.3.2",
185
- "concurrently": "^9.2.1",
186
- "cross-env": "^10.0.0",
187
- "eslint": "^9.35.0",
188
- "fast-glob": "^3.3.3",
189
- "http-server": "^14.1.1",
190
- "husky": "^9.1.7",
191
- "madge": "^8.0.0",
192
- "nuxt": "^4.1.2",
193
- "onchange": "^7.1.0",
194
- "playwright": "^1.54.0",
195
- "playwright-core": "^1.54.0",
196
- "prosemirror-test-builder": "^1.1.1",
197
- "radix-vue": "^1.9.17",
198
- "semantic-release": "^24.2.8",
199
- "tailwindcss": "^4.1.13",
200
- "typedoc": "^0.28.13",
201
- "typescript": "~5.9.2",
202
- "unplugin-icons": "^22.3.0",
203
- "vite": "^7.1.5",
204
- "vitest": "^3.2.4",
205
- "vue": "^3.5.21",
206
- "vue-component-type-helpers": "^3.0.7",
207
- "vue-tsc": "^2.2.12"
208
- },
209
- "author": "Alan <alanscodelog@gmail.com>",
210
- "repository": "https://github.com/witchcraftjs/editor",
211
- "license": "MIT",
212
- "files": [
213
- "src",
214
- "dist",
215
- "@types"
216
- ],
217
- "release": {
218
- "extends": [
219
- "@alanscodelog/semantic-release-config"
220
- ]
221
- },
222
- "commitlint": {
223
- "extends": [
224
- "@alanscodelog"
225
- ]
226
- },
227
- "browserslist": "defaults and supports es6-module,maintained node versions",
228
- "engines": {
229
- "node": ">=20.0.0"
230
- },
231
- "@comments": {
232
- "vue-tsc": "Do not upgrade to 3.0, #awaiting https://github.com/vuejs/language-tools/issues/5644"
233
- },
234
- "publishConfig": {
235
- "access": "public"
236
- }
237
- }
2
+ "name": "@witchcraft/editor",
3
+ "description": "Block base prosemirror editor with partial/full editable document embeds, infinite embeds, and document uploads.",
4
+ "version": "0.0.6",
5
+ "main": "./dist/runtime/main.lib.js",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/runtime/main.lib.d.ts",
11
+ "import": "./dist/runtime/main.lib.js"
12
+ },
13
+ "./*": {
14
+ "types": "./dist/runtime/*.d.ts",
15
+ "import": "./dist/runtime/*.js"
16
+ },
17
+ "./assets/*": {
18
+ "import": "./dist/runtime/assets/*"
19
+ },
20
+ "./components/*": {
21
+ "types": "./dist/runtime/components/*/*.vue.d.ts",
22
+ "import": "./dist/runtime/components/*/*.vue"
23
+ },
24
+ "./composables/*": {
25
+ "types": "./dist/runtime/composables/*.d.ts",
26
+ "import": "./dist/runtime/composables/*.js"
27
+ },
28
+ "./pm/features/Blocks/components/*": {
29
+ "types": "./dist/runtime/pm/features/Blocks/components/*.vue.d.ts",
30
+ "import": "./dist/runtime/pm/features/Blocks/components/*.vue"
31
+ },
32
+ "./pm/features/CodeBlock/components/*": {
33
+ "types": "./dist/runtime/pm/features/CodeBlock/components/*.vue.d.ts",
34
+ "import": "./dist/runtime/pm/features/CodeBlock/components/*.vue"
35
+ },
36
+ "./pm/features/EmbeddedDocument/components/*": {
37
+ "types": "./dist/runtime/pm/features/EmbeddedDocument/components/*.vue.d.ts",
38
+ "import": "./dist/runtime/pm/features/EmbeddedDocument/components/*.vue"
39
+ },
40
+ "./pm/features/FileLoader/components/*": {
41
+ "types": "./dist/runtime/pm/features/FileLoader/components/*.vue.d.ts",
42
+ "import": "./dist/runtime/pm/features/FileLoader/components/*.vue"
43
+ },
44
+ "./pm/features/Iframe/components/*": {
45
+ "types": "./dist/runtime/pm/features/Iframe/components/*.vue.d.ts",
46
+ "import": "./dist/runtime/pm/features/Iframe/components/*.vue"
47
+ },
48
+ "./pm/features/Menus/components/*": {
49
+ "types": "./dist/runtime/pm/features/Menus/components/*.vue.d.ts",
50
+ "import": "./dist/runtime/pm/features/Menus/components/*.vue"
51
+ },
52
+ "./pm/*": {
53
+ "types": "./dist/runtime/pm/*.d.ts",
54
+ "import": "./dist/runtime/pm/*.js"
55
+ },
56
+ "./nuxt": {
57
+ "import": "./dist/module.mjs"
58
+ },
59
+ "./base.css": "./src/runtime/assets/base.css",
60
+ "./utils.css": "./src/runtime/assets/utils.css",
61
+ "./@types/*": "./@types/*"
62
+ },
63
+ "unbuild": {
64
+ "failOnWarn": false
65
+ },
66
+ "peerDependencies": {
67
+ "@tiptap/core": "^3.4.2",
68
+ "@tiptap/extension-blockquote": "^3.4.2",
69
+ "@tiptap/extension-bold": "^3.4.2",
70
+ "@tiptap/extension-code": "^3.4.2",
71
+ "@tiptap/extension-code-block": "^3.4.2",
72
+ "@tiptap/extension-code-block-lowlight": "^3.4.2",
73
+ "@tiptap/extension-dropcursor": "^3.4.2",
74
+ "@tiptap/extension-gapcursor": "^3.4.2",
75
+ "@tiptap/extension-hard-break": "^3.4.2",
76
+ "@tiptap/extension-heading": "^3.4.2",
77
+ "@tiptap/extension-highlight": "^3.4.2",
78
+ "@tiptap/extension-history": "^3.4.2",
79
+ "@tiptap/extension-image": "^3.4.2",
80
+ "@tiptap/extension-italic": "^3.4.2",
81
+ "@tiptap/extension-link": "^3.4.2",
82
+ "@tiptap/extension-paragraph": "^3.4.2",
83
+ "@tiptap/extension-strike": "^3.4.2",
84
+ "@tiptap/extension-subscript": "^3.4.2",
85
+ "@tiptap/extension-superscript": "^3.4.2",
86
+ "@tiptap/extension-table": "^3.4.2",
87
+ "@tiptap/extension-table-cell": "^3.4.2",
88
+ "@tiptap/extension-table-header": "^3.4.2",
89
+ "@tiptap/extension-table-row": "^3.4.2",
90
+ "@tiptap/extension-text": "^3.4.2",
91
+ "@tiptap/extension-underline": "^3.4.2",
92
+ "@tiptap/pm": "^3.4.2",
93
+ "@tiptap/vue-3": "^3.4.2",
94
+ "@witchcraft/ui": "^0.3.7",
95
+ "tailwindcss": "^4.1.13",
96
+ "vue": "^3.5.21"
97
+ },
98
+ "peerDependenciesMeta": {
99
+ "@witchcraft/ui": {
100
+ "optional": false
101
+ },
102
+ "tailwindcss": {
103
+ "optional": false
104
+ },
105
+ "vue": {
106
+ "optional": false
107
+ }
108
+ },
109
+ "dependencies": {
110
+ "@alanscodelog/eslint-config": "^6.3.1",
111
+ "@alanscodelog/utils": "^6.0.2",
112
+ "@commitlint/cli": "^19.8.1",
113
+ "@fortawesome/fontawesome-svg-core": "^7.0.1",
114
+ "@fortawesome/free-brands-svg-icons": "^7.0.1",
115
+ "@fortawesome/free-regular-svg-icons": "^7.0.1",
116
+ "@fortawesome/free-solid-svg-icons": "^7.0.1",
117
+ "@nuxt/eslint-config": "^1.9.0",
118
+ "@witchcraft/nuxt-utils": "^0.3.6",
119
+ "@witchcraft/ui": "^0.3.7",
120
+ "colord": "^2.9.3",
121
+ "defu": "^6.1.4",
122
+ "highlight.js": "^11.11.1",
123
+ "lowlight": "^3.3.0",
124
+ "metamorphosis": "^0.6.1",
125
+ "mime": "^4.1.0",
126
+ "nanoid": "^5.1.5",
127
+ "reka-ui": "^2.5.0",
128
+ "tailwind-merge": "^3.3.1",
129
+ "unplugin-vue-components": "^29.1.0",
130
+ "uuid": "^13.0.0",
131
+ "y-prosemirror": "^1.3.7",
132
+ "yjs": "^13.6.27"
133
+ },
134
+ "devDependencies": {
135
+ "@alanscodelog/commitlint-config": "^3.1.2",
136
+ "@alanscodelog/semantic-release-config": "^6.0.0",
137
+ "@alanscodelog/tsconfigs": "^6.2.0",
138
+ "@alanscodelog/vite-config": "^0.0.6",
139
+ "@iconify/json": "^2.2.385",
140
+ "@nuxt/kit": "^4.1.2",
141
+ "@nuxt/module-builder": "^1.0.2",
142
+ "@nuxt/schema": "^4.1.2",
143
+ "@nuxt/types": "^2.18.1",
144
+ "@playwright/test": "^1.54.0",
145
+ "@rollup/plugin-dynamic-import-vars": "^2.1.5",
146
+ "@tailwindcss/cli": "^4.1.13",
147
+ "@tailwindcss/vite": "^4.1.13",
148
+ "@testing-library/vue": "^8.1.0",
149
+ "@types/node": "^24.5.1",
150
+ "@vitejs/plugin-vue": "^6.0.1",
151
+ "@vitest/browser": "^3.2.4",
152
+ "@vitest/coverage-v8": "^3.2.4",
153
+ "@witchcraft/ui": "^0.3.7",
154
+ "concurrently": "^9.2.1",
155
+ "cross-env": "^10.0.0",
156
+ "eslint": "^9.35.0",
157
+ "fast-glob": "^3.3.3",
158
+ "http-server": "^14.1.1",
159
+ "husky": "^9.1.7",
160
+ "madge": "^8.0.0",
161
+ "nuxt": "^4.1.2",
162
+ "onchange": "^7.1.0",
163
+ "playwright": "^1.54.0",
164
+ "playwright-core": "^1.54.0",
165
+ "prosemirror-test-builder": "^1.1.1",
166
+ "radix-vue": "^1.9.17",
167
+ "semantic-release": "^24.2.8",
168
+ "tailwindcss": "^4.1.13",
169
+ "typedoc": "^0.28.13",
170
+ "typescript": "~5.9.2",
171
+ "unplugin-icons": "^22.3.0",
172
+ "vite": "^7.1.5",
173
+ "vitest": "^3.2.4",
174
+ "vue": "^3.5.21",
175
+ "vue-component-type-helpers": "^3.0.7",
176
+ "vue-tsc": "^2.2.12"
177
+ },
178
+ "author": "Alan <alanscodelog@gmail.com>",
179
+ "repository": "https://github.com/witchcraftjs/editor",
180
+ "license": "MIT",
181
+ "files": [
182
+ "src",
183
+ "dist",
184
+ "@types"
185
+ ],
186
+ "release": {
187
+ "extends": [
188
+ "@alanscodelog/semantic-release-config"
189
+ ]
190
+ },
191
+ "commitlint": {
192
+ "extends": [
193
+ "@alanscodelog"
194
+ ]
195
+ },
196
+ "browserslist": "defaults and supports es6-module,maintained node versions",
197
+ "engines": {
198
+ "node": ">=20.0.0"
199
+ },
200
+ "@comments": {
201
+ "vue-tsc": "Do not upgrade to 3.0, #awaiting https://github.com/vuejs/language-tools/issues/5644"
202
+ },
203
+ "publishConfig": {
204
+ "access": "public"
205
+ },
206
+ "scripts": {
207
+ "build:only": "nuxt-module-build build",
208
+ "build": "pnpm gen:highlightJsLangInfo && nuxt-module-build prepare && nuxt-module-build build && nuxi generate playground",
209
+ "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
210
+ "dev": "nuxi dev playground",
211
+ "//dev:vite": "The module needs to be build, not stubbed, for vite's dev to work.",
212
+ "dev:vite": "concurrently \"pnpm build\" \"vite --mode development --config vite.config.ts\"",
213
+ "lint:eslint": "eslint \"{src,tests,playground/app}/**/*.{cjs,js,ts,vue}\" \"*.{cjs,js,ts}\" --max-warnings=0 --report-unused-disable-directives",
214
+ "lint:commits": "commitlint --from-last-tag --to HEAD --verbose",
215
+ "lint:imports": "echo not working madge --circular --extensions ts ./src",
216
+ "lint": "pnpm lint:eslint && pnpm lint:types && pnpm lint:commits && pnpm lint:imports",
217
+ "lint:types": "vue-tsc --noEmit",
218
+ "test": "vitest",
219
+ "test:watch": "vitest --watch",
220
+ "doc": "typedoc",
221
+ "doc:watch": "onchange -i \"src/**/*.ts\" \"typedoc.config.js\" -- pnpm doc",
222
+ "doc:serve": "http-server docs --port=5001",
223
+ "doc:dev": "concurrently \"pnpm doc:watch\" \"pnpm doc:serve\"",
224
+ "doc:check-invalid": "typedoc --listInvalidSymbolLinks",
225
+ "//actions:debug": "echo For debugging github build action locally with nektos/act. Requires act and docker. Note: Cache will never work locally because of https://github.com/nektos/act/issues/285",
226
+ "actions:debug": "act -r -v -j release",
227
+ "gen:highlightJsLangInfo": "node src/runtime/pm/features/CodeBlock/build/generateHighlightJsInfo.js"
228
+ }
229
+ }
package/src/module.ts CHANGED
@@ -9,7 +9,6 @@ import {
9
9
  import { defu } from "defu"
10
10
  import fs from "node:fs/promises"
11
11
 
12
- import pkg from "../package.json" with { type: "json" }
13
12
 
14
13
  const { resolve } = createResolver(import.meta.url)
15
14
 
@@ -35,7 +34,7 @@ export default defineNuxtModule<ModuleOptions>({
35
34
  },
36
35
  moduleDependencies: {
37
36
  "@witchcraft/ui/nuxt": {
38
- version: pkg.dependencies["@witchcraft/ui"]
37
+ version: "^0.3.2"
39
38
  }
40
39
  },
41
40
  async setup(options, nuxt) {
File without changes
File without changes
@@ -148,7 +148,7 @@
148
148
  :style="`
149
149
  left:${dropIndicator.x}px;
150
150
  top:calc(${dropIndicator.y}px ${dropIndicator.type !== 'before' ? `- (var(--pmDragDropIndicatorHeight, 5px))` : ''});
151
- width:${dropIndicator.width - dropIndicator.x}px;
151
+ width:calc(${dropIndicator.width}px);
152
152
  `"
153
153
  />
154
154
  </Teleport>
@@ -26,7 +26,7 @@
26
26
  contenteditable="false"
27
27
  >
28
28
  <div
29
- class="bg-neutral-100 dark:bg-neutral-900 flex p-1 gap-2 no-wrap justify-between align-center"
29
+ class="bg-neutral-100 dark:bg-neutral-900 flex p-1 gap-2 no-wrap justify-between items-center"
30
30
  contenteditable="false"
31
31
  >
32
32
  <div
File without changes
@@ -15,12 +15,12 @@ export interface DropIndicator extends Point {
15
15
  export function createDropIndicator(
16
16
  /** The drop point information object. */
17
17
  dropInfo: DropInfo,
18
- /** The bounding rectangle of the element being dragged over. */
18
+ /** The bounding rectangle of the element being dragged over. It will be used for positioning the indicator and constraining it's width `(target.x < indicator < target.right)`. */
19
19
  targetRect: DOMRect,
20
20
  /**
21
- * The indentation of the dragged item.
21
+ * Determines the additional indentation to add when indicating a child drop operation. You normally want this to be the indentation of the dragged item.
22
22
  *
23
- * Can be gotten with {@link getElPropertyAsInt}
23
+ * Can be gotten with {@link getElPropertyAsInt}, see it for details.
24
24
  */
25
25
  indentX: number,
26
26
  /** Maximum width of the drop indicator. See {@link getElMaxVisualSize}. */
@@ -57,5 +57,11 @@ export function createDropIndicator(
57
57
  }
58
58
  }
59
59
  }
60
+
61
+ const rightDiff = (dropIndicator.x + dropIndicator.width) - (targetRect.right)
62
+
63
+ if (rightDiff > 0) {
64
+ dropIndicator.width -= rightDiff
65
+ }
60
66
  return dropIndicator
61
67
  }
@@ -1,4 +1,7 @@
1
1
  const pxRegex = /([0-9.]+)px/g
2
+ /**
3
+ * Returns any **pixel** css property as an integer.
4
+ */
2
5
  export function getElPropertyAsInt(el: HTMLElement, prop: string): number {
3
6
  const value = window.getComputedStyle(el).getPropertyValue(prop)
4
7
  if (!pxRegex.test(value)) {
File without changes
File without changes