@arkitektbedriftene/fe-lib 2.2.1 → 2.3.1
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.es.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var R = (t, r, e) => (
|
|
4
|
-
import { createHeadlessEditor as
|
|
5
|
-
import { $generateHtmlFromNodes as
|
|
6
|
-
import { $getRoot as j, ParagraphNode as
|
|
7
|
-
import { trimTextContentFromAnchor as
|
|
8
|
-
import { LinkNode as B, AutoLinkNode as
|
|
9
|
-
import { ListNode as
|
|
10
|
-
import { HeadingNode as
|
|
11
|
-
import { TableNode as
|
|
12
|
-
import { jsx as o, jsxs as
|
|
13
|
-
import { createContext as
|
|
14
|
-
import { Box as H, Stack as
|
|
15
|
-
import { f as
|
|
16
|
-
import { useLexicalComposerContext as
|
|
17
|
-
import { LexicalComposer as
|
|
18
|
-
import { RichTextPlugin as
|
|
19
|
-
import
|
|
20
|
-
import { useFloating as
|
|
21
|
-
import { $getNearestNodeOfType as
|
|
22
|
-
import { s as
|
|
23
|
-
import { ListPlugin as
|
|
24
|
-
import { HistoryPlugin as
|
|
25
|
-
import { TablePlugin as
|
|
26
|
-
import { TabIndentationPlugin as
|
|
27
|
-
import { useLexicalComposerContext as
|
|
1
|
+
var se = Object.defineProperty;
|
|
2
|
+
var ce = (t, r, e) => r in t ? se(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
|
|
3
|
+
var R = (t, r, e) => (ce(t, typeof r != "symbol" ? r + "" : r, e), e);
|
|
4
|
+
import { createHeadlessEditor as It } from "@lexical/headless";
|
|
5
|
+
import { $generateHtmlFromNodes as Rt } from "@lexical/html";
|
|
6
|
+
import { $getRoot as j, ParagraphNode as de, $createParagraphNode as F, $createTextNode as I, $setSelection as Q, $getNodeByKey as Ct, DecoratorNode as he, $applyNodeReplacement as ue, SELECTION_CHANGE_COMMAND as K, $getSelection as L, COMMAND_PRIORITY_CRITICAL as st, $isRangeSelection as w, $isRootOrShadowRoot as Ot, FORMAT_TEXT_COMMAND as W, COMMAND_PRIORITY_LOW as O, KEY_ARROW_DOWN_COMMAND as ge, KEY_ARROW_UP_COMMAND as pe, KEY_ESCAPE_COMMAND as zt, KEY_SPACE_COMMAND as me, $getNearestNodeFromDOMNode as ct, KEY_ARROW_LEFT_COMMAND as fe, $isElementNode as ke, createCommand as be, $insertNodes as Me, COMMAND_PRIORITY_EDITOR as ve, COMMAND_PRIORITY_NORMAL as Ce, $createRangeSelection as At, COMMAND_PRIORITY_HIGH as Te, FORMAT_ELEMENT_COMMAND as ot } from "lexical";
|
|
7
|
+
import { trimTextContentFromAnchor as _e, $setBlocksType as it, $isAtNodeEnd as Tt } from "@lexical/selection";
|
|
8
|
+
import { LinkNode as B, AutoLinkNode as $t, $isLinkNode as G, TOGGLE_LINK_COMMAND as V } from "@lexical/link";
|
|
9
|
+
import { ListNode as dt, ListItemNode as Dt, $isListNode as ht, INSERT_UNORDERED_LIST_COMMAND as xe, INSERT_ORDERED_LIST_COMMAND as Le, INSERT_CHECK_LIST_COMMAND as Bt, insertList as we, $isListItemNode as P } from "@lexical/list";
|
|
10
|
+
import { HeadingNode as Pt, QuoteNode as Ht, $isHeadingNode as ye, $createHeadingNode as Ne, $createQuoteNode as Se } from "@lexical/rich-text";
|
|
11
|
+
import { TableNode as Ft, TableRowNode as Ut, TableCellNode as Wt, INSERT_TABLE_COMMAND as Ee, $getTableCellNodeFromLexicalNode as Ie, $deleteTableColumn__EXPERIMENTAL as Re, $deleteTableRow__EXPERIMENTAL as Oe, $insertTableColumn__EXPERIMENTAL as _t, $insertTableRow__EXPERIMENTAL as xt } from "@lexical/table";
|
|
12
|
+
import { jsx as o, jsxs as u, Fragment as U } from "react/jsx-runtime";
|
|
13
|
+
import { createContext as ze, useState as k, useRef as q, useCallback as C, useContext as Ae, useEffect as y, useMemo as jt, useLayoutEffect as $e } from "react";
|
|
14
|
+
import { Box as H, Stack as De, Button as N, DropdownMenu as Z, ToolbarButton as ut, DropdownMenuIconItem as v, ToolbarToggleGroup as Kt, ToolbarToggleItem as D, OverlayCard as qt, Toolbar as Be, ToolbarSeparator as Pe, styled as He, Spinner as gt, Dialog as Yt, DialogHeader as Fe, TextInput as pt, DialogActions as tt, DropdownMenuItem as $, DropdownMenuSeparator as Lt, NavBar as Ue, NavBarItem as at, Combobox as We } from "./ui.es.js";
|
|
15
|
+
import { f as je, g as Ke, G as m, h as qe, i as Ye } from "./index.esm-da01383a.js";
|
|
16
|
+
import { useLexicalComposerContext as _ } from "@lexical/react/LexicalComposerContext.js";
|
|
17
|
+
import { LexicalComposer as Ge } from "@lexical/react/LexicalComposer.js";
|
|
18
|
+
import { RichTextPlugin as Je } from "@lexical/react/LexicalRichTextPlugin.js";
|
|
19
|
+
import Xe from "@lexical/react/LexicalErrorBoundary.js";
|
|
20
|
+
import { useFloating as mt, autoUpdate as Gt, size as Qe, flip as Ve, offset as Jt, shift as Ze, useInteractions as Xt, useRole as Qt, FloatingPortal as Vt, inline as tr, useDismiss as er } from "@floating-ui/react";
|
|
21
|
+
import { $getNearestNodeOfType as rr, $findMatchingParent as Zt, mergeRegister as et, isHTMLElement as wt, $wrapNodeInElement as nr } from "@lexical/utils";
|
|
22
|
+
import { s as or, c as ir } from "./stitches.config-00c23cdb.js";
|
|
23
|
+
import { ListPlugin as ar } from "@lexical/react/LexicalListPlugin.js";
|
|
24
|
+
import { HistoryPlugin as lr } from "@lexical/react/LexicalHistoryPlugin.js";
|
|
25
|
+
import { TablePlugin as sr } from "@lexical/react/LexicalTablePlugin.js";
|
|
26
|
+
import { TabIndentationPlugin as cr } from "@lexical/react/LexicalTabIndentationPlugin.js";
|
|
27
|
+
import { useLexicalComposerContext as te } from "@lexical/react/LexicalComposerContext";
|
|
28
28
|
import "@stitches/react";
|
|
29
|
-
const
|
|
29
|
+
const dr = ({
|
|
30
30
|
text: t,
|
|
31
31
|
maxChars: r,
|
|
32
32
|
maxLines: e
|
|
@@ -41,16 +41,16 @@ const sr = ({
|
|
|
41
41
|
t[a] === `
|
|
42
42
|
` && l++, a++;
|
|
43
43
|
return t.slice(0, a).length;
|
|
44
|
-
},
|
|
44
|
+
}, ee = ({
|
|
45
45
|
editor: t,
|
|
46
46
|
maxChars: r,
|
|
47
47
|
maxLines: e
|
|
48
48
|
}) => {
|
|
49
|
-
const n = j(), i = n.getTextContent(), l =
|
|
50
|
-
|
|
49
|
+
const n = j(), i = n.getTextContent(), l = dr({ text: i, maxChars: r, maxLines: e }), a = i.length - l, d = n.select().anchor;
|
|
50
|
+
_e(t, d, a);
|
|
51
51
|
const c = n.getLastChild();
|
|
52
|
-
return c instanceof
|
|
53
|
-
},
|
|
52
|
+
return c instanceof de && c.getChildrenSize() === 0 && c.remove(), a;
|
|
53
|
+
}, ft = {
|
|
54
54
|
quote: "ain-rich-text-quote",
|
|
55
55
|
text: {
|
|
56
56
|
bold: "ain-rich-text-bold",
|
|
@@ -62,7 +62,7 @@ const sr = ({
|
|
|
62
62
|
listitem: "ain-rich-text-nested-list-item"
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
},
|
|
65
|
+
}, kt = (t) => t[0] === "{", hr = (t) => t !== null && typeof t == "object" && "isEmpty" in t, ur = (t, r) => {
|
|
66
66
|
t.update(
|
|
67
67
|
() => {
|
|
68
68
|
const e = j();
|
|
@@ -74,7 +74,7 @@ const sr = ({
|
|
|
74
74
|
tag: r
|
|
75
75
|
}
|
|
76
76
|
);
|
|
77
|
-
},
|
|
77
|
+
}, gr = (t, r, e) => {
|
|
78
78
|
r.update(
|
|
79
79
|
() => {
|
|
80
80
|
const n = j();
|
|
@@ -86,24 +86,24 @@ const sr = ({
|
|
|
86
86
|
tag: e
|
|
87
87
|
}
|
|
88
88
|
), r.blur();
|
|
89
|
-
},
|
|
89
|
+
}, zn = async (t, r, e) => {
|
|
90
90
|
var a;
|
|
91
91
|
let n = 0;
|
|
92
|
-
const i =
|
|
92
|
+
const i = It({
|
|
93
93
|
nodes: r,
|
|
94
94
|
editable: !1,
|
|
95
|
-
theme:
|
|
95
|
+
theme: ft
|
|
96
96
|
});
|
|
97
97
|
if (t)
|
|
98
98
|
try {
|
|
99
|
-
if (typeof t == "string" && !
|
|
99
|
+
if (typeof t == "string" && !kt(t))
|
|
100
100
|
i.update(() => {
|
|
101
101
|
const s = j(), d = F();
|
|
102
102
|
d.append(I(t.trim())), s.append(d);
|
|
103
103
|
});
|
|
104
104
|
else {
|
|
105
105
|
const s = i.parseEditorState(t, () => {
|
|
106
|
-
(e == null ? void 0 : e.maxLines) !== void 0 && (n =
|
|
106
|
+
(e == null ? void 0 : e.maxLines) !== void 0 && (n = ee({
|
|
107
107
|
editor: i,
|
|
108
108
|
maxLines: e.maxLines
|
|
109
109
|
}));
|
|
@@ -116,25 +116,25 @@ const sr = ({
|
|
|
116
116
|
await ((a = e == null ? void 0 : e.updateFn) == null ? void 0 : a.call(e, i));
|
|
117
117
|
let l = "";
|
|
118
118
|
return i.read(() => {
|
|
119
|
-
l =
|
|
119
|
+
l = Rt(i);
|
|
120
120
|
}), { html: l, trimCount: n };
|
|
121
|
-
},
|
|
121
|
+
}, An = (t, r, e) => {
|
|
122
122
|
let n = 0;
|
|
123
|
-
const i =
|
|
123
|
+
const i = It({
|
|
124
124
|
nodes: r,
|
|
125
125
|
editable: !1,
|
|
126
|
-
theme:
|
|
126
|
+
theme: ft
|
|
127
127
|
});
|
|
128
128
|
if (t)
|
|
129
129
|
try {
|
|
130
|
-
if (typeof t == "string" && !
|
|
130
|
+
if (typeof t == "string" && !kt(t))
|
|
131
131
|
i.update(() => {
|
|
132
132
|
const a = j(), s = F();
|
|
133
133
|
s.append(I(t.trim())), a.append(s);
|
|
134
134
|
});
|
|
135
135
|
else {
|
|
136
136
|
const a = i.parseEditorState(t, () => {
|
|
137
|
-
(e == null ? void 0 : e.maxLines) !== void 0 && (n =
|
|
137
|
+
(e == null ? void 0 : e.maxLines) !== void 0 && (n = ee({
|
|
138
138
|
editor: i,
|
|
139
139
|
maxLines: e.maxLines
|
|
140
140
|
}));
|
|
@@ -147,7 +147,7 @@ const sr = ({
|
|
|
147
147
|
let l = "";
|
|
148
148
|
try {
|
|
149
149
|
i.read(() => {
|
|
150
|
-
l =
|
|
150
|
+
l = Rt(i);
|
|
151
151
|
});
|
|
152
152
|
} catch {
|
|
153
153
|
}
|
|
@@ -181,8 +181,8 @@ class J extends B {
|
|
|
181
181
|
return B.importJSON(r);
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
const
|
|
185
|
-
const [r, e] =
|
|
184
|
+
const re = ze({ hasFocus: !1, editorRef: { current: null }, signUrl: void 0 }), pr = ({ onBlur: t }) => {
|
|
185
|
+
const [r, e] = k(!1), n = q(null), i = C(() => {
|
|
186
186
|
e(!0), n.current && window.clearTimeout(n.current);
|
|
187
187
|
}, []), l = C(() => {
|
|
188
188
|
n.current = window.setTimeout(() => {
|
|
@@ -196,45 +196,45 @@ const Zt = Ie({ hasFocus: !1, editorRef: { current: null }, signUrl: void 0 }),
|
|
|
196
196
|
onBlur: l
|
|
197
197
|
}
|
|
198
198
|
};
|
|
199
|
-
},
|
|
200
|
-
function
|
|
199
|
+
}, rt = () => Ae(re), mr = (t) => t.startsWith("https://devfilesab.blob.core.windows.net") || t.startsWith("https://filesab.blob.core.windows.net");
|
|
200
|
+
function fr({
|
|
201
201
|
src: t,
|
|
202
202
|
altText: r,
|
|
203
203
|
width: e,
|
|
204
204
|
height: n,
|
|
205
205
|
nodeKey: i
|
|
206
206
|
}) {
|
|
207
|
-
const { signUrl: l } =
|
|
207
|
+
const { signUrl: l } = rt(), [a, s] = k(mr(t) ? "" : t), [d, c] = k(!1), g = q(!1), [p] = _();
|
|
208
208
|
y(() => {
|
|
209
209
|
const h = async () => {
|
|
210
210
|
s(await (l == null ? void 0 : l(t)) ?? t);
|
|
211
211
|
};
|
|
212
|
-
!a && !
|
|
212
|
+
!a && !g.current && (g.current = !0, h());
|
|
213
213
|
}, []);
|
|
214
|
-
const
|
|
215
|
-
|
|
214
|
+
const f = (h) => (M) => {
|
|
215
|
+
M.relatedTarget instanceof HTMLElement && M.relatedTarget.dataset.controls === "true" || c(h);
|
|
216
216
|
}, S = () => {
|
|
217
217
|
p.update(() => {
|
|
218
|
-
var
|
|
219
|
-
const h =
|
|
218
|
+
var T;
|
|
219
|
+
const h = Ct(i);
|
|
220
220
|
if (!h)
|
|
221
221
|
return;
|
|
222
|
-
const
|
|
223
|
-
|
|
222
|
+
const M = h.getPreviousSibling() || ((T = h.getParent()) == null ? void 0 : T.getPreviousSibling());
|
|
223
|
+
M && M.insertBefore(h);
|
|
224
224
|
});
|
|
225
225
|
}, E = () => {
|
|
226
226
|
p.update(() => {
|
|
227
|
-
var
|
|
228
|
-
const h =
|
|
227
|
+
var T;
|
|
228
|
+
const h = Ct(i);
|
|
229
229
|
if (!h)
|
|
230
230
|
return;
|
|
231
|
-
const
|
|
232
|
-
|
|
231
|
+
const M = h.getNextSibling() || ((T = h.getParent()) == null ? void 0 : T.getNextSibling());
|
|
232
|
+
M && M.insertAfter(h);
|
|
233
233
|
});
|
|
234
234
|
};
|
|
235
|
-
return a ? /* @__PURE__ */
|
|
236
|
-
/* @__PURE__ */
|
|
237
|
-
|
|
235
|
+
return a ? /* @__PURE__ */ u(H, { css: { position: "relative", display: "inline-block" }, children: [
|
|
236
|
+
/* @__PURE__ */ u(
|
|
237
|
+
De,
|
|
238
238
|
{
|
|
239
239
|
css: {
|
|
240
240
|
position: "absolute",
|
|
@@ -246,7 +246,7 @@ function pr({
|
|
|
246
246
|
},
|
|
247
247
|
gap: 1,
|
|
248
248
|
"data-controls": "true",
|
|
249
|
-
onMouseLeave:
|
|
249
|
+
onMouseLeave: f(!1),
|
|
250
250
|
children: [
|
|
251
251
|
/* @__PURE__ */ o(
|
|
252
252
|
N,
|
|
@@ -255,7 +255,7 @@ function pr({
|
|
|
255
255
|
size: "sm",
|
|
256
256
|
css: { width: "20px", height: "20px" },
|
|
257
257
|
onClick: S,
|
|
258
|
-
children: /* @__PURE__ */ o(
|
|
258
|
+
children: /* @__PURE__ */ o(je, {})
|
|
259
259
|
}
|
|
260
260
|
),
|
|
261
261
|
/* @__PURE__ */ o(
|
|
@@ -265,7 +265,7 @@ function pr({
|
|
|
265
265
|
size: "sm",
|
|
266
266
|
css: { width: "20px", height: "20px" },
|
|
267
267
|
onClick: E,
|
|
268
|
-
children: /* @__PURE__ */ o(
|
|
268
|
+
children: /* @__PURE__ */ o(Ke, {})
|
|
269
269
|
}
|
|
270
270
|
)
|
|
271
271
|
]
|
|
@@ -281,18 +281,18 @@ function pr({
|
|
|
281
281
|
width: e
|
|
282
282
|
},
|
|
283
283
|
className: "ain-rich-text-image",
|
|
284
|
-
onMouseEnter:
|
|
285
|
-
onMouseLeave:
|
|
284
|
+
onMouseEnter: f(!0),
|
|
285
|
+
onMouseLeave: f(!1),
|
|
286
286
|
"data-controls": "true"
|
|
287
287
|
}
|
|
288
288
|
)
|
|
289
289
|
] }) : /* @__PURE__ */ o("span", {});
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function kr(t) {
|
|
292
292
|
const r = t, { alt: e, src: n, width: i, height: l } = r;
|
|
293
|
-
return { node:
|
|
293
|
+
return { node: bt({ altText: e, height: l, src: n, width: i }) };
|
|
294
294
|
}
|
|
295
|
-
class A extends
|
|
295
|
+
class A extends he {
|
|
296
296
|
constructor(e, n, i, l, a, s) {
|
|
297
297
|
super(s);
|
|
298
298
|
R(this, "__src");
|
|
@@ -317,7 +317,7 @@ class A extends se {
|
|
|
317
317
|
}
|
|
318
318
|
static importJSON(e) {
|
|
319
319
|
const { altText: n, height: i, width: l, src: a, meta: s } = e;
|
|
320
|
-
return
|
|
320
|
+
return bt({
|
|
321
321
|
altText: n,
|
|
322
322
|
height: i,
|
|
323
323
|
src: a,
|
|
@@ -332,7 +332,7 @@ class A extends se {
|
|
|
332
332
|
static importDOM() {
|
|
333
333
|
return {
|
|
334
334
|
img: (e) => ({
|
|
335
|
-
conversion:
|
|
335
|
+
conversion: kr,
|
|
336
336
|
priority: 0
|
|
337
337
|
})
|
|
338
338
|
};
|
|
@@ -374,7 +374,7 @@ class A extends se {
|
|
|
374
374
|
}
|
|
375
375
|
decorate() {
|
|
376
376
|
return /* @__PURE__ */ o(
|
|
377
|
-
|
|
377
|
+
fr,
|
|
378
378
|
{
|
|
379
379
|
src: this.__src,
|
|
380
380
|
altText: this.__altText,
|
|
@@ -385,7 +385,7 @@ class A extends se {
|
|
|
385
385
|
);
|
|
386
386
|
}
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function bt({
|
|
389
389
|
altText: t,
|
|
390
390
|
height: r,
|
|
391
391
|
src: e,
|
|
@@ -393,34 +393,34 @@ function ft({
|
|
|
393
393
|
meta: i,
|
|
394
394
|
key: l
|
|
395
395
|
}) {
|
|
396
|
-
return
|
|
396
|
+
return ue(
|
|
397
397
|
new A(e, t, n, r, i, l)
|
|
398
398
|
);
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function $n(t) {
|
|
401
401
|
return t instanceof A;
|
|
402
402
|
}
|
|
403
|
-
const
|
|
404
|
-
$t,
|
|
405
|
-
Dt,
|
|
406
|
-
st,
|
|
407
|
-
zt,
|
|
408
|
-
Ot,
|
|
409
|
-
B,
|
|
410
|
-
Bt,
|
|
403
|
+
const Dn = [
|
|
411
404
|
Pt,
|
|
412
405
|
Ht,
|
|
413
|
-
|
|
414
|
-
], zn = [
|
|
415
|
-
$t,
|
|
406
|
+
dt,
|
|
416
407
|
Dt,
|
|
417
|
-
|
|
418
|
-
zt,
|
|
419
|
-
Ot,
|
|
408
|
+
$t,
|
|
420
409
|
B,
|
|
421
|
-
|
|
410
|
+
Ft,
|
|
411
|
+
Ut,
|
|
412
|
+
Wt,
|
|
413
|
+
A
|
|
414
|
+
], Bn = [
|
|
422
415
|
Pt,
|
|
423
416
|
Ht,
|
|
417
|
+
dt,
|
|
418
|
+
Dt,
|
|
419
|
+
$t,
|
|
420
|
+
B,
|
|
421
|
+
Ft,
|
|
422
|
+
Ut,
|
|
423
|
+
Wt,
|
|
424
424
|
A,
|
|
425
425
|
J,
|
|
426
426
|
{
|
|
@@ -431,64 +431,73 @@ const On = [
|
|
|
431
431
|
)
|
|
432
432
|
}
|
|
433
433
|
];
|
|
434
|
-
function
|
|
435
|
-
return
|
|
434
|
+
function br(t) {
|
|
435
|
+
return m({ 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 6l16 0" } }, { tag: "path", attr: { d: "M8 12l8 0" } }, { tag: "path", attr: { d: "M6 18l12 0" } }] })(t);
|
|
436
436
|
}
|
|
437
|
-
function
|
|
438
|
-
return
|
|
437
|
+
function yt(t) {
|
|
438
|
+
return m({ 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 6l16 0" } }, { tag: "path", attr: { d: "M4 12l10 0" } }, { tag: "path", attr: { d: "M4 18l14 0" } }] })(t);
|
|
439
439
|
}
|
|
440
|
-
function
|
|
441
|
-
return
|
|
440
|
+
function Mr(t) {
|
|
441
|
+
return m({ 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 6l16 0" } }, { tag: "path", attr: { d: "M10 12l10 0" } }, { tag: "path", attr: { d: "M6 18l14 0" } }] })(t);
|
|
442
442
|
}
|
|
443
443
|
function vr(t) {
|
|
444
|
-
return
|
|
444
|
+
return m({ 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);
|
|
445
445
|
}
|
|
446
446
|
function Cr(t) {
|
|
447
|
-
return
|
|
447
|
+
return m({ 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);
|
|
448
448
|
}
|
|
449
|
-
function
|
|
450
|
-
return
|
|
449
|
+
function Tr(t) {
|
|
450
|
+
return m({ 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);
|
|
451
451
|
}
|
|
452
452
|
function _r(t) {
|
|
453
|
-
return
|
|
454
|
-
}
|
|
455
|
-
function Tr(t) {
|
|
456
|
-
return k({ 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);
|
|
453
|
+
return m({ 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);
|
|
457
454
|
}
|
|
458
455
|
function xr(t) {
|
|
459
|
-
return
|
|
456
|
+
return m({ 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);
|
|
460
457
|
}
|
|
461
458
|
function Lr(t) {
|
|
462
|
-
return
|
|
459
|
+
return m({ 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);
|
|
463
460
|
}
|
|
464
461
|
function wr(t) {
|
|
465
|
-
return
|
|
462
|
+
return m({ 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);
|
|
466
463
|
}
|
|
467
464
|
function yr(t) {
|
|
468
|
-
return
|
|
465
|
+
return m({ 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);
|
|
469
466
|
}
|
|
470
467
|
function Nr(t) {
|
|
471
|
-
return
|
|
468
|
+
return m({ 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);
|
|
472
469
|
}
|
|
473
470
|
function Sr(t) {
|
|
474
|
-
return
|
|
471
|
+
return m({ 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);
|
|
475
472
|
}
|
|
476
473
|
function Er(t) {
|
|
477
|
-
return
|
|
474
|
+
return m({ 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);
|
|
478
475
|
}
|
|
479
476
|
function Ir(t) {
|
|
480
|
-
return
|
|
477
|
+
return m({ 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);
|
|
481
478
|
}
|
|
482
479
|
function Rr(t) {
|
|
483
|
-
return
|
|
480
|
+
return m({ 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);
|
|
484
481
|
}
|
|
485
482
|
function Or(t) {
|
|
486
|
-
return
|
|
483
|
+
return m({ 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);
|
|
484
|
+
}
|
|
485
|
+
function zr(t) {
|
|
486
|
+
return m({ 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);
|
|
487
487
|
}
|
|
488
|
-
|
|
488
|
+
function Ar(t) {
|
|
489
|
+
return m({ 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);
|
|
490
|
+
}
|
|
491
|
+
function $r(t) {
|
|
492
|
+
return m({ 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);
|
|
493
|
+
}
|
|
494
|
+
function Dr(t) {
|
|
495
|
+
return m({ 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);
|
|
496
|
+
}
|
|
497
|
+
const Br = or("div", {
|
|
489
498
|
width: "10rem",
|
|
490
499
|
display: "flex"
|
|
491
|
-
}),
|
|
500
|
+
}), ne = {
|
|
492
501
|
bullet: "Punktliste",
|
|
493
502
|
h1: "Overskrift 1",
|
|
494
503
|
h2: "Overskrift 2",
|
|
@@ -500,22 +509,22 @@ const zr = er("div", {
|
|
|
500
509
|
paragraph: "Normal",
|
|
501
510
|
quote: "Sitat",
|
|
502
511
|
check: "Avkrysningsliste"
|
|
503
|
-
},
|
|
504
|
-
bullet: /* @__PURE__ */ o(
|
|
505
|
-
h1: /* @__PURE__ */ o(
|
|
506
|
-
h2: /* @__PURE__ */ o(
|
|
507
|
-
h3: /* @__PURE__ */ o(
|
|
508
|
-
h4: /* @__PURE__ */ o(
|
|
509
|
-
h5: /* @__PURE__ */ o(
|
|
510
|
-
h6: /* @__PURE__ */ o(
|
|
511
|
-
number: /* @__PURE__ */ o(
|
|
512
|
-
check: /* @__PURE__ */ o(
|
|
513
|
-
paragraph: /* @__PURE__ */ o(
|
|
514
|
-
quote: /* @__PURE__ */ o(
|
|
512
|
+
}, Pr = {
|
|
513
|
+
bullet: /* @__PURE__ */ o(Or, { size: "1.25rem" }),
|
|
514
|
+
h1: /* @__PURE__ */ o(Tr, { size: "1.25rem" }),
|
|
515
|
+
h2: /* @__PURE__ */ o(_r, { size: "1.25rem" }),
|
|
516
|
+
h3: /* @__PURE__ */ o(xr, { size: "1.25rem" }),
|
|
517
|
+
h4: /* @__PURE__ */ o(Lr, { size: "1.25rem" }),
|
|
518
|
+
h5: /* @__PURE__ */ o(wr, { size: "1.25rem" }),
|
|
519
|
+
h6: /* @__PURE__ */ o(yr, { size: "1.25rem" }),
|
|
520
|
+
number: /* @__PURE__ */ o(Rr, { size: "1.25rem" }),
|
|
521
|
+
check: /* @__PURE__ */ o(Ir, { size: "1.25rem" }),
|
|
522
|
+
paragraph: /* @__PURE__ */ o(Sr, { size: "1.25rem" }),
|
|
523
|
+
quote: /* @__PURE__ */ o(zr, { size: "1.25rem" })
|
|
515
524
|
}, x = ({
|
|
516
525
|
blockType: t
|
|
517
|
-
}) => /* @__PURE__ */
|
|
518
|
-
/* @__PURE__ */ o(H, { css: { display: "flex", flex: "0 0 auto" }, children:
|
|
526
|
+
}) => /* @__PURE__ */ u(U, { children: [
|
|
527
|
+
/* @__PURE__ */ o(H, { css: { display: "flex", flex: "0 0 auto" }, children: Pr[t] }),
|
|
519
528
|
/* @__PURE__ */ o(
|
|
520
529
|
H,
|
|
521
530
|
{
|
|
@@ -525,56 +534,56 @@ const zr = er("div", {
|
|
|
525
534
|
textOverflow: "ellipsis",
|
|
526
535
|
whiteSpace: "nowrap"
|
|
527
536
|
},
|
|
528
|
-
children:
|
|
537
|
+
children: ne[t]
|
|
529
538
|
}
|
|
530
539
|
)
|
|
531
|
-
] }),
|
|
540
|
+
] }), Hr = (t) => {
|
|
532
541
|
if (!w(t))
|
|
533
542
|
return null;
|
|
534
543
|
const r = t.anchor.getNode();
|
|
535
|
-
let e = r.getKey() === "root" ? r :
|
|
544
|
+
let e = r.getKey() === "root" ? r : Zt(r, (n) => {
|
|
536
545
|
const i = n.getParent();
|
|
537
|
-
return i !== null &&
|
|
546
|
+
return i !== null && Ot(i);
|
|
538
547
|
});
|
|
539
548
|
return e === null && (e = r.getTopLevelElementOrThrow()), {
|
|
540
549
|
anchorNode: r,
|
|
541
550
|
element: e
|
|
542
551
|
};
|
|
543
|
-
},
|
|
544
|
-
const [t] =
|
|
552
|
+
}, Fr = () => {
|
|
553
|
+
const [t] = _(), [r, e] = k("paragraph");
|
|
545
554
|
y(() => t.registerCommand(
|
|
546
555
|
K,
|
|
547
556
|
() => {
|
|
548
|
-
const c = L(),
|
|
549
|
-
if (!
|
|
557
|
+
const c = L(), g = Hr(c);
|
|
558
|
+
if (!g)
|
|
550
559
|
return !1;
|
|
551
|
-
const { element: p, anchorNode:
|
|
560
|
+
const { element: p, anchorNode: f } = g, S = p.getKey();
|
|
552
561
|
if (t.getElementByKey(S) !== null)
|
|
553
|
-
if (
|
|
554
|
-
const h =
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
),
|
|
558
|
-
e(
|
|
562
|
+
if (ht(p)) {
|
|
563
|
+
const h = rr(
|
|
564
|
+
f,
|
|
565
|
+
dt
|
|
566
|
+
), M = h ? h.getListType() : p.getListType();
|
|
567
|
+
e(M);
|
|
559
568
|
} else {
|
|
560
|
-
const h =
|
|
561
|
-
h in
|
|
569
|
+
const h = ye(p) ? p.getTag() : p.getType();
|
|
570
|
+
h in ne && e(h);
|
|
562
571
|
}
|
|
563
572
|
return !1;
|
|
564
573
|
},
|
|
565
|
-
|
|
574
|
+
st
|
|
566
575
|
), [t]);
|
|
567
576
|
const n = (c) => {
|
|
568
577
|
r !== c && t.update(() => {
|
|
569
|
-
const
|
|
570
|
-
w(
|
|
578
|
+
const g = L();
|
|
579
|
+
w(g) && (it(g, () => Ne(c)), e(c));
|
|
571
580
|
});
|
|
572
581
|
};
|
|
573
|
-
return /* @__PURE__ */ o(
|
|
574
|
-
|
|
582
|
+
return /* @__PURE__ */ o(Br, { children: /* @__PURE__ */ u(
|
|
583
|
+
Z,
|
|
575
584
|
{
|
|
576
585
|
trigger: /* @__PURE__ */ o(
|
|
577
|
-
|
|
586
|
+
ut,
|
|
578
587
|
{
|
|
579
588
|
dropdown: !0,
|
|
580
589
|
css: { display: "flex", width: "100%", overflow: "hidden" },
|
|
@@ -584,46 +593,46 @@ const zr = er("div", {
|
|
|
584
593
|
side: "bottom",
|
|
585
594
|
align: "start",
|
|
586
595
|
children: [
|
|
587
|
-
/* @__PURE__ */ o(
|
|
596
|
+
/* @__PURE__ */ o(v, { onClick: () => {
|
|
588
597
|
r !== "paragraph" && t.update(() => {
|
|
589
598
|
const c = L();
|
|
590
|
-
w(c) && (
|
|
599
|
+
w(c) && (it(c, () => F()), e("paragraph"));
|
|
591
600
|
});
|
|
592
601
|
}, children: /* @__PURE__ */ o(x, { blockType: "paragraph" }) }),
|
|
593
|
-
/* @__PURE__ */ o(
|
|
594
|
-
/* @__PURE__ */ o(
|
|
595
|
-
/* @__PURE__ */ o(
|
|
596
|
-
/* @__PURE__ */ o(
|
|
597
|
-
/* @__PURE__ */ o(
|
|
598
|
-
/* @__PURE__ */ o(
|
|
599
|
-
/* @__PURE__ */ o(
|
|
600
|
-
r !== "bullet" && (t.dispatchCommand(
|
|
602
|
+
/* @__PURE__ */ o(v, { onClick: () => n("h1"), children: /* @__PURE__ */ o(x, { blockType: "h1" }) }),
|
|
603
|
+
/* @__PURE__ */ o(v, { onClick: () => n("h2"), children: /* @__PURE__ */ o(x, { blockType: "h2" }) }),
|
|
604
|
+
/* @__PURE__ */ o(v, { onClick: () => n("h3"), children: /* @__PURE__ */ o(x, { blockType: "h3" }) }),
|
|
605
|
+
/* @__PURE__ */ o(v, { onClick: () => n("h4"), children: /* @__PURE__ */ o(x, { blockType: "h4" }) }),
|
|
606
|
+
/* @__PURE__ */ o(v, { onClick: () => n("h5"), children: /* @__PURE__ */ o(x, { blockType: "h5" }) }),
|
|
607
|
+
/* @__PURE__ */ o(v, { onClick: () => n("h6"), children: /* @__PURE__ */ o(x, { blockType: "h6" }) }),
|
|
608
|
+
/* @__PURE__ */ o(v, { onClick: () => {
|
|
609
|
+
r !== "bullet" && (t.dispatchCommand(xe, void 0), e("bullet"));
|
|
601
610
|
}, children: /* @__PURE__ */ o(x, { blockType: "bullet" }) }),
|
|
602
|
-
/* @__PURE__ */ o(
|
|
603
|
-
r !== "number" && (t.dispatchCommand(
|
|
611
|
+
/* @__PURE__ */ o(v, { onClick: () => {
|
|
612
|
+
r !== "number" && (t.dispatchCommand(Le, void 0), e("number"));
|
|
604
613
|
}, children: /* @__PURE__ */ o(x, { blockType: "number" }) }),
|
|
605
|
-
/* @__PURE__ */ o(
|
|
606
|
-
r !== "check" && (t.dispatchCommand(
|
|
614
|
+
/* @__PURE__ */ o(v, { onClick: () => {
|
|
615
|
+
r !== "check" && (t.dispatchCommand(Bt, void 0), e("check"));
|
|
607
616
|
}, children: /* @__PURE__ */ o(x, { blockType: "check" }) }),
|
|
608
|
-
/* @__PURE__ */ o(
|
|
617
|
+
/* @__PURE__ */ o(v, { onClick: () => {
|
|
609
618
|
r !== "quote" && t.update(() => {
|
|
610
619
|
const c = L();
|
|
611
|
-
w(c) && (
|
|
620
|
+
w(c) && (it(c, () => Se()), e("quote"));
|
|
612
621
|
});
|
|
613
622
|
}, children: /* @__PURE__ */ o(x, { blockType: "quote" }) })
|
|
614
623
|
]
|
|
615
624
|
}
|
|
616
625
|
) });
|
|
617
|
-
},
|
|
618
|
-
const [t] =
|
|
626
|
+
}, Ur = () => {
|
|
627
|
+
const [t] = _(), [r, e] = k(!1), [n, i] = k(!1), [l, a] = k(!1), [s, d] = k(!1), [c, g] = k(!1), p = C(() => {
|
|
619
628
|
const b = L();
|
|
620
|
-
w(b) && (e(b.hasFormat("bold")), i(b.hasFormat("italic")), a(b.hasFormat("underline")), d(b.hasFormat("code")),
|
|
629
|
+
w(b) && (e(b.hasFormat("bold")), i(b.hasFormat("italic")), a(b.hasFormat("underline")), d(b.hasFormat("code")), g(b.hasFormat("superscript")));
|
|
621
630
|
}, []);
|
|
622
|
-
y(() =>
|
|
631
|
+
y(() => et(
|
|
623
632
|
t.registerCommand(
|
|
624
633
|
K,
|
|
625
634
|
() => (p(), !1),
|
|
626
|
-
|
|
635
|
+
st
|
|
627
636
|
),
|
|
628
637
|
t.registerUpdateListener(({ editorState: b }) => {
|
|
629
638
|
b.read(() => {
|
|
@@ -631,7 +640,7 @@ const zr = er("div", {
|
|
|
631
640
|
});
|
|
632
641
|
})
|
|
633
642
|
), [t, p]);
|
|
634
|
-
const
|
|
643
|
+
const f = C(
|
|
635
644
|
() => t.dispatchCommand(W, "bold"),
|
|
636
645
|
[t]
|
|
637
646
|
), S = C(
|
|
@@ -643,28 +652,28 @@ const zr = er("div", {
|
|
|
643
652
|
), h = C(
|
|
644
653
|
() => t.dispatchCommand(W, "code"),
|
|
645
654
|
[t]
|
|
646
|
-
),
|
|
655
|
+
), M = C(
|
|
647
656
|
() => t.dispatchCommand(W, "superscript"),
|
|
648
657
|
[t]
|
|
649
|
-
),
|
|
658
|
+
), T = jt(() => {
|
|
650
659
|
const b = [];
|
|
651
660
|
return r && b.push("bold"), n && b.push("italic"), l && b.push("underline"), s && b.push("code"), c && b.push("superscript"), b;
|
|
652
661
|
}, [r, n, l, s, c]);
|
|
653
|
-
return /* @__PURE__ */
|
|
654
|
-
|
|
662
|
+
return /* @__PURE__ */ u(
|
|
663
|
+
Kt,
|
|
655
664
|
{
|
|
656
665
|
type: "multiple",
|
|
657
666
|
"aria-label": "Tekstformattering",
|
|
658
|
-
value:
|
|
667
|
+
value: T,
|
|
659
668
|
children: [
|
|
660
|
-
/* @__PURE__ */ o(D, { onClick:
|
|
669
|
+
/* @__PURE__ */ o(D, { onClick: f, title: "Fet tekst", value: "bold", children: /* @__PURE__ */ o(vr, { size: "1.25rem" }) }),
|
|
661
670
|
/* @__PURE__ */ o(
|
|
662
671
|
D,
|
|
663
672
|
{
|
|
664
673
|
onClick: S,
|
|
665
674
|
title: "Kursiv tekst",
|
|
666
675
|
value: "italic",
|
|
667
|
-
children: /* @__PURE__ */ o(
|
|
676
|
+
children: /* @__PURE__ */ o(Nr, { size: "1.25rem" })
|
|
668
677
|
}
|
|
669
678
|
),
|
|
670
679
|
/* @__PURE__ */ o(
|
|
@@ -673,41 +682,41 @@ const zr = er("div", {
|
|
|
673
682
|
onClick: E,
|
|
674
683
|
title: "Understreket tekst",
|
|
675
684
|
value: "underline",
|
|
676
|
-
children: /* @__PURE__ */ o(
|
|
685
|
+
children: /* @__PURE__ */ o(Dr, { size: "1.25rem" })
|
|
677
686
|
}
|
|
678
687
|
),
|
|
679
|
-
/* @__PURE__ */ o(D, { onClick: h, title: "Kode", value: "code", children: /* @__PURE__ */ o(
|
|
688
|
+
/* @__PURE__ */ o(D, { onClick: h, title: "Kode", value: "code", children: /* @__PURE__ */ o(Cr, { size: "1.25rem" }) }),
|
|
680
689
|
/* @__PURE__ */ o(
|
|
681
690
|
D,
|
|
682
691
|
{
|
|
683
|
-
onClick:
|
|
692
|
+
onClick: M,
|
|
684
693
|
title: "Superscript",
|
|
685
694
|
value: "superscript",
|
|
686
|
-
children: /* @__PURE__ */ o(
|
|
695
|
+
children: /* @__PURE__ */ o(Ar, { size: "1.25rem" })
|
|
687
696
|
}
|
|
688
697
|
)
|
|
689
698
|
]
|
|
690
699
|
}
|
|
691
700
|
);
|
|
692
|
-
},
|
|
693
|
-
const { hasFocus: r, editorRef: e } =
|
|
694
|
-
|
|
701
|
+
}, Wr = ({ children: t }) => {
|
|
702
|
+
const { hasFocus: r, editorRef: e } = rt(), n = r, [i, l] = k(n);
|
|
703
|
+
$e(() => {
|
|
695
704
|
l(n);
|
|
696
705
|
}, [n]);
|
|
697
|
-
const { context: a, refs: s, floatingStyles: d } =
|
|
706
|
+
const { context: a, refs: s, floatingStyles: d } = mt({
|
|
698
707
|
placement: "top",
|
|
699
|
-
whileElementsMounted:
|
|
708
|
+
whileElementsMounted: Gt,
|
|
700
709
|
middleware: [
|
|
701
|
-
|
|
702
|
-
apply: ({ rects:
|
|
703
|
-
p.floating.style.minWidth = `${
|
|
710
|
+
Qe({
|
|
711
|
+
apply: ({ rects: g, elements: p }) => {
|
|
712
|
+
p.floating.style.minWidth = `${g.reference.width}px`;
|
|
704
713
|
}
|
|
705
714
|
}),
|
|
706
|
-
|
|
707
|
-
|
|
715
|
+
Ve(),
|
|
716
|
+
Jt({
|
|
708
717
|
mainAxis: 8
|
|
709
718
|
}),
|
|
710
|
-
|
|
719
|
+
Ze({
|
|
711
720
|
padding: 8
|
|
712
721
|
})
|
|
713
722
|
],
|
|
@@ -716,13 +725,13 @@ const zr = er("div", {
|
|
|
716
725
|
elements: {
|
|
717
726
|
reference: e.current
|
|
718
727
|
}
|
|
719
|
-
}), { getFloatingProps: c } =
|
|
720
|
-
|
|
728
|
+
}), { getFloatingProps: c } = Xt([
|
|
729
|
+
Qt(a, {
|
|
721
730
|
role: "dialog"
|
|
722
731
|
})
|
|
723
732
|
]);
|
|
724
|
-
return i ? /* @__PURE__ */ o(
|
|
725
|
-
|
|
733
|
+
return i ? /* @__PURE__ */ o(Vt, { children: /* @__PURE__ */ o(
|
|
734
|
+
qt,
|
|
726
735
|
{
|
|
727
736
|
ref: s.setFloating,
|
|
728
737
|
style: d,
|
|
@@ -733,40 +742,40 @@ const zr = er("div", {
|
|
|
733
742
|
overflow: "hidden",
|
|
734
743
|
boxShadow: "$md"
|
|
735
744
|
},
|
|
736
|
-
children: /* @__PURE__ */ o(
|
|
745
|
+
children: /* @__PURE__ */ o(jr, { children: t })
|
|
737
746
|
}
|
|
738
747
|
) }) : null;
|
|
739
|
-
},
|
|
748
|
+
}, jr = ({
|
|
740
749
|
children: t,
|
|
741
750
|
...r
|
|
742
|
-
}) => /* @__PURE__ */
|
|
743
|
-
/* @__PURE__ */ o(
|
|
744
|
-
/* @__PURE__ */ o(
|
|
745
|
-
/* @__PURE__ */ o(
|
|
751
|
+
}) => /* @__PURE__ */ u(Be, { "aria-label": "Formattering", ...r, children: [
|
|
752
|
+
/* @__PURE__ */ o(Fr, {}),
|
|
753
|
+
/* @__PURE__ */ o(Pe, {}),
|
|
754
|
+
/* @__PURE__ */ o(Ur, {}),
|
|
746
755
|
t
|
|
747
756
|
] });
|
|
748
|
-
function
|
|
749
|
-
const [t] =
|
|
750
|
-
return y(() =>
|
|
757
|
+
function Kr() {
|
|
758
|
+
const [t] = _();
|
|
759
|
+
return y(() => et(
|
|
751
760
|
t.registerCommand(
|
|
752
|
-
|
|
753
|
-
() => (
|
|
761
|
+
Bt,
|
|
762
|
+
() => (we(t, "check"), !0),
|
|
754
763
|
O
|
|
755
764
|
),
|
|
756
765
|
t.registerCommand(
|
|
757
|
-
|
|
758
|
-
(r) =>
|
|
766
|
+
ge,
|
|
767
|
+
(r) => Et(r, t, !1),
|
|
759
768
|
O
|
|
760
769
|
),
|
|
761
770
|
t.registerCommand(
|
|
762
|
-
|
|
763
|
-
(r) =>
|
|
771
|
+
pe,
|
|
772
|
+
(r) => Et(r, t, !0),
|
|
764
773
|
O
|
|
765
774
|
),
|
|
766
775
|
t.registerCommand(
|
|
767
|
-
|
|
776
|
+
zt,
|
|
768
777
|
(r) => {
|
|
769
|
-
if (
|
|
778
|
+
if (lt() != null) {
|
|
770
779
|
const n = t.getRootElement();
|
|
771
780
|
return n != null && n.focus(), !0;
|
|
772
781
|
}
|
|
@@ -775,30 +784,30 @@ function Fr() {
|
|
|
775
784
|
O
|
|
776
785
|
),
|
|
777
786
|
t.registerCommand(
|
|
778
|
-
|
|
787
|
+
me,
|
|
779
788
|
(r) => {
|
|
780
|
-
const e =
|
|
789
|
+
const e = lt();
|
|
781
790
|
return e != null && t.isEditable() ? (t.update(() => {
|
|
782
|
-
const n =
|
|
791
|
+
const n = ct(e);
|
|
783
792
|
P(n) && (r.preventDefault(), n.toggleChecked());
|
|
784
793
|
}), !0) : !1;
|
|
785
794
|
},
|
|
786
795
|
O
|
|
787
796
|
),
|
|
788
797
|
t.registerCommand(
|
|
789
|
-
|
|
798
|
+
fe,
|
|
790
799
|
(r) => t.getEditorState().read(() => {
|
|
791
800
|
const e = L();
|
|
792
801
|
if (w(e) && e.isCollapsed()) {
|
|
793
802
|
const { anchor: n } = e, i = n.type === "element";
|
|
794
803
|
if (i || n.offset === 0) {
|
|
795
|
-
const l = n.getNode(), a =
|
|
804
|
+
const l = n.getNode(), a = Zt(
|
|
796
805
|
l,
|
|
797
|
-
(s) =>
|
|
806
|
+
(s) => ke(s) && !s.isInline()
|
|
798
807
|
);
|
|
799
808
|
if (P(a)) {
|
|
800
809
|
const s = a.getParent();
|
|
801
|
-
if (
|
|
810
|
+
if (ht(s) && s.getListType() === "check" && (i || a.getFirstDescendant() === l)) {
|
|
802
811
|
const d = t.getElementByKey(a.__key);
|
|
803
812
|
if (d != null && document.activeElement !== d)
|
|
804
813
|
return d.focus(), r.preventDefault(), !0;
|
|
@@ -811,16 +820,16 @@ function Fr() {
|
|
|
811
820
|
O
|
|
812
821
|
),
|
|
813
822
|
t.registerRootListener((r, e) => {
|
|
814
|
-
r !== null && (r.addEventListener("click",
|
|
823
|
+
r !== null && (r.addEventListener("click", Nt), r.addEventListener("pointerdown", St)), e !== null && (e.removeEventListener("click", Nt), e.removeEventListener("pointerdown", St));
|
|
815
824
|
})
|
|
816
825
|
), [t]), null;
|
|
817
826
|
}
|
|
818
|
-
function
|
|
827
|
+
function oe(t, r) {
|
|
819
828
|
const e = t.target;
|
|
820
|
-
if (e === null || !
|
|
829
|
+
if (e === null || !wt(e))
|
|
821
830
|
return;
|
|
822
831
|
const n = e.firstChild;
|
|
823
|
-
if (n != null &&
|
|
832
|
+
if (n != null && wt(n) && (n.tagName === "UL" || n.tagName === "OL"))
|
|
824
833
|
return;
|
|
825
834
|
const i = e.parentNode;
|
|
826
835
|
if (!i || i.__lexicalListType !== "check")
|
|
@@ -828,23 +837,23 @@ function ee(t, r) {
|
|
|
828
837
|
const l = t.pageX, a = e.getBoundingClientRect();
|
|
829
838
|
(e.dir === "rtl" ? l < a.right && l > a.right - 20 : l > a.left && l < a.left + 20) && r();
|
|
830
839
|
}
|
|
831
|
-
function
|
|
832
|
-
|
|
833
|
-
const r = t.target, e =
|
|
840
|
+
function Nt(t) {
|
|
841
|
+
oe(t, () => {
|
|
842
|
+
const r = t.target, e = qr(r);
|
|
834
843
|
e != null && e.isEditable() && e.update(() => {
|
|
835
844
|
if (t.target) {
|
|
836
|
-
const n =
|
|
845
|
+
const n = ct(r);
|
|
837
846
|
P(n) && (r.focus(), n.toggleChecked());
|
|
838
847
|
}
|
|
839
848
|
});
|
|
840
849
|
});
|
|
841
850
|
}
|
|
842
|
-
function
|
|
843
|
-
|
|
851
|
+
function St(t) {
|
|
852
|
+
oe(t, () => {
|
|
844
853
|
t.preventDefault();
|
|
845
854
|
});
|
|
846
855
|
}
|
|
847
|
-
function
|
|
856
|
+
function qr(t) {
|
|
848
857
|
let r = t;
|
|
849
858
|
for (; r; ) {
|
|
850
859
|
if (r.__lexicalEditor)
|
|
@@ -853,30 +862,30 @@ function Ur(t) {
|
|
|
853
862
|
}
|
|
854
863
|
return null;
|
|
855
864
|
}
|
|
856
|
-
function
|
|
865
|
+
function lt() {
|
|
857
866
|
const t = document.activeElement;
|
|
858
867
|
return t != null && t.tagName === "LI" && t.parentNode != null && // @ts-ignore internal field
|
|
859
868
|
t.parentNode.__lexicalListType === "check" ? t : null;
|
|
860
869
|
}
|
|
861
|
-
function
|
|
870
|
+
function Yr(t, r) {
|
|
862
871
|
let e = r ? t.getPreviousSibling() : t.getNextSibling(), n = t;
|
|
863
872
|
for (; e == null && P(n); )
|
|
864
873
|
n = n.getParentOrThrow().getParent(), n != null && (e = r ? n.getPreviousSibling() : n.getNextSibling());
|
|
865
874
|
for (; P(e); ) {
|
|
866
875
|
const i = r ? e.getLastChild() : e.getFirstChild();
|
|
867
|
-
if (!
|
|
876
|
+
if (!ht(i))
|
|
868
877
|
return e;
|
|
869
878
|
e = r ? i.getLastChild() : i.getFirstChild();
|
|
870
879
|
}
|
|
871
880
|
return null;
|
|
872
881
|
}
|
|
873
|
-
function
|
|
874
|
-
const n =
|
|
882
|
+
function Et(t, r, e) {
|
|
883
|
+
const n = lt();
|
|
875
884
|
return n != null && r.update(() => {
|
|
876
|
-
const i =
|
|
885
|
+
const i = ct(n);
|
|
877
886
|
if (!P(i))
|
|
878
887
|
return;
|
|
879
|
-
const l =
|
|
888
|
+
const l = Yr(i, e);
|
|
880
889
|
if (l != null) {
|
|
881
890
|
l.selectStart();
|
|
882
891
|
const a = r.getElementByKey(l.__key);
|
|
@@ -886,44 +895,44 @@ function yt(t, r, e) {
|
|
|
886
895
|
}
|
|
887
896
|
}), !1;
|
|
888
897
|
}
|
|
889
|
-
const
|
|
890
|
-
function
|
|
891
|
-
const [t] =
|
|
898
|
+
const ie = be("INSERT_IMAGE_COMMAND");
|
|
899
|
+
function Gr() {
|
|
900
|
+
const [t] = te();
|
|
892
901
|
return y(() => {
|
|
893
902
|
if (!t.hasNodes([A]))
|
|
894
903
|
throw new Error("ImagePlugin: ImageNode not registered on editor");
|
|
895
|
-
return
|
|
904
|
+
return et(
|
|
896
905
|
t.registerCommand(
|
|
897
|
-
|
|
906
|
+
ie,
|
|
898
907
|
(r) => {
|
|
899
|
-
const e =
|
|
900
|
-
return
|
|
908
|
+
const e = bt(r);
|
|
909
|
+
return Me([e]), Ot(e.getParentOrThrow()) && nr(e, F).selectEnd(), !0;
|
|
901
910
|
},
|
|
902
|
-
|
|
911
|
+
ve
|
|
903
912
|
)
|
|
904
913
|
);
|
|
905
914
|
}, [t]), null;
|
|
906
915
|
}
|
|
907
|
-
const
|
|
908
|
-
/* @__PURE__ */ o(nr, {}),
|
|
909
|
-
/* @__PURE__ */ o(ir, {}),
|
|
910
|
-
/* @__PURE__ */ o(or, {}),
|
|
911
|
-
/* @__PURE__ */ o(Fr, {}),
|
|
916
|
+
const Jr = () => /* @__PURE__ */ u(U, { children: [
|
|
912
917
|
/* @__PURE__ */ o(ar, {}),
|
|
913
|
-
/* @__PURE__ */ o(
|
|
914
|
-
|
|
918
|
+
/* @__PURE__ */ o(sr, {}),
|
|
919
|
+
/* @__PURE__ */ o(lr, {}),
|
|
920
|
+
/* @__PURE__ */ o(Kr, {}),
|
|
921
|
+
/* @__PURE__ */ o(cr, {}),
|
|
922
|
+
/* @__PURE__ */ o(Gr, {})
|
|
923
|
+
] }), Xr = ({
|
|
915
924
|
state: t
|
|
916
925
|
}) => {
|
|
917
|
-
const [r] =
|
|
926
|
+
const [r] = _(), e = q(!1);
|
|
918
927
|
return y(() => {
|
|
919
928
|
!t || e.current || (e.current = !0, window.queueMicrotask(() => {
|
|
920
929
|
try {
|
|
921
|
-
if (
|
|
922
|
-
t.isEmpty() ?
|
|
930
|
+
if (hr(t)) {
|
|
931
|
+
t.isEmpty() ? ur(r) : r.setEditorState(t);
|
|
923
932
|
return;
|
|
924
933
|
}
|
|
925
|
-
if (typeof t == "string" && !
|
|
926
|
-
|
|
934
|
+
if (typeof t == "string" && !kt(t)) {
|
|
935
|
+
gr(t, r);
|
|
927
936
|
return;
|
|
928
937
|
}
|
|
929
938
|
const n = r.parseEditorState(t);
|
|
@@ -933,7 +942,7 @@ const Kr = () => /* @__PURE__ */ g(U, { children: [
|
|
|
933
942
|
}
|
|
934
943
|
}));
|
|
935
944
|
}, []), null;
|
|
936
|
-
},
|
|
945
|
+
}, Qr = He("div", {
|
|
937
946
|
border: "1px solid $borderDarker",
|
|
938
947
|
borderRadius: "$md",
|
|
939
948
|
position: "relative",
|
|
@@ -970,7 +979,7 @@ const Kr = () => /* @__PURE__ */ g(U, { children: [
|
|
|
970
979
|
}
|
|
971
980
|
}
|
|
972
981
|
]
|
|
973
|
-
}),
|
|
982
|
+
}), Vr = ({
|
|
974
983
|
isLoading: t
|
|
975
984
|
}) => /* @__PURE__ */ o(
|
|
976
985
|
H,
|
|
@@ -982,9 +991,9 @@ const Kr = () => /* @__PURE__ */ g(U, { children: [
|
|
|
982
991
|
right: "1rem",
|
|
983
992
|
display: "flex"
|
|
984
993
|
},
|
|
985
|
-
children: /* @__PURE__ */ o(
|
|
994
|
+
children: /* @__PURE__ */ o(gt, {})
|
|
986
995
|
}
|
|
987
|
-
),
|
|
996
|
+
), Pn = ({
|
|
988
997
|
isLoading: t,
|
|
989
998
|
children: r,
|
|
990
999
|
placeholderText: e,
|
|
@@ -995,29 +1004,29 @@ const Kr = () => /* @__PURE__ */ g(U, { children: [
|
|
|
995
1004
|
content: s,
|
|
996
1005
|
hideBorder: d,
|
|
997
1006
|
onBlur: c,
|
|
998
|
-
defaultState:
|
|
1007
|
+
defaultState: g,
|
|
999
1008
|
css: p,
|
|
1000
|
-
signUrl:
|
|
1009
|
+
signUrl: f
|
|
1001
1010
|
}) => {
|
|
1002
|
-
const { hasFocus: S, attributes: E } =
|
|
1003
|
-
() => ({ hasFocus: S, editorRef: h, signUrl:
|
|
1004
|
-
[S,
|
|
1011
|
+
const { hasFocus: S, attributes: E } = pr({ onBlur: c }), h = q(null), M = jt(
|
|
1012
|
+
() => ({ hasFocus: S, editorRef: h, signUrl: f }),
|
|
1013
|
+
[S, f]
|
|
1005
1014
|
);
|
|
1006
|
-
return /* @__PURE__ */ o(
|
|
1007
|
-
|
|
1015
|
+
return /* @__PURE__ */ o(re.Provider, { value: M, children: /* @__PURE__ */ u(
|
|
1016
|
+
Ge,
|
|
1008
1017
|
{
|
|
1009
1018
|
initialConfig: {
|
|
1010
1019
|
namespace: "ain-rich-text",
|
|
1011
|
-
onError: (
|
|
1012
|
-
console.error(
|
|
1020
|
+
onError: (T) => {
|
|
1021
|
+
console.error(T);
|
|
1013
1022
|
},
|
|
1014
|
-
theme:
|
|
1023
|
+
theme: ft,
|
|
1015
1024
|
nodes: n,
|
|
1016
1025
|
editable: !0
|
|
1017
1026
|
},
|
|
1018
1027
|
children: [
|
|
1019
|
-
/* @__PURE__ */
|
|
1020
|
-
|
|
1028
|
+
/* @__PURE__ */ u(
|
|
1029
|
+
Qr,
|
|
1021
1030
|
{
|
|
1022
1031
|
ref: h,
|
|
1023
1032
|
hasFocus: S,
|
|
@@ -1027,7 +1036,7 @@ const Kr = () => /* @__PURE__ */ g(U, { children: [
|
|
|
1027
1036
|
children: [
|
|
1028
1037
|
l,
|
|
1029
1038
|
/* @__PURE__ */ o(
|
|
1030
|
-
|
|
1039
|
+
Je,
|
|
1031
1040
|
{
|
|
1032
1041
|
contentEditable: s,
|
|
1033
1042
|
placeholder: e ? /* @__PURE__ */ o(
|
|
@@ -1044,22 +1053,22 @@ const Kr = () => /* @__PURE__ */ g(U, { children: [
|
|
|
1044
1053
|
children: e
|
|
1045
1054
|
}
|
|
1046
1055
|
) : null,
|
|
1047
|
-
ErrorBoundary:
|
|
1056
|
+
ErrorBoundary: Xe
|
|
1048
1057
|
}
|
|
1049
1058
|
),
|
|
1050
|
-
/* @__PURE__ */ o(
|
|
1059
|
+
/* @__PURE__ */ o(Jr, {}),
|
|
1051
1060
|
i,
|
|
1052
|
-
/* @__PURE__ */ o(
|
|
1053
|
-
!l && /* @__PURE__ */ o(
|
|
1061
|
+
/* @__PURE__ */ o(Vr, { isLoading: t }),
|
|
1062
|
+
!l && /* @__PURE__ */ o(Wr, { children: a })
|
|
1054
1063
|
]
|
|
1055
1064
|
}
|
|
1056
1065
|
),
|
|
1057
|
-
/* @__PURE__ */ o(
|
|
1066
|
+
/* @__PURE__ */ o(Xr, { state: g }),
|
|
1058
1067
|
/* @__PURE__ */ o(U, { children: r })
|
|
1059
1068
|
]
|
|
1060
1069
|
}
|
|
1061
1070
|
) });
|
|
1062
|
-
},
|
|
1071
|
+
}, Zr = {
|
|
1063
1072
|
fontSize: "1rem",
|
|
1064
1073
|
lineHeight: "1.5",
|
|
1065
1074
|
"h1, h2, h3, h4, h5, h6": {
|
|
@@ -1212,7 +1221,7 @@ const Kr = () => /* @__PURE__ */ g(U, { children: [
|
|
|
1212
1221
|
padding: "0.5em 10px"
|
|
1213
1222
|
},
|
|
1214
1223
|
".ain-rich-text-image": {
|
|
1215
|
-
display: "block",
|
|
1224
|
+
display: "inline-block",
|
|
1216
1225
|
maxWidth: "100%",
|
|
1217
1226
|
height: "auto"
|
|
1218
1227
|
},
|
|
@@ -1253,32 +1262,32 @@ const Kr = () => /* @__PURE__ */ g(U, { children: [
|
|
|
1253
1262
|
defaultVariants: {
|
|
1254
1263
|
size: "md"
|
|
1255
1264
|
}
|
|
1256
|
-
},
|
|
1265
|
+
}, Hn = ir(Zr), tn = ({
|
|
1257
1266
|
uploadFile: t,
|
|
1258
1267
|
...r
|
|
1259
1268
|
}) => {
|
|
1260
|
-
const [e] =
|
|
1269
|
+
const [e] = _(), [n, i] = k(null), l = (s) => {
|
|
1261
1270
|
var c;
|
|
1262
1271
|
const d = (c = s.target.files) == null ? void 0 : c[0];
|
|
1263
1272
|
if (d) {
|
|
1264
|
-
const
|
|
1265
|
-
|
|
1266
|
-
const
|
|
1267
|
-
i({ url:
|
|
1268
|
-
},
|
|
1273
|
+
const g = new Image(), p = window.URL.createObjectURL(d);
|
|
1274
|
+
g.onload = async () => {
|
|
1275
|
+
const f = await t.uploadFile({ file: d });
|
|
1276
|
+
i({ url: f, width: g.naturalWidth, height: g.naturalHeight }), window.URL.revokeObjectURL(p);
|
|
1277
|
+
}, g.src = p;
|
|
1269
1278
|
}
|
|
1270
1279
|
}, a = () => {
|
|
1271
|
-
n && !t.isLoading && (e.dispatchCommand(
|
|
1280
|
+
n && !t.isLoading && (e.dispatchCommand(ie, {
|
|
1272
1281
|
src: n.url,
|
|
1273
1282
|
altText: `Image: ${n.url}`,
|
|
1274
1283
|
meta: { width: n.width, height: n.height }
|
|
1275
1284
|
}), r.onOpenChange(!1));
|
|
1276
1285
|
};
|
|
1277
|
-
return /* @__PURE__ */
|
|
1278
|
-
/* @__PURE__ */ o(
|
|
1279
|
-
t.isLoading && /* @__PURE__ */ o(
|
|
1286
|
+
return /* @__PURE__ */ u(Yt, { ...r, children: [
|
|
1287
|
+
/* @__PURE__ */ o(Fe, { children: "Sett inn bilde" }),
|
|
1288
|
+
t.isLoading && /* @__PURE__ */ o(gt, {}),
|
|
1280
1289
|
/* @__PURE__ */ o(
|
|
1281
|
-
|
|
1290
|
+
pt,
|
|
1282
1291
|
{
|
|
1283
1292
|
type: "file",
|
|
1284
1293
|
accept: "image/png, image/jpeg",
|
|
@@ -1286,7 +1295,7 @@ const Kr = () => /* @__PURE__ */ g(U, { children: [
|
|
|
1286
1295
|
disabled: t.isLoading
|
|
1287
1296
|
}
|
|
1288
1297
|
),
|
|
1289
|
-
/* @__PURE__ */
|
|
1298
|
+
/* @__PURE__ */ u(tt, { children: [
|
|
1290
1299
|
/* @__PURE__ */ o(N, { onClick: () => r.onOpenChange(!1), children: "Avbryt" }),
|
|
1291
1300
|
/* @__PURE__ */ o(
|
|
1292
1301
|
N,
|
|
@@ -1299,35 +1308,35 @@ const Kr = () => /* @__PURE__ */ g(U, { children: [
|
|
|
1299
1308
|
)
|
|
1300
1309
|
] })
|
|
1301
1310
|
] });
|
|
1302
|
-
},
|
|
1303
|
-
const [r] =
|
|
1304
|
-
r.dispatchCommand(
|
|
1311
|
+
}, Fn = ({ uploadFile: t }) => {
|
|
1312
|
+
const [r] = _(), [e, n] = k(!1), i = C(() => {
|
|
1313
|
+
r.dispatchCommand(Ee, {
|
|
1305
1314
|
rows: "3",
|
|
1306
1315
|
columns: "3",
|
|
1307
1316
|
includeHeaders: !1
|
|
1308
1317
|
});
|
|
1309
1318
|
}, [r]);
|
|
1310
|
-
return /* @__PURE__ */
|
|
1311
|
-
/* @__PURE__ */
|
|
1312
|
-
|
|
1319
|
+
return /* @__PURE__ */ u(U, { children: [
|
|
1320
|
+
/* @__PURE__ */ u(
|
|
1321
|
+
Z,
|
|
1313
1322
|
{
|
|
1314
|
-
trigger: /* @__PURE__ */ o(
|
|
1323
|
+
trigger: /* @__PURE__ */ o(ut, { dropdown: !0, children: "Sett inn" }),
|
|
1315
1324
|
side: "bottom",
|
|
1316
1325
|
align: "end",
|
|
1317
1326
|
children: [
|
|
1318
|
-
/* @__PURE__ */
|
|
1319
|
-
/* @__PURE__ */ o(
|
|
1327
|
+
/* @__PURE__ */ u(v, { onClick: i, children: [
|
|
1328
|
+
/* @__PURE__ */ o($r, { size: "1.25rem" }),
|
|
1320
1329
|
" Tabell"
|
|
1321
1330
|
] }),
|
|
1322
|
-
t && /* @__PURE__ */
|
|
1323
|
-
/* @__PURE__ */ o(
|
|
1331
|
+
t && /* @__PURE__ */ u(v, { onClick: () => n(!0), children: [
|
|
1332
|
+
/* @__PURE__ */ o(qe, { size: "1.25rem" }),
|
|
1324
1333
|
" Bilde"
|
|
1325
1334
|
] })
|
|
1326
1335
|
]
|
|
1327
1336
|
}
|
|
1328
1337
|
),
|
|
1329
1338
|
t && /* @__PURE__ */ o(
|
|
1330
|
-
|
|
1339
|
+
tn,
|
|
1331
1340
|
{
|
|
1332
1341
|
open: e,
|
|
1333
1342
|
onOpenChange: n,
|
|
@@ -1336,60 +1345,60 @@ const Kr = () => /* @__PURE__ */ g(U, { children: [
|
|
|
1336
1345
|
)
|
|
1337
1346
|
] });
|
|
1338
1347
|
};
|
|
1339
|
-
function
|
|
1340
|
-
return
|
|
1348
|
+
function en(t) {
|
|
1349
|
+
return m({ 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);
|
|
1341
1350
|
}
|
|
1342
|
-
const
|
|
1343
|
-
const [t] =
|
|
1351
|
+
const Un = () => {
|
|
1352
|
+
const [t] = _(), [r, e] = k(null), { hasFocus: n } = rt();
|
|
1344
1353
|
y(() => {
|
|
1345
1354
|
!n && r && e(null);
|
|
1346
1355
|
}, [n, r]);
|
|
1347
|
-
const { refs: i, floatingStyles: l } =
|
|
1356
|
+
const { refs: i, floatingStyles: l } = mt({
|
|
1348
1357
|
placement: "top-end",
|
|
1349
1358
|
open: !!r,
|
|
1350
1359
|
elements: {
|
|
1351
1360
|
reference: r
|
|
1352
1361
|
},
|
|
1353
|
-
middleware: [
|
|
1362
|
+
middleware: [Jt({ mainAxis: -20, crossAxis: -2 })]
|
|
1354
1363
|
});
|
|
1355
1364
|
y(() => t.registerCommand(
|
|
1356
1365
|
K,
|
|
1357
1366
|
() => {
|
|
1358
1367
|
const s = L();
|
|
1359
1368
|
if (w(s)) {
|
|
1360
|
-
const d = s.anchor.getNode(), c =
|
|
1369
|
+
const d = s.anchor.getNode(), c = Ie(d);
|
|
1361
1370
|
e(c ? t.getElementByKey(c.getKey()) : null);
|
|
1362
1371
|
}
|
|
1363
1372
|
return !1;
|
|
1364
1373
|
},
|
|
1365
|
-
|
|
1374
|
+
Ce
|
|
1366
1375
|
), [t]);
|
|
1367
1376
|
const a = (s) => () => {
|
|
1368
1377
|
t.update(() => {
|
|
1369
1378
|
switch (s) {
|
|
1370
1379
|
case "add-row-over":
|
|
1371
|
-
|
|
1380
|
+
xt(!1);
|
|
1372
1381
|
break;
|
|
1373
1382
|
case "add-row-under":
|
|
1374
|
-
|
|
1383
|
+
xt(!0);
|
|
1375
1384
|
break;
|
|
1376
1385
|
case "add-column-left":
|
|
1377
|
-
|
|
1386
|
+
_t(!1);
|
|
1378
1387
|
break;
|
|
1379
1388
|
case "add-column-right":
|
|
1380
|
-
|
|
1389
|
+
_t(!0);
|
|
1381
1390
|
break;
|
|
1382
1391
|
case "delete-row":
|
|
1383
|
-
|
|
1392
|
+
Oe();
|
|
1384
1393
|
break;
|
|
1385
1394
|
case "delete-column":
|
|
1386
|
-
|
|
1395
|
+
Re();
|
|
1387
1396
|
break;
|
|
1388
1397
|
}
|
|
1389
1398
|
});
|
|
1390
1399
|
};
|
|
1391
|
-
return r ? /* @__PURE__ */
|
|
1392
|
-
|
|
1400
|
+
return r ? /* @__PURE__ */ u(
|
|
1401
|
+
Z,
|
|
1393
1402
|
{
|
|
1394
1403
|
trigger: /* @__PURE__ */ o(
|
|
1395
1404
|
N,
|
|
@@ -1400,32 +1409,32 @@ const Bn = () => {
|
|
|
1400
1409
|
ref: i.setFloating,
|
|
1401
1410
|
style: l,
|
|
1402
1411
|
css: { padding: "2px", width: "18px", height: "18px" },
|
|
1403
|
-
children: /* @__PURE__ */ o(
|
|
1412
|
+
children: /* @__PURE__ */ o(en, {})
|
|
1404
1413
|
}
|
|
1405
1414
|
),
|
|
1406
1415
|
children: [
|
|
1407
1416
|
/* @__PURE__ */ o($, { onClick: a("add-row-over"), children: "Legg til rad over" }),
|
|
1408
1417
|
/* @__PURE__ */ o($, { onClick: a("add-row-under"), children: "Legg til rad under" }),
|
|
1409
|
-
/* @__PURE__ */ o(
|
|
1418
|
+
/* @__PURE__ */ o(Lt, {}),
|
|
1410
1419
|
/* @__PURE__ */ o($, { onClick: a("add-column-left"), children: "Legg til kolonne venstre" }),
|
|
1411
1420
|
/* @__PURE__ */ o($, { onClick: a("add-column-right"), children: "Legg til kolonne høyre" }),
|
|
1412
|
-
/* @__PURE__ */ o(
|
|
1421
|
+
/* @__PURE__ */ o(Lt, {}),
|
|
1413
1422
|
/* @__PURE__ */ o($, { onClick: a("delete-row"), children: "Fjern rad" }),
|
|
1414
1423
|
/* @__PURE__ */ o($, { onClick: a("delete-column"), children: "Fjern kolonne" })
|
|
1415
1424
|
]
|
|
1416
1425
|
}
|
|
1417
1426
|
) : null;
|
|
1418
1427
|
};
|
|
1419
|
-
function
|
|
1428
|
+
function Mt(t) {
|
|
1420
1429
|
let r = t;
|
|
1421
1430
|
const e = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi, n = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
|
|
1422
1431
|
return r = String(r).trim(), r.match(e) || r.match(n) ? r : "https://";
|
|
1423
1432
|
}
|
|
1424
|
-
function
|
|
1433
|
+
function ae(t) {
|
|
1425
1434
|
const r = t.anchor, e = t.focus, n = t.anchor.getNode(), i = t.focus.getNode();
|
|
1426
|
-
return n === i ? n : t.isBackward() ?
|
|
1435
|
+
return n === i ? n : t.isBackward() ? Tt(e) ? n : i : Tt(r) ? n : i;
|
|
1427
1436
|
}
|
|
1428
|
-
const
|
|
1437
|
+
const Wn = (t) => (z.baseURL = t, z), X = class extends B {
|
|
1429
1438
|
static getType() {
|
|
1430
1439
|
return "rutine_link";
|
|
1431
1440
|
}
|
|
@@ -1437,7 +1446,7 @@ const Pn = (t) => (z.baseURL = t, z), X = class extends B {
|
|
|
1437
1446
|
return e.setAttribute("href", this.getURL()), e.setAttribute("target", "_blank"), e.setAttribute("rel", "noopener noreferrer"), e.classList.add("rutine-link"), e;
|
|
1438
1447
|
}
|
|
1439
1448
|
static importJSON(r) {
|
|
1440
|
-
return
|
|
1449
|
+
return le(r.url);
|
|
1441
1450
|
}
|
|
1442
1451
|
exportJSON() {
|
|
1443
1452
|
return {
|
|
@@ -1457,50 +1466,50 @@ const Pn = (t) => (z.baseURL = t, z), X = class extends B {
|
|
|
1457
1466
|
};
|
|
1458
1467
|
let z = X;
|
|
1459
1468
|
R(z, "baseURL", "");
|
|
1460
|
-
function
|
|
1469
|
+
function le(t) {
|
|
1461
1470
|
return new z(t);
|
|
1462
1471
|
}
|
|
1463
|
-
function
|
|
1472
|
+
function rn(t) {
|
|
1464
1473
|
return t instanceof z;
|
|
1465
1474
|
}
|
|
1466
|
-
const
|
|
1467
|
-
const [r] =
|
|
1475
|
+
const nn = ({ onClose: t }) => {
|
|
1476
|
+
const [r] = _(), e = C(
|
|
1468
1477
|
(i) => {
|
|
1469
1478
|
r.update(() => {
|
|
1470
1479
|
const l = L();
|
|
1471
1480
|
if (w(l) && l.isCollapsed()) {
|
|
1472
1481
|
const a = I(i);
|
|
1473
1482
|
l.insertNodes([a]);
|
|
1474
|
-
const s =
|
|
1483
|
+
const s = At();
|
|
1475
1484
|
s.setTextNodeRange(a, 0, a, i.length), Q(s);
|
|
1476
1485
|
}
|
|
1477
|
-
r.dispatchCommand(V,
|
|
1486
|
+
r.dispatchCommand(V, Mt(i));
|
|
1478
1487
|
});
|
|
1479
1488
|
},
|
|
1480
1489
|
[r]
|
|
1481
1490
|
);
|
|
1482
|
-
return /* @__PURE__ */
|
|
1491
|
+
return /* @__PURE__ */ u("form", { onSubmit: (i) => {
|
|
1483
1492
|
e(i.currentTarget.url.value), t();
|
|
1484
1493
|
}, children: [
|
|
1485
|
-
/* @__PURE__ */ o(
|
|
1486
|
-
/* @__PURE__ */
|
|
1494
|
+
/* @__PURE__ */ o(pt, { name: "url", label: "URL", type: "url", required: !0 }),
|
|
1495
|
+
/* @__PURE__ */ u(tt, { children: [
|
|
1487
1496
|
/* @__PURE__ */ o(N, { onClick: t, children: "Avbryt" }),
|
|
1488
1497
|
/* @__PURE__ */ o(N, { type: "submit", variant: "primary", children: "Sett inn" })
|
|
1489
1498
|
] })
|
|
1490
1499
|
] });
|
|
1491
|
-
},
|
|
1500
|
+
}, on = ({
|
|
1492
1501
|
onClose: t,
|
|
1493
1502
|
getDocs: r
|
|
1494
1503
|
}) => {
|
|
1495
|
-
const [e] =
|
|
1504
|
+
const [e] = _(), [n, i] = k([]), l = r(), a = C(
|
|
1496
1505
|
(s) => {
|
|
1497
1506
|
e.update(() => {
|
|
1498
1507
|
const d = L();
|
|
1499
1508
|
if (w(d)) {
|
|
1500
1509
|
const c = [];
|
|
1501
|
-
for (const [
|
|
1502
|
-
const
|
|
1503
|
-
|
|
1510
|
+
for (const [g, p] of s.entries()) {
|
|
1511
|
+
const f = le(p.value);
|
|
1512
|
+
f.append(I(p.label)), c.push(f), g !== s.length - 1 && c.push(I(" "));
|
|
1504
1513
|
}
|
|
1505
1514
|
d.insertNodes(c);
|
|
1506
1515
|
}
|
|
@@ -1508,16 +1517,16 @@ const Zr = ({ onClose: t }) => {
|
|
|
1508
1517
|
},
|
|
1509
1518
|
[e]
|
|
1510
1519
|
);
|
|
1511
|
-
return /* @__PURE__ */
|
|
1520
|
+
return /* @__PURE__ */ u(U, { children: [
|
|
1512
1521
|
/* @__PURE__ */ o(
|
|
1513
|
-
|
|
1522
|
+
We,
|
|
1514
1523
|
{
|
|
1515
1524
|
isMulti: !0,
|
|
1516
1525
|
options: l,
|
|
1517
1526
|
onChange: (s) => i(s)
|
|
1518
1527
|
}
|
|
1519
1528
|
),
|
|
1520
|
-
/* @__PURE__ */
|
|
1529
|
+
/* @__PURE__ */ u(tt, { children: [
|
|
1521
1530
|
/* @__PURE__ */ o(N, { onClick: t, children: "Avbryt" }),
|
|
1522
1531
|
/* @__PURE__ */ o(
|
|
1523
1532
|
N,
|
|
@@ -1531,18 +1540,18 @@ const Zr = ({ onClose: t }) => {
|
|
|
1531
1540
|
)
|
|
1532
1541
|
] })
|
|
1533
1542
|
] });
|
|
1534
|
-
},
|
|
1543
|
+
}, an = ({
|
|
1535
1544
|
onClose: t,
|
|
1536
1545
|
uploadFile: r
|
|
1537
1546
|
}) => {
|
|
1538
|
-
const [e] =
|
|
1547
|
+
const [e] = _(), [n, i] = k(null), l = async (s) => {
|
|
1539
1548
|
var c;
|
|
1540
1549
|
const d = (c = s.target.files) == null ? void 0 : c[0];
|
|
1541
1550
|
if (d) {
|
|
1542
|
-
const
|
|
1551
|
+
const g = await r.uploadFile({ file: d });
|
|
1543
1552
|
i({
|
|
1544
1553
|
name: d.name,
|
|
1545
|
-
url:
|
|
1554
|
+
url: g
|
|
1546
1555
|
});
|
|
1547
1556
|
}
|
|
1548
1557
|
}, a = C(() => {
|
|
@@ -1553,23 +1562,23 @@ const Zr = ({ onClose: t }) => {
|
|
|
1553
1562
|
if (w(s) && s.isCollapsed()) {
|
|
1554
1563
|
const d = I(n.name);
|
|
1555
1564
|
s.insertNodes([d]);
|
|
1556
|
-
const c =
|
|
1565
|
+
const c = At();
|
|
1557
1566
|
c.setTextNodeRange(d, 0, d, n.name.length), Q(c);
|
|
1558
1567
|
}
|
|
1559
|
-
e.dispatchCommand(V,
|
|
1568
|
+
e.dispatchCommand(V, Mt(n.url));
|
|
1560
1569
|
});
|
|
1561
1570
|
}, [e, n]);
|
|
1562
|
-
return /* @__PURE__ */
|
|
1563
|
-
r.isLoading && /* @__PURE__ */ o(
|
|
1571
|
+
return /* @__PURE__ */ u(U, { children: [
|
|
1572
|
+
r.isLoading && /* @__PURE__ */ o(gt, {}),
|
|
1564
1573
|
/* @__PURE__ */ o(
|
|
1565
|
-
|
|
1574
|
+
pt,
|
|
1566
1575
|
{
|
|
1567
1576
|
type: "file",
|
|
1568
1577
|
onChange: l,
|
|
1569
1578
|
disabled: r.isLoading
|
|
1570
1579
|
}
|
|
1571
1580
|
),
|
|
1572
|
-
/* @__PURE__ */
|
|
1581
|
+
/* @__PURE__ */ u(tt, { children: [
|
|
1573
1582
|
/* @__PURE__ */ o(N, { onClick: t, children: "Avbryt" }),
|
|
1574
1583
|
/* @__PURE__ */ o(
|
|
1575
1584
|
N,
|
|
@@ -1584,48 +1593,48 @@ const Zr = ({ onClose: t }) => {
|
|
|
1584
1593
|
)
|
|
1585
1594
|
] })
|
|
1586
1595
|
] });
|
|
1587
|
-
},
|
|
1596
|
+
}, ln = ({
|
|
1588
1597
|
open: t,
|
|
1589
1598
|
onOpenChange: r,
|
|
1590
1599
|
getDocs: e,
|
|
1591
1600
|
uploadFile: n
|
|
1592
1601
|
}) => {
|
|
1593
|
-
const [i, l] =
|
|
1602
|
+
const [i, l] = k("url"), a = () => {
|
|
1594
1603
|
r(!1);
|
|
1595
1604
|
};
|
|
1596
|
-
return /* @__PURE__ */
|
|
1597
|
-
/* @__PURE__ */
|
|
1598
|
-
/* @__PURE__ */ o(
|
|
1605
|
+
return /* @__PURE__ */ u(Yt, { open: t, onOpenChange: r, css: { width: "600px" }, children: [
|
|
1606
|
+
/* @__PURE__ */ u(Ue, { css: { marginBottom: "$8" }, children: [
|
|
1607
|
+
/* @__PURE__ */ o(at, { active: i === "url", onClick: () => l("url"), children: "URL" }),
|
|
1599
1608
|
e && /* @__PURE__ */ o(
|
|
1600
|
-
|
|
1609
|
+
at,
|
|
1601
1610
|
{
|
|
1602
1611
|
active: i === "rutine",
|
|
1603
1612
|
onClick: () => l("rutine"),
|
|
1604
1613
|
children: "Rutine"
|
|
1605
1614
|
}
|
|
1606
1615
|
),
|
|
1607
|
-
n && /* @__PURE__ */ o(
|
|
1616
|
+
n && /* @__PURE__ */ o(at, { active: i === "file", onClick: () => l("file"), children: "Fil" })
|
|
1608
1617
|
] }),
|
|
1609
|
-
i === "url" && /* @__PURE__ */ o(
|
|
1610
|
-
i === "rutine" && e && /* @__PURE__ */ o(
|
|
1611
|
-
i === "file" && n && /* @__PURE__ */ o(
|
|
1618
|
+
i === "url" && /* @__PURE__ */ o(nn, { onClose: a }),
|
|
1619
|
+
i === "rutine" && e && /* @__PURE__ */ o(on, { onClose: a, getDocs: e }),
|
|
1620
|
+
i === "file" && n && /* @__PURE__ */ o(an, { onClose: a, uploadFile: n })
|
|
1612
1621
|
] });
|
|
1613
|
-
},
|
|
1622
|
+
}, jn = ({
|
|
1614
1623
|
getDocs: t,
|
|
1615
1624
|
uploadFile: r
|
|
1616
1625
|
}) => {
|
|
1617
|
-
const [e] =
|
|
1626
|
+
const [e] = _(), [n, i] = k(!1), [l, a] = k(!1), s = C(() => {
|
|
1618
1627
|
const d = L();
|
|
1619
1628
|
if (w(d)) {
|
|
1620
|
-
const c =
|
|
1621
|
-
i(G(
|
|
1629
|
+
const c = ae(d), g = c.getParent();
|
|
1630
|
+
i(G(g) || G(c));
|
|
1622
1631
|
}
|
|
1623
1632
|
}, []);
|
|
1624
1633
|
return y(() => e.registerCommand(
|
|
1625
1634
|
K,
|
|
1626
1635
|
() => (s(), !1),
|
|
1627
|
-
|
|
1628
|
-
), [e, s]), /* @__PURE__ */
|
|
1636
|
+
st
|
|
1637
|
+
), [e, s]), /* @__PURE__ */ u(Kt, { type: "single", value: n ? "link" : "", children: [
|
|
1629
1638
|
/* @__PURE__ */ o(
|
|
1630
1639
|
D,
|
|
1631
1640
|
{
|
|
@@ -1634,11 +1643,11 @@ const Zr = ({ onClose: t }) => {
|
|
|
1634
1643
|
},
|
|
1635
1644
|
title: "Lenke",
|
|
1636
1645
|
value: "link",
|
|
1637
|
-
children: /* @__PURE__ */ o(
|
|
1646
|
+
children: /* @__PURE__ */ o(Er, { size: "1.25rem" })
|
|
1638
1647
|
}
|
|
1639
1648
|
),
|
|
1640
1649
|
/* @__PURE__ */ o(
|
|
1641
|
-
|
|
1650
|
+
ln,
|
|
1642
1651
|
{
|
|
1643
1652
|
open: l,
|
|
1644
1653
|
onOpenChange: a,
|
|
@@ -1647,67 +1656,67 @@ const Zr = ({ onClose: t }) => {
|
|
|
1647
1656
|
}
|
|
1648
1657
|
)
|
|
1649
1658
|
] });
|
|
1650
|
-
},
|
|
1651
|
-
const [t] =
|
|
1659
|
+
}, Kn = () => {
|
|
1660
|
+
const [t] = _(), r = q(null), [e, n] = k(null), [i, l] = k(""), { hasFocus: a } = rt();
|
|
1652
1661
|
y(() => {
|
|
1653
1662
|
e ? t.update(() => {
|
|
1654
1663
|
l(e.getURL());
|
|
1655
1664
|
}) : l("");
|
|
1656
1665
|
}, [t, e]);
|
|
1657
|
-
const s = !!(e && i && a), { refs: d, floatingStyles: c, context:
|
|
1666
|
+
const s = !!(e && i && a), { refs: d, floatingStyles: c, context: g } = mt({
|
|
1658
1667
|
placement: "top",
|
|
1659
1668
|
strategy: "fixed",
|
|
1660
1669
|
open: s,
|
|
1661
|
-
whileElementsMounted:
|
|
1670
|
+
whileElementsMounted: Gt,
|
|
1662
1671
|
elements: {
|
|
1663
1672
|
reference: r.current
|
|
1664
1673
|
},
|
|
1665
|
-
middleware: [
|
|
1666
|
-
}), { getFloatingProps: p } =
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
]),
|
|
1670
|
-
var
|
|
1674
|
+
middleware: [tr()]
|
|
1675
|
+
}), { getFloatingProps: p } = Xt([
|
|
1676
|
+
Qt(g),
|
|
1677
|
+
er(g)
|
|
1678
|
+
]), f = C(() => {
|
|
1679
|
+
var M;
|
|
1671
1680
|
const h = L();
|
|
1672
1681
|
if (w(h)) {
|
|
1673
|
-
const
|
|
1682
|
+
const T = ae(h), b = T.getParent();
|
|
1674
1683
|
let Y = null;
|
|
1675
|
-
if (G(b) ? Y = b : G(
|
|
1676
|
-
const
|
|
1677
|
-
h !== null &&
|
|
1684
|
+
if (G(b) ? Y = b : G(T) && (Y = T), Y) {
|
|
1685
|
+
const nt = window.getSelection(), vt = t.getRootElement();
|
|
1686
|
+
h !== null && nt !== null && vt !== null && vt.contains(nt.anchorNode) && t.isEditable() && (r.current = ((M = nt.focusNode) == null ? void 0 : M.parentElement) ?? null);
|
|
1678
1687
|
}
|
|
1679
1688
|
n(Y);
|
|
1680
1689
|
}
|
|
1681
1690
|
}, [t]), S = C(() => {
|
|
1682
|
-
e &&
|
|
1691
|
+
e && rn(e) && t.update(() => {
|
|
1683
1692
|
e.remove();
|
|
1684
1693
|
}), t.dispatchCommand(V, null);
|
|
1685
1694
|
}, [t, e]);
|
|
1686
1695
|
if (y(() => {
|
|
1687
1696
|
t.getEditorState().read(() => {
|
|
1688
|
-
|
|
1697
|
+
f();
|
|
1689
1698
|
});
|
|
1690
|
-
}, [t,
|
|
1699
|
+
}, [t, f]), y(() => et(
|
|
1691
1700
|
t.registerUpdateListener(({ editorState: h }) => {
|
|
1692
1701
|
h.read(() => {
|
|
1693
|
-
|
|
1702
|
+
f();
|
|
1694
1703
|
});
|
|
1695
1704
|
}),
|
|
1696
1705
|
t.registerCommand(
|
|
1697
1706
|
K,
|
|
1698
|
-
() => (
|
|
1707
|
+
() => (f(), !0),
|
|
1699
1708
|
O
|
|
1700
1709
|
),
|
|
1701
1710
|
t.registerCommand(
|
|
1702
|
-
|
|
1711
|
+
zt,
|
|
1703
1712
|
() => e ? (n(null), !0) : !1,
|
|
1704
|
-
|
|
1713
|
+
Te
|
|
1705
1714
|
)
|
|
1706
|
-
), [t,
|
|
1715
|
+
), [t, f, e]), !s)
|
|
1707
1716
|
return null;
|
|
1708
|
-
const E =
|
|
1709
|
-
return /* @__PURE__ */ o(
|
|
1710
|
-
|
|
1717
|
+
const E = Mt(i);
|
|
1718
|
+
return /* @__PURE__ */ o(Vt, { children: /* @__PURE__ */ u(
|
|
1719
|
+
qt,
|
|
1711
1720
|
{
|
|
1712
1721
|
ref: d.setFloating,
|
|
1713
1722
|
css: {
|
|
@@ -1738,38 +1747,79 @@ const Zr = ({ onClose: t }) => {
|
|
|
1738
1747
|
children: i
|
|
1739
1748
|
}
|
|
1740
1749
|
),
|
|
1741
|
-
/* @__PURE__ */ o(N, { color: "danger", icon: !0, size: "sm", onClick: S, children: /* @__PURE__ */ o(
|
|
1750
|
+
/* @__PURE__ */ o(N, { color: "danger", icon: !0, size: "sm", onClick: S, children: /* @__PURE__ */ o(Ye, { size: 24 }) })
|
|
1742
1751
|
]
|
|
1743
1752
|
}
|
|
1744
1753
|
) });
|
|
1754
|
+
}, qn = () => {
|
|
1755
|
+
const [t] = te();
|
|
1756
|
+
return /* @__PURE__ */ u(
|
|
1757
|
+
Z,
|
|
1758
|
+
{
|
|
1759
|
+
trigger: /* @__PURE__ */ o(ut, { dropdown: !0, children: /* @__PURE__ */ o(yt, { size: "1.25rem" }) }),
|
|
1760
|
+
children: [
|
|
1761
|
+
/* @__PURE__ */ u(
|
|
1762
|
+
v,
|
|
1763
|
+
{
|
|
1764
|
+
onClick: () => t.dispatchCommand(ot, "left"),
|
|
1765
|
+
children: [
|
|
1766
|
+
/* @__PURE__ */ o(yt, { size: "1.25rem" }),
|
|
1767
|
+
"Venstre"
|
|
1768
|
+
]
|
|
1769
|
+
}
|
|
1770
|
+
),
|
|
1771
|
+
/* @__PURE__ */ u(
|
|
1772
|
+
v,
|
|
1773
|
+
{
|
|
1774
|
+
onClick: () => t.dispatchCommand(ot, "center"),
|
|
1775
|
+
children: [
|
|
1776
|
+
/* @__PURE__ */ o(br, { size: "1.25rem" }),
|
|
1777
|
+
"Midt"
|
|
1778
|
+
]
|
|
1779
|
+
}
|
|
1780
|
+
),
|
|
1781
|
+
/* @__PURE__ */ u(
|
|
1782
|
+
v,
|
|
1783
|
+
{
|
|
1784
|
+
onClick: () => t.dispatchCommand(ot, "right"),
|
|
1785
|
+
children: [
|
|
1786
|
+
/* @__PURE__ */ o(Mr, { size: "1.25rem" }),
|
|
1787
|
+
"Høyre"
|
|
1788
|
+
]
|
|
1789
|
+
}
|
|
1790
|
+
)
|
|
1791
|
+
]
|
|
1792
|
+
}
|
|
1793
|
+
);
|
|
1745
1794
|
};
|
|
1746
1795
|
export {
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1796
|
+
bt as $createImageNode,
|
|
1797
|
+
le as $createRutineLinkNode,
|
|
1798
|
+
$n as $isImageNode,
|
|
1799
|
+
rn as $isRutineLinkNode,
|
|
1800
|
+
qn as AlignToolbarDropdown,
|
|
1801
|
+
Wr as FloatingToolbar,
|
|
1752
1802
|
A as ImageNode,
|
|
1753
|
-
|
|
1754
|
-
|
|
1803
|
+
Fn as InsertSelector,
|
|
1804
|
+
Kn as LinkEditPlugin,
|
|
1755
1805
|
J as LinkTargetNode,
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1806
|
+
jn as LinkToolbarButton,
|
|
1807
|
+
Pn as RichTextEditor,
|
|
1808
|
+
jr as RichTextToolbar,
|
|
1759
1809
|
z as RutineLinkNode,
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1810
|
+
Wn as RutineLinkNodeInit,
|
|
1811
|
+
Un as TableEditPlugin,
|
|
1812
|
+
ur as clearEditorState,
|
|
1813
|
+
Dn as defaultNodes,
|
|
1814
|
+
Bn as defaultViewNodes,
|
|
1815
|
+
hr as isEditorState,
|
|
1816
|
+
kt as isJSON,
|
|
1817
|
+
re as richTextContext,
|
|
1818
|
+
Hn as richTextCss,
|
|
1819
|
+
Zr as richTextStyleObj,
|
|
1820
|
+
gr as setStateFromPlainText,
|
|
1821
|
+
zn as stateToHTML,
|
|
1822
|
+
An as syncStateToHTML,
|
|
1823
|
+
pr as useHasFocusWithin,
|
|
1824
|
+
rt as useRichTextContext
|
|
1775
1825
|
};
|