@paged-media/plugin-api 0.2.27-canary.1 → 0.2.29-canary.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.
@@ -25,6 +25,71 @@ export interface BindingRef {
25
25
  * (and a missing name reads as `false` — a visible seam, never a
26
26
  * throw). */
27
27
  export type SchemaGate = boolean | BindingRef;
28
+ /** Where a `list` row's items come from. Two sources, mirroring the
29
+ * two live-collection lanes the host already has:
30
+ * · `documentCollection` — a named engine collection (the same
31
+ * `host.document.collection(name)` lane the editor's own panels
32
+ * read);
33
+ * · `binding` — an ARRAY the plugin publishes through
34
+ * `host.bindings.publish(name, rows)` (the §12.2 published-
35
+ * bindings door, now carrying rows instead of a boolean). */
36
+ export type WidgetCollectionBinding = {
37
+ kind: "documentCollection";
38
+ collection: string;
39
+ } | {
40
+ kind: "binding";
41
+ bind: string;
42
+ };
43
+ /** G3 — a schema row ACTION. Either dispatches a registered command
44
+ * with the row id as payload, or the `applyEntity` write kind: apply
45
+ * the row's entity id (style / swatch self-id) to the current
46
+ * selection through the SAME `setElementProperty` mutation channel the
47
+ * scalar widgets commit on. `valueType` picks the wire payload
48
+ * (`text` for applied-style paths, `colorRef` for swatch/gradient
49
+ * paths) — the collection-select leaf's convention. Note the ceiling
50
+ * holds: an action writes ONE typed PropertyPath, it does not compute. */
51
+ export type SchemaRowAction = {
52
+ kind: "command";
53
+ command: string;
54
+ } | {
55
+ kind: "applyEntity";
56
+ /** Selection surface to write to (defaults to `"element"`). */
57
+ scope?: "element" | "content";
58
+ /** The applied-entity PropertyPath (e.g. `frameFillColor`,
59
+ * `appliedParagraphStyle`). */
60
+ path: PropertyPath;
61
+ /** Wire payload variant; defaults to `"text"`. */
62
+ valueType?: "text" | "colorRef";
63
+ };
64
+ /** One per-row action button on a `list` widget. */
65
+ export interface SchemaListAction {
66
+ /** Button label (sentence case, no emoji — brand content rules). */
67
+ label: string;
68
+ action: SchemaRowAction;
69
+ /** Gate the button on a published binding (absent = enabled;
70
+ * `applyEntity` actions additionally disable while the target
71
+ * selection is empty — the honest no-write-path rule). */
72
+ enabled?: SchemaGate;
73
+ }
74
+ /** The `list` widget spec (widget id `paged.list`). Renders rows from a
75
+ * collection binding; publishes the clicked row's id back through
76
+ * `selectionBinding` so other rows/sections can gate on it — which is
77
+ * how a list participates in §12.2 without a DSL. */
78
+ export interface SchemaListSpec {
79
+ items: WidgetCollectionBinding;
80
+ /** Dot-path into a row object for the primary label ("name"). */
81
+ labelField: string;
82
+ /** Optional secondary line (mono), e.g. "kind". */
83
+ secondaryField?: string;
84
+ /** Dot-path carrying the row's stable id; defaults to "selfId" (the
85
+ * summary-shape convention every document collection uses). */
86
+ idField?: string;
87
+ /** Published binding name that receives the selected row id on click
88
+ * (string). Absent = the list keeps private selection. */
89
+ selectionBinding?: string;
90
+ /** Per-row action buttons. */
91
+ actions?: SchemaListAction[];
92
+ }
28
93
  export interface PanelSchemaRow {
29
94
  /** Catalog widget id (a curated primitive-leaf id the host
30
95
  * registered). An unknown id renders a visible "unknown widget"
@@ -38,6 +103,9 @@ export interface PanelSchemaRow {
38
103
  * (`literal | selectionProperty`). Absent = a layout-only / display
39
104
  * leaf (label, section). */
40
105
  value?: WidgetValueBinding;
106
+ /** ADDITIVE (schema v1.1) — present iff `widget` is the list widget
107
+ * (`paged.list`). Scalar rows ignore it; a v1 schema never sets it. */
108
+ list?: SchemaListSpec;
41
109
  /** Show the row only when this gate is truthy. Absent = always. */
42
110
  visible?: SchemaGate;
43
111
  /** Enable the row's control only when this gate is truthy. Absent =