@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,41 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Declarative `<dialog>` shell.
|
|
4
|
+
*
|
|
5
|
+
* The markup follows the `dialog.bge-dialog > div > form > div` + `footer`
|
|
6
|
+
* structure that `ui.css` styles. Opening/closing is driven by the `open`
|
|
7
|
+
* prop; the close button uses the built-in `close` command — no click
|
|
8
|
+
* handlers.
|
|
9
|
+
* @param root0
|
|
10
|
+
* @param root0.name
|
|
11
|
+
* @param root0.open
|
|
12
|
+
* @param root0.onClose
|
|
13
|
+
* @param root0.onComplete
|
|
14
|
+
* @param root0.buttons
|
|
15
|
+
* @param root0.buttons.close
|
|
16
|
+
* @param root0.buttons.complete
|
|
17
|
+
* @param root0.children
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <EditorDialog
|
|
21
|
+
* name="options"
|
|
22
|
+
* open={block !== null}
|
|
23
|
+
* onClose={() => engine.uiState.closeDialog()}
|
|
24
|
+
* onComplete={(formData) => applyBlockOptions(block, formData)}
|
|
25
|
+
* buttons={{ close: 'キャンセル', complete: '決定' }}>
|
|
26
|
+
* {block ? <BlockOptions engine={engine} block={block} /> : null}
|
|
27
|
+
* </EditorDialog>
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function EditorDialog({ name, open, onClose, onComplete, buttons, children, }: {
|
|
31
|
+
readonly name: string;
|
|
32
|
+
readonly open: boolean;
|
|
33
|
+
readonly onClose: () => void;
|
|
34
|
+
readonly onComplete?: (formData: FormData) => void;
|
|
35
|
+
readonly buttons?: {
|
|
36
|
+
readonly close?: string;
|
|
37
|
+
readonly complete?: string;
|
|
38
|
+
};
|
|
39
|
+
readonly children: ReactNode;
|
|
40
|
+
}): import("react").JSX.Element;
|
|
41
|
+
//# sourceMappingURL=editor-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-dialog.d.ts","sourceRoot":"","sources":["../src/editor-dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,OAAO,uBAAuB,CAAC;AAE/B;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,YAAY,CAAC,EAC5B,IAAI,EACJ,IAAI,EACJ,OAAO,EACP,UAAU,EACV,OAAO,EACP,QAAQ,GACR,EAAE;IACF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;IACnD,QAAQ,CAAC,OAAO,CAAC,EAAE;QAClB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;KAC3B,CAAC;IACF,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC7B,+BAoDA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Controlled checkbox following the editor form markup convention
|
|
4
|
+
* (`label > input + text`).
|
|
5
|
+
*
|
|
6
|
+
* The structure is a styling contract: `ui.css` turns
|
|
7
|
+
* `label:not([for]):has(input[type='checkbox'])` into a flex row, so it
|
|
8
|
+
* must be preserved.
|
|
9
|
+
* @param root0
|
|
10
|
+
* @param root0.label
|
|
11
|
+
* @param root0.checked
|
|
12
|
+
* @param root0.onChange
|
|
13
|
+
* @param root0.name
|
|
14
|
+
* @param root0.disabled
|
|
15
|
+
* @param root0.describedBy
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <Checkbox
|
|
19
|
+
* label={<span>横スクロール可能</span>}
|
|
20
|
+
* name="bge-scrollable"
|
|
21
|
+
* checked={state.scrollable ?? false}
|
|
22
|
+
* onChange={(scrollable) => setState({ ...state, scrollable })}
|
|
23
|
+
* />
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function Checkbox({ label, checked, onChange, name, disabled, describedBy, }: {
|
|
27
|
+
readonly label: ReactNode;
|
|
28
|
+
readonly checked: boolean;
|
|
29
|
+
readonly onChange: (checked: boolean) => void;
|
|
30
|
+
readonly name?: string;
|
|
31
|
+
readonly disabled?: boolean;
|
|
32
|
+
readonly describedBy?: string;
|
|
33
|
+
}): import("react").JSX.Element;
|
|
34
|
+
//# sourceMappingURL=checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.d.ts","sourceRoot":"","sources":["../../src/form/checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,QAAQ,CAAC,EACxB,KAAK,EACL,OAAO,EACP,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,WAAW,GACX,EAAE;IACF,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAC9C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC9B,+BAcA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Grouping fieldset following the editor form markup convention
|
|
4
|
+
* (`fieldset > legend`).
|
|
5
|
+
*
|
|
6
|
+
* The structure is a styling contract: `ui.css` draws the group border
|
|
7
|
+
* and spacing on the `fieldset` element itself, so it must be preserved.
|
|
8
|
+
* @param root0
|
|
9
|
+
* @param root0.legend
|
|
10
|
+
* @param root0.id
|
|
11
|
+
* @param root0.disabled
|
|
12
|
+
* @param root0.children
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* <Fieldset legend="リンク設定" disabled={!state.useLink}>
|
|
16
|
+
* <TextField
|
|
17
|
+
* label="URL"
|
|
18
|
+
* name="bge-href"
|
|
19
|
+
* value={state.href ?? ''}
|
|
20
|
+
* onChange={(href) => setState({ ...state, href })}
|
|
21
|
+
* />
|
|
22
|
+
* </Fieldset>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function Fieldset({ legend, id, disabled, children, }: {
|
|
26
|
+
readonly legend: string;
|
|
27
|
+
readonly id?: string;
|
|
28
|
+
readonly disabled?: boolean;
|
|
29
|
+
readonly children: ReactNode;
|
|
30
|
+
}): import("react").JSX.Element;
|
|
31
|
+
//# sourceMappingURL=fieldset.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fieldset.d.ts","sourceRoot":"","sources":["../../src/form/fieldset.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,QAAQ,CAAC,EACxB,MAAM,EACN,EAAE,EACF,QAAQ,EACR,QAAQ,GACR,EAAE;IACF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC7B,+BAOA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { Checkbox } from './checkbox.js';
|
|
2
|
+
export { Fieldset } from './fieldset.js';
|
|
3
|
+
export { NumberField } from './number-field.js';
|
|
4
|
+
export { RadioGroup } from './radio-group.js';
|
|
5
|
+
export { SelectField } from './select-field.js';
|
|
6
|
+
export { TextArea } from './text-area.js';
|
|
7
|
+
export { TextField } from './text-field.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/form/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Controlled numeric input following the editor form markup convention.
|
|
3
|
+
*
|
|
4
|
+
* The `label > span + input` structure is a styling contract: `ui.css`
|
|
5
|
+
* lays out fields with structural selectors
|
|
6
|
+
* (`label:not([for]) > span:has(+ input)`), so it must be preserved.
|
|
7
|
+
* @param root0
|
|
8
|
+
* @param root0.label
|
|
9
|
+
* @param root0.value
|
|
10
|
+
* @param root0.onChange
|
|
11
|
+
* @param root0.name
|
|
12
|
+
* @param root0.min
|
|
13
|
+
* @param root0.max
|
|
14
|
+
* @param root0.step
|
|
15
|
+
* @param root0.disabled
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <NumberField
|
|
19
|
+
* label="表示件数"
|
|
20
|
+
* name="bge-count"
|
|
21
|
+
* value={state.count ?? 1}
|
|
22
|
+
* min={1}
|
|
23
|
+
* onChange={(count) => setState({ ...state, count })}
|
|
24
|
+
* />
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function NumberField({ label, value, onChange, name, min, max, step, disabled, }: {
|
|
28
|
+
readonly label: string;
|
|
29
|
+
readonly value: number;
|
|
30
|
+
readonly onChange: (value: number) => void;
|
|
31
|
+
readonly name?: string;
|
|
32
|
+
readonly min?: number;
|
|
33
|
+
readonly max?: number;
|
|
34
|
+
readonly step?: number;
|
|
35
|
+
readonly disabled?: boolean;
|
|
36
|
+
}): import("react").JSX.Element;
|
|
37
|
+
//# sourceMappingURL=number-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number-field.d.ts","sourceRoot":"","sources":["../../src/form/number-field.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,WAAW,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,GAAG,EACH,GAAG,EACH,IAAI,EACJ,QAAQ,GACR,EAAE;IACF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC5B,+BAgBA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { SelectableValue } from '@burger-editor/core';
|
|
2
|
+
/**
|
|
3
|
+
* Controlled radio group following the editor form markup convention
|
|
4
|
+
* (`div[role=radiogroup] > label > input + text`).
|
|
5
|
+
*
|
|
6
|
+
* The structure is a styling contract: `ui.css` lays out the group via
|
|
7
|
+
* `[role='radiogroup'] > label` (and appends `:` to the group label), so
|
|
8
|
+
* it must be preserved.
|
|
9
|
+
* @param root0
|
|
10
|
+
* @param root0.label
|
|
11
|
+
* @param root0.value
|
|
12
|
+
* @param root0.onChange
|
|
13
|
+
* @param root0.options
|
|
14
|
+
* @param root0.name
|
|
15
|
+
* @param root0.disabled
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <RadioGroup
|
|
19
|
+
* label="配置"
|
|
20
|
+
* name="bge-align"
|
|
21
|
+
* value={state.align ?? 'start'}
|
|
22
|
+
* options={[
|
|
23
|
+
* { value: 'start', label: '左寄せ' },
|
|
24
|
+
* { value: 'end', label: '右寄せ' },
|
|
25
|
+
* ]}
|
|
26
|
+
* onChange={(align) => setState({ ...state, align })}
|
|
27
|
+
* />
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function RadioGroup({ label, value, onChange, options, name, disabled, }: {
|
|
31
|
+
readonly label: string;
|
|
32
|
+
readonly value: string;
|
|
33
|
+
readonly onChange: (value: string) => void;
|
|
34
|
+
readonly options: readonly SelectableValue[];
|
|
35
|
+
readonly name?: string;
|
|
36
|
+
readonly disabled?: boolean;
|
|
37
|
+
}): import("react").JSX.Element;
|
|
38
|
+
//# sourceMappingURL=radio-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"radio-group.d.ts","sourceRoot":"","sources":["../../src/form/radio-group.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAI3D;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,UAAU,CAAC,EAC1B,KAAK,EACL,KAAK,EACL,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,QAAQ,GACR,EAAE;IACF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,CAAC;IAC7C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC5B,+BAwBA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { SelectableValue } from '@burger-editor/core';
|
|
2
|
+
/**
|
|
3
|
+
* Controlled select following the editor form markup convention
|
|
4
|
+
* (`label > span + select`).
|
|
5
|
+
*
|
|
6
|
+
* The structure is a styling contract: `ui.css` lays out fields with
|
|
7
|
+
* structural selectors (`label:not([for]) > span:has(+ select)`), so it
|
|
8
|
+
* must be preserved.
|
|
9
|
+
* @param root0
|
|
10
|
+
* @param root0.label
|
|
11
|
+
* @param root0.value
|
|
12
|
+
* @param root0.onChange
|
|
13
|
+
* @param root0.options
|
|
14
|
+
* @param root0.name
|
|
15
|
+
* @param root0.disabled
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <SelectField
|
|
19
|
+
* label="種類"
|
|
20
|
+
* name="bge-kind"
|
|
21
|
+
* value={state.kind ?? 'normal'}
|
|
22
|
+
* options={[
|
|
23
|
+
* { value: 'normal', label: '通常' },
|
|
24
|
+
* { value: 'wide', label: 'ワイド' },
|
|
25
|
+
* ]}
|
|
26
|
+
* onChange={(kind) => setState({ ...state, kind })}
|
|
27
|
+
* />
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function SelectField({ label, value, onChange, options, name, disabled, }: {
|
|
31
|
+
readonly label: string;
|
|
32
|
+
readonly value: string;
|
|
33
|
+
readonly onChange: (value: string) => void;
|
|
34
|
+
readonly options: readonly SelectableValue[];
|
|
35
|
+
readonly name?: string;
|
|
36
|
+
readonly disabled?: boolean;
|
|
37
|
+
}): import("react").JSX.Element;
|
|
38
|
+
//# sourceMappingURL=select-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-field.d.ts","sourceRoot":"","sources":["../../src/form/select-field.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,WAAW,CAAC,EAC3B,KAAK,EACL,KAAK,EACL,QAAQ,EACR,OAAO,EACP,IAAI,EACJ,QAAQ,GACR,EAAE;IACF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,OAAO,EAAE,SAAS,eAAe,EAAE,CAAC;IAC7C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC5B,+BAiBA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Controlled multi-line text input following the editor form markup
|
|
3
|
+
* convention.
|
|
4
|
+
*
|
|
5
|
+
* The `label > span + textarea` structure is a styling contract: `ui.css`
|
|
6
|
+
* lays out fields with structural selectors
|
|
7
|
+
* (`label:not([for]) > span:has(+ textarea)`), so it must be preserved.
|
|
8
|
+
* @param root0
|
|
9
|
+
* @param root0.label
|
|
10
|
+
* @param root0.value
|
|
11
|
+
* @param root0.onChange
|
|
12
|
+
* @param root0.name
|
|
13
|
+
* @param root0.rows
|
|
14
|
+
* @param root0.disabled
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <TextArea
|
|
18
|
+
* label="説明文"
|
|
19
|
+
* name="bge-text"
|
|
20
|
+
* value={state.text ?? ''}
|
|
21
|
+
* onChange={(text) => setState({ ...state, text })}
|
|
22
|
+
* />
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare function TextArea({ label, value, onChange, name, rows, disabled, }: {
|
|
26
|
+
readonly label: string;
|
|
27
|
+
readonly value: string;
|
|
28
|
+
readonly onChange: (value: string) => void;
|
|
29
|
+
readonly name?: string;
|
|
30
|
+
readonly rows?: number;
|
|
31
|
+
readonly disabled?: boolean;
|
|
32
|
+
}): import("react").JSX.Element;
|
|
33
|
+
//# sourceMappingURL=text-area.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-area.d.ts","sourceRoot":"","sources":["../../src/form/text-area.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,QAAQ,CAAC,EACxB,KAAK,EACL,KAAK,EACL,QAAQ,EACR,IAAI,EACJ,IAAI,EACJ,QAAQ,GACR,EAAE;IACF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC5B,+BAaA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Controlled single-line text input following the editor form markup
|
|
3
|
+
* convention (`label > span + input`).
|
|
4
|
+
*
|
|
5
|
+
* The structure is a styling contract: `ui.css` lays out fields with
|
|
6
|
+
* structural selectors (`label:not([for]) > span:has(+ input)`) instead
|
|
7
|
+
* of `for`/`id` wiring, so it must be preserved.
|
|
8
|
+
* @param root0
|
|
9
|
+
* @param root0.label
|
|
10
|
+
* @param root0.value
|
|
11
|
+
* @param root0.onChange
|
|
12
|
+
* @param root0.type
|
|
13
|
+
* @param root0.name
|
|
14
|
+
* @param root0.disabled
|
|
15
|
+
* @param root0.placeholder
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* <TextField
|
|
19
|
+
* label="URL"
|
|
20
|
+
* name="bge-link"
|
|
21
|
+
* value={state.href ?? ''}
|
|
22
|
+
* onChange={(href) => setState({ ...state, href })}
|
|
23
|
+
* />
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function TextField({ label, value, onChange, type, name, disabled, placeholder, }: {
|
|
27
|
+
readonly label: string;
|
|
28
|
+
readonly value: string;
|
|
29
|
+
readonly onChange: (value: string) => void;
|
|
30
|
+
readonly type?: 'text' | 'url' | 'email';
|
|
31
|
+
readonly name?: string;
|
|
32
|
+
readonly disabled?: boolean;
|
|
33
|
+
readonly placeholder?: string;
|
|
34
|
+
}): import("react").JSX.Element;
|
|
35
|
+
//# sourceMappingURL=text-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-field.d.ts","sourceRoot":"","sources":["../../src/form/text-field.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,SAAS,CAAC,EACzB,KAAK,EACL,KAAK,EACL,QAAQ,EACR,IAAa,EACb,IAAI,EACJ,QAAQ,EACR,WAAW,GACX,EAAE;IACF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,OAAO,CAAC;IACzC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC9B,+BAcA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,48 @@
|
|
|
1
1
|
import { BurgerEditorEngineOptions, BurgerEditorEngine } from '@burger-editor/core';
|
|
2
2
|
export declare const version: string;
|
|
3
3
|
/**
|
|
4
|
+
* 本稿⇄下書き切替UIをビューエリアの直前にマウントする
|
|
4
5
|
*
|
|
5
|
-
*
|
|
6
|
+
* `createBurgerEditorClient` に含めず分離しているのは、配置位置
|
|
7
|
+
* (エディタの外側のどこに置くか)がアプリケーション側の判断のため。
|
|
8
|
+
* @param engine - 対象エンジン。下書きが無い構成では何もしない
|
|
9
|
+
* @returns マウントハンドル(`cleanUp`でアンマウント)。下書きが無い場合はnull
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const { engine } = await createBurgerEditorClient(options);
|
|
13
|
+
* attachDraftSwitcher(engine);
|
|
14
|
+
* ```
|
|
6
15
|
*/
|
|
7
|
-
export declare function attachDraftSwitcher(engine: BurgerEditorEngine): {
|
|
8
|
-
cleanUp
|
|
9
|
-
} | null;
|
|
16
|
+
export declare function attachDraftSwitcher(engine: BurgerEditorEngine): (Disposable & {
|
|
17
|
+
cleanUp(): void;
|
|
18
|
+
}) | null;
|
|
10
19
|
/**
|
|
20
|
+
* BurgerEditorのクライアントUIを組み立てるメインエントリ
|
|
11
21
|
*
|
|
12
|
-
*
|
|
22
|
+
* headlessなエンジンを生成し、React製のUI(編集エリア・ブロックメニュー・
|
|
23
|
+
* 初期挿入ボタン・ダイアログ群)とエンジン操作コマンドのディスパッチ
|
|
24
|
+
* テーブルを配線する。エンジンへのUI注入点は `view` ひとつで、この関数が
|
|
25
|
+
* React実装を供給するためオプションから除外している。
|
|
26
|
+
* @param options - エンジンオプション(UI供給分を除く)
|
|
27
|
+
* @returns 生成済みエンジンを含むハンドル
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* import { createBurgerEditorClient, attachDraftSwitcher } from '@burger-editor/client';
|
|
31
|
+
* import itemSeeds from '@burger-editor/blocks';
|
|
32
|
+
*
|
|
33
|
+
* const { engine } = await createBurgerEditorClient({
|
|
34
|
+
* root: '#editor',
|
|
35
|
+
* config,
|
|
36
|
+
* catalog,
|
|
37
|
+
* items: itemSeeds,
|
|
38
|
+
* initialContents: { main, draft },
|
|
39
|
+
* generalCSS,
|
|
40
|
+
* fileIO: serverAPI,
|
|
41
|
+
* });
|
|
42
|
+
* attachDraftSwitcher(engine);
|
|
43
|
+
* ```
|
|
13
44
|
*/
|
|
14
|
-
export declare function createBurgerEditorClient(options: Omit<BurgerEditorEngineOptions, '
|
|
45
|
+
export declare function createBurgerEditorClient(options: Omit<BurgerEditorEngineOptions, 'view'>): Promise<{
|
|
15
46
|
engine: BurgerEditorEngine;
|
|
16
47
|
}>;
|
|
17
48
|
export { Migrator } from '@burger-editor/migrator';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAErE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AASzD,OAAO,gBAAgB,CAAC;AAExB,eAAO,MAAM,OAAO,QAAc,CAAC;AAEnC;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,kBAAkB;;UAS7D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,wBAAwB,CAC7C,OAAO,EAAE,IAAI,CAAC,yBAAyB,EAAE,MAAM,CAAC;;GAuChD;AAED,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare module 'react' {
|
|
2
|
+
interface ButtonHTMLAttributes<T> {
|
|
3
|
+
/**
|
|
4
|
+
* Built-in (`show-modal`, `close`, …) or custom (`--`-prefixed)
|
|
5
|
+
* command to invoke on the `commandfor` target.
|
|
6
|
+
*/
|
|
7
|
+
command?: string;
|
|
8
|
+
/**
|
|
9
|
+
* The id of the element the command is dispatched on. Must be in
|
|
10
|
+
* the same document as the button.
|
|
11
|
+
*/
|
|
12
|
+
commandfor?: string;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Invoker Commands API attributes for buttons. Re-exported (rather than
|
|
17
|
+
* imported for side effects only) so that the module augmentation above
|
|
18
|
+
* survives d.ts bundling and reaches consumers.
|
|
19
|
+
*/
|
|
20
|
+
export interface InvokerCommandAttributes {
|
|
21
|
+
readonly command?: string;
|
|
22
|
+
readonly commandfor?: string;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=invoker-commands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoker-commands.d.ts","sourceRoot":"","sources":["../src/invoker-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,OAAO,CAAC;AAEf,OAAO,QAAQ,OAAO,CAAC;IAEtB,UAAU,oBAAoB,CAAC,CAAC;QAC/B;;;WAGG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB;;;WAGG;QACH,UAAU,CAAC,EAAE,MAAM,CAAC;KACpB;CACD;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACxC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC7B"}
|
package/dist/mount.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Mount a React node into a DOM container and return a `Disposable`
|
|
4
|
+
* teardown handle, matching the `UICreator` contract shape used across
|
|
5
|
+
* the engine.
|
|
6
|
+
* @param node - The React node to render
|
|
7
|
+
* @param target - The DOM container
|
|
8
|
+
* @returns A handle that unmounts the root, via `using` or `cleanUp()`
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* using mount = reactMount(<DraftSwitcher engine={engine} />, container);
|
|
12
|
+
* // Root is unmounted automatically when `mount` goes out of scope.
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare function reactMount(node: ReactNode, target: HTMLElement): Disposable & {
|
|
16
|
+
/** @deprecated Use a `using` declaration instead. */
|
|
17
|
+
cleanUp(): void;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=mount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../src/mount.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC;;;;;;;;;;;;GAYG;AACH,wBAAgB,UAAU,CACzB,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,WAAW,GACjB,UAAU,GAAG;IACf,qDAAqD;IACrD,OAAO,IAAI,IAAI,CAAC;CAChB,CAaA"}
|
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type { InvokerCommandAttributes } from './invoker-commands.js';
|
|
2
|
+
export { EditorDialog } from './editor-dialog.js';
|
|
3
|
+
export { reactMount } from './mount.js';
|
|
4
|
+
export { registerEngineCommands } from './commands/register-engine-commands.js';
|
|
5
|
+
export * from './components/index.js';
|
|
6
|
+
export { useCommand } from './use-command.js';
|
|
7
|
+
export type { CommandHandlers } from './use-command.js';
|
|
8
|
+
export { useComponentEvent, useUIState } from './use-engine.js';
|
|
9
|
+
export * from './form/index.js';
|
|
10
|
+
//# sourceMappingURL=ui.d.ts.map
|
package/dist/ui.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,CAAC;AAE/B,YAAY,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAChE,cAAc,iBAAiB,CAAC"}
|