@arkitektbedriftene/fe-lib 2.0.4 → 2.0.5
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 +68 -68
- package/package.json +1 -1
package/dist/rich-text.es.js
CHANGED
|
@@ -3,22 +3,22 @@ var ne = (t, r, e) => r in t ? re(t, r, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var I = (t, r, e) => (ne(t, typeof r != "symbol" ? r + "" : r, e), e);
|
|
4
4
|
import { createHeadlessEditor as oe } from "@lexical/headless";
|
|
5
5
|
import { $generateHtmlFromNodes as ie } from "@lexical/html";
|
|
6
|
-
import { $getRoot as X, ParagraphNode as ae, $createParagraphNode as W, $createTextNode as $, $setSelection as Q, $getNodeByKey as
|
|
7
|
-
import { trimTextContentFromAnchor as ve, $setBlocksType as nt, $isAtNodeEnd as
|
|
8
|
-
import { LinkNode as B, AutoLinkNode as
|
|
9
|
-
import { ListNode as st, ListItemNode as
|
|
10
|
-
import { HeadingNode as
|
|
11
|
-
import { TableNode as
|
|
6
|
+
import { $getRoot as X, ParagraphNode as ae, $createParagraphNode as W, $createTextNode as $, $setSelection as Q, $getNodeByKey as kt, DecoratorNode as le, $applyNodeReplacement as se, SELECTION_CHANGE_COMMAND as j, $getSelection as w, COMMAND_PRIORITY_CRITICAL as at, $isRangeSelection as L, $isRootOrShadowRoot as Lt, FORMAT_TEXT_COMMAND as U, COMMAND_PRIORITY_LOW as R, KEY_ARROW_DOWN_COMMAND as ce, KEY_ARROW_UP_COMMAND as de, KEY_ESCAPE_COMMAND as yt, KEY_SPACE_COMMAND as he, $getNearestNodeFromDOMNode as lt, KEY_ARROW_LEFT_COMMAND as ue, $isElementNode as ge, createCommand as pe, $insertNodes as me, COMMAND_PRIORITY_EDITOR as fe, COMMAND_PRIORITY_NORMAL as ke, $createRangeSelection as Nt, COMMAND_PRIORITY_HIGH as be } from "lexical";
|
|
7
|
+
import { trimTextContentFromAnchor as ve, $setBlocksType as nt, $isAtNodeEnd as bt } from "@lexical/selection";
|
|
8
|
+
import { LinkNode as B, AutoLinkNode as St, $isLinkNode as Y, TOGGLE_LINK_COMMAND as V } from "@lexical/link";
|
|
9
|
+
import { ListNode as st, ListItemNode as Et, $isListNode as ct, INSERT_UNORDERED_LIST_COMMAND as Ce, INSERT_ORDERED_LIST_COMMAND as Me, INSERT_CHECK_LIST_COMMAND as It, insertList as _e, $isListItemNode as P } from "@lexical/list";
|
|
10
|
+
import { HeadingNode as Rt, QuoteNode as Ot, $isHeadingNode as Te, $createHeadingNode as xe, $createQuoteNode as we } from "@lexical/rich-text";
|
|
11
|
+
import { TableNode as $t, TableRowNode as zt, TableCellNode as At, INSERT_TABLE_COMMAND as Le, $getTableCellNodeFromLexicalNode as ye, $deleteTableColumn__EXPERIMENTAL as Ne, $deleteTableRow__EXPERIMENTAL as Se, $insertTableColumn__EXPERIMENTAL as vt, $insertTableRow__EXPERIMENTAL as Ct } from "@lexical/table";
|
|
12
12
|
import { jsx as o, jsxs as g, Fragment as F } from "react/jsx-runtime";
|
|
13
|
-
import { createContext as Ee, useState as f, useRef as K, useCallback as C, useContext as Ie, useEffect as y, useMemo as
|
|
14
|
-
import { Box as H, Stack as Oe, Button as N, DropdownMenu as dt, ToolbarButton as
|
|
13
|
+
import { createContext as Ee, useState as f, useRef as K, useCallback as C, useContext as Ie, useEffect as y, useMemo as Dt, useLayoutEffect as Re } from "react";
|
|
14
|
+
import { Box as H, Stack as Oe, Button as N, DropdownMenu as dt, ToolbarButton as Bt, DropdownMenuIconItem as _, ToolbarToggleGroup as Pt, ToolbarToggleItem as D, OverlayCard as Ht, Toolbar as $e, ToolbarSeparator as ze, styled as Ae, Spinner as ht, Dialog as Ft, DialogHeader as De, TextInput as ut, DialogActions as Z, DropdownMenuItem as A, DropdownMenuSeparator as Mt, NavBar as Be, NavBarItem as ot, Combobox as Pe } from "./ui.es.js";
|
|
15
15
|
import { f as He, g as Fe, G as k, h as Ue, i as We } from "./index.esm-da01383a.js";
|
|
16
16
|
import { useLexicalComposerContext as T } from "@lexical/react/LexicalComposerContext.js";
|
|
17
17
|
import { LexicalComposer as je } from "@lexical/react/LexicalComposer.js";
|
|
18
18
|
import { RichTextPlugin as Ke } from "@lexical/react/LexicalRichTextPlugin.js";
|
|
19
19
|
import qe from "@lexical/react/LexicalErrorBoundary.js";
|
|
20
|
-
import { useFloating as
|
|
21
|
-
import { $getNearestNodeOfType as Ve, $findMatchingParent as Yt, mergeRegister as tt, isHTMLElement as
|
|
20
|
+
import { useFloating as gt, autoUpdate as Ut, size as Ye, flip as Ge, offset as Wt, shift as Je, useInteractions as jt, useRole as Kt, FloatingPortal as qt, inline as Xe, useDismiss as Qe } from "@floating-ui/react";
|
|
21
|
+
import { $getNearestNodeOfType as Ve, $findMatchingParent as Yt, mergeRegister as tt, isHTMLElement as _t, $wrapNodeInElement as Ze } from "@lexical/utils";
|
|
22
22
|
import { s as tr, c as er } from "./stitches.config-00c23cdb.js";
|
|
23
23
|
import { ListPlugin as rr } from "@lexical/react/LexicalListPlugin.js";
|
|
24
24
|
import { HistoryPlugin as nr } from "@lexical/react/LexicalHistoryPlugin.js";
|
|
@@ -182,7 +182,7 @@ function pr({
|
|
|
182
182
|
}, S = () => {
|
|
183
183
|
p.update(() => {
|
|
184
184
|
var M;
|
|
185
|
-
const h =
|
|
185
|
+
const h = kt(i);
|
|
186
186
|
if (!h)
|
|
187
187
|
return;
|
|
188
188
|
const v = h.getPreviousSibling() || ((M = h.getParent()) == null ? void 0 : M.getPreviousSibling());
|
|
@@ -191,7 +191,7 @@ function pr({
|
|
|
191
191
|
}, E = () => {
|
|
192
192
|
p.update(() => {
|
|
193
193
|
var M;
|
|
194
|
-
const h =
|
|
194
|
+
const h = kt(i);
|
|
195
195
|
if (!h)
|
|
196
196
|
return;
|
|
197
197
|
const v = h.getNextSibling() || ((M = h.getParent()) == null ? void 0 : M.getNextSibling());
|
|
@@ -256,7 +256,7 @@ function pr({
|
|
|
256
256
|
}
|
|
257
257
|
function mr(t) {
|
|
258
258
|
const r = t, { alt: e, src: n, width: i, height: a } = r;
|
|
259
|
-
return { node:
|
|
259
|
+
return { node: pt({ altText: e, height: a, src: n, width: i }) };
|
|
260
260
|
}
|
|
261
261
|
class z extends le {
|
|
262
262
|
constructor(e, n, i, a, l, s) {
|
|
@@ -283,7 +283,7 @@ class z extends le {
|
|
|
283
283
|
}
|
|
284
284
|
static importJSON(e) {
|
|
285
285
|
const { altText: n, height: i, width: a, src: l, meta: s } = e;
|
|
286
|
-
return
|
|
286
|
+
return pt({
|
|
287
287
|
altText: n,
|
|
288
288
|
height: i,
|
|
289
289
|
src: l,
|
|
@@ -351,7 +351,7 @@ class z extends le {
|
|
|
351
351
|
);
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
|
-
function
|
|
354
|
+
function pt({
|
|
355
355
|
altText: t,
|
|
356
356
|
height: r,
|
|
357
357
|
src: e,
|
|
@@ -367,26 +367,26 @@ function In(t) {
|
|
|
367
367
|
return t instanceof z;
|
|
368
368
|
}
|
|
369
369
|
const Rn = [
|
|
370
|
-
It,
|
|
371
370
|
Rt,
|
|
371
|
+
Ot,
|
|
372
372
|
st,
|
|
373
|
+
Et,
|
|
373
374
|
St,
|
|
374
|
-
Nt,
|
|
375
375
|
B,
|
|
376
|
-
Ot,
|
|
377
376
|
$t,
|
|
378
377
|
zt,
|
|
378
|
+
At,
|
|
379
379
|
z
|
|
380
380
|
], On = [
|
|
381
|
-
It,
|
|
382
381
|
Rt,
|
|
382
|
+
Ot,
|
|
383
383
|
st,
|
|
384
|
+
Et,
|
|
384
385
|
St,
|
|
385
|
-
Nt,
|
|
386
386
|
B,
|
|
387
|
-
Ot,
|
|
388
387
|
$t,
|
|
389
388
|
zt,
|
|
389
|
+
At,
|
|
390
390
|
z,
|
|
391
391
|
G,
|
|
392
392
|
{
|
|
@@ -500,7 +500,7 @@ const $r = tr("div", {
|
|
|
500
500
|
const r = t.anchor.getNode();
|
|
501
501
|
let e = r.getKey() === "root" ? r : Yt(r, (n) => {
|
|
502
502
|
const i = n.getParent();
|
|
503
|
-
return i !== null &&
|
|
503
|
+
return i !== null && Lt(i);
|
|
504
504
|
});
|
|
505
505
|
return e === null && (e = r.getTopLevelElementOrThrow()), {
|
|
506
506
|
anchorNode: r,
|
|
@@ -540,7 +540,7 @@ const $r = tr("div", {
|
|
|
540
540
|
dt,
|
|
541
541
|
{
|
|
542
542
|
trigger: /* @__PURE__ */ o(
|
|
543
|
-
|
|
543
|
+
Bt,
|
|
544
544
|
{
|
|
545
545
|
dropdown: !0,
|
|
546
546
|
css: { display: "flex", width: "100%", overflow: "hidden" },
|
|
@@ -569,7 +569,7 @@ const $r = tr("div", {
|
|
|
569
569
|
r !== "number" && (t.dispatchCommand(Me, void 0), e("number"));
|
|
570
570
|
}, children: /* @__PURE__ */ o(x, { blockType: "number" }) }),
|
|
571
571
|
/* @__PURE__ */ o(_, { onClick: () => {
|
|
572
|
-
r !== "check" && (t.dispatchCommand(
|
|
572
|
+
r !== "check" && (t.dispatchCommand(It, void 0), e("check"));
|
|
573
573
|
}, children: /* @__PURE__ */ o(x, { blockType: "check" }) }),
|
|
574
574
|
/* @__PURE__ */ o(_, { onClick: () => {
|
|
575
575
|
r !== "quote" && t.update(() => {
|
|
@@ -612,12 +612,12 @@ const $r = tr("div", {
|
|
|
612
612
|
), v = C(
|
|
613
613
|
() => t.dispatchCommand(U, "superscript"),
|
|
614
614
|
[t]
|
|
615
|
-
), M =
|
|
615
|
+
), M = Dt(() => {
|
|
616
616
|
const b = [];
|
|
617
617
|
return r && b.push("bold"), n && b.push("italic"), a && b.push("underline"), s && b.push("code"), c && b.push("superscript"), b;
|
|
618
618
|
}, [r, n, a, s, c]);
|
|
619
619
|
return /* @__PURE__ */ g(
|
|
620
|
-
|
|
620
|
+
Pt,
|
|
621
621
|
{
|
|
622
622
|
type: "multiple",
|
|
623
623
|
"aria-label": "Tekstformattering",
|
|
@@ -660,7 +660,7 @@ const $r = tr("div", {
|
|
|
660
660
|
Re(() => {
|
|
661
661
|
a(n);
|
|
662
662
|
}, [n]);
|
|
663
|
-
const { context: l, refs: s, floatingStyles: d } =
|
|
663
|
+
const { context: l, refs: s, floatingStyles: d } = gt({
|
|
664
664
|
placement: "top",
|
|
665
665
|
whileElementsMounted: Ut,
|
|
666
666
|
middleware: [
|
|
@@ -688,7 +688,7 @@ const $r = tr("div", {
|
|
|
688
688
|
})
|
|
689
689
|
]);
|
|
690
690
|
return i ? /* @__PURE__ */ o(qt, { children: /* @__PURE__ */ o(
|
|
691
|
-
|
|
691
|
+
Ht,
|
|
692
692
|
{
|
|
693
693
|
ref: s.setFloating,
|
|
694
694
|
style: d,
|
|
@@ -715,22 +715,22 @@ function Fr() {
|
|
|
715
715
|
const [t] = T();
|
|
716
716
|
return y(() => tt(
|
|
717
717
|
t.registerCommand(
|
|
718
|
-
|
|
718
|
+
It,
|
|
719
719
|
() => (_e(t, "check"), !0),
|
|
720
720
|
R
|
|
721
721
|
),
|
|
722
722
|
t.registerCommand(
|
|
723
723
|
ce,
|
|
724
|
-
(r) =>
|
|
724
|
+
(r) => wt(r, t, !1),
|
|
725
725
|
R
|
|
726
726
|
),
|
|
727
727
|
t.registerCommand(
|
|
728
728
|
de,
|
|
729
|
-
(r) =>
|
|
729
|
+
(r) => wt(r, t, !0),
|
|
730
730
|
R
|
|
731
731
|
),
|
|
732
732
|
t.registerCommand(
|
|
733
|
-
|
|
733
|
+
yt,
|
|
734
734
|
(r) => {
|
|
735
735
|
if (it() != null) {
|
|
736
736
|
const n = t.getRootElement();
|
|
@@ -777,16 +777,16 @@ function Fr() {
|
|
|
777
777
|
R
|
|
778
778
|
),
|
|
779
779
|
t.registerRootListener((r, e) => {
|
|
780
|
-
r !== null && (r.addEventListener("click",
|
|
780
|
+
r !== null && (r.addEventListener("click", Tt), r.addEventListener("pointerdown", xt)), e !== null && (e.removeEventListener("click", Tt), e.removeEventListener("pointerdown", xt));
|
|
781
781
|
})
|
|
782
782
|
), [t]), null;
|
|
783
783
|
}
|
|
784
784
|
function Vt(t, r) {
|
|
785
785
|
const e = t.target;
|
|
786
|
-
if (e === null || !
|
|
786
|
+
if (e === null || !_t(e))
|
|
787
787
|
return;
|
|
788
788
|
const n = e.firstChild;
|
|
789
|
-
if (n != null &&
|
|
789
|
+
if (n != null && _t(n) && (n.tagName === "UL" || n.tagName === "OL"))
|
|
790
790
|
return;
|
|
791
791
|
const i = e.parentNode;
|
|
792
792
|
if (!i || i.__lexicalListType !== "check")
|
|
@@ -794,7 +794,7 @@ function Vt(t, r) {
|
|
|
794
794
|
const a = t.pageX, l = e.getBoundingClientRect();
|
|
795
795
|
(e.dir === "rtl" ? a < l.right && a > l.right - 20 : a > l.left && a < l.left + 20) && r();
|
|
796
796
|
}
|
|
797
|
-
function
|
|
797
|
+
function Tt(t) {
|
|
798
798
|
Vt(t, () => {
|
|
799
799
|
const r = t.target, e = Ur(r);
|
|
800
800
|
e != null && e.isEditable() && e.update(() => {
|
|
@@ -805,7 +805,7 @@ function _t(t) {
|
|
|
805
805
|
});
|
|
806
806
|
});
|
|
807
807
|
}
|
|
808
|
-
function
|
|
808
|
+
function xt(t) {
|
|
809
809
|
Vt(t, () => {
|
|
810
810
|
t.preventDefault();
|
|
811
811
|
});
|
|
@@ -836,7 +836,7 @@ function Wr(t, r) {
|
|
|
836
836
|
}
|
|
837
837
|
return null;
|
|
838
838
|
}
|
|
839
|
-
function
|
|
839
|
+
function wt(t, r, e) {
|
|
840
840
|
const n = it();
|
|
841
841
|
return n != null && r.update(() => {
|
|
842
842
|
const i = lt(n);
|
|
@@ -862,8 +862,8 @@ function jr() {
|
|
|
862
862
|
t.registerCommand(
|
|
863
863
|
Zt,
|
|
864
864
|
(r) => {
|
|
865
|
-
const e =
|
|
866
|
-
return me([e]),
|
|
865
|
+
const e = pt(r);
|
|
866
|
+
return me([e]), Lt(e.getParentOrThrow()) && Ze(e, W).selectEnd(), !0;
|
|
867
867
|
},
|
|
868
868
|
fe
|
|
869
869
|
)
|
|
@@ -965,7 +965,7 @@ const Kr = () => /* @__PURE__ */ g(F, { children: [
|
|
|
965
965
|
css: p,
|
|
966
966
|
signUrl: m
|
|
967
967
|
}) => {
|
|
968
|
-
const { hasFocus: S, attributes: E } = ur({ onBlur: c }), h = K(null), v =
|
|
968
|
+
const { hasFocus: S, attributes: E } = ur({ onBlur: c }), h = K(null), v = Dt(
|
|
969
969
|
() => ({ hasFocus: S, editorRef: h, signUrl: m }),
|
|
970
970
|
[S, m]
|
|
971
971
|
);
|
|
@@ -1241,11 +1241,11 @@ const Kr = () => /* @__PURE__ */ g(F, { children: [
|
|
|
1241
1241
|
meta: { width: n.width, height: n.height }
|
|
1242
1242
|
}), r.onOpenChange(!1));
|
|
1243
1243
|
};
|
|
1244
|
-
return /* @__PURE__ */ g(
|
|
1244
|
+
return /* @__PURE__ */ g(Ft, { ...r, children: [
|
|
1245
1245
|
/* @__PURE__ */ o(De, { children: "Sett inn bilde" }),
|
|
1246
1246
|
t.isLoading && /* @__PURE__ */ o(ht, {}),
|
|
1247
1247
|
/* @__PURE__ */ o(
|
|
1248
|
-
|
|
1248
|
+
ut,
|
|
1249
1249
|
{
|
|
1250
1250
|
type: "file",
|
|
1251
1251
|
accept: "image/png, image/jpeg",
|
|
@@ -1278,7 +1278,7 @@ const Kr = () => /* @__PURE__ */ g(F, { children: [
|
|
|
1278
1278
|
/* @__PURE__ */ g(
|
|
1279
1279
|
dt,
|
|
1280
1280
|
{
|
|
1281
|
-
trigger: /* @__PURE__ */ o(
|
|
1281
|
+
trigger: /* @__PURE__ */ o(Bt, { dropdown: !0, children: "Sett inn" }),
|
|
1282
1282
|
side: "bottom",
|
|
1283
1283
|
align: "end",
|
|
1284
1284
|
children: [
|
|
@@ -1311,7 +1311,7 @@ const Dn = () => {
|
|
|
1311
1311
|
y(() => {
|
|
1312
1312
|
!n && r && e(null);
|
|
1313
1313
|
}, [n, r]);
|
|
1314
|
-
const { refs: i, floatingStyles: a } =
|
|
1314
|
+
const { refs: i, floatingStyles: a } = gt({
|
|
1315
1315
|
placement: "top-end",
|
|
1316
1316
|
open: !!r,
|
|
1317
1317
|
elements: {
|
|
@@ -1335,16 +1335,16 @@ const Dn = () => {
|
|
|
1335
1335
|
t.update(() => {
|
|
1336
1336
|
switch (s) {
|
|
1337
1337
|
case "add-row-over":
|
|
1338
|
-
|
|
1338
|
+
Ct(!1);
|
|
1339
1339
|
break;
|
|
1340
1340
|
case "add-row-under":
|
|
1341
|
-
|
|
1341
|
+
Ct(!0);
|
|
1342
1342
|
break;
|
|
1343
1343
|
case "add-column-left":
|
|
1344
|
-
|
|
1344
|
+
vt(!1);
|
|
1345
1345
|
break;
|
|
1346
1346
|
case "add-column-right":
|
|
1347
|
-
|
|
1347
|
+
vt(!0);
|
|
1348
1348
|
break;
|
|
1349
1349
|
case "delete-row":
|
|
1350
1350
|
Se();
|
|
@@ -1373,24 +1373,24 @@ const Dn = () => {
|
|
|
1373
1373
|
children: [
|
|
1374
1374
|
/* @__PURE__ */ o(A, { onClick: l("add-row-over"), children: "Legg til rad over" }),
|
|
1375
1375
|
/* @__PURE__ */ o(A, { onClick: l("add-row-under"), children: "Legg til rad under" }),
|
|
1376
|
-
/* @__PURE__ */ o(
|
|
1376
|
+
/* @__PURE__ */ o(Mt, {}),
|
|
1377
1377
|
/* @__PURE__ */ o(A, { onClick: l("add-column-left"), children: "Legg til kolonne venstre" }),
|
|
1378
1378
|
/* @__PURE__ */ o(A, { onClick: l("add-column-right"), children: "Legg til kolonne høyre" }),
|
|
1379
|
-
/* @__PURE__ */ o(
|
|
1379
|
+
/* @__PURE__ */ o(Mt, {}),
|
|
1380
1380
|
/* @__PURE__ */ o(A, { onClick: l("delete-row"), children: "Fjern rad" }),
|
|
1381
1381
|
/* @__PURE__ */ o(A, { onClick: l("delete-column"), children: "Fjern kolonne" })
|
|
1382
1382
|
]
|
|
1383
1383
|
}
|
|
1384
1384
|
) : null;
|
|
1385
1385
|
};
|
|
1386
|
-
function
|
|
1386
|
+
function mt(t) {
|
|
1387
1387
|
let r = t;
|
|
1388
1388
|
const e = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi, n = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
|
|
1389
1389
|
return r = String(r).trim(), r.match(e) || r.match(n) ? r : "https://";
|
|
1390
1390
|
}
|
|
1391
1391
|
function te(t) {
|
|
1392
1392
|
const r = t.anchor, e = t.focus, n = t.anchor.getNode(), i = t.focus.getNode();
|
|
1393
|
-
return n === i ? n : t.isBackward() ?
|
|
1393
|
+
return n === i ? n : t.isBackward() ? bt(e) ? n : i : bt(r) ? n : i;
|
|
1394
1394
|
}
|
|
1395
1395
|
const Bn = (t) => (O.baseURL = t, O), J = class extends B {
|
|
1396
1396
|
static getType() {
|
|
@@ -1438,10 +1438,10 @@ const Zr = ({ onClose: t }) => {
|
|
|
1438
1438
|
if (L(a) && a.isCollapsed()) {
|
|
1439
1439
|
const l = $(i);
|
|
1440
1440
|
a.insertNodes([l]);
|
|
1441
|
-
const s =
|
|
1441
|
+
const s = Nt();
|
|
1442
1442
|
s.setTextNodeRange(l, 0, l, i.length), Q(s);
|
|
1443
1443
|
}
|
|
1444
|
-
r.dispatchCommand(V,
|
|
1444
|
+
r.dispatchCommand(V, mt(i));
|
|
1445
1445
|
});
|
|
1446
1446
|
},
|
|
1447
1447
|
[r]
|
|
@@ -1449,7 +1449,7 @@ const Zr = ({ onClose: t }) => {
|
|
|
1449
1449
|
return /* @__PURE__ */ g("form", { onSubmit: (i) => {
|
|
1450
1450
|
e(i.currentTarget.url.value), t();
|
|
1451
1451
|
}, children: [
|
|
1452
|
-
/* @__PURE__ */ o(
|
|
1452
|
+
/* @__PURE__ */ o(ut, { name: "url", label: "URL", type: "url", required: !0 }),
|
|
1453
1453
|
/* @__PURE__ */ g(Z, { children: [
|
|
1454
1454
|
/* @__PURE__ */ o(N, { onClick: t, children: "Avbryt" }),
|
|
1455
1455
|
/* @__PURE__ */ o(N, { type: "submit", variant: "primary", children: "Sett inn" })
|
|
@@ -1520,16 +1520,16 @@ const Zr = ({ onClose: t }) => {
|
|
|
1520
1520
|
if (L(s) && s.isCollapsed()) {
|
|
1521
1521
|
const d = $(n.name);
|
|
1522
1522
|
s.insertNodes([d]);
|
|
1523
|
-
const c =
|
|
1523
|
+
const c = Nt();
|
|
1524
1524
|
c.setTextNodeRange(d, 0, d, n.name.length), Q(c);
|
|
1525
1525
|
}
|
|
1526
|
-
e.dispatchCommand(V,
|
|
1526
|
+
e.dispatchCommand(V, mt(n.url));
|
|
1527
1527
|
});
|
|
1528
1528
|
}, [e, n]);
|
|
1529
1529
|
return /* @__PURE__ */ g(F, { children: [
|
|
1530
1530
|
r.isLoading && /* @__PURE__ */ o(ht, {}),
|
|
1531
1531
|
/* @__PURE__ */ o(
|
|
1532
|
-
|
|
1532
|
+
ut,
|
|
1533
1533
|
{
|
|
1534
1534
|
type: "file",
|
|
1535
1535
|
onChange: a,
|
|
@@ -1560,7 +1560,7 @@ const Zr = ({ onClose: t }) => {
|
|
|
1560
1560
|
const [i, a] = f("url"), l = () => {
|
|
1561
1561
|
r(!1);
|
|
1562
1562
|
};
|
|
1563
|
-
return /* @__PURE__ */ g(
|
|
1563
|
+
return /* @__PURE__ */ g(Ft, { open: t, onOpenChange: r, css: { width: "600px" }, children: [
|
|
1564
1564
|
/* @__PURE__ */ g(Be, { css: { marginBottom: "$8" }, children: [
|
|
1565
1565
|
/* @__PURE__ */ o(ot, { active: i === "url", onClick: () => a("url"), children: "URL" }),
|
|
1566
1566
|
e && /* @__PURE__ */ o(
|
|
@@ -1592,7 +1592,7 @@ const Zr = ({ onClose: t }) => {
|
|
|
1592
1592
|
j,
|
|
1593
1593
|
() => (s(), !1),
|
|
1594
1594
|
at
|
|
1595
|
-
), [e, s]), /* @__PURE__ */ g(
|
|
1595
|
+
), [e, s]), /* @__PURE__ */ g(Pt, { type: "single", value: n ? "link" : "", children: [
|
|
1596
1596
|
/* @__PURE__ */ o(
|
|
1597
1597
|
D,
|
|
1598
1598
|
{
|
|
@@ -1621,7 +1621,7 @@ const Zr = ({ onClose: t }) => {
|
|
|
1621
1621
|
a(e.getURL());
|
|
1622
1622
|
}) : a("");
|
|
1623
1623
|
}, [t, e]);
|
|
1624
|
-
const s = !!(e && i && l), { refs: d, floatingStyles: c, context: u } =
|
|
1624
|
+
const s = !!(e && i && l), { refs: d, floatingStyles: c, context: u } = gt({
|
|
1625
1625
|
placement: "top",
|
|
1626
1626
|
strategy: "fixed",
|
|
1627
1627
|
open: s,
|
|
@@ -1640,8 +1640,8 @@ const Zr = ({ onClose: t }) => {
|
|
|
1640
1640
|
const M = te(h), b = M.getParent();
|
|
1641
1641
|
let q = null;
|
|
1642
1642
|
if (Y(b) ? q = b : Y(M) && (q = M), q) {
|
|
1643
|
-
const rt = window.getSelection(),
|
|
1644
|
-
h !== null && rt !== null &&
|
|
1643
|
+
const rt = window.getSelection(), ft = t.getRootElement();
|
|
1644
|
+
h !== null && rt !== null && ft !== null && ft.contains(rt.anchorNode) && t.isEditable() && (r.current = ((v = rt.focusNode) == null ? void 0 : v.parentElement) ?? null);
|
|
1645
1645
|
}
|
|
1646
1646
|
n(q);
|
|
1647
1647
|
}
|
|
@@ -1666,15 +1666,15 @@ const Zr = ({ onClose: t }) => {
|
|
|
1666
1666
|
R
|
|
1667
1667
|
),
|
|
1668
1668
|
t.registerCommand(
|
|
1669
|
-
|
|
1669
|
+
yt,
|
|
1670
1670
|
() => e ? (n(null), !0) : !1,
|
|
1671
1671
|
be
|
|
1672
1672
|
)
|
|
1673
1673
|
), [t, m, e]), !s)
|
|
1674
1674
|
return null;
|
|
1675
|
-
const E =
|
|
1675
|
+
const E = mt(i);
|
|
1676
1676
|
return /* @__PURE__ */ o(qt, { children: /* @__PURE__ */ g(
|
|
1677
|
-
|
|
1677
|
+
Ht,
|
|
1678
1678
|
{
|
|
1679
1679
|
ref: d.setFloating,
|
|
1680
1680
|
css: {
|
|
@@ -1711,7 +1711,7 @@ const Zr = ({ onClose: t }) => {
|
|
|
1711
1711
|
) });
|
|
1712
1712
|
};
|
|
1713
1713
|
export {
|
|
1714
|
-
|
|
1714
|
+
pt as $createImageNode,
|
|
1715
1715
|
ee as $createRutineLinkNode,
|
|
1716
1716
|
In as $isImageNode,
|
|
1717
1717
|
Vr as $isRutineLinkNode,
|