@flogeez/angular-tiptap-editor 2.2.0 → 2.2.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/CHANGELOG.md +13 -1
- package/README.md +63 -46
- package/fesm2022/flogeez-angular-tiptap-editor.mjs +619 -384
- package/fesm2022/flogeez-angular-tiptap-editor.mjs.map +1 -1
- package/index.d.ts +59 -80
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -710,7 +710,7 @@ interface AteSlashCommandsConfig extends Partial<Record<AteSlashCommandKey, bool
|
|
|
710
710
|
/**
|
|
711
711
|
* Configuration par défaut : toutes les commandes natives sont activées
|
|
712
712
|
*/
|
|
713
|
-
declare const ATE_DEFAULT_SLASH_COMMANDS_CONFIG:
|
|
713
|
+
declare const ATE_DEFAULT_SLASH_COMMANDS_CONFIG: AteSlashCommandsConfig;
|
|
714
714
|
/**
|
|
715
715
|
* Factory pour créer les commandes natives avec leurs traductions et leur logique d'exécution.
|
|
716
716
|
* Utilise les services de l'éditeur pour garantir une cohérence de comportement.
|
|
@@ -731,77 +731,56 @@ declare function filterSlashCommands(config: AteSlashCommandsConfig, i18n: AteI1
|
|
|
731
731
|
allowedTypes?: string[];
|
|
732
732
|
}): AteSlashCommandItem[];
|
|
733
733
|
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
highlightPicker?: boolean;
|
|
745
|
-
heading1?: boolean;
|
|
746
|
-
heading2?: boolean;
|
|
747
|
-
heading3?: boolean;
|
|
748
|
-
bulletList?: boolean;
|
|
749
|
-
orderedList?: boolean;
|
|
750
|
-
blockquote?: boolean;
|
|
751
|
-
alignLeft?: boolean;
|
|
752
|
-
alignCenter?: boolean;
|
|
753
|
-
alignRight?: boolean;
|
|
754
|
-
alignJustify?: boolean;
|
|
755
|
-
link?: boolean;
|
|
756
|
-
image?: boolean;
|
|
757
|
-
horizontalRule?: boolean;
|
|
758
|
-
table?: boolean;
|
|
759
|
-
undo?: boolean;
|
|
760
|
-
redo?: boolean;
|
|
761
|
-
clear?: boolean;
|
|
762
|
-
textColor?: boolean;
|
|
763
|
-
separator?: boolean;
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
interface AteBubbleMenuConfig {
|
|
767
|
-
bold?: boolean;
|
|
768
|
-
italic?: boolean;
|
|
769
|
-
underline?: boolean;
|
|
770
|
-
strike?: boolean;
|
|
771
|
-
code?: boolean;
|
|
772
|
-
superscript?: boolean;
|
|
773
|
-
subscript?: boolean;
|
|
774
|
-
highlight?: boolean;
|
|
775
|
-
highlightPicker?: boolean;
|
|
776
|
-
textColor?: boolean;
|
|
777
|
-
link?: boolean;
|
|
778
|
-
separator?: boolean;
|
|
734
|
+
/**
|
|
735
|
+
* Clés des boutons de la barre d'outils native
|
|
736
|
+
*/
|
|
737
|
+
declare const ATE_TOOLBAR_KEYS: readonly ["bold", "italic", "underline", "strike", "code", "codeBlock", "superscript", "subscript", "highlight", "highlightPicker", "heading1", "heading2", "heading3", "bulletList", "orderedList", "blockquote", "alignLeft", "alignCenter", "alignRight", "alignJustify", "link", "image", "horizontalRule", "table", "undo", "redo", "clear", "textColor", "separator"];
|
|
738
|
+
type AteToolbarKey = (typeof ATE_TOOLBAR_KEYS)[number];
|
|
739
|
+
interface AteToolbarConfig extends Partial<Record<AteToolbarKey, boolean>> {
|
|
740
|
+
/**
|
|
741
|
+
* Boutons personnalisés à ajouter
|
|
742
|
+
*/
|
|
743
|
+
custom?: AteCustomToolbarItem[];
|
|
779
744
|
}
|
|
780
|
-
interface
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
resizeOriginal?: boolean;
|
|
786
|
-
deleteImage?: boolean;
|
|
787
|
-
separator?: boolean;
|
|
745
|
+
interface AteCustomToolbarItem {
|
|
746
|
+
key: string;
|
|
747
|
+
label: string;
|
|
748
|
+
icon: string;
|
|
749
|
+
command: (editor: Editor) => void | Promise<void>;
|
|
788
750
|
}
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
toggleHeaderRow?: boolean;
|
|
798
|
-
toggleHeaderColumn?: boolean;
|
|
799
|
-
separator?: boolean;
|
|
751
|
+
|
|
752
|
+
/**
|
|
753
|
+
* Clés des options du menu bulle de texte
|
|
754
|
+
*/
|
|
755
|
+
declare const ATE_BUBBLE_MENU_KEYS: readonly ["bold", "italic", "underline", "strike", "code", "superscript", "subscript", "highlight", "highlightPicker", "textColor", "link", "separator"];
|
|
756
|
+
type AteBubbleMenuKey = (typeof ATE_BUBBLE_MENU_KEYS)[number];
|
|
757
|
+
interface AteBubbleMenuConfig extends Partial<Record<AteBubbleMenuKey, boolean>> {
|
|
758
|
+
custom?: AteCustomBubbleMenuItem[];
|
|
800
759
|
}
|
|
801
|
-
interface
|
|
802
|
-
|
|
803
|
-
|
|
760
|
+
interface AteCustomBubbleMenuItem {
|
|
761
|
+
key: string;
|
|
762
|
+
label: string;
|
|
763
|
+
icon: string;
|
|
764
|
+
command: (editor: Editor) => void | Promise<void>;
|
|
804
765
|
}
|
|
766
|
+
/**
|
|
767
|
+
* Clés des options du menu bulle d'image
|
|
768
|
+
*/
|
|
769
|
+
declare const ATE_IMAGE_BUBBLE_MENU_KEYS: readonly ["changeImage", "resizeSmall", "resizeMedium", "resizeLarge", "resizeOriginal", "deleteImage", "separator"];
|
|
770
|
+
type AteImageBubbleMenuKey = (typeof ATE_IMAGE_BUBBLE_MENU_KEYS)[number];
|
|
771
|
+
type AteImageBubbleMenuConfig = Partial<Record<AteImageBubbleMenuKey, boolean>>;
|
|
772
|
+
/**
|
|
773
|
+
* Clés des options du menu de table
|
|
774
|
+
*/
|
|
775
|
+
declare const ATE_TABLE_BUBBLE_MENU_KEYS: readonly ["addRowBefore", "addRowAfter", "deleteRow", "addColumnBefore", "addColumnAfter", "deleteColumn", "deleteTable", "toggleHeaderRow", "toggleHeaderColumn", "separator"];
|
|
776
|
+
type AteTableBubbleMenuKey = (typeof ATE_TABLE_BUBBLE_MENU_KEYS)[number];
|
|
777
|
+
type AteTableBubbleMenuConfig = Partial<Record<AteTableBubbleMenuKey, boolean>>;
|
|
778
|
+
/**
|
|
779
|
+
* Clés des options du menu de cellule
|
|
780
|
+
*/
|
|
781
|
+
declare const ATE_CELL_BUBBLE_MENU_KEYS: readonly ["mergeCells", "splitCell"];
|
|
782
|
+
type AteCellBubbleMenuKey = (typeof ATE_CELL_BUBBLE_MENU_KEYS)[number];
|
|
783
|
+
type AteCellBubbleMenuConfig = Partial<Record<AteCellBubbleMenuKey, boolean>>;
|
|
805
784
|
|
|
806
785
|
/**
|
|
807
786
|
* Global configuration interface for Angular Tiptap Editor.
|
|
@@ -917,12 +896,12 @@ declare class AngularTiptapEditorComponent implements AfterViewInit, OnDestroy {
|
|
|
917
896
|
showBubbleMenu: _angular_core.InputSignal<boolean>;
|
|
918
897
|
bubbleMenu: _angular_core.InputSignal<Partial<AteBubbleMenuConfig>>;
|
|
919
898
|
showImageBubbleMenu: _angular_core.InputSignal<boolean>;
|
|
920
|
-
imageBubbleMenu: _angular_core.InputSignal<Partial<
|
|
899
|
+
imageBubbleMenu: _angular_core.InputSignal<Partial<Partial<Record<"separator" | "changeImage" | "resizeSmall" | "resizeMedium" | "resizeLarge" | "resizeOriginal" | "deleteImage", boolean>>>>;
|
|
921
900
|
toolbar: _angular_core.InputSignal<Partial<AteToolbarConfig>>;
|
|
922
901
|
showTableBubbleMenu: _angular_core.InputSignal<boolean>;
|
|
923
|
-
tableBubbleMenu: _angular_core.InputSignal<Partial<
|
|
902
|
+
tableBubbleMenu: _angular_core.InputSignal<Partial<Partial<Record<"addColumnBefore" | "addColumnAfter" | "deleteColumn" | "addRowBefore" | "addRowAfter" | "deleteRow" | "deleteTable" | "toggleHeaderColumn" | "toggleHeaderRow" | "separator", boolean>>>>;
|
|
924
903
|
showCellBubbleMenu: _angular_core.InputSignal<boolean>;
|
|
925
|
-
cellBubbleMenu: _angular_core.InputSignal<Partial<
|
|
904
|
+
cellBubbleMenu: _angular_core.InputSignal<Partial<Partial<Record<"mergeCells" | "splitCell", boolean>>>>;
|
|
926
905
|
/**
|
|
927
906
|
* Additionnal state calculators to extend the reactive editor state.
|
|
928
907
|
*/
|
|
@@ -998,11 +977,11 @@ declare class AngularTiptapEditorComponent implements AfterViewInit, OnDestroy {
|
|
|
998
977
|
readonly finalShowBubbleMenu: _angular_core.Signal<boolean>;
|
|
999
978
|
readonly finalBubbleMenuConfig: _angular_core.Signal<AteBubbleMenuConfig>;
|
|
1000
979
|
readonly finalShowImageBubbleMenu: _angular_core.Signal<boolean>;
|
|
1001
|
-
readonly finalImageBubbleMenuConfig: _angular_core.Signal<
|
|
980
|
+
readonly finalImageBubbleMenuConfig: _angular_core.Signal<Partial<Record<"separator" | "changeImage" | "resizeSmall" | "resizeMedium" | "resizeLarge" | "resizeOriginal" | "deleteImage", boolean>>>;
|
|
1002
981
|
readonly finalShowTableBubbleMenu: _angular_core.Signal<boolean>;
|
|
1003
|
-
readonly finalTableBubbleMenuConfig: _angular_core.Signal<
|
|
982
|
+
readonly finalTableBubbleMenuConfig: _angular_core.Signal<Partial<Record<"addColumnBefore" | "addColumnAfter" | "deleteColumn" | "addRowBefore" | "addRowAfter" | "deleteRow" | "deleteTable" | "toggleHeaderColumn" | "toggleHeaderRow" | "separator", boolean>>>;
|
|
1004
983
|
readonly finalShowCellBubbleMenu: _angular_core.Signal<boolean>;
|
|
1005
|
-
readonly finalCellBubbleMenuConfig: _angular_core.Signal<
|
|
984
|
+
readonly finalCellBubbleMenuConfig: _angular_core.Signal<Partial<Record<"mergeCells" | "splitCell", boolean>>>;
|
|
1006
985
|
readonly finalEnableSlashCommands: _angular_core.Signal<boolean>;
|
|
1007
986
|
readonly finalSlashCommandsConfig: _angular_core.Signal<AteCustomSlashCommands>;
|
|
1008
987
|
readonly finalAutofocus: _angular_core.Signal<number | boolean | "start" | "end" | "all">;
|
|
@@ -1255,7 +1234,7 @@ declare const INITIAL_EDITOR_STATE: AteEditorStateSnapshot;
|
|
|
1255
1234
|
/** @deprecated Renamed to `ATE_SLASH_COMMAND_KEYS`. This alias will be removed in v3.0.0. */
|
|
1256
1235
|
declare const SLASH_COMMAND_KEYS: readonly ["heading1", "heading2", "heading3", "bulletList", "orderedList", "blockquote", "code", "image", "horizontalRule", "table"];
|
|
1257
1236
|
/** @deprecated Renamed to `ATE_DEFAULT_SLASH_COMMANDS_CONFIG`. This alias will be removed in v3.0.0. */
|
|
1258
|
-
declare const DEFAULT_SLASH_COMMANDS_CONFIG:
|
|
1237
|
+
declare const DEFAULT_SLASH_COMMANDS_CONFIG: AteSlashCommandsConfig;
|
|
1259
1238
|
|
|
1260
1239
|
/** @deprecated Renamed to `AteDiscoveryCalculator`. This alias will be removed in v3.0.0. */
|
|
1261
1240
|
declare const DiscoveryCalculator: _flogeez_angular_tiptap_editor.AteStateCalculator;
|
|
@@ -1274,11 +1253,11 @@ declare const DEFAULT_TOOLBAR_CONFIG: AteToolbarConfig;
|
|
|
1274
1253
|
/** @deprecated Renamed to `ATE_DEFAULT_BUBBLE_MENU_CONFIG`. This alias will be removed in v3.0.0. */
|
|
1275
1254
|
declare const DEFAULT_BUBBLE_MENU_CONFIG: AteBubbleMenuConfig;
|
|
1276
1255
|
/** @deprecated Renamed to `ATE_DEFAULT_IMAGE_BUBBLE_MENU_CONFIG`. This alias will be removed in v3.0.0. */
|
|
1277
|
-
declare const DEFAULT_IMAGE_BUBBLE_MENU_CONFIG:
|
|
1256
|
+
declare const DEFAULT_IMAGE_BUBBLE_MENU_CONFIG: Partial<Record<"separator" | "changeImage" | "resizeSmall" | "resizeMedium" | "resizeLarge" | "resizeOriginal" | "deleteImage", boolean>>;
|
|
1278
1257
|
/** @deprecated Renamed to `ATE_DEFAULT_TABLE_MENU_CONFIG`. This alias will be removed in v3.0.0. */
|
|
1279
|
-
declare const DEFAULT_TABLE_MENU_CONFIG:
|
|
1258
|
+
declare const DEFAULT_TABLE_MENU_CONFIG: Partial<Record<"addColumnBefore" | "addColumnAfter" | "deleteColumn" | "addRowBefore" | "addRowAfter" | "deleteRow" | "deleteTable" | "toggleHeaderColumn" | "toggleHeaderRow" | "separator", boolean>>;
|
|
1280
1259
|
/** @deprecated Renamed to `ATE_DEFAULT_CELL_MENU_CONFIG`. This alias will be removed in v3.0.0. */
|
|
1281
|
-
declare const DEFAULT_CELL_MENU_CONFIG:
|
|
1260
|
+
declare const DEFAULT_CELL_MENU_CONFIG: Partial<Record<"mergeCells" | "splitCell", boolean>>;
|
|
1282
1261
|
|
|
1283
|
-
export { ATE_DEFAULT_BUBBLE_MENU_CONFIG, ATE_DEFAULT_CELL_MENU_CONFIG, ATE_DEFAULT_IMAGE_BUBBLE_MENU_CONFIG, ATE_DEFAULT_SLASH_COMMANDS_CONFIG, ATE_DEFAULT_TABLE_MENU_CONFIG, ATE_DEFAULT_TOOLBAR_CONFIG, ATE_INITIAL_EDITOR_STATE, ATE_SLASH_COMMAND_KEYS, AngularTiptapEditorComponent, AteColorPickerService, AteDiscoveryCalculator, AteEditorCommandsService, AteI18nService, AteImageCalculator, AteImageService, AteLinkService, AteMarksCalculator, AteNoopValueAccessorDirective, AteSelectionCalculator, AteStructureCalculator, AteTableCalculator, AteColorPickerService as ColorPickerService, DEFAULT_BUBBLE_MENU_CONFIG, DEFAULT_CELL_MENU_CONFIG, DEFAULT_IMAGE_BUBBLE_MENU_CONFIG, DEFAULT_SLASH_COMMANDS_CONFIG, DEFAULT_TABLE_MENU_CONFIG, DEFAULT_TOOLBAR_CONFIG, DiscoveryCalculator, AteEditorCommandsService as EditorCommandsService, INITIAL_EDITOR_STATE, ImageCalculator, AteImageService as ImageService, AteLinkService as LinkService, MarksCalculator, SLASH_COMMAND_KEYS, SelectionCalculator, StructureCalculator, TableCalculator, AteI18nService as TiptapI18nService, createDefaultSlashCommands, filterSlashCommands };
|
|
1284
|
-
export type { AteBubbleMenuConfig, AteCellBubbleMenuConfig, AteColorEditMode, AteColorPickerSelection, AteCustomSlashCommands, AteEditorConfig, AteEditorStateSnapshot, AteImageBubbleMenuConfig, AteImageData, AteImageUploadConfig, AteImageUploadContext, AteImageUploadHandler, AteImageUploadHandlerResult, AteImageUploadOptions, AteImageUploadResult, AteResizeOptions, AteSlashCommandItem, AteSlashCommandKey, AteSlashCommandsConfig, AteStateCalculator, AteTableBubbleMenuConfig, AteToolbarConfig, AteTranslations, AteBubbleMenuConfig as BubbleMenuConfig, AteCellBubbleMenuConfig as CellBubbleMenuConfig, AteCustomSlashCommands as CustomSlashCommands, AteEditorConfig as EditorConfig, AteEditorStateSnapshot as EditorStateSnapshot, AteImageBubbleMenuConfig as ImageBubbleMenuConfig, AteImageData as ImageData, AteImageUploadHandler as ImageUploadHandler, AteImageUploadOptions as ImageUploadOptions, AteImageUploadResult as ImageUploadResult, AteResizeOptions as ResizeOptions, AteSlashCommandItem as SlashCommandItem, AteSlashCommandKey as SlashCommandKey, AteSlashCommandsConfig as SlashCommandsConfig, SupportedLocale, AteTableBubbleMenuConfig as TableBubbleMenuConfig, AteToolbarConfig as ToolbarConfig };
|
|
1262
|
+
export { ATE_BUBBLE_MENU_KEYS, ATE_CELL_BUBBLE_MENU_KEYS, ATE_DEFAULT_BUBBLE_MENU_CONFIG, ATE_DEFAULT_CELL_MENU_CONFIG, ATE_DEFAULT_IMAGE_BUBBLE_MENU_CONFIG, ATE_DEFAULT_SLASH_COMMANDS_CONFIG, ATE_DEFAULT_TABLE_MENU_CONFIG, ATE_DEFAULT_TOOLBAR_CONFIG, ATE_IMAGE_BUBBLE_MENU_KEYS, ATE_INITIAL_EDITOR_STATE, ATE_SLASH_COMMAND_KEYS, ATE_TABLE_BUBBLE_MENU_KEYS, ATE_TOOLBAR_KEYS, AngularTiptapEditorComponent, AteColorPickerService, AteDiscoveryCalculator, AteEditorCommandsService, AteI18nService, AteImageCalculator, AteImageService, AteLinkService, AteMarksCalculator, AteNoopValueAccessorDirective, AteSelectionCalculator, AteStructureCalculator, AteTableCalculator, AteColorPickerService as ColorPickerService, DEFAULT_BUBBLE_MENU_CONFIG, DEFAULT_CELL_MENU_CONFIG, DEFAULT_IMAGE_BUBBLE_MENU_CONFIG, DEFAULT_SLASH_COMMANDS_CONFIG, DEFAULT_TABLE_MENU_CONFIG, DEFAULT_TOOLBAR_CONFIG, DiscoveryCalculator, AteEditorCommandsService as EditorCommandsService, INITIAL_EDITOR_STATE, ImageCalculator, AteImageService as ImageService, AteLinkService as LinkService, MarksCalculator, SLASH_COMMAND_KEYS, SelectionCalculator, StructureCalculator, TableCalculator, AteI18nService as TiptapI18nService, createDefaultSlashCommands, filterSlashCommands };
|
|
1263
|
+
export type { AteBubbleMenuConfig, AteBubbleMenuKey, AteCellBubbleMenuConfig, AteCellBubbleMenuKey, AteColorEditMode, AteColorPickerSelection, AteCustomBubbleMenuItem, AteCustomSlashCommands, AteCustomToolbarItem, AteEditorConfig, AteEditorStateSnapshot, AteImageBubbleMenuConfig, AteImageBubbleMenuKey, AteImageData, AteImageUploadConfig, AteImageUploadContext, AteImageUploadHandler, AteImageUploadHandlerResult, AteImageUploadOptions, AteImageUploadResult, AteResizeOptions, AteSlashCommandItem, AteSlashCommandKey, AteSlashCommandsConfig, AteStateCalculator, AteTableBubbleMenuConfig, AteTableBubbleMenuKey, AteToolbarConfig, AteToolbarKey, AteTranslations, AteBubbleMenuConfig as BubbleMenuConfig, AteCellBubbleMenuConfig as CellBubbleMenuConfig, AteCustomSlashCommands as CustomSlashCommands, AteEditorConfig as EditorConfig, AteEditorStateSnapshot as EditorStateSnapshot, AteImageBubbleMenuConfig as ImageBubbleMenuConfig, AteImageData as ImageData, AteImageUploadHandler as ImageUploadHandler, AteImageUploadOptions as ImageUploadOptions, AteImageUploadResult as ImageUploadResult, AteResizeOptions as ResizeOptions, AteSlashCommandItem as SlashCommandItem, AteSlashCommandKey as SlashCommandKey, AteSlashCommandsConfig as SlashCommandsConfig, SupportedLocale, AteTableBubbleMenuConfig as TableBubbleMenuConfig, AteToolbarConfig as ToolbarConfig };
|
package/package.json
CHANGED