@yahoo/uds-create-cli 5.107.2 → 5.108.0
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 +12 -12
- package/subprocess/transform-runner.mjs +193 -28
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yahoo/uds-create-cli",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.108.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"@modelcontextprotocol/sdk": "^1.32.2",
|
|
33
33
|
"@orpc/client": "^1.13.9",
|
|
34
34
|
"@orpc/contract": "^1.13.9",
|
|
35
|
-
"@yahoo/uds-create-config": "5.
|
|
36
|
-
"@yahoo/uds-create-loader": "5.
|
|
37
|
-
"@yahoo/uds-create-types": "5.
|
|
38
|
-
"@yahoo/uds-create-utils": "5.
|
|
35
|
+
"@yahoo/uds-create-config": "5.108.0",
|
|
36
|
+
"@yahoo/uds-create-loader": "5.108.0",
|
|
37
|
+
"@yahoo/uds-create-types": "5.108.0",
|
|
38
|
+
"@yahoo/uds-create-utils": "5.108.0",
|
|
39
39
|
"esbuild": "^0.27.4",
|
|
40
40
|
"ts-morph": "^27.0.2",
|
|
41
41
|
"get-tsconfig": "^4.10.0",
|
|
@@ -52,13 +52,13 @@
|
|
|
52
52
|
"lodash": "^4.17.23",
|
|
53
53
|
"prettier": "^3.8.1"
|
|
54
54
|
},
|
|
55
|
-
"udsSchemaVersion":
|
|
55
|
+
"udsSchemaVersion": 20261117234103,
|
|
56
56
|
"optionalDependencies": {
|
|
57
|
-
"@yahoo/uds-create-cli-darwin-arm64": "5.
|
|
58
|
-
"@yahoo/uds-create-cli-darwin-x64": "5.
|
|
59
|
-
"@yahoo/uds-create-cli-linux-arm64": "5.
|
|
60
|
-
"@yahoo/uds-create-cli-linux-x64": "5.
|
|
61
|
-
"@yahoo/uds-create-cli-linux-arm64-musl": "5.
|
|
62
|
-
"@yahoo/uds-create-cli-linux-x64-musl": "5.
|
|
57
|
+
"@yahoo/uds-create-cli-darwin-arm64": "5.108.0",
|
|
58
|
+
"@yahoo/uds-create-cli-darwin-x64": "5.108.0",
|
|
59
|
+
"@yahoo/uds-create-cli-linux-arm64": "5.108.0",
|
|
60
|
+
"@yahoo/uds-create-cli-linux-x64": "5.108.0",
|
|
61
|
+
"@yahoo/uds-create-cli-linux-arm64-musl": "5.108.0",
|
|
62
|
+
"@yahoo/uds-create-cli-linux-x64-musl": "5.108.0"
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -86801,12 +86801,13 @@ var TokenEntity = defineEntity({
|
|
|
86801
86801
|
get: {
|
|
86802
86802
|
input: external_exports.object({
|
|
86803
86803
|
path: pathInput("token"),
|
|
86804
|
-
detail: external_exports.enum(["full"]).optional().describe('`"full"` adds the token\'s stored body: its value, overrides and metadata as authored.')
|
|
86804
|
+
data: external_exports.object({ detail: external_exports.enum(["full"]).optional().describe('`"full"` adds the token\'s stored body: its value, overrides and metadata as authored.') }).optional()
|
|
86805
86805
|
}),
|
|
86806
86806
|
readOnly: true,
|
|
86807
86807
|
label: "Get",
|
|
86808
|
-
description: 'Get one token by its qualified `path`: what it comes to in each mode, and the tokens it refers to on the way. Pass `detail: "full"` for its stored body, which editing it needs.',
|
|
86808
|
+
description: 'Get one token by its qualified `path`: what it comes to in each mode, and the tokens it refers to on the way. Pass `data.detail: "full"` for its stored body, which editing it needs.',
|
|
86809
86809
|
scope: "item",
|
|
86810
|
+
example: ({ path: path2 }) => ({ path: path2 }),
|
|
86810
86811
|
handler: (input2, config2) => config2.resolve("token", String(input2.path))
|
|
86811
86812
|
},
|
|
86812
86813
|
create: { description: `Create a token at \`<group>/<name>\` \u2014 \`data.value\` is the CSS value. The first path segment is its group, and a style property takes a whole group as one ref (\`${JSON.stringify(ref("token", "<group>"))}\`), so put the tokens one prop should offer in one group rather than listing values on the prop.` }
|
|
@@ -89369,12 +89370,13 @@ var ComponentEntity = defineEntity({
|
|
|
89369
89370
|
get: {
|
|
89370
89371
|
input: external_exports.object({
|
|
89371
89372
|
path: pathInput("component"),
|
|
89372
|
-
detail: external_exports.enum(["full"]).optional().describe('`"full"` adds what an author needs: each layer\'s forwards and what it could still forward, and the style rules, anatomy and preview content.')
|
|
89373
|
+
data: external_exports.strictObject({ detail: external_exports.enum(["full"]).optional().describe('`"full"` adds what an author needs: each layer\'s forwards and what it could still forward, and the style rules, anatomy and preview content.') }).optional()
|
|
89373
89374
|
}),
|
|
89374
89375
|
readOnly: true,
|
|
89375
89376
|
label: "Get",
|
|
89376
|
-
description: 'Get one component by its qualified `path`: its props and a usage example. Pass `detail: "full"` for the forwards, style rules, anatomy and preview content, which editing it needs.',
|
|
89377
|
+
description: 'Get one component by its qualified `path`: its props and a usage example. Pass `data.detail: "full"` for the forwards, style rules, anatomy and preview content, which editing it needs.',
|
|
89377
89378
|
scope: "item",
|
|
89379
|
+
example: ({ path: path2 }) => ({ path: path2 }),
|
|
89378
89380
|
handler: (input2, config2) => config2.resolve("component", String(input2.path))
|
|
89379
89381
|
},
|
|
89380
89382
|
validate: {
|
|
@@ -93062,7 +93064,7 @@ var Entity = class {
|
|
|
93062
93064
|
};
|
|
93063
93065
|
|
|
93064
93066
|
// ../config/dist/framework/schema-version.js
|
|
93065
|
-
var CURRENT_SCHEMA_VERSION =
|
|
93067
|
+
var CURRENT_SCHEMA_VERSION = 20261117234103;
|
|
93066
93068
|
var SETTINGS_AS_KIND_VERSION = 20260908171448;
|
|
93067
93069
|
var SchemaVersionTooNew = class extends ConfigFormatError {
|
|
93068
93070
|
found;
|
|
@@ -93082,7 +93084,7 @@ function registerSchemaMigrations(...migrations) {
|
|
|
93082
93084
|
for (const migration of migrations) {
|
|
93083
93085
|
if (migration.version !== 1 && !isMintTimestamp(migration.version)) throw new Error(`Schema migration version ${migration.version} is not a mint timestamp \u2014 mint one with \`date +%Y%m%d%H%M%S\`, like a supabase migration.`);
|
|
93084
93086
|
if (REGISTERED.has(migration.version)) throw new Error(`A schema migration at version ${migration.version} is already registered.`);
|
|
93085
|
-
if (migration.version >
|
|
93087
|
+
if (migration.version > 20261117234103) throw new Error(`Schema migration ${migration.version} is newer than CURRENT_SCHEMA_VERSION (${CURRENT_SCHEMA_VERSION}) \u2014 a stale branch merged, or the mint forgot to bump the constant. Re-mint: set CURRENT_SCHEMA_VERSION to the newest migration version.`);
|
|
93086
93088
|
REGISTERED.set(migration.version, migration);
|
|
93087
93089
|
}
|
|
93088
93090
|
}
|
|
@@ -93113,7 +93115,7 @@ function pendingFor(version2, target2, options) {
|
|
|
93113
93115
|
return [...(options?.migrations ?? REGISTERED).values()].filter((m) => m.version > version2 && m.version <= target2).sort((a, b) => a.version - b.version);
|
|
93114
93116
|
}
|
|
93115
93117
|
function upgradeSerializedConfig(json2, options) {
|
|
93116
|
-
const target2 = options?.target ??
|
|
93118
|
+
const target2 = options?.target ?? 20261117234103;
|
|
93117
93119
|
const version2 = detectedWireVersion(json2);
|
|
93118
93120
|
if (version2 > target2) throw new SchemaVersionTooNew(version2, target2);
|
|
93119
93121
|
const raw = json2;
|
|
@@ -100405,7 +100407,7 @@ var Config = class Config2 {
|
|
|
100405
100407
|
* links from the provided sources. A declared `linkedKind` with no provided source throws. */
|
|
100406
100408
|
hydrateFrom(stored, options) {
|
|
100407
100409
|
const claimed = schemaVersionOf(stored);
|
|
100408
|
-
if (claimed >
|
|
100410
|
+
if (claimed > 20261117234103) throw new SchemaVersionTooNew(claimed);
|
|
100409
100411
|
const wire = upgradeSerializedConfig(stored);
|
|
100410
100412
|
if (!Array.isArray(wire.ownedKinds) || typeof wire.items !== "object" || wire.items === null) throw new ConfigFormatError(`Config "${stored.name ?? "system-config"}" cannot be hydrated: this is not a serialized config-v2 config (no "ownedKinds"/"items"). A pre-cutover build artifact converts through the registered cutover migration \u2014 import the config type's module (e.g. \`configs/system\`) before hydrating.`);
|
|
100411
100413
|
const leftover = wire.options;
|
|
@@ -106981,6 +106983,15 @@ var motionTypesMigration = {
|
|
|
106981
106983
|
up: (json2) => json2
|
|
106982
106984
|
};
|
|
106983
106985
|
|
|
106986
|
+
// ../config/dist/migrations/20261117234103_uds_6038_mcp_inputs.js
|
|
106987
|
+
var UDS_6038_MCP_INPUTS_VERSION = 20261117234103;
|
|
106988
|
+
var uds6038McpInputsMigration = {
|
|
106989
|
+
version: UDS_6038_MCP_INPUTS_VERSION,
|
|
106990
|
+
up(json2) {
|
|
106991
|
+
return json2;
|
|
106992
|
+
}
|
|
106993
|
+
};
|
|
106994
|
+
|
|
106984
106995
|
// ../config/dist/configs/system.js
|
|
106985
106996
|
var System = defineConfig({
|
|
106986
106997
|
name: WEB_CONFIG_NAME,
|
|
@@ -107112,6 +107123,7 @@ if (!registeredSchemaMigrations().has(20261112145536)) registerSchemaMigrations(
|
|
|
107112
107123
|
if (!registeredSchemaMigrations().has(20261112154943)) registerSchemaMigrations(variantBooleansMigration);
|
|
107113
107124
|
if (!registeredSchemaMigrations().has(20261112163439)) registerSchemaMigrations(vendorLinkTypeMigration);
|
|
107114
107125
|
if (!registeredSchemaMigrations().has(20261113131930)) registerSchemaMigrations(styleSetOwnRuleOnlyMigration);
|
|
107126
|
+
if (!registeredSchemaMigrations().has(20261117234103)) registerSchemaMigrations(uds6038McpInputsMigration);
|
|
107115
107127
|
|
|
107116
107128
|
// ../config/dist/capture/node-ops.js
|
|
107117
107129
|
var DEFAULT_WIDTH = 1600;
|
|
@@ -107288,8 +107300,8 @@ var duplicateInput = external_exports.object({
|
|
|
107288
107300
|
var swapInput = external_exports.object({
|
|
107289
107301
|
path: pathInput("node"),
|
|
107290
107302
|
data: external_exports.object({
|
|
107291
|
-
/**
|
|
107292
|
-
type:
|
|
107303
|
+
/** A ref to the component to render instead. */
|
|
107304
|
+
type: Component
|
|
107293
107305
|
})
|
|
107294
107306
|
});
|
|
107295
107307
|
var moveInput = external_exports.object({
|
|
@@ -107459,7 +107471,10 @@ function placeUpdate(place, list) {
|
|
|
107459
107471
|
}
|
|
107460
107472
|
function subtreeOf(config2, path2) {
|
|
107461
107473
|
const out = [];
|
|
107474
|
+
const visited = /* @__PURE__ */ new Set();
|
|
107462
107475
|
const visit2 = (at) => {
|
|
107476
|
+
if (visited.has(at)) return;
|
|
107477
|
+
visited.add(at);
|
|
107463
107478
|
const body = config2.resolve("node", at)?.body;
|
|
107464
107479
|
if (!body) return;
|
|
107465
107480
|
for (const child of childrenOf(body)) visit2(pathOf2(child));
|
|
@@ -107469,13 +107484,59 @@ function subtreeOf(config2, path2) {
|
|
|
107469
107484
|
visit2(path2);
|
|
107470
107485
|
return out;
|
|
107471
107486
|
}
|
|
107487
|
+
function clearAndDeleteSubtrees(config2, roots) {
|
|
107488
|
+
const paths = [...new Set(roots.flatMap((path2) => subtreeOf(config2, path2)))];
|
|
107489
|
+
const deleting = new Set(paths);
|
|
107490
|
+
const unlinkParents = config2.list("node").flatMap((node2) => {
|
|
107491
|
+
const body = node2.body;
|
|
107492
|
+
const children = body.children?.filter((child) => !deleting.has(pathOf2(child)));
|
|
107493
|
+
const slots = body.slots ? Object.fromEntries(Object.entries(body.slots).map(([slot, fills]) => [slot, fills.filter((fill) => !deleting.has(pathOf2(fill)))])) : void 0;
|
|
107494
|
+
const childrenChanged = children?.length !== body.children?.length;
|
|
107495
|
+
const slotsChanged = Object.entries(body.slots ?? {}).some(([slot, fills]) => slots?.[slot]?.length !== fills.length);
|
|
107496
|
+
if (!childrenChanged && !slotsChanged) return [];
|
|
107497
|
+
return [{
|
|
107498
|
+
kind: "node",
|
|
107499
|
+
operation: "update",
|
|
107500
|
+
path: node2.path,
|
|
107501
|
+
data: {
|
|
107502
|
+
...childrenChanged ? { children } : {},
|
|
107503
|
+
...slotsChanged ? { slots } : {}
|
|
107504
|
+
}
|
|
107505
|
+
}];
|
|
107506
|
+
});
|
|
107507
|
+
const clears = paths.flatMap((path2) => {
|
|
107508
|
+
const body = config2.resolve("node", path2)?.body;
|
|
107509
|
+
if (!body) return [];
|
|
107510
|
+
return [{
|
|
107511
|
+
kind: "node",
|
|
107512
|
+
operation: "update",
|
|
107513
|
+
path: path2,
|
|
107514
|
+
data: {
|
|
107515
|
+
...body.children ? { children: [] } : {},
|
|
107516
|
+
...body.slots ? { slots: Object.fromEntries(Object.keys(body.slots).map((slot) => [slot, []])) } : {}
|
|
107517
|
+
}
|
|
107518
|
+
}];
|
|
107519
|
+
});
|
|
107520
|
+
return [
|
|
107521
|
+
...unlinkParents,
|
|
107522
|
+
...clears,
|
|
107523
|
+
...paths.map((path2) => ({
|
|
107524
|
+
kind: "node",
|
|
107525
|
+
operation: "delete",
|
|
107526
|
+
path: path2
|
|
107527
|
+
}))
|
|
107528
|
+
];
|
|
107529
|
+
}
|
|
107530
|
+
function deleteNodePatches(config2, path2) {
|
|
107531
|
+
if (!config2.resolve("node", path2)) {
|
|
107532
|
+
if (!config2.patches.some((patch) => patch.kind === "node" && patch.operation === "delete" && patch.path === path2)) reject("NOT_FOUND", `No node at "${path2}".`);
|
|
107533
|
+
return [];
|
|
107534
|
+
}
|
|
107535
|
+
return clearAndDeleteSubtrees(config2, [path2]);
|
|
107536
|
+
}
|
|
107472
107537
|
function remove(config2, input2) {
|
|
107473
107538
|
const place = placeOf(config2, input2.path, ["path"]);
|
|
107474
|
-
return [placeUpdate(place, place.list.filter((_, i) => i !== place.index)), ...
|
|
107475
|
-
kind: "node",
|
|
107476
|
-
operation: "delete",
|
|
107477
|
-
path: path2
|
|
107478
|
-
}))];
|
|
107539
|
+
return [placeUpdate(place, place.list.filter((_, i) => i !== place.index)), ...clearAndDeleteSubtrees(config2, [input2.path])];
|
|
107479
107540
|
}
|
|
107480
107541
|
function annotationsOn({ config: config2, paths }) {
|
|
107481
107542
|
return config2.list("annotation").map((note) => ({
|
|
@@ -107549,13 +107610,14 @@ function unwrap(config2, input2) {
|
|
|
107549
107610
|
function swap(config2, input2) {
|
|
107550
107611
|
const { slug: slug2, system } = attachedSystem(config2);
|
|
107551
107612
|
const body = bodyOf2(config2, input2.path, ["path"]);
|
|
107552
|
-
const
|
|
107553
|
-
|
|
107554
|
-
|
|
107555
|
-
});
|
|
107556
|
-
const component = system.resolve("component",
|
|
107557
|
-
if (!component) return rejectData(`The system has no component "${
|
|
107558
|
-
|
|
107613
|
+
const source = sourceOf2(input2.data.type);
|
|
107614
|
+
if (source && source !== slug2) return rejectData(`The component ref must target the attached system "${slug2}".`, ["data", "type"]);
|
|
107615
|
+
const componentPath = pathOf2(input2.data.type);
|
|
107616
|
+
const type = source ? input2.data.type : ref("component", `${componentPath}@${slug2}`);
|
|
107617
|
+
const component = system.resolve("component", componentPath);
|
|
107618
|
+
if (!component) return rejectData(`The system has no component "${componentPath}".`, ["data", "type"]);
|
|
107619
|
+
const children = childrenOf(body);
|
|
107620
|
+
const discardChildren = children.length > 0 && childrenPolicy(system, component.path) !== "nodes";
|
|
107559
107621
|
for (const [name, fills] of Object.entries(body.slots ?? {})) {
|
|
107560
107622
|
if (fills.length === 0) continue;
|
|
107561
107623
|
const slot = slotOf({
|
|
@@ -107577,9 +107639,14 @@ function swap(config2, input2) {
|
|
|
107577
107639
|
path: input2.path,
|
|
107578
107640
|
data: {
|
|
107579
107641
|
type,
|
|
107580
|
-
props
|
|
107642
|
+
props,
|
|
107643
|
+
...discardChildren ? { children: [] } : {}
|
|
107581
107644
|
}
|
|
107582
|
-
}
|
|
107645
|
+
}, ...discardChildren ? children.flatMap((child) => subtreeOf(config2, pathOf2(child)).reverse().map((path2) => ({
|
|
107646
|
+
kind: "node",
|
|
107647
|
+
operation: "delete",
|
|
107648
|
+
path: path2
|
|
107649
|
+
}))) : []];
|
|
107583
107650
|
}
|
|
107584
107651
|
function slotTakes({ config: config2, slot, fill }) {
|
|
107585
107652
|
const type = config2.resolve("node", pathOf2(fill))?.body?.type;
|
|
@@ -107817,12 +107884,12 @@ var nodeGestureOps = {
|
|
|
107817
107884
|
input: swapInput,
|
|
107818
107885
|
readOnly: false,
|
|
107819
107886
|
label: "Swap an element for another component",
|
|
107820
|
-
description:
|
|
107887
|
+
description: "Render this element as a different component using a component ref. It keeps its place and the props the new component takes; children are removed when the new component does not accept them.",
|
|
107821
107888
|
scope: "item",
|
|
107822
107889
|
title: (entity) => `Swap ${entity}`,
|
|
107823
107890
|
example: () => ({
|
|
107824
107891
|
path: "card/row",
|
|
107825
|
-
data: { type: "VStack" }
|
|
107892
|
+
data: { type: Component.ref("VStack") }
|
|
107826
107893
|
}),
|
|
107827
107894
|
handler: (input2, config2) => applied2(config2, swap(config2, swapInput.parse(input2)))
|
|
107828
107895
|
},
|
|
@@ -107976,6 +108043,67 @@ var elementType = external_exports.union([
|
|
|
107976
108043
|
external_exports.object({ __ref: external_exports.enum(["spec:Slot", "spec:Fragment"]) })
|
|
107977
108044
|
]);
|
|
107978
108045
|
var nodeRef = external_exports.lazy(() => Node);
|
|
108046
|
+
var NODE_LIST_LIMIT = 50;
|
|
108047
|
+
var nodeListInput = external_exports.object({
|
|
108048
|
+
page: external_exports.string().min(1).optional().describe("Only nodes on this page and their descendants."),
|
|
108049
|
+
under: external_exports.string().min(1).optional().describe("Only this node and its descendants."),
|
|
108050
|
+
offset: external_exports.number().int().min(0).optional().default(0),
|
|
108051
|
+
limit: external_exports.number().int().min(1).max(100).optional().default(NODE_LIST_LIMIT)
|
|
108052
|
+
});
|
|
108053
|
+
var nodeSearchInput = nodeListInput.extend({ query: external_exports.string().min(1).describe("Text to find in node names, types, and props.") });
|
|
108054
|
+
function namedPath(value, kind) {
|
|
108055
|
+
if (!value) return void 0;
|
|
108056
|
+
return value.startsWith(`${kind}:`) ? pathOf2(value) : value;
|
|
108057
|
+
}
|
|
108058
|
+
function nodePagePath(body) {
|
|
108059
|
+
const page = body.page;
|
|
108060
|
+
return page && typeof page === "object" && "__ref" in page ? pathOf2(page) : void 0;
|
|
108061
|
+
}
|
|
108062
|
+
function containsText(value, query) {
|
|
108063
|
+
if (typeof value === "string") return value.toLowerCase().includes(query);
|
|
108064
|
+
if (Array.isArray(value)) return value.some((entry) => containsText(entry, query));
|
|
108065
|
+
if (value && typeof value === "object") return Object.entries(value).some(([key2, entry]) => key2.toLowerCase().includes(query) || containsText(entry, query));
|
|
108066
|
+
return false;
|
|
108067
|
+
}
|
|
108068
|
+
function nodeSummaries(config2, input2) {
|
|
108069
|
+
const page = namedPath(typeof input2.page === "string" ? input2.page : void 0, "page");
|
|
108070
|
+
const under = namedPath(typeof input2.under === "string" ? input2.under : void 0, "node");
|
|
108071
|
+
const query = typeof input2.query === "string" ? input2.query.toLowerCase() : void 0;
|
|
108072
|
+
const offset = Number(input2.offset ?? 0);
|
|
108073
|
+
const limit = Number(input2.limit ?? NODE_LIST_LIMIT);
|
|
108074
|
+
const nodes = config2.list("node").filter((node2) => {
|
|
108075
|
+
if (under && node2.path !== under && !node2.path.startsWith(`${under}/`)) return false;
|
|
108076
|
+
if (page) {
|
|
108077
|
+
const root = node2.path.split("/")[0] ?? node2.path;
|
|
108078
|
+
const rootBody = config2.resolve("node", root)?.body;
|
|
108079
|
+
if (!rootBody || nodePagePath(rootBody) !== page) return false;
|
|
108080
|
+
}
|
|
108081
|
+
if (!query) return true;
|
|
108082
|
+
const body = node2.body;
|
|
108083
|
+
const type = body.type;
|
|
108084
|
+
const typePath = type && typeof type === "object" && "__ref" in type ? pathOf2(type) : "";
|
|
108085
|
+
return node2.path.toLowerCase().includes(query) || String(node2.displayLabel ?? "").toLowerCase().includes(query) || typePath.toLowerCase().includes(query) || containsText(body.props, query);
|
|
108086
|
+
});
|
|
108087
|
+
const selected = nodes.slice(offset, offset + limit);
|
|
108088
|
+
return {
|
|
108089
|
+
total: nodes.length,
|
|
108090
|
+
offset,
|
|
108091
|
+
limit,
|
|
108092
|
+
nextOffset: offset + selected.length < nodes.length ? offset + selected.length : null,
|
|
108093
|
+
nodes: selected.map((node2) => {
|
|
108094
|
+
const body = node2.body;
|
|
108095
|
+
const type = body.type;
|
|
108096
|
+
const pageRef = body.page;
|
|
108097
|
+
return {
|
|
108098
|
+
path: node2.path,
|
|
108099
|
+
...typeof node2.displayLabel === "string" ? { displayLabel: node2.displayLabel } : {},
|
|
108100
|
+
...typeof body.label === "string" ? { label: body.label } : {},
|
|
108101
|
+
...type && typeof type === "object" && "__ref" in type ? { type: pathOf2(type) } : {},
|
|
108102
|
+
...pageRef && typeof pageRef === "object" && "__ref" in pageRef ? { page: pathOf2(pageRef) } : {}
|
|
108103
|
+
};
|
|
108104
|
+
})
|
|
108105
|
+
};
|
|
108106
|
+
}
|
|
107979
108107
|
var Size = external_exports.discriminatedUnion("type", [external_exports.object({
|
|
107980
108108
|
type: external_exports.literal("custom"),
|
|
107981
108109
|
width: external_exports.number(),
|
|
@@ -107988,14 +108116,51 @@ var Node = defineEntity({
|
|
|
107988
108116
|
kind: "node",
|
|
107989
108117
|
schemas: {
|
|
107990
108118
|
...captureNodeOps,
|
|
107991
|
-
...nodeGestureOps
|
|
108119
|
+
...nodeGestureOps,
|
|
108120
|
+
update: { description: "Update addressed node fields. Supplying `data.props` replaces the whole props bag; use `data.props.<name>` to change one prop." },
|
|
108121
|
+
delete: {
|
|
108122
|
+
input: external_exports.object({ path: pathInput("node") }),
|
|
108123
|
+
readOnly: false,
|
|
108124
|
+
label: "Delete",
|
|
108125
|
+
description: "Delete the node at `path` and its render subtree. A node inside another node is removed from its parent before its subtree is deleted.",
|
|
108126
|
+
scope: "item",
|
|
108127
|
+
approval: "destructive",
|
|
108128
|
+
example: ({ config: config2 }) => {
|
|
108129
|
+
const node2 = config2.list("node")[0];
|
|
108130
|
+
return node2 ? { path: node2.path } : void 0;
|
|
108131
|
+
},
|
|
108132
|
+
handler: (input2, config2) => {
|
|
108133
|
+
return deleteNodePatches(config2, String(input2.path)).reduce((next, patch) => next.apply(patch), config2);
|
|
108134
|
+
}
|
|
108135
|
+
},
|
|
108136
|
+
list: {
|
|
108137
|
+
input: nodeListInput,
|
|
108138
|
+
readOnly: true,
|
|
108139
|
+
label: "List",
|
|
108140
|
+
description: "List a page of node summaries (50 by default). Set `page` or `under` to scope the results; `offset` and `limit` page through matches. Use `node/search` to find nodes by text, component type, or props.",
|
|
108141
|
+
scope: "collection",
|
|
108142
|
+
example: () => ({ limit: 20 }),
|
|
108143
|
+
handler: (input2, config2) => nodeSummaries(config2, input2)
|
|
108144
|
+
},
|
|
108145
|
+
search: {
|
|
108146
|
+
input: nodeSearchInput,
|
|
108147
|
+
readOnly: true,
|
|
108148
|
+
label: "Search",
|
|
108149
|
+
description: "Find nodes by case-insensitive text in their path, label, component type, or props. Set `page` or `under` to scope results; use `offset` and `limit` to page through matches.",
|
|
108150
|
+
scope: "collection",
|
|
108151
|
+
example: () => ({
|
|
108152
|
+
query: "header",
|
|
108153
|
+
limit: 20
|
|
108154
|
+
}),
|
|
108155
|
+
handler: (input2, config2) => nodeSummaries(config2, input2)
|
|
108156
|
+
}
|
|
107992
108157
|
},
|
|
107993
108158
|
fields: external_exports.object({
|
|
107994
108159
|
/** A real ref, never a bare name — dependents()/rename-cascade need a real edge, and a bare
|
|
107995
108160
|
* `kind:path` string the framework never walks gives neither. Absent only on a placeholder
|
|
107996
108161
|
* awaiting generation. */
|
|
107997
108162
|
type: elementType.optional(),
|
|
107998
|
-
props: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
|
|
108163
|
+
props: external_exports.record(external_exports.string(), external_exports.unknown()).optional().describe("The props bag. Supplying `props` in `node/update` replaces this whole bag; use `props.<name>` to update one prop."),
|
|
107999
108164
|
/** The default slot's fill — refs to this node's subtree nodes. */
|
|
108000
108165
|
children: external_exports.array(nodeRef).describe(`Refs to this node's subtree nodes. A child's path nests under this node's root path, such as "card/title" under "card".`).optional(),
|
|
108001
108166
|
/** Named slots — never folded into `props`; see symptom 5 in the design doc for why. */
|