@harbour-enterprises/superdoc 0.21.0 → 0.22.0-next.10
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/chunks/{PdfViewer-D3zo7tPo.es.js → PdfViewer-CJdQmuIm.es.js} +1 -1
- package/dist/chunks/{PdfViewer-OZDJ7gwT.cjs → PdfViewer-DE1NR4Ve.cjs} +1 -1
- package/dist/chunks/{index-MzW5BVNd.es.js → index-B9sHxXr_.es.js} +55 -27
- package/dist/chunks/{index-CfYf4T_z.cjs → index-nfoifSpX.cjs} +55 -27
- package/dist/chunks/{super-editor.es-U-GVCd_F.cjs → super-editor.es-DAP-fnHo.cjs} +3469 -2438
- package/dist/chunks/{super-editor.es-Bntob7Wd.es.js → super-editor.es-_iVPQ8J8.es.js} +3469 -2438
- package/dist/core/SuperDoc.d.ts +5 -0
- package/dist/core/SuperDoc.d.ts.map +1 -1
- package/dist/core/types/index.d.ts +12 -4
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/stores/comments-store.d.ts +4 -1
- package/dist/stores/comments-store.d.ts.map +1 -1
- package/dist/style.css +53 -44
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-3xnF_NHq.js → converter-DK1NMJZB.js} +1148 -748
- package/dist/super-editor/chunks/{docx-zipper-CZdELYi-.js → docx-zipper-CmK8TyNb.js} +73 -12
- package/dist/super-editor/chunks/{editor-BqYH4kDD.js → editor-YR4uV-dp.js} +1917 -1606
- package/dist/super-editor/chunks/{toolbar-TkaE2kKM.js → toolbar-DzJyRvb0.js} +2 -2
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/src/components/slash-menu/menuItems.d.ts +5 -1
- package/dist/super-editor/src/components/slash-menu/tests/testHelpers.d.ts +466 -0
- package/dist/super-editor/src/components/slash-menu/utils.d.ts +9 -2
- package/dist/super-editor/src/core/DocxZipper.d.ts +1 -1
- package/dist/super-editor/src/core/commands/__tests__/schemaWithLists.d.ts +2 -0
- package/dist/super-editor/src/core/commands/__tests__/testHelpers.d.ts +4 -0
- package/dist/super-editor/src/core/commands/__tests__/testSchema.d.ts +2 -0
- package/dist/super-editor/src/core/commands/tests/commandTestUtils.d.ts +7 -0
- package/dist/super-editor/src/core/commands/tests/test-schema.d.ts +2 -0
- package/dist/super-editor/src/core/super-converter/SuperConverter.d.ts +1 -13
- package/dist/super-editor/src/core/super-converter/exporter.d.ts +1 -0
- package/dist/super-editor/src/core/super-converter/helpers/tableFallbackHelpers.d.ts +24 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/mc/altermateContent/alternate-content-translator.d.ts +6 -0
- package/dist/super-editor/src/core/super-converter/v3/handlers/mc/altermateContent/index.d.ts +1 -0
- package/dist/super-editor/src/extensions/custom-selection/custom-selection.d.ts +5 -0
- package/dist/super-editor/src/extensions/index.d.ts +2 -1
- package/dist/super-editor/src/extensions/structured-content/index.d.ts +1 -0
- package/dist/super-editor/src/extensions/structured-content/structured-content-commands.d.ts +67 -0
- package/dist/super-editor/src/extensions/structured-content/structuredContentHelpers/getStructuredContentBlockTags.d.ts +7 -0
- package/dist/super-editor/src/extensions/structured-content/structuredContentHelpers/getStructuredContentInlineTags.d.ts +7 -0
- package/dist/super-editor/src/extensions/structured-content/structuredContentHelpers/getStructuredContentTags.d.ts +7 -0
- package/dist/super-editor/src/extensions/structured-content/structuredContentHelpers/getStructuredContentTagsById.d.ts +8 -0
- package/dist/super-editor/src/extensions/structured-content/structuredContentHelpers/index.d.ts +4 -0
- package/dist/super-editor/src/tests/helpers/helpers.d.ts +1 -0
- package/dist/super-editor/src/utils/contextmenu-helpers.d.ts +24 -0
- package/dist/super-editor/style.css +9 -0
- package/dist/super-editor/super-editor.es.js +454 -154
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +2 -2
- package/dist/superdoc.umd.js +3528 -2469
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/super-editor/src/extensions/run-item/index.d.ts +0 -1
- package/dist/super-editor/src/extensions/run-item/run-item.d.ts +0 -26
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed, createElementBlock, openBlock, createElementVNode, createCommentVNode, normalizeClass, normalizeStyle, ref, withKeys, unref, withModifiers, createBlock, toDisplayString, withDirectives, vModelText, nextTick, getCurrentInstance, createVNode, readonly, watch, onMounted, onBeforeUnmount, reactive, onBeforeMount, inject, onActivated, onDeactivated, createTextVNode, Fragment, Comment, defineComponent, provide, h, Teleport, toRef, renderSlot, isVNode, shallowRef, watchEffect, mergeProps, Transition, vShow, cloneVNode, Text, renderList, withCtx } from "vue";
|
|
2
|
-
import { p as process$1 } from "./converter-
|
|
3
|
-
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-
|
|
2
|
+
import { p as process$1 } from "./converter-DK1NMJZB.js";
|
|
3
|
+
import { _ as _export_sfc, u as useHighContrastMode, g as global$1 } from "./editor-YR4uV-dp.js";
|
|
4
4
|
const sanitizeNumber = (value, defaultNumber) => {
|
|
5
5
|
let sanitized = value.replace(/[^0-9.]/g, "");
|
|
6
6
|
sanitized = parseFloat(sanitized);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E } from "./chunks/editor-
|
|
2
|
-
import "./chunks/converter-
|
|
3
|
-
import "./chunks/docx-zipper-
|
|
1
|
+
import { E } from "./chunks/editor-YR4uV-dp.js";
|
|
2
|
+
import "./chunks/converter-DK1NMJZB.js";
|
|
3
|
+
import "./chunks/docx-zipper-CmK8TyNb.js";
|
|
4
4
|
export {
|
|
5
5
|
E as Editor
|
|
6
6
|
};
|
|
@@ -14,7 +14,9 @@
|
|
|
14
14
|
* requiresClipboard?: boolean
|
|
15
15
|
* requiresTableParent?: boolean
|
|
16
16
|
* requiredSectionParent?: boolean,
|
|
17
|
-
* requiresModule?: string
|
|
17
|
+
* requiresModule?: string,
|
|
18
|
+
* render?: (context: Object) => HTMLElement,
|
|
19
|
+
* showWhen?: (context: Object) => boolean
|
|
18
20
|
* }>
|
|
19
21
|
* }>} Array of menu sections
|
|
20
22
|
*/
|
|
@@ -32,5 +34,7 @@ export function getItems(context: any): Array<{
|
|
|
32
34
|
requiresTableParent?: boolean;
|
|
33
35
|
requiredSectionParent?: boolean;
|
|
34
36
|
requiresModule?: string;
|
|
37
|
+
render?: (context: any) => HTMLElement;
|
|
38
|
+
showWhen?: (context: any) => boolean;
|
|
35
39
|
}>;
|
|
36
40
|
}>;
|
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test helper utilities for slash menu components
|
|
3
|
+
* Extracts shared patterns from utils.test.js, SlashMenu.test.js, and menuItems.test.js
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Creates a mock ProseMirror selection object with configurable properties
|
|
7
|
+
*/
|
|
8
|
+
export function createMockSelection(options?: {}): {
|
|
9
|
+
from: number;
|
|
10
|
+
to: number;
|
|
11
|
+
empty: boolean;
|
|
12
|
+
$head: {
|
|
13
|
+
marks: import("vitest").Mock<() => {
|
|
14
|
+
type: {
|
|
15
|
+
name: any;
|
|
16
|
+
};
|
|
17
|
+
}[]>;
|
|
18
|
+
};
|
|
19
|
+
$from: {
|
|
20
|
+
depth: number;
|
|
21
|
+
node: import("vitest").Mock<() => {
|
|
22
|
+
type: {
|
|
23
|
+
name: string;
|
|
24
|
+
};
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
$to: {
|
|
28
|
+
depth: number;
|
|
29
|
+
node: import("vitest").Mock<() => {
|
|
30
|
+
type: {
|
|
31
|
+
name: string;
|
|
32
|
+
};
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
constructor: {
|
|
36
|
+
near: import("vitest").Mock<() => {
|
|
37
|
+
from: number;
|
|
38
|
+
to: number;
|
|
39
|
+
}>;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Creates a mock ProseMirror state object with configurable properties
|
|
44
|
+
*/
|
|
45
|
+
export function createMockState(options?: {}): {
|
|
46
|
+
selection: {
|
|
47
|
+
from: number;
|
|
48
|
+
to: number;
|
|
49
|
+
empty: boolean;
|
|
50
|
+
$head: {
|
|
51
|
+
marks: import("vitest").Mock<() => {
|
|
52
|
+
type: {
|
|
53
|
+
name: any;
|
|
54
|
+
};
|
|
55
|
+
}[]>;
|
|
56
|
+
};
|
|
57
|
+
$from: {
|
|
58
|
+
depth: number;
|
|
59
|
+
node: import("vitest").Mock<() => {
|
|
60
|
+
type: {
|
|
61
|
+
name: string;
|
|
62
|
+
};
|
|
63
|
+
}>;
|
|
64
|
+
};
|
|
65
|
+
$to: {
|
|
66
|
+
depth: number;
|
|
67
|
+
node: import("vitest").Mock<() => {
|
|
68
|
+
type: {
|
|
69
|
+
name: string;
|
|
70
|
+
};
|
|
71
|
+
}>;
|
|
72
|
+
};
|
|
73
|
+
constructor: {
|
|
74
|
+
near: import("vitest").Mock<() => {
|
|
75
|
+
from: number;
|
|
76
|
+
to: number;
|
|
77
|
+
}>;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
doc: {
|
|
81
|
+
textBetween: import("vitest").Mock<() => string>;
|
|
82
|
+
nodeAt: import("vitest").Mock<() => {
|
|
83
|
+
type: {
|
|
84
|
+
name: string;
|
|
85
|
+
};
|
|
86
|
+
}>;
|
|
87
|
+
resolve: import("vitest").Mock<() => {}>;
|
|
88
|
+
};
|
|
89
|
+
schema: {
|
|
90
|
+
marks: {};
|
|
91
|
+
nodes: {
|
|
92
|
+
paragraph: {
|
|
93
|
+
name: string;
|
|
94
|
+
};
|
|
95
|
+
table: {
|
|
96
|
+
name: string;
|
|
97
|
+
};
|
|
98
|
+
bulletList: {
|
|
99
|
+
name: string;
|
|
100
|
+
};
|
|
101
|
+
documentSection: {
|
|
102
|
+
name: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
storedMarks: any;
|
|
107
|
+
history: {
|
|
108
|
+
undoDepth: number;
|
|
109
|
+
redoDepth: number;
|
|
110
|
+
};
|
|
111
|
+
tr: {
|
|
112
|
+
setMeta: import("vitest").Mock<() => any>;
|
|
113
|
+
setSelection: import("vitest").Mock<() => any>;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Creates a mock ProseMirror view object with configurable properties
|
|
118
|
+
*/
|
|
119
|
+
export function createMockView(options?: {}): {
|
|
120
|
+
state: {
|
|
121
|
+
selection: {
|
|
122
|
+
from: number;
|
|
123
|
+
to: number;
|
|
124
|
+
empty: boolean;
|
|
125
|
+
$head: {
|
|
126
|
+
marks: import("vitest").Mock<() => {
|
|
127
|
+
type: {
|
|
128
|
+
name: any;
|
|
129
|
+
};
|
|
130
|
+
}[]>;
|
|
131
|
+
};
|
|
132
|
+
$from: {
|
|
133
|
+
depth: number;
|
|
134
|
+
node: import("vitest").Mock<() => {
|
|
135
|
+
type: {
|
|
136
|
+
name: string;
|
|
137
|
+
};
|
|
138
|
+
}>;
|
|
139
|
+
};
|
|
140
|
+
$to: {
|
|
141
|
+
depth: number;
|
|
142
|
+
node: import("vitest").Mock<() => {
|
|
143
|
+
type: {
|
|
144
|
+
name: string;
|
|
145
|
+
};
|
|
146
|
+
}>;
|
|
147
|
+
};
|
|
148
|
+
constructor: {
|
|
149
|
+
near: import("vitest").Mock<() => {
|
|
150
|
+
from: number;
|
|
151
|
+
to: number;
|
|
152
|
+
}>;
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
doc: {
|
|
156
|
+
textBetween: import("vitest").Mock<() => string>;
|
|
157
|
+
nodeAt: import("vitest").Mock<() => {
|
|
158
|
+
type: {
|
|
159
|
+
name: string;
|
|
160
|
+
};
|
|
161
|
+
}>;
|
|
162
|
+
resolve: import("vitest").Mock<() => {}>;
|
|
163
|
+
};
|
|
164
|
+
schema: {
|
|
165
|
+
marks: {};
|
|
166
|
+
nodes: {
|
|
167
|
+
paragraph: {
|
|
168
|
+
name: string;
|
|
169
|
+
};
|
|
170
|
+
table: {
|
|
171
|
+
name: string;
|
|
172
|
+
};
|
|
173
|
+
bulletList: {
|
|
174
|
+
name: string;
|
|
175
|
+
};
|
|
176
|
+
documentSection: {
|
|
177
|
+
name: string;
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
storedMarks: any;
|
|
182
|
+
history: {
|
|
183
|
+
undoDepth: number;
|
|
184
|
+
redoDepth: number;
|
|
185
|
+
};
|
|
186
|
+
tr: {
|
|
187
|
+
setMeta: import("vitest").Mock<() => any>;
|
|
188
|
+
setSelection: import("vitest").Mock<() => any>;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
coordsAtPos: import("vitest").Mock<() => {
|
|
192
|
+
left: number;
|
|
193
|
+
top: number;
|
|
194
|
+
}>;
|
|
195
|
+
posAtCoords: import("vitest").Mock<() => {
|
|
196
|
+
pos: number;
|
|
197
|
+
}>;
|
|
198
|
+
dispatch: import("vitest").Mock<(...args: any[]) => any>;
|
|
199
|
+
focus: import("vitest").Mock<(...args: any[]) => any>;
|
|
200
|
+
dom: {
|
|
201
|
+
addEventListener: import("vitest").Mock<(...args: any[]) => any>;
|
|
202
|
+
removeEventListener: import("vitest").Mock<(...args: any[]) => any>;
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
/**
|
|
206
|
+
* Creates a mock editor object with configurable options
|
|
207
|
+
*/
|
|
208
|
+
export function createMockEditor(options?: {}): {
|
|
209
|
+
view: {
|
|
210
|
+
state: {
|
|
211
|
+
selection: {
|
|
212
|
+
from: number;
|
|
213
|
+
to: number;
|
|
214
|
+
empty: boolean;
|
|
215
|
+
$head: {
|
|
216
|
+
marks: import("vitest").Mock<() => {
|
|
217
|
+
type: {
|
|
218
|
+
name: any;
|
|
219
|
+
};
|
|
220
|
+
}[]>;
|
|
221
|
+
};
|
|
222
|
+
$from: {
|
|
223
|
+
depth: number;
|
|
224
|
+
node: import("vitest").Mock<() => {
|
|
225
|
+
type: {
|
|
226
|
+
name: string;
|
|
227
|
+
};
|
|
228
|
+
}>;
|
|
229
|
+
};
|
|
230
|
+
$to: {
|
|
231
|
+
depth: number;
|
|
232
|
+
node: import("vitest").Mock<() => {
|
|
233
|
+
type: {
|
|
234
|
+
name: string;
|
|
235
|
+
};
|
|
236
|
+
}>;
|
|
237
|
+
};
|
|
238
|
+
constructor: {
|
|
239
|
+
near: import("vitest").Mock<() => {
|
|
240
|
+
from: number;
|
|
241
|
+
to: number;
|
|
242
|
+
}>;
|
|
243
|
+
};
|
|
244
|
+
};
|
|
245
|
+
doc: {
|
|
246
|
+
textBetween: import("vitest").Mock<() => string>;
|
|
247
|
+
nodeAt: import("vitest").Mock<() => {
|
|
248
|
+
type: {
|
|
249
|
+
name: string;
|
|
250
|
+
};
|
|
251
|
+
}>;
|
|
252
|
+
resolve: import("vitest").Mock<() => {}>;
|
|
253
|
+
};
|
|
254
|
+
schema: {
|
|
255
|
+
marks: {};
|
|
256
|
+
nodes: {
|
|
257
|
+
paragraph: {
|
|
258
|
+
name: string;
|
|
259
|
+
};
|
|
260
|
+
table: {
|
|
261
|
+
name: string;
|
|
262
|
+
};
|
|
263
|
+
bulletList: {
|
|
264
|
+
name: string;
|
|
265
|
+
};
|
|
266
|
+
documentSection: {
|
|
267
|
+
name: string;
|
|
268
|
+
};
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
storedMarks: any;
|
|
272
|
+
history: {
|
|
273
|
+
undoDepth: number;
|
|
274
|
+
redoDepth: number;
|
|
275
|
+
};
|
|
276
|
+
tr: {
|
|
277
|
+
setMeta: import("vitest").Mock<() => any>;
|
|
278
|
+
setSelection: import("vitest").Mock<() => any>;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
coordsAtPos: import("vitest").Mock<() => {
|
|
282
|
+
left: number;
|
|
283
|
+
top: number;
|
|
284
|
+
}>;
|
|
285
|
+
posAtCoords: import("vitest").Mock<() => {
|
|
286
|
+
pos: number;
|
|
287
|
+
}>;
|
|
288
|
+
dispatch: import("vitest").Mock<(...args: any[]) => any>;
|
|
289
|
+
focus: import("vitest").Mock<(...args: any[]) => any>;
|
|
290
|
+
dom: {
|
|
291
|
+
addEventListener: import("vitest").Mock<(...args: any[]) => any>;
|
|
292
|
+
removeEventListener: import("vitest").Mock<(...args: any[]) => any>;
|
|
293
|
+
};
|
|
294
|
+
};
|
|
295
|
+
options: {
|
|
296
|
+
documentMode: string;
|
|
297
|
+
isAiEnabled: boolean;
|
|
298
|
+
slashMenuConfig: any;
|
|
299
|
+
aiApiKey: any;
|
|
300
|
+
aiEndpoint: any;
|
|
301
|
+
};
|
|
302
|
+
isEditable: boolean;
|
|
303
|
+
commands: any;
|
|
304
|
+
on: import("vitest").Mock<(...args: any[]) => any>;
|
|
305
|
+
off: import("vitest").Mock<(...args: any[]) => any>;
|
|
306
|
+
emit: import("vitest").Mock<(...args: any[]) => any>;
|
|
307
|
+
};
|
|
308
|
+
/**
|
|
309
|
+
* Creates a mock editor context object for slash menu utilities
|
|
310
|
+
*/
|
|
311
|
+
export function createMockContext(options?: {}): {
|
|
312
|
+
editor: any;
|
|
313
|
+
cursorPosition: {
|
|
314
|
+
x: number;
|
|
315
|
+
y: number;
|
|
316
|
+
};
|
|
317
|
+
pos: number;
|
|
318
|
+
node: {
|
|
319
|
+
type: {
|
|
320
|
+
name: string;
|
|
321
|
+
};
|
|
322
|
+
};
|
|
323
|
+
event: any;
|
|
324
|
+
selectedText: string;
|
|
325
|
+
hasSelection: boolean;
|
|
326
|
+
trigger: string;
|
|
327
|
+
clipboardContent: {
|
|
328
|
+
html: any;
|
|
329
|
+
text: any;
|
|
330
|
+
hasContent: boolean;
|
|
331
|
+
};
|
|
332
|
+
selectionStart: number;
|
|
333
|
+
selectionEnd: number;
|
|
334
|
+
isInTable: boolean;
|
|
335
|
+
isInList: boolean;
|
|
336
|
+
isInSectionNode: boolean;
|
|
337
|
+
currentNodeType: string;
|
|
338
|
+
activeMarks: any[];
|
|
339
|
+
isTrackedChange: boolean;
|
|
340
|
+
documentMode: string;
|
|
341
|
+
canUndo: boolean;
|
|
342
|
+
canRedo: boolean;
|
|
343
|
+
isEditable: boolean;
|
|
344
|
+
};
|
|
345
|
+
/**
|
|
346
|
+
* Sets up common mocks and returns cleanup functions
|
|
347
|
+
* Returns an object with mock functions and a cleanup function
|
|
348
|
+
*/
|
|
349
|
+
export function setupCommonMocks(): {
|
|
350
|
+
mocks: {
|
|
351
|
+
readFromClipboard: import("vitest").Mock<(...args: any[]) => any>;
|
|
352
|
+
selectionHasNodeOrMark: import("vitest").Mock<() => boolean>;
|
|
353
|
+
moveCursorToMouseEvent: import("vitest").Mock<(...args: any[]) => any>;
|
|
354
|
+
handleClipboardPaste: import("vitest").Mock<() => boolean>;
|
|
355
|
+
};
|
|
356
|
+
spies: {
|
|
357
|
+
docAddEventListener: import("vitest").MockInstance<{
|
|
358
|
+
<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
359
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
360
|
+
}>;
|
|
361
|
+
docRemoveEventListener: import("vitest").MockInstance<{
|
|
362
|
+
<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
363
|
+
(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
364
|
+
}>;
|
|
365
|
+
};
|
|
366
|
+
cleanup: () => void;
|
|
367
|
+
};
|
|
368
|
+
/**
|
|
369
|
+
* Creates a beforeEach setup function with common mock resets
|
|
370
|
+
* Has a callback for any custom setup that needs to be done before each test
|
|
371
|
+
*/
|
|
372
|
+
export function createBeforeEachSetup(customSetup?: () => void): () => void;
|
|
373
|
+
/**
|
|
374
|
+
* Mounts a Vue component with common props and returns wrapper with helper methods
|
|
375
|
+
*/
|
|
376
|
+
export function mountSlashMenuComponent(component: any, options?: {}): {
|
|
377
|
+
wrapper: import("@vue/test-utils").VueWrapper<unknown, import("vue").ComponentPublicInstance<unknown, Omit<unknown, never>>>;
|
|
378
|
+
props: any;
|
|
379
|
+
openMenu(menuPosition?: {
|
|
380
|
+
left: string;
|
|
381
|
+
top: string;
|
|
382
|
+
}): Promise<void>;
|
|
383
|
+
closeMenu(): Promise<void>;
|
|
384
|
+
triggerKeydown(key: any, target?: string): Promise<void>;
|
|
385
|
+
};
|
|
386
|
+
/**
|
|
387
|
+
* Filters menu items by various criteria (helper for testing menu item filtering)
|
|
388
|
+
*/
|
|
389
|
+
export function filterMenuItems(sections: any, criteria?: {}): any;
|
|
390
|
+
/**
|
|
391
|
+
* Creates mock menu items for testing
|
|
392
|
+
*/
|
|
393
|
+
export function createMockMenuItems(count?: number, customItems?: any[]): {
|
|
394
|
+
id: string;
|
|
395
|
+
items: any[];
|
|
396
|
+
}[];
|
|
397
|
+
/**
|
|
398
|
+
* Creates a mock item with custom render function for testing
|
|
399
|
+
*/
|
|
400
|
+
export function createMockRenderItem(id?: string, renderFn?: any): {
|
|
401
|
+
id: string;
|
|
402
|
+
label: string;
|
|
403
|
+
render: any;
|
|
404
|
+
allowedTriggers: string[];
|
|
405
|
+
};
|
|
406
|
+
/**
|
|
407
|
+
* Common assertions for editor mock objects
|
|
408
|
+
*/
|
|
409
|
+
export function assertEditorMockStructure(editor: any): void;
|
|
410
|
+
/**
|
|
411
|
+
* Common assertions for menu sections structure
|
|
412
|
+
*/
|
|
413
|
+
export function assertMenuSectionsStructure(sections: any): void;
|
|
414
|
+
/**
|
|
415
|
+
* Asserts that event listeners are properly set up
|
|
416
|
+
*/
|
|
417
|
+
export function assertEventListenersSetup(editor: any, documentSpies: any): void;
|
|
418
|
+
/**
|
|
419
|
+
* Asserts that event listeners are properly cleaned up
|
|
420
|
+
*/
|
|
421
|
+
export function assertEventListenersCleanup(editor: any, documentSpies: any): void;
|
|
422
|
+
export namespace SlashMenuConfigs {
|
|
423
|
+
namespace withAI {
|
|
424
|
+
let includeDefaultItems: boolean;
|
|
425
|
+
let customItems: any[];
|
|
426
|
+
}
|
|
427
|
+
namespace customOnly {
|
|
428
|
+
let includeDefaultItems_1: boolean;
|
|
429
|
+
export { includeDefaultItems_1 as includeDefaultItems };
|
|
430
|
+
let customItems_1: {
|
|
431
|
+
id: string;
|
|
432
|
+
items: {
|
|
433
|
+
id: string;
|
|
434
|
+
label: string;
|
|
435
|
+
allowedTriggers: string[];
|
|
436
|
+
action: import("vitest").Mock<(...args: any[]) => any>;
|
|
437
|
+
}[];
|
|
438
|
+
}[];
|
|
439
|
+
export { customItems_1 as customItems };
|
|
440
|
+
}
|
|
441
|
+
function withProvider(providerFn: any): {
|
|
442
|
+
includeDefaultItems: boolean;
|
|
443
|
+
menuProvider: any;
|
|
444
|
+
};
|
|
445
|
+
namespace withConditionalItems {
|
|
446
|
+
let includeDefaultItems_2: boolean;
|
|
447
|
+
export { includeDefaultItems_2 as includeDefaultItems };
|
|
448
|
+
let customItems_2: {
|
|
449
|
+
id: string;
|
|
450
|
+
items: ({
|
|
451
|
+
id: string;
|
|
452
|
+
label: string;
|
|
453
|
+
allowedTriggers: string[];
|
|
454
|
+
action: import("vitest").Mock<(...args: any[]) => any>;
|
|
455
|
+
showWhen?: undefined;
|
|
456
|
+
} | {
|
|
457
|
+
id: string;
|
|
458
|
+
label: string;
|
|
459
|
+
allowedTriggers: string[];
|
|
460
|
+
action: import("vitest").Mock<(...args: any[]) => any>;
|
|
461
|
+
showWhen: (context: any) => any;
|
|
462
|
+
})[];
|
|
463
|
+
}[];
|
|
464
|
+
export { customItems_2 as customItems };
|
|
465
|
+
}
|
|
466
|
+
}
|
|
@@ -3,7 +3,14 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @param {Object} editor - The editor instance
|
|
5
5
|
* @param {MouseEvent} [event] - Optional mouse event (for context menu)
|
|
6
|
-
* @returns {Object} context -
|
|
6
|
+
* @returns {Promise<Object>} context - Enhanced editor context with comprehensive state information
|
|
7
7
|
*/
|
|
8
|
-
export function getEditorContext(editor: any, event?: MouseEvent): any
|
|
8
|
+
export function getEditorContext(editor: any, event?: MouseEvent): Promise<any>;
|
|
9
9
|
export function getPropsByItemId(itemId: string, props: any): any;
|
|
10
|
+
declare function getStructureFromResolvedPos(state: any, pos: any): {
|
|
11
|
+
isInTable: boolean;
|
|
12
|
+
isInList: boolean;
|
|
13
|
+
isInSectionNode: boolean;
|
|
14
|
+
};
|
|
15
|
+
declare function isCollaborationEnabled(editor: any): boolean;
|
|
16
|
+
export { getStructureFromResolvedPos as __getStructureFromResolvedPosForTest, isCollaborationEnabled as __isCollaborationEnabledForTest };
|
|
@@ -33,7 +33,7 @@ declare class DocxZipper {
|
|
|
33
33
|
/**
|
|
34
34
|
* Update [Content_Types].xml with extensions of new Image annotations
|
|
35
35
|
*/
|
|
36
|
-
updateContentTypes(docx: any, media: any, fromJson: any): Promise<any>;
|
|
36
|
+
updateContentTypes(docx: any, media: any, fromJson: any, updatedDocs?: {}): Promise<any>;
|
|
37
37
|
unzip(file: any): Promise<any>;
|
|
38
38
|
updateZip({ docx, updatedDocs, originalDocxFile, media, fonts, isHeadless }: {
|
|
39
39
|
docx: any;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export function createState(doc: any): EditorState;
|
|
2
|
+
export function setSelection(state: any, pos: any, end?: any): any;
|
|
3
|
+
export function createDispatch(): {
|
|
4
|
+
dispatch: (tr: any) => number;
|
|
5
|
+
dispatched: any[];
|
|
6
|
+
};
|
|
7
|
+
import { EditorState } from 'prosemirror-state';
|
|
@@ -98,19 +98,7 @@ export class SuperConverter {
|
|
|
98
98
|
get docxHelpers(): any;
|
|
99
99
|
parseFromXml(): void;
|
|
100
100
|
parseXmlToJson(xml: any): any;
|
|
101
|
-
getDocumentDefaultStyles(): {
|
|
102
|
-
fontSizePt?: undefined;
|
|
103
|
-
kern?: undefined;
|
|
104
|
-
typeface?: undefined;
|
|
105
|
-
panose?: undefined;
|
|
106
|
-
fontFamilyCss?: undefined;
|
|
107
|
-
} | {
|
|
108
|
-
fontSizePt: number;
|
|
109
|
-
kern: any;
|
|
110
|
-
typeface: any;
|
|
111
|
-
panose: any;
|
|
112
|
-
fontFamilyCss: any;
|
|
113
|
-
};
|
|
101
|
+
getDocumentDefaultStyles(): {};
|
|
114
102
|
getDocumentFonts(): string;
|
|
115
103
|
getDocumentInternalId(): void;
|
|
116
104
|
createDocumentIdElement(): {
|
|
@@ -103,6 +103,7 @@ export function translateHardBreak(params: any): {
|
|
|
103
103
|
};
|
|
104
104
|
}[];
|
|
105
105
|
};
|
|
106
|
+
export function ensureSectionLayoutDefaults(sectPr: any, converter: any): any;
|
|
106
107
|
export function isLineBreakOnlyRun(node: any): any;
|
|
107
108
|
export class DocxExporter {
|
|
108
109
|
constructor(converter: any);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export const DEFAULT_PAGE_WIDTH_TWIPS: 12240;
|
|
2
|
+
export const DEFAULT_PAGE_MARGIN_TWIPS: 1440;
|
|
3
|
+
export const DEFAULT_CONTENT_WIDTH_TWIPS: number;
|
|
4
|
+
export const MIN_COLUMN_WIDTH_TWIPS: number;
|
|
5
|
+
export function pctToPercent(value: any): number;
|
|
6
|
+
export function resolveContentWidthTwips(): number;
|
|
7
|
+
export function resolveMeasurementWidthPx(measurement: any): number;
|
|
8
|
+
export function countColumnsInRow(row: any): any;
|
|
9
|
+
export function buildFallbackGridForTable({ params, rows, tableWidth, tableWidthMeasurement }: {
|
|
10
|
+
params: Partial<import("@translator").SCDecoderConfig>;
|
|
11
|
+
rows: any[];
|
|
12
|
+
tableWidth?: {
|
|
13
|
+
width?: number | null;
|
|
14
|
+
};
|
|
15
|
+
tableWidthMeasurement?: {
|
|
16
|
+
value?: number;
|
|
17
|
+
type?: string;
|
|
18
|
+
};
|
|
19
|
+
}): {
|
|
20
|
+
grid: Array<{
|
|
21
|
+
col: number;
|
|
22
|
+
}>;
|
|
23
|
+
columnWidths: number[];
|
|
24
|
+
} | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./alternate-content-translator.js";
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* @property {boolean} focused - Whether editor is focused
|
|
5
5
|
* @property {Object|null} preservedSelection - Stored selection
|
|
6
6
|
* @property {boolean} showVisualSelection - Whether to show selection decoration
|
|
7
|
+
* @property {boolean} skipFocusReset - Whether to skip clearing selection on next focus
|
|
7
8
|
*/
|
|
8
9
|
/**
|
|
9
10
|
* Configuration options for CustomSelection
|
|
@@ -44,6 +45,10 @@ export type SelectionState = {
|
|
|
44
45
|
* - Whether to show selection decoration
|
|
45
46
|
*/
|
|
46
47
|
showVisualSelection: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* - Whether to skip clearing selection on next focus
|
|
50
|
+
*/
|
|
51
|
+
skipFocusReset: boolean;
|
|
47
52
|
};
|
|
48
53
|
/**
|
|
49
54
|
* Configuration options for CustomSelection
|