@novaprose/tinymce-compat 0.5.3 → 0.7.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.
- package/README.md +20 -8
- package/dist/index.cjs +401 -258
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -8
- package/dist/index.d.ts +29 -8
- package/dist/index.js +399 -255
- package/dist/index.js.map +1 -1
- package/dist/novaprose.css +291 -29
- package/dist/tinymce-chunks/advlist-7a360f16.js +2 -0
- package/dist/tinymce-chunks/advlist-7a360f16.js.map +7 -0
- package/dist/tinymce-chunks/autolink-7e2e7be2.js +2 -0
- package/dist/tinymce-chunks/autolink-7e2e7be2.js.map +7 -0
- package/dist/tinymce-chunks/autoresize-d6c9537b.js +2 -0
- package/dist/tinymce-chunks/autoresize-d6c9537b.js.map +7 -0
- package/dist/tinymce-chunks/autosave-4fd46720.js +2 -0
- package/dist/tinymce-chunks/autosave-4fd46720.js.map +7 -0
- package/dist/tinymce-chunks/charmap-4b14307a.js +2 -0
- package/dist/tinymce-chunks/charmap-4b14307a.js.map +7 -0
- package/dist/tinymce-chunks/comments-panel-37cba890.js +2 -0
- package/dist/tinymce-chunks/comments-panel-37cba890.js.map +7 -0
- package/dist/tinymce-chunks/directionality-60dba768.js +2 -0
- package/dist/tinymce-chunks/directionality-60dba768.js.map +7 -0
- package/dist/tinymce-chunks/emoticons-7e6da0b6.js +2 -0
- package/dist/tinymce-chunks/emoticons-7e6da0b6.js.map +7 -0
- package/dist/tinymce-chunks/form-dialog-9cde0ef7.js +2 -0
- package/dist/tinymce-chunks/form-dialog-9cde0ef7.js.map +7 -0
- package/dist/tinymce-chunks/insertdatetime-e0dbcf63.js +2 -0
- package/dist/tinymce-chunks/insertdatetime-e0dbcf63.js.map +7 -0
- package/dist/tinymce-chunks/nonbreaking-49bdb0d2.js +2 -0
- package/dist/tinymce-chunks/nonbreaking-49bdb0d2.js.map +7 -0
- package/dist/tinymce-chunks/paste-office-a38659d6.js +3 -0
- package/dist/tinymce-chunks/paste-office-a38659d6.js.map +7 -0
- package/dist/tinymce-chunks/quickbars-d937e10a.js +2 -0
- package/dist/tinymce-chunks/quickbars-d937e10a.js.map +7 -0
- package/dist/tinymce-chunks/revisionhistory-d6306426.js +2 -0
- package/dist/tinymce-chunks/revisionhistory-d6306426.js.map +7 -0
- package/dist/tinymce-chunks/table-80284f6f.js +2 -0
- package/dist/tinymce-chunks/table-80284f6f.js.map +7 -0
- package/dist/tinymce-chunks/visualblocks-58c88e5d.js +2 -0
- package/dist/tinymce-chunks/visualblocks-58c88e5d.js.map +7 -0
- package/dist/tinymce.global.js +27 -24
- package/dist/tinymce.global.js.map +7 -1
- package/package.json +11 -6
package/dist/novaprose.css
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
.nova-editor {
|
|
10
10
|
--nova-bg: #ffffff;
|
|
11
11
|
--nova-fg: #1f2328;
|
|
12
|
-
--nova-muted: #
|
|
12
|
+
--nova-muted: #59636e; /* ≥4.5:1 на всех поверхностях, включая hover/pressed */
|
|
13
13
|
--nova-subtle: #8c959f;
|
|
14
14
|
--nova-border: #d0d7de;
|
|
15
15
|
--nova-border-strong: #afb8c1;
|
|
@@ -22,6 +22,9 @@
|
|
|
22
22
|
--nova-accent: #0969da;
|
|
23
23
|
--nova-accent-hover: #0858b9;
|
|
24
24
|
--nova-accent-fg: #ffffff;
|
|
25
|
+
/* Заливка кнопок с белым текстом: контраст не ниже 4.5:1 (WCAG AA). */
|
|
26
|
+
--nova-accent-strong: #0969da;
|
|
27
|
+
--nova-accent-strong-hover: #0858b9;
|
|
25
28
|
--nova-focus: #0969da;
|
|
26
29
|
--nova-danger: #cf222e;
|
|
27
30
|
--nova-danger-bg: #ffebe9;
|
|
@@ -58,7 +61,7 @@
|
|
|
58
61
|
[data-theme='dark'] .nova-editor {
|
|
59
62
|
--nova-bg: #0d1117;
|
|
60
63
|
--nova-fg: #e6edf3;
|
|
61
|
-
--nova-muted: #
|
|
64
|
+
--nova-muted: #9198a1; /* ≥4.5:1 на всех поверхностях, включая hover/pressed */
|
|
62
65
|
--nova-subtle: #6e7681;
|
|
63
66
|
--nova-border: #30363d;
|
|
64
67
|
--nova-border-strong: #484f58;
|
|
@@ -71,6 +74,9 @@
|
|
|
71
74
|
--nova-accent: #2f81f7;
|
|
72
75
|
--nova-accent-hover: #4493f8;
|
|
73
76
|
--nova-accent-fg: #ffffff;
|
|
77
|
+
/* #2f81f7 с белым — 3.7:1, ниже AA; для заливки — темнее (4.6:1). */
|
|
78
|
+
--nova-accent-strong: #1f6feb;
|
|
79
|
+
--nova-accent-strong-hover: #1a63d6;
|
|
74
80
|
--nova-focus: #58a6ff;
|
|
75
81
|
--nova-danger: #f85149;
|
|
76
82
|
--nova-danger-bg: #2d1214;
|
|
@@ -97,7 +103,7 @@
|
|
|
97
103
|
.nova-editor:not([data-theme='light'] *) {
|
|
98
104
|
--nova-bg: #0d1117;
|
|
99
105
|
--nova-fg: #e6edf3;
|
|
100
|
-
--nova-muted: #
|
|
106
|
+
--nova-muted: #9198a1; /* ≥4.5:1 на всех поверхностях, включая hover/pressed */
|
|
101
107
|
--nova-subtle: #6e7681;
|
|
102
108
|
--nova-border: #30363d;
|
|
103
109
|
--nova-border-strong: #484f58;
|
|
@@ -110,6 +116,9 @@
|
|
|
110
116
|
--nova-accent: #2f81f7;
|
|
111
117
|
--nova-accent-hover: #4493f8;
|
|
112
118
|
--nova-accent-fg: #ffffff;
|
|
119
|
+
/* #2f81f7 с белым — 3.7:1, ниже AA; для заливки — темнее (4.6:1). */
|
|
120
|
+
--nova-accent-strong: #1f6feb;
|
|
121
|
+
--nova-accent-strong-hover: #1a63d6;
|
|
113
122
|
--nova-focus: #58a6ff;
|
|
114
123
|
--nova-danger: #f85149;
|
|
115
124
|
--nova-danger-bg: #2d1214;
|
|
@@ -303,12 +312,12 @@
|
|
|
303
312
|
}
|
|
304
313
|
|
|
305
314
|
.nova-tb-group + .nova-tb-group {
|
|
306
|
-
padding-
|
|
307
|
-
border-
|
|
315
|
+
padding-inline-start: 4px;
|
|
316
|
+
border-inline-start: 1px solid var(--nova-border);
|
|
308
317
|
}
|
|
309
318
|
|
|
310
319
|
.nova-tb-more {
|
|
311
|
-
margin-
|
|
320
|
+
margin-inline-start: auto;
|
|
312
321
|
}
|
|
313
322
|
|
|
314
323
|
.nova-tb-overflow {
|
|
@@ -367,7 +376,7 @@
|
|
|
367
376
|
overflow: hidden;
|
|
368
377
|
text-overflow: ellipsis;
|
|
369
378
|
max-width: 14ch;
|
|
370
|
-
text-align:
|
|
379
|
+
text-align: start;
|
|
371
380
|
}
|
|
372
381
|
|
|
373
382
|
.nova-chevron {
|
|
@@ -386,7 +395,7 @@
|
|
|
386
395
|
|
|
387
396
|
.nova-color-bar {
|
|
388
397
|
position: absolute;
|
|
389
|
-
|
|
398
|
+
inset-inline-start: 8px;
|
|
390
399
|
bottom: 4px;
|
|
391
400
|
width: 18px;
|
|
392
401
|
height: 3px;
|
|
@@ -439,7 +448,8 @@
|
|
|
439
448
|
.nova-prosemirror.nova-empty::before {
|
|
440
449
|
content: attr(data-placeholder);
|
|
441
450
|
position: absolute;
|
|
442
|
-
|
|
451
|
+
/* Текст — контраст AA (4.5:1), поэтому muted, а не subtle. */
|
|
452
|
+
color: var(--nova-muted);
|
|
443
453
|
pointer-events: none;
|
|
444
454
|
}
|
|
445
455
|
|
|
@@ -463,8 +473,8 @@
|
|
|
463
473
|
|
|
464
474
|
.nova-prosemirror blockquote {
|
|
465
475
|
margin: 0 0 0.75em;
|
|
466
|
-
padding-
|
|
467
|
-
border-
|
|
476
|
+
padding-inline-start: 1em;
|
|
477
|
+
border-inline-start: 3px solid var(--nova-quote);
|
|
468
478
|
color: var(--nova-muted);
|
|
469
479
|
}
|
|
470
480
|
|
|
@@ -495,7 +505,7 @@
|
|
|
495
505
|
.nova-prosemirror ul,
|
|
496
506
|
.nova-prosemirror ol {
|
|
497
507
|
margin: 0 0 0.75em;
|
|
498
|
-
padding-
|
|
508
|
+
padding-inline-start: 1.5em;
|
|
499
509
|
}
|
|
500
510
|
|
|
501
511
|
.nova-prosemirror li > p {
|
|
@@ -512,6 +522,43 @@
|
|
|
512
522
|
border-radius: 2px;
|
|
513
523
|
}
|
|
514
524
|
|
|
525
|
+
/* Картинка с подписью: таблица — подпись по ширине картинки, при любом выравнивании. */
|
|
526
|
+
.nova-prosemirror figure {
|
|
527
|
+
display: table !important;
|
|
528
|
+
margin: 0.75em 0;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
.nova-prosemirror figure[style*='margin-left: auto'] {
|
|
532
|
+
margin-left: auto;
|
|
533
|
+
margin-right: auto;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
.nova-prosemirror figure img {
|
|
537
|
+
display: block;
|
|
538
|
+
width: 100%;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
.nova-prosemirror figcaption {
|
|
542
|
+
display: table-caption;
|
|
543
|
+
caption-side: bottom;
|
|
544
|
+
padding-top: 0.4em;
|
|
545
|
+
color: var(--nova-muted);
|
|
546
|
+
font-size: 0.9em;
|
|
547
|
+
text-align: center;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
/* Пустая подпись — приглашение на языке интерфейса (текст в --nova-caption-placeholder). */
|
|
551
|
+
.nova-prosemirror figcaption:has(> br.ProseMirror-trailingBreak:only-child)::before {
|
|
552
|
+
content: var(--nova-caption-placeholder, '');
|
|
553
|
+
color: var(--nova-muted);
|
|
554
|
+
pointer-events: none;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
.nova-prosemirror figure.ProseMirror-selectednode {
|
|
558
|
+
outline: 2px solid var(--nova-accent);
|
|
559
|
+
outline-offset: 2px;
|
|
560
|
+
}
|
|
561
|
+
|
|
515
562
|
.nova-prosemirror img[src^='blob:'] {
|
|
516
563
|
opacity: 0.5;
|
|
517
564
|
animation: nova-pulse 1.2s ease-in-out infinite;
|
|
@@ -545,7 +592,7 @@
|
|
|
545
592
|
.nova-prosemirror th {
|
|
546
593
|
background: var(--nova-toolbar-bg);
|
|
547
594
|
font-weight: 600;
|
|
548
|
-
text-align:
|
|
595
|
+
text-align: start;
|
|
549
596
|
}
|
|
550
597
|
|
|
551
598
|
.nova-prosemirror td > :last-child,
|
|
@@ -708,7 +755,7 @@
|
|
|
708
755
|
.nova-image[data-size]::after {
|
|
709
756
|
content: attr(data-size);
|
|
710
757
|
position: absolute;
|
|
711
|
-
|
|
758
|
+
inset-inline-end: 6px;
|
|
712
759
|
bottom: 6px;
|
|
713
760
|
padding: 2px 6px;
|
|
714
761
|
border-radius: 4px;
|
|
@@ -885,7 +932,7 @@ html.nova-fullscreen-lock body {
|
|
|
885
932
|
}
|
|
886
933
|
|
|
887
934
|
.nova-help-table td:last-child {
|
|
888
|
-
text-align:
|
|
935
|
+
text-align: end;
|
|
889
936
|
}
|
|
890
937
|
|
|
891
938
|
.nova-help kbd {
|
|
@@ -912,6 +959,8 @@ html.nova-fullscreen-lock body {
|
|
|
912
959
|
border-radius: 0 0 var(--nova-radius) var(--nova-radius);
|
|
913
960
|
color: var(--nova-muted);
|
|
914
961
|
font-size: 12px;
|
|
962
|
+
/* Служебная строка: не выделяется при перетаскивании ручки размера. */
|
|
963
|
+
user-select: none;
|
|
915
964
|
}
|
|
916
965
|
|
|
917
966
|
.nova-path {
|
|
@@ -921,8 +970,79 @@ html.nova-fullscreen-lock body {
|
|
|
921
970
|
font-family: var(--nova-mono);
|
|
922
971
|
}
|
|
923
972
|
|
|
973
|
+
.nova-path-item {
|
|
974
|
+
unicode-bidi: isolate;
|
|
975
|
+
}
|
|
976
|
+
|
|
924
977
|
.nova-wordcount {
|
|
925
978
|
flex: none;
|
|
979
|
+
margin-inline-start: auto;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
.nova-resize-handle {
|
|
983
|
+
display: grid;
|
|
984
|
+
flex: none;
|
|
985
|
+
place-items: center;
|
|
986
|
+
width: 20px;
|
|
987
|
+
height: 20px;
|
|
988
|
+
margin-inline-end: -8px;
|
|
989
|
+
border-radius: 4px;
|
|
990
|
+
color: var(--nova-subtle);
|
|
991
|
+
cursor: ns-resize;
|
|
992
|
+
touch-action: none;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
.nova-editor[data-resize='both'] .nova-resize-handle {
|
|
996
|
+
cursor: nwse-resize;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
/* ---------- справа налево ---------- */
|
|
1000
|
+
|
|
1001
|
+
/* Ручка размера — в левом нижнем углу: иконку и курсор отражаем. */
|
|
1002
|
+
[dir='rtl'] .nova-editor[data-resize='both'] .nova-resize-handle,
|
|
1003
|
+
.nova-editor[dir='rtl'][data-resize='both'] .nova-resize-handle {
|
|
1004
|
+
cursor: nesw-resize;
|
|
1005
|
+
}
|
|
1006
|
+
[dir='rtl'] .nova-resize-handle svg,
|
|
1007
|
+
.nova-editor[dir='rtl'] .nova-resize-handle svg {
|
|
1008
|
+
transform: scaleX(-1);
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
/* Иконки со смыслом направления (стрелки отмены, отступы, списки) отражаем,
|
|
1012
|
+
как принято в интерфейсах справа налево. Остальные (жирный, ссылка, картинка) — как есть. */
|
|
1013
|
+
:is([dir='rtl'] .nova-editor, .nova-editor[dir='rtl'])
|
|
1014
|
+
:is(
|
|
1015
|
+
[data-control='undo'],
|
|
1016
|
+
[data-control='redo'],
|
|
1017
|
+
[data-control='indent'],
|
|
1018
|
+
[data-control='outdent'],
|
|
1019
|
+
[data-control='bullist'],
|
|
1020
|
+
[data-control='numlist']
|
|
1021
|
+
)
|
|
1022
|
+
> .nova-icon
|
|
1023
|
+
svg {
|
|
1024
|
+
transform: scaleX(-1);
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
.nova-resize-handle:hover {
|
|
1028
|
+
color: var(--nova-fg);
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1031
|
+
.nova-resize-handle:focus-visible {
|
|
1032
|
+
outline: 2px solid var(--nova-accent);
|
|
1033
|
+
outline-offset: 1px;
|
|
1034
|
+
}
|
|
1035
|
+
|
|
1036
|
+
/* ======================= отключённый редактор ======================= */
|
|
1037
|
+
|
|
1038
|
+
.nova-disabled .nova-content,
|
|
1039
|
+
.nova-disabled .nova-header,
|
|
1040
|
+
.nova-disabled .nova-statusbar {
|
|
1041
|
+
opacity: 0.55;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
.nova-disabled .nova-prosemirror {
|
|
1045
|
+
cursor: not-allowed;
|
|
926
1046
|
}
|
|
927
1047
|
|
|
928
1048
|
/* ======================= оверлеи ======================= */
|
|
@@ -972,7 +1092,7 @@ html.nova-fullscreen-lock body {
|
|
|
972
1092
|
background: transparent;
|
|
973
1093
|
color: inherit;
|
|
974
1094
|
font: inherit;
|
|
975
|
-
text-align:
|
|
1095
|
+
text-align: start;
|
|
976
1096
|
cursor: pointer;
|
|
977
1097
|
}
|
|
978
1098
|
|
|
@@ -1004,8 +1124,9 @@ html.nova-fullscreen-lock body {
|
|
|
1004
1124
|
}
|
|
1005
1125
|
|
|
1006
1126
|
.nova-menu-shortcut {
|
|
1007
|
-
margin-
|
|
1008
|
-
|
|
1127
|
+
margin-inline-start: 16px;
|
|
1128
|
+
/* Текст — контраст AA (4.5:1), поэтому muted, а не subtle. */
|
|
1129
|
+
color: var(--nova-muted);
|
|
1009
1130
|
font-family: var(--nova-font);
|
|
1010
1131
|
font-size: 12px;
|
|
1011
1132
|
}
|
|
@@ -1016,6 +1137,15 @@ html.nova-fullscreen-lock body {
|
|
|
1016
1137
|
background: var(--nova-border);
|
|
1017
1138
|
}
|
|
1018
1139
|
|
|
1140
|
+
.nova-menu-heading {
|
|
1141
|
+
padding: 8px 10px 4px;
|
|
1142
|
+
color: var(--nova-muted);
|
|
1143
|
+
font-size: 11px;
|
|
1144
|
+
font-weight: 600;
|
|
1145
|
+
letter-spacing: 0.02em;
|
|
1146
|
+
text-transform: uppercase;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1019
1149
|
/* ---------- автокомплитер / слэш-команды ---------- */
|
|
1020
1150
|
|
|
1021
1151
|
.nova-ac {
|
|
@@ -1060,6 +1190,11 @@ html.nova-fullscreen-lock body {
|
|
|
1060
1190
|
gap: 4px;
|
|
1061
1191
|
}
|
|
1062
1192
|
|
|
1193
|
+
/* Строка палитры нужна только для ARIA (role=row) — в раскладке её нет. */
|
|
1194
|
+
.nova-swatch-row {
|
|
1195
|
+
display: contents;
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1063
1198
|
.nova-swatch {
|
|
1064
1199
|
display: inline-flex;
|
|
1065
1200
|
align-items: center;
|
|
@@ -1218,7 +1353,7 @@ html.nova-fullscreen-lock body {
|
|
|
1218
1353
|
|
|
1219
1354
|
.nova-notifications {
|
|
1220
1355
|
position: absolute;
|
|
1221
|
-
|
|
1356
|
+
inset-inline-end: 12px;
|
|
1222
1357
|
bottom: 40px;
|
|
1223
1358
|
z-index: 3;
|
|
1224
1359
|
display: flex;
|
|
@@ -1262,6 +1397,14 @@ html.nova-fullscreen-lock body {
|
|
|
1262
1397
|
padding: 0;
|
|
1263
1398
|
}
|
|
1264
1399
|
|
|
1400
|
+
.nova-notification .nova-notification-action {
|
|
1401
|
+
padding: 0 10px;
|
|
1402
|
+
border: 1px solid var(--nova-border-strong);
|
|
1403
|
+
background: var(--nova-surface);
|
|
1404
|
+
color: var(--nova-fg);
|
|
1405
|
+
font-weight: 500;
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1265
1408
|
.nova-notification .nova-btn svg {
|
|
1266
1409
|
width: 14px;
|
|
1267
1410
|
height: 14px;
|
|
@@ -1362,6 +1505,48 @@ html.nova-fullscreen-lock body {
|
|
|
1362
1505
|
font-size: 12px;
|
|
1363
1506
|
}
|
|
1364
1507
|
|
|
1508
|
+
/* Диалоги по описанию полей (editor.ui.dialog) */
|
|
1509
|
+
.nova-required {
|
|
1510
|
+
color: var(--nova-danger);
|
|
1511
|
+
}
|
|
1512
|
+
.nova-field-error {
|
|
1513
|
+
margin: 0;
|
|
1514
|
+
color: var(--nova-danger);
|
|
1515
|
+
font-size: 12px;
|
|
1516
|
+
}
|
|
1517
|
+
.nova-input[aria-invalid='true'] {
|
|
1518
|
+
border-color: var(--nova-danger);
|
|
1519
|
+
}
|
|
1520
|
+
.nova-form-message {
|
|
1521
|
+
margin: 0;
|
|
1522
|
+
padding: 8px 10px;
|
|
1523
|
+
border-radius: var(--nova-radius-sm);
|
|
1524
|
+
background: var(--nova-hover);
|
|
1525
|
+
}
|
|
1526
|
+
.nova-form-message.is-warning,
|
|
1527
|
+
.nova-form-message.is-error {
|
|
1528
|
+
background: var(--nova-danger-bg);
|
|
1529
|
+
color: var(--nova-danger);
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
.nova-input-group {
|
|
1533
|
+
display: flex;
|
|
1534
|
+
gap: 6px;
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
.nova-input-group .nova-input {
|
|
1538
|
+
flex: 1;
|
|
1539
|
+
min-width: 0;
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
.nova-input-action {
|
|
1543
|
+
flex: none;
|
|
1544
|
+
width: 36px;
|
|
1545
|
+
height: 36px;
|
|
1546
|
+
padding: 0;
|
|
1547
|
+
justify-content: center;
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1365
1550
|
.nova-input {
|
|
1366
1551
|
width: 100%;
|
|
1367
1552
|
height: 36px;
|
|
@@ -1407,14 +1592,14 @@ html.nova-fullscreen-lock body {
|
|
|
1407
1592
|
}
|
|
1408
1593
|
|
|
1409
1594
|
.nova-button-primary {
|
|
1410
|
-
border-color: var(--nova-accent);
|
|
1411
|
-
background: var(--nova-accent);
|
|
1595
|
+
border-color: var(--nova-accent-strong);
|
|
1596
|
+
background: var(--nova-accent-strong);
|
|
1412
1597
|
color: var(--nova-accent-fg);
|
|
1413
1598
|
}
|
|
1414
1599
|
|
|
1415
1600
|
.nova-button-primary:hover:not(:disabled) {
|
|
1416
|
-
border-color: var(--nova-accent-hover);
|
|
1417
|
-
background: var(--nova-accent-hover);
|
|
1601
|
+
border-color: var(--nova-accent-strong-hover);
|
|
1602
|
+
background: var(--nova-accent-strong-hover);
|
|
1418
1603
|
}
|
|
1419
1604
|
|
|
1420
1605
|
.nova-button:disabled {
|
|
@@ -1453,7 +1638,8 @@ html.nova-fullscreen-lock body {
|
|
|
1453
1638
|
display: flex;
|
|
1454
1639
|
align-items: center;
|
|
1455
1640
|
gap: 10px;
|
|
1456
|
-
|
|
1641
|
+
/* Текст («или»), а не декор: нужен контраст AA — muted, не subtle. */
|
|
1642
|
+
color: var(--nova-muted);
|
|
1457
1643
|
font-size: 12px;
|
|
1458
1644
|
text-transform: uppercase;
|
|
1459
1645
|
}
|
|
@@ -1538,6 +1724,17 @@ html.nova-fullscreen-lock body {
|
|
|
1538
1724
|
|
|
1539
1725
|
/* ======================= обязательные стили ProseMirror ======================= */
|
|
1540
1726
|
|
|
1727
|
+
/* Служебная картинка ProseMirror после нередактируемого элемента в конце абзаца (переменная,
|
|
1728
|
+
упоминание, картинка). Обязательный стиль ProseMirror: иначе общий сброс сайта вроде
|
|
1729
|
+
img { display: block } превращает её в лишнюю пустую строку. */
|
|
1730
|
+
.nova-prosemirror img.ProseMirror-separator {
|
|
1731
|
+
display: inline !important;
|
|
1732
|
+
width: auto !important;
|
|
1733
|
+
height: auto !important;
|
|
1734
|
+
margin: 0 !important;
|
|
1735
|
+
border: none !important;
|
|
1736
|
+
}
|
|
1737
|
+
|
|
1541
1738
|
.ProseMirror-hideselection *::selection {
|
|
1542
1739
|
background: transparent;
|
|
1543
1740
|
}
|
|
@@ -1771,17 +1968,55 @@ html.nova-fullscreen-lock body {
|
|
|
1771
1968
|
flex: 999 1 360px;
|
|
1772
1969
|
}
|
|
1773
1970
|
|
|
1774
|
-
.
|
|
1971
|
+
/* ---------- боковые панели (editor.ui.sidebar) ---------- */
|
|
1972
|
+
.nova-body > .nova-sidebar {
|
|
1775
1973
|
display: flex;
|
|
1776
1974
|
flex: 1 1 280px;
|
|
1777
1975
|
flex-direction: column;
|
|
1778
|
-
gap: 8px;
|
|
1779
1976
|
max-height: 70vh;
|
|
1780
1977
|
min-width: 0;
|
|
1781
|
-
padding: 10px;
|
|
1782
|
-
overflow: auto;
|
|
1783
1978
|
border-inline-start: 1px solid var(--nova-border);
|
|
1784
1979
|
background: var(--nova-toolbar-bg);
|
|
1980
|
+
}
|
|
1981
|
+
.nova-sidebar[hidden] {
|
|
1982
|
+
display: none;
|
|
1983
|
+
}
|
|
1984
|
+
.nova-sidebar-head {
|
|
1985
|
+
display: flex;
|
|
1986
|
+
align-items: center;
|
|
1987
|
+
justify-content: space-between;
|
|
1988
|
+
gap: 8px;
|
|
1989
|
+
padding: 6px;
|
|
1990
|
+
padding-inline-start: 12px;
|
|
1991
|
+
border-bottom: 1px solid var(--nova-border);
|
|
1992
|
+
}
|
|
1993
|
+
.nova-sidebar-title {
|
|
1994
|
+
margin: 0;
|
|
1995
|
+
font-size: 14px;
|
|
1996
|
+
font-weight: 600;
|
|
1997
|
+
}
|
|
1998
|
+
.nova-sidebar-body {
|
|
1999
|
+
flex: 1;
|
|
2000
|
+
min-height: 0;
|
|
2001
|
+
padding: 10px;
|
|
2002
|
+
overflow: auto;
|
|
2003
|
+
}
|
|
2004
|
+
/* Панель со своей шапкой (комментарии) сама задаёт отступы и прокрутку. */
|
|
2005
|
+
.nova-sidebar-bare > .nova-sidebar-body {
|
|
2006
|
+
display: flex;
|
|
2007
|
+
flex-direction: column;
|
|
2008
|
+
padding: 0;
|
|
2009
|
+
overflow: hidden;
|
|
2010
|
+
}
|
|
2011
|
+
|
|
2012
|
+
.nova-comments {
|
|
2013
|
+
display: flex;
|
|
2014
|
+
flex: 1;
|
|
2015
|
+
flex-direction: column;
|
|
2016
|
+
gap: 8px;
|
|
2017
|
+
min-height: 0;
|
|
2018
|
+
padding: 10px;
|
|
2019
|
+
overflow: auto;
|
|
1785
2020
|
font-size: 13px;
|
|
1786
2021
|
}
|
|
1787
2022
|
.nova-comments[hidden] {
|
|
@@ -1959,7 +2194,7 @@ html.nova-fullscreen-lock body {
|
|
|
1959
2194
|
container-type: inline-size;
|
|
1960
2195
|
}
|
|
1961
2196
|
@container (max-width: 640px) {
|
|
1962
|
-
.nova-body > .nova-
|
|
2197
|
+
.nova-body > .nova-sidebar {
|
|
1963
2198
|
flex-basis: 100%;
|
|
1964
2199
|
max-height: none;
|
|
1965
2200
|
border-inline-start: 0;
|
|
@@ -2305,3 +2540,30 @@ div.nova-diff-removed {
|
|
|
2305
2540
|
line-height: 1.5;
|
|
2306
2541
|
overflow-wrap: anywhere;
|
|
2307
2542
|
}
|
|
2543
|
+
|
|
2544
|
+
/* ======================= переменные (mergetags) ======================= */
|
|
2545
|
+
|
|
2546
|
+
.nova-mergetag {
|
|
2547
|
+
display: inline-block;
|
|
2548
|
+
padding: 0 6px;
|
|
2549
|
+
border-radius: 4px;
|
|
2550
|
+
background: var(--nova-active);
|
|
2551
|
+
color: var(--nova-active-fg);
|
|
2552
|
+
font-size: 0.9em;
|
|
2553
|
+
font-weight: 500;
|
|
2554
|
+
line-height: 1.5;
|
|
2555
|
+
white-space: nowrap;
|
|
2556
|
+
cursor: default;
|
|
2557
|
+
user-select: none;
|
|
2558
|
+
}
|
|
2559
|
+
|
|
2560
|
+
.nova-mergetag.is-unknown {
|
|
2561
|
+
outline: 1px dashed var(--nova-active-fg);
|
|
2562
|
+
outline-offset: -1px;
|
|
2563
|
+
background: transparent;
|
|
2564
|
+
}
|
|
2565
|
+
|
|
2566
|
+
.nova-mergetag.is-selected {
|
|
2567
|
+
outline: 2px solid var(--nova-accent);
|
|
2568
|
+
outline-offset: 1px;
|
|
2569
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var k=Object.create;var L=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var $=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var a=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var F=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of C(t))!z.call(e,o)&&o!==r&&L(e,o,{get:()=>t[o],enumerable:!(n=q(t,o))||n.enumerable});return e};var u=(e,t,r)=>(r=e!=null?k($(e)):{},F(t||!e||!e.__esModule?L(r,"default",{value:e,enumerable:!0}):r,e));var h=a(m=>{var E=globalThis.__novaprose_tinymce["packages/core/src/commands.ts"];Object.defineProperty(m,"__esModule",{value:!0});for(O in E)(function(e){Object.defineProperty(m,e,{enumerable:!0,get:function(){return E[e]}})})(O);var O});var P=a(b=>{var w=globalThis.__novaprose_tinymce["packages/core/src/plugins.ts"];Object.defineProperty(b,"__esModule",{value:!0});for(T in w)(function(e){Object.defineProperty(b,e,{enumerable:!0,get:function(){return w[e]}})})(T);var T});var D=a(y=>{var j=globalThis.__novaprose_tinymce["packages/core/src/schema.ts"];Object.defineProperty(y,"__esModule",{value:!0});for(B in j)(function(e){Object.defineProperty(y,e,{enumerable:!0,get:function(){return j[e]}})})(B);var B});var R=a(v=>{var I=globalThis.__novaprose_tinymce["packages/core/src/plugins/shared.ts"];Object.defineProperty(v,"__esModule",{value:!0});for(M in I)(function(e){Object.defineProperty(v,e,{enumerable:!0,get:function(){return I[e]}})})(M);var M});var g=u(h(),1),x=u(P(),1),c=u(D(),1),A=u(R(),1),G={en:{disc:"Default",circle:"Circle",square:"Square",decimal:"Default (1, 2, 3)","lower-alpha":"Lower alpha (a, b, c)","upper-alpha":"Upper alpha (A, B, C)","lower-roman":"Lower roman (i, ii, iii)","upper-roman":"Upper roman (I, II, III)","lower-greek":"Lower greek (\u03B1, \u03B2, \u03B3)"}};function _(e,t){let{$from:r}=e.selection;for(let n=r.depth;n>0;n--){let o=r.node(n);if(o.type===t)return{pos:r.before(n),attrs:o.attrs}}return null}function H(e,t,r,n){let o=()=>(0,g.nodesOf)(e.view.state)[t];_(e.view.state,o())||e.exec(t==="bullet_list"?"bulletList":"orderedList");let s=_(e.view.state,o());if(!s)return;let{state:p,dispatch:i}=e.view;i(p.tr.setNodeMarkup(s.pos,void 0,{...s.attrs,listStyle:r===n?null:r})),e.focus()}var X=(0,x.definePlugin)({name:"advlist",setup(e){let t=(0,A.pickLabels)(e,"advlist",G),r=e.options.pluginOptions?.advlist??{},n=[{control:"bullist",kind:"bullet_list",styles:r.bullets??[...c.BULLET_STYLES],fallback:"disc"},{control:"numlist",kind:"ordered_list",styles:r.numbers??[...c.ORDERED_STYLES],fallback:"decimal"}];for(let{control:o,kind:s,styles:p,fallback:i}of n){let f=e.ui.registry.get(o);if(!f||f.type!=="button")continue;let{type:U,...Y}=f;e.ui.registry.addSplitButton(o,{...Y,items:d=>{let S=_(d.view.state,(0,g.nodesOf)(d.view.state)[s]),N=S?.attrs.listStyle??(S?i:null);return p.map(l=>({id:l,label:t[l],active:N===l,onSelect:()=>H(d,s,l,i)}))}})}}});export{G as LABELS,X as default};
|
|
2
|
+
//# sourceMappingURL=advlist-7a360f16.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["nova-shared:packages/core/src/commands.ts", "nova-shared:packages/core/src/plugins.ts", "nova-shared:packages/core/src/schema.ts", "nova-shared:packages/core/src/plugins/shared.ts", "../../../core/src/plugins/advlist.ts"],
|
|
4
|
+
"sourcesContent": ["var m = globalThis[\"__novaprose_tinymce\"][\"packages/core/src/commands.ts\"];\nObject.defineProperty(exports, '__esModule', { value: true });\nfor (var k in m) (function (k) { Object.defineProperty(exports, k, { enumerable: true, get: function () { return m[k]; } }); })(k);", "var m = globalThis[\"__novaprose_tinymce\"][\"packages/core/src/plugins.ts\"];\nObject.defineProperty(exports, '__esModule', { value: true });\nfor (var k in m) (function (k) { Object.defineProperty(exports, k, { enumerable: true, get: function () { return m[k]; } }); })(k);", "var m = globalThis[\"__novaprose_tinymce\"][\"packages/core/src/schema.ts\"];\nObject.defineProperty(exports, '__esModule', { value: true });\nfor (var k in m) (function (k) { Object.defineProperty(exports, k, { enumerable: true, get: function () { return m[k]; } }); })(k);", "var m = globalThis[\"__novaprose_tinymce\"][\"packages/core/src/plugins/shared.ts\"];\nObject.defineProperty(exports, '__esModule', { value: true });\nfor (var k in m) (function (k) { Object.defineProperty(exports, k, { enumerable: true, get: function () { return m[k]; } }); })(k);", "import type { NodeType } from 'prosemirror-model';\nimport type { EditorState } from 'prosemirror-state';\nimport { nodesOf } from '../commands';\nimport type { Editor } from '../editor';\nimport { definePlugin } from '../plugins';\nimport { BULLET_STYLES, ORDERED_STYLES } from '../schema';\nimport type { ButtonSpec } from '../ui/registry';\nimport { pickLabels } from './shared';\n\n/**\n * \u041F\u043B\u0430\u0433\u0438\u043D advlist: \u0441\u0442\u0438\u043B\u044C \u043C\u0430\u0440\u043A\u0435\u0440\u043E\u0432 (\u0442\u043E\u0447\u043A\u0430, \u043A\u0440\u0443\u0436\u043E\u043A, \u043A\u0432\u0430\u0434\u0440\u0430\u0442) \u0438 \u043D\u0443\u043C\u0435\u0440\u0430\u0446\u0438\u0438 (1, a, A, i, I, \u03B1).\n * \u041A\u043D\u043E\u043F\u043A\u0438 `bullist` \u0438 `numlist` \u0441\u0442\u0430\u043D\u043E\u0432\u044F\u0442\u0441\u044F \u0441\u043E\u0441\u0442\u0430\u0432\u043D\u044B\u043C\u0438: \u043E\u0441\u043D\u043E\u0432\u043D\u0430\u044F \u0447\u0430\u0441\u0442\u044C \u043F\u0435\u0440\u0435\u043A\u043B\u044E\u0447\u0430\u0435\u0442 \u0441\u043F\u0438\u0441\u043E\u043A,\n * \u0441\u0442\u0440\u0435\u043B\u043A\u0430 \u2014 \u0432\u044B\u0431\u043E\u0440 \u0441\u0442\u0438\u043B\u044F. `plugins: ['advlist']`; \u043D\u0430\u0431\u043E\u0440\u044B \u0441\u0442\u0438\u043B\u0435\u0439 \u2014 `pluginOptions.advlist`\n * (`bullets`, `numbers`, \u043A\u0430\u043A advlist_bullet_styles / advlist_number_styles).\n */\n\nexport interface AdvlistOptions {\n bullets?: (typeof BULLET_STYLES)[number][];\n numbers?: (typeof ORDERED_STYLES)[number][];\n}\n\nexport const LABELS = {\n en: {\n disc: 'Default',\n circle: 'Circle',\n square: 'Square',\n decimal: 'Default (1, 2, 3)',\n 'lower-alpha': 'Lower alpha (a, b, c)',\n 'upper-alpha': 'Upper alpha (A, B, C)',\n 'lower-roman': 'Lower roman (i, ii, iii)',\n 'upper-roman': 'Upper roman (I, II, III)',\n 'lower-greek': 'Lower greek (\u03B1, \u03B2, \u03B3)',\n },\n};\n\n/** \u0411\u043B\u0438\u0436\u0430\u0439\u0448\u0438\u0439 \u0441\u043F\u0438\u0441\u043E\u043A \u043D\u0443\u0436\u043D\u043E\u0433\u043E \u0442\u0438\u043F\u0430 \u0432\u043E\u043A\u0440\u0443\u0433 \u0432\u044B\u0434\u0435\u043B\u0435\u043D\u0438\u044F. */\nfunction findList(\n state: EditorState,\n type: NodeType,\n): { pos: number; attrs: Record<string, unknown> } | null {\n const { $from } = state.selection;\n for (let depth = $from.depth; depth > 0; depth--) {\n const node = $from.node(depth);\n if (node.type === type) return { pos: $from.before(depth), attrs: node.attrs };\n }\n return null;\n}\n\nfunction applyStyle(\n editor: Editor,\n kind: 'bullet_list' | 'ordered_list',\n style: string,\n fallback: string,\n): void {\n const type = () => nodesOf(editor.view.state)[kind];\n // \u041D\u0435 \u0432 \u0441\u043F\u0438\u0441\u043A\u0435 \u044D\u0442\u043E\u0433\u043E \u0442\u0438\u043F\u0430 \u2014 \u0441\u043D\u0430\u0447\u0430\u043B\u0430 \u0441\u043E\u0437\u0434\u0430\u0451\u043C \u0441\u043F\u0438\u0441\u043E\u043A, \u043F\u043E\u0442\u043E\u043C \u0437\u0430\u0434\u0430\u0451\u043C \u0441\u0442\u0438\u043B\u044C.\n if (!findList(editor.view.state, type()))\n editor.exec(kind === 'bullet_list' ? 'bulletList' : 'orderedList');\n const list = findList(editor.view.state, type());\n if (!list) return;\n const { state, dispatch } = editor.view;\n dispatch(\n state.tr.setNodeMarkup(list.pos, undefined, {\n ...list.attrs,\n listStyle: style === fallback ? null : style,\n }),\n );\n editor.focus();\n}\n\nexport default definePlugin({\n name: 'advlist',\n setup(editor) {\n const labels = pickLabels(editor, 'advlist', LABELS);\n const options = (editor.options.pluginOptions?.advlist ?? {}) as AdvlistOptions;\n const lists = [\n {\n control: 'bullist',\n kind: 'bullet_list',\n styles: options.bullets ?? [...BULLET_STYLES],\n fallback: 'disc',\n },\n {\n control: 'numlist',\n kind: 'ordered_list',\n styles: options.numbers ?? [...ORDERED_STYLES],\n fallback: 'decimal',\n },\n ] as const;\n\n for (const { control, kind, styles, fallback } of lists) {\n const base = editor.ui.registry.get(control) as ButtonSpec | undefined;\n if (!base || base.type !== 'button') continue;\n const { type: _type, ...button } = base;\n void _type;\n editor.ui.registry.addSplitButton(control, {\n ...button,\n items: (e) => {\n const list = findList(e.view.state, nodesOf(e.view.state)[kind]);\n const current = (list?.attrs.listStyle as string | null) ?? (list ? fallback : null);\n return styles.map((style) => ({\n id: style,\n label: labels[style],\n active: current === style,\n onSelect: () => applyStyle(e, kind, style, fallback),\n }));\n },\n });\n }\n },\n});\n"],
|
|
5
|
+
"mappings": "ygBAAA,IAAAA,EAAAC,EAAAC,GAAA,KAAIC,EAAI,WAAW,oBAAuB,+BAA+B,EACzE,OAAO,eAAeD,EAAS,aAAc,CAAE,MAAO,EAAK,CAAC,EAC5D,IAASE,KAAKD,GAAI,SAAUC,EAAG,CAAE,OAAO,eAAeF,EAASE,EAAG,CAAE,WAAY,GAAM,IAAK,UAAY,CAAE,OAAOD,EAAEC,CAAC,CAAG,CAAE,CAAC,CAAG,GAAGA,CAAC,EAAxH,IAAAA,ICFT,IAAAC,EAAAC,EAAAC,GAAA,KAAIC,EAAI,WAAW,oBAAuB,8BAA8B,EACxE,OAAO,eAAeD,EAAS,aAAc,CAAE,MAAO,EAAK,CAAC,EAC5D,IAASE,KAAKD,GAAI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KAAK,EAAEd,CAAI,CAAC,EACzDe,EAAWZ,GAAM,MAAM,YAAgCA,EAAOD,EAAW,MAC/E,OAAOQ,EAAO,IAAKT,IAAW,CAC5B,GAAIA,EACJ,MAAOK,EAAOL,CAAK,EACnB,OAAQc,IAAYd,EACpB,SAAU,IAAMH,EAAWgB,EAAGd,EAAMC,EAAOC,CAAQ,CACrD,EAAE,CACJ,CACF,CAAC,CACH,CACF,CACF,CAAC",
|
|
6
|
+
"names": ["require_commands", "__commonJSMin", "exports", "m", "k", "require_plugins", "__commonJSMin", "exports", "m", "k", "require_schema", "__commonJSMin", "exports", "m", "k", "require_shared", "__commonJSMin", "exports", "m", "k", "import_commands", "import_plugins", "import_schema", "import_shared", "LABELS", "findList", "state", "type", "$from", "depth", "node", "applyStyle", "editor", "kind", "style", "fallback", "list", "dispatch", "advlist_default", "labels", "options", "lists", "control", "styles", "base", "_type", "button", "e", "current"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var z=Object.create;var O=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var G=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var a=(e,r)=>()=>(r||e((r={exports:{}}).exports,r),r.exports);var J=(e,r,o,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of F(r))!q.call(e,n)&&n!==o&&O(e,n,{get:()=>r[n],enumerable:!(t=C(r,n))||t.enumerable});return e};var f=(e,r,o)=>(o=e!=null?z(G(e)):{},J(r||!e||!e.__esModule?O(o,"default",{value:e,enumerable:!0}):o,e));var T=a(d=>{var P=globalThis.__novaprose_tinymce["node_modules/.pnpm/prosemirror-inputrules@1.7.0/node_modules/prosemirror-inputrules/dist/index.js"];Object.defineProperty(d,"__esModule",{value:!0});for(j in P)(function(e){Object.defineProperty(d,e,{enumerable:!0,get:function(){return P[e]}})})(j);var j});var S=a(_=>{var M=globalThis.__novaprose_tinymce["node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.js"];Object.defineProperty(_,"__esModule",{value:!0});for($ in M)(function(e){Object.defineProperty(_,e,{enumerable:!0,get:function(){return M[e]}})})($);var $});var E=a(b=>{var x=globalThis.__novaprose_tinymce["packages/core/src/commands.ts"];Object.defineProperty(b,"__esModule",{value:!0});for(k in x)(function(e){Object.defineProperty(b,e,{enumerable:!0,get:function(){return x[e]}})})(k);var k});var L=a(g=>{var A=globalThis.__novaprose_tinymce["packages/core/src/plugins.ts"];Object.defineProperty(g,"__esModule",{value:!0});for(B in A)(function(e){Object.defineProperty(g,e,{enumerable:!0,get:function(){return A[e]}})})(B);var B});var U=a(v=>{var R=globalThis.__novaprose_tinymce["packages/core/src/url.ts"];Object.defineProperty(v,"__esModule",{value:!0});for(D in R)(function(e){Object.defineProperty(v,e,{enumerable:!0,get:function(){return R[e]}})})(D);var D});var m=f(T(),1),c=f(S(),1),p=f(E(),1),I=f(L(),1),y=f(U(),1),K=/(?:^|[\s(])((?:https?:\/\/|www\.)[^\s<>"]*[^\s<>".,;:!?)\]'"]|[\w.+-]+@[\w-]+(?:\.[\w-]+)+)([.,;:!?)\]'"]*)$/i,Q=/^(?:https?:\/\/|www\.)\S+$|^mailto:\S+$/i;function N(e){return/^www\./i.test(e)?`https://${e}`:/^[\w.+-]+@/.test(e)?`mailto:${e}`:e}function H(e,r,o){let t=e.doc.resolve(o);if(!t.parent.isTextblock||t.parent.type.spec.code)return!1;let s=t.parent.textBetween(0,t.parentOffset,void 0,"\uFFFC").match(K);if(!s)return!1;let i=s[1],l=o-s[2].length,u=l-i.length,w=(0,p.marksOf)(e).link;if(e.doc.rangeHasMark(u,l,w))return!1;let h=N(i);return(0,y.isSafeLinkUrl)(h)?(r.addMark(u,l,w.create({href:h})),!0):!1}var re=(0,I.definePlugin)({name:"autolink",prosemirrorPlugins:e=>[(0,m.inputRules)({rules:[new m.InputRule(/\S\s$/,(r,o,t,n)=>{if(!e.isAllowed("link"))return null;let s=r.tr,i=t+o[0].length-1;return H(r,s,i)?s.insertText(o[0].slice(-1),n).removeStoredMark((0,p.marksOf)(r).link):null})]}),new c.Plugin({appendTransaction(r,o,t){if(!e.isAllowed("link")||!r.some(u=>u.docChanged))return null;let{$from:n,empty:s}=t.selection;if(!s||n.parentOffset!==0||n.depth<1)return null;let i=c.Selection.findFrom(t.doc.resolve(n.before()),-1,!0);if(!i||!i.empty||i.$from.parentOffset!==i.$from.parent.content.size)return null;let l=t.tr;return H(t,l,i.from)?l:null}}),new c.Plugin({props:{handlePaste(r,o){let{state:t}=r;if(t.selection.empty||!e.isAllowed("link"))return!1;let n=(o.clipboardData?.getData("text/plain")??"").trim();if(!Q.test(n))return!1;let s=N(n);if(!(0,y.isSafeLinkUrl)(s))return!1;let{from:i,to:l}=t.selection,u=(0,p.marksOf)(t).link;return r.dispatch(t.tr.removeMark(i,l,u).addMark(i,l,u.create({href:s}))),!0}}})]});export{re as default};
|
|
2
|
+
//# sourceMappingURL=autolink-7e2e7be2.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["nova-shared:node_modules/.pnpm/prosemirror-inputrules@1.7.0/node_modules/prosemirror-inputrules/dist/index.js", "nova-shared:node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.js", "nova-shared:packages/core/src/commands.ts", "nova-shared:packages/core/src/plugins.ts", "nova-shared:packages/core/src/url.ts", "../../../core/src/plugins/autolink.ts"],
|
|
4
|
+
"sourcesContent": ["var m = globalThis[\"__novaprose_tinymce\"][\"node_modules/.pnpm/prosemirror-inputrules@1.7.0/node_modules/prosemirror-inputrules/dist/index.js\"];\nObject.defineProperty(exports, '__esModule', { value: true });\nfor (var k in m) (function (k) { Object.defineProperty(exports, k, { enumerable: true, get: function () { return m[k]; } }); })(k);", "var m = globalThis[\"__novaprose_tinymce\"][\"node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.js\"];\nObject.defineProperty(exports, '__esModule', { value: true });\nfor (var k in m) (function (k) { Object.defineProperty(exports, k, { enumerable: true, get: function () { return m[k]; } }); })(k);", "var m = globalThis[\"__novaprose_tinymce\"][\"packages/core/src/commands.ts\"];\nObject.defineProperty(exports, '__esModule', { value: true });\nfor (var k in m) (function (k) { Object.defineProperty(exports, k, { enumerable: true, get: function () { return m[k]; } }); })(k);", "var m = globalThis[\"__novaprose_tinymce\"][\"packages/core/src/plugins.ts\"];\nObject.defineProperty(exports, '__esModule', { value: true });\nfor (var k in m) (function (k) { Object.defineProperty(exports, k, { enumerable: true, get: function () { return m[k]; } }); })(k);", "var m = globalThis[\"__novaprose_tinymce\"][\"packages/core/src/url.ts\"];\nObject.defineProperty(exports, '__esModule', { value: true });\nfor (var k in m) (function (k) { Object.defineProperty(exports, k, { enumerable: true, get: function () { return m[k]; } }); })(k);", "import { InputRule, inputRules } from 'prosemirror-inputrules';\nimport type { EditorState, Transaction } from 'prosemirror-state';\nimport { Plugin, Selection } from 'prosemirror-state';\nimport { marksOf } from '../commands';\nimport { definePlugin } from '../plugins';\nimport { isSafeLinkUrl } from '../url';\n\n/**\n * \u041F\u043B\u0430\u0433\u0438\u043D autolink:\n * - \u0430\u0434\u0440\u0435\u0441 \u0438\u043B\u0438 e-mail \u0441\u0442\u0430\u043D\u043E\u0432\u0438\u0442\u0441\u044F \u0441\u0441\u044B\u043B\u043A\u043E\u0439, \u043A\u043E\u0433\u0434\u0430 \u043F\u043E\u0441\u043B\u0435 \u043D\u0435\u0433\u043E \u043D\u0430\u0431\u0440\u0430\u043D \u043F\u0440\u043E\u0431\u0435\u043B \u0438\u043B\u0438 \u043D\u0430\u0436\u0430\u0442 Enter;\n * - \u0432\u0441\u0442\u0430\u0432\u043A\u0430 \u0430\u0434\u0440\u0435\u0441\u0430 \u043F\u043E\u0432\u0435\u0440\u0445 \u0432\u044B\u0434\u0435\u043B\u0435\u043D\u043D\u043E\u0433\u043E \u0442\u0435\u043A\u0441\u0442\u0430 \u0434\u0435\u043B\u0430\u0435\u0442 \u044D\u0442\u043E\u0442 \u0442\u0435\u043A\u0441\u0442 \u0441\u0441\u044B\u043B\u043A\u043E\u0439 (\u043A\u0430\u043A \u0432 Google Docs).\n * `plugins: ['autolink']`.\n */\n\n// \u0410\u0434\u0440\u0435\u0441 \u0432 \u043A\u043E\u043D\u0446\u0435 \u0442\u0435\u043A\u0441\u0442\u0430 (\u0433\u0440\u0443\u043F\u043F\u0430 1) \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u044E\u0449\u0430\u044F \u043F\u0443\u043D\u043A\u0442\u0443\u0430\u0446\u0438\u044F \u043F\u043E\u0441\u043B\u0435 \u043D\u0435\u0433\u043E (\u0433\u0440\u0443\u043F\u043F\u0430 2): \u00AB\u0441\u043C. https://x.com.\u00BB \u2014\n// \u0442\u043E\u0447\u043A\u0430 \u0432 \u0441\u0441\u044B\u043B\u043A\u0443 \u043D\u0435 \u0432\u0445\u043E\u0434\u0438\u0442.\nconst URL_AT_END =\n /(?:^|[\\s(])((?:https?:\\/\\/|www\\.)[^\\s<>\"]*[^\\s<>\".,;:!?)\\]'\"]|[\\w.+-]+@[\\w-]+(?:\\.[\\w-]+)+)([.,;:!?)\\]'\"]*)$/i;\nconst SINGLE_URL = /^(?:https?:\\/\\/|www\\.)\\S+$|^mailto:\\S+$/i;\n\nfunction toHref(text: string): string {\n if (/^www\\./i.test(text)) return `https://${text}`;\n if (/^[\\w.+-]+@/.test(text)) return `mailto:${text}`;\n return text;\n}\n\n/** \u0421\u0434\u0435\u043B\u0430\u0442\u044C \u0441\u0441\u044B\u043B\u043A\u043E\u0439 \u0430\u0434\u0440\u0435\u0441, \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u044E\u0449\u0438\u0439\u0441\u044F \u0432 \u043F\u043E\u0437\u0438\u0446\u0438\u0438 end (\u0435\u0441\u043B\u0438 \u043E\u043D \u0435\u0441\u0442\u044C \u0438 \u0435\u0449\u0451 \u043D\u0435 \u0441\u0441\u044B\u043B\u043A\u0430). */\nfunction linkifyBefore(state: EditorState, tr: Transaction, end: number): boolean {\n const $end = state.doc.resolve(end);\n if (!$end.parent.isTextblock || $end.parent.type.spec.code) return false;\n const textBefore = $end.parent.textBetween(0, $end.parentOffset, undefined, '\uFFFC');\n const match = textBefore.match(URL_AT_END);\n if (!match) return false;\n const text = match[1]!;\n const to = end - match[2]!.length;\n const from = to - text.length;\n const link = marksOf(state).link;\n if (state.doc.rangeHasMark(from, to, link)) return false;\n const href = toHref(text);\n if (!isSafeLinkUrl(href)) return false;\n tr.addMark(from, to, link.create({ href }));\n return true;\n}\n\nexport default definePlugin({\n name: 'autolink',\n prosemirrorPlugins: (editor) => [\n inputRules({\n rules: [\n // \u041F\u0440\u043E\u0431\u0435\u043B \u043F\u043E\u0441\u043B\u0435 \u0430\u0434\u0440\u0435\u0441\u0430: \u043E\u0444\u043E\u0440\u043C\u043B\u044F\u0435\u043C \u0430\u0434\u0440\u0435\u0441 \u0441\u0441\u044B\u043B\u043A\u043E\u0439 \u0438 \u0432\u0441\u0442\u0430\u0432\u043B\u044F\u0435\u043C \u0441\u0430\u043C \u043F\u0440\u043E\u0431\u0435\u043B.\n new InputRule(/\\S\\s$/, (state, match, start, end) => {\n if (!editor.isAllowed('link')) return null;\n const tr = state.tr;\n const urlEnd = start + match[0].length - 1;\n if (!linkifyBefore(state, tr, urlEnd)) return null;\n return tr.insertText(match[0].slice(-1), end).removeStoredMark(marksOf(state).link);\n }),\n ],\n }),\n new Plugin({\n /**\n * Enter \u043F\u043E\u0441\u043B\u0435 \u0430\u0434\u0440\u0435\u0441\u0430. \u0420\u0430\u0441\u043A\u043B\u0430\u0434\u043A\u0430 \u043A\u043B\u0430\u0432\u0438\u0448 \u044F\u0434\u0440\u0430 \u043E\u0431\u0440\u0430\u0431\u0430\u0442\u044B\u0432\u0430\u0435\u0442 Enter \u0440\u0430\u043D\u044C\u0448\u0435 \u043F\u043B\u0430\u0433\u0438\u043D\u043E\u0432, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0441\u043C\u043E\u0442\u0440\u0438\u043C\n * \u043D\u0430 \u0440\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442: \u043A\u0443\u0440\u0441\u043E\u0440 \u0432 \u043D\u0430\u0447\u0430\u043B\u0435 \u043D\u043E\u0432\u043E\u0433\u043E \u0431\u043B\u043E\u043A\u0430, \u0430 \u043F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0438\u0439 \u0431\u043B\u043E\u043A \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u0430\u0434\u0440\u0435\u0441\u043E\u043C.\n */\n appendTransaction(transactions, _old, state) {\n if (!editor.isAllowed('link') || !transactions.some((tr) => tr.docChanged)) return null;\n const { $from, empty } = state.selection;\n if (!empty || $from.parentOffset !== 0 || $from.depth < 1) return null;\n // \u041A\u043E\u043D\u0435\u0446 \u043F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0435\u0433\u043E \u0442\u0435\u043A\u0441\u0442\u043E\u0432\u043E\u0433\u043E \u0431\u043B\u043E\u043A\u0430 \u2014 \u0432 \u0442\u043E\u043C \u0447\u0438\u0441\u043B\u0435 \u0432 \u0441\u043E\u0441\u0435\u0434\u043D\u0435\u043C \u043F\u0443\u043D\u043A\u0442\u0435 \u0441\u043F\u0438\u0441\u043A\u0430 \u0438\u043B\u0438 \u044F\u0447\u0435\u0439\u043A\u0435.\n const prev = Selection.findFrom(state.doc.resolve($from.before()), -1, true);\n if (!prev || !prev.empty || prev.$from.parentOffset !== prev.$from.parent.content.size)\n return null;\n const tr = state.tr;\n return linkifyBefore(state, tr, prev.from) ? tr : null;\n },\n }),\n new Plugin({\n props: {\n handlePaste(view, event) {\n const { state } = view;\n if (state.selection.empty || !editor.isAllowed('link')) return false;\n const text = (event.clipboardData?.getData('text/plain') ?? '').trim();\n if (!SINGLE_URL.test(text)) return false;\n const href = toHref(text);\n if (!isSafeLinkUrl(href)) return false;\n const { from, to } = state.selection;\n const link = marksOf(state).link;\n view.dispatch(\n state.tr.removeMark(from, to, link).addMark(from, to, link.create({ href })),\n );\n return true;\n },\n },\n }),\n ],\n});\n"],
|
|
5
|
+
"mappings": "ygBAAA,IAAAA,EAAAC,EAAAC,GAAA,KAAIC,EAAI,WAAW,oBAAuB,mGAAmG,EAC7I,OAAO,eAAeD,EAAS,aAAc,CAAE,MAAO,EAAK,CAAC,EAC5D,IAASE,KAAKD,GAAI,SAAUC,EAAG,CAAE,OAAO,eAAeF,EAASE,EAAG,CAAE,WAAY,GAAM,IAAK,UAAY,CAAE,OAAOD,EAAEC,CAAC,CAAG,CAAE,CAAC,CAAG,GAAGA,CAAC,EAAxH,IAAAA,ICFT,IAAAC,EAAAC,EAAAC,GAAA,KAAIC,EAAI,WAAW,oBAAuB,yFAAyF,EACnI,OAAO,eAAeD,EAAS,aAAc,CAAE,MAAO,EAAK,CAAC,EAC5D,IAASE,KAAKD,GAAI,SAAUC,EAAG,CAAE,OAAO,eAAeF,EAASE,EAAG,CAAE,WAAY,GAAM,IAAK,UAAY,CAAE,OAAOD,EAAEC,CAAC,CAAG,CAAE,CAAC,CAAG,GAAGA,CAAC,EAAxH,IAAAA,ICFT,IAAAC,EAAAC,EAAAC,GAAA,KAAIC,EAAI,WAAW,oBAAuB,+BAA+B,EACzE,OAAO,eAAeD,EAAS,aAAc,CAAE,MAAO,EAAK,CAAC,EAC5D,IAAS,KAAKC,GAAI,SAAUC,EAAG,CAAE,OAAO,eAAeF,EAASE,EAAG,CAAE,WAAY,GAAM,IAAK,UAAY,CAAE,OAAOD,EAAEC,CAAC,CAAG,CAAE,CAAC,CAAG,GAAG,CAAC,EAAxH,QCFT,IAAAC,EAAAC,EAAAC,GAAA,KAAIC,EAAI,WAAW,oBAAuB,8BAA8B,EACxE,OAAO,eAAeD,EAAS,aAAc,CAAE,MAAO,EAAK,CAAC,EAC5D,IAASE,KAAKD,GAAI,SAAUC,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M,UAAU,OAAS,CAACU,EAAO,UAAU,MAAM,EAAG,MAAO,GAC/D,IAAMZ,GAAQqB,EAAM,eAAe,QAAQ,YAAY,GAAK,IAAI,KAAK,EACrE,GAAI,CAACvB,EAAW,KAAKE,CAAI,EAAG,MAAO,GACnC,IAAMU,EAAOX,EAAOC,CAAI,EACxB,GAAI,IAAC,iBAAcU,CAAI,EAAG,MAAO,GACjC,GAAM,CAAE,KAAAF,EAAM,GAAAD,CAAG,EAAIL,EAAM,UACrBO,KAAO,WAAQP,CAAK,EAAE,KAC5B,OAAAkB,EAAK,SACHlB,EAAM,GAAG,WAAWM,EAAMD,EAAIE,CAAI,EAAE,QAAQD,EAAMD,EAAIE,EAAK,OAAO,CAAE,KAAAC,CAAK,CAAC,CAAC,CAC7E,EACO,EACT,CACF,CACF,CAAC,CACH,CACF,CAAC",
|
|
6
|
+
"names": ["require_dist", "__commonJSMin", "exports", "m", "k", "require_dist", "__commonJSMin", "exports", "m", "k", "require_commands", "__commonJSMin", "exports", "m", "k", "require_plugins", "__commonJSMin", "exports", "m", "k", "require_url", "__commonJSMin", "exports", "m", "k", "import_prosemirror_inputrules", "import_prosemirror_state", "import_commands", "import_plugins", "import_url", "URL_AT_END", "SINGLE_URL", "toHref", "text", "linkifyBefore", "state", "tr", "end", "$end", "match", "to", "from", "link", "href", "autolink_default", "editor", "start", "urlEnd", "transactions", "_old", "$from", "empty", "prev", "view", "event"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var l=Object.create;var s=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty;var v=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var y=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of f(t))!h.call(e,r)&&r!==o&&s(e,r,{get:()=>t[r],enumerable:!(n=c(t,r))||n.enumerable});return e};var x=(e,t,o)=>(o=e!=null?l(g(e)):{},y(t||!e||!e.__esModule?s(o,"default",{value:e,enumerable:!0}):o,e));var m=v(i=>{var a=globalThis.__novaprose_tinymce["packages/core/src/plugins.ts"];Object.defineProperty(i,"__esModule",{value:!0});for(u in a)(function(e){Object.defineProperty(i,e,{enumerable:!0,get:function(){return a[e]}})})(u);var u});var p=x(m(),1),z=(0,p.definePlugin)({name:"autoresize",setup(e){let{minHeight:t,maxHeight:o}=e.options.pluginOptions?.autoresize??{},n=e.root.querySelector(".nova-content");if(n)return e.root.classList.add("nova-autoresize"),t!==void 0&&e.root.style.setProperty("--nova-min-height",`${t}px`),o!==void 0&&(n.style.maxHeight=`${o}px`),()=>{e.root.classList.remove("nova-autoresize"),e.root.style.removeProperty("--nova-min-height"),n.style.removeProperty("max-height")}}});export{z as default};
|
|
2
|
+
//# sourceMappingURL=autoresize-d6c9537b.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["nova-shared:packages/core/src/plugins.ts", "../../../core/src/plugins/autoresize.ts"],
|
|
4
|
+
"sourcesContent": ["var m = globalThis[\"__novaprose_tinymce\"][\"packages/core/src/plugins.ts\"];\nObject.defineProperty(exports, '__esModule', { value: true });\nfor (var k in m) (function (k) { Object.defineProperty(exports, k, { enumerable: true, get: function () { return m[k]; } }); })(k);", "import { definePlugin } from '../plugins';\n\n/**\n * \u041F\u043B\u0430\u0433\u0438\u043D autoresize: \u0432\u044B\u0441\u043E\u0442\u0430 \u0440\u0435\u0434\u0430\u043A\u0442\u043E\u0440\u0430 \u0441\u043B\u0435\u0434\u0443\u0435\u0442 \u0437\u0430 \u0442\u0435\u043A\u0441\u0442\u043E\u043C \u0432 \u043F\u0440\u0435\u0434\u0435\u043B\u0430\u0445 minHeight\u2026maxHeight;\n * \u0434\u0430\u043B\u044C\u0448\u0435 \u2014 \u043F\u0440\u043E\u043A\u0440\u0443\u0442\u043A\u0430 \u0432\u043D\u0443\u0442\u0440\u0438 \u0440\u0435\u0434\u0430\u043A\u0442\u043E\u0440\u0430, \u0430 \u0442\u0443\u043B\u0431\u0430\u0440 \u043E\u0441\u0442\u0430\u0451\u0442\u0441\u044F \u043D\u0430 \u043C\u0435\u0441\u0442\u0435.\n * `plugins: ['autoresize']`, `pluginOptions: { autoresize: { minHeight: 200, maxHeight: 600 } }`.\n */\n\nexport interface AutoresizeOptions {\n /** \u041C\u0438\u043D\u0438\u043C\u0430\u043B\u044C\u043D\u0430\u044F \u0432\u044B\u0441\u043E\u0442\u0430 \u043E\u0431\u043B\u0430\u0441\u0442\u0438 \u0442\u0435\u043A\u0441\u0442\u0430, px. */\n minHeight?: number;\n /** \u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430\u044F \u0432\u044B\u0441\u043E\u0442\u0430 \u043E\u0431\u043B\u0430\u0441\u0442\u0438 \u0442\u0435\u043A\u0441\u0442\u0430, px (\u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E \u2014 \u0431\u0435\u0437 \u043E\u0433\u0440\u0430\u043D\u0438\u0447\u0435\u043D\u0438\u044F). */\n maxHeight?: number;\n}\n\nexport default definePlugin({\n name: 'autoresize',\n setup(editor) {\n const { minHeight, maxHeight } = (editor.options.pluginOptions?.autoresize ??\n {}) as AutoresizeOptions;\n const content = editor.root.querySelector<HTMLElement>('.nova-content');\n if (!content) return;\n editor.root.classList.add('nova-autoresize');\n if (minHeight !== undefined)\n editor.root.style.setProperty('--nova-min-height', `${minHeight}px`);\n if (maxHeight !== undefined) content.style.maxHeight = `${maxHeight}px`;\n return () => {\n editor.root.classList.remove('nova-autoresize');\n editor.root.style.removeProperty('--nova-min-height');\n content.style.removeProperty('max-height');\n };\n },\n});\n"],
|
|
5
|
+
"mappings": "ygBAAA,IAAAA,EAAAC,EAAAC,GAAA,KAAIC,EAAI,WAAW,oBAAuB,8BAA8B,EACxE,OAAO,eAAeD,EAAS,aAAc,CAAE,MAAO,EAAK,CAAC,EAC5D,IAASE,KAAKD,GAAI,SAAUC,EAAG,CAAE,OAAO,eAAeF,EAASE,EAAG,CAAE,WAAY,GAAM,IAAK,UAAY,CAAE,OAAOD,EAAEC,CAAC,CAAG,CAAE,CAAC,CAAG,GAAGA,CAAC,EAAxH,IAAAA,ICFT,IAAAC,EAA6B,SAetBC,KAAQ,gBAAa,CAC1B,KAAM,aACN,MAAMC,EAAQ,CACZ,GAAM,CAAE,UAAAC,EAAW,UAAAC,CAAU,EAAKF,EAAO,QAAQ,eAAe,YAC9D,CAAC,EACGG,EAAUH,EAAO,KAAK,cAA2B,eAAe,EACtE,GAAKG,EACL,OAAAH,EAAO,KAAK,UAAU,IAAI,iBAAiB,EACvCC,IAAc,QAChBD,EAAO,KAAK,MAAM,YAAY,oBAAqB,GAAGC,CAAS,IAAI,EACjEC,IAAc,SAAWC,EAAQ,MAAM,UAAY,GAAGD,CAAS,MAC5D,IAAM,CACXF,EAAO,KAAK,UAAU,OAAO,iBAAiB,EAC9CA,EAAO,KAAK,MAAM,eAAe,mBAAmB,EACpDG,EAAQ,MAAM,eAAe,YAAY,CAC3C,CACF,CACF,CAAC",
|
|
6
|
+
"names": ["require_plugins", "__commonJSMin", "exports", "m", "k", "import_plugins", "autoresize_default", "editor", "minHeight", "maxHeight", "content"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var N=Object.create;var y=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var u=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var J=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of B(t))!H.call(e,r)&&r!==n&&y(e,r,{get:()=>t[r],enumerable:!(a=R(t,r))||a.enumerable});return e};var l=(e,t,n)=>(n=e!=null?N(C(e)):{},J(t||!e||!e.__esModule?y(n,"default",{value:e,enumerable:!0}):n,e));var _=u(c=>{var b=globalThis.__novaprose_tinymce["packages/core/src/ui/icons.ts"];Object.defineProperty(c,"__esModule",{value:!0});for(v in b)(function(e){Object.defineProperty(c,e,{enumerable:!0,get:function(){return b[e]}})})(v);var v});var T=u(f=>{var h=globalThis.__novaprose_tinymce["packages/core/src/plugins.ts"];Object.defineProperty(f,"__esModule",{value:!0});for(O in h)(function(e){Object.defineProperty(f,e,{enumerable:!0,get:function(){return h[e]}})})(O);var O});var j=u(m=>{var M=globalThis.__novaprose_tinymce["packages/core/src/plugins/shared.ts"];Object.defineProperty(m,"__esModule",{value:!0});for(P in M)(function(e){Object.defineProperty(m,e,{enumerable:!0,get:function(){return M[e]}})})(P);var P});var A=l(_(),1),D=l(T(),1),S=l(j(),1),x=A.icons.save,$={en:{restore:"Restore last draft",found:"An unsaved draft was found. Use \u201CRestore last draft\u201D to bring it back.",restored:"Draft restored"}};function U(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}var K=(0,D.definePlugin)({name:"autosave",toolbar:"restoredraft",setup(e){let t=e.options.pluginOptions?.autosave??{},n=(0,S.pickLabels)(e,"autosave",$),a=U(),r=t.key??`novaprose-draft:${typeof location>"u"?"":location.pathname}:${e.options.element.id||"editor"}`,I=t.delay??1e3,L=(t.retention??10080)*6e4,p=()=>{try{let s=JSON.parse(a?.getItem(r)??"null");return!s||typeof s.html!="string"||Date.now()-s.time>L?null:s}catch{return null}},o=p();o&&o.html===e.getHTML()&&(o=null),o&&e.ui.notify({text:n.found,timeout:8e3});let i,d=()=>{i=void 0;try{e.isEmpty()?a?.removeItem(r):a?.setItem(r,JSON.stringify({html:e.getHTML(),time:Date.now()}))}catch{}},E=e.on("change",()=>{o=null,clearTimeout(i),i=setTimeout(d,I)}),g=()=>{let s=o??p();s&&(e.setContent(s.html),o=null,e.ui.notify({text:n.restored}),e.focus())},w={icon:x,tooltip:n.restore,isEnabled:()=>e.isEditable()&&o!==null,onAction:g};return e.ui.registry.addButton("restoredraft",w),e.ui.registry.addMenuItem("restoredraft",{text:n.restore,icon:x,onAction:g}),()=>{E(),i!==void 0&&(clearTimeout(i),d())}}});export{$ as LABELS,K as default};
|
|
2
|
+
//# sourceMappingURL=autosave-4fd46720.js.map
|