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,141 @@
|
|
|
1
|
+
import { A as e, O as t, S as n, T as r, Te as i, b as a, ie as o, se as s, w as c, y as l } from "../../../../node_modules/snappykit/dist/snappykit.mjs";
|
|
2
|
+
import { IconImage as u, IconMultipleGrid as d, IconPlay as f, IconSingleGrid as p, IconSlider as m } from "../../../icons/index.mjs";
|
|
3
|
+
import { renderIcon as h } from "../../../utils/icon.mjs";
|
|
4
|
+
import g from "../files/index.mjs";
|
|
5
|
+
import _ from "../../../core/ui/slider.mjs";
|
|
6
|
+
/* empty css */
|
|
7
|
+
//#region src/entities/blocks/gallery/index.ts
|
|
8
|
+
var v = class extends g {
|
|
9
|
+
constructor(...e) {
|
|
10
|
+
super(...e), this.defaultStyles = [
|
|
11
|
+
"grid",
|
|
12
|
+
"slider",
|
|
13
|
+
"single"
|
|
14
|
+
], this.slider = null;
|
|
15
|
+
}
|
|
16
|
+
static setup(e) {
|
|
17
|
+
return super.setup(e);
|
|
18
|
+
}
|
|
19
|
+
configure() {
|
|
20
|
+
return {
|
|
21
|
+
...super.configure(),
|
|
22
|
+
name: "gallery",
|
|
23
|
+
icon: u,
|
|
24
|
+
className: "tex-gallery tex-files",
|
|
25
|
+
translation: "gallery",
|
|
26
|
+
styles: [
|
|
27
|
+
"grid",
|
|
28
|
+
"slider",
|
|
29
|
+
"single"
|
|
30
|
+
],
|
|
31
|
+
stylesLtr: "right",
|
|
32
|
+
defaultStyle: "single",
|
|
33
|
+
groupCode: "gallery",
|
|
34
|
+
sliderInfinite: !0,
|
|
35
|
+
imageMimeTypes: [
|
|
36
|
+
"image/jpeg",
|
|
37
|
+
"image/png",
|
|
38
|
+
"image/gif",
|
|
39
|
+
"image/webp",
|
|
40
|
+
"image/avif",
|
|
41
|
+
"image/bmp"
|
|
42
|
+
],
|
|
43
|
+
videoMimeTypes: [
|
|
44
|
+
"video/mp4",
|
|
45
|
+
"video/webm",
|
|
46
|
+
"video/ogg",
|
|
47
|
+
"video/mpeg",
|
|
48
|
+
"video/quicktime",
|
|
49
|
+
"video/x-msvideo"
|
|
50
|
+
],
|
|
51
|
+
visibleFieldFileName: !1,
|
|
52
|
+
requiredFieldFileName: !1
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
onMount(e) {
|
|
56
|
+
super.onMount(e), this.initSlider(), this.on("onChange.gallery", (e) => {
|
|
57
|
+
let t = e?.targetIndex || 0;
|
|
58
|
+
this.initSlider(t);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
getDefaultStyle() {
|
|
62
|
+
let e = this.getConfig("defaultStyle", []);
|
|
63
|
+
return this.defaultStyles.includes(e) ? e : "single";
|
|
64
|
+
}
|
|
65
|
+
getStyles() {
|
|
66
|
+
return this.getConfig("styles", []);
|
|
67
|
+
}
|
|
68
|
+
areStylesAllowed() {
|
|
69
|
+
return this.getStyles().every((e) => this.defaultStyles.includes(e));
|
|
70
|
+
}
|
|
71
|
+
onFormCreate(u) {
|
|
72
|
+
let { blockManager: f, events: g, i18n: _ } = this.editor, v = this.getConfig("stylesLtr", "left"), y = this.getConfig("styles", []), b = this.getElement();
|
|
73
|
+
if (this.areStylesAllowed()) {
|
|
74
|
+
let x = (e) => {
|
|
75
|
+
y.includes(e) && (n(".tex-gallery-style-item", (e) => {
|
|
76
|
+
a(e, "tex-active");
|
|
77
|
+
}, u), n(".tex-gallery-style-item-" + e, (e) => {
|
|
78
|
+
l(e, "tex-active");
|
|
79
|
+
}, u));
|
|
80
|
+
}, S = (n, r) => o("div", (a) => {
|
|
81
|
+
l(a, "tex-gallery-style-item tex-gallery-style-item-" + n), i(a, "click.style", () => {
|
|
82
|
+
x(n), e(b, "optionsStyle", n), this.destroySlider(), g.change({
|
|
83
|
+
modelCode: this.getModelCode(),
|
|
84
|
+
type: "galleryStyle",
|
|
85
|
+
index: f.getIndex(),
|
|
86
|
+
blockElement: b,
|
|
87
|
+
contentElement: this.getContentElement()
|
|
88
|
+
}), n === "slider" && this.initSlider();
|
|
89
|
+
}), s(a, h(r, {
|
|
90
|
+
width: 16,
|
|
91
|
+
height: 16
|
|
92
|
+
})), t(a, "title", _.get("appearance", "Appearance") + ": " + _.get(n));
|
|
93
|
+
}), C = o("div", (e) => {
|
|
94
|
+
l(e, "tex-gallery-styles"), c(e, o("div", (e) => {
|
|
95
|
+
l(e, "tex-gallery-style-list");
|
|
96
|
+
let t = [];
|
|
97
|
+
y.includes("single") && t.push(S("single", p)), y.includes("grid") && t.push(S("grid", d)), y.includes("slider") && t.push(S("slider", m)), c(e, t);
|
|
98
|
+
}));
|
|
99
|
+
});
|
|
100
|
+
v == "left" ? r(u, C) : c(u, C);
|
|
101
|
+
let w = this.getOption("style", "single") || "single";
|
|
102
|
+
w = this.defaultStyles.includes(w) ? w : "single", x(w);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
onCreateList(n) {
|
|
106
|
+
let r = this.getStyles(), i = this.getElement(), a = this.getOption("style", "");
|
|
107
|
+
this.areStylesAllowed() && a && r.includes(a) && e(i, "optionsStyle", a), this.setRenderCallback(this.getConfig("imageMimeTypes", []), (e) => o("img", (t) => {
|
|
108
|
+
t.src = e.url;
|
|
109
|
+
})), this.setRenderCallback(this.getConfig("videoMimeTypes", []), (e) => o("div", (n) => {
|
|
110
|
+
c(n, [o("video", (n) => {
|
|
111
|
+
c(n, o("source", (n) => {
|
|
112
|
+
n.src = e.url, t(n, "type", e.type);
|
|
113
|
+
}));
|
|
114
|
+
}), o("div", (e) => {
|
|
115
|
+
l(e, "tex-gallery-item-play"), e.innerHTML = h(f, {
|
|
116
|
+
width: 18,
|
|
117
|
+
height: 18
|
|
118
|
+
});
|
|
119
|
+
})]);
|
|
120
|
+
}));
|
|
121
|
+
}
|
|
122
|
+
save(e, t) {
|
|
123
|
+
e = super.save(e, t);
|
|
124
|
+
let n = e?.data, r = [];
|
|
125
|
+
return n.length && Array.isArray(n) && (n.forEach((e) => {
|
|
126
|
+
e.size && delete e.size, e.id && delete e.id, r.push(e);
|
|
127
|
+
}), e.data = r), e;
|
|
128
|
+
}
|
|
129
|
+
initSlider(t = 0) {
|
|
130
|
+
let n = this.getElement(), r = this.getContentElement();
|
|
131
|
+
this.destroySlider(), n && r && e(n, "optionsStyle") === "slider" && (this.slider = new _(r, { infinite: this.getConfig("sliderInfinite", !0) }), t && this.slider.goToSlide(t));
|
|
132
|
+
}
|
|
133
|
+
destroySlider() {
|
|
134
|
+
this.slider &&= (this.slider.destroy(), null);
|
|
135
|
+
}
|
|
136
|
+
destroy() {
|
|
137
|
+
this.destroySlider(), super.destroy();
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
//#endregion
|
|
141
|
+
export { v as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IconHeader2 as e } from "../../../icons/index.mjs";
|
|
2
|
+
import t from "./index.mjs";
|
|
3
|
+
//#region src/entities/blocks/header/H2.ts
|
|
4
|
+
var n = class extends t {
|
|
5
|
+
configure() {
|
|
6
|
+
return {
|
|
7
|
+
...super.configure(),
|
|
8
|
+
name: "h2",
|
|
9
|
+
tagName: "h2",
|
|
10
|
+
icon: e,
|
|
11
|
+
translation: "header2"
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { n as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IconHeader3 as e } from "../../../icons/index.mjs";
|
|
2
|
+
import t from "./index.mjs";
|
|
3
|
+
//#region src/entities/blocks/header/H3.ts
|
|
4
|
+
var n = class extends t {
|
|
5
|
+
configure() {
|
|
6
|
+
return {
|
|
7
|
+
...super.configure(),
|
|
8
|
+
name: "h3",
|
|
9
|
+
tagName: "h3",
|
|
10
|
+
icon: e,
|
|
11
|
+
translation: "header3"
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { n as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IconHeader4 as e } from "../../../icons/index.mjs";
|
|
2
|
+
import t from "./index.mjs";
|
|
3
|
+
//#region src/entities/blocks/header/H4.ts
|
|
4
|
+
var n = class extends t {
|
|
5
|
+
configure() {
|
|
6
|
+
return {
|
|
7
|
+
...super.configure(),
|
|
8
|
+
name: "h4",
|
|
9
|
+
tagName: "h4",
|
|
10
|
+
icon: e,
|
|
11
|
+
translation: "header4"
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { n as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IconHeader5 as e } from "../../../icons/index.mjs";
|
|
2
|
+
import t from "./index.mjs";
|
|
3
|
+
//#region src/entities/blocks/header/H5.ts
|
|
4
|
+
var n = class extends t {
|
|
5
|
+
configure() {
|
|
6
|
+
return {
|
|
7
|
+
...super.configure(),
|
|
8
|
+
name: "h5",
|
|
9
|
+
tagName: "h5",
|
|
10
|
+
icon: e,
|
|
11
|
+
translation: "header5"
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { n as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IconHeader6 as e } from "../../../icons/index.mjs";
|
|
2
|
+
import t from "./index.mjs";
|
|
3
|
+
//#region src/entities/blocks/header/H6.ts
|
|
4
|
+
var n = class extends t {
|
|
5
|
+
configure() {
|
|
6
|
+
return {
|
|
7
|
+
...super.configure(),
|
|
8
|
+
name: "h6",
|
|
9
|
+
tagName: "h6",
|
|
10
|
+
icon: e,
|
|
11
|
+
translation: "header6"
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { n as default };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { IconHeader1 as e } from "../../../icons/index.mjs";
|
|
2
|
+
import t from "../../../core/models/block-model.mjs";
|
|
3
|
+
//#region src/entities/blocks/header/index.ts
|
|
4
|
+
var n = class extends t {
|
|
5
|
+
configure() {
|
|
6
|
+
return {
|
|
7
|
+
name: "h1",
|
|
8
|
+
translation: "header1",
|
|
9
|
+
groupCode: "header",
|
|
10
|
+
tagName: "h1",
|
|
11
|
+
className: "tex-header",
|
|
12
|
+
autoParse: !0,
|
|
13
|
+
icon: e,
|
|
14
|
+
placeholder: this.editor.i18n.get("headerPlaceholder", "Enter your title"),
|
|
15
|
+
editable: !0,
|
|
16
|
+
visibleTools: !0,
|
|
17
|
+
availableTools: [
|
|
18
|
+
"link",
|
|
19
|
+
"subscript",
|
|
20
|
+
"superscript",
|
|
21
|
+
"clearFormatting"
|
|
22
|
+
],
|
|
23
|
+
enterCreate: !0,
|
|
24
|
+
emptyDetect: !0,
|
|
25
|
+
normalize: !0,
|
|
26
|
+
sanitizer: !0,
|
|
27
|
+
convertible: !0,
|
|
28
|
+
sanitizerConfig: {
|
|
29
|
+
elements: [
|
|
30
|
+
"a",
|
|
31
|
+
"sup",
|
|
32
|
+
"sub"
|
|
33
|
+
],
|
|
34
|
+
attributes: { a: ["href"] },
|
|
35
|
+
protocols: { a: { href: [
|
|
36
|
+
"https",
|
|
37
|
+
"ftp",
|
|
38
|
+
"http",
|
|
39
|
+
"mailto"
|
|
40
|
+
] } }
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
46
|
+
export { n as default };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { IconList as e } from "../../../icons/index.mjs";
|
|
2
|
+
import t from "../../../core/models/block-model.mjs";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/entities/blocks/list/index.ts
|
|
5
|
+
var n = class extends t {
|
|
6
|
+
configure() {
|
|
7
|
+
return {
|
|
8
|
+
name: "ul",
|
|
9
|
+
translation: "list",
|
|
10
|
+
groupCode: "list",
|
|
11
|
+
tagName: "ul",
|
|
12
|
+
itemTagName: "li",
|
|
13
|
+
itemName: "li",
|
|
14
|
+
itemClassName: "tex-list-item",
|
|
15
|
+
itemBodyClassName: "tex-list-item-body",
|
|
16
|
+
autoParse: !0,
|
|
17
|
+
autoMerge: !0,
|
|
18
|
+
icon: e,
|
|
19
|
+
editable: !1,
|
|
20
|
+
editableItems: !0,
|
|
21
|
+
visibleTools: !0,
|
|
22
|
+
sanitizer: !0,
|
|
23
|
+
normalize: !0,
|
|
24
|
+
convertible: !0,
|
|
25
|
+
className: "tex-list",
|
|
26
|
+
sortableItems: !0,
|
|
27
|
+
sanitizerConfig: {
|
|
28
|
+
elements: [
|
|
29
|
+
"b",
|
|
30
|
+
"a",
|
|
31
|
+
"i",
|
|
32
|
+
"s",
|
|
33
|
+
"u",
|
|
34
|
+
"sup",
|
|
35
|
+
"sub",
|
|
36
|
+
"mark",
|
|
37
|
+
"code"
|
|
38
|
+
],
|
|
39
|
+
attributes: { a: ["href", "target"] },
|
|
40
|
+
protocols: { a: { href: [
|
|
41
|
+
"https",
|
|
42
|
+
"ftp",
|
|
43
|
+
"http",
|
|
44
|
+
"mailto"
|
|
45
|
+
] } }
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
//#endregion
|
|
51
|
+
export { n as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IconOrderedList as e } from "../../../icons/index.mjs";
|
|
2
|
+
import t from "./index.mjs";
|
|
3
|
+
//#region src/entities/blocks/list/ol.ts
|
|
4
|
+
var n = class extends t {
|
|
5
|
+
configure() {
|
|
6
|
+
return {
|
|
7
|
+
...super.configure(),
|
|
8
|
+
name: "ol",
|
|
9
|
+
tagName: "ol",
|
|
10
|
+
icon: e,
|
|
11
|
+
translation: "orderedList"
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { n as default };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { IconParagraph as e } from "../../../icons/index.mjs";
|
|
2
|
+
import t from "../../../core/models/block-model.mjs";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/entities/blocks/paragraph/index.ts
|
|
5
|
+
var n = class extends t {
|
|
6
|
+
configure() {
|
|
7
|
+
return {
|
|
8
|
+
name: "p",
|
|
9
|
+
icon: e,
|
|
10
|
+
autoParse: !0,
|
|
11
|
+
translation: "paragraph",
|
|
12
|
+
groupCode: "paragraph",
|
|
13
|
+
tagName: "p",
|
|
14
|
+
placeholder: this.editor.i18n.get("paragraphPlaceholder", "Enter your text"),
|
|
15
|
+
editable: !0,
|
|
16
|
+
visibleTools: !0,
|
|
17
|
+
sanitizer: !0,
|
|
18
|
+
normalize: !0,
|
|
19
|
+
className: "tex-paragraph",
|
|
20
|
+
emptyDetect: !0,
|
|
21
|
+
convertible: !0,
|
|
22
|
+
sanitizerConfig: {
|
|
23
|
+
elements: [
|
|
24
|
+
"b",
|
|
25
|
+
"a",
|
|
26
|
+
"i",
|
|
27
|
+
"s",
|
|
28
|
+
"u",
|
|
29
|
+
"sup",
|
|
30
|
+
"sub",
|
|
31
|
+
"mark",
|
|
32
|
+
"code"
|
|
33
|
+
],
|
|
34
|
+
attributes: { a: ["href", "target"] },
|
|
35
|
+
protocols: { a: { href: [
|
|
36
|
+
"https",
|
|
37
|
+
"ftp",
|
|
38
|
+
"http",
|
|
39
|
+
"mailto"
|
|
40
|
+
] } }
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
46
|
+
export { n as default };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IconTrash as e } from "../../icons/index.mjs";
|
|
2
|
+
import t from "../../core/models/extension-model.mjs";
|
|
3
|
+
//#region src/entities/extensions/delete-selected.ts
|
|
4
|
+
var n = class extends t {
|
|
5
|
+
configure() {
|
|
6
|
+
return {
|
|
7
|
+
name: "deleteSelected",
|
|
8
|
+
translation: "delete",
|
|
9
|
+
icon: e,
|
|
10
|
+
toggleActive: !1,
|
|
11
|
+
groupName: "block"
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
getSelectedIndices() {
|
|
15
|
+
let { blockManager: e } = this.editor, t = e.getVirtualSelection();
|
|
16
|
+
return t ? t.getSelectedIndices() : [];
|
|
17
|
+
}
|
|
18
|
+
onClick(e) {
|
|
19
|
+
let { blockManager: t } = this.editor, n = this.getSelectedIndices();
|
|
20
|
+
n.length && t.removeBlock(n);
|
|
21
|
+
}
|
|
22
|
+
isVisible() {
|
|
23
|
+
return this.getSelectedIndices().length > 0;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
export { n as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IconRedo as e } from "../../icons/index.mjs";
|
|
2
|
+
import t from "../../core/models/extension-model.mjs";
|
|
3
|
+
//#region src/entities/extensions/redo.ts
|
|
4
|
+
var n = class extends t {
|
|
5
|
+
configure() {
|
|
6
|
+
return {
|
|
7
|
+
name: "redo",
|
|
8
|
+
translation: "redo",
|
|
9
|
+
icon: e,
|
|
10
|
+
toggleActive: !1,
|
|
11
|
+
groupName: "history"
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
onClick(e) {
|
|
15
|
+
this.editor.historyManager.redo();
|
|
16
|
+
}
|
|
17
|
+
isActive() {
|
|
18
|
+
return this.editor.historyManager.canRedo();
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { n as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IconUndo as e } from "../../icons/index.mjs";
|
|
2
|
+
import t from "../../core/models/extension-model.mjs";
|
|
3
|
+
//#region src/entities/extensions/undo.ts
|
|
4
|
+
var n = class extends t {
|
|
5
|
+
configure() {
|
|
6
|
+
return {
|
|
7
|
+
name: "undo",
|
|
8
|
+
translation: "undo",
|
|
9
|
+
icon: e,
|
|
10
|
+
toggleActive: !1,
|
|
11
|
+
groupName: "history"
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
onClick(e) {
|
|
15
|
+
this.editor.historyManager.undo();
|
|
16
|
+
}
|
|
17
|
+
isActive() {
|
|
18
|
+
return this.editor.historyManager.canUndo();
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { n as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IconBold as e } from "../../icons/index.mjs";
|
|
2
|
+
import t from "../../core/models/tool-model.mjs";
|
|
3
|
+
//#region src/entities/tools/bold.ts
|
|
4
|
+
var n = class extends t {
|
|
5
|
+
configure() {
|
|
6
|
+
return {
|
|
7
|
+
name: "bold",
|
|
8
|
+
tagName: "b",
|
|
9
|
+
icon: e,
|
|
10
|
+
iconWidth: 16,
|
|
11
|
+
iconHeight: 16
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { n as default };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IconClearFormatting as e } from "../../icons/index.mjs";
|
|
2
|
+
import t from "../../core/models/tool-model.mjs";
|
|
3
|
+
//#region src/entities/tools/clear-formatting.ts
|
|
4
|
+
var n = class extends t {
|
|
5
|
+
configure() {
|
|
6
|
+
return {
|
|
7
|
+
name: "clearFormatting",
|
|
8
|
+
icon: e,
|
|
9
|
+
translation: "clearFormatting",
|
|
10
|
+
iconWidth: 16,
|
|
11
|
+
iconHeight: 16
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
onClick() {
|
|
15
|
+
let { selectionApi: e, commands: t } = this.editor;
|
|
16
|
+
e.applyState(), t.clearAllFormatting();
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { n as default };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IconCode as e } from "../../icons/index.mjs";
|
|
2
|
+
import t from "../../core/models/tool-model.mjs";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/entities/tools/inline-code.ts
|
|
5
|
+
var n = class extends t {
|
|
6
|
+
configure() {
|
|
7
|
+
return {
|
|
8
|
+
name: "inlineCode",
|
|
9
|
+
translation: "code",
|
|
10
|
+
tagName: "code",
|
|
11
|
+
override: !1,
|
|
12
|
+
icon: e,
|
|
13
|
+
iconWidth: 16,
|
|
14
|
+
iconHeight: 16
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { n as default };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IconItalic as e } from "../../icons/index.mjs";
|
|
2
|
+
import t from "../../core/models/tool-model.mjs";
|
|
3
|
+
//#region src/entities/tools/italic.ts
|
|
4
|
+
var n = class extends t {
|
|
5
|
+
configure() {
|
|
6
|
+
return {
|
|
7
|
+
name: "italic",
|
|
8
|
+
tagName: "i",
|
|
9
|
+
icon: e,
|
|
10
|
+
iconWidth: 16,
|
|
11
|
+
iconHeight: 16
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
//#endregion
|
|
16
|
+
export { n as default };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { A as e, O as t, Q as n, S as r, Te as i, Z as a, g as o, ie as s, le as c, me as l, re as u, se as d, w as f, y as p } from "../../../node_modules/snappykit/dist/snappykit.mjs";
|
|
2
|
+
import { IconArrowRight as m, IconClearFormatting as h, IconLink as g, IconNewTab as _, IconTrash as v } from "../../icons/index.mjs";
|
|
3
|
+
import { renderIcon as y } from "../../utils/icon.mjs";
|
|
4
|
+
import b from "../../core/models/tool-model.mjs";
|
|
5
|
+
/* empty css */
|
|
6
|
+
//#region src/entities/tools/link.ts
|
|
7
|
+
var x = class extends b {
|
|
8
|
+
configure() {
|
|
9
|
+
return {
|
|
10
|
+
name: "link",
|
|
11
|
+
tagName: "a",
|
|
12
|
+
icon: g,
|
|
13
|
+
iconWidth: 16,
|
|
14
|
+
iconHeight: 16
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
onClick() {
|
|
18
|
+
let { selectionApi: e, commands: n } = this.editor;
|
|
19
|
+
e.applyState();
|
|
20
|
+
let [r] = n.findTags(this.getTagName());
|
|
21
|
+
if (r) {
|
|
22
|
+
let e = t(r, "target") === "_blank";
|
|
23
|
+
this.createForm(t(r, "href") || "", e);
|
|
24
|
+
} else this.createForm();
|
|
25
|
+
}
|
|
26
|
+
onFormat(n) {
|
|
27
|
+
let r = this.getEventId(), i = document.getElementById("form-link-" + r), a = document.getElementById("input-link-" + r);
|
|
28
|
+
i && a && n.forEach((n) => {
|
|
29
|
+
a?.value && t(n, "href", a?.value), e(i, "targetBlank") == "Y" && t(n, "target", "_blank");
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
removeForm() {
|
|
33
|
+
let e = this.editor.getRoot();
|
|
34
|
+
e && (r(".tex-tools-content", (e) => o(e, "display", "none"), e), r(".tex-tools-list", (e) => o(e, "display", ""), e), r(".tex-link-form", (e) => e.remove(), e));
|
|
35
|
+
}
|
|
36
|
+
createForm(g = "", b = !1) {
|
|
37
|
+
let { commands: x, selectionApi: S, i18n: C } = this.editor, w = this.getEventId(), T = this.editor.getRoot(), E = s("div", (n) => {
|
|
38
|
+
n.id = "form-link-" + w, e(n, "targetBlank", "N"), p(n, "tex-link-form"), f(n, s("div", (t) => {
|
|
39
|
+
p(t, "tex-link-form-btn tex-link-form-target-btn"), b && (p(t, "tex-active"), e(n, "targetBlank", "Y")), a(t, "click.link", () => {
|
|
40
|
+
e(n, "targetBlank", e(n, "targetBlank") == "Y" ? "N" : "Y"), u(t, "tex-active");
|
|
41
|
+
}), d(t, y(_, {
|
|
42
|
+
width: 14,
|
|
43
|
+
height: 14
|
|
44
|
+
})), t.title = C.get("openInNewTab", "Open in a new tab");
|
|
45
|
+
})), f(n, s("input", (e) => {
|
|
46
|
+
t(e, "type", "text"), e.id = "input-link-" + w, e.value = g, e.placeholder = C.get("enterLink", "Enter the link"), p(e, "tex-link-input"), i(e, "keydown.link", (e) => {
|
|
47
|
+
e.key == "Enter" && (e.preventDefault(), this.format(), document.body?.click());
|
|
48
|
+
}), setTimeout(() => e.focus(), 10);
|
|
49
|
+
})), f(n, s("div", (e) => {
|
|
50
|
+
p(e, "tex-link-form-btn tex-link-form-del-btn"), d(e, y(v, {
|
|
51
|
+
width: 18,
|
|
52
|
+
height: 18
|
|
53
|
+
})), e.title = C.get("delete", "Delete"), a(e, "click.link", () => {
|
|
54
|
+
S.applyState();
|
|
55
|
+
let [e] = x.findTags(this.getTagName());
|
|
56
|
+
e && l(e), document.body.click();
|
|
57
|
+
});
|
|
58
|
+
})), f(n, s("div", (e) => {
|
|
59
|
+
p(e, "tex-link-form-btn tex-link-form-clean-btn"), d(e, y(h, {
|
|
60
|
+
width: 14,
|
|
61
|
+
height: 14
|
|
62
|
+
})), e.title = C.get("delete", "Delete"), i(e, "click.link", () => {
|
|
63
|
+
this.removeFormat(), document.body?.click();
|
|
64
|
+
});
|
|
65
|
+
})), f(n, s("div", (e) => {
|
|
66
|
+
d(e, y(m, {
|
|
67
|
+
width: 18,
|
|
68
|
+
height: 18
|
|
69
|
+
})), p(e, "tex-link-form-btn"), e.title = C.get("done", "Done"), i(e, "click.link", () => {
|
|
70
|
+
this.removeFormat(), this.forcedFormat(), document.body?.click();
|
|
71
|
+
});
|
|
72
|
+
}));
|
|
73
|
+
});
|
|
74
|
+
T && (r(".tex-tools-content", (e) => o(e, "display", "block"), T), r(".tex-tools-list", (e) => o(e, "display", "none"), T), r(".tex-tools-content", (e) => {
|
|
75
|
+
f(e, E);
|
|
76
|
+
}, T)), setTimeout(() => {
|
|
77
|
+
T && a(document, "click.link" + w, (e) => {
|
|
78
|
+
r(".tex-link-form", (t) => {
|
|
79
|
+
c(e.target, t) || (this.removeForm(), n(document, "click.link" + w));
|
|
80
|
+
}, T);
|
|
81
|
+
});
|
|
82
|
+
}, 100);
|
|
83
|
+
}
|
|
84
|
+
destroy() {
|
|
85
|
+
n(document, "click.link" + this.getEventId());
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
//#endregion
|
|
89
|
+
export { x as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IconMarker as e } from "../../icons/index.mjs";
|
|
2
|
+
import t from "../../core/models/tool-model.mjs";
|
|
3
|
+
//#region src/entities/tools/marker.ts
|
|
4
|
+
var n = class extends t {
|
|
5
|
+
configure() {
|
|
6
|
+
return {
|
|
7
|
+
name: "marker",
|
|
8
|
+
tagName: "mark",
|
|
9
|
+
icon: e,
|
|
10
|
+
override: !1,
|
|
11
|
+
iconWidth: 16,
|
|
12
|
+
iconHeight: 16
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { n as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IconSubscript as e } from "../../icons/index.mjs";
|
|
2
|
+
import t from "../../core/models/tool-model.mjs";
|
|
3
|
+
//#region src/entities/tools/subscript.ts
|
|
4
|
+
var n = class extends t {
|
|
5
|
+
configure() {
|
|
6
|
+
return {
|
|
7
|
+
name: "subscript",
|
|
8
|
+
tagName: "sub",
|
|
9
|
+
icon: e,
|
|
10
|
+
override: !1,
|
|
11
|
+
iconWidth: 16,
|
|
12
|
+
iconHeight: 16
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { n as default };
|