@nodii/dev 0.6.197 → 0.6.198
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 +22 -2
- 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.198";
|
|
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 = 52;
|
|
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
|
|
@@ -1704,7 +1704,27 @@ function textNextTo(node, ctx) {
|
|
|
1704
1704
|
}
|
|
1705
1705
|
return null;
|
|
1706
1706
|
};
|
|
1707
|
-
return beside(ctx.parent, node) ?? (ctx.grand ? beside(ctx.grand, ctx.parent) : null);
|
|
1707
|
+
return beside(ctx.parent, node) ?? (ctx.grand ? beside(ctx.grand, ctx.parent) : null) ?? fieldGroupLabel(ctx.slotOwner);
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
/**
|
|
1711
|
+
* A FieldGroup labels its group, never its controls. A box or switch drawn
|
|
1712
|
+
* alone in its slot, with no text beside it, is named by the group's label:
|
|
1713
|
+
* else it has no accessible name (hub-629). With several toggles
|
|
1714
|
+
* each needs its own text, so none borrows the group's.
|
|
1715
|
+
*/
|
|
1716
|
+
function fieldGroupLabel(owner) {
|
|
1717
|
+
if (owner?.instance?.set !== "FieldGroup") return null;
|
|
1718
|
+
const label = owner.instance.props?.label;
|
|
1719
|
+
if (typeof label !== "string" || !/[A-Za-z]/.test(label)) return null;
|
|
1720
|
+
let toggles = 0;
|
|
1721
|
+
const count = (n) => {
|
|
1722
|
+
if (!n || n.visible === false) return;
|
|
1723
|
+
if (n !== owner && (n.instance?.set === "Switch" || n.instance?.set === "Checkbox")) toggles += 1;
|
|
1724
|
+
for (const c of n.children ?? []) count(c);
|
|
1725
|
+
};
|
|
1726
|
+
count(owner);
|
|
1727
|
+
return toggles === 1 ? label : null;
|
|
1708
1728
|
}
|
|
1709
1729
|
|
|
1710
1730
|
/** The form controls the page owns: a value it passes and a change it hears (NODII-DEV-CLI-82, -83). */
|