@uxf/wysiwyg 11.74.0 → 11.74.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components.d.ts +7 -0
- package/components.js +34 -0
- package/config/icons-config.d.ts +2 -0
- package/config/icons-config.js +5 -0
- package/config/icons.d.ts +183 -0
- package/config/icons.js +51 -0
- package/create-all-plugins-with-ui.d.ts +64 -0
- package/create-all-plugins-with-ui.js +127 -0
- package/create-plugins-with-ui.d.ts +4 -0
- package/create-plugins-with-ui.js +47 -0
- package/hooks.d.ts +9 -0
- package/hooks.js +20 -0
- package/index.d.ts +6 -0
- package/index.js +38 -0
- package/package.json +3 -3
- package/plugins/blockquote/create-blockquote-plugin.d.ts +3 -0
- package/plugins/blockquote/create-blockquote-plugin.js +9 -0
- package/plugins/blockquote/types.d.ts +2 -0
- package/plugins/blockquote/types.js +6 -0
- package/plugins/button/constants.d.ts +2 -0
- package/plugins/button/constants.js +5 -0
- package/plugins/button/create-button-plugin.d.ts +2 -0
- package/plugins/button/create-button-plugin.js +11 -0
- package/plugins/button/index.d.ts +3 -0
- package/plugins/button/index.js +23 -0
- package/plugins/button/transforms/get-active-button.d.ts +2 -0
- package/plugins/button/transforms/get-active-button.js +9 -0
- package/plugins/button/transforms/index.d.ts +4 -0
- package/plugins/button/transforms/index.js +11 -0
- package/plugins/button/transforms/insert-button.d.ts +2 -0
- package/plugins/button/transforms/insert-button.js +16 -0
- package/plugins/button/transforms/is-button-active.d.ts +2 -0
- package/plugins/button/transforms/is-button-active.js +7 -0
- package/plugins/button/transforms/remove-selected-button.d.ts +2 -0
- package/plugins/button/transforms/remove-selected-button.js +13 -0
- package/plugins/button/transforms/update-button.d.ts +2 -0
- package/plugins/button/transforms/update-button.js +9 -0
- package/plugins/embedded/utils.d.ts +1 -0
- package/plugins/embedded/utils.js +7 -0
- package/plugins/embedded/video/create-video-plugin.d.ts +4 -0
- package/plugins/embedded/video/create-video-plugin.js +19 -0
- package/plugins/embedded/video/get-active-video.d.ts +2 -0
- package/plugins/embedded/video/get-active-video.js +9 -0
- package/plugins/embedded/video/insert-video.d.ts +2 -0
- package/plugins/embedded/video/insert-video.js +19 -0
- package/plugins/embedded/video/update-video.d.ts +2 -0
- package/plugins/embedded/video/update-video.js +12 -0
- package/plugins/exit-break/create-exit-break-plugin.d.ts +3 -0
- package/plugins/exit-break/create-exit-break-plugin.js +30 -0
- package/plugins/heading/constants.d.ts +8 -0
- package/plugins/heading/constants.js +11 -0
- package/plugins/heading/create-headings-plugin.d.ts +8 -0
- package/plugins/heading/create-headings-plugin.js +40 -0
- package/plugins/highlight/createHighlightPlugin.d.ts +3 -0
- package/plugins/highlight/createHighlightPlugin.js +27 -0
- package/plugins/highlight/types.d.ts +10 -0
- package/plugins/highlight/types.js +4 -0
- package/plugins/image/create-image-plugin.d.ts +6 -0
- package/plugins/image/create-image-plugin.js +105 -0
- package/plugins/image/hooks/use-image-handlers.d.ts +5 -0
- package/plugins/image/hooks/use-image-handlers.js +19 -0
- package/plugins/image/transforms/get-active-image.d.ts +2 -0
- package/plugins/image/transforms/get-active-image.js +9 -0
- package/plugins/image/transforms/insert-image.d.ts +3 -0
- package/plugins/image/transforms/insert-image.js +19 -0
- package/plugins/image/transforms/is-image-active.d.ts +2 -0
- package/plugins/image/transforms/is-image-active.js +7 -0
- package/plugins/image/transforms/remove-selected-image.d.ts +2 -0
- package/plugins/image/transforms/remove-selected-image.js +13 -0
- package/plugins/image/transforms/update-image.d.ts +3 -0
- package/plugins/image/transforms/update-image.js +12 -0
- package/plugins/image/types.d.ts +12 -0
- package/plugins/image/types.js +6 -0
- package/plugins/image/utils/is-image-url.d.ts +2 -0
- package/plugins/image/utils/is-image-url.js +135 -0
- package/plugins/image/with-image.d.ts +7 -0
- package/plugins/image/with-image.js +19 -0
- package/plugins/image/with-paste-image-url.d.ts +7 -0
- package/plugins/image/with-paste-image-url.js +36 -0
- package/plugins/image/with-paste-image.d.ts +7 -0
- package/plugins/image/with-paste-image.js +49 -0
- package/plugins/link/constants.d.ts +2 -0
- package/plugins/link/constants.js +6 -0
- package/plugins/link/create-link-plugin.d.ts +3 -0
- package/plugins/link/create-link-plugin.js +15 -0
- package/plugins/link/floating-link-wrapper.d.ts +11 -0
- package/plugins/link/floating-link-wrapper.js +26 -0
- package/plugins/link/hooks/index.d.ts +4 -0
- package/plugins/link/hooks/index.js +11 -0
- package/plugins/link/hooks/use-link-actions.d.ts +12 -0
- package/plugins/link/hooks/use-link-actions.js +48 -0
- package/plugins/link/hooks/use-link-cancel-on-escape.d.ts +1 -0
- package/plugins/link/hooks/use-link-cancel-on-escape.js +5 -0
- package/plugins/link/hooks/use-link-submit-on-enter.d.ts +1 -0
- package/plugins/link/hooks/use-link-submit-on-enter.js +23 -0
- package/plugins/link/transforms/get-active-link.d.ts +3 -0
- package/plugins/link/transforms/get-active-link.js +17 -0
- package/plugins/link/transforms/insert-link.d.ts +2 -0
- package/plugins/link/transforms/insert-link.js +27 -0
- package/plugins/link/transforms/is-link-selected.d.ts +2 -0
- package/plugins/link/transforms/is-link-selected.js +15 -0
- package/plugins/link/transforms/submit-link.d.ts +8 -0
- package/plugins/link/transforms/submit-link.js +36 -0
- package/plugins/link/transforms/trigger-link-insert-or-edit.d.ts +2 -0
- package/plugins/link/transforms/trigger-link-insert-or-edit.js +6 -0
- package/plugins/link/transforms/unwrap-link.d.ts +2 -0
- package/plugins/link/transforms/unwrap-link.js +10 -0
- package/plugins/link/types.d.ts +5 -0
- package/plugins/link/types.js +2 -0
- package/plugins/list/constants.d.ts +4 -0
- package/plugins/list/constants.js +14 -0
- package/plugins/list/create-list-plugin.d.ts +4 -0
- package/plugins/list/create-list-plugin.js +16 -0
- package/plugins/mark-bold/create-bold-plugin.d.ts +3 -0
- package/plugins/mark-bold/create-bold-plugin.js +6 -0
- package/plugins/mark-bold/types.d.ts +2 -0
- package/plugins/mark-bold/types.js +6 -0
- package/plugins/mark-code/create-code-plugin.d.ts +3 -0
- package/plugins/mark-code/create-code-plugin.js +6 -0
- package/plugins/mark-code/types.d.ts +2 -0
- package/plugins/mark-code/types.js +6 -0
- package/plugins/mark-italic/create-italic-plugin.d.ts +3 -0
- package/plugins/mark-italic/create-italic-plugin.js +6 -0
- package/plugins/mark-italic/types.d.ts +2 -0
- package/plugins/mark-italic/types.js +6 -0
- package/plugins/mark-underline/create-underline-plugin.d.ts +3 -0
- package/plugins/mark-underline/create-underline-plugin.js +6 -0
- package/plugins/mark-underline/types.d.ts +2 -0
- package/plugins/mark-underline/types.js +6 -0
- package/plugins/node-id/add-ids-to-nodes.d.ts +2 -0
- package/plugins/node-id/add-ids-to-nodes.js +22 -0
- package/plugins/node-id/create-node-id-plugin.d.ts +3 -0
- package/plugins/node-id/create-node-id-plugin.js +6 -0
- package/plugins/paragraph/create-paragraph-plugin.d.ts +3 -0
- package/plugins/paragraph/create-paragraph-plugin.js +9 -0
- package/plugins/paragraph/types.d.ts +2 -0
- package/plugins/paragraph/types.js +6 -0
- package/plugins/reset-node/create-reset-node.d.ts +3 -0
- package/plugins/reset-node/create-reset-node.js +28 -0
- package/plugins/select-on-backspace/create-select-on-backspace-plugin.d.ts +3 -0
- package/plugins/select-on-backspace/create-select-on-backspace-plugin.js +14 -0
- package/plugins/soft-break/create-soft-break-plugin.d.ts +3 -0
- package/plugins/soft-break/create-soft-break-plugin.js +22 -0
- package/plugins/trailing-block/create-trailing-block-plugin.d.ts +3 -0
- package/plugins/trailing-block/create-trailing-block-plugin.js +6 -0
- package/serializers/serialize-to-plaintext.d.ts +2 -0
- package/serializers/serialize-to-plaintext.js +8 -0
- package/translations/cs.json +134 -0
- package/translations/de.json +134 -0
- package/translations/en.json +134 -0
- package/translations/sk.json +134 -0
- package/types.d.ts +118 -0
- package/types.js +2 -0
- package/ui/blockquote-element.d.ts +2 -0
- package/ui/blockquote-element.js +13 -0
- package/ui/bold-mark.d.ts +2 -0
- package/ui/bold-mark.js +13 -0
- package/ui/button/button-element.d.ts +2 -0
- package/ui/button/button-element.js +54 -0
- package/ui/button/index.d.ts +1 -0
- package/ui/button/index.js +5 -0
- package/ui/button/insert-button-modal-content.d.ts +8 -0
- package/ui/button/insert-button-modal-content.js +81 -0
- package/ui/code-mark.d.ts +2 -0
- package/ui/code-mark.js +13 -0
- package/ui/components/element/element-action-buttons.d.ts +9 -0
- package/ui/components/element/element-action-buttons.js +22 -0
- package/ui/components/element/element-with-action-buttons.d.ts +10 -0
- package/ui/components/element/element-with-action-buttons.js +17 -0
- package/ui/components/modal/modal-button-cancel.d.ts +9 -0
- package/ui/components/modal/modal-button-cancel.js +45 -0
- package/ui/components/modal/modal-button-submit.d.ts +6 -0
- package/ui/components/modal/modal-button-submit.js +12 -0
- package/ui/components/modal/modal-buttons.d.ts +11 -0
- package/ui/components/modal/modal-buttons.js +16 -0
- package/ui/components/modal/modal-content.d.ts +6 -0
- package/ui/components/modal/modal-content.js +14 -0
- package/ui/create-uxf-ui.d.ts +21 -0
- package/ui/create-uxf-ui.js +51 -0
- package/ui/floating-link.d.ts +2 -0
- package/ui/floating-link.js +110 -0
- package/ui/heading-elements.d.ts +7 -0
- package/ui/heading-elements.js +38 -0
- package/ui/highlight-mark.d.ts +3 -0
- package/ui/highlight-mark.js +13 -0
- package/ui/image/image-element.d.ts +2 -0
- package/ui/image/image-element.js +53 -0
- package/ui/image/insert-image-modal-content.d.ts +8 -0
- package/ui/image/insert-image-modal-content.js +89 -0
- package/ui/italic-mark.d.ts +2 -0
- package/ui/italic-mark.js +13 -0
- package/ui/link-element.d.ts +3 -0
- package/ui/link-element.js +14 -0
- package/ui/list-item-element.d.ts +2 -0
- package/ui/list-item-element.js +13 -0
- package/ui/list-ordered-element.d.ts +2 -0
- package/ui/list-ordered-element.js +13 -0
- package/ui/list-unordered-element.d.ts +2 -0
- package/ui/list-unordered-element.js +13 -0
- package/ui/paragraph-element.d.ts +2 -0
- package/ui/paragraph-element.js +13 -0
- package/ui/toolbar/buttons/button-toolbar-button.d.ts +10 -0
- package/ui/toolbar/buttons/button-toolbar-button.js +20 -0
- package/ui/toolbar/buttons/element-toolbar-button.d.ts +12 -0
- package/ui/toolbar/buttons/element-toolbar-button.js +25 -0
- package/ui/toolbar/buttons/image-toolbar-button.d.ts +10 -0
- package/ui/toolbar/buttons/image-toolbar-button.js +20 -0
- package/ui/toolbar/buttons/link-toolbar-button.d.ts +10 -0
- package/ui/toolbar/buttons/link-toolbar-button.js +29 -0
- package/ui/toolbar/buttons/list-toolbar-button.d.ts +13 -0
- package/ui/toolbar/buttons/list-toolbar-button.js +27 -0
- package/ui/toolbar/buttons/mark-toolbar-button.d.ts +13 -0
- package/ui/toolbar/buttons/mark-toolbar-button.js +25 -0
- package/ui/toolbar/buttons/modal-toolbar-button.d.ts +15 -0
- package/ui/toolbar/buttons/modal-toolbar-button.js +22 -0
- package/ui/toolbar/buttons/toolbar-button.d.ts +15 -0
- package/ui/toolbar/buttons/toolbar-button.js +35 -0
- package/ui/toolbar/buttons/undo-redo-button-group.d.ts +8 -0
- package/ui/toolbar/buttons/undo-redo-button-group.js +64 -0
- package/ui/toolbar/buttons/video-toolbar-button.d.ts +10 -0
- package/ui/toolbar/buttons/video-toolbar-button.js +20 -0
- package/ui/toolbar/toolbar.d.ts +3 -0
- package/ui/toolbar/toolbar.js +77 -0
- package/ui/toolbar/types.d.ts +8 -0
- package/ui/toolbar/types.js +2 -0
- package/ui/underline-mark.d.ts +2 -0
- package/ui/underline-mark.js +13 -0
- package/ui/utils.d.ts +2 -0
- package/ui/utils.js +13 -0
- package/ui/video/insert-video-modal-content.d.ts +8 -0
- package/ui/video/insert-video-modal-content.js +80 -0
- package/ui/video/video-element.d.ts +2 -0
- package/ui/video/video-element.js +55 -0
- package/utils/get-video-meta-data.d.ts +2 -0
- package/utils/get-video-meta-data.js +41 -0
- package/utils/url-helper.d.ts +7 -0
- package/utils/url-helper.js +15 -0
- package/utils/url-helper.test.d.ts +1 -0
- package/utils/url-helper.test.js +37 -0
- package/utils.d.ts +30 -0
- package/utils.js +88 -0
- package/wysiwyg-editor.d.ts +15 -0
- package/wysiwyg-editor.js +42 -0
- package/wysiwyg-editor.stories.d.ts +5 -0
- package/wysiwyg-editor.stories.js +193 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
{
|
|
2
|
+
"uxf-wysiwyg": {
|
|
3
|
+
"common": {
|
|
4
|
+
"placeholder": "Write something nice..."
|
|
5
|
+
},
|
|
6
|
+
"components": {
|
|
7
|
+
"modal": {
|
|
8
|
+
"button-cancel": "Cancel"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"plugins": {
|
|
12
|
+
"formatting": {
|
|
13
|
+
"bold": {
|
|
14
|
+
"tooltip": "Bold (Ctrl+B)"
|
|
15
|
+
},
|
|
16
|
+
"italic": {
|
|
17
|
+
"tooltip": "Italic (Ctrl+I)"
|
|
18
|
+
},
|
|
19
|
+
"underline": {
|
|
20
|
+
"tooltip": "Underline (Ctrl+U)"
|
|
21
|
+
},
|
|
22
|
+
"code": {
|
|
23
|
+
"tooltip": "Code"
|
|
24
|
+
},
|
|
25
|
+
"highlight": {
|
|
26
|
+
"tooltip": "Highlight (Ctrl+Shift+H)"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"headings": {
|
|
30
|
+
"h1": {
|
|
31
|
+
"tooltip": "Heading H1"
|
|
32
|
+
},
|
|
33
|
+
"h2": {
|
|
34
|
+
"tooltip": "Heading H2"
|
|
35
|
+
},
|
|
36
|
+
"h3": {
|
|
37
|
+
"tooltip": "Heading H3"
|
|
38
|
+
},
|
|
39
|
+
"h4": {
|
|
40
|
+
"tooltip": "Heading H4"
|
|
41
|
+
},
|
|
42
|
+
"h5": {
|
|
43
|
+
"tooltip": "Heading H5"
|
|
44
|
+
},
|
|
45
|
+
"h6": {
|
|
46
|
+
"tooltip": "Heading H6"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"link": {
|
|
50
|
+
"url-address": {
|
|
51
|
+
"invalid": "Invalid URL address",
|
|
52
|
+
"required": "URL address is required",
|
|
53
|
+
"label": "URL address",
|
|
54
|
+
"placeholder": "Enter URL address"
|
|
55
|
+
},
|
|
56
|
+
"link-text": {
|
|
57
|
+
"label": "Link text",
|
|
58
|
+
"placeholder": "Enter link text"
|
|
59
|
+
},
|
|
60
|
+
"open-in-new-tab": "Open in new tab",
|
|
61
|
+
"tooltip": "Insert link",
|
|
62
|
+
"button-save": "Save",
|
|
63
|
+
"button-close": "Close"
|
|
64
|
+
},
|
|
65
|
+
"blocks": {
|
|
66
|
+
"quote": {
|
|
67
|
+
"tooltip": "Quote"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"lists": {
|
|
71
|
+
"ul": {
|
|
72
|
+
"tooltip": "Insert bullet list"
|
|
73
|
+
},
|
|
74
|
+
"ol": {
|
|
75
|
+
"tooltip": "Insert numbered list"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"button": {
|
|
79
|
+
"tooltip": "Insert button",
|
|
80
|
+
"button-text": {
|
|
81
|
+
"label": "Button text",
|
|
82
|
+
"placeholder": "Enter button text",
|
|
83
|
+
"required": "This field is required"
|
|
84
|
+
},
|
|
85
|
+
"url-address": {
|
|
86
|
+
"label": "URL address",
|
|
87
|
+
"placeholder": "Enter URL address",
|
|
88
|
+
"required": "This field is required"
|
|
89
|
+
},
|
|
90
|
+
"button-insert": "Insert button",
|
|
91
|
+
"button-edit": "Edit button"
|
|
92
|
+
},
|
|
93
|
+
"image": {
|
|
94
|
+
"tooltip": "Insert image",
|
|
95
|
+
"alt": {
|
|
96
|
+
"label": "Image alt",
|
|
97
|
+
"placeholder": "Enter image alt"
|
|
98
|
+
},
|
|
99
|
+
"caption": {
|
|
100
|
+
"label": "Image caption",
|
|
101
|
+
"placeholder": "Enter image caption"
|
|
102
|
+
},
|
|
103
|
+
"source": {
|
|
104
|
+
"label": "Image source",
|
|
105
|
+
"placeholder": "Enter image source"
|
|
106
|
+
},
|
|
107
|
+
"file-upload": {
|
|
108
|
+
"label": "Image"
|
|
109
|
+
},
|
|
110
|
+
"button-insert": "Insert image",
|
|
111
|
+
"button-edit": "Edit image"
|
|
112
|
+
},
|
|
113
|
+
"video": {
|
|
114
|
+
"tooltip": "Insert video",
|
|
115
|
+
"url-address": {
|
|
116
|
+
"label": "URL address",
|
|
117
|
+
"placeholder": "Enter URL address",
|
|
118
|
+
"invalid": "Invalid URL address."
|
|
119
|
+
},
|
|
120
|
+
"iframe-title": "Video",
|
|
121
|
+
"button-insert": "Insert video",
|
|
122
|
+
"button-edit": "Edit video"
|
|
123
|
+
},
|
|
124
|
+
"actions": {
|
|
125
|
+
"undo": {
|
|
126
|
+
"tooltip": "Undo (Ctrl+Z)"
|
|
127
|
+
},
|
|
128
|
+
"redo": {
|
|
129
|
+
"tooltip": "Redo (Ctrl+Y)"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
{
|
|
2
|
+
"uxf-wysiwyg": {
|
|
3
|
+
"common": {
|
|
4
|
+
"placeholder": "Napíšte niečo pekné..."
|
|
5
|
+
},
|
|
6
|
+
"components": {
|
|
7
|
+
"modal": {
|
|
8
|
+
"button-cancel": "Zrušiť"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"plugins": {
|
|
12
|
+
"formatting": {
|
|
13
|
+
"bold": {
|
|
14
|
+
"tooltip": "Tučné (Ctrl+B)"
|
|
15
|
+
},
|
|
16
|
+
"italic": {
|
|
17
|
+
"tooltip": "Kurzíva (Ctrl+I)"
|
|
18
|
+
},
|
|
19
|
+
"underline": {
|
|
20
|
+
"tooltip": "Podčiarknutie (Ctrl+U)"
|
|
21
|
+
},
|
|
22
|
+
"code": {
|
|
23
|
+
"tooltip": "Kód"
|
|
24
|
+
},
|
|
25
|
+
"highlight": {
|
|
26
|
+
"tooltip": "Zvýraznenie (Ctrl+Shift+H)"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"headings": {
|
|
30
|
+
"h1": {
|
|
31
|
+
"tooltip": "Nadpis H1"
|
|
32
|
+
},
|
|
33
|
+
"h2": {
|
|
34
|
+
"tooltip": "Nadpis H2"
|
|
35
|
+
},
|
|
36
|
+
"h3": {
|
|
37
|
+
"tooltip": "Nadpis H3"
|
|
38
|
+
},
|
|
39
|
+
"h4": {
|
|
40
|
+
"tooltip": "Nadpis H4"
|
|
41
|
+
},
|
|
42
|
+
"h5": {
|
|
43
|
+
"tooltip": "Nadpis H5"
|
|
44
|
+
},
|
|
45
|
+
"h6": {
|
|
46
|
+
"tooltip": "Nadpis H6"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"link": {
|
|
50
|
+
"url-address": {
|
|
51
|
+
"invalid": "Neplatná URL adresa",
|
|
52
|
+
"required": "URL adresa je povinná",
|
|
53
|
+
"label": "URL adresa",
|
|
54
|
+
"placeholder": "Zadajte URL adresu"
|
|
55
|
+
},
|
|
56
|
+
"link-text": {
|
|
57
|
+
"label": "Text odkazu",
|
|
58
|
+
"placeholder": "Zadajte text odkazu"
|
|
59
|
+
},
|
|
60
|
+
"open-in-new-tab": "Otvoriť v novej karte",
|
|
61
|
+
"tooltip": "Vložiť odkaz",
|
|
62
|
+
"button-save": "Uložiť",
|
|
63
|
+
"button-close": "Zatvoriť"
|
|
64
|
+
},
|
|
65
|
+
"blocks": {
|
|
66
|
+
"quote": {
|
|
67
|
+
"tooltip": "Citácia"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"lists": {
|
|
71
|
+
"ul": {
|
|
72
|
+
"tooltip": "Vložiť odrážkový zoznam"
|
|
73
|
+
},
|
|
74
|
+
"ol": {
|
|
75
|
+
"tooltip": "Vložiť číslovaný zoznam"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"button": {
|
|
79
|
+
"tooltip": "Vložiť tlačidlo",
|
|
80
|
+
"button-text": {
|
|
81
|
+
"label": "Text tlačidla",
|
|
82
|
+
"placeholder": "Zadajte text tlačidla",
|
|
83
|
+
"required": "Toto pole je povinné"
|
|
84
|
+
},
|
|
85
|
+
"url-address": {
|
|
86
|
+
"label": "URL adresa",
|
|
87
|
+
"placeholder": "Zadajte URL adresu",
|
|
88
|
+
"required": "Toto pole je povinné"
|
|
89
|
+
},
|
|
90
|
+
"button-insert": "Vložiť tlačidlo",
|
|
91
|
+
"button-edit": "Upraviť tlačidlo"
|
|
92
|
+
},
|
|
93
|
+
"image": {
|
|
94
|
+
"tooltip": "Vložiť obrázok",
|
|
95
|
+
"alt": {
|
|
96
|
+
"label": "Alt obrázka",
|
|
97
|
+
"placeholder": "Zadajte alt obrázka"
|
|
98
|
+
},
|
|
99
|
+
"caption": {
|
|
100
|
+
"label": "Popis obrázka",
|
|
101
|
+
"placeholder": "Zadajte popis obrázka"
|
|
102
|
+
},
|
|
103
|
+
"source": {
|
|
104
|
+
"label": "Zdroj obrázka",
|
|
105
|
+
"placeholder": "Zadajte zdroj obrázka"
|
|
106
|
+
},
|
|
107
|
+
"file-upload": {
|
|
108
|
+
"label": "Obrázok"
|
|
109
|
+
},
|
|
110
|
+
"button-insert": "Vložiť obrázok",
|
|
111
|
+
"button-edit": "Upraviť obrázok"
|
|
112
|
+
},
|
|
113
|
+
"video": {
|
|
114
|
+
"tooltip": "Vložiť video",
|
|
115
|
+
"url-address": {
|
|
116
|
+
"label": "URL adresa",
|
|
117
|
+
"placeholder": "Zadajte URL adresu",
|
|
118
|
+
"invalid": "Neplatná URL adresa."
|
|
119
|
+
},
|
|
120
|
+
"iframe-title": "Video",
|
|
121
|
+
"button-insert": "Vložiť video",
|
|
122
|
+
"button-edit": "Upraviť video"
|
|
123
|
+
},
|
|
124
|
+
"actions": {
|
|
125
|
+
"undo": {
|
|
126
|
+
"tooltip": "Vrátiť späť (Ctrl+Z)"
|
|
127
|
+
},
|
|
128
|
+
"redo": {
|
|
129
|
+
"tooltip": "Opakovať (Ctrl+Y)"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
package/types.d.ts
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { OverrideByKey, PlateEditor, PlateId, PlatePlugin, PlatePluginComponent, RenderAfterEditable as PlateRenderAfterEditable, PlateRenderElementProps, PlateRenderLeafProps, PluginOptions } from "@udecode/plate-core";
|
|
2
|
+
import { TElement, TText } from "@udecode/slate";
|
|
3
|
+
import { FileResponse } from "@uxf/core/types";
|
|
4
|
+
import { FC } from "react";
|
|
5
|
+
export type EmptyText = {
|
|
6
|
+
text: "";
|
|
7
|
+
};
|
|
8
|
+
export interface RichText extends TText {
|
|
9
|
+
id?: PlateId;
|
|
10
|
+
bold?: boolean;
|
|
11
|
+
italic?: boolean;
|
|
12
|
+
underline?: boolean;
|
|
13
|
+
code?: boolean;
|
|
14
|
+
highlight?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface UxfBlockElement extends TElement {
|
|
17
|
+
id?: PlateId;
|
|
18
|
+
}
|
|
19
|
+
export interface UxfLinkElement extends UxfBlockElement {
|
|
20
|
+
type: "link";
|
|
21
|
+
url: string;
|
|
22
|
+
target: "_blank" | "_self";
|
|
23
|
+
}
|
|
24
|
+
export type UxfInlineDescendant = RichText | UxfLinkElement;
|
|
25
|
+
export type UxfInlineChildren = UxfInlineDescendant[];
|
|
26
|
+
export interface UxfParagraphElement extends UxfBlockElement {
|
|
27
|
+
type: "paragraph";
|
|
28
|
+
children: UxfInlineChildren;
|
|
29
|
+
}
|
|
30
|
+
export interface UxfBlockQuoteElement extends UxfBlockElement {
|
|
31
|
+
type: "blockquote";
|
|
32
|
+
children: UxfInlineChildren;
|
|
33
|
+
}
|
|
34
|
+
export interface UxfImageElement extends UxfBlockElement {
|
|
35
|
+
type: "image";
|
|
36
|
+
children: [EmptyText];
|
|
37
|
+
file: FileResponse;
|
|
38
|
+
source?: string;
|
|
39
|
+
caption?: string;
|
|
40
|
+
alt?: string;
|
|
41
|
+
url?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface UxfHeadingElement extends UxfBlockElement {
|
|
44
|
+
type: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
45
|
+
}
|
|
46
|
+
export interface LicElement extends UxfBlockElement {
|
|
47
|
+
type: "lic";
|
|
48
|
+
}
|
|
49
|
+
export interface LiElement extends UxfBlockElement {
|
|
50
|
+
type: "li";
|
|
51
|
+
children: LicElement[];
|
|
52
|
+
}
|
|
53
|
+
export interface UxfUnorderedListElement extends UxfBlockElement {
|
|
54
|
+
type: "ul";
|
|
55
|
+
children: LiElement[];
|
|
56
|
+
}
|
|
57
|
+
export interface UxfOrderedListElement extends UxfBlockElement {
|
|
58
|
+
type: "ol";
|
|
59
|
+
children: LiElement[];
|
|
60
|
+
}
|
|
61
|
+
export type UxfVideoMetaData = {
|
|
62
|
+
title: string;
|
|
63
|
+
description: string;
|
|
64
|
+
authorName: string;
|
|
65
|
+
authorUrl: string;
|
|
66
|
+
width: number;
|
|
67
|
+
height: number;
|
|
68
|
+
duration: number;
|
|
69
|
+
uploadDate: string;
|
|
70
|
+
thumbnail: {
|
|
71
|
+
width: number;
|
|
72
|
+
height: number;
|
|
73
|
+
url: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
export interface UxfVideoElement extends UxfBlockElement {
|
|
77
|
+
type: "video";
|
|
78
|
+
url: string;
|
|
79
|
+
embeddedUrl: string;
|
|
80
|
+
provider: string;
|
|
81
|
+
videoId: string;
|
|
82
|
+
children: [EmptyText];
|
|
83
|
+
metaData?: Partial<UxfVideoMetaData> | null;
|
|
84
|
+
}
|
|
85
|
+
export interface UxfButtonElement extends UxfBlockElement {
|
|
86
|
+
type: "button";
|
|
87
|
+
buttonUrl: string;
|
|
88
|
+
buttonText: string;
|
|
89
|
+
children: [EmptyText];
|
|
90
|
+
}
|
|
91
|
+
export type WysiwygRootBlock = UxfParagraphElement | UxfBlockQuoteElement | UxfImageElement | UxfHeadingElement | UxfLinkElement | UxfUnorderedListElement | UxfOrderedListElement | UxfVideoElement | UxfButtonElement;
|
|
92
|
+
export type UiComponents = Record<string, PlatePluginComponent>;
|
|
93
|
+
export type WysiwygContent = WysiwygRootBlock[];
|
|
94
|
+
export type RenderElementProps<E extends TElement = UxfBlockElement> = PlateRenderElementProps<WysiwygContent, E>;
|
|
95
|
+
export type ElementUiComponent<E extends TElement = UxfBlockElement> = FC<RenderElementProps<E>>;
|
|
96
|
+
export type RenderLeafProps<L extends TText = RichText> = PlateRenderLeafProps<WysiwygContent, L>;
|
|
97
|
+
export type LeafUiComponent<L extends TText = RichText> = FC<RenderLeafProps<L>>;
|
|
98
|
+
export type RenderAfterEditable = PlateRenderAfterEditable<WysiwygContent>;
|
|
99
|
+
export type UxfEditor = PlateEditor<WysiwygContent> & {
|
|
100
|
+
isDragging?: boolean;
|
|
101
|
+
};
|
|
102
|
+
export type UxfPlatePlugin<P = PluginOptions> = PlatePlugin<P, WysiwygContent, UxfEditor>;
|
|
103
|
+
export interface WysiwygPlugin<E extends UxfBlockElement = UxfBlockElement> {
|
|
104
|
+
plugin: UxfPlatePlugin;
|
|
105
|
+
component: ElementUiComponent<E> | LeafUiComponent;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* This is used when recursive plugin feature is used
|
|
109
|
+
* @see https://plate.udecode.io/docs/plugins#plugins
|
|
110
|
+
* E.g. Headings plugin
|
|
111
|
+
*/
|
|
112
|
+
export interface WysiwygRecursivePlugin<C extends string, E extends UxfBlockElement = UxfBlockElement> {
|
|
113
|
+
plugin: UxfPlatePlugin;
|
|
114
|
+
components: {
|
|
115
|
+
[key in C]: ElementUiComponent<E> | LeafUiComponent;
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
export type MyOverrideByKey = OverrideByKey<WysiwygContent, UxfEditor>;
|
package/types.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BlockquoteElement = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const CLASS_NAME = "uxf-wysiwyg__element";
|
|
9
|
+
const BlockquoteElement = (props) => {
|
|
10
|
+
var _a;
|
|
11
|
+
return (react_1.default.createElement("blockquote", { ...props.attributes, className: `${CLASS_NAME} ${CLASS_NAME}-blockquote ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}` }, props.children));
|
|
12
|
+
};
|
|
13
|
+
exports.BlockquoteElement = BlockquoteElement;
|
package/ui/bold-mark.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BoldMark = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const CLASS_NAME = "uxf-wysiwyg__element";
|
|
9
|
+
const BoldMark = (props) => {
|
|
10
|
+
var _a;
|
|
11
|
+
return (react_1.default.createElement("strong", { ...props.attributes, className: `${CLASS_NAME} ${CLASS_NAME}-bold ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}` }, props.children));
|
|
12
|
+
};
|
|
13
|
+
exports.BoldMark = BoldMark;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ButtonElement = void 0;
|
|
27
|
+
const button_1 = require("@uxf/ui/button");
|
|
28
|
+
const dialog_panel_1 = require("@uxf/ui/dialog/dialog-panel");
|
|
29
|
+
const modal_service_1 = require("@uxf/ui/modal/modal-service");
|
|
30
|
+
const react_1 = __importStar(require("react"));
|
|
31
|
+
const hooks_1 = require("../../hooks");
|
|
32
|
+
const button_2 = require("../../plugins/button");
|
|
33
|
+
const remove_selected_button_1 = require("../../plugins/button/transforms/remove-selected-button");
|
|
34
|
+
const element_with_action_buttons_1 = require("../components/element/element-with-action-buttons");
|
|
35
|
+
const insert_button_modal_content_1 = require("./insert-button-modal-content");
|
|
36
|
+
const CLASS_NAME = "uxf-wysiwyg__element";
|
|
37
|
+
const ButtonElement = (props) => {
|
|
38
|
+
var _a;
|
|
39
|
+
const selected = (0, hooks_1.useSelected)();
|
|
40
|
+
const onEdit = (0, react_1.useCallback)(() => {
|
|
41
|
+
(0, modal_service_1.openModal)({
|
|
42
|
+
children: (react_1.default.createElement(dialog_panel_1.DialogPanel, { width: "lg" },
|
|
43
|
+
react_1.default.createElement(insert_button_modal_content_1.InsertButtonModalContent, { buttonToEdit: (0, button_2.getActiveButton)(props.editor), editor: props.editor }))),
|
|
44
|
+
});
|
|
45
|
+
}, [props.editor]);
|
|
46
|
+
const onRemove = (0, react_1.useCallback)(() => {
|
|
47
|
+
(0, remove_selected_button_1.removeSelectedButton)(props.editor);
|
|
48
|
+
}, [props.editor]);
|
|
49
|
+
return (react_1.default.createElement("div", { ...props.attributes, className: `${CLASS_NAME} ${CLASS_NAME}-button ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}` },
|
|
50
|
+
react_1.default.createElement(element_with_action_buttons_1.ElementWithActionButtons, { className: `${CLASS_NAME}-button__action-buttons`, isSelected: selected, onDelete: onRemove, onEdit: onEdit, padding: selected },
|
|
51
|
+
react_1.default.createElement(button_1.Button, { className: `${CLASS_NAME}-button__action-button`, href: props.element.buttonUrl, isDisabled: true, variant: "secondary" }, props.element.buttonText)),
|
|
52
|
+
props.children));
|
|
53
|
+
};
|
|
54
|
+
exports.ButtonElement = ButtonElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ButtonElement } from "./button-element";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ButtonElement = void 0;
|
|
4
|
+
var button_element_1 = require("./button-element");
|
|
5
|
+
Object.defineProperty(exports, "ButtonElement", { enumerable: true, get: function () { return button_element_1.ButtonElement; } });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC } from "react";
|
|
2
|
+
import { UxfButtonElement, UxfEditor } from "../../types";
|
|
3
|
+
interface InsertButtonModalContentProps {
|
|
4
|
+
editor: UxfEditor;
|
|
5
|
+
buttonToEdit?: UxfButtonElement;
|
|
6
|
+
}
|
|
7
|
+
export declare const InsertButtonModalContent: FC<InsertButtonModalContentProps>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.InsertButtonModalContent = void 0;
|
|
27
|
+
const translations_1 = require("@uxf/core-react/translations");
|
|
28
|
+
const text_input_1 = require("@uxf/ui/text-input");
|
|
29
|
+
const react_1 = __importStar(require("react"));
|
|
30
|
+
const button_1 = require("../../plugins/button");
|
|
31
|
+
const modal_buttons_1 = require("../components/modal/modal-buttons");
|
|
32
|
+
const modal_content_1 = require("../components/modal/modal-content");
|
|
33
|
+
const utils_1 = require("../utils");
|
|
34
|
+
const CLASS_NAME = "uxf-wysiwyg__insert-modal-button";
|
|
35
|
+
const InsertButtonModalContent = (props) => {
|
|
36
|
+
var _a, _b, _c, _d;
|
|
37
|
+
const t = (0, translations_1.useUxfTranslation)();
|
|
38
|
+
const [buttonText, setButtonText] = (0, react_1.useState)((_b = (_a = props.buttonToEdit) === null || _a === void 0 ? void 0 : _a.buttonText) !== null && _b !== void 0 ? _b : "");
|
|
39
|
+
const [buttonUrl, setButtonUrl] = (0, react_1.useState)((_d = (_c = props.buttonToEdit) === null || _c === void 0 ? void 0 : _c.buttonUrl) !== null && _d !== void 0 ? _d : "");
|
|
40
|
+
const [error, setError] = (0, react_1.useState)({
|
|
41
|
+
text: undefined,
|
|
42
|
+
url: undefined,
|
|
43
|
+
});
|
|
44
|
+
const title = props.buttonToEdit
|
|
45
|
+
? t("uxf-wysiwyg:plugins.button.button-edit")
|
|
46
|
+
: t("uxf-wysiwyg:plugins.button.button-insert");
|
|
47
|
+
const onSubmit = (0, react_1.useCallback)(async (e) => {
|
|
48
|
+
e.preventDefault();
|
|
49
|
+
if (buttonText.length === 0) {
|
|
50
|
+
setError((prevError) => ({
|
|
51
|
+
...prevError,
|
|
52
|
+
text: t("uxf-wysiwyg:plugins.button.button-text.required"),
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
if (buttonUrl.length === 0) {
|
|
56
|
+
setError((prevError) => {
|
|
57
|
+
return {
|
|
58
|
+
...prevError,
|
|
59
|
+
url: t("uxf-wysiwyg:plugins.button.url-address.required"),
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
if (buttonText.length !== 0 && buttonUrl.length !== 0) {
|
|
64
|
+
if (props.buttonToEdit) {
|
|
65
|
+
(0, button_1.updateButton)(props.editor, buttonText, buttonUrl);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
(0, button_1.insertButton)(props.editor, buttonText, buttonUrl);
|
|
69
|
+
}
|
|
70
|
+
(0, utils_1.closeModalWithFocus)(props.editor);
|
|
71
|
+
}
|
|
72
|
+
}, [buttonText, buttonUrl, props.buttonToEdit, props.editor, t]);
|
|
73
|
+
return (react_1.default.createElement(modal_content_1.ModalContent, { title: title },
|
|
74
|
+
react_1.default.createElement("form", { className: `${CLASS_NAME}__form`, id: "insert-button-form", onSubmit: onSubmit },
|
|
75
|
+
react_1.default.createElement("div", { className: `${CLASS_NAME}__form-inputs` },
|
|
76
|
+
react_1.default.createElement(text_input_1.TextInput, { helperText: error.text, isInvalid: Boolean(error.text), isRequired: true, label: t("uxf-wysiwyg:plugins.button.button-text.label"), name: "button-text", onChange: setButtonText, placeholder: t("uxf-wysiwyg:plugins.button.button-text.placeholder"), type: "text", value: buttonText }),
|
|
77
|
+
react_1.default.createElement(text_input_1.TextInput, { helperText: error.url, isInvalid: Boolean(error.url), isRequired: true, label: t("uxf-wysiwyg:plugins.button.url-address.label"), name: "url-address", onChange: setButtonUrl, placeholder: t("uxf-wysiwyg:plugins.button.url-address.placeholder"), type: "text", value: buttonUrl })),
|
|
78
|
+
react_1.default.createElement(modal_buttons_1.ModalButtons, { className: `${CLASS_NAME}__form-buttons`, editor: props.editor, submitText: title }),
|
|
79
|
+
react_1.default.createElement("button", { hidden: true, type: "submit" }))));
|
|
80
|
+
};
|
|
81
|
+
exports.InsertButtonModalContent = InsertButtonModalContent;
|
package/ui/code-mark.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CodeMark = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const CLASS_NAME = "uxf-wysiwyg__element";
|
|
9
|
+
const CodeMark = (props) => {
|
|
10
|
+
var _a;
|
|
11
|
+
return (react_1.default.createElement("code", { ...props.attributes, className: `${CLASS_NAME} ${CLASS_NAME}-code ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}` }, props.children));
|
|
12
|
+
};
|
|
13
|
+
exports.CodeMark = CodeMark;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ElementActionButtons = void 0;
|
|
7
|
+
const button_1 = require("@uxf/ui/button");
|
|
8
|
+
const icon_1 = require("@uxf/ui/icon");
|
|
9
|
+
const react_1 = __importDefault(require("react"));
|
|
10
|
+
const CLASS_NAME = "uxf-wysiwyg__element-action-buttons";
|
|
11
|
+
const ElementActionButtons = (props) => {
|
|
12
|
+
var _a;
|
|
13
|
+
if (!props.isSelected) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
return (react_1.default.createElement("div", { className: `${CLASS_NAME} ${(_a = props.className) !== null && _a !== void 0 ? _a : ""}`, contentEditable: false, tabIndex: -1 },
|
|
17
|
+
react_1.default.createElement(button_1.Button, { className: `${CLASS_NAME}__edit`, isIconButton: true, onClick: props.onEdit, variant: "secondary" },
|
|
18
|
+
react_1.default.createElement(icon_1.Icon, { name: "edit" })),
|
|
19
|
+
react_1.default.createElement(button_1.Button, { className: `${CLASS_NAME}__delete`, isIconButton: true, onClick: props.onDelete, variant: "secondary" },
|
|
20
|
+
react_1.default.createElement(icon_1.Icon, { name: "delete" }))));
|
|
21
|
+
};
|
|
22
|
+
exports.ElementActionButtons = ElementActionButtons;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC, PropsWithChildren } from "react";
|
|
2
|
+
interface Props extends PropsWithChildren {
|
|
3
|
+
className?: string;
|
|
4
|
+
onEdit: () => void;
|
|
5
|
+
onDelete: () => void;
|
|
6
|
+
isSelected: boolean;
|
|
7
|
+
padding?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const ElementWithActionButtons: FC<Props>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ElementWithActionButtons = void 0;
|
|
7
|
+
const classes_1 = require("@uxf/core/constants/classes");
|
|
8
|
+
const cx_1 = require("@uxf/core/utils/cx");
|
|
9
|
+
const react_1 = __importDefault(require("react"));
|
|
10
|
+
const element_action_buttons_1 = require("./element-action-buttons");
|
|
11
|
+
const CLASS_NAME = "uxf-wysiwyg__element-with-action-buttons";
|
|
12
|
+
const ElementWithActionButtons = (props) => {
|
|
13
|
+
return (react_1.default.createElement("div", { className: (0, cx_1.cx)(CLASS_NAME, props.padding && `${CLASS_NAME}--has-padding`, props.isSelected && `${CLASS_NAME}--${classes_1.CLASSES.IS_SELECTED}`, props.className), contentEditable: false },
|
|
14
|
+
react_1.default.createElement(element_action_buttons_1.ElementActionButtons, { isSelected: props.isSelected, onDelete: props.onDelete, onEdit: props.onEdit }),
|
|
15
|
+
props.children));
|
|
16
|
+
};
|
|
17
|
+
exports.ElementWithActionButtons = ElementWithActionButtons;
|