@arkitektbedriftene/fe-lib 0.4.30 → 0.4.32
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/rich-text/rich-text.d.ts +1 -0
- package/dist/rich-text.es.js +255 -246
- package/package.json +1 -1
package/dist/rich-text.es.js
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { createHeadlessEditor as
|
|
5
|
-
import { $generateHtmlFromNodes as
|
|
6
|
-
import { $getRoot as K, ParagraphNode as
|
|
7
|
-
import { trimTextContentFromAnchor as
|
|
8
|
-
import { LinkNode as
|
|
9
|
-
import { ListNode as
|
|
10
|
-
import { HeadingNode as
|
|
11
|
-
import { TableNode as
|
|
1
|
+
var Gt = Object.defineProperty;
|
|
2
|
+
var Jt = (t, e, r) => e in t ? Gt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var st = (t, e, r) => (Jt(t, typeof e != "symbol" ? e + "" : e, r), r);
|
|
4
|
+
import { createHeadlessEditor as Xt } from "@lexical/headless";
|
|
5
|
+
import { $generateHtmlFromNodes as Qt } from "@lexical/html";
|
|
6
|
+
import { $getRoot as K, ParagraphNode as Vt, $createParagraphNode as q, $createTextNode as B, $setSelection as bt, SELECTION_CHANGE_COMMAND as F, $getSelection as T, COMMAND_PRIORITY_CRITICAL as Q, $isRangeSelection as L, $isRootOrShadowRoot as Zt, FORMAT_TEXT_COMMAND as D, COMMAND_PRIORITY_LOW as E, KEY_ARROW_DOWN_COMMAND as te, KEY_ARROW_UP_COMMAND as ee, KEY_ESCAPE_COMMAND as vt, KEY_SPACE_COMMAND as re, $getNearestNodeFromDOMNode as V, KEY_ARROW_LEFT_COMMAND as ne, $isElementNode as oe, COMMAND_PRIORITY_NORMAL as ie, $isParagraphNode as ae, COMMAND_PRIORITY_HIGH as le } from "lexical";
|
|
7
|
+
import { trimTextContentFromAnchor as se, $setBlocksType as J, $isAtNodeEnd as ct } from "@lexical/selection";
|
|
8
|
+
import { LinkNode as z, AutoLinkNode as Mt, $isLinkNode as U, TOGGLE_LINK_COMMAND as Z } from "@lexical/link";
|
|
9
|
+
import { ListNode as tt, ListItemNode as Ct, $isListNode as et, INSERT_UNORDERED_LIST_COMMAND as ce, INSERT_ORDERED_LIST_COMMAND as de, INSERT_CHECK_LIST_COMMAND as Tt, insertList as ue, $isListItemNode as O } from "@lexical/list";
|
|
10
|
+
import { HeadingNode as Lt, QuoteNode as xt, $isHeadingNode as he, $createHeadingNode as pe, $createQuoteNode as ge } from "@lexical/rich-text";
|
|
11
|
+
import { TableNode as yt, TableRowNode as Nt, TableCellNode as St, INSERT_TABLE_COMMAND as fe, $getTableCellNodeFromLexicalNode as me, $deleteTableColumn__EXPERIMENTAL as ke, $deleteTableRow__EXPERIMENTAL as be, $insertTableColumn__EXPERIMENTAL as dt, $insertTableRow__EXPERIMENTAL as ut } from "@lexical/table";
|
|
12
12
|
import { jsx as n, jsxs as g, Fragment as Y } from "react/jsx-runtime";
|
|
13
|
-
import { createContext as ve, useState as b, useRef as
|
|
14
|
-
import { s as
|
|
13
|
+
import { createContext as ve, useState as b, useRef as rt, useCallback as v, useContext as Me, useEffect as x, useMemo as wt, useLayoutEffect as Ce } from "react";
|
|
14
|
+
import { s as Et, D as nt, T as _t, a as C, B as P, b as Rt, c as I, u as ot, d as It, e as Te, f as Le, o as zt, g as xe, h as Ot, i as $t, F as At, O as Dt, j as ye, k as Ne, S as Se, l as we, m as $, n as R, p as ht, q as Ee, N as _e, r as pt, t as Re, v as Bt, C as Ie, w as ze, x as Oe } from "./Checkbox-0c1030b1.js";
|
|
15
15
|
import "react-select";
|
|
16
16
|
import { LexicalComposer as $e } from "@lexical/react/LexicalComposer.js";
|
|
17
17
|
import { RichTextPlugin as Ae } from "@lexical/react/LexicalRichTextPlugin.js";
|
|
18
18
|
import De from "@lexical/react/LexicalErrorBoundary.js";
|
|
19
19
|
import { useLexicalComposerContext as y } from "@lexical/react/LexicalComposerContext.js";
|
|
20
|
-
import { $getNearestNodeOfType as Be, $findMatchingParent as
|
|
20
|
+
import { $getNearestNodeOfType as Be, $findMatchingParent as Pt, mergeRegister as it, isHTMLElement as gt } from "@lexical/utils";
|
|
21
21
|
import { G as h, f as Pe } from "./index.esm-3266b7f8.js";
|
|
22
22
|
import { ListPlugin as Fe } from "@lexical/react/LexicalListPlugin.js";
|
|
23
23
|
import { HistoryPlugin as He } from "@lexical/react/LexicalHistoryPlugin.js";
|
|
@@ -49,10 +49,10 @@ const je = ({
|
|
|
49
49
|
maxLines: r
|
|
50
50
|
}) => {
|
|
51
51
|
const o = K(), i = o.getTextContent(), l = je({ text: i, maxChars: e, maxLines: r }), a = i.length - l, d = o.select().anchor;
|
|
52
|
-
|
|
52
|
+
se(t, d, a);
|
|
53
53
|
const c = o.getLastChild();
|
|
54
|
-
return c instanceof
|
|
55
|
-
},
|
|
54
|
+
return c instanceof Vt && c.getChildrenSize() === 0 && c.remove(), a;
|
|
55
|
+
}, Ft = {
|
|
56
56
|
quote: "ain-rich-text-quote",
|
|
57
57
|
text: {
|
|
58
58
|
bold: "ain-rich-text-bold",
|
|
@@ -64,13 +64,13 @@ const je = ({
|
|
|
64
64
|
listitem: "ain-rich-text-nested-list-item"
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
},
|
|
67
|
+
}, Ht = (t) => t[0] === "{", qe = (t) => t !== null && typeof t == "object" && "isEmpty" in t, Ye = (t, e) => {
|
|
68
68
|
t.update(
|
|
69
69
|
() => {
|
|
70
70
|
const r = K();
|
|
71
71
|
r.clear();
|
|
72
72
|
const o = q();
|
|
73
|
-
o.append(
|
|
73
|
+
o.append(B("")), r.append(o), bt(null);
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
tag: e
|
|
@@ -82,25 +82,25 @@ const je = ({
|
|
|
82
82
|
const o = K();
|
|
83
83
|
o.clear();
|
|
84
84
|
const i = q();
|
|
85
|
-
i.append(
|
|
85
|
+
i.append(B(t.trim())), o.append(i), bt(null);
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
tag: r
|
|
89
89
|
}
|
|
90
90
|
), e.blur();
|
|
91
|
-
},
|
|
91
|
+
}, cn = (t, e, r) => {
|
|
92
92
|
let o = 0;
|
|
93
|
-
const i =
|
|
93
|
+
const i = Xt({
|
|
94
94
|
nodes: e,
|
|
95
95
|
editable: !1,
|
|
96
|
-
theme:
|
|
96
|
+
theme: Ft
|
|
97
97
|
});
|
|
98
98
|
if (t)
|
|
99
99
|
try {
|
|
100
|
-
if (typeof t == "string" && !
|
|
100
|
+
if (typeof t == "string" && !Ht(t))
|
|
101
101
|
i.update(() => {
|
|
102
102
|
const a = K(), s = q();
|
|
103
|
-
s.append(
|
|
103
|
+
s.append(B(t.trim())), a.append(s);
|
|
104
104
|
});
|
|
105
105
|
else {
|
|
106
106
|
const a = i.parseEditorState(t, () => {
|
|
@@ -117,10 +117,10 @@ const je = ({
|
|
|
117
117
|
let l = "";
|
|
118
118
|
return i.update(() => {
|
|
119
119
|
var a;
|
|
120
|
-
r != null && r.updateFn && ((a = r.updateFn) == null || a.call(r)), l =
|
|
120
|
+
r != null && r.updateFn && ((a = r.updateFn) == null || a.call(r)), l = Qt(i);
|
|
121
121
|
}), { html: l, trimCount: o };
|
|
122
122
|
};
|
|
123
|
-
class W extends
|
|
123
|
+
class W extends z {
|
|
124
124
|
static getType() {
|
|
125
125
|
return "target-link";
|
|
126
126
|
}
|
|
@@ -139,32 +139,40 @@ class W extends B {
|
|
|
139
139
|
return super.exportJSON();
|
|
140
140
|
}
|
|
141
141
|
static importJSON(e) {
|
|
142
|
-
return
|
|
142
|
+
return z.importJSON(e);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
145
|
+
const dn = [
|
|
146
|
+
Lt,
|
|
147
|
+
xt,
|
|
148
|
+
tt,
|
|
149
|
+
Ct,
|
|
150
|
+
Mt,
|
|
151
|
+
z,
|
|
152
|
+
yt,
|
|
153
|
+
Nt,
|
|
154
|
+
St
|
|
155
155
|
], un = [
|
|
156
|
-
|
|
156
|
+
Lt,
|
|
157
|
+
xt,
|
|
158
|
+
tt,
|
|
159
|
+
Ct,
|
|
160
|
+
Mt,
|
|
161
|
+
z,
|
|
162
|
+
yt,
|
|
163
|
+
Nt,
|
|
164
|
+
St,
|
|
157
165
|
W,
|
|
158
166
|
{
|
|
159
|
-
replace:
|
|
167
|
+
replace: z,
|
|
160
168
|
with: (t) => new W(
|
|
161
169
|
t.getURL(),
|
|
162
170
|
{ rel: t.__rel, target: t.__target, title: t.__title },
|
|
163
171
|
t.getKey()
|
|
164
172
|
)
|
|
165
173
|
}
|
|
166
|
-
],
|
|
167
|
-
const [e, r] = b(!1), o =
|
|
174
|
+
], Ut = ve({ hasFocus: !1, editorRef: { current: null } }), Je = ({ onBlur: t }) => {
|
|
175
|
+
const [e, r] = b(!1), o = rt(null), i = v(() => {
|
|
168
176
|
r(!0), o.current && window.clearTimeout(o.current);
|
|
169
177
|
}, []), l = v(() => {
|
|
170
178
|
o.current = window.setTimeout(() => {
|
|
@@ -178,65 +186,65 @@ const Je = [
|
|
|
178
186
|
onBlur: l
|
|
179
187
|
}
|
|
180
188
|
};
|
|
181
|
-
},
|
|
182
|
-
function
|
|
189
|
+
}, at = () => Me(Ut);
|
|
190
|
+
function Xe(t) {
|
|
183
191
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 5h6a3.5 3.5 0 0 1 0 7h-6z" } }, { tag: "path", attr: { d: "M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7" } }] })(t);
|
|
184
192
|
}
|
|
185
|
-
function
|
|
193
|
+
function Qe(t) {
|
|
186
194
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 8l-4 4l4 4" } }, { tag: "path", attr: { d: "M17 8l4 4l-4 4" } }, { tag: "path", attr: { d: "M14 4l-4 16" } }] })(t);
|
|
187
195
|
}
|
|
188
|
-
function
|
|
196
|
+
function Ve(t) {
|
|
189
197
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 18v-8l-2 2" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
|
|
190
198
|
}
|
|
191
|
-
function
|
|
199
|
+
function Ze(t) {
|
|
192
200
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M17 12a2 2 0 1 1 4 0c0 .591 -.417 1.318 -.816 1.858l-3.184 4.143l4 0" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
|
|
193
201
|
}
|
|
194
|
-
function
|
|
202
|
+
function tr(t) {
|
|
195
203
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 14a2 2 0 1 0 -2 -2" } }, { tag: "path", attr: { d: "M17 16a2 2 0 1 0 2 -2" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
|
|
196
204
|
}
|
|
197
|
-
function
|
|
205
|
+
function er(t) {
|
|
198
206
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M20 18v-8l-4 6h5" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
|
|
199
207
|
}
|
|
200
|
-
function
|
|
208
|
+
function rr(t) {
|
|
201
209
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M17 18h2a2 2 0 1 0 0 -4h-2v-4h4" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
|
|
202
210
|
}
|
|
203
|
-
function
|
|
211
|
+
function nr(t) {
|
|
204
212
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 14a2 2 0 1 0 0 4a2 2 0 0 0 0 -4z" } }, { tag: "path", attr: { d: "M21 12a2 2 0 1 0 -4 0v4" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
|
|
205
213
|
}
|
|
206
|
-
function
|
|
214
|
+
function or(t) {
|
|
207
215
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M11 5l6 0" } }, { tag: "path", attr: { d: "M7 19l6 0" } }, { tag: "path", attr: { d: "M14 5l-4 14" } }] })(t);
|
|
208
216
|
}
|
|
209
|
-
function
|
|
217
|
+
function ir(t) {
|
|
210
218
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M17.5 15.5m-3.5 0a3.5 3.5 0 1 0 7 0a3.5 3.5 0 1 0 -7 0" } }, { tag: "path", attr: { d: "M3 19v-10.5a3.5 3.5 0 0 1 7 0v10.5" } }, { tag: "path", attr: { d: "M3 13h7" } }, { tag: "path", attr: { d: "M21 12v7" } }] })(t);
|
|
211
219
|
}
|
|
212
|
-
function
|
|
220
|
+
function ar(t) {
|
|
213
221
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5" } }, { tag: "path", attr: { d: "M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5" } }] })(t);
|
|
214
222
|
}
|
|
215
|
-
function
|
|
223
|
+
function lr(t) {
|
|
216
224
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M3.5 5.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M3.5 11.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M3.5 17.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M11 6l9 0" } }, { tag: "path", attr: { d: "M11 12l9 0" } }, { tag: "path", attr: { d: "M11 18l9 0" } }] })(t);
|
|
217
225
|
}
|
|
218
|
-
function
|
|
226
|
+
function sr(t) {
|
|
219
227
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M11 6h9" } }, { tag: "path", attr: { d: "M11 12h9" } }, { tag: "path", attr: { d: "M12 18h8" } }, { tag: "path", attr: { d: "M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4" } }, { tag: "path", attr: { d: "M6 10v-6l-2 2" } }] })(t);
|
|
220
228
|
}
|
|
221
|
-
function
|
|
229
|
+
function cr(t) {
|
|
222
230
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M9 6l11 0" } }, { tag: "path", attr: { d: "M9 12l11 0" } }, { tag: "path", attr: { d: "M9 18l11 0" } }, { tag: "path", attr: { d: "M5 6l0 .01" } }, { tag: "path", attr: { d: "M5 12l0 .01" } }, { tag: "path", attr: { d: "M5 18l0 .01" } }] })(t);
|
|
223
231
|
}
|
|
224
|
-
function
|
|
232
|
+
function dr(t) {
|
|
225
233
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M10 11h-4a1 1 0 0 1 -1 -1v-3a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v6c0 2.667 -1.333 4.333 -4 5" } }, { tag: "path", attr: { d: "M19 11h-4a1 1 0 0 1 -1 -1v-3a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v6c0 2.667 -1.333 4.333 -4 5" } }] })(t);
|
|
226
234
|
}
|
|
227
|
-
function
|
|
235
|
+
function ur(t) {
|
|
228
236
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M5 7l8 10m-8 0l8 -10" } }, { tag: "path", attr: { d: "M21 11h-4l3.5 -4a1.73 1.73 0 0 0 -3.5 -2" } }] })(t);
|
|
229
237
|
}
|
|
230
|
-
function
|
|
238
|
+
function hr(t) {
|
|
231
239
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z" } }, { tag: "path", attr: { d: "M4 10l16 0" } }, { tag: "path", attr: { d: "M10 4l0 16" } }] })(t);
|
|
232
240
|
}
|
|
233
|
-
function
|
|
241
|
+
function pr(t) {
|
|
234
242
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 5v5a5 5 0 0 0 10 0v-5" } }, { tag: "path", attr: { d: "M5 19h14" } }] })(t);
|
|
235
243
|
}
|
|
236
|
-
const
|
|
244
|
+
const gr = Et("div", {
|
|
237
245
|
width: "10rem",
|
|
238
246
|
display: "flex"
|
|
239
|
-
}),
|
|
247
|
+
}), Wt = {
|
|
240
248
|
bullet: "Punktliste",
|
|
241
249
|
h1: "Overskrift 1",
|
|
242
250
|
h2: "Overskrift 2",
|
|
@@ -248,22 +256,22 @@ const fr = Tt("div", {
|
|
|
248
256
|
paragraph: "Normal",
|
|
249
257
|
quote: "Sitat",
|
|
250
258
|
check: "Avkrysningsliste"
|
|
251
|
-
},
|
|
252
|
-
bullet: /* @__PURE__ */ n(
|
|
253
|
-
h1: /* @__PURE__ */ n(
|
|
254
|
-
h2: /* @__PURE__ */ n(
|
|
255
|
-
h3: /* @__PURE__ */ n(
|
|
256
|
-
h4: /* @__PURE__ */ n(
|
|
257
|
-
h5: /* @__PURE__ */ n(
|
|
258
|
-
h6: /* @__PURE__ */ n(
|
|
259
|
-
number: /* @__PURE__ */ n(
|
|
260
|
-
check: /* @__PURE__ */ n(
|
|
261
|
-
paragraph: /* @__PURE__ */ n(
|
|
262
|
-
quote: /* @__PURE__ */ n(
|
|
259
|
+
}, fr = {
|
|
260
|
+
bullet: /* @__PURE__ */ n(cr, { size: "1.25rem" }),
|
|
261
|
+
h1: /* @__PURE__ */ n(Ve, { size: "1.25rem" }),
|
|
262
|
+
h2: /* @__PURE__ */ n(Ze, { size: "1.25rem" }),
|
|
263
|
+
h3: /* @__PURE__ */ n(tr, { size: "1.25rem" }),
|
|
264
|
+
h4: /* @__PURE__ */ n(er, { size: "1.25rem" }),
|
|
265
|
+
h5: /* @__PURE__ */ n(rr, { size: "1.25rem" }),
|
|
266
|
+
h6: /* @__PURE__ */ n(nr, { size: "1.25rem" }),
|
|
267
|
+
number: /* @__PURE__ */ n(sr, { size: "1.25rem" }),
|
|
268
|
+
check: /* @__PURE__ */ n(lr, { size: "1.25rem" }),
|
|
269
|
+
paragraph: /* @__PURE__ */ n(ir, { size: "1.25rem" }),
|
|
270
|
+
quote: /* @__PURE__ */ n(dr, { size: "1.25rem" })
|
|
263
271
|
}, M = ({
|
|
264
272
|
blockType: t
|
|
265
273
|
}) => /* @__PURE__ */ g(Y, { children: [
|
|
266
|
-
/* @__PURE__ */ n(P, { css: { display: "flex", flex: "0 0 auto" }, children:
|
|
274
|
+
/* @__PURE__ */ n(P, { css: { display: "flex", flex: "0 0 auto" }, children: fr[t] }),
|
|
267
275
|
/* @__PURE__ */ n(
|
|
268
276
|
P,
|
|
269
277
|
{
|
|
@@ -273,40 +281,40 @@ const fr = Tt("div", {
|
|
|
273
281
|
textOverflow: "ellipsis",
|
|
274
282
|
whiteSpace: "nowrap"
|
|
275
283
|
},
|
|
276
|
-
children:
|
|
284
|
+
children: Wt[t]
|
|
277
285
|
}
|
|
278
286
|
)
|
|
279
|
-
] }),
|
|
287
|
+
] }), mr = (t) => {
|
|
280
288
|
if (!L(t))
|
|
281
289
|
return null;
|
|
282
290
|
const e = t.anchor.getNode();
|
|
283
|
-
let r = e.getKey() === "root" ? e :
|
|
291
|
+
let r = e.getKey() === "root" ? e : Pt(e, (o) => {
|
|
284
292
|
const i = o.getParent();
|
|
285
|
-
return i !== null &&
|
|
293
|
+
return i !== null && Zt(i);
|
|
286
294
|
});
|
|
287
295
|
return r === null && (r = e.getTopLevelElementOrThrow()), {
|
|
288
296
|
anchorNode: e,
|
|
289
297
|
element: r
|
|
290
298
|
};
|
|
291
|
-
},
|
|
299
|
+
}, kr = () => {
|
|
292
300
|
const [t] = y(), [e, r] = b("paragraph");
|
|
293
301
|
x(() => t.registerCommand(
|
|
294
302
|
F,
|
|
295
303
|
() => {
|
|
296
|
-
const c = T(), f =
|
|
304
|
+
const c = T(), f = mr(c);
|
|
297
305
|
if (!f)
|
|
298
306
|
return !1;
|
|
299
307
|
const { element: u, anchorNode: m } = f, w = u.getKey();
|
|
300
308
|
if (t.getElementByKey(w) !== null)
|
|
301
|
-
if (
|
|
309
|
+
if (et(u)) {
|
|
302
310
|
const k = Be(
|
|
303
311
|
m,
|
|
304
|
-
|
|
312
|
+
tt
|
|
305
313
|
), S = k ? k.getListType() : u.getListType();
|
|
306
314
|
r(S);
|
|
307
315
|
} else {
|
|
308
|
-
const k =
|
|
309
|
-
k in
|
|
316
|
+
const k = he(u) ? u.getTag() : u.getType();
|
|
317
|
+
k in Wt && r(k);
|
|
310
318
|
}
|
|
311
319
|
return !1;
|
|
312
320
|
},
|
|
@@ -315,14 +323,14 @@ const fr = Tt("div", {
|
|
|
315
323
|
const o = (c) => {
|
|
316
324
|
e !== c && t.update(() => {
|
|
317
325
|
const f = T();
|
|
318
|
-
L(f) && (J(f, () =>
|
|
326
|
+
L(f) && (J(f, () => pe(c)), r(c));
|
|
319
327
|
});
|
|
320
328
|
};
|
|
321
|
-
return /* @__PURE__ */ n(
|
|
322
|
-
|
|
329
|
+
return /* @__PURE__ */ n(gr, { children: /* @__PURE__ */ g(
|
|
330
|
+
nt,
|
|
323
331
|
{
|
|
324
332
|
trigger: /* @__PURE__ */ n(
|
|
325
|
-
|
|
333
|
+
_t,
|
|
326
334
|
{
|
|
327
335
|
dropdown: !0,
|
|
328
336
|
css: { display: "flex", width: "100%", overflow: "hidden" },
|
|
@@ -345,29 +353,29 @@ const fr = Tt("div", {
|
|
|
345
353
|
/* @__PURE__ */ n(C, { onClick: () => o("h5"), children: /* @__PURE__ */ n(M, { blockType: "h5" }) }),
|
|
346
354
|
/* @__PURE__ */ n(C, { onClick: () => o("h6"), children: /* @__PURE__ */ n(M, { blockType: "h6" }) }),
|
|
347
355
|
/* @__PURE__ */ n(C, { onClick: () => {
|
|
348
|
-
e !== "bullet" && (t.dispatchCommand(
|
|
356
|
+
e !== "bullet" && (t.dispatchCommand(ce, void 0), r("bullet"));
|
|
349
357
|
}, children: /* @__PURE__ */ n(M, { blockType: "bullet" }) }),
|
|
350
358
|
/* @__PURE__ */ n(C, { onClick: () => {
|
|
351
|
-
e !== "number" && (t.dispatchCommand(
|
|
359
|
+
e !== "number" && (t.dispatchCommand(de, void 0), r("number"));
|
|
352
360
|
}, children: /* @__PURE__ */ n(M, { blockType: "number" }) }),
|
|
353
361
|
/* @__PURE__ */ n(C, { onClick: () => {
|
|
354
|
-
e !== "check" && (t.dispatchCommand(
|
|
362
|
+
e !== "check" && (t.dispatchCommand(Tt, void 0), r("check"));
|
|
355
363
|
}, children: /* @__PURE__ */ n(M, { blockType: "check" }) }),
|
|
356
364
|
/* @__PURE__ */ n(C, { onClick: () => {
|
|
357
365
|
e !== "quote" && t.update(() => {
|
|
358
366
|
const c = T();
|
|
359
|
-
L(c) && (J(c, () =>
|
|
367
|
+
L(c) && (J(c, () => ge()), r("quote"));
|
|
360
368
|
});
|
|
361
369
|
}, children: /* @__PURE__ */ n(M, { blockType: "quote" }) })
|
|
362
370
|
]
|
|
363
371
|
}
|
|
364
372
|
) });
|
|
365
|
-
},
|
|
373
|
+
}, br = () => {
|
|
366
374
|
const [t] = y(), [e, r] = b(!1), [o, i] = b(!1), [l, a] = b(!1), [s, d] = b(!1), [c, f] = b(!1), u = v(() => {
|
|
367
375
|
const p = T();
|
|
368
376
|
L(p) && (r(p.hasFormat("bold")), i(p.hasFormat("italic")), a(p.hasFormat("underline")), d(p.hasFormat("code")), f(p.hasFormat("superscript")));
|
|
369
377
|
}, []);
|
|
370
|
-
x(() =>
|
|
378
|
+
x(() => it(
|
|
371
379
|
t.registerCommand(
|
|
372
380
|
F,
|
|
373
381
|
() => (u(), !1),
|
|
@@ -380,30 +388,30 @@ const fr = Tt("div", {
|
|
|
380
388
|
})
|
|
381
389
|
), [t, u]);
|
|
382
390
|
const m = v(
|
|
383
|
-
() => t.dispatchCommand(
|
|
391
|
+
() => t.dispatchCommand(D, "bold"),
|
|
384
392
|
[t]
|
|
385
393
|
), w = v(
|
|
386
|
-
() => t.dispatchCommand(
|
|
394
|
+
() => t.dispatchCommand(D, "italic"),
|
|
387
395
|
[t]
|
|
388
396
|
), N = v(
|
|
389
|
-
() => t.dispatchCommand(
|
|
397
|
+
() => t.dispatchCommand(D, "underline"),
|
|
390
398
|
[t]
|
|
391
399
|
), k = v(
|
|
392
|
-
() => t.dispatchCommand(
|
|
400
|
+
() => t.dispatchCommand(D, "code"),
|
|
393
401
|
[t]
|
|
394
402
|
), S = v(
|
|
395
|
-
() => t.dispatchCommand(
|
|
403
|
+
() => t.dispatchCommand(D, "superscript"),
|
|
396
404
|
[t]
|
|
397
|
-
),
|
|
405
|
+
), A = wt(() => {
|
|
398
406
|
const p = [];
|
|
399
407
|
return e && p.push("bold"), o && p.push("italic"), l && p.push("underline"), s && p.push("code"), c && p.push("superscript"), p;
|
|
400
408
|
}, [e, o, l, s, c]);
|
|
401
409
|
return /* @__PURE__ */ g(
|
|
402
|
-
|
|
410
|
+
Rt,
|
|
403
411
|
{
|
|
404
412
|
type: "multiple",
|
|
405
413
|
"aria-label": "Tekstformattering",
|
|
406
|
-
value:
|
|
414
|
+
value: A,
|
|
407
415
|
children: [
|
|
408
416
|
/* @__PURE__ */ n(
|
|
409
417
|
I,
|
|
@@ -411,7 +419,7 @@ const fr = Tt("div", {
|
|
|
411
419
|
onClick: m,
|
|
412
420
|
title: "Fet tekst",
|
|
413
421
|
value: "bold",
|
|
414
|
-
children: /* @__PURE__ */ n(
|
|
422
|
+
children: /* @__PURE__ */ n(Xe, { size: "1.25rem" })
|
|
415
423
|
}
|
|
416
424
|
),
|
|
417
425
|
/* @__PURE__ */ n(
|
|
@@ -420,7 +428,7 @@ const fr = Tt("div", {
|
|
|
420
428
|
onClick: w,
|
|
421
429
|
title: "Kursiv tekst",
|
|
422
430
|
value: "italic",
|
|
423
|
-
children: /* @__PURE__ */ n(
|
|
431
|
+
children: /* @__PURE__ */ n(or, { size: "1.25rem" })
|
|
424
432
|
}
|
|
425
433
|
),
|
|
426
434
|
/* @__PURE__ */ n(
|
|
@@ -429,7 +437,7 @@ const fr = Tt("div", {
|
|
|
429
437
|
onClick: N,
|
|
430
438
|
title: "Understreket tekst",
|
|
431
439
|
value: "underline",
|
|
432
|
-
children: /* @__PURE__ */ n(
|
|
440
|
+
children: /* @__PURE__ */ n(pr, { size: "1.25rem" })
|
|
433
441
|
}
|
|
434
442
|
),
|
|
435
443
|
/* @__PURE__ */ n(
|
|
@@ -438,7 +446,7 @@ const fr = Tt("div", {
|
|
|
438
446
|
onClick: k,
|
|
439
447
|
title: "Kode",
|
|
440
448
|
value: "code",
|
|
441
|
-
children: /* @__PURE__ */ n(
|
|
449
|
+
children: /* @__PURE__ */ n(Qe, { size: "1.25rem" })
|
|
442
450
|
}
|
|
443
451
|
),
|
|
444
452
|
/* @__PURE__ */ n(
|
|
@@ -447,20 +455,20 @@ const fr = Tt("div", {
|
|
|
447
455
|
onClick: S,
|
|
448
456
|
title: "Superscript",
|
|
449
457
|
value: "superscript",
|
|
450
|
-
children: /* @__PURE__ */ n(
|
|
458
|
+
children: /* @__PURE__ */ n(ur, { size: "1.25rem" })
|
|
451
459
|
}
|
|
452
460
|
)
|
|
453
461
|
]
|
|
454
462
|
}
|
|
455
463
|
);
|
|
456
|
-
},
|
|
457
|
-
const { hasFocus: e, editorRef: r } =
|
|
464
|
+
}, vr = ({ children: t }) => {
|
|
465
|
+
const { hasFocus: e, editorRef: r } = at(), o = e, [i, l] = b(o);
|
|
458
466
|
Ce(() => {
|
|
459
467
|
l(o);
|
|
460
468
|
}, [o]);
|
|
461
|
-
const { context: a, refs: s, floatingStyles: d } =
|
|
469
|
+
const { context: a, refs: s, floatingStyles: d } = ot({
|
|
462
470
|
placement: "top",
|
|
463
|
-
whileElementsMounted:
|
|
471
|
+
whileElementsMounted: It,
|
|
464
472
|
middleware: [
|
|
465
473
|
Te({
|
|
466
474
|
apply: ({ rects: f, elements: u }) => {
|
|
@@ -468,7 +476,7 @@ const fr = Tt("div", {
|
|
|
468
476
|
}
|
|
469
477
|
}),
|
|
470
478
|
Le(),
|
|
471
|
-
|
|
479
|
+
zt({
|
|
472
480
|
mainAxis: 8
|
|
473
481
|
}),
|
|
474
482
|
xe({
|
|
@@ -480,13 +488,13 @@ const fr = Tt("div", {
|
|
|
480
488
|
elements: {
|
|
481
489
|
reference: r.current
|
|
482
490
|
}
|
|
483
|
-
}), { getFloatingProps: c } =
|
|
484
|
-
|
|
491
|
+
}), { getFloatingProps: c } = Ot([
|
|
492
|
+
$t(a, {
|
|
485
493
|
role: "dialog"
|
|
486
494
|
})
|
|
487
495
|
]);
|
|
488
|
-
return i ? /* @__PURE__ */ n(
|
|
489
|
-
|
|
496
|
+
return i ? /* @__PURE__ */ n(At, { children: /* @__PURE__ */ n(
|
|
497
|
+
Dt,
|
|
490
498
|
{
|
|
491
499
|
ref: s.setFloating,
|
|
492
500
|
style: d,
|
|
@@ -497,38 +505,38 @@ const fr = Tt("div", {
|
|
|
497
505
|
overflow: "hidden",
|
|
498
506
|
boxShadow: "$md"
|
|
499
507
|
},
|
|
500
|
-
children: /* @__PURE__ */ n(
|
|
508
|
+
children: /* @__PURE__ */ n(Mr, { children: t })
|
|
501
509
|
}
|
|
502
510
|
) }) : null;
|
|
503
|
-
},
|
|
511
|
+
}, Mr = ({
|
|
504
512
|
children: t,
|
|
505
513
|
...e
|
|
506
514
|
}) => /* @__PURE__ */ g(ye, { "aria-label": "Formattering", ...e, children: [
|
|
507
|
-
/* @__PURE__ */ n(
|
|
515
|
+
/* @__PURE__ */ n(kr, {}),
|
|
508
516
|
/* @__PURE__ */ n(Ne, {}),
|
|
509
|
-
/* @__PURE__ */ n(
|
|
517
|
+
/* @__PURE__ */ n(br, {}),
|
|
510
518
|
t
|
|
511
519
|
] });
|
|
512
|
-
function
|
|
520
|
+
function Cr() {
|
|
513
521
|
const [t] = y();
|
|
514
|
-
return x(() =>
|
|
522
|
+
return x(() => it(
|
|
515
523
|
t.registerCommand(
|
|
516
|
-
|
|
517
|
-
() => (
|
|
524
|
+
Tt,
|
|
525
|
+
() => (ue(t, "check"), !0),
|
|
518
526
|
E
|
|
519
527
|
),
|
|
520
528
|
t.registerCommand(
|
|
521
|
-
|
|
522
|
-
(e) =>
|
|
529
|
+
te,
|
|
530
|
+
(e) => kt(e, t, !1),
|
|
523
531
|
E
|
|
524
532
|
),
|
|
525
533
|
t.registerCommand(
|
|
526
|
-
|
|
527
|
-
(e) =>
|
|
534
|
+
ee,
|
|
535
|
+
(e) => kt(e, t, !0),
|
|
528
536
|
E
|
|
529
537
|
),
|
|
530
538
|
t.registerCommand(
|
|
531
|
-
|
|
539
|
+
vt,
|
|
532
540
|
(e) => {
|
|
533
541
|
if (X() != null) {
|
|
534
542
|
const o = t.getRootElement();
|
|
@@ -539,30 +547,30 @@ function Tr() {
|
|
|
539
547
|
E
|
|
540
548
|
),
|
|
541
549
|
t.registerCommand(
|
|
542
|
-
|
|
550
|
+
re,
|
|
543
551
|
(e) => {
|
|
544
552
|
const r = X();
|
|
545
553
|
return r != null && t.isEditable() ? (t.update(() => {
|
|
546
554
|
const o = V(r);
|
|
547
|
-
|
|
555
|
+
O(o) && (e.preventDefault(), o.toggleChecked());
|
|
548
556
|
}), !0) : !1;
|
|
549
557
|
},
|
|
550
558
|
E
|
|
551
559
|
),
|
|
552
560
|
t.registerCommand(
|
|
553
|
-
|
|
561
|
+
ne,
|
|
554
562
|
(e) => t.getEditorState().read(() => {
|
|
555
563
|
const r = T();
|
|
556
564
|
if (L(r) && r.isCollapsed()) {
|
|
557
565
|
const { anchor: o } = r, i = o.type === "element";
|
|
558
566
|
if (i || o.offset === 0) {
|
|
559
|
-
const l = o.getNode(), a =
|
|
567
|
+
const l = o.getNode(), a = Pt(
|
|
560
568
|
l,
|
|
561
|
-
(s) =>
|
|
569
|
+
(s) => oe(s) && !s.isInline()
|
|
562
570
|
);
|
|
563
|
-
if (
|
|
571
|
+
if (O(a)) {
|
|
564
572
|
const s = a.getParent();
|
|
565
|
-
if (
|
|
573
|
+
if (et(s) && s.getListType() === "check" && (i || a.getFirstDescendant() === l)) {
|
|
566
574
|
const d = t.getElementByKey(a.__key);
|
|
567
575
|
if (d != null && document.activeElement !== d)
|
|
568
576
|
return d.focus(), e.preventDefault(), !0;
|
|
@@ -575,16 +583,16 @@ function Tr() {
|
|
|
575
583
|
E
|
|
576
584
|
),
|
|
577
585
|
t.registerRootListener((e, r) => {
|
|
578
|
-
e !== null && (e.addEventListener("click",
|
|
586
|
+
e !== null && (e.addEventListener("click", ft), e.addEventListener("pointerdown", mt)), r !== null && (r.removeEventListener("click", ft), r.removeEventListener("pointerdown", mt));
|
|
579
587
|
})
|
|
580
588
|
), [t]), null;
|
|
581
589
|
}
|
|
582
|
-
function
|
|
590
|
+
function jt(t, e) {
|
|
583
591
|
const r = t.target;
|
|
584
|
-
if (r === null || !
|
|
592
|
+
if (r === null || !gt(r))
|
|
585
593
|
return;
|
|
586
594
|
const o = r.firstChild;
|
|
587
|
-
if (o != null &&
|
|
595
|
+
if (o != null && gt(o) && (o.tagName === "UL" || o.tagName === "OL"))
|
|
588
596
|
return;
|
|
589
597
|
const i = r.parentNode;
|
|
590
598
|
if (!i || i.__lexicalListType !== "check")
|
|
@@ -592,23 +600,23 @@ function Dt(t, e) {
|
|
|
592
600
|
const l = t.pageX, a = r.getBoundingClientRect();
|
|
593
601
|
(r.dir === "rtl" ? l < a.right && l > a.right - 20 : l > a.left && l < a.left + 20) && e();
|
|
594
602
|
}
|
|
595
|
-
function
|
|
596
|
-
|
|
597
|
-
const e = t.target, r =
|
|
603
|
+
function ft(t) {
|
|
604
|
+
jt(t, () => {
|
|
605
|
+
const e = t.target, r = Tr(e);
|
|
598
606
|
r != null && r.isEditable() && r.update(() => {
|
|
599
607
|
if (t.target) {
|
|
600
608
|
const o = V(e);
|
|
601
|
-
|
|
609
|
+
O(o) && (e.focus(), o.toggleChecked());
|
|
602
610
|
}
|
|
603
611
|
});
|
|
604
612
|
});
|
|
605
613
|
}
|
|
606
|
-
function
|
|
607
|
-
|
|
614
|
+
function mt(t) {
|
|
615
|
+
jt(t, () => {
|
|
608
616
|
t.preventDefault();
|
|
609
617
|
});
|
|
610
618
|
}
|
|
611
|
-
function
|
|
619
|
+
function Tr(t) {
|
|
612
620
|
let e = t;
|
|
613
621
|
for (; e; ) {
|
|
614
622
|
if (e.__lexicalEditor)
|
|
@@ -622,25 +630,25 @@ function X() {
|
|
|
622
630
|
return t != null && t.tagName === "LI" && t.parentNode != null && // @ts-ignore internal field
|
|
623
631
|
t.parentNode.__lexicalListType === "check" ? t : null;
|
|
624
632
|
}
|
|
625
|
-
function
|
|
633
|
+
function Lr(t, e) {
|
|
626
634
|
let r = e ? t.getPreviousSibling() : t.getNextSibling(), o = t;
|
|
627
|
-
for (; r == null &&
|
|
635
|
+
for (; r == null && O(o); )
|
|
628
636
|
o = o.getParentOrThrow().getParent(), o != null && (r = e ? o.getPreviousSibling() : o.getNextSibling());
|
|
629
|
-
for (;
|
|
637
|
+
for (; O(r); ) {
|
|
630
638
|
const i = e ? r.getLastChild() : r.getFirstChild();
|
|
631
|
-
if (!
|
|
639
|
+
if (!et(i))
|
|
632
640
|
return r;
|
|
633
641
|
r = e ? i.getLastChild() : i.getFirstChild();
|
|
634
642
|
}
|
|
635
643
|
return null;
|
|
636
644
|
}
|
|
637
|
-
function
|
|
645
|
+
function kt(t, e, r) {
|
|
638
646
|
const o = X();
|
|
639
647
|
return o != null && e.update(() => {
|
|
640
648
|
const i = V(o);
|
|
641
|
-
if (!
|
|
649
|
+
if (!O(i))
|
|
642
650
|
return;
|
|
643
|
-
const l =
|
|
651
|
+
const l = Lr(i, r);
|
|
644
652
|
if (l != null) {
|
|
645
653
|
l.selectStart();
|
|
646
654
|
const a = e.getElementByKey(l.__key);
|
|
@@ -650,13 +658,13 @@ function mt(t, e, r) {
|
|
|
650
658
|
}
|
|
651
659
|
}), !1;
|
|
652
660
|
}
|
|
653
|
-
const
|
|
661
|
+
const xr = () => /* @__PURE__ */ g(Y, { children: [
|
|
654
662
|
/* @__PURE__ */ n(Fe, {}),
|
|
655
663
|
/* @__PURE__ */ n(Ue, {}),
|
|
656
664
|
/* @__PURE__ */ n(He, {}),
|
|
657
|
-
/* @__PURE__ */ n(
|
|
665
|
+
/* @__PURE__ */ n(Cr, {}),
|
|
658
666
|
/* @__PURE__ */ n(We, {})
|
|
659
|
-
] }),
|
|
667
|
+
] }), yr = ({
|
|
660
668
|
state: t
|
|
661
669
|
}) => {
|
|
662
670
|
const [e] = y();
|
|
@@ -667,7 +675,7 @@ const yr = () => /* @__PURE__ */ g(Y, { children: [
|
|
|
667
675
|
t.isEmpty() ? Ye(e) : e.setEditorState(t);
|
|
668
676
|
return;
|
|
669
677
|
}
|
|
670
|
-
if (typeof t == "string" && !
|
|
678
|
+
if (typeof t == "string" && !Ht(t)) {
|
|
671
679
|
Ge(t, e);
|
|
672
680
|
return;
|
|
673
681
|
}
|
|
@@ -677,7 +685,7 @@ const yr = () => /* @__PURE__ */ g(Y, { children: [
|
|
|
677
685
|
console.error("Could not parse"), console.error(r);
|
|
678
686
|
}
|
|
679
687
|
}, []), null;
|
|
680
|
-
},
|
|
688
|
+
}, Nr = Et("div", {
|
|
681
689
|
border: "1px solid $borderDarker",
|
|
682
690
|
borderRadius: "$md",
|
|
683
691
|
position: "relative",
|
|
@@ -714,7 +722,7 @@ const yr = () => /* @__PURE__ */ g(Y, { children: [
|
|
|
714
722
|
}
|
|
715
723
|
}
|
|
716
724
|
]
|
|
717
|
-
}),
|
|
725
|
+
}), Sr = ({
|
|
718
726
|
isLoading: t
|
|
719
727
|
}) => /* @__PURE__ */ n(
|
|
720
728
|
P,
|
|
@@ -742,8 +750,8 @@ const yr = () => /* @__PURE__ */ g(Y, { children: [
|
|
|
742
750
|
defaultState: f,
|
|
743
751
|
css: u
|
|
744
752
|
}) => {
|
|
745
|
-
const { hasFocus: m, attributes: w } =
|
|
746
|
-
return /* @__PURE__ */ n(
|
|
753
|
+
const { hasFocus: m, attributes: w } = Je({ onBlur: c }), N = rt(null), k = wt(() => ({ hasFocus: m, editorRef: N }), [m]);
|
|
754
|
+
return /* @__PURE__ */ n(Ut.Provider, { value: k, children: /* @__PURE__ */ g(
|
|
747
755
|
$e,
|
|
748
756
|
{
|
|
749
757
|
initialConfig: {
|
|
@@ -751,13 +759,13 @@ const yr = () => /* @__PURE__ */ g(Y, { children: [
|
|
|
751
759
|
onError: (S) => {
|
|
752
760
|
console.error(S);
|
|
753
761
|
},
|
|
754
|
-
theme:
|
|
762
|
+
theme: Ft,
|
|
755
763
|
nodes: o,
|
|
756
764
|
editable: !0
|
|
757
765
|
},
|
|
758
766
|
children: [
|
|
759
767
|
/* @__PURE__ */ g(
|
|
760
|
-
|
|
768
|
+
Nr,
|
|
761
769
|
{
|
|
762
770
|
ref: N,
|
|
763
771
|
hasFocus: m,
|
|
@@ -787,19 +795,19 @@ const yr = () => /* @__PURE__ */ g(Y, { children: [
|
|
|
787
795
|
ErrorBoundary: De
|
|
788
796
|
}
|
|
789
797
|
),
|
|
790
|
-
/* @__PURE__ */ n(
|
|
798
|
+
/* @__PURE__ */ n(xr, {}),
|
|
791
799
|
i,
|
|
792
|
-
/* @__PURE__ */ n(
|
|
793
|
-
!l && /* @__PURE__ */ n(
|
|
800
|
+
/* @__PURE__ */ n(Sr, { isLoading: t }),
|
|
801
|
+
!l && /* @__PURE__ */ n(vr, { children: a })
|
|
794
802
|
]
|
|
795
803
|
}
|
|
796
804
|
),
|
|
797
|
-
/* @__PURE__ */ n(
|
|
805
|
+
/* @__PURE__ */ n(yr, { state: f }),
|
|
798
806
|
/* @__PURE__ */ n(Y, { children: e })
|
|
799
807
|
]
|
|
800
808
|
}
|
|
801
809
|
) });
|
|
802
|
-
},
|
|
810
|
+
}, wr = {
|
|
803
811
|
fontSize: "1rem",
|
|
804
812
|
lineHeight: "1.5",
|
|
805
813
|
"h1, h2, h3, h4, h5, h6": {
|
|
@@ -989,7 +997,7 @@ const yr = () => /* @__PURE__ */ g(Y, { children: [
|
|
|
989
997
|
defaultVariants: {
|
|
990
998
|
size: "md"
|
|
991
999
|
}
|
|
992
|
-
}, pn = we(
|
|
1000
|
+
}, pn = we(wr), gn = () => {
|
|
993
1001
|
const [t] = y(), e = v(() => {
|
|
994
1002
|
t.dispatchCommand(fe, {
|
|
995
1003
|
rows: "3",
|
|
@@ -998,33 +1006,33 @@ const yr = () => /* @__PURE__ */ g(Y, { children: [
|
|
|
998
1006
|
});
|
|
999
1007
|
}, [t]);
|
|
1000
1008
|
return /* @__PURE__ */ n(
|
|
1001
|
-
|
|
1009
|
+
nt,
|
|
1002
1010
|
{
|
|
1003
|
-
trigger: /* @__PURE__ */ n(
|
|
1011
|
+
trigger: /* @__PURE__ */ n(_t, { dropdown: !0, children: "Sett inn" }),
|
|
1004
1012
|
side: "bottom",
|
|
1005
1013
|
align: "end",
|
|
1006
1014
|
children: /* @__PURE__ */ g(C, { onClick: e, children: [
|
|
1007
|
-
/* @__PURE__ */ n(
|
|
1015
|
+
/* @__PURE__ */ n(hr, { size: "1.25rem" }),
|
|
1008
1016
|
" Tabell"
|
|
1009
1017
|
] })
|
|
1010
1018
|
}
|
|
1011
1019
|
);
|
|
1012
1020
|
};
|
|
1013
|
-
function
|
|
1021
|
+
function Er(t) {
|
|
1014
1022
|
return h({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "circle", attr: { cx: "256", cy: "256", r: "48" } }, { tag: "circle", attr: { cx: "416", cy: "256", r: "48" } }, { tag: "circle", attr: { cx: "96", cy: "256", r: "48" } }] })(t);
|
|
1015
1023
|
}
|
|
1016
1024
|
const fn = () => {
|
|
1017
|
-
const [t] = y(), [e, r] = b(null), { hasFocus: o } =
|
|
1025
|
+
const [t] = y(), [e, r] = b(null), { hasFocus: o } = at();
|
|
1018
1026
|
x(() => {
|
|
1019
1027
|
!o && e && r(null);
|
|
1020
1028
|
}, [o, e]);
|
|
1021
|
-
const { refs: i, floatingStyles: l } =
|
|
1029
|
+
const { refs: i, floatingStyles: l } = ot({
|
|
1022
1030
|
placement: "top-end",
|
|
1023
1031
|
open: !!e,
|
|
1024
1032
|
elements: {
|
|
1025
1033
|
reference: e
|
|
1026
1034
|
},
|
|
1027
|
-
middleware: [
|
|
1035
|
+
middleware: [zt({ mainAxis: -20, crossAxis: -2 })]
|
|
1028
1036
|
});
|
|
1029
1037
|
x(() => t.registerCommand(
|
|
1030
1038
|
F,
|
|
@@ -1036,22 +1044,22 @@ const fn = () => {
|
|
|
1036
1044
|
}
|
|
1037
1045
|
return !1;
|
|
1038
1046
|
},
|
|
1039
|
-
|
|
1047
|
+
ie
|
|
1040
1048
|
), [t]);
|
|
1041
1049
|
const a = (s) => () => {
|
|
1042
1050
|
t.update(() => {
|
|
1043
1051
|
switch (s) {
|
|
1044
1052
|
case "add-row-over":
|
|
1045
|
-
|
|
1053
|
+
ut(!1);
|
|
1046
1054
|
break;
|
|
1047
1055
|
case "add-row-under":
|
|
1048
|
-
|
|
1056
|
+
ut(!0);
|
|
1049
1057
|
break;
|
|
1050
1058
|
case "add-column-left":
|
|
1051
|
-
|
|
1059
|
+
dt(!1);
|
|
1052
1060
|
break;
|
|
1053
1061
|
case "add-column-right":
|
|
1054
|
-
|
|
1062
|
+
dt(!0);
|
|
1055
1063
|
break;
|
|
1056
1064
|
case "delete-row":
|
|
1057
1065
|
be();
|
|
@@ -1063,10 +1071,10 @@ const fn = () => {
|
|
|
1063
1071
|
});
|
|
1064
1072
|
};
|
|
1065
1073
|
return e ? /* @__PURE__ */ g(
|
|
1066
|
-
|
|
1074
|
+
nt,
|
|
1067
1075
|
{
|
|
1068
1076
|
trigger: /* @__PURE__ */ n(
|
|
1069
|
-
|
|
1077
|
+
$,
|
|
1070
1078
|
{
|
|
1071
1079
|
icon: !0,
|
|
1072
1080
|
variant: "primary",
|
|
@@ -1074,32 +1082,32 @@ const fn = () => {
|
|
|
1074
1082
|
ref: i.setFloating,
|
|
1075
1083
|
style: l,
|
|
1076
1084
|
css: { padding: "2px", width: "18px", height: "18px" },
|
|
1077
|
-
children: /* @__PURE__ */ n(
|
|
1085
|
+
children: /* @__PURE__ */ n(Er, {})
|
|
1078
1086
|
}
|
|
1079
1087
|
),
|
|
1080
1088
|
children: [
|
|
1081
1089
|
/* @__PURE__ */ n(R, { onClick: a("add-row-over"), children: "Legg til rad over" }),
|
|
1082
1090
|
/* @__PURE__ */ n(R, { onClick: a("add-row-under"), children: "Legg til rad under" }),
|
|
1083
|
-
/* @__PURE__ */ n(
|
|
1091
|
+
/* @__PURE__ */ n(ht, {}),
|
|
1084
1092
|
/* @__PURE__ */ n(R, { onClick: a("add-column-left"), children: "Legg til kolonne venstre" }),
|
|
1085
1093
|
/* @__PURE__ */ n(R, { onClick: a("add-column-right"), children: "Legg til kolonne høyre" }),
|
|
1086
|
-
/* @__PURE__ */ n(
|
|
1094
|
+
/* @__PURE__ */ n(ht, {}),
|
|
1087
1095
|
/* @__PURE__ */ n(R, { onClick: a("delete-row"), children: "Fjern rad" }),
|
|
1088
1096
|
/* @__PURE__ */ n(R, { onClick: a("delete-column"), children: "Fjern kolonne" })
|
|
1089
1097
|
]
|
|
1090
1098
|
}
|
|
1091
1099
|
) : null;
|
|
1092
1100
|
};
|
|
1093
|
-
function
|
|
1101
|
+
function Kt(t) {
|
|
1094
1102
|
let e = t;
|
|
1095
1103
|
const r = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi, o = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
|
|
1096
1104
|
return e = String(e).trim(), e.match(r) || e.match(o) ? e : "https://";
|
|
1097
1105
|
}
|
|
1098
|
-
function
|
|
1106
|
+
function qt(t) {
|
|
1099
1107
|
const e = t.anchor, r = t.focus, o = t.anchor.getNode(), i = t.focus.getNode();
|
|
1100
|
-
return o === i ? o : t.isBackward() ?
|
|
1108
|
+
return o === i ? o : t.isBackward() ? ct(r) ? o : i : ct(e) ? o : i;
|
|
1101
1109
|
}
|
|
1102
|
-
const mn = (t) => (_.baseURL = t, _), j = class extends
|
|
1110
|
+
const mn = (t) => (_.baseURL = t, _), j = class extends z {
|
|
1103
1111
|
static getType() {
|
|
1104
1112
|
return "rutine_link";
|
|
1105
1113
|
}
|
|
@@ -1111,7 +1119,7 @@ const mn = (t) => (_.baseURL = t, _), j = class extends B {
|
|
|
1111
1119
|
return r.setAttribute("href", this.getURL()), r.setAttribute("target", "_blank"), r.setAttribute("rel", "noopener noreferrer"), r.classList.add("rutine-link"), r;
|
|
1112
1120
|
}
|
|
1113
1121
|
static importJSON(e) {
|
|
1114
|
-
return
|
|
1122
|
+
return Yt(e.url);
|
|
1115
1123
|
}
|
|
1116
1124
|
exportJSON() {
|
|
1117
1125
|
return {
|
|
@@ -1130,14 +1138,14 @@ const mn = (t) => (_.baseURL = t, _), j = class extends B {
|
|
|
1130
1138
|
}
|
|
1131
1139
|
};
|
|
1132
1140
|
let _ = j;
|
|
1133
|
-
|
|
1134
|
-
function
|
|
1141
|
+
st(_, "baseURL", "");
|
|
1142
|
+
function Yt(t) {
|
|
1135
1143
|
return new _(t);
|
|
1136
1144
|
}
|
|
1137
|
-
function
|
|
1145
|
+
function _r(t) {
|
|
1138
1146
|
return t instanceof _;
|
|
1139
1147
|
}
|
|
1140
|
-
const
|
|
1148
|
+
const Rr = ({ onClose: t }) => {
|
|
1141
1149
|
const [e] = y(), r = v(
|
|
1142
1150
|
(i) => {
|
|
1143
1151
|
e.update(() => {
|
|
@@ -1146,10 +1154,10 @@ const Ir = ({ onClose: t }) => {
|
|
|
1146
1154
|
const a = l.getNodes();
|
|
1147
1155
|
if (a.length === 1) {
|
|
1148
1156
|
const s = a[0];
|
|
1149
|
-
|
|
1157
|
+
ae(s) && s.getChildren().length === 0 && l.insertText(i);
|
|
1150
1158
|
}
|
|
1151
1159
|
}
|
|
1152
|
-
}), e.dispatchCommand(Z,
|
|
1160
|
+
}), e.dispatchCommand(Z, Kt(i));
|
|
1153
1161
|
},
|
|
1154
1162
|
[e]
|
|
1155
1163
|
);
|
|
@@ -1157,12 +1165,12 @@ const Ir = ({ onClose: t }) => {
|
|
|
1157
1165
|
r(i.target.url.value), t();
|
|
1158
1166
|
}, children: [
|
|
1159
1167
|
/* @__PURE__ */ n(Re, { name: "url", label: "URL", type: "url", required: !0 }),
|
|
1160
|
-
/* @__PURE__ */ g(
|
|
1161
|
-
/* @__PURE__ */ n(
|
|
1162
|
-
/* @__PURE__ */ n(
|
|
1168
|
+
/* @__PURE__ */ g(Bt, { children: [
|
|
1169
|
+
/* @__PURE__ */ n($, { onClick: t, children: "Avbryt" }),
|
|
1170
|
+
/* @__PURE__ */ n($, { type: "submit", variant: "primary", children: "Lagre" })
|
|
1163
1171
|
] })
|
|
1164
1172
|
] });
|
|
1165
|
-
},
|
|
1173
|
+
}, Ir = ({ onClose: t, getDocs: e }) => {
|
|
1166
1174
|
const [r] = y(), [o, i] = b([]), l = e(), a = v(
|
|
1167
1175
|
(s) => {
|
|
1168
1176
|
r.update(() => {
|
|
@@ -1170,8 +1178,8 @@ const Ir = ({ onClose: t }) => {
|
|
|
1170
1178
|
if (L(d)) {
|
|
1171
1179
|
const c = [];
|
|
1172
1180
|
for (const [f, u] of s.entries()) {
|
|
1173
|
-
const m =
|
|
1174
|
-
m.append(
|
|
1181
|
+
const m = Yt(u.value);
|
|
1182
|
+
m.append(B(u.label)), c.push(m), f !== s.length - 1 && c.push(B(" "));
|
|
1175
1183
|
}
|
|
1176
1184
|
d.insertNodes(c);
|
|
1177
1185
|
}
|
|
@@ -1181,10 +1189,10 @@ const Ir = ({ onClose: t }) => {
|
|
|
1181
1189
|
);
|
|
1182
1190
|
return /* @__PURE__ */ g(Y, { children: [
|
|
1183
1191
|
/* @__PURE__ */ n(Ie, { isMulti: !0, options: l, onChange: i }),
|
|
1184
|
-
/* @__PURE__ */ g(
|
|
1185
|
-
/* @__PURE__ */ n(
|
|
1192
|
+
/* @__PURE__ */ g(Bt, { children: [
|
|
1193
|
+
/* @__PURE__ */ n($, { onClick: t, children: "Avbryt" }),
|
|
1186
1194
|
/* @__PURE__ */ n(
|
|
1187
|
-
|
|
1195
|
+
$,
|
|
1188
1196
|
{
|
|
1189
1197
|
variant: "primary",
|
|
1190
1198
|
onClick: () => {
|
|
@@ -1195,7 +1203,7 @@ const Ir = ({ onClose: t }) => {
|
|
|
1195
1203
|
)
|
|
1196
1204
|
] })
|
|
1197
1205
|
] });
|
|
1198
|
-
},
|
|
1206
|
+
}, zr = ({
|
|
1199
1207
|
open: t,
|
|
1200
1208
|
onOpenChange: e,
|
|
1201
1209
|
getDocs: r
|
|
@@ -1205,17 +1213,17 @@ const Ir = ({ onClose: t }) => {
|
|
|
1205
1213
|
};
|
|
1206
1214
|
return /* @__PURE__ */ g(Ee, { open: t, onOpenChange: e, css: { width: "600px" }, children: [
|
|
1207
1215
|
/* @__PURE__ */ g(_e, { css: { marginBottom: "$8" }, children: [
|
|
1208
|
-
/* @__PURE__ */ n(
|
|
1209
|
-
/* @__PURE__ */ n(
|
|
1216
|
+
/* @__PURE__ */ n(pt, { active: o === "url", onClick: () => i("url"), children: "URL" }),
|
|
1217
|
+
/* @__PURE__ */ n(pt, { active: o === "rutine", onClick: () => i("rutine"), children: "Rutine" })
|
|
1210
1218
|
] }),
|
|
1211
|
-
o === "url" && /* @__PURE__ */ n(
|
|
1212
|
-
o === "rutine" && /* @__PURE__ */ n(
|
|
1219
|
+
o === "url" && /* @__PURE__ */ n(Rr, { onClose: l }),
|
|
1220
|
+
o === "rutine" && /* @__PURE__ */ n(Ir, { onClose: l, getDocs: r })
|
|
1213
1221
|
] });
|
|
1214
1222
|
}, kn = ({ getDocs: t }) => {
|
|
1215
1223
|
const [e] = y(), [r, o] = b(!1), [i, l] = b(!1), a = v(() => {
|
|
1216
1224
|
const s = T();
|
|
1217
1225
|
if (L(s)) {
|
|
1218
|
-
const d =
|
|
1226
|
+
const d = qt(s), c = d.getParent();
|
|
1219
1227
|
o(U(c) || U(d));
|
|
1220
1228
|
}
|
|
1221
1229
|
}, []);
|
|
@@ -1223,7 +1231,7 @@ const Ir = ({ onClose: t }) => {
|
|
|
1223
1231
|
F,
|
|
1224
1232
|
() => (a(), !1),
|
|
1225
1233
|
Q
|
|
1226
|
-
), [e, a]), /* @__PURE__ */ g(
|
|
1234
|
+
), [e, a]), /* @__PURE__ */ g(Rt, { type: "single", value: r ? "link" : "", children: [
|
|
1227
1235
|
/* @__PURE__ */ n(
|
|
1228
1236
|
I,
|
|
1229
1237
|
{
|
|
@@ -1232,11 +1240,11 @@ const Ir = ({ onClose: t }) => {
|
|
|
1232
1240
|
},
|
|
1233
1241
|
title: "Lenke",
|
|
1234
1242
|
value: "link",
|
|
1235
|
-
children: /* @__PURE__ */ n(
|
|
1243
|
+
children: /* @__PURE__ */ n(ar, { size: "1.25rem" })
|
|
1236
1244
|
}
|
|
1237
1245
|
),
|
|
1238
1246
|
/* @__PURE__ */ n(
|
|
1239
|
-
|
|
1247
|
+
zr,
|
|
1240
1248
|
{
|
|
1241
1249
|
open: i,
|
|
1242
1250
|
onOpenChange: l,
|
|
@@ -1245,38 +1253,38 @@ const Ir = ({ onClose: t }) => {
|
|
|
1245
1253
|
)
|
|
1246
1254
|
] });
|
|
1247
1255
|
}, bn = () => {
|
|
1248
|
-
const [t] = y(), e =
|
|
1256
|
+
const [t] = y(), e = rt(null), [r, o] = b(null), [i, l] = b(""), { hasFocus: a } = at();
|
|
1249
1257
|
x(() => {
|
|
1250
1258
|
r ? t.update(() => {
|
|
1251
1259
|
l(r.getURL());
|
|
1252
1260
|
}) : l("");
|
|
1253
1261
|
}, [t, r]);
|
|
1254
|
-
const s = !!(r && i && a), { refs: d, floatingStyles: c, context: f } =
|
|
1262
|
+
const s = !!(r && i && a), { refs: d, floatingStyles: c, context: f } = ot({
|
|
1255
1263
|
placement: "top",
|
|
1256
1264
|
strategy: "fixed",
|
|
1257
1265
|
open: s,
|
|
1258
|
-
whileElementsMounted:
|
|
1266
|
+
whileElementsMounted: It,
|
|
1259
1267
|
elements: {
|
|
1260
1268
|
reference: e.current
|
|
1261
1269
|
},
|
|
1262
1270
|
middleware: [ze()]
|
|
1263
|
-
}), { getFloatingProps: u } =
|
|
1264
|
-
|
|
1271
|
+
}), { getFloatingProps: u } = Ot([
|
|
1272
|
+
$t(f),
|
|
1265
1273
|
Oe(f)
|
|
1266
1274
|
]), m = v(() => {
|
|
1267
1275
|
var S;
|
|
1268
1276
|
const k = T();
|
|
1269
1277
|
if (L(k)) {
|
|
1270
|
-
const
|
|
1278
|
+
const A = qt(k), p = A.getParent();
|
|
1271
1279
|
let H = null;
|
|
1272
|
-
if (U(p) ? H = p : U(
|
|
1273
|
-
const G = window.getSelection(),
|
|
1274
|
-
k !== null && G !== null &&
|
|
1280
|
+
if (U(p) ? H = p : U(A) && (H = A), H) {
|
|
1281
|
+
const G = window.getSelection(), lt = t.getRootElement();
|
|
1282
|
+
k !== null && G !== null && lt !== null && lt.contains(G.anchorNode) && t.isEditable() && (e.current = ((S = G.focusNode) == null ? void 0 : S.parentElement) ?? null);
|
|
1275
1283
|
}
|
|
1276
1284
|
o(H);
|
|
1277
1285
|
}
|
|
1278
1286
|
}, [t]), w = v(() => {
|
|
1279
|
-
r &&
|
|
1287
|
+
r && _r(r) && t.update(() => {
|
|
1280
1288
|
r.remove();
|
|
1281
1289
|
}), t.dispatchCommand(Z, null);
|
|
1282
1290
|
}, [t, r]);
|
|
@@ -1284,7 +1292,7 @@ const Ir = ({ onClose: t }) => {
|
|
|
1284
1292
|
t.getEditorState().read(() => {
|
|
1285
1293
|
m();
|
|
1286
1294
|
});
|
|
1287
|
-
}, [t, m]), x(() =>
|
|
1295
|
+
}, [t, m]), x(() => it(
|
|
1288
1296
|
t.registerUpdateListener(({ editorState: k }) => {
|
|
1289
1297
|
k.read(() => {
|
|
1290
1298
|
m();
|
|
@@ -1296,15 +1304,15 @@ const Ir = ({ onClose: t }) => {
|
|
|
1296
1304
|
E
|
|
1297
1305
|
),
|
|
1298
1306
|
t.registerCommand(
|
|
1299
|
-
|
|
1307
|
+
vt,
|
|
1300
1308
|
() => r ? (o(null), !0) : !1,
|
|
1301
|
-
|
|
1309
|
+
le
|
|
1302
1310
|
)
|
|
1303
1311
|
), [t, m, r]), !s)
|
|
1304
1312
|
return null;
|
|
1305
|
-
const N =
|
|
1306
|
-
return /* @__PURE__ */ n(
|
|
1307
|
-
|
|
1313
|
+
const N = Kt(i);
|
|
1314
|
+
return /* @__PURE__ */ n(At, { children: /* @__PURE__ */ g(
|
|
1315
|
+
Dt,
|
|
1308
1316
|
{
|
|
1309
1317
|
ref: d.setFloating,
|
|
1310
1318
|
css: {
|
|
@@ -1335,33 +1343,34 @@ const Ir = ({ onClose: t }) => {
|
|
|
1335
1343
|
children: i
|
|
1336
1344
|
}
|
|
1337
1345
|
),
|
|
1338
|
-
/* @__PURE__ */ n(
|
|
1346
|
+
/* @__PURE__ */ n($, { color: "danger", icon: !0, size: "sm", onClick: w, children: /* @__PURE__ */ n(Pe, { size: 24 }) })
|
|
1339
1347
|
]
|
|
1340
1348
|
}
|
|
1341
1349
|
) });
|
|
1342
1350
|
};
|
|
1343
1351
|
export {
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1352
|
+
Yt as $createRutineLinkNode,
|
|
1353
|
+
_r as $isRutineLinkNode,
|
|
1354
|
+
vr as FloatingToolbar,
|
|
1347
1355
|
gn as InsertSelector,
|
|
1348
1356
|
bn as LinkEditPlugin,
|
|
1357
|
+
W as LinkTargetNode,
|
|
1349
1358
|
kn as LinkToolbarButton,
|
|
1350
1359
|
hn as RichTextEditor,
|
|
1351
|
-
|
|
1360
|
+
Mr as RichTextToolbar,
|
|
1352
1361
|
_ as RutineLinkNode,
|
|
1353
1362
|
mn as RutineLinkNodeInit,
|
|
1354
1363
|
fn as TableEditPlugin,
|
|
1355
1364
|
Ye as clearEditorState,
|
|
1356
|
-
|
|
1365
|
+
dn as defaultNodes,
|
|
1357
1366
|
un as defaultViewNodes,
|
|
1358
1367
|
qe as isEditorState,
|
|
1359
|
-
|
|
1360
|
-
|
|
1368
|
+
Ht as isJSON,
|
|
1369
|
+
Ut as richTextContext,
|
|
1361
1370
|
pn as richTextCss,
|
|
1362
|
-
|
|
1371
|
+
wr as richTextStyleObj,
|
|
1363
1372
|
Ge as setStateFromPlainText,
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1373
|
+
cn as stateToHTML,
|
|
1374
|
+
Je as useHasFocusWithin,
|
|
1375
|
+
at as useRichTextContext
|
|
1367
1376
|
};
|