@burger-editor/client 4.0.0-alpha.77 → 4.0.0-alpha.78
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.
- package/README.md +42 -41
- package/dist/block-swap-view-transition-css.d.ts +7 -0
- package/dist/block-swap-view-transition-css.d.ts.map +1 -0
- package/dist/client.css +158 -18
- package/dist/client.js +354 -281
- package/dist/client.js.map +1 -1
- package/dist/components/block-catalog.d.ts.map +1 -1
- package/dist/components/block-menu-anchors.d.ts +25 -0
- package/dist/components/block-menu-anchors.d.ts.map +1 -0
- package/dist/components/block-menu-button.d.ts +7 -2
- package/dist/components/block-menu-button.d.ts.map +1 -1
- package/dist/components/block-menu-view.d.ts +35 -29
- package/dist/components/block-menu-view.d.ts.map +1 -1
- package/dist/components/block-menu.d.ts.map +1 -1
- package/dist/components/block-options.d.ts.map +1 -1
- package/dist/components/editable-area-view.d.ts.map +1 -1
- package/dist/components/front-matter-editor.d.ts +16 -5
- package/dist/components/front-matter-editor.d.ts.map +1 -1
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/thumbnail-button.d.ts +39 -0
- package/dist/components/thumbnail-button.d.ts.map +1 -0
- package/dist/create-mock-engine-BloCpuEu.js +87 -0
- package/dist/create-mock-engine-BloCpuEu.js.map +1 -0
- package/dist/{engine-context-j4-LLPEh.js → dist-DYydjVsL.js} +772 -516
- package/dist/dist-DYydjVsL.js.map +1 -0
- package/dist/{editable-area-view-BRYT222Y.js → editable-area-view-CAeVDyOh.js} +538 -532
- package/dist/editable-area-view-CAeVDyOh.js.map +1 -0
- package/dist/engine-context-oEEsvNSx.js +49 -0
- package/dist/engine-context-oEEsvNSx.js.map +1 -0
- package/dist/form/select-field.d.ts +4 -1
- package/dist/form/select-field.d.ts.map +1 -1
- package/dist/form/text-field.d.ts +11 -1
- package/dist/form/text-field.d.ts.map +1 -1
- package/dist/interest-hints.d.ts +21 -0
- package/dist/interest-hints.d.ts.map +1 -0
- package/dist/replace-element.d.ts +12 -4
- package/dist/replace-element.d.ts.map +1 -1
- package/dist/testing/create-mock-engine.d.ts +3 -0
- package/dist/testing/create-mock-engine.d.ts.map +1 -1
- package/dist/testing-mock-engine.js +1 -0
- package/dist/testing.js +4 -55
- package/dist/testing.js.map +1 -1
- package/dist/ui.d.ts +1 -0
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +267 -160
- package/dist/ui.js.map +1 -1
- package/package.json +25 -21
- package/dist/editable-area-view-BRYT222Y.js.map +0 -1
- package/dist/engine-context-j4-LLPEh.js.map +0 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as beginProcessing, i as createBgeEvent, s as Item, t as getBlockAtPosition, u as CSS_LAYER } from "./dist-DYydjVsL.js";
|
|
2
|
+
import { n as useEngine } from "./engine-context-oEEsvNSx.js";
|
|
2
3
|
import { c } from "react/compiler-runtime";
|
|
3
4
|
import { Component, Fragment, Suspense, createContext, createElement, forwardRef, useActionState, useEffect, useEffectEvent, useId, useMemo, useRef, useState } from "react";
|
|
4
5
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import { useSyncExternalStoreWithSelector } from "use-sync-external-store/shim/with-selector";
|
|
6
7
|
import { createRoot } from "react-dom/client";
|
|
7
8
|
import { createPortal } from "react-dom";
|
|
8
|
-
|
|
9
|
+
// ../utils/dist/append-stylesheet-to.js
|
|
9
10
|
/**
|
|
10
11
|
* Append a `<link rel="stylesheet">` to a document's `<head>`.
|
|
11
12
|
* @param doc - The target document
|
|
@@ -23,8 +24,7 @@ function appendStylesheetTo(doc, url, id) {
|
|
|
23
24
|
link.href = `${url}#${id}`;
|
|
24
25
|
doc.head.append(link);
|
|
25
26
|
}
|
|
26
|
-
|
|
27
|
-
//#region ../core/dist/command/commands.js
|
|
27
|
+
// ../core/dist/command/commands.js
|
|
28
28
|
/**
|
|
29
29
|
* The engine's command vocabulary — every custom command accepted by the
|
|
30
30
|
* central command bus. Buttons declare these with
|
|
@@ -68,10 +68,9 @@ var BGE_COMMAND = {
|
|
|
68
68
|
/** Open the item editor for the item hosting the invoker button. */
|
|
69
69
|
openItemEditor: "--open-item-editor"
|
|
70
70
|
};
|
|
71
|
-
|
|
72
|
-
//#region ../../../node_modules/@tabler/icons-react/dist/esm/defaultAttributes.mjs
|
|
71
|
+
// ../../../node_modules/@tabler/icons-react/dist/esm/defaultAttributes.mjs
|
|
73
72
|
/**
|
|
74
|
-
* @license @tabler/icons-react v3.
|
|
73
|
+
* @license @tabler/icons-react v3.49.0 - MIT
|
|
75
74
|
*
|
|
76
75
|
* This source code is licensed under the MIT license.
|
|
77
76
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -97,10 +96,9 @@ var defaultAttributes = {
|
|
|
97
96
|
stroke: "none"
|
|
98
97
|
}
|
|
99
98
|
};
|
|
100
|
-
|
|
101
|
-
//#region ../../../node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs
|
|
99
|
+
// ../../../node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs
|
|
102
100
|
/**
|
|
103
|
-
* @license @tabler/icons-react v3.
|
|
101
|
+
* @license @tabler/icons-react v3.49.0 - MIT
|
|
104
102
|
*
|
|
105
103
|
* This source code is licensed under the MIT license.
|
|
106
104
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -130,7 +128,7 @@ var createReactComponent = (type, iconName, iconNamePascal, iconNode) => {
|
|
|
130
128
|
return Component;
|
|
131
129
|
};
|
|
132
130
|
/**
|
|
133
|
-
* @license @tabler/icons-react v3.
|
|
131
|
+
* @license @tabler/icons-react v3.49.0 - MIT
|
|
134
132
|
*
|
|
135
133
|
* This source code is licensed under the MIT license.
|
|
136
134
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -143,7 +141,7 @@ var IconArrowBigDownLine = createReactComponent("outline", "arrow-big-down-line"
|
|
|
143
141
|
"key": "svg-1"
|
|
144
142
|
}]]);
|
|
145
143
|
/**
|
|
146
|
-
* @license @tabler/icons-react v3.
|
|
144
|
+
* @license @tabler/icons-react v3.49.0 - MIT
|
|
147
145
|
*
|
|
148
146
|
* This source code is licensed under the MIT license.
|
|
149
147
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -156,7 +154,7 @@ var IconArrowBigUpLine = createReactComponent("outline", "arrow-big-up-line", "A
|
|
|
156
154
|
"key": "svg-1"
|
|
157
155
|
}]]);
|
|
158
156
|
/**
|
|
159
|
-
* @license @tabler/icons-react v3.
|
|
157
|
+
* @license @tabler/icons-react v3.49.0 - MIT
|
|
160
158
|
*
|
|
161
159
|
* This source code is licensed under the MIT license.
|
|
162
160
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -180,7 +178,7 @@ var IconClipboardPlus = createReactComponent("outline", "clipboard-plus", "Clipb
|
|
|
180
178
|
}]
|
|
181
179
|
]);
|
|
182
180
|
/**
|
|
183
|
-
* @license @tabler/icons-react v3.
|
|
181
|
+
* @license @tabler/icons-react v3.49.0 - MIT
|
|
184
182
|
*
|
|
185
183
|
* This source code is licensed under the MIT license.
|
|
186
184
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -193,7 +191,7 @@ var IconClipboard = createReactComponent("outline", "clipboard", "Clipboard", [[
|
|
|
193
191
|
"key": "svg-1"
|
|
194
192
|
}]]);
|
|
195
193
|
/**
|
|
196
|
-
* @license @tabler/icons-react v3.
|
|
194
|
+
* @license @tabler/icons-react v3.49.0 - MIT
|
|
197
195
|
*
|
|
198
196
|
* This source code is licensed under the MIT license.
|
|
199
197
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -217,7 +215,7 @@ var IconLayoutGridAdd = createReactComponent("outline", "layout-grid-add", "Layo
|
|
|
217
215
|
}]
|
|
218
216
|
]);
|
|
219
217
|
/**
|
|
220
|
-
* @license @tabler/icons-react v3.
|
|
218
|
+
* @license @tabler/icons-react v3.49.0 - MIT
|
|
221
219
|
*
|
|
222
220
|
* This source code is licensed under the MIT license.
|
|
223
221
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -241,7 +239,7 @@ var IconLayoutGridRemove = createReactComponent("outline", "layout-grid-remove",
|
|
|
241
239
|
}]
|
|
242
240
|
]);
|
|
243
241
|
/**
|
|
244
|
-
* @license @tabler/icons-react v3.
|
|
242
|
+
* @license @tabler/icons-react v3.49.0 - MIT
|
|
245
243
|
*
|
|
246
244
|
* This source code is licensed under the MIT license.
|
|
247
245
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -261,7 +259,7 @@ var IconRowInsertBottom = createReactComponent("outline", "row-insert-bottom", "
|
|
|
261
259
|
}]
|
|
262
260
|
]);
|
|
263
261
|
/**
|
|
264
|
-
* @license @tabler/icons-react v3.
|
|
262
|
+
* @license @tabler/icons-react v3.49.0 - MIT
|
|
265
263
|
*
|
|
266
264
|
* This source code is licensed under the MIT license.
|
|
267
265
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -281,7 +279,7 @@ var IconRowInsertTop = createReactComponent("outline", "row-insert-top", "RowIns
|
|
|
281
279
|
}]
|
|
282
280
|
]);
|
|
283
281
|
/**
|
|
284
|
-
* @license @tabler/icons-react v3.
|
|
282
|
+
* @license @tabler/icons-react v3.49.0 - MIT
|
|
285
283
|
*
|
|
286
284
|
* This source code is licensed under the MIT license.
|
|
287
285
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -294,7 +292,7 @@ var IconSettings = createReactComponent("outline", "settings", "Settings", [["pa
|
|
|
294
292
|
"key": "svg-1"
|
|
295
293
|
}]]);
|
|
296
294
|
/**
|
|
297
|
-
* @license @tabler/icons-react v3.
|
|
295
|
+
* @license @tabler/icons-react v3.49.0 - MIT
|
|
298
296
|
*
|
|
299
297
|
* This source code is licensed under the MIT license.
|
|
300
298
|
* See the LICENSE file in the root directory of this source tree.
|
|
@@ -329,8 +327,7 @@ var block_catalog_module_default = {
|
|
|
329
327
|
pasteSection: "_pasteSection_96ih6_66",
|
|
330
328
|
pasteButton: "_pasteButton_96ih6_72"
|
|
331
329
|
};
|
|
332
|
-
|
|
333
|
-
//#region src/components/block-catalog.tsx
|
|
330
|
+
// src/components/block-catalog.tsx
|
|
334
331
|
/**
|
|
335
332
|
* Block catalog dialog content. Adding and pasting blocks are declared
|
|
336
333
|
* as engine commands; the catalog entry is identified by
|
|
@@ -392,6 +389,7 @@ function BlockCatalog(t0) {
|
|
|
392
389
|
})
|
|
393
390
|
}) : /* @__PURE__ */ jsx("span", {
|
|
394
391
|
className: block_catalog_module_default.img,
|
|
392
|
+
"aria-hidden": "true",
|
|
395
393
|
dangerouslySetInnerHTML: { __html: blockInfo.definition.svg ?? "" }
|
|
396
394
|
}), /* @__PURE__ */ jsx("span", {
|
|
397
395
|
className: block_catalog_module_default.figcaption,
|
|
@@ -416,8 +414,7 @@ function BlockCatalog(t0) {
|
|
|
416
414
|
} else t4 = $[10];
|
|
417
415
|
return t4;
|
|
418
416
|
}
|
|
419
|
-
|
|
420
|
-
//#region src/components/block-options.tsx
|
|
417
|
+
// src/components/block-options.tsx
|
|
421
418
|
var containerTypeLabel = {
|
|
422
419
|
grid: "グリッド",
|
|
423
420
|
inline: "横並び",
|
|
@@ -442,7 +439,7 @@ var containerTypeLabel = {
|
|
|
442
439
|
* ```
|
|
443
440
|
*/
|
|
444
441
|
function BlockOptions(t0) {
|
|
445
|
-
const $ = c(
|
|
442
|
+
const $ = c(73);
|
|
446
443
|
const { block } = t0;
|
|
447
444
|
const engine = useEngine();
|
|
448
445
|
const currentBlock = block;
|
|
@@ -589,7 +586,7 @@ function BlockOptions(t0) {
|
|
|
589
586
|
$[22] = t7;
|
|
590
587
|
} else t7 = $[22];
|
|
591
588
|
let t8;
|
|
592
|
-
if ($[23] !== currentAutoRepeat || $[24] !== currentColumns || $[25] !== effectiveContainerType || $[26] !== options.containerProps.immutable || $[27] !== options.containerProps.repeatMinInlineSize || $[28] !== options.containerProps.type || $[29] !== repeatMinInlineSizeVariants) {
|
|
589
|
+
if ($[23] !== currentAutoRepeat || $[24] !== currentColumns || $[25] !== effectiveContainerType || $[26] !== options.containerProps.immutable || $[27] !== options.containerProps.repeatMinInlineSize || $[28] !== options.containerProps.type || $[29] !== repeatMinInlineSizeVariants || $[30] !== uid) {
|
|
593
590
|
t8 = effectiveContainerType === "grid" ? options.containerProps.immutable || options.containerProps.type === "float" ? /* @__PURE__ */ jsx("p", { children: "このブロックはコンテナタイプを変更できません。" }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
594
591
|
/* @__PURE__ */ jsxs("label", { children: [/* @__PURE__ */ jsx("span", { children: "列の自動調整" }), /* @__PURE__ */ jsxs("select", {
|
|
595
592
|
name: "bge-options-auto-repeat",
|
|
@@ -612,20 +609,20 @@ function BlockOptions(t0) {
|
|
|
612
609
|
})
|
|
613
610
|
]
|
|
614
611
|
})] }),
|
|
615
|
-
currentAutoRepeat === "fixed" ? /* @__PURE__ */ jsxs("label", { children: [
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
] }) : null,
|
|
612
|
+
currentAutoRepeat === "fixed" ? /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsxs("label", { children: [/* @__PURE__ */ jsx("span", { children: "基準列数" }), /* @__PURE__ */ jsx("input", {
|
|
613
|
+
id: `${uid}-columns`,
|
|
614
|
+
name: "bge-options-columns",
|
|
615
|
+
type: "range",
|
|
616
|
+
value: currentColumns,
|
|
617
|
+
onChange: (e_2) => {
|
|
618
|
+
setCurrentColumns(e_2.currentTarget.valueAsNumber);
|
|
619
|
+
},
|
|
620
|
+
min: "1",
|
|
621
|
+
max: "5"
|
|
622
|
+
})] }), /* @__PURE__ */ jsx("output", {
|
|
623
|
+
htmlFor: `${uid}-columns`,
|
|
624
|
+
children: currentColumns
|
|
625
|
+
})] }) : null,
|
|
629
626
|
currentAutoRepeat !== "fixed" && repeatMinInlineSizeVariants ? /* @__PURE__ */ jsxs("label", { children: [/* @__PURE__ */ jsx("span", { children: "折り返し基準幅" }), /* @__PURE__ */ jsx("select", {
|
|
630
627
|
name: "bge-options-repeat-min-inline-size",
|
|
631
628
|
defaultValue: [...repeatMinInlineSizeVariants.properties].find((t9) => {
|
|
@@ -642,10 +639,11 @@ function BlockOptions(t0) {
|
|
|
642
639
|
$[27] = options.containerProps.repeatMinInlineSize;
|
|
643
640
|
$[28] = options.containerProps.type;
|
|
644
641
|
$[29] = repeatMinInlineSizeVariants;
|
|
645
|
-
$[30] =
|
|
646
|
-
|
|
642
|
+
$[30] = uid;
|
|
643
|
+
$[31] = t8;
|
|
644
|
+
} else t8 = $[31];
|
|
647
645
|
let t9;
|
|
648
|
-
if ($[
|
|
646
|
+
if ($[32] !== effectiveContainerType || $[33] !== options.containerProps.float || $[34] !== uid) {
|
|
649
647
|
t9 = effectiveContainerType === "float" ? /* @__PURE__ */ jsxs("div", {
|
|
650
648
|
role: "radiogroup",
|
|
651
649
|
"aria-labelledby": `${uid}-float`,
|
|
@@ -662,36 +660,36 @@ function BlockOptions(t0) {
|
|
|
662
660
|
}), /* @__PURE__ */ jsx("span", { children: label_1 })] }, value_1);
|
|
663
661
|
})]
|
|
664
662
|
}) : null;
|
|
665
|
-
$[
|
|
666
|
-
$[
|
|
667
|
-
$[
|
|
668
|
-
$[
|
|
669
|
-
} else t9 = $[
|
|
663
|
+
$[32] = effectiveContainerType;
|
|
664
|
+
$[33] = options.containerProps.float;
|
|
665
|
+
$[34] = uid;
|
|
666
|
+
$[35] = t9;
|
|
667
|
+
} else t9 = $[35];
|
|
670
668
|
const t10 = options.containerProps.linkarea ?? false;
|
|
671
669
|
let t11;
|
|
672
|
-
if ($[
|
|
670
|
+
if ($[36] !== t10) {
|
|
673
671
|
t11 = /* @__PURE__ */ jsx("input", {
|
|
674
672
|
type: "checkbox",
|
|
675
673
|
name: "bge-options-linkarea",
|
|
676
674
|
value: "true",
|
|
677
675
|
defaultChecked: t10
|
|
678
676
|
});
|
|
679
|
-
$[
|
|
680
|
-
$[
|
|
681
|
-
} else t11 = $[
|
|
677
|
+
$[36] = t10;
|
|
678
|
+
$[37] = t11;
|
|
679
|
+
} else t11 = $[37];
|
|
682
680
|
let t12;
|
|
683
|
-
if ($[
|
|
681
|
+
if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
|
|
684
682
|
t12 = /* @__PURE__ */ jsx("span", { children: "リンクエリア機能を有効にする" });
|
|
685
|
-
$[
|
|
686
|
-
} else t12 = $[
|
|
683
|
+
$[38] = t12;
|
|
684
|
+
} else t12 = $[38];
|
|
687
685
|
let t13;
|
|
688
|
-
if ($[
|
|
686
|
+
if ($[39] !== t11) {
|
|
689
687
|
t13 = /* @__PURE__ */ jsxs("label", { children: [t11, t12] });
|
|
690
|
-
$[
|
|
691
|
-
$[
|
|
692
|
-
} else t13 = $[
|
|
688
|
+
$[39] = t11;
|
|
689
|
+
$[40] = t13;
|
|
690
|
+
} else t13 = $[40];
|
|
693
691
|
let t14;
|
|
694
|
-
if ($[
|
|
692
|
+
if ($[41] !== t13 || $[42] !== t5 || $[43] !== t6 || $[44] !== t7 || $[45] !== t8 || $[46] !== t9) {
|
|
695
693
|
t14 = /* @__PURE__ */ jsxs("fieldset", { children: [
|
|
696
694
|
t4,
|
|
697
695
|
t5,
|
|
@@ -701,16 +699,16 @@ function BlockOptions(t0) {
|
|
|
701
699
|
t9,
|
|
702
700
|
t13
|
|
703
701
|
] });
|
|
704
|
-
$[
|
|
705
|
-
$[
|
|
706
|
-
$[
|
|
707
|
-
$[
|
|
708
|
-
$[
|
|
709
|
-
$[
|
|
710
|
-
$[
|
|
711
|
-
} else t14 = $[
|
|
702
|
+
$[41] = t13;
|
|
703
|
+
$[42] = t5;
|
|
704
|
+
$[43] = t6;
|
|
705
|
+
$[44] = t7;
|
|
706
|
+
$[45] = t8;
|
|
707
|
+
$[46] = t9;
|
|
708
|
+
$[47] = t14;
|
|
709
|
+
} else t14 = $[47];
|
|
712
710
|
let t15;
|
|
713
|
-
if ($[
|
|
711
|
+
if ($[48] !== cssProps || $[49] !== options.style) {
|
|
714
712
|
t15 = cssProps.size > 0 ? /* @__PURE__ */ jsxs("fieldset", { children: [/* @__PURE__ */ jsx("legend", { children: "ブロックのスタイル拡張" }), [...cssProps].map((t16) => {
|
|
715
713
|
const [, category] = t16;
|
|
716
714
|
const selected = [...category.properties].find((t17) => {
|
|
@@ -723,71 +721,71 @@ function BlockOptions(t0) {
|
|
|
723
721
|
children: [...category.properties].map(_temp2$3)
|
|
724
722
|
})] }, `bge-options-style-${category.id}`);
|
|
725
723
|
})] }) : null;
|
|
726
|
-
$[
|
|
727
|
-
$[
|
|
728
|
-
$[
|
|
729
|
-
} else t15 = $[
|
|
724
|
+
$[48] = cssProps;
|
|
725
|
+
$[49] = options.style;
|
|
726
|
+
$[50] = t15;
|
|
727
|
+
} else t15 = $[50];
|
|
730
728
|
let t16;
|
|
731
|
-
if ($[
|
|
729
|
+
if ($[51] === Symbol.for("react.memo_cache_sentinel")) {
|
|
732
730
|
t16 = /* @__PURE__ */ jsx("span", { children: "独自class設定" });
|
|
733
|
-
$[
|
|
734
|
-
} else t16 = $[
|
|
731
|
+
$[51] = t16;
|
|
732
|
+
} else t16 = $[51];
|
|
735
733
|
let t17;
|
|
736
|
-
if ($[
|
|
734
|
+
if ($[52] !== options.classList) {
|
|
737
735
|
t17 = options.classList?.join(" ") ?? "";
|
|
738
|
-
$[
|
|
739
|
-
$[
|
|
740
|
-
} else t17 = $[
|
|
736
|
+
$[52] = options.classList;
|
|
737
|
+
$[53] = t17;
|
|
738
|
+
} else t17 = $[53];
|
|
741
739
|
const t18 = `${uid}-classes-desc`;
|
|
742
740
|
let t19;
|
|
743
|
-
if ($[
|
|
741
|
+
if ($[54] !== t17 || $[55] !== t18) {
|
|
744
742
|
t19 = /* @__PURE__ */ jsxs("label", { children: [t16, /* @__PURE__ */ jsx("input", {
|
|
745
743
|
type: "text",
|
|
746
744
|
name: "bge-options-classes",
|
|
747
745
|
defaultValue: t17,
|
|
748
746
|
"aria-describedby": t18
|
|
749
747
|
})] });
|
|
750
|
-
$[
|
|
751
|
-
$[
|
|
752
|
-
$[
|
|
753
|
-
} else t19 = $[
|
|
748
|
+
$[54] = t17;
|
|
749
|
+
$[55] = t18;
|
|
750
|
+
$[56] = t19;
|
|
751
|
+
} else t19 = $[56];
|
|
754
752
|
const t20 = `${uid}-classes-desc`;
|
|
755
753
|
let t21;
|
|
756
|
-
if ($[
|
|
754
|
+
if ($[57] !== t20) {
|
|
757
755
|
t21 = /* @__PURE__ */ jsx("small", {
|
|
758
756
|
id: t20,
|
|
759
757
|
children: "複数指定する場合はスペース(空白文字)で区切ってください。"
|
|
760
758
|
});
|
|
761
|
-
$[
|
|
762
|
-
$[
|
|
763
|
-
} else t21 = $[
|
|
759
|
+
$[57] = t20;
|
|
760
|
+
$[58] = t21;
|
|
761
|
+
} else t21 = $[58];
|
|
764
762
|
let t22;
|
|
765
|
-
if ($[
|
|
763
|
+
if ($[59] === Symbol.for("react.memo_cache_sentinel")) {
|
|
766
764
|
t22 = /* @__PURE__ */ jsxs("span", { children: ["ID設定: ", /* @__PURE__ */ jsx("code", { children: "bge-" })] });
|
|
767
|
-
$[
|
|
768
|
-
} else t22 = $[
|
|
765
|
+
$[59] = t22;
|
|
766
|
+
} else t22 = $[59];
|
|
769
767
|
const t23 = options.id ?? "";
|
|
770
768
|
const t24 = `${uid}-id-desc`;
|
|
771
769
|
let t25;
|
|
772
|
-
if ($[
|
|
770
|
+
if ($[60] !== t23 || $[61] !== t24) {
|
|
773
771
|
t25 = /* @__PURE__ */ jsxs("label", { children: [t22, /* @__PURE__ */ jsx("input", {
|
|
774
772
|
name: "bge-options-id",
|
|
775
773
|
type: "text",
|
|
776
774
|
defaultValue: t23,
|
|
777
775
|
"aria-describedby": t24
|
|
778
776
|
})] });
|
|
779
|
-
$[
|
|
780
|
-
$[
|
|
781
|
-
$[
|
|
782
|
-
} else t25 = $[
|
|
777
|
+
$[60] = t23;
|
|
778
|
+
$[61] = t24;
|
|
779
|
+
$[62] = t25;
|
|
780
|
+
} else t25 = $[62];
|
|
783
781
|
const t26 = `${uid}-id-desc`;
|
|
784
782
|
let t27;
|
|
785
|
-
if ($[
|
|
783
|
+
if ($[63] === Symbol.for("react.memo_cache_sentinel")) {
|
|
786
784
|
t27 = /* @__PURE__ */ jsx("code", { children: "bge-" });
|
|
787
|
-
$[
|
|
788
|
-
} else t27 = $[
|
|
785
|
+
$[63] = t27;
|
|
786
|
+
} else t27 = $[63];
|
|
789
787
|
let t28;
|
|
790
|
-
if ($[
|
|
788
|
+
if ($[64] !== t26) {
|
|
791
789
|
t28 = /* @__PURE__ */ jsxs("small", {
|
|
792
790
|
id: t26,
|
|
793
791
|
children: [
|
|
@@ -796,11 +794,11 @@ function BlockOptions(t0) {
|
|
|
796
794
|
"が自動的に先頭に付加されます。"
|
|
797
795
|
]
|
|
798
796
|
});
|
|
799
|
-
$[
|
|
800
|
-
$[
|
|
801
|
-
} else t28 = $[
|
|
797
|
+
$[64] = t26;
|
|
798
|
+
$[65] = t28;
|
|
799
|
+
} else t28 = $[65];
|
|
802
800
|
let t29;
|
|
803
|
-
if ($[
|
|
801
|
+
if ($[66] !== t14 || $[67] !== t15 || $[68] !== t19 || $[69] !== t21 || $[70] !== t25 || $[71] !== t28) {
|
|
804
802
|
t29 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
805
803
|
t14,
|
|
806
804
|
t15,
|
|
@@ -809,14 +807,14 @@ function BlockOptions(t0) {
|
|
|
809
807
|
t25,
|
|
810
808
|
t28
|
|
811
809
|
] });
|
|
812
|
-
$[
|
|
813
|
-
$[
|
|
814
|
-
$[
|
|
815
|
-
$[
|
|
816
|
-
$[
|
|
817
|
-
$[
|
|
818
|
-
$[
|
|
819
|
-
} else t29 = $[
|
|
810
|
+
$[66] = t14;
|
|
811
|
+
$[67] = t15;
|
|
812
|
+
$[68] = t19;
|
|
813
|
+
$[69] = t21;
|
|
814
|
+
$[70] = t25;
|
|
815
|
+
$[71] = t28;
|
|
816
|
+
$[72] = t29;
|
|
817
|
+
} else t29 = $[72];
|
|
820
818
|
return t29;
|
|
821
819
|
}
|
|
822
820
|
function _temp2$3(t0) {
|
|
@@ -833,8 +831,7 @@ function _temp$4(t0) {
|
|
|
833
831
|
children: `${variantName_0} (${data_0.value})`
|
|
834
832
|
}, variantName_0);
|
|
835
833
|
}
|
|
836
|
-
|
|
837
|
-
//#region ../../../node_modules/react-error-boundary/dist/react-error-boundary.js
|
|
834
|
+
// ../../../node_modules/react-error-boundary/dist/react-error-boundary.js
|
|
838
835
|
var f = createContext(null);
|
|
839
836
|
function m({ children: r, didCatch: e, error: t, resetErrorBoundary: o }) {
|
|
840
837
|
const n = useMemo(() => ({
|
|
@@ -903,15 +900,13 @@ var C = class extends Component {
|
|
|
903
900
|
function g(r = [], e = []) {
|
|
904
901
|
return r.length !== e.length || r.some((t, o) => !Object.is(t, e[o]));
|
|
905
902
|
}
|
|
906
|
-
|
|
907
|
-
//#region src/invoker-commands.ts
|
|
903
|
+
// src/invoker-commands.ts
|
|
908
904
|
/**
|
|
909
905
|
* Invoker Commands API attributes for buttons. Re-exported (rather than
|
|
910
906
|
* imported for side effects only) so that the module augmentation above
|
|
911
907
|
* survives d.ts bundling and reaches consumers.
|
|
912
908
|
*/
|
|
913
|
-
|
|
914
|
-
//#region src/editor-dialog.tsx
|
|
909
|
+
// src/editor-dialog.tsx
|
|
915
910
|
/**
|
|
916
911
|
* Minimal fallback for a dialog body that suspended and then threw.
|
|
917
912
|
* Display-only — the dialog's own close button (outside this boundary,
|
|
@@ -1126,8 +1121,7 @@ function EditorDialogBody({ name, formId, dialogId, open, action, buttons, child
|
|
|
1126
1121
|
children: buttons.complete
|
|
1127
1122
|
}) : null] })] });
|
|
1128
1123
|
}
|
|
1129
|
-
|
|
1130
|
-
//#region src/components/item-editor-host.tsx
|
|
1124
|
+
// src/components/item-editor-host.tsx
|
|
1131
1125
|
/**
|
|
1132
1126
|
* Declarative item editor dialog. Renders the item's `Editor` component
|
|
1133
1127
|
* with editor state derived via `toEditorState`; on submit the state is
|
|
@@ -1302,8 +1296,7 @@ function ItemEditorBody(t0) {
|
|
|
1302
1296
|
} else t6 = $[23];
|
|
1303
1297
|
return t6;
|
|
1304
1298
|
}
|
|
1305
|
-
|
|
1306
|
-
//#region src/use-engine.ts
|
|
1299
|
+
// src/use-engine.ts
|
|
1307
1300
|
var identity = (state) => state;
|
|
1308
1301
|
/**
|
|
1309
1302
|
* Subscribe to the engine's UI state store.
|
|
@@ -1342,74 +1335,51 @@ function useUIState(selector) {
|
|
|
1342
1335
|
const engine = useEngine();
|
|
1343
1336
|
return useSyncExternalStoreWithSelector(engine.uiState.subscribe, engine.uiState.getSnapshot, engine.uiState.getSnapshot, selector ?? identity);
|
|
1344
1337
|
}
|
|
1345
|
-
|
|
1346
|
-
|
|
1338
|
+
// src/replace-element.ts
|
|
1339
|
+
var nextViewTransitionId = 0;
|
|
1347
1340
|
/**
|
|
1341
|
+
* Swap two adjacent sibling blocks with a View Transition, then wait until it
|
|
1342
|
+
* finishes so `beginProcessing()` covers the same window as before.
|
|
1348
1343
|
*
|
|
1349
|
-
*
|
|
1350
|
-
*
|
|
1351
|
-
* @param
|
|
1344
|
+
* Animation length and `prefers-reduced-motion: reduce` are controlled by CSS
|
|
1345
|
+
* injected into the editable-area iframe (`editable-area-view.tsx`), not here.
|
|
1346
|
+
* @param elA - First sibling element
|
|
1347
|
+
* @param elB - Second sibling element (same parent as `elA`)
|
|
1348
|
+
* @example
|
|
1349
|
+
* ```ts
|
|
1350
|
+
* await replaceElement(currentBlock.el, currentBlock.el.nextElementSibling as HTMLElement);
|
|
1351
|
+
* // The two blocks have exchanged positions in the DOM.
|
|
1352
|
+
* ```
|
|
1352
1353
|
*/
|
|
1353
|
-
async function replaceElement(elA, elB
|
|
1354
|
+
async function replaceElement(elA, elB) {
|
|
1354
1355
|
if (elA.parentElement !== elB.parentElement) throw new Error("The parent element of the two elements is different.");
|
|
1355
|
-
const
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
const
|
|
1363
|
-
const
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
tmpB.style.height = `${boxB.height}px`;
|
|
1381
|
-
tmpB.style.zIndex = "10";
|
|
1382
|
-
tmpContainer.append(tmpA, tmpB);
|
|
1383
|
-
tmpContainer.ownerDocument.body.append(tmpContainer);
|
|
1384
|
-
elB.remove();
|
|
1385
|
-
elA.before(elB);
|
|
1386
|
-
elA.style.visibility = lockCSS.visibility;
|
|
1387
|
-
elA.style.pointerEvents = lockCSS.pointerEvents;
|
|
1388
|
-
elB.style.visibility = lockCSS.visibility;
|
|
1389
|
-
elB.style.pointerEvents = lockCSS.pointerEvents;
|
|
1390
|
-
const animateA = tmpA.animate([{
|
|
1391
|
-
top: tmpA.style.top,
|
|
1392
|
-
left: tmpA.style.left
|
|
1393
|
-
}, {
|
|
1394
|
-
top: `${boxA.top + boxB.height}px`,
|
|
1395
|
-
left: tmpB.style.left
|
|
1396
|
-
}], { duration });
|
|
1397
|
-
const animateB = tmpB.animate([{
|
|
1398
|
-
top: tmpB.style.top,
|
|
1399
|
-
left: tmpB.style.left
|
|
1400
|
-
}, {
|
|
1401
|
-
top: tmpA.style.top,
|
|
1402
|
-
left: tmpA.style.left
|
|
1403
|
-
}], { duration });
|
|
1404
|
-
await Promise.all([animateA.finished, animateB.finished]);
|
|
1405
|
-
tmpContainer.remove();
|
|
1406
|
-
elA.removeAttribute("style");
|
|
1407
|
-
elB.removeAttribute("style");
|
|
1408
|
-
if (beforeStyleA) elA.style.cssText = beforeStyleA;
|
|
1409
|
-
if (beforeStyleB) elB.style.cssText = beforeStyleB;
|
|
1356
|
+
const doc = elA.ownerDocument;
|
|
1357
|
+
const startViewTransition = doc.startViewTransition?.bind(doc);
|
|
1358
|
+
if (!startViewTransition) {
|
|
1359
|
+
elB.remove();
|
|
1360
|
+
elA.before(elB);
|
|
1361
|
+
return;
|
|
1362
|
+
}
|
|
1363
|
+
const id = ++nextViewTransitionId;
|
|
1364
|
+
const nameA = `bge-block-swap-${id}-a`;
|
|
1365
|
+
const nameB = `bge-block-swap-${id}-b`;
|
|
1366
|
+
const previousNameA = elA.style.viewTransitionName;
|
|
1367
|
+
const previousNameB = elB.style.viewTransitionName;
|
|
1368
|
+
elA.style.viewTransitionName = nameA;
|
|
1369
|
+
elB.style.viewTransitionName = nameB;
|
|
1370
|
+
try {
|
|
1371
|
+
await startViewTransition(() => {
|
|
1372
|
+
elB.remove();
|
|
1373
|
+
elA.before(elB);
|
|
1374
|
+
}).finished;
|
|
1375
|
+
} finally {
|
|
1376
|
+
if (previousNameA) elA.style.viewTransitionName = previousNameA;
|
|
1377
|
+
else elA.style.removeProperty("view-transition-name");
|
|
1378
|
+
if (previousNameB) elB.style.viewTransitionName = previousNameB;
|
|
1379
|
+
else elB.style.removeProperty("view-transition-name");
|
|
1380
|
+
}
|
|
1410
1381
|
}
|
|
1411
|
-
|
|
1412
|
-
//#region src/commands/register-engine-commands.ts
|
|
1382
|
+
// src/commands/register-engine-commands.ts
|
|
1413
1383
|
/**
|
|
1414
1384
|
* Register the engine's central command dispatch table.
|
|
1415
1385
|
*
|
|
@@ -1534,8 +1504,7 @@ var draft_switcher_module_default = {
|
|
|
1534
1504
|
draftTabBtn: "_draftTabBtn_14xtl_16",
|
|
1535
1505
|
draftCopyBtn: "_draftCopyBtn_14xtl_47"
|
|
1536
1506
|
};
|
|
1537
|
-
|
|
1538
|
-
//#region src/components/draft-switcher.tsx
|
|
1507
|
+
// src/components/draft-switcher.tsx
|
|
1539
1508
|
/**
|
|
1540
1509
|
* Main/draft content switcher. Switching and copying are declared as
|
|
1541
1510
|
* engine commands; the pressed state follows `engine.uiState.activeArea`
|
|
@@ -1697,8 +1666,7 @@ function _temp2$2(s_0) {
|
|
|
1697
1666
|
function _temp$2(s) {
|
|
1698
1667
|
return s.sourceMode;
|
|
1699
1668
|
}
|
|
1700
|
-
|
|
1701
|
-
//#region src/mount.tsx
|
|
1669
|
+
// src/mount.tsx
|
|
1702
1670
|
/**
|
|
1703
1671
|
* Mount a React node into a DOM container and return a `Disposable`
|
|
1704
1672
|
* teardown handle, matching the `UICreator` contract shape used across
|
|
@@ -1728,8 +1696,7 @@ function reactMount(node, target) {
|
|
|
1728
1696
|
[Symbol.dispose]: teardown
|
|
1729
1697
|
};
|
|
1730
1698
|
}
|
|
1731
|
-
|
|
1732
|
-
//#region src/root-error-boundary.tsx
|
|
1699
|
+
// src/root-error-boundary.tsx
|
|
1733
1700
|
/**
|
|
1734
1701
|
* Report a render error onto the engine element as `bge:error`. This is
|
|
1735
1702
|
* the only way an in-tree failure reaches code outside React — `core`
|
|
@@ -1812,8 +1779,7 @@ function RootErrorBoundary(t0) {
|
|
|
1812
1779
|
} else t1 = $[1];
|
|
1813
1780
|
return t1;
|
|
1814
1781
|
}
|
|
1815
|
-
|
|
1816
|
-
//#region src/animate-insertion.ts
|
|
1782
|
+
// src/animate-insertion.ts
|
|
1817
1783
|
var INSERTION_ANIMATION_DURATION_MS = 400;
|
|
1818
1784
|
/**
|
|
1819
1785
|
* Expand the block-insertion marker from zero to its natural height.
|
|
@@ -1840,8 +1806,30 @@ async function animateInsertion(markerEl) {
|
|
|
1840
1806
|
easing: "ease"
|
|
1841
1807
|
}).finished.then(() => {}, () => {});
|
|
1842
1808
|
}
|
|
1843
|
-
|
|
1844
|
-
|
|
1809
|
+
// src/block-swap-view-transition-css.ts
|
|
1810
|
+
/**
|
|
1811
|
+
* Editable-area iframe 文書に注入するブロック入れ替え View Transition 用 CSS。
|
|
1812
|
+
* アニメ時間と prefers-reduced-motion はここが正であり、`replace-element.spec.ts`
|
|
1813
|
+
* でも同じ文字列を注入して検証する。
|
|
1814
|
+
*/
|
|
1815
|
+
var BLOCK_SWAP_VIEW_TRANSITION_CSS = `
|
|
1816
|
+
::view-transition {
|
|
1817
|
+
pointer-events: none;
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
::view-transition-group(*) {
|
|
1821
|
+
animation-duration: 600ms;
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1825
|
+
::view-transition-group(*),
|
|
1826
|
+
::view-transition-old(*),
|
|
1827
|
+
::view-transition-new(*) {
|
|
1828
|
+
animation: none;
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
`.trim();
|
|
1832
|
+
// src/use-command.ts
|
|
1845
1833
|
/**
|
|
1846
1834
|
* Receive Invoker Commands API `command` events on the element the returned
|
|
1847
1835
|
* ref callback is attached to. Buttons address the element with
|
|
@@ -1909,12 +1897,55 @@ function useCommand(handlers) {
|
|
|
1909
1897
|
useEffect(t1, t2);
|
|
1910
1898
|
return setEl;
|
|
1911
1899
|
}
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1900
|
+
// src/components/block-menu-anchors.ts
|
|
1901
|
+
/** ホバー中ブロックの CSS アンカー名(`position-anchor` の参照先) */
|
|
1902
|
+
var BGE_BLOCK_MENU_BLOCK_ANCHOR = "--bge-current-block";
|
|
1903
|
+
/**
|
|
1904
|
+
* ブロック内アイテム(`[data-bgi]`)の CSS アンカー名を返す。
|
|
1905
|
+
* @param index - ブロック内の出現順(0 始まり)
|
|
1906
|
+
* @example
|
|
1907
|
+
* ```ts
|
|
1908
|
+
* bgeBlockMenuItemAnchorName(0); // '--bge-block-menu-item-0'
|
|
1909
|
+
* ```
|
|
1910
|
+
*/
|
|
1911
|
+
function bgeBlockMenuItemAnchorName(index) {
|
|
1912
|
+
return `--bge-block-menu-item-${index}`;
|
|
1913
|
+
}
|
|
1914
|
+
/**
|
|
1915
|
+
* @param blockEl - `[data-bge-container]` のブロック要素
|
|
1916
|
+
*/
|
|
1917
|
+
function clearBlockMenuAnchors(blockEl) {
|
|
1918
|
+
blockEl.style.removeProperty("anchor-name");
|
|
1919
|
+
for (const itemEl of blockEl.querySelectorAll("[data-bgi]")) itemEl.style.removeProperty("anchor-name");
|
|
1920
|
+
}
|
|
1921
|
+
/**
|
|
1922
|
+
* メニューとアイテムオーバーレイが参照するアンカーをブロック DOM に付与する。
|
|
1923
|
+
* `itemEls` は `Item.getInstance` で解決済みの `[data-bgi]` だけを渡す(オーバーレイの
|
|
1924
|
+
* `value` インデックスと `itemsRef` が同じ並びになる)。
|
|
1925
|
+
* @param blockEl - `[data-bge-container]` のブロック要素
|
|
1926
|
+
* @param itemEls - アンカーを付与するアイテム要素(出現順)
|
|
1927
|
+
* @returns 付与したアイテムアンカー名の一覧(オーバーレイの `position-anchor` 用)
|
|
1928
|
+
*/
|
|
1929
|
+
function applyBlockMenuAnchors(blockEl, itemEls) {
|
|
1930
|
+
blockEl.style.setProperty("anchor-name", BGE_BLOCK_MENU_BLOCK_ANCHOR);
|
|
1931
|
+
const anchorNames = [];
|
|
1932
|
+
for (const [index, itemEl] of itemEls.entries()) {
|
|
1933
|
+
const name = bgeBlockMenuItemAnchorName(index);
|
|
1934
|
+
itemEl.style.setProperty("anchor-name", name);
|
|
1935
|
+
anchorNames.push(name);
|
|
1936
|
+
}
|
|
1937
|
+
return anchorNames;
|
|
1938
|
+
}
|
|
1939
|
+
var block_menu_button_module_default = { wrapper: "_wrapper_rfa8x_1" };
|
|
1940
|
+
// src/components/block-menu-button.tsx
|
|
1915
1941
|
/**
|
|
1916
|
-
* Icon button of the block menu with an anchored tooltip
|
|
1917
|
-
*
|
|
1942
|
+
* Icon button of the block menu with an anchored hint tooltip (`interestfor`
|
|
1943
|
+
* + `popover="hint"`). Esc dismisses the tooltip without moving pointer or
|
|
1944
|
+
* focus (WCAG 1.4.13). The admin UI targets the latest stable Chrome, which
|
|
1945
|
+
* implements Interest Invokers; without `HTMLButtonElement.prototype
|
|
1946
|
+
* .interestForElement`, hints do not open (there is no CSS-only fallback).
|
|
1947
|
+
* The action is declared with the Invoker Commands API instead of a click
|
|
1948
|
+
* handler.
|
|
1918
1949
|
* @param root0
|
|
1919
1950
|
* @param root0.label
|
|
1920
1951
|
* @param root0.command
|
|
@@ -1954,6 +1985,7 @@ function BlockMenuButton(t0) {
|
|
|
1954
1985
|
t5 = /* @__PURE__ */ jsx("button", {
|
|
1955
1986
|
type: "button",
|
|
1956
1987
|
"aria-labelledby": uid,
|
|
1988
|
+
interestfor: uid,
|
|
1957
1989
|
command,
|
|
1958
1990
|
commandfor,
|
|
1959
1991
|
value,
|
|
@@ -1970,6 +2002,7 @@ function BlockMenuButton(t0) {
|
|
|
1970
2002
|
if ($[10] !== label || $[11] !== uid) {
|
|
1971
2003
|
t6 = /* @__PURE__ */ jsx("span", {
|
|
1972
2004
|
id: uid,
|
|
2005
|
+
popover: "hint",
|
|
1973
2006
|
children: label
|
|
1974
2007
|
});
|
|
1975
2008
|
$[10] = label;
|
|
@@ -1991,45 +2024,45 @@ function BlockMenuButton(t0) {
|
|
|
1991
2024
|
return t7;
|
|
1992
2025
|
}
|
|
1993
2026
|
var block_menu_module_default = {
|
|
1994
|
-
bgeMenuBase: "
|
|
1995
|
-
bgeMenuMargin: "
|
|
1996
|
-
bgeMenu: "
|
|
1997
|
-
bgeItemOverlay: "
|
|
1998
|
-
bgeMoveGroup: "
|
|
1999
|
-
bgeStandardGroup: "
|
|
2027
|
+
bgeMenuBase: "_bgeMenuBase_ry5ak_1",
|
|
2028
|
+
bgeMenuMargin: "_bgeMenuMargin_ry5ak_11",
|
|
2029
|
+
bgeMenu: "_bgeMenu_ry5ak_1",
|
|
2030
|
+
bgeItemOverlay: "_bgeItemOverlay_ry5ak_69",
|
|
2031
|
+
bgeMoveGroup: "_bgeMoveGroup_ry5ak_91",
|
|
2032
|
+
bgeStandardGroup: "_bgeStandardGroup_ry5ak_92"
|
|
2000
2033
|
};
|
|
2001
|
-
|
|
2002
|
-
//#region src/components/block-menu-view.tsx
|
|
2034
|
+
// src/components/block-menu-view.tsx
|
|
2003
2035
|
/**
|
|
2004
|
-
*
|
|
2005
|
-
*
|
|
2006
|
-
*
|
|
2007
|
-
* ブロックに追従させる。
|
|
2036
|
+
* 選択中ブロックの下マージン表示用。`BlockMenu` がブロック要素の
|
|
2037
|
+
* 算出スタイルから読み取り、余白インジケータ(`.bgeMenuMargin`)に渡す。
|
|
2038
|
+
* 位置とサイズは CSS アンカー配置(`--bge-current-block`)で追従する。
|
|
2008
2039
|
* @example
|
|
2009
2040
|
* ```ts
|
|
2010
|
-
* const
|
|
2011
|
-
* width: 320,
|
|
2012
|
-
* height: 120,
|
|
2013
|
-
* x: 0,
|
|
2014
|
-
* y: 0,
|
|
2041
|
+
* const margin: BlockMenuMargin = {
|
|
2015
2042
|
* marginBlockEnd: 16,
|
|
2016
2043
|
* marginBlockEndValue: '1em',
|
|
2017
2044
|
* };
|
|
2018
2045
|
* ```
|
|
2019
2046
|
*/
|
|
2020
2047
|
/**
|
|
2021
|
-
* ブロック内の各アイテム(`[data-bgi]
|
|
2022
|
-
*
|
|
2023
|
-
*
|
|
2048
|
+
* ブロック内の各アイテム(`[data-bgi]`)に付与した CSS アンカー名。
|
|
2049
|
+
* 対応する DOM 要素の `anchor-name` と一致し、オーバーレイの
|
|
2050
|
+
* `position-anchor` が参照する。
|
|
2024
2051
|
* @example
|
|
2025
2052
|
* ```ts
|
|
2026
|
-
* const
|
|
2053
|
+
* const anchor: ItemOverlayAnchor = { anchorName: '--bge-block-menu-item-0' };
|
|
2027
2054
|
* ```
|
|
2028
2055
|
*/
|
|
2029
2056
|
/**
|
|
2057
|
+
* @deprecated {@link BlockMenuMargin} に置き換え。位置・サイズはアンカー配置で決まる。
|
|
2058
|
+
*/
|
|
2059
|
+
/**
|
|
2060
|
+
* @deprecated {@link ItemOverlayAnchor} に置き換え。
|
|
2061
|
+
*/
|
|
2062
|
+
/**
|
|
2030
2063
|
* `BlockMenu` の描画専用の中身。マウス追跡・`BurgerBlock` 解決・
|
|
2031
|
-
* `engine`
|
|
2032
|
-
*
|
|
2064
|
+
* `engine` 接続は一切持たず、マージンとアイテムアンカーを props で
|
|
2065
|
+
* 受け取って並べるだけの純粋なプレゼンテーションコンポーネント。
|
|
2033
2066
|
*
|
|
2034
2067
|
* `BurgerBlock` の実インスタンス生成なしに見た目だけ確認したい用途
|
|
2035
2068
|
* (Storybook)のために `BlockMenu` から切り出されている。
|
|
@@ -2038,8 +2071,8 @@ var block_menu_module_default = {
|
|
|
2038
2071
|
* @param root0.menuId
|
|
2039
2072
|
* @param root0.commandBusId
|
|
2040
2073
|
* @param root0.visible
|
|
2041
|
-
* @param root0.
|
|
2042
|
-
* @param root0.
|
|
2074
|
+
* @param root0.margin
|
|
2075
|
+
* @param root0.itemAnchors
|
|
2043
2076
|
* @param root0.isMutable
|
|
2044
2077
|
* @example
|
|
2045
2078
|
* ```tsx
|
|
@@ -2048,145 +2081,126 @@ var block_menu_module_default = {
|
|
|
2048
2081
|
* menuId="bge-block-menu"
|
|
2049
2082
|
* commandBusId={engine.commandBus.receiverId}
|
|
2050
2083
|
* visible
|
|
2051
|
-
*
|
|
2052
|
-
*
|
|
2084
|
+
* margin={{ marginBlockEnd: 0, marginBlockEndValue: '0px' }}
|
|
2085
|
+
* itemAnchors={[{ anchorName: '--bge-block-menu-item-0' }]}
|
|
2053
2086
|
* isMutable
|
|
2054
2087
|
* />
|
|
2055
2088
|
* ```
|
|
2056
2089
|
*/
|
|
2057
2090
|
function BlockMenuView(t0) {
|
|
2058
|
-
const $ = c(
|
|
2059
|
-
const { rootRef, menuId, commandBusId, visible,
|
|
2091
|
+
const $ = c(55);
|
|
2092
|
+
const { rootRef, menuId, commandBusId, visible, margin, itemAnchors, isMutable } = t0;
|
|
2060
2093
|
const t1 = !visible;
|
|
2061
|
-
const t2 = `${
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
const t6 = `${geometry.marginBlockEnd ?? "0"}px`;
|
|
2066
|
-
let t7;
|
|
2067
|
-
if ($[0] !== t2 || $[1] !== t3 || $[2] !== t4 || $[3] !== t5 || $[4] !== t6) {
|
|
2068
|
-
t7 = {
|
|
2069
|
-
"--width": t2,
|
|
2070
|
-
"--height": t3,
|
|
2071
|
-
"--x": t4,
|
|
2072
|
-
"--y": t5,
|
|
2073
|
-
"--margin-block-end": t6
|
|
2074
|
-
};
|
|
2094
|
+
const t2 = `${margin.marginBlockEnd}px`;
|
|
2095
|
+
let t3;
|
|
2096
|
+
if ($[0] !== t2) {
|
|
2097
|
+
t3 = { "--margin-block-end": t2 };
|
|
2075
2098
|
$[0] = t2;
|
|
2076
2099
|
$[1] = t3;
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
if ($[6] !== itemRects || $[7] !== menuId) {
|
|
2085
|
-
let t10;
|
|
2086
|
-
if ($[9] !== menuId) {
|
|
2087
|
-
t10 = (rect, index) => /* @__PURE__ */ jsx("button", {
|
|
2100
|
+
} else t3 = $[1];
|
|
2101
|
+
const t4 = t3;
|
|
2102
|
+
let t5;
|
|
2103
|
+
if ($[2] !== itemAnchors || $[3] !== menuId) {
|
|
2104
|
+
let t6;
|
|
2105
|
+
if ($[5] !== menuId) {
|
|
2106
|
+
t6 = (item, index) => /* @__PURE__ */ jsx("button", {
|
|
2088
2107
|
type: "button",
|
|
2089
2108
|
className: block_menu_module_default.bgeItemOverlay,
|
|
2090
2109
|
"aria-label": "コンテンツを編集",
|
|
2091
2110
|
command: "--open-item-editor",
|
|
2092
2111
|
commandfor: menuId,
|
|
2093
2112
|
value: index,
|
|
2094
|
-
style: {
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
$[
|
|
2108
|
-
} else
|
|
2109
|
-
let
|
|
2110
|
-
if ($[
|
|
2111
|
-
|
|
2112
|
-
$[11] = t10;
|
|
2113
|
-
} else t10 = $[11];
|
|
2114
|
-
let t11;
|
|
2115
|
-
if ($[12] !== commandBusId) {
|
|
2116
|
-
t11 = /* @__PURE__ */ jsx(BlockMenuButton, {
|
|
2113
|
+
style: { "--item-anchor": item.anchorName }
|
|
2114
|
+
}, item.anchorName);
|
|
2115
|
+
$[5] = menuId;
|
|
2116
|
+
$[6] = t6;
|
|
2117
|
+
} else t6 = $[6];
|
|
2118
|
+
t5 = itemAnchors.map(t6);
|
|
2119
|
+
$[2] = itemAnchors;
|
|
2120
|
+
$[3] = menuId;
|
|
2121
|
+
$[4] = t5;
|
|
2122
|
+
} else t5 = $[4];
|
|
2123
|
+
let t6;
|
|
2124
|
+
if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2125
|
+
t6 = /* @__PURE__ */ jsx(IconArrowBigUpLine, {});
|
|
2126
|
+
$[7] = t6;
|
|
2127
|
+
} else t6 = $[7];
|
|
2128
|
+
let t7;
|
|
2129
|
+
if ($[8] !== commandBusId) {
|
|
2130
|
+
t7 = /* @__PURE__ */ jsx(BlockMenuButton, {
|
|
2117
2131
|
label: "ひとつ上へ移動",
|
|
2118
2132
|
command: BGE_COMMAND.moveBlock,
|
|
2119
2133
|
commandfor: commandBusId,
|
|
2120
2134
|
value: "up",
|
|
2121
|
-
children:
|
|
2135
|
+
children: t6
|
|
2122
2136
|
});
|
|
2123
|
-
$[
|
|
2124
|
-
$[
|
|
2125
|
-
} else
|
|
2126
|
-
let
|
|
2127
|
-
if ($[
|
|
2128
|
-
|
|
2129
|
-
$[
|
|
2130
|
-
} else
|
|
2131
|
-
let
|
|
2132
|
-
if ($[
|
|
2133
|
-
|
|
2137
|
+
$[8] = commandBusId;
|
|
2138
|
+
$[9] = t7;
|
|
2139
|
+
} else t7 = $[9];
|
|
2140
|
+
let t8;
|
|
2141
|
+
if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2142
|
+
t8 = /* @__PURE__ */ jsx(IconArrowBigDownLine, {});
|
|
2143
|
+
$[10] = t8;
|
|
2144
|
+
} else t8 = $[10];
|
|
2145
|
+
let t9;
|
|
2146
|
+
if ($[11] !== commandBusId) {
|
|
2147
|
+
t9 = /* @__PURE__ */ jsx(BlockMenuButton, {
|
|
2134
2148
|
label: "ひとつ下へ移動",
|
|
2135
2149
|
command: BGE_COMMAND.moveBlock,
|
|
2136
2150
|
commandfor: commandBusId,
|
|
2137
2151
|
value: "down",
|
|
2138
|
-
children:
|
|
2152
|
+
children: t8
|
|
2139
2153
|
});
|
|
2140
|
-
$[
|
|
2141
|
-
$[
|
|
2142
|
-
} else
|
|
2143
|
-
let
|
|
2144
|
-
if ($[
|
|
2145
|
-
|
|
2154
|
+
$[11] = commandBusId;
|
|
2155
|
+
$[12] = t9;
|
|
2156
|
+
} else t9 = $[12];
|
|
2157
|
+
let t10;
|
|
2158
|
+
if ($[13] !== t7 || $[14] !== t9) {
|
|
2159
|
+
t10 = /* @__PURE__ */ jsxs("div", {
|
|
2146
2160
|
className: block_menu_module_default.bgeMoveGroup,
|
|
2147
|
-
children: [
|
|
2161
|
+
children: [t7, t9]
|
|
2148
2162
|
});
|
|
2149
|
-
$[
|
|
2150
|
-
$[
|
|
2151
|
-
$[
|
|
2152
|
-
} else
|
|
2153
|
-
let
|
|
2154
|
-
if ($[
|
|
2155
|
-
|
|
2156
|
-
$[
|
|
2157
|
-
} else
|
|
2158
|
-
let
|
|
2159
|
-
if ($[
|
|
2160
|
-
|
|
2163
|
+
$[13] = t7;
|
|
2164
|
+
$[14] = t9;
|
|
2165
|
+
$[15] = t10;
|
|
2166
|
+
} else t10 = $[15];
|
|
2167
|
+
let t11;
|
|
2168
|
+
if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2169
|
+
t11 = /* @__PURE__ */ jsx(IconRowInsertTop, {});
|
|
2170
|
+
$[16] = t11;
|
|
2171
|
+
} else t11 = $[16];
|
|
2172
|
+
let t12;
|
|
2173
|
+
if ($[17] !== commandBusId) {
|
|
2174
|
+
t12 = /* @__PURE__ */ jsx(BlockMenuButton, {
|
|
2161
2175
|
label: "上にブロックを追加",
|
|
2162
2176
|
command: BGE_COMMAND.insertBlock,
|
|
2163
2177
|
commandfor: commandBusId,
|
|
2164
2178
|
value: "before",
|
|
2165
|
-
children:
|
|
2179
|
+
children: t11
|
|
2166
2180
|
});
|
|
2167
|
-
$[
|
|
2168
|
-
$[
|
|
2169
|
-
} else
|
|
2170
|
-
let
|
|
2171
|
-
if ($[
|
|
2172
|
-
|
|
2173
|
-
$[
|
|
2174
|
-
} else
|
|
2175
|
-
let
|
|
2176
|
-
if ($[
|
|
2177
|
-
|
|
2181
|
+
$[17] = commandBusId;
|
|
2182
|
+
$[18] = t12;
|
|
2183
|
+
} else t12 = $[18];
|
|
2184
|
+
let t13;
|
|
2185
|
+
if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2186
|
+
t13 = /* @__PURE__ */ jsx(IconRowInsertBottom, {});
|
|
2187
|
+
$[19] = t13;
|
|
2188
|
+
} else t13 = $[19];
|
|
2189
|
+
let t14;
|
|
2190
|
+
if ($[20] !== commandBusId) {
|
|
2191
|
+
t14 = /* @__PURE__ */ jsx(BlockMenuButton, {
|
|
2178
2192
|
label: "下にブロックを追加",
|
|
2179
2193
|
command: BGE_COMMAND.insertBlock,
|
|
2180
2194
|
commandfor: commandBusId,
|
|
2181
2195
|
value: "after",
|
|
2182
|
-
children:
|
|
2196
|
+
children: t13
|
|
2183
2197
|
});
|
|
2184
|
-
$[
|
|
2185
|
-
$[
|
|
2186
|
-
} else
|
|
2187
|
-
let
|
|
2188
|
-
if ($[
|
|
2189
|
-
|
|
2198
|
+
$[20] = commandBusId;
|
|
2199
|
+
$[21] = t14;
|
|
2200
|
+
} else t14 = $[21];
|
|
2201
|
+
let t15;
|
|
2202
|
+
if ($[22] !== commandBusId || $[23] !== isMutable) {
|
|
2203
|
+
t15 = isMutable ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(BlockMenuButton, {
|
|
2190
2204
|
label: "ブロック内に要素を追加",
|
|
2191
2205
|
command: BGE_COMMAND.updateGridItems,
|
|
2192
2206
|
commandfor: commandBusId,
|
|
@@ -2199,132 +2213,131 @@ function BlockMenuView(t0) {
|
|
|
2199
2213
|
value: "-1",
|
|
2200
2214
|
children: /* @__PURE__ */ jsx(IconLayoutGridRemove, {})
|
|
2201
2215
|
})] }) : null;
|
|
2202
|
-
$[
|
|
2203
|
-
$[
|
|
2204
|
-
$[
|
|
2205
|
-
} else
|
|
2206
|
-
let
|
|
2207
|
-
if ($[
|
|
2208
|
-
|
|
2209
|
-
$[
|
|
2210
|
-
} else
|
|
2211
|
-
let
|
|
2212
|
-
if ($[
|
|
2213
|
-
|
|
2216
|
+
$[22] = commandBusId;
|
|
2217
|
+
$[23] = isMutable;
|
|
2218
|
+
$[24] = t15;
|
|
2219
|
+
} else t15 = $[24];
|
|
2220
|
+
let t16;
|
|
2221
|
+
if ($[25] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2222
|
+
t16 = /* @__PURE__ */ jsx(IconSettings, {});
|
|
2223
|
+
$[25] = t16;
|
|
2224
|
+
} else t16 = $[25];
|
|
2225
|
+
let t17;
|
|
2226
|
+
if ($[26] !== commandBusId) {
|
|
2227
|
+
t17 = /* @__PURE__ */ jsx(BlockMenuButton, {
|
|
2214
2228
|
label: "オプション設定",
|
|
2215
2229
|
command: BGE_COMMAND.openBlockOptions,
|
|
2216
2230
|
commandfor: commandBusId,
|
|
2217
|
-
children:
|
|
2231
|
+
children: t16
|
|
2218
2232
|
});
|
|
2219
|
-
$[
|
|
2220
|
-
$[
|
|
2221
|
-
} else
|
|
2222
|
-
let
|
|
2223
|
-
if ($[
|
|
2224
|
-
|
|
2225
|
-
$[
|
|
2226
|
-
} else
|
|
2227
|
-
let
|
|
2228
|
-
if ($[
|
|
2229
|
-
|
|
2233
|
+
$[26] = commandBusId;
|
|
2234
|
+
$[27] = t17;
|
|
2235
|
+
} else t17 = $[27];
|
|
2236
|
+
let t18;
|
|
2237
|
+
if ($[28] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2238
|
+
t18 = /* @__PURE__ */ jsx(IconClipboardPlus, {});
|
|
2239
|
+
$[28] = t18;
|
|
2240
|
+
} else t18 = $[28];
|
|
2241
|
+
let t19;
|
|
2242
|
+
if ($[29] !== commandBusId) {
|
|
2243
|
+
t19 = /* @__PURE__ */ jsx(BlockMenuButton, {
|
|
2230
2244
|
label: "ブロックをコピー",
|
|
2231
2245
|
command: BGE_COMMAND.copyBlock,
|
|
2232
2246
|
commandfor: commandBusId,
|
|
2233
|
-
children:
|
|
2247
|
+
children: t18
|
|
2234
2248
|
});
|
|
2235
|
-
$[
|
|
2236
|
-
$[
|
|
2237
|
-
} else
|
|
2238
|
-
let
|
|
2239
|
-
if ($[
|
|
2240
|
-
|
|
2241
|
-
$[
|
|
2242
|
-
} else
|
|
2243
|
-
let
|
|
2244
|
-
if ($[
|
|
2245
|
-
|
|
2249
|
+
$[29] = commandBusId;
|
|
2250
|
+
$[30] = t19;
|
|
2251
|
+
} else t19 = $[30];
|
|
2252
|
+
let t20;
|
|
2253
|
+
if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2254
|
+
t20 = /* @__PURE__ */ jsx(IconTrash, {});
|
|
2255
|
+
$[31] = t20;
|
|
2256
|
+
} else t20 = $[31];
|
|
2257
|
+
let t21;
|
|
2258
|
+
if ($[32] !== commandBusId) {
|
|
2259
|
+
t21 = /* @__PURE__ */ jsx(BlockMenuButton, {
|
|
2246
2260
|
label: "ブロックを削除",
|
|
2247
2261
|
command: BGE_COMMAND.removeBlock,
|
|
2248
2262
|
commandfor: commandBusId,
|
|
2249
|
-
children:
|
|
2263
|
+
children: t20
|
|
2250
2264
|
});
|
|
2251
|
-
$[
|
|
2252
|
-
$[
|
|
2253
|
-
} else
|
|
2254
|
-
let
|
|
2255
|
-
if ($[
|
|
2256
|
-
|
|
2265
|
+
$[32] = commandBusId;
|
|
2266
|
+
$[33] = t21;
|
|
2267
|
+
} else t21 = $[33];
|
|
2268
|
+
let t22;
|
|
2269
|
+
if ($[34] !== t12 || $[35] !== t14 || $[36] !== t15 || $[37] !== t17 || $[38] !== t19 || $[39] !== t21) {
|
|
2270
|
+
t22 = /* @__PURE__ */ jsxs("div", {
|
|
2257
2271
|
className: block_menu_module_default.bgeStandardGroup,
|
|
2258
2272
|
children: [
|
|
2259
|
-
|
|
2260
|
-
|
|
2273
|
+
t12,
|
|
2274
|
+
t14,
|
|
2275
|
+
t15,
|
|
2276
|
+
t17,
|
|
2261
2277
|
t19,
|
|
2262
|
-
t21
|
|
2263
|
-
t23,
|
|
2264
|
-
t25
|
|
2278
|
+
t21
|
|
2265
2279
|
]
|
|
2266
2280
|
});
|
|
2267
|
-
$[
|
|
2268
|
-
$[
|
|
2269
|
-
$[
|
|
2270
|
-
$[
|
|
2271
|
-
$[
|
|
2272
|
-
$[
|
|
2273
|
-
$[
|
|
2274
|
-
} else
|
|
2275
|
-
let
|
|
2276
|
-
if ($[
|
|
2277
|
-
|
|
2281
|
+
$[34] = t12;
|
|
2282
|
+
$[35] = t14;
|
|
2283
|
+
$[36] = t15;
|
|
2284
|
+
$[37] = t17;
|
|
2285
|
+
$[38] = t19;
|
|
2286
|
+
$[39] = t21;
|
|
2287
|
+
$[40] = t22;
|
|
2288
|
+
} else t22 = $[40];
|
|
2289
|
+
let t23;
|
|
2290
|
+
if ($[41] !== t10 || $[42] !== t22) {
|
|
2291
|
+
t23 = /* @__PURE__ */ jsxs("div", {
|
|
2278
2292
|
className: block_menu_module_default.bgeMenu,
|
|
2279
|
-
children: [
|
|
2293
|
+
children: [t10, t22]
|
|
2280
2294
|
});
|
|
2281
|
-
$[
|
|
2282
|
-
$[
|
|
2283
|
-
$[
|
|
2284
|
-
} else
|
|
2285
|
-
let
|
|
2286
|
-
if ($[
|
|
2287
|
-
|
|
2295
|
+
$[41] = t10;
|
|
2296
|
+
$[42] = t22;
|
|
2297
|
+
$[43] = t23;
|
|
2298
|
+
} else t23 = $[43];
|
|
2299
|
+
let t24;
|
|
2300
|
+
if ($[44] !== margin.marginBlockEnd || $[45] !== margin.marginBlockEndValue) {
|
|
2301
|
+
t24 = /* @__PURE__ */ jsx("div", {
|
|
2288
2302
|
className: block_menu_module_default.bgeMenuMargin,
|
|
2289
2303
|
children: /* @__PURE__ */ jsxs("span", { children: [
|
|
2290
2304
|
"余白: ",
|
|
2291
|
-
|
|
2305
|
+
margin.marginBlockEndValue,
|
|
2292
2306
|
" (",
|
|
2293
|
-
|
|
2307
|
+
margin.marginBlockEnd,
|
|
2294
2308
|
"px)"
|
|
2295
2309
|
] })
|
|
2296
2310
|
});
|
|
2297
|
-
$[
|
|
2298
|
-
$[
|
|
2299
|
-
$[
|
|
2300
|
-
} else
|
|
2301
|
-
let
|
|
2302
|
-
if ($[
|
|
2303
|
-
|
|
2311
|
+
$[44] = margin.marginBlockEnd;
|
|
2312
|
+
$[45] = margin.marginBlockEndValue;
|
|
2313
|
+
$[46] = t24;
|
|
2314
|
+
} else t24 = $[46];
|
|
2315
|
+
let t25;
|
|
2316
|
+
if ($[47] !== menuId || $[48] !== rootRef || $[49] !== t1 || $[50] !== t23 || $[51] !== t24 || $[52] !== t4 || $[53] !== t5) {
|
|
2317
|
+
t25 = /* @__PURE__ */ jsxs("div", {
|
|
2304
2318
|
ref: rootRef,
|
|
2305
2319
|
id: menuId,
|
|
2306
2320
|
hidden: t1,
|
|
2307
2321
|
className: block_menu_module_default.bgeMenuBase,
|
|
2308
|
-
style:
|
|
2322
|
+
style: t4,
|
|
2309
2323
|
children: [
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2324
|
+
t5,
|
|
2325
|
+
t23,
|
|
2326
|
+
t24
|
|
2313
2327
|
]
|
|
2314
2328
|
});
|
|
2315
|
-
$[
|
|
2316
|
-
$[
|
|
2317
|
-
$[
|
|
2318
|
-
$[
|
|
2319
|
-
$[
|
|
2320
|
-
$[
|
|
2321
|
-
$[
|
|
2322
|
-
$[
|
|
2323
|
-
} else
|
|
2324
|
-
return
|
|
2329
|
+
$[47] = menuId;
|
|
2330
|
+
$[48] = rootRef;
|
|
2331
|
+
$[49] = t1;
|
|
2332
|
+
$[50] = t23;
|
|
2333
|
+
$[51] = t24;
|
|
2334
|
+
$[52] = t4;
|
|
2335
|
+
$[53] = t5;
|
|
2336
|
+
$[54] = t25;
|
|
2337
|
+
} else t25 = $[54];
|
|
2338
|
+
return t25;
|
|
2325
2339
|
}
|
|
2326
|
-
|
|
2327
|
-
//#region src/components/block-menu.tsx
|
|
2340
|
+
// src/components/block-menu.tsx
|
|
2328
2341
|
/**
|
|
2329
2342
|
* Hover menu over the selected block inside the editable area iframe.
|
|
2330
2343
|
* Block operations are declared as engine commands; positioning and
|
|
@@ -2347,7 +2360,7 @@ function BlockMenuView(t0) {
|
|
|
2347
2360
|
* ```
|
|
2348
2361
|
*/
|
|
2349
2362
|
function BlockMenu(t0) {
|
|
2350
|
-
const $ = c(
|
|
2363
|
+
const $ = c(33);
|
|
2351
2364
|
const { container } = t0;
|
|
2352
2365
|
const engine = useEngine();
|
|
2353
2366
|
const menuId = useId();
|
|
@@ -2358,26 +2371,23 @@ function BlockMenu(t0) {
|
|
|
2358
2371
|
t1 = [];
|
|
2359
2372
|
$[0] = t1;
|
|
2360
2373
|
} else t1 = $[0];
|
|
2361
|
-
const [
|
|
2374
|
+
const [itemAnchors, setItemAnchors] = useState(t1);
|
|
2362
2375
|
let t2;
|
|
2363
2376
|
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2364
2377
|
t2 = [];
|
|
2365
2378
|
$[1] = t2;
|
|
2366
2379
|
} else t2 = $[1];
|
|
2367
2380
|
const itemsRef = useRef(t2);
|
|
2381
|
+
const anchoredBlockElRef = useRef(null);
|
|
2368
2382
|
let t3;
|
|
2369
2383
|
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2370
2384
|
t3 = {
|
|
2371
|
-
width: 0,
|
|
2372
|
-
height: 0,
|
|
2373
|
-
x: 0,
|
|
2374
|
-
y: 0,
|
|
2375
2385
|
marginBlockEnd: 0,
|
|
2376
2386
|
marginBlockEndValue: "0px"
|
|
2377
2387
|
};
|
|
2378
2388
|
$[2] = t3;
|
|
2379
2389
|
} else t3 = $[2];
|
|
2380
|
-
const [
|
|
2390
|
+
const [margin, setMargin] = useState(t3);
|
|
2381
2391
|
let t4;
|
|
2382
2392
|
if ($[3] !== engine.isProcessed || $[4] !== engine.uiState) {
|
|
2383
2393
|
t4 = { "--open-item-editor": (e) => {
|
|
@@ -2393,35 +2403,50 @@ function BlockMenu(t0) {
|
|
|
2393
2403
|
} else t4 = $[5];
|
|
2394
2404
|
const rootRef = useCommand(t4);
|
|
2395
2405
|
let t5;
|
|
2396
|
-
if ($[6]
|
|
2406
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2397
2407
|
t5 = () => {
|
|
2408
|
+
const el = anchoredBlockElRef.current;
|
|
2409
|
+
if (el) {
|
|
2410
|
+
clearBlockMenuAnchors(el);
|
|
2411
|
+
anchoredBlockElRef.current = null;
|
|
2412
|
+
}
|
|
2413
|
+
};
|
|
2414
|
+
$[6] = t5;
|
|
2415
|
+
} else t5 = $[6];
|
|
2416
|
+
const clearAnchoredBlock = t5;
|
|
2417
|
+
let t6;
|
|
2418
|
+
if ($[7] !== engine) {
|
|
2419
|
+
t6 = () => {
|
|
2398
2420
|
setVisible(false);
|
|
2421
|
+
clearAnchoredBlock();
|
|
2422
|
+
setItemAnchors([]);
|
|
2423
|
+
itemsRef.current = [];
|
|
2399
2424
|
engine.clearCurrentBlock();
|
|
2400
2425
|
};
|
|
2401
|
-
$[
|
|
2402
|
-
$[
|
|
2403
|
-
} else
|
|
2404
|
-
const hide =
|
|
2405
|
-
let
|
|
2406
|
-
if ($[
|
|
2407
|
-
|
|
2426
|
+
$[7] = engine;
|
|
2427
|
+
$[8] = t6;
|
|
2428
|
+
} else t6 = $[8];
|
|
2429
|
+
const hide = t6;
|
|
2430
|
+
let t7;
|
|
2431
|
+
if ($[9] !== engine.uiState || $[10] !== hide) {
|
|
2432
|
+
t7 = () => engine.uiState.subscribe(() => {
|
|
2408
2433
|
if (engine.uiState.getSnapshot().processing) hide();
|
|
2409
2434
|
});
|
|
2410
|
-
$[
|
|
2411
|
-
$[
|
|
2412
|
-
$[
|
|
2413
|
-
} else
|
|
2414
|
-
let t7;
|
|
2415
|
-
if ($[11] !== engine || $[12] !== hide) {
|
|
2416
|
-
t7 = [engine, hide];
|
|
2417
|
-
$[11] = engine;
|
|
2418
|
-
$[12] = hide;
|
|
2419
|
-
$[13] = t7;
|
|
2420
|
-
} else t7 = $[13];
|
|
2421
|
-
useEffect(t6, t7);
|
|
2435
|
+
$[9] = engine.uiState;
|
|
2436
|
+
$[10] = hide;
|
|
2437
|
+
$[11] = t7;
|
|
2438
|
+
} else t7 = $[11];
|
|
2422
2439
|
let t8;
|
|
2423
|
-
if ($[
|
|
2424
|
-
t8 =
|
|
2440
|
+
if ($[12] !== engine || $[13] !== hide) {
|
|
2441
|
+
t8 = [engine, hide];
|
|
2442
|
+
$[12] = engine;
|
|
2443
|
+
$[13] = hide;
|
|
2444
|
+
$[14] = t8;
|
|
2445
|
+
} else t8 = $[14];
|
|
2446
|
+
useEffect(t7, t8);
|
|
2447
|
+
let t9;
|
|
2448
|
+
if ($[15] !== container.ownerDocument || $[16] !== engine || $[17] !== hide) {
|
|
2449
|
+
t9 = () => {
|
|
2425
2450
|
const doc = container.ownerDocument;
|
|
2426
2451
|
const body = doc.body;
|
|
2427
2452
|
const win = doc.defaultView;
|
|
@@ -2433,6 +2458,7 @@ function BlockMenu(t0) {
|
|
|
2433
2458
|
let raf = 0;
|
|
2434
2459
|
stack.defer(() => cancelAnimationFrame(raf));
|
|
2435
2460
|
stack.defer(() => listeners.abort());
|
|
2461
|
+
stack.defer(() => clearAnchoredBlock());
|
|
2436
2462
|
const updatePosition = () => {
|
|
2437
2463
|
const selected = getBlockAtPosition(doc, mouseX, mouseY);
|
|
2438
2464
|
if (!selected) {
|
|
@@ -2440,27 +2466,20 @@ function BlockMenu(t0) {
|
|
|
2440
2466
|
return;
|
|
2441
2467
|
}
|
|
2442
2468
|
setVisible(true);
|
|
2443
|
-
const { block,
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2469
|
+
const { block, marginBlockEnd } = selected;
|
|
2470
|
+
const blockEl = block.el;
|
|
2471
|
+
if (anchoredBlockElRef.current !== blockEl) {
|
|
2472
|
+
clearAnchoredBlock();
|
|
2473
|
+
anchoredBlockElRef.current = blockEl;
|
|
2474
|
+
}
|
|
2475
|
+
const itemEntries = [...blockEl.querySelectorAll("[data-bgi]")].map(_temp2$1).filter(_temp3);
|
|
2476
|
+
itemsRef.current = itemEntries.map(_temp4);
|
|
2477
|
+
const anchorNames = applyBlockMenuAnchors(blockEl, itemEntries.map(_temp5));
|
|
2478
|
+
setItemAnchors(anchorNames.map(_temp6));
|
|
2479
|
+
setMargin({
|
|
2449
2480
|
marginBlockEnd,
|
|
2450
|
-
marginBlockEndValue:
|
|
2481
|
+
marginBlockEndValue: win?.getComputedStyle(blockEl).getPropertyValue("--bge-block-margin") ?? "0px"
|
|
2451
2482
|
});
|
|
2452
|
-
const itemEntries = [...block.el.querySelectorAll("[data-bgi]")].map(_temp2$1).filter(_temp3);
|
|
2453
|
-
itemsRef.current = itemEntries.map(_temp4);
|
|
2454
|
-
setItemRects(itemEntries.map((t9) => {
|
|
2455
|
-
const { el: itemEl_0 } = t9;
|
|
2456
|
-
const itemRect = itemEl_0.getBoundingClientRect();
|
|
2457
|
-
return {
|
|
2458
|
-
x: itemRect.left - rect.left,
|
|
2459
|
-
y: itemRect.top - rect.top,
|
|
2460
|
-
width: itemRect.width,
|
|
2461
|
-
height: itemRect.height
|
|
2462
|
-
};
|
|
2463
|
-
}));
|
|
2464
2483
|
engine.setCurrentBlock(block);
|
|
2465
2484
|
};
|
|
2466
2485
|
const scheduleUpdate = () => {
|
|
@@ -2485,72 +2504,61 @@ function BlockMenu(t0) {
|
|
|
2485
2504
|
doc.addEventListener("mouseleave", onHideEvent, { signal });
|
|
2486
2505
|
win?.addEventListener("mouseleave", onHideEvent, { signal });
|
|
2487
2506
|
globalThis.addEventListener("resize", onHideEvent, { signal });
|
|
2488
|
-
engine.el.addEventListener("bge:saved", scheduleUpdate, { signal });
|
|
2489
|
-
const observer = new MutationObserver((mutations) => {
|
|
2490
|
-
for (const mutation of mutations) for (const node of mutation.addedNodes) {
|
|
2491
|
-
if (node.nodeType !== Node.ELEMENT_NODE) continue;
|
|
2492
|
-
const element = node;
|
|
2493
|
-
const images = element.matches("img") ? [element] : element.querySelectorAll("img");
|
|
2494
|
-
for (const img of images) {
|
|
2495
|
-
img.addEventListener("load", scheduleUpdate, { once: true });
|
|
2496
|
-
img.addEventListener("error", scheduleUpdate, { once: true });
|
|
2497
|
-
img.addEventListener("abort", scheduleUpdate, { once: true });
|
|
2498
|
-
}
|
|
2499
|
-
}
|
|
2500
|
-
});
|
|
2501
|
-
observer.observe(doc, {
|
|
2502
|
-
childList: true,
|
|
2503
|
-
subtree: true
|
|
2504
|
-
});
|
|
2505
|
-
stack.defer(() => observer.disconnect());
|
|
2506
2507
|
return () => stack.dispose();
|
|
2507
2508
|
};
|
|
2508
|
-
$[
|
|
2509
|
-
$[
|
|
2510
|
-
$[
|
|
2511
|
-
$[
|
|
2512
|
-
} else
|
|
2513
|
-
let
|
|
2514
|
-
if ($[
|
|
2515
|
-
|
|
2509
|
+
$[15] = container.ownerDocument;
|
|
2510
|
+
$[16] = engine;
|
|
2511
|
+
$[17] = hide;
|
|
2512
|
+
$[18] = t9;
|
|
2513
|
+
} else t9 = $[18];
|
|
2514
|
+
let t10;
|
|
2515
|
+
if ($[19] !== container || $[20] !== engine || $[21] !== hide) {
|
|
2516
|
+
t10 = [
|
|
2516
2517
|
engine,
|
|
2517
2518
|
container,
|
|
2518
|
-
hide
|
|
2519
|
+
hide,
|
|
2520
|
+
clearAnchoredBlock
|
|
2519
2521
|
];
|
|
2520
|
-
$[
|
|
2521
|
-
$[
|
|
2522
|
-
$[
|
|
2523
|
-
$[
|
|
2524
|
-
} else
|
|
2525
|
-
useEffect(
|
|
2526
|
-
let t10;
|
|
2527
|
-
if ($[22] !== currentBlock) {
|
|
2528
|
-
t10 = currentBlock?.isMutable() ?? false;
|
|
2529
|
-
$[22] = currentBlock;
|
|
2530
|
-
$[23] = t10;
|
|
2531
|
-
} else t10 = $[23];
|
|
2532
|
-
const isMutable = t10;
|
|
2522
|
+
$[19] = container;
|
|
2523
|
+
$[20] = engine;
|
|
2524
|
+
$[21] = hide;
|
|
2525
|
+
$[22] = t10;
|
|
2526
|
+
} else t10 = $[22];
|
|
2527
|
+
useEffect(t9, t10);
|
|
2533
2528
|
let t11;
|
|
2534
|
-
if ($[
|
|
2535
|
-
t11 =
|
|
2529
|
+
if ($[23] !== currentBlock) {
|
|
2530
|
+
t11 = currentBlock?.isMutable() ?? false;
|
|
2531
|
+
$[23] = currentBlock;
|
|
2532
|
+
$[24] = t11;
|
|
2533
|
+
} else t11 = $[24];
|
|
2534
|
+
const isMutable = t11;
|
|
2535
|
+
let t12;
|
|
2536
|
+
if ($[25] !== engine.commandBus.receiverId || $[26] !== isMutable || $[27] !== itemAnchors || $[28] !== margin || $[29] !== menuId || $[30] !== rootRef || $[31] !== visible) {
|
|
2537
|
+
t12 = /* @__PURE__ */ jsx(BlockMenuView, {
|
|
2536
2538
|
rootRef,
|
|
2537
2539
|
menuId,
|
|
2538
2540
|
commandBusId: engine.commandBus.receiverId,
|
|
2539
2541
|
visible,
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
+
margin,
|
|
2543
|
+
itemAnchors,
|
|
2542
2544
|
isMutable
|
|
2543
2545
|
});
|
|
2544
|
-
$[
|
|
2545
|
-
$[25] = geometry;
|
|
2546
|
+
$[25] = engine.commandBus.receiverId;
|
|
2546
2547
|
$[26] = isMutable;
|
|
2547
|
-
$[27] =
|
|
2548
|
-
$[28] =
|
|
2549
|
-
$[29] =
|
|
2550
|
-
$[30] =
|
|
2551
|
-
$[31] =
|
|
2552
|
-
|
|
2553
|
-
|
|
2548
|
+
$[27] = itemAnchors;
|
|
2549
|
+
$[28] = margin;
|
|
2550
|
+
$[29] = menuId;
|
|
2551
|
+
$[30] = rootRef;
|
|
2552
|
+
$[31] = visible;
|
|
2553
|
+
$[32] = t12;
|
|
2554
|
+
} else t12 = $[32];
|
|
2555
|
+
return t12;
|
|
2556
|
+
}
|
|
2557
|
+
function _temp6(anchorName) {
|
|
2558
|
+
return { anchorName };
|
|
2559
|
+
}
|
|
2560
|
+
function _temp5(entry_1) {
|
|
2561
|
+
return entry_1.el;
|
|
2554
2562
|
}
|
|
2555
2563
|
function _temp4(entry_0) {
|
|
2556
2564
|
return entry_0.item;
|
|
@@ -2567,8 +2575,7 @@ function _temp2$1(itemEl) {
|
|
|
2567
2575
|
function _temp$1(s) {
|
|
2568
2576
|
return s.currentBlock;
|
|
2569
2577
|
}
|
|
2570
|
-
|
|
2571
|
-
//#region src/components/initial-insertion-button.tsx
|
|
2578
|
+
// src/components/initial-insertion-button.tsx
|
|
2572
2579
|
/**
|
|
2573
2580
|
* Button shown in an empty editable area to insert the first block.
|
|
2574
2581
|
* Declares the engine command instead of taking a callback.
|
|
@@ -2596,8 +2603,7 @@ function InitialInsertionButton(t0) {
|
|
|
2596
2603
|
} else t1 = $[1];
|
|
2597
2604
|
return t1;
|
|
2598
2605
|
}
|
|
2599
|
-
|
|
2600
|
-
//#region src/components/editable-area-view.tsx
|
|
2606
|
+
// src/components/editable-area-view.tsx
|
|
2601
2607
|
var CONTAINER_PADDING = 10;
|
|
2602
2608
|
var CONTENT_ID = "bge-editable-area";
|
|
2603
2609
|
/**
|
|
@@ -2676,8 +2682,7 @@ function EditableAreaView(t0) {
|
|
|
2676
2682
|
const injectedUiStyle = frameDoc.createElement("style");
|
|
2677
2683
|
injectedUiStyle.textContent = `@layer ${CSS_LAYER.ui} {
|
|
2678
2684
|
[data-bge-component='block-menu'] {
|
|
2679
|
-
position:
|
|
2680
|
-
inset: 0;
|
|
2685
|
+
position: static;
|
|
2681
2686
|
z-index: 2147483647;
|
|
2682
2687
|
pointer-events: none;
|
|
2683
2688
|
}
|
|
@@ -2702,7 +2707,9 @@ function EditableAreaView(t0) {
|
|
|
2702
2707
|
outline-offset: 2px;
|
|
2703
2708
|
animation: bge-highlight-blink 0.5s ease-in-out 2;
|
|
2704
2709
|
}
|
|
2705
|
-
}
|
|
2710
|
+
}
|
|
2711
|
+
|
|
2712
|
+
${BLOCK_SWAP_VIEW_TRANSITION_CSS}`;
|
|
2706
2713
|
frameDoc.head.append(injectedUiStyle);
|
|
2707
2714
|
frameDoc.body.setAttribute("style", "margin: 0; border: 0;");
|
|
2708
2715
|
engine.commandBus.createReceiver(frameDoc.body);
|
|
@@ -2950,7 +2957,6 @@ function _temp2(s_1) {
|
|
|
2950
2957
|
function _temp(s_0) {
|
|
2951
2958
|
return s_0.processing;
|
|
2952
2959
|
}
|
|
2953
|
-
|
|
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 };
|
|
2960
|
+
export { BlockCatalog as _, BlockMenuButton as a, createReactComponent as b, RootErrorBoundary as c, DraftSwitcher as d, registerEngineCommands as f, BlockOptions as g, EditorDialog as h, BlockMenuView as i, reportRenderError as l, ItemEditorHost as m, InitialInsertionButton as n, BGE_BLOCK_MENU_BLOCK_ANCHOR as o, useUIState as p, BlockMenu as r, useCommand as s, EditableAreaView as t, reactMount as u, IconTrash as v, IconRowInsertBottom as y };
|
|
2955
2961
|
|
|
2956
|
-
//# sourceMappingURL=editable-area-view-
|
|
2962
|
+
//# sourceMappingURL=editable-area-view-CAeVDyOh.js.map
|