@nodii/dev 0.6.203 → 0.6.204
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/README.md +7 -0
- package/dist/core.js +1 -1
- package/dist/surface.js +27 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1355,6 +1355,13 @@ product-page catalog names the Surface by its published component-set key
|
|
|
1355
1355
|
whole, `value={loading ? <Skeleton shape="text" /> : <PiiText value={emailValue} … />}`,
|
|
1356
1356
|
so PiiText's `value` stays `string | null`. A value that reads nothing (fixed
|
|
1357
1357
|
copy) is left as it is.
|
|
1358
|
+
- **A person in a fact row is the served pair (DESIGN-SYSTEM-993).** A PiiText in
|
|
1359
|
+
a fact row's value slot (a Description List's `value`, a Right Pane / Row's or
|
|
1360
|
+
a Detail Section / Row's `valueSlot`) takes `value`, `model` and `relation`
|
|
1361
|
+
from its template and also the server's `maskHint` and `disposition`, both
|
|
1362
|
+
optional, as a lifted table's person cell takes `{ value, model, relation,
|
|
1363
|
+
maskHint? }`. The page passes them through as served: the relation keeps a
|
|
1364
|
+
self value revealed, and the generator never sets a mask (P-10).
|
|
1358
1365
|
- **Error and Empty views a route drives (NODII-DEV-CLI-260).** The Surface takes
|
|
1359
1366
|
`<Id>SurfaceInput`: a `state` with the full props, as before, or a literal
|
|
1360
1367
|
`state` with only the props its view reads (`{ state: "read-error" } &
|
package/dist/core.js
CHANGED
|
@@ -4,7 +4,7 @@ import { chmod, lstat, mkdir, readFile, rename, rm, writeFile } from "node:fs/pr
|
|
|
4
4
|
import { homedir, platform } from "node:os";
|
|
5
5
|
import { basename, dirname, join } from "node:path";
|
|
6
6
|
|
|
7
|
-
export const VERSION = "0.6.
|
|
7
|
+
export const VERSION = "0.6.204";
|
|
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
|
@@ -34,7 +34,7 @@ import { MIN_FIGMA_INTERVAL_MS, figmaRest } from "./figma-rest.js";
|
|
|
34
34
|
import { createRenderer } from "./vendor/render-templates.mjs";
|
|
35
35
|
|
|
36
36
|
/** Bumped whenever the emitted code changes shape for the same inputs. */
|
|
37
|
-
export const GENERATOR_FORMAT =
|
|
37
|
+
export const GENERATOR_FORMAT = 57;
|
|
38
38
|
/**
|
|
39
39
|
* DS parts that are an item of their parent's own list or grid, so they take no sizing
|
|
40
40
|
* wrapper: a Detail Section / Row's facts are the section grid's cells, a Right Pane / Row
|
|
@@ -1183,6 +1183,13 @@ const literalText = (lit) => JSON.parse(lit.startsWith("{") ? lit.slice(1, -1) :
|
|
|
1183
1183
|
* A run of sibling DescriptionLists and a table's body rows are lifted as lists
|
|
1184
1184
|
* (liftedDescriptionList, tableOf). Real copy (headings, labels, buttons) stays.
|
|
1185
1185
|
*/
|
|
1186
|
+
/**
|
|
1187
|
+
* The fact rows whose value is a slot, by Figma set, and that slot: a PiiText there takes the
|
|
1188
|
+
* server's `maskHint` and `disposition` as optional props (DESIGN-SYSTEM-993). A Detail Section /
|
|
1189
|
+
* Row's facts are its exposed Detail Section / Fact parts, read through the Row's own slots.
|
|
1190
|
+
*/
|
|
1191
|
+
const FACT_VALUE_SLOTS = new Map([["Description List", "value"], ["Right Pane / Row", "valueSlot"], ["Detail Section / Row", "valueSlot"]]);
|
|
1192
|
+
const FACT_PII_PROPS = ["maskHint", "disposition"];
|
|
1186
1193
|
function liftRecordData(code, node, ctx, path, scope = scopeName(node)) {
|
|
1187
1194
|
const lifted = [];
|
|
1188
1195
|
const lift = (at, name) => (lifted.push(name), mark(ctx, at, name));
|
|
@@ -1418,7 +1425,23 @@ function liftRecordData(code, node, ctx, path, scope = scopeName(node)) {
|
|
|
1418
1425
|
});
|
|
1419
1426
|
out = rewriteTags(out, "PiiText", (attrs) => {
|
|
1420
1427
|
const hint = new RegExp(String.raw`\bmaskHint=${LITERAL}`).exec(attrs);
|
|
1421
|
-
|
|
1428
|
+
// A person in a fact row's value is the served pair, as a table's person cell is: the page
|
|
1429
|
+
// passes the server's hint and disposition with its value, model and relation, so a
|
|
1430
|
+
// colleague HR withholds reads HR's hint, not "Restricted". Both are optional, the hint
|
|
1431
|
+
// too where Figma drew one (the server may send none), and the relation still decides
|
|
1432
|
+
// self, so nothing here can force a mask (P-10; DESIGN-SYSTEM-993).
|
|
1433
|
+
const hintProp = () => (ctx.factValue ? (lifted.push("maskHint"), optionalMark(ctx, scope, "maskHint")) : lift(scope, "maskHint"));
|
|
1434
|
+
let next = hint ? attrs.replace(hint[0], `maskHint={${hintProp()}}`) : attrs;
|
|
1435
|
+
if (ctx.factValue) {
|
|
1436
|
+
for (const prop of FACT_PII_PROPS) {
|
|
1437
|
+
if (new RegExp(String.raw`\b${prop}=`).test(next)) continue;
|
|
1438
|
+
lifted.push(prop);
|
|
1439
|
+
const attr = ` ${prop}={${optionalMark(ctx, scope, prop)}}`;
|
|
1440
|
+
const after = topLevelAttr(next, prop === "disposition" ? "maskHint" : "relation") ?? topLevelAttr(next, "relation");
|
|
1441
|
+
next = after ? `${next.slice(0, after.to)}${attr}${next.slice(after.to)}` : next.replace(/(\s*\/?\s*)$/, `${attr}$1`);
|
|
1442
|
+
}
|
|
1443
|
+
}
|
|
1444
|
+
return next;
|
|
1422
1445
|
});
|
|
1423
1446
|
// A title or label that dates or counts a record ("Headcount over time · 27 May 2026 to
|
|
1424
1447
|
// 25 Aug 2026", "Q3 2026 Performance Review", "Pay events 2027") is the record's; fixed copy
|
|
@@ -2842,7 +2865,8 @@ function emitNode(node, ctx) {
|
|
|
2842
2865
|
return comment(`unmapped: slot ${JSON.stringify(prop)} has no auto layout`);
|
|
2843
2866
|
}
|
|
2844
2867
|
const textOwner = TEXT_PROPERTY_PARTS.has(node.instance.set) ? node.instance.set : ctx.textOwner;
|
|
2845
|
-
const
|
|
2868
|
+
const factValue = FACT_VALUE_SLOTS.get(node.instance.set) === prop;
|
|
2869
|
+
const slotCtx = { ...ctx, depth: 0, parent: slotNode, grand: null, path: `${path} › ${prop}`, root: false, textOwner, slotOwner: owner, factValue, inTable: false, inSlot: true, chain: slotNode ? [...chain, slotNode] : chain, layer: `${ctx.layer}${nestedPath.map(part => ` › ${part}`).join("")} › ${prop}` };
|
|
2846
2870
|
const inner = emitChildren(slotNode?.children ?? [], (c) => emitNode(c, slotCtx), slotCtx);
|
|
2847
2871
|
return inner.length === 0 ? "<></>" : inner.length === 1 ? inner[0] : `<>\n${inner.map((x) => indent(x, 1)).join("\n")}\n</>`;
|
|
2848
2872
|
};
|