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,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cursor position interface
|
|
3
|
+
* Represents the start and end offsets of a text selection
|
|
4
|
+
*/
|
|
5
|
+
export interface CursorPosition {
|
|
6
|
+
/** Starting offset of the selection */
|
|
7
|
+
start: number;
|
|
8
|
+
/** Ending offset of the selection */
|
|
9
|
+
end: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Current selection data interface
|
|
13
|
+
* Stores the active selection state including position and containing element
|
|
14
|
+
*/
|
|
15
|
+
export interface SelectionState {
|
|
16
|
+
/** Cursor position with start and end offsets */
|
|
17
|
+
position: CursorPosition;
|
|
18
|
+
/** HTML element containing the selection, or null if no selection */
|
|
19
|
+
element: HTMLElement | null;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Selection API interface
|
|
23
|
+
* Defines the complete API for managing text selection, cursor operations,
|
|
24
|
+
* and range manipulations within the editor
|
|
25
|
+
*/
|
|
26
|
+
export interface SelectionAPI {
|
|
27
|
+
/**
|
|
28
|
+
* Saves the current selection state.
|
|
29
|
+
* @param state - selection state containing element and cursor position.
|
|
30
|
+
*/
|
|
31
|
+
setState(state: SelectionState): void;
|
|
32
|
+
/**
|
|
33
|
+
* Gets the saved selection state.
|
|
34
|
+
* @returns the current selection state.
|
|
35
|
+
*/
|
|
36
|
+
getState(): SelectionState;
|
|
37
|
+
/**
|
|
38
|
+
* Clears the saved selection state.
|
|
39
|
+
*/
|
|
40
|
+
clearState(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Restores the saved selection state.
|
|
43
|
+
*/
|
|
44
|
+
applyState(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Selects text within a container from start to end positions
|
|
47
|
+
* @param startPos - Starting position offset
|
|
48
|
+
* @param endPos - Ending position offset
|
|
49
|
+
* @param container - Container element (optional)
|
|
50
|
+
* @param scrollToContainer - Whether to scroll to the container
|
|
51
|
+
*/
|
|
52
|
+
select(startPos: number, endPos: number, container?: Element, scrollToContainer?: boolean): void;
|
|
53
|
+
/**
|
|
54
|
+
* Inserts content at the current cursor position
|
|
55
|
+
* @param content - Content to insert (HTML or text)
|
|
56
|
+
* @param isHtml - Whether content is HTML (true) or plain text (false)
|
|
57
|
+
* @param strip - Whether to strip HTML tags when isHtml is false
|
|
58
|
+
* @returns True if insertion was successful
|
|
59
|
+
*/
|
|
60
|
+
insert(content: string, isHtml?: boolean, strip?: boolean): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Inserts plain text at the current cursor position
|
|
63
|
+
* @param content - Text content to insert
|
|
64
|
+
* @param cleanHtml - Whether to strip HTML tags from content
|
|
65
|
+
* @returns True if insertion was successful
|
|
66
|
+
*/
|
|
67
|
+
insertText(content: string, cleanHtml?: boolean): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Splits content at the current cursor position
|
|
70
|
+
* @param container - Container element to split (optional)
|
|
71
|
+
* @returns HTML string of the content after the split
|
|
72
|
+
*/
|
|
73
|
+
splitContent(container?: HTMLElement | null): string;
|
|
74
|
+
/**
|
|
75
|
+
* Finds all HTML tags that intersect with the current selection
|
|
76
|
+
* @param container - Container element to search within
|
|
77
|
+
* @param children - Whether to search children recursively
|
|
78
|
+
* @returns Array of HTML elements that intersect the selection
|
|
79
|
+
*/
|
|
80
|
+
findTags(container: Element | HTMLElement, children?: boolean): HTMLElement[];
|
|
81
|
+
/**
|
|
82
|
+
* Gets the current window selection object
|
|
83
|
+
* @returns Selection object or null if not available
|
|
84
|
+
*/
|
|
85
|
+
getSelection(): Selection | null;
|
|
86
|
+
/**
|
|
87
|
+
* Gets a specific range from the current selection
|
|
88
|
+
* @param index - Index of the range to retrieve (default: 0)
|
|
89
|
+
* @returns Range object or null if not available
|
|
90
|
+
*/
|
|
91
|
+
getRange(index?: number): Range | null;
|
|
92
|
+
/**
|
|
93
|
+
* Calculates absolute character offset within a container
|
|
94
|
+
* @param container - Container node
|
|
95
|
+
* @param offset - Relative offset
|
|
96
|
+
* @returns Absolute offset position
|
|
97
|
+
*/
|
|
98
|
+
getAbsoluteOffset(container: Node, offset: number): number;
|
|
99
|
+
/**
|
|
100
|
+
* Gets the start and end offsets of the current selection
|
|
101
|
+
* @param container - Container element (optional)
|
|
102
|
+
* @returns Tuple of [start, end] offsets, or [-1, -1] if invalid
|
|
103
|
+
*/
|
|
104
|
+
getOffset(container?: Node | HTMLElement | null): [number, number];
|
|
105
|
+
/**
|
|
106
|
+
* Gets the bounding rectangle of the current selection
|
|
107
|
+
* @returns DOMRect of the selection or null if not available
|
|
108
|
+
*/
|
|
109
|
+
getBounds(): DOMRect | null;
|
|
110
|
+
/**
|
|
111
|
+
* Gets the bounding rectangle of the first line of selection
|
|
112
|
+
* @returns DOMRect of the first line or null if not available
|
|
113
|
+
*/
|
|
114
|
+
getFirstLineBounds(): DOMRect | null;
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=selection-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selection-api.d.ts","sourceRoot":"","sources":["../../../src/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,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,IAAI,CAAC;IAEvC;;;;;OAKG;IACH,iBAAiB,CAAC,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAE3D;;;;OAIG;IACH,SAAS,CAAC,SAAS,CAAC,EAAE,IAAI,GAAG,WAAW,GAAG,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEnE;;;OAGG;IACH,SAAS,IAAI,OAAO,GAAG,IAAI,CAAC;IAE5B;;;OAGG;IACH,kBAAkB,IAAI,OAAO,GAAG,IAAI,CAAC;CACtC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ToolModel } from './models';
|
|
2
|
+
/**
|
|
3
|
+
* Tools manager interface
|
|
4
|
+
* Defines all public methods for toolbar manipulation
|
|
5
|
+
*/
|
|
6
|
+
export interface Tools {
|
|
7
|
+
/**
|
|
8
|
+
* Show the toolbar at the current selection position
|
|
9
|
+
*/
|
|
10
|
+
show(): void;
|
|
11
|
+
/**
|
|
12
|
+
* Hide the toolbar
|
|
13
|
+
*/
|
|
14
|
+
hide(): void;
|
|
15
|
+
/**
|
|
16
|
+
* Synchronize active state highlighting for tools based on current selection
|
|
17
|
+
*/
|
|
18
|
+
syncHighlight(): void;
|
|
19
|
+
/**
|
|
20
|
+
* Gets all registered tools.
|
|
21
|
+
* @returns Array of tool models.
|
|
22
|
+
*/
|
|
23
|
+
getTools(): ToolModel[];
|
|
24
|
+
/**
|
|
25
|
+
* Gets a tool model by its unique string tag, or `null` if not found.
|
|
26
|
+
* @param tagName - unique string identifier of the model.
|
|
27
|
+
* @returns the matching ToolModel or null.
|
|
28
|
+
*/
|
|
29
|
+
getModelByTagName(tagName: string): ToolModel | null;
|
|
30
|
+
/**
|
|
31
|
+
* Destroy tools manager and clean up resources
|
|
32
|
+
*/
|
|
33
|
+
destroy(): void;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/types/core/tools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC;;;GAGG;AACH,MAAM,WAAW,KAAK;IACpB;;OAEG;IACH,IAAI,IAAI,IAAI,CAAC;IAEb;;OAEG;IACH,IAAI,IAAI,IAAI,CAAC;IAEb;;OAEG;IACH,aAAa,IAAI,IAAI,CAAC;IAEtB;;;OAGG;IACH,QAAQ,IAAI,SAAS,EAAE,CAAC;IAExB;;;;OAIG;IACH,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAErD;;OAEG;IACH,OAAO,IAAI,IAAI,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/core/ui/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration options for the Slider component
|
|
3
|
+
*/
|
|
4
|
+
export interface SliderOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Enables infinite looping navigation
|
|
7
|
+
* When true, navigating past the last slide goes to the first and vice versa
|
|
8
|
+
* @default true
|
|
9
|
+
*/
|
|
10
|
+
infinite?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Callback function triggered whenever the active slide changes
|
|
13
|
+
* @param index - The new current slide index (0-based)
|
|
14
|
+
*/
|
|
15
|
+
onChange?: (index: number) => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Public API interface for the Slider class
|
|
19
|
+
* Defines all methods and properties available for external use
|
|
20
|
+
*/
|
|
21
|
+
export interface Slider {
|
|
22
|
+
/**
|
|
23
|
+
* Navigates to a specific slide by index
|
|
24
|
+
* @param index - Target slide index (0-based)
|
|
25
|
+
* @throws Will not throw but will clamp index based on infinite option
|
|
26
|
+
*/
|
|
27
|
+
goToSlide(index: number): void;
|
|
28
|
+
/**
|
|
29
|
+
* Navigates to the next slide
|
|
30
|
+
* Behavior depends on infinite option setting
|
|
31
|
+
*/
|
|
32
|
+
next(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Navigates to the previous slide
|
|
35
|
+
* Behavior depends on infinite option setting
|
|
36
|
+
*/
|
|
37
|
+
prev(): void;
|
|
38
|
+
/**
|
|
39
|
+
* Completely destroys the slider instance
|
|
40
|
+
* Removes all added classes, styles, and DOM elements
|
|
41
|
+
* Restores the container to its original state
|
|
42
|
+
*/
|
|
43
|
+
destroy(): void;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=slider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../../../src/types/core/ui/slider.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB;;;;OAIG;IACH,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAE/B;;;OAGG;IACH,IAAI,IAAI,IAAI,CAAC;IAEb;;;OAGG;IACH,IAAI,IAAI,IAAI,CAAC;IAEb;;;;OAIG;IACH,OAAO,IAAI,IAAI,CAAC;CACjB"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for configuring a toast notification.
|
|
3
|
+
*/
|
|
4
|
+
export interface ToastOptions {
|
|
5
|
+
/**
|
|
6
|
+
* The status code determining the toast's appearance (e.g., 'error', 'success', 'warning', 'info').
|
|
7
|
+
* @default 'error'
|
|
8
|
+
*/
|
|
9
|
+
code?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The parent element where the toast container will be inserted.
|
|
12
|
+
* If not provided, uses the default parent from constructor or document.body.
|
|
13
|
+
*/
|
|
14
|
+
parent?: Element;
|
|
15
|
+
/**
|
|
16
|
+
* The insertion method for placing the toast container relative to the parent element.
|
|
17
|
+
* Uses snappykit DOM manipulation methods.
|
|
18
|
+
* @default 'prepend'
|
|
19
|
+
*/
|
|
20
|
+
insertType?: 'prepend' | 'append' | 'before' | 'after';
|
|
21
|
+
/**
|
|
22
|
+
* Custom CSS class name for the toast container.
|
|
23
|
+
* Overrides the default class name set in the constructor.
|
|
24
|
+
*/
|
|
25
|
+
className?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Duration in milliseconds before the toast is automatically removed.
|
|
28
|
+
* @default 3000
|
|
29
|
+
*/
|
|
30
|
+
timeout?: number;
|
|
31
|
+
/**
|
|
32
|
+
* Whether to scroll the toast into view after insertion.
|
|
33
|
+
* @default true
|
|
34
|
+
*/
|
|
35
|
+
scrollIntoView?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Limits display to a single toast, replacing any existing one.
|
|
38
|
+
* @default false
|
|
39
|
+
*/
|
|
40
|
+
single?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Public interface for the Toasts class.
|
|
44
|
+
* Defines the contract for toast notification management.
|
|
45
|
+
*/
|
|
46
|
+
export interface Toasts {
|
|
47
|
+
/**
|
|
48
|
+
* Displays a toast notification with the given message and options.
|
|
49
|
+
* @param message - The text content to display in the toast.
|
|
50
|
+
* @param options - Configuration options for the toast.
|
|
51
|
+
*/
|
|
52
|
+
add(message: string, options?: ToastOptions): void;
|
|
53
|
+
/**
|
|
54
|
+
* Removes all active toast notifications and cleans up the container.
|
|
55
|
+
*/
|
|
56
|
+
clear(): void;
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=toasts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toasts.d.ts","sourceRoot":"","sources":["../../../../src/types/core/ui/toasts.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IAEvD;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AACD;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB;;;;OAIG;IACH,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAEnD;;OAEG;IACH,KAAK,IAAI,IAAI,CAAC;CACf"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration options for the VirtualSelection manager
|
|
3
|
+
*/
|
|
4
|
+
export interface VirtualSelectionOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Container element that holds the selectable blocks
|
|
7
|
+
*/
|
|
8
|
+
blocksContainer: HTMLElement;
|
|
9
|
+
/**
|
|
10
|
+
* CSS selector to identify selectable blocks within the container
|
|
11
|
+
*/
|
|
12
|
+
blockSelector: string;
|
|
13
|
+
/**
|
|
14
|
+
* Zone where selection interaction is active
|
|
15
|
+
* @default document.body
|
|
16
|
+
*/
|
|
17
|
+
selectionZone?: HTMLElement;
|
|
18
|
+
/**
|
|
19
|
+
* CSS class name applied to selected blocks
|
|
20
|
+
* @default 'tex-ui-vs-selected'
|
|
21
|
+
*/
|
|
22
|
+
selectedBlockClass?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Tolerance margin (in pixels) when checking if pointer has exited a block's bounds
|
|
25
|
+
* @default 8
|
|
26
|
+
*/
|
|
27
|
+
exitTolerance?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Auto-scroll speed (in pixels per frame) when dragging near viewport edges
|
|
30
|
+
* @default 30
|
|
31
|
+
*/
|
|
32
|
+
autoScrollSpeed?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Distance (in pixels) from viewport edge to trigger auto-scroll
|
|
35
|
+
* @default 50
|
|
36
|
+
*/
|
|
37
|
+
autoScrollEdgeThreshold?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Delayed launch of the touch version.
|
|
40
|
+
* @default 200
|
|
41
|
+
*/
|
|
42
|
+
touchActivationDelay: number;
|
|
43
|
+
/**
|
|
44
|
+
* Callback invoked when the set of selected blocks changes
|
|
45
|
+
* @param selectedIndices - Array of indices of selected blocks
|
|
46
|
+
* @param selectedElements - Array of DOM elements of selected blocks
|
|
47
|
+
*/
|
|
48
|
+
onSelectionChange?: (selectedIndices: number[], selectedElements: HTMLElement[]) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Callback invoked when lasso selection mode starts
|
|
51
|
+
*/
|
|
52
|
+
onLassoStart?: () => void;
|
|
53
|
+
/**
|
|
54
|
+
* Callback invoked when lasso selection mode ends
|
|
55
|
+
*/
|
|
56
|
+
onLassoEnd?: () => void;
|
|
57
|
+
}
|
|
58
|
+
export interface VirtualSelection {
|
|
59
|
+
/**
|
|
60
|
+
* Returns array of indices of currently selected blocks.
|
|
61
|
+
* @returns Array of selected block indices
|
|
62
|
+
*/
|
|
63
|
+
getSelectedIndices(): number[];
|
|
64
|
+
/**
|
|
65
|
+
* Returns array of DOM elements that are currently selected
|
|
66
|
+
* @returns Array of selected block elements
|
|
67
|
+
*/
|
|
68
|
+
getSelectedBlocks(): HTMLElement[];
|
|
69
|
+
/**
|
|
70
|
+
* Clears current selection, removes all selected blocks
|
|
71
|
+
*/
|
|
72
|
+
clearSelection(): void;
|
|
73
|
+
/**
|
|
74
|
+
* Refreshes internal blocks cache by querying DOM for current blocks
|
|
75
|
+
* Updates indices and reapplies selection state
|
|
76
|
+
*/
|
|
77
|
+
refreshBlocks(): void;
|
|
78
|
+
/**
|
|
79
|
+
* Destroys the VirtualSelection instance
|
|
80
|
+
*/
|
|
81
|
+
destroy(): void;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=virtual-selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual-selection.d.ts","sourceRoot":"","sources":["../../../../src/types/core/ui/virtual-selection.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,eAAe,EAAE,WAAW,CAAC;IAE7B;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,aAAa,CAAC,EAAE,WAAW,CAAC;IAE5B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;OAGG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAEjC;;;OAGG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,eAAe,EAAE,MAAM,EAAE,EAAE,gBAAgB,EAAE,WAAW,EAAE,KAAK,IAAI,CAAC;IAEzF;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAE1B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACzB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,kBAAkB,IAAI,MAAM,EAAE,CAAC;IAE/B;;;OAGG;IACH,iBAAiB,IAAI,WAAW,EAAE,CAAC;IAEnC;;OAEG;IACH,cAAc,IAAI,IAAI,CAAC;IAEvB;;;OAGG;IACH,aAAa,IAAI,IAAI,CAAC;IAEtB;;OAEG;IACH,OAAO,IAAI,IAAI,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../../../src/types/entities/blocks/code.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACvB"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { BlockModelConfig, BlockModel, FileActionModelConstructor, FileActionModel } from '../../';
|
|
2
|
+
import { AjaxConfig, RenderIconContent } from '../..';
|
|
3
|
+
export interface FilesBlockModelConfig extends BlockModelConfig {
|
|
4
|
+
showOnlyWhenEmpty: boolean;
|
|
5
|
+
multiple: boolean;
|
|
6
|
+
messageTimeout: number;
|
|
7
|
+
mimeTypes: string[];
|
|
8
|
+
inputName: string;
|
|
9
|
+
fileCss: string;
|
|
10
|
+
uploadLabelIcon: RenderIconContent;
|
|
11
|
+
uploadLabelIconWidth: number;
|
|
12
|
+
uploadLabelIconHeight: number;
|
|
13
|
+
uploadMultipleLabelText: string;
|
|
14
|
+
uploadAddLabelText: string;
|
|
15
|
+
uploadLabelText: string;
|
|
16
|
+
uploadLabelMessage: string;
|
|
17
|
+
ajaxConfig: AjaxConfig;
|
|
18
|
+
visibleCounter: boolean;
|
|
19
|
+
requiredFieldFileName: boolean;
|
|
20
|
+
requiredFieldCaption: boolean;
|
|
21
|
+
requiredFieldDesc: boolean;
|
|
22
|
+
visibleFieldFileName: boolean;
|
|
23
|
+
visibleFieldCaption: boolean;
|
|
24
|
+
visibleFieldDesc: boolean;
|
|
25
|
+
renderImage: boolean;
|
|
26
|
+
actions: FileActionModelConstructor[];
|
|
27
|
+
}
|
|
28
|
+
export interface FilesAjaxResponse {
|
|
29
|
+
data: FileItem[];
|
|
30
|
+
success: boolean;
|
|
31
|
+
message: string;
|
|
32
|
+
[key: string]: unknown;
|
|
33
|
+
}
|
|
34
|
+
export interface FileItem {
|
|
35
|
+
url: string;
|
|
36
|
+
type: string;
|
|
37
|
+
thumbnail?: string;
|
|
38
|
+
caption?: string;
|
|
39
|
+
desc?: string;
|
|
40
|
+
name?: string;
|
|
41
|
+
size?: number;
|
|
42
|
+
id?: number;
|
|
43
|
+
[key: string]: unknown;
|
|
44
|
+
}
|
|
45
|
+
export interface FileItemElement extends HTMLElement {
|
|
46
|
+
fileType: string;
|
|
47
|
+
fileUrl: string;
|
|
48
|
+
fileSize?: number;
|
|
49
|
+
fileName?: string;
|
|
50
|
+
fileCaption?: string;
|
|
51
|
+
fileDesc?: string;
|
|
52
|
+
fileId?: number;
|
|
53
|
+
thumbnail?: string;
|
|
54
|
+
}
|
|
55
|
+
export interface FilesCreateOptions {
|
|
56
|
+
[key: string]: unknown;
|
|
57
|
+
}
|
|
58
|
+
export interface FilesBlockModel extends BlockModel {
|
|
59
|
+
/**
|
|
60
|
+
* Get render callback function for a specific MIME type
|
|
61
|
+
* @param mimeType - MIME type string
|
|
62
|
+
* @returns Render callback function
|
|
63
|
+
*/
|
|
64
|
+
getRenderCallback(mimeType: string): CallableFunction;
|
|
65
|
+
/**
|
|
66
|
+
* Set render callback function for one or more MIME types
|
|
67
|
+
* @param mimeType - Single MIME type or array of MIME types
|
|
68
|
+
* @param callback - Render callback function
|
|
69
|
+
*/
|
|
70
|
+
setRenderCallback(mimeType: string | string[], callable: CallableFunction): void;
|
|
71
|
+
/**
|
|
72
|
+
* Get the form container element
|
|
73
|
+
* @returns Form element or null
|
|
74
|
+
*/
|
|
75
|
+
getFormNode(): HTMLElement | null;
|
|
76
|
+
/**
|
|
77
|
+
* Check if item counter is visible
|
|
78
|
+
* @returns Visibility state
|
|
79
|
+
*/
|
|
80
|
+
isVisibleCounter(): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Get configured MIME types for file upload
|
|
83
|
+
* @returns Array of allowed MIME types
|
|
84
|
+
*/
|
|
85
|
+
getMimeTypes(): string[];
|
|
86
|
+
/**
|
|
87
|
+
* Check if multiple file upload is enabled
|
|
88
|
+
* @returns Multiple files flag
|
|
89
|
+
*/
|
|
90
|
+
isMultiple(): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Get AJAX configuration for file upload
|
|
93
|
+
* @returns AJAX configuration object
|
|
94
|
+
*/
|
|
95
|
+
getAjaxConfig(): AjaxConfig;
|
|
96
|
+
/**
|
|
97
|
+
* Get input name attribute for file upload
|
|
98
|
+
* @returns Input name string
|
|
99
|
+
*/
|
|
100
|
+
getInputName(): string;
|
|
101
|
+
/**
|
|
102
|
+
* Checks if the file name is required
|
|
103
|
+
* @returns True if required, `false` otherwise
|
|
104
|
+
*/
|
|
105
|
+
isRequiredFieldFileName(): boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Checks if the caption is required
|
|
108
|
+
* @returns True if required, `false` otherwise
|
|
109
|
+
*/
|
|
110
|
+
isRequiredFieldCaption(): boolean;
|
|
111
|
+
/**
|
|
112
|
+
*Checks if the description is required
|
|
113
|
+
* @returns True if required, `false` otherwise
|
|
114
|
+
*/
|
|
115
|
+
isRequiredFieldDesc(): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Checks if the file name is visible
|
|
118
|
+
* @returns True if visible, `false` otherwise
|
|
119
|
+
*/
|
|
120
|
+
isVisibleFieldFileName(): boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Checks if the caption is visible
|
|
123
|
+
* @returns True if visible, `false` otherwise
|
|
124
|
+
*/
|
|
125
|
+
isVisibleFieldCaption(): boolean;
|
|
126
|
+
/**
|
|
127
|
+
*Checks if the description is visible
|
|
128
|
+
* @returns True if visible, `false` otherwise
|
|
129
|
+
*/
|
|
130
|
+
isVisibleFieldDesc(): boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Checks if the image should be rendered.
|
|
133
|
+
* @returns True if ready, false otherwise.
|
|
134
|
+
*/
|
|
135
|
+
isRenderImage(): boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Get the upload progress bar element
|
|
138
|
+
* @returns Progress element or null
|
|
139
|
+
*/
|
|
140
|
+
getProgressNode(): HTMLElement | null;
|
|
141
|
+
/**
|
|
142
|
+
* Update progress bar percentage
|
|
143
|
+
* @param percent - Progress percentage value
|
|
144
|
+
*/
|
|
145
|
+
progress(percent: number): void;
|
|
146
|
+
/**
|
|
147
|
+
* Remove progress bar from DOM
|
|
148
|
+
*/
|
|
149
|
+
removeProgress(): void;
|
|
150
|
+
/**
|
|
151
|
+
* Refresh block UI state based on current items
|
|
152
|
+
*/
|
|
153
|
+
refresh(): void;
|
|
154
|
+
/**
|
|
155
|
+
* Refresh counter with current item count
|
|
156
|
+
* @param count - Optional count override
|
|
157
|
+
*/
|
|
158
|
+
refreshCount(count?: number): void;
|
|
159
|
+
/**
|
|
160
|
+
* Get the counter DOM element
|
|
161
|
+
* @returns Counter element or null
|
|
162
|
+
*/
|
|
163
|
+
getCounterNode(): HTMLElement | null;
|
|
164
|
+
/**
|
|
165
|
+
* Get action models with a file.
|
|
166
|
+
* @returns List of file action models
|
|
167
|
+
*/
|
|
168
|
+
getFileActions(): FileActionModel[];
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../../../src/types/entities/blocks/files.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAEnG,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAExD,MAAM,WAAW,qBAAsB,SAAQ,gBAAgB;IAC7D,iBAAiB,EAAE,OAAO,CAAC;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAA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;IACH,eAAe,IAAI,WAAW,GAAG,IAAI,CAAC;IAEtC;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAEhC;;OAEG;IACH,cAAc,IAAI,IAAI,CAAC;IAEvB;;OAEG;IACH,OAAO,IAAI,IAAI,CAAC;IAEhB;;;OAGG;IACH,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEnC;;;OAGG;IACH,cAAc,IAAI,WAAW,GAAG,IAAI,CAAC;IAErC;;;OAGG;IACH,cAAc,IAAI,eAAe,EAAE,CAAC;CACrC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { FilesBlockModelConfig, FilesBlockModel } from './files';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration interface for the Gallery block model.
|
|
4
|
+
* @property styles - Available display styles for the gallery
|
|
5
|
+
* @property stylesLtr - Position of the style selector panel ('left' or 'right')
|
|
6
|
+
* @property defaultStyle - Default display style when no style is selected
|
|
7
|
+
* @property sliderInfinite - Whether the slider should loop infinitely
|
|
8
|
+
* @property imageMimeTypes - MIME types that should be rendered as images
|
|
9
|
+
* @property videoMimeTypes - MIME types that should be rendered as videos
|
|
10
|
+
*/
|
|
11
|
+
export interface GalleryBlockModelConfig extends FilesBlockModelConfig {
|
|
12
|
+
styles: string[];
|
|
13
|
+
stylesLtr: 'left' | 'right';
|
|
14
|
+
defaultStyle: string;
|
|
15
|
+
sliderInfinite: boolean;
|
|
16
|
+
imageMimeTypes: string[];
|
|
17
|
+
videoMimeTypes: string[];
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Interface for the Gallery block model.
|
|
21
|
+
* Provides methods for managing gallery-specific display styles and behavior.
|
|
22
|
+
*/
|
|
23
|
+
export interface GalleryBlockModel extends FilesBlockModel {
|
|
24
|
+
/**
|
|
25
|
+
* Returns the list of available display styles for the gallery
|
|
26
|
+
* @returns Array of style identifiers
|
|
27
|
+
*/
|
|
28
|
+
getStyles(): string[];
|
|
29
|
+
/**
|
|
30
|
+
* Returns the default display style for the gallery
|
|
31
|
+
* @returns Default style identifier
|
|
32
|
+
*/
|
|
33
|
+
getDefaultStyle(): string;
|
|
34
|
+
/**
|
|
35
|
+
* Checks if all configured styles are valid and allowed
|
|
36
|
+
* @returns True if all styles are valid, false otherwise
|
|
37
|
+
*/
|
|
38
|
+
areStylesAllowed(): boolean;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=gallery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gallery.d.ts","sourceRoot":"","sources":["../../../../src/types/entities/blocks/gallery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAEjE;;;;;;;;GAQG;AACH,MAAM,WAAW,uBAAwB,SAAQ,qBAAqB;IACpE,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,eAAe;IACxD;;;OAGG;IACH,SAAS,IAAI,MAAM,EAAE,CAAC;IAEtB;;;OAGG;IACH,eAAe,IAAI,MAAM,CAAC;IAE1B;;;OAGG;IACH,gBAAgB,IAAI,OAAO,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../src/types/entities/blocks/header.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/entities/blocks/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../src/types/entities/blocks/list.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paragraph.d.ts","sourceRoot":"","sources":["../../../../src/types/entities/blocks/paragraph.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/entities/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC"}
|