@yahoo/uds-create-cli 5.107.2 → 5.108.1
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 +207 -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.1",
|
|
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.1",
|
|
36
|
+
"@yahoo/uds-create-loader": "5.108.1",
|
|
37
|
+
"@yahoo/uds-create-types": "5.108.1",
|
|
38
|
+
"@yahoo/uds-create-utils": "5.108.1",
|
|
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.1",
|
|
58
|
+
"@yahoo/uds-create-cli-darwin-x64": "5.108.1",
|
|
59
|
+
"@yahoo/uds-create-cli-linux-arm64": "5.108.1",
|
|
60
|
+
"@yahoo/uds-create-cli-linux-x64": "5.108.1",
|
|
61
|
+
"@yahoo/uds-create-cli-linux-arm64-musl": "5.108.1",
|
|
62
|
+
"@yahoo/uds-create-cli-linux-x64-musl": "5.108.1"
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -86456,6 +86456,19 @@ function listedLibraryRefsOf(decl) {
|
|
|
86456
86456
|
return listed && listed.length > 0 ? listed : void 0;
|
|
86457
86457
|
}
|
|
86458
86458
|
|
|
86459
|
+
// ../config/dist/entities/system/native-reserved-prop-invariants.js
|
|
86460
|
+
var nativeReservedPropInvariants = createSliceMemo({
|
|
86461
|
+
kinds: ["component"],
|
|
86462
|
+
compute: (config2) => {
|
|
86463
|
+
if (config2.name !== "react-native-system") return [];
|
|
86464
|
+
return config2.list("component").flatMap(({ path: path2 }) => {
|
|
86465
|
+
const style = resolveComponentProps(config2, path2).style;
|
|
86466
|
+
if (!style || style.type === "forward" && intoName(style.into) === "style") return [];
|
|
86467
|
+
return [`Component "${path2}": \`style\` is reserved: the native runtime forwards it as the root layer's React Native style. Rename this prop to \`variant\` or another name.`];
|
|
86468
|
+
});
|
|
86469
|
+
}
|
|
86470
|
+
});
|
|
86471
|
+
|
|
86459
86472
|
// ../config/dist/entities/system/prop-rules.js
|
|
86460
86473
|
function keyedPropRules(authored) {
|
|
86461
86474
|
const rules = Array.isArray(authored) ? authored : [{ props: authored }];
|
|
@@ -86801,12 +86814,13 @@ var TokenEntity = defineEntity({
|
|
|
86801
86814
|
get: {
|
|
86802
86815
|
input: external_exports.object({
|
|
86803
86816
|
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.')
|
|
86817
|
+
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
86818
|
}),
|
|
86806
86819
|
readOnly: true,
|
|
86807
86820
|
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.',
|
|
86821
|
+
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
86822
|
scope: "item",
|
|
86823
|
+
example: ({ path: path2 }) => ({ path: path2 }),
|
|
86810
86824
|
handler: (input2, config2) => config2.resolve("token", String(input2.path))
|
|
86811
86825
|
},
|
|
86812
86826
|
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 +89383,13 @@ var ComponentEntity = defineEntity({
|
|
|
89369
89383
|
get: {
|
|
89370
89384
|
input: external_exports.object({
|
|
89371
89385
|
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.')
|
|
89386
|
+
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
89387
|
}),
|
|
89374
89388
|
readOnly: true,
|
|
89375
89389
|
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.',
|
|
89390
|
+
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
89391
|
scope: "item",
|
|
89392
|
+
example: ({ path: path2 }) => ({ path: path2 }),
|
|
89378
89393
|
handler: (input2, config2) => config2.resolve("component", String(input2.path))
|
|
89379
89394
|
},
|
|
89380
89395
|
validate: {
|
|
@@ -89445,6 +89460,7 @@ var ComponentEntity = defineEntity({
|
|
|
89445
89460
|
invariants: (config2) => [
|
|
89446
89461
|
...iconDomainInvariants(config2),
|
|
89447
89462
|
...rootLayerInvariants(config2),
|
|
89463
|
+
...nativeReservedPropInvariants(config2),
|
|
89448
89464
|
...forwardRouteInvariants(config2)
|
|
89449
89465
|
]
|
|
89450
89466
|
});
|
|
@@ -93062,7 +93078,7 @@ var Entity = class {
|
|
|
93062
93078
|
};
|
|
93063
93079
|
|
|
93064
93080
|
// ../config/dist/framework/schema-version.js
|
|
93065
|
-
var CURRENT_SCHEMA_VERSION =
|
|
93081
|
+
var CURRENT_SCHEMA_VERSION = 20261117234103;
|
|
93066
93082
|
var SETTINGS_AS_KIND_VERSION = 20260908171448;
|
|
93067
93083
|
var SchemaVersionTooNew = class extends ConfigFormatError {
|
|
93068
93084
|
found;
|
|
@@ -93082,7 +93098,7 @@ function registerSchemaMigrations(...migrations) {
|
|
|
93082
93098
|
for (const migration of migrations) {
|
|
93083
93099
|
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
93100
|
if (REGISTERED.has(migration.version)) throw new Error(`A schema migration at version ${migration.version} is already registered.`);
|
|
93085
|
-
if (migration.version >
|
|
93101
|
+
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
93102
|
REGISTERED.set(migration.version, migration);
|
|
93087
93103
|
}
|
|
93088
93104
|
}
|
|
@@ -93113,7 +93129,7 @@ function pendingFor(version2, target2, options) {
|
|
|
93113
93129
|
return [...(options?.migrations ?? REGISTERED).values()].filter((m) => m.version > version2 && m.version <= target2).sort((a, b) => a.version - b.version);
|
|
93114
93130
|
}
|
|
93115
93131
|
function upgradeSerializedConfig(json2, options) {
|
|
93116
|
-
const target2 = options?.target ??
|
|
93132
|
+
const target2 = options?.target ?? 20261117234103;
|
|
93117
93133
|
const version2 = detectedWireVersion(json2);
|
|
93118
93134
|
if (version2 > target2) throw new SchemaVersionTooNew(version2, target2);
|
|
93119
93135
|
const raw = json2;
|
|
@@ -100405,7 +100421,7 @@ var Config = class Config2 {
|
|
|
100405
100421
|
* links from the provided sources. A declared `linkedKind` with no provided source throws. */
|
|
100406
100422
|
hydrateFrom(stored, options) {
|
|
100407
100423
|
const claimed = schemaVersionOf(stored);
|
|
100408
|
-
if (claimed >
|
|
100424
|
+
if (claimed > 20261117234103) throw new SchemaVersionTooNew(claimed);
|
|
100409
100425
|
const wire = upgradeSerializedConfig(stored);
|
|
100410
100426
|
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
100427
|
const leftover = wire.options;
|
|
@@ -106981,6 +106997,15 @@ var motionTypesMigration = {
|
|
|
106981
106997
|
up: (json2) => json2
|
|
106982
106998
|
};
|
|
106983
106999
|
|
|
107000
|
+
// ../config/dist/migrations/20261117234103_uds_6038_mcp_inputs.js
|
|
107001
|
+
var UDS_6038_MCP_INPUTS_VERSION = 20261117234103;
|
|
107002
|
+
var uds6038McpInputsMigration = {
|
|
107003
|
+
version: UDS_6038_MCP_INPUTS_VERSION,
|
|
107004
|
+
up(json2) {
|
|
107005
|
+
return json2;
|
|
107006
|
+
}
|
|
107007
|
+
};
|
|
107008
|
+
|
|
106984
107009
|
// ../config/dist/configs/system.js
|
|
106985
107010
|
var System = defineConfig({
|
|
106986
107011
|
name: WEB_CONFIG_NAME,
|
|
@@ -107112,6 +107137,7 @@ if (!registeredSchemaMigrations().has(20261112145536)) registerSchemaMigrations(
|
|
|
107112
107137
|
if (!registeredSchemaMigrations().has(20261112154943)) registerSchemaMigrations(variantBooleansMigration);
|
|
107113
107138
|
if (!registeredSchemaMigrations().has(20261112163439)) registerSchemaMigrations(vendorLinkTypeMigration);
|
|
107114
107139
|
if (!registeredSchemaMigrations().has(20261113131930)) registerSchemaMigrations(styleSetOwnRuleOnlyMigration);
|
|
107140
|
+
if (!registeredSchemaMigrations().has(20261117234103)) registerSchemaMigrations(uds6038McpInputsMigration);
|
|
107115
107141
|
|
|
107116
107142
|
// ../config/dist/capture/node-ops.js
|
|
107117
107143
|
var DEFAULT_WIDTH = 1600;
|
|
@@ -107288,8 +107314,8 @@ var duplicateInput = external_exports.object({
|
|
|
107288
107314
|
var swapInput = external_exports.object({
|
|
107289
107315
|
path: pathInput("node"),
|
|
107290
107316
|
data: external_exports.object({
|
|
107291
|
-
/**
|
|
107292
|
-
type:
|
|
107317
|
+
/** A ref to the component to render instead. */
|
|
107318
|
+
type: Component
|
|
107293
107319
|
})
|
|
107294
107320
|
});
|
|
107295
107321
|
var moveInput = external_exports.object({
|
|
@@ -107459,7 +107485,10 @@ function placeUpdate(place, list) {
|
|
|
107459
107485
|
}
|
|
107460
107486
|
function subtreeOf(config2, path2) {
|
|
107461
107487
|
const out = [];
|
|
107488
|
+
const visited = /* @__PURE__ */ new Set();
|
|
107462
107489
|
const visit2 = (at) => {
|
|
107490
|
+
if (visited.has(at)) return;
|
|
107491
|
+
visited.add(at);
|
|
107463
107492
|
const body = config2.resolve("node", at)?.body;
|
|
107464
107493
|
if (!body) return;
|
|
107465
107494
|
for (const child of childrenOf(body)) visit2(pathOf2(child));
|
|
@@ -107469,13 +107498,59 @@ function subtreeOf(config2, path2) {
|
|
|
107469
107498
|
visit2(path2);
|
|
107470
107499
|
return out;
|
|
107471
107500
|
}
|
|
107501
|
+
function clearAndDeleteSubtrees(config2, roots) {
|
|
107502
|
+
const paths = [...new Set(roots.flatMap((path2) => subtreeOf(config2, path2)))];
|
|
107503
|
+
const deleting = new Set(paths);
|
|
107504
|
+
const unlinkParents = config2.list("node").flatMap((node2) => {
|
|
107505
|
+
const body = node2.body;
|
|
107506
|
+
const children = body.children?.filter((child) => !deleting.has(pathOf2(child)));
|
|
107507
|
+
const slots = body.slots ? Object.fromEntries(Object.entries(body.slots).map(([slot, fills]) => [slot, fills.filter((fill) => !deleting.has(pathOf2(fill)))])) : void 0;
|
|
107508
|
+
const childrenChanged = children?.length !== body.children?.length;
|
|
107509
|
+
const slotsChanged = Object.entries(body.slots ?? {}).some(([slot, fills]) => slots?.[slot]?.length !== fills.length);
|
|
107510
|
+
if (!childrenChanged && !slotsChanged) return [];
|
|
107511
|
+
return [{
|
|
107512
|
+
kind: "node",
|
|
107513
|
+
operation: "update",
|
|
107514
|
+
path: node2.path,
|
|
107515
|
+
data: {
|
|
107516
|
+
...childrenChanged ? { children } : {},
|
|
107517
|
+
...slotsChanged ? { slots } : {}
|
|
107518
|
+
}
|
|
107519
|
+
}];
|
|
107520
|
+
});
|
|
107521
|
+
const clears = paths.flatMap((path2) => {
|
|
107522
|
+
const body = config2.resolve("node", path2)?.body;
|
|
107523
|
+
if (!body) return [];
|
|
107524
|
+
return [{
|
|
107525
|
+
kind: "node",
|
|
107526
|
+
operation: "update",
|
|
107527
|
+
path: path2,
|
|
107528
|
+
data: {
|
|
107529
|
+
...body.children ? { children: [] } : {},
|
|
107530
|
+
...body.slots ? { slots: Object.fromEntries(Object.keys(body.slots).map((slot) => [slot, []])) } : {}
|
|
107531
|
+
}
|
|
107532
|
+
}];
|
|
107533
|
+
});
|
|
107534
|
+
return [
|
|
107535
|
+
...unlinkParents,
|
|
107536
|
+
...clears,
|
|
107537
|
+
...paths.map((path2) => ({
|
|
107538
|
+
kind: "node",
|
|
107539
|
+
operation: "delete",
|
|
107540
|
+
path: path2
|
|
107541
|
+
}))
|
|
107542
|
+
];
|
|
107543
|
+
}
|
|
107544
|
+
function deleteNodePatches(config2, path2) {
|
|
107545
|
+
if (!config2.resolve("node", path2)) {
|
|
107546
|
+
if (!config2.patches.some((patch) => patch.kind === "node" && patch.operation === "delete" && patch.path === path2)) reject("NOT_FOUND", `No node at "${path2}".`);
|
|
107547
|
+
return [];
|
|
107548
|
+
}
|
|
107549
|
+
return clearAndDeleteSubtrees(config2, [path2]);
|
|
107550
|
+
}
|
|
107472
107551
|
function remove(config2, input2) {
|
|
107473
107552
|
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
|
-
}))];
|
|
107553
|
+
return [placeUpdate(place, place.list.filter((_, i) => i !== place.index)), ...clearAndDeleteSubtrees(config2, [input2.path])];
|
|
107479
107554
|
}
|
|
107480
107555
|
function annotationsOn({ config: config2, paths }) {
|
|
107481
107556
|
return config2.list("annotation").map((note) => ({
|
|
@@ -107549,13 +107624,14 @@ function unwrap(config2, input2) {
|
|
|
107549
107624
|
function swap(config2, input2) {
|
|
107550
107625
|
const { slug: slug2, system } = attachedSystem(config2);
|
|
107551
107626
|
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
|
-
|
|
107627
|
+
const source = sourceOf2(input2.data.type);
|
|
107628
|
+
if (source && source !== slug2) return rejectData(`The component ref must target the attached system "${slug2}".`, ["data", "type"]);
|
|
107629
|
+
const componentPath = pathOf2(input2.data.type);
|
|
107630
|
+
const type = source ? input2.data.type : ref("component", `${componentPath}@${slug2}`);
|
|
107631
|
+
const component = system.resolve("component", componentPath);
|
|
107632
|
+
if (!component) return rejectData(`The system has no component "${componentPath}".`, ["data", "type"]);
|
|
107633
|
+
const children = childrenOf(body);
|
|
107634
|
+
const discardChildren = children.length > 0 && childrenPolicy(system, component.path) !== "nodes";
|
|
107559
107635
|
for (const [name, fills] of Object.entries(body.slots ?? {})) {
|
|
107560
107636
|
if (fills.length === 0) continue;
|
|
107561
107637
|
const slot = slotOf({
|
|
@@ -107577,9 +107653,14 @@ function swap(config2, input2) {
|
|
|
107577
107653
|
path: input2.path,
|
|
107578
107654
|
data: {
|
|
107579
107655
|
type,
|
|
107580
|
-
props
|
|
107656
|
+
props,
|
|
107657
|
+
...discardChildren ? { children: [] } : {}
|
|
107581
107658
|
}
|
|
107582
|
-
}
|
|
107659
|
+
}, ...discardChildren ? children.flatMap((child) => subtreeOf(config2, pathOf2(child)).reverse().map((path2) => ({
|
|
107660
|
+
kind: "node",
|
|
107661
|
+
operation: "delete",
|
|
107662
|
+
path: path2
|
|
107663
|
+
}))) : []];
|
|
107583
107664
|
}
|
|
107584
107665
|
function slotTakes({ config: config2, slot, fill }) {
|
|
107585
107666
|
const type = config2.resolve("node", pathOf2(fill))?.body?.type;
|
|
@@ -107817,12 +107898,12 @@ var nodeGestureOps = {
|
|
|
107817
107898
|
input: swapInput,
|
|
107818
107899
|
readOnly: false,
|
|
107819
107900
|
label: "Swap an element for another component",
|
|
107820
|
-
description:
|
|
107901
|
+
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
107902
|
scope: "item",
|
|
107822
107903
|
title: (entity) => `Swap ${entity}`,
|
|
107823
107904
|
example: () => ({
|
|
107824
107905
|
path: "card/row",
|
|
107825
|
-
data: { type: "VStack" }
|
|
107906
|
+
data: { type: Component.ref("VStack") }
|
|
107826
107907
|
}),
|
|
107827
107908
|
handler: (input2, config2) => applied2(config2, swap(config2, swapInput.parse(input2)))
|
|
107828
107909
|
},
|
|
@@ -107976,6 +108057,67 @@ var elementType = external_exports.union([
|
|
|
107976
108057
|
external_exports.object({ __ref: external_exports.enum(["spec:Slot", "spec:Fragment"]) })
|
|
107977
108058
|
]);
|
|
107978
108059
|
var nodeRef = external_exports.lazy(() => Node);
|
|
108060
|
+
var NODE_LIST_LIMIT = 50;
|
|
108061
|
+
var nodeListInput = external_exports.object({
|
|
108062
|
+
page: external_exports.string().min(1).optional().describe("Only nodes on this page and their descendants."),
|
|
108063
|
+
under: external_exports.string().min(1).optional().describe("Only this node and its descendants."),
|
|
108064
|
+
offset: external_exports.number().int().min(0).optional().default(0),
|
|
108065
|
+
limit: external_exports.number().int().min(1).max(100).optional().default(NODE_LIST_LIMIT)
|
|
108066
|
+
});
|
|
108067
|
+
var nodeSearchInput = nodeListInput.extend({ query: external_exports.string().min(1).describe("Text to find in node names, types, and props.") });
|
|
108068
|
+
function namedPath(value, kind) {
|
|
108069
|
+
if (!value) return void 0;
|
|
108070
|
+
return value.startsWith(`${kind}:`) ? pathOf2(value) : value;
|
|
108071
|
+
}
|
|
108072
|
+
function nodePagePath(body) {
|
|
108073
|
+
const page = body.page;
|
|
108074
|
+
return page && typeof page === "object" && "__ref" in page ? pathOf2(page) : void 0;
|
|
108075
|
+
}
|
|
108076
|
+
function containsText(value, query) {
|
|
108077
|
+
if (typeof value === "string") return value.toLowerCase().includes(query);
|
|
108078
|
+
if (Array.isArray(value)) return value.some((entry) => containsText(entry, query));
|
|
108079
|
+
if (value && typeof value === "object") return Object.entries(value).some(([key2, entry]) => key2.toLowerCase().includes(query) || containsText(entry, query));
|
|
108080
|
+
return false;
|
|
108081
|
+
}
|
|
108082
|
+
function nodeSummaries(config2, input2) {
|
|
108083
|
+
const page = namedPath(typeof input2.page === "string" ? input2.page : void 0, "page");
|
|
108084
|
+
const under = namedPath(typeof input2.under === "string" ? input2.under : void 0, "node");
|
|
108085
|
+
const query = typeof input2.query === "string" ? input2.query.toLowerCase() : void 0;
|
|
108086
|
+
const offset = Number(input2.offset ?? 0);
|
|
108087
|
+
const limit = Number(input2.limit ?? NODE_LIST_LIMIT);
|
|
108088
|
+
const nodes = config2.list("node").filter((node2) => {
|
|
108089
|
+
if (under && node2.path !== under && !node2.path.startsWith(`${under}/`)) return false;
|
|
108090
|
+
if (page) {
|
|
108091
|
+
const root = node2.path.split("/")[0] ?? node2.path;
|
|
108092
|
+
const rootBody = config2.resolve("node", root)?.body;
|
|
108093
|
+
if (!rootBody || nodePagePath(rootBody) !== page) return false;
|
|
108094
|
+
}
|
|
108095
|
+
if (!query) return true;
|
|
108096
|
+
const body = node2.body;
|
|
108097
|
+
const type = body.type;
|
|
108098
|
+
const typePath = type && typeof type === "object" && "__ref" in type ? pathOf2(type) : "";
|
|
108099
|
+
return node2.path.toLowerCase().includes(query) || String(node2.displayLabel ?? "").toLowerCase().includes(query) || typePath.toLowerCase().includes(query) || containsText(body.props, query);
|
|
108100
|
+
});
|
|
108101
|
+
const selected = nodes.slice(offset, offset + limit);
|
|
108102
|
+
return {
|
|
108103
|
+
total: nodes.length,
|
|
108104
|
+
offset,
|
|
108105
|
+
limit,
|
|
108106
|
+
nextOffset: offset + selected.length < nodes.length ? offset + selected.length : null,
|
|
108107
|
+
nodes: selected.map((node2) => {
|
|
108108
|
+
const body = node2.body;
|
|
108109
|
+
const type = body.type;
|
|
108110
|
+
const pageRef = body.page;
|
|
108111
|
+
return {
|
|
108112
|
+
path: node2.path,
|
|
108113
|
+
...typeof node2.displayLabel === "string" ? { displayLabel: node2.displayLabel } : {},
|
|
108114
|
+
...typeof body.label === "string" ? { label: body.label } : {},
|
|
108115
|
+
...type && typeof type === "object" && "__ref" in type ? { type: pathOf2(type) } : {},
|
|
108116
|
+
...pageRef && typeof pageRef === "object" && "__ref" in pageRef ? { page: pathOf2(pageRef) } : {}
|
|
108117
|
+
};
|
|
108118
|
+
})
|
|
108119
|
+
};
|
|
108120
|
+
}
|
|
107979
108121
|
var Size = external_exports.discriminatedUnion("type", [external_exports.object({
|
|
107980
108122
|
type: external_exports.literal("custom"),
|
|
107981
108123
|
width: external_exports.number(),
|
|
@@ -107988,14 +108130,51 @@ var Node = defineEntity({
|
|
|
107988
108130
|
kind: "node",
|
|
107989
108131
|
schemas: {
|
|
107990
108132
|
...captureNodeOps,
|
|
107991
|
-
...nodeGestureOps
|
|
108133
|
+
...nodeGestureOps,
|
|
108134
|
+
update: { description: "Update addressed node fields. Supplying `data.props` replaces the whole props bag; use `data.props.<name>` to change one prop." },
|
|
108135
|
+
delete: {
|
|
108136
|
+
input: external_exports.object({ path: pathInput("node") }),
|
|
108137
|
+
readOnly: false,
|
|
108138
|
+
label: "Delete",
|
|
108139
|
+
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.",
|
|
108140
|
+
scope: "item",
|
|
108141
|
+
approval: "destructive",
|
|
108142
|
+
example: ({ config: config2 }) => {
|
|
108143
|
+
const node2 = config2.list("node")[0];
|
|
108144
|
+
return node2 ? { path: node2.path } : void 0;
|
|
108145
|
+
},
|
|
108146
|
+
handler: (input2, config2) => {
|
|
108147
|
+
return deleteNodePatches(config2, String(input2.path)).reduce((next, patch) => next.apply(patch), config2);
|
|
108148
|
+
}
|
|
108149
|
+
},
|
|
108150
|
+
list: {
|
|
108151
|
+
input: nodeListInput,
|
|
108152
|
+
readOnly: true,
|
|
108153
|
+
label: "List",
|
|
108154
|
+
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.",
|
|
108155
|
+
scope: "collection",
|
|
108156
|
+
example: () => ({ limit: 20 }),
|
|
108157
|
+
handler: (input2, config2) => nodeSummaries(config2, input2)
|
|
108158
|
+
},
|
|
108159
|
+
search: {
|
|
108160
|
+
input: nodeSearchInput,
|
|
108161
|
+
readOnly: true,
|
|
108162
|
+
label: "Search",
|
|
108163
|
+
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.",
|
|
108164
|
+
scope: "collection",
|
|
108165
|
+
example: () => ({
|
|
108166
|
+
query: "header",
|
|
108167
|
+
limit: 20
|
|
108168
|
+
}),
|
|
108169
|
+
handler: (input2, config2) => nodeSummaries(config2, input2)
|
|
108170
|
+
}
|
|
107992
108171
|
},
|
|
107993
108172
|
fields: external_exports.object({
|
|
107994
108173
|
/** A real ref, never a bare name — dependents()/rename-cascade need a real edge, and a bare
|
|
107995
108174
|
* `kind:path` string the framework never walks gives neither. Absent only on a placeholder
|
|
107996
108175
|
* awaiting generation. */
|
|
107997
108176
|
type: elementType.optional(),
|
|
107998
|
-
props: external_exports.record(external_exports.string(), external_exports.unknown()).optional(),
|
|
108177
|
+
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
108178
|
/** The default slot's fill — refs to this node's subtree nodes. */
|
|
108000
108179
|
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
108180
|
/** Named slots — never folded into `props`; see symptom 5 in the design doc for why. */
|