@ankhorage/contracts 9.0.0 → 10.0.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @ankhorage/contracts
2
2
 
3
+ ## 10.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 8835ea2: Replace the legacy `NavigatorSpec` contract with the focused `AppNavigatorManifest` slice, publish it through `@ankhorage/contracts/navigator`, and add typed topology presets plus adaptive, JavaScript, native, and custom tab implementation/presentation desired state.
8
+
3
9
  ## 9.0.0
4
10
 
5
11
  ### Major Changes
@@ -1,6 +1,7 @@
1
1
  export declare function isManifestMetadata(value: unknown): boolean;
2
2
  export declare function isThemeConfig(value: unknown): boolean;
3
- export declare function isNavigatorSpec(value: unknown): boolean;
3
+ /*** Validate the complete serialized `AppManifest.navigator` slice. */
4
+ export declare function isAppNavigatorManifest(value: unknown): boolean;
4
5
  export declare function isScreenRegistry(value: unknown): boolean;
5
6
  export declare function isSplashScreenSpec(value: unknown): boolean;
6
7
  //# sourceMappingURL=screens.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"screens.d.ts","sourceRoot":"","sources":["../../src/appManifest/screens.ts"],"names":[],"mappings":"AAiBA,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAY1D;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAQrD;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAUvD;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAQxD;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAM1D"}
1
+ {"version":3,"file":"screens.d.ts","sourceRoot":"","sources":["../../src/appManifest/screens.ts"],"names":[],"mappings":"AA4BA,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAY1D;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAQrD;AAED,uEAAuE;AACvE,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAU9D;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAQxD;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAM1D"}
@@ -1,9 +1,14 @@
1
1
  import { COLOR_HARMONIES } from '@ankhorage/color-theory';
2
- import { APP_CATEGORIES, NAVIGATOR_TYPES } from '../types';
2
+ import { CUSTOM_TABS_PRESENTATIONS, FIXED_CUSTOM_TABS_PRESENTATIONS, JAVASCRIPT_TABS_PRESENTATIONS, NAVIGATOR_PRESETS, NAVIGATOR_TYPES, } from '../navigator';
3
+ import { APP_CATEGORIES } from '../types';
3
4
  import { isBindingValueSource, isScreenDataLoaderDefinition } from './bindings';
4
5
  import { isOptionalBoolean, isOptionalNumber, isOptionalString, isRecord, isStringArray, } from './shared';
5
6
  const APP_CATEGORY_SET = new Set(APP_CATEGORIES);
6
7
  const COLOR_HARMONY_SET = new Set(COLOR_HARMONIES);
8
+ const CUSTOM_TABS_PRESENTATION_SET = new Set(CUSTOM_TABS_PRESENTATIONS);
9
+ const FIXED_CUSTOM_TABS_PRESENTATION_SET = new Set(FIXED_CUSTOM_TABS_PRESENTATIONS);
10
+ const JAVASCRIPT_TABS_PRESENTATION_SET = new Set(JAVASCRIPT_TABS_PRESENTATIONS);
11
+ const NAVIGATOR_PRESET_SET = new Set(NAVIGATOR_PRESETS);
7
12
  const NAVIGATOR_TYPE_SET = new Set(NAVIGATOR_TYPES);
8
13
  const SPLASH_SCREEN_RESIZE_MODE_SET = new Set(['contain', 'cover', 'native']);
9
14
  export function isManifestMetadata(value) {
@@ -24,14 +29,15 @@ export function isThemeConfig(value) {
24
29
  isThemeModeConfig(value.light) &&
25
30
  isThemeModeConfig(value.dark));
26
31
  }
27
- export function isNavigatorSpec(value) {
32
+ /*** Validate the complete serialized `AppManifest.navigator` slice. */
33
+ export function isAppNavigatorManifest(value) {
28
34
  return (isRecord(value) &&
29
- typeof value.type === 'string' &&
30
- NAVIGATOR_TYPE_SET.has(value.type) &&
31
- isOptionalString(value.initialRouteName) &&
32
- Array.isArray(value.routes) &&
33
- value.routes.every(isRouteDefinition) &&
34
- (value.options === undefined || isRecord(value.options)));
35
+ isNavigatorNode(value) &&
36
+ (value.preset === undefined ||
37
+ (typeof value.preset === 'string' && NAVIGATOR_PRESET_SET.has(value.preset))) &&
38
+ (value.flows === undefined || isNavigatorFlows(value.flows)) &&
39
+ (value.defaults === undefined || isNavigatorDefaults(value.defaults)) &&
40
+ (value.platforms === undefined || isNavigatorPlatforms(value.platforms)));
35
41
  }
36
42
  export function isScreenRegistry(value) {
37
43
  return (isRecord(value) &&
@@ -78,6 +84,17 @@ function isScreenSpec(value) {
78
84
  (value.requires === undefined || isScreenRequirements(value.requires)) &&
79
85
  isUiNode(value.root));
80
86
  }
87
+ /*** Validate one nested navigator node independently from app-level authoring metadata. */
88
+ function isNavigatorNode(value) {
89
+ return (isRecord(value) &&
90
+ typeof value.type === 'string' &&
91
+ NAVIGATOR_TYPE_SET.has(value.type) &&
92
+ isOptionalString(value.initialRouteName) &&
93
+ Array.isArray(value.routes) &&
94
+ value.routes.every(isRouteDefinition) &&
95
+ (value.options === undefined || isRecord(value.options)) &&
96
+ (value.type !== 'tabs' || isTabsImplementationConfig(value)));
97
+ }
81
98
  function isRouteDefinition(value) {
82
99
  return (isRecord(value) &&
83
100
  typeof value.name === 'string' &&
@@ -87,7 +104,7 @@ function isRouteDefinition(value) {
87
104
  isOptionalBoolean(value.showInPrimaryNavigation) &&
88
105
  (value.guards === undefined || isStringArray(value.guards)) &&
89
106
  isOptionalString(value.screenId) &&
90
- (value.navigator === undefined || isNavigatorSpec(value.navigator)));
107
+ (value.navigator === undefined || isNavigatorNode(value.navigator)));
91
108
  }
92
109
  function isIconSpec(value) {
93
110
  return (isRecord(value) &&
@@ -98,6 +115,82 @@ function isIconSpec(value) {
98
115
  typeof value.size === 'number') &&
99
116
  isOptionalString(value.color));
100
117
  }
118
+ /*** Validate tabs implementation desired state, with omitted implementation meaning adaptive. */
119
+ function isTabsImplementationConfig(value) {
120
+ if (value.implementation === undefined || value.implementation === 'adaptive') {
121
+ return ((value.native === undefined || isNativeTabsConfig(value.native)) &&
122
+ (value.web === undefined || isCustomTabsWebConfig(value.web)));
123
+ }
124
+ if (value.implementation === 'native')
125
+ return true;
126
+ if (value.implementation === 'javascript') {
127
+ return (value.presentation === undefined ||
128
+ (typeof value.presentation === 'string' &&
129
+ JAVASCRIPT_TABS_PRESENTATION_SET.has(value.presentation)));
130
+ }
131
+ return value.implementation === 'custom' && isCustomTabsConfig(value);
132
+ }
133
+ /*** Validate the native branch used by adaptive tabs. */
134
+ function isNativeTabsConfig(value) {
135
+ return isRecord(value) && value.implementation === 'native';
136
+ }
137
+ /*** Validate a full custom-tabs implementation config. */
138
+ function isCustomTabsConfig(value) {
139
+ return value.implementation === 'custom' && isCustomTabsPresentationConfig(value);
140
+ }
141
+ /*** Validate the implementation-free custom-tabs Web branch inside adaptive tabs. */
142
+ function isCustomTabsWebConfig(value) {
143
+ return (isRecord(value) && value.implementation === undefined && isCustomTabsPresentationConfig(value));
144
+ }
145
+ /*** Validate custom-tab presentation and its conditional serializable configuration. */
146
+ function isCustomTabsPresentationConfig(value) {
147
+ if (typeof value.presentation !== 'string' ||
148
+ !CUSTOM_TABS_PRESENTATION_SET.has(value.presentation)) {
149
+ return false;
150
+ }
151
+ if (value.responsive !== undefined && !isResponsiveTabsPresentation(value.responsive)) {
152
+ return false;
153
+ }
154
+ if (!isOptionalString(value.customPresentationId))
155
+ return false;
156
+ if (value.presentation === 'responsive' && value.responsive === undefined)
157
+ return false;
158
+ return (value.presentation !== 'custom' ||
159
+ (typeof value.customPresentationId === 'string' && value.customPresentationId.length > 0));
160
+ }
161
+ /*** Validate semantic compact/medium/expanded custom-tab presentation mapping. */
162
+ function isResponsiveTabsPresentation(value) {
163
+ return (isRecord(value) &&
164
+ typeof value.compact === 'string' &&
165
+ FIXED_CUSTOM_TABS_PRESENTATION_SET.has(value.compact) &&
166
+ (value.medium === undefined ||
167
+ (typeof value.medium === 'string' && FIXED_CUSTOM_TABS_PRESENTATION_SET.has(value.medium))) &&
168
+ typeof value.expanded === 'string' &&
169
+ FIXED_CUSTOM_TABS_PRESENTATION_SET.has(value.expanded));
170
+ }
171
+ /*** Validate optional app-level navigator flow intent. */
172
+ function isNavigatorFlows(value) {
173
+ return (isRecord(value) &&
174
+ isOptionalBoolean(value.onboarding) &&
175
+ isOptionalBoolean(value.authentication));
176
+ }
177
+ /*** Validate package-owned navigator defaults without requiring a navigator node type. */
178
+ function isNavigatorDefaults(value) {
179
+ return (isRecord(value) &&
180
+ (value.tabs === undefined || (isRecord(value.tabs) && isTabsImplementationConfig(value.tabs))));
181
+ }
182
+ /*** Validate per-platform navigator implementation overrides. */
183
+ function isNavigatorPlatforms(value) {
184
+ return (isRecord(value) &&
185
+ (value.android === undefined || isNavigatorPlatformConfig(value.android)) &&
186
+ (value.ios === undefined || isNavigatorPlatformConfig(value.ios)) &&
187
+ (value.web === undefined || isNavigatorPlatformConfig(value.web)));
188
+ }
189
+ /*** Validate one platform-specific navigator override slice. */
190
+ function isNavigatorPlatformConfig(value) {
191
+ return (isRecord(value) &&
192
+ (value.tabs === undefined || (isRecord(value.tabs) && isTabsImplementationConfig(value.tabs))));
193
+ }
101
194
  function isSplashScreenModeSpec(value) {
102
195
  return (isRecord(value) &&
103
196
  isOptionalString(value.image) &&
@@ -1 +1 @@
1
- {"version":3,"file":"screens.js","sourceRoot":"","sources":["../../src/appManifest/screens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,UAAU,C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reenDataLoaderDefinition } from './bindings';\nimport {\n isOptionalBoolean,\n isOptionalNumber,\n isOptionalString,\n isRecord,\n isStringArray,\n} from './shared';\n\nconst APP_CATEGORY_SET = new Set<string>(APP_CATEGORIES);\nconst COLOR_HARMONY_SET = new Set<string>(COLOR_HARMONIES);\nconst NAVIGATOR_TYPE_SET = new Set<string>(NAVIGATOR_TYPES);\nconst SPLASH_SCREEN_RESIZE_MODE_SET = new Set<string>(['contain', 'cover', 'native']);\n\nexport function isManifestMetadata(value: unknown): boolean {\n return (\n isRecord(value) &&\n typeof value.name === 'string' &&\n typeof value.slug === 'string' &&\n typeof value.version === 'string' &&\n typeof value.category === 'string' &&\n APP_CATEGORY_SET.has(value.category) &&\n typeof value.themeId === 'string' &&\n isOptionalString(value.created) &&\n isOptionalString(value.updated)\n );\n}\n\nexport function isThemeConfig(value: unknown): boolean {\n return (\n isRecord(value) &&\n typeof value.id === 'string' &&\n typeof value.name === 'string' &&\n isThemeModeConfig(value.light) &&\n isThemeModeConfig(value.dark)\n );\n}\n\nexport function isNavigatorSpec(value: unknown): boolean {\n return (\n isRecord(value) &&\n typeof value.type === 'string' &&\n NAVIGATOR_TYPE_SET.has(value.type) &&\n isOptionalString(value.initialRouteName) &&\n Array.isArray(value.routes) &&\n value.routes.every(isRouteDefinition) &&\n (value.options === undefined || isRecord(value.options))\n );\n}\n\nexport function isScreenRegistry(value: unknown): boolean {\n return (\n isRecord(value) &&\n Object.entries(value).every(\n ([registryKey, screen]) =>\n isScreenSpec(screen) && isRecord(screen) && registryKey === screen.id,\n )\n );\n}\n\nexport function isSplashScreenSpec(value: unknown): boolean {\n return (\n isSplashScreenModeSpec(value) &&\n isRecord(value) &&\n (value.dark === undefined || isSplashScreenModeSpec(value.dark))\n );\n}\n\nfunction isThemeModeConfig(value: unknown): boolean {\n return (\n isRecord(value) &&\n typeof value.primaryColor === 'string' &&\n typeof value.harmony === 'string' &&\n COLOR_HARMONY_SET.has(value.harmony)\n );\n}\n\nfunction isUiNode(value: unknown): boolean {\n return (\n isRecord(value) &&\n typeof value.id === 'string' &&\n typeof value.type === 'string' &&\n isOptionalString(value.alias) &&\n (value.props === undefined || isRecord(value.props)) &&\n (value.style === undefined || isRecord(value.style)) &&\n (value.repeat === undefined || isUiNodeRepeatSpec(value.repeat)) &&\n (value.children === undefined ||\n (Array.isArray(value.children) && value.children.every(isUiNode)))\n );\n}\n\nfunction isUiNodeRepeatSpec(value: unknown): boolean {\n return (\n isRecord(value) &&\n isBindingValueSource(value.source) &&\n isOptionalString(value.itemAlias) &&\n isOptionalString(value.keyPath) &&\n (value.empty === undefined || (Array.isArray(value.empty) && value.empty.every(isUiNode)))\n );\n}\n\nfunction isScreenSpec(value: unknown): boolean {\n return (\n isRecord(value) &&\n typeof value.id === 'string' &&\n typeof value.name === 'string' &&\n isOptionalString(value.title) &&\n isOptionalString(value.description) &&\n (value.dataLoaders === undefined ||\n (Array.isArray(value.dataLoaders) &&\n value.dataLoaders.every(isScreenDataLoaderDefinition))) &&\n (value.requires === undefined || isScreenRequirements(value.requires)) &&\n isUiNode(value.root)\n );\n}\n\nfunction isRouteDefinition(value: unknown): boolean {\n return (\n isRecord(value) &&\n typeof value.name === 'string' &&\n isOptionalString(value.path) &&\n isOptionalString(value.label) &&\n (value.icon === undefined || isIconSpec(value.icon)) &&\n isOptionalBoolean(value.showInPrimaryNavigation) &&\n (value.guards === undefined || isStringArray(value.guards)) &&\n isOptionalString(value.screenId) &&\n (value.navigator === undefined || isNavigatorSpec(value.navigator))\n );\n}\n\nfunction isIconSpec(value: unknown): boolean {\n return (\n isRecord(value) &&\n typeof value.name === 'string' &&\n isOptionalString(value.provider) &&\n (value.size === undefined ||\n typeof value.size === 'string' ||\n typeof value.size === 'number') &&\n isOptionalString(value.color)\n );\n}\n\nfunction isSplashScreenModeSpec(value: unknown): boolean {\n return (\n isRecord(value) &&\n isOptionalString(value.image) &&\n isOptionalNumber(value.imageWidth) &&\n (value.resizeMode === undefined ||\n (typeof value.resizeMode === 'string' &&\n SPLASH_SCREEN_RESIZE_MODE_SET.has(value.resizeMode))) &&\n isOptionalString(value.backgroundColor)\n );\n}\n\nfunction isScreenRequirements(value: unknown): boolean {\n return (\n isRecord(value) &&\n (value.permissions === undefined || isRequirementArray(value.permissions, 'permission')) &&\n (value.capabilities === undefined || isRequirementArray(value.capabilities, 'capability'))\n );\n}\n\nfunction isRequirementArray(value: unknown, key: 'capability' | 'permission'): boolean {\n return (\n Array.isArray(value) &&\n value.every((entry) => isRecord(entry) && typeof entry[key] === 'string')\n );\n}\n"]}
1
+ {"version":3,"file":"screens.js","sourceRoot":"","sources":["../../src/appManifest/screens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,EACL,yBAAyB,EACzB,+BAA+B,EAC/B,6BAA6B,EAC7B,iBAAiB,EACjB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,QAAQ,EACR,aAAa,GACd,MAAM,UAAU,CAAC;AAElB,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAS,cAAc,CAAC,CAAC;AACzD,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAS,eAAe,CAAC,CAAC;AAC3D,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAAS,yBAAyB,CAAC,CAAC;AAChF,MAAM,kCAAkC,GAAG,IAAI,GAAG,CAAS,+BAA+B,CAAC,CAAC;AAC5F,MAAM,gCAAgC,GAAG,IAAI,GAAG,CAAS,6BAA6B,CAAC,CAAC;AACxF,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAS,iBAAiB,CAAC,CAAC;AAChE,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAS,eAAe,C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C,KAAK,QAAQ,CAAC,CAC1E,CAAC;AACJ,CAAC","sourcesContent":["import { COLOR_HARMONIES } from '@ankhorage/color-theory';\n\nimport {\n CUSTOM_TABS_PRESENTATIONS,\n FIXED_CUSTOM_TABS_PRESENTATIONS,\n JAVASCRIPT_TABS_PRESENTATIONS,\n NAVIGATOR_PRESETS,\n NAVIGATOR_TYPES,\n} from '../navigator';\nimport { APP_CATEGORIES } from '../types';\nimport { isBindingValueSource, isScreenDataLoaderDefinition } from './bindings';\nimport {\n isOptionalBoolean,\n isOptionalNumber,\n isOptionalString,\n isRecord,\n isStringArray,\n} from './shared';\n\nconst APP_CATEGORY_SET = new Set<string>(APP_CATEGORIES);\nconst COLOR_HARMONY_SET = new Set<string>(COLOR_HARMONIES);\nconst CUSTOM_TABS_PRESENTATION_SET = new Set<string>(CUSTOM_TABS_PRESENTATIONS);\nconst FIXED_CUSTOM_TABS_PRESENTATION_SET = new Set<string>(FIXED_CUSTOM_TABS_PRESENTATIONS);\nconst JAVASCRIPT_TABS_PRESENTATION_SET = new Set<string>(JAVASCRIPT_TABS_PRESENTATIONS);\nconst NAVIGATOR_PRESET_SET = new Set<string>(NAVIGATOR_PRESETS);\nconst NAVIGATOR_TYPE_SET = new Set<string>(NAVIGATOR_TYPES);\nconst SPLASH_SCREEN_RESIZE_MODE_SET = new Set<string>(['contain', 'cover', 'native']);\n\nexport function isManifestMetadata(value: unknown): boolean {\n return (\n isRecord(value) &&\n typeof value.name === 'string' &&\n typeof value.slug === 'string' &&\n typeof value.version === 'string' &&\n typeof value.category === 'string' &&\n APP_CATEGORY_SET.has(value.category) &&\n typeof value.themeId === 'string' &&\n isOptionalString(value.created) &&\n isOptionalString(value.updated)\n );\n}\n\nexport function isThemeConfig(value: unknown): boolean {\n return (\n isRecord(value) &&\n typeof value.id === 'string' &&\n typeof value.name === 'string' &&\n isThemeModeConfig(value.light) &&\n isThemeModeConfig(value.dark)\n );\n}\n\n/*** Validate the complete serialized `AppManifest.navigator` slice. */\nexport function isAppNavigatorManifest(value: unknown): boolean {\n return (\n isRecord(value) &&\n isNavigatorNode(value) &&\n (value.preset === undefined ||\n (typeof value.preset === 'string' && NAVIGATOR_PRESET_SET.has(value.preset))) &&\n (value.flows === undefined || isNavigatorFlows(value.flows)) &&\n (value.defaults === undefined || isNavigatorDefaults(value.defaults)) &&\n (value.platforms === undefined || isNavigatorPlatforms(value.platforms))\n );\n}\n\nexport function isScreenRegistry(value: unknown): boolean {\n return (\n isRecord(value) &&\n Object.entries(value).every(\n ([registryKey, screen]) =>\n isScreenSpec(screen) && isRecord(screen) && registryKey === screen.id,\n )\n );\n}\n\nexport function isSplashScreenSpec(value: unknown): boolean {\n return (\n isSplashScreenModeSpec(value) &&\n isRecord(value) &&\n (value.dark === undefined || isSplashScreenModeSpec(value.dark))\n );\n}\n\nfunction isThemeModeConfig(value: unknown): boolean {\n return (\n isRecord(value) &&\n typeof value.primaryColor === 'string' &&\n typeof value.harmony === 'string' &&\n COLOR_HARMONY_SET.has(value.harmony)\n );\n}\n\nfunction isUiNode(value: unknown): boolean {\n return (\n isRecord(value) &&\n typeof value.id === 'string' &&\n typeof value.type === 'string' &&\n isOptionalString(value.alias) &&\n (value.props === undefined || isRecord(value.props)) &&\n (value.style === undefined || isRecord(value.style)) &&\n (value.repeat === undefined || isUiNodeRepeatSpec(value.repeat)) &&\n (value.children === undefined ||\n (Array.isArray(value.children) && value.children.every(isUiNode)))\n );\n}\n\nfunction isUiNodeRepeatSpec(value: unknown): boolean {\n return (\n isRecord(value) &&\n isBindingValueSource(value.source) &&\n isOptionalString(value.itemAlias) &&\n isOptionalString(value.keyPath) &&\n (value.empty === undefined || (Array.isArray(value.empty) && value.empty.every(isUiNode)))\n );\n}\n\nfunction isScreenSpec(value: unknown): boolean {\n return (\n isRecord(value) &&\n typeof value.id === 'string' &&\n typeof value.name === 'string' &&\n isOptionalString(value.title) &&\n isOptionalString(value.description) &&\n (value.dataLoaders === undefined ||\n (Array.isArray(value.dataLoaders) &&\n value.dataLoaders.every(isScreenDataLoaderDefinition))) &&\n (value.requires === undefined || isScreenRequirements(value.requires)) &&\n isUiNode(value.root)\n );\n}\n\n/*** Validate one nested navigator node independently from app-level authoring metadata. */\nfunction isNavigatorNode(value: unknown): boolean {\n return (\n isRecord(value) &&\n typeof value.type === 'string' &&\n NAVIGATOR_TYPE_SET.has(value.type) &&\n isOptionalString(value.initialRouteName) &&\n Array.isArray(value.routes) &&\n value.routes.every(isRouteDefinition) &&\n (value.options === undefined || isRecord(value.options)) &&\n (value.type !== 'tabs' || isTabsImplementationConfig(value))\n );\n}\n\nfunction isRouteDefinition(value: unknown): boolean {\n return (\n isRecord(value) &&\n typeof value.name === 'string' &&\n isOptionalString(value.path) &&\n isOptionalString(value.label) &&\n (value.icon === undefined || isIconSpec(value.icon)) &&\n isOptionalBoolean(value.showInPrimaryNavigation) &&\n (value.guards === undefined || isStringArray(value.guards)) &&\n isOptionalString(value.screenId) &&\n (value.navigator === undefined || isNavigatorNode(value.navigator))\n );\n}\n\nfunction isIconSpec(value: unknown): boolean {\n return (\n isRecord(value) &&\n typeof value.name === 'string' &&\n isOptionalString(value.provider) &&\n (value.size === undefined ||\n typeof value.size === 'string' ||\n typeof value.size === 'number') &&\n isOptionalString(value.color)\n );\n}\n\n/*** Validate tabs implementation desired state, with omitted implementation meaning adaptive. */\nfunction isTabsImplementationConfig(value: Record<string, unknown>): boolean {\n if (value.implementation === undefined || value.implementation === 'adaptive') {\n return (\n (value.native === undefined || isNativeTabsConfig(value.native)) &&\n (value.web === undefined || isCustomTabsWebConfig(value.web))\n );\n }\n\n if (value.implementation === 'native') return true;\n\n if (value.implementation === 'javascript') {\n return (\n value.presentation === undefined ||\n (typeof value.presentation === 'string' &&\n JAVASCRIPT_TABS_PRESENTATION_SET.has(value.presentation))\n );\n }\n\n return value.implementation === 'custom' && isCustomTabsConfig(value);\n}\n\n/*** Validate the native branch used by adaptive tabs. */\nfunction isNativeTabsConfig(value: unknown): boolean {\n return isRecord(value) && value.implementation === 'native';\n}\n\n/*** Validate a full custom-tabs implementation config. */\nfunction isCustomTabsConfig(value: Record<string, unknown>): boolean {\n return value.implementation === 'custom' && isCustomTabsPresentationConfig(value);\n}\n\n/*** Validate the implementation-free custom-tabs Web branch inside adaptive tabs. */\nfunction isCustomTabsWebConfig(value: unknown): boolean {\n return (\n isRecord(value) && value.implementation === undefined && isCustomTabsPresentationConfig(value)\n );\n}\n\n/*** Validate custom-tab presentation and its conditional serializable configuration. */\nfunction isCustomTabsPresentationConfig(value: Record<string, unknown>): boolean {\n if (\n typeof value.presentation !== 'string' ||\n !CUSTOM_TABS_PRESENTATION_SET.has(value.presentation)\n ) {\n return false;\n }\n\n if (value.responsive !== undefined && !isResponsiveTabsPresentation(value.responsive)) {\n return false;\n }\n\n if (!isOptionalString(value.customPresentationId)) return false;\n if (value.presentation === 'responsive' && value.responsive === undefined) return false;\n\n return (\n value.presentation !== 'custom' ||\n (typeof value.customPresentationId === 'string' && value.customPresentationId.length > 0)\n );\n}\n\n/*** Validate semantic compact/medium/expanded custom-tab presentation mapping. */\nfunction isResponsiveTabsPresentation(value: unknown): boolean {\n return (\n isRecord(value) &&\n typeof value.compact === 'string' &&\n FIXED_CUSTOM_TABS_PRESENTATION_SET.has(value.compact) &&\n (value.medium === undefined ||\n (typeof value.medium === 'string' && FIXED_CUSTOM_TABS_PRESENTATION_SET.has(value.medium))) &&\n typeof value.expanded === 'string' &&\n FIXED_CUSTOM_TABS_PRESENTATION_SET.has(value.expanded)\n );\n}\n\n/*** Validate optional app-level navigator flow intent. */\nfunction isNavigatorFlows(value: unknown): boolean {\n return (\n isRecord(value) &&\n isOptionalBoolean(value.onboarding) &&\n isOptionalBoolean(value.authentication)\n );\n}\n\n/*** Validate package-owned navigator defaults without requiring a navigator node type. */\nfunction isNavigatorDefaults(value: unknown): boolean {\n return (\n isRecord(value) &&\n (value.tabs === undefined || (isRecord(value.tabs) && isTabsImplementationConfig(value.tabs)))\n );\n}\n\n/*** Validate per-platform navigator implementation overrides. */\nfunction isNavigatorPlatforms(value: unknown): boolean {\n return (\n isRecord(value) &&\n (value.android === undefined || isNavigatorPlatformConfig(value.android)) &&\n (value.ios === undefined || isNavigatorPlatformConfig(value.ios)) &&\n (value.web === undefined || isNavigatorPlatformConfig(value.web))\n );\n}\n\n/*** Validate one platform-specific navigator override slice. */\nfunction isNavigatorPlatformConfig(value: unknown): boolean {\n return (\n isRecord(value) &&\n (value.tabs === undefined || (isRecord(value.tabs) && isTabsImplementationConfig(value.tabs)))\n );\n}\n\nfunction isSplashScreenModeSpec(value: unknown): boolean {\n return (\n isRecord(value) &&\n isOptionalString(value.image) &&\n isOptionalNumber(value.imageWidth) &&\n (value.resizeMode === undefined ||\n (typeof value.resizeMode === 'string' &&\n SPLASH_SCREEN_RESIZE_MODE_SET.has(value.resizeMode))) &&\n isOptionalString(value.backgroundColor)\n );\n}\n\nfunction isScreenRequirements(value: unknown): boolean {\n return (\n isRecord(value) &&\n (value.permissions === undefined || isRequirementArray(value.permissions, 'permission')) &&\n (value.capabilities === undefined || isRequirementArray(value.capabilities, 'capability'))\n );\n}\n\nfunction isRequirementArray(value: unknown, key: 'capability' | 'permission'): boolean {\n return (\n Array.isArray(value) &&\n value.every((entry) => isRecord(entry) && typeof entry[key] === 'string')\n );\n}\n"]}
@@ -3,7 +3,7 @@ import { isDataSourceRegistry } from './appManifest/dataSources';
3
3
  import { isAppDeployManifest } from './appManifest/deploy';
4
4
  import { isInfraManifest } from './appManifest/infra';
5
5
  import { isMediaManifest } from './appManifest/media';
6
- import { isManifestMetadata, isNavigatorSpec, isScreenRegistry, isSplashScreenSpec, isThemeConfig, } from './appManifest/screens';
6
+ import { isAppNavigatorManifest, isManifestMetadata, isScreenRegistry, isSplashScreenSpec, isThemeConfig, } from './appManifest/screens';
7
7
  import { isRecord, isStringArray } from './appManifest/shared';
8
8
  const APP_MANIFEST_KEY_POLICY = {
9
9
  metadata: 'required',
@@ -47,7 +47,7 @@ export function isAppManifest(value) {
47
47
  (value.media === undefined || isMediaManifest(value.media)) &&
48
48
  (value.deploy === undefined || isAppDeployManifest(value.deploy)) &&
49
49
  isInfraManifest(value.infra) &&
50
- isNavigatorSpec(value.navigator) &&
50
+ isAppNavigatorManifest(value.navigator) &&
51
51
  isScreenRegistry(value.screens) &&
52
52
  (value.dataSources === undefined || isDataSourceRegistry(value.dataSources)) &&
53
53
  (value.dataBindings === undefined || isComponentDataBindingRegistry(value.dataBindings)) &&
@@ -1 +1 @@
1
- {"version":3,"file":"appManifest.js","sourceRoot":"","sources":["../src/appManifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,GACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAO/D,MAAM,uBAAuB,GAAG;IAC9B,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,UAAU;IAClB,aAAa,EAAE,UAAU;IACzB,eAAe,EAAE,UAAU;IAC3B,YAAY,EAAE,UAAU;IACxB,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,UAAU;IAClB,KAAK,EAAE,UAAU;IACjB,SAAS,EAAE,UAAU;IACrB,OAAO,EAAE,UAAU;IACnB,WAAW,EAAE,UAAU;IACvB,YAAY,EAAE,UAAU;IACxB,UAAU,EAAE,UAAU;IACtB,QAAQ,EAAE,UAAU;CACiD,CAAC;AAExE;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,K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,CAAC","sourcesContent":["import { isComponentDataBindingRegistry } from './appManifest/bindings';\nimport { isDataSourceRegistry } from './appManifest/dataSources';\nimport { isAppDeployManifest } from './appManifest/deploy';\nimport { isInfraManifest } from './appManifest/infra';\nimport { isMediaManifest } from './appManifest/media';\nimport {\n isManifestMetadata,\n isNavigatorSpec,\n isScreenRegistry,\n isSplashScreenSpec,\n isThemeConfig,\n} from './appManifest/screens';\nimport { isRecord, isStringArray } from './appManifest/shared';\nimport type { AppManifest } from './types';\n\nexport type AppManifestParseResult =\n | { readonly ok: true; readonly manifest: AppManifest }\n | { readonly ok: false; readonly message: string };\n\nconst APP_MANIFEST_KEY_POLICY = {\n metadata: 'required',\n themes: 'required',\n activeThemeId: 'required',\n activeThemeMode: 'optional',\n splashScreen: 'optional',\n media: 'optional',\n deploy: 'optional',\n infra: 'required',\n navigator: 'required',\n screens: 'required',\n dataSources: 'optional',\n dataBindings: 'optional',\n repository: 'optional',\n settings: 'required',\n} as const satisfies Record<keyof AppManifest, 'optional' | 'required'>;\n\n/**\n * Parse unknown JSON-compatible input at the canonical AppManifest boundary.\n *\n * Contracts owns structural manifest validation. Consumers may add semantic\n * diagnostics after this parser succeeds, but should not reconstruct the\n * AppManifest shape in their own packages.\n */\nexport function parseAppManifest(value: unknown): AppManifestParseResult {\n return isAppManifest(value)\n ? { ok: true, manifest: value }\n : { ok: false, message: 'Value is not a canonical AppManifest.' };\n}\n\n/** Return whether an unknown value satisfies the canonical AppManifest shape. */\nexport function isAppManifest(value: unknown): value is AppManifest {\n return (\n isRecord(value) &&\n hasRequiredManifestKeys(value) &&\n !('generatedApis' in value) &&\n isManifestMetadata(value.metadata) &&\n Array.isArray(value.themes) &&\n value.themes.every(isThemeConfig) &&\n typeof value.activeThemeId === 'string' &&\n isActiveThemeMode(value.activeThemeMode) &&\n (value.splashScreen === undefined || isSplashScreenSpec(value.splashScreen)) &&\n (value.media === undefined || isMediaManifest(value.media)) &&\n (value.deploy === undefined || isAppDeployManifest(value.deploy)) &&\n isInfraManifest(value.infra) &&\n isNavigatorSpec(value.navigator) &&\n isScreenRegistry(value.screens) &&\n (value.dataSources === undefined || isDataSourceRegistry(value.dataSources)) &&\n (value.dataBindings === undefined || isComponentDataBindingRegistry(value.dataBindings)) &&\n (value.repository === undefined || isRepositoryManifest(value.repository)) &&\n isAppSettings(value.settings)\n );\n}\n\nfunction hasRequiredManifestKeys(value: Record<string, unknown>): boolean {\n return Object.entries(APP_MANIFEST_KEY_POLICY).every(\n ([key, policy]) => policy === 'optional' || key in value,\n );\n}\n\nfunction isActiveThemeMode(value: unknown): boolean {\n return value === undefined || value === 'dark' || value === 'light';\n}\n\nfunction isRepositoryManifest(value: unknown): boolean {\n return (\n isRecord(value) &&\n value.provider === 'github' &&\n typeof value.owner === 'string' &&\n value.owner.length > 0 &&\n typeof value.name === 'string' &&\n value.name.length > 0 &&\n typeof value.url === 'string' &&\n value.url.length > 0 &&\n value.defaultBranch === 'main'\n );\n}\n\nfunction isAppSettings(value: unknown): boolean {\n return (\n isRecord(value) &&\n !('apiBaseUrl' in value) &&\n isRecord(value.localization) &&\n typeof value.localization.defaultLocale === 'string' &&\n isStringArray(value.localization.locales)\n );\n}\n"]}
1
+ {"version":3,"file":"appManifest.js","sourceRoot":"","sources":["../src/appManifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,aAAa,GACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,s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AAG,CAAC;QACrB,OAAO,KAAK,CAAC,GAAG,KAAK,QAAQ;QAC7B,KAAK,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC;QACpB,KAAK,CAAC,aAAa,KAAK,MAAM,CAC/B,CAAC;AACJ,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACnC,OAAO,CACL,QAAQ,CAAC,KAAK,CAAC;QACf,CAAC,CAAC,YAAY,IAAI,KAAK,CAAC;QACxB,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC;QAC5B,OAAO,KAAK,CAAC,YAAY,CAAC,aAAa,KAAK,QAAQ;QACpD,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAC1C,CAAC;AACJ,CAAC","sourcesContent":["import { isComponentDataBindingRegistry } from './appManifest/bindings';\nimport { isDataSourceRegistry } from './appManifest/dataSources';\nimport { isAppDeployManifest } from './appManifest/deploy';\nimport { isInfraManifest } from './appManifest/infra';\nimport { isMediaManifest } from './appManifest/media';\nimport {\n isAppNavigatorManifest,\n isManifestMetadata,\n isScreenRegistry,\n isSplashScreenSpec,\n isThemeConfig,\n} from './appManifest/screens';\nimport { isRecord, isStringArray } from './appManifest/shared';\nimport type { AppManifest } from './types';\n\nexport type AppManifestParseResult =\n | { readonly ok: true; readonly manifest: AppManifest }\n | { readonly ok: false; readonly message: string };\n\nconst APP_MANIFEST_KEY_POLICY = {\n metadata: 'required',\n themes: 'required',\n activeThemeId: 'required',\n activeThemeMode: 'optional',\n splashScreen: 'optional',\n media: 'optional',\n deploy: 'optional',\n infra: 'required',\n navigator: 'required',\n screens: 'required',\n dataSources: 'optional',\n dataBindings: 'optional',\n repository: 'optional',\n settings: 'required',\n} as const satisfies Record<keyof AppManifest, 'optional' | 'required'>;\n\n/**\n * Parse unknown JSON-compatible input at the canonical AppManifest boundary.\n *\n * Contracts owns structural manifest validation. Consumers may add semantic\n * diagnostics after this parser succeeds, but should not reconstruct the\n * AppManifest shape in their own packages.\n */\nexport function parseAppManifest(value: unknown): AppManifestParseResult {\n return isAppManifest(value)\n ? { ok: true, manifest: value }\n : { ok: false, message: 'Value is not a canonical AppManifest.' };\n}\n\n/** Return whether an unknown value satisfies the canonical AppManifest shape. */\nexport function isAppManifest(value: unknown): value is AppManifest {\n return (\n isRecord(value) &&\n hasRequiredManifestKeys(value) &&\n !('generatedApis' in value) &&\n isManifestMetadata(value.metadata) &&\n Array.isArray(value.themes) &&\n value.themes.every(isThemeConfig) &&\n typeof value.activeThemeId === 'string' &&\n isActiveThemeMode(value.activeThemeMode) &&\n (value.splashScreen === undefined || isSplashScreenSpec(value.splashScreen)) &&\n (value.media === undefined || isMediaManifest(value.media)) &&\n (value.deploy === undefined || isAppDeployManifest(value.deploy)) &&\n isInfraManifest(value.infra) &&\n isAppNavigatorManifest(value.navigator) &&\n isScreenRegistry(value.screens) &&\n (value.dataSources === undefined || isDataSourceRegistry(value.dataSources)) &&\n (value.dataBindings === undefined || isComponentDataBindingRegistry(value.dataBindings)) &&\n (value.repository === undefined || isRepositoryManifest(value.repository)) &&\n isAppSettings(value.settings)\n );\n}\n\nfunction hasRequiredManifestKeys(value: Record<string, unknown>): boolean {\n return Object.entries(APP_MANIFEST_KEY_POLICY).every(\n ([key, policy]) => policy === 'optional' || key in value,\n );\n}\n\nfunction isActiveThemeMode(value: unknown): boolean {\n return value === undefined || value === 'dark' || value === 'light';\n}\n\nfunction isRepositoryManifest(value: unknown): boolean {\n return (\n isRecord(value) &&\n value.provider === 'github' &&\n typeof value.owner === 'string' &&\n value.owner.length > 0 &&\n typeof value.name === 'string' &&\n value.name.length > 0 &&\n typeof value.url === 'string' &&\n value.url.length > 0 &&\n value.defaultBranch === 'main'\n );\n}\n\nfunction isAppSettings(value: unknown): boolean {\n return (\n isRecord(value) &&\n !('apiBaseUrl' in value) &&\n isRecord(value.localization) &&\n typeof value.localization.defaultLocale === 'string' &&\n isStringArray(value.localization.locales)\n );\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -6,6 +6,7 @@ export * from './data';
6
6
  export * from './db';
7
7
  export * from './deploy';
8
8
  export * from './media';
9
+ export * from './navigator';
9
10
  export * from './repository';
10
11
  export * from './requirements';
11
12
  export * from './runtimeCallbacks';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC"}
package/dist/index.js CHANGED
@@ -6,6 +6,7 @@ export * from './data';
6
6
  export * from './db';
7
7
  export * from './deploy';
8
8
  export * from './media';
9
+ export * from './navigator';
9
10
  export * from './repository';
10
11
  export * from './requirements';
11
12
  export * from './runtimeCallbacks';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC","sourcesContent":["export * from './appManifest';\nexport * from './auth';\nexport * from './bindings';\nexport * from './cli';\nexport * from './data';\nexport * from './db';\nexport * from './deploy';\nexport * from './media';\nexport * from './repository';\nexport * from './requirements';\nexport * from './runtimeCallbacks';\nexport * from './secretManifest';\nexport * from './secrets';\nexport * from './state';\nexport * from './storage';\nexport * from './theme';\nexport * from './types';\nexport * from './ui';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC","sourcesContent":["export * from './appManifest';\nexport * from './auth';\nexport * from './bindings';\nexport * from './cli';\nexport * from './data';\nexport * from './db';\nexport * from './deploy';\nexport * from './media';\nexport * from './navigator';\nexport * from './repository';\nexport * from './requirements';\nexport * from './runtimeCallbacks';\nexport * from './secretManifest';\nexport * from './secrets';\nexport * from './state';\nexport * from './storage';\nexport * from './theme';\nexport * from './types';\nexport * from './ui';\n"]}
@@ -0,0 +1,96 @@
1
+ import type { IconSpec } from './types';
2
+ export declare const NAVIGATOR_TYPES: readonly ["stack", "tabs", "drawer"];
3
+ export type NavigatorType = (typeof NAVIGATOR_TYPES)[number];
4
+ export declare const NAVIGATOR_PRESETS: readonly ["stack", "tabs", "tabs-stack", "drawer", "drawer-stack", "drawer-tabs", "drawer-tabs-stack", "root-stack-tabs", "root-stack-tabs-stack", "root-stack-drawer", "root-stack-drawer-stack", "root-stack-drawer-tabs", "root-stack-drawer-tabs-stack"];
5
+ export type NavigatorPreset = (typeof NAVIGATOR_PRESETS)[number];
6
+ export declare const FIXED_CUSTOM_TABS_PRESENTATIONS: readonly ["bottom", "top", "rail", "sidebar"];
7
+ export type FixedCustomTabsPresentation = (typeof FIXED_CUSTOM_TABS_PRESENTATIONS)[number];
8
+ export declare const CUSTOM_TABS_PRESENTATIONS: readonly ["bottom", "top", "rail", "sidebar", "responsive", "custom"];
9
+ export type CustomTabsPresentation = (typeof CUSTOM_TABS_PRESENTATIONS)[number];
10
+ export declare const JAVASCRIPT_TABS_PRESENTATIONS: readonly ["bottom", "top"];
11
+ export type JavaScriptTabsPresentation = (typeof JAVASCRIPT_TABS_PRESENTATIONS)[number];
12
+ export interface ResponsiveTabsPresentation {
13
+ compact: FixedCustomTabsPresentation;
14
+ medium?: FixedCustomTabsPresentation;
15
+ expanded: FixedCustomTabsPresentation;
16
+ }
17
+ export interface CustomTabsConfig {
18
+ implementation: 'custom';
19
+ presentation: CustomTabsPresentation;
20
+ responsive?: ResponsiveTabsPresentation;
21
+ /** Serializable registered presentation id used when `presentation` is `custom`. */
22
+ customPresentationId?: string;
23
+ }
24
+ export interface NativeTabsConfig {
25
+ implementation: 'native';
26
+ }
27
+ export interface JavaScriptTabsConfig {
28
+ implementation: 'javascript';
29
+ presentation?: JavaScriptTabsPresentation;
30
+ }
31
+ export interface AdaptiveTabsConfig {
32
+ /** Omission selects the canonical adaptive default. */
33
+ implementation?: 'adaptive';
34
+ /** Android/iOS branch. Expo Router may expose this implementation as unstable. */
35
+ native?: NativeTabsConfig;
36
+ /** Web branch rendered through headless custom tabs. */
37
+ web?: Omit<CustomTabsConfig, 'implementation'>;
38
+ }
39
+ export type TabsImplementationConfig = AdaptiveTabsConfig | CustomTabsConfig | JavaScriptTabsConfig | NativeTabsConfig;
40
+ interface NavigatorNodeBase {
41
+ initialRouteName?: string;
42
+ routes: RouteDefinition[];
43
+ /** Typed upstream options can be layered by the owning Navigator package. */
44
+ options?: Record<string, unknown>;
45
+ }
46
+ export interface StackNavigatorNode extends NavigatorNodeBase {
47
+ type: 'stack';
48
+ }
49
+ export interface DrawerNavigatorNode extends NavigatorNodeBase {
50
+ type: 'drawer';
51
+ }
52
+ export type TabsNavigatorConfig = {
53
+ type: 'tabs';
54
+ } & TabsImplementationConfig;
55
+ export type TabsNavigatorNode = NavigatorNodeBase & TabsNavigatorConfig;
56
+ export type NavigatorNode = DrawerNavigatorNode | StackNavigatorNode | TabsNavigatorNode;
57
+ export interface RouteDefinition {
58
+ name: string;
59
+ path?: string;
60
+ label?: string;
61
+ icon?: IconSpec;
62
+ /** Hide this route from primary Tabs/Drawer presentation without making it unnavigable. */
63
+ showInPrimaryNavigation?: boolean;
64
+ guards?: string[];
65
+ screenId?: string;
66
+ navigator?: NavigatorNode;
67
+ }
68
+ export interface NavigatorFlows {
69
+ onboarding?: boolean;
70
+ authentication?: boolean;
71
+ }
72
+ export interface NavigatorDefaults {
73
+ tabs?: TabsImplementationConfig;
74
+ }
75
+ export interface NavigatorPlatformConfig {
76
+ tabs?: TabsImplementationConfig;
77
+ }
78
+ export interface NavigatorPlatforms {
79
+ android?: NavigatorPlatformConfig;
80
+ ios?: NavigatorPlatformConfig;
81
+ web?: NavigatorPlatformConfig;
82
+ }
83
+ /**
84
+ * Serializable desired state for `AppManifest.navigator`.
85
+ *
86
+ * The manifest slice is the root navigator tree itself; optional authoring metadata does not add
87
+ * a redundant `root` wrapper. The standalone Navigator capability consumes this slice directly.
88
+ */
89
+ export type AppNavigatorManifest = NavigatorNode & {
90
+ preset?: NavigatorPreset;
91
+ flows?: NavigatorFlows;
92
+ defaults?: NavigatorDefaults;
93
+ platforms?: NavigatorPlatforms;
94
+ };
95
+ export {};
96
+ //# sourceMappingURL=navigator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigator.d.ts","sourceRoot":"","sources":["../src/navigator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAExC,eAAO,MAAM,eAAe,sCAAuC,CAAC;AACpE,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,eAAO,MAAM,iBAAiB,8PAcpB,CAAC;AACX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjE,eAAO,MAAM,+BAA+B,+CAAgD,CAAC;AAC7F,MAAM,MAAM,2BAA2B,GAAG,CAAC,OAAO,+BAA+B,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3F,eAAO,MAAM,yBAAyB,uEAI5B,CAAC;AACX,MAAM,MAAM,sBAAsB,GAA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AAC,EAAE,kBAAkB,CAAC;CAChC,CAAC"}
@@ -0,0 +1,24 @@
1
+ export const NAVIGATOR_TYPES = ['stack', 'tabs', 'drawer'];
2
+ export const NAVIGATOR_PRESETS = [
3
+ 'stack',
4
+ 'tabs',
5
+ 'tabs-stack',
6
+ 'drawer',
7
+ 'drawer-stack',
8
+ 'drawer-tabs',
9
+ 'drawer-tabs-stack',
10
+ 'root-stack-tabs',
11
+ 'root-stack-tabs-stack',
12
+ 'root-stack-drawer',
13
+ 'root-stack-drawer-stack',
14
+ 'root-stack-drawer-tabs',
15
+ 'root-stack-drawer-tabs-stack',
16
+ ];
17
+ export const FIXED_CUSTOM_TABS_PRESENTATIONS = ['bottom', 'top', 'rail', 'sidebar'];
18
+ export const CUSTOM_TABS_PRESENTATIONS = [
19
+ ...FIXED_CUSTOM_TABS_PRESENTATIONS,
20
+ 'responsive',
21
+ 'custom',
22
+ ];
23
+ export const JAVASCRIPT_TABS_PRESENTATIONS = ['bottom', 'top'];
24
+ //# sourceMappingURL=navigator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigator.js","sourceRoot":"","sources":["../src/navigator.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAU,CAAC;AAGpE,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,OAAO;IACP,MAAM;IACN,YAAY;IACZ,QAAQ;IACR,cAAc;IACd,aAAa;IACb,mBAAmB;IACnB,iBAAiB;IACjB,uBAAuB;IACvB,mBAAmB;IACnB,yBAAyB;IACzB,wBAAwB;IACxB,8BAA8B;CACtB,CAAC;AAGX,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAU,CAAC;AAG7F,MAAM,CAAC,MAAM,yBAAyB,GAAG;IACvC,GAAG,+BAA+B;IAClC,YAAY;IACZ,QAAQ;CACA,CAAC;AAGX,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAU,CAAC","sourcesContent":["import type { IconSpec } from './types';\n\nexport const NAVIGATOR_TYPES = ['stack', 'tabs', 'drawer'] as const;\nexport type NavigatorType = (typeof NAVIGATOR_TYPES)[number];\n\nexport const NAVIGATOR_PRESETS = [\n 'stack',\n 'tabs',\n 'tabs-stack',\n 'drawer',\n 'drawer-stack',\n 'drawer-tabs',\n 'drawer-tabs-stack',\n 'root-stack-tabs',\n 'root-stack-tabs-stack',\n 'root-stack-drawer',\n 'root-stack-drawer-stack',\n 'root-stack-drawer-tabs',\n 'root-stack-drawer-tabs-stack',\n] as const;\nexport type NavigatorPreset = (typeof NAVIGATOR_PRESETS)[number];\n\nexport const FIXED_CUSTOM_TABS_PRESENTATIONS = ['bottom', 'top', 'rail', 'sidebar'] as const;\nexport type FixedCustomTabsPresentation = (typeof FIXED_CUSTOM_TABS_PRESENTATIONS)[number];\n\nexport const CUSTOM_TABS_PRESENTATIONS = [\n ...FIXED_CUSTOM_TABS_PRESENTATIONS,\n 'responsive',\n 'custom',\n] as const;\nexport type CustomTabsPresentation = (typeof CUSTOM_TABS_PRESENTATIONS)[number];\n\nexport const JAVASCRIPT_TABS_PRESENTATIONS = ['bottom', 'top'] as const;\nexport type JavaScriptTabsPresentation = (typeof JAVASCRIPT_TABS_PRESENTATIONS)[number];\n\nexport interface ResponsiveTabsPresentation {\n compact: FixedCustomTabsPresentation;\n medium?: FixedCustomTabsPresentation;\n expanded: FixedCustomTabsPresentation;\n}\n\nexport interface CustomTabsConfig {\n implementation: 'custom';\n presentation: CustomTabsPresentation;\n responsive?: ResponsiveTabsPresentation;\n /** Serializable registered presentation id used when `presentation` is `custom`. */\n customPresentationId?: string;\n}\n\nexport interface NativeTabsConfig {\n implementation: 'native';\n}\n\nexport interface JavaScriptTabsConfig {\n implementation: 'javascript';\n presentation?: JavaScriptTabsPresentation;\n}\n\nexport interface AdaptiveTabsConfig {\n /** Omission selects the canonical adaptive default. */\n implementation?: 'adaptive';\n /** Android/iOS branch. Expo Router may expose this implementation as unstable. */\n native?: NativeTabsConfig;\n /** Web branch rendered through headless custom tabs. */\n web?: Omit<CustomTabsConfig, 'implementation'>;\n}\n\nexport type TabsImplementationConfig =\n AdaptiveTabsConfig | CustomTabsConfig | JavaScriptTabsConfig | NativeTabsConfig;\n\ninterface NavigatorNodeBase {\n initialRouteName?: string;\n routes: RouteDefinition[];\n /** Typed upstream options can be layered by the owning Navigator package. */\n options?: Record<string, unknown>;\n}\n\nexport interface StackNavigatorNode extends NavigatorNodeBase {\n type: 'stack';\n}\n\nexport interface DrawerNavigatorNode extends NavigatorNodeBase {\n type: 'drawer';\n}\n\nexport type TabsNavigatorConfig = {\n type: 'tabs';\n} & TabsImplementationConfig;\n\nexport type TabsNavigatorNode = NavigatorNodeBase & TabsNavigatorConfig;\n\nexport type NavigatorNode = DrawerNavigatorNode | StackNavigatorNode | TabsNavigatorNode;\n\nexport interface RouteDefinition {\n name: string;\n path?: string;\n label?: string;\n icon?: IconSpec;\n /** Hide this route from primary Tabs/Drawer presentation without making it unnavigable. */\n showInPrimaryNavigation?: boolean;\n guards?: string[];\n screenId?: string;\n navigator?: NavigatorNode;\n}\n\nexport interface NavigatorFlows {\n onboarding?: boolean;\n authentication?: boolean;\n}\n\nexport interface NavigatorDefaults {\n tabs?: TabsImplementationConfig;\n}\n\nexport interface NavigatorPlatformConfig {\n tabs?: TabsImplementationConfig;\n}\n\nexport interface NavigatorPlatforms {\n android?: NavigatorPlatformConfig;\n ios?: NavigatorPlatformConfig;\n web?: NavigatorPlatformConfig;\n}\n\n/**\n * Serializable desired state for `AppManifest.navigator`.\n *\n * The manifest slice is the root navigator tree itself; optional authoring metadata does not add\n * a redundant `root` wrapper. The standalone Navigator capability consumes this slice directly.\n */\nexport type AppNavigatorManifest = NavigatorNode & {\n preset?: NavigatorPreset;\n flows?: NavigatorFlows;\n defaults?: NavigatorDefaults;\n platforms?: NavigatorPlatforms;\n};\n"]}
package/dist/types.d.ts CHANGED
@@ -4,6 +4,7 @@ import type { BindingValueSource, ComponentDataBindingRegistry, ScreenDataLoader
4
4
  import type { ApiDefinitionList, DataSourceRegistry } from './data';
5
5
  import type { AppDeployManifest } from './deploy';
6
6
  import type { MediaManifest } from './media';
7
+ import type { AppNavigatorManifest } from './navigator';
7
8
  import type { RepositoryManifest } from './repository';
8
9
  import type { ScreenRequirements } from './requirements';
9
10
  import type { ThemeGlobalTokenOverrides, ThemeRecipeOverrides } from './theme';
@@ -85,8 +86,6 @@ export interface CollectionItemPressPayload {
85
86
  export type CollectionItemPressEventDto = ComponentEventDto<'collection.itemPress', CollectionItemPressPayload>;
86
87
  export type ComponentEventDtoKind = ButtonPressEventDto['type'] | CollectionItemPressEventDto['type'] | FormSubmitEventDto['type'];
87
88
  export type KnownComponentEventDto = ButtonPressEventDto | CollectionItemPressEventDto | FormSubmitEventDto;
88
- export declare const NAVIGATOR_TYPES: readonly ["stack", "tabs", "drawer"];
89
- export type NavigatorType = (typeof NAVIGATOR_TYPES)[number];
90
89
  export declare const APP_CATEGORIES: readonly ["books_reading", "business_productivity", "developer_tools", "education_learning", "entertainment_media", "finance_money", "food_drink", "games", "graphics_design", "health_fitness", "kids_family", "lifestyle", "medical", "music_audio", "navigation_travel", "news_magazines", "photo_video", "reference", "shopping_commerce", "social_community", "sports", "utilities_tools", "weather"];
91
90
  export type AppCategory = (typeof APP_CATEGORIES)[number];
92
91
  export declare const DEPLOYMENT_TARGETS: readonly ["minikube"];
@@ -156,29 +155,6 @@ export interface ScreenSpec {
156
155
  dataLoaders?: readonly ScreenDataLoaderDefinition[];
157
156
  requires?: ScreenRequirements;
158
157
  }
159
- export interface NavigatorSpec {
160
- type: NavigatorType;
161
- initialRouteName?: string;
162
- routes: RouteDefinition[];
163
- options?: Record<string, unknown>;
164
- }
165
- export interface RouteDefinition {
166
- name: string;
167
- path?: string;
168
- label?: string;
169
- icon?: IconSpec;
170
- /**
171
- * Whether this route appears in Tabs and Drawer primary navigation.
172
- *
173
- * Omitted routes are visible by default. Setting this to `false` hides the
174
- * route from primary navigation without making it unnavigable. Stack
175
- * navigators preserve the value but do not present primary navigation.
176
- */
177
- showInPrimaryNavigation?: boolean;
178
- guards?: string[];
179
- screenId?: string;
180
- navigator?: NavigatorSpec;
181
- }
182
158
  export type SplashScreenResizeMode = 'contain' | 'cover' | 'native';
183
159
  export interface SplashScreenAssetSpec {
184
160
  readonly image?: string;
@@ -276,7 +252,7 @@ export interface AppManifest {
276
252
  /** App distribution desired state. Infrastructure deployment remains under `infra.deployment`. */
277
253
  deploy?: AppDeployManifest;
278
254
  infra: InfraManifest;
279
- navigator: NavigatorSpec;
255
+ navigator: AppNavigatorManifest;
280
256
  screens: Record<string, ScreenSpec>;
281
257
  dataSources?: DataSourceRegistry;
282
258
  dataBindings?: ComponentDataBindingRegistry;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AACnG,OAAO,KAAK,EACV,kBAAkB,EAClB,4BAA4B,EAC5B,0BAA0B,EAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CA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ACnC,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,uFAAuF;IACvF,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,kGAAkG;IAClG,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,KAAK,EAAE,aAAa,CAAC;IACrB,SAAS,EAAE,oBAAoB,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IACpC,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,YAAY,CAAC,EAAE,4BAA4B,CAAC;IAC5C,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,QAAQ,EAAE,WAAW,CAAC;CACvB"}
package/dist/types.js CHANGED
@@ -1,4 +1,3 @@
1
- export const NAVIGATOR_TYPES = ['stack', 'tabs', 'drawer'];
2
1
  export const APP_CATEGORIES = [
3
2
  'books_reading',
4
3
  'business_productivity',
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAyIA,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAU,CAAC;AAGpE,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,eAAe;IACf,uBAAuB;IACvB,iBAAiB;IACjB,oBAAoB;IACpB,qBAAqB;IACrB,eAAe;IACf,YAAY;IACZ,OAAO;IACP,iBAAiB;IACjB,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,SAAS;IACT,aAAa;IACb,mBAAmB;IACnB,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,mBAAmB;IACnB,kBAAkB;IAClB,QAAQ;IACR,iBAAiB;IACjB,SAAS;CACD,CAAC;AAGX,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,UAAU,CAAU,CAAC;AAIxD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,UAAU,CAAU,CAAC;AAIxD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,MAAM,CAAU,CAAC;AAGvD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC;AAG/D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAAQ,CAAU,CAAC;AAInD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAU,CAAC;AAGxF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAC;AAGrD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAG3D,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAU,CAAC;AAGrE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,UAAU,CAAU,CAAC;AAIpD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAU,CAAC;AAGhF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,YAAY,EAAE,qBAAqB,CAAU,CAAC;AAGpF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,GAAG,wBAAwB;IAC3B,WAAW;IACX,UAAU;IACV,aAAa;IACb,WAAW;CACH,CAAC;AAIX,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,YAAY,CAAU,CAAC;AAG3E,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAGjF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,KAAK,EAAE,KAAK,CAAU,CAAC","sourcesContent":["import type { ColorHarmony } from '@ankhorage/color-theory';\n\nimport type { AuthFlowConfig, AuthIdentifierKind, AuthOAuthConfig, AuthSignUpField } from './auth';\nimport type {\n BindingValueSource,\n ComponentDataBindingRegistry,\n ScreenDataLoaderDefinition,\n} from './bindings';\nimport type { ApiDefinitionList, DataSourceRegistry } from './data';\nimport type { AppDeployManifest } from './deploy';\nimport type { MediaManifest } from './media';\nimport type { RepositoryManifest } from './repository';\nimport type { ScreenRequirements } from './requirements';\nimport type { ThemeGlobalTokenOverrides, ThemeRecipeOverrides } from './theme';\n\nexport interface ThemeModeConfig {\n primaryColor: string;\n harmony: ColorHarmony;\n}\n\nexport interface ThemeConfig {\n id: string;\n name: string;\n light: ThemeModeConfig;\n dark: ThemeModeConfig;\n /** Theme-global authored token overrides shared by light and dark mode. */\n tokens?: ThemeGlobalTokenOverrides;\n /** Component/pattern recipe override values; recipe schemas remain package-owned metadata. */\n recipes?: ThemeRecipeOverrides;\n}\n\nexport type ActionType =\n 'navigate' | 'alert' | 'console' | 'toggleDarkMode' | 'setLanguage' | 'search' | 'filter';\n\nexport interface NavigateAction {\n type: 'navigate';\n payload: {\n route: string;\n params?: Record<string, number | string>;\n };\n}\n\nexport interface AlertAction {\n type: 'alert';\n payload?: {\n message?: string;\n };\n}\n\nexport interface ConsoleAction {\n type: 'console';\n payload?: Record<string, unknown>;\n}\n\nexport interface ToggleDarkModeAction {\n type: 'toggleDarkMode';\n payload?: never;\n}\n\nexport interface SetLanguageAction {\n type: 'setLanguage';\n payload: {\n locale: string;\n };\n}\n\nexport interface SearchAction {\n type: 'search';\n payload: {\n query: string;\n scope?: string;\n };\n}\n\nexport interface FilterAction {\n type: 'filter';\n payload: {\n filterKey: string;\n filterValue: string;\n };\n}\n\nexport type Action =\n | AlertAction\n | ConsoleAction\n | FilterAction\n | NavigateAction\n | SearchAction\n | SetLanguageAction\n | ToggleDarkModeAction;\n\nexport type ManifestValue =\n | string\n | number\n | boolean\n | null\n | readonly ManifestValue[]\n | { readonly [key: string]: ManifestValue };\n\nexport type ComponentEventPayloadValue = ManifestValue;\n\nexport interface ComponentEventDto<\n TType extends string = string,\n TPayload extends object = Record<string, ComponentEventPayloadValue>,\n> {\n readonly type: TType;\n readonly sourceNodeId: string;\n readonly payload: TPayload;\n}\n\nexport type FormSubmitValues = Record<string, ComponentEventPayloadValue>;\n\nexport type FormSubmitEventDto = ComponentEventDto<\n 'form.submit',\n {\n readonly values: FormSubmitValues;\n }\n>;\n\nexport type ButtonPressEventDto = ComponentEventDto<'button.press', Record<string, never>>;\n\nexport interface CollectionItemPressPayload {\n readonly itemId: string | number;\n readonly item: Record<string, ComponentEventPayloadValue>;\n}\n\nexport type CollectionItemPressEventDto = ComponentEventDto<\n 'collection.itemPress',\n CollectionItemPressPayload\n>;\n\nexport type ComponentEventDtoKind =\n ButtonPressEventDto['type'] | CollectionItemPressEventDto['type'] | FormSubmitEventDto['type'];\n\nexport type KnownComponentEventDto =\n ButtonPressEventDto | CollectionItemPressEventDto | FormSubmitEventDto;\n\nexport const NAVIGATOR_TYPES = ['stack', 'tabs', 'drawer'] as const;\nexport type NavigatorType = (typeof NAVIGATOR_TYPES)[number];\n\nexport const APP_CATEGORIES = [\n 'books_reading',\n 'business_productivity',\n 'developer_tools',\n 'education_learning',\n 'entertainment_media',\n 'finance_money',\n 'food_drink',\n 'games',\n 'graphics_design',\n 'health_fitness',\n 'kids_family',\n 'lifestyle',\n 'medical',\n 'music_audio',\n 'navigation_travel',\n 'news_magazines',\n 'photo_video',\n 'reference',\n 'shopping_commerce',\n 'social_community',\n 'sports',\n 'utilities_tools',\n 'weather',\n] as const;\nexport type AppCategory = (typeof APP_CATEGORIES)[number];\n\nexport const DEPLOYMENT_TARGETS = ['minikube'] as const;\nexport type KnownDeploymentTarget = (typeof DEPLOYMENT_TARGETS)[number];\nexport type DeploymentTarget = KnownDeploymentTarget | (string & {});\n\nexport const DATABASE_PROVIDERS = ['supabase'] as const;\nexport type KnownDatabaseProvider = (typeof DATABASE_PROVIDERS)[number];\nexport type DatabaseProvider = KnownDatabaseProvider | (string & {});\n\nexport const DATABASE_TIERS = ['dev', 'prod'] as const;\nexport type DatabaseTier = (typeof DATABASE_TIERS)[number];\n\nexport const STORAGE_PROVIDERS = ['auto', 's3', 'r2'] as const;\nexport type StorageProvider = (typeof STORAGE_PROVIDERS)[number];\n\nexport const STATE_PROVIDERS = ['legend'] as const;\nexport type KnownStateProvider = (typeof STATE_PROVIDERS)[number];\nexport type StateProvider = KnownStateProvider | (string & {});\n\nexport const STATE_PERSISTENCE_MODES = ['none', 'local', 'secure', 'database'] as const;\nexport type StatePersistenceMode = (typeof STATE_PERSISTENCE_MODES)[number];\n\nexport const AUTHZ_KINDS = ['RBAC', 'ABAC'] as const;\nexport type AuthzKind = (typeof AUTHZ_KINDS)[number];\n\nexport const AUTHZ_ENGINES = ['cerbos', 'native'] as const;\nexport type AuthzEngine = (typeof AUTHZ_ENGINES)[number];\n\nexport const AUTH_SCOPES = ['global', 'none', 'integrated'] as const;\nexport type AuthScope = (typeof AUTH_SCOPES)[number];\n\nexport const AUTH_PROVIDERS = ['supabase'] as const;\nexport type KnownAuthProvider = (typeof AUTH_PROVIDERS)[number];\nexport type AuthProvider = KnownAuthProvider | (string & {});\n\nexport const AUTH_SIGN_IN_IDENTIFIERS = ['email', 'username', 'phone'] as const;\nexport type AuthSignInIdentifier = AuthIdentifierKind;\n\nexport const AUTH_SIGN_UP_POLICIES = ['autoSignIn', 'requireVerification'] as const;\nexport type AuthSignUpPolicy = (typeof AUTH_SIGN_UP_POLICIES)[number];\n\nexport const AUTH_PROFILE_FIELDS = [\n ...AUTH_SIGN_IN_IDENTIFIERS,\n 'firstName',\n 'lastName',\n 'displayName',\n 'avatarUrl',\n] as const;\nexport type KnownAuthProfileField = (typeof AUTH_PROFILE_FIELDS)[number];\nexport type AuthProfileField = KnownAuthProfileField | (string & {});\n\nexport const AUTH_PROFILE_PRIMARY_KEY_STRATEGIES = ['authUserId'] as const;\nexport type AuthProfilePrimaryKeyStrategy = (typeof AUTH_PROFILE_PRIMARY_KEY_STRATEGIES)[number];\n\nexport const AUTH_PROFILE_CREATE_STRATEGIES = ['trigger', 'api', 'app'] as const;\nexport type AuthProfileCreateStrategy = (typeof AUTH_PROFILE_CREATE_STRATEGIES)[number];\n\nexport const AUTH_PROFILE_UPDATE_STRATEGIES = ['api', 'app'] as const;\nexport type AuthProfileUpdateStrategy = (typeof AUTH_PROFILE_UPDATE_STRATEGIES)[number];\n\nexport interface IconSpec {\n name: string;\n provider?: string;\n size?: number | string;\n color?: string;\n}\n\nexport interface UiNodeRepeatSpec {\n source: BindingValueSource;\n itemAlias?: string;\n keyPath?: string;\n empty?: readonly UiNode[];\n}\n\nexport interface UiNode {\n id: string;\n type: string;\n alias?: string;\n props?: Record<string, unknown>;\n children?: UiNode[];\n style?: Record<string, number | string>;\n repeat?: UiNodeRepeatSpec;\n}\n\nexport interface ScreenSpec {\n id: string;\n name: string;\n title?: string;\n description?: string;\n root: UiNode;\n dataLoaders?: readonly ScreenDataLoaderDefinition[];\n requires?: ScreenRequirements;\n}\n\nexport interface NavigatorSpec {\n type: NavigatorType;\n initialRouteName?: string;\n routes: RouteDefinition[];\n options?: Record<string, unknown>;\n}\n\nexport interface RouteDefinition {\n name: string;\n path?: string;\n label?: string;\n icon?: IconSpec;\n /**\n * Whether this route appears in Tabs and Drawer primary navigation.\n *\n * Omitted routes are visible by default. Setting this to `false` hides the\n * route from primary navigation without making it unnavigable. Stack\n * navigators preserve the value but do not present primary navigation.\n */\n showInPrimaryNavigation?: boolean;\n guards?: string[];\n screenId?: string;\n navigator?: NavigatorSpec;\n}\n\nexport type SplashScreenResizeMode = 'contain' | 'cover' | 'native';\n\nexport interface SplashScreenAssetSpec {\n readonly image?: string;\n readonly imageWidth?: number;\n readonly resizeMode?: SplashScreenResizeMode;\n}\n\nexport interface SplashScreenModeSpec extends SplashScreenAssetSpec {\n readonly backgroundColor?: string;\n}\n\nexport interface SplashScreenSpec extends SplashScreenModeSpec {\n readonly dark?: SplashScreenModeSpec;\n}\n\nexport interface DeploymentSpec {\n target: DeploymentTarget;\n monitoring: boolean;\n}\n\nexport interface DatabaseSpec {\n provider: DatabaseProvider;\n tier: DatabaseTier;\n}\n\nexport interface StorageSpec {\n provider: StorageProvider;\n buckets: string[];\n}\n\nexport interface StateSpec {\n readonly provider: StateProvider;\n readonly persistence?: StatePersistenceMode;\n}\n\nexport interface AuthzSpec {\n kind: AuthzKind;\n engine: AuthzEngine;\n}\n\nexport interface AuthSignInSpec {\n identifiers: AuthSignInIdentifier[];\n}\n\nexport interface AuthSignUpSpec {\n requiredFields: AuthSignUpField[];\n optionalFields?: AuthSignUpField[];\n signUpPolicy?: AuthSignUpPolicy;\n}\n\nexport interface AuthProfileSpec {\n fields: AuthProfileField[];\n table?: string;\n primaryKey?: AuthProfilePrimaryKeyStrategy;\n createStrategy?: AuthProfileCreateStrategy;\n updateStrategy?: AuthProfileUpdateStrategy;\n}\n\nexport interface AuthSpec {\n scope: AuthScope;\n provider: AuthProvider;\n authorization?: AuthzSpec;\n flow?: AuthFlowConfig;\n signIn?: AuthSignInSpec;\n signUp?: AuthSignUpSpec;\n oauth?: AuthOAuthConfig;\n profile?: AuthProfileSpec;\n}\n\nexport interface NetworkingSpec {\n domain?: string;\n cdn: boolean;\n}\n\nexport interface InfraManifest {\n deployment?: DeploymentSpec;\n auth?: AuthSpec;\n database?: DatabaseSpec;\n storage?: StorageSpec;\n state?: StateSpec;\n networking?: NetworkingSpec;\n apis?: ApiDefinitionList;\n modules: string[];\n modulesConfig?: Record<string, unknown>;\n}\n\nexport interface AppSettings {\n localization: {\n defaultLocale: string;\n locales: string[];\n };\n}\n\nexport interface AppManifest {\n metadata: {\n name: string;\n slug: string;\n version: string;\n category: AppCategory;\n themeId: string;\n created?: string;\n updated?: string;\n };\n themes: ThemeConfig[];\n activeThemeId: string;\n activeThemeMode?: 'dark' | 'light';\n splashScreen?: SplashScreenSpec;\n /** Studio-managed authoring media. Runtime/user uploads are intentionally separate. */\n media?: MediaManifest;\n /** App distribution desired state. Infrastructure deployment remains under `infra.deployment`. */\n deploy?: AppDeployManifest;\n infra: InfraManifest;\n navigator: NavigatorSpec;\n screens: Record<string, ScreenSpec>;\n dataSources?: DataSourceRegistry;\n dataBindings?: ComponentDataBindingRegistry;\n repository?: RepositoryManifest;\n settings: AppSettings;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA0IA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,eAAe;IACf,uBAAuB;IACvB,iBAAiB;IACjB,oBAAoB;IACpB,qBAAqB;IACrB,eAAe;IACf,YAAY;IACZ,OAAO;IACP,iBAAiB;IACjB,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,SAAS;IACT,aAAa;IACb,mBAAmB;IACnB,gBAAgB;IAChB,aAAa;IACb,WAAW;IACX,mBAAmB;IACnB,kBAAkB;IAClB,QAAQ;IACR,iBAAiB;IACjB,SAAS;CACD,CAAC;AAGX,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,UAAU,CAAU,CAAC;AAIxD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,UAAU,CAAU,CAAC;AAIxD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAK,EAAE,MAAM,CAAU,CAAC;AAGvD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAU,CAAC;AAG/D,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAAQ,CAAU,CAAC;AAInD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAU,CAAC;AAGxF,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,MAAM,CAAU,CAAC;AAGrD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAG3D,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAU,CAAC;AAGrE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,UAAU,CAAU,CAAC;AAIpD,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAU,CAAC;AAGhF,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,YAAY,EAAE,qBAAqB,CAAU,CAAC;AAGpF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,GAAG,wBAAwB;IAC3B,WAAW;IACX,UAAU;IACV,aAAa;IACb,WAAW;CACH,CAAC;AAIX,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,YAAY,CAAU,CAAC;AAG3E,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAGjF,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,KAAK,EAAE,KAAK,CAAU,CAAC","sourcesContent":["import type { ColorHarmony } from '@ankhorage/color-theory';\n\nimport type { AuthFlowConfig, AuthIdentifierKind, AuthOAuthConfig, AuthSignUpField } from './auth';\nimport type {\n BindingValueSource,\n ComponentDataBindingRegistry,\n ScreenDataLoaderDefinition,\n} from './bindings';\nimport type { ApiDefinitionList, DataSourceRegistry } from './data';\nimport type { AppDeployManifest } from './deploy';\nimport type { MediaManifest } from './media';\nimport type { AppNavigatorManifest } from './navigator';\nimport type { RepositoryManifest } from './repository';\nimport type { ScreenRequirements } from './requirements';\nimport type { ThemeGlobalTokenOverrides, ThemeRecipeOverrides } from './theme';\n\nexport interface ThemeModeConfig {\n primaryColor: string;\n harmony: ColorHarmony;\n}\n\nexport interface ThemeConfig {\n id: string;\n name: string;\n light: ThemeModeConfig;\n dark: ThemeModeConfig;\n /** Theme-global authored token overrides shared by light and dark mode. */\n tokens?: ThemeGlobalTokenOverrides;\n /** Component/pattern recipe override values; recipe schemas remain package-owned metadata. */\n recipes?: ThemeRecipeOverrides;\n}\n\nexport type ActionType =\n 'navigate' | 'alert' | 'console' | 'toggleDarkMode' | 'setLanguage' | 'search' | 'filter';\n\nexport interface NavigateAction {\n type: 'navigate';\n payload: {\n route: string;\n params?: Record<string, number | string>;\n };\n}\n\nexport interface AlertAction {\n type: 'alert';\n payload?: {\n message?: string;\n };\n}\n\nexport interface ConsoleAction {\n type: 'console';\n payload?: Record<string, unknown>;\n}\n\nexport interface ToggleDarkModeAction {\n type: 'toggleDarkMode';\n payload?: never;\n}\n\nexport interface SetLanguageAction {\n type: 'setLanguage';\n payload: {\n locale: string;\n };\n}\n\nexport interface SearchAction {\n type: 'search';\n payload: {\n query: string;\n scope?: string;\n };\n}\n\nexport interface FilterAction {\n type: 'filter';\n payload: {\n filterKey: string;\n filterValue: string;\n };\n}\n\nexport type Action =\n | AlertAction\n | ConsoleAction\n | FilterAction\n | NavigateAction\n | SearchAction\n | SetLanguageAction\n | ToggleDarkModeAction;\n\nexport type ManifestValue =\n | string\n | number\n | boolean\n | null\n | readonly ManifestValue[]\n | { readonly [key: string]: ManifestValue };\n\nexport type ComponentEventPayloadValue = ManifestValue;\n\nexport interface ComponentEventDto<\n TType extends string = string,\n TPayload extends object = Record<string, ComponentEventPayloadValue>,\n> {\n readonly type: TType;\n readonly sourceNodeId: string;\n readonly payload: TPayload;\n}\n\nexport type FormSubmitValues = Record<string, ComponentEventPayloadValue>;\n\nexport type FormSubmitEventDto = ComponentEventDto<\n 'form.submit',\n {\n readonly values: FormSubmitValues;\n }\n>;\n\nexport type ButtonPressEventDto = ComponentEventDto<'button.press', Record<string, never>>;\n\nexport interface CollectionItemPressPayload {\n readonly itemId: string | number;\n readonly item: Record<string, ComponentEventPayloadValue>;\n}\n\nexport type CollectionItemPressEventDto = ComponentEventDto<\n 'collection.itemPress',\n CollectionItemPressPayload\n>;\n\nexport type ComponentEventDtoKind =\n ButtonPressEventDto['type'] | CollectionItemPressEventDto['type'] | FormSubmitEventDto['type'];\n\nexport type KnownComponentEventDto =\n ButtonPressEventDto | CollectionItemPressEventDto | FormSubmitEventDto;\n\nexport const APP_CATEGORIES = [\n 'books_reading',\n 'business_productivity',\n 'developer_tools',\n 'education_learning',\n 'entertainment_media',\n 'finance_money',\n 'food_drink',\n 'games',\n 'graphics_design',\n 'health_fitness',\n 'kids_family',\n 'lifestyle',\n 'medical',\n 'music_audio',\n 'navigation_travel',\n 'news_magazines',\n 'photo_video',\n 'reference',\n 'shopping_commerce',\n 'social_community',\n 'sports',\n 'utilities_tools',\n 'weather',\n] as const;\nexport type AppCategory = (typeof APP_CATEGORIES)[number];\n\nexport const DEPLOYMENT_TARGETS = ['minikube'] as const;\nexport type KnownDeploymentTarget = (typeof DEPLOYMENT_TARGETS)[number];\nexport type DeploymentTarget = KnownDeploymentTarget | (string & {});\n\nexport const DATABASE_PROVIDERS = ['supabase'] as const;\nexport type KnownDatabaseProvider = (typeof DATABASE_PROVIDERS)[number];\nexport type DatabaseProvider = KnownDatabaseProvider | (string & {});\n\nexport const DATABASE_TIERS = ['dev', 'prod'] as const;\nexport type DatabaseTier = (typeof DATABASE_TIERS)[number];\n\nexport const STORAGE_PROVIDERS = ['auto', 's3', 'r2'] as const;\nexport type StorageProvider = (typeof STORAGE_PROVIDERS)[number];\n\nexport const STATE_PROVIDERS = ['legend'] as const;\nexport type KnownStateProvider = (typeof STATE_PROVIDERS)[number];\nexport type StateProvider = KnownStateProvider | (string & {});\n\nexport const STATE_PERSISTENCE_MODES = ['none', 'local', 'secure', 'database'] as const;\nexport type StatePersistenceMode = (typeof STATE_PERSISTENCE_MODES)[number];\n\nexport const AUTHZ_KINDS = ['RBAC', 'ABAC'] as const;\nexport type AuthzKind = (typeof AUTHZ_KINDS)[number];\n\nexport const AUTHZ_ENGINES = ['cerbos', 'native'] as const;\nexport type AuthzEngine = (typeof AUTHZ_ENGINES)[number];\n\nexport const AUTH_SCOPES = ['global', 'none', 'integrated'] as const;\nexport type AuthScope = (typeof AUTH_SCOPES)[number];\n\nexport const AUTH_PROVIDERS = ['supabase'] as const;\nexport type KnownAuthProvider = (typeof AUTH_PROVIDERS)[number];\nexport type AuthProvider = KnownAuthProvider | (string & {});\n\nexport const AUTH_SIGN_IN_IDENTIFIERS = ['email', 'username', 'phone'] as const;\nexport type AuthSignInIdentifier = AuthIdentifierKind;\n\nexport const AUTH_SIGN_UP_POLICIES = ['autoSignIn', 'requireVerification'] as const;\nexport type AuthSignUpPolicy = (typeof AUTH_SIGN_UP_POLICIES)[number];\n\nexport const AUTH_PROFILE_FIELDS = [\n ...AUTH_SIGN_IN_IDENTIFIERS,\n 'firstName',\n 'lastName',\n 'displayName',\n 'avatarUrl',\n] as const;\nexport type KnownAuthProfileField = (typeof AUTH_PROFILE_FIELDS)[number];\nexport type AuthProfileField = KnownAuthProfileField | (string & {});\n\nexport const AUTH_PROFILE_PRIMARY_KEY_STRATEGIES = ['authUserId'] as const;\nexport type AuthProfilePrimaryKeyStrategy = (typeof AUTH_PROFILE_PRIMARY_KEY_STRATEGIES)[number];\n\nexport const AUTH_PROFILE_CREATE_STRATEGIES = ['trigger', 'api', 'app'] as const;\nexport type AuthProfileCreateStrategy = (typeof AUTH_PROFILE_CREATE_STRATEGIES)[number];\n\nexport const AUTH_PROFILE_UPDATE_STRATEGIES = ['api', 'app'] as const;\nexport type AuthProfileUpdateStrategy = (typeof AUTH_PROFILE_UPDATE_STRATEGIES)[number];\n\nexport interface IconSpec {\n name: string;\n provider?: string;\n size?: number | string;\n color?: string;\n}\n\nexport interface UiNodeRepeatSpec {\n source: BindingValueSource;\n itemAlias?: string;\n keyPath?: string;\n empty?: readonly UiNode[];\n}\n\nexport interface UiNode {\n id: string;\n type: string;\n alias?: string;\n props?: Record<string, unknown>;\n children?: UiNode[];\n style?: Record<string, number | string>;\n repeat?: UiNodeRepeatSpec;\n}\n\nexport interface ScreenSpec {\n id: string;\n name: string;\n title?: string;\n description?: string;\n root: UiNode;\n dataLoaders?: readonly ScreenDataLoaderDefinition[];\n requires?: ScreenRequirements;\n}\n\nexport type SplashScreenResizeMode = 'contain' | 'cover' | 'native';\n\nexport interface SplashScreenAssetSpec {\n readonly image?: string;\n readonly imageWidth?: number;\n readonly resizeMode?: SplashScreenResizeMode;\n}\n\nexport interface SplashScreenModeSpec extends SplashScreenAssetSpec {\n readonly backgroundColor?: string;\n}\n\nexport interface SplashScreenSpec extends SplashScreenModeSpec {\n readonly dark?: SplashScreenModeSpec;\n}\n\nexport interface DeploymentSpec {\n target: DeploymentTarget;\n monitoring: boolean;\n}\n\nexport interface DatabaseSpec {\n provider: DatabaseProvider;\n tier: DatabaseTier;\n}\n\nexport interface StorageSpec {\n provider: StorageProvider;\n buckets: string[];\n}\n\nexport interface StateSpec {\n readonly provider: StateProvider;\n readonly persistence?: StatePersistenceMode;\n}\n\nexport interface AuthzSpec {\n kind: AuthzKind;\n engine: AuthzEngine;\n}\n\nexport interface AuthSignInSpec {\n identifiers: AuthSignInIdentifier[];\n}\n\nexport interface AuthSignUpSpec {\n requiredFields: AuthSignUpField[];\n optionalFields?: AuthSignUpField[];\n signUpPolicy?: AuthSignUpPolicy;\n}\n\nexport interface AuthProfileSpec {\n fields: AuthProfileField[];\n table?: string;\n primaryKey?: AuthProfilePrimaryKeyStrategy;\n createStrategy?: AuthProfileCreateStrategy;\n updateStrategy?: AuthProfileUpdateStrategy;\n}\n\nexport interface AuthSpec {\n scope: AuthScope;\n provider: AuthProvider;\n authorization?: AuthzSpec;\n flow?: AuthFlowConfig;\n signIn?: AuthSignInSpec;\n signUp?: AuthSignUpSpec;\n oauth?: AuthOAuthConfig;\n profile?: AuthProfileSpec;\n}\n\nexport interface NetworkingSpec {\n domain?: string;\n cdn: boolean;\n}\n\nexport interface InfraManifest {\n deployment?: DeploymentSpec;\n auth?: AuthSpec;\n database?: DatabaseSpec;\n storage?: StorageSpec;\n state?: StateSpec;\n networking?: NetworkingSpec;\n apis?: ApiDefinitionList;\n modules: string[];\n modulesConfig?: Record<string, unknown>;\n}\n\nexport interface AppSettings {\n localization: {\n defaultLocale: string;\n locales: string[];\n };\n}\n\nexport interface AppManifest {\n metadata: {\n name: string;\n slug: string;\n version: string;\n category: AppCategory;\n themeId: string;\n created?: string;\n updated?: string;\n };\n themes: ThemeConfig[];\n activeThemeId: string;\n activeThemeMode?: 'dark' | 'light';\n splashScreen?: SplashScreenSpec;\n /** Studio-managed authoring media. Runtime/user uploads are intentionally separate. */\n media?: MediaManifest;\n /** App distribution desired state. Infrastructure deployment remains under `infra.deployment`. */\n deploy?: AppDeployManifest;\n infra: InfraManifest;\n navigator: AppNavigatorManifest;\n screens: Record<string, ScreenSpec>;\n dataSources?: DataSourceRegistry;\n dataBindings?: ComponentDataBindingRegistry;\n repository?: RepositoryManifest;\n settings: AppSettings;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ankhorage/contracts",
3
- "version": "9.0.0",
3
+ "version": "10.0.0",
4
4
  "main": "./dist/index.js",
5
5
  "ankh": {
6
6
  "category": "contracts",
@@ -72,6 +72,10 @@
72
72
  "types": "./dist/media.d.ts",
73
73
  "default": "./dist/media.js"
74
74
  },
75
+ "./navigator": {
76
+ "types": "./dist/navigator.d.ts",
77
+ "default": "./dist/navigator.js"
78
+ },
75
79
  "./repository": {
76
80
  "types": "./dist/repository.d.ts",
77
81
  "default": "./dist/repository.js"
@@ -89,6 +93,7 @@
89
93
  "storage",
90
94
  "adapter",
91
95
  "media",
96
+ "navigator",
92
97
  "assets"
93
98
  ],
94
99
  "files": [
@@ -1,6 +1,13 @@
1
1
  import { COLOR_HARMONIES } from '@ankhorage/color-theory';
2
2
 
3
- import { APP_CATEGORIES, NAVIGATOR_TYPES } from '../types';
3
+ import {
4
+ CUSTOM_TABS_PRESENTATIONS,
5
+ FIXED_CUSTOM_TABS_PRESENTATIONS,
6
+ JAVASCRIPT_TABS_PRESENTATIONS,
7
+ NAVIGATOR_PRESETS,
8
+ NAVIGATOR_TYPES,
9
+ } from '../navigator';
10
+ import { APP_CATEGORIES } from '../types';
4
11
  import { isBindingValueSource, isScreenDataLoaderDefinition } from './bindings';
5
12
  import {
6
13
  isOptionalBoolean,
@@ -12,6 +19,10 @@ import {
12
19
 
13
20
  const APP_CATEGORY_SET = new Set<string>(APP_CATEGORIES);
14
21
  const COLOR_HARMONY_SET = new Set<string>(COLOR_HARMONIES);
22
+ const CUSTOM_TABS_PRESENTATION_SET = new Set<string>(CUSTOM_TABS_PRESENTATIONS);
23
+ const FIXED_CUSTOM_TABS_PRESENTATION_SET = new Set<string>(FIXED_CUSTOM_TABS_PRESENTATIONS);
24
+ const JAVASCRIPT_TABS_PRESENTATION_SET = new Set<string>(JAVASCRIPT_TABS_PRESENTATIONS);
25
+ const NAVIGATOR_PRESET_SET = new Set<string>(NAVIGATOR_PRESETS);
15
26
  const NAVIGATOR_TYPE_SET = new Set<string>(NAVIGATOR_TYPES);
16
27
  const SPLASH_SCREEN_RESIZE_MODE_SET = new Set<string>(['contain', 'cover', 'native']);
17
28
 
@@ -39,15 +50,16 @@ export function isThemeConfig(value: unknown): boolean {
39
50
  );
40
51
  }
41
52
 
42
- export function isNavigatorSpec(value: unknown): boolean {
53
+ /*** Validate the complete serialized `AppManifest.navigator` slice. */
54
+ export function isAppNavigatorManifest(value: unknown): boolean {
43
55
  return (
44
56
  isRecord(value) &&
45
- typeof value.type === 'string' &&
46
- NAVIGATOR_TYPE_SET.has(value.type) &&
47
- isOptionalString(value.initialRouteName) &&
48
- Array.isArray(value.routes) &&
49
- value.routes.every(isRouteDefinition) &&
50
- (value.options === undefined || isRecord(value.options))
57
+ isNavigatorNode(value) &&
58
+ (value.preset === undefined ||
59
+ (typeof value.preset === 'string' && NAVIGATOR_PRESET_SET.has(value.preset))) &&
60
+ (value.flows === undefined || isNavigatorFlows(value.flows)) &&
61
+ (value.defaults === undefined || isNavigatorDefaults(value.defaults)) &&
62
+ (value.platforms === undefined || isNavigatorPlatforms(value.platforms))
51
63
  );
52
64
  }
53
65
 
@@ -117,6 +129,20 @@ function isScreenSpec(value: unknown): boolean {
117
129
  );
118
130
  }
119
131
 
132
+ /*** Validate one nested navigator node independently from app-level authoring metadata. */
133
+ function isNavigatorNode(value: unknown): boolean {
134
+ return (
135
+ isRecord(value) &&
136
+ typeof value.type === 'string' &&
137
+ NAVIGATOR_TYPE_SET.has(value.type) &&
138
+ isOptionalString(value.initialRouteName) &&
139
+ Array.isArray(value.routes) &&
140
+ value.routes.every(isRouteDefinition) &&
141
+ (value.options === undefined || isRecord(value.options)) &&
142
+ (value.type !== 'tabs' || isTabsImplementationConfig(value))
143
+ );
144
+ }
145
+
120
146
  function isRouteDefinition(value: unknown): boolean {
121
147
  return (
122
148
  isRecord(value) &&
@@ -127,7 +153,7 @@ function isRouteDefinition(value: unknown): boolean {
127
153
  isOptionalBoolean(value.showInPrimaryNavigation) &&
128
154
  (value.guards === undefined || isStringArray(value.guards)) &&
129
155
  isOptionalString(value.screenId) &&
130
- (value.navigator === undefined || isNavigatorSpec(value.navigator))
156
+ (value.navigator === undefined || isNavigatorNode(value.navigator))
131
157
  );
132
158
  }
133
159
 
@@ -143,6 +169,115 @@ function isIconSpec(value: unknown): boolean {
143
169
  );
144
170
  }
145
171
 
172
+ /*** Validate tabs implementation desired state, with omitted implementation meaning adaptive. */
173
+ function isTabsImplementationConfig(value: Record<string, unknown>): boolean {
174
+ if (value.implementation === undefined || value.implementation === 'adaptive') {
175
+ return (
176
+ (value.native === undefined || isNativeTabsConfig(value.native)) &&
177
+ (value.web === undefined || isCustomTabsWebConfig(value.web))
178
+ );
179
+ }
180
+
181
+ if (value.implementation === 'native') return true;
182
+
183
+ if (value.implementation === 'javascript') {
184
+ return (
185
+ value.presentation === undefined ||
186
+ (typeof value.presentation === 'string' &&
187
+ JAVASCRIPT_TABS_PRESENTATION_SET.has(value.presentation))
188
+ );
189
+ }
190
+
191
+ return value.implementation === 'custom' && isCustomTabsConfig(value);
192
+ }
193
+
194
+ /*** Validate the native branch used by adaptive tabs. */
195
+ function isNativeTabsConfig(value: unknown): boolean {
196
+ return isRecord(value) && value.implementation === 'native';
197
+ }
198
+
199
+ /*** Validate a full custom-tabs implementation config. */
200
+ function isCustomTabsConfig(value: Record<string, unknown>): boolean {
201
+ return value.implementation === 'custom' && isCustomTabsPresentationConfig(value);
202
+ }
203
+
204
+ /*** Validate the implementation-free custom-tabs Web branch inside adaptive tabs. */
205
+ function isCustomTabsWebConfig(value: unknown): boolean {
206
+ return (
207
+ isRecord(value) && value.implementation === undefined && isCustomTabsPresentationConfig(value)
208
+ );
209
+ }
210
+
211
+ /*** Validate custom-tab presentation and its conditional serializable configuration. */
212
+ function isCustomTabsPresentationConfig(value: Record<string, unknown>): boolean {
213
+ if (
214
+ typeof value.presentation !== 'string' ||
215
+ !CUSTOM_TABS_PRESENTATION_SET.has(value.presentation)
216
+ ) {
217
+ return false;
218
+ }
219
+
220
+ if (value.responsive !== undefined && !isResponsiveTabsPresentation(value.responsive)) {
221
+ return false;
222
+ }
223
+
224
+ if (!isOptionalString(value.customPresentationId)) return false;
225
+ if (value.presentation === 'responsive' && value.responsive === undefined) return false;
226
+
227
+ return (
228
+ value.presentation !== 'custom' ||
229
+ (typeof value.customPresentationId === 'string' && value.customPresentationId.length > 0)
230
+ );
231
+ }
232
+
233
+ /*** Validate semantic compact/medium/expanded custom-tab presentation mapping. */
234
+ function isResponsiveTabsPresentation(value: unknown): boolean {
235
+ return (
236
+ isRecord(value) &&
237
+ typeof value.compact === 'string' &&
238
+ FIXED_CUSTOM_TABS_PRESENTATION_SET.has(value.compact) &&
239
+ (value.medium === undefined ||
240
+ (typeof value.medium === 'string' && FIXED_CUSTOM_TABS_PRESENTATION_SET.has(value.medium))) &&
241
+ typeof value.expanded === 'string' &&
242
+ FIXED_CUSTOM_TABS_PRESENTATION_SET.has(value.expanded)
243
+ );
244
+ }
245
+
246
+ /*** Validate optional app-level navigator flow intent. */
247
+ function isNavigatorFlows(value: unknown): boolean {
248
+ return (
249
+ isRecord(value) &&
250
+ isOptionalBoolean(value.onboarding) &&
251
+ isOptionalBoolean(value.authentication)
252
+ );
253
+ }
254
+
255
+ /*** Validate package-owned navigator defaults without requiring a navigator node type. */
256
+ function isNavigatorDefaults(value: unknown): boolean {
257
+ return (
258
+ isRecord(value) &&
259
+ (value.tabs === undefined || (isRecord(value.tabs) && isTabsImplementationConfig(value.tabs)))
260
+ );
261
+ }
262
+
263
+ /*** Validate per-platform navigator implementation overrides. */
264
+ function isNavigatorPlatforms(value: unknown): boolean {
265
+ return (
266
+ isRecord(value) &&
267
+ (value.android === undefined || isNavigatorPlatformConfig(value.android)) &&
268
+ (value.ios === undefined || isNavigatorPlatformConfig(value.ios)) &&
269
+ (value.web === undefined || isNavigatorPlatformConfig(value.web))
270
+ );
271
+ }
272
+
273
+ /*** Validate one platform-specific navigator override slice. */
274
+ function isNavigatorPlatformConfig(value: unknown): boolean {
275
+ return (
276
+ isRecord(value) &&
277
+ (value.tabs === undefined || (isRecord(value.tabs) && isTabsImplementationConfig(value.tabs)))
278
+ );
279
+ }
280
+
146
281
  function isSplashScreenModeSpec(value: unknown): boolean {
147
282
  return (
148
283
  isRecord(value) &&
@@ -4,8 +4,8 @@ import { isAppDeployManifest } from './appManifest/deploy';
4
4
  import { isInfraManifest } from './appManifest/infra';
5
5
  import { isMediaManifest } from './appManifest/media';
6
6
  import {
7
+ isAppNavigatorManifest,
7
8
  isManifestMetadata,
8
- isNavigatorSpec,
9
9
  isScreenRegistry,
10
10
  isSplashScreenSpec,
11
11
  isThemeConfig,
@@ -62,7 +62,7 @@ export function isAppManifest(value: unknown): value is AppManifest {
62
62
  (value.media === undefined || isMediaManifest(value.media)) &&
63
63
  (value.deploy === undefined || isAppDeployManifest(value.deploy)) &&
64
64
  isInfraManifest(value.infra) &&
65
- isNavigatorSpec(value.navigator) &&
65
+ isAppNavigatorManifest(value.navigator) &&
66
66
  isScreenRegistry(value.screens) &&
67
67
  (value.dataSources === undefined || isDataSourceRegistry(value.dataSources)) &&
68
68
  (value.dataBindings === undefined || isComponentDataBindingRegistry(value.dataBindings)) &&
package/src/index.ts CHANGED
@@ -6,6 +6,7 @@ export * from './data';
6
6
  export * from './db';
7
7
  export * from './deploy';
8
8
  export * from './media';
9
+ export * from './navigator';
9
10
  export * from './repository';
10
11
  export * from './requirements';
11
12
  export * from './runtimeCallbacks';
@@ -0,0 +1,121 @@
1
+ import { readFile } from 'node:fs/promises';
2
+ import { join } from 'node:path';
3
+
4
+ import { describe, expect, it } from 'bun:test';
5
+
6
+ import { isAppNavigatorManifest } from './appManifest/screens';
7
+ import {
8
+ type AppNavigatorManifest,
9
+ NAVIGATOR_PRESETS,
10
+ type TabsNavigatorConfig,
11
+ } from './navigator';
12
+
13
+ function createAdaptiveTabs(): AppNavigatorManifest {
14
+ return {
15
+ type: 'tabs',
16
+ preset: 'tabs-stack',
17
+ implementation: 'adaptive',
18
+ web: {
19
+ presentation: 'responsive',
20
+ responsive: {
21
+ compact: 'bottom',
22
+ medium: 'rail',
23
+ expanded: 'sidebar',
24
+ },
25
+ },
26
+ flows: { onboarding: true },
27
+ routes: [{ name: 'home', path: '/', screenId: 'home' }],
28
+ };
29
+ }
30
+
31
+ describe('app navigator manifest topology', () => {
32
+ it('keeps canonical topology presets finite and authorable', () => {
33
+ expect(NAVIGATOR_PRESETS).toContain('root-stack-tabs-stack');
34
+ expect(NAVIGATOR_PRESETS).toContain('root-stack-drawer-tabs-stack');
35
+ });
36
+
37
+ it('accepts adaptive native/Web tabs with responsive custom presentation', () => {
38
+ expect(isAppNavigatorManifest(createAdaptiveTabs())).toBe(true);
39
+ });
40
+
41
+ it('treats omitted tabs implementation as the canonical adaptive default', () => {
42
+ const tabs: TabsNavigatorConfig = { type: 'tabs' };
43
+ const navigator: AppNavigatorManifest = { ...tabs, routes: [] };
44
+
45
+ expect(isAppNavigatorManifest(navigator)).toBe(true);
46
+ });
47
+ });
48
+
49
+ describe('app navigator manifest custom presentation', () => {
50
+ it('accepts fixed and registered custom Web presentations', () => {
51
+ expect(
52
+ isAppNavigatorManifest({
53
+ type: 'tabs',
54
+ implementation: 'custom',
55
+ presentation: 'sidebar',
56
+ routes: [],
57
+ }),
58
+ ).toBe(true);
59
+
60
+ expect(
61
+ isAppNavigatorManifest({
62
+ type: 'tabs',
63
+ implementation: 'custom',
64
+ presentation: 'custom',
65
+ customPresentationId: 'workspace-tabs',
66
+ routes: [],
67
+ }),
68
+ ).toBe(true);
69
+ });
70
+
71
+ it('rejects incomplete responsive and custom presentation configuration', () => {
72
+ expect(
73
+ isAppNavigatorManifest({
74
+ type: 'tabs',
75
+ implementation: 'custom',
76
+ presentation: 'responsive',
77
+ routes: [],
78
+ }),
79
+ ).toBe(false);
80
+
81
+ expect(
82
+ isAppNavigatorManifest({
83
+ type: 'tabs',
84
+ implementation: 'custom',
85
+ presentation: 'custom',
86
+ routes: [],
87
+ }),
88
+ ).toBe(false);
89
+ });
90
+ });
91
+
92
+ describe('app navigator manifest composition', () => {
93
+ it('keeps nested topology separate from app-level flow metadata', () => {
94
+ expect(
95
+ isAppNavigatorManifest({
96
+ type: 'stack',
97
+ flows: { authentication: true },
98
+ routes: [
99
+ {
100
+ name: 'app',
101
+ navigator: {
102
+ type: 'tabs',
103
+ routes: [{ name: 'home', screenId: 'home' }],
104
+ },
105
+ },
106
+ ],
107
+ }),
108
+ ).toBe(true);
109
+ });
110
+
111
+ it('publishes the focused navigator contract subpath', async () => {
112
+ const packageJson = JSON.parse(await readFile(join(process.cwd(), 'package.json'), 'utf8')) as {
113
+ exports?: Record<string, { default?: string; types?: string }>;
114
+ };
115
+
116
+ expect(packageJson.exports?.['./navigator']).toEqual({
117
+ types: './dist/navigator.d.ts',
118
+ default: './dist/navigator.js',
119
+ });
120
+ });
121
+ });
@@ -0,0 +1,136 @@
1
+ import type { IconSpec } from './types';
2
+
3
+ export const NAVIGATOR_TYPES = ['stack', 'tabs', 'drawer'] as const;
4
+ export type NavigatorType = (typeof NAVIGATOR_TYPES)[number];
5
+
6
+ export const NAVIGATOR_PRESETS = [
7
+ 'stack',
8
+ 'tabs',
9
+ 'tabs-stack',
10
+ 'drawer',
11
+ 'drawer-stack',
12
+ 'drawer-tabs',
13
+ 'drawer-tabs-stack',
14
+ 'root-stack-tabs',
15
+ 'root-stack-tabs-stack',
16
+ 'root-stack-drawer',
17
+ 'root-stack-drawer-stack',
18
+ 'root-stack-drawer-tabs',
19
+ 'root-stack-drawer-tabs-stack',
20
+ ] as const;
21
+ export type NavigatorPreset = (typeof NAVIGATOR_PRESETS)[number];
22
+
23
+ export const FIXED_CUSTOM_TABS_PRESENTATIONS = ['bottom', 'top', 'rail', 'sidebar'] as const;
24
+ export type FixedCustomTabsPresentation = (typeof FIXED_CUSTOM_TABS_PRESENTATIONS)[number];
25
+
26
+ export const CUSTOM_TABS_PRESENTATIONS = [
27
+ ...FIXED_CUSTOM_TABS_PRESENTATIONS,
28
+ 'responsive',
29
+ 'custom',
30
+ ] as const;
31
+ export type CustomTabsPresentation = (typeof CUSTOM_TABS_PRESENTATIONS)[number];
32
+
33
+ export const JAVASCRIPT_TABS_PRESENTATIONS = ['bottom', 'top'] as const;
34
+ export type JavaScriptTabsPresentation = (typeof JAVASCRIPT_TABS_PRESENTATIONS)[number];
35
+
36
+ export interface ResponsiveTabsPresentation {
37
+ compact: FixedCustomTabsPresentation;
38
+ medium?: FixedCustomTabsPresentation;
39
+ expanded: FixedCustomTabsPresentation;
40
+ }
41
+
42
+ export interface CustomTabsConfig {
43
+ implementation: 'custom';
44
+ presentation: CustomTabsPresentation;
45
+ responsive?: ResponsiveTabsPresentation;
46
+ /** Serializable registered presentation id used when `presentation` is `custom`. */
47
+ customPresentationId?: string;
48
+ }
49
+
50
+ export interface NativeTabsConfig {
51
+ implementation: 'native';
52
+ }
53
+
54
+ export interface JavaScriptTabsConfig {
55
+ implementation: 'javascript';
56
+ presentation?: JavaScriptTabsPresentation;
57
+ }
58
+
59
+ export interface AdaptiveTabsConfig {
60
+ /** Omission selects the canonical adaptive default. */
61
+ implementation?: 'adaptive';
62
+ /** Android/iOS branch. Expo Router may expose this implementation as unstable. */
63
+ native?: NativeTabsConfig;
64
+ /** Web branch rendered through headless custom tabs. */
65
+ web?: Omit<CustomTabsConfig, 'implementation'>;
66
+ }
67
+
68
+ export type TabsImplementationConfig =
69
+ AdaptiveTabsConfig | CustomTabsConfig | JavaScriptTabsConfig | NativeTabsConfig;
70
+
71
+ interface NavigatorNodeBase {
72
+ initialRouteName?: string;
73
+ routes: RouteDefinition[];
74
+ /** Typed upstream options can be layered by the owning Navigator package. */
75
+ options?: Record<string, unknown>;
76
+ }
77
+
78
+ export interface StackNavigatorNode extends NavigatorNodeBase {
79
+ type: 'stack';
80
+ }
81
+
82
+ export interface DrawerNavigatorNode extends NavigatorNodeBase {
83
+ type: 'drawer';
84
+ }
85
+
86
+ export type TabsNavigatorConfig = {
87
+ type: 'tabs';
88
+ } & TabsImplementationConfig;
89
+
90
+ export type TabsNavigatorNode = NavigatorNodeBase & TabsNavigatorConfig;
91
+
92
+ export type NavigatorNode = DrawerNavigatorNode | StackNavigatorNode | TabsNavigatorNode;
93
+
94
+ export interface RouteDefinition {
95
+ name: string;
96
+ path?: string;
97
+ label?: string;
98
+ icon?: IconSpec;
99
+ /** Hide this route from primary Tabs/Drawer presentation without making it unnavigable. */
100
+ showInPrimaryNavigation?: boolean;
101
+ guards?: string[];
102
+ screenId?: string;
103
+ navigator?: NavigatorNode;
104
+ }
105
+
106
+ export interface NavigatorFlows {
107
+ onboarding?: boolean;
108
+ authentication?: boolean;
109
+ }
110
+
111
+ export interface NavigatorDefaults {
112
+ tabs?: TabsImplementationConfig;
113
+ }
114
+
115
+ export interface NavigatorPlatformConfig {
116
+ tabs?: TabsImplementationConfig;
117
+ }
118
+
119
+ export interface NavigatorPlatforms {
120
+ android?: NavigatorPlatformConfig;
121
+ ios?: NavigatorPlatformConfig;
122
+ web?: NavigatorPlatformConfig;
123
+ }
124
+
125
+ /**
126
+ * Serializable desired state for `AppManifest.navigator`.
127
+ *
128
+ * The manifest slice is the root navigator tree itself; optional authoring metadata does not add
129
+ * a redundant `root` wrapper. The standalone Navigator capability consumes this slice directly.
130
+ */
131
+ export type AppNavigatorManifest = NavigatorNode & {
132
+ preset?: NavigatorPreset;
133
+ flows?: NavigatorFlows;
134
+ defaults?: NavigatorDefaults;
135
+ platforms?: NavigatorPlatforms;
136
+ };
package/src/types.ts CHANGED
@@ -9,6 +9,7 @@ import type {
9
9
  import type { ApiDefinitionList, DataSourceRegistry } from './data';
10
10
  import type { AppDeployManifest } from './deploy';
11
11
  import type { MediaManifest } from './media';
12
+ import type { AppNavigatorManifest } from './navigator';
12
13
  import type { RepositoryManifest } from './repository';
13
14
  import type { ScreenRequirements } from './requirements';
14
15
  import type { ThemeGlobalTokenOverrides, ThemeRecipeOverrides } from './theme';
@@ -135,9 +136,6 @@ export type ComponentEventDtoKind =
135
136
  export type KnownComponentEventDto =
136
137
  ButtonPressEventDto | CollectionItemPressEventDto | FormSubmitEventDto;
137
138
 
138
- export const NAVIGATOR_TYPES = ['stack', 'tabs', 'drawer'] as const;
139
- export type NavigatorType = (typeof NAVIGATOR_TYPES)[number];
140
-
141
139
  export const APP_CATEGORIES = [
142
140
  'books_reading',
143
141
  'business_productivity',
@@ -258,31 +256,6 @@ export interface ScreenSpec {
258
256
  requires?: ScreenRequirements;
259
257
  }
260
258
 
261
- export interface NavigatorSpec {
262
- type: NavigatorType;
263
- initialRouteName?: string;
264
- routes: RouteDefinition[];
265
- options?: Record<string, unknown>;
266
- }
267
-
268
- export interface RouteDefinition {
269
- name: string;
270
- path?: string;
271
- label?: string;
272
- icon?: IconSpec;
273
- /**
274
- * Whether this route appears in Tabs and Drawer primary navigation.
275
- *
276
- * Omitted routes are visible by default. Setting this to `false` hides the
277
- * route from primary navigation without making it unnavigable. Stack
278
- * navigators preserve the value but do not present primary navigation.
279
- */
280
- showInPrimaryNavigation?: boolean;
281
- guards?: string[];
282
- screenId?: string;
283
- navigator?: NavigatorSpec;
284
- }
285
-
286
259
  export type SplashScreenResizeMode = 'contain' | 'cover' | 'native';
287
260
 
288
261
  export interface SplashScreenAssetSpec {
@@ -396,7 +369,7 @@ export interface AppManifest {
396
369
  /** App distribution desired state. Infrastructure deployment remains under `infra.deployment`. */
397
370
  deploy?: AppDeployManifest;
398
371
  infra: InfraManifest;
399
- navigator: NavigatorSpec;
372
+ navigator: AppNavigatorManifest;
400
373
  screens: Record<string, ScreenSpec>;
401
374
  dataSources?: DataSourceRegistry;
402
375
  dataBindings?: ComponentDataBindingRegistry;