@nanahoshi/mona-ui 0.1.0 → 0.1.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/nanahoshi-mona-ui-auto-complete.mjs +11 -11
- package/fesm2022/nanahoshi-mona-ui-breadcrumb.mjs +17 -17
- package/fesm2022/nanahoshi-mona-ui-button-group.mjs +26 -26
- package/fesm2022/nanahoshi-mona-ui-button.mjs +109 -107
- package/fesm2022/nanahoshi-mona-ui-calendar.mjs +53 -53
- package/fesm2022/nanahoshi-mona-ui-check-box.mjs +80 -80
- package/fesm2022/nanahoshi-mona-ui-chip.mjs +98 -98
- package/fesm2022/nanahoshi-mona-ui-circular-progress-bar.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-color-gradient.mjs +38 -38
- package/fesm2022/nanahoshi-mona-ui-color-palette.mjs +25 -25
- package/fesm2022/nanahoshi-mona-ui-color-picker.mjs +41 -37
- package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +17 -19
- package/fesm2022/nanahoshi-mona-ui-date-input.mjs +6 -6
- package/fesm2022/nanahoshi-mona-ui-date-picker.mjs +11 -13
- package/fesm2022/nanahoshi-mona-ui-datetime-picker.mjs +18 -20
- package/fesm2022/nanahoshi-mona-ui-dialog.mjs +40 -40
- package/fesm2022/nanahoshi-mona-ui-dropdown-list.mjs +14 -16
- package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +52 -52
- package/fesm2022/nanahoshi-mona-ui-editor.mjs +462 -81
- package/fesm2022/nanahoshi-mona-ui-expansion-panel.mjs +26 -26
- package/fesm2022/nanahoshi-mona-ui-fieldset.mjs +8 -8
- package/fesm2022/nanahoshi-mona-ui-filter.mjs +14 -14
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-cell.component-B9SQH5N-.mjs → nanahoshi-mona-ui-grid-grid-footer-cell.component-B2ETh-uI.mjs} +14 -14
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-DlLwcCFT.mjs → nanahoshi-mona-ui-grid-grid-footer-table-cell.directive-DZk18LJC.mjs} +2 -2
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-C7WKhhig.mjs +128 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-grid-toggle.component-DIUutx9s.mjs → nanahoshi-mona-ui-grid-grid-toggle.component-BRiY0CDX.mjs} +13 -13
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-BrYpFMyF.mjs +240 -0
- package/fesm2022/{nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-C3eZIaJK.mjs → nanahoshi-mona-ui-grid-nanahoshi-mona-ui-grid-T9Bj98kl.mjs} +120 -120
- package/fesm2022/nanahoshi-mona-ui-grid.mjs +1 -1
- package/fesm2022/nanahoshi-mona-ui-internal-list.mjs +81 -81
- package/fesm2022/nanahoshi-mona-ui-internal-tree.mjs +35 -35
- package/fesm2022/nanahoshi-mona-ui-list-box.mjs +8 -8
- package/fesm2022/nanahoshi-mona-ui-list-view.mjs +7 -7
- package/fesm2022/nanahoshi-mona-ui-menubar.mjs +50 -50
- package/fesm2022/nanahoshi-mona-ui-multi-select.mjs +12 -14
- package/fesm2022/nanahoshi-mona-ui-notification.mjs +24 -24
- package/fesm2022/nanahoshi-mona-ui-numeric-text-box.mjs +69 -69
- package/fesm2022/nanahoshi-mona-ui-pager.mjs +29 -29
- package/fesm2022/nanahoshi-mona-ui-placeholder.mjs +9 -9
- package/fesm2022/nanahoshi-mona-ui-popover.mjs +12 -12
- package/fesm2022/nanahoshi-mona-ui-popup-menu.mjs +26 -26
- package/fesm2022/nanahoshi-mona-ui-popup.mjs +4 -4
- package/fesm2022/nanahoshi-mona-ui-progress-bar.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-radio-button.mjs +55 -55
- package/fesm2022/nanahoshi-mona-ui-scroll-view.mjs +49 -49
- package/fesm2022/nanahoshi-mona-ui-slider.mjs +96 -96
- package/fesm2022/nanahoshi-mona-ui-split-button.mjs +30 -30
- package/fesm2022/nanahoshi-mona-ui-splitter.mjs +24 -24
- package/fesm2022/nanahoshi-mona-ui-stepper.mjs +29 -29
- package/fesm2022/nanahoshi-mona-ui-switch.mjs +42 -42
- package/fesm2022/nanahoshi-mona-ui-tabs.mjs +35 -39
- package/fesm2022/nanahoshi-mona-ui-text-area.mjs +22 -22
- package/fesm2022/nanahoshi-mona-ui-text-box.mjs +54 -54
- package/fesm2022/nanahoshi-mona-ui-time-picker.mjs +11 -19
- package/fesm2022/nanahoshi-mona-ui-time-selector.mjs +29 -29
- package/fesm2022/nanahoshi-mona-ui-tooltip.mjs +51 -51
- package/fesm2022/nanahoshi-mona-ui-tree-view.mjs +2 -2
- package/fesm2022/nanahoshi-mona-ui-window.mjs +27 -28
- package/package.json +30 -5
- package/types/nanahoshi-mona-ui-button.d.ts +4 -3
- package/types/nanahoshi-mona-ui-color-picker.d.ts +0 -3
- package/types/nanahoshi-mona-ui-dialog.d.ts +2 -2
- package/types/nanahoshi-mona-ui-editor.d.ts +17 -17
- package/types/nanahoshi-mona-ui-fieldset.d.ts +1 -1
- package/types/nanahoshi-mona-ui-filter.d.ts +2 -2
- package/types/nanahoshi-mona-ui-grid.d.ts +3 -3
- package/types/nanahoshi-mona-ui-internal-tree.d.ts +16 -16
- package/types/nanahoshi-mona-ui-menubar.d.ts +2 -2
- package/types/nanahoshi-mona-ui-stepper.d.ts +2 -2
- package/types/nanahoshi-mona-ui-tabs.d.ts +2 -2
- package/fesm2022/nanahoshi-mona-ui-grid-grid-list.component-Dgea-O0X.mjs +0 -130
- package/fesm2022/nanahoshi-mona-ui-grid-grid-virtual-list.component-DRHycGIh.mjs +0 -240
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, Injectable, computed, inject, Component, DOCUMENT, output,
|
|
3
|
-
import
|
|
4
|
-
import { FormsModule
|
|
2
|
+
import { signal, Injectable, computed, inject, Component, DOCUMENT, output, viewChild, DestroyRef, input, effect, untracked, afterNextRender } from '@angular/core';
|
|
3
|
+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
+
import { FormsModule } from '@angular/forms';
|
|
5
|
+
import { ThemeService } from '@nanahoshi/mona-ui/theme';
|
|
6
|
+
import { twMerge } from 'tailwind-merge';
|
|
5
7
|
import { ImmutableSet, any, List } from '@mirei/ts-collections';
|
|
6
8
|
import { Extension, Editor } from '@tiptap/core';
|
|
7
9
|
import { Color } from '@tiptap/extension-color';
|
|
@@ -23,12 +25,14 @@ import { StarterKit } from '@tiptap/starter-kit';
|
|
|
23
25
|
import { Subject } from 'rxjs';
|
|
24
26
|
import { Image } from '@tiptap/extension-image';
|
|
25
27
|
import { TextSelection, AllSelection } from '@tiptap/pm/state';
|
|
28
|
+
import { cva } from 'class-variance-authority';
|
|
26
29
|
import { ButtonDirective } from '@nanahoshi/mona-ui/button';
|
|
27
30
|
import { ButtonGroupComponent } from '@nanahoshi/mona-ui/button-group';
|
|
28
31
|
import { ColorPickerComponent, ColorPickerValueTemplateDirective } from '@nanahoshi/mona-ui/color-picker';
|
|
29
32
|
import { DropdownListComponent } from '@nanahoshi/mona-ui/dropdown-list';
|
|
30
33
|
import { DropdownItemTemplateDirective } from '@nanahoshi/mona-ui/dropdowns';
|
|
31
|
-
import { WindowComponent } from '@nanahoshi/mona-ui/window';
|
|
34
|
+
import { WindowComponent, WindowContentTemplateDirective } from '@nanahoshi/mona-ui/window';
|
|
35
|
+
import { form, required, maxLength, FormRoot, FormField } from '@angular/forms/signals';
|
|
32
36
|
import { NumericTextBoxComponent } from '@nanahoshi/mona-ui/numeric-text-box';
|
|
33
37
|
import { TextBoxComponent } from '@nanahoshi/mona-ui/text-box';
|
|
34
38
|
import { DialogService } from '@nanahoshi/mona-ui/dialog';
|
|
@@ -449,6 +453,275 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
449
453
|
type: Injectable
|
|
450
454
|
}] });
|
|
451
455
|
|
|
456
|
+
const editorBaseVariants = cva(`
|
|
457
|
+
flex flex-col bg-background text-foreground
|
|
458
|
+
border border-solid border-border
|
|
459
|
+
transition-[border-color] duration-150 ease-in
|
|
460
|
+
focus-visible:ring-2 focus-visible:ring-primary/40
|
|
461
|
+
focus-visible:border-primary
|
|
462
|
+
|
|
463
|
+
prose prose-neutral max-w-none
|
|
464
|
+
prose-headings:text-foreground prose-headings:font-bold
|
|
465
|
+
prose-headings:mt-1 prose-headings:mb-1
|
|
466
|
+
prose-p:text-foreground prose-p:my-1
|
|
467
|
+
prose-strong:text-foreground
|
|
468
|
+
prose-a:text-primary
|
|
469
|
+
|
|
470
|
+
[&_ol]:ps-8 [&_ul]:ps-8
|
|
471
|
+
|
|
472
|
+
[&_blockquote]:border-l-4
|
|
473
|
+
[&_blockquote]:border-l-solid
|
|
474
|
+
[&_blockquote]:border-l-primary
|
|
475
|
+
[&_blockquote]:px-4 [&_blockquote]:py-2
|
|
476
|
+
[&_blockquote]:ms-4
|
|
477
|
+
[&_blockquote]:bg-background-light
|
|
478
|
+
|
|
479
|
+
[&_hr]:border [&_hr]:border-solid [&_hr]:border-border
|
|
480
|
+
[&_hr]:bg-background-dark [&_hr]:my-1
|
|
481
|
+
|
|
482
|
+
[&_ul[data-type='taskList']_li]:flex
|
|
483
|
+
[&_ul[data-type='taskList']_li]:py-0.5
|
|
484
|
+
[&_ul[data-type='taskList']_li>label]:grow-0
|
|
485
|
+
[&_ul[data-type='taskList']_li>label]:shrink-0
|
|
486
|
+
[&_ul[data-type='taskList']_li>label]:basis-auto
|
|
487
|
+
[&_ul[data-type='taskList']_li>div]:grow-1
|
|
488
|
+
[&_ul[data-type='taskList']_li>div]:shrink-1
|
|
489
|
+
[&_ul[data-type='taskList']_li>div]:basis-auto
|
|
490
|
+
[&_ul[data-type='taskList']_input[type='checkbox']]:me-2!
|
|
491
|
+
|
|
492
|
+
[&_img]:max-w-full
|
|
493
|
+
[&_img]:h-auto
|
|
494
|
+
[&_img.ProseMirror-selectednode]:outline-3
|
|
495
|
+
[&_img.ProseMirror-selectednode]:outline-primary
|
|
496
|
+
|
|
497
|
+
[&_pre]:bg-background-dark
|
|
498
|
+
[&_pre]:border [&_pre]:border-solid [&_pre]:border-border
|
|
499
|
+
[&_pre]:whitespace-pre-wrap
|
|
500
|
+
[&_pre]:font-mono
|
|
501
|
+
[&_pre_code]:p-0
|
|
502
|
+
[&_pre_code]:text-sm
|
|
503
|
+
[&_pre_code]:bg-none
|
|
504
|
+
|
|
505
|
+
[&.ProseMirror-gapcursor]:after:border-foreground!
|
|
506
|
+
|
|
507
|
+
[&_table]:border-collapse
|
|
508
|
+
[&_table]:m-0
|
|
509
|
+
[&_table]:overflow-hidden
|
|
510
|
+
[&_table]:table-fixed
|
|
511
|
+
[&_table]:w-full
|
|
512
|
+
[&_table_td]:border [&_table_td]:border-solid [&_table_td]:border-foreground/40
|
|
513
|
+
[&_table_td]:p-2 [&_table_td]:align-top [&_table_td]:relative
|
|
514
|
+
[&_table_th]:border [&_table_th]:border-solid [&_table_th]:border-foreground/40
|
|
515
|
+
[&_table_th]:p-2 [&_table_th]:align-top [&_table_th]:relative
|
|
516
|
+
|
|
517
|
+
[&_table_th]:bg-background-darker [&_table_th]:color-foreground [&_table_th]:font-bold
|
|
518
|
+
|
|
519
|
+
[&_.selectedCell]:after:content-[''] [&_.selectedCell]:after:absolute [&_.selectedCell]:after:inset-0
|
|
520
|
+
[&_.selectedCell]:after:pointer-events-none
|
|
521
|
+
[&_.selectedCell]:after:z-2
|
|
522
|
+
[&_.selectedCell]:after:bg-primary
|
|
523
|
+
|
|
524
|
+
[&_.column-resize-handle]:absolute
|
|
525
|
+
[&_.column-resize-handle]:bg-primary
|
|
526
|
+
[&_.column-resize-handle]:w-1
|
|
527
|
+
[&_.column-resize-handle]:pointer-events-none
|
|
528
|
+
[&_.column-resize-handle]:top-0
|
|
529
|
+
[&_.column-resize-handle]:-bottom-0.5
|
|
530
|
+
[&_.column-resize-handle]:-right-0.5
|
|
531
|
+
|
|
532
|
+
[&_.ProseMirror.resize-cursor]:cursor-ew-resize
|
|
533
|
+
|
|
534
|
+
`);
|
|
535
|
+
const editorContainerVariants = cva(`
|
|
536
|
+
bg-background w-full h-full
|
|
537
|
+
[&_div:first-child[contenteditable='true']]:p-1.5
|
|
538
|
+
[&_div:first-child[contenteditable='true']]:text-foreground
|
|
539
|
+
[&_div:first-child[contenteditable='true']]:border-none
|
|
540
|
+
[&_div:first-child[contenteditable='true']]:outline-none
|
|
541
|
+
[&_div:first-child[contenteditable='true']]:w-full
|
|
542
|
+
[&_div:first-child[contenteditable='true']]:h-full
|
|
543
|
+
[&_div:first-child[contenteditable='true']]:overflow-auto
|
|
544
|
+
[&_div:first-child[contenteditable='true']]:resize-none
|
|
545
|
+
[&_div:first-child[contenteditable='true']]:[scrollbar-width:thin]
|
|
546
|
+
`);
|
|
547
|
+
const editorFontColorPreviewVariants = cva(`
|
|
548
|
+
w-full flex h-[2px]
|
|
549
|
+
`);
|
|
550
|
+
const editorFontColorValueVariants = cva(`
|
|
551
|
+
flex flex-col items-center justify-center
|
|
552
|
+
gap-0.5 ps-1.25 text-sm
|
|
553
|
+
`);
|
|
554
|
+
const editorFontFamilyDropdownListVariants = cva(`
|
|
555
|
+
w-[12em]
|
|
556
|
+
`);
|
|
557
|
+
const editorFontHighlightPreviewVariants = cva(`
|
|
558
|
+
w-full flex h-[2px]
|
|
559
|
+
`);
|
|
560
|
+
const editorFontHighlightValueVariants = cva(`
|
|
561
|
+
flex flex-col items-center justify-center
|
|
562
|
+
gap-0.5 ps-1.25 text-sm
|
|
563
|
+
`);
|
|
564
|
+
const editorFontSizeDropdownListVariants = cva(`
|
|
565
|
+
w-[8em]
|
|
566
|
+
`);
|
|
567
|
+
const editorHeadingsDropdownListVariants = cva(`
|
|
568
|
+
w-[14em]
|
|
569
|
+
`);
|
|
570
|
+
const editorImageInserterActionsVariants = cva(`
|
|
571
|
+
flex justify-end gap-1 px-2 py-1
|
|
572
|
+
bg-background-dark
|
|
573
|
+
border-t border-t-solid border-t-border
|
|
574
|
+
`);
|
|
575
|
+
const editorImageInserterFormVariants = cva(`
|
|
576
|
+
flex flex-col gap-1.5 pt-2
|
|
577
|
+
`);
|
|
578
|
+
const editorImageInserterRowLabelVariants = cva(`
|
|
579
|
+
mb-0.5 ps-0.5 text-sm font-semibold
|
|
580
|
+
`);
|
|
581
|
+
const editorImageInserterRowVariants = cva(`
|
|
582
|
+
flex flex-col justify-center px-2
|
|
583
|
+
`);
|
|
584
|
+
const editorTableCreatorVariants = cva(`
|
|
585
|
+
grid grid-cols-8 gap-0.5 p-1
|
|
586
|
+
`);
|
|
587
|
+
const editorTableCreatorCellVariants = cva(`
|
|
588
|
+
flex border border-solid border-border
|
|
589
|
+
w-6 h-6 bg-background-light
|
|
590
|
+
`);
|
|
591
|
+
const editorToolbarVariants = cva(`
|
|
592
|
+
flex flex-wrap items-center justify-start gap-1 p-1
|
|
593
|
+
bg-background-dark text-foreground border-b border-b-solid border-b-border
|
|
594
|
+
`);
|
|
595
|
+
|
|
596
|
+
const editorBaseThemeVariants = (theme) => {
|
|
597
|
+
switch (theme) {
|
|
598
|
+
case "mona":
|
|
599
|
+
return editorBaseVariants;
|
|
600
|
+
default:
|
|
601
|
+
return editorBaseVariants;
|
|
602
|
+
}
|
|
603
|
+
};
|
|
604
|
+
const editorContainerThemeVariants = (theme) => {
|
|
605
|
+
switch (theme) {
|
|
606
|
+
case "mona":
|
|
607
|
+
return editorContainerVariants;
|
|
608
|
+
default:
|
|
609
|
+
return editorContainerVariants;
|
|
610
|
+
}
|
|
611
|
+
};
|
|
612
|
+
const editorFontColorPreviewThemeVariants = (theme) => {
|
|
613
|
+
switch (theme) {
|
|
614
|
+
case "mona":
|
|
615
|
+
return editorFontColorPreviewVariants;
|
|
616
|
+
default:
|
|
617
|
+
return editorFontColorPreviewVariants;
|
|
618
|
+
}
|
|
619
|
+
};
|
|
620
|
+
const editorFontColorValueThemeVariants = (theme) => {
|
|
621
|
+
switch (theme) {
|
|
622
|
+
case "mona":
|
|
623
|
+
return editorFontColorValueVariants;
|
|
624
|
+
default:
|
|
625
|
+
return editorFontColorValueVariants;
|
|
626
|
+
}
|
|
627
|
+
};
|
|
628
|
+
const editorFontFamilyDropdownListThemeVariants = (theme) => {
|
|
629
|
+
switch (theme) {
|
|
630
|
+
case "mona":
|
|
631
|
+
return editorFontFamilyDropdownListVariants;
|
|
632
|
+
default:
|
|
633
|
+
return editorFontFamilyDropdownListVariants;
|
|
634
|
+
}
|
|
635
|
+
};
|
|
636
|
+
const editorFontHighlightPreviewThemeVariants = (theme) => {
|
|
637
|
+
switch (theme) {
|
|
638
|
+
case "mona":
|
|
639
|
+
return editorFontHighlightPreviewVariants;
|
|
640
|
+
default:
|
|
641
|
+
return editorFontHighlightPreviewVariants;
|
|
642
|
+
}
|
|
643
|
+
};
|
|
644
|
+
const editorFontHighlightValueThemeVariants = (theme) => {
|
|
645
|
+
switch (theme) {
|
|
646
|
+
case "mona":
|
|
647
|
+
return editorFontHighlightValueVariants;
|
|
648
|
+
default:
|
|
649
|
+
return editorFontHighlightValueVariants;
|
|
650
|
+
}
|
|
651
|
+
};
|
|
652
|
+
const editorFontSizeDropdownListThemeVariants = (theme) => {
|
|
653
|
+
switch (theme) {
|
|
654
|
+
case "mona":
|
|
655
|
+
return editorFontSizeDropdownListVariants;
|
|
656
|
+
default:
|
|
657
|
+
return editorFontSizeDropdownListVariants;
|
|
658
|
+
}
|
|
659
|
+
};
|
|
660
|
+
const editorHeadingsDropdownListThemeVariants = (theme) => {
|
|
661
|
+
switch (theme) {
|
|
662
|
+
case "mona":
|
|
663
|
+
return editorHeadingsDropdownListVariants;
|
|
664
|
+
default:
|
|
665
|
+
return editorHeadingsDropdownListVariants;
|
|
666
|
+
}
|
|
667
|
+
};
|
|
668
|
+
const editorImageInserterActionsThemeVariants = (theme) => {
|
|
669
|
+
switch (theme) {
|
|
670
|
+
case "mona":
|
|
671
|
+
return editorImageInserterActionsVariants;
|
|
672
|
+
default:
|
|
673
|
+
return editorImageInserterActionsVariants;
|
|
674
|
+
}
|
|
675
|
+
};
|
|
676
|
+
const editorImageInserterFormThemeVariants = (theme) => {
|
|
677
|
+
switch (theme) {
|
|
678
|
+
case "mona":
|
|
679
|
+
return editorImageInserterFormVariants;
|
|
680
|
+
default:
|
|
681
|
+
return editorImageInserterFormVariants;
|
|
682
|
+
}
|
|
683
|
+
};
|
|
684
|
+
const editorImageInserterRowLabelThemeVariants = (theme) => {
|
|
685
|
+
switch (theme) {
|
|
686
|
+
case "mona":
|
|
687
|
+
return editorImageInserterRowLabelVariants;
|
|
688
|
+
default:
|
|
689
|
+
return editorImageInserterRowLabelVariants;
|
|
690
|
+
}
|
|
691
|
+
};
|
|
692
|
+
const editorImageInserterRowThemeVariants = (theme) => {
|
|
693
|
+
switch (theme) {
|
|
694
|
+
case "mona":
|
|
695
|
+
return editorImageInserterRowVariants;
|
|
696
|
+
default:
|
|
697
|
+
return editorImageInserterRowVariants;
|
|
698
|
+
}
|
|
699
|
+
};
|
|
700
|
+
const editorTableCreatorCellThemeVariants = (theme) => {
|
|
701
|
+
switch (theme) {
|
|
702
|
+
case "mona":
|
|
703
|
+
return editorTableCreatorCellVariants;
|
|
704
|
+
default:
|
|
705
|
+
return editorTableCreatorCellVariants;
|
|
706
|
+
}
|
|
707
|
+
};
|
|
708
|
+
const editorTableCreatorThemeVariants = (theme) => {
|
|
709
|
+
switch (theme) {
|
|
710
|
+
case "mona":
|
|
711
|
+
return editorTableCreatorVariants;
|
|
712
|
+
default:
|
|
713
|
+
return editorTableCreatorVariants;
|
|
714
|
+
}
|
|
715
|
+
};
|
|
716
|
+
const editorToolbarThemeVariants = (theme) => {
|
|
717
|
+
switch (theme) {
|
|
718
|
+
case "mona":
|
|
719
|
+
return editorToolbarVariants;
|
|
720
|
+
default:
|
|
721
|
+
return editorToolbarVariants;
|
|
722
|
+
}
|
|
723
|
+
};
|
|
724
|
+
|
|
452
725
|
class EditorBasicTextStylesComponent {
|
|
453
726
|
constructor() {
|
|
454
727
|
this.anyToolVisible = computed(() => {
|
|
@@ -565,11 +838,11 @@ class EditorBasicTextStylesComponent {
|
|
|
565
838
|
}
|
|
566
839
|
}
|
|
567
840
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorBasicTextStylesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
568
|
-
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\">\n @if (boldVisible()) {\n <button monaButton [selected]=\"boldSelected()\" (click)=\"onBoldToggle()\" title=\"Bold\">\n <i class=\"ri-bold\"></i>\n </button>\n }\n @if (italicVisible()) {\n <button
|
|
841
|
+
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 monaButton [selected]=\"boldSelected()\" [toggleable]=\"false\" (click)=\"onBoldToggle()\" title=\"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=\"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=\"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=\"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=\"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=\"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", "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"] }] }); }
|
|
569
842
|
}
|
|
570
843
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorBasicTextStylesComponent, decorators: [{
|
|
571
844
|
type: Component,
|
|
572
|
-
args: [{ selector: "mona-editor-basic-text-styles", imports: [ButtonDirective, ButtonGroupComponent], template: "@if (anyToolVisible()) {\n <mona-button-group selection=\"multiple\">\n @if (boldVisible()) {\n <button monaButton [selected]=\"boldSelected()\" (click)=\"onBoldToggle()\" title=\"Bold\">\n <i class=\"ri-bold\"></i>\n </button>\n }\n @if (italicVisible()) {\n <button
|
|
845
|
+
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 monaButton [selected]=\"boldSelected()\" [toggleable]=\"false\" (click)=\"onBoldToggle()\" title=\"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=\"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=\"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=\"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=\"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=\"Superscript\">\n <i class=\"ri-superscript\"></i>\n </button>\n }\n </mona-button-group>\n}\n" }]
|
|
573
846
|
}] });
|
|
574
847
|
|
|
575
848
|
class EditorBlockquoteComponent {
|
|
@@ -591,11 +864,11 @@ class EditorBlockquoteComponent {
|
|
|
591
864
|
}
|
|
592
865
|
}
|
|
593
866
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorBlockquoteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
594
|
-
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 [selected]=\"blockquoteSelected()\" (click)=\"onBlockquoteToggle()\" title=\"Quotation\">\n <i class=\"ri-double-quotes-r\"></i>\n</button>\n",
|
|
867
|
+
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=\"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", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }] }); }
|
|
595
868
|
}
|
|
596
869
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorBlockquoteComponent, decorators: [{
|
|
597
870
|
type: Component,
|
|
598
|
-
args: [{ selector: "mona-editor-blockquote", imports: [ButtonDirective], template: "<button monaButton [selected]=\"blockquoteSelected()\" (click)=\"onBlockquoteToggle()\" title=\"Quotation\">\n <i class=\"ri-double-quotes-r\"></i>\n</button>\n" }]
|
|
871
|
+
args: [{ selector: "mona-editor-blockquote", imports: [ButtonDirective], template: "<button monaButton [size]=\"'small'\" [selected]=\"blockquoteSelected()\" (click)=\"onBlockquoteToggle()\" title=\"Quotation\">\n <i class=\"ri-double-quotes-r\"></i>\n</button>\n" }]
|
|
599
872
|
}] });
|
|
600
873
|
|
|
601
874
|
class EditorCodeBlockComponent {
|
|
@@ -612,11 +885,11 @@ class EditorCodeBlockComponent {
|
|
|
612
885
|
this.#editorService.editor.chain().toggleCodeBlock().run();
|
|
613
886
|
}
|
|
614
887
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorCodeBlockComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
615
|
-
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 [selected]=\"codeBlockSelected()\" (click)=\"onCodeBlockClick()\">\n <i class=\"ri-code-s-slash-line\"></i>\n</button>\n",
|
|
888
|
+
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", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }] }); }
|
|
616
889
|
}
|
|
617
890
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorCodeBlockComponent, decorators: [{
|
|
618
891
|
type: Component,
|
|
619
|
-
args: [{ selector: "mona-editor-code-block", imports: [ButtonDirective], template: "<button monaButton [selected]=\"codeBlockSelected()\" (click)=\"onCodeBlockClick()\">\n <i class=\"ri-code-s-slash-line\"></i>\n</button>\n" }]
|
|
892
|
+
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" }]
|
|
620
893
|
}] });
|
|
621
894
|
|
|
622
895
|
const htmlColorCode = (name, document) => {
|
|
@@ -633,7 +906,18 @@ class EditorFontColorComponent {
|
|
|
633
906
|
constructor() {
|
|
634
907
|
this.#document = inject(DOCUMENT);
|
|
635
908
|
this.#editorService = inject(EditorService);
|
|
909
|
+
this.#themeService = inject(ThemeService);
|
|
636
910
|
this.#lastColor = "";
|
|
911
|
+
this.colorPreviewClass = computed(() => {
|
|
912
|
+
const theme = this.#themeService.theme();
|
|
913
|
+
return editorFontColorPreviewThemeVariants(theme)();
|
|
914
|
+
}, /* @ts-ignore */
|
|
915
|
+
...(ngDevMode ? [{ debugName: "colorPreviewClass" }] : /* istanbul ignore next */ []));
|
|
916
|
+
this.colorValueClass = computed(() => {
|
|
917
|
+
const theme = this.#themeService.theme();
|
|
918
|
+
return editorFontColorValueThemeVariants(theme)();
|
|
919
|
+
}, /* @ts-ignore */
|
|
920
|
+
...(ngDevMode ? [{ debugName: "colorValueClass" }] : /* istanbul ignore next */ []));
|
|
637
921
|
this.selectedColor = computed(() => {
|
|
638
922
|
this.#editorService.state();
|
|
639
923
|
const attributes = this.#editorService.editor.getAttributes("textStyle");
|
|
@@ -644,6 +928,7 @@ class EditorFontColorComponent {
|
|
|
644
928
|
}
|
|
645
929
|
#document;
|
|
646
930
|
#editorService;
|
|
931
|
+
#themeService;
|
|
647
932
|
#lastColor;
|
|
648
933
|
onColorChange(color) {
|
|
649
934
|
if (color) {
|
|
@@ -655,15 +940,21 @@ class EditorFontColorComponent {
|
|
|
655
940
|
}
|
|
656
941
|
}
|
|
657
942
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorFontColorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
658
|
-
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
|
|
943
|
+
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=\"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: ["closeOnSelect", "columns", "disabled", "invalid", "opacity", "palette", "readonly", "rounded", "showClearButton", "size", "view", "required", "touched", "value"], outputs: ["touch", "valueChange"] }, { kind: "directive", type: ColorPickerValueTemplateDirective, selector: "ng-template[monaColorPickerValueTemplate]" }] }); }
|
|
659
944
|
}
|
|
660
945
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorFontColorComponent, decorators: [{
|
|
661
946
|
type: Component,
|
|
662
|
-
args: [{ selector: "mona-editor-font-color", imports: [ColorPickerComponent, ColorPickerValueTemplateDirective], template: "<mona-color-picker
|
|
947
|
+
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=\"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" }]
|
|
663
948
|
}] });
|
|
664
949
|
|
|
665
950
|
class EditorFontFamilyComponent {
|
|
666
951
|
constructor() {
|
|
952
|
+
this.#themeService = inject(ThemeService);
|
|
953
|
+
this.dropdownListClass = computed(() => {
|
|
954
|
+
const theme = this.#themeService.theme();
|
|
955
|
+
return editorFontFamilyDropdownListThemeVariants(theme)();
|
|
956
|
+
}, /* @ts-ignore */
|
|
957
|
+
...(ngDevMode ? [{ debugName: "dropdownListClass" }] : /* istanbul ignore next */ []));
|
|
667
958
|
this.editorService = inject(EditorService);
|
|
668
959
|
this.selectedFontFamily = computed(() => {
|
|
669
960
|
this.editorService.state();
|
|
@@ -673,25 +964,40 @@ class EditorFontFamilyComponent {
|
|
|
673
964
|
}, /* @ts-ignore */
|
|
674
965
|
...(ngDevMode ? [{ debugName: "selectedFontFamily" }] : /* istanbul ignore next */ []));
|
|
675
966
|
}
|
|
967
|
+
#themeService;
|
|
676
968
|
ngOnInit() {
|
|
677
969
|
const defaultFontFamily = this.editorService.fonts().first();
|
|
678
970
|
this.editorService.editor.chain().focus().setFontFamily(defaultFontFamily).run();
|
|
679
971
|
}
|
|
680
972
|
onFontFamilyChange(fontFamily) {
|
|
973
|
+
if (!fontFamily) {
|
|
974
|
+
return;
|
|
975
|
+
}
|
|
681
976
|
this.editorService.editor.chain().focus().setFontFamily(fontFamily).run();
|
|
682
977
|
}
|
|
683
978
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorFontFamilyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
684
|
-
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\
|
|
979
|
+
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=\"Select font family\">\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", "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] " }] }); }
|
|
685
980
|
}
|
|
686
981
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorFontFamilyComponent, decorators: [{
|
|
687
982
|
type: Component,
|
|
688
|
-
args: [{ selector: "mona-editor-font-family", imports: [DropdownListComponent, FormsModule, DropdownItemTemplateDirective], template: "<mona-dropdown-list\
|
|
983
|
+
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=\"Select font family\">\n <ng-template monaDropDownListItemTemplate let-font>\n <span [style.font-family]=\"font\">{{ font }}</span>\n </ng-template>\n</mona-dropdown-list>\n" }]
|
|
689
984
|
}] });
|
|
690
985
|
|
|
691
986
|
class EditorFontHighlightComponent {
|
|
692
987
|
constructor() {
|
|
693
988
|
this.#editorService = inject(EditorService);
|
|
989
|
+
this.#themeService = inject(ThemeService);
|
|
694
990
|
this.#lastColor = "";
|
|
991
|
+
this.highlightPreviewClass = computed(() => {
|
|
992
|
+
const theme = this.#themeService.theme();
|
|
993
|
+
return editorFontHighlightPreviewThemeVariants(theme)();
|
|
994
|
+
}, /* @ts-ignore */
|
|
995
|
+
...(ngDevMode ? [{ debugName: "highlightPreviewClass" }] : /* istanbul ignore next */ []));
|
|
996
|
+
this.highlightValueClass = computed(() => {
|
|
997
|
+
const theme = this.#themeService.theme();
|
|
998
|
+
return editorFontHighlightValueThemeVariants(theme)();
|
|
999
|
+
}, /* @ts-ignore */
|
|
1000
|
+
...(ngDevMode ? [{ debugName: "highlightValueClass" }] : /* istanbul ignore next */ []));
|
|
695
1001
|
this.selectedColor = computed(() => {
|
|
696
1002
|
const state = this.#editorService.state();
|
|
697
1003
|
if (state.selection.empty) {
|
|
@@ -711,6 +1017,7 @@ class EditorFontHighlightComponent {
|
|
|
711
1017
|
...(ngDevMode ? [{ debugName: "selectedColor" }] : /* istanbul ignore next */ []));
|
|
712
1018
|
}
|
|
713
1019
|
#editorService;
|
|
1020
|
+
#themeService;
|
|
714
1021
|
#lastColor;
|
|
715
1022
|
onColorChange(color) {
|
|
716
1023
|
if (color) {
|
|
@@ -722,16 +1029,22 @@ class EditorFontHighlightComponent {
|
|
|
722
1029
|
}
|
|
723
1030
|
}
|
|
724
1031
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorFontHighlightComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
725
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
1032
|
+
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=\"Background color\">\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: ["closeOnSelect", "columns", "disabled", "invalid", "opacity", "palette", "readonly", "rounded", "showClearButton", "size", "view", "required", "touched", "value"], outputs: ["touch", "valueChange"] }, { kind: "directive", type: ColorPickerValueTemplateDirective, selector: "ng-template[monaColorPickerValueTemplate]" }] }); }
|
|
726
1033
|
}
|
|
727
1034
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorFontHighlightComponent, decorators: [{
|
|
728
1035
|
type: Component,
|
|
729
|
-
args: [{ selector: "mona-editor-font-highlight", imports: [ColorPickerComponent, ColorPickerValueTemplateDirective], template: "<mona-color-picker\n view=\"gradient\"\n [value]=\"selectedColor()\"\n (valueChange)=\"onColorChange($event)\"\n title=\"Background color\">\n <ng-template monaColorPickerValueTemplate let-color>\n <div class=\"
|
|
1036
|
+
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=\"Background color\">\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" }]
|
|
730
1037
|
}] });
|
|
731
1038
|
|
|
732
1039
|
class EditorFontSizeComponent {
|
|
733
1040
|
constructor() {
|
|
734
1041
|
this.editorService = inject(EditorService);
|
|
1042
|
+
this.#themeService = inject(ThemeService);
|
|
1043
|
+
this.dropdownListClass = computed(() => {
|
|
1044
|
+
const theme = this.#themeService.theme();
|
|
1045
|
+
return editorFontSizeDropdownListThemeVariants(theme)();
|
|
1046
|
+
}, /* @ts-ignore */
|
|
1047
|
+
...(ngDevMode ? [{ debugName: "dropdownListClass" }] : /* istanbul ignore next */ []));
|
|
735
1048
|
this.selectedFontSize = computed(() => {
|
|
736
1049
|
this.editorService.state();
|
|
737
1050
|
return (this.editorService
|
|
@@ -740,18 +1053,19 @@ class EditorFontSizeComponent {
|
|
|
740
1053
|
}, /* @ts-ignore */
|
|
741
1054
|
...(ngDevMode ? [{ debugName: "selectedFontSize" }] : /* istanbul ignore next */ []));
|
|
742
1055
|
}
|
|
743
|
-
|
|
744
|
-
// this.#editorService.editor.chain().focus().setFontSize(this.selectedFontSize().value).run();
|
|
745
|
-
}
|
|
1056
|
+
#themeService;
|
|
746
1057
|
onFontSizeChange(fontSize) {
|
|
1058
|
+
if (!fontSize) {
|
|
1059
|
+
return;
|
|
1060
|
+
}
|
|
747
1061
|
this.editorService.editor.chain().focus().setFontSize(fontSize).run();
|
|
748
1062
|
}
|
|
749
1063
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorFontSizeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
750
|
-
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\
|
|
1064
|
+
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=\"Font Size\"\n [value]=\"selectedFontSize()\"\n (valueChange)=\"onFontSizeChange($event)\"\n [size]=\"'small'\"\n [class]=\"dropdownListClass()\"\n title=\"Select font size\"></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", "value"], outputs: ["close", "closed", "disabledChange", "open", "opened", "touch", "valueChange"] }, { kind: "ngmodule", type: FormsModule }] }); }
|
|
751
1065
|
}
|
|
752
1066
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorFontSizeComponent, decorators: [{
|
|
753
1067
|
type: Component,
|
|
754
|
-
args: [{ selector: "mona-editor-font-size", imports: [DropdownListComponent, FormsModule], template: "<mona-dropdown-list\
|
|
1068
|
+
args: [{ selector: "mona-editor-font-size", imports: [DropdownListComponent, FormsModule], template: "<mona-dropdown-list\n [data]=\"editorService.fontSizes()\"\n placeholder=\"Font Size\"\n [value]=\"selectedFontSize()\"\n (valueChange)=\"onFontSizeChange($event)\"\n [size]=\"'small'\"\n [class]=\"dropdownListClass()\"\n title=\"Select font size\"></mona-dropdown-list>\n" }]
|
|
755
1069
|
}] });
|
|
756
1070
|
|
|
757
1071
|
var HeadingType;
|
|
@@ -768,7 +1082,13 @@ var HeadingType;
|
|
|
768
1082
|
class EditorHeadingsComponent {
|
|
769
1083
|
constructor() {
|
|
770
1084
|
this.#editorService = inject(EditorService);
|
|
1085
|
+
this.#themeService = inject(ThemeService);
|
|
771
1086
|
this.HeadingType = HeadingType;
|
|
1087
|
+
this.dropdownListClass = computed(() => {
|
|
1088
|
+
const theme = this.#themeService.theme();
|
|
1089
|
+
return editorHeadingsDropdownListThemeVariants(theme)();
|
|
1090
|
+
}, /* @ts-ignore */
|
|
1091
|
+
...(ngDevMode ? [{ debugName: "dropdownListClass" }] : /* istanbul ignore next */ []));
|
|
772
1092
|
this.headingsDropdownListData = [
|
|
773
1093
|
{ text: "Paragraph", value: HeadingType.Paragraph },
|
|
774
1094
|
{ text: "Heading 1", value: HeadingType.Heading1 },
|
|
@@ -789,7 +1109,11 @@ class EditorHeadingsComponent {
|
|
|
789
1109
|
...(ngDevMode ? [{ debugName: "selectedHeadingsDropdownItem" }] : /* istanbul ignore next */ []));
|
|
790
1110
|
}
|
|
791
1111
|
#editorService;
|
|
1112
|
+
#themeService;
|
|
792
1113
|
onFormatChange(headingItem) {
|
|
1114
|
+
if (!headingItem) {
|
|
1115
|
+
return;
|
|
1116
|
+
}
|
|
793
1117
|
if (headingItem.value === HeadingType.Paragraph) {
|
|
794
1118
|
this.#editorService.editor.chain().focus().setParagraph().run();
|
|
795
1119
|
}
|
|
@@ -798,11 +1122,11 @@ class EditorHeadingsComponent {
|
|
|
798
1122
|
}
|
|
799
1123
|
}
|
|
800
1124
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorHeadingsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
801
|
-
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\
|
|
1125
|
+
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=\"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", "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] " }] }); }
|
|
802
1126
|
}
|
|
803
1127
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorHeadingsComponent, decorators: [{
|
|
804
1128
|
type: Component,
|
|
805
|
-
args: [{ selector: "mona-editor-headings", imports: [DropdownListComponent, FormsModule, DropdownItemTemplateDirective], template: "<mona-dropdown-list\
|
|
1129
|
+
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=\"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" }]
|
|
806
1130
|
}] });
|
|
807
1131
|
|
|
808
1132
|
class EditorHistoryComponent {
|
|
@@ -827,11 +1151,11 @@ class EditorHistoryComponent {
|
|
|
827
1151
|
this.#editorService.editor.chain().focus().undo().run();
|
|
828
1152
|
}
|
|
829
1153
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorHistoryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
830
|
-
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\">\n <button monaButton [disabled]=\"undoDisabled()\" (click)=\"onUndoClick()\" title=\"Undo\">\n <i class=\"ri-arrow-go-back-line\"></i>\n </button>\n <button monaButton [disabled]=\"redoDisabled()\" (click)=\"onRedoClick()\" title=\"Redo\">\n <i class=\"ri-arrow-go-forward-line\"></i>\n </button>\n</mona-button-group>\n",
|
|
1154
|
+
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=\"Undo\">\n <i class=\"ri-arrow-go-back-line\"></i>\n </button>\n <button monaButton [disabled]=\"redoDisabled()\" (click)=\"onRedoClick()\" title=\"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", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }] }); }
|
|
831
1155
|
}
|
|
832
1156
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorHistoryComponent, decorators: [{
|
|
833
1157
|
type: Component,
|
|
834
|
-
args: [{ selector: "mona-editor-history", imports: [ButtonGroupComponent, ButtonDirective], template: "<mona-button-group selection=\"single\">\n <button monaButton [disabled]=\"undoDisabled()\" (click)=\"onUndoClick()\" title=\"Undo\">\n <i class=\"ri-arrow-go-back-line\"></i>\n </button>\n <button monaButton [disabled]=\"redoDisabled()\" (click)=\"onRedoClick()\" title=\"Redo\">\n <i class=\"ri-arrow-go-forward-line\"></i>\n </button>\n</mona-button-group>\n" }]
|
|
1158
|
+
args: [{ selector: "mona-editor-history", imports: [ButtonGroupComponent, ButtonDirective], template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button monaButton [disabled]=\"undoDisabled()\" (click)=\"onUndoClick()\" title=\"Undo\">\n <i class=\"ri-arrow-go-back-line\"></i>\n </button>\n <button monaButton [disabled]=\"redoDisabled()\" (click)=\"onRedoClick()\" title=\"Redo\">\n <i class=\"ri-arrow-go-forward-line\"></i>\n </button>\n</mona-button-group>\n" }]
|
|
835
1159
|
}] });
|
|
836
1160
|
|
|
837
1161
|
class EditorHorizontalRuleComponent {
|
|
@@ -840,41 +1164,69 @@ class EditorHorizontalRuleComponent {
|
|
|
840
1164
|
this.#editorService.editor.chain().focus().setHorizontalRule().run();
|
|
841
1165
|
}
|
|
842
1166
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorHorizontalRuleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
843
|
-
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 (click)=\"onHorizontalRuleClick()\" title=\"Add horizontal line\">\n <i class=\"ri-subtract-line\"></i>\n</button>\n",
|
|
1167
|
+
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=\"Add horizontal line\">\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", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }] }); }
|
|
844
1168
|
}
|
|
845
1169
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorHorizontalRuleComponent, decorators: [{
|
|
846
1170
|
type: Component,
|
|
847
|
-
args: [{ selector: "mona-editor-horizontal-rule", imports: [ButtonDirective], template: "<button monaButton (click)=\"onHorizontalRuleClick()\" title=\"Add horizontal line\">\n <i class=\"ri-subtract-line\"></i>\n</button>\n" }]
|
|
1171
|
+
args: [{ selector: "mona-editor-horizontal-rule", imports: [ButtonDirective], template: "<button monaButton [size]=\"'small'\" (click)=\"onHorizontalRuleClick()\" title=\"Add horizontal line\">\n <i class=\"ri-subtract-line\"></i>\n</button>\n" }]
|
|
848
1172
|
}] });
|
|
849
1173
|
|
|
850
1174
|
class EditorImageInserterComponent {
|
|
851
1175
|
constructor() {
|
|
852
|
-
this
|
|
853
|
-
|
|
854
|
-
height:
|
|
855
|
-
link:
|
|
856
|
-
width:
|
|
1176
|
+
this.#imageFormModel = signal({
|
|
1177
|
+
alt: "",
|
|
1178
|
+
height: null,
|
|
1179
|
+
link: "",
|
|
1180
|
+
width: null
|
|
1181
|
+
}, /* @ts-ignore */
|
|
1182
|
+
...(ngDevMode ? [{ debugName: "#imageFormModel" }] : /* istanbul ignore next */ []));
|
|
1183
|
+
this.#themeService = inject(ThemeService);
|
|
1184
|
+
this.actionsClass = computed(() => {
|
|
1185
|
+
const theme = this.#themeService.theme();
|
|
1186
|
+
return editorImageInserterActionsThemeVariants(theme)();
|
|
1187
|
+
}, /* @ts-ignore */
|
|
1188
|
+
...(ngDevMode ? [{ debugName: "actionsClass" }] : /* istanbul ignore next */ []));
|
|
1189
|
+
this.formClass = computed(() => {
|
|
1190
|
+
const theme = this.#themeService.theme();
|
|
1191
|
+
return editorImageInserterFormThemeVariants(theme)();
|
|
1192
|
+
}, /* @ts-ignore */
|
|
1193
|
+
...(ngDevMode ? [{ debugName: "formClass" }] : /* istanbul ignore next */ []));
|
|
1194
|
+
this.iForm = form(this.#imageFormModel, schema => {
|
|
1195
|
+
required(schema.link);
|
|
1196
|
+
maxLength(schema.link, 2048);
|
|
857
1197
|
});
|
|
1198
|
+
this.rowClass = computed(() => {
|
|
1199
|
+
const theme = this.#themeService.theme();
|
|
1200
|
+
return editorImageInserterRowThemeVariants(theme)();
|
|
1201
|
+
}, /* @ts-ignore */
|
|
1202
|
+
...(ngDevMode ? [{ debugName: "rowClass" }] : /* istanbul ignore next */ []));
|
|
1203
|
+
this.rowLabelClass = computed(() => {
|
|
1204
|
+
const theme = this.#themeService.theme();
|
|
1205
|
+
return editorImageInserterRowLabelThemeVariants(theme)();
|
|
1206
|
+
}, /* @ts-ignore */
|
|
1207
|
+
...(ngDevMode ? [{ debugName: "rowLabelClass" }] : /* istanbul ignore next */ []));
|
|
858
1208
|
this.cancel = output();
|
|
859
1209
|
this.insert = output();
|
|
860
1210
|
}
|
|
1211
|
+
#imageFormModel;
|
|
1212
|
+
#themeService;
|
|
861
1213
|
onCancel() {
|
|
862
1214
|
this.cancel.emit();
|
|
863
1215
|
}
|
|
864
1216
|
onImageInsert() {
|
|
865
1217
|
this.insert.emit({
|
|
866
|
-
|
|
867
|
-
height: this.
|
|
868
|
-
link: this.
|
|
869
|
-
width: this.
|
|
1218
|
+
alt: this.iForm.alt().value(),
|
|
1219
|
+
height: this.iForm.height().value(),
|
|
1220
|
+
link: this.iForm.link().value(),
|
|
1221
|
+
width: this.iForm.width().value()
|
|
870
1222
|
});
|
|
871
1223
|
}
|
|
872
1224
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorImageInserterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
873
|
-
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 [
|
|
1225
|
+
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()\">Image URL</div>\n <mona-text-box [size]=\"'small'\" [formField]=\"iForm.link\"></mona-text-box>\n </div>\n <div [class]=\"rowClass()\">\n <div [class]=\"rowLabelClass()\">Alt Text</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()\">Width (px)</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()\">Height (px)</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 Insert\n </button>\n <button monaButton [size]=\"'small'\" [look]=\"'secondary'\" (click)=\"onCancel()\">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", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "component", type: NumericTextBoxComponent, selector: "mona-numeric-text-box", inputs: ["aria-label", "decimals", "disabled", "formatter", "maxValue", "minValue", "nullable", "readonly", "required", "invalid", "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"] }] }); }
|
|
874
1226
|
}
|
|
875
1227
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorImageInserterComponent, decorators: [{
|
|
876
1228
|
type: Component,
|
|
877
|
-
args: [{ selector: "mona-editor-image-inserter", imports: [TextBoxComponent,
|
|
1229
|
+
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()\">Image URL</div>\n <mona-text-box [size]=\"'small'\" [formField]=\"iForm.link\"></mona-text-box>\n </div>\n <div [class]=\"rowClass()\">\n <div [class]=\"rowLabelClass()\">Alt Text</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()\">Width (px)</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()\">Height (px)</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 Insert\n </button>\n <button monaButton [size]=\"'small'\" [look]=\"'secondary'\" (click)=\"onCancel()\">Cancel</button>\n </div>\n</form>\n" }]
|
|
878
1230
|
}], propDecorators: { cancel: [{ type: i0.Output, args: ["cancel"] }], insert: [{ type: i0.Output, args: ["insert"] }] } });
|
|
879
1231
|
|
|
880
1232
|
class EditorImageComponent {
|
|
@@ -905,8 +1257,8 @@ class EditorImageComponent {
|
|
|
905
1257
|
.chain()
|
|
906
1258
|
.setImage({
|
|
907
1259
|
src: event.link,
|
|
908
|
-
alt: event.
|
|
909
|
-
title: event.
|
|
1260
|
+
alt: event.alt,
|
|
1261
|
+
title: event.alt
|
|
910
1262
|
})
|
|
911
1263
|
.updateAttributes("extendedImage", {
|
|
912
1264
|
width: event.width,
|
|
@@ -915,11 +1267,11 @@ class EditorImageComponent {
|
|
|
915
1267
|
.run();
|
|
916
1268
|
}
|
|
917
1269
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorImageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
918
|
-
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 (click)=\"onDisplayInserterClick()\" title=\"Insert image\">\n <i class=\"ri-image-add-line\"></i>\n</button>\n\n@if (inserterVisible()) {\n <mona-window
|
|
1270
|
+
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=\"Insert image\">\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]=\"'Insert Image'\"\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", "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", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }, { kind: "directive", type: WindowContentTemplateDirective, selector: "ng-template[monaWindowContentTemplate]" }] }); }
|
|
919
1271
|
}
|
|
920
1272
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorImageComponent, decorators: [{
|
|
921
1273
|
type: Component,
|
|
922
|
-
args: [{ selector: "mona-editor-image", imports: [WindowComponent, EditorImageInserterComponent, ButtonDirective], template: "<button monaButton (click)=\"onDisplayInserterClick()\" title=\"Insert image\">\n <i class=\"ri-image-add-line\"></i>\n</button>\n\n@if (inserterVisible()) {\n <mona-window
|
|
1274
|
+
args: [{ selector: "mona-editor-image", imports: [WindowComponent, EditorImageInserterComponent, ButtonDirective, WindowContentTemplateDirective], template: "<button monaButton [size]=\"'small'\" (click)=\"onDisplayInserterClick()\" title=\"Insert image\">\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]=\"'Insert Image'\"\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" }]
|
|
923
1275
|
}] });
|
|
924
1276
|
|
|
925
1277
|
class EditorIndentComponent {
|
|
@@ -944,11 +1296,11 @@ class EditorIndentComponent {
|
|
|
944
1296
|
this.#editorService.editor.chain().focus().outdent().run();
|
|
945
1297
|
}
|
|
946
1298
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorIndentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
947
|
-
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\">\n <button monaButton [disabled]=\"indentDisabled()\" (click)=\"onIndentClick()\" title=\"Indent\">\n <i class=\"ri-indent-increase\"></i>\n </button>\n <button monaButton [disabled]=\"outdentDisabled()\" (click)=\"onOutdentClick()\" title=\"Outdent\">\n <i class=\"ri-indent-decrease\"></i>\n </button>\n</mona-button-group>\n",
|
|
1299
|
+
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=\"Indent\">\n <i class=\"ri-indent-increase\"></i>\n </button>\n <button monaButton [disabled]=\"outdentDisabled()\" (click)=\"onOutdentClick()\" title=\"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", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }] }); }
|
|
948
1300
|
}
|
|
949
1301
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorIndentComponent, decorators: [{
|
|
950
1302
|
type: Component,
|
|
951
|
-
args: [{ selector: "mona-editor-indent", imports: [ButtonGroupComponent, ButtonDirective], template: "<mona-button-group selection=\"single\">\n <button monaButton [disabled]=\"indentDisabled()\" (click)=\"onIndentClick()\" title=\"Indent\">\n <i class=\"ri-indent-increase\"></i>\n </button>\n <button monaButton [disabled]=\"outdentDisabled()\" (click)=\"onOutdentClick()\" title=\"Outdent\">\n <i class=\"ri-indent-decrease\"></i>\n </button>\n</mona-button-group>\n" }]
|
|
1303
|
+
args: [{ selector: "mona-editor-indent", imports: [ButtonGroupComponent, ButtonDirective], template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button monaButton [disabled]=\"indentDisabled()\" (click)=\"onIndentClick()\" title=\"Indent\">\n <i class=\"ri-indent-increase\"></i>\n </button>\n <button monaButton [disabled]=\"outdentDisabled()\" (click)=\"onOutdentClick()\" title=\"Outdent\">\n <i class=\"ri-indent-decrease\"></i>\n </button>\n</mona-button-group>\n" }]
|
|
952
1304
|
}] });
|
|
953
1305
|
|
|
954
1306
|
class EditorLinkComponent {
|
|
@@ -990,11 +1342,11 @@ class EditorLinkComponent {
|
|
|
990
1342
|
this.#editorService.editor.chain().focus().extendMarkRange("link").setLink({ href: url }).run();
|
|
991
1343
|
}
|
|
992
1344
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorLinkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
993
|
-
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\">\n <button
|
|
1345
|
+
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=\"Insert Link\">\n <i class=\"ri-link-m\"></i>\n </button>\n <button monaButton [disabled]=\"unlinkDisabled()\" (click)=\"onUnlinkClick()\" title=\"Remove Link\">\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", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }] }); }
|
|
994
1346
|
}
|
|
995
1347
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorLinkComponent, decorators: [{
|
|
996
1348
|
type: Component,
|
|
997
|
-
args: [{ selector: "mona-editor-link", imports: [ButtonGroupComponent, ButtonDirective], template: "<mona-button-group selection=\"single\">\n <button
|
|
1349
|
+
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=\"Insert Link\">\n <i class=\"ri-link-m\"></i>\n </button>\n <button monaButton [disabled]=\"unlinkDisabled()\" (click)=\"onUnlinkClick()\" title=\"Remove Link\">\n <i class=\"ri-link-unlink-m\"></i>\n </button>\n</mona-button-group>\n" }]
|
|
998
1350
|
}] });
|
|
999
1351
|
|
|
1000
1352
|
class EditorListComponent {
|
|
@@ -1019,18 +1371,30 @@ class EditorListComponent {
|
|
|
1019
1371
|
this.#editorService.editor.chain().focus().toggleBulletList().run();
|
|
1020
1372
|
}
|
|
1021
1373
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1022
|
-
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\">\n <button\n monaButton\n [selected]=\"unorderedListSelected()\"\n (click)=\"onUnorderedListToggle()\"\n title=\"Insert unordered list\">\n <i class=\"ri-list-unordered\"></i>\n </button>\n <button
|
|
1374
|
+
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=\"Insert unordered list\">\n <i class=\"ri-list-unordered\"></i>\n </button>\n <button\n monaButton\n [selected]=\"orderedListSelected()\"\n [toggleable]=\"false\"\n (click)=\"onOrderedListToggle()\"\n title=\"Insert ordered list\">\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", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }] }); }
|
|
1023
1375
|
}
|
|
1024
1376
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorListComponent, decorators: [{
|
|
1025
1377
|
type: Component,
|
|
1026
|
-
args: [{ selector: "mona-editor-list", imports: [ButtonGroupComponent, ButtonDirective], template: "<mona-button-group selection=\"single\">\n <button\n monaButton\n [selected]=\"unorderedListSelected()\"\n (click)=\"onUnorderedListToggle()\"\n title=\"Insert unordered list\">\n <i class=\"ri-list-unordered\"></i>\n </button>\n <button
|
|
1378
|
+
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=\"Insert unordered list\">\n <i class=\"ri-list-unordered\"></i>\n </button>\n <button\n monaButton\n [selected]=\"orderedListSelected()\"\n [toggleable]=\"false\"\n (click)=\"onOrderedListToggle()\"\n title=\"Insert ordered list\">\n <i class=\"ri-list-ordered-2\"></i>\n </button>\n</mona-button-group>\n" }]
|
|
1027
1379
|
}] });
|
|
1028
1380
|
|
|
1029
1381
|
class EditorTableCreatorComponent {
|
|
1030
1382
|
constructor() {
|
|
1383
|
+
this.#themeService = inject(ThemeService);
|
|
1031
1384
|
this.highlightedCell = { row: 0, col: 0 };
|
|
1385
|
+
this.tableCreatorCellClass = computed(() => {
|
|
1386
|
+
const theme = this.#themeService.theme();
|
|
1387
|
+
return editorTableCreatorCellThemeVariants(theme)();
|
|
1388
|
+
}, /* @ts-ignore */
|
|
1389
|
+
...(ngDevMode ? [{ debugName: "tableCreatorCellClass" }] : /* istanbul ignore next */ []));
|
|
1390
|
+
this.tableCreatorClass = computed(() => {
|
|
1391
|
+
const theme = this.#themeService.theme();
|
|
1392
|
+
return editorTableCreatorThemeVariants(theme)();
|
|
1393
|
+
}, /* @ts-ignore */
|
|
1394
|
+
...(ngDevMode ? [{ debugName: "tableCreatorClass" }] : /* istanbul ignore next */ []));
|
|
1032
1395
|
this.insert = output();
|
|
1033
1396
|
}
|
|
1397
|
+
#themeService;
|
|
1034
1398
|
onCellClick(row, col) {
|
|
1035
1399
|
this.insert.emit({ row, col });
|
|
1036
1400
|
this.highlightedCell = { row: 0, col: 0 };
|
|
@@ -1042,11 +1406,11 @@ class EditorTableCreatorComponent {
|
|
|
1042
1406
|
this.highlightedCell = { row: 0, col: 0 };
|
|
1043
1407
|
}
|
|
1044
1408
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorTableCreatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1045
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: EditorTableCreatorComponent, isStandalone: true, selector: "mona-editor-table-creator", outputs: { insert: "insert" }, ngImport: i0, template: "<div class=\"
|
|
1409
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: EditorTableCreatorComponent, isStandalone: true, selector: "mona-editor-table-creator", outputs: { insert: "insert" }, ngImport: i0, template: "<div [class]=\"tableCreatorClass()\" (pointerleave)=\"onCellMouseLeave()\">\n @for (rx of [1, 2, 3, 4, 5, 6, 7, 8]; track rx) {\n @for (cx of [1, 2, 3, 4, 5, 6, 7, 8]; track cx) {\n <div\n [class]=\"tableCreatorCellClass()\"\n [style.background-color]=\"\n rx <= highlightedCell.row && cx <= highlightedCell.col\n ? 'var(--color-primary)'\n : 'var(--color-background-light)'\n \"\n (click)=\"onCellClick(rx, cx)\"\n (pointerenter)=\"onCellMouseEnter(rx, cx)\"></div>\n }\n }\n</div>\n" }); }
|
|
1046
1410
|
}
|
|
1047
1411
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorTableCreatorComponent, decorators: [{
|
|
1048
1412
|
type: Component,
|
|
1049
|
-
args: [{ selector: "mona-editor-table-creator",
|
|
1413
|
+
args: [{ selector: "mona-editor-table-creator", template: "<div [class]=\"tableCreatorClass()\" (pointerleave)=\"onCellMouseLeave()\">\n @for (rx of [1, 2, 3, 4, 5, 6, 7, 8]; track rx) {\n @for (cx of [1, 2, 3, 4, 5, 6, 7, 8]; track cx) {\n <div\n [class]=\"tableCreatorCellClass()\"\n [style.background-color]=\"\n rx <= highlightedCell.row && cx <= highlightedCell.col\n ? 'var(--color-primary)'\n : 'var(--color-background-light)'\n \"\n (click)=\"onCellClick(rx, cx)\"\n (pointerenter)=\"onCellMouseEnter(rx, cx)\"></div>\n }\n }\n</div>\n" }]
|
|
1050
1414
|
}], propDecorators: { insert: [{ type: i0.Output, args: ["insert"] }] } });
|
|
1051
1415
|
|
|
1052
1416
|
class EditorTableComponent {
|
|
@@ -1164,11 +1528,11 @@ class EditorTableComponent {
|
|
|
1164
1528
|
this.#editorService.editor.chain().focus().toggleHeaderRow().run();
|
|
1165
1529
|
}
|
|
1166
1530
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1167
|
-
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\">\n <button monaButton title=\"Insert table\" #insertTableButton>\n <i class=\"ri-grid-line\"></i>\n </button>\n <button\n monaButton\n [disabled]=\"addColumnBeforeDisabled()\"\n (click)=\"onAddColumnBeforeClick()\"\n title=\"Add column before\">\n <i class=\"ri-insert-column-left\"></i>\n </button>\n <button monaButton [disabled]=\"addColumnAfterDisabled()\" (click)=\"onAddColumnAfterClick()\" title=\"Add column after\">\n <i class=\"ri-insert-column-right\"></i>\n </button>\n <button monaButton [disabled]=\"addRowBeforeDisabled()\" (click)=\"onAddRowBeforeClick()\" title=\"Add row before\">\n <i class=\"ri-insert-row-top\"></i>\n </button>\n <button monaButton [disabled]=\"addRowAfterDisabled()\" (click)=\"onAddRowAfterClick()\" title=\"Add row after\">\n <i class=\"ri-insert-row-bottom\"></i>\n </button>\n <button monaButton [disabled]=\"deleteColumnDisabled()\" (click)=\"onDeleteColumnClick()\" title=\"Delete column\">\n <i class=\"ri-delete-column\"></i>\n </button>\n <button monaButton [disabled]=\"deleteRowDisabled()\" (click)=\"onDeleteRowClick()\" title=\"Delete row\">\n <i class=\"ri-delete-row\"></i>\n </button>\n <button monaButton [disabled]=\"mergeCellsDisabled()\" (click)=\"onMergeCellsClick()\" title=\"Merge selected cells\">\n <i class=\"ri-merge-cells-horizontal\"></i>\n </button>\n <button monaButton [disabled]=\"splitCellDisabled()\" (click)=\"onSplitCellClick()\" title=\"Split cell\">\n <i class=\"ri-split-cells-horizontal\"></i>\n </button>\n <button monaButton [disabled]=\"toggleHeaderRowDisabled()\" (click)=\"onToggleHeaderRow()\" title=\"Toggle header row\">\n <i class=\"ri-table-line\"></i>\n </button>\n <button monaButton [disabled]=\"deleteTableDisabled()\" (click)=\"onDeleteTableClick()\" title=\"Delete table\">\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",
|
|
1531
|
+
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=\"Insert table\" #insertTableButton>\n <i class=\"ri-grid-line\"></i>\n </button>\n <button\n monaButton\n [disabled]=\"addColumnBeforeDisabled()\"\n (click)=\"onAddColumnBeforeClick()\"\n title=\"Add column before\">\n <i class=\"ri-insert-column-left\"></i>\n </button>\n <button monaButton [disabled]=\"addColumnAfterDisabled()\" (click)=\"onAddColumnAfterClick()\" title=\"Add column after\">\n <i class=\"ri-insert-column-right\"></i>\n </button>\n <button monaButton [disabled]=\"addRowBeforeDisabled()\" (click)=\"onAddRowBeforeClick()\" title=\"Add row before\">\n <i class=\"ri-insert-row-top\"></i>\n </button>\n <button monaButton [disabled]=\"addRowAfterDisabled()\" (click)=\"onAddRowAfterClick()\" title=\"Add row after\">\n <i class=\"ri-insert-row-bottom\"></i>\n </button>\n <button monaButton [disabled]=\"deleteColumnDisabled()\" (click)=\"onDeleteColumnClick()\" title=\"Delete column\">\n <i class=\"ri-delete-column\"></i>\n </button>\n <button monaButton [disabled]=\"deleteRowDisabled()\" (click)=\"onDeleteRowClick()\" title=\"Delete row\">\n <i class=\"ri-delete-row\"></i>\n </button>\n <button monaButton [disabled]=\"mergeCellsDisabled()\" (click)=\"onMergeCellsClick()\" title=\"Merge selected cells\">\n <i class=\"ri-merge-cells-horizontal\"></i>\n </button>\n <button monaButton [disabled]=\"splitCellDisabled()\" (click)=\"onSplitCellClick()\" title=\"Split cell\">\n <i class=\"ri-split-cells-horizontal\"></i>\n </button>\n <button monaButton [disabled]=\"toggleHeaderRowDisabled()\" (click)=\"onToggleHeaderRow()\" title=\"Toggle header row\">\n <i class=\"ri-table-line\"></i>\n </button>\n <button monaButton [disabled]=\"deleteTableDisabled()\" (click)=\"onDeleteTableClick()\" title=\"Delete table\">\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", "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"] }] }); }
|
|
1168
1532
|
}
|
|
1169
1533
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorTableComponent, decorators: [{
|
|
1170
1534
|
type: Component,
|
|
1171
|
-
args: [{ selector: "mona-editor-table", imports: [ButtonGroupComponent, ButtonDirective, PopoverComponent, EditorTableCreatorComponent], template: "<mona-button-group selection=\"single\">\n <button monaButton title=\"Insert table\" #insertTableButton>\n <i class=\"ri-grid-line\"></i>\n </button>\n <button\n monaButton\n [disabled]=\"addColumnBeforeDisabled()\"\n (click)=\"onAddColumnBeforeClick()\"\n title=\"Add column before\">\n <i class=\"ri-insert-column-left\"></i>\n </button>\n <button monaButton [disabled]=\"addColumnAfterDisabled()\" (click)=\"onAddColumnAfterClick()\" title=\"Add column after\">\n <i class=\"ri-insert-column-right\"></i>\n </button>\n <button monaButton [disabled]=\"addRowBeforeDisabled()\" (click)=\"onAddRowBeforeClick()\" title=\"Add row before\">\n <i class=\"ri-insert-row-top\"></i>\n </button>\n <button monaButton [disabled]=\"addRowAfterDisabled()\" (click)=\"onAddRowAfterClick()\" title=\"Add row after\">\n <i class=\"ri-insert-row-bottom\"></i>\n </button>\n <button monaButton [disabled]=\"deleteColumnDisabled()\" (click)=\"onDeleteColumnClick()\" title=\"Delete column\">\n <i class=\"ri-delete-column\"></i>\n </button>\n <button monaButton [disabled]=\"deleteRowDisabled()\" (click)=\"onDeleteRowClick()\" title=\"Delete row\">\n <i class=\"ri-delete-row\"></i>\n </button>\n <button monaButton [disabled]=\"mergeCellsDisabled()\" (click)=\"onMergeCellsClick()\" title=\"Merge selected cells\">\n <i class=\"ri-merge-cells-horizontal\"></i>\n </button>\n <button monaButton [disabled]=\"splitCellDisabled()\" (click)=\"onSplitCellClick()\" title=\"Split cell\">\n <i class=\"ri-split-cells-horizontal\"></i>\n </button>\n <button monaButton [disabled]=\"toggleHeaderRowDisabled()\" (click)=\"onToggleHeaderRow()\" title=\"Toggle header row\">\n <i class=\"ri-table-line\"></i>\n </button>\n <button monaButton [disabled]=\"deleteTableDisabled()\" (click)=\"onDeleteTableClick()\" title=\"Delete table\">\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" }]
|
|
1535
|
+
args: [{ selector: "mona-editor-table", imports: [ButtonGroupComponent, ButtonDirective, PopoverComponent, EditorTableCreatorComponent], template: "<mona-button-group selection=\"single\" [size]=\"'small'\">\n <button monaButton title=\"Insert table\" #insertTableButton>\n <i class=\"ri-grid-line\"></i>\n </button>\n <button\n monaButton\n [disabled]=\"addColumnBeforeDisabled()\"\n (click)=\"onAddColumnBeforeClick()\"\n title=\"Add column before\">\n <i class=\"ri-insert-column-left\"></i>\n </button>\n <button monaButton [disabled]=\"addColumnAfterDisabled()\" (click)=\"onAddColumnAfterClick()\" title=\"Add column after\">\n <i class=\"ri-insert-column-right\"></i>\n </button>\n <button monaButton [disabled]=\"addRowBeforeDisabled()\" (click)=\"onAddRowBeforeClick()\" title=\"Add row before\">\n <i class=\"ri-insert-row-top\"></i>\n </button>\n <button monaButton [disabled]=\"addRowAfterDisabled()\" (click)=\"onAddRowAfterClick()\" title=\"Add row after\">\n <i class=\"ri-insert-row-bottom\"></i>\n </button>\n <button monaButton [disabled]=\"deleteColumnDisabled()\" (click)=\"onDeleteColumnClick()\" title=\"Delete column\">\n <i class=\"ri-delete-column\"></i>\n </button>\n <button monaButton [disabled]=\"deleteRowDisabled()\" (click)=\"onDeleteRowClick()\" title=\"Delete row\">\n <i class=\"ri-delete-row\"></i>\n </button>\n <button monaButton [disabled]=\"mergeCellsDisabled()\" (click)=\"onMergeCellsClick()\" title=\"Merge selected cells\">\n <i class=\"ri-merge-cells-horizontal\"></i>\n </button>\n <button monaButton [disabled]=\"splitCellDisabled()\" (click)=\"onSplitCellClick()\" title=\"Split cell\">\n <i class=\"ri-split-cells-horizontal\"></i>\n </button>\n <button monaButton [disabled]=\"toggleHeaderRowDisabled()\" (click)=\"onToggleHeaderRow()\" title=\"Toggle header row\">\n <i class=\"ri-table-line\"></i>\n </button>\n <button monaButton [disabled]=\"deleteTableDisabled()\" (click)=\"onDeleteTableClick()\" title=\"Delete table\">\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" }]
|
|
1172
1536
|
}], propDecorators: { popover: [{ type: i0.ViewChild, args: ["popoverComponent", { isSignal: true }] }] } });
|
|
1173
1537
|
|
|
1174
1538
|
class EditorTaskListComponent {
|
|
@@ -1185,11 +1549,11 @@ class EditorTaskListComponent {
|
|
|
1185
1549
|
this.#editorService.editor.chain().focus().toggleTaskList().run();
|
|
1186
1550
|
}
|
|
1187
1551
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorTaskListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1188
|
-
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()\" (click)=\"onTaskToggle()\" title=\"Insert task list\">\n <i class=\"ri-checkbox-fill\"></i>\n</button>\n",
|
|
1552
|
+
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=\"Insert task list\">\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", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }] }); }
|
|
1189
1553
|
}
|
|
1190
1554
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorTaskListComponent, decorators: [{
|
|
1191
1555
|
type: Component,
|
|
1192
|
-
args: [{ selector: "mona-editor-task-list", imports: [ButtonDirective], template: "<button monaButton [selected]=\"taskSelected()\" (click)=\"onTaskToggle()\" title=\"Insert task list\">\n <i class=\"ri-checkbox-fill\"></i>\n</button>\n" }]
|
|
1556
|
+
args: [{ selector: "mona-editor-task-list", imports: [ButtonDirective], template: "<button monaButton [selected]=\"taskSelected()\" [size]=\"'small'\" (click)=\"onTaskToggle()\" title=\"Insert task list\">\n <i class=\"ri-checkbox-fill\"></i>\n</button>\n" }]
|
|
1193
1557
|
}] });
|
|
1194
1558
|
|
|
1195
1559
|
class EditorTextAlignmentsComponent {
|
|
@@ -1250,51 +1614,70 @@ class EditorTextAlignmentsComponent {
|
|
|
1250
1614
|
}
|
|
1251
1615
|
}
|
|
1252
1616
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorTextAlignmentsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1253
|
-
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\">\
|
|
1617
|
+
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=\"Align text left\">\n <i class=\"ri-align-left\"></i>\n </button>\n <button\n monaButton\n [selected]=\"alignCenterSelected()\"\n [toggleable]=\"false\"\n (click)=\"onAlignCenter()\"\n title=\"Center text\">\n <i class=\"ri-align-center\"></i>\n </button>\n <button\n monaButton\n [selected]=\"alignRightSelected()\"\n [toggleable]=\"false\"\n (click)=\"onAlignRight()\"\n title=\"Align text right\">\n <i class=\"ri-align-right\"></i>\n </button>\n <button\n monaButton\n [selected]=\"alignJustifySelected()\"\n [toggleable]=\"false\"\n (click)=\"onAlignJustify()\"\n title=\"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", "toggleable", "class"], outputs: ["disabledChange", "loadingChange", "lookChange", "selectedChange"] }] }); }
|
|
1254
1618
|
}
|
|
1255
1619
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorTextAlignmentsComponent, decorators: [{
|
|
1256
1620
|
type: Component,
|
|
1257
|
-
args: [{ selector: "mona-editor-text-alignments", imports: [ButtonGroupComponent, ButtonDirective], template: "<mona-button-group selection=\"single\">\
|
|
1621
|
+
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=\"Align text left\">\n <i class=\"ri-align-left\"></i>\n </button>\n <button\n monaButton\n [selected]=\"alignCenterSelected()\"\n [toggleable]=\"false\"\n (click)=\"onAlignCenter()\"\n title=\"Center text\">\n <i class=\"ri-align-center\"></i>\n </button>\n <button\n monaButton\n [selected]=\"alignRightSelected()\"\n [toggleable]=\"false\"\n (click)=\"onAlignRight()\"\n title=\"Align text right\">\n <i class=\"ri-align-right\"></i>\n </button>\n <button\n monaButton\n [selected]=\"alignJustifySelected()\"\n [toggleable]=\"false\"\n (click)=\"onAlignJustify()\"\n title=\"Justify\">\n <i class=\"ri-align-justify\"></i>\n </button>\n</mona-button-group>\n" }]
|
|
1258
1622
|
}] });
|
|
1259
1623
|
|
|
1260
1624
|
class EditorComponent {
|
|
1625
|
+
#destroyRef;
|
|
1626
|
+
#themeService;
|
|
1261
1627
|
constructor() {
|
|
1628
|
+
this.#destroyRef = inject(DestroyRef);
|
|
1629
|
+
this.#themeService = inject(ThemeService);
|
|
1630
|
+
this.baseClass = computed(() => {
|
|
1631
|
+
const theme = this.#themeService.theme();
|
|
1632
|
+
const userClass = this.userClass();
|
|
1633
|
+
const variantClass = editorBaseThemeVariants(theme)();
|
|
1634
|
+
return twMerge(variantClass, userClass);
|
|
1635
|
+
}, /* @ts-ignore */
|
|
1636
|
+
...(ngDevMode ? [{ debugName: "baseClass" }] : /* istanbul ignore next */ []));
|
|
1637
|
+
this.containerClass = computed(() => {
|
|
1638
|
+
const theme = this.#themeService.theme();
|
|
1639
|
+
return editorContainerThemeVariants(theme)();
|
|
1640
|
+
}, /* @ts-ignore */
|
|
1641
|
+
...(ngDevMode ? [{ debugName: "containerClass" }] : /* istanbul ignore next */ []));
|
|
1262
1642
|
this.editorContainer = viewChild.required("editorContainer", /* @ts-ignore */
|
|
1263
1643
|
...(ngDevMode ? [{ debugName: "editorContainer" }] : /* istanbul ignore next */ []));
|
|
1264
1644
|
this.editorService = inject(EditorService);
|
|
1645
|
+
this.toolbarClass = computed(() => {
|
|
1646
|
+
const theme = this.#themeService.theme();
|
|
1647
|
+
return editorToolbarThemeVariants(theme)();
|
|
1648
|
+
}, /* @ts-ignore */
|
|
1649
|
+
...(ngDevMode ? [{ debugName: "toolbarClass" }] : /* istanbul ignore next */ []));
|
|
1265
1650
|
/**
|
|
1266
|
-
* Emits when the editor loses focus.
|
|
1651
|
+
* @description Emits when the editor loses focus.
|
|
1267
1652
|
*/
|
|
1268
1653
|
this.blur = output();
|
|
1269
1654
|
/**
|
|
1270
|
-
* Emits when the editor is created for the first time and is ready to be used.
|
|
1655
|
+
* @description Emits when the editor is created for the first time and is ready to be used.
|
|
1271
1656
|
*/
|
|
1272
1657
|
this.create = output();
|
|
1273
1658
|
/**
|
|
1274
|
-
* Emits when the editor gains focus.
|
|
1659
|
+
* @description Emits when the editor gains focus.
|
|
1275
1660
|
*/
|
|
1276
1661
|
this.focus = output();
|
|
1277
1662
|
/**
|
|
1278
|
-
* Emits when the selection of the editor changes.
|
|
1663
|
+
* @description Emits when the selection of the editor changes.
|
|
1279
1664
|
*/
|
|
1280
1665
|
this.selectionUpdate = output();
|
|
1281
1666
|
/**
|
|
1282
|
-
* Emits when the content of the editor changes.
|
|
1667
|
+
* @description Emits when the content of the editor changes.
|
|
1283
1668
|
*/
|
|
1284
1669
|
this.update = output();
|
|
1285
1670
|
/**
|
|
1286
|
-
* The initial content of the editor.
|
|
1287
|
-
* Accepted values are:
|
|
1288
|
-
* - A string representing the HTML content.
|
|
1289
|
-
* - A {@link JSONContent} representing the content.
|
|
1671
|
+
* @description The initial content of the editor.
|
|
1290
1672
|
*/
|
|
1291
1673
|
this.content = input(/* @ts-ignore */
|
|
1292
1674
|
...(ngDevMode ? [undefined, { debugName: "content" }] : /* istanbul ignore next */ []));
|
|
1293
1675
|
/**
|
|
1294
|
-
* The settings of the editor.
|
|
1676
|
+
* @description The settings of the editor.
|
|
1295
1677
|
*/
|
|
1296
1678
|
this.settings = input({}, /* @ts-ignore */
|
|
1297
1679
|
...(ngDevMode ? [{ debugName: "settings" }] : /* istanbul ignore next */ []));
|
|
1680
|
+
this.userClass = input("", { ...(ngDevMode ? { debugName: "userClass" } : /* istanbul ignore next */ {}), alias: "class" });
|
|
1298
1681
|
effect(() => {
|
|
1299
1682
|
const settings = this.settings();
|
|
1300
1683
|
untracked(() => {
|
|
@@ -1307,12 +1690,10 @@ class EditorComponent {
|
|
|
1307
1690
|
this.loadEditorContent(content);
|
|
1308
1691
|
});
|
|
1309
1692
|
});
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
ngOnInit() {
|
|
1315
|
-
this.setSubscriptions();
|
|
1693
|
+
afterNextRender({
|
|
1694
|
+
read: () => this.setSubscriptions()
|
|
1695
|
+
});
|
|
1696
|
+
this.#destroyRef.onDestroy(() => this.editorService.destroy());
|
|
1316
1697
|
}
|
|
1317
1698
|
loadEditorContent(content) {
|
|
1318
1699
|
if (typeof content === "string") {
|
|
@@ -1326,19 +1707,19 @@ class EditorComponent {
|
|
|
1326
1707
|
}
|
|
1327
1708
|
}
|
|
1328
1709
|
setSubscriptions() {
|
|
1329
|
-
this.editorService.blur$.subscribe(() => {
|
|
1710
|
+
this.editorService.blur$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(() => {
|
|
1330
1711
|
this.blur.emit();
|
|
1331
1712
|
});
|
|
1332
|
-
this.editorService.create$.subscribe(() => {
|
|
1713
|
+
this.editorService.create$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(() => {
|
|
1333
1714
|
this.create.emit();
|
|
1334
1715
|
});
|
|
1335
|
-
this.editorService.focus$.subscribe(() => {
|
|
1716
|
+
this.editorService.focus$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(() => {
|
|
1336
1717
|
this.focus.emit();
|
|
1337
1718
|
});
|
|
1338
|
-
this.editorService.selectionUpdate$.subscribe(() => {
|
|
1719
|
+
this.editorService.selectionUpdate$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(() => {
|
|
1339
1720
|
this.selectionUpdate.emit();
|
|
1340
1721
|
});
|
|
1341
|
-
this.editorService.update$.subscribe(() => {
|
|
1722
|
+
this.editorService.update$.pipe(takeUntilDestroyed(this.#destroyRef)).subscribe(() => {
|
|
1342
1723
|
this.update.emit({
|
|
1343
1724
|
html: this.html,
|
|
1344
1725
|
json: this.json
|
|
@@ -1360,7 +1741,7 @@ class EditorComponent {
|
|
|
1360
1741
|
return this.editorService.editor.getJSON();
|
|
1361
1742
|
}
|
|
1362
1743
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1363
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: EditorComponent, isStandalone: true, selector: "mona-editor", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, settings: { classPropertyName: "settings", publicName: "settings", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { blur: "blur", create: "create", focus: "focus", selectionUpdate: "selectionUpdate", update: "update" }, host: {
|
|
1744
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: EditorComponent, isStandalone: true, selector: "mona-editor", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, settings: { classPropertyName: "settings", publicName: "settings", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { blur: "blur", create: "create", focus: "focus", selectionUpdate: "selectionUpdate", update: "update" }, host: { properties: { "class": "baseClass()" } }, providers: [EditorService], viewQueries: [{ propertyName: "editorContainer", first: true, predicate: ["editorContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div [class]=\"toolbarClass()\">\n <mona-editor-basic-text-styles></mona-editor-basic-text-styles>\n @if (editorService.settings().headings) {\n <mona-editor-headings></mona-editor-headings>\n }\n @if (editorService.settings().alignment) {\n <mona-editor-text-alignments></mona-editor-text-alignments>\n }\n @if (editorService.settings().fontSize) {\n <mona-editor-font-size></mona-editor-font-size>\n }\n @if (editorService.settings().fontFamily) {\n <mona-editor-font-family></mona-editor-font-family>\n }\n @if (editorService.settings().fontColor) {\n <mona-editor-font-color></mona-editor-font-color>\n }\n @if (editorService.settings().fontHighlight) {\n <mona-editor-font-highlight></mona-editor-font-highlight>\n }\n @if (editorService.settings().blockquote) {\n <mona-editor-blockquote></mona-editor-blockquote>\n }\n @if (editorService.settings().code) {\n <mona-editor-code-block></mona-editor-code-block>\n }\n @if (editorService.settings().link) {\n <mona-editor-link></mona-editor-link>\n }\n @if (editorService.settings().list) {\n <mona-editor-list></mona-editor-list>\n }\n @if (editorService.settings().taskList) {\n <mona-editor-task-list></mona-editor-task-list>\n }\n @if (editorService.settings().indent) {\n <mona-editor-indent></mona-editor-indent>\n }\n @if (editorService.settings().history) {\n <mona-editor-history></mona-editor-history>\n }\n @if (editorService.settings().horizontalRule) {\n <mona-editor-horizontal-rule></mona-editor-horizontal-rule>\n }\n @if (editorService.settings().image) {\n <mona-editor-image></mona-editor-image>\n }\n @if (editorService.settings().table) {\n <mona-editor-table></mona-editor-table>\n }\n</div>\n<div [class]=\"containerClass()\" #editorContainer></div>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: EditorBasicTextStylesComponent, selector: "mona-editor-basic-text-styles" }, { kind: "component", type: EditorHeadingsComponent, selector: "mona-editor-headings" }, { kind: "component", type: EditorTextAlignmentsComponent, selector: "mona-editor-text-alignments" }, { kind: "component", type: EditorFontSizeComponent, selector: "mona-editor-font-size" }, { kind: "component", type: EditorFontColorComponent, selector: "mona-editor-font-color" }, { kind: "component", type: EditorFontHighlightComponent, selector: "mona-editor-font-highlight" }, { kind: "component", type: EditorBlockquoteComponent, selector: "mona-editor-blockquote" }, { kind: "component", type: EditorLinkComponent, selector: "mona-editor-link" }, { kind: "component", type: EditorListComponent, selector: "mona-editor-list" }, { kind: "component", type: EditorIndentComponent, selector: "mona-editor-indent" }, { kind: "component", type: EditorHistoryComponent, selector: "mona-editor-history" }, { kind: "component", type: EditorFontFamilyComponent, selector: "mona-editor-font-family" }, { kind: "component", type: EditorHorizontalRuleComponent, selector: "mona-editor-horizontal-rule" }, { kind: "component", type: EditorTaskListComponent, selector: "mona-editor-task-list" }, { kind: "component", type: EditorImageComponent, selector: "mona-editor-image" }, { kind: "component", type: EditorTableComponent, selector: "mona-editor-table" }, { kind: "component", type: EditorCodeBlockComponent, selector: "mona-editor-code-block" }] }); }
|
|
1364
1745
|
}
|
|
1365
1746
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditorComponent, decorators: [{
|
|
1366
1747
|
type: Component,
|
|
@@ -1384,9 +1765,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
1384
1765
|
EditorTableComponent,
|
|
1385
1766
|
EditorCodeBlockComponent
|
|
1386
1767
|
], providers: [EditorService], host: {
|
|
1387
|
-
class: "
|
|
1388
|
-
}, template: "<div class=\"
|
|
1389
|
-
}], ctorParameters: () => [], propDecorators: { editorContainer: [{ type: i0.ViewChild, args: ["editorContainer", { isSignal: true }] }], blur: [{ type: i0.Output, args: ["blur"] }], create: [{ type: i0.Output, args: ["create"] }], focus: [{ type: i0.Output, args: ["focus"] }], selectionUpdate: [{ type: i0.Output, args: ["selectionUpdate"] }], update: [{ type: i0.Output, args: ["update"] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], settings: [{ type: i0.Input, args: [{ isSignal: true, alias: "settings", required: false }] }] } });
|
|
1768
|
+
"[class]": "baseClass()"
|
|
1769
|
+
}, template: "<div [class]=\"toolbarClass()\">\n <mona-editor-basic-text-styles></mona-editor-basic-text-styles>\n @if (editorService.settings().headings) {\n <mona-editor-headings></mona-editor-headings>\n }\n @if (editorService.settings().alignment) {\n <mona-editor-text-alignments></mona-editor-text-alignments>\n }\n @if (editorService.settings().fontSize) {\n <mona-editor-font-size></mona-editor-font-size>\n }\n @if (editorService.settings().fontFamily) {\n <mona-editor-font-family></mona-editor-font-family>\n }\n @if (editorService.settings().fontColor) {\n <mona-editor-font-color></mona-editor-font-color>\n }\n @if (editorService.settings().fontHighlight) {\n <mona-editor-font-highlight></mona-editor-font-highlight>\n }\n @if (editorService.settings().blockquote) {\n <mona-editor-blockquote></mona-editor-blockquote>\n }\n @if (editorService.settings().code) {\n <mona-editor-code-block></mona-editor-code-block>\n }\n @if (editorService.settings().link) {\n <mona-editor-link></mona-editor-link>\n }\n @if (editorService.settings().list) {\n <mona-editor-list></mona-editor-list>\n }\n @if (editorService.settings().taskList) {\n <mona-editor-task-list></mona-editor-task-list>\n }\n @if (editorService.settings().indent) {\n <mona-editor-indent></mona-editor-indent>\n }\n @if (editorService.settings().history) {\n <mona-editor-history></mona-editor-history>\n }\n @if (editorService.settings().horizontalRule) {\n <mona-editor-horizontal-rule></mona-editor-horizontal-rule>\n }\n @if (editorService.settings().image) {\n <mona-editor-image></mona-editor-image>\n }\n @if (editorService.settings().table) {\n <mona-editor-table></mona-editor-table>\n }\n</div>\n<div [class]=\"containerClass()\" #editorContainer></div>\n" }]
|
|
1770
|
+
}], ctorParameters: () => [], propDecorators: { editorContainer: [{ type: i0.ViewChild, args: ["editorContainer", { isSignal: true }] }], blur: [{ type: i0.Output, args: ["blur"] }], create: [{ type: i0.Output, args: ["create"] }], focus: [{ type: i0.Output, args: ["focus"] }], selectionUpdate: [{ type: i0.Output, args: ["selectionUpdate"] }], update: [{ type: i0.Output, args: ["update"] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], settings: [{ type: i0.Input, args: [{ isSignal: true, alias: "settings", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
1390
1771
|
|
|
1391
1772
|
/*
|
|
1392
1773
|
* Public API Surface of @nanahoshi/mona-ui/editor
|