# Bone Flow #028 - TextArea

Version: 1.0.14  
Status: Development  
Baseline: #027 Bone TextBox v1.0.14

## 概要

#028 Bone TextArea は複数行の `string` valueを入力・編集するInput UI Componentです。#027 TextBoxの正式Input UI基準を維持し、TextArea固有差分のみを追加します。#027 / #001 / #002 / #017は変更しません。

## 正式依存

- #001 Bone Core v1.0.0 — Bone `{id,type,value}` の正規化。
- #002 Bone Joint v1.1.36 — 接続、Compatibility、WAIT、FIFO、BLOCKED、配送、Joint描画。
- #022 Bone Hover Border Effect v1.0.8 minimum — Mouse Over時の枠Effect描画。
- #017 Bone Text — Runtime非依存。表示責務・Property表現の基準のみ。

## TextArea固有Property

- `rows`: 1～1000。既定 6。
- `cols`: 1～1000。既定 40。
- `wrap`: `soft / hard / off`。既定 `soft`。
- `resize`: `none / vertical / horizontal / both`。既定 `vertical`。
- `scroll`: `auto / hidden / scroll`。既定 `auto`。
- `commitShortcut`: `ctrl-enter / meta-enter / ctrl-or-meta-enter / none`。既定 `ctrl-or-meta-enter`。
- 既定サイズ: width 480px / height 160px。

## 編集・commit

`editingValue` と `committedValue` を分離し、`dirty = editingValue !== committedValue` とします。

- `input`: editingValue更新。
- `Enter`: 通常の改行。commitしない。
- `Ctrl+Enter / Cmd+Enter`: `commitShortcut` が許可する場合にcommit。
- `blur`: `blurCommit=true` の場合にcommit。
- `Escape`: editingValueをcommittedValueへ戻す。
- IME composition中: commit shortcutを処理しない。
- `readonly / disabled`: commit禁止。

commit成功時は、その時点の値をsnapshotとして #002 `BoneJoint.createDeliveryChannel()` へ渡します。TextArea自身にqueue / retryを実装しません。

## 改行

LF (`\n`) / CRLF由来のCR (`\r`) を文字列として許可します。NUL等の危険な制御文字は拒否します。改行をHTMLへ変換・実行しません。

## Untrusted IN / Security

受理するvalueは `string / null / undefined`。`null / undefined` は空文字契約です。

拒否対象:

- object / array / function
- getter / setter
- Proxy trap
- securityMaxLength超過
- 危険な制御文字
- 不正Unicode surrogate

objectを `String(value)` で強制文字列化しません。HTML風文字列は `textarea.value` として文字列のまま保持します。

Security Testは通常のTextArea Previewと別instanceを使用し、通常Previewのvalue / editing / committed / OUTへ干渉しません。

## WAIT / BLOCKED

- WAIT: 接続線を維持し、Joint側FIFOで待機。Target Ready後に自動配送。
- BLOCKED: 接続線を維持し、Targetへ配送しない。

WAIT / BLOCKEDはいずれもdisconnectではありません。

## 表示基準

#027から以下を維持します。

- 日本語 / English Property
- Theme: 標準 / Dark / Light / Neon
- backgroundColor: theme / transparent / safe HEX
- appearance: normal / flat / borderless
- 親要素に依存
- 9方向配置
- 入力時文字位置
- Active Border Effect: normal / neon / blink
- #002 Bone Joint正式描画による接続イメージ5ケース
- Smoke / Validation / JSON・MD Report / Completion管理

親依存ON時は幅・高さ100%、親の背景色・文字色・角丸・文字位置へ追従し、TextAreaのresizeは無効にします。

## Test URL

`http://localhost/BoneFlow/test/bone-textarea.html`

CompletionはブラウザRuntime QA ALL PASSに加え、WAIT / BLOCKEDの目視確認後に行います。未実施RuntimeをALL PASSとは扱いません。

## v1.0.5 Security Gate エラー内容表示

Untrusted IN / Security Test の中央「TextArea Security」に、BLOCKED時のエラーコードに加えて `message`（エラー内容）を表示する。PASS時は「エラーなし」を表示する。Security判定・TextArea本体・Property・接続イメージ・WAIT/BLOCK・Completionのロジックは変更しない。



## v1.0.6 Dependency Version compatibility

#001 Bone Core / #002 Bone Joint の依存Version判定は、完全一致ではなく Minimum Version + Public API compatibility を使用する。Version互換条件は same major.minor かつ actual patch >= minimum patch。#028 自身のVersion確認は完全一致のまま維持する。


## v1.0.7 Missing common UI restoration

- `Untrusted IN / Security Test` は通常Previewと独立した既存Security Testを維持し、表示Smokeを追加。
- `mouseoverBorderEffect / mouseoverEffectColor / mouseoverEffectDirection / mouseoverEffectSpeed` を追加し、描画は #022 Bone Hover Border Effectへ委譲。
- `Class リスト` を追加。`TextAreaClassSample` のコード、実UI生成、Class経由の値設定/commit、State/実行結果を同一画面で確認する。
- TextArea固有 rows / cols / wrap / resize / scroll / commitShortcut、Security判定、WAIT/BLOCK、接続イメージ、Completionは変更しない。

## v1.0.8 Guide
TESTのClassリストからGuideを開き、Public API一覧/詳細、使用方法、TextAreaClassSampleのいつ・どこで使用するか、参照データ、コード各部、コードの書き方、サンプル、実行結果を確認できる。

## v1.0.9 Installer version verification fix

- `install.ps1` / `install.bat` のComponent Versionを 1.0.9 へ同期。
- HTML / JS の実装VersionとInstaller期待Versionを一致させ、HTML version verification失敗を解消。
- #022 minimum 1.0.8 を含むDependency contractは変更しない。

## v1.0.10 Guide layout correction
- #027 TextBox v1.0.35 のGuide構造を維持。
- TextAreaの長いPublic API/Class内容でGuide全体に横スクロールが発生しないよう、Guide内コンテンツのmin-width/折返しを修正。
- Classリスト本体、Security、Mouse Over、TextArea Runtime責務は変更しない。


## v1.0.11 Guide content correction

- #027 TextBox v1.0.35 の実Guide内容を基準に、#028 Guideの「操作説明」を同じ構造へ修正。
- クラス一覧 → いつ・どこで使用するか → 参照するデータの説明 → 参照データ詳細 → コードの書き方 → サンプル → 結果、の順で説明。
- 使用方法はTextArea固有の複数行、rows/cols/wrap/resize/scroll/commitShortcut、Security IN、#002 WAIT/BLOCK、Parent、#022 Effect、selection、destroyのみを記載。
- #028に存在しない #040 ColorPicker はGuideへ追加していない。


## v1.0.14 Full TEST UI / Class List / Guide review

- #027 TextBox v1.0.35 was used as the primary structural reference for Guide presentation.
- Added 8 executable consumer-side Classes grouped by responsibility.
- All 35 BoneTextArea Public APIs are covered exactly once by the Class List catalog.
- Added ordinary TEST-screen operation instructions before Class-by-Class operation documentation.
- Corrected stale `textbox` sample-variable names in the #028 Public API Guide to `textarea`.
- Completed English Mouse Over `spin` / `cross` Property labels found during full-screen review.
- Runtime behavior itself is unchanged except self-version synchronization.


## HTML Functional Class `bf-textarea` (Package 1.0.14)

Dependencies: BoneCore / BoneJoint / #022 Effect / BoneTextArea Runtime 1.0.14. Load `js/bone-textarea-html-class.js` after these dependencies.

```html
<div class="bf-textarea" data-id="memo" data-value="1行目&#10;2行目" data-placeholder="メモを入力" data-rows="6" data-cols="40" data-width="480" data-height="160" data-wrap="soft" data-resize="vertical" data-commit-shortcut="ctrl-or-meta-enter"></div>
```

Use `BoneTextAreaHTMLClass.scan(root)` for elements added later. `mount(element)` returns the real BoneTextArea instance or null and fires `bone-textarea-html-class-error` on failure. The 028 HTML Class test page uses mocked dependencies for contract testing only; full runtime QA requires installed Bone Flow dependencies.


## Runtime correction candidate (package 1.0.29, runtime 1.0.16)
- #022 Border Effect is connected for Active and Mouse Over with focus/blur updates and all nine official effect kinds.
- #040 gradient RETURN is preserved; the official #022 overlay gets a caller-scoped gradient border layer.
- #118 four Property options remain available below Effect settings and are passed to #040 Caller.
- Actual Windows Installer execution and localhost UI tests are unverified. Use the on-page effect audit and existing Smoke/Validation.
