@phuong-tran-redoc/document-engine-angular 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +95 -233
- package/THIRD-PARTY-NOTICES.txt +67 -0
- package/fesm2022/phuong-tran-redoc-document-engine-angular.mjs +125 -121
- package/fesm2022/phuong-tran-redoc-document-engine-angular.mjs.map +1 -1
- package/index.d.ts +222 -218
- package/package.json +10 -2
package/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { OnInit, OnChanges, OnDestroy, EventEmitter, SimpleChanges,
|
|
3
|
-
import { IndentOptions, DynamicFieldOptions, DynamicFieldCategory as DynamicFieldCategory$1, RestrictedEditingOptions, TextCaseType, ListStyleType,
|
|
2
|
+
import { OnInit, OnChanges, OnDestroy, EventEmitter, SimpleChanges, InjectionToken, AfterViewInit, ElementRef, Renderer2, ChangeDetectorRef, Type, Injector, 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';
|
|
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,10 +19,9 @@ 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';
|
|
23
|
-
import { BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu';
|
|
24
22
|
import * as _angular_forms from '@angular/forms';
|
|
25
23
|
import { ControlValueAccessor, ValidatorFn, FormControl } from '@angular/forms';
|
|
24
|
+
import { BubbleMenuPluginProps } from '@tiptap/extension-bubble-menu';
|
|
26
25
|
import { FloatingMenuPluginProps } from '@tiptap/extension-floating-menu';
|
|
27
26
|
import { Placement } from '@floating-ui/dom';
|
|
28
27
|
import { SafeHtml } from '@angular/platform-browser';
|
|
@@ -387,7 +386,93 @@ declare class DocumentEditorComponent implements OnInit, OnChanges, OnDestroy {
|
|
|
387
386
|
*/
|
|
388
387
|
private mergeConfig;
|
|
389
388
|
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentEditorComponent, never>;
|
|
390
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DocumentEditorComponent, "document-engine-editor", never, { "config": { "alias": "config"; "required": false; }; }, { "editorReady": "editorReady"; }, never, ["*"],
|
|
389
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DocumentEditorComponent, "document-engine-editor", never, { "config": { "alias": "config"; "required": false; }; }, { "editorReady": "editorReady"; }, never, ["*"], true, never>;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Type definition for HTML preprocessor function.
|
|
394
|
+
* Allows clients to transform HTML content before it's set into the editor.
|
|
395
|
+
*
|
|
396
|
+
* @param html - The raw HTML string to be processed
|
|
397
|
+
* @returns The processed HTML string that will be set into the editor
|
|
398
|
+
*
|
|
399
|
+
* @example
|
|
400
|
+
* ```typescript
|
|
401
|
+
* const myPreprocessor: EditorHtmlPreprocessor = (html: string) => {
|
|
402
|
+
* // Remove all script tags for security
|
|
403
|
+
* return html.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '');
|
|
404
|
+
* };
|
|
405
|
+
* ```
|
|
406
|
+
*/
|
|
407
|
+
type EditorHtmlPreprocessor = (html: string) => string;
|
|
408
|
+
/**
|
|
409
|
+
* Injection token for HTML preprocessor function.
|
|
410
|
+
* Use this token to provide a custom function that processes HTML content
|
|
411
|
+
* before it's set into the TipTap editor.
|
|
412
|
+
*
|
|
413
|
+
* This is optional - if not provided, the editor will use the HTML content as-is.
|
|
414
|
+
*
|
|
415
|
+
* @example
|
|
416
|
+
* ```typescript
|
|
417
|
+
* // In your component or module providers
|
|
418
|
+
* {
|
|
419
|
+
* provide: EDITOR_HTML_PREPROCESSOR,
|
|
420
|
+
* useValue: (html: string) => {
|
|
421
|
+
* // Your custom preprocessing logic
|
|
422
|
+
* return html.replace(/old/g, 'new');
|
|
423
|
+
* }
|
|
424
|
+
* }
|
|
425
|
+
* ```
|
|
426
|
+
*/
|
|
427
|
+
declare const EDITOR_HTML_PREPROCESSOR: InjectionToken<EditorHtmlPreprocessor>;
|
|
428
|
+
/**
|
|
429
|
+
* Injection token for content wrapper class.
|
|
430
|
+
* Use this token to provide a custom class name for the content wrapper element.
|
|
431
|
+
*
|
|
432
|
+
* @example
|
|
433
|
+
* ```typescript
|
|
434
|
+
* // In your component or module providers
|
|
435
|
+
* {
|
|
436
|
+
* provide: EDITOR_CONTENT_WRAPPER_CLASS,
|
|
437
|
+
* useValue: 'my-content-wrapper'
|
|
438
|
+
* }
|
|
439
|
+
* ```
|
|
440
|
+
*/
|
|
441
|
+
declare const EDITOR_CONTENT_WRAPPER_CLASS: InjectionToken<string | null>;
|
|
442
|
+
|
|
443
|
+
declare class TiptapEditorDirective implements OnInit, AfterViewInit, ControlValueAccessor {
|
|
444
|
+
protected elRef: ElementRef<HTMLElement>;
|
|
445
|
+
protected renderer: Renderer2;
|
|
446
|
+
protected changeDetectorRef: ChangeDetectorRef;
|
|
447
|
+
protected htmlPreprocessor: EditorHtmlPreprocessor | null;
|
|
448
|
+
protected contentWrapperClass: string | null;
|
|
449
|
+
private _editor?;
|
|
450
|
+
private initialEditableState?;
|
|
451
|
+
set editor(editor: Editor);
|
|
452
|
+
get editor(): Editor;
|
|
453
|
+
outputFormat: 'json' | 'html';
|
|
454
|
+
protected onChange: (value: Content) => void;
|
|
455
|
+
protected onTouched: () => void;
|
|
456
|
+
writeValue(value: Content): void;
|
|
457
|
+
registerOnChange(fn: () => void): void;
|
|
458
|
+
registerOnTouched(fn: () => void): void;
|
|
459
|
+
setDisabledState(isDisabled: boolean): void;
|
|
460
|
+
protected handleChange: ({ editor, transaction }: EditorEvents["transaction"]) => void;
|
|
461
|
+
ngOnInit(): void;
|
|
462
|
+
ngAfterViewInit(): void;
|
|
463
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TiptapEditorDirective, never>;
|
|
464
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TiptapEditorDirective, "tiptap[editor], [tiptap][editor], tiptap-editor[editor], [tiptapEditor][editor]", never, { "editor": { "alias": "editor"; "required": false; }; "outputFormat": { "alias": "outputFormat"; "required": false; }; }, {}, never, never, true, never>;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
/**
|
|
468
|
+
* Back-compat shim for NgModule-based consumers. `DocumentEditorComponent` is now
|
|
469
|
+
* standalone (and `@defer`-friendly); standalone consumers should import it (and
|
|
470
|
+
* `TiptapEditorDirective`) directly instead of this module.
|
|
471
|
+
*/
|
|
472
|
+
declare class DocumentEditorModule {
|
|
473
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentEditorModule, never>;
|
|
474
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<DocumentEditorModule, never, [typeof DocumentEditorComponent, typeof TiptapEditorDirective], [typeof DocumentEditorComponent, typeof TiptapEditorDirective]>;
|
|
475
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<DocumentEditorModule>;
|
|
391
476
|
}
|
|
392
477
|
|
|
393
478
|
type BubbleTarget = {
|
|
@@ -551,219 +636,6 @@ interface ToolbarBubbleMenuConfig {
|
|
|
551
636
|
maxWidth?: string;
|
|
552
637
|
}
|
|
553
638
|
|
|
554
|
-
interface ToolbarState {
|
|
555
|
-
isReadOnly: boolean;
|
|
556
|
-
canUndo: boolean;
|
|
557
|
-
canRedo: boolean;
|
|
558
|
-
canResetFormat: boolean;
|
|
559
|
-
canToggleBold: boolean;
|
|
560
|
-
canToggleItalic: boolean;
|
|
561
|
-
canToggleUnderline: boolean;
|
|
562
|
-
canToggleStrike: boolean;
|
|
563
|
-
canToggleSubscript: boolean;
|
|
564
|
-
canToggleSuperscript: boolean;
|
|
565
|
-
canToggleCode: boolean;
|
|
566
|
-
canToggleLink: boolean;
|
|
567
|
-
canDecreaseIndent: boolean;
|
|
568
|
-
canIncreaseIndent: boolean;
|
|
569
|
-
canToggleBulletList: boolean;
|
|
570
|
-
canToggleBlockquote: boolean;
|
|
571
|
-
canInsertPageBreak: boolean;
|
|
572
|
-
canToggleEditableRegion: boolean;
|
|
573
|
-
canClearContent: boolean;
|
|
574
|
-
}
|
|
575
|
-
declare const DEFAULT_TOOLBAR_STATE: ToolbarState;
|
|
576
|
-
declare function buildToolbarState(editor: Editor, config?: Partial<DocumentEngineConfig>): ToolbarState;
|
|
577
|
-
|
|
578
|
-
/**
|
|
579
|
-
* Toolbar component for document editor
|
|
580
|
-
* Provides toolbar controls for editor actions
|
|
581
|
-
*/
|
|
582
|
-
declare class ToolbarComponent implements OnInit, OnDestroy {
|
|
583
|
-
private readonly cdr;
|
|
584
|
-
private readonly ngZone;
|
|
585
|
-
private readonly toolbarService;
|
|
586
|
-
editor: Editor;
|
|
587
|
-
capabilities: EditorCapabilities;
|
|
588
|
-
config?: Partial<DocumentEngineConfig>;
|
|
589
|
-
readonly action: i0.EventEmitter<string>;
|
|
590
|
-
activeFontSize: string | null;
|
|
591
|
-
activeLineHeight: string | null;
|
|
592
|
-
activeHeading: number | null;
|
|
593
|
-
activeTextAlign: string | null;
|
|
594
|
-
activeTextAlignIcon: string;
|
|
595
|
-
toolbarState: ToolbarState;
|
|
596
|
-
readonly fontSizeOptions: {
|
|
597
|
-
value: string;
|
|
598
|
-
label: string;
|
|
599
|
-
}[];
|
|
600
|
-
readonly lineHeightOptions: ({
|
|
601
|
-
value: null;
|
|
602
|
-
label: string;
|
|
603
|
-
} | {
|
|
604
|
-
value: string;
|
|
605
|
-
label: string;
|
|
606
|
-
})[];
|
|
607
|
-
readonly textCaseOptions: {
|
|
608
|
-
value: TextCaseType;
|
|
609
|
-
label: string;
|
|
610
|
-
}[];
|
|
611
|
-
readonly headingOptions: ({
|
|
612
|
-
value: null;
|
|
613
|
-
label: string;
|
|
614
|
-
class: string;
|
|
615
|
-
} | {
|
|
616
|
-
value: number;
|
|
617
|
-
label: string;
|
|
618
|
-
class: string;
|
|
619
|
-
})[];
|
|
620
|
-
readonly textAlignOptions: {
|
|
621
|
-
value: string;
|
|
622
|
-
label: string;
|
|
623
|
-
icon: string;
|
|
624
|
-
}[];
|
|
625
|
-
readonly listStyleOptions: {
|
|
626
|
-
value: ListStyleType;
|
|
627
|
-
label: string;
|
|
628
|
-
example: string;
|
|
629
|
-
}[];
|
|
630
|
-
private colorBubbleMenu;
|
|
631
|
-
private linkBubbleWrapper;
|
|
632
|
-
private imageBubbleMenu;
|
|
633
|
-
private specialCharsBubbleMenu;
|
|
634
|
-
private dynamicFieldsBubbleMenu;
|
|
635
|
-
private templateBubbleMenu;
|
|
636
|
-
private tableCreateBubbleMenu;
|
|
637
|
-
readonly colorBubbleConfig: ToolbarBubbleMenuConfig;
|
|
638
|
-
readonly linkBubbleConfig: EditorBubbleMenuConfig;
|
|
639
|
-
readonly tableBubbleConfig: EditorBubbleMenuConfig;
|
|
640
|
-
readonly imageBubbleConfig: ToolbarBubbleMenuConfig;
|
|
641
|
-
readonly specialCharsBubbleConfig: ToolbarBubbleMenuConfig;
|
|
642
|
-
readonly dynamicFieldsBubbleConfig: ToolbarBubbleMenuConfig;
|
|
643
|
-
readonly templateBubbleConfig: ToolbarBubbleMenuConfig;
|
|
644
|
-
readonly tableCreateBubbleConfig: ToolbarBubbleMenuConfig;
|
|
645
|
-
private throttleUpdateToolbarState;
|
|
646
|
-
private updateToolbarState;
|
|
647
|
-
ngOnInit(): void;
|
|
648
|
-
ngOnDestroy(): void;
|
|
649
|
-
runAndEmit(actionName: string, chain: () => void): void;
|
|
650
|
-
setFontSize(size: string | null): void;
|
|
651
|
-
setLineHeight(lineHeight: string | null): void;
|
|
652
|
-
setHeading(level: string | null): void;
|
|
653
|
-
setTextAlign(align: string | null): void;
|
|
654
|
-
setListStyle(listStyleType: ListStyleType): void;
|
|
655
|
-
openColorBubble(event: MouseEvent, type: 'text' | 'fill'): void;
|
|
656
|
-
toggleLink(): void;
|
|
657
|
-
insertImage(event: MouseEvent): void;
|
|
658
|
-
openSpecialCharsBubble(event: MouseEvent): void;
|
|
659
|
-
openDynamicFieldsBubble(event: MouseEvent): void;
|
|
660
|
-
openTemplateBubble(event: MouseEvent): void;
|
|
661
|
-
openCreateTableBubble(event: MouseEvent): void;
|
|
662
|
-
trackByValue(index: number, item: {
|
|
663
|
-
value: unknown;
|
|
664
|
-
}): unknown;
|
|
665
|
-
trackByIndex(index: number): number;
|
|
666
|
-
get customToolbarButtons(): ToolbarButton[];
|
|
667
|
-
handleCustomIconButton(button: ToolbarButton): void;
|
|
668
|
-
handleCustomSelectButton(button: ToolbarButton, value: string): void;
|
|
669
|
-
printValue(): void;
|
|
670
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarComponent, never>;
|
|
671
|
-
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>;
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
/**
|
|
675
|
-
* Footer component for document editor
|
|
676
|
-
* Container for footer components like character count
|
|
677
|
-
*/
|
|
678
|
-
declare class FooterComponent {
|
|
679
|
-
editor: Editor;
|
|
680
|
-
config?: Partial<DocumentEngineConfig>;
|
|
681
|
-
hasCharacterCount(): boolean;
|
|
682
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FooterComponent, never>;
|
|
683
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FooterComponent, "document-engine-footer", never, { "editor": { "alias": "editor"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
/**
|
|
687
|
-
* Type definition for HTML preprocessor function.
|
|
688
|
-
* Allows clients to transform HTML content before it's set into the editor.
|
|
689
|
-
*
|
|
690
|
-
* @param html - The raw HTML string to be processed
|
|
691
|
-
* @returns The processed HTML string that will be set into the editor
|
|
692
|
-
*
|
|
693
|
-
* @example
|
|
694
|
-
* ```typescript
|
|
695
|
-
* const myPreprocessor: EditorHtmlPreprocessor = (html: string) => {
|
|
696
|
-
* // Remove all script tags for security
|
|
697
|
-
* return html.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '');
|
|
698
|
-
* };
|
|
699
|
-
* ```
|
|
700
|
-
*/
|
|
701
|
-
type EditorHtmlPreprocessor = (html: string) => string;
|
|
702
|
-
/**
|
|
703
|
-
* Injection token for HTML preprocessor function.
|
|
704
|
-
* Use this token to provide a custom function that processes HTML content
|
|
705
|
-
* before it's set into the TipTap editor.
|
|
706
|
-
*
|
|
707
|
-
* This is optional - if not provided, the editor will use the HTML content as-is.
|
|
708
|
-
*
|
|
709
|
-
* @example
|
|
710
|
-
* ```typescript
|
|
711
|
-
* // In your component or module providers
|
|
712
|
-
* {
|
|
713
|
-
* provide: EDITOR_HTML_PREPROCESSOR,
|
|
714
|
-
* useValue: (html: string) => {
|
|
715
|
-
* // Your custom preprocessing logic
|
|
716
|
-
* return html.replace(/old/g, 'new');
|
|
717
|
-
* }
|
|
718
|
-
* }
|
|
719
|
-
* ```
|
|
720
|
-
*/
|
|
721
|
-
declare const EDITOR_HTML_PREPROCESSOR: InjectionToken<EditorHtmlPreprocessor>;
|
|
722
|
-
/**
|
|
723
|
-
* Injection token for content wrapper class.
|
|
724
|
-
* Use this token to provide a custom class name for the content wrapper element.
|
|
725
|
-
*
|
|
726
|
-
* @example
|
|
727
|
-
* ```typescript
|
|
728
|
-
* // In your component or module providers
|
|
729
|
-
* {
|
|
730
|
-
* provide: EDITOR_CONTENT_WRAPPER_CLASS,
|
|
731
|
-
* useValue: 'my-content-wrapper'
|
|
732
|
-
* }
|
|
733
|
-
* ```
|
|
734
|
-
*/
|
|
735
|
-
declare const EDITOR_CONTENT_WRAPPER_CLASS: InjectionToken<string | null>;
|
|
736
|
-
|
|
737
|
-
declare class TiptapEditorDirective implements OnInit, AfterViewInit, ControlValueAccessor {
|
|
738
|
-
protected elRef: ElementRef<HTMLElement>;
|
|
739
|
-
protected renderer: Renderer2;
|
|
740
|
-
protected changeDetectorRef: ChangeDetectorRef;
|
|
741
|
-
protected htmlPreprocessor: EditorHtmlPreprocessor | null;
|
|
742
|
-
protected contentWrapperClass: string | null;
|
|
743
|
-
private _editor?;
|
|
744
|
-
private initialEditableState?;
|
|
745
|
-
set editor(editor: Editor);
|
|
746
|
-
get editor(): Editor;
|
|
747
|
-
outputFormat: 'json' | 'html';
|
|
748
|
-
protected onChange: (value: Content) => void;
|
|
749
|
-
protected onTouched: () => void;
|
|
750
|
-
writeValue(value: Content): void;
|
|
751
|
-
registerOnChange(fn: () => void): void;
|
|
752
|
-
registerOnTouched(fn: () => void): void;
|
|
753
|
-
setDisabledState(isDisabled: boolean): void;
|
|
754
|
-
protected handleChange: ({ editor, transaction }: EditorEvents["transaction"]) => void;
|
|
755
|
-
ngOnInit(): void;
|
|
756
|
-
ngAfterViewInit(): void;
|
|
757
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TiptapEditorDirective, never>;
|
|
758
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TiptapEditorDirective, "tiptap[editor], [tiptap][editor], tiptap-editor[editor], [tiptapEditor][editor]", never, { "editor": { "alias": "editor"; "required": false; }; "outputFormat": { "alias": "outputFormat"; "required": false; }; }, {}, never, never, true, never>;
|
|
759
|
-
}
|
|
760
|
-
|
|
761
|
-
declare class DocumentEditorModule {
|
|
762
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DocumentEditorModule, never>;
|
|
763
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<DocumentEditorModule, [typeof DocumentEditorComponent], [typeof i2.CommonModule, typeof ToolbarComponent, typeof FooterComponent, typeof TiptapEditorDirective], [typeof DocumentEditorComponent, typeof TiptapEditorDirective]>;
|
|
764
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<DocumentEditorModule>;
|
|
765
|
-
}
|
|
766
|
-
|
|
767
639
|
declare class TiptapBubbleMenuDirective implements OnInit, OnDestroy {
|
|
768
640
|
private elRef;
|
|
769
641
|
props: BubbleMenuProps;
|
|
@@ -1138,6 +1010,126 @@ declare class SelectComponent implements AfterContentInit, OnChanges, OnDestroy,
|
|
|
1138
1010
|
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>;
|
|
1139
1011
|
}
|
|
1140
1012
|
|
|
1013
|
+
interface ToolbarState {
|
|
1014
|
+
isReadOnly: boolean;
|
|
1015
|
+
canUndo: boolean;
|
|
1016
|
+
canRedo: boolean;
|
|
1017
|
+
canResetFormat: boolean;
|
|
1018
|
+
canToggleBold: boolean;
|
|
1019
|
+
canToggleItalic: boolean;
|
|
1020
|
+
canToggleUnderline: boolean;
|
|
1021
|
+
canToggleStrike: boolean;
|
|
1022
|
+
canToggleSubscript: boolean;
|
|
1023
|
+
canToggleSuperscript: boolean;
|
|
1024
|
+
canToggleCode: boolean;
|
|
1025
|
+
canToggleLink: boolean;
|
|
1026
|
+
canDecreaseIndent: boolean;
|
|
1027
|
+
canIncreaseIndent: boolean;
|
|
1028
|
+
canToggleBulletList: boolean;
|
|
1029
|
+
canToggleBlockquote: boolean;
|
|
1030
|
+
canInsertPageBreak: boolean;
|
|
1031
|
+
canToggleEditableRegion: boolean;
|
|
1032
|
+
canClearContent: boolean;
|
|
1033
|
+
}
|
|
1034
|
+
declare const DEFAULT_TOOLBAR_STATE: ToolbarState;
|
|
1035
|
+
declare function buildToolbarState(editor: Editor, config?: Partial<DocumentEngineConfig>): ToolbarState;
|
|
1036
|
+
|
|
1037
|
+
/**
|
|
1038
|
+
* Toolbar component for document editor
|
|
1039
|
+
* Provides toolbar controls for editor actions
|
|
1040
|
+
*/
|
|
1041
|
+
declare class ToolbarComponent implements OnInit, OnDestroy {
|
|
1042
|
+
private readonly cdr;
|
|
1043
|
+
private readonly ngZone;
|
|
1044
|
+
private readonly toolbarService;
|
|
1045
|
+
editor: Editor;
|
|
1046
|
+
capabilities: EditorCapabilities;
|
|
1047
|
+
config?: Partial<DocumentEngineConfig>;
|
|
1048
|
+
readonly action: i0.EventEmitter<string>;
|
|
1049
|
+
activeFontSize: string | null;
|
|
1050
|
+
activeLineHeight: string | null;
|
|
1051
|
+
activeHeading: number | null;
|
|
1052
|
+
activeTextAlign: string | null;
|
|
1053
|
+
activeTextAlignIcon: string;
|
|
1054
|
+
toolbarState: ToolbarState;
|
|
1055
|
+
readonly fontSizeOptions: {
|
|
1056
|
+
value: string;
|
|
1057
|
+
label: string;
|
|
1058
|
+
}[];
|
|
1059
|
+
readonly lineHeightOptions: ({
|
|
1060
|
+
value: null;
|
|
1061
|
+
label: string;
|
|
1062
|
+
} | {
|
|
1063
|
+
value: string;
|
|
1064
|
+
label: string;
|
|
1065
|
+
})[];
|
|
1066
|
+
readonly textCaseOptions: {
|
|
1067
|
+
value: TextCaseType;
|
|
1068
|
+
label: string;
|
|
1069
|
+
}[];
|
|
1070
|
+
readonly headingOptions: ({
|
|
1071
|
+
value: null;
|
|
1072
|
+
label: string;
|
|
1073
|
+
class: string;
|
|
1074
|
+
} | {
|
|
1075
|
+
value: number;
|
|
1076
|
+
label: string;
|
|
1077
|
+
class: string;
|
|
1078
|
+
})[];
|
|
1079
|
+
readonly textAlignOptions: {
|
|
1080
|
+
value: string;
|
|
1081
|
+
label: string;
|
|
1082
|
+
icon: string;
|
|
1083
|
+
}[];
|
|
1084
|
+
readonly listStyleOptions: {
|
|
1085
|
+
value: ListStyleType;
|
|
1086
|
+
label: string;
|
|
1087
|
+
example: string;
|
|
1088
|
+
}[];
|
|
1089
|
+
private colorBubbleMenu;
|
|
1090
|
+
private linkBubbleWrapper;
|
|
1091
|
+
private imageBubbleMenu;
|
|
1092
|
+
private specialCharsBubbleMenu;
|
|
1093
|
+
private dynamicFieldsBubbleMenu;
|
|
1094
|
+
private templateBubbleMenu;
|
|
1095
|
+
private tableCreateBubbleMenu;
|
|
1096
|
+
readonly colorBubbleConfig: ToolbarBubbleMenuConfig;
|
|
1097
|
+
readonly linkBubbleConfig: EditorBubbleMenuConfig;
|
|
1098
|
+
readonly tableBubbleConfig: EditorBubbleMenuConfig;
|
|
1099
|
+
readonly imageBubbleConfig: ToolbarBubbleMenuConfig;
|
|
1100
|
+
readonly specialCharsBubbleConfig: ToolbarBubbleMenuConfig;
|
|
1101
|
+
readonly dynamicFieldsBubbleConfig: ToolbarBubbleMenuConfig;
|
|
1102
|
+
readonly templateBubbleConfig: ToolbarBubbleMenuConfig;
|
|
1103
|
+
readonly tableCreateBubbleConfig: ToolbarBubbleMenuConfig;
|
|
1104
|
+
private throttleUpdateToolbarState;
|
|
1105
|
+
private updateToolbarState;
|
|
1106
|
+
ngOnInit(): void;
|
|
1107
|
+
ngOnDestroy(): void;
|
|
1108
|
+
runAndEmit(actionName: string, chain: () => void): void;
|
|
1109
|
+
setFontSize(size: string | null): void;
|
|
1110
|
+
setLineHeight(lineHeight: string | null): void;
|
|
1111
|
+
setHeading(level: string | null): void;
|
|
1112
|
+
setTextAlign(align: string | null): void;
|
|
1113
|
+
setListStyle(listStyleType: ListStyleType): void;
|
|
1114
|
+
openColorBubble(event: MouseEvent, type: 'text' | 'fill'): void;
|
|
1115
|
+
toggleLink(): void;
|
|
1116
|
+
insertImage(event: MouseEvent): void;
|
|
1117
|
+
openSpecialCharsBubble(event: MouseEvent): void;
|
|
1118
|
+
openDynamicFieldsBubble(event: MouseEvent): void;
|
|
1119
|
+
openTemplateBubble(event: MouseEvent): void;
|
|
1120
|
+
openCreateTableBubble(event: MouseEvent): void;
|
|
1121
|
+
trackByValue(index: number, item: {
|
|
1122
|
+
value: unknown;
|
|
1123
|
+
}): unknown;
|
|
1124
|
+
trackByIndex(index: number): number;
|
|
1125
|
+
get customToolbarButtons(): ToolbarButton[];
|
|
1126
|
+
handleCustomIconButton(button: ToolbarButton): void;
|
|
1127
|
+
handleCustomSelectButton(button: ToolbarButton, value: string): void;
|
|
1128
|
+
printValue(): void;
|
|
1129
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ToolbarComponent, never>;
|
|
1130
|
+
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>;
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1141
1133
|
/**
|
|
1142
1134
|
* Service to handle toolbar action emissions
|
|
1143
1135
|
*/
|
|
@@ -1157,6 +1149,18 @@ declare class ToolbarService implements OnDestroy {
|
|
|
1157
1149
|
static ɵprov: i0.ɵɵInjectableDeclaration<ToolbarService>;
|
|
1158
1150
|
}
|
|
1159
1151
|
|
|
1152
|
+
/**
|
|
1153
|
+
* Footer component for document editor
|
|
1154
|
+
* Container for footer components like character count
|
|
1155
|
+
*/
|
|
1156
|
+
declare class FooterComponent {
|
|
1157
|
+
editor: Editor;
|
|
1158
|
+
config?: Partial<DocumentEngineConfig>;
|
|
1159
|
+
hasCharacterCount(): boolean;
|
|
1160
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FooterComponent, never>;
|
|
1161
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FooterComponent, "document-engine-footer", never, { "editor": { "alias": "editor"; "required": false; }; "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1160
1164
|
/**
|
|
1161
1165
|
* Character Count component for document editor footer
|
|
1162
1166
|
* Displays character/word count with optional limit and color coding
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phuong-tran-redoc/document-engine-angular",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Realestatedoc (Redoc)",
|
|
@@ -24,10 +24,18 @@
|
|
|
24
24
|
"directory": "../../dist/libs/document-engine-angular",
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
|
+
"files": [
|
|
28
|
+
"fesm2022",
|
|
29
|
+
"index.d.ts",
|
|
30
|
+
"src/lib/styles",
|
|
31
|
+
"README.md",
|
|
32
|
+
"LICENSE.md",
|
|
33
|
+
"THIRD-PARTY-NOTICES.txt"
|
|
34
|
+
],
|
|
27
35
|
"dependencies": {
|
|
28
36
|
"tslib": "^2.3.0",
|
|
29
37
|
"@floating-ui/dom": "^1.7.4",
|
|
30
|
-
"@phuong-tran-redoc/document-engine-core": "0.1.
|
|
38
|
+
"@phuong-tran-redoc/document-engine-core": "0.1.2"
|
|
31
39
|
},
|
|
32
40
|
"peerDependencies": {
|
|
33
41
|
"rxjs": "^7.5.0",
|