@magmonium/cli 0.8.10 → 0.8.11
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 +34 -3
- package/package.json +1 -1
package/codegen/index.js
CHANGED
|
@@ -270,6 +270,7 @@ __export(index_exports, {
|
|
|
270
270
|
SEARCH_ANSWER_KEY: () => SEARCH_ANSWER_KEY,
|
|
271
271
|
SEARCH_ANSWER_KINDS: () => SEARCH_ANSWER_KINDS,
|
|
272
272
|
SEARCH_FEED_IMPORTS: () => SEARCH_FEED_IMPORTS,
|
|
273
|
+
SEARCH_LABEL_KEY: () => SEARCH_LABEL_KEY,
|
|
273
274
|
SEARCH_NAV_ID: () => SEARCH_NAV_ID,
|
|
274
275
|
SEARCH_QUERY_LOCAL: () => SEARCH_QUERY_LOCAL,
|
|
275
276
|
SEARCH_QUERY_TOKEN: () => SEARCH_QUERY_TOKEN,
|
|
@@ -481,6 +482,7 @@ __export(index_exports, {
|
|
|
481
482
|
collectReferencedTranslations: () => collectReferencedTranslations,
|
|
482
483
|
collectScreenWires: () => collectScreenWires,
|
|
483
484
|
collectSearchEmits: () => collectSearchEmits,
|
|
485
|
+
collectSearchLabels: () => collectSearchLabels,
|
|
484
486
|
collectThemeAssets: () => collectThemeAssets,
|
|
485
487
|
collectTranslationAssets: () => collectTranslationAssets,
|
|
486
488
|
collectTypedComponentInputs: () => collectTypedComponentInputs,
|
|
@@ -1358,6 +1360,7 @@ __export(index_exports, {
|
|
|
1358
1360
|
sanitizeNpmAllowlist: () => sanitizeNpmAllowlist,
|
|
1359
1361
|
sanitizePalette: () => sanitizePalette,
|
|
1360
1362
|
sanitizeSearchAnswer: () => sanitizeSearchAnswer,
|
|
1363
|
+
sanitizeSearchLabel: () => sanitizeSearchLabel,
|
|
1361
1364
|
sanitizeTransform: () => sanitizeTransform,
|
|
1362
1365
|
sanitizeWcConfig: () => sanitizeWcConfig,
|
|
1363
1366
|
saveAppTarget: () => saveAppTarget,
|
|
@@ -1433,6 +1436,7 @@ __export(index_exports, {
|
|
|
1433
1436
|
searchAnswerScreenId: () => searchAnswerScreenId,
|
|
1434
1437
|
searchEmit: () => searchEmit,
|
|
1435
1438
|
searchFeedArgsComplete: () => searchFeedArgsComplete,
|
|
1439
|
+
searchLabelKey: () => searchLabelKey,
|
|
1436
1440
|
searchMemberName: () => searchMemberName,
|
|
1437
1441
|
searchSpec: () => searchSpec,
|
|
1438
1442
|
searchTextInput: () => searchTextInput,
|
|
@@ -15578,15 +15582,18 @@ function generateCacheMethods(methods, operationOf, properties, shapes, roots =
|
|
|
15578
15582
|
var SEARCH_ANSWER_KINDS = ["feed", "screen"];
|
|
15579
15583
|
var SEARCH_NAV_ID = "root_search";
|
|
15580
15584
|
var SEARCH_ANSWER_KEY = "search_answer";
|
|
15585
|
+
var SEARCH_LABEL_KEY = "search_label";
|
|
15581
15586
|
var searchAnswerScreenId = (navMap) => {
|
|
15582
15587
|
const answer = navMap[SEARCH_NAV_ID]?.searchAnswer;
|
|
15583
15588
|
return answer?.kind === "screen" ? answer.screenId || void 0 : void 0;
|
|
15584
15589
|
};
|
|
15590
|
+
var searchLabelKey = (navMap) => sanitizeSearchLabel(navMap[SEARCH_NAV_ID]?.searchLabel);
|
|
15585
15591
|
var sanitizeSearchAnswer = (value) => {
|
|
15586
15592
|
if (!value || typeof value !== "object") return void 0;
|
|
15587
15593
|
const answer = value;
|
|
15588
15594
|
return answer.kind === "screen" && typeof answer.screenId === "string" && answer.screenId ? { kind: "screen", screenId: answer.screenId } : void 0;
|
|
15589
15595
|
};
|
|
15596
|
+
var sanitizeSearchLabel = (value) => typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
15590
15597
|
var isCompleteVisibilitySource = (source) => !!source && !!source.featureId && !!source.functionId && (source.hidesRow || source.guardsRoute);
|
|
15591
15598
|
var prunedVisibilitySource = (source) => {
|
|
15592
15599
|
if (!source) return void 0;
|
|
@@ -24397,7 +24404,7 @@ __export(package_exports2, {
|
|
|
24397
24404
|
version: () => version2
|
|
24398
24405
|
});
|
|
24399
24406
|
var name2 = "@magmonium/cli";
|
|
24400
|
-
var version2 = "0.8.
|
|
24407
|
+
var version2 = "0.8.11";
|
|
24401
24408
|
var description2 = "A powerful and extensible asset compilation tool that can be shared across multiple projects";
|
|
24402
24409
|
var bin = {
|
|
24403
24410
|
"mag-cli": "bin/cli.js"
|
|
@@ -25523,7 +25530,11 @@ var sanitizeNavMap = (value) => {
|
|
|
25523
25530
|
...typeof n.componentKey === "string" && n.componentKey ? { componentKey: n.componentKey } : result[navId]?.componentKey ? { componentKey: result[navId].componentKey } : {},
|
|
25524
25531
|
...platform ? { platform: true } : {},
|
|
25525
25532
|
// On `root_search` and nowhere else (GLOSSARY.md SearchAnswer).
|
|
25526
|
-
...navId === SEARCH_NAV_ID && sanitizeSearchAnswer(n.searchAnswer) ? { searchAnswer: sanitizeSearchAnswer(n.searchAnswer) } : {}
|
|
25533
|
+
...navId === SEARCH_NAV_ID && sanitizeSearchAnswer(n.searchAnswer) ? { searchAnswer: sanitizeSearchAnswer(n.searchAnswer) } : {},
|
|
25534
|
+
// The same Nav, and the same rule: a Platform Nav's title is the
|
|
25535
|
+
// library's, so a label for the bar it draws is the app's one say in
|
|
25536
|
+
// chrome (GLOSSARY.md SearchLabel).
|
|
25537
|
+
...navId === SEARCH_NAV_ID && sanitizeSearchLabel(n.searchLabel) ? { searchLabel: sanitizeSearchLabel(n.searchLabel) } : {}
|
|
25527
25538
|
};
|
|
25528
25539
|
}
|
|
25529
25540
|
for (const navId of Object.keys(result).sort(
|
|
@@ -25667,6 +25678,10 @@ var collectNavIcons = (navMap) => new Set(
|
|
|
25667
25678
|
var collectNavLabels = (navMap) => new Set(
|
|
25668
25679
|
Object.values(navMap).filter((nav) => nav.navId !== ROOT_NAV_ID && nav.platform !== true).map((nav) => nav.label).filter((label) => !!label)
|
|
25669
25680
|
);
|
|
25681
|
+
var collectSearchLabels = (navMap) => {
|
|
25682
|
+
const key2 = searchLabelKey(navMap);
|
|
25683
|
+
return key2 ? /* @__PURE__ */ new Set([key2]) : /* @__PURE__ */ new Set();
|
|
25684
|
+
};
|
|
25670
25685
|
|
|
25671
25686
|
// libs/codegen/src/lib/function-case-helper.ts
|
|
25672
25687
|
var caseLiteral = (value) => {
|
|
@@ -28748,6 +28763,7 @@ var navVisibilityBindings = (navMap, features, methodArgNamesOf = () => []) => {
|
|
|
28748
28763
|
var loadCallArgs = (names = [], expressions = []) => names.length ? `{ ${names.map((name3, index) => `${name3}: ${expressions[index] ?? "undefined"}`).join(", ")} }` : "";
|
|
28749
28764
|
var navProvidersGeneratedFile = (navMap, screens, prefix, appName, controlMaps = [], features = [], methodArgNamesOf = () => []) => {
|
|
28750
28765
|
const bindings = navWidgetBindings(navMap, screens, prefix, features);
|
|
28766
|
+
const labelKey = searchLabelKey(navMap);
|
|
28751
28767
|
const rowSources = navRowSourceBindings(navMap, features);
|
|
28752
28768
|
const instanceSources = navInstanceSourceBindings(
|
|
28753
28769
|
navMap,
|
|
@@ -28905,7 +28921,14 @@ var navProvidersGeneratedFile = (navMap, screens, prefix, appName, controlMaps =
|
|
|
28905
28921
|
navInstance: (params: Record<string, string>) =>${block2 ? " " : ""}${body},${load}
|
|
28906
28922
|
},`;
|
|
28907
28923
|
}).join("\n");
|
|
28908
|
-
const
|
|
28924
|
+
const labelEntry = labelKey ? ` ${navKeyLiteral(SEARCH_LABEL_KEY)}: ${JSON.stringify(labelKey)},` : "";
|
|
28925
|
+
const allEntries = [
|
|
28926
|
+
entries,
|
|
28927
|
+
rowEntries,
|
|
28928
|
+
instanceEntries,
|
|
28929
|
+
visibilityEntries,
|
|
28930
|
+
labelEntry
|
|
28931
|
+
].filter(Boolean).join("\n");
|
|
28909
28932
|
const widgetMapLiteral = allEntries ? `{
|
|
28910
28933
|
${allEntries}
|
|
28911
28934
|
}` : "{}";
|
|
@@ -31870,6 +31893,10 @@ var emitAuthoredAssets = (ws, stringify) => {
|
|
|
31870
31893
|
});
|
|
31871
31894
|
collectTranslationAssets(map, ws.translations, [
|
|
31872
31895
|
...collectNavLabels(ws.navMap),
|
|
31896
|
+
// The words the app's own search bar shows: the bar is the host's, and it
|
|
31897
|
+
// renders this key through `translate` like any other label (GLOSSARY.md
|
|
31898
|
+
// SearchLabel).
|
|
31899
|
+
...collectSearchLabels(ws.navMap),
|
|
31873
31900
|
...Object.values(ws.features).flatMap(
|
|
31874
31901
|
(feature) => methodConfirmKeys(feature.methods)
|
|
31875
31902
|
),
|
|
@@ -32354,6 +32381,7 @@ var HISTORY_SELECTION_KEYS = [
|
|
|
32354
32381
|
SEARCH_ANSWER_KEY,
|
|
32355
32382
|
SEARCH_ANSWER_KINDS,
|
|
32356
32383
|
SEARCH_FEED_IMPORTS,
|
|
32384
|
+
SEARCH_LABEL_KEY,
|
|
32357
32385
|
SEARCH_NAV_ID,
|
|
32358
32386
|
SEARCH_QUERY_LOCAL,
|
|
32359
32387
|
SEARCH_QUERY_TOKEN,
|
|
@@ -32565,6 +32593,7 @@ var HISTORY_SELECTION_KEYS = [
|
|
|
32565
32593
|
collectReferencedTranslations,
|
|
32566
32594
|
collectScreenWires,
|
|
32567
32595
|
collectSearchEmits,
|
|
32596
|
+
collectSearchLabels,
|
|
32568
32597
|
collectThemeAssets,
|
|
32569
32598
|
collectTranslationAssets,
|
|
32570
32599
|
collectTypedComponentInputs,
|
|
@@ -33442,6 +33471,7 @@ var HISTORY_SELECTION_KEYS = [
|
|
|
33442
33471
|
sanitizeNpmAllowlist,
|
|
33443
33472
|
sanitizePalette,
|
|
33444
33473
|
sanitizeSearchAnswer,
|
|
33474
|
+
sanitizeSearchLabel,
|
|
33445
33475
|
sanitizeTransform,
|
|
33446
33476
|
sanitizeWcConfig,
|
|
33447
33477
|
saveAppTarget,
|
|
@@ -33517,6 +33547,7 @@ var HISTORY_SELECTION_KEYS = [
|
|
|
33517
33547
|
searchAnswerScreenId,
|
|
33518
33548
|
searchEmit,
|
|
33519
33549
|
searchFeedArgsComplete,
|
|
33550
|
+
searchLabelKey,
|
|
33520
33551
|
searchMemberName,
|
|
33521
33552
|
searchSpec,
|
|
33522
33553
|
searchTextInput,
|