@acorex/cdk 22.4.8 → 22.4.11
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/fesm2022/acorex-cdk-text-editor.mjs +942 -0
- package/fesm2022/acorex-cdk-text-editor.mjs.map +1 -0
- package/fesm2022/acorex-cdk-wysiwyg.mjs +2 -2
- package/fesm2022/acorex-cdk-wysiwyg.mjs.map +1 -1
- package/package.json +8 -2
- package/text-editor/README.md +5 -0
- package/types/acorex-cdk-text-editor.d.ts +156 -0
- package/types/acorex-cdk-wysiwyg.d.ts +1 -1
|
@@ -0,0 +1,942 @@
|
|
|
1
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { signal, inject, PLATFORM_ID, Injectable } from '@angular/core';
|
|
4
|
+
|
|
5
|
+
const AX_TEXT_EDITOR_FONT_SIZE_TOKEN_VALUES = {
|
|
6
|
+
small: '0.75em',
|
|
7
|
+
large: '1.5em',
|
|
8
|
+
huge: '2.5em',
|
|
9
|
+
};
|
|
10
|
+
const AX_TEXT_EDITOR_ZOOM_PRESETS = [40, 50, 75, 90, 100, 125, 150, 175, 200];
|
|
11
|
+
const AX_TEXT_EDITOR_ZOOM_MIN = 40;
|
|
12
|
+
const AX_TEXT_EDITOR_ZOOM_MAX = 200;
|
|
13
|
+
const AX_TEXT_EDITOR_FONT_SIZES = [8, 9, 10, 11, 12, 14, 16, 18, 20, 24, 28, 32, 36, 48, 72];
|
|
14
|
+
const AX_TEXT_EDITOR_DEFAULT_TEXT_COLORS = [
|
|
15
|
+
'#f59e0b',
|
|
16
|
+
'#eab308',
|
|
17
|
+
'#22c55e',
|
|
18
|
+
'#06b6d4',
|
|
19
|
+
'#3b82f6',
|
|
20
|
+
'#a855f7',
|
|
21
|
+
'#ec4899',
|
|
22
|
+
'#ef4444',
|
|
23
|
+
];
|
|
24
|
+
const AX_TEXT_EDITOR_DEFAULT_BACKGROUND_COLORS = [
|
|
25
|
+
'#ffffff',
|
|
26
|
+
'#f5e6c8',
|
|
27
|
+
'#fde68a',
|
|
28
|
+
'#f9a8d4',
|
|
29
|
+
'#bbf7d0',
|
|
30
|
+
'#ddd6fe',
|
|
31
|
+
'#fbcfe8',
|
|
32
|
+
'#fdba74',
|
|
33
|
+
];
|
|
34
|
+
const AX_DEFAULT_TEXT_EDITOR_FEATURES = {
|
|
35
|
+
table: true,
|
|
36
|
+
image: true,
|
|
37
|
+
video: true,
|
|
38
|
+
superscript: true,
|
|
39
|
+
subscript: true,
|
|
40
|
+
keepSelection: true,
|
|
41
|
+
placeholder: true,
|
|
42
|
+
};
|
|
43
|
+
const AX_EMPTY_TEXT_EDITOR_STATE = {
|
|
44
|
+
bold: false,
|
|
45
|
+
italic: false,
|
|
46
|
+
underline: false,
|
|
47
|
+
strike: false,
|
|
48
|
+
code: false,
|
|
49
|
+
codeBlock: false,
|
|
50
|
+
headingLevel: null,
|
|
51
|
+
bulletList: false,
|
|
52
|
+
orderedList: false,
|
|
53
|
+
blockquote: false,
|
|
54
|
+
superscript: false,
|
|
55
|
+
subscript: false,
|
|
56
|
+
textAlign: null,
|
|
57
|
+
textColor: null,
|
|
58
|
+
highlightColor: null,
|
|
59
|
+
linkHref: null,
|
|
60
|
+
fontSize: null,
|
|
61
|
+
textDirection: null,
|
|
62
|
+
table: false,
|
|
63
|
+
canUndo: false,
|
|
64
|
+
canRedo: false,
|
|
65
|
+
isEmpty: true,
|
|
66
|
+
isFocused: false,
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
class AXTextEditor {
|
|
70
|
+
constructor() {
|
|
71
|
+
this.editor = signal(null, /* @ts-ignore */
|
|
72
|
+
...(ngDevMode ? [{ debugName: "editor" }] : /* istanbul ignore next */ []));
|
|
73
|
+
this.state = signal(AX_EMPTY_TEXT_EDITOR_STATE, /* @ts-ignore */
|
|
74
|
+
...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
75
|
+
this.ready = signal(false, /* @ts-ignore */
|
|
76
|
+
...(ngDevMode ? [{ debugName: "ready" }] : /* istanbul ignore next */ []));
|
|
77
|
+
this.version = signal(0, /* @ts-ignore */
|
|
78
|
+
...(ngDevMode ? [{ debugName: "version" }] : /* istanbul ignore next */ []));
|
|
79
|
+
this.platformId = inject(PLATFORM_ID);
|
|
80
|
+
this.destroyed = false;
|
|
81
|
+
this.applyingContent = false;
|
|
82
|
+
this.commandsApi = null;
|
|
83
|
+
}
|
|
84
|
+
async init(container, options = {}) {
|
|
85
|
+
if (!isPlatformBrowser(this.platformId)) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
const element = typeof container === 'string' ? document.querySelector(container) : container;
|
|
89
|
+
if (!element) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
this.destroyed = false;
|
|
93
|
+
const editable = options.readOnly === true ? false : (options.editable ?? true);
|
|
94
|
+
const [{ createTextEditorExtensions }, commandsApi, { Editor }] = await Promise.all([
|
|
95
|
+
Promise.resolve().then(function () { return textEditor_extensions; }),
|
|
96
|
+
Promise.resolve().then(function () { return textEditor_commands; }),
|
|
97
|
+
import('@tiptap/core'),
|
|
98
|
+
]);
|
|
99
|
+
this.commandsApi = commandsApi;
|
|
100
|
+
const extensions = await createTextEditorExtensions({
|
|
101
|
+
placeholder: options.placeholder,
|
|
102
|
+
features: options.features,
|
|
103
|
+
headingLevels: options.headingLevels,
|
|
104
|
+
extensions: options.extensions,
|
|
105
|
+
});
|
|
106
|
+
if (this.destroyed) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const editor = new Editor({
|
|
110
|
+
element,
|
|
111
|
+
extensions,
|
|
112
|
+
content: options.content ?? '',
|
|
113
|
+
editable,
|
|
114
|
+
editorProps: {
|
|
115
|
+
...options.editorProps,
|
|
116
|
+
attributes: {
|
|
117
|
+
class: 'ax-text-editor-prose',
|
|
118
|
+
...(typeof options.editorProps?.attributes === 'object' ? options.editorProps.attributes : {}),
|
|
119
|
+
},
|
|
120
|
+
handleDOMEvents: {
|
|
121
|
+
...options.editorProps?.handleDOMEvents,
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
onUpdate: ({ editor: ed }) => {
|
|
125
|
+
this.refreshState(ed);
|
|
126
|
+
if (!this.applyingContent) {
|
|
127
|
+
options.onUpdate?.(ed);
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
onSelectionUpdate: ({ editor: ed }) => {
|
|
131
|
+
this.refreshState(ed);
|
|
132
|
+
options.onSelectionUpdate?.(ed);
|
|
133
|
+
},
|
|
134
|
+
onTransaction: ({ editor: ed }) => {
|
|
135
|
+
this.refreshState(ed);
|
|
136
|
+
options.onTransaction?.(ed);
|
|
137
|
+
},
|
|
138
|
+
onFocus: ({ editor: ed, event }) => {
|
|
139
|
+
this.refreshState(ed);
|
|
140
|
+
options.onFocus?.(ed, event);
|
|
141
|
+
},
|
|
142
|
+
onBlur: ({ editor: ed, event }) => {
|
|
143
|
+
this.refreshState(ed);
|
|
144
|
+
options.onBlur?.(ed, event);
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
this.editor.set(editor);
|
|
148
|
+
this.ready.set(true);
|
|
149
|
+
this.refreshState(editor);
|
|
150
|
+
}
|
|
151
|
+
destroy() {
|
|
152
|
+
this.destroyed = true;
|
|
153
|
+
const ed = this.editor();
|
|
154
|
+
ed?.destroy();
|
|
155
|
+
this.editor.set(null);
|
|
156
|
+
this.ready.set(false);
|
|
157
|
+
this.state.set(AX_EMPTY_TEXT_EDITOR_STATE);
|
|
158
|
+
this.version.set(0);
|
|
159
|
+
this.commandsApi = null;
|
|
160
|
+
}
|
|
161
|
+
refresh() {
|
|
162
|
+
const ed = this.editor();
|
|
163
|
+
if (ed) {
|
|
164
|
+
this.refreshState(ed);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
setContent(value, emit = false) {
|
|
168
|
+
const ed = this.editor();
|
|
169
|
+
if (!ed) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
const content = value == null || value === '' ? '' : value;
|
|
173
|
+
this.applyingContent = true;
|
|
174
|
+
try {
|
|
175
|
+
ed.commands.setContent(content, { emitUpdate: emit });
|
|
176
|
+
this.refreshState(ed);
|
|
177
|
+
}
|
|
178
|
+
finally {
|
|
179
|
+
this.applyingContent = false;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
getHTML() {
|
|
183
|
+
return this.editor()?.getHTML() ?? '';
|
|
184
|
+
}
|
|
185
|
+
getJSON() {
|
|
186
|
+
return this.editor()?.getJSON() ?? null;
|
|
187
|
+
}
|
|
188
|
+
getText(options) {
|
|
189
|
+
return this.editor()?.getText(options) ?? '';
|
|
190
|
+
}
|
|
191
|
+
isEmpty() {
|
|
192
|
+
return this.editor()?.isEmpty ?? true;
|
|
193
|
+
}
|
|
194
|
+
isFocused() {
|
|
195
|
+
return this.editor()?.isFocused ?? false;
|
|
196
|
+
}
|
|
197
|
+
isEditable() {
|
|
198
|
+
return this.editor()?.isEditable ?? false;
|
|
199
|
+
}
|
|
200
|
+
setEditable(editable) {
|
|
201
|
+
const ed = this.editor();
|
|
202
|
+
if (!ed || ed.isEditable === editable) {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
ed.setEditable(editable, false);
|
|
206
|
+
this.refreshState(ed);
|
|
207
|
+
}
|
|
208
|
+
focus() {
|
|
209
|
+
this.editor()?.commands.focus();
|
|
210
|
+
}
|
|
211
|
+
blur() {
|
|
212
|
+
this.editor()?.commands.blur();
|
|
213
|
+
}
|
|
214
|
+
chain() {
|
|
215
|
+
return this.editor()?.chain() ?? null;
|
|
216
|
+
}
|
|
217
|
+
get commands() {
|
|
218
|
+
return this.editor()?.commands;
|
|
219
|
+
}
|
|
220
|
+
isActive(command, attrs) {
|
|
221
|
+
this.version();
|
|
222
|
+
const ed = this.editor();
|
|
223
|
+
if (!ed) {
|
|
224
|
+
return false;
|
|
225
|
+
}
|
|
226
|
+
return this.getCommandsApi().isTextEditorCommandActive(ed, command, attrs);
|
|
227
|
+
}
|
|
228
|
+
can(command, attrs) {
|
|
229
|
+
this.version();
|
|
230
|
+
const ed = this.editor();
|
|
231
|
+
if (!ed || !ed.isEditable) {
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
return this.getCommandsApi().canRunTextEditorCommand(ed, command, attrs);
|
|
235
|
+
}
|
|
236
|
+
run(command, attrs) {
|
|
237
|
+
const ed = this.editor();
|
|
238
|
+
if (!ed || !ed.isEditable) {
|
|
239
|
+
return false;
|
|
240
|
+
}
|
|
241
|
+
const result = this.getCommandsApi().runTextEditorCommand(ed, command, attrs);
|
|
242
|
+
this.refreshState(ed);
|
|
243
|
+
return result;
|
|
244
|
+
}
|
|
245
|
+
getCommandsApi() {
|
|
246
|
+
if (!this.commandsApi) {
|
|
247
|
+
throw new Error('AXTextEditor commands are not loaded. Call init() first.');
|
|
248
|
+
}
|
|
249
|
+
return this.commandsApi;
|
|
250
|
+
}
|
|
251
|
+
insertContent(value) {
|
|
252
|
+
const result = this.editor()?.chain().focus().insertContent(value).run() ?? false;
|
|
253
|
+
this.refresh();
|
|
254
|
+
return result;
|
|
255
|
+
}
|
|
256
|
+
clearContent() {
|
|
257
|
+
const result = this.editor()?.commands.clearContent() ?? false;
|
|
258
|
+
this.refresh();
|
|
259
|
+
return result;
|
|
260
|
+
}
|
|
261
|
+
insertImage(src, alt) {
|
|
262
|
+
this.run('image', { src, alt });
|
|
263
|
+
}
|
|
264
|
+
insertVideo(src) {
|
|
265
|
+
this.run('video', { src });
|
|
266
|
+
}
|
|
267
|
+
setLink(href) {
|
|
268
|
+
this.run('link', { href });
|
|
269
|
+
}
|
|
270
|
+
unsetLink() {
|
|
271
|
+
this.run('unlink');
|
|
272
|
+
}
|
|
273
|
+
clearFormatting() {
|
|
274
|
+
this.editor()?.chain().focus().clearNodes().unsetAllMarks().run();
|
|
275
|
+
this.refresh();
|
|
276
|
+
}
|
|
277
|
+
toggleHeading(level) {
|
|
278
|
+
this.run('heading', { level });
|
|
279
|
+
}
|
|
280
|
+
setTextAlign(align) {
|
|
281
|
+
this.run('align', { align });
|
|
282
|
+
}
|
|
283
|
+
setTextDirection(direction) {
|
|
284
|
+
this.run('direction', { direction });
|
|
285
|
+
}
|
|
286
|
+
refreshState(editor) {
|
|
287
|
+
this.version.update((value) => value + 1);
|
|
288
|
+
const textColor = editor.getAttributes('textStyle')['color'];
|
|
289
|
+
const fontSizeCss = editor.getAttributes('textStyle')['fontSize'];
|
|
290
|
+
const highlightColor = editor.getAttributes('highlight')['color'];
|
|
291
|
+
const linkHref = editor.getAttributes('link')['href'];
|
|
292
|
+
const dir = (editor.getAttributes('paragraph')['dir'] || editor.getAttributes('heading')['dir']);
|
|
293
|
+
let headingLevel = null;
|
|
294
|
+
for (let level = 1; level <= 6; level++) {
|
|
295
|
+
if (editor.isActive('heading', { level })) {
|
|
296
|
+
headingLevel = level;
|
|
297
|
+
break;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
let textAlign = null;
|
|
301
|
+
for (const align of ['left', 'center', 'right', 'justify']) {
|
|
302
|
+
if (editor.isActive({ textAlign: align })) {
|
|
303
|
+
textAlign = align;
|
|
304
|
+
break;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
this.state.set({
|
|
308
|
+
bold: editor.isActive('bold'),
|
|
309
|
+
italic: editor.isActive('italic'),
|
|
310
|
+
underline: editor.isActive('underline'),
|
|
311
|
+
strike: editor.isActive('strike'),
|
|
312
|
+
code: editor.isActive('code'),
|
|
313
|
+
codeBlock: editor.isActive('codeBlock'),
|
|
314
|
+
headingLevel,
|
|
315
|
+
bulletList: editor.isActive('bulletList'),
|
|
316
|
+
orderedList: editor.isActive('orderedList'),
|
|
317
|
+
blockquote: editor.isActive('blockquote'),
|
|
318
|
+
superscript: editor.isActive('superscript'),
|
|
319
|
+
subscript: editor.isActive('subscript'),
|
|
320
|
+
textAlign,
|
|
321
|
+
textColor: textColor ?? null,
|
|
322
|
+
highlightColor: highlightColor ?? null,
|
|
323
|
+
linkHref: linkHref ?? null,
|
|
324
|
+
fontSize: fontSizeCss ?? null,
|
|
325
|
+
textDirection: dir ?? null,
|
|
326
|
+
table: editor.isActive('table'),
|
|
327
|
+
canUndo: editor.can().undo(),
|
|
328
|
+
canRedo: editor.can().redo(),
|
|
329
|
+
isEmpty: editor.isEmpty,
|
|
330
|
+
isFocused: editor.isFocused,
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditor, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
334
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditor }); }
|
|
335
|
+
}
|
|
336
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXTextEditor, decorators: [{
|
|
337
|
+
type: Injectable
|
|
338
|
+
}] });
|
|
339
|
+
|
|
340
|
+
function escapeHtml(value) {
|
|
341
|
+
return value.replaceAll('&', '&').replaceAll('<', '<').replaceAll('>', '>').replaceAll('"', '"');
|
|
342
|
+
}
|
|
343
|
+
function normalizeHref(value) {
|
|
344
|
+
const href = value.trim();
|
|
345
|
+
if (!href)
|
|
346
|
+
return '';
|
|
347
|
+
if (/^(https?:|mailto:|tel:|#|\/)/i.test(href))
|
|
348
|
+
return href;
|
|
349
|
+
return `https://${href}`;
|
|
350
|
+
}
|
|
351
|
+
function headingLevel(attrs) {
|
|
352
|
+
const level = Number(attrs?.['level']);
|
|
353
|
+
if (level >= 1 && level <= 6) {
|
|
354
|
+
return level;
|
|
355
|
+
}
|
|
356
|
+
return undefined;
|
|
357
|
+
}
|
|
358
|
+
function resolveFontSize(attrs) {
|
|
359
|
+
const raw = attrs?.['size'];
|
|
360
|
+
if (raw == null || raw === '') {
|
|
361
|
+
return null;
|
|
362
|
+
}
|
|
363
|
+
const size = String(raw);
|
|
364
|
+
if (size === 'small' || size === 'large' || size === 'huge') {
|
|
365
|
+
return AX_TEXT_EDITOR_FONT_SIZE_TOKEN_VALUES[size];
|
|
366
|
+
}
|
|
367
|
+
return size;
|
|
368
|
+
}
|
|
369
|
+
function isTextEditorCommandActive(editor, command, attrs) {
|
|
370
|
+
switch (command) {
|
|
371
|
+
case 'heading': {
|
|
372
|
+
const level = headingLevel(attrs);
|
|
373
|
+
return level ? editor.isActive('heading', { level }) : editor.isActive('heading');
|
|
374
|
+
}
|
|
375
|
+
case 'paragraph':
|
|
376
|
+
return editor.isActive('paragraph');
|
|
377
|
+
case 'align':
|
|
378
|
+
return editor.isActive({ textAlign: attrs?.['align'] });
|
|
379
|
+
case 'direction':
|
|
380
|
+
return editor.isActive({ dir: attrs?.['direction'] });
|
|
381
|
+
case 'link':
|
|
382
|
+
return editor.isActive('link');
|
|
383
|
+
case 'image':
|
|
384
|
+
return editor.isActive('image');
|
|
385
|
+
case 'video':
|
|
386
|
+
return editor.isActive('video');
|
|
387
|
+
case 'fontSize':
|
|
388
|
+
return Boolean(editor.getAttributes('textStyle')?.['fontSize']);
|
|
389
|
+
case 'insertTable':
|
|
390
|
+
return editor.isActive('table');
|
|
391
|
+
case 'unlink':
|
|
392
|
+
case 'color':
|
|
393
|
+
case 'highlight':
|
|
394
|
+
case 'undo':
|
|
395
|
+
case 'redo':
|
|
396
|
+
case 'horizontalRule':
|
|
397
|
+
return false;
|
|
398
|
+
default:
|
|
399
|
+
return editor.isActive(command);
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
function canRunTextEditorCommand(editor, command, attrs) {
|
|
403
|
+
switch (command) {
|
|
404
|
+
case 'undo':
|
|
405
|
+
return editor.can().undo();
|
|
406
|
+
case 'redo':
|
|
407
|
+
return editor.can().redo();
|
|
408
|
+
case 'heading': {
|
|
409
|
+
const level = headingLevel(attrs);
|
|
410
|
+
return level ? editor.can().setHeading({ level }) : editor.can().setParagraph();
|
|
411
|
+
}
|
|
412
|
+
case 'paragraph':
|
|
413
|
+
return editor.can().setParagraph();
|
|
414
|
+
case 'align':
|
|
415
|
+
return editor.can().setTextAlign(String(attrs?.['align'] ?? 'left'));
|
|
416
|
+
case 'direction':
|
|
417
|
+
return true;
|
|
418
|
+
case 'color':
|
|
419
|
+
return attrs?.['color'] ? editor.can().setColor(String(attrs['color'])) : editor.can().unsetColor();
|
|
420
|
+
case 'highlight':
|
|
421
|
+
return attrs?.['color']
|
|
422
|
+
? editor.can().setHighlight({ color: String(attrs['color']) })
|
|
423
|
+
: editor.can().unsetHighlight();
|
|
424
|
+
case 'fontSize':
|
|
425
|
+
return editor.isEditable;
|
|
426
|
+
case 'link':
|
|
427
|
+
return editor.isEditable;
|
|
428
|
+
case 'unlink':
|
|
429
|
+
return editor.isEditable && editor.can().unsetLink();
|
|
430
|
+
case 'image':
|
|
431
|
+
case 'video':
|
|
432
|
+
return editor.isEditable;
|
|
433
|
+
case 'insertTable':
|
|
434
|
+
return editor.can().insertTable({
|
|
435
|
+
rows: Number(attrs?.['rows'] ?? 3),
|
|
436
|
+
cols: Number(attrs?.['cols'] ?? 3),
|
|
437
|
+
withHeaderRow: Boolean(attrs?.['withHeaderRow'] ?? false),
|
|
438
|
+
});
|
|
439
|
+
case 'addColumnBefore':
|
|
440
|
+
return editor.can().addColumnBefore();
|
|
441
|
+
case 'addColumnAfter':
|
|
442
|
+
return editor.can().addColumnAfter();
|
|
443
|
+
case 'deleteColumn':
|
|
444
|
+
return editor.can().deleteColumn();
|
|
445
|
+
case 'addRowBefore':
|
|
446
|
+
return editor.can().addRowBefore();
|
|
447
|
+
case 'addRowAfter':
|
|
448
|
+
return editor.can().addRowAfter();
|
|
449
|
+
case 'deleteRow':
|
|
450
|
+
return editor.can().deleteRow();
|
|
451
|
+
case 'toggleHeaderRow':
|
|
452
|
+
return editor.can().toggleHeaderRow();
|
|
453
|
+
case 'deleteTable':
|
|
454
|
+
return editor.can().deleteTable();
|
|
455
|
+
case 'blockquote':
|
|
456
|
+
return editor.can().toggleBlockquote();
|
|
457
|
+
case 'code':
|
|
458
|
+
return editor.can().toggleCode();
|
|
459
|
+
case 'codeBlock':
|
|
460
|
+
return editor.can().toggleCodeBlock();
|
|
461
|
+
case 'horizontalRule':
|
|
462
|
+
return editor.can().setHorizontalRule();
|
|
463
|
+
case 'bulletList':
|
|
464
|
+
return editor.isEditable && Boolean(editor.schema.nodes['bulletList']);
|
|
465
|
+
case 'orderedList':
|
|
466
|
+
return editor.isEditable && Boolean(editor.schema.nodes['orderedList']);
|
|
467
|
+
case 'superscript':
|
|
468
|
+
return editor.can().toggleSuperscript();
|
|
469
|
+
case 'subscript':
|
|
470
|
+
return editor.can().toggleSubscript();
|
|
471
|
+
case 'bold':
|
|
472
|
+
return editor.can().toggleBold();
|
|
473
|
+
case 'italic':
|
|
474
|
+
return editor.can().toggleItalic();
|
|
475
|
+
case 'underline':
|
|
476
|
+
return editor.can().toggleUnderline();
|
|
477
|
+
case 'strike':
|
|
478
|
+
return editor.can().toggleStrike();
|
|
479
|
+
default:
|
|
480
|
+
return false;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
function runTextEditorCommand(editor, command, attrs) {
|
|
484
|
+
const chain = editor.chain().focus();
|
|
485
|
+
switch (command) {
|
|
486
|
+
case 'undo':
|
|
487
|
+
return chain.undo().run();
|
|
488
|
+
case 'redo':
|
|
489
|
+
return chain.redo().run();
|
|
490
|
+
case 'heading': {
|
|
491
|
+
const level = headingLevel(attrs);
|
|
492
|
+
return level ? chain.setHeading({ level }).run() : chain.setParagraph().run();
|
|
493
|
+
}
|
|
494
|
+
case 'paragraph':
|
|
495
|
+
return chain.setParagraph().run();
|
|
496
|
+
case 'align':
|
|
497
|
+
return chain.setTextAlign(String(attrs?.['align'] ?? 'left')).run();
|
|
498
|
+
case 'direction': {
|
|
499
|
+
const direction = attrs?.['direction'] === 'rtl' ? 'rtl' : 'ltr';
|
|
500
|
+
return chain
|
|
501
|
+
.updateAttributes('paragraph', { dir: direction })
|
|
502
|
+
.updateAttributes('heading', { dir: direction })
|
|
503
|
+
.run();
|
|
504
|
+
}
|
|
505
|
+
case 'color':
|
|
506
|
+
return attrs?.['color'] ? chain.setColor(String(attrs['color'])).run() : chain.unsetColor().run();
|
|
507
|
+
case 'highlight':
|
|
508
|
+
return attrs?.['color']
|
|
509
|
+
? chain.setHighlight({ color: String(attrs['color']) }).run()
|
|
510
|
+
: chain.unsetHighlight().run();
|
|
511
|
+
case 'fontSize':
|
|
512
|
+
return chain.setFontSize(resolveFontSize(attrs)).run();
|
|
513
|
+
case 'link': {
|
|
514
|
+
const href = normalizeHref(String(attrs?.['href'] ?? ''));
|
|
515
|
+
if (!href) {
|
|
516
|
+
return chain.extendMarkRange('link').unsetLink().run();
|
|
517
|
+
}
|
|
518
|
+
if (editor.state.selection.empty) {
|
|
519
|
+
const safeHref = escapeHtml(href);
|
|
520
|
+
return chain.insertContent(`<a href="${safeHref}">${safeHref}</a>`).run();
|
|
521
|
+
}
|
|
522
|
+
return chain.extendMarkRange('link').setLink({ href }).run();
|
|
523
|
+
}
|
|
524
|
+
case 'unlink':
|
|
525
|
+
return chain.extendMarkRange('link').unsetLink().run();
|
|
526
|
+
case 'image': {
|
|
527
|
+
const src = String(attrs?.['src'] ?? '').trim();
|
|
528
|
+
if (!src)
|
|
529
|
+
return false;
|
|
530
|
+
return chain.setImage({ src, alt: String(attrs?.['alt'] ?? '') }).run();
|
|
531
|
+
}
|
|
532
|
+
case 'video': {
|
|
533
|
+
const src = String(attrs?.['src'] ?? '').trim();
|
|
534
|
+
if (!src)
|
|
535
|
+
return false;
|
|
536
|
+
return chain.setVideo({ src }).run();
|
|
537
|
+
}
|
|
538
|
+
case 'insertTable':
|
|
539
|
+
return chain
|
|
540
|
+
.insertTable({
|
|
541
|
+
rows: Number(attrs?.['rows'] ?? 3),
|
|
542
|
+
cols: Number(attrs?.['cols'] ?? 3),
|
|
543
|
+
withHeaderRow: Boolean(attrs?.['withHeaderRow'] ?? false),
|
|
544
|
+
})
|
|
545
|
+
.run();
|
|
546
|
+
case 'addColumnBefore':
|
|
547
|
+
return chain.addColumnBefore().run();
|
|
548
|
+
case 'addColumnAfter':
|
|
549
|
+
return chain.addColumnAfter().run();
|
|
550
|
+
case 'deleteColumn':
|
|
551
|
+
return chain.deleteColumn().run();
|
|
552
|
+
case 'addRowBefore':
|
|
553
|
+
return chain.addRowBefore().run();
|
|
554
|
+
case 'addRowAfter':
|
|
555
|
+
return chain.addRowAfter().run();
|
|
556
|
+
case 'deleteRow':
|
|
557
|
+
return chain.deleteRow().run();
|
|
558
|
+
case 'toggleHeaderRow':
|
|
559
|
+
return chain.toggleHeaderRow().run();
|
|
560
|
+
case 'deleteTable':
|
|
561
|
+
return chain.deleteTable().run();
|
|
562
|
+
case 'blockquote':
|
|
563
|
+
return chain.toggleBlockquote().run();
|
|
564
|
+
case 'code':
|
|
565
|
+
return chain.toggleCode().run();
|
|
566
|
+
case 'codeBlock':
|
|
567
|
+
return chain.toggleCodeBlock().run();
|
|
568
|
+
case 'horizontalRule':
|
|
569
|
+
return chain.setHorizontalRule().run();
|
|
570
|
+
case 'bulletList':
|
|
571
|
+
return chain.toggleBulletList().run();
|
|
572
|
+
case 'orderedList':
|
|
573
|
+
return chain.toggleOrderedList().run();
|
|
574
|
+
case 'superscript':
|
|
575
|
+
return chain.toggleSuperscript().run();
|
|
576
|
+
case 'subscript':
|
|
577
|
+
return chain.toggleSubscript().run();
|
|
578
|
+
case 'bold':
|
|
579
|
+
return chain.toggleBold().run();
|
|
580
|
+
case 'italic':
|
|
581
|
+
return chain.toggleItalic().run();
|
|
582
|
+
case 'underline':
|
|
583
|
+
return chain.toggleUnderline().run();
|
|
584
|
+
case 'strike':
|
|
585
|
+
return chain.toggleStrike().run();
|
|
586
|
+
default:
|
|
587
|
+
return false;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
var textEditor_commands = /*#__PURE__*/Object.freeze({
|
|
592
|
+
__proto__: null,
|
|
593
|
+
canRunTextEditorCommand: canRunTextEditorCommand,
|
|
594
|
+
isTextEditorCommandActive: isTextEditorCommandActive,
|
|
595
|
+
runTextEditorCommand: runTextEditorCommand
|
|
596
|
+
});
|
|
597
|
+
|
|
598
|
+
function createSuperscript(core) {
|
|
599
|
+
return core.Mark.create({
|
|
600
|
+
name: 'superscript',
|
|
601
|
+
excludes: 'subscript',
|
|
602
|
+
parseHTML() {
|
|
603
|
+
return [{ tag: 'sup' }];
|
|
604
|
+
},
|
|
605
|
+
renderHTML({ HTMLAttributes }) {
|
|
606
|
+
return ['sup', core.mergeAttributes(HTMLAttributes), 0];
|
|
607
|
+
},
|
|
608
|
+
addCommands() {
|
|
609
|
+
return {
|
|
610
|
+
toggleSuperscript: () => ({ commands }) => commands.toggleMark(this.name),
|
|
611
|
+
};
|
|
612
|
+
},
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
function createSubscript(core) {
|
|
616
|
+
return core.Mark.create({
|
|
617
|
+
name: 'subscript',
|
|
618
|
+
excludes: 'superscript',
|
|
619
|
+
parseHTML() {
|
|
620
|
+
return [{ tag: 'sub' }];
|
|
621
|
+
},
|
|
622
|
+
renderHTML({ HTMLAttributes }) {
|
|
623
|
+
return ['sub', core.mergeAttributes(HTMLAttributes), 0];
|
|
624
|
+
},
|
|
625
|
+
addCommands() {
|
|
626
|
+
return {
|
|
627
|
+
toggleSubscript: () => ({ commands }) => commands.toggleMark(this.name),
|
|
628
|
+
};
|
|
629
|
+
},
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
function createKeepSelection(core, pmState, pmView) {
|
|
633
|
+
const keepSelectionKey = new pmState.PluginKey('axKeepSelection');
|
|
634
|
+
return core.Extension.create({
|
|
635
|
+
name: 'keepSelection',
|
|
636
|
+
addProseMirrorPlugins() {
|
|
637
|
+
return [
|
|
638
|
+
new pmState.Plugin({
|
|
639
|
+
key: keepSelectionKey,
|
|
640
|
+
state: {
|
|
641
|
+
init() {
|
|
642
|
+
return pmView.DecorationSet.empty;
|
|
643
|
+
},
|
|
644
|
+
apply(tr, set) {
|
|
645
|
+
const meta = tr.getMeta(keepSelectionKey);
|
|
646
|
+
if (meta === 'clear')
|
|
647
|
+
return pmView.DecorationSet.empty;
|
|
648
|
+
if (meta && meta.from !== meta.to) {
|
|
649
|
+
return pmView.DecorationSet.create(tr.doc, [
|
|
650
|
+
pmView.Decoration.inline(meta.from, meta.to, { class: 'ax-text-editor-kept-selection' }),
|
|
651
|
+
]);
|
|
652
|
+
}
|
|
653
|
+
return set.map(tr.mapping, tr.doc);
|
|
654
|
+
},
|
|
655
|
+
},
|
|
656
|
+
props: {
|
|
657
|
+
decorations(state) {
|
|
658
|
+
return keepSelectionKey.getState(state);
|
|
659
|
+
},
|
|
660
|
+
handleDOMEvents: {
|
|
661
|
+
blur(view) {
|
|
662
|
+
const { from, to } = view.state.selection;
|
|
663
|
+
if (from !== to) {
|
|
664
|
+
view.dispatch(view.state.tr.setMeta(keepSelectionKey, { from, to }));
|
|
665
|
+
}
|
|
666
|
+
return false;
|
|
667
|
+
},
|
|
668
|
+
focus(view) {
|
|
669
|
+
const decorations = keepSelectionKey.getState(view.state);
|
|
670
|
+
if (decorations?.find().length) {
|
|
671
|
+
view.dispatch(view.state.tr.setMeta(keepSelectionKey, 'clear'));
|
|
672
|
+
}
|
|
673
|
+
return false;
|
|
674
|
+
},
|
|
675
|
+
},
|
|
676
|
+
},
|
|
677
|
+
}),
|
|
678
|
+
];
|
|
679
|
+
},
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
function createTextDirection(core) {
|
|
683
|
+
return core.Extension.create({
|
|
684
|
+
name: 'textDirection',
|
|
685
|
+
addGlobalAttributes() {
|
|
686
|
+
return [
|
|
687
|
+
{
|
|
688
|
+
types: ['paragraph', 'heading'],
|
|
689
|
+
attributes: {
|
|
690
|
+
dir: {
|
|
691
|
+
default: null,
|
|
692
|
+
parseHTML: (element) => element.getAttribute('dir'),
|
|
693
|
+
renderHTML: (attributes) => (attributes['dir'] ? { dir: attributes['dir'] } : {}),
|
|
694
|
+
},
|
|
695
|
+
},
|
|
696
|
+
},
|
|
697
|
+
];
|
|
698
|
+
},
|
|
699
|
+
});
|
|
700
|
+
}
|
|
701
|
+
function createFontSize(core) {
|
|
702
|
+
return core.Extension.create({
|
|
703
|
+
name: 'axTextEditorFontSize',
|
|
704
|
+
addGlobalAttributes() {
|
|
705
|
+
return [
|
|
706
|
+
{
|
|
707
|
+
types: ['textStyle'],
|
|
708
|
+
attributes: {
|
|
709
|
+
fontSize: {
|
|
710
|
+
default: null,
|
|
711
|
+
parseHTML: (element) => element.style.fontSize?.replace(/['"]+/g, '') || null,
|
|
712
|
+
renderHTML: (attributes) => attributes['fontSize'] ? { style: `font-size: ${attributes['fontSize']}` } : {},
|
|
713
|
+
},
|
|
714
|
+
},
|
|
715
|
+
},
|
|
716
|
+
];
|
|
717
|
+
},
|
|
718
|
+
addCommands() {
|
|
719
|
+
return {
|
|
720
|
+
setFontSize: (size) => ({ chain }) => {
|
|
721
|
+
if (!size) {
|
|
722
|
+
return chain().focus().setMark('textStyle', { fontSize: null }).removeEmptyTextStyle().run();
|
|
723
|
+
}
|
|
724
|
+
return chain().focus().setMark('textStyle', { fontSize: size }).run();
|
|
725
|
+
},
|
|
726
|
+
};
|
|
727
|
+
},
|
|
728
|
+
});
|
|
729
|
+
}
|
|
730
|
+
function createVideo(core) {
|
|
731
|
+
return core.Node.create({
|
|
732
|
+
name: 'video',
|
|
733
|
+
group: 'block',
|
|
734
|
+
atom: true,
|
|
735
|
+
addOptions() {
|
|
736
|
+
return {
|
|
737
|
+
HTMLAttributes: {},
|
|
738
|
+
};
|
|
739
|
+
},
|
|
740
|
+
addAttributes() {
|
|
741
|
+
return {
|
|
742
|
+
src: {
|
|
743
|
+
default: null,
|
|
744
|
+
},
|
|
745
|
+
};
|
|
746
|
+
},
|
|
747
|
+
parseHTML() {
|
|
748
|
+
return [
|
|
749
|
+
{ tag: 'video[src]' },
|
|
750
|
+
{ tag: 'div[data-text-editor-video] video' },
|
|
751
|
+
{ tag: 'div[data-wysiwyg-video] iframe' },
|
|
752
|
+
{ tag: 'iframe[src]' },
|
|
753
|
+
];
|
|
754
|
+
},
|
|
755
|
+
renderHTML({ HTMLAttributes }) {
|
|
756
|
+
const src = String(HTMLAttributes['src'] ?? '');
|
|
757
|
+
if (isEmbedSrc(src)) {
|
|
758
|
+
return [
|
|
759
|
+
'div',
|
|
760
|
+
core.mergeAttributes(this.options.HTMLAttributes, { 'data-text-editor-video': '' }),
|
|
761
|
+
[
|
|
762
|
+
'iframe',
|
|
763
|
+
core.mergeAttributes({
|
|
764
|
+
src,
|
|
765
|
+
frameborder: '0',
|
|
766
|
+
allowfullscreen: 'true',
|
|
767
|
+
allow: 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture',
|
|
768
|
+
}),
|
|
769
|
+
],
|
|
770
|
+
];
|
|
771
|
+
}
|
|
772
|
+
return [
|
|
773
|
+
'video',
|
|
774
|
+
core.mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
|
|
775
|
+
class: 'ax-text-editor-video',
|
|
776
|
+
controls: 'true',
|
|
777
|
+
}),
|
|
778
|
+
];
|
|
779
|
+
},
|
|
780
|
+
addCommands() {
|
|
781
|
+
return {
|
|
782
|
+
setVideo: ({ src }) => ({ commands }) => commands.insertContent({
|
|
783
|
+
type: this.name,
|
|
784
|
+
attrs: { src: toVideoSrc(src) },
|
|
785
|
+
}),
|
|
786
|
+
};
|
|
787
|
+
},
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
function isEmbedSrc(src) {
|
|
791
|
+
return /youtube\.com\/embed\/|youtu\.be\//i.test(src);
|
|
792
|
+
}
|
|
793
|
+
function toVideoSrc(src) {
|
|
794
|
+
const trimmed = src.trim();
|
|
795
|
+
if (!trimmed)
|
|
796
|
+
return trimmed;
|
|
797
|
+
try {
|
|
798
|
+
const url = new URL(trimmed);
|
|
799
|
+
if (url.hostname.includes('youtube.com') && url.searchParams.get('v')) {
|
|
800
|
+
return `https://www.youtube.com/embed/${url.searchParams.get('v')}`;
|
|
801
|
+
}
|
|
802
|
+
if (url.hostname === 'youtu.be') {
|
|
803
|
+
return `https://www.youtube.com/embed/${url.pathname.slice(1)}`;
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
catch {
|
|
807
|
+
return trimmed;
|
|
808
|
+
}
|
|
809
|
+
return trimmed;
|
|
810
|
+
}
|
|
811
|
+
const DEFAULT_HEADING_LEVELS = [1, 2, 3];
|
|
812
|
+
function resolvePlaceholder(placeholder) {
|
|
813
|
+
if (typeof placeholder === 'function') {
|
|
814
|
+
return placeholder();
|
|
815
|
+
}
|
|
816
|
+
return placeholder ?? '';
|
|
817
|
+
}
|
|
818
|
+
async function createTextEditorExtensions(placeholderOrOptions = '') {
|
|
819
|
+
const options = typeof placeholderOrOptions === 'function' || typeof placeholderOrOptions === 'string'
|
|
820
|
+
? { placeholder: placeholderOrOptions }
|
|
821
|
+
: placeholderOrOptions;
|
|
822
|
+
const features = { ...AX_DEFAULT_TEXT_EDITOR_FEATURES, ...options.features };
|
|
823
|
+
const headingLevels = options.headingLevels ?? DEFAULT_HEADING_LEVELS;
|
|
824
|
+
const [core, pmState, pmView, starterKitMod, textStyleMod, highlightMod, textAlignMod, extensionsMod, tableMod, imageMod] = await Promise.all([
|
|
825
|
+
import('@tiptap/core'),
|
|
826
|
+
import('@tiptap/pm/state'),
|
|
827
|
+
import('@tiptap/pm/view'),
|
|
828
|
+
import('@tiptap/starter-kit'),
|
|
829
|
+
import('@tiptap/extension-text-style'),
|
|
830
|
+
import('@tiptap/extension-highlight'),
|
|
831
|
+
import('@tiptap/extension-text-align'),
|
|
832
|
+
import('@tiptap/extensions'),
|
|
833
|
+
import('@tiptap/extension-table/kit'),
|
|
834
|
+
import('@tiptap/extension-image'),
|
|
835
|
+
]);
|
|
836
|
+
const Image = imageMod.default ?? imageMod.Image;
|
|
837
|
+
const Highlight = highlightMod.default ?? highlightMod.Highlight;
|
|
838
|
+
const extensions = [
|
|
839
|
+
starterKitMod.StarterKit.configure({
|
|
840
|
+
heading: {
|
|
841
|
+
levels: headingLevels,
|
|
842
|
+
HTMLAttributes: {
|
|
843
|
+
class: 'ax-text-editor-heading',
|
|
844
|
+
},
|
|
845
|
+
},
|
|
846
|
+
link: {
|
|
847
|
+
openOnClick: false,
|
|
848
|
+
HTMLAttributes: {
|
|
849
|
+
class: 'ax-text-editor-link',
|
|
850
|
+
},
|
|
851
|
+
},
|
|
852
|
+
code: {
|
|
853
|
+
HTMLAttributes: {
|
|
854
|
+
class: 'ax-text-editor-code',
|
|
855
|
+
},
|
|
856
|
+
},
|
|
857
|
+
codeBlock: {
|
|
858
|
+
HTMLAttributes: {
|
|
859
|
+
class: 'ax-text-editor-code-block',
|
|
860
|
+
},
|
|
861
|
+
},
|
|
862
|
+
bulletList: {
|
|
863
|
+
HTMLAttributes: {
|
|
864
|
+
class: 'ax-text-editor-bullet-list',
|
|
865
|
+
},
|
|
866
|
+
},
|
|
867
|
+
orderedList: {
|
|
868
|
+
HTMLAttributes: {
|
|
869
|
+
class: 'ax-text-editor-ordered-list',
|
|
870
|
+
},
|
|
871
|
+
},
|
|
872
|
+
listItem: {
|
|
873
|
+
HTMLAttributes: {
|
|
874
|
+
class: 'ax-text-editor-list-item',
|
|
875
|
+
},
|
|
876
|
+
},
|
|
877
|
+
}),
|
|
878
|
+
textStyleMod.TextStyle,
|
|
879
|
+
textStyleMod.Color,
|
|
880
|
+
createFontSize(core),
|
|
881
|
+
Highlight.configure({ multicolor: true }),
|
|
882
|
+
textAlignMod.TextAlign.configure({
|
|
883
|
+
types: ['heading', 'paragraph'],
|
|
884
|
+
}),
|
|
885
|
+
createTextDirection(core),
|
|
886
|
+
];
|
|
887
|
+
if (features.superscript) {
|
|
888
|
+
extensions.push(createSuperscript(core));
|
|
889
|
+
}
|
|
890
|
+
if (features.subscript) {
|
|
891
|
+
extensions.push(createSubscript(core));
|
|
892
|
+
}
|
|
893
|
+
if (features.keepSelection) {
|
|
894
|
+
extensions.push(createKeepSelection(core, pmState, pmView));
|
|
895
|
+
}
|
|
896
|
+
if (features.table) {
|
|
897
|
+
extensions.push(tableMod.TableKit.configure({
|
|
898
|
+
table: {
|
|
899
|
+
resizable: true,
|
|
900
|
+
lastColumnResizable: true,
|
|
901
|
+
cellMinWidth: 64,
|
|
902
|
+
HTMLAttributes: {
|
|
903
|
+
class: 'ax-text-editor-table',
|
|
904
|
+
},
|
|
905
|
+
},
|
|
906
|
+
}));
|
|
907
|
+
}
|
|
908
|
+
if (features.image) {
|
|
909
|
+
extensions.push(Image.configure({
|
|
910
|
+
inline: true,
|
|
911
|
+
allowBase64: true,
|
|
912
|
+
HTMLAttributes: {
|
|
913
|
+
class: 'ax-text-editor-image',
|
|
914
|
+
},
|
|
915
|
+
}));
|
|
916
|
+
}
|
|
917
|
+
if (features.video) {
|
|
918
|
+
extensions.push(createVideo(core));
|
|
919
|
+
}
|
|
920
|
+
if (features.placeholder) {
|
|
921
|
+
extensions.push(extensionsMod.Placeholder.configure({
|
|
922
|
+
placeholder: () => resolvePlaceholder(options.placeholder),
|
|
923
|
+
showOnlyCurrent: true,
|
|
924
|
+
}));
|
|
925
|
+
}
|
|
926
|
+
if (options.extensions?.length) {
|
|
927
|
+
extensions.push(...options.extensions);
|
|
928
|
+
}
|
|
929
|
+
return extensions;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
var textEditor_extensions = /*#__PURE__*/Object.freeze({
|
|
933
|
+
__proto__: null,
|
|
934
|
+
createTextEditorExtensions: createTextEditorExtensions
|
|
935
|
+
});
|
|
936
|
+
|
|
937
|
+
/**
|
|
938
|
+
* Generated bundle index. Do not edit.
|
|
939
|
+
*/
|
|
940
|
+
|
|
941
|
+
export { AXTextEditor, AX_DEFAULT_TEXT_EDITOR_FEATURES, AX_EMPTY_TEXT_EDITOR_STATE, AX_TEXT_EDITOR_DEFAULT_BACKGROUND_COLORS, AX_TEXT_EDITOR_DEFAULT_TEXT_COLORS, AX_TEXT_EDITOR_FONT_SIZES, AX_TEXT_EDITOR_FONT_SIZE_TOKEN_VALUES, AX_TEXT_EDITOR_ZOOM_MAX, AX_TEXT_EDITOR_ZOOM_MIN, AX_TEXT_EDITOR_ZOOM_PRESETS, canRunTextEditorCommand, createTextEditorExtensions, isTextEditorCommandActive, runTextEditorCommand };
|
|
942
|
+
//# sourceMappingURL=acorex-cdk-text-editor.mjs.map
|