@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.
Files changed (50) hide show
  1. package/README.md +42 -41
  2. package/dist/block-swap-view-transition-css.d.ts +7 -0
  3. package/dist/block-swap-view-transition-css.d.ts.map +1 -0
  4. package/dist/client.css +158 -18
  5. package/dist/client.js +354 -281
  6. package/dist/client.js.map +1 -1
  7. package/dist/components/block-catalog.d.ts.map +1 -1
  8. package/dist/components/block-menu-anchors.d.ts +25 -0
  9. package/dist/components/block-menu-anchors.d.ts.map +1 -0
  10. package/dist/components/block-menu-button.d.ts +7 -2
  11. package/dist/components/block-menu-button.d.ts.map +1 -1
  12. package/dist/components/block-menu-view.d.ts +35 -29
  13. package/dist/components/block-menu-view.d.ts.map +1 -1
  14. package/dist/components/block-menu.d.ts.map +1 -1
  15. package/dist/components/block-options.d.ts.map +1 -1
  16. package/dist/components/editable-area-view.d.ts.map +1 -1
  17. package/dist/components/front-matter-editor.d.ts +16 -5
  18. package/dist/components/front-matter-editor.d.ts.map +1 -1
  19. package/dist/components/index.d.ts +3 -1
  20. package/dist/components/index.d.ts.map +1 -1
  21. package/dist/components/thumbnail-button.d.ts +39 -0
  22. package/dist/components/thumbnail-button.d.ts.map +1 -0
  23. package/dist/create-mock-engine-BloCpuEu.js +87 -0
  24. package/dist/create-mock-engine-BloCpuEu.js.map +1 -0
  25. package/dist/{engine-context-j4-LLPEh.js → dist-DYydjVsL.js} +772 -516
  26. package/dist/dist-DYydjVsL.js.map +1 -0
  27. package/dist/{editable-area-view-BRYT222Y.js → editable-area-view-CAeVDyOh.js} +538 -532
  28. package/dist/editable-area-view-CAeVDyOh.js.map +1 -0
  29. package/dist/engine-context-oEEsvNSx.js +49 -0
  30. package/dist/engine-context-oEEsvNSx.js.map +1 -0
  31. package/dist/form/select-field.d.ts +4 -1
  32. package/dist/form/select-field.d.ts.map +1 -1
  33. package/dist/form/text-field.d.ts +11 -1
  34. package/dist/form/text-field.d.ts.map +1 -1
  35. package/dist/interest-hints.d.ts +21 -0
  36. package/dist/interest-hints.d.ts.map +1 -0
  37. package/dist/replace-element.d.ts +12 -4
  38. package/dist/replace-element.d.ts.map +1 -1
  39. package/dist/testing/create-mock-engine.d.ts +3 -0
  40. package/dist/testing/create-mock-engine.d.ts.map +1 -1
  41. package/dist/testing-mock-engine.js +1 -0
  42. package/dist/testing.js +4 -55
  43. package/dist/testing.js.map +1 -1
  44. package/dist/ui.d.ts +1 -0
  45. package/dist/ui.d.ts.map +1 -1
  46. package/dist/ui.js +267 -160
  47. package/dist/ui.js.map +1 -1
  48. package/package.json +25 -21
  49. package/dist/editable-area-view-BRYT222Y.js.map +0 -1
  50. package/dist/engine-context-j4-LLPEh.js.map +0 -1
package/dist/ui.js CHANGED
@@ -1,11 +1,12 @@
1
- import { d as formatDate, n as useEngine, t as EngineProvider, u as formatByteSize } from "./engine-context-j4-LLPEh.js";
2
- import { _ as IconTrash, a as BlockMenuButton, c as reportRenderError, d as registerEngineCommands, f as useUIState, g as BlockCatalog, h as BlockOptions, i as BlockMenuView, l as reactMount, m as EditorDialog, n as InitialInsertionButton, o as useCommand, p as ItemEditorHost, r as BlockMenu, s as RootErrorBoundary, t as EditableAreaView, u as DraftSwitcher, v as IconRowInsertBottom, y as createReactComponent } from "./editable-area-view-BRYT222Y.js";
1
+ import { _ as BlockCatalog, a as BlockMenuButton, b as createReactComponent, c as RootErrorBoundary, d as DraftSwitcher, f as registerEngineCommands, g as BlockOptions, h as EditorDialog, i as BlockMenuView, l as reportRenderError, m as ItemEditorHost, n as InitialInsertionButton, o as BGE_BLOCK_MENU_BLOCK_ANCHOR, p as useUIState, r as BlockMenu, s as useCommand, t as EditableAreaView, u as reactMount, v as IconTrash, y as IconRowInsertBottom } from "./editable-area-view-CAeVDyOh.js";
2
+ import { n as useEngine, t as EngineProvider } from "./engine-context-oEEsvNSx.js";
3
+ import { c as formatByteSize, l as formatDate } from "./dist-DYydjVsL.js";
3
4
  import { c } from "react/compiler-runtime";
4
5
  import { Fragment, use, useDeferredValue, useEffect, useEffectEvent, useId, useRef, useState, useSyncExternalStore, useTransition } from "react";
5
6
  import { jsx, jsxs } from "react/jsx-runtime";
6
7
  import { createRoot } from "react-dom/client";
7
8
  /**
8
- * @license @tabler/icons-react v3.48.0 - MIT
9
+ * @license @tabler/icons-react v3.49.0 - MIT
9
10
  *
10
11
  * This source code is licensed under the MIT license.
11
12
  * See the LICENSE file in the root directory of this source tree.
@@ -37,7 +38,7 @@ var IconArrowsTransferDown = createReactComponent("outline", "arrows-transfer-do
37
38
  }]
38
39
  ]);
39
40
  /**
40
- * @license @tabler/icons-react v3.48.0 - MIT
41
+ * @license @tabler/icons-react v3.49.0 - MIT
41
42
  *
42
43
  * This source code is licensed under the MIT license.
43
44
  * See the LICENSE file in the root directory of this source tree.
@@ -65,7 +66,7 @@ var IconFileTypeDoc = createReactComponent("outline", "file-type-doc", "FileType
65
66
  }]
66
67
  ]);
67
68
  /**
68
- * @license @tabler/icons-react v3.48.0 - MIT
69
+ * @license @tabler/icons-react v3.49.0 - MIT
69
70
  *
70
71
  * This source code is licensed under the MIT license.
71
72
  * See the LICENSE file in the root directory of this source tree.
@@ -97,7 +98,7 @@ var IconFileTypePdf = createReactComponent("outline", "file-type-pdf", "FileType
97
98
  }]
98
99
  ]);
99
100
  /**
100
- * @license @tabler/icons-react v3.48.0 - MIT
101
+ * @license @tabler/icons-react v3.49.0 - MIT
101
102
  *
102
103
  * This source code is licensed under the MIT license.
103
104
  * See the LICENSE file in the root directory of this source tree.
@@ -133,7 +134,7 @@ var IconFileTypePpt = createReactComponent("outline", "file-type-ppt", "FileType
133
134
  }]
134
135
  ]);
135
136
  /**
136
- * @license @tabler/icons-react v3.48.0 - MIT
137
+ * @license @tabler/icons-react v3.49.0 - MIT
137
138
  *
138
139
  * This source code is licensed under the MIT license.
139
140
  * See the LICENSE file in the root directory of this source tree.
@@ -165,7 +166,7 @@ var IconFileTypeXls = createReactComponent("outline", "file-type-xls", "FileType
165
166
  }]
166
167
  ]);
167
168
  /**
168
- * @license @tabler/icons-react v3.48.0 - MIT
169
+ * @license @tabler/icons-react v3.49.0 - MIT
169
170
  *
170
171
  * This source code is licensed under the MIT license.
171
172
  * See the LICENSE file in the root directory of this source tree.
@@ -178,7 +179,7 @@ var IconFile = createReactComponent("outline", "file", "File", [["path", {
178
179
  "key": "svg-1"
179
180
  }]]);
180
181
  /**
181
- * @license @tabler/icons-react v3.48.0 - MIT
182
+ * @license @tabler/icons-react v3.49.0 - MIT
182
183
  *
183
184
  * This source code is licensed under the MIT license.
184
185
  * See the LICENSE file in the root directory of this source tree.
@@ -198,7 +199,31 @@ var IconHeadphones = createReactComponent("outline", "headphones", "Headphones",
198
199
  }]
199
200
  ]);
200
201
  /**
201
- * @license @tabler/icons-react v3.48.0 - MIT
202
+ * @license @tabler/icons-react v3.49.0 - MIT
203
+ *
204
+ * This source code is licensed under the MIT license.
205
+ * See the LICENSE file in the root directory of this source tree.
206
+ */
207
+ var IconPhoto = createReactComponent("outline", "photo", "Photo", [
208
+ ["path", {
209
+ "d": "M15 8h.01",
210
+ "key": "svg-0"
211
+ }],
212
+ ["path", {
213
+ "d": "M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12",
214
+ "key": "svg-1"
215
+ }],
216
+ ["path", {
217
+ "d": "M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5",
218
+ "key": "svg-2"
219
+ }],
220
+ ["path", {
221
+ "d": "M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3",
222
+ "key": "svg-3"
223
+ }]
224
+ ]);
225
+ /**
226
+ * @license @tabler/icons-react v3.49.0 - MIT
202
227
  *
203
228
  * This source code is licensed under the MIT license.
204
229
  * See the LICENSE file in the root directory of this source tree.
@@ -210,8 +235,7 @@ var IconVideo = createReactComponent("outline", "video", "Video", [["path", {
210
235
  "d": "M3 8a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2l0 -8",
211
236
  "key": "svg-1"
212
237
  }]]);
213
- //#endregion
214
- //#region src/file-browser/store.ts
238
+ // src/file-browser/store.ts
215
239
  /**
216
240
  * A file currently selected for a given `FileType` inside a dialog — the
217
241
  * path the item editor should apply, plus the byte size the old
@@ -448,8 +472,7 @@ function getFileBrowserStore(engine) {
448
472
  }
449
473
  return store;
450
474
  }
451
- //#endregion
452
- //#region src/file-browser/use-file-browser.ts
475
+ // src/file-browser/use-file-browser.ts
453
476
  /**
454
477
  * Get the current engine's `FileBrowserStore` — file-list query cache,
455
478
  * current selection and upload progress shared by `FileList`,
@@ -485,8 +508,7 @@ var file_list_module_default = {
485
508
  thumbnail: "_thumbnail_1vnsv_58",
486
509
  attr: "_attr_1vnsv_65"
487
510
  };
488
- //#endregion
489
- //#region src/get-ext.ts
511
+ // src/get-ext.ts
490
512
  /**
491
513
  *
492
514
  * @param src
@@ -523,8 +545,7 @@ function getExt(src) {
523
545
  };
524
546
  }
525
547
  var thumbnail_module_default = { thumbnail: "_thumbnail_bi2ve_1" };
526
- //#endregion
527
- //#region src/components/thumbnail.tsx
548
+ // src/components/thumbnail.tsx
528
549
  /**
529
550
  * File thumbnail. Renders an image/video preview or a file-type icon.
530
551
  *
@@ -596,8 +617,7 @@ function Thumbnail(t0) {
596
617
  } else t3 = $[14];
597
618
  return t3;
598
619
  }
599
- //#endregion
600
- //#region src/components/file-list.tsx
620
+ // src/components/file-list.tsx
601
621
  /**
602
622
  * Paginated, searchable file list. Reads its page through `use()` against
603
623
  * the engine's `FileBrowserStore` (suspends into the dialog's Suspense
@@ -776,8 +796,7 @@ function scrollToSelected(el) {
776
796
  });
777
797
  }
778
798
  var file_uploader_module_default = { uploader: "_uploader_obiwu_1" };
779
- //#endregion
780
- //#region src/components/file-uploader.tsx
799
+ // src/components/file-uploader.tsx
781
800
  /**
782
801
  * File upload control. The trigger button declares a local command and
783
802
  * the handler opens the picker via `showPicker()` — no click handlers,
@@ -865,8 +884,7 @@ function FileUploader(t0) {
865
884
  } else t5 = $[14];
866
885
  return t5;
867
886
  }
868
- //#endregion
869
- //#region src/components/front-matter-editor.tsx
887
+ // src/components/front-matter-editor.tsx
870
888
  /**
871
889
  * Supported field types for Front Matter editor
872
890
  */
@@ -875,8 +893,9 @@ function FileUploader(t0) {
875
893
  */
876
894
  /**
877
895
  * Owns the Front Matter field list — the actual data, as opposed to the
878
- * view's own UI-only state (collapsed, add-dialog-open, in-progress JSON
879
- * drafts). `createFrontMatterEditor`'s handle reads `getData()`/
896
+ * view's own UI-only state (add-dialog-open, in-progress JSON drafts).
897
+ * Whether the panel is open is not part of this store.
898
+ * `createFrontMatterEditor`'s handle reads `getData()`/
880
899
  * `getSnapshot()` directly and subscribes to be notified of changes,
881
900
  * instead of a mutable closure variable updated from inside a React
882
901
  * callback — the handle has no other way to read React state from
@@ -956,9 +975,19 @@ function createFrontMatterEditor(options) {
956
975
  }
957
976
  /**
958
977
  * Front Matterの動的フォーム本体。フィールド一覧は`store`(唯一の
959
- * データソース)から読み、折りたたみ・追加ダイアログ・JSON下書きは
960
- * この見た目だけのUI状態としてローカルに持つ。操作は Invoker Commands
961
- * (`--fm-toggle` / `--fm-add-field` / `--fm-delete-field`)で受ける
978
+ * データソース)から読み、追加ダイアログとJSON下書きはこの見た目だけの
979
+ * UI状態としてローカルに持つ。フィールドの追加と削除は Invoker Commands
980
+ * (`--fm-add-field` / `--fm-delete-field`)で受ける。
981
+ *
982
+ * 開閉は `<details>` の `open` に任せる。Invoker Command と React の
983
+ * state には戻さない。同じ状態をコマンドのハンドラと DOM の属性の両方に
984
+ * 持つと、再レンダーのたびにどちらかがもう一方を上書きする。
985
+ *
986
+ * 「+ 追加」は `summary` の外に置く。`summary` の内容モデルはフレーズ内容
987
+ * で、ボタンを入れると対話要素の入れ子になり、押すとパネルも開閉する。
988
+ * 閉じた `details` の中に置くと、閉じている間はボタンが押せなくなる。
989
+ * 見た目は見出し行の右端だが、DOM 順ではフィールドの後なので、キーボードの
990
+ * 移動順は見出し、フィールド、追加ボタンになる。
962
991
  * @param root0
963
992
  * @param root0.store
964
993
  * @example
@@ -970,7 +999,6 @@ function FrontMatterEditorView({ store }) {
970
999
  const rootId = useId();
971
1000
  const dialogId = useId();
972
1001
  const fields = useSyncExternalStore(store.subscribe, store.getSnapshot);
973
- const [isCollapsed, setIsCollapsed] = useState(false);
974
1002
  const [addDialogOpen, setAddDialogOpen] = useState(false);
975
1003
  const [jsonDrafts, setJsonDrafts] = useState({});
976
1004
  const applyFields = (next) => {
@@ -983,9 +1011,6 @@ function FrontMatterEditorView({ store }) {
983
1011
  } : f));
984
1012
  };
985
1013
  const rootRef = useCommand({
986
- "--fm-toggle": () => {
987
- setIsCollapsed((prev) => !prev);
988
- },
989
1014
  "--fm-add-field": () => {
990
1015
  setAddDialogOpen(true);
991
1016
  },
@@ -993,8 +1018,8 @@ function FrontMatterEditorView({ store }) {
993
1018
  const key_0 = e.source?.value;
994
1019
  if (key_0 == null) return;
995
1020
  applyFields(fields.filter((f_0) => f_0.key !== key_0));
996
- setJsonDrafts((prev_0) => {
997
- const { [key_0]: _removed, ...rest } = prev_0;
1021
+ setJsonDrafts((prev) => {
1022
+ const { [key_0]: _removed, ...rest } = prev;
998
1023
  return rest;
999
1024
  });
1000
1025
  }
@@ -1016,67 +1041,61 @@ function FrontMatterEditorView({ store }) {
1016
1041
  id: rootId,
1017
1042
  className: "fm-editor",
1018
1043
  children: [
1019
- /* @__PURE__ */ jsxs("div", {
1020
- className: "fm-editor-header",
1021
- children: [/* @__PURE__ */ jsxs("button", {
1022
- type: "button",
1044
+ /* @__PURE__ */ jsxs("details", {
1045
+ className: "fm-editor-details",
1046
+ open: true,
1047
+ children: [/* @__PURE__ */ jsx("summary", {
1023
1048
  className: "fm-editor-toggle",
1024
- "aria-expanded": !isCollapsed,
1025
- command: "--fm-toggle",
1026
- commandfor: rootId,
1027
- children: [/* @__PURE__ */ jsx("span", {
1028
- className: "fm-editor-toggle-icon",
1029
- children: isCollapsed ? "▶" : "▼"
1030
- }), /* @__PURE__ */ jsx("span", { children: "Front Matter" })]
1031
- }), /* @__PURE__ */ jsx("button", {
1032
- type: "button",
1033
- className: "fm-editor-add",
1034
- title: "フィールドを追加",
1035
- command: "--fm-add-field",
1036
- commandfor: rootId,
1037
- children: "+ 追加"
1049
+ children: "Front Matter"
1050
+ }), /* @__PURE__ */ jsx("div", {
1051
+ className: "fm-editor-fields",
1052
+ children: fields.length === 0 ? /* @__PURE__ */ jsx("div", {
1053
+ className: "fm-editor-empty",
1054
+ children: "フィールドがありません。「+ 追加」ボタンでフィールドを追加してください。"
1055
+ }) : fields.map((field) => /* @__PURE__ */ jsxs("div", {
1056
+ className: "fm-editor-field",
1057
+ "data-type": field.type,
1058
+ children: [
1059
+ /* @__PURE__ */ jsx("label", {
1060
+ className: "fm-editor-field-label",
1061
+ htmlFor: `${rootId}-field-${field.key}`,
1062
+ children: field.key
1063
+ }),
1064
+ /* @__PURE__ */ jsx("div", {
1065
+ className: "fm-editor-field-input",
1066
+ children: /* @__PURE__ */ jsx(FieldInput, {
1067
+ field,
1068
+ inputId: `${rootId}-field-${field.key}`,
1069
+ jsonDraft: jsonDrafts[field.key],
1070
+ onValueChange: (value_0) => updateFieldValue(field.key, value_0),
1071
+ onJsonDraftChange: (text) => {
1072
+ setJsonDrafts((prev_0) => ({
1073
+ ...prev_0,
1074
+ [field.key]: text
1075
+ }));
1076
+ }
1077
+ })
1078
+ }),
1079
+ /* @__PURE__ */ jsx("button", {
1080
+ type: "button",
1081
+ className: "fm-editor-field-delete",
1082
+ title: "フィールドを削除",
1083
+ command: "--fm-delete-field",
1084
+ commandfor: rootId,
1085
+ value: field.key,
1086
+ children: "×"
1087
+ })
1088
+ ]
1089
+ }, field.key))
1038
1090
  })]
1039
1091
  }),
1040
- isCollapsed ? null : /* @__PURE__ */ jsx("div", {
1041
- className: "fm-editor-fields",
1042
- children: fields.length === 0 ? /* @__PURE__ */ jsx("div", {
1043
- className: "fm-editor-empty",
1044
- children: "フィールドがありません。「+ 追加」ボタンでフィールドを追加してください。"
1045
- }) : fields.map((field) => /* @__PURE__ */ jsxs("div", {
1046
- className: "fm-editor-field",
1047
- "data-type": field.type,
1048
- children: [
1049
- /* @__PURE__ */ jsx("label", {
1050
- className: "fm-editor-field-label",
1051
- htmlFor: `${rootId}-field-${field.key}`,
1052
- children: field.key
1053
- }),
1054
- /* @__PURE__ */ jsx("div", {
1055
- className: "fm-editor-field-input",
1056
- children: /* @__PURE__ */ jsx(FieldInput, {
1057
- field,
1058
- inputId: `${rootId}-field-${field.key}`,
1059
- jsonDraft: jsonDrafts[field.key],
1060
- onValueChange: (value_0) => updateFieldValue(field.key, value_0),
1061
- onJsonDraftChange: (text) => {
1062
- setJsonDrafts((prev_1) => ({
1063
- ...prev_1,
1064
- [field.key]: text
1065
- }));
1066
- }
1067
- })
1068
- }),
1069
- /* @__PURE__ */ jsx("button", {
1070
- type: "button",
1071
- className: "fm-editor-field-delete",
1072
- title: "フィールドを削除",
1073
- command: "--fm-delete-field",
1074
- commandfor: rootId,
1075
- value: field.key,
1076
- children: "×"
1077
- })
1078
- ]
1079
- }, field.key))
1092
+ /* @__PURE__ */ jsx("button", {
1093
+ type: "button",
1094
+ className: "fm-editor-add",
1095
+ title: "フィールドを追加",
1096
+ command: "--fm-add-field",
1097
+ commandfor: rootId,
1098
+ children: "+ 追加"
1080
1099
  }),
1081
1100
  addDialogOpen ? /* @__PURE__ */ jsx(AddFieldDialog, {
1082
1101
  dialogId,
@@ -1535,8 +1554,7 @@ var preview_module_default = {
1535
1554
  upload: "_upload_18j28_26",
1536
1555
  dimension: "_dimension_18j28_72"
1537
1556
  };
1538
- //#endregion
1539
- //#region src/components/preview.tsx
1557
+ // src/components/preview.tsx
1540
1558
  /**
1541
1559
  * File preview pane. The previewed path comes from the parent (lifted
1542
1560
  * from the item's own state); upload progress is read from the engine's
@@ -1755,8 +1773,7 @@ var table_editor_module_default = {
1755
1773
  row: "_row_1qb61_7",
1756
1774
  btn: "_btn_1qb61_19"
1757
1775
  };
1758
- //#endregion
1759
- //#region src/components/table-editor.tsx
1776
+ // src/components/table-editor.tsx
1760
1777
  /**
1761
1778
  * Row-aligned table cell text: `th[i]` and `td[i]` form one row. In the
1762
1779
  * table item the `td` cells hold Markdown while editing (converted
@@ -1933,8 +1950,7 @@ function _temp$1() {
1933
1950
  return crypto.randomUUID();
1934
1951
  }
1935
1952
  var tabs_module_default = { tablist: "_tablist_1hyld_1" };
1936
- //#endregion
1937
- //#region src/components/tabs.tsx
1953
+ // src/components/tabs.tsx
1938
1954
  /**
1939
1955
  * Controlled tab list. Selection is lifted to the parent via
1940
1956
  * `current`/`onChange`; tab buttons declare a local command instead of a
@@ -1991,8 +2007,92 @@ function Tabs({ current, onChange, contentId, length = 2, createLabel = (index)
1991
2007
  }, index_1))
1992
2008
  });
1993
2009
  }
1994
- //#endregion
1995
- //#region src/components/wysiwyg-field.tsx
2010
+ var thumbnail_button_module_default = {
2011
+ button: "_button_fs9jb_4",
2012
+ image: "_image_fs9jb_3",
2013
+ placeholder: "_placeholder_fs9jb_23",
2014
+ "tabler-icon": "_tabler-icon_fs9jb_36",
2015
+ label: "_label_fs9jb_44"
2016
+ };
2017
+ // src/components/thumbnail-button.tsx
2018
+ /**
2019
+ * Thumbnail that is itself a button. Pressing it invokes `command` on the
2020
+ * `commandfor` target (like every other button in the editor UI, no click
2021
+ * handler). The `label` is hidden until the pointer hovers it or it gets
2022
+ * keyboard focus, so the thumbnail stays uncluttered but the action is
2023
+ * discoverable.
2024
+ *
2025
+ * An empty `src` renders a placeholder of the same size, so a row of
2026
+ * thumbnails keeps its layout while some of them have no file yet.
2027
+ *
2028
+ * `aria-label` is the accessible name. It must contain `label` and say what
2029
+ * the button acts on, since several of these buttons sit side by side.
2030
+ * @param root0
2031
+ * @param root0.src - File URL to preview; empty for "no file yet"
2032
+ * @param root0.label - Text shown on hover / focus (e.g. `編集`)
2033
+ * @param root0.command - Command name invoked on the `commandfor` target (a custom `--`-prefixed command or a built-in one)
2034
+ * @param root0.commandfor - The id of the element that receives the command; it must be in the same document as the button
2035
+ * @param root0.value - Passed to the command handler as `source.value`
2036
+ * @example
2037
+ * ```tsx
2038
+ * <ThumbnailButton
2039
+ * src={slide.path}
2040
+ * label="編集"
2041
+ * aria-label={`スライド${index + 1}を編集`}
2042
+ * command="--edit-slide"
2043
+ * commandfor={rootId}
2044
+ * value={String(index)}
2045
+ * />
2046
+ * ```
2047
+ */
2048
+ function ThumbnailButton(t0) {
2049
+ const $ = c(11);
2050
+ const { src, label, "aria-label": ariaLabel, command, commandfor, value } = t0;
2051
+ let t1;
2052
+ if ($[0] !== src) {
2053
+ t1 = /* @__PURE__ */ jsx("span", {
2054
+ className: thumbnail_button_module_default.image,
2055
+ children: src ? /* @__PURE__ */ jsx(Thumbnail, { src }) : /* @__PURE__ */ jsxs("span", {
2056
+ className: thumbnail_button_module_default.placeholder,
2057
+ "data-bge-thumbnail-placeholder": "",
2058
+ children: [/* @__PURE__ */ jsx(IconPhoto, { "aria-hidden": "true" }), /* @__PURE__ */ jsx("span", { children: "画像未選択" })]
2059
+ })
2060
+ });
2061
+ $[0] = src;
2062
+ $[1] = t1;
2063
+ } else t1 = $[1];
2064
+ let t2;
2065
+ if ($[2] !== label) {
2066
+ t2 = /* @__PURE__ */ jsx("span", {
2067
+ className: thumbnail_button_module_default.label,
2068
+ "aria-hidden": "true",
2069
+ children: label
2070
+ });
2071
+ $[2] = label;
2072
+ $[3] = t2;
2073
+ } else t2 = $[3];
2074
+ let t3;
2075
+ if ($[4] !== ariaLabel || $[5] !== command || $[6] !== commandfor || $[7] !== t1 || $[8] !== t2 || $[9] !== value) {
2076
+ t3 = /* @__PURE__ */ jsxs("button", {
2077
+ type: "button",
2078
+ className: thumbnail_button_module_default.button,
2079
+ "aria-label": ariaLabel,
2080
+ command,
2081
+ commandfor,
2082
+ value,
2083
+ children: [t1, t2]
2084
+ });
2085
+ $[4] = ariaLabel;
2086
+ $[5] = command;
2087
+ $[6] = commandfor;
2088
+ $[7] = t1;
2089
+ $[8] = t2;
2090
+ $[9] = value;
2091
+ $[10] = t3;
2092
+ } else t3 = $[10];
2093
+ return t3;
2094
+ }
2095
+ // src/components/wysiwyg-field.tsx
1996
2096
  /**
1997
2097
  * Wrap `promise` so a rejection resolves to `fallback` instead, without
1998
2098
  * breaking the `use()` cache contract (react.dev's `wrapPromise` pattern:
@@ -2115,8 +2215,7 @@ function WysiwygField(t0) {
2115
2215
  } else t6 = $[12];
2116
2216
  return t6;
2117
2217
  }
2118
- //#endregion
2119
- //#region src/use-mount-effect.ts
2218
+ // src/use-mount-effect.ts
2120
2219
  /**
2121
2220
  * Run `fn` exactly once, when the component mounts, always reading `fn`'s
2122
2221
  * latest closure (via `useEffectEvent`) rather than the one captured at
@@ -2153,8 +2252,7 @@ function useMountEffect(fn) {
2153
2252
  } else t1 = $[2];
2154
2253
  useEffect(t0, t1);
2155
2254
  }
2156
- //#endregion
2157
- //#region src/file-browser/use-external-file-selection.ts
2255
+ // src/file-browser/use-external-file-selection.ts
2158
2256
  /**
2159
2257
  * React to a file becoming selected from outside the item's own `Editor`
2160
2258
  * (i.e. via `FileList`, in the same `FileBrowserStore` the item's own
@@ -2226,8 +2324,7 @@ function useExternalFileSelection(selected, getCurrentPath, onExternalChange) {
2226
2324
  } else t2 = $[7];
2227
2325
  useEffect(t1, t2);
2228
2326
  }
2229
- //#endregion
2230
- //#region src/form/checkbox.tsx
2327
+ // src/form/checkbox.tsx
2231
2328
  /**
2232
2329
  * Controlled checkbox following the editor form markup convention
2233
2330
  * (`label > input + text`).
@@ -2287,8 +2384,7 @@ function Checkbox(t0) {
2287
2384
  } else t3 = $[10];
2288
2385
  return t3;
2289
2386
  }
2290
- //#endregion
2291
- //#region src/form/fieldset.tsx
2387
+ // src/form/fieldset.tsx
2292
2388
  /**
2293
2389
  * Grouping fieldset following the editor form markup convention
2294
2390
  * (`fieldset > legend`).
@@ -2336,8 +2432,7 @@ function Fieldset(t0) {
2336
2432
  } else t2 = $[6];
2337
2433
  return t2;
2338
2434
  }
2339
- //#endregion
2340
- //#region src/form/number-field.tsx
2435
+ // src/form/number-field.tsx
2341
2436
  /**
2342
2437
  * Controlled numeric input following the editor form markup convention.
2343
2438
  *
@@ -2410,8 +2505,7 @@ function NumberField(t0) {
2410
2505
  } else t5 = $[14];
2411
2506
  return t5;
2412
2507
  }
2413
- //#endregion
2414
- //#region src/form/radio-group.tsx
2508
+ // src/form/radio-group.tsx
2415
2509
  /**
2416
2510
  * Controlled radio group following the editor form markup convention
2417
2511
  * (`div[role=radiogroup] > label > input + text`).
@@ -2496,8 +2590,7 @@ function RadioGroup(t0) {
2496
2590
  } else t3 = $[17];
2497
2591
  return t3;
2498
2592
  }
2499
- //#endregion
2500
- //#region src/form/select-field.tsx
2593
+ // src/form/select-field.tsx
2501
2594
  /**
2502
2595
  * Controlled select following the editor form markup convention
2503
2596
  * (`label > span + select`).
@@ -2512,6 +2605,8 @@ function RadioGroup(t0) {
2512
2605
  * @param root0.options
2513
2606
  * @param root0.name
2514
2607
  * @param root0.disabled
2608
+ * @param root0.describedBy - The ID of the element that describes the select
2609
+ * (for example, why it is disabled), wired through `aria-describedby`.
2515
2610
  * @example
2516
2611
  * ```tsx
2517
2612
  * <SelectField
@@ -2527,8 +2622,8 @@ function RadioGroup(t0) {
2527
2622
  * ```
2528
2623
  */
2529
2624
  function SelectField(t0) {
2530
- const $ = c(15);
2531
- const { label, value, onChange, options, name, disabled } = t0;
2625
+ const $ = c(16);
2626
+ const { label, value, onChange, options, name, disabled, describedBy } = t0;
2532
2627
  let t1;
2533
2628
  if ($[0] !== label) {
2534
2629
  t1 = /* @__PURE__ */ jsx("span", { children: label });
@@ -2548,28 +2643,30 @@ function SelectField(t0) {
2548
2643
  $[5] = t3;
2549
2644
  } else t3 = $[5];
2550
2645
  let t4;
2551
- if ($[6] !== disabled || $[7] !== name || $[8] !== t2 || $[9] !== t3 || $[10] !== value) {
2646
+ if ($[6] !== describedBy || $[7] !== disabled || $[8] !== name || $[9] !== t2 || $[10] !== t3 || $[11] !== value) {
2552
2647
  t4 = /* @__PURE__ */ jsx("select", {
2553
2648
  name,
2554
2649
  value,
2555
2650
  disabled,
2651
+ "aria-describedby": describedBy,
2556
2652
  onChange: t2,
2557
2653
  children: t3
2558
2654
  });
2559
- $[6] = disabled;
2560
- $[7] = name;
2561
- $[8] = t2;
2562
- $[9] = t3;
2563
- $[10] = value;
2564
- $[11] = t4;
2565
- } else t4 = $[11];
2655
+ $[6] = describedBy;
2656
+ $[7] = disabled;
2657
+ $[8] = name;
2658
+ $[9] = t2;
2659
+ $[10] = t3;
2660
+ $[11] = value;
2661
+ $[12] = t4;
2662
+ } else t4 = $[12];
2566
2663
  let t5;
2567
- if ($[12] !== t1 || $[13] !== t4) {
2664
+ if ($[13] !== t1 || $[14] !== t4) {
2568
2665
  t5 = /* @__PURE__ */ jsxs("label", { children: [t1, t4] });
2569
- $[12] = t1;
2570
- $[13] = t4;
2571
- $[14] = t5;
2572
- } else t5 = $[14];
2666
+ $[13] = t1;
2667
+ $[14] = t4;
2668
+ $[15] = t5;
2669
+ } else t5 = $[15];
2573
2670
  return t5;
2574
2671
  }
2575
2672
  function _temp(option) {
@@ -2578,8 +2675,7 @@ function _temp(option) {
2578
2675
  children: option.label
2579
2676
  }, option.value);
2580
2677
  }
2581
- //#endregion
2582
- //#region src/form/text-area.tsx
2678
+ // src/form/text-area.tsx
2583
2679
  /**
2584
2680
  * Controlled multi-line text input following the editor form markup
2585
2681
  * convention.
@@ -2644,8 +2740,7 @@ function TextArea(t0) {
2644
2740
  } else t4 = $[12];
2645
2741
  return t4;
2646
2742
  }
2647
- //#endregion
2648
- //#region src/form/text-field.tsx
2743
+ // src/form/text-field.tsx
2649
2744
  /**
2650
2745
  * Controlled single-line text input following the editor form markup
2651
2746
  * convention (`label > span + input`).
@@ -2662,6 +2757,14 @@ function TextArea(t0) {
2662
2757
  * @param root0.disabled
2663
2758
  * @param root0.placeholder
2664
2759
  * @param root0.describedBy
2760
+ * @param root0.required - Marks the field as required for assistive
2761
+ * technology via `aria-required`. The native `required` attribute is not
2762
+ * used: `type` is dynamic here, so markup linting cannot tell it is valid.
2763
+ * The dialog form is `noValidate`, so the browser never blocks submission;
2764
+ * the item's `toItemData` is what rejects an empty value.
2765
+ * @param root0.onBlur - Called when focus leaves the input. Use it to
2766
+ * normalize a value (for example, to restore a default when the field was
2767
+ * left empty) once the user has finished typing, not on every keystroke.
2665
2768
  * @example
2666
2769
  * ```tsx
2667
2770
  * <TextField
@@ -2673,8 +2776,8 @@ function TextArea(t0) {
2673
2776
  * ```
2674
2777
  */
2675
2778
  function TextField(t0) {
2676
- const $ = c(15);
2677
- const { label, value, onChange, type: t1, name, disabled, placeholder, describedBy } = t0;
2779
+ const $ = c(17);
2780
+ const { label, value, onChange, type: t1, name, disabled, placeholder, describedBy, required, onBlur } = t0;
2678
2781
  const type = t1 === void 0 ? "text" : t1;
2679
2782
  let t2;
2680
2783
  if ($[0] !== label) {
@@ -2682,42 +2785,46 @@ function TextField(t0) {
2682
2785
  $[0] = label;
2683
2786
  $[1] = t2;
2684
2787
  } else t2 = $[1];
2685
- let t3;
2788
+ const t3 = required || void 0;
2789
+ let t4;
2686
2790
  if ($[2] !== onChange) {
2687
- t3 = (e) => onChange(e.currentTarget.value);
2791
+ t4 = (e) => onChange(e.currentTarget.value);
2688
2792
  $[2] = onChange;
2689
- $[3] = t3;
2690
- } else t3 = $[3];
2691
- let t4;
2692
- if ($[4] !== describedBy || $[5] !== disabled || $[6] !== name || $[7] !== placeholder || $[8] !== t3 || $[9] !== type || $[10] !== value) {
2693
- t4 = /* @__PURE__ */ jsx("input", {
2793
+ $[3] = t4;
2794
+ } else t4 = $[3];
2795
+ let t5;
2796
+ if ($[4] !== describedBy || $[5] !== disabled || $[6] !== name || $[7] !== onBlur || $[8] !== placeholder || $[9] !== t3 || $[10] !== t4 || $[11] !== type || $[12] !== value) {
2797
+ t5 = /* @__PURE__ */ jsx("input", {
2694
2798
  type,
2695
2799
  name,
2696
2800
  value,
2697
2801
  disabled,
2802
+ "aria-required": t3,
2698
2803
  placeholder,
2699
2804
  "aria-describedby": describedBy,
2700
- onChange: t3
2805
+ onChange: t4,
2806
+ onBlur
2701
2807
  });
2702
2808
  $[4] = describedBy;
2703
2809
  $[5] = disabled;
2704
2810
  $[6] = name;
2705
- $[7] = placeholder;
2706
- $[8] = t3;
2707
- $[9] = type;
2708
- $[10] = value;
2709
- $[11] = t4;
2710
- } else t4 = $[11];
2711
- let t5;
2712
- if ($[12] !== t2 || $[13] !== t4) {
2713
- t5 = /* @__PURE__ */ jsxs("label", { children: [t2, t4] });
2714
- $[12] = t2;
2715
- $[13] = t4;
2716
- $[14] = t5;
2717
- } else t5 = $[14];
2718
- return t5;
2811
+ $[7] = onBlur;
2812
+ $[8] = placeholder;
2813
+ $[9] = t3;
2814
+ $[10] = t4;
2815
+ $[11] = type;
2816
+ $[12] = value;
2817
+ $[13] = t5;
2818
+ } else t5 = $[13];
2819
+ let t6;
2820
+ if ($[14] !== t2 || $[15] !== t5) {
2821
+ t6 = /* @__PURE__ */ jsxs("label", { children: [t2, t5] });
2822
+ $[14] = t2;
2823
+ $[15] = t5;
2824
+ $[16] = t6;
2825
+ } else t6 = $[16];
2826
+ return t6;
2719
2827
  }
2720
- //#endregion
2721
- export { BlockCatalog, BlockMenu, BlockMenuButton, BlockMenuView, BlockOptions, Checkbox, DraftSwitcher, EditableAreaView, EditorDialog, EngineProvider, Fieldset, FileList, FileUploader, FrontMatterEditorView, FrontMatterStore, InitialInsertionButton, ItemEditorHost, NumberField, Preview, RadioGroup, RootErrorBoundary, SelectField, TableEditor, Tabs, TextArea, TextField, Thumbnail, WysiwygField, createFrontMatterEditor, reactMount, registerEngineCommands, reportRenderError, useCommand, useEngine, useExternalFileSelection, useFileBrowser, useMountEffect, useUIState };
2828
+ export { BGE_BLOCK_MENU_BLOCK_ANCHOR, BlockCatalog, BlockMenu, BlockMenuButton, BlockMenuView, BlockOptions, Checkbox, DraftSwitcher, EditableAreaView, EditorDialog, EngineProvider, Fieldset, FileList, FileUploader, FrontMatterEditorView, FrontMatterStore, InitialInsertionButton, ItemEditorHost, NumberField, Preview, RadioGroup, RootErrorBoundary, SelectField, TableEditor, Tabs, TextArea, TextField, Thumbnail, ThumbnailButton, WysiwygField, createFrontMatterEditor, reactMount, registerEngineCommands, reportRenderError, useCommand, useEngine, useExternalFileSelection, useFileBrowser, useMountEffect, useUIState };
2722
2829
 
2723
2830
  //# sourceMappingURL=ui.js.map