@arkitektbedriftene/fe-lib 5.1.1 → 5.1.2
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 +6 -0
- package/dist/rich-text.es.js +48 -42
- package/package.json +1 -1
|
@@ -66,6 +66,12 @@ export declare const richTextStyleObj: {
|
|
|
66
66
|
};
|
|
67
67
|
ol: {
|
|
68
68
|
listStyleType: string;
|
|
69
|
+
"&[type='a']": {
|
|
70
|
+
listStyleType: string;
|
|
71
|
+
};
|
|
72
|
+
"&[type='i']": {
|
|
73
|
+
listStyleType: string;
|
|
74
|
+
};
|
|
69
75
|
};
|
|
70
76
|
".ain-rich-text-nested-list-item": {
|
|
71
77
|
listStyleType: string;
|
package/dist/rich-text.es.js
CHANGED
|
@@ -3,8 +3,8 @@ var Me = (t, r, e) => r in t ? Ce(t, r, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var $ = (t, r, e) => Me(t, typeof r != "symbol" ? r + "" : r, e);
|
|
4
4
|
import { createHeadlessEditor as Bt } from "@lexical/headless";
|
|
5
5
|
import { $generateHtmlFromNodes as Pt } from "@lexical/html";
|
|
6
|
-
import { $getRoot as V, ParagraphNode as Te, $createParagraphNode as G, $createTextNode as z, $setSelection as nt, $getNodeByKey as dt, DecoratorNode as xe, $applyNodeReplacement as Le, SELECTION_CHANGE_COMMAND as Q, $getSelection as
|
|
7
|
-
import { trimTextContentFromAnchor as Oe, $setBlocksType as ut, $getSelectionStyleValueForProperty as ze, $patchStyleText as $e, $isAtNodeEnd as
|
|
6
|
+
import { $getRoot as V, ParagraphNode as Te, $createParagraphNode as G, $createTextNode as z, $setSelection as nt, $getNodeByKey as dt, DecoratorNode as xe, $applyNodeReplacement as Le, SELECTION_CHANGE_COMMAND as Q, $getSelection as _, COMMAND_PRIORITY_EDITOR as q, $isRangeSelection as R, $isRootOrShadowRoot as Ht, FORMAT_TEXT_COMMAND as A, COMMAND_PRIORITY_LOW as D, KEY_ARROW_DOWN_COMMAND as we, KEY_ARROW_UP_COMMAND as ye, KEY_ESCAPE_COMMAND as Ft, KEY_SPACE_COMMAND as _e, $getNearestNodeFromDOMNode as mt, KEY_ARROW_LEFT_COMMAND as Se, $isElementNode as Ne, createCommand as Ee, $insertNodes as Re, $createRangeSelection as Ut, COMMAND_PRIORITY_HIGH as Ie, FORMAT_ELEMENT_COMMAND as ht } from "lexical";
|
|
7
|
+
import { trimTextContentFromAnchor as Oe, $setBlocksType as ut, $getSelectionStyleValueForProperty as ze, $patchStyleText as $e, $isAtNodeEnd as _t } from "@lexical/selection";
|
|
8
8
|
import { $dfs as Ae, $getNearestNodeOfType as De, $findMatchingParent as Wt, mergeRegister as ot, isHTMLElement as St, $wrapNodeInElement as Be, mediaFileReader as Pe, isMimeType as He } from "@lexical/utils";
|
|
9
9
|
import { LinkNode as W, AutoLinkNode as jt, $isLinkNode as tt, TOGGLE_LINK_COMMAND as it } from "@lexical/link";
|
|
10
10
|
import { ListNode as ft, ListItemNode as Kt, $isListNode as kt, INSERT_UNORDERED_LIST_COMMAND as Fe, INSERT_ORDERED_LIST_COMMAND as Ue, INSERT_CHECK_LIST_COMMAND as Gt, insertList as We, $isListItemNode as j } from "@lexical/list";
|
|
@@ -22,8 +22,8 @@ import { LexicalErrorBoundary as kr } from "@lexical/react/LexicalErrorBoundary.
|
|
|
22
22
|
import { useFloating as vt, autoUpdate as oe, size as br, flip as vr, offset as ie, shift as Cr, useInteractions as ae, useRole as le, FloatingPortal as se, inline as Mr, useDismiss as Tr } from "@floating-ui/react";
|
|
23
23
|
import { s as xr, c as Lr } from "./stitches.config-CEYOm13b.js";
|
|
24
24
|
import { ListPlugin as wr } from "@lexical/react/LexicalListPlugin.js";
|
|
25
|
-
import { HistoryPlugin as
|
|
26
|
-
import { TablePlugin as
|
|
25
|
+
import { HistoryPlugin as yr } from "@lexical/react/LexicalHistoryPlugin.js";
|
|
26
|
+
import { TablePlugin as _r } from "@lexical/react/LexicalTablePlugin.js";
|
|
27
27
|
import { HorizontalRulePlugin as Sr } from "@lexical/react/LexicalHorizontalRulePlugin.js";
|
|
28
28
|
import { TabIndentationPlugin as Nr } from "@lexical/react/LexicalTabIndentationPlugin.js";
|
|
29
29
|
import { useLexicalComposerContext as Ct } from "@lexical/react/LexicalComposerContext";
|
|
@@ -225,7 +225,7 @@ function $r({
|
|
|
225
225
|
const m = dt(i);
|
|
226
226
|
m && m.remove();
|
|
227
227
|
});
|
|
228
|
-
},
|
|
228
|
+
}, y = () => {
|
|
229
229
|
g.update(() => {
|
|
230
230
|
var N;
|
|
231
231
|
const m = dt(i);
|
|
@@ -277,7 +277,7 @@ function $r({
|
|
|
277
277
|
icon: !0,
|
|
278
278
|
size: "sm",
|
|
279
279
|
css: { width: "20px", height: "20px" },
|
|
280
|
-
onClick:
|
|
280
|
+
onClick: y,
|
|
281
281
|
children: /* @__PURE__ */ n(sr, {})
|
|
282
282
|
}
|
|
283
283
|
),
|
|
@@ -587,7 +587,7 @@ const ln = xr("div", {
|
|
|
587
587
|
L(() => t.registerCommand(
|
|
588
588
|
Q,
|
|
589
589
|
() => {
|
|
590
|
-
const c =
|
|
590
|
+
const c = _(), u = cn(c);
|
|
591
591
|
if (!u)
|
|
592
592
|
return !1;
|
|
593
593
|
const { element: g, anchorNode: v } = u, x = g.getKey();
|
|
@@ -608,7 +608,7 @@ const ln = xr("div", {
|
|
|
608
608
|
), [t]);
|
|
609
609
|
const o = (c) => {
|
|
610
610
|
r !== c && t.update(() => {
|
|
611
|
-
const u =
|
|
611
|
+
const u = _();
|
|
612
612
|
R(u) && (ut(u, () => Ke(c)), e(c));
|
|
613
613
|
});
|
|
614
614
|
};
|
|
@@ -628,7 +628,7 @@ const ln = xr("div", {
|
|
|
628
628
|
children: [
|
|
629
629
|
/* @__PURE__ */ n(T, { onClick: () => {
|
|
630
630
|
r !== "paragraph" && t.update(() => {
|
|
631
|
-
const c =
|
|
631
|
+
const c = _();
|
|
632
632
|
R(c) && (ut(c, () => G()), e("paragraph"));
|
|
633
633
|
});
|
|
634
634
|
}, children: /* @__PURE__ */ n(E, { blockType: "paragraph" }) }),
|
|
@@ -649,7 +649,7 @@ const ln = xr("div", {
|
|
|
649
649
|
}, children: /* @__PURE__ */ n(E, { blockType: "check" }) }),
|
|
650
650
|
/* @__PURE__ */ n(T, { onClick: () => {
|
|
651
651
|
r !== "quote" && t.update(() => {
|
|
652
|
-
const c =
|
|
652
|
+
const c = _();
|
|
653
653
|
R(c) && (ut(c, () => Ge()), e("quote"));
|
|
654
654
|
});
|
|
655
655
|
}, children: /* @__PURE__ */ n(E, { blockType: "quote" }) })
|
|
@@ -657,9 +657,9 @@ const ln = xr("div", {
|
|
|
657
657
|
}
|
|
658
658
|
) });
|
|
659
659
|
}, hn = () => {
|
|
660
|
-
const [t] = w(), [r, e] = p(!1), [o, i] = p(!1), [a, l] = p(!1), [s, d] = p(!1), [c, u] = p(!1), [g, v] = p(!1), [x,
|
|
661
|
-
const b =
|
|
662
|
-
R(b) && (e(b.hasFormat("bold")), i(b.hasFormat("italic")), l(b.hasFormat("underline")), d(b.hasFormat("strikethrough")), u(b.hasFormat("code")), v(b.hasFormat("superscript")),
|
|
660
|
+
const [t] = w(), [r, e] = p(!1), [o, i] = p(!1), [a, l] = p(!1), [s, d] = p(!1), [c, u] = p(!1), [g, v] = p(!1), [x, y] = p(!1), [k, m] = p(""), [C, N] = p(!1), I = M(() => {
|
|
661
|
+
const b = _();
|
|
662
|
+
R(b) && (e(b.hasFormat("bold")), i(b.hasFormat("italic")), l(b.hasFormat("underline")), d(b.hasFormat("strikethrough")), u(b.hasFormat("code")), v(b.hasFormat("superscript")), y(b.hasFormat("subscript")), m(ze(b, "color", "")));
|
|
663
663
|
}, []);
|
|
664
664
|
L(() => ot(
|
|
665
665
|
t.registerCommand(
|
|
@@ -694,7 +694,7 @@ const ln = xr("div", {
|
|
|
694
694
|
), ve = M(
|
|
695
695
|
() => t.dispatchCommand(A, "subscript"),
|
|
696
696
|
[t]
|
|
697
|
-
),
|
|
697
|
+
), yt = Qt(() => {
|
|
698
698
|
const b = [];
|
|
699
699
|
return r && b.push("bold"), o && b.push("italic"), a && b.push("underline"), s && b.push("strikethrough"), c && b.push("code"), g && b.push("superscript"), x && b.push("subscript"), k && b.push("color"), b;
|
|
700
700
|
}, [
|
|
@@ -713,7 +713,7 @@ const ln = xr("div", {
|
|
|
713
713
|
{
|
|
714
714
|
type: "multiple",
|
|
715
715
|
"aria-label": "Tekstformattering",
|
|
716
|
-
value:
|
|
716
|
+
value: yt,
|
|
717
717
|
children: [
|
|
718
718
|
/* @__PURE__ */ n(O, { onClick: Y, title: "Fet tekst", value: "bold", children: /* @__PURE__ */ n(Pr, { size: "1.25rem" }) }),
|
|
719
719
|
/* @__PURE__ */ n(
|
|
@@ -744,7 +744,7 @@ const ln = xr("div", {
|
|
|
744
744
|
{
|
|
745
745
|
type: "multiple",
|
|
746
746
|
"aria-label": "Tekstformattering",
|
|
747
|
-
value:
|
|
747
|
+
value: yt,
|
|
748
748
|
css: { margin: "$1" },
|
|
749
749
|
children: [
|
|
750
750
|
/* @__PURE__ */ n(
|
|
@@ -790,7 +790,7 @@ const ln = xr("div", {
|
|
|
790
790
|
], gn = ({ activeColor: t }) => {
|
|
791
791
|
const [r] = w(), [e, o] = p(!1), i = (a) => {
|
|
792
792
|
r.update(() => {
|
|
793
|
-
const l =
|
|
793
|
+
const l = _();
|
|
794
794
|
l && $e(l, { color: a });
|
|
795
795
|
});
|
|
796
796
|
};
|
|
@@ -905,7 +905,7 @@ function fn() {
|
|
|
905
905
|
D
|
|
906
906
|
),
|
|
907
907
|
t.registerCommand(
|
|
908
|
-
|
|
908
|
+
ye,
|
|
909
909
|
(r) => At(r, t, !0),
|
|
910
910
|
D
|
|
911
911
|
),
|
|
@@ -921,7 +921,7 @@ function fn() {
|
|
|
921
921
|
D
|
|
922
922
|
),
|
|
923
923
|
t.registerCommand(
|
|
924
|
-
|
|
924
|
+
_e,
|
|
925
925
|
(r) => {
|
|
926
926
|
const e = pt();
|
|
927
927
|
return e != null && t.isEditable() ? (t.update(() => {
|
|
@@ -934,7 +934,7 @@ function fn() {
|
|
|
934
934
|
t.registerCommand(
|
|
935
935
|
Se,
|
|
936
936
|
(r) => t.getEditorState().read(() => {
|
|
937
|
-
const e =
|
|
937
|
+
const e = _();
|
|
938
938
|
if (R(e) && e.isCollapsed()) {
|
|
939
939
|
const { anchor: o } = e, i = o.type === "element";
|
|
940
940
|
if (i || o.offset === 0) {
|
|
@@ -1052,8 +1052,8 @@ function vn() {
|
|
|
1052
1052
|
}
|
|
1053
1053
|
const Cn = () => /* @__PURE__ */ h(P, { children: [
|
|
1054
1054
|
/* @__PURE__ */ n(wr, {}),
|
|
1055
|
-
/* @__PURE__ */ n(yr, {}),
|
|
1056
1055
|
/* @__PURE__ */ n(_r, {}),
|
|
1056
|
+
/* @__PURE__ */ n(yr, {}),
|
|
1057
1057
|
/* @__PURE__ */ n(fn, {}),
|
|
1058
1058
|
/* @__PURE__ */ n(Nr, {}),
|
|
1059
1059
|
/* @__PURE__ */ n(vn, {}),
|
|
@@ -1146,7 +1146,7 @@ const Cn = () => /* @__PURE__ */ h(P, { children: [
|
|
|
1146
1146
|
css: g,
|
|
1147
1147
|
signUrl: v,
|
|
1148
1148
|
fileUpload: x,
|
|
1149
|
-
editable:
|
|
1149
|
+
editable: y = !0
|
|
1150
1150
|
}) => {
|
|
1151
1151
|
const { hasFocus: k, attributes: m } = zr({ onBlur: c }), C = J(null), N = Qt(
|
|
1152
1152
|
() => ({ hasFocus: k, editorRef: C, signUrl: v, fileUpload: x }),
|
|
@@ -1162,7 +1162,7 @@ const Cn = () => /* @__PURE__ */ h(P, { children: [
|
|
|
1162
1162
|
},
|
|
1163
1163
|
theme: Mt,
|
|
1164
1164
|
nodes: o,
|
|
1165
|
-
editable:
|
|
1165
|
+
editable: y
|
|
1166
1166
|
},
|
|
1167
1167
|
children: [
|
|
1168
1168
|
/* @__PURE__ */ h(
|
|
@@ -1199,7 +1199,7 @@ const Cn = () => /* @__PURE__ */ h(P, { children: [
|
|
|
1199
1199
|
/* @__PURE__ */ n(Cn, {}),
|
|
1200
1200
|
i,
|
|
1201
1201
|
/* @__PURE__ */ n(xn, { isLoading: t }),
|
|
1202
|
-
|
|
1202
|
+
y && !a && /* @__PURE__ */ n(pn, { children: l })
|
|
1203
1203
|
]
|
|
1204
1204
|
}
|
|
1205
1205
|
),
|
|
@@ -1275,7 +1275,13 @@ const Cn = () => /* @__PURE__ */ h(P, { children: [
|
|
|
1275
1275
|
listStyleType: "square"
|
|
1276
1276
|
},
|
|
1277
1277
|
ol: {
|
|
1278
|
-
listStyleType: "decimal"
|
|
1278
|
+
listStyleType: "decimal",
|
|
1279
|
+
"&[type='a']": {
|
|
1280
|
+
listStyleType: "lower-alpha"
|
|
1281
|
+
},
|
|
1282
|
+
"&[type='i']": {
|
|
1283
|
+
listStyleType: "lower-roman"
|
|
1284
|
+
}
|
|
1279
1285
|
},
|
|
1280
1286
|
".ain-rich-text-nested-list-item": {
|
|
1281
1287
|
listStyleType: "none"
|
|
@@ -1496,7 +1502,7 @@ const Cn = () => /* @__PURE__ */ h(P, { children: [
|
|
|
1496
1502
|
)
|
|
1497
1503
|
] });
|
|
1498
1504
|
};
|
|
1499
|
-
function
|
|
1505
|
+
function yn(t) {
|
|
1500
1506
|
return f({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "circle", attr: { cx: "256", cy: "256", r: "48" } }, { tag: "circle", attr: { cx: "416", cy: "256", r: "48" } }, { tag: "circle", attr: { cx: "96", cy: "256", r: "48" } }] })(t);
|
|
1501
1507
|
}
|
|
1502
1508
|
const mo = () => {
|
|
@@ -1515,7 +1521,7 @@ const mo = () => {
|
|
|
1515
1521
|
L(() => t.registerCommand(
|
|
1516
1522
|
Q,
|
|
1517
1523
|
() => {
|
|
1518
|
-
const s =
|
|
1524
|
+
const s = _();
|
|
1519
1525
|
if (R(s)) {
|
|
1520
1526
|
const d = s.anchor.getNode(), c = Ye(d);
|
|
1521
1527
|
e(c ? t.getElementByKey(c.getKey()) : null);
|
|
@@ -1560,7 +1566,7 @@ const mo = () => {
|
|
|
1560
1566
|
ref: i.setFloating,
|
|
1561
1567
|
style: a,
|
|
1562
1568
|
css: { padding: "2px", width: "18px", height: "18px" },
|
|
1563
|
-
children: /* @__PURE__ */ n(
|
|
1569
|
+
children: /* @__PURE__ */ n(yn, {})
|
|
1564
1570
|
}
|
|
1565
1571
|
),
|
|
1566
1572
|
children: [
|
|
@@ -1583,7 +1589,7 @@ function wt(t) {
|
|
|
1583
1589
|
}
|
|
1584
1590
|
function ge(t) {
|
|
1585
1591
|
const r = t.anchor, e = t.focus, o = t.anchor.getNode(), i = t.focus.getNode();
|
|
1586
|
-
return o === i ? o : t.isBackward() ?
|
|
1592
|
+
return o === i ? o : t.isBackward() ? _t(e) ? o : i : _t(r) ? o : i;
|
|
1587
1593
|
}
|
|
1588
1594
|
const fo = (t) => (K.baseURL = t, K), X = class X extends W {
|
|
1589
1595
|
static getType() {
|
|
@@ -1620,14 +1626,14 @@ let K = X;
|
|
|
1620
1626
|
function pe(t) {
|
|
1621
1627
|
return new K(t);
|
|
1622
1628
|
}
|
|
1623
|
-
function
|
|
1629
|
+
function _n(t) {
|
|
1624
1630
|
return t instanceof K;
|
|
1625
1631
|
}
|
|
1626
1632
|
const Sn = ({ onClose: t }) => {
|
|
1627
1633
|
const [r] = w(), e = M(
|
|
1628
1634
|
(i) => {
|
|
1629
1635
|
r.update(() => {
|
|
1630
|
-
const a =
|
|
1636
|
+
const a = _();
|
|
1631
1637
|
if (R(a) && a.isCollapsed()) {
|
|
1632
1638
|
const l = z(i);
|
|
1633
1639
|
a.insertNodes([l]);
|
|
@@ -1666,12 +1672,12 @@ const Sn = ({ onClose: t }) => {
|
|
|
1666
1672
|
const d = M(
|
|
1667
1673
|
(c) => {
|
|
1668
1674
|
e.update(() => {
|
|
1669
|
-
const u =
|
|
1675
|
+
const u = _();
|
|
1670
1676
|
if (R(u)) {
|
|
1671
1677
|
const g = [];
|
|
1672
1678
|
for (const [v, x] of c.entries()) {
|
|
1673
|
-
const
|
|
1674
|
-
|
|
1679
|
+
const y = pe(x.value);
|
|
1680
|
+
y.append(z(x.label)), g.push(y), v !== c.length - 1 && g.push(z(" "));
|
|
1675
1681
|
}
|
|
1676
1682
|
u.insertNodes(g);
|
|
1677
1683
|
}
|
|
@@ -1722,7 +1728,7 @@ const Sn = ({ onClose: t }) => {
|
|
|
1722
1728
|
o.update(() => {
|
|
1723
1729
|
if (!i)
|
|
1724
1730
|
return;
|
|
1725
|
-
const d =
|
|
1731
|
+
const d = _();
|
|
1726
1732
|
if (R(d) && d.isCollapsed()) {
|
|
1727
1733
|
const c = z(i.name);
|
|
1728
1734
|
d.insertNodes([c]);
|
|
@@ -1795,7 +1801,7 @@ const Sn = ({ onClose: t }) => {
|
|
|
1795
1801
|
filePrefix: r
|
|
1796
1802
|
}) => {
|
|
1797
1803
|
const [e] = w(), [o, i] = p(!1), [a, l] = p(!1), s = M(() => {
|
|
1798
|
-
const d =
|
|
1804
|
+
const d = _();
|
|
1799
1805
|
if (R(d)) {
|
|
1800
1806
|
const c = ge(d), u = c.getParent();
|
|
1801
1807
|
i(tt(u) || tt(c));
|
|
@@ -1848,7 +1854,7 @@ const Sn = ({ onClose: t }) => {
|
|
|
1848
1854
|
Tr(u)
|
|
1849
1855
|
]), v = M(() => {
|
|
1850
1856
|
var m;
|
|
1851
|
-
const k =
|
|
1857
|
+
const k = _();
|
|
1852
1858
|
if (R(k)) {
|
|
1853
1859
|
const C = ge(k), N = C.getParent();
|
|
1854
1860
|
let I = null;
|
|
@@ -1859,7 +1865,7 @@ const Sn = ({ onClose: t }) => {
|
|
|
1859
1865
|
o(I);
|
|
1860
1866
|
}
|
|
1861
1867
|
}, [t]), x = M(() => {
|
|
1862
|
-
e &&
|
|
1868
|
+
e && _n(e) && t.update(() => {
|
|
1863
1869
|
e.remove();
|
|
1864
1870
|
}), t.dispatchCommand(it, null);
|
|
1865
1871
|
}, [t, e]);
|
|
@@ -1884,7 +1890,7 @@ const Sn = ({ onClose: t }) => {
|
|
|
1884
1890
|
Ie
|
|
1885
1891
|
)
|
|
1886
1892
|
), [t, v, e]), !s) return null;
|
|
1887
|
-
const
|
|
1893
|
+
const y = wt(i);
|
|
1888
1894
|
return /* @__PURE__ */ n(se, { children: /* @__PURE__ */ h(
|
|
1889
1895
|
re,
|
|
1890
1896
|
{
|
|
@@ -1910,8 +1916,8 @@ const Sn = ({ onClose: t }) => {
|
|
|
1910
1916
|
textOverflow: "ellipsis",
|
|
1911
1917
|
marginRight: "$4"
|
|
1912
1918
|
},
|
|
1913
|
-
href:
|
|
1914
|
-
title:
|
|
1919
|
+
href: y,
|
|
1920
|
+
title: y,
|
|
1915
1921
|
target: "_blank",
|
|
1916
1922
|
rel: "noreferrer",
|
|
1917
1923
|
children: i
|
|
@@ -1992,7 +1998,7 @@ export {
|
|
|
1992
1998
|
pe as $createRutineLinkNode,
|
|
1993
1999
|
lo as $getNodesOfTypes,
|
|
1994
2000
|
so as $isImageNode,
|
|
1995
|
-
|
|
2001
|
+
_n as $isRutineLinkNode,
|
|
1996
2002
|
vo as AlignToolbarDropdown,
|
|
1997
2003
|
Co as DragDropPastePlugin,
|
|
1998
2004
|
pn as FloatingToolbar,
|