@designbasekorea/ui-wc 0.14.0 → 0.15.0

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.
@@ -0,0 +1,31 @@
1
+ <!-- Generated from docs/LAYER-LIST.md by scripts/sync-package-docs.mjs. -->
2
+ # Layer List
3
+
4
+ `db-layer-list` / React `LayerList` is a compact list for editor layers and effect stacks. It composes native Designbase ghost buttons and outline icons. Default labels follow `dbSetLocale`; item labels and custom action labels belong to the host document.
5
+
6
+ ```tsx
7
+ import { useState } from 'react';
8
+ import { LayerList, type LayerListItem } from '@designbasekorea/ui-wc/react';
9
+ const initial: LayerListItem[] = [
10
+ { id:'color', label:'Color grade', visible:true },
11
+ { id:'grain', label:'Film grain', locked:true },
12
+ ];
13
+ export function Effects() {
14
+ const [items,setItems] = useState(initial);
15
+ return <LayerList items={items} dragMode="handle"
16
+ onChange={e => { setItems(e.detail.items); /* persist complete document state */ }} />;
17
+ }
18
+ ```
19
+
20
+ - `items`: array or JSON string, unique stable `id`, `label`, optional `description`, official `icon`, `visible` (default true), `locked`, `removable` (default true), `actions: {id,label,icon,disabled?}[]`.
21
+ - `drag-mode`: `handle` (default) or `row`. Row mode omits the grip; mouse/touch can drag anywhere except action buttons. Use handle mode when touch users need to scroll by swiping rows.
22
+ - `selected-id` / `selectedId`: selected item. Selection does not change visibility or lock.
23
+ - `actions-visibility` / `actionsVisibility`: `always` (default) or `hover`. Hover mode reveals controls on row hover or keyboard focus, keeps label space stable, and always displays actions on touch devices.
24
+ - `disabled`, `hide-visibility`, `hide-lock`, `hide-delete` are boolean options.
25
+ - `--db-layer-list-max-height`: opt-in scrolling height, e.g. `240px`. Dragging at an overflowing ancestor's top/bottom scrolls it. Width always stays inside the parent.
26
+
27
+ `db-change` delivers `{items,itemId,action,fromIndex?,toIndex?}`, where action is `reorder`, `visibility`, `lock`, or `delete`. `db-reorder` also reports reorder only. `db-selection-change` reports `{itemId}`. `db-action` reports custom `{itemId,actionId}`; the owner implements duplication, settings, etc. React maps these to `onChange`, `onReorder`, `onSelectionChange`, `onAction`. Persist only once through `onChange`; subscribing to both change and reorder must not produce two history entries.
28
+
29
+ A locked item cannot initiate drag or be deleted, but can be unlocked or hidden. Other items may reorder around it. `removable:false` removes delete entirely. No network or project deletion occurs automatically; the component only changes its local list and emits the result. Supply saved items on remount.
30
+
31
+ Keyboard on a focused row: arrows focus previous/next, Enter/Space select, Alt+Up/Down reorder, Delete/Backspace delete when allowed, Escape cancels an active drag. Buttons retain their own normal keyboard behavior. Pointer cancellation and disconnection cancel uncommitted reorder. One drop produces one change; clicking an action never initiates row drag.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@designbasekorea/ui-wc",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "Supernormal Web Components 및 React wrapper — by Designbase",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",