@burger-editor/client 4.0.0-alpha.70 → 4.0.0-alpha.72
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 +93 -242
- package/dist/animate-insertion.d.ts +17 -0
- package/dist/animate-insertion.d.ts.map +1 -0
- package/dist/burger-editor-root.d.ts +11 -0
- package/dist/burger-editor-root.d.ts.map +1 -0
- package/dist/client.css +465 -434
- package/dist/client.js +26083 -48423
- package/dist/client.js.map +1 -1
- package/dist/commands/register-engine-commands.d.ts +17 -0
- package/dist/commands/register-engine-commands.d.ts.map +1 -0
- package/dist/components/block-catalog.d.ts +20 -0
- package/dist/components/block-catalog.d.ts.map +1 -0
- package/dist/components/block-menu-button.d.ts +28 -0
- package/dist/components/block-menu-button.d.ts.map +1 -0
- package/dist/components/block-menu-view.d.ts +78 -0
- package/dist/components/block-menu-view.d.ts.map +1 -0
- package/dist/components/block-menu.d.ts +28 -0
- package/dist/components/block-menu.d.ts.map +1 -0
- package/dist/components/block-options.d.ts +25 -0
- package/dist/components/block-options.d.ts.map +1 -0
- package/dist/components/draft-switcher.d.ts +23 -0
- package/dist/components/draft-switcher.d.ts.map +1 -0
- package/dist/components/editable-area-view.d.ts +44 -0
- package/dist/components/editable-area-view.d.ts.map +1 -0
- package/dist/components/file-list.d.ts +19 -0
- package/dist/components/file-list.d.ts.map +1 -0
- package/dist/components/file-uploader.d.ts +18 -0
- package/dist/components/file-uploader.d.ts.map +1 -0
- package/dist/components/front-matter-editor.d.ts +72 -0
- package/dist/components/front-matter-editor.d.ts.map +1 -0
- package/dist/components/index.d.ts +21 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/initial-insertion-button.d.ts +10 -0
- package/dist/components/initial-insertion-button.d.ts.map +1 -0
- package/dist/components/item-editor-host.d.ts +23 -0
- package/dist/components/item-editor-host.d.ts.map +1 -0
- package/dist/components/preview.d.ts +18 -0
- package/dist/components/preview.d.ts.map +1 -0
- package/dist/components/table-editor.d.ts +28 -0
- package/dist/components/table-editor.d.ts.map +1 -0
- package/dist/components/tabs.d.ts +27 -0
- package/dist/components/tabs.d.ts.map +1 -0
- package/dist/components/thumbnail.d.ts +17 -0
- package/dist/components/thumbnail.d.ts.map +1 -0
- package/dist/components/wysiwyg-field.d.ts +40 -0
- package/dist/components/wysiwyg-field.d.ts.map +1 -0
- package/dist/editable-area-view-C00DSDVk.js +17510 -0
- package/dist/editable-area-view-C00DSDVk.js.map +1 -0
- package/dist/editor-dialog.d.ts +41 -0
- package/dist/editor-dialog.d.ts.map +1 -0
- package/dist/form/checkbox.d.ts +34 -0
- package/dist/form/checkbox.d.ts.map +1 -0
- package/dist/form/fieldset.d.ts +31 -0
- package/dist/form/fieldset.d.ts.map +1 -0
- package/dist/form/index.d.ts +8 -0
- package/dist/form/index.d.ts.map +1 -0
- package/dist/form/number-field.d.ts +37 -0
- package/dist/form/number-field.d.ts.map +1 -0
- package/dist/form/radio-group.d.ts +38 -0
- package/dist/form/radio-group.d.ts.map +1 -0
- package/dist/form/select-field.d.ts +38 -0
- package/dist/form/select-field.d.ts.map +1 -0
- package/dist/form/text-area.d.ts +33 -0
- package/dist/form/text-area.d.ts.map +1 -0
- package/dist/form/text-field.d.ts +35 -0
- package/dist/form/text-field.d.ts.map +1 -0
- package/dist/index.d.ts +37 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/invoker-commands.d.ts +24 -0
- package/dist/invoker-commands.d.ts.map +1 -0
- package/dist/mount.d.ts +19 -0
- package/dist/mount.d.ts.map +1 -0
- package/dist/ui.d.ts +10 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +1632 -0
- package/dist/ui.js.map +1 -0
- package/dist/use-command.d.ts +29 -0
- package/dist/use-command.d.ts.map +1 -0
- package/dist/use-engine.d.ts +53 -0
- package/dist/use-engine.d.ts.map +1 -0
- package/dist/view/create-react-view.d.ts +17 -0
- package/dist/view/create-react-view.d.ts.map +1 -0
- package/package.json +25 -13
- package/dist/block-catalog.svelte.d.ts +0 -1
- package/dist/block-menu-button.svelte.d.ts +0 -1
- package/dist/block-menu.svelte.d.ts +0 -1
- package/dist/block-options.svelte.d.ts +0 -1
- package/dist/draft-switcher.svelte.d.ts +0 -1
- package/dist/engine-state.svelte.d.ts +0 -42
- package/dist/engine-state.svelte.d.ts.map +0 -1
- package/dist/file-list.svelte.d.ts +0 -1
- package/dist/file-uploader.svelte.d.ts +0 -1
- package/dist/initial-insertion-button.svelte.d.ts +0 -1
- package/dist/preview.svelte.d.ts +0 -1
- package/dist/svelte-mount.d.ts +0 -10
- package/dist/svelte-mount.d.ts.map +0 -1
- package/dist/table-editor.svelte.d.ts +0 -1
- package/dist/tabs.svelte.d.ts +0 -1
- package/dist/thumbnail.svelte.d.ts +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BlockCatalog, BurgerEditorEngine } from '@burger-editor/core';
|
|
2
|
+
/**
|
|
3
|
+
* Register the engine's central command dispatch table.
|
|
4
|
+
*
|
|
5
|
+
* This is the single place where engine-mutating UI commands are
|
|
6
|
+
* implemented; buttons anywhere (main document or EditableArea iframes)
|
|
7
|
+
* declare them with `commandfor={COMMAND_BUS_ID}`. Call once per engine.
|
|
8
|
+
* @param engine - The engine instance
|
|
9
|
+
* @param catalog - The block catalog used by `--add-block`
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const engine = await BurgerEditorEngine.new(options);
|
|
13
|
+
* registerEngineCommands(engine, options.catalog);
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare function registerEngineCommands(engine: BurgerEditorEngine, catalog: BlockCatalog): void;
|
|
17
|
+
//# sourceMappingURL=register-engine-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-engine-commands.d.ts","sourceRoot":"","sources":["../../src/commands/register-engine-commands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAM5E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CACrC,MAAM,EAAE,kBAAkB,EAC1B,OAAO,EAAE,YAAY,QA6LrB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BlockCatalog as BlockCatalogData, BurgerEditorEngine } from '@burger-editor/core';
|
|
2
|
+
/**
|
|
3
|
+
* Block catalog dialog content. Adding and pasting blocks are declared
|
|
4
|
+
* as engine commands; the catalog entry is identified by
|
|
5
|
+
* `data-category` / `data-index` on the invoker button.
|
|
6
|
+
* @param root0
|
|
7
|
+
* @param root0.engine
|
|
8
|
+
* @param root0.catalog
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <EditorDialog name="catalog" open={open} onClose={close} buttons={{ close: 'キャンセル' }}>
|
|
12
|
+
* <BlockCatalog engine={engine} catalog={engine.catalog} />
|
|
13
|
+
* </EditorDialog>
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare function BlockCatalog({ engine, catalog, }: {
|
|
17
|
+
readonly engine: BurgerEditorEngine;
|
|
18
|
+
readonly catalog: BlockCatalogData;
|
|
19
|
+
}): import("react").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=block-catalog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-catalog.d.ts","sourceRoot":"","sources":["../../src/components/block-catalog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,YAAY,IAAI,gBAAgB,EAChC,kBAAkB,EAClB,MAAM,qBAAqB,CAAC;AAQ7B;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,EAC5B,MAAM,EACN,OAAO,GACP,EAAE;IACF,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAC;CACnC,+BA6DA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Icon button of the block menu with an anchored tooltip. The action is
|
|
4
|
+
* declared with the Invoker Commands API instead of a click handler.
|
|
5
|
+
* @param root0
|
|
6
|
+
* @param root0.label
|
|
7
|
+
* @param root0.command
|
|
8
|
+
* @param root0.commandfor
|
|
9
|
+
* @param root0.value
|
|
10
|
+
* @param root0.children
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <BlockMenuButton
|
|
14
|
+
* label="ブロックを削除"
|
|
15
|
+
* command={BGE_COMMAND.removeBlock}
|
|
16
|
+
* commandfor={COMMAND_BUS_ID}>
|
|
17
|
+
* <IconTrash />
|
|
18
|
+
* </BlockMenuButton>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function BlockMenuButton({ label, command, commandfor, value, children, }: {
|
|
22
|
+
readonly label: string;
|
|
23
|
+
readonly command: string;
|
|
24
|
+
readonly commandfor: string;
|
|
25
|
+
readonly value?: string;
|
|
26
|
+
readonly children: ReactNode;
|
|
27
|
+
}): import("react").JSX.Element;
|
|
28
|
+
//# sourceMappingURL=block-menu-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-menu-button.d.ts","sourceRoot":"","sources":["../../src/components/block-menu-button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AAMtD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,EAC/B,KAAK,EACL,OAAO,EACP,UAAU,EACV,KAAK,EACL,QAAQ,GACR,EAAE;IACF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC7B,+BAiBA"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 選択中ブロックの位置・サイズ・下マージン。座標とサイズはドキュメント
|
|
4
|
+
* 座標系のpx。`BlockMenu` が `getBlockAtPosition` の戻り値から算出し、
|
|
5
|
+
* `BlockMenuView` はこれをCSSカスタムプロパティに変換してメニューを
|
|
6
|
+
* ブロックに追従させる。
|
|
7
|
+
* @example
|
|
8
|
+
* ```ts
|
|
9
|
+
* const geometry: MenuGeometry = {
|
|
10
|
+
* width: 320,
|
|
11
|
+
* height: 120,
|
|
12
|
+
* x: 0,
|
|
13
|
+
* y: 0,
|
|
14
|
+
* marginBlockEnd: 16,
|
|
15
|
+
* marginBlockEndValue: '1em',
|
|
16
|
+
* };
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export interface MenuGeometry {
|
|
20
|
+
readonly width: number;
|
|
21
|
+
readonly height: number;
|
|
22
|
+
readonly x: number;
|
|
23
|
+
readonly y: number;
|
|
24
|
+
/** ブロック要素の `margin-block-end` 算出値(px) */
|
|
25
|
+
readonly marginBlockEnd: number;
|
|
26
|
+
/** `margin-block-end` のCSS値そのまま(例: `'1em'`) */
|
|
27
|
+
readonly marginBlockEndValue: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* ブロック内の各アイテム(`[data-bgi]`要素)のオーバーレイ矩形。
|
|
31
|
+
* 座標はブロック左上を原点とした相対px。クリックするとそのアイテムの
|
|
32
|
+
* エディタが開く透明ボタンの位置決めに使う。
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const rect: ItemOverlayRect = { x: 8, y: 8, width: 140, height: 40 };
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export interface ItemOverlayRect {
|
|
39
|
+
readonly x: number;
|
|
40
|
+
readonly y: number;
|
|
41
|
+
readonly width: number;
|
|
42
|
+
readonly height: number;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* `BlockMenu` の描画専用の中身。マウス追跡・`BurgerBlock` 解決・
|
|
46
|
+
* `engine` 接続は一切持たず、位置とアイテム矩形を props で受け取って
|
|
47
|
+
* 並べるだけの純粋なプレゼンテーションコンポーネント。
|
|
48
|
+
*
|
|
49
|
+
* `BurgerBlock` の実インスタンス生成なしに見た目だけ確認したい用途
|
|
50
|
+
* (Storybook)のために `BlockMenu` から切り出されている。
|
|
51
|
+
* @param root0
|
|
52
|
+
* @param root0.rootRef
|
|
53
|
+
* @param root0.menuId
|
|
54
|
+
* @param root0.visible
|
|
55
|
+
* @param root0.geometry
|
|
56
|
+
* @param root0.itemRects
|
|
57
|
+
* @param root0.isMutable
|
|
58
|
+
* @example
|
|
59
|
+
* ```tsx
|
|
60
|
+
* <BlockMenuView
|
|
61
|
+
* rootRef={rootRef}
|
|
62
|
+
* menuId="bge-block-menu"
|
|
63
|
+
* visible
|
|
64
|
+
* geometry={{ width: 100, height: 40, x: 0, y: 0, marginBlockEnd: 0, marginBlockEndValue: '0px' }}
|
|
65
|
+
* itemRects={[]}
|
|
66
|
+
* isMutable
|
|
67
|
+
* />
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
export declare function BlockMenuView({ rootRef, menuId, visible, geometry, itemRects, isMutable, }: {
|
|
71
|
+
readonly rootRef: RefObject<HTMLDivElement | null>;
|
|
72
|
+
readonly menuId: string;
|
|
73
|
+
readonly visible: boolean;
|
|
74
|
+
readonly geometry: MenuGeometry;
|
|
75
|
+
readonly itemRects: readonly ItemOverlayRect[];
|
|
76
|
+
readonly isMutable: boolean;
|
|
77
|
+
}): import("react").JSX.Element;
|
|
78
|
+
//# sourceMappingURL=block-menu-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-menu-view.d.ts","sourceRoot":"","sources":["../../src/components/block-menu-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAiB,MAAM,OAAO,CAAC;AAkBtD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,+CAA+C;IAC/C,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;CACrC;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,aAAa,CAAC,EAC7B,OAAO,EACP,MAAM,EACN,OAAO,EACP,QAAQ,EACR,SAAS,EACT,SAAS,GACT,EAAE;IACF,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACnD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,SAAS,eAAe,EAAE,CAAC;IAC/C,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;CAC5B,+BA6GA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BurgerEditorEngine } from '@burger-editor/core';
|
|
2
|
+
/**
|
|
3
|
+
* Hover menu over the selected block inside the editable area iframe.
|
|
4
|
+
* Block operations are declared as engine commands; positioning and
|
|
5
|
+
* visibility are React state owned entirely by this component — the
|
|
6
|
+
* single source of truth. While `engine.uiState.processing` is true the
|
|
7
|
+
* menu hides itself by subscribing to the store; nothing outside React
|
|
8
|
+
* ever writes this component's `hidden` attribute (a direct DOM write
|
|
9
|
+
* would leave React's `visible` state out of sync and a later same-value
|
|
10
|
+
* `setVisible(true)` would be skipped, leaving the menu stuck hidden).
|
|
11
|
+
*
|
|
12
|
+
* マウス追跡・`BurgerBlock` 解決・`engine` 接続を担うコンテナで、
|
|
13
|
+
* 実際の描画は {@link BlockMenuView} に委譲する。`BlockMenuView` は
|
|
14
|
+
* `BurgerBlock` の実インスタンスなしに見た目だけ確認できるため、
|
|
15
|
+
* Storybook 等では `BlockMenuView` を直接使う。
|
|
16
|
+
* @param root0
|
|
17
|
+
* @param root0.engine
|
|
18
|
+
* @param root0.container
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* <BlockMenu engine={engine} container={frameBody} />
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function BlockMenu({ engine, container, }: {
|
|
25
|
+
readonly engine: BurgerEditorEngine;
|
|
26
|
+
readonly container: HTMLElement;
|
|
27
|
+
}): import("react").JSX.Element;
|
|
28
|
+
//# sourceMappingURL=block-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-menu.d.ts","sourceRoot":"","sources":["../../src/components/block-menu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAe,kBAAkB,EAAY,MAAM,qBAAqB,CAAC;AAUrF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CAAC,EACzB,MAAM,EACN,SAAS,GACT,EAAE;IACF,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;CAChC,+BA8LA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BurgerBlock, BurgerEditorEngine } from '@burger-editor/core';
|
|
2
|
+
/**
|
|
3
|
+
* Block options dialog content. Values are read out of the dialog form
|
|
4
|
+
* on submit (uncontrolled, `name="bge-options-*"`); only the fields that
|
|
5
|
+
* drive conditional rendering are controlled.
|
|
6
|
+
* @param root0
|
|
7
|
+
* @param root0.engine
|
|
8
|
+
* @param root0.block
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <EditorDialog
|
|
12
|
+
* name="options"
|
|
13
|
+
* open={block !== null}
|
|
14
|
+
* onClose={close}
|
|
15
|
+
* onComplete={(formData) => applyBlockOptions(block, formData)}
|
|
16
|
+
* buttons={{ close: 'キャンセル', complete: '決定' }}>
|
|
17
|
+
* {block ? <BlockOptions engine={engine} block={block} /> : null}
|
|
18
|
+
* </EditorDialog>
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function BlockOptions({ engine, block, }: {
|
|
22
|
+
readonly engine: BurgerEditorEngine;
|
|
23
|
+
readonly block: BurgerBlock;
|
|
24
|
+
}): import("react").JSX.Element;
|
|
25
|
+
//# sourceMappingURL=block-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-options.d.ts","sourceRoot":"","sources":["../../src/components/block-options.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAU3E;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,EAC5B,MAAM,EACN,KAAK,GACL,EAAE;IACF,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC5B,+BA8RA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BurgerEditorEngine } from '@burger-editor/core';
|
|
2
|
+
/**
|
|
3
|
+
* Main/draft content switcher. Switching and copying are declared as
|
|
4
|
+
* engine commands; the pressed state follows the engine's
|
|
5
|
+
* `bge:switch-content` event and the source-view indicator follows
|
|
6
|
+
* `engine.uiState.sourceMode` — no state is duplicated locally.
|
|
7
|
+
*
|
|
8
|
+
* The alt+double-click source-view toggle is kept as a DOM event —
|
|
9
|
+
* double-click has no Invoker Commands equivalent (the no-click rule
|
|
10
|
+
* targets single-click activation).
|
|
11
|
+
* @param root0
|
|
12
|
+
* @param root0.engine
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* const container = document.createElement('div');
|
|
16
|
+
* engine.viewArea.insertAdjacentElement('beforebegin', container);
|
|
17
|
+
* reactMount(<DraftSwitcher engine={engine} />, container);
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function DraftSwitcher({ engine }: {
|
|
21
|
+
readonly engine: BurgerEditorEngine;
|
|
22
|
+
}): import("react").JSX.Element;
|
|
23
|
+
//# sourceMappingURL=draft-switcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft-switcher.d.ts","sourceRoot":"","sources":["../../src/components/draft-switcher.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAS9D;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAA;CAAE,+BA+EhF"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { BurgerEditorEngine, EditableAreaHost, EditableAreaType } from '@burger-editor/core';
|
|
2
|
+
/**
|
|
3
|
+
* The React shell of one editable area: the iframe hosting the edited
|
|
4
|
+
* content, the HTML source textarea, and the in-frame UI islands
|
|
5
|
+
* (block menu, initial insertion button) rendered through a portal.
|
|
6
|
+
*
|
|
7
|
+
* All presentation state is React state derived from `engine.uiState`
|
|
8
|
+
* and engine events — the engine never touches this component's DOM.
|
|
9
|
+
* The iframe is rendered unconditionally at a fixed position in the
|
|
10
|
+
* tree (visibility is `hidden` only) because unmounting an iframe
|
|
11
|
+
* destroys its document, and the engine owns the content inside it.
|
|
12
|
+
* @param root0
|
|
13
|
+
* @param root0.engine
|
|
14
|
+
* @param root0.type
|
|
15
|
+
* @param root0.initialContent
|
|
16
|
+
* @param root0.stylesheets
|
|
17
|
+
* @param root0.classList
|
|
18
|
+
* @param root0.onReady
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* root.render(
|
|
22
|
+
* <EditableAreaView
|
|
23
|
+
* engine={engine}
|
|
24
|
+
* type="main"
|
|
25
|
+
* initialContent={html}
|
|
26
|
+
* stylesheets={stylesheets}
|
|
27
|
+
* classList={classList}
|
|
28
|
+
* onReady={(host) => resolve(host)}
|
|
29
|
+
* />,
|
|
30
|
+
* );
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function EditableAreaView({ engine, type, initialContent, stylesheets, classList, onReady, }: {
|
|
34
|
+
readonly engine: BurgerEditorEngine;
|
|
35
|
+
readonly type: EditableAreaType;
|
|
36
|
+
readonly initialContent: string;
|
|
37
|
+
readonly stylesheets: readonly {
|
|
38
|
+
readonly path: string;
|
|
39
|
+
readonly id: string;
|
|
40
|
+
}[];
|
|
41
|
+
readonly classList: readonly string[];
|
|
42
|
+
readonly onReady: (host: EditableAreaHost) => void;
|
|
43
|
+
}): import("react").JSX.Element;
|
|
44
|
+
//# sourceMappingURL=editable-area-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editable-area-view.d.ts","sourceRoot":"","sources":["../../src/components/editable-area-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,MAAM,qBAAqB,CAAC;AAyC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,gBAAgB,CAAC,EAChC,MAAM,EACN,IAAI,EACJ,cAAc,EACd,WAAW,EACX,SAAS,EACT,OAAO,GACP,EAAE;IACF,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAChF,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACnD,+BAwNA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BurgerEditorEngine, FileType } from '@burger-editor/core';
|
|
2
|
+
/**
|
|
3
|
+
* Paginated, searchable file list. Selection is broadcast on the
|
|
4
|
+
* engine-level component observer (`file-select`); buttons declare local
|
|
5
|
+
* commands instead of click handlers.
|
|
6
|
+
* @param root0
|
|
7
|
+
* @param root0.engine
|
|
8
|
+
* @param root0.fileType
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <FileUploader engine={engine} fileType="image" />
|
|
12
|
+
* <FileList engine={engine} fileType="image" />
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare function FileList({ engine, fileType, }: {
|
|
16
|
+
readonly engine: BurgerEditorEngine;
|
|
17
|
+
readonly fileType: FileType;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=file-list.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-list.d.ts","sourceRoot":"","sources":["../../src/components/file-list.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAgB,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAYtF;;;;;;;;;;;;GAYG;AACH,wBAAgB,QAAQ,CAAC,EACxB,MAAM,EACN,QAAQ,GACR,EAAE;IACF,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC5B,+BA6OA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BurgerEditorEngine, FileType } from '@burger-editor/core';
|
|
2
|
+
/**
|
|
3
|
+
* File upload control. The trigger button declares a local command and
|
|
4
|
+
* the handler opens the picker via `showPicker()` — no click handlers,
|
|
5
|
+
* no programmatic `click()`.
|
|
6
|
+
* @param root0
|
|
7
|
+
* @param root0.engine
|
|
8
|
+
* @param root0.fileType
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <FileUploader engine={engine} fileType="image" />
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare function FileUploader({ engine, fileType, }: {
|
|
15
|
+
readonly engine: BurgerEditorEngine;
|
|
16
|
+
readonly fileType: FileType;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=file-uploader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-uploader.d.ts","sourceRoot":"","sources":["../../src/components/file-uploader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAQxE;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,EAC5B,MAAM,EACN,QAAQ,GACR,EAAE;IACF,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC5B,+BAsEA"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for the Front Matter editor
|
|
3
|
+
*/
|
|
4
|
+
export interface FrontMatterEditorOptions {
|
|
5
|
+
/** Container element to render the editor */
|
|
6
|
+
readonly container: HTMLElement;
|
|
7
|
+
/** Initial Front Matter data */
|
|
8
|
+
readonly initialData: Record<string, unknown>;
|
|
9
|
+
/** Whether Front Matter originally existed */
|
|
10
|
+
readonly hasFrontMatter: boolean;
|
|
11
|
+
/** Callback when data changes */
|
|
12
|
+
readonly onUpdated?: (data: Record<string, unknown>) => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Handle returned by {@link createFrontMatterEditor}.
|
|
16
|
+
*/
|
|
17
|
+
export interface FrontMatterEditorHandle extends Disposable {
|
|
18
|
+
/**
|
|
19
|
+
* Get current Front Matter data
|
|
20
|
+
*/
|
|
21
|
+
getData(): Record<string, unknown>;
|
|
22
|
+
/**
|
|
23
|
+
* Get original Front Matter string for format preservation
|
|
24
|
+
*/
|
|
25
|
+
getOriginalFrontMatter(): string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Unmount the editor UI.
|
|
28
|
+
* @deprecated Use a `using` declaration (`[Symbol.dispose]`) instead.
|
|
29
|
+
*/
|
|
30
|
+
unmount(): void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Mount the Front Matter editor (a React component) into the given
|
|
34
|
+
* container.
|
|
35
|
+
*
|
|
36
|
+
* The field list is rendered declaratively from React state, so
|
|
37
|
+
* toggling the panel or editing other fields never rebuilds the inputs
|
|
38
|
+
* — focus, caret position and IME composition survive re-renders.
|
|
39
|
+
* @param options - Mount target and initial data
|
|
40
|
+
* @returns A handle exposing the latest data and an unmount function
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const editor = createFrontMatterEditor({
|
|
44
|
+
* container: document.querySelector('.front-matter-editor')!,
|
|
45
|
+
* initialData: { title: 'ページ' },
|
|
46
|
+
* hasFrontMatter: true,
|
|
47
|
+
* onUpdated: (data) => debouncedSave(data),
|
|
48
|
+
* });
|
|
49
|
+
* editor.getData(); // => { title: 'ページ' }
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare function createFrontMatterEditor(options: FrontMatterEditorOptions): FrontMatterEditorHandle;
|
|
53
|
+
/**
|
|
54
|
+
* Front Matterの動的フォーム本体。フィールド一覧・折りたたみ・追加
|
|
55
|
+
* ダイアログをReact stateとして持ち、操作は Invoker Commands
|
|
56
|
+
* (`--fm-toggle` / `--fm-add-field` / `--fm-delete-field`)で受ける
|
|
57
|
+
* @param root0
|
|
58
|
+
* @param root0.initialData
|
|
59
|
+
* @param root0.onDataChange
|
|
60
|
+
* @example
|
|
61
|
+
* ```tsx
|
|
62
|
+
* <FrontMatterEditorView
|
|
63
|
+
* initialData={{ title: 'ページ' }}
|
|
64
|
+
* onDataChange={(data) => console.log(data)}
|
|
65
|
+
* />
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
export declare function FrontMatterEditorView({ initialData, onDataChange, }: {
|
|
69
|
+
readonly initialData: Record<string, unknown>;
|
|
70
|
+
readonly onDataChange: (data: Record<string, unknown>) => void;
|
|
71
|
+
}): import("react").JSX.Element;
|
|
72
|
+
//# sourceMappingURL=front-matter-editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"front-matter-editor.d.ts","sourceRoot":"","sources":["../../src/components/front-matter-editor.tsx"],"names":[],"mappings":"AAsBA;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC,6CAA6C;IAC7C,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;IAChC,gCAAgC;IAChC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9C,8CAA8C;IAC9C,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,iCAAiC;IACjC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CAC7D;AAED;;GAEG;AACH,MAAM,WAAW,uBAAwB,SAAQ,UAAU;IAC1D;;OAEG;IACH,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC;;OAEG;IACH,sBAAsB,IAAI,MAAM,GAAG,SAAS,CAAC;IAC7C;;;OAGG;IACH,OAAO,IAAI,IAAI,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,uBAAuB,CACtC,OAAO,EAAE,wBAAwB,GAC/B,uBAAuB,CAgCzB;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,qBAAqB,CAAC,EACrC,WAAW,EACX,YAAY,GACZ,EAAE;IACF,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9C,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CAC/D,+BA8HA"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { BlockCatalog } from './block-catalog.js';
|
|
2
|
+
export { BlockMenu } from './block-menu.js';
|
|
3
|
+
export { BlockMenuButton } from './block-menu-button.js';
|
|
4
|
+
export { BlockMenuView } from './block-menu-view.js';
|
|
5
|
+
export type { MenuGeometry, ItemOverlayRect } from './block-menu-view.js';
|
|
6
|
+
export { BlockOptions } from './block-options.js';
|
|
7
|
+
export { DraftSwitcher } from './draft-switcher.js';
|
|
8
|
+
export { EditableAreaView } from './editable-area-view.js';
|
|
9
|
+
export { FileList } from './file-list.js';
|
|
10
|
+
export { FileUploader } from './file-uploader.js';
|
|
11
|
+
export { createFrontMatterEditor, FrontMatterEditorView } from './front-matter-editor.js';
|
|
12
|
+
export type { FrontMatterEditorOptions, FrontMatterEditorHandle, } from './front-matter-editor.js';
|
|
13
|
+
export { InitialInsertionButton } from './initial-insertion-button.js';
|
|
14
|
+
export { ItemEditorHost } from './item-editor-host.js';
|
|
15
|
+
export { Preview } from './preview.js';
|
|
16
|
+
export { TableEditor } from './table-editor.js';
|
|
17
|
+
export type { TableEditorData } from './table-editor.js';
|
|
18
|
+
export { Tabs } from './tabs.js';
|
|
19
|
+
export { Thumbnail } from './thumbnail.js';
|
|
20
|
+
export { WysiwygField } from './wysiwyg-field.js';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAC1F,YAAY,EACX,wBAAwB,EACxB,uBAAuB,GACvB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Button shown in an empty editable area to insert the first block.
|
|
3
|
+
* Declares the engine command instead of taking a callback.
|
|
4
|
+
* @example
|
|
5
|
+
* ```tsx
|
|
6
|
+
* reactMount(<InitialInsertionButton />, container);
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
9
|
+
export declare function InitialInsertionButton(): import("react").JSX.Element;
|
|
10
|
+
//# sourceMappingURL=initial-insertion-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"initial-insertion-button.d.ts","sourceRoot":"","sources":["../../src/components/initial-insertion-button.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,gCAUrC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BurgerEditorEngine, Item, ItemData } from '@burger-editor/core';
|
|
2
|
+
type AnyItem = Item<ItemData, {}>;
|
|
3
|
+
/**
|
|
4
|
+
* Declarative item editor dialog. Renders the item's `Editor` component
|
|
5
|
+
* with editor state derived via `toEditorState`; on submit the state is
|
|
6
|
+
* converted back with `toItemData` and imported into the item.
|
|
7
|
+
* @param root0
|
|
8
|
+
* @param root0.engine
|
|
9
|
+
* @param root0.item
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <ItemEditorHost
|
|
13
|
+
* engine={engine}
|
|
14
|
+
* item={open?.type === 'item-editor' ? open.item : null}
|
|
15
|
+
* />
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function ItemEditorHost({ engine, item, }: {
|
|
19
|
+
readonly engine: BurgerEditorEngine;
|
|
20
|
+
readonly item: AnyItem | null;
|
|
21
|
+
}): import("react").JSX.Element;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=item-editor-host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"item-editor-host.d.ts","sourceRoot":"","sources":["../../src/components/item-editor-host.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,kBAAkB,EAClB,IAAI,EACJ,QAAQ,EAER,MAAM,qBAAqB,CAAC;AAQ7B,KAAK,OAAO,GAAG,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAGlC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,CAAC,EAC9B,MAAM,EACN,IAAI,GACJ,EAAE;IACF,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9B,+BAqBA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BurgerEditorEngine } from '@burger-editor/core';
|
|
2
|
+
/**
|
|
3
|
+
* File preview pane. The previewed path comes from the parent (lifted
|
|
4
|
+
* from the old `file-select` observer event); upload progress stays on
|
|
5
|
+
* the engine-level component observer.
|
|
6
|
+
* @param root0
|
|
7
|
+
* @param root0.engine
|
|
8
|
+
* @param root0.path
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <Preview engine={engine} path={state.path ?? ''} />
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare function Preview({ engine, path, }: {
|
|
15
|
+
readonly engine: BurgerEditorEngine;
|
|
16
|
+
readonly path: string;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
//# sourceMappingURL=preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../src/components/preview.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAS9D;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,EACvB,MAAM,EACN,IAAI,GACJ,EAAE;IACF,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB,+BAmHA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Row-aligned table cell text: `th[i]` and `td[i]` form one row. In the
|
|
3
|
+
* table item the `td` cells hold Markdown while editing (converted
|
|
4
|
+
* to/from HTML via `toEditorState`/`toItemData`); `th` cells stay plain.
|
|
5
|
+
*/
|
|
6
|
+
export interface TableEditorData {
|
|
7
|
+
readonly th: readonly string[];
|
|
8
|
+
readonly td: readonly string[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Table row editor as a fully controlled component. The table item's
|
|
12
|
+
* editor owns the state; row operations are declared as local commands.
|
|
13
|
+
* @param root0
|
|
14
|
+
* @param root0.value
|
|
15
|
+
* @param root0.onChange
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <TableEditor
|
|
19
|
+
* value={{ th: state.th ?? [], td: state.td ?? [] }}
|
|
20
|
+
* onChange={({ th, td }) => setState({ ...state, th: [...th], td: [...td] })}
|
|
21
|
+
* />
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function TableEditor({ value, onChange, }: {
|
|
25
|
+
readonly value: TableEditorData;
|
|
26
|
+
readonly onChange: (value: TableEditorData) => void;
|
|
27
|
+
}): import("react").JSX.Element;
|
|
28
|
+
//# sourceMappingURL=table-editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-editor.d.ts","sourceRoot":"","sources":["../../src/components/table-editor.tsx"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,EAAE,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,QAAQ,CAAC,EAAE,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,EAC3B,KAAK,EACL,QAAQ,GACR,EAAE;IACF,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;CACpD,+BAkGA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Controlled tab list. Selection is lifted to the parent via
|
|
3
|
+
* `current`/`onChange`; tab buttons declare a local command instead of a
|
|
4
|
+
* click handler. Arrow keys move the selection. The tab panel itself is
|
|
5
|
+
* rendered by the parent, which also owns its `aria-label`.
|
|
6
|
+
* @param root0
|
|
7
|
+
* @param root0.current
|
|
8
|
+
* @param root0.onChange
|
|
9
|
+
* @param root0.contentId
|
|
10
|
+
* @param root0.length
|
|
11
|
+
* @param root0.createLabel
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* <Tabs current={currentIndex} onChange={setCurrentIndex} contentId="tab-content" />
|
|
15
|
+
* <div id="tab-content" role="tabpanel" aria-label={`画像${currentIndex + 1}`}>
|
|
16
|
+
* {currentIndex === 0 ? <PcForm /> : <SpForm />}
|
|
17
|
+
* </div>
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function Tabs({ current, onChange, contentId, length, createLabel, }: {
|
|
21
|
+
readonly current: number;
|
|
22
|
+
readonly onChange: (index: number) => void;
|
|
23
|
+
readonly contentId: string;
|
|
24
|
+
readonly length?: number;
|
|
25
|
+
readonly createLabel?: (index: number) => string;
|
|
26
|
+
}): import("react").JSX.Element;
|
|
27
|
+
//# sourceMappingURL=tabs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","sourceRoot":"","sources":["../../src/components/tabs.tsx"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,IAAI,CAAC,EACpB,OAAO,EACP,QAAQ,EACR,SAAS,EACT,MAAU,EACV,WAAyC,GACzC,EAAE;IACF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CACjD,+BA8CA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File thumbnail. Renders an image/video preview or a file-type icon.
|
|
3
|
+
*
|
|
4
|
+
* The file type is inferred from the URL's extension (`getExt`) — the
|
|
5
|
+
* URL is the only information available here, so the extension decides
|
|
6
|
+
* whether the file can be previewed inline or needs a type icon.
|
|
7
|
+
* @param root0
|
|
8
|
+
* @param root0.src
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <Thumbnail src={file.url} />
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare function Thumbnail({ src }: {
|
|
15
|
+
readonly src: string;
|
|
16
|
+
}): import("react").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=thumbnail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"thumbnail.d.ts","sourceRoot":"","sources":["../../src/components/thumbnail.tsx"],"names":[],"mappings":"AAeA;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,EAAE,GAAG,EAAE,EAAE;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,+BAsC1D"}
|