# Demo

Demo は Host が UnifiedSpread 本体 AMD パッケージをどう組み込むかを示す利用例であり、製品本体ではありません。


## dev-20.7.1 での最大化修正

`parameters.html` などのパラメータ指定型 Demo では、最大化時に Demo 側の Header、Toolbar、Options Panel、Callback Log Panel を隠し、本体 Control 表示用の `#controlFrame` だけが viewport 全体を使うようにしました。

この最大化は `demo/assets/demo-maximize.js` と `demo/assets/demo.css` の Demo 専用実装です。UnifiedSpread runtime、Control API、Command、State、File I/O callback 契約には影響させません。

最大化中は右上の floating restore button、または Esc キーで通常表示へ戻れます。Control は remount されないため、選択状態、入力内容、workbook state、注入済み `OpenFile` / `SaveFile` callback は維持されます。

## dev-20.5.1 での修正

- 成果物直下の `index.html` を削除しました。
- Demo HTML から UnifiedSpread 本体 UI の固定 markup を削除しました。
- Demo HTML は Host 側の説明・パラメータ領域・本体 Control 表示用 DIV フレームのみを持ちます。
- UnifiedSpread 本体 UI は `UnifiedSpread.createWorkbenchControl({ container: '#controlFrame', ... }).mount()` により runtime 側が生成します。
- Local Disk の Open / Save は `demo/assets/local-file-callbacks.js` に分離し、`OpenFile` / `SaveFile` callback として Control に注入します。
- 本体 Control 表示フレームは通常表示とページ領域最大化表示を切り替えられます。

## Demo 一覧

| Demo | 目的 |
| --- | --- |
| `index.html` | Demo 一覧と概要。 |
| `basic.html` | 基本起動、Local callback 注入、最大化表示確認。 |
| `parameters.html` | language / theme などの Host options を変更し再マウント。 |
| `callback-io.html` | `OpenFile` / `SaveFile` request / response のログ確認。 |
| `control-architecture.html` | Control API / Command / `getState()` の利用例。 |
| `regression-tests.html` | 軽量回帰テスト。 |

## 方針

Demo 専用コード、説明文、パラメータパネル、Local callback 実装は `demo/` 配下に限定します。`scripts/` 配下の製品本体は、保存先名称や Local 端末固有 UI を直接持たず、Host から渡された `OpenFile` / `SaveFile` callback のみを呼び出します。


## dev-22.0.1 Demo chrome stability
Demo maximization now locks html/body scrolling and gives the mounted Control frame the whole viewport. The product title/menu row remains part of the runtime UI and should not disappear while interacting with object-layer items.


## oneeditor-integration.html

`demo/oneeditor-integration.html` demonstrates the OneEditor integration profile. The Demo shell owns the top File/menu area, creates `createEditorControl({ hostProfile: 'oneEditor' })`, and obtains declarative menu / toolbar / context menu / file capability descriptors from the Control.

This Demo intentionally keeps OneEditor-like Host shell logic under `demo/` and does not mix it into runtime Control code.


## callback-io.html v1.3 check

`callback-io.html` includes a Generate Save Payload button. It calls `control.saveFile({ fileName: 'callback_payload.uspdx' })` and logs the returned `HostSavePayload/v1` summary, confirming that EditorControl can generate save data without invoking Host storage directly.
