@burger-editor/client 4.0.0-alpha.76 → 4.0.0-alpha.77

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 (44) hide show
  1. package/dist/burger-editor-root.d.ts +1 -1
  2. package/dist/client.js +10554 -10286
  3. package/dist/client.js.map +1 -1
  4. package/dist/components/block-catalog.d.ts +1 -1
  5. package/dist/components/block-menu-button.d.ts +1 -1
  6. package/dist/components/block-menu-view.d.ts +1 -1
  7. package/dist/components/block-menu.d.ts +1 -1
  8. package/dist/components/block-menu.d.ts.map +1 -1
  9. package/dist/components/block-options.d.ts +1 -1
  10. package/dist/components/draft-switcher.d.ts +1 -1
  11. package/dist/components/editable-area-view.d.ts +1 -1
  12. package/dist/components/editable-area-view.d.ts.map +1 -1
  13. package/dist/components/file-list.d.ts +1 -1
  14. package/dist/components/file-uploader.d.ts +1 -1
  15. package/dist/components/front-matter-editor.d.ts +1 -1
  16. package/dist/components/initial-insertion-button.d.ts +1 -1
  17. package/dist/components/item-editor-host.d.ts +1 -1
  18. package/dist/components/preview.d.ts +1 -1
  19. package/dist/components/table-editor.d.ts +1 -1
  20. package/dist/components/tabs.d.ts +1 -1
  21. package/dist/components/thumbnail.d.ts +1 -1
  22. package/dist/components/wysiwyg-field.d.ts +1 -1
  23. package/dist/{editable-area-view-S2Uz7pl8.js → editable-area-view-BRYT222Y.js} +174 -159
  24. package/dist/editable-area-view-BRYT222Y.js.map +1 -0
  25. package/dist/editor-dialog.d.ts +1 -1
  26. package/dist/{engine-context-D0zt6fhJ.js → engine-context-j4-LLPEh.js} +201 -74
  27. package/dist/engine-context-j4-LLPEh.js.map +1 -0
  28. package/dist/engine-context.d.ts +9 -6
  29. package/dist/engine-context.d.ts.map +1 -1
  30. package/dist/form/checkbox.d.ts +1 -1
  31. package/dist/form/fieldset.d.ts +1 -1
  32. package/dist/form/number-field.d.ts +1 -1
  33. package/dist/form/radio-group.d.ts +1 -1
  34. package/dist/form/select-field.d.ts +1 -1
  35. package/dist/form/text-area.d.ts +1 -1
  36. package/dist/form/text-field.d.ts +1 -1
  37. package/dist/root-error-boundary.d.ts +1 -1
  38. package/dist/testing/render-with-engine.d.ts +1 -1
  39. package/dist/testing.js +1 -1
  40. package/dist/ui.js +10 -10
  41. package/dist/ui.js.map +1 -1
  42. package/package.json +11 -11
  43. package/dist/editable-area-view-S2Uz7pl8.js.map +0 -1
  44. package/dist/engine-context-D0zt6fhJ.js.map +0 -1
@@ -1,6 +1,6 @@
1
- import { f as CSS_LAYER, l as Item, n as useEngine, o as createBgeEvent, r as getBlockAtPosition, s as beginProcessing } from "./engine-context-D0zt6fhJ.js";
1
+ import { f as CSS_LAYER, l as Item, n as useEngine, o as createBgeEvent, r as getBlockAtPosition, s as beginProcessing } from "./engine-context-j4-LLPEh.js";
2
2
  import { c } from "react/compiler-runtime";
3
- import { Component, Fragment, Suspense, createContext, createElement, forwardRef, useActionState, useEffect, useEffectEvent, useId, useRef, useState } from "react";
3
+ import { Component, Fragment, Suspense, createContext, createElement, forwardRef, useActionState, useEffect, useEffectEvent, useId, useMemo, useRef, useState } from "react";
4
4
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
5
5
  import { useSyncExternalStoreWithSelector } from "use-sync-external-store/shim/with-selector";
6
6
  import { createRoot } from "react-dom/client";
@@ -71,7 +71,7 @@ var BGE_COMMAND = {
71
71
  //#endregion
72
72
  //#region ../../../node_modules/@tabler/icons-react/dist/esm/defaultAttributes.mjs
73
73
  /**
74
- * @license @tabler/icons-react v3.46.0 - MIT
74
+ * @license @tabler/icons-react v3.48.0 - MIT
75
75
  *
76
76
  * This source code is licensed under the MIT license.
77
77
  * See the LICENSE file in the root directory of this source tree.
@@ -100,7 +100,7 @@ var defaultAttributes = {
100
100
  //#endregion
101
101
  //#region ../../../node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs
102
102
  /**
103
- * @license @tabler/icons-react v3.46.0 - MIT
103
+ * @license @tabler/icons-react v3.48.0 - MIT
104
104
  *
105
105
  * This source code is licensed under the MIT license.
106
106
  * See the LICENSE file in the root directory of this source tree.
@@ -115,7 +115,7 @@ var createReactComponent = (type, iconName, iconNamePascal, iconNode) => {
115
115
  `tabler-icon`,
116
116
  `tabler-icon-${iconName}`,
117
117
  className
118
- ].join(" "),
118
+ ].filter(Boolean).join(" "),
119
119
  ...type === "filled" ? { fill: color } : {
120
120
  strokeWidth: stroke,
121
121
  stroke: color
@@ -130,7 +130,7 @@ var createReactComponent = (type, iconName, iconNamePascal, iconNode) => {
130
130
  return Component;
131
131
  };
132
132
  /**
133
- * @license @tabler/icons-react v3.46.0 - MIT
133
+ * @license @tabler/icons-react v3.48.0 - MIT
134
134
  *
135
135
  * This source code is licensed under the MIT license.
136
136
  * See the LICENSE file in the root directory of this source tree.
@@ -143,7 +143,7 @@ var IconArrowBigDownLine = createReactComponent("outline", "arrow-big-down-line"
143
143
  "key": "svg-1"
144
144
  }]]);
145
145
  /**
146
- * @license @tabler/icons-react v3.46.0 - MIT
146
+ * @license @tabler/icons-react v3.48.0 - MIT
147
147
  *
148
148
  * This source code is licensed under the MIT license.
149
149
  * See the LICENSE file in the root directory of this source tree.
@@ -156,7 +156,7 @@ var IconArrowBigUpLine = createReactComponent("outline", "arrow-big-up-line", "A
156
156
  "key": "svg-1"
157
157
  }]]);
158
158
  /**
159
- * @license @tabler/icons-react v3.46.0 - MIT
159
+ * @license @tabler/icons-react v3.48.0 - MIT
160
160
  *
161
161
  * This source code is licensed under the MIT license.
162
162
  * See the LICENSE file in the root directory of this source tree.
@@ -180,7 +180,7 @@ var IconClipboardPlus = createReactComponent("outline", "clipboard-plus", "Clipb
180
180
  }]
181
181
  ]);
182
182
  /**
183
- * @license @tabler/icons-react v3.46.0 - MIT
183
+ * @license @tabler/icons-react v3.48.0 - MIT
184
184
  *
185
185
  * This source code is licensed under the MIT license.
186
186
  * See the LICENSE file in the root directory of this source tree.
@@ -193,7 +193,7 @@ var IconClipboard = createReactComponent("outline", "clipboard", "Clipboard", [[
193
193
  "key": "svg-1"
194
194
  }]]);
195
195
  /**
196
- * @license @tabler/icons-react v3.46.0 - MIT
196
+ * @license @tabler/icons-react v3.48.0 - MIT
197
197
  *
198
198
  * This source code is licensed under the MIT license.
199
199
  * See the LICENSE file in the root directory of this source tree.
@@ -217,7 +217,7 @@ var IconLayoutGridAdd = createReactComponent("outline", "layout-grid-add", "Layo
217
217
  }]
218
218
  ]);
219
219
  /**
220
- * @license @tabler/icons-react v3.46.0 - MIT
220
+ * @license @tabler/icons-react v3.48.0 - MIT
221
221
  *
222
222
  * This source code is licensed under the MIT license.
223
223
  * See the LICENSE file in the root directory of this source tree.
@@ -241,7 +241,7 @@ var IconLayoutGridRemove = createReactComponent("outline", "layout-grid-remove",
241
241
  }]
242
242
  ]);
243
243
  /**
244
- * @license @tabler/icons-react v3.46.0 - MIT
244
+ * @license @tabler/icons-react v3.48.0 - MIT
245
245
  *
246
246
  * This source code is licensed under the MIT license.
247
247
  * See the LICENSE file in the root directory of this source tree.
@@ -261,7 +261,7 @@ var IconRowInsertBottom = createReactComponent("outline", "row-insert-bottom", "
261
261
  }]
262
262
  ]);
263
263
  /**
264
- * @license @tabler/icons-react v3.46.0 - MIT
264
+ * @license @tabler/icons-react v3.48.0 - MIT
265
265
  *
266
266
  * This source code is licensed under the MIT license.
267
267
  * See the LICENSE file in the root directory of this source tree.
@@ -281,7 +281,7 @@ var IconRowInsertTop = createReactComponent("outline", "row-insert-top", "RowIns
281
281
  }]
282
282
  ]);
283
283
  /**
284
- * @license @tabler/icons-react v3.46.0 - MIT
284
+ * @license @tabler/icons-react v3.48.0 - MIT
285
285
  *
286
286
  * This source code is licensed under the MIT license.
287
287
  * See the LICENSE file in the root directory of this source tree.
@@ -294,7 +294,7 @@ var IconSettings = createReactComponent("outline", "settings", "Settings", [["pa
294
294
  "key": "svg-1"
295
295
  }]]);
296
296
  /**
297
- * @license @tabler/icons-react v3.46.0 - MIT
297
+ * @license @tabler/icons-react v3.48.0 - MIT
298
298
  *
299
299
  * This source code is licensed under the MIT license.
300
300
  * See the LICENSE file in the root directory of this source tree.
@@ -835,14 +835,26 @@ function _temp$4(t0) {
835
835
  }
836
836
  //#endregion
837
837
  //#region ../../../node_modules/react-error-boundary/dist/react-error-boundary.js
838
- var h = createContext(null);
839
- var c$1 = {
838
+ var f = createContext(null);
839
+ function m({ children: r, didCatch: e, error: t, resetErrorBoundary: o }) {
840
+ const n = useMemo(() => ({
841
+ didCatch: e,
842
+ error: t,
843
+ resetErrorBoundary: o
844
+ }), [
845
+ e,
846
+ t,
847
+ o
848
+ ]);
849
+ return createElement(f.Provider, { value: n }, r);
850
+ }
851
+ var d = {
840
852
  didCatch: !1,
841
853
  error: null
842
854
  };
843
- var m = class extends Component {
855
+ var C = class extends Component {
844
856
  constructor(e) {
845
- super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = c$1;
857
+ super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = d;
846
858
  }
847
859
  static getDerivedStateFromError(e) {
848
860
  return {
@@ -855,40 +867,40 @@ var m = class extends Component {
855
867
  t && (this.props.onReset?.({
856
868
  args: e,
857
869
  reason: "imperative-api"
858
- }), this.setState(c$1));
870
+ }), this.setState(d));
859
871
  }
860
872
  componentDidCatch(e, t) {
861
873
  this.props.onError?.(e, t);
862
874
  }
863
875
  componentDidUpdate(e, t) {
864
- const { didCatch: o } = this.state, { resetKeys: s } = this.props;
865
- o && t.didCatch && C(e.resetKeys, s) && (this.props.onReset?.({
866
- next: s,
876
+ const { didCatch: o } = this.state, { resetKeys: n } = this.props;
877
+ o && t.didCatch && g(e.resetKeys, n) && (this.props.onReset?.({
878
+ next: n,
867
879
  prev: e.resetKeys,
868
880
  reason: "keys"
869
- }), this.setState(c$1));
881
+ }), this.setState(d));
870
882
  }
871
883
  render() {
872
- const { children: e, fallbackRender: t, FallbackComponent: o, fallback: s } = this.props, { didCatch: n, error: a } = this.state;
873
- let i = e;
874
- if (n) {
884
+ const { children: e, fallbackRender: t, FallbackComponent: o, fallback: n } = this.props, { didCatch: s, error: a } = this.state;
885
+ let c = e;
886
+ if (s) {
875
887
  const u = {
876
888
  error: a,
877
889
  resetErrorBoundary: this.resetErrorBoundary
878
890
  };
879
- if (typeof t == "function") i = t(u);
880
- else if (o) i = createElement(o, u);
881
- else if (s !== void 0) i = s;
891
+ if (typeof t == "function") c = t(u);
892
+ else if (o) c = createElement(o, u);
893
+ else if ("fallback" in this.props) c = n;
882
894
  else throw a;
883
895
  }
884
- return createElement(h.Provider, { value: {
885
- didCatch: n,
896
+ return createElement(m, {
897
+ didCatch: s,
886
898
  error: a,
887
899
  resetErrorBoundary: this.resetErrorBoundary
888
- } }, i);
900
+ }, c);
889
901
  }
890
902
  };
891
- function C(r = [], e = []) {
903
+ function g(r = [], e = []) {
892
904
  return r.length !== e.length || r.some((t, o) => !Object.is(t, e[o]));
893
905
  }
894
906
  //#endregion
@@ -1090,7 +1102,7 @@ function EditorDialogBody({ name, formId, dialogId, open, action, buttons, child
1090
1102
  autoCapitalize: "off",
1091
1103
  children: [/* @__PURE__ */ jsx("div", {
1092
1104
  "data-bge-component": `${name}-dialog`,
1093
- children: open ? /* @__PURE__ */ jsx(m, {
1105
+ children: open ? /* @__PURE__ */ jsx(C, {
1094
1106
  FallbackComponent: DialogErrorFallback,
1095
1107
  children: /* @__PURE__ */ jsx(Suspense, {
1096
1108
  fallback: /* @__PURE__ */ jsx(DialogSkeleton, {}),
@@ -1791,7 +1803,7 @@ function RootErrorBoundary(t0) {
1791
1803
  const { children } = t0;
1792
1804
  let t1;
1793
1805
  if ($[0] !== children) {
1794
- t1 = /* @__PURE__ */ jsx(m, {
1806
+ t1 = /* @__PURE__ */ jsx(C, {
1795
1807
  FallbackComponent: RootErrorFallback,
1796
1808
  children
1797
1809
  });
@@ -2413,9 +2425,14 @@ function BlockMenu(t0) {
2413
2425
  const doc = container.ownerDocument;
2414
2426
  const body = doc.body;
2415
2427
  const win = doc.defaultView;
2428
+ const stack = new DisposableStack();
2429
+ const listeners = new AbortController();
2430
+ const { signal } = listeners;
2416
2431
  let mouseX = 0;
2417
2432
  let mouseY = 0;
2418
2433
  let raf = 0;
2434
+ stack.defer(() => cancelAnimationFrame(raf));
2435
+ stack.defer(() => listeners.abort());
2419
2436
  const updatePosition = () => {
2420
2437
  const selected = getBlockAtPosition(doc, mouseX, mouseY);
2421
2438
  if (!selected) {
@@ -2447,6 +2464,7 @@ function BlockMenu(t0) {
2447
2464
  engine.setCurrentBlock(block);
2448
2465
  };
2449
2466
  const scheduleUpdate = () => {
2467
+ if (signal.aborted) return;
2450
2468
  cancelAnimationFrame(raf);
2451
2469
  if (engine.isProcessed) {
2452
2470
  hide();
@@ -2462,16 +2480,17 @@ function BlockMenu(t0) {
2462
2480
  scheduleUpdate();
2463
2481
  };
2464
2482
  const onHideEvent = () => hide();
2465
- body.addEventListener("mousemove", onMouseMove);
2466
- body.addEventListener("mouseleave", onHideEvent);
2467
- doc.addEventListener("mouseleave", onHideEvent);
2468
- win?.addEventListener("mouseleave", onHideEvent);
2469
- globalThis.addEventListener("resize", onHideEvent);
2470
- engine.el.addEventListener("bge:saved", scheduleUpdate);
2483
+ body.addEventListener("mousemove", onMouseMove, { signal });
2484
+ body.addEventListener("mouseleave", onHideEvent, { signal });
2485
+ doc.addEventListener("mouseleave", onHideEvent, { signal });
2486
+ win?.addEventListener("mouseleave", onHideEvent, { signal });
2487
+ globalThis.addEventListener("resize", onHideEvent, { signal });
2488
+ engine.el.addEventListener("bge:saved", scheduleUpdate, { signal });
2471
2489
  const observer = new MutationObserver((mutations) => {
2472
2490
  for (const mutation of mutations) for (const node of mutation.addedNodes) {
2473
- if (!(node instanceof HTMLElement)) continue;
2474
- const images = node.querySelectorAll("img");
2491
+ if (node.nodeType !== Node.ELEMENT_NODE) continue;
2492
+ const element = node;
2493
+ const images = element.matches("img") ? [element] : element.querySelectorAll("img");
2475
2494
  for (const img of images) {
2476
2495
  img.addEventListener("load", scheduleUpdate, { once: true });
2477
2496
  img.addEventListener("error", scheduleUpdate, { once: true });
@@ -2483,16 +2502,8 @@ function BlockMenu(t0) {
2483
2502
  childList: true,
2484
2503
  subtree: true
2485
2504
  });
2486
- return () => {
2487
- body.removeEventListener("mousemove", onMouseMove);
2488
- body.removeEventListener("mouseleave", onHideEvent);
2489
- doc.removeEventListener("mouseleave", onHideEvent);
2490
- win?.removeEventListener("mouseleave", onHideEvent);
2491
- globalThis.removeEventListener("resize", onHideEvent);
2492
- engine.el.removeEventListener("bge:saved", scheduleUpdate);
2493
- observer.disconnect();
2494
- cancelAnimationFrame(raf);
2495
- };
2505
+ stack.defer(() => observer.disconnect());
2506
+ return () => stack.dispose();
2496
2507
  };
2497
2508
  $[14] = container.ownerDocument;
2498
2509
  $[15] = engine;
@@ -2619,7 +2630,7 @@ var CONTENT_ID = "bge-editable-area";
2619
2630
  * ```
2620
2631
  */
2621
2632
  function EditableAreaView(t0) {
2622
- const $ = c(60);
2633
+ const $ = c(61);
2623
2634
  const { type, initialContent, stylesheets, classList, onReady } = t0;
2624
2635
  const engine = useEngine();
2625
2636
  let t1;
@@ -2647,9 +2658,9 @@ function EditableAreaView(t0) {
2647
2658
  } else t3 = $[5];
2648
2659
  const [isEmpty, setIsEmpty] = useState(t3 === "");
2649
2660
  const [height, setHeight] = useState(0);
2650
- const [frameBody, setFrameBody] = useState(null);
2661
+ const [containerElement, setContainerElement] = useState(null);
2662
+ const frameBody = containerElement?.ownerDocument.body ?? null;
2651
2663
  const initializedRef = useRef(false);
2652
- const resizeObserverRef = useRef(null);
2653
2664
  let t4;
2654
2665
  if ($[6] !== classList || $[7] !== engine.commandBus || $[8] !== onReady || $[9] !== stylesheets) {
2655
2666
  t4 = (iframe) => {
@@ -2695,27 +2706,18 @@ function EditableAreaView(t0) {
2695
2706
  frameDoc.head.append(injectedUiStyle);
2696
2707
  frameDoc.body.setAttribute("style", "margin: 0; border: 0;");
2697
2708
  engine.commandBus.createReceiver(frameDoc.body);
2698
- const containerElement = frameDoc.createElement("div");
2699
- containerElement.id = CONTENT_ID;
2700
- containerElement.style.setProperty("padding", `${CONTAINER_PADDING}px`, "important");
2701
- containerElement.style.setProperty("overflow", "hidden", "important");
2702
- containerElement.style.setProperty("margin", "0", "important");
2703
- containerElement.style.setProperty("box-sizing", "border-box", "important");
2704
- containerElement.classList.add(...classList);
2705
- containerElement.dataset.bgeComponent = "editable-area";
2706
- frameDoc.body.append(containerElement);
2707
- if (typeof ResizeObserver !== "undefined") {
2708
- const observer = new ResizeObserver(() => {
2709
- requestAnimationFrame(() => {
2710
- setHeight(containerElement.getBoundingClientRect().height + 20);
2711
- });
2712
- });
2713
- observer.observe(containerElement);
2714
- resizeObserverRef.current = observer;
2715
- }
2716
- setFrameBody(frameDoc.body);
2709
+ const content = frameDoc.createElement("div");
2710
+ content.id = CONTENT_ID;
2711
+ content.style.setProperty("padding", `${CONTAINER_PADDING}px`, "important");
2712
+ content.style.setProperty("overflow", "hidden", "important");
2713
+ content.style.setProperty("margin", "0", "important");
2714
+ content.style.setProperty("box-sizing", "border-box", "important");
2715
+ content.classList.add(...classList);
2716
+ content.dataset.bgeComponent = "editable-area";
2717
+ frameDoc.body.append(content);
2718
+ setContainerElement(content);
2717
2719
  onReady({
2718
- containerElement,
2720
+ containerElement: content,
2719
2721
  animateInsertion
2720
2722
  });
2721
2723
  };
@@ -2728,20 +2730,33 @@ function EditableAreaView(t0) {
2728
2730
  const initFrame = t4;
2729
2731
  let t5;
2730
2732
  let t6;
2731
- if ($[11] === Symbol.for("react.memo_cache_sentinel")) {
2732
- t5 = () => () => {
2733
- resizeObserverRef.current?.disconnect();
2733
+ if ($[11] !== containerElement) {
2734
+ t5 = () => {
2735
+ if (!containerElement || typeof ResizeObserver === "undefined") return;
2736
+ const stack = new DisposableStack();
2737
+ let raf = 0;
2738
+ stack.defer(() => cancelAnimationFrame(raf));
2739
+ const observer = new ResizeObserver(() => {
2740
+ cancelAnimationFrame(raf);
2741
+ raf = requestAnimationFrame(() => {
2742
+ setHeight(containerElement.getBoundingClientRect().height + 20);
2743
+ });
2744
+ });
2745
+ observer.observe(containerElement);
2746
+ stack.defer(() => observer.disconnect());
2747
+ return () => stack.dispose();
2734
2748
  };
2735
- t6 = [];
2736
- $[11] = t5;
2737
- $[12] = t6;
2749
+ t6 = [containerElement];
2750
+ $[11] = containerElement;
2751
+ $[12] = t5;
2752
+ $[13] = t6;
2738
2753
  } else {
2739
- t5 = $[11];
2740
- t6 = $[12];
2754
+ t5 = $[12];
2755
+ t6 = $[13];
2741
2756
  }
2742
2757
  useEffect(t5, t6);
2743
2758
  let t7;
2744
- if ($[13] !== engine.el || $[14] !== type) {
2759
+ if ($[14] !== engine.el || $[15] !== type) {
2745
2760
  t7 = () => {
2746
2761
  const onSaved = (e) => {
2747
2762
  const value = type === "main" ? e.detail.main : e.detail.draft ?? "";
@@ -2753,27 +2768,27 @@ function EditableAreaView(t0) {
2753
2768
  engine.el.removeEventListener("bge:saved", onSaved);
2754
2769
  };
2755
2770
  };
2756
- $[13] = engine.el;
2757
- $[14] = type;
2758
- $[15] = t7;
2759
- } else t7 = $[15];
2771
+ $[14] = engine.el;
2772
+ $[15] = type;
2773
+ $[16] = t7;
2774
+ } else t7 = $[16];
2760
2775
  let t8;
2761
- if ($[16] !== engine || $[17] !== type) {
2776
+ if ($[17] !== engine || $[18] !== type) {
2762
2777
  t8 = [engine, type];
2763
- $[16] = engine;
2764
- $[17] = type;
2765
- $[18] = t8;
2766
- } else t8 = $[18];
2778
+ $[17] = engine;
2779
+ $[18] = type;
2780
+ $[19] = t8;
2781
+ } else t8 = $[19];
2767
2782
  useEffect(t7, t8);
2768
2783
  let t9;
2769
- if ($[19] !== sourceText) {
2784
+ if ($[20] !== sourceText) {
2770
2785
  t9 = () => sourceText;
2771
- $[19] = sourceText;
2772
- $[20] = t9;
2773
- } else t9 = $[20];
2786
+ $[20] = sourceText;
2787
+ $[21] = t9;
2788
+ } else t9 = $[21];
2774
2789
  const getPendingSourceText = useEffectEvent(t9);
2775
2790
  let t10;
2776
- if ($[21] !== engine || $[22] !== type) {
2791
+ if ($[22] !== engine || $[23] !== type) {
2777
2792
  t10 = (value_0) => {
2778
2793
  engine.commitSourceEdit(type, value_0).then(() => {
2779
2794
  const committed = engine.getEditableContent(type)?.getContentsAsString() ?? "";
@@ -2781,10 +2796,10 @@ function EditableAreaView(t0) {
2781
2796
  setIsEmpty(committed.trim() === "");
2782
2797
  });
2783
2798
  };
2784
- $[21] = engine;
2785
- $[22] = type;
2786
- $[23] = t10;
2787
- } else t10 = $[23];
2799
+ $[22] = engine;
2800
+ $[23] = type;
2801
+ $[24] = t10;
2802
+ } else t10 = $[24];
2788
2803
  const commitSource = t10;
2789
2804
  const [prevSourceMode, setPrevSourceMode] = useState(sourceMode);
2790
2805
  if (sourceMode !== prevSourceMode) {
@@ -2797,7 +2812,7 @@ function EditableAreaView(t0) {
2797
2812
  }
2798
2813
  const wasSourceModeRef = useRef(sourceMode);
2799
2814
  let t11;
2800
- if ($[24] !== engine || $[25] !== getPendingSourceText || $[26] !== sourceMode || $[27] !== type) {
2815
+ if ($[25] !== engine || $[26] !== getPendingSourceText || $[27] !== sourceMode || $[28] !== type) {
2801
2816
  t11 = () => {
2802
2817
  const wasSourceMode = wasSourceModeRef.current;
2803
2818
  wasSourceModeRef.current = sourceMode;
@@ -2813,24 +2828,24 @@ function EditableAreaView(t0) {
2813
2828
  cancelled = true;
2814
2829
  };
2815
2830
  };
2816
- $[24] = engine;
2817
- $[25] = getPendingSourceText;
2818
- $[26] = sourceMode;
2819
- $[27] = type;
2820
- $[28] = t11;
2821
- } else t11 = $[28];
2831
+ $[25] = engine;
2832
+ $[26] = getPendingSourceText;
2833
+ $[27] = sourceMode;
2834
+ $[28] = type;
2835
+ $[29] = t11;
2836
+ } else t11 = $[29];
2822
2837
  let t12;
2823
- if ($[29] !== engine || $[30] !== sourceMode || $[31] !== type) {
2838
+ if ($[30] !== engine || $[31] !== sourceMode || $[32] !== type) {
2824
2839
  t12 = [
2825
2840
  engine,
2826
2841
  type,
2827
2842
  sourceMode
2828
2843
  ];
2829
- $[29] = engine;
2830
- $[30] = sourceMode;
2831
- $[31] = type;
2832
- $[32] = t12;
2833
- } else t12 = $[32];
2844
+ $[30] = engine;
2845
+ $[31] = sourceMode;
2846
+ $[32] = type;
2847
+ $[33] = t12;
2848
+ } else t12 = $[33];
2834
2849
  useEffect(t11, t12);
2835
2850
  const t13 = `${type}-editable-area`;
2836
2851
  const t14 = sourceMode ? "source" : "visual";
@@ -2838,18 +2853,18 @@ function EditableAreaView(t0) {
2838
2853
  const t16 = !sourceMode;
2839
2854
  const t17 = !sourceMode;
2840
2855
  let t18;
2841
- if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
2856
+ if ($[34] === Symbol.for("react.memo_cache_sentinel")) {
2842
2857
  t18 = (e_0) => setSourceText(e_0.currentTarget.value);
2843
- $[33] = t18;
2844
- } else t18 = $[33];
2858
+ $[34] = t18;
2859
+ } else t18 = $[34];
2845
2860
  let t19;
2846
- if ($[34] !== commitSource) {
2861
+ if ($[35] !== commitSource) {
2847
2862
  t19 = (e_1) => commitSource(e_1.currentTarget.value);
2848
- $[34] = commitSource;
2849
- $[35] = t19;
2850
- } else t19 = $[35];
2863
+ $[35] = commitSource;
2864
+ $[36] = t19;
2865
+ } else t19 = $[36];
2851
2866
  let t20;
2852
- if ($[36] !== sourceText || $[37] !== t16 || $[38] !== t17 || $[39] !== t19) {
2867
+ if ($[37] !== sourceText || $[38] !== t16 || $[39] !== t17 || $[40] !== t19) {
2853
2868
  t20 = /* @__PURE__ */ jsx("textarea", {
2854
2869
  "aria-label": "HTMLソース",
2855
2870
  spellCheck: false,
@@ -2859,23 +2874,23 @@ function EditableAreaView(t0) {
2859
2874
  onChange: t18,
2860
2875
  onBlur: t19
2861
2876
  });
2862
- $[36] = sourceText;
2863
- $[37] = t16;
2864
- $[38] = t17;
2865
- $[39] = t19;
2866
- $[40] = t20;
2867
- } else t20 = $[40];
2877
+ $[37] = sourceText;
2878
+ $[38] = t16;
2879
+ $[39] = t17;
2880
+ $[40] = t19;
2881
+ $[41] = t20;
2882
+ } else t20 = $[41];
2868
2883
  const t21 = type === "main" ? "本稿の編集エリア" : "下書きの編集エリア";
2869
2884
  let t22;
2870
- if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
2885
+ if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
2871
2886
  t22 = {
2872
2887
  inlineSize: "100%",
2873
2888
  overflow: "hidden"
2874
2889
  };
2875
- $[41] = t22;
2876
- } else t22 = $[41];
2890
+ $[42] = t22;
2891
+ } else t22 = $[42];
2877
2892
  let t23;
2878
- if ($[42] !== height || $[43] !== initFrame || $[44] !== sourceMode || $[45] !== t21) {
2893
+ if ($[43] !== height || $[44] !== initFrame || $[45] !== sourceMode || $[46] !== t21) {
2879
2894
  t23 = /* @__PURE__ */ jsx("iframe", {
2880
2895
  title: t21,
2881
2896
  loading: "lazy",
@@ -2884,14 +2899,14 @@ function EditableAreaView(t0) {
2884
2899
  hidden: sourceMode,
2885
2900
  ref: initFrame
2886
2901
  });
2887
- $[42] = height;
2888
- $[43] = initFrame;
2889
- $[44] = sourceMode;
2890
- $[45] = t21;
2891
- $[46] = t23;
2892
- } else t23 = $[46];
2902
+ $[43] = height;
2903
+ $[44] = initFrame;
2904
+ $[45] = sourceMode;
2905
+ $[46] = t21;
2906
+ $[47] = t23;
2907
+ } else t23 = $[47];
2893
2908
  let t24;
2894
- if ($[47] !== dialogOpen || $[48] !== engine.commandBus || $[49] !== frameBody || $[50] !== isEmpty || $[51] !== processing) {
2909
+ if ($[48] !== dialogOpen || $[49] !== engine.commandBus || $[50] !== frameBody || $[51] !== isEmpty || $[52] !== processing) {
2895
2910
  t24 = frameBody ? createPortal(/* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
2896
2911
  "data-bge-component": "block-menu",
2897
2912
  children: /* @__PURE__ */ jsx(BlockMenu, { container: frameBody })
@@ -2900,15 +2915,15 @@ function EditableAreaView(t0) {
2900
2915
  hidden: !(isEmpty && !processing && !dialogOpen),
2901
2916
  children: /* @__PURE__ */ jsx(InitialInsertionButton, { commandBusId: engine.commandBus.receiverId })
2902
2917
  })] }), frameBody) : null;
2903
- $[47] = dialogOpen;
2904
- $[48] = engine.commandBus;
2905
- $[49] = frameBody;
2906
- $[50] = isEmpty;
2907
- $[51] = processing;
2908
- $[52] = t24;
2909
- } else t24 = $[52];
2918
+ $[48] = dialogOpen;
2919
+ $[49] = engine.commandBus;
2920
+ $[50] = frameBody;
2921
+ $[51] = isEmpty;
2922
+ $[52] = processing;
2923
+ $[53] = t24;
2924
+ } else t24 = $[53];
2910
2925
  let t25;
2911
- if ($[53] !== t13 || $[54] !== t14 || $[55] !== t15 || $[56] !== t20 || $[57] !== t23 || $[58] !== t24) {
2926
+ if ($[54] !== t13 || $[55] !== t14 || $[56] !== t15 || $[57] !== t20 || $[58] !== t23 || $[59] !== t24) {
2912
2927
  t25 = /* @__PURE__ */ jsxs("div", {
2913
2928
  "data-bge-component": t13,
2914
2929
  "data-bge-component-mode": t14,
@@ -2919,14 +2934,14 @@ function EditableAreaView(t0) {
2919
2934
  t24
2920
2935
  ]
2921
2936
  });
2922
- $[53] = t13;
2923
- $[54] = t14;
2924
- $[55] = t15;
2925
- $[56] = t20;
2926
- $[57] = t23;
2927
- $[58] = t24;
2928
- $[59] = t25;
2929
- } else t25 = $[59];
2937
+ $[54] = t13;
2938
+ $[55] = t14;
2939
+ $[56] = t15;
2940
+ $[57] = t20;
2941
+ $[58] = t23;
2942
+ $[59] = t24;
2943
+ $[60] = t25;
2944
+ } else t25 = $[60];
2930
2945
  return t25;
2931
2946
  }
2932
2947
  function _temp2(s_1) {
@@ -2938,4 +2953,4 @@ function _temp(s_0) {
2938
2953
  //#endregion
2939
2954
  export { IconTrash as _, BlockMenuButton as a, reportRenderError as c, registerEngineCommands as d, useUIState as f, BlockCatalog as g, BlockOptions as h, BlockMenuView as i, reactMount as l, EditorDialog as m, InitialInsertionButton as n, useCommand as o, ItemEditorHost as p, BlockMenu as r, RootErrorBoundary as s, EditableAreaView as t, DraftSwitcher as u, IconRowInsertBottom as v, createReactComponent as y };
2940
2955
 
2941
- //# sourceMappingURL=editable-area-view-S2Uz7pl8.js.map
2956
+ //# sourceMappingURL=editable-area-view-BRYT222Y.js.map