@ashley-shrok/viewmodel-shell 0.16.0 → 1.0.1

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/dist/browser.d.ts CHANGED
@@ -1,24 +1,14 @@
1
- import type { ViewNode, ActionEvent, Adapter } from "./index.js";
1
+ import type { ViewNode, ActionEvent, Adapter, StateAccess } from "./index.js";
2
2
  export declare class BrowserAdapter implements Adapter {
3
3
  private container;
4
4
  private fileRegistry;
5
+ private sa;
5
6
  constructor(container: HTMLElement);
6
- render(vm: ViewNode, onAction: (action: ActionEvent) => void): void;
7
+ render(vm: ViewNode, onAction: (action: ActionEvent) => void, stateAccess?: StateAccess): void;
7
8
  navigate(url: string): void;
8
9
  storage(scope: "local" | "session", key: string, value: string): void;
9
- /** Save an authenticated-download blob via the browser's native Save-As.
10
- * contentType is informational — the Blob's own .type takes precedence in
11
- * browsers. We accept the arg for adapter symmetry (other adapters use it). */
12
10
  saveFile(data: Blob, filename: string, _contentType: string): void;
13
- /** 0.16.0 — toggle the `.vms-busy` class on the container. Default CSS makes
14
- * every interactive descendant non-clickable (cursor:wait + pointer-events:
15
- * none), so a rapid checkbox click during a round-trip never visually flips
16
- * the box. Idempotent (classList.toggle with a force value). */
17
11
  setBusy(active: boolean): void;
18
- /** 0.14.0 — install / clear the browser's `beforeunload` guard. The shell
19
- * calls this on every response with `response.preventUnload ?? false`, so
20
- * the lock-and-clear cycle is just "server sets preventUnload:true while
21
- * work is pending, omits it (or sets false) when done." Idempotent. */
22
12
  private unloadHandler;
23
13
  setPreventUnload(active: boolean): void;
24
14
  transport(input: string, init: {
@@ -34,17 +24,33 @@ export declare class BrowserAdapter implements Adapter {
34
24
  private section;
35
25
  private list;
36
26
  private listItem;
27
+ /** FormNode — no harvest. Field values live in state via their bind paths;
28
+ * submit dispatches just `{name}`. File inputs are walked for binaries to
29
+ * attach to action.files (multipart side channel). */
37
30
  private form;
31
+ /** FieldNode — reads value from `sa.read(bind)`; writes back on input/change.
32
+ * When `action` is set, it fires on Enter (text-like) or change (select) —
33
+ * the new value is already in state by that point. */
38
34
  private field;
35
+ /** CheckboxNode (standalone, immediate-dispatch) — bound boolean; on toggle,
36
+ * write to state then dispatch the action name (if any). */
39
37
  private checkbox;
40
38
  private button;
41
39
  private text;
42
40
  private link;
43
41
  private statBar;
42
+ /** TabsNode — on click, write tab.value to state at node.bind, then dispatch
43
+ * the tab's own action name. */
44
44
  private tabs;
45
45
  private image;
46
46
  private progress;
47
47
  private modal;
48
+ /** TableNode — sort writes {column, direction} to sortBind then dispatches
49
+ * sortActions[col.key]; filter inputs are bound to filterBinds[col.key],
50
+ * every keystroke writes, Enter dispatches filterAction; pagination
51
+ * prev/next write the target page to paginationBind then dispatch
52
+ * prevAction/nextAction. Per-row buttons are plain ButtonNodes. Selection
53
+ * is no longer a framework concept. */
48
54
  private table;
49
55
  private copyButton;
50
56
  }