@magmonium/cli 0.8.9 → 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 CHANGED
@@ -35,6 +35,11 @@ __export(index_exports, {
35
35
  ASSET_DIRECTIVE_KEY: () => ASSET_DIRECTIVE_KEY,
36
36
  ASSET_ROOT: () => ASSET_ROOT,
37
37
  ASSET_TIERS: () => ASSET_TIERS,
38
+ AUDIENCE_PICKER_LEVELS_KEY: () => AUDIENCE_PICKER_LEVELS_KEY,
39
+ AUDIENCE_PICKER_VALUE_LABEL: () => AUDIENCE_PICKER_VALUE_LABEL,
40
+ AUDIENCE_PICKER_VALUE_SLOTS: () => AUDIENCE_PICKER_VALUE_SLOTS,
41
+ AUDIENCE_TYPE_NAME: () => AUDIENCE_TYPE_NAME,
42
+ AUDIENCE_TYPE_PACKAGE: () => AUDIENCE_TYPE_PACKAGE,
38
43
  AUTH_EXPRESSION: () => AUTH_EXPRESSION,
39
44
  AUTH_PROPERTIES: () => AUTH_PROPERTIES,
40
45
  BASE_THEME_FOR_MODE: () => BASE_THEME_FOR_MODE,
@@ -47,6 +52,7 @@ __export(index_exports, {
47
52
  BUSY_SIGNAL: () => BUSY_SIGNAL,
48
53
  BUSY_VARIANT_ID: () => BUSY_VARIANT_ID,
49
54
  BUSY_VARIANT_NAME: () => BUSY_VARIANT_NAME,
55
+ BUTTON_CLICK_OUTPUT: () => BUTTON_CLICK_OUTPUT,
50
56
  CALL_ARG_SOURCES: () => CALL_ARG_SOURCES,
51
57
  CALL_ARG_TRANSFORM_LEAVES: () => CALL_ARG_TRANSFORM_LEAVES,
52
58
  CALL_CONDITION_KINDS: () => CALL_CONDITION_KINDS,
@@ -171,6 +177,7 @@ __export(index_exports, {
171
177
  LIB_SEGMENT: () => LIB_SEGMENT,
172
178
  LIGHT_SURFACE_MIN_LUMINANCE: () => LIGHT_SURFACE_MIN_LUMINANCE,
173
179
  LIMIT_CHECK_KINDS: () => LIMIT_CHECK_KINDS,
180
+ LINK_TARGET_KINDS: () => LINK_TARGET_KINDS,
174
181
  LIST_ITEMS_KEY: () => LIST_ITEMS_KEY,
175
182
  LIST_ROW_ID_KEY: () => LIST_ROW_ID_KEY,
176
183
  LIST_ROW_LABEL_KEY: () => LIST_ROW_LABEL_KEY,
@@ -191,7 +198,7 @@ __export(index_exports, {
191
198
  METHOD_VARIANT_SOURCES: () => METHOD_VARIANT_SOURCES,
192
199
  MIGRATION_FLOOR: () => MIGRATION_FLOOR,
193
200
  MODAL_STORE: () => MODAL_STORE,
194
- NAV_ID_SEP: () => NAV_ID_SEP,
201
+ NAV_ID_SEP: () => NAV_ID_SEP2,
195
202
  NAV_LINK_KINDS: () => NAV_LINK_KINDS,
196
203
  NAV_PRESENTATIONS: () => NAV_PRESENTATIONS,
197
204
  NAV_REF_MEMBER: () => NAV_REF_MEMBER,
@@ -260,9 +267,15 @@ __export(index_exports, {
260
267
  ROUTER_LINK_MODES: () => ROUTER_LINK_MODES,
261
268
  SCREEN_METHOD_FORBIDDEN_SOURCE: () => SCREEN_METHOD_FORBIDDEN_SOURCE,
262
269
  SCREEN_SOURCE_SEP: () => SCREEN_SOURCE_SEP,
270
+ SEARCH_ANSWER_KEY: () => SEARCH_ANSWER_KEY,
271
+ SEARCH_ANSWER_KINDS: () => SEARCH_ANSWER_KINDS,
263
272
  SEARCH_FEED_IMPORTS: () => SEARCH_FEED_IMPORTS,
273
+ SEARCH_LABEL_KEY: () => SEARCH_LABEL_KEY,
274
+ SEARCH_NAV_ID: () => SEARCH_NAV_ID,
264
275
  SEARCH_QUERY_LOCAL: () => SEARCH_QUERY_LOCAL,
265
276
  SEARCH_QUERY_TOKEN: () => SEARCH_QUERY_TOKEN,
277
+ SEARCH_RESULT_KEYS: () => SEARCH_RESULT_KEYS,
278
+ SEARCH_RESULT_OPTIONAL_KEYS: () => SEARCH_RESULT_OPTIONAL_KEYS,
266
279
  SEARCH_STORE: () => SEARCH_STORE,
267
280
  SEARCH_STORE_LOCAL: () => SEARCH_STORE_LOCAL,
268
281
  SEARCH_TEXT_INPUT: () => SEARCH_TEXT_INPUT,
@@ -469,6 +482,7 @@ __export(index_exports, {
469
482
  collectReferencedTranslations: () => collectReferencedTranslations,
470
483
  collectScreenWires: () => collectScreenWires,
471
484
  collectSearchEmits: () => collectSearchEmits,
485
+ collectSearchLabels: () => collectSearchLabels,
472
486
  collectThemeAssets: () => collectThemeAssets,
473
487
  collectTranslationAssets: () => collectTranslationAssets,
474
488
  collectTypedComponentInputs: () => collectTypedComponentInputs,
@@ -873,6 +887,7 @@ __export(index_exports, {
873
887
  isRedirectRoute: () => isRedirectRoute,
874
888
  isReferencedByRule: () => isReferencedByRule,
875
889
  isReleaseVersion: () => isReleaseVersion,
890
+ isRemoteManifestPath: () => isRemoteManifestPath,
876
891
  isRepeatFamily: () => isRepeatFamily,
877
892
  isReservedFeatureName: () => isReservedFeatureName,
878
893
  isReservedVariantId: () => isReservedVariantId,
@@ -886,6 +901,8 @@ __export(index_exports, {
886
901
  isRuntimePath: () => isRuntimePath,
887
902
  isScreenMemberBinding: () => isScreenMemberBinding,
888
903
  isScreenOwnedKind: () => isScreenOwnedKind,
904
+ isSearchFeedFunction: () => isSearchFeedFunction,
905
+ isSearchResultShape: () => isSearchResultShape,
889
906
  isSectionHeaderSlotFamily: () => isSectionHeaderSlotFamily,
890
907
  isSharedIconName: () => isSharedIconName,
891
908
  isSharedShapeId: () => isSharedShapeId,
@@ -937,6 +954,7 @@ __export(index_exports, {
937
954
  levelStateComputeds: () => levelStateComputeds,
938
955
  libImportsFrom: () => libImportsFrom,
939
956
  linkDrift: () => linkDrift,
957
+ linkTargetKind: () => linkTargetKind,
940
958
  linkedVariableReaders: () => linkedVariableReaders,
941
959
  listAssetName: () => listAssetName,
942
960
  listDataProperties: () => listDataProperties,
@@ -1341,6 +1359,8 @@ __export(index_exports, {
1341
1359
  sanitizeNavMap: () => sanitizeNavMap,
1342
1360
  sanitizeNpmAllowlist: () => sanitizeNpmAllowlist,
1343
1361
  sanitizePalette: () => sanitizePalette,
1362
+ sanitizeSearchAnswer: () => sanitizeSearchAnswer,
1363
+ sanitizeSearchLabel: () => sanitizeSearchLabel,
1344
1364
  sanitizeTransform: () => sanitizeTransform,
1345
1365
  sanitizeWcConfig: () => sanitizeWcConfig,
1346
1366
  saveAppTarget: () => saveAppTarget,
@@ -1413,7 +1433,10 @@ __export(index_exports, {
1413
1433
  screenWriteValueKinds: () => screenWriteValueKinds,
1414
1434
  screensOfFeature: () => screensOfFeature,
1415
1435
  screensOfKind: () => screensOfKind,
1436
+ searchAnswerScreenId: () => searchAnswerScreenId,
1416
1437
  searchEmit: () => searchEmit,
1438
+ searchFeedArgsComplete: () => searchFeedArgsComplete,
1439
+ searchLabelKey: () => searchLabelKey,
1417
1440
  searchMemberName: () => searchMemberName,
1418
1441
  searchSpec: () => searchSpec,
1419
1442
  searchTextInput: () => searchTextInput,
@@ -1668,6 +1691,7 @@ var ControlType = /* @__PURE__ */ ((ControlType2) => {
1668
1691
  ControlType2["SECTION_BUTTON_GROUP"] = "section_button_group";
1669
1692
  ControlType2["BUTTON"] = "button";
1670
1693
  ControlType2["CONTEXT_MENU"] = "context_menu";
1694
+ ControlType2["AUDIENCE_PICKER"] = "audience_picker";
1671
1695
  ControlType2["ROUTER_OUTLET"] = "router_outlet";
1672
1696
  ControlType2["REMOTE"] = "remote";
1673
1697
  ControlType2["PLUGIN"] = "plugin";
@@ -1753,6 +1777,8 @@ var LIMIT_CHECK_KINDS = [
1753
1777
  var isOverlayType = (type) => type === "modal" /* MODAL */ || type === "side_panel" /* SIDE_PANEL */;
1754
1778
  var OPTION_ROW_TYPE_NAME = "DropdownOption";
1755
1779
  var OPTION_ROW_TYPE_PACKAGE = "@magmonium/one";
1780
+ var AUDIENCE_TYPE_NAME = "Audience";
1781
+ var AUDIENCE_TYPE_PACKAGE = "@magmonium/one";
1756
1782
  var isMapCardinality = (cardinality) => cardinality === "map" || cardinality === "map-many";
1757
1783
  var SHARED_SHAPE_ID_PREFIX = "shared-";
1758
1784
  var isSharedShapeId = (id) => !!id && id.startsWith(SHARED_SHAPE_ID_PREFIX);
@@ -2476,7 +2502,7 @@ function tsTypeExpression(shapes, dataType, cardinality, actionEnumName = () =>
2476
2502
  const shapeKey = shapeKeyOf(dataType);
2477
2503
  const interfaceNameOf = dataType?.type === "form" ? formInterfaceName : shapeInterfaceName;
2478
2504
  const enumName = dataType?.actionEnumId ? actionEnumName(dataType.actionEnumId) : void 0;
2479
- const element = shapeKey !== void 0 ? interfaceNameOf(shapes[shapeKey]?.name ?? "") : enumName ?? (dataType?.type === "file" ? "File" : dataType?.type === "option" ? OPTION_ROW_TYPE_NAME : dataType?.type) ?? "string";
2505
+ const element = shapeKey !== void 0 ? interfaceNameOf(shapes[shapeKey]?.name ?? "") : enumName ?? (dataType?.type === "file" ? "File" : dataType?.type === "option" ? OPTION_ROW_TYPE_NAME : dataType?.type === "audience" ? AUDIENCE_TYPE_NAME : dataType?.type) ?? "string";
2480
2506
  const named = element || "unknown";
2481
2507
  if (cardinality === "many") return `${named}[]`;
2482
2508
  if (cardinality === "map-many") return `Record<string, ${named}[]>`;
@@ -2497,6 +2523,7 @@ function generateShapeInterface(shapes, shape, options = {}) {
2497
2523
  isSharedShapeId(shape.id) ? "shared-type" : "slice-type"
2498
2524
  )}';`
2499
2525
  ).join("\n") : "";
2526
+ const audienceImport = (options.imports ?? true) && shape.keys.some((key2) => key2.dataType.type === "audience") ? `import type { ${AUDIENCE_TYPE_NAME} } from '${AUDIENCE_TYPE_PACKAGE}';` : "";
2500
2527
  const members = shape.keys.map(
2501
2528
  (key2) => ` ${key2.name}: ${tsTypeExpression(
2502
2529
  shapes,
@@ -2504,10 +2531,12 @@ function generateShapeInterface(shapes, shape, options = {}) {
2504
2531
  key2.cardinality
2505
2532
  )};`
2506
2533
  ).join("\n");
2507
- const head = imports ? `${imports}
2534
+ const head = [imports, audienceImport].filter(Boolean).join("\n");
2535
+ return `${head ? `${head}
2508
2536
 
2509
- ` : "";
2510
- return `${head}export interface ${shapeInterfaceName(shape.name)} {
2537
+ ` : ""}export interface ${shapeInterfaceName(
2538
+ shape.name
2539
+ )} {
2511
2540
  ${members}
2512
2541
  }
2513
2542
  `;
@@ -2570,6 +2599,7 @@ var TOTAL_COLUMNS = 12;
2570
2599
  // libs/one/src/lib/features/nav/model/nav.ts
2571
2600
  var ROOT_NAV = "root";
2572
2601
  var DEFAULT_NAV_SEGMENT = "default";
2602
+ var NAV_ID_SEP = "_";
2573
2603
 
2574
2604
  // libs/one/src/lib/features/nav/model/platform-nav.ts
2575
2605
  var PLATFORM_BUTTON_NAV_IDS = [
@@ -3095,6 +3125,7 @@ var CONTROL_RELATIONSHIPS = {
3095
3125
  "section_button_group" /* SECTION_BUTTON_GROUP */,
3096
3126
  "button" /* BUTTON */,
3097
3127
  "context_menu" /* CONTEXT_MENU */,
3128
+ "audience_picker" /* AUDIENCE_PICKER */,
3098
3129
  "router_outlet" /* ROUTER_OUTLET */,
3099
3130
  "screen" /* SCREEN */,
3100
3131
  "variant_branch" /* VARIANT_BRANCH */,
@@ -3102,7 +3133,7 @@ var CONTROL_RELATIONSHIPS = {
3102
3133
  ],
3103
3134
  // A slide body and nothing else — what a slide holds is the ContentControl
3104
3135
  // drawn in place, gated through `contentSlotOf` the way a card Field's is
3105
- // (CONTEXT.md ContentControl, ADR 0070). A carousel naming a Screen per slide
3136
+ // (GLOSSARY.md ContentControl, ADR 0070). A carousel naming a Screen per slide
3106
3137
  // draws no body here at all: that Screen is the body.
3107
3138
  ["section_carousel" /* SECTION_CAROUSEL */]: ["content" /* CONTENT */],
3108
3139
  // A row body and nothing else, for the carousel's reason above — a List's
@@ -3138,6 +3169,7 @@ var CONTROL_RELATIONSHIPS = {
3138
3169
  "section_button_group" /* SECTION_BUTTON_GROUP */,
3139
3170
  "button" /* BUTTON */,
3140
3171
  "context_menu" /* CONTEXT_MENU */,
3172
+ "audience_picker" /* AUDIENCE_PICKER */,
3141
3173
  "screen" /* SCREEN */,
3142
3174
  "variant_branch" /* VARIANT_BRANCH */,
3143
3175
  "repeat" /* REPEAT */
@@ -3165,6 +3197,7 @@ var CONTROL_RELATIONSHIPS = {
3165
3197
  "section_button_group" /* SECTION_BUTTON_GROUP */,
3166
3198
  "button" /* BUTTON */,
3167
3199
  "context_menu" /* CONTEXT_MENU */,
3200
+ "audience_picker" /* AUDIENCE_PICKER */,
3168
3201
  "router_outlet" /* ROUTER_OUTLET */,
3169
3202
  "screen" /* SCREEN */,
3170
3203
  "variant_branch" /* VARIANT_BRANCH */,
@@ -3194,6 +3227,7 @@ var CONTROL_RELATIONSHIPS = {
3194
3227
  "section_button_group" /* SECTION_BUTTON_GROUP */,
3195
3228
  "button" /* BUTTON */,
3196
3229
  "context_menu" /* CONTEXT_MENU */,
3230
+ "audience_picker" /* AUDIENCE_PICKER */,
3197
3231
  "router_outlet" /* ROUTER_OUTLET */,
3198
3232
  "screen" /* SCREEN */,
3199
3233
  "variant_branch" /* VARIANT_BRANCH */,
@@ -3227,6 +3261,7 @@ var CONTROL_RELATIONSHIPS = {
3227
3261
  "section_button_group" /* SECTION_BUTTON_GROUP */,
3228
3262
  "button" /* BUTTON */,
3229
3263
  "context_menu" /* CONTEXT_MENU */,
3264
+ "audience_picker" /* AUDIENCE_PICKER */,
3230
3265
  "router_outlet" /* ROUTER_OUTLET */,
3231
3266
  "screen" /* SCREEN */,
3232
3267
  "variant_branch" /* VARIANT_BRANCH */,
@@ -3255,6 +3290,7 @@ var CONTROL_RELATIONSHIPS = {
3255
3290
  "section_button_group" /* SECTION_BUTTON_GROUP */,
3256
3291
  "button" /* BUTTON */,
3257
3292
  "context_menu" /* CONTEXT_MENU */,
3293
+ "audience_picker" /* AUDIENCE_PICKER */,
3258
3294
  "router_outlet" /* ROUTER_OUTLET */,
3259
3295
  "screen" /* SCREEN */,
3260
3296
  "variant_branch" /* VARIANT_BRANCH */,
@@ -3278,13 +3314,14 @@ var CONTROL_RELATIONSHIPS = {
3278
3314
  "flex" /* FLEX */,
3279
3315
  "button" /* BUTTON */,
3280
3316
  "context_menu" /* CONTEXT_MENU */,
3317
+ "audience_picker" /* AUDIENCE_PICKER */,
3281
3318
  "section_button_group" /* SECTION_BUTTON_GROUP */,
3282
3319
  "variant_branch" /* VARIANT_BRANCH */,
3283
3320
  "repeat" /* REPEAT */
3284
3321
  ],
3285
3322
  // A leaf but for one child, and only on a `selectable_card` Field: its
3286
3323
  // ContentControl, which `canPlaceChild` gates through `contentSlotOf` — what
3287
- // admits one is an InputType, which this table cannot see (CONTEXT.md
3324
+ // admits one is an InputType, which this table cannot see (GLOSSARY.md
3288
3325
  // ContentControl, ADR 0070).
3289
3326
  ["field" /* FIELD */]: ["content" /* CONTENT */],
3290
3327
  // The one list of what a content slot holds, whichever host opened it — a
@@ -3306,6 +3343,7 @@ var CONTROL_RELATIONSHIPS = {
3306
3343
  "user" /* USER */,
3307
3344
  "button" /* BUTTON */,
3308
3345
  "context_menu" /* CONTEXT_MENU */,
3346
+ "audience_picker" /* AUDIENCE_PICKER */,
3309
3347
  "section_button_group" /* SECTION_BUTTON_GROUP */,
3310
3348
  "screen" /* SCREEN */,
3311
3349
  "variant_branch" /* VARIANT_BRANCH */,
@@ -3317,6 +3355,7 @@ var CONTROL_RELATIONSHIPS = {
3317
3355
  ["section_button_group" /* SECTION_BUTTON_GROUP */]: [
3318
3356
  "button" /* BUTTON */,
3319
3357
  "context_menu" /* CONTEXT_MENU */,
3358
+ "audience_picker" /* AUDIENCE_PICKER */,
3320
3359
  "variant_branch" /* VARIANT_BRANCH */,
3321
3360
  "repeat" /* REPEAT */
3322
3361
  ],
@@ -3325,6 +3364,10 @@ var CONTROL_RELATIONSHIPS = {
3325
3364
  // Leaf too, for the Button's reason: everything a menu holds is its own
3326
3365
  // options — an authored bag or a bound list — never a child.
3327
3366
  ["context_menu" /* CONTEXT_MENU */]: [],
3367
+ // Leaf for the menu's reason: its Audience is its value, never a child.
3368
+ // Admitted beside every Button but a SectionAction's — that bar folds its
3369
+ // Buttons into `[buttons]` and projects nothing (ADR 0187).
3370
+ ["audience_picker" /* AUDIENCE_PICKER */]: [],
3328
3371
  // A Section, or a Flex for a Screen that is one line of content — the root
3329
3372
  // container in the reset still gives breakpoints a `mag-grid` to resolve
3330
3373
  // against, and a Flex owns none (ADR 0001, ADR 0005).
@@ -3334,19 +3377,19 @@ var CONTROL_RELATIONSHIPS = {
3334
3377
  "variant_branch" /* VARIANT_BRANCH */,
3335
3378
  "repeat" /* REPEAT */,
3336
3379
  // A whole app is a top-level thing on a Screen, like a Section: it fills
3337
- // the page it mounts in rather than sitting in a Col (CONTEXT.md
3380
+ // the page it mounts in rather than sitting in a Col (GLOSSARY.md
3338
3381
  // RemoteControl).
3339
3382
  "remote" /* REMOTE */,
3340
3383
  "plugin" /* PLUGIN */
3341
3384
  ],
3342
3385
  ["text" /* TEXT_OUTPUT */]: [],
3343
3386
  // Leaf, and the one Control whose children are not its own: what lands in it
3344
- // is whatever the Router matched under this Page (CONTEXT.md
3387
+ // is whatever the Router matched under this Page (GLOSSARY.md
3345
3388
  // RouterOutletControl), so nothing in the Tree may sit inside it.
3346
3389
  ["router_outlet" /* ROUTER_OUTLET */]: [],
3347
3390
  // Leaf, and the other Control whose children are not its own: what renders
3348
3391
  // inside it is the named Screen's own Tree, held in that Screen's slot
3349
- // (CONTEXT.md ScreenControl).
3392
+ // (GLOSSARY.md ScreenControl).
3350
3393
  ["screen" /* SCREEN */]: [],
3351
3394
  // Leaf, like text — content rather than structure, so a Section reaches it
3352
3395
  // only through a Row or Col.
@@ -3380,7 +3423,7 @@ var CONTROL_RELATIONSHIPS = {
3380
3423
  ["user" /* USER */]: ["content" /* CONTENT */],
3381
3424
  ["chat_bubble" /* CHAT_BUBBLE */]: ["content" /* CONTENT */],
3382
3425
  // Arms and nothing else — a branch is the chain and its arms are the arms of
3383
- // it (CONTEXT.md VariantBranch). One arm ControlType for both kinds: a
3426
+ // it (GLOSSARY.md VariantBranch). One arm ControlType for both kinds: a
3384
3427
  // DefaultArm is a BRANCH_ARM with `armKind: 'default'`.
3385
3428
  ["variant_branch" /* VARIANT_BRANCH */]: ["branch_arm" /* BRANCH_ARM */],
3386
3429
  // Deliberately empty, and not a leaf: an arm is transparent, so what it
@@ -3448,7 +3491,7 @@ var CONTROL_MAX_CHILDREN = {
3448
3491
  ["router_outlet" /* ROUTER_OUTLET */]: 1
3449
3492
  },
3450
3493
  // One content slot per host: a host renders the content it was handed in one
3451
- // place, so a second has nowhere to go (CONTEXT.md ContentControl).
3494
+ // place, so a second has nowhere to go (GLOSSARY.md ContentControl).
3452
3495
  ["field" /* FIELD */]: { ["content" /* CONTENT */]: 1 },
3453
3496
  ["user" /* USER */]: { ["content" /* CONTENT */]: 1 },
3454
3497
  ["chat_bubble" /* CHAT_BUBBLE */]: { ["content" /* CONTENT */]: 1 },
@@ -3617,12 +3660,15 @@ var OWN_DIRECTIVES = {
3617
3660
  ["section_button_group" /* SECTION_BUTTON_GROUP */]: ["routerLink"],
3618
3661
  // The other click affordance the editor can express, beside a Col: a Button
3619
3662
  // is what a User presses to open a Modal or SidePanel. Its own click target
3620
- // — `url`/`murl` — is the one thing an overlay competes with, so the two are
3621
- // mutually exclusive per Button and `canAttachDirective` says so.
3663
+ // — its LinkTarget — is the one thing an overlay competes with, so the two
3664
+ // are mutually exclusive per Button and `canAttachDirective` says so.
3622
3665
  ["button" /* BUTTON */]: ["mModal", "mSidePanel", "routerLink"],
3623
3666
  // Nothing to attach: the trigger's one click is the menu's own open, so an
3624
3667
  // overlay or a route on it would compete with the very thing the Control is.
3625
3668
  ["context_menu" /* CONTEXT_MENU */]: [],
3669
+ // Nothing to attach, for the menu's reason: the trigger's one click opens
3670
+ // the picker.
3671
+ ["audience_picker" /* AUDIENCE_PICKER */]: [],
3626
3672
  // Nothing to attach to: an outlet renders another Page's Controls, and a
3627
3673
  // behaviour on it would be a behaviour on whatever the Router happened to
3628
3674
  // match.
@@ -3689,8 +3735,21 @@ var DIRECTIVE_NAMES = [
3689
3735
  "mOptions",
3690
3736
  "routerLink"
3691
3737
  ];
3692
- var NAV_TARGET_KEYS = ["url", "murl"];
3693
- var hasNavTarget = (control) => NAV_TARGET_KEYS.some((key2) => {
3738
+ var NAV_TARGET_KEYS = ["href"];
3739
+ var BUTTON_CLICK_OUTPUT = "clicked";
3740
+ var LINK_TARGET_KINDS = [
3741
+ "none",
3742
+ "nav",
3743
+ "route",
3744
+ "external"
3745
+ ];
3746
+ var linkTargetKind = (control) => {
3747
+ if (control.outputNavs?.[BUTTON_CLICK_OUTPUT]) return "nav";
3748
+ if (control.directives?.["routerLink"]) return "route";
3749
+ if (typeof control.configs?.["href"] === "string") return "external";
3750
+ return "none";
3751
+ };
3752
+ var hasNavTarget = (control) => control.type === "button" /* BUTTON */ && !!control.outputNavs?.[BUTTON_CLICK_OUTPUT] || NAV_TARGET_KEYS.some((key2) => {
3694
3753
  const value = control.configs?.[key2];
3695
3754
  return typeof value === "string" ? value.trim() !== "" : value != null;
3696
3755
  });
@@ -3755,6 +3814,9 @@ var CONTROL_LABEL = {
3755
3814
  ["section_button_group" /* SECTION_BUTTON_GROUP */]: "section-button-group",
3756
3815
  ["button" /* BUTTON */]: "button",
3757
3816
  ["context_menu" /* CONTEXT_MENU */]: "context-menu",
3817
+ // The library's own key: project keys win the translation merge, so an
3818
+ // app-side `audience-picker` would reword the primitive's trigger label.
3819
+ ["audience_picker" /* AUDIENCE_PICKER */]: "audience-picker",
3758
3820
  ["router_outlet" /* ROUTER_OUTLET */]: "router-outlet",
3759
3821
  ["screen" /* SCREEN */]: "screen",
3760
3822
  ["variant_branch" /* VARIANT_BRANCH */]: "variant-branch",
@@ -3815,6 +3877,7 @@ var CONTROL_ICON = {
3815
3877
  ["section_button_group" /* SECTION_BUTTON_GROUP */]: "control_button_group",
3816
3878
  ["button" /* BUTTON */]: "control_button",
3817
3879
  ["context_menu" /* CONTEXT_MENU */]: "control_context_menu",
3880
+ ["audience_picker" /* AUDIENCE_PICKER */]: "control_audience_picker",
3818
3881
  ["router_outlet" /* ROUTER_OUTLET */]: "control_router_outlet",
3819
3882
  ["screen" /* SCREEN */]: "control_screen",
3820
3883
  ["variant_branch" /* VARIANT_BRANCH */]: "control_variant_branch",
@@ -4021,7 +4084,7 @@ var CONTROL_CODEGEN = {
4021
4084
  },
4022
4085
  // Folderless for the Remote's reason — PluginComponent takes `link` and
4023
4086
  // `screen` as individual inputs, its Screen's inputs as `m-plugin-input`
4024
- // children (CONTEXT.md PluginControl).
4087
+ // children (GLOSSARY.md PluginControl).
4025
4088
  ["plugin" /* PLUGIN */]: {
4026
4089
  tag: "m-plugin",
4027
4090
  component: "PluginComponent"
@@ -4085,6 +4148,12 @@ var CONTROL_CODEGEN = {
4085
4148
  component: "ContextMenuComponent",
4086
4149
  folder: "menu"
4087
4150
  },
4151
+ // `audience_picker` is the primitive's own `subFolder` (ADR 0187).
4152
+ ["audience_picker" /* AUDIENCE_PICKER */]: {
4153
+ tag: "m-audience-picker",
4154
+ component: "AudiencePickerComponent",
4155
+ folder: "audience_picker"
4156
+ },
4088
4157
  // Angular's own tag and Angular's own class — the outlet is a hole the Router
4089
4158
  // fills, so there is nothing about it for the editor to configure and no
4090
4159
  // folder for it to browse.
@@ -4345,7 +4414,7 @@ function renameScreenMethodParamReads(method, from, to) {
4345
4414
  return {
4346
4415
  ...method,
4347
4416
  ...method.args ? { args: renameArgs(method.args) } : {},
4348
- // Every further call's rows read the same parameters (CONTEXT.md
4417
+ // Every further call's rows read the same parameters (GLOSSARY.md
4349
4418
  // OutputCall).
4350
4419
  ...method.calls ? {
4351
4420
  calls: method.calls.map(
@@ -6349,6 +6418,11 @@ var BINDING_SLOT = {
6349
6418
  data: "data",
6350
6419
  // A RepeatControl's collection.
6351
6420
  source: "source",
6421
+ // An [AudiencePickerControl]'s controlled half, named for the `[audience]`
6422
+ // input it lands on. Exclusive with `source` beside it: the two are halves of
6423
+ // one value, and a Screen holding both would be sending the picker its value
6424
+ // twice (GLOSSARY.md AudiencePickerControl, ADR 0187).
6425
+ audience: "audience",
6352
6426
  // A UserControl's four, each named for the `m-user` input it lands on
6353
6427
  // (ADR 0069). `id` is the User the row *is* — what UserStore looks up — and
6354
6428
  // the other three are the values that stand in front of whatever it resolved.
@@ -6359,16 +6433,16 @@ var BINDING_SLOT = {
6359
6433
  // An [ImgControl]'s picture, named for the `m-img` input it lands on. Bound
6360
6434
  // is the ordinary case rather than the exotic one — a row's cover, a User's
6361
6435
  // photo — and what a binding usually holds is half a url, which is what the
6362
- // prefix beside it is for (CONTEXT.md ImgControl).
6436
+ // prefix beside it is for (GLOSSARY.md ImgControl).
6363
6437
  src: "src",
6364
6438
  // A [RemoteControl]'s AppLink and its path in (the RemotePathMap's `in`),
6365
- // named for the `m-remote` inputs they land on (CONTEXT.md RemoteControl).
6439
+ // named for the `m-remote` inputs they land on (GLOSSARY.md RemoteControl).
6366
6440
  link: "link",
6367
6441
  path: "path",
6368
6442
  // A FieldControl's choices, named for the `m-section-form-item` input it
6369
6443
  // lands on. Exclusive with the `mOptions` AssetDirective beside it: an asset
6370
6444
  // name and a bound array are two answers to one question, so the picker
6371
- // clears one when it writes the other (CONTEXT.md OptionSet).
6445
+ // clears one when it writes the other (GLOSSARY.md OptionSet).
6372
6446
  options: "options",
6373
6447
  // A SectionPagination's row count, named for the `m-section-pagination` input
6374
6448
  // it lands on. Content and not a setting, so it belongs here: what the band
@@ -6397,6 +6471,15 @@ var FALLBACK_SLOTS = [
6397
6471
  ];
6398
6472
  var IMG_VALUE_SLOTS = [BINDING_SLOT.src];
6399
6473
  var REMOTE_VALUE_SLOTS = [BINDING_SLOT.link, BINDING_SLOT.path];
6474
+ var AUDIENCE_PICKER_VALUE_SLOTS = [
6475
+ BINDING_SLOT.audience,
6476
+ BINDING_SLOT.source
6477
+ ];
6478
+ var AUDIENCE_PICKER_VALUE_LABEL = {
6479
+ [BINDING_SLOT.audience]: "audience-controlled",
6480
+ [BINDING_SLOT.source]: "audience-source"
6481
+ };
6482
+ var AUDIENCE_PICKER_LEVELS_KEY = "levels";
6400
6483
  var REMOTE_MOUNT_NAME_KEY = "mountName";
6401
6484
  var IMG_SRC_PREFIX_KEY = "srcPrefix";
6402
6485
  var IMG_SRC_SUFFIX_KEY = "srcSuffix";
@@ -6443,7 +6526,7 @@ function controlMapReadsState(map) {
6443
6526
  return Object.values(map).some(
6444
6527
  (control) => Object.values(control.bindings ?? {}).some(readsStore) || // A FormatPipe's bound argument is a store read the same way — a static
6445
6528
  // label under a `money:…:ordersStore.currency()` chain names no binding
6446
- // of its own (CONTEXT.md FormatPipe).
6529
+ // of its own (GLOSSARY.md FormatPipe).
6447
6530
  (control.formatPipes ?? []).some(
6448
6531
  (pipe) => Object.values(pipe.args ?? {}).some(
6449
6532
  (arg) => arg.kind === "binding" && readsStore(arg.binding)
@@ -7297,7 +7380,7 @@ var screenRoots = (scope) => [
7297
7380
  cardinality: input.cardinality
7298
7381
  })),
7299
7382
  // A ScreenComputed's type is its PureFunction's declared return and is
7300
- // never authored (CONTEXT.md ScreenComputed), so it is read off the
7383
+ // never authored (GLOSSARY.md ScreenComputed), so it is read off the
7301
7384
  // function the same way `computedAsProperty` reads a StateComputed's.
7302
7385
  ...Object.values(scope.screenComputeds ?? {}).flatMap((computed) => {
7303
7386
  const fn = screenComputedFunction(computed, scope.functions ?? {});
@@ -8964,8 +9047,10 @@ var declOf = (input) => ({
8964
9047
  cardinality: input.cardinality
8965
9048
  });
8966
9049
  var inputPrimitive = (input) => input.dataType.type === "shape" || input.dataType.type === "form" || input.dataType.type === "file" || // An option row is a list a Field reads, never a scalar crossing a Screen
8967
- // boundary (ADR 0038) — so it is no ScreenInput's type either.
8968
- input.dataType.type === "option" ? void 0 : input.dataType.type;
9050
+ // boundary (ADR 0038) — so it is no ScreenInput's type either. An `audience`
9051
+ // joins it: a picker's value is held and bound as a whole, not narrowed to a
9052
+ // primitive here (ADR 0187).
9053
+ input.dataType.type === "option" || input.dataType.type === "audience" ? void 0 : input.dataType.type;
8969
9054
  function mergeScreenInputs(declared = {}, inferred = []) {
8970
9055
  const byName = /* @__PURE__ */ new Map();
8971
9056
  for (const input of listScreenInputs(declared)) {
@@ -9045,7 +9130,7 @@ function screenInputExpression(binding, target, wires, renderBinding = () => voi
9045
9130
  }
9046
9131
  // A path into what this Screen reads, emitted by the one walk every other
9047
9132
  // bound slot goes through — injected rather than imported, for the reason
9048
- // `renderMethodCall` is (CONTEXT.md DataBinding). Undefined where the read
9133
+ // `renderMethodCall` is (GLOSSARY.md DataBinding). Undefined where the read
9049
9134
  // no longer resolves, which leaves the input unbound rather than emitting a
9050
9135
  // dead chain (ADR 0064).
9051
9136
  case "data":
@@ -11106,7 +11191,11 @@ var OUTPUT_PAYLOADS_BY_CONTROL = {
11106
11191
  // into the group rather than a fixed list, which is why they are resolved
11107
11192
  // from the ControlMap instead of declared below (libs/one ADR 0026,
11108
11193
  // superseding ADR 0096's `{name, value}[]`).
11109
- ["section_filter_group" /* SECTION_FILTER_GROUP */]: { filterChange: "record" }
11194
+ ["section_filter_group" /* SECTION_FILTER_GROUP */]: { filterChange: "record" },
11195
+ // An AudiencePickerControl's one output carries the `Audience` it was left
11196
+ // holding — the same value its controlled half reads. A record because the
11197
+ // library declares it as one: `level`, `uids` and `groupIds` (ADR 0187).
11198
+ ["audience_picker" /* AUDIENCE_PICKER */]: { audienceChange: "record" }
11110
11199
  };
11111
11200
  var FIELD_STRING_READER = "fieldString";
11112
11201
  var FIELD_NUMBER_READER = "fieldNumber";
@@ -11121,6 +11210,12 @@ var OUTPUT_PAYLOAD_MEMBERS = {
11121
11210
  },
11122
11211
  ["section_table" /* SECTION_TABLE */]: {
11123
11212
  sortChange: { id: "S", direction: "S" }
11213
+ },
11214
+ // libs/one `Audience` — one AudienceLevel, then the people and the Groups it
11215
+ // lets in or keeps out (GLOSSARY.md AudiencePickerControl). Self-typed, so
11216
+ // nothing binds `data` to give the output a shape (ADR 0187).
11217
+ ["audience_picker" /* AUDIENCE_PICKER */]: {
11218
+ audienceChange: { level: "S", uids: "S[]", groupIds: "S[]" }
11124
11219
  }
11125
11220
  };
11126
11221
  var DYNAMIC_MEMBER_OUTPUTS = {
@@ -11263,7 +11358,7 @@ function methodUsage(methodId, controls) {
11263
11358
  return Object.values(controls).filter(
11264
11359
  (control) => Object.values(control.outputs ?? {}).some((id) => id === methodId) || Object.values(control.outputOpens ?? {}).some(
11265
11360
  (open) => Object.values(open?.outputs ?? {}).some(
11266
- (wire) => wire.binding?.kind === "method" && wire.binding.methodId === methodId || // A further call of the wire (CONTEXT.md OutputCall).
11361
+ (wire) => wire.binding?.kind === "method" && wire.binding.methodId === methodId || // A further call of the wire (GLOSSARY.md OutputCall).
11267
11362
  (wire.calls ?? []).some((call) => call.methodId === methodId)
11268
11363
  )
11269
11364
  )
@@ -12360,7 +12455,11 @@ function loadWcConfig(storage) {
12360
12455
  function sanitizeWcConfig(value) {
12361
12456
  if (!value || typeof value !== "object") return EMPTY_WC_CONFIG;
12362
12457
  const stored = value;
12458
+ const name3 = asString(stored.name).trim();
12363
12459
  return {
12460
+ // Only when set, so a workspace that never linked an App keeps its
12461
+ // DesignSource byte for byte.
12462
+ ...name3 && { name: name3 },
12364
12463
  description: asString(stored.description),
12365
12464
  company: asString(stored.company),
12366
12465
  pwaColor: asString(stored.pwaColor) || EMPTY_WC_CONFIG.pwaColor,
@@ -12594,7 +12693,7 @@ var FORMAT_PIPE_CATALOG = [
12594
12693
  component: "TimeAgoPipe",
12595
12694
  importFrom: ONE_IMPORT_MODULE,
12596
12695
  // `string | Date`, and `string` is the half the editor can express — every
12597
- // date in this domain is a string the developer parses (CONTEXT.md DataType).
12696
+ // date in this domain is a string the developer parses (GLOSSARY.md DataType).
12598
12697
  inputType: STR2,
12599
12698
  returnType: STR2,
12600
12699
  // Takes the value and nothing else — the only entry with no parameter
@@ -15123,7 +15222,7 @@ ${failureArms.map(
15123
15222
  ) || Object.values(method.confirm?.params ?? {}).some(
15124
15223
  (binding) => binding.source === "compute" && binding.name === name3
15125
15224
  ) || // The overlay opens inside the success `tap`, which closes over the same
15126
- // widened receiver (CONTEXT.md OpenScreen).
15225
+ // widened receiver (GLOSSARY.md OpenScreen).
15127
15226
  (method.open?.inputs ?? []).some(
15128
15227
  (row) => row.source === "compute" && row.compute === name3
15129
15228
  ) || // A MethodVariant is resolved inside the response block, which closes
@@ -15480,6 +15579,21 @@ function generateCacheMethods(methods, operationOf, properties, shapes, roots =
15480
15579
  }
15481
15580
 
15482
15581
  // libs/codegen/src/model/nav.ts
15582
+ var SEARCH_ANSWER_KINDS = ["feed", "screen"];
15583
+ var SEARCH_NAV_ID = "root_search";
15584
+ var SEARCH_ANSWER_KEY = "search_answer";
15585
+ var SEARCH_LABEL_KEY = "search_label";
15586
+ var searchAnswerScreenId = (navMap) => {
15587
+ const answer = navMap[SEARCH_NAV_ID]?.searchAnswer;
15588
+ return answer?.kind === "screen" ? answer.screenId || void 0 : void 0;
15589
+ };
15590
+ var searchLabelKey = (navMap) => sanitizeSearchLabel(navMap[SEARCH_NAV_ID]?.searchLabel);
15591
+ var sanitizeSearchAnswer = (value) => {
15592
+ if (!value || typeof value !== "object") return void 0;
15593
+ const answer = value;
15594
+ return answer.kind === "screen" && typeof answer.screenId === "string" && answer.screenId ? { kind: "screen", screenId: answer.screenId } : void 0;
15595
+ };
15596
+ var sanitizeSearchLabel = (value) => typeof value === "string" && value.trim() ? value.trim() : void 0;
15483
15597
  var isCompleteVisibilitySource = (source) => !!source && !!source.featureId && !!source.functionId && (source.hidesRow || source.guardsRoute);
15484
15598
  var prunedVisibilitySource = (source) => {
15485
15599
  if (!source) return void 0;
@@ -15562,18 +15676,18 @@ var pickedNavTail = (typed, nav) => {
15562
15676
  return isLegalNavTail(nav.tail, nav) ? nav.tail : void 0;
15563
15677
  };
15564
15678
  var navDynamicSegment = (nav) => `:${navParam(nav)}`;
15565
- var NAV_ID_SEP = "_";
15679
+ var NAV_ID_SEP2 = "_";
15566
15680
  var isValidNavSegment = (segment) => /^[a-z0-9][a-z0-9-]*$/.test(segment);
15567
15681
  var isValidNavId = (navId) => {
15568
- const segments = navId.split(NAV_ID_SEP);
15682
+ const segments = navId.split(NAV_ID_SEP2);
15569
15683
  return segments[0] === ROOT_NAV_ID && segments.slice(1).every(isValidNavSegment);
15570
15684
  };
15571
15685
  var parentNavId = (navId) => {
15572
- const i = navId.lastIndexOf(NAV_ID_SEP);
15686
+ const i = navId.lastIndexOf(NAV_ID_SEP2);
15573
15687
  return i > 0 ? navId.slice(0, i) : void 0;
15574
15688
  };
15575
15689
  var navSegmentId = (navId) => {
15576
- const i = navId.lastIndexOf(NAV_ID_SEP);
15690
+ const i = navId.lastIndexOf(NAV_ID_SEP2);
15577
15691
  return i > 0 ? navId.slice(i + 1) : navId;
15578
15692
  };
15579
15693
  var navParamTarget = (navMap, navId, ownerNavId) => {
@@ -15588,7 +15702,7 @@ var navParamTarget = (navMap, navId, ownerNavId) => {
15588
15702
  return void 0;
15589
15703
  };
15590
15704
  var isDefaultNavId = (navId) => navSegmentId(navId) === DEFAULT_NAV_SEGMENT;
15591
- var childNavId = (parentId, slug2) => `${parentId}${NAV_ID_SEP}${slug2}`;
15705
+ var childNavId = (parentId, slug2) => `${parentId}${NAV_ID_SEP2}${slug2}`;
15592
15706
  var ancestorNavIds = (navId) => {
15593
15707
  const out = [];
15594
15708
  let id = parentNavId(navId);
@@ -15623,12 +15737,12 @@ var navsReferencingVisibilityMethod = (navMap, methodId) => Object.values(navMap
15623
15737
  var navParamsInScope = (navId, navMap) => [navId, ...ancestorNavIds(navId)].map((id) => navMap[id]).filter((nav) => !!nav && nav.presentation === "dynamic");
15624
15738
  var canBeDefaultNav = (nav) => !!nav && nav.platform !== true && // The other half of `canCarryVisibilitySource`'s refusal, stated from this
15625
15739
  // side: the landing is where a refused navigation is sent, so a landing that
15626
- // can itself be refused has nowhere to send it (CONTEXT.md
15740
+ // can itself be refused has nowhere to send it (GLOSSARY.md
15627
15741
  // NavVisibilitySource).
15628
15742
  !nav.visibilitySource && nav.navId !== ROOT_NAV_ID && nav.linkKind === "url" && nav.presentation !== "component" && // A `dynamic` Nav writes `:<param>` in place of its own segment and a
15629
15743
  // default writes `''`. Both claim the one slot, and the value the landing
15630
15744
  // would redirect to does not exist until a store has loaded — a route that
15631
- // cannot be emitted at build time (CONTEXT.md Default Nav).
15745
+ // cannot be emitted at build time (GLOSSARY.md Default Nav).
15632
15746
  nav.presentation !== "dynamic";
15633
15747
  var canBeMurl = (presentation) => presentation !== "dynamic";
15634
15748
  var navsReferencingComputed = (navMap, computedId) => Object.values(navMap).filter(
@@ -15651,11 +15765,11 @@ var navVariantNavIds = (navMap, screenId) => {
15651
15765
  if (!bound.length) return [];
15652
15766
  return Object.values(navMap).filter(
15653
15767
  (nav) => nav.navId !== ROOT_NAV_ID && nav.linkKind === "url" && bound.some(
15654
- (id) => id === nav.navId || id.startsWith(`${nav.navId}${NAV_ID_SEP}`) || nav.navId.startsWith(`${id}${NAV_ID_SEP}`)
15768
+ (id) => id === nav.navId || id.startsWith(`${nav.navId}${NAV_ID_SEP2}`) || nav.navId.startsWith(`${id}${NAV_ID_SEP2}`)
15655
15769
  )
15656
15770
  ).map((nav) => nav.navId);
15657
15771
  };
15658
- var isNavAtOrBelow = (navId, target) => navId === target || navId.startsWith(`${target}${NAV_ID_SEP}`);
15772
+ var isNavAtOrBelow = (navId, target) => navId === target || navId.startsWith(`${target}${NAV_ID_SEP2}`);
15659
15773
  var NAV_LINK_KINDS = ["url", "murl"];
15660
15774
  var NAV_PRESENTATIONS = [
15661
15775
  "static",
@@ -15668,8 +15782,8 @@ var NAV_REF_MEMBER = "this.navRef";
15668
15782
  var NAV_ROUTER_MEMBER = "this.navRouter";
15669
15783
  var NAV_ROUTE_MEMBER = "this.navRoute";
15670
15784
  var navIdChain = (navId) => {
15671
- const segments = navId.split(NAV_ID_SEP).filter(Boolean);
15672
- return segments.map((_, i) => segments.slice(0, i + 1).join(NAV_ID_SEP));
15785
+ const segments = navId.split(NAV_ID_SEP2).filter(Boolean);
15786
+ return segments.map((_, i) => segments.slice(0, i + 1).join(NAV_ID_SEP2));
15673
15787
  };
15674
15788
  function outcomeNavDynamicNavs(navId, navMap) {
15675
15789
  if (!navId || !navMap[navId]) return [];
@@ -15744,7 +15858,7 @@ function outcomeReadsArgs(outcome) {
15744
15858
  )
15745
15859
  );
15746
15860
  }
15747
- var within = (navId, root) => !!navId && (navId === root || navId.startsWith(`${root}${NAV_ID_SEP}`));
15861
+ var within = (navId, root) => !!navId && (navId === root || navId.startsWith(`${root}${NAV_ID_SEP2}`));
15748
15862
  function controlNavReferences(control) {
15749
15863
  const outcomes = [
15750
15864
  ...Object.values(control.outputOutcomes ?? {}),
@@ -16418,10 +16532,84 @@ ${indent2}});`;
16418
16532
  return closes && idVar ? `const ${idVar} = ${call}` : call;
16419
16533
  }
16420
16534
 
16535
+ // libs/codegen/src/model/search-feed.ts
16536
+ var SEARCH_RESULT_KEYS = ["id", "title"];
16537
+ var SEARCH_RESULT_OPTIONAL_KEYS = ["description", "img", "url"];
16538
+ var hasStringKey = (shape, name3) => !!shape?.keys.some(
16539
+ (key2) => key2.name === name3 && key2.dataType.type === "string" && key2.cardinality === "one"
16540
+ );
16541
+ var isSearchResultShape = (shape) => SEARCH_RESULT_KEYS.every((name3) => hasStringKey(shape, name3));
16542
+ var isSearchFeedFunction = (fn, property, shapes) => {
16543
+ if (!fn || !property || property.cardinality !== "many") return false;
16544
+ if (fn.returnAsync) return false;
16545
+ const [query, items] = fn.params;
16546
+ if (!query || query.dataType.type !== "string" || query.cardinality !== "one")
16547
+ return false;
16548
+ if (!items || items.cardinality !== "many") return false;
16549
+ if (!sameDataType2(items.dataType, property.dataType)) return false;
16550
+ if (fn.returnCardinality !== "many" || fn.returnType.type !== "shape")
16551
+ return false;
16552
+ return isSearchResultShape(shapes[fn.returnType.shapeId]);
16553
+ };
16554
+ var sameDataType2 = (a, b) => a.type === b.type && (a.type !== "shape" || b.type === "shape" && a.shapeId === b.shapeId);
16555
+ var searchFeedArgsComplete = (fn, args) => fn.params.slice(2).every((param) => !!args?.[param.id]);
16556
+ var sanitizeMemberPath = (value) => {
16557
+ if (!Array.isArray(value)) return void 0;
16558
+ const segments = value.filter(
16559
+ (segment) => typeof segment === "string" && !!segment
16560
+ );
16561
+ return segments.length ? segments : void 0;
16562
+ };
16563
+
16421
16564
  // libs/codegen/src/lib/search-feed-codegen.ts
16422
16565
  var SEARCH_STORE = "SearchStore";
16423
16566
  var SEARCH_STORE_LOCAL = "searchStore";
16424
16567
  var SEARCH_FEED_IMPORTS = [SEARCH_STORE];
16568
+ function generateFunctionFeed(storeKey, feed, propertyName, context) {
16569
+ const { fn, property, shapes, roots } = context;
16570
+ if (!fn || !isSearchFeedFunction(fn, property, shapes)) {
16571
+ return { block: "", needsSearch: false };
16572
+ }
16573
+ if (!searchFeedArgsComplete(fn, feed.args)) {
16574
+ return { block: "", needsSearch: false };
16575
+ }
16576
+ const rest = fn.params.slice(2).map((param, index) => {
16577
+ const arg = feed.args?.[param.id];
16578
+ return {
16579
+ local: `arg${index}`,
16580
+ expression: stateComputedArgExpression(arg, roots, shapes, () => "store."),
16581
+ guarded: arg?.source === "path"
16582
+ };
16583
+ });
16584
+ if (rest.some((r) => r.expression === "undefined")) {
16585
+ return { block: "", needsSearch: false };
16586
+ }
16587
+ const clear = `${SEARCH_STORE_LOCAL}.clearSourceResults('${storeKey}');`;
16588
+ const locals = rest.map((r) => ` const ${r.local} = ${r.expression};
16589
+ `).join("");
16590
+ const guard = rest.filter((r) => r.guarded).map((r) => `${r.local} === undefined`).join(" || ");
16591
+ const guardBlock = guard ? ` if (${guard}) {
16592
+ ${clear}
16593
+ return;
16594
+ }
16595
+ ` : "";
16596
+ const call = `${fn.name}(${["query", "rows", ...rest.map((r) => r.local)].join(
16597
+ ", "
16598
+ )})`;
16599
+ return {
16600
+ block: ` effect(() => {
16601
+ const query = ${SEARCH_QUERY_LOCAL}?.() ?? '';
16602
+ if (!query.trim()) {
16603
+ ${clear}
16604
+ return;
16605
+ }
16606
+ const rows = store.${propertyName}() ?? [];
16607
+ ${locals}${guardBlock} ${SEARCH_STORE_LOCAL}.updateSourceResults('${storeKey}', '${feed.label}', ${call});
16608
+ });`,
16609
+ needsSearch: true,
16610
+ functionId: fn.id
16611
+ };
16612
+ }
16425
16613
  var resolveSearchFeedMember = (path, dataType, shapes) => {
16426
16614
  if (!path.length) return void 0;
16427
16615
  let current = dataType;
@@ -16433,11 +16621,19 @@ var resolveSearchFeedMember = (path, dataType, shapes) => {
16433
16621
  }
16434
16622
  return path.slice();
16435
16623
  };
16436
- function generateSearchFeed(storeKey, feed, properties, shapes) {
16624
+ function generateSearchFeed(storeKey, feed, properties, shapes, functions = {}, roots = properties) {
16437
16625
  const property = feed ? properties[feed.propertyId] : void 0;
16438
16626
  if (!feed || !property || property.cardinality !== "many") {
16439
16627
  return { block: "", needsSearch: false };
16440
16628
  }
16629
+ if (feed.functionId) {
16630
+ return generateFunctionFeed(storeKey, feed, property.name, {
16631
+ fn: functions[feed.functionId],
16632
+ property,
16633
+ shapes,
16634
+ roots
16635
+ });
16636
+ }
16441
16637
  const title = resolveSearchFeedMember(feed.title, property.dataType, shapes);
16442
16638
  if (!title) return { block: "", needsSearch: false };
16443
16639
  const item = "item";
@@ -16809,7 +17005,14 @@ function generateStoreHook(featureName, hook, properties, shapes, methods, opera
16809
17005
  /* @__PURE__ */ new Set(["store", "storage", SEARCH_QUERY_LOCAL]),
16810
17006
  casts
16811
17007
  ) : { once: [], onChange: [] };
16812
- const feed = generateSearchFeed(storeKey, searchFeed, properties, shapes);
17008
+ const feed = generateSearchFeed(
17009
+ storeKey,
17010
+ searchFeed,
17011
+ properties,
17012
+ shapes,
17013
+ functions,
17014
+ roots
17015
+ );
16813
17016
  const timerTaken = /* @__PURE__ */ new Set([
16814
17017
  "store",
16815
17018
  "storage",
@@ -16889,6 +17092,7 @@ ${storageLine}${searchLine}${searchStoreLine}${globalStoreLines}${body.join("\n"
16889
17092
  needsStorage: usesService,
16890
17093
  needsSearch: usesSearch,
16891
17094
  needsFeed: !!feed.block,
17095
+ ...feed.functionId ? { feedFunctionId: feed.functionId } : {},
16892
17096
  needsUntracked: timerEmission.needsUntracked,
16893
17097
  // A StoreHookRead's cast and a `storage` call-arg row's are both the hook
16894
17098
  // naming an interface the api half may never mention (ADR 0060).
@@ -18218,7 +18422,7 @@ function formModelShapeKeys(controlMap, formId) {
18218
18422
  return buildFormShape(controlMap, formId)?.keys ?? [];
18219
18423
  }
18220
18424
  function formModelKeyType(key2) {
18221
- if (key2.dataType.type === "shape" || key2.dataType.type === "form" || key2.dataType.type === "option") {
18425
+ if (key2.dataType.type === "shape" || key2.dataType.type === "form" || key2.dataType.type === "option" || key2.dataType.type === "audience") {
18222
18426
  return void 0;
18223
18427
  }
18224
18428
  if (!isKeyCardinality(key2.cardinality)) return void 0;
@@ -18266,7 +18470,7 @@ function formModelSourceType(source, scope) {
18266
18470
  input.cardinality
18267
18471
  );
18268
18472
  }
18269
- if (input.dataType.type === "form" || input.dataType.type === "option") {
18473
+ if (input.dataType.type === "form" || input.dataType.type === "option" || input.dataType.type === "audience") {
18270
18474
  return void 0;
18271
18475
  }
18272
18476
  if (source.member?.length) return void 0;
@@ -18285,7 +18489,7 @@ function formModelSourceType(source, scope) {
18285
18489
  fn.returnCardinality
18286
18490
  );
18287
18491
  }
18288
- if (fn.returnType.type === "form" || fn.returnType.type === "option") {
18492
+ if (fn.returnType.type === "form" || fn.returnType.type === "option" || fn.returnType.type === "audience") {
18289
18493
  return void 0;
18290
18494
  }
18291
18495
  if (source.member?.length) return void 0;
@@ -18507,7 +18711,7 @@ function screenVariableSourceType(source, scope) {
18507
18711
  const input = scope.inputs[source.inputId];
18508
18712
  if (!input || input.dataType.type === "shape") return void 0;
18509
18713
  if (input.dataType.type === "form") return void 0;
18510
- if (input.dataType.type === "file" || input.dataType.type === "option") {
18714
+ if (input.dataType.type === "file" || input.dataType.type === "option" || input.dataType.type === "audience") {
18511
18715
  return void 0;
18512
18716
  }
18513
18717
  if (!isVariableCardinality(input.cardinality)) return void 0;
@@ -18516,7 +18720,7 @@ function screenVariableSourceType(source, scope) {
18516
18720
  if (source.source === "computed") {
18517
18721
  const computed = scope.computeds[source.computedId];
18518
18722
  const fn = computed ? screenComputedFunction(computed, scope.functions) : void 0;
18519
- if (!fn || fn.returnType.type === "shape" || fn.returnType.type === "form" || fn.returnType.type === "file" || fn.returnType.type === "option") {
18723
+ if (!fn || fn.returnType.type === "shape" || fn.returnType.type === "form" || fn.returnType.type === "file" || fn.returnType.type === "option" || fn.returnType.type === "audience") {
18520
18724
  return void 0;
18521
18725
  }
18522
18726
  if (!isVariableCardinality(fn.returnCardinality)) return void 0;
@@ -18820,6 +19024,9 @@ function bodyConfigs(node) {
18820
19024
  if (node.type === "list" /* LIST */) {
18821
19025
  delete configs["items"];
18822
19026
  }
19027
+ if (node.type === "audience_picker" /* AUDIENCE_PICKER */) {
19028
+ delete configs[AUDIENCE_PICKER_LEVELS_KEY];
19029
+ }
18823
19030
  if (node.type === "section_table" /* SECTION_TABLE */) {
18824
19031
  for (const key2 of Object.keys(configs)) {
18825
19032
  if (!SECTION_TABLE_INPUTS.has(key2)) delete configs[key2];
@@ -19017,6 +19224,50 @@ function collectContextMenuConfigProps(tree, controls, names, menuVariants) {
19017
19224
  walk(tree);
19018
19225
  return props;
19019
19226
  }
19227
+ var audiencePickerHasLevels = (node) => {
19228
+ const levels = node.configs?.[AUDIENCE_PICKER_LEVELS_KEY];
19229
+ return Array.isArray(levels) && levels.length > 0;
19230
+ };
19231
+ function audiencePickerConfigPropNames(tree) {
19232
+ const names = /* @__PURE__ */ new Map();
19233
+ const used = /* @__PURE__ */ new Set();
19234
+ const walk = (nodes) => {
19235
+ nodes.forEach((node) => {
19236
+ if (node.type === "audience_picker" /* AUDIENCE_PICKER */ && audiencePickerHasLevels(node)) {
19237
+ const stem = `audiencePickerConfig${toPascalCase(
19238
+ slugifyComponentName(node.id).slice(0, 8)
19239
+ )}`;
19240
+ let name3 = stem;
19241
+ for (let suffix = 2; used.has(name3); suffix += 1)
19242
+ name3 = `${stem}${suffix}`;
19243
+ used.add(name3);
19244
+ names.set(node.id, name3);
19245
+ }
19246
+ walk(node.childrens);
19247
+ });
19248
+ };
19249
+ walk(tree);
19250
+ return names;
19251
+ }
19252
+ function collectAudiencePickerConfigProps(tree, names) {
19253
+ const props = [];
19254
+ const walk = (nodes) => {
19255
+ nodes.forEach((node) => {
19256
+ const name3 = names.get(node.id);
19257
+ if (node.type === "audience_picker" /* AUDIENCE_PICKER */ && name3 && audiencePickerHasLevels(node)) {
19258
+ props.push({
19259
+ name: name3,
19260
+ configs: {
19261
+ [AUDIENCE_PICKER_LEVELS_KEY]: node.configs?.[AUDIENCE_PICKER_LEVELS_KEY]
19262
+ }
19263
+ });
19264
+ }
19265
+ walk(node.childrens);
19266
+ });
19267
+ };
19268
+ walk(tree);
19269
+ return props;
19270
+ }
19020
19271
  function actionEnums(tree) {
19021
19272
  const propNames = actionButtonPropNames(tree);
19022
19273
  const taken = /* @__PURE__ */ new Set();
@@ -19343,6 +19594,7 @@ var attrBindingSlots = (type) => {
19343
19594
  return [BINDING_SLOT.options, BINDING_SLOT.min, BINDING_SLOT.max];
19344
19595
  }
19345
19596
  if (type === "user" /* USER */) return USER_VALUE_SLOTS;
19597
+ if (type === "audience_picker" /* AUDIENCE_PICKER */) return AUDIENCE_PICKER_VALUE_SLOTS;
19346
19598
  if (type === "img" /* IMG */) return [BINDING_SLOT.src];
19347
19599
  if (type === "remote" /* REMOTE */) return REMOTE_VALUE_SLOTS;
19348
19600
  if (type === "section_pagination" /* SECTION_PAGINATION */) return [BINDING_SLOT.total];
@@ -19622,6 +19874,14 @@ function boundAttrs(node, ctx, storeProp) {
19622
19874
  }
19623
19875
  }
19624
19876
  }
19877
+ if (node.type === "audience_picker" /* AUDIENCE_PICKER */) {
19878
+ const audience = bindings?.[BINDING_SLOT.audience];
19879
+ const audienceExpr = audience ? bindingExpression(audience, scope) : void 0;
19880
+ if (audienceExpr) parts.push(` [audience]="${audienceExpr}"`);
19881
+ const boundSource = bindings?.[BINDING_SLOT.source];
19882
+ const sourceExpr = boundSource ? textBindingExpression(boundSource, scope) : void 0;
19883
+ if (sourceExpr) parts.push(` [source]="${sourceExpr}"`);
19884
+ }
19625
19885
  parts.push(messageParamsAttr(node, ctx, storeProp));
19626
19886
  return parts.join("");
19627
19887
  }
@@ -19639,6 +19899,12 @@ var inSectionHeader = (node, ctx) => {
19639
19899
  return !!parentId && ctx.controlMap?.[parentId]?.type === "section_header" /* SECTION_HEADER */;
19640
19900
  };
19641
19901
  function tagAttrs(node, ctx, storeProp) {
19902
+ if (node.type === "audience_picker" /* AUDIENCE_PICKER */) {
19903
+ const config = ctx.audiencePickerConfigNames?.get(node.id);
19904
+ return `${config ? ` [config]="${config}"` : ""}${inlineAttrs(
19905
+ node
19906
+ )}${boundAttrs(node, ctx, storeProp)}`;
19907
+ }
19642
19908
  if (node.type === "context_menu" /* CONTEXT_MENU */) {
19643
19909
  const binding = ctx.controlMap?.[node.id]?.bindings?.[BINDING_SLOT.options];
19644
19910
  const expr = binding ? bindingExpression(binding, bindingScope(ctx, storeProp)) : void 0;
@@ -19908,10 +20174,10 @@ function outputAttrs(node, methods, operationOf, storeProp, ctx) {
19908
20174
  ...Object.keys(node.outputs ?? {}),
19909
20175
  // An output that only opens a Screen holds nothing in the maps above, and
19910
20176
  // the one call to its overlay member is the whole of what it does
19911
- // (CONTEXT.md OutputOpen).
20177
+ // (GLOSSARY.md OutputOpen).
19912
20178
  ...Object.keys(node.outputOpens ?? {}),
19913
20179
  // An output that only navigates or opens a new tab holds nothing in the
19914
- // maps above either (CONTEXT.md OutputNav, OutputNewTab).
20180
+ // maps above either (GLOSSARY.md OutputNav, OutputNewTab).
19915
20181
  ...Object.keys(node.outputNavs ?? {}),
19916
20182
  ...Object.keys(node.outputNewTabs ?? {}),
19917
20183
  // An output that only fires a ScreenMethod holds nothing in the three maps
@@ -20264,7 +20530,7 @@ function renderTag(node, indent2, names, methods, operationOf, storeProp, ctx, w
20264
20530
  ),
20265
20531
  // A bound ScreenInput reading a path — a row of the Repeat this embed
20266
20532
  // sits in, a StateProperty — emits through the same walk every other
20267
- // bound slot does (CONTEXT.md DataBinding).
20533
+ // bound slot does (GLOSSARY.md DataBinding).
20268
20534
  (binding) => bindingExpression(binding, bindingScope(ctx, storeProp)),
20269
20535
  inputAliases
20270
20536
  );
@@ -20417,6 +20683,7 @@ function planScreenEmit(tree, variants = {}, featureName = "feature", ctx = {})
20417
20683
  overlayNames: overlayPropNames(tree),
20418
20684
  actionButtonNames: actionButtonPropNames(tree),
20419
20685
  contextMenuConfigNames: contextMenuConfigPropNames(tree),
20686
+ audiencePickerConfigNames: audiencePickerConfigPropNames(tree),
20420
20687
  menuVariants: menuVariantLookup(variants, ctx.screenVariants),
20421
20688
  writtenTags
20422
20689
  },
@@ -20434,6 +20701,7 @@ function generateHtml(tree, variants = {}, methods = {}, operationOf = () => voi
20434
20701
  overlayNames: overlayPropNames(tree),
20435
20702
  actionButtonNames: actionButtonPropNames(tree),
20436
20703
  contextMenuConfigNames: contextMenuConfigPropNames(tree),
20704
+ audiencePickerConfigNames: audiencePickerConfigPropNames(tree),
20437
20705
  menuVariants: menuVariantLookup(variants, ctx.screenVariants),
20438
20706
  writtenTags: /* @__PURE__ */ new Set()
20439
20707
  };
@@ -20489,7 +20757,7 @@ function hasOutputBinding(tree, methods, operationOf, constants = {}, functions
20489
20757
  ) !== void 0;
20490
20758
  }) || // A call a wire makes is a call this Screen makes: the rows live inline
20491
20759
  // on the [OutputOpen] rather than in `node.outputs`, so they are asked
20492
- // here or the store would go uninjected (CONTEXT.md OverlayOutput,
20760
+ // here or the store would go uninjected (GLOSSARY.md OverlayOutput,
20493
20761
  // ADR 0144).
20494
20762
  overlayOutputBinds(
20495
20763
  node,
@@ -20516,7 +20784,7 @@ function overlayOutputBinds(node, methods, operationOf, constants, functions, pr
20516
20784
  return Object.entries(node.outputOpens ?? {}).some(
20517
20785
  ([output, open]) => Object.entries(open?.outputs ?? {}).some(
20518
20786
  ([outputId, wire]) => (
20519
- // Every call the wire fires, the further ones too (CONTEXT.md
20787
+ // Every call the wire fires, the further ones too (GLOSSARY.md
20520
20788
  // OutputCall).
20521
20789
  wireBindings(wire).some(
20522
20790
  (binding) => !!wireCallParts(
@@ -21054,7 +21322,7 @@ function outputOpenEmit(node, output, ctx, storeProp, indent2 = " ", methods
21054
21322
  // A `screen` row reads what the embedding class already declares, or walks
21055
21323
  // what that Screen reads — the two expressions a bound ScreenControl input
21056
21324
  // emits, spelled here for a class member rather than a template attribute
21057
- // (CONTEXT.md OutputOpen, ADR 0121).
21325
+ // (GLOSSARY.md OutputOpen, ADR 0121).
21058
21326
  (binding) => {
21059
21327
  const member = screenMemberExpression(binding, ctx);
21060
21328
  return member ? `this.${member}` : void 0;
@@ -22199,7 +22467,7 @@ function armStatements(node, output, arm, payload, eventRoot, selfStore, ctx, ar
22199
22467
  );
22200
22468
  const statements = [
22201
22469
  // What was refused, first: the rows below tidy up behind the dialog rather
22202
- // than ahead of it (CONTEXT.md DenialDialog).
22470
+ // than ahead of it (GLOSSARY.md DenialDialog).
22203
22471
  ...arm === "denied" ? [denialDialogCall(denialDialogOf(rows))] : [],
22204
22472
  ...screenWritesFor(
22205
22473
  node,
@@ -22574,7 +22842,10 @@ function generateStateType(featureName, properties, shapes = {}, enums = [], ini
22574
22842
  )} | undefined;`
22575
22843
  ).join("\n");
22576
22844
  const initialEntries = dataProperties.map((property) => ` ${property.name}: undefined,`).join("\n");
22577
- const imports = [shapeImports, enumImports].filter(Boolean).join("\n");
22845
+ const audienceImport = dataProperties.some(
22846
+ (property) => property.dataType.type === "audience"
22847
+ ) ? `import type { ${AUDIENCE_TYPE_NAME} } from '${AUDIENCE_TYPE_PACKAGE}';` : "";
22848
+ const imports = [shapeImports, enumImports, audienceImport].filter(Boolean).join("\n");
22578
22849
  return `${imports ? `${imports}
22579
22850
 
22580
22851
  ` : ""}export interface ${stateName} {
@@ -22793,7 +23064,7 @@ ${lines.join("\n")}
22793
23064
  "withState"
22794
23065
  ].sort();
22795
23066
  const needsInject = drawn.needsRx || drawn.needsModal || hooks.needsStorage || drawn.needsStorage || storageMethods.needsStorage || // `withProps` injects each SubStore this store holds (ADR 0093).
22796
- held.length > 0 || // A RuleCall injects the root store it asks (CONTEXT.md RuleCall).
23067
+ held.length > 0 || // A RuleCall injects the root store it asks (GLOSSARY.md RuleCall).
22797
23068
  variantGlobalStores.length > 0 || hooks.globalStores.length > 0;
22798
23069
  const coreImports = [
22799
23070
  ...usesComputed ? ["computed"] : [],
@@ -22807,7 +23078,7 @@ ${lines.join("\n")}
22807
23078
  ...emitsBusy ? [BUSY_SIGNAL] : [],
22808
23079
  // A method that asks before it calls — or opens a Screen once it has
22809
23080
  // landed — injects the overlay store, the same way a persisting one injects
22810
- // StorageService (CONTEXT.md CallConfirm, OpenScreen).
23081
+ // StorageService (GLOSSARY.md CallConfirm, OpenScreen).
22811
23082
  ...drawn.needsModal ? [MODAL_STORE] : [],
22812
23083
  // A `denied` arm's refusal is claimed off the library (api ADR 0005).
22813
23084
  ...drawn.needsDenial ? ["claimDenial"] : [],
@@ -22816,7 +23087,7 @@ ${lines.join("\n")}
22816
23087
  // other source's import is (ADR 0184).
22817
23088
  ...hooks.needsSearch ? [SEARCH_QUERY_TOKEN] : [],
22818
23089
  // The store the Feature answers the host's search with — one group onto
22819
- // libs/one's SearchStore, which the nav's panel draws (CONTEXT.md
23090
+ // libs/one's SearchStore, which the nav's panel draws (GLOSSARY.md
22820
23091
  // SearchFeed).
22821
23092
  ...hooks.needsFeed ? SEARCH_FEED_IMPORTS : [],
22822
23093
  ...Array.from(/* @__PURE__ */ new Set([...variantGlobalStores, ...hooks.globalStores])).map(
@@ -22826,7 +23097,7 @@ ${lines.join("\n")}
22826
23097
  const storageImport = oneImports.length ? `import { ${oneImports.join(", ")} } from '@magmonium/one';
22827
23098
  ` : "";
22828
23099
  const functionImports = Array.from(
22829
- Object.values(computeds).map((computed) => functions[computed.functionId]).concat((drawn.functionIds ?? []).map((id) => functions[id])).filter((fn) => !!fn).reduce(
23100
+ Object.values(computeds).map((computed) => functions[computed.functionId]).concat((drawn.functionIds ?? []).map((id) => functions[id])).concat(hooks.feedFunctionId ? [functions[hooks.feedFunctionId]] : []).filter((fn) => !!fn).reduce(
22830
23101
  (byName, fn) => byName.has(fn.name) ? byName : byName.set(fn.name, fn),
22831
23102
  /* @__PURE__ */ new Map()
22832
23103
  ).values()
@@ -23132,6 +23403,7 @@ function generateTs(tree, naming, featureName, variants = {}, methods = {}, oper
23132
23403
  const variantList = listVariants(variants);
23133
23404
  const menuVariants = plan?.ctx.menuVariants ?? menuVariantLookup(variants, ctx.screenVariants);
23134
23405
  const contextMenuConfigNames = plan?.ctx.contextMenuConfigNames ?? contextMenuConfigPropNames(tree);
23406
+ const audiencePickerConfigNames = plan?.ctx.audiencePickerConfigNames ?? audiencePickerConfigPropNames(tree);
23135
23407
  const contextMenuConfigProps = collectContextMenuConfigProps(
23136
23408
  tree,
23137
23409
  ctx.controlMap ?? {},
@@ -23158,6 +23430,15 @@ function generateTs(tree, naming, featureName, variants = {}, methods = {}, oper
23158
23430
  (prop) => ` protected readonly ${prop.name}: ContextMenu = ${overlayConfigLiteral(
23159
23431
  prop.configs
23160
23432
  ).split("\n").join("\n ")};
23433
+ `
23434
+ ).join("\n");
23435
+ const audiencePickerConfigBody = collectAudiencePickerConfigProps(
23436
+ tree,
23437
+ audiencePickerConfigNames
23438
+ ).map(
23439
+ (prop) => ` protected readonly ${prop.name}: AudiencePicker = ${overlayConfigLiteral(
23440
+ prop.configs
23441
+ ).split("\n").join("\n ")};
23161
23442
  `
23162
23443
  ).join("\n");
23163
23444
  const inferredInputs = collectScreenInputs(
@@ -23333,7 +23614,7 @@ ${tables.map(
23333
23614
  (store) => store !== "AuthStore" && callsGlobalStore(ctx.controlMap ?? {}, ctx.screenMethods ?? {}, store)
23334
23615
  );
23335
23616
  const usesAuth = bindsDeployToken || // An output firing one of AuthStore's GlobalMethods reads the same
23336
- // injected member (CONTEXT.md GlobalMethod).
23617
+ // injected member (GLOSSARY.md GlobalMethod).
23337
23618
  callsGlobalStore(
23338
23619
  ctx.controlMap ?? {},
23339
23620
  ctx.screenMethods ?? {},
@@ -23703,7 +23984,7 @@ ${tables.map(
23703
23984
  ctx.functions ?? {}
23704
23985
  );
23705
23986
  return `${angularImports}
23706
- ${`${outcomeHandlersBody}${menuActionHandlersBody}`.includes("$event: MenuItem") ? "import type { MenuItem } from '@magmonium/one';\n" : ""}${contextMenuConfigBody ? "import type { ContextMenu } from '@magmonium/one';\n" : ""}${environmentImport}${inputTypeImports}${importsBlock}${validationImports}${sectionTableImport}${formModelImports}${storeImport}${busyImport}${authImport}${globalStoreImports}${modalImport}${overlayRefImport}${navRefImport}${navRouterImport}${assetOptionsImport}${payloadReaderImport}${screenFunctionImport}
23987
+ ${`${outcomeHandlersBody}${menuActionHandlersBody}`.includes("$event: MenuItem") ? "import type { MenuItem } from '@magmonium/one';\n" : ""}${contextMenuConfigBody ? "import type { ContextMenu } from '@magmonium/one';\n" : ""}${audiencePickerConfigBody ? "import type { AudiencePicker } from '@magmonium/one';\n" : ""}${environmentImport}${inputTypeImports}${importsBlock}${validationImports}${sectionTableImport}${formModelImports}${storeImport}${busyImport}${authImport}${globalStoreImports}${modalImport}${overlayRefImport}${navRefImport}${navRouterImport}${assetOptionsImport}${payloadReaderImport}${screenFunctionImport}
23707
23988
  @Component({
23708
23989
  selector: '${naming.selector}',
23709
23990
  changeDetection: ChangeDetectionStrategy.OnPush,
@@ -23723,7 +24004,7 @@ ${`${outcomeHandlersBody}${menuActionHandlersBody}`.includes("$event: MenuItem")
23723
24004
  width: 100%
23724
24005
  \`,
23725
24006
  })
23726
- export class ${naming.className} {${storeBody}${busyBody}${authBody}${globalStoreBody}${modalBody}${overlayRefBody}${navRefBody}${navRouterBody}${imgApiOriginBody}${inputsBody}${constantsBody}${screenComputedsBody}${variablesBody}${formModelsBody}${screenVariantsBody}${cardsBody}${searchBody}${messageParamsBody}${outputsBody}${wiresBody}${overlayProps}${contextMenuConfigBody}${payloadsBody}${transformMembersBody}${payloadReadersBody}${sectionTablesBody}${checksBody}${screenMethodsBody}${outputOpenBody}${outputLinkBody}${outcomeHandlersBody}${menuActionHandlersBody}${menuConditionBody}${outputArmHandlersBody}${autoCallsBody}}
24007
+ export class ${naming.className} {${storeBody}${busyBody}${authBody}${globalStoreBody}${modalBody}${overlayRefBody}${navRefBody}${navRouterBody}${imgApiOriginBody}${inputsBody}${constantsBody}${screenComputedsBody}${variablesBody}${formModelsBody}${screenVariantsBody}${cardsBody}${searchBody}${messageParamsBody}${outputsBody}${wiresBody}${overlayProps}${contextMenuConfigBody}${audiencePickerConfigBody}${payloadsBody}${transformMembersBody}${payloadReadersBody}${sectionTablesBody}${checksBody}${screenMethodsBody}${outputOpenBody}${outputLinkBody}${outcomeHandlersBody}${menuActionHandlersBody}${menuConditionBody}${outputArmHandlersBody}${autoCallsBody}}
23727
24008
  `;
23728
24009
  }
23729
24010
  function assetName(node) {
@@ -23766,7 +24047,7 @@ function makeOutputOpenRefResolver(host, screens, features, prefix) {
23766
24047
  importFrom: screenImportPath(from, to),
23767
24048
  inputs: Object.values(screen.inputs ?? {}),
23768
24049
  // What the opened Screen emits, so the call site can wire each one
23769
- // (CONTEXT.md OverlayOutput, ADR 0144).
24050
+ // (GLOSSARY.md OverlayOutput, ADR 0144).
23770
24051
  outputs: Object.values(screen.outputs ?? {})
23771
24052
  };
23772
24053
  };
@@ -23941,6 +24222,13 @@ function generateCode(tree, featureName, screenName, properties = {}, variants =
23941
24222
  }
23942
24223
  function generateFeatureCode(feature, context) {
23943
24224
  const { operationOf } = context;
24225
+ const silenced = !!context.silenceSearchFeeds;
24226
+ const subStores = silenced && feature.subStores ? Object.fromEntries(
24227
+ Object.entries(feature.subStores).map(([id, sub]) => [
24228
+ id,
24229
+ { ...sub, searchFeed: void 0 }
24230
+ ])
24231
+ ) : feature.subStores;
23944
24232
  const emittedFeature = {
23945
24233
  id: "",
23946
24234
  name: feature.name,
@@ -23952,8 +24240,8 @@ function generateFeatureCode(feature, context) {
23952
24240
  functions: context.functions,
23953
24241
  ...feature.hook ? { hook: feature.hook } : {},
23954
24242
  ...feature.timers ? { timers: feature.timers } : {},
23955
- ...feature.searchFeed ? { searchFeed: feature.searchFeed } : {},
23956
- ...feature.subStores ? { subStores: feature.subStores } : {}
24243
+ ...feature.searchFeed && !silenced ? { searchFeed: feature.searchFeed } : {},
24244
+ ...subStores ? { subStores } : {}
23957
24245
  };
23958
24246
  const stores = generateStoreFiles(emittedFeature, operationOf, {
23959
24247
  usesBusy: context.usesBusy,
@@ -24048,7 +24336,7 @@ __export(package_exports, {
24048
24336
  version: () => version
24049
24337
  });
24050
24338
  var name = "@magmonium/one";
24051
- var version = "0.4.34";
24339
+ var version = "0.4.37";
24052
24340
  var description = "Magmonium One \u2014 Angular design-system primitives for mm Apps";
24053
24341
  var author = "magmonium";
24054
24342
  var license = "MIT";
@@ -24116,7 +24404,7 @@ __export(package_exports2, {
24116
24404
  version: () => version2
24117
24405
  });
24118
24406
  var name2 = "@magmonium/cli";
24119
- var version2 = "0.8.9";
24407
+ var version2 = "0.8.11";
24120
24408
  var description2 = "A powerful and extensible asset compilation tool that can be shared across multiple projects";
24121
24409
  var bin = {
24122
24410
  "mag-cli": "bin/cli.js"
@@ -24198,15 +24486,6 @@ var CLI_PACKAGE_VERSION = versionOf(package_exports2);
24198
24486
  // libs/codegen/src/model/hand-contract.ts
24199
24487
  var EMPTY_HAND_SCAN = { contracts: {}, skips: [] };
24200
24488
 
24201
- // libs/codegen/src/model/search-feed.ts
24202
- var sanitizeMemberPath = (value) => {
24203
- if (!Array.isArray(value)) return void 0;
24204
- const segments = value.filter(
24205
- (segment) => typeof segment === "string" && !!segment
24206
- );
24207
- return segments.length ? segments : void 0;
24208
- };
24209
-
24210
24489
  // libs/codegen/src/lib/timer-helper.ts
24211
24490
  function isValidTimerName(name3) {
24212
24491
  return /^[a-z][a-zA-Z0-9]*$/.test(name3);
@@ -24430,7 +24709,7 @@ function parseThemeSource(source) {
24430
24709
  // libs/codegen/src/lib/nav-row-helper.ts
24431
24710
  var NAV_ROW_KEYS = ["value", "label"];
24432
24711
  var NAV_ROW_ICON_KEY = "icon";
24433
- var hasStringKey = (shape, name3) => !!shape?.keys.some(
24712
+ var hasStringKey2 = (shape, name3) => !!shape?.keys.some(
24434
24713
  (key2) => key2.name === name3 && key2.dataType.type === "string" && key2.cardinality === "one"
24435
24714
  );
24436
24715
  function isNavRowShape(dataType, cardinality, shapes) {
@@ -24438,14 +24717,14 @@ function isNavRowShape(dataType, cardinality, shapes) {
24438
24717
  if (dataType?.type !== "shape") return false;
24439
24718
  const shape = shapes[dataType.shapeId];
24440
24719
  if (!shape) return false;
24441
- return NAV_ROW_KEYS.every((name3) => hasStringKey(shape, name3));
24720
+ return NAV_ROW_KEYS.every((name3) => hasStringKey2(shape, name3));
24442
24721
  }
24443
24722
  function navRowMiss(dataType, cardinality, shapes) {
24444
24723
  if (cardinality !== "many") return "nav-rows-need-many";
24445
24724
  if (dataType?.type !== "shape") return "nav-rows-need-shape";
24446
24725
  const shape = shapes[dataType.shapeId];
24447
24726
  if (!shape) return "nav-rows-unknown-shape";
24448
- return NAV_ROW_KEYS.every((name3) => hasStringKey(shape, name3)) ? void 0 : "nav-rows-need-keys";
24727
+ return NAV_ROW_KEYS.every((name3) => hasStringKey2(shape, name3)) ? void 0 : "nav-rows-need-keys";
24449
24728
  }
24450
24729
  function findNavRowShapeId(shapes) {
24451
24730
  return Object.values(shapes).find(
@@ -24798,7 +25077,7 @@ var hostRoutesConst = (nav, navMap, targets, outletScreens) => {
24798
25077
  (other) => other.pageId === nav.pageId && isOutletHostNav(other, navMap, targets, outletScreens)
24799
25078
  ).map((other) => other.navId).sort((a, b) => a.localeCompare(b));
24800
25079
  if (first === void 0 || first === nav.navId) return own;
24801
- const below = nav.navId.split(NAV_ID_SEP).slice(1).join("-");
25080
+ const below = nav.navId.split(NAV_ID_SEP2).slice(1).join("-");
24802
25081
  return own.replace(/Routes$/, `${toPascalCase(below)}Routes`);
24803
25082
  };
24804
25083
  var canHostNavChildren = (nav, outletScreens) => (
@@ -25032,7 +25311,7 @@ var pasteNav = (clipboard, targetId, navMap, outletScreens) => {
25032
25311
  };
25033
25312
  }
25034
25313
  const sourceSegment = source.navId.slice(
25035
- source.navId.lastIndexOf(NAV_ID_SEP) + 1
25314
+ source.navId.lastIndexOf(NAV_ID_SEP2) + 1
25036
25315
  );
25037
25316
  const defaultCannotMoveAsDefault = isDefaultNavId(source.navId) && (!isCut || !canHostDefaultChild(destination, outletScreens));
25038
25317
  const rootId = nextNavChildId(
@@ -25046,7 +25325,7 @@ var pasteNav = (clipboard, targetId, navMap, outletScreens) => {
25046
25325
  const parentId = parentNavId(id);
25047
25326
  const parentCopyId = parentId ? remapped.get(parentId) : void 0;
25048
25327
  if (!parentCopyId) return;
25049
- const segment = id.slice(id.lastIndexOf(NAV_ID_SEP) + 1);
25328
+ const segment = id.slice(id.lastIndexOf(NAV_ID_SEP2) + 1);
25050
25329
  remapped.set(id, childNavId(parentCopyId, segment));
25051
25330
  });
25052
25331
  const nextMap = { ...withoutTree };
@@ -25223,21 +25502,21 @@ var sanitizeNavMap = (value) => {
25223
25502
  // Same rule the parameter gets, and for the same reason: a source on a
25224
25503
  // Nav that reads no rows is a computed nothing draws, and one that comes
25225
25504
  // back when the Nav turns dynamic again names a menu the User has since
25226
- // forgotten (CONTEXT.md NavRowSource).
25505
+ // forgotten (GLOSSARY.md NavRowSource).
25227
25506
  ...presentation === "dynamic" && isCompleteRowSource(n.rowSource) ? { rowSource: prunedRowSource(n.rowSource) } : {},
25228
25507
  // And again for the instance source: a resolver on a Nav with no
25229
- // `:<param>` left to resolve names a header nothing reads (CONTEXT.md
25508
+ // `:<param>` left to resolve names a header nothing reads (GLOSSARY.md
25230
25509
  // NavInstanceSource).
25231
25510
  ...presentation === "dynamic" && isCompleteInstanceSource(n.instanceSource) ? { instanceSource: prunedInstanceSource(n.instanceSource) } : {},
25232
25511
  // A gate survives whatever the Nav's presentation turned into — unlike
25233
25512
  // `param`, `rowSource` and `instanceSource` above, it asks nothing of
25234
25513
  // `dynamic`. What it does not survive is the Default Nav claim below it,
25235
25514
  // which is the one shape that makes the guard's redirect a loop
25236
- // (CONTEXT.md NavVisibilitySource).
25515
+ // (GLOSSARY.md NavVisibilitySource).
25237
25516
  ...!platform && n.isDefault !== true && isCompleteVisibilitySource(n.visibilitySource) && n.visibilitySource ? { visibilitySource: prunedVisibilitySource(n.visibilitySource) } : {},
25238
25517
  ...n.isDefault === true ? { isDefault: true } : {},
25239
25518
  // Only a static or dynamic Url Nav routes a tail — the rule
25240
- // `pickedNavTail` holds the inspector to (CONTEXT.md NavTail). Left out,
25519
+ // `pickedNavTail` holds the inspector to (GLOSSARY.md NavTail). Left out,
25241
25520
  // the Tail parameter came back empty on every reload and the emitted
25242
25521
  // route lost its matcher.
25243
25522
  ...routesNavTail({ linkKind, presentation }) && isLegalNavTail(n.tail, { presentation, param: n.param }) ? { tail: n.tail } : {},
@@ -25249,7 +25528,13 @@ var sanitizeNavMap = (value) => {
25249
25528
  ...n.inheritsParams === true ? { inheritsParams: true } : {},
25250
25529
  ...typeof n.pageId === "string" && n.pageId ? { pageId: n.pageId } : {},
25251
25530
  ...typeof n.componentKey === "string" && n.componentKey ? { componentKey: n.componentKey } : result[navId]?.componentKey ? { componentKey: result[navId].componentKey } : {},
25252
- ...platform ? { platform: true } : {}
25531
+ ...platform ? { platform: true } : {},
25532
+ // On `root_search` and nowhere else (GLOSSARY.md 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) } : {}
25253
25538
  };
25254
25539
  }
25255
25540
  for (const navId of Object.keys(result).sort(
@@ -25272,7 +25557,7 @@ var sanitizeNavMap = (value) => {
25272
25557
  }
25273
25558
  }
25274
25559
  for (const navId of Object.keys(result).sort(
25275
- (a, b) => a.split(NAV_ID_SEP).length - b.split(NAV_ID_SEP).length
25560
+ (a, b) => a.split(NAV_ID_SEP2).length - b.split(NAV_ID_SEP2).length
25276
25561
  )) {
25277
25562
  if (result[navId].platform) continue;
25278
25563
  const parentId = parentNavId(navId);
@@ -25393,6 +25678,10 @@ var collectNavIcons = (navMap) => new Set(
25393
25678
  var collectNavLabels = (navMap) => new Set(
25394
25679
  Object.values(navMap).filter((nav) => nav.navId !== ROOT_NAV_ID && nav.platform !== true).map((nav) => nav.label).filter((label) => !!label)
25395
25680
  );
25681
+ var collectSearchLabels = (navMap) => {
25682
+ const key2 = searchLabelKey(navMap);
25683
+ return key2 ? /* @__PURE__ */ new Set([key2]) : /* @__PURE__ */ new Set();
25684
+ };
25396
25685
 
25397
25686
  // libs/codegen/src/lib/function-case-helper.ts
25398
25687
  var caseLiteral = (value) => {
@@ -25680,7 +25969,7 @@ var caseEquals = (actual, expected) => {
25680
25969
  };
25681
25970
 
25682
25971
  // libs/codegen/src/lib/workspace-codec.ts
25683
- var WORKSPACE_SCHEMA_VERSION = 27;
25972
+ var WORKSPACE_SCHEMA_VERSION = 28;
25684
25973
  var MIGRATION_FLOOR = 18;
25685
25974
  var DEPLOY_TOKEN_METHOD_IDS = {
25686
25975
  "@UserStore.ensureDeployToken": "@AuthStore.ensureDeployToken",
@@ -25788,6 +26077,53 @@ var dropOptionMultiple = (control) => {
25788
26077
  if (multiple === void 0) return control;
25789
26078
  return { ...control, configs: rest };
25790
26079
  };
26080
+ var SCHEME = /^[a-z][a-z0-9+.-]*:/i;
26081
+ var murlNavId = (murl) => [
26082
+ ROOT_NAV,
26083
+ ...murl.split(/[/~|]/).filter((s) => s && s !== ROOT_NAV)
26084
+ ].join(NAV_ID_SEP);
26085
+ var moveButtonNavTarget = (control) => {
26086
+ const configs = control["configs"];
26087
+ if (control["type"] !== "button" /* BUTTON */ || !configs || typeof configs !== "object") {
26088
+ return control;
26089
+ }
26090
+ const { url, murl, ...rest } = configs;
26091
+ if (url === void 0 && murl === void 0) return control;
26092
+ const next = { ...control, configs: rest };
26093
+ const directives = control["directives"] ?? {};
26094
+ const navs = control["outputNavs"] ?? {};
26095
+ const opens = control["outputOpens"] ?? {};
26096
+ const taken = !!directives["mModal"] || !!directives["mSidePanel"] || !!directives["routerLink"] || !!navs[BUTTON_CLICK_OUTPUT] || !!opens[BUTTON_CLICK_OUTPUT] || typeof rest["href"] === "string";
26097
+ if (taken) return next;
26098
+ const route = typeof url === "string" ? url.trim() : "";
26099
+ const menu = typeof murl === "string" && murl.trim() ? murl.trim() : route.includes("~") ? route : "";
26100
+ if (route && !route.includes("~")) {
26101
+ if (SCHEME.test(route)) return { ...next, configs: { ...rest, href: route } };
26102
+ const parts = route.split(/[?#]/)[0].split("/").filter(Boolean).map((value) => ({ kind: "static", value }));
26103
+ return {
26104
+ ...next,
26105
+ directives: {
26106
+ ...directives,
26107
+ routerLink: {
26108
+ configs: {
26109
+ ...parts.length ? { parts } : {},
26110
+ mode: route.startsWith("/") ? "absolute" : "relative"
26111
+ }
26112
+ }
26113
+ }
26114
+ };
26115
+ }
26116
+ if (menu) {
26117
+ return {
26118
+ ...next,
26119
+ outputNavs: {
26120
+ ...navs,
26121
+ [BUTTON_CLICK_OUTPUT]: { kind: "nav", navId: murlNavId(menu) }
26122
+ }
26123
+ };
26124
+ }
26125
+ return next;
26126
+ };
25791
26127
  var moveDeployTokenToAuth = (value) => {
25792
26128
  if (typeof value === "string") return DEPLOY_TOKEN_METHOD_IDS[value] ?? value;
25793
26129
  if (Array.isArray(value)) return value.map(moveDeployTokenToAuth);
@@ -25812,6 +26148,9 @@ var screenOnly = (step) => ({
25812
26148
  step
25813
26149
  });
25814
26150
  var MIGRATIONS = {
26151
+ // 27 → 28: a Button's `url`/`murl` move onto its LinkTarget, in a Screen's
26152
+ // ControlMap and in every ControlGroup.
26153
+ 27: everyKind((blob) => mapBlobControls(blob, moveButtonNavTarget)),
25815
26154
  // 26 → 27: a dropdown holds one value; `multiple` leaves the option types,
25816
26155
  // in a Screen's ControlMap and in every ControlGroup.
25817
26156
  26: everyKind((blob) => mapBlobControls(blob, dropOptionMultiple)),
@@ -25897,7 +26236,7 @@ var MIGRATIONS = {
25897
26236
  };
25898
26237
  }),
25899
26238
  // 21 -> 22: a FilterControl's `multiple` boolean becomes a `variant`, which
25900
- // has room for `range` where a boolean did not (CONTEXT.md FilterVariant).
26239
+ // has room for `range` where a boolean did not (GLOSSARY.md FilterVariant).
25901
26240
  //
25902
26241
  // Written explicitly on *every* Filter rather than only on the narrowed
25903
26242
  // ones, because the component's own default flipped with it: `multiple`
@@ -26534,14 +26873,14 @@ function sanitizeFeatures(features, appFunctions, sharedShapes = {}) {
26534
26873
  // Feature saved before ADR 0058 round-trips unchanged.
26535
26874
  ...hook ? { hook } : {},
26536
26875
  // Absent for a store that draws none, so a Feature saved before feeds
26537
- // existed round-trips unchanged (CONTEXT.md SearchFeed, ADR 0184).
26876
+ // existed round-trips unchanged (GLOSSARY.md SearchFeed, ADR 0184).
26538
26877
  ...searchFeed ? { searchFeed } : {},
26539
26878
  // Absent for a Feature that draws none, so a Feature saved before Timers
26540
26879
  // existed round-trips unchanged (ADR 0071).
26541
26880
  ...Object.keys(timers).length ? { timers } : {},
26542
26881
  // The store's one namespace: state keys, computed keys, method names and
26543
26882
  // the reserved `patch` / `variant` all land on one instance surface, so a
26544
- // computed cannot take a name already spoken for (CONTEXT.md
26883
+ // computed cannot take a name already spoken for (GLOSSARY.md
26545
26884
  // StateComputed).
26546
26885
  computeds,
26547
26886
  // Absent for a Feature owning none, so a Feature saved before SubStores
@@ -26558,8 +26897,19 @@ function sanitizeSearchFeed(value, properties) {
26558
26897
  const property = properties[stored.propertyId ?? ""];
26559
26898
  if (!property || property.cardinality !== "many") return void 0;
26560
26899
  if (typeof stored.label !== "string" || !stored.label.trim()) return void 0;
26900
+ const functionId = typeof stored.functionId === "string" && stored.functionId ? stored.functionId : void 0;
26901
+ const args = functionId ? sanitizeFeedArgs(stored.args) : void 0;
26561
26902
  const title = sanitizeMemberPath(stored.title);
26562
- if (!title) return void 0;
26903
+ if (!title && !functionId) return void 0;
26904
+ if (!title) {
26905
+ return {
26906
+ propertyId: property.id,
26907
+ label: stored.label,
26908
+ title: [],
26909
+ functionId,
26910
+ ...args ? { args } : {}
26911
+ };
26912
+ }
26563
26913
  const description3 = sanitizeMemberPath(stored.description);
26564
26914
  const img = sanitizeMemberPath(stored.img);
26565
26915
  const id = sanitizeMemberPath(stored.id);
@@ -26572,9 +26922,24 @@ function sanitizeSearchFeed(value, properties) {
26572
26922
  ...description3 ? { description: description3 } : {},
26573
26923
  ...img ? { img } : {},
26574
26924
  ...id ? { id } : {},
26575
- ...urlMember ? { url: { ...prefix ? { prefix } : {}, member: urlMember } } : {}
26925
+ ...urlMember ? { url: { ...prefix ? { prefix } : {}, member: urlMember } } : {},
26926
+ ...functionId ? { functionId } : {},
26927
+ ...args ? { args } : {}
26576
26928
  };
26577
26929
  }
26930
+ function sanitizeFeedArgs(value) {
26931
+ if (!value || typeof value !== "object") return void 0;
26932
+ const result = {};
26933
+ for (const [id, raw] of Object.entries(value)) {
26934
+ const arg = raw;
26935
+ if (arg?.source === "path" && Array.isArray(arg.path) && arg.path.length && arg.path.every((segment) => typeof segment === "string" && segment)) {
26936
+ result[id] = { source: "path", path: arg.path };
26937
+ } else if (arg?.source === "fixed" && ["string", "number", "boolean"].includes(typeof arg.value)) {
26938
+ result[id] = { source: "fixed", value: arg.value };
26939
+ }
26940
+ }
26941
+ return Object.keys(result).length ? result : void 0;
26942
+ }
26578
26943
  function sanitizeSubStores(value, featureName, shapes, functions) {
26579
26944
  if (!value || typeof value !== "object") return {};
26580
26945
  const result = {};
@@ -26720,7 +27085,7 @@ function sanitizeScreenInputs(inputs, shapes) {
26720
27085
  ...input.required ? { required: true } : {},
26721
27086
  ...input.origin === "card" ? { origin: "card" } : {},
26722
27087
  // A results Screen's search input is minted like a card row and typed
26723
- // like an authored scalar — it is always the bar's text (CONTEXT.md
27088
+ // like an authored scalar — it is always the bar's text (GLOSSARY.md
26724
27089
  // SearchResultsScreen).
26725
27090
  ...input.origin === "search" ? { origin: "search" } : {}
26726
27091
  };
@@ -26956,7 +27321,7 @@ function sanitizeScreenMethods(value, taken) {
26956
27321
  ...Array.isArray(method.screenWrites) && method.screenWrites.length ? { screenWrites: method.screenWrites } : {},
26957
27322
  ...Array.isArray(method.emits) && method.emits.length ? { emits: method.emits } : {},
26958
27323
  ...Array.isArray(method.params) && method.params.length ? { params: sanitizeScreenMethodParams(method.params) } : {},
26959
- // The further calls (CONTEXT.md OutputCall), each trusted the way the
27324
+ // The further calls (GLOSSARY.md OutputCall), each trusted the way the
26960
27325
  // handler's own call is: an object, one of the two ids at most.
26961
27326
  ...Array.isArray(method.calls) && method.calls.length ? { calls: sanitizeScreenMethodCalls(method.calls) } : {}
26962
27327
  };
@@ -27747,7 +28112,7 @@ function buildDesignSource(ws, operations = drawnOperations(ws)) {
27747
28112
  functions: ws.functions,
27748
28113
  sharedShapes: ws.sharedShapes ?? {},
27749
28114
  distinct: ws.distinct ?? [],
27750
- // Travels though CONTEXT.md files it beside AiProvider: that grouping is
28115
+ // Travels though GLOSSARY.md files it beside AiProvider: that grouping is
27751
28116
  // Reset Project's scope, not disk. This is a list of package names and
27752
28117
  // semver ranges Download already merges into `package.json`, and it cannot
27753
28118
  // be rederived from there — `package.json` cannot say which of its
@@ -27962,7 +28327,7 @@ function buildTree(controlMap, rootControlIds, selection) {
27962
28327
  ...ctrl.source ? { source: ctrl.source } : {},
27963
28328
  ...ctrl.variants?.length ? { variants: ctrl.variants } : {},
27964
28329
  // Carried through so renderBranch can order the `@else` last and spell it
27965
- // without reaching back into ControlMap mid-walk (CONTEXT.md DefaultArm).
28330
+ // without reaching back into ControlMap mid-walk (GLOSSARY.md DefaultArm).
27966
28331
  ...ctrl.armKind ? { armKind: ctrl.armKind } : {},
27967
28332
  ...ctrl.variantKind ? { variantKind: ctrl.variantKind } : {},
27968
28333
  ...ctrl.outputs && Object.keys(ctrl.outputs).length ? { outputs: ctrl.outputs } : {},
@@ -27977,11 +28342,11 @@ function buildTree(controlMap, rootControlIds, selection) {
27977
28342
  // Without this the codegen walk reads `outputArms` off a Tree that never
27978
28343
  // carried it, every gated output falls back to ungated, and its groups —
27979
28344
  // filed under `<output>|arm:<armId>` — are skipped as qualified keys. The
27980
- // output emits nothing at all (CONTEXT.md OutputArm).
28345
+ // output emits nothing at all (GLOSSARY.md OutputArm).
27981
28346
  ...ctrl.outputArms && Object.keys(ctrl.outputArms).length ? { outputArms: ctrl.outputArms } : {},
27982
28347
  // Without this every group fires its first call alone: the rest are
27983
28348
  // filed under `<group>|call:<callId>` and read in the order this holds
27984
- // (CONTEXT.md OutputCall).
28349
+ // (GLOSSARY.md OutputCall).
27985
28350
  ...ctrl.outputCalls && Object.keys(ctrl.outputCalls).length ? { outputCalls: ctrl.outputCalls } : {},
27986
28351
  ...ctrl.outputScreenMethods && Object.keys(ctrl.outputScreenMethods).length ? { outputScreenMethods: ctrl.outputScreenMethods } : {},
27987
28352
  ...ctrl.menuActions?.length ? { menuActions: ctrl.menuActions } : {},
@@ -28005,7 +28370,7 @@ function buildTree(controlMap, rootControlIds, selection) {
28005
28370
  ...ctrl.search ? { search: ctrl.search } : {},
28006
28371
  // A Repeat's row count, carried for `cards`' reason: the Canvas draws
28007
28372
  // its sample rows from the Tree alone. Nothing else reads it — codegen
28008
- // never emits a count (CONTEXT.md SampleValue).
28373
+ // never emits a count (GLOSSARY.md SampleValue).
28009
28374
  ...ctrl.repeat?.sampleRows !== void 0 ? { sampleRows: ctrl.repeat.sampleRows } : {},
28010
28375
  ...fullyFaded ? { faded: true } : {}
28011
28376
  };
@@ -28112,13 +28477,16 @@ var navWidgetBindings = (navMap, screens, prefix, features = []) => {
28112
28477
  const mountable = new Map(
28113
28478
  screens.filter((s) => s.kind === "app_widget" || s.kind === "feature").map((s) => [s.id, s])
28114
28479
  );
28115
- return Object.values(navMap).flatMap((nav) => {
28480
+ const panels = Object.values(navMap).flatMap((nav) => {
28116
28481
  const screenId = nav.presentation === "component" ? nav.componentKey : nav.presentation === "dynamic" && nav.rowSource?.kind === "screen" ? nav.rowSource.screenId : void 0;
28117
- return screenId ? [{ nav, screenId }] : [];
28118
- }).sort((a, b) => a.nav.navId.localeCompare(b.nav.navId)).flatMap(({ nav, screenId }) => {
28482
+ return screenId ? [{ navId: nav.navId, screenId }] : [];
28483
+ }).sort((a, b) => a.navId.localeCompare(b.navId));
28484
+ const answerScreenId = searchAnswerScreenId(navMap);
28485
+ const answer = answerScreenId ? [{ navId: SEARCH_ANSWER_KEY, screenId: answerScreenId }] : [];
28486
+ return [...panels, ...answer].flatMap(({ navId, screenId }) => {
28119
28487
  const screen = mountable.get(screenId);
28120
28488
  const naming = screen && panelNaming(screen, prefix, features);
28121
- return naming ? [{ navId: nav.navId, ...naming }] : [];
28489
+ return naming ? [{ navId, ...naming }] : [];
28122
28490
  });
28123
28491
  };
28124
28492
  var exposedScreenBindings = (screens, prefix, features = []) => {
@@ -28395,6 +28763,7 @@ var navVisibilityBindings = (navMap, features, methodArgNamesOf = () => []) => {
28395
28763
  var loadCallArgs = (names = [], expressions = []) => names.length ? `{ ${names.map((name3, index) => `${name3}: ${expressions[index] ?? "undefined"}`).join(", ")} }` : "";
28396
28764
  var navProvidersGeneratedFile = (navMap, screens, prefix, appName, controlMaps = [], features = [], methodArgNamesOf = () => []) => {
28397
28765
  const bindings = navWidgetBindings(navMap, screens, prefix, features);
28766
+ const labelKey = searchLabelKey(navMap);
28398
28767
  const rowSources = navRowSourceBindings(navMap, features);
28399
28768
  const instanceSources = navInstanceSourceBindings(
28400
28769
  navMap,
@@ -28552,7 +28921,14 @@ var navProvidersGeneratedFile = (navMap, screens, prefix, appName, controlMaps =
28552
28921
  navInstance: (params: Record<string, string>) =>${block2 ? " " : ""}${body},${load}
28553
28922
  },`;
28554
28923
  }).join("\n");
28555
- const allEntries = [entries, rowEntries, instanceEntries, visibilityEntries].filter(Boolean).join("\n");
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");
28556
28932
  const widgetMapLiteral = allEntries ? `{
28557
28933
  ${allEntries}
28558
28934
  }` : "{}";
@@ -28588,8 +28964,8 @@ ${exposed.map((b) => ` '${b.name}': ${b.className},`).join("\n")}
28588
28964
 
28589
28965
  // libs/codegen/src/lib/nav-routes-helper.ts
28590
28966
  var navRoutesPath = (appName) => `src/app/${appFileBase(appName)}.router.ts`;
28591
- var routePathFor = (navId, navMap, landing) => navId.split(NAV_ID_SEP).slice(1).flatMap((segment, i, all) => {
28592
- const id = [ROOT_NAV_ID, ...all.slice(0, i + 1)].join(NAV_ID_SEP);
28967
+ var routePathFor = (navId, navMap, landing) => navId.split(NAV_ID_SEP2).slice(1).flatMap((segment, i, all) => {
28968
+ const id = [ROOT_NAV_ID, ...all.slice(0, i + 1)].join(NAV_ID_SEP2);
28593
28969
  const own = id === landing || isDefaultNavId(id) ? [] : [segment];
28594
28970
  const nav = navMap[id];
28595
28971
  return nav?.presentation === "dynamic" ? [navDynamicSegment(nav)] : own;
@@ -28814,7 +29190,7 @@ var packageJson = (appName, version3, extraDeps = {}) => JSON.stringify(
28814
29190
  rxjs: "~7.8.0",
28815
29191
  "socket.io-client": "^4.8.3",
28816
29192
  tslib: "^2.3.0",
28817
- // Workspace npm allowlist (CONTEXT.md NpmAllowlist) — packages a
29193
+ // Workspace npm allowlist (GLOSSARY.md NpmAllowlist) — packages a
28818
29194
  // PureFunction was approved to import. Sorted by Object.assign order
28819
29195
  // of the spread; npm does not care about key order.
28820
29196
  ...extraDeps
@@ -29520,7 +29896,7 @@ ${p2.required?.length ? ` required: [${p2.required.join(", ")}]
29520
29896
  ).join("")}` : "";
29521
29897
  var remoteManifest = (app, appName, config, className, selector, plugins) => `app: ${app}
29522
29898
  version: ${config.version}
29523
- name: ${appDisplayName(appName)}
29899
+ name: ${config.name?.trim() || appDisplayName(appName)}
29524
29900
  description: ${config.description}
29525
29901
  company: ${config.company}
29526
29902
  componentPath: src/app
@@ -30909,7 +31285,7 @@ ${block("renders before anything it reads has loaded", [
30909
31285
  const pluginBlock = plugins.length ? `
30910
31286
  describe(${quote4(`${className} plugins`)}, () => {
30911
31287
  // Every PluginControl this Screen places: its app, its Exposed Screen, the
30912
- // inputs it binds and the outputs it hears (CONTEXT.md PluginControl).
31288
+ // inputs it binds and the outputs it hears (GLOSSARY.md PluginControl).
30913
31289
  const PLUGINS = ${JSON.stringify(plugins)};
30914
31290
 
30915
31291
  ${block(
@@ -31152,7 +31528,7 @@ var screenCtxOf = (ws, meta, controlMap) => {
31152
31528
  // reachable — an overlay opens a body rather than embedding a Screen, so
31153
31529
  // nothing about the host Screen's filing narrows the list; what its filing
31154
31530
  // decides is only the import path the loader is written with.
31155
- // The Screen a Control's output opens when it fires (CONTEXT.md
31531
+ // The Screen a Control's output opens when it fires (GLOSSARY.md
31156
31532
  // OutputOpen). Resolved from this Screen rather than from the Feature: the
31157
31533
  // loader is written into this Screen's own class, so the path is relative
31158
31534
  // to its `ui/` folder.
@@ -31174,7 +31550,7 @@ var screenCtxOf = (ws, meta, controlMap) => {
31174
31550
  // the Feature's own on a Feature owning no SubStore.
31175
31551
  computeds: feature && readableMembers(feature, MAIN_STORE_OWNER).computeds,
31176
31552
  // The Feature's StateProperties and the shapes they are typed by — what a
31177
- // DataBinding walks to spell a read (CONTEXT.md DataBinding). Feature-owned
31553
+ // DataBinding walks to spell a read (GLOSSARY.md DataBinding). Feature-owned
31178
31554
  // like `computeds`, so a storeless Screen is handed neither and its bindings
31179
31555
  // reach ScreenInputs, ScreenComputeds and BindingAliases alone (ADR 0040).
31180
31556
  properties: feature && readableMembers(feature, MAIN_STORE_OWNER).properties,
@@ -31212,13 +31588,13 @@ var screenCtxOf = (ws, meta, controlMap) => {
31212
31588
  screenMethods: meta.methods,
31213
31589
  // The Controls themselves, for the FieldChecks their forms carry — reached
31214
31590
  // from the map rather than the Tree so a form inside a Modal is not missed
31215
- // (CONTEXT.md FieldCheck, ADR 0004).
31591
+ // (GLOSSARY.md FieldCheck, ADR 0004).
31216
31592
  controlMap,
31217
31593
  // The Nav tree, for the dynamic segments an OutcomeNav's target needs
31218
31594
  // filled before its row may emit (ADR 0142).
31219
31595
  navMap: ws.navMap,
31220
31596
  // The NavTail routing this Screen, which a `tail` RemoteControl reads its
31221
- // raw rest from (CONTEXT.md NavTail).
31597
+ // raw rest from (GLOSSARY.md NavTail).
31222
31598
  navTail: Object.values(ws.navMap).find(
31223
31599
  (nav) => nav.pageId === meta.id && nav.tail !== void 0
31224
31600
  )?.tail,
@@ -31245,7 +31621,7 @@ var featureContextOf = (ws, feature) => ({
31245
31621
  ),
31246
31622
  usesBusy: featureUsesBusy(ws, feature.id),
31247
31623
  armed: featureMethodArms(ws, feature.id),
31248
- // The Screen a StoreMethod opens once it has landed (CONTEXT.md OpenScreen).
31624
+ // The Screen a StoreMethod opens once it has landed (GLOSSARY.md OpenScreen).
31249
31625
  // Resolved from the Feature rather than from any Screen: the store opens it,
31250
31626
  // so the import is written from `lib/`.
31251
31627
  openScreenRef: makeOpenScreenRefResolver(
@@ -31253,7 +31629,9 @@ var featureContextOf = (ws, feature) => ({
31253
31629
  ws.screens.map((screen) => screen.meta),
31254
31630
  ws.features,
31255
31631
  prefixOf(ws)
31256
- )
31632
+ ),
31633
+ // A `screen` SearchAnswer takes the search panel whole (ADR 0190).
31634
+ silenceSearchFeeds: !!searchAnswerScreenId(ws.navMap)
31257
31635
  });
31258
31636
  var featureMethodArms = (ws, featureId) => featureId ? methodArms(
31259
31637
  ws.screens.filter(
@@ -31515,6 +31893,10 @@ var emitAuthoredAssets = (ws, stringify) => {
31515
31893
  });
31516
31894
  collectTranslationAssets(map, ws.translations, [
31517
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),
31518
31900
  ...Object.values(ws.features).flatMap(
31519
31901
  (feature) => methodConfirmKeys(feature.methods)
31520
31902
  ),
@@ -31598,7 +31980,21 @@ var allowlistDeps = (ws) => Object.fromEntries(
31598
31980
  var SHIPPED_SHELL_PATHS = [
31599
31981
  "package.json",
31600
31982
  ".github/workflows/ci.yml",
31601
- ".github/workflows/cd.yml"
31983
+ ".github/workflows/cd.yml",
31984
+ // The shell named after the AppLink — class, selector, the generated
31985
+ // overlay it imports (`./<app>.router`), the build's output folder. Written
31986
+ // once, a renamed App's manifest says `store` while these still import
31987
+ // `./app.router` and build `dist/app`, and the bundle never compiles.
31988
+ "angular.json",
31989
+ "module-federation.config.ts",
31990
+ "webpack.config.ts",
31991
+ "src/index.html",
31992
+ "src/bootstrap.ts",
31993
+ "src/styles.sass",
31994
+ "src/app/wc.ts",
31995
+ "src/app/wc.config.ts",
31996
+ "src/app/wc.routes.ts",
31997
+ "src/app/providers.ts"
31602
31998
  ];
31603
31999
  var emitShippedShellFiles = (authored) => {
31604
32000
  const ws = inReach(authored);
@@ -31610,15 +32006,14 @@ var emitShippedShellFiles = (authored) => {
31610
32006
  pluginContractsOf(ws)
31611
32007
  ).filter((file) => SHIPPED_SHELL_PATHS.includes(file.path)).map((file) => ({ path: file.path, contents: file.contents }));
31612
32008
  };
32009
+ var isRemoteManifestPath = (path) => /^mag_assets(_env\/[^/]+)?\/remote\/[^/]+\.yml$/.test(path);
31613
32010
  var remoteManifestFiles = (ws) => scaffoldFiles(
31614
32011
  ws.appTarget.appName,
31615
32012
  ws.wcConfig,
31616
32013
  ws.appTarget.environment,
31617
32014
  {},
31618
32015
  pluginContractsOf(ws)
31619
- ).filter(
31620
- (file) => file.path.startsWith("mag_assets/remote/") && file.path.endsWith(".yml")
31621
- ).map((file) => ({ path: file.path, contents: file.contents }));
32016
+ ).filter((file) => isRemoteManifestPath(file.path)).map((file) => ({ path: file.path, contents: file.contents }));
31622
32017
  var emitOverlayFiles = (authored, stringify) => {
31623
32018
  const ws = inReach(authored);
31624
32019
  const files3 = emitScreenCode(ws, stringify);
@@ -31687,7 +32082,7 @@ var HISTORY_LABELS = [
31687
32082
  "cut-control",
31688
32083
  "duplicate-control",
31689
32084
  // The Screen Map's paste: one step for both halves of a cut, the source
31690
- // Screen's slot riding it beside the target's (CONTEXT.md ScreenLink).
32085
+ // Screen's slot riding it beside the target's (GLOSSARY.md ScreenLink).
31691
32086
  "paste-screen-link",
31692
32087
  "paste-control",
31693
32088
  "edit-control",
@@ -31751,6 +32146,11 @@ var HISTORY_SELECTION_KEYS = [
31751
32146
  ASSET_DIRECTIVE_KEY,
31752
32147
  ASSET_ROOT,
31753
32148
  ASSET_TIERS,
32149
+ AUDIENCE_PICKER_LEVELS_KEY,
32150
+ AUDIENCE_PICKER_VALUE_LABEL,
32151
+ AUDIENCE_PICKER_VALUE_SLOTS,
32152
+ AUDIENCE_TYPE_NAME,
32153
+ AUDIENCE_TYPE_PACKAGE,
31754
32154
  AUTH_EXPRESSION,
31755
32155
  AUTH_PROPERTIES,
31756
32156
  BASE_THEME_FOR_MODE,
@@ -31763,6 +32163,7 @@ var HISTORY_SELECTION_KEYS = [
31763
32163
  BUSY_SIGNAL,
31764
32164
  BUSY_VARIANT_ID,
31765
32165
  BUSY_VARIANT_NAME,
32166
+ BUTTON_CLICK_OUTPUT,
31766
32167
  CALL_ARG_SOURCES,
31767
32168
  CALL_ARG_TRANSFORM_LEAVES,
31768
32169
  CALL_CONDITION_KINDS,
@@ -31887,6 +32288,7 @@ var HISTORY_SELECTION_KEYS = [
31887
32288
  LIB_SEGMENT,
31888
32289
  LIGHT_SURFACE_MIN_LUMINANCE,
31889
32290
  LIMIT_CHECK_KINDS,
32291
+ LINK_TARGET_KINDS,
31890
32292
  LIST_ITEMS_KEY,
31891
32293
  LIST_ROW_ID_KEY,
31892
32294
  LIST_ROW_LABEL_KEY,
@@ -31976,9 +32378,15 @@ var HISTORY_SELECTION_KEYS = [
31976
32378
  ROUTER_LINK_MODES,
31977
32379
  SCREEN_METHOD_FORBIDDEN_SOURCE,
31978
32380
  SCREEN_SOURCE_SEP,
32381
+ SEARCH_ANSWER_KEY,
32382
+ SEARCH_ANSWER_KINDS,
31979
32383
  SEARCH_FEED_IMPORTS,
32384
+ SEARCH_LABEL_KEY,
32385
+ SEARCH_NAV_ID,
31980
32386
  SEARCH_QUERY_LOCAL,
31981
32387
  SEARCH_QUERY_TOKEN,
32388
+ SEARCH_RESULT_KEYS,
32389
+ SEARCH_RESULT_OPTIONAL_KEYS,
31982
32390
  SEARCH_STORE,
31983
32391
  SEARCH_STORE_LOCAL,
31984
32392
  SEARCH_TEXT_INPUT,
@@ -32185,6 +32593,7 @@ var HISTORY_SELECTION_KEYS = [
32185
32593
  collectReferencedTranslations,
32186
32594
  collectScreenWires,
32187
32595
  collectSearchEmits,
32596
+ collectSearchLabels,
32188
32597
  collectThemeAssets,
32189
32598
  collectTranslationAssets,
32190
32599
  collectTypedComponentInputs,
@@ -32589,6 +32998,7 @@ var HISTORY_SELECTION_KEYS = [
32589
32998
  isRedirectRoute,
32590
32999
  isReferencedByRule,
32591
33000
  isReleaseVersion,
33001
+ isRemoteManifestPath,
32592
33002
  isRepeatFamily,
32593
33003
  isReservedFeatureName,
32594
33004
  isReservedVariantId,
@@ -32602,6 +33012,8 @@ var HISTORY_SELECTION_KEYS = [
32602
33012
  isRuntimePath,
32603
33013
  isScreenMemberBinding,
32604
33014
  isScreenOwnedKind,
33015
+ isSearchFeedFunction,
33016
+ isSearchResultShape,
32605
33017
  isSectionHeaderSlotFamily,
32606
33018
  isSharedIconName,
32607
33019
  isSharedShapeId,
@@ -32653,6 +33065,7 @@ var HISTORY_SELECTION_KEYS = [
32653
33065
  levelStateComputeds,
32654
33066
  libImportsFrom,
32655
33067
  linkDrift,
33068
+ linkTargetKind,
32656
33069
  linkedVariableReaders,
32657
33070
  listAssetName,
32658
33071
  listDataProperties,
@@ -33057,6 +33470,8 @@ var HISTORY_SELECTION_KEYS = [
33057
33470
  sanitizeNavMap,
33058
33471
  sanitizeNpmAllowlist,
33059
33472
  sanitizePalette,
33473
+ sanitizeSearchAnswer,
33474
+ sanitizeSearchLabel,
33060
33475
  sanitizeTransform,
33061
33476
  sanitizeWcConfig,
33062
33477
  saveAppTarget,
@@ -33129,7 +33544,10 @@ var HISTORY_SELECTION_KEYS = [
33129
33544
  screenWriteValueKinds,
33130
33545
  screensOfFeature,
33131
33546
  screensOfKind,
33547
+ searchAnswerScreenId,
33132
33548
  searchEmit,
33549
+ searchFeedArgsComplete,
33550
+ searchLabelKey,
33133
33551
  searchMemberName,
33134
33552
  searchSpec,
33135
33553
  searchTextInput,