@novaprose/core 0.5.2 → 0.5.3
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/THIRD_PARTY_NOTICES.md +50 -0
- package/dist/{autosave-WODRZ7L6.js → autosave-DH7SO4UQ.js} +5 -2
- package/dist/autosave-DH7SO4UQ.js.map +1 -0
- package/dist/{charmap-LWA7TL3K.js → charmap-F7EVJ56K.js} +5 -2
- package/dist/charmap-F7EVJ56K.js.map +1 -0
- package/dist/{chunk-2A3IYKPE.js → chunk-55LD2TT2.js} +5 -3
- package/dist/{chunk-2A3IYKPE.js.map → chunk-55LD2TT2.js.map} +1 -1
- package/dist/{chunk-PHRON5PL.js → chunk-6AL2IS6V.js} +4 -150
- package/dist/chunk-6AL2IS6V.js.map +1 -0
- package/dist/chunk-MOO4PJGI.js +229 -0
- package/dist/chunk-MOO4PJGI.js.map +1 -0
- package/dist/{directionality-N62ZB7CF.js → directionality-MF5HDXH3.js} +6 -3
- package/dist/directionality-MF5HDXH3.js.map +1 -0
- package/dist/{emoticons-WQ3K4J6G.js → emoticons-SONBUCFV.js} +5 -2
- package/dist/emoticons-SONBUCFV.js.map +1 -0
- package/dist/index.cjs +236 -146
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +86 -70
- package/dist/index.d.ts +86 -70
- package/dist/index.js +23 -21
- package/dist/index.js.map +1 -1
- package/dist/{insertdatetime-2RZ3UUQE.js → insertdatetime-X2T4ZY6R.js} +5 -2
- package/dist/insertdatetime-X2T4ZY6R.js.map +1 -0
- package/dist/{nonbreaking-L6GNDHVO.js → nonbreaking-PP4KIJSR.js} +5 -2
- package/dist/nonbreaking-PP4KIJSR.js.map +1 -0
- package/dist/{quickbars-TIRY3RH4.js → quickbars-3WKHLKAR.js} +5 -3
- package/dist/{quickbars-TIRY3RH4.js.map → quickbars-3WKHLKAR.js.map} +1 -1
- package/dist/{revisionhistory-GDTOULKS.js → revisionhistory-FYRVDGRA.js} +7 -4
- package/dist/revisionhistory-FYRVDGRA.js.map +1 -0
- package/dist/{visualblocks-V4CQ4XMF.js → visualblocks-NPTMWFXD.js} +5 -2
- package/dist/visualblocks-NPTMWFXD.js.map +1 -0
- package/package.json +3 -2
- package/dist/autosave-WODRZ7L6.js.map +0 -1
- package/dist/charmap-LWA7TL3K.js.map +0 -1
- package/dist/chunk-PHRON5PL.js.map +0 -1
- package/dist/directionality-N62ZB7CF.js.map +0 -1
- package/dist/emoticons-WQ3K4J6G.js.map +0 -1
- package/dist/insertdatetime-2RZ3UUQE.js.map +0 -1
- package/dist/nonbreaking-L6GNDHVO.js.map +0 -1
- package/dist/revisionhistory-GDTOULKS.js.map +0 -1
- package/dist/visualblocks-V4CQ4XMF.js.map +0 -1
|
@@ -8,6 +8,9 @@ import {
|
|
|
8
8
|
icon,
|
|
9
9
|
uniqueId
|
|
10
10
|
} from "./chunk-HZRIBOPW.js";
|
|
11
|
+
import {
|
|
12
|
+
icons
|
|
13
|
+
} from "./chunk-MOO4PJGI.js";
|
|
11
14
|
import {
|
|
12
15
|
getLinkAt,
|
|
13
16
|
insertImage,
|
|
@@ -18,154 +21,6 @@ import {
|
|
|
18
21
|
nodesOf
|
|
19
22
|
} from "./chunk-GHEFKKRC.js";
|
|
20
23
|
|
|
21
|
-
// src/ui/icons.ts
|
|
22
|
-
var svg = (body) => `<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${body}</svg>`;
|
|
23
|
-
var icons = {
|
|
24
|
-
undo: svg('<path d="M9 14 4 9l5-5"/><path d="M4 9h11a5 5 0 0 1 0 10h-3"/>'),
|
|
25
|
-
redo: svg('<path d="m15 14 5-5-5-5"/><path d="M20 9H9a5 5 0 0 0 0 10h3"/>'),
|
|
26
|
-
bold: svg('<path d="M7 5h6a3.5 3.5 0 0 1 0 7H7z"/><path d="M7 12h7a3.5 3.5 0 0 1 0 7H7z"/>'),
|
|
27
|
-
italic: svg('<path d="M14 5h-4M14 19h-4M14 5l-4 14"/>'),
|
|
28
|
-
underline: svg('<path d="M7 4v6a5 5 0 0 0 10 0V4"/><path d="M5 20h14"/>'),
|
|
29
|
-
strike: svg(
|
|
30
|
-
'<path d="M4 12h16"/><path d="M16 7a4 3 0 0 0-4-2c-2.5 0-4 1.3-4 3"/><path d="M8 17a4 3 0 0 0 4 2c2.5 0 4-1.3 4-3"/>'
|
|
31
|
-
),
|
|
32
|
-
code: svg('<path d="m9 8-4 4 4 4"/><path d="m15 8 4 4-4 4"/>'),
|
|
33
|
-
subscript: svg(
|
|
34
|
-
'<path d="m4 6 8 9M12 6l-8 9"/><path d="M20 20h-4c0-1.5 4-2 4-4a1.5 1.5 0 0 0-3-.5"/>'
|
|
35
|
-
),
|
|
36
|
-
superscript: svg(
|
|
37
|
-
'<path d="m4 9 8 9M12 9l-8 9"/><path d="M20 10h-4c0-1.5 4-2 4-4a1.5 1.5 0 0 0-3-.5"/>'
|
|
38
|
-
),
|
|
39
|
-
bulletList: svg(
|
|
40
|
-
'<circle cx="5" cy="7" r="1"/><circle cx="5" cy="12" r="1"/><circle cx="5" cy="17" r="1"/><path d="M9 7h11M9 12h11M9 17h11"/>'
|
|
41
|
-
),
|
|
42
|
-
orderedList: svg(
|
|
43
|
-
'<path d="M4 5h1v4M4 9h2"/><path d="M4 14h2l-2 3h2"/><path d="M10 7h10M10 12h10M10 17h10"/>'
|
|
44
|
-
),
|
|
45
|
-
indent: svg('<path d="M4 6h16M10 12h10M4 18h16"/><path d="m4 10 3 2-3 2"/>'),
|
|
46
|
-
outdent: svg('<path d="M4 6h16M10 12h10M4 18h16"/><path d="m7 10-3 2 3 2"/>'),
|
|
47
|
-
blockquote: svg(
|
|
48
|
-
'<path d="M6 17c-1.5 0-2.5-1-2.5-3 0-3 2-6 5-7"/><path d="M15 17c-1.5 0-2.5-1-2.5-3 0-3 2-6 5-7"/><circle cx="6" cy="14" r="2.5"/><circle cx="15" cy="14" r="2.5"/>'
|
|
49
|
-
),
|
|
50
|
-
codeBlock: svg(
|
|
51
|
-
'<rect x="3" y="4" width="18" height="16" rx="2"/><path d="m9 10-2 2 2 2M15 10l2 2-2 2"/>'
|
|
52
|
-
),
|
|
53
|
-
alignLeft: svg('<path d="M4 6h16M4 10h10M4 14h16M4 18h10"/>'),
|
|
54
|
-
alignCenter: svg('<path d="M4 6h16M7 10h10M4 14h16M7 18h10"/>'),
|
|
55
|
-
alignRight: svg('<path d="M4 6h16M10 10h10M4 14h16M10 18h10"/>'),
|
|
56
|
-
alignJustify: svg('<path d="M4 6h16M4 10h16M4 14h16M4 18h16"/>'),
|
|
57
|
-
horizontalRule: svg('<path d="M4 12h16"/><path d="M8 7h8M8 17h8" opacity=".4"/>'),
|
|
58
|
-
link: svg(
|
|
59
|
-
'<path d="M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1"/><path d="M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1"/>'
|
|
60
|
-
),
|
|
61
|
-
unlink: svg(
|
|
62
|
-
'<path d="M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1"/><path d="M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1"/><path d="M3 3l18 18"/>'
|
|
63
|
-
),
|
|
64
|
-
image: svg(
|
|
65
|
-
'<rect x="3" y="4" width="18" height="16" rx="2"/><circle cx="9" cy="10" r="2"/><path d="m21 16-5-5-9 9"/>'
|
|
66
|
-
),
|
|
67
|
-
clearFormatting: svg('<path d="M6 5h12M12 5l-3 14"/><path d="m15 15 5 5M20 15l-5 5"/>'),
|
|
68
|
-
// «T²» — меню дополнительного форматирования
|
|
69
|
-
formatMore: svg(
|
|
70
|
-
'<path d="M3 7h10M8 7v12"/><path d="M21 11h-4c0-1.5 4-2 4-4a1.5 1.5 0 0 0-3-.5"/>'
|
|
71
|
-
),
|
|
72
|
-
// Картинка: обтекание слева / по центру / справа — прямоугольник + строки текста
|
|
73
|
-
imageLeft: svg(
|
|
74
|
-
'<rect x="3" y="5" width="8" height="8" rx="1"/><path d="M14 6h7M14 10h7M3 17h18M3 20h12"/>'
|
|
75
|
-
),
|
|
76
|
-
imageCenter: svg('<rect x="7" y="4" width="10" height="9" rx="1"/><path d="M3 17h18M6 20h12"/>'),
|
|
77
|
-
imageRight: svg(
|
|
78
|
-
'<rect x="13" y="5" width="8" height="8" rx="1"/><path d="M3 6h7M3 10h7M3 17h18M9 20h12"/>'
|
|
79
|
-
),
|
|
80
|
-
resize: svg('<path d="M15 3h6v6M9 21H3v-6"/><path d="m21 3-7 7M3 21l7-7"/>'),
|
|
81
|
-
altText: svg(
|
|
82
|
-
'<rect x="3" y="5" width="18" height="14" rx="2"/><path d="M7 15l2.5-6 2.5 6M7.8 13h3.4M15 9v6h3"/>'
|
|
83
|
-
),
|
|
84
|
-
trash: svg('<path d="M4 7h16M10 11v6M14 11v6"/><path d="M6 7l1 13h10l1-13M9 7V4h6v3"/>'),
|
|
85
|
-
paragraph: svg('<path d="M13 4v16M17 4v16M19 4H9.5a4.5 4.5 0 0 0 0 9H13"/>'),
|
|
86
|
-
h1: svg('<path d="M4 6v12M12 6v12M4 12h8"/><path d="m16 9 3-2v11"/>'),
|
|
87
|
-
h2: svg(
|
|
88
|
-
'<path d="M4 6v12M12 6v12M4 12h8"/><path d="M16 9.5a2.5 2.5 0 1 1 5 .5c0 1.5-5 4-5 8h5"/>'
|
|
89
|
-
),
|
|
90
|
-
h3: svg('<path d="M4 6v12M12 6v12M4 12h8"/><path d="M16 7.5h4.5l-2.5 3.5a3 3 0 1 1-2.5 5"/>'),
|
|
91
|
-
// Планшет буфера обмена с буквой T — «вставить как текст»
|
|
92
|
-
pasteText: svg(
|
|
93
|
-
'<rect x="5" y="4" width="14" height="17" rx="2"/><path d="M9 4V3h6v1M9 10h6M12 10v7"/>'
|
|
94
|
-
),
|
|
95
|
-
// ---------- таблицы ----------
|
|
96
|
-
table: svg(
|
|
97
|
-
'<rect x="3" y="4" width="18" height="16" rx="1.5"/><path d="M3 10h18M3 15h18M9 4v16M15 4v16"/>'
|
|
98
|
-
),
|
|
99
|
-
rowBefore: svg('<rect x="3" y="12" width="18" height="8" rx="1"/><path d="M12 3v6M9 6h6"/>'),
|
|
100
|
-
rowAfter: svg('<rect x="3" y="4" width="18" height="8" rx="1"/><path d="M12 15v6M9 18h6"/>'),
|
|
101
|
-
rowDelete: svg(
|
|
102
|
-
'<rect x="3" y="8" width="18" height="8" rx="1"/><path d="m10 10 4 4M14 10l-4 4"/>'
|
|
103
|
-
),
|
|
104
|
-
colBefore: svg('<rect x="12" y="3" width="8" height="18" rx="1"/><path d="M3 12h6M6 9v6"/>'),
|
|
105
|
-
colAfter: svg('<rect x="4" y="3" width="8" height="18" rx="1"/><path d="M15 12h6M18 9v6"/>'),
|
|
106
|
-
colDelete: svg(
|
|
107
|
-
'<rect x="8" y="3" width="8" height="18" rx="1"/><path d="m10 10 4 4M14 10l-4 4"/>'
|
|
108
|
-
),
|
|
109
|
-
merge: svg(
|
|
110
|
-
'<rect x="3" y="5" width="18" height="14" rx="1"/><path d="M6 12h4M14 12h4M8 10l2 2-2 2M16 10l-2 2 2 2"/>'
|
|
111
|
-
),
|
|
112
|
-
split: svg(
|
|
113
|
-
'<rect x="3" y="5" width="18" height="14" rx="1"/><path d="M12 5v14M5 12h4M15 12h4M7 10l-2 2 2 2M17 10l2 2-2 2"/>'
|
|
114
|
-
),
|
|
115
|
-
rowHeader: svg(
|
|
116
|
-
'<rect x="3" y="4" width="18" height="16" rx="1.5"/><path d="M3 9.5h18"/><path d="M4 5h16v4H4z" fill="currentColor" opacity=".35" stroke="none"/>'
|
|
117
|
-
),
|
|
118
|
-
colHeader: svg(
|
|
119
|
-
'<rect x="3" y="4" width="18" height="16" rx="1.5"/><path d="M9.5 4v16"/><path d="M4 5h5v14H4z" fill="currentColor" opacity=".35" stroke="none"/>'
|
|
120
|
-
),
|
|
121
|
-
sort: svg('<path d="M7 4v16M4 17l3 3 3-3"/><path d="M14 6h7M14 11h5M14 16h3"/>'),
|
|
122
|
-
tableProps: svg(
|
|
123
|
-
'<rect x="3" y="4" width="18" height="16" rx="2"/><path d="M3 10h18M9 10v10"/><path d="M15 15h3"/>'
|
|
124
|
-
),
|
|
125
|
-
cellProps: svg(
|
|
126
|
-
'<rect x="3" y="4" width="18" height="16" rx="2"/><path d="M3 10h18M9 4v16"/><rect x="11" y="12" width="8" height="6" rx="1"/>'
|
|
127
|
-
),
|
|
128
|
-
tableDelete: svg(
|
|
129
|
-
'<rect x="3" y="4" width="13" height="12" rx="1"/><path d="M3 10h13M9.5 4v12"/><path d="m17 15 4 4M21 15l-4 4"/>'
|
|
130
|
-
),
|
|
131
|
-
chevronUp: svg('<path d="m7 14 5-5 5 5"/>'),
|
|
132
|
-
search: svg('<circle cx="11" cy="11" r="6.5"/><path d="m20 20-4.2-4.2"/>'),
|
|
133
|
-
fullscreen: svg('<path d="M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5"/>'),
|
|
134
|
-
fullscreenExit: svg('<path d="M9 4v5H4M15 4v5h5M9 20v-5H4M15 20v-5h5"/>'),
|
|
135
|
-
preview: svg(
|
|
136
|
-
'<path d="M2 12s3.6-7 10-7 10 7 10 7-3.6 7-10 7S2 12 2 12z"/><circle cx="12" cy="12" r="3"/>'
|
|
137
|
-
),
|
|
138
|
-
sourceCode: svg('<path d="m8 7-5 5 5 5M16 7l5 5-5 5M14 4l-4 16"/>'),
|
|
139
|
-
help: svg(
|
|
140
|
-
'<circle cx="12" cy="12" r="9"/><path d="M9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .9-1 1.6v.6"/><circle cx="12" cy="17" r=".6" fill="currentColor"/>'
|
|
141
|
-
),
|
|
142
|
-
print: svg(
|
|
143
|
-
'<path d="M7 9V3h10v6"/><rect x="3" y="9" width="18" height="8" rx="2"/><path d="M7 14h10v7H7z"/>'
|
|
144
|
-
),
|
|
145
|
-
check: svg('<path d="m5 12 5 5 9-10"/>'),
|
|
146
|
-
close: svg('<path d="M6 6l12 12M18 6 6 18"/>'),
|
|
147
|
-
chevronDown: svg('<path d="m7 10 5 5 5-5"/>'),
|
|
148
|
-
more: svg(
|
|
149
|
-
'<circle cx="5" cy="12" r="1.2" fill="currentColor"/><circle cx="12" cy="12" r="1.2" fill="currentColor"/><circle cx="19" cy="12" r="1.2" fill="currentColor"/>'
|
|
150
|
-
),
|
|
151
|
-
// Буква «A» — цвет полоски под ней задаётся через currentColor у .nova-color-bar
|
|
152
|
-
textColor: svg('<path d="m6 16 6-12 6 12"/><path d="M8.5 11h7"/>'),
|
|
153
|
-
highlight: svg('<path d="m14 4 6 6-8 8H6v-6z"/><path d="m11 7 6 6"/>'),
|
|
154
|
-
lineHeight: svg(
|
|
155
|
-
'<path d="M11 6h10M11 12h10M11 18h10"/><path d="m3 8 3-3 3 3M3 16l3 3 3-3M6 5v14"/>'
|
|
156
|
-
),
|
|
157
|
-
upload: svg(
|
|
158
|
-
'<path d="M12 16V4"/><path d="m7 9 5-5 5 5"/><path d="M4 16v3a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-3"/>'
|
|
159
|
-
),
|
|
160
|
-
externalLink: svg(
|
|
161
|
-
'<path d="M14 4h6v6"/><path d="M20 4 10 14"/><path d="M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/>'
|
|
162
|
-
),
|
|
163
|
-
copy: svg(
|
|
164
|
-
'<rect x="8" y="8" width="12" height="12" rx="2"/><path d="M16 8V5a1 1 0 0 0-1-1H5a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h3"/>'
|
|
165
|
-
),
|
|
166
|
-
edit: svg('<path d="M4 20h4L19 9l-4-4L4 16z"/><path d="m13 7 4 4"/>')
|
|
167
|
-
};
|
|
168
|
-
|
|
169
24
|
// src/image.ts
|
|
170
25
|
import {
|
|
171
26
|
NodeSelection,
|
|
@@ -1032,7 +887,6 @@ function setCellProps(props) {
|
|
|
1032
887
|
}
|
|
1033
888
|
|
|
1034
889
|
export {
|
|
1035
|
-
icons,
|
|
1036
890
|
openDialog,
|
|
1037
891
|
textField,
|
|
1038
892
|
selectField,
|
|
@@ -1065,4 +919,4 @@ export {
|
|
|
1065
919
|
getCellProps,
|
|
1066
920
|
setCellProps
|
|
1067
921
|
};
|
|
1068
|
-
//# sourceMappingURL=chunk-
|
|
922
|
+
//# sourceMappingURL=chunk-6AL2IS6V.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/image.ts","../src/ui/dialog.ts","../src/link.ts","../src/table.ts"],"sourcesContent":["import type { Node as PMNode } from 'prosemirror-model';\nimport {\n NodeSelection,\n Plugin,\n PluginKey,\n type Command,\n type EditorState,\n} from 'prosemirror-state';\nimport type { EditorView } from 'prosemirror-view';\nimport { insertImage } from './commands';\nimport type { Editor } from './editor';\nimport { nodesOf } from './commands';\nimport { textField } from './ui/dialog';\nimport { h, icon } from './ui/dom';\nimport { icons } from './ui/icons';\nimport { isSafeImageUrl } from './url';\n\n/**\n * Загрузчик изображений (аналог images_upload_handler): получает файл, возвращает URL.\n * progress(0..100) — необязательный индикатор.\n */\nexport type UploadImageHandler = (\n file: File,\n progress: (percent: number) => void,\n) => Promise<string>;\n\nconst IMAGE_TYPES = /^image\\/(png|jpe?g|gif|webp|avif|bmp)$/;\n\nexport function isSupportedImage(file: File): boolean {\n return IMAGE_TYPES.test(file.type);\n}\n\nfunction readAsDataUrl(file: File): Promise<string> {\n return new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => resolve(String(reader.result));\n reader.onerror = () => reject(reader.error ?? new Error('FileReader failed'));\n reader.readAsDataURL(file);\n });\n}\n\n/** Найти позицию картинки с данным src (нужно, т.к. документ мог измениться за время загрузки). */\nfunction findImage(view: EditorView, src: string): number | null {\n let found: number | null = null;\n view.state.doc.descendants((node, pos) => {\n if (found !== null) return false;\n if (node.type === nodesOf(view.state).image && node.attrs.src === src) found = pos;\n return true;\n });\n return found;\n}\n\n/**\n * Вставить и загрузить файлы изображений. Пока файл грузится, показываем его локальную копию\n * (blob:) полупрозрачной; после загрузки подменяем src, при ошибке — убираем и сообщаем.\n * Без uploadImage картинка встраивается как data:URL (как делает TinyMCE без обработчика).\n */\nexport function uploadImages(editor: Editor, files: File[], pos?: number): void {\n const images = files.filter(isSupportedImage);\n const view = editor.view;\n for (const file of images) {\n const blobUrl = URL.createObjectURL(file);\n const node = nodesOf(view.state).image.create({ src: blobUrl, alt: null });\n const tr = view.state.tr;\n if (pos !== undefined) tr.insert(Math.min(pos, tr.doc.content.size), node);\n else tr.replaceSelectionWith(node);\n // Загружаемая картинка подсвечивается CSS-правилом img[src^=\"blob:\"].\n view.dispatch(tr.scrollIntoView());\n\n const handler = editor.options.uploadImage;\n const notice = handler\n ? editor.ui.notify({ text: editor.ui.t('image.uploading'), timeout: 0 })\n : null;\n const upload = handler\n ? handler(file, (percent) =>\n notice?.setText(`${editor.ui.t('image.uploading')} ${Math.round(percent)}%`),\n )\n : readAsDataUrl(file);\n\n upload\n .then((url) => {\n if (!isSafeImageUrl(url)) throw new Error(`Unsafe image URL returned: ${url}`);\n const at = findImage(view, blobUrl);\n if (at === null) return;\n const current = view.state.doc.nodeAt(at)!;\n // Подмена src не должна быть отдельным шагом undo.\n view.dispatch(\n view.state.tr\n .setNodeMarkup(at, undefined, { ...current.attrs, src: url })\n .setMeta('addToHistory', false),\n );\n })\n .catch((error: unknown) => {\n console.error('[nova] image upload failed', error);\n const at = findImage(view, blobUrl);\n if (at !== null)\n view.dispatch(view.state.tr.delete(at, at + 1).setMeta('addToHistory', false));\n editor.ui.notify({ text: editor.ui.t('image.uploadFailed'), type: 'error' });\n })\n .finally(() => {\n notice?.close();\n URL.revokeObjectURL(blobUrl);\n });\n }\n}\n\n// ---------- автозагрузка встроенных (data:) картинок ----------\n\nconst DATA_IMAGE = /^data:(image\\/(?:png|jpe?g|gif|webp|avif|bmp));base64,(.+)$/i;\n\n/** data:-URL → File без fetch (fetch data: может запрещать CSP connect-src). */\nexport function dataUrlToFile(src: string, name = 'pasted-image'): File | null {\n const match = src.match(DATA_IMAGE);\n if (!match) return null;\n const type = match[1]!.toLowerCase();\n try {\n const binary = atob(match[2]!);\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);\n const ext = type.split('/')[1]!.replace('jpeg', 'jpg');\n return new File([bytes], `${name}.${ext}`, { type });\n } catch {\n return null;\n }\n}\n\n/** Заменить src у всех картинок с данным src (без шага в истории). */\nfunction replaceImageSrc(view: EditorView, from: string, to: string): void {\n const tr = view.state.tr;\n view.state.doc.descendants((node, pos) => {\n if (node.type === nodesOf(view.state).image && node.attrs.src === from) {\n tr.setNodeMarkup(pos, undefined, { ...node.attrs, src: to });\n }\n });\n if (tr.docChanged) view.dispatch(tr.setMeta('addToHistory', false));\n}\n\n/**\n * Загрузить встроенную картинку через uploadImage и подменить data:-URL на адрес с сервера.\n * При ошибке картинка остаётся встроенной: содержимое не теряется, пользователь видит уведомление.\n */\nexport async function uploadEmbeddedImage(editor: Editor, src: string): Promise<void> {\n const handler = editor.options.uploadImage;\n const file = handler ? dataUrlToFile(src) : null;\n if (!handler || !file) return;\n const notice = editor.ui.notify({ text: editor.ui.t('image.uploading'), timeout: 0 });\n try {\n const url = await handler(file, (percent) =>\n notice.setText(`${editor.ui.t('image.uploading')} ${Math.round(percent)}%`),\n );\n if (!isSafeImageUrl(url)) throw new Error(`Unsafe image URL returned: ${url}`);\n replaceImageSrc(editor.view, src, url);\n } catch (error) {\n console.error('[nova] embedded image upload failed', error);\n editor.ui.notify({ text: editor.ui.t('image.uploadFailed'), type: 'error' });\n } finally {\n notice.close();\n }\n}\n\nfunction dataImageSrcs(doc: PMNode, type: PMNode['type']): Set<string> {\n const srcs = new Set<string>();\n doc.descendants((node) => {\n if (node.type === type && DATA_IMAGE.test(node.attrs.src as string)) srcs.add(node.attrs.src);\n });\n return srcs;\n}\n\n/**\n * Встроенные картинки, появившиеся при вставке или перетаскивании (Word, другие приложения), сразу\n * загружаются через uploadImage. Без uploadImage остаются встроенными, как и раньше.\n */\nexport function embeddedImageUploadPlugin(editor: Editor): Plugin {\n return new Plugin({\n key: new PluginKey('nova-embedded-image-upload'),\n appendTransaction(transactions, oldState, newState) {\n if (!editor.options.uploadImage) return null;\n const fromUser = transactions.some((tr) =>\n ['paste', 'drop'].includes(tr.getMeta('uiEvent') as string),\n );\n if (!fromUser || !transactions.some((tr) => tr.docChanged)) return null;\n const type = nodesOf(newState).image;\n const before = dataImageSrcs(oldState.doc, type);\n const added = [...dataImageSrcs(newState.doc, type)].filter((src) => !before.has(src));\n // Загрузку запускаем после применения транзакции: изменять документ здесь нельзя.\n if (added.length)\n queueMicrotask(() => added.forEach((src) => void uploadEmbeddedImage(editor, src)));\n return null;\n },\n });\n}\n\n/** Плагин: картинки из буфера обмена и перетаскивание файлов. */\nexport function imageDropPastePlugin(editor: Editor): Plugin {\n return new Plugin({\n key: new PluginKey('nova-image-drop-paste'),\n props: {\n handlePaste(_view, event) {\n if (!editor.isAllowed('image')) return false;\n const data = event.clipboardData;\n if (!data) return false;\n // При копировании из Word в буфере есть и HTML, и картинка-скриншот — берём HTML.\n if (data.getData('text/html')) return false;\n const files = [...data.files].filter(isSupportedImage);\n if (!files.length) return false;\n uploadImages(editor, files);\n return true;\n },\n handleDrop(view, event) {\n if (!editor.isAllowed('image')) return false;\n const files = [...(event.dataTransfer?.files ?? [])].filter(isSupportedImage);\n if (!files.length) return false;\n event.preventDefault();\n const coords = view.posAtCoords({ left: event.clientX, top: event.clientY });\n uploadImages(editor, files, coords?.pos);\n return true;\n },\n },\n });\n}\n\n/** Диалог вставки изображения: загрузка файла или URL + обязательный по смыслу alt. */\nexport function openImageDialog(editor: Editor): void {\n const { t } = editor.ui;\n const fileInput = h('input', {\n type: 'file',\n accept: 'image/png,image/jpeg,image/gif,image/webp,image/avif',\n className: 'nova-visually-hidden',\n tabindex: '-1',\n });\n const dropzone = h(\n 'button',\n { type: 'button', className: 'nova-dropzone' },\n icon(icons.upload),\n h('span', {}, t('image.drop')),\n );\n const url = textField({ label: t('image.url'), type: 'url', placeholder: 'https://' });\n const alt = textField({ label: t('image.alt'), hint: t('image.altHint') });\n\n const body = h(\n 'div',\n { className: 'nova-form' },\n dropzone,\n fileInput,\n h('div', { className: 'nova-divider' }, h('span', {}, t('image.or'))),\n url.el,\n alt.el,\n );\n\n const dialog = editor.ui.openDialog({\n title: t('image.title'),\n body,\n submitLabel: t('dialog.insert'),\n initialFocus: url.input,\n onSubmit: () => {\n const src = url.input.value.trim();\n if (!src || !isSafeImageUrl(src)) {\n url.input.setAttribute('aria-invalid', 'true');\n url.input.focus();\n return t('image.invalid');\n }\n editor.exec(insertImage(src, alt.input.value.trim() || undefined));\n return true;\n },\n });\n\n const takeFiles = (files: File[]) => {\n const images = files.filter(isSupportedImage);\n if (!images.length) return;\n dialog.close();\n uploadImages(editor, images);\n };\n\n dropzone.addEventListener('click', () => fileInput.click());\n fileInput.addEventListener('change', () => takeFiles([...(fileInput.files ?? [])]));\n dropzone.addEventListener('dragover', (event) => {\n event.preventDefault();\n dropzone.classList.add('is-dragover');\n });\n dropzone.addEventListener('dragleave', () => dropzone.classList.remove('is-dragover'));\n dropzone.addEventListener('drop', (event) => {\n event.preventDefault();\n dropzone.classList.remove('is-dragover');\n takeFiles([...(event.dataTransfer?.files ?? [])]);\n });\n}\n\n// ---------- выделенная картинка: размер, выравнивание, alt ----------\n\nexport function getSelectedImage(state: EditorState): { node: PMNode; pos: number } | null {\n const { selection } = state;\n if (selection instanceof NodeSelection && selection.node.type === nodesOf(state).image) {\n return { node: selection.node, pos: selection.from };\n }\n return null;\n}\n\n/** Изменить атрибуты выделенной картинки (выделение узла сохраняется). */\nexport function setImageAttrs(\n attrs: Partial<Record<'alt' | 'title' | 'width' | 'height' | 'align', unknown>>,\n): Command {\n return (state, dispatch) => {\n const image = getSelectedImage(state);\n if (!image) return false;\n if (dispatch) {\n const tr = state.tr.setNodeMarkup(image.pos, undefined, { ...image.node.attrs, ...attrs });\n tr.setSelection(NodeSelection.create(tr.doc, image.pos));\n dispatch(tr);\n }\n return true;\n };\n}\n\n/** Ширина картинки как доля ширины области текста (с сохранением пропорций); null — исходный размер. */\nexport function setImageWidthFraction(editor: Editor, fraction: number | null): boolean {\n const image = getSelectedImage(editor.view.state);\n if (!image) return false;\n if (fraction === null) return editor.exec(setImageAttrs({ width: null, height: null }));\n const dom = editor.view.nodeDOM(image.pos) as HTMLElement | null;\n const img = dom?.querySelector('img') ?? null;\n const style = getComputedStyle(editor.view.dom);\n const contentWidth =\n editor.view.dom.clientWidth -\n parseFloat(style.paddingLeft || '0') -\n parseFloat(style.paddingRight || '0');\n const width = Math.max(24, Math.round(contentWidth * fraction));\n const ratio = img && img.naturalWidth ? img.naturalHeight / img.naturalWidth : null;\n return editor.exec(setImageAttrs({ width, height: ratio ? Math.round(width * ratio) : null }));\n}\n\n/** Диалог альтернативного текста — главный пункт доступности картинки. */\nexport function openImageAltDialog(editor: Editor): void {\n const image = getSelectedImage(editor.view.state);\n if (!image) return;\n const { t } = editor.ui;\n const alt = textField({\n label: t('image.alt'),\n value: image.node.attrs.alt ?? '',\n hint: t('image.altHint'),\n });\n const title = textField({ label: t('link.tooltip'), value: image.node.attrs.title ?? '' });\n editor.ui.openDialog({\n title: t('image.editAlt'),\n body: h('div', { className: 'nova-form' }, alt.el, title.el),\n submitLabel: t('dialog.save'),\n initialFocus: alt.input,\n onSubmit: () => {\n editor.exec(\n setImageAttrs({\n alt: alt.input.value.trim() || null,\n title: title.input.value.trim() || null,\n }),\n );\n return true;\n },\n });\n}\n","import { FOCUSABLE, h, icon, uniqueId } from './dom';\nimport { icons } from './icons';\n\nexport interface DialogOptions {\n host: HTMLElement;\n title: string;\n body: HTMLElement;\n /** Без submitLabel диалог информационный: в подвале только кнопка cancelLabel («Закрыть»). */\n submitLabel?: string;\n cancelLabel: string;\n closeLabel: string;\n /** Вернуть false (или строку ошибки), чтобы не закрывать диалог. */\n onSubmit?: () => boolean | string | void | Promise<boolean | string | void>;\n /** large — для предпросмотра и HTML-кода. */\n size?: 'normal' | 'large';\n onClose?: () => void;\n /** Куда вернуть фокус после закрытия. */\n returnFocus?: () => void;\n /** Элемент, получающий фокус при открытии (по умолчанию — первое поле). */\n initialFocus?: HTMLElement;\n}\n\nexport interface DialogHandle {\n el: HTMLElement;\n close(): void;\n setError(message: string | null): void;\n setBusy(busy: boolean): void;\n}\n\n/**\n * Модальный диалог: focus trap, Escape, возврат фокуса, Enter = отправка формы.\n * На узких экранах CSS превращает его в нижний лист (sheet).\n */\nexport function openDialog(options: DialogOptions): DialogHandle {\n const titleId = uniqueId('nova-dialog-title');\n const error = h('p', { className: 'nova-dialog-error', role: 'alert', hidden: true });\n const submit = h(\n 'button',\n { type: 'submit', className: 'nova-button nova-button-primary', hidden: !options.submitLabel },\n options.submitLabel ?? '',\n );\n const cancel = h('button', { type: 'button', className: 'nova-button' }, options.cancelLabel);\n const closeButton = h(\n 'button',\n { type: 'button', className: 'nova-btn nova-dialog-close', 'aria-label': options.closeLabel },\n icon(icons.close),\n );\n\n const form = h(\n 'form',\n {\n className: options.size === 'large' ? 'nova-dialog nova-dialog-large' : 'nova-dialog',\n role: 'dialog',\n 'aria-modal': 'true',\n 'aria-labelledby': titleId,\n novalidate: true,\n },\n h(\n 'header',\n { className: 'nova-dialog-header' },\n h('h2', { id: titleId }, options.title),\n closeButton,\n ),\n h('div', { className: 'nova-dialog-body' }, options.body, error),\n h('footer', { className: 'nova-dialog-footer' }, cancel, submit),\n );\n const backdrop = h('div', { className: 'nova-dialog-backdrop' }, form);\n options.host.append(backdrop);\n\n let closed = false;\n const close = () => {\n if (closed) return;\n closed = true;\n backdrop.remove();\n document.removeEventListener('focusin', keepFocusInside, true);\n options.onClose?.();\n options.returnFocus?.();\n };\n\n const setError = (message: string | null) => {\n error.hidden = !message;\n error.textContent = message ?? '';\n };\n\n const setBusy = (busy: boolean) => {\n submit.disabled = busy;\n form.setAttribute('aria-busy', String(busy));\n };\n\n form.addEventListener('submit', async (event) => {\n event.preventDefault();\n setError(null);\n setBusy(true);\n try {\n const result = options.onSubmit ? await options.onSubmit() : true;\n if (typeof result === 'string') setError(result);\n else if (result !== false) close();\n } finally {\n if (!closed) setBusy(false);\n }\n });\n cancel.addEventListener('click', close);\n closeButton.addEventListener('click', close);\n backdrop.addEventListener('mousedown', (event) => {\n if (event.target === backdrop) close();\n });\n\n form.addEventListener('keydown', (event) => {\n if (event.key === 'Escape') {\n event.preventDefault();\n event.stopPropagation();\n close();\n } else if (event.key === 'Tab') {\n const focusable = [...form.querySelectorAll<HTMLElement>(FOCUSABLE)].filter(\n (el) => !el.hidden,\n );\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n if (!first || !last) return;\n if (event.shiftKey && document.activeElement === first) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && document.activeElement === last) {\n event.preventDefault();\n first.focus();\n }\n }\n });\n\n // Если фокус всё же ушёл наружу (клик мимо, программный фокус) — возвращаем в диалог.\n const keepFocusInside = (event: FocusEvent) => {\n if (!form.contains(event.target as Node)) {\n (form.querySelector<HTMLElement>(FOCUSABLE) ?? form).focus();\n }\n };\n document.addEventListener('focusin', keepFocusInside, true);\n\n const first =\n options.initialFocus ??\n form.querySelector<HTMLElement>('.nova-dialog-body input, .nova-dialog-body textarea');\n // Без полей ввода — на видимую кнопку (submit может быть скрыт у информационных диалогов).\n (first ?? (options.submitLabel ? submit : cancel)).focus();\n\n return { el: form, close, setError, setBusy };\n}\n\n// ---------- поля форм ----------\n\nexport interface TextFieldOptions {\n label: string;\n value?: string;\n type?: 'text' | 'url';\n placeholder?: string;\n hint?: string;\n required?: boolean;\n autocomplete?: string;\n}\n\nexport function textField(options: TextFieldOptions): { el: HTMLElement; input: HTMLInputElement } {\n const id = uniqueId('nova-field');\n const hintId = options.hint ? `${id}-hint` : undefined;\n const input = h('input', {\n id,\n type: options.type ?? 'text',\n className: 'nova-input',\n value: options.value ?? '',\n placeholder: options.placeholder,\n required: options.required ?? false,\n autocomplete: options.autocomplete ?? 'off',\n spellcheck: 'false',\n 'aria-describedby': hintId,\n });\n input.value = options.value ?? '';\n const el = h(\n 'div',\n { className: 'nova-field' },\n h('label', { for: id, className: 'nova-label' }, options.label),\n input,\n options.hint ? h('p', { id: hintId, className: 'nova-hint' }, options.hint) : null,\n );\n return { el, input };\n}\n\nexport function checkboxField(\n label: string,\n checked = false,\n): { el: HTMLElement; input: HTMLInputElement } {\n const id = uniqueId('nova-check');\n const input = h('input', { id, type: 'checkbox', className: 'nova-checkbox' });\n input.checked = checked;\n const el = h(\n 'div',\n { className: 'nova-field nova-field-inline' },\n input,\n h('label', { for: id }, label),\n );\n return { el, input };\n}\n\nexport interface SelectFieldOptions {\n label: string;\n value: string;\n options: { value: string; label: string }[];\n}\n\n/** Выпадающий список с подписью — для диалогов свойств. */\nexport function selectField(options: SelectFieldOptions): {\n el: HTMLElement;\n select: HTMLSelectElement;\n} {\n const id = uniqueId('nova-field');\n const select = h(\n 'select',\n { id, className: 'nova-input nova-select' },\n ...options.options.map((o) => h('option', { value: o.value }, o.label)),\n );\n select.value = options.value;\n const el = h(\n 'div',\n { className: 'nova-field' },\n h('label', { for: id, className: 'nova-label' }, options.label),\n select,\n );\n return { el, select };\n}\n","import type { Command, EditorState } from 'prosemirror-state';\nimport { getLinkAt, markRange } from './commands';\nimport type { Editor } from './editor';\nimport { marksOf } from './commands';\nimport { checkboxField, textField } from './ui/dialog';\nimport { h } from './ui/dom';\nimport { isSafeLinkUrl } from './url';\n\n/**\n * Приводит ввод пользователя к URL: 'example.com' → 'https://example.com',\n * 'a@b.ru' → 'mailto:a@b.ru'. Относительные пути и якоря не трогает.\n */\nexport function normalizeUrl(input: string): string {\n const url = input.trim();\n if (!url) return '';\n if (/^[a-z][a-z0-9+.-]*:/i.test(url) || /^[/#?.]/.test(url)) return url;\n if (/^[^\\s@/]+@[^\\s@/]+\\.[^\\s@/]+$/.test(url)) return `mailto:${url}`;\n if (/^(www\\.)?[^\\s/]+\\.[a-z]{2,}([/:?#].*)?$/i.test(url)) return `https://${url}`;\n return url;\n}\n\nexport interface LinkAttrs {\n href: string;\n text?: string;\n title?: string | null;\n target?: string | null;\n}\n\n/** Диапазон, к которому относится ссылка: выделение или ссылка под курсором. */\nfunction linkTarget(state: EditorState): { from: number; to: number } {\n const { from, to, empty, $from } = state.selection;\n if (empty) return markRange(state, marksOf(state).link, $from.pos) ?? { from, to };\n return { from, to };\n}\n\n/**\n * Создать или обновить ссылку. Если передан text и он отличается от текущего —\n * текст заменяется, остальные марки (жирный и т.п.) сохраняются.\n */\nexport function applyLink(attrs: LinkAttrs): Command {\n return (state, dispatch) => {\n const href = normalizeUrl(attrs.href);\n if (!href || !isSafeLinkUrl(href)) return false;\n if (!dispatch) return true;\n\n const { from, to } = linkTarget(state);\n const linkMark = marksOf(state).link.create({\n href,\n title: attrs.title || null,\n target: attrs.target || null,\n });\n const currentText = state.doc.textBetween(from, to);\n const text = attrs.text?.trim() ? attrs.text : null;\n const tr = state.tr;\n\n if (from === to || (text !== null && text !== currentText)) {\n const baseMarks = marksOf(state).link.removeFromSet(state.doc.resolve(from).marks());\n const node = state.schema.text(text ?? (currentText || href), linkMark.addToSet(baseMarks));\n tr.replaceWith(from, to, node);\n } else {\n tr.removeMark(from, to, marksOf(state).link).addMark(from, to, linkMark);\n }\n dispatch(tr.scrollIntoView());\n return true;\n };\n}\n\nexport function removeLink(): Command {\n return (state, dispatch) => {\n const { from, to } = linkTarget(state);\n if (from === to || !state.doc.rangeHasMark(from, to, marksOf(state).link)) return false;\n dispatch?.(state.tr.removeMark(from, to, marksOf(state).link));\n return true;\n };\n}\n\n/** Диалог вставки/редактирования ссылки. */\nexport function openLinkDialog(editor: Editor): void {\n const { t } = editor.ui;\n const state = editor.view.state;\n const existing = getLinkAt(state);\n const range = linkTarget(state);\n const selectedText = state.doc.textBetween(range.from, range.to);\n // Текст ссылки редактируем, только если выделение не пересекает несколько блоков/узлов.\n const canEditText =\n !selectedText.includes('\\n') && state.selection.$from.sameParent(state.doc.resolve(range.to));\n\n const url = textField({\n label: t('link.url'),\n type: 'url',\n value: existing?.href ?? '',\n placeholder: 'https://',\n required: true,\n });\n const text = textField({ label: t('link.text'), value: selectedText });\n const title = textField({ label: t('link.tooltip'), value: existing?.title ?? '' });\n const newTab = checkboxField(t('link.newTab'), existing?.target === '_blank');\n\n const body = h(\n 'div',\n { className: 'nova-form' },\n url.el,\n canEditText ? text.el : null,\n title.el,\n newTab.el,\n );\n\n editor.ui.openDialog({\n title: existing ? t('link.editTitle') : t('link.title'),\n body,\n submitLabel: existing ? t('dialog.save') : t('dialog.insert'),\n initialFocus: url.input,\n onSubmit: () => {\n const href = normalizeUrl(url.input.value);\n if (!href || !isSafeLinkUrl(href)) {\n url.input.setAttribute('aria-invalid', 'true');\n url.input.focus();\n return t('link.invalid');\n }\n editor.exec(\n applyLink({\n href,\n ...(canEditText ? { text: text.input.value } : {}),\n title: title.input.value.trim() || null,\n target: newTab.input.checked ? '_blank' : null,\n }),\n );\n return true;\n },\n });\n}\n","import { keymap } from 'prosemirror-keymap';\nimport { Fragment, type Node as PMNode } from 'prosemirror-model';\nimport { TextSelection, type Command, type EditorState, type Plugin } from 'prosemirror-state';\nimport {\n addColumnAfter,\n addColumnBefore,\n addRowAfter,\n addRowBefore,\n CellSelection,\n columnResizing,\n deleteColumn,\n deleteRow,\n deleteTable,\n findTable,\n goToNextCell,\n isInTable,\n mergeCells,\n selectedRect,\n setCellAttr,\n splitCell,\n tableEditing,\n TableView,\n toggleHeader,\n} from 'prosemirror-tables';\nimport type { Editor } from './editor';\nimport {\n cssValue,\n schema as baseSchema,\n type CellVAlign,\n type NovaSchema,\n type TableAlign,\n} from './schema';\nimport { h } from './ui/dom';\n\nexport const MAX_GRID = 10;\n\n/** Создать таблицу rows×cols; первая строка — заголовки, если withHeader. */\nexport function createTable(\n rows: number,\n cols: number,\n withHeader = true,\n schema: NovaSchema = baseSchema,\n): PMNode {\n const { table, table_row, table_cell, table_header, paragraph } = schema.nodes;\n const rowNodes: PMNode[] = [];\n for (let r = 0; r < rows; r++) {\n const cellType = withHeader && r === 0 ? table_header : table_cell;\n const cells: PMNode[] = [];\n for (let c = 0; c < cols; c++) cells.push(cellType.create(null, paragraph.create()));\n rowNodes.push(table_row.create(null, cells));\n }\n return table.create(null, rowNodes);\n}\n\n/** Вставить таблицу на место выделения и поставить курсор в первую ячейку. */\nexport function insertTable(rows: number, cols: number, withHeader = true): Command {\n return (state, dispatch) => {\n if (rows < 1 || cols < 1 || rows > 100 || cols > 50) return false;\n // Таблицы внутри таблиц не вставляем — как и большинство редакторов.\n if (isInTable(state)) return false;\n if (dispatch) {\n const node = createTable(rows, cols, withHeader, state.schema as NovaSchema);\n const tr = state.tr.replaceSelectionWith(node);\n // Узлы неизменяемы — вставленную таблицу находим по ссылке на объект.\n let tablePos = -1;\n tr.doc.descendants((n, pos) => {\n if (n === node) tablePos = pos;\n return tablePos < 0;\n });\n // +3: table → row → cell → внутрь первого абзаца.\n if (tablePos >= 0) tr.setSelection(TextSelection.near(tr.doc.resolve(tablePos + 3)));\n dispatch(tr.scrollIntoView());\n }\n return true;\n };\n}\n\n/** Tab — следующая ячейка; в последней ячейке — новая строка (как в Word и TinyMCE). */\nconst nextCellOrNewRow: Command = (state, dispatch, view) => {\n if (!isInTable(state)) return false;\n if (goToNextCell(1)(state, dispatch, view)) return true;\n if (!dispatch) return true;\n let next: EditorState = state;\n addRowAfter(state, (tr) => {\n next = state.apply(tr);\n dispatch(tr);\n });\n return goToNextCell(1)(next, dispatch, view);\n};\n\nexport function tablePlugins(): Plugin[] {\n return [\n columnResizing({ cellMinWidth: 48, View: NovaTableView }),\n tableEditing(),\n keymap({\n Tab: nextCellOrNewRow,\n 'Shift-Tab': goToNextCell(-1),\n }),\n ];\n}\n\nexport const tableCommands = {\n addRowBefore,\n addRowAfter,\n deleteRow,\n addColumnBefore,\n addColumnAfter,\n deleteColumn,\n mergeCells,\n splitCell,\n // Без устаревшей логики (та смотрит на угловую ячейку и путает строку/столбец заголовков).\n toggleHeaderRow: toggleHeader('row'),\n toggleHeaderColumn: toggleHeader('column'),\n deleteTable,\n} satisfies Record<string, Command>;\n\nexport { isInTable };\n\n/** Фон выделенных ячеек (null — убрать). */\nexport function setCellBackground(color: string | null): Command {\n return setCellAttr('background', color);\n}\n\n/** Есть ли в текущей таблице строка-заголовок (первая строка из th). */\nexport function hasHeaderRow(state: EditorState): boolean {\n if (!isInTable(state)) return false;\n const firstRow = findTable(state.selection.$from)?.node.firstChild;\n if (!firstRow || firstRow.childCount === 0) return false;\n let all = true;\n firstRow.forEach((cell) => {\n if (cell.type !== (state.schema as NovaSchema).nodes.table_header) all = false;\n });\n return all;\n}\n\n/** Есть ли столбец-заголовок (первая ячейка каждой строки — th). */\nexport function hasHeaderColumn(state: EditorState): boolean {\n if (!isInTable(state)) return false;\n const table = findTable(state.selection.$from)?.node;\n if (!table) return false;\n let all = true;\n table.forEach((row) => {\n if (row.firstChild?.type !== (state.schema as NovaSchema).nodes.table_header) all = false;\n });\n return all;\n}\n\n/** Выделено ли несколько ячеек (для «объединить»). */\nexport function isCellSelection(state: EditorState): boolean {\n return state.selection instanceof CellSelection;\n}\n\n/** DOM-прямоугольник текущей таблицы (для позиционирования контекстного тулбара). */\nexport function tableRect(editor: Editor): DOMRect | null {\n const { state } = editor.view;\n if (!isInTable(state)) return null;\n const table = findTable(state.selection.$from);\n if (!table) return null;\n const dom = editor.view.nodeDOM(table.pos) as HTMLElement | null;\n return dom?.getBoundingClientRect() ?? null;\n}\n\nexport { selectedRect };\n\n/**\n * Панель выбора размера таблицы: сетка до 10×10, подсветка при наведении/стрелках,\n * подпись «3 × 4». Доступна с клавиатуры (стрелки + Enter).\n */\nexport function createTableGridPanel(\n onPick: (rows: number, cols: number) => void,\n label: (rows: number, cols: number) => string,\n gridLabel: string,\n): HTMLElement {\n let rows = 1;\n let cols = 1;\n const cells: HTMLButtonElement[] = [];\n const caption = h('div', { className: 'nova-grid-caption', 'aria-live': 'polite' });\n const grid = h('div', { className: 'nova-grid', role: 'grid', 'aria-label': gridLabel });\n\n const paint = () => {\n for (const cell of cells) {\n const r = Number(cell.dataset.row);\n const c = Number(cell.dataset.col);\n cell.classList.toggle('is-on', r <= rows && c <= cols);\n cell.tabIndex = r === rows && c === cols ? 0 : -1;\n }\n caption.textContent = label(rows, cols);\n };\n\n for (let r = 1; r <= MAX_GRID; r++) {\n for (let c = 1; c <= MAX_GRID; c++) {\n const cell = h('button', {\n type: 'button',\n className: 'nova-grid-cell',\n role: 'gridcell',\n 'aria-label': label(r, c),\n 'data-row': String(r),\n 'data-col': String(c),\n });\n cell.addEventListener('mouseenter', () => {\n rows = r;\n cols = c;\n paint();\n });\n cell.addEventListener('click', () => onPick(r, c));\n cells.push(cell);\n grid.append(cell);\n }\n }\n\n grid.addEventListener('keydown', (event) => {\n const moves: Record<string, [number, number]> = {\n ArrowRight: [0, 1],\n ArrowLeft: [0, -1],\n ArrowDown: [1, 0],\n ArrowUp: [-1, 0],\n };\n const move = moves[event.key];\n if (!move) return;\n event.preventDefault();\n rows = Math.min(MAX_GRID, Math.max(1, rows + move[0]));\n cols = Math.min(MAX_GRID, Math.max(1, cols + move[1]));\n paint();\n cells[(rows - 1) * MAX_GRID + (cols - 1)]!.focus();\n });\n\n paint();\n return h('div', { className: 'nova-grid-panel' }, grid, caption);\n}\n\n// ---------- сортировка по столбцу ----------\n\nexport type SortDirection = 'asc' | 'desc';\n\n/** Число из текста ячейки («1 200», «$45.00», «-3,5 %»), иначе null — тогда сравниваем как текст. */\nfunction numericValue(text: string): number | null {\n const cleaned = text\n .replace(/\\s/g, '')\n .replace(/^[^\\d+-]+|[^\\d]+$/g, '') // валюта и единицы по краям\n .replace(/,(?=\\d{3}(?:\\D|$))/g, '') // разделитель тысяч «1,200»\n .replace(',', '.'); // десятичная запятая «3,5»\n if (!/^[+-]?\\d+(\\.\\d+)?$/.test(cleaned)) return null;\n return Number(cleaned);\n}\n\ninterface SortTarget {\n pos: number;\n table: PMNode;\n column: number;\n /** Число строк-заголовков сверху (их не сортируем). */\n headerRows: number;\n}\n\nfunction sortTarget(state: EditorState): SortTarget | null {\n if (!isInTable(state)) return null;\n const rect = selectedRect(state);\n const table = rect.table;\n // Объединённые ячейки ломают построчную перестановку — такие таблицы не сортируем.\n let merged = false;\n table.descendants((node) => {\n if (node.attrs.colspan > 1 || node.attrs.rowspan > 1) merged = true;\n return (\n !merged && node.type.spec.tableRole !== 'cell' && node.type.spec.tableRole !== 'header_cell'\n );\n });\n if (merged) return null;\n const nodes = (state.schema as NovaSchema).nodes;\n let headerRows = 0;\n for (let i = 0; i < table.childCount; i++) {\n let allHeaders = true;\n table.child(i).forEach((cell) => {\n if (cell.type !== nodes.table_header) allHeaders = false;\n });\n if (!allHeaders) break;\n headerRows++;\n }\n if (table.childCount - headerRows < 2) return null;\n return { pos: rect.tableStart - 1, table, column: rect.left, headerRows };\n}\n\n/** Отсортировать строки таблицы по столбцу с курсором. Строки-заголовки остаются сверху. */\nexport function sortTable(direction: SortDirection, locale?: string): Command {\n return (state, dispatch) => {\n const target = sortTarget(state);\n if (!target) return false;\n if (dispatch) {\n const { table, column, headerRows, pos } = target;\n const rows: PMNode[] = [];\n table.forEach((row) => rows.push(row));\n const head = rows.slice(0, headerRows);\n const body = rows.slice(headerRows);\n const texts = body.map((row) =>\n column < row.childCount ? row.child(column).textContent.trim() : '',\n );\n const numbers = texts.map(numericValue);\n // Числовая сортировка, только если числа во всех непустых ячейках столбца.\n const numeric = texts.every((t, i) => t === '' || numbers[i] !== null);\n const collator = new Intl.Collator(locale, { numeric: true, sensitivity: 'base' });\n const order = body\n .map((row, i) => ({ row, i }))\n .sort((a, b) => {\n const ta = texts[a.i]!;\n const tb = texts[b.i]!;\n // Пустые ячейки — всегда в конце.\n if (!ta || !tb) return ta ? -1 : tb ? 1 : a.i - b.i;\n const cmp = numeric ? numbers[a.i]! - numbers[b.i]! : collator.compare(ta, tb);\n return (direction === 'asc' ? cmp : -cmp) || a.i - b.i;\n })\n .map(({ row }) => row);\n const sorted = table.copy(Fragment.from([...head, ...order]));\n dispatch(state.tr.replaceWith(pos, pos + table.nodeSize, sorted).scrollIntoView());\n }\n return true;\n };\n}\n\n// ---------- свойства таблицы и ячеек ----------\n\n/**\n * Представление таблицы в редакторе: поверх расчёта ширины столбцов (prosemirror-tables) применяет\n * заданную ширину и выравнивание таблицы, чтобы в редакторе было видно то же, что получится на сайте.\n */\nclass NovaTableView extends TableView {\n constructor(node: PMNode, cellMinWidth: number) {\n super(node, cellMinWidth);\n this.apply(node);\n }\n\n override update(node: PMNode): boolean {\n if (!super.update(node)) return false;\n this.apply(node);\n return true;\n }\n\n private apply(node: PMNode): void {\n const width = cssValue.length(node.attrs.width);\n if (width) {\n this.table.style.width = width;\n this.table.style.minWidth = '';\n }\n const align = node.attrs.align as TableAlign | null;\n this.table.style.marginLeft = align ? 'auto' : '';\n this.table.style.marginRight = align === 'center' ? 'auto' : '';\n }\n}\n\nexport interface TableProps {\n width: string | null;\n align: TableAlign | null;\n}\n\nexport function getTableProps(state: EditorState): TableProps | null {\n const found = findTable(state.selection.$from);\n return found\n ? { width: found.node.attrs.width ?? null, align: found.node.attrs.align ?? null }\n : null;\n}\n\n/** Ширина (px или %, null — по содержимому) и выравнивание таблицы. */\nexport function setTableProps(props: TableProps): Command {\n return (state, dispatch) => {\n const found = findTable(state.selection.$from);\n if (!found) return false;\n if (props.width !== null && !cssValue.length(props.width)) return false;\n dispatch?.(state.tr.setNodeMarkup(found.pos, undefined, { ...found.node.attrs, ...props }));\n return true;\n };\n}\n\nexport interface CellProps {\n valign?: CellVAlign | null;\n /** true — ячейка-заголовок (th), false — обычная (td). */\n header?: boolean;\n /** Ширина столбца(ов) выделения в px; null — по содержимому. */\n width?: number | null;\n}\n\n/** Позиции выделенных ячеек (или ячейки с курсором). */\nfunction selectedCells(state: EditorState): { pos: number; node: PMNode }[] {\n const out: { pos: number; node: PMNode }[] = [];\n if (state.selection instanceof CellSelection) {\n state.selection.forEachCell((node, pos) => out.push({ node, pos }));\n return out;\n }\n const { $from } = state.selection;\n for (let depth = $from.depth; depth > 0; depth--) {\n const node = $from.node(depth);\n const role = node.type.spec.tableRole;\n if (role === 'cell' || role === 'header_cell') {\n out.push({ node, pos: $from.before(depth) });\n break;\n }\n }\n return out;\n}\n\nexport function getCellProps(state: EditorState): Required<CellProps> | null {\n const cell = selectedCells(state)[0];\n if (!cell) return null;\n const widths = cell.node.attrs.colwidth as number[] | null;\n return {\n valign: cell.node.attrs.valign ?? null,\n header: cell.node.type === (state.schema as NovaSchema).nodes.table_header,\n width: widths?.[0] ?? null,\n };\n}\n\n/** Свойства выделенных ячеек: вертикальное выравнивание, тип (th/td), ширина столбца. */\nexport function setCellProps(props: CellProps): Command {\n return (state, dispatch) => {\n const cells = selectedCells(state);\n if (!cells.length) return false;\n if (props.width != null && !(props.width >= 24 && props.width <= 4000)) return false;\n if (!dispatch) return true;\n const nodes = (state.schema as NovaSchema).nodes;\n const tr = state.tr;\n for (const { pos, node } of cells) {\n const type =\n props.header === undefined\n ? node.type\n : props.header\n ? nodes.table_header\n : nodes.table_cell;\n const attrs = {\n ...node.attrs,\n ...(props.valign !== undefined ? { valign: props.valign } : {}),\n };\n tr.setNodeMarkup(pos, type, attrs);\n }\n if (props.width !== undefined) {\n // Ширина — у всех ячеек затронутых столбцов (colwidth хранится в каждой ячейке).\n const rect = selectedRect(state);\n const map = rect.map;\n const seen = new Set<number>();\n for (let col = rect.left; col < rect.right; col++) {\n for (let row = 0; row < map.height; row++) {\n const cellPos = map.map[row * map.width + col]!;\n const key = cellPos * 1000 + col;\n if (seen.has(key)) continue;\n seen.add(key);\n const absolute = rect.tableStart + cellPos;\n const cell = tr.doc.nodeAt(absolute);\n if (!cell) continue;\n const index = col - map.colCount(cellPos);\n const widths = [\n ...((cell.attrs.colwidth as number[] | null) ?? new Array(cell.attrs.colspan).fill(0)),\n ];\n widths[index] = props.width ?? 0;\n tr.setNodeMarkup(absolute, undefined, {\n ...cell.attrs,\n colwidth: widths.every((w) => !w) ? null : widths,\n });\n }\n }\n }\n dispatch(tr);\n return true;\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAGK;;;AC0BA,SAAS,WAAW,SAAsC;AAC/D,QAAM,UAAU,SAAS,mBAAmB;AAC5C,QAAM,QAAQ,EAAE,KAAK,EAAE,WAAW,qBAAqB,MAAM,SAAS,QAAQ,KAAK,CAAC;AACpF,QAAM,SAAS;AAAA,IACb;AAAA,IACA,EAAE,MAAM,UAAU,WAAW,mCAAmC,QAAQ,CAAC,QAAQ,YAAY;AAAA,IAC7F,QAAQ,eAAe;AAAA,EACzB;AACA,QAAM,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,WAAW,cAAc,GAAG,QAAQ,WAAW;AAC5F,QAAM,cAAc;AAAA,IAClB;AAAA,IACA,EAAE,MAAM,UAAU,WAAW,8BAA8B,cAAc,QAAQ,WAAW;AAAA,IAC5F,KAAK,MAAM,KAAK;AAAA,EAClB;AAEA,QAAM,OAAO;AAAA,IACX;AAAA,IACA;AAAA,MACE,WAAW,QAAQ,SAAS,UAAU,kCAAkC;AAAA,MACxE,MAAM;AAAA,MACN,cAAc;AAAA,MACd,mBAAmB;AAAA,MACnB,YAAY;AAAA,IACd;AAAA,IACA;AAAA,MACE;AAAA,MACA,EAAE,WAAW,qBAAqB;AAAA,MAClC,EAAE,MAAM,EAAE,IAAI,QAAQ,GAAG,QAAQ,KAAK;AAAA,MACtC;AAAA,IACF;AAAA,IACA,EAAE,OAAO,EAAE,WAAW,mBAAmB,GAAG,QAAQ,MAAM,KAAK;AAAA,IAC/D,EAAE,UAAU,EAAE,WAAW,qBAAqB,GAAG,QAAQ,MAA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MAAM,IAAI,QAAQ,GAAG;AAC7C,gBAAM,MAAM,UAAU,MAAO;AAC7B,cAAI,KAAK,IAAI,GAAG,EAAG;AACnB,eAAK,IAAI,GAAG;AACZ,gBAAM,WAAW,KAAK,aAAa;AACnC,gBAAM,OAAO,GAAG,IAAI,OAAO,QAAQ;AACnC,cAAI,CAAC,KAAM;AACX,gBAAM,QAAQ,MAAM,IAAI,SAAS,OAAO;AACxC,gBAAM,SAAS;AAAA,YACb,GAAK,KAAK,MAAM,YAAgC,IAAI,MAAM,KAAK,MAAM,OAAO,EAAE,KAAK,CAAC;AAAA,UACtF;AACA,iBAAO,KAAK,IAAI,MAAM,SAAS;AAC/B,aAAG,cAAc,UAAU,QAAW;AAAA,YACpC,GAAG,KAAK;AAAA,YACR,UAAU,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,OAAO;AAAA,UAC7C,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AACA,aAAS,EAAE;AACX,WAAO;AAAA,EACT;AACF;","names":["first","schema"]}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
// src/ui/icons.ts
|
|
2
|
+
var svg = (body) => `<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${body}</svg>`;
|
|
3
|
+
var icons = {
|
|
4
|
+
undo: svg(
|
|
5
|
+
'<path d="M9 14 4 9l5-5" /><path d="M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11" />'
|
|
6
|
+
),
|
|
7
|
+
redo: svg(
|
|
8
|
+
'<path d="m15 14 5-5-5-5" /><path d="M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13" />'
|
|
9
|
+
),
|
|
10
|
+
bold: svg('<path d="M6 12h9a4 4 0 010 8H7a1 1 0 01-1-1V5a1 1 0 011-1h7a4 4 0 010 8" />'),
|
|
11
|
+
italic: svg(
|
|
12
|
+
'<line x1="19" x2="10" y1="4" y2="4" /><line x1="14" x2="5" y1="20" y2="20" /><line x1="15" x2="9" y1="4" y2="20" />'
|
|
13
|
+
),
|
|
14
|
+
underline: svg('<path d="M6 4v6a6 6 0 0 0 12 0V4" /><line x1="4" x2="20" y1="20" y2="20" />'),
|
|
15
|
+
strike: svg(
|
|
16
|
+
'<path d="M16 4H9a3 3 0 0 0-2.83 4" /><path d="M14 12a4 4 0 0 1 0 8H6" /><line x1="4" x2="20" y1="12" y2="12" />'
|
|
17
|
+
),
|
|
18
|
+
code: svg('<path d="m16 18 6-6-6-6" /><path d="m8 6-6 6 6 6" />'),
|
|
19
|
+
subscript: svg(
|
|
20
|
+
'<path d="m4 5 8 8" /><path d="m12 5-8 8" /><path d="M20 19h-4c0-1.5.44-2 1.5-2.5S20 15.33 20 14c0-.47-.17-.93-.48-1.29a2.11 2.11 0 0 0-2.62-.44c-.42.24-.74.62-.9 1.07" />'
|
|
21
|
+
),
|
|
22
|
+
superscript: svg(
|
|
23
|
+
'<path d="m4 19 8-8" /><path d="m12 19-8-8" /><path d="M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06" />'
|
|
24
|
+
),
|
|
25
|
+
bulletList: svg(
|
|
26
|
+
'<path d="M3 5h.01" /><path d="M3 12h.01" /><path d="M3 19h.01" /><path d="M8 5h13" /><path d="M8 12h13" /><path d="M8 19h13" />'
|
|
27
|
+
),
|
|
28
|
+
orderedList: svg(
|
|
29
|
+
'<path d="M11 5h10" /><path d="M11 12h10" /><path d="M11 19h10" /><path d="M4 4h1v5" /><path d="M4 9h2" /><path d="M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02" />'
|
|
30
|
+
),
|
|
31
|
+
indent: svg(
|
|
32
|
+
'<path d="M21 5H11" /><path d="M21 12H11" /><path d="M21 19H11" /><path d="m3 8 4 4-4 4" />'
|
|
33
|
+
),
|
|
34
|
+
outdent: svg(
|
|
35
|
+
'<path d="M21 5H11" /><path d="M21 12H11" /><path d="M21 19H11" /><path d="m7 8-4 4 4 4" />'
|
|
36
|
+
),
|
|
37
|
+
blockquote: svg(
|
|
38
|
+
'<path d="M17 5H3" /><path d="M21 12H8" /><path d="M21 19H8" /><path d="M3 12v7" />'
|
|
39
|
+
),
|
|
40
|
+
codeBlock: svg(
|
|
41
|
+
'<path d="m10 9-3 3 3 3" /><path d="m14 15 3-3-3-3" /><rect x="3" y="3" width="18" height="18" rx="2" />'
|
|
42
|
+
),
|
|
43
|
+
alignLeft: svg('<path d="M21 5H3" /><path d="M15 12H3" /><path d="M17 19H3" />'),
|
|
44
|
+
alignCenter: svg('<path d="M21 5H3" /><path d="M17 12H7" /><path d="M19 19H5" />'),
|
|
45
|
+
alignRight: svg('<path d="M21 5H3" /><path d="M21 12H9" /><path d="M21 19H7" />'),
|
|
46
|
+
alignJustify: svg('<path d="M3 5h18" /><path d="M3 12h18" /><path d="M3 19h18" />'),
|
|
47
|
+
horizontalRule: svg('<path d="m16 16-4 4-4-4" /><path d="M3 12h18" /><path d="m8 8 4-4 4 4" />'),
|
|
48
|
+
link: svg(
|
|
49
|
+
'<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" /><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" />'
|
|
50
|
+
),
|
|
51
|
+
unlink: svg(
|
|
52
|
+
'<path d="m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71" /><path d="m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71" /><line x1="8" x2="8" y1="2" y2="5" /><line x1="2" x2="5" y1="8" y2="8" /><line x1="16" x2="16" y1="19" y2="22" /><line x1="19" x2="22" y1="16" y2="16" />'
|
|
53
|
+
),
|
|
54
|
+
image: svg(
|
|
55
|
+
'<rect width="18" height="18" x="3" y="3" rx="2" ry="2" /><circle cx="9" cy="9" r="2" /><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" />'
|
|
56
|
+
),
|
|
57
|
+
clearFormatting: svg(
|
|
58
|
+
'<path d="M4 7V4h16v3" /><path d="M5 20h6" /><path d="M13 4 8 20" /><path d="m15 15 5 5" /><path d="m20 15-5 5" />'
|
|
59
|
+
),
|
|
60
|
+
formatMore: svg(
|
|
61
|
+
'<path d="M12 4v16" /><path d="M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2" /><path d="M9 20h6" />'
|
|
62
|
+
),
|
|
63
|
+
imageLeft: svg(
|
|
64
|
+
'<rect width="9" height="6" x="6" y="14" rx="2" /><rect width="16" height="6" x="6" y="4" rx="2" /><path d="M2 2v20" />'
|
|
65
|
+
),
|
|
66
|
+
imageCenter: svg(
|
|
67
|
+
'<path d="M12 2v20" /><path d="M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4" /><path d="M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4" /><path d="M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1" /><path d="M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1" />'
|
|
68
|
+
),
|
|
69
|
+
imageRight: svg(
|
|
70
|
+
'<rect width="16" height="6" x="2" y="4" rx="2" /><rect width="9" height="6" x="9" y="14" rx="2" /><path d="M22 22V2" />'
|
|
71
|
+
),
|
|
72
|
+
resize: svg(
|
|
73
|
+
'<path d="M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" /><path d="M14 15H9v-5" /><path d="M16 3h5v5" /><path d="M21 3 9 15" />'
|
|
74
|
+
),
|
|
75
|
+
altText: svg(
|
|
76
|
+
'<rect width="18" height="14" x="3" y="5" rx="2" ry="2" /><path d="M7 15h4M15 15h2M7 11h2M13 11h4" />'
|
|
77
|
+
),
|
|
78
|
+
trash: svg(
|
|
79
|
+
'<path d="M10 11v6" /><path d="M14 11v6" /><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" /><path d="M3 6h18" /><path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />'
|
|
80
|
+
),
|
|
81
|
+
paragraph: svg(
|
|
82
|
+
'<path d="M13 4v16" /><path d="M17 4v16" /><path d="M19 4H9.5a4.5 4.5 0 0 0 0 9H13" />'
|
|
83
|
+
),
|
|
84
|
+
h1: svg('<path d="M4 12h8" /><path d="M4 18V6" /><path d="M12 18V6" /><path d="m17 12 3-2v8" />'),
|
|
85
|
+
h2: svg(
|
|
86
|
+
'<path d="M4 12h8" /><path d="M4 18V6" /><path d="M12 18V6" /><path d="M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1" />'
|
|
87
|
+
),
|
|
88
|
+
h3: svg(
|
|
89
|
+
'<path d="M4 12h8" /><path d="M4 18V6" /><path d="M12 18V6" /><path d="M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2" /><path d="M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2" />'
|
|
90
|
+
),
|
|
91
|
+
pasteText: svg(
|
|
92
|
+
'<rect width="8" height="4" x="8" y="2" rx="1" ry="1" /><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2" /><path d="M9 12v-1h6v1" /><path d="M11 17h2" /><path d="M12 11v6" />'
|
|
93
|
+
),
|
|
94
|
+
table: svg(
|
|
95
|
+
'<path d="M12 3v18" /><rect width="18" height="18" x="3" y="3" rx="2" /><path d="M3 9h18" /><path d="M3 15h18" />'
|
|
96
|
+
),
|
|
97
|
+
rowBefore: svg(
|
|
98
|
+
'<path d="M12 2v6" /><path d="M18.464 3H19a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h.535" /><path d="M21 12H3" /><path d="M9 5h6" />'
|
|
99
|
+
),
|
|
100
|
+
rowAfter: svg(
|
|
101
|
+
'<path d="M12 22v-6" /><path d="M18.464 21H19a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h.535" /><path d="M21 12H3" /><path d="M9 19h6" />'
|
|
102
|
+
),
|
|
103
|
+
rowDelete: svg(
|
|
104
|
+
'<path d="M16 5H3" /><path d="M11 12H3" /><path d="M16 19H3" /><path d="m15.5 9.5 5 5" /><path d="m20.5 9.5-5 5" />'
|
|
105
|
+
),
|
|
106
|
+
colBefore: svg(
|
|
107
|
+
'<path d="M12 3v18" /><path d="M3 5.536V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-.535" /><path d="M5 15V9" /><path d="M8 12H2" />'
|
|
108
|
+
),
|
|
109
|
+
colAfter: svg(
|
|
110
|
+
'<path d="M12 3v18" /><path d="M16 12h6" /><path d="M19 15V9" /><path d="M21 5.536V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-.535" />'
|
|
111
|
+
),
|
|
112
|
+
colDelete: svg(
|
|
113
|
+
'<g transform="rotate(90 12 12)"><path d="M16 5H3" /><path d="M11 12H3" /><path d="M16 19H3" /><path d="m15.5 9.5 5 5" /><path d="m20.5 9.5-5 5" /></g>'
|
|
114
|
+
),
|
|
115
|
+
merge: svg(
|
|
116
|
+
'<path d="M12 21v-6" /><path d="M12 9V3" /><path d="M3 15h18" /><path d="M3 9h18" /><rect width="18" height="18" x="3" y="3" rx="2" />'
|
|
117
|
+
),
|
|
118
|
+
split: svg(
|
|
119
|
+
'<path d="M12 15V9" /><path d="M3 15h18" /><path d="M3 9h18" /><rect width="18" height="18" x="3" y="3" rx="2" />'
|
|
120
|
+
),
|
|
121
|
+
rowHeader: svg('<rect width="18" height="18" x="3" y="3" rx="2" /><path d="M3 9h18" />'),
|
|
122
|
+
colHeader: svg('<rect width="18" height="18" x="3" y="3" rx="2" /><path d="M9 3v18" />'),
|
|
123
|
+
sort: svg(
|
|
124
|
+
'<path d="m3 16 4 4 4-4" /><path d="M7 20V4" /><path d="M11 4h10" /><path d="M11 8h7" /><path d="M11 12h4" />'
|
|
125
|
+
),
|
|
126
|
+
tableProps: svg(
|
|
127
|
+
'<path d="M15 3v18" /><rect width="18" height="18" x="3" y="3" rx="2" /><path d="M21 9H3" /><path d="M21 15H3" />'
|
|
128
|
+
),
|
|
129
|
+
cellProps: svg(
|
|
130
|
+
'<path d="M10.6 21H5a2 2 0 01-2-2V5a2 2 0 012-2h14a2 2 0 012 2v5.6" /><path d="m14.305 19.53.923-.382" /><path d="M15 3v7.6" /><path d="m15.229 16.852-.924-.383" /><path d="m16.852 15.228-.383-.923" /><path d="m16.852 20.772-.383.924" /><path d="m19.148 15.228.383-.923" /><path d="m19.53 21.696-.382-.924" /><path d="m20.773 16.852.922-.383" /><path d="m20.773 19.148.922.383" /><path d="M9 3v18" /><circle cx="18" cy="18" r="3" />'
|
|
131
|
+
),
|
|
132
|
+
tableDelete: svg(
|
|
133
|
+
'<path d="M12 3v17a1 1 0 0 1-1 1H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v6a1 1 0 0 1-1 1H3" /><path d="m16.5 16.5 5 5" /><path d="m16.5 21.5 5-5" />'
|
|
134
|
+
),
|
|
135
|
+
chevronUp: svg('<path d="m18 15-6-6-6 6" />'),
|
|
136
|
+
search: svg('<path d="m21 21-4.34-4.34" /><circle cx="11" cy="11" r="8" />'),
|
|
137
|
+
fullscreen: svg(
|
|
138
|
+
'<path d="M8 3H5a2 2 0 0 0-2 2v3" /><path d="M21 8V5a2 2 0 0 0-2-2h-3" /><path d="M3 16v3a2 2 0 0 0 2 2h3" /><path d="M16 21h3a2 2 0 0 0 2-2v-3" />'
|
|
139
|
+
),
|
|
140
|
+
fullscreenExit: svg(
|
|
141
|
+
'<path d="M8 3v3a2 2 0 0 1-2 2H3" /><path d="M21 8h-3a2 2 0 0 1-2-2V3" /><path d="M3 16h3a2 2 0 0 1 2 2v3" /><path d="M16 21v-3a2 2 0 0 1 2-2h3" />'
|
|
142
|
+
),
|
|
143
|
+
preview: svg(
|
|
144
|
+
'<path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" /><circle cx="12" cy="12" r="3" />'
|
|
145
|
+
),
|
|
146
|
+
sourceCode: svg('<path d="m18 16 4-4-4-4" /><path d="m6 8-4 4 4 4" /><path d="m14.5 4-5 16" />'),
|
|
147
|
+
help: svg(
|
|
148
|
+
'<circle cx="12" cy="12" r="10" /><path d="M9 9.5a3 2.5 0 016 0c0 2-2 2-3 3.5" /><path d="M12 17h.01" />'
|
|
149
|
+
),
|
|
150
|
+
print: svg(
|
|
151
|
+
'<path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2" /><path d="M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6" /><rect x="6" y="14" width="12" height="8" rx="1" />'
|
|
152
|
+
),
|
|
153
|
+
check: svg('<path d="M20 6 9 17l-5-5" />'),
|
|
154
|
+
close: svg('<path d="M18 6 6 18" /><path d="m6 6 12 12" />'),
|
|
155
|
+
chevronDown: svg('<path d="m6 9 6 6 6-6" />'),
|
|
156
|
+
more: svg(
|
|
157
|
+
'<circle cx="12" cy="12" r="1" /><circle cx="19" cy="12" r="1" /><circle cx="5" cy="12" r="1" />'
|
|
158
|
+
),
|
|
159
|
+
textColor: svg('<path d="M4 20h16" /><path d="m6 16 6-12 6 12" /><path d="M8 12h8" />'),
|
|
160
|
+
highlight: svg(
|
|
161
|
+
'<path d="m9 11-6 6v3h9l3-3" /><path d="m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4" />'
|
|
162
|
+
),
|
|
163
|
+
lineHeight: svg(
|
|
164
|
+
'<path d="M15 14H9" /><path d="M21 21H3" /><path d="M21 3H3" /><path d="m8 16 3.453-7.648a.6.6 0 011.094.001L16 16" />'
|
|
165
|
+
),
|
|
166
|
+
upload: svg(
|
|
167
|
+
'<path d="M12 3v12" /><path d="m17 8-5-5-5 5" /><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />'
|
|
168
|
+
),
|
|
169
|
+
externalLink: svg(
|
|
170
|
+
'<path d="M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6" /><path d="m21 3-9 9" /><path d="M15 3h6v6" />'
|
|
171
|
+
),
|
|
172
|
+
copy: svg(
|
|
173
|
+
'<rect width="14" height="14" x="8" y="8" rx="2" ry="2" /><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />'
|
|
174
|
+
),
|
|
175
|
+
edit: svg(
|
|
176
|
+
'<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" /><path d="m15 5 4 4" />'
|
|
177
|
+
),
|
|
178
|
+
anchor: svg(
|
|
179
|
+
'<path d="M12 6v16" /><path d="m19 13 2-1a9 9 0 0 1-18 0l2 1" /><path d="M9 11h6" /><circle cx="12" cy="4" r="2" />'
|
|
180
|
+
),
|
|
181
|
+
save: svg(
|
|
182
|
+
'<path d="M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z" /><path d="M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7" /><path d="M7 3v4a1 1 0 0 0 1 1h7" />'
|
|
183
|
+
),
|
|
184
|
+
charmap: svg(
|
|
185
|
+
'<path d="M3 20h4.5a.5.5 0 0 0 .5-.5v-.282a.52.52 0 0 0-.247-.437 8 8 0 1 1 8.494-.001.52.52 0 0 0-.247.438v.282a.5.5 0 0 0 .5.5H21" />'
|
|
186
|
+
),
|
|
187
|
+
commentAdd: svg(
|
|
188
|
+
'<path d="M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z" /><path d="M12 8v6" /><path d="M9 11h6" />'
|
|
189
|
+
),
|
|
190
|
+
comments: svg(
|
|
191
|
+
'<path d="M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z" /><path d="M7 11h10" /><path d="M7 15h6" /><path d="M7 7h8" />'
|
|
192
|
+
),
|
|
193
|
+
emoji: svg(
|
|
194
|
+
'<path d="M15 10V9" /><path d="M16.472 15a6 6 0 01-8.943 0" /><path d="M9 10V9" /><circle cx="12" cy="12" r="10" />'
|
|
195
|
+
),
|
|
196
|
+
dateTime: svg(
|
|
197
|
+
'<path d="M16 2v3" /><path d="M17 15.5v1.7l1 .625" /><path d="M21 8.936V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h3.935" /><path d="M3 9h9.873" /><path d="M8 2v3" /><circle cx="17" cy="17" r="5" />'
|
|
198
|
+
),
|
|
199
|
+
media: svg(
|
|
200
|
+
'<rect x="3" y="3" width="18" height="18" rx="2" /><path d="M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z" />'
|
|
201
|
+
),
|
|
202
|
+
nonBreaking: svg('<path d="M22 17v1c0 .5-.5 1-1 1H3c-.5 0-1-.5-1-1v-1" />'),
|
|
203
|
+
pageBreak: svg(
|
|
204
|
+
'<path d="M5.42 9.42 8 12" /><circle cx="4" cy="8" r="2" /><path d="m14 6-8.58 8.58" /><circle cx="4" cy="16" r="2" /><path d="M10.8 14.8 14 18" /><path d="M16 12h-2" /><path d="M22 12h-2" />'
|
|
205
|
+
),
|
|
206
|
+
history: svg(
|
|
207
|
+
'<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" /><path d="M3 3v5h5" /><path d="M12 7v5l4 2" />'
|
|
208
|
+
),
|
|
209
|
+
suggest: svg(
|
|
210
|
+
'<path d="M13 21h8" /><path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" />'
|
|
211
|
+
),
|
|
212
|
+
review: svg(
|
|
213
|
+
'<path d="M13 5h8" /><path d="M13 12h8" /><path d="M13 19h8" /><path d="m3 17 2 2 4-4" /><path d="m3 7 2 2 4-4" />'
|
|
214
|
+
),
|
|
215
|
+
visualBlocks: svg(
|
|
216
|
+
'<path d="M5 3a2 2 0 0 0-2 2" /><path d="M19 3a2 2 0 0 1 2 2" /><path d="M21 19a2 2 0 0 1-2 2" /><path d="M5 21a2 2 0 0 1-2-2" /><path d="M9 3h1" /><path d="M9 21h1" /><path d="M14 3h1" /><path d="M14 21h1" /><path d="M3 9v1" /><path d="M21 9v1" /><path d="M3 14v1" /><path d="M21 14v1" />'
|
|
217
|
+
),
|
|
218
|
+
ltr: svg(
|
|
219
|
+
'<path d="M10 3v11" /><path d="M10 9H7a1 1 0 0 1 0-6h8" /><path d="M14 3v11" /><path d="m18 14 4 4H2" /><path d="m22 18-4 4" />'
|
|
220
|
+
),
|
|
221
|
+
rtl: svg(
|
|
222
|
+
'<path d="M14 3v11" /><path d="M14 9h-3a3 3 0 0 1 0-6h9" /><path d="M18 3v11" /><path d="M22 18H2l4-4" /><path d="m6 22-4-4" />'
|
|
223
|
+
)
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
export {
|
|
227
|
+
icons
|
|
228
|
+
};
|
|
229
|
+
//# sourceMappingURL=chunk-MOO4PJGI.js.map
|