@magmonium/cli 0.8.3 → 0.8.4
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/codegen/index.js +442 -30
- package/package.json +1 -1
package/codegen/index.js
CHANGED
|
@@ -260,6 +260,11 @@ __export(index_exports, {
|
|
|
260
260
|
ROUTER_LINK_MODES: () => ROUTER_LINK_MODES,
|
|
261
261
|
SCREEN_METHOD_FORBIDDEN_SOURCE: () => SCREEN_METHOD_FORBIDDEN_SOURCE,
|
|
262
262
|
SCREEN_SOURCE_SEP: () => SCREEN_SOURCE_SEP,
|
|
263
|
+
SEARCH_FEED_IMPORTS: () => SEARCH_FEED_IMPORTS,
|
|
264
|
+
SEARCH_QUERY_LOCAL: () => SEARCH_QUERY_LOCAL,
|
|
265
|
+
SEARCH_QUERY_TOKEN: () => SEARCH_QUERY_TOKEN,
|
|
266
|
+
SEARCH_STORE: () => SEARCH_STORE,
|
|
267
|
+
SEARCH_STORE_LOCAL: () => SEARCH_STORE_LOCAL,
|
|
263
268
|
SEARCH_TEXT_INPUT: () => SEARCH_TEXT_INPUT,
|
|
264
269
|
SECTION_TABLE_COLUMNS_KEY: () => SECTION_TABLE_COLUMNS_KEY,
|
|
265
270
|
SECTION_TABLE_SEED_COLUMNS: () => SECTION_TABLE_SEED_COLUMNS,
|
|
@@ -390,6 +395,7 @@ __export(index_exports, {
|
|
|
390
395
|
callArgLeaves: () => callArgLeaves,
|
|
391
396
|
callArgLeavesOf: () => callArgLeavesOf,
|
|
392
397
|
callArgReadsVariable: () => callArgReadsVariable,
|
|
398
|
+
callArgSearchRead: () => callArgSearchRead,
|
|
393
399
|
callArgStateRead: () => callArgStateRead,
|
|
394
400
|
callArgStorageRead: () => callArgStorageRead,
|
|
395
401
|
callArgTargetKey: () => callArgTargetKey,
|
|
@@ -423,10 +429,13 @@ __export(index_exports, {
|
|
|
423
429
|
cardRowInput: () => cardRowInput,
|
|
424
430
|
cardRowType: () => cardRowType,
|
|
425
431
|
cardSpec: () => cardSpec,
|
|
432
|
+
caseArgFit: () => caseArgFit,
|
|
426
433
|
caseArityMatches: () => caseArityMatches,
|
|
427
434
|
caseCallText: () => caseCallText,
|
|
428
435
|
caseEquals: () => caseEquals,
|
|
436
|
+
caseFits: () => caseFits,
|
|
429
437
|
caseLiteral: () => caseLiteral,
|
|
438
|
+
caseLiteralValue: () => caseLiteralValue,
|
|
430
439
|
casesFromJson: () => casesFromJson,
|
|
431
440
|
chainCall: () => chainCall,
|
|
432
441
|
chainInputType: () => chainInputType,
|
|
@@ -645,6 +654,7 @@ __export(index_exports, {
|
|
|
645
654
|
findStateWriteProperty: () => findStateWriteProperty,
|
|
646
655
|
findTarget: () => findTarget,
|
|
647
656
|
firstControlAtLayer: () => firstControlAtLayer,
|
|
657
|
+
fittedCaseArgs: () => fittedCaseArgs,
|
|
648
658
|
fixedAllowed: () => fixedAllowed,
|
|
649
659
|
fixedIsText: () => fixedIsText,
|
|
650
660
|
fnv64: () => fnv64,
|
|
@@ -708,6 +718,7 @@ __export(index_exports, {
|
|
|
708
718
|
generateHtml: () => generateHtml,
|
|
709
719
|
generateRuleExpression: () => generateRuleExpression,
|
|
710
720
|
generateScreenComputedMember: () => generateScreenComputedMember,
|
|
721
|
+
generateSearchFeed: () => generateSearchFeed,
|
|
711
722
|
generateShapeInterface: () => generateShapeInterface,
|
|
712
723
|
generateStateBlock: () => generateStateBlock,
|
|
713
724
|
generateStateComputedEntry: () => generateStateComputedEntry,
|
|
@@ -1023,6 +1034,7 @@ __export(index_exports, {
|
|
|
1023
1034
|
navInstanceReturn: () => navInstanceReturn,
|
|
1024
1035
|
navInstanceSourceBindings: () => navInstanceSourceBindings,
|
|
1025
1036
|
navParam: () => navParam,
|
|
1037
|
+
navParamTarget: () => navParamTarget,
|
|
1026
1038
|
navParamsInScope: () => navParamsInScope,
|
|
1027
1039
|
navProvidersGeneratedFile: () => navProvidersGeneratedFile,
|
|
1028
1040
|
navProvidersPath: () => navProvidersPath,
|
|
@@ -1285,6 +1297,7 @@ __export(index_exports, {
|
|
|
1285
1297
|
resolveFormName: () => resolveFormName,
|
|
1286
1298
|
resolvePageNaming: () => resolvePageNaming,
|
|
1287
1299
|
resolvePath: () => resolvePath,
|
|
1300
|
+
resolveSearchFeedMember: () => resolveSearchFeedMember,
|
|
1288
1301
|
resolveVariantSelection: () => resolveVariantSelection,
|
|
1289
1302
|
resolveWidgetNaming: () => resolveWidgetNaming,
|
|
1290
1303
|
resolvedAuthUrl: () => resolvedAuthUrl,
|
|
@@ -1318,6 +1331,7 @@ __export(index_exports, {
|
|
|
1318
1331
|
sanitizeControlGroups: () => sanitizeControlGroups,
|
|
1319
1332
|
sanitizeControlVariants: () => sanitizeControlVariants,
|
|
1320
1333
|
sanitizeDistinct: () => sanitizeDistinct,
|
|
1334
|
+
sanitizeMemberPath: () => sanitizeMemberPath,
|
|
1321
1335
|
sanitizeNavMap: () => sanitizeNavMap,
|
|
1322
1336
|
sanitizeNpmAllowlist: () => sanitizeNpmAllowlist,
|
|
1323
1337
|
sanitizePalette: () => sanitizePalette,
|
|
@@ -8159,6 +8173,8 @@ var filterReaderName = (many2, dataType) => {
|
|
|
8159
8173
|
};
|
|
8160
8174
|
|
|
8161
8175
|
// libs/codegen/src/lib/call-arg-helper.ts
|
|
8176
|
+
var SEARCH_QUERY_TOKEN = "SEARCH_QUERY";
|
|
8177
|
+
var SEARCH_QUERY_LOCAL = "searchQuery";
|
|
8162
8178
|
var isCallArgMapping = (value) => typeof value === "object" && value !== null && "source" in value && "target" in value && Array.isArray(value.target);
|
|
8163
8179
|
function outputArgRows(outputArgs, output) {
|
|
8164
8180
|
const rows = outputArgs?.[output];
|
|
@@ -8394,6 +8410,14 @@ var rowComplete = (row, target, payload, fieldNames, constants, functions, scope
|
|
|
8394
8410
|
} else if (row.source === "storage") {
|
|
8395
8411
|
if (!target.dataType) return "call-arg-type-mismatch";
|
|
8396
8412
|
if (!row.storageKey?.trim()) return "call-arg-incomplete";
|
|
8413
|
+
} else if (row.source === "search") {
|
|
8414
|
+
if (!target.dataType) return "call-arg-type-mismatch";
|
|
8415
|
+
if (!sameType3(target, {
|
|
8416
|
+
dataType: { type: "string" },
|
|
8417
|
+
cardinality: "one"
|
|
8418
|
+
})) {
|
|
8419
|
+
return "call-arg-type-mismatch";
|
|
8420
|
+
}
|
|
8397
8421
|
} else {
|
|
8398
8422
|
if (!callArgEventAllowed(payload)) return "call-arg-event-void";
|
|
8399
8423
|
if (callArgEventPathAllowed(payload)) {
|
|
@@ -8530,6 +8554,7 @@ var callArgStorageRead = (row, target, ctx) => {
|
|
|
8530
8554
|
);
|
|
8531
8555
|
return `${ctx.storage ?? "storage"}.${getter}('${row.storageKey ?? ""}') as ${type} | undefined`;
|
|
8532
8556
|
};
|
|
8557
|
+
var callArgSearchRead = () => `${SEARCH_QUERY_LOCAL}?.() ?? ''`;
|
|
8533
8558
|
var rowExpression = (row, target, payload, ctx) => {
|
|
8534
8559
|
let source;
|
|
8535
8560
|
if (row.source === "fixed") {
|
|
@@ -8545,6 +8570,8 @@ var rowExpression = (row, target, payload, ctx) => {
|
|
|
8545
8570
|
source = ctx.locals?.get(row) ?? callArgBindingRead(row.binding, ctx, row.optional === true);
|
|
8546
8571
|
} else if (row.source === "storage") {
|
|
8547
8572
|
source = ctx.locals?.get(row) ?? callArgStorageRead(row, target, ctx);
|
|
8573
|
+
} else if (row.source === "search") {
|
|
8574
|
+
source = ctx.locals?.get(row) ?? callArgSearchRead();
|
|
8548
8575
|
} else {
|
|
8549
8576
|
source = eventExpression(
|
|
8550
8577
|
row.event,
|
|
@@ -8577,9 +8604,10 @@ var mayBeAbsent = (row, source) => row.source === "event" ? source.startsWith(`$
|
|
|
8577
8604
|
var objectEntry = (name3, value) => name3 === value ? name3 : `${name3}: ${value}`;
|
|
8578
8605
|
function callArgumentsExpression(args, rows, payload, ctx = {}) {
|
|
8579
8606
|
if (!args.length) return "";
|
|
8607
|
+
const usable = ctx.scope === "store" ? rows : rows.filter((row) => row.source !== "search");
|
|
8580
8608
|
if (validateCallArgs(
|
|
8581
8609
|
args,
|
|
8582
|
-
|
|
8610
|
+
usable,
|
|
8583
8611
|
payload,
|
|
8584
8612
|
ctx.eventMembers ?? [],
|
|
8585
8613
|
ctx.constants,
|
|
@@ -8591,14 +8619,14 @@ function callArgumentsExpression(args, rows, payload, ctx = {}) {
|
|
|
8591
8619
|
}
|
|
8592
8620
|
))
|
|
8593
8621
|
return void 0;
|
|
8594
|
-
const whole =
|
|
8622
|
+
const whole = usable.find((r) => r.target.length === 0);
|
|
8595
8623
|
if (whole) {
|
|
8596
8624
|
const target = findCallArgTarget(args, []);
|
|
8597
8625
|
if (!target) return void 0;
|
|
8598
8626
|
return rowExpression(whole, target, payload, ctx);
|
|
8599
8627
|
}
|
|
8600
8628
|
const root = { children: /* @__PURE__ */ new Map() };
|
|
8601
|
-
for (const row of
|
|
8629
|
+
for (const row of usable) {
|
|
8602
8630
|
const target = findCallArgTarget(args, row.target);
|
|
8603
8631
|
if (!target) continue;
|
|
8604
8632
|
const expr = rowExpression(row, target, payload, ctx);
|
|
@@ -11008,10 +11036,17 @@ function validateInputs(method, op) {
|
|
|
11008
11036
|
args.set(arg.name, arg);
|
|
11009
11037
|
}
|
|
11010
11038
|
const requiredMissing = targets.some(
|
|
11011
|
-
(t) => t.required && !mapped.includes(t.label) && !coveredByRoot(t, mapped) && !coveredByMembers(t, mapped)
|
|
11039
|
+
(t) => t.required && !mapped.includes(t.label) && !coveredByRoot(t, mapped) && !coveredByMembers(t, mapped) && !insideUnsent(t, targets, mapped)
|
|
11012
11040
|
);
|
|
11013
11041
|
return requiredMissing ? "input-required-unmapped" : void 0;
|
|
11014
11042
|
}
|
|
11043
|
+
function insideUnsent(target, targets, mapped) {
|
|
11044
|
+
return targets.some(
|
|
11045
|
+
(ancestor) => !ancestor.required && target.label.startsWith(`${ancestor.label}.`) && !mapped.some(
|
|
11046
|
+
(key2) => key2 === ancestor.label || key2.startsWith(`${ancestor.label}.`)
|
|
11047
|
+
)
|
|
11048
|
+
);
|
|
11049
|
+
}
|
|
11015
11050
|
function allArgs(method, op) {
|
|
11016
11051
|
const targets = inputPaths(op);
|
|
11017
11052
|
return method.inputs.filter((m) => m.source === "args" && !!m.arg).map((m) => {
|
|
@@ -11532,8 +11567,9 @@ function importShapes(dataType, from, existing, mintId, overwriteExisting = fals
|
|
|
11532
11567
|
const byOrigin = source.origin ? Object.values(candidates).find(
|
|
11533
11568
|
(candidate) => sameOrigin(candidate.origin, source.origin)
|
|
11534
11569
|
)?.id : void 0;
|
|
11570
|
+
const sameSchema = (candidate) => !source.origin || !candidate.origin || candidate.name === source.name;
|
|
11535
11571
|
const structural = Object.values(candidates).find(
|
|
11536
|
-
(candidate) => dataTypeFits(
|
|
11572
|
+
(candidate) => sameSchema(candidate) && dataTypeFits(
|
|
11537
11573
|
{ dataType: { type: "shape", shapeId }, cardinality: "one" },
|
|
11538
11574
|
from,
|
|
11539
11575
|
{
|
|
@@ -11755,7 +11791,8 @@ function storesOf(feature) {
|
|
|
11755
11791
|
computeds: feature.computeds,
|
|
11756
11792
|
methods: feature.methods,
|
|
11757
11793
|
timers: feature.timers ?? {},
|
|
11758
|
-
hook: feature.hook
|
|
11794
|
+
hook: feature.hook,
|
|
11795
|
+
searchFeed: feature.searchFeed
|
|
11759
11796
|
};
|
|
11760
11797
|
return [
|
|
11761
11798
|
main2,
|
|
@@ -11766,7 +11803,8 @@ function storesOf(feature) {
|
|
|
11766
11803
|
computeds: subStore.computeds,
|
|
11767
11804
|
methods: subStore.methods,
|
|
11768
11805
|
timers: subStore.timers ?? {},
|
|
11769
|
-
hook: subStore.hook
|
|
11806
|
+
hook: subStore.hook,
|
|
11807
|
+
searchFeed: subStore.searchFeed
|
|
11770
11808
|
}))
|
|
11771
11809
|
];
|
|
11772
11810
|
}
|
|
@@ -15537,6 +15575,17 @@ var navSegmentId = (navId) => {
|
|
|
15537
15575
|
const i = navId.lastIndexOf(NAV_ID_SEP);
|
|
15538
15576
|
return i > 0 ? navId.slice(i + 1) : navId;
|
|
15539
15577
|
};
|
|
15578
|
+
var navParamTarget = (navMap, navId, ownerNavId) => {
|
|
15579
|
+
const stored = navMap[navId];
|
|
15580
|
+
if (stored) return stored.presentation === "dynamic" ? stored : void 0;
|
|
15581
|
+
const segment = navSegmentId(navId);
|
|
15582
|
+
for (let id = ownerNavId; id; id = parentNavId(id)) {
|
|
15583
|
+
const nav = navMap[id];
|
|
15584
|
+
if (nav?.presentation === "dynamic" && navSegmentId(id) === segment)
|
|
15585
|
+
return nav;
|
|
15586
|
+
}
|
|
15587
|
+
return void 0;
|
|
15588
|
+
};
|
|
15540
15589
|
var isDefaultNavId = (navId) => navSegmentId(navId) === DEFAULT_NAV_SEGMENT;
|
|
15541
15590
|
var childNavId = (parentId, slug2) => `${parentId}${NAV_ID_SEP}${slug2}`;
|
|
15542
15591
|
var ancestorNavIds = (navId) => {
|
|
@@ -16299,6 +16348,60 @@ ${indent2}});`;
|
|
|
16299
16348
|
return closes && idVar ? `const ${idVar} = ${call}` : call;
|
|
16300
16349
|
}
|
|
16301
16350
|
|
|
16351
|
+
// libs/codegen/src/lib/search-feed-codegen.ts
|
|
16352
|
+
var SEARCH_STORE = "SearchStore";
|
|
16353
|
+
var SEARCH_STORE_LOCAL = "searchStore";
|
|
16354
|
+
var SEARCH_FEED_IMPORTS = [SEARCH_STORE];
|
|
16355
|
+
var resolveSearchFeedMember = (path, dataType, shapes) => {
|
|
16356
|
+
if (!path.length) return void 0;
|
|
16357
|
+
let current = dataType;
|
|
16358
|
+
for (let i = 0; i < path.length; i++) {
|
|
16359
|
+
const shape = current?.type === "shape" ? shapes[current.shapeId] : void 0;
|
|
16360
|
+
const key2 = shape?.keys.find((entry2) => entry2.name === path[i]);
|
|
16361
|
+
if (!key2) return i ? path.slice() : void 0;
|
|
16362
|
+
current = key2.dataType;
|
|
16363
|
+
}
|
|
16364
|
+
return path.slice();
|
|
16365
|
+
};
|
|
16366
|
+
function generateSearchFeed(storeKey, feed, properties, shapes) {
|
|
16367
|
+
const property = feed ? properties[feed.propertyId] : void 0;
|
|
16368
|
+
if (!feed || !property || property.cardinality !== "many") {
|
|
16369
|
+
return { block: "", needsSearch: false };
|
|
16370
|
+
}
|
|
16371
|
+
const title = resolveSearchFeedMember(feed.title, property.dataType, shapes);
|
|
16372
|
+
if (!title) return { block: "", needsSearch: false };
|
|
16373
|
+
const item = "item";
|
|
16374
|
+
const index = "index";
|
|
16375
|
+
const read = (path) => `${item}.${path.join(".")}`;
|
|
16376
|
+
const collection = `store.${property.name}() ?? []`;
|
|
16377
|
+
const optional = (path) => path ? resolveSearchFeedMember(path, property.dataType, shapes) : void 0;
|
|
16378
|
+
const id = optional(feed.id);
|
|
16379
|
+
const description3 = optional(feed.description);
|
|
16380
|
+
const img = optional(feed.img);
|
|
16381
|
+
const url = feed.url ? optional(feed.url.member) : void 0;
|
|
16382
|
+
const rows = [
|
|
16383
|
+
`id: ${id ? read(id) : `String(${index})`}`,
|
|
16384
|
+
`title: ${read(title)}`
|
|
16385
|
+
];
|
|
16386
|
+
if (description3) rows.push(`description: ${read(description3)}`);
|
|
16387
|
+
if (img) rows.push(`img: ${read(img)}`);
|
|
16388
|
+
if (url) rows.push(`url: \`${feed.url?.prefix ?? ""}\${${read(url)}}\``);
|
|
16389
|
+
return {
|
|
16390
|
+
block: ` effect(() => {
|
|
16391
|
+
const query = ${SEARCH_QUERY_LOCAL}?.() ?? '';
|
|
16392
|
+
if (!query.trim()) {
|
|
16393
|
+
${SEARCH_STORE_LOCAL}.clearSourceResults('${storeKey}');
|
|
16394
|
+
return;
|
|
16395
|
+
}
|
|
16396
|
+
const rows = ${collection};
|
|
16397
|
+
${SEARCH_STORE_LOCAL}.updateSourceResults('${storeKey}', '${feed.label}', rows.map((${item}, ${index}) => ({
|
|
16398
|
+
${rows.map((row) => ` ${row},`).join("\n")}
|
|
16399
|
+
})));
|
|
16400
|
+
});`,
|
|
16401
|
+
needsSearch: true
|
|
16402
|
+
};
|
|
16403
|
+
}
|
|
16404
|
+
|
|
16302
16405
|
// libs/codegen/src/model/timer.ts
|
|
16303
16406
|
var isCountdown = (timer) => timer.kind === "countdown";
|
|
16304
16407
|
var timerTickSeconds = (timer) => timer.every ?? 1;
|
|
@@ -16433,7 +16536,9 @@ function generateTimers(timers, properties, shapes, roots, mint, writeCall) {
|
|
|
16433
16536
|
var isOnChange = (call) => call.when === "on-change";
|
|
16434
16537
|
var storeHookCallError = (call) => {
|
|
16435
16538
|
if (!isOnChange(call)) return void 0;
|
|
16436
|
-
return call.args.some(
|
|
16539
|
+
return call.args.some(
|
|
16540
|
+
(row) => row.source === "state" || row.source === "search"
|
|
16541
|
+
) ? void 0 : "hook-call-never-fires";
|
|
16437
16542
|
};
|
|
16438
16543
|
var EMPTY_STORE_HOOK = { reads: [], writes: [], calls: [] };
|
|
16439
16544
|
var isEmptyStoreHook = (hook) => !hook || !hook.reads.length && !hook.writes.length && !hook.calls.length;
|
|
@@ -16558,7 +16663,7 @@ function callStatement(call, methods, operationOf, functions, roots, shapes, tak
|
|
|
16558
16663
|
const op = operationOf(method);
|
|
16559
16664
|
if (!op && !isStorageMethod(method)) return "";
|
|
16560
16665
|
const rows = call.args.filter(
|
|
16561
|
-
(row) => row.source === "fixed" || row.source === "state" || row.source === "storage"
|
|
16666
|
+
(row) => row.source === "fixed" || row.source === "state" || row.source === "storage" || row.source === "search"
|
|
16562
16667
|
);
|
|
16563
16668
|
const args = op ? methodArgs(method, op) : storageMethodArgs(method, roots, shapes);
|
|
16564
16669
|
const ctx = { functions, roots, shapes, scope: "store" };
|
|
@@ -16610,7 +16715,7 @@ var localBase = (key2) => {
|
|
|
16610
16715
|
].join("");
|
|
16611
16716
|
return /^[A-Za-z_$]/.test(name3) ? name3 : `stored${name3}`;
|
|
16612
16717
|
};
|
|
16613
|
-
function generateStoreHook(featureName, hook, properties, shapes, methods, operationOf, functions = {}, roots = properties, timers = {}) {
|
|
16718
|
+
function generateStoreHook(featureName, hook, properties, shapes, methods, operationOf, functions = {}, roots = properties, timers = {}, searchFeed, storeKey = featureName) {
|
|
16614
16719
|
const held = heldProperties(properties);
|
|
16615
16720
|
const effects = held.map((property) => {
|
|
16616
16721
|
const shelf = property.hold === "session" ? `, 'session'` : "";
|
|
@@ -16631,12 +16736,14 @@ function generateStoreHook(featureName, hook, properties, shapes, methods, opera
|
|
|
16631
16736
|
functions,
|
|
16632
16737
|
roots,
|
|
16633
16738
|
shapes,
|
|
16634
|
-
/* @__PURE__ */ new Set(["store", "storage"]),
|
|
16739
|
+
/* @__PURE__ */ new Set(["store", "storage", SEARCH_QUERY_LOCAL]),
|
|
16635
16740
|
casts
|
|
16636
16741
|
) : { once: [], onChange: [] };
|
|
16742
|
+
const feed = generateSearchFeed(storeKey, searchFeed, properties, shapes);
|
|
16637
16743
|
const timerTaken = /* @__PURE__ */ new Set([
|
|
16638
16744
|
"store",
|
|
16639
16745
|
"storage",
|
|
16746
|
+
SEARCH_QUERY_LOCAL,
|
|
16640
16747
|
...Object.values(GLOBAL_RULE_STORES).map((entry2) => entry2.prop)
|
|
16641
16748
|
]);
|
|
16642
16749
|
const timerEmission = generateTimers(
|
|
@@ -16661,6 +16768,7 @@ function generateStoreHook(featureName, hook, properties, shapes, methods, opera
|
|
|
16661
16768
|
...patch,
|
|
16662
16769
|
...calls.once,
|
|
16663
16770
|
...calls.onChange,
|
|
16771
|
+
...feed.block ? [feed.block] : [],
|
|
16664
16772
|
...timerEmission.blocks
|
|
16665
16773
|
];
|
|
16666
16774
|
if (!body.length) {
|
|
@@ -16668,6 +16776,8 @@ function generateStoreHook(featureName, hook, properties, shapes, methods, opera
|
|
|
16668
16776
|
block: "",
|
|
16669
16777
|
needsEffect: false,
|
|
16670
16778
|
needsStorage: false,
|
|
16779
|
+
needsSearch: false,
|
|
16780
|
+
needsFeed: false,
|
|
16671
16781
|
needsUntracked: false,
|
|
16672
16782
|
shapeTypes: [],
|
|
16673
16783
|
globalStores: []
|
|
@@ -16678,8 +16788,18 @@ function generateStoreHook(featureName, hook, properties, shapes, methods, opera
|
|
|
16678
16788
|
(row) => row.source === "storage" && !!row.storageKey?.trim()
|
|
16679
16789
|
)
|
|
16680
16790
|
);
|
|
16791
|
+
const callsSearch = [
|
|
16792
|
+
...calls.once,
|
|
16793
|
+
...calls.onChange,
|
|
16794
|
+
...timerEmission.blocks
|
|
16795
|
+
].some((block2) => block2.includes(`${SEARCH_QUERY_LOCAL}?.()`));
|
|
16796
|
+
const usesSearch = callsSearch || feed.needsSearch;
|
|
16681
16797
|
const usesService = effects.length > 0 || reads.entries.length > 0 || callsRead;
|
|
16682
16798
|
const storageLine = usesService ? ` const storage = inject(${STORAGE_SERVICE});
|
|
16799
|
+
` : "";
|
|
16800
|
+
const searchLine = usesSearch ? ` const ${SEARCH_QUERY_LOCAL} = inject(${SEARCH_QUERY_TOKEN}, { optional: true });
|
|
16801
|
+
` : "";
|
|
16802
|
+
const searchStoreLine = feed.block ? ` const ${SEARCH_STORE_LOCAL} = inject(${SEARCH_STORE});
|
|
16683
16803
|
` : "";
|
|
16684
16804
|
const globalStoreLines = timerEmission.globalStores.map((store) => {
|
|
16685
16805
|
const entry2 = GLOBAL_RULE_STORES[store];
|
|
@@ -16689,7 +16809,7 @@ function generateStoreHook(featureName, hook, properties, shapes, methods, opera
|
|
|
16689
16809
|
return {
|
|
16690
16810
|
block: ` withHooks({
|
|
16691
16811
|
onInit(store) {
|
|
16692
|
-
${storageLine}${globalStoreLines}${body.join("\n")}
|
|
16812
|
+
${storageLine}${searchLine}${searchStoreLine}${globalStoreLines}${body.join("\n")}
|
|
16693
16813
|
},
|
|
16694
16814
|
}),
|
|
16695
16815
|
`,
|
|
@@ -16697,6 +16817,8 @@ ${storageLine}${globalStoreLines}${body.join("\n")}
|
|
|
16697
16817
|
// for a Timer alike — one import however many reasons there are for it.
|
|
16698
16818
|
needsEffect: effects.length > 0 || calls.onChange.length > 0 || timerEmission.blocks.length > 0,
|
|
16699
16819
|
needsStorage: usesService,
|
|
16820
|
+
needsSearch: usesSearch,
|
|
16821
|
+
needsFeed: !!feed.block,
|
|
16700
16822
|
needsUntracked: timerEmission.needsUntracked,
|
|
16701
16823
|
// A StoreHookRead's cast and a `storage` call-arg row's are both the hook
|
|
16702
16824
|
// naming an interface the api half may never mention (ADR 0060).
|
|
@@ -22384,7 +22506,7 @@ ${initialEntries ? `${initialEntries}
|
|
|
22384
22506
|
` : ""}};
|
|
22385
22507
|
`;
|
|
22386
22508
|
}
|
|
22387
|
-
function generateFeatureStore(featureName, properties, variants = {}, shapes = {}, methods = {}, operationOf = () => void 0, computeds = {}, functions = {}, hook, usesBusy = false, timers = {}, identity = {}, armed = {}, openRef = () => void 0, onFacts) {
|
|
22509
|
+
function generateFeatureStore(featureName, properties, variants = {}, shapes = {}, methods = {}, operationOf = () => void 0, computeds = {}, functions = {}, hook, usesBusy = false, timers = {}, identity = {}, armed = {}, openRef = () => void 0, onFacts, searchFeed) {
|
|
22388
22510
|
const storeName = identity.storeName ?? featureName;
|
|
22389
22511
|
const isSub = !!identity.storeName;
|
|
22390
22512
|
const initialStateName = identity.initialStateName ?? "initialState";
|
|
@@ -22446,7 +22568,9 @@ function generateFeatureStore(featureName, properties, variants = {}, shapes = {
|
|
|
22446
22568
|
operationOf,
|
|
22447
22569
|
functions,
|
|
22448
22570
|
rootProperties,
|
|
22449
|
-
timers
|
|
22571
|
+
timers,
|
|
22572
|
+
searchFeed,
|
|
22573
|
+
storeName
|
|
22450
22574
|
);
|
|
22451
22575
|
if (!variantList.length && !emitsBusy && !dataProperties.length && !storageMethods.block && !cacheMethods.block && !drawn.block && !hasComputeds) {
|
|
22452
22576
|
return "";
|
|
@@ -22608,6 +22732,13 @@ ${lines.join("\n")}
|
|
|
22608
22732
|
// A `denied` arm's refusal is claimed off the library (api ADR 0005).
|
|
22609
22733
|
...drawn.needsDenial ? ["claimDenial"] : [],
|
|
22610
22734
|
...hooks.needsStorage || drawn.needsStorage || storageMethods.needsStorage ? [STORAGE_SERVICE] : [],
|
|
22735
|
+
// What the host's search box is read through, drawn per row the way every
|
|
22736
|
+
// other source's import is (ADR 0184).
|
|
22737
|
+
...hooks.needsSearch ? [SEARCH_QUERY_TOKEN] : [],
|
|
22738
|
+
// The store the Feature answers the host's search with — one group onto
|
|
22739
|
+
// libs/one's SearchStore, which the nav's panel draws (CONTEXT.md
|
|
22740
|
+
// SearchFeed).
|
|
22741
|
+
...hooks.needsFeed ? SEARCH_FEED_IMPORTS : [],
|
|
22611
22742
|
...Array.from(/* @__PURE__ */ new Set([...variantGlobalStores, ...hooks.globalStores])).map(
|
|
22612
22743
|
(store) => GLOBAL_RULE_STORES[store].className
|
|
22613
22744
|
)
|
|
@@ -22790,7 +22921,8 @@ function generateStoreFiles(feature, operationOf = () => void 0, options = {}) {
|
|
|
22790
22921
|
},
|
|
22791
22922
|
armed,
|
|
22792
22923
|
options.openScreenRef,
|
|
22793
|
-
(facts) => mainFacts = facts
|
|
22924
|
+
(facts) => mainFacts = facts,
|
|
22925
|
+
feature.searchFeed
|
|
22794
22926
|
);
|
|
22795
22927
|
if (main2) {
|
|
22796
22928
|
files3.push({
|
|
@@ -22829,7 +22961,8 @@ function generateStoreFiles(feature, operationOf = () => void 0, options = {}) {
|
|
|
22829
22961
|
{ storeName, initialStateName },
|
|
22830
22962
|
armed,
|
|
22831
22963
|
options.openScreenRef,
|
|
22832
|
-
(recorded) => facts = recorded
|
|
22964
|
+
(recorded) => facts = recorded,
|
|
22965
|
+
sub.searchFeed
|
|
22833
22966
|
);
|
|
22834
22967
|
if (!contents) return;
|
|
22835
22968
|
files3.push({ fileName: featureStoreFile(storeName), contents, facts });
|
|
@@ -23739,6 +23872,7 @@ function generateFeatureCode(feature, context) {
|
|
|
23739
23872
|
functions: context.functions,
|
|
23740
23873
|
...feature.hook ? { hook: feature.hook } : {},
|
|
23741
23874
|
...feature.timers ? { timers: feature.timers } : {},
|
|
23875
|
+
...feature.searchFeed ? { searchFeed: feature.searchFeed } : {},
|
|
23742
23876
|
...feature.subStores ? { subStores: feature.subStores } : {}
|
|
23743
23877
|
};
|
|
23744
23878
|
const stores = generateStoreFiles(emittedFeature, operationOf, {
|
|
@@ -23834,7 +23968,7 @@ __export(package_exports, {
|
|
|
23834
23968
|
version: () => version
|
|
23835
23969
|
});
|
|
23836
23970
|
var name = "@magmonium/one";
|
|
23837
|
-
var version = "0.4.
|
|
23971
|
+
var version = "0.4.30";
|
|
23838
23972
|
var description = "Magmonium One \u2014 Angular design-system primitives for mm Apps";
|
|
23839
23973
|
var author = "magmonium";
|
|
23840
23974
|
var license = "MIT";
|
|
@@ -23902,7 +24036,7 @@ __export(package_exports2, {
|
|
|
23902
24036
|
version: () => version2
|
|
23903
24037
|
});
|
|
23904
24038
|
var name2 = "@magmonium/cli";
|
|
23905
|
-
var version2 = "0.8.
|
|
24039
|
+
var version2 = "0.8.4";
|
|
23906
24040
|
var description2 = "A powerful and extensible asset compilation tool that can be shared across multiple projects";
|
|
23907
24041
|
var bin = {
|
|
23908
24042
|
"mag-cli": "bin/cli.js"
|
|
@@ -23984,6 +24118,15 @@ var CLI_PACKAGE_VERSION = versionOf(package_exports2);
|
|
|
23984
24118
|
// libs/codegen/src/model/hand-contract.ts
|
|
23985
24119
|
var EMPTY_HAND_SCAN = { contracts: {}, skips: [] };
|
|
23986
24120
|
|
|
24121
|
+
// libs/codegen/src/model/search-feed.ts
|
|
24122
|
+
var sanitizeMemberPath = (value) => {
|
|
24123
|
+
if (!Array.isArray(value)) return void 0;
|
|
24124
|
+
const segments = value.filter(
|
|
24125
|
+
(segment) => typeof segment === "string" && !!segment
|
|
24126
|
+
);
|
|
24127
|
+
return segments.length ? segments : void 0;
|
|
24128
|
+
};
|
|
24129
|
+
|
|
23987
24130
|
// libs/codegen/src/lib/timer-helper.ts
|
|
23988
24131
|
function isValidTimerName(name3) {
|
|
23989
24132
|
return /^[a-z][a-zA-Z0-9]*$/.test(name3);
|
|
@@ -25092,7 +25235,224 @@ var withCases = (fn, cases) => {
|
|
|
25092
25235
|
return next;
|
|
25093
25236
|
};
|
|
25094
25237
|
var caseArityMatches = (fn, entry2) => entry2.args.length === fn.params.length;
|
|
25095
|
-
var
|
|
25238
|
+
var caseLiteralValue = (text2) => {
|
|
25239
|
+
const source = text2.trim();
|
|
25240
|
+
if (!source) return { ok: false };
|
|
25241
|
+
let at = 0;
|
|
25242
|
+
const skip = () => {
|
|
25243
|
+
while (at < source.length && /\s/.test(source[at])) at += 1;
|
|
25244
|
+
};
|
|
25245
|
+
const readString = () => {
|
|
25246
|
+
const quote5 = source[at];
|
|
25247
|
+
let end = at + 1;
|
|
25248
|
+
let raw = "";
|
|
25249
|
+
while (end < source.length) {
|
|
25250
|
+
if (source[end] === "\\") {
|
|
25251
|
+
raw += source.slice(end, end + 2);
|
|
25252
|
+
end += 2;
|
|
25253
|
+
continue;
|
|
25254
|
+
}
|
|
25255
|
+
if (source[end] === quote5) break;
|
|
25256
|
+
raw += source[end];
|
|
25257
|
+
end += 1;
|
|
25258
|
+
}
|
|
25259
|
+
if (end >= source.length) return { ok: false };
|
|
25260
|
+
at = end + 1;
|
|
25261
|
+
if (quote5 !== '"') {
|
|
25262
|
+
return { ok: true, value: raw.replace(/\\'/g, "'").replace(/\\\\/g, "\\") };
|
|
25263
|
+
}
|
|
25264
|
+
try {
|
|
25265
|
+
return { ok: true, value: JSON.parse(`"${raw}"`) };
|
|
25266
|
+
} catch {
|
|
25267
|
+
return { ok: false };
|
|
25268
|
+
}
|
|
25269
|
+
};
|
|
25270
|
+
const readNumber = () => {
|
|
25271
|
+
const match = /^-?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/.exec(source.slice(at));
|
|
25272
|
+
if (!match) return { ok: false };
|
|
25273
|
+
at += match[0].length;
|
|
25274
|
+
return { ok: true, value: Number(match[0]) };
|
|
25275
|
+
};
|
|
25276
|
+
const readValue = () => {
|
|
25277
|
+
skip();
|
|
25278
|
+
if (source.startsWith("undefined", at)) {
|
|
25279
|
+
at += 9;
|
|
25280
|
+
return { ok: true, value: void 0 };
|
|
25281
|
+
}
|
|
25282
|
+
if (source.startsWith("null", at)) {
|
|
25283
|
+
at += 4;
|
|
25284
|
+
return { ok: true, value: null };
|
|
25285
|
+
}
|
|
25286
|
+
if (source.startsWith("true", at)) {
|
|
25287
|
+
at += 4;
|
|
25288
|
+
return { ok: true, value: true };
|
|
25289
|
+
}
|
|
25290
|
+
if (source.startsWith("false", at)) {
|
|
25291
|
+
at += 5;
|
|
25292
|
+
return { ok: true, value: false };
|
|
25293
|
+
}
|
|
25294
|
+
if (source[at] === "[") return readList("]", readListValue);
|
|
25295
|
+
if (source[at] === "{") return readList("}", readMember);
|
|
25296
|
+
if (source[at] === '"' || source[at] === "'") return readString();
|
|
25297
|
+
return readNumber();
|
|
25298
|
+
};
|
|
25299
|
+
const readListValue = () => readValue();
|
|
25300
|
+
const readMember = () => {
|
|
25301
|
+
skip();
|
|
25302
|
+
let name3;
|
|
25303
|
+
if (source[at] === '"' || source[at] === "'") {
|
|
25304
|
+
const read = readString();
|
|
25305
|
+
if (!read.ok || typeof read.value !== "string") return { ok: false };
|
|
25306
|
+
name3 = read.value;
|
|
25307
|
+
} else {
|
|
25308
|
+
const match = /^[A-Za-z_$][A-Za-z0-9_$-]*/.exec(source.slice(at));
|
|
25309
|
+
if (!match) return { ok: false };
|
|
25310
|
+
at += match[0].length;
|
|
25311
|
+
name3 = match[0];
|
|
25312
|
+
}
|
|
25313
|
+
skip();
|
|
25314
|
+
if (source[at] !== ":") return { ok: false };
|
|
25315
|
+
at += 1;
|
|
25316
|
+
const entry2 = readValue();
|
|
25317
|
+
if (!entry2.ok) return { ok: false };
|
|
25318
|
+
return { ok: true, value: [name3, entry2.value] };
|
|
25319
|
+
};
|
|
25320
|
+
const readList = (close, item) => {
|
|
25321
|
+
at += 1;
|
|
25322
|
+
const items = [];
|
|
25323
|
+
const held = {};
|
|
25324
|
+
skip();
|
|
25325
|
+
if (source[at] === close) {
|
|
25326
|
+
at += 1;
|
|
25327
|
+
return { ok: true, value: close === "]" ? items : held };
|
|
25328
|
+
}
|
|
25329
|
+
for (; ; ) {
|
|
25330
|
+
const read = item();
|
|
25331
|
+
if (!read.ok) return { ok: false };
|
|
25332
|
+
if (close === "]") items.push(read.value);
|
|
25333
|
+
else {
|
|
25334
|
+
const [name3, entry2] = read.value;
|
|
25335
|
+
held[name3] = entry2;
|
|
25336
|
+
}
|
|
25337
|
+
skip();
|
|
25338
|
+
if (source[at] === ",") {
|
|
25339
|
+
at += 1;
|
|
25340
|
+
skip();
|
|
25341
|
+
if (source[at] === close) {
|
|
25342
|
+
at += 1;
|
|
25343
|
+
return { ok: true, value: close === "]" ? items : held };
|
|
25344
|
+
}
|
|
25345
|
+
continue;
|
|
25346
|
+
}
|
|
25347
|
+
if (source[at] === close) {
|
|
25348
|
+
at += 1;
|
|
25349
|
+
return { ok: true, value: close === "]" ? items : held };
|
|
25350
|
+
}
|
|
25351
|
+
return { ok: false };
|
|
25352
|
+
}
|
|
25353
|
+
};
|
|
25354
|
+
const value = readValue();
|
|
25355
|
+
skip();
|
|
25356
|
+
return value.ok && at === source.length ? value : { ok: false };
|
|
25357
|
+
};
|
|
25358
|
+
var caseArgFit = (param, arg, shapes) => {
|
|
25359
|
+
const read = caseLiteralValue(arg);
|
|
25360
|
+
if (!read.ok) return "unjudged";
|
|
25361
|
+
if (read.value === void 0 || read.value === null) {
|
|
25362
|
+
return param.acceptsUndefined ? "fits" : "mismatch";
|
|
25363
|
+
}
|
|
25364
|
+
const verdict = valueFits(read.value, param.dataType, param.cardinality, shapes);
|
|
25365
|
+
return verdict === void 0 ? "unjudged" : verdict ? "fits" : "mismatch";
|
|
25366
|
+
};
|
|
25367
|
+
var everyFit = (held) => held.includes(false) ? false : held.includes(void 0) ? void 0 : true;
|
|
25368
|
+
var valueFits = (value, dataType, cardinality, shapes) => {
|
|
25369
|
+
if (!dataType) return void 0;
|
|
25370
|
+
if (cardinality === "many" || cardinality === "map" || cardinality === "map-many") {
|
|
25371
|
+
const element = cardinality === "map-many" ? "many" : "one";
|
|
25372
|
+
if (cardinality === "many") {
|
|
25373
|
+
if (!Array.isArray(value)) return false;
|
|
25374
|
+
return everyFit(value.map((item) => valueFits(item, dataType, "one", shapes)));
|
|
25375
|
+
}
|
|
25376
|
+
if (Array.isArray(value) || typeof value !== "object" || value === null) {
|
|
25377
|
+
return false;
|
|
25378
|
+
}
|
|
25379
|
+
return everyFit(
|
|
25380
|
+
Object.values(value).map(
|
|
25381
|
+
(item) => valueFits(item, dataType, element, shapes)
|
|
25382
|
+
)
|
|
25383
|
+
);
|
|
25384
|
+
}
|
|
25385
|
+
switch (dataType.type) {
|
|
25386
|
+
case "string":
|
|
25387
|
+
return typeof value === "string";
|
|
25388
|
+
case "number":
|
|
25389
|
+
return typeof value === "number";
|
|
25390
|
+
case "boolean":
|
|
25391
|
+
return typeof value === "boolean";
|
|
25392
|
+
case "shape": {
|
|
25393
|
+
const shape = shapes[dataType.shapeId];
|
|
25394
|
+
if (!shape) return void 0;
|
|
25395
|
+
if (Array.isArray(value) || typeof value !== "object" || value === null) {
|
|
25396
|
+
return false;
|
|
25397
|
+
}
|
|
25398
|
+
const held = value;
|
|
25399
|
+
const named = new Set(shape.keys.map((key2) => key2.name));
|
|
25400
|
+
if (Object.keys(held).some((name3) => !named.has(name3))) return false;
|
|
25401
|
+
return everyFit(
|
|
25402
|
+
shape.keys.map((key2) => {
|
|
25403
|
+
const member = held[key2.name];
|
|
25404
|
+
if (member === void 0) return key2.optional ? true : false;
|
|
25405
|
+
return valueFits(member, key2.dataType, key2.cardinality, shapes);
|
|
25406
|
+
})
|
|
25407
|
+
);
|
|
25408
|
+
}
|
|
25409
|
+
default:
|
|
25410
|
+
return void 0;
|
|
25411
|
+
}
|
|
25412
|
+
};
|
|
25413
|
+
var caseFits = (fn, entry2, shapes) => caseArityMatches(fn, entry2) && fn.params.every(
|
|
25414
|
+
(param, at) => caseArgFit(param, entry2.args[at], shapes) !== "mismatch"
|
|
25415
|
+
);
|
|
25416
|
+
var staleCases = (fn, shapes) => (fn.cases ?? []).filter((entry2) => !caseFits(fn, entry2, shapes));
|
|
25417
|
+
var fittedCaseArgs = (fn, entry2, shapes) => fn.params.map((param, at) => {
|
|
25418
|
+
const written = entry2.args[at];
|
|
25419
|
+
if (written === void 0) return "undefined";
|
|
25420
|
+
const read = caseLiteralValue(written);
|
|
25421
|
+
return read.ok ? caseLiteral(
|
|
25422
|
+
spelledValue(read.value, param.dataType, param.cardinality, shapes)
|
|
25423
|
+
) : written;
|
|
25424
|
+
});
|
|
25425
|
+
var spelledValue = (value, dataType, cardinality, shapes) => {
|
|
25426
|
+
if (!dataType) return value;
|
|
25427
|
+
if (cardinality === "many" && Array.isArray(value)) {
|
|
25428
|
+
return value.map((item) => spelledValue(item, dataType, "one", shapes));
|
|
25429
|
+
}
|
|
25430
|
+
if ((cardinality === "map" || cardinality === "map-many") && !Array.isArray(value) && typeof value === "object" && value !== null) {
|
|
25431
|
+
const element = cardinality === "map-many" ? "many" : "one";
|
|
25432
|
+
return Object.fromEntries(
|
|
25433
|
+
Object.entries(value).map(([key2, item]) => [
|
|
25434
|
+
key2,
|
|
25435
|
+
spelledValue(item, dataType, element, shapes)
|
|
25436
|
+
])
|
|
25437
|
+
);
|
|
25438
|
+
}
|
|
25439
|
+
if (cardinality !== "one" || dataType.type !== "shape") return value;
|
|
25440
|
+
const shape = shapes[dataType.shapeId];
|
|
25441
|
+
if (!shape || Array.isArray(value) || typeof value !== "object" || value === null) {
|
|
25442
|
+
return value;
|
|
25443
|
+
}
|
|
25444
|
+
const held = value;
|
|
25445
|
+
const next = {};
|
|
25446
|
+
for (const key2 of shape.keys) {
|
|
25447
|
+
const member = held[key2.name];
|
|
25448
|
+
if (member === void 0) {
|
|
25449
|
+
if (!key2.optional) next[key2.name] = void 0;
|
|
25450
|
+
continue;
|
|
25451
|
+
}
|
|
25452
|
+
next[key2.name] = spelledValue(member, key2.dataType, key2.cardinality, shapes);
|
|
25453
|
+
}
|
|
25454
|
+
return next;
|
|
25455
|
+
};
|
|
25096
25456
|
var caseCallText = (fn, entry2) => `${fn.name || "name"}(${entry2.args.join(", ")})`;
|
|
25097
25457
|
var sanitizeCases = (value) => {
|
|
25098
25458
|
if (!Array.isArray(value)) return [];
|
|
@@ -25975,6 +26335,7 @@ function sanitizeFeatures(features, appFunctions, sharedShapes = {}) {
|
|
|
25975
26335
|
methods,
|
|
25976
26336
|
propertiesWithComputeds(properties, computeds, inScope)
|
|
25977
26337
|
);
|
|
26338
|
+
const searchFeed = sanitizeSearchFeed(feature.searchFeed, properties);
|
|
25978
26339
|
const subStores = sanitizeSubStores(
|
|
25979
26340
|
feature.subStores,
|
|
25980
26341
|
feature.name,
|
|
@@ -25995,6 +26356,9 @@ function sanitizeFeatures(features, appFunctions, sharedShapes = {}) {
|
|
|
25995
26356
|
// Absent for a Feature that draws none, so an empty hook is no hook and a
|
|
25996
26357
|
// Feature saved before ADR 0058 round-trips unchanged.
|
|
25997
26358
|
...hook ? { hook } : {},
|
|
26359
|
+
// Absent for a store that draws none, so a Feature saved before feeds
|
|
26360
|
+
// existed round-trips unchanged (CONTEXT.md SearchFeed, ADR 0184).
|
|
26361
|
+
...searchFeed ? { searchFeed } : {},
|
|
25998
26362
|
// Absent for a Feature that draws none, so a Feature saved before Timers
|
|
25999
26363
|
// existed round-trips unchanged (ADR 0071).
|
|
26000
26364
|
...Object.keys(timers).length ? { timers } : {},
|
|
@@ -26011,6 +26375,29 @@ function sanitizeFeatures(features, appFunctions, sharedShapes = {}) {
|
|
|
26011
26375
|
}
|
|
26012
26376
|
return result;
|
|
26013
26377
|
}
|
|
26378
|
+
function sanitizeSearchFeed(value, properties) {
|
|
26379
|
+
if (!value || typeof value !== "object") return void 0;
|
|
26380
|
+
const stored = value;
|
|
26381
|
+
const property = properties[stored.propertyId ?? ""];
|
|
26382
|
+
if (!property || property.cardinality !== "many") return void 0;
|
|
26383
|
+
if (typeof stored.label !== "string" || !stored.label.trim()) return void 0;
|
|
26384
|
+
const title = sanitizeMemberPath(stored.title);
|
|
26385
|
+
if (!title) return void 0;
|
|
26386
|
+
const description3 = sanitizeMemberPath(stored.description);
|
|
26387
|
+
const img = sanitizeMemberPath(stored.img);
|
|
26388
|
+
const id = sanitizeMemberPath(stored.id);
|
|
26389
|
+
const urlMember = stored.url ? sanitizeMemberPath(stored.url.member) : void 0;
|
|
26390
|
+
const prefix = typeof stored.url?.prefix === "string" ? stored.url.prefix : void 0;
|
|
26391
|
+
return {
|
|
26392
|
+
propertyId: property.id,
|
|
26393
|
+
label: stored.label,
|
|
26394
|
+
title,
|
|
26395
|
+
...description3 ? { description: description3 } : {},
|
|
26396
|
+
...img ? { img } : {},
|
|
26397
|
+
...id ? { id } : {},
|
|
26398
|
+
...urlMember ? { url: { ...prefix ? { prefix } : {}, member: urlMember } } : {}
|
|
26399
|
+
};
|
|
26400
|
+
}
|
|
26014
26401
|
function sanitizeSubStores(value, featureName, shapes, functions) {
|
|
26015
26402
|
if (!value || typeof value !== "object") return {};
|
|
26016
26403
|
const result = {};
|
|
@@ -26037,6 +26424,7 @@ function sanitizeSubStores(value, featureName, shapes, functions) {
|
|
|
26037
26424
|
const roots = propertiesWithComputeds(properties, computeds, functions);
|
|
26038
26425
|
const hook = sanitizeStoreHook(subStore.hook, properties, methods, roots);
|
|
26039
26426
|
const timers = sanitizeTimers(subStore.timers, properties, methods, roots);
|
|
26427
|
+
const searchFeed = sanitizeSearchFeed(subStore.searchFeed, properties);
|
|
26040
26428
|
result[id] = {
|
|
26041
26429
|
id,
|
|
26042
26430
|
name: subStore.name,
|
|
@@ -26044,7 +26432,8 @@ function sanitizeSubStores(value, featureName, shapes, functions) {
|
|
|
26044
26432
|
computeds,
|
|
26045
26433
|
methods,
|
|
26046
26434
|
...hook ? { hook } : {},
|
|
26047
|
-
...Object.keys(timers).length ? { timers } : {}
|
|
26435
|
+
...Object.keys(timers).length ? { timers } : {},
|
|
26436
|
+
...searchFeed ? { searchFeed } : {}
|
|
26048
26437
|
};
|
|
26049
26438
|
}
|
|
26050
26439
|
return result;
|
|
@@ -26214,6 +26603,11 @@ function sanitizeHookCallArgs(value, roots) {
|
|
|
26214
26603
|
// StoreHookRead's own getter pair already carries.
|
|
26215
26604
|
storageShelf: raw.storageShelf === "session" ? "session" : "local"
|
|
26216
26605
|
});
|
|
26606
|
+
continue;
|
|
26607
|
+
}
|
|
26608
|
+
if (raw.source === "search") {
|
|
26609
|
+
result.push(raw);
|
|
26610
|
+
continue;
|
|
26217
26611
|
}
|
|
26218
26612
|
}
|
|
26219
26613
|
return result;
|
|
@@ -27616,8 +28010,8 @@ var loadArgs = (nav, navMap, methodArgs2, argNames) => {
|
|
|
27616
28010
|
return argNames.map((name3) => {
|
|
27617
28011
|
const arg = methodArgs2[name3];
|
|
27618
28012
|
if (arg?.source === "nav-param") {
|
|
27619
|
-
const target = navMap
|
|
27620
|
-
return target
|
|
28013
|
+
const target = navParamTarget(navMap, arg.navId, nav.navId);
|
|
28014
|
+
return target ? `params[${JSON.stringify(navParam(target))}]` : "undefined";
|
|
27621
28015
|
}
|
|
27622
28016
|
if (arg?.source === "fixed") return JSON.stringify(arg.value);
|
|
27623
28017
|
return "undefined";
|
|
@@ -27655,8 +28049,8 @@ var navInstanceSourceBindings = (navMap, features, methodArgNamesOf = () => [])
|
|
|
27655
28049
|
const arg = source.args?.[param.id];
|
|
27656
28050
|
if (!arg) return [];
|
|
27657
28051
|
if (arg.source === "nav-param") {
|
|
27658
|
-
const target = navMap
|
|
27659
|
-
if (!target
|
|
28052
|
+
const target = navParamTarget(navMap, arg.navId, nav.navId);
|
|
28053
|
+
if (!target) return [];
|
|
27660
28054
|
argExpressions.push(`params[${JSON.stringify(navParam(target))}]`);
|
|
27661
28055
|
guardedIndexes.push(index);
|
|
27662
28056
|
continue;
|
|
@@ -27726,11 +28120,11 @@ var navInstanceSourceBindings = (navMap, features, methodArgNamesOf = () => [])
|
|
|
27726
28120
|
var navKeyLiteral = (navId) => /^[A-Za-z_$][\w$]*$/.test(navId) ? navId : `'${navId}'`;
|
|
27727
28121
|
var AUTH_STORE_PARAM = "authStore";
|
|
27728
28122
|
var AUTH_STORE_CLASS = "AuthStore";
|
|
27729
|
-
var visibilityLoadArgs = (navMap, methodArgs2, argNames) => argNames.map((name3) => {
|
|
28123
|
+
var visibilityLoadArgs = (nav, navMap, methodArgs2, argNames) => argNames.map((name3) => {
|
|
27730
28124
|
const arg = methodArgs2?.[name3];
|
|
27731
28125
|
if (arg?.source === "nav-param") {
|
|
27732
|
-
const target = navMap
|
|
27733
|
-
return target
|
|
28126
|
+
const target = navParamTarget(navMap, arg.navId, nav.navId);
|
|
28127
|
+
return target ? `params[${JSON.stringify(navParam(target))}]` : "undefined";
|
|
27734
28128
|
}
|
|
27735
28129
|
if (arg?.source === "fixed") return JSON.stringify(arg.value);
|
|
27736
28130
|
return "undefined";
|
|
@@ -27752,8 +28146,8 @@ var navVisibilityBindings = (navMap, features, methodArgNamesOf = () => []) => {
|
|
|
27752
28146
|
const arg = source.args?.[param.id];
|
|
27753
28147
|
if (!arg) return [];
|
|
27754
28148
|
if (arg.source === "nav-param") {
|
|
27755
|
-
const target = navMap
|
|
27756
|
-
if (!target
|
|
28149
|
+
const target = navParamTarget(navMap, arg.navId, nav.navId);
|
|
28150
|
+
if (!target) return [];
|
|
27757
28151
|
argExpressions.push(`params[${JSON.stringify(navParam(target))}]`);
|
|
27758
28152
|
guardedIndexes.push(index);
|
|
27759
28153
|
continue;
|
|
@@ -27810,6 +28204,7 @@ var navVisibilityBindings = (navMap, features, methodArgNamesOf = () => []) => {
|
|
|
27810
28204
|
...methodStore && method ? {
|
|
27811
28205
|
loadCall: { store: methodStore, member: method.name },
|
|
27812
28206
|
loadArgExpressions: visibilityLoadArgs(
|
|
28207
|
+
nav,
|
|
27813
28208
|
navMap,
|
|
27814
28209
|
source.methodArgs,
|
|
27815
28210
|
methodArgNamesOf(method.id, feature)
|
|
@@ -29550,7 +29945,7 @@ var pureFunctionTest = (path, fn, shapes) => ({
|
|
|
29550
29945
|
],
|
|
29551
29946
|
true
|
|
29552
29947
|
),
|
|
29553
|
-
...(fn.cases ?? []).filter((entry2) =>
|
|
29948
|
+
...(fn.cases ?? []).filter((entry2) => caseFits(fn, entry2, shapes)).map(
|
|
29554
29949
|
(entry2) => block(
|
|
29555
29950
|
entry2.name,
|
|
29556
29951
|
[
|
|
@@ -31122,6 +31517,9 @@ var HISTORY_LABELS = [
|
|
|
31122
31517
|
"edit-store",
|
|
31123
31518
|
"edit-timer",
|
|
31124
31519
|
"edit-hook",
|
|
31520
|
+
// What a store answers the host's search with — its own step, because a feed
|
|
31521
|
+
// is one thing a store carries rather than a row of its hook (ADR 0184).
|
|
31522
|
+
"edit-search-feed",
|
|
31125
31523
|
"edit-computed",
|
|
31126
31524
|
"edit-function",
|
|
31127
31525
|
"edit-asset",
|
|
@@ -31397,6 +31795,11 @@ var HISTORY_SELECTION_KEYS = [
|
|
|
31397
31795
|
ROUTER_LINK_MODES,
|
|
31398
31796
|
SCREEN_METHOD_FORBIDDEN_SOURCE,
|
|
31399
31797
|
SCREEN_SOURCE_SEP,
|
|
31798
|
+
SEARCH_FEED_IMPORTS,
|
|
31799
|
+
SEARCH_QUERY_LOCAL,
|
|
31800
|
+
SEARCH_QUERY_TOKEN,
|
|
31801
|
+
SEARCH_STORE,
|
|
31802
|
+
SEARCH_STORE_LOCAL,
|
|
31400
31803
|
SEARCH_TEXT_INPUT,
|
|
31401
31804
|
SECTION_TABLE_COLUMNS_KEY,
|
|
31402
31805
|
SECTION_TABLE_SEED_COLUMNS,
|
|
@@ -31527,6 +31930,7 @@ var HISTORY_SELECTION_KEYS = [
|
|
|
31527
31930
|
callArgLeaves,
|
|
31528
31931
|
callArgLeavesOf,
|
|
31529
31932
|
callArgReadsVariable,
|
|
31933
|
+
callArgSearchRead,
|
|
31530
31934
|
callArgStateRead,
|
|
31531
31935
|
callArgStorageRead,
|
|
31532
31936
|
callArgTargetKey,
|
|
@@ -31560,10 +31964,13 @@ var HISTORY_SELECTION_KEYS = [
|
|
|
31560
31964
|
cardRowInput,
|
|
31561
31965
|
cardRowType,
|
|
31562
31966
|
cardSpec,
|
|
31967
|
+
caseArgFit,
|
|
31563
31968
|
caseArityMatches,
|
|
31564
31969
|
caseCallText,
|
|
31565
31970
|
caseEquals,
|
|
31971
|
+
caseFits,
|
|
31566
31972
|
caseLiteral,
|
|
31973
|
+
caseLiteralValue,
|
|
31567
31974
|
casesFromJson,
|
|
31568
31975
|
chainCall,
|
|
31569
31976
|
chainInputType,
|
|
@@ -31782,6 +32189,7 @@ var HISTORY_SELECTION_KEYS = [
|
|
|
31782
32189
|
findStateWriteProperty,
|
|
31783
32190
|
findTarget,
|
|
31784
32191
|
firstControlAtLayer,
|
|
32192
|
+
fittedCaseArgs,
|
|
31785
32193
|
fixedAllowed,
|
|
31786
32194
|
fixedIsText,
|
|
31787
32195
|
fnv64,
|
|
@@ -31845,6 +32253,7 @@ var HISTORY_SELECTION_KEYS = [
|
|
|
31845
32253
|
generateHtml,
|
|
31846
32254
|
generateRuleExpression,
|
|
31847
32255
|
generateScreenComputedMember,
|
|
32256
|
+
generateSearchFeed,
|
|
31848
32257
|
generateShapeInterface,
|
|
31849
32258
|
generateStateBlock,
|
|
31850
32259
|
generateStateComputedEntry,
|
|
@@ -32160,6 +32569,7 @@ var HISTORY_SELECTION_KEYS = [
|
|
|
32160
32569
|
navInstanceReturn,
|
|
32161
32570
|
navInstanceSourceBindings,
|
|
32162
32571
|
navParam,
|
|
32572
|
+
navParamTarget,
|
|
32163
32573
|
navParamsInScope,
|
|
32164
32574
|
navProvidersGeneratedFile,
|
|
32165
32575
|
navProvidersPath,
|
|
@@ -32422,6 +32832,7 @@ var HISTORY_SELECTION_KEYS = [
|
|
|
32422
32832
|
resolveFormName,
|
|
32423
32833
|
resolvePageNaming,
|
|
32424
32834
|
resolvePath,
|
|
32835
|
+
resolveSearchFeedMember,
|
|
32425
32836
|
resolveVariantSelection,
|
|
32426
32837
|
resolveWidgetNaming,
|
|
32427
32838
|
resolvedAuthUrl,
|
|
@@ -32455,6 +32866,7 @@ var HISTORY_SELECTION_KEYS = [
|
|
|
32455
32866
|
sanitizeControlGroups,
|
|
32456
32867
|
sanitizeControlVariants,
|
|
32457
32868
|
sanitizeDistinct,
|
|
32869
|
+
sanitizeMemberPath,
|
|
32458
32870
|
sanitizeNavMap,
|
|
32459
32871
|
sanitizeNpmAllowlist,
|
|
32460
32872
|
sanitizePalette,
|