@nodii/dev 0.6.169 → 0.6.171
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/core.js +1 -1
- package/dist/surface.js +14 -2
- package/package.json +1 -1
package/dist/core.js
CHANGED
|
@@ -4,7 +4,7 @@ import { chmod, mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
|
4
4
|
import { homedir, platform } from "node:os";
|
|
5
5
|
import { dirname, join } from "node:path";
|
|
6
6
|
|
|
7
|
-
export const VERSION = "0.6.
|
|
7
|
+
export const VERSION = "0.6.171";
|
|
8
8
|
export const configPath = () =>
|
|
9
9
|
process.env.NODII_DEV_CONFIG_PATH ??
|
|
10
10
|
join(homedir(), ".config/nodii-dev/config.json");
|
package/dist/surface.js
CHANGED
|
@@ -32,7 +32,7 @@ import { CliError, VERSION, devRequest, readConfig } from "./core.js";
|
|
|
32
32
|
import { createRenderer } from "./vendor/render-templates.mjs";
|
|
33
33
|
|
|
34
34
|
/** Bumped whenever the emitted code changes shape for the same inputs. */
|
|
35
|
-
export const GENERATOR_FORMAT =
|
|
35
|
+
export const GENERATOR_FORMAT = 38;
|
|
36
36
|
export const TREE_DIR = "docs/figma-ux-ds/figma/surface-trees";
|
|
37
37
|
export const GENERATED_SUFFIX = ".surface.generated.tsx";
|
|
38
38
|
/** Where every generated product page lives, as a git glob (NODII-DEV-CLI-77). */
|
|
@@ -1901,6 +1901,10 @@ function dataProps(views, propsType) {
|
|
|
1901
1901
|
if (list) member(entry(list), "kind").set("\u0000kind", { raw: '"branch" | "leaf"' });
|
|
1902
1902
|
}
|
|
1903
1903
|
const itemList = (at, name) => (openers.some((o) => o.param === name) ? listAt(openers, at, name) : null);
|
|
1904
|
+
for (const m of body.matchAll(/onCheckedChange=\{([a-z][A-Za-z0-9]*) && \(\(checked\) => \1\(row\.id, checked\)\)\}/g)) {
|
|
1905
|
+
own(m[1], '(id: string, checked: Parameters<NonNullable<ComponentProps<typeof TableSelectionCell>["onCheckedChange"]>>[0]) => void');
|
|
1906
|
+
view.uses.add(m[1]);
|
|
1907
|
+
}
|
|
1904
1908
|
// hub-492: absence of a handler keeps an inert row noninteractive.
|
|
1905
1909
|
for (const m of body.matchAll(/onClick=\{([a-z][A-Za-z0-9]*)\?\.\(row\) \? undefined : ([a-z][A-Za-z0-9]*) \? \2\(row\) : ([a-z][A-Za-z0-9]*) && /g)) {
|
|
1906
1910
|
const list = listAt(openers, m.index, "row");
|
|
@@ -3209,7 +3213,8 @@ function tableOf(node, ctx) {
|
|
|
3209
3213
|
const rowsName = mark(ctx, listName, "rows", null);
|
|
3210
3214
|
let selectedKey = "isSelected";
|
|
3211
3215
|
while (keys.includes(selectedKey)) selectedKey += "Row";
|
|
3212
|
-
const
|
|
3216
|
+
const selectable = dataRows.some(p => p.cells.some(c => /<TableSelectionCell\b/.test(c.code ?? "")));
|
|
3217
|
+
const selection = selectable || dataRows.some(p => p.cells.some(c => c.selected)) ? ` selected={row.${selectedKey}}` : "";
|
|
3213
3218
|
// A row is a door to its record when the page passes a handler (U03-7; NODII-DEV-CLI-83).
|
|
3214
3219
|
const rowClick = mark(ctx, listName, "onRowClick", null);
|
|
3215
3220
|
const inert = mark(ctx, listName, "isRowInert", null);
|
|
@@ -3273,6 +3278,13 @@ function tableOf(node, ctx) {
|
|
|
3273
3278
|
open = own.slice(0, end + 1).replace(/\s*\/>$/, ">");
|
|
3274
3279
|
close = `</${tag}>`;
|
|
3275
3280
|
}
|
|
3281
|
+
// Selection is record data even when the drawing shows every row unchecked.
|
|
3282
|
+
if (/^<TableSelectionCell\b/.test(open)) {
|
|
3283
|
+
const change = mark(ctx, listName, "onRowSelectionChange", null);
|
|
3284
|
+
open = open.replace(/\bchecked=\{(?:true|false)\}/, `checked={row.${selectedKey}}`)
|
|
3285
|
+
.replace(/\bonCheckedChange=\{(?:__s\d+_)?onSelect\}/, `onCheckedChange={${change} && ((checked) => ${change}(row.id, checked))}`);
|
|
3286
|
+
return indent(`${open.slice(0, -1)} />`, depth + 4);
|
|
3287
|
+
}
|
|
3276
3288
|
// Two-line templates own the presentation; both lines belong to each row.
|
|
3277
3289
|
// Reserve every header key before naming secondary fields, so a column
|
|
3278
3290
|
// called "Environment secondary" cannot alias Environment's second line.
|