@arkitektbedriftene/fe-lib 4.2.2 → 4.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/icons.es.js +1 -1
- package/dist/{index.esm-787a7997.js → index.esm-fa9e6ea7.js} +68 -60
- package/dist/rich-text/styles.d.ts +3 -0
- package/dist/rich-text.es.js +829 -712
- package/dist/ui.es.js +1 -1
- package/package.json +1 -1
package/dist/rich-text.es.js
CHANGED
|
@@ -1,109 +1,110 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { createHeadlessEditor as
|
|
5
|
-
import { $generateHtmlFromNodes as
|
|
6
|
-
import { $getRoot as
|
|
7
|
-
import { trimTextContentFromAnchor as
|
|
8
|
-
import { $dfs as
|
|
9
|
-
import { LinkNode as
|
|
10
|
-
import { ListNode as
|
|
11
|
-
import { HeadingNode as
|
|
12
|
-
import { TableNode as
|
|
13
|
-
import { jsx as
|
|
14
|
-
import { createContext as
|
|
15
|
-
import { Box as
|
|
16
|
-
import { f as
|
|
1
|
+
var Ce = Object.defineProperty;
|
|
2
|
+
var Me = (t, r, e) => r in t ? Ce(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
|
|
3
|
+
var $ = (t, r, e) => (Me(t, typeof r != "symbol" ? r + "" : r, e), e);
|
|
4
|
+
import { createHeadlessEditor as Bt } from "@lexical/headless";
|
|
5
|
+
import { $generateHtmlFromNodes as Pt } from "@lexical/html";
|
|
6
|
+
import { $getRoot as Y, ParagraphNode as Te, $createParagraphNode as G, $createTextNode as z, $setSelection as nt, $getNodeByKey as ct, DecoratorNode as xe, $applyNodeReplacement as Le, SELECTION_CHANGE_COMMAND as X, $getSelection as L, COMMAND_PRIORITY_EDITOR as q, $isRangeSelection as N, $isRootOrShadowRoot as Ft, FORMAT_TEXT_COMMAND as A, COMMAND_PRIORITY_LOW as D, KEY_ARROW_DOWN_COMMAND as _e, KEY_ARROW_UP_COMMAND as we, KEY_ESCAPE_COMMAND as Ht, KEY_SPACE_COMMAND as ye, $getNearestNodeFromDOMNode as pt, KEY_ARROW_LEFT_COMMAND as Se, $isElementNode as Ne, createCommand as Ee, $insertNodes as Re, $createRangeSelection as Ut, COMMAND_PRIORITY_HIGH as Ie, FORMAT_ELEMENT_COMMAND as dt } from "lexical";
|
|
7
|
+
import { trimTextContentFromAnchor as Oe, $setBlocksType as ht, $getSelectionStyleValueForProperty as ze, $patchStyleText as $e, $isAtNodeEnd as yt } from "@lexical/selection";
|
|
8
|
+
import { $dfs as Ae, $getNearestNodeOfType as De, $findMatchingParent as Wt, mergeRegister as ot, isHTMLElement as St, $wrapNodeInElement as Be, mediaFileReader as Pe, isMimeType as Fe } from "@lexical/utils";
|
|
9
|
+
import { LinkNode as j, AutoLinkNode as jt, $isLinkNode as Z, TOGGLE_LINK_COMMAND as it } from "@lexical/link";
|
|
10
|
+
import { ListNode as mt, ListItemNode as Kt, $isListNode as ft, INSERT_UNORDERED_LIST_COMMAND as He, INSERT_ORDERED_LIST_COMMAND as Ue, INSERT_CHECK_LIST_COMMAND as Gt, insertList as We, $isListItemNode as K } from "@lexical/list";
|
|
11
|
+
import { HeadingNode as qt, QuoteNode as Jt, $isHeadingNode as je, $createHeadingNode as Ke, $createQuoteNode as Ge, DRAG_DROP_PASTE as qe } from "@lexical/rich-text";
|
|
12
|
+
import { TableNode as Yt, TableRowNode as Xt, TableCellNode as Vt, INSERT_TABLE_COMMAND as Je, $getTableCellNodeFromLexicalNode as Ye, $deleteTableColumn__EXPERIMENTAL as Xe, $deleteTableRow__EXPERIMENTAL as Ve, $insertTableColumn__EXPERIMENTAL as Nt, $insertTableRow__EXPERIMENTAL as Et } from "@lexical/table";
|
|
13
|
+
import { jsx as n, jsxs as h, Fragment as F } from "react/jsx-runtime";
|
|
14
|
+
import { createContext as Qe, useState as m, useRef as V, useCallback as M, useContext as Ze, useEffect as _, useMemo as Qt, useLayoutEffect as tr } from "react";
|
|
15
|
+
import { Box as P, Stack as er, Button as w, DropdownMenu as at, ToolbarButton as lt, DropdownMenuIconItem as T, ToolbarToggleGroup as tt, ToolbarToggleItem as O, Popover as Zt, PopoverTrigger as te, PopoverContent as ee, OverlayCard as re, Toolbar as rr, ToolbarSeparator as Rt, styled as nr, Spinner as kt, Dialog as ne, DialogHeader as or, TextInput as bt, DialogActions as st, DropdownMenuItem as W, DropdownMenuSeparator as It, NavBar as ir, NavBarItem as ut, Combobox as ar } from "./ui.es.js";
|
|
16
|
+
import { f as lr, g as sr, h as cr, G as f, i as dr, j as hr, k as ur, l as gr } from "./index.esm-fa9e6ea7.js";
|
|
17
17
|
import { useLexicalComposerContext as x } from "@lexical/react/LexicalComposerContext.js";
|
|
18
|
-
import { LexicalComposer as
|
|
19
|
-
import { RichTextPlugin as
|
|
20
|
-
import { LexicalErrorBoundary as
|
|
21
|
-
import { useFloating 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
|
|
18
|
+
import { LexicalComposer as pr } from "@lexical/react/LexicalComposer.js";
|
|
19
|
+
import { RichTextPlugin as mr } from "@lexical/react/LexicalRichTextPlugin.js";
|
|
20
|
+
import { LexicalErrorBoundary as fr } from "@lexical/react/LexicalErrorBoundary.js";
|
|
21
|
+
import { useFloating as vt, autoUpdate as oe, size as kr, flip as br, offset as ie, shift as vr, useInteractions as ae, useRole as le, FloatingPortal as se, inline as Cr, useDismiss as Mr } from "@floating-ui/react";
|
|
22
|
+
import { s as Tr, c as xr } from "./stitches.config-00c23cdb.js";
|
|
23
|
+
import { ListPlugin as Lr } from "@lexical/react/LexicalListPlugin.js";
|
|
24
|
+
import { HistoryPlugin as _r } from "@lexical/react/LexicalHistoryPlugin.js";
|
|
25
|
+
import { TablePlugin as wr } from "@lexical/react/LexicalTablePlugin.js";
|
|
26
|
+
import { TabIndentationPlugin as yr } from "@lexical/react/LexicalTabIndentationPlugin.js";
|
|
27
|
+
import { useLexicalComposerContext as Ct } from "@lexical/react/LexicalComposerContext";
|
|
28
28
|
import "@stitches/react";
|
|
29
|
-
const
|
|
29
|
+
const Sr = ({
|
|
30
30
|
text: t,
|
|
31
31
|
maxChars: r,
|
|
32
32
|
maxLines: e
|
|
33
33
|
}) => {
|
|
34
34
|
if (t.length === 0)
|
|
35
35
|
return 0;
|
|
36
|
-
const
|
|
37
|
-
if (!
|
|
36
|
+
const o = typeof e == "number", i = typeof r == "number";
|
|
37
|
+
if (!o && !i)
|
|
38
38
|
return t.length;
|
|
39
39
|
let a = 0, l = 0;
|
|
40
|
-
for (; l < t.length && (!
|
|
40
|
+
for (; l < t.length && (!o || a < e) && (!i || l < r); )
|
|
41
41
|
t[l] === `
|
|
42
42
|
` && a++, l++;
|
|
43
43
|
return t.slice(0, l).length;
|
|
44
|
-
},
|
|
44
|
+
}, ce = ({
|
|
45
45
|
editor: t,
|
|
46
46
|
maxChars: r,
|
|
47
47
|
maxLines: e
|
|
48
48
|
}) => {
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
const c =
|
|
52
|
-
return c instanceof
|
|
53
|
-
},
|
|
49
|
+
const o = Y(), i = o.getTextContent(), a = Sr({ text: i, maxChars: r, maxLines: e }), l = i.length - a, d = o.select().anchor;
|
|
50
|
+
Oe(t, d, l);
|
|
51
|
+
const c = o.getLastChild();
|
|
52
|
+
return c instanceof Te && c.getChildrenSize() === 0 && c.remove(), l;
|
|
53
|
+
}, Mt = {
|
|
54
54
|
quote: "ain-rich-text-quote",
|
|
55
55
|
text: {
|
|
56
56
|
bold: "ain-rich-text-bold",
|
|
57
57
|
italic: "ain-rich-text-italic",
|
|
58
|
-
underline: "ain-rich-text-underline"
|
|
58
|
+
underline: "ain-rich-text-underline",
|
|
59
|
+
strikethrough: "ain-rich-text-strikethrough"
|
|
59
60
|
},
|
|
60
61
|
list: {
|
|
61
62
|
nested: {
|
|
62
63
|
listitem: "ain-rich-text-nested-list-item"
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
|
-
},
|
|
66
|
+
}, Tt = (t) => t[0] === "{", Nr = (t) => t !== null && typeof t == "object" && "isEmpty" in t, Er = (t, r) => {
|
|
66
67
|
t.update(
|
|
67
68
|
() => {
|
|
68
|
-
const e =
|
|
69
|
+
const e = Y();
|
|
69
70
|
e.clear();
|
|
70
|
-
const
|
|
71
|
-
|
|
71
|
+
const o = G();
|
|
72
|
+
o.append(z("")), e.append(o), nt(null);
|
|
72
73
|
},
|
|
73
74
|
{
|
|
74
75
|
tag: r
|
|
75
76
|
}
|
|
76
77
|
);
|
|
77
|
-
},
|
|
78
|
+
}, Rr = (t, r, e) => {
|
|
78
79
|
r.update(
|
|
79
80
|
() => {
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
const i =
|
|
83
|
-
i.append(
|
|
81
|
+
const o = Y();
|
|
82
|
+
o.clear();
|
|
83
|
+
const i = G();
|
|
84
|
+
i.append(z(t.trim())), o.append(i), nt(null);
|
|
84
85
|
},
|
|
85
86
|
{
|
|
86
87
|
tag: e
|
|
87
88
|
}
|
|
88
89
|
), r.blur();
|
|
89
|
-
},
|
|
90
|
+
}, ro = async (t, r, e) => {
|
|
90
91
|
var l;
|
|
91
|
-
let
|
|
92
|
-
const i =
|
|
92
|
+
let o = 0;
|
|
93
|
+
const i = Bt({
|
|
93
94
|
nodes: r,
|
|
94
95
|
editable: !1,
|
|
95
|
-
theme:
|
|
96
|
+
theme: Mt
|
|
96
97
|
});
|
|
97
98
|
if (t)
|
|
98
99
|
try {
|
|
99
|
-
if (typeof t == "string" && !
|
|
100
|
+
if (typeof t == "string" && !Tt(t))
|
|
100
101
|
i.update(() => {
|
|
101
|
-
const s =
|
|
102
|
-
d.append(
|
|
102
|
+
const s = Y(), d = G();
|
|
103
|
+
d.append(z(t.trim())), s.append(d);
|
|
103
104
|
});
|
|
104
105
|
else {
|
|
105
106
|
const s = i.parseEditorState(t, () => {
|
|
106
|
-
(e == null ? void 0 : e.maxLines) !== void 0 && (
|
|
107
|
+
(e == null ? void 0 : e.maxLines) !== void 0 && (o = ce({
|
|
107
108
|
editor: i,
|
|
108
109
|
maxLines: e.maxLines
|
|
109
110
|
}));
|
|
@@ -116,25 +117,25 @@ const fr = ({
|
|
|
116
117
|
await ((l = e == null ? void 0 : e.updateFn) == null ? void 0 : l.call(e, i));
|
|
117
118
|
let a = "";
|
|
118
119
|
return i.read(() => {
|
|
119
|
-
a =
|
|
120
|
-
}), { html: a, trimCount:
|
|
121
|
-
},
|
|
122
|
-
let
|
|
123
|
-
const i =
|
|
120
|
+
a = Pt(i);
|
|
121
|
+
}), { html: a, trimCount: o };
|
|
122
|
+
}, no = (t, r, e) => {
|
|
123
|
+
let o = 0;
|
|
124
|
+
const i = Bt({
|
|
124
125
|
nodes: r,
|
|
125
126
|
editable: !1,
|
|
126
|
-
theme:
|
|
127
|
+
theme: Mt
|
|
127
128
|
});
|
|
128
129
|
if (t)
|
|
129
130
|
try {
|
|
130
|
-
if (typeof t == "string" && !
|
|
131
|
+
if (typeof t == "string" && !Tt(t))
|
|
131
132
|
i.update(() => {
|
|
132
|
-
const l =
|
|
133
|
-
s.append(
|
|
133
|
+
const l = Y(), s = G();
|
|
134
|
+
s.append(z(t.trim())), l.append(s);
|
|
134
135
|
});
|
|
135
136
|
else {
|
|
136
137
|
const l = i.parseEditorState(t, () => {
|
|
137
|
-
(e == null ? void 0 : e.maxLines) !== void 0 && (
|
|
138
|
+
(e == null ? void 0 : e.maxLines) !== void 0 && (o = ce({
|
|
138
139
|
editor: i,
|
|
139
140
|
maxLines: e.maxLines
|
|
140
141
|
}));
|
|
@@ -147,17 +148,17 @@ const fr = ({
|
|
|
147
148
|
let a = "";
|
|
148
149
|
try {
|
|
149
150
|
i.read(() => {
|
|
150
|
-
a =
|
|
151
|
+
a = Pt(i);
|
|
151
152
|
});
|
|
152
153
|
} catch {
|
|
153
154
|
}
|
|
154
|
-
return { html: a, trimCount:
|
|
155
|
-
},
|
|
156
|
-
class
|
|
155
|
+
return { html: a, trimCount: o };
|
|
156
|
+
}, oo = (t) => Ae().map(({ node: r }) => r).filter((r) => t.some((e) => r instanceof e));
|
|
157
|
+
class et extends j {
|
|
157
158
|
static getType() {
|
|
158
159
|
return "target-link";
|
|
159
160
|
}
|
|
160
|
-
constructor(r, e,
|
|
161
|
+
constructor(r, e, o) {
|
|
161
162
|
let i = !1;
|
|
162
163
|
const a = { ...e };
|
|
163
164
|
try {
|
|
@@ -165,10 +166,10 @@ class X extends F {
|
|
|
165
166
|
window.location.hostname !== l.hostname && (i = !0);
|
|
166
167
|
} catch {
|
|
167
168
|
}
|
|
168
|
-
i && (a.target = "_blank", a.rel = "noopener noreferrer"), super(r, a,
|
|
169
|
+
i && (a.target = "_blank", a.rel = "noopener noreferrer"), super(r, a, o);
|
|
169
170
|
}
|
|
170
171
|
static clone(r) {
|
|
171
|
-
return new
|
|
172
|
+
return new et(
|
|
172
173
|
r.__url,
|
|
173
174
|
{ rel: r.__rel, target: r.__target, title: r.__title },
|
|
174
175
|
r.__key
|
|
@@ -178,19 +179,19 @@ class X extends F {
|
|
|
178
179
|
return super.exportJSON();
|
|
179
180
|
}
|
|
180
181
|
static importJSON(r) {
|
|
181
|
-
return
|
|
182
|
+
return j.importJSON(r);
|
|
182
183
|
}
|
|
183
184
|
}
|
|
184
|
-
const
|
|
185
|
+
const de = Qe({
|
|
185
186
|
hasFocus: !1,
|
|
186
187
|
editorRef: { current: null },
|
|
187
188
|
signUrl: void 0,
|
|
188
189
|
fileUpload: void 0
|
|
189
|
-
}),
|
|
190
|
-
const [r, e] =
|
|
191
|
-
e(!0),
|
|
192
|
-
}, []), a =
|
|
193
|
-
|
|
190
|
+
}), Ir = ({ onBlur: t }) => {
|
|
191
|
+
const [r, e] = m(!1), o = V(null), i = M(() => {
|
|
192
|
+
e(!0), o.current && window.clearTimeout(o.current);
|
|
193
|
+
}, []), a = M(() => {
|
|
194
|
+
o.current = window.setTimeout(() => {
|
|
194
195
|
e(!1), t == null || t();
|
|
195
196
|
}, 0);
|
|
196
197
|
}, [t]);
|
|
@@ -201,50 +202,50 @@ const oe = He({
|
|
|
201
202
|
onBlur: a
|
|
202
203
|
}
|
|
203
204
|
};
|
|
204
|
-
},
|
|
205
|
-
function
|
|
205
|
+
}, H = () => Ze(de);
|
|
206
|
+
function Or({
|
|
206
207
|
src: t,
|
|
207
208
|
altText: r,
|
|
208
209
|
width: e,
|
|
209
|
-
height:
|
|
210
|
+
height: o,
|
|
210
211
|
nodeKey: i
|
|
211
212
|
}) {
|
|
212
|
-
const { signUrl: a } =
|
|
213
|
+
const { signUrl: a } = H(), [l, s] = m(a ? "" : t), [d, c] = m(!1), u = V(!1), [g] = x();
|
|
213
214
|
_(() => {
|
|
214
|
-
const
|
|
215
|
+
const p = async () => {
|
|
215
216
|
s(await (a == null ? void 0 : a(t)) ?? t);
|
|
216
217
|
};
|
|
217
|
-
!l && !
|
|
218
|
+
!l && !u.current && (u.current = !0, p());
|
|
218
219
|
}, []);
|
|
219
|
-
const k = (
|
|
220
|
-
C.relatedTarget instanceof HTMLElement && C.relatedTarget.dataset.controls === "true" || c(
|
|
221
|
-
},
|
|
220
|
+
const k = (p) => (C) => {
|
|
221
|
+
C.relatedTarget instanceof HTMLElement && C.relatedTarget.dataset.controls === "true" || c(p);
|
|
222
|
+
}, E = () => {
|
|
222
223
|
g.update(() => {
|
|
223
|
-
const
|
|
224
|
-
|
|
224
|
+
const p = ct(i);
|
|
225
|
+
p && p.remove();
|
|
225
226
|
});
|
|
226
|
-
},
|
|
227
|
+
}, R = () => {
|
|
227
228
|
g.update(() => {
|
|
228
|
-
var
|
|
229
|
-
const
|
|
230
|
-
if (!
|
|
229
|
+
var y;
|
|
230
|
+
const p = ct(i);
|
|
231
|
+
if (!p)
|
|
231
232
|
return;
|
|
232
|
-
const C =
|
|
233
|
-
C && C.insertBefore(
|
|
233
|
+
const C = p.getPreviousSibling() || ((y = p.getParent()) == null ? void 0 : y.getPreviousSibling());
|
|
234
|
+
C && C.insertBefore(p);
|
|
234
235
|
});
|
|
235
|
-
},
|
|
236
|
+
}, b = () => {
|
|
236
237
|
g.update(() => {
|
|
237
|
-
var
|
|
238
|
-
const
|
|
239
|
-
if (!
|
|
238
|
+
var y;
|
|
239
|
+
const p = ct(i);
|
|
240
|
+
if (!p)
|
|
240
241
|
return;
|
|
241
|
-
const C =
|
|
242
|
-
C && C.insertAfter(
|
|
242
|
+
const C = p.getNextSibling() || ((y = p.getParent()) == null ? void 0 : y.getNextSibling());
|
|
243
|
+
C && C.insertAfter(p);
|
|
243
244
|
});
|
|
244
245
|
};
|
|
245
|
-
return l ? /* @__PURE__ */
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
-
|
|
246
|
+
return l ? /* @__PURE__ */ h(P, { css: { position: "relative", display: "inline-block" }, children: [
|
|
247
|
+
/* @__PURE__ */ h(
|
|
248
|
+
er,
|
|
248
249
|
{
|
|
249
250
|
css: {
|
|
250
251
|
position: "absolute",
|
|
@@ -258,47 +259,47 @@ function vr({
|
|
|
258
259
|
"data-controls": "true",
|
|
259
260
|
onMouseLeave: k(!1),
|
|
260
261
|
children: [
|
|
261
|
-
/* @__PURE__ */
|
|
262
|
-
|
|
262
|
+
/* @__PURE__ */ n(
|
|
263
|
+
w,
|
|
263
264
|
{
|
|
264
265
|
icon: !0,
|
|
265
266
|
size: "sm",
|
|
266
267
|
css: { width: "20px", height: "20px" },
|
|
267
|
-
onClick:
|
|
268
|
+
onClick: E,
|
|
268
269
|
color: "danger",
|
|
269
|
-
children: /* @__PURE__ */
|
|
270
|
+
children: /* @__PURE__ */ n(lr, {})
|
|
270
271
|
}
|
|
271
272
|
),
|
|
272
|
-
/* @__PURE__ */
|
|
273
|
-
|
|
273
|
+
/* @__PURE__ */ n(
|
|
274
|
+
w,
|
|
274
275
|
{
|
|
275
276
|
icon: !0,
|
|
276
277
|
size: "sm",
|
|
277
278
|
css: { width: "20px", height: "20px" },
|
|
278
|
-
onClick:
|
|
279
|
-
children: /* @__PURE__ */
|
|
279
|
+
onClick: R,
|
|
280
|
+
children: /* @__PURE__ */ n(sr, {})
|
|
280
281
|
}
|
|
281
282
|
),
|
|
282
|
-
/* @__PURE__ */
|
|
283
|
-
|
|
283
|
+
/* @__PURE__ */ n(
|
|
284
|
+
w,
|
|
284
285
|
{
|
|
285
286
|
icon: !0,
|
|
286
287
|
size: "sm",
|
|
287
288
|
css: { width: "20px", height: "20px" },
|
|
288
|
-
onClick:
|
|
289
|
-
children: /* @__PURE__ */
|
|
289
|
+
onClick: b,
|
|
290
|
+
children: /* @__PURE__ */ n(cr, {})
|
|
290
291
|
}
|
|
291
292
|
)
|
|
292
293
|
]
|
|
293
294
|
}
|
|
294
295
|
),
|
|
295
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ n(
|
|
296
297
|
"img",
|
|
297
298
|
{
|
|
298
299
|
src: l,
|
|
299
300
|
alt: r,
|
|
300
301
|
style: {
|
|
301
|
-
height:
|
|
302
|
+
height: o,
|
|
302
303
|
width: e
|
|
303
304
|
},
|
|
304
305
|
className: "ain-rich-text-image",
|
|
@@ -307,27 +308,27 @@ function vr({
|
|
|
307
308
|
"data-controls": "true"
|
|
308
309
|
}
|
|
309
310
|
)
|
|
310
|
-
] }) : /* @__PURE__ */
|
|
311
|
+
] }) : /* @__PURE__ */ n("span", {});
|
|
311
312
|
}
|
|
312
|
-
function
|
|
313
|
-
const r = t, { alt: e, src:
|
|
314
|
-
return { node:
|
|
313
|
+
function zr(t) {
|
|
314
|
+
const r = t, { alt: e, src: o, width: i, height: a } = r;
|
|
315
|
+
return { node: xt({ altText: e, height: a, src: o, width: i }) };
|
|
315
316
|
}
|
|
316
|
-
class
|
|
317
|
-
constructor(e,
|
|
317
|
+
class U extends xe {
|
|
318
|
+
constructor(e, o, i, a, l, s) {
|
|
318
319
|
super(s);
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
this.__src = e, this.__altText =
|
|
320
|
+
$(this, "__src");
|
|
321
|
+
$(this, "__altText");
|
|
322
|
+
$(this, "__width");
|
|
323
|
+
$(this, "__height");
|
|
324
|
+
$(this, "__meta");
|
|
325
|
+
this.__src = e, this.__altText = o, this.__width = i || "inherit", this.__height = a || "inherit", this.__meta = l;
|
|
325
326
|
}
|
|
326
327
|
static getType() {
|
|
327
328
|
return "image";
|
|
328
329
|
}
|
|
329
330
|
static clone(e) {
|
|
330
|
-
return new
|
|
331
|
+
return new U(
|
|
331
332
|
e.__src,
|
|
332
333
|
e.__altText,
|
|
333
334
|
e.__width,
|
|
@@ -337,9 +338,9 @@ class $ extends ue {
|
|
|
337
338
|
);
|
|
338
339
|
}
|
|
339
340
|
static importJSON(e) {
|
|
340
|
-
const { altText:
|
|
341
|
-
return
|
|
342
|
-
altText:
|
|
341
|
+
const { altText: o, height: i, width: a, src: l, meta: s } = e;
|
|
342
|
+
return xt({
|
|
343
|
+
altText: o,
|
|
343
344
|
height: i,
|
|
344
345
|
src: l,
|
|
345
346
|
width: a,
|
|
@@ -353,7 +354,7 @@ class $ extends ue {
|
|
|
353
354
|
static importDOM() {
|
|
354
355
|
return {
|
|
355
356
|
img: (e) => ({
|
|
356
|
-
conversion:
|
|
357
|
+
conversion: zr,
|
|
357
358
|
priority: 0
|
|
358
359
|
})
|
|
359
360
|
};
|
|
@@ -373,12 +374,12 @@ class $ extends ue {
|
|
|
373
374
|
return this.__meta ?? { width: 0, height: 0 };
|
|
374
375
|
}
|
|
375
376
|
setSrc(e) {
|
|
376
|
-
const
|
|
377
|
-
|
|
377
|
+
const o = this.getWritable();
|
|
378
|
+
o.__src = e;
|
|
378
379
|
}
|
|
379
|
-
setWidthAndHeight(e,
|
|
380
|
+
setWidthAndHeight(e, o) {
|
|
380
381
|
const i = this.getWritable();
|
|
381
|
-
i.__width = e, i.__height =
|
|
382
|
+
i.__width = e, i.__height = o;
|
|
382
383
|
}
|
|
383
384
|
// View
|
|
384
385
|
createDOM(e) {
|
|
@@ -394,8 +395,8 @@ class $ extends ue {
|
|
|
394
395
|
return this.__altText;
|
|
395
396
|
}
|
|
396
397
|
decorate() {
|
|
397
|
-
return /* @__PURE__ */
|
|
398
|
-
|
|
398
|
+
return /* @__PURE__ */ n(
|
|
399
|
+
Or,
|
|
399
400
|
{
|
|
400
401
|
src: this.__src,
|
|
401
402
|
altText: this.__altText,
|
|
@@ -406,119 +407,128 @@ class $ extends ue {
|
|
|
406
407
|
);
|
|
407
408
|
}
|
|
408
409
|
}
|
|
409
|
-
function
|
|
410
|
+
function xt({
|
|
410
411
|
altText: t,
|
|
411
412
|
height: r,
|
|
412
413
|
src: e,
|
|
413
|
-
width:
|
|
414
|
+
width: o,
|
|
414
415
|
meta: i,
|
|
415
416
|
key: a
|
|
416
417
|
}) {
|
|
417
|
-
return
|
|
418
|
-
new
|
|
418
|
+
return Le(
|
|
419
|
+
new U(e, t, o, r, i, a)
|
|
419
420
|
);
|
|
420
421
|
}
|
|
421
|
-
function
|
|
422
|
-
return t instanceof
|
|
422
|
+
function io(t) {
|
|
423
|
+
return t instanceof U;
|
|
423
424
|
}
|
|
424
|
-
const
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
Ht,
|
|
429
|
-
Ft,
|
|
430
|
-
F,
|
|
425
|
+
const ao = [
|
|
426
|
+
qt,
|
|
427
|
+
Jt,
|
|
428
|
+
mt,
|
|
431
429
|
Kt,
|
|
432
|
-
Gt,
|
|
433
|
-
Yt,
|
|
434
|
-
$
|
|
435
|
-
], jn = [
|
|
436
|
-
Wt,
|
|
437
430
|
jt,
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
431
|
+
j,
|
|
432
|
+
Yt,
|
|
433
|
+
Xt,
|
|
434
|
+
Vt,
|
|
435
|
+
U
|
|
436
|
+
], lo = [
|
|
437
|
+
qt,
|
|
438
|
+
Jt,
|
|
439
|
+
mt,
|
|
442
440
|
Kt,
|
|
443
|
-
|
|
441
|
+
jt,
|
|
442
|
+
j,
|
|
444
443
|
Yt,
|
|
445
|
-
|
|
446
|
-
|
|
444
|
+
Xt,
|
|
445
|
+
Vt,
|
|
446
|
+
U,
|
|
447
|
+
et,
|
|
447
448
|
{
|
|
448
|
-
replace:
|
|
449
|
-
with: (t) => new
|
|
449
|
+
replace: j,
|
|
450
|
+
with: (t) => new et(
|
|
450
451
|
t.getURL(),
|
|
451
452
|
{ rel: t.__rel, target: t.__target, title: t.__title }
|
|
452
453
|
)
|
|
453
454
|
}
|
|
454
455
|
];
|
|
455
|
-
function
|
|
456
|
+
function $r(t) {
|
|
456
457
|
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
458
|
}
|
|
458
|
-
function
|
|
459
|
+
function Ot(t) {
|
|
459
460
|
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
461
|
}
|
|
461
|
-
function
|
|
462
|
+
function Ar(t) {
|
|
462
463
|
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
464
|
}
|
|
464
|
-
function
|
|
465
|
+
function Dr(t) {
|
|
465
466
|
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
467
|
}
|
|
467
|
-
function
|
|
468
|
+
function Br(t) {
|
|
468
469
|
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
470
|
}
|
|
470
|
-
function
|
|
471
|
+
function Pr(t) {
|
|
471
472
|
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
473
|
}
|
|
473
|
-
function
|
|
474
|
+
function Fr(t) {
|
|
474
475
|
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
476
|
}
|
|
476
|
-
function
|
|
477
|
+
function Hr(t) {
|
|
477
478
|
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
479
|
}
|
|
479
|
-
function
|
|
480
|
+
function Ur(t) {
|
|
480
481
|
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
482
|
}
|
|
482
|
-
function
|
|
483
|
+
function Wr(t) {
|
|
483
484
|
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
485
|
}
|
|
485
|
-
function
|
|
486
|
+
function jr(t) {
|
|
486
487
|
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
488
|
}
|
|
488
|
-
function
|
|
489
|
+
function Kr(t) {
|
|
489
490
|
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
491
|
}
|
|
491
|
-
function
|
|
492
|
+
function Gr(t) {
|
|
492
493
|
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
494
|
}
|
|
494
|
-
function
|
|
495
|
+
function qr(t) {
|
|
495
496
|
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
497
|
}
|
|
497
|
-
function
|
|
498
|
+
function Jr(t) {
|
|
498
499
|
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
500
|
}
|
|
500
|
-
function
|
|
501
|
+
function Yr(t) {
|
|
501
502
|
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
503
|
}
|
|
503
|
-
function
|
|
504
|
+
function Xr(t) {
|
|
504
505
|
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
506
|
}
|
|
506
|
-
function
|
|
507
|
+
function Vr(t) {
|
|
507
508
|
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
509
|
}
|
|
509
|
-
function
|
|
510
|
+
function Qr(t) {
|
|
511
|
+
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 12l14 0" } }, { tag: "path", attr: { d: "M16 6.5a4 2 0 0 0 -4 -1.5h-1a3.5 3.5 0 0 0 0 7h2a3.5 3.5 0 0 1 0 7h-1.5a4 2 0 0 1 -4 -1.5" } }] })(t);
|
|
512
|
+
}
|
|
513
|
+
function Zr(t) {
|
|
514
|
+
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 20h-4l3.5 -4a1.73 1.73 0 0 0 -3.5 -2" } }] })(t);
|
|
515
|
+
}
|
|
516
|
+
function tn(t) {
|
|
510
517
|
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
518
|
}
|
|
512
|
-
function
|
|
519
|
+
function en(t) {
|
|
513
520
|
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
521
|
}
|
|
515
|
-
function
|
|
522
|
+
function rn(t) {
|
|
523
|
+
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 15v-7a3 3 0 0 1 6 0v7" } }, { tag: "path", attr: { d: "M9 11h6" } }, { tag: "path", attr: { d: "M5 19h14" } }] })(t);
|
|
524
|
+
}
|
|
525
|
+
function nn(t) {
|
|
516
526
|
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
527
|
}
|
|
518
|
-
const
|
|
528
|
+
const on = Tr("div", {
|
|
519
529
|
width: "10rem",
|
|
520
530
|
display: "flex"
|
|
521
|
-
}),
|
|
531
|
+
}), he = {
|
|
522
532
|
bullet: "Punktliste",
|
|
523
533
|
h1: "Overskrift 1",
|
|
524
534
|
h2: "Overskrift 2",
|
|
@@ -530,24 +540,24 @@ const Wr = dr("div", {
|
|
|
530
540
|
paragraph: "Normal",
|
|
531
541
|
quote: "Sitat",
|
|
532
542
|
check: "Avkrysningsliste"
|
|
533
|
-
},
|
|
534
|
-
bullet: /* @__PURE__ */
|
|
535
|
-
h1: /* @__PURE__ */
|
|
536
|
-
h2: /* @__PURE__ */
|
|
537
|
-
h3: /* @__PURE__ */
|
|
538
|
-
h4: /* @__PURE__ */
|
|
539
|
-
h5: /* @__PURE__ */
|
|
540
|
-
h6: /* @__PURE__ */
|
|
541
|
-
number: /* @__PURE__ */
|
|
542
|
-
check: /* @__PURE__ */
|
|
543
|
-
paragraph: /* @__PURE__ */
|
|
544
|
-
quote: /* @__PURE__ */
|
|
545
|
-
},
|
|
543
|
+
}, an = {
|
|
544
|
+
bullet: /* @__PURE__ */ n(Xr, { size: "1.25rem" }),
|
|
545
|
+
h1: /* @__PURE__ */ n(Pr, { size: "1.25rem" }),
|
|
546
|
+
h2: /* @__PURE__ */ n(Fr, { size: "1.25rem" }),
|
|
547
|
+
h3: /* @__PURE__ */ n(Hr, { size: "1.25rem" }),
|
|
548
|
+
h4: /* @__PURE__ */ n(Ur, { size: "1.25rem" }),
|
|
549
|
+
h5: /* @__PURE__ */ n(Wr, { size: "1.25rem" }),
|
|
550
|
+
h6: /* @__PURE__ */ n(jr, { size: "1.25rem" }),
|
|
551
|
+
number: /* @__PURE__ */ n(Yr, { size: "1.25rem" }),
|
|
552
|
+
check: /* @__PURE__ */ n(Jr, { size: "1.25rem" }),
|
|
553
|
+
paragraph: /* @__PURE__ */ n(Gr, { size: "1.25rem" }),
|
|
554
|
+
quote: /* @__PURE__ */ n(Vr, { size: "1.25rem" })
|
|
555
|
+
}, S = ({
|
|
546
556
|
blockType: t
|
|
547
|
-
}) => /* @__PURE__ */
|
|
548
|
-
/* @__PURE__ */
|
|
549
|
-
/* @__PURE__ */
|
|
550
|
-
|
|
557
|
+
}) => /* @__PURE__ */ h(F, { children: [
|
|
558
|
+
/* @__PURE__ */ n(P, { css: { display: "flex", flex: "0 0 auto" }, children: an[t] }),
|
|
559
|
+
/* @__PURE__ */ n(
|
|
560
|
+
P,
|
|
551
561
|
{
|
|
552
562
|
css: {
|
|
553
563
|
flex: "1 1 auto",
|
|
@@ -555,189 +565,292 @@ const Wr = dr("div", {
|
|
|
555
565
|
textOverflow: "ellipsis",
|
|
556
566
|
whiteSpace: "nowrap"
|
|
557
567
|
},
|
|
558
|
-
children:
|
|
568
|
+
children: he[t]
|
|
559
569
|
}
|
|
560
570
|
)
|
|
561
|
-
] }),
|
|
571
|
+
] }), ln = (t) => {
|
|
562
572
|
if (!N(t))
|
|
563
573
|
return null;
|
|
564
574
|
const r = t.anchor.getNode();
|
|
565
|
-
let e = r.getKey() === "root" ? r :
|
|
566
|
-
const i =
|
|
567
|
-
return i !== null &&
|
|
575
|
+
let e = r.getKey() === "root" ? r : Wt(r, (o) => {
|
|
576
|
+
const i = o.getParent();
|
|
577
|
+
return i !== null && Ft(i);
|
|
568
578
|
});
|
|
569
579
|
return e === null && (e = r.getTopLevelElementOrThrow()), {
|
|
570
580
|
anchorNode: r,
|
|
571
581
|
element: e
|
|
572
582
|
};
|
|
573
|
-
},
|
|
574
|
-
const [t] = x(), [r, e] =
|
|
583
|
+
}, sn = () => {
|
|
584
|
+
const [t] = x(), [r, e] = m("paragraph");
|
|
575
585
|
_(() => t.registerCommand(
|
|
576
|
-
|
|
586
|
+
X,
|
|
577
587
|
() => {
|
|
578
|
-
const c =
|
|
579
|
-
if (!
|
|
588
|
+
const c = L(), u = ln(c);
|
|
589
|
+
if (!u)
|
|
580
590
|
return !1;
|
|
581
|
-
const { element: g, anchorNode: k } =
|
|
582
|
-
if (t.getElementByKey(
|
|
583
|
-
if (
|
|
584
|
-
const
|
|
591
|
+
const { element: g, anchorNode: k } = u, E = g.getKey();
|
|
592
|
+
if (t.getElementByKey(E) !== null)
|
|
593
|
+
if (ft(g)) {
|
|
594
|
+
const b = De(
|
|
585
595
|
k,
|
|
586
|
-
|
|
587
|
-
),
|
|
588
|
-
e(
|
|
596
|
+
mt
|
|
597
|
+
), p = b ? b.getListType() : g.getListType();
|
|
598
|
+
e(p);
|
|
589
599
|
} else {
|
|
590
|
-
const
|
|
591
|
-
|
|
600
|
+
const b = je(g) ? g.getTag() : g.getType();
|
|
601
|
+
b in he && e(b);
|
|
592
602
|
}
|
|
593
603
|
return !1;
|
|
594
604
|
},
|
|
595
|
-
|
|
605
|
+
q
|
|
596
606
|
), [t]);
|
|
597
|
-
const
|
|
607
|
+
const o = (c) => {
|
|
598
608
|
r !== c && t.update(() => {
|
|
599
|
-
const
|
|
600
|
-
N(
|
|
609
|
+
const u = L();
|
|
610
|
+
N(u) && (ht(u, () => Ke(c)), e(c));
|
|
601
611
|
});
|
|
602
612
|
};
|
|
603
|
-
return /* @__PURE__ */
|
|
604
|
-
|
|
613
|
+
return /* @__PURE__ */ n(on, { children: /* @__PURE__ */ h(
|
|
614
|
+
at,
|
|
605
615
|
{
|
|
606
|
-
trigger: /* @__PURE__ */
|
|
607
|
-
|
|
616
|
+
trigger: /* @__PURE__ */ n(
|
|
617
|
+
lt,
|
|
608
618
|
{
|
|
609
619
|
dropdown: !0,
|
|
610
620
|
css: { display: "flex", width: "100%", overflow: "hidden" },
|
|
611
|
-
children: /* @__PURE__ */
|
|
621
|
+
children: /* @__PURE__ */ n(S, { blockType: r })
|
|
612
622
|
}
|
|
613
623
|
),
|
|
614
624
|
side: "bottom",
|
|
615
625
|
align: "start",
|
|
616
626
|
children: [
|
|
617
|
-
/* @__PURE__ */
|
|
627
|
+
/* @__PURE__ */ n(T, { onClick: () => {
|
|
618
628
|
r !== "paragraph" && t.update(() => {
|
|
619
|
-
const c =
|
|
620
|
-
N(c) && (
|
|
629
|
+
const c = L();
|
|
630
|
+
N(c) && (ht(c, () => G()), e("paragraph"));
|
|
621
631
|
});
|
|
622
|
-
}, children: /* @__PURE__ */
|
|
623
|
-
/* @__PURE__ */
|
|
624
|
-
/* @__PURE__ */
|
|
625
|
-
/* @__PURE__ */
|
|
626
|
-
/* @__PURE__ */
|
|
627
|
-
/* @__PURE__ */
|
|
628
|
-
/* @__PURE__ */
|
|
629
|
-
/* @__PURE__ */
|
|
630
|
-
r !== "bullet" && (t.dispatchCommand(
|
|
631
|
-
}, children: /* @__PURE__ */
|
|
632
|
-
/* @__PURE__ */
|
|
633
|
-
r !== "number" && (t.dispatchCommand(
|
|
634
|
-
}, children: /* @__PURE__ */
|
|
635
|
-
/* @__PURE__ */
|
|
636
|
-
r !== "check" && (t.dispatchCommand(
|
|
637
|
-
}, children: /* @__PURE__ */
|
|
638
|
-
/* @__PURE__ */
|
|
632
|
+
}, children: /* @__PURE__ */ n(S, { blockType: "paragraph" }) }),
|
|
633
|
+
/* @__PURE__ */ n(T, { onClick: () => o("h1"), children: /* @__PURE__ */ n(S, { blockType: "h1" }) }),
|
|
634
|
+
/* @__PURE__ */ n(T, { onClick: () => o("h2"), children: /* @__PURE__ */ n(S, { blockType: "h2" }) }),
|
|
635
|
+
/* @__PURE__ */ n(T, { onClick: () => o("h3"), children: /* @__PURE__ */ n(S, { blockType: "h3" }) }),
|
|
636
|
+
/* @__PURE__ */ n(T, { onClick: () => o("h4"), children: /* @__PURE__ */ n(S, { blockType: "h4" }) }),
|
|
637
|
+
/* @__PURE__ */ n(T, { onClick: () => o("h5"), children: /* @__PURE__ */ n(S, { blockType: "h5" }) }),
|
|
638
|
+
/* @__PURE__ */ n(T, { onClick: () => o("h6"), children: /* @__PURE__ */ n(S, { blockType: "h6" }) }),
|
|
639
|
+
/* @__PURE__ */ n(T, { onClick: () => {
|
|
640
|
+
r !== "bullet" && (t.dispatchCommand(He, void 0), e("bullet"));
|
|
641
|
+
}, children: /* @__PURE__ */ n(S, { blockType: "bullet" }) }),
|
|
642
|
+
/* @__PURE__ */ n(T, { onClick: () => {
|
|
643
|
+
r !== "number" && (t.dispatchCommand(Ue, void 0), e("number"));
|
|
644
|
+
}, children: /* @__PURE__ */ n(S, { blockType: "number" }) }),
|
|
645
|
+
/* @__PURE__ */ n(T, { onClick: () => {
|
|
646
|
+
r !== "check" && (t.dispatchCommand(Gt, void 0), e("check"));
|
|
647
|
+
}, children: /* @__PURE__ */ n(S, { blockType: "check" }) }),
|
|
648
|
+
/* @__PURE__ */ n(T, { onClick: () => {
|
|
639
649
|
r !== "quote" && t.update(() => {
|
|
640
|
-
const c =
|
|
641
|
-
N(c) && (
|
|
650
|
+
const c = L();
|
|
651
|
+
N(c) && (ht(c, () => Ge()), e("quote"));
|
|
642
652
|
});
|
|
643
|
-
}, children: /* @__PURE__ */
|
|
653
|
+
}, children: /* @__PURE__ */ n(S, { blockType: "quote" }) })
|
|
644
654
|
]
|
|
645
655
|
}
|
|
646
656
|
) });
|
|
647
|
-
},
|
|
648
|
-
const [t] = x(), [r, e] =
|
|
649
|
-
const
|
|
650
|
-
N(
|
|
657
|
+
}, cn = () => {
|
|
658
|
+
const [t] = x(), [r, e] = m(!1), [o, i] = m(!1), [a, l] = m(!1), [s, d] = m(!1), [c, u] = m(!1), [g, k] = m(!1), [E, R] = m(!1), [b, p] = m(""), [C, y] = m(!1), I = M(() => {
|
|
659
|
+
const v = L();
|
|
660
|
+
N(v) && (e(v.hasFormat("bold")), i(v.hasFormat("italic")), l(v.hasFormat("underline")), d(v.hasFormat("strikethrough")), u(v.hasFormat("code")), k(v.hasFormat("superscript")), R(v.hasFormat("subscript")), p(ze(v, "color", "")));
|
|
651
661
|
}, []);
|
|
652
|
-
_(() =>
|
|
662
|
+
_(() => ot(
|
|
653
663
|
t.registerCommand(
|
|
654
|
-
|
|
655
|
-
() => (
|
|
656
|
-
|
|
664
|
+
X,
|
|
665
|
+
() => (I(), !1),
|
|
666
|
+
q
|
|
657
667
|
),
|
|
658
|
-
t.registerUpdateListener(({ editorState:
|
|
659
|
-
|
|
660
|
-
|
|
668
|
+
t.registerUpdateListener(({ editorState: v }) => {
|
|
669
|
+
v.read(() => {
|
|
670
|
+
I();
|
|
661
671
|
});
|
|
662
672
|
})
|
|
663
|
-
), [t,
|
|
664
|
-
const
|
|
665
|
-
() => t.dispatchCommand(
|
|
673
|
+
), [t, I]);
|
|
674
|
+
const J = M(
|
|
675
|
+
() => t.dispatchCommand(A, "bold"),
|
|
666
676
|
[t]
|
|
667
|
-
),
|
|
668
|
-
() => t.dispatchCommand(
|
|
677
|
+
), Q = M(
|
|
678
|
+
() => t.dispatchCommand(A, "italic"),
|
|
669
679
|
[t]
|
|
670
|
-
),
|
|
671
|
-
() => t.dispatchCommand(
|
|
680
|
+
), me = M(
|
|
681
|
+
() => t.dispatchCommand(A, "underline"),
|
|
672
682
|
[t]
|
|
673
|
-
),
|
|
674
|
-
() => t.dispatchCommand(
|
|
683
|
+
), fe = M(
|
|
684
|
+
() => t.dispatchCommand(A, "strikethrough"),
|
|
675
685
|
[t]
|
|
676
|
-
),
|
|
677
|
-
() => t.dispatchCommand(
|
|
686
|
+
), ke = M(
|
|
687
|
+
() => t.dispatchCommand(A, "code"),
|
|
678
688
|
[t]
|
|
679
|
-
),
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
689
|
+
), be = M(
|
|
690
|
+
() => t.dispatchCommand(A, "superscript"),
|
|
691
|
+
[t]
|
|
692
|
+
), ve = M(
|
|
693
|
+
() => t.dispatchCommand(A, "subscript"),
|
|
694
|
+
[t]
|
|
695
|
+
), wt = Qt(() => {
|
|
696
|
+
const v = [];
|
|
697
|
+
return r && v.push("bold"), o && v.push("italic"), a && v.push("underline"), s && v.push("strikethrough"), c && v.push("code"), g && v.push("superscript"), E && v.push("subscript"), b && v.push("color"), v;
|
|
698
|
+
}, [
|
|
699
|
+
r,
|
|
700
|
+
o,
|
|
701
|
+
a,
|
|
702
|
+
c,
|
|
703
|
+
g,
|
|
704
|
+
E,
|
|
705
|
+
s,
|
|
706
|
+
b
|
|
707
|
+
]);
|
|
708
|
+
return /* @__PURE__ */ h(F, { children: [
|
|
709
|
+
/* @__PURE__ */ h(
|
|
710
|
+
tt,
|
|
711
|
+
{
|
|
712
|
+
type: "multiple",
|
|
713
|
+
"aria-label": "Tekstformattering",
|
|
714
|
+
value: wt,
|
|
715
|
+
children: [
|
|
716
|
+
/* @__PURE__ */ n(O, { onClick: J, title: "Fet tekst", value: "bold", children: /* @__PURE__ */ n(Dr, { size: "1.25rem" }) }),
|
|
717
|
+
/* @__PURE__ */ n(
|
|
718
|
+
O,
|
|
719
|
+
{
|
|
720
|
+
onClick: Q,
|
|
721
|
+
title: "Kursiv tekst",
|
|
722
|
+
value: "italic",
|
|
723
|
+
children: /* @__PURE__ */ n(Kr, { size: "1.25rem" })
|
|
724
|
+
}
|
|
725
|
+
),
|
|
726
|
+
/* @__PURE__ */ n(
|
|
727
|
+
O,
|
|
728
|
+
{
|
|
729
|
+
onClick: me,
|
|
730
|
+
title: "Understreket tekst",
|
|
731
|
+
value: "underline",
|
|
732
|
+
children: /* @__PURE__ */ n(nn, { size: "1.25rem" })
|
|
733
|
+
}
|
|
734
|
+
)
|
|
735
|
+
]
|
|
736
|
+
}
|
|
737
|
+
),
|
|
738
|
+
/* @__PURE__ */ h(Zt, { open: C, onOpenChange: y, children: [
|
|
739
|
+
/* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(lt, { children: /* @__PURE__ */ n(dr, { size: "1.25rem" }) }) }),
|
|
740
|
+
/* @__PURE__ */ n(ee, { children: /* @__PURE__ */ h(
|
|
741
|
+
tt,
|
|
742
|
+
{
|
|
743
|
+
type: "multiple",
|
|
744
|
+
"aria-label": "Tekstformattering",
|
|
745
|
+
value: wt,
|
|
746
|
+
css: { margin: "$1" },
|
|
747
|
+
children: [
|
|
748
|
+
/* @__PURE__ */ n(
|
|
749
|
+
O,
|
|
750
|
+
{
|
|
751
|
+
onClick: fe,
|
|
752
|
+
title: "Gjennomstreking",
|
|
753
|
+
value: "strikethrough",
|
|
754
|
+
children: /* @__PURE__ */ n(Qr, { size: "1.25rem" })
|
|
755
|
+
}
|
|
756
|
+
),
|
|
757
|
+
/* @__PURE__ */ n(
|
|
758
|
+
O,
|
|
759
|
+
{
|
|
760
|
+
onClick: be,
|
|
761
|
+
title: "Superscript",
|
|
762
|
+
value: "superscript",
|
|
763
|
+
children: /* @__PURE__ */ n(tn, { size: "1.25rem" })
|
|
764
|
+
}
|
|
765
|
+
),
|
|
766
|
+
/* @__PURE__ */ n(
|
|
767
|
+
O,
|
|
768
|
+
{
|
|
769
|
+
onClick: ve,
|
|
770
|
+
title: "Subscript",
|
|
771
|
+
value: "subscript",
|
|
772
|
+
children: /* @__PURE__ */ n(Zr, { size: "1.25rem" })
|
|
773
|
+
}
|
|
774
|
+
),
|
|
775
|
+
/* @__PURE__ */ n(O, { onClick: ke, title: "Kode", value: "code", children: /* @__PURE__ */ n(Br, { size: "1.25rem" }) }),
|
|
776
|
+
/* @__PURE__ */ n(hn, { activeColor: b })
|
|
777
|
+
]
|
|
778
|
+
}
|
|
779
|
+
) })
|
|
780
|
+
] })
|
|
781
|
+
] });
|
|
782
|
+
}, dn = [
|
|
783
|
+
{ name: "Reset", value: "" },
|
|
784
|
+
{ name: "Rød", value: "#df2222" },
|
|
785
|
+
{ name: "Grønn", value: "#1ca021" },
|
|
786
|
+
{ name: "Blå", value: "#2044b8" },
|
|
787
|
+
{ name: "Lilla", value: "#9c31de" }
|
|
788
|
+
], hn = ({ activeColor: t }) => {
|
|
789
|
+
const [r] = x(), [e, o] = m(!1), i = (a) => {
|
|
790
|
+
r.update(() => {
|
|
791
|
+
const l = L();
|
|
792
|
+
l && $e(l, { color: a });
|
|
793
|
+
});
|
|
794
|
+
};
|
|
795
|
+
return /* @__PURE__ */ h(Zt, { open: e, onOpenChange: o, children: [
|
|
796
|
+
/* @__PURE__ */ n(te, { children: /* @__PURE__ */ n(O, { value: "color", title: "Tekstfarge", children: /* @__PURE__ */ n(rn, { size: "1.25rem" }) }) }),
|
|
797
|
+
/* @__PURE__ */ n(ee, { children: /* @__PURE__ */ n(
|
|
798
|
+
tt,
|
|
799
|
+
{
|
|
800
|
+
type: "single",
|
|
801
|
+
"aria-label": "Tekstfarge",
|
|
802
|
+
value: t,
|
|
803
|
+
css: { margin: "$1" },
|
|
804
|
+
children: dn.map((a) => /* @__PURE__ */ n(
|
|
805
|
+
O,
|
|
712
806
|
{
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
807
|
+
value: a.value,
|
|
808
|
+
onClick: () => i(
|
|
809
|
+
!a.value || a.value === t ? null : a.value
|
|
810
|
+
),
|
|
811
|
+
children: a.value ? /* @__PURE__ */ n(
|
|
812
|
+
P,
|
|
813
|
+
{
|
|
814
|
+
css: {
|
|
815
|
+
width: "1rem",
|
|
816
|
+
height: "1rem",
|
|
817
|
+
backgroundColor: a.value,
|
|
818
|
+
borderRadius: "$full",
|
|
819
|
+
flexShrink: 0
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
) : /* @__PURE__ */ n(
|
|
823
|
+
hr,
|
|
824
|
+
{
|
|
825
|
+
size: "1.25rem",
|
|
826
|
+
style: { color: "#000" }
|
|
827
|
+
}
|
|
828
|
+
)
|
|
829
|
+
},
|
|
830
|
+
a.name
|
|
831
|
+
))
|
|
832
|
+
}
|
|
833
|
+
) })
|
|
834
|
+
] });
|
|
835
|
+
}, un = ({ children: t }) => {
|
|
836
|
+
const { hasFocus: r, editorRef: e } = H(), o = r, [i, a] = m(o);
|
|
837
|
+
tr(() => {
|
|
838
|
+
a(o);
|
|
839
|
+
}, [o]);
|
|
840
|
+
const { context: l, refs: s, floatingStyles: d } = vt({
|
|
728
841
|
placement: "top",
|
|
729
|
-
whileElementsMounted:
|
|
842
|
+
whileElementsMounted: oe,
|
|
730
843
|
middleware: [
|
|
731
|
-
|
|
732
|
-
apply: ({ rects:
|
|
733
|
-
g.floating.style.minWidth = `${
|
|
844
|
+
kr({
|
|
845
|
+
apply: ({ rects: u, elements: g }) => {
|
|
846
|
+
g.floating.style.minWidth = `${u.reference.width}px`;
|
|
734
847
|
}
|
|
735
848
|
}),
|
|
736
|
-
|
|
737
|
-
|
|
849
|
+
br(),
|
|
850
|
+
ie({
|
|
738
851
|
mainAxis: 8
|
|
739
852
|
}),
|
|
740
|
-
|
|
853
|
+
vr({
|
|
741
854
|
padding: 8
|
|
742
855
|
})
|
|
743
856
|
],
|
|
@@ -746,13 +859,13 @@ const Wr = dr("div", {
|
|
|
746
859
|
elements: {
|
|
747
860
|
reference: e.current
|
|
748
861
|
}
|
|
749
|
-
}), { getFloatingProps: c } =
|
|
750
|
-
|
|
862
|
+
}), { getFloatingProps: c } = ae([
|
|
863
|
+
le(l, {
|
|
751
864
|
role: "dialog"
|
|
752
865
|
})
|
|
753
866
|
]);
|
|
754
|
-
return i ? /* @__PURE__ */
|
|
755
|
-
|
|
867
|
+
return i ? /* @__PURE__ */ n(se, { children: /* @__PURE__ */ n(
|
|
868
|
+
re,
|
|
756
869
|
{
|
|
757
870
|
ref: s.setFloating,
|
|
758
871
|
style: d,
|
|
@@ -763,72 +876,73 @@ const Wr = dr("div", {
|
|
|
763
876
|
overflow: "hidden",
|
|
764
877
|
boxShadow: "$md"
|
|
765
878
|
},
|
|
766
|
-
children: /* @__PURE__ */
|
|
879
|
+
children: /* @__PURE__ */ n(gn, { children: t })
|
|
767
880
|
}
|
|
768
881
|
) }) : null;
|
|
769
|
-
},
|
|
882
|
+
}, gn = ({
|
|
770
883
|
children: t,
|
|
771
884
|
...r
|
|
772
|
-
}) => /* @__PURE__ */
|
|
773
|
-
/* @__PURE__ */
|
|
774
|
-
/* @__PURE__ */
|
|
775
|
-
/* @__PURE__ */
|
|
885
|
+
}) => /* @__PURE__ */ h(rr, { "aria-label": "Formattering", ...r, children: [
|
|
886
|
+
/* @__PURE__ */ n(sn, {}),
|
|
887
|
+
/* @__PURE__ */ n(Rt, {}),
|
|
888
|
+
/* @__PURE__ */ n(cn, {}),
|
|
889
|
+
/* @__PURE__ */ n(Rt, {}),
|
|
776
890
|
t
|
|
777
891
|
] });
|
|
778
|
-
function
|
|
892
|
+
function pn() {
|
|
779
893
|
const [t] = x();
|
|
780
|
-
return _(() =>
|
|
894
|
+
return _(() => ot(
|
|
781
895
|
t.registerCommand(
|
|
782
|
-
|
|
783
|
-
() => (
|
|
784
|
-
|
|
896
|
+
Gt,
|
|
897
|
+
() => (We(t, "check"), !0),
|
|
898
|
+
D
|
|
785
899
|
),
|
|
786
900
|
t.registerCommand(
|
|
787
|
-
|
|
788
|
-
(r) =>
|
|
789
|
-
|
|
901
|
+
_e,
|
|
902
|
+
(r) => At(r, t, !1),
|
|
903
|
+
D
|
|
790
904
|
),
|
|
791
905
|
t.registerCommand(
|
|
792
|
-
|
|
793
|
-
(r) =>
|
|
794
|
-
|
|
906
|
+
we,
|
|
907
|
+
(r) => At(r, t, !0),
|
|
908
|
+
D
|
|
795
909
|
),
|
|
796
910
|
t.registerCommand(
|
|
797
|
-
|
|
911
|
+
Ht,
|
|
798
912
|
(r) => {
|
|
799
|
-
if (
|
|
800
|
-
const
|
|
801
|
-
return
|
|
913
|
+
if (gt() != null) {
|
|
914
|
+
const o = t.getRootElement();
|
|
915
|
+
return o != null && o.focus(), !0;
|
|
802
916
|
}
|
|
803
917
|
return !1;
|
|
804
918
|
},
|
|
805
|
-
|
|
919
|
+
D
|
|
806
920
|
),
|
|
807
921
|
t.registerCommand(
|
|
808
|
-
|
|
922
|
+
ye,
|
|
809
923
|
(r) => {
|
|
810
|
-
const e =
|
|
924
|
+
const e = gt();
|
|
811
925
|
return e != null && t.isEditable() ? (t.update(() => {
|
|
812
|
-
const
|
|
813
|
-
|
|
926
|
+
const o = pt(e);
|
|
927
|
+
K(o) && (r.preventDefault(), o.toggleChecked());
|
|
814
928
|
}), !0) : !1;
|
|
815
929
|
},
|
|
816
|
-
|
|
930
|
+
D
|
|
817
931
|
),
|
|
818
932
|
t.registerCommand(
|
|
819
|
-
|
|
933
|
+
Se,
|
|
820
934
|
(r) => t.getEditorState().read(() => {
|
|
821
|
-
const e =
|
|
935
|
+
const e = L();
|
|
822
936
|
if (N(e) && e.isCollapsed()) {
|
|
823
|
-
const { anchor:
|
|
824
|
-
if (i ||
|
|
825
|
-
const a =
|
|
937
|
+
const { anchor: o } = e, i = o.type === "element";
|
|
938
|
+
if (i || o.offset === 0) {
|
|
939
|
+
const a = o.getNode(), l = Wt(
|
|
826
940
|
a,
|
|
827
|
-
(s) =>
|
|
941
|
+
(s) => Ne(s) && !s.isInline()
|
|
828
942
|
);
|
|
829
|
-
if (
|
|
943
|
+
if (K(l)) {
|
|
830
944
|
const s = l.getParent();
|
|
831
|
-
if (
|
|
945
|
+
if (ft(s) && s.getListType() === "check" && (i || l.getFirstDescendant() === a)) {
|
|
832
946
|
const d = t.getElementByKey(l.__key);
|
|
833
947
|
if (d != null && document.activeElement !== d)
|
|
834
948
|
return d.focus(), r.preventDefault(), !0;
|
|
@@ -838,19 +952,19 @@ function Xr() {
|
|
|
838
952
|
}
|
|
839
953
|
return !1;
|
|
840
954
|
}),
|
|
841
|
-
|
|
955
|
+
D
|
|
842
956
|
),
|
|
843
957
|
t.registerRootListener((r, e) => {
|
|
844
|
-
r !== null && (r.addEventListener("click",
|
|
958
|
+
r !== null && (r.addEventListener("click", zt), r.addEventListener("pointerdown", $t)), e !== null && (e.removeEventListener("click", zt), e.removeEventListener("pointerdown", $t));
|
|
845
959
|
})
|
|
846
960
|
), [t]), null;
|
|
847
961
|
}
|
|
848
|
-
function
|
|
962
|
+
function ue(t, r) {
|
|
849
963
|
const e = t.target;
|
|
850
|
-
if (e === null || !
|
|
964
|
+
if (e === null || !St(e))
|
|
851
965
|
return;
|
|
852
|
-
const
|
|
853
|
-
if (
|
|
966
|
+
const o = e.firstChild;
|
|
967
|
+
if (o != null && St(o) && (o.tagName === "UL" || o.tagName === "OL"))
|
|
854
968
|
return;
|
|
855
969
|
const i = e.parentNode;
|
|
856
970
|
if (!i || i.__lexicalListType !== "check")
|
|
@@ -858,23 +972,23 @@ function ae(t, r) {
|
|
|
858
972
|
const a = t.pageX, l = e.getBoundingClientRect();
|
|
859
973
|
(e.dir === "rtl" ? a < l.right && a > l.right - 20 : a > l.left && a < l.left + 20) && r();
|
|
860
974
|
}
|
|
861
|
-
function
|
|
862
|
-
|
|
863
|
-
const r = t.target, e =
|
|
975
|
+
function zt(t) {
|
|
976
|
+
ue(t, () => {
|
|
977
|
+
const r = t.target, e = mn(r);
|
|
864
978
|
e != null && e.isEditable() && e.update(() => {
|
|
865
979
|
if (t.target) {
|
|
866
|
-
const
|
|
867
|
-
|
|
980
|
+
const o = pt(r);
|
|
981
|
+
K(o) && (r.focus(), o.toggleChecked());
|
|
868
982
|
}
|
|
869
983
|
});
|
|
870
984
|
});
|
|
871
985
|
}
|
|
872
|
-
function
|
|
873
|
-
|
|
986
|
+
function $t(t) {
|
|
987
|
+
ue(t, () => {
|
|
874
988
|
t.preventDefault();
|
|
875
989
|
});
|
|
876
990
|
}
|
|
877
|
-
function
|
|
991
|
+
function mn(t) {
|
|
878
992
|
let r = t;
|
|
879
993
|
for (; r; ) {
|
|
880
994
|
if (r.__lexicalEditor)
|
|
@@ -883,30 +997,30 @@ function Qr(t) {
|
|
|
883
997
|
}
|
|
884
998
|
return null;
|
|
885
999
|
}
|
|
886
|
-
function
|
|
1000
|
+
function gt() {
|
|
887
1001
|
const t = document.activeElement;
|
|
888
1002
|
return t != null && t.tagName === "LI" && t.parentNode != null && // @ts-ignore internal field
|
|
889
1003
|
t.parentNode.__lexicalListType === "check" ? t : null;
|
|
890
1004
|
}
|
|
891
|
-
function
|
|
892
|
-
let e = r ? t.getPreviousSibling() : t.getNextSibling(),
|
|
893
|
-
for (; e == null &&
|
|
894
|
-
|
|
895
|
-
for (;
|
|
1005
|
+
function fn(t, r) {
|
|
1006
|
+
let e = r ? t.getPreviousSibling() : t.getNextSibling(), o = t;
|
|
1007
|
+
for (; e == null && K(o); )
|
|
1008
|
+
o = o.getParentOrThrow().getParent(), o != null && (e = r ? o.getPreviousSibling() : o.getNextSibling());
|
|
1009
|
+
for (; K(e); ) {
|
|
896
1010
|
const i = r ? e.getLastChild() : e.getFirstChild();
|
|
897
|
-
if (!
|
|
1011
|
+
if (!ft(i))
|
|
898
1012
|
return e;
|
|
899
1013
|
e = r ? i.getLastChild() : i.getFirstChild();
|
|
900
1014
|
}
|
|
901
1015
|
return null;
|
|
902
1016
|
}
|
|
903
|
-
function
|
|
904
|
-
const
|
|
905
|
-
return
|
|
906
|
-
const i =
|
|
907
|
-
if (!
|
|
1017
|
+
function At(t, r, e) {
|
|
1018
|
+
const o = gt();
|
|
1019
|
+
return o != null && r.update(() => {
|
|
1020
|
+
const i = pt(o);
|
|
1021
|
+
if (!K(i))
|
|
908
1022
|
return;
|
|
909
|
-
const a =
|
|
1023
|
+
const a = fn(i, e);
|
|
910
1024
|
if (a != null) {
|
|
911
1025
|
a.selectStart();
|
|
912
1026
|
const l = r.getElementByKey(a.__key);
|
|
@@ -916,54 +1030,54 @@ function It(t, r, e) {
|
|
|
916
1030
|
}
|
|
917
1031
|
}), !1;
|
|
918
1032
|
}
|
|
919
|
-
const
|
|
920
|
-
function
|
|
921
|
-
const [t] =
|
|
1033
|
+
const Lt = Ee("INSERT_IMAGE_COMMAND");
|
|
1034
|
+
function kn() {
|
|
1035
|
+
const [t] = Ct();
|
|
922
1036
|
return _(() => {
|
|
923
|
-
if (!t.hasNodes([
|
|
1037
|
+
if (!t.hasNodes([U]))
|
|
924
1038
|
throw new Error("ImagePlugin: ImageNode not registered on editor");
|
|
925
|
-
return
|
|
1039
|
+
return ot(
|
|
926
1040
|
t.registerCommand(
|
|
927
|
-
|
|
1041
|
+
Lt,
|
|
928
1042
|
(r) => {
|
|
929
|
-
const e =
|
|
930
|
-
return
|
|
1043
|
+
const e = xt(r);
|
|
1044
|
+
return Re([e]), Ft(e.getParentOrThrow()) && Be(e, G).selectEnd(), !0;
|
|
931
1045
|
},
|
|
932
|
-
|
|
1046
|
+
q
|
|
933
1047
|
)
|
|
934
1048
|
);
|
|
935
1049
|
}, [t]), null;
|
|
936
1050
|
}
|
|
937
|
-
const
|
|
938
|
-
/* @__PURE__ */
|
|
939
|
-
/* @__PURE__ */
|
|
940
|
-
/* @__PURE__ */
|
|
941
|
-
/* @__PURE__ */
|
|
942
|
-
/* @__PURE__ */
|
|
943
|
-
/* @__PURE__ */
|
|
944
|
-
] }),
|
|
1051
|
+
const bn = () => /* @__PURE__ */ h(F, { children: [
|
|
1052
|
+
/* @__PURE__ */ n(Lr, {}),
|
|
1053
|
+
/* @__PURE__ */ n(wr, {}),
|
|
1054
|
+
/* @__PURE__ */ n(_r, {}),
|
|
1055
|
+
/* @__PURE__ */ n(pn, {}),
|
|
1056
|
+
/* @__PURE__ */ n(yr, {}),
|
|
1057
|
+
/* @__PURE__ */ n(kn, {})
|
|
1058
|
+
] }), vn = ({
|
|
945
1059
|
state: t
|
|
946
1060
|
}) => {
|
|
947
|
-
const [r] = x(), e =
|
|
1061
|
+
const [r] = x(), e = V(!1);
|
|
948
1062
|
return _(() => {
|
|
949
1063
|
!t || e.current || (e.current = !0, window.queueMicrotask(() => {
|
|
950
1064
|
try {
|
|
951
|
-
if (
|
|
952
|
-
t.isEmpty() ?
|
|
1065
|
+
if (Nr(t)) {
|
|
1066
|
+
t.isEmpty() ? Er(r) : r.setEditorState(t);
|
|
953
1067
|
return;
|
|
954
1068
|
}
|
|
955
|
-
if (typeof t == "string" && !
|
|
956
|
-
|
|
1069
|
+
if (typeof t == "string" && !Tt(t)) {
|
|
1070
|
+
Rr(t, r);
|
|
957
1071
|
return;
|
|
958
1072
|
}
|
|
959
|
-
const
|
|
960
|
-
|
|
961
|
-
} catch (
|
|
962
|
-
console.error("Could not parse"), console.error(
|
|
1073
|
+
const o = r.parseEditorState(t);
|
|
1074
|
+
o.isEmpty() || r.setEditorState(o);
|
|
1075
|
+
} catch (o) {
|
|
1076
|
+
console.error("Could not parse"), console.error(o);
|
|
963
1077
|
}
|
|
964
1078
|
}));
|
|
965
1079
|
}, []), null;
|
|
966
|
-
},
|
|
1080
|
+
}, Cn = nr("div", {
|
|
967
1081
|
border: "1px solid $borderDarker",
|
|
968
1082
|
borderRadius: "$md",
|
|
969
1083
|
position: "relative",
|
|
@@ -1000,10 +1114,10 @@ const tn = () => /* @__PURE__ */ u(j, { children: [
|
|
|
1000
1114
|
}
|
|
1001
1115
|
}
|
|
1002
1116
|
]
|
|
1003
|
-
}),
|
|
1117
|
+
}), Mn = ({
|
|
1004
1118
|
isLoading: t
|
|
1005
|
-
}) => /* @__PURE__ */
|
|
1006
|
-
|
|
1119
|
+
}) => /* @__PURE__ */ n(
|
|
1120
|
+
P,
|
|
1007
1121
|
{
|
|
1008
1122
|
css: {
|
|
1009
1123
|
visibility: t ? "visible" : "hidden",
|
|
@@ -1012,58 +1126,58 @@ const tn = () => /* @__PURE__ */ u(j, { children: [
|
|
|
1012
1126
|
right: "1rem",
|
|
1013
1127
|
display: "flex"
|
|
1014
1128
|
},
|
|
1015
|
-
children: /* @__PURE__ */
|
|
1129
|
+
children: /* @__PURE__ */ n(kt, {})
|
|
1016
1130
|
}
|
|
1017
|
-
),
|
|
1131
|
+
), so = ({
|
|
1018
1132
|
isLoading: t,
|
|
1019
1133
|
children: r,
|
|
1020
1134
|
placeholderText: e,
|
|
1021
|
-
nodes:
|
|
1135
|
+
nodes: o,
|
|
1022
1136
|
plugins: i,
|
|
1023
1137
|
toolbar: a,
|
|
1024
1138
|
toolbarContent: l,
|
|
1025
1139
|
content: s,
|
|
1026
1140
|
hideBorder: d,
|
|
1027
1141
|
onBlur: c,
|
|
1028
|
-
defaultState:
|
|
1142
|
+
defaultState: u,
|
|
1029
1143
|
css: g,
|
|
1030
1144
|
signUrl: k,
|
|
1031
|
-
fileUpload:
|
|
1032
|
-
editable:
|
|
1145
|
+
fileUpload: E,
|
|
1146
|
+
editable: R = !0
|
|
1033
1147
|
}) => {
|
|
1034
|
-
const { hasFocus:
|
|
1035
|
-
() => ({ hasFocus:
|
|
1036
|
-
[
|
|
1148
|
+
const { hasFocus: b, attributes: p } = Ir({ onBlur: c }), C = V(null), y = Qt(
|
|
1149
|
+
() => ({ hasFocus: b, editorRef: C, signUrl: k, fileUpload: E }),
|
|
1150
|
+
[b, k, E]
|
|
1037
1151
|
);
|
|
1038
|
-
return /* @__PURE__ */
|
|
1039
|
-
|
|
1152
|
+
return /* @__PURE__ */ n(de.Provider, { value: y, children: /* @__PURE__ */ h(
|
|
1153
|
+
pr,
|
|
1040
1154
|
{
|
|
1041
1155
|
initialConfig: {
|
|
1042
1156
|
namespace: "ain-rich-text",
|
|
1043
|
-
onError: (
|
|
1044
|
-
console.error(
|
|
1157
|
+
onError: (I) => {
|
|
1158
|
+
console.error(I);
|
|
1045
1159
|
},
|
|
1046
|
-
theme:
|
|
1047
|
-
nodes:
|
|
1048
|
-
editable:
|
|
1160
|
+
theme: Mt,
|
|
1161
|
+
nodes: o,
|
|
1162
|
+
editable: R
|
|
1049
1163
|
},
|
|
1050
1164
|
children: [
|
|
1051
|
-
/* @__PURE__ */
|
|
1052
|
-
|
|
1165
|
+
/* @__PURE__ */ h(
|
|
1166
|
+
Cn,
|
|
1053
1167
|
{
|
|
1054
1168
|
ref: C,
|
|
1055
|
-
hasFocus:
|
|
1169
|
+
hasFocus: b,
|
|
1056
1170
|
hideBorder: d,
|
|
1057
1171
|
css: g,
|
|
1058
|
-
...
|
|
1172
|
+
...p,
|
|
1059
1173
|
children: [
|
|
1060
1174
|
a,
|
|
1061
|
-
/* @__PURE__ */
|
|
1062
|
-
|
|
1175
|
+
/* @__PURE__ */ n(
|
|
1176
|
+
mr,
|
|
1063
1177
|
{
|
|
1064
1178
|
contentEditable: s,
|
|
1065
|
-
placeholder: e ? /* @__PURE__ */
|
|
1066
|
-
|
|
1179
|
+
placeholder: e ? /* @__PURE__ */ n(
|
|
1180
|
+
P,
|
|
1067
1181
|
{
|
|
1068
1182
|
css: {
|
|
1069
1183
|
position: "absolute",
|
|
@@ -1076,22 +1190,22 @@ const tn = () => /* @__PURE__ */ u(j, { children: [
|
|
|
1076
1190
|
children: e
|
|
1077
1191
|
}
|
|
1078
1192
|
) : null,
|
|
1079
|
-
ErrorBoundary:
|
|
1193
|
+
ErrorBoundary: fr
|
|
1080
1194
|
}
|
|
1081
1195
|
),
|
|
1082
|
-
/* @__PURE__ */
|
|
1196
|
+
/* @__PURE__ */ n(bn, {}),
|
|
1083
1197
|
i,
|
|
1084
|
-
/* @__PURE__ */
|
|
1085
|
-
|
|
1198
|
+
/* @__PURE__ */ n(Mn, { isLoading: t }),
|
|
1199
|
+
R && !a && /* @__PURE__ */ n(un, { children: l })
|
|
1086
1200
|
]
|
|
1087
1201
|
}
|
|
1088
1202
|
),
|
|
1089
|
-
/* @__PURE__ */
|
|
1090
|
-
/* @__PURE__ */
|
|
1203
|
+
/* @__PURE__ */ n(vn, { state: u }),
|
|
1204
|
+
/* @__PURE__ */ n(F, { children: r })
|
|
1091
1205
|
]
|
|
1092
1206
|
}
|
|
1093
1207
|
) });
|
|
1094
|
-
},
|
|
1208
|
+
}, Tn = {
|
|
1095
1209
|
fontSize: "1rem",
|
|
1096
1210
|
lineHeight: "1.5",
|
|
1097
1211
|
"h1, h2, h3, h4, h5, h6": {
|
|
@@ -1138,6 +1252,9 @@ const tn = () => /* @__PURE__ */ u(j, { children: [
|
|
|
1138
1252
|
".ain-rich-text-underline": {
|
|
1139
1253
|
textDecoration: "underline"
|
|
1140
1254
|
},
|
|
1255
|
+
".ain-rich-text-strikethrough": {
|
|
1256
|
+
textDecoration: "line-through"
|
|
1257
|
+
},
|
|
1141
1258
|
"ul, ol": {
|
|
1142
1259
|
paddingLeft: "1.8em",
|
|
1143
1260
|
listStylePosition: "outside",
|
|
@@ -1285,32 +1402,32 @@ const tn = () => /* @__PURE__ */ u(j, { children: [
|
|
|
1285
1402
|
defaultVariants: {
|
|
1286
1403
|
size: "md"
|
|
1287
1404
|
}
|
|
1288
|
-
},
|
|
1405
|
+
}, co = xr(Tn), xn = ({
|
|
1289
1406
|
fileUpload: t,
|
|
1290
1407
|
...r
|
|
1291
1408
|
}) => {
|
|
1292
|
-
const [e] = x(), [
|
|
1409
|
+
const [e] = x(), [o, i] = m(null), a = (s) => {
|
|
1293
1410
|
var c;
|
|
1294
1411
|
const d = (c = s.target.files) == null ? void 0 : c[0];
|
|
1295
1412
|
if (d) {
|
|
1296
|
-
const
|
|
1297
|
-
|
|
1413
|
+
const u = new Image(), g = window.URL.createObjectURL(d);
|
|
1414
|
+
u.onload = async () => {
|
|
1298
1415
|
const k = await t.uploadFile({ file: d });
|
|
1299
|
-
i({ url: k, width:
|
|
1300
|
-
},
|
|
1416
|
+
i({ url: k, width: u.naturalWidth, height: u.naturalHeight }), window.URL.revokeObjectURL(g);
|
|
1417
|
+
}, u.src = g;
|
|
1301
1418
|
}
|
|
1302
1419
|
}, l = () => {
|
|
1303
|
-
|
|
1304
|
-
src:
|
|
1305
|
-
altText: `Image: ${
|
|
1306
|
-
meta: { width:
|
|
1420
|
+
o && !t.isLoading && (e.dispatchCommand(Lt, {
|
|
1421
|
+
src: o.url,
|
|
1422
|
+
altText: `Image: ${o.url}`,
|
|
1423
|
+
meta: { width: o.width, height: o.height }
|
|
1307
1424
|
}), r.onOpenChange(!1));
|
|
1308
1425
|
};
|
|
1309
|
-
return /* @__PURE__ */
|
|
1310
|
-
/* @__PURE__ */
|
|
1311
|
-
t.isLoading && /* @__PURE__ */
|
|
1312
|
-
/* @__PURE__ */
|
|
1313
|
-
|
|
1426
|
+
return /* @__PURE__ */ h(ne, { ...r, children: [
|
|
1427
|
+
/* @__PURE__ */ n(or, { children: "Sett inn bilde" }),
|
|
1428
|
+
t.isLoading && /* @__PURE__ */ n(kt, {}),
|
|
1429
|
+
/* @__PURE__ */ n(
|
|
1430
|
+
bt,
|
|
1314
1431
|
{
|
|
1315
1432
|
type: "file",
|
|
1316
1433
|
accept: "image/*",
|
|
@@ -1318,113 +1435,113 @@ const tn = () => /* @__PURE__ */ u(j, { children: [
|
|
|
1318
1435
|
disabled: t.isLoading
|
|
1319
1436
|
}
|
|
1320
1437
|
),
|
|
1321
|
-
/* @__PURE__ */
|
|
1322
|
-
/* @__PURE__ */
|
|
1323
|
-
/* @__PURE__ */
|
|
1324
|
-
|
|
1438
|
+
/* @__PURE__ */ h(st, { children: [
|
|
1439
|
+
/* @__PURE__ */ n(w, { onClick: () => r.onOpenChange(!1), children: "Avbryt" }),
|
|
1440
|
+
/* @__PURE__ */ n(
|
|
1441
|
+
w,
|
|
1325
1442
|
{
|
|
1326
1443
|
variant: "primary",
|
|
1327
|
-
disabled: !
|
|
1444
|
+
disabled: !o || t.isLoading,
|
|
1328
1445
|
onClick: l,
|
|
1329
1446
|
children: "Sett inn"
|
|
1330
1447
|
}
|
|
1331
1448
|
)
|
|
1332
1449
|
] })
|
|
1333
1450
|
] });
|
|
1334
|
-
},
|
|
1335
|
-
const [t] = x(), { fileUpload: r } =
|
|
1336
|
-
t.dispatchCommand(
|
|
1451
|
+
}, ho = () => {
|
|
1452
|
+
const [t] = x(), { fileUpload: r } = H(), [e, o] = m(!1), i = M(() => {
|
|
1453
|
+
t.dispatchCommand(Je, {
|
|
1337
1454
|
rows: "3",
|
|
1338
1455
|
columns: "3",
|
|
1339
1456
|
includeHeaders: !1
|
|
1340
1457
|
});
|
|
1341
1458
|
}, [t]);
|
|
1342
|
-
return /* @__PURE__ */
|
|
1343
|
-
/* @__PURE__ */
|
|
1344
|
-
|
|
1459
|
+
return /* @__PURE__ */ h(F, { children: [
|
|
1460
|
+
/* @__PURE__ */ h(
|
|
1461
|
+
at,
|
|
1345
1462
|
{
|
|
1346
|
-
trigger: /* @__PURE__ */
|
|
1463
|
+
trigger: /* @__PURE__ */ n(lt, { dropdown: !0, children: "Sett inn" }),
|
|
1347
1464
|
side: "bottom",
|
|
1348
1465
|
align: "end",
|
|
1349
1466
|
children: [
|
|
1350
|
-
/* @__PURE__ */
|
|
1351
|
-
/* @__PURE__ */
|
|
1467
|
+
/* @__PURE__ */ h(T, { onClick: i, children: [
|
|
1468
|
+
/* @__PURE__ */ n(en, { size: "1.25rem" }),
|
|
1352
1469
|
" Tabell"
|
|
1353
1470
|
] }),
|
|
1354
|
-
r && /* @__PURE__ */
|
|
1355
|
-
/* @__PURE__ */
|
|
1471
|
+
r && /* @__PURE__ */ h(T, { onClick: () => o(!0), children: [
|
|
1472
|
+
/* @__PURE__ */ n(ur, { size: "1.25rem" }),
|
|
1356
1473
|
" Bilde"
|
|
1357
1474
|
] })
|
|
1358
1475
|
]
|
|
1359
1476
|
}
|
|
1360
1477
|
),
|
|
1361
|
-
r && /* @__PURE__ */
|
|
1362
|
-
|
|
1478
|
+
r && /* @__PURE__ */ n(
|
|
1479
|
+
xn,
|
|
1363
1480
|
{
|
|
1364
1481
|
open: e,
|
|
1365
|
-
onOpenChange:
|
|
1482
|
+
onOpenChange: o,
|
|
1366
1483
|
fileUpload: r
|
|
1367
1484
|
}
|
|
1368
1485
|
)
|
|
1369
1486
|
] });
|
|
1370
1487
|
};
|
|
1371
|
-
function
|
|
1488
|
+
function Ln(t) {
|
|
1372
1489
|
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);
|
|
1373
1490
|
}
|
|
1374
|
-
const
|
|
1375
|
-
const [t] = x(), [r, e] =
|
|
1491
|
+
const uo = () => {
|
|
1492
|
+
const [t] = x(), [r, e] = m(null), { hasFocus: o } = H();
|
|
1376
1493
|
_(() => {
|
|
1377
|
-
!
|
|
1378
|
-
}, [
|
|
1379
|
-
const { refs: i, floatingStyles: a } =
|
|
1494
|
+
!o && r && e(null);
|
|
1495
|
+
}, [o, r]);
|
|
1496
|
+
const { refs: i, floatingStyles: a } = vt({
|
|
1380
1497
|
placement: "top-end",
|
|
1381
1498
|
open: !!r,
|
|
1382
1499
|
elements: {
|
|
1383
1500
|
reference: r
|
|
1384
1501
|
},
|
|
1385
|
-
middleware: [
|
|
1502
|
+
middleware: [ie({ mainAxis: -20, crossAxis: -2 })]
|
|
1386
1503
|
});
|
|
1387
1504
|
_(() => t.registerCommand(
|
|
1388
|
-
|
|
1505
|
+
X,
|
|
1389
1506
|
() => {
|
|
1390
|
-
const s =
|
|
1507
|
+
const s = L();
|
|
1391
1508
|
if (N(s)) {
|
|
1392
|
-
const d = s.anchor.getNode(), c =
|
|
1509
|
+
const d = s.anchor.getNode(), c = Ye(d);
|
|
1393
1510
|
e(c ? t.getElementByKey(c.getKey()) : null);
|
|
1394
1511
|
}
|
|
1395
1512
|
return !1;
|
|
1396
1513
|
},
|
|
1397
|
-
|
|
1514
|
+
q
|
|
1398
1515
|
), [t]);
|
|
1399
1516
|
const l = (s) => () => {
|
|
1400
1517
|
t.update(() => {
|
|
1401
1518
|
switch (s) {
|
|
1402
1519
|
case "add-row-over":
|
|
1403
|
-
|
|
1520
|
+
Et(!1);
|
|
1404
1521
|
break;
|
|
1405
1522
|
case "add-row-under":
|
|
1406
|
-
|
|
1523
|
+
Et(!0);
|
|
1407
1524
|
break;
|
|
1408
1525
|
case "add-column-left":
|
|
1409
|
-
|
|
1526
|
+
Nt(!1);
|
|
1410
1527
|
break;
|
|
1411
1528
|
case "add-column-right":
|
|
1412
|
-
|
|
1529
|
+
Nt(!0);
|
|
1413
1530
|
break;
|
|
1414
1531
|
case "delete-row":
|
|
1415
|
-
|
|
1532
|
+
Ve();
|
|
1416
1533
|
break;
|
|
1417
1534
|
case "delete-column":
|
|
1418
|
-
|
|
1535
|
+
Xe();
|
|
1419
1536
|
break;
|
|
1420
1537
|
}
|
|
1421
1538
|
});
|
|
1422
1539
|
};
|
|
1423
|
-
return r ? /* @__PURE__ */
|
|
1424
|
-
|
|
1540
|
+
return r ? /* @__PURE__ */ h(
|
|
1541
|
+
at,
|
|
1425
1542
|
{
|
|
1426
|
-
trigger: /* @__PURE__ */
|
|
1427
|
-
|
|
1543
|
+
trigger: /* @__PURE__ */ n(
|
|
1544
|
+
w,
|
|
1428
1545
|
{
|
|
1429
1546
|
icon: !0,
|
|
1430
1547
|
variant: "primary",
|
|
@@ -1432,44 +1549,44 @@ const qn = () => {
|
|
|
1432
1549
|
ref: i.setFloating,
|
|
1433
1550
|
style: a,
|
|
1434
1551
|
css: { padding: "2px", width: "18px", height: "18px" },
|
|
1435
|
-
children: /* @__PURE__ */
|
|
1552
|
+
children: /* @__PURE__ */ n(Ln, {})
|
|
1436
1553
|
}
|
|
1437
1554
|
),
|
|
1438
1555
|
children: [
|
|
1439
|
-
/* @__PURE__ */
|
|
1440
|
-
/* @__PURE__ */
|
|
1441
|
-
/* @__PURE__ */
|
|
1442
|
-
/* @__PURE__ */
|
|
1443
|
-
/* @__PURE__ */
|
|
1444
|
-
/* @__PURE__ */
|
|
1445
|
-
/* @__PURE__ */
|
|
1446
|
-
/* @__PURE__ */
|
|
1556
|
+
/* @__PURE__ */ n(W, { onClick: l("add-row-over"), children: "Legg til rad over" }),
|
|
1557
|
+
/* @__PURE__ */ n(W, { onClick: l("add-row-under"), children: "Legg til rad under" }),
|
|
1558
|
+
/* @__PURE__ */ n(It, {}),
|
|
1559
|
+
/* @__PURE__ */ n(W, { onClick: l("add-column-left"), children: "Legg til kolonne venstre" }),
|
|
1560
|
+
/* @__PURE__ */ n(W, { onClick: l("add-column-right"), children: "Legg til kolonne høyre" }),
|
|
1561
|
+
/* @__PURE__ */ n(It, {}),
|
|
1562
|
+
/* @__PURE__ */ n(W, { onClick: l("delete-row"), children: "Fjern rad" }),
|
|
1563
|
+
/* @__PURE__ */ n(W, { onClick: l("delete-column"), children: "Fjern kolonne" })
|
|
1447
1564
|
]
|
|
1448
1565
|
}
|
|
1449
1566
|
) : null;
|
|
1450
1567
|
};
|
|
1451
|
-
function
|
|
1568
|
+
function _t(t) {
|
|
1452
1569
|
let r = t;
|
|
1453
|
-
const e = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi,
|
|
1454
|
-
return r = String(r).trim(), r.match(e) || r.match(
|
|
1570
|
+
const e = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi, o = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
|
|
1571
|
+
return r = String(r).trim(), r.match(e) || r.match(o) ? r : "https://";
|
|
1455
1572
|
}
|
|
1456
|
-
function
|
|
1457
|
-
const r = t.anchor, e = t.focus,
|
|
1458
|
-
return
|
|
1573
|
+
function ge(t) {
|
|
1574
|
+
const r = t.anchor, e = t.focus, o = t.anchor.getNode(), i = t.focus.getNode();
|
|
1575
|
+
return o === i ? o : t.isBackward() ? yt(e) ? o : i : yt(r) ? o : i;
|
|
1459
1576
|
}
|
|
1460
|
-
const
|
|
1577
|
+
const go = (t) => (B.baseURL = t, B), rt = class extends j {
|
|
1461
1578
|
static getType() {
|
|
1462
1579
|
return "rutine_link";
|
|
1463
1580
|
}
|
|
1464
1581
|
static clone(r) {
|
|
1465
|
-
return new
|
|
1582
|
+
return new rt(r.__url, {}, r.__key);
|
|
1466
1583
|
}
|
|
1467
1584
|
createDOM(r) {
|
|
1468
1585
|
const e = super.createDOM(r);
|
|
1469
1586
|
return e.setAttribute("href", this.getURL()), e.setAttribute("target", "_blank"), e.setAttribute("rel", "noopener noreferrer"), e.classList.add("rutine-link"), e;
|
|
1470
1587
|
}
|
|
1471
1588
|
static importJSON(r) {
|
|
1472
|
-
return
|
|
1589
|
+
return pe(r.url);
|
|
1473
1590
|
}
|
|
1474
1591
|
exportJSON() {
|
|
1475
1592
|
return {
|
|
@@ -1481,58 +1598,58 @@ const Jn = (t) => (A.baseURL = t, A), Q = class extends F {
|
|
|
1481
1598
|
}
|
|
1482
1599
|
getURL() {
|
|
1483
1600
|
try {
|
|
1484
|
-
return new URL(this.__url,
|
|
1601
|
+
return new URL(this.__url, rt.baseURL).toString();
|
|
1485
1602
|
} catch {
|
|
1486
1603
|
return "";
|
|
1487
1604
|
}
|
|
1488
1605
|
}
|
|
1489
1606
|
};
|
|
1490
|
-
let
|
|
1491
|
-
|
|
1492
|
-
function
|
|
1493
|
-
return new
|
|
1607
|
+
let B = rt;
|
|
1608
|
+
$(B, "baseURL", "");
|
|
1609
|
+
function pe(t) {
|
|
1610
|
+
return new B(t);
|
|
1494
1611
|
}
|
|
1495
|
-
function
|
|
1496
|
-
return t instanceof
|
|
1612
|
+
function _n(t) {
|
|
1613
|
+
return t instanceof B;
|
|
1497
1614
|
}
|
|
1498
|
-
const
|
|
1499
|
-
const [r] = x(), e =
|
|
1615
|
+
const wn = ({ onClose: t }) => {
|
|
1616
|
+
const [r] = x(), e = M(
|
|
1500
1617
|
(i) => {
|
|
1501
1618
|
r.update(() => {
|
|
1502
|
-
const a =
|
|
1619
|
+
const a = L();
|
|
1503
1620
|
if (N(a) && a.isCollapsed()) {
|
|
1504
|
-
const l =
|
|
1621
|
+
const l = z(i);
|
|
1505
1622
|
a.insertNodes([l]);
|
|
1506
|
-
const s =
|
|
1507
|
-
s.setTextNodeRange(l, 0, l, i.length),
|
|
1623
|
+
const s = Ut();
|
|
1624
|
+
s.setTextNodeRange(l, 0, l, i.length), nt(s);
|
|
1508
1625
|
}
|
|
1509
|
-
r.dispatchCommand(
|
|
1626
|
+
r.dispatchCommand(it, _t(i));
|
|
1510
1627
|
});
|
|
1511
1628
|
},
|
|
1512
1629
|
[r]
|
|
1513
1630
|
);
|
|
1514
|
-
return /* @__PURE__ */
|
|
1631
|
+
return /* @__PURE__ */ h("form", { onSubmit: (i) => {
|
|
1515
1632
|
e(i.currentTarget.url.value), t();
|
|
1516
1633
|
}, children: [
|
|
1517
|
-
/* @__PURE__ */
|
|
1518
|
-
/* @__PURE__ */
|
|
1519
|
-
/* @__PURE__ */
|
|
1520
|
-
/* @__PURE__ */
|
|
1634
|
+
/* @__PURE__ */ n(bt, { name: "url", label: "URL", type: "url", required: !0 }),
|
|
1635
|
+
/* @__PURE__ */ h(st, { children: [
|
|
1636
|
+
/* @__PURE__ */ n(w, { onClick: t, children: "Avbryt" }),
|
|
1637
|
+
/* @__PURE__ */ n(w, { type: "submit", variant: "primary", children: "Sett inn" })
|
|
1521
1638
|
] })
|
|
1522
1639
|
] });
|
|
1523
|
-
},
|
|
1640
|
+
}, yn = ({
|
|
1524
1641
|
onClose: t,
|
|
1525
1642
|
getDocs: r
|
|
1526
1643
|
}) => {
|
|
1527
|
-
const [e] = x(), [
|
|
1644
|
+
const [e] = x(), [o, i] = m([]), a = r(), l = M(
|
|
1528
1645
|
(s) => {
|
|
1529
1646
|
e.update(() => {
|
|
1530
|
-
const d =
|
|
1647
|
+
const d = L();
|
|
1531
1648
|
if (N(d)) {
|
|
1532
1649
|
const c = [];
|
|
1533
|
-
for (const [
|
|
1534
|
-
const k =
|
|
1535
|
-
k.append(
|
|
1650
|
+
for (const [u, g] of s.entries()) {
|
|
1651
|
+
const k = pe(g.value);
|
|
1652
|
+
k.append(z(g.label)), c.push(k), u !== s.length - 1 && c.push(z(" "));
|
|
1536
1653
|
}
|
|
1537
1654
|
d.insertNodes(c);
|
|
1538
1655
|
}
|
|
@@ -1540,37 +1657,37 @@ const cn = ({ onClose: t }) => {
|
|
|
1540
1657
|
},
|
|
1541
1658
|
[e]
|
|
1542
1659
|
);
|
|
1543
|
-
return /* @__PURE__ */
|
|
1544
|
-
/* @__PURE__ */
|
|
1545
|
-
|
|
1660
|
+
return /* @__PURE__ */ h(F, { children: [
|
|
1661
|
+
/* @__PURE__ */ n(
|
|
1662
|
+
ar,
|
|
1546
1663
|
{
|
|
1547
1664
|
isMulti: !0,
|
|
1548
1665
|
options: a,
|
|
1549
1666
|
onChange: (s) => i(s)
|
|
1550
1667
|
}
|
|
1551
1668
|
),
|
|
1552
|
-
/* @__PURE__ */
|
|
1553
|
-
/* @__PURE__ */
|
|
1554
|
-
/* @__PURE__ */
|
|
1555
|
-
|
|
1669
|
+
/* @__PURE__ */ h(st, { children: [
|
|
1670
|
+
/* @__PURE__ */ n(w, { onClick: t, children: "Avbryt" }),
|
|
1671
|
+
/* @__PURE__ */ n(
|
|
1672
|
+
w,
|
|
1556
1673
|
{
|
|
1557
1674
|
variant: "primary",
|
|
1558
1675
|
onClick: () => {
|
|
1559
|
-
l(
|
|
1676
|
+
l(o), t();
|
|
1560
1677
|
},
|
|
1561
1678
|
children: "Sett inn"
|
|
1562
1679
|
}
|
|
1563
1680
|
)
|
|
1564
1681
|
] })
|
|
1565
1682
|
] });
|
|
1566
|
-
},
|
|
1683
|
+
}, Sn = ({
|
|
1567
1684
|
onClose: t,
|
|
1568
1685
|
fileUpload: r,
|
|
1569
1686
|
filePrefix: e
|
|
1570
1687
|
}) => {
|
|
1571
|
-
const [
|
|
1572
|
-
var
|
|
1573
|
-
const c = (
|
|
1688
|
+
const [o] = x(), [i, a] = m(null), l = async (d) => {
|
|
1689
|
+
var u;
|
|
1690
|
+
const c = (u = d.target.files) == null ? void 0 : u[0];
|
|
1574
1691
|
if (c) {
|
|
1575
1692
|
const g = await r.uploadFile({ file: c });
|
|
1576
1693
|
a({
|
|
@@ -1578,34 +1695,34 @@ const cn = ({ onClose: t }) => {
|
|
|
1578
1695
|
url: e ? `${e}${g}` : g
|
|
1579
1696
|
});
|
|
1580
1697
|
}
|
|
1581
|
-
}, s =
|
|
1582
|
-
|
|
1698
|
+
}, s = M(() => {
|
|
1699
|
+
o.update(() => {
|
|
1583
1700
|
if (!i)
|
|
1584
1701
|
return;
|
|
1585
|
-
const d =
|
|
1702
|
+
const d = L();
|
|
1586
1703
|
if (N(d) && d.isCollapsed()) {
|
|
1587
|
-
const c =
|
|
1704
|
+
const c = z(i.name);
|
|
1588
1705
|
d.insertNodes([c]);
|
|
1589
|
-
const
|
|
1590
|
-
|
|
1706
|
+
const u = Ut();
|
|
1707
|
+
u.setTextNodeRange(c, 0, c, i.name.length), nt(u);
|
|
1591
1708
|
}
|
|
1592
|
-
|
|
1709
|
+
o.dispatchCommand(it, _t(i.url));
|
|
1593
1710
|
});
|
|
1594
|
-
}, [
|
|
1595
|
-
return /* @__PURE__ */
|
|
1596
|
-
r.isLoading && /* @__PURE__ */
|
|
1597
|
-
/* @__PURE__ */
|
|
1598
|
-
|
|
1711
|
+
}, [o, i]);
|
|
1712
|
+
return /* @__PURE__ */ h(F, { children: [
|
|
1713
|
+
r.isLoading && /* @__PURE__ */ n(kt, {}),
|
|
1714
|
+
/* @__PURE__ */ n(
|
|
1715
|
+
bt,
|
|
1599
1716
|
{
|
|
1600
1717
|
type: "file",
|
|
1601
1718
|
onChange: l,
|
|
1602
1719
|
disabled: r.isLoading
|
|
1603
1720
|
}
|
|
1604
1721
|
),
|
|
1605
|
-
/* @__PURE__ */
|
|
1606
|
-
/* @__PURE__ */
|
|
1607
|
-
/* @__PURE__ */
|
|
1608
|
-
|
|
1722
|
+
/* @__PURE__ */ h(st, { children: [
|
|
1723
|
+
/* @__PURE__ */ n(w, { onClick: t, children: "Avbryt" }),
|
|
1724
|
+
/* @__PURE__ */ n(
|
|
1725
|
+
w,
|
|
1609
1726
|
{
|
|
1610
1727
|
variant: "primary",
|
|
1611
1728
|
onClick: () => {
|
|
@@ -1617,68 +1734,68 @@ const cn = ({ onClose: t }) => {
|
|
|
1617
1734
|
)
|
|
1618
1735
|
] })
|
|
1619
1736
|
] });
|
|
1620
|
-
},
|
|
1737
|
+
}, Nn = ({
|
|
1621
1738
|
open: t,
|
|
1622
1739
|
onOpenChange: r,
|
|
1623
1740
|
getDocs: e,
|
|
1624
|
-
filePrefix:
|
|
1741
|
+
filePrefix: o
|
|
1625
1742
|
}) => {
|
|
1626
|
-
const { fileUpload: i } =
|
|
1743
|
+
const { fileUpload: i } = H(), [a, l] = m("url"), s = () => {
|
|
1627
1744
|
r(!1);
|
|
1628
1745
|
};
|
|
1629
|
-
return /* @__PURE__ */
|
|
1630
|
-
/* @__PURE__ */
|
|
1631
|
-
/* @__PURE__ */
|
|
1632
|
-
e && /* @__PURE__ */
|
|
1633
|
-
|
|
1746
|
+
return /* @__PURE__ */ h(ne, { open: t, onOpenChange: r, css: { width: "600px" }, children: [
|
|
1747
|
+
/* @__PURE__ */ h(ir, { css: { marginBottom: "$8" }, children: [
|
|
1748
|
+
/* @__PURE__ */ n(ut, { active: a === "url", onClick: () => l("url"), children: "URL" }),
|
|
1749
|
+
e && /* @__PURE__ */ n(
|
|
1750
|
+
ut,
|
|
1634
1751
|
{
|
|
1635
1752
|
active: a === "rutine",
|
|
1636
1753
|
onClick: () => l("rutine"),
|
|
1637
1754
|
children: "Rutine"
|
|
1638
1755
|
}
|
|
1639
1756
|
),
|
|
1640
|
-
i && /* @__PURE__ */
|
|
1757
|
+
i && /* @__PURE__ */ n(ut, { active: a === "file", onClick: () => l("file"), children: "Fil" })
|
|
1641
1758
|
] }),
|
|
1642
|
-
a === "url" && /* @__PURE__ */
|
|
1643
|
-
a === "rutine" && e && /* @__PURE__ */
|
|
1644
|
-
a === "file" && i && /* @__PURE__ */
|
|
1645
|
-
|
|
1759
|
+
a === "url" && /* @__PURE__ */ n(wn, { onClose: s }),
|
|
1760
|
+
a === "rutine" && e && /* @__PURE__ */ n(yn, { onClose: s, getDocs: e }),
|
|
1761
|
+
a === "file" && i && /* @__PURE__ */ n(
|
|
1762
|
+
Sn,
|
|
1646
1763
|
{
|
|
1647
1764
|
onClose: s,
|
|
1648
1765
|
fileUpload: i,
|
|
1649
|
-
filePrefix:
|
|
1766
|
+
filePrefix: o
|
|
1650
1767
|
}
|
|
1651
1768
|
)
|
|
1652
1769
|
] });
|
|
1653
|
-
},
|
|
1770
|
+
}, po = ({
|
|
1654
1771
|
getDocs: t,
|
|
1655
1772
|
filePrefix: r
|
|
1656
1773
|
}) => {
|
|
1657
|
-
const [e] = x(), [
|
|
1658
|
-
const d =
|
|
1774
|
+
const [e] = x(), [o, i] = m(!1), [a, l] = m(!1), s = M(() => {
|
|
1775
|
+
const d = L();
|
|
1659
1776
|
if (N(d)) {
|
|
1660
|
-
const c =
|
|
1661
|
-
i(
|
|
1777
|
+
const c = ge(d), u = c.getParent();
|
|
1778
|
+
i(Z(u) || Z(c));
|
|
1662
1779
|
}
|
|
1663
1780
|
}, []);
|
|
1664
1781
|
return _(() => e.registerCommand(
|
|
1665
|
-
|
|
1782
|
+
X,
|
|
1666
1783
|
() => (s(), !1),
|
|
1667
|
-
|
|
1668
|
-
), [e, s]), /* @__PURE__ */
|
|
1669
|
-
/* @__PURE__ */
|
|
1670
|
-
|
|
1784
|
+
q
|
|
1785
|
+
), [e, s]), /* @__PURE__ */ h(tt, { type: "single", value: o ? "link" : "", children: [
|
|
1786
|
+
/* @__PURE__ */ n(
|
|
1787
|
+
O,
|
|
1671
1788
|
{
|
|
1672
1789
|
onClick: () => {
|
|
1673
|
-
|
|
1790
|
+
o ? e.dispatchCommand(it, null) : l(!0);
|
|
1674
1791
|
},
|
|
1675
1792
|
title: "Lenke",
|
|
1676
1793
|
value: "link",
|
|
1677
|
-
children: /* @__PURE__ */
|
|
1794
|
+
children: /* @__PURE__ */ n(qr, { size: "1.25rem" })
|
|
1678
1795
|
}
|
|
1679
1796
|
),
|
|
1680
|
-
/* @__PURE__ */
|
|
1681
|
-
|
|
1797
|
+
/* @__PURE__ */ n(
|
|
1798
|
+
Nn,
|
|
1682
1799
|
{
|
|
1683
1800
|
open: a,
|
|
1684
1801
|
onOpenChange: l,
|
|
@@ -1687,67 +1804,67 @@ const cn = ({ onClose: t }) => {
|
|
|
1687
1804
|
}
|
|
1688
1805
|
)
|
|
1689
1806
|
] });
|
|
1690
|
-
},
|
|
1691
|
-
const [t] = x(), r =
|
|
1807
|
+
}, mo = () => {
|
|
1808
|
+
const [t] = x(), r = V(null), [e, o] = m(null), [i, a] = m(""), { hasFocus: l } = H();
|
|
1692
1809
|
_(() => {
|
|
1693
1810
|
e ? t.update(() => {
|
|
1694
1811
|
a(e.getURL());
|
|
1695
1812
|
}) : a("");
|
|
1696
1813
|
}, [t, e]);
|
|
1697
|
-
const s = !!(e && i && l), { refs: d, floatingStyles: c, context:
|
|
1814
|
+
const s = !!(e && i && l), { refs: d, floatingStyles: c, context: u } = vt({
|
|
1698
1815
|
placement: "top",
|
|
1699
1816
|
strategy: "fixed",
|
|
1700
1817
|
open: s,
|
|
1701
|
-
whileElementsMounted:
|
|
1818
|
+
whileElementsMounted: oe,
|
|
1702
1819
|
elements: {
|
|
1703
1820
|
reference: r.current
|
|
1704
1821
|
},
|
|
1705
|
-
middleware: [
|
|
1706
|
-
}), { getFloatingProps: g } =
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
]), k =
|
|
1710
|
-
var
|
|
1711
|
-
const
|
|
1712
|
-
if (N(
|
|
1713
|
-
const C =
|
|
1714
|
-
let
|
|
1715
|
-
if (
|
|
1716
|
-
const
|
|
1717
|
-
|
|
1822
|
+
middleware: [Cr()]
|
|
1823
|
+
}), { getFloatingProps: g } = ae([
|
|
1824
|
+
le(u),
|
|
1825
|
+
Mr(u)
|
|
1826
|
+
]), k = M(() => {
|
|
1827
|
+
var p;
|
|
1828
|
+
const b = L();
|
|
1829
|
+
if (N(b)) {
|
|
1830
|
+
const C = ge(b), y = C.getParent();
|
|
1831
|
+
let I = null;
|
|
1832
|
+
if (Z(y) ? I = y : Z(C) && (I = C), I) {
|
|
1833
|
+
const J = window.getSelection(), Q = t.getRootElement();
|
|
1834
|
+
b !== null && J !== null && Q !== null && Q.contains(J.anchorNode) && t.isEditable() && (r.current = ((p = J.focusNode) == null ? void 0 : p.parentElement) ?? null);
|
|
1718
1835
|
}
|
|
1719
|
-
|
|
1836
|
+
o(I);
|
|
1720
1837
|
}
|
|
1721
|
-
}, [t]),
|
|
1722
|
-
e &&
|
|
1838
|
+
}, [t]), E = M(() => {
|
|
1839
|
+
e && _n(e) && t.update(() => {
|
|
1723
1840
|
e.remove();
|
|
1724
|
-
}), t.dispatchCommand(
|
|
1841
|
+
}), t.dispatchCommand(it, null);
|
|
1725
1842
|
}, [t, e]);
|
|
1726
1843
|
if (_(() => {
|
|
1727
1844
|
t.getEditorState().read(() => {
|
|
1728
1845
|
k();
|
|
1729
1846
|
});
|
|
1730
|
-
}, [t, k]), _(() =>
|
|
1731
|
-
t.registerUpdateListener(({ editorState:
|
|
1732
|
-
|
|
1847
|
+
}, [t, k]), _(() => ot(
|
|
1848
|
+
t.registerUpdateListener(({ editorState: b }) => {
|
|
1849
|
+
b.read(() => {
|
|
1733
1850
|
k();
|
|
1734
1851
|
});
|
|
1735
1852
|
}),
|
|
1736
1853
|
t.registerCommand(
|
|
1737
|
-
|
|
1738
|
-
() => (k(), !
|
|
1739
|
-
|
|
1854
|
+
X,
|
|
1855
|
+
() => (k(), !1),
|
|
1856
|
+
q
|
|
1740
1857
|
),
|
|
1741
1858
|
t.registerCommand(
|
|
1742
|
-
|
|
1743
|
-
() => e ? (
|
|
1744
|
-
|
|
1859
|
+
Ht,
|
|
1860
|
+
() => e ? (o(null), !0) : !1,
|
|
1861
|
+
Ie
|
|
1745
1862
|
)
|
|
1746
1863
|
), [t, k, e]), !s)
|
|
1747
1864
|
return null;
|
|
1748
|
-
const
|
|
1749
|
-
return /* @__PURE__ */
|
|
1750
|
-
|
|
1865
|
+
const R = _t(i);
|
|
1866
|
+
return /* @__PURE__ */ n(se, { children: /* @__PURE__ */ h(
|
|
1867
|
+
re,
|
|
1751
1868
|
{
|
|
1752
1869
|
ref: d.setFloating,
|
|
1753
1870
|
css: {
|
|
@@ -1760,8 +1877,8 @@ const cn = ({ onClose: t }) => {
|
|
|
1760
1877
|
style: c,
|
|
1761
1878
|
...g(),
|
|
1762
1879
|
children: [
|
|
1763
|
-
/* @__PURE__ */
|
|
1764
|
-
|
|
1880
|
+
/* @__PURE__ */ n(
|
|
1881
|
+
P,
|
|
1765
1882
|
{
|
|
1766
1883
|
as: "a",
|
|
1767
1884
|
css: {
|
|
@@ -1771,51 +1888,51 @@ const cn = ({ onClose: t }) => {
|
|
|
1771
1888
|
textOverflow: "ellipsis",
|
|
1772
1889
|
marginRight: "$4"
|
|
1773
1890
|
},
|
|
1774
|
-
href:
|
|
1775
|
-
title:
|
|
1891
|
+
href: R,
|
|
1892
|
+
title: R,
|
|
1776
1893
|
target: "_blank",
|
|
1777
1894
|
rel: "noreferrer",
|
|
1778
1895
|
children: i
|
|
1779
1896
|
}
|
|
1780
1897
|
),
|
|
1781
|
-
/* @__PURE__ */
|
|
1898
|
+
/* @__PURE__ */ n(w, { color: "danger", icon: !0, size: "sm", onClick: E, children: /* @__PURE__ */ n(gr, { size: 24 }) })
|
|
1782
1899
|
]
|
|
1783
1900
|
}
|
|
1784
1901
|
) });
|
|
1785
|
-
},
|
|
1786
|
-
const [t] =
|
|
1787
|
-
return /* @__PURE__ */
|
|
1788
|
-
|
|
1902
|
+
}, fo = () => {
|
|
1903
|
+
const [t] = Ct();
|
|
1904
|
+
return /* @__PURE__ */ h(
|
|
1905
|
+
at,
|
|
1789
1906
|
{
|
|
1790
1907
|
align: "end",
|
|
1791
|
-
trigger: /* @__PURE__ */
|
|
1908
|
+
trigger: /* @__PURE__ */ n(lt, { dropdown: !0, children: /* @__PURE__ */ n(Ot, { size: "1.25rem" }) }),
|
|
1792
1909
|
children: [
|
|
1793
|
-
/* @__PURE__ */
|
|
1794
|
-
|
|
1910
|
+
/* @__PURE__ */ h(
|
|
1911
|
+
T,
|
|
1795
1912
|
{
|
|
1796
|
-
onClick: () => t.dispatchCommand(
|
|
1913
|
+
onClick: () => t.dispatchCommand(dt, "left"),
|
|
1797
1914
|
children: [
|
|
1798
|
-
/* @__PURE__ */
|
|
1915
|
+
/* @__PURE__ */ n(Ot, { size: "1.25rem" }),
|
|
1799
1916
|
"Venstre"
|
|
1800
1917
|
]
|
|
1801
1918
|
}
|
|
1802
1919
|
),
|
|
1803
|
-
/* @__PURE__ */
|
|
1804
|
-
|
|
1920
|
+
/* @__PURE__ */ h(
|
|
1921
|
+
T,
|
|
1805
1922
|
{
|
|
1806
|
-
onClick: () => t.dispatchCommand(
|
|
1923
|
+
onClick: () => t.dispatchCommand(dt, "center"),
|
|
1807
1924
|
children: [
|
|
1808
|
-
/* @__PURE__ */
|
|
1925
|
+
/* @__PURE__ */ n($r, { size: "1.25rem" }),
|
|
1809
1926
|
"Midt"
|
|
1810
1927
|
]
|
|
1811
1928
|
}
|
|
1812
1929
|
),
|
|
1813
|
-
/* @__PURE__ */
|
|
1814
|
-
|
|
1930
|
+
/* @__PURE__ */ h(
|
|
1931
|
+
T,
|
|
1815
1932
|
{
|
|
1816
|
-
onClick: () => t.dispatchCommand(
|
|
1933
|
+
onClick: () => t.dispatchCommand(dt, "right"),
|
|
1817
1934
|
children: [
|
|
1818
|
-
/* @__PURE__ */
|
|
1935
|
+
/* @__PURE__ */ n(Ar, { size: "1.25rem" }),
|
|
1819
1936
|
"Høyre"
|
|
1820
1937
|
]
|
|
1821
1938
|
}
|
|
@@ -1823,21 +1940,21 @@ const cn = ({ onClose: t }) => {
|
|
|
1823
1940
|
]
|
|
1824
1941
|
}
|
|
1825
1942
|
);
|
|
1826
|
-
},
|
|
1827
|
-
const [t] =
|
|
1943
|
+
}, Dt = ["image/"], ko = () => {
|
|
1944
|
+
const [t] = Ct(), { fileUpload: r } = H();
|
|
1828
1945
|
return _(() => t.registerCommand(
|
|
1829
|
-
|
|
1946
|
+
qe,
|
|
1830
1947
|
(e) => ((async () => {
|
|
1831
|
-
const
|
|
1948
|
+
const o = await Pe(
|
|
1832
1949
|
e,
|
|
1833
|
-
[
|
|
1950
|
+
[Dt].flatMap((i) => i)
|
|
1834
1951
|
);
|
|
1835
|
-
for (const { file: i, result: a } of
|
|
1836
|
-
if (
|
|
1952
|
+
for (const { file: i, result: a } of o)
|
|
1953
|
+
if (Fe(i, Dt)) {
|
|
1837
1954
|
let l = a;
|
|
1838
1955
|
const s = new Image(), d = window.URL.createObjectURL(i);
|
|
1839
1956
|
s.onload = async () => {
|
|
1840
|
-
r && (l = await r.uploadFile({ file: i })), t.dispatchCommand(
|
|
1957
|
+
r && (l = await r.uploadFile({ file: i })), t.dispatchCommand(Lt, {
|
|
1841
1958
|
src: l,
|
|
1842
1959
|
altText: i.name,
|
|
1843
1960
|
meta: { width: s.naturalWidth, height: s.naturalHeight }
|
|
@@ -1845,39 +1962,39 @@ const cn = ({ onClose: t }) => {
|
|
|
1845
1962
|
}, s.src = d;
|
|
1846
1963
|
}
|
|
1847
1964
|
})(), !0),
|
|
1848
|
-
|
|
1965
|
+
D
|
|
1849
1966
|
), [t, r]), null;
|
|
1850
1967
|
};
|
|
1851
1968
|
export {
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1969
|
+
xt as $createImageNode,
|
|
1970
|
+
pe as $createRutineLinkNode,
|
|
1971
|
+
oo as $getNodesOfTypes,
|
|
1972
|
+
io as $isImageNode,
|
|
1973
|
+
_n as $isRutineLinkNode,
|
|
1974
|
+
fo as AlignToolbarDropdown,
|
|
1975
|
+
ko as DragDropPastePlugin,
|
|
1976
|
+
un as FloatingToolbar,
|
|
1977
|
+
U as ImageNode,
|
|
1978
|
+
ho as InsertSelector,
|
|
1979
|
+
mo as LinkEditPlugin,
|
|
1980
|
+
et as LinkTargetNode,
|
|
1981
|
+
po as LinkToolbarButton,
|
|
1982
|
+
so as RichTextEditor,
|
|
1983
|
+
gn as RichTextToolbar,
|
|
1984
|
+
B as RutineLinkNode,
|
|
1985
|
+
go as RutineLinkNodeInit,
|
|
1986
|
+
uo as TableEditPlugin,
|
|
1987
|
+
Er as clearEditorState,
|
|
1988
|
+
ao as defaultNodes,
|
|
1989
|
+
lo as defaultViewNodes,
|
|
1990
|
+
Nr as isEditorState,
|
|
1991
|
+
Tt as isJSON,
|
|
1992
|
+
de as richTextContext,
|
|
1993
|
+
co as richTextCss,
|
|
1994
|
+
Tn as richTextStyleObj,
|
|
1995
|
+
Rr as setStateFromPlainText,
|
|
1996
|
+
ro as stateToHTML,
|
|
1997
|
+
no as syncStateToHTML,
|
|
1998
|
+
Ir as useHasFocusWithin,
|
|
1999
|
+
H as useRichTextContext
|
|
1883
2000
|
};
|