@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 +1 -1
- package/dist/module.mjs +1 -6
- package/dist/runtime/pm/features/Blocks/components/ItemNodeView.vue +1 -1
- package/dist/runtime/pm/features/EmbeddedDocument/components/EmbeddedNodeView.vue +1 -1
- package/dist/runtime/pm/utils/createDropIndicator.d.ts +3 -3
- package/dist/runtime/pm/utils/createDropIndicator.js +4 -0
- package/dist/runtime/pm/utils/getElPropertyAsInt.d.ts +3 -0
- package/package.json +228 -236
- package/src/module.ts +1 -2
- package/src/runtime/assets/handle-border-circles.svg +0 -0
- package/src/runtime/components/Editor.vue +0 -0
- package/src/runtime/pm/features/Blocks/components/ItemNodeView.vue +1 -1
- package/src/runtime/pm/features/EmbeddedDocument/components/EmbeddedNodeView.vue +1 -1
- package/src/runtime/pm/schema.ts +0 -0
- package/src/runtime/pm/utils/createDropIndicator.ts +9 -3
- package/src/runtime/pm/utils/getElPropertyAsInt.ts +3 -0
- package/src/runtime/pm/utils/internal/debugSel.ts +0 -0
- package/src/runtime/pm/utils/internal/recurse.ts +0 -0
package/dist/module.json
CHANGED
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:
|
|
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
|
|
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
|
|
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
|
-
*
|
|
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
|
}
|
package/package.json
CHANGED
|
@@ -1,237 +1,229 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
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:
|
|
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
|
|
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
|
|
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
|
package/src/runtime/pm/schema.ts
CHANGED
|
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
|
-
*
|
|
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
|