@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.
@@ -10,6 +10,8 @@ var o = () => /* @__PURE__ */ t("svg", {
10
10
  viewBox: "0 0 66 66",
11
11
  fill: "none",
12
12
  xmlns: "http://www.w3.org/2000/svg",
13
+ "aria-hidden": "true",
14
+ focusable: "false",
13
15
  children: /* @__PURE__ */ t("path", {
14
16
  d: "M42.1875 4.75C42.1875 7.38672 39.9902 9.4375 37.5 9.4375H4.6875C2.05078 9.4375 0 7.38672 0 4.75C0 2.25977 2.05078 0.0625 4.6875 0.0625H37.5C39.9902 0.0625 42.1875 2.25977 42.1875 4.75ZM42.1875 42.25C42.1875 44.8867 39.9902 46.9375 37.5 46.9375H4.6875C2.05078 46.9375 0 44.8867 0 42.25C0 39.7598 2.05078 37.5625 4.6875 37.5625H37.5C39.9902 37.5625 42.1875 39.7598 42.1875 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z",
15
17
  fill: "currentColor"
@@ -20,6 +22,8 @@ var o = () => /* @__PURE__ */ t("svg", {
20
22
  viewBox: "0 0 66 66",
21
23
  fill: "none",
22
24
  xmlns: "http://www.w3.org/2000/svg",
25
+ "aria-hidden": "true",
26
+ focusable: "false",
23
27
  children: /* @__PURE__ */ t("path", {
24
28
  d: "M65.625 4.75C65.625 7.38672 63.4277 9.4375 60.9375 9.4375H28.125C25.4883 9.4375 23.4375 7.38672 23.4375 4.75C23.4375 2.25977 25.4883 0.0625 28.125 0.0625H60.9375C63.4277 0.0625 65.625 2.25977 65.625 4.75ZM65.625 42.25C65.625 44.8867 63.4277 46.9375 60.9375 46.9375H28.125C25.4883 46.9375 23.4375 44.8867 23.4375 42.25C23.4375 39.7598 25.4883 37.5625 28.125 37.5625H60.9375C63.4277 37.5625 65.625 39.7598 65.625 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z",
25
29
  fill: "currentColor"
@@ -30,6 +34,8 @@ var o = () => /* @__PURE__ */ t("svg", {
30
34
  viewBox: "0 0 66 66",
31
35
  fill: "none",
32
36
  xmlns: "http://www.w3.org/2000/svg",
37
+ "aria-hidden": "true",
38
+ focusable: "false",
33
39
  children: /* @__PURE__ */ t("path", {
34
40
  d: "M51.5625 4.75C51.5625 7.38672 49.3652 9.4375 46.875 9.4375H18.75C16.1133 9.4375 14.0625 7.38672 14.0625 4.75C14.0625 2.25977 16.1133 0.0625 18.75 0.0625H46.875C49.3652 0.0625 51.5625 2.25977 51.5625 4.75ZM65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5ZM0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61ZM51.5625 42.25C51.5625 44.8867 49.3652 46.9375 46.875 46.9375H18.75C16.1133 46.9375 14.0625 44.8867 14.0625 42.25C14.0625 39.7598 16.1133 37.5625 18.75 37.5625H46.875C49.3652 37.5625 51.5625 39.7598 51.5625 42.25Z",
35
41
  fill: "currentColor"
@@ -40,6 +46,8 @@ var o = () => /* @__PURE__ */ t("svg", {
40
46
  viewBox: "0 0 66 66",
41
47
  fill: "none",
42
48
  xmlns: "http://www.w3.org/2000/svg",
49
+ "aria-hidden": "true",
50
+ focusable: "false",
43
51
  children: /* @__PURE__ */ t("path", {
44
52
  d: "M65.625 4.75C65.625 7.38672 63.4277 9.4375 60.9375 9.4375H4.6875C2.05078 9.4375 0 7.38672 0 4.75C0 2.25977 2.05078 0.0625 4.6875 0.0625H60.9375C63.4277 0.0625 65.625 2.25977 65.625 4.75ZM65.625 42.25C65.625 44.8867 63.4277 46.9375 60.9375 46.9375H4.6875C2.05078 46.9375 0 44.8867 0 42.25C0 39.7598 2.05078 37.5625 4.6875 37.5625H60.9375C63.4277 37.5625 65.625 39.7598 65.625 42.25ZM0 23.5C0 21.0098 2.05078 18.8125 4.6875 18.8125H60.9375C63.4277 18.8125 65.625 21.0098 65.625 23.5C65.625 26.1367 63.4277 28.1875 60.9375 28.1875H4.6875C2.05078 28.1875 0 26.1367 0 23.5ZM65.625 61C65.625 63.6367 63.4277 65.6875 60.9375 65.6875H4.6875C2.05078 65.6875 0 63.6367 0 61C0 58.5098 2.05078 56.3125 4.6875 56.3125H60.9375C63.4277 56.3125 65.625 58.5098 65.625 61Z",
45
53
  fill: "currentColor"
@@ -77,6 +85,7 @@ var o = () => /* @__PURE__ */ t("svg", {
77
85
  marginLeft: "5px",
78
86
  fontSize: "8px"
79
87
  },
88
+ "aria-hidden": "true",
80
89
  children: "▼"
81
90
  })]
82
91
  }), /* @__PURE__ */ t(a, {
@@ -131,4 +140,4 @@ var o = () => /* @__PURE__ */ t("svg", {
131
140
  })] });
132
141
  };
133
142
  //#endregion
134
- export { u as default };
143
+ export { c as AlignCenter, l as AlignJustify, o as AlignLeft, s as AlignRight, u as default };
@@ -58,4 +58,4 @@ var u = class extends e.Component {
58
58
  }
59
59
  };
60
60
  //#endregion
61
- export { u as default };
61
+ export { u as AltDialog, u as default };
@@ -1,4 +1,4 @@
1
- import e from "./AltDialog.js";
1
+ import { AltDialog as e } from "./AltDialog.js";
2
2
  import { MarkButton as t } from "../common/toolbar-buttons.js";
3
3
  import n from "react";
4
4
  import { styled as r } from "@mui/material/styles";
@@ -77,4 +77,4 @@ var m = class extends n.Component {
77
77
  }
78
78
  };
79
79
  //#endregion
80
- export { m as default };
80
+ export { m as ImageToolbar, m as default };
@@ -386,4 +386,4 @@ var y = c("@pie-lib:editable-html:plugins:media:dialog"), b = (e) => {
386
386
  }
387
387
  };
388
388
  //#endregion
389
- export { P as default };
389
+ export { P as MediaDialog, P as default };
@@ -55,4 +55,4 @@ s.propTypes = {
55
55
  opts: r.object
56
56
  };
57
57
  //#endregion
58
- export { s as default };
58
+ export { s as default, o as onRemoveResponse, a as onValueChange };
@@ -1,4 +1,4 @@
1
- import e from "../../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
1
+ import { clsx as e } from "../../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
2
2
  import { GripIcon as t } from "../../icons/RespArea.js";
3
3
  import { useEffect as n, useRef as r, useState as i } from "react";
4
4
  import { styled as a } from "@mui/material/styles";
@@ -10,6 +10,7 @@ import { renderMath as f } from "@pie-element/shared-math-rendering-mathjax";
10
10
  //#region src/components/respArea/DragInTheBlank/choice.tsx
11
11
  var p = a("span")(({ theme: e }) => ({
12
12
  border: `solid 0px ${e.palette.primary.main}`,
13
+ "& mjx-mn:has(~ mjx-mfrac), mjx-mfrac ~ mjx-mn": { fontSize: "120% !important" },
13
14
  "& mjx-frac": { fontSize: "120% !important" }
14
15
  }));
15
16
  function m({ n: e, children: a, isDragging: o, isOver: l, dragItem: u, value: p, selected: m }) {
@@ -153,4 +154,4 @@ h.propTypes = {
153
154
  selected: o.bool
154
155
  };
155
156
  //#endregion
156
- export { h as default };
157
+ export { m as BlankContent, h as default };
@@ -1,62 +1,63 @@
1
1
  import e from "../../extensions/custom-toolbar-wrapper.js";
2
- import t, { useEffect as n, useRef as r, useState as i } from "react";
3
- import { NodeViewWrapper as a } from "@tiptap/react";
4
- import o from "react-dom";
5
- import s from "prop-types";
6
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
2
+ import { setToolbarOpened as t } from "../../utils/toolbar.js";
3
+ import n, { useEffect as r, useRef as i, useState as a } from "react";
4
+ import { NodeViewWrapper as o } from "@tiptap/react";
5
+ import s from "react-dom";
6
+ import c from "prop-types";
7
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
7
8
  //#region src/components/respArea/ExplicitConstructedResponse.tsx
8
- var u = (s) => {
9
- let { editor: u, node: d, getPos: f, options: p, selected: m } = s, { attrs: h } = d, { value: g } = h, { respAreaToolbar: _, error: v } = p, y = f(), [b, x] = i(!1), S = _([d, y], u, () => {}), C = r(null), w;
10
- if (v) {
11
- let e = v(), t = parseInt(h.index, 10);
12
- w = !!e?.[t]?.[0];
9
+ var d = (c) => {
10
+ let { editor: d, node: f, getPos: p, options: m, selected: h } = c, { attrs: g } = f, { value: _ } = g, { respAreaToolbar: v, error: y } = m, b = p(), [x, S] = a(!1), C = v([f, b], d, () => {}), w = i(null), T;
11
+ if (y) {
12
+ let e = y(), t = parseInt(g.index, 10);
13
+ T = !!e?.[t]?.[0];
13
14
  }
14
- return n(() => {
15
- let { selection: e } = u.state, t = e.from + d.nodeSize === e.to;
16
- m ? t && x(m) : x(m);
15
+ return r(() => {
16
+ let { selection: e } = d.state, t = e.from + f.nodeSize === e.to;
17
+ h ? t && S(h) : S(h);
17
18
  }, [
18
- u,
19
19
  d,
20
- m
21
- ]), n(() => {
20
+ f,
21
+ h
22
+ ]), r(() => {
22
23
  let e = (e) => {
23
- !(e.target.closest(".insert-character-dialog") || e.target.closest("[data-toolbar-for]")) && C.current && !C.current.contains(e.target) && !e.target.closest("[data-inline-node]") && x(!1);
24
+ !(e.target.closest(".insert-character-dialog") || e.target.closest("[data-toolbar-for]")) && w.current && !w.current.contains(e.target) && !e.target.closest("[data-inline-node]") && S(!1);
24
25
  };
25
- return b ? document.addEventListener("mousedown", e) : document.removeEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
26
- }, [b]), /* @__PURE__ */ l(a, {
26
+ return x ? document.addEventListener("mousedown", e) : document.removeEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
27
+ }, [x]), /* @__PURE__ */ u(o, {
27
28
  className: "drag-in-the-blank",
28
- "data-selected": m,
29
+ "data-selected": h,
29
30
  style: {
30
31
  display: "inline-flex",
31
32
  minHeight: "55px",
32
33
  position: "relative",
33
34
  cursor: "pointer"
34
35
  },
35
- children: [/* @__PURE__ */ c("div", {
36
- ...h,
36
+ children: [/* @__PURE__ */ l("div", {
37
+ ...g,
37
38
  style: {
38
39
  display: "inline-flex",
39
40
  width: "100%",
40
41
  minHeight: "46px",
41
42
  height: "46px",
42
43
  backgroundColor: "#FFF",
43
- border: `1px solid ${w ? "red" : "#C0C3CF"}`,
44
+ border: `1px solid ${T ? "red" : "#C0C3CF"}`,
44
45
  boxSizing: "border-box",
45
46
  borderRadius: "4px",
46
47
  overflow: "hidden",
47
48
  padding: "12px 21px",
48
49
  margin: "0 4px",
49
50
  minWidth: "178px",
50
- visibility: b ? "hidden" : "visible"
51
+ visibility: x ? "hidden" : "visible"
51
52
  },
52
- onClick: () => x(!0),
53
- dangerouslySetInnerHTML: { __html: g || "<div>&nbsp;</div>" }
54
- }), b && /* @__PURE__ */ l(t.Fragment, { children: [/* @__PURE__ */ c("div", {
55
- ref: C,
53
+ onClick: () => S(!0),
54
+ dangerouslySetInnerHTML: { __html: _ || "<div>&nbsp;</div>" }
55
+ }), x && /* @__PURE__ */ u(n.Fragment, { children: [/* @__PURE__ */ l("div", {
56
+ ref: w,
56
57
  className: "absolute z-50 bg-white shadow-lg rounded p-2",
57
58
  style: { zIndex: 1 },
58
- children: /* @__PURE__ */ c(S, {})
59
- }), u._tiptapContainerEl && o.createPortal(/* @__PURE__ */ c(e, {
59
+ children: /* @__PURE__ */ l(C, {})
60
+ }), d._tiptapContainerEl && s.createPortal(/* @__PURE__ */ l(e, {
60
61
  deletable: !0,
61
62
  toolbarOpts: { minWidth: "auto" },
62
63
  autoWidth: !0,
@@ -66,18 +67,18 @@ var u = (s) => {
66
67
  right: 0
67
68
  },
68
69
  onDelete: () => {
69
- let { tr: e } = u.state;
70
- e.delete(y, y + d.nodeSize), u._toolbarOpened = !1, u.view.dispatch(e), x(!1), u.commands.focus();
70
+ let { tr: e } = d.state;
71
+ e.delete(b, b + f.nodeSize), t(d, !1), d.view.dispatch(e), S(!1), d.commands.focus();
71
72
  },
72
73
  showDone: !1
73
- }), u._tiptapContainerEl)] })]
74
+ }), d._tiptapContainerEl)] })]
74
75
  });
75
76
  };
76
- u.propTypes = {
77
- attributes: s.object,
78
- error: s.any,
79
- value: s.string,
80
- isFocused: s.bool
77
+ d.propTypes = {
78
+ attributes: c.object,
79
+ error: c.any,
80
+ value: c.string,
81
+ isFocused: c.bool
81
82
  };
82
83
  //#endregion
83
- export { u as default };
84
+ export { d as default };
@@ -1,57 +1,65 @@
1
1
  import e from "../../extensions/custom-toolbar-wrapper.js";
2
- import { Chevron as t } from "../icons/RespArea.js";
3
- import n, { useEffect as r, useRef as i, useState as a } from "react";
4
- import { NodeViewWrapper as o } from "@tiptap/react";
5
- import { NodeSelection as s } from "prosemirror-state";
6
- import c from "react-dom";
7
- import l from "prop-types";
8
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
2
+ import { setToolbarOpened as t } from "../../utils/toolbar.js";
3
+ import { Chevron as n } from "../icons/RespArea.js";
4
+ import r, { useEffect as i, useRef as a, useState as o } from "react";
5
+ import { NodeViewWrapper as s } from "@tiptap/react";
6
+ import { NodeSelection as c } from "prosemirror-state";
7
+ import l from "react-dom";
8
+ import u from "prop-types";
9
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
10
+ import { renderMath as p } from "@pie-element/shared-math-rendering-mathjax";
9
11
  //#region src/components/respArea/InlineDropdown.tsx
10
- var f = (l) => {
11
- let { editor: f, node: p, getPos: m, options: h, selected: g } = l, { attrs: _ } = p, { value: v, error: y } = _, b = v || "<div>&nbsp</div>", x = m(), S = i(null), C = i(null), w = i(!1), T = () => f._holdInlineDropdownToolbarIndex != null && String(f._holdInlineDropdownToolbarIndex) === String(p.attrs.index), [E, D] = a(!1), [O, k] = a({
12
+ var m = (u) => {
13
+ let { editor: m, node: h, getPos: g, options: _, selected: v } = u, { attrs: y } = h, { value: b, error: x } = y, S = b || "<div>&nbsp</div>", C = g(), w = a(null), T = a(null), E = a(!1), D = a(null), O = () => m._holdInlineDropdownToolbarIndex != null && String(m._holdInlineDropdownToolbarIndex) === String(h.attrs.index), [k, A] = o(!1), [j, M] = o({
12
14
  top: 0,
13
15
  left: 0
14
- }), A = () => {
15
- T() || D(!1);
16
- }, j = h.respAreaToolbar([p, x], f, A), M = () => {
17
- let { tr: e } = f.state, t = e.doc.nodeAt(x);
16
+ }), N = () => {
17
+ O() || (A(!1), _.onInlineDropdownToolbarClose?.(m));
18
+ }, P = _.respAreaToolbar([h, C], m, N), F = () => {
19
+ let { tr: e } = m.state, t = e.doc.nodeAt(C);
18
20
  if (!t) return;
19
21
  let { selection: n } = e;
20
- n.from === x && n.to === x + t.nodeSize || (e.setSelection(s.create(e.doc, x)), f.view.dispatch(e));
21
- }, N = () => {
22
- w.current || (h.onToolbarCloseRequest ? (w.current = !0, h.onToolbarCloseRequest([p, x], f, () => {
23
- w.current = !1, delete f._holdInlineDropdownToolbarIndex, A();
22
+ n.from === C && n.to === C + t.nodeSize || (e.setSelection(c.create(e.doc, C)), m.view.dispatch(e));
23
+ }, I = () => {
24
+ E.current || (_.onToolbarCloseRequest ? (E.current = !0, _.onToolbarCloseRequest([h, C], m, () => {
25
+ E.current = !1, delete m._holdInlineDropdownToolbarIndex, N();
24
26
  }, () => {
25
- w.current = !1, delete f._holdInlineDropdownToolbarIndex, D(!0), setTimeout(M, 0);
26
- })) : A());
27
+ E.current = !1, delete m._holdInlineDropdownToolbarIndex, A(!0), setTimeout(F, 0);
28
+ })) : N());
27
29
  };
28
- return r(() => {
29
- let { selection: e } = f.state, t = e.from + p.nodeSize === e.to;
30
- g ? t && D(!0) : E && N();
30
+ i(() => {
31
+ let { selection: e } = m.state, t = e.from + h.nodeSize === e.to;
32
+ v ? t && A(!0) : k && I();
31
33
  }, [
32
- f,
33
- p,
34
- g
35
- ]), r(() => {
36
- let e = document.body.getBoundingClientRect(), { from: t } = f.state.selection, n = f.view.coordsAtPos(t);
37
- k({
34
+ m,
35
+ h,
36
+ v
37
+ ]);
38
+ let L = (e) => e.clientX > document.documentElement.clientWidth || e.clientY > document.documentElement.clientHeight || e.target === document.documentElement;
39
+ return i(() => {
40
+ D.current && typeof p == "function" && p(D.current);
41
+ }, [b]), i(() => {
42
+ let e = document.body.getBoundingClientRect(), { from: t } = m.state.selection, n = m.view.coordsAtPos(t);
43
+ M({
38
44
  top: n.top + Math.abs(e.top) + 40,
39
45
  left: n.left
40
46
  });
41
47
  let r = (e) => {
48
+ if (L(e)) return;
42
49
  let t = e.target.closest("[data-toolbar-for]");
43
- !e.target.closest("[data-inline-dropdown-toolbar]") && (!t || t.dataset.toolbarFor !== C.current?.instanceId) && !f._toolbarOpened && S.current && !S.current.contains(e.target) && !e.target.closest("[data-inline-node]") && N();
50
+ !e.target.closest("[data-inline-dropdown-toolbar]") && (!t || t.dataset.toolbarFor !== T.current?.instanceId) && !m._toolbarOpened && w.current && !w.current.contains(e.target) && !e.target.closest("[data-inline-node]") && I();
44
51
  };
45
- return E ? document.addEventListener("mousedown", r) : document.removeEventListener("mousedown", r), () => document.removeEventListener("mousedown", r);
46
- }, [E]), /* @__PURE__ */ d(o, {
52
+ return k ? document.addEventListener("mousedown", r) : document.removeEventListener("mousedown", r), () => document.removeEventListener("mousedown", r);
53
+ }, [k, h]), /* @__PURE__ */ f(s, {
47
54
  className: "inline-dropdown",
48
- "data-selected": g,
55
+ "data-selected": v,
49
56
  style: {
50
57
  display: "inline-flex",
51
58
  height: "50px",
52
59
  cursor: "pointer"
53
60
  },
54
- children: [/* @__PURE__ */ d("div", {
61
+ children: [/* @__PURE__ */ f("div", {
62
+ ref: D,
55
63
  style: {
56
64
  display: "inline-flex",
57
65
  minWidth: "178px",
@@ -64,8 +72,8 @@ var f = (l) => {
64
72
  position: "relative",
65
73
  alignItems: "center"
66
74
  },
67
- onClick: () => D(!0),
68
- children: [/* @__PURE__ */ u("div", {
75
+ onClick: () => A(!0),
76
+ children: [/* @__PURE__ */ d("div", {
69
77
  style: {
70
78
  flex: 1,
71
79
  overflow: "hidden",
@@ -73,14 +81,14 @@ var f = (l) => {
73
81
  whiteSpace: "nowrap",
74
82
  textOverflow: "ellipsis"
75
83
  },
76
- children: /* @__PURE__ */ u("span", {
84
+ children: /* @__PURE__ */ d("span", {
77
85
  style: {
78
86
  display: "inline-block",
79
87
  verticalAlign: "middle"
80
88
  },
81
- dangerouslySetInnerHTML: { __html: b }
89
+ dangerouslySetInnerHTML: { __html: S }
82
90
  })
83
- }), /* @__PURE__ */ u(t, {
91
+ }), /* @__PURE__ */ d(n, {
84
92
  direction: "down",
85
93
  style: {
86
94
  position: "absolute",
@@ -88,13 +96,12 @@ var f = (l) => {
88
96
  right: "5px"
89
97
  }
90
98
  })]
91
- }), E && /* @__PURE__ */ d(n.Fragment, { children: [c.createPortal(/* @__PURE__ */ u("div", {
92
- ref: S,
93
- style: { zIndex: 1 },
94
- children: /* @__PURE__ */ u(j, { editorCallback: (e) => {
95
- C.current = e;
99
+ }), k && /* @__PURE__ */ f(r.Fragment, { children: [l.createPortal(/* @__PURE__ */ d("div", {
100
+ ref: w,
101
+ children: /* @__PURE__ */ d(P, { editorCallback: (e) => {
102
+ T.current = e;
96
103
  } })
97
- }), document.body), f._tiptapContainerEl && c.createPortal(/* @__PURE__ */ u(e, {
104
+ }), m?._tiptapContainerEl || document.body), m._tiptapContainerEl && l.createPortal(/* @__PURE__ */ d(e, {
98
105
  deletable: !0,
99
106
  toolbarOpts: { minWidth: "auto" },
100
107
  autoWidth: !0,
@@ -104,16 +111,16 @@ var f = (l) => {
104
111
  right: 0
105
112
  },
106
113
  onDelete: () => {
107
- let { tr: e } = f.state;
108
- e.delete(x, x + p.nodeSize), f._toolbarOpened = !1, delete f._holdInlineDropdownToolbarIndex, f.view.dispatch(e), D(!1), f.commands.focus();
114
+ let { tr: e } = m.state;
115
+ e.delete(C, C + h.nodeSize), t(m, !1), delete m._holdInlineDropdownToolbarIndex, m.view.dispatch(e), A(!1), m.commands.focus();
109
116
  },
110
117
  showDone: !1
111
- }), f._tiptapContainerEl)] })]
118
+ }), m._tiptapContainerEl)] })]
112
119
  });
113
120
  };
114
- f.propTypes = {
115
- attributes: l.object,
116
- selectedItem: l.oneOfType([l.string, l.object])
121
+ m.propTypes = {
122
+ attributes: u.object,
123
+ selectedItem: u.oneOfType([u.string, u.object])
117
124
  };
118
125
  //#endregion
119
- export { f as default };
126
+ export { m as default };
@@ -3,11 +3,12 @@ import { NodeViewWrapper as e } from "@tiptap/react";
3
3
  import { styled as t } from "@mui/material/styles";
4
4
  import n from "prop-types";
5
5
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
6
- import { mq as a } from "@pie-lib/math-input";
6
+ import { color as a } from "@pie-lib/render-ui";
7
+ import { mq as o } from "@pie-lib/math-input";
7
8
  //#region src/components/respArea/MathTemplated.tsx
8
- var o = t("span")(() => ({
9
+ var s = t("span")(() => ({
9
10
  display: "inline-flex",
10
- border: "1px solid #C0C3CF",
11
+ border: `1px solid ${a.border()}`,
11
12
  margin: "1px 5px",
12
13
  cursor: "pointer",
13
14
  alignItems: "center",
@@ -15,11 +16,11 @@ var o = t("span")(() => ({
15
16
  minWidth: "50px",
16
17
  minHeight: "36px",
17
18
  height: "fit-content"
18
- })), s = t("div")(({ theme: e }) => ({
19
- background: e.palette.grey.A100,
20
- color: e.palette.grey.A700,
19
+ })), c = t("div")(() => ({
20
+ background: a.backgroundDark(),
21
+ color: a.text(),
21
22
  display: "inline-flex",
22
- borderRight: "2px solid #C0C3CF",
23
+ borderRight: `2px solid ${a.border()}`,
23
24
  boxSizing: "border-box",
24
25
  overflow: "hidden",
25
26
  fontSize: "12px",
@@ -28,7 +29,7 @@ var o = t("span")(() => ({
28
29
  alignItems: "center",
29
30
  fontFamily: "Symbola, Times New Roman, serif",
30
31
  padding: "0 2px"
31
- })), c = t("div")(() => ({
32
+ })), l = t("div")(() => ({
32
33
  flex: 8,
33
34
  color: "var(--pie-text, black)",
34
35
  padding: "4px !important",
@@ -71,8 +72,8 @@ var o = t("span")(() => ({
71
72
  } },
72
73
  "& .mq-overarrow-inner-right": { display: "none !important" },
73
74
  "& .mq-overarrow-inner-left": { display: "none !important" }
74
- })), l = (t) => {
75
- let { node: n, options: l, selected: u } = t, { attrs: d } = n, { value: f, index: p } = d, m = `R ${parseInt(p) + 1}`;
75
+ })), u = (t) => {
76
+ let { node: n, options: a, selected: u } = t, { attrs: d } = n, { value: f, index: p } = d, m = `R ${parseInt(p) + 1}`;
76
77
  return /* @__PURE__ */ r(e, {
77
78
  className: "math-templated",
78
79
  "data-selected": u,
@@ -82,16 +83,16 @@ var o = t("span")(() => ({
82
83
  minWidth: "50px",
83
84
  cursor: "pointer"
84
85
  },
85
- children: /* @__PURE__ */ i(o, {
86
+ children: /* @__PURE__ */ i(s, {
86
87
  ...d,
87
- children: [/* @__PURE__ */ r(s, { children: m }), /* @__PURE__ */ r(c, { children: /* @__PURE__ */ r(a.Static, { latex: f }) })]
88
+ children: [/* @__PURE__ */ r(c, { children: m }), /* @__PURE__ */ r(l, { children: /* @__PURE__ */ r(o.Static, { latex: f }) })]
88
89
  })
89
90
  });
90
91
  };
91
- l.propTypes = {
92
+ u.propTypes = {
92
93
  attributes: n.object,
93
94
  value: n.string,
94
95
  keyToDisplay: n.string
95
96
  };
96
97
  //#endregion
97
- export { l as default };
98
+ export { u as default };
@@ -12,4 +12,4 @@ var e = "_holdInlineDropdownToolbarIndex", t = (e, t) => {
12
12
  return s ? (o.delete(a, a + s.nodeSize), e.view.dispatch(o), n(e), !0) : (n(e), !1);
13
13
  };
14
14
  //#endregion
15
- export { r as deleteInlineDropdownByIndex };
15
+ export { e as HOLD_INLINE_DROPDOWN_TOOLBAR_INDEX, r as deleteInlineDropdownByIndex, t as findInlineDropdownPos, n as releaseInlineDropdownToolbarHold };
@@ -81,8 +81,13 @@ var s = () => {
81
81
  return [{
82
82
  tag: "span[class]",
83
83
  getAttrs: (e) => {
84
- let t = e.getAttribute("class") || "", n = this.options.classes.find((e) => t.includes(e));
85
- return n ? { class: n } : !1;
84
+ let t = e.getAttribute("class") || "";
85
+ if (!t) return !1;
86
+ if ((this.options && this.options.classes || []).length > 0) {
87
+ let e = this.options.classes.find((e) => t.includes(e));
88
+ return e ? { class: e } : !1;
89
+ }
90
+ return { class: t };
86
91
  }
87
92
  }];
88
93
  },
@@ -112,4 +117,4 @@ var s = () => {
112
117
  }
113
118
  });
114
119
  //#endregion
115
- export { l as CSSMark };
120
+ export { l as CSSMark, s as removeDialogs };
@@ -31,4 +31,4 @@ var n = (e, t) => {
31
31
  }
32
32
  });
33
33
  //#endregion
34
- export { i as default };
34
+ export { r as ExtendedTableView, n as applyPresentationToTableElement, i as default };
@@ -1,6 +1,6 @@
1
1
  import e from "./custom-toolbar-wrapper.js";
2
2
  import t from "../components/image/InsertImageHandler.js";
3
- import n from "../components/image/ImageToolbar.js";
3
+ import { ImageToolbar as n } from "../components/image/ImageToolbar.js";
4
4
  import { useCallback as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
5
5
  import { isEqual as c } from "@pie-element/shared-lodash";
6
6
  import { NodeViewWrapper as l } from "@tiptap/react";
@@ -68,7 +68,7 @@ function C(u) {
68
68
  ...e
69
69
  }));
70
70
  }, [h, V]), U = r(() => {
71
- if (!f.attrs.width || !L.current) return;
71
+ if (!f.attrs.width || !L.current || !L.current.naturalWidth) return;
72
72
  let e = B(f.attrs.width);
73
73
  f.attrs.resizePercent !== e && H({ resizePercent: e });
74
74
  }, [
@@ -83,11 +83,15 @@ function C(u) {
83
83
  pos: A
84
84
  };
85
85
  }, [f, A]), i(() => {
86
- T ? N && (!String(f.attrs?.src ?? "").trim() && E.imageHandling?.insertImageRequested && E.imageHandling.insertImageRequested(h, [f, A], (e) => new t(h, [f, A], e)), F(T)) : F(T);
87
- }, [N, T]), i(() => {
86
+ T ? N && h.isEditable && (!String(f.attrs?.src ?? "").trim() && E.imageHandling?.insertImageRequested && E.imageHandling.insertImageRequested(h, [f, A], (e) => new t(h, [f, A], e)), F(T)) : F(T);
87
+ }, [
88
+ N,
89
+ T,
90
+ h.isEditable
91
+ ]), i(() => {
88
92
  U();
89
- let e = R.current;
90
- return e && e.addEventListener("mousedown", Y, !1), () => {
93
+ let e = R?.current;
94
+ return e && h.isEditable && e.addEventListener("mousedown", Y, !1), () => {
91
95
  e && e.removeEventListener("mousedown", Y, !1);
92
96
  };
93
97
  }, []), i(() => {
@@ -128,16 +132,16 @@ function C(u) {
128
132
  }, K = r((e) => {
129
133
  let t = L.current;
130
134
  if (!t) return;
131
- let n = e.target.getBoundingClientRect(), r = G({
135
+ let n = e.target.getBoundingClientRect(), r = {
132
136
  width: t.naturalWidth,
133
137
  height: t.naturalHeight
134
- }, {
138
+ }, i = G(r, {
135
139
  width: e.clientX - n.left,
136
140
  height: e.clientY - n.top
137
141
  });
138
- r.width > 50 && r.height > 50 && r.width <= 700 && r.height <= 900 && (t.style.width = `${r.width}px`, t.style.height = `${r.height}px`, H({
139
- width: r.width,
140
- height: r.height
142
+ i.width > 50 && i.height > 50 && i.width <= 700 && i.height <= 900 && (t.style.width = `${i.width}px`, t.style.height = `${i.height}px`, H({
143
+ width: i.width,
144
+ height: i.height
141
145
  }));
142
146
  }, [h, H]), q = r((e) => {
143
147
  H(e);
@@ -176,7 +180,8 @@ function C(u) {
176
180
  alt: f.attrs.alt
177
181
  }), /* @__PURE__ */ p(x, {
178
182
  ref: R,
179
- className: "resize"
183
+ className: "resize",
184
+ style: { display: h.isEditable ? void 0 : "none" }
180
185
  })]
181
186
  })]
182
187
  }), P && h._tiptapContainerEl && d.createPortal(/* @__PURE__ */ p("div", {