@arkitektbedriftene/fe-lib 0.4.6 → 0.4.8

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,30 +1,29 @@
1
- import { createHeadlessEditor as kt } from "@lexical/headless";
2
- import { $generateHtmlFromNodes as Mt } from "@lexical/html";
3
- import { $getRoot as O, ParagraphNode as Ct, $createParagraphNode as B, $createTextNode as A, $setSelection as Z, SELECTION_CHANGE_COMMAND as W, $getSelection as T, COMMAND_PRIORITY_CRITICAL as tt, $isRangeSelection as L, $isRootOrShadowRoot as bt, DEPRECATED_$isGridSelection as F, FORMAT_TEXT_COMMAND as _, COMMAND_PRIORITY_LOW as y, KEY_ARROW_DOWN_COMMAND as vt, KEY_ARROW_UP_COMMAND as Tt, KEY_ESCAPE_COMMAND as Lt, KEY_SPACE_COMMAND as yt, $getNearestNodeFromDOMNode as j, KEY_ARROW_LEFT_COMMAND as xt, $isElementNode as Nt, COMMAND_PRIORITY_NORMAL as Et } from "lexical";
4
- import { trimTextContentFromAnchor as St, $setBlocksType as D } from "@lexical/selection";
5
- import { AutoLinkNode as wt, LinkNode as zt } from "@lexical/link";
6
- import { ListNode as et, ListItemNode as It, $isListNode as K, INSERT_UNORDERED_LIST_COMMAND as _t, INSERT_ORDERED_LIST_COMMAND as $t, INSERT_CHECK_LIST_COMMAND as rt, insertList as Rt, $isListItemNode as N } from "@lexical/list";
7
- import { HeadingNode as Ot, QuoteNode as Bt, $isHeadingNode as Pt, $createHeadingNode as Ft, $createQuoteNode as Dt } from "@lexical/rich-text";
8
- import { TableNode as Ht, TableRowNode as At, TableCellNode as Wt, $getTableCellNodeFromLexicalNode as jt, $deleteTableColumn__EXPERIMENTAL as Kt, $deleteTableRow__EXPERIMENTAL as Ut, $insertTableColumn__EXPERIMENTAL as Y, $insertTableRow__EXPERIMENTAL as q } from "@lexical/table";
9
- import { jsx as r, jsxs as b, Fragment as U } from "react/jsx-runtime";
10
- import { createContext as Yt, useState as M, useRef as ot, useCallback as C, useContext as qt, useEffect as E, useMemo as nt, useLayoutEffect as Xt } from "react";
11
- import { c as S, s as at, D as it, T as Gt, a as f, B as R, b as Qt, d as $, u as lt, e as Vt, f as Jt, g as Zt, o as st, h as te, i as ee, j as re, F as oe, O as ne, k as ae, l as ie, S as le, m as se, n as x, p as X } from "./TextInput-bedd6814.js";
1
+ import { createHeadlessEditor as zt } from "@lexical/headless";
2
+ import { $generateHtmlFromNodes as Rt } from "@lexical/html";
3
+ import { $getRoot as H, ParagraphNode as _t, $createParagraphNode as W, $createTextNode as q, $setSelection as ct, SELECTION_CHANGE_COMMAND as A, $getSelection as T, COMMAND_PRIORITY_CRITICAL as X, $isRangeSelection as y, $isRootOrShadowRoot as $t, DEPRECATED_$isGridSelection as U, FORMAT_TEXT_COMMAND as O, COMMAND_PRIORITY_LOW as w, KEY_ARROW_DOWN_COMMAND as Ot, KEY_ARROW_UP_COMMAND as Pt, KEY_ESCAPE_COMMAND as ht, KEY_SPACE_COMMAND as At, $getNearestNodeFromDOMNode as Q, KEY_ARROW_LEFT_COMMAND as Bt, $isElementNode as Dt, COMMAND_PRIORITY_NORMAL as Ft, $isParagraphNode as Ht, COMMAND_PRIORITY_HIGH as Wt } from "lexical";
4
+ import { trimTextContentFromAnchor as jt, $setBlocksType as K, $isAtNodeEnd as rt } from "@lexical/selection";
5
+ import { AutoLinkNode as Ut, LinkNode as Kt, $isLinkNode as P, TOGGLE_LINK_COMMAND as Y, $isAutoLinkNode as Yt } from "@lexical/link";
6
+ import { ListNode as ut, ListItemNode as Gt, $isListNode as V, INSERT_UNORDERED_LIST_COMMAND as qt, INSERT_ORDERED_LIST_COMMAND as Xt, INSERT_CHECK_LIST_COMMAND as pt, insertList as Qt, $isListItemNode as _ } from "@lexical/list";
7
+ import { HeadingNode as Vt, QuoteNode as Jt, $isHeadingNode as Zt, $createHeadingNode as te, $createQuoteNode as ee } from "@lexical/rich-text";
8
+ import { TableNode as re, TableRowNode as oe, TableCellNode as ne, $getTableCellNodeFromLexicalNode as ae, $deleteTableColumn__EXPERIMENTAL as ie, $deleteTableRow__EXPERIMENTAL as le, $insertTableColumn__EXPERIMENTAL as ot, $insertTableRow__EXPERIMENTAL as nt } from "@lexical/table";
9
+ import { jsx as r, jsxs as C, Fragment as j } from "react/jsx-runtime";
10
+ import { createContext as se, useState as f, useRef as J, useCallback as L, useContext as de, useEffect as E, useMemo as gt, useLayoutEffect as ce } from "react";
11
+ import { c as $, s as ft, D as mt, T as he, a as b, B, b as ue, d as R, u as Z, e as kt, f as pe, g as ge, o as vt, h as fe, i as Ct, j as Mt, F as bt, O as Lt, k as me, l as ke, S as ve, m as D, n as z, p as at, q as Ce, r as Me, t as be, v as Le, w as Te, x as ye } from "./TextInput-986922b7.js";
12
12
  import "react-select";
13
- import { LexicalComposer as de } from "@lexical/react/LexicalComposer.js";
14
- import { RichTextPlugin as ce } from "@lexical/react/LexicalRichTextPlugin.js";
15
- import he from "@lexical/react/LexicalErrorBoundary.js";
16
- import { useLexicalComposerContext as P } from "@lexical/react/LexicalComposerContext.js";
17
- import { $getNearestNodeOfType as ue, $findMatchingParent as dt, mergeRegister as ct, isHTMLElement as G } from "@lexical/utils";
18
- import { G as c } from "./index.esm-969855d2.js";
19
- import { ListPlugin as pe } from "@lexical/react/LexicalListPlugin.js";
20
- import { HistoryPlugin as ge } from "@lexical/react/LexicalHistoryPlugin.js";
21
- import { TablePlugin as me } from "@lexical/react/LexicalTablePlugin.js";
22
- import { TabIndentationPlugin as fe } from "@lexical/react/LexicalTabIndentationPlugin.js";
23
- import { useLexicalComposerContext as ke } from "@lexical/react/LexicalComposerContext";
13
+ import { LexicalComposer as Ne } from "@lexical/react/LexicalComposer.js";
14
+ import { RichTextPlugin as Ee } from "@lexical/react/LexicalRichTextPlugin.js";
15
+ import xe from "@lexical/react/LexicalErrorBoundary.js";
16
+ import { useLexicalComposerContext as I } from "@lexical/react/LexicalComposerContext.js";
17
+ import { $getNearestNodeOfType as Se, $findMatchingParent as F, mergeRegister as tt, isHTMLElement as it } from "@lexical/utils";
18
+ import { G as p, f as we } from "./index.esm-b848a615.js";
19
+ import { ListPlugin as Ie } from "@lexical/react/LexicalListPlugin.js";
20
+ import { HistoryPlugin as ze } from "@lexical/react/LexicalHistoryPlugin.js";
21
+ import { TablePlugin as Re } from "@lexical/react/LexicalTablePlugin.js";
22
+ import { TabIndentationPlugin as _e } from "@lexical/react/LexicalTabIndentationPlugin.js";
24
23
  import "react-dom";
25
24
  import "@radix-ui/react-toolbar";
26
25
  import "@radix-ui/react-dropdown-menu";
27
- const Me = ({
26
+ const $e = ({
28
27
  text: t,
29
28
  maxChars: e,
30
29
  maxLines: o
@@ -39,55 +38,55 @@ const Me = ({
39
38
  t[i] === `
40
39
  ` && l++, i++;
41
40
  return t.slice(0, i).length;
42
- }, Ce = ({
41
+ }, Oe = ({
43
42
  editor: t,
44
43
  maxChars: e,
45
44
  maxLines: o
46
45
  }) => {
47
- const n = O(), a = n.getTextContent(), l = Me({ text: a, maxChars: e, maxLines: o }), i = a.length - l, h = n.select().anchor;
48
- St(t, h, i);
46
+ const n = H(), a = n.getTextContent(), l = $e({ text: a, maxChars: e, maxLines: o }), i = a.length - l, c = n.select().anchor;
47
+ jt(t, c, i);
49
48
  const s = n.getLastChild();
50
- return s instanceof Ct && s.getChildrenSize() === 0 && s.remove(), i;
51
- }, ht = (t) => t[0] === "{", be = (t) => t !== null && typeof t == "object" && "isEmpty" in t, ve = (t, e) => {
49
+ return s instanceof _t && s.getChildrenSize() === 0 && s.remove(), i;
50
+ }, Tt = (t) => t[0] === "{", Pe = (t) => t !== null && typeof t == "object" && "isEmpty" in t, Ae = (t, e) => {
52
51
  t.update(
53
52
  () => {
54
- const o = O();
53
+ const o = H();
55
54
  o.clear();
56
- const n = B();
57
- n.append(A("")), o.append(n), Z(null);
55
+ const n = W();
56
+ n.append(q("")), o.append(n), ct(null);
58
57
  },
59
58
  {
60
59
  tag: e
61
60
  }
62
61
  );
63
- }, Te = (t, e, o) => {
62
+ }, Be = (t, e, o) => {
64
63
  e.update(
65
64
  () => {
66
- const n = O();
65
+ const n = H();
67
66
  n.clear();
68
- const a = B();
69
- a.append(A(t.trim())), n.append(a), Z(null);
67
+ const a = W();
68
+ a.append(q(t.trim())), n.append(a), ct(null);
70
69
  },
71
70
  {
72
71
  tag: o
73
72
  }
74
73
  ), e.blur();
75
- }, $r = (t, e, o) => {
74
+ }, Qr = (t, e, o) => {
76
75
  let n = 0;
77
- const a = kt({
76
+ const a = zt({
78
77
  nodes: e,
79
78
  editable: !1
80
79
  });
81
80
  if (t)
82
81
  try {
83
- if (typeof t == "string" && !ht(t))
82
+ if (typeof t == "string" && !Tt(t))
84
83
  a.update(() => {
85
- const i = O(), d = B();
86
- d.append(A(t.trim())), i.append(d);
84
+ const i = H(), d = W();
85
+ d.append(q(t.trim())), i.append(d);
87
86
  });
88
87
  else {
89
88
  const i = a.parseEditorState(t, () => {
90
- n = Ce({
89
+ n = Oe({
91
90
  editor: a,
92
91
  maxLines: o == null ? void 0 : o.maxLines
93
92
  });
@@ -99,48 +98,48 @@ const Me = ({
99
98
  }
100
99
  let l = "";
101
100
  return a.update(() => {
102
- l = Mt(a);
101
+ l = Rt(a);
103
102
  }), { html: l, trimCount: n };
104
- }, Rr = [
105
- Ot,
106
- Bt,
107
- et,
108
- It,
109
- wt,
110
- zt,
111
- Ht,
112
- At,
113
- Wt
114
- ], Le = S({
103
+ }, Vr = [
104
+ Vt,
105
+ Jt,
106
+ ut,
107
+ Gt,
108
+ Ut,
109
+ Kt,
110
+ re,
111
+ oe,
112
+ ne
113
+ ], De = $({
115
114
  fontWeight: "bold"
116
- }), ye = S({
115
+ }), Fe = $({
117
116
  fontStyle: "italic"
118
- }), xe = S({
117
+ }), He = $({
119
118
  textDecoration: "underline"
120
- }), Ne = S({
119
+ }), We = $({
121
120
  listStyleType: "none"
122
- }), Ee = S({
121
+ }), je = $({
123
122
  borderLeft: "4px solid #ccc",
124
123
  color: "#666",
125
124
  fontStyle: "italic",
126
125
  margin: "1.5em 10px",
127
126
  padding: "0.5em 10px"
128
- }), Se = {
129
- quote: Ee().className,
127
+ }), Ue = {
128
+ quote: je().className,
130
129
  text: {
131
- bold: Le().className,
132
- italic: ye().className,
133
- underline: xe().className
130
+ bold: De().className,
131
+ italic: Fe().className,
132
+ underline: He().className
134
133
  },
135
134
  list: {
136
135
  nested: {
137
- listitem: Ne().className
136
+ listitem: We().className
138
137
  }
139
138
  }
140
- }, ut = Yt({ hasFocus: !1, editorRef: { current: null } }), we = ({ onBlur: t }) => {
141
- const [e, o] = M(!1), n = ot(null), a = C(() => {
139
+ }, yt = se({ hasFocus: !1, editorRef: { current: null } }), Ke = ({ onBlur: t }) => {
140
+ const [e, o] = f(!1), n = J(null), a = L(() => {
142
141
  o(!0), n.current && window.clearTimeout(n.current);
143
- }, []), l = C(() => {
142
+ }, []), l = L(() => {
144
143
  n.current = window.setTimeout(() => {
145
144
  o(!1), t == null || t();
146
145
  }, 0);
@@ -152,59 +151,62 @@ const Me = ({
152
151
  onBlur: l
153
152
  }
154
153
  };
155
- }, pt = () => qt(ut);
156
- function ze(t) {
157
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 5h6a3.5 3.5 0 0 1 0 7h-6z" } }, { tag: "path", attr: { d: "M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7" } }] })(t);
154
+ }, et = () => de(yt);
155
+ function Ye(t) {
156
+ return p({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 5h6a3.5 3.5 0 0 1 0 7h-6z" } }, { tag: "path", attr: { d: "M13 12h1a3.5 3.5 0 0 1 0 7h-7v-7" } }] })(t);
158
157
  }
159
- function Ie(t) {
160
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 8l-4 4l4 4" } }, { tag: "path", attr: { d: "M17 8l4 4l-4 4" } }, { tag: "path", attr: { d: "M14 4l-4 16" } }] })(t);
158
+ function Ge(t) {
159
+ return p({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 8l-4 4l4 4" } }, { tag: "path", attr: { d: "M17 8l4 4l-4 4" } }, { tag: "path", attr: { d: "M14 4l-4 16" } }] })(t);
161
160
  }
162
- function _e(t) {
163
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 18v-8l-2 2" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
161
+ function qe(t) {
162
+ return p({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 18v-8l-2 2" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
164
163
  }
165
- function $e(t) {
166
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M17 12a2 2 0 1 1 4 0c0 .591 -.417 1.318 -.816 1.858l-3.184 4.143l4 0" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
164
+ function Xe(t) {
165
+ return p({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M17 12a2 2 0 1 1 4 0c0 .591 -.417 1.318 -.816 1.858l-3.184 4.143l4 0" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
167
166
  }
168
- function Re(t) {
169
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 14a2 2 0 1 0 -2 -2" } }, { tag: "path", attr: { d: "M17 16a2 2 0 1 0 2 -2" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
167
+ function Qe(t) {
168
+ return p({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 14a2 2 0 1 0 -2 -2" } }, { tag: "path", attr: { d: "M17 16a2 2 0 1 0 2 -2" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
170
169
  }
171
- function Oe(t) {
172
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M20 18v-8l-4 6h5" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
170
+ function Ve(t) {
171
+ return p({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M20 18v-8l-4 6h5" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
173
172
  }
174
- function Be(t) {
175
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M17 18h2a2 2 0 1 0 0 -4h-2v-4h4" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
173
+ function Je(t) {
174
+ return p({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M17 18h2a2 2 0 1 0 0 -4h-2v-4h4" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
176
175
  }
177
- function Pe(t) {
178
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 14a2 2 0 1 0 0 4a2 2 0 0 0 0 -4z" } }, { tag: "path", attr: { d: "M21 12a2 2 0 1 0 -4 0v4" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
176
+ function Ze(t) {
177
+ return p({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M19 14a2 2 0 1 0 0 4a2 2 0 0 0 0 -4z" } }, { tag: "path", attr: { d: "M21 12a2 2 0 1 0 -4 0v4" } }, { tag: "path", attr: { d: "M4 6v12" } }, { tag: "path", attr: { d: "M12 6v12" } }, { tag: "path", attr: { d: "M11 18h2" } }, { tag: "path", attr: { d: "M3 18h2" } }, { tag: "path", attr: { d: "M4 12h8" } }, { tag: "path", attr: { d: "M3 6h2" } }, { tag: "path", attr: { d: "M11 6h2" } }] })(t);
179
178
  }
180
- function Fe(t) {
181
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M11 5l6 0" } }, { tag: "path", attr: { d: "M7 19l6 0" } }, { tag: "path", attr: { d: "M14 5l-4 14" } }] })(t);
179
+ function tr(t) {
180
+ return p({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M11 5l6 0" } }, { tag: "path", attr: { d: "M7 19l6 0" } }, { tag: "path", attr: { d: "M14 5l-4 14" } }] })(t);
181
+ }
182
+ function er(t) {
183
+ return p({ 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);
182
184
  }
183
- function De(t) {
184
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M17.5 15.5m-3.5 0a3.5 3.5 0 1 0 7 0a3.5 3.5 0 1 0 -7 0" } }, { tag: "path", attr: { d: "M3 19v-10.5a3.5 3.5 0 0 1 7 0v10.5" } }, { tag: "path", attr: { d: "M3 13h7" } }, { tag: "path", attr: { d: "M21 12v7" } }] })(t);
185
+ function rr(t) {
186
+ return p({ 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);
185
187
  }
186
- function He(t) {
187
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M3.5 5.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M3.5 11.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M3.5 17.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M11 6l9 0" } }, { tag: "path", attr: { d: "M11 12l9 0" } }, { tag: "path", attr: { d: "M11 18l9 0" } }] })(t);
188
+ function or(t) {
189
+ return p({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M3.5 5.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M3.5 11.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M3.5 17.5l1.5 1.5l2.5 -2.5" } }, { tag: "path", attr: { d: "M11 6l9 0" } }, { tag: "path", attr: { d: "M11 12l9 0" } }, { tag: "path", attr: { d: "M11 18l9 0" } }] })(t);
188
190
  }
189
- function Ae(t) {
190
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M11 6h9" } }, { tag: "path", attr: { d: "M11 12h9" } }, { tag: "path", attr: { d: "M12 18h8" } }, { tag: "path", attr: { d: "M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4" } }, { tag: "path", attr: { d: "M6 10v-6l-2 2" } }] })(t);
191
+ function nr(t) {
192
+ return p({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M11 6h9" } }, { tag: "path", attr: { d: "M11 12h9" } }, { tag: "path", attr: { d: "M12 18h8" } }, { tag: "path", attr: { d: "M4 16a2 2 0 1 1 4 0c0 .591 -.5 1 -1 1.5l-3 2.5h4" } }, { tag: "path", attr: { d: "M6 10v-6l-2 2" } }] })(t);
191
193
  }
192
- function We(t) {
193
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M9 6l11 0" } }, { tag: "path", attr: { d: "M9 12l11 0" } }, { tag: "path", attr: { d: "M9 18l11 0" } }, { tag: "path", attr: { d: "M5 6l0 .01" } }, { tag: "path", attr: { d: "M5 12l0 .01" } }, { tag: "path", attr: { d: "M5 18l0 .01" } }] })(t);
194
+ function ar(t) {
195
+ return p({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M9 6l11 0" } }, { tag: "path", attr: { d: "M9 12l11 0" } }, { tag: "path", attr: { d: "M9 18l11 0" } }, { tag: "path", attr: { d: "M5 6l0 .01" } }, { tag: "path", attr: { d: "M5 12l0 .01" } }, { tag: "path", attr: { d: "M5 18l0 .01" } }] })(t);
194
196
  }
195
- function je(t) {
196
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M10 11h-4a1 1 0 0 1 -1 -1v-3a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v6c0 2.667 -1.333 4.333 -4 5" } }, { tag: "path", attr: { d: "M19 11h-4a1 1 0 0 1 -1 -1v-3a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v6c0 2.667 -1.333 4.333 -4 5" } }] })(t);
197
+ function ir(t) {
198
+ return p({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M10 11h-4a1 1 0 0 1 -1 -1v-3a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v6c0 2.667 -1.333 4.333 -4 5" } }, { tag: "path", attr: { d: "M19 11h-4a1 1 0 0 1 -1 -1v-3a1 1 0 0 1 1 -1h3a1 1 0 0 1 1 1v6c0 2.667 -1.333 4.333 -4 5" } }] })(t);
197
199
  }
198
- function Ke(t) {
199
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M5 7l8 10m-8 0l8 -10" } }, { tag: "path", attr: { d: "M21 11h-4l3.5 -4a1.73 1.73 0 0 0 -3.5 -2" } }] })(t);
200
+ function lr(t) {
201
+ return p({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M5 7l8 10m-8 0l8 -10" } }, { tag: "path", attr: { d: "M21 11h-4l3.5 -4a1.73 1.73 0 0 0 -3.5 -2" } }] })(t);
200
202
  }
201
- function Ue(t) {
202
- return c({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 5v5a5 5 0 0 0 10 0v-5" } }, { tag: "path", attr: { d: "M5 19h14" } }] })(t);
203
+ function sr(t) {
204
+ return p({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" } }, { tag: "path", attr: { d: "M7 5v5a5 5 0 0 0 10 0v-5" } }, { tag: "path", attr: { d: "M5 19h14" } }] })(t);
203
205
  }
204
- const Ye = at("div", {
206
+ const dr = ft("div", {
205
207
  width: "10rem",
206
208
  display: "flex"
207
- }), gt = {
209
+ }), Nt = {
208
210
  bullet: "Punktliste",
209
211
  h1: "Overskrift 1",
210
212
  h2: "Overskrift 2",
@@ -216,24 +218,24 @@ const Ye = at("div", {
216
218
  paragraph: "Normal",
217
219
  quote: "Sitat",
218
220
  check: "Avkrysningsliste"
219
- }, qe = {
220
- bullet: /* @__PURE__ */ r(We, { size: "1.25rem" }),
221
- h1: /* @__PURE__ */ r(_e, { size: "1.25rem" }),
222
- h2: /* @__PURE__ */ r($e, { size: "1.25rem" }),
223
- h3: /* @__PURE__ */ r(Re, { size: "1.25rem" }),
224
- h4: /* @__PURE__ */ r(Oe, { size: "1.25rem" }),
225
- h5: /* @__PURE__ */ r(Be, { size: "1.25rem" }),
226
- h6: /* @__PURE__ */ r(Pe, { size: "1.25rem" }),
227
- number: /* @__PURE__ */ r(Ae, { size: "1.25rem" }),
228
- check: /* @__PURE__ */ r(He, { size: "1.25rem" }),
229
- paragraph: /* @__PURE__ */ r(De, { size: "1.25rem" }),
230
- quote: /* @__PURE__ */ r(je, { size: "1.25rem" })
231
- }, m = ({
221
+ }, cr = {
222
+ bullet: /* @__PURE__ */ r(ar, { size: "1.25rem" }),
223
+ h1: /* @__PURE__ */ r(qe, { size: "1.25rem" }),
224
+ h2: /* @__PURE__ */ r(Xe, { size: "1.25rem" }),
225
+ h3: /* @__PURE__ */ r(Qe, { size: "1.25rem" }),
226
+ h4: /* @__PURE__ */ r(Ve, { size: "1.25rem" }),
227
+ h5: /* @__PURE__ */ r(Je, { size: "1.25rem" }),
228
+ h6: /* @__PURE__ */ r(Ze, { size: "1.25rem" }),
229
+ number: /* @__PURE__ */ r(nr, { size: "1.25rem" }),
230
+ check: /* @__PURE__ */ r(or, { size: "1.25rem" }),
231
+ paragraph: /* @__PURE__ */ r(er, { size: "1.25rem" }),
232
+ quote: /* @__PURE__ */ r(ir, { size: "1.25rem" })
233
+ }, v = ({
232
234
  blockType: t
233
- }) => /* @__PURE__ */ b(U, { children: [
234
- /* @__PURE__ */ r(R, { css: { display: "flex", flex: "0 0 auto" }, children: qe[t] }),
235
+ }) => /* @__PURE__ */ C(j, { children: [
236
+ /* @__PURE__ */ r(B, { css: { display: "flex", flex: "0 0 auto" }, children: cr[t] }),
235
237
  /* @__PURE__ */ r(
236
- R,
238
+ B,
237
239
  {
238
240
  css: {
239
241
  flex: "1 1 auto",
@@ -241,205 +243,205 @@ const Ye = at("div", {
241
243
  textOverflow: "ellipsis",
242
244
  whiteSpace: "nowrap"
243
245
  },
244
- children: gt[t]
246
+ children: Nt[t]
245
247
  }
246
248
  )
247
- ] }), Xe = (t) => {
248
- if (!L(t))
249
+ ] }), hr = (t) => {
250
+ if (!y(t))
249
251
  return null;
250
252
  const e = t.anchor.getNode();
251
- let o = e.getKey() === "root" ? e : dt(e, (n) => {
253
+ let o = e.getKey() === "root" ? e : F(e, (n) => {
252
254
  const a = n.getParent();
253
- return a !== null && bt(a);
255
+ return a !== null && $t(a);
254
256
  });
255
257
  return o === null && (o = e.getTopLevelElementOrThrow()), {
256
258
  anchorNode: e,
257
259
  element: o
258
260
  };
259
- }, Ge = () => {
260
- const [t] = P(), [e, o] = M("paragraph");
261
+ }, ur = () => {
262
+ const [t] = I(), [e, o] = f("paragraph");
261
263
  E(() => t.registerCommand(
262
- W,
264
+ A,
263
265
  () => {
264
- const s = T(), g = Xe(s);
265
- if (!g)
266
+ const s = T(), h = hr(s);
267
+ if (!h)
266
268
  return !1;
267
- const { element: p, anchorNode: v } = g, w = p.getKey();
268
- if (t.getElementByKey(w) !== null)
269
- if (K(p)) {
270
- const k = ue(
271
- v,
272
- et
273
- ), I = k ? k.getListType() : p.getListType();
274
- o(I);
269
+ const { element: g, anchorNode: m } = h, M = g.getKey();
270
+ if (t.getElementByKey(M) !== null)
271
+ if (V(g)) {
272
+ const k = Se(
273
+ m,
274
+ ut
275
+ ), x = k ? k.getListType() : g.getListType();
276
+ o(x);
275
277
  } else {
276
- const k = Pt(p) ? p.getTag() : p.getType();
277
- k in gt && o(k);
278
+ const k = Zt(g) ? g.getTag() : g.getType();
279
+ k in Nt && o(k);
278
280
  }
279
281
  return !1;
280
282
  },
281
- tt
283
+ X
282
284
  ), [t]);
283
285
  const n = (s) => {
284
286
  e !== s && t.update(() => {
285
- const g = T();
286
- (L(g) || F(g)) && (D(g, () => Ft(s)), o(s));
287
+ const h = T();
288
+ (y(h) || U(h)) && (K(h, () => te(s)), o(s));
287
289
  });
288
290
  };
289
- return /* @__PURE__ */ r(Ye, { children: /* @__PURE__ */ b(
290
- it,
291
+ return /* @__PURE__ */ r(dr, { children: /* @__PURE__ */ C(
292
+ mt,
291
293
  {
292
294
  trigger: /* @__PURE__ */ r(
293
- Gt,
295
+ he,
294
296
  {
295
297
  dropdown: !0,
296
298
  css: { display: "flex", width: "100%", overflow: "hidden" },
297
- children: /* @__PURE__ */ r(m, { blockType: e })
299
+ children: /* @__PURE__ */ r(v, { blockType: e })
298
300
  }
299
301
  ),
300
302
  side: "bottom",
301
303
  align: "start",
302
304
  children: [
303
- /* @__PURE__ */ r(f, { onClick: () => {
305
+ /* @__PURE__ */ r(b, { onClick: () => {
304
306
  e !== "paragraph" && t.update(() => {
305
307
  const s = T();
306
- (L(s) || F(s)) && (D(s, () => B()), o("paragraph"));
308
+ (y(s) || U(s)) && (K(s, () => W()), o("paragraph"));
307
309
  });
308
- }, children: /* @__PURE__ */ r(m, { blockType: "paragraph" }) }),
309
- /* @__PURE__ */ r(f, { onClick: () => n("h1"), children: /* @__PURE__ */ r(m, { blockType: "h1" }) }),
310
- /* @__PURE__ */ r(f, { onClick: () => n("h2"), children: /* @__PURE__ */ r(m, { blockType: "h2" }) }),
311
- /* @__PURE__ */ r(f, { onClick: () => n("h3"), children: /* @__PURE__ */ r(m, { blockType: "h3" }) }),
312
- /* @__PURE__ */ r(f, { onClick: () => n("h4"), children: /* @__PURE__ */ r(m, { blockType: "h4" }) }),
313
- /* @__PURE__ */ r(f, { onClick: () => n("h5"), children: /* @__PURE__ */ r(m, { blockType: "h5" }) }),
314
- /* @__PURE__ */ r(f, { onClick: () => n("h6"), children: /* @__PURE__ */ r(m, { blockType: "h6" }) }),
315
- /* @__PURE__ */ r(f, { onClick: () => {
316
- e !== "bullet" && (t.dispatchCommand(_t, void 0), o("bullet"));
317
- }, children: /* @__PURE__ */ r(m, { blockType: "bullet" }) }),
318
- /* @__PURE__ */ r(f, { onClick: () => {
319
- e !== "number" && (t.dispatchCommand($t, void 0), o("number"));
320
- }, children: /* @__PURE__ */ r(m, { blockType: "number" }) }),
321
- /* @__PURE__ */ r(f, { onClick: () => {
322
- e !== "check" && (t.dispatchCommand(rt, void 0), o("check"));
323
- }, children: /* @__PURE__ */ r(m, { blockType: "check" }) }),
324
- /* @__PURE__ */ r(f, { onClick: () => {
310
+ }, children: /* @__PURE__ */ r(v, { blockType: "paragraph" }) }),
311
+ /* @__PURE__ */ r(b, { onClick: () => n("h1"), children: /* @__PURE__ */ r(v, { blockType: "h1" }) }),
312
+ /* @__PURE__ */ r(b, { onClick: () => n("h2"), children: /* @__PURE__ */ r(v, { blockType: "h2" }) }),
313
+ /* @__PURE__ */ r(b, { onClick: () => n("h3"), children: /* @__PURE__ */ r(v, { blockType: "h3" }) }),
314
+ /* @__PURE__ */ r(b, { onClick: () => n("h4"), children: /* @__PURE__ */ r(v, { blockType: "h4" }) }),
315
+ /* @__PURE__ */ r(b, { onClick: () => n("h5"), children: /* @__PURE__ */ r(v, { blockType: "h5" }) }),
316
+ /* @__PURE__ */ r(b, { onClick: () => n("h6"), children: /* @__PURE__ */ r(v, { blockType: "h6" }) }),
317
+ /* @__PURE__ */ r(b, { onClick: () => {
318
+ e !== "bullet" && (t.dispatchCommand(qt, void 0), o("bullet"));
319
+ }, children: /* @__PURE__ */ r(v, { blockType: "bullet" }) }),
320
+ /* @__PURE__ */ r(b, { onClick: () => {
321
+ e !== "number" && (t.dispatchCommand(Xt, void 0), o("number"));
322
+ }, children: /* @__PURE__ */ r(v, { blockType: "number" }) }),
323
+ /* @__PURE__ */ r(b, { onClick: () => {
324
+ e !== "check" && (t.dispatchCommand(pt, void 0), o("check"));
325
+ }, children: /* @__PURE__ */ r(v, { blockType: "check" }) }),
326
+ /* @__PURE__ */ r(b, { onClick: () => {
325
327
  e !== "quote" && t.update(() => {
326
328
  const s = T();
327
- (L(s) || F(s)) && (D(s, () => Dt()), o("quote"));
329
+ (y(s) || U(s)) && (K(s, () => ee()), o("quote"));
328
330
  });
329
- }, children: /* @__PURE__ */ r(m, { blockType: "quote" }) })
331
+ }, children: /* @__PURE__ */ r(v, { blockType: "quote" }) })
330
332
  ]
331
333
  }
332
334
  ) });
333
- }, Qe = () => {
334
- const [t] = P(), [e, o] = M(!1), [n, a] = M(!1), [l, i] = M(!1), [d, h] = M(!1), [s, g] = M(!1), p = C(() => {
335
+ }, pr = () => {
336
+ const [t] = I(), [e, o] = f(!1), [n, a] = f(!1), [l, i] = f(!1), [d, c] = f(!1), [s, h] = f(!1), g = L(() => {
335
337
  const u = T();
336
- L(u) && (o(u.hasFormat("bold")), a(u.hasFormat("italic")), i(u.hasFormat("underline")), h(u.hasFormat("code")), g(u.hasFormat("superscript")));
338
+ y(u) && (o(u.hasFormat("bold")), a(u.hasFormat("italic")), i(u.hasFormat("underline")), c(u.hasFormat("code")), h(u.hasFormat("superscript")));
337
339
  }, []);
338
- E(() => ct(
340
+ E(() => tt(
339
341
  t.registerCommand(
340
- W,
341
- () => (p(), !1),
342
- tt
342
+ A,
343
+ () => (g(), !1),
344
+ X
343
345
  ),
344
346
  t.registerUpdateListener(({ editorState: u }) => {
345
347
  u.read(() => {
346
- p();
348
+ g();
347
349
  });
348
350
  })
349
- ), [t, p]);
350
- const v = C(
351
- () => t.dispatchCommand(_, "bold"),
351
+ ), [t, g]);
352
+ const m = L(
353
+ () => t.dispatchCommand(O, "bold"),
352
354
  [t]
353
- ), w = C(
354
- () => t.dispatchCommand(_, "italic"),
355
+ ), M = L(
356
+ () => t.dispatchCommand(O, "italic"),
355
357
  [t]
356
- ), z = C(
357
- () => t.dispatchCommand(_, "underline"),
358
+ ), N = L(
359
+ () => t.dispatchCommand(O, "underline"),
358
360
  [t]
359
- ), k = C(
360
- () => t.dispatchCommand(_, "code"),
361
+ ), k = L(
362
+ () => t.dispatchCommand(O, "code"),
361
363
  [t]
362
- ), I = C(
363
- () => t.dispatchCommand(_, "superscript"),
364
+ ), x = L(
365
+ () => t.dispatchCommand(O, "superscript"),
364
366
  [t]
365
- ), ft = nt(() => {
367
+ ), S = gt(() => {
366
368
  const u = [];
367
369
  return e && u.push("bold"), n && u.push("italic"), l && u.push("underline"), d && u.push("code"), s && u.push("superscript"), u;
368
370
  }, [e, n, l, d, s]);
369
- return /* @__PURE__ */ b(
370
- Qt,
371
+ return /* @__PURE__ */ C(
372
+ ue,
371
373
  {
372
374
  type: "multiple",
373
375
  "aria-label": "Tekstformattering",
374
- value: ft,
376
+ value: S,
375
377
  children: [
376
378
  /* @__PURE__ */ r(
377
- $,
379
+ R,
378
380
  {
379
- onClick: v,
381
+ onClick: m,
380
382
  title: "Fet tekst",
381
383
  value: "bold",
382
- children: /* @__PURE__ */ r(ze, { size: "1.25rem" })
384
+ children: /* @__PURE__ */ r(Ye, { size: "1.25rem" })
383
385
  }
384
386
  ),
385
387
  /* @__PURE__ */ r(
386
- $,
388
+ R,
387
389
  {
388
- onClick: w,
390
+ onClick: M,
389
391
  title: "Kursiv tekst",
390
392
  value: "italic",
391
- children: /* @__PURE__ */ r(Fe, { size: "1.25rem" })
393
+ children: /* @__PURE__ */ r(tr, { size: "1.25rem" })
392
394
  }
393
395
  ),
394
396
  /* @__PURE__ */ r(
395
- $,
397
+ R,
396
398
  {
397
- onClick: z,
399
+ onClick: N,
398
400
  title: "Understreket tekst",
399
401
  value: "underline",
400
- children: /* @__PURE__ */ r(Ue, { size: "1.25rem" })
402
+ children: /* @__PURE__ */ r(sr, { size: "1.25rem" })
401
403
  }
402
404
  ),
403
405
  /* @__PURE__ */ r(
404
- $,
406
+ R,
405
407
  {
406
408
  onClick: k,
407
409
  title: "Kode",
408
410
  value: "code",
409
- children: /* @__PURE__ */ r(Ie, { size: "1.25rem" })
411
+ children: /* @__PURE__ */ r(Ge, { size: "1.25rem" })
410
412
  }
411
413
  ),
412
414
  /* @__PURE__ */ r(
413
- $,
415
+ R,
414
416
  {
415
- onClick: I,
417
+ onClick: x,
416
418
  title: "Superscript",
417
419
  value: "superscript",
418
- children: /* @__PURE__ */ r(Ke, { size: "1.25rem" })
420
+ children: /* @__PURE__ */ r(lr, { size: "1.25rem" })
419
421
  }
420
422
  )
421
423
  ]
422
424
  }
423
425
  );
424
- }, Ve = ({ children: t }) => {
425
- const { hasFocus: e, editorRef: o } = pt(), n = e, [a, l] = M(n);
426
- Xt(() => {
426
+ }, gr = ({ children: t }) => {
427
+ const { hasFocus: e, editorRef: o } = et(), n = e, [a, l] = f(n);
428
+ ce(() => {
427
429
  l(n);
428
430
  }, [n]);
429
- const { context: i, refs: d, floatingStyles: h } = lt({
431
+ const { context: i, refs: d, floatingStyles: c } = Z({
430
432
  placement: "top",
431
- whileElementsMounted: Vt,
433
+ whileElementsMounted: kt,
432
434
  middleware: [
433
- Jt({
434
- apply: ({ rects: g, elements: p }) => {
435
- p.floating.style.minWidth = `${g.reference.width}px`;
435
+ pe({
436
+ apply: ({ rects: h, elements: g }) => {
437
+ g.floating.style.minWidth = `${h.reference.width}px`;
436
438
  }
437
439
  }),
438
- Zt(),
439
- st({
440
+ ge(),
441
+ vt({
440
442
  mainAxis: 8
441
443
  }),
442
- te({
444
+ fe({
443
445
  padding: 8
444
446
  })
445
447
  ],
@@ -448,16 +450,16 @@ const Ye = at("div", {
448
450
  elements: {
449
451
  reference: o.current
450
452
  }
451
- }), { getFloatingProps: s } = ee([
452
- re(i, {
453
+ }), { getFloatingProps: s } = Ct([
454
+ Mt(i, {
453
455
  role: "dialog"
454
456
  })
455
457
  ]);
456
- return a ? /* @__PURE__ */ r(oe, { children: /* @__PURE__ */ r(
457
- ne,
458
+ return a ? /* @__PURE__ */ r(bt, { children: /* @__PURE__ */ r(
459
+ Lt,
458
460
  {
459
461
  ref: d.setFloating,
460
- style: h,
462
+ style: c,
461
463
  ...s,
462
464
  css: {
463
465
  border: "1px solid $border",
@@ -465,94 +467,94 @@ const Ye = at("div", {
465
467
  overflow: "hidden",
466
468
  boxShadow: "$md"
467
469
  },
468
- children: /* @__PURE__ */ r(Je, { children: t })
470
+ children: /* @__PURE__ */ r(fr, { children: t })
469
471
  }
470
472
  ) }) : null;
471
- }, Je = ({
473
+ }, fr = ({
472
474
  children: t,
473
475
  ...e
474
- }) => /* @__PURE__ */ b(ae, { "aria-label": "Formattering", ...e, children: [
475
- /* @__PURE__ */ r(Ge, {}),
476
- /* @__PURE__ */ r(ie, {}),
477
- /* @__PURE__ */ r(Qe, {}),
476
+ }) => /* @__PURE__ */ C(me, { "aria-label": "Formattering", ...e, children: [
477
+ /* @__PURE__ */ r(ur, {}),
478
+ /* @__PURE__ */ r(ke, {}),
479
+ /* @__PURE__ */ r(pr, {}),
478
480
  t
479
481
  ] });
480
- function Ze() {
481
- const [t] = P();
482
- return E(() => ct(
482
+ function mr() {
483
+ const [t] = I();
484
+ return E(() => tt(
483
485
  t.registerCommand(
484
- rt,
485
- () => (Rt(t, "check"), !0),
486
- y
486
+ pt,
487
+ () => (Qt(t, "check"), !0),
488
+ w
487
489
  ),
488
490
  t.registerCommand(
489
- vt,
490
- (e) => J(e, t, !1),
491
- y
491
+ Ot,
492
+ (e) => dt(e, t, !1),
493
+ w
492
494
  ),
493
495
  t.registerCommand(
494
- Tt,
495
- (e) => J(e, t, !0),
496
- y
496
+ Pt,
497
+ (e) => dt(e, t, !0),
498
+ w
497
499
  ),
498
500
  t.registerCommand(
499
- Lt,
501
+ ht,
500
502
  (e) => {
501
- if (H() != null) {
503
+ if (G() != null) {
502
504
  const n = t.getRootElement();
503
505
  return n != null && n.focus(), !0;
504
506
  }
505
507
  return !1;
506
508
  },
507
- y
509
+ w
508
510
  ),
509
511
  t.registerCommand(
510
- yt,
512
+ At,
511
513
  (e) => {
512
- const o = H();
514
+ const o = G();
513
515
  return o != null && t.isEditable() ? (t.update(() => {
514
- const n = j(o);
515
- N(n) && (e.preventDefault(), n.toggleChecked());
516
+ const n = Q(o);
517
+ _(n) && (e.preventDefault(), n.toggleChecked());
516
518
  }), !0) : !1;
517
519
  },
518
- y
520
+ w
519
521
  ),
520
522
  t.registerCommand(
521
- xt,
523
+ Bt,
522
524
  (e) => t.getEditorState().read(() => {
523
525
  const o = T();
524
- if (L(o) && o.isCollapsed()) {
526
+ if (y(o) && o.isCollapsed()) {
525
527
  const { anchor: n } = o, a = n.type === "element";
526
528
  if (a || n.offset === 0) {
527
- const l = n.getNode(), i = dt(
529
+ const l = n.getNode(), i = F(
528
530
  l,
529
- (d) => Nt(d) && !d.isInline()
531
+ (d) => Dt(d) && !d.isInline()
530
532
  );
531
- if (N(i)) {
533
+ if (_(i)) {
532
534
  const d = i.getParent();
533
- if (K(d) && d.getListType() === "check" && (a || i.getFirstDescendant() === l)) {
534
- const h = t.getElementByKey(i.__key);
535
- if (h != null && document.activeElement !== h)
536
- return h.focus(), e.preventDefault(), !0;
535
+ if (V(d) && d.getListType() === "check" && (a || i.getFirstDescendant() === l)) {
536
+ const c = t.getElementByKey(i.__key);
537
+ if (c != null && document.activeElement !== c)
538
+ return c.focus(), e.preventDefault(), !0;
537
539
  }
538
540
  }
539
541
  }
540
542
  }
541
543
  return !1;
542
544
  }),
543
- y
545
+ w
544
546
  ),
545
547
  t.registerRootListener((e, o) => {
546
- e !== null && (e.addEventListener("click", Q), e.addEventListener("pointerdown", V)), o !== null && (o.removeEventListener("click", Q), o.removeEventListener("pointerdown", V));
548
+ e !== null && (e.addEventListener("click", lt), e.addEventListener("pointerdown", st)), o !== null && (o.removeEventListener("click", lt), o.removeEventListener("pointerdown", st));
547
549
  })
548
550
  ), [t]), null;
549
551
  }
550
- function mt(t, e) {
552
+ function Et(t, e) {
551
553
  const o = t.target;
552
- if (o === null || !G(o))
554
+ if (o === null || !it(o))
553
555
  return;
554
556
  const n = o.firstChild;
555
- if (n != null && G(n) && (n.tagName === "UL" || n.tagName === "OL"))
557
+ if (n != null && it(n) && (n.tagName === "UL" || n.tagName === "OL"))
556
558
  return;
557
559
  const a = o.parentNode;
558
560
  if (!a || a.__lexicalListType !== "check")
@@ -560,23 +562,23 @@ function mt(t, e) {
560
562
  const l = t.pageX, i = o.getBoundingClientRect();
561
563
  (o.dir === "rtl" ? l < i.right && l > i.right - 20 : l > i.left && l < i.left + 20) && e();
562
564
  }
563
- function Q(t) {
564
- mt(t, () => {
565
- const e = t.target, o = tr(e);
565
+ function lt(t) {
566
+ Et(t, () => {
567
+ const e = t.target, o = kr(e);
566
568
  o != null && o.isEditable() && o.update(() => {
567
569
  if (t.target) {
568
- const n = j(e);
569
- N(n) && (e.focus(), n.toggleChecked());
570
+ const n = Q(e);
571
+ _(n) && (e.focus(), n.toggleChecked());
570
572
  }
571
573
  });
572
574
  });
573
575
  }
574
- function V(t) {
575
- mt(t, () => {
576
+ function st(t) {
577
+ Et(t, () => {
576
578
  t.preventDefault();
577
579
  });
578
580
  }
579
- function tr(t) {
581
+ function kr(t) {
580
582
  let e = t;
581
583
  for (; e; ) {
582
584
  if (e.__lexicalEditor)
@@ -585,30 +587,30 @@ function tr(t) {
585
587
  }
586
588
  return null;
587
589
  }
588
- function H() {
590
+ function G() {
589
591
  const t = document.activeElement;
590
592
  return t != null && t.tagName === "LI" && t.parentNode != null && // @ts-ignore internal field
591
593
  t.parentNode.__lexicalListType === "check" ? t : null;
592
594
  }
593
- function er(t, e) {
595
+ function vr(t, e) {
594
596
  let o = e ? t.getPreviousSibling() : t.getNextSibling(), n = t;
595
- for (; o == null && N(n); )
597
+ for (; o == null && _(n); )
596
598
  n = n.getParentOrThrow().getParent(), n != null && (o = e ? n.getPreviousSibling() : n.getNextSibling());
597
- for (; N(o); ) {
599
+ for (; _(o); ) {
598
600
  const a = e ? o.getLastChild() : o.getFirstChild();
599
- if (!K(a))
601
+ if (!V(a))
600
602
  return o;
601
603
  o = e ? a.getLastChild() : a.getFirstChild();
602
604
  }
603
605
  return null;
604
606
  }
605
- function J(t, e, o) {
606
- const n = H();
607
+ function dt(t, e, o) {
608
+ const n = G();
607
609
  return n != null && e.update(() => {
608
- const a = j(n);
609
- if (!N(a))
610
+ const a = Q(n);
611
+ if (!_(a))
610
612
  return;
611
- const l = er(a, o);
613
+ const l = vr(a, o);
612
614
  if (l != null) {
613
615
  l.selectStart();
614
616
  const i = e.getElementByKey(l.__key);
@@ -618,25 +620,25 @@ function J(t, e, o) {
618
620
  }
619
621
  }), !1;
620
622
  }
621
- const rr = () => /* @__PURE__ */ b(U, { children: [
622
- /* @__PURE__ */ r(pe, {}),
623
- /* @__PURE__ */ r(me, {}),
624
- /* @__PURE__ */ r(ge, {}),
625
- /* @__PURE__ */ r(Ze, {}),
626
- /* @__PURE__ */ r(fe, {})
627
- ] }), or = ({
623
+ const Cr = () => /* @__PURE__ */ C(j, { children: [
624
+ /* @__PURE__ */ r(Ie, {}),
625
+ /* @__PURE__ */ r(Re, {}),
626
+ /* @__PURE__ */ r(ze, {}),
627
+ /* @__PURE__ */ r(mr, {}),
628
+ /* @__PURE__ */ r(_e, {})
629
+ ] }), Mr = ({
628
630
  state: t
629
631
  }) => {
630
- const [e] = P();
632
+ const [e] = I();
631
633
  return E(() => {
632
634
  if (t)
633
635
  try {
634
- if (be(t)) {
635
- t.isEmpty() ? ve(e) : e.setEditorState(t);
636
+ if (Pe(t)) {
637
+ t.isEmpty() ? Ae(e) : e.setEditorState(t);
636
638
  return;
637
639
  }
638
- if (typeof t == "string" && !ht(t)) {
639
- Te(t, e);
640
+ if (typeof t == "string" && !Tt(t)) {
641
+ Be(t, e);
640
642
  return;
641
643
  }
642
644
  const o = e.parseEditorState(t);
@@ -645,7 +647,7 @@ const rr = () => /* @__PURE__ */ b(U, { children: [
645
647
  console.error("Could not parse"), console.error(o);
646
648
  }
647
649
  }, []), null;
648
- }, nr = at("div", {
650
+ }, br = ft("div", {
649
651
  border: "1px solid $borderDarker",
650
652
  borderRadius: "$md",
651
653
  position: "relative",
@@ -682,10 +684,10 @@ const rr = () => /* @__PURE__ */ b(U, { children: [
682
684
  }
683
685
  }
684
686
  ]
685
- }), ar = ({
687
+ }), Lr = ({
686
688
  isLoading: t
687
689
  }) => /* @__PURE__ */ r(
688
- R,
690
+ B,
689
691
  {
690
692
  css: {
691
693
  visibility: t ? "visible" : "hidden",
@@ -694,9 +696,9 @@ const rr = () => /* @__PURE__ */ b(U, { children: [
694
696
  right: "1rem",
695
697
  display: "flex"
696
698
  },
697
- children: /* @__PURE__ */ r(le, {})
699
+ children: /* @__PURE__ */ r(ve, {})
698
700
  }
699
- ), Or = ({
701
+ ), Jr = ({
700
702
  isLoading: t,
701
703
  children: e,
702
704
  placeholderText: o,
@@ -705,41 +707,41 @@ const rr = () => /* @__PURE__ */ b(U, { children: [
705
707
  toolbar: l,
706
708
  toolbarContent: i,
707
709
  content: d,
708
- hideBorder: h,
710
+ hideBorder: c,
709
711
  onBlur: s,
710
- defaultState: g,
711
- css: p
712
+ defaultState: h,
713
+ css: g
712
714
  }) => {
713
- const { hasFocus: v, attributes: w } = we({ onBlur: s }), z = ot(null), k = nt(() => ({ hasFocus: v, editorRef: z }), [v]);
714
- return /* @__PURE__ */ r(ut.Provider, { value: k, children: /* @__PURE__ */ b(
715
- de,
715
+ const { hasFocus: m, attributes: M } = Ke({ onBlur: s }), N = J(null), k = gt(() => ({ hasFocus: m, editorRef: N }), [m]);
716
+ return /* @__PURE__ */ r(yt.Provider, { value: k, children: /* @__PURE__ */ C(
717
+ Ne,
716
718
  {
717
719
  initialConfig: {
718
720
  namespace: "CommentEditor",
719
- onError: (I) => {
720
- console.error(I);
721
+ onError: (x) => {
722
+ console.error(x);
721
723
  },
722
- theme: Se,
724
+ theme: Ue,
723
725
  nodes: n,
724
726
  editable: !0
725
727
  },
726
728
  children: [
727
- /* @__PURE__ */ b(
728
- nr,
729
+ /* @__PURE__ */ C(
730
+ br,
729
731
  {
730
- ref: z,
731
- hasFocus: v,
732
- hideBorder: h,
733
- css: p,
734
- ...w,
732
+ ref: N,
733
+ hasFocus: m,
734
+ hideBorder: c,
735
+ css: g,
736
+ ...M,
735
737
  children: [
736
738
  l,
737
739
  /* @__PURE__ */ r(
738
- ce,
740
+ Ee,
739
741
  {
740
742
  contentEditable: d,
741
743
  placeholder: o ? /* @__PURE__ */ r(
742
- R,
744
+ B,
743
745
  {
744
746
  css: {
745
747
  position: "absolute",
@@ -752,22 +754,22 @@ const rr = () => /* @__PURE__ */ b(U, { children: [
752
754
  children: o
753
755
  }
754
756
  ) : null,
755
- ErrorBoundary: he
757
+ ErrorBoundary: xe
756
758
  }
757
759
  ),
758
- /* @__PURE__ */ r(rr, {}),
760
+ /* @__PURE__ */ r(Cr, {}),
759
761
  a,
760
- /* @__PURE__ */ r(ar, { isLoading: t }),
761
- !l && /* @__PURE__ */ r(Ve, { children: i })
762
+ /* @__PURE__ */ r(Lr, { isLoading: t }),
763
+ !l && /* @__PURE__ */ r(gr, { children: i })
762
764
  ]
763
765
  }
764
766
  ),
765
- /* @__PURE__ */ r(or, { state: g }),
766
- /* @__PURE__ */ r(U, { children: e })
767
+ /* @__PURE__ */ r(Mr, { state: h }),
768
+ /* @__PURE__ */ r(j, { children: e })
767
769
  ]
768
770
  }
769
771
  ) });
770
- }, Br = S({
772
+ }, Zr = $({
771
773
  fontSize: "1rem",
772
774
  lineHeight: "1.5",
773
775
  "h1, h2, h3, h4, h5, h6": {
@@ -929,63 +931,63 @@ const rr = () => /* @__PURE__ */ b(U, { children: [
929
931
  size: "md"
930
932
  }
931
933
  });
932
- function ir(t) {
933
- return c({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "circle", attr: { cx: "256", cy: "256", r: "48" } }, { tag: "circle", attr: { cx: "416", cy: "256", r: "48" } }, { tag: "circle", attr: { cx: "96", cy: "256", r: "48" } }] })(t);
934
+ function Tr(t) {
935
+ return p({ 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);
934
936
  }
935
- const Pr = () => {
936
- const [t] = ke(), [e, o] = M(null), { hasFocus: n } = pt();
937
+ const to = () => {
938
+ const [t] = I(), [e, o] = f(null), { hasFocus: n } = et();
937
939
  E(() => {
938
940
  !n && e && o(null);
939
941
  }, [n, e]);
940
- const { refs: a, floatingStyles: l } = lt({
942
+ const { refs: a, floatingStyles: l } = Z({
941
943
  placement: "top-end",
942
944
  open: !!e,
943
945
  elements: {
944
946
  reference: e
945
947
  },
946
- middleware: [st({ mainAxis: -20, crossAxis: -2 })]
948
+ middleware: [vt({ mainAxis: -20, crossAxis: -2 })]
947
949
  });
948
950
  E(() => t.registerCommand(
949
- W,
951
+ A,
950
952
  () => {
951
953
  const d = T();
952
- if (L(d)) {
953
- const h = d.anchor.getNode(), s = jt(h);
954
+ if (y(d)) {
955
+ const c = d.anchor.getNode(), s = ae(c);
954
956
  o(s ? t.getElementByKey(s.getKey()) : null);
955
957
  }
956
958
  return !1;
957
959
  },
958
- Et
960
+ Ft
959
961
  ), [t]);
960
962
  const i = (d) => () => {
961
963
  t.update(() => {
962
964
  switch (d) {
963
965
  case "add-row-over":
964
- q(!1);
966
+ nt(!1);
965
967
  break;
966
968
  case "add-row-under":
967
- q(!0);
969
+ nt(!0);
968
970
  break;
969
971
  case "add-column-left":
970
- Y(!1);
972
+ ot(!1);
971
973
  break;
972
974
  case "add-column-right":
973
- Y(!0);
975
+ ot(!0);
974
976
  break;
975
977
  case "delete-row":
976
- Ut();
978
+ le();
977
979
  break;
978
980
  case "delete-column":
979
- Kt();
981
+ ie();
980
982
  break;
981
983
  }
982
984
  });
983
985
  };
984
- return e ? /* @__PURE__ */ b(
985
- it,
986
+ return e ? /* @__PURE__ */ C(
987
+ mt,
986
988
  {
987
989
  trigger: /* @__PURE__ */ r(
988
- se,
990
+ D,
989
991
  {
990
992
  icon: !0,
991
993
  variant: "primary",
@@ -993,35 +995,190 @@ const Pr = () => {
993
995
  ref: a.setFloating,
994
996
  style: l,
995
997
  css: { padding: "2px", width: "18px", height: "18px" },
996
- children: /* @__PURE__ */ r(ir, {})
998
+ children: /* @__PURE__ */ r(Tr, {})
997
999
  }
998
1000
  ),
999
1001
  children: [
1000
- /* @__PURE__ */ r(x, { onClick: i("add-row-over"), children: "Legg til rad over" }),
1001
- /* @__PURE__ */ r(x, { onClick: i("add-row-under"), children: "Legg til rad under" }),
1002
- /* @__PURE__ */ r(X, {}),
1003
- /* @__PURE__ */ r(x, { onClick: i("add-column-left"), children: "Legg til kolumne venstre" }),
1004
- /* @__PURE__ */ r(x, { onClick: i("add-column-right"), children: "Legg til kolumne høyre" }),
1005
- /* @__PURE__ */ r(X, {}),
1006
- /* @__PURE__ */ r(x, { onClick: i("delete-row"), children: "Fjern rad" }),
1007
- /* @__PURE__ */ r(x, { onClick: i("delete-column"), children: "Fjern kolumne" })
1002
+ /* @__PURE__ */ r(z, { onClick: i("add-row-over"), children: "Legg til rad over" }),
1003
+ /* @__PURE__ */ r(z, { onClick: i("add-row-under"), children: "Legg til rad under" }),
1004
+ /* @__PURE__ */ r(at, {}),
1005
+ /* @__PURE__ */ r(z, { onClick: i("add-column-left"), children: "Legg til kolumne venstre" }),
1006
+ /* @__PURE__ */ r(z, { onClick: i("add-column-right"), children: "Legg til kolumne høyre" }),
1007
+ /* @__PURE__ */ r(at, {}),
1008
+ /* @__PURE__ */ r(z, { onClick: i("delete-row"), children: "Fjern rad" }),
1009
+ /* @__PURE__ */ r(z, { onClick: i("delete-column"), children: "Fjern kolumne" })
1008
1010
  ]
1009
1011
  }
1010
1012
  ) : null;
1011
1013
  };
1014
+ function xt(t) {
1015
+ let e = t;
1016
+ const o = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi, n = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;
1017
+ return e = String(e).trim(), e.match(o) || e.match(n) ? e : "https://";
1018
+ }
1019
+ function St(t) {
1020
+ const e = t.anchor, o = t.focus, n = t.anchor.getNode(), a = t.focus.getNode();
1021
+ return n === a ? n : t.isBackward() ? rt(o) ? n : a : rt(e) ? n : a;
1022
+ }
1023
+ const yr = ({
1024
+ isOpen: t,
1025
+ onSave: e,
1026
+ onCancel: o
1027
+ }) => {
1028
+ const n = J(null);
1029
+ return /* @__PURE__ */ C(Ce, { open: t, onOpenChange: o, children: [
1030
+ /* @__PURE__ */ r(Me, { children: "Opprett lenke" }),
1031
+ /* @__PURE__ */ r(be, { label: "URL", ref: n }),
1032
+ /* @__PURE__ */ C(Le, { children: [
1033
+ /* @__PURE__ */ r(D, { onClick: o, children: "Avbryt" }),
1034
+ /* @__PURE__ */ r(
1035
+ D,
1036
+ {
1037
+ variant: "primary",
1038
+ onClick: () => {
1039
+ var a;
1040
+ e(((a = n.current) == null ? void 0 : a.value) || "");
1041
+ },
1042
+ children: "Lagre"
1043
+ }
1044
+ )
1045
+ ] })
1046
+ ] });
1047
+ }, eo = () => {
1048
+ const [t] = I(), [e, o] = f(!1), [n, a] = f(!1), l = L(() => {
1049
+ const d = T();
1050
+ if (y(d)) {
1051
+ const c = St(d), s = c.getParent();
1052
+ o(P(s) || P(c));
1053
+ }
1054
+ }, []);
1055
+ E(() => t.registerCommand(
1056
+ A,
1057
+ () => (l(), !1),
1058
+ X
1059
+ ), [t, l]);
1060
+ const i = L(
1061
+ (d) => {
1062
+ t.update(() => {
1063
+ const c = T();
1064
+ if (y(c) && c.isCollapsed()) {
1065
+ const s = c.getNodes();
1066
+ if (s.length === 1) {
1067
+ const h = s[0];
1068
+ Ht(h) && h.getChildren().length === 0 && c.insertText(d);
1069
+ }
1070
+ }
1071
+ }), t.dispatchCommand(Y, xt(d));
1072
+ },
1073
+ [t]
1074
+ );
1075
+ return /* @__PURE__ */ C(j, { children: [
1076
+ /* @__PURE__ */ r(
1077
+ R,
1078
+ {
1079
+ onClick: () => {
1080
+ e ? t.dispatchCommand(Y, null) : a(!0);
1081
+ },
1082
+ title: "Lenke",
1083
+ value: "link",
1084
+ children: /* @__PURE__ */ r(rr, { size: "1.25rem" })
1085
+ }
1086
+ ),
1087
+ /* @__PURE__ */ r(
1088
+ yr,
1089
+ {
1090
+ isOpen: n,
1091
+ onCancel: () => a(!1),
1092
+ onSave: (d) => {
1093
+ i(d), a(!1);
1094
+ }
1095
+ }
1096
+ )
1097
+ ] });
1098
+ }, ro = () => {
1099
+ const [t] = I(), [e, o] = f(), [n, a] = f(!1), [l, i] = f(""), { hasFocus: d } = et(), { refs: c, floatingStyles: s, context: h } = Z({
1100
+ placement: "top",
1101
+ strategy: "fixed",
1102
+ open: !!e,
1103
+ whileElementsMounted: kt,
1104
+ elements: {
1105
+ reference: e
1106
+ },
1107
+ middleware: [ye()]
1108
+ }), { getFloatingProps: g } = Ct([
1109
+ Mt(h),
1110
+ Te(h)
1111
+ ]), m = L(() => {
1112
+ var x;
1113
+ const M = T();
1114
+ if (y(M)) {
1115
+ const S = St(M), u = S.getParent(), wt = F(S, P), It = F(S, Yt);
1116
+ a(wt !== null && It === null), P(u) ? i(u.getURL()) : P(S) ? i(S.getURL()) : i("");
1117
+ }
1118
+ const N = window.getSelection(), k = t.getRootElement();
1119
+ M !== null && N !== null && k !== null && k.contains(N.anchorNode) && t.isEditable() && o(((x = N.focusNode) == null ? void 0 : x.parentElement) ?? void 0);
1120
+ }, [t]);
1121
+ return E(() => {
1122
+ t.getEditorState().read(() => {
1123
+ m();
1124
+ });
1125
+ }, [t, m]), E(() => tt(
1126
+ t.registerUpdateListener(({ editorState: M }) => {
1127
+ M.read(() => {
1128
+ m();
1129
+ });
1130
+ }),
1131
+ t.registerCommand(
1132
+ A,
1133
+ () => (m(), !0),
1134
+ w
1135
+ ),
1136
+ t.registerCommand(
1137
+ ht,
1138
+ () => n ? (a(!1), !0) : !1,
1139
+ Wt
1140
+ )
1141
+ ), [t, m, n]), n && d ? /* @__PURE__ */ r(bt, { children: /* @__PURE__ */ C(
1142
+ Lt,
1143
+ {
1144
+ ref: c.setFloating,
1145
+ css: {
1146
+ padding: "$2 $4",
1147
+ // Make sure this renders above the toolbar
1148
+ zIndex: "calc(var(--zIndices-overlayCard) + 1)"
1149
+ },
1150
+ style: s,
1151
+ ...g(),
1152
+ children: [
1153
+ /* @__PURE__ */ r("a", { href: xt(l), target: "_blank", rel: "noreferrer", children: l }),
1154
+ /* @__PURE__ */ r(
1155
+ D,
1156
+ {
1157
+ onClick: () => {
1158
+ t.dispatchCommand(Y, null);
1159
+ },
1160
+ children: /* @__PURE__ */ r(we, {})
1161
+ }
1162
+ )
1163
+ ]
1164
+ }
1165
+ ) }) : null;
1166
+ };
1012
1167
  export {
1013
- Ve as FloatingToolbar,
1014
- Or as RichTextEditor,
1015
- Je as RichTextToolbar,
1016
- Pr as TableEditPlugin,
1017
- ve as clearEditorState,
1018
- Rr as defaultNodes,
1019
- be as isEditorState,
1020
- ht as isJSON,
1021
- ut as richTextContext,
1022
- Br as richTextCss,
1023
- Te as setStateFromPlainText,
1024
- $r as stateToHTML,
1025
- we as useHasFocusWithin,
1026
- pt as useRichTextContext
1168
+ gr as FloatingToolbar,
1169
+ ro as LinkEditPlugin,
1170
+ eo as LinkToolbarButton,
1171
+ Jr as RichTextEditor,
1172
+ fr as RichTextToolbar,
1173
+ to as TableEditPlugin,
1174
+ Ae as clearEditorState,
1175
+ Vr as defaultNodes,
1176
+ Pe as isEditorState,
1177
+ Tt as isJSON,
1178
+ yt as richTextContext,
1179
+ Zr as richTextCss,
1180
+ Be as setStateFromPlainText,
1181
+ Qr as stateToHTML,
1182
+ Ke as useHasFocusWithin,
1183
+ et as useRichTextContext
1027
1184
  };