@uva-glass/component-library 3.47.6 → 3.47.8
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/{Lexical.prod-nXWuyOKD.js → Lexical.prod-DBU6xTBY.js} +1397 -1279
- package/dist/Lexical.prod-DBU6xTBY.js.map +1 -0
- package/dist/LexicalClipboard.prod-CzGBnMdD.js +272 -0
- package/dist/LexicalClipboard.prod-CzGBnMdD.js.map +1 -0
- package/dist/LexicalLink.prod-DV9kT537.js +1027 -0
- package/dist/LexicalLink.prod-DV9kT537.js.map +1 -0
- package/dist/{LexicalList.prod--mkvX0uW.js → LexicalList.prod-2UfLUgO1.js} +159 -154
- package/dist/LexicalList.prod-2UfLUgO1.js.map +1 -0
- package/dist/LexicalSelection.prod-C1JYA_go.js +114 -0
- package/dist/LexicalSelection.prod-C1JYA_go.js.map +1 -0
- package/dist/LexicalTable.prod-CZ1mYUR-.js +1802 -0
- package/dist/LexicalTable.prod-CZ1mYUR-.js.map +1 -0
- package/dist/LexicalUtils.prod-C3vvQk50.js +114 -0
- package/dist/LexicalUtils.prod-C3vvQk50.js.map +1 -0
- package/dist/{TableCellResizerPlugin-Cpbankb8.js → TableCellResizerPlugin-CxFy7dbe.js} +53 -53
- package/dist/TableCellResizerPlugin-CxFy7dbe.js.map +1 -0
- package/dist/{TablePlugin-CfXPNfT8.js → TablePlugin-CfTWvWk1.js} +59 -59
- package/dist/{TablePlugin-CfXPNfT8.js.map → TablePlugin-CfTWvWk1.js.map} +1 -1
- package/dist/{WeekSelector.module-CTDcqKel.js → WeekSelector.module-P6WOVdLX.js} +12 -12
- package/dist/WeekSelector.module-P6WOVdLX.js.map +1 -0
- package/dist/assets/WeekSelector.css +1 -1
- package/dist/client--GsCJ9Up.js +27328 -0
- package/dist/client--GsCJ9Up.js.map +1 -0
- package/dist/components/Accordion/Accordion.test.js +3 -3
- package/dist/components/AccordionCard/AccordionCard.test.js +3 -3
- package/dist/components/ActionList/ActionList.test.js +3 -3
- package/dist/components/AppStatusBar/AppStatusBar.test.js +2 -2
- package/dist/components/Attention/Attention.test.js +2 -2
- package/dist/components/Backdrop/Backdrop.test.js +2 -2
- package/dist/components/Buttons/Button.test.js +2 -2
- package/dist/components/Buttons/LinkButton.test.js +2 -2
- package/dist/components/Buttons/MenuButton.test.js +2 -2
- package/dist/components/Card/Card.test.js +2 -2
- package/dist/components/Checkbox/Checkbox.test.js +3 -3
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js +2 -2
- package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
- package/dist/components/FeedbackBar/FeedbackBar.test.js +2 -2
- package/dist/components/FormInput/FormInput.js +1 -1
- package/dist/components/InputField/InputField.stories.js +1 -1
- package/dist/components/Label/Label.test.js +2 -2
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +1 -1
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.test.js +2 -2
- package/dist/components/Notification/Notification.test.js +2 -2
- package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js +1 -1
- package/dist/components/RadioGroup/Radiogroup.test.js +2 -2
- package/dist/components/RadioTabSelector/RadioTabSelector.js +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +7 -7
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +6 -6
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +2 -2
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +9 -9
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +35 -35
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +9 -5
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js.map +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +40 -40
- package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +5 -5
- package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/TableCellResizerPlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/AddTableFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +25 -25
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +19 -19
- package/dist/components/RteEditor/Plugins/index.js +2 -2
- package/dist/components/RteEditor/RteEditor.js +671 -627
- package/dist/components/RteEditor/RteEditor.js.map +1 -1
- package/dist/components/RteEditor/helpers.js +8 -8
- package/dist/components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js +19 -19
- package/dist/components/StatusBadge/StatusBadge.test.js +2 -2
- package/dist/components/TextArea/TextArea.test.js +2 -2
- package/dist/components/VarIndicator/VarIndicator.test.js +3 -3
- package/dist/components/WeekSelector/WeekSelector.js +1 -1
- package/dist/components/WeekSelector/components/WeekSelectorButton.js +1 -1
- package/dist/components/WeekSelector/components/WeekSelectorOption.js +1 -1
- package/dist/components/WeekSelector/components/WeekSelectorOptionContainer.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/{index-D5qpMB9d.js → index-Bf2LCbD1.js} +2 -2
- package/dist/{index-D5qpMB9d.js.map → index-Bf2LCbD1.js.map} +1 -1
- package/dist/{index-rQE9MV9y.js → index-JOHbZ4si.js} +523 -523
- package/dist/{index-rQE9MV9y.js.map → index-JOHbZ4si.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/{react-18-DXfB7ZX7.js → react-18-BHQltW8V.js} +2 -2
- package/dist/{react-18-DXfB7ZX7.js.map → react-18-BHQltW8V.js.map} +1 -1
- package/dist/{react.esm-D2ppoNuM.js → react.esm-Bg7Fh9lz.js} +3 -3
- package/dist/{react.esm-D2ppoNuM.js.map → react.esm-Bg7Fh9lz.js.map} +1 -1
- package/dist/setupTests.js +1 -1
- package/dist/storybook__react.d.js +1 -1
- package/package.json +20 -20
- package/dist/Lexical.prod-nXWuyOKD.js.map +0 -1
- package/dist/LexicalClipboard.prod-pXq91TBU.js +0 -276
- package/dist/LexicalClipboard.prod-pXq91TBU.js.map +0 -1
- package/dist/LexicalLink.prod-Brzpgs_K.js +0 -285
- package/dist/LexicalLink.prod-Brzpgs_K.js.map +0 -1
- package/dist/LexicalList.prod--mkvX0uW.js.map +0 -1
- package/dist/LexicalSelection.prod-Ct4PZOht.js +0 -119
- package/dist/LexicalSelection.prod-Ct4PZOht.js.map +0 -1
- package/dist/LexicalTable.prod-Bexd4dGG.js +0 -1763
- package/dist/LexicalTable.prod-Bexd4dGG.js.map +0 -1
- package/dist/LexicalUtils.prod-Ckfw0Hjt.js +0 -123
- package/dist/LexicalUtils.prod-Ckfw0Hjt.js.map +0 -1
- package/dist/TableCellResizerPlugin-Cpbankb8.js.map +0 -1
- package/dist/WeekSelector.module-CTDcqKel.js.map +0 -1
- package/dist/client-BK9NlSVR.js +0 -25208
- package/dist/client-BK9NlSVR.js.map +0 -1
- package/dist/helpers-mE437H2Y.js +0 -164
- package/dist/helpers-mE437H2Y.js.map +0 -1
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import { o as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { jsx as T, jsxs as J, Fragment as Q } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as B, useState as x, useRef as E, useLayoutEffect as Z, useEffect as L, useCallback as b } from "react";
|
|
3
|
+
import { o as F } from "./LexicalComposerContext.prod-DOyoZx0P.js";
|
|
4
|
+
import { d as ee, T as te, A as k, I as _, U as ne, z as oe, m as re, H as le, a as se } from "./LexicalTable.prod-CZ1mYUR-.js";
|
|
5
|
+
import { w as ie, R as K } from "./LexicalUtils.prod-C3vvQk50.js";
|
|
6
|
+
import { l as $, d as ce } from "./Lexical.prod-DBU6xTBY.js";
|
|
7
7
|
import { createPortal as ue } from "react-dom";
|
|
8
8
|
import { tableHasContent as ae, getEditorParrentCellWidth as de, getEditorContentWidth as fe } from "./components/RteEditor/Plugins/TablePlugin/helpers.js";
|
|
9
|
-
import { TableWrapperNode as he, $createTableWrapperNode as
|
|
10
|
-
import './assets/TableCellResizerPlugin.css';const
|
|
9
|
+
import { TableWrapperNode as he, $createTableWrapperNode as we } from "./components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js";
|
|
10
|
+
import './assets/TableCellResizerPlugin.css';const ge = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? Z : L;
|
|
11
11
|
function me(l) {
|
|
12
12
|
return { initialValueFn: () => l.isEditable(), subscribe: (d) => l.registerEditableListener(d) };
|
|
13
13
|
}
|
|
14
14
|
function pe() {
|
|
15
15
|
return (function(l) {
|
|
16
|
-
const [d] =
|
|
17
|
-
return
|
|
16
|
+
const [d] = F(), m = B(() => l(d), [d, l]), [p, w] = x(() => m.initialValueFn()), g = E(p);
|
|
17
|
+
return ge(() => {
|
|
18
18
|
const { initialValueFn: R, subscribe: c } = m, C = R();
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
})
|
|
22
|
-
}
|
|
19
|
+
return g.current !== C && (g.current = C, w(C)), c((z) => {
|
|
20
|
+
g.current = z, w(z);
|
|
21
|
+
});
|
|
22
|
+
}, [m, l]), p;
|
|
23
23
|
})(me);
|
|
24
24
|
}
|
|
25
25
|
const S = {
|
|
26
26
|
"table-cell-resizer__resizer": "_table-cell-resizer__resizer_2hhfo_17"
|
|
27
|
-
}, Ce = 33, W = 32,
|
|
27
|
+
}, Ce = 33, W = 32, A = 2;
|
|
28
28
|
function be({ editor: l }) {
|
|
29
|
-
const d = E(null), m = E(null), p = E(null),
|
|
30
|
-
C(null), d.current = null,
|
|
29
|
+
const d = E(null), m = E(null), p = E(null), w = E(null), [g, R] = x(null), [c, C] = x(null), [z, M] = x(!1), [a, I] = x(null), v = b(() => {
|
|
30
|
+
C(null), d.current = null, I(null), w.current = null, p.current = null;
|
|
31
31
|
}, []), U = (e) => (e.buttons & 1) === 1;
|
|
32
32
|
L(() => l.registerNodeTransform(ee, (e) => {
|
|
33
33
|
if (!e.getColWidths()) {
|
|
@@ -44,7 +44,7 @@ function be({ editor: l }) {
|
|
|
44
44
|
}), e.setColWidths(i);
|
|
45
45
|
}
|
|
46
46
|
if (e && !(e.getParent() instanceof he)) {
|
|
47
|
-
const t =
|
|
47
|
+
const t = we();
|
|
48
48
|
e.replace(t), t.append(e);
|
|
49
49
|
}
|
|
50
50
|
return e;
|
|
@@ -59,15 +59,15 @@ function be({ editor: l }) {
|
|
|
59
59
|
});
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
62
|
-
if (
|
|
62
|
+
if (M(U(s)), !(m.current && m.current.contains(r)) && d.current !== r) {
|
|
63
63
|
d.current = r;
|
|
64
64
|
const o = le(r);
|
|
65
65
|
o && c !== o ? l.getEditorState().read(
|
|
66
66
|
() => {
|
|
67
|
-
const u =
|
|
67
|
+
const u = $(o.elem);
|
|
68
68
|
if (!u)
|
|
69
69
|
throw new Error("TableCellResizer: Table cell node not found.");
|
|
70
|
-
const f =
|
|
70
|
+
const f = _(u), h = se(f, l.getElementByKey(f.getKey()));
|
|
71
71
|
if (!h)
|
|
72
72
|
throw new Error("TableCellResizer: Table element not found.");
|
|
73
73
|
d.current = r, p.current = h.getBoundingClientRect(), C(o);
|
|
@@ -77,9 +77,9 @@ function be({ editor: l }) {
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
}, t = () => {
|
|
80
|
-
|
|
80
|
+
M(!0);
|
|
81
81
|
}, n = () => {
|
|
82
|
-
|
|
82
|
+
M(!1);
|
|
83
83
|
}, i = l.registerRootListener((s, r) => {
|
|
84
84
|
r?.removeEventListener("mousemove", e), r?.removeEventListener("mousedown", t), r?.removeEventListener("mouseup", n), s?.addEventListener("mousemove", e), s?.addEventListener("mousedown", t), s?.addEventListener("mouseup", n);
|
|
85
85
|
});
|
|
@@ -87,16 +87,16 @@ function be({ editor: l }) {
|
|
|
87
87
|
i();
|
|
88
88
|
};
|
|
89
89
|
}, [c, a, l, v]);
|
|
90
|
-
const
|
|
90
|
+
const D = (e) => e === "bottom", O = b(
|
|
91
91
|
(e) => {
|
|
92
92
|
if (!c)
|
|
93
93
|
throw new Error("TableCellResizer: Expected active cell.");
|
|
94
94
|
l.update(
|
|
95
95
|
() => {
|
|
96
|
-
const t =
|
|
96
|
+
const t = $(c.elem);
|
|
97
97
|
if (!k(t))
|
|
98
98
|
throw new Error("TableCellResizer: Table cell node not found.");
|
|
99
|
-
const n =
|
|
99
|
+
const n = _(t), i = ne(t) + t.getRowSpan() - 1, s = n.getChildren();
|
|
100
100
|
if (i >= s.length || i < 0)
|
|
101
101
|
throw new Error("Expected table cell to be inside of table row.");
|
|
102
102
|
const r = s[i];
|
|
@@ -120,16 +120,16 @@ function be({ editor: l }) {
|
|
|
120
120
|
if (t[n][i].cell === e)
|
|
121
121
|
return i;
|
|
122
122
|
return -1;
|
|
123
|
-
},
|
|
123
|
+
}, N = b(
|
|
124
124
|
(e) => {
|
|
125
125
|
if (!c)
|
|
126
126
|
throw new Error("TableCellResizer: Expected active cell.");
|
|
127
127
|
l.update(
|
|
128
128
|
() => {
|
|
129
|
-
const t =
|
|
129
|
+
const t = $(c.elem);
|
|
130
130
|
if (!k(t))
|
|
131
131
|
throw new Error("TableCellResizer: Table cell node not found.");
|
|
132
|
-
const n =
|
|
132
|
+
const n = _(t), [i] = re(n, null, null), s = j(t, i);
|
|
133
133
|
if (s === void 0)
|
|
134
134
|
throw new Error("TableCellResizer: Table column not found.");
|
|
135
135
|
const r = n.getColWidths();
|
|
@@ -143,47 +143,47 @@ function be({ editor: l }) {
|
|
|
143
143
|
const h = n.getColWidths();
|
|
144
144
|
if (!h)
|
|
145
145
|
return;
|
|
146
|
-
const
|
|
147
|
-
|
|
146
|
+
const H = [...h], y = s + 1, G = h[y], q = Math.max(G - e, W);
|
|
147
|
+
H[y] = q, n.setColWidths(H);
|
|
148
148
|
}
|
|
149
149
|
},
|
|
150
150
|
{ tag: "skip-scroll-into-view" }
|
|
151
151
|
);
|
|
152
152
|
},
|
|
153
153
|
[c, l]
|
|
154
|
-
),
|
|
154
|
+
), P = b(
|
|
155
155
|
(e) => {
|
|
156
156
|
const t = (n) => {
|
|
157
157
|
if (n.preventDefault(), n.stopPropagation(), !c)
|
|
158
158
|
throw new Error("TableCellResizer: Expected active cell.");
|
|
159
|
-
if (
|
|
160
|
-
const { x: i, y: s } =
|
|
159
|
+
if (w.current) {
|
|
160
|
+
const { x: i, y: s } = w.current;
|
|
161
161
|
if (c === null)
|
|
162
162
|
return;
|
|
163
163
|
const r = K(n.target);
|
|
164
|
-
if (
|
|
164
|
+
if (D(e)) {
|
|
165
165
|
const o = (n.clientY - s) / r;
|
|
166
166
|
O(o);
|
|
167
167
|
} else {
|
|
168
168
|
const o = (n.clientX - i) / r;
|
|
169
|
-
|
|
169
|
+
N(o);
|
|
170
170
|
}
|
|
171
171
|
v(), document.removeEventListener("mouseup", t);
|
|
172
172
|
}
|
|
173
173
|
};
|
|
174
174
|
return t;
|
|
175
175
|
},
|
|
176
|
-
[c, v,
|
|
176
|
+
[c, v, N, O]
|
|
177
177
|
), X = b(
|
|
178
178
|
(e) => (t) => {
|
|
179
179
|
if (t.preventDefault(), t.stopPropagation(), !c)
|
|
180
180
|
throw new Error("TableCellResizer: Expected active cell.");
|
|
181
|
-
|
|
181
|
+
w.current = {
|
|
182
182
|
x: t.clientX,
|
|
183
183
|
y: t.clientY
|
|
184
|
-
}, R(
|
|
184
|
+
}, R(w.current), I(e), document.addEventListener("mouseup", P(e));
|
|
185
185
|
},
|
|
186
|
-
[c,
|
|
186
|
+
[c, P]
|
|
187
187
|
), Y = b(() => {
|
|
188
188
|
if (c) {
|
|
189
189
|
const { height: e, width: t, top: n, left: i } = c.elem.getBoundingClientRect(), s = K(c.elem), r = 10, o = {
|
|
@@ -192,7 +192,7 @@ function be({ editor: l }) {
|
|
|
192
192
|
cursor: "ns-resize",
|
|
193
193
|
height: `${r}px`,
|
|
194
194
|
left: `${window.pageXOffset + i}px`,
|
|
195
|
-
top: `${window.pageYOffset + n + e - r /
|
|
195
|
+
top: `${window.pageYOffset + n + e - r / A}px`,
|
|
196
196
|
width: `${t}px`,
|
|
197
197
|
zIndex: 5e3
|
|
198
198
|
},
|
|
@@ -200,13 +200,13 @@ function be({ editor: l }) {
|
|
|
200
200
|
backgroundColor: "none",
|
|
201
201
|
cursor: "ew-resize",
|
|
202
202
|
height: `${e}px`,
|
|
203
|
-
left: `${window.pageXOffset + i + t - r /
|
|
203
|
+
left: `${window.pageXOffset + i + t - r / A}px`,
|
|
204
204
|
top: `${window.pageYOffset + n}px`,
|
|
205
205
|
width: `${r}px`,
|
|
206
206
|
zIndex: 5e3
|
|
207
207
|
}
|
|
208
208
|
}, u = p.current;
|
|
209
|
-
return a &&
|
|
209
|
+
return a && g && u && (D(a) ? (o[a].left = `${window.pageXOffset + u.left}px`, o[a].top = `${window.pageYOffset + g.y / s}px`, o[a].height = "3px", o[a].width = `${u.width}px`) : (o[a].top = `${window.pageYOffset + u.top}px`, o[a].left = `${window.pageXOffset + g.x / s}px`, o[a].width = "3px", o[a].height = `${u.height}px`), o[a].backgroundColor = "#adf"), o;
|
|
210
210
|
}
|
|
211
211
|
return {
|
|
212
212
|
bottom: null,
|
|
@@ -214,9 +214,9 @@ function be({ editor: l }) {
|
|
|
214
214
|
right: null,
|
|
215
215
|
top: null
|
|
216
216
|
};
|
|
217
|
-
}, [c, a,
|
|
218
|
-
return /* @__PURE__ */
|
|
219
|
-
/* @__PURE__ */
|
|
217
|
+
}, [c, a, g])();
|
|
218
|
+
return /* @__PURE__ */ T("div", { ref: m, children: c != null && !z && /* @__PURE__ */ J(Q, { children: [
|
|
219
|
+
/* @__PURE__ */ T(
|
|
220
220
|
"div",
|
|
221
221
|
{
|
|
222
222
|
className: S["table-cell-resizer__resizer"],
|
|
@@ -224,7 +224,7 @@ function be({ editor: l }) {
|
|
|
224
224
|
onMouseDown: X("right")
|
|
225
225
|
}
|
|
226
226
|
),
|
|
227
|
-
/* @__PURE__ */
|
|
227
|
+
/* @__PURE__ */ T(
|
|
228
228
|
"div",
|
|
229
229
|
{
|
|
230
230
|
className: S["table-cell-resizer__resizer"],
|
|
@@ -234,15 +234,15 @@ function be({ editor: l }) {
|
|
|
234
234
|
)
|
|
235
235
|
] }) });
|
|
236
236
|
}
|
|
237
|
-
const
|
|
238
|
-
const [l] =
|
|
239
|
-
return
|
|
240
|
-
() => d ? ue(/* @__PURE__ */
|
|
237
|
+
const _e = () => {
|
|
238
|
+
const [l] = F(), d = pe();
|
|
239
|
+
return B(
|
|
240
|
+
() => d ? ue(/* @__PURE__ */ T(be, { editor: l }), document.body) : null,
|
|
241
241
|
[l, d]
|
|
242
242
|
);
|
|
243
243
|
};
|
|
244
244
|
export {
|
|
245
|
-
|
|
245
|
+
_e as T,
|
|
246
246
|
pe as a
|
|
247
247
|
};
|
|
248
|
-
//# sourceMappingURL=TableCellResizerPlugin-
|
|
248
|
+
//# sourceMappingURL=TableCellResizerPlugin-CxFy7dbe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableCellResizerPlugin-CxFy7dbe.js","sources":["../node_modules/@lexical/react/useLexicalEditable.prod.mjs","../src/components/RteEditor/Plugins/TableCellResizerPlugin/TableCellResizerPlugin.tsx"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport{useLexicalComposerContext as e}from\"@lexical/react/LexicalComposerContext\";import{useLayoutEffect as n,useEffect as t,useMemo as i,useState as r,useRef as o}from\"react\";const c=\"undefined\"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?n:t;function u(e){return{initialValueFn:()=>e.isEditable(),subscribe:n=>e.registerEditableListener(n)}}function a(){return function(n){const[t]=e(),u=i(()=>n(t),[t,n]),[a,l]=r(()=>u.initialValueFn()),d=o(a);return c(()=>{const{initialValueFn:e,subscribe:n}=u,t=e();return d.current!==t&&(d.current=t,l(t)),n(e=>{d.current=e,l(e)})},[u,n]),a}(u)}export{a as useLexicalEditable};\n","/* eslint-disable jsx-a11y/no-static-element-interactions */\r\n/**\r\n * Copyright (c) Meta Platforms, Inc. and affiliates.\r\n *\r\n * This source code is licensed under the MIT license found in the\r\n * LICENSE file in the root directory of this source tree.\r\n *\r\n * Modified from original to fit project needs wim jurriaans.\r\n *\r\n *\r\n */\r\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\r\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';\r\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable';\r\nimport {\r\n $computeTableMapSkipCellCheck,\r\n $getTableNodeFromLexicalNodeOrThrow,\r\n $getTableRowIndexFromTableCellNode,\r\n $isTableCellNode,\r\n $isTableRowNode,\r\n TableNode,\r\n getDOMCellFromTarget,\r\n getTableElement,\r\n TableCellNode,\r\n} from '@lexical/table';\r\nimport { $getNearestNodeOfType, calculateZoomLevel } from '@lexical/utils';\r\nimport { $getNearestNodeFromDOMNode, isHTMLElement } from 'lexical';\r\nimport { createPortal } from 'react-dom';\r\n\r\nimport type { LexicalEditor } from 'lexical';\r\nimport type { TableDOMCell, TableMapType, TableRowNode } from '@lexical/table';\r\nimport type { JSX, MouseEventHandler, ReactPortal } from 'react';\r\n\r\nimport styles from './TableCellResizerPlugin.module.css';\r\n\r\nimport {\r\n getEditorContentWidth,\r\n getEditorParrentCellWidth,\r\n tableHasContent,\r\n} from 'components/RteEditor/Plugins/TablePlugin/helpers';\r\nimport { $createTableWrapperNode, TableWrapperNode } from 'components/RteEditor/nodes';\r\n\r\ntype MousePosition = {\r\n x: number;\r\n y: number;\r\n};\r\n\r\ntype MouseDraggingDirection = 'right' | 'bottom';\r\n\r\nconst MIN_ROW_HEIGHT = 33;\r\nconst MIN_COLUMN_WIDTH = 32;\r\nconst HALF = 2;\r\n\r\nfunction TableCellResizer({ editor }: { editor: LexicalEditor }): JSX.Element {\r\n const targetRef = useRef<HTMLElement | null>(null);\r\n const resizerRef = useRef<HTMLDivElement | null>(null);\r\n const tableRectRef = useRef<DOMRect | null>(null);\r\n\r\n const mouseStartPosRef = useRef<MousePosition | null>(null);\r\n const [mouseCurrentPos, updateMouseCurrentPos] = useState<MousePosition | null>(null);\r\n\r\n const [activeCell, updateActiveCell] = useState<TableDOMCell | null>(null);\r\n const [isMouseDown, updateIsMouseDown] = useState<boolean>(false);\r\n const [draggingDirection, updateDraggingDirection] = useState<MouseDraggingDirection | null>(null);\r\n\r\n const resetState = useCallback(() => {\r\n updateActiveCell(null);\r\n targetRef.current = null;\r\n updateDraggingDirection(null);\r\n mouseStartPosRef.current = null;\r\n tableRectRef.current = null;\r\n }, []);\r\n\r\n const isMouseDownOnEvent = (event: MouseEvent) => {\r\n return (event.buttons & 1) === 1;\r\n };\r\n\r\n useEffect(() => {\r\n return editor.registerNodeTransform(TableNode, (tableNode) => {\r\n // modification: set default column widths if not defined or table cells of imported tables has the width set\r\n if (!tableNode.getColWidths()) {\r\n const tableRows = tableNode.getChildren();\r\n const columnCount = tableNode.getColumnCount();\r\n const colWidths = new Array(columnCount).fill(undefined);\r\n\r\n const firstRow = tableRows[0] as TableRowNode;\r\n const cells = firstRow.getChildren();\r\n cells.forEach((cell, colIdx) => {\r\n const domCell = editor.getElementByKey(cell.getKey());\r\n if (domCell && domCell.style.width) {\r\n colWidths[colIdx] = parseInt(domCell.style.width, 10);\r\n domCell.style.width = '';\r\n } else if (tableHasContent(tableNode)) {\r\n const isNested = tableNode ? $getNearestNodeOfType(tableNode, TableCellNode) : null;\r\n\r\n const availableWidth = isNested\r\n ? getEditorParrentCellWidth(isNested, columnCount, editor)\r\n : getEditorContentWidth(editor);\r\n const newColWidth = availableWidth / columnCount;\r\n colWidths[colIdx] = Math.max(newColWidth, MIN_COLUMN_WIDTH);\r\n } else {\r\n colWidths[colIdx] = MIN_COLUMN_WIDTH;\r\n }\r\n });\r\n\r\n tableNode.setColWidths(colWidths);\r\n }\r\n\r\n // modification: wrap table node in a wrapper node if there is no wrapper node present\r\n if (tableNode && !(tableNode.getParent() instanceof TableWrapperNode)) {\r\n const wrapperNode = $createTableWrapperNode();\r\n tableNode.replace(wrapperNode);\r\n wrapperNode.append(tableNode);\r\n }\r\n\r\n return tableNode;\r\n });\r\n }, [editor]);\r\n\r\n useEffect(() => {\r\n const onMouseMove = (event: MouseEvent) => {\r\n const target = event.target;\r\n if (!isHTMLElement(target)) {\r\n return;\r\n }\r\n\r\n if (draggingDirection) {\r\n updateMouseCurrentPos({\r\n x: event.clientX,\r\n y: event.clientY,\r\n });\r\n return;\r\n }\r\n updateIsMouseDown(isMouseDownOnEvent(event));\r\n if (resizerRef.current && resizerRef.current.contains(target)) {\r\n return;\r\n }\r\n\r\n if (targetRef.current !== target) {\r\n targetRef.current = target;\r\n const cell = getDOMCellFromTarget(target);\r\n\r\n if (cell && activeCell !== cell) {\r\n editor.getEditorState().read(\r\n () => {\r\n const tableCellNode = $getNearestNodeFromDOMNode(cell.elem);\r\n if (!tableCellNode) {\r\n throw new Error('TableCellResizer: Table cell node not found.');\r\n }\r\n\r\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);\r\n const tableElement = getTableElement(tableNode, editor.getElementByKey(tableNode.getKey()));\r\n\r\n if (!tableElement) {\r\n throw new Error('TableCellResizer: Table element not found.');\r\n }\r\n\r\n targetRef.current = target;\r\n tableRectRef.current = tableElement.getBoundingClientRect();\r\n updateActiveCell(cell);\r\n },\r\n { editor }\r\n );\r\n } else if (cell == null) {\r\n resetState();\r\n }\r\n }\r\n };\r\n\r\n const onMouseDown = () => {\r\n updateIsMouseDown(true);\r\n };\r\n\r\n const onMouseUp = () => {\r\n updateIsMouseDown(false);\r\n };\r\n\r\n const removeRootListener = editor.registerRootListener((rootElement, prevRootElement) => {\r\n prevRootElement?.removeEventListener('mousemove', onMouseMove);\r\n prevRootElement?.removeEventListener('mousedown', onMouseDown);\r\n prevRootElement?.removeEventListener('mouseup', onMouseUp);\r\n rootElement?.addEventListener('mousemove', onMouseMove);\r\n rootElement?.addEventListener('mousedown', onMouseDown);\r\n rootElement?.addEventListener('mouseup', onMouseUp);\r\n });\r\n\r\n return () => {\r\n removeRootListener();\r\n };\r\n }, [activeCell, draggingDirection, editor, resetState]);\r\n\r\n const isHeightChanging = (direction: MouseDraggingDirection) => {\r\n if (direction === 'bottom') {\r\n return true;\r\n }\r\n return false;\r\n };\r\n\r\n const updateRowHeight = useCallback(\r\n (heightChange: number) => {\r\n if (!activeCell) {\r\n throw new Error('TableCellResizer: Expected active cell.');\r\n }\r\n\r\n editor.update(\r\n () => {\r\n const tableCellNode = $getNearestNodeFromDOMNode(activeCell.elem);\r\n if (!$isTableCellNode(tableCellNode)) {\r\n throw new Error('TableCellResizer: Table cell node not found.');\r\n }\r\n\r\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);\r\n\r\n const tableRowIndex = $getTableRowIndexFromTableCellNode(tableCellNode) + tableCellNode.getRowSpan() - 1;\r\n\r\n const tableRows = tableNode.getChildren();\r\n\r\n if (tableRowIndex >= tableRows.length || tableRowIndex < 0) {\r\n throw new Error('Expected table cell to be inside of table row.');\r\n }\r\n\r\n const tableRow = tableRows[tableRowIndex];\r\n\r\n if (!$isTableRowNode(tableRow)) {\r\n throw new Error('Expected table row');\r\n }\r\n\r\n let height = tableRow.getHeight();\r\n if (height === undefined) {\r\n const rowCells = tableRow.getChildren<TableCellNode>();\r\n height = Math.min(...rowCells.map((cell) => getCellNodeHeight(cell, editor) ?? Infinity));\r\n }\r\n\r\n const newHeight = Math.max(height + heightChange, MIN_ROW_HEIGHT);\r\n tableRow.setHeight(newHeight);\r\n },\r\n { tag: 'skip-scroll-into-view' }\r\n );\r\n },\r\n [activeCell, editor]\r\n );\r\n\r\n const getCellNodeHeight = (cell: TableCellNode, activeEditor: LexicalEditor): number | undefined => {\r\n const domCellNode = activeEditor.getElementByKey(cell.getKey());\r\n return domCellNode?.clientHeight;\r\n };\r\n\r\n const getCellColumnIndex = (tableCellNode: TableCellNode, tableMap: TableMapType) => {\r\n for (let row = 0; row < tableMap.length; row++) {\r\n for (let column = 0; column < tableMap[row].length; column++) {\r\n if (tableMap[row][column].cell === tableCellNode) {\r\n return column;\r\n }\r\n }\r\n }\r\n return -1;\r\n };\r\n\r\n const updateColumnWidth = useCallback(\r\n (widthChange: number) => {\r\n if (!activeCell) {\r\n throw new Error('TableCellResizer: Expected active cell.');\r\n }\r\n editor.update(\r\n () => {\r\n const tableCellNode = $getNearestNodeFromDOMNode(activeCell.elem);\r\n if (!$isTableCellNode(tableCellNode)) {\r\n throw new Error('TableCellResizer: Table cell node not found.');\r\n }\r\n\r\n const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);\r\n const [tableMap] = $computeTableMapSkipCellCheck(tableNode, null, null);\r\n const columnIndex = getCellColumnIndex(tableCellNode, tableMap);\r\n if (columnIndex === undefined) {\r\n throw new Error('TableCellResizer: Table column not found.');\r\n }\r\n\r\n const colWidths = tableNode.getColWidths();\r\n if (!colWidths) {\r\n return;\r\n }\r\n const width = colWidths[columnIndex];\r\n if (width === undefined) {\r\n return;\r\n }\r\n const newColWidths = [...colWidths];\r\n const newWidth = Math.max(width + widthChange, MIN_COLUMN_WIDTH);\r\n newColWidths[columnIndex] = newWidth;\r\n tableNode.setColWidths(newColWidths);\r\n\r\n // modification: when resizing a column, also resize the next column so the table doesn't overflow\r\n if (columnIndex < tableNode.getColumnCount() - 1) {\r\n const nextColWidths = tableNode.getColWidths();\r\n if (!nextColWidths) {\r\n return;\r\n }\r\n const newNextColWidths = [...nextColWidths];\r\n const newColumnIndex = columnIndex + 1;\r\n const newNextWidth = nextColWidths[newColumnIndex];\r\n const nextWidth = Math.max(newNextWidth - widthChange, MIN_COLUMN_WIDTH);\r\n newNextColWidths[newColumnIndex] = nextWidth;\r\n tableNode.setColWidths(newNextColWidths);\r\n }\r\n },\r\n { tag: 'skip-scroll-into-view' }\r\n );\r\n },\r\n [activeCell, editor]\r\n );\r\n\r\n const mouseUpHandler = useCallback(\r\n (direction: MouseDraggingDirection) => {\r\n const handler = (event: MouseEvent) => {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n\r\n if (!activeCell) {\r\n throw new Error('TableCellResizer: Expected active cell.');\r\n }\r\n\r\n if (mouseStartPosRef.current) {\r\n const { x, y } = mouseStartPosRef.current;\r\n\r\n if (activeCell === null) {\r\n return;\r\n }\r\n const zoom = calculateZoomLevel(event.target as Element);\r\n\r\n if (isHeightChanging(direction)) {\r\n const heightChange = (event.clientY - y) / zoom;\r\n updateRowHeight(heightChange);\r\n } else {\r\n const widthChange = (event.clientX - x) / zoom;\r\n updateColumnWidth(widthChange);\r\n }\r\n\r\n resetState();\r\n document.removeEventListener('mouseup', handler);\r\n }\r\n };\r\n return handler;\r\n },\r\n [activeCell, resetState, updateColumnWidth, updateRowHeight]\r\n );\r\n\r\n const toggleResize = useCallback(\r\n (direction: MouseDraggingDirection): MouseEventHandler<HTMLDivElement> =>\r\n (event) => {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n\r\n if (!activeCell) {\r\n throw new Error('TableCellResizer: Expected active cell.');\r\n }\r\n\r\n mouseStartPosRef.current = {\r\n x: event.clientX,\r\n y: event.clientY,\r\n };\r\n updateMouseCurrentPos(mouseStartPosRef.current);\r\n updateDraggingDirection(direction);\r\n\r\n document.addEventListener('mouseup', mouseUpHandler(direction));\r\n },\r\n [activeCell, mouseUpHandler]\r\n );\r\n\r\n const getResizers = useCallback(() => {\r\n if (activeCell) {\r\n const { height, width, top, left } = activeCell.elem.getBoundingClientRect();\r\n const zoom = calculateZoomLevel(activeCell.elem);\r\n const zoneWidth = 10; // Pixel width of the zone where you can drag the edge\r\n const styles = {\r\n bottom: {\r\n backgroundColor: 'none',\r\n cursor: 'ns-resize',\r\n height: `${zoneWidth}px`,\r\n left: `${window.pageXOffset + left}px`,\r\n top: `${window.pageYOffset + top + height - zoneWidth / HALF}px`,\r\n width: `${width}px`,\r\n zIndex: 5000,\r\n },\r\n right: {\r\n backgroundColor: 'none',\r\n cursor: 'ew-resize',\r\n height: `${height}px`,\r\n left: `${window.pageXOffset + left + width - zoneWidth / HALF}px`,\r\n top: `${window.pageYOffset + top}px`,\r\n width: `${zoneWidth}px`,\r\n zIndex: 5000,\r\n },\r\n };\r\n\r\n const tableRect = tableRectRef.current;\r\n\r\n if (draggingDirection && mouseCurrentPos && tableRect) {\r\n if (isHeightChanging(draggingDirection)) {\r\n styles[draggingDirection].left = `${window.pageXOffset + tableRect.left}px`;\r\n styles[draggingDirection].top = `${window.pageYOffset + mouseCurrentPos.y / zoom}px`;\r\n styles[draggingDirection].height = '3px';\r\n styles[draggingDirection].width = `${tableRect.width}px`;\r\n } else {\r\n styles[draggingDirection].top = `${window.pageYOffset + tableRect.top}px`;\r\n styles[draggingDirection].left = `${window.pageXOffset + mouseCurrentPos.x / zoom}px`;\r\n styles[draggingDirection].width = '3px';\r\n styles[draggingDirection].height = `${tableRect.height}px`;\r\n }\r\n\r\n styles[draggingDirection].backgroundColor = '#adf';\r\n }\r\n\r\n return styles;\r\n }\r\n\r\n return {\r\n bottom: null,\r\n left: null,\r\n right: null,\r\n top: null,\r\n };\r\n }, [activeCell, draggingDirection, mouseCurrentPos]);\r\n\r\n const resizerStyles = getResizers();\r\n\r\n return (\r\n <div ref={resizerRef}>\r\n {activeCell != null && !isMouseDown && (\r\n <>\r\n <div\r\n className={styles['table-cell-resizer__resizer']}\r\n style={resizerStyles.right || undefined}\r\n onMouseDown={toggleResize('right')}\r\n />\r\n <div\r\n className={styles['table-cell-resizer__resizer']}\r\n style={resizerStyles.bottom || undefined}\r\n onMouseDown={toggleResize('bottom')}\r\n />\r\n </>\r\n )}\r\n </div>\r\n );\r\n}\r\n\r\nexport const TableCellResizerPlugin = (): null | ReactPortal => {\r\n const [editor] = useLexicalComposerContext();\r\n const isEditable = useLexicalEditable();\r\n\r\n return useMemo(\r\n () => (isEditable ? createPortal(<TableCellResizer editor={editor} />, document.body) : null),\r\n [editor, isEditable]\r\n );\r\n};\r\n"],"names":["c","n","t","u","e","a","i","l","r","d","o","MIN_ROW_HEIGHT","MIN_COLUMN_WIDTH","HALF","TableCellResizer","editor","targetRef","useRef","resizerRef","tableRectRef","mouseStartPosRef","mouseCurrentPos","updateMouseCurrentPos","useState","activeCell","updateActiveCell","isMouseDown","updateIsMouseDown","draggingDirection","updateDraggingDirection","resetState","useCallback","isMouseDownOnEvent","event","useEffect","TableNode","tableNode","tableRows","columnCount","colWidths","cell","colIdx","domCell","tableHasContent","isNested","$getNearestNodeOfType","TableCellNode","newColWidth","getEditorParrentCellWidth","getEditorContentWidth","TableWrapperNode","wrapperNode","$createTableWrapperNode","onMouseMove","target","isHTMLElement","getDOMCellFromTarget","tableCellNode","$getNearestNodeFromDOMNode","$getTableNodeFromLexicalNodeOrThrow","tableElement","getTableElement","onMouseDown","onMouseUp","removeRootListener","rootElement","prevRootElement","isHeightChanging","direction","updateRowHeight","heightChange","$isTableCellNode","tableRowIndex","$getTableRowIndexFromTableCellNode","tableRow","$isTableRowNode","height","rowCells","getCellNodeHeight","newHeight","activeEditor","getCellColumnIndex","tableMap","row","column","updateColumnWidth","widthChange","$computeTableMapSkipCellCheck","columnIndex","width","newColWidths","newWidth","nextColWidths","newNextColWidths","newColumnIndex","newNextWidth","nextWidth","mouseUpHandler","handler","x","y","zoom","calculateZoomLevel","toggleResize","resizerStyles","top","left","zoneWidth","styles","table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]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as c, jsx as e, Fragment as Z } from "react/jsx-runtime";
|
|
2
2
|
import { o as ee } from "./LexicalComposerContext.prod-DOyoZx0P.js";
|
|
3
|
-
import { c as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { forwardRef as
|
|
3
|
+
import { c as V } from "./clsx-OuTLNxxd.js";
|
|
4
|
+
import { P as te, A as oe, T as re } from "./LexicalTable.prod-CZ1mYUR-.js";
|
|
5
|
+
import { ar as le, A as ne, a as Y, f as O, aV as ie, ah as ae } from "./Lexical.prod-DBU6xTBY.js";
|
|
6
|
+
import { w as se } from "./LexicalUtils.prod-C3vvQk50.js";
|
|
7
|
+
import { forwardRef as z, useState as y, useRef as g, useId as q, useImperativeHandle as K, useEffect as L } from "react";
|
|
8
8
|
import "./components/Accordion/Accordion.js";
|
|
9
9
|
import { Button as I } from "./components/Buttons/Button.js";
|
|
10
10
|
import "./components/Buttons/LinkButton.js";
|
|
@@ -21,9 +21,9 @@ import "./components/IconButton/IconButton.js";
|
|
|
21
21
|
import "./components/Input/Input.js";
|
|
22
22
|
import { InputField as U } from "./components/InputField/InputField.js";
|
|
23
23
|
import "react-router";
|
|
24
|
-
import { s as
|
|
24
|
+
import { s as R, M as ce } from "./MultiSelectItem-DbOdEllV.js";
|
|
25
25
|
import "./components/RteEditor/Providers/LanguageProvider.js";
|
|
26
|
-
import {
|
|
26
|
+
import { ensureHttps as me, validateUrlWithProtocol as de } from "./components/RteEditor/Plugins/LinkPlugin/helpers.js";
|
|
27
27
|
import { Icon as J } from "./components/Icon/Icon.js";
|
|
28
28
|
import { FeedbackBox as G } from "./components/FeedbackBox/FeedbackBox.js";
|
|
29
29
|
import { useTranslation as j } from "./components/RteEditor/hooks/useTranslation.js";
|
|
@@ -31,8 +31,8 @@ import "./components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMen
|
|
|
31
31
|
import "./components/RteEditor/hooks/components/Flyout.js";
|
|
32
32
|
import { PREVENT_OPEN_DELAY as ue, deleteTable as fe, deleteColumn as pe, insertColumn as be, deleteRow as _e, insertRow as he, createTable as ke, getEditorParrentCellWidth as ve, getEditorContentWidth as we, DEFAULT_EDITOR_WIDTH as Fe, DEFAULT_COL_WIDTH as Ce } from "./components/RteEditor/Plugins/TablePlugin/helpers.js";
|
|
33
33
|
import { $createTableWrapperNode as ye } from "./components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js";
|
|
34
|
-
import { useFlyout as
|
|
35
|
-
import { s as
|
|
34
|
+
import { useFlyout as Te } from "./components/RteEditor/hooks/useFlyout.js";
|
|
35
|
+
import { s as P } from "./RteEditor.module-CovRFt0S.js";
|
|
36
36
|
import "react-dom";
|
|
37
37
|
import "./index-yEhaxKq-.js";
|
|
38
38
|
import "./components/SearchField/SearchField.js";
|
|
@@ -41,9 +41,9 @@ import "./components/SelectListbox/SelectProvider.js";
|
|
|
41
41
|
import "./components/Sortable/components/SortableItem.js";
|
|
42
42
|
import "./SortableProvider-l8-7ClBJ.js";
|
|
43
43
|
import "./components/WeekSelector/components/WeekSelectorOptionContainer.js";
|
|
44
|
-
import { setScrollableContainers as
|
|
44
|
+
import { setScrollableContainers as Ne, removeScrollableContainers as xe } from "./components/RteEditor/helpers.js";
|
|
45
45
|
import './assets/TablePlugin.css';function ge({ label: _, clearTrigger: u, onClear: a }) {
|
|
46
|
-
return /* @__PURE__ */ c("header", { className:
|
|
46
|
+
return /* @__PURE__ */ c("header", { className: R["multi-select__header"], children: [
|
|
47
47
|
/* @__PURE__ */ e(S, { htmlFor: "multi-select-list", children: _ }),
|
|
48
48
|
u && /* @__PURE__ */ e(I, { variant: "blank", onClick: a, children: u })
|
|
49
49
|
] });
|
|
@@ -53,14 +53,14 @@ const Q = ({ scrollable: _ = !0, noBorder: u, header: a, children: o }) => /* @_
|
|
|
53
53
|
/* @__PURE__ */ e(
|
|
54
54
|
"div",
|
|
55
55
|
{
|
|
56
|
-
className:
|
|
57
|
-
[
|
|
56
|
+
className: V(R["multi-select"], {
|
|
57
|
+
[R["multi-select--no-border"]]: u
|
|
58
58
|
}),
|
|
59
59
|
children: /* @__PURE__ */ e(
|
|
60
60
|
"ul",
|
|
61
61
|
{
|
|
62
|
-
className:
|
|
63
|
-
[
|
|
62
|
+
className: V(R["multi-select__list"], {
|
|
63
|
+
[R["multi-select__list--scrollable"]]: _
|
|
64
64
|
}),
|
|
65
65
|
id: "multi-select-list",
|
|
66
66
|
children: o
|
|
@@ -71,27 +71,27 @@ const Q = ({ scrollable: _ = !0, noBorder: u, header: a, children: o }) => /* @_
|
|
|
71
71
|
] });
|
|
72
72
|
Q.MultiSelectHeader = ge;
|
|
73
73
|
Q.MultiSelectItem = ce;
|
|
74
|
-
const Ee = "_linkform_ki2qx_1",
|
|
74
|
+
const Ee = "_linkform_ki2qx_1", Le = "_linkform__footer_ki2qx_12", x = {
|
|
75
75
|
linkform: Ee,
|
|
76
76
|
"linkform__input-field": "_linkform__input-field_ki2qx_5",
|
|
77
|
-
linkform__footer:
|
|
77
|
+
linkform__footer: Le,
|
|
78
78
|
"linkform__input-url-wrapper": "_linkform__input-url-wrapper_ki2qx_19",
|
|
79
79
|
"linkform__open-url-button": "_linkform__open-url-button_ki2qx_31"
|
|
80
|
-
}, yt =
|
|
80
|
+
}, yt = z(
|
|
81
81
|
({ onCloseHandler: _, onSaveHandler: u, isLink: a = { active: !1, url: "", linktext: "" } }, o) => {
|
|
82
|
-
const l = j(), [f, m] = y(a.url || ""), [s, h] = y(a.linktext || ""), [F, k] = y(!1), [C, v] = y(null), [w, p] = y(null), n = g(null),
|
|
82
|
+
const l = j(), [f, m] = y(a.url || ""), [s, h] = y(a.linktext || ""), [F, k] = y(!1), [C, v] = y(null), [w, p] = y(null), n = g(null), T = `link_${q()}`, t = `text_${q()}`, r = () => {
|
|
83
83
|
window.open(me(f), "_blank");
|
|
84
84
|
}, b = (i) => {
|
|
85
85
|
m(i.target.value);
|
|
86
86
|
}, d = (i) => {
|
|
87
87
|
h(i.target.value);
|
|
88
|
-
},
|
|
89
|
-
!
|
|
88
|
+
}, A = (i) => de(i) === !1 || i.trim() === "" ? (v(l.errortext.urlNotValid), !1) : (v(null), !0), D = (i) => i.trim() === "" ? (p(l.errortext.linkTextNotValid), !1) : (p(null), !0), $ = () => {
|
|
89
|
+
!A(f) || F && !D(s) || (u(f, s), E());
|
|
90
90
|
}, B = () => {
|
|
91
91
|
_(), E();
|
|
92
92
|
}, E = () => {
|
|
93
93
|
m(""), k(!1), v(null), p(null);
|
|
94
|
-
},
|
|
94
|
+
}, N = (i, X) => {
|
|
95
95
|
m(i), !X && !i && k(!0);
|
|
96
96
|
}, M = () => {
|
|
97
97
|
n.current && n.current.focus();
|
|
@@ -99,15 +99,15 @@ const Ee = "_linkform_ki2qx_1", Re = "_linkform__footer_ki2qx_12", T = {
|
|
|
99
99
|
return K(o, () => ({
|
|
100
100
|
clearForm: E,
|
|
101
101
|
focusFirstField: M,
|
|
102
|
-
setDefaults:
|
|
103
|
-
})), /* @__PURE__ */ c("div", { className:
|
|
104
|
-
/* @__PURE__ */ c(H, { className:
|
|
105
|
-
/* @__PURE__ */ e(S, { htmlFor:
|
|
106
|
-
/* @__PURE__ */ c("div", { className:
|
|
102
|
+
setDefaults: N
|
|
103
|
+
})), /* @__PURE__ */ c("div", { className: x.linkform, children: [
|
|
104
|
+
/* @__PURE__ */ c(H, { className: x["linkform__input-field"], children: [
|
|
105
|
+
/* @__PURE__ */ e(S, { htmlFor: T, children: l.links.linkLabel }),
|
|
106
|
+
/* @__PURE__ */ c("div", { className: x["linkform__input-url-wrapper"], children: [
|
|
107
107
|
/* @__PURE__ */ e(
|
|
108
108
|
U,
|
|
109
109
|
{
|
|
110
|
-
id:
|
|
110
|
+
id: T,
|
|
111
111
|
placeholder: l.links.linkPlaceholder,
|
|
112
112
|
value: f,
|
|
113
113
|
onChange: (i) => b(i),
|
|
@@ -116,11 +116,11 @@ const Ee = "_linkform_ki2qx_1", Re = "_linkform__footer_ki2qx_12", T = {
|
|
|
116
116
|
"aria-label": l.aria.labels.linkField
|
|
117
117
|
}
|
|
118
118
|
),
|
|
119
|
-
f && /* @__PURE__ */ e("button", { type: "button", onClick: r, className:
|
|
119
|
+
f && /* @__PURE__ */ e("button", { type: "button", onClick: r, className: x["linkform__open-url-button"], children: /* @__PURE__ */ e(J, { name: "ArrowTopRightOnSquare", size: 20 }) })
|
|
120
120
|
] }),
|
|
121
121
|
C && /* @__PURE__ */ e(G, { level: "error", feedback: C })
|
|
122
122
|
] }),
|
|
123
|
-
F && /* @__PURE__ */ c(H, { className:
|
|
123
|
+
F && /* @__PURE__ */ c(H, { className: x["linkform__input-field"], children: [
|
|
124
124
|
/* @__PURE__ */ e(S, { htmlFor: t, children: l.links.linkText }),
|
|
125
125
|
/* @__PURE__ */ e(
|
|
126
126
|
U,
|
|
@@ -134,20 +134,20 @@ const Ee = "_linkform_ki2qx_1", Re = "_linkform__footer_ki2qx_12", T = {
|
|
|
134
134
|
),
|
|
135
135
|
w && /* @__PURE__ */ e(G, { level: "error", feedback: w })
|
|
136
136
|
] }),
|
|
137
|
-
/* @__PURE__ */ c("div", { className:
|
|
137
|
+
/* @__PURE__ */ c("div", { className: x.linkform__footer, children: [
|
|
138
138
|
/* @__PURE__ */ e(I, { variant: "secondary", onClick: B, "aria-label": l.common.cancel, type: "button", children: l.common.cancel }),
|
|
139
139
|
/* @__PURE__ */ e(I, { variant: "primary", onClick: $, "aria-label": l.aria.labels.linkOkButton, type: "button", children: l.links.addLink })
|
|
140
140
|
] })
|
|
141
141
|
] });
|
|
142
142
|
}
|
|
143
|
-
),
|
|
144
|
-
tableform:
|
|
143
|
+
), Re = "_tableform_t5fpq_1", Ie = "_tableform__footer_t5fpq_12", W = {
|
|
144
|
+
tableform: Re,
|
|
145
145
|
"tableform__input-field": "_tableform__input-field_t5fpq_5",
|
|
146
146
|
tableform__footer: Ie
|
|
147
|
-
}, Se =
|
|
148
|
-
const o = j(), [l, f] = y(), [m, s] = y(), h = g(null), F = `row_${
|
|
147
|
+
}, Se = z(({ onCloseHandler: _, onSaveHandler: u }, a) => {
|
|
148
|
+
const o = j(), [l, f] = y(), [m, s] = y(), h = g(null), F = `row_${q()}`, k = `column_${q()}`, C = (n, T) => {
|
|
149
149
|
const t = n.target.value;
|
|
150
|
-
|
|
150
|
+
T === "row" ? f(parseInt(t)) : s(parseInt(t));
|
|
151
151
|
}, v = () => {
|
|
152
152
|
l !== void 0 && m !== void 0 && (u(l, m), p());
|
|
153
153
|
}, w = () => {
|
|
@@ -158,15 +158,15 @@ const Ee = "_linkform_ki2qx_1", Re = "_linkform__footer_ki2qx_12", T = {
|
|
|
158
158
|
return K(a, () => ({
|
|
159
159
|
clearForm: p,
|
|
160
160
|
focusFirstField: () => h.current?.focus()
|
|
161
|
-
})),
|
|
161
|
+
})), L(() => {
|
|
162
162
|
const n = () => {
|
|
163
163
|
w();
|
|
164
164
|
};
|
|
165
|
-
return
|
|
166
|
-
window.removeEventListener("scroll", n), window.removeEventListener("resize", n),
|
|
165
|
+
return Ne(n), window.addEventListener("scroll", n), window.addEventListener("resize", n), () => {
|
|
166
|
+
window.removeEventListener("scroll", n), window.removeEventListener("resize", n), xe(n);
|
|
167
167
|
};
|
|
168
|
-
}, []), /* @__PURE__ */ c("div", { className:
|
|
169
|
-
/* @__PURE__ */ c(H, { className:
|
|
168
|
+
}, []), /* @__PURE__ */ c("div", { className: W.tableform, children: [
|
|
169
|
+
/* @__PURE__ */ c(H, { className: W["tableform__input-field"], children: [
|
|
170
170
|
/* @__PURE__ */ e(S, { htmlFor: F, children: o.table.nrofRows }),
|
|
171
171
|
/* @__PURE__ */ e(
|
|
172
172
|
U,
|
|
@@ -180,7 +180,7 @@ const Ee = "_linkform_ki2qx_1", Re = "_linkform__footer_ki2qx_12", T = {
|
|
|
180
180
|
}
|
|
181
181
|
)
|
|
182
182
|
] }),
|
|
183
|
-
/* @__PURE__ */ c(H, { className:
|
|
183
|
+
/* @__PURE__ */ c(H, { className: W["tableform__input-field"], children: [
|
|
184
184
|
/* @__PURE__ */ e(S, { htmlFor: k, children: o.table.nrofColumns }),
|
|
185
185
|
/* @__PURE__ */ e(
|
|
186
186
|
U,
|
|
@@ -193,7 +193,7 @@ const Ee = "_linkform_ki2qx_1", Re = "_linkform__footer_ki2qx_12", T = {
|
|
|
193
193
|
}
|
|
194
194
|
)
|
|
195
195
|
] }),
|
|
196
|
-
/* @__PURE__ */ c("div", { className:
|
|
196
|
+
/* @__PURE__ */ c("div", { className: W.tableform__footer, children: [
|
|
197
197
|
/* @__PURE__ */ e(I, { variant: "secondary", onClick: w, "aria-label": o.common.cancel, children: o.common.cancel }),
|
|
198
198
|
/* @__PURE__ */ e(
|
|
199
199
|
I,
|
|
@@ -207,19 +207,19 @@ const Ee = "_linkform_ki2qx_1", Re = "_linkform__footer_ki2qx_12", T = {
|
|
|
207
207
|
)
|
|
208
208
|
] })
|
|
209
209
|
] });
|
|
210
|
-
}),
|
|
211
|
-
const a = j(), [o] = ee(), { flyout: l, showFlyout: f, hideFlyout: m, isVisible: s } =
|
|
210
|
+
}), Tt = z(({ isActive: _ }, u) => {
|
|
211
|
+
const a = j(), [o] = ee(), { flyout: l, showFlyout: f, hideFlyout: m, isVisible: s } = Te(), h = g(void 0), F = g(null), k = g(!1), C = g(s), v = () => {
|
|
212
212
|
const t = F.current?.getBoundingClientRect();
|
|
213
|
-
!k.current && t && f({ position: { top: t.bottom, left: t.left }, ...
|
|
213
|
+
!k.current && t && f({ position: { top: t.bottom, left: t.left }, ...T });
|
|
214
214
|
}, w = () => {
|
|
215
215
|
m();
|
|
216
216
|
}, p = (t, r) => {
|
|
217
217
|
o.update(() => {
|
|
218
|
-
const b = Y(), d = ke(t, r),
|
|
218
|
+
const b = Y(), d = ke(t, r), A = O(b) && b.anchor.getNode() || ie(b) && b.getNodes()[0] || null, D = A ? se(A, re) : null, $ = D ? ve(D, r, o) : we(o) || Fe, B = Math.max(Ce, Math.floor($ / Math.max(1, r))), E = Array.from({ length: r }, () => B);
|
|
219
219
|
d.setColWidths(E);
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
const M =
|
|
220
|
+
const N = ye();
|
|
221
|
+
N.append(d), O(b) ? b.insertNodes([N]) : ae().append(N);
|
|
222
|
+
const M = N.getFirstDescendant();
|
|
223
223
|
M && M.select();
|
|
224
224
|
}), w();
|
|
225
225
|
}, n = (t) => {
|
|
@@ -249,7 +249,7 @@ const Ee = "_linkform_ki2qx_1", Re = "_linkform__footer_ki2qx_12", T = {
|
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
});
|
|
252
|
-
},
|
|
252
|
+
}, T = {
|
|
253
253
|
children: /* @__PURE__ */ e(
|
|
254
254
|
Se,
|
|
255
255
|
{
|
|
@@ -259,9 +259,9 @@ const Ee = "_linkform_ki2qx_1", Re = "_linkform__footer_ki2qx_12", T = {
|
|
|
259
259
|
}
|
|
260
260
|
)
|
|
261
261
|
};
|
|
262
|
-
return
|
|
262
|
+
return L(() => {
|
|
263
263
|
s ? (k.current = !0, h.current?.focusFirstField()) : (h.current?.clearForm(), setTimeout(() => k.current = !1, ue));
|
|
264
|
-
}, [h, s]),
|
|
264
|
+
}, [h, s]), L(() => {
|
|
265
265
|
const t = o.registerCommand(
|
|
266
266
|
le,
|
|
267
267
|
(r) => r.ctrlKey && r.shiftKey && r.code === "Digit9" ? (r.preventDefault(), v(), !0) : !1,
|
|
@@ -270,9 +270,9 @@ const Ee = "_linkform_ki2qx_1", Re = "_linkform__footer_ki2qx_12", T = {
|
|
|
270
270
|
return () => {
|
|
271
271
|
t();
|
|
272
272
|
};
|
|
273
|
-
}, [o]),
|
|
273
|
+
}, [o]), L(() => {
|
|
274
274
|
C.current = s;
|
|
275
|
-
}, [s]),
|
|
275
|
+
}, [s]), L(() => {
|
|
276
276
|
const t = (r) => {
|
|
277
277
|
r.key === "Escape" && C.current && (r.preventDefault(), r.stopPropagation(), w());
|
|
278
278
|
};
|
|
@@ -281,13 +281,13 @@ const Ee = "_linkform_ki2qx_1", Re = "_linkform__footer_ki2qx_12", T = {
|
|
|
281
281
|
};
|
|
282
282
|
}, []), K(u, () => ({
|
|
283
283
|
mutateTable: n
|
|
284
|
-
})), /* @__PURE__ */ e("div", { className:
|
|
284
|
+
})), /* @__PURE__ */ e("div", { className: P["editor__toolbar-button-group"], children: /* @__PURE__ */ c("div", { className: P["editor__toolbar-button-flyoutwrapper"], children: [
|
|
285
285
|
/* @__PURE__ */ e(
|
|
286
286
|
"button",
|
|
287
287
|
{
|
|
288
288
|
onClick: v,
|
|
289
289
|
title: a.table.tableTooltip,
|
|
290
|
-
className:
|
|
290
|
+
className: V(P["editor__toolbar-button"], _ && P["editor__toolbar-button--active"]),
|
|
291
291
|
"aria-label": a.aria.labels.table,
|
|
292
292
|
"aria-keyshortcuts": a.aria.keyshortcuts.table,
|
|
293
293
|
ref: F,
|
|
@@ -301,8 +301,8 @@ const Ee = "_linkform_ki2qx_1", Re = "_linkform__footer_ki2qx_12", T = {
|
|
|
301
301
|
export {
|
|
302
302
|
yt as A,
|
|
303
303
|
Q as M,
|
|
304
|
-
|
|
304
|
+
Tt as T,
|
|
305
305
|
ge as a,
|
|
306
306
|
Se as b
|
|
307
307
|
};
|
|
308
|
-
//# sourceMappingURL=TablePlugin-
|
|
308
|
+
//# sourceMappingURL=TablePlugin-CfTWvWk1.js.map
|