@arkitektbedriftene/fe-lib 4.0.0 → 4.1.0
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/state.d.ts +2 -1
- package/dist/rich-text.es.js +241 -240
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type EditorState, type CreateEditorArgs, type SerializedEditorState, type LexicalEditor } from "lexical";
|
|
1
|
+
import { type EditorState, type CreateEditorArgs, type SerializedEditorState, type LexicalEditor, type LexicalNode, type Klass } from "lexical";
|
|
2
2
|
export declare const isJSON: (str: string) => boolean;
|
|
3
3
|
export declare const isEditorState: (state: unknown) => state is EditorState;
|
|
4
4
|
export declare const clearEditorState: (editor: LexicalEditor, tag?: string) => void;
|
|
@@ -18,3 +18,4 @@ export declare const syncStateToHTML: (state: SerializedEditorState | string | n
|
|
|
18
18
|
html: string;
|
|
19
19
|
trimCount: number;
|
|
20
20
|
};
|
|
21
|
+
export declare const $getNodesOfTypes: <T extends LexicalNode>(klasses: Klass<T>[]) => T[];
|
package/dist/rich-text.es.js
CHANGED
|
@@ -5,28 +5,28 @@ import { createHeadlessEditor as At } from "@lexical/headless";
|
|
|
5
5
|
import { $generateHtmlFromNodes as zt } from "@lexical/html";
|
|
6
6
|
import { $getRoot as K, ParagraphNode as he, $createParagraphNode as U, $createTextNode as I, $setSelection as V, $getNodeByKey as ot, DecoratorNode as ue, $applyNodeReplacement as ge, SELECTION_CHANGE_COMMAND as G, $getSelection as y, COMMAND_PRIORITY_CRITICAL as ct, $isRangeSelection as N, $isRootOrShadowRoot as $t, FORMAT_TEXT_COMMAND as j, COMMAND_PRIORITY_LOW as R, KEY_ARROW_DOWN_COMMAND as pe, KEY_ARROW_UP_COMMAND as me, KEY_ESCAPE_COMMAND as Dt, KEY_SPACE_COMMAND as fe, $getNearestNodeFromDOMNode as dt, KEY_ARROW_LEFT_COMMAND as ke, $isElementNode as be, createCommand as Me, $insertNodes as Ce, COMMAND_PRIORITY_EDITOR as ve, COMMAND_PRIORITY_NORMAL as Te, $createRangeSelection as Bt, COMMAND_PRIORITY_HIGH as _e, FORMAT_ELEMENT_COMMAND as it } from "lexical";
|
|
7
7
|
import { trimTextContentFromAnchor as Le, $setBlocksType as at, $isAtNodeEnd as Lt } from "@lexical/selection";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
import { $dfs as xe, $getNearestNodeOfType as we, $findMatchingParent as Pt, mergeRegister as Z, isHTMLElement as xt, $wrapNodeInElement as ye, mediaFileReader as Ne, isMimeType as Se } from "@lexical/utils";
|
|
9
|
+
import { LinkNode as P, AutoLinkNode as Ft, $isLinkNode as J, TOGGLE_LINK_COMMAND as tt } from "@lexical/link";
|
|
10
|
+
import { ListNode as ht, ListItemNode as Ht, $isListNode as ut, INSERT_UNORDERED_LIST_COMMAND as Ee, INSERT_ORDERED_LIST_COMMAND as Re, INSERT_CHECK_LIST_COMMAND as Ut, insertList as Ie, $isListItemNode as F } from "@lexical/list";
|
|
11
|
+
import { HeadingNode as Wt, QuoteNode as jt, $isHeadingNode as Oe, $createHeadingNode as Ae, $createQuoteNode as ze, DRAG_DROP_PASTE as $e } from "@lexical/rich-text";
|
|
12
|
+
import { TableNode as Kt, TableRowNode as Gt, TableCellNode as Yt, INSERT_TABLE_COMMAND as De, $getTableCellNodeFromLexicalNode as Be, $deleteTableColumn__EXPERIMENTAL as Pe, $deleteTableRow__EXPERIMENTAL as Fe, $insertTableColumn__EXPERIMENTAL as wt, $insertTableRow__EXPERIMENTAL as yt } from "@lexical/table";
|
|
12
13
|
import { jsx as o, jsxs as u, Fragment as W } from "react/jsx-runtime";
|
|
13
|
-
import { createContext as
|
|
14
|
-
import { Box as H, Stack as
|
|
15
|
-
import { f as
|
|
14
|
+
import { createContext as He, useState as b, useRef as Y, useCallback as T, useContext as Ue, useEffect as _, useMemo as qt, useLayoutEffect as We } from "react";
|
|
15
|
+
import { Box as H, Stack as je, Button as L, DropdownMenu as et, ToolbarButton as gt, DropdownMenuIconItem as v, ToolbarToggleGroup as Jt, ToolbarToggleItem as B, OverlayCard as Xt, Toolbar as Ke, ToolbarSeparator as Ge, styled as Ye, Spinner as pt, Dialog as Qt, DialogHeader as qe, TextInput as mt, DialogActions as rt, DropdownMenuItem as D, DropdownMenuSeparator as Nt, NavBar as Je, NavBarItem as lt, Combobox as Xe } from "./ui.es.js";
|
|
16
|
+
import { f as Qe, g as Ve, h as Ze, G as f, i as tr, j as er } from "./index.esm-787a7997.js";
|
|
16
17
|
import { useLexicalComposerContext as x } from "@lexical/react/LexicalComposerContext.js";
|
|
17
|
-
import { LexicalComposer as
|
|
18
|
-
import { RichTextPlugin as
|
|
19
|
-
import
|
|
20
|
-
import { useFloating as ft, autoUpdate as
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import { TabIndentationPlugin as pr } from "@lexical/react/LexicalTabIndentationPlugin.js";
|
|
18
|
+
import { LexicalComposer as rr } from "@lexical/react/LexicalComposer.js";
|
|
19
|
+
import { RichTextPlugin as nr } from "@lexical/react/LexicalRichTextPlugin.js";
|
|
20
|
+
import or from "@lexical/react/LexicalErrorBoundary.js";
|
|
21
|
+
import { useFloating as ft, autoUpdate as Vt, size as ir, flip as ar, offset as Zt, shift as lr, useInteractions as te, useRole as ee, FloatingPortal as re, inline as sr, useDismiss as cr } from "@floating-ui/react";
|
|
22
|
+
import { s as dr, c as hr } from "./stitches.config-00c23cdb.js";
|
|
23
|
+
import { ListPlugin as ur } from "@lexical/react/LexicalListPlugin.js";
|
|
24
|
+
import { HistoryPlugin as gr } from "@lexical/react/LexicalHistoryPlugin.js";
|
|
25
|
+
import { TablePlugin as pr } from "@lexical/react/LexicalTablePlugin.js";
|
|
26
|
+
import { TabIndentationPlugin as mr } from "@lexical/react/LexicalTabIndentationPlugin.js";
|
|
27
27
|
import { useLexicalComposerContext as kt } from "@lexical/react/LexicalComposerContext";
|
|
28
28
|
import "@stitches/react";
|
|
29
|
-
const
|
|
29
|
+
const fr = ({
|
|
30
30
|
text: t,
|
|
31
31
|
maxChars: r,
|
|
32
32
|
maxLines: e
|
|
@@ -46,7 +46,7 @@ const mr = ({
|
|
|
46
46
|
maxChars: r,
|
|
47
47
|
maxLines: e
|
|
48
48
|
}) => {
|
|
49
|
-
const n = K(), i = n.getTextContent(), a =
|
|
49
|
+
const n = K(), i = n.getTextContent(), a = fr({ text: i, maxChars: r, maxLines: e }), l = i.length - a, d = n.select().anchor;
|
|
50
50
|
Le(t, d, l);
|
|
51
51
|
const c = n.getLastChild();
|
|
52
52
|
return c instanceof he && c.getChildrenSize() === 0 && c.remove(), l;
|
|
@@ -62,7 +62,7 @@ const mr = ({
|
|
|
62
62
|
listitem: "ain-rich-text-nested-list-item"
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
}, Mt = (t) => t[0] === "{",
|
|
65
|
+
}, Mt = (t) => t[0] === "{", kr = (t) => t !== null && typeof t == "object" && "isEmpty" in t, br = (t, r) => {
|
|
66
66
|
t.update(
|
|
67
67
|
() => {
|
|
68
68
|
const e = K();
|
|
@@ -74,7 +74,7 @@ const mr = ({
|
|
|
74
74
|
tag: r
|
|
75
75
|
}
|
|
76
76
|
);
|
|
77
|
-
},
|
|
77
|
+
}, Mr = (t, r, e) => {
|
|
78
78
|
r.update(
|
|
79
79
|
() => {
|
|
80
80
|
const n = K();
|
|
@@ -86,7 +86,7 @@ const mr = ({
|
|
|
86
86
|
tag: e
|
|
87
87
|
}
|
|
88
88
|
), r.blur();
|
|
89
|
-
},
|
|
89
|
+
}, Pn = async (t, r, e) => {
|
|
90
90
|
var l;
|
|
91
91
|
let n = 0;
|
|
92
92
|
const i = At({
|
|
@@ -118,7 +118,7 @@ const mr = ({
|
|
|
118
118
|
return i.read(() => {
|
|
119
119
|
a = zt(i);
|
|
120
120
|
}), { html: a, trimCount: n };
|
|
121
|
-
},
|
|
121
|
+
}, Fn = (t, r, e) => {
|
|
122
122
|
let n = 0;
|
|
123
123
|
const i = At({
|
|
124
124
|
nodes: r,
|
|
@@ -152,7 +152,7 @@ const mr = ({
|
|
|
152
152
|
} catch {
|
|
153
153
|
}
|
|
154
154
|
return { html: a, trimCount: n };
|
|
155
|
-
};
|
|
155
|
+
}, Hn = (t) => xe().map(({ node: r }) => r).filter((r) => t.some((e) => r instanceof e));
|
|
156
156
|
class X extends P {
|
|
157
157
|
static getType() {
|
|
158
158
|
return "target-link";
|
|
@@ -181,12 +181,12 @@ class X extends P {
|
|
|
181
181
|
return P.importJSON(r);
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
const oe =
|
|
184
|
+
const oe = He({
|
|
185
185
|
hasFocus: !1,
|
|
186
186
|
editorRef: { current: null },
|
|
187
187
|
signUrl: void 0,
|
|
188
188
|
fileUpload: void 0
|
|
189
|
-
}),
|
|
189
|
+
}), Cr = ({ onBlur: t }) => {
|
|
190
190
|
const [r, e] = b(!1), n = Y(null), i = T(() => {
|
|
191
191
|
e(!0), n.current && window.clearTimeout(n.current);
|
|
192
192
|
}, []), a = T(() => {
|
|
@@ -201,8 +201,8 @@ const oe = $e({
|
|
|
201
201
|
onBlur: a
|
|
202
202
|
}
|
|
203
203
|
};
|
|
204
|
-
}, z = () =>
|
|
205
|
-
function
|
|
204
|
+
}, z = () => Ue(oe);
|
|
205
|
+
function vr({
|
|
206
206
|
src: t,
|
|
207
207
|
altText: r,
|
|
208
208
|
width: e,
|
|
@@ -244,7 +244,7 @@ function Cr({
|
|
|
244
244
|
};
|
|
245
245
|
return l ? /* @__PURE__ */ u(H, { css: { position: "relative", display: "inline-block" }, children: [
|
|
246
246
|
/* @__PURE__ */ u(
|
|
247
|
-
|
|
247
|
+
je,
|
|
248
248
|
{
|
|
249
249
|
css: {
|
|
250
250
|
position: "absolute",
|
|
@@ -266,7 +266,7 @@ function Cr({
|
|
|
266
266
|
css: { width: "20px", height: "20px" },
|
|
267
267
|
onClick: E,
|
|
268
268
|
color: "danger",
|
|
269
|
-
children: /* @__PURE__ */ o(
|
|
269
|
+
children: /* @__PURE__ */ o(Qe, {})
|
|
270
270
|
}
|
|
271
271
|
),
|
|
272
272
|
/* @__PURE__ */ o(
|
|
@@ -276,7 +276,7 @@ function Cr({
|
|
|
276
276
|
size: "sm",
|
|
277
277
|
css: { width: "20px", height: "20px" },
|
|
278
278
|
onClick: S,
|
|
279
|
-
children: /* @__PURE__ */ o(
|
|
279
|
+
children: /* @__PURE__ */ o(Ve, {})
|
|
280
280
|
}
|
|
281
281
|
),
|
|
282
282
|
/* @__PURE__ */ o(
|
|
@@ -286,7 +286,7 @@ function Cr({
|
|
|
286
286
|
size: "sm",
|
|
287
287
|
css: { width: "20px", height: "20px" },
|
|
288
288
|
onClick: M,
|
|
289
|
-
children: /* @__PURE__ */ o(
|
|
289
|
+
children: /* @__PURE__ */ o(Ze, {})
|
|
290
290
|
}
|
|
291
291
|
)
|
|
292
292
|
]
|
|
@@ -309,7 +309,7 @@ function Cr({
|
|
|
309
309
|
)
|
|
310
310
|
] }) : /* @__PURE__ */ o("span", {});
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function Tr(t) {
|
|
313
313
|
const r = t, { alt: e, src: n, width: i, height: a } = r;
|
|
314
314
|
return { node: Ct({ altText: e, height: a, src: n, width: i }) };
|
|
315
315
|
}
|
|
@@ -353,7 +353,7 @@ class $ extends ue {
|
|
|
353
353
|
static importDOM() {
|
|
354
354
|
return {
|
|
355
355
|
img: (e) => ({
|
|
356
|
-
conversion:
|
|
356
|
+
conversion: Tr,
|
|
357
357
|
priority: 0
|
|
358
358
|
})
|
|
359
359
|
};
|
|
@@ -395,7 +395,7 @@ class $ extends ue {
|
|
|
395
395
|
}
|
|
396
396
|
decorate() {
|
|
397
397
|
return /* @__PURE__ */ o(
|
|
398
|
-
|
|
398
|
+
vr,
|
|
399
399
|
{
|
|
400
400
|
src: this.__src,
|
|
401
401
|
altText: this.__altText,
|
|
@@ -418,30 +418,30 @@ function Ct({
|
|
|
418
418
|
new $(e, t, n, r, i, a)
|
|
419
419
|
);
|
|
420
420
|
}
|
|
421
|
-
function
|
|
421
|
+
function Un(t) {
|
|
422
422
|
return t instanceof $;
|
|
423
423
|
}
|
|
424
|
-
const
|
|
425
|
-
Ut,
|
|
424
|
+
const Wn = [
|
|
426
425
|
Wt,
|
|
426
|
+
jt,
|
|
427
427
|
ht,
|
|
428
|
+
Ht,
|
|
428
429
|
Ft,
|
|
429
|
-
Pt,
|
|
430
430
|
P,
|
|
431
|
-
jt,
|
|
432
431
|
Kt,
|
|
433
432
|
Gt,
|
|
433
|
+
Yt,
|
|
434
434
|
$
|
|
435
|
-
],
|
|
436
|
-
Ut,
|
|
435
|
+
], jn = [
|
|
437
436
|
Wt,
|
|
437
|
+
jt,
|
|
438
438
|
ht,
|
|
439
|
+
Ht,
|
|
439
440
|
Ft,
|
|
440
|
-
Pt,
|
|
441
441
|
P,
|
|
442
|
-
jt,
|
|
443
442
|
Kt,
|
|
444
443
|
Gt,
|
|
444
|
+
Yt,
|
|
445
445
|
$,
|
|
446
446
|
X,
|
|
447
447
|
{
|
|
@@ -452,70 +452,70 @@ const Hn = [
|
|
|
452
452
|
)
|
|
453
453
|
}
|
|
454
454
|
];
|
|
455
|
-
function
|
|
455
|
+
function _r(t) {
|
|
456
456
|
return f({ 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);
|
|
457
457
|
}
|
|
458
458
|
function St(t) {
|
|
459
459
|
return f({ 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);
|
|
460
460
|
}
|
|
461
|
-
function
|
|
461
|
+
function Lr(t) {
|
|
462
462
|
return f({ 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);
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function xr(t) {
|
|
465
465
|
return f({ 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);
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function wr(t) {
|
|
468
468
|
return f({ 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);
|
|
469
469
|
}
|
|
470
|
-
function
|
|
470
|
+
function yr(t) {
|
|
471
471
|
return f({ 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);
|
|
472
472
|
}
|
|
473
|
-
function
|
|
473
|
+
function Nr(t) {
|
|
474
474
|
return f({ 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);
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function Sr(t) {
|
|
477
477
|
return f({ 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);
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function Er(t) {
|
|
480
480
|
return f({ 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);
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function Rr(t) {
|
|
483
483
|
return f({ 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);
|
|
484
484
|
}
|
|
485
|
-
function
|
|
485
|
+
function Ir(t) {
|
|
486
486
|
return f({ 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);
|
|
487
487
|
}
|
|
488
|
-
function
|
|
488
|
+
function Or(t) {
|
|
489
489
|
return f({ 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);
|
|
490
490
|
}
|
|
491
|
-
function
|
|
491
|
+
function Ar(t) {
|
|
492
492
|
return f({ 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);
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function zr(t) {
|
|
495
495
|
return f({ 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);
|
|
496
496
|
}
|
|
497
|
-
function
|
|
497
|
+
function $r(t) {
|
|
498
498
|
return f({ 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);
|
|
499
499
|
}
|
|
500
|
-
function
|
|
500
|
+
function Dr(t) {
|
|
501
501
|
return f({ 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);
|
|
502
502
|
}
|
|
503
|
-
function
|
|
503
|
+
function Br(t) {
|
|
504
504
|
return f({ 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);
|
|
505
505
|
}
|
|
506
|
-
function
|
|
506
|
+
function Pr(t) {
|
|
507
507
|
return f({ 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);
|
|
508
508
|
}
|
|
509
|
-
function
|
|
509
|
+
function Fr(t) {
|
|
510
510
|
return f({ 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);
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function Hr(t) {
|
|
513
513
|
return f({ 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);
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function Ur(t) {
|
|
516
516
|
return f({ 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);
|
|
517
517
|
}
|
|
518
|
-
const
|
|
518
|
+
const Wr = dr("div", {
|
|
519
519
|
width: "10rem",
|
|
520
520
|
display: "flex"
|
|
521
521
|
}), ie = {
|
|
@@ -530,22 +530,22 @@ const Ur = cr("div", {
|
|
|
530
530
|
paragraph: "Normal",
|
|
531
531
|
quote: "Sitat",
|
|
532
532
|
check: "Avkrysningsliste"
|
|
533
|
-
},
|
|
534
|
-
bullet: /* @__PURE__ */ o(
|
|
535
|
-
h1: /* @__PURE__ */ o(
|
|
536
|
-
h2: /* @__PURE__ */ o(
|
|
537
|
-
h3: /* @__PURE__ */ o(
|
|
538
|
-
h4: /* @__PURE__ */ o(
|
|
539
|
-
h5: /* @__PURE__ */ o(
|
|
540
|
-
h6: /* @__PURE__ */ o(
|
|
541
|
-
number: /* @__PURE__ */ o(
|
|
542
|
-
check: /* @__PURE__ */ o(
|
|
543
|
-
paragraph: /* @__PURE__ */ o(
|
|
544
|
-
quote: /* @__PURE__ */ o(
|
|
533
|
+
}, jr = {
|
|
534
|
+
bullet: /* @__PURE__ */ o(Br, { size: "1.25rem" }),
|
|
535
|
+
h1: /* @__PURE__ */ o(yr, { size: "1.25rem" }),
|
|
536
|
+
h2: /* @__PURE__ */ o(Nr, { size: "1.25rem" }),
|
|
537
|
+
h3: /* @__PURE__ */ o(Sr, { size: "1.25rem" }),
|
|
538
|
+
h4: /* @__PURE__ */ o(Er, { size: "1.25rem" }),
|
|
539
|
+
h5: /* @__PURE__ */ o(Rr, { size: "1.25rem" }),
|
|
540
|
+
h6: /* @__PURE__ */ o(Ir, { size: "1.25rem" }),
|
|
541
|
+
number: /* @__PURE__ */ o(Dr, { size: "1.25rem" }),
|
|
542
|
+
check: /* @__PURE__ */ o($r, { size: "1.25rem" }),
|
|
543
|
+
paragraph: /* @__PURE__ */ o(Ar, { size: "1.25rem" }),
|
|
544
|
+
quote: /* @__PURE__ */ o(Pr, { size: "1.25rem" })
|
|
545
545
|
}, w = ({
|
|
546
546
|
blockType: t
|
|
547
547
|
}) => /* @__PURE__ */ u(W, { children: [
|
|
548
|
-
/* @__PURE__ */ o(H, { css: { display: "flex", flex: "0 0 auto" }, children:
|
|
548
|
+
/* @__PURE__ */ o(H, { css: { display: "flex", flex: "0 0 auto" }, children: jr[t] }),
|
|
549
549
|
/* @__PURE__ */ o(
|
|
550
550
|
H,
|
|
551
551
|
{
|
|
@@ -558,11 +558,11 @@ const Ur = cr("div", {
|
|
|
558
558
|
children: ie[t]
|
|
559
559
|
}
|
|
560
560
|
)
|
|
561
|
-
] }),
|
|
561
|
+
] }), Kr = (t) => {
|
|
562
562
|
if (!N(t))
|
|
563
563
|
return null;
|
|
564
564
|
const r = t.anchor.getNode();
|
|
565
|
-
let e = r.getKey() === "root" ? r :
|
|
565
|
+
let e = r.getKey() === "root" ? r : Pt(r, (n) => {
|
|
566
566
|
const i = n.getParent();
|
|
567
567
|
return i !== null && $t(i);
|
|
568
568
|
});
|
|
@@ -570,24 +570,24 @@ const Ur = cr("div", {
|
|
|
570
570
|
anchorNode: r,
|
|
571
571
|
element: e
|
|
572
572
|
};
|
|
573
|
-
},
|
|
573
|
+
}, Gr = () => {
|
|
574
574
|
const [t] = x(), [r, e] = b("paragraph");
|
|
575
575
|
_(() => t.registerCommand(
|
|
576
576
|
G,
|
|
577
577
|
() => {
|
|
578
|
-
const c = y(), h =
|
|
578
|
+
const c = y(), h = Kr(c);
|
|
579
579
|
if (!h)
|
|
580
580
|
return !1;
|
|
581
581
|
const { element: g, anchorNode: k } = h, E = g.getKey();
|
|
582
582
|
if (t.getElementByKey(E) !== null)
|
|
583
583
|
if (ut(g)) {
|
|
584
|
-
const M =
|
|
584
|
+
const M = we(
|
|
585
585
|
k,
|
|
586
586
|
ht
|
|
587
587
|
), p = M ? M.getListType() : g.getListType();
|
|
588
588
|
e(p);
|
|
589
589
|
} else {
|
|
590
|
-
const M =
|
|
590
|
+
const M = Oe(g) ? g.getTag() : g.getType();
|
|
591
591
|
M in ie && e(M);
|
|
592
592
|
}
|
|
593
593
|
return !1;
|
|
@@ -597,11 +597,11 @@ const Ur = cr("div", {
|
|
|
597
597
|
const n = (c) => {
|
|
598
598
|
r !== c && t.update(() => {
|
|
599
599
|
const h = y();
|
|
600
|
-
N(h) && (at(h, () =>
|
|
600
|
+
N(h) && (at(h, () => Ae(c)), e(c));
|
|
601
601
|
});
|
|
602
602
|
};
|
|
603
|
-
return /* @__PURE__ */ o(
|
|
604
|
-
|
|
603
|
+
return /* @__PURE__ */ o(Wr, { children: /* @__PURE__ */ u(
|
|
604
|
+
et,
|
|
605
605
|
{
|
|
606
606
|
trigger: /* @__PURE__ */ o(
|
|
607
607
|
gt,
|
|
@@ -627,29 +627,29 @@ const Ur = cr("div", {
|
|
|
627
627
|
/* @__PURE__ */ o(v, { onClick: () => n("h5"), children: /* @__PURE__ */ o(w, { blockType: "h5" }) }),
|
|
628
628
|
/* @__PURE__ */ o(v, { onClick: () => n("h6"), children: /* @__PURE__ */ o(w, { blockType: "h6" }) }),
|
|
629
629
|
/* @__PURE__ */ o(v, { onClick: () => {
|
|
630
|
-
r !== "bullet" && (t.dispatchCommand(
|
|
630
|
+
r !== "bullet" && (t.dispatchCommand(Ee, void 0), e("bullet"));
|
|
631
631
|
}, children: /* @__PURE__ */ o(w, { blockType: "bullet" }) }),
|
|
632
632
|
/* @__PURE__ */ o(v, { onClick: () => {
|
|
633
|
-
r !== "number" && (t.dispatchCommand(
|
|
633
|
+
r !== "number" && (t.dispatchCommand(Re, void 0), e("number"));
|
|
634
634
|
}, children: /* @__PURE__ */ o(w, { blockType: "number" }) }),
|
|
635
635
|
/* @__PURE__ */ o(v, { onClick: () => {
|
|
636
|
-
r !== "check" && (t.dispatchCommand(
|
|
636
|
+
r !== "check" && (t.dispatchCommand(Ut, void 0), e("check"));
|
|
637
637
|
}, children: /* @__PURE__ */ o(w, { blockType: "check" }) }),
|
|
638
638
|
/* @__PURE__ */ o(v, { onClick: () => {
|
|
639
639
|
r !== "quote" && t.update(() => {
|
|
640
640
|
const c = y();
|
|
641
|
-
N(c) && (at(c, () =>
|
|
641
|
+
N(c) && (at(c, () => ze()), e("quote"));
|
|
642
642
|
});
|
|
643
643
|
}, children: /* @__PURE__ */ o(w, { blockType: "quote" }) })
|
|
644
644
|
]
|
|
645
645
|
}
|
|
646
646
|
) });
|
|
647
|
-
},
|
|
647
|
+
}, Yr = () => {
|
|
648
648
|
const [t] = x(), [r, e] = b(!1), [n, i] = b(!1), [a, l] = b(!1), [s, d] = b(!1), [c, h] = b(!1), g = T(() => {
|
|
649
649
|
const m = y();
|
|
650
650
|
N(m) && (e(m.hasFormat("bold")), i(m.hasFormat("italic")), l(m.hasFormat("underline")), d(m.hasFormat("code")), h(m.hasFormat("superscript")));
|
|
651
651
|
}, []);
|
|
652
|
-
_(() =>
|
|
652
|
+
_(() => Z(
|
|
653
653
|
t.registerCommand(
|
|
654
654
|
G,
|
|
655
655
|
() => (g(), !1),
|
|
@@ -676,25 +676,25 @@ const Ur = cr("div", {
|
|
|
676
676
|
), p = T(
|
|
677
677
|
() => t.dispatchCommand(j, "superscript"),
|
|
678
678
|
[t]
|
|
679
|
-
), C =
|
|
679
|
+
), C = qt(() => {
|
|
680
680
|
const m = [];
|
|
681
681
|
return r && m.push("bold"), n && m.push("italic"), a && m.push("underline"), s && m.push("code"), c && m.push("superscript"), m;
|
|
682
682
|
}, [r, n, a, s, c]);
|
|
683
683
|
return /* @__PURE__ */ u(
|
|
684
|
-
|
|
684
|
+
Jt,
|
|
685
685
|
{
|
|
686
686
|
type: "multiple",
|
|
687
687
|
"aria-label": "Tekstformattering",
|
|
688
688
|
value: C,
|
|
689
689
|
children: [
|
|
690
|
-
/* @__PURE__ */ o(B, { onClick: k, title: "Fet tekst", value: "bold", children: /* @__PURE__ */ o(
|
|
690
|
+
/* @__PURE__ */ o(B, { onClick: k, title: "Fet tekst", value: "bold", children: /* @__PURE__ */ o(xr, { size: "1.25rem" }) }),
|
|
691
691
|
/* @__PURE__ */ o(
|
|
692
692
|
B,
|
|
693
693
|
{
|
|
694
694
|
onClick: E,
|
|
695
695
|
title: "Kursiv tekst",
|
|
696
696
|
value: "italic",
|
|
697
|
-
children: /* @__PURE__ */ o(
|
|
697
|
+
children: /* @__PURE__ */ o(Or, { size: "1.25rem" })
|
|
698
698
|
}
|
|
699
699
|
),
|
|
700
700
|
/* @__PURE__ */ o(
|
|
@@ -703,41 +703,41 @@ const Ur = cr("div", {
|
|
|
703
703
|
onClick: S,
|
|
704
704
|
title: "Understreket tekst",
|
|
705
705
|
value: "underline",
|
|
706
|
-
children: /* @__PURE__ */ o(
|
|
706
|
+
children: /* @__PURE__ */ o(Ur, { size: "1.25rem" })
|
|
707
707
|
}
|
|
708
708
|
),
|
|
709
|
-
/* @__PURE__ */ o(B, { onClick: M, title: "Kode", value: "code", children: /* @__PURE__ */ o(
|
|
709
|
+
/* @__PURE__ */ o(B, { onClick: M, title: "Kode", value: "code", children: /* @__PURE__ */ o(wr, { size: "1.25rem" }) }),
|
|
710
710
|
/* @__PURE__ */ o(
|
|
711
711
|
B,
|
|
712
712
|
{
|
|
713
713
|
onClick: p,
|
|
714
714
|
title: "Superscript",
|
|
715
715
|
value: "superscript",
|
|
716
|
-
children: /* @__PURE__ */ o(
|
|
716
|
+
children: /* @__PURE__ */ o(Fr, { size: "1.25rem" })
|
|
717
717
|
}
|
|
718
718
|
)
|
|
719
719
|
]
|
|
720
720
|
}
|
|
721
721
|
);
|
|
722
|
-
},
|
|
722
|
+
}, qr = ({ children: t }) => {
|
|
723
723
|
const { hasFocus: r, editorRef: e } = z(), n = r, [i, a] = b(n);
|
|
724
|
-
|
|
724
|
+
We(() => {
|
|
725
725
|
a(n);
|
|
726
726
|
}, [n]);
|
|
727
727
|
const { context: l, refs: s, floatingStyles: d } = ft({
|
|
728
728
|
placement: "top",
|
|
729
|
-
whileElementsMounted:
|
|
729
|
+
whileElementsMounted: Vt,
|
|
730
730
|
middleware: [
|
|
731
|
-
|
|
731
|
+
ir({
|
|
732
732
|
apply: ({ rects: h, elements: g }) => {
|
|
733
733
|
g.floating.style.minWidth = `${h.reference.width}px`;
|
|
734
734
|
}
|
|
735
735
|
}),
|
|
736
|
-
|
|
737
|
-
|
|
736
|
+
ar(),
|
|
737
|
+
Zt({
|
|
738
738
|
mainAxis: 8
|
|
739
739
|
}),
|
|
740
|
-
|
|
740
|
+
lr({
|
|
741
741
|
padding: 8
|
|
742
742
|
})
|
|
743
743
|
],
|
|
@@ -746,13 +746,13 @@ const Ur = cr("div", {
|
|
|
746
746
|
elements: {
|
|
747
747
|
reference: e.current
|
|
748
748
|
}
|
|
749
|
-
}), { getFloatingProps: c } =
|
|
750
|
-
|
|
749
|
+
}), { getFloatingProps: c } = te([
|
|
750
|
+
ee(l, {
|
|
751
751
|
role: "dialog"
|
|
752
752
|
})
|
|
753
753
|
]);
|
|
754
|
-
return i ? /* @__PURE__ */ o(
|
|
755
|
-
|
|
754
|
+
return i ? /* @__PURE__ */ o(re, { children: /* @__PURE__ */ o(
|
|
755
|
+
Xt,
|
|
756
756
|
{
|
|
757
757
|
ref: s.setFloating,
|
|
758
758
|
style: d,
|
|
@@ -763,24 +763,24 @@ const Ur = cr("div", {
|
|
|
763
763
|
overflow: "hidden",
|
|
764
764
|
boxShadow: "$md"
|
|
765
765
|
},
|
|
766
|
-
children: /* @__PURE__ */ o(
|
|
766
|
+
children: /* @__PURE__ */ o(Jr, { children: t })
|
|
767
767
|
}
|
|
768
768
|
) }) : null;
|
|
769
|
-
},
|
|
769
|
+
}, Jr = ({
|
|
770
770
|
children: t,
|
|
771
771
|
...r
|
|
772
|
-
}) => /* @__PURE__ */ u(
|
|
773
|
-
/* @__PURE__ */ o(Kr, {}),
|
|
774
|
-
/* @__PURE__ */ o(He, {}),
|
|
772
|
+
}) => /* @__PURE__ */ u(Ke, { "aria-label": "Formattering", ...r, children: [
|
|
775
773
|
/* @__PURE__ */ o(Gr, {}),
|
|
774
|
+
/* @__PURE__ */ o(Ge, {}),
|
|
775
|
+
/* @__PURE__ */ o(Yr, {}),
|
|
776
776
|
t
|
|
777
777
|
] });
|
|
778
|
-
function
|
|
778
|
+
function Xr() {
|
|
779
779
|
const [t] = x();
|
|
780
|
-
return _(() =>
|
|
780
|
+
return _(() => Z(
|
|
781
781
|
t.registerCommand(
|
|
782
|
-
|
|
783
|
-
() => (
|
|
782
|
+
Ut,
|
|
783
|
+
() => (Ie(t, "check"), !0),
|
|
784
784
|
R
|
|
785
785
|
),
|
|
786
786
|
t.registerCommand(
|
|
@@ -822,7 +822,7 @@ function Jr() {
|
|
|
822
822
|
if (N(e) && e.isCollapsed()) {
|
|
823
823
|
const { anchor: n } = e, i = n.type === "element";
|
|
824
824
|
if (i || n.offset === 0) {
|
|
825
|
-
const a = n.getNode(), l =
|
|
825
|
+
const a = n.getNode(), l = Pt(
|
|
826
826
|
a,
|
|
827
827
|
(s) => be(s) && !s.isInline()
|
|
828
828
|
);
|
|
@@ -847,10 +847,10 @@ function Jr() {
|
|
|
847
847
|
}
|
|
848
848
|
function ae(t, r) {
|
|
849
849
|
const e = t.target;
|
|
850
|
-
if (e === null || !
|
|
850
|
+
if (e === null || !xt(e))
|
|
851
851
|
return;
|
|
852
852
|
const n = e.firstChild;
|
|
853
|
-
if (n != null &&
|
|
853
|
+
if (n != null && xt(n) && (n.tagName === "UL" || n.tagName === "OL"))
|
|
854
854
|
return;
|
|
855
855
|
const i = e.parentNode;
|
|
856
856
|
if (!i || i.__lexicalListType !== "check")
|
|
@@ -860,7 +860,7 @@ function ae(t, r) {
|
|
|
860
860
|
}
|
|
861
861
|
function Et(t) {
|
|
862
862
|
ae(t, () => {
|
|
863
|
-
const r = t.target, e =
|
|
863
|
+
const r = t.target, e = Qr(r);
|
|
864
864
|
e != null && e.isEditable() && e.update(() => {
|
|
865
865
|
if (t.target) {
|
|
866
866
|
const n = dt(r);
|
|
@@ -874,7 +874,7 @@ function Rt(t) {
|
|
|
874
874
|
t.preventDefault();
|
|
875
875
|
});
|
|
876
876
|
}
|
|
877
|
-
function
|
|
877
|
+
function Qr(t) {
|
|
878
878
|
let r = t;
|
|
879
879
|
for (; r; ) {
|
|
880
880
|
if (r.__lexicalEditor)
|
|
@@ -888,7 +888,7 @@ function st() {
|
|
|
888
888
|
return t != null && t.tagName === "LI" && t.parentNode != null && // @ts-ignore internal field
|
|
889
889
|
t.parentNode.__lexicalListType === "check" ? t : null;
|
|
890
890
|
}
|
|
891
|
-
function
|
|
891
|
+
function Vr(t, r) {
|
|
892
892
|
let e = r ? t.getPreviousSibling() : t.getNextSibling(), n = t;
|
|
893
893
|
for (; e == null && F(n); )
|
|
894
894
|
n = n.getParentOrThrow().getParent(), n != null && (e = r ? n.getPreviousSibling() : n.getNextSibling());
|
|
@@ -906,7 +906,7 @@ function It(t, r, e) {
|
|
|
906
906
|
const i = dt(n);
|
|
907
907
|
if (!F(i))
|
|
908
908
|
return;
|
|
909
|
-
const a =
|
|
909
|
+
const a = Vr(i, e);
|
|
910
910
|
if (a != null) {
|
|
911
911
|
a.selectStart();
|
|
912
912
|
const l = r.getElementByKey(a.__key);
|
|
@@ -917,43 +917,43 @@ function It(t, r, e) {
|
|
|
917
917
|
}), !1;
|
|
918
918
|
}
|
|
919
919
|
const vt = Me("INSERT_IMAGE_COMMAND");
|
|
920
|
-
function
|
|
920
|
+
function Zr() {
|
|
921
921
|
const [t] = kt();
|
|
922
922
|
return _(() => {
|
|
923
923
|
if (!t.hasNodes([$]))
|
|
924
924
|
throw new Error("ImagePlugin: ImageNode not registered on editor");
|
|
925
|
-
return
|
|
925
|
+
return Z(
|
|
926
926
|
t.registerCommand(
|
|
927
927
|
vt,
|
|
928
928
|
(r) => {
|
|
929
929
|
const e = Ct(r);
|
|
930
|
-
return Ce([e]), $t(e.getParentOrThrow()) &&
|
|
930
|
+
return Ce([e]), $t(e.getParentOrThrow()) && ye(e, U).selectEnd(), !0;
|
|
931
931
|
},
|
|
932
932
|
ve
|
|
933
933
|
)
|
|
934
934
|
);
|
|
935
935
|
}, [t]), null;
|
|
936
936
|
}
|
|
937
|
-
const
|
|
938
|
-
/* @__PURE__ */ o(hr, {}),
|
|
939
|
-
/* @__PURE__ */ o(gr, {}),
|
|
937
|
+
const tn = () => /* @__PURE__ */ u(W, { children: [
|
|
940
938
|
/* @__PURE__ */ o(ur, {}),
|
|
941
|
-
/* @__PURE__ */ o(Jr, {}),
|
|
942
939
|
/* @__PURE__ */ o(pr, {}),
|
|
943
|
-
/* @__PURE__ */ o(
|
|
944
|
-
|
|
940
|
+
/* @__PURE__ */ o(gr, {}),
|
|
941
|
+
/* @__PURE__ */ o(Xr, {}),
|
|
942
|
+
/* @__PURE__ */ o(mr, {}),
|
|
943
|
+
/* @__PURE__ */ o(Zr, {})
|
|
944
|
+
] }), en = ({
|
|
945
945
|
state: t
|
|
946
946
|
}) => {
|
|
947
947
|
const [r] = x(), e = Y(!1);
|
|
948
948
|
return _(() => {
|
|
949
949
|
!t || e.current || (e.current = !0, window.queueMicrotask(() => {
|
|
950
950
|
try {
|
|
951
|
-
if (
|
|
952
|
-
t.isEmpty() ?
|
|
951
|
+
if (kr(t)) {
|
|
952
|
+
t.isEmpty() ? br(r) : r.setEditorState(t);
|
|
953
953
|
return;
|
|
954
954
|
}
|
|
955
955
|
if (typeof t == "string" && !Mt(t)) {
|
|
956
|
-
|
|
956
|
+
Mr(t, r);
|
|
957
957
|
return;
|
|
958
958
|
}
|
|
959
959
|
const n = r.parseEditorState(t);
|
|
@@ -963,7 +963,7 @@ const Zr = () => /* @__PURE__ */ u(W, { children: [
|
|
|
963
963
|
}
|
|
964
964
|
}));
|
|
965
965
|
}, []), null;
|
|
966
|
-
},
|
|
966
|
+
}, rn = Ye("div", {
|
|
967
967
|
border: "1px solid $borderDarker",
|
|
968
968
|
borderRadius: "$md",
|
|
969
969
|
position: "relative",
|
|
@@ -1000,7 +1000,7 @@ const Zr = () => /* @__PURE__ */ u(W, { children: [
|
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
1002
1002
|
]
|
|
1003
|
-
}),
|
|
1003
|
+
}), nn = ({
|
|
1004
1004
|
isLoading: t
|
|
1005
1005
|
}) => /* @__PURE__ */ o(
|
|
1006
1006
|
H,
|
|
@@ -1014,7 +1014,7 @@ const Zr = () => /* @__PURE__ */ u(W, { children: [
|
|
|
1014
1014
|
},
|
|
1015
1015
|
children: /* @__PURE__ */ o(pt, {})
|
|
1016
1016
|
}
|
|
1017
|
-
),
|
|
1017
|
+
), Kn = ({
|
|
1018
1018
|
isLoading: t,
|
|
1019
1019
|
children: r,
|
|
1020
1020
|
placeholderText: e,
|
|
@@ -1030,12 +1030,12 @@ const Zr = () => /* @__PURE__ */ u(W, { children: [
|
|
|
1030
1030
|
signUrl: k,
|
|
1031
1031
|
fileUpload: E
|
|
1032
1032
|
}) => {
|
|
1033
|
-
const { hasFocus: S, attributes: M } =
|
|
1033
|
+
const { hasFocus: S, attributes: M } = Cr({ onBlur: c }), p = Y(null), C = qt(
|
|
1034
1034
|
() => ({ hasFocus: S, editorRef: p, signUrl: k, fileUpload: E }),
|
|
1035
1035
|
[S, k, E]
|
|
1036
1036
|
);
|
|
1037
1037
|
return /* @__PURE__ */ o(oe.Provider, { value: C, children: /* @__PURE__ */ u(
|
|
1038
|
-
|
|
1038
|
+
rr,
|
|
1039
1039
|
{
|
|
1040
1040
|
initialConfig: {
|
|
1041
1041
|
namespace: "ain-rich-text",
|
|
@@ -1048,7 +1048,7 @@ const Zr = () => /* @__PURE__ */ u(W, { children: [
|
|
|
1048
1048
|
},
|
|
1049
1049
|
children: [
|
|
1050
1050
|
/* @__PURE__ */ u(
|
|
1051
|
-
|
|
1051
|
+
rn,
|
|
1052
1052
|
{
|
|
1053
1053
|
ref: p,
|
|
1054
1054
|
hasFocus: S,
|
|
@@ -1058,7 +1058,7 @@ const Zr = () => /* @__PURE__ */ u(W, { children: [
|
|
|
1058
1058
|
children: [
|
|
1059
1059
|
a,
|
|
1060
1060
|
/* @__PURE__ */ o(
|
|
1061
|
-
|
|
1061
|
+
nr,
|
|
1062
1062
|
{
|
|
1063
1063
|
contentEditable: s,
|
|
1064
1064
|
placeholder: e ? /* @__PURE__ */ o(
|
|
@@ -1075,22 +1075,22 @@ const Zr = () => /* @__PURE__ */ u(W, { children: [
|
|
|
1075
1075
|
children: e
|
|
1076
1076
|
}
|
|
1077
1077
|
) : null,
|
|
1078
|
-
ErrorBoundary:
|
|
1078
|
+
ErrorBoundary: or
|
|
1079
1079
|
}
|
|
1080
1080
|
),
|
|
1081
|
-
/* @__PURE__ */ o(
|
|
1081
|
+
/* @__PURE__ */ o(tn, {}),
|
|
1082
1082
|
i,
|
|
1083
|
-
/* @__PURE__ */ o(
|
|
1084
|
-
!a && /* @__PURE__ */ o(
|
|
1083
|
+
/* @__PURE__ */ o(nn, { isLoading: t }),
|
|
1084
|
+
!a && /* @__PURE__ */ o(qr, { children: l })
|
|
1085
1085
|
]
|
|
1086
1086
|
}
|
|
1087
1087
|
),
|
|
1088
|
-
/* @__PURE__ */ o(
|
|
1088
|
+
/* @__PURE__ */ o(en, { state: h }),
|
|
1089
1089
|
/* @__PURE__ */ o(W, { children: r })
|
|
1090
1090
|
]
|
|
1091
1091
|
}
|
|
1092
1092
|
) });
|
|
1093
|
-
},
|
|
1093
|
+
}, on = {
|
|
1094
1094
|
fontSize: "1rem",
|
|
1095
1095
|
lineHeight: "1.5",
|
|
1096
1096
|
"h1, h2, h3, h4, h5, h6": {
|
|
@@ -1284,7 +1284,7 @@ const Zr = () => /* @__PURE__ */ u(W, { children: [
|
|
|
1284
1284
|
defaultVariants: {
|
|
1285
1285
|
size: "md"
|
|
1286
1286
|
}
|
|
1287
|
-
},
|
|
1287
|
+
}, Gn = hr(on), an = ({
|
|
1288
1288
|
fileUpload: t,
|
|
1289
1289
|
...r
|
|
1290
1290
|
}) => {
|
|
@@ -1305,8 +1305,8 @@ const Zr = () => /* @__PURE__ */ u(W, { children: [
|
|
|
1305
1305
|
meta: { width: n.width, height: n.height }
|
|
1306
1306
|
}), r.onOpenChange(!1));
|
|
1307
1307
|
};
|
|
1308
|
-
return /* @__PURE__ */ u(
|
|
1309
|
-
/* @__PURE__ */ o(
|
|
1308
|
+
return /* @__PURE__ */ u(Qt, { ...r, children: [
|
|
1309
|
+
/* @__PURE__ */ o(qe, { children: "Sett inn bilde" }),
|
|
1310
1310
|
t.isLoading && /* @__PURE__ */ o(pt, {}),
|
|
1311
1311
|
/* @__PURE__ */ o(
|
|
1312
1312
|
mt,
|
|
@@ -1317,7 +1317,7 @@ const Zr = () => /* @__PURE__ */ u(W, { children: [
|
|
|
1317
1317
|
disabled: t.isLoading
|
|
1318
1318
|
}
|
|
1319
1319
|
),
|
|
1320
|
-
/* @__PURE__ */ u(
|
|
1320
|
+
/* @__PURE__ */ u(rt, { children: [
|
|
1321
1321
|
/* @__PURE__ */ o(L, { onClick: () => r.onOpenChange(!1), children: "Avbryt" }),
|
|
1322
1322
|
/* @__PURE__ */ o(
|
|
1323
1323
|
L,
|
|
@@ -1330,9 +1330,9 @@ const Zr = () => /* @__PURE__ */ u(W, { children: [
|
|
|
1330
1330
|
)
|
|
1331
1331
|
] })
|
|
1332
1332
|
] });
|
|
1333
|
-
},
|
|
1333
|
+
}, Yn = () => {
|
|
1334
1334
|
const [t] = x(), { fileUpload: r } = z(), [e, n] = b(!1), i = T(() => {
|
|
1335
|
-
t.dispatchCommand(
|
|
1335
|
+
t.dispatchCommand(De, {
|
|
1336
1336
|
rows: "3",
|
|
1337
1337
|
columns: "3",
|
|
1338
1338
|
includeHeaders: !1
|
|
@@ -1340,25 +1340,25 @@ const Zr = () => /* @__PURE__ */ u(W, { children: [
|
|
|
1340
1340
|
}, [t]);
|
|
1341
1341
|
return /* @__PURE__ */ u(W, { children: [
|
|
1342
1342
|
/* @__PURE__ */ u(
|
|
1343
|
-
|
|
1343
|
+
et,
|
|
1344
1344
|
{
|
|
1345
1345
|
trigger: /* @__PURE__ */ o(gt, { dropdown: !0, children: "Sett inn" }),
|
|
1346
1346
|
side: "bottom",
|
|
1347
1347
|
align: "end",
|
|
1348
1348
|
children: [
|
|
1349
1349
|
/* @__PURE__ */ u(v, { onClick: i, children: [
|
|
1350
|
-
/* @__PURE__ */ o(
|
|
1350
|
+
/* @__PURE__ */ o(Hr, { size: "1.25rem" }),
|
|
1351
1351
|
" Tabell"
|
|
1352
1352
|
] }),
|
|
1353
1353
|
r && /* @__PURE__ */ u(v, { onClick: () => n(!0), children: [
|
|
1354
|
-
/* @__PURE__ */ o(
|
|
1354
|
+
/* @__PURE__ */ o(tr, { size: "1.25rem" }),
|
|
1355
1355
|
" Bilde"
|
|
1356
1356
|
] })
|
|
1357
1357
|
]
|
|
1358
1358
|
}
|
|
1359
1359
|
),
|
|
1360
1360
|
r && /* @__PURE__ */ o(
|
|
1361
|
-
|
|
1361
|
+
an,
|
|
1362
1362
|
{
|
|
1363
1363
|
open: e,
|
|
1364
1364
|
onOpenChange: n,
|
|
@@ -1367,10 +1367,10 @@ const Zr = () => /* @__PURE__ */ u(W, { children: [
|
|
|
1367
1367
|
)
|
|
1368
1368
|
] });
|
|
1369
1369
|
};
|
|
1370
|
-
function
|
|
1370
|
+
function ln(t) {
|
|
1371
1371
|
return f({ 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);
|
|
1372
1372
|
}
|
|
1373
|
-
const
|
|
1373
|
+
const qn = () => {
|
|
1374
1374
|
const [t] = x(), [r, e] = b(null), { hasFocus: n } = z();
|
|
1375
1375
|
_(() => {
|
|
1376
1376
|
!n && r && e(null);
|
|
@@ -1381,14 +1381,14 @@ const Gn = () => {
|
|
|
1381
1381
|
elements: {
|
|
1382
1382
|
reference: r
|
|
1383
1383
|
},
|
|
1384
|
-
middleware: [
|
|
1384
|
+
middleware: [Zt({ mainAxis: -20, crossAxis: -2 })]
|
|
1385
1385
|
});
|
|
1386
1386
|
_(() => t.registerCommand(
|
|
1387
1387
|
G,
|
|
1388
1388
|
() => {
|
|
1389
1389
|
const s = y();
|
|
1390
1390
|
if (N(s)) {
|
|
1391
|
-
const d = s.anchor.getNode(), c =
|
|
1391
|
+
const d = s.anchor.getNode(), c = Be(d);
|
|
1392
1392
|
e(c ? t.getElementByKey(c.getKey()) : null);
|
|
1393
1393
|
}
|
|
1394
1394
|
return !1;
|
|
@@ -1399,28 +1399,28 @@ const Gn = () => {
|
|
|
1399
1399
|
t.update(() => {
|
|
1400
1400
|
switch (s) {
|
|
1401
1401
|
case "add-row-over":
|
|
1402
|
-
|
|
1402
|
+
yt(!1);
|
|
1403
1403
|
break;
|
|
1404
1404
|
case "add-row-under":
|
|
1405
|
-
|
|
1405
|
+
yt(!0);
|
|
1406
1406
|
break;
|
|
1407
1407
|
case "add-column-left":
|
|
1408
|
-
|
|
1408
|
+
wt(!1);
|
|
1409
1409
|
break;
|
|
1410
1410
|
case "add-column-right":
|
|
1411
|
-
|
|
1411
|
+
wt(!0);
|
|
1412
1412
|
break;
|
|
1413
1413
|
case "delete-row":
|
|
1414
|
-
|
|
1414
|
+
Fe();
|
|
1415
1415
|
break;
|
|
1416
1416
|
case "delete-column":
|
|
1417
|
-
|
|
1417
|
+
Pe();
|
|
1418
1418
|
break;
|
|
1419
1419
|
}
|
|
1420
1420
|
});
|
|
1421
1421
|
};
|
|
1422
1422
|
return r ? /* @__PURE__ */ u(
|
|
1423
|
-
|
|
1423
|
+
et,
|
|
1424
1424
|
{
|
|
1425
1425
|
trigger: /* @__PURE__ */ o(
|
|
1426
1426
|
L,
|
|
@@ -1431,16 +1431,16 @@ const Gn = () => {
|
|
|
1431
1431
|
ref: i.setFloating,
|
|
1432
1432
|
style: a,
|
|
1433
1433
|
css: { padding: "2px", width: "18px", height: "18px" },
|
|
1434
|
-
children: /* @__PURE__ */ o(
|
|
1434
|
+
children: /* @__PURE__ */ o(ln, {})
|
|
1435
1435
|
}
|
|
1436
1436
|
),
|
|
1437
1437
|
children: [
|
|
1438
1438
|
/* @__PURE__ */ o(D, { onClick: l("add-row-over"), children: "Legg til rad over" }),
|
|
1439
1439
|
/* @__PURE__ */ o(D, { onClick: l("add-row-under"), children: "Legg til rad under" }),
|
|
1440
|
-
/* @__PURE__ */ o(
|
|
1440
|
+
/* @__PURE__ */ o(Nt, {}),
|
|
1441
1441
|
/* @__PURE__ */ o(D, { onClick: l("add-column-left"), children: "Legg til kolonne venstre" }),
|
|
1442
1442
|
/* @__PURE__ */ o(D, { onClick: l("add-column-right"), children: "Legg til kolonne høyre" }),
|
|
1443
|
-
/* @__PURE__ */ o(
|
|
1443
|
+
/* @__PURE__ */ o(Nt, {}),
|
|
1444
1444
|
/* @__PURE__ */ o(D, { onClick: l("delete-row"), children: "Fjern rad" }),
|
|
1445
1445
|
/* @__PURE__ */ o(D, { onClick: l("delete-column"), children: "Fjern kolonne" })
|
|
1446
1446
|
]
|
|
@@ -1456,7 +1456,7 @@ function le(t) {
|
|
|
1456
1456
|
const r = t.anchor, e = t.focus, n = t.anchor.getNode(), i = t.focus.getNode();
|
|
1457
1457
|
return n === i ? n : t.isBackward() ? Lt(e) ? n : i : Lt(r) ? n : i;
|
|
1458
1458
|
}
|
|
1459
|
-
const
|
|
1459
|
+
const Jn = (t) => (A.baseURL = t, A), Q = class extends P {
|
|
1460
1460
|
static getType() {
|
|
1461
1461
|
return "rutine_link";
|
|
1462
1462
|
}
|
|
@@ -1491,10 +1491,10 @@ O(A, "baseURL", "");
|
|
|
1491
1491
|
function se(t) {
|
|
1492
1492
|
return new A(t);
|
|
1493
1493
|
}
|
|
1494
|
-
function
|
|
1494
|
+
function sn(t) {
|
|
1495
1495
|
return t instanceof A;
|
|
1496
1496
|
}
|
|
1497
|
-
const
|
|
1497
|
+
const cn = ({ onClose: t }) => {
|
|
1498
1498
|
const [r] = x(), e = T(
|
|
1499
1499
|
(i) => {
|
|
1500
1500
|
r.update(() => {
|
|
@@ -1505,7 +1505,7 @@ const sn = ({ onClose: t }) => {
|
|
|
1505
1505
|
const s = Bt();
|
|
1506
1506
|
s.setTextNodeRange(l, 0, l, i.length), V(s);
|
|
1507
1507
|
}
|
|
1508
|
-
r.dispatchCommand(
|
|
1508
|
+
r.dispatchCommand(tt, Tt(i));
|
|
1509
1509
|
});
|
|
1510
1510
|
},
|
|
1511
1511
|
[r]
|
|
@@ -1514,12 +1514,12 @@ const sn = ({ onClose: t }) => {
|
|
|
1514
1514
|
e(i.currentTarget.url.value), t();
|
|
1515
1515
|
}, children: [
|
|
1516
1516
|
/* @__PURE__ */ o(mt, { name: "url", label: "URL", type: "url", required: !0 }),
|
|
1517
|
-
/* @__PURE__ */ u(
|
|
1517
|
+
/* @__PURE__ */ u(rt, { children: [
|
|
1518
1518
|
/* @__PURE__ */ o(L, { onClick: t, children: "Avbryt" }),
|
|
1519
1519
|
/* @__PURE__ */ o(L, { type: "submit", variant: "primary", children: "Sett inn" })
|
|
1520
1520
|
] })
|
|
1521
1521
|
] });
|
|
1522
|
-
},
|
|
1522
|
+
}, dn = ({
|
|
1523
1523
|
onClose: t,
|
|
1524
1524
|
getDocs: r
|
|
1525
1525
|
}) => {
|
|
@@ -1541,14 +1541,14 @@ const sn = ({ onClose: t }) => {
|
|
|
1541
1541
|
);
|
|
1542
1542
|
return /* @__PURE__ */ u(W, { children: [
|
|
1543
1543
|
/* @__PURE__ */ o(
|
|
1544
|
-
|
|
1544
|
+
Xe,
|
|
1545
1545
|
{
|
|
1546
1546
|
isMulti: !0,
|
|
1547
1547
|
options: a,
|
|
1548
1548
|
onChange: (s) => i(s)
|
|
1549
1549
|
}
|
|
1550
1550
|
),
|
|
1551
|
-
/* @__PURE__ */ u(
|
|
1551
|
+
/* @__PURE__ */ u(rt, { children: [
|
|
1552
1552
|
/* @__PURE__ */ o(L, { onClick: t, children: "Avbryt" }),
|
|
1553
1553
|
/* @__PURE__ */ o(
|
|
1554
1554
|
L,
|
|
@@ -1562,7 +1562,7 @@ const sn = ({ onClose: t }) => {
|
|
|
1562
1562
|
)
|
|
1563
1563
|
] })
|
|
1564
1564
|
] });
|
|
1565
|
-
},
|
|
1565
|
+
}, hn = ({
|
|
1566
1566
|
onClose: t,
|
|
1567
1567
|
fileUpload: r,
|
|
1568
1568
|
filePrefix: e
|
|
@@ -1588,7 +1588,7 @@ const sn = ({ onClose: t }) => {
|
|
|
1588
1588
|
const h = Bt();
|
|
1589
1589
|
h.setTextNodeRange(c, 0, c, i.name.length), V(h);
|
|
1590
1590
|
}
|
|
1591
|
-
n.dispatchCommand(
|
|
1591
|
+
n.dispatchCommand(tt, Tt(i.url));
|
|
1592
1592
|
});
|
|
1593
1593
|
}, [n, i]);
|
|
1594
1594
|
return /* @__PURE__ */ u(W, { children: [
|
|
@@ -1601,7 +1601,7 @@ const sn = ({ onClose: t }) => {
|
|
|
1601
1601
|
disabled: r.isLoading
|
|
1602
1602
|
}
|
|
1603
1603
|
),
|
|
1604
|
-
/* @__PURE__ */ u(
|
|
1604
|
+
/* @__PURE__ */ u(rt, { children: [
|
|
1605
1605
|
/* @__PURE__ */ o(L, { onClick: t, children: "Avbryt" }),
|
|
1606
1606
|
/* @__PURE__ */ o(
|
|
1607
1607
|
L,
|
|
@@ -1616,7 +1616,7 @@ const sn = ({ onClose: t }) => {
|
|
|
1616
1616
|
)
|
|
1617
1617
|
] })
|
|
1618
1618
|
] });
|
|
1619
|
-
},
|
|
1619
|
+
}, un = ({
|
|
1620
1620
|
open: t,
|
|
1621
1621
|
onOpenChange: r,
|
|
1622
1622
|
getDocs: e,
|
|
@@ -1625,8 +1625,8 @@ const sn = ({ onClose: t }) => {
|
|
|
1625
1625
|
const { fileUpload: i } = z(), [a, l] = b("url"), s = () => {
|
|
1626
1626
|
r(!1);
|
|
1627
1627
|
};
|
|
1628
|
-
return /* @__PURE__ */ u(
|
|
1629
|
-
/* @__PURE__ */ u(
|
|
1628
|
+
return /* @__PURE__ */ u(Qt, { open: t, onOpenChange: r, css: { width: "600px" }, children: [
|
|
1629
|
+
/* @__PURE__ */ u(Je, { css: { marginBottom: "$8" }, children: [
|
|
1630
1630
|
/* @__PURE__ */ o(lt, { active: a === "url", onClick: () => l("url"), children: "URL" }),
|
|
1631
1631
|
e && /* @__PURE__ */ o(
|
|
1632
1632
|
lt,
|
|
@@ -1638,10 +1638,10 @@ const sn = ({ onClose: t }) => {
|
|
|
1638
1638
|
),
|
|
1639
1639
|
i && /* @__PURE__ */ o(lt, { active: a === "file", onClick: () => l("file"), children: "Fil" })
|
|
1640
1640
|
] }),
|
|
1641
|
-
a === "url" && /* @__PURE__ */ o(
|
|
1642
|
-
a === "rutine" && e && /* @__PURE__ */ o(
|
|
1641
|
+
a === "url" && /* @__PURE__ */ o(cn, { onClose: s }),
|
|
1642
|
+
a === "rutine" && e && /* @__PURE__ */ o(dn, { onClose: s, getDocs: e }),
|
|
1643
1643
|
a === "file" && i && /* @__PURE__ */ o(
|
|
1644
|
-
|
|
1644
|
+
hn,
|
|
1645
1645
|
{
|
|
1646
1646
|
onClose: s,
|
|
1647
1647
|
fileUpload: i,
|
|
@@ -1649,7 +1649,7 @@ const sn = ({ onClose: t }) => {
|
|
|
1649
1649
|
}
|
|
1650
1650
|
)
|
|
1651
1651
|
] });
|
|
1652
|
-
},
|
|
1652
|
+
}, Xn = ({
|
|
1653
1653
|
getDocs: t,
|
|
1654
1654
|
filePrefix: r
|
|
1655
1655
|
}) => {
|
|
@@ -1664,20 +1664,20 @@ const sn = ({ onClose: t }) => {
|
|
|
1664
1664
|
G,
|
|
1665
1665
|
() => (s(), !1),
|
|
1666
1666
|
ct
|
|
1667
|
-
), [e, s]), /* @__PURE__ */ u(
|
|
1667
|
+
), [e, s]), /* @__PURE__ */ u(Jt, { type: "single", value: n ? "link" : "", children: [
|
|
1668
1668
|
/* @__PURE__ */ o(
|
|
1669
1669
|
B,
|
|
1670
1670
|
{
|
|
1671
1671
|
onClick: () => {
|
|
1672
|
-
n ? e.dispatchCommand(
|
|
1672
|
+
n ? e.dispatchCommand(tt, null) : l(!0);
|
|
1673
1673
|
},
|
|
1674
1674
|
title: "Lenke",
|
|
1675
1675
|
value: "link",
|
|
1676
|
-
children: /* @__PURE__ */ o(
|
|
1676
|
+
children: /* @__PURE__ */ o(zr, { size: "1.25rem" })
|
|
1677
1677
|
}
|
|
1678
1678
|
),
|
|
1679
1679
|
/* @__PURE__ */ o(
|
|
1680
|
-
|
|
1680
|
+
un,
|
|
1681
1681
|
{
|
|
1682
1682
|
open: a,
|
|
1683
1683
|
onOpenChange: l,
|
|
@@ -1686,7 +1686,7 @@ const sn = ({ onClose: t }) => {
|
|
|
1686
1686
|
}
|
|
1687
1687
|
)
|
|
1688
1688
|
] });
|
|
1689
|
-
},
|
|
1689
|
+
}, Qn = () => {
|
|
1690
1690
|
const [t] = x(), r = Y(null), [e, n] = b(null), [i, a] = b(""), { hasFocus: l } = z();
|
|
1691
1691
|
_(() => {
|
|
1692
1692
|
e ? t.update(() => {
|
|
@@ -1697,14 +1697,14 @@ const sn = ({ onClose: t }) => {
|
|
|
1697
1697
|
placement: "top",
|
|
1698
1698
|
strategy: "fixed",
|
|
1699
1699
|
open: s,
|
|
1700
|
-
whileElementsMounted:
|
|
1700
|
+
whileElementsMounted: Vt,
|
|
1701
1701
|
elements: {
|
|
1702
1702
|
reference: r.current
|
|
1703
1703
|
},
|
|
1704
|
-
middleware: [
|
|
1705
|
-
}), { getFloatingProps: g } =
|
|
1706
|
-
|
|
1707
|
-
|
|
1704
|
+
middleware: [sr()]
|
|
1705
|
+
}), { getFloatingProps: g } = te([
|
|
1706
|
+
ee(h),
|
|
1707
|
+
cr(h)
|
|
1708
1708
|
]), k = T(() => {
|
|
1709
1709
|
var p;
|
|
1710
1710
|
const M = y();
|
|
@@ -1718,15 +1718,15 @@ const sn = ({ onClose: t }) => {
|
|
|
1718
1718
|
n(q);
|
|
1719
1719
|
}
|
|
1720
1720
|
}, [t]), E = T(() => {
|
|
1721
|
-
e &&
|
|
1721
|
+
e && sn(e) && t.update(() => {
|
|
1722
1722
|
e.remove();
|
|
1723
|
-
}), t.dispatchCommand(
|
|
1723
|
+
}), t.dispatchCommand(tt, null);
|
|
1724
1724
|
}, [t, e]);
|
|
1725
1725
|
if (_(() => {
|
|
1726
1726
|
t.getEditorState().read(() => {
|
|
1727
1727
|
k();
|
|
1728
1728
|
});
|
|
1729
|
-
}, [t, k]), _(() =>
|
|
1729
|
+
}, [t, k]), _(() => Z(
|
|
1730
1730
|
t.registerUpdateListener(({ editorState: M }) => {
|
|
1731
1731
|
M.read(() => {
|
|
1732
1732
|
k();
|
|
@@ -1745,8 +1745,8 @@ const sn = ({ onClose: t }) => {
|
|
|
1745
1745
|
), [t, k, e]), !s)
|
|
1746
1746
|
return null;
|
|
1747
1747
|
const S = Tt(i);
|
|
1748
|
-
return /* @__PURE__ */ o(
|
|
1749
|
-
|
|
1748
|
+
return /* @__PURE__ */ o(re, { children: /* @__PURE__ */ u(
|
|
1749
|
+
Xt,
|
|
1750
1750
|
{
|
|
1751
1751
|
ref: d.setFloating,
|
|
1752
1752
|
css: {
|
|
@@ -1777,14 +1777,14 @@ const sn = ({ onClose: t }) => {
|
|
|
1777
1777
|
children: i
|
|
1778
1778
|
}
|
|
1779
1779
|
),
|
|
1780
|
-
/* @__PURE__ */ o(L, { color: "danger", icon: !0, size: "sm", onClick: E, children: /* @__PURE__ */ o(
|
|
1780
|
+
/* @__PURE__ */ o(L, { color: "danger", icon: !0, size: "sm", onClick: E, children: /* @__PURE__ */ o(er, { size: 24 }) })
|
|
1781
1781
|
]
|
|
1782
1782
|
}
|
|
1783
1783
|
) });
|
|
1784
|
-
},
|
|
1784
|
+
}, Vn = () => {
|
|
1785
1785
|
const [t] = kt();
|
|
1786
1786
|
return /* @__PURE__ */ u(
|
|
1787
|
-
|
|
1787
|
+
et,
|
|
1788
1788
|
{
|
|
1789
1789
|
align: "end",
|
|
1790
1790
|
trigger: /* @__PURE__ */ o(gt, { dropdown: !0, children: /* @__PURE__ */ o(St, { size: "1.25rem" }) }),
|
|
@@ -1804,7 +1804,7 @@ const sn = ({ onClose: t }) => {
|
|
|
1804
1804
|
{
|
|
1805
1805
|
onClick: () => t.dispatchCommand(it, "center"),
|
|
1806
1806
|
children: [
|
|
1807
|
-
/* @__PURE__ */ o(
|
|
1807
|
+
/* @__PURE__ */ o(_r, { size: "1.25rem" }),
|
|
1808
1808
|
"Midt"
|
|
1809
1809
|
]
|
|
1810
1810
|
}
|
|
@@ -1814,7 +1814,7 @@ const sn = ({ onClose: t }) => {
|
|
|
1814
1814
|
{
|
|
1815
1815
|
onClick: () => t.dispatchCommand(it, "right"),
|
|
1816
1816
|
children: [
|
|
1817
|
-
/* @__PURE__ */ o(
|
|
1817
|
+
/* @__PURE__ */ o(Lr, { size: "1.25rem" }),
|
|
1818
1818
|
"Høyre"
|
|
1819
1819
|
]
|
|
1820
1820
|
}
|
|
@@ -1822,17 +1822,17 @@ const sn = ({ onClose: t }) => {
|
|
|
1822
1822
|
]
|
|
1823
1823
|
}
|
|
1824
1824
|
);
|
|
1825
|
-
}, Ot = ["image/"],
|
|
1825
|
+
}, Ot = ["image/"], Zn = () => {
|
|
1826
1826
|
const [t] = kt(), { fileUpload: r } = z();
|
|
1827
1827
|
return _(() => t.registerCommand(
|
|
1828
|
-
|
|
1828
|
+
$e,
|
|
1829
1829
|
(e) => ((async () => {
|
|
1830
|
-
const n = await
|
|
1830
|
+
const n = await Ne(
|
|
1831
1831
|
e,
|
|
1832
1832
|
[Ot].flatMap((i) => i)
|
|
1833
1833
|
);
|
|
1834
1834
|
for (const { file: i, result: a } of n)
|
|
1835
|
-
if (
|
|
1835
|
+
if (Se(i, Ot)) {
|
|
1836
1836
|
let l = a;
|
|
1837
1837
|
const s = new Image(), d = window.URL.createObjectURL(i);
|
|
1838
1838
|
s.onload = async () => {
|
|
@@ -1850,32 +1850,33 @@ const sn = ({ onClose: t }) => {
|
|
|
1850
1850
|
export {
|
|
1851
1851
|
Ct as $createImageNode,
|
|
1852
1852
|
se as $createRutineLinkNode,
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1853
|
+
Hn as $getNodesOfTypes,
|
|
1854
|
+
Un as $isImageNode,
|
|
1855
|
+
sn as $isRutineLinkNode,
|
|
1856
|
+
Vn as AlignToolbarDropdown,
|
|
1857
|
+
Zn as DragDropPastePlugin,
|
|
1858
|
+
qr as FloatingToolbar,
|
|
1858
1859
|
$ as ImageNode,
|
|
1859
|
-
|
|
1860
|
-
|
|
1860
|
+
Yn as InsertSelector,
|
|
1861
|
+
Qn as LinkEditPlugin,
|
|
1861
1862
|
X as LinkTargetNode,
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1863
|
+
Xn as LinkToolbarButton,
|
|
1864
|
+
Kn as RichTextEditor,
|
|
1865
|
+
Jr as RichTextToolbar,
|
|
1865
1866
|
A as RutineLinkNode,
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1867
|
+
Jn as RutineLinkNodeInit,
|
|
1868
|
+
qn as TableEditPlugin,
|
|
1869
|
+
br as clearEditorState,
|
|
1870
|
+
Wn as defaultNodes,
|
|
1871
|
+
jn as defaultViewNodes,
|
|
1872
|
+
kr as isEditorState,
|
|
1872
1873
|
Mt as isJSON,
|
|
1873
1874
|
oe as richTextContext,
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1875
|
+
Gn as richTextCss,
|
|
1876
|
+
on as richTextStyleObj,
|
|
1877
|
+
Mr as setStateFromPlainText,
|
|
1878
|
+
Pn as stateToHTML,
|
|
1879
|
+
Fn as syncStateToHTML,
|
|
1880
|
+
Cr as useHasFocusWithin,
|
|
1880
1881
|
z as useRichTextContext
|
|
1881
1882
|
};
|