@ankhorage/contracts 11.1.0 → 12.0.1
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 +15 -0
- package/README.md +1 -1
- package/dist/appManifest/navigator.d.ts +2 -1
- package/dist/appManifest/navigator.d.ts.map +1 -1
- package/dist/appManifest/navigator.js +11 -11
- package/dist/appManifest/navigator.js.map +1 -1
- package/dist/appManifest/navigatorOptions.d.ts.map +1 -1
- package/dist/appManifest/navigatorOptions.js +27 -29
- package/dist/appManifest/navigatorOptions.js.map +1 -1
- package/dist/navigator/catalog.d.ts +42 -0
- package/dist/navigator/catalog.d.ts.map +1 -0
- package/dist/navigator/catalog.js +2 -0
- package/dist/navigator/catalog.js.map +1 -0
- package/dist/navigator/generation.d.ts +14 -4
- package/dist/navigator/generation.d.ts.map +1 -1
- package/dist/navigator/generation.js.map +1 -1
- package/dist/navigator/planning.d.ts +9 -9
- package/dist/navigator/planning.d.ts.map +1 -1
- package/dist/navigator/planning.js.map +1 -1
- package/dist/navigator.d.ts +21 -24
- package/dist/navigator.d.ts.map +1 -1
- package/dist/navigator.js +10 -9
- package/dist/navigator.js.map +1 -1
- package/package.json +2 -2
- package/src/appManifest/navigator.ts +15 -17
- package/src/appManifest/navigatorOptions.ts +29 -31
- package/src/navigator/catalog.ts +79 -0
- package/src/navigator/generation.ts +22 -4
- package/src/navigator/planning.ts +10 -9
- package/src/navigator-runtime-contracts.test.ts +54 -3
- package/src/navigator-validation.test.ts +31 -4
- package/src/navigator.test.ts +49 -17
- package/src/navigator.ts +41 -30
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planning.js","sourceRoot":"","sources":["../../src/navigator/planning.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n CustomNavigatorNode,\n DrawerNavigatorOptions,\n NavigatorType,\n RouteDefinition,\n StackImplementation,\n StackScreenOptions,\n} from '../navigator';\nimport type { CustomNavigatorRegistry } from './extensions';\n\nexport interface
|
|
1
|
+
{"version":3,"file":"planning.js","sourceRoot":"","sources":["../../src/navigator/planning.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n CustomNavigatorNode,\n DrawerNavigatorOptions,\n NavigatorType,\n RouteDefinition,\n StackImplementation,\n StackScreenOptions,\n} from '../navigator';\nimport type { CustomNavigatorRegistry } from './extensions';\nimport type { NavigatorDependencyRequirement } from './generation';\n\nexport interface ResolvedHeadlessTabsPresentation {\n presentation: ResolvedTabsPresentation;\n customPresentationId?: string;\n}\n\nexport type ResolvedTabsImplementation = 'headless' | 'javascript' | 'native';\n\nexport type ResolvedTabsPresentation = 'bottom' | 'top' | 'rail' | 'sidebar' | 'custom';\n\n/**\n * Disposable adapter plan for a `tabs` topology.\n *\n * The implementation selects the Router runtime. Presentation only selects its visual chrome and\n * never creates another route topology.\n */\nexport interface TabsNavigatorPlan {\n implementation: ResolvedTabsImplementation;\n module: ExpoRouterNavigatorModule;\n exportName: string;\n stability: NavigatorApiStability;\n presentation?: ResolvedTabsPresentation;\n presentations?: Readonly<Record<NavigatorResponsiveSize, ResolvedTabsPresentation>>;\n customPresentationId?: string;\n minimizeBehavior?: 'automatic' | 'never' | 'onScrollDown' | 'onScrollUp';\n bottomAccessoryScreenId?: string;\n}\n\nexport interface CreateNavigatorPlanOptions {\n platform: NavigatorRuntimePlatform;\n expoRouterVersion: string;\n responsiveSize?: NavigatorResponsiveSize;\n customNavigators?: CustomNavigatorRegistry;\n}\n\nexport type ExpoRouterNavigatorModule =\n | 'expo-router'\n | 'expo-router/drawer'\n | 'expo-router/js-stack'\n | 'expo-router/js-tabs'\n | 'expo-router/js-top-tabs'\n | 'expo-router/ui'\n | 'expo-router/unstable-split-view'\n | 'expo-router/unstable-native-tabs';\n\nexport type NavigatorAdapterId =\n | 'slot'\n | 'stack.native'\n | 'stack.javascript'\n | 'stack.experimental'\n | 'drawer'\n | 'tabs.native'\n | 'tabs.javascript'\n | 'tabs.headless'\n | 'split-view'\n | 'custom';\n\nexport interface NavigatorAdapterPlan {\n id: NavigatorAdapterId;\n /** Built-in Expo Router entry point or an explicitly registered custom module. */\n module?: string;\n exportName?: string;\n support: NavigatorSupportStatus;\n stability: NavigatorApiStability;\n limitations: readonly string[];\n}\n\nexport type NavigatorApiStability = 'stable' | 'alpha';\n\nexport type NavigatorCapabilityId = string;\n\nexport interface NavigatorDiagnostic {\n code: string;\n severity: 'error' | 'warning';\n path: string;\n message: string;\n}\n\nexport interface NavigatorNodePlan {\n type: NavigatorType;\n pointer: string;\n adapter: NavigatorAdapterPlan;\n initialRouteName?: string;\n routes: readonly NavigatorRoutePlan[];\n stack?: {\n implementation: StackImplementation;\n options?: StackScreenOptions;\n };\n drawer?: {\n options?: DrawerNavigatorOptions;\n };\n tabs?: TabsNavigatorPlan;\n splitView?: {\n columns: {\n primary: string;\n supplementary?: string;\n };\n inspector?: string;\n topColumnForCollapsing?: 'primary' | 'secondary' | 'supplementary';\n };\n custom?: {\n navigatorId: string;\n config?: CustomNavigatorNode['config'];\n };\n}\n\nexport interface NavigatorPlan {\n context: NavigatorValidationContext;\n root: NavigatorNodePlan;\n diagnostics: readonly NavigatorDiagnostic[];\n support: NavigatorSupportStatus;\n capabilityIds: readonly NavigatorCapabilityId[];\n dependencies: readonly NavigatorDependencyRequirement[];\n}\n\nexport type NavigatorResponsiveSize = 'compact' | 'medium' | 'expanded';\n\nexport interface NavigatorRoutePlan {\n name: string;\n path?: string;\n label?: string;\n icon?: RouteDefinition['icon'];\n showInPrimaryNavigation?: boolean;\n guards: readonly string[];\n screenId?: string;\n stackOptions?: StackScreenOptions;\n navigator?: NavigatorNodePlan;\n}\n\nexport type NavigatorRuntimePlatform = 'android' | 'ios' | 'web';\n\nexport type NavigatorSupportStatus = 'supported' | 'testing-only' | 'unsupported';\n\nexport interface NavigatorValidationContext {\n platform: NavigatorRuntimePlatform;\n expoRouterVersion: string;\n}\n"]}
|
package/dist/navigator.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { IconSpec, ManifestValue } from './types';
|
|
2
|
+
export { isAppNavigatorManifest } from './appManifest/navigator';
|
|
2
3
|
export declare const NAVIGATOR_TYPES: readonly ["slot", "stack", "tabs", "drawer", "split-view", "custom"];
|
|
3
4
|
export type NavigatorType = (typeof NAVIGATOR_TYPES)[number];
|
|
4
|
-
export declare const NAVIGATOR_PRESETS: readonly ["slot", "stack", "tabs", "tabs-stack", "
|
|
5
|
+
export declare const NAVIGATOR_PRESETS: readonly ["slot", "stack", "tabs", "tabs-stack", "stack-tabs", "stack-tabs-stack", "drawer", "drawer-stack", "stack-drawer", "stack-drawer-stack", "drawer-tabs", "drawer-tabs-stack", "stack-drawer-tabs", "stack-drawer-tabs-stack", "split-view", "custom"];
|
|
5
6
|
export type NavigatorPreset = (typeof NAVIGATOR_PRESETS)[number];
|
|
6
7
|
export declare const STACK_IMPLEMENTATIONS: readonly ["native", "javascript", "experimental"];
|
|
7
8
|
export type StackImplementation = (typeof STACK_IMPLEMENTATIONS)[number];
|
|
@@ -49,21 +50,21 @@ export interface DrawerNavigatorOptions {
|
|
|
49
50
|
swipeEnabled?: boolean;
|
|
50
51
|
headerShown?: boolean;
|
|
51
52
|
}
|
|
52
|
-
export declare const
|
|
53
|
-
export type
|
|
54
|
-
export declare const
|
|
55
|
-
export type
|
|
53
|
+
export declare const FIXED_HEADLESS_TABS_PRESENTATIONS: readonly ["bottom", "top", "rail", "sidebar"];
|
|
54
|
+
export type FixedHeadlessTabsPresentation = (typeof FIXED_HEADLESS_TABS_PRESENTATIONS)[number];
|
|
55
|
+
export declare const HEADLESS_TABS_PRESENTATIONS: readonly ["bottom", "top", "rail", "sidebar", "responsive", "custom"];
|
|
56
|
+
export type HeadlessTabsPresentation = (typeof HEADLESS_TABS_PRESENTATIONS)[number];
|
|
56
57
|
export declare const JAVASCRIPT_TABS_PRESENTATIONS: readonly ["bottom", "top"];
|
|
57
58
|
export type JavaScriptTabsPresentation = (typeof JAVASCRIPT_TABS_PRESENTATIONS)[number];
|
|
58
59
|
export declare const NATIVE_TABS_MINIMIZE_BEHAVIORS: readonly ["automatic", "never", "onScrollDown", "onScrollUp"];
|
|
59
60
|
export type NativeTabsMinimizeBehavior = (typeof NATIVE_TABS_MINIMIZE_BEHAVIORS)[number];
|
|
60
61
|
export interface ResponsiveTabsPresentation {
|
|
61
|
-
compact:
|
|
62
|
-
medium?:
|
|
63
|
-
expanded:
|
|
62
|
+
compact: FixedHeadlessTabsPresentation;
|
|
63
|
+
medium?: FixedHeadlessTabsPresentation;
|
|
64
|
+
expanded: FixedHeadlessTabsPresentation;
|
|
64
65
|
}
|
|
65
|
-
export type
|
|
66
|
-
presentation:
|
|
66
|
+
export type HeadlessTabsPresentationConfig = {
|
|
67
|
+
presentation: FixedHeadlessTabsPresentation;
|
|
67
68
|
responsive?: never;
|
|
68
69
|
customPresentationId?: never;
|
|
69
70
|
} | {
|
|
@@ -76,10 +77,10 @@ export type CustomTabsPresentationConfig = {
|
|
|
76
77
|
/** Serializable registered presentation id. */
|
|
77
78
|
customPresentationId: string;
|
|
78
79
|
};
|
|
79
|
-
export type
|
|
80
|
-
implementation: '
|
|
81
|
-
} &
|
|
82
|
-
export type
|
|
80
|
+
export type HeadlessTabsConfig = {
|
|
81
|
+
implementation: 'headless';
|
|
82
|
+
} & HeadlessTabsPresentationConfig;
|
|
83
|
+
export type HeadlessTabsWebConfig = HeadlessTabsPresentationConfig;
|
|
83
84
|
export interface NavigatorScreenReference {
|
|
84
85
|
screenId: string;
|
|
85
86
|
}
|
|
@@ -99,10 +100,10 @@ export interface AdaptiveTabsConfig {
|
|
|
99
100
|
implementation?: 'adaptive';
|
|
100
101
|
/** Android/iOS branch. Expo Router may expose this implementation as unstable. */
|
|
101
102
|
native?: NativeTabsConfig;
|
|
102
|
-
/** Web branch rendered through headless
|
|
103
|
-
web?:
|
|
103
|
+
/** Web branch rendered through headless tabs. */
|
|
104
|
+
web?: HeadlessTabsWebConfig;
|
|
104
105
|
}
|
|
105
|
-
export type TabsImplementationConfig = AdaptiveTabsConfig |
|
|
106
|
+
export type TabsImplementationConfig = AdaptiveTabsConfig | HeadlessTabsConfig | JavaScriptTabsConfig | NativeTabsConfig;
|
|
106
107
|
interface NavigatorNodeBase {
|
|
107
108
|
initialRouteName?: string;
|
|
108
109
|
routes: RouteDefinition[];
|
|
@@ -150,10 +151,6 @@ export interface RouteDefinition {
|
|
|
150
151
|
stackOptions?: StackScreenOptions;
|
|
151
152
|
navigator?: NavigatorNode;
|
|
152
153
|
}
|
|
153
|
-
export interface NavigatorFlows {
|
|
154
|
-
onboarding?: boolean;
|
|
155
|
-
authentication?: boolean;
|
|
156
|
-
}
|
|
157
154
|
export interface NavigatorDefaults {
|
|
158
155
|
tabs?: TabsImplementationConfig;
|
|
159
156
|
stack?: StackImplementationConfig;
|
|
@@ -175,11 +172,11 @@ export interface NavigatorPlatforms {
|
|
|
175
172
|
*/
|
|
176
173
|
export type AppNavigatorManifest = NavigatorNode & {
|
|
177
174
|
preset?: NavigatorPreset;
|
|
178
|
-
flows?: NavigatorFlows;
|
|
179
175
|
defaults?: NavigatorDefaults;
|
|
180
176
|
platforms?: NavigatorPlatforms;
|
|
181
177
|
};
|
|
178
|
+
export type { NavigatorCapabilityDescriptor, NavigatorCapabilityRequirement, NavigatorCapabilityTarget, NavigatorCapabilityVerification, NavigatorCatalog, NavigatorImplementation, NavigatorPresentation, NavigatorPresetDescriptor, NavigatorVerificationKind, NavigatorVerificationStatus, } from './navigator/catalog';
|
|
182
179
|
export type { CustomNavigatorConfigIssue, CustomNavigatorRegistration, CustomNavigatorRegistry, } from './navigator/extensions';
|
|
183
|
-
export type { NavigatorGeneratedFile, NavigatorGenerationBindings, NavigatorGenerationOptions, NavigatorScreenModule, } from './navigator/generation';
|
|
184
|
-
export type { CreateNavigatorPlanOptions, ExpoRouterNavigatorModule, NavigatorAdapterId, NavigatorAdapterPlan, NavigatorApiStability, NavigatorDiagnostic, NavigatorNodePlan, NavigatorPlan, NavigatorResponsiveSize, NavigatorRoutePlan, NavigatorRuntimePlatform, NavigatorSupportStatus, NavigatorValidationContext,
|
|
180
|
+
export type { NavigatorDependencyRequirement, NavigatorGeneratedFile, NavigatorGenerationBindings, NavigatorGenerationOptions, NavigatorGenerationResult, NavigatorScreenModule, } from './navigator/generation';
|
|
181
|
+
export type { CreateNavigatorPlanOptions, ExpoRouterNavigatorModule, NavigatorAdapterId, NavigatorAdapterPlan, NavigatorApiStability, NavigatorCapabilityId, NavigatorDiagnostic, NavigatorNodePlan, NavigatorPlan, NavigatorResponsiveSize, NavigatorRoutePlan, NavigatorRuntimePlatform, NavigatorSupportStatus, NavigatorValidationContext, ResolvedHeadlessTabsPresentation, ResolvedTabsImplementation, ResolvedTabsPresentation, TabsNavigatorPlan, } from './navigator/planning';
|
|
185
182
|
//# sourceMappingURL=navigator.d.ts.map
|
package/dist/navigator.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigator.d.ts","sourceRoot":"","sources":["../src/navigator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEvD,eAAO,MAAM,eAAe,sEAAuE,CAAC;AACpG,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"navigator.d.ts","sourceRoot":"","sources":["../src/navigator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,eAAO,MAAM,eAAe,sEAAuE,CAAC;AACpG,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7D,eAAO,MAAM,iBAAiB,gQAiBpB,CAAC;AACX,MAAM,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oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,wBAAwB,EACxB,sBAAsB,EACtB,0BAA0B,EAC1B,gCAAgC,EAChC,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,sBAAsB,CAAC"}
|
package/dist/navigator.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
|
+
export { isAppNavigatorManifest } from './appManifest/navigator';
|
|
1
2
|
export const NAVIGATOR_TYPES = ['slot', 'stack', 'tabs', 'drawer', 'split-view', 'custom'];
|
|
2
3
|
export const NAVIGATOR_PRESETS = [
|
|
3
4
|
'slot',
|
|
4
5
|
'stack',
|
|
5
6
|
'tabs',
|
|
6
7
|
'tabs-stack',
|
|
8
|
+
'stack-tabs',
|
|
9
|
+
'stack-tabs-stack',
|
|
7
10
|
'drawer',
|
|
8
11
|
'drawer-stack',
|
|
12
|
+
'stack-drawer',
|
|
13
|
+
'stack-drawer-stack',
|
|
9
14
|
'drawer-tabs',
|
|
10
15
|
'drawer-tabs-stack',
|
|
11
|
-
'
|
|
12
|
-
'
|
|
13
|
-
'root-stack-drawer',
|
|
14
|
-
'root-stack-drawer-stack',
|
|
15
|
-
'root-stack-drawer-tabs',
|
|
16
|
-
'root-stack-drawer-tabs-stack',
|
|
16
|
+
'stack-drawer-tabs',
|
|
17
|
+
'stack-drawer-tabs-stack',
|
|
17
18
|
'split-view',
|
|
18
19
|
'custom',
|
|
19
20
|
];
|
|
@@ -30,9 +31,9 @@ export const STACK_PRESENTATIONS = [
|
|
|
30
31
|
export const JAVASCRIPT_STACK_PRESENTATIONS = ['card', 'modal', 'transparentModal'];
|
|
31
32
|
export const DRAWER_POSITIONS = ['left', 'right'];
|
|
32
33
|
export const DRAWER_TYPES = ['front', 'back', 'slide', 'permanent'];
|
|
33
|
-
export const
|
|
34
|
-
export const
|
|
35
|
-
...
|
|
34
|
+
export const FIXED_HEADLESS_TABS_PRESENTATIONS = ['bottom', 'top', 'rail', 'sidebar'];
|
|
35
|
+
export const HEADLESS_TABS_PRESENTATIONS = [
|
|
36
|
+
...FIXED_HEADLESS_TABS_PRESENTATIONS,
|
|
36
37
|
'responsive',
|
|
37
38
|
'custom',
|
|
38
39
|
];
|
package/dist/navigator.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigator.js","sourceRoot":"","sources":["../src/navigator.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,CAAU,CAAC;AAGpG,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,MAAM;IACN,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;IAC9B,YAAY;IACZ,QAAQ;CACA,CAAC;AAGX,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,QAAQ,EAAE,YAAY,EAAE,cAAc,CAAU,CAAC;AAGvF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,MAAM;IACN,OAAO;IACP,kBAAkB;IAClB,gBAAgB;IAChB,2BAA2B;IAC3B,iBAAiB;IACjB,WAAW;CACH,CAAC;AAGX,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,kBAAkB,CAAU,CAAC;AA4C7F,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU,CAAC;AAG3D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,CAAU,CAAC;AAU7E,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;AAGxE,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,WAAW;IACX,OAAO;IACP,cAAc;IACd,YAAY;CACJ,CAAC","sourcesContent":["import type { IconSpec, ManifestValue } from './types';\n\nexport const NAVIGATOR_TYPES = ['slot', 'stack', 'tabs', 'drawer', 'split-view', 'custom'] as const;\nexport type NavigatorType = (typeof NAVIGATOR_TYPES)[number];\n\nexport const NAVIGATOR_PRESETS = [\n 'slot',\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 'split-view',\n 'custom',\n] as const;\nexport type NavigatorPreset = (typeof NAVIGATOR_PRESETS)[number];\n\nexport const STACK_IMPLEMENTATIONS = ['native', 'javascript', 'experimental'] as const;\nexport type StackImplementation = (typeof STACK_IMPLEMENTATIONS)[number];\n\nexport const STACK_PRESENTATIONS = [\n 'card',\n 'modal',\n 'transparentModal',\n 'containedModal',\n 'containedTransparentModal',\n 'fullScreenModal',\n 'formSheet',\n] as const;\nexport type StackPresentation = (typeof STACK_PRESENTATIONS)[number];\n\nexport const JAVASCRIPT_STACK_PRESENTATIONS = ['card', 'modal', 'transparentModal'] as const;\nexport type JavaScriptStackPresentation = (typeof JAVASCRIPT_STACK_PRESENTATIONS)[number];\n\nexport interface StackHeaderOptions {\n title?: string;\n headerShown?: boolean;\n headerTransparent?: boolean;\n headerBackVisible?: boolean;\n}\n\nexport type StackScreenOptions = StackHeaderOptions &\n (\n | {\n presentation?: Exclude<StackPresentation, 'formSheet'>;\n sheetAllowedDetents?: never;\n sheetGrabberVisible?: never;\n }\n | {\n presentation: 'formSheet';\n sheetAllowedDetents?: 'fitToContents' | number[];\n sheetGrabberVisible?: boolean;\n }\n );\n\nexport type JavaScriptStackScreenOptions = StackHeaderOptions & {\n presentation?: JavaScriptStackPresentation;\n};\n\nexport type StackImplementationConfig =\n | {\n /** Omission selects the stable native stack implementation. */\n implementation?: 'native';\n options?: StackScreenOptions;\n }\n | {\n implementation: 'javascript';\n options?: JavaScriptStackScreenOptions;\n }\n | {\n /** Expo Router Experimental Stack is alpha, native-only, and available from SDK 56. */\n implementation: 'experimental';\n options?: StackHeaderOptions;\n };\n\nexport const DRAWER_POSITIONS = ['left', 'right'] as const;\nexport type DrawerPosition = (typeof DRAWER_POSITIONS)[number];\n\nexport const DRAWER_TYPES = ['front', 'back', 'slide', 'permanent'] as const;\nexport type DrawerType = (typeof DRAWER_TYPES)[number];\n\nexport interface DrawerNavigatorOptions {\n drawerPosition?: DrawerPosition;\n drawerType?: DrawerType;\n swipeEnabled?: boolean;\n headerShown?: boolean;\n}\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 const NATIVE_TABS_MINIMIZE_BEHAVIORS = [\n 'automatic',\n 'never',\n 'onScrollDown',\n 'onScrollUp',\n] as const;\nexport type NativeTabsMinimizeBehavior = (typeof NATIVE_TABS_MINIMIZE_BEHAVIORS)[number];\n\nexport interface ResponsiveTabsPresentation {\n compact: FixedCustomTabsPresentation;\n medium?: FixedCustomTabsPresentation;\n expanded: FixedCustomTabsPresentation;\n}\n\nexport type CustomTabsPresentationConfig =\n | {\n presentation: FixedCustomTabsPresentation;\n responsive?: never;\n customPresentationId?: never;\n }\n | {\n presentation: 'responsive';\n responsive: ResponsiveTabsPresentation;\n customPresentationId?: never;\n }\n | {\n presentation: 'custom';\n responsive?: never;\n /** Serializable registered presentation id. */\n customPresentationId: string;\n };\n\nexport type CustomTabsConfig = {\n implementation: 'custom';\n} & CustomTabsPresentationConfig;\n\nexport type CustomTabsWebConfig = CustomTabsPresentationConfig;\n\nexport interface NavigatorScreenReference {\n screenId: string;\n}\n\nexport interface NativeTabsConfig {\n implementation: 'native';\n /** Expo Router Native Tabs is alpha; minimizing is available on iOS 26+ from SDK 55. */\n minimizeBehavior?: NativeTabsMinimizeBehavior;\n /** Registered screen rendered through NativeTabs.BottomAccessory, available from SDK 55. */\n bottomAccessory?: NavigatorScreenReference;\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?: CustomTabsWebConfig;\n}\n\nexport type TabsImplementationConfig =\n AdaptiveTabsConfig | CustomTabsConfig | JavaScriptTabsConfig | NativeTabsConfig;\n\ninterface NavigatorNodeBase {\n initialRouteName?: string;\n routes: RouteDefinition[];\n}\n\nexport interface SlotNavigatorNode extends NavigatorNodeBase {\n type: 'slot';\n}\n\nexport type StackNavigatorNode = NavigatorNodeBase & {\n type: 'stack';\n} & StackImplementationConfig;\n\nexport interface DrawerNavigatorNode extends NavigatorNodeBase {\n type: 'drawer';\n options?: DrawerNavigatorOptions;\n}\n\nexport type TabsNavigatorConfig = {\n type: 'tabs';\n} & TabsImplementationConfig;\n\nexport type TabsNavigatorNode = NavigatorNodeBase & TabsNavigatorConfig;\n\nexport interface SplitViewNavigatorNode extends NavigatorNodeBase {\n type: 'split-view';\n columns: {\n primary: NavigatorScreenReference;\n supplementary?: NavigatorScreenReference;\n };\n inspector?: NavigatorScreenReference;\n /** Split View is alpha and iOS-only; other platforms fall back to Slot. */\n topColumnForCollapsing?: 'primary' | 'supplementary' | 'secondary';\n}\n\nexport interface CustomNavigatorNode extends NavigatorNodeBase {\n type: 'custom';\n navigatorId: string;\n config?: Readonly<Record<string, ManifestValue>>;\n}\n\nexport type NavigatorNode =\n | CustomNavigatorNode\n | DrawerNavigatorNode\n | SlotNavigatorNode\n | SplitViewNavigatorNode\n | StackNavigatorNode\n | 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 /** Presentation applied by the resolved parent stack implementation. */\n stackOptions?: StackScreenOptions;\n navigator?: NavigatorNode;\n}\n\nexport interface NavigatorFlows {\n onboarding?: boolean;\n authentication?: boolean;\n}\n\nexport interface NavigatorDefaults {\n tabs?: TabsImplementationConfig;\n stack?: StackImplementationConfig;\n}\n\nexport interface NavigatorPlatformConfig {\n tabs?: TabsImplementationConfig;\n stack?: StackImplementationConfig;\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\nexport type {\n CustomNavigatorConfigIssue,\n CustomNavigatorRegistration,\n CustomNavigatorRegistry,\n} from './navigator/extensions';\nexport type {\n NavigatorGeneratedFile,\n NavigatorGenerationBindings,\n NavigatorGenerationOptions,\n NavigatorScreenModule,\n} from './navigator/generation';\nexport type {\n CreateNavigatorPlanOptions,\n ExpoRouterNavigatorModule,\n NavigatorAdapterId,\n NavigatorAdapterPlan,\n NavigatorApiStability,\n NavigatorDiagnostic,\n NavigatorNodePlan,\n NavigatorPlan,\n NavigatorResponsiveSize,\n NavigatorRoutePlan,\n NavigatorRuntimePlatform,\n NavigatorSupportStatus,\n NavigatorValidationContext,\n ResolvedCustomTabsPresentation,\n ResolvedTabsImplementation,\n ResolvedTabsPresentation,\n TabsNavigatorPlan,\n} from './navigator/planning';\n"]}
|
|
1
|
+
{"version":3,"file":"navigator.js","sourceRoot":"","sources":["../src/navigator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEjE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,CAAU,CAAC;AAGpG,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,MAAM;IACN,OAAO;IACP,MAAM;IACN,YAAY;IACZ,YAAY;IACZ,kBAAkB;IAClB,QAAQ;IACR,cAAc;IACd,cAAc;IACd,oBAAoB;IACpB,aAAa;IACb,mBAAmB;IACnB,mBAAmB;IACnB,yBAAyB;IACzB,YAAY;IACZ,QAAQ;CACA,CAAC;AAGX,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,QAAQ,EAAE,YAAY,EAAE,cAAc,CAAU,CAAC;AAGvF,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,MAAM;IACN,OAAO;IACP,kBAAkB;IAClB,gBAAgB;IAChB,2BAA2B;IAC3B,iBAAiB;IACjB,WAAW;CACH,CAAC;AAGX,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,kBAAkB,CAAU,CAAC;AA4C7F,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,OAAO,CAAU,CAAC;AAG3D,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,CAAU,CAAC;AAU7E,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAU,CAAC;AAG/F,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,GAAG,iCAAiC;IACpC,YAAY;IACZ,QAAQ;CACA,CAAC;AAGX,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAU,CAAC;AAGxE,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,WAAW;IACX,OAAO;IACP,cAAc;IACd,YAAY;CACJ,CAAC","sourcesContent":["import type { IconSpec, ManifestValue } from './types';\n\nexport { isAppNavigatorManifest } from './appManifest/navigator';\n\nexport const NAVIGATOR_TYPES = ['slot', 'stack', 'tabs', 'drawer', 'split-view', 'custom'] as const;\nexport type NavigatorType = (typeof NAVIGATOR_TYPES)[number];\n\nexport const NAVIGATOR_PRESETS = [\n 'slot',\n 'stack',\n 'tabs',\n 'tabs-stack',\n 'stack-tabs',\n 'stack-tabs-stack',\n 'drawer',\n 'drawer-stack',\n 'stack-drawer',\n 'stack-drawer-stack',\n 'drawer-tabs',\n 'drawer-tabs-stack',\n 'stack-drawer-tabs',\n 'stack-drawer-tabs-stack',\n 'split-view',\n 'custom',\n] as const;\nexport type NavigatorPreset = (typeof NAVIGATOR_PRESETS)[number];\n\nexport const STACK_IMPLEMENTATIONS = ['native', 'javascript', 'experimental'] as const;\nexport type StackImplementation = (typeof STACK_IMPLEMENTATIONS)[number];\n\nexport const STACK_PRESENTATIONS = [\n 'card',\n 'modal',\n 'transparentModal',\n 'containedModal',\n 'containedTransparentModal',\n 'fullScreenModal',\n 'formSheet',\n] as const;\nexport type StackPresentation = (typeof STACK_PRESENTATIONS)[number];\n\nexport const JAVASCRIPT_STACK_PRESENTATIONS = ['card', 'modal', 'transparentModal'] as const;\nexport type JavaScriptStackPresentation = (typeof JAVASCRIPT_STACK_PRESENTATIONS)[number];\n\nexport interface StackHeaderOptions {\n title?: string;\n headerShown?: boolean;\n headerTransparent?: boolean;\n headerBackVisible?: boolean;\n}\n\nexport type StackScreenOptions = StackHeaderOptions &\n (\n | {\n presentation?: Exclude<StackPresentation, 'formSheet'>;\n sheetAllowedDetents?: never;\n sheetGrabberVisible?: never;\n }\n | {\n presentation: 'formSheet';\n sheetAllowedDetents?: 'fitToContents' | number[];\n sheetGrabberVisible?: boolean;\n }\n );\n\nexport type JavaScriptStackScreenOptions = StackHeaderOptions & {\n presentation?: JavaScriptStackPresentation;\n};\n\nexport type StackImplementationConfig =\n | {\n /** Omission selects the stable native stack implementation. */\n implementation?: 'native';\n options?: StackScreenOptions;\n }\n | {\n implementation: 'javascript';\n options?: JavaScriptStackScreenOptions;\n }\n | {\n /** Expo Router Experimental Stack is alpha, native-only, and available from SDK 56. */\n implementation: 'experimental';\n options?: StackHeaderOptions;\n };\n\nexport const DRAWER_POSITIONS = ['left', 'right'] as const;\nexport type DrawerPosition = (typeof DRAWER_POSITIONS)[number];\n\nexport const DRAWER_TYPES = ['front', 'back', 'slide', 'permanent'] as const;\nexport type DrawerType = (typeof DRAWER_TYPES)[number];\n\nexport interface DrawerNavigatorOptions {\n drawerPosition?: DrawerPosition;\n drawerType?: DrawerType;\n swipeEnabled?: boolean;\n headerShown?: boolean;\n}\n\nexport const FIXED_HEADLESS_TABS_PRESENTATIONS = ['bottom', 'top', 'rail', 'sidebar'] as const;\nexport type FixedHeadlessTabsPresentation = (typeof FIXED_HEADLESS_TABS_PRESENTATIONS)[number];\n\nexport const HEADLESS_TABS_PRESENTATIONS = [\n ...FIXED_HEADLESS_TABS_PRESENTATIONS,\n 'responsive',\n 'custom',\n] as const;\nexport type HeadlessTabsPresentation = (typeof HEADLESS_TABS_PRESENTATIONS)[number];\n\nexport const JAVASCRIPT_TABS_PRESENTATIONS = ['bottom', 'top'] as const;\nexport type JavaScriptTabsPresentation = (typeof JAVASCRIPT_TABS_PRESENTATIONS)[number];\n\nexport const NATIVE_TABS_MINIMIZE_BEHAVIORS = [\n 'automatic',\n 'never',\n 'onScrollDown',\n 'onScrollUp',\n] as const;\nexport type NativeTabsMinimizeBehavior = (typeof NATIVE_TABS_MINIMIZE_BEHAVIORS)[number];\n\nexport interface ResponsiveTabsPresentation {\n compact: FixedHeadlessTabsPresentation;\n medium?: FixedHeadlessTabsPresentation;\n expanded: FixedHeadlessTabsPresentation;\n}\n\nexport type HeadlessTabsPresentationConfig =\n | {\n presentation: FixedHeadlessTabsPresentation;\n responsive?: never;\n customPresentationId?: never;\n }\n | {\n presentation: 'responsive';\n responsive: ResponsiveTabsPresentation;\n customPresentationId?: never;\n }\n | {\n presentation: 'custom';\n responsive?: never;\n /** Serializable registered presentation id. */\n customPresentationId: string;\n };\n\nexport type HeadlessTabsConfig = {\n implementation: 'headless';\n} & HeadlessTabsPresentationConfig;\n\nexport type HeadlessTabsWebConfig = HeadlessTabsPresentationConfig;\n\nexport interface NavigatorScreenReference {\n screenId: string;\n}\n\nexport interface NativeTabsConfig {\n implementation: 'native';\n /** Expo Router Native Tabs is alpha; minimizing is available on iOS 26+ from SDK 55. */\n minimizeBehavior?: NativeTabsMinimizeBehavior;\n /** Registered screen rendered through NativeTabs.BottomAccessory, available from SDK 55. */\n bottomAccessory?: NavigatorScreenReference;\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 tabs. */\n web?: HeadlessTabsWebConfig;\n}\n\nexport type TabsImplementationConfig =\n AdaptiveTabsConfig | HeadlessTabsConfig | JavaScriptTabsConfig | NativeTabsConfig;\n\ninterface NavigatorNodeBase {\n initialRouteName?: string;\n routes: RouteDefinition[];\n}\n\nexport interface SlotNavigatorNode extends NavigatorNodeBase {\n type: 'slot';\n}\n\nexport type StackNavigatorNode = NavigatorNodeBase & {\n type: 'stack';\n} & StackImplementationConfig;\n\nexport interface DrawerNavigatorNode extends NavigatorNodeBase {\n type: 'drawer';\n options?: DrawerNavigatorOptions;\n}\n\nexport type TabsNavigatorConfig = {\n type: 'tabs';\n} & TabsImplementationConfig;\n\nexport type TabsNavigatorNode = NavigatorNodeBase & TabsNavigatorConfig;\n\nexport interface SplitViewNavigatorNode extends NavigatorNodeBase {\n type: 'split-view';\n columns: {\n primary: NavigatorScreenReference;\n supplementary?: NavigatorScreenReference;\n };\n inspector?: NavigatorScreenReference;\n /** Split View is alpha and iOS-only; other platforms fall back to Slot. */\n topColumnForCollapsing?: 'primary' | 'supplementary' | 'secondary';\n}\n\nexport interface CustomNavigatorNode extends NavigatorNodeBase {\n type: 'custom';\n navigatorId: string;\n config?: Readonly<Record<string, ManifestValue>>;\n}\n\nexport type NavigatorNode =\n | CustomNavigatorNode\n | DrawerNavigatorNode\n | SlotNavigatorNode\n | SplitViewNavigatorNode\n | StackNavigatorNode\n | 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 /** Presentation applied by the resolved parent stack implementation. */\n stackOptions?: StackScreenOptions;\n navigator?: NavigatorNode;\n}\n\nexport interface NavigatorDefaults {\n tabs?: TabsImplementationConfig;\n stack?: StackImplementationConfig;\n}\n\nexport interface NavigatorPlatformConfig {\n tabs?: TabsImplementationConfig;\n stack?: StackImplementationConfig;\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 defaults?: NavigatorDefaults;\n platforms?: NavigatorPlatforms;\n};\n\nexport type {\n NavigatorCapabilityDescriptor,\n NavigatorCapabilityRequirement,\n NavigatorCapabilityTarget,\n NavigatorCapabilityVerification,\n NavigatorCatalog,\n NavigatorImplementation,\n NavigatorPresentation,\n NavigatorPresetDescriptor,\n NavigatorVerificationKind,\n NavigatorVerificationStatus,\n} from './navigator/catalog';\nexport type {\n CustomNavigatorConfigIssue,\n CustomNavigatorRegistration,\n CustomNavigatorRegistry,\n} from './navigator/extensions';\nexport type {\n NavigatorDependencyRequirement,\n NavigatorGeneratedFile,\n NavigatorGenerationBindings,\n NavigatorGenerationOptions,\n NavigatorGenerationResult,\n NavigatorScreenModule,\n} from './navigator/generation';\nexport type {\n CreateNavigatorPlanOptions,\n ExpoRouterNavigatorModule,\n NavigatorAdapterId,\n NavigatorAdapterPlan,\n NavigatorApiStability,\n NavigatorCapabilityId,\n NavigatorDiagnostic,\n NavigatorNodePlan,\n NavigatorPlan,\n NavigatorResponsiveSize,\n NavigatorRoutePlan,\n NavigatorRuntimePlatform,\n NavigatorSupportStatus,\n NavigatorValidationContext,\n ResolvedHeadlessTabsPresentation,\n ResolvedTabsImplementation,\n ResolvedTabsPresentation,\n TabsNavigatorPlan,\n} from './navigator/planning';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/contracts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"ankh": {
|
|
6
6
|
"category": "contracts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"@ankhorage/color-theory": "^0.3.0"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@ankhorage/devtools": "^1.
|
|
16
|
+
"@ankhorage/devtools": "^1.12.0",
|
|
17
17
|
"@ankhorage/paradox": "^0.1.24",
|
|
18
18
|
"@types/bun": "^1.4.1",
|
|
19
19
|
"@types/node": "^25.2.3",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NAVIGATOR_PRESETS, NAVIGATOR_TYPES } from '../navigator';
|
|
1
|
+
import { type AppNavigatorManifest, NAVIGATOR_PRESETS, NAVIGATOR_TYPES } from '../navigator';
|
|
2
2
|
import { isIconSpec } from './icon';
|
|
3
3
|
import {
|
|
4
4
|
hasOnlyKeys,
|
|
@@ -10,17 +10,14 @@ import {
|
|
|
10
10
|
} from './navigatorOptions';
|
|
11
11
|
import { isOptionalBoolean, isOptionalString, isRecord, isStringArray } from './shared';
|
|
12
12
|
|
|
13
|
-
const NAVIGATOR_PRESET_SET = new Set<string>(NAVIGATOR_PRESETS);
|
|
14
|
-
const NAVIGATOR_TYPE_SET = new Set<string>(NAVIGATOR_TYPES);
|
|
15
|
-
|
|
16
13
|
/*** Validate the complete serialized `AppManifest.navigator` slice. */
|
|
17
|
-
export function isAppNavigatorManifest(value: unknown):
|
|
14
|
+
export function isAppNavigatorManifest(value: unknown): value is AppNavigatorManifest {
|
|
18
15
|
return (
|
|
19
16
|
isRecord(value) &&
|
|
20
17
|
isNavigatorNode(value) &&
|
|
21
18
|
(value.preset === undefined ||
|
|
22
|
-
(typeof value.preset === 'string' &&
|
|
23
|
-
|
|
19
|
+
(typeof value.preset === 'string' && hasNavigatorPreset(value.preset))) &&
|
|
20
|
+
value.flows === undefined &&
|
|
24
21
|
(value.defaults === undefined || isNavigatorDefaults(value.defaults)) &&
|
|
25
22
|
(value.platforms === undefined || isNavigatorPlatforms(value.platforms))
|
|
26
23
|
);
|
|
@@ -31,7 +28,7 @@ function isNavigatorNode(value: unknown): boolean {
|
|
|
31
28
|
if (
|
|
32
29
|
!isRecord(value) ||
|
|
33
30
|
typeof value.type !== 'string' ||
|
|
34
|
-
!
|
|
31
|
+
!hasNavigatorType(value.type) ||
|
|
35
32
|
!isOptionalString(value.initialRouteName) ||
|
|
36
33
|
!Array.isArray(value.routes) ||
|
|
37
34
|
!value.routes.every(isRouteDefinition)
|
|
@@ -60,6 +57,16 @@ function isNavigatorNode(value: unknown): boolean {
|
|
|
60
57
|
}
|
|
61
58
|
}
|
|
62
59
|
|
|
60
|
+
/*** Check a serialized preset against the public contract without eager cyclic initialization. */
|
|
61
|
+
function hasNavigatorPreset(value: string): boolean {
|
|
62
|
+
return (NAVIGATOR_PRESETS as readonly string[]).includes(value);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/*** Check a serialized topology against the public contract without eager cyclic initialization. */
|
|
66
|
+
function hasNavigatorType(value: string): boolean {
|
|
67
|
+
return (NAVIGATOR_TYPES as readonly string[]).includes(value);
|
|
68
|
+
}
|
|
69
|
+
|
|
63
70
|
/*** Validate one route and preserve its portable metadata and nested navigator. */
|
|
64
71
|
function isRouteDefinition(value: unknown): boolean {
|
|
65
72
|
return (
|
|
@@ -134,15 +141,6 @@ function isNavigatorJsonValue(value: unknown, ancestors: Set<object>): boolean {
|
|
|
134
141
|
return isValid;
|
|
135
142
|
}
|
|
136
143
|
|
|
137
|
-
/*** Validate optional app-level navigator flow intent. */
|
|
138
|
-
function isNavigatorFlows(value: unknown): boolean {
|
|
139
|
-
return (
|
|
140
|
-
isRecord(value) &&
|
|
141
|
-
isOptionalBoolean(value.onboarding) &&
|
|
142
|
-
isOptionalBoolean(value.authentication)
|
|
143
|
-
);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
144
|
/*** Validate package-owned navigator defaults without requiring a navigator node type. */
|
|
147
145
|
function isNavigatorDefaults(value: unknown): boolean {
|
|
148
146
|
return (
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
|
-
CUSTOM_TABS_PRESENTATIONS,
|
|
3
2
|
DRAWER_POSITIONS,
|
|
4
3
|
DRAWER_TYPES,
|
|
5
|
-
|
|
4
|
+
FIXED_HEADLESS_TABS_PRESENTATIONS,
|
|
5
|
+
HEADLESS_TABS_PRESENTATIONS,
|
|
6
6
|
JAVASCRIPT_STACK_PRESENTATIONS,
|
|
7
7
|
JAVASCRIPT_TABS_PRESENTATIONS,
|
|
8
8
|
NATIVE_TABS_MINIMIZE_BEHAVIORS,
|
|
@@ -10,15 +10,6 @@ import {
|
|
|
10
10
|
} from '../navigator';
|
|
11
11
|
import { isOptionalBoolean, isOptionalString, isRecord } from './shared';
|
|
12
12
|
|
|
13
|
-
const CUSTOM_TABS_PRESENTATION_SET = new Set<string>(CUSTOM_TABS_PRESENTATIONS);
|
|
14
|
-
const DRAWER_POSITION_SET = new Set<string>(DRAWER_POSITIONS);
|
|
15
|
-
const DRAWER_TYPE_SET = new Set<string>(DRAWER_TYPES);
|
|
16
|
-
const FIXED_CUSTOM_TABS_PRESENTATION_SET = new Set<string>(FIXED_CUSTOM_TABS_PRESENTATIONS);
|
|
17
|
-
const JAVASCRIPT_STACK_PRESENTATION_SET = new Set<string>(JAVASCRIPT_STACK_PRESENTATIONS);
|
|
18
|
-
const JAVASCRIPT_TABS_PRESENTATION_SET = new Set<string>(JAVASCRIPT_TABS_PRESENTATIONS);
|
|
19
|
-
const NATIVE_TABS_MINIMIZE_BEHAVIOR_SET = new Set<string>(NATIVE_TABS_MINIMIZE_BEHAVIORS);
|
|
20
|
-
const STACK_PRESENTATION_SET = new Set<string>(STACK_PRESENTATIONS);
|
|
21
|
-
|
|
22
13
|
/*** Validate stable native, JavaScript, or alpha Experimental Stack desired state. */
|
|
23
14
|
export function isStackImplementationConfig(value: Record<string, unknown>): boolean {
|
|
24
15
|
if (
|
|
@@ -61,7 +52,8 @@ export function isStackScreenOptions(value: unknown): boolean {
|
|
|
61
52
|
]) ||
|
|
62
53
|
!isStackHeaderOptionsShape(value) ||
|
|
63
54
|
(value.presentation !== undefined &&
|
|
64
|
-
(typeof value.presentation !== 'string' ||
|
|
55
|
+
(typeof value.presentation !== 'string' ||
|
|
56
|
+
!contains(STACK_PRESENTATIONS, value.presentation)))
|
|
65
57
|
) {
|
|
66
58
|
return false;
|
|
67
59
|
}
|
|
@@ -82,9 +74,9 @@ export function isDrawerNavigatorOptions(value: unknown): boolean {
|
|
|
82
74
|
hasOnlyKeys(value, ['drawerPosition', 'drawerType', 'swipeEnabled', 'headerShown']) &&
|
|
83
75
|
(value.drawerPosition === undefined ||
|
|
84
76
|
(typeof value.drawerPosition === 'string' &&
|
|
85
|
-
|
|
77
|
+
contains(DRAWER_POSITIONS, value.drawerPosition))) &&
|
|
86
78
|
(value.drawerType === undefined ||
|
|
87
|
-
(typeof value.drawerType === 'string' &&
|
|
79
|
+
(typeof value.drawerType === 'string' && contains(DRAWER_TYPES, value.drawerType))) &&
|
|
88
80
|
isOptionalBoolean(value.swipeEnabled) &&
|
|
89
81
|
isOptionalBoolean(value.headerShown)
|
|
90
82
|
);
|
|
@@ -98,9 +90,9 @@ export function isTabsImplementationConfig(value: Record<string, unknown>): bool
|
|
|
98
90
|
if (value.implementation === 'native') return isFullNativeTabsConfig(value);
|
|
99
91
|
if (value.implementation === 'javascript') return isJavaScriptTabsConfig(value);
|
|
100
92
|
return (
|
|
101
|
-
value.implementation === '
|
|
93
|
+
value.implementation === 'headless' &&
|
|
102
94
|
hasNoDefinedKeys(value, ['options', 'native', 'web', 'minimizeBehavior', 'bottomAccessory']) &&
|
|
103
|
-
|
|
95
|
+
isHeadlessTabsPresentationConfig(value)
|
|
104
96
|
);
|
|
105
97
|
}
|
|
106
98
|
|
|
@@ -132,7 +124,7 @@ function isJavaScriptStackScreenOptions(value: unknown): boolean {
|
|
|
132
124
|
isStackHeaderOptionsShape(value) &&
|
|
133
125
|
(value.presentation === undefined ||
|
|
134
126
|
(typeof value.presentation === 'string' &&
|
|
135
|
-
|
|
127
|
+
contains(JAVASCRIPT_STACK_PRESENTATIONS, value.presentation)))
|
|
136
128
|
);
|
|
137
129
|
}
|
|
138
130
|
|
|
@@ -181,7 +173,7 @@ function isAdaptiveTabsConfig(value: Record<string, unknown>): boolean {
|
|
|
181
173
|
'bottomAccessory',
|
|
182
174
|
]) &&
|
|
183
175
|
(value.native === undefined || isNativeTabsConfig(value.native)) &&
|
|
184
|
-
(value.web === undefined ||
|
|
176
|
+
(value.web === undefined || isHeadlessTabsWebConfig(value.web))
|
|
185
177
|
);
|
|
186
178
|
}
|
|
187
179
|
|
|
@@ -213,7 +205,7 @@ function isJavaScriptTabsConfig(value: Record<string, unknown>): boolean {
|
|
|
213
205
|
]) &&
|
|
214
206
|
(value.presentation === undefined ||
|
|
215
207
|
(typeof value.presentation === 'string' &&
|
|
216
|
-
|
|
208
|
+
contains(JAVASCRIPT_TABS_PRESENTATIONS, value.presentation)))
|
|
217
209
|
);
|
|
218
210
|
}
|
|
219
211
|
|
|
@@ -232,25 +224,25 @@ function isNativeTabsFields(value: Record<string, unknown>): boolean {
|
|
|
232
224
|
return (
|
|
233
225
|
(value.minimizeBehavior === undefined ||
|
|
234
226
|
(typeof value.minimizeBehavior === 'string' &&
|
|
235
|
-
|
|
227
|
+
contains(NATIVE_TABS_MINIMIZE_BEHAVIORS, value.minimizeBehavior))) &&
|
|
236
228
|
(value.bottomAccessory === undefined || isNavigatorScreenReference(value.bottomAccessory))
|
|
237
229
|
);
|
|
238
230
|
}
|
|
239
231
|
|
|
240
|
-
/*** Validate the implementation-free
|
|
241
|
-
function
|
|
232
|
+
/*** Validate the implementation-free headless-tabs Web branch inside adaptive tabs. */
|
|
233
|
+
function isHeadlessTabsWebConfig(value: unknown): boolean {
|
|
242
234
|
return (
|
|
243
235
|
isRecord(value) &&
|
|
244
236
|
hasOnlyKeys(value, ['presentation', 'responsive', 'customPresentationId']) &&
|
|
245
|
-
|
|
237
|
+
isHeadlessTabsPresentationConfig(value)
|
|
246
238
|
);
|
|
247
239
|
}
|
|
248
240
|
|
|
249
|
-
/*** Validate
|
|
250
|
-
function
|
|
241
|
+
/*** Validate headless-tab presentation and its conditional serializable configuration. */
|
|
242
|
+
function isHeadlessTabsPresentationConfig(value: Record<string, unknown>): boolean {
|
|
251
243
|
if (
|
|
252
244
|
typeof value.presentation !== 'string' ||
|
|
253
|
-
!
|
|
245
|
+
!contains(HEADLESS_TABS_PRESENTATIONS, value.presentation)
|
|
254
246
|
) {
|
|
255
247
|
return false;
|
|
256
248
|
}
|
|
@@ -258,7 +250,7 @@ function isCustomTabsPresentationConfig(value: Record<string, unknown>): boolean
|
|
|
258
250
|
return false;
|
|
259
251
|
}
|
|
260
252
|
if (!isOptionalString(value.customPresentationId)) return false;
|
|
261
|
-
if (
|
|
253
|
+
if (contains(FIXED_HEADLESS_TABS_PRESENTATIONS, value.presentation)) {
|
|
262
254
|
return value.responsive === undefined && value.customPresentationId === undefined;
|
|
263
255
|
}
|
|
264
256
|
if (value.presentation === 'responsive') {
|
|
@@ -271,20 +263,26 @@ function isCustomTabsPresentationConfig(value: Record<string, unknown>): boolean
|
|
|
271
263
|
);
|
|
272
264
|
}
|
|
273
265
|
|
|
274
|
-
/*** Validate semantic compact/medium/expanded
|
|
266
|
+
/*** Validate semantic compact/medium/expanded headless-tab presentation mapping. */
|
|
275
267
|
function isResponsiveTabsPresentation(value: unknown): boolean {
|
|
276
268
|
return (
|
|
277
269
|
isRecord(value) &&
|
|
278
270
|
hasOnlyKeys(value, ['compact', 'medium', 'expanded']) &&
|
|
279
271
|
typeof value.compact === 'string' &&
|
|
280
|
-
|
|
272
|
+
contains(FIXED_HEADLESS_TABS_PRESENTATIONS, value.compact) &&
|
|
281
273
|
(value.medium === undefined ||
|
|
282
|
-
(typeof value.medium === 'string' &&
|
|
274
|
+
(typeof value.medium === 'string' &&
|
|
275
|
+
contains(FIXED_HEADLESS_TABS_PRESENTATIONS, value.medium))) &&
|
|
283
276
|
typeof value.expanded === 'string' &&
|
|
284
|
-
|
|
277
|
+
contains(FIXED_HEADLESS_TABS_PRESENTATIONS, value.expanded)
|
|
285
278
|
);
|
|
286
279
|
}
|
|
287
280
|
|
|
281
|
+
/*** Check a string against a public finite contract without eager cyclic initialization. */
|
|
282
|
+
function contains(values: readonly string[], value: string): boolean {
|
|
283
|
+
return values.includes(value);
|
|
284
|
+
}
|
|
285
|
+
|
|
288
286
|
/*** Check that mutually exclusive branch fields are absent. */
|
|
289
287
|
function hasNoDefinedKeys(value: Record<string, unknown>, keys: readonly string[]): boolean {
|
|
290
288
|
const prohibited = new Set(keys);
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
HeadlessTabsPresentation,
|
|
3
|
+
JavaScriptTabsPresentation,
|
|
4
|
+
NavigatorPreset,
|
|
5
|
+
NavigatorType,
|
|
6
|
+
StackPresentation,
|
|
7
|
+
} from '../navigator';
|
|
8
|
+
import type { NavigatorDependencyRequirement } from './generation';
|
|
9
|
+
import type {
|
|
10
|
+
NavigatorApiStability,
|
|
11
|
+
NavigatorCapabilityId,
|
|
12
|
+
NavigatorRuntimePlatform,
|
|
13
|
+
NavigatorSupportStatus,
|
|
14
|
+
} from './planning';
|
|
15
|
+
|
|
16
|
+
export type NavigatorVerificationKind =
|
|
17
|
+
| 'structural'
|
|
18
|
+
| 'generation'
|
|
19
|
+
| 'format'
|
|
20
|
+
| 'lint'
|
|
21
|
+
| 'dependency'
|
|
22
|
+
| 'typescript'
|
|
23
|
+
| 'install'
|
|
24
|
+
| 'build'
|
|
25
|
+
| 'export'
|
|
26
|
+
| 'browser'
|
|
27
|
+
| 'simulator'
|
|
28
|
+
| 'device';
|
|
29
|
+
|
|
30
|
+
export type NavigatorVerificationStatus = 'verified' | 'unverified';
|
|
31
|
+
|
|
32
|
+
export type NavigatorImplementation = 'native' | 'javascript' | 'headless' | 'experimental';
|
|
33
|
+
|
|
34
|
+
export type NavigatorPresentation =
|
|
35
|
+
| StackPresentation
|
|
36
|
+
| HeadlessTabsPresentation
|
|
37
|
+
| JavaScriptTabsPresentation
|
|
38
|
+
| 'two-column'
|
|
39
|
+
| 'three-column';
|
|
40
|
+
|
|
41
|
+
export interface NavigatorCapabilityVerification {
|
|
42
|
+
kind: NavigatorVerificationKind;
|
|
43
|
+
status: NavigatorVerificationStatus;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface NavigatorCapabilityTarget {
|
|
47
|
+
platform: NavigatorRuntimePlatform;
|
|
48
|
+
support: NavigatorSupportStatus;
|
|
49
|
+
verification: readonly NavigatorCapabilityVerification[];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface NavigatorCapabilityRequirement {
|
|
53
|
+
id: string;
|
|
54
|
+
description: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface NavigatorCapabilityDescriptor {
|
|
58
|
+
id: NavigatorCapabilityId;
|
|
59
|
+
topology: NavigatorType;
|
|
60
|
+
implementation?: NavigatorImplementation;
|
|
61
|
+
presentation?: NavigatorPresentation;
|
|
62
|
+
stability: NavigatorApiStability;
|
|
63
|
+
targets: readonly NavigatorCapabilityTarget[];
|
|
64
|
+
dependencies: readonly NavigatorDependencyRequirement[];
|
|
65
|
+
requirements: readonly NavigatorCapabilityRequirement[];
|
|
66
|
+
incompatibilities: readonly NavigatorCapabilityId[];
|
|
67
|
+
limitations: readonly string[];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface NavigatorPresetDescriptor {
|
|
71
|
+
id: NavigatorPreset;
|
|
72
|
+
description: string;
|
|
73
|
+
topology: readonly NavigatorType[];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface NavigatorCatalog {
|
|
77
|
+
capabilities: readonly NavigatorCapabilityDescriptor[];
|
|
78
|
+
presets: readonly NavigatorPresetDescriptor[];
|
|
79
|
+
}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
NavigatorCapabilityId,
|
|
3
|
+
NavigatorDiagnostic,
|
|
4
|
+
NavigatorPlan,
|
|
5
|
+
NavigatorSupportStatus,
|
|
6
|
+
} from './planning';
|
|
7
|
+
|
|
1
8
|
export interface NavigatorGeneratedFile {
|
|
2
9
|
path: string;
|
|
3
10
|
contents: string;
|
|
@@ -7,13 +14,24 @@ export interface NavigatorGenerationBindings {
|
|
|
7
14
|
screens: Readonly<Record<string, NavigatorScreenModule>>;
|
|
8
15
|
guards: Readonly<Record<string, NavigatorScreenModule>>;
|
|
9
16
|
iconSourceResolver?: NavigatorScreenModule;
|
|
10
|
-
flows?: {
|
|
11
|
-
onboardingRoute?: string;
|
|
12
|
-
authenticationRoute?: string;
|
|
13
|
-
};
|
|
14
17
|
tabPresentations?: Readonly<Record<string, NavigatorScreenModule>>;
|
|
15
18
|
}
|
|
16
19
|
|
|
20
|
+
export interface NavigatorDependencyRequirement {
|
|
21
|
+
packageName: string;
|
|
22
|
+
versionRange: string;
|
|
23
|
+
kind: 'dependency' | 'peerDependency';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface NavigatorGenerationResult {
|
|
27
|
+
support: NavigatorSupportStatus;
|
|
28
|
+
capabilityIds: readonly NavigatorCapabilityId[];
|
|
29
|
+
dependencies: readonly NavigatorDependencyRequirement[];
|
|
30
|
+
diagnostics: readonly NavigatorDiagnostic[];
|
|
31
|
+
plan: NavigatorPlan;
|
|
32
|
+
files: readonly NavigatorGeneratedFile[];
|
|
33
|
+
}
|
|
34
|
+
|
|
17
35
|
/** Options for placing Navigator-owned files inside a consumer-owned Expo Router app shell. */
|
|
18
36
|
export interface NavigatorGenerationOptions {
|
|
19
37
|
/** Directory that receives the root navigator layout. Must be `src/app` or one of its safe descendants. */
|