@arkitektbedriftene/fe-lib 0.4.5 → 0.4.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.
Files changed (2) hide show
  1. package/dist/rich-text.es.js +244 -236
  2. package/package.json +1 -1
@@ -1,30 +1,30 @@
1
1
  import { createHeadlessEditor as kt } from "@lexical/headless";
2
2
  import { $generateHtmlFromNodes as Mt } from "@lexical/html";
3
- import { $getRoot as O, ParagraphNode as bt, $createParagraphNode as B, $createTextNode as A, $setSelection as Z, SELECTION_CHANGE_COMMAND as W, $getSelection as L, COMMAND_PRIORITY_CRITICAL as tt, $isRangeSelection as x, $isRootOrShadowRoot as Ct, DEPRECATED_$isGridSelection as P, FORMAT_TEXT_COMMAND as $, COMMAND_PRIORITY_LOW as T, KEY_ARROW_DOWN_COMMAND as vt, KEY_ARROW_UP_COMMAND as Tt, KEY_ESCAPE_COMMAND as Lt, KEY_SPACE_COMMAND as xt, $getNearestNodeFromDOMNode as j, KEY_ARROW_LEFT_COMMAND as yt, $isElementNode as Et } from "lexical";
4
- import { trimTextContentFromAnchor as Nt, $setBlocksType as H } from "@lexical/selection";
5
- import { AutoLinkNode as St, LinkNode as wt } from "@lexical/link";
6
- import { ListNode as et, ListItemNode as zt, $isListNode as K, INSERT_UNORDERED_LIST_COMMAND as It, INSERT_ORDERED_LIST_COMMAND as $t, INSERT_CHECK_LIST_COMMAND as rt, insertList as _t, $isListItemNode as E } from "@lexical/list";
7
- import { HeadingNode as Rt, QuoteNode as Ot, $isHeadingNode as Bt, $createHeadingNode as Ft, $createQuoteNode as Pt } from "@lexical/rich-text";
8
- import { TableNode as Ht, TableRowNode as Dt, TableCellNode as At, $getTableCellNodeFromLexicalNode as Wt, $deleteTableColumn__EXPERIMENTAL as jt, $deleteTableRow__EXPERIMENTAL as Kt, $insertTableColumn__EXPERIMENTAL as Y, $insertTableRow__EXPERIMENTAL as q } from "@lexical/table";
9
- import { jsx as r, jsxs as C, Fragment as U } from "react/jsx-runtime";
10
- import { createContext as Ut, useState as M, useRef as ot, useCallback as b, useContext as Yt, useEffect as N, useMemo as nt, useLayoutEffect as qt } from "react";
11
- import { c as S, s as at, D as it, T as Xt, a as m, B as R, b as Gt, d as _, u as lt, e as Qt, f as Vt, g as Jt, o as st, h as Zt, i as te, j as ee, F as re, O as oe, k as ne, l as ae, S as ie, m as le, n as y, p as X } from "./TextInput-bedd6814.js";
3
+ import { $getRoot as O, ParagraphNode as Ct, $createParagraphNode as B, $createTextNode as A, $setSelection as Z, SELECTION_CHANGE_COMMAND as W, $getSelection as T, COMMAND_PRIORITY_CRITICAL as tt, $isRangeSelection as L, $isRootOrShadowRoot as bt, DEPRECATED_$isGridSelection as F, FORMAT_TEXT_COMMAND as _, COMMAND_PRIORITY_LOW as y, KEY_ARROW_DOWN_COMMAND as vt, KEY_ARROW_UP_COMMAND as Tt, KEY_ESCAPE_COMMAND as Lt, KEY_SPACE_COMMAND as yt, $getNearestNodeFromDOMNode as j, KEY_ARROW_LEFT_COMMAND as xt, $isElementNode as Nt, COMMAND_PRIORITY_NORMAL as Et } from "lexical";
4
+ import { trimTextContentFromAnchor as St, $setBlocksType as D } from "@lexical/selection";
5
+ import { AutoLinkNode as wt, LinkNode as zt } from "@lexical/link";
6
+ import { ListNode as et, ListItemNode as It, $isListNode as K, INSERT_UNORDERED_LIST_COMMAND as _t, INSERT_ORDERED_LIST_COMMAND as $t, INSERT_CHECK_LIST_COMMAND as rt, insertList as Rt, $isListItemNode as N } from "@lexical/list";
7
+ import { HeadingNode as Ot, QuoteNode as Bt, $isHeadingNode as Pt, $createHeadingNode as Ft, $createQuoteNode as Dt } from "@lexical/rich-text";
8
+ import { TableNode as Ht, TableRowNode as At, TableCellNode as Wt, $getTableCellNodeFromLexicalNode as jt, $deleteTableColumn__EXPERIMENTAL as Kt, $deleteTableRow__EXPERIMENTAL as Ut, $insertTableColumn__EXPERIMENTAL as Y, $insertTableRow__EXPERIMENTAL as q } from "@lexical/table";
9
+ import { jsx as r, jsxs as b, Fragment as U } from "react/jsx-runtime";
10
+ import { createContext as Yt, useState as M, useRef as ot, useCallback as C, useContext as qt, useEffect as E, useMemo as nt, useLayoutEffect as Xt } from "react";
11
+ import { c as S, s as at, D as it, T as Gt, a as f, B as R, b as Qt, d as $, u as lt, e as Vt, f as Jt, g as Zt, o as st, h as te, i as ee, j as re, F as oe, O as ne, k as ae, l as ie, S as le, m as se, n as x, p as X } from "./TextInput-bedd6814.js";
12
12
  import "react-select";
13
- import { LexicalComposer as se } from "@lexical/react/LexicalComposer.js";
14
- import { RichTextPlugin as de } from "@lexical/react/LexicalRichTextPlugin.js";
15
- import ce from "@lexical/react/LexicalErrorBoundary.js";
16
- import { useLexicalComposerContext as F } from "@lexical/react/LexicalComposerContext.js";
17
- import { $getNearestNodeOfType as he, $findMatchingParent as dt, mergeRegister as ct, isHTMLElement as G } from "@lexical/utils";
13
+ import { LexicalComposer as de } from "@lexical/react/LexicalComposer.js";
14
+ import { RichTextPlugin as ce } from "@lexical/react/LexicalRichTextPlugin.js";
15
+ import he from "@lexical/react/LexicalErrorBoundary.js";
16
+ import { useLexicalComposerContext as P } from "@lexical/react/LexicalComposerContext.js";
17
+ import { $getNearestNodeOfType as ue, $findMatchingParent as dt, mergeRegister as ct, isHTMLElement as G } from "@lexical/utils";
18
18
  import { G as c } from "./index.esm-969855d2.js";
19
- import { ListPlugin as ue } from "@lexical/react/LexicalListPlugin.js";
20
- import { HistoryPlugin as pe } from "@lexical/react/LexicalHistoryPlugin.js";
21
- import { TablePlugin as ge } from "@lexical/react/LexicalTablePlugin.js";
19
+ import { ListPlugin as pe } from "@lexical/react/LexicalListPlugin.js";
20
+ import { HistoryPlugin as ge } from "@lexical/react/LexicalHistoryPlugin.js";
21
+ import { TablePlugin as me } from "@lexical/react/LexicalTablePlugin.js";
22
22
  import { TabIndentationPlugin as fe } from "@lexical/react/LexicalTabIndentationPlugin.js";
23
- import { useLexicalComposerContext as me } from "@lexical/react/LexicalComposerContext";
23
+ import { useLexicalComposerContext as ke } from "@lexical/react/LexicalComposerContext";
24
24
  import "react-dom";
25
25
  import "@radix-ui/react-toolbar";
26
26
  import "@radix-ui/react-dropdown-menu";
27
- const ke = ({
27
+ const Me = ({
28
28
  text: t,
29
29
  maxChars: e,
30
30
  maxLines: o
@@ -39,16 +39,16 @@ const ke = ({
39
39
  t[i] === `
40
40
  ` && l++, i++;
41
41
  return t.slice(0, i).length;
42
- }, Me = ({
42
+ }, Ce = ({
43
43
  editor: t,
44
44
  maxChars: e,
45
45
  maxLines: o
46
46
  }) => {
47
- const n = O(), a = n.getTextContent(), l = ke({ text: a, maxChars: e, maxLines: o }), i = a.length - l, h = n.select().anchor;
48
- Nt(t, h, i);
47
+ const n = O(), a = n.getTextContent(), l = Me({ text: a, maxChars: e, maxLines: o }), i = a.length - l, h = n.select().anchor;
48
+ St(t, h, i);
49
49
  const s = n.getLastChild();
50
- return s instanceof bt && s.getChildrenSize() === 0 && s.remove(), i;
51
- }, ht = (t) => t[0] === "{", be = (t) => t !== null && typeof t == "object" && "isEmpty" in t, Ce = (t, e) => {
50
+ return s instanceof Ct && s.getChildrenSize() === 0 && s.remove(), i;
51
+ }, ht = (t) => t[0] === "{", be = (t) => t !== null && typeof t == "object" && "isEmpty" in t, ve = (t, e) => {
52
52
  t.update(
53
53
  () => {
54
54
  const o = O();
@@ -60,7 +60,7 @@ const ke = ({
60
60
  tag: e
61
61
  }
62
62
  );
63
- }, ve = (t, e, o) => {
63
+ }, Te = (t, e, o) => {
64
64
  e.update(
65
65
  () => {
66
66
  const n = O();
@@ -87,7 +87,7 @@ const ke = ({
87
87
  });
88
88
  else {
89
89
  const i = a.parseEditorState(t, () => {
90
- n = Me({
90
+ n = Ce({
91
91
  editor: a,
92
92
  maxLines: o == null ? void 0 : o.maxLines
93
93
  });
@@ -101,23 +101,23 @@ const ke = ({
101
101
  return a.update(() => {
102
102
  l = Mt(a);
103
103
  }), { html: l, trimCount: n };
104
- }, _r = [
105
- Rt,
104
+ }, Rr = [
106
105
  Ot,
106
+ Bt,
107
107
  et,
108
- zt,
109
- St,
108
+ It,
110
109
  wt,
110
+ zt,
111
111
  Ht,
112
- Dt,
113
- At
114
- ], Te = S({
112
+ At,
113
+ Wt
114
+ ], Le = S({
115
115
  fontWeight: "bold"
116
- }), Le = S({
116
+ }), ye = S({
117
117
  fontStyle: "italic"
118
118
  }), xe = S({
119
119
  textDecoration: "underline"
120
- }), ye = S({
120
+ }), Ne = S({
121
121
  listStyleType: "none"
122
122
  }), Ee = S({
123
123
  borderLeft: "4px solid #ccc",
@@ -125,22 +125,22 @@ const ke = ({
125
125
  fontStyle: "italic",
126
126
  margin: "1.5em 10px",
127
127
  padding: "0.5em 10px"
128
- }), Ne = {
128
+ }), Se = {
129
129
  quote: Ee().className,
130
130
  text: {
131
- bold: Te().className,
132
- italic: Le().className,
131
+ bold: Le().className,
132
+ italic: ye().className,
133
133
  underline: xe().className
134
134
  },
135
135
  list: {
136
136
  nested: {
137
- listitem: ye().className
137
+ listitem: Ne().className
138
138
  }
139
139
  }
140
- }, ut = Ut({ hasFocus: !1, editorRef: { current: null } }), Se = ({ onBlur: t }) => {
141
- const [e, o] = M(!1), n = ot(null), a = b(() => {
140
+ }, ut = Yt({ hasFocus: !1, editorRef: { current: null } }), we = ({ onBlur: t }) => {
141
+ const [e, o] = M(!1), n = ot(null), a = C(() => {
142
142
  o(!0), n.current && window.clearTimeout(n.current);
143
- }, []), l = b(() => {
143
+ }, []), l = C(() => {
144
144
  n.current = window.setTimeout(() => {
145
145
  o(!1), t == null || t();
146
146
  }, 0);
@@ -152,56 +152,56 @@ const ke = ({
152
152
  onBlur: l
153
153
  }
154
154
  };
155
- }, pt = () => Yt(ut);
156
- function we(t) {
155
+ }, pt = () => qt(ut);
156
+ function ze(t) {
157
157
  return c({ 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);
158
158
  }
159
- function ze(t) {
159
+ function Ie(t) {
160
160
  return c({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 8l-4 4l4 4" } }, { tag: "path", attr: { d: "M17 8l4 4l-4 4" } }, { tag: "path", attr: { d: "M14 4l-4 16" } }] })(t);
161
161
  }
162
- function Ie(t) {
162
+ function _e(t) {
163
163
  return c({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 18v-8l-2 2" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
164
164
  }
165
165
  function $e(t) {
166
166
  return c({ 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);
167
167
  }
168
- function _e(t) {
168
+ function Re(t) {
169
169
  return c({ 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);
170
170
  }
171
- function Re(t) {
171
+ function Oe(t) {
172
172
  return c({ 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);
173
173
  }
174
- function Oe(t) {
174
+ function Be(t) {
175
175
  return c({ 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);
176
176
  }
177
- function Be(t) {
177
+ function Pe(t) {
178
178
  return c({ 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);
179
179
  }
180
180
  function Fe(t) {
181
181
  return c({ 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);
182
182
  }
183
- function Pe(t) {
183
+ function De(t) {
184
184
  return c({ 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);
185
185
  }
186
186
  function He(t) {
187
187
  return c({ 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);
188
188
  }
189
- function De(t) {
189
+ function Ae(t) {
190
190
  return c({ 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);
191
191
  }
192
- function Ae(t) {
192
+ function We(t) {
193
193
  return c({ 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);
194
194
  }
195
- function We(t) {
195
+ function je(t) {
196
196
  return c({ 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);
197
197
  }
198
- function je(t) {
198
+ function Ke(t) {
199
199
  return c({ 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);
200
200
  }
201
- function Ke(t) {
201
+ function Ue(t) {
202
202
  return c({ 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);
203
203
  }
204
- const Ue = at("div", {
204
+ const Ye = at("div", {
205
205
  width: "10rem",
206
206
  display: "flex"
207
207
  }), gt = {
@@ -216,22 +216,22 @@ const Ue = at("div", {
216
216
  paragraph: "Normal",
217
217
  quote: "Sitat",
218
218
  check: "Avkrysningsliste"
219
- }, Ye = {
220
- bullet: /* @__PURE__ */ r(Ae, { size: "1.25rem" }),
221
- h1: /* @__PURE__ */ r(Ie, { size: "1.25rem" }),
219
+ }, qe = {
220
+ bullet: /* @__PURE__ */ r(We, { size: "1.25rem" }),
221
+ h1: /* @__PURE__ */ r(_e, { size: "1.25rem" }),
222
222
  h2: /* @__PURE__ */ r($e, { size: "1.25rem" }),
223
- h3: /* @__PURE__ */ r(_e, { size: "1.25rem" }),
224
- h4: /* @__PURE__ */ r(Re, { size: "1.25rem" }),
225
- h5: /* @__PURE__ */ r(Oe, { size: "1.25rem" }),
226
- h6: /* @__PURE__ */ r(Be, { size: "1.25rem" }),
227
- number: /* @__PURE__ */ r(De, { size: "1.25rem" }),
223
+ h3: /* @__PURE__ */ r(Re, { size: "1.25rem" }),
224
+ h4: /* @__PURE__ */ r(Oe, { size: "1.25rem" }),
225
+ h5: /* @__PURE__ */ r(Be, { size: "1.25rem" }),
226
+ h6: /* @__PURE__ */ r(Pe, { size: "1.25rem" }),
227
+ number: /* @__PURE__ */ r(Ae, { size: "1.25rem" }),
228
228
  check: /* @__PURE__ */ r(He, { size: "1.25rem" }),
229
- paragraph: /* @__PURE__ */ r(Pe, { size: "1.25rem" }),
230
- quote: /* @__PURE__ */ r(We, { size: "1.25rem" })
231
- }, f = ({
229
+ paragraph: /* @__PURE__ */ r(De, { size: "1.25rem" }),
230
+ quote: /* @__PURE__ */ r(je, { size: "1.25rem" })
231
+ }, m = ({
232
232
  blockType: t
233
- }) => /* @__PURE__ */ C(U, { children: [
234
- /* @__PURE__ */ r(R, { css: { display: "flex", flex: "0 0 auto" }, children: Ye[t] }),
233
+ }) => /* @__PURE__ */ b(U, { children: [
234
+ /* @__PURE__ */ r(R, { css: { display: "flex", flex: "0 0 auto" }, children: qe[t] }),
235
235
  /* @__PURE__ */ r(
236
236
  R,
237
237
  {
@@ -244,36 +244,36 @@ const Ue = at("div", {
244
244
  children: gt[t]
245
245
  }
246
246
  )
247
- ] }), qe = (t) => {
248
- if (!x(t))
247
+ ] }), Xe = (t) => {
248
+ if (!L(t))
249
249
  return null;
250
250
  const e = t.anchor.getNode();
251
251
  let o = e.getKey() === "root" ? e : dt(e, (n) => {
252
252
  const a = n.getParent();
253
- return a !== null && Ct(a);
253
+ return a !== null && bt(a);
254
254
  });
255
255
  return o === null && (o = e.getTopLevelElementOrThrow()), {
256
256
  anchorNode: e,
257
257
  element: o
258
258
  };
259
- }, Xe = () => {
260
- const [t] = F(), [e, o] = M("paragraph");
261
- N(() => t.registerCommand(
259
+ }, Ge = () => {
260
+ const [t] = P(), [e, o] = M("paragraph");
261
+ E(() => t.registerCommand(
262
262
  W,
263
263
  () => {
264
- const s = L(), g = qe(s);
264
+ const s = T(), g = Xe(s);
265
265
  if (!g)
266
266
  return !1;
267
267
  const { element: p, anchorNode: v } = g, w = p.getKey();
268
268
  if (t.getElementByKey(w) !== null)
269
269
  if (K(p)) {
270
- const k = he(
270
+ const k = ue(
271
271
  v,
272
272
  et
273
273
  ), I = k ? k.getListType() : p.getListType();
274
274
  o(I);
275
275
  } else {
276
- const k = Bt(p) ? p.getTag() : p.getType();
276
+ const k = Pt(p) ? p.getTag() : p.getType();
277
277
  k in gt && o(k);
278
278
  }
279
279
  return !1;
@@ -282,60 +282,60 @@ const Ue = at("div", {
282
282
  ), [t]);
283
283
  const n = (s) => {
284
284
  e !== s && t.update(() => {
285
- const g = L();
286
- (x(g) || P(g)) && (H(g, () => Ft(s)), o(s));
285
+ const g = T();
286
+ (L(g) || F(g)) && (D(g, () => Ft(s)), o(s));
287
287
  });
288
288
  };
289
- return /* @__PURE__ */ r(Ue, { children: /* @__PURE__ */ C(
289
+ return /* @__PURE__ */ r(Ye, { children: /* @__PURE__ */ b(
290
290
  it,
291
291
  {
292
292
  trigger: /* @__PURE__ */ r(
293
- Xt,
293
+ Gt,
294
294
  {
295
295
  dropdown: !0,
296
296
  css: { display: "flex", width: "100%", overflow: "hidden" },
297
- children: /* @__PURE__ */ r(f, { blockType: e })
297
+ children: /* @__PURE__ */ r(m, { blockType: e })
298
298
  }
299
299
  ),
300
300
  side: "bottom",
301
301
  align: "start",
302
302
  children: [
303
- /* @__PURE__ */ r(m, { onClick: () => {
303
+ /* @__PURE__ */ r(f, { onClick: () => {
304
304
  e !== "paragraph" && t.update(() => {
305
- const s = L();
306
- (x(s) || P(s)) && (H(s, () => B()), o("paragraph"));
305
+ const s = T();
306
+ (L(s) || F(s)) && (D(s, () => B()), o("paragraph"));
307
307
  });
308
- }, children: /* @__PURE__ */ r(f, { blockType: "paragraph" }) }),
309
- /* @__PURE__ */ r(m, { onClick: () => n("h1"), children: /* @__PURE__ */ r(f, { blockType: "h1" }) }),
310
- /* @__PURE__ */ r(m, { onClick: () => n("h2"), children: /* @__PURE__ */ r(f, { blockType: "h2" }) }),
311
- /* @__PURE__ */ r(m, { onClick: () => n("h3"), children: /* @__PURE__ */ r(f, { blockType: "h3" }) }),
312
- /* @__PURE__ */ r(m, { onClick: () => n("h4"), children: /* @__PURE__ */ r(f, { blockType: "h4" }) }),
313
- /* @__PURE__ */ r(m, { onClick: () => n("h5"), children: /* @__PURE__ */ r(f, { blockType: "h5" }) }),
314
- /* @__PURE__ */ r(m, { onClick: () => n("h6"), children: /* @__PURE__ */ r(f, { blockType: "h6" }) }),
315
- /* @__PURE__ */ r(m, { onClick: () => {
316
- e !== "bullet" && (t.dispatchCommand(It, void 0), o("bullet"));
317
- }, children: /* @__PURE__ */ r(f, { blockType: "bullet" }) }),
318
- /* @__PURE__ */ r(m, { onClick: () => {
308
+ }, children: /* @__PURE__ */ r(m, { blockType: "paragraph" }) }),
309
+ /* @__PURE__ */ r(f, { onClick: () => n("h1"), children: /* @__PURE__ */ r(m, { blockType: "h1" }) }),
310
+ /* @__PURE__ */ r(f, { onClick: () => n("h2"), children: /* @__PURE__ */ r(m, { blockType: "h2" }) }),
311
+ /* @__PURE__ */ r(f, { onClick: () => n("h3"), children: /* @__PURE__ */ r(m, { blockType: "h3" }) }),
312
+ /* @__PURE__ */ r(f, { onClick: () => n("h4"), children: /* @__PURE__ */ r(m, { blockType: "h4" }) }),
313
+ /* @__PURE__ */ r(f, { onClick: () => n("h5"), children: /* @__PURE__ */ r(m, { blockType: "h5" }) }),
314
+ /* @__PURE__ */ r(f, { onClick: () => n("h6"), children: /* @__PURE__ */ r(m, { blockType: "h6" }) }),
315
+ /* @__PURE__ */ r(f, { onClick: () => {
316
+ e !== "bullet" && (t.dispatchCommand(_t, void 0), o("bullet"));
317
+ }, children: /* @__PURE__ */ r(m, { blockType: "bullet" }) }),
318
+ /* @__PURE__ */ r(f, { onClick: () => {
319
319
  e !== "number" && (t.dispatchCommand($t, void 0), o("number"));
320
- }, children: /* @__PURE__ */ r(f, { blockType: "number" }) }),
321
- /* @__PURE__ */ r(m, { onClick: () => {
320
+ }, children: /* @__PURE__ */ r(m, { blockType: "number" }) }),
321
+ /* @__PURE__ */ r(f, { onClick: () => {
322
322
  e !== "check" && (t.dispatchCommand(rt, void 0), o("check"));
323
- }, children: /* @__PURE__ */ r(f, { blockType: "check" }) }),
324
- /* @__PURE__ */ r(m, { onClick: () => {
323
+ }, children: /* @__PURE__ */ r(m, { blockType: "check" }) }),
324
+ /* @__PURE__ */ r(f, { onClick: () => {
325
325
  e !== "quote" && t.update(() => {
326
- const s = L();
327
- (x(s) || P(s)) && (H(s, () => Pt()), o("quote"));
326
+ const s = T();
327
+ (L(s) || F(s)) && (D(s, () => Dt()), o("quote"));
328
328
  });
329
- }, children: /* @__PURE__ */ r(f, { blockType: "quote" }) })
329
+ }, children: /* @__PURE__ */ r(m, { blockType: "quote" }) })
330
330
  ]
331
331
  }
332
332
  ) });
333
- }, Ge = () => {
334
- const [t] = F(), [e, o] = M(!1), [n, a] = M(!1), [l, i] = M(!1), [d, h] = M(!1), [s, g] = M(!1), p = b(() => {
335
- const u = L();
336
- x(u) && (o(u.hasFormat("bold")), a(u.hasFormat("italic")), i(u.hasFormat("underline")), h(u.hasFormat("code")), g(u.hasFormat("superscript")));
333
+ }, Qe = () => {
334
+ const [t] = P(), [e, o] = M(!1), [n, a] = M(!1), [l, i] = M(!1), [d, h] = M(!1), [s, g] = M(!1), p = C(() => {
335
+ const u = T();
336
+ L(u) && (o(u.hasFormat("bold")), a(u.hasFormat("italic")), i(u.hasFormat("underline")), h(u.hasFormat("code")), g(u.hasFormat("superscript")));
337
337
  }, []);
338
- N(() => ct(
338
+ E(() => ct(
339
339
  t.registerCommand(
340
340
  W,
341
341
  () => (p(), !1),
@@ -347,43 +347,43 @@ const Ue = at("div", {
347
347
  });
348
348
  })
349
349
  ), [t, p]);
350
- const v = b(
351
- () => t.dispatchCommand($, "bold"),
350
+ const v = C(
351
+ () => t.dispatchCommand(_, "bold"),
352
352
  [t]
353
- ), w = b(
354
- () => t.dispatchCommand($, "italic"),
353
+ ), w = C(
354
+ () => t.dispatchCommand(_, "italic"),
355
355
  [t]
356
- ), z = b(
357
- () => t.dispatchCommand($, "underline"),
356
+ ), z = C(
357
+ () => t.dispatchCommand(_, "underline"),
358
358
  [t]
359
- ), k = b(
360
- () => t.dispatchCommand($, "code"),
359
+ ), k = C(
360
+ () => t.dispatchCommand(_, "code"),
361
361
  [t]
362
- ), I = b(
363
- () => t.dispatchCommand($, "superscript"),
362
+ ), I = C(
363
+ () => t.dispatchCommand(_, "superscript"),
364
364
  [t]
365
- ), mt = nt(() => {
365
+ ), ft = nt(() => {
366
366
  const u = [];
367
367
  return e && u.push("bold"), n && u.push("italic"), l && u.push("underline"), d && u.push("code"), s && u.push("superscript"), u;
368
368
  }, [e, n, l, d, s]);
369
- return /* @__PURE__ */ C(
370
- Gt,
369
+ return /* @__PURE__ */ b(
370
+ Qt,
371
371
  {
372
372
  type: "multiple",
373
373
  "aria-label": "Tekstformattering",
374
- value: mt,
374
+ value: ft,
375
375
  children: [
376
376
  /* @__PURE__ */ r(
377
- _,
377
+ $,
378
378
  {
379
379
  onClick: v,
380
380
  title: "Fet tekst",
381
381
  value: "bold",
382
- children: /* @__PURE__ */ r(we, { size: "1.25rem" })
382
+ children: /* @__PURE__ */ r(ze, { size: "1.25rem" })
383
383
  }
384
384
  ),
385
385
  /* @__PURE__ */ r(
386
- _,
386
+ $,
387
387
  {
388
388
  onClick: w,
389
389
  title: "Kursiv tekst",
@@ -392,54 +392,54 @@ const Ue = at("div", {
392
392
  }
393
393
  ),
394
394
  /* @__PURE__ */ r(
395
- _,
395
+ $,
396
396
  {
397
397
  onClick: z,
398
398
  title: "Understreket tekst",
399
399
  value: "underline",
400
- children: /* @__PURE__ */ r(Ke, { size: "1.25rem" })
400
+ children: /* @__PURE__ */ r(Ue, { size: "1.25rem" })
401
401
  }
402
402
  ),
403
403
  /* @__PURE__ */ r(
404
- _,
404
+ $,
405
405
  {
406
406
  onClick: k,
407
407
  title: "Kode",
408
408
  value: "code",
409
- children: /* @__PURE__ */ r(ze, { size: "1.25rem" })
409
+ children: /* @__PURE__ */ r(Ie, { size: "1.25rem" })
410
410
  }
411
411
  ),
412
412
  /* @__PURE__ */ r(
413
- _,
413
+ $,
414
414
  {
415
415
  onClick: I,
416
416
  title: "Superscript",
417
417
  value: "superscript",
418
- children: /* @__PURE__ */ r(je, { size: "1.25rem" })
418
+ children: /* @__PURE__ */ r(Ke, { size: "1.25rem" })
419
419
  }
420
420
  )
421
421
  ]
422
422
  }
423
423
  );
424
- }, Qe = ({ children: t }) => {
424
+ }, Ve = ({ children: t }) => {
425
425
  const { hasFocus: e, editorRef: o } = pt(), n = e, [a, l] = M(n);
426
- qt(() => {
426
+ Xt(() => {
427
427
  l(n);
428
428
  }, [n]);
429
429
  const { context: i, refs: d, floatingStyles: h } = lt({
430
430
  placement: "top",
431
- whileElementsMounted: Qt,
431
+ whileElementsMounted: Vt,
432
432
  middleware: [
433
- Vt({
433
+ Jt({
434
434
  apply: ({ rects: g, elements: p }) => {
435
435
  p.floating.style.minWidth = `${g.reference.width}px`;
436
436
  }
437
437
  }),
438
- Jt(),
438
+ Zt(),
439
439
  st({
440
440
  mainAxis: 8
441
441
  }),
442
- Zt({
442
+ te({
443
443
  padding: 8
444
444
  })
445
445
  ],
@@ -448,13 +448,13 @@ const Ue = at("div", {
448
448
  elements: {
449
449
  reference: o.current
450
450
  }
451
- }), { getFloatingProps: s } = te([
452
- ee(i, {
451
+ }), { getFloatingProps: s } = ee([
452
+ re(i, {
453
453
  role: "dialog"
454
454
  })
455
455
  ]);
456
- return a ? /* @__PURE__ */ r(re, { children: /* @__PURE__ */ r(
457
- oe,
456
+ return a ? /* @__PURE__ */ r(oe, { children: /* @__PURE__ */ r(
457
+ ne,
458
458
  {
459
459
  ref: d.setFloating,
460
460
  style: h,
@@ -465,70 +465,70 @@ const Ue = at("div", {
465
465
  overflow: "hidden",
466
466
  boxShadow: "$md"
467
467
  },
468
- children: /* @__PURE__ */ r(Ve, { children: t })
468
+ children: /* @__PURE__ */ r(Je, { children: t })
469
469
  }
470
470
  ) }) : null;
471
- }, Ve = ({
471
+ }, Je = ({
472
472
  children: t,
473
473
  ...e
474
- }) => /* @__PURE__ */ C(ne, { "aria-label": "Formattering", ...e, children: [
475
- /* @__PURE__ */ r(Xe, {}),
476
- /* @__PURE__ */ r(ae, {}),
474
+ }) => /* @__PURE__ */ b(ae, { "aria-label": "Formattering", ...e, children: [
477
475
  /* @__PURE__ */ r(Ge, {}),
476
+ /* @__PURE__ */ r(ie, {}),
477
+ /* @__PURE__ */ r(Qe, {}),
478
478
  t
479
479
  ] });
480
- function Je() {
481
- const [t] = F();
482
- return N(() => ct(
480
+ function Ze() {
481
+ const [t] = P();
482
+ return E(() => ct(
483
483
  t.registerCommand(
484
484
  rt,
485
- () => (_t(t, "check"), !0),
486
- T
485
+ () => (Rt(t, "check"), !0),
486
+ y
487
487
  ),
488
488
  t.registerCommand(
489
489
  vt,
490
490
  (e) => J(e, t, !1),
491
- T
491
+ y
492
492
  ),
493
493
  t.registerCommand(
494
494
  Tt,
495
495
  (e) => J(e, t, !0),
496
- T
496
+ y
497
497
  ),
498
498
  t.registerCommand(
499
499
  Lt,
500
500
  (e) => {
501
- if (D() != null) {
501
+ if (H() != null) {
502
502
  const n = t.getRootElement();
503
503
  return n != null && n.focus(), !0;
504
504
  }
505
505
  return !1;
506
506
  },
507
- T
507
+ y
508
508
  ),
509
509
  t.registerCommand(
510
- xt,
510
+ yt,
511
511
  (e) => {
512
- const o = D();
512
+ const o = H();
513
513
  return o != null && t.isEditable() ? (t.update(() => {
514
514
  const n = j(o);
515
- E(n) && (e.preventDefault(), n.toggleChecked());
515
+ N(n) && (e.preventDefault(), n.toggleChecked());
516
516
  }), !0) : !1;
517
517
  },
518
- T
518
+ y
519
519
  ),
520
520
  t.registerCommand(
521
- yt,
521
+ xt,
522
522
  (e) => t.getEditorState().read(() => {
523
- const o = L();
524
- if (x(o) && o.isCollapsed()) {
523
+ const o = T();
524
+ if (L(o) && o.isCollapsed()) {
525
525
  const { anchor: n } = o, a = n.type === "element";
526
526
  if (a || n.offset === 0) {
527
527
  const l = n.getNode(), i = dt(
528
528
  l,
529
- (d) => Et(d) && !d.isInline()
529
+ (d) => Nt(d) && !d.isInline()
530
530
  );
531
- if (E(i)) {
531
+ if (N(i)) {
532
532
  const d = i.getParent();
533
533
  if (K(d) && d.getListType() === "check" && (a || i.getFirstDescendant() === l)) {
534
534
  const h = t.getElementByKey(i.__key);
@@ -540,14 +540,14 @@ function Je() {
540
540
  }
541
541
  return !1;
542
542
  }),
543
- T
543
+ y
544
544
  ),
545
545
  t.registerRootListener((e, o) => {
546
546
  e !== null && (e.addEventListener("click", Q), e.addEventListener("pointerdown", V)), o !== null && (o.removeEventListener("click", Q), o.removeEventListener("pointerdown", V));
547
547
  })
548
548
  ), [t]), null;
549
549
  }
550
- function ft(t, e) {
550
+ function mt(t, e) {
551
551
  const o = t.target;
552
552
  if (o === null || !G(o))
553
553
  return;
@@ -561,22 +561,22 @@ function ft(t, e) {
561
561
  (o.dir === "rtl" ? l < i.right && l > i.right - 20 : l > i.left && l < i.left + 20) && e();
562
562
  }
563
563
  function Q(t) {
564
- ft(t, () => {
565
- const e = t.target, o = Ze(e);
564
+ mt(t, () => {
565
+ const e = t.target, o = tr(e);
566
566
  o != null && o.isEditable() && o.update(() => {
567
567
  if (t.target) {
568
568
  const n = j(e);
569
- E(n) && (e.focus(), n.toggleChecked());
569
+ N(n) && (e.focus(), n.toggleChecked());
570
570
  }
571
571
  });
572
572
  });
573
573
  }
574
574
  function V(t) {
575
- ft(t, () => {
575
+ mt(t, () => {
576
576
  t.preventDefault();
577
577
  });
578
578
  }
579
- function Ze(t) {
579
+ function tr(t) {
580
580
  let e = t;
581
581
  for (; e; ) {
582
582
  if (e.__lexicalEditor)
@@ -585,16 +585,16 @@ function Ze(t) {
585
585
  }
586
586
  return null;
587
587
  }
588
- function D() {
588
+ function H() {
589
589
  const t = document.activeElement;
590
590
  return t != null && t.tagName === "LI" && t.parentNode != null && // @ts-ignore internal field
591
591
  t.parentNode.__lexicalListType === "check" ? t : null;
592
592
  }
593
- function tr(t, e) {
593
+ function er(t, e) {
594
594
  let o = e ? t.getPreviousSibling() : t.getNextSibling(), n = t;
595
- for (; o == null && E(n); )
595
+ for (; o == null && N(n); )
596
596
  n = n.getParentOrThrow().getParent(), n != null && (o = e ? n.getPreviousSibling() : n.getNextSibling());
597
- for (; E(o); ) {
597
+ for (; N(o); ) {
598
598
  const a = e ? o.getLastChild() : o.getFirstChild();
599
599
  if (!K(a))
600
600
  return o;
@@ -603,12 +603,12 @@ function tr(t, e) {
603
603
  return null;
604
604
  }
605
605
  function J(t, e, o) {
606
- const n = D();
606
+ const n = H();
607
607
  return n != null && e.update(() => {
608
608
  const a = j(n);
609
- if (!E(a))
609
+ if (!N(a))
610
610
  return;
611
- const l = tr(a, o);
611
+ const l = er(a, o);
612
612
  if (l != null) {
613
613
  l.selectStart();
614
614
  const i = e.getElementByKey(l.__key);
@@ -618,25 +618,25 @@ function J(t, e, o) {
618
618
  }
619
619
  }), !1;
620
620
  }
621
- const er = () => /* @__PURE__ */ C(U, { children: [
622
- /* @__PURE__ */ r(ue, {}),
623
- /* @__PURE__ */ r(ge, {}),
621
+ const rr = () => /* @__PURE__ */ b(U, { children: [
624
622
  /* @__PURE__ */ r(pe, {}),
625
- /* @__PURE__ */ r(Je, {}),
623
+ /* @__PURE__ */ r(me, {}),
624
+ /* @__PURE__ */ r(ge, {}),
625
+ /* @__PURE__ */ r(Ze, {}),
626
626
  /* @__PURE__ */ r(fe, {})
627
- ] }), rr = ({
627
+ ] }), or = ({
628
628
  state: t
629
629
  }) => {
630
- const [e] = F();
631
- return N(() => {
630
+ const [e] = P();
631
+ return E(() => {
632
632
  if (t)
633
633
  try {
634
634
  if (be(t)) {
635
- t.isEmpty() ? Ce(e) : e.setEditorState(t);
635
+ t.isEmpty() ? ve(e) : e.setEditorState(t);
636
636
  return;
637
637
  }
638
638
  if (typeof t == "string" && !ht(t)) {
639
- ve(t, e);
639
+ Te(t, e);
640
640
  return;
641
641
  }
642
642
  const o = e.parseEditorState(t);
@@ -645,7 +645,7 @@ const er = () => /* @__PURE__ */ C(U, { children: [
645
645
  console.error("Could not parse"), console.error(o);
646
646
  }
647
647
  }, []), null;
648
- }, or = at("div", {
648
+ }, nr = at("div", {
649
649
  border: "1px solid $borderDarker",
650
650
  borderRadius: "$md",
651
651
  position: "relative",
@@ -682,7 +682,7 @@ const er = () => /* @__PURE__ */ C(U, { children: [
682
682
  }
683
683
  }
684
684
  ]
685
- }), nr = ({
685
+ }), ar = ({
686
686
  isLoading: t
687
687
  }) => /* @__PURE__ */ r(
688
688
  R,
@@ -694,9 +694,9 @@ const er = () => /* @__PURE__ */ C(U, { children: [
694
694
  right: "1rem",
695
695
  display: "flex"
696
696
  },
697
- children: /* @__PURE__ */ r(ie, {})
697
+ children: /* @__PURE__ */ r(le, {})
698
698
  }
699
- ), Rr = ({
699
+ ), Or = ({
700
700
  isLoading: t,
701
701
  children: e,
702
702
  placeholderText: o,
@@ -710,22 +710,22 @@ const er = () => /* @__PURE__ */ C(U, { children: [
710
710
  defaultState: g,
711
711
  css: p
712
712
  }) => {
713
- const { hasFocus: v, attributes: w } = Se({ onBlur: s }), z = ot(null), k = nt(() => ({ hasFocus: v, editorRef: z }), [v]);
714
- return /* @__PURE__ */ r(ut.Provider, { value: k, children: /* @__PURE__ */ C(
715
- se,
713
+ const { hasFocus: v, attributes: w } = we({ onBlur: s }), z = ot(null), k = nt(() => ({ hasFocus: v, editorRef: z }), [v]);
714
+ return /* @__PURE__ */ r(ut.Provider, { value: k, children: /* @__PURE__ */ b(
715
+ de,
716
716
  {
717
717
  initialConfig: {
718
718
  namespace: "CommentEditor",
719
719
  onError: (I) => {
720
720
  console.error(I);
721
721
  },
722
- theme: Ne,
722
+ theme: Se,
723
723
  nodes: n,
724
724
  editable: !0
725
725
  },
726
726
  children: [
727
- /* @__PURE__ */ C(
728
- or,
727
+ /* @__PURE__ */ b(
728
+ nr,
729
729
  {
730
730
  ref: z,
731
731
  hasFocus: v,
@@ -735,7 +735,7 @@ const er = () => /* @__PURE__ */ C(U, { children: [
735
735
  children: [
736
736
  l,
737
737
  /* @__PURE__ */ r(
738
- de,
738
+ ce,
739
739
  {
740
740
  contentEditable: d,
741
741
  placeholder: o ? /* @__PURE__ */ r(
@@ -752,22 +752,22 @@ const er = () => /* @__PURE__ */ C(U, { children: [
752
752
  children: o
753
753
  }
754
754
  ) : null,
755
- ErrorBoundary: ce
755
+ ErrorBoundary: he
756
756
  }
757
757
  ),
758
- /* @__PURE__ */ r(er, {}),
758
+ /* @__PURE__ */ r(rr, {}),
759
759
  a,
760
- /* @__PURE__ */ r(nr, { isLoading: t }),
761
- !l && /* @__PURE__ */ r(Qe, { children: i })
760
+ /* @__PURE__ */ r(ar, { isLoading: t }),
761
+ !l && /* @__PURE__ */ r(Ve, { children: i })
762
762
  ]
763
763
  }
764
764
  ),
765
- /* @__PURE__ */ r(rr, { state: g }),
765
+ /* @__PURE__ */ r(or, { state: g }),
766
766
  /* @__PURE__ */ r(U, { children: e })
767
767
  ]
768
768
  }
769
769
  ) });
770
- }, Or = S({
770
+ }, Br = S({
771
771
  fontSize: "1rem",
772
772
  lineHeight: "1.5",
773
773
  "h1, h2, h3, h4, h5, h6": {
@@ -809,7 +809,15 @@ const er = () => /* @__PURE__ */ C(U, { children: [
809
809
  fontWeight: "$bold"
810
810
  },
811
811
  "ul, ol": {
812
- paddingLeft: "1.8em"
812
+ paddingLeft: "1.8em",
813
+ listStylePosition: "inside",
814
+ listStyleImage: "none"
815
+ },
816
+ ul: {
817
+ listStyleType: "disc"
818
+ },
819
+ ol: {
820
+ listStyleType: "decimal"
813
821
  },
814
822
  th: {
815
823
  fontWeight: "$medium",
@@ -921,12 +929,12 @@ const er = () => /* @__PURE__ */ C(U, { children: [
921
929
  size: "md"
922
930
  }
923
931
  });
924
- function ar(t) {
932
+ function ir(t) {
925
933
  return c({ 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);
926
934
  }
927
- const Br = () => {
928
- const [t] = me(), [e, o] = M(null), { hasFocus: n } = pt();
929
- N(() => {
935
+ const Pr = () => {
936
+ const [t] = ke(), [e, o] = M(null), { hasFocus: n } = pt();
937
+ E(() => {
930
938
  !n && e && o(null);
931
939
  }, [n, e]);
932
940
  const { refs: a, floatingStyles: l } = lt({
@@ -937,17 +945,17 @@ const Br = () => {
937
945
  },
938
946
  middleware: [st({ mainAxis: -20, crossAxis: -2 })]
939
947
  });
940
- N(() => t.registerCommand(
948
+ E(() => t.registerCommand(
941
949
  W,
942
950
  () => {
943
- const d = L();
944
- if (x(d)) {
945
- const h = d.anchor.getNode(), s = Wt(h);
951
+ const d = T();
952
+ if (L(d)) {
953
+ const h = d.anchor.getNode(), s = jt(h);
946
954
  o(s ? t.getElementByKey(s.getKey()) : null);
947
955
  }
948
956
  return !1;
949
957
  },
950
- T
958
+ Et
951
959
  ), [t]);
952
960
  const i = (d) => () => {
953
961
  t.update(() => {
@@ -965,19 +973,19 @@ const Br = () => {
965
973
  Y(!0);
966
974
  break;
967
975
  case "delete-row":
968
- Kt();
976
+ Ut();
969
977
  break;
970
978
  case "delete-column":
971
- jt();
979
+ Kt();
972
980
  break;
973
981
  }
974
982
  });
975
983
  };
976
- return e ? /* @__PURE__ */ C(
984
+ return e ? /* @__PURE__ */ b(
977
985
  it,
978
986
  {
979
987
  trigger: /* @__PURE__ */ r(
980
- le,
988
+ se,
981
989
  {
982
990
  icon: !0,
983
991
  variant: "primary",
@@ -985,35 +993,35 @@ const Br = () => {
985
993
  ref: a.setFloating,
986
994
  style: l,
987
995
  css: { padding: "2px", width: "18px", height: "18px" },
988
- children: /* @__PURE__ */ r(ar, {})
996
+ children: /* @__PURE__ */ r(ir, {})
989
997
  }
990
998
  ),
991
999
  children: [
992
- /* @__PURE__ */ r(y, { onClick: i("add-row-over"), children: "Legg til rad over" }),
993
- /* @__PURE__ */ r(y, { onClick: i("add-row-under"), children: "Legg til rad under" }),
1000
+ /* @__PURE__ */ r(x, { onClick: i("add-row-over"), children: "Legg til rad over" }),
1001
+ /* @__PURE__ */ r(x, { onClick: i("add-row-under"), children: "Legg til rad under" }),
994
1002
  /* @__PURE__ */ r(X, {}),
995
- /* @__PURE__ */ r(y, { onClick: i("add-column-left"), children: "Legg til kolumne venstre" }),
996
- /* @__PURE__ */ r(y, { onClick: i("add-column-right"), children: "Legg til kolumne høyre" }),
1003
+ /* @__PURE__ */ r(x, { onClick: i("add-column-left"), children: "Legg til kolumne venstre" }),
1004
+ /* @__PURE__ */ r(x, { onClick: i("add-column-right"), children: "Legg til kolumne høyre" }),
997
1005
  /* @__PURE__ */ r(X, {}),
998
- /* @__PURE__ */ r(y, { onClick: i("delete-row"), children: "Fjern rad" }),
999
- /* @__PURE__ */ r(y, { onClick: i("delete-column"), children: "Fjern kolumne" })
1006
+ /* @__PURE__ */ r(x, { onClick: i("delete-row"), children: "Fjern rad" }),
1007
+ /* @__PURE__ */ r(x, { onClick: i("delete-column"), children: "Fjern kolumne" })
1000
1008
  ]
1001
1009
  }
1002
1010
  ) : null;
1003
1011
  };
1004
1012
  export {
1005
- Qe as FloatingToolbar,
1006
- Rr as RichTextEditor,
1007
- Ve as RichTextToolbar,
1008
- Br as TableEditPlugin,
1009
- Ce as clearEditorState,
1010
- _r as defaultNodes,
1013
+ Ve as FloatingToolbar,
1014
+ Or as RichTextEditor,
1015
+ Je as RichTextToolbar,
1016
+ Pr as TableEditPlugin,
1017
+ ve as clearEditorState,
1018
+ Rr as defaultNodes,
1011
1019
  be as isEditorState,
1012
1020
  ht as isJSON,
1013
1021
  ut as richTextContext,
1014
- Or as richTextCss,
1015
- ve as setStateFromPlainText,
1022
+ Br as richTextCss,
1023
+ Te as setStateFromPlainText,
1016
1024
  $r as stateToHTML,
1017
- Se as useHasFocusWithin,
1025
+ we as useHasFocusWithin,
1018
1026
  pt as useRichTextContext
1019
1027
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkitektbedriftene/fe-lib",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {