@magmonium/cli 0.8.8 → 0.8.10

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,14 @@ __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_NAV_ID: () => SEARCH_NAV_ID,
264
274
  SEARCH_QUERY_LOCAL: () => SEARCH_QUERY_LOCAL,
265
275
  SEARCH_QUERY_TOKEN: () => SEARCH_QUERY_TOKEN,
276
+ SEARCH_RESULT_KEYS: () => SEARCH_RESULT_KEYS,
277
+ SEARCH_RESULT_OPTIONAL_KEYS: () => SEARCH_RESULT_OPTIONAL_KEYS,
266
278
  SEARCH_STORE: () => SEARCH_STORE,
267
279
  SEARCH_STORE_LOCAL: () => SEARCH_STORE_LOCAL,
268
280
  SEARCH_TEXT_INPUT: () => SEARCH_TEXT_INPUT,
@@ -873,6 +885,7 @@ __export(index_exports, {
873
885
  isRedirectRoute: () => isRedirectRoute,
874
886
  isReferencedByRule: () => isReferencedByRule,
875
887
  isReleaseVersion: () => isReleaseVersion,
888
+ isRemoteManifestPath: () => isRemoteManifestPath,
876
889
  isRepeatFamily: () => isRepeatFamily,
877
890
  isReservedFeatureName: () => isReservedFeatureName,
878
891
  isReservedVariantId: () => isReservedVariantId,
@@ -886,6 +899,8 @@ __export(index_exports, {
886
899
  isRuntimePath: () => isRuntimePath,
887
900
  isScreenMemberBinding: () => isScreenMemberBinding,
888
901
  isScreenOwnedKind: () => isScreenOwnedKind,
902
+ isSearchFeedFunction: () => isSearchFeedFunction,
903
+ isSearchResultShape: () => isSearchResultShape,
889
904
  isSectionHeaderSlotFamily: () => isSectionHeaderSlotFamily,
890
905
  isSharedIconName: () => isSharedIconName,
891
906
  isSharedShapeId: () => isSharedShapeId,
@@ -937,6 +952,7 @@ __export(index_exports, {
937
952
  levelStateComputeds: () => levelStateComputeds,
938
953
  libImportsFrom: () => libImportsFrom,
939
954
  linkDrift: () => linkDrift,
955
+ linkTargetKind: () => linkTargetKind,
940
956
  linkedVariableReaders: () => linkedVariableReaders,
941
957
  listAssetName: () => listAssetName,
942
958
  listDataProperties: () => listDataProperties,
@@ -1341,6 +1357,7 @@ __export(index_exports, {
1341
1357
  sanitizeNavMap: () => sanitizeNavMap,
1342
1358
  sanitizeNpmAllowlist: () => sanitizeNpmAllowlist,
1343
1359
  sanitizePalette: () => sanitizePalette,
1360
+ sanitizeSearchAnswer: () => sanitizeSearchAnswer,
1344
1361
  sanitizeTransform: () => sanitizeTransform,
1345
1362
  sanitizeWcConfig: () => sanitizeWcConfig,
1346
1363
  saveAppTarget: () => saveAppTarget,
@@ -1413,7 +1430,9 @@ __export(index_exports, {
1413
1430
  screenWriteValueKinds: () => screenWriteValueKinds,
1414
1431
  screensOfFeature: () => screensOfFeature,
1415
1432
  screensOfKind: () => screensOfKind,
1433
+ searchAnswerScreenId: () => searchAnswerScreenId,
1416
1434
  searchEmit: () => searchEmit,
1435
+ searchFeedArgsComplete: () => searchFeedArgsComplete,
1417
1436
  searchMemberName: () => searchMemberName,
1418
1437
  searchSpec: () => searchSpec,
1419
1438
  searchTextInput: () => searchTextInput,
@@ -1668,6 +1687,7 @@ var ControlType = /* @__PURE__ */ ((ControlType2) => {
1668
1687
  ControlType2["SECTION_BUTTON_GROUP"] = "section_button_group";
1669
1688
  ControlType2["BUTTON"] = "button";
1670
1689
  ControlType2["CONTEXT_MENU"] = "context_menu";
1690
+ ControlType2["AUDIENCE_PICKER"] = "audience_picker";
1671
1691
  ControlType2["ROUTER_OUTLET"] = "router_outlet";
1672
1692
  ControlType2["REMOTE"] = "remote";
1673
1693
  ControlType2["PLUGIN"] = "plugin";
@@ -1753,6 +1773,8 @@ var LIMIT_CHECK_KINDS = [
1753
1773
  var isOverlayType = (type) => type === "modal" /* MODAL */ || type === "side_panel" /* SIDE_PANEL */;
1754
1774
  var OPTION_ROW_TYPE_NAME = "DropdownOption";
1755
1775
  var OPTION_ROW_TYPE_PACKAGE = "@magmonium/one";
1776
+ var AUDIENCE_TYPE_NAME = "Audience";
1777
+ var AUDIENCE_TYPE_PACKAGE = "@magmonium/one";
1756
1778
  var isMapCardinality = (cardinality) => cardinality === "map" || cardinality === "map-many";
1757
1779
  var SHARED_SHAPE_ID_PREFIX = "shared-";
1758
1780
  var isSharedShapeId = (id) => !!id && id.startsWith(SHARED_SHAPE_ID_PREFIX);
@@ -2476,7 +2498,7 @@ function tsTypeExpression(shapes, dataType, cardinality, actionEnumName = () =>
2476
2498
  const shapeKey = shapeKeyOf(dataType);
2477
2499
  const interfaceNameOf = dataType?.type === "form" ? formInterfaceName : shapeInterfaceName;
2478
2500
  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";
2501
+ 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
2502
  const named = element || "unknown";
2481
2503
  if (cardinality === "many") return `${named}[]`;
2482
2504
  if (cardinality === "map-many") return `Record<string, ${named}[]>`;
@@ -2497,6 +2519,7 @@ function generateShapeInterface(shapes, shape, options = {}) {
2497
2519
  isSharedShapeId(shape.id) ? "shared-type" : "slice-type"
2498
2520
  )}';`
2499
2521
  ).join("\n") : "";
2522
+ const audienceImport = (options.imports ?? true) && shape.keys.some((key2) => key2.dataType.type === "audience") ? `import type { ${AUDIENCE_TYPE_NAME} } from '${AUDIENCE_TYPE_PACKAGE}';` : "";
2500
2523
  const members = shape.keys.map(
2501
2524
  (key2) => ` ${key2.name}: ${tsTypeExpression(
2502
2525
  shapes,
@@ -2504,10 +2527,12 @@ function generateShapeInterface(shapes, shape, options = {}) {
2504
2527
  key2.cardinality
2505
2528
  )};`
2506
2529
  ).join("\n");
2507
- const head = imports ? `${imports}
2530
+ const head = [imports, audienceImport].filter(Boolean).join("\n");
2531
+ return `${head ? `${head}
2508
2532
 
2509
- ` : "";
2510
- return `${head}export interface ${shapeInterfaceName(shape.name)} {
2533
+ ` : ""}export interface ${shapeInterfaceName(
2534
+ shape.name
2535
+ )} {
2511
2536
  ${members}
2512
2537
  }
2513
2538
  `;
@@ -2570,6 +2595,7 @@ var TOTAL_COLUMNS = 12;
2570
2595
  // libs/one/src/lib/features/nav/model/nav.ts
2571
2596
  var ROOT_NAV = "root";
2572
2597
  var DEFAULT_NAV_SEGMENT = "default";
2598
+ var NAV_ID_SEP = "_";
2573
2599
 
2574
2600
  // libs/one/src/lib/features/nav/model/platform-nav.ts
2575
2601
  var PLATFORM_BUTTON_NAV_IDS = [
@@ -3095,6 +3121,7 @@ var CONTROL_RELATIONSHIPS = {
3095
3121
  "section_button_group" /* SECTION_BUTTON_GROUP */,
3096
3122
  "button" /* BUTTON */,
3097
3123
  "context_menu" /* CONTEXT_MENU */,
3124
+ "audience_picker" /* AUDIENCE_PICKER */,
3098
3125
  "router_outlet" /* ROUTER_OUTLET */,
3099
3126
  "screen" /* SCREEN */,
3100
3127
  "variant_branch" /* VARIANT_BRANCH */,
@@ -3102,7 +3129,7 @@ var CONTROL_RELATIONSHIPS = {
3102
3129
  ],
3103
3130
  // A slide body and nothing else — what a slide holds is the ContentControl
3104
3131
  // 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
3132
+ // (GLOSSARY.md ContentControl, ADR 0070). A carousel naming a Screen per slide
3106
3133
  // draws no body here at all: that Screen is the body.
3107
3134
  ["section_carousel" /* SECTION_CAROUSEL */]: ["content" /* CONTENT */],
3108
3135
  // A row body and nothing else, for the carousel's reason above — a List's
@@ -3138,6 +3165,7 @@ var CONTROL_RELATIONSHIPS = {
3138
3165
  "section_button_group" /* SECTION_BUTTON_GROUP */,
3139
3166
  "button" /* BUTTON */,
3140
3167
  "context_menu" /* CONTEXT_MENU */,
3168
+ "audience_picker" /* AUDIENCE_PICKER */,
3141
3169
  "screen" /* SCREEN */,
3142
3170
  "variant_branch" /* VARIANT_BRANCH */,
3143
3171
  "repeat" /* REPEAT */
@@ -3165,6 +3193,7 @@ var CONTROL_RELATIONSHIPS = {
3165
3193
  "section_button_group" /* SECTION_BUTTON_GROUP */,
3166
3194
  "button" /* BUTTON */,
3167
3195
  "context_menu" /* CONTEXT_MENU */,
3196
+ "audience_picker" /* AUDIENCE_PICKER */,
3168
3197
  "router_outlet" /* ROUTER_OUTLET */,
3169
3198
  "screen" /* SCREEN */,
3170
3199
  "variant_branch" /* VARIANT_BRANCH */,
@@ -3194,6 +3223,7 @@ var CONTROL_RELATIONSHIPS = {
3194
3223
  "section_button_group" /* SECTION_BUTTON_GROUP */,
3195
3224
  "button" /* BUTTON */,
3196
3225
  "context_menu" /* CONTEXT_MENU */,
3226
+ "audience_picker" /* AUDIENCE_PICKER */,
3197
3227
  "router_outlet" /* ROUTER_OUTLET */,
3198
3228
  "screen" /* SCREEN */,
3199
3229
  "variant_branch" /* VARIANT_BRANCH */,
@@ -3227,6 +3257,7 @@ var CONTROL_RELATIONSHIPS = {
3227
3257
  "section_button_group" /* SECTION_BUTTON_GROUP */,
3228
3258
  "button" /* BUTTON */,
3229
3259
  "context_menu" /* CONTEXT_MENU */,
3260
+ "audience_picker" /* AUDIENCE_PICKER */,
3230
3261
  "router_outlet" /* ROUTER_OUTLET */,
3231
3262
  "screen" /* SCREEN */,
3232
3263
  "variant_branch" /* VARIANT_BRANCH */,
@@ -3255,6 +3286,7 @@ var CONTROL_RELATIONSHIPS = {
3255
3286
  "section_button_group" /* SECTION_BUTTON_GROUP */,
3256
3287
  "button" /* BUTTON */,
3257
3288
  "context_menu" /* CONTEXT_MENU */,
3289
+ "audience_picker" /* AUDIENCE_PICKER */,
3258
3290
  "router_outlet" /* ROUTER_OUTLET */,
3259
3291
  "screen" /* SCREEN */,
3260
3292
  "variant_branch" /* VARIANT_BRANCH */,
@@ -3278,13 +3310,14 @@ var CONTROL_RELATIONSHIPS = {
3278
3310
  "flex" /* FLEX */,
3279
3311
  "button" /* BUTTON */,
3280
3312
  "context_menu" /* CONTEXT_MENU */,
3313
+ "audience_picker" /* AUDIENCE_PICKER */,
3281
3314
  "section_button_group" /* SECTION_BUTTON_GROUP */,
3282
3315
  "variant_branch" /* VARIANT_BRANCH */,
3283
3316
  "repeat" /* REPEAT */
3284
3317
  ],
3285
3318
  // A leaf but for one child, and only on a `selectable_card` Field: its
3286
3319
  // ContentControl, which `canPlaceChild` gates through `contentSlotOf` — what
3287
- // admits one is an InputType, which this table cannot see (CONTEXT.md
3320
+ // admits one is an InputType, which this table cannot see (GLOSSARY.md
3288
3321
  // ContentControl, ADR 0070).
3289
3322
  ["field" /* FIELD */]: ["content" /* CONTENT */],
3290
3323
  // The one list of what a content slot holds, whichever host opened it — a
@@ -3306,6 +3339,7 @@ var CONTROL_RELATIONSHIPS = {
3306
3339
  "user" /* USER */,
3307
3340
  "button" /* BUTTON */,
3308
3341
  "context_menu" /* CONTEXT_MENU */,
3342
+ "audience_picker" /* AUDIENCE_PICKER */,
3309
3343
  "section_button_group" /* SECTION_BUTTON_GROUP */,
3310
3344
  "screen" /* SCREEN */,
3311
3345
  "variant_branch" /* VARIANT_BRANCH */,
@@ -3317,6 +3351,7 @@ var CONTROL_RELATIONSHIPS = {
3317
3351
  ["section_button_group" /* SECTION_BUTTON_GROUP */]: [
3318
3352
  "button" /* BUTTON */,
3319
3353
  "context_menu" /* CONTEXT_MENU */,
3354
+ "audience_picker" /* AUDIENCE_PICKER */,
3320
3355
  "variant_branch" /* VARIANT_BRANCH */,
3321
3356
  "repeat" /* REPEAT */
3322
3357
  ],
@@ -3325,6 +3360,10 @@ var CONTROL_RELATIONSHIPS = {
3325
3360
  // Leaf too, for the Button's reason: everything a menu holds is its own
3326
3361
  // options — an authored bag or a bound list — never a child.
3327
3362
  ["context_menu" /* CONTEXT_MENU */]: [],
3363
+ // Leaf for the menu's reason: its Audience is its value, never a child.
3364
+ // Admitted beside every Button but a SectionAction's — that bar folds its
3365
+ // Buttons into `[buttons]` and projects nothing (ADR 0187).
3366
+ ["audience_picker" /* AUDIENCE_PICKER */]: [],
3328
3367
  // A Section, or a Flex for a Screen that is one line of content — the root
3329
3368
  // container in the reset still gives breakpoints a `mag-grid` to resolve
3330
3369
  // against, and a Flex owns none (ADR 0001, ADR 0005).
@@ -3334,19 +3373,19 @@ var CONTROL_RELATIONSHIPS = {
3334
3373
  "variant_branch" /* VARIANT_BRANCH */,
3335
3374
  "repeat" /* REPEAT */,
3336
3375
  // 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
3376
+ // the page it mounts in rather than sitting in a Col (GLOSSARY.md
3338
3377
  // RemoteControl).
3339
3378
  "remote" /* REMOTE */,
3340
3379
  "plugin" /* PLUGIN */
3341
3380
  ],
3342
3381
  ["text" /* TEXT_OUTPUT */]: [],
3343
3382
  // 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
3383
+ // is whatever the Router matched under this Page (GLOSSARY.md
3345
3384
  // RouterOutletControl), so nothing in the Tree may sit inside it.
3346
3385
  ["router_outlet" /* ROUTER_OUTLET */]: [],
3347
3386
  // Leaf, and the other Control whose children are not its own: what renders
3348
3387
  // inside it is the named Screen's own Tree, held in that Screen's slot
3349
- // (CONTEXT.md ScreenControl).
3388
+ // (GLOSSARY.md ScreenControl).
3350
3389
  ["screen" /* SCREEN */]: [],
3351
3390
  // Leaf, like text — content rather than structure, so a Section reaches it
3352
3391
  // only through a Row or Col.
@@ -3380,7 +3419,7 @@ var CONTROL_RELATIONSHIPS = {
3380
3419
  ["user" /* USER */]: ["content" /* CONTENT */],
3381
3420
  ["chat_bubble" /* CHAT_BUBBLE */]: ["content" /* CONTENT */],
3382
3421
  // 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
3422
+ // it (GLOSSARY.md VariantBranch). One arm ControlType for both kinds: a
3384
3423
  // DefaultArm is a BRANCH_ARM with `armKind: 'default'`.
3385
3424
  ["variant_branch" /* VARIANT_BRANCH */]: ["branch_arm" /* BRANCH_ARM */],
3386
3425
  // Deliberately empty, and not a leaf: an arm is transparent, so what it
@@ -3448,7 +3487,7 @@ var CONTROL_MAX_CHILDREN = {
3448
3487
  ["router_outlet" /* ROUTER_OUTLET */]: 1
3449
3488
  },
3450
3489
  // 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).
3490
+ // place, so a second has nowhere to go (GLOSSARY.md ContentControl).
3452
3491
  ["field" /* FIELD */]: { ["content" /* CONTENT */]: 1 },
3453
3492
  ["user" /* USER */]: { ["content" /* CONTENT */]: 1 },
3454
3493
  ["chat_bubble" /* CHAT_BUBBLE */]: { ["content" /* CONTENT */]: 1 },
@@ -3617,12 +3656,15 @@ var OWN_DIRECTIVES = {
3617
3656
  ["section_button_group" /* SECTION_BUTTON_GROUP */]: ["routerLink"],
3618
3657
  // The other click affordance the editor can express, beside a Col: a Button
3619
3658
  // 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.
3659
+ // — its LinkTarget — is the one thing an overlay competes with, so the two
3660
+ // are mutually exclusive per Button and `canAttachDirective` says so.
3622
3661
  ["button" /* BUTTON */]: ["mModal", "mSidePanel", "routerLink"],
3623
3662
  // Nothing to attach: the trigger's one click is the menu's own open, so an
3624
3663
  // overlay or a route on it would compete with the very thing the Control is.
3625
3664
  ["context_menu" /* CONTEXT_MENU */]: [],
3665
+ // Nothing to attach, for the menu's reason: the trigger's one click opens
3666
+ // the picker.
3667
+ ["audience_picker" /* AUDIENCE_PICKER */]: [],
3626
3668
  // Nothing to attach to: an outlet renders another Page's Controls, and a
3627
3669
  // behaviour on it would be a behaviour on whatever the Router happened to
3628
3670
  // match.
@@ -3689,8 +3731,21 @@ var DIRECTIVE_NAMES = [
3689
3731
  "mOptions",
3690
3732
  "routerLink"
3691
3733
  ];
3692
- var NAV_TARGET_KEYS = ["url", "murl"];
3693
- var hasNavTarget = (control) => NAV_TARGET_KEYS.some((key2) => {
3734
+ var NAV_TARGET_KEYS = ["href"];
3735
+ var BUTTON_CLICK_OUTPUT = "clicked";
3736
+ var LINK_TARGET_KINDS = [
3737
+ "none",
3738
+ "nav",
3739
+ "route",
3740
+ "external"
3741
+ ];
3742
+ var linkTargetKind = (control) => {
3743
+ if (control.outputNavs?.[BUTTON_CLICK_OUTPUT]) return "nav";
3744
+ if (control.directives?.["routerLink"]) return "route";
3745
+ if (typeof control.configs?.["href"] === "string") return "external";
3746
+ return "none";
3747
+ };
3748
+ var hasNavTarget = (control) => control.type === "button" /* BUTTON */ && !!control.outputNavs?.[BUTTON_CLICK_OUTPUT] || NAV_TARGET_KEYS.some((key2) => {
3694
3749
  const value = control.configs?.[key2];
3695
3750
  return typeof value === "string" ? value.trim() !== "" : value != null;
3696
3751
  });
@@ -3755,6 +3810,9 @@ var CONTROL_LABEL = {
3755
3810
  ["section_button_group" /* SECTION_BUTTON_GROUP */]: "section-button-group",
3756
3811
  ["button" /* BUTTON */]: "button",
3757
3812
  ["context_menu" /* CONTEXT_MENU */]: "context-menu",
3813
+ // The library's own key: project keys win the translation merge, so an
3814
+ // app-side `audience-picker` would reword the primitive's trigger label.
3815
+ ["audience_picker" /* AUDIENCE_PICKER */]: "audience-picker",
3758
3816
  ["router_outlet" /* ROUTER_OUTLET */]: "router-outlet",
3759
3817
  ["screen" /* SCREEN */]: "screen",
3760
3818
  ["variant_branch" /* VARIANT_BRANCH */]: "variant-branch",
@@ -3815,6 +3873,7 @@ var CONTROL_ICON = {
3815
3873
  ["section_button_group" /* SECTION_BUTTON_GROUP */]: "control_button_group",
3816
3874
  ["button" /* BUTTON */]: "control_button",
3817
3875
  ["context_menu" /* CONTEXT_MENU */]: "control_context_menu",
3876
+ ["audience_picker" /* AUDIENCE_PICKER */]: "control_audience_picker",
3818
3877
  ["router_outlet" /* ROUTER_OUTLET */]: "control_router_outlet",
3819
3878
  ["screen" /* SCREEN */]: "control_screen",
3820
3879
  ["variant_branch" /* VARIANT_BRANCH */]: "control_variant_branch",
@@ -4021,7 +4080,7 @@ var CONTROL_CODEGEN = {
4021
4080
  },
4022
4081
  // Folderless for the Remote's reason — PluginComponent takes `link` and
4023
4082
  // `screen` as individual inputs, its Screen's inputs as `m-plugin-input`
4024
- // children (CONTEXT.md PluginControl).
4083
+ // children (GLOSSARY.md PluginControl).
4025
4084
  ["plugin" /* PLUGIN */]: {
4026
4085
  tag: "m-plugin",
4027
4086
  component: "PluginComponent"
@@ -4085,6 +4144,12 @@ var CONTROL_CODEGEN = {
4085
4144
  component: "ContextMenuComponent",
4086
4145
  folder: "menu"
4087
4146
  },
4147
+ // `audience_picker` is the primitive's own `subFolder` (ADR 0187).
4148
+ ["audience_picker" /* AUDIENCE_PICKER */]: {
4149
+ tag: "m-audience-picker",
4150
+ component: "AudiencePickerComponent",
4151
+ folder: "audience_picker"
4152
+ },
4088
4153
  // Angular's own tag and Angular's own class — the outlet is a hole the Router
4089
4154
  // fills, so there is nothing about it for the editor to configure and no
4090
4155
  // folder for it to browse.
@@ -4345,7 +4410,7 @@ function renameScreenMethodParamReads(method, from, to) {
4345
4410
  return {
4346
4411
  ...method,
4347
4412
  ...method.args ? { args: renameArgs(method.args) } : {},
4348
- // Every further call's rows read the same parameters (CONTEXT.md
4413
+ // Every further call's rows read the same parameters (GLOSSARY.md
4349
4414
  // OutputCall).
4350
4415
  ...method.calls ? {
4351
4416
  calls: method.calls.map(
@@ -6349,6 +6414,11 @@ var BINDING_SLOT = {
6349
6414
  data: "data",
6350
6415
  // A RepeatControl's collection.
6351
6416
  source: "source",
6417
+ // An [AudiencePickerControl]'s controlled half, named for the `[audience]`
6418
+ // input it lands on. Exclusive with `source` beside it: the two are halves of
6419
+ // one value, and a Screen holding both would be sending the picker its value
6420
+ // twice (GLOSSARY.md AudiencePickerControl, ADR 0187).
6421
+ audience: "audience",
6352
6422
  // A UserControl's four, each named for the `m-user` input it lands on
6353
6423
  // (ADR 0069). `id` is the User the row *is* — what UserStore looks up — and
6354
6424
  // the other three are the values that stand in front of whatever it resolved.
@@ -6359,16 +6429,16 @@ var BINDING_SLOT = {
6359
6429
  // An [ImgControl]'s picture, named for the `m-img` input it lands on. Bound
6360
6430
  // is the ordinary case rather than the exotic one — a row's cover, a User's
6361
6431
  // photo — and what a binding usually holds is half a url, which is what the
6362
- // prefix beside it is for (CONTEXT.md ImgControl).
6432
+ // prefix beside it is for (GLOSSARY.md ImgControl).
6363
6433
  src: "src",
6364
6434
  // 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).
6435
+ // named for the `m-remote` inputs they land on (GLOSSARY.md RemoteControl).
6366
6436
  link: "link",
6367
6437
  path: "path",
6368
6438
  // A FieldControl's choices, named for the `m-section-form-item` input it
6369
6439
  // lands on. Exclusive with the `mOptions` AssetDirective beside it: an asset
6370
6440
  // 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).
6441
+ // clears one when it writes the other (GLOSSARY.md OptionSet).
6372
6442
  options: "options",
6373
6443
  // A SectionPagination's row count, named for the `m-section-pagination` input
6374
6444
  // it lands on. Content and not a setting, so it belongs here: what the band
@@ -6397,6 +6467,15 @@ var FALLBACK_SLOTS = [
6397
6467
  ];
6398
6468
  var IMG_VALUE_SLOTS = [BINDING_SLOT.src];
6399
6469
  var REMOTE_VALUE_SLOTS = [BINDING_SLOT.link, BINDING_SLOT.path];
6470
+ var AUDIENCE_PICKER_VALUE_SLOTS = [
6471
+ BINDING_SLOT.audience,
6472
+ BINDING_SLOT.source
6473
+ ];
6474
+ var AUDIENCE_PICKER_VALUE_LABEL = {
6475
+ [BINDING_SLOT.audience]: "audience-controlled",
6476
+ [BINDING_SLOT.source]: "audience-source"
6477
+ };
6478
+ var AUDIENCE_PICKER_LEVELS_KEY = "levels";
6400
6479
  var REMOTE_MOUNT_NAME_KEY = "mountName";
6401
6480
  var IMG_SRC_PREFIX_KEY = "srcPrefix";
6402
6481
  var IMG_SRC_SUFFIX_KEY = "srcSuffix";
@@ -6443,7 +6522,7 @@ function controlMapReadsState(map) {
6443
6522
  return Object.values(map).some(
6444
6523
  (control) => Object.values(control.bindings ?? {}).some(readsStore) || // A FormatPipe's bound argument is a store read the same way — a static
6445
6524
  // label under a `money:…:ordersStore.currency()` chain names no binding
6446
- // of its own (CONTEXT.md FormatPipe).
6525
+ // of its own (GLOSSARY.md FormatPipe).
6447
6526
  (control.formatPipes ?? []).some(
6448
6527
  (pipe) => Object.values(pipe.args ?? {}).some(
6449
6528
  (arg) => arg.kind === "binding" && readsStore(arg.binding)
@@ -7297,7 +7376,7 @@ var screenRoots = (scope) => [
7297
7376
  cardinality: input.cardinality
7298
7377
  })),
7299
7378
  // A ScreenComputed's type is its PureFunction's declared return and is
7300
- // never authored (CONTEXT.md ScreenComputed), so it is read off the
7379
+ // never authored (GLOSSARY.md ScreenComputed), so it is read off the
7301
7380
  // function the same way `computedAsProperty` reads a StateComputed's.
7302
7381
  ...Object.values(scope.screenComputeds ?? {}).flatMap((computed) => {
7303
7382
  const fn = screenComputedFunction(computed, scope.functions ?? {});
@@ -8964,8 +9043,10 @@ var declOf = (input) => ({
8964
9043
  cardinality: input.cardinality
8965
9044
  });
8966
9045
  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;
9046
+ // boundary (ADR 0038) — so it is no ScreenInput's type either. An `audience`
9047
+ // joins it: a picker's value is held and bound as a whole, not narrowed to a
9048
+ // primitive here (ADR 0187).
9049
+ input.dataType.type === "option" || input.dataType.type === "audience" ? void 0 : input.dataType.type;
8969
9050
  function mergeScreenInputs(declared = {}, inferred = []) {
8970
9051
  const byName = /* @__PURE__ */ new Map();
8971
9052
  for (const input of listScreenInputs(declared)) {
@@ -9045,7 +9126,7 @@ function screenInputExpression(binding, target, wires, renderBinding = () => voi
9045
9126
  }
9046
9127
  // A path into what this Screen reads, emitted by the one walk every other
9047
9128
  // bound slot goes through — injected rather than imported, for the reason
9048
- // `renderMethodCall` is (CONTEXT.md DataBinding). Undefined where the read
9129
+ // `renderMethodCall` is (GLOSSARY.md DataBinding). Undefined where the read
9049
9130
  // no longer resolves, which leaves the input unbound rather than emitting a
9050
9131
  // dead chain (ADR 0064).
9051
9132
  case "data":
@@ -11106,7 +11187,11 @@ var OUTPUT_PAYLOADS_BY_CONTROL = {
11106
11187
  // into the group rather than a fixed list, which is why they are resolved
11107
11188
  // from the ControlMap instead of declared below (libs/one ADR 0026,
11108
11189
  // superseding ADR 0096's `{name, value}[]`).
11109
- ["section_filter_group" /* SECTION_FILTER_GROUP */]: { filterChange: "record" }
11190
+ ["section_filter_group" /* SECTION_FILTER_GROUP */]: { filterChange: "record" },
11191
+ // An AudiencePickerControl's one output carries the `Audience` it was left
11192
+ // holding — the same value its controlled half reads. A record because the
11193
+ // library declares it as one: `level`, `uids` and `groupIds` (ADR 0187).
11194
+ ["audience_picker" /* AUDIENCE_PICKER */]: { audienceChange: "record" }
11110
11195
  };
11111
11196
  var FIELD_STRING_READER = "fieldString";
11112
11197
  var FIELD_NUMBER_READER = "fieldNumber";
@@ -11121,6 +11206,12 @@ var OUTPUT_PAYLOAD_MEMBERS = {
11121
11206
  },
11122
11207
  ["section_table" /* SECTION_TABLE */]: {
11123
11208
  sortChange: { id: "S", direction: "S" }
11209
+ },
11210
+ // libs/one `Audience` — one AudienceLevel, then the people and the Groups it
11211
+ // lets in or keeps out (GLOSSARY.md AudiencePickerControl). Self-typed, so
11212
+ // nothing binds `data` to give the output a shape (ADR 0187).
11213
+ ["audience_picker" /* AUDIENCE_PICKER */]: {
11214
+ audienceChange: { level: "S", uids: "S[]", groupIds: "S[]" }
11124
11215
  }
11125
11216
  };
11126
11217
  var DYNAMIC_MEMBER_OUTPUTS = {
@@ -11263,7 +11354,7 @@ function methodUsage(methodId, controls) {
11263
11354
  return Object.values(controls).filter(
11264
11355
  (control) => Object.values(control.outputs ?? {}).some((id) => id === methodId) || Object.values(control.outputOpens ?? {}).some(
11265
11356
  (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).
11357
+ (wire) => wire.binding?.kind === "method" && wire.binding.methodId === methodId || // A further call of the wire (GLOSSARY.md OutputCall).
11267
11358
  (wire.calls ?? []).some((call) => call.methodId === methodId)
11268
11359
  )
11269
11360
  )
@@ -12360,7 +12451,11 @@ function loadWcConfig(storage) {
12360
12451
  function sanitizeWcConfig(value) {
12361
12452
  if (!value || typeof value !== "object") return EMPTY_WC_CONFIG;
12362
12453
  const stored = value;
12454
+ const name3 = asString(stored.name).trim();
12363
12455
  return {
12456
+ // Only when set, so a workspace that never linked an App keeps its
12457
+ // DesignSource byte for byte.
12458
+ ...name3 && { name: name3 },
12364
12459
  description: asString(stored.description),
12365
12460
  company: asString(stored.company),
12366
12461
  pwaColor: asString(stored.pwaColor) || EMPTY_WC_CONFIG.pwaColor,
@@ -12594,7 +12689,7 @@ var FORMAT_PIPE_CATALOG = [
12594
12689
  component: "TimeAgoPipe",
12595
12690
  importFrom: ONE_IMPORT_MODULE,
12596
12691
  // `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).
12692
+ // date in this domain is a string the developer parses (GLOSSARY.md DataType).
12598
12693
  inputType: STR2,
12599
12694
  returnType: STR2,
12600
12695
  // Takes the value and nothing else — the only entry with no parameter
@@ -15123,7 +15218,7 @@ ${failureArms.map(
15123
15218
  ) || Object.values(method.confirm?.params ?? {}).some(
15124
15219
  (binding) => binding.source === "compute" && binding.name === name3
15125
15220
  ) || // The overlay opens inside the success `tap`, which closes over the same
15126
- // widened receiver (CONTEXT.md OpenScreen).
15221
+ // widened receiver (GLOSSARY.md OpenScreen).
15127
15222
  (method.open?.inputs ?? []).some(
15128
15223
  (row) => row.source === "compute" && row.compute === name3
15129
15224
  ) || // A MethodVariant is resolved inside the response block, which closes
@@ -15480,6 +15575,18 @@ function generateCacheMethods(methods, operationOf, properties, shapes, roots =
15480
15575
  }
15481
15576
 
15482
15577
  // libs/codegen/src/model/nav.ts
15578
+ var SEARCH_ANSWER_KINDS = ["feed", "screen"];
15579
+ var SEARCH_NAV_ID = "root_search";
15580
+ var SEARCH_ANSWER_KEY = "search_answer";
15581
+ var searchAnswerScreenId = (navMap) => {
15582
+ const answer = navMap[SEARCH_NAV_ID]?.searchAnswer;
15583
+ return answer?.kind === "screen" ? answer.screenId || void 0 : void 0;
15584
+ };
15585
+ var sanitizeSearchAnswer = (value) => {
15586
+ if (!value || typeof value !== "object") return void 0;
15587
+ const answer = value;
15588
+ return answer.kind === "screen" && typeof answer.screenId === "string" && answer.screenId ? { kind: "screen", screenId: answer.screenId } : void 0;
15589
+ };
15483
15590
  var isCompleteVisibilitySource = (source) => !!source && !!source.featureId && !!source.functionId && (source.hidesRow || source.guardsRoute);
15484
15591
  var prunedVisibilitySource = (source) => {
15485
15592
  if (!source) return void 0;
@@ -15562,18 +15669,18 @@ var pickedNavTail = (typed, nav) => {
15562
15669
  return isLegalNavTail(nav.tail, nav) ? nav.tail : void 0;
15563
15670
  };
15564
15671
  var navDynamicSegment = (nav) => `:${navParam(nav)}`;
15565
- var NAV_ID_SEP = "_";
15672
+ var NAV_ID_SEP2 = "_";
15566
15673
  var isValidNavSegment = (segment) => /^[a-z0-9][a-z0-9-]*$/.test(segment);
15567
15674
  var isValidNavId = (navId) => {
15568
- const segments = navId.split(NAV_ID_SEP);
15675
+ const segments = navId.split(NAV_ID_SEP2);
15569
15676
  return segments[0] === ROOT_NAV_ID && segments.slice(1).every(isValidNavSegment);
15570
15677
  };
15571
15678
  var parentNavId = (navId) => {
15572
- const i = navId.lastIndexOf(NAV_ID_SEP);
15679
+ const i = navId.lastIndexOf(NAV_ID_SEP2);
15573
15680
  return i > 0 ? navId.slice(0, i) : void 0;
15574
15681
  };
15575
15682
  var navSegmentId = (navId) => {
15576
- const i = navId.lastIndexOf(NAV_ID_SEP);
15683
+ const i = navId.lastIndexOf(NAV_ID_SEP2);
15577
15684
  return i > 0 ? navId.slice(i + 1) : navId;
15578
15685
  };
15579
15686
  var navParamTarget = (navMap, navId, ownerNavId) => {
@@ -15588,7 +15695,7 @@ var navParamTarget = (navMap, navId, ownerNavId) => {
15588
15695
  return void 0;
15589
15696
  };
15590
15697
  var isDefaultNavId = (navId) => navSegmentId(navId) === DEFAULT_NAV_SEGMENT;
15591
- var childNavId = (parentId, slug2) => `${parentId}${NAV_ID_SEP}${slug2}`;
15698
+ var childNavId = (parentId, slug2) => `${parentId}${NAV_ID_SEP2}${slug2}`;
15592
15699
  var ancestorNavIds = (navId) => {
15593
15700
  const out = [];
15594
15701
  let id = parentNavId(navId);
@@ -15623,12 +15730,12 @@ var navsReferencingVisibilityMethod = (navMap, methodId) => Object.values(navMap
15623
15730
  var navParamsInScope = (navId, navMap) => [navId, ...ancestorNavIds(navId)].map((id) => navMap[id]).filter((nav) => !!nav && nav.presentation === "dynamic");
15624
15731
  var canBeDefaultNav = (nav) => !!nav && nav.platform !== true && // The other half of `canCarryVisibilitySource`'s refusal, stated from this
15625
15732
  // 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
15733
+ // can itself be refused has nowhere to send it (GLOSSARY.md
15627
15734
  // NavVisibilitySource).
15628
15735
  !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
15736
  // default writes `''`. Both claim the one slot, and the value the landing
15630
15737
  // 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).
15738
+ // cannot be emitted at build time (GLOSSARY.md Default Nav).
15632
15739
  nav.presentation !== "dynamic";
15633
15740
  var canBeMurl = (presentation) => presentation !== "dynamic";
15634
15741
  var navsReferencingComputed = (navMap, computedId) => Object.values(navMap).filter(
@@ -15651,11 +15758,11 @@ var navVariantNavIds = (navMap, screenId) => {
15651
15758
  if (!bound.length) return [];
15652
15759
  return Object.values(navMap).filter(
15653
15760
  (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}`)
15761
+ (id) => id === nav.navId || id.startsWith(`${nav.navId}${NAV_ID_SEP2}`) || nav.navId.startsWith(`${id}${NAV_ID_SEP2}`)
15655
15762
  )
15656
15763
  ).map((nav) => nav.navId);
15657
15764
  };
15658
- var isNavAtOrBelow = (navId, target) => navId === target || navId.startsWith(`${target}${NAV_ID_SEP}`);
15765
+ var isNavAtOrBelow = (navId, target) => navId === target || navId.startsWith(`${target}${NAV_ID_SEP2}`);
15659
15766
  var NAV_LINK_KINDS = ["url", "murl"];
15660
15767
  var NAV_PRESENTATIONS = [
15661
15768
  "static",
@@ -15668,8 +15775,8 @@ var NAV_REF_MEMBER = "this.navRef";
15668
15775
  var NAV_ROUTER_MEMBER = "this.navRouter";
15669
15776
  var NAV_ROUTE_MEMBER = "this.navRoute";
15670
15777
  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));
15778
+ const segments = navId.split(NAV_ID_SEP2).filter(Boolean);
15779
+ return segments.map((_, i) => segments.slice(0, i + 1).join(NAV_ID_SEP2));
15673
15780
  };
15674
15781
  function outcomeNavDynamicNavs(navId, navMap) {
15675
15782
  if (!navId || !navMap[navId]) return [];
@@ -15744,7 +15851,7 @@ function outcomeReadsArgs(outcome) {
15744
15851
  )
15745
15852
  );
15746
15853
  }
15747
- var within = (navId, root) => !!navId && (navId === root || navId.startsWith(`${root}${NAV_ID_SEP}`));
15854
+ var within = (navId, root) => !!navId && (navId === root || navId.startsWith(`${root}${NAV_ID_SEP2}`));
15748
15855
  function controlNavReferences(control) {
15749
15856
  const outcomes = [
15750
15857
  ...Object.values(control.outputOutcomes ?? {}),
@@ -16418,10 +16525,84 @@ ${indent2}});`;
16418
16525
  return closes && idVar ? `const ${idVar} = ${call}` : call;
16419
16526
  }
16420
16527
 
16528
+ // libs/codegen/src/model/search-feed.ts
16529
+ var SEARCH_RESULT_KEYS = ["id", "title"];
16530
+ var SEARCH_RESULT_OPTIONAL_KEYS = ["description", "img", "url"];
16531
+ var hasStringKey = (shape, name3) => !!shape?.keys.some(
16532
+ (key2) => key2.name === name3 && key2.dataType.type === "string" && key2.cardinality === "one"
16533
+ );
16534
+ var isSearchResultShape = (shape) => SEARCH_RESULT_KEYS.every((name3) => hasStringKey(shape, name3));
16535
+ var isSearchFeedFunction = (fn, property, shapes) => {
16536
+ if (!fn || !property || property.cardinality !== "many") return false;
16537
+ if (fn.returnAsync) return false;
16538
+ const [query, items] = fn.params;
16539
+ if (!query || query.dataType.type !== "string" || query.cardinality !== "one")
16540
+ return false;
16541
+ if (!items || items.cardinality !== "many") return false;
16542
+ if (!sameDataType2(items.dataType, property.dataType)) return false;
16543
+ if (fn.returnCardinality !== "many" || fn.returnType.type !== "shape")
16544
+ return false;
16545
+ return isSearchResultShape(shapes[fn.returnType.shapeId]);
16546
+ };
16547
+ var sameDataType2 = (a, b) => a.type === b.type && (a.type !== "shape" || b.type === "shape" && a.shapeId === b.shapeId);
16548
+ var searchFeedArgsComplete = (fn, args) => fn.params.slice(2).every((param) => !!args?.[param.id]);
16549
+ var sanitizeMemberPath = (value) => {
16550
+ if (!Array.isArray(value)) return void 0;
16551
+ const segments = value.filter(
16552
+ (segment) => typeof segment === "string" && !!segment
16553
+ );
16554
+ return segments.length ? segments : void 0;
16555
+ };
16556
+
16421
16557
  // libs/codegen/src/lib/search-feed-codegen.ts
16422
16558
  var SEARCH_STORE = "SearchStore";
16423
16559
  var SEARCH_STORE_LOCAL = "searchStore";
16424
16560
  var SEARCH_FEED_IMPORTS = [SEARCH_STORE];
16561
+ function generateFunctionFeed(storeKey, feed, propertyName, context) {
16562
+ const { fn, property, shapes, roots } = context;
16563
+ if (!fn || !isSearchFeedFunction(fn, property, shapes)) {
16564
+ return { block: "", needsSearch: false };
16565
+ }
16566
+ if (!searchFeedArgsComplete(fn, feed.args)) {
16567
+ return { block: "", needsSearch: false };
16568
+ }
16569
+ const rest = fn.params.slice(2).map((param, index) => {
16570
+ const arg = feed.args?.[param.id];
16571
+ return {
16572
+ local: `arg${index}`,
16573
+ expression: stateComputedArgExpression(arg, roots, shapes, () => "store."),
16574
+ guarded: arg?.source === "path"
16575
+ };
16576
+ });
16577
+ if (rest.some((r) => r.expression === "undefined")) {
16578
+ return { block: "", needsSearch: false };
16579
+ }
16580
+ const clear = `${SEARCH_STORE_LOCAL}.clearSourceResults('${storeKey}');`;
16581
+ const locals = rest.map((r) => ` const ${r.local} = ${r.expression};
16582
+ `).join("");
16583
+ const guard = rest.filter((r) => r.guarded).map((r) => `${r.local} === undefined`).join(" || ");
16584
+ const guardBlock = guard ? ` if (${guard}) {
16585
+ ${clear}
16586
+ return;
16587
+ }
16588
+ ` : "";
16589
+ const call = `${fn.name}(${["query", "rows", ...rest.map((r) => r.local)].join(
16590
+ ", "
16591
+ )})`;
16592
+ return {
16593
+ block: ` effect(() => {
16594
+ const query = ${SEARCH_QUERY_LOCAL}?.() ?? '';
16595
+ if (!query.trim()) {
16596
+ ${clear}
16597
+ return;
16598
+ }
16599
+ const rows = store.${propertyName}() ?? [];
16600
+ ${locals}${guardBlock} ${SEARCH_STORE_LOCAL}.updateSourceResults('${storeKey}', '${feed.label}', ${call});
16601
+ });`,
16602
+ needsSearch: true,
16603
+ functionId: fn.id
16604
+ };
16605
+ }
16425
16606
  var resolveSearchFeedMember = (path, dataType, shapes) => {
16426
16607
  if (!path.length) return void 0;
16427
16608
  let current = dataType;
@@ -16433,11 +16614,19 @@ var resolveSearchFeedMember = (path, dataType, shapes) => {
16433
16614
  }
16434
16615
  return path.slice();
16435
16616
  };
16436
- function generateSearchFeed(storeKey, feed, properties, shapes) {
16617
+ function generateSearchFeed(storeKey, feed, properties, shapes, functions = {}, roots = properties) {
16437
16618
  const property = feed ? properties[feed.propertyId] : void 0;
16438
16619
  if (!feed || !property || property.cardinality !== "many") {
16439
16620
  return { block: "", needsSearch: false };
16440
16621
  }
16622
+ if (feed.functionId) {
16623
+ return generateFunctionFeed(storeKey, feed, property.name, {
16624
+ fn: functions[feed.functionId],
16625
+ property,
16626
+ shapes,
16627
+ roots
16628
+ });
16629
+ }
16441
16630
  const title = resolveSearchFeedMember(feed.title, property.dataType, shapes);
16442
16631
  if (!title) return { block: "", needsSearch: false };
16443
16632
  const item = "item";
@@ -16809,7 +16998,14 @@ function generateStoreHook(featureName, hook, properties, shapes, methods, opera
16809
16998
  /* @__PURE__ */ new Set(["store", "storage", SEARCH_QUERY_LOCAL]),
16810
16999
  casts
16811
17000
  ) : { once: [], onChange: [] };
16812
- const feed = generateSearchFeed(storeKey, searchFeed, properties, shapes);
17001
+ const feed = generateSearchFeed(
17002
+ storeKey,
17003
+ searchFeed,
17004
+ properties,
17005
+ shapes,
17006
+ functions,
17007
+ roots
17008
+ );
16813
17009
  const timerTaken = /* @__PURE__ */ new Set([
16814
17010
  "store",
16815
17011
  "storage",
@@ -16889,6 +17085,7 @@ ${storageLine}${searchLine}${searchStoreLine}${globalStoreLines}${body.join("\n"
16889
17085
  needsStorage: usesService,
16890
17086
  needsSearch: usesSearch,
16891
17087
  needsFeed: !!feed.block,
17088
+ ...feed.functionId ? { feedFunctionId: feed.functionId } : {},
16892
17089
  needsUntracked: timerEmission.needsUntracked,
16893
17090
  // A StoreHookRead's cast and a `storage` call-arg row's are both the hook
16894
17091
  // naming an interface the api half may never mention (ADR 0060).
@@ -18218,7 +18415,7 @@ function formModelShapeKeys(controlMap, formId) {
18218
18415
  return buildFormShape(controlMap, formId)?.keys ?? [];
18219
18416
  }
18220
18417
  function formModelKeyType(key2) {
18221
- if (key2.dataType.type === "shape" || key2.dataType.type === "form" || key2.dataType.type === "option") {
18418
+ if (key2.dataType.type === "shape" || key2.dataType.type === "form" || key2.dataType.type === "option" || key2.dataType.type === "audience") {
18222
18419
  return void 0;
18223
18420
  }
18224
18421
  if (!isKeyCardinality(key2.cardinality)) return void 0;
@@ -18266,7 +18463,7 @@ function formModelSourceType(source, scope) {
18266
18463
  input.cardinality
18267
18464
  );
18268
18465
  }
18269
- if (input.dataType.type === "form" || input.dataType.type === "option") {
18466
+ if (input.dataType.type === "form" || input.dataType.type === "option" || input.dataType.type === "audience") {
18270
18467
  return void 0;
18271
18468
  }
18272
18469
  if (source.member?.length) return void 0;
@@ -18285,7 +18482,7 @@ function formModelSourceType(source, scope) {
18285
18482
  fn.returnCardinality
18286
18483
  );
18287
18484
  }
18288
- if (fn.returnType.type === "form" || fn.returnType.type === "option") {
18485
+ if (fn.returnType.type === "form" || fn.returnType.type === "option" || fn.returnType.type === "audience") {
18289
18486
  return void 0;
18290
18487
  }
18291
18488
  if (source.member?.length) return void 0;
@@ -18507,7 +18704,7 @@ function screenVariableSourceType(source, scope) {
18507
18704
  const input = scope.inputs[source.inputId];
18508
18705
  if (!input || input.dataType.type === "shape") return void 0;
18509
18706
  if (input.dataType.type === "form") return void 0;
18510
- if (input.dataType.type === "file" || input.dataType.type === "option") {
18707
+ if (input.dataType.type === "file" || input.dataType.type === "option" || input.dataType.type === "audience") {
18511
18708
  return void 0;
18512
18709
  }
18513
18710
  if (!isVariableCardinality(input.cardinality)) return void 0;
@@ -18516,7 +18713,7 @@ function screenVariableSourceType(source, scope) {
18516
18713
  if (source.source === "computed") {
18517
18714
  const computed = scope.computeds[source.computedId];
18518
18715
  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") {
18716
+ if (!fn || fn.returnType.type === "shape" || fn.returnType.type === "form" || fn.returnType.type === "file" || fn.returnType.type === "option" || fn.returnType.type === "audience") {
18520
18717
  return void 0;
18521
18718
  }
18522
18719
  if (!isVariableCardinality(fn.returnCardinality)) return void 0;
@@ -18820,6 +19017,9 @@ function bodyConfigs(node) {
18820
19017
  if (node.type === "list" /* LIST */) {
18821
19018
  delete configs["items"];
18822
19019
  }
19020
+ if (node.type === "audience_picker" /* AUDIENCE_PICKER */) {
19021
+ delete configs[AUDIENCE_PICKER_LEVELS_KEY];
19022
+ }
18823
19023
  if (node.type === "section_table" /* SECTION_TABLE */) {
18824
19024
  for (const key2 of Object.keys(configs)) {
18825
19025
  if (!SECTION_TABLE_INPUTS.has(key2)) delete configs[key2];
@@ -19017,6 +19217,50 @@ function collectContextMenuConfigProps(tree, controls, names, menuVariants) {
19017
19217
  walk(tree);
19018
19218
  return props;
19019
19219
  }
19220
+ var audiencePickerHasLevels = (node) => {
19221
+ const levels = node.configs?.[AUDIENCE_PICKER_LEVELS_KEY];
19222
+ return Array.isArray(levels) && levels.length > 0;
19223
+ };
19224
+ function audiencePickerConfigPropNames(tree) {
19225
+ const names = /* @__PURE__ */ new Map();
19226
+ const used = /* @__PURE__ */ new Set();
19227
+ const walk = (nodes) => {
19228
+ nodes.forEach((node) => {
19229
+ if (node.type === "audience_picker" /* AUDIENCE_PICKER */ && audiencePickerHasLevels(node)) {
19230
+ const stem = `audiencePickerConfig${toPascalCase(
19231
+ slugifyComponentName(node.id).slice(0, 8)
19232
+ )}`;
19233
+ let name3 = stem;
19234
+ for (let suffix = 2; used.has(name3); suffix += 1)
19235
+ name3 = `${stem}${suffix}`;
19236
+ used.add(name3);
19237
+ names.set(node.id, name3);
19238
+ }
19239
+ walk(node.childrens);
19240
+ });
19241
+ };
19242
+ walk(tree);
19243
+ return names;
19244
+ }
19245
+ function collectAudiencePickerConfigProps(tree, names) {
19246
+ const props = [];
19247
+ const walk = (nodes) => {
19248
+ nodes.forEach((node) => {
19249
+ const name3 = names.get(node.id);
19250
+ if (node.type === "audience_picker" /* AUDIENCE_PICKER */ && name3 && audiencePickerHasLevels(node)) {
19251
+ props.push({
19252
+ name: name3,
19253
+ configs: {
19254
+ [AUDIENCE_PICKER_LEVELS_KEY]: node.configs?.[AUDIENCE_PICKER_LEVELS_KEY]
19255
+ }
19256
+ });
19257
+ }
19258
+ walk(node.childrens);
19259
+ });
19260
+ };
19261
+ walk(tree);
19262
+ return props;
19263
+ }
19020
19264
  function actionEnums(tree) {
19021
19265
  const propNames = actionButtonPropNames(tree);
19022
19266
  const taken = /* @__PURE__ */ new Set();
@@ -19343,6 +19587,7 @@ var attrBindingSlots = (type) => {
19343
19587
  return [BINDING_SLOT.options, BINDING_SLOT.min, BINDING_SLOT.max];
19344
19588
  }
19345
19589
  if (type === "user" /* USER */) return USER_VALUE_SLOTS;
19590
+ if (type === "audience_picker" /* AUDIENCE_PICKER */) return AUDIENCE_PICKER_VALUE_SLOTS;
19346
19591
  if (type === "img" /* IMG */) return [BINDING_SLOT.src];
19347
19592
  if (type === "remote" /* REMOTE */) return REMOTE_VALUE_SLOTS;
19348
19593
  if (type === "section_pagination" /* SECTION_PAGINATION */) return [BINDING_SLOT.total];
@@ -19622,6 +19867,14 @@ function boundAttrs(node, ctx, storeProp) {
19622
19867
  }
19623
19868
  }
19624
19869
  }
19870
+ if (node.type === "audience_picker" /* AUDIENCE_PICKER */) {
19871
+ const audience = bindings?.[BINDING_SLOT.audience];
19872
+ const audienceExpr = audience ? bindingExpression(audience, scope) : void 0;
19873
+ if (audienceExpr) parts.push(` [audience]="${audienceExpr}"`);
19874
+ const boundSource = bindings?.[BINDING_SLOT.source];
19875
+ const sourceExpr = boundSource ? textBindingExpression(boundSource, scope) : void 0;
19876
+ if (sourceExpr) parts.push(` [source]="${sourceExpr}"`);
19877
+ }
19625
19878
  parts.push(messageParamsAttr(node, ctx, storeProp));
19626
19879
  return parts.join("");
19627
19880
  }
@@ -19639,6 +19892,12 @@ var inSectionHeader = (node, ctx) => {
19639
19892
  return !!parentId && ctx.controlMap?.[parentId]?.type === "section_header" /* SECTION_HEADER */;
19640
19893
  };
19641
19894
  function tagAttrs(node, ctx, storeProp) {
19895
+ if (node.type === "audience_picker" /* AUDIENCE_PICKER */) {
19896
+ const config = ctx.audiencePickerConfigNames?.get(node.id);
19897
+ return `${config ? ` [config]="${config}"` : ""}${inlineAttrs(
19898
+ node
19899
+ )}${boundAttrs(node, ctx, storeProp)}`;
19900
+ }
19642
19901
  if (node.type === "context_menu" /* CONTEXT_MENU */) {
19643
19902
  const binding = ctx.controlMap?.[node.id]?.bindings?.[BINDING_SLOT.options];
19644
19903
  const expr = binding ? bindingExpression(binding, bindingScope(ctx, storeProp)) : void 0;
@@ -19908,10 +20167,10 @@ function outputAttrs(node, methods, operationOf, storeProp, ctx) {
19908
20167
  ...Object.keys(node.outputs ?? {}),
19909
20168
  // An output that only opens a Screen holds nothing in the maps above, and
19910
20169
  // the one call to its overlay member is the whole of what it does
19911
- // (CONTEXT.md OutputOpen).
20170
+ // (GLOSSARY.md OutputOpen).
19912
20171
  ...Object.keys(node.outputOpens ?? {}),
19913
20172
  // An output that only navigates or opens a new tab holds nothing in the
19914
- // maps above either (CONTEXT.md OutputNav, OutputNewTab).
20173
+ // maps above either (GLOSSARY.md OutputNav, OutputNewTab).
19915
20174
  ...Object.keys(node.outputNavs ?? {}),
19916
20175
  ...Object.keys(node.outputNewTabs ?? {}),
19917
20176
  // An output that only fires a ScreenMethod holds nothing in the three maps
@@ -20264,7 +20523,7 @@ function renderTag(node, indent2, names, methods, operationOf, storeProp, ctx, w
20264
20523
  ),
20265
20524
  // A bound ScreenInput reading a path — a row of the Repeat this embed
20266
20525
  // sits in, a StateProperty — emits through the same walk every other
20267
- // bound slot does (CONTEXT.md DataBinding).
20526
+ // bound slot does (GLOSSARY.md DataBinding).
20268
20527
  (binding) => bindingExpression(binding, bindingScope(ctx, storeProp)),
20269
20528
  inputAliases
20270
20529
  );
@@ -20417,6 +20676,7 @@ function planScreenEmit(tree, variants = {}, featureName = "feature", ctx = {})
20417
20676
  overlayNames: overlayPropNames(tree),
20418
20677
  actionButtonNames: actionButtonPropNames(tree),
20419
20678
  contextMenuConfigNames: contextMenuConfigPropNames(tree),
20679
+ audiencePickerConfigNames: audiencePickerConfigPropNames(tree),
20420
20680
  menuVariants: menuVariantLookup(variants, ctx.screenVariants),
20421
20681
  writtenTags
20422
20682
  },
@@ -20434,6 +20694,7 @@ function generateHtml(tree, variants = {}, methods = {}, operationOf = () => voi
20434
20694
  overlayNames: overlayPropNames(tree),
20435
20695
  actionButtonNames: actionButtonPropNames(tree),
20436
20696
  contextMenuConfigNames: contextMenuConfigPropNames(tree),
20697
+ audiencePickerConfigNames: audiencePickerConfigPropNames(tree),
20437
20698
  menuVariants: menuVariantLookup(variants, ctx.screenVariants),
20438
20699
  writtenTags: /* @__PURE__ */ new Set()
20439
20700
  };
@@ -20489,7 +20750,7 @@ function hasOutputBinding(tree, methods, operationOf, constants = {}, functions
20489
20750
  ) !== void 0;
20490
20751
  }) || // A call a wire makes is a call this Screen makes: the rows live inline
20491
20752
  // on the [OutputOpen] rather than in `node.outputs`, so they are asked
20492
- // here or the store would go uninjected (CONTEXT.md OverlayOutput,
20753
+ // here or the store would go uninjected (GLOSSARY.md OverlayOutput,
20493
20754
  // ADR 0144).
20494
20755
  overlayOutputBinds(
20495
20756
  node,
@@ -20516,7 +20777,7 @@ function overlayOutputBinds(node, methods, operationOf, constants, functions, pr
20516
20777
  return Object.entries(node.outputOpens ?? {}).some(
20517
20778
  ([output, open]) => Object.entries(open?.outputs ?? {}).some(
20518
20779
  ([outputId, wire]) => (
20519
- // Every call the wire fires, the further ones too (CONTEXT.md
20780
+ // Every call the wire fires, the further ones too (GLOSSARY.md
20520
20781
  // OutputCall).
20521
20782
  wireBindings(wire).some(
20522
20783
  (binding) => !!wireCallParts(
@@ -21054,7 +21315,7 @@ function outputOpenEmit(node, output, ctx, storeProp, indent2 = " ", methods
21054
21315
  // A `screen` row reads what the embedding class already declares, or walks
21055
21316
  // what that Screen reads — the two expressions a bound ScreenControl input
21056
21317
  // emits, spelled here for a class member rather than a template attribute
21057
- // (CONTEXT.md OutputOpen, ADR 0121).
21318
+ // (GLOSSARY.md OutputOpen, ADR 0121).
21058
21319
  (binding) => {
21059
21320
  const member = screenMemberExpression(binding, ctx);
21060
21321
  return member ? `this.${member}` : void 0;
@@ -22199,7 +22460,7 @@ function armStatements(node, output, arm, payload, eventRoot, selfStore, ctx, ar
22199
22460
  );
22200
22461
  const statements = [
22201
22462
  // What was refused, first: the rows below tidy up behind the dialog rather
22202
- // than ahead of it (CONTEXT.md DenialDialog).
22463
+ // than ahead of it (GLOSSARY.md DenialDialog).
22203
22464
  ...arm === "denied" ? [denialDialogCall(denialDialogOf(rows))] : [],
22204
22465
  ...screenWritesFor(
22205
22466
  node,
@@ -22574,7 +22835,10 @@ function generateStateType(featureName, properties, shapes = {}, enums = [], ini
22574
22835
  )} | undefined;`
22575
22836
  ).join("\n");
22576
22837
  const initialEntries = dataProperties.map((property) => ` ${property.name}: undefined,`).join("\n");
22577
- const imports = [shapeImports, enumImports].filter(Boolean).join("\n");
22838
+ const audienceImport = dataProperties.some(
22839
+ (property) => property.dataType.type === "audience"
22840
+ ) ? `import type { ${AUDIENCE_TYPE_NAME} } from '${AUDIENCE_TYPE_PACKAGE}';` : "";
22841
+ const imports = [shapeImports, enumImports, audienceImport].filter(Boolean).join("\n");
22578
22842
  return `${imports ? `${imports}
22579
22843
 
22580
22844
  ` : ""}export interface ${stateName} {
@@ -22793,7 +23057,7 @@ ${lines.join("\n")}
22793
23057
  "withState"
22794
23058
  ].sort();
22795
23059
  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).
23060
+ held.length > 0 || // A RuleCall injects the root store it asks (GLOSSARY.md RuleCall).
22797
23061
  variantGlobalStores.length > 0 || hooks.globalStores.length > 0;
22798
23062
  const coreImports = [
22799
23063
  ...usesComputed ? ["computed"] : [],
@@ -22807,7 +23071,7 @@ ${lines.join("\n")}
22807
23071
  ...emitsBusy ? [BUSY_SIGNAL] : [],
22808
23072
  // A method that asks before it calls — or opens a Screen once it has
22809
23073
  // landed — injects the overlay store, the same way a persisting one injects
22810
- // StorageService (CONTEXT.md CallConfirm, OpenScreen).
23074
+ // StorageService (GLOSSARY.md CallConfirm, OpenScreen).
22811
23075
  ...drawn.needsModal ? [MODAL_STORE] : [],
22812
23076
  // A `denied` arm's refusal is claimed off the library (api ADR 0005).
22813
23077
  ...drawn.needsDenial ? ["claimDenial"] : [],
@@ -22816,7 +23080,7 @@ ${lines.join("\n")}
22816
23080
  // other source's import is (ADR 0184).
22817
23081
  ...hooks.needsSearch ? [SEARCH_QUERY_TOKEN] : [],
22818
23082
  // 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
23083
+ // libs/one's SearchStore, which the nav's panel draws (GLOSSARY.md
22820
23084
  // SearchFeed).
22821
23085
  ...hooks.needsFeed ? SEARCH_FEED_IMPORTS : [],
22822
23086
  ...Array.from(/* @__PURE__ */ new Set([...variantGlobalStores, ...hooks.globalStores])).map(
@@ -22826,7 +23090,7 @@ ${lines.join("\n")}
22826
23090
  const storageImport = oneImports.length ? `import { ${oneImports.join(", ")} } from '@magmonium/one';
22827
23091
  ` : "";
22828
23092
  const functionImports = Array.from(
22829
- Object.values(computeds).map((computed) => functions[computed.functionId]).concat((drawn.functionIds ?? []).map((id) => functions[id])).filter((fn) => !!fn).reduce(
23093
+ 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
23094
  (byName, fn) => byName.has(fn.name) ? byName : byName.set(fn.name, fn),
22831
23095
  /* @__PURE__ */ new Map()
22832
23096
  ).values()
@@ -23132,6 +23396,7 @@ function generateTs(tree, naming, featureName, variants = {}, methods = {}, oper
23132
23396
  const variantList = listVariants(variants);
23133
23397
  const menuVariants = plan?.ctx.menuVariants ?? menuVariantLookup(variants, ctx.screenVariants);
23134
23398
  const contextMenuConfigNames = plan?.ctx.contextMenuConfigNames ?? contextMenuConfigPropNames(tree);
23399
+ const audiencePickerConfigNames = plan?.ctx.audiencePickerConfigNames ?? audiencePickerConfigPropNames(tree);
23135
23400
  const contextMenuConfigProps = collectContextMenuConfigProps(
23136
23401
  tree,
23137
23402
  ctx.controlMap ?? {},
@@ -23158,6 +23423,15 @@ function generateTs(tree, naming, featureName, variants = {}, methods = {}, oper
23158
23423
  (prop) => ` protected readonly ${prop.name}: ContextMenu = ${overlayConfigLiteral(
23159
23424
  prop.configs
23160
23425
  ).split("\n").join("\n ")};
23426
+ `
23427
+ ).join("\n");
23428
+ const audiencePickerConfigBody = collectAudiencePickerConfigProps(
23429
+ tree,
23430
+ audiencePickerConfigNames
23431
+ ).map(
23432
+ (prop) => ` protected readonly ${prop.name}: AudiencePicker = ${overlayConfigLiteral(
23433
+ prop.configs
23434
+ ).split("\n").join("\n ")};
23161
23435
  `
23162
23436
  ).join("\n");
23163
23437
  const inferredInputs = collectScreenInputs(
@@ -23333,7 +23607,7 @@ ${tables.map(
23333
23607
  (store) => store !== "AuthStore" && callsGlobalStore(ctx.controlMap ?? {}, ctx.screenMethods ?? {}, store)
23334
23608
  );
23335
23609
  const usesAuth = bindsDeployToken || // An output firing one of AuthStore's GlobalMethods reads the same
23336
- // injected member (CONTEXT.md GlobalMethod).
23610
+ // injected member (GLOSSARY.md GlobalMethod).
23337
23611
  callsGlobalStore(
23338
23612
  ctx.controlMap ?? {},
23339
23613
  ctx.screenMethods ?? {},
@@ -23703,7 +23977,7 @@ ${tables.map(
23703
23977
  ctx.functions ?? {}
23704
23978
  );
23705
23979
  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}
23980
+ ${`${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
23981
  @Component({
23708
23982
  selector: '${naming.selector}',
23709
23983
  changeDetection: ChangeDetectionStrategy.OnPush,
@@ -23723,7 +23997,7 @@ ${`${outcomeHandlersBody}${menuActionHandlersBody}`.includes("$event: MenuItem")
23723
23997
  width: 100%
23724
23998
  \`,
23725
23999
  })
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}}
24000
+ 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
24001
  `;
23728
24002
  }
23729
24003
  function assetName(node) {
@@ -23766,7 +24040,7 @@ function makeOutputOpenRefResolver(host, screens, features, prefix) {
23766
24040
  importFrom: screenImportPath(from, to),
23767
24041
  inputs: Object.values(screen.inputs ?? {}),
23768
24042
  // What the opened Screen emits, so the call site can wire each one
23769
- // (CONTEXT.md OverlayOutput, ADR 0144).
24043
+ // (GLOSSARY.md OverlayOutput, ADR 0144).
23770
24044
  outputs: Object.values(screen.outputs ?? {})
23771
24045
  };
23772
24046
  };
@@ -23941,6 +24215,13 @@ function generateCode(tree, featureName, screenName, properties = {}, variants =
23941
24215
  }
23942
24216
  function generateFeatureCode(feature, context) {
23943
24217
  const { operationOf } = context;
24218
+ const silenced = !!context.silenceSearchFeeds;
24219
+ const subStores = silenced && feature.subStores ? Object.fromEntries(
24220
+ Object.entries(feature.subStores).map(([id, sub]) => [
24221
+ id,
24222
+ { ...sub, searchFeed: void 0 }
24223
+ ])
24224
+ ) : feature.subStores;
23944
24225
  const emittedFeature = {
23945
24226
  id: "",
23946
24227
  name: feature.name,
@@ -23952,8 +24233,8 @@ function generateFeatureCode(feature, context) {
23952
24233
  functions: context.functions,
23953
24234
  ...feature.hook ? { hook: feature.hook } : {},
23954
24235
  ...feature.timers ? { timers: feature.timers } : {},
23955
- ...feature.searchFeed ? { searchFeed: feature.searchFeed } : {},
23956
- ...feature.subStores ? { subStores: feature.subStores } : {}
24236
+ ...feature.searchFeed && !silenced ? { searchFeed: feature.searchFeed } : {},
24237
+ ...subStores ? { subStores } : {}
23957
24238
  };
23958
24239
  const stores = generateStoreFiles(emittedFeature, operationOf, {
23959
24240
  usesBusy: context.usesBusy,
@@ -24048,7 +24329,7 @@ __export(package_exports, {
24048
24329
  version: () => version
24049
24330
  });
24050
24331
  var name = "@magmonium/one";
24051
- var version = "0.4.34";
24332
+ var version = "0.4.37";
24052
24333
  var description = "Magmonium One \u2014 Angular design-system primitives for mm Apps";
24053
24334
  var author = "magmonium";
24054
24335
  var license = "MIT";
@@ -24116,7 +24397,7 @@ __export(package_exports2, {
24116
24397
  version: () => version2
24117
24398
  });
24118
24399
  var name2 = "@magmonium/cli";
24119
- var version2 = "0.8.8";
24400
+ var version2 = "0.8.10";
24120
24401
  var description2 = "A powerful and extensible asset compilation tool that can be shared across multiple projects";
24121
24402
  var bin = {
24122
24403
  "mag-cli": "bin/cli.js"
@@ -24198,15 +24479,6 @@ var CLI_PACKAGE_VERSION = versionOf(package_exports2);
24198
24479
  // libs/codegen/src/model/hand-contract.ts
24199
24480
  var EMPTY_HAND_SCAN = { contracts: {}, skips: [] };
24200
24481
 
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
24482
  // libs/codegen/src/lib/timer-helper.ts
24211
24483
  function isValidTimerName(name3) {
24212
24484
  return /^[a-z][a-zA-Z0-9]*$/.test(name3);
@@ -24430,7 +24702,7 @@ function parseThemeSource(source) {
24430
24702
  // libs/codegen/src/lib/nav-row-helper.ts
24431
24703
  var NAV_ROW_KEYS = ["value", "label"];
24432
24704
  var NAV_ROW_ICON_KEY = "icon";
24433
- var hasStringKey = (shape, name3) => !!shape?.keys.some(
24705
+ var hasStringKey2 = (shape, name3) => !!shape?.keys.some(
24434
24706
  (key2) => key2.name === name3 && key2.dataType.type === "string" && key2.cardinality === "one"
24435
24707
  );
24436
24708
  function isNavRowShape(dataType, cardinality, shapes) {
@@ -24438,14 +24710,14 @@ function isNavRowShape(dataType, cardinality, shapes) {
24438
24710
  if (dataType?.type !== "shape") return false;
24439
24711
  const shape = shapes[dataType.shapeId];
24440
24712
  if (!shape) return false;
24441
- return NAV_ROW_KEYS.every((name3) => hasStringKey(shape, name3));
24713
+ return NAV_ROW_KEYS.every((name3) => hasStringKey2(shape, name3));
24442
24714
  }
24443
24715
  function navRowMiss(dataType, cardinality, shapes) {
24444
24716
  if (cardinality !== "many") return "nav-rows-need-many";
24445
24717
  if (dataType?.type !== "shape") return "nav-rows-need-shape";
24446
24718
  const shape = shapes[dataType.shapeId];
24447
24719
  if (!shape) return "nav-rows-unknown-shape";
24448
- return NAV_ROW_KEYS.every((name3) => hasStringKey(shape, name3)) ? void 0 : "nav-rows-need-keys";
24720
+ return NAV_ROW_KEYS.every((name3) => hasStringKey2(shape, name3)) ? void 0 : "nav-rows-need-keys";
24449
24721
  }
24450
24722
  function findNavRowShapeId(shapes) {
24451
24723
  return Object.values(shapes).find(
@@ -24798,7 +25070,7 @@ var hostRoutesConst = (nav, navMap, targets, outletScreens) => {
24798
25070
  (other) => other.pageId === nav.pageId && isOutletHostNav(other, navMap, targets, outletScreens)
24799
25071
  ).map((other) => other.navId).sort((a, b) => a.localeCompare(b));
24800
25072
  if (first === void 0 || first === nav.navId) return own;
24801
- const below = nav.navId.split(NAV_ID_SEP).slice(1).join("-");
25073
+ const below = nav.navId.split(NAV_ID_SEP2).slice(1).join("-");
24802
25074
  return own.replace(/Routes$/, `${toPascalCase(below)}Routes`);
24803
25075
  };
24804
25076
  var canHostNavChildren = (nav, outletScreens) => (
@@ -25032,7 +25304,7 @@ var pasteNav = (clipboard, targetId, navMap, outletScreens) => {
25032
25304
  };
25033
25305
  }
25034
25306
  const sourceSegment = source.navId.slice(
25035
- source.navId.lastIndexOf(NAV_ID_SEP) + 1
25307
+ source.navId.lastIndexOf(NAV_ID_SEP2) + 1
25036
25308
  );
25037
25309
  const defaultCannotMoveAsDefault = isDefaultNavId(source.navId) && (!isCut || !canHostDefaultChild(destination, outletScreens));
25038
25310
  const rootId = nextNavChildId(
@@ -25046,7 +25318,7 @@ var pasteNav = (clipboard, targetId, navMap, outletScreens) => {
25046
25318
  const parentId = parentNavId(id);
25047
25319
  const parentCopyId = parentId ? remapped.get(parentId) : void 0;
25048
25320
  if (!parentCopyId) return;
25049
- const segment = id.slice(id.lastIndexOf(NAV_ID_SEP) + 1);
25321
+ const segment = id.slice(id.lastIndexOf(NAV_ID_SEP2) + 1);
25050
25322
  remapped.set(id, childNavId(parentCopyId, segment));
25051
25323
  });
25052
25324
  const nextMap = { ...withoutTree };
@@ -25223,21 +25495,21 @@ var sanitizeNavMap = (value) => {
25223
25495
  // Same rule the parameter gets, and for the same reason: a source on a
25224
25496
  // Nav that reads no rows is a computed nothing draws, and one that comes
25225
25497
  // back when the Nav turns dynamic again names a menu the User has since
25226
- // forgotten (CONTEXT.md NavRowSource).
25498
+ // forgotten (GLOSSARY.md NavRowSource).
25227
25499
  ...presentation === "dynamic" && isCompleteRowSource(n.rowSource) ? { rowSource: prunedRowSource(n.rowSource) } : {},
25228
25500
  // 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
25501
+ // `:<param>` left to resolve names a header nothing reads (GLOSSARY.md
25230
25502
  // NavInstanceSource).
25231
25503
  ...presentation === "dynamic" && isCompleteInstanceSource(n.instanceSource) ? { instanceSource: prunedInstanceSource(n.instanceSource) } : {},
25232
25504
  // A gate survives whatever the Nav's presentation turned into — unlike
25233
25505
  // `param`, `rowSource` and `instanceSource` above, it asks nothing of
25234
25506
  // `dynamic`. What it does not survive is the Default Nav claim below it,
25235
25507
  // which is the one shape that makes the guard's redirect a loop
25236
- // (CONTEXT.md NavVisibilitySource).
25508
+ // (GLOSSARY.md NavVisibilitySource).
25237
25509
  ...!platform && n.isDefault !== true && isCompleteVisibilitySource(n.visibilitySource) && n.visibilitySource ? { visibilitySource: prunedVisibilitySource(n.visibilitySource) } : {},
25238
25510
  ...n.isDefault === true ? { isDefault: true } : {},
25239
25511
  // Only a static or dynamic Url Nav routes a tail — the rule
25240
- // `pickedNavTail` holds the inspector to (CONTEXT.md NavTail). Left out,
25512
+ // `pickedNavTail` holds the inspector to (GLOSSARY.md NavTail). Left out,
25241
25513
  // the Tail parameter came back empty on every reload and the emitted
25242
25514
  // route lost its matcher.
25243
25515
  ...routesNavTail({ linkKind, presentation }) && isLegalNavTail(n.tail, { presentation, param: n.param }) ? { tail: n.tail } : {},
@@ -25249,7 +25521,9 @@ var sanitizeNavMap = (value) => {
25249
25521
  ...n.inheritsParams === true ? { inheritsParams: true } : {},
25250
25522
  ...typeof n.pageId === "string" && n.pageId ? { pageId: n.pageId } : {},
25251
25523
  ...typeof n.componentKey === "string" && n.componentKey ? { componentKey: n.componentKey } : result[navId]?.componentKey ? { componentKey: result[navId].componentKey } : {},
25252
- ...platform ? { platform: true } : {}
25524
+ ...platform ? { platform: true } : {},
25525
+ // On `root_search` and nowhere else (GLOSSARY.md SearchAnswer).
25526
+ ...navId === SEARCH_NAV_ID && sanitizeSearchAnswer(n.searchAnswer) ? { searchAnswer: sanitizeSearchAnswer(n.searchAnswer) } : {}
25253
25527
  };
25254
25528
  }
25255
25529
  for (const navId of Object.keys(result).sort(
@@ -25272,7 +25546,7 @@ var sanitizeNavMap = (value) => {
25272
25546
  }
25273
25547
  }
25274
25548
  for (const navId of Object.keys(result).sort(
25275
- (a, b) => a.split(NAV_ID_SEP).length - b.split(NAV_ID_SEP).length
25549
+ (a, b) => a.split(NAV_ID_SEP2).length - b.split(NAV_ID_SEP2).length
25276
25550
  )) {
25277
25551
  if (result[navId].platform) continue;
25278
25552
  const parentId = parentNavId(navId);
@@ -25680,7 +25954,7 @@ var caseEquals = (actual, expected) => {
25680
25954
  };
25681
25955
 
25682
25956
  // libs/codegen/src/lib/workspace-codec.ts
25683
- var WORKSPACE_SCHEMA_VERSION = 27;
25957
+ var WORKSPACE_SCHEMA_VERSION = 28;
25684
25958
  var MIGRATION_FLOOR = 18;
25685
25959
  var DEPLOY_TOKEN_METHOD_IDS = {
25686
25960
  "@UserStore.ensureDeployToken": "@AuthStore.ensureDeployToken",
@@ -25788,6 +26062,53 @@ var dropOptionMultiple = (control) => {
25788
26062
  if (multiple === void 0) return control;
25789
26063
  return { ...control, configs: rest };
25790
26064
  };
26065
+ var SCHEME = /^[a-z][a-z0-9+.-]*:/i;
26066
+ var murlNavId = (murl) => [
26067
+ ROOT_NAV,
26068
+ ...murl.split(/[/~|]/).filter((s) => s && s !== ROOT_NAV)
26069
+ ].join(NAV_ID_SEP);
26070
+ var moveButtonNavTarget = (control) => {
26071
+ const configs = control["configs"];
26072
+ if (control["type"] !== "button" /* BUTTON */ || !configs || typeof configs !== "object") {
26073
+ return control;
26074
+ }
26075
+ const { url, murl, ...rest } = configs;
26076
+ if (url === void 0 && murl === void 0) return control;
26077
+ const next = { ...control, configs: rest };
26078
+ const directives = control["directives"] ?? {};
26079
+ const navs = control["outputNavs"] ?? {};
26080
+ const opens = control["outputOpens"] ?? {};
26081
+ const taken = !!directives["mModal"] || !!directives["mSidePanel"] || !!directives["routerLink"] || !!navs[BUTTON_CLICK_OUTPUT] || !!opens[BUTTON_CLICK_OUTPUT] || typeof rest["href"] === "string";
26082
+ if (taken) return next;
26083
+ const route = typeof url === "string" ? url.trim() : "";
26084
+ const menu = typeof murl === "string" && murl.trim() ? murl.trim() : route.includes("~") ? route : "";
26085
+ if (route && !route.includes("~")) {
26086
+ if (SCHEME.test(route)) return { ...next, configs: { ...rest, href: route } };
26087
+ const parts = route.split(/[?#]/)[0].split("/").filter(Boolean).map((value) => ({ kind: "static", value }));
26088
+ return {
26089
+ ...next,
26090
+ directives: {
26091
+ ...directives,
26092
+ routerLink: {
26093
+ configs: {
26094
+ ...parts.length ? { parts } : {},
26095
+ mode: route.startsWith("/") ? "absolute" : "relative"
26096
+ }
26097
+ }
26098
+ }
26099
+ };
26100
+ }
26101
+ if (menu) {
26102
+ return {
26103
+ ...next,
26104
+ outputNavs: {
26105
+ ...navs,
26106
+ [BUTTON_CLICK_OUTPUT]: { kind: "nav", navId: murlNavId(menu) }
26107
+ }
26108
+ };
26109
+ }
26110
+ return next;
26111
+ };
25791
26112
  var moveDeployTokenToAuth = (value) => {
25792
26113
  if (typeof value === "string") return DEPLOY_TOKEN_METHOD_IDS[value] ?? value;
25793
26114
  if (Array.isArray(value)) return value.map(moveDeployTokenToAuth);
@@ -25812,6 +26133,9 @@ var screenOnly = (step) => ({
25812
26133
  step
25813
26134
  });
25814
26135
  var MIGRATIONS = {
26136
+ // 27 → 28: a Button's `url`/`murl` move onto its LinkTarget, in a Screen's
26137
+ // ControlMap and in every ControlGroup.
26138
+ 27: everyKind((blob) => mapBlobControls(blob, moveButtonNavTarget)),
25815
26139
  // 26 → 27: a dropdown holds one value; `multiple` leaves the option types,
25816
26140
  // in a Screen's ControlMap and in every ControlGroup.
25817
26141
  26: everyKind((blob) => mapBlobControls(blob, dropOptionMultiple)),
@@ -25897,7 +26221,7 @@ var MIGRATIONS = {
25897
26221
  };
25898
26222
  }),
25899
26223
  // 21 -> 22: a FilterControl's `multiple` boolean becomes a `variant`, which
25900
- // has room for `range` where a boolean did not (CONTEXT.md FilterVariant).
26224
+ // has room for `range` where a boolean did not (GLOSSARY.md FilterVariant).
25901
26225
  //
25902
26226
  // Written explicitly on *every* Filter rather than only on the narrowed
25903
26227
  // ones, because the component's own default flipped with it: `multiple`
@@ -26534,14 +26858,14 @@ function sanitizeFeatures(features, appFunctions, sharedShapes = {}) {
26534
26858
  // Feature saved before ADR 0058 round-trips unchanged.
26535
26859
  ...hook ? { hook } : {},
26536
26860
  // Absent for a store that draws none, so a Feature saved before feeds
26537
- // existed round-trips unchanged (CONTEXT.md SearchFeed, ADR 0184).
26861
+ // existed round-trips unchanged (GLOSSARY.md SearchFeed, ADR 0184).
26538
26862
  ...searchFeed ? { searchFeed } : {},
26539
26863
  // Absent for a Feature that draws none, so a Feature saved before Timers
26540
26864
  // existed round-trips unchanged (ADR 0071).
26541
26865
  ...Object.keys(timers).length ? { timers } : {},
26542
26866
  // The store's one namespace: state keys, computed keys, method names and
26543
26867
  // the reserved `patch` / `variant` all land on one instance surface, so a
26544
- // computed cannot take a name already spoken for (CONTEXT.md
26868
+ // computed cannot take a name already spoken for (GLOSSARY.md
26545
26869
  // StateComputed).
26546
26870
  computeds,
26547
26871
  // Absent for a Feature owning none, so a Feature saved before SubStores
@@ -26558,8 +26882,19 @@ function sanitizeSearchFeed(value, properties) {
26558
26882
  const property = properties[stored.propertyId ?? ""];
26559
26883
  if (!property || property.cardinality !== "many") return void 0;
26560
26884
  if (typeof stored.label !== "string" || !stored.label.trim()) return void 0;
26885
+ const functionId = typeof stored.functionId === "string" && stored.functionId ? stored.functionId : void 0;
26886
+ const args = functionId ? sanitizeFeedArgs(stored.args) : void 0;
26561
26887
  const title = sanitizeMemberPath(stored.title);
26562
- if (!title) return void 0;
26888
+ if (!title && !functionId) return void 0;
26889
+ if (!title) {
26890
+ return {
26891
+ propertyId: property.id,
26892
+ label: stored.label,
26893
+ title: [],
26894
+ functionId,
26895
+ ...args ? { args } : {}
26896
+ };
26897
+ }
26563
26898
  const description3 = sanitizeMemberPath(stored.description);
26564
26899
  const img = sanitizeMemberPath(stored.img);
26565
26900
  const id = sanitizeMemberPath(stored.id);
@@ -26572,9 +26907,24 @@ function sanitizeSearchFeed(value, properties) {
26572
26907
  ...description3 ? { description: description3 } : {},
26573
26908
  ...img ? { img } : {},
26574
26909
  ...id ? { id } : {},
26575
- ...urlMember ? { url: { ...prefix ? { prefix } : {}, member: urlMember } } : {}
26910
+ ...urlMember ? { url: { ...prefix ? { prefix } : {}, member: urlMember } } : {},
26911
+ ...functionId ? { functionId } : {},
26912
+ ...args ? { args } : {}
26576
26913
  };
26577
26914
  }
26915
+ function sanitizeFeedArgs(value) {
26916
+ if (!value || typeof value !== "object") return void 0;
26917
+ const result = {};
26918
+ for (const [id, raw] of Object.entries(value)) {
26919
+ const arg = raw;
26920
+ if (arg?.source === "path" && Array.isArray(arg.path) && arg.path.length && arg.path.every((segment) => typeof segment === "string" && segment)) {
26921
+ result[id] = { source: "path", path: arg.path };
26922
+ } else if (arg?.source === "fixed" && ["string", "number", "boolean"].includes(typeof arg.value)) {
26923
+ result[id] = { source: "fixed", value: arg.value };
26924
+ }
26925
+ }
26926
+ return Object.keys(result).length ? result : void 0;
26927
+ }
26578
26928
  function sanitizeSubStores(value, featureName, shapes, functions) {
26579
26929
  if (!value || typeof value !== "object") return {};
26580
26930
  const result = {};
@@ -26720,7 +27070,7 @@ function sanitizeScreenInputs(inputs, shapes) {
26720
27070
  ...input.required ? { required: true } : {},
26721
27071
  ...input.origin === "card" ? { origin: "card" } : {},
26722
27072
  // 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
27073
+ // like an authored scalar — it is always the bar's text (GLOSSARY.md
26724
27074
  // SearchResultsScreen).
26725
27075
  ...input.origin === "search" ? { origin: "search" } : {}
26726
27076
  };
@@ -26956,7 +27306,7 @@ function sanitizeScreenMethods(value, taken) {
26956
27306
  ...Array.isArray(method.screenWrites) && method.screenWrites.length ? { screenWrites: method.screenWrites } : {},
26957
27307
  ...Array.isArray(method.emits) && method.emits.length ? { emits: method.emits } : {},
26958
27308
  ...Array.isArray(method.params) && method.params.length ? { params: sanitizeScreenMethodParams(method.params) } : {},
26959
- // The further calls (CONTEXT.md OutputCall), each trusted the way the
27309
+ // The further calls (GLOSSARY.md OutputCall), each trusted the way the
26960
27310
  // handler's own call is: an object, one of the two ids at most.
26961
27311
  ...Array.isArray(method.calls) && method.calls.length ? { calls: sanitizeScreenMethodCalls(method.calls) } : {}
26962
27312
  };
@@ -27747,7 +28097,7 @@ function buildDesignSource(ws, operations = drawnOperations(ws)) {
27747
28097
  functions: ws.functions,
27748
28098
  sharedShapes: ws.sharedShapes ?? {},
27749
28099
  distinct: ws.distinct ?? [],
27750
- // Travels though CONTEXT.md files it beside AiProvider: that grouping is
28100
+ // Travels though GLOSSARY.md files it beside AiProvider: that grouping is
27751
28101
  // Reset Project's scope, not disk. This is a list of package names and
27752
28102
  // semver ranges Download already merges into `package.json`, and it cannot
27753
28103
  // be rederived from there — `package.json` cannot say which of its
@@ -27962,7 +28312,7 @@ function buildTree(controlMap, rootControlIds, selection) {
27962
28312
  ...ctrl.source ? { source: ctrl.source } : {},
27963
28313
  ...ctrl.variants?.length ? { variants: ctrl.variants } : {},
27964
28314
  // Carried through so renderBranch can order the `@else` last and spell it
27965
- // without reaching back into ControlMap mid-walk (CONTEXT.md DefaultArm).
28315
+ // without reaching back into ControlMap mid-walk (GLOSSARY.md DefaultArm).
27966
28316
  ...ctrl.armKind ? { armKind: ctrl.armKind } : {},
27967
28317
  ...ctrl.variantKind ? { variantKind: ctrl.variantKind } : {},
27968
28318
  ...ctrl.outputs && Object.keys(ctrl.outputs).length ? { outputs: ctrl.outputs } : {},
@@ -27977,11 +28327,11 @@ function buildTree(controlMap, rootControlIds, selection) {
27977
28327
  // Without this the codegen walk reads `outputArms` off a Tree that never
27978
28328
  // carried it, every gated output falls back to ungated, and its groups —
27979
28329
  // filed under `<output>|arm:<armId>` — are skipped as qualified keys. The
27980
- // output emits nothing at all (CONTEXT.md OutputArm).
28330
+ // output emits nothing at all (GLOSSARY.md OutputArm).
27981
28331
  ...ctrl.outputArms && Object.keys(ctrl.outputArms).length ? { outputArms: ctrl.outputArms } : {},
27982
28332
  // Without this every group fires its first call alone: the rest are
27983
28333
  // filed under `<group>|call:<callId>` and read in the order this holds
27984
- // (CONTEXT.md OutputCall).
28334
+ // (GLOSSARY.md OutputCall).
27985
28335
  ...ctrl.outputCalls && Object.keys(ctrl.outputCalls).length ? { outputCalls: ctrl.outputCalls } : {},
27986
28336
  ...ctrl.outputScreenMethods && Object.keys(ctrl.outputScreenMethods).length ? { outputScreenMethods: ctrl.outputScreenMethods } : {},
27987
28337
  ...ctrl.menuActions?.length ? { menuActions: ctrl.menuActions } : {},
@@ -28005,7 +28355,7 @@ function buildTree(controlMap, rootControlIds, selection) {
28005
28355
  ...ctrl.search ? { search: ctrl.search } : {},
28006
28356
  // A Repeat's row count, carried for `cards`' reason: the Canvas draws
28007
28357
  // its sample rows from the Tree alone. Nothing else reads it — codegen
28008
- // never emits a count (CONTEXT.md SampleValue).
28358
+ // never emits a count (GLOSSARY.md SampleValue).
28009
28359
  ...ctrl.repeat?.sampleRows !== void 0 ? { sampleRows: ctrl.repeat.sampleRows } : {},
28010
28360
  ...fullyFaded ? { faded: true } : {}
28011
28361
  };
@@ -28112,13 +28462,16 @@ var navWidgetBindings = (navMap, screens, prefix, features = []) => {
28112
28462
  const mountable = new Map(
28113
28463
  screens.filter((s) => s.kind === "app_widget" || s.kind === "feature").map((s) => [s.id, s])
28114
28464
  );
28115
- return Object.values(navMap).flatMap((nav) => {
28465
+ const panels = Object.values(navMap).flatMap((nav) => {
28116
28466
  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 }) => {
28467
+ return screenId ? [{ navId: nav.navId, screenId }] : [];
28468
+ }).sort((a, b) => a.navId.localeCompare(b.navId));
28469
+ const answerScreenId = searchAnswerScreenId(navMap);
28470
+ const answer = answerScreenId ? [{ navId: SEARCH_ANSWER_KEY, screenId: answerScreenId }] : [];
28471
+ return [...panels, ...answer].flatMap(({ navId, screenId }) => {
28119
28472
  const screen = mountable.get(screenId);
28120
28473
  const naming = screen && panelNaming(screen, prefix, features);
28121
- return naming ? [{ navId: nav.navId, ...naming }] : [];
28474
+ return naming ? [{ navId, ...naming }] : [];
28122
28475
  });
28123
28476
  };
28124
28477
  var exposedScreenBindings = (screens, prefix, features = []) => {
@@ -28588,8 +28941,8 @@ ${exposed.map((b) => ` '${b.name}': ${b.className},`).join("\n")}
28588
28941
 
28589
28942
  // libs/codegen/src/lib/nav-routes-helper.ts
28590
28943
  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);
28944
+ var routePathFor = (navId, navMap, landing) => navId.split(NAV_ID_SEP2).slice(1).flatMap((segment, i, all) => {
28945
+ const id = [ROOT_NAV_ID, ...all.slice(0, i + 1)].join(NAV_ID_SEP2);
28593
28946
  const own = id === landing || isDefaultNavId(id) ? [] : [segment];
28594
28947
  const nav = navMap[id];
28595
28948
  return nav?.presentation === "dynamic" ? [navDynamicSegment(nav)] : own;
@@ -28814,7 +29167,7 @@ var packageJson = (appName, version3, extraDeps = {}) => JSON.stringify(
28814
29167
  rxjs: "~7.8.0",
28815
29168
  "socket.io-client": "^4.8.3",
28816
29169
  tslib: "^2.3.0",
28817
- // Workspace npm allowlist (CONTEXT.md NpmAllowlist) — packages a
29170
+ // Workspace npm allowlist (GLOSSARY.md NpmAllowlist) — packages a
28818
29171
  // PureFunction was approved to import. Sorted by Object.assign order
28819
29172
  // of the spread; npm does not care about key order.
28820
29173
  ...extraDeps
@@ -29520,7 +29873,7 @@ ${p2.required?.length ? ` required: [${p2.required.join(", ")}]
29520
29873
  ).join("")}` : "";
29521
29874
  var remoteManifest = (app, appName, config, className, selector, plugins) => `app: ${app}
29522
29875
  version: ${config.version}
29523
- name: ${appDisplayName(appName)}
29876
+ name: ${config.name?.trim() || appDisplayName(appName)}
29524
29877
  description: ${config.description}
29525
29878
  company: ${config.company}
29526
29879
  componentPath: src/app
@@ -30909,7 +31262,7 @@ ${block("renders before anything it reads has loaded", [
30909
31262
  const pluginBlock = plugins.length ? `
30910
31263
  describe(${quote4(`${className} plugins`)}, () => {
30911
31264
  // Every PluginControl this Screen places: its app, its Exposed Screen, the
30912
- // inputs it binds and the outputs it hears (CONTEXT.md PluginControl).
31265
+ // inputs it binds and the outputs it hears (GLOSSARY.md PluginControl).
30913
31266
  const PLUGINS = ${JSON.stringify(plugins)};
30914
31267
 
30915
31268
  ${block(
@@ -31152,7 +31505,7 @@ var screenCtxOf = (ws, meta, controlMap) => {
31152
31505
  // reachable — an overlay opens a body rather than embedding a Screen, so
31153
31506
  // nothing about the host Screen's filing narrows the list; what its filing
31154
31507
  // decides is only the import path the loader is written with.
31155
- // The Screen a Control's output opens when it fires (CONTEXT.md
31508
+ // The Screen a Control's output opens when it fires (GLOSSARY.md
31156
31509
  // OutputOpen). Resolved from this Screen rather than from the Feature: the
31157
31510
  // loader is written into this Screen's own class, so the path is relative
31158
31511
  // to its `ui/` folder.
@@ -31174,7 +31527,7 @@ var screenCtxOf = (ws, meta, controlMap) => {
31174
31527
  // the Feature's own on a Feature owning no SubStore.
31175
31528
  computeds: feature && readableMembers(feature, MAIN_STORE_OWNER).computeds,
31176
31529
  // 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
31530
+ // DataBinding walks to spell a read (GLOSSARY.md DataBinding). Feature-owned
31178
31531
  // like `computeds`, so a storeless Screen is handed neither and its bindings
31179
31532
  // reach ScreenInputs, ScreenComputeds and BindingAliases alone (ADR 0040).
31180
31533
  properties: feature && readableMembers(feature, MAIN_STORE_OWNER).properties,
@@ -31212,13 +31565,13 @@ var screenCtxOf = (ws, meta, controlMap) => {
31212
31565
  screenMethods: meta.methods,
31213
31566
  // The Controls themselves, for the FieldChecks their forms carry — reached
31214
31567
  // from the map rather than the Tree so a form inside a Modal is not missed
31215
- // (CONTEXT.md FieldCheck, ADR 0004).
31568
+ // (GLOSSARY.md FieldCheck, ADR 0004).
31216
31569
  controlMap,
31217
31570
  // The Nav tree, for the dynamic segments an OutcomeNav's target needs
31218
31571
  // filled before its row may emit (ADR 0142).
31219
31572
  navMap: ws.navMap,
31220
31573
  // The NavTail routing this Screen, which a `tail` RemoteControl reads its
31221
- // raw rest from (CONTEXT.md NavTail).
31574
+ // raw rest from (GLOSSARY.md NavTail).
31222
31575
  navTail: Object.values(ws.navMap).find(
31223
31576
  (nav) => nav.pageId === meta.id && nav.tail !== void 0
31224
31577
  )?.tail,
@@ -31245,7 +31598,7 @@ var featureContextOf = (ws, feature) => ({
31245
31598
  ),
31246
31599
  usesBusy: featureUsesBusy(ws, feature.id),
31247
31600
  armed: featureMethodArms(ws, feature.id),
31248
- // The Screen a StoreMethod opens once it has landed (CONTEXT.md OpenScreen).
31601
+ // The Screen a StoreMethod opens once it has landed (GLOSSARY.md OpenScreen).
31249
31602
  // Resolved from the Feature rather than from any Screen: the store opens it,
31250
31603
  // so the import is written from `lib/`.
31251
31604
  openScreenRef: makeOpenScreenRefResolver(
@@ -31253,7 +31606,9 @@ var featureContextOf = (ws, feature) => ({
31253
31606
  ws.screens.map((screen) => screen.meta),
31254
31607
  ws.features,
31255
31608
  prefixOf(ws)
31256
- )
31609
+ ),
31610
+ // A `screen` SearchAnswer takes the search panel whole (ADR 0190).
31611
+ silenceSearchFeeds: !!searchAnswerScreenId(ws.navMap)
31257
31612
  });
31258
31613
  var featureMethodArms = (ws, featureId) => featureId ? methodArms(
31259
31614
  ws.screens.filter(
@@ -31598,7 +31953,21 @@ var allowlistDeps = (ws) => Object.fromEntries(
31598
31953
  var SHIPPED_SHELL_PATHS = [
31599
31954
  "package.json",
31600
31955
  ".github/workflows/ci.yml",
31601
- ".github/workflows/cd.yml"
31956
+ ".github/workflows/cd.yml",
31957
+ // The shell named after the AppLink — class, selector, the generated
31958
+ // overlay it imports (`./<app>.router`), the build's output folder. Written
31959
+ // once, a renamed App's manifest says `store` while these still import
31960
+ // `./app.router` and build `dist/app`, and the bundle never compiles.
31961
+ "angular.json",
31962
+ "module-federation.config.ts",
31963
+ "webpack.config.ts",
31964
+ "src/index.html",
31965
+ "src/bootstrap.ts",
31966
+ "src/styles.sass",
31967
+ "src/app/wc.ts",
31968
+ "src/app/wc.config.ts",
31969
+ "src/app/wc.routes.ts",
31970
+ "src/app/providers.ts"
31602
31971
  ];
31603
31972
  var emitShippedShellFiles = (authored) => {
31604
31973
  const ws = inReach(authored);
@@ -31610,15 +31979,14 @@ var emitShippedShellFiles = (authored) => {
31610
31979
  pluginContractsOf(ws)
31611
31980
  ).filter((file) => SHIPPED_SHELL_PATHS.includes(file.path)).map((file) => ({ path: file.path, contents: file.contents }));
31612
31981
  };
31982
+ var isRemoteManifestPath = (path) => /^mag_assets(_env\/[^/]+)?\/remote\/[^/]+\.yml$/.test(path);
31613
31983
  var remoteManifestFiles = (ws) => scaffoldFiles(
31614
31984
  ws.appTarget.appName,
31615
31985
  ws.wcConfig,
31616
31986
  ws.appTarget.environment,
31617
31987
  {},
31618
31988
  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 }));
31989
+ ).filter((file) => isRemoteManifestPath(file.path)).map((file) => ({ path: file.path, contents: file.contents }));
31622
31990
  var emitOverlayFiles = (authored, stringify) => {
31623
31991
  const ws = inReach(authored);
31624
31992
  const files3 = emitScreenCode(ws, stringify);
@@ -31687,7 +32055,7 @@ var HISTORY_LABELS = [
31687
32055
  "cut-control",
31688
32056
  "duplicate-control",
31689
32057
  // 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).
32058
+ // Screen's slot riding it beside the target's (GLOSSARY.md ScreenLink).
31691
32059
  "paste-screen-link",
31692
32060
  "paste-control",
31693
32061
  "edit-control",
@@ -31751,6 +32119,11 @@ var HISTORY_SELECTION_KEYS = [
31751
32119
  ASSET_DIRECTIVE_KEY,
31752
32120
  ASSET_ROOT,
31753
32121
  ASSET_TIERS,
32122
+ AUDIENCE_PICKER_LEVELS_KEY,
32123
+ AUDIENCE_PICKER_VALUE_LABEL,
32124
+ AUDIENCE_PICKER_VALUE_SLOTS,
32125
+ AUDIENCE_TYPE_NAME,
32126
+ AUDIENCE_TYPE_PACKAGE,
31754
32127
  AUTH_EXPRESSION,
31755
32128
  AUTH_PROPERTIES,
31756
32129
  BASE_THEME_FOR_MODE,
@@ -31763,6 +32136,7 @@ var HISTORY_SELECTION_KEYS = [
31763
32136
  BUSY_SIGNAL,
31764
32137
  BUSY_VARIANT_ID,
31765
32138
  BUSY_VARIANT_NAME,
32139
+ BUTTON_CLICK_OUTPUT,
31766
32140
  CALL_ARG_SOURCES,
31767
32141
  CALL_ARG_TRANSFORM_LEAVES,
31768
32142
  CALL_CONDITION_KINDS,
@@ -31887,6 +32261,7 @@ var HISTORY_SELECTION_KEYS = [
31887
32261
  LIB_SEGMENT,
31888
32262
  LIGHT_SURFACE_MIN_LUMINANCE,
31889
32263
  LIMIT_CHECK_KINDS,
32264
+ LINK_TARGET_KINDS,
31890
32265
  LIST_ITEMS_KEY,
31891
32266
  LIST_ROW_ID_KEY,
31892
32267
  LIST_ROW_LABEL_KEY,
@@ -31976,9 +32351,14 @@ var HISTORY_SELECTION_KEYS = [
31976
32351
  ROUTER_LINK_MODES,
31977
32352
  SCREEN_METHOD_FORBIDDEN_SOURCE,
31978
32353
  SCREEN_SOURCE_SEP,
32354
+ SEARCH_ANSWER_KEY,
32355
+ SEARCH_ANSWER_KINDS,
31979
32356
  SEARCH_FEED_IMPORTS,
32357
+ SEARCH_NAV_ID,
31980
32358
  SEARCH_QUERY_LOCAL,
31981
32359
  SEARCH_QUERY_TOKEN,
32360
+ SEARCH_RESULT_KEYS,
32361
+ SEARCH_RESULT_OPTIONAL_KEYS,
31982
32362
  SEARCH_STORE,
31983
32363
  SEARCH_STORE_LOCAL,
31984
32364
  SEARCH_TEXT_INPUT,
@@ -32589,6 +32969,7 @@ var HISTORY_SELECTION_KEYS = [
32589
32969
  isRedirectRoute,
32590
32970
  isReferencedByRule,
32591
32971
  isReleaseVersion,
32972
+ isRemoteManifestPath,
32592
32973
  isRepeatFamily,
32593
32974
  isReservedFeatureName,
32594
32975
  isReservedVariantId,
@@ -32602,6 +32983,8 @@ var HISTORY_SELECTION_KEYS = [
32602
32983
  isRuntimePath,
32603
32984
  isScreenMemberBinding,
32604
32985
  isScreenOwnedKind,
32986
+ isSearchFeedFunction,
32987
+ isSearchResultShape,
32605
32988
  isSectionHeaderSlotFamily,
32606
32989
  isSharedIconName,
32607
32990
  isSharedShapeId,
@@ -32653,6 +33036,7 @@ var HISTORY_SELECTION_KEYS = [
32653
33036
  levelStateComputeds,
32654
33037
  libImportsFrom,
32655
33038
  linkDrift,
33039
+ linkTargetKind,
32656
33040
  linkedVariableReaders,
32657
33041
  listAssetName,
32658
33042
  listDataProperties,
@@ -33057,6 +33441,7 @@ var HISTORY_SELECTION_KEYS = [
33057
33441
  sanitizeNavMap,
33058
33442
  sanitizeNpmAllowlist,
33059
33443
  sanitizePalette,
33444
+ sanitizeSearchAnswer,
33060
33445
  sanitizeTransform,
33061
33446
  sanitizeWcConfig,
33062
33447
  saveAppTarget,
@@ -33129,7 +33514,9 @@ var HISTORY_SELECTION_KEYS = [
33129
33514
  screenWriteValueKinds,
33130
33515
  screensOfFeature,
33131
33516
  screensOfKind,
33517
+ searchAnswerScreenId,
33132
33518
  searchEmit,
33519
+ searchFeedArgsComplete,
33133
33520
  searchMemberName,
33134
33521
  searchSpec,
33135
33522
  searchTextInput,