texditor 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +9 -0
- package/README.md +232 -0
- package/dist/core/base/base-model.d.ts +160 -0
- package/dist/core/base/base-model.d.ts.map +1 -0
- package/dist/core/base/event-manager.d.ts +20 -0
- package/dist/core/base/event-manager.d.ts.map +1 -0
- package/dist/core/base/index.d.ts +3 -0
- package/dist/core/base/index.d.ts.map +1 -0
- package/dist/core/base.d.ts +2 -0
- package/dist/core/base.mjs +1 -0
- package/dist/core/block-manager.d.ts +91 -0
- package/dist/core/block-manager.d.ts.map +1 -0
- package/dist/core/commands.d.ts +73 -0
- package/dist/core/commands.d.ts.map +1 -0
- package/dist/core/config.d.ts +11 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/events.d.ts +121 -0
- package/dist/core/events.d.ts.map +1 -0
- package/dist/core/extensions.d.ts +23 -0
- package/dist/core/extensions.d.ts.map +1 -0
- package/dist/core/history-manager.d.ts +76 -0
- package/dist/core/history-manager.d.ts.map +1 -0
- package/dist/core/i18n.d.ts +29 -0
- package/dist/core/i18n.d.ts.map +1 -0
- package/dist/core/models/action-model.d.ts +54 -0
- package/dist/core/models/action-model.d.ts.map +1 -0
- package/dist/core/models/block-model.d.ts +396 -0
- package/dist/core/models/block-model.d.ts.map +1 -0
- package/dist/core/models/extension-model.d.ts +25 -0
- package/dist/core/models/extension-model.d.ts.map +1 -0
- package/dist/core/models/file-action-model.d.ts +20 -0
- package/dist/core/models/file-action-model.d.ts.map +1 -0
- package/dist/core/models/index.d.ts +7 -0
- package/dist/core/models/index.d.ts.map +1 -0
- package/dist/core/models/tool-model.d.ts +69 -0
- package/dist/core/models/tool-model.d.ts.map +1 -0
- package/dist/core/models.d.ts +2 -0
- package/dist/core/models.mjs +6 -0
- package/dist/core/security/sanitizer.d.ts +65 -0
- package/dist/core/security/sanitizer.d.ts.map +1 -0
- package/dist/core/selection-api.d.ts +52 -0
- package/dist/core/selection-api.d.ts.map +1 -0
- package/dist/core/tools.d.ts +27 -0
- package/dist/core/tools.d.ts.map +1 -0
- package/dist/core/ui/slider.d.ts +50 -0
- package/dist/core/ui/slider.d.ts.map +1 -0
- package/dist/core/ui/toasts.d.ts +23 -0
- package/dist/core/ui/toasts.d.ts.map +1 -0
- package/dist/core/ui/virtual-selection.d.ts +171 -0
- package/dist/core/ui/virtual-selection.d.ts.map +1 -0
- package/dist/entities/actions/convert-action.d.ts +9 -0
- package/dist/entities/actions/convert-action.d.ts.map +1 -0
- package/dist/entities/actions/create-action.d.ts +8 -0
- package/dist/entities/actions/create-action.d.ts.map +1 -0
- package/dist/entities/actions/delete-action.d.ts +8 -0
- package/dist/entities/actions/delete-action.d.ts.map +1 -0
- package/dist/entities/actions/index.d.ts +7 -0
- package/dist/entities/actions/index.d.ts.map +1 -0
- package/dist/entities/actions/move-down-action.d.ts +9 -0
- package/dist/entities/actions/move-down-action.d.ts.map +1 -0
- package/dist/entities/actions/move-up-action.d.ts +9 -0
- package/dist/entities/actions/move-up-action.d.ts.map +1 -0
- package/dist/entities/actions.d.ts +2 -0
- package/dist/entities/actions.mjs +6 -0
- package/dist/entities/blocks/code/index.d.ts +48 -0
- package/dist/entities/blocks/code/index.d.ts.map +1 -0
- package/dist/entities/blocks/code/languages.d.ts +4 -0
- package/dist/entities/blocks/code/languages.d.ts.map +1 -0
- package/dist/entities/blocks/files/actions/DeleteFileAction.d.ts +7 -0
- package/dist/entities/blocks/files/actions/DeleteFileAction.d.ts.map +1 -0
- package/dist/entities/blocks/files/actions/DownloadFileAction.d.ts +12 -0
- package/dist/entities/blocks/files/actions/DownloadFileAction.d.ts.map +1 -0
- package/dist/entities/blocks/files/actions/EditFileAction.d.ts +32 -0
- package/dist/entities/blocks/files/actions/EditFileAction.d.ts.map +1 -0
- package/dist/entities/blocks/files/actions/MoveLeftFileAction.d.ts +8 -0
- package/dist/entities/blocks/files/actions/MoveLeftFileAction.d.ts.map +1 -0
- package/dist/entities/blocks/files/actions/MoveRightFileAction.d.ts +8 -0
- package/dist/entities/blocks/files/actions/MoveRightFileAction.d.ts.map +1 -0
- package/dist/entities/blocks/files/index.d.ts +185 -0
- package/dist/entities/blocks/files/index.d.ts.map +1 -0
- package/dist/entities/blocks/gallery/index.d.ts +60 -0
- package/dist/entities/blocks/gallery/index.d.ts.map +1 -0
- package/dist/entities/blocks/header/H1.d.ts +4 -0
- package/dist/entities/blocks/header/H1.d.ts.map +1 -0
- package/dist/entities/blocks/header/H2.d.ts +6 -0
- package/dist/entities/blocks/header/H2.d.ts.map +1 -0
- package/dist/entities/blocks/header/H3.d.ts +6 -0
- package/dist/entities/blocks/header/H3.d.ts.map +1 -0
- package/dist/entities/blocks/header/H4.d.ts +6 -0
- package/dist/entities/blocks/header/H4.d.ts.map +1 -0
- package/dist/entities/blocks/header/H5.d.ts +6 -0
- package/dist/entities/blocks/header/H5.d.ts.map +1 -0
- package/dist/entities/blocks/header/H6.d.ts +6 -0
- package/dist/entities/blocks/header/H6.d.ts.map +1 -0
- package/dist/entities/blocks/header/index.d.ts +6 -0
- package/dist/entities/blocks/header/index.d.ts.map +1 -0
- package/dist/entities/blocks/index.d.ts +14 -0
- package/dist/entities/blocks/index.d.ts.map +1 -0
- package/dist/entities/blocks/list/index.d.ts +6 -0
- package/dist/entities/blocks/list/index.d.ts.map +1 -0
- package/dist/entities/blocks/list/ol.d.ts +6 -0
- package/dist/entities/blocks/list/ol.d.ts.map +1 -0
- package/dist/entities/blocks/paragraph/index.d.ts +6 -0
- package/dist/entities/blocks/paragraph/index.d.ts.map +1 -0
- package/dist/entities/blocks.d.ts +2 -0
- package/dist/entities/blocks.mjs +13 -0
- package/dist/entities/extensions/delete-selected.d.ts +9 -0
- package/dist/entities/extensions/delete-selected.d.ts.map +1 -0
- package/dist/entities/extensions/index.d.ts +5 -0
- package/dist/entities/extensions/index.d.ts.map +1 -0
- package/dist/entities/extensions/redo.d.ts +8 -0
- package/dist/entities/extensions/redo.d.ts.map +1 -0
- package/dist/entities/extensions/undo.d.ts +8 -0
- package/dist/entities/extensions/undo.d.ts.map +1 -0
- package/dist/entities/extensions.d.ts +2 -0
- package/dist/entities/extensions.mjs +4 -0
- package/dist/entities/tools/bold.d.ts +6 -0
- package/dist/entities/tools/bold.d.ts.map +1 -0
- package/dist/entities/tools/clear-formatting.d.ts +7 -0
- package/dist/entities/tools/clear-formatting.d.ts.map +1 -0
- package/dist/entities/tools/index.d.ts +10 -0
- package/dist/entities/tools/index.d.ts.map +1 -0
- package/dist/entities/tools/inline-code.d.ts +6 -0
- package/dist/entities/tools/inline-code.d.ts.map +1 -0
- package/dist/entities/tools/italic.d.ts +6 -0
- package/dist/entities/tools/italic.d.ts.map +1 -0
- package/dist/entities/tools/link.d.ts +35 -0
- package/dist/entities/tools/link.d.ts.map +1 -0
- package/dist/entities/tools/marker.d.ts +6 -0
- package/dist/entities/tools/marker.d.ts.map +1 -0
- package/dist/entities/tools/subscript.d.ts +6 -0
- package/dist/entities/tools/subscript.d.ts.map +1 -0
- package/dist/entities/tools/superscript.d.ts +6 -0
- package/dist/entities/tools/superscript.d.ts.map +1 -0
- package/dist/entities/tools.d.ts +2 -0
- package/dist/entities/tools.mjs +9 -0
- package/dist/icons/index.d.ts +42 -0
- package/dist/icons/index.d.ts.map +1 -0
- package/dist/locales/en.d.ts +66 -0
- package/dist/locales/en.d.ts.map +1 -0
- package/dist/locales/index.d.ts +4 -0
- package/dist/locales/index.d.ts.map +1 -0
- package/dist/locales/ru.d.ts +66 -0
- package/dist/locales/ru.d.ts.map +1 -0
- package/dist/locales.d.ts +2 -0
- package/dist/locales.mjs +3 -0
- package/dist/main.d.ts +6 -0
- package/dist/node_modules/snappykit/dist/snappykit.mjs +440 -0
- package/dist/node_modules/sortum/dist/sortum.mjs +588 -0
- package/dist/src/core/base/base-model.mjs +184 -0
- package/dist/src/core/base/event-manager.mjs +31 -0
- package/dist/src/core/block-manager.mjs +499 -0
- package/dist/src/core/commands.mjs +311 -0
- package/dist/src/core/config.mjs +12 -0
- package/dist/src/core/events.mjs +369 -0
- package/dist/src/core/extensions.mjs +48 -0
- package/dist/src/core/history-manager.mjs +107 -0
- package/dist/src/core/i18n.mjs +25 -0
- package/dist/src/core/models/action-model.mjs +72 -0
- package/dist/src/core/models/block-model.mjs +619 -0
- package/dist/src/core/models/extension-model.mjs +28 -0
- package/dist/src/core/models/file-action-model.mjs +24 -0
- package/dist/src/core/models/tool-model.mjs +80 -0
- package/dist/src/core/security/sanitizer.mjs +130 -0
- package/dist/src/core/selection-api.mjs +202 -0
- package/dist/src/core/tools.mjs +88 -0
- package/dist/src/core/ui/slider.mjs +81 -0
- package/dist/src/core/ui/toasts.mjs +55 -0
- package/dist/src/core/ui/virtual-selection.mjs +205 -0
- package/dist/src/entities/actions/convert-action.mjs +43 -0
- package/dist/src/entities/actions/create-action.mjs +39 -0
- package/dist/src/entities/actions/delete-action.mjs +19 -0
- package/dist/src/entities/actions/move-down-action.mjs +22 -0
- package/dist/src/entities/actions/move-up-action.mjs +22 -0
- package/dist/src/entities/blocks/code/index.mjs +144 -0
- package/dist/src/entities/blocks/code/languages.mjs +54 -0
- package/dist/src/entities/blocks/files/actions/DeleteFileAction.mjs +21 -0
- package/dist/src/entities/blocks/files/actions/DownloadFileAction.mjs +44 -0
- package/dist/src/entities/blocks/files/actions/EditFileAction.mjs +111 -0
- package/dist/src/entities/blocks/files/actions/MoveLeftFileAction.mjs +24 -0
- package/dist/src/entities/blocks/files/actions/MoveRightFileAction.mjs +24 -0
- package/dist/src/entities/blocks/files/index.mjs +424 -0
- package/dist/src/entities/blocks/gallery/index.mjs +141 -0
- package/dist/src/entities/blocks/header/H1.mjs +5 -0
- package/dist/src/entities/blocks/header/H2.mjs +16 -0
- package/dist/src/entities/blocks/header/H3.mjs +16 -0
- package/dist/src/entities/blocks/header/H4.mjs +16 -0
- package/dist/src/entities/blocks/header/H5.mjs +16 -0
- package/dist/src/entities/blocks/header/H6.mjs +16 -0
- package/dist/src/entities/blocks/header/index.mjs +46 -0
- package/dist/src/entities/blocks/list/index.mjs +51 -0
- package/dist/src/entities/blocks/list/ol.mjs +16 -0
- package/dist/src/entities/blocks/paragraph/index.mjs +46 -0
- package/dist/src/entities/extensions/delete-selected.mjs +27 -0
- package/dist/src/entities/extensions/redo.mjs +22 -0
- package/dist/src/entities/extensions/undo.mjs +22 -0
- package/dist/src/entities/tools/bold.mjs +16 -0
- package/dist/src/entities/tools/clear-formatting.mjs +20 -0
- package/dist/src/entities/tools/inline-code.mjs +19 -0
- package/dist/src/entities/tools/italic.mjs +16 -0
- package/dist/src/entities/tools/link.mjs +89 -0
- package/dist/src/entities/tools/marker.mjs +17 -0
- package/dist/src/entities/tools/subscript.mjs +17 -0
- package/dist/src/entities/tools/superscript.mjs +18 -0
- package/dist/src/icons/index.mjs +4 -0
- package/dist/src/locales/en.mjs +68 -0
- package/dist/src/locales/ru.mjs +68 -0
- package/dist/src/store/currentStore.mjs +8 -0
- package/dist/src/store/mainStore.mjs +4 -0
- package/dist/src/utils/ajax.mjs +35 -0
- package/dist/src/utils/common.mjs +26 -0
- package/dist/src/utils/icon.mjs +12 -0
- package/dist/src/utils/sanitizer.mjs +20 -0
- package/dist/src/views/extensions.mjs +18 -0
- package/dist/src/views/main.mjs +19 -0
- package/dist/src/views/tools.mjs +9 -0
- package/dist/store/currentStore.d.ts +15 -0
- package/dist/store/currentStore.d.ts.map +1 -0
- package/dist/store/mainStore.d.ts +14 -0
- package/dist/store/mainStore.d.ts.map +1 -0
- package/dist/styles/animations.css +1 -0
- package/dist/styles/core/ui/selection.css +1 -0
- package/dist/styles/core/ui/slider.css +1 -0
- package/dist/styles/entities/blocks/code.css +1 -0
- package/dist/styles/entities/blocks/files.css +1 -0
- package/dist/styles/entities/blocks/gallery.css +1 -0
- package/dist/styles/entities/blocks/list.css +1 -0
- package/dist/styles/entities/blocks/paragraph.css +1 -0
- package/dist/styles/entities/tools/inline-code.css +1 -0
- package/dist/styles/entities/tools/link.css +1 -0
- package/dist/styles/texditor.css +1 -0
- package/dist/styles/theme.css +42 -0
- package/dist/texditor.d.ts +68 -0
- package/dist/texditor.d.ts.map +1 -0
- package/dist/texditor.mjs +138 -0
- package/dist/types/core/base/base-model.d.ts +212 -0
- package/dist/types/core/base/base-model.d.ts.map +1 -0
- package/dist/types/core/base/event-manager.d.ts +42 -0
- package/dist/types/core/base/event-manager.d.ts.map +1 -0
- package/dist/types/core/base/index.d.ts +3 -0
- package/dist/types/core/base/index.d.ts.map +1 -0
- package/dist/types/core/block-manager.d.ts +223 -0
- package/dist/types/core/block-manager.d.ts.map +1 -0
- package/dist/types/core/commands.d.ts +93 -0
- package/dist/types/core/commands.d.ts.map +1 -0
- package/dist/types/core/config.d.ts +86 -0
- package/dist/types/core/config.d.ts.map +1 -0
- package/dist/types/core/events.d.ts +58 -0
- package/dist/types/core/events.d.ts.map +1 -0
- package/dist/types/core/extensions.d.ts +19 -0
- package/dist/types/core/extensions.d.ts.map +1 -0
- package/dist/types/core/history-manager.d.ts +72 -0
- package/dist/types/core/history-manager.d.ts.map +1 -0
- package/dist/types/core/http/index.d.ts +2 -0
- package/dist/types/core/http/index.d.ts.map +1 -0
- package/dist/types/core/http/response.d.ts +6 -0
- package/dist/types/core/http/response.d.ts.map +1 -0
- package/dist/types/core/i18n.d.ts +40 -0
- package/dist/types/core/i18n.d.ts.map +1 -0
- package/dist/types/core/index.d.ts +15 -0
- package/dist/types/core/index.d.ts.map +1 -0
- package/dist/types/core/models/action-model.d.ts +46 -0
- package/dist/types/core/models/action-model.d.ts.map +1 -0
- package/dist/types/core/models/block-model.d.ts +404 -0
- package/dist/types/core/models/block-model.d.ts.map +1 -0
- package/dist/types/core/models/extension-model.d.ts +41 -0
- package/dist/types/core/models/extension-model.d.ts.map +1 -0
- package/dist/types/core/models/file-action-model.d.ts +36 -0
- package/dist/types/core/models/file-action-model.d.ts.map +1 -0
- package/dist/types/core/models/index.d.ts +7 -0
- package/dist/types/core/models/index.d.ts.map +1 -0
- package/dist/types/core/models/tool-model.d.ts +54 -0
- package/dist/types/core/models/tool-model.d.ts.map +1 -0
- package/dist/types/core/sanitizer.d.ts +27 -0
- package/dist/types/core/sanitizer.d.ts.map +1 -0
- package/dist/types/core/selection-api.d.ts +116 -0
- package/dist/types/core/selection-api.d.ts.map +1 -0
- package/dist/types/core/tools.d.ts +35 -0
- package/dist/types/core/tools.d.ts.map +1 -0
- package/dist/types/core/ui/index.d.ts +4 -0
- package/dist/types/core/ui/index.d.ts.map +1 -0
- package/dist/types/core/ui/slider.d.ts +45 -0
- package/dist/types/core/ui/slider.d.ts.map +1 -0
- package/dist/types/core/ui/toasts.d.ts +58 -0
- package/dist/types/core/ui/toasts.d.ts.map +1 -0
- package/dist/types/core/ui/virtual-selection.d.ts +83 -0
- package/dist/types/core/ui/virtual-selection.d.ts.map +1 -0
- package/dist/types/entities/blocks/code.d.ts +4 -0
- package/dist/types/entities/blocks/code.d.ts.map +1 -0
- package/dist/types/entities/blocks/files.d.ts +170 -0
- package/dist/types/entities/blocks/files.d.ts.map +1 -0
- package/dist/types/entities/blocks/gallery.d.ts +40 -0
- package/dist/types/entities/blocks/gallery.d.ts.map +1 -0
- package/dist/types/entities/blocks/header.d.ts +4 -0
- package/dist/types/entities/blocks/header.d.ts.map +1 -0
- package/dist/types/entities/blocks/index.d.ts +7 -0
- package/dist/types/entities/blocks/index.d.ts.map +1 -0
- package/dist/types/entities/blocks/list.d.ts +4 -0
- package/dist/types/entities/blocks/list.d.ts.map +1 -0
- package/dist/types/entities/blocks/paragraph.d.ts +4 -0
- package/dist/types/entities/blocks/paragraph.d.ts.map +1 -0
- package/dist/types/entities/index.d.ts +2 -0
- package/dist/types/entities/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/texditor.d.ts +66 -0
- package/dist/types/texditor.d.ts.map +1 -0
- package/dist/types/utils/ajax.d.ts +31 -0
- package/dist/types/utils/ajax.d.ts.map +1 -0
- package/dist/types/utils/icon.d.ts +10 -0
- package/dist/types/utils/icon.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +3 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/utils/ajax.d.ts +9 -0
- package/dist/utils/ajax.d.ts.map +1 -0
- package/dist/utils/common.d.ts +28 -0
- package/dist/utils/common.d.ts.map +1 -0
- package/dist/utils/icon.d.ts +12 -0
- package/dist/utils/icon.d.ts.map +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/sanitizer.d.ts +8 -0
- package/dist/utils/sanitizer.d.ts.map +1 -0
- package/dist/views/extensions.d.ts +3 -0
- package/dist/views/extensions.d.ts.map +1 -0
- package/dist/views/main.d.ts +3 -0
- package/dist/views/main.d.ts.map +1 -0
- package/dist/views/tools.d.ts +2 -0
- package/dist/views/tools.d.ts.map +1 -0
- package/package.json +75 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
export interface Commands {
|
|
2
|
+
/**
|
|
3
|
+
* Formats a specific text range within a container with the given HTML tag
|
|
4
|
+
* @param tagName - HTML tag name to apply (e.g., 'strong', 'em')
|
|
5
|
+
* @param startOffset - Starting character offset in the container
|
|
6
|
+
* @param endOffset - Ending character offset in the container
|
|
7
|
+
* @param container - Container element containing the text
|
|
8
|
+
*/
|
|
9
|
+
formatTextRange(tagName: string, startOffset: number, endOffset: number, container: HTMLElement): void;
|
|
10
|
+
/**
|
|
11
|
+
* Applies or removes formatting based on current selection context
|
|
12
|
+
* @param tagName - HTML tag name to format with
|
|
13
|
+
* @param focus - Whether to restore focus after formatting
|
|
14
|
+
*/
|
|
15
|
+
format(tagName: string, focus?: boolean): void;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a new format around the current selection
|
|
18
|
+
* @param tagName - HTML tag name to apply
|
|
19
|
+
*/
|
|
20
|
+
createFormat(tagName: string): void;
|
|
21
|
+
/**
|
|
22
|
+
* Removes formatting tags from the current selection
|
|
23
|
+
* @param tagName - HTML tag name to remove
|
|
24
|
+
* @param focus - Whether to restore focus after removal
|
|
25
|
+
* @param normalize - Whether to normalize after removal
|
|
26
|
+
*/
|
|
27
|
+
removeFormat(tagName: string, focus?: boolean, normalize?: boolean): void;
|
|
28
|
+
/**
|
|
29
|
+
* Removes all formatting tags from the document
|
|
30
|
+
* @param normalize - Whether to normalize after clearing
|
|
31
|
+
*/
|
|
32
|
+
clearAllFormatting(normalize?: boolean): void;
|
|
33
|
+
/**
|
|
34
|
+
* Normalizes the DOM structure by removing empty tags and merging adjacent elements
|
|
35
|
+
* @param container - Optional container to normalize (defaults to current selection element)
|
|
36
|
+
*/
|
|
37
|
+
normalize(container?: HTMLElement): void;
|
|
38
|
+
/**
|
|
39
|
+
* Flattens nested tags of the same type (e.g., <strong><strong>text</strong></strong>)
|
|
40
|
+
* @param parentElement - Element to process
|
|
41
|
+
*/
|
|
42
|
+
flattenNestedTags(parentElement: HTMLElement): void;
|
|
43
|
+
/**
|
|
44
|
+
* Merges adjacent tags of the same type
|
|
45
|
+
* @param root - Root element to process
|
|
46
|
+
*/
|
|
47
|
+
mergeAdjacentTags(root: HTMLElement | Element): void;
|
|
48
|
+
/**
|
|
49
|
+
* Removes empty tags of specified type from an element
|
|
50
|
+
* @param element - Parent element to check
|
|
51
|
+
* @param tagName - Tag name to remove if empty
|
|
52
|
+
*/
|
|
53
|
+
removeEmptyTags(element: HTMLElement, tagName: string): void;
|
|
54
|
+
/**
|
|
55
|
+
* Splits an element at specified text positions
|
|
56
|
+
* @param element - Element to split
|
|
57
|
+
* @param startIndex - Start index for split
|
|
58
|
+
* @param endIndex - End index for split
|
|
59
|
+
* @returns Tuple of [before element, middle fragment, after element]
|
|
60
|
+
*/
|
|
61
|
+
splitElement(element: HTMLElement, startIndex: number, endIndex: number): [HTMLElement, DocumentFragment, HTMLElement];
|
|
62
|
+
/**
|
|
63
|
+
* Replaces empty edges with space characters
|
|
64
|
+
* @param el - Parent element
|
|
65
|
+
* @param item - Optional item to check edges for
|
|
66
|
+
*/
|
|
67
|
+
replaceEmptyEdges(el: HTMLElement, item?: HTMLElement | Node): void;
|
|
68
|
+
/**
|
|
69
|
+
* Finds all tags matching the criteria within the current selection
|
|
70
|
+
* @param tagName - Tag name to find (false for all tags)
|
|
71
|
+
* @param children - Whether to search in child elements
|
|
72
|
+
* @returns Array of matching HTML elements
|
|
73
|
+
*/
|
|
74
|
+
findTags(tagName?: string | boolean, children?: boolean): HTMLElement[];
|
|
75
|
+
/**
|
|
76
|
+
* Determines the direction of selection relative to formatting tags
|
|
77
|
+
* @param tagName - Tag name or element to check direction for
|
|
78
|
+
* @returns Direction constant or null
|
|
79
|
+
*/
|
|
80
|
+
getSelectionDirection(tagName: string | HTMLElement): string | null;
|
|
81
|
+
/**
|
|
82
|
+
* Gets the first and last characters of a string with their emptiness status
|
|
83
|
+
* @param str - Input string
|
|
84
|
+
* @returns Object containing edge characters and their emptiness status
|
|
85
|
+
*/
|
|
86
|
+
getEdgeChars(str: string): {
|
|
87
|
+
firstChar: string;
|
|
88
|
+
lastChar: string;
|
|
89
|
+
isEmptyFirstChar: boolean;
|
|
90
|
+
isEmptyLastChar: boolean;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/types/core/commands.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB;;;;;;OAMG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAEvG;;;;OAIG;IACH,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAE/C;;;OAGG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,G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AAC;CACH"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { ActionModelConstructor, BlockModelConstructor, ExtensionModelConstructor, LocaleMap, TexditorEvent, ToolModelConstructor } from '..';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration store interface defining all available configuration options
|
|
4
|
+
*/
|
|
5
|
+
export interface ConfigOptions {
|
|
6
|
+
/** Unique identifier for the editor instance */
|
|
7
|
+
handle?: string;
|
|
8
|
+
/** Callback function called when editor is ready */
|
|
9
|
+
onReady?: (evt: TexditorEvent) => void;
|
|
10
|
+
/** Callback function called when content changes */
|
|
11
|
+
onChange?: (evt: TexditorEvent) => void;
|
|
12
|
+
/** Initial data to populate the editor */
|
|
13
|
+
content?: object[] | string;
|
|
14
|
+
/** Array of block model instances available in the editor */
|
|
15
|
+
blocks?: BlockModelConstructor[];
|
|
16
|
+
/** Maximum number of blocks allowed in the editor */
|
|
17
|
+
maxBlocks?: number;
|
|
18
|
+
/** Array of tool model instances available in the editor */
|
|
19
|
+
tools?: ToolModelConstructor[];
|
|
20
|
+
/** Default block type to insert (e.g., "p", "h1") */
|
|
21
|
+
defaultBlock?: string;
|
|
22
|
+
/** Current locale for translations */
|
|
23
|
+
locale?: string;
|
|
24
|
+
/** Localizations */
|
|
25
|
+
locales?: LocaleMap[];
|
|
26
|
+
/** Default locale fallback */
|
|
27
|
+
defaultLocale?: string;
|
|
28
|
+
/** Array of action model instances */
|
|
29
|
+
actions?: ActionModelConstructor[];
|
|
30
|
+
/** Array of extension model instances */
|
|
31
|
+
extensions?: ExtensionModelConstructor[];
|
|
32
|
+
/** Whether extensions panel is fixed position */
|
|
33
|
+
extensionsFixed?: boolean;
|
|
34
|
+
/** Custom styles for fixed extensions panel */
|
|
35
|
+
extensionsFixedStyle?: false | Record<string, string>;
|
|
36
|
+
/** Whether to show extension titles */
|
|
37
|
+
extensionVisibleTitle?: boolean;
|
|
38
|
+
/** Whether to autofocus editor on initialization */
|
|
39
|
+
autofocus?: boolean;
|
|
40
|
+
/** Autofocus delay */
|
|
41
|
+
autofocusDelay?: number;
|
|
42
|
+
/** Virtual block selection zone */
|
|
43
|
+
selectionZoneElement?: HTMLElement;
|
|
44
|
+
/** Use keyboard shortcut history */
|
|
45
|
+
historyShortcuts?: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Type definition for the config get function with overloads
|
|
49
|
+
*/
|
|
50
|
+
export type ConfigGetFunction = {
|
|
51
|
+
/**
|
|
52
|
+
* Gets defaultBlock configuration value
|
|
53
|
+
* @param key - Must be "defaultBlock"
|
|
54
|
+
* @param defaultValue - Default string value
|
|
55
|
+
* @returns Configuration value as string
|
|
56
|
+
*/
|
|
57
|
+
(key: 'defaultBlock', defaultValue: string): string;
|
|
58
|
+
/**
|
|
59
|
+
* Gets a typed configuration value
|
|
60
|
+
* @param key - Configuration key from ConfigOptions
|
|
61
|
+
* @returns Configuration value with proper type
|
|
62
|
+
*/
|
|
63
|
+
<K extends keyof ConfigOptions>(key: K): ConfigOptions[K];
|
|
64
|
+
/**
|
|
65
|
+
* Gets a typed configuration value with default
|
|
66
|
+
* @param key - Configuration key from ConfigOptions
|
|
67
|
+
* @param defaultValue - Default value
|
|
68
|
+
* @returns Configuration value or default
|
|
69
|
+
*/
|
|
70
|
+
<K extends keyof ConfigOptions>(key: K, defaultValue: Required<ConfigOptions>[K]): Required<ConfigOptions>[K];
|
|
71
|
+
/**
|
|
72
|
+
* Gets any configuration value (fallback)
|
|
73
|
+
* @param key - Any string key
|
|
74
|
+
* @param defaultValue - Default value
|
|
75
|
+
* @returns Configuration value or default as unknown
|
|
76
|
+
*/
|
|
77
|
+
(key: string, defaultValue: unknown): unknown;
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Configuration manager interface
|
|
81
|
+
*/
|
|
82
|
+
export interface Config {
|
|
83
|
+
/** Method to retrieve configuration values */
|
|
84
|
+
get: ConfigGetFunction;
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=config.d.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,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC,oDAAoD;IACpD,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,sBAAsB;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,mCAAmC;IACnC,oBAAoB,CAAC,EAAE,WAAW,CAAC;IAEnC,oCAAoC;IACpC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;;;OAKG;IACH,CAAC,GAAG,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAAC;IAEpD;;;;OAIG;IACH,CAAC,CAAC,SAAS,MAAM,aAAa,EAAE,GAAG,EAAE,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;IAE1D;;;;;OAKG;IACH,CAAC,CAAC,SAAS,MAAM,aAAa,EAAE,GAAG,EAAE,CAAC,EAAE,YAAY,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IAE9G;;;;;OAKG;IACH,CAAC,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAAC;CAC/C,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,8CAA8C;IAC9C,GAAG,EAAE,iBAAiB,CAAC;CACxB"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { BlockElement, EventManager, Texditor } from '..';
|
|
2
|
+
export type PasteMapItem = {
|
|
3
|
+
type: string;
|
|
4
|
+
node: Node;
|
|
5
|
+
};
|
|
6
|
+
export type PasteMap = {
|
|
7
|
+
schema: string;
|
|
8
|
+
data: PasteMapItem[];
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Event data structure passed to callbacks
|
|
12
|
+
*/
|
|
13
|
+
export interface TexditorEventBase {
|
|
14
|
+
/** Type of event */
|
|
15
|
+
type?: string;
|
|
16
|
+
/** Index related to the event */
|
|
17
|
+
index?: number | number[];
|
|
18
|
+
/** Index of the target element related to the event */
|
|
19
|
+
targetIndex?: number | number[];
|
|
20
|
+
/** Block node involved in the event */
|
|
21
|
+
blockElement?: BlockElement | HTMLElement | null;
|
|
22
|
+
/** The content node inside the block */
|
|
23
|
+
contentElement?: HTMLElement | null;
|
|
24
|
+
/** Event-bound DOM element */
|
|
25
|
+
element?: HTMLElement | HTMLElement[] | null;
|
|
26
|
+
/** Original DOM event */
|
|
27
|
+
domEvent?: Event;
|
|
28
|
+
/** Model name */
|
|
29
|
+
modelCode?: string;
|
|
30
|
+
/** Additional event data */
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Public Event Data Structure (read-only)
|
|
35
|
+
* */
|
|
36
|
+
export interface TexditorEvent extends TexditorEventBase {
|
|
37
|
+
/** Reference to the Texditor instance that fired the event */
|
|
38
|
+
instance: Texditor;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Events manager interface for handling editor events
|
|
42
|
+
*/
|
|
43
|
+
export interface Events extends EventManager {
|
|
44
|
+
/**
|
|
45
|
+
* Handles content change events
|
|
46
|
+
* @param event - Change event data
|
|
47
|
+
*/
|
|
48
|
+
change(event: TexditorEventBase): void;
|
|
49
|
+
/**
|
|
50
|
+
* Refreshes event listeners on all blocks
|
|
51
|
+
*/
|
|
52
|
+
refresh(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Destroys the events manager and cleans up all listeners
|
|
55
|
+
*/
|
|
56
|
+
destroy(): void;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/types/core/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;A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ensions {
|
|
3
|
+
/**
|
|
4
|
+
* Gets all registered extension models.
|
|
5
|
+
* @returns array of extension models.
|
|
6
|
+
*/
|
|
7
|
+
getExtensions(): ExtensionModel[];
|
|
8
|
+
/**
|
|
9
|
+
* Refreshes the extensions UI.
|
|
10
|
+
*/
|
|
11
|
+
refresh(): void;
|
|
12
|
+
/**
|
|
13
|
+
* Destroys the extensions manager.
|
|
14
|
+
* Removes all event listeners and cleans up.
|
|
15
|
+
* Should be called when editor is being destroyed.
|
|
16
|
+
*/
|
|
17
|
+
destroy(): void;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=extensions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../../src/types/core/extensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,aAAa,IAAI,cAAc,EAAE,CAAC;IAElC;;OAEG;IACH,OAAO,IAAI,IAAI,CAAC;IAEhB;;;;OAIG;IACH,OAAO,IAAI,IAAI,CAAC;CACjB"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { BlockSchema } from './models';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for selection data to be saved in history
|
|
4
|
+
* Describes cursor position and selected block at the moment of state saving
|
|
5
|
+
* @property start - Starting position of selection in text
|
|
6
|
+
* @property end - Ending position of selection in text
|
|
7
|
+
* @property index - Index of the current block
|
|
8
|
+
* @property itemIndex - Item index inside block (for editable lists, etc.)
|
|
9
|
+
*/
|
|
10
|
+
export interface HistoryStateSelectionData {
|
|
11
|
+
start: number;
|
|
12
|
+
end: number;
|
|
13
|
+
index: number;
|
|
14
|
+
itemIndex?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Interface for history state
|
|
18
|
+
* Stores a complete snapshot of the editor state at a specific moment in time
|
|
19
|
+
* @property content - Content of all editor blocks
|
|
20
|
+
* @property selection - Current selection data
|
|
21
|
+
* @property timestamp - Timestamp of state creation (Unix timestamp)
|
|
22
|
+
*/
|
|
23
|
+
export interface HistoryState {
|
|
24
|
+
content: BlockSchema[];
|
|
25
|
+
selection: HistoryStateSelectionData;
|
|
26
|
+
timestamp: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Interface for history manager
|
|
30
|
+
* Defines API for managing change history, undo and redo operations
|
|
31
|
+
*/
|
|
32
|
+
export interface HistoryManager {
|
|
33
|
+
/**
|
|
34
|
+
* Schedule delayed state saving with debouncing
|
|
35
|
+
* Used to optimize frequent changes
|
|
36
|
+
*/
|
|
37
|
+
scheduleSave(): void;
|
|
38
|
+
/**
|
|
39
|
+
* Immediately save the current state
|
|
40
|
+
*/
|
|
41
|
+
save(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Undo the last operation
|
|
44
|
+
* @returns true if operation was successful, false if nothing to undo
|
|
45
|
+
*/
|
|
46
|
+
undo(): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Redo the previously undone operation
|
|
49
|
+
* @returns true if operation was successful, false if nothing to redo
|
|
50
|
+
*/
|
|
51
|
+
redo(): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Check if undo operation is available
|
|
54
|
+
* @returns true if there are actions to undo
|
|
55
|
+
*/
|
|
56
|
+
canUndo(): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Check if redo operation is available
|
|
59
|
+
* @returns true if there are actions to redo
|
|
60
|
+
*/
|
|
61
|
+
canRedo(): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Clear all history (both past and future states)
|
|
64
|
+
*/
|
|
65
|
+
clear(): void;
|
|
66
|
+
/**
|
|
67
|
+
* Set the delayed save interval
|
|
68
|
+
* @param interval - interval in milliseconds
|
|
69
|
+
*/
|
|
70
|
+
setSaveInterval(interval: number): void;
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=history-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history-manager.d.ts","sourceRoot":"","sources":["../../../src/types/core/history-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC;;;;;;;GAOG;AACH,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,SAAS,EAAE,yBAAyB,CAAC;IACrC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,YAAY,IAAI,IAAI,CAAC;IAErB;;OAEG;IACH,IAAI,IAAI,IAAI,CAAC;IAEb;;;OAGG;IACH,IAAI,IAAI,OAAO,CAAC;IAEhB;;;OAGG;IACH,IAAI,IAAI,OAAO,CAAC;IAEhB;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC;IAEnB;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC;IAEnB;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;IAEd;;;OAGG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/core/http/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../../src/types/core/http/response.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ,CAAC,CAAC,GAAG,OAAO;IACnC,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,EAAE,OAAO,CAAC;IACjB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locale map data structure
|
|
3
|
+
* Key-value pairs for translation strings
|
|
4
|
+
*/
|
|
5
|
+
export type LocaleMapData = {
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Locale map interface
|
|
10
|
+
* @property code - Locale identifier code
|
|
11
|
+
* @property data - Translation data for the locale
|
|
12
|
+
*/
|
|
13
|
+
export interface LocaleMap {
|
|
14
|
+
code: string;
|
|
15
|
+
data: LocaleMapData;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* I18N interface for internationalization management
|
|
19
|
+
* Defines all public methods for translation handling
|
|
20
|
+
*/
|
|
21
|
+
export interface I18N {
|
|
22
|
+
/**
|
|
23
|
+
* Get current active locale
|
|
24
|
+
* @returns Current locale code string
|
|
25
|
+
*/
|
|
26
|
+
getLocale(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Get default fallback locale
|
|
29
|
+
* @returns Default locale code string
|
|
30
|
+
*/
|
|
31
|
+
getDefaultLocale(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Get translation for a key
|
|
34
|
+
* @param key - Translation key to look up
|
|
35
|
+
* @param def - Default value if translation not found
|
|
36
|
+
* @returns Translated string or default value
|
|
37
|
+
*/
|
|
38
|
+
get(key: string, def?: string): string;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=i18n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../src/types/core/i18n.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,aAAa,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,IAAI;IACnB;;;OAGG;IACH,SAAS,IAAI,MAAM,CAAC;IAEpB;;;OAGG;IACH,gBAAgB,IAAI,MAAM,CAAC;IAE3B;;;;;OAKG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACxC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './base';
|
|
2
|
+
export * from './block-manager';
|
|
3
|
+
export * from './commands';
|
|
4
|
+
export * from './config';
|
|
5
|
+
export * from './events';
|
|
6
|
+
export * from './extensions';
|
|
7
|
+
export * from './history-manager';
|
|
8
|
+
export * from './i18n';
|
|
9
|
+
export * from './sanitizer';
|
|
10
|
+
export * from './selection-api';
|
|
11
|
+
export * from './tools';
|
|
12
|
+
export * from './models';
|
|
13
|
+
export * from './ui';
|
|
14
|
+
export * from './http';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,MAAM,CAAC;AACrB,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { BaseModelConfig, BaseModel, BaseElement, BlockElement, ModelConstructor } from '../..';
|
|
2
|
+
/**
|
|
3
|
+
* Action model constructor type
|
|
4
|
+
* Specialized constructor that creates ActionModel instances
|
|
5
|
+
* with ActionModelConfig
|
|
6
|
+
*/
|
|
7
|
+
export type ActionModelConstructor = ModelConstructor<ActionModel, ActionModelConfig>;
|
|
8
|
+
/**
|
|
9
|
+
* Action DOM node interface
|
|
10
|
+
* Extends HTMLElement with action model reference
|
|
11
|
+
*/
|
|
12
|
+
export interface ActionElement extends BaseElement {
|
|
13
|
+
/** Reference to the action model instance */
|
|
14
|
+
baseModel: ActionModel;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Action model configuration interface
|
|
18
|
+
* @property menu - Whether action shows a menu on click
|
|
19
|
+
* @property confirm - Whether action requires confirmation before execution
|
|
20
|
+
*/
|
|
21
|
+
export interface ActionModelConfig extends BaseModelConfig {
|
|
22
|
+
dropdown: boolean;
|
|
23
|
+
confirm: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Action model behavior interface
|
|
27
|
+
* Defines all public methods for action manipulation
|
|
28
|
+
*/
|
|
29
|
+
export interface ActionModel extends BaseModel<ActionElement> {
|
|
30
|
+
/**
|
|
31
|
+
* Get the parent block node associated with this action
|
|
32
|
+
* @returns The parent block node or null if not set
|
|
33
|
+
*/
|
|
34
|
+
getBlockElement(): BlockElement | null;
|
|
35
|
+
/**
|
|
36
|
+
* Check if the drop-down list of actions is displayed when you click
|
|
37
|
+
* @returns True if the action has a dropdown menu, false otherwise.
|
|
38
|
+
*/
|
|
39
|
+
isDropdown(): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Check if action requires confirmation before execution
|
|
42
|
+
* @returns True if confirmation is required, false otherwise
|
|
43
|
+
*/
|
|
44
|
+
isConfirm(): boolean;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=action-model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-model.d.ts","sourceRoot":"","sources":["../../../../src/types/core/models/action-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEvG;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;AAEtF;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,WAAW;IAChD,6CAA6C;IAC7C,SAAS,EAAE,WAAW,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAkB,SAAQ,eAAe;IACxD,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,SAAS,CAAC,aAAa,CAAC;IAC3D;;;OAGG;IACH,eAAe,IAAI,YAAY,GAAG,IAAI,CAAC;IAEvC;;;OAGG;IACH,UAAU,IAAI,OAAO,CAAC;IAEtB;;;OAGG;IACH,SAAS,IAAI,OAAO,CAAC;CACtB"}
|