@acorex/cdk 22.3.25 → 22.4.1
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-wysiwyg.mjs +689 -37
- package/fesm2022/acorex-cdk-wysiwyg.mjs.map +1 -1
- package/package.json +11 -3
- package/types/acorex-cdk-wysiwyg.d.ts +118 -14
- package/wysiwyg/README.md +3 -1
|
@@ -1,88 +1,740 @@
|
|
|
1
1
|
import { isPlatformBrowser } from '@angular/common';
|
|
2
|
-
import
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { signal, inject, PLATFORM_ID, Injectable } from '@angular/core';
|
|
4
|
+
import { Extension, Node, mergeAttributes } from '@tiptap/core';
|
|
5
|
+
|
|
6
|
+
const AX_WYSIWYG_FONT_SIZE_VALUES = {
|
|
7
|
+
small: '0.75em',
|
|
8
|
+
large: '1.5em',
|
|
9
|
+
huge: '2.5em',
|
|
10
|
+
};
|
|
11
|
+
const AXWysiwygFontSizeExtension = Extension.create({
|
|
12
|
+
name: 'axWysiwygFontSize',
|
|
13
|
+
addGlobalAttributes() {
|
|
14
|
+
return [
|
|
15
|
+
{
|
|
16
|
+
types: ['textStyle'],
|
|
17
|
+
attributes: {
|
|
18
|
+
fontSize: {
|
|
19
|
+
default: null,
|
|
20
|
+
parseHTML: (element) => element.style.fontSize?.replace(/['"]+/g, '') || null,
|
|
21
|
+
renderHTML: (attributes) => {
|
|
22
|
+
if (!attributes['fontSize']) {
|
|
23
|
+
return {};
|
|
24
|
+
}
|
|
25
|
+
return { style: `font-size: ${attributes['fontSize']}` };
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
},
|
|
32
|
+
addCommands() {
|
|
33
|
+
return {
|
|
34
|
+
setAxWysiwygFontSize: (size) => ({ chain }) => {
|
|
35
|
+
if (!size) {
|
|
36
|
+
return chain().focus().unsetMark('textStyle').run();
|
|
37
|
+
}
|
|
38
|
+
const cssSize = AX_WYSIWYG_FONT_SIZE_VALUES[size];
|
|
39
|
+
return chain().focus().setMark('textStyle', { fontSize: cssSize }).run();
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const AX_DEFAULT_WYSIWYG_FEATURES = {
|
|
46
|
+
textAlign: true,
|
|
47
|
+
image: true,
|
|
48
|
+
link: true,
|
|
49
|
+
video: true,
|
|
50
|
+
color: true,
|
|
51
|
+
highlight: true,
|
|
52
|
+
placeholder: true,
|
|
53
|
+
fontSize: true,
|
|
54
|
+
textDirection: true,
|
|
55
|
+
};
|
|
56
|
+
const AX_EMPTY_WYSIWYG_STATE = {
|
|
57
|
+
bold: false,
|
|
58
|
+
italic: false,
|
|
59
|
+
underline: false,
|
|
60
|
+
strike: false,
|
|
61
|
+
code: false,
|
|
62
|
+
codeBlock: false,
|
|
63
|
+
headingLevel: null,
|
|
64
|
+
bulletList: false,
|
|
65
|
+
orderedList: false,
|
|
66
|
+
blockquote: false,
|
|
67
|
+
textAlign: null,
|
|
68
|
+
textColor: null,
|
|
69
|
+
highlightColor: null,
|
|
70
|
+
linkHref: null,
|
|
71
|
+
fontSize: null,
|
|
72
|
+
textDirection: null,
|
|
73
|
+
canUndo: false,
|
|
74
|
+
canRedo: false,
|
|
75
|
+
isEmpty: true,
|
|
76
|
+
isFocused: false,
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const AXWysiwygTextDirectionExtension = Extension.create({
|
|
80
|
+
name: 'axWysiwygTextDirection',
|
|
81
|
+
addGlobalAttributes() {
|
|
82
|
+
return [
|
|
83
|
+
{
|
|
84
|
+
types: ['paragraph', 'heading'],
|
|
85
|
+
attributes: {
|
|
86
|
+
dir: {
|
|
87
|
+
default: null,
|
|
88
|
+
parseHTML: (element) => element.getAttribute('dir'),
|
|
89
|
+
renderHTML: (attributes) => {
|
|
90
|
+
if (!attributes['dir']) {
|
|
91
|
+
return {};
|
|
92
|
+
}
|
|
93
|
+
return { dir: attributes['dir'] };
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
];
|
|
99
|
+
},
|
|
100
|
+
addCommands() {
|
|
101
|
+
return {
|
|
102
|
+
setAxWysiwygTextDirection: (direction) => ({ chain }) => chain()
|
|
103
|
+
.focus()
|
|
104
|
+
.updateAttributes('paragraph', { dir: direction })
|
|
105
|
+
.updateAttributes('heading', { dir: direction })
|
|
106
|
+
.run(),
|
|
107
|
+
};
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
function toEmbedSrc(src) {
|
|
112
|
+
const trimmed = src.trim();
|
|
113
|
+
if (!trimmed) {
|
|
114
|
+
return trimmed;
|
|
115
|
+
}
|
|
116
|
+
try {
|
|
117
|
+
const url = new URL(trimmed);
|
|
118
|
+
if (url.hostname.includes('youtube.com') && url.searchParams.get('v')) {
|
|
119
|
+
return `https://www.youtube.com/embed/${url.searchParams.get('v')}`;
|
|
120
|
+
}
|
|
121
|
+
if (url.hostname === 'youtu.be') {
|
|
122
|
+
return `https://www.youtube.com/embed/${url.pathname.slice(1)}`;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
catch {
|
|
126
|
+
return trimmed;
|
|
127
|
+
}
|
|
128
|
+
return trimmed;
|
|
129
|
+
}
|
|
130
|
+
const AXWysiwygVideoExtension = Node.create({
|
|
131
|
+
name: 'video',
|
|
132
|
+
group: 'block',
|
|
133
|
+
atom: true,
|
|
134
|
+
addOptions() {
|
|
135
|
+
return {
|
|
136
|
+
inline: false,
|
|
137
|
+
allowBase64: false,
|
|
138
|
+
HTMLAttributes: {},
|
|
139
|
+
};
|
|
140
|
+
},
|
|
141
|
+
addAttributes() {
|
|
142
|
+
return {
|
|
143
|
+
src: {
|
|
144
|
+
default: null,
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
},
|
|
148
|
+
parseHTML() {
|
|
149
|
+
return [
|
|
150
|
+
{
|
|
151
|
+
tag: 'div[data-wysiwyg-video] iframe',
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
tag: 'iframe[src]',
|
|
155
|
+
},
|
|
156
|
+
];
|
|
157
|
+
},
|
|
158
|
+
renderHTML({ HTMLAttributes }) {
|
|
159
|
+
const src = HTMLAttributes['src'];
|
|
160
|
+
return [
|
|
161
|
+
'div',
|
|
162
|
+
mergeAttributes(this.options.HTMLAttributes, { 'data-wysiwyg-video': '' }),
|
|
163
|
+
[
|
|
164
|
+
'iframe',
|
|
165
|
+
mergeAttributes({
|
|
166
|
+
src,
|
|
167
|
+
frameborder: '0',
|
|
168
|
+
allowfullscreen: 'true',
|
|
169
|
+
allow: 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture',
|
|
170
|
+
}),
|
|
171
|
+
],
|
|
172
|
+
];
|
|
173
|
+
},
|
|
174
|
+
addCommands() {
|
|
175
|
+
return {
|
|
176
|
+
setVideo: ({ src }) => ({ commands }) => commands.insertContent({
|
|
177
|
+
type: this.name,
|
|
178
|
+
attrs: { src: toEmbedSrc(src) },
|
|
179
|
+
}),
|
|
180
|
+
};
|
|
181
|
+
},
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
async function loadAXWysiwygExtensions(options) {
|
|
185
|
+
const features = { ...AX_DEFAULT_WYSIWYG_FEATURES, ...options?.features };
|
|
186
|
+
const [starterKitMod, textStyleMod, colorMod, highlightMod, underlineMod] = await Promise.all([
|
|
187
|
+
import('@tiptap/starter-kit'),
|
|
188
|
+
import('@tiptap/extension-text-style'),
|
|
189
|
+
import('@tiptap/extension-color'),
|
|
190
|
+
import('@tiptap/extension-highlight'),
|
|
191
|
+
import('@tiptap/extension-underline'),
|
|
192
|
+
]);
|
|
193
|
+
const extensions = [
|
|
194
|
+
starterKitMod.default.configure({
|
|
195
|
+
link: features.link ? { openOnClick: false } : false,
|
|
196
|
+
}),
|
|
197
|
+
underlineMod.default,
|
|
198
|
+
];
|
|
199
|
+
if (features.color || features.fontSize) {
|
|
200
|
+
extensions.push(textStyleMod.TextStyle);
|
|
201
|
+
}
|
|
202
|
+
if (features.color) {
|
|
203
|
+
extensions.push(colorMod.Color);
|
|
204
|
+
}
|
|
205
|
+
if (features.highlight) {
|
|
206
|
+
extensions.push(highlightMod.default.configure({ multicolor: true }));
|
|
207
|
+
}
|
|
208
|
+
if (features.fontSize) {
|
|
209
|
+
extensions.push(AXWysiwygFontSizeExtension);
|
|
210
|
+
}
|
|
211
|
+
if (features.textDirection) {
|
|
212
|
+
extensions.push(AXWysiwygTextDirectionExtension);
|
|
213
|
+
}
|
|
214
|
+
if (features.textAlign) {
|
|
215
|
+
const textAlignMod = await import('@tiptap/extension-text-align');
|
|
216
|
+
extensions.push(textAlignMod.default.configure({
|
|
217
|
+
types: ['heading', 'paragraph'],
|
|
218
|
+
}));
|
|
219
|
+
}
|
|
220
|
+
if (features.image) {
|
|
221
|
+
const imageMod = await import('@tiptap/extension-image');
|
|
222
|
+
extensions.push(imageMod.default.configure({
|
|
223
|
+
inline: true,
|
|
224
|
+
allowBase64: true,
|
|
225
|
+
}));
|
|
226
|
+
}
|
|
227
|
+
if (features.video) {
|
|
228
|
+
extensions.push(AXWysiwygVideoExtension);
|
|
229
|
+
}
|
|
230
|
+
if (features.placeholder && options?.placeholder) {
|
|
231
|
+
const { Placeholder } = await import('@tiptap/extensions');
|
|
232
|
+
extensions.push(Placeholder.configure({
|
|
233
|
+
placeholder: options.placeholder,
|
|
234
|
+
}));
|
|
235
|
+
}
|
|
236
|
+
return extensions;
|
|
237
|
+
}
|
|
3
238
|
|
|
4
239
|
class AXWysiwyg {
|
|
5
240
|
constructor() {
|
|
6
|
-
this.
|
|
7
|
-
...(ngDevMode ? [{ debugName: "
|
|
241
|
+
this.editor = signal(null, /* @ts-ignore */
|
|
242
|
+
...(ngDevMode ? [{ debugName: "editor" }] : /* istanbul ignore next */ []));
|
|
243
|
+
this.state = signal(AX_EMPTY_WYSIWYG_STATE, /* @ts-ignore */
|
|
244
|
+
...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
245
|
+
this.ready = signal(false, /* @ts-ignore */
|
|
246
|
+
...(ngDevMode ? [{ debugName: "ready" }] : /* istanbul ignore next */ []));
|
|
8
247
|
this.platformId = inject(PLATFORM_ID);
|
|
248
|
+
this.destroyed = false;
|
|
249
|
+
this.applyingContent = false;
|
|
9
250
|
}
|
|
10
|
-
async init(container,
|
|
11
|
-
if (!isPlatformBrowser(this.platformId))
|
|
251
|
+
async init(container, options = {}) {
|
|
252
|
+
if (!isPlatformBrowser(this.platformId)) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
const element = typeof container === 'string' ? document.querySelector(container) : container;
|
|
256
|
+
if (!element) {
|
|
12
257
|
return;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
258
|
+
}
|
|
259
|
+
this.destroyed = false;
|
|
260
|
+
const editable = options.readOnly === true ? false : (options.editable ?? true);
|
|
261
|
+
const extensions = await loadAXWysiwygExtensions({
|
|
262
|
+
features: options.features,
|
|
263
|
+
placeholder: options.placeholder,
|
|
16
264
|
});
|
|
265
|
+
if (this.destroyed) {
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
const { Editor } = await import('@tiptap/core');
|
|
269
|
+
if (this.destroyed) {
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
const allExtensions = [...extensions, ...(options.extensions ?? [])];
|
|
273
|
+
const editor = new Editor({
|
|
274
|
+
element,
|
|
275
|
+
extensions: allExtensions,
|
|
276
|
+
content: options.content ?? '',
|
|
277
|
+
editable,
|
|
278
|
+
editorProps: {
|
|
279
|
+
attributes: {
|
|
280
|
+
class: 'tiptap',
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
onUpdate: ({ editor: ed }) => {
|
|
284
|
+
this.refreshState(ed);
|
|
285
|
+
if (!this.applyingContent) {
|
|
286
|
+
options.onUpdate?.(ed);
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
onSelectionUpdate: ({ editor: ed }) => {
|
|
290
|
+
this.refreshState(ed);
|
|
291
|
+
options.onSelectionUpdate?.(ed);
|
|
292
|
+
},
|
|
293
|
+
onFocus: ({ editor: ed }) => {
|
|
294
|
+
this.refreshState(ed);
|
|
295
|
+
options.onFocus?.(ed);
|
|
296
|
+
},
|
|
297
|
+
onBlur: ({ editor: ed }) => {
|
|
298
|
+
this.refreshState(ed);
|
|
299
|
+
options.onBlur?.(ed);
|
|
300
|
+
},
|
|
301
|
+
});
|
|
302
|
+
this.editor.set(editor);
|
|
303
|
+
this.ready.set(true);
|
|
304
|
+
this.refreshState(editor);
|
|
305
|
+
}
|
|
306
|
+
destroy() {
|
|
307
|
+
this.destroyed = true;
|
|
308
|
+
const ed = this.editor();
|
|
309
|
+
ed?.destroy();
|
|
310
|
+
this.editor.set(null);
|
|
311
|
+
this.ready.set(false);
|
|
312
|
+
this.state.set(AX_EMPTY_WYSIWYG_STATE);
|
|
313
|
+
}
|
|
314
|
+
setContent(value, emit = false) {
|
|
315
|
+
const ed = this.editor();
|
|
316
|
+
if (!ed) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
const html = value?.trim() ? value : '';
|
|
320
|
+
this.applyingContent = true;
|
|
321
|
+
try {
|
|
322
|
+
ed.commands.setContent(html, { emitUpdate: emit });
|
|
323
|
+
this.refreshState(ed);
|
|
324
|
+
}
|
|
325
|
+
finally {
|
|
326
|
+
this.applyingContent = false;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
getHTML() {
|
|
330
|
+
return this.editor()?.getHTML() ?? '';
|
|
331
|
+
}
|
|
332
|
+
get JSONoutput() {
|
|
333
|
+
return this.editor()?.getJSON() ?? null;
|
|
334
|
+
}
|
|
335
|
+
getText() {
|
|
336
|
+
return this.editor()?.getText() ?? '';
|
|
337
|
+
}
|
|
338
|
+
isEmpty() {
|
|
339
|
+
return this.editor()?.isEmpty ?? true;
|
|
340
|
+
}
|
|
341
|
+
setEditable(editable) {
|
|
342
|
+
this.editor()?.setEditable(editable);
|
|
343
|
+
const ed = this.editor();
|
|
344
|
+
if (ed) {
|
|
345
|
+
this.refreshState(ed);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
get HTMLoutput() {
|
|
349
|
+
return this.getHTML();
|
|
17
350
|
}
|
|
18
351
|
bold(value) {
|
|
19
|
-
this.
|
|
352
|
+
this.setMarkActive('bold', value);
|
|
20
353
|
}
|
|
21
354
|
italic(value) {
|
|
22
|
-
this.
|
|
355
|
+
this.setMarkActive('italic', value);
|
|
23
356
|
}
|
|
24
357
|
underLine(value) {
|
|
25
|
-
this.
|
|
358
|
+
this.setMarkActive('underline', value);
|
|
26
359
|
}
|
|
27
360
|
strike(value) {
|
|
28
|
-
this.
|
|
361
|
+
this.setMarkActive('strike', value);
|
|
29
362
|
}
|
|
30
363
|
color(value) {
|
|
31
|
-
|
|
364
|
+
if (value) {
|
|
365
|
+
this.setColor(value);
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
this.unsetColor();
|
|
369
|
+
}
|
|
32
370
|
}
|
|
33
371
|
header(value) {
|
|
34
|
-
this.
|
|
372
|
+
const ed = this.editor();
|
|
373
|
+
if (!ed) {
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
if (value >= 1 && value <= 6) {
|
|
377
|
+
ed.chain()
|
|
378
|
+
.focus()
|
|
379
|
+
.toggleHeading({ level: value })
|
|
380
|
+
.run();
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
ed.chain().focus().setParagraph().run();
|
|
384
|
+
}
|
|
35
385
|
}
|
|
36
386
|
list(value) {
|
|
37
|
-
this.
|
|
387
|
+
const ed = this.editor();
|
|
388
|
+
if (!ed) {
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
const chain = ed.chain().focus();
|
|
392
|
+
if (value === 'bullet') {
|
|
393
|
+
chain.toggleBulletList().run();
|
|
394
|
+
}
|
|
395
|
+
else if (value === 'ordered') {
|
|
396
|
+
chain.toggleOrderedList().run();
|
|
397
|
+
}
|
|
398
|
+
else {
|
|
399
|
+
chain.liftListItem('listItem').run();
|
|
400
|
+
}
|
|
38
401
|
}
|
|
39
402
|
align(value) {
|
|
40
403
|
if (value === 'left') {
|
|
41
|
-
this.
|
|
404
|
+
this.setTextAlign('left');
|
|
42
405
|
}
|
|
43
406
|
else {
|
|
44
|
-
this.
|
|
407
|
+
this.setTextAlign(value);
|
|
45
408
|
}
|
|
46
409
|
}
|
|
47
410
|
direction(value) {
|
|
48
|
-
this.
|
|
411
|
+
this.setTextDirection(value);
|
|
49
412
|
}
|
|
50
413
|
fontSize(value, range) {
|
|
51
|
-
this.
|
|
414
|
+
const ed = this.editor();
|
|
415
|
+
if (!ed || !range) {
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
const from = range.index;
|
|
419
|
+
const to = range.index + range.length;
|
|
420
|
+
if (value === false) {
|
|
421
|
+
ed.chain().focus().setTextSelection({ from, to }).setAxWysiwygFontSize(null).run();
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
ed.chain().focus().setTextSelection({ from, to }).setAxWysiwygFontSize(value).run();
|
|
52
425
|
}
|
|
53
|
-
|
|
54
|
-
|
|
426
|
+
background(value) {
|
|
427
|
+
if (value) {
|
|
428
|
+
this.setHighlight(value);
|
|
429
|
+
}
|
|
430
|
+
else {
|
|
431
|
+
this.unsetHighlight();
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
addImage(value) {
|
|
435
|
+
this.insertImage(value);
|
|
436
|
+
}
|
|
437
|
+
insertVideo(src) {
|
|
438
|
+
this.editor()?.chain().focus().setVideo({ src }).run();
|
|
439
|
+
}
|
|
440
|
+
codeBlock(range, status) {
|
|
441
|
+
const ed = this.editor();
|
|
442
|
+
if (!ed || !range) {
|
|
443
|
+
return;
|
|
444
|
+
}
|
|
445
|
+
const from = range.index;
|
|
446
|
+
const to = range.index + range.length;
|
|
447
|
+
if (status) {
|
|
448
|
+
ed.chain().focus().setTextSelection({ from, to }).toggleCodeBlock().run();
|
|
449
|
+
}
|
|
450
|
+
else {
|
|
451
|
+
ed.chain().focus().setTextSelection({ from, to }).setParagraph().run();
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
focus() {
|
|
455
|
+
this.editor()?.commands.focus();
|
|
456
|
+
}
|
|
457
|
+
blur() {
|
|
458
|
+
this.editor()?.commands.blur();
|
|
459
|
+
}
|
|
460
|
+
toggleBold() {
|
|
461
|
+
this.editor()?.chain().focus().toggleBold().run();
|
|
462
|
+
}
|
|
463
|
+
toggleItalic() {
|
|
464
|
+
this.editor()?.chain().focus().toggleItalic().run();
|
|
465
|
+
}
|
|
466
|
+
toggleUnderline() {
|
|
467
|
+
this.editor()?.chain().focus().toggleUnderline().run();
|
|
468
|
+
}
|
|
469
|
+
toggleStrike() {
|
|
470
|
+
this.editor()?.chain().focus().toggleStrike().run();
|
|
471
|
+
}
|
|
472
|
+
toggleCode() {
|
|
473
|
+
this.editor()?.chain().focus().toggleCode().run();
|
|
474
|
+
}
|
|
475
|
+
toggleCodeBlock() {
|
|
476
|
+
this.editor()?.chain().focus().toggleCodeBlock().run();
|
|
477
|
+
}
|
|
478
|
+
toggleHeading(level) {
|
|
479
|
+
this.editor()?.chain().focus().toggleHeading({ level }).run();
|
|
480
|
+
}
|
|
481
|
+
setParagraph() {
|
|
482
|
+
this.editor()?.chain().focus().setParagraph().run();
|
|
483
|
+
}
|
|
484
|
+
toggleBulletList() {
|
|
485
|
+
this.editor()?.chain().focus().toggleBulletList().run();
|
|
486
|
+
}
|
|
487
|
+
toggleOrderedList() {
|
|
488
|
+
this.editor()?.chain().focus().toggleOrderedList().run();
|
|
489
|
+
}
|
|
490
|
+
toggleBlockquote() {
|
|
491
|
+
this.editor()?.chain().focus().toggleBlockquote().run();
|
|
492
|
+
}
|
|
493
|
+
setTextAlign(align) {
|
|
494
|
+
this.editor()?.chain().focus().setTextAlign(align).run();
|
|
495
|
+
}
|
|
496
|
+
setTextDirection(direction) {
|
|
497
|
+
this.editor()?.chain().focus().setAxWysiwygTextDirection(direction).run();
|
|
498
|
+
}
|
|
499
|
+
setFontSize(size) {
|
|
500
|
+
this.editor()?.chain().focus().setAxWysiwygFontSize(size).run();
|
|
501
|
+
}
|
|
502
|
+
setColor(color) {
|
|
503
|
+
this.editor()?.chain().focus().setColor(color).run();
|
|
504
|
+
}
|
|
505
|
+
unsetColor() {
|
|
506
|
+
this.editor()?.chain().focus().unsetColor().run();
|
|
507
|
+
}
|
|
508
|
+
setHighlight(color) {
|
|
509
|
+
this.editor()?.chain().focus().setHighlight({ color }).run();
|
|
510
|
+
}
|
|
511
|
+
unsetHighlight() {
|
|
512
|
+
this.editor()?.chain().focus().unsetHighlight().run();
|
|
513
|
+
}
|
|
514
|
+
setLink(href) {
|
|
515
|
+
this.editor()?.chain().focus().extendMarkRange('link').setLink({ href }).run();
|
|
516
|
+
}
|
|
517
|
+
unsetLink() {
|
|
518
|
+
this.editor()?.chain().focus().unsetLink().run();
|
|
519
|
+
}
|
|
520
|
+
insertImage(src, alt) {
|
|
521
|
+
this.editor()?.chain().focus().setImage({ src, alt }).run();
|
|
55
522
|
}
|
|
56
523
|
undo() {
|
|
57
|
-
this.
|
|
524
|
+
const ed = this.editor();
|
|
525
|
+
if (!ed) {
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
ed.chain().focus().undo().run();
|
|
529
|
+
this.refreshState(ed);
|
|
58
530
|
}
|
|
59
531
|
redo() {
|
|
60
|
-
this.
|
|
532
|
+
const ed = this.editor();
|
|
533
|
+
if (!ed) {
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
ed.chain().focus().redo().run();
|
|
537
|
+
this.refreshState(ed);
|
|
61
538
|
}
|
|
62
|
-
|
|
63
|
-
this.
|
|
539
|
+
clearFormatting() {
|
|
540
|
+
this.editor()?.chain().focus().clearNodes().unsetAllMarks().run();
|
|
64
541
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
542
|
+
execute(command, payload) {
|
|
543
|
+
switch (command) {
|
|
544
|
+
case 'bold':
|
|
545
|
+
this.toggleBold();
|
|
546
|
+
break;
|
|
547
|
+
case 'italic':
|
|
548
|
+
this.toggleItalic();
|
|
549
|
+
break;
|
|
550
|
+
case 'underline':
|
|
551
|
+
this.toggleUnderline();
|
|
552
|
+
break;
|
|
553
|
+
case 'strike':
|
|
554
|
+
this.toggleStrike();
|
|
555
|
+
break;
|
|
556
|
+
case 'code':
|
|
557
|
+
this.toggleCode();
|
|
558
|
+
break;
|
|
559
|
+
case 'codeBlock':
|
|
560
|
+
this.toggleCodeBlock();
|
|
561
|
+
break;
|
|
562
|
+
case 'heading':
|
|
563
|
+
if (typeof payload === 'number') {
|
|
564
|
+
this.toggleHeading(payload);
|
|
565
|
+
}
|
|
566
|
+
break;
|
|
567
|
+
case 'paragraph':
|
|
568
|
+
this.setParagraph();
|
|
569
|
+
break;
|
|
570
|
+
case 'bulletList':
|
|
571
|
+
this.toggleBulletList();
|
|
572
|
+
break;
|
|
573
|
+
case 'orderedList':
|
|
574
|
+
this.toggleOrderedList();
|
|
575
|
+
break;
|
|
576
|
+
case 'blockquote':
|
|
577
|
+
this.toggleBlockquote();
|
|
578
|
+
break;
|
|
579
|
+
case 'textAlign':
|
|
580
|
+
if (typeof payload === 'string') {
|
|
581
|
+
this.setTextAlign(payload);
|
|
582
|
+
}
|
|
583
|
+
break;
|
|
584
|
+
case 'direction':
|
|
585
|
+
if (payload === 'rtl' || payload === 'ltr') {
|
|
586
|
+
this.setTextDirection(payload);
|
|
587
|
+
}
|
|
588
|
+
break;
|
|
589
|
+
case 'fontSize':
|
|
590
|
+
if (payload === null) {
|
|
591
|
+
this.setFontSize(null);
|
|
592
|
+
}
|
|
593
|
+
else if (payload === 'small' || payload === 'large' || payload === 'huge') {
|
|
594
|
+
this.setFontSize(payload);
|
|
595
|
+
}
|
|
596
|
+
break;
|
|
597
|
+
case 'color':
|
|
598
|
+
if (typeof payload === 'string') {
|
|
599
|
+
this.setColor(payload);
|
|
600
|
+
}
|
|
601
|
+
else {
|
|
602
|
+
this.unsetColor();
|
|
603
|
+
}
|
|
604
|
+
break;
|
|
605
|
+
case 'highlight':
|
|
606
|
+
if (typeof payload === 'string') {
|
|
607
|
+
this.setHighlight(payload);
|
|
608
|
+
}
|
|
609
|
+
else {
|
|
610
|
+
this.unsetHighlight();
|
|
611
|
+
}
|
|
612
|
+
break;
|
|
613
|
+
case 'link':
|
|
614
|
+
if (typeof payload === 'string' && payload) {
|
|
615
|
+
this.setLink(payload);
|
|
616
|
+
}
|
|
617
|
+
else {
|
|
618
|
+
this.unsetLink();
|
|
619
|
+
}
|
|
620
|
+
break;
|
|
621
|
+
case 'image':
|
|
622
|
+
if (typeof payload === 'string') {
|
|
623
|
+
this.insertImage(payload);
|
|
624
|
+
}
|
|
625
|
+
break;
|
|
626
|
+
case 'video':
|
|
627
|
+
if (typeof payload === 'string') {
|
|
628
|
+
this.insertVideo(payload);
|
|
629
|
+
}
|
|
630
|
+
break;
|
|
631
|
+
case 'undo':
|
|
632
|
+
this.undo();
|
|
633
|
+
break;
|
|
634
|
+
case 'redo':
|
|
635
|
+
this.redo();
|
|
636
|
+
break;
|
|
637
|
+
case 'clearFormatting':
|
|
638
|
+
this.clearFormatting();
|
|
639
|
+
break;
|
|
640
|
+
}
|
|
69
641
|
}
|
|
70
|
-
|
|
71
|
-
this.
|
|
642
|
+
isActive(name, attrs) {
|
|
643
|
+
return this.editor()?.isActive(name, attrs) ?? false;
|
|
72
644
|
}
|
|
73
|
-
|
|
74
|
-
this.
|
|
645
|
+
can(command) {
|
|
646
|
+
const ed = this.editor();
|
|
647
|
+
if (!ed) {
|
|
648
|
+
return false;
|
|
649
|
+
}
|
|
650
|
+
if (command === 'undo') {
|
|
651
|
+
return ed.can().undo();
|
|
652
|
+
}
|
|
653
|
+
return ed.can().redo();
|
|
75
654
|
}
|
|
76
|
-
|
|
77
|
-
|
|
655
|
+
setMarkActive(name, active) {
|
|
656
|
+
const ed = this.editor();
|
|
657
|
+
if (!ed) {
|
|
78
658
|
return;
|
|
79
|
-
|
|
659
|
+
}
|
|
660
|
+
const chain = ed.chain().focus();
|
|
661
|
+
switch (name) {
|
|
662
|
+
case 'bold':
|
|
663
|
+
active ? chain.setBold().run() : chain.unsetBold().run();
|
|
664
|
+
break;
|
|
665
|
+
case 'italic':
|
|
666
|
+
active ? chain.setItalic().run() : chain.unsetItalic().run();
|
|
667
|
+
break;
|
|
668
|
+
case 'underline':
|
|
669
|
+
active ? chain.setUnderline().run() : chain.unsetUnderline().run();
|
|
670
|
+
break;
|
|
671
|
+
case 'strike':
|
|
672
|
+
active ? chain.setStrike().run() : chain.unsetStrike().run();
|
|
673
|
+
break;
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
refreshState(editor) {
|
|
677
|
+
const textColor = editor.getAttributes('textStyle')['color'];
|
|
678
|
+
const fontSizeCss = editor.getAttributes('textStyle')['fontSize'];
|
|
679
|
+
const highlightColor = editor.getAttributes('highlight')['color'];
|
|
680
|
+
const linkHref = editor.getAttributes('link')['href'];
|
|
681
|
+
const dir = (editor.getAttributes('paragraph')['dir'] || editor.getAttributes('heading')['dir']);
|
|
682
|
+
let headingLevel = null;
|
|
683
|
+
for (let level = 1; level <= 6; level++) {
|
|
684
|
+
if (editor.isActive('heading', { level })) {
|
|
685
|
+
headingLevel = level;
|
|
686
|
+
break;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
let textAlign = null;
|
|
690
|
+
for (const align of ['left', 'center', 'right', 'justify']) {
|
|
691
|
+
if (editor.isActive({ textAlign: align })) {
|
|
692
|
+
textAlign = align;
|
|
693
|
+
break;
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
let fontSize = null;
|
|
697
|
+
if (fontSizeCss) {
|
|
698
|
+
for (const [token, css] of Object.entries(AX_WYSIWYG_FONT_SIZE_VALUES)) {
|
|
699
|
+
if (fontSizeCss === css) {
|
|
700
|
+
fontSize = token;
|
|
701
|
+
break;
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
this.state.set({
|
|
706
|
+
bold: editor.isActive('bold'),
|
|
707
|
+
italic: editor.isActive('italic'),
|
|
708
|
+
underline: editor.isActive('underline'),
|
|
709
|
+
strike: editor.isActive('strike'),
|
|
710
|
+
code: editor.isActive('code'),
|
|
711
|
+
codeBlock: editor.isActive('codeBlock'),
|
|
712
|
+
headingLevel,
|
|
713
|
+
bulletList: editor.isActive('bulletList'),
|
|
714
|
+
orderedList: editor.isActive('orderedList'),
|
|
715
|
+
blockquote: editor.isActive('blockquote'),
|
|
716
|
+
textAlign,
|
|
717
|
+
textColor: textColor ?? null,
|
|
718
|
+
highlightColor: highlightColor ?? null,
|
|
719
|
+
linkHref: linkHref ?? null,
|
|
720
|
+
fontSize,
|
|
721
|
+
textDirection: dir ?? null,
|
|
722
|
+
canUndo: editor.can().undo(),
|
|
723
|
+
canRedo: editor.can().redo(),
|
|
724
|
+
isEmpty: editor.isEmpty,
|
|
725
|
+
isFocused: editor.isFocused,
|
|
726
|
+
});
|
|
80
727
|
}
|
|
728
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXWysiwyg, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
729
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXWysiwyg }); }
|
|
81
730
|
}
|
|
731
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.6", ngImport: i0, type: AXWysiwyg, decorators: [{
|
|
732
|
+
type: Injectable
|
|
733
|
+
}] });
|
|
82
734
|
|
|
83
735
|
/**
|
|
84
736
|
* Generated bundle index. Do not edit.
|
|
85
737
|
*/
|
|
86
738
|
|
|
87
|
-
export { AXWysiwyg };
|
|
739
|
+
export { AXWysiwyg, AX_DEFAULT_WYSIWYG_FEATURES, AX_EMPTY_WYSIWYG_STATE, loadAXWysiwygExtensions };
|
|
88
740
|
//# sourceMappingURL=acorex-cdk-wysiwyg.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-cdk-wysiwyg.mjs","sources":["../../../../packages/cdk/wysiwyg/src/wysiwyg.class.ts","../../../../packages/cdk/wysiwyg/src/acorex-cdk-wysiwyg.ts"],"sourcesContent":["import { isPlatformBrowser } from '@angular/common';\nimport { inject, PLATFORM_ID, signal } from '@angular/core';\nimport type Quill from 'quill/quill.d.ts';\nimport type { QuillOptions, Range } from 'quill/quill.d.ts';\n\nexport type Wysiwyg = Quill;\nexport type WysiwygOptions = QuillOptions;\n\nexport class AXWysiwyg {\n quillObj = signal<Wysiwyg | null>(null);\n\n private platformId = inject(PLATFORM_ID);\n\n async init(container: HTMLElement | string, option?: WysiwygOptions) {\n if (!isPlatformBrowser(this.platformId)) return;\n await import('quill').then((e) => {\n const wysiwygObject = new e.default(container, option);\n this.quillObj.set(wysiwygObject);\n });\n }\n\n bold(value: boolean) {\n this.quillObj().format('bold', value);\n }\n\n italic(value: boolean) {\n this.quillObj().format('italic', value);\n }\n\n underLine(value: boolean) {\n this.quillObj().format('underline', value);\n }\n\n strike(value: boolean) {\n this.quillObj().format('strike', value);\n }\n\n color(value: string) {\n this.quillObj().format('color', value);\n }\n\n header(value: number) {\n this.quillObj().format('header', value);\n }\n\n list(value: 'ordered' | 'bullet' | '') {\n this.quillObj().format('list', value);\n }\n\n align(value: 'center' | 'right' | 'left' | 'justify') {\n if (value === 'left') {\n this.quillObj().format('align', '');\n } else {\n this.quillObj().format('align', value);\n }\n }\n\n direction(value: 'rtl' | 'ltr') {\n this.quillObj().format('direction', value);\n }\n\n fontSize(value: 'small' | false | 'large' | 'huge', range: Range) {\n this.quillObj().formatText(range.index, range.length, 'size', value);\n }\n\n get HTMLoutput() {\n return this.quillObj().root.innerHTML;\n }\n\n undo() {\n this.quillObj().history.undo();\n }\n\n redo() {\n this.quillObj().history.redo();\n }\n\n background(value: string) {\n this.quillObj().format('background', value);\n }\n\n addImage(value: string) {\n const range = this.quillObj().getSelection();\n const currentIndex = range?.index;\n this.quillObj().insertEmbed(currentIndex, 'image', value);\n }\n\n focus() {\n this.quillObj().focus();\n }\n\n blur() {\n this.quillObj().blur();\n }\n\n codeBlock(range: Range, status: boolean) {\n if (!range) return;\n this.quillObj().formatLine(range.index, range.length, 'code-block', status);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAQa,SAAS,CAAA;AAAtB,IAAA,WAAA,GAAA;QACE,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAiB,IAAI;qFAAC;AAE/B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC;IAwF1C;AAtFE,IAAA,MAAM,IAAI,CAAC,SAA+B,EAAE,MAAuB,EAAA;AACjE,QAAA,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,UAAU,CAAC;YAAE;QACzC,MAAM,OAAO,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAI;YAC/B,MAAM,aAAa,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC;AACtD,YAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC;AAClC,QAAA,CAAC,CAAC;IACJ;AAEA,IAAA,IAAI,CAAC,KAAc,EAAA;QACjB,IAAI,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;IACvC;AAEA,IAAA,MAAM,CAAC,KAAc,EAAA;QACnB,IAAI,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC;IACzC;AAEA,IAAA,SAAS,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AAI,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE;IAChC;IAEA,IAAI,GAAA;QACF,IAAI,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE;IAChC;AAEA,IAAA,UAAU,CAAC,KAAa,EAAA;QACtB,IAAI,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,YAAY,EAAE,KAAK,CAAC;IAC7C;AAEA,IAAA,QAAQ,CAAC,KAAa,EAAA;QACpB,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,YAAY,EAAE;AAC5C,QAAA,MAAM,YAAY,GAAG,KAAK,EAAE,KAAK;AACjC,QAAA,IAAI,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC,YAAY,EAAE,OAAO,EAAE,KAAK,CAAC;IAC3D;IAEA,KAAK,GAAA;AACH,QAAA,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE;IACzB;IAEA,IAAI,GAAA;AACF,QAAA,IAAI,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE;IACxB;IAEA,SAAS,CAAC,KAAY,EAAE,MAAe,EAAA;AACrC,QAAA,IAAI,CAAC,KAAK;YAAE;AACZ,QAAA,IAAI,CAAC,QAAQ,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,CAAC;IAC7E;AACD;;ACnGD;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"acorex-cdk-wysiwyg.mjs","sources":["../../../../packages/cdk/wysiwyg/src/lib/wysiwyg-font-size.extension.ts","../../../../packages/cdk/wysiwyg/src/lib/wysiwyg.types.ts","../../../../packages/cdk/wysiwyg/src/lib/wysiwyg-text-direction.extension.ts","../../../../packages/cdk/wysiwyg/src/lib/wysiwyg-video.extension.ts","../../../../packages/cdk/wysiwyg/src/lib/wysiwyg.extensions.ts","../../../../packages/cdk/wysiwyg/src/lib/wysiwyg.class.ts","../../../../packages/cdk/wysiwyg/src/acorex-cdk-wysiwyg.ts"],"sourcesContent":["import { Extension } from '@tiptap/core';\nimport type { AXWysiwygFontSizeToken } from './wysiwyg.types';\n\nexport const AX_WYSIWYG_FONT_SIZE_VALUES: Record<AXWysiwygFontSizeToken, string> = {\n small: '0.75em',\n large: '1.5em',\n huge: '2.5em',\n};\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n axWysiwygFontSize: {\n setAxWysiwygFontSize: (size: AXWysiwygFontSizeToken | null) => ReturnType;\n };\n }\n}\n\nexport const AXWysiwygFontSizeExtension = Extension.create({\n name: 'axWysiwygFontSize',\n\n addGlobalAttributes() {\n return [\n {\n types: ['textStyle'],\n attributes: {\n fontSize: {\n default: null,\n parseHTML: (element) => element.style.fontSize?.replace(/['\"]+/g, '') || null,\n renderHTML: (attributes) => {\n if (!attributes['fontSize']) {\n return {};\n }\n return { style: `font-size: ${attributes['fontSize']}` };\n },\n },\n },\n },\n ];\n },\n\n addCommands() {\n return {\n setAxWysiwygFontSize:\n (size: AXWysiwygFontSizeToken | null) =>\n ({ chain }) => {\n if (!size) {\n return chain().focus().unsetMark('textStyle').run();\n }\n const cssSize = AX_WYSIWYG_FONT_SIZE_VALUES[size];\n return chain().focus().setMark('textStyle', { fontSize: cssSize }).run();\n },\n };\n },\n});\n","import type { Editor, Extensions } from '@tiptap/core';\n\nexport type AXWysiwygEditor = Editor;\n\nexport type AXWysiwygHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\nexport type AXWysiwygTextAlign = 'left' | 'center' | 'right' | 'justify';\n\nexport type AXWysiwygFontSizeToken = 'small' | 'large' | 'huge';\n\nexport type AXWysiwygTextDirection = 'rtl' | 'ltr';\n\nexport interface AXWysiwygRange {\n index: number;\n length: number;\n}\n\nexport type AXWysiwygCommand =\n | 'bold'\n | 'italic'\n | 'underline'\n | 'strike'\n | 'code'\n | 'codeBlock'\n | 'heading'\n | 'paragraph'\n | 'bulletList'\n | 'orderedList'\n | 'blockquote'\n | 'textAlign'\n | 'color'\n | 'highlight'\n | 'link'\n | 'image'\n | 'video'\n | 'undo'\n | 'redo'\n | 'clearFormatting'\n | 'direction'\n | 'fontSize';\n\nexport interface AXWysiwygFeatures {\n textAlign?: boolean;\n image?: boolean;\n link?: boolean;\n video?: boolean;\n color?: boolean;\n highlight?: boolean;\n placeholder?: boolean;\n fontSize?: boolean;\n textDirection?: boolean;\n}\n\nexport const AX_DEFAULT_WYSIWYG_FEATURES: AXWysiwygFeatures = {\n textAlign: true,\n image: true,\n link: true,\n video: true,\n color: true,\n highlight: true,\n placeholder: true,\n fontSize: true,\n textDirection: true,\n};\n\nexport interface AXWysiwygState {\n bold: boolean;\n italic: boolean;\n underline: boolean;\n strike: boolean;\n code: boolean;\n codeBlock: boolean;\n headingLevel: AXWysiwygHeadingLevel | null;\n bulletList: boolean;\n orderedList: boolean;\n blockquote: boolean;\n textAlign: AXWysiwygTextAlign | null;\n textColor: string | null;\n highlightColor: string | null;\n linkHref: string | null;\n fontSize: AXWysiwygFontSizeToken | null;\n textDirection: AXWysiwygTextDirection | null;\n canUndo: boolean;\n canRedo: boolean;\n isEmpty: boolean;\n isFocused: boolean;\n}\n\nexport const AX_EMPTY_WYSIWYG_STATE: AXWysiwygState = {\n bold: false,\n italic: false,\n underline: false,\n strike: false,\n code: false,\n codeBlock: false,\n headingLevel: null,\n bulletList: false,\n orderedList: false,\n blockquote: false,\n textAlign: null,\n textColor: null,\n highlightColor: null,\n linkHref: null,\n fontSize: null,\n textDirection: null,\n canUndo: false,\n canRedo: false,\n isEmpty: true,\n isFocused: false,\n};\n\nexport interface AXWysiwygInitOptions {\n content?: string;\n editable?: boolean;\n placeholder?: string;\n features?: AXWysiwygFeatures;\n extensions?: Extensions;\n /** @deprecated Use `editable: false` instead. */\n readOnly?: boolean;\n onUpdate?: (editor: AXWysiwygEditor) => void;\n onFocus?: (editor: AXWysiwygEditor) => void;\n onBlur?: (editor: AXWysiwygEditor) => void;\n onSelectionUpdate?: (editor: AXWysiwygEditor) => void;\n}\n\nexport interface AXWysiwygLoadExtensionsOptions {\n features?: AXWysiwygFeatures;\n placeholder?: string;\n}\n","import { Extension } from '@tiptap/core';\nimport type { AXWysiwygTextDirection } from './wysiwyg.types';\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n axWysiwygTextDirection: {\n setAxWysiwygTextDirection: (direction: AXWysiwygTextDirection | null) => ReturnType;\n };\n }\n}\n\nexport const AXWysiwygTextDirectionExtension = Extension.create({\n name: 'axWysiwygTextDirection',\n\n addGlobalAttributes() {\n return [\n {\n types: ['paragraph', 'heading'],\n attributes: {\n dir: {\n default: null,\n parseHTML: (element) => element.getAttribute('dir'),\n renderHTML: (attributes) => {\n if (!attributes['dir']) {\n return {};\n }\n return { dir: attributes['dir'] };\n },\n },\n },\n },\n ];\n },\n\n addCommands() {\n return {\n setAxWysiwygTextDirection:\n (direction: AXWysiwygTextDirection | null) =>\n ({ chain }) =>\n chain()\n .focus()\n .updateAttributes('paragraph', { dir: direction })\n .updateAttributes('heading', { dir: direction })\n .run(),\n };\n },\n});\n","import { mergeAttributes, Node } from '@tiptap/core';\n\nexport interface AXWysiwygVideoOptions {\n inline: boolean;\n allowBase64: boolean;\n HTMLAttributes: Record<string, unknown>;\n}\n\ndeclare module '@tiptap/core' {\n interface Commands<ReturnType> {\n axWysiwygVideo: {\n setVideo: (options: { src: string }) => ReturnType;\n };\n }\n}\n\nfunction toEmbedSrc(src: string): string {\n const trimmed = src.trim();\n if (!trimmed) {\n return trimmed;\n }\n try {\n const url = new URL(trimmed);\n if (url.hostname.includes('youtube.com') && url.searchParams.get('v')) {\n return `https://www.youtube.com/embed/${url.searchParams.get('v')}`;\n }\n if (url.hostname === 'youtu.be') {\n return `https://www.youtube.com/embed/${url.pathname.slice(1)}`;\n }\n } catch {\n return trimmed;\n }\n return trimmed;\n}\n\nexport const AXWysiwygVideoExtension = Node.create<AXWysiwygVideoOptions>({\n name: 'video',\n\n group: 'block',\n\n atom: true,\n\n addOptions() {\n return {\n inline: false,\n allowBase64: false,\n HTMLAttributes: {},\n };\n },\n\n addAttributes() {\n return {\n src: {\n default: null,\n },\n };\n },\n\n parseHTML() {\n return [\n {\n tag: 'div[data-wysiwyg-video] iframe',\n },\n {\n tag: 'iframe[src]',\n },\n ];\n },\n\n renderHTML({ HTMLAttributes }) {\n const src = HTMLAttributes['src'] as string | undefined;\n return [\n 'div',\n mergeAttributes(this.options.HTMLAttributes, { 'data-wysiwyg-video': '' }),\n [\n 'iframe',\n mergeAttributes({\n src,\n frameborder: '0',\n allowfullscreen: 'true',\n allow: 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture',\n }),\n ],\n ];\n },\n\n addCommands() {\n return {\n setVideo:\n ({ src }) =>\n ({ commands }) =>\n commands.insertContent({\n type: this.name,\n attrs: { src: toEmbedSrc(src) },\n }),\n };\n },\n});\n","import type { Extensions } from '@tiptap/core';\nimport {\n AX_DEFAULT_WYSIWYG_FEATURES,\n type AXWysiwygFeatures,\n type AXWysiwygLoadExtensionsOptions,\n} from './wysiwyg.types';\nimport { AXWysiwygFontSizeExtension } from './wysiwyg-font-size.extension';\nimport { AXWysiwygTextDirectionExtension } from './wysiwyg-text-direction.extension';\nimport { AXWysiwygVideoExtension } from './wysiwyg-video.extension';\n\nexport async function loadAXWysiwygExtensions(options?: AXWysiwygLoadExtensionsOptions): Promise<Extensions> {\n const features: AXWysiwygFeatures = { ...AX_DEFAULT_WYSIWYG_FEATURES, ...options?.features };\n\n const [starterKitMod, textStyleMod, colorMod, highlightMod, underlineMod] = await Promise.all([\n import('@tiptap/starter-kit'),\n import('@tiptap/extension-text-style'),\n import('@tiptap/extension-color'),\n import('@tiptap/extension-highlight'),\n import('@tiptap/extension-underline'),\n ]);\n\n const extensions: Extensions = [\n starterKitMod.default.configure({\n link: features.link ? { openOnClick: false } : false,\n }),\n underlineMod.default,\n ];\n\n if (features.color || features.fontSize) {\n extensions.push(textStyleMod.TextStyle);\n }\n\n if (features.color) {\n extensions.push(colorMod.Color);\n }\n\n if (features.highlight) {\n extensions.push(highlightMod.default.configure({ multicolor: true }));\n }\n\n if (features.fontSize) {\n extensions.push(AXWysiwygFontSizeExtension);\n }\n\n if (features.textDirection) {\n extensions.push(AXWysiwygTextDirectionExtension);\n }\n\n if (features.textAlign) {\n const textAlignMod = await import('@tiptap/extension-text-align');\n extensions.push(\n textAlignMod.default.configure({\n types: ['heading', 'paragraph'],\n }),\n );\n }\n\n if (features.image) {\n const imageMod = await import('@tiptap/extension-image');\n extensions.push(\n imageMod.default.configure({\n inline: true,\n allowBase64: true,\n }),\n );\n }\n\n if (features.video) {\n extensions.push(AXWysiwygVideoExtension);\n }\n\n if (features.placeholder && options?.placeholder) {\n const { Placeholder } = await import('@tiptap/extensions');\n extensions.push(\n Placeholder.configure({\n placeholder: options.placeholder,\n }),\n );\n }\n\n return extensions;\n}\n","import { isPlatformBrowser } from '@angular/common';\nimport { inject, Injectable, PLATFORM_ID, signal } from '@angular/core';\nimport type { Editor } from '@tiptap/core';\nimport { AX_WYSIWYG_FONT_SIZE_VALUES } from './wysiwyg-font-size.extension';\nimport { loadAXWysiwygExtensions } from './wysiwyg.extensions';\nimport {\n AX_EMPTY_WYSIWYG_STATE,\n type AXWysiwygCommand,\n type AXWysiwygEditor,\n type AXWysiwygFontSizeToken,\n type AXWysiwygHeadingLevel,\n type AXWysiwygInitOptions,\n type AXWysiwygRange,\n type AXWysiwygState,\n type AXWysiwygTextAlign,\n type AXWysiwygTextDirection,\n} from './wysiwyg.types';\n\n@Injectable()\nexport class AXWysiwyg {\n readonly editor = signal<AXWysiwygEditor | null>(null);\n readonly state = signal<AXWysiwygState>(AX_EMPTY_WYSIWYG_STATE);\n readonly ready = signal(false);\n\n private readonly platformId = inject(PLATFORM_ID);\n private destroyed = false;\n private applyingContent = false;\n\n async init(container: HTMLElement | string, options: AXWysiwygInitOptions = {}): Promise<void> {\n if (!isPlatformBrowser(this.platformId)) {\n return;\n }\n\n const element =\n typeof container === 'string' ? (document.querySelector(container) as HTMLElement | null) : container;\n if (!element) {\n return;\n }\n\n this.destroyed = false;\n const editable = options.readOnly === true ? false : (options.editable ?? true);\n\n const extensions = await loadAXWysiwygExtensions({\n features: options.features,\n placeholder: options.placeholder,\n });\n\n if (this.destroyed) {\n return;\n }\n\n const { Editor } = await import('@tiptap/core');\n if (this.destroyed) {\n return;\n }\n\n const allExtensions = [...extensions, ...(options.extensions ?? [])];\n\n const editor = new Editor({\n element,\n extensions: allExtensions,\n content: options.content ?? '',\n editable,\n editorProps: {\n attributes: {\n class: 'tiptap',\n },\n },\n onUpdate: ({ editor: ed }) => {\n this.refreshState(ed);\n if (!this.applyingContent) {\n options.onUpdate?.(ed);\n }\n },\n onSelectionUpdate: ({ editor: ed }) => {\n this.refreshState(ed);\n options.onSelectionUpdate?.(ed);\n },\n onFocus: ({ editor: ed }) => {\n this.refreshState(ed);\n options.onFocus?.(ed);\n },\n onBlur: ({ editor: ed }) => {\n this.refreshState(ed);\n options.onBlur?.(ed);\n },\n });\n\n this.editor.set(editor);\n this.ready.set(true);\n this.refreshState(editor);\n }\n\n destroy(): void {\n this.destroyed = true;\n const ed = this.editor();\n ed?.destroy();\n this.editor.set(null);\n this.ready.set(false);\n this.state.set(AX_EMPTY_WYSIWYG_STATE);\n }\n\n setContent(value: string | null | undefined, emit = false): void {\n const ed = this.editor();\n if (!ed) {\n return;\n }\n\n const html = value?.trim() ? value : '';\n this.applyingContent = true;\n try {\n ed.commands.setContent(html, { emitUpdate: emit });\n this.refreshState(ed);\n } finally {\n this.applyingContent = false;\n }\n }\n\n getHTML(): string {\n return this.editor()?.getHTML() ?? '';\n }\n\n get JSONoutput(): unknown {\n return this.editor()?.getJSON() ?? null;\n }\n\n getText(): string {\n return this.editor()?.getText() ?? '';\n }\n\n isEmpty(): boolean {\n return this.editor()?.isEmpty ?? true;\n }\n\n setEditable(editable: boolean): void {\n this.editor()?.setEditable(editable);\n const ed = this.editor();\n if (ed) {\n this.refreshState(ed);\n }\n }\n\n get HTMLoutput(): string {\n return this.getHTML();\n }\n\n bold(value: boolean): void {\n this.setMarkActive('bold', value);\n }\n\n italic(value: boolean): void {\n this.setMarkActive('italic', value);\n }\n\n underLine(value: boolean): void {\n this.setMarkActive('underline', value);\n }\n\n strike(value: boolean): void {\n this.setMarkActive('strike', value);\n }\n\n color(value: string): void {\n if (value) {\n this.setColor(value);\n } else {\n this.unsetColor();\n }\n }\n\n header(value: number): void {\n const ed = this.editor();\n if (!ed) {\n return;\n }\n if (value >= 1 && value <= 6) {\n ed.chain()\n .focus()\n .toggleHeading({ level: value as AXWysiwygHeadingLevel })\n .run();\n } else {\n ed.chain().focus().setParagraph().run();\n }\n }\n\n list(value: 'ordered' | 'bullet' | ''): void {\n const ed = this.editor();\n if (!ed) {\n return;\n }\n const chain = ed.chain().focus();\n if (value === 'bullet') {\n chain.toggleBulletList().run();\n } else if (value === 'ordered') {\n chain.toggleOrderedList().run();\n } else {\n chain.liftListItem('listItem').run();\n }\n }\n\n align(value: 'center' | 'right' | 'left' | 'justify'): void {\n if (value === 'left') {\n this.setTextAlign('left');\n } else {\n this.setTextAlign(value);\n }\n }\n\n direction(value: AXWysiwygTextDirection): void {\n this.setTextDirection(value);\n }\n\n fontSize(value: 'small' | false | 'large' | 'huge', range: AXWysiwygRange): void {\n const ed = this.editor();\n if (!ed || !range) {\n return;\n }\n const from = range.index;\n const to = range.index + range.length;\n if (value === false) {\n ed.chain().focus().setTextSelection({ from, to }).setAxWysiwygFontSize(null).run();\n return;\n }\n ed.chain().focus().setTextSelection({ from, to }).setAxWysiwygFontSize(value).run();\n }\n\n background(value: string): void {\n if (value) {\n this.setHighlight(value);\n } else {\n this.unsetHighlight();\n }\n }\n\n addImage(value: string): void {\n this.insertImage(value);\n }\n\n insertVideo(src: string): void {\n this.editor()?.chain().focus().setVideo({ src }).run();\n }\n\n codeBlock(range: AXWysiwygRange, status: boolean): void {\n const ed = this.editor();\n if (!ed || !range) {\n return;\n }\n const from = range.index;\n const to = range.index + range.length;\n if (status) {\n ed.chain().focus().setTextSelection({ from, to }).toggleCodeBlock().run();\n } else {\n ed.chain().focus().setTextSelection({ from, to }).setParagraph().run();\n }\n }\n\n focus(): void {\n this.editor()?.commands.focus();\n }\n\n blur(): void {\n this.editor()?.commands.blur();\n }\n\n toggleBold(): void {\n this.editor()?.chain().focus().toggleBold().run();\n }\n\n toggleItalic(): void {\n this.editor()?.chain().focus().toggleItalic().run();\n }\n\n toggleUnderline(): void {\n this.editor()?.chain().focus().toggleUnderline().run();\n }\n\n toggleStrike(): void {\n this.editor()?.chain().focus().toggleStrike().run();\n }\n\n toggleCode(): void {\n this.editor()?.chain().focus().toggleCode().run();\n }\n\n toggleCodeBlock(): void {\n this.editor()?.chain().focus().toggleCodeBlock().run();\n }\n\n toggleHeading(level: AXWysiwygHeadingLevel): void {\n this.editor()?.chain().focus().toggleHeading({ level }).run();\n }\n\n setParagraph(): void {\n this.editor()?.chain().focus().setParagraph().run();\n }\n\n toggleBulletList(): void {\n this.editor()?.chain().focus().toggleBulletList().run();\n }\n\n toggleOrderedList(): void {\n this.editor()?.chain().focus().toggleOrderedList().run();\n }\n\n toggleBlockquote(): void {\n this.editor()?.chain().focus().toggleBlockquote().run();\n }\n\n setTextAlign(align: AXWysiwygTextAlign): void {\n this.editor()?.chain().focus().setTextAlign(align).run();\n }\n\n setTextDirection(direction: AXWysiwygTextDirection | null): void {\n this.editor()?.chain().focus().setAxWysiwygTextDirection(direction).run();\n }\n\n setFontSize(size: AXWysiwygFontSizeToken | null): void {\n this.editor()?.chain().focus().setAxWysiwygFontSize(size).run();\n }\n\n setColor(color: string): void {\n this.editor()?.chain().focus().setColor(color).run();\n }\n\n unsetColor(): void {\n this.editor()?.chain().focus().unsetColor().run();\n }\n\n setHighlight(color: string): void {\n this.editor()?.chain().focus().setHighlight({ color }).run();\n }\n\n unsetHighlight(): void {\n this.editor()?.chain().focus().unsetHighlight().run();\n }\n\n setLink(href: string): void {\n this.editor()?.chain().focus().extendMarkRange('link').setLink({ href }).run();\n }\n\n unsetLink(): void {\n this.editor()?.chain().focus().unsetLink().run();\n }\n\n insertImage(src: string, alt?: string): void {\n this.editor()?.chain().focus().setImage({ src, alt }).run();\n }\n\n undo(): void {\n const ed = this.editor();\n if (!ed) {\n return;\n }\n ed.chain().focus().undo().run();\n this.refreshState(ed);\n }\n\n redo(): void {\n const ed = this.editor();\n if (!ed) {\n return;\n }\n ed.chain().focus().redo().run();\n this.refreshState(ed);\n }\n\n clearFormatting(): void {\n this.editor()?.chain().focus().clearNodes().unsetAllMarks().run();\n }\n\n execute(command: AXWysiwygCommand, payload?: unknown): void {\n switch (command) {\n case 'bold':\n this.toggleBold();\n break;\n case 'italic':\n this.toggleItalic();\n break;\n case 'underline':\n this.toggleUnderline();\n break;\n case 'strike':\n this.toggleStrike();\n break;\n case 'code':\n this.toggleCode();\n break;\n case 'codeBlock':\n this.toggleCodeBlock();\n break;\n case 'heading':\n if (typeof payload === 'number') {\n this.toggleHeading(payload as AXWysiwygHeadingLevel);\n }\n break;\n case 'paragraph':\n this.setParagraph();\n break;\n case 'bulletList':\n this.toggleBulletList();\n break;\n case 'orderedList':\n this.toggleOrderedList();\n break;\n case 'blockquote':\n this.toggleBlockquote();\n break;\n case 'textAlign':\n if (typeof payload === 'string') {\n this.setTextAlign(payload as AXWysiwygTextAlign);\n }\n break;\n case 'direction':\n if (payload === 'rtl' || payload === 'ltr') {\n this.setTextDirection(payload);\n }\n break;\n case 'fontSize':\n if (payload === null) {\n this.setFontSize(null);\n } else if (payload === 'small' || payload === 'large' || payload === 'huge') {\n this.setFontSize(payload);\n }\n break;\n case 'color':\n if (typeof payload === 'string') {\n this.setColor(payload);\n } else {\n this.unsetColor();\n }\n break;\n case 'highlight':\n if (typeof payload === 'string') {\n this.setHighlight(payload);\n } else {\n this.unsetHighlight();\n }\n break;\n case 'link':\n if (typeof payload === 'string' && payload) {\n this.setLink(payload);\n } else {\n this.unsetLink();\n }\n break;\n case 'image':\n if (typeof payload === 'string') {\n this.insertImage(payload);\n }\n break;\n case 'video':\n if (typeof payload === 'string') {\n this.insertVideo(payload);\n }\n break;\n case 'undo':\n this.undo();\n break;\n case 'redo':\n this.redo();\n break;\n case 'clearFormatting':\n this.clearFormatting();\n break;\n }\n }\n\n isActive(name: string, attrs?: Record<string, unknown>): boolean {\n return this.editor()?.isActive(name, attrs) ?? false;\n }\n\n can(command: 'undo' | 'redo'): boolean {\n const ed = this.editor();\n if (!ed) {\n return false;\n }\n if (command === 'undo') {\n return ed.can().undo();\n }\n return ed.can().redo();\n }\n\n private setMarkActive(name: 'bold' | 'italic' | 'underline' | 'strike', active: boolean): void {\n const ed = this.editor();\n if (!ed) {\n return;\n }\n const chain = ed.chain().focus();\n switch (name) {\n case 'bold':\n active ? chain.setBold().run() : chain.unsetBold().run();\n break;\n case 'italic':\n active ? chain.setItalic().run() : chain.unsetItalic().run();\n break;\n case 'underline':\n active ? chain.setUnderline().run() : chain.unsetUnderline().run();\n break;\n case 'strike':\n active ? chain.setStrike().run() : chain.unsetStrike().run();\n break;\n }\n }\n\n private refreshState(editor: Editor): void {\n const textColor = editor.getAttributes('textStyle')['color'] as string | undefined;\n const fontSizeCss = editor.getAttributes('textStyle')['fontSize'] as string | undefined;\n const highlightColor = editor.getAttributes('highlight')['color'] as string | undefined;\n const linkHref = editor.getAttributes('link')['href'] as string | undefined;\n const dir = (editor.getAttributes('paragraph')['dir'] || editor.getAttributes('heading')['dir']) as\n | AXWysiwygTextDirection\n | undefined;\n\n let headingLevel: AXWysiwygHeadingLevel | null = null;\n for (let level = 1; level <= 6; level++) {\n if (editor.isActive('heading', { level })) {\n headingLevel = level as AXWysiwygHeadingLevel;\n break;\n }\n }\n\n let textAlign: AXWysiwygTextAlign | null = null;\n for (const align of ['left', 'center', 'right', 'justify'] as AXWysiwygTextAlign[]) {\n if (editor.isActive({ textAlign: align })) {\n textAlign = align;\n break;\n }\n }\n\n let fontSize: AXWysiwygFontSizeToken | null = null;\n if (fontSizeCss) {\n for (const [token, css] of Object.entries(AX_WYSIWYG_FONT_SIZE_VALUES) as [AXWysiwygFontSizeToken, string][]) {\n if (fontSizeCss === css) {\n fontSize = token;\n break;\n }\n }\n }\n\n this.state.set({\n bold: editor.isActive('bold'),\n italic: editor.isActive('italic'),\n underline: editor.isActive('underline'),\n strike: editor.isActive('strike'),\n code: editor.isActive('code'),\n codeBlock: editor.isActive('codeBlock'),\n headingLevel,\n bulletList: editor.isActive('bulletList'),\n orderedList: editor.isActive('orderedList'),\n blockquote: editor.isActive('blockquote'),\n textAlign,\n textColor: textColor ?? null,\n highlightColor: highlightColor ?? null,\n linkHref: linkHref ?? null,\n fontSize,\n textDirection: dir ?? null,\n canUndo: editor.can().undo(),\n canRedo: editor.can().redo(),\n isEmpty: editor.isEmpty,\n isFocused: editor.isFocused,\n });\n }\n}\n\nexport type { AXWysiwygRange };\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAGO,MAAM,2BAA2B,GAA2C;AACjF,IAAA,KAAK,EAAE,QAAQ;AACf,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,IAAI,EAAE,OAAO;CACd;AAUM,MAAM,0BAA0B,GAAG,SAAS,CAAC,MAAM,CAAC;AACzD,IAAA,IAAI,EAAE,mBAAmB;IAEzB,mBAAmB,GAAA;QACjB,OAAO;AACL,YAAA;gBACE,KAAK,EAAE,CAAC,WAAW,CAAC;AACpB,gBAAA,UAAU,EAAE;AACV,oBAAA,QAAQ,EAAE;AACR,wBAAA,OAAO,EAAE,IAAI;AACb,wBAAA,SAAS,EAAE,CAAC,OAAO,KAAK,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,IAAI;AAC7E,wBAAA,UAAU,EAAE,CAAC,UAAU,KAAI;AACzB,4BAAA,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE;AAC3B,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S,IAAI,IAAI;YAC5B,cAAc,EAAE,cAAc,IAAI,IAAI;YACtC,QAAQ,EAAE,QAAQ,IAAI,IAAI;YAC1B,QAAQ;YACR,aAAa,EAAE,GAAG,IAAI,IAAI;AAC1B,YAAA,OAAO,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE;AAC5B,YAAA,OAAO,EAAE,MAAM,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE;YAC5B,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,SAAS,EAAE,MAAM,CAAC,SAAS;AAC5B,SAAA,CAAC;IACJ;8GA9hBW,SAAS,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;kHAAT,SAAS,EAAA,CAAA,CAAA;;2FAAT,SAAS,EAAA,UAAA,EAAA,CAAA;kBADrB;;;AClBD;;AAEG;;"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@acorex/cdk",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.4.1",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@acorex/core": "22.
|
|
6
|
-
"
|
|
5
|
+
"@acorex/core": "22.4.1",
|
|
6
|
+
"@tiptap/core": ">=3.31.4",
|
|
7
|
+
"@tiptap/extension-color": ">=3.31.4",
|
|
8
|
+
"@tiptap/extension-highlight": ">=3.31.4",
|
|
9
|
+
"@tiptap/extension-image": ">=3.31.4",
|
|
10
|
+
"@tiptap/extension-text-align": ">=3.31.4",
|
|
11
|
+
"@tiptap/extension-text-style": ">=3.31.4",
|
|
12
|
+
"@tiptap/extension-underline": ">=3.31.4",
|
|
13
|
+
"@tiptap/extensions": ">=3.31.4",
|
|
14
|
+
"@tiptap/starter-kit": ">=3.31.4",
|
|
7
15
|
"qrcode": ">=1.5.4",
|
|
8
16
|
"swiper": ">=11.1.15",
|
|
9
17
|
"maska": ">=3.1.1",
|
|
@@ -1,12 +1,85 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import
|
|
2
|
+
import { Extensions, Editor } from '@tiptap/core';
|
|
3
|
+
|
|
4
|
+
type AXWysiwygEditor = Editor;
|
|
5
|
+
type AXWysiwygHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
6
|
+
type AXWysiwygTextAlign = 'left' | 'center' | 'right' | 'justify';
|
|
7
|
+
type AXWysiwygFontSizeToken = 'small' | 'large' | 'huge';
|
|
8
|
+
type AXWysiwygTextDirection = 'rtl' | 'ltr';
|
|
9
|
+
interface AXWysiwygRange {
|
|
10
|
+
index: number;
|
|
11
|
+
length: number;
|
|
12
|
+
}
|
|
13
|
+
type AXWysiwygCommand = 'bold' | 'italic' | 'underline' | 'strike' | 'code' | 'codeBlock' | 'heading' | 'paragraph' | 'bulletList' | 'orderedList' | 'blockquote' | 'textAlign' | 'color' | 'highlight' | 'link' | 'image' | 'video' | 'undo' | 'redo' | 'clearFormatting' | 'direction' | 'fontSize';
|
|
14
|
+
interface AXWysiwygFeatures {
|
|
15
|
+
textAlign?: boolean;
|
|
16
|
+
image?: boolean;
|
|
17
|
+
link?: boolean;
|
|
18
|
+
video?: boolean;
|
|
19
|
+
color?: boolean;
|
|
20
|
+
highlight?: boolean;
|
|
21
|
+
placeholder?: boolean;
|
|
22
|
+
fontSize?: boolean;
|
|
23
|
+
textDirection?: boolean;
|
|
24
|
+
}
|
|
25
|
+
declare const AX_DEFAULT_WYSIWYG_FEATURES: AXWysiwygFeatures;
|
|
26
|
+
interface AXWysiwygState {
|
|
27
|
+
bold: boolean;
|
|
28
|
+
italic: boolean;
|
|
29
|
+
underline: boolean;
|
|
30
|
+
strike: boolean;
|
|
31
|
+
code: boolean;
|
|
32
|
+
codeBlock: boolean;
|
|
33
|
+
headingLevel: AXWysiwygHeadingLevel | null;
|
|
34
|
+
bulletList: boolean;
|
|
35
|
+
orderedList: boolean;
|
|
36
|
+
blockquote: boolean;
|
|
37
|
+
textAlign: AXWysiwygTextAlign | null;
|
|
38
|
+
textColor: string | null;
|
|
39
|
+
highlightColor: string | null;
|
|
40
|
+
linkHref: string | null;
|
|
41
|
+
fontSize: AXWysiwygFontSizeToken | null;
|
|
42
|
+
textDirection: AXWysiwygTextDirection | null;
|
|
43
|
+
canUndo: boolean;
|
|
44
|
+
canRedo: boolean;
|
|
45
|
+
isEmpty: boolean;
|
|
46
|
+
isFocused: boolean;
|
|
47
|
+
}
|
|
48
|
+
declare const AX_EMPTY_WYSIWYG_STATE: AXWysiwygState;
|
|
49
|
+
interface AXWysiwygInitOptions {
|
|
50
|
+
content?: string;
|
|
51
|
+
editable?: boolean;
|
|
52
|
+
placeholder?: string;
|
|
53
|
+
features?: AXWysiwygFeatures;
|
|
54
|
+
extensions?: Extensions;
|
|
55
|
+
/** @deprecated Use `editable: false` instead. */
|
|
56
|
+
readOnly?: boolean;
|
|
57
|
+
onUpdate?: (editor: AXWysiwygEditor) => void;
|
|
58
|
+
onFocus?: (editor: AXWysiwygEditor) => void;
|
|
59
|
+
onBlur?: (editor: AXWysiwygEditor) => void;
|
|
60
|
+
onSelectionUpdate?: (editor: AXWysiwygEditor) => void;
|
|
61
|
+
}
|
|
62
|
+
interface AXWysiwygLoadExtensionsOptions {
|
|
63
|
+
features?: AXWysiwygFeatures;
|
|
64
|
+
placeholder?: string;
|
|
65
|
+
}
|
|
3
66
|
|
|
4
|
-
type Wysiwyg = Quill;
|
|
5
|
-
type WysiwygOptions = QuillOptions;
|
|
6
67
|
declare class AXWysiwyg {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
68
|
+
readonly editor: _angular_core.WritableSignal<Editor>;
|
|
69
|
+
readonly state: _angular_core.WritableSignal<AXWysiwygState>;
|
|
70
|
+
readonly ready: _angular_core.WritableSignal<boolean>;
|
|
71
|
+
private readonly platformId;
|
|
72
|
+
private destroyed;
|
|
73
|
+
private applyingContent;
|
|
74
|
+
init(container: HTMLElement | string, options?: AXWysiwygInitOptions): Promise<void>;
|
|
75
|
+
destroy(): void;
|
|
76
|
+
setContent(value: string | null | undefined, emit?: boolean): void;
|
|
77
|
+
getHTML(): string;
|
|
78
|
+
get JSONoutput(): unknown;
|
|
79
|
+
getText(): string;
|
|
80
|
+
isEmpty(): boolean;
|
|
81
|
+
setEditable(editable: boolean): void;
|
|
82
|
+
get HTMLoutput(): string;
|
|
10
83
|
bold(value: boolean): void;
|
|
11
84
|
italic(value: boolean): void;
|
|
12
85
|
underLine(value: boolean): void;
|
|
@@ -15,17 +88,48 @@ declare class AXWysiwyg {
|
|
|
15
88
|
header(value: number): void;
|
|
16
89
|
list(value: 'ordered' | 'bullet' | ''): void;
|
|
17
90
|
align(value: 'center' | 'right' | 'left' | 'justify'): void;
|
|
18
|
-
direction(value:
|
|
19
|
-
fontSize(value: 'small' | false | 'large' | 'huge', range:
|
|
20
|
-
get HTMLoutput(): string;
|
|
21
|
-
undo(): void;
|
|
22
|
-
redo(): void;
|
|
91
|
+
direction(value: AXWysiwygTextDirection): void;
|
|
92
|
+
fontSize(value: 'small' | false | 'large' | 'huge', range: AXWysiwygRange): void;
|
|
23
93
|
background(value: string): void;
|
|
24
94
|
addImage(value: string): void;
|
|
95
|
+
insertVideo(src: string): void;
|
|
96
|
+
codeBlock(range: AXWysiwygRange, status: boolean): void;
|
|
25
97
|
focus(): void;
|
|
26
98
|
blur(): void;
|
|
27
|
-
|
|
99
|
+
toggleBold(): void;
|
|
100
|
+
toggleItalic(): void;
|
|
101
|
+
toggleUnderline(): void;
|
|
102
|
+
toggleStrike(): void;
|
|
103
|
+
toggleCode(): void;
|
|
104
|
+
toggleCodeBlock(): void;
|
|
105
|
+
toggleHeading(level: AXWysiwygHeadingLevel): void;
|
|
106
|
+
setParagraph(): void;
|
|
107
|
+
toggleBulletList(): void;
|
|
108
|
+
toggleOrderedList(): void;
|
|
109
|
+
toggleBlockquote(): void;
|
|
110
|
+
setTextAlign(align: AXWysiwygTextAlign): void;
|
|
111
|
+
setTextDirection(direction: AXWysiwygTextDirection | null): void;
|
|
112
|
+
setFontSize(size: AXWysiwygFontSizeToken | null): void;
|
|
113
|
+
setColor(color: string): void;
|
|
114
|
+
unsetColor(): void;
|
|
115
|
+
setHighlight(color: string): void;
|
|
116
|
+
unsetHighlight(): void;
|
|
117
|
+
setLink(href: string): void;
|
|
118
|
+
unsetLink(): void;
|
|
119
|
+
insertImage(src: string, alt?: string): void;
|
|
120
|
+
undo(): void;
|
|
121
|
+
redo(): void;
|
|
122
|
+
clearFormatting(): void;
|
|
123
|
+
execute(command: AXWysiwygCommand, payload?: unknown): void;
|
|
124
|
+
isActive(name: string, attrs?: Record<string, unknown>): boolean;
|
|
125
|
+
can(command: 'undo' | 'redo'): boolean;
|
|
126
|
+
private setMarkActive;
|
|
127
|
+
private refreshState;
|
|
128
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXWysiwyg, never>;
|
|
129
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<any>;
|
|
28
130
|
}
|
|
29
131
|
|
|
30
|
-
|
|
31
|
-
|
|
132
|
+
declare function loadAXWysiwygExtensions(options?: AXWysiwygLoadExtensionsOptions): Promise<Extensions>;
|
|
133
|
+
|
|
134
|
+
export { AXWysiwyg, AX_DEFAULT_WYSIWYG_FEATURES, AX_EMPTY_WYSIWYG_STATE, loadAXWysiwygExtensions };
|
|
135
|
+
export type { AXWysiwygCommand, AXWysiwygEditor, AXWysiwygFeatures, AXWysiwygFontSizeToken, AXWysiwygHeadingLevel, AXWysiwygInitOptions, AXWysiwygLoadExtensionsOptions, AXWysiwygRange, AXWysiwygState, AXWysiwygTextAlign, AXWysiwygTextDirection };
|
package/wysiwyg/README.md
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
# @acorex/cdk/wysiwyg
|
|
2
2
|
|
|
3
|
-
Secondary entry point of `@acorex/cdk`.
|
|
3
|
+
Secondary entry point of `@acorex/cdk`. Headless TipTap-powered rich text API. Import from `@acorex/cdk/wysiwyg`.
|
|
4
|
+
|
|
5
|
+
Requires `@tiptap/*` peer dependencies (lazy-loaded at runtime).
|