@arkitektbedriftene/fe-lib 0.3.23 → 0.3.24

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.
@@ -1,19 +1,19 @@
1
1
  import { createHeadlessEditor as dt } from "@lexical/headless";
2
2
  import { $generateHtmlFromNodes as ct } from "@lexical/html";
3
- import { $getRoot as _, ParagraphNode as ht, $createParagraphNode as R, $createTextNode as $, $setSelection as G, SELECTION_CHANGE_COMMAND as Q, $getSelection as L, COMMAND_PRIORITY_CRITICAL as X, $isRangeSelection as N, $isRootOrShadowRoot as ut, DEPRECATED_$isGridSelection as H, FORMAT_TEXT_COMMAND as E, COMMAND_PRIORITY_LOW as T, KEY_ARROW_DOWN_COMMAND as pt, KEY_ARROW_UP_COMMAND as gt, KEY_ESCAPE_COMMAND as ft, KEY_SPACE_COMMAND as mt, $getNearestNodeFromDOMNode as A, KEY_ARROW_LEFT_COMMAND as kt, $isElementNode as Mt } from "lexical";
4
- import { trimTextContentFromAnchor as vt, $setBlocksType as F } from "@lexical/selection";
3
+ import { $getRoot as O, ParagraphNode as ht, $createParagraphNode as $, $createTextNode as P, $setSelection as G, SELECTION_CHANGE_COMMAND as Q, $getSelection as L, COMMAND_PRIORITY_CRITICAL as V, $isRangeSelection as y, $isRootOrShadowRoot as ut, DEPRECATED_$isGridSelection as H, FORMAT_TEXT_COMMAND as E, COMMAND_PRIORITY_LOW as T, KEY_ARROW_DOWN_COMMAND as pt, KEY_ARROW_UP_COMMAND as gt, KEY_ESCAPE_COMMAND as ft, KEY_SPACE_COMMAND as mt, $getNearestNodeFromDOMNode as W, KEY_ARROW_LEFT_COMMAND as kt, $isElementNode as Mt } from "lexical";
4
+ import { trimTextContentFromAnchor as vt, $setBlocksType as D } from "@lexical/selection";
5
5
  import { AutoLinkNode as Ct, LinkNode as bt } from "@lexical/link";
6
- import { ListNode as V, ListItemNode as Tt, $isListNode as W, INSERT_UNORDERED_LIST_COMMAND as Lt, INSERT_ORDERED_LIST_COMMAND as Nt, INSERT_CHECK_LIST_COMMAND as J, insertList as yt, $isListItemNode as y } from "@lexical/list";
7
- import { HeadingNode as xt, QuoteNode as Et, $isHeadingNode as St, $createHeadingNode as wt, $createQuoteNode as It } from "@lexical/rich-text";
8
- import { TableNode as Ot, TableRowNode as _t, TableCellNode as Rt } from "@lexical/table";
6
+ import { ListNode as X, ListItemNode as Tt, $isListNode as A, INSERT_UNORDERED_LIST_COMMAND as Lt, INSERT_ORDERED_LIST_COMMAND as yt, INSERT_CHECK_LIST_COMMAND as J, insertList as xt, $isListItemNode as x } from "@lexical/list";
7
+ import { HeadingNode as Nt, QuoteNode as St, $isHeadingNode as Et, $createHeadingNode as wt, $createQuoteNode as zt } from "@lexical/rich-text";
8
+ import { TableNode as It, TableRowNode as Ot, TableCellNode as $t } from "@lexical/table";
9
9
  import { jsx as o, jsxs as C, Fragment as j } from "react/jsx-runtime";
10
- import { createContext as zt, useState as v, useRef as Z, useCallback as M, useContext as Bt, useEffect as z, useMemo as tt, useLayoutEffect as Dt } from "react";
11
- import { c as w, s as et, D as Ht, T as Ft, a as m, B as O, b as Pt, d as S, u as $t, e as At, f as Wt, g as jt, o as Kt, h as Ut, i as Yt, j as qt, F as Gt, O as Qt, k as Xt, l as Vt, S as Jt } from "./DropdownMenu-7a3b57bd.js";
10
+ import { createContext as _t, useState as v, useRef as Z, useCallback as M, useContext as Rt, useEffect as _, useMemo as tt, useLayoutEffect as Bt } from "react";
11
+ import { c as N, s as et, D as Ht, T as Dt, a as m, B as I, b as Ft, d as w, u as Pt, e as Wt, f as At, g as jt, o as Kt, h as Ut, i as Yt, j as qt, F as Gt, O as Qt, k as Vt, l as Xt, S as Jt } from "./DropdownMenu-c37aea6d.js";
12
12
  import "react-select";
13
13
  import { LexicalComposer as Zt } from "@lexical/react/LexicalComposer.js";
14
14
  import { RichTextPlugin as te } from "@lexical/react/LexicalRichTextPlugin.js";
15
15
  import ee from "@lexical/react/LexicalErrorBoundary.js";
16
- import { useLexicalComposerContext as B } from "@lexical/react/LexicalComposerContext.js";
16
+ import { useLexicalComposerContext as R } from "@lexical/react/LexicalComposerContext.js";
17
17
  import { $getNearestNodeOfType as re, $findMatchingParent as rt, mergeRegister as ot, isHTMLElement as K } from "@lexical/utils";
18
18
  import { G as h } from "./index.esm-d078f232.js";
19
19
  import { ListPlugin as oe } from "@lexical/react/LexicalListPlugin.js";
@@ -23,7 +23,7 @@ import { TabIndentationPlugin as ie } from "@lexical/react/LexicalTabIndentation
23
23
  import "react-dom";
24
24
  import "@radix-ui/react-toolbar";
25
25
  import "@radix-ui/react-dropdown-menu";
26
- const se = ({
26
+ const le = ({
27
27
  text: t,
28
28
  maxChars: r,
29
29
  maxLines: e
@@ -33,27 +33,27 @@ const se = ({
33
33
  const n = typeof e == "number", a = typeof r == "number";
34
34
  if (!n && !a)
35
35
  return t.length;
36
- let s = 0, i = 0;
37
- for (; i < t.length && (!n || s < e) && (!a || i < r); )
36
+ let l = 0, i = 0;
37
+ for (; i < t.length && (!n || l < e) && (!a || i < r); )
38
38
  t[i] === `
39
- ` && s++, i++;
39
+ ` && l++, i++;
40
40
  return t.slice(0, i).length;
41
- }, le = ({
41
+ }, se = ({
42
42
  editor: t,
43
43
  maxChars: r,
44
44
  maxLines: e
45
45
  }) => {
46
- const n = _(), a = n.getTextContent(), s = se({ text: a, maxChars: r, maxLines: e }), i = a.length - s, p = n.select().anchor;
46
+ const n = O(), a = n.getTextContent(), l = le({ text: a, maxChars: r, maxLines: e }), i = a.length - l, p = n.select().anchor;
47
47
  vt(t, p, i);
48
- const l = n.getLastChild();
49
- return l instanceof ht && l.getChildrenSize() === 0 && l.remove(), i;
48
+ const s = n.getLastChild();
49
+ return s instanceof ht && s.getChildrenSize() === 0 && s.remove(), i;
50
50
  }, nt = (t) => t[0] === "{", de = (t) => t !== null && typeof t == "object" && "isEmpty" in t, ce = (t, r) => {
51
51
  t.update(
52
52
  () => {
53
- const e = _();
53
+ const e = O();
54
54
  e.clear();
55
- const n = R();
56
- n.append($("")), e.append(n), G(null);
55
+ const n = $();
56
+ n.append(P("")), e.append(n), G(null);
57
57
  },
58
58
  {
59
59
  tag: r
@@ -62,10 +62,10 @@ const se = ({
62
62
  }, he = (t, r, e) => {
63
63
  r.update(
64
64
  () => {
65
- const n = _();
65
+ const n = O();
66
66
  n.clear();
67
- const a = R();
68
- a.append($(t.trim())), n.append(a), G(null);
67
+ const a = $();
68
+ a.append(P(t.trim())), n.append(a), G(null);
69
69
  },
70
70
  {
71
71
  tag: e
@@ -81,12 +81,12 @@ const se = ({
81
81
  try {
82
82
  if (typeof t == "string" && !nt(t))
83
83
  a.update(() => {
84
- const i = _(), d = R();
85
- d.append($(t.trim())), i.append(d);
84
+ const i = O(), d = $();
85
+ d.append(P(t.trim())), i.append(d);
86
86
  });
87
87
  else {
88
88
  const i = a.parseEditorState(t, () => {
89
- n = le({
89
+ n = se({
90
90
  editor: a,
91
91
  maxLines: e == null ? void 0 : e.maxLines
92
92
  });
@@ -96,29 +96,29 @@ const se = ({
96
96
  } catch (i) {
97
97
  console.error(i);
98
98
  }
99
- let s = "";
99
+ let l = "";
100
100
  return a.update(() => {
101
- s = ct(a);
102
- }), { html: s, trimCount: n };
101
+ l = ct(a);
102
+ }), { html: l, trimCount: n };
103
103
  }, br = [
104
- xt,
105
- Et,
106
- V,
104
+ Nt,
105
+ St,
106
+ X,
107
107
  Tt,
108
108
  Ct,
109
109
  bt,
110
+ It,
110
111
  Ot,
111
- _t,
112
- Rt
113
- ], ue = w({
112
+ $t
113
+ ], ue = N({
114
114
  fontWeight: "bold"
115
- }), pe = w({
115
+ }), pe = N({
116
116
  fontStyle: "italic"
117
- }), ge = w({
117
+ }), ge = N({
118
118
  textDecoration: "underline"
119
- }), fe = w({
119
+ }), fe = N({
120
120
  listStyleType: "none"
121
- }), me = w({
121
+ }), me = N({
122
122
  borderLeft: "4px solid #ccc",
123
123
  color: "#666",
124
124
  fontStyle: "italic",
@@ -136,10 +136,10 @@ const se = ({
136
136
  listitem: fe().className
137
137
  }
138
138
  }
139
- }, at = zt({ hasFocus: !1, editorRef: { current: null } }), Me = ({ onBlur: t }) => {
139
+ }, at = _t({ hasFocus: !1, editorRef: { current: null } }), Me = ({ onBlur: t }) => {
140
140
  const [r, e] = v(!1), n = Z(null), a = M(() => {
141
141
  e(!0), n.current && window.clearTimeout(n.current);
142
- }, []), s = M(() => {
142
+ }, []), l = M(() => {
143
143
  n.current = window.setTimeout(() => {
144
144
  e(!1), t == null || t();
145
145
  }, 0);
@@ -148,10 +148,10 @@ const se = ({
148
148
  hasFocus: r,
149
149
  attributes: {
150
150
  onFocus: a,
151
- onBlur: s
151
+ onBlur: l
152
152
  }
153
153
  };
154
- }, ve = () => Bt(at);
154
+ }, ve = () => Rt(at);
155
155
  function Ce(t) {
156
156
  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);
157
157
  }
@@ -164,43 +164,43 @@ function Te(t) {
164
164
  function Le(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: "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);
166
166
  }
167
- function Ne(t) {
167
+ function ye(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 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);
169
169
  }
170
- function ye(t) {
170
+ function xe(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: "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);
172
172
  }
173
- function xe(t) {
173
+ function Ne(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: "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);
175
175
  }
176
- function Ee(t) {
176
+ function Se(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: "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);
178
178
  }
179
- function Se(t) {
179
+ function Ee(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: "M11 5l6 0" } }, { tag: "path", attr: { d: "M7 19l6 0" } }, { tag: "path", attr: { d: "M14 5l-4 14" } }] })(t);
181
181
  }
182
182
  function we(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: "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);
184
184
  }
185
- function Ie(t) {
185
+ function ze(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: "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);
187
187
  }
188
- function Oe(t) {
188
+ function Ie(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: "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);
190
190
  }
191
- function _e(t) {
191
+ function Oe(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: "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);
193
193
  }
194
- function Re(t) {
194
+ function $e(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: "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);
196
196
  }
197
- function ze(t) {
197
+ function _e(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: "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);
199
199
  }
200
- function Be(t) {
200
+ function Re(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: "M7 5v5a5 5 0 0 0 10 0v-5" } }, { tag: "path", attr: { d: "M5 19h14" } }] })(t);
202
202
  }
203
- const De = et("div", {
203
+ const Be = et("div", {
204
204
  width: "10rem",
205
205
  display: "flex"
206
206
  }), it = {
@@ -216,23 +216,23 @@ const De = et("div", {
216
216
  quote: "Sitat",
217
217
  check: "Avkrysningsliste"
218
218
  }, He = {
219
- bullet: /* @__PURE__ */ o(_e, { size: "1.25rem" }),
219
+ bullet: /* @__PURE__ */ o(Oe, { size: "1.25rem" }),
220
220
  h1: /* @__PURE__ */ o(Te, { size: "1.25rem" }),
221
221
  h2: /* @__PURE__ */ o(Le, { size: "1.25rem" }),
222
- h3: /* @__PURE__ */ o(Ne, { size: "1.25rem" }),
223
- h4: /* @__PURE__ */ o(ye, { size: "1.25rem" }),
224
- h5: /* @__PURE__ */ o(xe, { size: "1.25rem" }),
225
- h6: /* @__PURE__ */ o(Ee, { size: "1.25rem" }),
226
- number: /* @__PURE__ */ o(Oe, { size: "1.25rem" }),
227
- check: /* @__PURE__ */ o(Ie, { size: "1.25rem" }),
222
+ h3: /* @__PURE__ */ o(ye, { size: "1.25rem" }),
223
+ h4: /* @__PURE__ */ o(xe, { size: "1.25rem" }),
224
+ h5: /* @__PURE__ */ o(Ne, { size: "1.25rem" }),
225
+ h6: /* @__PURE__ */ o(Se, { size: "1.25rem" }),
226
+ number: /* @__PURE__ */ o(Ie, { size: "1.25rem" }),
227
+ check: /* @__PURE__ */ o(ze, { size: "1.25rem" }),
228
228
  paragraph: /* @__PURE__ */ o(we, { size: "1.25rem" }),
229
- quote: /* @__PURE__ */ o(Re, { size: "1.25rem" })
229
+ quote: /* @__PURE__ */ o($e, { size: "1.25rem" })
230
230
  }, f = ({
231
231
  blockType: t
232
232
  }) => /* @__PURE__ */ C(j, { children: [
233
- /* @__PURE__ */ o(O, { css: { display: "flex", flex: "0 0 auto" }, children: He[t] }),
233
+ /* @__PURE__ */ o(I, { css: { display: "flex", flex: "0 0 auto" }, children: He[t] }),
234
234
  /* @__PURE__ */ o(
235
- O,
235
+ I,
236
236
  {
237
237
  css: {
238
238
  flex: "1 1 auto",
@@ -243,8 +243,8 @@ const De = et("div", {
243
243
  children: it[t]
244
244
  }
245
245
  )
246
- ] }), Fe = (t) => {
247
- if (!N(t))
246
+ ] }), De = (t) => {
247
+ if (!y(t))
248
248
  return null;
249
249
  const r = t.anchor.getNode();
250
250
  let e = r.getKey() === "root" ? r : rt(r, (n) => {
@@ -255,41 +255,41 @@ const De = et("div", {
255
255
  anchorNode: r,
256
256
  element: e
257
257
  };
258
- }, Pe = () => {
259
- const [t] = B(), [r, e] = v("paragraph");
260
- z(() => t.registerCommand(
258
+ }, Fe = () => {
259
+ const [t] = R(), [r, e] = v("paragraph");
260
+ _(() => t.registerCommand(
261
261
  Q,
262
262
  () => {
263
- const l = L(), g = Fe(l);
263
+ const s = L(), g = De(s);
264
264
  if (!g)
265
265
  return !1;
266
- const { element: c, anchorNode: x } = g, b = c.getKey();
266
+ const { element: c, anchorNode: S } = g, b = c.getKey();
267
267
  if (t.getElementByKey(b) !== null)
268
- if (W(c)) {
268
+ if (A(c)) {
269
269
  const k = re(
270
- x,
271
- V
272
- ), D = k ? k.getListType() : c.getListType();
273
- e(D);
270
+ S,
271
+ X
272
+ ), B = k ? k.getListType() : c.getListType();
273
+ e(B);
274
274
  } else {
275
- const k = St(c) ? c.getTag() : c.getType();
275
+ const k = Et(c) ? c.getTag() : c.getType();
276
276
  k in it && e(k);
277
277
  }
278
278
  return !1;
279
279
  },
280
- X
280
+ V
281
281
  ), [t]);
282
- const n = (l) => {
283
- r !== l && t.update(() => {
282
+ const n = (s) => {
283
+ r !== s && t.update(() => {
284
284
  const g = L();
285
- (N(g) || H(g)) && (F(g, () => wt(l)), e(l));
285
+ (y(g) || H(g)) && (D(g, () => wt(s)), e(s));
286
286
  });
287
287
  };
288
- return /* @__PURE__ */ o(De, { children: /* @__PURE__ */ C(
288
+ return /* @__PURE__ */ o(Be, { children: /* @__PURE__ */ C(
289
289
  Ht,
290
290
  {
291
291
  trigger: /* @__PURE__ */ o(
292
- Ft,
292
+ Dt,
293
293
  {
294
294
  dropdown: !0,
295
295
  css: { display: "flex", width: "100%", overflow: "hidden" },
@@ -301,8 +301,8 @@ const De = et("div", {
301
301
  children: [
302
302
  /* @__PURE__ */ o(m, { onClick: () => {
303
303
  r !== "paragraph" && t.update(() => {
304
- const l = L();
305
- (N(l) || H(l)) && (F(l, () => R()), e("paragraph"));
304
+ const s = L();
305
+ (y(s) || H(s)) && (D(s, () => $()), e("paragraph"));
306
306
  });
307
307
  }, children: /* @__PURE__ */ o(f, { blockType: "paragraph" }) }),
308
308
  /* @__PURE__ */ o(m, { onClick: () => n("h1"), children: /* @__PURE__ */ o(f, { blockType: "h1" }) }),
@@ -315,30 +315,30 @@ const De = et("div", {
315
315
  r !== "bullet" && (t.dispatchCommand(Lt, void 0), e("bullet"));
316
316
  }, children: /* @__PURE__ */ o(f, { blockType: "bullet" }) }),
317
317
  /* @__PURE__ */ o(m, { onClick: () => {
318
- r !== "number" && (t.dispatchCommand(Nt, void 0), e("number"));
318
+ r !== "number" && (t.dispatchCommand(yt, void 0), e("number"));
319
319
  }, children: /* @__PURE__ */ o(f, { blockType: "number" }) }),
320
320
  /* @__PURE__ */ o(m, { onClick: () => {
321
321
  r !== "check" && (t.dispatchCommand(J, void 0), e("check"));
322
322
  }, children: /* @__PURE__ */ o(f, { blockType: "check" }) }),
323
323
  /* @__PURE__ */ o(m, { onClick: () => {
324
324
  r !== "quote" && t.update(() => {
325
- const l = L();
326
- (N(l) || H(l)) && (F(l, () => It()), e("quote"));
325
+ const s = L();
326
+ (y(s) || H(s)) && (D(s, () => zt()), e("quote"));
327
327
  });
328
328
  }, children: /* @__PURE__ */ o(f, { blockType: "quote" }) })
329
329
  ]
330
330
  }
331
331
  ) });
332
- }, $e = () => {
333
- const [t] = B(), [r, e] = v(!1), [n, a] = v(!1), [s, i] = v(!1), [d, p] = v(!1), [l, g] = v(!1), c = M(() => {
332
+ }, Pe = () => {
333
+ const [t] = R(), [r, e] = v(!1), [n, a] = v(!1), [l, i] = v(!1), [d, p] = v(!1), [s, g] = v(!1), c = M(() => {
334
334
  const u = L();
335
- N(u) && (e(u.hasFormat("bold")), a(u.hasFormat("italic")), i(u.hasFormat("underline")), p(u.hasFormat("code")), g(u.hasFormat("superscript")));
335
+ y(u) && (e(u.hasFormat("bold")), a(u.hasFormat("italic")), i(u.hasFormat("underline")), p(u.hasFormat("code")), g(u.hasFormat("superscript")));
336
336
  }, []);
337
- z(() => ot(
337
+ _(() => ot(
338
338
  t.registerCommand(
339
339
  Q,
340
340
  () => (c(), !1),
341
- X
341
+ V
342
342
  ),
343
343
  t.registerUpdateListener(({ editorState: u }) => {
344
344
  u.read(() => {
@@ -346,61 +346,61 @@ const De = et("div", {
346
346
  });
347
347
  })
348
348
  ), [t, c]);
349
- const x = M(
349
+ const S = M(
350
350
  () => t.dispatchCommand(E, "bold"),
351
351
  [t]
352
352
  ), b = M(
353
353
  () => t.dispatchCommand(E, "italic"),
354
354
  [t]
355
- ), I = M(
355
+ ), z = M(
356
356
  () => t.dispatchCommand(E, "underline"),
357
357
  [t]
358
358
  ), k = M(
359
359
  () => t.dispatchCommand(E, "code"),
360
360
  [t]
361
- ), D = M(
361
+ ), B = M(
362
362
  () => t.dispatchCommand(E, "superscript"),
363
363
  [t]
364
- ), lt = tt(() => {
364
+ ), st = tt(() => {
365
365
  const u = [];
366
- return r && u.push("bold"), n && u.push("italic"), s && u.push("underline"), d && u.push("code"), l && u.push("superscript"), u;
367
- }, [r, n, s, d, l]);
366
+ return r && u.push("bold"), n && u.push("italic"), l && u.push("underline"), d && u.push("code"), s && u.push("superscript"), u;
367
+ }, [r, n, l, d, s]);
368
368
  return /* @__PURE__ */ C(
369
- Pt,
369
+ Ft,
370
370
  {
371
371
  type: "multiple",
372
372
  "aria-label": "Tekstformattering",
373
- value: lt,
373
+ value: st,
374
374
  children: [
375
375
  /* @__PURE__ */ o(
376
- S,
376
+ w,
377
377
  {
378
- onClick: x,
378
+ onClick: S,
379
379
  title: "Fet tekst",
380
380
  value: "bold",
381
381
  children: /* @__PURE__ */ o(Ce, { size: "1.25rem" })
382
382
  }
383
383
  ),
384
384
  /* @__PURE__ */ o(
385
- S,
385
+ w,
386
386
  {
387
387
  onClick: b,
388
388
  title: "Kursiv tekst",
389
389
  value: "italic",
390
- children: /* @__PURE__ */ o(Se, { size: "1.25rem" })
390
+ children: /* @__PURE__ */ o(Ee, { size: "1.25rem" })
391
391
  }
392
392
  ),
393
393
  /* @__PURE__ */ o(
394
- S,
394
+ w,
395
395
  {
396
- onClick: I,
396
+ onClick: z,
397
397
  title: "Understreket tekst",
398
398
  value: "underline",
399
- children: /* @__PURE__ */ o(Be, { size: "1.25rem" })
399
+ children: /* @__PURE__ */ o(Re, { size: "1.25rem" })
400
400
  }
401
401
  ),
402
402
  /* @__PURE__ */ o(
403
- S,
403
+ w,
404
404
  {
405
405
  onClick: k,
406
406
  title: "Kode",
@@ -409,27 +409,27 @@ const De = et("div", {
409
409
  }
410
410
  ),
411
411
  /* @__PURE__ */ o(
412
- S,
412
+ w,
413
413
  {
414
- onClick: D,
414
+ onClick: B,
415
415
  title: "Superscript",
416
416
  value: "superscript",
417
- children: /* @__PURE__ */ o(ze, { size: "1.25rem" })
417
+ children: /* @__PURE__ */ o(_e, { size: "1.25rem" })
418
418
  }
419
419
  )
420
420
  ]
421
421
  }
422
422
  );
423
- }, Ae = ({ children: t }) => {
424
- const { hasFocus: r, editorRef: e } = ve(), n = r, [a, s] = v(n);
425
- Dt(() => {
426
- s(n);
423
+ }, We = ({ children: t }) => {
424
+ const { hasFocus: r, editorRef: e } = ve(), n = r, [a, l] = v(n);
425
+ Bt(() => {
426
+ l(n);
427
427
  }, [n]);
428
- const { context: i, refs: d, floatingStyles: p } = $t({
428
+ const { context: i, refs: d, floatingStyles: p } = Pt({
429
429
  placement: "top",
430
- whileElementsMounted: At,
430
+ whileElementsMounted: Wt,
431
431
  middleware: [
432
- Wt({
432
+ At({
433
433
  apply: ({ rects: g, elements: c }) => {
434
434
  c.floating.style.minWidth = `${g.reference.width}px`;
435
435
  }
@@ -443,11 +443,11 @@ const De = et("div", {
443
443
  })
444
444
  ],
445
445
  open: a,
446
- onOpenChange: s,
446
+ onOpenChange: l,
447
447
  elements: {
448
448
  reference: e.current
449
449
  }
450
- }), { getFloatingProps: l } = Yt([
450
+ }), { getFloatingProps: s } = Yt([
451
451
  qt(i, {
452
452
  role: "dialog"
453
453
  })
@@ -457,28 +457,28 @@ const De = et("div", {
457
457
  {
458
458
  ref: d.setFloating,
459
459
  style: p,
460
- ...l,
460
+ ...s,
461
461
  css: {
462
462
  border: "1px solid $border",
463
463
  borderRadius: "$md",
464
464
  overflow: "hidden",
465
465
  boxShadow: "$md"
466
466
  },
467
- children: /* @__PURE__ */ C(Xt, { "aria-label": "Formattering", children: [
467
+ children: /* @__PURE__ */ C(Vt, { "aria-label": "Formattering", children: [
468
+ /* @__PURE__ */ o(Fe, {}),
469
+ /* @__PURE__ */ o(Xt, {}),
468
470
  /* @__PURE__ */ o(Pe, {}),
469
- /* @__PURE__ */ o(Vt, {}),
470
- /* @__PURE__ */ o($e, {}),
471
471
  t
472
472
  ] })
473
473
  }
474
474
  ) }) : null;
475
475
  };
476
- function We() {
477
- const [t] = B();
478
- return z(() => ot(
476
+ function Ae() {
477
+ const [t] = R();
478
+ return _(() => ot(
479
479
  t.registerCommand(
480
480
  J,
481
- () => (yt(t, "check"), !0),
481
+ () => (xt(t, "check"), !0),
482
482
  T
483
483
  ),
484
484
  t.registerCommand(
@@ -494,7 +494,7 @@ function We() {
494
494
  t.registerCommand(
495
495
  ft,
496
496
  (r) => {
497
- if (P() != null) {
497
+ if (F() != null) {
498
498
  const n = t.getRootElement();
499
499
  return n != null && n.focus(), !0;
500
500
  }
@@ -505,10 +505,10 @@ function We() {
505
505
  t.registerCommand(
506
506
  mt,
507
507
  (r) => {
508
- const e = P();
508
+ const e = F();
509
509
  return e != null && t.isEditable() ? (t.update(() => {
510
- const n = A(e);
511
- y(n) && (r.preventDefault(), n.toggleChecked());
510
+ const n = W(e);
511
+ x(n) && (r.preventDefault(), n.toggleChecked());
512
512
  }), !0) : !1;
513
513
  },
514
514
  T
@@ -517,16 +517,16 @@ function We() {
517
517
  kt,
518
518
  (r) => t.getEditorState().read(() => {
519
519
  const e = L();
520
- if (N(e) && e.isCollapsed()) {
520
+ if (y(e) && e.isCollapsed()) {
521
521
  const { anchor: n } = e, a = n.type === "element";
522
522
  if (a || n.offset === 0) {
523
- const s = n.getNode(), i = rt(
524
- s,
523
+ const l = n.getNode(), i = rt(
524
+ l,
525
525
  (d) => Mt(d) && !d.isInline()
526
526
  );
527
- if (y(i)) {
527
+ if (x(i)) {
528
528
  const d = i.getParent();
529
- if (W(d) && d.getListType() === "check" && (a || i.getFirstDescendant() === s)) {
529
+ if (A(d) && d.getListType() === "check" && (a || i.getFirstDescendant() === l)) {
530
530
  const p = t.getElementByKey(i.__key);
531
531
  if (p != null && document.activeElement !== p)
532
532
  return p.focus(), r.preventDefault(), !0;
@@ -543,7 +543,7 @@ function We() {
543
543
  })
544
544
  ), [t]), null;
545
545
  }
546
- function st(t, r) {
546
+ function lt(t, r) {
547
547
  const e = t.target;
548
548
  if (e === null || !K(e))
549
549
  return;
@@ -553,22 +553,22 @@ function st(t, r) {
553
553
  const a = e.parentNode;
554
554
  if (!a || a.__lexicalListType !== "check")
555
555
  return;
556
- const s = t.pageX, i = e.getBoundingClientRect();
557
- (e.dir === "rtl" ? s < i.right && s > i.right - 20 : s > i.left && s < i.left + 20) && r();
556
+ const l = t.pageX, i = e.getBoundingClientRect();
557
+ (e.dir === "rtl" ? l < i.right && l > i.right - 20 : l > i.left && l < i.left + 20) && r();
558
558
  }
559
559
  function U(t) {
560
- st(t, () => {
560
+ lt(t, () => {
561
561
  const r = t.target, e = je(r);
562
562
  e != null && e.isEditable() && e.update(() => {
563
563
  if (t.target) {
564
- const n = A(r);
565
- y(n) && (r.focus(), n.toggleChecked());
564
+ const n = W(r);
565
+ x(n) && (r.focus(), n.toggleChecked());
566
566
  }
567
567
  });
568
568
  });
569
569
  }
570
570
  function Y(t) {
571
- st(t, () => {
571
+ lt(t, () => {
572
572
  t.preventDefault();
573
573
  });
574
574
  }
@@ -581,33 +581,33 @@ function je(t) {
581
581
  }
582
582
  return null;
583
583
  }
584
- function P() {
584
+ function F() {
585
585
  const t = document.activeElement;
586
586
  return t != null && t.tagName === "LI" && t.parentNode != null && // @ts-ignore internal field
587
587
  t.parentNode.__lexicalListType === "check" ? t : null;
588
588
  }
589
589
  function Ke(t, r) {
590
590
  let e = r ? t.getPreviousSibling() : t.getNextSibling(), n = t;
591
- for (; e == null && y(n); )
591
+ for (; e == null && x(n); )
592
592
  n = n.getParentOrThrow().getParent(), n != null && (e = r ? n.getPreviousSibling() : n.getNextSibling());
593
- for (; y(e); ) {
593
+ for (; x(e); ) {
594
594
  const a = r ? e.getLastChild() : e.getFirstChild();
595
- if (!W(a))
595
+ if (!A(a))
596
596
  return e;
597
597
  e = r ? a.getLastChild() : a.getFirstChild();
598
598
  }
599
599
  return null;
600
600
  }
601
601
  function q(t, r, e) {
602
- const n = P();
602
+ const n = F();
603
603
  return n != null && r.update(() => {
604
- const a = A(n);
605
- if (!y(a))
604
+ const a = W(n);
605
+ if (!x(a))
606
606
  return;
607
- const s = Ke(a, e);
608
- if (s != null) {
609
- s.selectStart();
610
- const i = r.getElementByKey(s.__key);
607
+ const l = Ke(a, e);
608
+ if (l != null) {
609
+ l.selectStart();
610
+ const i = r.getElementByKey(l.__key);
611
611
  i != null && (t.preventDefault(), setTimeout(() => {
612
612
  i.focus();
613
613
  }, 0));
@@ -618,13 +618,13 @@ const Ue = () => /* @__PURE__ */ C(j, { children: [
618
618
  /* @__PURE__ */ o(oe, {}),
619
619
  /* @__PURE__ */ o(ae, {}),
620
620
  /* @__PURE__ */ o(ne, {}),
621
- /* @__PURE__ */ o(We, {}),
621
+ /* @__PURE__ */ o(Ae, {}),
622
622
  /* @__PURE__ */ o(ie, {})
623
623
  ] }), Ye = ({
624
624
  state: t
625
625
  }) => {
626
- const [r] = B();
627
- return z(() => {
626
+ const [r] = R();
627
+ return _(() => {
628
628
  if (t)
629
629
  try {
630
630
  if (de(t)) {
@@ -681,7 +681,7 @@ const Ue = () => /* @__PURE__ */ C(j, { children: [
681
681
  }), Ge = ({
682
682
  isLoading: t
683
683
  }) => /* @__PURE__ */ o(
684
- O,
684
+ I,
685
685
  {
686
686
  css: {
687
687
  visibility: t ? "visible" : "hidden",
@@ -698,15 +698,15 @@ const Ue = () => /* @__PURE__ */ C(j, { children: [
698
698
  placeholderText: e,
699
699
  nodes: n,
700
700
  plugins: a,
701
- toolbarContent: s,
701
+ toolbarContent: l,
702
702
  content: i,
703
703
  hideBorder: d,
704
704
  onBlur: p,
705
- defaultState: l,
705
+ defaultState: s,
706
706
  css: g
707
707
  }) => {
708
- const { hasFocus: c, attributes: x } = Me({ onBlur: p }), b = Z(null), I = tt(() => ({ hasFocus: c, editorRef: b }), [c]);
709
- return /* @__PURE__ */ o(at.Provider, { value: I, children: /* @__PURE__ */ C(
708
+ const { hasFocus: c, attributes: S } = Me({ onBlur: p }), b = Z(null), z = tt(() => ({ hasFocus: c, editorRef: b }), [c]);
709
+ return /* @__PURE__ */ o(at.Provider, { value: z, children: /* @__PURE__ */ C(
710
710
  Zt,
711
711
  {
712
712
  initialConfig: {
@@ -726,14 +726,14 @@ const Ue = () => /* @__PURE__ */ C(j, { children: [
726
726
  hasFocus: c,
727
727
  hideBorder: d,
728
728
  css: g,
729
- ...x,
729
+ ...S,
730
730
  children: [
731
731
  /* @__PURE__ */ o(
732
732
  te,
733
733
  {
734
734
  contentEditable: i,
735
735
  placeholder: e ? /* @__PURE__ */ o(
736
- O,
736
+ I,
737
737
  {
738
738
  css: {
739
739
  position: "absolute",
@@ -752,16 +752,156 @@ const Ue = () => /* @__PURE__ */ C(j, { children: [
752
752
  /* @__PURE__ */ o(Ue, {}),
753
753
  a,
754
754
  /* @__PURE__ */ o(Ge, { isLoading: t }),
755
- /* @__PURE__ */ o(Ae, { children: s })
755
+ /* @__PURE__ */ o(We, { children: l })
756
756
  ]
757
757
  }
758
758
  ),
759
- /* @__PURE__ */ o(Ye, { state: l }),
759
+ /* @__PURE__ */ o(Ye, { state: s }),
760
760
  /* @__PURE__ */ o(j, { children: r })
761
761
  ]
762
762
  }
763
763
  ) });
764
- };
764
+ }, Lr = N({
765
+ fontSize: "1rem",
766
+ lineHeight: "1.5",
767
+ "h1, h2, h3, h4, h5, h6": {
768
+ fontWeight: "700",
769
+ lineHeight: "1.2",
770
+ margin: "1.5rem 0 0.5rem",
771
+ "&:first-child": {
772
+ marginTop: "0"
773
+ }
774
+ },
775
+ h1: {
776
+ fontSize: "1.6em"
777
+ },
778
+ h2: {
779
+ fontSize: "1.4em"
780
+ },
781
+ h3: {
782
+ fontSize: "1.2em"
783
+ },
784
+ h4: {
785
+ fontSize: "1.1em"
786
+ },
787
+ h5: {
788
+ fontSize: "1em"
789
+ },
790
+ h6: {
791
+ fontSize: "0.9em"
792
+ },
793
+ "p, ul, ol": {
794
+ margin: "1.14em 0",
795
+ "&:first-child": {
796
+ marginTop: "0"
797
+ },
798
+ "&:last-child": {
799
+ marginBottom: "0"
800
+ }
801
+ },
802
+ strong: {
803
+ fontWeight: "$bold"
804
+ },
805
+ "ul, ol": {
806
+ paddingLeft: "1.8em"
807
+ },
808
+ th: {
809
+ fontWeight: "$medium",
810
+ backgroundColor: "$gray100"
811
+ },
812
+ "th, td": {
813
+ padding: "0.5em 1em",
814
+ border: "1px solid $gray200"
815
+ },
816
+ kbd: {
817
+ backgroundColor: "$blue100",
818
+ color: "$blue700",
819
+ padding: "0.1em 0.4em",
820
+ borderRadius: "$sm",
821
+ fontSize: "0.9em",
822
+ fontWeight: "$medium"
823
+ },
824
+ "li[role=checkbox]": {
825
+ listStyle: "none",
826
+ position: "relative",
827
+ paddingLeft: 24,
828
+ "&::before": {
829
+ content: "",
830
+ width: 16,
831
+ height: 16,
832
+ top: 2,
833
+ left: 0,
834
+ cursor: "pointer",
835
+ display: "block",
836
+ backgroundSize: "cover",
837
+ position: "absolute",
838
+ border: "1px solid $gray500",
839
+ borderRadius: 2
840
+ },
841
+ "&::after": {
842
+ content: "",
843
+ width: 8,
844
+ height: 4,
845
+ top: 6,
846
+ left: 4,
847
+ display: "block",
848
+ position: "absolute",
849
+ borderLeft: "2px solid white",
850
+ borderBottom: "2px solid white",
851
+ transform: "rotate(-45deg)"
852
+ },
853
+ "&[aria-checked=true]": {
854
+ "&::before": {
855
+ backgroundColor: "$green500",
856
+ borderColor: "$green500"
857
+ }
858
+ },
859
+ "&:focus": {
860
+ outline: "none",
861
+ "&::before": {
862
+ outline: "2px solid $gray500",
863
+ outlineOffset: 2
864
+ }
865
+ }
866
+ },
867
+ variants: {
868
+ size: {
869
+ xs: {
870
+ fontSize: "0.625rem",
871
+ "@print": {
872
+ fontSize: "8pt"
873
+ }
874
+ },
875
+ sm: {
876
+ fontSize: "0.75rem",
877
+ "@print": {
878
+ fontSize: "10pt"
879
+ }
880
+ },
881
+ md: {
882
+ fontSize: "0.875rem",
883
+ "@print": {
884
+ fontSize: "12pt"
885
+ }
886
+ },
887
+ lg: {
888
+ fontSize: "1rem",
889
+ "@print": {
890
+ fontSize: "14pt"
891
+ }
892
+ },
893
+ xl: {
894
+ fontSize: "1.25rem",
895
+ "@print": {
896
+ fontSize: "16pt"
897
+ }
898
+ }
899
+ }
900
+ },
901
+ defaultVariants: {
902
+ size: "md"
903
+ }
904
+ });
765
905
  export {
766
906
  Tr as RichTextEditor,
767
907
  ce as clearEditorState,
@@ -769,6 +909,7 @@ export {
769
909
  de as isEditorState,
770
910
  nt as isJSON,
771
911
  at as richTextContext,
912
+ Lr as richTextCss,
772
913
  he as setStateFromPlainText,
773
914
  Cr as stateToHTML,
774
915
  Me as useHasFocusWithin,