@examind/block-editor 0.1.13 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/dist/index.css +48 -485
  2. package/dist/index.js +867 -833
  3. package/dist/index.mjs +690 -657
  4. package/package.json +14 -12
package/dist/index.js CHANGED
@@ -70,144 +70,9 @@ var import_tab = __toESM(require("@shoelace-style/shoelace/dist/components/tab/t
70
70
  var import_textarea = __toESM(require("@shoelace-style/shoelace/dist/components/textarea/textarea.js"));
71
71
  var import_tooltip = __toESM(require("@shoelace-style/shoelace/dist/components/tooltip/tooltip.js"));
72
72
 
73
- // src/components/feedback/DotBadge.tsx
74
- var import_clsx = __toESM(require("clsx"));
75
- var import_jsx_runtime = require("react/jsx-runtime");
76
- function DotBadge(props) {
77
- const { slot, variant, leftSided, style } = props;
78
- const className = (0, import_clsx.default)("dot", {
79
- ["left_sided"]: leftSided
80
- });
81
- const attributes = {};
82
- if (slot) {
83
- attributes.slot = slot;
84
- }
85
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
86
- "sl-badge",
87
- {
88
- class: className,
89
- ...attributes,
90
- variant,
91
- pill: true,
92
- pulse: true,
93
- style
94
- }
95
- );
96
- }
97
-
98
- // src/components/feedback/TextBadge.tsx
99
- var import_jsx_runtime2 = require("react/jsx-runtime");
100
- function TextBadge(props) {
101
- const { variant, text, slot } = props;
102
- const attributes = {};
103
- if (slot) {
104
- attributes.slot = slot;
105
- }
106
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("sl-badge", { ...attributes, variant, pill: true, children: text });
107
- }
108
-
109
- // src/components/icon/Icon.tsx
110
- var import_jsx_runtime3 = require("react/jsx-runtime");
111
- function Icon(props) {
112
- const { icon, slot, style, fill, dataTrigger } = props;
113
- const IconComponent = icon;
114
- const dataAttributes = {};
115
- if (dataTrigger) {
116
- dataAttributes["data-trigger"] = dataTrigger;
117
- }
118
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { slot, className: "sl-icon", ...dataAttributes, children: IconComponent && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
119
- IconComponent,
120
- {
121
- fill: fill ? fill : "none",
122
- style: { ...style }
123
- }
124
- ) });
125
- }
126
-
127
- // src/components/utils/objectUtils.ts
128
- var isNil = (value) => value === null || value === void 0;
129
- function filterNilAttrs(object, attrs) {
130
- return Object.fromEntries(
131
- Object.entries(object).filter(
132
- ([key, value]) => attrs.includes(key) && !isNil(value)
133
- )
134
- );
135
- }
136
-
137
- // src/components/inputs/Button.tsx
138
- var import_jsx_runtime4 = require("react/jsx-runtime");
139
- function Button(props) {
140
- const {
141
- label,
142
- variant = "default",
143
- className,
144
- EndIcon,
145
- StartIcon,
146
- circle,
147
- size = "medium",
148
- isBadgeDot = false,
149
- badgeText,
150
- type = "button",
151
- tooltip,
152
- prefix,
153
- suffix,
154
- onClick
155
- } = props;
156
- const handleButtonClick = (e) => {
157
- if (e) {
158
- e.stopPropagation();
159
- e.preventDefault();
160
- }
161
- if (onClick) {
162
- onClick();
163
- }
164
- };
165
- const attributes = filterNilAttrs(props, [
166
- "form",
167
- "name",
168
- "loading",
169
- "disabled",
170
- "outline",
171
- "circle",
172
- "caret",
173
- "pill",
174
- "slot",
175
- "href",
176
- "target",
177
- "value",
178
- "tabindex"
179
- ]);
180
- let validClassName = className;
181
- if (!label) {
182
- validClassName = className ? `${className} button_icon` : "button_icon";
183
- }
184
- const buttonElement = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
185
- "sl-button",
186
- {
187
- class: validClassName,
188
- ...attributes,
189
- variant,
190
- size,
191
- title: tooltip,
192
- type,
193
- onClick: handleButtonClick,
194
- children: [
195
- prefix && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { slot: "prefix", children: prefix }),
196
- StartIcon && !circle && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { slot: "prefix", icon: StartIcon }),
197
- EndIcon && !circle && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { slot: "suffix", icon: EndIcon }),
198
- circle ? StartIcon ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Icon, { slot: "prefix", icon: StartIcon }) : null : label ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "line-clamp-1", children: label }) : null,
199
- isBadgeDot && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DotBadge, { variant: "danger" }),
200
- badgeText && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(TextBadge, { variant: "neutral", text: badgeText }),
201
- suffix && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { slot: "suffix", children: suffix })
202
- ]
203
- }
204
- );
205
- return buttonElement;
206
- }
207
-
208
73
  // src/components/utils/ResizeObserver.tsx
209
74
  var import_react = require("react");
210
- var import_jsx_runtime5 = require("react/jsx-runtime");
75
+ var import_jsx_runtime = require("react/jsx-runtime");
211
76
  var RESIZE_CONTENT_EVENT = "RESIZE_CONTENT_EVENT";
212
77
  function ResizeObserver(props) {
213
78
  const { children } = props;
@@ -227,7 +92,7 @@ function ResizeObserver(props) {
227
92
  );
228
93
  };
229
94
  }, []);
230
- return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
95
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
231
96
  "sl-resize-observer",
232
97
  {
233
98
  style: { display: "contents" },
@@ -241,11 +106,29 @@ function ResizeObserver(props) {
241
106
  var import_lexical52 = require("lexical");
242
107
  var import_lucide_react9 = require("lucide-react");
243
108
 
109
+ // src/components/icon/Icon.tsx
110
+ var import_jsx_runtime2 = require("react/jsx-runtime");
111
+ function Icon(props) {
112
+ const { icon, slot, style, fill, dataTrigger } = props;
113
+ const IconComponent = icon;
114
+ const dataAttributes = {};
115
+ if (dataTrigger) {
116
+ dataAttributes["data-trigger"] = dataTrigger;
117
+ }
118
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { slot, className: "sl-icon", ...dataAttributes, children: IconComponent && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
119
+ IconComponent,
120
+ {
121
+ fill: fill ? fill : "none",
122
+ style: { ...style }
123
+ }
124
+ ) });
125
+ }
126
+
244
127
  // src/content/editable/NestedContentEditable.tsx
245
128
  var import_LexicalContentEditable = require("@lexical/react/LexicalContentEditable");
246
- var import_jsx_runtime6 = require("react/jsx-runtime");
129
+ var import_jsx_runtime3 = require("react/jsx-runtime");
247
130
  function NestedContentEditable(props) {
248
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
131
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
249
132
  import_LexicalContentEditable.ContentEditable,
250
133
  {
251
134
  tabIndex: props.tabIndex,
@@ -279,7 +162,7 @@ function OnNestedChangePlugin(props) {
279
162
  var import_LexicalComposerContext2 = require("@lexical/react/LexicalComposerContext");
280
163
  var import_uniqueId = __toESM(require("lodash-es/uniqueId"));
281
164
  var import_react3 = __toESM(require("react"));
282
- var import_jsx_runtime7 = require("react/jsx-runtime");
165
+ var import_jsx_runtime4 = require("react/jsx-runtime");
283
166
  var NestedEditorContext = import_react3.default.createContext(null);
284
167
  function NestedEditor(props) {
285
168
  const { children, nodeKey } = props;
@@ -315,7 +198,7 @@ function NestedEditor(props) {
315
198
  }
316
199
  );
317
200
  }, [editor]);
318
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
201
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
319
202
  NestedEditorContext.Provider,
320
203
  {
321
204
  value: {
@@ -336,6 +219,123 @@ var useNestedEditor = () => {
336
219
  return context;
337
220
  };
338
221
 
222
+ // src/components/feedback/DotBadge.tsx
223
+ var import_clsx = __toESM(require("clsx"));
224
+ var import_jsx_runtime5 = require("react/jsx-runtime");
225
+ function DotBadge(props) {
226
+ const { slot, variant, leftSided, style } = props;
227
+ const className = (0, import_clsx.default)("dot", {
228
+ ["left_sided"]: leftSided
229
+ });
230
+ const attributes = {};
231
+ if (slot) {
232
+ attributes.slot = slot;
233
+ }
234
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
235
+ "sl-badge",
236
+ {
237
+ class: className,
238
+ ...attributes,
239
+ variant,
240
+ pill: true,
241
+ pulse: true,
242
+ style
243
+ }
244
+ );
245
+ }
246
+
247
+ // src/components/feedback/TextBadge.tsx
248
+ var import_jsx_runtime6 = require("react/jsx-runtime");
249
+ function TextBadge(props) {
250
+ const { variant, text, slot } = props;
251
+ const attributes = {};
252
+ if (slot) {
253
+ attributes.slot = slot;
254
+ }
255
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("sl-badge", { ...attributes, variant, pill: true, children: text });
256
+ }
257
+
258
+ // src/components/utils/objectUtils.ts
259
+ var isNil = (value) => value === null || value === void 0;
260
+ function filterNilAttrs(object, attrs) {
261
+ return Object.fromEntries(
262
+ Object.entries(object).filter(
263
+ ([key, value]) => attrs.includes(key) && !isNil(value)
264
+ )
265
+ );
266
+ }
267
+
268
+ // src/components/inputs/Button.tsx
269
+ var import_jsx_runtime7 = require("react/jsx-runtime");
270
+ function Button(props) {
271
+ const {
272
+ label,
273
+ variant = "default",
274
+ className,
275
+ EndIcon,
276
+ StartIcon,
277
+ circle,
278
+ size = "medium",
279
+ isBadgeDot = false,
280
+ badgeText,
281
+ type = "button",
282
+ tooltip,
283
+ prefix,
284
+ suffix,
285
+ onClick
286
+ } = props;
287
+ const handleButtonClick = (e) => {
288
+ if (e) {
289
+ e.stopPropagation();
290
+ e.preventDefault();
291
+ }
292
+ if (onClick) {
293
+ onClick();
294
+ }
295
+ };
296
+ const attributes = filterNilAttrs(props, [
297
+ "form",
298
+ "name",
299
+ "loading",
300
+ "disabled",
301
+ "outline",
302
+ "circle",
303
+ "caret",
304
+ "pill",
305
+ "slot",
306
+ "href",
307
+ "target",
308
+ "value",
309
+ "tabindex"
310
+ ]);
311
+ let validClassName = className;
312
+ if (!label) {
313
+ validClassName = className ? `${className} button_icon` : "button_icon";
314
+ }
315
+ const buttonElement = /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
316
+ "sl-button",
317
+ {
318
+ class: validClassName,
319
+ ...attributes,
320
+ variant,
321
+ size,
322
+ title: tooltip,
323
+ type,
324
+ onClick: handleButtonClick,
325
+ children: [
326
+ prefix && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { slot: "prefix", children: prefix }),
327
+ StartIcon && !circle && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { slot: "prefix", icon: StartIcon }),
328
+ EndIcon && !circle && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { slot: "suffix", icon: EndIcon }),
329
+ circle ? StartIcon ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Icon, { slot: "prefix", icon: StartIcon }) : null : label ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "line-clamp-1", children: label }) : null,
330
+ isBadgeDot && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DotBadge, { variant: "danger" }),
331
+ badgeText && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TextBadge, { variant: "neutral", text: badgeText }),
332
+ suffix && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { slot: "suffix", children: suffix })
333
+ ]
334
+ }
335
+ );
336
+ return buttonElement;
337
+ }
338
+
339
339
  // src/components/layouts/SettingsCard.tsx
340
340
  var import_lucide_react = require("lucide-react");
341
341
  var import_react4 = require("react");
@@ -4377,6 +4377,7 @@ var ACCEPTABLE_IMAGE_TYPES = [
4377
4377
  ];
4378
4378
 
4379
4379
  // src/utils/formatUtils.ts
4380
+ var import_numeral = __toESM(require("numeral"));
4380
4381
  function humanReadableBytes(bytes) {
4381
4382
  if (!bytes) {
4382
4383
  return "";
@@ -4393,6 +4394,31 @@ function humanReadableBytes(bytes) {
4393
4394
  return `${Math.round(bytes / Math.pow(1024, i))} ${sizes[i]}`;
4394
4395
  }
4395
4396
  }
4397
+ function getNumber(str) {
4398
+ const trimmedStr = str.trim();
4399
+ if (trimmedStr === "") {
4400
+ return void 0;
4401
+ }
4402
+ const num = +trimmedStr;
4403
+ if (Number.isNaN(num)) {
4404
+ return void 0;
4405
+ }
4406
+ return num;
4407
+ }
4408
+ var formatNumber = (num, format) => {
4409
+ return format ? (0, import_numeral.default)(num).format(format) : autoFormatNumber(num);
4410
+ };
4411
+ var correctRoundingError = (num) => parseFloat(num.toPrecision(14));
4412
+ var autoFormatNumber = (num, options = {}) => {
4413
+ const correctedNum = correctRoundingError(num);
4414
+ const formatted = new Intl.NumberFormat("en-US", {
4415
+ maximumFractionDigits: 14,
4416
+ ...options
4417
+ }).format(correctedNum);
4418
+ if (Math.abs(correctedNum) < 1e4)
4419
+ return formatted.replace(/,/g, "");
4420
+ return formatted;
4421
+ };
4396
4422
 
4397
4423
  // src/plugins/ImagePlugin/ImagePlugin.tsx
4398
4424
  var import_LexicalComposerContext18 = require("@lexical/react/LexicalComposerContext");
@@ -4517,15 +4543,15 @@ function ImageSettings(props) {
4517
4543
  },
4518
4544
  options: [
4519
4545
  {
4520
- id: "30%",
4546
+ id: "188px",
4521
4547
  label: "Small"
4522
4548
  },
4523
4549
  {
4524
- id: "50%",
4550
+ id: "375px",
4525
4551
  label: "Medium"
4526
4552
  },
4527
4553
  {
4528
- id: "70%",
4554
+ id: "563px",
4529
4555
  label: "Large"
4530
4556
  },
4531
4557
  {
@@ -4836,10 +4862,8 @@ var placeholderData = `data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w
4836
4862
  var import_LexicalComposerContext19 = require("@lexical/react/LexicalComposerContext");
4837
4863
  var import_LexicalErrorBoundary = require("@lexical/react/LexicalErrorBoundary");
4838
4864
  var import_LexicalHistoryPlugin2 = require("@lexical/react/LexicalHistoryPlugin");
4839
- var import_LexicalListPlugin = require("@lexical/react/LexicalListPlugin");
4840
4865
  var import_LexicalNestedComposer = require("@lexical/react/LexicalNestedComposer");
4841
- var import_LexicalRichTextPlugin = require("@lexical/react/LexicalRichTextPlugin");
4842
- var import_LexicalTabIndentationPlugin = require("@lexical/react/LexicalTabIndentationPlugin");
4866
+ var import_LexicalPlainTextPlugin = require("@lexical/react/LexicalPlainTextPlugin");
4843
4867
  var import_useLexicalNodeSelection2 = require("@lexical/react/useLexicalNodeSelection");
4844
4868
  var import_utils5 = require("@lexical/utils");
4845
4869
  var import_lexical20 = require("lexical");
@@ -4867,9 +4891,6 @@ function ImageComponent(props) {
4867
4891
  if (root.getFirstChild() === null) {
4868
4892
  const paragraph = (0, import_lexical20.$createParagraphNode)();
4869
4893
  const textNode = (0, import_lexical20.$createTextNode)("Image caption");
4870
- textNode.setStyle(
4871
- "font-size: var(--sl-font-size-small); color: var(--sl-color-gray-500)"
4872
- );
4873
4894
  paragraph.append(textNode);
4874
4895
  paragraph.setFormat("center");
4875
4896
  root.append(paragraph);
@@ -4930,7 +4951,7 @@ function ImageComponent(props) {
4930
4951
  }
4931
4952
  );
4932
4953
  }
4933
- return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_jsx_runtime47.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "image-box", style: { width }, children: [
4954
+ return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_jsx_runtime47.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "image-box", style: { width, maxWidth: "100%" }, children: [
4934
4955
  src ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
4935
4956
  "img",
4936
4957
  {
@@ -4998,18 +5019,15 @@ function ImageComponent(props) {
4998
5019
  position: "relative"
4999
5020
  },
5000
5021
  children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_LexicalNestedComposer.LexicalNestedComposer, { initialEditor: caption, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(NestedEditor, { nodeKey, children: [
5022
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(SettingsPanelNestedAgentPlugin, {}),
5001
5023
  /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
5002
- import_LexicalRichTextPlugin.RichTextPlugin,
5024
+ import_LexicalPlainTextPlugin.PlainTextPlugin,
5003
5025
  {
5004
5026
  contentEditable: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(NestedContentEditable, {}),
5005
- placeholder: null,
5006
5027
  ErrorBoundary: import_LexicalErrorBoundary.LexicalErrorBoundary
5007
5028
  }
5008
5029
  ),
5009
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_LexicalHistoryPlugin2.HistoryPlugin, { externalHistoryState: historyState }),
5010
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_LexicalListPlugin.ListPlugin, {}),
5011
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_LexicalTabIndentationPlugin.TabIndentationPlugin, {}),
5012
- /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TextToolbarAgentPlugin, { decoratorNode: ImageNode })
5030
+ /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_LexicalHistoryPlugin2.HistoryPlugin, { externalHistoryState: historyState })
5013
5031
  ] }) })
5014
5032
  }
5015
5033
  )
@@ -5017,7 +5035,6 @@ function ImageComponent(props) {
5017
5035
  }
5018
5036
 
5019
5037
  // src/plugins/ImagePlugin/ImageNode.tsx
5020
- var import_html = require("@lexical/html");
5021
5038
  var import_lexical21 = require("lexical");
5022
5039
  var import_jsx_runtime48 = require("react/jsx-runtime");
5023
5040
  function convertImageElement(domNode) {
@@ -5089,35 +5106,6 @@ var ImageNode = class _ImageNode extends import_lexical21.DecoratorNode {
5089
5106
  }
5090
5107
  exportDOM() {
5091
5108
  const element = this._createWrapper();
5092
- const imgBox = document.createElement("div");
5093
- imgBox.classList.add("image-box");
5094
- imgBox.style.width = this.__width.toString();
5095
- element.appendChild(imgBox);
5096
- const img = document.createElement("img");
5097
- img.setAttribute("src", this.__src || "");
5098
- img.style.width = "100%";
5099
- img.style.borderRadius = "var(--sl-border-radius-small)";
5100
- if (this.__showBorder) {
5101
- img.style.border = "1px solid var(--sl-color-neutral-300)";
5102
- }
5103
- imgBox.appendChild(img);
5104
- if (this.__showCaption && this.__caption) {
5105
- const div = document.createElement("div");
5106
- div.style.width = "100%";
5107
- this.__caption.getEditorState().read(() => {
5108
- div.innerHTML = (0, import_html.$generateHtmlFromNodes)(this.__caption, null);
5109
- const rootNode = (0, import_lexical21.$getRoot)();
5110
- if (rootNode) {
5111
- img.setAttribute(
5112
- "alt",
5113
- rootNode.getAllTextNodes().map((textNode) => {
5114
- return textNode.getTextContent();
5115
- }).join(" ")
5116
- );
5117
- }
5118
- });
5119
- imgBox.appendChild(div);
5120
- }
5121
5109
  return { element };
5122
5110
  }
5123
5111
  static importDOM() {
@@ -5405,7 +5393,15 @@ var VariableNode = class _VariableNode extends import_lexical23.DecoratorNode {
5405
5393
  this.__variable
5406
5394
  );
5407
5395
  if (this.__isPreviewMode) {
5408
- element.textContent = this.__variableValue || "[???]";
5396
+ const variableAsNumber = this.__variableValue ? getNumber(this.__variableValue) : void 0;
5397
+ if (variableAsNumber) {
5398
+ element.textContent = formatNumber(
5399
+ variableAsNumber,
5400
+ this.__variableFormat
5401
+ );
5402
+ } else {
5403
+ element.textContent = "[???]";
5404
+ }
5409
5405
  } else {
5410
5406
  element.textContent = this.__variable;
5411
5407
  }
@@ -5422,7 +5418,15 @@ var VariableNode = class _VariableNode extends import_lexical23.DecoratorNode {
5422
5418
  }
5423
5419
  updateDOM(_prevNode, dom, _config) {
5424
5420
  if (this.__isPreviewMode) {
5425
- dom.textContent = this.__variableValue || "[???]";
5421
+ const variableAsNumber = this.__variableValue ? getNumber(this.__variableValue) : void 0;
5422
+ if (variableAsNumber) {
5423
+ dom.textContent = formatNumber(
5424
+ variableAsNumber,
5425
+ this.__variableFormat
5426
+ );
5427
+ } else {
5428
+ dom.textContent = "[???]";
5429
+ }
5426
5430
  } else {
5427
5431
  dom.textContent = this.__variable;
5428
5432
  }
@@ -5646,7 +5650,7 @@ var import_LexicalComposerContext22 = require("@lexical/react/LexicalComposerCon
5646
5650
  var import_LexicalErrorBoundary2 = require("@lexical/react/LexicalErrorBoundary");
5647
5651
  var import_LexicalHistoryPlugin3 = require("@lexical/react/LexicalHistoryPlugin");
5648
5652
  var import_LexicalNestedComposer2 = require("@lexical/react/LexicalNestedComposer");
5649
- var import_LexicalRichTextPlugin2 = require("@lexical/react/LexicalRichTextPlugin");
5653
+ var import_LexicalRichTextPlugin = require("@lexical/react/LexicalRichTextPlugin");
5650
5654
  var import_lexical25 = require("lexical");
5651
5655
  var import_react41 = require("react");
5652
5656
  var import_jsx_runtime52 = require("react/jsx-runtime");
@@ -5702,7 +5706,7 @@ function FinancialStatementQuestionComponent(props) {
5702
5706
  children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_LexicalNestedComposer2.LexicalNestedComposer, { initialEditor: header, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(NestedEditor, { nodeKey, children: [
5703
5707
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(SettingsPanelNestedAgentPlugin, {}),
5704
5708
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
5705
- import_LexicalRichTextPlugin2.RichTextPlugin,
5709
+ import_LexicalRichTextPlugin.RichTextPlugin,
5706
5710
  {
5707
5711
  contentEditable: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(NestedContentEditable, {}),
5708
5712
  ErrorBoundary: import_LexicalErrorBoundary2.LexicalErrorBoundary,
@@ -5799,7 +5803,7 @@ function FinancialStatementQuestionComponent(props) {
5799
5803
  children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(NestedEditor, { nodeKey, children: [
5800
5804
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(SettingsPanelNestedAgentPlugin, {}),
5801
5805
  /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
5802
- import_LexicalRichTextPlugin2.RichTextPlugin,
5806
+ import_LexicalRichTextPlugin.RichTextPlugin,
5803
5807
  {
5804
5808
  contentEditable: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(NestedContentEditable, {}),
5805
5809
  ErrorBoundary: import_LexicalErrorBoundary2.LexicalErrorBoundary,
@@ -6147,7 +6151,7 @@ var import_LexicalComposerContext25 = require("@lexical/react/LexicalComposerCon
6147
6151
  var import_LexicalErrorBoundary3 = require("@lexical/react/LexicalErrorBoundary");
6148
6152
  var import_LexicalHistoryPlugin4 = require("@lexical/react/LexicalHistoryPlugin");
6149
6153
  var import_LexicalNestedComposer3 = require("@lexical/react/LexicalNestedComposer");
6150
- var import_LexicalRichTextPlugin3 = require("@lexical/react/LexicalRichTextPlugin");
6154
+ var import_LexicalRichTextPlugin2 = require("@lexical/react/LexicalRichTextPlugin");
6151
6155
  var import_clsx2 = __toESM(require("clsx"));
6152
6156
  var import_lexical29 = require("lexical");
6153
6157
  var import_lucide_react6 = require("lucide-react");
@@ -6232,7 +6236,7 @@ function QuestionItemComponent(props) {
6232
6236
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { style: { height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_LexicalNestedComposer3.LexicalNestedComposer, { initialEditor: itemPremiseContent, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(NestedEditor, { nodeKey, children: [
6233
6237
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SettingsPanelNestedAgentPlugin, {}),
6234
6238
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6235
- import_LexicalRichTextPlugin3.RichTextPlugin,
6239
+ import_LexicalRichTextPlugin2.RichTextPlugin,
6236
6240
  {
6237
6241
  contentEditable: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(NestedContentEditable, {}),
6238
6242
  ErrorBoundary: import_LexicalErrorBoundary3.LexicalErrorBoundary,
@@ -6271,7 +6275,7 @@ function QuestionItemComponent(props) {
6271
6275
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { style: { height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_LexicalNestedComposer3.LexicalNestedComposer, { initialEditor: itemOptionContent, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(NestedEditor, { nodeKey, children: [
6272
6276
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(SettingsPanelNestedAgentPlugin, {}),
6273
6277
  /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
6274
- import_LexicalRichTextPlugin3.RichTextPlugin,
6278
+ import_LexicalRichTextPlugin2.RichTextPlugin,
6275
6279
  {
6276
6280
  contentEditable: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(NestedContentEditable, {}),
6277
6281
  ErrorBoundary: import_LexicalErrorBoundary3.LexicalErrorBoundary,
@@ -6592,7 +6596,7 @@ var import_LexicalComposerContext27 = require("@lexical/react/LexicalComposerCon
6592
6596
  var import_LexicalErrorBoundary4 = require("@lexical/react/LexicalErrorBoundary");
6593
6597
  var import_LexicalHistoryPlugin5 = require("@lexical/react/LexicalHistoryPlugin");
6594
6598
  var import_LexicalNestedComposer4 = require("@lexical/react/LexicalNestedComposer");
6595
- var import_LexicalRichTextPlugin4 = require("@lexical/react/LexicalRichTextPlugin");
6599
+ var import_LexicalRichTextPlugin3 = require("@lexical/react/LexicalRichTextPlugin");
6596
6600
  var import_clsx3 = __toESM(require("clsx"));
6597
6601
  var import_lexical32 = require("lexical");
6598
6602
  var import_lucide_react7 = require("lucide-react");
@@ -6651,7 +6655,7 @@ function MultipleOptionQuestionItemComponent(props) {
6651
6655
  /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_LexicalNestedComposer4.LexicalNestedComposer, { initialEditor: content, children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(NestedEditor, { nodeKey, children: [
6652
6656
  /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(SettingsPanelNestedAgentPlugin, {}),
6653
6657
  /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
6654
- import_LexicalRichTextPlugin4.RichTextPlugin,
6658
+ import_LexicalRichTextPlugin3.RichTextPlugin,
6655
6659
  {
6656
6660
  contentEditable: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(NestedContentEditable, {}),
6657
6661
  ErrorBoundary: import_LexicalErrorBoundary4.LexicalErrorBoundary,
@@ -7044,7 +7048,7 @@ var import_LexicalComposerContext29 = require("@lexical/react/LexicalComposerCon
7044
7048
  var import_LexicalErrorBoundary5 = require("@lexical/react/LexicalErrorBoundary");
7045
7049
  var import_LexicalHistoryPlugin6 = require("@lexical/react/LexicalHistoryPlugin");
7046
7050
  var import_LexicalNestedComposer5 = require("@lexical/react/LexicalNestedComposer");
7047
- var import_LexicalRichTextPlugin5 = require("@lexical/react/LexicalRichTextPlugin");
7051
+ var import_LexicalRichTextPlugin4 = require("@lexical/react/LexicalRichTextPlugin");
7048
7052
  var import_lexical35 = require("lexical");
7049
7053
  var import_react48 = require("react");
7050
7054
  var import_jsx_runtime62 = require("react/jsx-runtime");
@@ -7099,7 +7103,7 @@ function ShortAnswerQuestionComponent(props) {
7099
7103
  /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_LexicalNestedComposer5.LexicalNestedComposer, { initialEditor: notes, children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(NestedEditor, { nodeKey, children: [
7100
7104
  /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(SettingsPanelNestedAgentPlugin, {}),
7101
7105
  /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
7102
- import_LexicalRichTextPlugin5.RichTextPlugin,
7106
+ import_LexicalRichTextPlugin4.RichTextPlugin,
7103
7107
  {
7104
7108
  contentEditable: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(NestedContentEditable, {}),
7105
7109
  ErrorBoundary: import_LexicalErrorBoundary5.LexicalErrorBoundary,
@@ -7272,7 +7276,7 @@ var import_LexicalComposerContext31 = require("@lexical/react/LexicalComposerCon
7272
7276
  var import_LexicalErrorBoundary6 = require("@lexical/react/LexicalErrorBoundary");
7273
7277
  var import_LexicalHistoryPlugin7 = require("@lexical/react/LexicalHistoryPlugin");
7274
7278
  var import_LexicalNestedComposer6 = require("@lexical/react/LexicalNestedComposer");
7275
- var import_LexicalRichTextPlugin6 = require("@lexical/react/LexicalRichTextPlugin");
7279
+ var import_LexicalRichTextPlugin5 = require("@lexical/react/LexicalRichTextPlugin");
7276
7280
  var import_clsx4 = __toESM(require("clsx"));
7277
7281
  var import_lexical38 = require("lexical");
7278
7282
  var import_lucide_react8 = require("lucide-react");
@@ -7363,7 +7367,7 @@ function JournalEntryQuestionItemComponent(props) {
7363
7367
  /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { style: { height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_LexicalNestedComposer6.LexicalNestedComposer, { initialEditor: account, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(NestedEditor, { nodeKey, children: [
7364
7368
  /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SettingsPanelNestedAgentPlugin, {}),
7365
7369
  /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
7366
- import_LexicalRichTextPlugin6.RichTextPlugin,
7370
+ import_LexicalRichTextPlugin5.RichTextPlugin,
7367
7371
  {
7368
7372
  contentEditable: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(NestedContentEditable, {}),
7369
7373
  ErrorBoundary: import_LexicalErrorBoundary6.LexicalErrorBoundary,
@@ -7405,7 +7409,7 @@ function JournalEntryQuestionItemComponent(props) {
7405
7409
  /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { style: { height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_LexicalNestedComposer6.LexicalNestedComposer, { initialEditor: debit, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(NestedEditor, { nodeKey, children: [
7406
7410
  /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SettingsPanelNestedAgentPlugin, {}),
7407
7411
  /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
7408
- import_LexicalRichTextPlugin6.RichTextPlugin,
7412
+ import_LexicalRichTextPlugin5.RichTextPlugin,
7409
7413
  {
7410
7414
  contentEditable: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(NestedContentEditable, {}),
7411
7415
  ErrorBoundary: import_LexicalErrorBoundary6.LexicalErrorBoundary,
@@ -7447,7 +7451,7 @@ function JournalEntryQuestionItemComponent(props) {
7447
7451
  /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { style: { height: "100%" }, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_LexicalNestedComposer6.LexicalNestedComposer, { initialEditor: credit, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(NestedEditor, { nodeKey, children: [
7448
7452
  /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(SettingsPanelNestedAgentPlugin, {}),
7449
7453
  /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
7450
- import_LexicalRichTextPlugin6.RichTextPlugin,
7454
+ import_LexicalRichTextPlugin5.RichTextPlugin,
7451
7455
  {
7452
7456
  contentEditable: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(NestedContentEditable, {}),
7453
7457
  ErrorBoundary: import_LexicalErrorBoundary6.LexicalErrorBoundary,
@@ -7892,10 +7896,10 @@ function TypeaheadMenuAgentPlugin(props) {
7892
7896
  var import_LexicalComposerContext36 = require("@lexical/react/LexicalComposerContext");
7893
7897
  var import_LexicalErrorBoundary7 = require("@lexical/react/LexicalErrorBoundary");
7894
7898
  var import_LexicalHistoryPlugin8 = require("@lexical/react/LexicalHistoryPlugin");
7895
- var import_LexicalListPlugin2 = require("@lexical/react/LexicalListPlugin");
7899
+ var import_LexicalListPlugin = require("@lexical/react/LexicalListPlugin");
7896
7900
  var import_LexicalNestedComposer7 = require("@lexical/react/LexicalNestedComposer");
7897
- var import_LexicalRichTextPlugin7 = require("@lexical/react/LexicalRichTextPlugin");
7898
- var import_LexicalTabIndentationPlugin2 = require("@lexical/react/LexicalTabIndentationPlugin");
7901
+ var import_LexicalRichTextPlugin6 = require("@lexical/react/LexicalRichTextPlugin");
7902
+ var import_LexicalTabIndentationPlugin = require("@lexical/react/LexicalTabIndentationPlugin");
7899
7903
  var import_lexical45 = require("lexical");
7900
7904
  var import_react55 = require("react");
7901
7905
 
@@ -8085,7 +8089,7 @@ function FillInTheBlankQuestionComponent(props) {
8085
8089
  /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(FillInTheBlankSpaceComponentPlugin, {}),
8086
8090
  /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(FillInTheBlankSpaceSettingsPlugin, {}),
8087
8091
  /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
8088
- import_LexicalRichTextPlugin7.RichTextPlugin,
8092
+ import_LexicalRichTextPlugin6.RichTextPlugin,
8089
8093
  {
8090
8094
  contentEditable: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(NestedContentEditable, {}),
8091
8095
  ErrorBoundary: import_LexicalErrorBoundary7.LexicalErrorBoundary,
@@ -8114,10 +8118,10 @@ function FillInTheBlankQuestionComponent(props) {
8114
8118
  decoratorNode: FillInTheBlankQuestionNode
8115
8119
  }
8116
8120
  ),
8117
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_LexicalListPlugin2.ListPlugin, {}),
8121
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_LexicalListPlugin.ListPlugin, {}),
8118
8122
  /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(ListLevelLimitPlugin, {}),
8119
8123
  /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Table, {}),
8120
- /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_LexicalTabIndentationPlugin2.TabIndentationPlugin, {})
8124
+ /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_LexicalTabIndentationPlugin.TabIndentationPlugin, {})
8121
8125
  ] }) })
8122
8126
  ]
8123
8127
  }
@@ -8322,7 +8326,8 @@ function SettingsPanelPlugin() {
8322
8326
  drawer,
8323
8327
  getSettingsPanel,
8324
8328
  getNestedEditor,
8325
- renderSettings
8329
+ renderSettings,
8330
+ autoOpenSettingsPanel
8326
8331
  } = useBlockEditor();
8327
8332
  const [_articleIsReady, setArticleReady] = (0, import_react57.useState)(false);
8328
8333
  const articleElementRef = (0, import_react57.useRef)();
@@ -8353,6 +8358,7 @@ function SettingsPanelPlugin() {
8353
8358
  }
8354
8359
  if (currentFocusedNode.current) {
8355
8360
  setSelectedNode(currentFocusedNode.current.getKey());
8361
+ autoOpenSettingsPanel();
8356
8362
  } else {
8357
8363
  setSelectedNode(void 0);
8358
8364
  }
@@ -8585,7 +8591,7 @@ function getLineBreakNodeBeforeCaretOnLastLine(paragraph, selection) {
8585
8591
  var import_LexicalErrorBoundary8 = require("@lexical/react/LexicalErrorBoundary");
8586
8592
  var import_LexicalHistoryPlugin9 = require("@lexical/react/LexicalHistoryPlugin");
8587
8593
  var import_LexicalNestedComposer8 = require("@lexical/react/LexicalNestedComposer");
8588
- var import_LexicalPlainTextPlugin = require("@lexical/react/LexicalPlainTextPlugin");
8594
+ var import_LexicalPlainTextPlugin2 = require("@lexical/react/LexicalPlainTextPlugin");
8589
8595
  var import_useLexicalNodeSelection3 = require("@lexical/react/useLexicalNodeSelection");
8590
8596
  var import_utils14 = require("@lexical/utils");
8591
8597
  var import_lexical51 = require("lexical");
@@ -8700,7 +8706,7 @@ function CalloutBoxComponent(props) {
8700
8706
  children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_LexicalNestedComposer8.LexicalNestedComposer, { initialEditor: content, children: /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(NestedEditor, { nodeKey, children: [
8701
8707
  /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(SettingsPanelNestedAgentPlugin, {}),
8702
8708
  /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
8703
- import_LexicalPlainTextPlugin.PlainTextPlugin,
8709
+ import_LexicalPlainTextPlugin2.PlainTextPlugin,
8704
8710
  {
8705
8711
  contentEditable: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(NestedContentEditable, {}),
8706
8712
  ErrorBoundary: import_LexicalErrorBoundary8.LexicalErrorBoundary
@@ -8723,8 +8729,8 @@ var CALLOUT_ICONS = {
8723
8729
  tip: import_lucide_react9.Lightbulb
8724
8730
  };
8725
8731
  var CALLOUT_COLORS = {
8726
- info: "--sl-color-sky",
8727
- tip: "--sl-color-teal"
8732
+ info: "--sl-color-primary",
8733
+ tip: "--sl-color-success"
8728
8734
  };
8729
8735
  var CALLOUT_LABELS = {
8730
8736
  info: "Instructions",
@@ -9378,20 +9384,58 @@ var initialEditorRegistry = {
9378
9384
  Questions: false
9379
9385
  };
9380
9386
 
9387
+ // src/content/drawer/Drawer.tsx
9388
+ var import_lucide_react10 = require("lucide-react");
9389
+ var import_react63 = require("react");
9390
+ var import_jsx_runtime83 = require("react/jsx-runtime");
9391
+ var Drawer = (0, import_react63.forwardRef)(
9392
+ (props, ref) => {
9393
+ const {
9394
+ settingsPanelSwitch,
9395
+ toggleSettingsPanelSwitch,
9396
+ modulesNumber,
9397
+ hasModule
9398
+ } = useBlockEditor();
9399
+ const [showSettingsButton, setShowSettingsButton] = (0, import_react63.useState)(false);
9400
+ (0, import_react63.useEffect)(() => {
9401
+ if (hasModule("SettingsPanel")) {
9402
+ setShowSettingsButton(true);
9403
+ }
9404
+ }, [modulesNumber, hasModule]);
9405
+ return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
9406
+ "nav",
9407
+ {
9408
+ ref,
9409
+ className: !showSettingsButton ? "disabled" : settingsPanelSwitch === "on" ? "shown" : "hidden",
9410
+ children: settingsPanelSwitch === "off" && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
9411
+ Button,
9412
+ {
9413
+ className: "cancel",
9414
+ variant: "text",
9415
+ size: "large",
9416
+ StartIcon: import_lucide_react10.Menu,
9417
+ onClick: toggleSettingsPanelSwitch
9418
+ }
9419
+ ) })
9420
+ }
9421
+ );
9422
+ }
9423
+ );
9424
+
9381
9425
  // src/content/editable/ContentEditable.tsx
9382
9426
  var import_LexicalContentEditable2 = require("@lexical/react/LexicalContentEditable");
9383
- var import_jsx_runtime83 = require("react/jsx-runtime");
9427
+ var import_jsx_runtime84 = require("react/jsx-runtime");
9384
9428
  function ContentEditable() {
9385
- return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_LexicalContentEditable2.ContentEditable, { className: "content" });
9429
+ return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_LexicalContentEditable2.ContentEditable, { className: "content" });
9386
9430
  }
9387
9431
 
9388
9432
  // src/content/node/NodeProvider.tsx
9389
- var import_react78 = __toESM(require("react"));
9433
+ var import_react79 = __toESM(require("react"));
9390
9434
 
9391
9435
  // src/components/inputs/DropdownWrapper.tsx
9392
- var import_react63 = require("react");
9393
- var import_jsx_runtime84 = require("react/jsx-runtime");
9394
- var DropdownWrapper = (0, import_react63.forwardRef)((props, ref) => {
9436
+ var import_react64 = require("react");
9437
+ var import_jsx_runtime85 = require("react/jsx-runtime");
9438
+ var DropdownWrapper = (0, import_react64.forwardRef)((props, ref) => {
9395
9439
  const {
9396
9440
  className,
9397
9441
  menuClassName,
@@ -9402,9 +9446,9 @@ var DropdownWrapper = (0, import_react63.forwardRef)((props, ref) => {
9402
9446
  triggerAttribute,
9403
9447
  children
9404
9448
  } = props;
9405
- const menuRef = (0, import_react63.useRef)(null);
9406
- const dropdownRef = (0, import_react63.useRef)(null);
9407
- (0, import_react63.useImperativeHandle)(ref, () => ({
9449
+ const menuRef = (0, import_react64.useRef)(null);
9450
+ const dropdownRef = (0, import_react64.useRef)(null);
9451
+ (0, import_react64.useImperativeHandle)(ref, () => ({
9408
9452
  hide: () => {
9409
9453
  dropdownRef.current?.hide();
9410
9454
  },
@@ -9434,7 +9478,7 @@ var DropdownWrapper = (0, import_react63.forwardRef)((props, ref) => {
9434
9478
  {}
9435
9479
  ) || {};
9436
9480
  };
9437
- const menuItemsIndex = (0, import_react63.useMemo)(() => {
9481
+ const menuItemsIndex = (0, import_react64.useMemo)(() => {
9438
9482
  return menu ? createMenuItemsIndex(menu) : {};
9439
9483
  }, [menu]);
9440
9484
  function handleMenuItemClick(e) {
@@ -9473,9 +9517,9 @@ var DropdownWrapper = (0, import_react63.forwardRef)((props, ref) => {
9473
9517
  subMenu
9474
9518
  } = menuItem;
9475
9519
  if (menuItemDivider) {
9476
- menuItemElement = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("sl-divider", { ...triggerData }, `menuItem${menuItemId}`);
9520
+ menuItemElement = /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("sl-divider", { ...triggerData }, `menuItem${menuItemId}`);
9477
9521
  } else if (menuItemIsGroup) {
9478
- menuItemElement = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("sl-menu-label", { children: menuItemLabel }, `menuItem${menuItemId}`);
9522
+ menuItemElement = /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("sl-menu-label", { children: menuItemLabel }, `menuItem${menuItemId}`);
9479
9523
  } else if (subMenu) {
9480
9524
  const subMenuElements = [];
9481
9525
  let subTabsIndex = 0;
@@ -9484,7 +9528,7 @@ var DropdownWrapper = (0, import_react63.forwardRef)((props, ref) => {
9484
9528
  createMenuItem(subMenuItem, subTabsIndex++)
9485
9529
  );
9486
9530
  }
9487
- menuItemElement = /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
9531
+ menuItemElement = /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
9488
9532
  "sl-menu-item",
9489
9533
  {
9490
9534
  className: menuItemClassName,
@@ -9494,7 +9538,7 @@ var DropdownWrapper = (0, import_react63.forwardRef)((props, ref) => {
9494
9538
  e.stopPropagation();
9495
9539
  },
9496
9540
  children: [
9497
- MenuItemIcon && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
9541
+ MenuItemIcon && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
9498
9542
  Icon,
9499
9543
  {
9500
9544
  style: { color: menuItemColor || "inherit" },
@@ -9503,7 +9547,7 @@ var DropdownWrapper = (0, import_react63.forwardRef)((props, ref) => {
9503
9547
  }
9504
9548
  ),
9505
9549
  menuItemLabel,
9506
- /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
9550
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
9507
9551
  "sl-menu",
9508
9552
  {
9509
9553
  slot: "submenu",
@@ -9528,7 +9572,7 @@ var DropdownWrapper = (0, import_react63.forwardRef)((props, ref) => {
9528
9572
  menuItemAttributes.type = "checkbox";
9529
9573
  menuItemAttributes.checked = menuItemSelected;
9530
9574
  }
9531
- menuItemElement = /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
9575
+ menuItemElement = /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
9532
9576
  "sl-menu-item",
9533
9577
  {
9534
9578
  value: menuItemId,
@@ -9540,7 +9584,7 @@ var DropdownWrapper = (0, import_react63.forwardRef)((props, ref) => {
9540
9584
  e.stopPropagation();
9541
9585
  },
9542
9586
  children: [
9543
- MenuItemIcon && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
9587
+ MenuItemIcon && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
9544
9588
  Icon,
9545
9589
  {
9546
9590
  style: { color: menuItemColor || "inherit" },
@@ -9549,7 +9593,7 @@ var DropdownWrapper = (0, import_react63.forwardRef)((props, ref) => {
9549
9593
  }
9550
9594
  ),
9551
9595
  menuItemLabel,
9552
- menuItemIsError && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(DotBadge, { variant: "danger", leftSided: true })
9596
+ menuItemIsError && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(DotBadge, { variant: "danger", leftSided: true })
9553
9597
  ]
9554
9598
  },
9555
9599
  `menuItem${menuItemId}`
@@ -9557,7 +9601,7 @@ var DropdownWrapper = (0, import_react63.forwardRef)((props, ref) => {
9557
9601
  }
9558
9602
  return menuItemElement;
9559
9603
  };
9560
- const menuItems = (0, import_react63.useMemo)(() => {
9604
+ const menuItems = (0, import_react64.useMemo)(() => {
9561
9605
  const resultList = [];
9562
9606
  if (menu && menu.length > 0) {
9563
9607
  let tabIndex = 0;
@@ -9571,7 +9615,7 @@ var DropdownWrapper = (0, import_react63.forwardRef)((props, ref) => {
9571
9615
  }, [menu]);
9572
9616
  filterNilAttrs(props, ["sync", "slot"]);
9573
9617
  const dropdownAttributes = filterNilAttrs(props, ["placement"]);
9574
- (0, import_react63.useEffect)(() => {
9618
+ (0, import_react64.useEffect)(() => {
9575
9619
  window.customElements.whenDefined("sl-menu").then(() => {
9576
9620
  if (menuRef.current) {
9577
9621
  menuRef.current.addEventListener(
@@ -9589,7 +9633,7 @@ var DropdownWrapper = (0, import_react63.forwardRef)((props, ref) => {
9589
9633
  }
9590
9634
  };
9591
9635
  }, [menu]);
9592
- (0, import_react63.useEffect)(() => {
9636
+ (0, import_react64.useEffect)(() => {
9593
9637
  window.customElements.whenDefined("sl-dropdown").then(() => {
9594
9638
  if (dropdownRef.current) {
9595
9639
  dropdownRef.current.addEventListener(
@@ -9615,7 +9659,7 @@ var DropdownWrapper = (0, import_react63.forwardRef)((props, ref) => {
9615
9659
  }
9616
9660
  };
9617
9661
  }, []);
9618
- const buttonElement = /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
9662
+ const buttonElement = /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
9619
9663
  "sl-dropdown",
9620
9664
  {
9621
9665
  ref: dropdownRef,
@@ -9624,7 +9668,7 @@ var DropdownWrapper = (0, import_react63.forwardRef)((props, ref) => {
9624
9668
  ...dropdownAttributes,
9625
9669
  children: [
9626
9670
  children,
9627
- menuItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
9671
+ menuItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
9628
9672
  "sl-menu",
9629
9673
  {
9630
9674
  ref: menuRef,
@@ -9675,12 +9719,12 @@ var import_LexicalComposerContext44 = require("@lexical/react/LexicalComposerCon
9675
9719
  var import_table13 = require("@lexical/table");
9676
9720
  var import_utils16 = require("@lexical/utils");
9677
9721
  var import_lexical60 = require("lexical");
9678
- var import_react65 = require("react");
9722
+ var import_react66 = require("react");
9679
9723
 
9680
9724
  // src/plugins/FillInTheBlankQuestionPlugin/FillInTheBlankQuestionSettings.tsx
9681
9725
  var import_LexicalComposerContext43 = require("@lexical/react/LexicalComposerContext");
9682
9726
  var import_lexical59 = require("lexical");
9683
- var import_react64 = require("react");
9727
+ var import_react65 = require("react");
9684
9728
 
9685
9729
  // src/plugins/FillInTheBlankQuestionPlugin/validatePointslnput.ts
9686
9730
  function validatePointsInput(input) {
@@ -9702,13 +9746,13 @@ function validatePointsInput(input) {
9702
9746
  }
9703
9747
 
9704
9748
  // src/plugins/FillInTheBlankQuestionPlugin/FillInTheBlankQuestionSettings.tsx
9705
- var import_jsx_runtime85 = require("react/jsx-runtime");
9749
+ var import_jsx_runtime86 = require("react/jsx-runtime");
9706
9750
  function FillInTheBlankQuestionSettings(props) {
9707
9751
  const { nodeKey } = props;
9708
9752
  const [editor] = (0, import_LexicalComposerContext43.useLexicalComposerContext)();
9709
- const pointsTextInputRef = (0, import_react64.useRef)(null);
9710
- const [foundNode, setFoundNode] = (0, import_react64.useState)();
9711
- (0, import_react64.useEffect)(() => {
9753
+ const pointsTextInputRef = (0, import_react65.useRef)(null);
9754
+ const [foundNode, setFoundNode] = (0, import_react65.useState)();
9755
+ (0, import_react65.useEffect)(() => {
9712
9756
  if (nodeKey) {
9713
9757
  editor.getEditorState().read(() => {
9714
9758
  const fillInTheBlankNode = (0, import_lexical59.$getNodeByKey)(nodeKey);
@@ -9721,7 +9765,7 @@ function FillInTheBlankQuestionSettings(props) {
9721
9765
  if (!foundNode) {
9722
9766
  return null;
9723
9767
  }
9724
- return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
9768
+ return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
9725
9769
  TextInput,
9726
9770
  {
9727
9771
  ref: pointsTextInputRef,
@@ -9751,7 +9795,7 @@ function FillInTheBlankQuestionSettings(props) {
9751
9795
  }
9752
9796
 
9753
9797
  // src/plugins/FillInTheBlankQuestionPlugin/FillInTheBlankQuestionPlugin.tsx
9754
- var import_jsx_runtime86 = require("react/jsx-runtime");
9798
+ var import_jsx_runtime87 = require("react/jsx-runtime");
9755
9799
  var INSERT_FILL_IN_THE_BLANK_QUESTION_COMMAND = (0, import_lexical60.createCommand)("INSERT_FILL_IN_THE_BLANK_QUESTION_COMMAND");
9756
9800
  function FillInTheBlankQuestionPlugin() {
9757
9801
  const {
@@ -9761,8 +9805,8 @@ function FillInTheBlankQuestionPlugin() {
9761
9805
  toggleSettingsPanelSwitch
9762
9806
  } = useBlockEditor();
9763
9807
  const [editor] = (0, import_LexicalComposerContext44.useLexicalComposerContext)();
9764
- const settingsPanelStickyRef = (0, import_react65.useRef)(null);
9765
- (0, import_react65.useEffect)(() => {
9808
+ const settingsPanelStickyRef = (0, import_react66.useRef)(null);
9809
+ (0, import_react66.useEffect)(() => {
9766
9810
  return (0, import_utils16.mergeRegister)(
9767
9811
  editor.registerCommand(
9768
9812
  INSERT_FILL_IN_THE_BLANK_QUESTION_COMMAND,
@@ -9863,7 +9907,7 @@ function FillInTheBlankQuestionPlugin() {
9863
9907
  )
9864
9908
  );
9865
9909
  }, [editor]);
9866
- (0, import_react65.useEffect)(() => {
9910
+ (0, import_react66.useEffect)(() => {
9867
9911
  if (isBlockEditorReady) {
9868
9912
  if (settingsPanelStickyRef.current) {
9869
9913
  registerSettingsPanel(
@@ -9873,20 +9917,20 @@ function FillInTheBlankQuestionPlugin() {
9873
9917
  }
9874
9918
  }
9875
9919
  }, [isBlockEditorReady]);
9876
- return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_jsx_runtime86.Fragment, { children: drawer && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
9920
+ return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_jsx_runtime87.Fragment, { children: drawer && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
9877
9921
  StickyToPosition,
9878
9922
  {
9879
9923
  ref: settingsPanelStickyRef,
9880
9924
  container: drawer,
9881
9925
  children: (data, position, isVisible) => {
9882
- return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { style: { width: position.width }, children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
9926
+ return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { style: { width: position.width }, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
9883
9927
  SettingsCard,
9884
9928
  {
9885
9929
  isVisible: !!isVisible,
9886
9930
  container: drawer,
9887
9931
  title: "Fill In The Blank Settings",
9888
9932
  onClose: toggleSettingsPanelSwitch,
9889
- children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
9933
+ children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
9890
9934
  FillInTheBlankQuestionSettings,
9891
9935
  {
9892
9936
  nodeKey: data.nodeKey
@@ -9904,12 +9948,12 @@ function FillInTheBlankQuestionPlugin() {
9904
9948
  var import_LexicalComposerContext46 = require("@lexical/react/LexicalComposerContext");
9905
9949
  var import_utils17 = require("@lexical/utils");
9906
9950
  var import_lexical62 = require("lexical");
9907
- var import_react67 = require("react");
9951
+ var import_react68 = require("react");
9908
9952
 
9909
9953
  // src/plugins/JournalEntryQuestionPlugin/JournalEntryQuestionSettings.tsx
9910
9954
  var import_LexicalComposerContext45 = require("@lexical/react/LexicalComposerContext");
9911
9955
  var import_lexical61 = require("lexical");
9912
- var import_react66 = require("react");
9956
+ var import_react67 = require("react");
9913
9957
 
9914
9958
  // src/plugins/JournalEntryQuestionPlugin/validateErrorTolarancelnput.ts
9915
9959
  function validateErrorTolerance(input) {
@@ -9950,15 +9994,15 @@ function validatePointsInput2(input) {
9950
9994
  }
9951
9995
 
9952
9996
  // src/plugins/JournalEntryQuestionPlugin/JournalEntryQuestionSettings.tsx
9953
- var import_jsx_runtime87 = require("react/jsx-runtime");
9997
+ var import_jsx_runtime88 = require("react/jsx-runtime");
9954
9998
  function JournalEntryQuestionSettings(props) {
9955
9999
  const { nodeKey } = props;
9956
10000
  const [editor] = (0, import_LexicalComposerContext45.useLexicalComposerContext)();
9957
- const pointsTextInputRef = (0, import_react66.useRef)(null);
9958
- const errorToleranceTextInputRef = (0, import_react66.useRef)(null);
9959
- const typeRadioGroupRef = (0, import_react66.useRef)(null);
9960
- const [foundNode, setFoundNode] = (0, import_react66.useState)();
9961
- (0, import_react66.useEffect)(() => {
10001
+ const pointsTextInputRef = (0, import_react67.useRef)(null);
10002
+ const errorToleranceTextInputRef = (0, import_react67.useRef)(null);
10003
+ const typeRadioGroupRef = (0, import_react67.useRef)(null);
10004
+ const [foundNode, setFoundNode] = (0, import_react67.useState)();
10005
+ (0, import_react67.useEffect)(() => {
9962
10006
  if (nodeKey) {
9963
10007
  editor.getEditorState().read(() => {
9964
10008
  const journalEntryNode = (0, import_lexical61.$getNodeByKey)(nodeKey);
@@ -9968,7 +10012,7 @@ function JournalEntryQuestionSettings(props) {
9968
10012
  });
9969
10013
  }
9970
10014
  }, [editor, nodeKey]);
9971
- const options = (0, import_react66.useMemo)(() => {
10015
+ const options = (0, import_react67.useMemo)(() => {
9972
10016
  const optionsList = [];
9973
10017
  for (const [itemType, label] of Object.entries(
9974
10018
  JournalTypeLabelMap
@@ -9983,8 +10027,8 @@ function JournalEntryQuestionSettings(props) {
9983
10027
  if (!foundNode) {
9984
10028
  return null;
9985
10029
  }
9986
- return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(import_jsx_runtime87.Fragment, { children: [
9987
- /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
10030
+ return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [
10031
+ /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
9988
10032
  TextInput,
9989
10033
  {
9990
10034
  ref: pointsTextInputRef,
@@ -10011,7 +10055,7 @@ function JournalEntryQuestionSettings(props) {
10011
10055
  }
10012
10056
  }
10013
10057
  ) }),
10014
- /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
10058
+ /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
10015
10059
  TextInput,
10016
10060
  {
10017
10061
  ref: errorToleranceTextInputRef,
@@ -10042,7 +10086,7 @@ function JournalEntryQuestionSettings(props) {
10042
10086
  }
10043
10087
  }
10044
10088
  ) }),
10045
- /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
10089
+ /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
10046
10090
  RadioGroup,
10047
10091
  {
10048
10092
  ref: typeRadioGroupRef,
@@ -10064,7 +10108,7 @@ function JournalEntryQuestionSettings(props) {
10064
10108
  }
10065
10109
 
10066
10110
  // src/plugins/JournalEntryQuestionPlugin/JournalEntryQuestionPlugin.tsx
10067
- var import_jsx_runtime88 = require("react/jsx-runtime");
10111
+ var import_jsx_runtime89 = require("react/jsx-runtime");
10068
10112
  var INSERT_JOURNAL_ENTRY_QUESTION_COMMAND = (0, import_lexical62.createCommand)("INSERT_JOURNAL_ENTRY_QUESTION_COMMAND");
10069
10113
  function JournalEntryQuestionPlugin() {
10070
10114
  const {
@@ -10074,8 +10118,8 @@ function JournalEntryQuestionPlugin() {
10074
10118
  toggleSettingsPanelSwitch
10075
10119
  } = useBlockEditor();
10076
10120
  const [editor] = (0, import_LexicalComposerContext46.useLexicalComposerContext)();
10077
- const settingsPanelStickyRef = (0, import_react67.useRef)(null);
10078
- (0, import_react67.useEffect)(() => {
10121
+ const settingsPanelStickyRef = (0, import_react68.useRef)(null);
10122
+ (0, import_react68.useEffect)(() => {
10079
10123
  return (0, import_utils17.mergeRegister)(
10080
10124
  editor.registerCommand(
10081
10125
  INSERT_JOURNAL_ENTRY_QUESTION_COMMAND,
@@ -10161,7 +10205,7 @@ function JournalEntryQuestionPlugin() {
10161
10205
  )
10162
10206
  );
10163
10207
  }, [editor]);
10164
- (0, import_react67.useEffect)(() => {
10208
+ (0, import_react68.useEffect)(() => {
10165
10209
  if (isBlockEditorReady && settingsPanelStickyRef.current) {
10166
10210
  registerSettingsPanel(
10167
10211
  JournalEntryQuestionNode.getType(),
@@ -10169,20 +10213,20 @@ function JournalEntryQuestionPlugin() {
10169
10213
  );
10170
10214
  }
10171
10215
  }, [isBlockEditorReady]);
10172
- return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_jsx_runtime88.Fragment, { children: drawer && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
10216
+ return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_jsx_runtime89.Fragment, { children: drawer && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10173
10217
  StickyToPosition,
10174
10218
  {
10175
10219
  ref: settingsPanelStickyRef,
10176
10220
  container: drawer,
10177
10221
  children: (data, position, isVisible) => {
10178
- return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { style: { width: position.width }, children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
10222
+ return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { style: { width: position.width }, children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10179
10223
  SettingsCard,
10180
10224
  {
10181
10225
  isVisible: !!isVisible,
10182
10226
  container: drawer,
10183
10227
  title: "Journal Entry Settings",
10184
10228
  onClose: toggleSettingsPanelSwitch,
10185
- children: isVisible && /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
10229
+ children: isVisible && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10186
10230
  JournalEntryQuestionSettings,
10187
10231
  {
10188
10232
  nodeKey: data.nodeKey
@@ -10198,7 +10242,7 @@ function JournalEntryQuestionPlugin() {
10198
10242
  // src/plugins/MatchingQuestionPlugin/MatchingQuestionSettings.tsx
10199
10243
  var import_LexicalComposerContext47 = require("@lexical/react/LexicalComposerContext");
10200
10244
  var import_lexical63 = require("lexical");
10201
- var import_react68 = require("react");
10245
+ var import_react69 = require("react");
10202
10246
 
10203
10247
  // src/plugins/MatchingQuestionPlugin/validatePointslnput.ts
10204
10248
  function validatePointsInput3(input) {
@@ -10220,13 +10264,13 @@ function validatePointsInput3(input) {
10220
10264
  }
10221
10265
 
10222
10266
  // src/plugins/MatchingQuestionPlugin/MatchingQuestionSettings.tsx
10223
- var import_jsx_runtime89 = require("react/jsx-runtime");
10267
+ var import_jsx_runtime90 = require("react/jsx-runtime");
10224
10268
  function MatchingQuestionSettings(props) {
10225
10269
  const { nodeKey } = props;
10226
10270
  const [editor] = (0, import_LexicalComposerContext47.useLexicalComposerContext)();
10227
- const pointsTextInputRef = (0, import_react68.useRef)(null);
10228
- const [foundNode, setFoundNode] = (0, import_react68.useState)();
10229
- (0, import_react68.useEffect)(() => {
10271
+ const pointsTextInputRef = (0, import_react69.useRef)(null);
10272
+ const [foundNode, setFoundNode] = (0, import_react69.useState)();
10273
+ (0, import_react69.useEffect)(() => {
10230
10274
  if (nodeKey) {
10231
10275
  editor.getEditorState().read(() => {
10232
10276
  const matchingQuestionNode = (0, import_lexical63.$getNodeByKey)(nodeKey);
@@ -10239,7 +10283,7 @@ function MatchingQuestionSettings(props) {
10239
10283
  if (!foundNode) {
10240
10284
  return null;
10241
10285
  }
10242
- return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
10286
+ return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
10243
10287
  TextInput,
10244
10288
  {
10245
10289
  ref: pointsTextInputRef,
@@ -10272,8 +10316,8 @@ function MatchingQuestionSettings(props) {
10272
10316
  var import_LexicalComposerContext48 = require("@lexical/react/LexicalComposerContext");
10273
10317
  var import_utils18 = require("@lexical/utils");
10274
10318
  var import_lexical64 = require("lexical");
10275
- var import_react69 = require("react");
10276
- var import_jsx_runtime90 = require("react/jsx-runtime");
10319
+ var import_react70 = require("react");
10320
+ var import_jsx_runtime91 = require("react/jsx-runtime");
10277
10321
  var INSERT_MATCHING_QUESTION_COMMAND = (0, import_lexical64.createCommand)("INSERT_MATCHING_QUESTION_COMMAND");
10278
10322
  function MatchingQuestionPlugin() {
10279
10323
  const {
@@ -10283,8 +10327,8 @@ function MatchingQuestionPlugin() {
10283
10327
  toggleSettingsPanelSwitch
10284
10328
  } = useBlockEditor();
10285
10329
  const [editor] = (0, import_LexicalComposerContext48.useLexicalComposerContext)();
10286
- const settingsPanelStickyRef = (0, import_react69.useRef)(null);
10287
- (0, import_react69.useEffect)(() => {
10330
+ const settingsPanelStickyRef = (0, import_react70.useRef)(null);
10331
+ (0, import_react70.useEffect)(() => {
10288
10332
  return (0, import_utils18.mergeRegister)(
10289
10333
  editor.registerCommand(
10290
10334
  INSERT_MATCHING_QUESTION_COMMAND,
@@ -10343,7 +10387,7 @@ function MatchingQuestionPlugin() {
10343
10387
  )
10344
10388
  );
10345
10389
  }, [editor]);
10346
- (0, import_react69.useEffect)(() => {
10390
+ (0, import_react70.useEffect)(() => {
10347
10391
  if (isBlockEditorReady && settingsPanelStickyRef.current) {
10348
10392
  registerSettingsPanel(
10349
10393
  MatchingQuestionNode.getType(),
@@ -10351,20 +10395,20 @@ function MatchingQuestionPlugin() {
10351
10395
  );
10352
10396
  }
10353
10397
  }, [isBlockEditorReady]);
10354
- return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_jsx_runtime90.Fragment, { children: drawer && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
10398
+ return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_jsx_runtime91.Fragment, { children: drawer && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
10355
10399
  StickyToPosition,
10356
10400
  {
10357
10401
  ref: settingsPanelStickyRef,
10358
10402
  container: drawer,
10359
10403
  children: (data, position, isVisible) => {
10360
- return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { style: { width: position.width }, children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
10404
+ return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { style: { width: position.width }, children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
10361
10405
  SettingsCard,
10362
10406
  {
10363
10407
  isVisible: !!isVisible,
10364
10408
  container: drawer,
10365
10409
  title: "Matching Settings",
10366
10410
  onClose: toggleSettingsPanelSwitch,
10367
- children: isVisible && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
10411
+ children: isVisible && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
10368
10412
  MatchingQuestionSettings,
10369
10413
  {
10370
10414
  nodeKey: data.nodeKey
@@ -10417,12 +10461,12 @@ var import_list4 = require("@lexical/list");
10417
10461
  var import_LexicalComposerContext50 = require("@lexical/react/LexicalComposerContext");
10418
10462
  var import_utils19 = require("@lexical/utils");
10419
10463
  var import_lexical66 = require("lexical");
10420
- var import_react71 = require("react");
10464
+ var import_react72 = require("react");
10421
10465
 
10422
10466
  // src/plugins/MultipleOptionQuestionPlugin/MultipleOptionQuestionSettings.tsx
10423
10467
  var import_LexicalComposerContext49 = require("@lexical/react/LexicalComposerContext");
10424
10468
  var import_lexical65 = require("lexical");
10425
- var import_react70 = require("react");
10469
+ var import_react71 = require("react");
10426
10470
 
10427
10471
  // src/plugins/MultipleOptionQuestionPlugin/validateChoicesInput.ts
10428
10472
  function validateChoicesInput(input, min) {
@@ -10466,19 +10510,19 @@ function validatePointsInput4(input) {
10466
10510
  }
10467
10511
 
10468
10512
  // src/plugins/MultipleOptionQuestionPlugin/MultipleOptionQuestionSettings.tsx
10469
- var import_jsx_runtime91 = require("react/jsx-runtime");
10513
+ var import_jsx_runtime92 = require("react/jsx-runtime");
10470
10514
  function MultipleOptionQuestionSettings(props) {
10471
10515
  const { nodeKey } = props;
10472
10516
  const [editor] = (0, import_LexicalComposerContext49.useLexicalComposerContext)();
10473
- const noneOfTheAboveInputRef = (0, import_react70.useRef)(null);
10474
- const gradingRadioGroupRef = (0, import_react70.useRef)(null);
10475
- const pointsTextInputRef = (0, import_react70.useRef)(null);
10476
- const choicesTextInputRef = (0, import_react70.useRef)(null);
10477
- const correctChoicesTextInputRef = (0, import_react70.useRef)(null);
10478
- const incorrectChoicesTextInputRef = (0, import_react70.useRef)(null);
10479
- const foundNodeRef = (0, import_react70.useRef)();
10480
- const [questionType, setQuestionType] = (0, import_react70.useState)();
10481
- (0, import_react70.useEffect)(() => {
10517
+ const noneOfTheAboveInputRef = (0, import_react71.useRef)(null);
10518
+ const gradingRadioGroupRef = (0, import_react71.useRef)(null);
10519
+ const pointsTextInputRef = (0, import_react71.useRef)(null);
10520
+ const choicesTextInputRef = (0, import_react71.useRef)(null);
10521
+ const correctChoicesTextInputRef = (0, import_react71.useRef)(null);
10522
+ const incorrectChoicesTextInputRef = (0, import_react71.useRef)(null);
10523
+ const foundNodeRef = (0, import_react71.useRef)();
10524
+ const [questionType, setQuestionType] = (0, import_react71.useState)();
10525
+ (0, import_react71.useEffect)(() => {
10482
10526
  if (nodeKey) {
10483
10527
  editor.getEditorState().read(() => {
10484
10528
  const optionsQuestionNode = (0, import_lexical65.$getNodeByKey)(nodeKey);
@@ -10492,8 +10536,8 @@ function MultipleOptionQuestionSettings(props) {
10492
10536
  if (!questionType || !foundNodeRef.current) {
10493
10537
  return null;
10494
10538
  }
10495
- return /* @__PURE__ */ (0, import_jsx_runtime91.jsxs)(import_jsx_runtime91.Fragment, { children: [
10496
- /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
10539
+ return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(import_jsx_runtime92.Fragment, { children: [
10540
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
10497
10541
  TextInput,
10498
10542
  {
10499
10543
  ref: pointsTextInputRef,
@@ -10520,7 +10564,7 @@ function MultipleOptionQuestionSettings(props) {
10520
10564
  }
10521
10565
  }
10522
10566
  ) }),
10523
- questionType === "multiple-answers" && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
10567
+ questionType === "multiple-answers" && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
10524
10568
  RadioGroup,
10525
10569
  {
10526
10570
  ref: gradingRadioGroupRef,
@@ -10547,7 +10591,7 @@ function MultipleOptionQuestionSettings(props) {
10547
10591
  }
10548
10592
  }
10549
10593
  ) }),
10550
- questionType === "multiple-answers" && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
10594
+ questionType === "multiple-answers" && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
10551
10595
  TextInput,
10552
10596
  {
10553
10597
  ref: correctChoicesTextInputRef,
@@ -10580,7 +10624,7 @@ function MultipleOptionQuestionSettings(props) {
10580
10624
  }
10581
10625
  }
10582
10626
  ) }),
10583
- questionType === "multiple-answers" && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
10627
+ questionType === "multiple-answers" && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
10584
10628
  TextInput,
10585
10629
  {
10586
10630
  ref: incorrectChoicesTextInputRef,
@@ -10613,7 +10657,7 @@ function MultipleOptionQuestionSettings(props) {
10613
10657
  }
10614
10658
  }
10615
10659
  ) }),
10616
- questionType === "multiple-choice" && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
10660
+ questionType === "multiple-choice" && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
10617
10661
  TextInput,
10618
10662
  {
10619
10663
  ref: choicesTextInputRef,
@@ -10644,13 +10688,13 @@ function MultipleOptionQuestionSettings(props) {
10644
10688
  }
10645
10689
  }
10646
10690
  ) }),
10647
- /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
10691
+ /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
10648
10692
  "div",
10649
10693
  {
10650
10694
  style: {
10651
10695
  paddingBottom: "var(--sl-spacing-medium)"
10652
10696
  },
10653
- children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
10697
+ children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
10654
10698
  Checkbox,
10655
10699
  {
10656
10700
  ref: noneOfTheAboveInputRef,
@@ -10674,7 +10718,7 @@ function MultipleOptionQuestionSettings(props) {
10674
10718
  }
10675
10719
 
10676
10720
  // src/plugins/MultipleOptionQuestionPlugin/MultipleOptionQuestionPlugin.tsx
10677
- var import_jsx_runtime92 = require("react/jsx-runtime");
10721
+ var import_jsx_runtime93 = require("react/jsx-runtime");
10678
10722
  var INSERT_MULTIPLE_OPTION_QUESTION_COMMAND = (0, import_lexical66.createCommand)("INSERT_MULTIPLE_OPTION_QUESTION_COMMAND");
10679
10723
  var REPLACE_LIST_WITH_MULTIPLE_OPTION_QUESTION_COMMAND = (0, import_lexical66.createCommand)("REPLACE_LIST_WITH_MULTIPLE_OPTION_QUESTION_COMMAND");
10680
10724
  var REPLACE_MULTIPLE_OPTION_QUESTION_COMMAND = (0, import_lexical66.createCommand)("REPLACE_MULTIPLE_OPTION_QUESTION_COMMAND");
@@ -10686,8 +10730,8 @@ function MultipleOptionQuestionPlugin() {
10686
10730
  toggleSettingsPanelSwitch
10687
10731
  } = useBlockEditor();
10688
10732
  const [editor] = (0, import_LexicalComposerContext50.useLexicalComposerContext)();
10689
- const settingsPanelStickyRef = (0, import_react71.useRef)(null);
10690
- (0, import_react71.useEffect)(() => {
10733
+ const settingsPanelStickyRef = (0, import_react72.useRef)(null);
10734
+ (0, import_react72.useEffect)(() => {
10691
10735
  return (0, import_utils19.mergeRegister)(
10692
10736
  editor.registerCommand(
10693
10737
  INSERT_MULTIPLE_OPTION_QUESTION_COMMAND,
@@ -10866,7 +10910,7 @@ function MultipleOptionQuestionPlugin() {
10866
10910
  )
10867
10911
  );
10868
10912
  }, [editor]);
10869
- (0, import_react71.useEffect)(() => {
10913
+ (0, import_react72.useEffect)(() => {
10870
10914
  if (isBlockEditorReady && settingsPanelStickyRef.current) {
10871
10915
  registerSettingsPanel(
10872
10916
  MultipleOptionQuestionNode.getType(),
@@ -10874,7 +10918,7 @@ function MultipleOptionQuestionPlugin() {
10874
10918
  );
10875
10919
  }
10876
10920
  }, [isBlockEditorReady]);
10877
- return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_jsx_runtime92.Fragment, { children: drawer && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
10921
+ return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_jsx_runtime93.Fragment, { children: drawer && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
10878
10922
  StickyToPosition,
10879
10923
  {
10880
10924
  ref: settingsPanelStickyRef,
@@ -10891,14 +10935,14 @@ function MultipleOptionQuestionPlugin() {
10891
10935
  }
10892
10936
  });
10893
10937
  }
10894
- return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("div", { style: { width: position.width }, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
10938
+ return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { style: { width: position.width }, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
10895
10939
  SettingsCard,
10896
10940
  {
10897
10941
  isVisible: !!isVisible,
10898
10942
  container: drawer,
10899
10943
  title: questionType === "multiple-answers" ? "Multiple Answers Settings" : "Multiple Choice Settings",
10900
10944
  onClose: toggleSettingsPanelSwitch,
10901
- children: isVisible && /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
10945
+ children: isVisible && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
10902
10946
  MultipleOptionQuestionSettings,
10903
10947
  {
10904
10948
  nodeKey: data.nodeKey
@@ -10915,12 +10959,12 @@ function MultipleOptionQuestionPlugin() {
10915
10959
  var import_LexicalComposerContext52 = require("@lexical/react/LexicalComposerContext");
10916
10960
  var import_utils20 = require("@lexical/utils");
10917
10961
  var import_lexical68 = require("lexical");
10918
- var import_react73 = require("react");
10962
+ var import_react74 = require("react");
10919
10963
 
10920
10964
  // src/plugins/ShortAnswerQuestionPlugin/ShortAnswerQuestionSettings.tsx
10921
10965
  var import_LexicalComposerContext51 = require("@lexical/react/LexicalComposerContext");
10922
10966
  var import_lexical67 = require("lexical");
10923
- var import_react72 = require("react");
10967
+ var import_react73 = require("react");
10924
10968
 
10925
10969
  // src/plugins/ShortAnswerQuestionPlugin/validateMaxWordsInput.ts
10926
10970
  function validateMaxWordsInput(input, min) {
@@ -10964,14 +11008,14 @@ function validatePointsInput5(input) {
10964
11008
  }
10965
11009
 
10966
11010
  // src/plugins/ShortAnswerQuestionPlugin/ShortAnswerQuestionSettings.tsx
10967
- var import_jsx_runtime93 = require("react/jsx-runtime");
11011
+ var import_jsx_runtime94 = require("react/jsx-runtime");
10968
11012
  function ShortAnswerQuestionSettings(props) {
10969
11013
  const { nodeKey } = props;
10970
11014
  const [editor] = (0, import_LexicalComposerContext51.useLexicalComposerContext)();
10971
- const pointsTextInputRef = (0, import_react72.useRef)(null);
10972
- const maxWordsTextInputRef = (0, import_react72.useRef)(null);
10973
- const [foundNode, setFoundNode] = (0, import_react72.useState)();
10974
- (0, import_react72.useEffect)(() => {
11015
+ const pointsTextInputRef = (0, import_react73.useRef)(null);
11016
+ const maxWordsTextInputRef = (0, import_react73.useRef)(null);
11017
+ const [foundNode, setFoundNode] = (0, import_react73.useState)();
11018
+ (0, import_react73.useEffect)(() => {
10975
11019
  if (nodeKey) {
10976
11020
  editor.getEditorState().read(() => {
10977
11021
  const shortAnswerNode = (0, import_lexical67.$getNodeByKey)(nodeKey);
@@ -10984,8 +11028,8 @@ function ShortAnswerQuestionSettings(props) {
10984
11028
  if (!foundNode) {
10985
11029
  return null;
10986
11030
  }
10987
- return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
10988
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
11031
+ return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(import_jsx_runtime94.Fragment, { children: [
11032
+ /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
10989
11033
  TextInput,
10990
11034
  {
10991
11035
  ref: pointsTextInputRef,
@@ -11012,7 +11056,7 @@ function ShortAnswerQuestionSettings(props) {
11012
11056
  }
11013
11057
  }
11014
11058
  ) }),
11015
- /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
11059
+ /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
11016
11060
  TextInput,
11017
11061
  {
11018
11062
  ref: maxWordsTextInputRef,
@@ -11043,7 +11087,7 @@ function ShortAnswerQuestionSettings(props) {
11043
11087
  }
11044
11088
 
11045
11089
  // src/plugins/ShortAnswerQuestionPlugin/ShortAnswerQuestionPlugin.tsx
11046
- var import_jsx_runtime94 = require("react/jsx-runtime");
11090
+ var import_jsx_runtime95 = require("react/jsx-runtime");
11047
11091
  var INSERT_SHORT_ANSWER_QUESTION_COMMAND = (0, import_lexical68.createCommand)("INSERT_SHORT_ANSWER_QUESTION_COMMAND");
11048
11092
  function ShortAnswerQuestionPlugin() {
11049
11093
  const {
@@ -11053,8 +11097,8 @@ function ShortAnswerQuestionPlugin() {
11053
11097
  toggleSettingsPanelSwitch
11054
11098
  } = useBlockEditor();
11055
11099
  const [editor] = (0, import_LexicalComposerContext52.useLexicalComposerContext)();
11056
- const settingsPanelStickyRef = (0, import_react73.useRef)(null);
11057
- (0, import_react73.useEffect)(() => {
11100
+ const settingsPanelStickyRef = (0, import_react74.useRef)(null);
11101
+ (0, import_react74.useEffect)(() => {
11058
11102
  return (0, import_utils20.mergeRegister)(
11059
11103
  editor.registerCommand(
11060
11104
  INSERT_SHORT_ANSWER_QUESTION_COMMAND,
@@ -11110,7 +11154,7 @@ function ShortAnswerQuestionPlugin() {
11110
11154
  )
11111
11155
  );
11112
11156
  }, [editor]);
11113
- (0, import_react73.useEffect)(() => {
11157
+ (0, import_react74.useEffect)(() => {
11114
11158
  if (isBlockEditorReady && settingsPanelStickyRef.current) {
11115
11159
  registerSettingsPanel(
11116
11160
  ShortAnswerQuestionNode.getType(),
@@ -11118,20 +11162,20 @@ function ShortAnswerQuestionPlugin() {
11118
11162
  );
11119
11163
  }
11120
11164
  }, [isBlockEditorReady]);
11121
- return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_jsx_runtime94.Fragment, { children: drawer && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
11165
+ return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_jsx_runtime95.Fragment, { children: drawer && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
11122
11166
  StickyToPosition,
11123
11167
  {
11124
11168
  ref: settingsPanelStickyRef,
11125
11169
  container: drawer,
11126
11170
  children: (data, position, isVisible) => {
11127
- return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { style: { width: position.width }, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
11171
+ return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { style: { width: position.width }, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
11128
11172
  SettingsCard,
11129
11173
  {
11130
11174
  isVisible: !!isVisible,
11131
11175
  container: drawer,
11132
11176
  title: "Short Answer Settings",
11133
11177
  onClose: toggleSettingsPanelSwitch,
11134
- children: isVisible && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
11178
+ children: isVisible && /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
11135
11179
  ShortAnswerQuestionSettings,
11136
11180
  {
11137
11181
  nodeKey: data.nodeKey
@@ -11148,9 +11192,9 @@ function ShortAnswerQuestionPlugin() {
11148
11192
  var import_list5 = require("@lexical/list");
11149
11193
  var import_rich_text2 = require("@lexical/rich-text");
11150
11194
  var import_lexical69 = require("lexical");
11151
- var import_lucide_react10 = require("lucide-react");
11152
- var import_react74 = require("react");
11153
- var import_jsx_runtime95 = require("react/jsx-runtime");
11195
+ var import_lucide_react11 = require("lucide-react");
11196
+ var import_react75 = require("react");
11197
+ var import_jsx_runtime96 = require("react/jsx-runtime");
11154
11198
  var handlerStyle3 = {
11155
11199
  display: "flex",
11156
11200
  zIndex: 10,
@@ -11164,7 +11208,7 @@ function AddMenuHandle(props) {
11164
11208
  const { hoveredNode } = props;
11165
11209
  const { getRegisteredEditor, addVisiblePopup, removeVisiblePopup } = useNode();
11166
11210
  const handlerKey = "handle_add_menu";
11167
- const menu = (0, import_react74.useMemo)(() => {
11211
+ const menu = (0, import_react75.useMemo)(() => {
11168
11212
  const menu2 = [];
11169
11213
  if (hoveredNode) {
11170
11214
  const currentEditor = getRegisteredEditor(
@@ -11176,7 +11220,7 @@ function AddMenuHandle(props) {
11176
11220
  {
11177
11221
  id: "paragraph",
11178
11222
  label: "Paragraph",
11179
- Icon: import_lucide_react10.Pilcrow,
11223
+ Icon: import_lucide_react11.Pilcrow,
11180
11224
  onClick: () => {
11181
11225
  currentEditor.update(() => {
11182
11226
  if (nodeKey) {
@@ -11198,7 +11242,7 @@ function AddMenuHandle(props) {
11198
11242
  {
11199
11243
  id: "heading-h1",
11200
11244
  label: "Heading 1",
11201
- Icon: import_lucide_react10.Heading1,
11245
+ Icon: import_lucide_react11.Heading1,
11202
11246
  onClick: () => {
11203
11247
  currentEditor.update(() => {
11204
11248
  if (nodeKey) {
@@ -11215,7 +11259,7 @@ function AddMenuHandle(props) {
11215
11259
  {
11216
11260
  id: "heading-h2",
11217
11261
  label: "Heading 2",
11218
- Icon: import_lucide_react10.Heading2,
11262
+ Icon: import_lucide_react11.Heading2,
11219
11263
  onClick: () => {
11220
11264
  currentEditor.update(() => {
11221
11265
  if (nodeKey) {
@@ -11232,7 +11276,7 @@ function AddMenuHandle(props) {
11232
11276
  {
11233
11277
  id: "heading-h3",
11234
11278
  label: "Heading 3",
11235
- Icon: import_lucide_react10.Heading3,
11279
+ Icon: import_lucide_react11.Heading3,
11236
11280
  onClick: () => {
11237
11281
  currentEditor.update(() => {
11238
11282
  if (nodeKey) {
@@ -11254,7 +11298,7 @@ function AddMenuHandle(props) {
11254
11298
  {
11255
11299
  id: "ordered-list",
11256
11300
  label: "Ordered List",
11257
- Icon: import_lucide_react10.ListOrdered,
11301
+ Icon: import_lucide_react11.ListOrdered,
11258
11302
  onClick: () => {
11259
11303
  currentEditor.update(() => {
11260
11304
  if (nodeKey) {
@@ -11275,7 +11319,7 @@ function AddMenuHandle(props) {
11275
11319
  {
11276
11320
  id: "unordered-list",
11277
11321
  label: "Unordered List",
11278
- Icon: import_lucide_react10.List,
11322
+ Icon: import_lucide_react11.List,
11279
11323
  onClick: () => {
11280
11324
  currentEditor.update(() => {
11281
11325
  if (nodeKey) {
@@ -11296,7 +11340,7 @@ function AddMenuHandle(props) {
11296
11340
  {
11297
11341
  id: "horizontal-rule",
11298
11342
  label: "Divider",
11299
- Icon: import_lucide_react10.SquareSplitVertical,
11343
+ Icon: import_lucide_react11.SquareSplitVertical,
11300
11344
  onClick: () => {
11301
11345
  currentEditor.update(() => {
11302
11346
  if (nodeKey) {
@@ -11317,7 +11361,7 @@ function AddMenuHandle(props) {
11317
11361
  menu2.push({
11318
11362
  id: "image",
11319
11363
  label: "Image",
11320
- Icon: import_lucide_react10.ImageIcon,
11364
+ Icon: import_lucide_react11.ImageIcon,
11321
11365
  onClick: () => {
11322
11366
  currentEditor.update(() => {
11323
11367
  if (nodeKey) {
@@ -11342,7 +11386,7 @@ function AddMenuHandle(props) {
11342
11386
  menu2.push({
11343
11387
  id: `callout-box`,
11344
11388
  label: "Callout",
11345
- Icon: import_lucide_react10.MessageSquareQuote,
11389
+ Icon: import_lucide_react11.MessageSquareQuote,
11346
11390
  onClick: () => {
11347
11391
  if (nodeKey) {
11348
11392
  currentEditor.dispatchCommand(
@@ -11366,7 +11410,7 @@ function AddMenuHandle(props) {
11366
11410
  {
11367
11411
  id: "smart-table",
11368
11412
  label: "Table",
11369
- Icon: import_lucide_react10.Table2,
11413
+ Icon: import_lucide_react11.Table2,
11370
11414
  onClick: () => {
11371
11415
  if (nodeKey) {
11372
11416
  currentEditor.dispatchCommand(
@@ -11391,7 +11435,7 @@ function AddMenuHandle(props) {
11391
11435
  {
11392
11436
  id: "multiple-answers",
11393
11437
  label: "Multiple Answers",
11394
- Icon: import_lucide_react10.ListChecks,
11438
+ Icon: import_lucide_react11.ListChecks,
11395
11439
  onClick: () => {
11396
11440
  if (nodeKey) {
11397
11441
  currentEditor.dispatchCommand(
@@ -11408,7 +11452,7 @@ function AddMenuHandle(props) {
11408
11452
  {
11409
11453
  id: "multiple-choice",
11410
11454
  label: "Multiple Choice",
11411
- Icon: import_lucide_react10.LayoutList,
11455
+ Icon: import_lucide_react11.LayoutList,
11412
11456
  onClick: () => {
11413
11457
  if (nodeKey) {
11414
11458
  currentEditor.dispatchCommand(
@@ -11425,7 +11469,7 @@ function AddMenuHandle(props) {
11425
11469
  {
11426
11470
  id: "short-answer-question",
11427
11471
  label: "Short Answer",
11428
- Icon: import_lucide_react10.FileQuestion,
11472
+ Icon: import_lucide_react11.FileQuestion,
11429
11473
  onClick: () => {
11430
11474
  if (nodeKey) {
11431
11475
  currentEditor.dispatchCommand(
@@ -11441,7 +11485,7 @@ function AddMenuHandle(props) {
11441
11485
  {
11442
11486
  id: "matching-question",
11443
11487
  label: "Matching",
11444
- Icon: import_lucide_react10.ArrowRightLeft,
11488
+ Icon: import_lucide_react11.ArrowRightLeft,
11445
11489
  onClick: () => {
11446
11490
  if (nodeKey) {
11447
11491
  currentEditor.dispatchCommand(
@@ -11457,7 +11501,7 @@ function AddMenuHandle(props) {
11457
11501
  {
11458
11502
  id: "fill-in-the-blank-question",
11459
11503
  label: "Fill In The Blank",
11460
- Icon: import_lucide_react10.Space,
11504
+ Icon: import_lucide_react11.Space,
11461
11505
  onClick: () => {
11462
11506
  if (nodeKey) {
11463
11507
  currentEditor.dispatchCommand(
@@ -11473,7 +11517,7 @@ function AddMenuHandle(props) {
11473
11517
  {
11474
11518
  id: "journal-entry-question",
11475
11519
  label: "Journal Entry",
11476
- Icon: import_lucide_react10.Calculator,
11520
+ Icon: import_lucide_react11.Calculator,
11477
11521
  onClick: () => {
11478
11522
  if (nodeKey) {
11479
11523
  currentEditor.dispatchCommand(
@@ -11492,7 +11536,7 @@ function AddMenuHandle(props) {
11492
11536
  }
11493
11537
  return menu2;
11494
11538
  }, [hoveredNode]);
11495
- return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { id: handlerKey, style: handlerStyle3, children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
11539
+ return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { id: handlerKey, style: handlerStyle3, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
11496
11540
  DropdownWrapper,
11497
11541
  {
11498
11542
  placement: "bottom-start",
@@ -11503,20 +11547,20 @@ function AddMenuHandle(props) {
11503
11547
  onHideMenu: () => {
11504
11548
  removeVisiblePopup();
11505
11549
  },
11506
- children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)("div", { slot: "trigger", className: "add-menu-handle", children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(Icon, { icon: import_lucide_react10.Plus }) })
11550
+ children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { slot: "trigger", className: "add-menu-handle", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Icon, { icon: import_lucide_react11.Plus }) })
11507
11551
  }
11508
11552
  ) });
11509
11553
  }
11510
11554
 
11511
11555
  // src/content/node/menus/copyToClipboardMenu.tsx
11512
11556
  var import_lexical70 = require("lexical");
11513
- var import_lucide_react11 = require("lucide-react");
11557
+ var import_lucide_react12 = require("lucide-react");
11514
11558
  function renderCopyToClipboardMenu(nodeKey, editor) {
11515
11559
  return [
11516
11560
  {
11517
11561
  id: "copyToClipboardMenu",
11518
11562
  label: "Copy to Clipboard",
11519
- Icon: import_lucide_react11.ClipboardCopy,
11563
+ Icon: import_lucide_react12.ClipboardCopy,
11520
11564
  onClick: () => {
11521
11565
  editor.update(() => {
11522
11566
  let nodeSerialized = void 0;
@@ -11537,13 +11581,13 @@ function renderCopyToClipboardMenu(nodeKey, editor) {
11537
11581
 
11538
11582
  // src/content/node/menus/deleteMenu.tsx
11539
11583
  var import_lexical71 = require("lexical");
11540
- var import_lucide_react12 = require("lucide-react");
11584
+ var import_lucide_react13 = require("lucide-react");
11541
11585
  function renderDeleteMenu(nodeKey, editor) {
11542
11586
  return [
11543
11587
  {
11544
11588
  id: "deleteMenu",
11545
11589
  label: "Delete",
11546
- Icon: import_lucide_react12.Trash2,
11590
+ Icon: import_lucide_react13.Trash2,
11547
11591
  onClick: () => {
11548
11592
  editor.update(() => {
11549
11593
  const targetNode = (0, import_lexical71.$getNodeByKey)(nodeKey);
@@ -11574,7 +11618,7 @@ function renderDeleteMenu(nodeKey, editor) {
11574
11618
  // src/content/node/menus/listReplaceMenu.tsx
11575
11619
  var import_list6 = require("@lexical/list");
11576
11620
  var import_lexical72 = require("lexical");
11577
- var import_lucide_react13 = require("lucide-react");
11621
+ var import_lucide_react14 = require("lucide-react");
11578
11622
  function renderListReplaceMenu(nodeKey, editor) {
11579
11623
  let listType = void 0;
11580
11624
  editor.getEditorState().read(() => {
@@ -11587,7 +11631,7 @@ function renderListReplaceMenu(nodeKey, editor) {
11587
11631
  {
11588
11632
  id: "replace_with_ordered_list",
11589
11633
  label: "Ordered List",
11590
- Icon: import_lucide_react13.ListOrdered,
11634
+ Icon: import_lucide_react14.ListOrdered,
11591
11635
  selected: listType === "number",
11592
11636
  onClick: () => {
11593
11637
  editor.update(() => {
@@ -11604,7 +11648,7 @@ function renderListReplaceMenu(nodeKey, editor) {
11604
11648
  {
11605
11649
  id: "replace_with_unordered_list",
11606
11650
  label: "Unordered List",
11607
- Icon: import_lucide_react13.List,
11651
+ Icon: import_lucide_react14.List,
11608
11652
  selected: listType === "bullet",
11609
11653
  onClick: () => {
11610
11654
  editor.update(() => {
@@ -11625,7 +11669,7 @@ function renderListReplaceMenu(nodeKey, editor) {
11625
11669
  var import_rich_text3 = require("@lexical/rich-text");
11626
11670
  var import_selection = require("@lexical/selection");
11627
11671
  var import_lexical73 = require("lexical");
11628
- var import_lucide_react14 = require("lucide-react");
11672
+ var import_lucide_react15 = require("lucide-react");
11629
11673
  function renderTypographyReplaceMenu(nodeKey, editor) {
11630
11674
  let nodeType = "";
11631
11675
  let nodeTag = "";
@@ -11642,7 +11686,7 @@ function renderTypographyReplaceMenu(nodeKey, editor) {
11642
11686
  {
11643
11687
  id: "replace_with_heading_1",
11644
11688
  label: "Heading 1",
11645
- Icon: import_lucide_react14.Heading1,
11689
+ Icon: import_lucide_react15.Heading1,
11646
11690
  selected: import_rich_text3.HeadingNode.getType() === nodeType && nodeTag === "h1",
11647
11691
  onClick: () => {
11648
11692
  editor.update(() => {
@@ -11659,7 +11703,7 @@ function renderTypographyReplaceMenu(nodeKey, editor) {
11659
11703
  {
11660
11704
  id: "replace_with_heading_2",
11661
11705
  label: "Heading 2",
11662
- Icon: import_lucide_react14.Heading2,
11706
+ Icon: import_lucide_react15.Heading2,
11663
11707
  selected: import_rich_text3.HeadingNode.getType() === nodeType && nodeTag === "h2",
11664
11708
  onClick: () => {
11665
11709
  editor.update(() => {
@@ -11676,7 +11720,7 @@ function renderTypographyReplaceMenu(nodeKey, editor) {
11676
11720
  {
11677
11721
  id: "replace_with_heading_3",
11678
11722
  label: "Heading 3",
11679
- Icon: import_lucide_react14.Heading3,
11723
+ Icon: import_lucide_react15.Heading3,
11680
11724
  selected: import_rich_text3.HeadingNode.getType() === nodeType && nodeTag === "h3",
11681
11725
  onClick: () => {
11682
11726
  editor.update(() => {
@@ -11693,7 +11737,7 @@ function renderTypographyReplaceMenu(nodeKey, editor) {
11693
11737
  {
11694
11738
  id: "replace_with_paragraph",
11695
11739
  label: "Paragraph",
11696
- Icon: import_lucide_react14.Pilcrow,
11740
+ Icon: import_lucide_react15.Pilcrow,
11697
11741
  selected: import_lexical73.ParagraphNode.getType() === nodeType,
11698
11742
  onClick: () => {
11699
11743
  editor.update(() => {
@@ -11713,13 +11757,13 @@ function renderTypographyReplaceMenu(nodeKey, editor) {
11713
11757
  // src/content/node/menus/listReplaceWithQuestionMenu.tsx
11714
11758
  var import_list7 = require("@lexical/list");
11715
11759
  var import_lexical74 = require("lexical");
11716
- var import_lucide_react15 = require("lucide-react");
11760
+ var import_lucide_react16 = require("lucide-react");
11717
11761
  function renderListReplaceWithQuestionMenu(nodeKey, editor) {
11718
11762
  return [
11719
11763
  {
11720
11764
  id: "replace_with_multiple_answers",
11721
11765
  label: "Multiple Answers",
11722
- Icon: import_lucide_react15.ListChecks,
11766
+ Icon: import_lucide_react16.ListChecks,
11723
11767
  onClick: () => {
11724
11768
  editor.update(() => {
11725
11769
  const targetNode = (0, import_lexical74.$getNodeByKey)(nodeKey);
@@ -11738,7 +11782,7 @@ function renderListReplaceWithQuestionMenu(nodeKey, editor) {
11738
11782
  {
11739
11783
  id: "replace_with_multiple_choice",
11740
11784
  label: "Multiple Choice",
11741
- Icon: import_lucide_react15.LayoutList,
11785
+ Icon: import_lucide_react16.LayoutList,
11742
11786
  onClick: () => {
11743
11787
  editor.update(() => {
11744
11788
  const targetNode = (0, import_lexical74.$getNodeByKey)(nodeKey);
@@ -11759,7 +11803,7 @@ function renderListReplaceWithQuestionMenu(nodeKey, editor) {
11759
11803
 
11760
11804
  // src/content/node/menus/multipleOptionsQuestionReplaceMenu.tsx
11761
11805
  var import_lexical75 = require("lexical");
11762
- var import_lucide_react16 = require("lucide-react");
11806
+ var import_lucide_react17 = require("lucide-react");
11763
11807
  function renderMultipleOptionsQuestionReplaceMenu(nodeKey, editor) {
11764
11808
  let questionType = void 0;
11765
11809
  editor.getEditorState().read(() => {
@@ -11772,7 +11816,7 @@ function renderMultipleOptionsQuestionReplaceMenu(nodeKey, editor) {
11772
11816
  {
11773
11817
  id: "replace_with_multiple_answers",
11774
11818
  label: "Multiple Answers",
11775
- Icon: import_lucide_react16.ListChecks,
11819
+ Icon: import_lucide_react17.ListChecks,
11776
11820
  selected: questionType === "multiple-answers",
11777
11821
  onClick: () => {
11778
11822
  editor.update(() => {
@@ -11792,7 +11836,7 @@ function renderMultipleOptionsQuestionReplaceMenu(nodeKey, editor) {
11792
11836
  {
11793
11837
  id: "replace_with_multiple_choice",
11794
11838
  label: "Multiple Choice",
11795
- Icon: import_lucide_react16.LayoutList,
11839
+ Icon: import_lucide_react17.LayoutList,
11796
11840
  selected: questionType === "multiple-choice",
11797
11841
  onClick: () => {
11798
11842
  editor.update(() => {
@@ -11817,9 +11861,9 @@ var import_core7 = require("@dnd-kit/core");
11817
11861
  var import_list8 = require("@lexical/list");
11818
11862
  var import_rich_text4 = require("@lexical/rich-text");
11819
11863
  var import_lexical76 = require("lexical");
11820
- var import_lucide_react17 = require("lucide-react");
11821
- var import_react75 = require("react");
11822
- var import_jsx_runtime96 = require("react/jsx-runtime");
11864
+ var import_lucide_react18 = require("lucide-react");
11865
+ var import_react76 = require("react");
11866
+ var import_jsx_runtime97 = require("react/jsx-runtime");
11823
11867
  var handlerStyle4 = {
11824
11868
  display: "flex",
11825
11869
  zIndex: 10,
@@ -11842,7 +11886,7 @@ function DragHandle(props) {
11842
11886
  }
11843
11887
  });
11844
11888
  const currentEditor = hoveredNode ? getRegisteredEditor(hoveredNode.editorKey) : void 0;
11845
- const menu = (0, import_react75.useMemo)(() => {
11889
+ const menu = (0, import_react76.useMemo)(() => {
11846
11890
  let menu2 = [];
11847
11891
  if (hoveredNode) {
11848
11892
  const nodeType = hoveredNode.nodeType;
@@ -11906,7 +11950,7 @@ function DragHandle(props) {
11906
11950
  }
11907
11951
  return menu2;
11908
11952
  }, [hoveredNode, currentEditor]);
11909
- return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
11953
+ return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
11910
11954
  "div",
11911
11955
  {
11912
11956
  id: handlerKey,
@@ -11914,7 +11958,7 @@ function DragHandle(props) {
11914
11958
  ...listeners,
11915
11959
  ...attributes,
11916
11960
  style: handlerStyle4,
11917
- children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
11961
+ children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
11918
11962
  DropdownWrapper,
11919
11963
  {
11920
11964
  placement: "bottom-start",
@@ -11925,7 +11969,7 @@ function DragHandle(props) {
11925
11969
  onHideMenu: () => {
11926
11970
  removeVisiblePopup();
11927
11971
  },
11928
- children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("div", { slot: "trigger", className: "draggable-handle", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Icon, { icon: import_lucide_react17.GripVertical }) })
11972
+ children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { slot: "trigger", className: "draggable-handle", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(Icon, { icon: import_lucide_react18.GripVertical }) })
11929
11973
  }
11930
11974
  )
11931
11975
  }
@@ -11959,7 +12003,7 @@ function findNodePosition(rows, point, lastFound) {
11959
12003
  }
11960
12004
 
11961
12005
  // src/content/node/NodeDragOverlay.tsx
11962
- var import_jsx_runtime97 = require("react/jsx-runtime");
12006
+ var import_jsx_runtime98 = require("react/jsx-runtime");
11963
12007
  var overlayStyle2 = {
11964
12008
  display: "flex",
11965
12009
  minWidth: "150px",
@@ -11978,12 +12022,12 @@ var overlayStyle2 = {
11978
12022
  boxShadow: "0 1px 3px rgba(34, 25, 25, 0.4)"
11979
12023
  };
11980
12024
  function NodeDragOverlay(props) {
11981
- return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)("div", { style: overlayStyle2, children: props.children() });
12025
+ return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { style: overlayStyle2, children: props.children() });
11982
12026
  }
11983
12027
 
11984
12028
  // src/content/node/NodeDropMarker.tsx
11985
- var import_react76 = require("react");
11986
- var import_jsx_runtime98 = require("react/jsx-runtime");
12029
+ var import_react77 = require("react");
12030
+ var import_jsx_runtime99 = require("react/jsx-runtime");
11987
12031
  var placeholderStyle3 = {
11988
12032
  position: "absolute",
11989
12033
  top: "calc(-1 * var(--sl-spacing-small) / 2)",
@@ -12001,8 +12045,8 @@ var lineStyle3 = {
12001
12045
  };
12002
12046
  function NodeDropMarker(props) {
12003
12047
  const { visible, top } = props;
12004
- const lineDivRef = (0, import_react76.useRef)(null);
12005
- (0, import_react76.useEffect)(() => {
12048
+ const lineDivRef = (0, import_react77.useRef)(null);
12049
+ (0, import_react77.useEffect)(() => {
12006
12050
  if (visible && lineDivRef.current) {
12007
12051
  lineDivRef.current.style.transition = "none";
12008
12052
  lineDivRef.current.style.width = "0px";
@@ -12014,31 +12058,31 @@ function NodeDropMarker(props) {
12014
12058
  }, 5);
12015
12059
  }
12016
12060
  }, [visible, top]);
12017
- return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { style: { ...placeholderStyle3, width: props.width }, children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)("div", { ref: lineDivRef, style: lineStyle3 }) });
12061
+ return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("div", { style: { ...placeholderStyle3, width: props.width }, children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("div", { ref: lineDivRef, style: lineStyle3 }) });
12018
12062
  }
12019
12063
 
12020
12064
  // src/content/node/NodeDraggableHandleSticky.tsx
12021
12065
  var import_core8 = require("@dnd-kit/core");
12022
12066
  var import_lexical77 = require("lexical");
12023
12067
  var import_throttle3 = __toESM(require("lodash-es/throttle"));
12024
- var import_react77 = require("react");
12025
- var import_jsx_runtime99 = require("react/jsx-runtime");
12026
- var NodeDraggableHandleSticky = (0, import_react77.forwardRef)((props, ref) => {
12068
+ var import_react78 = require("react");
12069
+ var import_jsx_runtime100 = require("react/jsx-runtime");
12070
+ var NodeDraggableHandleSticky = (0, import_react78.forwardRef)((props, ref) => {
12027
12071
  const {
12028
12072
  getRegisteredEditor,
12029
12073
  setHandleDragged,
12030
12074
  unsetHandleDragged
12031
12075
  } = useNode();
12032
- const anchorElementRef = (0, import_react77.useRef)();
12033
- const [isAnchorElementReady, setAnchorElementReady] = (0, import_react77.useState)(false);
12034
- const nodeHandleSticky = (0, import_react77.useRef)(null);
12035
- const dropMarkerSticky = (0, import_react77.useRef)(null);
12036
- const nodePositionsRef = (0, import_react77.useRef)([]);
12037
- const overNodePositionRef = (0, import_react77.useRef)(
12076
+ const anchorElementRef = (0, import_react78.useRef)();
12077
+ const [isAnchorElementReady, setAnchorElementReady] = (0, import_react78.useState)(false);
12078
+ const nodeHandleSticky = (0, import_react78.useRef)(null);
12079
+ const dropMarkerSticky = (0, import_react78.useRef)(null);
12080
+ const nodePositionsRef = (0, import_react78.useRef)([]);
12081
+ const overNodePositionRef = (0, import_react78.useRef)(
12038
12082
  void 0
12039
12083
  );
12040
- const activeNodeOptionsRef = (0, import_react77.useRef)(void 0);
12041
- const windowScrollPositionRef = (0, import_react77.useRef)(0);
12084
+ const activeNodeOptionsRef = (0, import_react78.useRef)(void 0);
12085
+ const windowScrollPositionRef = (0, import_react78.useRef)(0);
12042
12086
  const mouseSensor = (0, import_core8.useSensor)(import_core8.MouseSensor, {
12043
12087
  activationConstraint: {
12044
12088
  distance: 1
@@ -12088,7 +12132,7 @@ var NodeDraggableHandleSticky = (0, import_react77.forwardRef)((props, ref) => {
12088
12132
  const forceHideHandle = () => {
12089
12133
  nodeHandleSticky.current?.hide();
12090
12134
  };
12091
- (0, import_react77.useImperativeHandle)(ref, () => ({
12135
+ (0, import_react78.useImperativeHandle)(ref, () => ({
12092
12136
  setAnchorElement,
12093
12137
  showHandle,
12094
12138
  hideHandle,
@@ -12096,9 +12140,9 @@ var NodeDraggableHandleSticky = (0, import_react77.forwardRef)((props, ref) => {
12096
12140
  isHandleVisible: () => !!nodeHandleSticky.current?.isVisible()
12097
12141
  }));
12098
12142
  if (!isAnchorElementReady || !anchorElementRef.current) {
12099
- return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_jsx_runtime99.Fragment, {});
12143
+ return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_jsx_runtime100.Fragment, {});
12100
12144
  }
12101
- return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(
12145
+ return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
12102
12146
  import_core8.DndContext,
12103
12147
  {
12104
12148
  sensors,
@@ -12319,13 +12363,13 @@ var NodeDraggableHandleSticky = (0, import_react77.forwardRef)((props, ref) => {
12319
12363
  unsetHandleDragged();
12320
12364
  },
12321
12365
  children: [
12322
- /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
12366
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
12323
12367
  StickyToPosition,
12324
12368
  {
12325
12369
  ref: nodeHandleSticky,
12326
12370
  container: anchorElementRef.current,
12327
12371
  children: (data, _position) => {
12328
- return /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)(
12372
+ return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
12329
12373
  "div",
12330
12374
  {
12331
12375
  style: {
@@ -12337,21 +12381,21 @@ var NodeDraggableHandleSticky = (0, import_react77.forwardRef)((props, ref) => {
12337
12381
  gap: "6px"
12338
12382
  },
12339
12383
  children: [
12340
- /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(AddMenuHandle, { hoveredNode: data.hoveredNode }),
12341
- /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(DragHandle, { hoveredNode: data.hoveredNode })
12384
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(AddMenuHandle, { hoveredNode: data.hoveredNode }),
12385
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(DragHandle, { hoveredNode: data.hoveredNode })
12342
12386
  ]
12343
12387
  }
12344
12388
  );
12345
12389
  }
12346
12390
  }
12347
12391
  ),
12348
- /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
12392
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
12349
12393
  StickyToPosition,
12350
12394
  {
12351
12395
  ref: dropMarkerSticky,
12352
12396
  container: anchorElementRef.current,
12353
12397
  children: (_data, position, isVisible) => {
12354
- return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
12398
+ return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
12355
12399
  NodeDropMarker,
12356
12400
  {
12357
12401
  top: `${position.top}px`,
@@ -12362,8 +12406,8 @@ var NodeDraggableHandleSticky = (0, import_react77.forwardRef)((props, ref) => {
12362
12406
  }
12363
12407
  }
12364
12408
  ),
12365
- /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_core8.DragOverlay, { dropAnimation: null, children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(NodeDragOverlay, { children: () => {
12366
- return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)("div", { children: "Move Block" });
12409
+ /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_core8.DragOverlay, { dropAnimation: null, children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(NodeDragOverlay, { children: () => {
12410
+ return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)("div", { children: "Move Block" });
12367
12411
  } }) })
12368
12412
  ]
12369
12413
  }
@@ -12371,19 +12415,19 @@ var NodeDraggableHandleSticky = (0, import_react77.forwardRef)((props, ref) => {
12371
12415
  });
12372
12416
 
12373
12417
  // src/content/node/NodeProvider.tsx
12374
- var import_jsx_runtime100 = require("react/jsx-runtime");
12375
- var NodeProviderContext = import_react78.default.createContext(null);
12418
+ var import_jsx_runtime101 = require("react/jsx-runtime");
12419
+ var NodeProviderContext = import_react79.default.createContext(null);
12376
12420
  function NodeProvider(props) {
12377
12421
  const { children } = props;
12378
- const anchorElementRef = (0, import_react78.useRef)(void 0);
12379
- const nodeDraggableHandleRef = (0, import_react78.useRef)(null);
12380
- const editorsRegisterRef = (0, import_react78.useRef)(
12422
+ const anchorElementRef = (0, import_react79.useRef)(void 0);
12423
+ const nodeDraggableHandleRef = (0, import_react79.useRef)(null);
12424
+ const editorsRegisterRef = (0, import_react79.useRef)(
12381
12425
  {}
12382
12426
  );
12383
- const lastFocusedElementRef = (0, import_react78.useRef)(null);
12384
- const visiblePopupsCountRef = (0, import_react78.useRef)(0);
12385
- const isHandleDraggedRef = (0, import_react78.useRef)(false);
12386
- const handleOverNodeKeyRef = (0, import_react78.useRef)(void 0);
12427
+ const lastFocusedElementRef = (0, import_react79.useRef)(null);
12428
+ const visiblePopupsCountRef = (0, import_react79.useRef)(0);
12429
+ const isHandleDraggedRef = (0, import_react79.useRef)(false);
12430
+ const handleOverNodeKeyRef = (0, import_react79.useRef)(void 0);
12387
12431
  const setAnchorElement = (anchorElement) => {
12388
12432
  anchorElementRef.current = anchorElement;
12389
12433
  nodeDraggableHandleRef.current?.setAnchorElement(anchorElement);
@@ -12442,7 +12486,7 @@ function NodeProvider(props) {
12442
12486
  const getHandleOverNodeKey = () => {
12443
12487
  return handleOverNodeKeyRef.current;
12444
12488
  };
12445
- (0, import_react78.useEffect)(() => {
12489
+ (0, import_react79.useEffect)(() => {
12446
12490
  return () => {
12447
12491
  const editorsKeys = Object.keys(editorsRegisterRef.current);
12448
12492
  for (const editorKey of editorsKeys) {
@@ -12450,7 +12494,7 @@ function NodeProvider(props) {
12450
12494
  }
12451
12495
  };
12452
12496
  }, []);
12453
- return /* @__PURE__ */ (0, import_jsx_runtime100.jsxs)(
12497
+ return /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(
12454
12498
  NodeProviderContext.Provider,
12455
12499
  {
12456
12500
  value: {
@@ -12473,13 +12517,13 @@ function NodeProvider(props) {
12473
12517
  },
12474
12518
  children: [
12475
12519
  children,
12476
- /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(NodeDraggableHandleSticky, { ref: nodeDraggableHandleRef })
12520
+ /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(NodeDraggableHandleSticky, { ref: nodeDraggableHandleRef })
12477
12521
  ]
12478
12522
  }
12479
12523
  );
12480
12524
  }
12481
12525
  var useNode = () => {
12482
- const context = (0, import_react78.useContext)(NodeProviderContext);
12526
+ const context = (0, import_react79.useContext)(NodeProviderContext);
12483
12527
  if (!context) {
12484
12528
  throw new Error("useNode must be used within a NodeProvider");
12485
12529
  }
@@ -12491,8 +12535,8 @@ var import_LexicalComposerContext53 = require("@lexical/react/LexicalComposerCon
12491
12535
  var import_table14 = require("@lexical/table");
12492
12536
  var import_utils21 = require("@lexical/utils");
12493
12537
  var import_lexical78 = require("lexical");
12494
- var import_react79 = require("react");
12495
- var import_jsx_runtime101 = require("react/jsx-runtime");
12538
+ var import_react80 = require("react");
12539
+ var import_jsx_runtime102 = require("react/jsx-runtime");
12496
12540
  function AutoBottomParagraphPlugin() {
12497
12541
  const [editor] = (0, import_LexicalComposerContext53.useLexicalComposerContext)();
12498
12542
  const listener = (nodeMutations) => {
@@ -12511,7 +12555,7 @@ function AutoBottomParagraphPlugin() {
12511
12555
  }
12512
12556
  }
12513
12557
  };
12514
- (0, import_react79.useEffect)(() => {
12558
+ (0, import_react80.useEffect)(() => {
12515
12559
  return (0, import_utils21.mergeRegister)(
12516
12560
  ...[
12517
12561
  ImageNode,
@@ -12534,16 +12578,16 @@ function AutoBottomParagraphPlugin() {
12534
12578
  )
12535
12579
  );
12536
12580
  }, [editor]);
12537
- return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_jsx_runtime101.Fragment, {});
12581
+ return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_jsx_runtime102.Fragment, {});
12538
12582
  }
12539
12583
 
12540
12584
  // src/plugins/AutoFocusPlugin/AutoFocusPlugin.tsx
12541
12585
  var import_LexicalComposerContext54 = require("@lexical/react/LexicalComposerContext");
12542
12586
  var import_lexical79 = require("lexical");
12543
- var import_react80 = require("react");
12587
+ var import_react81 = require("react");
12544
12588
  function AutoFocusPlugin() {
12545
12589
  const [editor] = (0, import_LexicalComposerContext54.useLexicalComposerContext)();
12546
- (0, import_react80.useEffect)(() => {
12590
+ (0, import_react81.useEffect)(() => {
12547
12591
  setTimeout(() => {
12548
12592
  editor.update(() => {
12549
12593
  const rootNode = (0, import_lexical79.$getRoot)();
@@ -12561,18 +12605,18 @@ function AutoFocusPlugin() {
12561
12605
 
12562
12606
  // src/plugins/EditorRefPlugin/EditorRefPlugin.tsx
12563
12607
  var import_LexicalComposerContext55 = require("@lexical/react/LexicalComposerContext");
12564
- var import_react81 = require("react");
12608
+ var import_react82 = require("react");
12565
12609
  function EditorRefPlugin(props) {
12566
12610
  const [editor] = (0, import_LexicalComposerContext55.useLexicalComposerContext)();
12567
12611
  const { onMountRef } = props;
12568
- (0, import_react81.useEffect)(() => {
12612
+ (0, import_react82.useEffect)(() => {
12569
12613
  onMountRef(editor);
12570
12614
  }, [editor]);
12571
12615
  return null;
12572
12616
  }
12573
12617
 
12574
12618
  // src/plugins/MarkdownPlugin/MarkdownPlugin.tsx
12575
- var import_react82 = require("react");
12619
+ var import_react83 = require("react");
12576
12620
  var import_LexicalComposerContext56 = require("@lexical/react/LexicalComposerContext");
12577
12621
 
12578
12622
  // src/plugins/MarkdownPlugin/markdown/MarkdownExport.ts
@@ -13393,7 +13437,7 @@ var TRANSFORMERS = [
13393
13437
  // src/plugins/MarkdownPlugin/MarkdownPlugin.tsx
13394
13438
  function MarkdownPlugin() {
13395
13439
  const [editor] = (0, import_LexicalComposerContext56.useLexicalComposerContext)();
13396
- (0, import_react82.useEffect)(() => {
13440
+ (0, import_react83.useEffect)(() => {
13397
13441
  return registerMarkdownShortcuts(editor, TRANSFORMERS);
13398
13442
  }, [editor]);
13399
13443
  return null;
@@ -13401,12 +13445,12 @@ function MarkdownPlugin() {
13401
13445
 
13402
13446
  // src/plugins/NodeMousePlugin/NodeMouseAnchorPlugin.tsx
13403
13447
  var import_LexicalComposerContext57 = require("@lexical/react/LexicalComposerContext");
13404
- var import_react83 = require("react");
13405
- var import_jsx_runtime102 = require("react/jsx-runtime");
13448
+ var import_react84 = require("react");
13449
+ var import_jsx_runtime103 = require("react/jsx-runtime");
13406
13450
  function NodeMouseAnchorPlugin() {
13407
13451
  const [editor] = (0, import_LexicalComposerContext57.useLexicalComposerContext)();
13408
13452
  const { setAnchorElement, hideHandles } = useNode();
13409
- const parentWeakRef = (0, import_react83.useRef)();
13453
+ const parentWeakRef = (0, import_react84.useRef)();
13410
13454
  const handleMouseLeave = (event) => {
13411
13455
  const target = event.target;
13412
13456
  const allHighlightedNodes = target?.querySelectorAll(
@@ -13419,7 +13463,7 @@ function NodeMouseAnchorPlugin() {
13419
13463
  }
13420
13464
  hideHandles();
13421
13465
  };
13422
- (0, import_react83.useEffect)(() => {
13466
+ (0, import_react84.useEffect)(() => {
13423
13467
  const removeRootListener = editor.registerRootListener(
13424
13468
  (nextRootElem) => {
13425
13469
  if (nextRootElem?.parentElement) {
@@ -13452,7 +13496,7 @@ function NodeMouseAnchorPlugin() {
13452
13496
  removeRootListener();
13453
13497
  };
13454
13498
  }, [editor]);
13455
- return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_jsx_runtime102.Fragment, {});
13499
+ return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_jsx_runtime103.Fragment, {});
13456
13500
  }
13457
13501
 
13458
13502
  // src/plugins/NodeMousePlugin/NodeMousePlugin.tsx
@@ -13465,7 +13509,7 @@ var import_utils26 = require("@lexical/utils");
13465
13509
  var import_lexical85 = require("lexical");
13466
13510
  var import_debounce4 = __toESM(require("lodash-es/debounce"));
13467
13511
  var import_uniqueId2 = __toESM(require("lodash-es/uniqueId"));
13468
- var import_react84 = require("react");
13512
+ var import_react85 = require("react");
13469
13513
 
13470
13514
  // src/plugins/NodeMousePlugin/nodeUtils.ts
13471
13515
  function getNodePosition2(element, parent) {
@@ -13481,14 +13525,14 @@ function getNodePosition2(element, parent) {
13481
13525
  }
13482
13526
 
13483
13527
  // src/plugins/NodeMousePlugin/NodeMousePlugin.tsx
13484
- var import_jsx_runtime103 = require("react/jsx-runtime");
13528
+ var import_jsx_runtime104 = require("react/jsx-runtime");
13485
13529
  function NodeMousePlugin() {
13486
13530
  const [editor] = (0, import_LexicalComposerContext58.useLexicalComposerContext)();
13487
- const editorUniqueIdRef = (0, import_react84.useRef)((0, import_uniqueId2.default)("editor"));
13488
- const elementsMapRef = (0, import_react84.useRef)(
13531
+ const editorUniqueIdRef = (0, import_react85.useRef)((0, import_uniqueId2.default)("editor"));
13532
+ const elementsMapRef = (0, import_react85.useRef)(
13489
13533
  {}
13490
13534
  );
13491
- const helpersMapRef = (0, import_react84.useRef)(
13535
+ const helpersMapRef = (0, import_react85.useRef)(
13492
13536
  {}
13493
13537
  );
13494
13538
  const {
@@ -13775,7 +13819,7 @@ function NodeMousePlugin() {
13775
13819
  }
13776
13820
  refreshHelpersPositions();
13777
13821
  };
13778
- (0, import_react84.useEffect)(() => {
13822
+ (0, import_react85.useEffect)(() => {
13779
13823
  window.addEventListener(
13780
13824
  RESIZE_CONTENT_EVENT,
13781
13825
  refreshHelpersPositions
@@ -13787,7 +13831,7 @@ function NodeMousePlugin() {
13787
13831
  );
13788
13832
  };
13789
13833
  }, []);
13790
- (0, import_react84.useEffect)(() => {
13834
+ (0, import_react85.useEffect)(() => {
13791
13835
  registerEditor(editorUniqueIdRef.current, editor);
13792
13836
  const removeRegistration = (0, import_utils26.mergeRegister)(
13793
13837
  ...[
@@ -13851,7 +13895,7 @@ function NodeMousePlugin() {
13851
13895
  removeRegistration();
13852
13896
  };
13853
13897
  }, [editor]);
13854
- return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_jsx_runtime103.Fragment, {});
13898
+ return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_jsx_runtime104.Fragment, {});
13855
13899
  }
13856
13900
 
13857
13901
  // src/plugins/NodePastePlugin/NodePastePlugin.tsx
@@ -13859,7 +13903,7 @@ var import_LexicalComposerContext59 = require("@lexical/react/LexicalComposerCon
13859
13903
  var import_rich_text9 = require("@lexical/rich-text");
13860
13904
  var import_utils27 = require("@lexical/utils");
13861
13905
  var import_lexical86 = require("lexical");
13862
- var import_react85 = require("react");
13906
+ var import_react86 = require("react");
13863
13907
 
13864
13908
  // src/plugins/NodePastePlugin/regenerateIdsInQuestion.ts
13865
13909
  var import_nanoid10 = require("nanoid");
@@ -13906,10 +13950,10 @@ function regenerateIdsInQuestion(serializedNode) {
13906
13950
  }
13907
13951
 
13908
13952
  // src/plugins/NodePastePlugin/NodePastePlugin.tsx
13909
- var import_jsx_runtime104 = require("react/jsx-runtime");
13953
+ var import_jsx_runtime105 = require("react/jsx-runtime");
13910
13954
  function NodePastePlugin() {
13911
13955
  const [editor] = (0, import_LexicalComposerContext59.useLexicalComposerContext)();
13912
- (0, import_react85.useEffect)(() => {
13956
+ (0, import_react86.useEffect)(() => {
13913
13957
  return (0, import_utils27.mergeRegister)(
13914
13958
  editor.registerCommand(
13915
13959
  import_lexical86.PASTE_COMMAND,
@@ -13988,23 +14032,23 @@ function NodePastePlugin() {
13988
14032
  )
13989
14033
  );
13990
14034
  }, [editor]);
13991
- return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_jsx_runtime104.Fragment, {});
14035
+ return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_jsx_runtime105.Fragment, {});
13992
14036
  }
13993
14037
 
13994
14038
  // src/components/inputs/PopupToolbar.tsx
13995
14039
  var import_clsx5 = __toESM(require("clsx"));
13996
- var import_react86 = require("react");
13997
- var import_jsx_runtime105 = require("react/jsx-runtime");
13998
- var PopupToolbar = (0, import_react86.forwardRef)((props, ref) => {
14040
+ var import_react87 = require("react");
14041
+ var import_jsx_runtime106 = require("react/jsx-runtime");
14042
+ var PopupToolbar = (0, import_react87.forwardRef)((props, ref) => {
13999
14043
  const { onEscape, menu, toolbar } = props;
14000
- const popupRef = (0, import_react86.useRef)(null);
14001
- const toolbarRef = (0, import_react86.useRef)(null);
14044
+ const popupRef = (0, import_react87.useRef)(null);
14045
+ const toolbarRef = (0, import_react87.useRef)(null);
14002
14046
  function hidePopup() {
14003
14047
  if (popupRef.current) {
14004
14048
  popupRef.current.active = false;
14005
14049
  }
14006
14050
  }
14007
- const menuItems = (0, import_react86.useMemo)(() => {
14051
+ const menuItems = (0, import_react87.useMemo)(() => {
14008
14052
  const resultList = [];
14009
14053
  if (menu && menu.length > 0) {
14010
14054
  let tabIndex = 0;
@@ -14027,7 +14071,7 @@ var PopupToolbar = (0, import_react86.forwardRef)((props, ref) => {
14027
14071
  menuItemAttributes.checked = menuItemSelected;
14028
14072
  menuItemAttributes.type = "checkbox";
14029
14073
  }
14030
- let buttonElement = menuItem.subMenu ? /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
14074
+ let buttonElement = menuItem.subMenu ? /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
14031
14075
  DropdownButton,
14032
14076
  {
14033
14077
  size: "medium",
@@ -14037,7 +14081,7 @@ var PopupToolbar = (0, import_react86.forwardRef)((props, ref) => {
14037
14081
  menu: menuItem.subMenu
14038
14082
  },
14039
14083
  `menuItem${menuItemId}`
14040
- ) : /* @__PURE__ */ (0, import_jsx_runtime105.jsxs)(
14084
+ ) : /* @__PURE__ */ (0, import_jsx_runtime106.jsxs)(
14041
14085
  "sl-button",
14042
14086
  {
14043
14087
  size: "medium",
@@ -14052,15 +14096,15 @@ var PopupToolbar = (0, import_react86.forwardRef)((props, ref) => {
14052
14096
  }
14053
14097
  },
14054
14098
  children: [
14055
- MenuItemIcon && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(Icon, { slot: "prefix", icon: MenuItemIcon }),
14099
+ MenuItemIcon && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(Icon, { slot: "prefix", icon: MenuItemIcon }),
14056
14100
  menuItemLabel,
14057
- menuItemIsError && /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(DotBadge, { variant: "danger" })
14101
+ menuItemIsError && /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(DotBadge, { variant: "danger" })
14058
14102
  ]
14059
14103
  },
14060
14104
  `menuItem${menuItemId}`
14061
14105
  );
14062
14106
  if (tooltip && !menuItem.subMenu) {
14063
- buttonElement = /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
14107
+ buttonElement = /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
14064
14108
  "sl-tooltip",
14065
14109
  {
14066
14110
  content: tooltip,
@@ -14076,7 +14120,7 @@ var PopupToolbar = (0, import_react86.forwardRef)((props, ref) => {
14076
14120
  }
14077
14121
  return resultList;
14078
14122
  }, [menu]);
14079
- (0, import_react86.useImperativeHandle)(ref, () => ({
14123
+ (0, import_react87.useImperativeHandle)(ref, () => ({
14080
14124
  isShown: () => !!popupRef.current?.active,
14081
14125
  showToolbar: (anchor, placement, flipBoundary, distance) => {
14082
14126
  if (popupRef.current) {
@@ -14111,7 +14155,7 @@ var PopupToolbar = (0, import_react86.forwardRef)((props, ref) => {
14111
14155
  onEscape();
14112
14156
  }
14113
14157
  }
14114
- (0, import_react86.useEffect)(() => {
14158
+ (0, import_react87.useEffect)(() => {
14115
14159
  if (onEscape) {
14116
14160
  toolbarRef.current?.addEventListener("keydown", handleKeyDown);
14117
14161
  return () => {
@@ -14122,7 +14166,7 @@ var PopupToolbar = (0, import_react86.forwardRef)((props, ref) => {
14122
14166
  };
14123
14167
  }
14124
14168
  }, [onEscape]);
14125
- return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_jsx_runtime105.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
14169
+ return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_jsx_runtime106.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
14126
14170
  "sl-popup",
14127
14171
  {
14128
14172
  ref: popupRef,
@@ -14130,7 +14174,7 @@ var PopupToolbar = (0, import_react86.forwardRef)((props, ref) => {
14130
14174
  shift: true,
14131
14175
  "auto-size": "horizontal",
14132
14176
  strategy: "fixed",
14133
- children: toolbar || /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("sl-button-group", { ref: toolbarRef, children: menuItems })
14177
+ children: toolbar || /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("sl-button-group", { ref: toolbarRef, children: menuItems })
14134
14178
  }
14135
14179
  ) });
14136
14180
  });
@@ -14182,16 +14226,16 @@ var bgColorList = [
14182
14226
  ];
14183
14227
 
14184
14228
  // src/components/feedback/ProgressBar.tsx
14185
- var import_jsx_runtime106 = require("react/jsx-runtime");
14229
+ var import_jsx_runtime107 = require("react/jsx-runtime");
14186
14230
  function ProgressBar() {
14187
- return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)("sl-progress-bar", { indeterminate: "indeterminate" });
14231
+ return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)("sl-progress-bar", { indeterminate: "indeterminate" });
14188
14232
  }
14189
14233
 
14190
14234
  // src/components/layouts/Stack.tsx
14191
- var import_jsx_runtime107 = require("react/jsx-runtime");
14235
+ var import_jsx_runtime108 = require("react/jsx-runtime");
14192
14236
  function Stack(props) {
14193
14237
  const { id, style, className, slot, children } = props;
14194
- return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
14238
+ return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
14195
14239
  "div",
14196
14240
  {
14197
14241
  id,
@@ -14204,9 +14248,9 @@ function Stack(props) {
14204
14248
  }
14205
14249
 
14206
14250
  // src/components/dialogs/FormDialog.tsx
14207
- var import_react87 = require("react");
14208
- var import_jsx_runtime108 = require("react/jsx-runtime");
14209
- var FormDialog = (0, import_react87.forwardRef)((props, ref) => {
14251
+ var import_react88 = require("react");
14252
+ var import_jsx_runtime109 = require("react/jsx-runtime");
14253
+ var FormDialog = (0, import_react88.forwardRef)((props, ref) => {
14210
14254
  const {
14211
14255
  id,
14212
14256
  actionName,
@@ -14226,7 +14270,7 @@ var FormDialog = (0, import_react87.forwardRef)((props, ref) => {
14226
14270
  extraControl,
14227
14271
  className = ""
14228
14272
  } = props;
14229
- const dialogRef = (0, import_react87.useRef)(null);
14273
+ const dialogRef = (0, import_react88.useRef)(null);
14230
14274
  const handleSubmit = (e) => {
14231
14275
  e.stopPropagation();
14232
14276
  e.preventDefault();
@@ -14269,7 +14313,7 @@ var FormDialog = (0, import_react87.forwardRef)((props, ref) => {
14269
14313
  onHide();
14270
14314
  }
14271
14315
  };
14272
- (0, import_react87.useEffect)(() => {
14316
+ (0, import_react88.useEffect)(() => {
14273
14317
  window.customElements.whenDefined("sl-dialog").then(() => {
14274
14318
  if (dialogRef.current) {
14275
14319
  dialogRef.current.addEventListener(
@@ -14303,7 +14347,7 @@ var FormDialog = (0, import_react87.forwardRef)((props, ref) => {
14303
14347
  }
14304
14348
  };
14305
14349
  }, [onCancel]);
14306
- (0, import_react87.useEffect)(() => {
14350
+ (0, import_react88.useEffect)(() => {
14307
14351
  window.addEventListener(
14308
14352
  FORM_DIALOG_OPEN_EVENT,
14309
14353
  handleOpenByEvent
@@ -14323,7 +14367,7 @@ var FormDialog = (0, import_react87.forwardRef)((props, ref) => {
14323
14367
  );
14324
14368
  };
14325
14369
  }, []);
14326
- (0, import_react87.useImperativeHandle)(ref, () => {
14370
+ (0, import_react88.useImperativeHandle)(ref, () => {
14327
14371
  return {
14328
14372
  open: () => {
14329
14373
  dialogRef.current?.show();
@@ -14333,13 +14377,13 @@ var FormDialog = (0, import_react87.forwardRef)((props, ref) => {
14333
14377
  }
14334
14378
  };
14335
14379
  });
14336
- return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("form", { id, method: "POST", onSubmit: handleSubmit, children: /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
14380
+ return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("form", { id, method: "POST", onSubmit: handleSubmit, children: /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
14337
14381
  "sl-dialog",
14338
14382
  {
14339
14383
  class: `dialog_control ${className}`,
14340
14384
  ref: dialogRef,
14341
14385
  children: [
14342
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { slot: "label", children: headerControls && headerControls.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
14386
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { slot: "label", children: headerControls && headerControls.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
14343
14387
  Stack,
14344
14388
  {
14345
14389
  className: "stack__gap-3 stack__row",
@@ -14350,29 +14394,29 @@ var FormDialog = (0, import_react87.forwardRef)((props, ref) => {
14350
14394
  },
14351
14395
  children: [
14352
14396
  headerControls,
14353
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { style: { flexGrow: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "font-medium font-w-semibold", children: title }) })
14397
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { style: { flexGrow: 2 }, children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: "font-medium font-w-semibold", children: title }) })
14354
14398
  ]
14355
14399
  }
14356
- ) : /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("span", { className: "font-medium font-w-semibold", children: title }) }),
14357
- loading && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(ProgressBar, {}),
14358
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("input", { type: "hidden", name: "formDialogId", value: id }),
14359
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("input", { type: "hidden", name: "action", value: actionName }),
14400
+ ) : /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { className: "font-medium font-w-semibold", children: title }) }),
14401
+ loading && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(ProgressBar, {}),
14402
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("input", { type: "hidden", name: "formDialogId", value: id }),
14403
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("input", { type: "hidden", name: "action", value: actionName }),
14360
14404
  children,
14361
- /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
14405
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
14362
14406
  Stack,
14363
14407
  {
14364
14408
  slot: "footer",
14365
14409
  className: "stack__row stack__gap-4",
14366
14410
  style: { width: "100%", flexWrap: "nowrap" },
14367
14411
  children: [
14368
- extraControl && /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { style: { flexGrow: 0 }, children: extraControl }),
14369
- /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)(
14412
+ extraControl && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { style: { flexGrow: 0 }, children: extraControl }),
14413
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(
14370
14414
  Stack,
14371
14415
  {
14372
14416
  className: "stack__row stack__gap-4",
14373
14417
  style: { flexGrow: 1, justifyContent: "end" },
14374
14418
  children: [
14375
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
14419
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
14376
14420
  Button,
14377
14421
  {
14378
14422
  slot: "footer",
@@ -14384,7 +14428,7 @@ var FormDialog = (0, import_react87.forwardRef)((props, ref) => {
14384
14428
  onClick: handleCancel
14385
14429
  }
14386
14430
  ) }),
14387
- /* @__PURE__ */ (0, import_jsx_runtime108.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
14431
+ /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
14388
14432
  Button,
14389
14433
  {
14390
14434
  slot: "footer",
@@ -14415,16 +14459,16 @@ var import_link3 = require("@lexical/link");
14415
14459
  var import_LexicalComposerContext60 = require("@lexical/react/LexicalComposerContext");
14416
14460
  var import_utils28 = require("@lexical/utils");
14417
14461
  var import_lexical87 = require("lexical");
14418
- var import_react88 = require("react");
14419
- var import_jsx_runtime109 = require("react/jsx-runtime");
14462
+ var import_react89 = require("react");
14463
+ var import_jsx_runtime110 = require("react/jsx-runtime");
14420
14464
  var SHOW_LINK_EDITOR_COMMAND = (0, import_lexical87.createCommand)("SHOW_LINK_EDITOR_COMMAND");
14421
14465
  function LinkEditorPlugin() {
14422
14466
  const [editor] = (0, import_LexicalComposerContext60.useLexicalComposerContext)();
14423
- const formDialogRef = (0, import_react88.useRef)(null);
14424
- const linkUrlInputRef = (0, import_react88.useRef)(null);
14425
- const [openInNew, setOpenInNew] = (0, import_react88.useState)(false);
14426
- const activeEditorRef = (0, import_react88.useRef)();
14427
- (0, import_react88.useEffect)(() => {
14467
+ const formDialogRef = (0, import_react89.useRef)(null);
14468
+ const linkUrlInputRef = (0, import_react89.useRef)(null);
14469
+ const [openInNew, setOpenInNew] = (0, import_react89.useState)(false);
14470
+ const activeEditorRef = (0, import_react89.useRef)();
14471
+ (0, import_react89.useEffect)(() => {
14428
14472
  return (0, import_utils28.mergeRegister)(
14429
14473
  editor.registerCommand(
14430
14474
  SHOW_LINK_EDITOR_COMMAND,
@@ -14449,7 +14493,7 @@ function LinkEditorPlugin() {
14449
14493
  )
14450
14494
  );
14451
14495
  }, [editor]);
14452
- return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
14496
+ return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
14453
14497
  FormDialog,
14454
14498
  {
14455
14499
  ref: formDialogRef,
@@ -14486,8 +14530,8 @@ function LinkEditorPlugin() {
14486
14530
  onCancel: () => {
14487
14531
  formDialogRef.current?.close();
14488
14532
  },
14489
- children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { style: { width: "450px" }, children: /* @__PURE__ */ (0, import_jsx_runtime109.jsxs)(Stack, { className: "stack__column stack__gap-4", children: [
14490
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
14533
+ children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { style: { width: "450px" }, children: /* @__PURE__ */ (0, import_jsx_runtime110.jsxs)(Stack, { className: "stack__column stack__gap-4", children: [
14534
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
14491
14535
  TextInput,
14492
14536
  {
14493
14537
  ref: linkUrlInputRef,
@@ -14497,7 +14541,7 @@ function LinkEditorPlugin() {
14497
14541
  defaultValue: ""
14498
14542
  }
14499
14543
  ) }),
14500
- /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
14544
+ /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
14501
14545
  Checkbox,
14502
14546
  {
14503
14547
  size: "small",
@@ -14515,18 +14559,18 @@ function LinkEditorPlugin() {
14515
14559
  }
14516
14560
 
14517
14561
  // src/components/inputs/PopupHighlight.tsx
14518
- var import_react89 = require("react");
14519
- var import_jsx_runtime110 = require("react/jsx-runtime");
14520
- var PopupHighlighter = (0, import_react89.forwardRef)((props, ref) => {
14562
+ var import_react90 = require("react");
14563
+ var import_jsx_runtime111 = require("react/jsx-runtime");
14564
+ var PopupHighlighter = (0, import_react90.forwardRef)((props, ref) => {
14521
14565
  const { highlighterClassName } = props;
14522
- const popupRef = (0, import_react89.useRef)(null);
14523
- const [popupRect, setPopupRect] = (0, import_react89.useState)();
14566
+ const popupRef = (0, import_react90.useRef)(null);
14567
+ const [popupRect, setPopupRect] = (0, import_react90.useState)();
14524
14568
  function hidePopup() {
14525
14569
  if (popupRef.current) {
14526
14570
  popupRef.current.active = false;
14527
14571
  }
14528
14572
  }
14529
- (0, import_react89.useImperativeHandle)(ref, () => ({
14573
+ (0, import_react90.useImperativeHandle)(ref, () => ({
14530
14574
  isShown: () => !!popupRef.current?.active,
14531
14575
  showPopup: (anchor) => {
14532
14576
  if (popupRef.current) {
@@ -14551,7 +14595,7 @@ var PopupHighlighter = (0, import_react89.forwardRef)((props, ref) => {
14551
14595
  }
14552
14596
  }
14553
14597
  }));
14554
- return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("sl-popup", { ref: popupRef, placement: "top-start", strategy: "fixed", children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)("div", { style: { position: "relative" }, children: highlighterClassName ? /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
14598
+ return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("sl-popup", { ref: popupRef, placement: "top-start", strategy: "fixed", children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("div", { style: { position: "relative" }, children: highlighterClassName ? /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
14555
14599
  "div",
14556
14600
  {
14557
14601
  className: highlighterClassName,
@@ -14560,7 +14604,7 @@ var PopupHighlighter = (0, import_react89.forwardRef)((props, ref) => {
14560
14604
  "--variable-placeholder-height": `${popupRect?.height || 0}px`
14561
14605
  }
14562
14606
  }
14563
- ) : /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
14607
+ ) : /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
14564
14608
  "div",
14565
14609
  {
14566
14610
  style: {
@@ -14578,9 +14622,9 @@ var PopupHighlighter = (0, import_react89.forwardRef)((props, ref) => {
14578
14622
  });
14579
14623
 
14580
14624
  // src/components/inputs/PopupMenu.tsx
14581
- var import_react90 = require("react");
14582
- var import_jsx_runtime111 = require("react/jsx-runtime");
14583
- var PopupMenu = (0, import_react90.forwardRef)(
14625
+ var import_react91 = require("react");
14626
+ var import_jsx_runtime112 = require("react/jsx-runtime");
14627
+ var PopupMenu = (0, import_react91.forwardRef)(
14584
14628
  (props, ref) => {
14585
14629
  const {
14586
14630
  onEscape,
@@ -14588,9 +14632,9 @@ var PopupMenu = (0, import_react90.forwardRef)(
14588
14632
  constMenu = [],
14589
14633
  menuItemClassName
14590
14634
  } = props;
14591
- const popupRef = (0, import_react90.useRef)(null);
14592
- const menuRef = (0, import_react90.useRef)(null);
14593
- const [itemsFilter, setItemsFilter] = (0, import_react90.useState)();
14635
+ const popupRef = (0, import_react91.useRef)(null);
14636
+ const menuRef = (0, import_react91.useRef)(null);
14637
+ const [itemsFilter, setItemsFilter] = (0, import_react91.useState)();
14594
14638
  function hidePopup() {
14595
14639
  if (popupRef.current) {
14596
14640
  popupRef.current.active = false;
@@ -14623,7 +14667,7 @@ var PopupMenu = (0, import_react90.forwardRef)(
14623
14667
  }
14624
14668
  }
14625
14669
  };
14626
- const menuItemsIndex = (0, import_react90.useMemo)(() => {
14670
+ const menuItemsIndex = (0, import_react91.useMemo)(() => {
14627
14671
  const combinedMenu = [...menu, ...constMenu];
14628
14672
  const menuItemsIndex2 = combinedMenu.reduce(
14629
14673
  (indexObj, item) => {
@@ -14659,11 +14703,11 @@ var PopupMenu = (0, import_react90.forwardRef)(
14659
14703
  } = menuItem;
14660
14704
  if (menuItemDivider) {
14661
14705
  resultList.push(
14662
- /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("sl-divider", {}, `menuItem${menuItemId}`)
14706
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("sl-divider", {}, `menuItem${menuItemId}`)
14663
14707
  );
14664
14708
  } else if (menuItemIsGroup) {
14665
14709
  resultList.push(
14666
- /* @__PURE__ */ (0, import_jsx_runtime111.jsx)("sl-menu-label", { children: menuItemLabel }, `menuItem${menuItemId}`)
14710
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsx)("sl-menu-label", { children: menuItemLabel }, `menuItem${menuItemId}`)
14667
14711
  );
14668
14712
  } else {
14669
14713
  const menuItemAttributes = {};
@@ -14675,16 +14719,16 @@ var PopupMenu = (0, import_react90.forwardRef)(
14675
14719
  menuItemAttributes.type = "checkbox";
14676
14720
  }
14677
14721
  resultList.push(
14678
- /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(
14722
+ /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)(
14679
14723
  "sl-menu-item",
14680
14724
  {
14681
14725
  value: menuItemId,
14682
14726
  class: menuItemClassName,
14683
14727
  ...menuItemAttributes,
14684
14728
  children: [
14685
- MenuItemIcon && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(Icon, { slot: "prefix", icon: MenuItemIcon }),
14729
+ MenuItemIcon && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(Icon, { slot: "prefix", icon: MenuItemIcon }),
14686
14730
  menuItemLabel,
14687
- menuItemIsError && /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(DotBadge, { variant: "danger" })
14731
+ menuItemIsError && /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(DotBadge, { variant: "danger" })
14688
14732
  ]
14689
14733
  },
14690
14734
  `menuItem${menuItemId}`
@@ -14695,7 +14739,7 @@ var PopupMenu = (0, import_react90.forwardRef)(
14695
14739
  }
14696
14740
  return resultList;
14697
14741
  }
14698
- const menuItems = (0, import_react90.useMemo)(() => {
14742
+ const menuItems = (0, import_react91.useMemo)(() => {
14699
14743
  let resultList = [];
14700
14744
  if (menu && menu.length > 0) {
14701
14745
  const filteredMenu = !itemsFilter ? menu.filter((menuItem) => !!menuItem) : menu.filter((menuItem) => {
@@ -14707,13 +14751,13 @@ var PopupMenu = (0, import_react90.forwardRef)(
14707
14751
  }
14708
14752
  if (constMenu.length > 0) {
14709
14753
  if (resultList.length > 0) {
14710
- resultList.push(/* @__PURE__ */ (0, import_jsx_runtime111.jsx)("sl-divider", {}, "const-menu-divider"));
14754
+ resultList.push(/* @__PURE__ */ (0, import_jsx_runtime112.jsx)("sl-divider", {}, "const-menu-divider"));
14711
14755
  }
14712
14756
  resultList = resultList.concat(createMenuList(constMenu));
14713
14757
  }
14714
14758
  return resultList;
14715
14759
  }, [menu, constMenu, itemsFilter]);
14716
- (0, import_react90.useImperativeHandle)(ref, () => ({
14760
+ (0, import_react91.useImperativeHandle)(ref, () => ({
14717
14761
  isShown: () => !!popupRef.current?.active,
14718
14762
  showMenu: (anchor, placement, flipBoundary) => {
14719
14763
  if (popupRef.current) {
@@ -14798,7 +14842,7 @@ var PopupMenu = (0, import_react90.forwardRef)(
14798
14842
  }
14799
14843
  }
14800
14844
  }));
14801
- (0, import_react90.useLayoutEffect)(() => {
14845
+ (0, import_react91.useLayoutEffect)(() => {
14802
14846
  if (menuRef.current) {
14803
14847
  menuRef.current.addEventListener(
14804
14848
  "sl-select",
@@ -14819,7 +14863,7 @@ var PopupMenu = (0, import_react90.forwardRef)(
14819
14863
  onEscape();
14820
14864
  }
14821
14865
  }
14822
- (0, import_react90.useEffect)(() => {
14866
+ (0, import_react91.useEffect)(() => {
14823
14867
  if (onEscape) {
14824
14868
  popupRef.current?.addEventListener("keydown", handleKeyDown);
14825
14869
  menuRef.current?.addEventListener("keydown", handleKeyDown);
@@ -14835,7 +14879,7 @@ var PopupMenu = (0, import_react90.forwardRef)(
14835
14879
  };
14836
14880
  }
14837
14881
  }, [onEscape]);
14838
- return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_jsx_runtime111.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
14882
+ return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_jsx_runtime112.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
14839
14883
  "sl-popup",
14840
14884
  {
14841
14885
  ref: popupRef,
@@ -14847,7 +14891,7 @@ var PopupMenu = (0, import_react90.forwardRef)(
14847
14891
  strategy: "fixed",
14848
14892
  "auto-size": "vertical",
14849
14893
  "auto-size-padding": "10",
14850
- children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
14894
+ children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
14851
14895
  "sl-menu",
14852
14896
  {
14853
14897
  ref: menuRef,
@@ -14962,13 +15006,13 @@ function renderVariableMenu(list, popupRef, highlighterRef, activeEditorRef, tex
14962
15006
  }
14963
15007
 
14964
15008
  // src/plugins/VariablesPlugin/useTypeaheadTriggerMatch.ts
14965
- var import_react91 = require("react");
15009
+ var import_react92 = require("react");
14966
15010
  var PUNCTUATION = "\\@";
14967
15011
  function useTypeaheadTriggerMatch(trigger, {
14968
15012
  minLength = 1,
14969
15013
  maxLength = 75
14970
15014
  }) {
14971
- return (0, import_react91.useCallback)(
15015
+ return (0, import_react92.useCallback)(
14972
15016
  (text) => {
14973
15017
  const validChars = "[^" + trigger + PUNCTUATION + "]";
14974
15018
  const TypeaheadTriggerRegex = new RegExp(
@@ -15008,13 +15052,13 @@ function visitVariableNodes(rootNode, cb) {
15008
15052
 
15009
15053
  // src/plugins/VariablesPlugin/VariablesContext.tsx
15010
15054
  var import_lexical90 = require("lexical");
15011
- var import_react92 = __toESM(require("react"));
15012
- var import_jsx_runtime112 = require("react/jsx-runtime");
15013
- var VariablesContext = import_react92.default.createContext(null);
15055
+ var import_react93 = __toESM(require("react"));
15056
+ var import_jsx_runtime113 = require("react/jsx-runtime");
15057
+ var VariablesContext = import_react93.default.createContext(null);
15014
15058
  function VariablesProvider(props) {
15015
15059
  const { getEditor, getAllNestedEditors } = useBlockEditor();
15016
15060
  const { children, variablesSettings } = props;
15017
- const [variableList, setVariableList] = (0, import_react92.useState)(
15061
+ const [variableList, setVariableList] = (0, import_react93.useState)(
15018
15062
  variablesSettings.list
15019
15063
  );
15020
15064
  const updateVariablesInEditor = (newName, oldName, editor) => {
@@ -15038,7 +15082,7 @@ function VariablesProvider(props) {
15038
15082
  setVariableSelection(editorRef, newName);
15039
15083
  }
15040
15084
  };
15041
- (0, import_react92.useEffect)(() => {
15085
+ (0, import_react93.useEffect)(() => {
15042
15086
  setVariableList(variablesSettings.list);
15043
15087
  }, [variablesSettings]);
15044
15088
  const handleOnCreated = (name) => {
@@ -15050,7 +15094,7 @@ function VariablesProvider(props) {
15050
15094
  renameVariable(newName, oldName);
15051
15095
  variablesSettings.onUpdated(newName, oldName);
15052
15096
  };
15053
- return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
15097
+ return /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
15054
15098
  VariablesContext.Provider,
15055
15099
  {
15056
15100
  value: {
@@ -15063,7 +15107,7 @@ function VariablesProvider(props) {
15063
15107
  );
15064
15108
  }
15065
15109
  var useVariables = () => {
15066
- const context = (0, import_react92.useContext)(VariablesContext);
15110
+ const context = (0, import_react93.useContext)(VariablesContext);
15067
15111
  if (!context) {
15068
15112
  throw new Error(
15069
15113
  "useVariables must be used within a VariablesProvider"
@@ -15154,8 +15198,8 @@ function removeTextInDomSelection(editor, leadOffset, onUpdate) {
15154
15198
  var import_LexicalComposerContext61 = require("@lexical/react/LexicalComposerContext");
15155
15199
  var import_utils32 = require("@lexical/utils");
15156
15200
  var import_lexical93 = require("lexical");
15157
- var import_react93 = require("react");
15158
- var import_jsx_runtime113 = require("react/jsx-runtime");
15201
+ var import_react94 = require("react");
15202
+ var import_jsx_runtime114 = require("react/jsx-runtime");
15159
15203
  var CREATE_VARIABLE_FROM_SELECTION_COMMAND = (0, import_lexical93.createCommand)("CREATE_VARIABLE_FROM_SELECTION_COMMAND");
15160
15204
  function TypeaheadVariablePlugin() {
15161
15205
  const { variableList, onCreated } = useVariables();
@@ -15163,11 +15207,11 @@ function TypeaheadVariablePlugin() {
15163
15207
  const triggerVariableFn = useTypeaheadTriggerMatch("@", {
15164
15208
  minLength: 0
15165
15209
  });
15166
- const popupRef = (0, import_react93.useRef)(null);
15167
- const highlighterRef = (0, import_react93.useRef)(null);
15168
- const activeEditorRef = (0, import_react93.useRef)();
15169
- const textToReplaceTargetRef = (0, import_react93.useRef)();
15170
- const activeDecoratorRef = (0, import_react93.useRef)(void 0);
15210
+ const popupRef = (0, import_react94.useRef)(null);
15211
+ const highlighterRef = (0, import_react94.useRef)(null);
15212
+ const activeEditorRef = (0, import_react94.useRef)();
15213
+ const textToReplaceTargetRef = (0, import_react94.useRef)();
15214
+ const activeDecoratorRef = (0, import_react94.useRef)(void 0);
15171
15215
  const handleUpdate = () => {
15172
15216
  activeEditorRef.current?.getEditorState().read(() => {
15173
15217
  const selection = (0, import_lexical93.$getSelection)();
@@ -15309,7 +15353,7 @@ function TypeaheadVariablePlugin() {
15309
15353
  }
15310
15354
  return false;
15311
15355
  };
15312
- (0, import_react93.useEffect)(() => {
15356
+ (0, import_react94.useEffect)(() => {
15313
15357
  return (0, import_utils32.mergeRegister)(
15314
15358
  editor.registerCommand(
15315
15359
  TYPEAHEAD_VARIABLE_COMMAND,
@@ -15382,7 +15426,7 @@ function TypeaheadVariablePlugin() {
15382
15426
  )
15383
15427
  );
15384
15428
  }, [editor, variableList]);
15385
- const menu = (0, import_react93.useMemo)(() => {
15429
+ const menu = (0, import_react94.useMemo)(() => {
15386
15430
  return renderVariableMenu(
15387
15431
  variableList || [],
15388
15432
  popupRef,
@@ -15392,8 +15436,8 @@ function TypeaheadVariablePlugin() {
15392
15436
  activeDecoratorRef.current !== JournalEntryQuestionNode
15393
15437
  );
15394
15438
  }, [variableList, activeDecoratorRef.current]);
15395
- return /* @__PURE__ */ (0, import_jsx_runtime113.jsxs)(import_jsx_runtime113.Fragment, { children: [
15396
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
15439
+ return /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)(import_jsx_runtime114.Fragment, { children: [
15440
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
15397
15441
  PopupMenu,
15398
15442
  {
15399
15443
  ref: popupRef,
@@ -15401,7 +15445,7 @@ function TypeaheadVariablePlugin() {
15401
15445
  menu
15402
15446
  }
15403
15447
  ),
15404
- /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(
15448
+ /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
15405
15449
  PopupHighlighter,
15406
15450
  {
15407
15451
  highlighterClassName: "variable-placeholder",
@@ -15412,11 +15456,11 @@ function TypeaheadVariablePlugin() {
15412
15456
  }
15413
15457
 
15414
15458
  // src/utils/blocks.ts
15415
- var import_lucide_react18 = require("lucide-react");
15459
+ var import_lucide_react19 = require("lucide-react");
15416
15460
  var textAlignToIcon = {
15417
- right: import_lucide_react18.AlignRight,
15418
- left: import_lucide_react18.AlignLeft,
15419
- center: import_lucide_react18.AlignCenter
15461
+ right: import_lucide_react19.AlignRight,
15462
+ left: import_lucide_react19.AlignLeft,
15463
+ center: import_lucide_react19.AlignCenter
15420
15464
  };
15421
15465
 
15422
15466
  // src/utils/getDOMRangeRect.ts
@@ -15506,16 +15550,16 @@ var import_table16 = require("@lexical/table");
15506
15550
  var import_utils33 = require("@lexical/utils");
15507
15551
  var import_lexical94 = require("lexical");
15508
15552
  var import_debounce5 = __toESM(require("lodash-es/debounce"));
15509
- var import_lucide_react19 = require("lucide-react");
15510
- var import_react94 = require("react");
15511
- var import_jsx_runtime114 = require("react/jsx-runtime");
15553
+ var import_lucide_react20 = require("lucide-react");
15554
+ var import_react95 = require("react");
15555
+ var import_jsx_runtime115 = require("react/jsx-runtime");
15512
15556
  function TextToolbarPlugin() {
15513
15557
  const { hasModule } = useBlockEditor();
15514
15558
  const [editor] = (0, import_LexicalComposerContext62.useLexicalComposerContext)();
15515
- const popupToolbarRef = (0, import_react94.useRef)(null);
15516
- const activeEditorRef = (0, import_react94.useRef)(void 0);
15517
- const activeDecoratorRef = (0, import_react94.useRef)(void 0);
15518
- const [toolbarState, setToolbarState] = (0, import_react94.useState)({
15559
+ const popupToolbarRef = (0, import_react95.useRef)(null);
15560
+ const activeEditorRef = (0, import_react95.useRef)(void 0);
15561
+ const activeDecoratorRef = (0, import_react95.useRef)(void 0);
15562
+ const [toolbarState, setToolbarState] = (0, import_react95.useState)({
15519
15563
  isBold: false,
15520
15564
  isItalic: false,
15521
15565
  isUnderline: false,
@@ -15529,8 +15573,8 @@ function TextToolbarPlugin() {
15529
15573
  bgColor: "",
15530
15574
  textAlign: "left"
15531
15575
  });
15532
- const selectedNodeRef = (0, import_react94.useRef)(null);
15533
- const [selectionType, setSelectionType] = (0, import_react94.useState)("paragraph");
15576
+ const selectedNodeRef = (0, import_react95.useRef)(null);
15577
+ const [selectionType, setSelectionType] = (0, import_react95.useState)("paragraph");
15534
15578
  const formatText = (format) => {
15535
15579
  activeEditorRef.current?.update(() => {
15536
15580
  const selection = (0, import_lexical94.$getSelection)();
@@ -15778,7 +15822,7 @@ function TextToolbarPlugin() {
15778
15822
  }
15779
15823
  }
15780
15824
  };
15781
- (0, import_react94.useEffect)(() => {
15825
+ (0, import_react95.useEffect)(() => {
15782
15826
  return (0, import_utils33.mergeRegister)(
15783
15827
  editor.registerCommand(
15784
15828
  TEXT_TOOLBAR_SELECTION_CHANGE_COMMAND,
@@ -15910,7 +15954,7 @@ function TextToolbarPlugin() {
15910
15954
  )
15911
15955
  );
15912
15956
  }, [editor]);
15913
- const repositionPopupToolbar = (0, import_react94.useCallback)(
15957
+ const repositionPopupToolbar = (0, import_react95.useCallback)(
15914
15958
  (0, import_debounce5.default)(() => {
15915
15959
  if (activeEditorRef.current && popupToolbarRef.current && popupToolbarRef.current.isShown()) {
15916
15960
  const nativeSelection = window.getSelection();
@@ -15928,7 +15972,7 @@ function TextToolbarPlugin() {
15928
15972
  popupToolbarRef.current.hideToolbar();
15929
15973
  }
15930
15974
  }
15931
- (0, import_react94.useEffect)(() => {
15975
+ (0, import_react95.useEffect)(() => {
15932
15976
  window.addEventListener("scroll", repositionPopupToolbar);
15933
15977
  window.addEventListener("resize", repositionPopupToolbar);
15934
15978
  document.addEventListener("selectstart", handleSelectionStart);
@@ -15941,7 +15985,7 @@ function TextToolbarPlugin() {
15941
15985
  window.removeEventListener("scroll", repositionPopupToolbar);
15942
15986
  };
15943
15987
  }, []);
15944
- const menuItems = (0, import_react94.useMemo)(() => {
15988
+ const menuItems = (0, import_react95.useMemo)(() => {
15945
15989
  const resultList = [];
15946
15990
  const plt = getOperatingSystem();
15947
15991
  if (selectionType === "paragraph" || selectionType === "list") {
@@ -15950,7 +15994,7 @@ function TextToolbarPlugin() {
15950
15994
  id: "bold",
15951
15995
  label: "",
15952
15996
  selected: toolbarState.isBold,
15953
- Icon: import_lucide_react19.Bold,
15997
+ Icon: import_lucide_react20.Bold,
15954
15998
  tooltip: `Bold ${plt === "macOS" /* macOS */ ? "(\u2318B)" : "(Ctrl+B)"}`,
15955
15999
  onClick: () => {
15956
16000
  formatText("bold");
@@ -15960,7 +16004,7 @@ function TextToolbarPlugin() {
15960
16004
  id: "italic",
15961
16005
  label: "",
15962
16006
  selected: toolbarState.isItalic,
15963
- Icon: import_lucide_react19.Italic,
16007
+ Icon: import_lucide_react20.Italic,
15964
16008
  tooltip: `Italic ${plt === "macOS" /* macOS */ ? "(\u2318I)" : "(Ctrl+I)"}`,
15965
16009
  onClick: () => {
15966
16010
  formatText("italic");
@@ -15970,7 +16014,7 @@ function TextToolbarPlugin() {
15970
16014
  id: "underline",
15971
16015
  label: "",
15972
16016
  selected: toolbarState.isUnderline,
15973
- Icon: import_lucide_react19.Underline,
16017
+ Icon: import_lucide_react20.Underline,
15974
16018
  tooltip: `Underline ${plt === "macOS" /* macOS */ ? "(\u2318U)" : "(Ctrl+U)"}`,
15975
16019
  onClick: () => {
15976
16020
  formatText("underline");
@@ -15980,7 +16024,7 @@ function TextToolbarPlugin() {
15980
16024
  id: "strikethrough",
15981
16025
  label: "",
15982
16026
  selected: toolbarState.isStrikethrough,
15983
- Icon: import_lucide_react19.Strikethrough,
16027
+ Icon: import_lucide_react20.Strikethrough,
15984
16028
  tooltip: `Strikethrough ${plt === "macOS" /* macOS */ ? "(\u2318\u21E7X)" : "(Ctrl+Alt+X)"}`,
15985
16029
  onClick: () => {
15986
16030
  formatText("strikethrough");
@@ -15993,7 +16037,7 @@ function TextToolbarPlugin() {
15993
16037
  id: "subscript",
15994
16038
  label: "",
15995
16039
  selected: toolbarState.isSubscript,
15996
- Icon: import_lucide_react19.Subscript,
16040
+ Icon: import_lucide_react20.Subscript,
15997
16041
  tooltip: `Subscript ${plt === "macOS" /* macOS */ ? "(\u2318\u21E7-)" : "(Ctrl+Shift+`-`)"}`,
15998
16042
  onClick: () => {
15999
16043
  formatText("subscript");
@@ -16003,7 +16047,7 @@ function TextToolbarPlugin() {
16003
16047
  id: "superscript",
16004
16048
  label: "",
16005
16049
  selected: toolbarState.isSuperscript,
16006
- Icon: import_lucide_react19.Superscript,
16050
+ Icon: import_lucide_react20.Superscript,
16007
16051
  tooltip: `Superscript ${plt === "macOS" /* macOS */ ? "(\u2318\u21E7=)" : "(Ctrl+Shift+`=`)"}`,
16008
16052
  onClick: () => {
16009
16053
  formatText("superscript");
@@ -16014,7 +16058,7 @@ function TextToolbarPlugin() {
16014
16058
  resultList.push({
16015
16059
  id: "link",
16016
16060
  label: "",
16017
- Icon: import_lucide_react19.Link2,
16061
+ Icon: import_lucide_react20.Link2,
16018
16062
  tooltip: `Link ${plt === "macOS" /* macOS */ ? "(\u2318K)" : "(Ctrl+K)"}`,
16019
16063
  onClick: () => {
16020
16064
  createLink();
@@ -16024,18 +16068,18 @@ function TextToolbarPlugin() {
16024
16068
  resultList.push({
16025
16069
  id: "styling",
16026
16070
  label: "",
16027
- Icon: import_lucide_react19.Brush,
16071
+ Icon: import_lucide_react20.Brush,
16028
16072
  tooltip: "Color",
16029
16073
  subMenu: [
16030
16074
  {
16031
16075
  id: "color",
16032
16076
  label: "Text Color",
16033
- Icon: import_lucide_react19.TypeIcon,
16077
+ Icon: import_lucide_react20.TypeIcon,
16034
16078
  subMenu: [
16035
16079
  {
16036
16080
  id: "color-default",
16037
16081
  label: "Default",
16038
- Icon: import_lucide_react19.Circle,
16082
+ Icon: import_lucide_react20.Circle,
16039
16083
  onClick: () => {
16040
16084
  formatColor("default");
16041
16085
  }
@@ -16044,7 +16088,7 @@ function TextToolbarPlugin() {
16044
16088
  return {
16045
16089
  id: `color-${simpleColor.label}`,
16046
16090
  label: simpleColor.label,
16047
- Icon: import_lucide_react19.Circle,
16091
+ Icon: import_lucide_react20.Circle,
16048
16092
  color: simpleColor.color,
16049
16093
  onClick: () => {
16050
16094
  formatColor(simpleColor.color);
@@ -16056,12 +16100,12 @@ function TextToolbarPlugin() {
16056
16100
  {
16057
16101
  id: "bg-color",
16058
16102
  label: "Background Color",
16059
- Icon: import_lucide_react19.Highlighter,
16103
+ Icon: import_lucide_react20.Highlighter,
16060
16104
  subMenu: [
16061
16105
  {
16062
16106
  id: "bg-color-default",
16063
16107
  label: "Default",
16064
- Icon: import_lucide_react19.Circle,
16108
+ Icon: import_lucide_react20.Circle,
16065
16109
  onClick: () => {
16066
16110
  formatBackgroundColor("default", "default");
16067
16111
  }
@@ -16070,7 +16114,7 @@ function TextToolbarPlugin() {
16070
16114
  return {
16071
16115
  id: `bg-color-${simpleColor.label}`,
16072
16116
  label: simpleColor.label,
16073
- Icon: import_lucide_react19.Circle,
16117
+ Icon: import_lucide_react20.Circle,
16074
16118
  color: bgColorList[index].color,
16075
16119
  bgColor: simpleColor.color,
16076
16120
  onClick: () => {
@@ -16091,7 +16135,7 @@ function TextToolbarPlugin() {
16091
16135
  resultList.push({
16092
16136
  id: "clear-styling",
16093
16137
  label: "",
16094
- Icon: import_lucide_react19.RemoveFormatting,
16138
+ Icon: import_lucide_react20.RemoveFormatting,
16095
16139
  tooltip: `Clear Format ${plt === "macOS" /* macOS */ ? "(\u2318\\)" : "(Ctrl+\\)"}`,
16096
16140
  onClick: clearFormatting
16097
16141
  });
@@ -16101,7 +16145,7 @@ function TextToolbarPlugin() {
16101
16145
  resultList.push({
16102
16146
  id: "create-variable",
16103
16147
  label: "",
16104
- Icon: import_lucide_react19.Webhook,
16148
+ Icon: import_lucide_react20.Webhook,
16105
16149
  tooltip: `Insert Variable ${plt === "macOS" /* macOS */ ? "(\u2318\u21E7C)" : "(Ctrl+Shift+C)"}`,
16106
16150
  onClick: () => {
16107
16151
  clearFormatting();
@@ -16117,12 +16161,12 @@ function TextToolbarPlugin() {
16117
16161
  resultList.push({
16118
16162
  id: "text-align",
16119
16163
  label: "",
16120
- Icon: textAlignToIcon[toolbarState.textAlign] || import_lucide_react19.AlignLeft,
16164
+ Icon: textAlignToIcon[toolbarState.textAlign] || import_lucide_react20.AlignLeft,
16121
16165
  tooltip: "Align Text",
16122
16166
  subMenu: [
16123
16167
  {
16124
16168
  id: "text-left",
16125
- Icon: import_lucide_react19.AlignLeft,
16169
+ Icon: import_lucide_react20.AlignLeft,
16126
16170
  label: `Align Left ${plt === "macOS" /* macOS */ ? "(\u2318\u21E7L)" : "(Ctrl+Alt+L)"}`,
16127
16171
  selected: toolbarState.textAlign === "left",
16128
16172
  onClick: () => {
@@ -16132,7 +16176,7 @@ function TextToolbarPlugin() {
16132
16176
  },
16133
16177
  {
16134
16178
  id: "text-center",
16135
- Icon: import_lucide_react19.AlignCenter,
16179
+ Icon: import_lucide_react20.AlignCenter,
16136
16180
  label: `Align Center ${plt === "macOS" /* macOS */ ? "(\u2318\u21E7E)" : "(Ctrl+Alt+E)"}`,
16137
16181
  selected: toolbarState.textAlign === "center",
16138
16182
  onClick: () => {
@@ -16142,7 +16186,7 @@ function TextToolbarPlugin() {
16142
16186
  },
16143
16187
  {
16144
16188
  id: "text-right",
16145
- Icon: import_lucide_react19.AlignRight,
16189
+ Icon: import_lucide_react20.AlignRight,
16146
16190
  label: `Align Right ${plt === "macOS" /* macOS */ ? "(\u2318\u21E7R)" : "(Ctrl+Alt+R)"}`,
16147
16191
  selected: toolbarState.textAlign === "right",
16148
16192
  onClick: () => {
@@ -16156,7 +16200,7 @@ function TextToolbarPlugin() {
16156
16200
  resultList.push({
16157
16201
  id: "create-variable",
16158
16202
  label: "",
16159
- Icon: import_lucide_react19.Webhook,
16203
+ Icon: import_lucide_react20.Webhook,
16160
16204
  tooltip: `Insert Variable ${plt === "macOS" /* macOS */ ? "(\u2318\u21E7C)" : "(Ctrl+Shift+C)"}`,
16161
16205
  onClick: () => {
16162
16206
  clearFormatting();
@@ -16172,7 +16216,7 @@ function TextToolbarPlugin() {
16172
16216
  resultList.push({
16173
16217
  id: "create-space",
16174
16218
  label: "",
16175
- Icon: import_lucide_react19.RectangleHorizontal,
16219
+ Icon: import_lucide_react20.RectangleHorizontal,
16176
16220
  tooltip: `Insert Blank Space ${plt === "macOS" /* macOS */ ? "(\u2318\u21E7B)" : "(Ctrl+Shift+B)"}`,
16177
16221
  onClick: () => {
16178
16222
  clearFormatting();
@@ -16186,7 +16230,7 @@ function TextToolbarPlugin() {
16186
16230
  resultList.push({
16187
16231
  id: "create-space",
16188
16232
  label: "",
16189
- Icon: import_lucide_react19.RectangleHorizontal,
16233
+ Icon: import_lucide_react20.RectangleHorizontal,
16190
16234
  tooltip: `Insert Blank Space ${plt === "macOS" /* macOS */ ? "(\u2318\u21E7B)" : "(Ctrl+Shift+B)"}`,
16191
16235
  onClick: () => {
16192
16236
  clearFormatting();
@@ -16226,7 +16270,7 @@ function TextToolbarPlugin() {
16226
16270
  resultList.push(
16227
16271
  {
16228
16272
  id: "text-left",
16229
- Icon: import_lucide_react19.AlignLeft,
16273
+ Icon: import_lucide_react20.AlignLeft,
16230
16274
  label: "",
16231
16275
  tooltip: `Align Left ${plt === "macOS" /* macOS */ ? "(\u2318\u21E7L)" : "(Ctrl+Alt+L)"}`,
16232
16276
  selected: toolbarState.textAlign === "left",
@@ -16237,7 +16281,7 @@ function TextToolbarPlugin() {
16237
16281
  },
16238
16282
  {
16239
16283
  id: "text-center",
16240
- Icon: import_lucide_react19.AlignCenter,
16284
+ Icon: import_lucide_react20.AlignCenter,
16241
16285
  label: "",
16242
16286
  tooltip: `Align Center ${plt === "macOS" /* macOS */ ? "(\u2318\u21E7E)" : "(Ctrl+Alt+E)"}`,
16243
16287
  selected: toolbarState.textAlign === "center",
@@ -16248,7 +16292,7 @@ function TextToolbarPlugin() {
16248
16292
  },
16249
16293
  {
16250
16294
  id: "text-right",
16251
- Icon: import_lucide_react19.AlignRight,
16295
+ Icon: import_lucide_react20.AlignRight,
16252
16296
  label: "",
16253
16297
  tooltip: `Align Right ${plt === "macOS" /* macOS */ ? "(\u2318\u21E7R)" : "(Ctrl+Alt+R)"}`,
16254
16298
  selected: toolbarState.textAlign === "right",
@@ -16261,11 +16305,11 @@ function TextToolbarPlugin() {
16261
16305
  }
16262
16306
  return resultList;
16263
16307
  }, [toolbarState, selectionType, activeEditorRef.current]);
16264
- return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(PopupToolbar, { ref: popupToolbarRef, menu: menuItems });
16308
+ return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(PopupToolbar, { ref: popupToolbarRef, menu: menuItems });
16265
16309
  }
16266
16310
 
16267
16311
  // src/plugins/TypeaheadMenuPlugin/renderCalloutModuleMenu.tsx
16268
- var import_lucide_react20 = require("lucide-react");
16312
+ var import_lucide_react21 = require("lucide-react");
16269
16313
  function renderCalloutModuleMenu(popupRef, targetNodeKeyRef, activeEditorRef) {
16270
16314
  return [
16271
16315
  {
@@ -16284,7 +16328,7 @@ function renderCalloutModuleMenu(popupRef, targetNodeKeyRef, activeEditorRef) {
16284
16328
  "tooltip",
16285
16329
  "note"
16286
16330
  ],
16287
- Icon: import_lucide_react20.MessageSquareQuote,
16331
+ Icon: import_lucide_react21.MessageSquareQuote,
16288
16332
  onClick: () => {
16289
16333
  if (targetNodeKeyRef.current) {
16290
16334
  activeEditorRef.current?.dispatchCommand(
@@ -16305,7 +16349,7 @@ function renderCalloutModuleMenu(popupRef, targetNodeKeyRef, activeEditorRef) {
16305
16349
  var import_list14 = require("@lexical/list");
16306
16350
  var import_rich_text11 = require("@lexical/rich-text");
16307
16351
  var import_lexical95 = require("lexical");
16308
- var import_lucide_react21 = require("lucide-react");
16352
+ var import_lucide_react22 = require("lucide-react");
16309
16353
  function renderDefaultComponentsMenu(popupRef, targetNodeKeyRef, activeEditorRef) {
16310
16354
  return [
16311
16355
  {
@@ -16317,7 +16361,7 @@ function renderDefaultComponentsMenu(popupRef, targetNodeKeyRef, activeEditorRef
16317
16361
  id: "heading-h1",
16318
16362
  label: "Heading 1",
16319
16363
  keywords: ["heading", "h1", "title"],
16320
- Icon: import_lucide_react21.Heading1,
16364
+ Icon: import_lucide_react22.Heading1,
16321
16365
  onClick: () => {
16322
16366
  activeEditorRef.current?.update(() => {
16323
16367
  if (targetNodeKeyRef.current) {
@@ -16338,7 +16382,7 @@ function renderDefaultComponentsMenu(popupRef, targetNodeKeyRef, activeEditorRef
16338
16382
  id: "heading-h2",
16339
16383
  label: "Heading 2",
16340
16384
  keywords: ["heading", "h2", "title"],
16341
- Icon: import_lucide_react21.Heading2,
16385
+ Icon: import_lucide_react22.Heading2,
16342
16386
  onClick: () => {
16343
16387
  activeEditorRef.current?.update(() => {
16344
16388
  if (targetNodeKeyRef.current) {
@@ -16359,7 +16403,7 @@ function renderDefaultComponentsMenu(popupRef, targetNodeKeyRef, activeEditorRef
16359
16403
  id: "heading-h3",
16360
16404
  label: "Heading 3",
16361
16405
  keywords: ["heading", "h3", "title"],
16362
- Icon: import_lucide_react21.Heading3,
16406
+ Icon: import_lucide_react22.Heading3,
16363
16407
  onClick: () => {
16364
16408
  activeEditorRef.current?.update(() => {
16365
16409
  if (targetNodeKeyRef.current) {
@@ -16391,7 +16435,7 @@ function renderDefaultComponentsMenu(popupRef, targetNodeKeyRef, activeEditorRef
16391
16435
  "numbers",
16392
16436
  "sequence"
16393
16437
  ],
16394
- Icon: import_lucide_react21.ListOrdered,
16438
+ Icon: import_lucide_react22.ListOrdered,
16395
16439
  onClick: () => {
16396
16440
  activeEditorRef.current?.update(() => {
16397
16441
  if (targetNodeKeyRef.current) {
@@ -16422,7 +16466,7 @@ function renderDefaultComponentsMenu(popupRef, targetNodeKeyRef, activeEditorRef
16422
16466
  "bullets",
16423
16467
  "points"
16424
16468
  ],
16425
- Icon: import_lucide_react21.List,
16469
+ Icon: import_lucide_react22.List,
16426
16470
  onClick: () => {
16427
16471
  activeEditorRef.current?.update(() => {
16428
16472
  if (targetNodeKeyRef.current) {
@@ -16453,7 +16497,7 @@ function renderDefaultComponentsMenu(popupRef, targetNodeKeyRef, activeEditorRef
16453
16497
  "hr",
16454
16498
  "line"
16455
16499
  ],
16456
- Icon: import_lucide_react21.SquareSplitVertical,
16500
+ Icon: import_lucide_react22.SquareSplitVertical,
16457
16501
  onClick: () => {
16458
16502
  activeEditorRef.current?.update(() => {
16459
16503
  if (targetNodeKeyRef.current) {
@@ -16476,14 +16520,14 @@ function renderDefaultComponentsMenu(popupRef, targetNodeKeyRef, activeEditorRef
16476
16520
  }
16477
16521
 
16478
16522
  // src/plugins/TypeaheadMenuPlugin/renderImageModuleMenu.tsx
16479
- var import_lucide_react22 = require("lucide-react");
16523
+ var import_lucide_react23 = require("lucide-react");
16480
16524
  function renderImageModuleMenu(popupRef, targetNodeKeyRef, activeEditorRef) {
16481
16525
  return [
16482
16526
  {
16483
16527
  id: "image",
16484
16528
  label: "Image",
16485
16529
  keywords: ["image", "picture", "photo", "upload"],
16486
- Icon: import_lucide_react22.ImageIcon,
16530
+ Icon: import_lucide_react23.ImageIcon,
16487
16531
  onClick: () => {
16488
16532
  if (targetNodeKeyRef.current) {
16489
16533
  activeEditorRef.current?.dispatchCommand(
@@ -16500,7 +16544,7 @@ function renderImageModuleMenu(popupRef, targetNodeKeyRef, activeEditorRef) {
16500
16544
  }
16501
16545
 
16502
16546
  // src/plugins/TypeaheadMenuPlugin/renderQuestionsModuleMenu.tsx
16503
- var import_lucide_react23 = require("lucide-react");
16547
+ var import_lucide_react24 = require("lucide-react");
16504
16548
  function renderQuestionsModuleMenu(popupRef, targetNodeKeyRef, activeEditorRef) {
16505
16549
  return [
16506
16550
  {
@@ -16518,7 +16562,7 @@ function renderQuestionsModuleMenu(popupRef, targetNodeKeyRef, activeEditorRef)
16518
16562
  "multiple response",
16519
16563
  "question"
16520
16564
  ],
16521
- Icon: import_lucide_react23.ListChecks,
16565
+ Icon: import_lucide_react24.ListChecks,
16522
16566
  onClick: () => {
16523
16567
  if (targetNodeKeyRef.current) {
16524
16568
  activeEditorRef.current?.dispatchCommand(
@@ -16537,7 +16581,7 @@ function renderQuestionsModuleMenu(popupRef, targetNodeKeyRef, activeEditorRef)
16537
16581
  id: "multiple-choice",
16538
16582
  label: "Multiple Choice",
16539
16583
  keywords: ["multiple choice", "question"],
16540
- Icon: import_lucide_react23.LayoutList,
16584
+ Icon: import_lucide_react24.LayoutList,
16541
16585
  onClick: () => {
16542
16586
  if (targetNodeKeyRef.current) {
16543
16587
  activeEditorRef.current?.dispatchCommand(
@@ -16556,7 +16600,7 @@ function renderQuestionsModuleMenu(popupRef, targetNodeKeyRef, activeEditorRef)
16556
16600
  id: "short-answer-question",
16557
16601
  label: "Short Answer",
16558
16602
  keywords: ["short answer", "question"],
16559
- Icon: import_lucide_react23.FileQuestion,
16603
+ Icon: import_lucide_react24.FileQuestion,
16560
16604
  onClick: () => {
16561
16605
  if (targetNodeKeyRef.current) {
16562
16606
  activeEditorRef.current?.dispatchCommand(
@@ -16579,7 +16623,7 @@ function renderQuestionsModuleMenu(popupRef, targetNodeKeyRef, activeEditorRef)
16579
16623
  "associate",
16580
16624
  "question"
16581
16625
  ],
16582
- Icon: import_lucide_react23.ArrowRightLeft,
16626
+ Icon: import_lucide_react24.ArrowRightLeft,
16583
16627
  onClick: () => {
16584
16628
  if (targetNodeKeyRef.current) {
16585
16629
  activeEditorRef.current?.dispatchCommand(
@@ -16602,7 +16646,7 @@ function renderQuestionsModuleMenu(popupRef, targetNodeKeyRef, activeEditorRef)
16602
16646
  "complete sentence",
16603
16647
  "question"
16604
16648
  ],
16605
- Icon: import_lucide_react23.Space,
16649
+ Icon: import_lucide_react24.Space,
16606
16650
  onClick: () => {
16607
16651
  if (targetNodeKeyRef.current) {
16608
16652
  activeEditorRef.current?.dispatchCommand(
@@ -16620,7 +16664,7 @@ function renderQuestionsModuleMenu(popupRef, targetNodeKeyRef, activeEditorRef)
16620
16664
  id: "journal-entry-question",
16621
16665
  label: "Journal Entry",
16622
16666
  keywords: ["journal entry", "question", ""],
16623
- Icon: import_lucide_react23.Calculator,
16667
+ Icon: import_lucide_react24.Calculator,
16624
16668
  onClick: () => {
16625
16669
  if (targetNodeKeyRef.current) {
16626
16670
  activeEditorRef.current?.dispatchCommand(
@@ -16638,7 +16682,7 @@ function renderQuestionsModuleMenu(popupRef, targetNodeKeyRef, activeEditorRef)
16638
16682
  }
16639
16683
 
16640
16684
  // src/plugins/TypeaheadMenuPlugin/renderTableModuleMenu.tsx
16641
- var import_lucide_react24 = require("lucide-react");
16685
+ var import_lucide_react25 = require("lucide-react");
16642
16686
  function renderTableModuleMenu(popupRef, targetNodeKeyRef, activeEditorRef) {
16643
16687
  return [
16644
16688
  {
@@ -16657,7 +16701,7 @@ function renderTableModuleMenu(popupRef, targetNodeKeyRef, activeEditorRef) {
16657
16701
  "data",
16658
16702
  "spreadsheet"
16659
16703
  ],
16660
- Icon: import_lucide_react24.Table2,
16704
+ Icon: import_lucide_react25.Table2,
16661
16705
  onClick: () => {
16662
16706
  if (targetNodeKeyRef.current) {
16663
16707
  activeEditorRef.current?.dispatchCommand(
@@ -16675,13 +16719,13 @@ function renderTableModuleMenu(popupRef, targetNodeKeyRef, activeEditorRef) {
16675
16719
  }
16676
16720
 
16677
16721
  // src/plugins/TypeaheadMenuPlugin/useTypeaheadTriggerMatch.ts
16678
- var import_react95 = require("react");
16722
+ var import_react96 = require("react");
16679
16723
  var PUNCTUATION2 = `\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'"~=<>_:;`;
16680
16724
  function useTypeaheadTriggerMatch2(trigger, {
16681
16725
  minLength = 1,
16682
16726
  maxLength = 75
16683
16727
  }) {
16684
- return (0, import_react95.useCallback)(
16728
+ return (0, import_react96.useCallback)(
16685
16729
  (text) => {
16686
16730
  const validChars = "[^" + trigger + PUNCTUATION2 + "]";
16687
16731
  const TypeaheadTriggerRegex = new RegExp(
@@ -16711,12 +16755,12 @@ var import_rich_text12 = require("@lexical/rich-text");
16711
16755
  var import_table17 = require("@lexical/table");
16712
16756
  var import_utils34 = require("@lexical/utils");
16713
16757
  var import_lexical97 = require("lexical");
16714
- var import_react96 = require("react");
16758
+ var import_react97 = require("react");
16715
16759
 
16716
16760
  // src/plugins/TypeaheadMenuPlugin/renderFillInTheBlankMenu.tsx
16717
16761
  var import_list15 = require("@lexical/list");
16718
16762
  var import_lexical96 = require("lexical");
16719
- var import_lucide_react25 = require("lucide-react");
16763
+ var import_lucide_react26 = require("lucide-react");
16720
16764
  function renderFillInTheBlankMenu(popupRef, targetNodeKeyRef, activeEditorRef) {
16721
16765
  return [
16722
16766
  {
@@ -16734,7 +16778,7 @@ function renderFillInTheBlankMenu(popupRef, targetNodeKeyRef, activeEditorRef) {
16734
16778
  "numbers",
16735
16779
  "sequence"
16736
16780
  ],
16737
- Icon: import_lucide_react25.ListOrdered,
16781
+ Icon: import_lucide_react26.ListOrdered,
16738
16782
  onClick: () => {
16739
16783
  activeEditorRef.current?.update(() => {
16740
16784
  if (targetNodeKeyRef.current) {
@@ -16765,7 +16809,7 @@ function renderFillInTheBlankMenu(popupRef, targetNodeKeyRef, activeEditorRef) {
16765
16809
  "bullets",
16766
16810
  "points"
16767
16811
  ],
16768
- Icon: import_lucide_react25.List,
16812
+ Icon: import_lucide_react26.List,
16769
16813
  onClick: () => {
16770
16814
  activeEditorRef.current?.update(() => {
16771
16815
  if (targetNodeKeyRef.current) {
@@ -16802,7 +16846,7 @@ function renderFillInTheBlankMenu(popupRef, targetNodeKeyRef, activeEditorRef) {
16802
16846
  "data",
16803
16847
  "spreadsheet"
16804
16848
  ],
16805
- Icon: import_lucide_react25.Table2,
16849
+ Icon: import_lucide_react26.Table2,
16806
16850
  onClick: () => {
16807
16851
  if (targetNodeKeyRef.current) {
16808
16852
  activeEditorRef.current?.dispatchCommand(
@@ -16820,17 +16864,17 @@ function renderFillInTheBlankMenu(popupRef, targetNodeKeyRef, activeEditorRef) {
16820
16864
  }
16821
16865
 
16822
16866
  // src/plugins/TypeaheadMenuPlugin/TypeaheadMenuPlugin.tsx
16823
- var import_jsx_runtime115 = require("react/jsx-runtime");
16867
+ var import_jsx_runtime116 = require("react/jsx-runtime");
16824
16868
  function TypeaheadMenuPlugin() {
16825
16869
  const { hasModule, modulesNumber } = useBlockEditor();
16826
16870
  const [editor] = (0, import_LexicalComposerContext63.useLexicalComposerContext)();
16827
16871
  const triggerFn = useTypeaheadTriggerMatch2("/", {
16828
16872
  minLength: 0
16829
16873
  });
16830
- const popupRef = (0, import_react96.useRef)(null);
16831
- const targetNodeKeyRef = (0, import_react96.useRef)(void 0);
16832
- const activeEditorRef = (0, import_react96.useRef)(void 0);
16833
- const [activeDecorator, setActiveDecorator] = (0, import_react96.useState)();
16874
+ const popupRef = (0, import_react97.useRef)(null);
16875
+ const targetNodeKeyRef = (0, import_react97.useRef)(void 0);
16876
+ const activeEditorRef = (0, import_react97.useRef)(void 0);
16877
+ const [activeDecorator, setActiveDecorator] = (0, import_react97.useState)();
16834
16878
  const handleUpdate = () => {
16835
16879
  activeEditorRef.current?.getEditorState().read(() => {
16836
16880
  const selection = (0, import_lexical97.$getSelection)();
@@ -16952,7 +16996,7 @@ function TypeaheadMenuPlugin() {
16952
16996
  }
16953
16997
  return false;
16954
16998
  };
16955
- (0, import_react96.useEffect)(() => {
16999
+ (0, import_react97.useEffect)(() => {
16956
17000
  return (0, import_utils34.mergeRegister)(
16957
17001
  editor.registerCommand(
16958
17002
  TYPEAHEAD_MENU_COMMAND,
@@ -17042,7 +17086,7 @@ function TypeaheadMenuPlugin() {
17042
17086
  )
17043
17087
  );
17044
17088
  }, [editor]);
17045
- const menu = (0, import_react96.useMemo)(() => {
17089
+ const menu = (0, import_react97.useMemo)(() => {
17046
17090
  let menuItems = activeDecorator === FillInTheBlankQuestionNode.getType() ? [] : [
17047
17091
  ...renderDefaultComponentsMenu(
17048
17092
  popupRef,
@@ -17103,7 +17147,7 @@ function TypeaheadMenuPlugin() {
17103
17147
  }
17104
17148
  return menuItems;
17105
17149
  }, [editor, modulesNumber, activeDecorator]);
17106
- return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
17150
+ return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
17107
17151
  PopupMenu,
17108
17152
  {
17109
17153
  ref: popupRef,
@@ -17116,8 +17160,8 @@ function TypeaheadMenuPlugin() {
17116
17160
  }
17117
17161
 
17118
17162
  // src/theme/ThemeProvider.tsx
17119
- var import_react97 = require("react");
17120
- var import_jsx_runtime116 = require("react/jsx-runtime");
17163
+ var import_react98 = require("react");
17164
+ var import_jsx_runtime117 = require("react/jsx-runtime");
17121
17165
  var themeVariablesMap = {
17122
17166
  borderBase: "--be-border-base",
17123
17167
  fontSans: "--be-font-sans",
@@ -17126,7 +17170,7 @@ var themeVariablesMap = {
17126
17170
  spacingBase: "--be-spacing-base",
17127
17171
  fontSizeBase: "--be-font-size-base"
17128
17172
  };
17129
- var ThemeContext = (0, import_react97.createContext)(
17173
+ var ThemeContext = (0, import_react98.createContext)(
17130
17174
  void 0
17131
17175
  );
17132
17176
  function ThemeProvider({
@@ -17134,9 +17178,9 @@ function ThemeProvider({
17134
17178
  themeVariables = {},
17135
17179
  children
17136
17180
  }) {
17137
- const rootElementRef = (0, import_react97.useRef)(null);
17138
- const [effectiveTheme, setEffectiveTheme] = (0, import_react97.useState)("light");
17139
- (0, import_react97.useEffect)(() => {
17181
+ const rootElementRef = (0, import_react98.useRef)(null);
17182
+ const [effectiveTheme, setEffectiveTheme] = (0, import_react98.useState)("light");
17183
+ (0, import_react98.useEffect)(() => {
17140
17184
  const mediaQuery = window.matchMedia(
17141
17185
  "(prefers-color-scheme: dark)"
17142
17186
  );
@@ -17151,14 +17195,14 @@ function ThemeProvider({
17151
17195
  mediaQuery.addEventListener("change", updateEffectiveTheme);
17152
17196
  return () => mediaQuery.removeEventListener("change", updateEffectiveTheme);
17153
17197
  }, [theme]);
17154
- (0, import_react97.useEffect)(() => {
17198
+ (0, import_react98.useEffect)(() => {
17155
17199
  rootElementRef.current?.classList.remove(
17156
17200
  "theme-light",
17157
17201
  "theme-dark"
17158
17202
  );
17159
17203
  rootElementRef.current?.classList.add(`theme-${effectiveTheme}`);
17160
17204
  }, [effectiveTheme]);
17161
- return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(ThemeContext.Provider, { value: { theme, effectiveTheme }, children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
17205
+ return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(ThemeContext.Provider, { value: { theme, effectiveTheme }, children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
17162
17206
  "div",
17163
17207
  {
17164
17208
  ref: rootElementRef,
@@ -17180,16 +17224,15 @@ function ThemeProvider({
17180
17224
  var import_LexicalComposer = require("@lexical/react/LexicalComposer");
17181
17225
  var import_LexicalErrorBoundary9 = require("@lexical/react/LexicalErrorBoundary");
17182
17226
  var import_LexicalHistoryPlugin10 = require("@lexical/react/LexicalHistoryPlugin");
17183
- var import_LexicalListPlugin3 = require("@lexical/react/LexicalListPlugin");
17227
+ var import_LexicalListPlugin2 = require("@lexical/react/LexicalListPlugin");
17184
17228
  var import_LexicalOnChangePlugin = require("@lexical/react/LexicalOnChangePlugin");
17185
- var import_LexicalRichTextPlugin8 = require("@lexical/react/LexicalRichTextPlugin");
17186
- var import_LexicalTabIndentationPlugin3 = require("@lexical/react/LexicalTabIndentationPlugin");
17187
- var import_lucide_react26 = require("lucide-react");
17188
- var import_react98 = __toESM(require("react"));
17189
- var import_jsx_runtime117 = require("react/jsx-runtime");
17229
+ var import_LexicalRichTextPlugin7 = require("@lexical/react/LexicalRichTextPlugin");
17230
+ var import_LexicalTabIndentationPlugin2 = require("@lexical/react/LexicalTabIndentationPlugin");
17231
+ var import_react99 = __toESM(require("react"));
17232
+ var import_jsx_runtime118 = require("react/jsx-runtime");
17190
17233
  var TOGGLE_EDITING_MODE = "TOGGLE_EDITING_MODE";
17191
17234
  var RESET_EDITING_MODE = "RESET_EDITING_MODE";
17192
- var BlockEditorContext = import_react98.default.createContext(null);
17235
+ var BlockEditorContext = import_react99.default.createContext(null);
17193
17236
  function BlockEditor(props) {
17194
17237
  const {
17195
17238
  themeSettings,
@@ -17200,21 +17243,21 @@ function BlockEditor(props) {
17200
17243
  children,
17201
17244
  renderSettings
17202
17245
  } = props;
17203
- const [modulesNumber, setModulesNumber] = (0, import_react98.useState)(0);
17204
- const editorModulesRef = (0, import_react98.useRef)({
17246
+ const [modulesNumber, setModulesNumber] = (0, import_react99.useState)(0);
17247
+ const editorModulesRef = (0, import_react99.useRef)({
17205
17248
  ...initialEditorRegistry
17206
17249
  });
17207
- const [settingsPanelSwitch, setSettingsPanelSwitch] = (0, import_react98.useState)("off");
17208
- const settingsPanelsRef = (0, import_react98.useRef)({});
17209
- const nestedEditorsRef = (0, import_react98.useRef)({});
17210
- const editorRef = (0, import_react98.useRef)(null);
17211
- const drawerRef = (0, import_react98.useRef)(null);
17212
- const [isBlockEditorReady, setBlockEditorReady] = (0, import_react98.useState)(false);
17250
+ const [settingsPanelSwitch, setSettingsPanelSwitch] = (0, import_react99.useState)("off");
17251
+ const settingsPanelsRef = (0, import_react99.useRef)({});
17252
+ const nestedEditorsRef = (0, import_react99.useRef)({});
17253
+ const editorRef = (0, import_react99.useRef)(null);
17254
+ const drawerRef = (0, import_react99.useRef)(null);
17255
+ const [isBlockEditorReady, setBlockEditorReady] = (0, import_react99.useState)(false);
17213
17256
  const { historyState } = useSharedHistoryContext();
17214
- const [blockEditorStyleVars, setBlockEditorStyleVars] = (0, import_react98.useState)({
17257
+ const [blockEditorStyleVars, setBlockEditorStyleVars] = (0, import_react99.useState)({
17215
17258
  "--be-ol-list-style-type": "decimal"
17216
17259
  });
17217
- const handleChange = (0, import_react98.useCallback)(
17260
+ const handleChange = (0, import_react99.useCallback)(
17218
17261
  (editorState2, _editor, tags) => {
17219
17262
  if (onChange && !tags?.has("new_state") && !tags?.has("history-merge")) {
17220
17263
  const editorStateJSON = editorState2.toJSON();
@@ -17223,7 +17266,7 @@ function BlockEditor(props) {
17223
17266
  },
17224
17267
  [onChange]
17225
17268
  );
17226
- (0, import_react98.useEffect)(() => {
17269
+ (0, import_react99.useEffect)(() => {
17227
17270
  if (editorState) {
17228
17271
  const parsedEditorState = editorRef.current?.parseEditorState(editorState);
17229
17272
  if (parsedEditorState) {
@@ -17234,10 +17277,10 @@ function BlockEditor(props) {
17234
17277
  }
17235
17278
  editorRef.current?.setEditable(editable);
17236
17279
  }, [editable, editorState]);
17237
- (0, import_react98.useEffect)(() => {
17280
+ (0, import_react99.useEffect)(() => {
17238
17281
  setBlockEditorReady(true);
17239
17282
  }, []);
17240
- const registerModule = (0, import_react98.useCallback)(
17283
+ const registerModule = (0, import_react99.useCallback)(
17241
17284
  (moduleType) => {
17242
17285
  editorModulesRef.current[moduleType] = true;
17243
17286
  const modulesNumber2 = Object.entries(
@@ -17247,17 +17290,25 @@ function BlockEditor(props) {
17247
17290
  },
17248
17291
  [modulesNumber]
17249
17292
  );
17250
- const openSettingsPanel = (0, import_react98.useCallback)(() => {
17293
+ const openSettingsPanel = (0, import_react99.useCallback)(() => {
17251
17294
  setSettingsPanelSwitch("on");
17252
17295
  }, []);
17253
- const [editingMode, setEditingMode] = (0, import_react98.useState)({
17296
+ const autoOpenSettingsPanel = (0, import_react99.useCallback)(() => {
17297
+ setSettingsPanelSwitch((prevState) => {
17298
+ if (prevState === "off") {
17299
+ return "on";
17300
+ }
17301
+ return prevState;
17302
+ });
17303
+ }, []);
17304
+ const [editingMode, setEditingMode] = (0, import_react99.useState)({
17254
17305
  mode: "edit"
17255
17306
  });
17256
- const editingModeDataCallbackRef = (0, import_react98.useRef)();
17307
+ const editingModeDataCallbackRef = (0, import_react99.useRef)();
17257
17308
  const handleResetPreviewModeEvent = () => {
17258
17309
  setEditingMode({ mode: "edit" });
17259
17310
  };
17260
- (0, import_react98.useEffect)(() => {
17311
+ (0, import_react99.useEffect)(() => {
17261
17312
  if (editingMode.mode === "preview") {
17262
17313
  window.dispatchEvent(
17263
17314
  new CustomEvent(
@@ -17283,7 +17334,7 @@ function BlockEditor(props) {
17283
17334
  );
17284
17335
  }
17285
17336
  }, [editingMode]);
17286
- (0, import_react98.useEffect)(() => {
17337
+ (0, import_react99.useEffect)(() => {
17287
17338
  window.addEventListener(
17288
17339
  RESET_EDITING_MODE,
17289
17340
  handleResetPreviewModeEvent
@@ -17295,7 +17346,7 @@ function BlockEditor(props) {
17295
17346
  );
17296
17347
  };
17297
17348
  }, []);
17298
- return /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
17349
+ return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
17299
17350
  BlockEditorContext.Provider,
17300
17351
  {
17301
17352
  value: {
@@ -17316,6 +17367,7 @@ function BlockEditor(props) {
17316
17367
  },
17317
17368
  settingsPanelSwitch,
17318
17369
  openSettingsPanel,
17370
+ autoOpenSettingsPanel,
17319
17371
  toggleSettingsPanelSwitch: () => {
17320
17372
  setSettingsPanelSwitch((prevState) => {
17321
17373
  if (drawerRef.current) {
@@ -17357,91 +17409,73 @@ function BlockEditor(props) {
17357
17409
  ...value
17358
17410
  });
17359
17411
  },
17360
- renderSettings: renderSettings ? renderSettings : () => /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("div", {})
17412
+ renderSettings: renderSettings ? renderSettings : () => /* @__PURE__ */ (0, import_jsx_runtime118.jsx)("div", {})
17361
17413
  },
17362
- children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(ThemeProvider, { theme, themeVariables: themeSettings, children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(ResizeObserver, { children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
17414
+ children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(ThemeProvider, { theme, themeVariables: themeSettings, children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(ResizeObserver, { children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
17363
17415
  "article",
17364
17416
  {
17365
17417
  className: "be-article",
17366
17418
  style: { ...blockEditorStyleVars },
17367
- children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(SharedHistoryContext, { children: /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(NodeProvider, { children: [
17368
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
17419
+ children: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(SharedHistoryContext, { children: /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(NodeProvider, { children: [
17420
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
17369
17421
  "main",
17370
17422
  {
17371
17423
  className: `${settingsPanelSwitch === "on" ? "narrow" : ""}`,
17372
- children: /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(
17424
+ children: /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(
17373
17425
  import_LexicalComposer.LexicalComposer,
17374
17426
  {
17375
17427
  initialConfig: { ...initialConfig },
17376
17428
  children: [
17377
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
17429
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
17378
17430
  EditorRefPlugin,
17379
17431
  {
17380
17432
  onMountRef: (editor) => editorRef.current = editor
17381
17433
  }
17382
17434
  ),
17383
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(AutoFocusPlugin, {}),
17384
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(AutoBottomParagraphPlugin, {}),
17385
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
17435
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(AutoFocusPlugin, {}),
17436
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(AutoBottomParagraphPlugin, {}),
17437
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
17386
17438
  import_LexicalHistoryPlugin10.HistoryPlugin,
17387
17439
  {
17388
17440
  externalHistoryState: historyState
17389
17441
  }
17390
17442
  ),
17391
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
17443
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
17392
17444
  import_LexicalOnChangePlugin.OnChangePlugin,
17393
17445
  {
17394
17446
  onChange: handleChange,
17395
17447
  ignoreSelectionChange: true
17396
17448
  }
17397
17449
  ),
17398
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(OnNestedChangePlugin, { onChange: handleChange }),
17399
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
17400
- import_LexicalRichTextPlugin8.RichTextPlugin,
17450
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(OnNestedChangePlugin, { onChange: handleChange }),
17451
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
17452
+ import_LexicalRichTextPlugin7.RichTextPlugin,
17401
17453
  {
17402
- contentEditable: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(ContentEditable, {}),
17454
+ contentEditable: /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(ContentEditable, {}),
17403
17455
  placeholder: null,
17404
17456
  ErrorBoundary: import_LexicalErrorBoundary9.LexicalErrorBoundary
17405
17457
  }
17406
17458
  ),
17407
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(NodePastePlugin, {}),
17408
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_LexicalListPlugin3.ListPlugin, {}),
17409
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(ListLevelLimitPlugin, {}),
17410
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_LexicalTabIndentationPlugin3.TabIndentationPlugin, {}),
17459
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(NodePastePlugin, {}),
17460
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_LexicalListPlugin2.ListPlugin, {}),
17461
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(ListLevelLimitPlugin, {}),
17462
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_LexicalTabIndentationPlugin2.TabIndentationPlugin, {}),
17411
17463
  children,
17412
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(TypeaheadMenuPlugin, {}),
17413
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(TypeaheadMenuAgentPlugin, {}),
17414
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(NodeMouseAnchorPlugin, {}),
17415
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(NodeMousePlugin, {}),
17416
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(TextToolbarPlugin, {}),
17417
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(TextToolbarAgentPlugin, {}),
17418
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(TypeaheadVariableAgentPlugin, {}),
17419
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(VariableComponentPlugin, {}),
17420
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(MarkdownPlugin, {})
17464
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(TypeaheadMenuPlugin, {}),
17465
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(TypeaheadMenuAgentPlugin, {}),
17466
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(NodeMouseAnchorPlugin, {}),
17467
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(NodeMousePlugin, {}),
17468
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(TextToolbarPlugin, {}),
17469
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(TextToolbarAgentPlugin, {}),
17470
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(TypeaheadVariableAgentPlugin, {}),
17471
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(VariableComponentPlugin, {}),
17472
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(MarkdownPlugin, {})
17421
17473
  ]
17422
17474
  }
17423
17475
  )
17424
17476
  }
17425
17477
  ),
17426
- /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
17427
- "nav",
17428
- {
17429
- ref: drawerRef,
17430
- className: settingsPanelSwitch === "on" ? "shown" : "hidden",
17431
- children: settingsPanelSwitch === "off" && /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
17432
- Button,
17433
- {
17434
- className: "cancel",
17435
- variant: "text",
17436
- size: "large",
17437
- StartIcon: import_lucide_react26.Menu,
17438
- onClick: () => {
17439
- setSettingsPanelSwitch("on");
17440
- }
17441
- }
17442
- ) })
17443
- }
17444
- )
17478
+ /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(Drawer, { ref: drawerRef })
17445
17479
  ] }) })
17446
17480
  }
17447
17481
  ) }) })
@@ -17449,7 +17483,7 @@ function BlockEditor(props) {
17449
17483
  );
17450
17484
  }
17451
17485
  var useBlockEditor = () => {
17452
- const context = (0, import_react98.useContext)(BlockEditorContext);
17486
+ const context = (0, import_react99.useContext)(BlockEditorContext);
17453
17487
  if (!context) {
17454
17488
  throw new Error(
17455
17489
  "useBlockEditor must be used within a BlockEditor"
@@ -17459,23 +17493,23 @@ var useBlockEditor = () => {
17459
17493
  };
17460
17494
 
17461
17495
  // src/modules/Callout.tsx
17462
- var import_react99 = require("react");
17463
- var import_jsx_runtime118 = require("react/jsx-runtime");
17496
+ var import_react100 = require("react");
17497
+ var import_jsx_runtime119 = require("react/jsx-runtime");
17464
17498
  function Callout() {
17465
17499
  const { registerModule } = useBlockEditor();
17466
- (0, import_react99.useEffect)(() => {
17500
+ (0, import_react100.useEffect)(() => {
17467
17501
  registerModule("Callout");
17468
17502
  }, [registerModule]);
17469
- return /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(CalloutBoxPlugin, {});
17503
+ return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(CalloutBoxPlugin, {});
17470
17504
  }
17471
17505
 
17472
17506
  // src/plugins/TreeViewPlugin/index.tsx
17473
17507
  var import_LexicalComposerContext64 = require("@lexical/react/LexicalComposerContext");
17474
17508
  var import_LexicalTreeView = require("@lexical/react/LexicalTreeView");
17475
- var import_jsx_runtime119 = require("react/jsx-runtime");
17509
+ var import_jsx_runtime120 = require("react/jsx-runtime");
17476
17510
  function TreeViewPlugin() {
17477
17511
  const [editor] = (0, import_LexicalComposerContext64.useLexicalComposerContext)();
17478
- return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
17512
+ return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
17479
17513
  import_LexicalTreeView.TreeView,
17480
17514
  {
17481
17515
  viewClassName: "tree-view-output",
@@ -17490,26 +17524,26 @@ function TreeViewPlugin() {
17490
17524
  }
17491
17525
 
17492
17526
  // src/modules/Debug.tsx
17493
- var import_react100 = require("react");
17494
- var import_jsx_runtime120 = require("react/jsx-runtime");
17527
+ var import_react101 = require("react");
17528
+ var import_jsx_runtime121 = require("react/jsx-runtime");
17495
17529
  function Debug() {
17496
17530
  const { registerModule } = useBlockEditor();
17497
- (0, import_react100.useEffect)(() => {
17531
+ (0, import_react101.useEffect)(() => {
17498
17532
  registerModule("Debug");
17499
17533
  }, [registerModule]);
17500
- return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(TreeViewPlugin, {});
17534
+ return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(TreeViewPlugin, {});
17501
17535
  }
17502
17536
 
17503
17537
  // src/modules/Image.tsx
17504
- var import_react101 = require("react");
17505
- var import_jsx_runtime121 = require("react/jsx-runtime");
17538
+ var import_react102 = require("react");
17539
+ var import_jsx_runtime122 = require("react/jsx-runtime");
17506
17540
  function Image(props) {
17507
17541
  const { imageSettings } = props;
17508
17542
  const { registerModule } = useBlockEditor();
17509
- (0, import_react101.useEffect)(() => {
17543
+ (0, import_react102.useEffect)(() => {
17510
17544
  registerModule("Image");
17511
17545
  }, [registerModule]);
17512
- return /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_jsx_runtime121.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(ImagePlugin, { imageSettings }) });
17546
+ return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_jsx_runtime122.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(ImagePlugin, { imageSettings }) });
17513
17547
  }
17514
17548
 
17515
17549
  // src/plugins/LinkToolbarPlugin/LinkToolbarPlugin.tsx
@@ -17519,22 +17553,22 @@ var import_utils35 = require("@lexical/utils");
17519
17553
  var import_lexical98 = require("lexical");
17520
17554
  var import_debounce6 = __toESM(require("lodash-es/debounce"));
17521
17555
  var import_lucide_react27 = require("lucide-react");
17522
- var import_react102 = require("react");
17523
- var import_jsx_runtime122 = require("react/jsx-runtime");
17556
+ var import_react103 = require("react");
17557
+ var import_jsx_runtime123 = require("react/jsx-runtime");
17524
17558
  function LinkToolbarPlugin() {
17525
17559
  const [editor] = (0, import_LexicalComposerContext65.useLexicalComposerContext)();
17526
- const popupToolbarRef = (0, import_react102.useRef)(null);
17527
- const linkTextNodeRef = (0, import_react102.useRef)();
17528
- const linkTextNodeOffsetRef = (0, import_react102.useRef)();
17529
- const [linkNode, setLinkNode] = (0, import_react102.useState)();
17530
- const linkNodeElementRef = (0, import_react102.useRef)();
17531
- const activeEditorRef = (0, import_react102.useRef)();
17560
+ const popupToolbarRef = (0, import_react103.useRef)(null);
17561
+ const linkTextNodeRef = (0, import_react103.useRef)();
17562
+ const linkTextNodeOffsetRef = (0, import_react103.useRef)();
17563
+ const [linkNode, setLinkNode] = (0, import_react103.useState)();
17564
+ const linkNodeElementRef = (0, import_react103.useRef)();
17565
+ const activeEditorRef = (0, import_react103.useRef)();
17532
17566
  const handleClose = () => {
17533
17567
  if (popupToolbarRef.current && popupToolbarRef.current.isShown()) {
17534
17568
  popupToolbarRef.current.hideToolbar();
17535
17569
  }
17536
17570
  };
17537
- const repositionPopupToolbar = (0, import_react102.useCallback)(
17571
+ const repositionPopupToolbar = (0, import_react103.useCallback)(
17538
17572
  (0, import_debounce6.default)(() => {
17539
17573
  if (popupToolbarRef.current && popupToolbarRef.current.isShown()) {
17540
17574
  if (linkNodeElementRef.current) {
@@ -17546,7 +17580,7 @@ function LinkToolbarPlugin() {
17546
17580
  }, 10),
17547
17581
  [editor]
17548
17582
  );
17549
- (0, import_react102.useEffect)(() => {
17583
+ (0, import_react103.useEffect)(() => {
17550
17584
  return (0, import_utils35.mergeRegister)(
17551
17585
  editor.registerCommand(
17552
17586
  import_lexical98.CLICK_COMMAND,
@@ -17620,7 +17654,7 @@ function LinkToolbarPlugin() {
17620
17654
  )
17621
17655
  );
17622
17656
  }, [editor]);
17623
- (0, import_react102.useEffect)(() => {
17657
+ (0, import_react103.useEffect)(() => {
17624
17658
  window.addEventListener("scroll", repositionPopupToolbar);
17625
17659
  window.addEventListener("resize", repositionPopupToolbar);
17626
17660
  return () => {
@@ -17630,12 +17664,12 @@ function LinkToolbarPlugin() {
17630
17664
  }, [editor]);
17631
17665
  const linkUrl = linkNode?.linkUrl;
17632
17666
  const linkTitle = linkNode?.linkUrl;
17633
- return /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
17667
+ return /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
17634
17668
  PopupToolbar,
17635
17669
  {
17636
17670
  ref: popupToolbarRef,
17637
17671
  onEscape: handleClose,
17638
- toolbar: /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(
17672
+ toolbar: /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(
17639
17673
  "div",
17640
17674
  {
17641
17675
  style: {
@@ -17648,23 +17682,23 @@ function LinkToolbarPlugin() {
17648
17682
  padding: "var(--sl-spacing-2x-small) var(--sl-spacing-x-small) var(--sl-spacing-2x-small) var(--sl-spacing-medium)"
17649
17683
  },
17650
17684
  children: [
17651
- /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("a", { href: linkUrl, target: linkNode?.linkTarget || "", children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
17685
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("a", { href: linkUrl, target: linkNode?.linkTarget || "", children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
17652
17686
  "sl-tooltip",
17653
17687
  {
17654
17688
  style: { "--show-delay": "1800" },
17655
17689
  hoist: true,
17656
17690
  content: linkUrl || "[Empty URL]",
17657
- children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("span", { className: "line-short-20", children: linkTitle })
17691
+ children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("span", { className: "line-short-20", children: linkTitle })
17658
17692
  }
17659
17693
  ) }) }),
17660
- /* @__PURE__ */ (0, import_jsx_runtime122.jsxs)(Stack, { className: "stack__row", children: [
17661
- /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
17694
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(Stack, { className: "stack__row", children: [
17695
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
17662
17696
  "sl-tooltip",
17663
17697
  {
17664
17698
  style: { "--show-delay": "1800" },
17665
17699
  hoist: "hoist",
17666
17700
  content: "Edit Link",
17667
- children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
17701
+ children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
17668
17702
  Button,
17669
17703
  {
17670
17704
  size: "small",
@@ -17703,13 +17737,13 @@ function LinkToolbarPlugin() {
17703
17737
  )
17704
17738
  }
17705
17739
  ) }),
17706
- /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
17740
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
17707
17741
  "sl-tooltip",
17708
17742
  {
17709
17743
  style: { "--show-delay": "1800" },
17710
17744
  hoist: "hoist",
17711
17745
  content: "Remove Link",
17712
- children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
17746
+ children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
17713
17747
  Button,
17714
17748
  {
17715
17749
  size: "small",
@@ -17744,13 +17778,13 @@ function LinkToolbarPlugin() {
17744
17778
  )
17745
17779
  }
17746
17780
  ) }),
17747
- /* @__PURE__ */ (0, import_jsx_runtime122.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
17781
+ /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
17748
17782
  "sl-tooltip",
17749
17783
  {
17750
17784
  style: { "--show-delay": "1800" },
17751
17785
  hoist: "hoist",
17752
17786
  content: "Close",
17753
- children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
17787
+ children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
17754
17788
  Button,
17755
17789
  {
17756
17790
  size: "small",
@@ -17772,16 +17806,16 @@ function LinkToolbarPlugin() {
17772
17806
  }
17773
17807
 
17774
17808
  // src/modules/Link.tsx
17775
- var import_react103 = require("react");
17776
- var import_jsx_runtime123 = require("react/jsx-runtime");
17809
+ var import_react104 = require("react");
17810
+ var import_jsx_runtime124 = require("react/jsx-runtime");
17777
17811
  function Link() {
17778
17812
  const { registerModule } = useBlockEditor();
17779
- (0, import_react103.useEffect)(() => {
17813
+ (0, import_react104.useEffect)(() => {
17780
17814
  registerModule("Link");
17781
17815
  }, [registerModule]);
17782
- return /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(import_jsx_runtime123.Fragment, { children: [
17783
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(LinkEditorPlugin, {}),
17784
- /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(LinkToolbarPlugin, {})
17816
+ return /* @__PURE__ */ (0, import_jsx_runtime124.jsxs)(import_jsx_runtime124.Fragment, { children: [
17817
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(LinkEditorPlugin, {}),
17818
+ /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(LinkToolbarPlugin, {})
17785
17819
  ] });
17786
17820
  }
17787
17821
 
@@ -17789,12 +17823,12 @@ function Link() {
17789
17823
  var import_LexicalComposerContext66 = require("@lexical/react/LexicalComposerContext");
17790
17824
  var import_utils36 = require("@lexical/utils");
17791
17825
  var import_lexical99 = require("lexical");
17792
- var import_react104 = require("react");
17793
- var import_jsx_runtime124 = require("react/jsx-runtime");
17826
+ var import_react105 = require("react");
17827
+ var import_jsx_runtime125 = require("react/jsx-runtime");
17794
17828
  var INSERT_ESSAY_QUESTION_COMMAND = (0, import_lexical99.createCommand)("INSERT_ESSAY_QUESTION_COMMAND");
17795
17829
  function EssayQuestionPlugin() {
17796
17830
  const [editor] = (0, import_LexicalComposerContext66.useLexicalComposerContext)();
17797
- (0, import_react104.useEffect)(() => {
17831
+ (0, import_react105.useEffect)(() => {
17798
17832
  return (0, import_utils36.mergeRegister)(
17799
17833
  editor.registerCommand(
17800
17834
  INSERT_ESSAY_QUESTION_COMMAND,
@@ -17828,13 +17862,13 @@ function EssayQuestionPlugin() {
17828
17862
  )
17829
17863
  );
17830
17864
  }, [editor]);
17831
- return /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_jsx_runtime124.Fragment, {});
17865
+ return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_jsx_runtime125.Fragment, {});
17832
17866
  }
17833
17867
 
17834
17868
  // src/plugins/FinancialStatementQuestionPlugin/FinancialStatementQuestionSettings.tsx
17835
17869
  var import_LexicalComposerContext67 = require("@lexical/react/LexicalComposerContext");
17836
17870
  var import_lexical100 = require("lexical");
17837
- var import_react105 = require("react");
17871
+ var import_react106 = require("react");
17838
17872
 
17839
17873
  // src/plugins/FinancialStatementQuestionPlugin/validatePointslnput.ts
17840
17874
  function validatePointsInput6(input) {
@@ -17856,13 +17890,13 @@ function validatePointsInput6(input) {
17856
17890
  }
17857
17891
 
17858
17892
  // src/plugins/FinancialStatementQuestionPlugin/FinancialStatementQuestionSettings.tsx
17859
- var import_jsx_runtime125 = require("react/jsx-runtime");
17893
+ var import_jsx_runtime126 = require("react/jsx-runtime");
17860
17894
  function FinancialStatementQuestionSettings(props) {
17861
17895
  const { nodeKey } = props;
17862
17896
  const [editor] = (0, import_LexicalComposerContext67.useLexicalComposerContext)();
17863
- const pointsTextInputRef = (0, import_react105.useRef)(null);
17864
- const [foundNode, setFoundNode] = (0, import_react105.useState)();
17865
- (0, import_react105.useEffect)(() => {
17897
+ const pointsTextInputRef = (0, import_react106.useRef)(null);
17898
+ const [foundNode, setFoundNode] = (0, import_react106.useState)();
17899
+ (0, import_react106.useEffect)(() => {
17866
17900
  if (nodeKey) {
17867
17901
  editor.getEditorState().read(() => {
17868
17902
  const fillInTheBlankNode = (0, import_lexical100.$getNodeByKey)(nodeKey);
@@ -17875,7 +17909,7 @@ function FinancialStatementQuestionSettings(props) {
17875
17909
  if (!foundNode) {
17876
17910
  return null;
17877
17911
  }
17878
- return /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
17912
+ return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
17879
17913
  TextInput,
17880
17914
  {
17881
17915
  ref: pointsTextInputRef,
@@ -17908,8 +17942,8 @@ function FinancialStatementQuestionSettings(props) {
17908
17942
  var import_LexicalComposerContext68 = require("@lexical/react/LexicalComposerContext");
17909
17943
  var import_utils37 = require("@lexical/utils");
17910
17944
  var import_lexical101 = require("lexical");
17911
- var import_react106 = require("react");
17912
- var import_jsx_runtime126 = require("react/jsx-runtime");
17945
+ var import_react107 = require("react");
17946
+ var import_jsx_runtime127 = require("react/jsx-runtime");
17913
17947
  var INSERT_FINANCIAL_STATEMENT_QUESTION_COMMAND = (0, import_lexical101.createCommand)("INSERT_FINANCIAL_STATEMENT_QUESTION_COMMAND");
17914
17948
  function FinancialStatementQuestionPlugin() {
17915
17949
  const {
@@ -17919,8 +17953,8 @@ function FinancialStatementQuestionPlugin() {
17919
17953
  toggleSettingsPanelSwitch
17920
17954
  } = useBlockEditor();
17921
17955
  const [editor] = (0, import_LexicalComposerContext68.useLexicalComposerContext)();
17922
- const settingsPanelStickyRef = (0, import_react106.useRef)(null);
17923
- (0, import_react106.useEffect)(() => {
17956
+ const settingsPanelStickyRef = (0, import_react107.useRef)(null);
17957
+ (0, import_react107.useEffect)(() => {
17924
17958
  return (0, import_utils37.mergeRegister)(
17925
17959
  editor.registerCommand(
17926
17960
  INSERT_FINANCIAL_STATEMENT_QUESTION_COMMAND,
@@ -17964,7 +17998,7 @@ function FinancialStatementQuestionPlugin() {
17964
17998
  )
17965
17999
  );
17966
18000
  }, [editor]);
17967
- (0, import_react106.useEffect)(() => {
18001
+ (0, import_react107.useEffect)(() => {
17968
18002
  if (isBlockEditorReady) {
17969
18003
  if (settingsPanelStickyRef.current) {
17970
18004
  registerSettingsPanel(
@@ -17974,21 +18008,21 @@ function FinancialStatementQuestionPlugin() {
17974
18008
  }
17975
18009
  }
17976
18010
  }, [isBlockEditorReady]);
17977
- return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(import_jsx_runtime126.Fragment, { children: [
17978
- drawer && /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
18011
+ return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_jsx_runtime127.Fragment, { children: [
18012
+ drawer && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
17979
18013
  StickyToPosition,
17980
18014
  {
17981
18015
  ref: settingsPanelStickyRef,
17982
18016
  container: drawer,
17983
18017
  children: (data, position, isVisible) => {
17984
- return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)("div", { style: { width: position.width }, children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
18018
+ return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("div", { style: { width: position.width }, children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
17985
18019
  SettingsCard,
17986
18020
  {
17987
18021
  isVisible: !!isVisible,
17988
18022
  container: drawer,
17989
18023
  title: "Financial Statement Settings",
17990
18024
  onClose: toggleSettingsPanelSwitch,
17991
- children: isVisible && /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
18025
+ children: isVisible && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
17992
18026
  FinancialStatementQuestionSettings,
17993
18027
  {
17994
18028
  nodeKey: data.nodeKey
@@ -18000,36 +18034,36 @@ function FinancialStatementQuestionPlugin() {
18000
18034
  }
18001
18035
  }
18002
18036
  ),
18003
- /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(FillInTheBlankSpaceSettingsPlugin, {})
18037
+ /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(FillInTheBlankSpaceSettingsPlugin, {})
18004
18038
  ] });
18005
18039
  }
18006
18040
 
18007
18041
  // src/modules/Questions.tsx
18008
- var import_react107 = require("react");
18009
- var import_jsx_runtime127 = require("react/jsx-runtime");
18042
+ var import_react108 = require("react");
18043
+ var import_jsx_runtime128 = require("react/jsx-runtime");
18010
18044
  function Questions() {
18011
18045
  const { registerModule } = useBlockEditor();
18012
- (0, import_react107.useEffect)(() => {
18046
+ (0, import_react108.useEffect)(() => {
18013
18047
  registerModule("Questions");
18014
18048
  }, [registerModule]);
18015
- return /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_jsx_runtime127.Fragment, { children: [
18016
- /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(MultipleOptionQuestionPlugin, {}),
18017
- /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(ShortAnswerQuestionPlugin, {}),
18018
- /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(MatchingQuestionPlugin, {}),
18019
- /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(FillInTheBlankQuestionPlugin, {}),
18020
- /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(JournalEntryQuestionPlugin, {}),
18021
- /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(FinancialStatementQuestionPlugin, {}),
18022
- /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(EssayQuestionPlugin, {})
18049
+ return /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(import_jsx_runtime128.Fragment, { children: [
18050
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(MultipleOptionQuestionPlugin, {}),
18051
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(ShortAnswerQuestionPlugin, {}),
18052
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(MatchingQuestionPlugin, {}),
18053
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(FillInTheBlankQuestionPlugin, {}),
18054
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(JournalEntryQuestionPlugin, {}),
18055
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(FinancialStatementQuestionPlugin, {}),
18056
+ /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(EssayQuestionPlugin, {})
18023
18057
  ] });
18024
18058
  }
18025
18059
 
18026
18060
  // src/modules/SettingsPanel.tsx
18027
- var import_react108 = require("react");
18028
- var import_jsx_runtime128 = require("react/jsx-runtime");
18061
+ var import_react109 = require("react");
18062
+ var import_jsx_runtime129 = require("react/jsx-runtime");
18029
18063
  function SettingsPanel(props) {
18030
18064
  const { defaultOpen = true } = props;
18031
18065
  const { registerModule, openSettingsPanel } = useBlockEditor();
18032
- (0, import_react108.useEffect)(() => {
18066
+ (0, import_react109.useEffect)(() => {
18033
18067
  registerModule("SettingsPanel");
18034
18068
  setTimeout(() => {
18035
18069
  if (defaultOpen) {
@@ -18037,18 +18071,18 @@ function SettingsPanel(props) {
18037
18071
  }
18038
18072
  }, 50);
18039
18073
  }, [registerModule, defaultOpen, openSettingsPanel]);
18040
- return /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(SettingsPanelPlugin, {});
18074
+ return /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(SettingsPanelPlugin, {});
18041
18075
  }
18042
18076
 
18043
18077
  // src/plugins/VariablesPlugin/VariableSettingsPlugin.tsx
18044
- var import_react110 = require("react");
18078
+ var import_react111 = require("react");
18045
18079
 
18046
18080
  // src/plugins/VariablesPlugin/VariableSettings.tsx
18047
18081
  var import_LexicalComposerContext69 = require("@lexical/react/LexicalComposerContext");
18048
18082
  var import_lexical102 = require("lexical");
18049
18083
  var import_lucide_react28 = require("lucide-react");
18050
- var import_react109 = require("react");
18051
- var import_jsx_runtime129 = require("react/jsx-runtime");
18084
+ var import_react110 = require("react");
18085
+ var import_jsx_runtime130 = require("react/jsx-runtime");
18052
18086
  var controlGridStyle = {
18053
18087
  width: "100%",
18054
18088
  display: "flex",
@@ -18081,11 +18115,11 @@ function VariableSettings(props) {
18081
18115
  } = useBlockEditor();
18082
18116
  const { variableList, onRenamed } = useVariables();
18083
18117
  const [editor] = (0, import_LexicalComposerContext69.useLexicalComposerContext)();
18084
- const activeEditorRef = (0, import_react109.useRef)();
18085
- const [currentVariableNode, setCurrentVariableNode] = (0, import_react109.useState)();
18086
- const [isSettingsEditingMode, setSettingsEditingMode] = (0, import_react109.useState)(false);
18087
- const variableNameInputRef = (0, import_react109.useRef)(null);
18088
- (0, import_react109.useEffect)(() => {
18118
+ const activeEditorRef = (0, import_react110.useRef)();
18119
+ const [currentVariableNode, setCurrentVariableNode] = (0, import_react110.useState)();
18120
+ const [isSettingsEditingMode, setSettingsEditingMode] = (0, import_react110.useState)(false);
18121
+ const variableNameInputRef = (0, import_react110.useRef)(null);
18122
+ (0, import_react110.useEffect)(() => {
18089
18123
  if (nodeKey) {
18090
18124
  activeEditorRef.current = nestedEditorId ? getNestedEditor(nestedEditorId) || editor : editor;
18091
18125
  if (activeEditorRef.current) {
@@ -18098,7 +18132,7 @@ function VariableSettings(props) {
18098
18132
  }
18099
18133
  }
18100
18134
  }, [editor, nodeKey, nestedEditorId]);
18101
- const variablesMenu = (0, import_react109.useMemo)(() => {
18135
+ const variablesMenu = (0, import_react110.useMemo)(() => {
18102
18136
  return variableList.map((variableItem) => {
18103
18137
  return {
18104
18138
  id: variableItem,
@@ -18142,7 +18176,7 @@ function VariableSettings(props) {
18142
18176
  number: "Number",
18143
18177
  text: "Text"
18144
18178
  };
18145
- const variableTypesMenu = (0, import_react109.useMemo)(() => {
18179
+ const variableTypesMenu = (0, import_react110.useMemo)(() => {
18146
18180
  return VariableTypes.map((typeItem) => {
18147
18181
  return {
18148
18182
  id: typeItem,
@@ -18176,7 +18210,7 @@ function VariableSettings(props) {
18176
18210
  };
18177
18211
  });
18178
18212
  }, [currentVariableNode]);
18179
- const variableFormatsMenu = (0, import_react109.useMemo)(() => {
18213
+ const variableFormatsMenu = (0, import_react110.useMemo)(() => {
18180
18214
  return VariableFormats.map((formatItem) => {
18181
18215
  return {
18182
18216
  id: formatItem,
@@ -18270,8 +18304,8 @@ function VariableSettings(props) {
18270
18304
  if (!currentVariableNode) {
18271
18305
  return null;
18272
18306
  }
18273
- return /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)(import_jsx_runtime129.Fragment, { children: [
18274
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { style: formFieldStyle, children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
18307
+ return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_jsx_runtime130.Fragment, { children: [
18308
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { style: formFieldStyle, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
18275
18309
  Button,
18276
18310
  {
18277
18311
  className: "button__fullwidth",
@@ -18290,10 +18324,10 @@ function VariableSettings(props) {
18290
18324
  variant: "default"
18291
18325
  }
18292
18326
  ) }),
18293
- /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { style: formFieldStyle, children: [
18294
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { style: formFieldLabel, children: "Name" }),
18295
- /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { style: controlGridStyle, children: [
18296
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { style: { flexGrow: 1 }, children: isSettingsEditingMode ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
18327
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { style: formFieldStyle, children: [
18328
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { style: formFieldLabel, children: "Name" }),
18329
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { style: controlGridStyle, children: [
18330
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { style: { flexGrow: 1 }, children: isSettingsEditingMode ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
18297
18331
  "form",
18298
18332
  {
18299
18333
  onSubmit: (e) => {
@@ -18301,7 +18335,7 @@ function VariableSettings(props) {
18301
18335
  e.preventDefault();
18302
18336
  updateVariableName();
18303
18337
  },
18304
- children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
18338
+ children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
18305
18339
  TextInput,
18306
18340
  {
18307
18341
  ref: variableNameInputRef,
@@ -18313,7 +18347,7 @@ function VariableSettings(props) {
18313
18347
  }
18314
18348
  )
18315
18349
  }
18316
- ) : /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
18350
+ ) : /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
18317
18351
  DropdownButton,
18318
18352
  {
18319
18353
  className: "button__fullwidth button__left_aligned",
@@ -18326,7 +18360,7 @@ function VariableSettings(props) {
18326
18360
  menu: variablesMenu
18327
18361
  }
18328
18362
  ) }),
18329
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { style: { flexGrow: 0 }, children: isSettingsEditingMode ? /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
18363
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { style: { flexGrow: 0 }, children: isSettingsEditingMode ? /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
18330
18364
  Button,
18331
18365
  {
18332
18366
  StartIcon: import_lucide_react28.Save,
@@ -18334,7 +18368,7 @@ function VariableSettings(props) {
18334
18368
  size: "small",
18335
18369
  onClick: updateVariableName
18336
18370
  }
18337
- ) : /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
18371
+ ) : /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
18338
18372
  Button,
18339
18373
  {
18340
18374
  StartIcon: import_lucide_react28.Pencil,
@@ -18347,9 +18381,9 @@ function VariableSettings(props) {
18347
18381
  ) })
18348
18382
  ] })
18349
18383
  ] }),
18350
- /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { style: formFieldStyle, children: [
18351
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { style: formFieldLabel, children: "Type" }),
18352
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
18384
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { style: formFieldStyle, children: [
18385
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { style: formFieldLabel, children: "Type" }),
18386
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
18353
18387
  DropdownButton,
18354
18388
  {
18355
18389
  className: "button__fullwidth button__left_aligned",
@@ -18363,9 +18397,9 @@ function VariableSettings(props) {
18363
18397
  }
18364
18398
  )
18365
18399
  ] }),
18366
- currentVariableNode.getVariableFormat() && /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { style: formFieldStyle, children: [
18367
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { style: formFieldLabel, children: "Format" }),
18368
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
18400
+ currentVariableNode.getVariableFormat() && /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)("div", { style: formFieldStyle, children: [
18401
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { style: formFieldLabel, children: "Format" }),
18402
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
18369
18403
  DropdownButton,
18370
18404
  {
18371
18405
  className: "button__fullwidth button__left_aligned",
@@ -18379,7 +18413,7 @@ function VariableSettings(props) {
18379
18413
  }
18380
18414
  )
18381
18415
  ] }),
18382
- /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("div", { style: { width: "100%", display: "f" }, children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(
18416
+ /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { style: { width: "100%", display: "f" }, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
18383
18417
  Button,
18384
18418
  {
18385
18419
  size: "small",
@@ -18421,7 +18455,7 @@ function VariableSettings(props) {
18421
18455
  }
18422
18456
 
18423
18457
  // src/plugins/VariablesPlugin/VariableSettingsPlugin.tsx
18424
- var import_jsx_runtime130 = require("react/jsx-runtime");
18458
+ var import_jsx_runtime131 = require("react/jsx-runtime");
18425
18459
  function VariableSettingsPlugin() {
18426
18460
  const {
18427
18461
  registerSettingsPanel,
@@ -18429,8 +18463,8 @@ function VariableSettingsPlugin() {
18429
18463
  drawer,
18430
18464
  toggleSettingsPanelSwitch
18431
18465
  } = useBlockEditor();
18432
- const settingsPanelStickyRef = (0, import_react110.useRef)(null);
18433
- (0, import_react110.useEffect)(() => {
18466
+ const settingsPanelStickyRef = (0, import_react111.useRef)(null);
18467
+ (0, import_react111.useEffect)(() => {
18434
18468
  if (isBlockEditorReady) {
18435
18469
  if (settingsPanelStickyRef.current) {
18436
18470
  registerSettingsPanel(
@@ -18440,20 +18474,20 @@ function VariableSettingsPlugin() {
18440
18474
  }
18441
18475
  }
18442
18476
  }, [isBlockEditorReady]);
18443
- return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_jsx_runtime130.Fragment, { children: drawer && /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
18477
+ return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_jsx_runtime131.Fragment, { children: drawer && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
18444
18478
  StickyToPosition,
18445
18479
  {
18446
18480
  ref: settingsPanelStickyRef,
18447
18481
  container: drawer,
18448
18482
  children: (data, position, isVisible) => {
18449
- return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { style: { width: position.width }, children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
18483
+ return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { style: { width: position.width }, children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
18450
18484
  SettingsCard,
18451
18485
  {
18452
18486
  isVisible: !!isVisible,
18453
18487
  container: drawer,
18454
18488
  title: "Variable Settings",
18455
18489
  onClose: toggleSettingsPanelSwitch,
18456
- children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(
18490
+ children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
18457
18491
  VariableSettings,
18458
18492
  {
18459
18493
  nodeKey: data.nodeKey,
@@ -18474,14 +18508,14 @@ var import_utils39 = require("@lexical/utils");
18474
18508
  var import_lexical103 = require("lexical");
18475
18509
  var import_debounce7 = __toESM(require("lodash-es/debounce"));
18476
18510
  var import_lucide_react29 = require("lucide-react");
18477
- var import_react111 = require("react");
18478
- var import_jsx_runtime131 = require("react/jsx-runtime");
18511
+ var import_react112 = require("react");
18512
+ var import_jsx_runtime132 = require("react/jsx-runtime");
18479
18513
  function VariableToolbarPlugin() {
18480
18514
  const [editor] = (0, import_LexicalComposerContext70.useLexicalComposerContext)();
18481
- const popupToolbarRef = (0, import_react111.useRef)(null);
18482
- const activeEditorRef = (0, import_react111.useRef)();
18483
- const selectedNodeRef = (0, import_react111.useRef)();
18484
- const [toolbarState, setToolbarState] = (0, import_react111.useState)({
18515
+ const popupToolbarRef = (0, import_react112.useRef)(null);
18516
+ const activeEditorRef = (0, import_react112.useRef)();
18517
+ const selectedNodeRef = (0, import_react112.useRef)();
18518
+ const [toolbarState, setToolbarState] = (0, import_react112.useState)({
18485
18519
  isBold: false,
18486
18520
  isItalic: false,
18487
18521
  isUnderline: false
@@ -18556,7 +18590,7 @@ function VariableToolbarPlugin() {
18556
18590
  }
18557
18591
  }
18558
18592
  };
18559
- const repositionPopupToolbar = (0, import_react111.useCallback)(
18593
+ const repositionPopupToolbar = (0, import_react112.useCallback)(
18560
18594
  (0, import_debounce7.default)(() => {
18561
18595
  if (selectedNodeRef.current) {
18562
18596
  if (activeEditorRef.current) {
@@ -18584,7 +18618,7 @@ function VariableToolbarPlugin() {
18584
18618
  }, 10),
18585
18619
  [activeEditorRef.current]
18586
18620
  );
18587
- (0, import_react111.useEffect)(() => {
18621
+ (0, import_react112.useEffect)(() => {
18588
18622
  return (0, import_utils39.mergeRegister)(
18589
18623
  editor.registerCommand(
18590
18624
  VARIABLE_TOOLBAR_SELECTION_CHANGE_COMMAND,
@@ -18624,7 +18658,7 @@ function VariableToolbarPlugin() {
18624
18658
  )
18625
18659
  );
18626
18660
  }, [editor]);
18627
- (0, import_react111.useEffect)(() => {
18661
+ (0, import_react112.useEffect)(() => {
18628
18662
  window.addEventListener("scroll", repositionPopupToolbar);
18629
18663
  window.addEventListener("resize", repositionPopupToolbar);
18630
18664
  return () => {
@@ -18632,7 +18666,7 @@ function VariableToolbarPlugin() {
18632
18666
  window.removeEventListener("scroll", repositionPopupToolbar);
18633
18667
  };
18634
18668
  }, []);
18635
- const menuItems = (0, import_react111.useMemo)(() => {
18669
+ const menuItems = (0, import_react112.useMemo)(() => {
18636
18670
  const plt = getOperatingSystem();
18637
18671
  const resultList = [
18638
18672
  {
@@ -18668,30 +18702,30 @@ function VariableToolbarPlugin() {
18668
18702
  ];
18669
18703
  return resultList;
18670
18704
  }, [toolbarState]);
18671
- return /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(PopupToolbar, { ref: popupToolbarRef, menu: menuItems });
18705
+ return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(PopupToolbar, { ref: popupToolbarRef, menu: menuItems });
18672
18706
  }
18673
18707
 
18674
18708
  // src/modules/Variables.tsx
18675
- var import_react112 = require("react");
18676
- var import_jsx_runtime132 = require("react/jsx-runtime");
18709
+ var import_react113 = require("react");
18710
+ var import_jsx_runtime133 = require("react/jsx-runtime");
18677
18711
  function Variables(props) {
18678
18712
  const { variablesSettings } = props;
18679
18713
  const { registerModule, setEditingModeDataCallback } = useBlockEditor();
18680
- (0, import_react112.useEffect)(() => {
18714
+ (0, import_react113.useEffect)(() => {
18681
18715
  registerModule("Variables");
18682
18716
  }, [registerModule]);
18683
- (0, import_react112.useEffect)(() => {
18717
+ (0, import_react113.useEffect)(() => {
18684
18718
  setEditingModeDataCallback(() => {
18685
18719
  return {
18686
18720
  variableValues: variablesSettings.getVariableValues()
18687
18721
  };
18688
18722
  });
18689
18723
  }, [variablesSettings, setEditingModeDataCallback]);
18690
- return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(VariablesProvider, { variablesSettings, children: [
18691
- /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(TypeaheadVariablePlugin, {}),
18692
- /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(VariableSettingsPlugin, {}),
18693
- /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(VariableToolbarPlugin, {}),
18694
- /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(VariableToolbarAgentPlugin, {})
18724
+ return /* @__PURE__ */ (0, import_jsx_runtime133.jsxs)(VariablesProvider, { variablesSettings, children: [
18725
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(TypeaheadVariablePlugin, {}),
18726
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(VariableSettingsPlugin, {}),
18727
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(VariableToolbarPlugin, {}),
18728
+ /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(VariableToolbarAgentPlugin, {})
18695
18729
  ] });
18696
18730
  }
18697
18731
  // Annotate the CommonJS export names for ESM import in node: