@arkitektbedriftene/fe-lib 0.4.24 → 0.4.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rich-text.es.js +314 -314
- package/dist/ui/components/Stack.d.ts +1 -1
- package/package.json +10 -10
package/dist/rich-text.es.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { createHeadlessEditor as
|
|
5
|
-
import { $generateHtmlFromNodes as
|
|
6
|
-
import { $getRoot as j, ParagraphNode as
|
|
7
|
-
import { trimTextContentFromAnchor as
|
|
8
|
-
import { AutoLinkNode as
|
|
9
|
-
import { ListNode as
|
|
10
|
-
import { HeadingNode as
|
|
11
|
-
import { TableNode as
|
|
12
|
-
import { jsx as n, jsxs as
|
|
13
|
-
import { createContext as
|
|
14
|
-
import { c as
|
|
1
|
+
var Ft = Object.defineProperty;
|
|
2
|
+
var Ht = (t, r, e) => r in t ? Ft(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
|
|
3
|
+
var at = (t, r, e) => (Ht(t, typeof r != "symbol" ? r + "" : r, e), e);
|
|
4
|
+
import { createHeadlessEditor as Wt } from "@lexical/headless";
|
|
5
|
+
import { $generateHtmlFromNodes as Ut } from "@lexical/html";
|
|
6
|
+
import { $getRoot as j, ParagraphNode as jt, $createParagraphNode as K, $createTextNode as D, $setSelection as mt, SELECTION_CHANGE_COMMAND as F, $getSelection as L, COMMAND_PRIORITY_CRITICAL as Q, $isRangeSelection as T, $isRootOrShadowRoot as Kt, FORMAT_TEXT_COMMAND as A, COMMAND_PRIORITY_LOW as w, KEY_ARROW_DOWN_COMMAND as Yt, KEY_ARROW_UP_COMMAND as qt, KEY_ESCAPE_COMMAND as kt, KEY_SPACE_COMMAND as Gt, $getNearestNodeFromDOMNode as J, KEY_ARROW_LEFT_COMMAND as Xt, $isElementNode as Qt, COMMAND_PRIORITY_NORMAL as Jt, $isParagraphNode as Vt, COMMAND_PRIORITY_HIGH as Zt } from "lexical";
|
|
7
|
+
import { trimTextContentFromAnchor as te, $setBlocksType as G, $isAtNodeEnd as lt } from "@lexical/selection";
|
|
8
|
+
import { AutoLinkNode as ee, LinkNode as bt, $isLinkNode as W, TOGGLE_LINK_COMMAND as V } from "@lexical/link";
|
|
9
|
+
import { ListNode as vt, ListItemNode as re, $isListNode as Z, INSERT_UNORDERED_LIST_COMMAND as ne, INSERT_ORDERED_LIST_COMMAND as oe, INSERT_CHECK_LIST_COMMAND as Ct, insertList as ie, $isListItemNode as z } from "@lexical/list";
|
|
10
|
+
import { HeadingNode as ae, QuoteNode as le, $isHeadingNode as se, $createHeadingNode as ce, $createQuoteNode as de } from "@lexical/rich-text";
|
|
11
|
+
import { TableNode as ue, TableRowNode as he, TableCellNode as pe, INSERT_TABLE_COMMAND as ge, $getTableCellNodeFromLexicalNode as fe, $deleteTableColumn__EXPERIMENTAL as me, $deleteTableRow__EXPERIMENTAL as ke, $insertTableColumn__EXPERIMENTAL as st, $insertTableRow__EXPERIMENTAL as ct } from "@lexical/table";
|
|
12
|
+
import { jsx as n, jsxs as g, Fragment as Y } from "react/jsx-runtime";
|
|
13
|
+
import { createContext as be, useState as b, useRef as tt, useCallback as v, useContext as ve, useEffect as N, useMemo as Mt, useLayoutEffect as Ce } from "react";
|
|
14
|
+
import { c as $, s as Lt, D as et, T as Tt, a as M, B as P, b as Nt, d as I, u as rt, e as yt, f as Me, g as Le, o as xt, h as Te, i as St, j as Et, F as wt, O as Rt, k as Ne, l as ye, S as xe, m as O, n as _, p as dt, q as Se, N as Ee, r as ut, t as we, v as _t, C as Re, w as _e, x as Ie } from "./Checkbox-404e0375.js";
|
|
15
15
|
import "react-select";
|
|
16
|
-
import { LexicalComposer as
|
|
16
|
+
import { LexicalComposer as ze } from "@lexical/react/LexicalComposer.js";
|
|
17
17
|
import { RichTextPlugin as Oe } from "@lexical/react/LexicalRichTextPlugin.js";
|
|
18
|
-
import
|
|
18
|
+
import $e from "@lexical/react/LexicalErrorBoundary.js";
|
|
19
19
|
import { useLexicalComposerContext as y } from "@lexical/react/LexicalComposerContext.js";
|
|
20
|
-
import { $getNearestNodeOfType as
|
|
21
|
-
import { G as h, f as
|
|
22
|
-
import { ListPlugin as
|
|
23
|
-
import { HistoryPlugin as
|
|
24
|
-
import { TablePlugin as
|
|
25
|
-
import { TabIndentationPlugin as
|
|
20
|
+
import { $getNearestNodeOfType as Be, $findMatchingParent as It, mergeRegister as nt, isHTMLElement as ht } from "@lexical/utils";
|
|
21
|
+
import { G as h, f as Ae } from "./index.esm-3266b7f8.js";
|
|
22
|
+
import { ListPlugin as De } from "@lexical/react/LexicalListPlugin.js";
|
|
23
|
+
import { HistoryPlugin as Pe } from "@lexical/react/LexicalHistoryPlugin.js";
|
|
24
|
+
import { TablePlugin as Fe } from "@lexical/react/LexicalTablePlugin.js";
|
|
25
|
+
import { TabIndentationPlugin as He } from "@lexical/react/LexicalTabIndentationPlugin.js";
|
|
26
26
|
import "react-dom";
|
|
27
27
|
import "@radix-ui/react-toolbar";
|
|
28
28
|
import "@radix-ui/react-dialog";
|
|
29
29
|
import "@radix-ui/react-dropdown-menu";
|
|
30
30
|
import "@radix-ui/react-checkbox";
|
|
31
|
-
const
|
|
31
|
+
const We = ({
|
|
32
32
|
text: t,
|
|
33
33
|
maxChars: r,
|
|
34
34
|
maxLines: e
|
|
@@ -43,55 +43,55 @@ const Ue = ({
|
|
|
43
43
|
t[a] === `
|
|
44
44
|
` && l++, a++;
|
|
45
45
|
return t.slice(0, a).length;
|
|
46
|
-
},
|
|
46
|
+
}, Ue = ({
|
|
47
47
|
editor: t,
|
|
48
48
|
maxChars: r,
|
|
49
49
|
maxLines: e
|
|
50
50
|
}) => {
|
|
51
|
-
const o = j(), i = o.getTextContent(), l =
|
|
52
|
-
|
|
51
|
+
const o = j(), i = o.getTextContent(), l = We({ text: i, maxChars: r, maxLines: e }), a = i.length - l, d = o.select().anchor;
|
|
52
|
+
te(t, d, a);
|
|
53
53
|
const c = o.getLastChild();
|
|
54
|
-
return c instanceof
|
|
55
|
-
},
|
|
54
|
+
return c instanceof jt && c.getChildrenSize() === 0 && c.remove(), a;
|
|
55
|
+
}, zt = (t) => t[0] === "{", je = (t) => t !== null && typeof t == "object" && "isEmpty" in t, Ke = (t, r) => {
|
|
56
56
|
t.update(
|
|
57
57
|
() => {
|
|
58
58
|
const e = j();
|
|
59
59
|
e.clear();
|
|
60
60
|
const o = K();
|
|
61
|
-
o.append(
|
|
61
|
+
o.append(D("")), e.append(o), mt(null);
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
tag: r
|
|
65
65
|
}
|
|
66
66
|
);
|
|
67
|
-
},
|
|
67
|
+
}, Ye = (t, r, e) => {
|
|
68
68
|
r.update(
|
|
69
69
|
() => {
|
|
70
70
|
const o = j();
|
|
71
71
|
o.clear();
|
|
72
72
|
const i = K();
|
|
73
|
-
i.append(
|
|
73
|
+
i.append(D(t.trim())), o.append(i), mt(null);
|
|
74
74
|
},
|
|
75
75
|
{
|
|
76
76
|
tag: e
|
|
77
77
|
}
|
|
78
78
|
), r.blur();
|
|
79
|
-
},
|
|
79
|
+
}, pn = (t, r, e) => {
|
|
80
80
|
let o = 0;
|
|
81
|
-
const i =
|
|
81
|
+
const i = Wt({
|
|
82
82
|
nodes: r,
|
|
83
83
|
editable: !1
|
|
84
84
|
});
|
|
85
85
|
if (t)
|
|
86
86
|
try {
|
|
87
|
-
if (typeof t == "string" &&
|
|
87
|
+
if (typeof t == "string" && !zt(t))
|
|
88
88
|
i.update(() => {
|
|
89
89
|
const a = j(), s = K();
|
|
90
|
-
s.append(
|
|
90
|
+
s.append(D(t.trim())), a.append(s);
|
|
91
91
|
});
|
|
92
92
|
else {
|
|
93
93
|
const a = i.parseEditorState(t, () => {
|
|
94
|
-
(e == null ? void 0 : e.maxLines) !== void 0 && (o =
|
|
94
|
+
(e == null ? void 0 : e.maxLines) !== void 0 && (o = Ue({
|
|
95
95
|
editor: i,
|
|
96
96
|
maxLines: e.maxLines
|
|
97
97
|
}));
|
|
@@ -104,46 +104,46 @@ const Ue = ({
|
|
|
104
104
|
let l = "";
|
|
105
105
|
return i.update(() => {
|
|
106
106
|
var a;
|
|
107
|
-
e != null && e.updateFn && ((a = e.updateFn) == null || a.call(e)), l =
|
|
107
|
+
e != null && e.updateFn && ((a = e.updateFn) == null || a.call(e)), l = Ut(i);
|
|
108
108
|
}), { html: l, trimCount: o };
|
|
109
|
-
},
|
|
109
|
+
}, gn = [
|
|
110
|
+
ae,
|
|
110
111
|
le,
|
|
111
|
-
se,
|
|
112
|
-
Ct,
|
|
113
|
-
ne,
|
|
114
|
-
re,
|
|
115
112
|
vt,
|
|
113
|
+
re,
|
|
114
|
+
ee,
|
|
115
|
+
bt,
|
|
116
|
+
ue,
|
|
116
117
|
he,
|
|
117
|
-
pe
|
|
118
|
-
|
|
119
|
-
], Ge = O({
|
|
118
|
+
pe
|
|
119
|
+
], qe = $({
|
|
120
120
|
fontWeight: "bold"
|
|
121
|
-
}),
|
|
121
|
+
}), Ge = $({
|
|
122
122
|
fontStyle: "italic"
|
|
123
|
-
}),
|
|
123
|
+
}), Xe = $({
|
|
124
124
|
textDecoration: "underline"
|
|
125
|
-
}),
|
|
125
|
+
}), Qe = $({
|
|
126
126
|
listStyleType: "none"
|
|
127
|
-
}),
|
|
127
|
+
}), Je = $({
|
|
128
128
|
borderLeft: "4px solid #ccc",
|
|
129
129
|
color: "#666",
|
|
130
130
|
fontStyle: "italic",
|
|
131
131
|
margin: "1.5em 10px",
|
|
132
132
|
padding: "0.5em 10px"
|
|
133
|
-
}),
|
|
134
|
-
quote:
|
|
133
|
+
}), Ve = {
|
|
134
|
+
quote: Je().className,
|
|
135
135
|
text: {
|
|
136
|
-
bold:
|
|
137
|
-
italic:
|
|
138
|
-
underline:
|
|
136
|
+
bold: qe().className,
|
|
137
|
+
italic: Ge().className,
|
|
138
|
+
underline: Xe().className
|
|
139
139
|
},
|
|
140
140
|
list: {
|
|
141
141
|
nested: {
|
|
142
|
-
listitem:
|
|
142
|
+
listitem: Qe().className
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
|
-
}, Ot =
|
|
146
|
-
const [r, e] = b(!1), o =
|
|
145
|
+
}, Ot = be({ hasFocus: !1, editorRef: { current: null } }), Ze = ({ onBlur: t }) => {
|
|
146
|
+
const [r, e] = b(!1), o = tt(null), i = v(() => {
|
|
147
147
|
e(!0), o.current && window.clearTimeout(o.current);
|
|
148
148
|
}, []), l = v(() => {
|
|
149
149
|
o.current = window.setTimeout(() => {
|
|
@@ -157,65 +157,65 @@ const Ue = ({
|
|
|
157
157
|
onBlur: l
|
|
158
158
|
}
|
|
159
159
|
};
|
|
160
|
-
},
|
|
161
|
-
function
|
|
160
|
+
}, ot = () => ve(Ot);
|
|
161
|
+
function tr(t) {
|
|
162
162
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 5h6a3.5 3.5 0 0 1 0 7h-6z" } }, { tag: "path", attr: { d: "M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7" } }] })(t);
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function er(t) {
|
|
165
165
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 8l-4 4l4 4" } }, { tag: "path", attr: { d: "M17 8l4 4l-4 4" } }, { tag: "path", attr: { d: "M14 4l-4 16" } }] })(t);
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function rr(t) {
|
|
168
168
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 18v-8l-2 2" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function nr(t) {
|
|
171
171
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M17 12a2 2 0 1 1 4 0c0 .591 -.417 1.318 -.816 1.858l-3.184 4.143l4 0" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
|
|
172
172
|
}
|
|
173
|
-
function
|
|
173
|
+
function or(t) {
|
|
174
174
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 14a2 2 0 1 0 -2 -2" } }, { tag: "path", attr: { d: "M17 16a2 2 0 1 0 2 -2" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
|
|
175
175
|
}
|
|
176
|
-
function
|
|
176
|
+
function ir(t) {
|
|
177
177
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M20 18v-8l-4 6h5" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
|
|
178
178
|
}
|
|
179
|
-
function
|
|
179
|
+
function ar(t) {
|
|
180
180
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M17 18h2a2 2 0 1 0 0 -4h-2v-4h4" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function lr(t) {
|
|
183
183
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 14a2 2 0 1 0 0 4a2 2 0 0 0 0 -4z" } }, { tag: "path", attr: { d: "M21 12a2 2 0 1 0 -4 0v4" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function sr(t) {
|
|
186
186
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M11 5l6 0" } }, { tag: "path", attr: { d: "M7 19l6 0" } }, { tag: "path", attr: { d: "M14 5l-4 14" } }] })(t);
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function cr(t) {
|
|
189
189
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M17.5 15.5m-3.5 0a3.5 3.5 0 1 0 7 0a3.5 3.5 0 1 0 -7 0" } }, { tag: "path", attr: { d: "M3 19v-10.5a3.5 3.5 0 0 1 7 0v10.5" } }, { tag: "path", attr: { d: "M3 13h7" } }, { tag: "path", attr: { d: "M21 12v7" } }] })(t);
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function dr(t) {
|
|
192
192
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5" } }, { tag: "path", attr: { d: "M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5" } }] })(t);
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function ur(t) {
|
|
195
195
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M3.5 5.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M3.5 11.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M3.5 17.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M11 6l9 0" } }, { tag: "path", attr: { d: "M11 12l9 0" } }, { tag: "path", attr: { d: "M11 18l9 0" } }] })(t);
|
|
196
196
|
}
|
|
197
|
-
function
|
|
197
|
+
function hr(t) {
|
|
198
198
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M11 6h9" } }, { tag: "path", attr: { d: "M11 12h9" } }, { tag: "path", attr: { d: "M12 18h8" } }, { tag: "path", attr: { d: "M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4" } }, { tag: "path", attr: { d: "M6 10v-6l-2 2" } }] })(t);
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function pr(t) {
|
|
201
201
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M9 6l11 0" } }, { tag: "path", attr: { d: "M9 12l11 0" } }, { tag: "path", attr: { d: "M9 18l11 0" } }, { tag: "path", attr: { d: "M5 6l0 .01" } }, { tag: "path", attr: { d: "M5 12l0 .01" } }, { tag: "path", attr: { d: "M5 18l0 .01" } }] })(t);
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function gr(t) {
|
|
204
204
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M10 11h-4a1 1 0 0 1 -1 -1v-3a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v6c0 2.667 -1.333 4.333 -4 5" } }, { tag: "path", attr: { d: "M19 11h-4a1 1 0 0 1 -1 -1v-3a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v6c0 2.667 -1.333 4.333 -4 5" } }] })(t);
|
|
205
205
|
}
|
|
206
|
-
function
|
|
206
|
+
function fr(t) {
|
|
207
207
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M5 7l8 10m-8 0l8 -10" } }, { tag: "path", attr: { d: "M21 11h-4l3.5 -4a1.73 1.73 0 0 0 -3.5 -2" } }] })(t);
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function mr(t) {
|
|
210
210
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z" } }, { tag: "path", attr: { d: "M4 10l16 0" } }, { tag: "path", attr: { d: "M10 4l0 16" } }] })(t);
|
|
211
211
|
}
|
|
212
|
-
function
|
|
212
|
+
function kr(t) {
|
|
213
213
|
return h({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 5v5a5 5 0 0 0 10 0v-5" } }, { tag: "path", attr: { d: "M5 19h14" } }] })(t);
|
|
214
214
|
}
|
|
215
|
-
const
|
|
215
|
+
const br = Lt("div", {
|
|
216
216
|
width: "10rem",
|
|
217
217
|
display: "flex"
|
|
218
|
-
}),
|
|
218
|
+
}), $t = {
|
|
219
219
|
bullet: "Punktliste",
|
|
220
220
|
h1: "Overskrift 1",
|
|
221
221
|
h2: "Overskrift 2",
|
|
@@ -227,22 +227,22 @@ const vr = Tt("div", {
|
|
|
227
227
|
paragraph: "Normal",
|
|
228
228
|
quote: "Sitat",
|
|
229
229
|
check: "Avkrysningsliste"
|
|
230
|
-
},
|
|
231
|
-
bullet: /* @__PURE__ */ n(
|
|
232
|
-
h1: /* @__PURE__ */ n(
|
|
233
|
-
h2: /* @__PURE__ */ n(
|
|
234
|
-
h3: /* @__PURE__ */ n(
|
|
235
|
-
h4: /* @__PURE__ */ n(
|
|
236
|
-
h5: /* @__PURE__ */ n(
|
|
237
|
-
h6: /* @__PURE__ */ n(
|
|
238
|
-
number: /* @__PURE__ */ n(
|
|
239
|
-
check: /* @__PURE__ */ n(
|
|
240
|
-
paragraph: /* @__PURE__ */ n(
|
|
241
|
-
quote: /* @__PURE__ */ n(
|
|
230
|
+
}, vr = {
|
|
231
|
+
bullet: /* @__PURE__ */ n(pr, { size: "1.25rem" }),
|
|
232
|
+
h1: /* @__PURE__ */ n(rr, { size: "1.25rem" }),
|
|
233
|
+
h2: /* @__PURE__ */ n(nr, { size: "1.25rem" }),
|
|
234
|
+
h3: /* @__PURE__ */ n(or, { size: "1.25rem" }),
|
|
235
|
+
h4: /* @__PURE__ */ n(ir, { size: "1.25rem" }),
|
|
236
|
+
h5: /* @__PURE__ */ n(ar, { size: "1.25rem" }),
|
|
237
|
+
h6: /* @__PURE__ */ n(lr, { size: "1.25rem" }),
|
|
238
|
+
number: /* @__PURE__ */ n(hr, { size: "1.25rem" }),
|
|
239
|
+
check: /* @__PURE__ */ n(ur, { size: "1.25rem" }),
|
|
240
|
+
paragraph: /* @__PURE__ */ n(cr, { size: "1.25rem" }),
|
|
241
|
+
quote: /* @__PURE__ */ n(gr, { size: "1.25rem" })
|
|
242
242
|
}, C = ({
|
|
243
243
|
blockType: t
|
|
244
|
-
}) => /* @__PURE__ */
|
|
245
|
-
/* @__PURE__ */ n(P, { css: { display: "flex", flex: "0 0 auto" }, children:
|
|
244
|
+
}) => /* @__PURE__ */ g(Y, { children: [
|
|
245
|
+
/* @__PURE__ */ n(P, { css: { display: "flex", flex: "0 0 auto" }, children: vr[t] }),
|
|
246
246
|
/* @__PURE__ */ n(
|
|
247
247
|
P,
|
|
248
248
|
{
|
|
@@ -252,56 +252,56 @@ const vr = Tt("div", {
|
|
|
252
252
|
textOverflow: "ellipsis",
|
|
253
253
|
whiteSpace: "nowrap"
|
|
254
254
|
},
|
|
255
|
-
children:
|
|
255
|
+
children: $t[t]
|
|
256
256
|
}
|
|
257
257
|
)
|
|
258
|
-
] }),
|
|
258
|
+
] }), Cr = (t) => {
|
|
259
259
|
if (!T(t))
|
|
260
260
|
return null;
|
|
261
261
|
const r = t.anchor.getNode();
|
|
262
|
-
let e = r.getKey() === "root" ? r :
|
|
262
|
+
let e = r.getKey() === "root" ? r : It(r, (o) => {
|
|
263
263
|
const i = o.getParent();
|
|
264
|
-
return i !== null &&
|
|
264
|
+
return i !== null && Kt(i);
|
|
265
265
|
});
|
|
266
266
|
return e === null && (e = r.getTopLevelElementOrThrow()), {
|
|
267
267
|
anchorNode: r,
|
|
268
268
|
element: e
|
|
269
269
|
};
|
|
270
|
-
},
|
|
270
|
+
}, Mr = () => {
|
|
271
271
|
const [t] = y(), [r, e] = b("paragraph");
|
|
272
272
|
N(() => t.registerCommand(
|
|
273
273
|
F,
|
|
274
274
|
() => {
|
|
275
|
-
const c = L(),
|
|
276
|
-
if (!
|
|
275
|
+
const c = L(), f = Cr(c);
|
|
276
|
+
if (!f)
|
|
277
277
|
return !1;
|
|
278
|
-
const { element: u, anchorNode: m } =
|
|
278
|
+
const { element: u, anchorNode: m } = f, E = u.getKey();
|
|
279
279
|
if (t.getElementByKey(E) !== null)
|
|
280
|
-
if (
|
|
281
|
-
const k =
|
|
280
|
+
if (Z(u)) {
|
|
281
|
+
const k = Be(
|
|
282
282
|
m,
|
|
283
|
-
|
|
283
|
+
vt
|
|
284
284
|
), S = k ? k.getListType() : u.getListType();
|
|
285
285
|
e(S);
|
|
286
286
|
} else {
|
|
287
|
-
const k =
|
|
288
|
-
k in
|
|
287
|
+
const k = se(u) ? u.getTag() : u.getType();
|
|
288
|
+
k in $t && e(k);
|
|
289
289
|
}
|
|
290
290
|
return !1;
|
|
291
291
|
},
|
|
292
|
-
|
|
292
|
+
Q
|
|
293
293
|
), [t]);
|
|
294
294
|
const o = (c) => {
|
|
295
295
|
r !== c && t.update(() => {
|
|
296
|
-
const
|
|
297
|
-
|
|
296
|
+
const f = L();
|
|
297
|
+
T(f) && (G(f, () => ce(c)), e(c));
|
|
298
298
|
});
|
|
299
299
|
};
|
|
300
|
-
return /* @__PURE__ */ n(
|
|
301
|
-
|
|
300
|
+
return /* @__PURE__ */ n(br, { children: /* @__PURE__ */ g(
|
|
301
|
+
et,
|
|
302
302
|
{
|
|
303
303
|
trigger: /* @__PURE__ */ n(
|
|
304
|
-
|
|
304
|
+
Tt,
|
|
305
305
|
{
|
|
306
306
|
dropdown: !0,
|
|
307
307
|
css: { display: "flex", width: "100%", overflow: "hidden" },
|
|
@@ -314,7 +314,7 @@ const vr = Tt("div", {
|
|
|
314
314
|
/* @__PURE__ */ n(M, { onClick: () => {
|
|
315
315
|
r !== "paragraph" && t.update(() => {
|
|
316
316
|
const c = L();
|
|
317
|
-
|
|
317
|
+
T(c) && (G(c, () => K()), e("paragraph"));
|
|
318
318
|
});
|
|
319
319
|
}, children: /* @__PURE__ */ n(C, { blockType: "paragraph" }) }),
|
|
320
320
|
/* @__PURE__ */ n(M, { onClick: () => o("h1"), children: /* @__PURE__ */ n(C, { blockType: "h1" }) }),
|
|
@@ -324,33 +324,33 @@ const vr = Tt("div", {
|
|
|
324
324
|
/* @__PURE__ */ n(M, { onClick: () => o("h5"), children: /* @__PURE__ */ n(C, { blockType: "h5" }) }),
|
|
325
325
|
/* @__PURE__ */ n(M, { onClick: () => o("h6"), children: /* @__PURE__ */ n(C, { blockType: "h6" }) }),
|
|
326
326
|
/* @__PURE__ */ n(M, { onClick: () => {
|
|
327
|
-
r !== "bullet" && (t.dispatchCommand(
|
|
327
|
+
r !== "bullet" && (t.dispatchCommand(ne, void 0), e("bullet"));
|
|
328
328
|
}, children: /* @__PURE__ */ n(C, { blockType: "bullet" }) }),
|
|
329
329
|
/* @__PURE__ */ n(M, { onClick: () => {
|
|
330
|
-
r !== "number" && (t.dispatchCommand(
|
|
330
|
+
r !== "number" && (t.dispatchCommand(oe, void 0), e("number"));
|
|
331
331
|
}, children: /* @__PURE__ */ n(C, { blockType: "number" }) }),
|
|
332
332
|
/* @__PURE__ */ n(M, { onClick: () => {
|
|
333
|
-
r !== "check" && (t.dispatchCommand(
|
|
333
|
+
r !== "check" && (t.dispatchCommand(Ct, void 0), e("check"));
|
|
334
334
|
}, children: /* @__PURE__ */ n(C, { blockType: "check" }) }),
|
|
335
335
|
/* @__PURE__ */ n(M, { onClick: () => {
|
|
336
336
|
r !== "quote" && t.update(() => {
|
|
337
337
|
const c = L();
|
|
338
|
-
|
|
338
|
+
T(c) && (G(c, () => de()), e("quote"));
|
|
339
339
|
});
|
|
340
340
|
}, children: /* @__PURE__ */ n(C, { blockType: "quote" }) })
|
|
341
341
|
]
|
|
342
342
|
}
|
|
343
343
|
) });
|
|
344
|
-
},
|
|
345
|
-
const [t] = y(), [r, e] = b(!1), [o, i] = b(!1), [l, a] = b(!1), [s, d] = b(!1), [c,
|
|
344
|
+
}, Lr = () => {
|
|
345
|
+
const [t] = y(), [r, e] = b(!1), [o, i] = b(!1), [l, a] = b(!1), [s, d] = b(!1), [c, f] = b(!1), u = v(() => {
|
|
346
346
|
const p = L();
|
|
347
|
-
T(p) && (e(p.hasFormat("bold")), i(p.hasFormat("italic")), a(p.hasFormat("underline")), d(p.hasFormat("code")),
|
|
347
|
+
T(p) && (e(p.hasFormat("bold")), i(p.hasFormat("italic")), a(p.hasFormat("underline")), d(p.hasFormat("code")), f(p.hasFormat("superscript")));
|
|
348
348
|
}, []);
|
|
349
|
-
N(() =>
|
|
349
|
+
N(() => nt(
|
|
350
350
|
t.registerCommand(
|
|
351
351
|
F,
|
|
352
352
|
() => (u(), !1),
|
|
353
|
-
|
|
353
|
+
Q
|
|
354
354
|
),
|
|
355
355
|
t.registerUpdateListener(({ editorState: p }) => {
|
|
356
356
|
p.read(() => {
|
|
@@ -373,16 +373,16 @@ const vr = Tt("div", {
|
|
|
373
373
|
), S = v(
|
|
374
374
|
() => t.dispatchCommand(A, "superscript"),
|
|
375
375
|
[t]
|
|
376
|
-
),
|
|
376
|
+
), B = Mt(() => {
|
|
377
377
|
const p = [];
|
|
378
378
|
return r && p.push("bold"), o && p.push("italic"), l && p.push("underline"), s && p.push("code"), c && p.push("superscript"), p;
|
|
379
379
|
}, [r, o, l, s, c]);
|
|
380
|
-
return /* @__PURE__ */
|
|
381
|
-
|
|
380
|
+
return /* @__PURE__ */ g(
|
|
381
|
+
Nt,
|
|
382
382
|
{
|
|
383
383
|
type: "multiple",
|
|
384
384
|
"aria-label": "Tekstformattering",
|
|
385
|
-
value:
|
|
385
|
+
value: B,
|
|
386
386
|
children: [
|
|
387
387
|
/* @__PURE__ */ n(
|
|
388
388
|
I,
|
|
@@ -390,7 +390,7 @@ const vr = Tt("div", {
|
|
|
390
390
|
onClick: m,
|
|
391
391
|
title: "Fet tekst",
|
|
392
392
|
value: "bold",
|
|
393
|
-
children: /* @__PURE__ */ n(
|
|
393
|
+
children: /* @__PURE__ */ n(tr, { size: "1.25rem" })
|
|
394
394
|
}
|
|
395
395
|
),
|
|
396
396
|
/* @__PURE__ */ n(
|
|
@@ -399,7 +399,7 @@ const vr = Tt("div", {
|
|
|
399
399
|
onClick: E,
|
|
400
400
|
title: "Kursiv tekst",
|
|
401
401
|
value: "italic",
|
|
402
|
-
children: /* @__PURE__ */ n(
|
|
402
|
+
children: /* @__PURE__ */ n(sr, { size: "1.25rem" })
|
|
403
403
|
}
|
|
404
404
|
),
|
|
405
405
|
/* @__PURE__ */ n(
|
|
@@ -408,7 +408,7 @@ const vr = Tt("div", {
|
|
|
408
408
|
onClick: x,
|
|
409
409
|
title: "Understreket tekst",
|
|
410
410
|
value: "underline",
|
|
411
|
-
children: /* @__PURE__ */ n(
|
|
411
|
+
children: /* @__PURE__ */ n(kr, { size: "1.25rem" })
|
|
412
412
|
}
|
|
413
413
|
),
|
|
414
414
|
/* @__PURE__ */ n(
|
|
@@ -417,7 +417,7 @@ const vr = Tt("div", {
|
|
|
417
417
|
onClick: k,
|
|
418
418
|
title: "Kode",
|
|
419
419
|
value: "code",
|
|
420
|
-
children: /* @__PURE__ */ n(
|
|
420
|
+
children: /* @__PURE__ */ n(er, { size: "1.25rem" })
|
|
421
421
|
}
|
|
422
422
|
),
|
|
423
423
|
/* @__PURE__ */ n(
|
|
@@ -426,31 +426,31 @@ const vr = Tt("div", {
|
|
|
426
426
|
onClick: S,
|
|
427
427
|
title: "Superscript",
|
|
428
428
|
value: "superscript",
|
|
429
|
-
children: /* @__PURE__ */ n(
|
|
429
|
+
children: /* @__PURE__ */ n(fr, { size: "1.25rem" })
|
|
430
430
|
}
|
|
431
431
|
)
|
|
432
432
|
]
|
|
433
433
|
}
|
|
434
434
|
);
|
|
435
|
-
},
|
|
436
|
-
const { hasFocus: r, editorRef: e } =
|
|
437
|
-
|
|
435
|
+
}, Tr = ({ children: t }) => {
|
|
436
|
+
const { hasFocus: r, editorRef: e } = ot(), o = r, [i, l] = b(o);
|
|
437
|
+
Ce(() => {
|
|
438
438
|
l(o);
|
|
439
439
|
}, [o]);
|
|
440
|
-
const { context: a, refs: s, floatingStyles: d } =
|
|
440
|
+
const { context: a, refs: s, floatingStyles: d } = rt({
|
|
441
441
|
placement: "top",
|
|
442
|
-
whileElementsMounted:
|
|
442
|
+
whileElementsMounted: yt,
|
|
443
443
|
middleware: [
|
|
444
|
-
|
|
445
|
-
apply: ({ rects:
|
|
446
|
-
u.floating.style.minWidth = `${
|
|
444
|
+
Me({
|
|
445
|
+
apply: ({ rects: f, elements: u }) => {
|
|
446
|
+
u.floating.style.minWidth = `${f.reference.width}px`;
|
|
447
447
|
}
|
|
448
448
|
}),
|
|
449
|
-
|
|
450
|
-
|
|
449
|
+
Le(),
|
|
450
|
+
xt({
|
|
451
451
|
mainAxis: 8
|
|
452
452
|
}),
|
|
453
|
-
|
|
453
|
+
Te({
|
|
454
454
|
padding: 8
|
|
455
455
|
})
|
|
456
456
|
],
|
|
@@ -459,13 +459,13 @@ const vr = Tt("div", {
|
|
|
459
459
|
elements: {
|
|
460
460
|
reference: e.current
|
|
461
461
|
}
|
|
462
|
-
}), { getFloatingProps: c } =
|
|
463
|
-
|
|
462
|
+
}), { getFloatingProps: c } = St([
|
|
463
|
+
Et(a, {
|
|
464
464
|
role: "dialog"
|
|
465
465
|
})
|
|
466
466
|
]);
|
|
467
|
-
return i ? /* @__PURE__ */ n(
|
|
468
|
-
|
|
467
|
+
return i ? /* @__PURE__ */ n(wt, { children: /* @__PURE__ */ n(
|
|
468
|
+
Rt,
|
|
469
469
|
{
|
|
470
470
|
ref: s.setFloating,
|
|
471
471
|
style: d,
|
|
@@ -476,40 +476,40 @@ const vr = Tt("div", {
|
|
|
476
476
|
overflow: "hidden",
|
|
477
477
|
boxShadow: "$md"
|
|
478
478
|
},
|
|
479
|
-
children: /* @__PURE__ */ n(
|
|
479
|
+
children: /* @__PURE__ */ n(Nr, { children: t })
|
|
480
480
|
}
|
|
481
481
|
) }) : null;
|
|
482
|
-
},
|
|
482
|
+
}, Nr = ({
|
|
483
483
|
children: t,
|
|
484
484
|
...r
|
|
485
|
-
}) => /* @__PURE__ */
|
|
485
|
+
}) => /* @__PURE__ */ g(Ne, { "aria-label": "Formattering", ...r, children: [
|
|
486
|
+
/* @__PURE__ */ n(Mr, {}),
|
|
487
|
+
/* @__PURE__ */ n(ye, {}),
|
|
486
488
|
/* @__PURE__ */ n(Lr, {}),
|
|
487
|
-
/* @__PURE__ */ n(xe, {}),
|
|
488
|
-
/* @__PURE__ */ n(Tr, {}),
|
|
489
489
|
t
|
|
490
490
|
] });
|
|
491
|
-
function
|
|
491
|
+
function yr() {
|
|
492
492
|
const [t] = y();
|
|
493
|
-
return N(() =>
|
|
493
|
+
return N(() => nt(
|
|
494
494
|
t.registerCommand(
|
|
495
|
-
|
|
496
|
-
() => (
|
|
495
|
+
Ct,
|
|
496
|
+
() => (ie(t, "check"), !0),
|
|
497
497
|
w
|
|
498
498
|
),
|
|
499
499
|
t.registerCommand(
|
|
500
|
-
|
|
501
|
-
(r) =>
|
|
500
|
+
Yt,
|
|
501
|
+
(r) => ft(r, t, !1),
|
|
502
502
|
w
|
|
503
503
|
),
|
|
504
504
|
t.registerCommand(
|
|
505
|
-
|
|
506
|
-
(r) =>
|
|
505
|
+
qt,
|
|
506
|
+
(r) => ft(r, t, !0),
|
|
507
507
|
w
|
|
508
508
|
),
|
|
509
509
|
t.registerCommand(
|
|
510
|
-
|
|
510
|
+
kt,
|
|
511
511
|
(r) => {
|
|
512
|
-
if (
|
|
512
|
+
if (X() != null) {
|
|
513
513
|
const o = t.getRootElement();
|
|
514
514
|
return o != null && o.focus(), !0;
|
|
515
515
|
}
|
|
@@ -518,30 +518,30 @@ function xr() {
|
|
|
518
518
|
w
|
|
519
519
|
),
|
|
520
520
|
t.registerCommand(
|
|
521
|
-
|
|
521
|
+
Gt,
|
|
522
522
|
(r) => {
|
|
523
|
-
const e =
|
|
523
|
+
const e = X();
|
|
524
524
|
return e != null && t.isEditable() ? (t.update(() => {
|
|
525
|
-
const o =
|
|
525
|
+
const o = J(e);
|
|
526
526
|
z(o) && (r.preventDefault(), o.toggleChecked());
|
|
527
527
|
}), !0) : !1;
|
|
528
528
|
},
|
|
529
529
|
w
|
|
530
530
|
),
|
|
531
531
|
t.registerCommand(
|
|
532
|
-
|
|
532
|
+
Xt,
|
|
533
533
|
(r) => t.getEditorState().read(() => {
|
|
534
534
|
const e = L();
|
|
535
535
|
if (T(e) && e.isCollapsed()) {
|
|
536
536
|
const { anchor: o } = e, i = o.type === "element";
|
|
537
537
|
if (i || o.offset === 0) {
|
|
538
|
-
const l = o.getNode(), a =
|
|
538
|
+
const l = o.getNode(), a = It(
|
|
539
539
|
l,
|
|
540
|
-
(s) =>
|
|
540
|
+
(s) => Qt(s) && !s.isInline()
|
|
541
541
|
);
|
|
542
542
|
if (z(a)) {
|
|
543
543
|
const s = a.getParent();
|
|
544
|
-
if (
|
|
544
|
+
if (Z(s) && s.getListType() === "check" && (i || a.getFirstDescendant() === l)) {
|
|
545
545
|
const d = t.getElementByKey(a.__key);
|
|
546
546
|
if (d != null && document.activeElement !== d)
|
|
547
547
|
return d.focus(), r.preventDefault(), !0;
|
|
@@ -554,16 +554,16 @@ function xr() {
|
|
|
554
554
|
w
|
|
555
555
|
),
|
|
556
556
|
t.registerRootListener((r, e) => {
|
|
557
|
-
r !== null && (r.addEventListener("click",
|
|
557
|
+
r !== null && (r.addEventListener("click", pt), r.addEventListener("pointerdown", gt)), e !== null && (e.removeEventListener("click", pt), e.removeEventListener("pointerdown", gt));
|
|
558
558
|
})
|
|
559
559
|
), [t]), null;
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function Bt(t, r) {
|
|
562
562
|
const e = t.target;
|
|
563
|
-
if (e === null || !
|
|
563
|
+
if (e === null || !ht(e))
|
|
564
564
|
return;
|
|
565
565
|
const o = e.firstChild;
|
|
566
|
-
if (o != null &&
|
|
566
|
+
if (o != null && ht(o) && (o.tagName === "UL" || o.tagName === "OL"))
|
|
567
567
|
return;
|
|
568
568
|
const i = e.parentNode;
|
|
569
569
|
if (!i || i.__lexicalListType !== "check")
|
|
@@ -571,23 +571,23 @@ function At(t, r) {
|
|
|
571
571
|
const l = t.pageX, a = e.getBoundingClientRect();
|
|
572
572
|
(e.dir === "rtl" ? l < a.right && l > a.right - 20 : l > a.left && l < a.left + 20) && r();
|
|
573
573
|
}
|
|
574
|
-
function
|
|
575
|
-
|
|
576
|
-
const r = t.target, e =
|
|
574
|
+
function pt(t) {
|
|
575
|
+
Bt(t, () => {
|
|
576
|
+
const r = t.target, e = xr(r);
|
|
577
577
|
e != null && e.isEditable() && e.update(() => {
|
|
578
578
|
if (t.target) {
|
|
579
|
-
const o =
|
|
579
|
+
const o = J(r);
|
|
580
580
|
z(o) && (r.focus(), o.toggleChecked());
|
|
581
581
|
}
|
|
582
582
|
});
|
|
583
583
|
});
|
|
584
584
|
}
|
|
585
|
-
function
|
|
586
|
-
|
|
585
|
+
function gt(t) {
|
|
586
|
+
Bt(t, () => {
|
|
587
587
|
t.preventDefault();
|
|
588
588
|
});
|
|
589
589
|
}
|
|
590
|
-
function
|
|
590
|
+
function xr(t) {
|
|
591
591
|
let r = t;
|
|
592
592
|
for (; r; ) {
|
|
593
593
|
if (r.__lexicalEditor)
|
|
@@ -596,30 +596,30 @@ function Sr(t) {
|
|
|
596
596
|
}
|
|
597
597
|
return null;
|
|
598
598
|
}
|
|
599
|
-
function
|
|
599
|
+
function X() {
|
|
600
600
|
const t = document.activeElement;
|
|
601
601
|
return t != null && t.tagName === "LI" && t.parentNode != null && // @ts-ignore internal field
|
|
602
602
|
t.parentNode.__lexicalListType === "check" ? t : null;
|
|
603
603
|
}
|
|
604
|
-
function
|
|
604
|
+
function Sr(t, r) {
|
|
605
605
|
let e = r ? t.getPreviousSibling() : t.getNextSibling(), o = t;
|
|
606
606
|
for (; e == null && z(o); )
|
|
607
607
|
o = o.getParentOrThrow().getParent(), o != null && (e = r ? o.getPreviousSibling() : o.getNextSibling());
|
|
608
608
|
for (; z(e); ) {
|
|
609
609
|
const i = r ? e.getLastChild() : e.getFirstChild();
|
|
610
|
-
if (!
|
|
610
|
+
if (!Z(i))
|
|
611
611
|
return e;
|
|
612
612
|
e = r ? i.getLastChild() : i.getFirstChild();
|
|
613
613
|
}
|
|
614
614
|
return null;
|
|
615
615
|
}
|
|
616
|
-
function
|
|
617
|
-
const o =
|
|
616
|
+
function ft(t, r, e) {
|
|
617
|
+
const o = X();
|
|
618
618
|
return o != null && r.update(() => {
|
|
619
|
-
const i =
|
|
619
|
+
const i = J(o);
|
|
620
620
|
if (!z(i))
|
|
621
621
|
return;
|
|
622
|
-
const l =
|
|
622
|
+
const l = Sr(i, e);
|
|
623
623
|
if (l != null) {
|
|
624
624
|
l.selectStart();
|
|
625
625
|
const a = r.getElementByKey(l.__key);
|
|
@@ -629,25 +629,25 @@ function mt(t, r, e) {
|
|
|
629
629
|
}
|
|
630
630
|
}), !1;
|
|
631
631
|
}
|
|
632
|
-
const
|
|
633
|
-
/* @__PURE__ */ n(
|
|
634
|
-
/* @__PURE__ */ n(He, {}),
|
|
632
|
+
const Er = () => /* @__PURE__ */ g(Y, { children: [
|
|
633
|
+
/* @__PURE__ */ n(De, {}),
|
|
635
634
|
/* @__PURE__ */ n(Fe, {}),
|
|
636
|
-
/* @__PURE__ */ n(
|
|
637
|
-
/* @__PURE__ */ n(
|
|
638
|
-
|
|
635
|
+
/* @__PURE__ */ n(Pe, {}),
|
|
636
|
+
/* @__PURE__ */ n(yr, {}),
|
|
637
|
+
/* @__PURE__ */ n(He, {})
|
|
638
|
+
] }), wr = ({
|
|
639
639
|
state: t
|
|
640
640
|
}) => {
|
|
641
641
|
const [r] = y();
|
|
642
642
|
return N(() => {
|
|
643
643
|
if (t)
|
|
644
644
|
try {
|
|
645
|
-
if (
|
|
646
|
-
t.isEmpty() ?
|
|
645
|
+
if (je(t)) {
|
|
646
|
+
t.isEmpty() ? Ke(r) : r.setEditorState(t);
|
|
647
647
|
return;
|
|
648
648
|
}
|
|
649
|
-
if (typeof t == "string" &&
|
|
650
|
-
|
|
649
|
+
if (typeof t == "string" && !zt(t)) {
|
|
650
|
+
Ye(t, r);
|
|
651
651
|
return;
|
|
652
652
|
}
|
|
653
653
|
const e = r.parseEditorState(t);
|
|
@@ -656,7 +656,7 @@ const wr = () => /* @__PURE__ */ f(Y, { children: [
|
|
|
656
656
|
console.error("Could not parse"), console.error(e);
|
|
657
657
|
}
|
|
658
658
|
}, []), null;
|
|
659
|
-
},
|
|
659
|
+
}, Rr = Lt("div", {
|
|
660
660
|
border: "1px solid $borderDarker",
|
|
661
661
|
borderRadius: "$md",
|
|
662
662
|
position: "relative",
|
|
@@ -693,7 +693,7 @@ const wr = () => /* @__PURE__ */ f(Y, { children: [
|
|
|
693
693
|
}
|
|
694
694
|
}
|
|
695
695
|
]
|
|
696
|
-
}),
|
|
696
|
+
}), _r = ({
|
|
697
697
|
isLoading: t
|
|
698
698
|
}) => /* @__PURE__ */ n(
|
|
699
699
|
P,
|
|
@@ -705,9 +705,9 @@ const wr = () => /* @__PURE__ */ f(Y, { children: [
|
|
|
705
705
|
right: "1rem",
|
|
706
706
|
display: "flex"
|
|
707
707
|
},
|
|
708
|
-
children: /* @__PURE__ */ n(
|
|
708
|
+
children: /* @__PURE__ */ n(xe, {})
|
|
709
709
|
}
|
|
710
|
-
),
|
|
710
|
+
), fn = ({
|
|
711
711
|
isLoading: t,
|
|
712
712
|
children: r,
|
|
713
713
|
placeholderText: e,
|
|
@@ -718,25 +718,25 @@ const wr = () => /* @__PURE__ */ f(Y, { children: [
|
|
|
718
718
|
content: s,
|
|
719
719
|
hideBorder: d,
|
|
720
720
|
onBlur: c,
|
|
721
|
-
defaultState:
|
|
721
|
+
defaultState: f,
|
|
722
722
|
css: u
|
|
723
723
|
}) => {
|
|
724
|
-
const { hasFocus: m, attributes: E } =
|
|
725
|
-
return /* @__PURE__ */ n(Ot.Provider, { value: k, children: /* @__PURE__ */
|
|
726
|
-
|
|
724
|
+
const { hasFocus: m, attributes: E } = Ze({ onBlur: c }), x = tt(null), k = Mt(() => ({ hasFocus: m, editorRef: x }), [m]);
|
|
725
|
+
return /* @__PURE__ */ n(Ot.Provider, { value: k, children: /* @__PURE__ */ g(
|
|
726
|
+
ze,
|
|
727
727
|
{
|
|
728
728
|
initialConfig: {
|
|
729
729
|
namespace: "CommentEditor",
|
|
730
730
|
onError: (S) => {
|
|
731
731
|
console.error(S);
|
|
732
732
|
},
|
|
733
|
-
theme:
|
|
733
|
+
theme: Ve,
|
|
734
734
|
nodes: o,
|
|
735
735
|
editable: !0
|
|
736
736
|
},
|
|
737
737
|
children: [
|
|
738
|
-
/* @__PURE__ */
|
|
739
|
-
|
|
738
|
+
/* @__PURE__ */ g(
|
|
739
|
+
Rr,
|
|
740
740
|
{
|
|
741
741
|
ref: x,
|
|
742
742
|
hasFocus: m,
|
|
@@ -763,22 +763,22 @@ const wr = () => /* @__PURE__ */ f(Y, { children: [
|
|
|
763
763
|
children: e
|
|
764
764
|
}
|
|
765
765
|
) : null,
|
|
766
|
-
ErrorBoundary:
|
|
766
|
+
ErrorBoundary: $e
|
|
767
767
|
}
|
|
768
768
|
),
|
|
769
|
-
/* @__PURE__ */ n(
|
|
769
|
+
/* @__PURE__ */ n(Er, {}),
|
|
770
770
|
i,
|
|
771
|
-
/* @__PURE__ */ n(
|
|
772
|
-
!l && /* @__PURE__ */ n(
|
|
771
|
+
/* @__PURE__ */ n(_r, { isLoading: t }),
|
|
772
|
+
!l && /* @__PURE__ */ n(Tr, { children: a })
|
|
773
773
|
]
|
|
774
774
|
}
|
|
775
775
|
),
|
|
776
|
-
/* @__PURE__ */ n(
|
|
776
|
+
/* @__PURE__ */ n(wr, { state: f }),
|
|
777
777
|
/* @__PURE__ */ n(Y, { children: r })
|
|
778
778
|
]
|
|
779
779
|
}
|
|
780
780
|
) });
|
|
781
|
-
},
|
|
781
|
+
}, Ir = {
|
|
782
782
|
fontSize: "1rem",
|
|
783
783
|
lineHeight: "1.5",
|
|
784
784
|
"h1, h2, h3, h4, h5, h6": {
|
|
@@ -946,84 +946,84 @@ const wr = () => /* @__PURE__ */ f(Y, { children: [
|
|
|
946
946
|
defaultVariants: {
|
|
947
947
|
size: "md"
|
|
948
948
|
}
|
|
949
|
-
},
|
|
949
|
+
}, mn = $(Ir), kn = () => {
|
|
950
950
|
const [t] = y(), r = v(() => {
|
|
951
|
-
t.dispatchCommand(
|
|
951
|
+
t.dispatchCommand(ge, {
|
|
952
952
|
rows: "3",
|
|
953
953
|
columns: "3",
|
|
954
954
|
includeHeaders: !1
|
|
955
955
|
});
|
|
956
956
|
}, [t]);
|
|
957
957
|
return /* @__PURE__ */ n(
|
|
958
|
-
|
|
958
|
+
et,
|
|
959
959
|
{
|
|
960
|
-
trigger: /* @__PURE__ */ n(
|
|
960
|
+
trigger: /* @__PURE__ */ n(Tt, { dropdown: !0, children: "Sett inn" }),
|
|
961
961
|
side: "bottom",
|
|
962
962
|
align: "end",
|
|
963
|
-
children: /* @__PURE__ */
|
|
964
|
-
/* @__PURE__ */ n(
|
|
963
|
+
children: /* @__PURE__ */ g(M, { onClick: r, children: [
|
|
964
|
+
/* @__PURE__ */ n(mr, { size: "1.25rem" }),
|
|
965
965
|
" Tabell"
|
|
966
966
|
] })
|
|
967
967
|
}
|
|
968
968
|
);
|
|
969
969
|
};
|
|
970
|
-
function
|
|
970
|
+
function zr(t) {
|
|
971
971
|
return h({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "circle", attr: { cx: "256", cy: "256", r: "48" } }, { tag: "circle", attr: { cx: "416", cy: "256", r: "48" } }, { tag: "circle", attr: { cx: "96", cy: "256", r: "48" } }] })(t);
|
|
972
972
|
}
|
|
973
|
-
const
|
|
974
|
-
const [t] = y(), [r, e] = b(null), { hasFocus: o } =
|
|
973
|
+
const bn = () => {
|
|
974
|
+
const [t] = y(), [r, e] = b(null), { hasFocus: o } = ot();
|
|
975
975
|
N(() => {
|
|
976
976
|
!o && r && e(null);
|
|
977
977
|
}, [o, r]);
|
|
978
|
-
const { refs: i, floatingStyles: l } =
|
|
978
|
+
const { refs: i, floatingStyles: l } = rt({
|
|
979
979
|
placement: "top-end",
|
|
980
980
|
open: !!r,
|
|
981
981
|
elements: {
|
|
982
982
|
reference: r
|
|
983
983
|
},
|
|
984
|
-
middleware: [
|
|
984
|
+
middleware: [xt({ mainAxis: -20, crossAxis: -2 })]
|
|
985
985
|
});
|
|
986
986
|
N(() => t.registerCommand(
|
|
987
987
|
F,
|
|
988
988
|
() => {
|
|
989
989
|
const s = L();
|
|
990
990
|
if (T(s)) {
|
|
991
|
-
const d = s.anchor.getNode(), c =
|
|
991
|
+
const d = s.anchor.getNode(), c = fe(d);
|
|
992
992
|
e(c ? t.getElementByKey(c.getKey()) : null);
|
|
993
993
|
}
|
|
994
994
|
return !1;
|
|
995
995
|
},
|
|
996
|
-
|
|
996
|
+
Jt
|
|
997
997
|
), [t]);
|
|
998
998
|
const a = (s) => () => {
|
|
999
999
|
t.update(() => {
|
|
1000
1000
|
switch (s) {
|
|
1001
1001
|
case "add-row-over":
|
|
1002
|
-
|
|
1002
|
+
ct(!1);
|
|
1003
1003
|
break;
|
|
1004
1004
|
case "add-row-under":
|
|
1005
|
-
|
|
1005
|
+
ct(!0);
|
|
1006
1006
|
break;
|
|
1007
1007
|
case "add-column-left":
|
|
1008
|
-
|
|
1008
|
+
st(!1);
|
|
1009
1009
|
break;
|
|
1010
1010
|
case "add-column-right":
|
|
1011
|
-
|
|
1011
|
+
st(!0);
|
|
1012
1012
|
break;
|
|
1013
1013
|
case "delete-row":
|
|
1014
|
-
|
|
1014
|
+
ke();
|
|
1015
1015
|
break;
|
|
1016
1016
|
case "delete-column":
|
|
1017
|
-
|
|
1017
|
+
me();
|
|
1018
1018
|
break;
|
|
1019
1019
|
}
|
|
1020
1020
|
});
|
|
1021
1021
|
};
|
|
1022
|
-
return r ? /* @__PURE__ */
|
|
1023
|
-
|
|
1022
|
+
return r ? /* @__PURE__ */ g(
|
|
1023
|
+
et,
|
|
1024
1024
|
{
|
|
1025
1025
|
trigger: /* @__PURE__ */ n(
|
|
1026
|
-
|
|
1026
|
+
O,
|
|
1027
1027
|
{
|
|
1028
1028
|
icon: !0,
|
|
1029
1029
|
variant: "primary",
|
|
@@ -1031,32 +1031,32 @@ const vn = () => {
|
|
|
1031
1031
|
ref: i.setFloating,
|
|
1032
1032
|
style: l,
|
|
1033
1033
|
css: { padding: "2px", width: "18px", height: "18px" },
|
|
1034
|
-
children: /* @__PURE__ */ n(
|
|
1034
|
+
children: /* @__PURE__ */ n(zr, {})
|
|
1035
1035
|
}
|
|
1036
1036
|
),
|
|
1037
1037
|
children: [
|
|
1038
1038
|
/* @__PURE__ */ n(_, { onClick: a("add-row-over"), children: "Legg til rad over" }),
|
|
1039
1039
|
/* @__PURE__ */ n(_, { onClick: a("add-row-under"), children: "Legg til rad under" }),
|
|
1040
|
-
/* @__PURE__ */ n(
|
|
1040
|
+
/* @__PURE__ */ n(dt, {}),
|
|
1041
1041
|
/* @__PURE__ */ n(_, { onClick: a("add-column-left"), children: "Legg til kolonne venstre" }),
|
|
1042
1042
|
/* @__PURE__ */ n(_, { onClick: a("add-column-right"), children: "Legg til kolonne høyre" }),
|
|
1043
|
-
/* @__PURE__ */ n(
|
|
1043
|
+
/* @__PURE__ */ n(dt, {}),
|
|
1044
1044
|
/* @__PURE__ */ n(_, { onClick: a("delete-row"), children: "Fjern rad" }),
|
|
1045
1045
|
/* @__PURE__ */ n(_, { onClick: a("delete-column"), children: "Fjern kolonne" })
|
|
1046
1046
|
]
|
|
1047
1047
|
}
|
|
1048
1048
|
) : null;
|
|
1049
1049
|
};
|
|
1050
|
-
function
|
|
1050
|
+
function At(t) {
|
|
1051
1051
|
let r = t;
|
|
1052
1052
|
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;
|
|
1053
1053
|
return r = String(r).trim(), r.match(e) || r.match(o) ? r : "https://";
|
|
1054
1054
|
}
|
|
1055
|
-
function
|
|
1055
|
+
function Dt(t) {
|
|
1056
1056
|
const r = t.anchor, e = t.focus, o = t.anchor.getNode(), i = t.focus.getNode();
|
|
1057
|
-
return o === i ? o : t.isBackward() ?
|
|
1057
|
+
return o === i ? o : t.isBackward() ? lt(e) ? o : i : lt(r) ? o : i;
|
|
1058
1058
|
}
|
|
1059
|
-
const
|
|
1059
|
+
const vn = (t) => (R.baseURL = t, R), U = class extends bt {
|
|
1060
1060
|
static getType() {
|
|
1061
1061
|
return "rutine_link";
|
|
1062
1062
|
}
|
|
@@ -1068,7 +1068,7 @@ const Cn = (t) => (R.baseURL = t, R), U = class extends vt {
|
|
|
1068
1068
|
return e.setAttribute("href", this.getURL()), e.setAttribute("target", "_blank"), e.setAttribute("rel", "noopener noreferrer"), e.classList.add("rutine-link"), e;
|
|
1069
1069
|
}
|
|
1070
1070
|
static importJSON(r) {
|
|
1071
|
-
return
|
|
1071
|
+
return Pt(r.url);
|
|
1072
1072
|
}
|
|
1073
1073
|
exportJSON() {
|
|
1074
1074
|
return {
|
|
@@ -1087,14 +1087,14 @@ const Cn = (t) => (R.baseURL = t, R), U = class extends vt {
|
|
|
1087
1087
|
}
|
|
1088
1088
|
};
|
|
1089
1089
|
let R = U;
|
|
1090
|
-
|
|
1091
|
-
function
|
|
1090
|
+
at(R, "baseURL", "");
|
|
1091
|
+
function Pt(t) {
|
|
1092
1092
|
return new R(t);
|
|
1093
1093
|
}
|
|
1094
1094
|
function Or(t) {
|
|
1095
1095
|
return t instanceof R;
|
|
1096
1096
|
}
|
|
1097
|
-
const
|
|
1097
|
+
const $r = ({ onClose: t }) => {
|
|
1098
1098
|
const [r] = y(), e = v(
|
|
1099
1099
|
(i) => {
|
|
1100
1100
|
r.update(() => {
|
|
@@ -1103,32 +1103,32 @@ const Dr = ({ onClose: t }) => {
|
|
|
1103
1103
|
const a = l.getNodes();
|
|
1104
1104
|
if (a.length === 1) {
|
|
1105
1105
|
const s = a[0];
|
|
1106
|
-
|
|
1106
|
+
Vt(s) && s.getChildren().length === 0 && l.insertText(i);
|
|
1107
1107
|
}
|
|
1108
1108
|
}
|
|
1109
|
-
}), r.dispatchCommand(
|
|
1109
|
+
}), r.dispatchCommand(V, At(i));
|
|
1110
1110
|
},
|
|
1111
1111
|
[r]
|
|
1112
1112
|
);
|
|
1113
|
-
return /* @__PURE__ */
|
|
1113
|
+
return /* @__PURE__ */ g("form", { onSubmit: (i) => {
|
|
1114
1114
|
e(i.target.url.value), t();
|
|
1115
1115
|
}, children: [
|
|
1116
|
-
/* @__PURE__ */ n(
|
|
1117
|
-
/* @__PURE__ */
|
|
1118
|
-
/* @__PURE__ */ n(
|
|
1119
|
-
/* @__PURE__ */ n(
|
|
1116
|
+
/* @__PURE__ */ n(we, { name: "url", label: "URL", type: "url", required: !0 }),
|
|
1117
|
+
/* @__PURE__ */ g(_t, { children: [
|
|
1118
|
+
/* @__PURE__ */ n(O, { onClick: t, children: "Avbryt" }),
|
|
1119
|
+
/* @__PURE__ */ n(O, { type: "submit", variant: "primary", children: "Lagre" })
|
|
1120
1120
|
] })
|
|
1121
1121
|
] });
|
|
1122
|
-
},
|
|
1122
|
+
}, Br = ({ onClose: t, getDocs: r }) => {
|
|
1123
1123
|
const [e] = y(), [o, i] = b([]), l = r(), a = v(
|
|
1124
1124
|
(s) => {
|
|
1125
1125
|
e.update(() => {
|
|
1126
1126
|
const d = L();
|
|
1127
1127
|
if (T(d)) {
|
|
1128
1128
|
const c = [];
|
|
1129
|
-
for (const [
|
|
1130
|
-
const m =
|
|
1131
|
-
m.append(
|
|
1129
|
+
for (const [f, u] of s.entries()) {
|
|
1130
|
+
const m = Pt(u.value);
|
|
1131
|
+
m.append(D(u.label)), c.push(m), f !== s.length - 1 && c.push(D(" "));
|
|
1132
1132
|
}
|
|
1133
1133
|
d.insertNodes(c);
|
|
1134
1134
|
}
|
|
@@ -1136,12 +1136,12 @@ const Dr = ({ onClose: t }) => {
|
|
|
1136
1136
|
},
|
|
1137
1137
|
[e]
|
|
1138
1138
|
);
|
|
1139
|
-
return /* @__PURE__ */
|
|
1140
|
-
/* @__PURE__ */ n(
|
|
1141
|
-
/* @__PURE__ */
|
|
1142
|
-
/* @__PURE__ */ n(
|
|
1139
|
+
return /* @__PURE__ */ g(Y, { children: [
|
|
1140
|
+
/* @__PURE__ */ n(Re, { isMulti: !0, options: l, onChange: i }),
|
|
1141
|
+
/* @__PURE__ */ g(_t, { children: [
|
|
1142
|
+
/* @__PURE__ */ n(O, { onClick: t, children: "Avbryt" }),
|
|
1143
1143
|
/* @__PURE__ */ n(
|
|
1144
|
-
|
|
1144
|
+
O,
|
|
1145
1145
|
{
|
|
1146
1146
|
variant: "primary",
|
|
1147
1147
|
onClick: () => {
|
|
@@ -1152,7 +1152,7 @@ const Dr = ({ onClose: t }) => {
|
|
|
1152
1152
|
)
|
|
1153
1153
|
] })
|
|
1154
1154
|
] });
|
|
1155
|
-
},
|
|
1155
|
+
}, Ar = ({
|
|
1156
1156
|
open: t,
|
|
1157
1157
|
onOpenChange: r,
|
|
1158
1158
|
getDocs: e
|
|
@@ -1160,40 +1160,40 @@ const Dr = ({ onClose: t }) => {
|
|
|
1160
1160
|
const [o, i] = b("url"), l = () => {
|
|
1161
1161
|
r(!1);
|
|
1162
1162
|
};
|
|
1163
|
-
return /* @__PURE__ */
|
|
1164
|
-
/* @__PURE__ */
|
|
1165
|
-
/* @__PURE__ */ n(
|
|
1166
|
-
/* @__PURE__ */ n(
|
|
1163
|
+
return /* @__PURE__ */ g(Se, { open: t, onOpenChange: r, css: { width: "600px" }, children: [
|
|
1164
|
+
/* @__PURE__ */ g(Ee, { css: { marginBottom: "$8" }, children: [
|
|
1165
|
+
/* @__PURE__ */ n(ut, { active: o === "url", onClick: () => i("url"), children: "URL" }),
|
|
1166
|
+
/* @__PURE__ */ n(ut, { active: o === "rutine", onClick: () => i("rutine"), children: "Rutine" })
|
|
1167
1167
|
] }),
|
|
1168
|
-
o === "url" && /* @__PURE__ */ n(
|
|
1169
|
-
o === "rutine" && /* @__PURE__ */ n(
|
|
1168
|
+
o === "url" && /* @__PURE__ */ n($r, { onClose: l }),
|
|
1169
|
+
o === "rutine" && /* @__PURE__ */ n(Br, { onClose: l, getDocs: e })
|
|
1170
1170
|
] });
|
|
1171
|
-
},
|
|
1171
|
+
}, Cn = ({ getDocs: t }) => {
|
|
1172
1172
|
const [r] = y(), [e, o] = b(!1), [i, l] = b(!1), a = v(() => {
|
|
1173
1173
|
const s = L();
|
|
1174
1174
|
if (T(s)) {
|
|
1175
|
-
const d =
|
|
1175
|
+
const d = Dt(s), c = d.getParent();
|
|
1176
1176
|
o(W(c) || W(d));
|
|
1177
1177
|
}
|
|
1178
1178
|
}, []);
|
|
1179
1179
|
return N(() => r.registerCommand(
|
|
1180
1180
|
F,
|
|
1181
1181
|
() => (a(), !1),
|
|
1182
|
-
|
|
1183
|
-
), [r, a]), /* @__PURE__ */
|
|
1182
|
+
Q
|
|
1183
|
+
), [r, a]), /* @__PURE__ */ g(Nt, { type: "single", value: e ? "link" : "", children: [
|
|
1184
1184
|
/* @__PURE__ */ n(
|
|
1185
1185
|
I,
|
|
1186
1186
|
{
|
|
1187
1187
|
onClick: () => {
|
|
1188
|
-
e ? r.dispatchCommand(
|
|
1188
|
+
e ? r.dispatchCommand(V, null) : l(!0);
|
|
1189
1189
|
},
|
|
1190
1190
|
title: "Lenke",
|
|
1191
1191
|
value: "link",
|
|
1192
|
-
children: /* @__PURE__ */ n(
|
|
1192
|
+
children: /* @__PURE__ */ n(dr, { size: "1.25rem" })
|
|
1193
1193
|
}
|
|
1194
1194
|
),
|
|
1195
1195
|
/* @__PURE__ */ n(
|
|
1196
|
-
|
|
1196
|
+
Ar,
|
|
1197
1197
|
{
|
|
1198
1198
|
open: i,
|
|
1199
1199
|
onOpenChange: l,
|
|
@@ -1201,47 +1201,47 @@ const Dr = ({ onClose: t }) => {
|
|
|
1201
1201
|
}
|
|
1202
1202
|
)
|
|
1203
1203
|
] });
|
|
1204
|
-
},
|
|
1205
|
-
const [t] = y(), r =
|
|
1204
|
+
}, Mn = () => {
|
|
1205
|
+
const [t] = y(), r = tt(null), [e, o] = b(null), [i, l] = b(""), { hasFocus: a } = ot();
|
|
1206
1206
|
N(() => {
|
|
1207
1207
|
e ? t.update(() => {
|
|
1208
1208
|
l(e.getURL());
|
|
1209
1209
|
}) : l("");
|
|
1210
1210
|
}, [t, e]);
|
|
1211
|
-
const s = !!(e && i && a), { refs: d, floatingStyles: c, context:
|
|
1211
|
+
const s = !!(e && i && a), { refs: d, floatingStyles: c, context: f } = rt({
|
|
1212
1212
|
placement: "top",
|
|
1213
1213
|
strategy: "fixed",
|
|
1214
1214
|
open: s,
|
|
1215
|
-
whileElementsMounted:
|
|
1215
|
+
whileElementsMounted: yt,
|
|
1216
1216
|
elements: {
|
|
1217
1217
|
reference: r.current
|
|
1218
1218
|
},
|
|
1219
|
-
middleware: [
|
|
1220
|
-
}), { getFloatingProps: u } =
|
|
1221
|
-
|
|
1222
|
-
|
|
1219
|
+
middleware: [_e()]
|
|
1220
|
+
}), { getFloatingProps: u } = St([
|
|
1221
|
+
Et(f),
|
|
1222
|
+
Ie(f)
|
|
1223
1223
|
]), m = v(() => {
|
|
1224
1224
|
var S;
|
|
1225
1225
|
const k = L();
|
|
1226
1226
|
if (T(k)) {
|
|
1227
|
-
const
|
|
1227
|
+
const B = Dt(k), p = B.getParent();
|
|
1228
1228
|
let H = null;
|
|
1229
|
-
if (W(p) ? H = p : W(
|
|
1230
|
-
const q = window.getSelection(),
|
|
1231
|
-
k !== null && q !== null &&
|
|
1229
|
+
if (W(p) ? H = p : W(B) && (H = B), H) {
|
|
1230
|
+
const q = window.getSelection(), it = t.getRootElement();
|
|
1231
|
+
k !== null && q !== null && it !== null && it.contains(q.anchorNode) && t.isEditable() && (r.current = ((S = q.focusNode) == null ? void 0 : S.parentElement) ?? null);
|
|
1232
1232
|
}
|
|
1233
1233
|
o(H);
|
|
1234
1234
|
}
|
|
1235
1235
|
}, [t]), E = v(() => {
|
|
1236
1236
|
e && Or(e) && t.update(() => {
|
|
1237
1237
|
e.remove();
|
|
1238
|
-
}), t.dispatchCommand(
|
|
1238
|
+
}), t.dispatchCommand(V, null);
|
|
1239
1239
|
}, [t, e]);
|
|
1240
1240
|
if (N(() => {
|
|
1241
1241
|
t.getEditorState().read(() => {
|
|
1242
1242
|
m();
|
|
1243
1243
|
});
|
|
1244
|
-
}, [t, m]), N(() =>
|
|
1244
|
+
}, [t, m]), N(() => nt(
|
|
1245
1245
|
t.registerUpdateListener(({ editorState: k }) => {
|
|
1246
1246
|
k.read(() => {
|
|
1247
1247
|
m();
|
|
@@ -1253,15 +1253,15 @@ const Dr = ({ onClose: t }) => {
|
|
|
1253
1253
|
w
|
|
1254
1254
|
),
|
|
1255
1255
|
t.registerCommand(
|
|
1256
|
-
|
|
1256
|
+
kt,
|
|
1257
1257
|
() => e ? (o(null), !0) : !1,
|
|
1258
|
-
|
|
1258
|
+
Zt
|
|
1259
1259
|
)
|
|
1260
1260
|
), [t, m, e]), !s)
|
|
1261
1261
|
return null;
|
|
1262
|
-
const x =
|
|
1263
|
-
return /* @__PURE__ */ n(
|
|
1264
|
-
|
|
1262
|
+
const x = At(i);
|
|
1263
|
+
return /* @__PURE__ */ n(wt, { children: /* @__PURE__ */ g(
|
|
1264
|
+
Rt,
|
|
1265
1265
|
{
|
|
1266
1266
|
ref: d.setFloating,
|
|
1267
1267
|
css: {
|
|
@@ -1292,32 +1292,32 @@ const Dr = ({ onClose: t }) => {
|
|
|
1292
1292
|
children: i
|
|
1293
1293
|
}
|
|
1294
1294
|
),
|
|
1295
|
-
/* @__PURE__ */ n(
|
|
1295
|
+
/* @__PURE__ */ n(O, { color: "danger", icon: !0, size: "sm", onClick: E, children: /* @__PURE__ */ n(Ae, { size: 24 }) })
|
|
1296
1296
|
]
|
|
1297
1297
|
}
|
|
1298
1298
|
) });
|
|
1299
1299
|
};
|
|
1300
1300
|
export {
|
|
1301
|
-
|
|
1301
|
+
Pt as $createRutineLinkNode,
|
|
1302
1302
|
Or as $isRutineLinkNode,
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1303
|
+
Tr as FloatingToolbar,
|
|
1304
|
+
kn as InsertSelector,
|
|
1305
|
+
Mn as LinkEditPlugin,
|
|
1306
|
+
Cn as LinkToolbarButton,
|
|
1307
|
+
fn as RichTextEditor,
|
|
1308
|
+
Nr as RichTextToolbar,
|
|
1309
1309
|
R as RutineLinkNode,
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1310
|
+
vn as RutineLinkNodeInit,
|
|
1311
|
+
bn as TableEditPlugin,
|
|
1312
|
+
Ke as clearEditorState,
|
|
1313
|
+
gn as defaultNodes,
|
|
1314
|
+
je as isEditorState,
|
|
1315
|
+
zt as isJSON,
|
|
1316
1316
|
Ot as richTextContext,
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1317
|
+
mn as richTextCss,
|
|
1318
|
+
Ir as richTextStyleObj,
|
|
1319
|
+
Ye as setStateFromPlainText,
|
|
1320
|
+
pn as stateToHTML,
|
|
1321
|
+
Ze as useHasFocusWithin,
|
|
1322
|
+
ot as useRichTextContext
|
|
1323
1323
|
};
|