@pie-lib/editable-html-tip-tap 2.1.2-next.31 → 2.1.2-next.33
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/CharacterPicker.js +22 -12
- package/dist/components/EditableHtml.js +215 -181
- package/dist/components/MenuBar.js +135 -75
- package/dist/components/TiptapContainer.js +16 -3
- package/dist/components/common/done-button.js +1 -1
- package/dist/components/common/toolbar-buttons.js +23 -18
- package/dist/components/icons/TableIcons.js +2 -0
- package/dist/components/icons/TextAlign.js +10 -1
- package/dist/components/image/AltDialog.js +1 -1
- package/dist/components/image/ImageToolbar.js +2 -2
- package/dist/components/media/MediaDialog.js +1 -1
- package/dist/components/respArea/DragInTheBlank/DragInTheBlank.js +1 -1
- package/dist/components/respArea/DragInTheBlank/choice.js +3 -2
- package/dist/components/respArea/ExplicitConstructedResponse.js +40 -39
- package/dist/components/respArea/InlineDropdown.js +58 -51
- package/dist/components/respArea/MathTemplated.js +15 -14
- package/dist/components/respArea/inlineDropdownUtils.js +1 -1
- package/dist/extensions/css.js +8 -3
- package/dist/extensions/extended-table.js +1 -1
- package/dist/extensions/image-component.js +17 -12
- package/dist/extensions/math.js +131 -76
- package/dist/extensions/media.js +2 -2
- package/dist/extensions/responseArea.js +1 -5
- package/dist/index.js +1 -1
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +1 -1
- package/dist/utils/toolbar.d.ts +10 -0
- package/dist/utils/toolbar.js +7 -0
- package/package.json +13 -8
|
@@ -37,18 +37,28 @@ function h({ editor: l, opts: m, onClose: h }) {
|
|
|
37
37
|
w();
|
|
38
38
|
}, []), r(() => {
|
|
39
39
|
if (!l) return;
|
|
40
|
-
let e = l.options.element
|
|
41
|
-
|
|
42
|
-
top: i,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
40
|
+
let e = l.options.element, t = l.view.dom, n = () => {
|
|
41
|
+
if (!g.current) return;
|
|
42
|
+
let t = e.getBoundingClientRect(), { from: n } = l.state.selection, r = l.view.coordsAtPos(n), i = g.current.offsetHeight, a = g.current.offsetWidth, o = window.innerHeight - (t.bottom + 60) >= i || t.top < i + 80 ? t.bottom + 60 : t.top - i - 20, s = r.left;
|
|
43
|
+
o = Math.max(8, Math.min(o, window.innerHeight - i - 8)), s = Math.max(8, Math.min(s, window.innerWidth - a - 8)), y({
|
|
44
|
+
top: o,
|
|
45
|
+
left: s
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
n();
|
|
49
|
+
let r = null, i = () => {
|
|
50
|
+
r === null && (r = requestAnimationFrame(() => {
|
|
51
|
+
r = null, n();
|
|
52
|
+
}));
|
|
53
|
+
};
|
|
54
|
+
window.addEventListener("scroll", i, !0), window.addEventListener("resize", i);
|
|
55
|
+
let a = (e) => {
|
|
56
|
+
g.current && !g.current.contains(e.target) && !t.contains(e.target) && _.current();
|
|
57
|
+
}, o = setTimeout(() => {
|
|
58
|
+
document.addEventListener("click", a);
|
|
49
59
|
});
|
|
50
60
|
return () => {
|
|
51
|
-
clearTimeout(
|
|
61
|
+
clearTimeout(o), r !== null && cancelAnimationFrame(r), window.removeEventListener("scroll", i, !0), window.removeEventListener("resize", i), document.removeEventListener("click", a);
|
|
52
62
|
};
|
|
53
63
|
}, [l]);
|
|
54
64
|
let T = (e, t) => x({
|
|
@@ -61,11 +71,11 @@ function h({ editor: l, opts: m, onClose: h }) {
|
|
|
61
71
|
"data-toolbar-for": l.instanceId,
|
|
62
72
|
style: {
|
|
63
73
|
visibility: v.top === 0 && v.left === 0 ? "hidden" : "initial",
|
|
64
|
-
position: "
|
|
74
|
+
position: "fixed",
|
|
65
75
|
top: `${v.top}px`,
|
|
66
76
|
left: `${v.left}px`,
|
|
67
77
|
maxWidth: "500px",
|
|
68
|
-
zIndex:
|
|
78
|
+
zIndex: 1e3
|
|
69
79
|
},
|
|
70
80
|
children: /* @__PURE__ */ d("div", { children: /* @__PURE__ */ d(p, {
|
|
71
81
|
keyPadCharacterRef: m.keyPadCharacterRef,
|
|
@@ -4,38 +4,42 @@ import { ExtendedTableCell as n, ExtendedTableHeader as r } from "../extensions/
|
|
|
4
4
|
import { DivNode as i } from "../extensions/div-node.js";
|
|
5
5
|
import { EnsureEmptyRootIsDiv as a } from "../extensions/ensure-empty-root-div.js";
|
|
6
6
|
import { EnsureListItemContentIsDiv as o } from "../extensions/ensure-list-item-content-is-div.js";
|
|
7
|
-
import { DragInTheBlankNode as s, ExplicitConstructedResponseNode as c, InlineDropdownNode as l, MathTemplatedNode as u, ResponseAreaExtension as
|
|
8
|
-
import { MathNode as
|
|
9
|
-
import { ImageUploadNode as
|
|
10
|
-
import { Media as
|
|
11
|
-
import { CSSMark as
|
|
12
|
-
import { ExtendedListItem as
|
|
13
|
-
import { HeadingParagraph as
|
|
14
|
-
import { valueToSize as
|
|
15
|
-
import
|
|
16
|
-
import { PLUGINS_MAP as
|
|
17
|
-
import { useCallback as
|
|
18
|
-
import { debounce as
|
|
19
|
-
import { EditorContent as
|
|
20
|
-
import { styled as
|
|
21
|
-
import
|
|
22
|
-
import { TextStyleKit as
|
|
23
|
-
import { CharacterCount as
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import { TableRow as
|
|
30
|
-
import { jsx as
|
|
7
|
+
import { DragInTheBlankNode as s, ExplicitConstructedResponseNode as c, InlineDropdownNode as l, MathTemplatedNode as u, ResponseAreaExtension as ee } from "../extensions/responseArea.js";
|
|
8
|
+
import { MathNode as te } from "../extensions/math.js";
|
|
9
|
+
import { ImageUploadNode as d } from "../extensions/image.js";
|
|
10
|
+
import { Media as f } from "../extensions/media.js";
|
|
11
|
+
import { CSSMark as ne } from "../extensions/css.js";
|
|
12
|
+
import { ExtendedListItem as p } from "../extensions/extended-list-item.js";
|
|
13
|
+
import { HeadingParagraph as re } from "../extensions/heading-paragraph.js";
|
|
14
|
+
import { valueToSize as m } from "../utils/size.js";
|
|
15
|
+
import h from "./TiptapContainer.js";
|
|
16
|
+
import { PLUGINS_MAP as g, buildExtensions as _ } from "../extensions/index.js";
|
|
17
|
+
import { useCallback as v, useEffect as y, useMemo as b, useState as x } from "react";
|
|
18
|
+
import { debounce as S } from "@pie-element/shared-lodash";
|
|
19
|
+
import { EditorContent as C, useEditor as w, useEditorState as T } from "@tiptap/react";
|
|
20
|
+
import { styled as E } from "@mui/material/styles";
|
|
21
|
+
import D from "@tiptap/starter-kit";
|
|
22
|
+
import { TextStyleKit as O } from "@tiptap/extension-text-style";
|
|
23
|
+
import { CharacterCount as k } from "@tiptap/extension-character-count";
|
|
24
|
+
import A from "@tiptap/extension-superscript";
|
|
25
|
+
import j from "@tiptap/extension-subscript";
|
|
26
|
+
import M from "@tiptap/extension-text-align";
|
|
27
|
+
import N from "@tiptap/extension-image";
|
|
28
|
+
import P from "@tiptap/extension-placeholder";
|
|
29
|
+
import { TableRow as F } from "@tiptap/extension-table-row";
|
|
30
|
+
import { jsx as I } from "react/jsx-runtime";
|
|
31
31
|
//#region src/components/EditableHtml.tsx
|
|
32
|
-
var
|
|
32
|
+
var ie = {
|
|
33
33
|
position: "bottom",
|
|
34
34
|
alignment: "left",
|
|
35
35
|
alwaysVisible: !1,
|
|
36
36
|
showDone: !0,
|
|
37
37
|
doneOn: "blur"
|
|
38
|
-
},
|
|
38
|
+
}, L = {
|
|
39
|
+
options: {},
|
|
40
|
+
respAreaToolbar: () => {},
|
|
41
|
+
onHandleAreaChange: () => {}
|
|
42
|
+
}, R = [
|
|
39
43
|
"bold",
|
|
40
44
|
"italic",
|
|
41
45
|
"underline",
|
|
@@ -57,7 +61,7 @@ var z = {
|
|
|
57
61
|
"h3",
|
|
58
62
|
"undo",
|
|
59
63
|
"redo"
|
|
60
|
-
],
|
|
64
|
+
], z = {
|
|
61
65
|
"--white": "#fff",
|
|
62
66
|
"--black": "#2e2b29",
|
|
63
67
|
"--black-contrast": "#110f0e",
|
|
@@ -76,189 +80,219 @@ var z = {
|
|
|
76
80
|
"--red": "#ff5c33",
|
|
77
81
|
"--red-light": "#ffebe5",
|
|
78
82
|
"--shadow": "0px 12px 33px 0px rgba(0, 0, 0, .06),\n 0px 3.618px 9.949px 0px rgba(0, 0, 0, .04)"
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
|
|
83
|
+
}, B = (e) => ({
|
|
84
|
+
spellcheck: e ? "true" : "false",
|
|
85
|
+
autocorrect: e ? "on" : "off",
|
|
86
|
+
autocapitalize: e ? "on" : "off"
|
|
87
|
+
}), V = (C) => {
|
|
88
|
+
let { showParagraphs: E, separateParagraphs: V } = C.pluginProps || {}, [ae, U] = x([]), [W, G] = x(!1), { toolbarOpts: K } = C, q = v((e) => {
|
|
89
|
+
U((t) => {
|
|
82
90
|
let n = t.filter((t) => t.pos !== e);
|
|
83
|
-
return n.length === 0 &&
|
|
91
|
+
return n.length === 0 && G(!1), n;
|
|
84
92
|
});
|
|
85
|
-
}, [
|
|
86
|
-
...
|
|
87
|
-
...
|
|
88
|
-
},
|
|
89
|
-
let
|
|
93
|
+
}, [U]), J = {
|
|
94
|
+
...ie,
|
|
95
|
+
...K
|
|
96
|
+
}, Y = v((e) => {
|
|
97
|
+
let t = e.getHTML();
|
|
98
|
+
C.markup !== t && C.onChange?.(t), J.doneOn === "blur" && C.onDone?.(t);
|
|
99
|
+
}, [
|
|
100
|
+
C.markup,
|
|
101
|
+
C.onChange,
|
|
102
|
+
C.onDone,
|
|
103
|
+
J.doneOn
|
|
104
|
+
]), X = b(() => ({
|
|
105
|
+
...L,
|
|
106
|
+
...C.responseAreaProps,
|
|
107
|
+
onInlineDropdownToolbarClose: Y
|
|
108
|
+
}), [C.responseAreaProps, Y]), oe = b(() => {
|
|
109
|
+
let { customPlugins: e, ...t } = C.pluginProps || {};
|
|
90
110
|
e ||= [];
|
|
91
|
-
let n = (
|
|
92
|
-
let n =
|
|
93
|
-
return !
|
|
111
|
+
let n = (C.activePlugins || R)?.filter((e) => {
|
|
112
|
+
let n = g[e] || e, r = t[n] || {};
|
|
113
|
+
return !r || !r.disabled;
|
|
94
114
|
});
|
|
95
|
-
return
|
|
115
|
+
return _(n, e, {
|
|
96
116
|
math: {},
|
|
97
|
-
textAlign:
|
|
117
|
+
textAlign: C.textAlign,
|
|
98
118
|
html: {},
|
|
99
|
-
extraCSSRules:
|
|
100
|
-
image: { ...
|
|
119
|
+
extraCSSRules: C.extraCSSRules || {},
|
|
120
|
+
image: { ...C.imageSupport },
|
|
101
121
|
toolbar: {},
|
|
102
122
|
table: {},
|
|
103
|
-
responseArea: { type:
|
|
104
|
-
languageCharacters:
|
|
123
|
+
responseArea: { type: X.type },
|
|
124
|
+
languageCharacters: C.languageCharactersProps,
|
|
105
125
|
keyPadCharacterRef: {},
|
|
106
126
|
setKeypadInteraction: {},
|
|
107
127
|
media: {}
|
|
108
128
|
});
|
|
109
|
-
}, [
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
129
|
+
}, [C, X.type]), se = [
|
|
130
|
+
M.configure({
|
|
131
|
+
types: [
|
|
132
|
+
"heading",
|
|
133
|
+
"paragraph",
|
|
134
|
+
"div",
|
|
135
|
+
"headingParagraph",
|
|
136
|
+
"h1",
|
|
137
|
+
"h2",
|
|
138
|
+
"h3",
|
|
139
|
+
"h4",
|
|
140
|
+
"h5",
|
|
141
|
+
"h6",
|
|
142
|
+
"td",
|
|
143
|
+
"th"
|
|
144
|
+
],
|
|
145
|
+
alignments: [
|
|
146
|
+
"left",
|
|
147
|
+
"right",
|
|
148
|
+
"center",
|
|
149
|
+
"justify"
|
|
150
|
+
]
|
|
151
|
+
}),
|
|
152
|
+
O,
|
|
153
|
+
k.configure({ limit: C.charactersLimit || 1e6 }),
|
|
154
|
+
D.configure({
|
|
155
|
+
trailingNode: {
|
|
136
156
|
node: "paragraph",
|
|
137
157
|
notAfter: ["paragraph", "div"]
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
158
|
+
},
|
|
159
|
+
link: {
|
|
160
|
+
autolink: !1,
|
|
161
|
+
linkOnPaste: !1
|
|
162
|
+
}
|
|
163
|
+
}),
|
|
164
|
+
p,
|
|
165
|
+
i,
|
|
166
|
+
re,
|
|
167
|
+
a,
|
|
168
|
+
o,
|
|
169
|
+
P.configure({
|
|
170
|
+
placeholder: C.placeholder,
|
|
171
|
+
showOnlyWhenEditable: !0,
|
|
172
|
+
showOnlyCurrent: !1,
|
|
173
|
+
includeChildren: !0
|
|
174
|
+
}),
|
|
175
|
+
t,
|
|
176
|
+
F,
|
|
177
|
+
r,
|
|
178
|
+
n,
|
|
179
|
+
ee.configure(X),
|
|
180
|
+
c.configure(X),
|
|
181
|
+
s.configure(X),
|
|
182
|
+
l.configure(X),
|
|
183
|
+
u.configure(X),
|
|
184
|
+
te.configure({
|
|
185
|
+
toolbarOpts: J,
|
|
186
|
+
math: C.pluginProps?.math || {}
|
|
187
|
+
}),
|
|
188
|
+
j,
|
|
189
|
+
A,
|
|
190
|
+
N,
|
|
191
|
+
d.configure({
|
|
192
|
+
toolbarOpts: J,
|
|
193
|
+
imageHandling: {
|
|
194
|
+
disableImageAlignmentButtons: C.disableImageAlignmentButtons,
|
|
195
|
+
onDone: (e) => C.onDone?.(e.getHTML()),
|
|
196
|
+
onDelete: C.imageSupport && C.imageSupport.delete && ((e) => {
|
|
197
|
+
let { src: t } = e.attrs;
|
|
198
|
+
C.imageSupport.delete(t, (t) => {
|
|
199
|
+
q(e.pos);
|
|
200
|
+
});
|
|
201
|
+
}),
|
|
202
|
+
insertImageRequested: C.imageSupport && ((e, t, n) => {
|
|
203
|
+
let [r, i] = t, a = (t) => {
|
|
204
|
+
let n;
|
|
205
|
+
W && t && (n = C.onChange), q(i), n?.(e.getHTML());
|
|
206
|
+
};
|
|
207
|
+
e._insertingImage = !0, U((e) => [...e, r]), (() => {
|
|
208
|
+
let t = n(a), r = S(() => {
|
|
209
|
+
let t = () => window.removeEventListener("focus", r);
|
|
210
|
+
if (!e._insertingImage) {
|
|
211
|
+
t();
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
q(i), e._insertingImage = !1, t();
|
|
215
|
+
}, 500);
|
|
216
|
+
window.addEventListener("focus", r), C.imageSupport.add(t);
|
|
217
|
+
})();
|
|
218
|
+
}),
|
|
219
|
+
maxImageWidth: C.maxImageWidth,
|
|
220
|
+
maxImageHeight: C.maxImageHeight
|
|
221
|
+
},
|
|
222
|
+
limit: 3
|
|
223
|
+
}),
|
|
224
|
+
f.configure({ uploadSoundSupport: C.uploadSoundSupport }),
|
|
225
|
+
ne.configure({ extraCSSRules: C.extraCSSRules })
|
|
226
|
+
], Z = C.spellCheck !== !1, Q = w({
|
|
227
|
+
extensions: se,
|
|
202
228
|
immediatelyRender: !1,
|
|
203
|
-
editorProps: {
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
229
|
+
editorProps: {
|
|
230
|
+
attributes: B(Z),
|
|
231
|
+
handleKeyDown(e, t) {
|
|
232
|
+
return C.onKeyDown ? C.onKeyDown(t) : !1;
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
editable: !C.disabled,
|
|
236
|
+
content: e(C.markup),
|
|
208
237
|
onUpdate: ({ editor: e, transaction: t }) => {
|
|
209
|
-
t.isDone &&
|
|
238
|
+
t.isDone && C.onChange?.(e.getHTML());
|
|
210
239
|
},
|
|
211
240
|
onBlur: ({ editor: e }) => {
|
|
212
|
-
|
|
213
|
-
let t = e.getHTML();
|
|
214
|
-
E.markup !== t && E.onChange?.(t), Y.doneOn === "blur" && E.onDone?.(t);
|
|
241
|
+
e._insertingImage || e._toolbarOpened || e.isActive("inline_dropdown") || e.isActive("explicit_constructed_response") || !e.schema || Y(e);
|
|
215
242
|
}
|
|
216
|
-
}, [
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}, [
|
|
220
|
-
|
|
221
|
-
}, [
|
|
222
|
-
if (!
|
|
223
|
-
let t =
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
243
|
+
}, [C.charactersLimit]);
|
|
244
|
+
y(() => {
|
|
245
|
+
C.editorRef && C.editorRef(Q);
|
|
246
|
+
}, [C.editorRef, Q]), y(() => {
|
|
247
|
+
Q?.setEditable(!C.disabled);
|
|
248
|
+
}, [C.disabled, Q]), y(() => {
|
|
249
|
+
if (!Q) return;
|
|
250
|
+
let e = Q.options?.editorProps, t = B(Z);
|
|
251
|
+
e?.attributes?.spellcheck !== t.spellcheck && Q.setOptions({ editorProps: {
|
|
252
|
+
...e,
|
|
253
|
+
attributes: t
|
|
254
|
+
} });
|
|
255
|
+
}, [Z, Q]), y(() => {
|
|
256
|
+
if (!Q) return;
|
|
257
|
+
let t = e(C.markup);
|
|
258
|
+
t !== Q.getHTML() && Q.commands.setContent(t, { emitUpdate: !1 });
|
|
259
|
+
}, [C.markup, Q]), y(() => {
|
|
260
|
+
Object.entries(z).forEach(([e, t]) => {
|
|
227
261
|
document.documentElement.style.setProperty(e, t);
|
|
228
262
|
});
|
|
229
263
|
}, []);
|
|
230
|
-
let
|
|
231
|
-
editor:
|
|
264
|
+
let ce = T({
|
|
265
|
+
editor: Q,
|
|
232
266
|
selector: (e) => ({ isFocused: e.editor?.isFocused })
|
|
233
|
-
}), $ =
|
|
234
|
-
let { minWidth: e, width: t, maxWidth: n, minHeight: r, height: i, maxHeight: a } =
|
|
267
|
+
}), $ = b(() => {
|
|
268
|
+
let { minWidth: e, width: t, maxWidth: n, minHeight: r, height: i, maxHeight: a } = C;
|
|
235
269
|
return {
|
|
236
|
-
width:
|
|
237
|
-
minWidth:
|
|
238
|
-
maxWidth:
|
|
239
|
-
height:
|
|
240
|
-
minHeight:
|
|
241
|
-
maxHeight:
|
|
270
|
+
width: m(t),
|
|
271
|
+
minWidth: m(e),
|
|
272
|
+
maxWidth: m(n),
|
|
273
|
+
height: m(i),
|
|
274
|
+
minHeight: m(r),
|
|
275
|
+
maxHeight: m(a)
|
|
242
276
|
};
|
|
243
|
-
}, [
|
|
244
|
-
return /* @__PURE__ */
|
|
245
|
-
...
|
|
246
|
-
activePlugins:
|
|
247
|
-
toolbarOpts:
|
|
248
|
-
editorState:
|
|
249
|
-
editor:
|
|
250
|
-
children:
|
|
277
|
+
}, [C]);
|
|
278
|
+
return /* @__PURE__ */ I(h, {
|
|
279
|
+
...C,
|
|
280
|
+
activePlugins: oe,
|
|
281
|
+
toolbarOpts: J,
|
|
282
|
+
editorState: ce,
|
|
283
|
+
editor: Q,
|
|
284
|
+
children: Q && /* @__PURE__ */ I(H, {
|
|
251
285
|
style: {
|
|
252
286
|
minHeight: $.minHeight,
|
|
253
287
|
height: $.height,
|
|
254
288
|
maxHeight: $.maxHeight
|
|
255
289
|
},
|
|
256
|
-
showParagraph:
|
|
257
|
-
separateParagraph:
|
|
258
|
-
editor:
|
|
290
|
+
showParagraph: E && !E.disabled,
|
|
291
|
+
separateParagraph: V && !V.disabled,
|
|
292
|
+
editor: Q
|
|
259
293
|
})
|
|
260
294
|
});
|
|
261
|
-
},
|
|
295
|
+
}, H = E(C, { shouldForwardProp: (e) => !["showParagraph", "separateParagraph"].includes(e) })(({ showParagraph: e, separateParagraph: t }) => ({
|
|
262
296
|
display: "flex",
|
|
263
297
|
outline: "none !important",
|
|
264
298
|
"& .ProseMirror": {
|
|
@@ -268,8 +302,8 @@ var z = {
|
|
|
268
302
|
outline: "none !important",
|
|
269
303
|
position: "initial",
|
|
270
304
|
"& > p, & > div": { margin: "0" },
|
|
271
|
-
"& p.is-
|
|
272
|
-
"& p.is-
|
|
305
|
+
"& p[data-placeholder].is-empty:only-child, & div[data-placeholder].is-empty:only-child": { position: "relative" },
|
|
306
|
+
"& p[data-placeholder].is-empty:only-child::before, & div[data-placeholder].is-empty:only-child::before": {
|
|
273
307
|
content: "attr(data-placeholder)",
|
|
274
308
|
position: "absolute",
|
|
275
309
|
left: 0,
|
|
@@ -288,4 +322,4 @@ var z = {
|
|
|
288
322
|
}
|
|
289
323
|
}));
|
|
290
324
|
//#endregion
|
|
291
|
-
export {
|
|
325
|
+
export { V as EditableHtml, V as default };
|