@uxf/wysiwyg 11.73.0 → 11.74.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/README.md +3 -1
- package/package.json +3 -3
- package/translations/translations.d.ts +405 -5
- package/translations/translations.js +404 -4
- package/components.d.ts +0 -7
- package/components.js +0 -34
- package/config/icons-config.d.ts +0 -2
- package/config/icons-config.js +0 -5
- package/config/icons.d.ts +0 -183
- package/config/icons.js +0 -51
- package/create-all-plugins-with-ui.d.ts +0 -64
- package/create-all-plugins-with-ui.js +0 -127
- package/create-plugins-with-ui.d.ts +0 -4
- package/create-plugins-with-ui.js +0 -47
- package/hooks.d.ts +0 -9
- package/hooks.js +0 -20
- package/index.d.ts +0 -6
- package/index.js +0 -38
- package/plugins/blockquote/create-blockquote-plugin.d.ts +0 -3
- package/plugins/blockquote/create-blockquote-plugin.js +0 -9
- package/plugins/blockquote/types.d.ts +0 -2
- package/plugins/blockquote/types.js +0 -6
- package/plugins/button/constants.d.ts +0 -2
- package/plugins/button/constants.js +0 -5
- package/plugins/button/create-button-plugin.d.ts +0 -2
- package/plugins/button/create-button-plugin.js +0 -11
- package/plugins/button/index.d.ts +0 -3
- package/plugins/button/index.js +0 -23
- package/plugins/button/transforms/get-active-button.d.ts +0 -2
- package/plugins/button/transforms/get-active-button.js +0 -9
- package/plugins/button/transforms/index.d.ts +0 -4
- package/plugins/button/transforms/index.js +0 -11
- package/plugins/button/transforms/insert-button.d.ts +0 -2
- package/plugins/button/transforms/insert-button.js +0 -16
- package/plugins/button/transforms/is-button-active.d.ts +0 -2
- package/plugins/button/transforms/is-button-active.js +0 -7
- package/plugins/button/transforms/remove-selected-button.d.ts +0 -2
- package/plugins/button/transforms/remove-selected-button.js +0 -13
- package/plugins/button/transforms/update-button.d.ts +0 -2
- package/plugins/button/transforms/update-button.js +0 -9
- package/plugins/embedded/utils.d.ts +0 -1
- package/plugins/embedded/utils.js +0 -7
- package/plugins/embedded/video/create-video-plugin.d.ts +0 -4
- package/plugins/embedded/video/create-video-plugin.js +0 -19
- package/plugins/embedded/video/get-active-video.d.ts +0 -2
- package/plugins/embedded/video/get-active-video.js +0 -9
- package/plugins/embedded/video/insert-video.d.ts +0 -2
- package/plugins/embedded/video/insert-video.js +0 -19
- package/plugins/embedded/video/update-video.d.ts +0 -2
- package/plugins/embedded/video/update-video.js +0 -12
- package/plugins/exit-break/create-exit-break-plugin.d.ts +0 -3
- package/plugins/exit-break/create-exit-break-plugin.js +0 -30
- package/plugins/heading/constants.d.ts +0 -8
- package/plugins/heading/constants.js +0 -11
- package/plugins/heading/create-headings-plugin.d.ts +0 -8
- package/plugins/heading/create-headings-plugin.js +0 -40
- package/plugins/highlight/createHighlightPlugin.d.ts +0 -3
- package/plugins/highlight/createHighlightPlugin.js +0 -27
- package/plugins/highlight/types.d.ts +0 -10
- package/plugins/highlight/types.js +0 -4
- package/plugins/image/create-image-plugin.d.ts +0 -6
- package/plugins/image/create-image-plugin.js +0 -105
- package/plugins/image/hooks/use-image-handlers.d.ts +0 -5
- package/plugins/image/hooks/use-image-handlers.js +0 -19
- package/plugins/image/transforms/get-active-image.d.ts +0 -2
- package/plugins/image/transforms/get-active-image.js +0 -9
- package/plugins/image/transforms/insert-image.d.ts +0 -3
- package/plugins/image/transforms/insert-image.js +0 -19
- package/plugins/image/transforms/is-image-active.d.ts +0 -2
- package/plugins/image/transforms/is-image-active.js +0 -7
- package/plugins/image/transforms/remove-selected-image.d.ts +0 -2
- package/plugins/image/transforms/remove-selected-image.js +0 -13
- package/plugins/image/transforms/update-image.d.ts +0 -3
- package/plugins/image/transforms/update-image.js +0 -12
- package/plugins/image/types.d.ts +0 -12
- package/plugins/image/types.js +0 -6
- package/plugins/image/utils/is-image-url.d.ts +0 -2
- package/plugins/image/utils/is-image-url.js +0 -135
- package/plugins/image/with-image.d.ts +0 -7
- package/plugins/image/with-image.js +0 -19
- package/plugins/image/with-paste-image-url.d.ts +0 -7
- package/plugins/image/with-paste-image-url.js +0 -36
- package/plugins/image/with-paste-image.d.ts +0 -7
- package/plugins/image/with-paste-image.js +0 -49
- package/plugins/link/constants.d.ts +0 -2
- package/plugins/link/constants.js +0 -6
- package/plugins/link/create-link-plugin.d.ts +0 -3
- package/plugins/link/create-link-plugin.js +0 -15
- package/plugins/link/floating-link-wrapper.d.ts +0 -11
- package/plugins/link/floating-link-wrapper.js +0 -26
- package/plugins/link/hooks/index.d.ts +0 -4
- package/plugins/link/hooks/index.js +0 -11
- package/plugins/link/hooks/use-link-actions.d.ts +0 -12
- package/plugins/link/hooks/use-link-actions.js +0 -48
- package/plugins/link/hooks/use-link-cancel-on-escape.d.ts +0 -1
- package/plugins/link/hooks/use-link-cancel-on-escape.js +0 -5
- package/plugins/link/hooks/use-link-submit-on-enter.d.ts +0 -1
- package/plugins/link/hooks/use-link-submit-on-enter.js +0 -23
- package/plugins/link/transforms/get-active-link.d.ts +0 -3
- package/plugins/link/transforms/get-active-link.js +0 -17
- package/plugins/link/transforms/insert-link.d.ts +0 -2
- package/plugins/link/transforms/insert-link.js +0 -27
- package/plugins/link/transforms/is-link-selected.d.ts +0 -2
- package/plugins/link/transforms/is-link-selected.js +0 -15
- package/plugins/link/transforms/submit-link.d.ts +0 -8
- package/plugins/link/transforms/submit-link.js +0 -36
- package/plugins/link/transforms/trigger-link-insert-or-edit.d.ts +0 -2
- package/plugins/link/transforms/trigger-link-insert-or-edit.js +0 -6
- package/plugins/link/transforms/unwrap-link.d.ts +0 -2
- package/plugins/link/transforms/unwrap-link.js +0 -10
- package/plugins/link/types.d.ts +0 -5
- package/plugins/link/types.js +0 -2
- package/plugins/list/constants.d.ts +0 -4
- package/plugins/list/constants.js +0 -14
- package/plugins/list/create-list-plugin.d.ts +0 -4
- package/plugins/list/create-list-plugin.js +0 -16
- package/plugins/mark-bold/create-bold-plugin.d.ts +0 -3
- package/plugins/mark-bold/create-bold-plugin.js +0 -6
- package/plugins/mark-bold/types.d.ts +0 -2
- package/plugins/mark-bold/types.js +0 -6
- package/plugins/mark-code/create-code-plugin.d.ts +0 -3
- package/plugins/mark-code/create-code-plugin.js +0 -6
- package/plugins/mark-code/types.d.ts +0 -2
- package/plugins/mark-code/types.js +0 -6
- package/plugins/mark-italic/create-italic-plugin.d.ts +0 -3
- package/plugins/mark-italic/create-italic-plugin.js +0 -6
- package/plugins/mark-italic/types.d.ts +0 -2
- package/plugins/mark-italic/types.js +0 -6
- package/plugins/mark-underline/create-underline-plugin.d.ts +0 -3
- package/plugins/mark-underline/create-underline-plugin.js +0 -6
- package/plugins/mark-underline/types.d.ts +0 -2
- package/plugins/mark-underline/types.js +0 -6
- package/plugins/node-id/add-ids-to-nodes.d.ts +0 -2
- package/plugins/node-id/add-ids-to-nodes.js +0 -22
- package/plugins/node-id/create-node-id-plugin.d.ts +0 -3
- package/plugins/node-id/create-node-id-plugin.js +0 -6
- package/plugins/paragraph/create-paragraph-plugin.d.ts +0 -3
- package/plugins/paragraph/create-paragraph-plugin.js +0 -9
- package/plugins/paragraph/types.d.ts +0 -2
- package/plugins/paragraph/types.js +0 -6
- package/plugins/reset-node/create-reset-node.d.ts +0 -3
- package/plugins/reset-node/create-reset-node.js +0 -28
- package/plugins/select-on-backspace/create-select-on-backspace-plugin.d.ts +0 -3
- package/plugins/select-on-backspace/create-select-on-backspace-plugin.js +0 -14
- package/plugins/soft-break/create-soft-break-plugin.d.ts +0 -3
- package/plugins/soft-break/create-soft-break-plugin.js +0 -22
- package/plugins/trailing-block/create-trailing-block-plugin.d.ts +0 -3
- package/plugins/trailing-block/create-trailing-block-plugin.js +0 -6
- package/serializers/serialize-to-plaintext.d.ts +0 -2
- package/serializers/serialize-to-plaintext.js +0 -8
- package/translations/context.d.ts +0 -2
- package/translations/context.js +0 -9
- package/translations/cs.d.ts +0 -52
- package/translations/cs.js +0 -55
- package/translations/en.d.ts +0 -2
- package/translations/en.js +0 -55
- package/translations/sk.d.ts +0 -2
- package/translations/sk.js +0 -55
- package/types.d.ts +0 -118
- package/types.js +0 -2
- package/ui/blockquote-element.d.ts +0 -2
- package/ui/blockquote-element.js +0 -13
- package/ui/bold-mark.d.ts +0 -2
- package/ui/bold-mark.js +0 -13
- package/ui/button/button-element.d.ts +0 -2
- package/ui/button/button-element.js +0 -54
- package/ui/button/index.d.ts +0 -1
- package/ui/button/index.js +0 -5
- package/ui/button/insert-button-modal-content.d.ts +0 -8
- package/ui/button/insert-button-modal-content.js +0 -81
- package/ui/code-mark.d.ts +0 -2
- package/ui/code-mark.js +0 -13
- package/ui/components/element/element-action-buttons.d.ts +0 -9
- package/ui/components/element/element-action-buttons.js +0 -22
- package/ui/components/element/element-with-action-buttons.d.ts +0 -10
- package/ui/components/element/element-with-action-buttons.js +0 -17
- package/ui/components/modal/modal-button-cancel.d.ts +0 -9
- package/ui/components/modal/modal-button-cancel.js +0 -45
- package/ui/components/modal/modal-button-submit.d.ts +0 -6
- package/ui/components/modal/modal-button-submit.js +0 -12
- package/ui/components/modal/modal-buttons.d.ts +0 -11
- package/ui/components/modal/modal-buttons.js +0 -16
- package/ui/components/modal/modal-content.d.ts +0 -6
- package/ui/components/modal/modal-content.js +0 -14
- package/ui/create-uxf-ui.d.ts +0 -21
- package/ui/create-uxf-ui.js +0 -51
- package/ui/floating-link.d.ts +0 -2
- package/ui/floating-link.js +0 -110
- package/ui/heading-elements.d.ts +0 -7
- package/ui/heading-elements.js +0 -38
- package/ui/highlight-mark.d.ts +0 -3
- package/ui/highlight-mark.js +0 -13
- package/ui/image/image-element.d.ts +0 -2
- package/ui/image/image-element.js +0 -53
- package/ui/image/insert-image-modal-content.d.ts +0 -8
- package/ui/image/insert-image-modal-content.js +0 -87
- package/ui/italic-mark.d.ts +0 -2
- package/ui/italic-mark.js +0 -13
- package/ui/link-element.d.ts +0 -3
- package/ui/link-element.js +0 -14
- package/ui/list-item-element.d.ts +0 -2
- package/ui/list-item-element.js +0 -13
- package/ui/list-ordered-element.d.ts +0 -2
- package/ui/list-ordered-element.js +0 -13
- package/ui/list-unordered-element.d.ts +0 -2
- package/ui/list-unordered-element.js +0 -13
- package/ui/paragraph-element.d.ts +0 -2
- package/ui/paragraph-element.js +0 -13
- package/ui/toolbar/buttons/button-toolbar-button.d.ts +0 -10
- package/ui/toolbar/buttons/button-toolbar-button.js +0 -20
- package/ui/toolbar/buttons/element-toolbar-button.d.ts +0 -12
- package/ui/toolbar/buttons/element-toolbar-button.js +0 -25
- package/ui/toolbar/buttons/image-toolbar-button.d.ts +0 -10
- package/ui/toolbar/buttons/image-toolbar-button.js +0 -20
- package/ui/toolbar/buttons/link-toolbar-button.d.ts +0 -10
- package/ui/toolbar/buttons/link-toolbar-button.js +0 -29
- package/ui/toolbar/buttons/list-toolbar-button.d.ts +0 -13
- package/ui/toolbar/buttons/list-toolbar-button.js +0 -27
- package/ui/toolbar/buttons/mark-toolbar-button.d.ts +0 -13
- package/ui/toolbar/buttons/mark-toolbar-button.js +0 -25
- package/ui/toolbar/buttons/modal-toolbar-button.d.ts +0 -15
- package/ui/toolbar/buttons/modal-toolbar-button.js +0 -22
- package/ui/toolbar/buttons/toolbar-button.d.ts +0 -15
- package/ui/toolbar/buttons/toolbar-button.js +0 -35
- package/ui/toolbar/buttons/undo-redo-button-group.d.ts +0 -8
- package/ui/toolbar/buttons/undo-redo-button-group.js +0 -64
- package/ui/toolbar/buttons/video-toolbar-button.d.ts +0 -10
- package/ui/toolbar/buttons/video-toolbar-button.js +0 -20
- package/ui/toolbar/toolbar.d.ts +0 -3
- package/ui/toolbar/toolbar.js +0 -77
- package/ui/toolbar/types.d.ts +0 -8
- package/ui/toolbar/types.js +0 -2
- package/ui/underline-mark.d.ts +0 -2
- package/ui/underline-mark.js +0 -13
- package/ui/utils.d.ts +0 -2
- package/ui/utils.js +0 -13
- package/ui/video/insert-video-modal-content.d.ts +0 -8
- package/ui/video/insert-video-modal-content.js +0 -78
- package/ui/video/video-element.d.ts +0 -2
- package/ui/video/video-element.js +0 -55
- package/utils/get-video-meta-data.d.ts +0 -2
- package/utils/get-video-meta-data.js +0 -41
- package/utils/url-helper.d.ts +0 -7
- package/utils/url-helper.js +0 -15
- package/utils/url-helper.test.d.ts +0 -1
- package/utils/url-helper.test.js +0 -37
- package/utils.d.ts +0 -30
- package/utils.js +0 -88
- package/wysiwyg-editor.d.ts +0 -17
- package/wysiwyg-editor.js +0 -44
- package/wysiwyg-editor.stories.d.ts +0 -5
- package/wysiwyg-editor.stories.js +0 -193
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
"use client";
|
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
-
if (k2 === undefined) k2 = k;
|
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
-
if (mod && mod.__esModule) return mod;
|
|
21
|
-
var result = {};
|
|
22
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
-
__setModuleDefault(result, mod);
|
|
24
|
-
return result;
|
|
25
|
-
};
|
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.initialValue = void 0;
|
|
28
|
-
exports.Playground = Playground;
|
|
29
|
-
exports.SelectedPlugins = SelectedPlugins;
|
|
30
|
-
const show_1 = require("@uxf/core-react/components/show");
|
|
31
|
-
const use_is_mounted_1 = require("@uxf/core-react/hooks/use-is-mounted");
|
|
32
|
-
const wysiwyg_1 = require("@uxf/wysiwyg");
|
|
33
|
-
const react_1 = __importStar(require("react"));
|
|
34
|
-
exports.initialValue = [
|
|
35
|
-
{
|
|
36
|
-
type: "h1",
|
|
37
|
-
id: "mnlt6",
|
|
38
|
-
children: [{ text: "Nadpis H1" }],
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
type: "h2",
|
|
42
|
-
id: "feu6s",
|
|
43
|
-
children: [{ text: "Nadpis H2" }],
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
type: "h3",
|
|
47
|
-
id: "i9cb4",
|
|
48
|
-
children: [{ text: "Nadpis H3" }],
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
type: "h4",
|
|
52
|
-
id: "967c7",
|
|
53
|
-
children: [{ text: "Nadpis H4" }],
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
type: "h5",
|
|
57
|
-
id: "4kyki",
|
|
58
|
-
children: [{ text: "Nadpis H5" }],
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
type: "h6",
|
|
62
|
-
id: "ximag",
|
|
63
|
-
children: [{ text: "Nadpis H6" }],
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
type: "paragraph",
|
|
67
|
-
id: "xnws3",
|
|
68
|
-
children: [
|
|
69
|
-
{ text: "Toto je odstavec. " },
|
|
70
|
-
{ type: "link", id: "j4bh1", url: "https://uxf.cz", target: "_blank", children: [{ text: "uxf.cz" }] },
|
|
71
|
-
{ text: " " },
|
|
72
|
-
{ text: "tučné ", bold: true },
|
|
73
|
-
{ text: "kurzíva ", italic: true },
|
|
74
|
-
{ text: "podtržení", underline: true },
|
|
75
|
-
{ text: " kód", code: true },
|
|
76
|
-
{ text: " " },
|
|
77
|
-
{ text: "zvýraznění", highlight: true },
|
|
78
|
-
],
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
type: "blockquote",
|
|
82
|
-
id: "imx33",
|
|
83
|
-
children: [{ text: "Toto je citace." }],
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
type: "ul",
|
|
87
|
-
id: "aq7rl",
|
|
88
|
-
children: [
|
|
89
|
-
{
|
|
90
|
-
type: "li",
|
|
91
|
-
id: "b8ljb",
|
|
92
|
-
children: [
|
|
93
|
-
{
|
|
94
|
-
type: "lic",
|
|
95
|
-
id: "az5v2",
|
|
96
|
-
children: [{ text: "Položka nečíslovaného seznamu" }],
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
type: "li",
|
|
102
|
-
id: "nq1e3",
|
|
103
|
-
children: [{ type: "lic", id: "dp5er", children: [{ text: "Druhá položka" }] }],
|
|
104
|
-
},
|
|
105
|
-
],
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
type: "ol",
|
|
109
|
-
id: "hioy1",
|
|
110
|
-
children: [
|
|
111
|
-
{
|
|
112
|
-
type: "li",
|
|
113
|
-
id: "wm2vd",
|
|
114
|
-
children: [{ type: "lic", id: "q5ynx", children: [{ text: "Položka číslovaného seznamu" }] }],
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
type: "li",
|
|
118
|
-
id: "5qjr0",
|
|
119
|
-
children: [{ type: "lic", id: "8u41x", children: [{ text: "Druhá položka" }] }],
|
|
120
|
-
},
|
|
121
|
-
],
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
type: "paragraph",
|
|
125
|
-
id: "9013p",
|
|
126
|
-
children: [
|
|
127
|
-
{
|
|
128
|
-
text: "Pokud vypneš nějaký plugin, zobrazení je nefunkční, ale v JSONu pořád je, protože je v initial values.",
|
|
129
|
-
},
|
|
130
|
-
],
|
|
131
|
-
},
|
|
132
|
-
];
|
|
133
|
-
function Playground() {
|
|
134
|
-
const [value, setValue] = (0, react_1.useState)(exports.initialValue);
|
|
135
|
-
const plugins = (0, wysiwyg_1.createPluginsWithUi)([
|
|
136
|
-
(0, wysiwyg_1.createHeadingsPluginWithUi)({ disabledLevels: [1] }),
|
|
137
|
-
(0, wysiwyg_1.createBoldPluginWithUi)(),
|
|
138
|
-
(0, wysiwyg_1.createImagePluginWithUi)({
|
|
139
|
-
uploadImage: async (file) => ({
|
|
140
|
-
id: 1,
|
|
141
|
-
name: URL.createObjectURL(file),
|
|
142
|
-
extension: ".ext",
|
|
143
|
-
namespace: "wysiwyg",
|
|
144
|
-
uuid: "this-should-be-some-random-uuid",
|
|
145
|
-
}),
|
|
146
|
-
getImageUrl: (file) => file.name,
|
|
147
|
-
}),
|
|
148
|
-
(0, wysiwyg_1.createHighlightPluginWithUi)("red"),
|
|
149
|
-
]);
|
|
150
|
-
const isMounted = (0, use_is_mounted_1.useIsMounted)();
|
|
151
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
152
|
-
react_1.default.createElement(wysiwyg_1.WysiwygEditor, { id: "editor", initialValue: exports.initialValue, onChange: setValue, plugins: plugins }),
|
|
153
|
-
react_1.default.createElement("div", { className: "relative mt-4" },
|
|
154
|
-
react_1.default.createElement("div", { "aria-hidden": "true", className: "absolute inset-0 flex items-center" },
|
|
155
|
-
react_1.default.createElement("div", { className: "w-full border-t border-gray-300" })),
|
|
156
|
-
react_1.default.createElement("div", { className: "relative flex justify-center" },
|
|
157
|
-
react_1.default.createElement("span", { className: "bg-white px-2 text-sm text-gray-500" }, "Value"))),
|
|
158
|
-
react_1.default.createElement(show_1.Show, { when: isMounted },
|
|
159
|
-
react_1.default.createElement("pre", null,
|
|
160
|
-
react_1.default.createElement("code", null, JSON.stringify(value, null, " "))))));
|
|
161
|
-
}
|
|
162
|
-
function SelectedPlugins() {
|
|
163
|
-
const _initialValues = [
|
|
164
|
-
{ type: "paragraph", id: "mnlt6", children: [{ text: "Použití pouze vybraných pluginů" }] },
|
|
165
|
-
];
|
|
166
|
-
const [value, setValue] = (0, react_1.useState)(_initialValues);
|
|
167
|
-
const plugins = (0, wysiwyg_1.createPluginsWithUi)([
|
|
168
|
-
(0, wysiwyg_1.createHeadingsPluginWithUi)({ disabledLevels: [1] }),
|
|
169
|
-
(0, wysiwyg_1.createBoldPluginWithUi)(),
|
|
170
|
-
(0, wysiwyg_1.createImagePluginWithUi)({
|
|
171
|
-
uploadImage: async (file) => ({
|
|
172
|
-
id: 1,
|
|
173
|
-
name: URL.createObjectURL(file),
|
|
174
|
-
extension: ".ext",
|
|
175
|
-
namespace: "wysiwyg",
|
|
176
|
-
uuid: "this-should-be-some-random-uuid",
|
|
177
|
-
}),
|
|
178
|
-
getImageUrl: (file) => file.name,
|
|
179
|
-
}),
|
|
180
|
-
(0, wysiwyg_1.createHighlightPluginWithUi)("red"),
|
|
181
|
-
]);
|
|
182
|
-
const isMounted = (0, use_is_mounted_1.useIsMounted)();
|
|
183
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
184
|
-
react_1.default.createElement(wysiwyg_1.WysiwygEditor, { id: "editor", initialValue: _initialValues, onChange: setValue, plugins: plugins }),
|
|
185
|
-
react_1.default.createElement("div", { className: "relative mt-4" },
|
|
186
|
-
react_1.default.createElement("div", { "aria-hidden": "true", className: "absolute inset-0 flex items-center" },
|
|
187
|
-
react_1.default.createElement("div", { className: "w-full border-t border-gray-300" })),
|
|
188
|
-
react_1.default.createElement("div", { className: "relative flex justify-center" },
|
|
189
|
-
react_1.default.createElement("span", { className: "bg-white px-2 text-sm text-gray-500" }, "Value"))),
|
|
190
|
-
react_1.default.createElement(show_1.Show, { when: isMounted },
|
|
191
|
-
react_1.default.createElement("pre", null,
|
|
192
|
-
react_1.default.createElement("code", null, JSON.stringify(value, null, " "))))));
|
|
193
|
-
}
|