@uva-glass/component-library 3.57.2 → 3.57.3
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/ActionList-D2GC2qPX.js.map +1 -1
- package/dist/AddCatalogueLinkForm-Di0xm7Ep.js.map +1 -1
- package/dist/ClipboardButton-Cg6LGUiD.js.map +1 -1
- package/dist/ControlsButton-Byx4XQtB.js.map +1 -1
- package/dist/CopyableText-BKsM-TuS.js.map +1 -1
- package/dist/DataTable-Cgn_RKTA.js.map +1 -1
- package/dist/{Lexical.prod-nAj5fF96.js → Lexical.prod-Dy5aDppc.js} +2449 -1794
- package/dist/Lexical.prod-Dy5aDppc.js.map +1 -0
- package/dist/LexicalClipboard.prod-CS8a49uL.js +398 -0
- package/dist/LexicalClipboard.prod-CS8a49uL.js.map +1 -0
- package/dist/{LexicalComposerContext.prod-DumMmRBt.js → LexicalComposerContext.prod-D4HOlWII.js} +3 -3
- package/dist/LexicalComposerContext.prod-D4HOlWII.js.map +1 -0
- package/dist/LexicalHtml.prod-BtzosUOH.js +1611 -0
- package/dist/LexicalHtml.prod-BtzosUOH.js.map +1 -0
- package/dist/LexicalLink.prod-DzgwWhQM.js +646 -0
- package/dist/LexicalLink.prod-DzgwWhQM.js.map +1 -0
- package/dist/LexicalList.prod-icY8mpm6.js +710 -0
- package/dist/LexicalList.prod-icY8mpm6.js.map +1 -0
- package/dist/{LexicalTable.prod-BpHQYpBM.js → LexicalTable.prod-Bf0is-op.js} +674 -750
- package/dist/LexicalTable.prod-Bf0is-op.js.map +1 -0
- package/dist/LexicalUtils.prod-CjGUKarD.js +259 -0
- package/dist/LexicalUtils.prod-CjGUKarD.js.map +1 -0
- package/dist/{LinkContextMenu-Byu3AEqp.js → LinkContextMenu-C8ehPbP8.js} +2 -2
- package/dist/{LinkContextMenu-Byu3AEqp.js.map → LinkContextMenu-C8ehPbP8.js.map} +1 -1
- package/dist/MenuLink-sK2_W2zs.js.map +1 -1
- package/dist/MetaDataList-Co9WCexh.js.map +1 -1
- package/dist/MultiSelectBox-D34qAgzc.js.map +1 -1
- package/dist/OverlayStepBar-BiC06Itd.js.map +1 -1
- package/dist/{PasteHandlerPlugin-DyTXcFsj.js → PasteHandlerPlugin-CSo_lOE8.js} +6 -6
- package/dist/{PasteHandlerPlugin-DyTXcFsj.js.map → PasteHandlerPlugin-CSo_lOE8.js.map} +1 -1
- package/dist/Periods-B4ms3N24.js.map +1 -1
- package/dist/SortableProvider-D-6Ttz0h.js.map +1 -1
- package/dist/{TableCellContextMenu--4IdoKAU.js → TableCellContextMenu-Cu5iXYSJ.js} +2 -2
- package/dist/{TableCellContextMenu--4IdoKAU.js.map → TableCellContextMenu-Cu5iXYSJ.js.map} +1 -1
- package/dist/{TableCellResizerPlugin-Dn8Ks2Lm.js → TableCellResizerPlugin-Bb2blXnq.js} +43 -43
- package/dist/TableCellResizerPlugin-Bb2blXnq.js.map +1 -0
- package/dist/VarIndicator-D0cnlcIf.js.map +1 -1
- package/dist/{chunk-5WKL7XVT-3IraU-Ja.js → chunk-5WKL7XVT-CvOIS3NE.js} +15 -15
- package/dist/{chunk-5WKL7XVT-3IraU-Ja.js.map → chunk-5WKL7XVT-CvOIS3NE.js.map} +1 -1
- package/dist/{client-BcEWjSJP.js → client-CXlG3hNo.js} +956 -957
- package/dist/{client-BcEWjSJP.js.map → client-CXlG3hNo.js.map} +1 -1
- package/dist/components/Accordion/Accordion.test.js +3 -3
- package/dist/components/Accordion/Accordion.test.js.map +1 -1
- package/dist/components/AccordionCard/AccordionCard.stories.js.map +1 -1
- package/dist/components/AccordionCard/AccordionCard.test.js +3 -3
- package/dist/components/AccordionCard/AccordionCard.test.js.map +1 -1
- package/dist/components/ActionList/ActionList.test.js +3 -3
- package/dist/components/ActionList/ActionList.test.js.map +1 -1
- package/dist/components/AppStatusBar/AppStatusBar.test.js +2 -2
- package/dist/components/AppStatusBar/AppStatusBar.test.js.map +1 -1
- package/dist/components/Attention/Attention.stories.js.map +1 -1
- package/dist/components/Attention/Attention.test.js +2 -2
- package/dist/components/Attention/Attention.test.js.map +1 -1
- package/dist/components/Backdrop/Backdrop.stories.js.map +1 -1
- package/dist/components/Backdrop/Backdrop.test.js +2 -2
- package/dist/components/Backdrop/Backdrop.test.js.map +1 -1
- package/dist/components/Buttons/Button.stories.js +1 -1
- package/dist/components/Buttons/Button.test.js +2 -2
- package/dist/components/Buttons/Button.test.js.map +1 -1
- package/dist/components/Buttons/LinkButton.stories.js +1 -1
- package/dist/components/Buttons/LinkButton.test.js +2 -2
- package/dist/components/Buttons/LinkButton.test.js.map +1 -1
- package/dist/components/Buttons/MenuButton.stories.js +1 -1
- package/dist/components/Buttons/MenuButton.test.js +2 -2
- package/dist/components/Buttons/MenuButton.test.js.map +1 -1
- package/dist/components/Card/Card.test.js +2 -2
- package/dist/components/Card/Card.test.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.stories.js +1 -1
- package/dist/components/Checkbox/Checkbox.stories.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.test.js +3 -3
- package/dist/components/Checkbox/Checkbox.test.js.map +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.stories.js +1 -1
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js +2 -2
- package/dist/components/CheckboxButtonBar/CheckboxButtonBar.test.js.map +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.js +1 -1
- package/dist/components/CheckboxTree/CheckboxTree.stories.js +3 -3
- package/dist/components/CheckboxTree/CheckboxTree.stories.js.map +1 -1
- package/dist/components/CheckboxTree/index.js +1 -1
- package/dist/components/Chip/Chip.stories.js +1 -1
- package/dist/components/ControlsButton/ControlsButton.stories.js +1 -1
- package/dist/components/CopyableText/CopyableText.stories.js.map +1 -1
- package/dist/components/DataTable/DataTable.stories.js +2 -2
- package/dist/components/DataTable/DataTable.stories.js.map +1 -1
- package/dist/components/Drawer/Drawer.stories.js +1 -1
- package/dist/components/Drawer/Drawer.stories.js.map +1 -1
- package/dist/components/EmptyStateDataDisplay/EmptyStateDataDisplay.stories.js.map +1 -1
- package/dist/components/FeedbackBar/FeedbackBar.stories.js.map +1 -1
- package/dist/components/FeedbackBar/FeedbackBar.test.js +2 -2
- package/dist/components/FeedbackBar/FeedbackBar.test.js.map +1 -1
- package/dist/components/FormInput/FormInput.js +1 -1
- package/dist/components/FormInput/FormInput.stories.js +2 -2
- package/dist/components/FormInput/index.js +1 -1
- package/dist/components/GridRow/GridRow.stories.js.map +1 -1
- package/dist/components/Icon/Icon.stories.js.map +1 -1
- package/dist/components/IconButton/IconButton.stories.js +1 -1
- package/dist/components/IconButton/IconButton.stories.js.map +1 -1
- package/dist/components/InfoBanner/InfoBanner.stories.js.map +1 -1
- package/dist/components/InfoMessage/InfoMessage.stories.js.map +1 -1
- package/dist/components/InputField/InputField.stories.js +1 -1
- package/dist/components/InputField/InputField.stories.js.map +1 -1
- package/dist/components/Label/Label.test.js +2 -2
- package/dist/components/Label/Label.test.js.map +1 -1
- package/dist/components/MenuLink/MenuLink.stories.js.map +1 -1
- package/dist/components/MetaDataBar/MetaDataBar.stories.js.map +1 -1
- package/dist/components/MetaDataBar/MetaDataBar.test.js +1 -1
- package/dist/components/MetaDataBar/MetaDataBar.test.js.map +1 -1
- package/dist/components/MetaDataList/MetaDataList.stories.js.map +1 -1
- package/dist/components/ModalDialog/ModalDialog.stories.js +1 -1
- package/dist/components/ModalDialog/ModalDialog.stories.js.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/MultiSelect/MultiSelect.stories.js +2 -2
- package/dist/components/MultiSelect/MultiSelect.stories.js.map +1 -1
- package/dist/components/MultiSelect/components/MultiSelectHeader.js +1 -1
- package/dist/components/MultiSelect/index.js +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.stories.js +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.stories.js.map +1 -1
- package/dist/components/MultiSelectBox/MultiSelectBox.test.js +2 -2
- package/dist/components/MultiSelectBox/MultiSelectBox.test.js.map +1 -1
- package/dist/components/Notification/Notification.stories.js +1 -1
- package/dist/components/Notification/Notification.test.js +2 -2
- package/dist/components/Notification/Notification.test.js.map +1 -1
- package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js +1 -1
- package/dist/components/OverlayCloseButton/OverlayCloseButton.stories.js.map +1 -1
- package/dist/components/PageOverlay/PageOverlay.stories.js.map +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.js +1 -1
- package/dist/components/PeriodSelector/PeriodSelector.stories.js +2 -2
- package/dist/components/PeriodSelector/PeriodSelector.stories.js.map +1 -1
- package/dist/components/PeriodSelector/index.js +1 -1
- package/dist/components/Periods/Periods.stories.js.map +1 -1
- package/dist/components/ProgrammeCard/ProgrammeCard.stories.js.map +1 -1
- package/dist/components/RadioButton/RadioButton.stories.js.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.stories.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.stories.js.map +1 -1
- package/dist/components/RadioGroup/Radiogroup.test.js +2 -2
- package/dist/components/RadioGroup/Radiogroup.test.js.map +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.js +1 -1
- package/dist/components/RadioTabSelector/RadioTabSelector.stories.js +2 -2
- package/dist/components/RadioTabSelector/index.js +1 -1
- package/dist/components/Repeater/Repeater.stories.js.map +1 -1
- package/dist/components/RteEditor/EditorHeader/EditorHeader.js +1 -1
- package/dist/components/RteEditor/EditorHeader/index.js +1 -1
- package/dist/components/RteEditor/Plugins/BlockFormatPlugin/BlockFormatPlugin.js +4 -4
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js +35 -35
- package/dist/components/RteEditor/Plugins/CourseCataloguePlugin/CourseCataloguePlugin.js.map +1 -1
- package/dist/components/RteEditor/Plugins/HistoryPlugin/HistoryPlugin.js +1 -1
- package/dist/components/RteEditor/Plugins/HistoryPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/AddLinkForm/AddLinkFrom.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkContextMenu/LinkContextMenu.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/LinkPlugin.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/helpers.js +1 -1
- package/dist/components/RteEditor/Plugins/LinkPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/ListPlugin/ListPlugin.js +15 -15
- package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/PasteHandlerPlugin.js +1 -1
- package/dist/components/RteEditor/Plugins/PasteHandlerPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/TableCellResizerPlugin/TableCellResizerPlugin.js +1 -1
- 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/TableCellContextMenu/TableCellContextMenu.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TableCellContextMenu/index.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/TablePlugin.js +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js +33 -33
- package/dist/components/RteEditor/Plugins/TablePlugin/helpers.js.map +1 -1
- package/dist/components/RteEditor/Plugins/TablePlugin/index.js +2 -2
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/ToolbarPlugin.js +1 -1
- package/dist/components/RteEditor/Plugins/ToolbarPlugin/index.js +1 -1
- package/dist/components/RteEditor/Plugins/index.js +4 -4
- package/dist/components/RteEditor/RteEditor.js +1 -1
- package/dist/components/RteEditor/RteEditor.stories.js +1 -1
- package/dist/components/RteEditor/RteEditor.stories.js.map +1 -1
- package/dist/components/RteEditor/helpers.js +7 -7
- package/dist/components/RteEditor/helpers.js.map +1 -1
- package/dist/components/RteEditor/index.js +1 -1
- package/dist/components/RteEditor/nodes/CourseCatalogueNode/CourseCatalogueNode.js +18 -18
- package/dist/components/RteEditor/nodes/CourseCatalogueNode/CourseCatalogueNode.js.map +1 -1
- package/dist/components/RteEditor/nodes/TableWrapperNode/TableWrapperNode.js +22 -22
- package/dist/components/SearchField/SearcheField.stories.js.map +1 -1
- package/dist/components/SectionNotification/SectionNotification.stories.js.map +1 -1
- package/dist/components/SelectListbox/SelectListBox.stories.js +1 -1
- package/dist/components/SelectListbox/SelectListBox.stories.js.map +1 -1
- package/dist/components/SelectListbox/SelectProvider.js.map +1 -1
- package/dist/components/SelectListbox/components/SelectButton.js.map +1 -1
- package/dist/components/SelectListbox/components/SelectOption.js.map +1 -1
- package/dist/components/Slider/Slider.stories.js.map +1 -1
- package/dist/components/Sortable/Sortable.stories.js +1 -1
- package/dist/components/Sortable/Sortable.stories.js.map +1 -1
- package/dist/components/Spinner/Spinner.stories.js.map +1 -1
- package/dist/components/StatusBadge/StatusBadge.test.js +2 -2
- package/dist/components/StatusBadge/StatusBadge.test.js.map +1 -1
- package/dist/components/StatusPill/StatusPill.stories.js.map +1 -1
- package/dist/components/TextArea/TextArea.stories.js +1 -1
- package/dist/components/TextArea/TextArea.test.js +3 -3
- package/dist/components/TextArea/TextArea.test.js.map +1 -1
- package/dist/components/ToggleSwitch/ToggleSwitch.stories.js +1 -1
- package/dist/components/Tooltip/Tooltip.stories.js.map +1 -1
- package/dist/components/VarIndicator/VarIndicator.stories.js +1 -1
- package/dist/components/VarIndicator/VarIndicator.test.js +3 -3
- package/dist/components/VarIndicator/VarIndicator.test.js.map +1 -1
- package/dist/components/WeekSelector/WeekSelector.js.map +1 -1
- package/dist/components/WeekSelector/WeekSelector.stories.js.map +1 -1
- package/dist/components/WeekSelector/components/WeekSelectorOption.js.map +1 -1
- package/dist/components/hooks/useOnClickOutside.js.map +1 -1
- package/dist/components/hooks/usePositionedFloaters.js.map +1 -1
- package/dist/components/hooks/useResponsive.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components-CgBF6db6.js +2013 -0
- package/dist/components-CgBF6db6.js.map +1 -0
- package/dist/{dist-C6Ar8a59.js → dist-oLwM--0y.js} +14 -14
- package/dist/{dist-C6Ar8a59.js.map → dist-oLwM--0y.js.map} +1 -1
- package/dist/{esm-B6Pg-v2v.js → esm-BXzGXYWZ.js} +3 -3
- package/dist/{esm-B6Pg-v2v.js.map → esm-BXzGXYWZ.js.map} +1 -1
- package/dist/{helpers-BzYayeT-.js → helpers-MMNO9vlK.js} +9 -9
- package/dist/helpers-MMNO9vlK.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/{react-18-DbbN8Pdb.js → react-18-BwdnKC48.js} +3 -3
- package/dist/react-18-BwdnKC48.js.map +1 -0
- package/dist/{react.esm-56DGmlLk.js → react.esm-DwWzhs9e.js} +17 -17
- package/dist/react.esm-DwWzhs9e.js.map +1 -0
- package/dist/setupTests.js +2 -2
- package/dist/setupTests.js.map +1 -1
- package/dist/storybook__react.d.js +266 -266
- package/dist/storybook__react.d.js.map +1 -1
- package/dist/{test-WxLxsxwA.js → test-Gtly6H2f.js} +7 -5
- package/dist/{test-WxLxsxwA.js.map → test-Gtly6H2f.js.map} +1 -1
- package/dist/{test-utils-CMrZ33U0.js → test-utils-BVa31HVj.js} +2 -2
- package/dist/{test-utils-CMrZ33U0.js.map → test-utils-BVa31HVj.js.map} +1 -1
- package/package.json +21 -22
- package/dist/Lexical.prod-nAj5fF96.js.map +0 -1
- package/dist/LexicalClipboard.prod-B9sWgdS2.js +0 -348
- package/dist/LexicalClipboard.prod-B9sWgdS2.js.map +0 -1
- package/dist/LexicalComposerContext.prod-DumMmRBt.js.map +0 -1
- package/dist/LexicalHtml.prod-RCMsF0qt.js +0 -2139
- package/dist/LexicalHtml.prod-RCMsF0qt.js.map +0 -1
- package/dist/LexicalLink.prod-BcBNTFEb.js +0 -707
- package/dist/LexicalLink.prod-BcBNTFEb.js.map +0 -1
- package/dist/LexicalList.prod-THQt9B32.js +0 -890
- package/dist/LexicalList.prod-THQt9B32.js.map +0 -1
- package/dist/LexicalTable.prod-BpHQYpBM.js.map +0 -1
- package/dist/LexicalUtils.prod-7S6iuu9A.js +0 -347
- package/dist/LexicalUtils.prod-7S6iuu9A.js.map +0 -1
- package/dist/TableCellResizerPlugin-Dn8Ks2Lm.js.map +0 -1
- package/dist/components-KU0q76JR.js +0 -2150
- package/dist/components-KU0q76JR.js.map +0 -1
- package/dist/helpers-BzYayeT-.js.map +0 -1
- package/dist/react-18-DbbN8Pdb.js.map +0 -1
- package/dist/react.esm-56DGmlLk.js.map +0 -1
- /package/dist/{chunk-CWhphoD1.js → rolldown-runtime-CWhphoD1.js} +0 -0
|
@@ -0,0 +1,710 @@
|
|
|
1
|
+
import { $ as e, $t as t, Bn as n, Bt as r, Dr as i, Er as a, Ft as o, I as s, K as c, M as l, Mr as u, Mt as d, N as f, Qt as p, St as ee, U as m, Wt as te, ar as ne, f as h, fn as g, g as _, gn as v, gr as y, ln as re, lt as b, n as x, nr as ie, o as ae, p as S, q as C, rt as w, sr as T, vt as E, wn as D, x as O } from "./Lexical.prod-Dy5aDppc.js";
|
|
2
|
+
import { l as oe } from "./LexicalUtils.prod-CjGUKarD.js";
|
|
3
|
+
import { f as k } from "./LexicalHtml.prod-BtzosUOH.js";
|
|
4
|
+
//#region node_modules/.pnpm/@lexical+list@0.46.0_typescript@5.9.3/node_modules/@lexical/list/dist/LexicalList.prod.mjs
|
|
5
|
+
function A(e, ...t) {
|
|
6
|
+
let n = new URL("https://lexical.dev/docs/error"), r = new URLSearchParams();
|
|
7
|
+
r.append("code", e);
|
|
8
|
+
for (let e of t) r.append("v", e);
|
|
9
|
+
throw n.search = r.toString(), Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
10
|
+
}
|
|
11
|
+
function j(e) {
|
|
12
|
+
let t = 1, n = e.getParent();
|
|
13
|
+
for (; n != null;) {
|
|
14
|
+
if (G(n)) {
|
|
15
|
+
let e = n.getParent();
|
|
16
|
+
if (X(e)) {
|
|
17
|
+
t++, n = e.getParent();
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
A(40);
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
}
|
|
26
|
+
function M(e) {
|
|
27
|
+
let t = e.getParent();
|
|
28
|
+
X(t) || A(40);
|
|
29
|
+
let n = t, r = t;
|
|
30
|
+
for (; r !== null;) r = r.getParent(), X(r) && (n = r);
|
|
31
|
+
return n;
|
|
32
|
+
}
|
|
33
|
+
function N(e) {
|
|
34
|
+
let t = [], n = e.getChildren().filter(G);
|
|
35
|
+
for (let e = 0; e < n.length; e++) {
|
|
36
|
+
let r = n[e], i = r.getFirstChild();
|
|
37
|
+
X(i) ? t = t.concat(N(i)) : t.push(r);
|
|
38
|
+
}
|
|
39
|
+
return t;
|
|
40
|
+
}
|
|
41
|
+
function P(e) {
|
|
42
|
+
return G(e) && X(e.getFirstChild());
|
|
43
|
+
}
|
|
44
|
+
function F(e, t) {
|
|
45
|
+
return G(e) && (t.length === 0 || t.length === 1 && e.is(t[0]) && e.getChildrenSize() === 0);
|
|
46
|
+
}
|
|
47
|
+
function I(e) {
|
|
48
|
+
let t = c();
|
|
49
|
+
if (t !== null) {
|
|
50
|
+
let n = t.getNodes();
|
|
51
|
+
if (v(t)) {
|
|
52
|
+
let [r] = t.getStartEndPoints(), i = r.getNode(), a = i.getParent();
|
|
53
|
+
if (C(i)) {
|
|
54
|
+
let e = i.getFirstChild();
|
|
55
|
+
if (e) n = e.selectStart().getNodes();
|
|
56
|
+
else {
|
|
57
|
+
let e = y();
|
|
58
|
+
i.append(e), n = e.select().getNodes();
|
|
59
|
+
}
|
|
60
|
+
} else if (F(i, n)) {
|
|
61
|
+
let t = Y(e);
|
|
62
|
+
if (C(a)) {
|
|
63
|
+
i.replace(t);
|
|
64
|
+
let e = W();
|
|
65
|
+
_(i) && (e.setFormat(i.getFormatType()), e.setIndent(i.getIndent())), t.append(e);
|
|
66
|
+
} else if (G(i)) {
|
|
67
|
+
let e = i.getParentOrThrow();
|
|
68
|
+
L(t, e.getChildren()), e.replace(t);
|
|
69
|
+
}
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
let r = /* @__PURE__ */ new Set();
|
|
74
|
+
for (let t = 0; t < n.length; t++) {
|
|
75
|
+
let i = n[t];
|
|
76
|
+
if (_(i) && i.isEmpty() && !G(i) && !r.has(i.getKey())) {
|
|
77
|
+
R(i, e);
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
let a = E(i) ? i.getParent() : G(i) && i.isEmpty() ? i : null;
|
|
81
|
+
for (; a != null;) {
|
|
82
|
+
let t = a.getKey();
|
|
83
|
+
if (X(a)) {
|
|
84
|
+
if (!r.has(t)) {
|
|
85
|
+
let n = Y(e);
|
|
86
|
+
L(n, a.getChildren()), a.replace(n), r.add(t);
|
|
87
|
+
}
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
{
|
|
91
|
+
let n = a.getParent();
|
|
92
|
+
if (C(n) && !r.has(t)) {
|
|
93
|
+
r.add(t), R(a, e);
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
a = n;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function L(e, t) {
|
|
103
|
+
e.splice(e.getChildrenSize(), 0, t);
|
|
104
|
+
}
|
|
105
|
+
function R(e, t) {
|
|
106
|
+
if (X(e)) return e;
|
|
107
|
+
let n = e.getPreviousSibling(), r = e.getNextSibling(), i = W(), a;
|
|
108
|
+
if (L(i, e.getChildren()), X(n) && t === n.getListType()) n.append(i), X(r) && t === r.getListType() && (L(n, r.getChildren()), r.remove()), a = n;
|
|
109
|
+
else if (X(r) && t === r.getListType()) r.getFirstChildOrThrow().insertBefore(i), a = r;
|
|
110
|
+
else {
|
|
111
|
+
let n = Y(t);
|
|
112
|
+
n.append(i), e.replace(n), a = n;
|
|
113
|
+
}
|
|
114
|
+
i.setFormat(e.getFormatType()), i.setIndent(e.getIndent());
|
|
115
|
+
let o = c();
|
|
116
|
+
return v(o) && (a.getKey() === o.anchor.key && o.anchor.set(i.getKey(), o.anchor.offset, "element"), a.getKey() === o.focus.key && o.focus.set(i.getKey(), o.focus.offset, "element")), e.remove(), a;
|
|
117
|
+
}
|
|
118
|
+
function z(e, t) {
|
|
119
|
+
let n = e.getLastChild(), r = t.getFirstChild();
|
|
120
|
+
n && r && P(n) && P(r) && (z(n.getFirstChild(), r.getFirstChild()), r.remove());
|
|
121
|
+
let i = t.getChildren();
|
|
122
|
+
i.length > 0 && e.append(...i), t.remove();
|
|
123
|
+
}
|
|
124
|
+
function se() {
|
|
125
|
+
let e = c();
|
|
126
|
+
if (v(e)) {
|
|
127
|
+
let t = /* @__PURE__ */ new Set(), n = e.getNodes(), i = e.anchor.getNode();
|
|
128
|
+
if (F(i, n)) t.add(M(i));
|
|
129
|
+
else for (let e = 0; e < n.length; e++) {
|
|
130
|
+
let r = n[e];
|
|
131
|
+
if (E(r)) {
|
|
132
|
+
let e = oe(r, V);
|
|
133
|
+
e != null && t.add(M(e));
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
for (let n of t) {
|
|
137
|
+
let t = n, i = N(n);
|
|
138
|
+
for (let n of i) {
|
|
139
|
+
let i = y().setTextStyle(e.style).setTextFormat(e.format);
|
|
140
|
+
L(i, n.getChildren()), t.insertAfter(i), t = i, n.__key === e.anchor.key && r(e.anchor, T(S(i, "next"))), n.__key === e.focus.key && r(e.focus, T(S(i, "next"))), n.remove();
|
|
141
|
+
}
|
|
142
|
+
n.remove();
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
function B(e) {
|
|
147
|
+
let t = e.getListType() !== "check", n = e.getStart();
|
|
148
|
+
for (let r of e.getChildren()) G(r) && (r.getValue() !== n && r.setValue(n), t && r.getLatest().__checked != null && r.setChecked(void 0), X(r.getFirstChild()) || n++);
|
|
149
|
+
}
|
|
150
|
+
function ce(e) {
|
|
151
|
+
let t = /* @__PURE__ */ new Set();
|
|
152
|
+
if (P(e) || t.has(e.getKey())) return;
|
|
153
|
+
let n = e.getParent(), r = e.getNextSibling(), i = e.getPreviousSibling();
|
|
154
|
+
if (P(r) && P(i)) {
|
|
155
|
+
let n = i.getFirstChild();
|
|
156
|
+
if (X(n)) {
|
|
157
|
+
n.append(e);
|
|
158
|
+
let i = r.getFirstChild();
|
|
159
|
+
X(i) && (L(n, i.getChildren()), r.remove(), t.add(r.getKey()));
|
|
160
|
+
}
|
|
161
|
+
} else if (P(r)) {
|
|
162
|
+
let t = r.getFirstChild();
|
|
163
|
+
if (X(t)) {
|
|
164
|
+
let n = t.getFirstChild();
|
|
165
|
+
n !== null && n.insertBefore(e);
|
|
166
|
+
}
|
|
167
|
+
} else if (P(i)) {
|
|
168
|
+
let t = i.getFirstChild();
|
|
169
|
+
X(t) && t.append(e);
|
|
170
|
+
} else if (X(n)) {
|
|
171
|
+
let t = l(e), a = l(n);
|
|
172
|
+
t.append(a), a.append(e), i ? i.insertAfter(t) : r ? r.insertBefore(t) : n.append(t);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function le(e) {
|
|
176
|
+
if (P(e)) return;
|
|
177
|
+
let t = e.getParent(), n = t ? t.getParent() : void 0;
|
|
178
|
+
if (X(n ? n.getParent() : void 0) && G(n) && X(t)) {
|
|
179
|
+
let r = t ? t.getFirstChild() : void 0, i = t ? t.getLastChild() : void 0;
|
|
180
|
+
if (e.is(r)) n.insertBefore(e), t.isEmpty() && n.remove();
|
|
181
|
+
else if (e.is(i)) n.insertAfter(e), t.isEmpty() && n.remove();
|
|
182
|
+
else {
|
|
183
|
+
let r = l(e), i = l(t);
|
|
184
|
+
r.append(i), e.getPreviousSiblings().forEach((e) => i.append(e));
|
|
185
|
+
let a = l(e), o = l(t);
|
|
186
|
+
a.append(o), L(o, e.getNextSiblings()), n.insertBefore(r), n.insertAfter(a), n.replace(e);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
function ue(e = !1) {
|
|
191
|
+
let t = c();
|
|
192
|
+
if (!v(t) || !t.isCollapsed()) return !1;
|
|
193
|
+
let n = t.anchor.getNode(), r = null;
|
|
194
|
+
if (G(n) && n.getChildrenSize() === 0) r = n;
|
|
195
|
+
else if (D(n)) {
|
|
196
|
+
let e = n.getParent();
|
|
197
|
+
G(e) && e.getChildren().every((e) => D(e) && e.getTextContent().trim() === "") && (r = e);
|
|
198
|
+
}
|
|
199
|
+
if (r === null) return !1;
|
|
200
|
+
let i = M(r), a = r.getParent();
|
|
201
|
+
X(a) || A(40);
|
|
202
|
+
let o = a.getParent(), s;
|
|
203
|
+
if (C(o)) s = y(), i.insertAfter(s);
|
|
204
|
+
else {
|
|
205
|
+
if (!G(o)) return !1;
|
|
206
|
+
s = l(o), o.insertAfter(s);
|
|
207
|
+
}
|
|
208
|
+
s.setTextStyle(t.style).setTextFormat(t.format).select();
|
|
209
|
+
let u = r.getNextSiblings();
|
|
210
|
+
if (u.length > 0) {
|
|
211
|
+
let t = e ? function(e, t) {
|
|
212
|
+
return e.getStart() + t.getIndexWithinParent();
|
|
213
|
+
}(a, r) : 1, n = l(a).setStart(t);
|
|
214
|
+
if (G(s)) {
|
|
215
|
+
let e = l(s);
|
|
216
|
+
e.append(n), s.insertAfter(e);
|
|
217
|
+
} else s.insertAfter(n);
|
|
218
|
+
n.append(...u);
|
|
219
|
+
}
|
|
220
|
+
return function(e) {
|
|
221
|
+
let t = e;
|
|
222
|
+
for (; t.getNextSibling() == null && t.getPreviousSibling() == null;) {
|
|
223
|
+
let e = t.getParent();
|
|
224
|
+
if (e == null || !G(e) && !X(e)) break;
|
|
225
|
+
t = e;
|
|
226
|
+
}
|
|
227
|
+
t.remove();
|
|
228
|
+
}(r), !0;
|
|
229
|
+
}
|
|
230
|
+
var V = class extends b {
|
|
231
|
+
__value;
|
|
232
|
+
__checked;
|
|
233
|
+
$config() {
|
|
234
|
+
return this.config("listitem", {
|
|
235
|
+
$transform: (e) => {
|
|
236
|
+
let t = e.getParent();
|
|
237
|
+
if (X(t)) t.getListType() !== "check" && e.getChecked() != null && e.setChecked(void 0);
|
|
238
|
+
else if (t) {
|
|
239
|
+
let n = e.createParentElementNode();
|
|
240
|
+
X(n) || A(340);
|
|
241
|
+
let r = [e];
|
|
242
|
+
for (let t of ["previous", "next"]) {
|
|
243
|
+
r.reverse();
|
|
244
|
+
for (let { origin: n } of w(e, t)) {
|
|
245
|
+
if (!G(n)) break;
|
|
246
|
+
r.push(n);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
e.insertBefore(n), n.splice(0, 0, r), C(t) || (re(n, te(w(n, "next")), {
|
|
250
|
+
$shouldSplit: () => !1,
|
|
251
|
+
removeEmptyDestination: !0
|
|
252
|
+
}), t.isEmpty() && t.isAttached() && t.remove());
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
extends: b,
|
|
256
|
+
importDOM: a({ li: () => ({
|
|
257
|
+
conversion: de,
|
|
258
|
+
priority: 0
|
|
259
|
+
}) })
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
constructor(e = 1, t = void 0, n) {
|
|
263
|
+
super(n), this.__value = e === void 0 ? 1 : e, this.__checked = t;
|
|
264
|
+
}
|
|
265
|
+
afterCloneFrom(e) {
|
|
266
|
+
super.afterCloneFrom(e), this.__value = e.__value, this.__checked = e.__checked;
|
|
267
|
+
}
|
|
268
|
+
createDOM(e) {
|
|
269
|
+
let t = document.createElement("li");
|
|
270
|
+
return this.updateListItemDOM(null, t, e), t;
|
|
271
|
+
}
|
|
272
|
+
updateListItemDOM(e, t, r) {
|
|
273
|
+
(function(e, t) {
|
|
274
|
+
let n = t.getParent();
|
|
275
|
+
!X(n) || n.getListType() !== "check" || X(t.getFirstChild()) ? (e.removeAttribute("role"), e.removeAttribute("tabIndex"), e.removeAttribute("aria-checked")) : (e.setAttribute("role", "checkbox"), e.setAttribute("tabIndex", "-1"), e.setAttribute("aria-checked", t.getChecked() ? "true" : "false"));
|
|
276
|
+
})(t, this), t.value = this.__value, function(e, t, r) {
|
|
277
|
+
let a = t.list;
|
|
278
|
+
if (!a) return;
|
|
279
|
+
let o = a.listitem, s = a.nested && a.nested.listitem, c = r.getParent(), l = X(c) && c.getListType() === "check", u = r.getChecked(), d = r.getChildren().some((e) => X(e)), f = [];
|
|
280
|
+
a.listitemChecked !== void 0 && f.push(a.listitemChecked), a.listitemUnchecked !== void 0 && f.push(a.listitemUnchecked), s !== void 0 && f.push(...n(s)), f.length > 0 && h(e, ...f);
|
|
281
|
+
let p = [];
|
|
282
|
+
if (o !== void 0 && p.push(...n(o)), l) {
|
|
283
|
+
let e = u ? a.listitemChecked : a.listitemUnchecked;
|
|
284
|
+
e !== void 0 && p.push(e);
|
|
285
|
+
}
|
|
286
|
+
s !== void 0 && d && p.push(...n(s)), p.length > 0 && i(e, ...p);
|
|
287
|
+
}(t, r.theme, this);
|
|
288
|
+
let a = e ? e.__style : "", s = this.__style;
|
|
289
|
+
a !== s && o(t.style, s, a), function(e, t, n) {
|
|
290
|
+
let r = t.__textStyle, i = n ? n.__textStyle : "";
|
|
291
|
+
if (n !== null && i === r) return;
|
|
292
|
+
let a = m(r);
|
|
293
|
+
for (let t in a) e.style.setProperty(`--listitem-marker-${t}`, a[t]);
|
|
294
|
+
if (i !== "") for (let t in m(i)) t in a || e.style.removeProperty(`--listitem-marker-${t}`);
|
|
295
|
+
}(t, this, e);
|
|
296
|
+
}
|
|
297
|
+
updateDOM(e, t, n) {
|
|
298
|
+
let r = t;
|
|
299
|
+
return this.updateListItemDOM(e, r, n), !1;
|
|
300
|
+
}
|
|
301
|
+
updateFromJSON(e) {
|
|
302
|
+
return super.updateFromJSON(e).setValue(e.value).setChecked(e.checked);
|
|
303
|
+
}
|
|
304
|
+
exportDOM(e) {
|
|
305
|
+
let t = this.createDOM(e._config), n = this.getFormatType();
|
|
306
|
+
n && (t.style.textAlign = n);
|
|
307
|
+
let r = this.getDirection();
|
|
308
|
+
return r && (t.dir = r), P(this) ? {
|
|
309
|
+
after(e) {
|
|
310
|
+
if (p(e)) {
|
|
311
|
+
let t = e.previousElementSibling;
|
|
312
|
+
if (p(t) && t.nodeName === "LI") {
|
|
313
|
+
for (; e.firstChild;) t.append(e.firstChild);
|
|
314
|
+
e.remove();
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
return e;
|
|
318
|
+
},
|
|
319
|
+
element: t
|
|
320
|
+
} : { element: t };
|
|
321
|
+
}
|
|
322
|
+
exportJSON() {
|
|
323
|
+
return {
|
|
324
|
+
...super.exportJSON(),
|
|
325
|
+
checked: this.getChecked(),
|
|
326
|
+
value: this.getValue()
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
append(...e) {
|
|
330
|
+
for (let t = 0; t < e.length; t++) {
|
|
331
|
+
let n = e[t];
|
|
332
|
+
if (_(n) && this.canMergeWith(n)) {
|
|
333
|
+
let e = n.getChildren();
|
|
334
|
+
this.append(...e), n.remove();
|
|
335
|
+
} else super.append(n);
|
|
336
|
+
}
|
|
337
|
+
return this;
|
|
338
|
+
}
|
|
339
|
+
replace(e, t) {
|
|
340
|
+
if (G(e)) return super.replace(e);
|
|
341
|
+
this.setIndent(0);
|
|
342
|
+
let n = this.getParentOrThrow();
|
|
343
|
+
if (!X(n)) return e;
|
|
344
|
+
if (n.__first === this.getKey()) n.insertBefore(e);
|
|
345
|
+
else if (n.__last === this.getKey()) n.insertAfter(e);
|
|
346
|
+
else {
|
|
347
|
+
let t = l(n), r = this.getNextSibling();
|
|
348
|
+
for (; r;) {
|
|
349
|
+
let e = r;
|
|
350
|
+
r = r.getNextSibling(), t.append(e);
|
|
351
|
+
}
|
|
352
|
+
n.insertAfter(e), e.insertAfter(t);
|
|
353
|
+
}
|
|
354
|
+
let r = this.__key, i = 0;
|
|
355
|
+
if (t && (_(e) || A(139), i = e.getChildrenSize(), e.splice(i, 0, this.getChildren())), t && _(e)) {
|
|
356
|
+
let t = c();
|
|
357
|
+
if (v(t)) for (let n of t.getStartEndPoints()) n.key === r && n.type === "element" && n.set(e.getKey(), i + n.offset, "element");
|
|
358
|
+
}
|
|
359
|
+
return this.remove(), n.getChildrenSize() === 0 && n.remove(), e;
|
|
360
|
+
}
|
|
361
|
+
insertAfter(e, t = !0) {
|
|
362
|
+
let n = this.getParentOrThrow();
|
|
363
|
+
if (X(n) || A(39), G(e)) return super.insertAfter(e, t);
|
|
364
|
+
let r = this.getNextSiblings();
|
|
365
|
+
if (n.insertAfter(e, t), r.length !== 0) {
|
|
366
|
+
let i = l(n);
|
|
367
|
+
r.forEach((e) => i.append(e)), e.insertAfter(i, t);
|
|
368
|
+
}
|
|
369
|
+
return e;
|
|
370
|
+
}
|
|
371
|
+
remove(e) {
|
|
372
|
+
let t = this.getPreviousSibling(), n = this.getNextSibling();
|
|
373
|
+
super.remove(e), t && n && P(t) && P(n) && (z(t.getFirstChild(), n.getFirstChild()), n.remove());
|
|
374
|
+
}
|
|
375
|
+
resetOnCopyNodeFrom(e) {
|
|
376
|
+
super.resetOnCopyNodeFrom(e), e.getChecked() && this.setChecked(!1);
|
|
377
|
+
}
|
|
378
|
+
insertNewAfter(e, t = !0) {
|
|
379
|
+
let n = l(this);
|
|
380
|
+
return this.insertAfter(n, t), n;
|
|
381
|
+
}
|
|
382
|
+
collapseAtStart(e) {
|
|
383
|
+
let t = y();
|
|
384
|
+
this.getChildren().forEach((e) => t.append(e));
|
|
385
|
+
let n = this.getParentOrThrow(), r = n.getParentOrThrow(), i = G(r);
|
|
386
|
+
if (n.getChildrenSize() === 1) if (i) n.remove(), r.select();
|
|
387
|
+
else {
|
|
388
|
+
n.insertBefore(t), n.remove();
|
|
389
|
+
let r = e.anchor, i = e.focus, a = t.getKey();
|
|
390
|
+
r.type === "element" && r.getNode().is(this) && r.set(a, r.offset, "element"), i.type === "element" && i.getNode().is(this) && i.set(a, i.offset, "element");
|
|
391
|
+
}
|
|
392
|
+
else n.insertBefore(t), this.remove();
|
|
393
|
+
return !0;
|
|
394
|
+
}
|
|
395
|
+
getValue() {
|
|
396
|
+
return this.getLatest().__value;
|
|
397
|
+
}
|
|
398
|
+
setValue(e) {
|
|
399
|
+
let t = this.getWritable();
|
|
400
|
+
return t.__value = e, t;
|
|
401
|
+
}
|
|
402
|
+
getChecked() {
|
|
403
|
+
let e = this.getLatest(), t, n = this.getParent();
|
|
404
|
+
return X(n) && (t = n.getListType()), t === "check" ? !!e.__checked : void 0;
|
|
405
|
+
}
|
|
406
|
+
setChecked(e) {
|
|
407
|
+
let t = this.getWritable();
|
|
408
|
+
return t.__checked = e, t;
|
|
409
|
+
}
|
|
410
|
+
toggleChecked() {
|
|
411
|
+
let e = this.getWritable();
|
|
412
|
+
return e.setChecked(!e.__checked);
|
|
413
|
+
}
|
|
414
|
+
getIndent() {
|
|
415
|
+
let e = this.getParent();
|
|
416
|
+
if (e === null || !this.isAttached()) return this.getLatest().__indent;
|
|
417
|
+
let t = e.getParentOrThrow(), n = 0;
|
|
418
|
+
for (; G(t);) t = t.getParentOrThrow().getParentOrThrow(), n++;
|
|
419
|
+
return n;
|
|
420
|
+
}
|
|
421
|
+
setIndent(e) {
|
|
422
|
+
typeof e != "number" && A(117), (e = Math.floor(e)) >= 0 || A(199);
|
|
423
|
+
let t = this.getIndent();
|
|
424
|
+
for (; t !== e;) t < e ? (ce(this), t++) : (le(this), t--);
|
|
425
|
+
return this;
|
|
426
|
+
}
|
|
427
|
+
canInsertAfter(e) {
|
|
428
|
+
return G(e);
|
|
429
|
+
}
|
|
430
|
+
canReplaceWith(e) {
|
|
431
|
+
return G(e);
|
|
432
|
+
}
|
|
433
|
+
canMergeWith(e) {
|
|
434
|
+
return G(e) || g(e);
|
|
435
|
+
}
|
|
436
|
+
extractWithChild(e, t) {
|
|
437
|
+
if (!v(t)) return !1;
|
|
438
|
+
let n = t.anchor.getNode(), r = t.focus.getNode();
|
|
439
|
+
return this.isParentOf(n) && this.isParentOf(r) && this.getTextContent().length === t.getTextContent().length;
|
|
440
|
+
}
|
|
441
|
+
isParentRequired() {
|
|
442
|
+
return !0;
|
|
443
|
+
}
|
|
444
|
+
createParentElementNode() {
|
|
445
|
+
return Y("bullet");
|
|
446
|
+
}
|
|
447
|
+
canMergeWhenEmpty() {
|
|
448
|
+
return !0;
|
|
449
|
+
}
|
|
450
|
+
};
|
|
451
|
+
function de(t) {
|
|
452
|
+
if (t.classList.contains("task-list-item")) {
|
|
453
|
+
for (let e of t.children) if (e.tagName === "INPUT") return H(e);
|
|
454
|
+
}
|
|
455
|
+
if (t.classList.contains("joplin-checkbox")) {
|
|
456
|
+
for (let e of t.children) if (e.classList.contains("checkbox-wrapper") && e.children.length > 0 && e.children[0].tagName === "INPUT") return H(e.children[0]);
|
|
457
|
+
}
|
|
458
|
+
let n = t.getAttribute("aria-checked"), r = W(n === "true" || n !== "false" && void 0);
|
|
459
|
+
return ae(r, t), {
|
|
460
|
+
after: U.bind(null, r),
|
|
461
|
+
node: e(r, t)
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
function H(e) {
|
|
465
|
+
if (e.getAttribute("type") !== "checkbox") return { node: null };
|
|
466
|
+
let t = W(e.hasAttribute("checked"));
|
|
467
|
+
return {
|
|
468
|
+
after: U.bind(null, t),
|
|
469
|
+
node: t
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
function U(e, t) {
|
|
473
|
+
let n = t[0];
|
|
474
|
+
return t.length === 1 && g(n) && !e.getFormatType() && n.getFormatType() ? (e.setFormat(n.getFormatType()), n.getChildren()) : t;
|
|
475
|
+
}
|
|
476
|
+
function W(e) {
|
|
477
|
+
return u(new V(void 0, e));
|
|
478
|
+
}
|
|
479
|
+
function G(e) {
|
|
480
|
+
return e instanceof V;
|
|
481
|
+
}
|
|
482
|
+
var K = class extends b {
|
|
483
|
+
__tag;
|
|
484
|
+
__start;
|
|
485
|
+
__listType;
|
|
486
|
+
$config() {
|
|
487
|
+
return this.config("list", {
|
|
488
|
+
$transform: (e) => {
|
|
489
|
+
(function(e) {
|
|
490
|
+
let t = e.getNextSibling();
|
|
491
|
+
X(t) && e.getListType() === t.getListType() && z(e, t);
|
|
492
|
+
})(e), B(e);
|
|
493
|
+
},
|
|
494
|
+
extends: b,
|
|
495
|
+
importDOM: a({
|
|
496
|
+
ol: () => ({
|
|
497
|
+
conversion: J,
|
|
498
|
+
priority: 0
|
|
499
|
+
}),
|
|
500
|
+
ul: () => ({
|
|
501
|
+
conversion: J,
|
|
502
|
+
priority: 0
|
|
503
|
+
})
|
|
504
|
+
})
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
constructor(e = "number", t = 1, n) {
|
|
508
|
+
super(n);
|
|
509
|
+
let r = fe[e] || e;
|
|
510
|
+
this.__listType = r, this.__tag = r === "number" ? "ol" : "ul", this.__start = t;
|
|
511
|
+
}
|
|
512
|
+
afterCloneFrom(e) {
|
|
513
|
+
super.afterCloneFrom(e), this.__listType = e.__listType, this.__tag = e.__tag, this.__start = e.__start;
|
|
514
|
+
}
|
|
515
|
+
getTag() {
|
|
516
|
+
return this.getLatest().__tag;
|
|
517
|
+
}
|
|
518
|
+
setListType(e) {
|
|
519
|
+
let t = this.getWritable();
|
|
520
|
+
return t.__listType = e, t.__tag = e === "number" ? "ol" : "ul", t;
|
|
521
|
+
}
|
|
522
|
+
getListType() {
|
|
523
|
+
return this.getLatest().__listType;
|
|
524
|
+
}
|
|
525
|
+
getStart() {
|
|
526
|
+
return this.getLatest().__start;
|
|
527
|
+
}
|
|
528
|
+
setStart(e) {
|
|
529
|
+
let t = this.getWritable();
|
|
530
|
+
return t.__start = e, t;
|
|
531
|
+
}
|
|
532
|
+
createDOM(e, t) {
|
|
533
|
+
let n = this.__tag, r = document.createElement(n);
|
|
534
|
+
return this.__start !== 1 && r.setAttribute("start", String(this.__start)), r.__lexicalListType = this.__listType, q(r, e.theme, this), r;
|
|
535
|
+
}
|
|
536
|
+
updateDOM(e, t, n) {
|
|
537
|
+
return e.__tag !== this.__tag || e.__listType !== this.__listType || (q(t, n.theme, this), e.__start !== this.__start && t.setAttribute("start", String(this.__start)), !1);
|
|
538
|
+
}
|
|
539
|
+
updateFromJSON(e) {
|
|
540
|
+
return super.updateFromJSON(e).setListType(e.listType).setStart(e.start);
|
|
541
|
+
}
|
|
542
|
+
exportDOM(e) {
|
|
543
|
+
let t = this.createDOM(e._config, e);
|
|
544
|
+
return p(t) && (this.__start !== 1 && t.setAttribute("start", String(this.__start)), this.__listType === "check" && t.setAttribute("__lexicalListType", "check")), { element: t };
|
|
545
|
+
}
|
|
546
|
+
exportJSON() {
|
|
547
|
+
return {
|
|
548
|
+
...super.exportJSON(),
|
|
549
|
+
listType: this.getListType(),
|
|
550
|
+
start: this.getStart(),
|
|
551
|
+
tag: this.getTag()
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
canBeEmpty() {
|
|
555
|
+
return !1;
|
|
556
|
+
}
|
|
557
|
+
canIndent() {
|
|
558
|
+
return !1;
|
|
559
|
+
}
|
|
560
|
+
splice(e, t, n) {
|
|
561
|
+
let r = n;
|
|
562
|
+
for (let e = 0; e < n.length; e++) {
|
|
563
|
+
let t = n[e];
|
|
564
|
+
G(t) || (r === n && (r = [...n]), r[e] = this.createListItemNode().append(!_(t) || X(t) || t.isInline() ? t : ne(t.getTextContent())));
|
|
565
|
+
}
|
|
566
|
+
return super.splice(e, t, r);
|
|
567
|
+
}
|
|
568
|
+
extractWithChild(e) {
|
|
569
|
+
return G(e);
|
|
570
|
+
}
|
|
571
|
+
createListItemNode() {
|
|
572
|
+
return W();
|
|
573
|
+
}
|
|
574
|
+
};
|
|
575
|
+
function q(e, t, r) {
|
|
576
|
+
let a = [], o = [], s = t.list;
|
|
577
|
+
if (s !== void 0) {
|
|
578
|
+
let e = s[`${r.__tag}Depth`] || [], t = j(r) - 1, i = t % e.length, c = e[i], l = s[r.__tag], u, d = s.nested, f = s.checklist;
|
|
579
|
+
if (d !== void 0 && d.list && (u = d.list), l !== void 0 && a.push(l), f !== void 0 && r.__listType === "check" && a.push(f), c !== void 0) {
|
|
580
|
+
a.push(...n(c));
|
|
581
|
+
for (let t = 0; t < e.length; t++) t !== i && o.push(r.__tag + t);
|
|
582
|
+
}
|
|
583
|
+
if (u !== void 0) {
|
|
584
|
+
let e = n(u);
|
|
585
|
+
t > 1 ? a.push(...e) : o.push(...e);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
o.length > 0 && h(e, ...o), a.length > 0 && i(e, ...a);
|
|
589
|
+
}
|
|
590
|
+
function J(t) {
|
|
591
|
+
let n;
|
|
592
|
+
if (function(e) {
|
|
593
|
+
return p(e) && e.nodeName.toLowerCase() === "ol";
|
|
594
|
+
}(t)) {
|
|
595
|
+
let e = t.start;
|
|
596
|
+
n = Y("number", e);
|
|
597
|
+
} else n = function(e) {
|
|
598
|
+
if (e.getAttribute("__lexicallisttype") === "check" || e.classList.contains("contains-task-list") || e.getAttribute("data-is-checklist") === "1") return !0;
|
|
599
|
+
for (let t of e.childNodes) if (p(t) && t.hasAttribute("aria-checked")) return !0;
|
|
600
|
+
return !1;
|
|
601
|
+
}(t) ? Y("check") : Y("bullet");
|
|
602
|
+
return e(n, t), {
|
|
603
|
+
after: (e) => function(e, t) {
|
|
604
|
+
let n = t.createListItemNode.bind(t), r = [];
|
|
605
|
+
for (let t = 0; t < e.length; t++) {
|
|
606
|
+
let i = e[t];
|
|
607
|
+
if (G(i)) {
|
|
608
|
+
r.push(i);
|
|
609
|
+
let e = i.getChildren();
|
|
610
|
+
e.length > 1 && e.forEach((e) => {
|
|
611
|
+
X(e) && r.push(n().append(e));
|
|
612
|
+
});
|
|
613
|
+
} else r.push(n().append(i));
|
|
614
|
+
}
|
|
615
|
+
return r;
|
|
616
|
+
}(e, n),
|
|
617
|
+
node: n
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
var fe = {
|
|
621
|
+
ol: "number",
|
|
622
|
+
ul: "bullet"
|
|
623
|
+
};
|
|
624
|
+
function Y(e = "number", t = 1) {
|
|
625
|
+
return u(new K(e, t));
|
|
626
|
+
}
|
|
627
|
+
function X(e) {
|
|
628
|
+
return e instanceof K;
|
|
629
|
+
}
|
|
630
|
+
k.tag("ol", "ul"), k.tag("li"), k.tag("li").classAll("task-list-item"), k.tag("li").classAll("joplin-checkbox");
|
|
631
|
+
var pe = /* @__PURE__ */ O("UPDATE_LIST_START_COMMAND"), Z = /* @__PURE__ */ O("INSERT_UNORDERED_LIST_COMMAND"), Q = /* @__PURE__ */ O("INSERT_ORDERED_LIST_COMMAND"), $ = /* @__PURE__ */ O("REMOVE_LIST_COMMAND");
|
|
632
|
+
function me(e, n) {
|
|
633
|
+
return ee(e.registerCommand(Q, () => (I("number"), !0), 1), e.registerCommand(pe, (e) => {
|
|
634
|
+
let { listNodeKey: t, newStart: n } = e, r = d(t);
|
|
635
|
+
return !!X(r) && (r.getListType() === "number" && (r.setStart(n), B(r)), !0);
|
|
636
|
+
}, 1), e.registerCommand(Z, () => (I("bullet"), !0), 1), e.registerCommand($, () => (se(), !0), 1), e.registerCommand(s, () => ue(!!(n && n.restoreNumbering)), 1), e.registerCommand(t, (e) => !!function() {
|
|
637
|
+
let e = c();
|
|
638
|
+
if (!v(e) || !e.isCollapsed() || e.anchor.offset !== 0) return !1;
|
|
639
|
+
let t = e.anchor.getNode(), n = x(t, G);
|
|
640
|
+
if (!G(n)) return !1;
|
|
641
|
+
let r = n.getFirstDescendant();
|
|
642
|
+
if (r === null || !n.is(t) && !r.is(t)) return !1;
|
|
643
|
+
let i = n.getParent();
|
|
644
|
+
if (!X(i) || !n.is(i.getFirstChild())) return !1;
|
|
645
|
+
let a = i.getPreviousSibling();
|
|
646
|
+
if (!f(a) || a.isIsolated() || !a.isKeyboardSelectable() && a.isInline()) return !1;
|
|
647
|
+
let o = y().append(...n.getChildren());
|
|
648
|
+
return i.insertBefore(o), n.remove(), i.isEmpty() && i.remove(), o.selectStart(), !0;
|
|
649
|
+
}() && (e.preventDefault(), !0), -8), e.registerNodeTransform(V, (e) => {
|
|
650
|
+
let t = e.getFirstChild();
|
|
651
|
+
if (t) {
|
|
652
|
+
if (D(t)) {
|
|
653
|
+
let n = t.getStyle(), r = t.getFormat();
|
|
654
|
+
e.getTextStyle() !== n && e.setTextStyle(n), e.getTextFormat() !== r && e.setTextFormat(r);
|
|
655
|
+
}
|
|
656
|
+
} else {
|
|
657
|
+
let t = c();
|
|
658
|
+
v(t) && (t.style !== e.getTextStyle() || t.format !== e.getTextFormat()) && t.isCollapsed() && e.is(t.anchor.getNode()) && e.setTextStyle(t.style).setTextFormat(t.format);
|
|
659
|
+
}
|
|
660
|
+
}), e.registerNodeTransform(ie, (e) => {
|
|
661
|
+
let t = e.getParent();
|
|
662
|
+
if (G(t) && e.is(t.getFirstChild())) {
|
|
663
|
+
let n = e.getStyle(), r = e.getFormat();
|
|
664
|
+
n === t.getTextStyle() && r === t.getTextFormat() || t.setTextStyle(n).setTextFormat(r);
|
|
665
|
+
}
|
|
666
|
+
}));
|
|
667
|
+
}
|
|
668
|
+
function he(e) {
|
|
669
|
+
let t = (e) => {
|
|
670
|
+
let t = e.getParent();
|
|
671
|
+
if (X(e.getFirstChild()) || !X(t)) return;
|
|
672
|
+
let n = x(e, (e) => G(e) && X(e.getParent()) && G(e.getPreviousSibling()));
|
|
673
|
+
if (n === null && e.getIndent() > 0) e.setIndent(0);
|
|
674
|
+
else if (G(n)) {
|
|
675
|
+
let r = n.getPreviousSibling();
|
|
676
|
+
if (G(r)) {
|
|
677
|
+
let n = function(e) {
|
|
678
|
+
let t = e, n = t.getFirstChild();
|
|
679
|
+
for (; X(n);) {
|
|
680
|
+
let e = n.getLastChild();
|
|
681
|
+
if (!G(e)) break;
|
|
682
|
+
t = e, n = t.getFirstChild();
|
|
683
|
+
}
|
|
684
|
+
return t;
|
|
685
|
+
}(r).getParent();
|
|
686
|
+
if (X(n)) {
|
|
687
|
+
let r = j(n);
|
|
688
|
+
r + 1 < j(t) && e.setIndent(r);
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
};
|
|
693
|
+
return e.registerNodeTransform(K, (e) => {
|
|
694
|
+
let n = [e];
|
|
695
|
+
for (; n.length > 0;) {
|
|
696
|
+
let e = n.shift();
|
|
697
|
+
if (X(e)) {
|
|
698
|
+
for (let r of e.getChildren()) if (G(r)) {
|
|
699
|
+
t(r);
|
|
700
|
+
let e = r.getFirstChild();
|
|
701
|
+
X(e) && n.push(e);
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
//#endregion
|
|
708
|
+
export { V as a, me as c, Z as i, he as l, X as n, Q as o, G as r, $ as s, K as t, Y as u };
|
|
709
|
+
|
|
710
|
+
//# sourceMappingURL=LexicalList.prod-icY8mpm6.js.map
|