@pie-lib/editable-html-tip-tap 3.1.3-next.20261109125924 → 3.1.3-next.20261110063142
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 +5 -6
- package/dist/components/EditableHtml.js +8 -9
- package/dist/components/MenuBar.js +57 -58
- package/dist/components/TiptapContainer.js +29 -30
- package/dist/components/ToolbarDisclosure.js +1 -2
- package/dist/components/characters/characterUtils.js +1 -2
- package/dist/components/characters/custom-popper.js +1 -2
- package/dist/components/common/done-button.js +1 -2
- package/dist/components/common/toolbar-buttons.js +1 -2
- package/dist/components/icons/CssIcon.js +1 -2
- package/dist/components/icons/RespArea.js +1 -2
- package/dist/components/icons/TableIcons.js +1 -2
- package/dist/components/icons/TextAlign.js +1 -2
- package/dist/components/image/AltDialog.js +1 -2
- package/dist/components/image/ImageToolbar.js +1 -2
- package/dist/components/image/InsertImageHandler.js +1 -2
- package/dist/components/image/findImageNode.js +1 -2
- package/dist/components/media/MediaDialog.js +1 -2
- package/dist/components/media/MediaToolbar.js +1 -2
- package/dist/components/respArea/DragInTheBlank/DragInTheBlank.js +1 -2
- package/dist/components/respArea/DragInTheBlank/choice.js +1 -2
- package/dist/components/respArea/ExplicitConstructedResponse.js +1 -2
- package/dist/components/respArea/InlineDropdown.js +8 -9
- package/dist/components/respArea/MathTemplated.js +1 -2
- package/dist/components/respArea/ToolbarIcon.js +1 -2
- package/dist/components/respArea/inlineDropdownUtils.js +1 -2
- package/dist/constants.js +1 -2
- package/dist/extensions/css.js +1 -2
- package/dist/extensions/custom-toolbar-wrapper.js +1 -2
- package/dist/extensions/div-node.js +1 -2
- package/dist/extensions/ensure-empty-root-div.js +1 -2
- package/dist/extensions/ensure-list-item-content-is-div.js +1 -2
- package/dist/extensions/extended-list-item.js +1 -2
- package/dist/extensions/extended-table-cell.js +1 -2
- package/dist/extensions/extended-table.js +1 -2
- package/dist/extensions/heading-paragraph.js +1 -2
- package/dist/extensions/image-component.js +11 -12
- package/dist/extensions/image.js +20 -21
- package/dist/extensions/inactive-caret.js +1 -2
- package/dist/extensions/index.js +1 -2
- package/dist/extensions/math.js +10 -11
- package/dist/extensions/media.js +1 -2
- package/dist/extensions/responseArea.js +1 -2
- package/dist/extensions/table-semantics.js +1 -2
- package/dist/extensions/text-direction.js +1 -2
- package/dist/external-paste.js +1 -2
- package/dist/i18n/ar.js +1 -2
- package/dist/i18n/cy.js +1 -2
- package/dist/i18n/en-AU.js +1 -2
- package/dist/i18n/en-GB.js +1 -2
- package/dist/i18n/en-US.js +1 -2
- package/dist/i18n/es.js +1 -2
- package/dist/i18n/fr.js +1 -2
- package/dist/i18n/index.js +1 -2
- package/dist/i18n/ja.js +1 -2
- package/dist/i18n/ko.js +1 -2
- package/dist/i18n/nl-NL.js +1 -2
- package/dist/i18n/pt.js +1 -2
- package/dist/i18n/ro.js +1 -2
- package/dist/i18n/sv.js +1 -2
- package/dist/i18n/th-TH.js +1 -2
- package/dist/i18n/zh.js +1 -2
- package/dist/index.js +6 -7
- package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js +1 -2
- package/dist/pending-save.js +1 -2
- package/dist/utils/content-languages.js +1 -2
- package/dist/utils/direction.js +1 -2
- package/dist/utils/focus.js +1 -2
- package/dist/utils/helper.js +1 -2
- package/dist/utils/size.js +1 -2
- package/dist/utils/toolbar.js +1 -2
- package/dist/word-lists.js +1 -2
- package/package.json +9 -9
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from "./characters/custom-popper.js";
|
|
2
2
|
import { arabicConfig as t, spanishConfig as n, specialConfig as r } from "./characters/characterUtils.js";
|
|
3
|
-
import i from "
|
|
3
|
+
import { returnFocusToText as i } from "../utils/focus.js";
|
|
4
4
|
import { useEffect as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
5
5
|
import { get as l } from "@pie-element/shared-lodash";
|
|
6
6
|
import u from "react-dom";
|
|
7
7
|
import d from "prop-types";
|
|
8
8
|
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
9
9
|
import { PureToolbar as h } from "@pie-lib/math-toolbar";
|
|
10
|
-
|
|
10
|
+
// src/components/CharacterPicker.tsx
|
|
11
11
|
var g = ({ letter: e }) => /* @__PURE__ */ p("div", {
|
|
12
12
|
style: {
|
|
13
13
|
fontSize: "24px",
|
|
@@ -38,7 +38,7 @@ function C({ editor: d, opts: g, onClose: v, triggerEl: y, focusOnOpen: x }) {
|
|
|
38
38
|
}), [D, O] = c(null);
|
|
39
39
|
w.current = v;
|
|
40
40
|
let k = () => {
|
|
41
|
-
|
|
41
|
+
i(d), w.current();
|
|
42
42
|
}, A = o(() => {
|
|
43
43
|
if (!g) return n;
|
|
44
44
|
switch (!0) {
|
|
@@ -168,7 +168,7 @@ function C({ editor: d, opts: g, onClose: v, triggerEl: y, focusOnOpen: x }) {
|
|
|
168
168
|
},
|
|
169
169
|
onDone: k
|
|
170
170
|
}) })
|
|
171
|
-
}), document.body), D && u.createPortal(/* @__PURE__ */ m(
|
|
171
|
+
}), document.body), D && u.createPortal(/* @__PURE__ */ m(e, {
|
|
172
172
|
onClose: M,
|
|
173
173
|
anchorEl: D.anchorEl,
|
|
174
174
|
children: [
|
|
@@ -197,5 +197,4 @@ C.propTypes = {
|
|
|
197
197
|
triggerEl: d.object,
|
|
198
198
|
focusOnOpen: d.bool
|
|
199
199
|
};
|
|
200
|
-
//#endregion
|
|
201
200
|
export { g as CharacterIcon, C as CharacterPicker };
|
|
@@ -15,10 +15,10 @@ import { CSSMark as fe } from "../extensions/css.js";
|
|
|
15
15
|
import { ExtendedListItem as pe } from "../extensions/extended-list-item.js";
|
|
16
16
|
import { HeadingParagraph as me } from "../extensions/heading-paragraph.js";
|
|
17
17
|
import { BlockDirection as he, ContentLanguage as ge } from "../extensions/text-direction.js";
|
|
18
|
+
import _e from "./TiptapContainer.js";
|
|
18
19
|
import { valueToSize as s } from "../utils/size.js";
|
|
19
|
-
import {
|
|
20
|
-
import
|
|
21
|
-
import { PLUGINS_MAP as ye, buildExtensions as be } from "../extensions/index.js";
|
|
20
|
+
import { PLUGINS_MAP as ve, buildExtensions as ye } from "../extensions/index.js";
|
|
21
|
+
import { contentLanguageChoices as be } from "../utils/content-languages.js";
|
|
22
22
|
import { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
|
|
23
23
|
import { debounce as p } from "@pie-element/shared-lodash";
|
|
24
24
|
import { elementLanguageAttributes as m, subscribeInterfaceLocale as xe } from "@pie-element/shared-i18n";
|
|
@@ -33,7 +33,7 @@ import ke from "@tiptap/extension-text-align";
|
|
|
33
33
|
import Ae from "@tiptap/extension-placeholder";
|
|
34
34
|
import { TableRow as _ } from "@tiptap/extension-table-row";
|
|
35
35
|
import { jsx as v } from "react/jsx-runtime";
|
|
36
|
-
|
|
36
|
+
// src/components/EditableHtml.tsx
|
|
37
37
|
var y = {
|
|
38
38
|
position: "bottom",
|
|
39
39
|
alignment: "left",
|
|
@@ -155,10 +155,10 @@ var y = {
|
|
|
155
155
|
let { customPlugins: e, ...t } = h.pluginProps || {};
|
|
156
156
|
e ||= [];
|
|
157
157
|
let n = t.textDirection?.disabled === !1 || m(h.language)?.dir === "rtl", r = [...h.activePlugins || x, ...n ? ["text-direction"] : []].filter((e) => {
|
|
158
|
-
let n =
|
|
158
|
+
let n = ve[e] || e, r = t[n] || {};
|
|
159
159
|
return !r || !r.disabled;
|
|
160
160
|
});
|
|
161
|
-
return
|
|
161
|
+
return ye(r, e, {
|
|
162
162
|
math: {},
|
|
163
163
|
textAlign: h.textAlign,
|
|
164
164
|
html: {},
|
|
@@ -180,7 +180,7 @@ var y = {
|
|
|
180
180
|
let G = d("ltr");
|
|
181
181
|
G.current = m(h.language)?.dir ?? "ltr";
|
|
182
182
|
let [K, Ie] = f(null), q = d(() => []);
|
|
183
|
-
q.current = () =>
|
|
183
|
+
q.current = () => be(h.language, K);
|
|
184
184
|
let Le = [
|
|
185
185
|
ke.configure({
|
|
186
186
|
types: [
|
|
@@ -360,7 +360,7 @@ var y = {
|
|
|
360
360
|
maxHeight: s(a)
|
|
361
361
|
};
|
|
362
362
|
}, [h]);
|
|
363
|
-
return /* @__PURE__ */ v(
|
|
363
|
+
return /* @__PURE__ */ v(_e, {
|
|
364
364
|
...h,
|
|
365
365
|
activePlugins: U,
|
|
366
366
|
toolbarOpts: j,
|
|
@@ -414,5 +414,4 @@ var y = {
|
|
|
414
414
|
...t && { "& > p:has(+ p)": { marginBottom: "1em" } }
|
|
415
415
|
}
|
|
416
416
|
}));
|
|
417
|
-
//#endregion
|
|
418
417
|
export { D as EditableHtml, D as default };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { clsx as e } from "../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
2
2
|
import { PIE_TOOLBAR__CLASS as t, TOOLBAR_BACKGROUND as n } from "../constants.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
3
|
+
import { ToolbarIcon as r } from "./respArea/ToolbarIcon.js";
|
|
4
|
+
import { logicalAlignment as i, selectionDirection as a } from "../extensions/text-direction.js";
|
|
5
|
+
import { writtenLanguage as o } from "../utils/content-languages.js";
|
|
6
|
+
import { returnFocusToText as s } from "../utils/focus.js";
|
|
7
|
+
import { arabicConfig as c, spanishConfig as ee, specialConfig as te } from "./characters/characterUtils.js";
|
|
8
|
+
import ne from "./icons/TextAlign.js";
|
|
9
|
+
import re from "./ToolbarDisclosure.js";
|
|
10
|
+
import l from "./icons/CssIcon.js";
|
|
11
|
+
import { AddColumn as ie, AddRow as ae, RemoveColumn as oe, RemoveRow as se, RemoveTable as ce } from "./icons/TableIcons.js";
|
|
12
|
+
import { CharacterIcon as u, CharacterPicker as le } from "./CharacterPicker.js";
|
|
13
|
+
import { DoneButton as d } from "./common/done-button.js";
|
|
14
|
+
import { TOOLBAR_ATTRIBUTE as ue } from "../extensions/inactive-caret.js";
|
|
15
|
+
import { catalogs as de } from "../i18n/index.js";
|
|
16
16
|
import fe, { useEffect as f, useLayoutEffect as pe, useMemo as me, useReducer as he, useRef as ge, useState as p } from "react";
|
|
17
17
|
import { dynamicMessageKey as _e } from "@pie-element/shared-i18n";
|
|
18
18
|
import { useEditorState as ve } from "@tiptap/react";
|
|
@@ -41,7 +41,7 @@ import Se from "@mui/icons-material/BorderAll";
|
|
|
41
41
|
import Ce from "@mui/icons-material/FormatTextdirectionLToR";
|
|
42
42
|
import we from "@mui/icons-material/FormatTextdirectionRToL";
|
|
43
43
|
import Te from "@mui/icons-material/Translate";
|
|
44
|
-
|
|
44
|
+
// src/components/MenuBar.tsx
|
|
45
45
|
var Ee = () => /* @__PURE__ */ _("svg", {
|
|
46
46
|
xmlns: "http://www.w3.org/2000/svg",
|
|
47
47
|
height: "24px",
|
|
@@ -87,7 +87,7 @@ function F({ editor: n, classes: m, activePlugins: h, toolbarOpts: g, responseAr
|
|
|
87
87
|
let [B, V] = p(!1), [H, ke] = p({
|
|
88
88
|
el: null,
|
|
89
89
|
keyboard: !1
|
|
90
|
-
}), [U, W] = p(!1), [Ae, je] = he((e) => e + 1, 0), G =
|
|
90
|
+
}), [U, W] = p(!1), [Ae, je] = he((e) => e + 1, 0), G = de.forLocale(z, je), K = ge(null), q = (e, t) => {
|
|
91
91
|
ke({
|
|
92
92
|
el: t?.currentTarget ?? null,
|
|
93
93
|
keyboard: t?.detail === 0
|
|
@@ -98,11 +98,11 @@ function F({ editor: n, classes: m, activePlugins: h, toolbarOpts: g, responseAr
|
|
|
98
98
|
let { selection: t } = e.editor?.state || {}, n;
|
|
99
99
|
if (!e.editor?.commandManager) return {};
|
|
100
100
|
t instanceof ye && (n = t.node);
|
|
101
|
-
let r = e.editor?.isActive("math") || e.editor?.isActive("explicit_constructed_response") || e.editor?.isActive("imageUploadNode") || e.editor?.isActive("drag_in_the_blank"),
|
|
101
|
+
let r = e.editor?.isActive("math") || e.editor?.isActive("explicit_constructed_response") || e.editor?.isActive("imageUploadNode") || e.editor?.isActive("drag_in_the_blank"), o = t && t.empty === !1 && e.editor.isActive("table"), s = a(e.editor);
|
|
102
102
|
return {
|
|
103
103
|
currentNode: n,
|
|
104
104
|
hideDefaultToolbar: r,
|
|
105
|
-
hasTextSelectionInTable:
|
|
105
|
+
hasTextSelectionInTable: o,
|
|
106
106
|
toolbarOpened: e.editor?._toolbarOpened ?? !1,
|
|
107
107
|
isBold: e.editor.isActive("bold") ?? !1,
|
|
108
108
|
canBold: e.editor.can().chain().toggleBold().run() ?? !1,
|
|
@@ -133,9 +133,9 @@ function F({ editor: n, classes: m, activePlugins: h, toolbarOpts: g, responseAr
|
|
|
133
133
|
isBlockquote: e.editor.isActive("blockquote") ?? !1,
|
|
134
134
|
canUndo: e.editor.can().chain().undo().run() ?? !1,
|
|
135
135
|
canRedo: e.editor.can().chain().redo().run() ?? !1,
|
|
136
|
-
dir:
|
|
137
|
-
dirPinned:
|
|
138
|
-
alignment:
|
|
136
|
+
dir: s.rendered,
|
|
137
|
+
dirPinned: s.pinned,
|
|
138
|
+
alignment: i(s.textAlign, s.rendered),
|
|
139
139
|
contentLanguage: e.editor.getAttributes("contentLanguage")?.lang ?? null
|
|
140
140
|
};
|
|
141
141
|
}
|
|
@@ -151,7 +151,7 @@ function F({ editor: n, classes: m, activePlugins: h, toolbarOpts: g, responseAr
|
|
|
151
151
|
}, [U, n]), pe(() => {
|
|
152
152
|
K.current?.toggleAttribute("inert", !Q);
|
|
153
153
|
}, [Q]);
|
|
154
|
-
let Me =
|
|
154
|
+
let Me = e(m.toolbar, t, {
|
|
155
155
|
[m.toolbarWithNoDone]: !0,
|
|
156
156
|
[m.toolbarTop]: J.position === "top",
|
|
157
157
|
[m.toolbarRight]: J.alignment === "right",
|
|
@@ -162,7 +162,7 @@ function F({ editor: n, classes: m, activePlugins: h, toolbarOpts: g, responseAr
|
|
|
162
162
|
}), Ne = J.minWidth === void 0 ? {} : { minWidth: J.minWidth }, Pe = (e) => {
|
|
163
163
|
if (e.key === "Escape") {
|
|
164
164
|
if (e.defaultPrevented || !e.currentTarget.contains(e.target)) return;
|
|
165
|
-
e.preventDefault(), e.stopPropagation(),
|
|
165
|
+
e.preventDefault(), e.stopPropagation(), s(n), V(!1);
|
|
166
166
|
return;
|
|
167
167
|
}
|
|
168
168
|
let t = y(e.key, e.currentTarget);
|
|
@@ -187,7 +187,7 @@ function F({ editor: n, classes: m, activePlugins: h, toolbarOpts: g, responseAr
|
|
|
187
187
|
isDisabled: (e) => !e.canTable
|
|
188
188
|
},
|
|
189
189
|
{
|
|
190
|
-
icon: /* @__PURE__ */ _(
|
|
190
|
+
icon: /* @__PURE__ */ _(ae, {}),
|
|
191
191
|
label: $("addTableRow"),
|
|
192
192
|
onClick: (e) => e.chain().focus().addRowAfter().run(),
|
|
193
193
|
hidden: (e) => !(e.isTable && !e.hasTextSelectionInTable),
|
|
@@ -195,7 +195,7 @@ function F({ editor: n, classes: m, activePlugins: h, toolbarOpts: g, responseAr
|
|
|
195
195
|
isDisabled: (e) => !e.canTable
|
|
196
196
|
},
|
|
197
197
|
{
|
|
198
|
-
icon: /* @__PURE__ */ _(
|
|
198
|
+
icon: /* @__PURE__ */ _(se, {}),
|
|
199
199
|
label: $("removeTableRow"),
|
|
200
200
|
onClick: (e) => e.chain().focus().deleteRow().run(),
|
|
201
201
|
hidden: (e) => !(e.isTable && !e.hasTextSelectionInTable),
|
|
@@ -203,7 +203,7 @@ function F({ editor: n, classes: m, activePlugins: h, toolbarOpts: g, responseAr
|
|
|
203
203
|
isDisabled: (e) => !e.canTable
|
|
204
204
|
},
|
|
205
205
|
{
|
|
206
|
-
icon: /* @__PURE__ */ _(
|
|
206
|
+
icon: /* @__PURE__ */ _(ie, {}),
|
|
207
207
|
label: $("addTableColumn"),
|
|
208
208
|
onClick: (e) => e.chain().focus().addColumnAfter().run(),
|
|
209
209
|
hidden: (e) => !(e.isTable && !e.hasTextSelectionInTable),
|
|
@@ -211,7 +211,7 @@ function F({ editor: n, classes: m, activePlugins: h, toolbarOpts: g, responseAr
|
|
|
211
211
|
isDisabled: (e) => !e.canTable
|
|
212
212
|
},
|
|
213
213
|
{
|
|
214
|
-
icon: /* @__PURE__ */ _(
|
|
214
|
+
icon: /* @__PURE__ */ _(oe, {}),
|
|
215
215
|
label: $("removeTableColumn"),
|
|
216
216
|
onClick: (e) => e.chain().focus().deleteColumn().run(),
|
|
217
217
|
hidden: (e) => !(e.isTable && !e.hasTextSelectionInTable),
|
|
@@ -219,7 +219,7 @@ function F({ editor: n, classes: m, activePlugins: h, toolbarOpts: g, responseAr
|
|
|
219
219
|
isDisabled: (e) => !e.canTable
|
|
220
220
|
},
|
|
221
221
|
{
|
|
222
|
-
icon: /* @__PURE__ */ _(
|
|
222
|
+
icon: /* @__PURE__ */ _(ce, {}),
|
|
223
223
|
label: $("removeTable"),
|
|
224
224
|
onClick: (e) => e.chain().focus().deleteTable().run(),
|
|
225
225
|
hidden: (e) => !(e.isTable && !e.hasTextSelectionInTable),
|
|
@@ -323,7 +323,7 @@ function F({ editor: n, classes: m, activePlugins: h, toolbarOpts: g, responseAr
|
|
|
323
323
|
}).run()
|
|
324
324
|
},
|
|
325
325
|
{
|
|
326
|
-
icon: /* @__PURE__ */ _(
|
|
326
|
+
icon: /* @__PURE__ */ _(l, {}),
|
|
327
327
|
label: $("cssClasses"),
|
|
328
328
|
hidden: () => !h?.includes("css"),
|
|
329
329
|
onClick: (e) => e.commands.openCSSClassDialog()
|
|
@@ -351,26 +351,26 @@ function F({ editor: n, classes: m, activePlugins: h, toolbarOpts: g, responseAr
|
|
|
351
351
|
onClick: (e) => e.chain().focus().insertMath("").run()
|
|
352
352
|
},
|
|
353
353
|
{
|
|
354
|
-
icon: /* @__PURE__ */ _(
|
|
354
|
+
icon: /* @__PURE__ */ _(u, { letter: "ñ" }),
|
|
355
355
|
label: $("spanishCharacters"),
|
|
356
356
|
hidden: () => !h?.includes("languageCharacters"),
|
|
357
|
-
onClick: (e, t) => q(
|
|
357
|
+
onClick: (e, t) => q(ee, t)
|
|
358
358
|
},
|
|
359
359
|
{
|
|
360
|
-
icon: /* @__PURE__ */ _(
|
|
360
|
+
icon: /* @__PURE__ */ _(u, { letter: "€" }),
|
|
361
361
|
label: $("specialCharacters"),
|
|
362
362
|
hidden: () => h?.filter((e) => e === "languageCharacters").length !== 2,
|
|
363
|
-
onClick: (e, t) => q(
|
|
363
|
+
onClick: (e, t) => q(te, t)
|
|
364
364
|
},
|
|
365
365
|
{
|
|
366
|
-
icon: /* @__PURE__ */ _(
|
|
366
|
+
icon: /* @__PURE__ */ _(u, { letter: "ع" }),
|
|
367
367
|
label: $("arabicCharacters"),
|
|
368
368
|
hidden: () => !h?.includes("arabicCharacters"),
|
|
369
|
-
onClick: (e, t) => q(
|
|
369
|
+
onClick: (e, t) => q(c, t)
|
|
370
370
|
},
|
|
371
371
|
{
|
|
372
372
|
hidden: () => !h?.includes("text-align"),
|
|
373
|
-
render: (e) => /* @__PURE__ */ _(
|
|
373
|
+
render: (e) => /* @__PURE__ */ _(ne, {
|
|
374
374
|
editor: n,
|
|
375
375
|
alignment: e.alignment,
|
|
376
376
|
direction: e.dir,
|
|
@@ -393,7 +393,7 @@ function F({ editor: n, classes: m, activePlugins: h, toolbarOpts: g, responseAr
|
|
|
393
393
|
toggle: !0,
|
|
394
394
|
hidden: () => !h?.includes("text-direction"),
|
|
395
395
|
onClick: (t) => {
|
|
396
|
-
let { rendered: n, pinned: r } =
|
|
396
|
+
let { rendered: n, pinned: r } = a(t), i = t.chain().focus();
|
|
397
397
|
(n === e && r ? i.unsetBlockDirection() : i.setBlockDirection(e)).run();
|
|
398
398
|
},
|
|
399
399
|
isActive: (t) => t.dir === e
|
|
@@ -401,8 +401,8 @@ function F({ editor: n, classes: m, activePlugins: h, toolbarOpts: g, responseAr
|
|
|
401
401
|
{
|
|
402
402
|
hidden: (e) => P(n).length < 2 && !e.contentLanguage,
|
|
403
403
|
render: (e) => {
|
|
404
|
-
let t = e.contentLanguage &&
|
|
405
|
-
return /* @__PURE__ */ _(
|
|
404
|
+
let t = e.contentLanguage && o(e.contentLanguage), r = P(n), i = r.some(({ value: e }) => o(e) === t);
|
|
405
|
+
return /* @__PURE__ */ _(re, {
|
|
406
406
|
editor: n,
|
|
407
407
|
label: $("contentLanguage"),
|
|
408
408
|
trigger: /* @__PURE__ */ _(Te, {}),
|
|
@@ -412,7 +412,7 @@ function F({ editor: n, classes: m, activePlugins: h, toolbarOpts: g, responseAr
|
|
|
412
412
|
}] : [], ...r].map(({ value: e, label: n }) => ({
|
|
413
413
|
key: e,
|
|
414
414
|
label: n,
|
|
415
|
-
pressed:
|
|
415
|
+
pressed: o(e) === t
|
|
416
416
|
})).concat(t ? [{
|
|
417
417
|
key: "",
|
|
418
418
|
label: $("removeContentLanguage")
|
|
@@ -464,7 +464,7 @@ function F({ editor: n, classes: m, activePlugins: h, toolbarOpts: g, responseAr
|
|
|
464
464
|
className: Me,
|
|
465
465
|
style: { ...Ne },
|
|
466
466
|
onMouseDown: Fe,
|
|
467
|
-
[
|
|
467
|
+
[ue]: "",
|
|
468
468
|
children: [
|
|
469
469
|
Z && /* @__PURE__ */ _("div", {
|
|
470
470
|
className: m.defaultToolbar,
|
|
@@ -494,21 +494,21 @@ function F({ editor: n, classes: m, activePlugins: h, toolbarOpts: g, responseAr
|
|
|
494
494
|
children: [
|
|
495
495
|
/* @__PURE__ */ _("div", {
|
|
496
496
|
className: m.buttonsContainer,
|
|
497
|
-
children: Ie.filter((e) => !e.hidden?.(Y)).map((
|
|
498
|
-
if (
|
|
499
|
-
let
|
|
497
|
+
children: Ie.filter((e) => !e.hidden?.(Y)).map((t, r) => {
|
|
498
|
+
if (t.render) return /* @__PURE__ */ _(fe.Fragment, { children: t.render(Y) }, r);
|
|
499
|
+
let i = t.isDisabled?.(Y), a = t.isActive?.(Y);
|
|
500
500
|
return /* @__PURE__ */ _("button", {
|
|
501
501
|
type: "button",
|
|
502
|
-
disabled:
|
|
503
|
-
"aria-label":
|
|
504
|
-
title:
|
|
505
|
-
"aria-pressed":
|
|
506
|
-
onClick: (
|
|
507
|
-
|
|
502
|
+
disabled: i,
|
|
503
|
+
"aria-label": t.label,
|
|
504
|
+
title: t.label,
|
|
505
|
+
"aria-pressed": t.toggle ? !!a : void 0,
|
|
506
|
+
onClick: (e) => {
|
|
507
|
+
e.preventDefault(), t.onClick(n, e);
|
|
508
508
|
},
|
|
509
|
-
className:
|
|
510
|
-
children:
|
|
511
|
-
},
|
|
509
|
+
className: e(m.button, { [m.active]: a }),
|
|
510
|
+
children: t.icon
|
|
511
|
+
}, r);
|
|
512
512
|
})
|
|
513
513
|
}),
|
|
514
514
|
h?.includes("responseArea") && /* @__PURE__ */ _("button", {
|
|
@@ -519,17 +519,17 @@ function F({ editor: n, classes: m, activePlugins: h, toolbarOpts: g, responseAr
|
|
|
519
519
|
n.chain().focus().insertResponseArea(F.type).run();
|
|
520
520
|
},
|
|
521
521
|
className: m.button,
|
|
522
|
-
children: /* @__PURE__ */ _(
|
|
522
|
+
children: /* @__PURE__ */ _(r, {})
|
|
523
523
|
}),
|
|
524
|
-
J.showDone && /* @__PURE__ */ _(
|
|
524
|
+
J.showDone && /* @__PURE__ */ _(d, {
|
|
525
525
|
language: z,
|
|
526
526
|
onClick: (e) => {
|
|
527
|
-
I?.(n.getHTML()), e.detail === 0 ? (
|
|
527
|
+
I?.(n.getHTML()), e.detail === 0 ? (s(n), W(!0)) : n.commands.blur();
|
|
528
528
|
}
|
|
529
529
|
})
|
|
530
530
|
]
|
|
531
531
|
}),
|
|
532
|
-
B && /* @__PURE__ */ _(
|
|
532
|
+
B && /* @__PURE__ */ _(le, {
|
|
533
533
|
editor: n,
|
|
534
534
|
triggerEl: H.el,
|
|
535
535
|
focusOnOpen: H.keyboard,
|
|
@@ -677,5 +677,4 @@ var I = (e) => {
|
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
679
|
}));
|
|
680
|
-
//#endregion
|
|
681
680
|
export { I as default };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import r from "
|
|
1
|
+
import { valueToSize as e } from "../utils/size.js";
|
|
2
|
+
import t from "./MenuBar.js";
|
|
3
|
+
import { TOOLBAR_ATTRIBUTE as n, setInactiveCaret as r } from "../extensions/inactive-caret.js";
|
|
4
4
|
import { useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
|
|
5
5
|
import { styled as c } from "@mui/material/styles";
|
|
6
6
|
import { color as l } from "@pie-lib/render-ui";
|
|
7
7
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
8
|
-
|
|
9
|
-
var f = (
|
|
8
|
+
// src/components/TiptapContainer.tsx
|
|
9
|
+
var f = (e) => !!e?.closest?.(`[${n}]`), p = c("div", { shouldForwardProp: (e) => !["noBorder", "error"].includes(e) })(({ theme: e, noBorder: t, error: n }) => ({
|
|
10
10
|
position: "relative",
|
|
11
11
|
padding: "0px",
|
|
12
12
|
border: t ? "none" : `1px solid ${l.borderDark()}`,
|
|
@@ -95,8 +95,8 @@ var f = (t) => !!t?.closest?.(`[${e}]`), p = c("div", { shouldForwardProp: (e) =
|
|
|
95
95
|
"-ms-overflow-style": "none"
|
|
96
96
|
}
|
|
97
97
|
})), h = c("div", { shouldForwardProp: (e) => e !== "noPadding" })(({ noPadding: e }) => ({ padding: e ? 0 : "10px 8px" }));
|
|
98
|
-
function g(
|
|
99
|
-
let [c, l] = s(null), [g, _] = s(!1), v = o(null), { editor: y, disabled: b, children: x, disableScrollbar: S, activePlugins: C, toolbarOpts: w, responseAreaProps: T, autoFocus: E, minWidth: D, width: O, maxWidth: k, minHeight: A, height: j, maxHeight: M, highlightShape: N, ref: P } =
|
|
98
|
+
function g(n) {
|
|
99
|
+
let [c, l] = s(null), [g, _] = s(!1), v = o(null), { editor: y, disabled: b, children: x, disableScrollbar: S, activePlugins: C, toolbarOpts: w, responseAreaProps: T, autoFocus: E, minWidth: D, width: O, maxWidth: k, minHeight: A, height: j, maxHeight: M, highlightShape: N, ref: P } = n;
|
|
100
100
|
i(() => {
|
|
101
101
|
y && v.current && (y._tiptapContainerEl = v.current);
|
|
102
102
|
}, [y, v.current]), i(() => {
|
|
@@ -104,10 +104,10 @@ function g(e) {
|
|
|
104
104
|
y.commands.focus("end");
|
|
105
105
|
});
|
|
106
106
|
}, [y, E]), i(() => {
|
|
107
|
-
if (
|
|
108
|
-
let
|
|
109
|
-
|
|
110
|
-
let
|
|
107
|
+
if (n.adjustWidthForLimit) {
|
|
108
|
+
let e = document.createElement("p");
|
|
109
|
+
e.style.visibility = "hidden", e.style.position = "absolute", e.style.whiteSpace = "nowrap", e.textContent = "W".repeat(n.charactersLimit);
|
|
110
|
+
let t = window.getComputedStyle(v.current);
|
|
111
111
|
[
|
|
112
112
|
"fontFamily",
|
|
113
113
|
"fontSize",
|
|
@@ -117,18 +117,18 @@ function g(e) {
|
|
|
117
117
|
"wordSpacing",
|
|
118
118
|
"textTransform",
|
|
119
119
|
"lineHeight"
|
|
120
|
-
].forEach((
|
|
121
|
-
|
|
122
|
-
}), document.body.appendChild(
|
|
120
|
+
].forEach((n) => {
|
|
121
|
+
e.style[n] = t[n];
|
|
122
|
+
}), document.body.appendChild(e), l(`${e.offsetWidth + 27}px`), e.remove();
|
|
123
123
|
}
|
|
124
|
-
}, [
|
|
124
|
+
}, [n.adjustWidthForLimit, n.charactersLimit]);
|
|
125
125
|
let F = a(() => ({
|
|
126
|
-
width:
|
|
127
|
-
minWidth:
|
|
128
|
-
maxWidth:
|
|
129
|
-
height:
|
|
130
|
-
minHeight:
|
|
131
|
-
maxHeight:
|
|
126
|
+
width: e(c || O),
|
|
127
|
+
minWidth: e(D),
|
|
128
|
+
maxWidth: e(k),
|
|
129
|
+
height: e(j),
|
|
130
|
+
minHeight: e(A),
|
|
131
|
+
maxHeight: e(M)
|
|
132
132
|
}), [
|
|
133
133
|
c,
|
|
134
134
|
D,
|
|
@@ -141,7 +141,7 @@ function g(e) {
|
|
|
141
141
|
return /* @__PURE__ */ d(p, {
|
|
142
142
|
noBorder: w && w.noBorder,
|
|
143
143
|
error: w && w.error,
|
|
144
|
-
className:
|
|
144
|
+
className: n.className,
|
|
145
145
|
style: {
|
|
146
146
|
width: F.width,
|
|
147
147
|
minWidth: F.minWidth,
|
|
@@ -149,11 +149,11 @@ function g(e) {
|
|
|
149
149
|
},
|
|
150
150
|
ref: v,
|
|
151
151
|
onFocus: (e) => {
|
|
152
|
-
e.currentTarget.contains(e.target) && (_(!0),
|
|
152
|
+
e.currentTarget.contains(e.target) && (_(!0), r(y, f(e.target)));
|
|
153
153
|
},
|
|
154
154
|
onBlur: (e) => {
|
|
155
|
-
let
|
|
156
|
-
!e.currentTarget.contains(e.relatedTarget) && !
|
|
155
|
+
let t = e.relatedTarget?.closest?.(`.insert-character-dialog[data-toolbar-for="${y?.instanceId}"]`);
|
|
156
|
+
!e.currentTarget.contains(e.relatedTarget) && !t && _(!1), r(y, f(e.relatedTarget) && e.currentTarget.contains(e.relatedTarget));
|
|
157
157
|
},
|
|
158
158
|
children: [/* @__PURE__ */ u(m, {
|
|
159
159
|
disableScrollbar: S,
|
|
@@ -162,17 +162,16 @@ function g(e) {
|
|
|
162
162
|
noPadding: w && w.noPadding,
|
|
163
163
|
children: x
|
|
164
164
|
})
|
|
165
|
-
}), y && /* @__PURE__ */ u(
|
|
165
|
+
}), y && /* @__PURE__ */ u(t, {
|
|
166
166
|
editor: y,
|
|
167
167
|
responseAreaProps: T,
|
|
168
168
|
toolbarOpts: w,
|
|
169
169
|
activePlugins: C,
|
|
170
|
-
onChange:
|
|
171
|
-
autoWidthToolbar:
|
|
170
|
+
onChange: n.onChange,
|
|
171
|
+
autoWidthToolbar: n.autoWidthToolbar,
|
|
172
172
|
hasFocus: g,
|
|
173
|
-
language:
|
|
173
|
+
language: n.language
|
|
174
174
|
})]
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
|
-
//#endregion
|
|
178
177
|
export { g as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { clsx as e } from "../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
|
|
2
2
|
import { useEffect as t, useId as n, useRef as r, useState as i } from "react";
|
|
3
3
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/components/ToolbarDisclosure.tsx
|
|
5
5
|
function s({ editor: s, label: c, trigger: l, options: u, onSelect: d, className: f, list: p = !1 }) {
|
|
6
6
|
let [m, h] = i(!1), g = r(!1), _ = r(null), v = r(null), y = n();
|
|
7
7
|
return t(() => {
|
|
@@ -59,5 +59,4 @@ function s({ editor: s, label: c, trigger: l, options: u, onSelect: d, className
|
|
|
59
59
|
})]
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
//#endregion
|
|
63
62
|
export { s as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/components/characters/characterUtils.ts
|
|
2
2
|
var e = { characters: [
|
|
3
3
|
[
|
|
4
4
|
"á",
|
|
@@ -647,5 +647,4 @@ var e = { characters: [
|
|
|
647
647
|
]
|
|
648
648
|
]
|
|
649
649
|
};
|
|
650
|
-
//#endregion
|
|
651
650
|
export { n as arabicConfig, e as spanishConfig, t as specialConfig };
|
|
@@ -3,7 +3,7 @@ import { styled as e } from "@mui/material/styles";
|
|
|
3
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
4
|
import n from "@mui/material/Typography";
|
|
5
5
|
import r from "@mui/material/Popper";
|
|
6
|
-
|
|
6
|
+
// src/components/characters/custom-popper.tsx
|
|
7
7
|
var i = e(r)({
|
|
8
8
|
background: "#fff",
|
|
9
9
|
padding: "10px",
|
|
@@ -28,5 +28,4 @@ var i = e(r)({
|
|
|
28
28
|
...n,
|
|
29
29
|
children: /* @__PURE__ */ t(a, { children: e })
|
|
30
30
|
});
|
|
31
|
-
//#endregion
|
|
32
31
|
export { o as default };
|
|
@@ -6,7 +6,7 @@ import { color as i } from "@pie-lib/render-ui";
|
|
|
6
6
|
import a from "@mui/material/IconButton";
|
|
7
7
|
import o from "@mui/icons-material/Check";
|
|
8
8
|
import { jsx as s } from "react/jsx-runtime";
|
|
9
|
-
|
|
9
|
+
// src/components/common/done-button.tsx
|
|
10
10
|
var c = n(a)({
|
|
11
11
|
verticalAlign: "top",
|
|
12
12
|
width: "28px",
|
|
@@ -28,5 +28,4 @@ l.propTypes = {
|
|
|
28
28
|
language: r.string
|
|
29
29
|
};
|
|
30
30
|
var u = l;
|
|
31
|
-
//#endregion
|
|
32
31
|
export { u as DoneButton, l as RawDoneButton };
|
|
@@ -4,7 +4,7 @@ import n from "prop-types";
|
|
|
4
4
|
import { color as r } from "@pie-lib/render-ui";
|
|
5
5
|
import { jsx as i } from "react/jsx-runtime";
|
|
6
6
|
import a from "debug";
|
|
7
|
-
|
|
7
|
+
// src/components/common/toolbar-buttons.tsx
|
|
8
8
|
var o = t("button", { shouldForwardProp: (e) => ![
|
|
9
9
|
"active",
|
|
10
10
|
"disabled",
|
|
@@ -92,5 +92,4 @@ var c = class extends e.Component {
|
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
}, l = c;
|
|
95
|
-
//#endregion
|
|
96
95
|
export { l as MarkButton, c as RawMarkButton };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react";
|
|
2
2
|
import { styled as e } from "@mui/material/styles";
|
|
3
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/components/icons/CssIcon.tsx
|
|
5
5
|
var n = e("div")(({ theme: e }) => ({
|
|
6
6
|
fontFamily: "Cerebri Sans, Arial, sans-serif",
|
|
7
7
|
fontSize: e.typography.fontSize,
|
|
@@ -10,5 +10,4 @@ var n = e("div")(({ theme: e }) => ({
|
|
|
10
10
|
position: "relative",
|
|
11
11
|
whiteSpace: "nowrap"
|
|
12
12
|
})), r = () => /* @__PURE__ */ t(n, { children: "CSS" });
|
|
13
|
-
//#endregion
|
|
14
13
|
export { r as default };
|
|
@@ -4,7 +4,7 @@ import t from "prop-types";
|
|
|
4
4
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
5
|
import i from "@mui/icons-material/ChevronRight";
|
|
6
6
|
import a from "@mui/icons-material/MoreVert";
|
|
7
|
-
|
|
7
|
+
// src/components/icons/RespArea.tsx
|
|
8
8
|
var o = (e) => {
|
|
9
9
|
switch (e) {
|
|
10
10
|
case "down": return 90;
|
|
@@ -38,5 +38,4 @@ c.propTypes = { style: t.object }, e("div")(({ theme: e }) => ({
|
|
|
38
38
|
height: "28px",
|
|
39
39
|
whiteSpace: "nowrap"
|
|
40
40
|
}));
|
|
41
|
-
//#endregion
|
|
42
41
|
export { s as Chevron, c as GripIcon };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "react";
|
|
2
2
|
import { styled as e } from "@mui/material/styles";
|
|
3
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/components/icons/TableIcons.tsx
|
|
5
5
|
var n = e("path")({
|
|
6
6
|
fill: "grey",
|
|
7
7
|
"&:hover": { fill: "black" }
|
|
@@ -30,5 +30,4 @@ var n = e("path")({
|
|
|
30
30
|
...e,
|
|
31
31
|
d: "M15.46,15.88L16.88,14.46L19,16.59L21.12,14.46L22.54,15.88L20.41,18L22.54,20.12L21.12,21.54L19,19.41L16.88,21.54L15.46,20.12L17.59,18L15.46,15.88M4,3H18A2,2 0 0,1 20,5V12.08C18.45,11.82 16.92,12.18 15.68,13H12V17H13.08C12.97,17.68 12.97,18.35 13.08,19H4A2,2 0 0,1 2,17V5A2,2 0 0,1 4,3M4,7V11H10V7H4M12,7V11H18V7H12M4,13V17H10V13H4Z"
|
|
32
32
|
}));
|
|
33
|
-
//#endregion
|
|
34
33
|
export { o as AddColumn, i as AddRow, s as RemoveColumn, a as RemoveRow, c as RemoveTable };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "../ToolbarDisclosure.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/components/icons/TextAlign.tsx
|
|
5
5
|
var n = () => /* @__PURE__ */ t("svg", {
|
|
6
6
|
width: "20",
|
|
7
7
|
height: "20",
|
|
@@ -79,5 +79,4 @@ function c({ editor: n, alignment: r, direction: i, label: a, alignmentLabel: c,
|
|
|
79
79
|
className: l
|
|
80
80
|
});
|
|
81
81
|
}
|
|
82
|
-
//#endregion
|
|
83
82
|
export { o as ALIGNMENTS, i as AlignCenter, a as AlignJustify, n as AlignLeft, r as AlignRight, c as default };
|
|
@@ -7,7 +7,7 @@ import o from "@mui/material/TextField";
|
|
|
7
7
|
import s from "@mui/material/DialogActions";
|
|
8
8
|
import c from "@mui/material/Button";
|
|
9
9
|
import l from "@mui/material/Dialog";
|
|
10
|
-
|
|
10
|
+
// src/components/image/AltDialog.tsx
|
|
11
11
|
var u = class extends e.Component {
|
|
12
12
|
static propTypes = {
|
|
13
13
|
onDone: t.func.isRequired,
|
|
@@ -48,5 +48,4 @@ var u = class extends e.Component {
|
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
|
-
//#endregion
|
|
52
51
|
export { u as AltDialog, u as default };
|