@nodii/dev 0.6.206 → 0.6.208
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 +19 -5
- package/package.json +1 -1
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.208";
|
|
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 = 63;
|
|
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
|
|
@@ -3133,6 +3133,12 @@ function emitChildren(children, emitOne, ctx) {
|
|
|
3133
3133
|
runKind = kind;
|
|
3134
3134
|
} else {
|
|
3135
3135
|
flush();
|
|
3136
|
+
// The DS TabsList draws its own 1px baseline, so Figma's Separator directly under a
|
|
3137
|
+
// strip is that baseline: emitting it draws the line twice (NODII-DEV-CLI-298).
|
|
3138
|
+
if (separatorOf(c) && TAB_STRIP_END.test(out.at(-1) ?? "")) {
|
|
3139
|
+
ctx.note(`${ctx.path} › ${c.name}`, ASSEMBLED, "Separator under a Tab strip absorbed by the TabsList's own baseline (NODII-DEV-CLI-298)");
|
|
3140
|
+
continue;
|
|
3141
|
+
}
|
|
3136
3142
|
const code = emitOne(c);
|
|
3137
3143
|
if (code !== null) out.push(code);
|
|
3138
3144
|
}
|
|
@@ -3141,6 +3147,11 @@ function emitChildren(children, emitOne, ctx) {
|
|
|
3141
3147
|
return pairLabelledControls(out);
|
|
3142
3148
|
}
|
|
3143
3149
|
|
|
3150
|
+
/** A horizontal DS Separator instance. */
|
|
3151
|
+
const separatorOf = (node) => node.instance?.remote && node.instance.set === "Separator" && (node.instance.props?.orientation ?? "horizontal") === "horizontal";
|
|
3152
|
+
/** Emitted code that ends with a Tab strip, inside any number of wrapping divs. */
|
|
3153
|
+
const TAB_STRIP_END = /<\/TabsList>\s*<\/Tabs>(?:\s*<\/div>)*\s*$/;
|
|
3154
|
+
|
|
3144
3155
|
/** The one-step Stepper the Stepper template emits for one Figma Step. */
|
|
3145
3156
|
const ONE_STEP_PROBE = /^<Stepper\n\s*steps=\{\[\{ id: "step-1"[\s\S]*\}\]\}(?:\n\s*[A-Za-z]+=(?:"[^"\n]*"|\{[^{}\n]*\}))*\n\/>$/;
|
|
3146
3157
|
|
|
@@ -4164,14 +4175,17 @@ function tableOf(node, ctx) {
|
|
|
4164
4175
|
const w = columnWidth(c.cell);
|
|
4165
4176
|
let open = withAlign(`<TableCell${wrapperAttrs(w, first.row)}>`, i);
|
|
4166
4177
|
let close = "</TableCell>";
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4178
|
+
// A union column's cell is the person cell's own, whichever row the frame draws first:
|
|
4179
|
+
// a plain first row would drop the rich cell's density (NODII-DEV-CLI-299).
|
|
4180
|
+
const sample = piiColumn[i] ? (mixedPii.get(i)?.sample ?? nullablePii.get(i)?.sample ?? personSamples.get(i) ?? c) : c;
|
|
4181
|
+
if (sample.code && !sample.held) {
|
|
4182
|
+
const emitted = emitNode(sample.cell, { ...ctx, depth: 0, parent: null, path: `${ctx.path} › ${first.row.name}`, root: false, bare: true, inTable: true, scopes: null, note: () => {} });
|
|
4183
|
+
const own = withWidth(sample.selected ? selectedCell(emitted) : emitted, w).trim();
|
|
4170
4184
|
const end = openTagEnd(own);
|
|
4171
4185
|
const tag = /^<([A-Za-z]+)/.exec(own)[1];
|
|
4172
4186
|
open = withAlign(own.slice(0, end + 1).replace(/\s*\/>$/, ">"), i);
|
|
4173
4187
|
close = `</${tag}>`;
|
|
4174
|
-
if (oneLine(open,
|
|
4188
|
+
if (oneLine(open, sample.cell, own.slice(end + 1, own.lastIndexOf(close)), piiColumn[i])) open = withTruncate(open);
|
|
4175
4189
|
}
|
|
4176
4190
|
// Selection is record data even when the drawing shows every row unchecked.
|
|
4177
4191
|
if (/^<TableSelectionCell\b/.test(open)) {
|