@arkitektbedriftene/fe-lib 0.4.25 → 0.4.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,34 +1,34 @@
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 at = (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 j, ParagraphNode as jt, $createParagraphNode as K, $createTextNode as D, $setSelection as mt, SELECTION_CHANGE_COMMAND as F, $getSelection as L, COMMAND_PRIORITY_CRITICAL as Q, $isRangeSelection as T, $isRootOrShadowRoot as Kt, FORMAT_TEXT_COMMAND as A, COMMAND_PRIORITY_LOW as w, KEY_ARROW_DOWN_COMMAND as Yt, KEY_ARROW_UP_COMMAND as qt, KEY_ESCAPE_COMMAND as kt, KEY_SPACE_COMMAND as Gt, $getNearestNodeFromDOMNode as J, 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 G, $isAtNodeEnd as lt } from "@lexical/selection";
8
- import { AutoLinkNode as ee, LinkNode as bt, $isLinkNode as W, TOGGLE_LINK_COMMAND as V } from "@lexical/link";
9
- import { ListNode as vt, ListItemNode as re, $isListNode as Z, INSERT_UNORDERED_LIST_COMMAND as ne, INSERT_ORDERED_LIST_COMMAND as oe, INSERT_CHECK_LIST_COMMAND as Ct, 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 st, $insertTableRow__EXPERIMENTAL as ct } from "@lexical/table";
12
- import { jsx as n, jsxs as g, Fragment as Y } from "react/jsx-runtime";
13
- import { createContext as be, useState as b, useRef as tt, useCallback as v, useContext as ve, useEffect as N, useMemo as Mt, useLayoutEffect as Ce } from "react";
14
- import { c as $, s as Lt, D as et, T as Tt, a as M, B as P, b as Nt, d as I, u as rt, e as yt, f as Me, g as Le, o as xt, h as Te, i as St, j as Et, F as wt, O as Rt, k as Ne, l as ye, S as xe, m as O, n as _, p as dt, q as Se, N as Ee, r as ut, t as we, v as _t, C as Re, w as _e, x as Ie } from "./Checkbox-404e0375.js";
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";
9
+ 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";
15
11
  import "react-select";
16
- import { LexicalComposer as ze } from "@lexical/react/LexicalComposer.js";
17
- import { RichTextPlugin as Oe } from "@lexical/react/LexicalRichTextPlugin.js";
18
- import $e from "@lexical/react/LexicalErrorBoundary.js";
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
+ import { LexicalComposer as Oe } from "@lexical/react/LexicalComposer.js";
17
+ import { RichTextPlugin as $e } from "@lexical/react/LexicalRichTextPlugin.js";
18
+ import Be from "@lexical/react/LexicalErrorBoundary.js";
19
19
  import { useLexicalComposerContext as y } from "@lexical/react/LexicalComposerContext.js";
20
- import { $getNearestNodeOfType as Be, $findMatchingParent as It, mergeRegister as nt, isHTMLElement as ht } from "@lexical/utils";
21
- import { G as h, f as Ae } from "./index.esm-3266b7f8.js";
22
- import { ListPlugin as De } from "@lexical/react/LexicalListPlugin.js";
23
- import { HistoryPlugin as Pe } from "@lexical/react/LexicalHistoryPlugin.js";
24
- import { TablePlugin as Fe } from "@lexical/react/LexicalTablePlugin.js";
25
- import { TabIndentationPlugin as He } from "@lexical/react/LexicalTabIndentationPlugin.js";
20
+ import { $getNearestNodeOfType as Ae, $findMatchingParent as It, mergeRegister as rt, isHTMLElement as ut } from "@lexical/utils";
21
+ import { G as h, f as De } from "./index.esm-3266b7f8.js";
22
+ import { ListPlugin as Pe } from "@lexical/react/LexicalListPlugin.js";
23
+ import { HistoryPlugin as Fe } from "@lexical/react/LexicalHistoryPlugin.js";
24
+ import { TablePlugin as He } from "@lexical/react/LexicalTablePlugin.js";
25
+ import { TabIndentationPlugin as We } from "@lexical/react/LexicalTabIndentationPlugin.js";
26
26
  import "react-dom";
27
27
  import "@radix-ui/react-toolbar";
28
28
  import "@radix-ui/react-dialog";
29
29
  import "@radix-ui/react-dropdown-menu";
30
30
  import "@radix-ui/react-checkbox";
31
- const We = ({
31
+ const Ue = ({
32
32
  text: t,
33
33
  maxChars: r,
34
34
  maxLines: e
@@ -43,55 +43,74 @@ const We = ({
43
43
  t[a] === `
44
44
  ` && l++, a++;
45
45
  return t.slice(0, a).length;
46
- }, Ue = ({
46
+ }, je = ({
47
47
  editor: t,
48
48
  maxChars: r,
49
49
  maxLines: e
50
50
  }) => {
51
- const o = j(), i = o.getTextContent(), l = We({ text: i, maxChars: r, maxLines: e }), a = i.length - l, d = o.select().anchor;
52
- te(t, d, a);
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);
53
53
  const c = o.getLastChild();
54
- return c instanceof jt && c.getChildrenSize() === 0 && c.remove(), a;
55
- }, zt = (t) => t[0] === "{", je = (t) => t !== null && typeof t == "object" && "isEmpty" in t, Ke = (t, r) => {
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,
63
+ text: {
64
+ bold: "ain-rich-text-bold",
65
+ italic: "ain-rich-text-italic",
66
+ underline: "ain-rich-text-underline"
67
+ },
68
+ list: {
69
+ nested: {
70
+ listitem: "ain-rich-text-nested-list-item"
71
+ }
72
+ }
73
+ }, Ot = (t) => t[0] === "{", qe = (t) => t !== null && typeof t == "object" && "isEmpty" in t, Ye = (t, r) => {
56
74
  t.update(
57
75
  () => {
58
- const e = j();
76
+ const e = U();
59
77
  e.clear();
60
- const o = K();
61
- o.append(D("")), e.append(o), mt(null);
78
+ const o = j();
79
+ o.append(A("")), e.append(o), ft(null);
62
80
  },
63
81
  {
64
82
  tag: r
65
83
  }
66
84
  );
67
- }, Ye = (t, r, e) => {
85
+ }, Ge = (t, r, e) => {
68
86
  r.update(
69
87
  () => {
70
- const o = j();
88
+ const o = U();
71
89
  o.clear();
72
- const i = K();
73
- i.append(D(t.trim())), o.append(i), mt(null);
90
+ const i = j();
91
+ i.append(A(t.trim())), o.append(i), ft(null);
74
92
  },
75
93
  {
76
94
  tag: e
77
95
  }
78
96
  ), r.blur();
79
- }, pn = (t, r, e) => {
97
+ }, cn = (t, r, e) => {
80
98
  let o = 0;
81
- const i = Wt({
99
+ const i = Ut({
82
100
  nodes: r,
83
- editable: !1
101
+ editable: !1,
102
+ theme: zt
84
103
  });
85
104
  if (t)
86
105
  try {
87
- if (typeof t == "string" && !zt(t))
106
+ if (typeof t == "string" && !Ot(t))
88
107
  i.update(() => {
89
- const a = j(), s = K();
90
- s.append(D(t.trim())), a.append(s);
108
+ const a = U(), s = j();
109
+ s.append(A(t.trim())), a.append(s);
91
110
  });
92
111
  else {
93
112
  const a = i.parseEditorState(t, () => {
94
- (e == null ? void 0 : e.maxLines) !== void 0 && (o = Ue({
113
+ (e == null ? void 0 : e.maxLines) !== void 0 && (o = je({
95
114
  editor: i,
96
115
  maxLines: e.maxLines
97
116
  }));
@@ -104,46 +123,20 @@ const We = ({
104
123
  let l = "";
105
124
  return i.update(() => {
106
125
  var a;
107
- e != null && e.updateFn && ((a = e.updateFn) == null || a.call(e)), l = Ut(i);
126
+ e != null && e.updateFn && ((a = e.updateFn) == null || a.call(e)), l = jt(i);
108
127
  }), { html: l, trimCount: o };
109
- }, gn = [
110
- ae,
111
- le,
112
- vt,
113
- re,
114
- ee,
115
- bt,
116
- ue,
117
- he,
118
- pe
119
- ], qe = $({
120
- fontWeight: "bold"
121
- }), Ge = $({
122
- fontStyle: "italic"
123
- }), Xe = $({
124
- textDecoration: "underline"
125
- }), Qe = $({
126
- listStyleType: "none"
127
- }), Je = $({
128
- borderLeft: "4px solid #ccc",
129
- color: "#666",
130
- fontStyle: "italic",
131
- margin: "1.5em 10px",
132
- padding: "0.5em 10px"
133
- }), Ve = {
134
- quote: Je().className,
135
- text: {
136
- bold: qe().className,
137
- italic: Ge().className,
138
- underline: Xe().className
139
- },
140
- list: {
141
- nested: {
142
- listitem: Qe().className
143
- }
144
- }
145
- }, Ot = be({ hasFocus: !1, editorRef: { current: null } }), Ze = ({ onBlur: t }) => {
146
- const [r, e] = b(!1), o = tt(null), i = v(() => {
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 }) => {
139
+ const [r, e] = b(!1), o = Z(null), i = v(() => {
147
140
  e(!0), o.current && window.clearTimeout(o.current);
148
141
  }, []), l = v(() => {
149
142
  o.current = window.setTimeout(() => {
@@ -157,65 +150,65 @@ const We = ({
157
150
  onBlur: l
158
151
  }
159
152
  };
160
- }, ot = () => ve(Ot);
161
- function tr(t) {
153
+ }, nt = () => fe($t);
154
+ function Qe(t) {
162
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: "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);
163
156
  }
164
- function er(t) {
157
+ function Je(t) {
165
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: "M7 8l-4 4l4 4" } }, { tag: "path", attr: { d: "M17 8l4 4l-4 4" } }, { tag: "path", attr: { d: "M14 4l-4 16" } }] })(t);
166
159
  }
167
- function rr(t) {
160
+ function Ve(t) {
168
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 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);
169
162
  }
170
- function nr(t) {
163
+ function Ze(t) {
171
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: "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);
172
165
  }
173
- function or(t) {
166
+ function tr(t) {
174
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: "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);
175
168
  }
176
- function ir(t) {
169
+ function er(t) {
177
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: "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);
178
171
  }
179
- function ar(t) {
172
+ function rr(t) {
180
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: "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);
181
174
  }
182
- function lr(t) {
175
+ function nr(t) {
183
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: "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);
184
177
  }
185
- function sr(t) {
178
+ function or(t) {
186
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: "M11 5l6 0" } }, { tag: "path", attr: { d: "M7 19l6 0" } }, { tag: "path", attr: { d: "M14 5l-4 14" } }] })(t);
187
180
  }
188
- function cr(t) {
181
+ function ir(t) {
189
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: "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);
190
183
  }
191
- function dr(t) {
184
+ function ar(t) {
192
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: "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);
193
186
  }
194
- function ur(t) {
187
+ function lr(t) {
195
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: "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);
196
189
  }
197
- function hr(t) {
190
+ function sr(t) {
198
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: "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);
199
192
  }
200
- function pr(t) {
193
+ function cr(t) {
201
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: "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);
202
195
  }
203
- function gr(t) {
196
+ function dr(t) {
204
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: "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);
205
198
  }
206
- function fr(t) {
199
+ function ur(t) {
207
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: "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);
208
201
  }
209
- function mr(t) {
202
+ function hr(t) {
210
203
  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);
211
204
  }
212
- function kr(t) {
205
+ function pr(t) {
213
206
  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);
214
207
  }
215
- const br = Lt("div", {
208
+ const gr = bt("div", {
216
209
  width: "10rem",
217
210
  display: "flex"
218
- }), $t = {
211
+ }), Bt = {
219
212
  bullet: "Punktliste",
220
213
  h1: "Overskrift 1",
221
214
  h2: "Overskrift 2",
@@ -227,24 +220,24 @@ const br = Lt("div", {
227
220
  paragraph: "Normal",
228
221
  quote: "Sitat",
229
222
  check: "Avkrysningsliste"
230
- }, vr = {
231
- bullet: /* @__PURE__ */ n(pr, { size: "1.25rem" }),
232
- h1: /* @__PURE__ */ n(rr, { size: "1.25rem" }),
233
- h2: /* @__PURE__ */ n(nr, { size: "1.25rem" }),
234
- h3: /* @__PURE__ */ n(or, { size: "1.25rem" }),
235
- h4: /* @__PURE__ */ n(ir, { size: "1.25rem" }),
236
- h5: /* @__PURE__ */ n(ar, { size: "1.25rem" }),
237
- h6: /* @__PURE__ */ n(lr, { size: "1.25rem" }),
238
- number: /* @__PURE__ */ n(hr, { size: "1.25rem" }),
239
- check: /* @__PURE__ */ n(ur, { size: "1.25rem" }),
240
- paragraph: /* @__PURE__ */ n(cr, { size: "1.25rem" }),
241
- quote: /* @__PURE__ */ n(gr, { size: "1.25rem" })
242
- }, C = ({
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" })
235
+ }, M = ({
243
236
  blockType: t
244
- }) => /* @__PURE__ */ g(Y, { children: [
245
- /* @__PURE__ */ n(P, { css: { display: "flex", flex: "0 0 auto" }, children: vr[t] }),
237
+ }) => /* @__PURE__ */ g(K, { children: [
238
+ /* @__PURE__ */ n(D, { css: { display: "flex", flex: "0 0 auto" }, children: fr[t] }),
246
239
  /* @__PURE__ */ n(
247
- P,
240
+ D,
248
241
  {
249
242
  css: {
250
243
  flex: "1 1 auto",
@@ -252,105 +245,105 @@ const br = Lt("div", {
252
245
  textOverflow: "ellipsis",
253
246
  whiteSpace: "nowrap"
254
247
  },
255
- children: $t[t]
248
+ children: Bt[t]
256
249
  }
257
250
  )
258
- ] }), Cr = (t) => {
259
- if (!T(t))
251
+ ] }), mr = (t) => {
252
+ if (!L(t))
260
253
  return null;
261
254
  const r = t.anchor.getNode();
262
255
  let e = r.getKey() === "root" ? r : It(r, (o) => {
263
256
  const i = o.getParent();
264
- return i !== null && Kt(i);
257
+ return i !== null && qt(i);
265
258
  });
266
259
  return e === null && (e = r.getTopLevelElementOrThrow()), {
267
260
  anchorNode: r,
268
261
  element: e
269
262
  };
270
- }, Mr = () => {
263
+ }, kr = () => {
271
264
  const [t] = y(), [r, e] = b("paragraph");
272
- N(() => t.registerCommand(
273
- F,
265
+ x(() => t.registerCommand(
266
+ P,
274
267
  () => {
275
- const c = L(), f = Cr(c);
268
+ const c = T(), f = mr(c);
276
269
  if (!f)
277
270
  return !1;
278
271
  const { element: u, anchorNode: m } = f, E = u.getKey();
279
272
  if (t.getElementByKey(E) !== null)
280
- if (Z(u)) {
281
- const k = Be(
273
+ if (et(u)) {
274
+ const k = Ae(
282
275
  m,
283
- vt
276
+ Rt
284
277
  ), S = k ? k.getListType() : u.getListType();
285
278
  e(S);
286
279
  } else {
287
- const k = se(u) ? u.getTag() : u.getType();
288
- k in $t && e(k);
280
+ const k = xe(u) ? u.getTag() : u.getType();
281
+ k in Bt && e(k);
289
282
  }
290
283
  return !1;
291
284
  },
292
- Q
285
+ X
293
286
  ), [t]);
294
287
  const o = (c) => {
295
288
  r !== c && t.update(() => {
296
- const f = L();
297
- T(f) && (G(f, () => ce(c)), e(c));
289
+ const f = T();
290
+ L(f) && (Y(f, () => ye(c)), e(c));
298
291
  });
299
292
  };
300
- return /* @__PURE__ */ n(br, { children: /* @__PURE__ */ g(
301
- et,
293
+ return /* @__PURE__ */ n(gr, { children: /* @__PURE__ */ g(
294
+ J,
302
295
  {
303
296
  trigger: /* @__PURE__ */ n(
304
- Tt,
297
+ vt,
305
298
  {
306
299
  dropdown: !0,
307
300
  css: { display: "flex", width: "100%", overflow: "hidden" },
308
- children: /* @__PURE__ */ n(C, { blockType: r })
301
+ children: /* @__PURE__ */ n(M, { blockType: r })
309
302
  }
310
303
  ),
311
304
  side: "bottom",
312
305
  align: "start",
313
306
  children: [
314
- /* @__PURE__ */ n(M, { onClick: () => {
307
+ /* @__PURE__ */ n(C, { onClick: () => {
315
308
  r !== "paragraph" && t.update(() => {
316
- const c = L();
317
- T(c) && (G(c, () => K()), e("paragraph"));
309
+ const c = T();
310
+ L(c) && (Y(c, () => j()), e("paragraph"));
318
311
  });
319
- }, children: /* @__PURE__ */ n(C, { blockType: "paragraph" }) }),
320
- /* @__PURE__ */ n(M, { onClick: () => o("h1"), children: /* @__PURE__ */ n(C, { blockType: "h1" }) }),
321
- /* @__PURE__ */ n(M, { onClick: () => o("h2"), children: /* @__PURE__ */ n(C, { blockType: "h2" }) }),
322
- /* @__PURE__ */ n(M, { onClick: () => o("h3"), children: /* @__PURE__ */ n(C, { blockType: "h3" }) }),
323
- /* @__PURE__ */ n(M, { onClick: () => o("h4"), children: /* @__PURE__ */ n(C, { blockType: "h4" }) }),
324
- /* @__PURE__ */ n(M, { onClick: () => o("h5"), children: /* @__PURE__ */ n(C, { blockType: "h5" }) }),
325
- /* @__PURE__ */ n(M, { onClick: () => o("h6"), children: /* @__PURE__ */ n(C, { blockType: "h6" }) }),
326
- /* @__PURE__ */ n(M, { onClick: () => {
327
- r !== "bullet" && (t.dispatchCommand(ne, void 0), e("bullet"));
328
- }, children: /* @__PURE__ */ n(C, { blockType: "bullet" }) }),
329
- /* @__PURE__ */ n(M, { onClick: () => {
330
- r !== "number" && (t.dispatchCommand(oe, void 0), e("number"));
331
- }, children: /* @__PURE__ */ n(C, { blockType: "number" }) }),
332
- /* @__PURE__ */ n(M, { onClick: () => {
333
- r !== "check" && (t.dispatchCommand(Ct, void 0), e("check"));
334
- }, children: /* @__PURE__ */ n(C, { blockType: "check" }) }),
335
- /* @__PURE__ */ n(M, { onClick: () => {
312
+ }, children: /* @__PURE__ */ n(M, { blockType: "paragraph" }) }),
313
+ /* @__PURE__ */ n(C, { onClick: () => o("h1"), children: /* @__PURE__ */ n(M, { blockType: "h1" }) }),
314
+ /* @__PURE__ */ n(C, { onClick: () => o("h2"), children: /* @__PURE__ */ n(M, { blockType: "h2" }) }),
315
+ /* @__PURE__ */ n(C, { onClick: () => o("h3"), children: /* @__PURE__ */ n(M, { blockType: "h3" }) }),
316
+ /* @__PURE__ */ n(C, { onClick: () => o("h4"), children: /* @__PURE__ */ n(M, { blockType: "h4" }) }),
317
+ /* @__PURE__ */ n(C, { onClick: () => o("h5"), children: /* @__PURE__ */ n(M, { blockType: "h5" }) }),
318
+ /* @__PURE__ */ n(C, { onClick: () => o("h6"), children: /* @__PURE__ */ n(M, { blockType: "h6" }) }),
319
+ /* @__PURE__ */ n(C, { onClick: () => {
320
+ r !== "bullet" && (t.dispatchCommand(ve, void 0), e("bullet"));
321
+ }, children: /* @__PURE__ */ n(M, { blockType: "bullet" }) }),
322
+ /* @__PURE__ */ n(C, { onClick: () => {
323
+ r !== "number" && (t.dispatchCommand(Me, void 0), e("number"));
324
+ }, children: /* @__PURE__ */ n(M, { blockType: "number" }) }),
325
+ /* @__PURE__ */ n(C, { onClick: () => {
326
+ r !== "check" && (t.dispatchCommand(_t, void 0), e("check"));
327
+ }, children: /* @__PURE__ */ n(M, { blockType: "check" }) }),
328
+ /* @__PURE__ */ n(C, { onClick: () => {
336
329
  r !== "quote" && t.update(() => {
337
- const c = L();
338
- T(c) && (G(c, () => de()), e("quote"));
330
+ const c = T();
331
+ L(c) && (Y(c, () => Ne()), e("quote"));
339
332
  });
340
- }, children: /* @__PURE__ */ n(C, { blockType: "quote" }) })
333
+ }, children: /* @__PURE__ */ n(M, { blockType: "quote" }) })
341
334
  ]
342
335
  }
343
336
  ) });
344
- }, Lr = () => {
337
+ }, br = () => {
345
338
  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(() => {
346
- const p = L();
347
- T(p) && (e(p.hasFormat("bold")), i(p.hasFormat("italic")), a(p.hasFormat("underline")), d(p.hasFormat("code")), f(p.hasFormat("superscript")));
339
+ const p = T();
340
+ L(p) && (e(p.hasFormat("bold")), i(p.hasFormat("italic")), a(p.hasFormat("underline")), d(p.hasFormat("code")), f(p.hasFormat("superscript")));
348
341
  }, []);
349
- N(() => nt(
342
+ x(() => rt(
350
343
  t.registerCommand(
351
- F,
344
+ P,
352
345
  () => (u(), !1),
353
- Q
346
+ X
354
347
  ),
355
348
  t.registerUpdateListener(({ editorState: p }) => {
356
349
  p.read(() => {
@@ -359,30 +352,30 @@ const br = Lt("div", {
359
352
  })
360
353
  ), [t, u]);
361
354
  const m = v(
362
- () => t.dispatchCommand(A, "bold"),
355
+ () => t.dispatchCommand(B, "bold"),
363
356
  [t]
364
357
  ), E = v(
365
- () => t.dispatchCommand(A, "italic"),
358
+ () => t.dispatchCommand(B, "italic"),
366
359
  [t]
367
- ), x = v(
368
- () => t.dispatchCommand(A, "underline"),
360
+ ), N = v(
361
+ () => t.dispatchCommand(B, "underline"),
369
362
  [t]
370
363
  ), k = v(
371
- () => t.dispatchCommand(A, "code"),
364
+ () => t.dispatchCommand(B, "code"),
372
365
  [t]
373
366
  ), S = v(
374
- () => t.dispatchCommand(A, "superscript"),
367
+ () => t.dispatchCommand(B, "superscript"),
375
368
  [t]
376
- ), B = Mt(() => {
369
+ ), $ = Et(() => {
377
370
  const p = [];
378
371
  return r && p.push("bold"), o && p.push("italic"), l && p.push("underline"), s && p.push("code"), c && p.push("superscript"), p;
379
372
  }, [r, o, l, s, c]);
380
373
  return /* @__PURE__ */ g(
381
- Nt,
374
+ Mt,
382
375
  {
383
376
  type: "multiple",
384
377
  "aria-label": "Tekstformattering",
385
- value: B,
378
+ value: $,
386
379
  children: [
387
380
  /* @__PURE__ */ n(
388
381
  I,
@@ -390,7 +383,7 @@ const br = Lt("div", {
390
383
  onClick: m,
391
384
  title: "Fet tekst",
392
385
  value: "bold",
393
- children: /* @__PURE__ */ n(tr, { size: "1.25rem" })
386
+ children: /* @__PURE__ */ n(Qe, { size: "1.25rem" })
394
387
  }
395
388
  ),
396
389
  /* @__PURE__ */ n(
@@ -399,16 +392,16 @@ const br = Lt("div", {
399
392
  onClick: E,
400
393
  title: "Kursiv tekst",
401
394
  value: "italic",
402
- children: /* @__PURE__ */ n(sr, { size: "1.25rem" })
395
+ children: /* @__PURE__ */ n(or, { size: "1.25rem" })
403
396
  }
404
397
  ),
405
398
  /* @__PURE__ */ n(
406
399
  I,
407
400
  {
408
- onClick: x,
401
+ onClick: N,
409
402
  title: "Understreket tekst",
410
403
  value: "underline",
411
- children: /* @__PURE__ */ n(kr, { size: "1.25rem" })
404
+ children: /* @__PURE__ */ n(pr, { size: "1.25rem" })
412
405
  }
413
406
  ),
414
407
  /* @__PURE__ */ n(
@@ -417,7 +410,7 @@ const br = Lt("div", {
417
410
  onClick: k,
418
411
  title: "Kode",
419
412
  value: "code",
420
- children: /* @__PURE__ */ n(er, { size: "1.25rem" })
413
+ children: /* @__PURE__ */ n(Je, { size: "1.25rem" })
421
414
  }
422
415
  ),
423
416
  /* @__PURE__ */ n(
@@ -426,31 +419,31 @@ const br = Lt("div", {
426
419
  onClick: S,
427
420
  title: "Superscript",
428
421
  value: "superscript",
429
- children: /* @__PURE__ */ n(fr, { size: "1.25rem" })
422
+ children: /* @__PURE__ */ n(ur, { size: "1.25rem" })
430
423
  }
431
424
  )
432
425
  ]
433
426
  }
434
427
  );
435
- }, Tr = ({ children: t }) => {
436
- const { hasFocus: r, editorRef: e } = ot(), o = r, [i, l] = b(o);
437
- Ce(() => {
428
+ }, vr = ({ children: t }) => {
429
+ const { hasFocus: r, editorRef: e } = nt(), o = r, [i, l] = b(o);
430
+ me(() => {
438
431
  l(o);
439
432
  }, [o]);
440
- const { context: a, refs: s, floatingStyles: d } = rt({
433
+ const { context: a, refs: s, floatingStyles: d } = V({
441
434
  placement: "top",
442
- whileElementsMounted: yt,
435
+ whileElementsMounted: Ct,
443
436
  middleware: [
444
- Me({
437
+ re({
445
438
  apply: ({ rects: f, elements: u }) => {
446
439
  u.floating.style.minWidth = `${f.reference.width}px`;
447
440
  }
448
441
  }),
449
- Le(),
450
- xt({
442
+ ne(),
443
+ Tt({
451
444
  mainAxis: 8
452
445
  }),
453
- Te({
446
+ oe({
454
447
  padding: 8
455
448
  })
456
449
  ],
@@ -459,13 +452,13 @@ const br = Lt("div", {
459
452
  elements: {
460
453
  reference: e.current
461
454
  }
462
- }), { getFloatingProps: c } = St([
463
- Et(a, {
455
+ }), { getFloatingProps: c } = Lt([
456
+ xt(a, {
464
457
  role: "dialog"
465
458
  })
466
459
  ]);
467
- return i ? /* @__PURE__ */ n(wt, { children: /* @__PURE__ */ n(
468
- Rt,
460
+ return i ? /* @__PURE__ */ n(yt, { children: /* @__PURE__ */ n(
461
+ Nt,
469
462
  {
470
463
  ref: s.setFloating,
471
464
  style: d,
@@ -476,40 +469,40 @@ const br = Lt("div", {
476
469
  overflow: "hidden",
477
470
  boxShadow: "$md"
478
471
  },
479
- children: /* @__PURE__ */ n(Nr, { children: t })
472
+ children: /* @__PURE__ */ n(Mr, { children: t })
480
473
  }
481
474
  ) }) : null;
482
- }, Nr = ({
475
+ }, Mr = ({
483
476
  children: t,
484
477
  ...r
485
- }) => /* @__PURE__ */ g(Ne, { "aria-label": "Formattering", ...r, children: [
486
- /* @__PURE__ */ n(Mr, {}),
487
- /* @__PURE__ */ n(ye, {}),
488
- /* @__PURE__ */ n(Lr, {}),
478
+ }) => /* @__PURE__ */ g(ie, { "aria-label": "Formattering", ...r, children: [
479
+ /* @__PURE__ */ n(kr, {}),
480
+ /* @__PURE__ */ n(ae, {}),
481
+ /* @__PURE__ */ n(br, {}),
489
482
  t
490
483
  ] });
491
- function yr() {
484
+ function Cr() {
492
485
  const [t] = y();
493
- return N(() => nt(
486
+ return x(() => rt(
494
487
  t.registerCommand(
495
- Ct,
496
- () => (ie(t, "check"), !0),
488
+ _t,
489
+ () => (Ce(t, "check"), !0),
497
490
  w
498
491
  ),
499
492
  t.registerCommand(
500
493
  Yt,
501
- (r) => ft(r, t, !1),
494
+ (r) => gt(r, t, !1),
502
495
  w
503
496
  ),
504
497
  t.registerCommand(
505
- qt,
506
- (r) => ft(r, t, !0),
498
+ Gt,
499
+ (r) => gt(r, t, !0),
507
500
  w
508
501
  ),
509
502
  t.registerCommand(
510
- kt,
503
+ mt,
511
504
  (r) => {
512
- if (X() != null) {
505
+ if (G() != null) {
513
506
  const o = t.getRootElement();
514
507
  return o != null && o.focus(), !0;
515
508
  }
@@ -518,30 +511,30 @@ function yr() {
518
511
  w
519
512
  ),
520
513
  t.registerCommand(
521
- Gt,
514
+ Xt,
522
515
  (r) => {
523
- const e = X();
516
+ const e = G();
524
517
  return e != null && t.isEditable() ? (t.update(() => {
525
- const o = J(e);
526
- z(o) && (r.preventDefault(), o.toggleChecked());
518
+ const o = Q(e);
519
+ O(o) && (r.preventDefault(), o.toggleChecked());
527
520
  }), !0) : !1;
528
521
  },
529
522
  w
530
523
  ),
531
524
  t.registerCommand(
532
- Xt,
525
+ Qt,
533
526
  (r) => t.getEditorState().read(() => {
534
- const e = L();
535
- if (T(e) && e.isCollapsed()) {
527
+ const e = T();
528
+ if (L(e) && e.isCollapsed()) {
536
529
  const { anchor: o } = e, i = o.type === "element";
537
530
  if (i || o.offset === 0) {
538
531
  const l = o.getNode(), a = It(
539
532
  l,
540
- (s) => Qt(s) && !s.isInline()
533
+ (s) => Jt(s) && !s.isInline()
541
534
  );
542
- if (z(a)) {
535
+ if (O(a)) {
543
536
  const s = a.getParent();
544
- if (Z(s) && s.getListType() === "check" && (i || a.getFirstDescendant() === l)) {
537
+ if (et(s) && s.getListType() === "check" && (i || a.getFirstDescendant() === l)) {
545
538
  const d = t.getElementByKey(a.__key);
546
539
  if (d != null && document.activeElement !== d)
547
540
  return d.focus(), r.preventDefault(), !0;
@@ -554,16 +547,16 @@ function yr() {
554
547
  w
555
548
  ),
556
549
  t.registerRootListener((r, e) => {
557
- r !== null && (r.addEventListener("click", pt), r.addEventListener("pointerdown", gt)), e !== null && (e.removeEventListener("click", pt), e.removeEventListener("pointerdown", gt));
550
+ r !== null && (r.addEventListener("click", ht), r.addEventListener("pointerdown", pt)), e !== null && (e.removeEventListener("click", ht), e.removeEventListener("pointerdown", pt));
558
551
  })
559
552
  ), [t]), null;
560
553
  }
561
- function Bt(t, r) {
554
+ function At(t, r) {
562
555
  const e = t.target;
563
- if (e === null || !ht(e))
556
+ if (e === null || !ut(e))
564
557
  return;
565
558
  const o = e.firstChild;
566
- if (o != null && ht(o) && (o.tagName === "UL" || o.tagName === "OL"))
559
+ if (o != null && ut(o) && (o.tagName === "UL" || o.tagName === "OL"))
567
560
  return;
568
561
  const i = e.parentNode;
569
562
  if (!i || i.__lexicalListType !== "check")
@@ -571,23 +564,23 @@ function Bt(t, r) {
571
564
  const l = t.pageX, a = e.getBoundingClientRect();
572
565
  (e.dir === "rtl" ? l < a.right && l > a.right - 20 : l > a.left && l < a.left + 20) && r();
573
566
  }
574
- function pt(t) {
575
- Bt(t, () => {
576
- const r = t.target, e = xr(r);
567
+ function ht(t) {
568
+ At(t, () => {
569
+ const r = t.target, e = Tr(r);
577
570
  e != null && e.isEditable() && e.update(() => {
578
571
  if (t.target) {
579
- const o = J(r);
580
- z(o) && (r.focus(), o.toggleChecked());
572
+ const o = Q(r);
573
+ O(o) && (r.focus(), o.toggleChecked());
581
574
  }
582
575
  });
583
576
  });
584
577
  }
585
- function gt(t) {
586
- Bt(t, () => {
578
+ function pt(t) {
579
+ At(t, () => {
587
580
  t.preventDefault();
588
581
  });
589
582
  }
590
- function xr(t) {
583
+ function Tr(t) {
591
584
  let r = t;
592
585
  for (; r; ) {
593
586
  if (r.__lexicalEditor)
@@ -596,30 +589,30 @@ function xr(t) {
596
589
  }
597
590
  return null;
598
591
  }
599
- function X() {
592
+ function G() {
600
593
  const t = document.activeElement;
601
594
  return t != null && t.tagName === "LI" && t.parentNode != null && // @ts-ignore internal field
602
595
  t.parentNode.__lexicalListType === "check" ? t : null;
603
596
  }
604
- function Sr(t, r) {
597
+ function Lr(t, r) {
605
598
  let e = r ? t.getPreviousSibling() : t.getNextSibling(), o = t;
606
- for (; e == null && z(o); )
599
+ for (; e == null && O(o); )
607
600
  o = o.getParentOrThrow().getParent(), o != null && (e = r ? o.getPreviousSibling() : o.getNextSibling());
608
- for (; z(e); ) {
601
+ for (; O(e); ) {
609
602
  const i = r ? e.getLastChild() : e.getFirstChild();
610
- if (!Z(i))
603
+ if (!et(i))
611
604
  return e;
612
605
  e = r ? i.getLastChild() : i.getFirstChild();
613
606
  }
614
607
  return null;
615
608
  }
616
- function ft(t, r, e) {
617
- const o = X();
609
+ function gt(t, r, e) {
610
+ const o = G();
618
611
  return o != null && r.update(() => {
619
- const i = J(o);
620
- if (!z(i))
612
+ const i = Q(o);
613
+ if (!O(i))
621
614
  return;
622
- const l = Sr(i, e);
615
+ const l = Lr(i, e);
623
616
  if (l != null) {
624
617
  l.selectStart();
625
618
  const a = r.getElementByKey(l.__key);
@@ -629,25 +622,25 @@ function ft(t, r, e) {
629
622
  }
630
623
  }), !1;
631
624
  }
632
- const Er = () => /* @__PURE__ */ g(Y, { children: [
633
- /* @__PURE__ */ n(De, {}),
634
- /* @__PURE__ */ n(Fe, {}),
625
+ const xr = () => /* @__PURE__ */ g(K, { children: [
635
626
  /* @__PURE__ */ n(Pe, {}),
636
- /* @__PURE__ */ n(yr, {}),
637
- /* @__PURE__ */ n(He, {})
638
- ] }), wr = ({
627
+ /* @__PURE__ */ n(He, {}),
628
+ /* @__PURE__ */ n(Fe, {}),
629
+ /* @__PURE__ */ n(Cr, {}),
630
+ /* @__PURE__ */ n(We, {})
631
+ ] }), yr = ({
639
632
  state: t
640
633
  }) => {
641
634
  const [r] = y();
642
- return N(() => {
635
+ return x(() => {
643
636
  if (t)
644
637
  try {
645
- if (je(t)) {
646
- t.isEmpty() ? Ke(r) : r.setEditorState(t);
638
+ if (qe(t)) {
639
+ t.isEmpty() ? Ye(r) : r.setEditorState(t);
647
640
  return;
648
641
  }
649
- if (typeof t == "string" && !zt(t)) {
650
- Ye(t, r);
642
+ if (typeof t == "string" && !Ot(t)) {
643
+ Ge(t, r);
651
644
  return;
652
645
  }
653
646
  const e = r.parseEditorState(t);
@@ -656,7 +649,7 @@ const Er = () => /* @__PURE__ */ g(Y, { children: [
656
649
  console.error("Could not parse"), console.error(e);
657
650
  }
658
651
  }, []), null;
659
- }, Rr = Lt("div", {
652
+ }, Nr = bt("div", {
660
653
  border: "1px solid $borderDarker",
661
654
  borderRadius: "$md",
662
655
  position: "relative",
@@ -693,10 +686,10 @@ const Er = () => /* @__PURE__ */ g(Y, { children: [
693
686
  }
694
687
  }
695
688
  ]
696
- }), _r = ({
689
+ }), Sr = ({
697
690
  isLoading: t
698
691
  }) => /* @__PURE__ */ n(
699
- P,
692
+ D,
700
693
  {
701
694
  css: {
702
695
  visibility: t ? "visible" : "hidden",
@@ -705,9 +698,9 @@ const Er = () => /* @__PURE__ */ g(Y, { children: [
705
698
  right: "1rem",
706
699
  display: "flex"
707
700
  },
708
- children: /* @__PURE__ */ n(xe, {})
701
+ children: /* @__PURE__ */ n(le, {})
709
702
  }
710
- ), fn = ({
703
+ ), un = ({
711
704
  isLoading: t,
712
705
  children: r,
713
706
  placeholderText: e,
@@ -721,24 +714,24 @@ const Er = () => /* @__PURE__ */ g(Y, { children: [
721
714
  defaultState: f,
722
715
  css: u
723
716
  }) => {
724
- const { hasFocus: m, attributes: E } = Ze({ onBlur: c }), x = tt(null), k = Mt(() => ({ hasFocus: m, editorRef: x }), [m]);
725
- return /* @__PURE__ */ n(Ot.Provider, { value: k, children: /* @__PURE__ */ g(
726
- ze,
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(
719
+ Oe,
727
720
  {
728
721
  initialConfig: {
729
- namespace: "CommentEditor",
722
+ namespace: "ain-rich-text",
730
723
  onError: (S) => {
731
724
  console.error(S);
732
725
  },
733
- theme: Ve,
726
+ theme: zt,
734
727
  nodes: o,
735
728
  editable: !0
736
729
  },
737
730
  children: [
738
731
  /* @__PURE__ */ g(
739
- Rr,
732
+ Nr,
740
733
  {
741
- ref: x,
734
+ ref: N,
742
735
  hasFocus: m,
743
736
  hideBorder: d,
744
737
  css: u,
@@ -746,11 +739,11 @@ const Er = () => /* @__PURE__ */ g(Y, { children: [
746
739
  children: [
747
740
  l,
748
741
  /* @__PURE__ */ n(
749
- Oe,
742
+ $e,
750
743
  {
751
744
  contentEditable: s,
752
745
  placeholder: e ? /* @__PURE__ */ n(
753
- P,
746
+ D,
754
747
  {
755
748
  css: {
756
749
  position: "absolute",
@@ -763,22 +756,22 @@ const Er = () => /* @__PURE__ */ g(Y, { children: [
763
756
  children: e
764
757
  }
765
758
  ) : null,
766
- ErrorBoundary: $e
759
+ ErrorBoundary: Be
767
760
  }
768
761
  ),
769
- /* @__PURE__ */ n(Er, {}),
762
+ /* @__PURE__ */ n(xr, {}),
770
763
  i,
771
- /* @__PURE__ */ n(_r, { isLoading: t }),
772
- !l && /* @__PURE__ */ n(Tr, { children: a })
764
+ /* @__PURE__ */ n(Sr, { isLoading: t }),
765
+ !l && /* @__PURE__ */ n(vr, { children: a })
773
766
  ]
774
767
  }
775
768
  ),
776
- /* @__PURE__ */ n(wr, { state: f }),
777
- /* @__PURE__ */ n(Y, { children: r })
769
+ /* @__PURE__ */ n(yr, { state: f }),
770
+ /* @__PURE__ */ n(K, { children: r })
778
771
  ]
779
772
  }
780
773
  ) });
781
- }, Ir = {
774
+ }, Er = {
782
775
  fontSize: "1rem",
783
776
  lineHeight: "1.5",
784
777
  "h1, h2, h3, h4, h5, h6": {
@@ -816,9 +809,15 @@ const Er = () => /* @__PURE__ */ g(Y, { children: [
816
809
  marginBottom: "0"
817
810
  }
818
811
  },
819
- strong: {
812
+ "b, strong, .ain-rich-text-bold": {
820
813
  fontWeight: "$bold"
821
814
  },
815
+ "i, em, .ain-rich-text-italic": {
816
+ fontStyle: "italic"
817
+ },
818
+ ".ain-rich-text-underline": {
819
+ textDecoration: "underline"
820
+ },
822
821
  "ul, ol": {
823
822
  paddingLeft: "1.8em",
824
823
  listStylePosition: "inside",
@@ -827,9 +826,18 @@ const Er = () => /* @__PURE__ */ g(Y, { children: [
827
826
  ul: {
828
827
  listStyleType: "disc"
829
828
  },
829
+ "ul ul": {
830
+ listStyleType: "circle"
831
+ },
832
+ "ul ul ul": {
833
+ listStyleType: "square"
834
+ },
830
835
  ol: {
831
836
  listStyleType: "decimal"
832
837
  },
838
+ ".ain-rich-text-nested-list-item": {
839
+ listStyleType: "none"
840
+ },
833
841
  th: {
834
842
  fontWeight: "$medium",
835
843
  backgroundColor: "$gray100"
@@ -946,84 +954,84 @@ const Er = () => /* @__PURE__ */ g(Y, { children: [
946
954
  defaultVariants: {
947
955
  size: "md"
948
956
  }
949
- }, mn = $(Ir), kn = () => {
957
+ }, hn = kt(Er), pn = () => {
950
958
  const [t] = y(), r = v(() => {
951
- t.dispatchCommand(ge, {
959
+ t.dispatchCommand(Re, {
952
960
  rows: "3",
953
961
  columns: "3",
954
962
  includeHeaders: !1
955
963
  });
956
964
  }, [t]);
957
965
  return /* @__PURE__ */ n(
958
- et,
966
+ J,
959
967
  {
960
- trigger: /* @__PURE__ */ n(Tt, { dropdown: !0, children: "Sett inn" }),
968
+ trigger: /* @__PURE__ */ n(vt, { dropdown: !0, children: "Sett inn" }),
961
969
  side: "bottom",
962
970
  align: "end",
963
- children: /* @__PURE__ */ g(M, { onClick: r, children: [
964
- /* @__PURE__ */ n(mr, { size: "1.25rem" }),
971
+ children: /* @__PURE__ */ g(C, { onClick: r, children: [
972
+ /* @__PURE__ */ n(hr, { size: "1.25rem" }),
965
973
  " Tabell"
966
974
  ] })
967
975
  }
968
976
  );
969
977
  };
970
- function zr(t) {
978
+ function wr(t) {
971
979
  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);
972
980
  }
973
- const bn = () => {
974
- const [t] = y(), [r, e] = b(null), { hasFocus: o } = ot();
975
- N(() => {
981
+ const gn = () => {
982
+ const [t] = y(), [r, e] = b(null), { hasFocus: o } = nt();
983
+ x(() => {
976
984
  !o && r && e(null);
977
985
  }, [o, r]);
978
- const { refs: i, floatingStyles: l } = rt({
986
+ const { refs: i, floatingStyles: l } = V({
979
987
  placement: "top-end",
980
988
  open: !!r,
981
989
  elements: {
982
990
  reference: r
983
991
  },
984
- middleware: [xt({ mainAxis: -20, crossAxis: -2 })]
992
+ middleware: [Tt({ mainAxis: -20, crossAxis: -2 })]
985
993
  });
986
- N(() => t.registerCommand(
987
- F,
994
+ x(() => t.registerCommand(
995
+ P,
988
996
  () => {
989
- const s = L();
990
- if (T(s)) {
991
- const d = s.anchor.getNode(), c = fe(d);
997
+ const s = T();
998
+ if (L(s)) {
999
+ const d = s.anchor.getNode(), c = _e(d);
992
1000
  e(c ? t.getElementByKey(c.getKey()) : null);
993
1001
  }
994
1002
  return !1;
995
1003
  },
996
- Jt
1004
+ Vt
997
1005
  ), [t]);
998
1006
  const a = (s) => () => {
999
1007
  t.update(() => {
1000
1008
  switch (s) {
1001
1009
  case "add-row-over":
1002
- ct(!1);
1010
+ dt(!1);
1003
1011
  break;
1004
1012
  case "add-row-under":
1005
- ct(!0);
1013
+ dt(!0);
1006
1014
  break;
1007
1015
  case "add-column-left":
1008
- st(!1);
1016
+ ct(!1);
1009
1017
  break;
1010
1018
  case "add-column-right":
1011
- st(!0);
1019
+ ct(!0);
1012
1020
  break;
1013
1021
  case "delete-row":
1014
- ke();
1022
+ ze();
1015
1023
  break;
1016
1024
  case "delete-column":
1017
- me();
1025
+ Ie();
1018
1026
  break;
1019
1027
  }
1020
1028
  });
1021
1029
  };
1022
1030
  return r ? /* @__PURE__ */ g(
1023
- et,
1031
+ J,
1024
1032
  {
1025
1033
  trigger: /* @__PURE__ */ n(
1026
- O,
1034
+ z,
1027
1035
  {
1028
1036
  icon: !0,
1029
1037
  variant: "primary",
@@ -1031,44 +1039,44 @@ const bn = () => {
1031
1039
  ref: i.setFloating,
1032
1040
  style: l,
1033
1041
  css: { padding: "2px", width: "18px", height: "18px" },
1034
- children: /* @__PURE__ */ n(zr, {})
1042
+ children: /* @__PURE__ */ n(wr, {})
1035
1043
  }
1036
1044
  ),
1037
1045
  children: [
1038
1046
  /* @__PURE__ */ n(_, { onClick: a("add-row-over"), children: "Legg til rad over" }),
1039
1047
  /* @__PURE__ */ n(_, { onClick: a("add-row-under"), children: "Legg til rad under" }),
1040
- /* @__PURE__ */ n(dt, {}),
1048
+ /* @__PURE__ */ n(lt, {}),
1041
1049
  /* @__PURE__ */ n(_, { onClick: a("add-column-left"), children: "Legg til kolonne venstre" }),
1042
1050
  /* @__PURE__ */ n(_, { onClick: a("add-column-right"), children: "Legg til kolonne høyre" }),
1043
- /* @__PURE__ */ n(dt, {}),
1051
+ /* @__PURE__ */ n(lt, {}),
1044
1052
  /* @__PURE__ */ n(_, { onClick: a("delete-row"), children: "Fjern rad" }),
1045
1053
  /* @__PURE__ */ n(_, { onClick: a("delete-column"), children: "Fjern kolonne" })
1046
1054
  ]
1047
1055
  }
1048
1056
  ) : null;
1049
1057
  };
1050
- function At(t) {
1058
+ function Dt(t) {
1051
1059
  let r = t;
1052
1060
  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;
1053
1061
  return r = String(r).trim(), r.match(e) || r.match(o) ? r : "https://";
1054
1062
  }
1055
- function Dt(t) {
1063
+ function Pt(t) {
1056
1064
  const r = t.anchor, e = t.focus, o = t.anchor.getNode(), i = t.focus.getNode();
1057
- return o === i ? o : t.isBackward() ? lt(e) ? o : i : lt(r) ? o : i;
1065
+ return o === i ? o : t.isBackward() ? at(e) ? o : i : at(r) ? o : i;
1058
1066
  }
1059
- const vn = (t) => (R.baseURL = t, R), U = class extends bt {
1067
+ const fn = (t) => (R.baseURL = t, R), W = class extends wt {
1060
1068
  static getType() {
1061
1069
  return "rutine_link";
1062
1070
  }
1063
1071
  static clone(r) {
1064
- return new U(r.__url, {}, r.__key);
1072
+ return new W(r.__url, {}, r.__key);
1065
1073
  }
1066
1074
  createDOM(r) {
1067
1075
  const e = super.createDOM(r);
1068
1076
  return e.setAttribute("href", this.getURL()), e.setAttribute("target", "_blank"), e.setAttribute("rel", "noopener noreferrer"), e.classList.add("rutine-link"), e;
1069
1077
  }
1070
1078
  static importJSON(r) {
1071
- return Pt(r.url);
1079
+ return Ft(r.url);
1072
1080
  }
1073
1081
  exportJSON() {
1074
1082
  return {
@@ -1080,55 +1088,55 @@ const vn = (t) => (R.baseURL = t, R), U = class extends bt {
1080
1088
  }
1081
1089
  getURL() {
1082
1090
  try {
1083
- return new URL(this.__url, U.baseURL).toString();
1091
+ return new URL(this.__url, W.baseURL).toString();
1084
1092
  } catch {
1085
1093
  return "";
1086
1094
  }
1087
1095
  }
1088
1096
  };
1089
- let R = U;
1090
- at(R, "baseURL", "");
1091
- function Pt(t) {
1097
+ let R = W;
1098
+ it(R, "baseURL", "");
1099
+ function Ft(t) {
1092
1100
  return new R(t);
1093
1101
  }
1094
- function Or(t) {
1102
+ function Rr(t) {
1095
1103
  return t instanceof R;
1096
1104
  }
1097
- const $r = ({ onClose: t }) => {
1105
+ const _r = ({ onClose: t }) => {
1098
1106
  const [r] = y(), e = v(
1099
1107
  (i) => {
1100
1108
  r.update(() => {
1101
- const l = L();
1102
- if (T(l) && l.isCollapsed()) {
1109
+ const l = T();
1110
+ if (L(l) && l.isCollapsed()) {
1103
1111
  const a = l.getNodes();
1104
1112
  if (a.length === 1) {
1105
1113
  const s = a[0];
1106
- Vt(s) && s.getChildren().length === 0 && l.insertText(i);
1114
+ Zt(s) && s.getChildren().length === 0 && l.insertText(i);
1107
1115
  }
1108
1116
  }
1109
- }), r.dispatchCommand(V, At(i));
1117
+ }), r.dispatchCommand(tt, Dt(i));
1110
1118
  },
1111
1119
  [r]
1112
1120
  );
1113
1121
  return /* @__PURE__ */ g("form", { onSubmit: (i) => {
1114
1122
  e(i.target.url.value), t();
1115
1123
  }, children: [
1116
- /* @__PURE__ */ n(we, { name: "url", label: "URL", type: "url", required: !0 }),
1117
- /* @__PURE__ */ g(_t, { children: [
1118
- /* @__PURE__ */ n(O, { onClick: t, children: "Avbryt" }),
1119
- /* @__PURE__ */ n(O, { type: "submit", variant: "primary", children: "Lagre" })
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" })
1120
1128
  ] })
1121
1129
  ] });
1122
- }, Br = ({ onClose: t, getDocs: r }) => {
1130
+ }, Ir = ({ onClose: t, getDocs: r }) => {
1123
1131
  const [e] = y(), [o, i] = b([]), l = r(), a = v(
1124
1132
  (s) => {
1125
1133
  e.update(() => {
1126
- const d = L();
1127
- if (T(d)) {
1134
+ const d = T();
1135
+ if (L(d)) {
1128
1136
  const c = [];
1129
1137
  for (const [f, u] of s.entries()) {
1130
- const m = Pt(u.value);
1131
- m.append(D(u.label)), c.push(m), f !== s.length - 1 && c.push(D(" "));
1138
+ const m = Ft(u.value);
1139
+ m.append(A(u.label)), c.push(m), f !== s.length - 1 && c.push(A(" "));
1132
1140
  }
1133
1141
  d.insertNodes(c);
1134
1142
  }
@@ -1136,12 +1144,12 @@ const $r = ({ onClose: t }) => {
1136
1144
  },
1137
1145
  [e]
1138
1146
  );
1139
- return /* @__PURE__ */ g(Y, { children: [
1140
- /* @__PURE__ */ n(Re, { isMulti: !0, options: l, onChange: i }),
1141
- /* @__PURE__ */ g(_t, { children: [
1142
- /* @__PURE__ */ n(O, { onClick: t, children: "Avbryt" }),
1147
+ 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" }),
1143
1151
  /* @__PURE__ */ n(
1144
- O,
1152
+ z,
1145
1153
  {
1146
1154
  variant: "primary",
1147
1155
  onClick: () => {
@@ -1152,7 +1160,7 @@ const $r = ({ onClose: t }) => {
1152
1160
  )
1153
1161
  ] })
1154
1162
  ] });
1155
- }, Ar = ({
1163
+ }, zr = ({
1156
1164
  open: t,
1157
1165
  onOpenChange: r,
1158
1166
  getDocs: e
@@ -1160,40 +1168,40 @@ const $r = ({ onClose: t }) => {
1160
1168
  const [o, i] = b("url"), l = () => {
1161
1169
  r(!1);
1162
1170
  };
1163
- return /* @__PURE__ */ g(Se, { open: t, onOpenChange: r, css: { width: "600px" }, children: [
1164
- /* @__PURE__ */ g(Ee, { css: { marginBottom: "$8" }, children: [
1165
- /* @__PURE__ */ n(ut, { active: o === "url", onClick: () => i("url"), children: "URL" }),
1166
- /* @__PURE__ */ n(ut, { active: o === "rutine", onClick: () => i("rutine"), children: "Rutine" })
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" })
1167
1175
  ] }),
1168
- o === "url" && /* @__PURE__ */ n($r, { onClose: l }),
1169
- o === "rutine" && /* @__PURE__ */ n(Br, { onClose: l, getDocs: e })
1176
+ o === "url" && /* @__PURE__ */ n(_r, { onClose: l }),
1177
+ o === "rutine" && /* @__PURE__ */ n(Ir, { onClose: l, getDocs: e })
1170
1178
  ] });
1171
- }, Cn = ({ getDocs: t }) => {
1179
+ }, mn = ({ getDocs: t }) => {
1172
1180
  const [r] = y(), [e, o] = b(!1), [i, l] = b(!1), a = v(() => {
1173
- const s = L();
1174
- if (T(s)) {
1175
- const d = Dt(s), c = d.getParent();
1176
- o(W(c) || W(d));
1181
+ const s = T();
1182
+ if (L(s)) {
1183
+ const d = Pt(s), c = d.getParent();
1184
+ o(H(c) || H(d));
1177
1185
  }
1178
1186
  }, []);
1179
- return N(() => r.registerCommand(
1180
- F,
1187
+ return x(() => r.registerCommand(
1188
+ P,
1181
1189
  () => (a(), !1),
1182
- Q
1183
- ), [r, a]), /* @__PURE__ */ g(Nt, { type: "single", value: e ? "link" : "", children: [
1190
+ X
1191
+ ), [r, a]), /* @__PURE__ */ g(Mt, { type: "single", value: e ? "link" : "", children: [
1184
1192
  /* @__PURE__ */ n(
1185
1193
  I,
1186
1194
  {
1187
1195
  onClick: () => {
1188
- e ? r.dispatchCommand(V, null) : l(!0);
1196
+ e ? r.dispatchCommand(tt, null) : l(!0);
1189
1197
  },
1190
1198
  title: "Lenke",
1191
1199
  value: "link",
1192
- children: /* @__PURE__ */ n(dr, { size: "1.25rem" })
1200
+ children: /* @__PURE__ */ n(ar, { size: "1.25rem" })
1193
1201
  }
1194
1202
  ),
1195
1203
  /* @__PURE__ */ n(
1196
- Ar,
1204
+ zr,
1197
1205
  {
1198
1206
  open: i,
1199
1207
  onOpenChange: l,
@@ -1201,67 +1209,67 @@ const $r = ({ onClose: t }) => {
1201
1209
  }
1202
1210
  )
1203
1211
  ] });
1204
- }, Mn = () => {
1205
- const [t] = y(), r = tt(null), [e, o] = b(null), [i, l] = b(""), { hasFocus: a } = ot();
1206
- N(() => {
1212
+ }, kn = () => {
1213
+ const [t] = y(), r = Z(null), [e, o] = b(null), [i, l] = b(""), { hasFocus: a } = nt();
1214
+ x(() => {
1207
1215
  e ? t.update(() => {
1208
1216
  l(e.getURL());
1209
1217
  }) : l("");
1210
1218
  }, [t, e]);
1211
- const s = !!(e && i && a), { refs: d, floatingStyles: c, context: f } = rt({
1219
+ const s = !!(e && i && a), { refs: d, floatingStyles: c, context: f } = V({
1212
1220
  placement: "top",
1213
1221
  strategy: "fixed",
1214
1222
  open: s,
1215
- whileElementsMounted: yt,
1223
+ whileElementsMounted: Ct,
1216
1224
  elements: {
1217
1225
  reference: r.current
1218
1226
  },
1219
- middleware: [_e()]
1220
- }), { getFloatingProps: u } = St([
1221
- Et(f),
1222
- Ie(f)
1227
+ middleware: [he()]
1228
+ }), { getFloatingProps: u } = Lt([
1229
+ xt(f),
1230
+ pe(f)
1223
1231
  ]), m = v(() => {
1224
1232
  var S;
1225
- const k = L();
1226
- if (T(k)) {
1227
- const B = Dt(k), p = B.getParent();
1228
- let H = null;
1229
- if (W(p) ? H = p : W(B) && (H = B), H) {
1230
- const q = window.getSelection(), it = t.getRootElement();
1231
- k !== null && q !== null && it !== null && it.contains(q.anchorNode) && t.isEditable() && (r.current = ((S = q.focusNode) == null ? void 0 : S.parentElement) ?? null);
1233
+ const k = T();
1234
+ if (L(k)) {
1235
+ const $ = Pt(k), p = $.getParent();
1236
+ let F = null;
1237
+ if (H(p) ? F = p : H($) && (F = $), F) {
1238
+ const q = window.getSelection(), ot = t.getRootElement();
1239
+ k !== null && q !== null && ot !== null && ot.contains(q.anchorNode) && t.isEditable() && (r.current = ((S = q.focusNode) == null ? void 0 : S.parentElement) ?? null);
1232
1240
  }
1233
- o(H);
1241
+ o(F);
1234
1242
  }
1235
1243
  }, [t]), E = v(() => {
1236
- e && Or(e) && t.update(() => {
1244
+ e && Rr(e) && t.update(() => {
1237
1245
  e.remove();
1238
- }), t.dispatchCommand(V, null);
1246
+ }), t.dispatchCommand(tt, null);
1239
1247
  }, [t, e]);
1240
- if (N(() => {
1248
+ if (x(() => {
1241
1249
  t.getEditorState().read(() => {
1242
1250
  m();
1243
1251
  });
1244
- }, [t, m]), N(() => nt(
1252
+ }, [t, m]), x(() => rt(
1245
1253
  t.registerUpdateListener(({ editorState: k }) => {
1246
1254
  k.read(() => {
1247
1255
  m();
1248
1256
  });
1249
1257
  }),
1250
1258
  t.registerCommand(
1251
- F,
1259
+ P,
1252
1260
  () => (m(), !0),
1253
1261
  w
1254
1262
  ),
1255
1263
  t.registerCommand(
1256
- kt,
1264
+ mt,
1257
1265
  () => e ? (o(null), !0) : !1,
1258
- Zt
1266
+ te
1259
1267
  )
1260
1268
  ), [t, m, e]), !s)
1261
1269
  return null;
1262
- const x = At(i);
1263
- return /* @__PURE__ */ n(wt, { children: /* @__PURE__ */ g(
1264
- Rt,
1270
+ const N = Dt(i);
1271
+ return /* @__PURE__ */ n(yt, { children: /* @__PURE__ */ g(
1272
+ Nt,
1265
1273
  {
1266
1274
  ref: d.setFloating,
1267
1275
  css: {
@@ -1275,7 +1283,7 @@ const $r = ({ onClose: t }) => {
1275
1283
  ...u(),
1276
1284
  children: [
1277
1285
  /* @__PURE__ */ n(
1278
- P,
1286
+ D,
1279
1287
  {
1280
1288
  as: "a",
1281
1289
  css: {
@@ -1285,39 +1293,39 @@ const $r = ({ onClose: t }) => {
1285
1293
  textOverflow: "ellipsis",
1286
1294
  marginRight: "$4"
1287
1295
  },
1288
- href: x,
1289
- title: x,
1296
+ href: N,
1297
+ title: N,
1290
1298
  target: "_blank",
1291
1299
  rel: "noreferrer",
1292
1300
  children: i
1293
1301
  }
1294
1302
  ),
1295
- /* @__PURE__ */ n(O, { color: "danger", icon: !0, size: "sm", onClick: E, children: /* @__PURE__ */ n(Ae, { size: 24 }) })
1303
+ /* @__PURE__ */ n(z, { color: "danger", icon: !0, size: "sm", onClick: E, children: /* @__PURE__ */ n(De, { size: 24 }) })
1296
1304
  ]
1297
1305
  }
1298
1306
  ) });
1299
1307
  };
1300
1308
  export {
1301
- Pt as $createRutineLinkNode,
1302
- Or as $isRutineLinkNode,
1303
- Tr as FloatingToolbar,
1304
- kn as InsertSelector,
1305
- Mn as LinkEditPlugin,
1306
- Cn as LinkToolbarButton,
1307
- fn as RichTextEditor,
1308
- Nr as RichTextToolbar,
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,
1309
1317
  R as RutineLinkNode,
1310
- vn as RutineLinkNodeInit,
1311
- bn as TableEditPlugin,
1312
- Ke as clearEditorState,
1313
- gn as defaultNodes,
1314
- je as isEditorState,
1315
- zt as isJSON,
1316
- Ot as richTextContext,
1317
- mn as richTextCss,
1318
- Ir as richTextStyleObj,
1319
- Ye as setStateFromPlainText,
1320
- pn as stateToHTML,
1321
- Ze as useHasFocusWithin,
1322
- ot as useRichTextContext
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,
1330
+ nt as useRichTextContext
1323
1331
  };