@pie-lib/editable-html-tip-tap 3.1.3-next.20261109082044 → 3.1.3-next.20261109125924
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/dist/components/EditableHtml.js +163 -153
- package/dist/components/MenuBar.js +209 -205
- package/dist/components/TiptapContainer.js +71 -70
- package/dist/components/common/done-button.js +22 -19
- package/dist/extensions/inactive-caret.d.ts +15 -0
- package/dist/extensions/inactive-caret.js +45 -0
- package/dist/i18n/ar.d.ts +45 -0
- package/dist/i18n/ar.js +47 -0
- package/dist/i18n/cy.d.ts +45 -0
- package/dist/i18n/cy.js +47 -0
- package/dist/i18n/en-AU.d.ts +45 -0
- package/dist/i18n/en-AU.js +47 -0
- package/dist/i18n/en-GB.d.ts +45 -0
- package/dist/i18n/en-GB.js +47 -0
- package/dist/i18n/en-US.d.ts +50 -0
- package/dist/i18n/en-US.js +47 -0
- package/dist/i18n/es.d.ts +45 -0
- package/dist/i18n/es.js +47 -0
- package/dist/i18n/fr.d.ts +45 -0
- package/dist/i18n/fr.js +47 -0
- package/dist/i18n/index.d.ts +44 -0
- package/dist/i18n/index.js +67 -0
- package/dist/i18n/ja.d.ts +45 -0
- package/dist/i18n/ja.js +47 -0
- package/dist/i18n/ko.d.ts +45 -0
- package/dist/i18n/ko.js +47 -0
- package/dist/i18n/nl-NL.d.ts +45 -0
- package/dist/i18n/nl-NL.js +47 -0
- package/dist/i18n/pt.d.ts +45 -0
- package/dist/i18n/pt.js +47 -0
- package/dist/i18n/ro.d.ts +45 -0
- package/dist/i18n/ro.js +47 -0
- package/dist/i18n/sv.d.ts +45 -0
- package/dist/i18n/sv.js +47 -0
- package/dist/i18n/th-TH.d.ts +45 -0
- package/dist/i18n/th-TH.js +47 -0
- package/dist/i18n/zh.d.ts +45 -0
- package/dist/i18n/zh.js +47 -0
- package/package.json +6 -7
|
@@ -4,46 +4,47 @@ import { setPendingSaveFlush as n } from "../pending-save.js";
|
|
|
4
4
|
import r from "../extensions/extended-table.js";
|
|
5
5
|
import { ExtendedTableCell as i, ExtendedTableHeader as a } from "../extensions/extended-table-cell.js";
|
|
6
6
|
import { DivNode as ee } from "../extensions/div-node.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { InactiveCaret as te } from "../extensions/inactive-caret.js";
|
|
8
|
+
import { EnsureEmptyRootIsDiv as ne } from "../extensions/ensure-empty-root-div.js";
|
|
9
|
+
import { EnsureListItemContentIsDiv as re } from "../extensions/ensure-list-item-content-is-div.js";
|
|
10
|
+
import { DragInTheBlankNode as ie, ExplicitConstructedResponseNode as ae, InlineDropdownNode as oe, MathTemplatedNode as o, ResponseAreaExtension as se } from "../extensions/responseArea.js";
|
|
10
11
|
import { MathNode as ce } from "../extensions/math.js";
|
|
11
|
-
import { ImageUploadNode as le, uploadPastedImage as
|
|
12
|
-
import { Media as
|
|
13
|
-
import { CSSMark as
|
|
14
|
-
import { ExtendedListItem as
|
|
15
|
-
import { HeadingParagraph as
|
|
16
|
-
import { BlockDirection as
|
|
17
|
-
import { valueToSize as
|
|
18
|
-
import { contentLanguageChoices as
|
|
19
|
-
import
|
|
20
|
-
import { PLUGINS_MAP as
|
|
21
|
-
import { useCallback as
|
|
22
|
-
import { debounce as
|
|
23
|
-
import { elementLanguageAttributes as
|
|
24
|
-
import { EditorContent as
|
|
25
|
-
import { styled as
|
|
26
|
-
import
|
|
27
|
-
import { TextStyleKit as
|
|
28
|
-
import { CharacterCount as
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import { TableRow as
|
|
34
|
-
import { jsx as
|
|
12
|
+
import { ImageUploadNode as le, uploadPastedImage as ue } from "../extensions/image.js";
|
|
13
|
+
import { Media as de } from "../extensions/media.js";
|
|
14
|
+
import { CSSMark as fe } from "../extensions/css.js";
|
|
15
|
+
import { ExtendedListItem as pe } from "../extensions/extended-list-item.js";
|
|
16
|
+
import { HeadingParagraph as me } from "../extensions/heading-paragraph.js";
|
|
17
|
+
import { BlockDirection as he, ContentLanguage as ge } from "../extensions/text-direction.js";
|
|
18
|
+
import { valueToSize as s } from "../utils/size.js";
|
|
19
|
+
import { contentLanguageChoices as _e } from "../utils/content-languages.js";
|
|
20
|
+
import ve from "./TiptapContainer.js";
|
|
21
|
+
import { PLUGINS_MAP as ye, buildExtensions as be } from "../extensions/index.js";
|
|
22
|
+
import { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
23
|
+
import { debounce as p } from "@pie-element/shared-lodash";
|
|
24
|
+
import { elementLanguageAttributes as m, subscribeInterfaceLocale as xe } from "@pie-element/shared-i18n";
|
|
25
|
+
import { EditorContent as h, useEditor as Se, useEditorState as Ce } from "@tiptap/react";
|
|
26
|
+
import { styled as g } from "@mui/material/styles";
|
|
27
|
+
import we from "@tiptap/starter-kit";
|
|
28
|
+
import { TextStyleKit as Te } from "@tiptap/extension-text-style";
|
|
29
|
+
import { CharacterCount as Ee } from "@tiptap/extension-character-count";
|
|
30
|
+
import De from "@tiptap/extension-superscript";
|
|
31
|
+
import Oe from "@tiptap/extension-subscript";
|
|
32
|
+
import ke from "@tiptap/extension-text-align";
|
|
33
|
+
import Ae from "@tiptap/extension-placeholder";
|
|
34
|
+
import { TableRow as _ } from "@tiptap/extension-table-row";
|
|
35
|
+
import { jsx as v } from "react/jsx-runtime";
|
|
35
36
|
//#region src/components/EditableHtml.tsx
|
|
36
|
-
var
|
|
37
|
+
var y = {
|
|
37
38
|
position: "bottom",
|
|
38
39
|
alignment: "left",
|
|
39
40
|
alwaysVisible: !1,
|
|
40
41
|
showDone: !0,
|
|
41
42
|
doneOn: "blur"
|
|
42
|
-
},
|
|
43
|
+
}, b = {
|
|
43
44
|
options: {},
|
|
44
45
|
respAreaToolbar: () => {},
|
|
45
46
|
onHandleAreaChange: () => {}
|
|
46
|
-
},
|
|
47
|
+
}, x = [
|
|
47
48
|
"bold",
|
|
48
49
|
"italic",
|
|
49
50
|
"underline",
|
|
@@ -65,7 +66,7 @@ var b = {
|
|
|
65
66
|
"h3",
|
|
66
67
|
"undo",
|
|
67
68
|
"redo"
|
|
68
|
-
],
|
|
69
|
+
], S = {
|
|
69
70
|
bold: "bold",
|
|
70
71
|
italic: "italic",
|
|
71
72
|
underline: "underline",
|
|
@@ -76,7 +77,7 @@ var b = {
|
|
|
76
77
|
"numbered-list": "orderedList",
|
|
77
78
|
table: "table",
|
|
78
79
|
image: "image"
|
|
79
|
-
},
|
|
80
|
+
}, C = {
|
|
80
81
|
"--white": "#fff",
|
|
81
82
|
"--black": "#2e2b29",
|
|
82
83
|
"--black-contrast": "#110f0e",
|
|
@@ -95,7 +96,7 @@ var b = {
|
|
|
95
96
|
"--red": "#ff5c33",
|
|
96
97
|
"--red-light": "#ffebe5",
|
|
97
98
|
"--shadow": "0px 12px 33px 0px rgba(0, 0, 0, .06),\n 0px 3.618px 9.949px 0px rgba(0, 0, 0, .04)"
|
|
98
|
-
},
|
|
99
|
+
}, w = (e, t, n, r) => ({
|
|
99
100
|
role: "textbox",
|
|
100
101
|
"data-pie-editor": "true",
|
|
101
102
|
class: "mathjax_ignore",
|
|
@@ -104,40 +105,40 @@ var b = {
|
|
|
104
105
|
autocapitalize: e ? "on" : "off",
|
|
105
106
|
...t && { "aria-label": t },
|
|
106
107
|
...n && { "aria-labelledby": n },
|
|
107
|
-
...
|
|
108
|
-
}),
|
|
108
|
+
...m(r)
|
|
109
|
+
}), T = [
|
|
109
110
|
"aria-label",
|
|
110
111
|
"aria-labelledby",
|
|
111
112
|
"lang",
|
|
112
113
|
"dir"
|
|
113
|
-
],
|
|
114
|
-
let { showParagraphs:
|
|
115
|
-
|
|
114
|
+
], E = (e) => e._insertingImage || e._toolbarOpened || e.isActive("inline_dropdown") || e.isActive("explicit_constructed_response"), D = (h) => {
|
|
115
|
+
let { showParagraphs: g, separateParagraphs: D } = h.pluginProps || {}, [Me, O] = f([]), [Ne, k] = f(!1), { toolbarOpts: Pe } = h, A = c((e) => {
|
|
116
|
+
O((t) => {
|
|
116
117
|
let n = t.filter((t) => t.pos !== e);
|
|
117
|
-
return n.length === 0 &&
|
|
118
|
+
return n.length === 0 && k(!1), n;
|
|
118
119
|
});
|
|
119
|
-
}, [
|
|
120
|
-
...
|
|
121
|
-
...
|
|
122
|
-
}, M =
|
|
123
|
-
M.current = [...M.current.slice(-4), e],
|
|
124
|
-
}, P =
|
|
120
|
+
}, [O]), j = {
|
|
121
|
+
...y,
|
|
122
|
+
...Pe
|
|
123
|
+
}, M = d([]), N = (e) => {
|
|
124
|
+
M.current = [...M.current.slice(-4), e], h.onChange?.(e);
|
|
125
|
+
}, P = d(N);
|
|
125
126
|
P.current = N;
|
|
126
|
-
let F =
|
|
127
|
+
let F = c((e) => {
|
|
127
128
|
let t = e.getHTML();
|
|
128
|
-
|
|
129
|
+
h.markup !== t && P.current(t), j.doneOn === "blur" && h.onDone?.(t);
|
|
129
130
|
}, [
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
h.markup,
|
|
132
|
+
h.onChange,
|
|
133
|
+
h.onDone,
|
|
133
134
|
j.doneOn
|
|
134
|
-
]), I =
|
|
135
|
+
]), I = d(F);
|
|
135
136
|
I.current = F;
|
|
136
|
-
let { idleSaveDelay: L } =
|
|
137
|
-
e.isDestroyed || (!R.current && (e.view.composing ||
|
|
138
|
-
}, L) : null, [L]), B =
|
|
137
|
+
let { idleSaveDelay: L } = h, R = d(!1), z = u(() => L > 0 ? p((e) => {
|
|
138
|
+
e.isDestroyed || (!R.current && (e.view.composing || E(e)) ? B.current?.(e) : I.current(e));
|
|
139
|
+
}, L) : null, [L]), B = d(z);
|
|
139
140
|
B.current = z;
|
|
140
|
-
let V =
|
|
141
|
+
let V = c((e) => {
|
|
141
142
|
R.current = !0;
|
|
142
143
|
try {
|
|
143
144
|
e?.flush();
|
|
@@ -145,43 +146,43 @@ var b = {
|
|
|
145
146
|
R.current = !1;
|
|
146
147
|
}
|
|
147
148
|
}, []);
|
|
148
|
-
|
|
149
|
-
let
|
|
150
|
-
...
|
|
151
|
-
...
|
|
149
|
+
l(() => () => V(z), [z, V]);
|
|
150
|
+
let Fe = c(() => V(B.current), [V]), H = u(() => ({
|
|
151
|
+
...b,
|
|
152
|
+
...h.responseAreaProps,
|
|
152
153
|
onInlineDropdownToolbarClose: F
|
|
153
|
-
}), [
|
|
154
|
-
let { customPlugins: e, ...t } =
|
|
154
|
+
}), [h.responseAreaProps, F]), U = u(() => {
|
|
155
|
+
let { customPlugins: e, ...t } = h.pluginProps || {};
|
|
155
156
|
e ||= [];
|
|
156
|
-
let n = t.textDirection?.disabled === !1 || h
|
|
157
|
-
let n =
|
|
157
|
+
let n = t.textDirection?.disabled === !1 || m(h.language)?.dir === "rtl", r = [...h.activePlugins || x, ...n ? ["text-direction"] : []].filter((e) => {
|
|
158
|
+
let n = ye[e] || e, r = t[n] || {};
|
|
158
159
|
return !r || !r.disabled;
|
|
159
160
|
});
|
|
160
|
-
return
|
|
161
|
+
return be(r, e, {
|
|
161
162
|
math: {},
|
|
162
|
-
textAlign:
|
|
163
|
+
textAlign: h.textAlign,
|
|
163
164
|
html: {},
|
|
164
|
-
extraCSSRules:
|
|
165
|
-
image: { ...
|
|
165
|
+
extraCSSRules: h.extraCSSRules || {},
|
|
166
|
+
image: { ...h.imageSupport },
|
|
166
167
|
toolbar: {},
|
|
167
168
|
table: {},
|
|
168
169
|
responseArea: { type: H.type },
|
|
169
|
-
languageCharacters:
|
|
170
|
+
languageCharacters: h.languageCharactersProps,
|
|
170
171
|
keyPadCharacterRef: {},
|
|
171
172
|
setKeypadInteraction: {},
|
|
172
173
|
media: {}
|
|
173
174
|
});
|
|
174
|
-
}, [
|
|
175
|
+
}, [h, H.type]), W = d(null);
|
|
175
176
|
W.current = {
|
|
176
|
-
plainText:
|
|
177
|
-
formatting: U.map((e) =>
|
|
177
|
+
plainText: h.pluginProps?.pasteFormatting?.disabled === !0,
|
|
178
|
+
formatting: U.map((e) => S[e]).filter(Boolean)
|
|
178
179
|
};
|
|
179
|
-
let G =
|
|
180
|
-
G.current = h
|
|
181
|
-
let [
|
|
182
|
-
|
|
183
|
-
let
|
|
184
|
-
|
|
180
|
+
let G = d("ltr");
|
|
181
|
+
G.current = m(h.language)?.dir ?? "ltr";
|
|
182
|
+
let [K, Ie] = f(null), q = d(() => []);
|
|
183
|
+
q.current = () => _e(h.language, K);
|
|
184
|
+
let Le = [
|
|
185
|
+
ke.configure({
|
|
185
186
|
types: [
|
|
186
187
|
"heading",
|
|
187
188
|
"paragraph",
|
|
@@ -205,15 +206,15 @@ var b = {
|
|
|
205
206
|
"right"
|
|
206
207
|
]
|
|
207
208
|
}),
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
he.configure({ baseDirection: () => G.current }),
|
|
210
|
+
ge.configure({ languages: () => q.current() }),
|
|
211
|
+
Te,
|
|
211
212
|
e.configure({
|
|
212
213
|
settings: () => W.current,
|
|
213
|
-
uploadImage:
|
|
214
|
+
uploadImage: h.imageSupport && ue
|
|
214
215
|
}),
|
|
215
|
-
|
|
216
|
-
|
|
216
|
+
Ee.configure({ limit: h.charactersLimit || 1e6 }),
|
|
217
|
+
we.configure({
|
|
217
218
|
trailingNode: {
|
|
218
219
|
node: "paragraph",
|
|
219
220
|
notAfter: ["paragraph", "div"]
|
|
@@ -223,104 +224,105 @@ var b = {
|
|
|
223
224
|
linkOnPaste: !1
|
|
224
225
|
}
|
|
225
226
|
}),
|
|
226
|
-
|
|
227
|
+
pe,
|
|
227
228
|
ee,
|
|
228
|
-
|
|
229
|
-
te,
|
|
229
|
+
me,
|
|
230
230
|
ne,
|
|
231
|
-
|
|
232
|
-
|
|
231
|
+
re,
|
|
232
|
+
Ae.configure({
|
|
233
|
+
placeholder: h.placeholder,
|
|
233
234
|
showOnlyWhenEditable: !0,
|
|
234
235
|
showOnlyCurrent: !1,
|
|
235
236
|
includeChildren: !0
|
|
236
237
|
}),
|
|
238
|
+
te,
|
|
237
239
|
r,
|
|
238
|
-
|
|
240
|
+
_,
|
|
239
241
|
a,
|
|
240
242
|
i,
|
|
241
243
|
se.configure(H),
|
|
242
|
-
ie.configure(H),
|
|
243
|
-
re.configure(H),
|
|
244
244
|
ae.configure(H),
|
|
245
|
+
ie.configure(H),
|
|
245
246
|
oe.configure(H),
|
|
247
|
+
o.configure(H),
|
|
246
248
|
ce.configure({
|
|
247
249
|
toolbarOpts: j,
|
|
248
|
-
math:
|
|
249
|
-
mathMlOptions:
|
|
250
|
+
math: h.pluginProps?.math || {},
|
|
251
|
+
mathMlOptions: h.mathMlOptions || {}
|
|
250
252
|
}),
|
|
251
|
-
|
|
252
|
-
|
|
253
|
+
Oe,
|
|
254
|
+
De,
|
|
253
255
|
le.configure({
|
|
254
256
|
toolbarOpts: j,
|
|
255
257
|
imageHandling: {
|
|
256
|
-
disableImageAlignmentButtons:
|
|
257
|
-
onDone: (e) =>
|
|
258
|
-
onDelete:
|
|
258
|
+
disableImageAlignmentButtons: h.disableImageAlignmentButtons,
|
|
259
|
+
onDone: (e) => h.onDone?.(e.getHTML()),
|
|
260
|
+
onDelete: h.imageSupport && h.imageSupport.delete && ((e) => {
|
|
259
261
|
let { src: t } = e.attrs;
|
|
260
|
-
|
|
262
|
+
h.imageSupport.delete(t, (t) => {
|
|
261
263
|
A(e.pos);
|
|
262
264
|
});
|
|
263
265
|
}),
|
|
264
|
-
insertImageRequested:
|
|
266
|
+
insertImageRequested: h.imageSupport && ((e, t, n) => {
|
|
265
267
|
let [r, i] = t, a = (t) => {
|
|
266
268
|
let n;
|
|
267
|
-
|
|
269
|
+
Ne && t && (n = P.current), A(i), n?.(e.getHTML());
|
|
268
270
|
};
|
|
269
|
-
e._insertingImage = !0,
|
|
270
|
-
let t = n(a), r =
|
|
271
|
+
e._insertingImage = !0, O((e) => [...e, r]), (() => {
|
|
272
|
+
let t = n(a), r = p(() => {
|
|
271
273
|
e._insertingImage &&= (A(i), !1), window.removeEventListener("focus", r);
|
|
272
274
|
}, 500);
|
|
273
|
-
window.addEventListener("focus", r),
|
|
275
|
+
window.addEventListener("focus", r), h.imageSupport.add(t);
|
|
274
276
|
})();
|
|
275
277
|
}),
|
|
276
|
-
maxImageWidth:
|
|
277
|
-
maxImageHeight:
|
|
278
|
+
maxImageWidth: h.maxImageWidth,
|
|
279
|
+
maxImageHeight: h.maxImageHeight
|
|
278
280
|
},
|
|
279
281
|
limit: 3
|
|
280
282
|
}),
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
], J =
|
|
284
|
-
extensions:
|
|
283
|
+
de.configure({ uploadSoundSupport: h.uploadSoundSupport }),
|
|
284
|
+
fe.configure({ extraCSSRules: h.extraCSSRules })
|
|
285
|
+
], J = h.spellCheck !== !1, { ariaLabel: Y, ariaLabelledBy: X, language: Z } = h, Q = Se({
|
|
286
|
+
extensions: Le,
|
|
285
287
|
immediatelyRender: !1,
|
|
286
288
|
editorProps: {
|
|
287
|
-
attributes:
|
|
289
|
+
attributes: w(J, Y, X, Z),
|
|
288
290
|
handleKeyDown(e, t) {
|
|
289
|
-
return
|
|
291
|
+
return h.onKeyDown ? h.onKeyDown(t) : !1;
|
|
290
292
|
}
|
|
291
293
|
},
|
|
292
|
-
editable: !
|
|
293
|
-
content: t(
|
|
294
|
+
editable: !h.disabled,
|
|
295
|
+
content: t(h.markup),
|
|
294
296
|
onUpdate: ({ editor: e, transaction: t }) => {
|
|
295
|
-
t.isDone && P.current(e.getHTML()), t.docChanged && B.current && (B.current(e), n(e.view.dom,
|
|
297
|
+
t.isDone && P.current(e.getHTML()), t.docChanged && B.current && (B.current(e), n(e.view.dom, Fe));
|
|
296
298
|
},
|
|
297
299
|
onBlur: ({ editor: e }) => {
|
|
298
|
-
!
|
|
300
|
+
!E(e) && e.schema && (B.current?.cancel(), F(e));
|
|
299
301
|
}
|
|
300
302
|
}, [
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
303
|
+
h.charactersLimit,
|
|
304
|
+
h.mathMlOptions?.mmlEditing,
|
|
305
|
+
h.mathMlOptions?.mmlOutput
|
|
304
306
|
]);
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}, [
|
|
308
|
-
Q?.setEditable(!
|
|
309
|
-
}, [
|
|
307
|
+
l(() => {
|
|
308
|
+
h.editorRef && h.editorRef(Q);
|
|
309
|
+
}, [h.editorRef, Q]), l(() => {
|
|
310
|
+
Q?.setEditable(!h.disabled);
|
|
311
|
+
}, [h.disabled, Q]), l(() => {
|
|
310
312
|
let e;
|
|
311
313
|
try {
|
|
312
314
|
e = Q?.view?.dom;
|
|
313
315
|
} catch {
|
|
314
316
|
return;
|
|
315
317
|
}
|
|
316
|
-
return e ?
|
|
317
|
-
}, [Q]),
|
|
318
|
+
return e ? xe(e, (e) => Ie(e?.locale ?? null)) : void 0;
|
|
319
|
+
}, [Q]), l(() => {
|
|
318
320
|
Q?.on("destroy", () => V(B.current));
|
|
319
|
-
}, [Q, V]),
|
|
321
|
+
}, [Q, V]), l(() => {
|
|
320
322
|
if (!Q) return;
|
|
321
|
-
let e = Q.options?.editorProps, t = e?.attributes || {}, n =
|
|
322
|
-
if (["spellcheck", ...
|
|
323
|
-
let r = Object.fromEntries(Object.entries(t).filter(([e]) => !
|
|
323
|
+
let e = Q.options?.editorProps, t = e?.attributes || {}, n = w(J, Y, X, Z);
|
|
324
|
+
if (["spellcheck", ...T].every((e) => t[e] === n[e])) return;
|
|
325
|
+
let r = Object.fromEntries(Object.entries(t).filter(([e]) => !T.includes(e)));
|
|
324
326
|
Q.setOptions({ editorProps: {
|
|
325
327
|
...e,
|
|
326
328
|
attributes: {
|
|
@@ -334,50 +336,58 @@ var b = {
|
|
|
334
336
|
X,
|
|
335
337
|
Z,
|
|
336
338
|
Q
|
|
337
|
-
]),
|
|
338
|
-
if (!Q || M.current.includes(
|
|
339
|
+
]), l(() => {
|
|
340
|
+
if (!Q || M.current.includes(h.markup)) return;
|
|
339
341
|
M.current = [];
|
|
340
|
-
let e = t(
|
|
342
|
+
let e = t(h.markup);
|
|
341
343
|
e !== Q.getHTML() && Q.commands.setContent(e, { emitUpdate: !1 });
|
|
342
|
-
}, [
|
|
343
|
-
Object.entries(
|
|
344
|
+
}, [h.markup, Q]), l(() => {
|
|
345
|
+
Object.entries(C).forEach(([e, t]) => {
|
|
344
346
|
document.documentElement.style.setProperty(e, t);
|
|
345
347
|
});
|
|
346
348
|
}, []);
|
|
347
|
-
let
|
|
349
|
+
let Re = Ce({
|
|
348
350
|
editor: Q,
|
|
349
351
|
selector: (e) => ({ isFocused: e.editor?.isFocused })
|
|
350
|
-
}), $ =
|
|
351
|
-
let { minWidth: e, width: t, maxWidth: n, minHeight: r, height: i, maxHeight: a } =
|
|
352
|
+
}), $ = u(() => {
|
|
353
|
+
let { minWidth: e, width: t, maxWidth: n, minHeight: r, height: i, maxHeight: a } = h;
|
|
352
354
|
return {
|
|
353
|
-
width:
|
|
354
|
-
minWidth:
|
|
355
|
-
maxWidth:
|
|
356
|
-
height:
|
|
357
|
-
minHeight:
|
|
358
|
-
maxHeight:
|
|
355
|
+
width: s(t),
|
|
356
|
+
minWidth: s(e),
|
|
357
|
+
maxWidth: s(n),
|
|
358
|
+
height: s(i),
|
|
359
|
+
minHeight: s(r),
|
|
360
|
+
maxHeight: s(a)
|
|
359
361
|
};
|
|
360
|
-
}, [
|
|
361
|
-
return /* @__PURE__ */
|
|
362
|
-
...
|
|
362
|
+
}, [h]);
|
|
363
|
+
return /* @__PURE__ */ v(ve, {
|
|
364
|
+
...h,
|
|
363
365
|
activePlugins: U,
|
|
364
366
|
toolbarOpts: j,
|
|
365
|
-
|
|
367
|
+
language: K ?? h.language,
|
|
368
|
+
editorState: Re,
|
|
366
369
|
editor: Q,
|
|
367
|
-
children: Q && /* @__PURE__ */
|
|
370
|
+
children: Q && /* @__PURE__ */ v(je, {
|
|
368
371
|
style: {
|
|
369
372
|
minHeight: $.minHeight,
|
|
370
373
|
height: $.height,
|
|
371
374
|
maxHeight: $.maxHeight
|
|
372
375
|
},
|
|
373
|
-
showParagraph:
|
|
374
|
-
separateParagraph:
|
|
376
|
+
showParagraph: g && !g.disabled,
|
|
377
|
+
separateParagraph: D && !D.disabled,
|
|
375
378
|
editor: Q
|
|
376
379
|
})
|
|
377
380
|
});
|
|
378
|
-
},
|
|
381
|
+
}, je = g(h, { shouldForwardProp: (e) => !["showParagraph", "separateParagraph"].includes(e) })(({ showParagraph: e, separateParagraph: t }) => ({
|
|
379
382
|
display: "flex",
|
|
380
383
|
outline: "none !important",
|
|
384
|
+
position: "relative",
|
|
385
|
+
"& > .pie-inactive-caret": {
|
|
386
|
+
position: "absolute",
|
|
387
|
+
width: 0,
|
|
388
|
+
borderLeft: "1px solid currentColor",
|
|
389
|
+
pointerEvents: "none"
|
|
390
|
+
},
|
|
381
391
|
"& .ProseMirror": {
|
|
382
392
|
flex: 1,
|
|
383
393
|
padding: "5px",
|
|
@@ -405,4 +415,4 @@ var b = {
|
|
|
405
415
|
}
|
|
406
416
|
}));
|
|
407
417
|
//#endregion
|
|
408
|
-
export {
|
|
418
|
+
export { D as EditableHtml, D as default };
|