@burger-editor/client 4.0.0-alpha.76 → 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/burger-editor-root.d.ts +1 -1
- package/dist/client.css +158 -18
- package/dist/client.js +10865 -10524
- package/dist/client.js.map +1 -1
- package/dist/components/block-catalog.d.ts +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 +8 -3
- package/dist/components/block-menu-button.d.ts.map +1 -1
- package/dist/components/block-menu-view.d.ts +36 -30
- package/dist/components/block-menu-view.d.ts.map +1 -1
- package/dist/components/block-menu.d.ts +1 -1
- package/dist/components/block-menu.d.ts.map +1 -1
- package/dist/components/block-options.d.ts +1 -1
- package/dist/components/block-options.d.ts.map +1 -1
- package/dist/components/draft-switcher.d.ts +1 -1
- package/dist/components/editable-area-view.d.ts +1 -1
- package/dist/components/editable-area-view.d.ts.map +1 -1
- package/dist/components/file-list.d.ts +1 -1
- package/dist/components/file-uploader.d.ts +1 -1
- package/dist/components/front-matter-editor.d.ts +17 -6
- 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/initial-insertion-button.d.ts +1 -1
- package/dist/components/item-editor-host.d.ts +1 -1
- package/dist/components/preview.d.ts +1 -1
- package/dist/components/table-editor.d.ts +1 -1
- package/dist/components/tabs.d.ts +1 -1
- package/dist/components/thumbnail-button.d.ts +39 -0
- package/dist/components/thumbnail-button.d.ts.map +1 -0
- package/dist/components/thumbnail.d.ts +1 -1
- package/dist/components/wysiwyg-field.d.ts +1 -1
- package/dist/create-mock-engine-BloCpuEu.js +87 -0
- package/dist/create-mock-engine-BloCpuEu.js.map +1 -0
- package/dist/{engine-context-D0zt6fhJ.js → dist-DYydjVsL.js} +960 -577
- package/dist/dist-DYydjVsL.js.map +1 -0
- package/dist/{editable-area-view-S2Uz7pl8.js → editable-area-view-CAeVDyOh.js} +693 -672
- package/dist/editable-area-view-CAeVDyOh.js.map +1 -0
- package/dist/editor-dialog.d.ts +1 -1
- package/dist/engine-context-oEEsvNSx.js +49 -0
- package/dist/engine-context-oEEsvNSx.js.map +1 -0
- package/dist/engine-context.d.ts +9 -6
- package/dist/engine-context.d.ts.map +1 -1
- package/dist/form/checkbox.d.ts +1 -1
- package/dist/form/fieldset.d.ts +1 -1
- package/dist/form/number-field.d.ts +1 -1
- package/dist/form/radio-group.d.ts +1 -1
- package/dist/form/select-field.d.ts +5 -2
- package/dist/form/select-field.d.ts.map +1 -1
- package/dist/form/text-area.d.ts +1 -1
- package/dist/form/text-field.d.ts +12 -2
- 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/root-error-boundary.d.ts +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/render-with-engine.d.ts +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 +26 -22
- package/dist/editable-area-view-S2Uz7pl8.js.map +0 -1
- package/dist/engine-context-D0zt6fhJ.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
|
-
import { Component, Fragment, Suspense, createContext, createElement, forwardRef, useActionState, useEffect, useEffectEvent, useId, useRef, useState } from "react";
|
|
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.
|
|
@@ -115,7 +113,7 @@ var createReactComponent = (type, iconName, iconNamePascal, iconNode) => {
|
|
|
115
113
|
`tabler-icon`,
|
|
116
114
|
`tabler-icon-${iconName}`,
|
|
117
115
|
className
|
|
118
|
-
].join(" "),
|
|
116
|
+
].filter(Boolean).join(" "),
|
|
119
117
|
...type === "filled" ? { fill: color } : {
|
|
120
118
|
strokeWidth: stroke,
|
|
121
119
|
stroke: color
|
|
@@ -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,16 +831,27 @@ function _temp$4(t0) {
|
|
|
833
831
|
children: `${variantName_0} (${data_0.value})`
|
|
834
832
|
}, variantName_0);
|
|
835
833
|
}
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
834
|
+
// ../../../node_modules/react-error-boundary/dist/react-error-boundary.js
|
|
835
|
+
var f = createContext(null);
|
|
836
|
+
function m({ children: r, didCatch: e, error: t, resetErrorBoundary: o }) {
|
|
837
|
+
const n = useMemo(() => ({
|
|
838
|
+
didCatch: e,
|
|
839
|
+
error: t,
|
|
840
|
+
resetErrorBoundary: o
|
|
841
|
+
}), [
|
|
842
|
+
e,
|
|
843
|
+
t,
|
|
844
|
+
o
|
|
845
|
+
]);
|
|
846
|
+
return createElement(f.Provider, { value: n }, r);
|
|
847
|
+
}
|
|
848
|
+
var d = {
|
|
840
849
|
didCatch: !1,
|
|
841
850
|
error: null
|
|
842
851
|
};
|
|
843
|
-
var
|
|
852
|
+
var C = class extends Component {
|
|
844
853
|
constructor(e) {
|
|
845
|
-
super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state =
|
|
854
|
+
super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = d;
|
|
846
855
|
}
|
|
847
856
|
static getDerivedStateFromError(e) {
|
|
848
857
|
return {
|
|
@@ -855,51 +864,49 @@ var m = class extends Component {
|
|
|
855
864
|
t && (this.props.onReset?.({
|
|
856
865
|
args: e,
|
|
857
866
|
reason: "imperative-api"
|
|
858
|
-
}), this.setState(
|
|
867
|
+
}), this.setState(d));
|
|
859
868
|
}
|
|
860
869
|
componentDidCatch(e, t) {
|
|
861
870
|
this.props.onError?.(e, t);
|
|
862
871
|
}
|
|
863
872
|
componentDidUpdate(e, t) {
|
|
864
|
-
const { didCatch: o } = this.state, { resetKeys:
|
|
865
|
-
o && t.didCatch &&
|
|
866
|
-
next:
|
|
873
|
+
const { didCatch: o } = this.state, { resetKeys: n } = this.props;
|
|
874
|
+
o && t.didCatch && g(e.resetKeys, n) && (this.props.onReset?.({
|
|
875
|
+
next: n,
|
|
867
876
|
prev: e.resetKeys,
|
|
868
877
|
reason: "keys"
|
|
869
|
-
}), this.setState(
|
|
878
|
+
}), this.setState(d));
|
|
870
879
|
}
|
|
871
880
|
render() {
|
|
872
|
-
const { children: e, fallbackRender: t, FallbackComponent: o, fallback:
|
|
873
|
-
let
|
|
874
|
-
if (
|
|
881
|
+
const { children: e, fallbackRender: t, FallbackComponent: o, fallback: n } = this.props, { didCatch: s, error: a } = this.state;
|
|
882
|
+
let c = e;
|
|
883
|
+
if (s) {
|
|
875
884
|
const u = {
|
|
876
885
|
error: a,
|
|
877
886
|
resetErrorBoundary: this.resetErrorBoundary
|
|
878
887
|
};
|
|
879
|
-
if (typeof t == "function")
|
|
880
|
-
else if (o)
|
|
881
|
-
else if (
|
|
888
|
+
if (typeof t == "function") c = t(u);
|
|
889
|
+
else if (o) c = createElement(o, u);
|
|
890
|
+
else if ("fallback" in this.props) c = n;
|
|
882
891
|
else throw a;
|
|
883
892
|
}
|
|
884
|
-
return createElement(
|
|
885
|
-
didCatch:
|
|
893
|
+
return createElement(m, {
|
|
894
|
+
didCatch: s,
|
|
886
895
|
error: a,
|
|
887
896
|
resetErrorBoundary: this.resetErrorBoundary
|
|
888
|
-
}
|
|
897
|
+
}, c);
|
|
889
898
|
}
|
|
890
899
|
};
|
|
891
|
-
function
|
|
900
|
+
function g(r = [], e = []) {
|
|
892
901
|
return r.length !== e.length || r.some((t, o) => !Object.is(t, e[o]));
|
|
893
902
|
}
|
|
894
|
-
|
|
895
|
-
//#region src/invoker-commands.ts
|
|
903
|
+
// src/invoker-commands.ts
|
|
896
904
|
/**
|
|
897
905
|
* Invoker Commands API attributes for buttons. Re-exported (rather than
|
|
898
906
|
* imported for side effects only) so that the module augmentation above
|
|
899
907
|
* survives d.ts bundling and reaches consumers.
|
|
900
908
|
*/
|
|
901
|
-
|
|
902
|
-
//#region src/editor-dialog.tsx
|
|
909
|
+
// src/editor-dialog.tsx
|
|
903
910
|
/**
|
|
904
911
|
* Minimal fallback for a dialog body that suspended and then threw.
|
|
905
912
|
* Display-only — the dialog's own close button (outside this boundary,
|
|
@@ -1090,7 +1097,7 @@ function EditorDialogBody({ name, formId, dialogId, open, action, buttons, child
|
|
|
1090
1097
|
autoCapitalize: "off",
|
|
1091
1098
|
children: [/* @__PURE__ */ jsx("div", {
|
|
1092
1099
|
"data-bge-component": `${name}-dialog`,
|
|
1093
|
-
children: open ? /* @__PURE__ */ jsx(
|
|
1100
|
+
children: open ? /* @__PURE__ */ jsx(C, {
|
|
1094
1101
|
FallbackComponent: DialogErrorFallback,
|
|
1095
1102
|
children: /* @__PURE__ */ jsx(Suspense, {
|
|
1096
1103
|
fallback: /* @__PURE__ */ jsx(DialogSkeleton, {}),
|
|
@@ -1114,8 +1121,7 @@ function EditorDialogBody({ name, formId, dialogId, open, action, buttons, child
|
|
|
1114
1121
|
children: buttons.complete
|
|
1115
1122
|
}) : null] })] });
|
|
1116
1123
|
}
|
|
1117
|
-
|
|
1118
|
-
//#region src/components/item-editor-host.tsx
|
|
1124
|
+
// src/components/item-editor-host.tsx
|
|
1119
1125
|
/**
|
|
1120
1126
|
* Declarative item editor dialog. Renders the item's `Editor` component
|
|
1121
1127
|
* with editor state derived via `toEditorState`; on submit the state is
|
|
@@ -1290,8 +1296,7 @@ function ItemEditorBody(t0) {
|
|
|
1290
1296
|
} else t6 = $[23];
|
|
1291
1297
|
return t6;
|
|
1292
1298
|
}
|
|
1293
|
-
|
|
1294
|
-
//#region src/use-engine.ts
|
|
1299
|
+
// src/use-engine.ts
|
|
1295
1300
|
var identity = (state) => state;
|
|
1296
1301
|
/**
|
|
1297
1302
|
* Subscribe to the engine's UI state store.
|
|
@@ -1330,74 +1335,51 @@ function useUIState(selector) {
|
|
|
1330
1335
|
const engine = useEngine();
|
|
1331
1336
|
return useSyncExternalStoreWithSelector(engine.uiState.subscribe, engine.uiState.getSnapshot, engine.uiState.getSnapshot, selector ?? identity);
|
|
1332
1337
|
}
|
|
1333
|
-
|
|
1334
|
-
|
|
1338
|
+
// src/replace-element.ts
|
|
1339
|
+
var nextViewTransitionId = 0;
|
|
1335
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.
|
|
1336
1343
|
*
|
|
1337
|
-
*
|
|
1338
|
-
*
|
|
1339
|
-
* @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
|
+
* ```
|
|
1340
1353
|
*/
|
|
1341
|
-
async function replaceElement(elA, elB
|
|
1354
|
+
async function replaceElement(elA, elB) {
|
|
1342
1355
|
if (elA.parentElement !== elB.parentElement) throw new Error("The parent element of the two elements is different.");
|
|
1343
|
-
const
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
const
|
|
1351
|
-
const
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
tmpB.style.height = `${boxB.height}px`;
|
|
1369
|
-
tmpB.style.zIndex = "10";
|
|
1370
|
-
tmpContainer.append(tmpA, tmpB);
|
|
1371
|
-
tmpContainer.ownerDocument.body.append(tmpContainer);
|
|
1372
|
-
elB.remove();
|
|
1373
|
-
elA.before(elB);
|
|
1374
|
-
elA.style.visibility = lockCSS.visibility;
|
|
1375
|
-
elA.style.pointerEvents = lockCSS.pointerEvents;
|
|
1376
|
-
elB.style.visibility = lockCSS.visibility;
|
|
1377
|
-
elB.style.pointerEvents = lockCSS.pointerEvents;
|
|
1378
|
-
const animateA = tmpA.animate([{
|
|
1379
|
-
top: tmpA.style.top,
|
|
1380
|
-
left: tmpA.style.left
|
|
1381
|
-
}, {
|
|
1382
|
-
top: `${boxA.top + boxB.height}px`,
|
|
1383
|
-
left: tmpB.style.left
|
|
1384
|
-
}], { duration });
|
|
1385
|
-
const animateB = tmpB.animate([{
|
|
1386
|
-
top: tmpB.style.top,
|
|
1387
|
-
left: tmpB.style.left
|
|
1388
|
-
}, {
|
|
1389
|
-
top: tmpA.style.top,
|
|
1390
|
-
left: tmpA.style.left
|
|
1391
|
-
}], { duration });
|
|
1392
|
-
await Promise.all([animateA.finished, animateB.finished]);
|
|
1393
|
-
tmpContainer.remove();
|
|
1394
|
-
elA.removeAttribute("style");
|
|
1395
|
-
elB.removeAttribute("style");
|
|
1396
|
-
if (beforeStyleA) elA.style.cssText = beforeStyleA;
|
|
1397
|
-
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
|
+
}
|
|
1398
1381
|
}
|
|
1399
|
-
|
|
1400
|
-
//#region src/commands/register-engine-commands.ts
|
|
1382
|
+
// src/commands/register-engine-commands.ts
|
|
1401
1383
|
/**
|
|
1402
1384
|
* Register the engine's central command dispatch table.
|
|
1403
1385
|
*
|
|
@@ -1522,8 +1504,7 @@ var draft_switcher_module_default = {
|
|
|
1522
1504
|
draftTabBtn: "_draftTabBtn_14xtl_16",
|
|
1523
1505
|
draftCopyBtn: "_draftCopyBtn_14xtl_47"
|
|
1524
1506
|
};
|
|
1525
|
-
|
|
1526
|
-
//#region src/components/draft-switcher.tsx
|
|
1507
|
+
// src/components/draft-switcher.tsx
|
|
1527
1508
|
/**
|
|
1528
1509
|
* Main/draft content switcher. Switching and copying are declared as
|
|
1529
1510
|
* engine commands; the pressed state follows `engine.uiState.activeArea`
|
|
@@ -1685,8 +1666,7 @@ function _temp2$2(s_0) {
|
|
|
1685
1666
|
function _temp$2(s) {
|
|
1686
1667
|
return s.sourceMode;
|
|
1687
1668
|
}
|
|
1688
|
-
|
|
1689
|
-
//#region src/mount.tsx
|
|
1669
|
+
// src/mount.tsx
|
|
1690
1670
|
/**
|
|
1691
1671
|
* Mount a React node into a DOM container and return a `Disposable`
|
|
1692
1672
|
* teardown handle, matching the `UICreator` contract shape used across
|
|
@@ -1716,8 +1696,7 @@ function reactMount(node, target) {
|
|
|
1716
1696
|
[Symbol.dispose]: teardown
|
|
1717
1697
|
};
|
|
1718
1698
|
}
|
|
1719
|
-
|
|
1720
|
-
//#region src/root-error-boundary.tsx
|
|
1699
|
+
// src/root-error-boundary.tsx
|
|
1721
1700
|
/**
|
|
1722
1701
|
* Report a render error onto the engine element as `bge:error`. This is
|
|
1723
1702
|
* the only way an in-tree failure reaches code outside React — `core`
|
|
@@ -1791,7 +1770,7 @@ function RootErrorBoundary(t0) {
|
|
|
1791
1770
|
const { children } = t0;
|
|
1792
1771
|
let t1;
|
|
1793
1772
|
if ($[0] !== children) {
|
|
1794
|
-
t1 = /* @__PURE__ */ jsx(
|
|
1773
|
+
t1 = /* @__PURE__ */ jsx(C, {
|
|
1795
1774
|
FallbackComponent: RootErrorFallback,
|
|
1796
1775
|
children
|
|
1797
1776
|
});
|
|
@@ -1800,8 +1779,7 @@ function RootErrorBoundary(t0) {
|
|
|
1800
1779
|
} else t1 = $[1];
|
|
1801
1780
|
return t1;
|
|
1802
1781
|
}
|
|
1803
|
-
|
|
1804
|
-
//#region src/animate-insertion.ts
|
|
1782
|
+
// src/animate-insertion.ts
|
|
1805
1783
|
var INSERTION_ANIMATION_DURATION_MS = 400;
|
|
1806
1784
|
/**
|
|
1807
1785
|
* Expand the block-insertion marker from zero to its natural height.
|
|
@@ -1828,8 +1806,30 @@ async function animateInsertion(markerEl) {
|
|
|
1828
1806
|
easing: "ease"
|
|
1829
1807
|
}).finished.then(() => {}, () => {});
|
|
1830
1808
|
}
|
|
1831
|
-
|
|
1832
|
-
|
|
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
|
|
1833
1833
|
/**
|
|
1834
1834
|
* Receive Invoker Commands API `command` events on the element the returned
|
|
1835
1835
|
* ref callback is attached to. Buttons address the element with
|
|
@@ -1897,12 +1897,55 @@ function useCommand(handlers) {
|
|
|
1897
1897
|
useEffect(t1, t2);
|
|
1898
1898
|
return setEl;
|
|
1899
1899
|
}
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
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
|
|
1903
1941
|
/**
|
|
1904
|
-
* Icon button of the block menu with an anchored tooltip
|
|
1905
|
-
*
|
|
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.
|
|
1906
1949
|
* @param root0
|
|
1907
1950
|
* @param root0.label
|
|
1908
1951
|
* @param root0.command
|
|
@@ -1942,6 +1985,7 @@ function BlockMenuButton(t0) {
|
|
|
1942
1985
|
t5 = /* @__PURE__ */ jsx("button", {
|
|
1943
1986
|
type: "button",
|
|
1944
1987
|
"aria-labelledby": uid,
|
|
1988
|
+
interestfor: uid,
|
|
1945
1989
|
command,
|
|
1946
1990
|
commandfor,
|
|
1947
1991
|
value,
|
|
@@ -1958,6 +2002,7 @@ function BlockMenuButton(t0) {
|
|
|
1958
2002
|
if ($[10] !== label || $[11] !== uid) {
|
|
1959
2003
|
t6 = /* @__PURE__ */ jsx("span", {
|
|
1960
2004
|
id: uid,
|
|
2005
|
+
popover: "hint",
|
|
1961
2006
|
children: label
|
|
1962
2007
|
});
|
|
1963
2008
|
$[10] = label;
|
|
@@ -1979,45 +2024,45 @@ function BlockMenuButton(t0) {
|
|
|
1979
2024
|
return t7;
|
|
1980
2025
|
}
|
|
1981
2026
|
var block_menu_module_default = {
|
|
1982
|
-
bgeMenuBase: "
|
|
1983
|
-
bgeMenuMargin: "
|
|
1984
|
-
bgeMenu: "
|
|
1985
|
-
bgeItemOverlay: "
|
|
1986
|
-
bgeMoveGroup: "
|
|
1987
|
-
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"
|
|
1988
2033
|
};
|
|
1989
|
-
|
|
1990
|
-
//#region src/components/block-menu-view.tsx
|
|
2034
|
+
// src/components/block-menu-view.tsx
|
|
1991
2035
|
/**
|
|
1992
|
-
*
|
|
1993
|
-
*
|
|
1994
|
-
*
|
|
1995
|
-
* ブロックに追従させる。
|
|
2036
|
+
* 選択中ブロックの下マージン表示用。`BlockMenu` がブロック要素の
|
|
2037
|
+
* 算出スタイルから読み取り、余白インジケータ(`.bgeMenuMargin`)に渡す。
|
|
2038
|
+
* 位置とサイズは CSS アンカー配置(`--bge-current-block`)で追従する。
|
|
1996
2039
|
* @example
|
|
1997
2040
|
* ```ts
|
|
1998
|
-
* const
|
|
1999
|
-
* width: 320,
|
|
2000
|
-
* height: 120,
|
|
2001
|
-
* x: 0,
|
|
2002
|
-
* y: 0,
|
|
2041
|
+
* const margin: BlockMenuMargin = {
|
|
2003
2042
|
* marginBlockEnd: 16,
|
|
2004
2043
|
* marginBlockEndValue: '1em',
|
|
2005
2044
|
* };
|
|
2006
2045
|
* ```
|
|
2007
2046
|
*/
|
|
2008
2047
|
/**
|
|
2009
|
-
* ブロック内の各アイテム(`[data-bgi]
|
|
2010
|
-
*
|
|
2011
|
-
*
|
|
2048
|
+
* ブロック内の各アイテム(`[data-bgi]`)に付与した CSS アンカー名。
|
|
2049
|
+
* 対応する DOM 要素の `anchor-name` と一致し、オーバーレイの
|
|
2050
|
+
* `position-anchor` が参照する。
|
|
2012
2051
|
* @example
|
|
2013
2052
|
* ```ts
|
|
2014
|
-
* const
|
|
2053
|
+
* const anchor: ItemOverlayAnchor = { anchorName: '--bge-block-menu-item-0' };
|
|
2015
2054
|
* ```
|
|
2016
2055
|
*/
|
|
2017
2056
|
/**
|
|
2057
|
+
* @deprecated {@link BlockMenuMargin} に置き換え。位置・サイズはアンカー配置で決まる。
|
|
2058
|
+
*/
|
|
2059
|
+
/**
|
|
2060
|
+
* @deprecated {@link ItemOverlayAnchor} に置き換え。
|
|
2061
|
+
*/
|
|
2062
|
+
/**
|
|
2018
2063
|
* `BlockMenu` の描画専用の中身。マウス追跡・`BurgerBlock` 解決・
|
|
2019
|
-
* `engine`
|
|
2020
|
-
*
|
|
2064
|
+
* `engine` 接続は一切持たず、マージンとアイテムアンカーを props で
|
|
2065
|
+
* 受け取って並べるだけの純粋なプレゼンテーションコンポーネント。
|
|
2021
2066
|
*
|
|
2022
2067
|
* `BurgerBlock` の実インスタンス生成なしに見た目だけ確認したい用途
|
|
2023
2068
|
* (Storybook)のために `BlockMenu` から切り出されている。
|
|
@@ -2026,8 +2071,8 @@ var block_menu_module_default = {
|
|
|
2026
2071
|
* @param root0.menuId
|
|
2027
2072
|
* @param root0.commandBusId
|
|
2028
2073
|
* @param root0.visible
|
|
2029
|
-
* @param root0.
|
|
2030
|
-
* @param root0.
|
|
2074
|
+
* @param root0.margin
|
|
2075
|
+
* @param root0.itemAnchors
|
|
2031
2076
|
* @param root0.isMutable
|
|
2032
2077
|
* @example
|
|
2033
2078
|
* ```tsx
|
|
@@ -2036,145 +2081,126 @@ var block_menu_module_default = {
|
|
|
2036
2081
|
* menuId="bge-block-menu"
|
|
2037
2082
|
* commandBusId={engine.commandBus.receiverId}
|
|
2038
2083
|
* visible
|
|
2039
|
-
*
|
|
2040
|
-
*
|
|
2084
|
+
* margin={{ marginBlockEnd: 0, marginBlockEndValue: '0px' }}
|
|
2085
|
+
* itemAnchors={[{ anchorName: '--bge-block-menu-item-0' }]}
|
|
2041
2086
|
* isMutable
|
|
2042
2087
|
* />
|
|
2043
2088
|
* ```
|
|
2044
2089
|
*/
|
|
2045
2090
|
function BlockMenuView(t0) {
|
|
2046
|
-
const $ = c(
|
|
2047
|
-
const { rootRef, menuId, commandBusId, visible,
|
|
2091
|
+
const $ = c(55);
|
|
2092
|
+
const { rootRef, menuId, commandBusId, visible, margin, itemAnchors, isMutable } = t0;
|
|
2048
2093
|
const t1 = !visible;
|
|
2049
|
-
const t2 = `${
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
const t6 = `${geometry.marginBlockEnd ?? "0"}px`;
|
|
2054
|
-
let t7;
|
|
2055
|
-
if ($[0] !== t2 || $[1] !== t3 || $[2] !== t4 || $[3] !== t5 || $[4] !== t6) {
|
|
2056
|
-
t7 = {
|
|
2057
|
-
"--width": t2,
|
|
2058
|
-
"--height": t3,
|
|
2059
|
-
"--x": t4,
|
|
2060
|
-
"--y": t5,
|
|
2061
|
-
"--margin-block-end": t6
|
|
2062
|
-
};
|
|
2094
|
+
const t2 = `${margin.marginBlockEnd}px`;
|
|
2095
|
+
let t3;
|
|
2096
|
+
if ($[0] !== t2) {
|
|
2097
|
+
t3 = { "--margin-block-end": t2 };
|
|
2063
2098
|
$[0] = t2;
|
|
2064
2099
|
$[1] = t3;
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
if ($[6] !== itemRects || $[7] !== menuId) {
|
|
2073
|
-
let t10;
|
|
2074
|
-
if ($[9] !== menuId) {
|
|
2075
|
-
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", {
|
|
2076
2107
|
type: "button",
|
|
2077
2108
|
className: block_menu_module_default.bgeItemOverlay,
|
|
2078
2109
|
"aria-label": "コンテンツを編集",
|
|
2079
2110
|
command: "--open-item-editor",
|
|
2080
2111
|
commandfor: menuId,
|
|
2081
2112
|
value: index,
|
|
2082
|
-
style: {
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
$[
|
|
2096
|
-
} else
|
|
2097
|
-
let
|
|
2098
|
-
if ($[
|
|
2099
|
-
|
|
2100
|
-
$[11] = t10;
|
|
2101
|
-
} else t10 = $[11];
|
|
2102
|
-
let t11;
|
|
2103
|
-
if ($[12] !== commandBusId) {
|
|
2104
|
-
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, {
|
|
2105
2131
|
label: "ひとつ上へ移動",
|
|
2106
2132
|
command: BGE_COMMAND.moveBlock,
|
|
2107
2133
|
commandfor: commandBusId,
|
|
2108
2134
|
value: "up",
|
|
2109
|
-
children:
|
|
2135
|
+
children: t6
|
|
2110
2136
|
});
|
|
2111
|
-
$[
|
|
2112
|
-
$[
|
|
2113
|
-
} else
|
|
2114
|
-
let
|
|
2115
|
-
if ($[
|
|
2116
|
-
|
|
2117
|
-
$[
|
|
2118
|
-
} else
|
|
2119
|
-
let
|
|
2120
|
-
if ($[
|
|
2121
|
-
|
|
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, {
|
|
2122
2148
|
label: "ひとつ下へ移動",
|
|
2123
2149
|
command: BGE_COMMAND.moveBlock,
|
|
2124
2150
|
commandfor: commandBusId,
|
|
2125
2151
|
value: "down",
|
|
2126
|
-
children:
|
|
2152
|
+
children: t8
|
|
2127
2153
|
});
|
|
2128
|
-
$[
|
|
2129
|
-
$[
|
|
2130
|
-
} else
|
|
2131
|
-
let
|
|
2132
|
-
if ($[
|
|
2133
|
-
|
|
2154
|
+
$[11] = commandBusId;
|
|
2155
|
+
$[12] = t9;
|
|
2156
|
+
} else t9 = $[12];
|
|
2157
|
+
let t10;
|
|
2158
|
+
if ($[13] !== t7 || $[14] !== t9) {
|
|
2159
|
+
t10 = /* @__PURE__ */ jsxs("div", {
|
|
2134
2160
|
className: block_menu_module_default.bgeMoveGroup,
|
|
2135
|
-
children: [
|
|
2161
|
+
children: [t7, t9]
|
|
2136
2162
|
});
|
|
2137
|
-
$[
|
|
2138
|
-
$[
|
|
2139
|
-
$[
|
|
2140
|
-
} else
|
|
2141
|
-
let
|
|
2142
|
-
if ($[
|
|
2143
|
-
|
|
2144
|
-
$[
|
|
2145
|
-
} else
|
|
2146
|
-
let
|
|
2147
|
-
if ($[
|
|
2148
|
-
|
|
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, {
|
|
2149
2175
|
label: "上にブロックを追加",
|
|
2150
2176
|
command: BGE_COMMAND.insertBlock,
|
|
2151
2177
|
commandfor: commandBusId,
|
|
2152
2178
|
value: "before",
|
|
2153
|
-
children:
|
|
2179
|
+
children: t11
|
|
2154
2180
|
});
|
|
2155
|
-
$[
|
|
2156
|
-
$[
|
|
2157
|
-
} else
|
|
2158
|
-
let
|
|
2159
|
-
if ($[
|
|
2160
|
-
|
|
2161
|
-
$[
|
|
2162
|
-
} else
|
|
2163
|
-
let
|
|
2164
|
-
if ($[
|
|
2165
|
-
|
|
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, {
|
|
2166
2192
|
label: "下にブロックを追加",
|
|
2167
2193
|
command: BGE_COMMAND.insertBlock,
|
|
2168
2194
|
commandfor: commandBusId,
|
|
2169
2195
|
value: "after",
|
|
2170
|
-
children:
|
|
2196
|
+
children: t13
|
|
2171
2197
|
});
|
|
2172
|
-
$[
|
|
2173
|
-
$[
|
|
2174
|
-
} else
|
|
2175
|
-
let
|
|
2176
|
-
if ($[
|
|
2177
|
-
|
|
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, {
|
|
2178
2204
|
label: "ブロック内に要素を追加",
|
|
2179
2205
|
command: BGE_COMMAND.updateGridItems,
|
|
2180
2206
|
commandfor: commandBusId,
|
|
@@ -2187,132 +2213,131 @@ function BlockMenuView(t0) {
|
|
|
2187
2213
|
value: "-1",
|
|
2188
2214
|
children: /* @__PURE__ */ jsx(IconLayoutGridRemove, {})
|
|
2189
2215
|
})] }) : null;
|
|
2190
|
-
$[
|
|
2191
|
-
$[
|
|
2192
|
-
$[
|
|
2193
|
-
} else
|
|
2194
|
-
let
|
|
2195
|
-
if ($[
|
|
2196
|
-
|
|
2197
|
-
$[
|
|
2198
|
-
} else
|
|
2199
|
-
let
|
|
2200
|
-
if ($[
|
|
2201
|
-
|
|
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, {
|
|
2202
2228
|
label: "オプション設定",
|
|
2203
2229
|
command: BGE_COMMAND.openBlockOptions,
|
|
2204
2230
|
commandfor: commandBusId,
|
|
2205
|
-
children:
|
|
2231
|
+
children: t16
|
|
2206
2232
|
});
|
|
2207
|
-
$[
|
|
2208
|
-
$[
|
|
2209
|
-
} else
|
|
2210
|
-
let
|
|
2211
|
-
if ($[
|
|
2212
|
-
|
|
2213
|
-
$[
|
|
2214
|
-
} else
|
|
2215
|
-
let
|
|
2216
|
-
if ($[
|
|
2217
|
-
|
|
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, {
|
|
2218
2244
|
label: "ブロックをコピー",
|
|
2219
2245
|
command: BGE_COMMAND.copyBlock,
|
|
2220
2246
|
commandfor: commandBusId,
|
|
2221
|
-
children:
|
|
2247
|
+
children: t18
|
|
2222
2248
|
});
|
|
2223
|
-
$[
|
|
2224
|
-
$[
|
|
2225
|
-
} else
|
|
2226
|
-
let
|
|
2227
|
-
if ($[
|
|
2228
|
-
|
|
2229
|
-
$[
|
|
2230
|
-
} else
|
|
2231
|
-
let
|
|
2232
|
-
if ($[
|
|
2233
|
-
|
|
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, {
|
|
2234
2260
|
label: "ブロックを削除",
|
|
2235
2261
|
command: BGE_COMMAND.removeBlock,
|
|
2236
2262
|
commandfor: commandBusId,
|
|
2237
|
-
children:
|
|
2263
|
+
children: t20
|
|
2238
2264
|
});
|
|
2239
|
-
$[
|
|
2240
|
-
$[
|
|
2241
|
-
} else
|
|
2242
|
-
let
|
|
2243
|
-
if ($[
|
|
2244
|
-
|
|
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", {
|
|
2245
2271
|
className: block_menu_module_default.bgeStandardGroup,
|
|
2246
2272
|
children: [
|
|
2247
|
-
|
|
2248
|
-
|
|
2273
|
+
t12,
|
|
2274
|
+
t14,
|
|
2275
|
+
t15,
|
|
2276
|
+
t17,
|
|
2249
2277
|
t19,
|
|
2250
|
-
t21
|
|
2251
|
-
t23,
|
|
2252
|
-
t25
|
|
2278
|
+
t21
|
|
2253
2279
|
]
|
|
2254
2280
|
});
|
|
2255
|
-
$[
|
|
2256
|
-
$[
|
|
2257
|
-
$[
|
|
2258
|
-
$[
|
|
2259
|
-
$[
|
|
2260
|
-
$[
|
|
2261
|
-
$[
|
|
2262
|
-
} else
|
|
2263
|
-
let
|
|
2264
|
-
if ($[
|
|
2265
|
-
|
|
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", {
|
|
2266
2292
|
className: block_menu_module_default.bgeMenu,
|
|
2267
|
-
children: [
|
|
2293
|
+
children: [t10, t22]
|
|
2268
2294
|
});
|
|
2269
|
-
$[
|
|
2270
|
-
$[
|
|
2271
|
-
$[
|
|
2272
|
-
} else
|
|
2273
|
-
let
|
|
2274
|
-
if ($[
|
|
2275
|
-
|
|
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", {
|
|
2276
2302
|
className: block_menu_module_default.bgeMenuMargin,
|
|
2277
2303
|
children: /* @__PURE__ */ jsxs("span", { children: [
|
|
2278
2304
|
"余白: ",
|
|
2279
|
-
|
|
2305
|
+
margin.marginBlockEndValue,
|
|
2280
2306
|
" (",
|
|
2281
|
-
|
|
2307
|
+
margin.marginBlockEnd,
|
|
2282
2308
|
"px)"
|
|
2283
2309
|
] })
|
|
2284
2310
|
});
|
|
2285
|
-
$[
|
|
2286
|
-
$[
|
|
2287
|
-
$[
|
|
2288
|
-
} else
|
|
2289
|
-
let
|
|
2290
|
-
if ($[
|
|
2291
|
-
|
|
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", {
|
|
2292
2318
|
ref: rootRef,
|
|
2293
2319
|
id: menuId,
|
|
2294
2320
|
hidden: t1,
|
|
2295
2321
|
className: block_menu_module_default.bgeMenuBase,
|
|
2296
|
-
style:
|
|
2322
|
+
style: t4,
|
|
2297
2323
|
children: [
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2324
|
+
t5,
|
|
2325
|
+
t23,
|
|
2326
|
+
t24
|
|
2301
2327
|
]
|
|
2302
2328
|
});
|
|
2303
|
-
$[
|
|
2304
|
-
$[
|
|
2305
|
-
$[
|
|
2306
|
-
$[
|
|
2307
|
-
$[
|
|
2308
|
-
$[
|
|
2309
|
-
$[
|
|
2310
|
-
$[
|
|
2311
|
-
} else
|
|
2312
|
-
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;
|
|
2313
2339
|
}
|
|
2314
|
-
|
|
2315
|
-
//#region src/components/block-menu.tsx
|
|
2340
|
+
// src/components/block-menu.tsx
|
|
2316
2341
|
/**
|
|
2317
2342
|
* Hover menu over the selected block inside the editable area iframe.
|
|
2318
2343
|
* Block operations are declared as engine commands; positioning and
|
|
@@ -2335,7 +2360,7 @@ function BlockMenuView(t0) {
|
|
|
2335
2360
|
* ```
|
|
2336
2361
|
*/
|
|
2337
2362
|
function BlockMenu(t0) {
|
|
2338
|
-
const $ = c(
|
|
2363
|
+
const $ = c(33);
|
|
2339
2364
|
const { container } = t0;
|
|
2340
2365
|
const engine = useEngine();
|
|
2341
2366
|
const menuId = useId();
|
|
@@ -2346,26 +2371,23 @@ function BlockMenu(t0) {
|
|
|
2346
2371
|
t1 = [];
|
|
2347
2372
|
$[0] = t1;
|
|
2348
2373
|
} else t1 = $[0];
|
|
2349
|
-
const [
|
|
2374
|
+
const [itemAnchors, setItemAnchors] = useState(t1);
|
|
2350
2375
|
let t2;
|
|
2351
2376
|
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2352
2377
|
t2 = [];
|
|
2353
2378
|
$[1] = t2;
|
|
2354
2379
|
} else t2 = $[1];
|
|
2355
2380
|
const itemsRef = useRef(t2);
|
|
2381
|
+
const anchoredBlockElRef = useRef(null);
|
|
2356
2382
|
let t3;
|
|
2357
2383
|
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2358
2384
|
t3 = {
|
|
2359
|
-
width: 0,
|
|
2360
|
-
height: 0,
|
|
2361
|
-
x: 0,
|
|
2362
|
-
y: 0,
|
|
2363
2385
|
marginBlockEnd: 0,
|
|
2364
2386
|
marginBlockEndValue: "0px"
|
|
2365
2387
|
};
|
|
2366
2388
|
$[2] = t3;
|
|
2367
2389
|
} else t3 = $[2];
|
|
2368
|
-
const [
|
|
2390
|
+
const [margin, setMargin] = useState(t3);
|
|
2369
2391
|
let t4;
|
|
2370
2392
|
if ($[3] !== engine.isProcessed || $[4] !== engine.uiState) {
|
|
2371
2393
|
t4 = { "--open-item-editor": (e) => {
|
|
@@ -2381,41 +2403,62 @@ function BlockMenu(t0) {
|
|
|
2381
2403
|
} else t4 = $[5];
|
|
2382
2404
|
const rootRef = useCommand(t4);
|
|
2383
2405
|
let t5;
|
|
2384
|
-
if ($[6]
|
|
2406
|
+
if ($[6] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2385
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 = () => {
|
|
2386
2420
|
setVisible(false);
|
|
2421
|
+
clearAnchoredBlock();
|
|
2422
|
+
setItemAnchors([]);
|
|
2423
|
+
itemsRef.current = [];
|
|
2387
2424
|
engine.clearCurrentBlock();
|
|
2388
2425
|
};
|
|
2389
|
-
$[
|
|
2390
|
-
$[
|
|
2391
|
-
} else
|
|
2392
|
-
const hide =
|
|
2393
|
-
let
|
|
2394
|
-
if ($[
|
|
2395
|
-
|
|
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(() => {
|
|
2396
2433
|
if (engine.uiState.getSnapshot().processing) hide();
|
|
2397
2434
|
});
|
|
2398
|
-
$[
|
|
2399
|
-
$[
|
|
2400
|
-
$[
|
|
2401
|
-
} else
|
|
2402
|
-
let t7;
|
|
2403
|
-
if ($[11] !== engine || $[12] !== hide) {
|
|
2404
|
-
t7 = [engine, hide];
|
|
2405
|
-
$[11] = engine;
|
|
2406
|
-
$[12] = hide;
|
|
2407
|
-
$[13] = t7;
|
|
2408
|
-
} else t7 = $[13];
|
|
2409
|
-
useEffect(t6, t7);
|
|
2435
|
+
$[9] = engine.uiState;
|
|
2436
|
+
$[10] = hide;
|
|
2437
|
+
$[11] = t7;
|
|
2438
|
+
} else t7 = $[11];
|
|
2410
2439
|
let t8;
|
|
2411
|
-
if ($[
|
|
2412
|
-
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 = () => {
|
|
2413
2450
|
const doc = container.ownerDocument;
|
|
2414
2451
|
const body = doc.body;
|
|
2415
2452
|
const win = doc.defaultView;
|
|
2453
|
+
const stack = new DisposableStack();
|
|
2454
|
+
const listeners = new AbortController();
|
|
2455
|
+
const { signal } = listeners;
|
|
2416
2456
|
let mouseX = 0;
|
|
2417
2457
|
let mouseY = 0;
|
|
2418
2458
|
let raf = 0;
|
|
2459
|
+
stack.defer(() => cancelAnimationFrame(raf));
|
|
2460
|
+
stack.defer(() => listeners.abort());
|
|
2461
|
+
stack.defer(() => clearAnchoredBlock());
|
|
2419
2462
|
const updatePosition = () => {
|
|
2420
2463
|
const selected = getBlockAtPosition(doc, mouseX, mouseY);
|
|
2421
2464
|
if (!selected) {
|
|
@@ -2423,30 +2466,24 @@ function BlockMenu(t0) {
|
|
|
2423
2466
|
return;
|
|
2424
2467
|
}
|
|
2425
2468
|
setVisible(true);
|
|
2426
|
-
const { block,
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
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({
|
|
2432
2480
|
marginBlockEnd,
|
|
2433
|
-
marginBlockEndValue:
|
|
2481
|
+
marginBlockEndValue: win?.getComputedStyle(blockEl).getPropertyValue("--bge-block-margin") ?? "0px"
|
|
2434
2482
|
});
|
|
2435
|
-
const itemEntries = [...block.el.querySelectorAll("[data-bgi]")].map(_temp2$1).filter(_temp3);
|
|
2436
|
-
itemsRef.current = itemEntries.map(_temp4);
|
|
2437
|
-
setItemRects(itemEntries.map((t9) => {
|
|
2438
|
-
const { el: itemEl_0 } = t9;
|
|
2439
|
-
const itemRect = itemEl_0.getBoundingClientRect();
|
|
2440
|
-
return {
|
|
2441
|
-
x: itemRect.left - rect.left,
|
|
2442
|
-
y: itemRect.top - rect.top,
|
|
2443
|
-
width: itemRect.width,
|
|
2444
|
-
height: itemRect.height
|
|
2445
|
-
};
|
|
2446
|
-
}));
|
|
2447
2483
|
engine.setCurrentBlock(block);
|
|
2448
2484
|
};
|
|
2449
2485
|
const scheduleUpdate = () => {
|
|
2486
|
+
if (signal.aborted) return;
|
|
2450
2487
|
cancelAnimationFrame(raf);
|
|
2451
2488
|
if (engine.isProcessed) {
|
|
2452
2489
|
hide();
|
|
@@ -2462,84 +2499,66 @@ function BlockMenu(t0) {
|
|
|
2462
2499
|
scheduleUpdate();
|
|
2463
2500
|
};
|
|
2464
2501
|
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
|
-
|
|
2471
|
-
const observer = new MutationObserver((mutations) => {
|
|
2472
|
-
for (const mutation of mutations) for (const node of mutation.addedNodes) {
|
|
2473
|
-
if (!(node instanceof HTMLElement)) continue;
|
|
2474
|
-
const images = node.querySelectorAll("img");
|
|
2475
|
-
for (const img of images) {
|
|
2476
|
-
img.addEventListener("load", scheduleUpdate, { once: true });
|
|
2477
|
-
img.addEventListener("error", scheduleUpdate, { once: true });
|
|
2478
|
-
img.addEventListener("abort", scheduleUpdate, { once: true });
|
|
2479
|
-
}
|
|
2480
|
-
}
|
|
2481
|
-
});
|
|
2482
|
-
observer.observe(doc, {
|
|
2483
|
-
childList: true,
|
|
2484
|
-
subtree: true
|
|
2485
|
-
});
|
|
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
|
-
};
|
|
2502
|
+
body.addEventListener("mousemove", onMouseMove, { signal });
|
|
2503
|
+
body.addEventListener("mouseleave", onHideEvent, { signal });
|
|
2504
|
+
doc.addEventListener("mouseleave", onHideEvent, { signal });
|
|
2505
|
+
win?.addEventListener("mouseleave", onHideEvent, { signal });
|
|
2506
|
+
globalThis.addEventListener("resize", onHideEvent, { signal });
|
|
2507
|
+
return () => stack.dispose();
|
|
2496
2508
|
};
|
|
2497
|
-
$[
|
|
2498
|
-
$[
|
|
2499
|
-
$[
|
|
2500
|
-
$[
|
|
2501
|
-
} else
|
|
2502
|
-
let
|
|
2503
|
-
if ($[
|
|
2504
|
-
|
|
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 = [
|
|
2505
2517
|
engine,
|
|
2506
2518
|
container,
|
|
2507
|
-
hide
|
|
2519
|
+
hide,
|
|
2520
|
+
clearAnchoredBlock
|
|
2508
2521
|
];
|
|
2509
|
-
$[
|
|
2510
|
-
$[
|
|
2511
|
-
$[
|
|
2512
|
-
$[
|
|
2513
|
-
} else
|
|
2514
|
-
useEffect(
|
|
2515
|
-
let t10;
|
|
2516
|
-
if ($[22] !== currentBlock) {
|
|
2517
|
-
t10 = currentBlock?.isMutable() ?? false;
|
|
2518
|
-
$[22] = currentBlock;
|
|
2519
|
-
$[23] = t10;
|
|
2520
|
-
} else t10 = $[23];
|
|
2521
|
-
const isMutable = t10;
|
|
2522
|
+
$[19] = container;
|
|
2523
|
+
$[20] = engine;
|
|
2524
|
+
$[21] = hide;
|
|
2525
|
+
$[22] = t10;
|
|
2526
|
+
} else t10 = $[22];
|
|
2527
|
+
useEffect(t9, t10);
|
|
2522
2528
|
let t11;
|
|
2523
|
-
if ($[
|
|
2524
|
-
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, {
|
|
2525
2538
|
rootRef,
|
|
2526
2539
|
menuId,
|
|
2527
2540
|
commandBusId: engine.commandBus.receiverId,
|
|
2528
2541
|
visible,
|
|
2529
|
-
|
|
2530
|
-
|
|
2542
|
+
margin,
|
|
2543
|
+
itemAnchors,
|
|
2531
2544
|
isMutable
|
|
2532
2545
|
});
|
|
2533
|
-
$[
|
|
2534
|
-
$[25] = geometry;
|
|
2546
|
+
$[25] = engine.commandBus.receiverId;
|
|
2535
2547
|
$[26] = isMutable;
|
|
2536
|
-
$[27] =
|
|
2537
|
-
$[28] =
|
|
2538
|
-
$[29] =
|
|
2539
|
-
$[30] =
|
|
2540
|
-
$[31] =
|
|
2541
|
-
|
|
2542
|
-
|
|
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;
|
|
2543
2562
|
}
|
|
2544
2563
|
function _temp4(entry_0) {
|
|
2545
2564
|
return entry_0.item;
|
|
@@ -2556,8 +2575,7 @@ function _temp2$1(itemEl) {
|
|
|
2556
2575
|
function _temp$1(s) {
|
|
2557
2576
|
return s.currentBlock;
|
|
2558
2577
|
}
|
|
2559
|
-
|
|
2560
|
-
//#region src/components/initial-insertion-button.tsx
|
|
2578
|
+
// src/components/initial-insertion-button.tsx
|
|
2561
2579
|
/**
|
|
2562
2580
|
* Button shown in an empty editable area to insert the first block.
|
|
2563
2581
|
* Declares the engine command instead of taking a callback.
|
|
@@ -2585,8 +2603,7 @@ function InitialInsertionButton(t0) {
|
|
|
2585
2603
|
} else t1 = $[1];
|
|
2586
2604
|
return t1;
|
|
2587
2605
|
}
|
|
2588
|
-
|
|
2589
|
-
//#region src/components/editable-area-view.tsx
|
|
2606
|
+
// src/components/editable-area-view.tsx
|
|
2590
2607
|
var CONTAINER_PADDING = 10;
|
|
2591
2608
|
var CONTENT_ID = "bge-editable-area";
|
|
2592
2609
|
/**
|
|
@@ -2619,7 +2636,7 @@ var CONTENT_ID = "bge-editable-area";
|
|
|
2619
2636
|
* ```
|
|
2620
2637
|
*/
|
|
2621
2638
|
function EditableAreaView(t0) {
|
|
2622
|
-
const $ = c(
|
|
2639
|
+
const $ = c(61);
|
|
2623
2640
|
const { type, initialContent, stylesheets, classList, onReady } = t0;
|
|
2624
2641
|
const engine = useEngine();
|
|
2625
2642
|
let t1;
|
|
@@ -2647,9 +2664,9 @@ function EditableAreaView(t0) {
|
|
|
2647
2664
|
} else t3 = $[5];
|
|
2648
2665
|
const [isEmpty, setIsEmpty] = useState(t3 === "");
|
|
2649
2666
|
const [height, setHeight] = useState(0);
|
|
2650
|
-
const [
|
|
2667
|
+
const [containerElement, setContainerElement] = useState(null);
|
|
2668
|
+
const frameBody = containerElement?.ownerDocument.body ?? null;
|
|
2651
2669
|
const initializedRef = useRef(false);
|
|
2652
|
-
const resizeObserverRef = useRef(null);
|
|
2653
2670
|
let t4;
|
|
2654
2671
|
if ($[6] !== classList || $[7] !== engine.commandBus || $[8] !== onReady || $[9] !== stylesheets) {
|
|
2655
2672
|
t4 = (iframe) => {
|
|
@@ -2665,8 +2682,7 @@ function EditableAreaView(t0) {
|
|
|
2665
2682
|
const injectedUiStyle = frameDoc.createElement("style");
|
|
2666
2683
|
injectedUiStyle.textContent = `@layer ${CSS_LAYER.ui} {
|
|
2667
2684
|
[data-bge-component='block-menu'] {
|
|
2668
|
-
position:
|
|
2669
|
-
inset: 0;
|
|
2685
|
+
position: static;
|
|
2670
2686
|
z-index: 2147483647;
|
|
2671
2687
|
pointer-events: none;
|
|
2672
2688
|
}
|
|
@@ -2691,31 +2707,24 @@ function EditableAreaView(t0) {
|
|
|
2691
2707
|
outline-offset: 2px;
|
|
2692
2708
|
animation: bge-highlight-blink 0.5s ease-in-out 2;
|
|
2693
2709
|
}
|
|
2694
|
-
}
|
|
2710
|
+
}
|
|
2711
|
+
|
|
2712
|
+
${BLOCK_SWAP_VIEW_TRANSITION_CSS}`;
|
|
2695
2713
|
frameDoc.head.append(injectedUiStyle);
|
|
2696
2714
|
frameDoc.body.setAttribute("style", "margin: 0; border: 0;");
|
|
2697
2715
|
engine.commandBus.createReceiver(frameDoc.body);
|
|
2698
|
-
const
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
frameDoc.body.append(
|
|
2707
|
-
|
|
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);
|
|
2716
|
+
const content = frameDoc.createElement("div");
|
|
2717
|
+
content.id = CONTENT_ID;
|
|
2718
|
+
content.style.setProperty("padding", `${CONTAINER_PADDING}px`, "important");
|
|
2719
|
+
content.style.setProperty("overflow", "hidden", "important");
|
|
2720
|
+
content.style.setProperty("margin", "0", "important");
|
|
2721
|
+
content.style.setProperty("box-sizing", "border-box", "important");
|
|
2722
|
+
content.classList.add(...classList);
|
|
2723
|
+
content.dataset.bgeComponent = "editable-area";
|
|
2724
|
+
frameDoc.body.append(content);
|
|
2725
|
+
setContainerElement(content);
|
|
2717
2726
|
onReady({
|
|
2718
|
-
containerElement,
|
|
2727
|
+
containerElement: content,
|
|
2719
2728
|
animateInsertion
|
|
2720
2729
|
});
|
|
2721
2730
|
};
|
|
@@ -2728,20 +2737,33 @@ function EditableAreaView(t0) {
|
|
|
2728
2737
|
const initFrame = t4;
|
|
2729
2738
|
let t5;
|
|
2730
2739
|
let t6;
|
|
2731
|
-
if ($[11]
|
|
2732
|
-
t5 = () =>
|
|
2733
|
-
|
|
2740
|
+
if ($[11] !== containerElement) {
|
|
2741
|
+
t5 = () => {
|
|
2742
|
+
if (!containerElement || typeof ResizeObserver === "undefined") return;
|
|
2743
|
+
const stack = new DisposableStack();
|
|
2744
|
+
let raf = 0;
|
|
2745
|
+
stack.defer(() => cancelAnimationFrame(raf));
|
|
2746
|
+
const observer = new ResizeObserver(() => {
|
|
2747
|
+
cancelAnimationFrame(raf);
|
|
2748
|
+
raf = requestAnimationFrame(() => {
|
|
2749
|
+
setHeight(containerElement.getBoundingClientRect().height + 20);
|
|
2750
|
+
});
|
|
2751
|
+
});
|
|
2752
|
+
observer.observe(containerElement);
|
|
2753
|
+
stack.defer(() => observer.disconnect());
|
|
2754
|
+
return () => stack.dispose();
|
|
2734
2755
|
};
|
|
2735
|
-
t6 = [];
|
|
2736
|
-
$[11] =
|
|
2737
|
-
$[12] =
|
|
2756
|
+
t6 = [containerElement];
|
|
2757
|
+
$[11] = containerElement;
|
|
2758
|
+
$[12] = t5;
|
|
2759
|
+
$[13] = t6;
|
|
2738
2760
|
} else {
|
|
2739
|
-
t5 = $[
|
|
2740
|
-
t6 = $[
|
|
2761
|
+
t5 = $[12];
|
|
2762
|
+
t6 = $[13];
|
|
2741
2763
|
}
|
|
2742
2764
|
useEffect(t5, t6);
|
|
2743
2765
|
let t7;
|
|
2744
|
-
if ($[
|
|
2766
|
+
if ($[14] !== engine.el || $[15] !== type) {
|
|
2745
2767
|
t7 = () => {
|
|
2746
2768
|
const onSaved = (e) => {
|
|
2747
2769
|
const value = type === "main" ? e.detail.main : e.detail.draft ?? "";
|
|
@@ -2753,27 +2775,27 @@ function EditableAreaView(t0) {
|
|
|
2753
2775
|
engine.el.removeEventListener("bge:saved", onSaved);
|
|
2754
2776
|
};
|
|
2755
2777
|
};
|
|
2756
|
-
$[
|
|
2757
|
-
$[
|
|
2758
|
-
$[
|
|
2759
|
-
} else t7 = $[
|
|
2778
|
+
$[14] = engine.el;
|
|
2779
|
+
$[15] = type;
|
|
2780
|
+
$[16] = t7;
|
|
2781
|
+
} else t7 = $[16];
|
|
2760
2782
|
let t8;
|
|
2761
|
-
if ($[
|
|
2783
|
+
if ($[17] !== engine || $[18] !== type) {
|
|
2762
2784
|
t8 = [engine, type];
|
|
2763
|
-
$[
|
|
2764
|
-
$[
|
|
2765
|
-
$[
|
|
2766
|
-
} else t8 = $[
|
|
2785
|
+
$[17] = engine;
|
|
2786
|
+
$[18] = type;
|
|
2787
|
+
$[19] = t8;
|
|
2788
|
+
} else t8 = $[19];
|
|
2767
2789
|
useEffect(t7, t8);
|
|
2768
2790
|
let t9;
|
|
2769
|
-
if ($[
|
|
2791
|
+
if ($[20] !== sourceText) {
|
|
2770
2792
|
t9 = () => sourceText;
|
|
2771
|
-
$[
|
|
2772
|
-
$[
|
|
2773
|
-
} else t9 = $[
|
|
2793
|
+
$[20] = sourceText;
|
|
2794
|
+
$[21] = t9;
|
|
2795
|
+
} else t9 = $[21];
|
|
2774
2796
|
const getPendingSourceText = useEffectEvent(t9);
|
|
2775
2797
|
let t10;
|
|
2776
|
-
if ($[
|
|
2798
|
+
if ($[22] !== engine || $[23] !== type) {
|
|
2777
2799
|
t10 = (value_0) => {
|
|
2778
2800
|
engine.commitSourceEdit(type, value_0).then(() => {
|
|
2779
2801
|
const committed = engine.getEditableContent(type)?.getContentsAsString() ?? "";
|
|
@@ -2781,10 +2803,10 @@ function EditableAreaView(t0) {
|
|
|
2781
2803
|
setIsEmpty(committed.trim() === "");
|
|
2782
2804
|
});
|
|
2783
2805
|
};
|
|
2784
|
-
$[
|
|
2785
|
-
$[
|
|
2786
|
-
$[
|
|
2787
|
-
} else t10 = $[
|
|
2806
|
+
$[22] = engine;
|
|
2807
|
+
$[23] = type;
|
|
2808
|
+
$[24] = t10;
|
|
2809
|
+
} else t10 = $[24];
|
|
2788
2810
|
const commitSource = t10;
|
|
2789
2811
|
const [prevSourceMode, setPrevSourceMode] = useState(sourceMode);
|
|
2790
2812
|
if (sourceMode !== prevSourceMode) {
|
|
@@ -2797,7 +2819,7 @@ function EditableAreaView(t0) {
|
|
|
2797
2819
|
}
|
|
2798
2820
|
const wasSourceModeRef = useRef(sourceMode);
|
|
2799
2821
|
let t11;
|
|
2800
|
-
if ($[
|
|
2822
|
+
if ($[25] !== engine || $[26] !== getPendingSourceText || $[27] !== sourceMode || $[28] !== type) {
|
|
2801
2823
|
t11 = () => {
|
|
2802
2824
|
const wasSourceMode = wasSourceModeRef.current;
|
|
2803
2825
|
wasSourceModeRef.current = sourceMode;
|
|
@@ -2813,24 +2835,24 @@ function EditableAreaView(t0) {
|
|
|
2813
2835
|
cancelled = true;
|
|
2814
2836
|
};
|
|
2815
2837
|
};
|
|
2816
|
-
$[
|
|
2817
|
-
$[
|
|
2818
|
-
$[
|
|
2819
|
-
$[
|
|
2820
|
-
$[
|
|
2821
|
-
} else t11 = $[
|
|
2838
|
+
$[25] = engine;
|
|
2839
|
+
$[26] = getPendingSourceText;
|
|
2840
|
+
$[27] = sourceMode;
|
|
2841
|
+
$[28] = type;
|
|
2842
|
+
$[29] = t11;
|
|
2843
|
+
} else t11 = $[29];
|
|
2822
2844
|
let t12;
|
|
2823
|
-
if ($[
|
|
2845
|
+
if ($[30] !== engine || $[31] !== sourceMode || $[32] !== type) {
|
|
2824
2846
|
t12 = [
|
|
2825
2847
|
engine,
|
|
2826
2848
|
type,
|
|
2827
2849
|
sourceMode
|
|
2828
2850
|
];
|
|
2829
|
-
$[
|
|
2830
|
-
$[
|
|
2831
|
-
$[
|
|
2832
|
-
$[
|
|
2833
|
-
} else t12 = $[
|
|
2851
|
+
$[30] = engine;
|
|
2852
|
+
$[31] = sourceMode;
|
|
2853
|
+
$[32] = type;
|
|
2854
|
+
$[33] = t12;
|
|
2855
|
+
} else t12 = $[33];
|
|
2834
2856
|
useEffect(t11, t12);
|
|
2835
2857
|
const t13 = `${type}-editable-area`;
|
|
2836
2858
|
const t14 = sourceMode ? "source" : "visual";
|
|
@@ -2838,18 +2860,18 @@ function EditableAreaView(t0) {
|
|
|
2838
2860
|
const t16 = !sourceMode;
|
|
2839
2861
|
const t17 = !sourceMode;
|
|
2840
2862
|
let t18;
|
|
2841
|
-
if ($[
|
|
2863
|
+
if ($[34] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2842
2864
|
t18 = (e_0) => setSourceText(e_0.currentTarget.value);
|
|
2843
|
-
$[
|
|
2844
|
-
} else t18 = $[
|
|
2865
|
+
$[34] = t18;
|
|
2866
|
+
} else t18 = $[34];
|
|
2845
2867
|
let t19;
|
|
2846
|
-
if ($[
|
|
2868
|
+
if ($[35] !== commitSource) {
|
|
2847
2869
|
t19 = (e_1) => commitSource(e_1.currentTarget.value);
|
|
2848
|
-
$[
|
|
2849
|
-
$[
|
|
2850
|
-
} else t19 = $[
|
|
2870
|
+
$[35] = commitSource;
|
|
2871
|
+
$[36] = t19;
|
|
2872
|
+
} else t19 = $[36];
|
|
2851
2873
|
let t20;
|
|
2852
|
-
if ($[
|
|
2874
|
+
if ($[37] !== sourceText || $[38] !== t16 || $[39] !== t17 || $[40] !== t19) {
|
|
2853
2875
|
t20 = /* @__PURE__ */ jsx("textarea", {
|
|
2854
2876
|
"aria-label": "HTMLソース",
|
|
2855
2877
|
spellCheck: false,
|
|
@@ -2859,23 +2881,23 @@ function EditableAreaView(t0) {
|
|
|
2859
2881
|
onChange: t18,
|
|
2860
2882
|
onBlur: t19
|
|
2861
2883
|
});
|
|
2862
|
-
$[
|
|
2863
|
-
$[
|
|
2864
|
-
$[
|
|
2865
|
-
$[
|
|
2866
|
-
$[
|
|
2867
|
-
} else t20 = $[
|
|
2884
|
+
$[37] = sourceText;
|
|
2885
|
+
$[38] = t16;
|
|
2886
|
+
$[39] = t17;
|
|
2887
|
+
$[40] = t19;
|
|
2888
|
+
$[41] = t20;
|
|
2889
|
+
} else t20 = $[41];
|
|
2868
2890
|
const t21 = type === "main" ? "本稿の編集エリア" : "下書きの編集エリア";
|
|
2869
2891
|
let t22;
|
|
2870
|
-
if ($[
|
|
2892
|
+
if ($[42] === Symbol.for("react.memo_cache_sentinel")) {
|
|
2871
2893
|
t22 = {
|
|
2872
2894
|
inlineSize: "100%",
|
|
2873
2895
|
overflow: "hidden"
|
|
2874
2896
|
};
|
|
2875
|
-
$[
|
|
2876
|
-
} else t22 = $[
|
|
2897
|
+
$[42] = t22;
|
|
2898
|
+
} else t22 = $[42];
|
|
2877
2899
|
let t23;
|
|
2878
|
-
if ($[
|
|
2900
|
+
if ($[43] !== height || $[44] !== initFrame || $[45] !== sourceMode || $[46] !== t21) {
|
|
2879
2901
|
t23 = /* @__PURE__ */ jsx("iframe", {
|
|
2880
2902
|
title: t21,
|
|
2881
2903
|
loading: "lazy",
|
|
@@ -2884,14 +2906,14 @@ function EditableAreaView(t0) {
|
|
|
2884
2906
|
hidden: sourceMode,
|
|
2885
2907
|
ref: initFrame
|
|
2886
2908
|
});
|
|
2887
|
-
$[
|
|
2888
|
-
$[
|
|
2889
|
-
$[
|
|
2890
|
-
$[
|
|
2891
|
-
$[
|
|
2892
|
-
} else t23 = $[
|
|
2909
|
+
$[43] = height;
|
|
2910
|
+
$[44] = initFrame;
|
|
2911
|
+
$[45] = sourceMode;
|
|
2912
|
+
$[46] = t21;
|
|
2913
|
+
$[47] = t23;
|
|
2914
|
+
} else t23 = $[47];
|
|
2893
2915
|
let t24;
|
|
2894
|
-
if ($[
|
|
2916
|
+
if ($[48] !== dialogOpen || $[49] !== engine.commandBus || $[50] !== frameBody || $[51] !== isEmpty || $[52] !== processing) {
|
|
2895
2917
|
t24 = frameBody ? createPortal(/* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
|
|
2896
2918
|
"data-bge-component": "block-menu",
|
|
2897
2919
|
children: /* @__PURE__ */ jsx(BlockMenu, { container: frameBody })
|
|
@@ -2900,15 +2922,15 @@ function EditableAreaView(t0) {
|
|
|
2900
2922
|
hidden: !(isEmpty && !processing && !dialogOpen),
|
|
2901
2923
|
children: /* @__PURE__ */ jsx(InitialInsertionButton, { commandBusId: engine.commandBus.receiverId })
|
|
2902
2924
|
})] }), frameBody) : null;
|
|
2903
|
-
$[
|
|
2904
|
-
$[
|
|
2905
|
-
$[
|
|
2906
|
-
$[
|
|
2907
|
-
$[
|
|
2908
|
-
$[
|
|
2909
|
-
} else t24 = $[
|
|
2925
|
+
$[48] = dialogOpen;
|
|
2926
|
+
$[49] = engine.commandBus;
|
|
2927
|
+
$[50] = frameBody;
|
|
2928
|
+
$[51] = isEmpty;
|
|
2929
|
+
$[52] = processing;
|
|
2930
|
+
$[53] = t24;
|
|
2931
|
+
} else t24 = $[53];
|
|
2910
2932
|
let t25;
|
|
2911
|
-
if ($[
|
|
2933
|
+
if ($[54] !== t13 || $[55] !== t14 || $[56] !== t15 || $[57] !== t20 || $[58] !== t23 || $[59] !== t24) {
|
|
2912
2934
|
t25 = /* @__PURE__ */ jsxs("div", {
|
|
2913
2935
|
"data-bge-component": t13,
|
|
2914
2936
|
"data-bge-component-mode": t14,
|
|
@@ -2919,14 +2941,14 @@ function EditableAreaView(t0) {
|
|
|
2919
2941
|
t24
|
|
2920
2942
|
]
|
|
2921
2943
|
});
|
|
2922
|
-
$[
|
|
2923
|
-
$[
|
|
2924
|
-
$[
|
|
2925
|
-
$[
|
|
2926
|
-
$[
|
|
2927
|
-
$[
|
|
2928
|
-
$[
|
|
2929
|
-
} else t25 = $[
|
|
2944
|
+
$[54] = t13;
|
|
2945
|
+
$[55] = t14;
|
|
2946
|
+
$[56] = t15;
|
|
2947
|
+
$[57] = t20;
|
|
2948
|
+
$[58] = t23;
|
|
2949
|
+
$[59] = t24;
|
|
2950
|
+
$[60] = t25;
|
|
2951
|
+
} else t25 = $[60];
|
|
2930
2952
|
return t25;
|
|
2931
2953
|
}
|
|
2932
2954
|
function _temp2(s_1) {
|
|
@@ -2935,7 +2957,6 @@ function _temp2(s_1) {
|
|
|
2935
2957
|
function _temp(s_0) {
|
|
2936
2958
|
return s_0.processing;
|
|
2937
2959
|
}
|
|
2938
|
-
|
|
2939
|
-
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 };
|
|
2940
2961
|
|
|
2941
|
-
//# sourceMappingURL=editable-area-view-
|
|
2962
|
+
//# sourceMappingURL=editable-area-view-CAeVDyOh.js.map
|