@xignature/docx-editor 1.0.0

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.
@@ -0,0 +1,8 @@
1
+ import {
2
+ executeCommand,
3
+ executeCommands
4
+ } from "./chunk-IAU6OTCV.mjs";
5
+ export {
6
+ executeCommand,
7
+ executeCommands
8
+ };
package/dist/index.css ADDED
@@ -0,0 +1,483 @@
1
+ /* src/core/prosemirror/editor.css */
2
+ .prosemirror-editor-wrapper {
3
+ min-height: 100%;
4
+ }
5
+ .prosemirror-zoom-container {
6
+ }
7
+ .prosemirror-editor {
8
+ width: var(--page-width, 8.5in);
9
+ }
10
+ .prosemirror-editor .ProseMirror {
11
+ background: white;
12
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
13
+ width: var(--page-width, 8.5in);
14
+ min-height: var(--page-height, 11in);
15
+ padding-top: var(--margin-top, 72px);
16
+ padding-bottom: var(--margin-bottom, 72px);
17
+ padding-left: var(--margin-left, 72px);
18
+ padding-right: var(--margin-right, 72px);
19
+ outline: none;
20
+ font-family:
21
+ "Calibri",
22
+ "Arial",
23
+ sans-serif;
24
+ font-size: 11pt;
25
+ color: #000;
26
+ white-space: pre-wrap;
27
+ word-wrap: break-word;
28
+ tab-size: 48;
29
+ -moz-tab-size: 48;
30
+ box-sizing: border-box;
31
+ position: relative;
32
+ }
33
+ .prosemirror-editor .ProseMirror .docx-page-break {
34
+ display: block;
35
+ position: relative;
36
+ height: 40px;
37
+ margin: 0 calc(-1 * var(--margin-left, 72px));
38
+ margin-right: calc(-1 * var(--margin-right, 72px));
39
+ background: var(--doc-bg);
40
+ border: none;
41
+ pointer-events: none;
42
+ }
43
+ .prosemirror-editor .ProseMirror .docx-page-break::before {
44
+ content: "";
45
+ position: absolute;
46
+ bottom: 0;
47
+ left: 0;
48
+ right: 0;
49
+ height: 8px;
50
+ background:
51
+ linear-gradient(
52
+ to bottom,
53
+ transparent,
54
+ rgba(0, 0, 0, 0.08));
55
+ }
56
+ .prosemirror-editor .ProseMirror .docx-page-break::after {
57
+ content: "";
58
+ position: absolute;
59
+ top: 0;
60
+ left: 0;
61
+ right: 0;
62
+ height: 8px;
63
+ background:
64
+ linear-gradient(
65
+ to top,
66
+ transparent,
67
+ rgba(0, 0, 0, 0.08));
68
+ }
69
+ .prosemirror-editor .ProseMirror [data-page-break-before=true] {
70
+ break-before: page;
71
+ }
72
+ .prosemirror-editor .ProseMirror .docx-page-break-line {
73
+ display: block;
74
+ position: relative;
75
+ height: 1px;
76
+ margin: 20px calc(-1 * var(--margin-left, 72px));
77
+ margin-right: calc(-1 * var(--margin-right, 72px));
78
+ border-top: 1px dashed var(--doc-border);
79
+ }
80
+ .prosemirror-editor .ProseMirror .docx-page-break-line::before {
81
+ content: "Page Break";
82
+ position: absolute;
83
+ top: -10px;
84
+ left: 50%;
85
+ transform: translateX(-50%);
86
+ background: var(--doc-bg);
87
+ padding: 0 8px;
88
+ font-size: 10px;
89
+ color: var(--doc-text-muted);
90
+ white-space: nowrap;
91
+ }
92
+ .prosemirror-editor .ProseMirror:focus {
93
+ outline: none;
94
+ }
95
+ .prosemirror-editor .ProseMirror p {
96
+ display: block;
97
+ margin: 0;
98
+ padding: 0;
99
+ min-height: 1em;
100
+ white-space: pre-wrap;
101
+ word-wrap: break-word;
102
+ line-height: normal;
103
+ }
104
+ .prosemirror-editor .ProseMirror p:empty::before {
105
+ content: "\a0";
106
+ }
107
+ .prosemirror-editor .ProseMirror span {
108
+ display: inline;
109
+ white-space: pre-wrap;
110
+ }
111
+ .prosemirror-editor .ProseMirror .docx-list-bullet,
112
+ .prosemirror-editor .ProseMirror .docx-list-numbered {
113
+ position: relative;
114
+ padding-left: 48px;
115
+ }
116
+ .prosemirror-editor .ProseMirror [data-list-marker]::before {
117
+ content: attr(data-list-marker);
118
+ position: absolute;
119
+ left: 0;
120
+ width: 44px;
121
+ text-align: right;
122
+ white-space: nowrap;
123
+ }
124
+ .prosemirror-editor .ProseMirror .docx-list-bullet:not([data-list-marker])::before {
125
+ content: "\2022";
126
+ position: absolute;
127
+ left: 0;
128
+ width: 44px;
129
+ text-align: right;
130
+ }
131
+ .prosemirror-editor .ProseMirror .docx-list-numbered:not([data-list-marker]) {
132
+ counter-increment: list-counter;
133
+ }
134
+ .prosemirror-editor .ProseMirror .docx-list-decimal:not([data-list-marker])::before {
135
+ content: counter(list-counter) ".";
136
+ position: absolute;
137
+ left: 0;
138
+ width: 44px;
139
+ text-align: right;
140
+ }
141
+ .prosemirror-editor .ProseMirror .docx-list-lower-roman:not([data-list-marker])::before {
142
+ content: counter(list-counter, lower-roman) ".";
143
+ position: absolute;
144
+ left: 0;
145
+ width: 44px;
146
+ text-align: right;
147
+ }
148
+ .prosemirror-editor .ProseMirror .docx-list-upper-roman:not([data-list-marker])::before {
149
+ content: counter(list-counter, upper-roman) ".";
150
+ position: absolute;
151
+ left: 0;
152
+ width: 44px;
153
+ text-align: right;
154
+ }
155
+ .prosemirror-editor .ProseMirror .docx-list-lower-alpha:not([data-list-marker])::before {
156
+ content: counter(list-counter, lower-alpha) ".";
157
+ position: absolute;
158
+ left: 0;
159
+ width: 44px;
160
+ text-align: right;
161
+ }
162
+ .prosemirror-editor .ProseMirror .docx-list-upper-alpha:not([data-list-marker])::before {
163
+ content: counter(list-counter, upper-alpha) ".";
164
+ position: absolute;
165
+ left: 0;
166
+ width: 44px;
167
+ text-align: right;
168
+ }
169
+ .prosemirror-editor .ProseMirror .docx-list-level-0:not([data-list-marker]):first-of-type {
170
+ counter-reset: list-counter;
171
+ }
172
+ .prosemirror-editor .ProseMirror .docx-list-level-1 {
173
+ margin-left: 0.5in;
174
+ }
175
+ .prosemirror-editor .ProseMirror .docx-list-level-2 {
176
+ margin-left: 1in;
177
+ }
178
+ .prosemirror-editor .ProseMirror .docx-list-level-3 {
179
+ margin-left: 1.5in;
180
+ }
181
+ .prosemirror-editor .ProseMirror .docx-list-level-4 {
182
+ margin-left: 2in;
183
+ }
184
+ .prosemirror-editor .ProseMirror .docx-list-level-5 {
185
+ margin-left: 2.5in;
186
+ }
187
+ .prosemirror-editor .ProseMirror .docx-list-level-6 {
188
+ margin-left: 3in;
189
+ }
190
+ .prosemirror-editor .ProseMirror .docx-list-level-7 {
191
+ margin-left: 3.5in;
192
+ }
193
+ .prosemirror-editor .ProseMirror .docx-list-level-8 {
194
+ margin-left: 4in;
195
+ }
196
+ .prosemirror-editor .ProseMirror ::selection {
197
+ background: rgba(66, 133, 244, 0.3);
198
+ }
199
+ .prosemirror-editor[data-placeholder]::before {
200
+ content: attr(data-placeholder);
201
+ color: #aaa;
202
+ position: absolute;
203
+ pointer-events: none;
204
+ }
205
+ .prosemirror-editor .ProseMirror img.docx-image {
206
+ display: inline;
207
+ max-width: 100%;
208
+ object-fit: contain;
209
+ vertical-align: baseline;
210
+ outline: none;
211
+ }
212
+ .prosemirror-editor .ProseMirror img.docx-image-float {
213
+ }
214
+ .prosemirror-editor .ProseMirror img.docx-image-float-left {
215
+ clear: left;
216
+ }
217
+ .prosemirror-editor .ProseMirror img.docx-image-float-right {
218
+ clear: right;
219
+ }
220
+ .prosemirror-editor .ProseMirror img.docx-image-block {
221
+ clear: both;
222
+ }
223
+ .prosemirror-editor .ProseMirror p:has(> img.docx-image-block:only-child) {
224
+ text-indent: 0 !important;
225
+ text-align: center;
226
+ }
227
+ .prosemirror-editor .ProseMirror p:has(img.docx-image-float)::after {
228
+ content: "";
229
+ display: table;
230
+ clear: both;
231
+ }
232
+ .prosemirror-editor .ProseMirror img.docx-image.ProseMirror-selectednode {
233
+ outline: 2px solid var(--doc-primary, #4285f4);
234
+ outline-offset: 2px;
235
+ cursor: grab;
236
+ }
237
+ .prosemirror-editor .ProseMirror.pm-image-dragging img.docx-image.ProseMirror-selectednode {
238
+ opacity: 0.4;
239
+ outline: 2px dashed var(--doc-primary, #4285f4);
240
+ cursor: grabbing;
241
+ }
242
+ .prosemirror-editor .ProseMirror img:not(.docx-image) {
243
+ max-width: 100%;
244
+ height: auto;
245
+ }
246
+ .prosemirror-editor .ProseMirror .docx-shape {
247
+ display: inline-block;
248
+ vertical-align: middle;
249
+ line-height: 0;
250
+ cursor: pointer;
251
+ }
252
+ .prosemirror-editor .ProseMirror .docx-shape.ProseMirror-selectednode {
253
+ outline: 2px solid var(--doc-primary, #4285f4);
254
+ outline-offset: 2px;
255
+ }
256
+ .prosemirror-editor .ProseMirror .docx-textbox {
257
+ border-radius: 2px;
258
+ margin: 4px 0;
259
+ cursor: text;
260
+ }
261
+ .prosemirror-editor .ProseMirror .docx-textbox.ProseMirror-selectednode {
262
+ outline: 2px solid var(--doc-primary, #4285f4);
263
+ outline-offset: 2px;
264
+ }
265
+ .prosemirror-editor .ProseMirror a {
266
+ color: var(--doc-link);
267
+ text-decoration: underline;
268
+ }
269
+ .prosemirror-editor .ProseMirror a:hover {
270
+ color: var(--doc-primary-hover);
271
+ }
272
+ .prosemirror-editor .ProseMirror .docx-footnote-ref,
273
+ .prosemirror-editor .ProseMirror .docx-endnote-ref {
274
+ color: var(--doc-link, #0066cc);
275
+ cursor: pointer;
276
+ vertical-align: super;
277
+ font-size: smaller;
278
+ }
279
+ .prosemirror-editor .ProseMirror .docx-footnote-ref:hover,
280
+ .prosemirror-editor .ProseMirror .docx-endnote-ref:hover {
281
+ text-decoration: underline;
282
+ }
283
+ .prosemirror-editor .ProseMirror hr {
284
+ border: none;
285
+ border-top: 1px solid #000;
286
+ margin: 12pt 0;
287
+ height: 0;
288
+ }
289
+ .prosemirror-editor .ProseMirror table.docx-table {
290
+ border-collapse: collapse;
291
+ margin: 12pt 0;
292
+ max-width: 100%;
293
+ }
294
+ .prosemirror-editor .ProseMirror td.docx-table-cell,
295
+ .prosemirror-editor .ProseMirror th.docx-table-header {
296
+ padding: 4px 8px;
297
+ vertical-align: top;
298
+ min-width: 30px;
299
+ }
300
+ .prosemirror-editor .ProseMirror th.docx-table-header {
301
+ font-weight: bold;
302
+ text-align: left;
303
+ }
304
+ .prosemirror-editor .ProseMirror td p,
305
+ .prosemirror-editor .ProseMirror th p {
306
+ margin: 0;
307
+ padding: 0;
308
+ min-height: auto;
309
+ }
310
+ .prosemirror-editor .ProseMirror td p:first-child,
311
+ .prosemirror-editor .ProseMirror th p:first-child {
312
+ margin-top: 0;
313
+ }
314
+ .prosemirror-editor .ProseMirror td p:last-child,
315
+ .prosemirror-editor .ProseMirror th p:last-child {
316
+ margin-bottom: 0;
317
+ }
318
+ .prosemirror-editor .ProseMirror .activeCell {
319
+ outline: 2px solid rgba(66, 133, 244, 0.5);
320
+ outline-offset: -2px;
321
+ }
322
+ .prosemirror-editor .ProseMirror .selectedCell {
323
+ background-color: rgba(66, 133, 244, 0.15);
324
+ }
325
+ .prosemirror-editor .ProseMirror .selectedCell::after {
326
+ content: "";
327
+ position: absolute;
328
+ inset: 0;
329
+ background: rgba(66, 133, 244, 0.1);
330
+ pointer-events: none;
331
+ }
332
+ .prosemirror-editor .ProseMirror table table {
333
+ margin: 4px 0;
334
+ }
335
+ .prosemirror-editor .ProseMirror .column-resize-handle {
336
+ position: absolute;
337
+ right: -2px;
338
+ top: 0;
339
+ bottom: 0;
340
+ width: 4px;
341
+ background-color: rgba(66, 133, 244, 0.5);
342
+ cursor: col-resize;
343
+ z-index: 20;
344
+ }
345
+ .prosemirror-editor .ProseMirror td.docx-table-cell,
346
+ .prosemirror-editor .ProseMirror th.docx-table-header {
347
+ position: relative;
348
+ }
349
+ .prosemirror-editor .ProseMirror.resize-cursor {
350
+ cursor: col-resize;
351
+ }
352
+ .prosemirror-editor .ProseMirror table:not(:hover) .column-resize-handle {
353
+ background-color: transparent;
354
+ }
355
+ .prosemirror-editor .ProseMirror table:hover .column-resize-handle {
356
+ background-color: rgba(66, 133, 244, 0.3);
357
+ }
358
+ .prosemirror-editor .ProseMirror .column-resize-handle:hover {
359
+ background-color: rgba(66, 133, 244, 0.7);
360
+ }
361
+ .prosemirror-editor .ProseMirror span.docx-tab {
362
+ display: inline-block;
363
+ min-width: 48px;
364
+ white-space: pre;
365
+ background: transparent;
366
+ }
367
+ .prosemirror-editor .ProseMirror span.docx-tab[data-leader=dot]::before {
368
+ content: "...........";
369
+ position: absolute;
370
+ color: inherit;
371
+ white-space: nowrap;
372
+ overflow: hidden;
373
+ }
374
+ .prosemirror-editor .ProseMirror span.docx-tab[data-leader=hyphen]::before {
375
+ content: "-----------";
376
+ position: absolute;
377
+ color: inherit;
378
+ white-space: nowrap;
379
+ overflow: hidden;
380
+ }
381
+ .prosemirror-editor .ProseMirror span.docx-tab[data-leader=underscore]::before {
382
+ content: "___________";
383
+ position: absolute;
384
+ color: inherit;
385
+ white-space: nowrap;
386
+ overflow: hidden;
387
+ }
388
+ .prosemirror-editor .ProseMirror .docx-run-all-caps {
389
+ text-transform: uppercase;
390
+ }
391
+ .prosemirror-editor .ProseMirror .docx-run-small-caps {
392
+ font-variant: small-caps;
393
+ }
394
+ .docx-section-break {
395
+ position: relative;
396
+ }
397
+ .docx-section-break::after {
398
+ content: "Section Break (" attr(data-section-break) ")";
399
+ display: block;
400
+ text-align: center;
401
+ font-size: 9px;
402
+ color: var(--doc-text-muted, #9ca3af);
403
+ border-top: 1px dashed var(--doc-border, #d1d5db);
404
+ margin-top: 4px;
405
+ padding-top: 2px;
406
+ pointer-events: none;
407
+ }
408
+ .prosemirror-editor .ProseMirror .pm-drop-indicator {
409
+ position: absolute;
410
+ width: 2px;
411
+ background: var(--doc-primary, #4285f4);
412
+ pointer-events: none;
413
+ z-index: 50;
414
+ }
415
+ .prosemirror-editor .ProseMirror .ProseMirror-dropcursor {
416
+ z-index: 50;
417
+ }
418
+ .layout-page-content {
419
+ cursor: text;
420
+ }
421
+ .layout-page-header,
422
+ .layout-page-footer {
423
+ cursor: pointer;
424
+ transition: background-color 0.15s ease;
425
+ }
426
+ .layout-page-header:hover,
427
+ .layout-page-footer:hover {
428
+ background-color: rgba(37, 99, 235, 0.06);
429
+ }
430
+ .layout-page-header:empty:hover::after {
431
+ content: "Double-click to add header";
432
+ display: block;
433
+ text-align: center;
434
+ color: #9ca3af;
435
+ font-size: 11px;
436
+ padding: 4px 0;
437
+ }
438
+ .layout-page-footer:empty:hover::after {
439
+ content: "Double-click to add footer";
440
+ display: block;
441
+ text-align: center;
442
+ color: #9ca3af;
443
+ font-size: 11px;
444
+ padding: 4px 0;
445
+ }
446
+ .hf-editor-pm .ProseMirror {
447
+ outline: none;
448
+ min-height: 40px;
449
+ padding: 4px;
450
+ }
451
+ .hf-editor-pm .ProseMirror:focus {
452
+ outline: none;
453
+ }
454
+ .hf-editor-pm .ProseMirror p {
455
+ display: block;
456
+ margin: 0 !important;
457
+ padding: 0;
458
+ min-height: 1em;
459
+ white-space: pre-wrap;
460
+ word-wrap: break-word;
461
+ line-height: normal !important;
462
+ }
463
+ .paged-editor--hf-editing .layout-page-content {
464
+ opacity: 0.4;
465
+ pointer-events: none;
466
+ transition: opacity 0.15s ease;
467
+ }
468
+ .paged-editor--editing-header .layout-page-header {
469
+ border-bottom: 1px dotted #4285f4;
470
+ }
471
+ .paged-editor--editing-footer .layout-page-footer {
472
+ border-top: 1px dotted #4285f4;
473
+ }
474
+ .paged-editor--editing-header .layout-page-header > * {
475
+ visibility: hidden;
476
+ }
477
+ .paged-editor--editing-footer .layout-page-footer > * {
478
+ visibility: hidden;
479
+ }
480
+ .paged-editor--hf-editing .layout-page-header:hover,
481
+ .paged-editor--hf-editing .layout-page-footer:hover {
482
+ background-color: transparent;
483
+ }