@sps-woodland/core 8.53.9 → 8.53.11
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/lib/action-bar/action-bar/ActionBar.ve.js +1 -1
- package/lib/action-bar/index.js +1 -1
- package/lib/action-bar/index.umd.cjs +1 -1
- package/lib/action-bar/style.css +1 -1
- package/lib/add-to-list/add-to-list/AddToList.ve.js +1 -1
- package/lib/add-to-list/index.js +1 -1
- package/lib/add-to-list/index.umd.cjs +1 -1
- package/lib/add-to-list/style.css +1 -1
- package/lib/buttons/button/Button.ve.js +1 -1
- package/lib/buttons/index.js +1 -1
- package/lib/buttons/index.umd.cjs +1 -1
- package/lib/buttons/style.css +1 -1
- package/lib/cards/card/Card.ve.js +1 -1
- package/lib/cards/card-footer/CardFooter.ve.js +1 -1
- package/lib/cards/card-header/CardHeader.ve.js +1 -1
- package/lib/cards/card-title/CardTitle.ve.js +1 -1
- package/lib/cards/index.js +4 -4
- package/lib/cards/index.umd.cjs +1 -1
- package/lib/cards/style.css +1 -1
- package/lib/content-row/content-row/ContentRow.ve.js +1 -1
- package/lib/content-row/content-row-col/ContentRowCol.ve.js +1 -1
- package/lib/content-row/index.js +3 -3
- package/lib/content-row/index.umd.cjs +1 -1
- package/lib/content-row/row-list-auto-layout/RowListAutoLayout.ve.js +1 -1
- package/lib/content-row/style.css +1 -1
- package/lib/content-tiles/content-tile/ContentTile.ve.js +1 -1
- package/lib/content-tiles/content-tile-list/ContentTileList.ve.js +1 -1
- package/lib/content-tiles/index.js +2 -2
- package/lib/content-tiles/index.umd.cjs +1 -1
- package/lib/content-tiles/style.css +1 -1
- package/lib/core.css +1 -1
- package/lib/dropdowns/dropdown/Dropdown.ve.js +1 -1
- package/lib/dropdowns/index.js +3 -3
- package/lib/dropdowns/index.umd.cjs +1 -1
- package/lib/dropdowns/option-list/Option.ve.js +1 -1
- package/lib/dropdowns/option-list/OptionList.ve.js +1 -1
- package/lib/dropdowns/style.css +1 -1
- package/lib/feedback-block/FeedbackBlock.ve.js +1 -1
- package/lib/feedback-block/index.js +1 -1
- package/lib/feedback-block/index.umd.cjs +1 -1
- package/lib/feedback-block/style.css +1 -1
- package/lib/file-upload/file-upload/FileUpload.ve.js +1 -1
- package/lib/file-upload/index.js +1 -1
- package/lib/file-upload/index.umd.cjs +1 -1
- package/lib/file-upload/style.css +1 -1
- package/lib/filter-tiles/filter-tile/FilterTile.ve.js +1 -1
- package/lib/filter-tiles/filter-tile-set/FilterTileSet.ve.js +1 -1
- package/lib/filter-tiles/index.js +2 -2
- package/lib/filter-tiles/index.umd.cjs +1 -1
- package/lib/filter-tiles/style.css +1 -1
- package/lib/focused-task/focused-task/FocusedTask.ve.js +1 -1
- package/lib/focused-task/index.js +1 -1
- package/lib/focused-task/index.umd.cjs +1 -1
- package/lib/focused-task/style.css +1 -1
- package/lib/growler/Growler.ve.js +1 -1
- package/lib/growler/Sonner.ve.js +1 -1
- package/lib/growler/index.js +2 -2
- package/lib/growler/index.umd.cjs +1 -1
- package/lib/growler/style.css +1 -1
- package/lib/index.js +8 -8
- package/lib/index.umd.cjs +1 -1
- package/lib/insight-card/InsightCard.ve.js +1 -1
- package/lib/insight-card/index.js +1 -1
- package/lib/insight-card/index.umd.cjs +1 -1
- package/lib/insight-card/style.css +1 -1
- package/lib/key-value-set/index.js +2 -2
- package/lib/key-value-set/index.umd.cjs +1 -1
- package/lib/key-value-set/key-value-set/KeyValueSet.ve.js +1 -1
- package/lib/key-value-set/key-value-set-item/KeyValueSetItem.ve.js +1 -1
- package/lib/key-value-set/style.css +1 -1
- package/lib/list-bar/advanced-search/AdvancedSearch.ve.js +1 -1
- package/lib/list-bar/index.js +3 -3
- package/lib/list-bar/index.umd.cjs +1 -1
- package/lib/list-bar/list-bar/ListBar.ve.js +1 -1
- package/lib/list-bar/search-results-bar/SearchResultsBar.ve.js +1 -1
- package/lib/list-bar/style.css +1 -1
- package/lib/matrix/index.js +1 -1
- package/lib/matrix/index.umd.cjs +1 -1
- package/lib/matrix/matrix/Matrix.ve.js +1 -1
- package/lib/matrix/style.css +1 -1
- package/lib/modal/index.js +1 -1
- package/lib/modal/index.umd.cjs +1 -1
- package/lib/modal/modal/Modal.ve.js +1 -1
- package/lib/modal/style.css +1 -1
- package/lib/page-title/index.js +2 -2
- package/lib/page-title/index.umd.cjs +1 -1
- package/lib/page-title/page-subtitle/PageSubtitle.ve.js +1 -1
- package/lib/page-title/page-title/PageTitle.ve.js +1 -1
- package/lib/page-title/style.css +1 -1
- package/lib/photo/index.js +2 -2
- package/lib/photo/index.umd.cjs +1 -1
- package/lib/photo/photo/Photo.ve.js +1 -1
- package/lib/photo/photo-carousel/PhotoCarousel.ve.js +1 -1
- package/lib/photo/style.css +1 -1
- package/lib/product-bar/index.js +3 -3
- package/lib/product-bar/index.umd.cjs +1 -1
- package/lib/product-bar/product-bar/ProductBar.ve.js +1 -1
- package/lib/product-bar/product-bar-overflow-menu/ProductBarOverflowMenu.ve.js +1 -1
- package/lib/product-bar/slack-link/SlackLink.ve.js +1 -1
- package/lib/product-bar/style.css +1 -1
- package/lib/product-bar-vertical/index.js +1 -1
- package/lib/product-bar-vertical/index.umd.cjs +1 -1
- package/lib/product-bar-vertical/product-bar-vertical/ProductBarVertical.ve.js +1 -1
- package/lib/product-bar-vertical/style.css +1 -1
- package/lib/progress-indicators/index.js +1 -1
- package/lib/progress-indicators/index.umd.cjs +1 -1
- package/lib/progress-indicators/progress-bar/ProgressBar.ve.js +1 -1
- package/lib/progress-indicators/progress-bar/progress-bar-step/ProgressBarStep.ve.js +1 -1
- package/lib/progress-indicators/style.css +1 -1
- package/lib/rich-text-editor/index.js +252 -234
- package/lib/rich-text-editor/index.umd.cjs +5 -5
- package/lib/rich-text-editor/rich-text-editor/RTEToolbarButton.ve.js +1 -1
- package/lib/rich-text-editor/rich-text-editor/RichTextEditor.ve.js +1 -1
- package/lib/rich-text-editor/rich-text-editor/hooks/useHtmlToMd.d.ts.map +1 -1
- package/lib/rich-text-editor/rich-text-editor/hooks/useHtmlToMd.js +13 -12
- package/lib/rich-text-editor/rich-text-editor/utils/removeUnrepresentableBreaks.d.ts +17 -0
- package/lib/rich-text-editor/rich-text-editor/utils/removeUnrepresentableBreaks.d.ts.map +1 -0
- package/lib/rich-text-editor/rich-text-editor/utils/removeUnrepresentableBreaks.js +21 -0
- package/lib/rich-text-editor/style.css +1 -1
- package/lib/scrollable-container/ScrollableContainer.ve.js +1 -1
- package/lib/scrollable-container/index.js +1 -1
- package/lib/scrollable-container/index.umd.cjs +1 -1
- package/lib/scrollable-container/style.css +1 -1
- package/lib/side-nav/index.js +1 -1
- package/lib/side-nav/index.umd.cjs +1 -1
- package/lib/side-nav/side-nav/SideNav.ve.js +1 -1
- package/lib/side-nav/style.css +1 -1
- package/lib/sorting-header/caret/caret.ve.js +1 -1
- package/lib/sorting-header/index.js +2 -2
- package/lib/sorting-header/index.umd.cjs +1 -1
- package/lib/sorting-header/sorting-header/SortingHeader.ve.js +1 -1
- package/lib/sorting-header/sorting-header-cell/SortingHeaderCell.ve.js +1 -1
- package/lib/sorting-header/style.css +1 -1
- package/lib/style.css +1 -1
- package/lib/tabs/index.js +2 -2
- package/lib/tabs/index.umd.cjs +1 -1
- package/lib/tabs/style.css +1 -1
- package/lib/tabs/tab/Tab.ve.js +1 -1
- package/lib/tabs/tabs/Tabs.ve.js +1 -1
- package/lib/tags/clickable-tag/ClickableTag.ve.js +1 -1
- package/lib/tags/index.js +3 -3
- package/lib/tags/index.umd.cjs +1 -1
- package/lib/tags/split-tag/SplitTag.ve.js +1 -1
- package/lib/tags/style.css +1 -1
- package/lib/tags/tag/Tag.ve.js +1 -1
- package/lib/zero-state/ZeroState.ve.js +1 -1
- package/lib/zero-state/index.js +1 -1
- package/lib/zero-state/index.umd.cjs +1 -1
- package/lib/zero-state/style.css +1 -1
- package/package.json +10 -10
|
@@ -1,181 +1,199 @@
|
|
|
1
|
-
import { Metadata as
|
|
1
|
+
import { Metadata as P, useChildTestIdAttrBuilder as V, cl as H } from "@sps-woodland/core";
|
|
2
2
|
import * as d from "react";
|
|
3
|
-
import { useMemo as C, useState as v, useCallback as x, useEffect as L, useRef as
|
|
4
|
-
import { useSpsForm as
|
|
5
|
-
import { Button as
|
|
6
|
-
import { useWoodlandLanguage as
|
|
3
|
+
import { useMemo as C, useState as v, useCallback as x, useEffect as L, useRef as F } from "react";
|
|
4
|
+
import { useSpsForm as $, SpsModal as Z, SpsLabel as S, SpsTextInput as M, SpsModalFooter as G } from "@spscommerce/ds-react";
|
|
5
|
+
import { Button as j } from "@sps-woodland/core/button";
|
|
6
|
+
import { useWoodlandLanguage as z } from "@spscommerce/i18n";
|
|
7
7
|
import { Tokens as p } from "@sps-woodland/tokens";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { unified as
|
|
13
|
-
import { visit as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
function
|
|
18
|
-
onClose:
|
|
19
|
-
selectionDOMContextFind:
|
|
8
|
+
import K from "remark-parse";
|
|
9
|
+
import q from "remark-rehype";
|
|
10
|
+
import W from "rehype-sanitize";
|
|
11
|
+
import J from "rehype-stringify";
|
|
12
|
+
import { unified as B } from "unified";
|
|
13
|
+
import { visit as Q } from "unist-util-visit";
|
|
14
|
+
import X from "rehype-parse";
|
|
15
|
+
import Y from "rehype-remark";
|
|
16
|
+
import e0 from "remark-stringify";
|
|
17
|
+
function t0({
|
|
18
|
+
onClose: t,
|
|
19
|
+
selectionDOMContextFind: n,
|
|
20
20
|
selectionRange: e
|
|
21
21
|
}) {
|
|
22
|
-
const { t: r } =
|
|
22
|
+
const { t: r } = z(), o = d.useRef(e), i = d.useRef(!1), { formValue: c, formMeta: a, updateForm: s } = $({
|
|
23
23
|
text: e?.toString() || "",
|
|
24
24
|
link: ""
|
|
25
25
|
});
|
|
26
26
|
return d.useEffect(() => {
|
|
27
|
-
if (!
|
|
28
|
-
const l =
|
|
27
|
+
if (!i.current) {
|
|
28
|
+
const l = n((g) => g.tagName === "A");
|
|
29
29
|
l && (s({
|
|
30
30
|
text: l.textContent || "",
|
|
31
31
|
link: l.getAttribute("href") || ""
|
|
32
|
-
}),
|
|
32
|
+
}), i.current = !0);
|
|
33
33
|
}
|
|
34
|
-
}, [
|
|
35
|
-
|
|
34
|
+
}, [n]), /* @__PURE__ */ d.createElement(
|
|
35
|
+
Z,
|
|
36
36
|
{
|
|
37
37
|
title: "Add Link",
|
|
38
|
-
onClose: () =>
|
|
38
|
+
onClose: () => t(o.current)
|
|
39
39
|
},
|
|
40
|
-
/* @__PURE__ */ d.createElement("div", { className: "sg-row" }, /* @__PURE__ */ d.createElement("div", { className: "sg-col-12" }, /* @__PURE__ */ d.createElement(
|
|
41
|
-
/* @__PURE__ */ d.createElement("div", { className: "sg-row" }, /* @__PURE__ */ d.createElement("div", { className: "sg-col-12" }, /* @__PURE__ */ d.createElement(
|
|
42
|
-
/* @__PURE__ */ d.createElement(
|
|
40
|
+
/* @__PURE__ */ d.createElement("div", { className: "sg-row" }, /* @__PURE__ */ d.createElement("div", { className: "sg-col-12" }, /* @__PURE__ */ d.createElement(S, { for: a.fields.text }, r("richTextEditor.linkModal.text", { defaultValue: "Text" })), /* @__PURE__ */ d.createElement(M, { formMeta: a.fields.text, value: c.text }))),
|
|
41
|
+
/* @__PURE__ */ d.createElement("div", { className: "sg-row" }, /* @__PURE__ */ d.createElement("div", { className: "sg-col-12" }, /* @__PURE__ */ d.createElement(S, { for: a.fields.link }, r("richTextEditor.linkModal.link", { defaultValue: "Link" })), /* @__PURE__ */ d.createElement(M, { formMeta: a.fields.link, value: c.link }))),
|
|
42
|
+
/* @__PURE__ */ d.createElement(G, null, /* @__PURE__ */ d.createElement(j, { onClick: () => t(o.current, c) }, r("richTextEditor.linkModal.ok", { defaultValue: "OK" })))
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
return
|
|
45
|
+
function n0(t, n, e) {
|
|
46
|
+
return n in t ? Object.defineProperty(t, n, {
|
|
47
47
|
value: e,
|
|
48
48
|
enumerable: !0,
|
|
49
49
|
configurable: !0,
|
|
50
50
|
writable: !0
|
|
51
|
-
}) : n
|
|
51
|
+
}) : t[n] = e, t;
|
|
52
52
|
}
|
|
53
|
-
function b(
|
|
54
|
-
var e = Object.keys(
|
|
53
|
+
function b(t, n) {
|
|
54
|
+
var e = Object.keys(t);
|
|
55
55
|
if (Object.getOwnPropertySymbols) {
|
|
56
|
-
var r = Object.getOwnPropertySymbols(
|
|
57
|
-
|
|
58
|
-
return Object.getOwnPropertyDescriptor(
|
|
56
|
+
var r = Object.getOwnPropertySymbols(t);
|
|
57
|
+
n && (r = r.filter(function(o) {
|
|
58
|
+
return Object.getOwnPropertyDescriptor(t, o).enumerable;
|
|
59
59
|
})), e.push.apply(e, r);
|
|
60
60
|
}
|
|
61
61
|
return e;
|
|
62
62
|
}
|
|
63
|
-
function I(
|
|
64
|
-
for (var
|
|
65
|
-
var e = arguments[
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
69
|
-
Object.defineProperty(
|
|
63
|
+
function I(t) {
|
|
64
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
65
|
+
var e = arguments[n] != null ? arguments[n] : {};
|
|
66
|
+
n % 2 ? b(Object(e), !0).forEach(function(r) {
|
|
67
|
+
n0(t, r, e[r]);
|
|
68
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(e)) : b(Object(e)).forEach(function(r) {
|
|
69
|
+
Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(e, r));
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
return
|
|
72
|
+
return t;
|
|
73
73
|
}
|
|
74
|
-
var
|
|
75
|
-
for (var r of Object.keys(
|
|
74
|
+
var r0 = (t, n, e) => {
|
|
75
|
+
for (var r of Object.keys(t)) {
|
|
76
76
|
var o;
|
|
77
|
-
if (
|
|
77
|
+
if (t[r] !== ((o = n[r]) !== null && o !== void 0 ? o : e[r]))
|
|
78
78
|
return !1;
|
|
79
79
|
}
|
|
80
80
|
return !0;
|
|
81
|
-
}, N = (
|
|
82
|
-
var e =
|
|
81
|
+
}, N = (t) => (n) => {
|
|
82
|
+
var e = t.defaultClassName, r = I(I({}, t.defaultVariants), n);
|
|
83
83
|
for (var o in r) {
|
|
84
|
-
var
|
|
84
|
+
var i, c = (i = r[o]) !== null && i !== void 0 ? i : t.defaultVariants[o];
|
|
85
85
|
if (c != null) {
|
|
86
|
-
var
|
|
87
|
-
typeof
|
|
86
|
+
var a = c;
|
|
87
|
+
typeof a == "boolean" && (a = a === !0 ? "true" : "false");
|
|
88
88
|
var s = (
|
|
89
89
|
// @ts-expect-error
|
|
90
|
-
|
|
90
|
+
t.variantClassNames[o][a]
|
|
91
91
|
);
|
|
92
92
|
s && (e += " " + s);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
for (var [l, g] of
|
|
96
|
-
|
|
95
|
+
for (var [l, g] of t.compoundVariants)
|
|
96
|
+
r0(l, r, t.defaultVariants) && (e += " " + g);
|
|
97
97
|
return e;
|
|
98
|
-
},
|
|
99
|
-
function
|
|
100
|
-
icon:
|
|
101
|
-
onClick:
|
|
98
|
+
}, o0 = N({ defaultClassName: "pkg_sps-woodland_core__version_8_53_11__hash_1903a6n0", variantClassNames: { active: { true: "pkg_sps-woodland_core__version_8_53_11__hash_1903a6n1", false: "pkg_sps-woodland_core__version_8_53_11__hash_1903a6n2" } }, defaultVariants: {}, compoundVariants: [] }), c0 = { icon: "pkg_sps-woodland_core__version_8_53_11__hash_1903a6n3" };
|
|
99
|
+
function i0({
|
|
100
|
+
icon: t,
|
|
101
|
+
onClick: n,
|
|
102
102
|
selectionDOMContextFind: e,
|
|
103
103
|
activeTest: r,
|
|
104
104
|
isSimpleToggle: o = !1,
|
|
105
|
-
...
|
|
105
|
+
...i
|
|
106
106
|
}) {
|
|
107
|
-
const [c,
|
|
107
|
+
const [c, a] = d.useState(!1);
|
|
108
108
|
d.useEffect(() => {
|
|
109
|
-
r &&
|
|
109
|
+
r && a(!!e(r));
|
|
110
110
|
}, [e]);
|
|
111
111
|
const s = d.useCallback(() => {
|
|
112
|
-
|
|
113
|
-
}, [
|
|
112
|
+
n && n(c), o && a(!c);
|
|
113
|
+
}, [n, c]);
|
|
114
114
|
return /* @__PURE__ */ d.createElement(
|
|
115
115
|
"button",
|
|
116
116
|
{
|
|
117
|
-
className:
|
|
117
|
+
className: o0({ active: c }),
|
|
118
118
|
onClick: s,
|
|
119
119
|
onMouseDown: (l) => l.preventDefault(),
|
|
120
|
-
...
|
|
120
|
+
...i
|
|
121
121
|
},
|
|
122
122
|
/* @__PURE__ */ d.createElement(
|
|
123
123
|
"span",
|
|
124
124
|
{
|
|
125
|
-
className:
|
|
126
|
-
style: { backgroundImage: 'url("' +
|
|
125
|
+
className: c0.icon,
|
|
126
|
+
style: { backgroundImage: 'url("' + t + '")' },
|
|
127
127
|
"aria-hidden": "true"
|
|
128
128
|
}
|
|
129
129
|
)
|
|
130
130
|
);
|
|
131
131
|
}
|
|
132
|
-
var
|
|
133
|
-
function
|
|
134
|
-
return (
|
|
135
|
-
const e = Array.from(
|
|
132
|
+
var a0 = N({ defaultClassName: "pkg_sps-woodland_core__version_8_53_11__hash_1f3v2ss0", variantClassNames: { disabled: { true: "pkg_sps-woodland_core__version_8_53_11__hash_1f3v2ss1", false: "pkg_sps-woodland_core__version_8_53_11__hash_1f3v2ss2" } }, defaultVariants: { disabled: !1 }, compoundVariants: [] }), s0 = N({ defaultClassName: "pkg_sps-woodland_core__version_8_53_11__hash_1f3v2ss3", variantClassNames: { disabled: { true: "pkg_sps-woodland_core__version_8_53_11__hash_1f3v2ss4", false: "pkg_sps-woodland_core__version_8_53_11__hash_1f3v2ss5" } }, defaultVariants: {}, compoundVariants: [] }), l0 = "pkg_sps-woodland_core__version_8_53_11__hash_1f3v2ss6", d0 = "pkg_sps-woodland_core__version_8_53_11__hash_1f3v2ss7";
|
|
133
|
+
function g0() {
|
|
134
|
+
return (t) => (Q(t, "listItem", (n) => {
|
|
135
|
+
const e = Array.from(n.children);
|
|
136
136
|
if (e.length > 0 && e[0].type === "paragraph") {
|
|
137
|
-
const r = e[0],
|
|
138
|
-
|
|
137
|
+
const r = e[0], i = Array.from(r.children).concat(e.slice(1));
|
|
138
|
+
n.children = i;
|
|
139
139
|
}
|
|
140
|
-
}),
|
|
140
|
+
}), t);
|
|
141
141
|
}
|
|
142
|
-
function
|
|
143
|
-
const
|
|
144
|
-
() =>
|
|
142
|
+
function m0() {
|
|
143
|
+
const t = C(
|
|
144
|
+
() => B().use(K).use(g0).use(q).use(W).use(J),
|
|
145
145
|
[]
|
|
146
146
|
);
|
|
147
147
|
return C(
|
|
148
148
|
() => function(e) {
|
|
149
|
-
return
|
|
149
|
+
return t.process(e).then(String);
|
|
150
150
|
},
|
|
151
|
-
[
|
|
151
|
+
[t]
|
|
152
152
|
);
|
|
153
153
|
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
154
|
+
const U = /* @__PURE__ */ new Set(["strong", "emphasis", "delete", "link", "linkReference"]), f0 = /* @__PURE__ */ new Set([...U, "paragraph"]);
|
|
155
|
+
function A(t) {
|
|
156
|
+
return "children" in t;
|
|
157
|
+
}
|
|
158
|
+
function h0() {
|
|
159
|
+
return (t) => {
|
|
160
|
+
function n(e) {
|
|
161
|
+
for (const r of e.children)
|
|
162
|
+
A(r) && n(r);
|
|
163
|
+
if (e.children = e.children.filter(
|
|
164
|
+
(r) => !(f0.has(r.type) && A(r) && r.children.length === 0)
|
|
165
|
+
), U.has(e.type))
|
|
166
|
+
for (; e.children.at(-1)?.type === "break"; )
|
|
167
|
+
e.children.pop();
|
|
168
|
+
}
|
|
169
|
+
return n(t), t;
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
function u0() {
|
|
173
|
+
const t = C(
|
|
174
|
+
() => B().use(X).use(Y).use(h0).use(e0),
|
|
157
175
|
[]
|
|
158
176
|
);
|
|
159
177
|
return C(
|
|
160
178
|
() => function(e) {
|
|
161
|
-
return
|
|
179
|
+
return t.process(e).then(String);
|
|
162
180
|
},
|
|
163
|
-
[]
|
|
181
|
+
[t]
|
|
164
182
|
);
|
|
165
183
|
}
|
|
166
|
-
function
|
|
167
|
-
const [e, r] = v(), [o,
|
|
168
|
-
const f = await
|
|
184
|
+
function C0(t = "", n = "") {
|
|
185
|
+
const [e, r] = v(), [o, i] = v({ html: n }), c = u0(), a = m0(), s = x(async (m) => {
|
|
186
|
+
const f = await a(m), h = { md: m, html: f };
|
|
169
187
|
return r(h), h;
|
|
170
|
-
}, [
|
|
188
|
+
}, [a]), l = x(async (m) => {
|
|
171
189
|
const h = { md: await c(m), html: m };
|
|
172
190
|
return r(h), h;
|
|
173
191
|
}, [c]);
|
|
174
192
|
L(() => {
|
|
175
|
-
!
|
|
176
|
-
|
|
177
|
-
}) : !
|
|
178
|
-
}, [
|
|
193
|
+
!n && t !== e?.md ? s(t).then(({ html: m }) => {
|
|
194
|
+
i({ html: m });
|
|
195
|
+
}) : !t && n && n !== e?.html && l(n);
|
|
196
|
+
}, [t, n]);
|
|
179
197
|
function g(m) {
|
|
180
198
|
m.current && l(m.current.innerHTML);
|
|
181
199
|
}
|
|
@@ -185,14 +203,14 @@ function m0(n = "", t = "") {
|
|
|
185
203
|
updateStateFromDiv: g
|
|
186
204
|
};
|
|
187
205
|
}
|
|
188
|
-
function
|
|
189
|
-
if (
|
|
190
|
-
for (const
|
|
191
|
-
/(style|class|data-[^=]+)/.test(
|
|
192
|
-
|
|
206
|
+
function p0(t) {
|
|
207
|
+
if (t instanceof HTMLElement) {
|
|
208
|
+
for (const n of Array.from(t.attributes))
|
|
209
|
+
/(style|class|data-[^=]+)/.test(n.name) && t.removeAttribute(n.name);
|
|
210
|
+
t.innerHTML = t.innerHTML.replace(/(style|class|data-[^=]+)="[^"]+"/g, "");
|
|
193
211
|
}
|
|
194
212
|
}
|
|
195
|
-
const
|
|
213
|
+
const w0 = [
|
|
196
214
|
// Bold
|
|
197
215
|
{
|
|
198
216
|
regex: /\*\*([^*]+)\*\*/,
|
|
@@ -217,68 +235,68 @@ const h0 = [
|
|
|
217
235
|
{
|
|
218
236
|
regex: /\[([^\]]+)\]\(([^)]+)\)/,
|
|
219
237
|
command: "createLink",
|
|
220
|
-
getCommandArg: ([, ,
|
|
238
|
+
getCommandArg: ([, , t]) => /^https?:\/\//.test(t) ? t : `https://${t}`
|
|
221
239
|
}
|
|
222
240
|
];
|
|
223
|
-
function
|
|
241
|
+
function v0(t, n, e) {
|
|
224
242
|
const r = document.createRange();
|
|
225
|
-
r.setStart(
|
|
243
|
+
r.setStart(t, n), r.setEnd(t, e);
|
|
226
244
|
const o = window.getSelection();
|
|
227
245
|
o?.removeAllRanges(), o?.addRange(r);
|
|
228
246
|
}
|
|
229
|
-
function y(
|
|
230
|
-
const
|
|
231
|
-
|
|
247
|
+
function y(t) {
|
|
248
|
+
const n = document.createRange();
|
|
249
|
+
n.setStartAfter(t), n.setEndAfter(t);
|
|
232
250
|
const e = window.getSelection();
|
|
233
|
-
e?.removeAllRanges(), e?.addRange(
|
|
251
|
+
e?.removeAllRanges(), e?.addRange(n);
|
|
234
252
|
}
|
|
235
|
-
function
|
|
236
|
-
const
|
|
237
|
-
|
|
253
|
+
function x0(t) {
|
|
254
|
+
const n = document.createRange();
|
|
255
|
+
n.setStartBefore(t), n.setEndBefore(t);
|
|
238
256
|
const e = window.getSelection();
|
|
239
|
-
e?.removeAllRanges(), e?.addRange(
|
|
257
|
+
e?.removeAllRanges(), e?.addRange(n);
|
|
240
258
|
}
|
|
241
|
-
function
|
|
242
|
-
const
|
|
259
|
+
function L0(t) {
|
|
260
|
+
const n = F(null), e = C(() => new MutationObserver(([r]) => {
|
|
243
261
|
if (r.type === "characterData" && r.oldValue && r.target.textContent) {
|
|
244
|
-
for (const o of
|
|
262
|
+
for (const o of w0)
|
|
245
263
|
if (!o.regex.test(r.oldValue) && o.regex.test(r.target.textContent)) {
|
|
246
|
-
const
|
|
247
|
-
r.target.textContent = r.target.textContent.replace(c,
|
|
248
|
-
const l = s +
|
|
249
|
-
|
|
250
|
-
const g = o.getCommandArg ? o.getCommandArg(
|
|
251
|
-
document.execCommand(o.command, void 0, g),
|
|
264
|
+
const i = o.regex.exec(r.target.textContent), [c, a = ""] = i, s = r.target.textContent.indexOf(c);
|
|
265
|
+
r.target.textContent = r.target.textContent.replace(c, a);
|
|
266
|
+
const l = s + a.length;
|
|
267
|
+
v0(r.target, s, l);
|
|
268
|
+
const g = o.getCommandArg ? o.getCommandArg(i) : void 0;
|
|
269
|
+
document.execCommand(o.command, void 0, g), a && (y(r.target.parentNode), document.execCommand(o.command));
|
|
252
270
|
}
|
|
253
271
|
} else r.type === "childList" && Array.from(r.addedNodes).forEach((o) => {
|
|
254
|
-
let
|
|
255
|
-
if (o instanceof HTMLElement && o.tagName === "LI" ?
|
|
256
|
-
const c =
|
|
257
|
-
if (
|
|
272
|
+
let i;
|
|
273
|
+
if (o instanceof HTMLElement && o.tagName === "LI" ? i = o : o?.parentElement?.tagName === "LI" && (i = o?.parentElement), i) {
|
|
274
|
+
const c = i.nextElementSibling, a = c?.childNodes?.[0];
|
|
275
|
+
if (a instanceof HTMLElement && ["UL", "OL"].includes(a.tagName)) {
|
|
258
276
|
const l = document.createElement("br");
|
|
259
|
-
c.insertBefore(l,
|
|
277
|
+
c.insertBefore(l, a), x0(l);
|
|
260
278
|
}
|
|
261
279
|
}
|
|
262
|
-
|
|
280
|
+
p0(o);
|
|
263
281
|
});
|
|
264
|
-
n
|
|
282
|
+
t(n);
|
|
265
283
|
}), []);
|
|
266
284
|
return L(() => () => {
|
|
267
285
|
e && e.disconnect();
|
|
268
286
|
}, []), L(() => {
|
|
269
|
-
|
|
287
|
+
n.current !== null && e.observe(n.current, {
|
|
270
288
|
childList: !0,
|
|
271
289
|
subtree: !0,
|
|
272
290
|
characterDataOldValue: !0
|
|
273
291
|
});
|
|
274
|
-
}, [e,
|
|
292
|
+
}, [e, n]), n;
|
|
275
293
|
}
|
|
276
|
-
function
|
|
277
|
-
const [
|
|
294
|
+
function E0(t) {
|
|
295
|
+
const [n, e] = v();
|
|
278
296
|
L(() => {
|
|
279
297
|
function o() {
|
|
280
|
-
const
|
|
281
|
-
Number(
|
|
298
|
+
const i = window.getSelection();
|
|
299
|
+
Number(i?.rangeCount) > 0 && e(i?.getRangeAt(0));
|
|
282
300
|
}
|
|
283
301
|
return document.addEventListener("selectionchange", o), () => {
|
|
284
302
|
document.removeEventListener("selectionchange", o);
|
|
@@ -286,97 +304,97 @@ function w0(n) {
|
|
|
286
304
|
}, []);
|
|
287
305
|
const r = x(
|
|
288
306
|
(o) => {
|
|
289
|
-
if (!
|
|
307
|
+
if (!n)
|
|
290
308
|
return null;
|
|
291
|
-
const
|
|
292
|
-
if (!
|
|
309
|
+
const i = n.commonAncestorContainer;
|
|
310
|
+
if (!t.current || !t.current.contains(i))
|
|
293
311
|
return null;
|
|
294
|
-
let c =
|
|
295
|
-
for (; c && c !==
|
|
312
|
+
let c = i instanceof HTMLElement ? i : i.parentElement;
|
|
313
|
+
for (; c && c !== t.current; ) {
|
|
296
314
|
if (o(c))
|
|
297
315
|
return c;
|
|
298
316
|
c = c.parentElement;
|
|
299
317
|
}
|
|
300
318
|
return null;
|
|
301
319
|
},
|
|
302
|
-
[
|
|
320
|
+
[n]
|
|
303
321
|
);
|
|
304
322
|
return {
|
|
305
|
-
selectionRange:
|
|
323
|
+
selectionRange: n,
|
|
306
324
|
selectionDOMContextFind: r
|
|
307
325
|
};
|
|
308
326
|
}
|
|
309
|
-
const v0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='10px'%20height='12px'%20viewBox='0%200%2010%2012'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eBold%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-53.000000,%20-103.000000)'%20fill='%234B5356'%20fill-rule='nonzero'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%202.000000)'%20id='B'%3e%3cg%20transform='translate(3.550000,%202.130000)'%3e%3cpath%20d='M0,0%20L4.014,0%20C4.626,0%205.193,0.045%205.715,0.135%20C6.237,0.225%206.693,0.384%207.083,0.612%20C7.473,0.84%207.779,1.14%208.001,1.512%20C8.223,1.884%208.334,2.352%208.334,2.916%20C8.334,3.18%208.295,3.444%208.217,3.708%20C8.139,3.972%208.022,4.218%207.866,4.446%20C7.71,4.674%207.506,4.878%207.254,5.058%20C7.002,5.238%206.708,5.37%206.372,5.454%20L6.372,5.526%20C7.212,5.682%207.845,5.982%208.271,6.426%20C8.697,6.87%208.91,7.488%208.91,8.28%20C8.91,8.88%208.793,9.396%208.559,9.828%20C8.325,10.26%208.001,10.617%207.587,10.899%20C7.173,11.181%206.69,11.391%206.138,11.529%20C5.586,11.667%204.992,11.736%204.356,11.736%20L0,11.736%20L0,0%20Z%20M3.888,4.734%20C4.536,4.734%205.007,4.605%205.301,4.347%20C5.595,4.089%205.742,3.738%205.742,3.294%20C5.742,2.85%205.592,2.532%205.292,2.34%20C4.992,2.148%204.53,2.052%203.906,2.052%20L2.646,2.052%20L2.646,4.734%20L3.888,4.734%20Z%20M4.14,9.684%20C5.592,9.684%206.318,9.15%206.318,8.082%20C6.318,7.566%206.138,7.191%205.778,6.957%20C5.418,6.723%204.872,6.606%204.14,6.606%20L2.646,6.606%20L2.646,9.684%20L4.14,9.684%20Z'%20id='Shape'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", x0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='14px'%20viewBox='0%200%2016%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIndent%20short%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-50.000000,%20-282.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20182.000000)'%3e%3crect%20id='Rectangle-223'%20x='0'%20y='1.6'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='0'%20y='12.4'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='8.8'%20width='9'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='5.2'%20width='9'%20height='2'%3e%3c/rect%3e%3cpath%20d='M5.20857552,7.99286089%20C5.20857552,8.06428955%205.18178977,8.14464678%205.12821828,8.19821828%20L2.27107201,11.0553645%20C2.21750052,11.108936%202.13714328,11.1357218%202.06571463,11.1357218%20C1.91392873,11.1357218%201.78,11.001793%201.78,10.85%20L1.78,5.13571463%20C1.78,4.97500015%201.90500015,4.85%202.06571463,4.85%20C2.14607186,4.85%202.21750052,4.88571433%202.28,4.93928582%20L5.12821828,7.7875035%20C5.18178977,7.84107499%205.20857552,7.92143223%205.20857552,7.99286089%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", L0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='10px'%20height='12px'%20viewBox='0%200%2010%2012'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eItalics%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-53.000000,%20-148.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%2047.000000)'%3e%3cg%20id='I'%20transform='translate(5.600000,%202.130000)'%20fill-rule='nonzero'%3e%3cpolygon%20id='Path'%20points='2.358%200%204.824%200%202.484%2011.736%200%2011.736'%3e%3c/polygon%3e%3c/g%3e%3crect%20id='Rectangle'%20x='5.5'%20y='2'%20width='7'%20height='1.5'%3e%3c/rect%3e%3crect%20id='Rectangle-Copy'%20x='3.5'%20y='12.5'%20width='7'%20height='1.5'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", E0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='14px'%20viewBox='0%200%2014%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIcon/icon-ellipses%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---Schematics'%20transform='translate(-401.000000,%20-200.000000)'%20fill='%234B5356'%3e%3cg%20id='Group-5'%20transform='translate(146.000000,%20167.000000)'%3e%3cg%20id='Icon/icon-link'%20transform='translate(254.000000,%2032.000000)'%3e%3cpath%20d='M9.28515625,6.03125%20C9.33984402,6.06770852%209.39908822,6.11328098%209.46289062,6.16796875%20C9.52669303,6.22265652%209.58593723,6.26822898%209.640625,6.3046875%20L9.6953125,6.359375%20C10.3333365,7.01562828%2010.6523438,7.79947461%2010.6523438,8.7109375%20C10.6523438,9.62240039%2010.3333365,10.4062467%209.6953125,11.0625%20L6.6875,14.0429688%20C6.04947598,14.6809928%205.27474414,15%204.36328125,15%20C3.45181836,15%202.66797203,14.6809928%202.01171875,14.0429688%20L1.95703125,13.9882812%20C1.31900723,13.332028%201,12.5481816%201,11.6367188%20C1,10.7252559%201.31900723,9.95052402%201.95703125,9.3125%20L4.0625,7.20703125%20C4.04427074,7.51692863%204.06249973,7.82682137%204.1171875,8.13671875%20C4.17187527,8.44661613%204.2630202,8.73827988%204.390625,9.01171875%20L3.05078125,10.3789062%20C2.68619609,10.7252621%202.50390625,11.1445288%202.50390625,11.6367188%20C2.50390625,12.1289087%202.68619609,12.5481754%203.05078125,12.8945312%20L3.10546875,12.9492188%20C3.45182465,13.3138039%203.87109129,13.4960938%204.36328125,13.4960938%20C4.85547121,13.4960938%205.27473785,13.3138039%205.62109375,12.9492188%20L8.6015625,9.96875%20C8.9479184,9.6223941%209.12109375,9.20312746%209.12109375,8.7109375%20C9.12109375,8.21874754%208.9479184,7.7994809%208.6015625,7.453125%20L8.546875,7.3984375%20C8.49218723,7.34374973%208.43750027,7.29362002%208.3828125,7.24804688%20C8.32812473,7.20247373%208.26432328,7.16145852%208.19140625,7.125%20L9.28515625,6.03125%20Z%20M11.6367188,1%20C12.5481816,1%2013.332028,1.31900723%2013.9882812,1.95703125%20L14.0429688,2.01171875%20C14.6809928,2.66797203%2015,3.45181836%2015,4.36328125%20C15,5.27474414%2014.6809928,6.04947598%2014.0429688,6.6875%20L11.9375,8.79296875%20C11.9557293,8.48307137%2011.9375003,8.17317863%2011.8828125,7.86328125%20C11.8281247,7.55338387%2011.7369798,7.26172012%2011.609375,6.98828125%20L12.9492188,5.62109375%20C13.3138039,5.27473785%2013.4960938,4.85547121%2013.4960938,4.36328125%20C13.4960938,3.87109129%2013.3138039,3.45182465%2012.9492188,3.10546875%20L12.8945312,3.05078125%20C12.5481754,2.68619609%2012.1289087,2.50390625%2011.6367188,2.50390625%20C11.1445288,2.50390625%2010.7252621,2.68619609%2010.3789062,3.05078125%20L7.3984375,6.03125%20C7.0520816,6.3776059%206.87890625,6.79687254%206.87890625,7.2890625%20C6.87890625,7.78125246%207.0520816,8.2005191%207.3984375,8.546875%20L7.453125,8.6015625%20C7.50781277,8.65625027%207.56249973,8.70637998%207.6171875,8.75195312%20C7.67187527,8.79752627%207.73567672,8.83854148%207.80859375,8.875%20L6.71484375,9.96875%20C6.66015598,9.93229148%206.60091178,9.88671902%206.53710938,9.83203125%20C6.47330697,9.77734348%206.41406277,9.73177102%206.359375,9.6953125%20L6.3046875,9.640625%20C5.66666348,8.98437172%205.34765625,8.20052539%205.34765625,7.2890625%20C5.34765625,6.37759961%205.66666348,5.59375328%206.3046875,4.9375%20L9.3125,1.95703125%20C9.95052402,1.31900723%2010.7252559,1%2011.6367188,1%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", _0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='15px'%20height='14px'%20viewBox='0%200%2015%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eOrdered%20list%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-51.000000,%20-192.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%2092.000000)'%3e%3crect%20id='Rectangle-223-Copy-3'%20x='5'%20y='2.5'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223-Copy-2'%20x='5'%20y='7'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223-Copy'%20x='5'%20y='11.5'%20width='11'%20height='2'%3e%3c/rect%3e%3cg%20id='1'%20transform='translate(1.500000,%201.900000)'%20fill-rule='nonzero'%3e%3cpath%20d='M0,2.58%20L0.69,2.58%20L0.69,0.745%20L0.095,0.745%20L0.095,0.29%20C0.268333333,0.256666667%200.415,0.216666667%200.535,0.17%20C0.655,0.123333333%200.771666667,0.0666666667%200.885,0%20L1.425,0%20L1.425,2.58%20L2.02,2.58%20L2.02,3.175%20L0,3.175%20L0,2.58%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3cg%20id='2'%20transform='translate(1.355000,%206.400000)'%20fill-rule='nonzero'%3e%3cpath%20d='M0.035,2.815%20C0.238333333,2.625%200.424166667,2.4475%200.5925,2.2825%20C0.760833333,2.1175%200.905833333,1.9625%201.0275,1.8175%20C1.14916667,1.6725%201.24416667,1.5375%201.3125,1.4125%20C1.38083333,1.2875%201.415,1.16833333%201.415,1.055%20C1.415,0.898333333%201.375,0.779166667%201.295,0.6975%20C1.215,0.615833333%201.105,0.575%200.965,0.575%20C0.848333333,0.575%200.745,0.6075%200.655,0.6725%20C0.565,0.7375%200.48,0.813333333%200.4,0.9%20L0,0.505%20C0.156666667,0.338333333%200.316666667,0.2125%200.48,0.1275%20C0.643333333,0.0425%200.838333333,0%201.065,0%20C1.22166667,0%201.36416667,0.0241666667%201.4925,0.0725%20C1.62083333,0.120833333%201.73166667,0.189166667%201.825,0.2775%20C1.91833333,0.365833333%201.99,0.471666667%202.04,0.595%20C2.09,0.718333333%202.115,0.856666667%202.115,1.01%20C2.115,1.14333333%202.08666667,1.27916667%202.03,1.4175%20C1.97333333,1.55583333%201.8975,1.69416667%201.8025,1.8325%20C1.7075,1.97083333%201.59916667,2.10916667%201.4775,2.2475%20C1.35583333,2.38583333%201.23,2.52166667%201.1,2.655%20C1.18,2.645%201.26916667,2.63583333%201.3675,2.6275%20C1.46583333,2.61916667%201.55333333,2.615%201.63,2.615%20L2.27,2.615%20L2.27,3.235%20L0.035,3.235%20L0.035,2.815%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3cg%20id='3'%20transform='translate(1.350000,%2010.800000)'%20fill-rule='nonzero'%3e%3cpath%20d='M0.34,2.38%20C0.436666667,2.47333333%200.5425,2.55%200.6575,2.61%20C0.7725,2.67%200.898333333,2.7%201.035,2.7%20C1.19166667,2.7%201.31666667,2.6675%201.41,2.6025%20C1.50333333,2.5375%201.55,2.445%201.55,2.325%20C1.55,2.255%201.5375,2.19166667%201.5125,2.135%20C1.4875,2.07833333%201.44333333,2.03083333%201.38,1.9925%20C1.31666667,1.95416667%201.23,1.92416667%201.12,1.9025%20C1.01,1.88083333%200.868333333,1.87%200.695,1.87%20L0.695,1.35%20C0.838333333,1.35%200.9575,1.34%201.0525,1.32%20C1.1475,1.3%201.22416667,1.27083333%201.2825,1.2325%20C1.34083333,1.19416667%201.3825,1.14916667%201.4075,1.0975%20C1.4325,1.04583333%201.445,0.988333333%201.445,0.925%20C1.445,0.815%201.41166667,0.729166667%201.345,0.6675%20C1.27833333,0.605833333%201.18166667,0.575%201.055,0.575%20C0.941666667,0.575%200.839166667,0.6%200.7475,0.65%20C0.655833333,0.7%200.56,0.768333333%200.46,0.855%20L0.09,0.405%20C0.236666667,0.278333333%200.390833333,0.179166667%200.5525,0.1075%20C0.714166667,0.0358333333%200.893333333,0%201.09,0%20C1.25333333,0%201.4025,0.0191666667%201.5375,0.0575%20C1.6725,0.0958333333%201.7875,0.1525%201.8825,0.2275%20C1.9775,0.3025%202.05166667,0.393333333%202.105,0.5%20C2.15833333,0.606666667%202.185,0.73%202.185,0.87%20C2.185,1.03666667%202.13916667,1.1775%202.0475,1.2925%20C1.95583333,1.4075%201.825,1.50166667%201.655,1.575%20L1.655,1.595%20C1.83833333,1.64833333%201.98916667,1.73916667%202.1075,1.8675%20C2.22583333,1.99583333%202.285,2.16333333%202.285,2.37%20C2.285,2.51666667%202.25333333,2.6475%202.19,2.7625%20C2.12666667,2.8775%202.04166667,2.97416667%201.935,3.0525%20C1.82833333,3.13083333%201.70333333,3.19083333%201.56,3.2325%20C1.41666667,3.27416667%201.265,3.295%201.105,3.295%20C0.845,3.295%200.625,3.25416667%200.445,3.1725%20C0.265,3.09083333%200.116666667,2.98166667%200,2.845%20L0.34,2.38%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", k0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='14px'%20viewBox='0%200%2016%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eOutdent%20short%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-50.000000,%20-327.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20227.000000)'%3e%3crect%20id='Rectangle-223'%20x='0'%20y='1.6'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='0'%20y='12.4'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='8.8'%20width='9'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='5.2'%20width='9'%20height='2'%3e%3c/rect%3e%3cpath%20d='M5.21357552,10.85%20C5.21357552,11.001793%205.08857537,11.1357218%204.92786089,11.1357218%20C4.84750365,11.1357218%204.77607499,11.1000075%204.71357492,11.046436%20L1.86535724,8.1892897%20C1.81178575,8.1357182%201.785,8.06428955%201.785,7.99286089%20C1.785,7.91250365%201.81178575,7.84107499%201.86535724,7.7875035%20L4.7225035,4.93035724%20C4.77607499,4.87678575%204.85643223,4.85%204.92786089,4.85%20C5.07964678,4.85%205.21357552,4.97500015%205.21357552,5.13571463%20L5.21357552,10.85%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", N0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='14px'%20viewBox='0%200%2014%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIcon/icon-ellipses%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---Schematics'%20transform='translate(-520.000000,%20-200.000000)'%20fill='%234B5356'%3e%3cg%20id='Group-5'%20transform='translate(146.000000,%20167.000000)'%3e%3cg%20id='Button/2.-Icon/6.-Default-Copy-8'%20transform='translate(363.000000,%2025.000000)'%3e%3cg%20id='Icon/icon-undo'%20transform='translate(10.000000,%207.000000)'%3e%3cpath%20d='M15,2.16666667%20C15,1.9296875%2014.8541667,1.72005208%2014.6445312,1.62890625%20C14.4257812,1.53776042%2014.1705729,1.58333333%2014.0065104,1.75651042%20L12.8216146,2.93229167%20C11.5364583,1.72005208%209.79557292,1%208,1%20C4.14453125,1%201,4.14453125%201,8%20C1,11.8554688%204.14453125,15%208,15%20C10.0872396,15%2012.0559896,14.0794271%2013.3867188,12.4752604%20C13.4778646,12.3567708%2013.4778646,12.1835938%2013.3684896,12.0833333%20L12.1197917,10.8255208%20C12.0559896,10.7708333%2011.9739583,10.7434896%2011.8919271,10.7434896%20C11.8098958,10.7526042%2011.7278646,10.7890625%2011.6822917,10.8528646%20C10.7890625,12.0104167%209.44921875,12.6666667%208,12.6666667%20C5.4296875,12.6666667%203.33333333,10.5703125%203.33333333,8%20C3.33333333,5.4296875%205.4296875,3.33333333%208,3.33333333%20C9.19401042,3.33333333%2010.3242188,3.7890625%2011.1809896,4.58203125%20L9.92317708,5.83984375%20C9.75,6.00390625%209.70442708,6.25911458%209.79557292,6.46875%20C9.88671875,6.6875%2010.0963542,6.83333333%2010.3333333,6.83333333%20L14.4166667,6.83333333%20C14.7356771,6.83333333%2015,6.56901042%2015,6.25%20L15,2.16666667%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", y0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='14px'%20viewBox='0%200%2014%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIcon/icon-ellipses%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---Schematics'%20transform='translate(-484.000000,%20-200.000000)'%20fill='%234B5356'%3e%3cg%20id='Group-5'%20transform='translate(146.000000,%20167.000000)'%3e%3cg%20id='Button/2.-Icon/6.-Default-Copy-9'%20transform='translate(345.000000,%2040.000000)%20scale(-1,%201)%20translate(-345.000000,%20-40.000000)%20translate(327.000000,%2025.000000)'%3e%3cg%20id='Icon/icon-undo'%20transform='translate(10.000000,%207.000000)'%3e%3cpath%20d='M15,2.16666667%20C15,1.9296875%2014.8541667,1.72005208%2014.6445312,1.62890625%20C14.4257812,1.53776042%2014.1705729,1.58333333%2014.0065104,1.75651042%20L12.8216146,2.93229167%20C11.5364583,1.72005208%209.79557292,1%208,1%20C4.14453125,1%201,4.14453125%201,8%20C1,11.8554688%204.14453125,15%208,15%20C10.0872396,15%2012.0559896,14.0794271%2013.3867188,12.4752604%20C13.4778646,12.3567708%2013.4778646,12.1835938%2013.3684896,12.0833333%20L12.1197917,10.8255208%20C12.0559896,10.7708333%2011.9739583,10.7434896%2011.8919271,10.7434896%20C11.8098958,10.7526042%2011.7278646,10.7890625%2011.6822917,10.8528646%20C10.7890625,12.0104167%209.44921875,12.6666667%208,12.6666667%20C5.4296875,12.6666667%203.33333333,10.5703125%203.33333333,8%20C3.33333333,5.4296875%205.4296875,3.33333333%208,3.33333333%20C9.19401042,3.33333333%2010.3242188,3.7890625%2011.1809896,4.58203125%20L9.92317708,5.83984375%20C9.75,6.00390625%209.70442708,6.25911458%209.79557292,6.46875%20C9.88671875,6.6875%2010.0963542,6.83333333%2010.3333333,6.83333333%20L14.4166667,6.83333333%20C14.7356771,6.83333333%2015,6.56901042%2015,6.25%20L15,2.16666667%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", T0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='16px'%20viewBox='0%200%2014%2016'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eUnlink%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-51.000000,%20-371.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20272.000000)'%3e%3cpath%20d='M14.0429688,2.01171875%20C14.6809928,2.66797203%2015,3.45181836%2015,4.36328125%20C15,5.27474414%2014.6809928,6.04947598%2014.0429688,6.6875%20L11.1027446,9.58420181%20L10.3518996,8.27890801%20L12.9492188,5.62109375%20C13.3138039,5.27473785%2013.4960938,4.85547121%2013.4960938,4.36328125%20C13.4960938,3.87109129%2013.3138039,3.45182465%2012.9492188,3.10546875%20L12.8945313,3.05078125%20C12.5481754,2.68619609%2012.1289087,2.50390625%2011.6367188,2.50390625%20C11.1445288,2.50390625%2010.7252621,2.68619609%2010.3789063,3.05078125%20L8.41457939,4.92175579%20L7.64047964,3.57621944%20L9.3125,1.95703125%20C9.95052402,1.31900723%2010.7252559,1%2011.6367188,1%20C12.5481816,1%2013.332028,1.31900723%2013.9882813,1.95703125%20L14.0429688,2.01171875%20Z'%20id='Path'%3e%3c/path%3e%3cpath%20d='M8.02641916,12.7072184%20L6.6875,14.0429687%20C6.04947598,14.6809928%205.27474414,15%204.36328125,15%20C3.45181836,15%202.66797203,14.6809928%202.01171875,14.0429687%20L1.95703125,13.9882812%20C1.31900723,13.332028%201,12.5481816%201,11.6367187%20C1,10.7252559%201.31900723,9.95052402%201.95703125,9.3125%20L4.57246065,6.71787083%20L5.34566408,8.05009655%20L3.05078125,10.3789062%20C2.68619609,10.7252621%202.50390625,11.1445288%202.50390625,11.6367187%20C2.50390625,12.1289087%202.68619609,12.5481754%203.05078125,12.8945312%20L3.10546875,12.9492187%20C3.45182465,13.3138039%203.87109129,13.4960937%204.36328125,13.4960937%20C4.85547121,13.4960937%205.27473785,13.3138039%205.62109375,12.9492187%20L7.2646265,11.388324%20L8.02641916,12.7072184%20Z'%20id='Path'%3e%3c/path%3e%3crect%20id='Rectangle'%20transform='translate(7.750000,%208.000000)%20rotate(-30.000000)%20translate(-7.750000,%20-8.000000)%20'%20x='7'%20y='0'%20width='1.5'%20height='16'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", R0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='15px'%20height='12px'%20viewBox='0%200%2015%2012'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eUnordered%20list%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-51.000000,%20-238.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20137.000000)'%3e%3cg%20transform='translate(1.000000,%202.000000)'%3e%3crect%20id='Rectangle-223'%20x='4'%20y='0.5'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='4'%20y='5'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='4'%20y='9.5'%20width='11'%20height='2'%3e%3c/rect%3e%3ccircle%20id='Oval'%20cx='1.5'%20cy='1.5'%20r='1.5'%3e%3c/circle%3e%3ccircle%20id='Oval-Copy'%20cx='1.5'%20cy='6'%20r='1.5'%3e%3c/circle%3e%3ccircle%20id='Oval-Copy-2'%20cx='1.5'%20cy='10.5'%20r='1.5'%3e%3c/circle%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", w = (n, t) => {
|
|
310
|
-
let e =
|
|
311
|
-
for (; e.parentElement && !
|
|
327
|
+
const _0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='10px'%20height='12px'%20viewBox='0%200%2010%2012'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eBold%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-53.000000,%20-103.000000)'%20fill='%234B5356'%20fill-rule='nonzero'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%202.000000)'%20id='B'%3e%3cg%20transform='translate(3.550000,%202.130000)'%3e%3cpath%20d='M0,0%20L4.014,0%20C4.626,0%205.193,0.045%205.715,0.135%20C6.237,0.225%206.693,0.384%207.083,0.612%20C7.473,0.84%207.779,1.14%208.001,1.512%20C8.223,1.884%208.334,2.352%208.334,2.916%20C8.334,3.18%208.295,3.444%208.217,3.708%20C8.139,3.972%208.022,4.218%207.866,4.446%20C7.71,4.674%207.506,4.878%207.254,5.058%20C7.002,5.238%206.708,5.37%206.372,5.454%20L6.372,5.526%20C7.212,5.682%207.845,5.982%208.271,6.426%20C8.697,6.87%208.91,7.488%208.91,8.28%20C8.91,8.88%208.793,9.396%208.559,9.828%20C8.325,10.26%208.001,10.617%207.587,10.899%20C7.173,11.181%206.69,11.391%206.138,11.529%20C5.586,11.667%204.992,11.736%204.356,11.736%20L0,11.736%20L0,0%20Z%20M3.888,4.734%20C4.536,4.734%205.007,4.605%205.301,4.347%20C5.595,4.089%205.742,3.738%205.742,3.294%20C5.742,2.85%205.592,2.532%205.292,2.34%20C4.992,2.148%204.53,2.052%203.906,2.052%20L2.646,2.052%20L2.646,4.734%20L3.888,4.734%20Z%20M4.14,9.684%20C5.592,9.684%206.318,9.15%206.318,8.082%20C6.318,7.566%206.138,7.191%205.778,6.957%20C5.418,6.723%204.872,6.606%204.14,6.606%20L2.646,6.606%20L2.646,9.684%20L4.14,9.684%20Z'%20id='Shape'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", k0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='14px'%20viewBox='0%200%2016%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIndent%20short%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-50.000000,%20-282.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20182.000000)'%3e%3crect%20id='Rectangle-223'%20x='0'%20y='1.6'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='0'%20y='12.4'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='8.8'%20width='9'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='5.2'%20width='9'%20height='2'%3e%3c/rect%3e%3cpath%20d='M5.20857552,7.99286089%20C5.20857552,8.06428955%205.18178977,8.14464678%205.12821828,8.19821828%20L2.27107201,11.0553645%20C2.21750052,11.108936%202.13714328,11.1357218%202.06571463,11.1357218%20C1.91392873,11.1357218%201.78,11.001793%201.78,10.85%20L1.78,5.13571463%20C1.78,4.97500015%201.90500015,4.85%202.06571463,4.85%20C2.14607186,4.85%202.21750052,4.88571433%202.28,4.93928582%20L5.12821828,7.7875035%20C5.18178977,7.84107499%205.20857552,7.92143223%205.20857552,7.99286089%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", N0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='10px'%20height='12px'%20viewBox='0%200%2010%2012'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eItalics%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-53.000000,%20-148.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%2047.000000)'%3e%3cg%20id='I'%20transform='translate(5.600000,%202.130000)'%20fill-rule='nonzero'%3e%3cpolygon%20id='Path'%20points='2.358%200%204.824%200%202.484%2011.736%200%2011.736'%3e%3c/polygon%3e%3c/g%3e%3crect%20id='Rectangle'%20x='5.5'%20y='2'%20width='7'%20height='1.5'%3e%3c/rect%3e%3crect%20id='Rectangle-Copy'%20x='3.5'%20y='12.5'%20width='7'%20height='1.5'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", y0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='14px'%20viewBox='0%200%2014%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIcon/icon-ellipses%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---Schematics'%20transform='translate(-401.000000,%20-200.000000)'%20fill='%234B5356'%3e%3cg%20id='Group-5'%20transform='translate(146.000000,%20167.000000)'%3e%3cg%20id='Icon/icon-link'%20transform='translate(254.000000,%2032.000000)'%3e%3cpath%20d='M9.28515625,6.03125%20C9.33984402,6.06770852%209.39908822,6.11328098%209.46289062,6.16796875%20C9.52669303,6.22265652%209.58593723,6.26822898%209.640625,6.3046875%20L9.6953125,6.359375%20C10.3333365,7.01562828%2010.6523438,7.79947461%2010.6523438,8.7109375%20C10.6523438,9.62240039%2010.3333365,10.4062467%209.6953125,11.0625%20L6.6875,14.0429688%20C6.04947598,14.6809928%205.27474414,15%204.36328125,15%20C3.45181836,15%202.66797203,14.6809928%202.01171875,14.0429688%20L1.95703125,13.9882812%20C1.31900723,13.332028%201,12.5481816%201,11.6367188%20C1,10.7252559%201.31900723,9.95052402%201.95703125,9.3125%20L4.0625,7.20703125%20C4.04427074,7.51692863%204.06249973,7.82682137%204.1171875,8.13671875%20C4.17187527,8.44661613%204.2630202,8.73827988%204.390625,9.01171875%20L3.05078125,10.3789062%20C2.68619609,10.7252621%202.50390625,11.1445288%202.50390625,11.6367188%20C2.50390625,12.1289087%202.68619609,12.5481754%203.05078125,12.8945312%20L3.10546875,12.9492188%20C3.45182465,13.3138039%203.87109129,13.4960938%204.36328125,13.4960938%20C4.85547121,13.4960938%205.27473785,13.3138039%205.62109375,12.9492188%20L8.6015625,9.96875%20C8.9479184,9.6223941%209.12109375,9.20312746%209.12109375,8.7109375%20C9.12109375,8.21874754%208.9479184,7.7994809%208.6015625,7.453125%20L8.546875,7.3984375%20C8.49218723,7.34374973%208.43750027,7.29362002%208.3828125,7.24804688%20C8.32812473,7.20247373%208.26432328,7.16145852%208.19140625,7.125%20L9.28515625,6.03125%20Z%20M11.6367188,1%20C12.5481816,1%2013.332028,1.31900723%2013.9882812,1.95703125%20L14.0429688,2.01171875%20C14.6809928,2.66797203%2015,3.45181836%2015,4.36328125%20C15,5.27474414%2014.6809928,6.04947598%2014.0429688,6.6875%20L11.9375,8.79296875%20C11.9557293,8.48307137%2011.9375003,8.17317863%2011.8828125,7.86328125%20C11.8281247,7.55338387%2011.7369798,7.26172012%2011.609375,6.98828125%20L12.9492188,5.62109375%20C13.3138039,5.27473785%2013.4960938,4.85547121%2013.4960938,4.36328125%20C13.4960938,3.87109129%2013.3138039,3.45182465%2012.9492188,3.10546875%20L12.8945312,3.05078125%20C12.5481754,2.68619609%2012.1289087,2.50390625%2011.6367188,2.50390625%20C11.1445288,2.50390625%2010.7252621,2.68619609%2010.3789062,3.05078125%20L7.3984375,6.03125%20C7.0520816,6.3776059%206.87890625,6.79687254%206.87890625,7.2890625%20C6.87890625,7.78125246%207.0520816,8.2005191%207.3984375,8.546875%20L7.453125,8.6015625%20C7.50781277,8.65625027%207.56249973,8.70637998%207.6171875,8.75195312%20C7.67187527,8.79752627%207.73567672,8.83854148%207.80859375,8.875%20L6.71484375,9.96875%20C6.66015598,9.93229148%206.60091178,9.88671902%206.53710938,9.83203125%20C6.47330697,9.77734348%206.41406277,9.73177102%206.359375,9.6953125%20L6.3046875,9.640625%20C5.66666348,8.98437172%205.34765625,8.20052539%205.34765625,7.2890625%20C5.34765625,6.37759961%205.66666348,5.59375328%206.3046875,4.9375%20L9.3125,1.95703125%20C9.95052402,1.31900723%2010.7252559,1%2011.6367188,1%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", T0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='15px'%20height='14px'%20viewBox='0%200%2015%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eOrdered%20list%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-51.000000,%20-192.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%2092.000000)'%3e%3crect%20id='Rectangle-223-Copy-3'%20x='5'%20y='2.5'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223-Copy-2'%20x='5'%20y='7'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223-Copy'%20x='5'%20y='11.5'%20width='11'%20height='2'%3e%3c/rect%3e%3cg%20id='1'%20transform='translate(1.500000,%201.900000)'%20fill-rule='nonzero'%3e%3cpath%20d='M0,2.58%20L0.69,2.58%20L0.69,0.745%20L0.095,0.745%20L0.095,0.29%20C0.268333333,0.256666667%200.415,0.216666667%200.535,0.17%20C0.655,0.123333333%200.771666667,0.0666666667%200.885,0%20L1.425,0%20L1.425,2.58%20L2.02,2.58%20L2.02,3.175%20L0,3.175%20L0,2.58%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3cg%20id='2'%20transform='translate(1.355000,%206.400000)'%20fill-rule='nonzero'%3e%3cpath%20d='M0.035,2.815%20C0.238333333,2.625%200.424166667,2.4475%200.5925,2.2825%20C0.760833333,2.1175%200.905833333,1.9625%201.0275,1.8175%20C1.14916667,1.6725%201.24416667,1.5375%201.3125,1.4125%20C1.38083333,1.2875%201.415,1.16833333%201.415,1.055%20C1.415,0.898333333%201.375,0.779166667%201.295,0.6975%20C1.215,0.615833333%201.105,0.575%200.965,0.575%20C0.848333333,0.575%200.745,0.6075%200.655,0.6725%20C0.565,0.7375%200.48,0.813333333%200.4,0.9%20L0,0.505%20C0.156666667,0.338333333%200.316666667,0.2125%200.48,0.1275%20C0.643333333,0.0425%200.838333333,0%201.065,0%20C1.22166667,0%201.36416667,0.0241666667%201.4925,0.0725%20C1.62083333,0.120833333%201.73166667,0.189166667%201.825,0.2775%20C1.91833333,0.365833333%201.99,0.471666667%202.04,0.595%20C2.09,0.718333333%202.115,0.856666667%202.115,1.01%20C2.115,1.14333333%202.08666667,1.27916667%202.03,1.4175%20C1.97333333,1.55583333%201.8975,1.69416667%201.8025,1.8325%20C1.7075,1.97083333%201.59916667,2.10916667%201.4775,2.2475%20C1.35583333,2.38583333%201.23,2.52166667%201.1,2.655%20C1.18,2.645%201.26916667,2.63583333%201.3675,2.6275%20C1.46583333,2.61916667%201.55333333,2.615%201.63,2.615%20L2.27,2.615%20L2.27,3.235%20L0.035,3.235%20L0.035,2.815%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3cg%20id='3'%20transform='translate(1.350000,%2010.800000)'%20fill-rule='nonzero'%3e%3cpath%20d='M0.34,2.38%20C0.436666667,2.47333333%200.5425,2.55%200.6575,2.61%20C0.7725,2.67%200.898333333,2.7%201.035,2.7%20C1.19166667,2.7%201.31666667,2.6675%201.41,2.6025%20C1.50333333,2.5375%201.55,2.445%201.55,2.325%20C1.55,2.255%201.5375,2.19166667%201.5125,2.135%20C1.4875,2.07833333%201.44333333,2.03083333%201.38,1.9925%20C1.31666667,1.95416667%201.23,1.92416667%201.12,1.9025%20C1.01,1.88083333%200.868333333,1.87%200.695,1.87%20L0.695,1.35%20C0.838333333,1.35%200.9575,1.34%201.0525,1.32%20C1.1475,1.3%201.22416667,1.27083333%201.2825,1.2325%20C1.34083333,1.19416667%201.3825,1.14916667%201.4075,1.0975%20C1.4325,1.04583333%201.445,0.988333333%201.445,0.925%20C1.445,0.815%201.41166667,0.729166667%201.345,0.6675%20C1.27833333,0.605833333%201.18166667,0.575%201.055,0.575%20C0.941666667,0.575%200.839166667,0.6%200.7475,0.65%20C0.655833333,0.7%200.56,0.768333333%200.46,0.855%20L0.09,0.405%20C0.236666667,0.278333333%200.390833333,0.179166667%200.5525,0.1075%20C0.714166667,0.0358333333%200.893333333,0%201.09,0%20C1.25333333,0%201.4025,0.0191666667%201.5375,0.0575%20C1.6725,0.0958333333%201.7875,0.1525%201.8825,0.2275%20C1.9775,0.3025%202.05166667,0.393333333%202.105,0.5%20C2.15833333,0.606666667%202.185,0.73%202.185,0.87%20C2.185,1.03666667%202.13916667,1.1775%202.0475,1.2925%20C1.95583333,1.4075%201.825,1.50166667%201.655,1.575%20L1.655,1.595%20C1.83833333,1.64833333%201.98916667,1.73916667%202.1075,1.8675%20C2.22583333,1.99583333%202.285,2.16333333%202.285,2.37%20C2.285,2.51666667%202.25333333,2.6475%202.19,2.7625%20C2.12666667,2.8775%202.04166667,2.97416667%201.935,3.0525%20C1.82833333,3.13083333%201.70333333,3.19083333%201.56,3.2325%20C1.41666667,3.27416667%201.265,3.295%201.105,3.295%20C0.845,3.295%200.625,3.25416667%200.445,3.1725%20C0.265,3.09083333%200.116666667,2.98166667%200,2.845%20L0.34,2.38%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", R0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='16px'%20height='14px'%20viewBox='0%200%2016%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eOutdent%20short%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-50.000000,%20-327.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20227.000000)'%3e%3crect%20id='Rectangle-223'%20x='0'%20y='1.6'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='0'%20y='12.4'%20width='16'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='8.8'%20width='9'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='7'%20y='5.2'%20width='9'%20height='2'%3e%3c/rect%3e%3cpath%20d='M5.21357552,10.85%20C5.21357552,11.001793%205.08857537,11.1357218%204.92786089,11.1357218%20C4.84750365,11.1357218%204.77607499,11.1000075%204.71357492,11.046436%20L1.86535724,8.1892897%20C1.81178575,8.1357182%201.785,8.06428955%201.785,7.99286089%20C1.785,7.91250365%201.81178575,7.84107499%201.86535724,7.7875035%20L4.7225035,4.93035724%20C4.77607499,4.87678575%204.85643223,4.85%204.92786089,4.85%20C5.07964678,4.85%205.21357552,4.97500015%205.21357552,5.13571463%20L5.21357552,10.85%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", S0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='14px'%20viewBox='0%200%2014%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIcon/icon-ellipses%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---Schematics'%20transform='translate(-520.000000,%20-200.000000)'%20fill='%234B5356'%3e%3cg%20id='Group-5'%20transform='translate(146.000000,%20167.000000)'%3e%3cg%20id='Button/2.-Icon/6.-Default-Copy-8'%20transform='translate(363.000000,%2025.000000)'%3e%3cg%20id='Icon/icon-undo'%20transform='translate(10.000000,%207.000000)'%3e%3cpath%20d='M15,2.16666667%20C15,1.9296875%2014.8541667,1.72005208%2014.6445312,1.62890625%20C14.4257812,1.53776042%2014.1705729,1.58333333%2014.0065104,1.75651042%20L12.8216146,2.93229167%20C11.5364583,1.72005208%209.79557292,1%208,1%20C4.14453125,1%201,4.14453125%201,8%20C1,11.8554688%204.14453125,15%208,15%20C10.0872396,15%2012.0559896,14.0794271%2013.3867188,12.4752604%20C13.4778646,12.3567708%2013.4778646,12.1835938%2013.3684896,12.0833333%20L12.1197917,10.8255208%20C12.0559896,10.7708333%2011.9739583,10.7434896%2011.8919271,10.7434896%20C11.8098958,10.7526042%2011.7278646,10.7890625%2011.6822917,10.8528646%20C10.7890625,12.0104167%209.44921875,12.6666667%208,12.6666667%20C5.4296875,12.6666667%203.33333333,10.5703125%203.33333333,8%20C3.33333333,5.4296875%205.4296875,3.33333333%208,3.33333333%20C9.19401042,3.33333333%2010.3242188,3.7890625%2011.1809896,4.58203125%20L9.92317708,5.83984375%20C9.75,6.00390625%209.70442708,6.25911458%209.79557292,6.46875%20C9.88671875,6.6875%2010.0963542,6.83333333%2010.3333333,6.83333333%20L14.4166667,6.83333333%20C14.7356771,6.83333333%2015,6.56901042%2015,6.25%20L15,2.16666667%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", M0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='14px'%20viewBox='0%200%2014%2014'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eIcon/icon-ellipses%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---Schematics'%20transform='translate(-484.000000,%20-200.000000)'%20fill='%234B5356'%3e%3cg%20id='Group-5'%20transform='translate(146.000000,%20167.000000)'%3e%3cg%20id='Button/2.-Icon/6.-Default-Copy-9'%20transform='translate(345.000000,%2040.000000)%20scale(-1,%201)%20translate(-345.000000,%20-40.000000)%20translate(327.000000,%2025.000000)'%3e%3cg%20id='Icon/icon-undo'%20transform='translate(10.000000,%207.000000)'%3e%3cpath%20d='M15,2.16666667%20C15,1.9296875%2014.8541667,1.72005208%2014.6445312,1.62890625%20C14.4257812,1.53776042%2014.1705729,1.58333333%2014.0065104,1.75651042%20L12.8216146,2.93229167%20C11.5364583,1.72005208%209.79557292,1%208,1%20C4.14453125,1%201,4.14453125%201,8%20C1,11.8554688%204.14453125,15%208,15%20C10.0872396,15%2012.0559896,14.0794271%2013.3867188,12.4752604%20C13.4778646,12.3567708%2013.4778646,12.1835938%2013.3684896,12.0833333%20L12.1197917,10.8255208%20C12.0559896,10.7708333%2011.9739583,10.7434896%2011.8919271,10.7434896%20C11.8098958,10.7526042%2011.7278646,10.7890625%2011.6822917,10.8528646%20C10.7890625,12.0104167%209.44921875,12.6666667%208,12.6666667%20C5.4296875,12.6666667%203.33333333,10.5703125%203.33333333,8%20C3.33333333,5.4296875%205.4296875,3.33333333%208,3.33333333%20C9.19401042,3.33333333%2010.3242188,3.7890625%2011.1809896,4.58203125%20L9.92317708,5.83984375%20C9.75,6.00390625%209.70442708,6.25911458%209.79557292,6.46875%20C9.88671875,6.6875%2010.0963542,6.83333333%2010.3333333,6.83333333%20L14.4166667,6.83333333%20C14.7356771,6.83333333%2015,6.56901042%2015,6.25%20L15,2.16666667%20Z'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", b0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='14px'%20height='16px'%20viewBox='0%200%2014%2016'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eUnlink%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-51.000000,%20-371.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20272.000000)'%3e%3cpath%20d='M14.0429688,2.01171875%20C14.6809928,2.66797203%2015,3.45181836%2015,4.36328125%20C15,5.27474414%2014.6809928,6.04947598%2014.0429688,6.6875%20L11.1027446,9.58420181%20L10.3518996,8.27890801%20L12.9492188,5.62109375%20C13.3138039,5.27473785%2013.4960938,4.85547121%2013.4960938,4.36328125%20C13.4960938,3.87109129%2013.3138039,3.45182465%2012.9492188,3.10546875%20L12.8945313,3.05078125%20C12.5481754,2.68619609%2012.1289087,2.50390625%2011.6367188,2.50390625%20C11.1445288,2.50390625%2010.7252621,2.68619609%2010.3789063,3.05078125%20L8.41457939,4.92175579%20L7.64047964,3.57621944%20L9.3125,1.95703125%20C9.95052402,1.31900723%2010.7252559,1%2011.6367188,1%20C12.5481816,1%2013.332028,1.31900723%2013.9882813,1.95703125%20L14.0429688,2.01171875%20Z'%20id='Path'%3e%3c/path%3e%3cpath%20d='M8.02641916,12.7072184%20L6.6875,14.0429687%20C6.04947598,14.6809928%205.27474414,15%204.36328125,15%20C3.45181836,15%202.66797203,14.6809928%202.01171875,14.0429687%20L1.95703125,13.9882812%20C1.31900723,13.332028%201,12.5481816%201,11.6367187%20C1,10.7252559%201.31900723,9.95052402%201.95703125,9.3125%20L4.57246065,6.71787083%20L5.34566408,8.05009655%20L3.05078125,10.3789062%20C2.68619609,10.7252621%202.50390625,11.1445288%202.50390625,11.6367187%20C2.50390625,12.1289087%202.68619609,12.5481754%203.05078125,12.8945312%20L3.10546875,12.9492187%20C3.45182465,13.3138039%203.87109129,13.4960937%204.36328125,13.4960937%20C4.85547121,13.4960937%205.27473785,13.3138039%205.62109375,12.9492187%20L7.2646265,11.388324%20L8.02641916,12.7072184%20Z'%20id='Path'%3e%3c/path%3e%3crect%20id='Rectangle'%20transform='translate(7.750000,%208.000000)%20rotate(-30.000000)%20translate(-7.750000,%20-8.000000)%20'%20x='7'%20y='0'%20width='1.5'%20height='16'%3e%3c/rect%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", I0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='15px'%20height='12px'%20viewBox='0%200%2015%2012'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eUnordered%20list%3c/title%3e%3cg%20id='Components'%20stroke='none'%20stroke-width='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='Markdown-Editor---New-icons'%20transform='translate(-51.000000,%20-238.000000)'%20fill='%234B5356'%3e%3cg%20id='Group'%20transform='translate(50.000000,%2099.000000)'%3e%3cg%20transform='translate(0.000000,%20137.000000)'%3e%3cg%20transform='translate(1.000000,%202.000000)'%3e%3crect%20id='Rectangle-223'%20x='4'%20y='0.5'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='4'%20y='5'%20width='11'%20height='2'%3e%3c/rect%3e%3crect%20id='Rectangle-223'%20x='4'%20y='9.5'%20width='11'%20height='2'%3e%3c/rect%3e%3ccircle%20id='Oval'%20cx='1.5'%20cy='1.5'%20r='1.5'%3e%3c/circle%3e%3ccircle%20id='Oval-Copy'%20cx='1.5'%20cy='6'%20r='1.5'%3e%3c/circle%3e%3ccircle%20id='Oval-Copy-2'%20cx='1.5'%20cy='10.5'%20r='1.5'%3e%3c/circle%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e", w = (t, n) => {
|
|
328
|
+
let e = t;
|
|
329
|
+
for (; e.parentElement && !n.includes(e.parentElement.tagName); )
|
|
312
330
|
e = e.parentElement;
|
|
313
|
-
return e.parentElement &&
|
|
314
|
-
},
|
|
315
|
-
const
|
|
316
|
-
let e =
|
|
331
|
+
return e.parentElement && n.includes(e.parentElement.tagName) ? e.parentElement : null;
|
|
332
|
+
}, O = (t) => {
|
|
333
|
+
const n = [];
|
|
334
|
+
let e = t;
|
|
317
335
|
for (; e.nextElementSibling; )
|
|
318
|
-
|
|
319
|
-
return
|
|
320
|
-
},
|
|
336
|
+
n.push(e.nextElementSibling), e = e.nextElementSibling;
|
|
337
|
+
return n;
|
|
338
|
+
}, A0 = {
|
|
321
339
|
key: "bold",
|
|
322
|
-
icon:
|
|
340
|
+
icon: _0,
|
|
323
341
|
onClick: () => document.execCommand("bold"),
|
|
324
|
-
activeTest: (
|
|
342
|
+
activeTest: (t) => ["B", "STRONG"].includes(t.tagName),
|
|
325
343
|
isSimpleToggle: !0
|
|
326
|
-
},
|
|
344
|
+
}, O0 = {
|
|
327
345
|
key: "italics",
|
|
328
|
-
icon:
|
|
346
|
+
icon: N0,
|
|
329
347
|
onClick: () => document.execCommand("italic"),
|
|
330
|
-
activeTest: (
|
|
348
|
+
activeTest: (t) => ["I", "EM"].includes(t.tagName),
|
|
331
349
|
isSimpleToggle: !0
|
|
332
|
-
},
|
|
350
|
+
}, B0 = {
|
|
333
351
|
key: "ul",
|
|
334
|
-
icon:
|
|
352
|
+
icon: I0,
|
|
335
353
|
onClick: () => document.execCommand("insertUnorderedList"),
|
|
336
|
-
activeTest: (
|
|
337
|
-
},
|
|
354
|
+
activeTest: (t) => t.tagName === "UL"
|
|
355
|
+
}, U0 = {
|
|
338
356
|
key: "ol",
|
|
339
|
-
icon:
|
|
357
|
+
icon: T0,
|
|
340
358
|
onClick: () => document.execCommand("insertOrderedList"),
|
|
341
|
-
activeTest: (
|
|
342
|
-
},
|
|
359
|
+
activeTest: (t) => t.tagName === "OL"
|
|
360
|
+
}, D0 = {
|
|
343
361
|
key: "indent",
|
|
344
|
-
icon:
|
|
362
|
+
icon: k0,
|
|
345
363
|
onClick: () => {
|
|
346
364
|
try {
|
|
347
|
-
const
|
|
348
|
-
if (
|
|
349
|
-
const
|
|
350
|
-
if (!(e instanceof HTMLElement) || (e.tagName === "UL" || e.tagName === "OL" || e.tagName === "LI") && e.firstElementChild &&
|
|
365
|
+
const t = window.getSelection();
|
|
366
|
+
if (t?.type === "Range") {
|
|
367
|
+
const n = t.getRangeAt(0), e = n.commonAncestorContainer;
|
|
368
|
+
if (!(e instanceof HTMLElement) || (e.tagName === "UL" || e.tagName === "OL" || e.tagName === "LI") && e.firstElementChild && n.intersectsNode(e.firstElementChild))
|
|
351
369
|
return;
|
|
352
370
|
const r = [];
|
|
353
371
|
let o;
|
|
354
|
-
if (e.childNodes.forEach((
|
|
355
|
-
|
|
372
|
+
if (e.childNodes.forEach((i) => {
|
|
373
|
+
n.intersectsNode(i) && i instanceof HTMLElement && i.tagName === "LI" && (r.length === 0 && (o = i.previousSibling), r.push(i));
|
|
356
374
|
}), o instanceof HTMLElement && o.tagName === "LI") {
|
|
357
375
|
r.forEach((c) => c.remove());
|
|
358
|
-
const
|
|
359
|
-
if (
|
|
360
|
-
const c = document.createElement(
|
|
361
|
-
r.forEach((
|
|
376
|
+
const i = o.parentElement?.tagName.toLowerCase();
|
|
377
|
+
if (i) {
|
|
378
|
+
const c = document.createElement(i);
|
|
379
|
+
r.forEach((a) => c.appendChild(a)), o.appendChild(c);
|
|
362
380
|
}
|
|
363
381
|
return;
|
|
364
382
|
}
|
|
365
|
-
} else if (
|
|
366
|
-
const { anchorNode:
|
|
383
|
+
} else if (t) {
|
|
384
|
+
const { anchorNode: n } = t;
|
|
367
385
|
let e;
|
|
368
|
-
if (
|
|
386
|
+
if (n instanceof HTMLElement && n.tagName === "LI" ? e = n : n && (e = w(n, ["LI"])), e) {
|
|
369
387
|
const r = e.previousElementSibling, o = e.parentElement.tagName.toLowerCase();
|
|
370
388
|
if (r && r.tagName === "LI") {
|
|
371
389
|
e.remove();
|
|
372
|
-
const
|
|
373
|
-
if (
|
|
374
|
-
|
|
390
|
+
const i = r.querySelector(o);
|
|
391
|
+
if (i)
|
|
392
|
+
i.appendChild(e);
|
|
375
393
|
else {
|
|
376
394
|
const c = document.createElement(o);
|
|
377
395
|
c.appendChild(e), r.appendChild(c);
|
|
378
396
|
}
|
|
379
|
-
|
|
397
|
+
n && y(n.childNodes?.[0] || n);
|
|
380
398
|
}
|
|
381
399
|
return;
|
|
382
400
|
}
|
|
@@ -385,26 +403,26 @@ const v0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3c
|
|
|
385
403
|
}
|
|
386
404
|
document.execCommand("indent");
|
|
387
405
|
}
|
|
388
|
-
},
|
|
406
|
+
}, P0 = {
|
|
389
407
|
key: "outdent",
|
|
390
|
-
icon:
|
|
408
|
+
icon: R0,
|
|
391
409
|
onClick: () => {
|
|
392
410
|
try {
|
|
393
|
-
const
|
|
394
|
-
if (
|
|
395
|
-
const
|
|
411
|
+
const t = window.getSelection();
|
|
412
|
+
if (t?.type === "Range") {
|
|
413
|
+
const n = t.getRangeAt(0), e = n.commonAncestorContainer;
|
|
396
414
|
if (!(e instanceof HTMLElement))
|
|
397
415
|
return;
|
|
398
416
|
const r = [];
|
|
399
417
|
let o;
|
|
400
418
|
if (e.tagName === "UL" || e.tagName === "OL" ? o = e : e.tagName === "LI" && (o = e.parentElement), o) {
|
|
401
419
|
o.childNodes.forEach((c) => {
|
|
402
|
-
|
|
420
|
+
n.intersectsNode(c) && c instanceof HTMLElement && c.tagName === "LI" && r.push(c);
|
|
403
421
|
});
|
|
404
|
-
const
|
|
405
|
-
|
|
406
|
-
if (
|
|
407
|
-
const s =
|
|
422
|
+
const i = o.parentElement;
|
|
423
|
+
i?.tagName === "LI" && (r.forEach((c, a) => {
|
|
424
|
+
if (a === r.length - 1) {
|
|
425
|
+
const s = O(c);
|
|
408
426
|
if (s.length > 0) {
|
|
409
427
|
const l = o.tagName.toLowerCase(), g = c.querySelector(l);
|
|
410
428
|
if (g)
|
|
@@ -419,25 +437,25 @@ const v0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3c
|
|
|
419
437
|
}
|
|
420
438
|
}
|
|
421
439
|
c.remove();
|
|
422
|
-
}), o.childElementCount === 0 && o.remove(), r.reverse().forEach((c) =>
|
|
440
|
+
}), o.childElementCount === 0 && o.remove(), r.reverse().forEach((c) => i.after(c)));
|
|
423
441
|
return;
|
|
424
442
|
}
|
|
425
|
-
} else if (
|
|
426
|
-
const { anchorNode:
|
|
443
|
+
} else if (t) {
|
|
444
|
+
const { anchorNode: n } = t;
|
|
427
445
|
let e = null, r = null;
|
|
428
|
-
|
|
446
|
+
n instanceof HTMLElement && (n.tagName === "UL" || n.tagName === "OL") ? (e = n, r = n.querySelector("li")) : n && (e = w(n, ["UL", "OL"]), r = n instanceof HTMLElement && n.tagName === "LI" ? n : w(n, ["LI"]));
|
|
429
447
|
const o = e ? w(e, ["UL", "OL"]) : null;
|
|
430
448
|
if (e && o) {
|
|
431
|
-
const
|
|
449
|
+
const i = w(e, ["LI"]);
|
|
432
450
|
if (e.childElementCount === 1 && e.remove(), r) {
|
|
433
|
-
const c =
|
|
451
|
+
const c = O(r);
|
|
434
452
|
if (c.length > 0) {
|
|
435
|
-
const
|
|
436
|
-
r.appendChild(
|
|
453
|
+
const a = document.createElement(e.tagName.toLowerCase());
|
|
454
|
+
r.appendChild(a);
|
|
437
455
|
for (const s of c)
|
|
438
|
-
s.remove(),
|
|
456
|
+
s.remove(), a.appendChild(s);
|
|
439
457
|
}
|
|
440
|
-
|
|
458
|
+
i?.after(r), r.lastChild && y(r.lastChild);
|
|
441
459
|
}
|
|
442
460
|
return;
|
|
443
461
|
}
|
|
@@ -446,16 +464,16 @@ const v0 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3c
|
|
|
446
464
|
}
|
|
447
465
|
document.execCommand("outdent");
|
|
448
466
|
}
|
|
449
|
-
},
|
|
467
|
+
}, V0 = {
|
|
450
468
|
key: "undo",
|
|
451
|
-
icon:
|
|
469
|
+
icon: M0,
|
|
452
470
|
onClick: () => document.execCommand("undo")
|
|
453
|
-
},
|
|
471
|
+
}, H0 = {
|
|
454
472
|
key: "redo",
|
|
455
|
-
icon:
|
|
473
|
+
icon: S0,
|
|
456
474
|
onClick: () => document.execCommand("redo")
|
|
457
475
|
};
|
|
458
|
-
function
|
|
476
|
+
function F0(t, n) {
|
|
459
477
|
const [e, r] = v(!1), o = x((s, l) => {
|
|
460
478
|
r(!1);
|
|
461
479
|
const g = s.cloneRange(), m = window.getSelection();
|
|
@@ -479,62 +497,62 @@ function U0(n, t) {
|
|
|
479
497
|
const f = g?.startContainer?.parentElement;
|
|
480
498
|
f && f.tagName === "A" ? (f.setAttribute("href", l.link), f.textContent = l.text, window.getSelection()?.getRangeAt(0)?.selectNodeContents(f)) : document.execCommand("createLink", void 0, l.link);
|
|
481
499
|
}
|
|
482
|
-
}, []),
|
|
500
|
+
}, []), i = C(() => ({
|
|
483
501
|
key: "link",
|
|
484
|
-
icon:
|
|
502
|
+
icon: y0,
|
|
485
503
|
onClick: () => {
|
|
486
504
|
const s = window.getSelection(), l = (s?.rangeCount ?? 0) > 0 ? s?.getRangeAt(0).commonAncestorContainer : null;
|
|
487
|
-
|
|
505
|
+
n.current && l && n.current.contains(l) && r(!0);
|
|
488
506
|
},
|
|
489
507
|
activeTest: (s) => s.tagName === "A"
|
|
490
508
|
}), []), c = C(() => ({
|
|
491
509
|
key: "unlink",
|
|
492
|
-
icon:
|
|
510
|
+
icon: b0,
|
|
493
511
|
onClick: () => {
|
|
494
|
-
const s =
|
|
512
|
+
const s = t(i.activeTest);
|
|
495
513
|
s && (window.getSelection()?.getRangeAt(0).selectNodeContents(s), document.execCommand("unlink"));
|
|
496
514
|
}
|
|
497
|
-
}), [
|
|
515
|
+
}), [t]);
|
|
498
516
|
return {
|
|
499
517
|
toolbarButtons: [
|
|
500
|
-
M0,
|
|
501
|
-
S0,
|
|
502
|
-
"vr",
|
|
503
|
-
b0,
|
|
504
|
-
I0,
|
|
505
518
|
A0,
|
|
506
519
|
O0,
|
|
507
520
|
"vr",
|
|
508
|
-
|
|
521
|
+
B0,
|
|
522
|
+
U0,
|
|
523
|
+
D0,
|
|
524
|
+
P0,
|
|
525
|
+
"vr",
|
|
526
|
+
i,
|
|
509
527
|
c,
|
|
510
528
|
"vr",
|
|
511
|
-
|
|
512
|
-
|
|
529
|
+
V0,
|
|
530
|
+
H0
|
|
513
531
|
],
|
|
514
532
|
showLinkModal: e,
|
|
515
533
|
handleLinkModalClose: o
|
|
516
534
|
};
|
|
517
535
|
}
|
|
518
|
-
function
|
|
519
|
-
className:
|
|
520
|
-
md:
|
|
536
|
+
function $0({
|
|
537
|
+
className: t,
|
|
538
|
+
md: n,
|
|
521
539
|
html: e,
|
|
522
540
|
disabled: r,
|
|
523
541
|
onChange: o,
|
|
524
|
-
...
|
|
542
|
+
...i
|
|
525
543
|
}) {
|
|
526
|
-
const c =
|
|
544
|
+
const c = V(i), { aggValue: a, editableDivInnerHtml: s, updateStateFromDiv: l } = C0(n, e);
|
|
527
545
|
d.useEffect(() => {
|
|
528
|
-
o &&
|
|
529
|
-
}, [
|
|
530
|
-
const g =
|
|
546
|
+
o && a && o(a);
|
|
547
|
+
}, [a]);
|
|
548
|
+
const g = L0(l);
|
|
531
549
|
d.useEffect(() => {
|
|
532
550
|
s && g.current && (g.current.innerHTML = s.html);
|
|
533
551
|
}, [s]);
|
|
534
|
-
const { selectionRange: m, selectionDOMContextFind: f } =
|
|
552
|
+
const { selectionRange: m, selectionDOMContextFind: f } = E0(g), { toolbarButtons: h, showLinkModal: u, handleLinkModalClose: E } = F0(
|
|
535
553
|
f,
|
|
536
554
|
g
|
|
537
|
-
), { height: T, minHeight: R } =
|
|
555
|
+
), { height: T, minHeight: R } = i.style ?? {}, _ = {};
|
|
538
556
|
return T ? _.height = `
|
|
539
557
|
calc(
|
|
540
558
|
${T}
|
|
@@ -547,9 +565,9 @@ function P0({
|
|
|
547
565
|
- ${p.component["rich-text-editor"].vr.height}
|
|
548
566
|
- (2 * ${p.component["rich-text-editor"].border.width})
|
|
549
567
|
- (2 * ${p.component["rich-text-editor"].padding.input.y})
|
|
550
|
-
)`), /* @__PURE__ */ d.createElement("div", { className:
|
|
551
|
-
(k,
|
|
552
|
-
|
|
568
|
+
)`), /* @__PURE__ */ d.createElement("div", { className: H(a0({ disabled: r }), t), ...i }, !r && /* @__PURE__ */ d.createElement(d.Fragment, null, /* @__PURE__ */ d.createElement("div", { className: l0, ...c("toolbar") }, h.map(
|
|
569
|
+
(k, D) => k === "vr" ? /* @__PURE__ */ d.createElement("div", { className: d0, key: `vr-${D}` }) : /* @__PURE__ */ d.createElement(
|
|
570
|
+
i0,
|
|
553
571
|
{
|
|
554
572
|
...k,
|
|
555
573
|
selectionDOMContextFind: f,
|
|
@@ -557,7 +575,7 @@ function P0({
|
|
|
557
575
|
}
|
|
558
576
|
)
|
|
559
577
|
)), u && /* @__PURE__ */ d.createElement(
|
|
560
|
-
|
|
578
|
+
t0,
|
|
561
579
|
{
|
|
562
580
|
onClose: E,
|
|
563
581
|
selectionDOMContextFind: f,
|
|
@@ -566,7 +584,7 @@ function P0({
|
|
|
566
584
|
)), /* @__PURE__ */ d.createElement(
|
|
567
585
|
"div",
|
|
568
586
|
{
|
|
569
|
-
className:
|
|
587
|
+
className: s0({ disabled: r }),
|
|
570
588
|
ref: g,
|
|
571
589
|
contentEditable: !r,
|
|
572
590
|
...c("input"),
|
|
@@ -574,7 +592,7 @@ function P0({
|
|
|
574
592
|
}
|
|
575
593
|
));
|
|
576
594
|
}
|
|
577
|
-
|
|
595
|
+
P.set($0, {
|
|
578
596
|
name: "RichTextEditor",
|
|
579
597
|
props: {
|
|
580
598
|
md: "string",
|
|
@@ -584,5 +602,5 @@ D.set(P0, {
|
|
|
584
602
|
}
|
|
585
603
|
});
|
|
586
604
|
export {
|
|
587
|
-
|
|
605
|
+
$0 as RichTextEditor
|
|
588
606
|
};
|