@nanahoshi/mona-ui 0.18.5 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -13
- package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +11 -3
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +17 -9
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +16 -7
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +122 -48
- package/fesm2022/nanahoshi-mona-ui-card.mjs +22 -14
- package/fesm2022/nanahoshi-mona-ui-chart.mjs +78 -18
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +199 -77
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +1 -2
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +23 -5
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +49 -28
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +42 -26
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +11 -3
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +28 -16
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +74 -51
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +57 -25
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +13 -5
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +17 -6
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +178 -59
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +137 -54
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-WEDbZ5vy.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-Bg7rckst.mjs} +2 -2
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-ibH5osCg.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-BSSpaCLL.mjs} +2 -2
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-D9AwQFDV.mjs +145 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-hc-LeIb0.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-Byb9iTes.mjs} +21 -17
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-virtual-list.component-DYajpOb9.mjs → nanahoshi-mona-ui-grid-grid-virtual-list.component-CBmdtrXm.mjs} +5 -5
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-Pm8Fbp6M.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-DPmJmCap.mjs} +90 -42
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-i18n.mjs +1168 -0
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +12 -4
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +48 -21
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +33 -18
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +10 -10
- package/fesm2022/nanahoshi-mona-ui-list.mjs +2 -0
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +29 -16
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +12 -3
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +23 -18
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +211 -106
- package/fesm2022/nanahoshi-mona-ui-otp-input.mjs +14 -6
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +46 -19
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +57 -46
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +35 -15
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +38 -17
- package/fesm2022/nanahoshi-mona-ui-rating.mjs +25 -7
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +431 -101
- package/fesm2022/nanahoshi-mona-ui-segmented.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-sheet.mjs +26 -8
- package/fesm2022/nanahoshi-mona-ui-sidebar.mjs +222 -28
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +91 -36
- package/fesm2022/nanahoshi-mona-ui-spinner.mjs +34 -15
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +39 -23
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +50 -25
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +32 -14
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +9 -9
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +74 -56
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +16 -8
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +33 -19
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +66 -27
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +23 -15
- package/fesm2022/nanahoshi-mona-ui-window.mjs +71 -40
- package/i18n/package.json +4 -0
- package/package.json +5 -1
- package/types/nanahoshi-mona-ui-auto-complete.d.ts +6 -1
- package/types/nanahoshi-mona-ui-breadcrumb.d.ts +9 -3
- package/types/nanahoshi-mona-ui-button-group.d.ts +9 -3
- package/types/nanahoshi-mona-ui-calendar.d.ts +13 -3
- package/types/nanahoshi-mona-ui-card.d.ts +8 -2
- package/types/nanahoshi-mona-ui-chart.d.ts +10 -1
- package/types/nanahoshi-mona-ui-chip.d.ts +14 -5
- package/types/nanahoshi-mona-ui-color-gradient.d.ts +6 -1
- package/types/nanahoshi-mona-ui-color-palette.d.ts +21 -10
- package/types/nanahoshi-mona-ui-color-picker.d.ts +30 -20
- package/types/nanahoshi-mona-ui-combo-box.d.ts +6 -1
- package/types/nanahoshi-mona-ui-date-picker.d.ts +7 -2
- package/types/nanahoshi-mona-ui-datetime-picker.d.ts +33 -8
- package/types/nanahoshi-mona-ui-dialog.d.ts +16 -7
- package/types/nanahoshi-mona-ui-dropdown-list.d.ts +6 -1
- package/types/nanahoshi-mona-ui-dropdowns.d.ts +4 -1
- package/types/nanahoshi-mona-ui-editor.d.ts +6 -1
- package/types/nanahoshi-mona-ui-filter.d.ts +16 -10
- package/types/nanahoshi-mona-ui-grid.d.ts +38 -1
- package/types/nanahoshi-mona-ui-i18n.d.ts +633 -0
- package/types/nanahoshi-mona-ui-internal-list.d.ts +7 -2
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +7 -3
- package/types/nanahoshi-mona-ui-list-box.d.ts +9 -4
- package/types/nanahoshi-mona-ui-list-view.d.ts +6 -6
- package/types/nanahoshi-mona-ui-list.d.ts +1 -1
- package/types/nanahoshi-mona-ui-menubar.d.ts +59 -58
- package/types/nanahoshi-mona-ui-multi-select.d.ts +6 -1
- package/types/nanahoshi-mona-ui-notification.d.ts +11 -5
- package/types/nanahoshi-mona-ui-numeric-text-box.d.ts +24 -15
- package/types/nanahoshi-mona-ui-otp-input.d.ts +9 -3
- package/types/nanahoshi-mona-ui-pager.d.ts +19 -6
- package/types/nanahoshi-mona-ui-popup.d.ts +2 -1
- package/types/nanahoshi-mona-ui-progress-bar.d.ts +9 -7
- package/types/nanahoshi-mona-ui-rating.d.ts +19 -12
- package/types/nanahoshi-mona-ui-scroll-view.d.ts +34 -28
- package/types/nanahoshi-mona-ui-sheet.d.ts +8 -2
- package/types/nanahoshi-mona-ui-sidebar.d.ts +3 -0
- package/types/nanahoshi-mona-ui-slider.d.ts +44 -26
- package/types/nanahoshi-mona-ui-spinner.d.ts +13 -4
- package/types/nanahoshi-mona-ui-split-button.d.ts +62 -56
- package/types/nanahoshi-mona-ui-splitter.d.ts +9 -6
- package/types/nanahoshi-mona-ui-stepper.d.ts +9 -3
- package/types/nanahoshi-mona-ui-switch.d.ts +1 -1
- package/types/nanahoshi-mona-ui-tabs.d.ts +96 -35
- package/types/nanahoshi-mona-ui-text-box.d.ts +11 -5
- package/types/nanahoshi-mona-ui-time-picker.d.ts +7 -2
- package/types/nanahoshi-mona-ui-time-selector.d.ts +16 -5
- package/types/nanahoshi-mona-ui-tree-view.d.ts +15 -10
- package/types/nanahoshi-mona-ui-window.d.ts +26 -20
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-ZM3CneJ0.mjs +0 -145
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, Injectable, computed,
|
|
2
|
+
import { inject, signal, Injectable, computed, Component, DOCUMENT, output, viewChild, DestroyRef, input, effect, untracked, afterNextRender } from '@angular/core';
|
|
3
3
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
4
|
import { FormsModule } from '@angular/forms';
|
|
5
5
|
import { twMerge } from 'tailwind-merge';
|
|
6
|
-
import { ImmutableSet, any, List } from '@mirei/ts-collections';
|
|
6
|
+
import { ImmutableSet, any, List, range } from '@mirei/ts-collections';
|
|
7
|
+
import { MonaI18nService } from '@nanahoshi/mona-ui/i18n';
|
|
7
8
|
import { Extension, Editor } from '@tiptap/core';
|
|
8
9
|
import { Color } from '@tiptap/extension-color';
|
|
9
10
|
import { FontFamily } from '@tiptap/extension-font-family';
|
|
@@ -201,11 +202,12 @@ const Indent = Extension.create({
|
|
|
201
202
|
return {};
|
|
202
203
|
}
|
|
203
204
|
return {
|
|
204
|
-
style: `margin-
|
|
205
|
+
style: `margin-inline-start: ${indent}px;`
|
|
205
206
|
};
|
|
206
207
|
},
|
|
207
208
|
parseHTML: element => {
|
|
208
|
-
const
|
|
209
|
+
const el = element;
|
|
210
|
+
const raw = el.style.marginInlineStart || el.style.marginLeft;
|
|
209
211
|
const parsed = raw ? parseInt(raw, 10) : NaN;
|
|
210
212
|
return Number.isNaN(parsed) ? this.options.defaultIndentLevel : parsed;
|
|
211
213
|
}
|
|
@@ -254,8 +256,62 @@ const Indent = Extension.create({
|
|
|
254
256
|
}
|
|
255
257
|
});
|
|
256
258
|
|
|
259
|
+
const EDITOR_DEFAULT_MESSAGES = {
|
|
260
|
+
addColumnAfter: "Add column after",
|
|
261
|
+
addColumnBefore: "Add column before",
|
|
262
|
+
addHorizontalLine: "Add horizontal line",
|
|
263
|
+
addRowAfter: "Add row after",
|
|
264
|
+
addRowBefore: "Add row before",
|
|
265
|
+
alignCenter: "Center text",
|
|
266
|
+
alignLeft: "Align text left",
|
|
267
|
+
alignRight: "Align text right",
|
|
268
|
+
altText: "Alt Text",
|
|
269
|
+
backgroundColor: "Background color",
|
|
270
|
+
bold: "Bold",
|
|
271
|
+
cancel: "Cancel",
|
|
272
|
+
codeBlock: "Code block",
|
|
273
|
+
color: "Color",
|
|
274
|
+
deleteColumn: "Delete column",
|
|
275
|
+
deleteRow: "Delete row",
|
|
276
|
+
deleteTable: "Delete table",
|
|
277
|
+
enterUrl: "Enter the URL",
|
|
278
|
+
fontSize: "Font Size",
|
|
279
|
+
format: "Format",
|
|
280
|
+
heading: (level) => `Heading ${level}`,
|
|
281
|
+
heightPx: "Height (px)",
|
|
282
|
+
imageUrl: "Image URL",
|
|
283
|
+
indent: "Indent",
|
|
284
|
+
insert: "Insert",
|
|
285
|
+
insertImage: "Insert image",
|
|
286
|
+
insertLink: "Insert Link",
|
|
287
|
+
insertOrderedList: "Insert ordered list",
|
|
288
|
+
insertTable: "Insert table",
|
|
289
|
+
insertTaskList: "Insert task list",
|
|
290
|
+
insertUnorderedList: "Insert unordered list",
|
|
291
|
+
italic: "Italic",
|
|
292
|
+
justify: "Justify",
|
|
293
|
+
mergeCells: "Merge selected cells",
|
|
294
|
+
outdent: "Outdent",
|
|
295
|
+
paragraph: "Paragraph",
|
|
296
|
+
quotation: "Quotation",
|
|
297
|
+
redo: "Redo",
|
|
298
|
+
removeLink: "Remove Link",
|
|
299
|
+
selectFontFamily: "Select font family",
|
|
300
|
+
selectFontSize: "Select font size",
|
|
301
|
+
splitCell: "Split cell",
|
|
302
|
+
strikethrough: "Strikethrough",
|
|
303
|
+
subscript: "Subscript",
|
|
304
|
+
superscript: "Superscript",
|
|
305
|
+
toggleHeaderRow: "Toggle header row",
|
|
306
|
+
underline: "Underline",
|
|
307
|
+
undo: "Undo",
|
|
308
|
+
widthPx: "Width (px)"
|
|
309
|
+
};
|
|
310
|
+
|
|
257
311
|
class EditorService {
|
|
258
312
|
constructor() {
|
|
313
|
+
this.#i18n = inject(MonaI18nService);
|
|
314
|
+
this.messages = this.#i18n.componentMessages("editor", EDITOR_DEFAULT_MESSAGES);
|
|
259
315
|
this.#defaultSettings = {
|
|
260
316
|
alignment: true,
|
|
261
317
|
blockquote: true,
|
|
@@ -322,6 +378,7 @@ class EditorService {
|
|
|
322
378
|
...(ngDevMode ? [{ debugName: "settings" }] : /* istanbul ignore next */ []));
|
|
323
379
|
this.update$ = new Subject();
|
|
324
380
|
}
|
|
381
|
+
#i18n;
|
|
325
382
|
#defaultSettings;
|
|
326
383
|
#state;
|
|
327
384
|
#editor;
|
|
@@ -469,9 +526,9 @@ const editorBaseThemeVariants = cva(`
|
|
|
469
526
|
|
|
470
527
|
[&_ol]:ps-8 [&_ul]:ps-8
|
|
471
528
|
|
|
472
|
-
[&_blockquote]:border-
|
|
473
|
-
[&_blockquote]:border-
|
|
474
|
-
[&_blockquote]:border-
|
|
529
|
+
[&_blockquote]:border-s-4
|
|
530
|
+
[&_blockquote]:border-s-solid
|
|
531
|
+
[&_blockquote]:border-s-border-control-hover
|
|
475
532
|
[&_blockquote]:px-4 [&_blockquote]:py-2
|
|
476
533
|
[&_blockquote]:ms-4
|
|
477
534
|
[&_blockquote]:bg-surface-muted
|
|
@@ -527,7 +584,7 @@ const editorBaseThemeVariants = cva(`
|
|
|
527
584
|
[&_.column-resize-handle]:pointer-events-none
|
|
528
585
|
[&_.column-resize-handle]:top-0
|
|
529
586
|
[&_.column-resize-handle]:-bottom-0.5
|
|
530
|
-
[&_.column-resize-handle]:-
|
|
587
|
+
[&_.column-resize-handle]:-end-0.5
|
|
531
588
|
|
|
532
589
|
[&_.ProseMirror.resize-cursor]:cursor-ew-resize
|
|
533
590
|
|
|
@@ -596,6 +653,8 @@ const editorToolbarThemeVariants = cva(`
|
|
|
596
653
|
|
|
597
654
|
class EditorBasicTextStylesComponent {
|
|
598
655
|
constructor() {
|
|
656
|
+
this.#i18n = inject(MonaI18nService);
|
|
657
|
+
this.messages = this.#i18n.componentMessages("editor", EDITOR_DEFAULT_MESSAGES);
|
|
599
658
|
this.anyToolVisible = computed(() => {
|
|
600
659
|
return (this.boldVisible() ||
|
|
601
660
|
this.italicVisible() ||
|
|
@@ -661,6 +720,7 @@ class EditorBasicTextStylesComponent {
|
|
|
661
720
|
}, /* @ts-ignore */
|
|
662
721
|
...(ngDevMode ? [{ debugName: "underlineVisible" }] : /* istanbul ignore next */ []));
|
|
663
722
|
}
|
|
723
|
+
#i18n;
|
|
664
724
|
onBoldToggle() {
|
|
665
725
|
if (this.boldSelected()) {
|
|
666
726
|
this.editorService.editor.chain().focus().unsetBold().run();
|
|
@@ -710,16 +770,18 @@ class EditorBasicTextStylesComponent {
|
|
|
710
770
|
}
|
|
711
771
|
}
|
|
712
772
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorBasicTextStylesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
713
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: EditorBasicTextStylesComponent, isStandalone: true, selector: "mona-editor-basic-text-styles", ngImport: i0, template: "@if (anyToolVisible()) {\n <mona-button-group selection=\"multiple\" [size]=\"'small'\">\n @if (boldVisible()) {\n <button
|
|
773
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: EditorBasicTextStylesComponent, isStandalone: true, selector: "mona-editor-basic-text-styles", ngImport: i0, template: "@if (anyToolVisible()) {\n <mona-button-group selection=\"multiple\" [size]=\"'small'\">\n @if (boldVisible()) {\n <button\n monaButton\n [selected]=\"boldSelected()\"\n [toggleable]=\"false\"\n (click)=\"onBoldToggle()\"\n [title]=\"messages().bold\">\n <i class=\"ri-bold\"></i>\n </button>\n }\n @if (italicVisible()) {\n <button\n monaButton\n [selected]=\"italicSelected()\"\n [toggleable]=\"false\"\n (click)=\"onItalicToggle()\"\n [title]=\"messages().italic\">\n <i class=\"ri-italic\"></i>\n </button>\n }\n @if (underlineVisible()) {\n <button\n monaButton\n [selected]=\"underlineSelected()\"\n [toggleable]=\"false\"\n (click)=\"onUnderlineToggle()\"\n [title]=\"messages().underline\">\n <i class=\"ri-underline\"></i>\n </button>\n }\n @if (strikeThroughVisible()) {\n <button\n monaButton\n [selected]=\"strikeThroughSelected()\"\n [toggleable]=\"false\"\n (click)=\"onStrikeThroughToggle()\"\n [title]=\"messages().strikethrough\">\n <i class=\"ri-strikethrough\"></i>\n </button>\n }\n @if (subscriptVisible()) {\n <button\n monaButton\n [selected]=\"subscriptSelected()\"\n [toggleable]=\"false\"\n (click)=\"onSubscriptToggle()\"\n [title]=\"messages().subscript\">\n <i class=\"ri-subscript\"></i>\n </button>\n }\n @if (superscriptVisible()) {\n <button\n monaButton\n [selected]=\"superscriptSelected()\"\n [toggleable]=\"false\"\n (click)=\"onSuperscriptToggle()\"\n [title]=\"messages().superscript\">\n <i class=\"ri-superscript\"></i>\n </button>\n }\n </mona-button-group>\n}\n", dependencies: [{ kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "component", type: ButtonGroupComponent, selector: "mona-button-group", inputs: ["allowEmpty", "aria-label", "disabled", "look", "rounded", "selection", "size", "class"], outputs: ["buttonClick", "disabledChange", "selectionChange"] }] }); }
|
|
714
774
|
}
|
|
715
775
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorBasicTextStylesComponent, decorators: [{
|
|
716
776
|
type: Component,
|
|
717
|
-
args: [{ selector: "mona-editor-basic-text-styles", imports: [ButtonDirective, ButtonGroupComponent], template: "@if (anyToolVisible()) {\n <mona-button-group selection=\"multiple\" [size]=\"'small'\">\n @if (boldVisible()) {\n <button
|
|
777
|
+
args: [{ selector: "mona-editor-basic-text-styles", imports: [ButtonDirective, ButtonGroupComponent], template: "@if (anyToolVisible()) {\n <mona-button-group selection=\"multiple\" [size]=\"'small'\">\n @if (boldVisible()) {\n <button\n monaButton\n [selected]=\"boldSelected()\"\n [toggleable]=\"false\"\n (click)=\"onBoldToggle()\"\n [title]=\"messages().bold\">\n <i class=\"ri-bold\"></i>\n </button>\n }\n @if (italicVisible()) {\n <button\n monaButton\n [selected]=\"italicSelected()\"\n [toggleable]=\"false\"\n (click)=\"onItalicToggle()\"\n [title]=\"messages().italic\">\n <i class=\"ri-italic\"></i>\n </button>\n }\n @if (underlineVisible()) {\n <button\n monaButton\n [selected]=\"underlineSelected()\"\n [toggleable]=\"false\"\n (click)=\"onUnderlineToggle()\"\n [title]=\"messages().underline\">\n <i class=\"ri-underline\"></i>\n </button>\n }\n @if (strikeThroughVisible()) {\n <button\n monaButton\n [selected]=\"strikeThroughSelected()\"\n [toggleable]=\"false\"\n (click)=\"onStrikeThroughToggle()\"\n [title]=\"messages().strikethrough\">\n <i class=\"ri-strikethrough\"></i>\n </button>\n }\n @if (subscriptVisible()) {\n <button\n monaButton\n [selected]=\"subscriptSelected()\"\n [toggleable]=\"false\"\n (click)=\"onSubscriptToggle()\"\n [title]=\"messages().subscript\">\n <i class=\"ri-subscript\"></i>\n </button>\n }\n @if (superscriptVisible()) {\n <button\n monaButton\n [selected]=\"superscriptSelected()\"\n [toggleable]=\"false\"\n (click)=\"onSuperscriptToggle()\"\n [title]=\"messages().superscript\">\n <i class=\"ri-superscript\"></i>\n </button>\n }\n </mona-button-group>\n}\n" }]
|
|
718
778
|
}] });
|
|
719
779
|
|
|
720
780
|
class EditorBlockquoteComponent {
|
|
721
781
|
constructor() {
|
|
722
782
|
this.#editorService = inject(EditorService);
|
|
783
|
+
this.#i18n = inject(MonaI18nService);
|
|
784
|
+
this.messages = this.#i18n.componentMessages("editor", EDITOR_DEFAULT_MESSAGES);
|
|
723
785
|
this.blockquoteSelected = computed(() => {
|
|
724
786
|
this.#editorService.state();
|
|
725
787
|
return this.#editorService.editor.isActive("blockquote");
|
|
@@ -727,6 +789,7 @@ class EditorBlockquoteComponent {
|
|
|
727
789
|
...(ngDevMode ? [{ debugName: "blockquoteSelected" }] : /* istanbul ignore next */ []));
|
|
728
790
|
}
|
|
729
791
|
#editorService;
|
|
792
|
+
#i18n;
|
|
730
793
|
onBlockquoteToggle() {
|
|
731
794
|
if (this.blockquoteSelected()) {
|
|
732
795
|
this.#editorService.editor.chain().focus().unsetBlockquote().run();
|
|
@@ -736,16 +799,18 @@ class EditorBlockquoteComponent {
|
|
|
736
799
|
}
|
|
737
800
|
}
|
|
738
801
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorBlockquoteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
739
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorBlockquoteComponent, isStandalone: true, selector: "mona-editor-blockquote", ngImport: i0, template: "<button monaButton [size]=\"'small'\" [selected]=\"blockquoteSelected()\" (click)=\"onBlockquoteToggle()\" title=\"
|
|
802
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorBlockquoteComponent, isStandalone: true, selector: "mona-editor-blockquote", ngImport: i0, template: "<button monaButton [size]=\"'small'\" [selected]=\"blockquoteSelected()\" (click)=\"onBlockquoteToggle()\" [title]=\"messages().quotation\">\n <i class=\"ri-double-quotes-r\"></i>\n</button>\n", dependencies: [{ kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }] }); }
|
|
740
803
|
}
|
|
741
804
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorBlockquoteComponent, decorators: [{
|
|
742
805
|
type: Component,
|
|
743
|
-
args: [{ selector: "mona-editor-blockquote", imports: [ButtonDirective], template: "<button monaButton [size]=\"'small'\" [selected]=\"blockquoteSelected()\" (click)=\"onBlockquoteToggle()\" title=\"
|
|
806
|
+
args: [{ selector: "mona-editor-blockquote", imports: [ButtonDirective], template: "<button monaButton [size]=\"'small'\" [selected]=\"blockquoteSelected()\" (click)=\"onBlockquoteToggle()\" [title]=\"messages().quotation\">\n <i class=\"ri-double-quotes-r\"></i>\n</button>\n" }]
|
|
744
807
|
}] });
|
|
745
808
|
|
|
746
809
|
class EditorCodeBlockComponent {
|
|
747
810
|
constructor() {
|
|
748
811
|
this.#editorService = inject(EditorService);
|
|
812
|
+
this.#i18n = inject(MonaI18nService);
|
|
813
|
+
this.messages = this.#i18n.componentMessages("editor", EDITOR_DEFAULT_MESSAGES);
|
|
749
814
|
this.codeBlockSelected = computed(() => {
|
|
750
815
|
this.#editorService.state();
|
|
751
816
|
return this.#editorService.editor.isActive("codeBlock");
|
|
@@ -753,15 +818,16 @@ class EditorCodeBlockComponent {
|
|
|
753
818
|
...(ngDevMode ? [{ debugName: "codeBlockSelected" }] : /* istanbul ignore next */ []));
|
|
754
819
|
}
|
|
755
820
|
#editorService;
|
|
821
|
+
#i18n;
|
|
756
822
|
onCodeBlockClick() {
|
|
757
823
|
this.#editorService.editor.chain().toggleCodeBlock().run();
|
|
758
824
|
}
|
|
759
825
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorCodeBlockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
760
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorCodeBlockComponent, isStandalone: true, selector: "mona-editor-code-block", ngImport: i0, template: "<button monaButton [size]=\"'small'\" [selected]=\"codeBlockSelected()\" (click)=\"onCodeBlockClick()\">\n <i class=\"ri-code-s-slash-line\"></i>\n</button>\n", dependencies: [{ kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }] }); }
|
|
826
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorCodeBlockComponent, isStandalone: true, selector: "mona-editor-code-block", ngImport: i0, template: "<button monaButton [size]=\"'small'\" [selected]=\"codeBlockSelected()\" (click)=\"onCodeBlockClick()\" [title]=\"messages().codeBlock\">\n <i class=\"ri-code-s-slash-line\"></i>\n</button>\n", dependencies: [{ kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }] }); }
|
|
761
827
|
}
|
|
762
828
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorCodeBlockComponent, decorators: [{
|
|
763
829
|
type: Component,
|
|
764
|
-
args: [{ selector: "mona-editor-code-block", imports: [ButtonDirective], template: "<button monaButton [size]=\"'small'\" [selected]=\"codeBlockSelected()\" (click)=\"onCodeBlockClick()\">\n <i class=\"ri-code-s-slash-line\"></i>\n</button>\n" }]
|
|
830
|
+
args: [{ selector: "mona-editor-code-block", imports: [ButtonDirective], template: "<button monaButton [size]=\"'small'\" [selected]=\"codeBlockSelected()\" (click)=\"onCodeBlockClick()\" [title]=\"messages().codeBlock\">\n <i class=\"ri-code-s-slash-line\"></i>\n</button>\n" }]
|
|
765
831
|
}] });
|
|
766
832
|
|
|
767
833
|
const htmlColorCode = (name, document) => {
|
|
@@ -778,6 +844,8 @@ class EditorFontColorComponent {
|
|
|
778
844
|
constructor() {
|
|
779
845
|
this.#document = inject(DOCUMENT);
|
|
780
846
|
this.#editorService = inject(EditorService);
|
|
847
|
+
this.#i18n = inject(MonaI18nService);
|
|
848
|
+
this.messages = this.#i18n.componentMessages("editor", EDITOR_DEFAULT_MESSAGES);
|
|
781
849
|
this.#lastColor = "";
|
|
782
850
|
this.colorPreviewClass = computed(() => {
|
|
783
851
|
return editorFontColorPreviewThemeVariants();
|
|
@@ -797,6 +865,7 @@ class EditorFontColorComponent {
|
|
|
797
865
|
}
|
|
798
866
|
#document;
|
|
799
867
|
#editorService;
|
|
868
|
+
#i18n;
|
|
800
869
|
#lastColor;
|
|
801
870
|
onColorChange(color) {
|
|
802
871
|
if (color) {
|
|
@@ -808,15 +877,17 @@ class EditorFontColorComponent {
|
|
|
808
877
|
}
|
|
809
878
|
}
|
|
810
879
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorFontColorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
811
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorFontColorComponent, isStandalone: true, selector: "mona-editor-font-color", ngImport: i0, template: "<mona-color-picker\n view=\"gradient\"\n [size]=\"'small'\"\n [value]=\"selectedColor()\"\n (valueChange)=\"onColorChange($event)\"\n title=\"
|
|
880
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorFontColorComponent, isStandalone: true, selector: "mona-editor-font-color", ngImport: i0, template: "<mona-color-picker\n view=\"gradient\"\n [size]=\"'small'\"\n [value]=\"selectedColor()\"\n (valueChange)=\"onColorChange($event)\"\n [title]=\"messages().color\">\n <ng-template monaColorPickerValueTemplate let-color>\n <div [class]=\"colorValueClass()\">\n <i class=\"ri-font-family\"></i>\n <span [class]=\"colorPreviewClass()\" [style.background-color]=\"color\"></span>\n </div>\n </ng-template>\n</mona-color-picker>\n", dependencies: [{ kind: "component", type: ColorPickerComponent, selector: "mona-color-picker", inputs: ["aria-label", "closeOnSelect", "columns", "disabled", "invalid", "opacity", "palette", "readonly", "required", "rounded", "showClearButton", "size", "touched", "value", "view"], outputs: ["touch", "valueChange"] }, { kind: "directive", type: ColorPickerValueTemplateDirective, selector: "ng-template[monaColorPickerValueTemplate]" }] }); }
|
|
812
881
|
}
|
|
813
882
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorFontColorComponent, decorators: [{
|
|
814
883
|
type: Component,
|
|
815
|
-
args: [{ selector: "mona-editor-font-color", imports: [ColorPickerComponent, ColorPickerValueTemplateDirective], template: "<mona-color-picker\n view=\"gradient\"\n [size]=\"'small'\"\n [value]=\"selectedColor()\"\n (valueChange)=\"onColorChange($event)\"\n title=\"
|
|
884
|
+
args: [{ selector: "mona-editor-font-color", imports: [ColorPickerComponent, ColorPickerValueTemplateDirective], template: "<mona-color-picker\n view=\"gradient\"\n [size]=\"'small'\"\n [value]=\"selectedColor()\"\n (valueChange)=\"onColorChange($event)\"\n [title]=\"messages().color\">\n <ng-template monaColorPickerValueTemplate let-color>\n <div [class]=\"colorValueClass()\">\n <i class=\"ri-font-family\"></i>\n <span [class]=\"colorPreviewClass()\" [style.background-color]=\"color\"></span>\n </div>\n </ng-template>\n</mona-color-picker>\n" }]
|
|
816
885
|
}] });
|
|
817
886
|
|
|
818
887
|
class EditorFontFamilyComponent {
|
|
819
888
|
constructor() {
|
|
889
|
+
this.#i18n = inject(MonaI18nService);
|
|
890
|
+
this.messages = this.#i18n.componentMessages("editor", EDITOR_DEFAULT_MESSAGES);
|
|
820
891
|
this.dropdownListClass = computed(() => {
|
|
821
892
|
return editorFontFamilyDropdownListThemeVariants();
|
|
822
893
|
}, /* @ts-ignore */
|
|
@@ -830,6 +901,7 @@ class EditorFontFamilyComponent {
|
|
|
830
901
|
}, /* @ts-ignore */
|
|
831
902
|
...(ngDevMode ? [{ debugName: "selectedFontFamily" }] : /* istanbul ignore next */ []));
|
|
832
903
|
}
|
|
904
|
+
#i18n;
|
|
833
905
|
ngOnInit() {
|
|
834
906
|
const defaultFontFamily = this.editorService.fonts().first();
|
|
835
907
|
this.editorService.editor.chain().focus().setFontFamily(defaultFontFamily).run();
|
|
@@ -841,16 +913,18 @@ class EditorFontFamilyComponent {
|
|
|
841
913
|
this.editorService.editor.chain().focus().setFontFamily(fontFamily).run();
|
|
842
914
|
}
|
|
843
915
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorFontFamilyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
844
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorFontFamilyComponent, isStandalone: true, selector: "mona-editor-font-family", ngImport: i0, template: "<mona-dropdown-list\n [data]=\"editorService.fonts()\"\n [value]=\"selectedFontFamily()\"\n (valueChange)=\"onFontFamilyChange($event)\"\n [size]=\"'small'\"\n [class]=\"dropdownListClass()\"\n title=\"
|
|
916
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorFontFamilyComponent, isStandalone: true, selector: "mona-editor-font-family", ngImport: i0, template: "<mona-dropdown-list\n [data]=\"editorService.fonts()\"\n [value]=\"selectedFontFamily()\"\n (valueChange)=\"onFontFamilyChange($event)\"\n [size]=\"'small'\"\n [class]=\"dropdownListClass()\"\n [title]=\"messages().selectFontFamily\">\n <ng-template monaDropDownListItemTemplate let-font>\n <span [style.font-family]=\"font\">{{ font }}</span>\n </ng-template>\n</mona-dropdown-list>\n", dependencies: [{ kind: "component", type: DropdownListComponent, selector: "mona-dropdown-list", inputs: ["aria-label", "aria-labelledby", "data", "disabled", "itemDisabled", "invalid", "loading", "placeholder", "popupClass", "popupHeight", "popupWidth", "readonly", "required", "rounded", "showClearButton", "size", "textField", "touched", "class", "valueField", "valuePrimitive", "value"], outputs: ["close", "closed", "disabledChange", "open", "opened", "touch", "valueChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: DropdownItemTemplateDirective, selector: " ng-template[monaDropDownItemTemplate], ng-template[monaAutoCompleteItemTemplate], ng-template[monaDropDownListItemTemplate], ng-template[monaComboBoxItemTemplate], ng-template[monaMultiSelectItemTemplate] " }] }); }
|
|
845
917
|
}
|
|
846
918
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorFontFamilyComponent, decorators: [{
|
|
847
919
|
type: Component,
|
|
848
|
-
args: [{ selector: "mona-editor-font-family", imports: [DropdownListComponent, FormsModule, DropdownItemTemplateDirective], template: "<mona-dropdown-list\n [data]=\"editorService.fonts()\"\n [value]=\"selectedFontFamily()\"\n (valueChange)=\"onFontFamilyChange($event)\"\n [size]=\"'small'\"\n [class]=\"dropdownListClass()\"\n title=\"
|
|
920
|
+
args: [{ selector: "mona-editor-font-family", imports: [DropdownListComponent, FormsModule, DropdownItemTemplateDirective], template: "<mona-dropdown-list\n [data]=\"editorService.fonts()\"\n [value]=\"selectedFontFamily()\"\n (valueChange)=\"onFontFamilyChange($event)\"\n [size]=\"'small'\"\n [class]=\"dropdownListClass()\"\n [title]=\"messages().selectFontFamily\">\n <ng-template monaDropDownListItemTemplate let-font>\n <span [style.font-family]=\"font\">{{ font }}</span>\n </ng-template>\n</mona-dropdown-list>\n" }]
|
|
849
921
|
}] });
|
|
850
922
|
|
|
851
923
|
class EditorFontHighlightComponent {
|
|
852
924
|
constructor() {
|
|
853
925
|
this.#editorService = inject(EditorService);
|
|
926
|
+
this.#i18n = inject(MonaI18nService);
|
|
927
|
+
this.messages = this.#i18n.componentMessages("editor", EDITOR_DEFAULT_MESSAGES);
|
|
854
928
|
this.#lastColor = "";
|
|
855
929
|
this.highlightPreviewClass = computed(() => {
|
|
856
930
|
return editorFontHighlightPreviewThemeVariants();
|
|
@@ -879,6 +953,7 @@ class EditorFontHighlightComponent {
|
|
|
879
953
|
...(ngDevMode ? [{ debugName: "selectedColor" }] : /* istanbul ignore next */ []));
|
|
880
954
|
}
|
|
881
955
|
#editorService;
|
|
956
|
+
#i18n;
|
|
882
957
|
#lastColor;
|
|
883
958
|
onColorChange(color) {
|
|
884
959
|
if (color) {
|
|
@@ -890,15 +965,17 @@ class EditorFontHighlightComponent {
|
|
|
890
965
|
}
|
|
891
966
|
}
|
|
892
967
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorFontHighlightComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
893
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: EditorFontHighlightComponent, isStandalone: true, selector: "mona-editor-font-highlight", ngImport: i0, template: "<mona-color-picker\n view=\"gradient\"\n [value]=\"selectedColor()\"\n (valueChange)=\"onColorChange($event)\"\n [size]=\"'small'\"\n title=\"
|
|
968
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: EditorFontHighlightComponent, isStandalone: true, selector: "mona-editor-font-highlight", ngImport: i0, template: "<mona-color-picker\n view=\"gradient\"\n [value]=\"selectedColor()\"\n (valueChange)=\"onColorChange($event)\"\n [size]=\"'small'\"\n [title]=\"messages().backgroundColor\">\n <ng-template monaColorPickerValueTemplate let-color>\n <div [class]=\"highlightValueClass()\">\n <i class=\"ri-drop-fill\"></i>\n @if (color) {\n <span [class]=\"highlightPreviewClass()\" [style.background-color]=\"color\"></span>\n }\n </div>\n </ng-template>\n</mona-color-picker>\n", dependencies: [{ kind: "component", type: ColorPickerComponent, selector: "mona-color-picker", inputs: ["aria-label", "closeOnSelect", "columns", "disabled", "invalid", "opacity", "palette", "readonly", "required", "rounded", "showClearButton", "size", "touched", "value", "view"], outputs: ["touch", "valueChange"] }, { kind: "directive", type: ColorPickerValueTemplateDirective, selector: "ng-template[monaColorPickerValueTemplate]" }] }); }
|
|
894
969
|
}
|
|
895
970
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorFontHighlightComponent, decorators: [{
|
|
896
971
|
type: Component,
|
|
897
|
-
args: [{ selector: "mona-editor-font-highlight", imports: [ColorPickerComponent, ColorPickerValueTemplateDirective], template: "<mona-color-picker\n view=\"gradient\"\n [value]=\"selectedColor()\"\n (valueChange)=\"onColorChange($event)\"\n [size]=\"'small'\"\n title=\"
|
|
972
|
+
args: [{ selector: "mona-editor-font-highlight", imports: [ColorPickerComponent, ColorPickerValueTemplateDirective], template: "<mona-color-picker\n view=\"gradient\"\n [value]=\"selectedColor()\"\n (valueChange)=\"onColorChange($event)\"\n [size]=\"'small'\"\n [title]=\"messages().backgroundColor\">\n <ng-template monaColorPickerValueTemplate let-color>\n <div [class]=\"highlightValueClass()\">\n <i class=\"ri-drop-fill\"></i>\n @if (color) {\n <span [class]=\"highlightPreviewClass()\" [style.background-color]=\"color\"></span>\n }\n </div>\n </ng-template>\n</mona-color-picker>\n" }]
|
|
898
973
|
}] });
|
|
899
974
|
|
|
900
975
|
class EditorFontSizeComponent {
|
|
901
976
|
constructor() {
|
|
977
|
+
this.#i18n = inject(MonaI18nService);
|
|
978
|
+
this.messages = this.#i18n.componentMessages("editor", EDITOR_DEFAULT_MESSAGES);
|
|
902
979
|
this.editorService = inject(EditorService);
|
|
903
980
|
this.dropdownListClass = computed(() => {
|
|
904
981
|
return editorFontSizeDropdownListThemeVariants();
|
|
@@ -912,6 +989,7 @@ class EditorFontSizeComponent {
|
|
|
912
989
|
}, /* @ts-ignore */
|
|
913
990
|
...(ngDevMode ? [{ debugName: "selectedFontSize" }] : /* istanbul ignore next */ []));
|
|
914
991
|
}
|
|
992
|
+
#i18n;
|
|
915
993
|
onFontSizeChange(fontSize) {
|
|
916
994
|
if (!fontSize) {
|
|
917
995
|
return;
|
|
@@ -919,11 +997,11 @@ class EditorFontSizeComponent {
|
|
|
919
997
|
this.editorService.editor.chain().focus().setFontSize(fontSize).run();
|
|
920
998
|
}
|
|
921
999
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorFontSizeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
922
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorFontSizeComponent, isStandalone: true, selector: "mona-editor-font-size", ngImport: i0, template: "<mona-dropdown-list\n [data]=\"editorService.fontSizes()\"\n placeholder=\"
|
|
1000
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorFontSizeComponent, isStandalone: true, selector: "mona-editor-font-size", ngImport: i0, template: "<mona-dropdown-list\n [data]=\"editorService.fontSizes()\"\n [placeholder]=\"messages().fontSize\"\n [value]=\"selectedFontSize()\"\n (valueChange)=\"onFontSizeChange($event)\"\n [size]=\"'small'\"\n [class]=\"dropdownListClass()\"\n [title]=\"messages().selectFontSize\"></mona-dropdown-list>\n", dependencies: [{ kind: "component", type: DropdownListComponent, selector: "mona-dropdown-list", inputs: ["aria-label", "aria-labelledby", "data", "disabled", "itemDisabled", "invalid", "loading", "placeholder", "popupClass", "popupHeight", "popupWidth", "readonly", "required", "rounded", "showClearButton", "size", "textField", "touched", "class", "valueField", "valuePrimitive", "value"], outputs: ["close", "closed", "disabledChange", "open", "opened", "touch", "valueChange"] }, { kind: "ngmodule", type: FormsModule }] }); }
|
|
923
1001
|
}
|
|
924
1002
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorFontSizeComponent, decorators: [{
|
|
925
1003
|
type: Component,
|
|
926
|
-
args: [{ selector: "mona-editor-font-size", imports: [DropdownListComponent, FormsModule], template: "<mona-dropdown-list\n [data]=\"editorService.fontSizes()\"\n placeholder=\"
|
|
1004
|
+
args: [{ selector: "mona-editor-font-size", imports: [DropdownListComponent, FormsModule], template: "<mona-dropdown-list\n [data]=\"editorService.fontSizes()\"\n [placeholder]=\"messages().fontSize\"\n [value]=\"selectedFontSize()\"\n (valueChange)=\"onFontSizeChange($event)\"\n [size]=\"'small'\"\n [class]=\"dropdownListClass()\"\n [title]=\"messages().selectFontSize\"></mona-dropdown-list>\n" }]
|
|
927
1005
|
}] });
|
|
928
1006
|
|
|
929
1007
|
var HeadingType;
|
|
@@ -940,31 +1018,39 @@ var HeadingType;
|
|
|
940
1018
|
class EditorHeadingsComponent {
|
|
941
1019
|
constructor() {
|
|
942
1020
|
this.#editorService = inject(EditorService);
|
|
1021
|
+
this.#i18n = inject(MonaI18nService);
|
|
1022
|
+
this.messages = this.#i18n.componentMessages("editor", EDITOR_DEFAULT_MESSAGES);
|
|
943
1023
|
this.HeadingType = HeadingType;
|
|
944
1024
|
this.dropdownListClass = computed(() => {
|
|
945
1025
|
return editorHeadingsDropdownListThemeVariants();
|
|
946
1026
|
}, /* @ts-ignore */
|
|
947
1027
|
...(ngDevMode ? [{ debugName: "dropdownListClass" }] : /* istanbul ignore next */ []));
|
|
948
|
-
this.headingsDropdownListData =
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
1028
|
+
this.headingsDropdownListData = computed(() => {
|
|
1029
|
+
const msgs = this.messages();
|
|
1030
|
+
return [
|
|
1031
|
+
{ text: msgs.paragraph, value: HeadingType.Paragraph },
|
|
1032
|
+
...range(1, 6)
|
|
1033
|
+
.select(level => ({
|
|
1034
|
+
text: msgs.heading(level),
|
|
1035
|
+
value: level
|
|
1036
|
+
}))
|
|
1037
|
+
.toArray()
|
|
1038
|
+
];
|
|
1039
|
+
}, /* @ts-ignore */
|
|
1040
|
+
...(ngDevMode ? [{ debugName: "headingsDropdownListData" }] : /* istanbul ignore next */ []));
|
|
957
1041
|
this.selectedHeadingsDropdownItem = computed(() => {
|
|
958
1042
|
const state = this.#editorService.state();
|
|
959
1043
|
const node = state.selection.$from.node();
|
|
1044
|
+
const data = this.headingsDropdownListData();
|
|
960
1045
|
if (node && node.type.name === "heading") {
|
|
961
|
-
return
|
|
1046
|
+
return data.find(item => item.value === node.attrs["level"]);
|
|
962
1047
|
}
|
|
963
|
-
return
|
|
1048
|
+
return data.find(item => item.value === HeadingType.Paragraph);
|
|
964
1049
|
}, /* @ts-ignore */
|
|
965
1050
|
...(ngDevMode ? [{ debugName: "selectedHeadingsDropdownItem" }] : /* istanbul ignore next */ []));
|
|
966
1051
|
}
|
|
967
1052
|
#editorService;
|
|
1053
|
+
#i18n;
|
|
968
1054
|
onFormatChange(headingItem) {
|
|
969
1055
|
if (!headingItem) {
|
|
970
1056
|
return;
|
|
@@ -977,16 +1063,18 @@ class EditorHeadingsComponent {
|
|
|
977
1063
|
}
|
|
978
1064
|
}
|
|
979
1065
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorHeadingsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
980
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: EditorHeadingsComponent, isStandalone: true, selector: "mona-editor-headings", ngImport: i0, template: "<mona-dropdown-list\n [data]=\"headingsDropdownListData\"\n [value]=\"selectedHeadingsDropdownItem()\"\n (valueChange)=\"onFormatChange($event)\"\n [size]=\"'small'\"\n [class]=\"dropdownListClass()\"\n textField=\"text\"\n valueField=\"value\"\n title=\"
|
|
1066
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: EditorHeadingsComponent, isStandalone: true, selector: "mona-editor-headings", ngImport: i0, template: "<mona-dropdown-list\n [data]=\"headingsDropdownListData()\"\n [value]=\"selectedHeadingsDropdownItem()\"\n (valueChange)=\"onFormatChange($event)\"\n [size]=\"'small'\"\n [class]=\"dropdownListClass()\"\n textField=\"text\"\n valueField=\"value\"\n [title]=\"messages().format\">\n <ng-template monaDropDownListItemTemplate let-dataItem>\n @switch (dataItem.value) {\n @case (HeadingType.Heading1) {\n <h1 class=\"m-0 text-2xl font-bold\">{{ dataItem.text }}</h1>\n }\n @case (HeadingType.Heading2) {\n <h2 class=\"m-0 text-xl font-bold\">{{ dataItem.text }}</h2>\n }\n @case (HeadingType.Heading3) {\n <h3 class=\"m-0 text-lg font-bold\">{{ dataItem.text }}</h3>\n }\n @case (HeadingType.Heading4) {\n <h4 class=\"m-0 text-base font-bold\">{{ dataItem.text }}</h4>\n }\n @case (HeadingType.Heading5) {\n <h5 class=\"m-0 text-sm font-bold\">{{ dataItem.text }}</h5>\n }\n @case (HeadingType.Heading6) {\n <h6 class=\"m-0 text-xs font-bold\">{{ dataItem.text }}</h6>\n }\n @case (HeadingType.Paragraph) {\n <p class=\"m-0 text-sm\">{{ dataItem.text }}</p>\n }\n @default {\n <p class=\"m-0 text-sm\">{{ dataItem.text }}</p>\n }\n }\n </ng-template>\n</mona-dropdown-list>\n", dependencies: [{ kind: "component", type: DropdownListComponent, selector: "mona-dropdown-list", inputs: ["aria-label", "aria-labelledby", "data", "disabled", "itemDisabled", "invalid", "loading", "placeholder", "popupClass", "popupHeight", "popupWidth", "readonly", "required", "rounded", "showClearButton", "size", "textField", "touched", "class", "valueField", "valuePrimitive", "value"], outputs: ["close", "closed", "disabledChange", "open", "opened", "touch", "valueChange"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: DropdownItemTemplateDirective, selector: " ng-template[monaDropDownItemTemplate], ng-template[monaAutoCompleteItemTemplate], ng-template[monaDropDownListItemTemplate], ng-template[monaComboBoxItemTemplate], ng-template[monaMultiSelectItemTemplate] " }] }); }
|
|
981
1067
|
}
|
|
982
1068
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorHeadingsComponent, decorators: [{
|
|
983
1069
|
type: Component,
|
|
984
|
-
args: [{ selector: "mona-editor-headings", imports: [DropdownListComponent, FormsModule, DropdownItemTemplateDirective], template: "<mona-dropdown-list\n [data]=\"headingsDropdownListData\"\n [value]=\"selectedHeadingsDropdownItem()\"\n (valueChange)=\"onFormatChange($event)\"\n [size]=\"'small'\"\n [class]=\"dropdownListClass()\"\n textField=\"text\"\n valueField=\"value\"\n title=\"
|
|
1070
|
+
args: [{ selector: "mona-editor-headings", imports: [DropdownListComponent, FormsModule, DropdownItemTemplateDirective], template: "<mona-dropdown-list\n [data]=\"headingsDropdownListData()\"\n [value]=\"selectedHeadingsDropdownItem()\"\n (valueChange)=\"onFormatChange($event)\"\n [size]=\"'small'\"\n [class]=\"dropdownListClass()\"\n textField=\"text\"\n valueField=\"value\"\n [title]=\"messages().format\">\n <ng-template monaDropDownListItemTemplate let-dataItem>\n @switch (dataItem.value) {\n @case (HeadingType.Heading1) {\n <h1 class=\"m-0 text-2xl font-bold\">{{ dataItem.text }}</h1>\n }\n @case (HeadingType.Heading2) {\n <h2 class=\"m-0 text-xl font-bold\">{{ dataItem.text }}</h2>\n }\n @case (HeadingType.Heading3) {\n <h3 class=\"m-0 text-lg font-bold\">{{ dataItem.text }}</h3>\n }\n @case (HeadingType.Heading4) {\n <h4 class=\"m-0 text-base font-bold\">{{ dataItem.text }}</h4>\n }\n @case (HeadingType.Heading5) {\n <h5 class=\"m-0 text-sm font-bold\">{{ dataItem.text }}</h5>\n }\n @case (HeadingType.Heading6) {\n <h6 class=\"m-0 text-xs font-bold\">{{ dataItem.text }}</h6>\n }\n @case (HeadingType.Paragraph) {\n <p class=\"m-0 text-sm\">{{ dataItem.text }}</p>\n }\n @default {\n <p class=\"m-0 text-sm\">{{ dataItem.text }}</p>\n }\n }\n </ng-template>\n</mona-dropdown-list>\n" }]
|
|
985
1071
|
}] });
|
|
986
1072
|
|
|
987
1073
|
class EditorHistoryComponent {
|
|
988
1074
|
constructor() {
|
|
989
1075
|
this.#editorService = inject(EditorService);
|
|
1076
|
+
this.#i18n = inject(MonaI18nService);
|
|
1077
|
+
this.messages = this.#i18n.componentMessages("editor", EDITOR_DEFAULT_MESSAGES);
|
|
990
1078
|
this.redoDisabled = computed(() => {
|
|
991
1079
|
this.#editorService.state();
|
|
992
1080
|
return !this.#editorService.editor.can().redo();
|
|
@@ -999,6 +1087,7 @@ class EditorHistoryComponent {
|
|
|
999
1087
|
...(ngDevMode ? [{ debugName: "undoDisabled" }] : /* istanbul ignore next */ []));
|
|
1000
1088
|
}
|
|
1001
1089
|
#editorService;
|
|
1090
|
+
#i18n;
|
|
1002
1091
|
onRedoClick() {
|
|
1003
1092
|
this.#editorService.editor.chain().focus().redo().run();
|
|
1004
1093
|
}
|
|
@@ -1006,28 +1095,36 @@ class EditorHistoryComponent {
|
|
|
1006
1095
|
this.#editorService.editor.chain().focus().undo().run();
|
|
1007
1096
|
}
|
|
1008
1097
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorHistoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1009
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorHistoryComponent, isStandalone: true, selector: "mona-editor-history", ngImport: i0, template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button monaButton [disabled]=\"undoDisabled()\" (click)=\"onUndoClick()\" title=\"
|
|
1098
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorHistoryComponent, isStandalone: true, selector: "mona-editor-history", ngImport: i0, template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button monaButton [disabled]=\"undoDisabled()\" (click)=\"onUndoClick()\" [title]=\"messages().undo\">\n <i class=\"ri-arrow-go-back-line\"></i>\n </button>\n <button monaButton [disabled]=\"redoDisabled()\" (click)=\"onRedoClick()\" [title]=\"messages().redo\">\n <i class=\"ri-arrow-go-forward-line\"></i>\n </button>\n</mona-button-group>\n", dependencies: [{ kind: "component", type: ButtonGroupComponent, selector: "mona-button-group", inputs: ["allowEmpty", "aria-label", "disabled", "look", "rounded", "selection", "size", "class"], outputs: ["buttonClick", "disabledChange", "selectionChange"] }, { kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }] }); }
|
|
1010
1099
|
}
|
|
1011
1100
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorHistoryComponent, decorators: [{
|
|
1012
1101
|
type: Component,
|
|
1013
|
-
args: [{ selector: "mona-editor-history", imports: [ButtonGroupComponent, ButtonDirective], template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button monaButton [disabled]=\"undoDisabled()\" (click)=\"onUndoClick()\" title=\"
|
|
1102
|
+
args: [{ selector: "mona-editor-history", imports: [ButtonGroupComponent, ButtonDirective], template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button monaButton [disabled]=\"undoDisabled()\" (click)=\"onUndoClick()\" [title]=\"messages().undo\">\n <i class=\"ri-arrow-go-back-line\"></i>\n </button>\n <button monaButton [disabled]=\"redoDisabled()\" (click)=\"onRedoClick()\" [title]=\"messages().redo\">\n <i class=\"ri-arrow-go-forward-line\"></i>\n </button>\n</mona-button-group>\n" }]
|
|
1014
1103
|
}] });
|
|
1015
1104
|
|
|
1016
1105
|
class EditorHorizontalRuleComponent {
|
|
1017
|
-
|
|
1106
|
+
constructor() {
|
|
1107
|
+
this.#editorService = inject(EditorService);
|
|
1108
|
+
this.#i18n = inject(MonaI18nService);
|
|
1109
|
+
this.messages = this.#i18n.componentMessages("editor", EDITOR_DEFAULT_MESSAGES);
|
|
1110
|
+
}
|
|
1111
|
+
#editorService;
|
|
1112
|
+
#i18n;
|
|
1018
1113
|
onHorizontalRuleClick() {
|
|
1019
1114
|
this.#editorService.editor.chain().focus().setHorizontalRule().run();
|
|
1020
1115
|
}
|
|
1021
1116
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorHorizontalRuleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1022
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorHorizontalRuleComponent, isStandalone: true, selector: "mona-editor-horizontal-rule", ngImport: i0, template: "<button monaButton [size]=\"'small'\" (click)=\"onHorizontalRuleClick()\" title=\"
|
|
1117
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorHorizontalRuleComponent, isStandalone: true, selector: "mona-editor-horizontal-rule", ngImport: i0, template: "<button monaButton [size]=\"'small'\" (click)=\"onHorizontalRuleClick()\" [title]=\"messages().addHorizontalLine\">\n <i class=\"ri-subtract-line\"></i>\n</button>\n", dependencies: [{ kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }] }); }
|
|
1023
1118
|
}
|
|
1024
1119
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorHorizontalRuleComponent, decorators: [{
|
|
1025
1120
|
type: Component,
|
|
1026
|
-
args: [{ selector: "mona-editor-horizontal-rule", imports: [ButtonDirective], template: "<button monaButton [size]=\"'small'\" (click)=\"onHorizontalRuleClick()\" title=\"
|
|
1121
|
+
args: [{ selector: "mona-editor-horizontal-rule", imports: [ButtonDirective], template: "<button monaButton [size]=\"'small'\" (click)=\"onHorizontalRuleClick()\" [title]=\"messages().addHorizontalLine\">\n <i class=\"ri-subtract-line\"></i>\n</button>\n" }]
|
|
1027
1122
|
}] });
|
|
1028
1123
|
|
|
1029
1124
|
class EditorImageInserterComponent {
|
|
1030
1125
|
constructor() {
|
|
1126
|
+
this.#i18n = inject(MonaI18nService);
|
|
1127
|
+
this.messages = this.#i18n.componentMessages("editor", EDITOR_DEFAULT_MESSAGES);
|
|
1031
1128
|
this.#imageFormModel = signal({
|
|
1032
1129
|
alt: "",
|
|
1033
1130
|
height: null,
|
|
@@ -1058,6 +1155,7 @@ class EditorImageInserterComponent {
|
|
|
1058
1155
|
this.cancel = output();
|
|
1059
1156
|
this.insert = output();
|
|
1060
1157
|
}
|
|
1158
|
+
#i18n;
|
|
1061
1159
|
#imageFormModel;
|
|
1062
1160
|
onCancel() {
|
|
1063
1161
|
this.cancel.emit();
|
|
@@ -1071,20 +1169,23 @@ class EditorImageInserterComponent {
|
|
|
1071
1169
|
});
|
|
1072
1170
|
}
|
|
1073
1171
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorImageInserterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1074
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorImageInserterComponent, isStandalone: true, selector: "mona-editor-image-inserter", outputs: { cancel: "cancel", insert: "insert" }, ngImport: i0, template: "<form [formRoot]=\"iForm\" [class]=\"formClass()\">\n <div [class]=\"rowClass()\">\n <div [class]=\"rowLabelClass()\">
|
|
1172
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorImageInserterComponent, isStandalone: true, selector: "mona-editor-image-inserter", outputs: { cancel: "cancel", insert: "insert" }, ngImport: i0, template: "<form [formRoot]=\"iForm\" [class]=\"formClass()\">\n <div [class]=\"rowClass()\">\n <div [class]=\"rowLabelClass()\">{{ messages().imageUrl }}</div>\n <mona-text-box [size]=\"'small'\" [formField]=\"iForm.link\"></mona-text-box>\n </div>\n <div [class]=\"rowClass()\">\n <div [class]=\"rowLabelClass()\">{{ messages().altText }}</div>\n <mona-text-box [size]=\"'small'\" [formField]=\"iForm.alt\"></mona-text-box>\n </div>\n <div class=\"flex gap-2\">\n <div [class]=\"rowClass()\">\n <div [class]=\"rowLabelClass()\">{{ messages().widthPx }}</div>\n <mona-numeric-text-box [size]=\"'small'\" [formField]=\"iForm.width\"></mona-numeric-text-box>\n </div>\n <div [class]=\"rowClass()\">\n <div [class]=\"rowLabelClass()\">{{ messages().heightPx }}</div>\n <mona-numeric-text-box [size]=\"'small'\" [formField]=\"iForm.height\"></mona-numeric-text-box>\n </div>\n </div>\n <div [class]=\"actionsClass()\">\n <button monaButton [size]=\"'small'\" [disabled]=\"!iForm().valid()\" look=\"primary\" (click)=\"onImageInsert()\">\n {{ messages().insert }}\n </button>\n <button monaButton [size]=\"'small'\" [look]=\"'secondary'\" (click)=\"onCancel()\">{{ messages().cancel }}</button>\n </div>\n</form>\n", dependencies: [{ kind: "component", type: TextBoxComponent, selector: "mona-text-box", inputs: ["clearButton", "disabled", "inputAttributes", "inputClass", "inputStyle", "invalid", "placeholder", "readonly", "required", "rounded", "size", "touched", "type", "class", "value"], outputs: ["inputBlur", "inputFocus", "touch", "valueChange"] }, { kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "component", type: NumericTextBoxComponent, selector: "mona-numeric-text-box", inputs: ["aria-label", "decimals", "disabled", "formatter", "invalid", "maxValue", "minValue", "nullable", "readonly", "required", "rounded", "size", "spinners", "step", "tabindex", "touched", "class", "value"], outputs: ["inputBlur", "inputFocus", "inputFocusOut", "touch", "valueChange"] }, { kind: "directive", type: FormRoot, selector: "form[formRoot]", inputs: ["formRoot"] }, { kind: "directive", type: FormField, selector: "[formField]", inputs: ["formField"], exportAs: ["formField"] }] }); }
|
|
1075
1173
|
}
|
|
1076
1174
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorImageInserterComponent, decorators: [{
|
|
1077
1175
|
type: Component,
|
|
1078
|
-
args: [{ selector: "mona-editor-image-inserter", imports: [TextBoxComponent, ButtonDirective, NumericTextBoxComponent, FormRoot, FormField], template: "<form [formRoot]=\"iForm\" [class]=\"formClass()\">\n <div [class]=\"rowClass()\">\n <div [class]=\"rowLabelClass()\">
|
|
1176
|
+
args: [{ selector: "mona-editor-image-inserter", imports: [TextBoxComponent, ButtonDirective, NumericTextBoxComponent, FormRoot, FormField], template: "<form [formRoot]=\"iForm\" [class]=\"formClass()\">\n <div [class]=\"rowClass()\">\n <div [class]=\"rowLabelClass()\">{{ messages().imageUrl }}</div>\n <mona-text-box [size]=\"'small'\" [formField]=\"iForm.link\"></mona-text-box>\n </div>\n <div [class]=\"rowClass()\">\n <div [class]=\"rowLabelClass()\">{{ messages().altText }}</div>\n <mona-text-box [size]=\"'small'\" [formField]=\"iForm.alt\"></mona-text-box>\n </div>\n <div class=\"flex gap-2\">\n <div [class]=\"rowClass()\">\n <div [class]=\"rowLabelClass()\">{{ messages().widthPx }}</div>\n <mona-numeric-text-box [size]=\"'small'\" [formField]=\"iForm.width\"></mona-numeric-text-box>\n </div>\n <div [class]=\"rowClass()\">\n <div [class]=\"rowLabelClass()\">{{ messages().heightPx }}</div>\n <mona-numeric-text-box [size]=\"'small'\" [formField]=\"iForm.height\"></mona-numeric-text-box>\n </div>\n </div>\n <div [class]=\"actionsClass()\">\n <button monaButton [size]=\"'small'\" [disabled]=\"!iForm().valid()\" look=\"primary\" (click)=\"onImageInsert()\">\n {{ messages().insert }}\n </button>\n <button monaButton [size]=\"'small'\" [look]=\"'secondary'\" (click)=\"onCancel()\">{{ messages().cancel }}</button>\n </div>\n</form>\n" }]
|
|
1079
1177
|
}], propDecorators: { cancel: [{ type: i0.Output, args: ["cancel"] }], insert: [{ type: i0.Output, args: ["insert"] }] } });
|
|
1080
1178
|
|
|
1081
1179
|
class EditorImageComponent {
|
|
1082
1180
|
constructor() {
|
|
1083
1181
|
this.#editorService = inject(EditorService);
|
|
1182
|
+
this.#i18n = inject(MonaI18nService);
|
|
1183
|
+
this.messages = this.#i18n.componentMessages("editor", EDITOR_DEFAULT_MESSAGES);
|
|
1084
1184
|
this.inserterVisible = signal(false, /* @ts-ignore */
|
|
1085
1185
|
...(ngDevMode ? [{ debugName: "inserterVisible" }] : /* istanbul ignore next */ []));
|
|
1086
1186
|
}
|
|
1087
1187
|
#editorService;
|
|
1188
|
+
#i18n;
|
|
1088
1189
|
onDisplayInserterClick() {
|
|
1089
1190
|
this.inserterVisible.set(true);
|
|
1090
1191
|
}
|
|
@@ -1116,16 +1217,18 @@ class EditorImageComponent {
|
|
|
1116
1217
|
.run();
|
|
1117
1218
|
}
|
|
1118
1219
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorImageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1119
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: EditorImageComponent, isStandalone: true, selector: "mona-editor-image", ngImport: i0, template: "<button monaButton [size]=\"'small'\" (click)=\"onDisplayInserterClick()\" title=\"
|
|
1220
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: EditorImageComponent, isStandalone: true, selector: "mona-editor-image", ngImport: i0, template: "<button monaButton [size]=\"'small'\" (click)=\"onDisplayInserterClick()\" [title]=\"messages().insertImage\">\n <i class=\"ri-image-add-line\"></i>\n</button>\n\n@if (inserterVisible()) {\n <mona-window\n [width]=\"400\"\n [modal]=\"false\"\n [title]=\"messages().insertImage\"\n [minimizable]=\"false\"\n [maximizable]=\"false\"\n (close)=\"onInserterClose()\">\n <ng-template monaWindowContentTemplate>\n <mona-editor-image-inserter\n (insert)=\"onImageInsert($event)\"\n (cancel)=\"onInsertCancel()\"></mona-editor-image-inserter>\n </ng-template>\n </mona-window>\n}\n", dependencies: [{ kind: "component", type: WindowComponent, selector: "mona-window", inputs: ["closable", "closeOnEscape", "draggable", "focusedElement", "height", "left", "look", "maxHeight", "maxWidth", "maximizable", "messages", "minHeight", "minWidth", "minimizable", "modal", "resizable", "rounded", "title", "top", "width"], outputs: ["close", "closed", "dragEnd", "dragStart", "heightChange", "leftChange", "topChange", "widthChange"] }, { kind: "component", type: EditorImageInserterComponent, selector: "mona-editor-image-inserter", outputs: ["cancel", "insert"] }, { kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "directive", type: WindowContentTemplateDirective, selector: "ng-template[monaWindowContentTemplate]" }] }); }
|
|
1120
1221
|
}
|
|
1121
1222
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorImageComponent, decorators: [{
|
|
1122
1223
|
type: Component,
|
|
1123
|
-
args: [{ selector: "mona-editor-image", imports: [WindowComponent, EditorImageInserterComponent, ButtonDirective, WindowContentTemplateDirective], template: "<button monaButton [size]=\"'small'\" (click)=\"onDisplayInserterClick()\" title=\"
|
|
1224
|
+
args: [{ selector: "mona-editor-image", imports: [WindowComponent, EditorImageInserterComponent, ButtonDirective, WindowContentTemplateDirective], template: "<button monaButton [size]=\"'small'\" (click)=\"onDisplayInserterClick()\" [title]=\"messages().insertImage\">\n <i class=\"ri-image-add-line\"></i>\n</button>\n\n@if (inserterVisible()) {\n <mona-window\n [width]=\"400\"\n [modal]=\"false\"\n [title]=\"messages().insertImage\"\n [minimizable]=\"false\"\n [maximizable]=\"false\"\n (close)=\"onInserterClose()\">\n <ng-template monaWindowContentTemplate>\n <mona-editor-image-inserter\n (insert)=\"onImageInsert($event)\"\n (cancel)=\"onInsertCancel()\"></mona-editor-image-inserter>\n </ng-template>\n </mona-window>\n}\n" }]
|
|
1124
1225
|
}] });
|
|
1125
1226
|
|
|
1126
1227
|
class EditorIndentComponent {
|
|
1127
1228
|
constructor() {
|
|
1128
1229
|
this.#editorService = inject(EditorService);
|
|
1230
|
+
this.#i18n = inject(MonaI18nService);
|
|
1231
|
+
this.messages = this.#i18n.componentMessages("editor", EDITOR_DEFAULT_MESSAGES);
|
|
1129
1232
|
this.indentDisabled = computed(() => {
|
|
1130
1233
|
this.#editorService.state();
|
|
1131
1234
|
return !this.#editorService.editor.can().indent();
|
|
@@ -1138,6 +1241,7 @@ class EditorIndentComponent {
|
|
|
1138
1241
|
...(ngDevMode ? [{ debugName: "outdentDisabled" }] : /* istanbul ignore next */ []));
|
|
1139
1242
|
}
|
|
1140
1243
|
#editorService;
|
|
1244
|
+
#i18n;
|
|
1141
1245
|
onIndentClick() {
|
|
1142
1246
|
this.#editorService.editor.chain().focus().indent().run();
|
|
1143
1247
|
}
|
|
@@ -1145,17 +1249,19 @@ class EditorIndentComponent {
|
|
|
1145
1249
|
this.#editorService.editor.chain().focus().outdent().run();
|
|
1146
1250
|
}
|
|
1147
1251
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorIndentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1148
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorIndentComponent, isStandalone: true, selector: "mona-editor-indent", ngImport: i0, template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button monaButton [disabled]=\"indentDisabled()\" (click)=\"onIndentClick()\" title=\"
|
|
1252
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorIndentComponent, isStandalone: true, selector: "mona-editor-indent", ngImport: i0, template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button monaButton [disabled]=\"indentDisabled()\" (click)=\"onIndentClick()\" [title]=\"messages().indent\">\n <i class=\"ri-indent-increase\"></i>\n </button>\n <button monaButton [disabled]=\"outdentDisabled()\" (click)=\"onOutdentClick()\" [title]=\"messages().outdent\">\n <i class=\"ri-indent-decrease\"></i>\n </button>\n</mona-button-group>\n", dependencies: [{ kind: "component", type: ButtonGroupComponent, selector: "mona-button-group", inputs: ["allowEmpty", "aria-label", "disabled", "look", "rounded", "selection", "size", "class"], outputs: ["buttonClick", "disabledChange", "selectionChange"] }, { kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }] }); }
|
|
1149
1253
|
}
|
|
1150
1254
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorIndentComponent, decorators: [{
|
|
1151
1255
|
type: Component,
|
|
1152
|
-
args: [{ selector: "mona-editor-indent", imports: [ButtonGroupComponent, ButtonDirective], template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button monaButton [disabled]=\"indentDisabled()\" (click)=\"onIndentClick()\" title=\"
|
|
1256
|
+
args: [{ selector: "mona-editor-indent", imports: [ButtonGroupComponent, ButtonDirective], template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button monaButton [disabled]=\"indentDisabled()\" (click)=\"onIndentClick()\" [title]=\"messages().indent\">\n <i class=\"ri-indent-increase\"></i>\n </button>\n <button monaButton [disabled]=\"outdentDisabled()\" (click)=\"onOutdentClick()\" [title]=\"messages().outdent\">\n <i class=\"ri-indent-decrease\"></i>\n </button>\n</mona-button-group>\n" }]
|
|
1153
1257
|
}] });
|
|
1154
1258
|
|
|
1155
1259
|
class EditorLinkComponent {
|
|
1156
1260
|
constructor() {
|
|
1157
1261
|
this.#dialogService = inject(DialogService);
|
|
1158
1262
|
this.#editorService = inject(EditorService);
|
|
1263
|
+
this.#i18n = inject(MonaI18nService);
|
|
1264
|
+
this.messages = this.#i18n.componentMessages("editor", EDITOR_DEFAULT_MESSAGES);
|
|
1159
1265
|
this.linkSelected = computed(() => {
|
|
1160
1266
|
this.#editorService.state();
|
|
1161
1267
|
return this.#editorService.editor.isActive("link");
|
|
@@ -1169,13 +1275,14 @@ class EditorLinkComponent {
|
|
|
1169
1275
|
}
|
|
1170
1276
|
#dialogService;
|
|
1171
1277
|
#editorService;
|
|
1278
|
+
#i18n;
|
|
1172
1279
|
onLinkDialogDisplay() {
|
|
1173
1280
|
const link = this.#editorService.editor.getAttributes("link")["href"] ?? "";
|
|
1174
1281
|
const dialogRef = this.#dialogService.show({
|
|
1175
|
-
title:
|
|
1282
|
+
title: this.messages().insertLink,
|
|
1176
1283
|
type: "info",
|
|
1177
1284
|
// inputType: "string",
|
|
1178
|
-
text:
|
|
1285
|
+
text: this.messages().enterUrl
|
|
1179
1286
|
// value: link
|
|
1180
1287
|
});
|
|
1181
1288
|
// dialogRef.result.pipe(take(1)).subscribe(result => this.setLink(result.value as string));
|
|
@@ -1191,16 +1298,18 @@ class EditorLinkComponent {
|
|
|
1191
1298
|
this.#editorService.editor.chain().focus().extendMarkRange("link").setLink({ href: url }).run();
|
|
1192
1299
|
}
|
|
1193
1300
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorLinkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1194
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorLinkComponent, isStandalone: true, selector: "mona-editor-link", ngImport: i0, template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button\n monaButton\n [selected]=\"linkSelected()\"\n [toggleable]=\"false\"\n (click)=\"onLinkDialogDisplay()\"\n title=\"
|
|
1301
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorLinkComponent, isStandalone: true, selector: "mona-editor-link", ngImport: i0, template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button\n monaButton\n [selected]=\"linkSelected()\"\n [toggleable]=\"false\"\n (click)=\"onLinkDialogDisplay()\"\n [title]=\"messages().insertLink\">\n <i class=\"ri-link-m\"></i>\n </button>\n <button monaButton [disabled]=\"unlinkDisabled()\" (click)=\"onUnlinkClick()\" [title]=\"messages().removeLink\">\n <i class=\"ri-link-unlink-m\"></i>\n </button>\n</mona-button-group>\n", dependencies: [{ kind: "component", type: ButtonGroupComponent, selector: "mona-button-group", inputs: ["allowEmpty", "aria-label", "disabled", "look", "rounded", "selection", "size", "class"], outputs: ["buttonClick", "disabledChange", "selectionChange"] }, { kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }] }); }
|
|
1195
1302
|
}
|
|
1196
1303
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorLinkComponent, decorators: [{
|
|
1197
1304
|
type: Component,
|
|
1198
|
-
args: [{ selector: "mona-editor-link", imports: [ButtonGroupComponent, ButtonDirective], template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button\n monaButton\n [selected]=\"linkSelected()\"\n [toggleable]=\"false\"\n (click)=\"onLinkDialogDisplay()\"\n title=\"
|
|
1305
|
+
args: [{ selector: "mona-editor-link", imports: [ButtonGroupComponent, ButtonDirective], template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button\n monaButton\n [selected]=\"linkSelected()\"\n [toggleable]=\"false\"\n (click)=\"onLinkDialogDisplay()\"\n [title]=\"messages().insertLink\">\n <i class=\"ri-link-m\"></i>\n </button>\n <button monaButton [disabled]=\"unlinkDisabled()\" (click)=\"onUnlinkClick()\" [title]=\"messages().removeLink\">\n <i class=\"ri-link-unlink-m\"></i>\n </button>\n</mona-button-group>\n" }]
|
|
1199
1306
|
}] });
|
|
1200
1307
|
|
|
1201
1308
|
class EditorListComponent {
|
|
1202
1309
|
constructor() {
|
|
1203
1310
|
this.#editorService = inject(EditorService);
|
|
1311
|
+
this.#i18n = inject(MonaI18nService);
|
|
1312
|
+
this.messages = this.#i18n.componentMessages("editor", EDITOR_DEFAULT_MESSAGES);
|
|
1204
1313
|
this.orderedListSelected = computed(() => {
|
|
1205
1314
|
this.#editorService.state();
|
|
1206
1315
|
return this.#editorService.editor.isActive("orderedList");
|
|
@@ -1213,6 +1322,7 @@ class EditorListComponent {
|
|
|
1213
1322
|
...(ngDevMode ? [{ debugName: "unorderedListSelected" }] : /* istanbul ignore next */ []));
|
|
1214
1323
|
}
|
|
1215
1324
|
#editorService;
|
|
1325
|
+
#i18n;
|
|
1216
1326
|
onOrderedListToggle() {
|
|
1217
1327
|
this.#editorService.editor.chain().focus().toggleOrderedList().run();
|
|
1218
1328
|
}
|
|
@@ -1220,11 +1330,11 @@ class EditorListComponent {
|
|
|
1220
1330
|
this.#editorService.editor.chain().focus().toggleBulletList().run();
|
|
1221
1331
|
}
|
|
1222
1332
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1223
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorListComponent, isStandalone: true, selector: "mona-editor-list", ngImport: i0, template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button\n monaButton\n [selected]=\"unorderedListSelected()\"\n [toggleable]=\"false\"\n (click)=\"onUnorderedListToggle()\"\n title=\"
|
|
1333
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorListComponent, isStandalone: true, selector: "mona-editor-list", ngImport: i0, template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button\n monaButton\n [selected]=\"unorderedListSelected()\"\n [toggleable]=\"false\"\n (click)=\"onUnorderedListToggle()\"\n [title]=\"messages().insertUnorderedList\">\n <i class=\"ri-list-unordered\"></i>\n </button>\n <button\n monaButton\n [selected]=\"orderedListSelected()\"\n [toggleable]=\"false\"\n (click)=\"onOrderedListToggle()\"\n [title]=\"messages().insertOrderedList\">\n <i class=\"ri-list-ordered-2\"></i>\n </button>\n</mona-button-group>\n", dependencies: [{ kind: "component", type: ButtonGroupComponent, selector: "mona-button-group", inputs: ["allowEmpty", "aria-label", "disabled", "look", "rounded", "selection", "size", "class"], outputs: ["buttonClick", "disabledChange", "selectionChange"] }, { kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }] }); }
|
|
1224
1334
|
}
|
|
1225
1335
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorListComponent, decorators: [{
|
|
1226
1336
|
type: Component,
|
|
1227
|
-
args: [{ selector: "mona-editor-list", imports: [ButtonGroupComponent, ButtonDirective], template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button\n monaButton\n [selected]=\"unorderedListSelected()\"\n [toggleable]=\"false\"\n (click)=\"onUnorderedListToggle()\"\n title=\"
|
|
1337
|
+
args: [{ selector: "mona-editor-list", imports: [ButtonGroupComponent, ButtonDirective], template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button\n monaButton\n [selected]=\"unorderedListSelected()\"\n [toggleable]=\"false\"\n (click)=\"onUnorderedListToggle()\"\n [title]=\"messages().insertUnorderedList\">\n <i class=\"ri-list-unordered\"></i>\n </button>\n <button\n monaButton\n [selected]=\"orderedListSelected()\"\n [toggleable]=\"false\"\n (click)=\"onOrderedListToggle()\"\n [title]=\"messages().insertOrderedList\">\n <i class=\"ri-list-ordered-2\"></i>\n </button>\n</mona-button-group>\n" }]
|
|
1228
1338
|
}] });
|
|
1229
1339
|
|
|
1230
1340
|
class EditorTableCreatorComponent {
|
|
@@ -1261,6 +1371,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
1261
1371
|
class EditorTableComponent {
|
|
1262
1372
|
constructor() {
|
|
1263
1373
|
this.#editorService = inject(EditorService);
|
|
1374
|
+
this.#i18n = inject(MonaI18nService);
|
|
1375
|
+
this.messages = this.#i18n.componentMessages("editor", EDITOR_DEFAULT_MESSAGES);
|
|
1264
1376
|
this.addColumnBeforeDisabled = computed(() => {
|
|
1265
1377
|
this.#editorService.state();
|
|
1266
1378
|
const isTable = this.#editorService.editor.isActive("table");
|
|
@@ -1335,6 +1447,7 @@ class EditorTableComponent {
|
|
|
1335
1447
|
...(ngDevMode ? [{ debugName: "toggleHeaderRowDisabled" }] : /* istanbul ignore next */ []));
|
|
1336
1448
|
}
|
|
1337
1449
|
#editorService;
|
|
1450
|
+
#i18n;
|
|
1338
1451
|
onAddColumnBeforeClick() {
|
|
1339
1452
|
this.#editorService.editor.chain().focus().addColumnBefore().run();
|
|
1340
1453
|
}
|
|
@@ -1373,16 +1486,18 @@ class EditorTableComponent {
|
|
|
1373
1486
|
this.#editorService.editor.chain().focus().toggleHeaderRow().run();
|
|
1374
1487
|
}
|
|
1375
1488
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1376
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.6", type: EditorTableComponent, isStandalone: true, selector: "mona-editor-table", viewQueries: [{ propertyName: "popover", first: true, predicate: ["popoverComponent"], descendants: true, isSignal: true }], ngImport: i0, template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button monaButton title=\"
|
|
1489
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.6", type: EditorTableComponent, isStandalone: true, selector: "mona-editor-table", viewQueries: [{ propertyName: "popover", first: true, predicate: ["popoverComponent"], descendants: true, isSignal: true }], ngImport: i0, template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button monaButton [title]=\"messages().insertTable\" #insertTableButton>\n <i class=\"ri-grid-line\"></i>\n </button>\n <button\n monaButton\n [disabled]=\"addColumnBeforeDisabled()\"\n (click)=\"onAddColumnBeforeClick()\"\n [title]=\"messages().addColumnBefore\">\n <i class=\"ri-insert-column-left\"></i>\n </button>\n <button monaButton [disabled]=\"addColumnAfterDisabled()\" (click)=\"onAddColumnAfterClick()\" [title]=\"messages().addColumnAfter\">\n <i class=\"ri-insert-column-right\"></i>\n </button>\n <button monaButton [disabled]=\"addRowBeforeDisabled()\" (click)=\"onAddRowBeforeClick()\" [title]=\"messages().addRowBefore\">\n <i class=\"ri-insert-row-top\"></i>\n </button>\n <button monaButton [disabled]=\"addRowAfterDisabled()\" (click)=\"onAddRowAfterClick()\" [title]=\"messages().addRowAfter\">\n <i class=\"ri-insert-row-bottom\"></i>\n </button>\n <button monaButton [disabled]=\"deleteColumnDisabled()\" (click)=\"onDeleteColumnClick()\" [title]=\"messages().deleteColumn\">\n <i class=\"ri-delete-column\"></i>\n </button>\n <button monaButton [disabled]=\"deleteRowDisabled()\" (click)=\"onDeleteRowClick()\" [title]=\"messages().deleteRow\">\n <i class=\"ri-delete-row\"></i>\n </button>\n <button monaButton [disabled]=\"mergeCellsDisabled()\" (click)=\"onMergeCellsClick()\" [title]=\"messages().mergeCells\">\n <i class=\"ri-merge-cells-horizontal\"></i>\n </button>\n <button monaButton [disabled]=\"splitCellDisabled()\" (click)=\"onSplitCellClick()\" [title]=\"messages().splitCell\">\n <i class=\"ri-split-cells-horizontal\"></i>\n </button>\n <button monaButton [disabled]=\"toggleHeaderRowDisabled()\" (click)=\"onToggleHeaderRow()\" [title]=\"messages().toggleHeaderRow\">\n <i class=\"ri-table-line\"></i>\n </button>\n <button monaButton [disabled]=\"deleteTableDisabled()\" (click)=\"onDeleteTableClick()\" [title]=\"messages().deleteTable\">\n <i class=\"ri-close-large-line\"></i>\n </button>\n</mona-button-group>\n\n<mona-popover [target]=\"insertTableButton\" position=\"bottom\" #popoverComponent>\n <mona-editor-table-creator (insert)=\"onTableInsert($event)\"></mona-editor-table-creator>\n</mona-popover>\n", dependencies: [{ kind: "component", type: ButtonGroupComponent, selector: "mona-button-group", inputs: ["allowEmpty", "aria-label", "disabled", "look", "rounded", "selection", "size", "class"], outputs: ["buttonClick", "disabledChange", "selectionChange"] }, { kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "component", type: PopoverComponent, selector: "mona-popover", inputs: ["displayArrow", "position", "rounded", "target", "title", "trigger"], outputs: ["hide", "hidden", "show", "shown"], exportAs: ["monaPopover"] }, { kind: "component", type: EditorTableCreatorComponent, selector: "mona-editor-table-creator", outputs: ["insert"] }] }); }
|
|
1377
1490
|
}
|
|
1378
1491
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorTableComponent, decorators: [{
|
|
1379
1492
|
type: Component,
|
|
1380
|
-
args: [{ selector: "mona-editor-table", imports: [ButtonGroupComponent, ButtonDirective, PopoverComponent, EditorTableCreatorComponent], template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button monaButton title=\"
|
|
1493
|
+
args: [{ selector: "mona-editor-table", imports: [ButtonGroupComponent, ButtonDirective, PopoverComponent, EditorTableCreatorComponent], template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button monaButton [title]=\"messages().insertTable\" #insertTableButton>\n <i class=\"ri-grid-line\"></i>\n </button>\n <button\n monaButton\n [disabled]=\"addColumnBeforeDisabled()\"\n (click)=\"onAddColumnBeforeClick()\"\n [title]=\"messages().addColumnBefore\">\n <i class=\"ri-insert-column-left\"></i>\n </button>\n <button monaButton [disabled]=\"addColumnAfterDisabled()\" (click)=\"onAddColumnAfterClick()\" [title]=\"messages().addColumnAfter\">\n <i class=\"ri-insert-column-right\"></i>\n </button>\n <button monaButton [disabled]=\"addRowBeforeDisabled()\" (click)=\"onAddRowBeforeClick()\" [title]=\"messages().addRowBefore\">\n <i class=\"ri-insert-row-top\"></i>\n </button>\n <button monaButton [disabled]=\"addRowAfterDisabled()\" (click)=\"onAddRowAfterClick()\" [title]=\"messages().addRowAfter\">\n <i class=\"ri-insert-row-bottom\"></i>\n </button>\n <button monaButton [disabled]=\"deleteColumnDisabled()\" (click)=\"onDeleteColumnClick()\" [title]=\"messages().deleteColumn\">\n <i class=\"ri-delete-column\"></i>\n </button>\n <button monaButton [disabled]=\"deleteRowDisabled()\" (click)=\"onDeleteRowClick()\" [title]=\"messages().deleteRow\">\n <i class=\"ri-delete-row\"></i>\n </button>\n <button monaButton [disabled]=\"mergeCellsDisabled()\" (click)=\"onMergeCellsClick()\" [title]=\"messages().mergeCells\">\n <i class=\"ri-merge-cells-horizontal\"></i>\n </button>\n <button monaButton [disabled]=\"splitCellDisabled()\" (click)=\"onSplitCellClick()\" [title]=\"messages().splitCell\">\n <i class=\"ri-split-cells-horizontal\"></i>\n </button>\n <button monaButton [disabled]=\"toggleHeaderRowDisabled()\" (click)=\"onToggleHeaderRow()\" [title]=\"messages().toggleHeaderRow\">\n <i class=\"ri-table-line\"></i>\n </button>\n <button monaButton [disabled]=\"deleteTableDisabled()\" (click)=\"onDeleteTableClick()\" [title]=\"messages().deleteTable\">\n <i class=\"ri-close-large-line\"></i>\n </button>\n</mona-button-group>\n\n<mona-popover [target]=\"insertTableButton\" position=\"bottom\" #popoverComponent>\n <mona-editor-table-creator (insert)=\"onTableInsert($event)\"></mona-editor-table-creator>\n</mona-popover>\n" }]
|
|
1381
1494
|
}], propDecorators: { popover: [{ type: i0.ViewChild, args: ["popoverComponent", { isSignal: true }] }] } });
|
|
1382
1495
|
|
|
1383
1496
|
class EditorTaskListComponent {
|
|
1384
1497
|
constructor() {
|
|
1385
1498
|
this.#editorService = inject(EditorService);
|
|
1499
|
+
this.#i18n = inject(MonaI18nService);
|
|
1500
|
+
this.messages = this.#i18n.componentMessages("editor", EDITOR_DEFAULT_MESSAGES);
|
|
1386
1501
|
this.taskSelected = computed(() => {
|
|
1387
1502
|
this.#editorService.state();
|
|
1388
1503
|
return this.#editorService.editor.isActive("taskItem");
|
|
@@ -1390,20 +1505,23 @@ class EditorTaskListComponent {
|
|
|
1390
1505
|
...(ngDevMode ? [{ debugName: "taskSelected" }] : /* istanbul ignore next */ []));
|
|
1391
1506
|
}
|
|
1392
1507
|
#editorService;
|
|
1508
|
+
#i18n;
|
|
1393
1509
|
onTaskToggle() {
|
|
1394
1510
|
this.#editorService.editor.chain().focus().toggleTaskList().run();
|
|
1395
1511
|
}
|
|
1396
1512
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorTaskListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1397
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorTaskListComponent, isStandalone: true, selector: "mona-editor-task-list", ngImport: i0, template: "<button monaButton [selected]=\"taskSelected()\" [size]=\"'small'\" (click)=\"onTaskToggle()\" title=\"
|
|
1513
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorTaskListComponent, isStandalone: true, selector: "mona-editor-task-list", ngImport: i0, template: "<button monaButton [selected]=\"taskSelected()\" [size]=\"'small'\" (click)=\"onTaskToggle()\" [title]=\"messages().insertTaskList\">\n <i class=\"ri-checkbox-fill\"></i>\n</button>\n", dependencies: [{ kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }] }); }
|
|
1398
1514
|
}
|
|
1399
1515
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorTaskListComponent, decorators: [{
|
|
1400
1516
|
type: Component,
|
|
1401
|
-
args: [{ selector: "mona-editor-task-list", imports: [ButtonDirective], template: "<button monaButton [selected]=\"taskSelected()\" [size]=\"'small'\" (click)=\"onTaskToggle()\" title=\"
|
|
1517
|
+
args: [{ selector: "mona-editor-task-list", imports: [ButtonDirective], template: "<button monaButton [selected]=\"taskSelected()\" [size]=\"'small'\" (click)=\"onTaskToggle()\" [title]=\"messages().insertTaskList\">\n <i class=\"ri-checkbox-fill\"></i>\n</button>\n" }]
|
|
1402
1518
|
}] });
|
|
1403
1519
|
|
|
1404
1520
|
class EditorTextAlignmentsComponent {
|
|
1405
1521
|
constructor() {
|
|
1406
1522
|
this.#editorService = inject(EditorService);
|
|
1523
|
+
this.#i18n = inject(MonaI18nService);
|
|
1524
|
+
this.messages = this.#i18n.componentMessages("editor", EDITOR_DEFAULT_MESSAGES);
|
|
1407
1525
|
this.alignCenterSelected = computed(() => {
|
|
1408
1526
|
this.#editorService.state();
|
|
1409
1527
|
return this.#editorService.editor.isActive({ textAlign: "center" });
|
|
@@ -1426,6 +1544,7 @@ class EditorTextAlignmentsComponent {
|
|
|
1426
1544
|
...(ngDevMode ? [{ debugName: "alignRightSelected" }] : /* istanbul ignore next */ []));
|
|
1427
1545
|
}
|
|
1428
1546
|
#editorService;
|
|
1547
|
+
#i18n;
|
|
1429
1548
|
onAlignCenter() {
|
|
1430
1549
|
if (this.alignCenterSelected()) {
|
|
1431
1550
|
this.#editorService.editor.chain().focus().unsetTextAlign().run();
|
|
@@ -1459,11 +1578,11 @@ class EditorTextAlignmentsComponent {
|
|
|
1459
1578
|
}
|
|
1460
1579
|
}
|
|
1461
1580
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorTextAlignmentsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1462
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorTextAlignmentsComponent, isStandalone: true, selector: "mona-editor-text-alignments", ngImport: i0, template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button\n monaButton\n [selected]=\"alignLeftSelected()\"\n [toggleable]=\"false\"\n (click)=\"onAlignLeft()\"\n title=\"
|
|
1581
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.6", type: EditorTextAlignmentsComponent, isStandalone: true, selector: "mona-editor-text-alignments", ngImport: i0, template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button\n monaButton\n [selected]=\"alignLeftSelected()\"\n [toggleable]=\"false\"\n (click)=\"onAlignLeft()\"\n [title]=\"messages().alignLeft\">\n <i class=\"ri-align-left\"></i>\n </button>\n <button\n monaButton\n [selected]=\"alignCenterSelected()\"\n [toggleable]=\"false\"\n (click)=\"onAlignCenter()\"\n [title]=\"messages().alignCenter\">\n <i class=\"ri-align-center\"></i>\n </button>\n <button\n monaButton\n [selected]=\"alignRightSelected()\"\n [toggleable]=\"false\"\n (click)=\"onAlignRight()\"\n [title]=\"messages().alignRight\">\n <i class=\"ri-align-right\"></i>\n </button>\n <button\n monaButton\n [selected]=\"alignJustifySelected()\"\n [toggleable]=\"false\"\n (click)=\"onAlignJustify()\"\n [title]=\"messages().justify\">\n <i class=\"ri-align-justify\"></i>\n </button>\n</mona-button-group>\n", dependencies: [{ kind: "component", type: ButtonGroupComponent, selector: "mona-button-group", inputs: ["allowEmpty", "aria-label", "disabled", "look", "rounded", "selection", "size", "class"], outputs: ["buttonClick", "disabledChange", "selectionChange"] }, { kind: "directive", type: ButtonDirective, selector: "button[monaButton]", inputs: ["aria-haspopup", "disabled", "iconOnly", "loading", "look", "rounded", "selected", "size", "tabindex", "type", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }] }); }
|
|
1463
1582
|
}
|
|
1464
1583
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorTextAlignmentsComponent, decorators: [{
|
|
1465
1584
|
type: Component,
|
|
1466
|
-
args: [{ selector: "mona-editor-text-alignments", imports: [ButtonGroupComponent, ButtonDirective], template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button\n monaButton\n [selected]=\"alignLeftSelected()\"\n [toggleable]=\"false\"\n (click)=\"onAlignLeft()\"\n title=\"
|
|
1585
|
+
args: [{ selector: "mona-editor-text-alignments", imports: [ButtonGroupComponent, ButtonDirective], template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button\n monaButton\n [selected]=\"alignLeftSelected()\"\n [toggleable]=\"false\"\n (click)=\"onAlignLeft()\"\n [title]=\"messages().alignLeft\">\n <i class=\"ri-align-left\"></i>\n </button>\n <button\n monaButton\n [selected]=\"alignCenterSelected()\"\n [toggleable]=\"false\"\n (click)=\"onAlignCenter()\"\n [title]=\"messages().alignCenter\">\n <i class=\"ri-align-center\"></i>\n </button>\n <button\n monaButton\n [selected]=\"alignRightSelected()\"\n [toggleable]=\"false\"\n (click)=\"onAlignRight()\"\n [title]=\"messages().alignRight\">\n <i class=\"ri-align-right\"></i>\n </button>\n <button\n monaButton\n [selected]=\"alignJustifySelected()\"\n [toggleable]=\"false\"\n (click)=\"onAlignJustify()\"\n [title]=\"messages().justify\">\n <i class=\"ri-align-justify\"></i>\n </button>\n</mona-button-group>\n" }]
|
|
1467
1586
|
}] });
|
|
1468
1587
|
|
|
1469
1588
|
class EditorComponent {
|
|
@@ -1617,5 +1736,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
1617
1736
|
* Generated bundle index. Do not edit.
|
|
1618
1737
|
*/
|
|
1619
1738
|
|
|
1620
|
-
export { EditorComponent };
|
|
1739
|
+
export { EDITOR_DEFAULT_MESSAGES, EditorComponent };
|
|
1621
1740
|
//# sourceMappingURL=nanahoshi-mona-ui-editor.mjs.map
|