@phuong-tran-redoc/document-engine-angular 0.0.21 → 0.0.22

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/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { OnInit, OnChanges, OnDestroy, EventEmitter, SimpleChanges, Type, Injector, ElementRef, AfterViewInit, Renderer2, ChangeDetectorRef, AfterContentInit, QueryList } from '@angular/core';
3
- import { IndentOptions, DynamicFieldOptions, DynamicFieldCategory as DynamicFieldCategory$1, RestrictedEditingOptions, Color, TextCaseType, ListStyleType, DynamicFieldItem as DynamicFieldItem$1 } from '@phuong-tran-redoc/document-engine-core';
3
+ import { IndentOptions, DynamicFieldOptions, DynamicFieldCategory as DynamicFieldCategory$1, RestrictedEditingOptions, TextCaseType, ListStyleType, Color, DynamicFieldItem as DynamicFieldItem$1 } from '@phuong-tran-redoc/document-engine-core';
4
4
  import { BlockquoteOptions } from '@tiptap/extension-blockquote';
5
5
  import { BoldOptions } from '@tiptap/extension-bold';
6
6
  import { CodeOptions } from '@tiptap/extension-code';
@@ -19,6 +19,7 @@ import { UnderlineOptions } from '@tiptap/extension-underline';
19
19
  import { UndoRedoOptions, PlaceholderOptions, CharacterCountOptions } from '@tiptap/extensions';
20
20
  import { Editor, Content, EditorEvents, Extension } from '@tiptap/core';
21
21
  export { Editor } from '@tiptap/core';
22
+ import * as i2 from '@angular/common';
22
23
  import { BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu';
23
24
  import * as _angular_forms from '@angular/forms';
24
25
  import { ControlValueAccessor, ValidatorFn, FormControl } from '@angular/forms';
@@ -341,7 +342,7 @@ declare class DocumentEditorComponent implements OnInit, OnChanges, OnDestroy {
341
342
  */
342
343
  private mergeConfig;
343
344
  static ɵfac: i0.ɵɵFactoryDeclaration<DocumentEditorComponent, never>;
344
- static ɵcmp: i0.ɵɵComponentDeclaration<DocumentEditorComponent, "document-engine-editor", never, { "config": { "alias": "config"; "required": false; }; }, { "editorReady": "editorReady"; }, never, ["*"], true, never>;
345
+ static ɵcmp: i0.ɵɵComponentDeclaration<DocumentEditorComponent, "document-engine-editor", never, { "config": { "alias": "config"; "required": false; }; }, { "editorReady": "editorReady"; }, never, ["*"], false, never>;
345
346
  }
346
347
 
347
348
  type BubbleTarget = {
@@ -505,6 +506,143 @@ interface ToolbarBubbleMenuConfig {
505
506
  maxWidth?: string;
506
507
  }
507
508
 
509
+ interface ToolbarState {
510
+ isReadOnly: boolean;
511
+ canUndo: boolean;
512
+ canRedo: boolean;
513
+ canResetFormat: boolean;
514
+ canToggleBold: boolean;
515
+ canToggleItalic: boolean;
516
+ canToggleUnderline: boolean;
517
+ canToggleStrike: boolean;
518
+ canToggleSubscript: boolean;
519
+ canToggleSuperscript: boolean;
520
+ canToggleCode: boolean;
521
+ canToggleLink: boolean;
522
+ canDecreaseIndent: boolean;
523
+ canIncreaseIndent: boolean;
524
+ canToggleBulletList: boolean;
525
+ canToggleBlockquote: boolean;
526
+ canInsertPageBreak: boolean;
527
+ canToggleEditableRegion: boolean;
528
+ canClearContent: boolean;
529
+ }
530
+ declare const DEFAULT_TOOLBAR_STATE: ToolbarState;
531
+ declare function buildToolbarState(editor: Editor, config?: Partial<DocumentEngineConfig>): ToolbarState;
532
+
533
+ /**
534
+ * Toolbar component for document editor
535
+ * Provides toolbar controls for editor actions
536
+ */
537
+ declare class ToolbarComponent implements OnInit, OnDestroy {
538
+ private readonly cdr;
539
+ private readonly toolbarService;
540
+ editor: Editor;
541
+ capabilities: EditorCapabilities;
542
+ config?: Partial<DocumentEngineConfig>;
543
+ readonly action: i0.EventEmitter<string>;
544
+ activeFontSize: string | null;
545
+ activeLineHeight: string | null;
546
+ activeHeading: number | null;
547
+ activeTextAlign: string | null;
548
+ activeTextAlignIcon: string;
549
+ toolbarState: ToolbarState;
550
+ readonly fontSizeOptions: {
551
+ value: string;
552
+ label: string;
553
+ }[];
554
+ readonly lineHeightOptions: ({
555
+ value: null;
556
+ label: string;
557
+ } | {
558
+ value: string;
559
+ label: string;
560
+ })[];
561
+ readonly textCaseOptions: {
562
+ value: TextCaseType;
563
+ label: string;
564
+ }[];
565
+ readonly headingOptions: ({
566
+ value: null;
567
+ label: string;
568
+ class: string;
569
+ } | {
570
+ value: number;
571
+ label: string;
572
+ class: string;
573
+ })[];
574
+ readonly textAlignOptions: {
575
+ value: string;
576
+ label: string;
577
+ icon: string;
578
+ }[];
579
+ readonly listStyleOptions: {
580
+ value: ListStyleType;
581
+ label: string;
582
+ example: string;
583
+ }[];
584
+ private colorBubbleMenu;
585
+ private linkBubbleWrapper;
586
+ private imageBubbleMenu;
587
+ private specialCharsBubbleMenu;
588
+ private dynamicFieldsBubbleMenu;
589
+ private templateBubbleMenu;
590
+ private tableCreateBubbleMenu;
591
+ readonly colorBubbleConfig: ToolbarBubbleMenuConfig;
592
+ readonly linkBubbleConfig: EditorBubbleMenuConfig;
593
+ readonly tableBubbleConfig: EditorBubbleMenuConfig;
594
+ readonly imageBubbleConfig: ToolbarBubbleMenuConfig;
595
+ readonly specialCharsBubbleConfig: ToolbarBubbleMenuConfig;
596
+ readonly dynamicFieldsBubbleConfig: ToolbarBubbleMenuConfig;
597
+ readonly templateBubbleConfig: ToolbarBubbleMenuConfig;
598
+ readonly tableCreateBubbleConfig: ToolbarBubbleMenuConfig;
599
+ private throttleUpdateToolbarState;
600
+ private updateToolbarState;
601
+ ngOnInit(): void;
602
+ ngOnDestroy(): void;
603
+ runAndEmit(actionName: string, chain: () => void): void;
604
+ setFontSize(size: string | null): void;
605
+ setLineHeight(lineHeight: string | null): void;
606
+ setHeading(level: string | null): void;
607
+ setTextAlign(align: string | null): void;
608
+ setListStyle(listStyleType: ListStyleType): void;
609
+ openColorBubble(event: MouseEvent, type: 'text' | 'fill'): void;
610
+ toggleLink(): void;
611
+ insertImage(event: MouseEvent): void;
612
+ openSpecialCharsBubble(event: MouseEvent): void;
613
+ openDynamicFieldsBubble(event: MouseEvent): void;
614
+ openTemplateBubble(event: MouseEvent): void;
615
+ openCreateTableBubble(event: MouseEvent): void;
616
+ trackByValue(index: number, item: {
617
+ value: unknown;
618
+ }): unknown;
619
+ trackByIndex(index: number): number;
620
+ get customToolbarButtons(): ToolbarButton[];
621
+ handleCustomIconButton(button: ToolbarButton): void;
622
+ handleCustomSelectButton(button: ToolbarButton, value: string): void;
623
+ printValue(): void;
624
+ static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarComponent, never>;
625
+ static ɵcmp: i0.ɵɵComponentDeclaration<ToolbarComponent, "document-engine-toolbar", never, { "editor": { "alias": "editor"; "required": false; }; "capabilities": { "alias": "capabilities"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, { "action": "action"; }, never, never, true, never>;
626
+ }
627
+
628
+ /**
629
+ * Footer component for document editor
630
+ * Container for footer components like character count
631
+ */
632
+ declare class FooterComponent {
633
+ editor: Editor;
634
+ config?: Partial<DocumentEngineConfig>;
635
+ hasCharacterCount(): boolean;
636
+ static ɵfac: i0.ɵɵFactoryDeclaration<FooterComponent, never>;
637
+ static ɵcmp: i0.ɵɵComponentDeclaration<FooterComponent, "document-engine-footer", never, { "editor": { "alias": "editor"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
638
+ }
639
+
640
+ declare class DocumentEditorModule {
641
+ static ɵfac: i0.ɵɵFactoryDeclaration<DocumentEditorModule, never>;
642
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DocumentEditorModule, [typeof DocumentEditorComponent], [typeof i2.CommonModule, typeof ToolbarComponent, typeof FooterComponent], [typeof DocumentEditorComponent]>;
643
+ static ɵinj: i0.ɵɵInjectorDeclaration<DocumentEditorModule>;
644
+ }
645
+
508
646
  declare class TiptapBubbleMenuDirective implements OnInit, OnDestroy {
509
647
  private elRef;
510
648
  props: BubbleMenuProps;
@@ -903,125 +1041,6 @@ declare class SelectComponent implements AfterContentInit, OnChanges, OnDestroy,
903
1041
  static ɵcmp: i0.ɵɵComponentDeclaration<SelectComponent, "document-engine-select", never, { "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "labelMode": { "alias": "labelMode"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; }, { "valueChange": "valueChange"; }, ["labelDirectives", "options"], ["[documentEngineSelectLabel]", "*"], true, never>;
904
1042
  }
905
1043
 
906
- interface ToolbarState {
907
- isReadOnly: boolean;
908
- canUndo: boolean;
909
- canRedo: boolean;
910
- canResetFormat: boolean;
911
- canToggleBold: boolean;
912
- canToggleItalic: boolean;
913
- canToggleUnderline: boolean;
914
- canToggleStrike: boolean;
915
- canToggleSubscript: boolean;
916
- canToggleSuperscript: boolean;
917
- canToggleCode: boolean;
918
- canToggleLink: boolean;
919
- canDecreaseIndent: boolean;
920
- canIncreaseIndent: boolean;
921
- canToggleBulletList: boolean;
922
- canToggleBlockquote: boolean;
923
- canInsertPageBreak: boolean;
924
- canToggleEditableRegion: boolean;
925
- canClearContent: boolean;
926
- }
927
- declare const DEFAULT_TOOLBAR_STATE: ToolbarState;
928
- declare function buildToolbarState(editor: Editor, config?: Partial<DocumentEngineConfig>): ToolbarState;
929
-
930
- /**
931
- * Toolbar component for document editor
932
- * Provides toolbar controls for editor actions
933
- */
934
- declare class ToolbarComponent implements OnInit, OnDestroy {
935
- private readonly cdr;
936
- private readonly toolbarService;
937
- editor: Editor;
938
- capabilities: EditorCapabilities;
939
- config?: Partial<DocumentEngineConfig>;
940
- readonly action: i0.EventEmitter<string>;
941
- activeFontSize: string | null;
942
- activeLineHeight: string | null;
943
- activeHeading: number | null;
944
- activeTextAlign: string | null;
945
- activeTextAlignIcon: string;
946
- toolbarState: ToolbarState;
947
- readonly fontSizeOptions: {
948
- value: string;
949
- label: string;
950
- }[];
951
- readonly lineHeightOptions: ({
952
- value: null;
953
- label: string;
954
- } | {
955
- value: string;
956
- label: string;
957
- })[];
958
- readonly textCaseOptions: {
959
- value: TextCaseType;
960
- label: string;
961
- }[];
962
- readonly headingOptions: ({
963
- value: null;
964
- label: string;
965
- class: string;
966
- } | {
967
- value: number;
968
- label: string;
969
- class: string;
970
- })[];
971
- readonly textAlignOptions: {
972
- value: string;
973
- label: string;
974
- icon: string;
975
- }[];
976
- readonly listStyleOptions: {
977
- value: ListStyleType;
978
- label: string;
979
- example: string;
980
- }[];
981
- private colorBubbleMenu;
982
- private linkBubbleWrapper;
983
- private imageBubbleMenu;
984
- private specialCharsBubbleMenu;
985
- private dynamicFieldsBubbleMenu;
986
- private templateBubbleMenu;
987
- private tableCreateBubbleMenu;
988
- readonly colorBubbleConfig: ToolbarBubbleMenuConfig;
989
- readonly linkBubbleConfig: EditorBubbleMenuConfig;
990
- readonly tableBubbleConfig: EditorBubbleMenuConfig;
991
- readonly imageBubbleConfig: ToolbarBubbleMenuConfig;
992
- readonly specialCharsBubbleConfig: ToolbarBubbleMenuConfig;
993
- readonly dynamicFieldsBubbleConfig: ToolbarBubbleMenuConfig;
994
- readonly templateBubbleConfig: ToolbarBubbleMenuConfig;
995
- readonly tableCreateBubbleConfig: ToolbarBubbleMenuConfig;
996
- private throttleUpdateToolbarState;
997
- private updateToolbarState;
998
- ngOnInit(): void;
999
- ngOnDestroy(): void;
1000
- runAndEmit(actionName: string, chain: () => void): void;
1001
- setFontSize(size: string | null): void;
1002
- setLineHeight(lineHeight: string | null): void;
1003
- setHeading(level: string | null): void;
1004
- setTextAlign(align: string | null): void;
1005
- setListStyle(listStyleType: ListStyleType): void;
1006
- openColorBubble(event: MouseEvent, type: 'text' | 'fill'): void;
1007
- toggleLink(): void;
1008
- insertImage(event: MouseEvent): void;
1009
- openSpecialCharsBubble(event: MouseEvent): void;
1010
- openDynamicFieldsBubble(event: MouseEvent): void;
1011
- openTemplateBubble(event: MouseEvent): void;
1012
- openCreateTableBubble(event: MouseEvent): void;
1013
- trackByValue(index: number, item: {
1014
- value: unknown;
1015
- }): unknown;
1016
- trackByIndex(index: number): number;
1017
- get customToolbarButtons(): ToolbarButton[];
1018
- handleCustomIconButton(button: ToolbarButton): void;
1019
- handleCustomSelectButton(button: ToolbarButton, value: string): void;
1020
- printValue(): void;
1021
- static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarComponent, never>;
1022
- static ɵcmp: i0.ɵɵComponentDeclaration<ToolbarComponent, "document-engine-toolbar", never, { "editor": { "alias": "editor"; "required": false; }; "capabilities": { "alias": "capabilities"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, { "action": "action"; }, never, never, true, never>;
1023
- }
1024
-
1025
1044
  /**
1026
1045
  * Service to handle toolbar action emissions
1027
1046
  */
@@ -1041,18 +1060,6 @@ declare class ToolbarService implements OnDestroy {
1041
1060
  static ɵprov: i0.ɵɵInjectableDeclaration<ToolbarService>;
1042
1061
  }
1043
1062
 
1044
- /**
1045
- * Footer component for document editor
1046
- * Container for footer components like character count
1047
- */
1048
- declare class FooterComponent {
1049
- editor: Editor;
1050
- config?: Partial<DocumentEngineConfig>;
1051
- hasCharacterCount(): boolean;
1052
- static ɵfac: i0.ɵɵFactoryDeclaration<FooterComponent, never>;
1053
- static ɵcmp: i0.ɵɵComponentDeclaration<FooterComponent, "document-engine-footer", never, { "editor": { "alias": "editor"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
1054
- }
1055
-
1056
1063
  /**
1057
1064
  * Character Count component for document editor footer
1058
1065
  * Displays character/word count with optional limit and color coding
@@ -1694,5 +1701,5 @@ declare class EditorBubbleMenuComponent implements OnInit, AfterViewInit, OnDest
1694
1701
  static ɵcmp: i0.ɵɵComponentDeclaration<EditorBubbleMenuComponent, "document-engine-editor-bubble-menu", never, { "editor": { "alias": "editor"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
1695
1702
  }
1696
1703
 
1697
- export { ARCHIVE, ARROW_DROP_DOWN, AngularRenderer, ButtonDirective, CHECK, CLEAR_ALL, CLOSE, CODE, CharacterCountComponent, CheckboxComponent, ColorPickerComponent, ColorPickerViewComponent, DEFAULT, DEFAULT_TOOLBAR_STATE, DESCRIPTION, DYNAMIC_FORM, DocumentEditorComponent, DocumentEngineKit, DynamicFieldsViewComponent, EDIT, EditorBubbleMenuComponent, EditorCapabilities, ErrorMessageComponent, EventManager, FORMAT_ALIGN_CENTER, FORMAT_ALIGN_JUSTIFY, FORMAT_ALIGN_LEFT, FORMAT_ALIGN_RIGHT, FORMAT_BOLD, FORMAT_CLEAR, FORMAT_COLOR_FILL, FORMAT_COLOR_TEXT, FORMAT_INDENT_DECREASE, FORMAT_INDENT_INCREASE, FORMAT_ITALIC, FORMAT_LINE_SPACING, FORMAT_LIST_BULLETED, FORMAT_LIST_NUMBERED, FORMAT_QUOTE, FORMAT_SIZE, FORMAT_STRIKETHROUGH, FORMAT_UNDERLINE, FocusTrapService, FooterComponent, INSERT_PAGE_BREAK, IconComponent, IconRegistryService, ImageInsertViewComponent, InputDirective, LINK, LINK_OFF, LabelDirective, LinkEditViewComponent, LinkMainViewComponent, LinkPropertiesViewComponent, MARKDOWN, MATCH_CASE, PHOTO, PRINT, PopoverDirective, REDO, RESTRICT_EDIT, SEARCH, SEARCH_OFF, SETTINGS, SPECIAL_CHARACTER, SUBSCRIPT, SUPERSCRIPT, SelectComponent, SelectLabelDirective, SelectOptionDirective, SpecialCharactersViewComponent, TABLE_CELL_PROPERTY, TABLE_COLUMN, TABLE_MERGE_CELL, TABLE_PROPERTY, TABLE_ROW, TABLE_ROWS, TableCellStyleViewComponent, TableCreateViewComponent, TableMainViewComponent, TableStyleViewComponent, TemplateViewComponent, TiptapBubbleMenuDirective, TiptapDraggableDirective, TiptapEditorDirective, TiptapFloatingMenuDirective, ToggleGroupComponent, ToggleOptionDirective, ToolbarBubbleMenuComponent, ToolbarComponent, ToolbarService, UNDO, VERTICAL_ALIGN_BOTTOM, VERTICAL_ALIGN_CENTER, VERTICAL_ALIGN_TOP, buildToolbarState, selectionChangeHandler, shouldShowFnFactory, urlValidator };
1704
+ export { ARCHIVE, ARROW_DROP_DOWN, AngularRenderer, ButtonDirective, CHECK, CLEAR_ALL, CLOSE, CODE, CharacterCountComponent, CheckboxComponent, ColorPickerComponent, ColorPickerViewComponent, DEFAULT, DEFAULT_TOOLBAR_STATE, DESCRIPTION, DYNAMIC_FORM, DocumentEditorComponent, DocumentEditorModule, DocumentEngineKit, DynamicFieldsViewComponent, EDIT, EditorBubbleMenuComponent, EditorCapabilities, ErrorMessageComponent, EventManager, FORMAT_ALIGN_CENTER, FORMAT_ALIGN_JUSTIFY, FORMAT_ALIGN_LEFT, FORMAT_ALIGN_RIGHT, FORMAT_BOLD, FORMAT_CLEAR, FORMAT_COLOR_FILL, FORMAT_COLOR_TEXT, FORMAT_INDENT_DECREASE, FORMAT_INDENT_INCREASE, FORMAT_ITALIC, FORMAT_LINE_SPACING, FORMAT_LIST_BULLETED, FORMAT_LIST_NUMBERED, FORMAT_QUOTE, FORMAT_SIZE, FORMAT_STRIKETHROUGH, FORMAT_UNDERLINE, FocusTrapService, FooterComponent, INSERT_PAGE_BREAK, IconComponent, IconRegistryService, ImageInsertViewComponent, InputDirective, LINK, LINK_OFF, LabelDirective, LinkEditViewComponent, LinkMainViewComponent, LinkPropertiesViewComponent, MARKDOWN, MATCH_CASE, PHOTO, PRINT, PopoverDirective, REDO, RESTRICT_EDIT, SEARCH, SEARCH_OFF, SETTINGS, SPECIAL_CHARACTER, SUBSCRIPT, SUPERSCRIPT, SelectComponent, SelectLabelDirective, SelectOptionDirective, SpecialCharactersViewComponent, TABLE_CELL_PROPERTY, TABLE_COLUMN, TABLE_MERGE_CELL, TABLE_PROPERTY, TABLE_ROW, TABLE_ROWS, TableCellStyleViewComponent, TableCreateViewComponent, TableMainViewComponent, TableStyleViewComponent, TemplateViewComponent, TiptapBubbleMenuDirective, TiptapDraggableDirective, TiptapEditorDirective, TiptapFloatingMenuDirective, ToggleGroupComponent, ToggleOptionDirective, ToolbarBubbleMenuComponent, ToolbarComponent, ToolbarService, UNDO, VERTICAL_ALIGN_BOTTOM, VERTICAL_ALIGN_CENTER, VERTICAL_ALIGN_TOP, buildToolbarState, selectionChangeHandler, shouldShowFnFactory, urlValidator };
1698
1705
  export type { BubbleMenuProps, BubbleMenuViewConfig, BubbleMenuViewContent, BubbleTarget, ButtonType, DocumentEngineConfig, DynamicFieldCategory, DynamicFieldItem, EditorBubbleMenuConfig, HeadingLevel, IconButton, OutsideHandler, SelectButton, SelectOption, TableCreateViewData, TemplateItem, ToolbarBubbleMenuConfig, ToolbarButton, ToolbarState };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phuong-tran-redoc/document-engine-angular",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "type": "commonjs",
5
5
  "license": "MIT",
6
6
  "author": "Duc Phuong (Jack) <tdp99.business@gmail.com>",
@@ -26,7 +26,7 @@
26
26
  "dependencies": {
27
27
  "tslib": "^2.3.0",
28
28
  "@floating-ui/dom": "^1.7.4",
29
- "@phuong-tran-redoc/document-engine-core": "0.0.21"
29
+ "@phuong-tran-redoc/document-engine-core": "0.0.22"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "rxjs": "^7.5.0",