@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unoverse-platform/studio",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "description": "Unoverse Studio: the local authoring app. Reads your own rx/ folder, no backend.",
6
6
  "scripts": {
@@ -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
  };