@arkitektbedriftene/fe-lib 2.0.5 → 2.0.6
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/styles.d.ts +12 -13
- package/dist/rich-text.es.js +87 -88
- package/package.json +1 -1
|
@@ -98,23 +98,22 @@ export declare const richTextStyleObj: {
|
|
|
98
98
|
border: string;
|
|
99
99
|
borderRadius: number;
|
|
100
100
|
};
|
|
101
|
-
"&::after": {
|
|
102
|
-
content: string;
|
|
103
|
-
width: number;
|
|
104
|
-
height: number;
|
|
105
|
-
top: number;
|
|
106
|
-
left: number;
|
|
107
|
-
display: string;
|
|
108
|
-
position: string;
|
|
109
|
-
borderLeft: string;
|
|
110
|
-
borderBottom: string;
|
|
111
|
-
transform: string;
|
|
112
|
-
};
|
|
113
101
|
"&[aria-checked=true]": {
|
|
114
102
|
"&::before": {
|
|
115
|
-
backgroundColor: string;
|
|
116
103
|
borderColor: string;
|
|
117
104
|
};
|
|
105
|
+
"&::after": {
|
|
106
|
+
content: string;
|
|
107
|
+
width: number;
|
|
108
|
+
height: number;
|
|
109
|
+
top: number;
|
|
110
|
+
left: number;
|
|
111
|
+
display: string;
|
|
112
|
+
position: string;
|
|
113
|
+
borderLeft: string;
|
|
114
|
+
borderBottom: string;
|
|
115
|
+
transform: string;
|
|
116
|
+
};
|
|
118
117
|
};
|
|
119
118
|
"&:focus": {
|
|
120
119
|
outline: string;
|
package/dist/rich-text.es.js
CHANGED
|
@@ -3,15 +3,15 @@ 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
|
|
6
|
+
import { $getRoot as X, ParagraphNode as ae, $createParagraphNode as W, $createTextNode as z, $setSelection as Q, $getNodeByKey as kt, DecoratorNode as le, $applyNodeReplacement as se, SELECTION_CHANGE_COMMAND as j, $getSelection as L, COMMAND_PRIORITY_CRITICAL as at, $isRangeSelection as w, $isRootOrShadowRoot as wt, 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
7
|
import { trimTextContentFromAnchor as ve, $setBlocksType as nt, $isAtNodeEnd as bt } from "@lexical/selection";
|
|
8
8
|
import { LinkNode as B, AutoLinkNode as St, $isLinkNode as Y, TOGGLE_LINK_COMMAND as V } from "@lexical/link";
|
|
9
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
|
|
11
|
-
import { TableNode as
|
|
10
|
+
import { HeadingNode as Rt, QuoteNode as Ot, $isHeadingNode as Te, $createHeadingNode as xe, $createQuoteNode as Le } from "@lexical/rich-text";
|
|
11
|
+
import { TableNode as zt, TableRowNode as At, TableCellNode as $t, INSERT_TABLE_COMMAND as we, $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
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
|
|
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 ze, ToolbarSeparator as Ae, styled as $e, Spinner as ht, Dialog as Ft, DialogHeader as De, TextInput as ut, DialogActions as Z, DropdownMenuItem as $, 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";
|
|
@@ -68,7 +68,7 @@ const lr = ({
|
|
|
68
68
|
const e = X();
|
|
69
69
|
e.clear();
|
|
70
70
|
const n = W();
|
|
71
|
-
n.append(
|
|
71
|
+
n.append(z("")), e.append(n), Q(null);
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
tag: r
|
|
@@ -80,7 +80,7 @@ const lr = ({
|
|
|
80
80
|
const n = X();
|
|
81
81
|
n.clear();
|
|
82
82
|
const i = W();
|
|
83
|
-
i.append(
|
|
83
|
+
i.append(z(t.trim())), n.append(i), Q(null);
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
tag: e
|
|
@@ -99,7 +99,7 @@ const lr = ({
|
|
|
99
99
|
if (typeof t == "string" && !Jt(t))
|
|
100
100
|
i.update(() => {
|
|
101
101
|
const s = X(), d = W();
|
|
102
|
-
d.append(
|
|
102
|
+
d.append(z(t.trim())), s.append(d);
|
|
103
103
|
});
|
|
104
104
|
else {
|
|
105
105
|
const s = i.parseEditorState(t, () => {
|
|
@@ -258,7 +258,7 @@ function mr(t) {
|
|
|
258
258
|
const r = t, { alt: e, src: n, width: i, height: a } = r;
|
|
259
259
|
return { node: pt({ altText: e, height: a, src: n, width: i }) };
|
|
260
260
|
}
|
|
261
|
-
class
|
|
261
|
+
class A extends le {
|
|
262
262
|
constructor(e, n, i, a, l, s) {
|
|
263
263
|
super(s);
|
|
264
264
|
I(this, "__src");
|
|
@@ -272,7 +272,7 @@ class z extends le {
|
|
|
272
272
|
return "image";
|
|
273
273
|
}
|
|
274
274
|
static clone(e) {
|
|
275
|
-
return new
|
|
275
|
+
return new A(
|
|
276
276
|
e.__src,
|
|
277
277
|
e.__altText,
|
|
278
278
|
e.__width,
|
|
@@ -360,11 +360,11 @@ function pt({
|
|
|
360
360
|
key: a
|
|
361
361
|
}) {
|
|
362
362
|
return se(
|
|
363
|
-
new
|
|
363
|
+
new A(e, t, n, r, i, a)
|
|
364
364
|
);
|
|
365
365
|
}
|
|
366
366
|
function In(t) {
|
|
367
|
-
return t instanceof
|
|
367
|
+
return t instanceof A;
|
|
368
368
|
}
|
|
369
369
|
const Rn = [
|
|
370
370
|
Rt,
|
|
@@ -373,10 +373,10 @@ const Rn = [
|
|
|
373
373
|
Et,
|
|
374
374
|
St,
|
|
375
375
|
B,
|
|
376
|
-
$t,
|
|
377
376
|
zt,
|
|
378
377
|
At,
|
|
379
|
-
|
|
378
|
+
$t,
|
|
379
|
+
A
|
|
380
380
|
], On = [
|
|
381
381
|
Rt,
|
|
382
382
|
Ot,
|
|
@@ -384,10 +384,10 @@ const Rn = [
|
|
|
384
384
|
Et,
|
|
385
385
|
St,
|
|
386
386
|
B,
|
|
387
|
-
$t,
|
|
388
387
|
zt,
|
|
389
388
|
At,
|
|
390
|
-
|
|
389
|
+
$t,
|
|
390
|
+
A,
|
|
391
391
|
G,
|
|
392
392
|
{
|
|
393
393
|
replace: B,
|
|
@@ -424,10 +424,10 @@ function Tr(t) {
|
|
|
424
424
|
function xr(t) {
|
|
425
425
|
return k({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M11 5l6 0" } }, { tag: "path", attr: { d: "M7 19l6 0" } }, { tag: "path", attr: { d: "M14 5l-4 14" } }] })(t);
|
|
426
426
|
}
|
|
427
|
-
function
|
|
427
|
+
function Lr(t) {
|
|
428
428
|
return k({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "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);
|
|
429
429
|
}
|
|
430
|
-
function
|
|
430
|
+
function wr(t) {
|
|
431
431
|
return k({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "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);
|
|
432
432
|
}
|
|
433
433
|
function yr(t) {
|
|
@@ -451,7 +451,7 @@ function Rr(t) {
|
|
|
451
451
|
function Or(t) {
|
|
452
452
|
return k({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 5v5a5 5 0 0 0 10 0v-5" } }, { tag: "path", attr: { d: "M5 19h14" } }] })(t);
|
|
453
453
|
}
|
|
454
|
-
const
|
|
454
|
+
const zr = tr("div", {
|
|
455
455
|
width: "10rem",
|
|
456
456
|
display: "flex"
|
|
457
457
|
}), Qt = {
|
|
@@ -466,7 +466,7 @@ const $r = tr("div", {
|
|
|
466
466
|
paragraph: "Normal",
|
|
467
467
|
quote: "Sitat",
|
|
468
468
|
check: "Avkrysningsliste"
|
|
469
|
-
},
|
|
469
|
+
}, Ar = {
|
|
470
470
|
bullet: /* @__PURE__ */ o(Sr, { size: "1.25rem" }),
|
|
471
471
|
h1: /* @__PURE__ */ o(br, { size: "1.25rem" }),
|
|
472
472
|
h2: /* @__PURE__ */ o(vr, { size: "1.25rem" }),
|
|
@@ -476,12 +476,12 @@ const $r = tr("div", {
|
|
|
476
476
|
h6: /* @__PURE__ */ o(Tr, { size: "1.25rem" }),
|
|
477
477
|
number: /* @__PURE__ */ o(Nr, { size: "1.25rem" }),
|
|
478
478
|
check: /* @__PURE__ */ o(yr, { size: "1.25rem" }),
|
|
479
|
-
paragraph: /* @__PURE__ */ o(
|
|
479
|
+
paragraph: /* @__PURE__ */ o(Lr, { size: "1.25rem" }),
|
|
480
480
|
quote: /* @__PURE__ */ o(Er, { size: "1.25rem" })
|
|
481
481
|
}, x = ({
|
|
482
482
|
blockType: t
|
|
483
483
|
}) => /* @__PURE__ */ g(F, { children: [
|
|
484
|
-
/* @__PURE__ */ o(H, { css: { display: "flex", flex: "0 0 auto" }, children:
|
|
484
|
+
/* @__PURE__ */ o(H, { css: { display: "flex", flex: "0 0 auto" }, children: Ar[t] }),
|
|
485
485
|
/* @__PURE__ */ o(
|
|
486
486
|
H,
|
|
487
487
|
{
|
|
@@ -494,13 +494,13 @@ const $r = tr("div", {
|
|
|
494
494
|
children: Qt[t]
|
|
495
495
|
}
|
|
496
496
|
)
|
|
497
|
-
] }),
|
|
498
|
-
if (!
|
|
497
|
+
] }), $r = (t) => {
|
|
498
|
+
if (!w(t))
|
|
499
499
|
return null;
|
|
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 && wt(i);
|
|
504
504
|
});
|
|
505
505
|
return e === null && (e = r.getTopLevelElementOrThrow()), {
|
|
506
506
|
anchorNode: r,
|
|
@@ -511,7 +511,7 @@ const $r = tr("div", {
|
|
|
511
511
|
y(() => t.registerCommand(
|
|
512
512
|
j,
|
|
513
513
|
() => {
|
|
514
|
-
const c =
|
|
514
|
+
const c = L(), u = $r(c);
|
|
515
515
|
if (!u)
|
|
516
516
|
return !1;
|
|
517
517
|
const { element: p, anchorNode: m } = u, S = p.getKey();
|
|
@@ -532,11 +532,11 @@ const $r = tr("div", {
|
|
|
532
532
|
), [t]);
|
|
533
533
|
const n = (c) => {
|
|
534
534
|
r !== c && t.update(() => {
|
|
535
|
-
const u =
|
|
536
|
-
|
|
535
|
+
const u = L();
|
|
536
|
+
w(u) && (nt(u, () => xe(c)), e(c));
|
|
537
537
|
});
|
|
538
538
|
};
|
|
539
|
-
return /* @__PURE__ */ o(
|
|
539
|
+
return /* @__PURE__ */ o(zr, { children: /* @__PURE__ */ g(
|
|
540
540
|
dt,
|
|
541
541
|
{
|
|
542
542
|
trigger: /* @__PURE__ */ o(
|
|
@@ -552,8 +552,8 @@ const $r = tr("div", {
|
|
|
552
552
|
children: [
|
|
553
553
|
/* @__PURE__ */ o(_, { onClick: () => {
|
|
554
554
|
r !== "paragraph" && t.update(() => {
|
|
555
|
-
const c =
|
|
556
|
-
|
|
555
|
+
const c = L();
|
|
556
|
+
w(c) && (nt(c, () => W()), e("paragraph"));
|
|
557
557
|
});
|
|
558
558
|
}, children: /* @__PURE__ */ o(x, { blockType: "paragraph" }) }),
|
|
559
559
|
/* @__PURE__ */ o(_, { onClick: () => n("h1"), children: /* @__PURE__ */ o(x, { blockType: "h1" }) }),
|
|
@@ -573,8 +573,8 @@ const $r = tr("div", {
|
|
|
573
573
|
}, children: /* @__PURE__ */ o(x, { blockType: "check" }) }),
|
|
574
574
|
/* @__PURE__ */ o(_, { onClick: () => {
|
|
575
575
|
r !== "quote" && t.update(() => {
|
|
576
|
-
const c =
|
|
577
|
-
|
|
576
|
+
const c = L();
|
|
577
|
+
w(c) && (nt(c, () => Le()), e("quote"));
|
|
578
578
|
});
|
|
579
579
|
}, children: /* @__PURE__ */ o(x, { blockType: "quote" }) })
|
|
580
580
|
]
|
|
@@ -582,8 +582,8 @@ const $r = tr("div", {
|
|
|
582
582
|
) });
|
|
583
583
|
}, Br = () => {
|
|
584
584
|
const [t] = T(), [r, e] = f(!1), [n, i] = f(!1), [a, l] = f(!1), [s, d] = f(!1), [c, u] = f(!1), p = C(() => {
|
|
585
|
-
const b =
|
|
586
|
-
|
|
585
|
+
const b = L();
|
|
586
|
+
w(b) && (e(b.hasFormat("bold")), i(b.hasFormat("italic")), l(b.hasFormat("underline")), d(b.hasFormat("code")), u(b.hasFormat("superscript")));
|
|
587
587
|
}, []);
|
|
588
588
|
y(() => tt(
|
|
589
589
|
t.registerCommand(
|
|
@@ -705,9 +705,9 @@ const $r = tr("div", {
|
|
|
705
705
|
}, Hr = ({
|
|
706
706
|
children: t,
|
|
707
707
|
...r
|
|
708
|
-
}) => /* @__PURE__ */ g(
|
|
708
|
+
}) => /* @__PURE__ */ g(ze, { "aria-label": "Formattering", ...r, children: [
|
|
709
709
|
/* @__PURE__ */ o(Dr, {}),
|
|
710
|
-
/* @__PURE__ */ o(
|
|
710
|
+
/* @__PURE__ */ o(Ae, {}),
|
|
711
711
|
/* @__PURE__ */ o(Br, {}),
|
|
712
712
|
t
|
|
713
713
|
] });
|
|
@@ -721,12 +721,12 @@ function Fr() {
|
|
|
721
721
|
),
|
|
722
722
|
t.registerCommand(
|
|
723
723
|
ce,
|
|
724
|
-
(r) =>
|
|
724
|
+
(r) => Lt(r, t, !1),
|
|
725
725
|
R
|
|
726
726
|
),
|
|
727
727
|
t.registerCommand(
|
|
728
728
|
de,
|
|
729
|
-
(r) =>
|
|
729
|
+
(r) => Lt(r, t, !0),
|
|
730
730
|
R
|
|
731
731
|
),
|
|
732
732
|
t.registerCommand(
|
|
@@ -754,8 +754,8 @@ function Fr() {
|
|
|
754
754
|
t.registerCommand(
|
|
755
755
|
ue,
|
|
756
756
|
(r) => t.getEditorState().read(() => {
|
|
757
|
-
const e =
|
|
758
|
-
if (
|
|
757
|
+
const e = L();
|
|
758
|
+
if (w(e) && e.isCollapsed()) {
|
|
759
759
|
const { anchor: n } = e, i = n.type === "element";
|
|
760
760
|
if (i || n.offset === 0) {
|
|
761
761
|
const a = n.getNode(), l = Yt(
|
|
@@ -836,7 +836,7 @@ function Wr(t, r) {
|
|
|
836
836
|
}
|
|
837
837
|
return null;
|
|
838
838
|
}
|
|
839
|
-
function
|
|
839
|
+
function Lt(t, r, e) {
|
|
840
840
|
const n = it();
|
|
841
841
|
return n != null && r.update(() => {
|
|
842
842
|
const i = lt(n);
|
|
@@ -856,14 +856,14 @@ const Zt = pe("INSERT_IMAGE_COMMAND");
|
|
|
856
856
|
function jr() {
|
|
857
857
|
const [t] = ar();
|
|
858
858
|
return y(() => {
|
|
859
|
-
if (!t.hasNodes([
|
|
859
|
+
if (!t.hasNodes([A]))
|
|
860
860
|
throw new Error("ImagePlugin: ImageNode not registered on editor");
|
|
861
861
|
return tt(
|
|
862
862
|
t.registerCommand(
|
|
863
863
|
Zt,
|
|
864
864
|
(r) => {
|
|
865
865
|
const e = pt(r);
|
|
866
|
-
return me([e]),
|
|
866
|
+
return me([e]), wt(e.getParentOrThrow()) && Ze(e, W).selectEnd(), !0;
|
|
867
867
|
},
|
|
868
868
|
fe
|
|
869
869
|
)
|
|
@@ -899,7 +899,7 @@ const Kr = () => /* @__PURE__ */ g(F, { children: [
|
|
|
899
899
|
}
|
|
900
900
|
}));
|
|
901
901
|
}, []), null;
|
|
902
|
-
}, Yr =
|
|
902
|
+
}, Yr = $e("div", {
|
|
903
903
|
border: "1px solid $borderDarker",
|
|
904
904
|
borderRadius: "$md",
|
|
905
905
|
position: "relative",
|
|
@@ -950,7 +950,7 @@ const Kr = () => /* @__PURE__ */ g(F, { children: [
|
|
|
950
950
|
},
|
|
951
951
|
children: /* @__PURE__ */ o(ht, {})
|
|
952
952
|
}
|
|
953
|
-
),
|
|
953
|
+
), zn = ({
|
|
954
954
|
isLoading: t,
|
|
955
955
|
children: r,
|
|
956
956
|
placeholderText: e,
|
|
@@ -1125,22 +1125,21 @@ const Kr = () => /* @__PURE__ */ g(F, { children: [
|
|
|
1125
1125
|
border: "1px solid $gray500",
|
|
1126
1126
|
borderRadius: 2
|
|
1127
1127
|
},
|
|
1128
|
-
"&::after": {
|
|
1129
|
-
content: "",
|
|
1130
|
-
width: 8,
|
|
1131
|
-
height: 4,
|
|
1132
|
-
top: 6,
|
|
1133
|
-
left: 4,
|
|
1134
|
-
display: "block",
|
|
1135
|
-
position: "absolute",
|
|
1136
|
-
borderLeft: "2px solid white",
|
|
1137
|
-
borderBottom: "2px solid white",
|
|
1138
|
-
transform: "rotate(-45deg)"
|
|
1139
|
-
},
|
|
1140
1128
|
"&[aria-checked=true]": {
|
|
1141
1129
|
"&::before": {
|
|
1142
|
-
|
|
1143
|
-
|
|
1130
|
+
borderColor: "black"
|
|
1131
|
+
},
|
|
1132
|
+
"&::after": {
|
|
1133
|
+
content: "",
|
|
1134
|
+
width: 8,
|
|
1135
|
+
height: 4,
|
|
1136
|
+
top: 6,
|
|
1137
|
+
left: 4,
|
|
1138
|
+
display: "block",
|
|
1139
|
+
position: "absolute",
|
|
1140
|
+
borderLeft: "2px solid black",
|
|
1141
|
+
borderBottom: "2px solid black",
|
|
1142
|
+
transform: "rotate(-45deg)"
|
|
1144
1143
|
}
|
|
1145
1144
|
},
|
|
1146
1145
|
"&:focus": {
|
|
@@ -1220,7 +1219,7 @@ const Kr = () => /* @__PURE__ */ g(F, { children: [
|
|
|
1220
1219
|
defaultVariants: {
|
|
1221
1220
|
size: "md"
|
|
1222
1221
|
}
|
|
1223
|
-
},
|
|
1222
|
+
}, An = er(Jr), Xr = ({
|
|
1224
1223
|
uploadFile: t,
|
|
1225
1224
|
...r
|
|
1226
1225
|
}) => {
|
|
@@ -1266,9 +1265,9 @@ const Kr = () => /* @__PURE__ */ g(F, { children: [
|
|
|
1266
1265
|
)
|
|
1267
1266
|
] })
|
|
1268
1267
|
] });
|
|
1269
|
-
},
|
|
1268
|
+
}, $n = ({ uploadFile: t }) => {
|
|
1270
1269
|
const [r] = T(), [e, n] = f(!1), i = C(() => {
|
|
1271
|
-
r.dispatchCommand(
|
|
1270
|
+
r.dispatchCommand(we, {
|
|
1272
1271
|
rows: "3",
|
|
1273
1272
|
columns: "3",
|
|
1274
1273
|
includeHeaders: !1
|
|
@@ -1322,8 +1321,8 @@ const Dn = () => {
|
|
|
1322
1321
|
y(() => t.registerCommand(
|
|
1323
1322
|
j,
|
|
1324
1323
|
() => {
|
|
1325
|
-
const s =
|
|
1326
|
-
if (
|
|
1324
|
+
const s = L();
|
|
1325
|
+
if (w(s)) {
|
|
1327
1326
|
const d = s.anchor.getNode(), c = ye(d);
|
|
1328
1327
|
e(c ? t.getElementByKey(c.getKey()) : null);
|
|
1329
1328
|
}
|
|
@@ -1371,14 +1370,14 @@ const Dn = () => {
|
|
|
1371
1370
|
}
|
|
1372
1371
|
),
|
|
1373
1372
|
children: [
|
|
1374
|
-
/* @__PURE__ */ o(
|
|
1375
|
-
/* @__PURE__ */ o(
|
|
1373
|
+
/* @__PURE__ */ o($, { onClick: l("add-row-over"), children: "Legg til rad over" }),
|
|
1374
|
+
/* @__PURE__ */ o($, { onClick: l("add-row-under"), children: "Legg til rad under" }),
|
|
1376
1375
|
/* @__PURE__ */ o(Mt, {}),
|
|
1377
|
-
/* @__PURE__ */ o(
|
|
1378
|
-
/* @__PURE__ */ o(
|
|
1376
|
+
/* @__PURE__ */ o($, { onClick: l("add-column-left"), children: "Legg til kolonne venstre" }),
|
|
1377
|
+
/* @__PURE__ */ o($, { onClick: l("add-column-right"), children: "Legg til kolonne høyre" }),
|
|
1379
1378
|
/* @__PURE__ */ o(Mt, {}),
|
|
1380
|
-
/* @__PURE__ */ o(
|
|
1381
|
-
/* @__PURE__ */ o(
|
|
1379
|
+
/* @__PURE__ */ o($, { onClick: l("delete-row"), children: "Fjern rad" }),
|
|
1380
|
+
/* @__PURE__ */ o($, { onClick: l("delete-column"), children: "Fjern kolonne" })
|
|
1382
1381
|
]
|
|
1383
1382
|
}
|
|
1384
1383
|
) : null;
|
|
@@ -1434,9 +1433,9 @@ const Zr = ({ onClose: t }) => {
|
|
|
1434
1433
|
const [r] = T(), e = C(
|
|
1435
1434
|
(i) => {
|
|
1436
1435
|
r.update(() => {
|
|
1437
|
-
const a =
|
|
1438
|
-
if (
|
|
1439
|
-
const l =
|
|
1436
|
+
const a = L();
|
|
1437
|
+
if (w(a) && a.isCollapsed()) {
|
|
1438
|
+
const l = z(i);
|
|
1440
1439
|
a.insertNodes([l]);
|
|
1441
1440
|
const s = Nt();
|
|
1442
1441
|
s.setTextNodeRange(l, 0, l, i.length), Q(s);
|
|
@@ -1462,12 +1461,12 @@ const Zr = ({ onClose: t }) => {
|
|
|
1462
1461
|
const [e] = T(), [n, i] = f([]), a = r(), l = C(
|
|
1463
1462
|
(s) => {
|
|
1464
1463
|
e.update(() => {
|
|
1465
|
-
const d =
|
|
1466
|
-
if (
|
|
1464
|
+
const d = L();
|
|
1465
|
+
if (w(d)) {
|
|
1467
1466
|
const c = [];
|
|
1468
1467
|
for (const [u, p] of s.entries()) {
|
|
1469
1468
|
const m = ee(p.value);
|
|
1470
|
-
m.append(
|
|
1469
|
+
m.append(z(p.label)), c.push(m), u !== s.length - 1 && c.push(z(" "));
|
|
1471
1470
|
}
|
|
1472
1471
|
d.insertNodes(c);
|
|
1473
1472
|
}
|
|
@@ -1516,9 +1515,9 @@ const Zr = ({ onClose: t }) => {
|
|
|
1516
1515
|
e.update(() => {
|
|
1517
1516
|
if (!n)
|
|
1518
1517
|
return;
|
|
1519
|
-
const s =
|
|
1520
|
-
if (
|
|
1521
|
-
const d =
|
|
1518
|
+
const s = L();
|
|
1519
|
+
if (w(s) && s.isCollapsed()) {
|
|
1520
|
+
const d = z(n.name);
|
|
1522
1521
|
s.insertNodes([d]);
|
|
1523
1522
|
const c = Nt();
|
|
1524
1523
|
c.setTextNodeRange(d, 0, d, n.name.length), Q(c);
|
|
@@ -1582,8 +1581,8 @@ const Zr = ({ onClose: t }) => {
|
|
|
1582
1581
|
uploadFile: r
|
|
1583
1582
|
}) => {
|
|
1584
1583
|
const [e] = T(), [n, i] = f(!1), [a, l] = f(!1), s = C(() => {
|
|
1585
|
-
const d =
|
|
1586
|
-
if (
|
|
1584
|
+
const d = L();
|
|
1585
|
+
if (w(d)) {
|
|
1587
1586
|
const c = te(d), u = c.getParent();
|
|
1588
1587
|
i(Y(u) || Y(c));
|
|
1589
1588
|
}
|
|
@@ -1601,7 +1600,7 @@ const Zr = ({ onClose: t }) => {
|
|
|
1601
1600
|
},
|
|
1602
1601
|
title: "Lenke",
|
|
1603
1602
|
value: "link",
|
|
1604
|
-
children: /* @__PURE__ */ o(
|
|
1603
|
+
children: /* @__PURE__ */ o(wr, { size: "1.25rem" })
|
|
1605
1604
|
}
|
|
1606
1605
|
),
|
|
1607
1606
|
/* @__PURE__ */ o(
|
|
@@ -1635,8 +1634,8 @@ const Zr = ({ onClose: t }) => {
|
|
|
1635
1634
|
Qe(u)
|
|
1636
1635
|
]), m = C(() => {
|
|
1637
1636
|
var v;
|
|
1638
|
-
const h =
|
|
1639
|
-
if (
|
|
1637
|
+
const h = L();
|
|
1638
|
+
if (w(h)) {
|
|
1640
1639
|
const M = te(h), b = M.getParent();
|
|
1641
1640
|
let q = null;
|
|
1642
1641
|
if (Y(b) ? q = b : Y(M) && (q = M), q) {
|
|
@@ -1716,12 +1715,12 @@ export {
|
|
|
1716
1715
|
In as $isImageNode,
|
|
1717
1716
|
Vr as $isRutineLinkNode,
|
|
1718
1717
|
Pr as FloatingToolbar,
|
|
1719
|
-
|
|
1720
|
-
|
|
1718
|
+
A as ImageNode,
|
|
1719
|
+
$n as InsertSelector,
|
|
1721
1720
|
Hn as LinkEditPlugin,
|
|
1722
1721
|
G as LinkTargetNode,
|
|
1723
1722
|
Pn as LinkToolbarButton,
|
|
1724
|
-
|
|
1723
|
+
zn as RichTextEditor,
|
|
1725
1724
|
Hr as RichTextToolbar,
|
|
1726
1725
|
O as RutineLinkNode,
|
|
1727
1726
|
Bn as RutineLinkNodeInit,
|
|
@@ -1732,7 +1731,7 @@ export {
|
|
|
1732
1731
|
cr as isEditorState,
|
|
1733
1732
|
Jt as isJSON,
|
|
1734
1733
|
Xt as richTextContext,
|
|
1735
|
-
|
|
1734
|
+
An as richTextCss,
|
|
1736
1735
|
Jr as richTextStyleObj,
|
|
1737
1736
|
hr as setStateFromPlainText,
|
|
1738
1737
|
En as stateToHTML,
|