@arkitektbedriftene/fe-lib 0.4.26 → 0.4.27

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.
@@ -4032,16 +4032,16 @@ export {
4032
4032
  ws as Y,
4033
4033
  bs as a,
4034
4034
  ns as b,
4035
- Ve as c,
4036
- is as d,
4037
- Rr as e,
4038
- Ui as f,
4039
- Er as g,
4040
- Cr as h,
4041
- pi as i,
4042
- bi as j,
4043
- ts as k,
4044
- os as l,
4035
+ is as c,
4036
+ Rr as d,
4037
+ Ui as e,
4038
+ Er as f,
4039
+ Cr as g,
4040
+ pi as h,
4041
+ bi as i,
4042
+ ts as j,
4043
+ os as k,
4044
+ Ve as l,
4045
4045
  un as m,
4046
4046
  hs as n,
4047
4047
  ir as o,
@@ -144,6 +144,13 @@ export declare const richTextStyleObj: {
144
144
  borderRadius: string;
145
145
  };
146
146
  };
147
+ ".ain-rich-text-quote": {
148
+ borderLeft: string;
149
+ color: string;
150
+ fontStyle: string;
151
+ margin: string;
152
+ padding: string;
153
+ };
147
154
  variants: {
148
155
  size: {
149
156
  xs: {
@@ -1,23 +1,23 @@
1
- var Ht = Object.defineProperty;
2
- var Wt = (t, r, e) => r in t ? Ht(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
3
- var it = (t, r, e) => (Wt(t, typeof r != "symbol" ? r + "" : r, e), e);
4
- import { createHeadlessEditor as Ut } from "@lexical/headless";
5
- import { $generateHtmlFromNodes as jt } from "@lexical/html";
6
- import { $getRoot as U, ParagraphNode as Kt, $createParagraphNode as j, $createTextNode as A, $setSelection as ft, SELECTION_CHANGE_COMMAND as P, $getSelection as T, COMMAND_PRIORITY_CRITICAL as X, $isRangeSelection as L, $isRootOrShadowRoot as qt, FORMAT_TEXT_COMMAND as B, COMMAND_PRIORITY_LOW as w, KEY_ARROW_DOWN_COMMAND as Yt, KEY_ARROW_UP_COMMAND as Gt, KEY_ESCAPE_COMMAND as mt, KEY_SPACE_COMMAND as Xt, $getNearestNodeFromDOMNode as Q, KEY_ARROW_LEFT_COMMAND as Qt, $isElementNode as Jt, COMMAND_PRIORITY_NORMAL as Vt, $isParagraphNode as Zt, COMMAND_PRIORITY_HIGH as te } from "lexical";
7
- import { trimTextContentFromAnchor as ee, $setBlocksType as Y, $isAtNodeEnd as at } from "@lexical/selection";
8
- import { c as kt, s as bt, D as J, T as vt, a as C, B as D, b as Mt, d as I, u as V, e as Ct, f as re, g as ne, o as Tt, h as oe, i as Lt, j as xt, F as yt, O as Nt, k as ie, l as ae, S as le, m as z, n as _, p as lt, q as se, N as ce, r as st, t as de, v as St, C as ue, w as he, x as pe } from "./Checkbox-404e0375.js";
1
+ var Ft = Object.defineProperty;
2
+ var Ht = (t, r, e) => r in t ? Ft(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
3
+ var it = (t, r, e) => (Ht(t, typeof r != "symbol" ? r + "" : r, e), e);
4
+ import { createHeadlessEditor as Wt } from "@lexical/headless";
5
+ import { $generateHtmlFromNodes as Ut } from "@lexical/html";
6
+ import { $getRoot as U, ParagraphNode as jt, $createParagraphNode as j, $createTextNode as A, $setSelection as ft, SELECTION_CHANGE_COMMAND as P, $getSelection as T, COMMAND_PRIORITY_CRITICAL as X, $isRangeSelection as L, $isRootOrShadowRoot as Kt, FORMAT_TEXT_COMMAND as B, COMMAND_PRIORITY_LOW as w, KEY_ARROW_DOWN_COMMAND as qt, KEY_ARROW_UP_COMMAND as Yt, KEY_ESCAPE_COMMAND as mt, KEY_SPACE_COMMAND as Gt, $getNearestNodeFromDOMNode as Q, KEY_ARROW_LEFT_COMMAND as Xt, $isElementNode as Qt, COMMAND_PRIORITY_NORMAL as Jt, $isParagraphNode as Vt, COMMAND_PRIORITY_HIGH as Zt } from "lexical";
7
+ import { trimTextContentFromAnchor as te, $setBlocksType as Y, $isAtNodeEnd as at } from "@lexical/selection";
8
+ import { AutoLinkNode as ee, LinkNode as kt, $isLinkNode as H, TOGGLE_LINK_COMMAND as J } from "@lexical/link";
9
+ import { ListNode as bt, ListItemNode as re, $isListNode as V, INSERT_UNORDERED_LIST_COMMAND as ne, INSERT_ORDERED_LIST_COMMAND as oe, INSERT_CHECK_LIST_COMMAND as vt, insertList as ie, $isListItemNode as z } from "@lexical/list";
10
+ import { HeadingNode as ae, QuoteNode as le, $isHeadingNode as se, $createHeadingNode as ce, $createQuoteNode as de } from "@lexical/rich-text";
11
+ import { TableNode as ue, TableRowNode as he, TableCellNode as pe, INSERT_TABLE_COMMAND as ge, $getTableCellNodeFromLexicalNode as fe, $deleteTableColumn__EXPERIMENTAL as me, $deleteTableRow__EXPERIMENTAL as ke, $insertTableColumn__EXPERIMENTAL as lt, $insertTableRow__EXPERIMENTAL as st } from "@lexical/table";
9
12
  import { jsx as n, jsxs as g, Fragment as K } from "react/jsx-runtime";
10
- import { createContext as ge, useState as b, useRef as Z, useCallback as v, useContext as fe, useEffect as x, useMemo as Et, useLayoutEffect as me } from "react";
13
+ import { createContext as be, useState as b, useRef as Z, useCallback as v, useContext as ve, useEffect as x, useMemo as Mt, useLayoutEffect as Me } from "react";
14
+ import { s as Ct, D as tt, T as Tt, a as C, B as D, b as Lt, c as I, u as et, d as xt, e as Ce, f as Te, o as yt, g as Le, h as Nt, i as St, F as Et, O as wt, j as xe, k as ye, S as Ne, l as Se, m as O, n as _, p as ct, q as Ee, N as we, r as dt, t as Re, v as Rt, C as _e, w as Ie, x as ze } from "./Checkbox-48d88d36.js";
11
15
  import "react-select";
12
- import { AutoLinkNode as ke, LinkNode as wt, $isLinkNode as H, TOGGLE_LINK_COMMAND as tt } from "@lexical/link";
13
- import { ListNode as Rt, ListItemNode as be, $isListNode as et, INSERT_UNORDERED_LIST_COMMAND as ve, INSERT_ORDERED_LIST_COMMAND as Me, INSERT_CHECK_LIST_COMMAND as _t, insertList as Ce, $isListItemNode as O } from "@lexical/list";
14
- import { HeadingNode as Te, QuoteNode as Le, $isHeadingNode as xe, $createHeadingNode as ye, $createQuoteNode as Ne } from "@lexical/rich-text";
15
- import { TableNode as Se, TableRowNode as Ee, TableCellNode as we, INSERT_TABLE_COMMAND as Re, $getTableCellNodeFromLexicalNode as _e, $deleteTableColumn__EXPERIMENTAL as Ie, $deleteTableRow__EXPERIMENTAL as ze, $insertTableColumn__EXPERIMENTAL as ct, $insertTableRow__EXPERIMENTAL as dt } from "@lexical/table";
16
16
  import { LexicalComposer as Oe } from "@lexical/react/LexicalComposer.js";
17
17
  import { RichTextPlugin as $e } from "@lexical/react/LexicalRichTextPlugin.js";
18
18
  import Be from "@lexical/react/LexicalErrorBoundary.js";
19
19
  import { useLexicalComposerContext as y } from "@lexical/react/LexicalComposerContext.js";
20
- import { $getNearestNodeOfType as Ae, $findMatchingParent as It, mergeRegister as rt, isHTMLElement as ut } from "@lexical/utils";
20
+ import { $getNearestNodeOfType as Ae, $findMatchingParent as _t, mergeRegister as rt, isHTMLElement as ut } from "@lexical/utils";
21
21
  import { G as h, f as De } from "./index.esm-3266b7f8.js";
22
22
  import { ListPlugin as Pe } from "@lexical/react/LexicalListPlugin.js";
23
23
  import { HistoryPlugin as Fe } from "@lexical/react/LexicalHistoryPlugin.js";
@@ -49,17 +49,11 @@ const Ue = ({
49
49
  maxLines: e
50
50
  }) => {
51
51
  const o = U(), i = o.getTextContent(), l = Ue({ text: i, maxChars: r, maxLines: e }), a = i.length - l, d = o.select().anchor;
52
- ee(t, d, a);
52
+ te(t, d, a);
53
53
  const c = o.getLastChild();
54
- return c instanceof Kt && c.getChildrenSize() === 0 && c.remove(), a;
55
- }, Ke = kt({
56
- borderLeft: "4px solid #ccc",
57
- color: "#666",
58
- fontStyle: "italic",
59
- margin: "1.5em 10px",
60
- padding: "0.5em 10px"
61
- }), zt = {
62
- quote: Ke().className,
54
+ return c instanceof jt && c.getChildrenSize() === 0 && c.remove(), a;
55
+ }, It = {
56
+ quote: "ain-rich-text-quote",
63
57
  text: {
64
58
  bold: "ain-rich-text-bold",
65
59
  italic: "ain-rich-text-italic",
@@ -70,7 +64,7 @@ const Ue = ({
70
64
  listitem: "ain-rich-text-nested-list-item"
71
65
  }
72
66
  }
73
- }, Ot = (t) => t[0] === "{", qe = (t) => t !== null && typeof t == "object" && "isEmpty" in t, Ye = (t, r) => {
67
+ }, zt = (t) => t[0] === "{", Ke = (t) => t !== null && typeof t == "object" && "isEmpty" in t, qe = (t, r) => {
74
68
  t.update(
75
69
  () => {
76
70
  const e = U();
@@ -82,7 +76,7 @@ const Ue = ({
82
76
  tag: r
83
77
  }
84
78
  );
85
- }, Ge = (t, r, e) => {
79
+ }, Ye = (t, r, e) => {
86
80
  r.update(
87
81
  () => {
88
82
  const o = U();
@@ -94,16 +88,16 @@ const Ue = ({
94
88
  tag: e
95
89
  }
96
90
  ), r.blur();
97
- }, cn = (t, r, e) => {
91
+ }, sn = (t, r, e) => {
98
92
  let o = 0;
99
- const i = Ut({
93
+ const i = Wt({
100
94
  nodes: r,
101
95
  editable: !1,
102
- theme: zt
96
+ theme: It
103
97
  });
104
98
  if (t)
105
99
  try {
106
- if (typeof t == "string" && !Ot(t))
100
+ if (typeof t == "string" && !zt(t))
107
101
  i.update(() => {
108
102
  const a = U(), s = j();
109
103
  s.append(A(t.trim())), a.append(s);
@@ -123,19 +117,19 @@ const Ue = ({
123
117
  let l = "";
124
118
  return i.update(() => {
125
119
  var a;
126
- e != null && e.updateFn && ((a = e.updateFn) == null || a.call(e)), l = jt(i);
120
+ e != null && e.updateFn && ((a = e.updateFn) == null || a.call(e)), l = Ut(i);
127
121
  }), { html: l, trimCount: o };
128
- }, dn = [
129
- Te,
130
- Le,
131
- Rt,
132
- be,
133
- ke,
134
- wt,
135
- Se,
136
- Ee,
137
- we
138
- ], $t = ge({ hasFocus: !1, editorRef: { current: null } }), Xe = ({ onBlur: t }) => {
122
+ }, cn = [
123
+ ae,
124
+ le,
125
+ bt,
126
+ re,
127
+ ee,
128
+ kt,
129
+ ue,
130
+ he,
131
+ pe
132
+ ], Ot = be({ hasFocus: !1, editorRef: { current: null } }), Ge = ({ onBlur: t }) => {
139
133
  const [r, e] = b(!1), o = Z(null), i = v(() => {
140
134
  e(!0), o.current && window.clearTimeout(o.current);
141
135
  }, []), l = v(() => {
@@ -150,65 +144,65 @@ const Ue = ({
150
144
  onBlur: l
151
145
  }
152
146
  };
153
- }, nt = () => fe($t);
154
- function Qe(t) {
147
+ }, nt = () => ve(Ot);
148
+ function Xe(t) {
155
149
  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);
156
150
  }
157
- function Je(t) {
151
+ function Qe(t) {
158
152
  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 8l-4 4l4 4" } }, { tag: "path", attr: { d: "M17 8l4 4l-4 4" } }, { tag: "path", attr: { d: "M14 4l-4 16" } }] })(t);
159
153
  }
160
- function Ve(t) {
154
+ function Je(t) {
161
155
  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 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);
162
156
  }
163
- function Ze(t) {
157
+ function Ve(t) {
164
158
  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);
165
159
  }
166
- function tr(t) {
160
+ function Ze(t) {
167
161
  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);
168
162
  }
169
- function er(t) {
163
+ function tr(t) {
170
164
  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);
171
165
  }
172
- function rr(t) {
166
+ function er(t) {
173
167
  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);
174
168
  }
175
- function nr(t) {
169
+ function rr(t) {
176
170
  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);
177
171
  }
178
- function or(t) {
172
+ function nr(t) {
179
173
  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);
180
174
  }
181
- function ir(t) {
175
+ function or(t) {
182
176
  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);
183
177
  }
184
- function ar(t) {
178
+ function ir(t) {
185
179
  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 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5" } }, { tag: "path", attr: { d: "M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5" } }] })(t);
186
180
  }
187
- function lr(t) {
181
+ function ar(t) {
188
182
  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);
189
183
  }
190
- function sr(t) {
184
+ function lr(t) {
191
185
  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);
192
186
  }
193
- function cr(t) {
187
+ function sr(t) {
194
188
  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);
195
189
  }
196
- function dr(t) {
190
+ function cr(t) {
197
191
  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);
198
192
  }
199
- function ur(t) {
193
+ function dr(t) {
200
194
  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);
201
195
  }
202
- function hr(t) {
196
+ function ur(t) {
203
197
  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: "M4 4m0 2a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2z" } }, { tag: "path", attr: { d: "M4 10l16 0" } }, { tag: "path", attr: { d: "M10 4l0 16" } }] })(t);
204
198
  }
205
- function pr(t) {
199
+ function hr(t) {
206
200
  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);
207
201
  }
208
- const gr = bt("div", {
202
+ const pr = Ct("div", {
209
203
  width: "10rem",
210
204
  display: "flex"
211
- }), Bt = {
205
+ }), $t = {
212
206
  bullet: "Punktliste",
213
207
  h1: "Overskrift 1",
214
208
  h2: "Overskrift 2",
@@ -220,22 +214,22 @@ const gr = bt("div", {
220
214
  paragraph: "Normal",
221
215
  quote: "Sitat",
222
216
  check: "Avkrysningsliste"
223
- }, fr = {
224
- bullet: /* @__PURE__ */ n(cr, { size: "1.25rem" }),
225
- h1: /* @__PURE__ */ n(Ve, { size: "1.25rem" }),
226
- h2: /* @__PURE__ */ n(Ze, { size: "1.25rem" }),
227
- h3: /* @__PURE__ */ n(tr, { size: "1.25rem" }),
228
- h4: /* @__PURE__ */ n(er, { size: "1.25rem" }),
229
- h5: /* @__PURE__ */ n(rr, { size: "1.25rem" }),
230
- h6: /* @__PURE__ */ n(nr, { size: "1.25rem" }),
231
- number: /* @__PURE__ */ n(sr, { size: "1.25rem" }),
232
- check: /* @__PURE__ */ n(lr, { size: "1.25rem" }),
233
- paragraph: /* @__PURE__ */ n(ir, { size: "1.25rem" }),
234
- quote: /* @__PURE__ */ n(dr, { size: "1.25rem" })
217
+ }, gr = {
218
+ bullet: /* @__PURE__ */ n(sr, { size: "1.25rem" }),
219
+ h1: /* @__PURE__ */ n(Je, { size: "1.25rem" }),
220
+ h2: /* @__PURE__ */ n(Ve, { size: "1.25rem" }),
221
+ h3: /* @__PURE__ */ n(Ze, { size: "1.25rem" }),
222
+ h4: /* @__PURE__ */ n(tr, { size: "1.25rem" }),
223
+ h5: /* @__PURE__ */ n(er, { size: "1.25rem" }),
224
+ h6: /* @__PURE__ */ n(rr, { size: "1.25rem" }),
225
+ number: /* @__PURE__ */ n(lr, { size: "1.25rem" }),
226
+ check: /* @__PURE__ */ n(ar, { size: "1.25rem" }),
227
+ paragraph: /* @__PURE__ */ n(or, { size: "1.25rem" }),
228
+ quote: /* @__PURE__ */ n(cr, { size: "1.25rem" })
235
229
  }, M = ({
236
230
  blockType: t
237
231
  }) => /* @__PURE__ */ g(K, { children: [
238
- /* @__PURE__ */ n(D, { css: { display: "flex", flex: "0 0 auto" }, children: fr[t] }),
232
+ /* @__PURE__ */ n(D, { css: { display: "flex", flex: "0 0 auto" }, children: gr[t] }),
239
233
  /* @__PURE__ */ n(
240
234
  D,
241
235
  {
@@ -245,40 +239,40 @@ const gr = bt("div", {
245
239
  textOverflow: "ellipsis",
246
240
  whiteSpace: "nowrap"
247
241
  },
248
- children: Bt[t]
242
+ children: $t[t]
249
243
  }
250
244
  )
251
- ] }), mr = (t) => {
245
+ ] }), fr = (t) => {
252
246
  if (!L(t))
253
247
  return null;
254
248
  const r = t.anchor.getNode();
255
- let e = r.getKey() === "root" ? r : It(r, (o) => {
249
+ let e = r.getKey() === "root" ? r : _t(r, (o) => {
256
250
  const i = o.getParent();
257
- return i !== null && qt(i);
251
+ return i !== null && Kt(i);
258
252
  });
259
253
  return e === null && (e = r.getTopLevelElementOrThrow()), {
260
254
  anchorNode: r,
261
255
  element: e
262
256
  };
263
- }, kr = () => {
257
+ }, mr = () => {
264
258
  const [t] = y(), [r, e] = b("paragraph");
265
259
  x(() => t.registerCommand(
266
260
  P,
267
261
  () => {
268
- const c = T(), f = mr(c);
262
+ const c = T(), f = fr(c);
269
263
  if (!f)
270
264
  return !1;
271
265
  const { element: u, anchorNode: m } = f, E = u.getKey();
272
266
  if (t.getElementByKey(E) !== null)
273
- if (et(u)) {
267
+ if (V(u)) {
274
268
  const k = Ae(
275
269
  m,
276
- Rt
270
+ bt
277
271
  ), S = k ? k.getListType() : u.getListType();
278
272
  e(S);
279
273
  } else {
280
- const k = xe(u) ? u.getTag() : u.getType();
281
- k in Bt && e(k);
274
+ const k = se(u) ? u.getTag() : u.getType();
275
+ k in $t && e(k);
282
276
  }
283
277
  return !1;
284
278
  },
@@ -287,14 +281,14 @@ const gr = bt("div", {
287
281
  const o = (c) => {
288
282
  r !== c && t.update(() => {
289
283
  const f = T();
290
- L(f) && (Y(f, () => ye(c)), e(c));
284
+ L(f) && (Y(f, () => ce(c)), e(c));
291
285
  });
292
286
  };
293
- return /* @__PURE__ */ n(gr, { children: /* @__PURE__ */ g(
294
- J,
287
+ return /* @__PURE__ */ n(pr, { children: /* @__PURE__ */ g(
288
+ tt,
295
289
  {
296
290
  trigger: /* @__PURE__ */ n(
297
- vt,
291
+ Tt,
298
292
  {
299
293
  dropdown: !0,
300
294
  css: { display: "flex", width: "100%", overflow: "hidden" },
@@ -317,24 +311,24 @@ const gr = bt("div", {
317
311
  /* @__PURE__ */ n(C, { onClick: () => o("h5"), children: /* @__PURE__ */ n(M, { blockType: "h5" }) }),
318
312
  /* @__PURE__ */ n(C, { onClick: () => o("h6"), children: /* @__PURE__ */ n(M, { blockType: "h6" }) }),
319
313
  /* @__PURE__ */ n(C, { onClick: () => {
320
- r !== "bullet" && (t.dispatchCommand(ve, void 0), e("bullet"));
314
+ r !== "bullet" && (t.dispatchCommand(ne, void 0), e("bullet"));
321
315
  }, children: /* @__PURE__ */ n(M, { blockType: "bullet" }) }),
322
316
  /* @__PURE__ */ n(C, { onClick: () => {
323
- r !== "number" && (t.dispatchCommand(Me, void 0), e("number"));
317
+ r !== "number" && (t.dispatchCommand(oe, void 0), e("number"));
324
318
  }, children: /* @__PURE__ */ n(M, { blockType: "number" }) }),
325
319
  /* @__PURE__ */ n(C, { onClick: () => {
326
- r !== "check" && (t.dispatchCommand(_t, void 0), e("check"));
320
+ r !== "check" && (t.dispatchCommand(vt, void 0), e("check"));
327
321
  }, children: /* @__PURE__ */ n(M, { blockType: "check" }) }),
328
322
  /* @__PURE__ */ n(C, { onClick: () => {
329
323
  r !== "quote" && t.update(() => {
330
324
  const c = T();
331
- L(c) && (Y(c, () => Ne()), e("quote"));
325
+ L(c) && (Y(c, () => de()), e("quote"));
332
326
  });
333
327
  }, children: /* @__PURE__ */ n(M, { blockType: "quote" }) })
334
328
  ]
335
329
  }
336
330
  ) });
337
- }, br = () => {
331
+ }, kr = () => {
338
332
  const [t] = y(), [r, e] = b(!1), [o, i] = b(!1), [l, a] = b(!1), [s, d] = b(!1), [c, f] = b(!1), u = v(() => {
339
333
  const p = T();
340
334
  L(p) && (e(p.hasFormat("bold")), i(p.hasFormat("italic")), a(p.hasFormat("underline")), d(p.hasFormat("code")), f(p.hasFormat("superscript")));
@@ -366,12 +360,12 @@ const gr = bt("div", {
366
360
  ), S = v(
367
361
  () => t.dispatchCommand(B, "superscript"),
368
362
  [t]
369
- ), $ = Et(() => {
363
+ ), $ = Mt(() => {
370
364
  const p = [];
371
365
  return r && p.push("bold"), o && p.push("italic"), l && p.push("underline"), s && p.push("code"), c && p.push("superscript"), p;
372
366
  }, [r, o, l, s, c]);
373
367
  return /* @__PURE__ */ g(
374
- Mt,
368
+ Lt,
375
369
  {
376
370
  type: "multiple",
377
371
  "aria-label": "Tekstformattering",
@@ -383,7 +377,7 @@ const gr = bt("div", {
383
377
  onClick: m,
384
378
  title: "Fet tekst",
385
379
  value: "bold",
386
- children: /* @__PURE__ */ n(Qe, { size: "1.25rem" })
380
+ children: /* @__PURE__ */ n(Xe, { size: "1.25rem" })
387
381
  }
388
382
  ),
389
383
  /* @__PURE__ */ n(
@@ -392,7 +386,7 @@ const gr = bt("div", {
392
386
  onClick: E,
393
387
  title: "Kursiv tekst",
394
388
  value: "italic",
395
- children: /* @__PURE__ */ n(or, { size: "1.25rem" })
389
+ children: /* @__PURE__ */ n(nr, { size: "1.25rem" })
396
390
  }
397
391
  ),
398
392
  /* @__PURE__ */ n(
@@ -401,7 +395,7 @@ const gr = bt("div", {
401
395
  onClick: N,
402
396
  title: "Understreket tekst",
403
397
  value: "underline",
404
- children: /* @__PURE__ */ n(pr, { size: "1.25rem" })
398
+ children: /* @__PURE__ */ n(hr, { size: "1.25rem" })
405
399
  }
406
400
  ),
407
401
  /* @__PURE__ */ n(
@@ -410,7 +404,7 @@ const gr = bt("div", {
410
404
  onClick: k,
411
405
  title: "Kode",
412
406
  value: "code",
413
- children: /* @__PURE__ */ n(Je, { size: "1.25rem" })
407
+ children: /* @__PURE__ */ n(Qe, { size: "1.25rem" })
414
408
  }
415
409
  ),
416
410
  /* @__PURE__ */ n(
@@ -419,31 +413,31 @@ const gr = bt("div", {
419
413
  onClick: S,
420
414
  title: "Superscript",
421
415
  value: "superscript",
422
- children: /* @__PURE__ */ n(ur, { size: "1.25rem" })
416
+ children: /* @__PURE__ */ n(dr, { size: "1.25rem" })
423
417
  }
424
418
  )
425
419
  ]
426
420
  }
427
421
  );
428
- }, vr = ({ children: t }) => {
422
+ }, br = ({ children: t }) => {
429
423
  const { hasFocus: r, editorRef: e } = nt(), o = r, [i, l] = b(o);
430
- me(() => {
424
+ Me(() => {
431
425
  l(o);
432
426
  }, [o]);
433
- const { context: a, refs: s, floatingStyles: d } = V({
427
+ const { context: a, refs: s, floatingStyles: d } = et({
434
428
  placement: "top",
435
- whileElementsMounted: Ct,
429
+ whileElementsMounted: xt,
436
430
  middleware: [
437
- re({
431
+ Ce({
438
432
  apply: ({ rects: f, elements: u }) => {
439
433
  u.floating.style.minWidth = `${f.reference.width}px`;
440
434
  }
441
435
  }),
442
- ne(),
443
- Tt({
436
+ Te(),
437
+ yt({
444
438
  mainAxis: 8
445
439
  }),
446
- oe({
440
+ Le({
447
441
  padding: 8
448
442
  })
449
443
  ],
@@ -452,13 +446,13 @@ const gr = bt("div", {
452
446
  elements: {
453
447
  reference: e.current
454
448
  }
455
- }), { getFloatingProps: c } = Lt([
456
- xt(a, {
449
+ }), { getFloatingProps: c } = Nt([
450
+ St(a, {
457
451
  role: "dialog"
458
452
  })
459
453
  ]);
460
- return i ? /* @__PURE__ */ n(yt, { children: /* @__PURE__ */ n(
461
- Nt,
454
+ return i ? /* @__PURE__ */ n(Et, { children: /* @__PURE__ */ n(
455
+ wt,
462
456
  {
463
457
  ref: s.setFloating,
464
458
  style: d,
@@ -469,33 +463,33 @@ const gr = bt("div", {
469
463
  overflow: "hidden",
470
464
  boxShadow: "$md"
471
465
  },
472
- children: /* @__PURE__ */ n(Mr, { children: t })
466
+ children: /* @__PURE__ */ n(vr, { children: t })
473
467
  }
474
468
  ) }) : null;
475
- }, Mr = ({
469
+ }, vr = ({
476
470
  children: t,
477
471
  ...r
478
- }) => /* @__PURE__ */ g(ie, { "aria-label": "Formattering", ...r, children: [
472
+ }) => /* @__PURE__ */ g(xe, { "aria-label": "Formattering", ...r, children: [
473
+ /* @__PURE__ */ n(mr, {}),
474
+ /* @__PURE__ */ n(ye, {}),
479
475
  /* @__PURE__ */ n(kr, {}),
480
- /* @__PURE__ */ n(ae, {}),
481
- /* @__PURE__ */ n(br, {}),
482
476
  t
483
477
  ] });
484
- function Cr() {
478
+ function Mr() {
485
479
  const [t] = y();
486
480
  return x(() => rt(
487
481
  t.registerCommand(
488
- _t,
489
- () => (Ce(t, "check"), !0),
482
+ vt,
483
+ () => (ie(t, "check"), !0),
490
484
  w
491
485
  ),
492
486
  t.registerCommand(
493
- Yt,
487
+ qt,
494
488
  (r) => gt(r, t, !1),
495
489
  w
496
490
  ),
497
491
  t.registerCommand(
498
- Gt,
492
+ Yt,
499
493
  (r) => gt(r, t, !0),
500
494
  w
501
495
  ),
@@ -511,30 +505,30 @@ function Cr() {
511
505
  w
512
506
  ),
513
507
  t.registerCommand(
514
- Xt,
508
+ Gt,
515
509
  (r) => {
516
510
  const e = G();
517
511
  return e != null && t.isEditable() ? (t.update(() => {
518
512
  const o = Q(e);
519
- O(o) && (r.preventDefault(), o.toggleChecked());
513
+ z(o) && (r.preventDefault(), o.toggleChecked());
520
514
  }), !0) : !1;
521
515
  },
522
516
  w
523
517
  ),
524
518
  t.registerCommand(
525
- Qt,
519
+ Xt,
526
520
  (r) => t.getEditorState().read(() => {
527
521
  const e = T();
528
522
  if (L(e) && e.isCollapsed()) {
529
523
  const { anchor: o } = e, i = o.type === "element";
530
524
  if (i || o.offset === 0) {
531
- const l = o.getNode(), a = It(
525
+ const l = o.getNode(), a = _t(
532
526
  l,
533
- (s) => Jt(s) && !s.isInline()
527
+ (s) => Qt(s) && !s.isInline()
534
528
  );
535
- if (O(a)) {
529
+ if (z(a)) {
536
530
  const s = a.getParent();
537
- if (et(s) && s.getListType() === "check" && (i || a.getFirstDescendant() === l)) {
531
+ if (V(s) && s.getListType() === "check" && (i || a.getFirstDescendant() === l)) {
538
532
  const d = t.getElementByKey(a.__key);
539
533
  if (d != null && document.activeElement !== d)
540
534
  return d.focus(), r.preventDefault(), !0;
@@ -551,7 +545,7 @@ function Cr() {
551
545
  })
552
546
  ), [t]), null;
553
547
  }
554
- function At(t, r) {
548
+ function Bt(t, r) {
555
549
  const e = t.target;
556
550
  if (e === null || !ut(e))
557
551
  return;
@@ -565,22 +559,22 @@ function At(t, r) {
565
559
  (e.dir === "rtl" ? l < a.right && l > a.right - 20 : l > a.left && l < a.left + 20) && r();
566
560
  }
567
561
  function ht(t) {
568
- At(t, () => {
569
- const r = t.target, e = Tr(r);
562
+ Bt(t, () => {
563
+ const r = t.target, e = Cr(r);
570
564
  e != null && e.isEditable() && e.update(() => {
571
565
  if (t.target) {
572
566
  const o = Q(r);
573
- O(o) && (r.focus(), o.toggleChecked());
567
+ z(o) && (r.focus(), o.toggleChecked());
574
568
  }
575
569
  });
576
570
  });
577
571
  }
578
572
  function pt(t) {
579
- At(t, () => {
573
+ Bt(t, () => {
580
574
  t.preventDefault();
581
575
  });
582
576
  }
583
- function Tr(t) {
577
+ function Cr(t) {
584
578
  let r = t;
585
579
  for (; r; ) {
586
580
  if (r.__lexicalEditor)
@@ -594,13 +588,13 @@ function G() {
594
588
  return t != null && t.tagName === "LI" && t.parentNode != null && // @ts-ignore internal field
595
589
  t.parentNode.__lexicalListType === "check" ? t : null;
596
590
  }
597
- function Lr(t, r) {
591
+ function Tr(t, r) {
598
592
  let e = r ? t.getPreviousSibling() : t.getNextSibling(), o = t;
599
- for (; e == null && O(o); )
593
+ for (; e == null && z(o); )
600
594
  o = o.getParentOrThrow().getParent(), o != null && (e = r ? o.getPreviousSibling() : o.getNextSibling());
601
- for (; O(e); ) {
595
+ for (; z(e); ) {
602
596
  const i = r ? e.getLastChild() : e.getFirstChild();
603
- if (!et(i))
597
+ if (!V(i))
604
598
  return e;
605
599
  e = r ? i.getLastChild() : i.getFirstChild();
606
600
  }
@@ -610,9 +604,9 @@ function gt(t, r, e) {
610
604
  const o = G();
611
605
  return o != null && r.update(() => {
612
606
  const i = Q(o);
613
- if (!O(i))
607
+ if (!z(i))
614
608
  return;
615
- const l = Lr(i, e);
609
+ const l = Tr(i, e);
616
610
  if (l != null) {
617
611
  l.selectStart();
618
612
  const a = r.getElementByKey(l.__key);
@@ -622,25 +616,25 @@ function gt(t, r, e) {
622
616
  }
623
617
  }), !1;
624
618
  }
625
- const xr = () => /* @__PURE__ */ g(K, { children: [
619
+ const Lr = () => /* @__PURE__ */ g(K, { children: [
626
620
  /* @__PURE__ */ n(Pe, {}),
627
621
  /* @__PURE__ */ n(He, {}),
628
622
  /* @__PURE__ */ n(Fe, {}),
629
- /* @__PURE__ */ n(Cr, {}),
623
+ /* @__PURE__ */ n(Mr, {}),
630
624
  /* @__PURE__ */ n(We, {})
631
- ] }), yr = ({
625
+ ] }), xr = ({
632
626
  state: t
633
627
  }) => {
634
628
  const [r] = y();
635
629
  return x(() => {
636
630
  if (t)
637
631
  try {
638
- if (qe(t)) {
639
- t.isEmpty() ? Ye(r) : r.setEditorState(t);
632
+ if (Ke(t)) {
633
+ t.isEmpty() ? qe(r) : r.setEditorState(t);
640
634
  return;
641
635
  }
642
- if (typeof t == "string" && !Ot(t)) {
643
- Ge(t, r);
636
+ if (typeof t == "string" && !zt(t)) {
637
+ Ye(t, r);
644
638
  return;
645
639
  }
646
640
  const e = r.parseEditorState(t);
@@ -649,7 +643,7 @@ const xr = () => /* @__PURE__ */ g(K, { children: [
649
643
  console.error("Could not parse"), console.error(e);
650
644
  }
651
645
  }, []), null;
652
- }, Nr = bt("div", {
646
+ }, yr = Ct("div", {
653
647
  border: "1px solid $borderDarker",
654
648
  borderRadius: "$md",
655
649
  position: "relative",
@@ -686,7 +680,7 @@ const xr = () => /* @__PURE__ */ g(K, { children: [
686
680
  }
687
681
  }
688
682
  ]
689
- }), Sr = ({
683
+ }), Nr = ({
690
684
  isLoading: t
691
685
  }) => /* @__PURE__ */ n(
692
686
  D,
@@ -698,9 +692,9 @@ const xr = () => /* @__PURE__ */ g(K, { children: [
698
692
  right: "1rem",
699
693
  display: "flex"
700
694
  },
701
- children: /* @__PURE__ */ n(le, {})
695
+ children: /* @__PURE__ */ n(Ne, {})
702
696
  }
703
- ), un = ({
697
+ ), dn = ({
704
698
  isLoading: t,
705
699
  children: r,
706
700
  placeholderText: e,
@@ -714,8 +708,8 @@ const xr = () => /* @__PURE__ */ g(K, { children: [
714
708
  defaultState: f,
715
709
  css: u
716
710
  }) => {
717
- const { hasFocus: m, attributes: E } = Xe({ onBlur: c }), N = Z(null), k = Et(() => ({ hasFocus: m, editorRef: N }), [m]);
718
- return /* @__PURE__ */ n($t.Provider, { value: k, children: /* @__PURE__ */ g(
711
+ const { hasFocus: m, attributes: E } = Ge({ onBlur: c }), N = Z(null), k = Mt(() => ({ hasFocus: m, editorRef: N }), [m]);
712
+ return /* @__PURE__ */ n(Ot.Provider, { value: k, children: /* @__PURE__ */ g(
719
713
  Oe,
720
714
  {
721
715
  initialConfig: {
@@ -723,13 +717,13 @@ const xr = () => /* @__PURE__ */ g(K, { children: [
723
717
  onError: (S) => {
724
718
  console.error(S);
725
719
  },
726
- theme: zt,
720
+ theme: It,
727
721
  nodes: o,
728
722
  editable: !0
729
723
  },
730
724
  children: [
731
725
  /* @__PURE__ */ g(
732
- Nr,
726
+ yr,
733
727
  {
734
728
  ref: N,
735
729
  hasFocus: m,
@@ -759,19 +753,19 @@ const xr = () => /* @__PURE__ */ g(K, { children: [
759
753
  ErrorBoundary: Be
760
754
  }
761
755
  ),
762
- /* @__PURE__ */ n(xr, {}),
756
+ /* @__PURE__ */ n(Lr, {}),
763
757
  i,
764
- /* @__PURE__ */ n(Sr, { isLoading: t }),
765
- !l && /* @__PURE__ */ n(vr, { children: a })
758
+ /* @__PURE__ */ n(Nr, { isLoading: t }),
759
+ !l && /* @__PURE__ */ n(br, { children: a })
766
760
  ]
767
761
  }
768
762
  ),
769
- /* @__PURE__ */ n(yr, { state: f }),
763
+ /* @__PURE__ */ n(xr, { state: f }),
770
764
  /* @__PURE__ */ n(K, { children: r })
771
765
  ]
772
766
  }
773
767
  ) });
774
- }, Er = {
768
+ }, Sr = {
775
769
  fontSize: "1rem",
776
770
  lineHeight: "1.5",
777
771
  "h1, h2, h3, h4, h5, h6": {
@@ -917,6 +911,13 @@ const xr = () => /* @__PURE__ */ g(K, { children: [
917
911
  borderRadius: "$sm"
918
912
  }
919
913
  },
914
+ ".ain-rich-text-quote": {
915
+ borderLeft: "4px solid #ccc",
916
+ color: "#666",
917
+ fontStyle: "italic",
918
+ margin: "1.5em 10px",
919
+ padding: "0.5em 10px"
920
+ },
920
921
  variants: {
921
922
  size: {
922
923
  xs: {
@@ -954,84 +955,84 @@ const xr = () => /* @__PURE__ */ g(K, { children: [
954
955
  defaultVariants: {
955
956
  size: "md"
956
957
  }
957
- }, hn = kt(Er), pn = () => {
958
+ }, un = Se(Sr), hn = () => {
958
959
  const [t] = y(), r = v(() => {
959
- t.dispatchCommand(Re, {
960
+ t.dispatchCommand(ge, {
960
961
  rows: "3",
961
962
  columns: "3",
962
963
  includeHeaders: !1
963
964
  });
964
965
  }, [t]);
965
966
  return /* @__PURE__ */ n(
966
- J,
967
+ tt,
967
968
  {
968
- trigger: /* @__PURE__ */ n(vt, { dropdown: !0, children: "Sett inn" }),
969
+ trigger: /* @__PURE__ */ n(Tt, { dropdown: !0, children: "Sett inn" }),
969
970
  side: "bottom",
970
971
  align: "end",
971
972
  children: /* @__PURE__ */ g(C, { onClick: r, children: [
972
- /* @__PURE__ */ n(hr, { size: "1.25rem" }),
973
+ /* @__PURE__ */ n(ur, { size: "1.25rem" }),
973
974
  " Tabell"
974
975
  ] })
975
976
  }
976
977
  );
977
978
  };
978
- function wr(t) {
979
+ function Er(t) {
979
980
  return h({ 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);
980
981
  }
981
- const gn = () => {
982
+ const pn = () => {
982
983
  const [t] = y(), [r, e] = b(null), { hasFocus: o } = nt();
983
984
  x(() => {
984
985
  !o && r && e(null);
985
986
  }, [o, r]);
986
- const { refs: i, floatingStyles: l } = V({
987
+ const { refs: i, floatingStyles: l } = et({
987
988
  placement: "top-end",
988
989
  open: !!r,
989
990
  elements: {
990
991
  reference: r
991
992
  },
992
- middleware: [Tt({ mainAxis: -20, crossAxis: -2 })]
993
+ middleware: [yt({ mainAxis: -20, crossAxis: -2 })]
993
994
  });
994
995
  x(() => t.registerCommand(
995
996
  P,
996
997
  () => {
997
998
  const s = T();
998
999
  if (L(s)) {
999
- const d = s.anchor.getNode(), c = _e(d);
1000
+ const d = s.anchor.getNode(), c = fe(d);
1000
1001
  e(c ? t.getElementByKey(c.getKey()) : null);
1001
1002
  }
1002
1003
  return !1;
1003
1004
  },
1004
- Vt
1005
+ Jt
1005
1006
  ), [t]);
1006
1007
  const a = (s) => () => {
1007
1008
  t.update(() => {
1008
1009
  switch (s) {
1009
1010
  case "add-row-over":
1010
- dt(!1);
1011
+ st(!1);
1011
1012
  break;
1012
1013
  case "add-row-under":
1013
- dt(!0);
1014
+ st(!0);
1014
1015
  break;
1015
1016
  case "add-column-left":
1016
- ct(!1);
1017
+ lt(!1);
1017
1018
  break;
1018
1019
  case "add-column-right":
1019
- ct(!0);
1020
+ lt(!0);
1020
1021
  break;
1021
1022
  case "delete-row":
1022
- ze();
1023
+ ke();
1023
1024
  break;
1024
1025
  case "delete-column":
1025
- Ie();
1026
+ me();
1026
1027
  break;
1027
1028
  }
1028
1029
  });
1029
1030
  };
1030
1031
  return r ? /* @__PURE__ */ g(
1031
- J,
1032
+ tt,
1032
1033
  {
1033
1034
  trigger: /* @__PURE__ */ n(
1034
- z,
1035
+ O,
1035
1036
  {
1036
1037
  icon: !0,
1037
1038
  variant: "primary",
@@ -1039,32 +1040,32 @@ const gn = () => {
1039
1040
  ref: i.setFloating,
1040
1041
  style: l,
1041
1042
  css: { padding: "2px", width: "18px", height: "18px" },
1042
- children: /* @__PURE__ */ n(wr, {})
1043
+ children: /* @__PURE__ */ n(Er, {})
1043
1044
  }
1044
1045
  ),
1045
1046
  children: [
1046
1047
  /* @__PURE__ */ n(_, { onClick: a("add-row-over"), children: "Legg til rad over" }),
1047
1048
  /* @__PURE__ */ n(_, { onClick: a("add-row-under"), children: "Legg til rad under" }),
1048
- /* @__PURE__ */ n(lt, {}),
1049
+ /* @__PURE__ */ n(ct, {}),
1049
1050
  /* @__PURE__ */ n(_, { onClick: a("add-column-left"), children: "Legg til kolonne venstre" }),
1050
1051
  /* @__PURE__ */ n(_, { onClick: a("add-column-right"), children: "Legg til kolonne høyre" }),
1051
- /* @__PURE__ */ n(lt, {}),
1052
+ /* @__PURE__ */ n(ct, {}),
1052
1053
  /* @__PURE__ */ n(_, { onClick: a("delete-row"), children: "Fjern rad" }),
1053
1054
  /* @__PURE__ */ n(_, { onClick: a("delete-column"), children: "Fjern kolonne" })
1054
1055
  ]
1055
1056
  }
1056
1057
  ) : null;
1057
1058
  };
1058
- function Dt(t) {
1059
+ function At(t) {
1059
1060
  let r = t;
1060
1061
  const e = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi, o = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
1061
1062
  return r = String(r).trim(), r.match(e) || r.match(o) ? r : "https://";
1062
1063
  }
1063
- function Pt(t) {
1064
+ function Dt(t) {
1064
1065
  const r = t.anchor, e = t.focus, o = t.anchor.getNode(), i = t.focus.getNode();
1065
1066
  return o === i ? o : t.isBackward() ? at(e) ? o : i : at(r) ? o : i;
1066
1067
  }
1067
- const fn = (t) => (R.baseURL = t, R), W = class extends wt {
1068
+ const gn = (t) => (R.baseURL = t, R), W = class extends kt {
1068
1069
  static getType() {
1069
1070
  return "rutine_link";
1070
1071
  }
@@ -1076,7 +1077,7 @@ const fn = (t) => (R.baseURL = t, R), W = class extends wt {
1076
1077
  return e.setAttribute("href", this.getURL()), e.setAttribute("target", "_blank"), e.setAttribute("rel", "noopener noreferrer"), e.classList.add("rutine-link"), e;
1077
1078
  }
1078
1079
  static importJSON(r) {
1079
- return Ft(r.url);
1080
+ return Pt(r.url);
1080
1081
  }
1081
1082
  exportJSON() {
1082
1083
  return {
@@ -1096,13 +1097,13 @@ const fn = (t) => (R.baseURL = t, R), W = class extends wt {
1096
1097
  };
1097
1098
  let R = W;
1098
1099
  it(R, "baseURL", "");
1099
- function Ft(t) {
1100
+ function Pt(t) {
1100
1101
  return new R(t);
1101
1102
  }
1102
- function Rr(t) {
1103
+ function wr(t) {
1103
1104
  return t instanceof R;
1104
1105
  }
1105
- const _r = ({ onClose: t }) => {
1106
+ const Rr = ({ onClose: t }) => {
1106
1107
  const [r] = y(), e = v(
1107
1108
  (i) => {
1108
1109
  r.update(() => {
@@ -1111,23 +1112,23 @@ const _r = ({ onClose: t }) => {
1111
1112
  const a = l.getNodes();
1112
1113
  if (a.length === 1) {
1113
1114
  const s = a[0];
1114
- Zt(s) && s.getChildren().length === 0 && l.insertText(i);
1115
+ Vt(s) && s.getChildren().length === 0 && l.insertText(i);
1115
1116
  }
1116
1117
  }
1117
- }), r.dispatchCommand(tt, Dt(i));
1118
+ }), r.dispatchCommand(J, At(i));
1118
1119
  },
1119
1120
  [r]
1120
1121
  );
1121
1122
  return /* @__PURE__ */ g("form", { onSubmit: (i) => {
1122
1123
  e(i.target.url.value), t();
1123
1124
  }, children: [
1124
- /* @__PURE__ */ n(de, { name: "url", label: "URL", type: "url", required: !0 }),
1125
- /* @__PURE__ */ g(St, { children: [
1126
- /* @__PURE__ */ n(z, { onClick: t, children: "Avbryt" }),
1127
- /* @__PURE__ */ n(z, { type: "submit", variant: "primary", children: "Lagre" })
1125
+ /* @__PURE__ */ n(Re, { name: "url", label: "URL", type: "url", required: !0 }),
1126
+ /* @__PURE__ */ g(Rt, { children: [
1127
+ /* @__PURE__ */ n(O, { onClick: t, children: "Avbryt" }),
1128
+ /* @__PURE__ */ n(O, { type: "submit", variant: "primary", children: "Lagre" })
1128
1129
  ] })
1129
1130
  ] });
1130
- }, Ir = ({ onClose: t, getDocs: r }) => {
1131
+ }, _r = ({ onClose: t, getDocs: r }) => {
1131
1132
  const [e] = y(), [o, i] = b([]), l = r(), a = v(
1132
1133
  (s) => {
1133
1134
  e.update(() => {
@@ -1135,7 +1136,7 @@ const _r = ({ onClose: t }) => {
1135
1136
  if (L(d)) {
1136
1137
  const c = [];
1137
1138
  for (const [f, u] of s.entries()) {
1138
- const m = Ft(u.value);
1139
+ const m = Pt(u.value);
1139
1140
  m.append(A(u.label)), c.push(m), f !== s.length - 1 && c.push(A(" "));
1140
1141
  }
1141
1142
  d.insertNodes(c);
@@ -1145,11 +1146,11 @@ const _r = ({ onClose: t }) => {
1145
1146
  [e]
1146
1147
  );
1147
1148
  return /* @__PURE__ */ g(K, { children: [
1148
- /* @__PURE__ */ n(ue, { isMulti: !0, options: l, onChange: i }),
1149
- /* @__PURE__ */ g(St, { children: [
1150
- /* @__PURE__ */ n(z, { onClick: t, children: "Avbryt" }),
1149
+ /* @__PURE__ */ n(_e, { isMulti: !0, options: l, onChange: i }),
1150
+ /* @__PURE__ */ g(Rt, { children: [
1151
+ /* @__PURE__ */ n(O, { onClick: t, children: "Avbryt" }),
1151
1152
  /* @__PURE__ */ n(
1152
- z,
1153
+ O,
1153
1154
  {
1154
1155
  variant: "primary",
1155
1156
  onClick: () => {
@@ -1160,7 +1161,7 @@ const _r = ({ onClose: t }) => {
1160
1161
  )
1161
1162
  ] })
1162
1163
  ] });
1163
- }, zr = ({
1164
+ }, Ir = ({
1164
1165
  open: t,
1165
1166
  onOpenChange: r,
1166
1167
  getDocs: e
@@ -1168,19 +1169,19 @@ const _r = ({ onClose: t }) => {
1168
1169
  const [o, i] = b("url"), l = () => {
1169
1170
  r(!1);
1170
1171
  };
1171
- return /* @__PURE__ */ g(se, { open: t, onOpenChange: r, css: { width: "600px" }, children: [
1172
- /* @__PURE__ */ g(ce, { css: { marginBottom: "$8" }, children: [
1173
- /* @__PURE__ */ n(st, { active: o === "url", onClick: () => i("url"), children: "URL" }),
1174
- /* @__PURE__ */ n(st, { active: o === "rutine", onClick: () => i("rutine"), children: "Rutine" })
1172
+ return /* @__PURE__ */ g(Ee, { open: t, onOpenChange: r, css: { width: "600px" }, children: [
1173
+ /* @__PURE__ */ g(we, { css: { marginBottom: "$8" }, children: [
1174
+ /* @__PURE__ */ n(dt, { active: o === "url", onClick: () => i("url"), children: "URL" }),
1175
+ /* @__PURE__ */ n(dt, { active: o === "rutine", onClick: () => i("rutine"), children: "Rutine" })
1175
1176
  ] }),
1176
- o === "url" && /* @__PURE__ */ n(_r, { onClose: l }),
1177
- o === "rutine" && /* @__PURE__ */ n(Ir, { onClose: l, getDocs: e })
1177
+ o === "url" && /* @__PURE__ */ n(Rr, { onClose: l }),
1178
+ o === "rutine" && /* @__PURE__ */ n(_r, { onClose: l, getDocs: e })
1178
1179
  ] });
1179
- }, mn = ({ getDocs: t }) => {
1180
+ }, fn = ({ getDocs: t }) => {
1180
1181
  const [r] = y(), [e, o] = b(!1), [i, l] = b(!1), a = v(() => {
1181
1182
  const s = T();
1182
1183
  if (L(s)) {
1183
- const d = Pt(s), c = d.getParent();
1184
+ const d = Dt(s), c = d.getParent();
1184
1185
  o(H(c) || H(d));
1185
1186
  }
1186
1187
  }, []);
@@ -1188,20 +1189,20 @@ const _r = ({ onClose: t }) => {
1188
1189
  P,
1189
1190
  () => (a(), !1),
1190
1191
  X
1191
- ), [r, a]), /* @__PURE__ */ g(Mt, { type: "single", value: e ? "link" : "", children: [
1192
+ ), [r, a]), /* @__PURE__ */ g(Lt, { type: "single", value: e ? "link" : "", children: [
1192
1193
  /* @__PURE__ */ n(
1193
1194
  I,
1194
1195
  {
1195
1196
  onClick: () => {
1196
- e ? r.dispatchCommand(tt, null) : l(!0);
1197
+ e ? r.dispatchCommand(J, null) : l(!0);
1197
1198
  },
1198
1199
  title: "Lenke",
1199
1200
  value: "link",
1200
- children: /* @__PURE__ */ n(ar, { size: "1.25rem" })
1201
+ children: /* @__PURE__ */ n(ir, { size: "1.25rem" })
1201
1202
  }
1202
1203
  ),
1203
1204
  /* @__PURE__ */ n(
1204
- zr,
1205
+ Ir,
1205
1206
  {
1206
1207
  open: i,
1207
1208
  onOpenChange: l,
@@ -1209,30 +1210,30 @@ const _r = ({ onClose: t }) => {
1209
1210
  }
1210
1211
  )
1211
1212
  ] });
1212
- }, kn = () => {
1213
+ }, mn = () => {
1213
1214
  const [t] = y(), r = Z(null), [e, o] = b(null), [i, l] = b(""), { hasFocus: a } = nt();
1214
1215
  x(() => {
1215
1216
  e ? t.update(() => {
1216
1217
  l(e.getURL());
1217
1218
  }) : l("");
1218
1219
  }, [t, e]);
1219
- const s = !!(e && i && a), { refs: d, floatingStyles: c, context: f } = V({
1220
+ const s = !!(e && i && a), { refs: d, floatingStyles: c, context: f } = et({
1220
1221
  placement: "top",
1221
1222
  strategy: "fixed",
1222
1223
  open: s,
1223
- whileElementsMounted: Ct,
1224
+ whileElementsMounted: xt,
1224
1225
  elements: {
1225
1226
  reference: r.current
1226
1227
  },
1227
- middleware: [he()]
1228
- }), { getFloatingProps: u } = Lt([
1229
- xt(f),
1230
- pe(f)
1228
+ middleware: [Ie()]
1229
+ }), { getFloatingProps: u } = Nt([
1230
+ St(f),
1231
+ ze(f)
1231
1232
  ]), m = v(() => {
1232
1233
  var S;
1233
1234
  const k = T();
1234
1235
  if (L(k)) {
1235
- const $ = Pt(k), p = $.getParent();
1236
+ const $ = Dt(k), p = $.getParent();
1236
1237
  let F = null;
1237
1238
  if (H(p) ? F = p : H($) && (F = $), F) {
1238
1239
  const q = window.getSelection(), ot = t.getRootElement();
@@ -1241,9 +1242,9 @@ const _r = ({ onClose: t }) => {
1241
1242
  o(F);
1242
1243
  }
1243
1244
  }, [t]), E = v(() => {
1244
- e && Rr(e) && t.update(() => {
1245
+ e && wr(e) && t.update(() => {
1245
1246
  e.remove();
1246
- }), t.dispatchCommand(tt, null);
1247
+ }), t.dispatchCommand(J, null);
1247
1248
  }, [t, e]);
1248
1249
  if (x(() => {
1249
1250
  t.getEditorState().read(() => {
@@ -1263,13 +1264,13 @@ const _r = ({ onClose: t }) => {
1263
1264
  t.registerCommand(
1264
1265
  mt,
1265
1266
  () => e ? (o(null), !0) : !1,
1266
- te
1267
+ Zt
1267
1268
  )
1268
1269
  ), [t, m, e]), !s)
1269
1270
  return null;
1270
- const N = Dt(i);
1271
- return /* @__PURE__ */ n(yt, { children: /* @__PURE__ */ g(
1272
- Nt,
1271
+ const N = At(i);
1272
+ return /* @__PURE__ */ n(Et, { children: /* @__PURE__ */ g(
1273
+ wt,
1273
1274
  {
1274
1275
  ref: d.setFloating,
1275
1276
  css: {
@@ -1300,32 +1301,32 @@ const _r = ({ onClose: t }) => {
1300
1301
  children: i
1301
1302
  }
1302
1303
  ),
1303
- /* @__PURE__ */ n(z, { color: "danger", icon: !0, size: "sm", onClick: E, children: /* @__PURE__ */ n(De, { size: 24 }) })
1304
+ /* @__PURE__ */ n(O, { color: "danger", icon: !0, size: "sm", onClick: E, children: /* @__PURE__ */ n(De, { size: 24 }) })
1304
1305
  ]
1305
1306
  }
1306
1307
  ) });
1307
1308
  };
1308
1309
  export {
1309
- Ft as $createRutineLinkNode,
1310
- Rr as $isRutineLinkNode,
1311
- vr as FloatingToolbar,
1312
- pn as InsertSelector,
1313
- kn as LinkEditPlugin,
1314
- mn as LinkToolbarButton,
1315
- un as RichTextEditor,
1316
- Mr as RichTextToolbar,
1310
+ Pt as $createRutineLinkNode,
1311
+ wr as $isRutineLinkNode,
1312
+ br as FloatingToolbar,
1313
+ hn as InsertSelector,
1314
+ mn as LinkEditPlugin,
1315
+ fn as LinkToolbarButton,
1316
+ dn as RichTextEditor,
1317
+ vr as RichTextToolbar,
1317
1318
  R as RutineLinkNode,
1318
- fn as RutineLinkNodeInit,
1319
- gn as TableEditPlugin,
1320
- Ye as clearEditorState,
1321
- dn as defaultNodes,
1322
- qe as isEditorState,
1323
- Ot as isJSON,
1324
- $t as richTextContext,
1325
- hn as richTextCss,
1326
- Er as richTextStyleObj,
1327
- Ge as setStateFromPlainText,
1328
- cn as stateToHTML,
1329
- Xe as useHasFocusWithin,
1319
+ gn as RutineLinkNodeInit,
1320
+ pn as TableEditPlugin,
1321
+ qe as clearEditorState,
1322
+ cn as defaultNodes,
1323
+ Ke as isEditorState,
1324
+ zt as isJSON,
1325
+ Ot as richTextContext,
1326
+ un as richTextCss,
1327
+ Sr as richTextStyleObj,
1328
+ Ye as setStateFromPlainText,
1329
+ sn as stateToHTML,
1330
+ Ge as useHasFocusWithin,
1330
1331
  nt as useRichTextContext
1331
1332
  };
package/dist/ui.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import { P as l, y as p, z as i, B as t, R as m } from "./Checkbox-404e0375.js";
2
- import { H as D, Q as M, I as $, m as k, J as A, K as w, Y as O, C as P, q as z, v as N, L as j, D as G, W as H, a as R, n as q, p as E, U as J, N as K, r as L, O as Q, S as U, M as V, X as W, t as X, k as Y, T as F, l as Z, b as _, d as oo, c as ao, G as so, E as eo, A as ro, V as to, s as no } from "./Checkbox-404e0375.js";
1
+ import { P as l, y as p, z as i, B as t, R as m } from "./Checkbox-48d88d36.js";
2
+ import { H as D, Q as M, I as $, m as k, J as A, K as w, Y as O, C as P, q as z, v as j, L as N, D as G, W as H, a as R, n as q, p as E, U as J, N as K, r as L, O as Q, S as U, M as V, X as W, t as X, j as Y, T as F, k as Z, b as _, c as oo, l as ao, G as so, E as eo, A as ro, V as to, s as no } from "./Checkbox-48d88d36.js";
3
3
  import { jsxs as n, jsx as a } from "react/jsx-runtime";
4
4
  import { useState as c } from "react";
5
5
  import "react-dom";
@@ -73,8 +73,8 @@ export {
73
73
  O as Checkbox,
74
74
  P as Combobox,
75
75
  z as Dialog,
76
- N as DialogActions,
77
- j as DialogHeader,
76
+ j as DialogActions,
77
+ N as DialogHeader,
78
78
  G as DropdownMenu,
79
79
  H as DropdownMenuCheckboxItem,
80
80
  R as DropdownMenuIconItem,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arkitektbedriftene/fe-lib",
3
- "version": "0.4.26",
3
+ "version": "0.4.27",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {