@unoverse-platform/studio 0.1.5 → 0.1.6
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/package.json
CHANGED
|
@@ -71,6 +71,11 @@ export interface UnoverseNode {
|
|
|
71
71
|
userData?: Record<string, unknown>;
|
|
72
72
|
/** Icon: the served glyph NAME (literal) — or bind a data field via `bind.name`. */
|
|
73
73
|
icon?: string;
|
|
74
|
+
/** Icon: the same literal under the key a `Ref`'s `with` writes. An atom binds `name`, and
|
|
75
|
+
* `applyLiterals` replaces that bind with a literal of the SAME key — so a Ref-supplied
|
|
76
|
+
* glyph arrives as `name`, never as `icon`. Declared because the renderer reads it; it was
|
|
77
|
+
* read without being declared, which typechecked nowhere until Studio's config was fixed. */
|
|
78
|
+
name?: string;
|
|
74
79
|
/** Disable the element (Input/Button) when this data field is truthy; the node's
|
|
75
80
|
* `style.disabled` is merged while disabled. */
|
|
76
81
|
disabledWhen?: string;
|
|
@@ -147,9 +147,13 @@ export function renderNode(
|
|
|
147
147
|
// be authored without it: the data carries no ordinal, and a template cannot count.
|
|
148
148
|
// `index` is 0-based for logic, `position` 1-based because that is what a reader sees.
|
|
149
149
|
// The item's own fields always win, so data that carries either name is untouched.
|
|
150
|
+
// AN ARRAY ITEM IS THE VALUE. `typeof [] === "object"`, so an array took the spread
|
|
151
|
+
// branch and its INDICES became scope keys ({0: "London", 1: "+44…"}) while `value` was
|
|
152
|
+
// never set. A nested Each bound to `value` — a table's row of cells — then found
|
|
153
|
+
// nothing, and every table rendered its headers over empty rows.
|
|
150
154
|
const scopeOf = (item: unknown, i: number): Record<string, unknown> => {
|
|
151
155
|
const base = { index: i, position: i + 1 };
|
|
152
|
-
return item != null && typeof item === "object"
|
|
156
|
+
return item != null && typeof item === "object" && !Array.isArray(item)
|
|
153
157
|
? { ...base, ...(item as Record<string, unknown>) }
|
|
154
158
|
: { ...base, value: item };
|
|
155
159
|
};
|