@ankhorage/studio 0.0.20 → 0.1.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.
Files changed (211) hide show
  1. package/README.md +1 -2
  2. package/dist/cli/index.d.ts +4 -4
  3. package/dist/cli/index.d.ts.map +1 -1
  4. package/dist/cli/index.js +81 -56
  5. package/dist/cli/index.js.map +1 -1
  6. package/dist/core/constants.d.ts.map +1 -1
  7. package/dist/core/constants.js +17 -6
  8. package/dist/core/constants.js.map +1 -1
  9. package/dist/hooks/useProjects.js +1 -1
  10. package/dist/hooks/useProjects.js.map +1 -1
  11. package/dist/host/createStudioHost.d.ts +13 -0
  12. package/dist/host/createStudioHost.d.ts.map +1 -0
  13. package/dist/host/createStudioHost.js +16 -0
  14. package/dist/host/createStudioHost.js.map +1 -0
  15. package/dist/host/http/security.d.ts +2 -0
  16. package/dist/host/http/security.d.ts.map +1 -0
  17. package/dist/host/http/security.js +55 -0
  18. package/dist/host/http/security.js.map +1 -0
  19. package/dist/host/http/server.d.ts +16 -0
  20. package/dist/host/http/server.d.ts.map +1 -0
  21. package/dist/host/http/server.js +549 -0
  22. package/dist/host/http/server.js.map +1 -0
  23. package/dist/host/layout/auth/resolveAuthLayoutPlan.d.ts +38 -0
  24. package/dist/host/layout/auth/resolveAuthLayoutPlan.d.ts.map +1 -0
  25. package/dist/host/layout/auth/resolveAuthLayoutPlan.js +262 -0
  26. package/dist/host/layout/auth/resolveAuthLayoutPlan.js.map +1 -0
  27. package/dist/host/layout/layoutGenerator.d.ts +19 -0
  28. package/dist/host/layout/layoutGenerator.d.ts.map +1 -0
  29. package/dist/host/layout/layoutGenerator.js +418 -0
  30. package/dist/host/layout/layoutGenerator.js.map +1 -0
  31. package/dist/host/layout/templates/auth/adapter.d.ts +6 -0
  32. package/dist/host/layout/templates/auth/adapter.d.ts.map +1 -0
  33. package/dist/host/layout/templates/auth/adapter.js +94 -0
  34. package/dist/host/layout/templates/auth/adapter.js.map +1 -0
  35. package/dist/host/layout/templates/auth/screen.d.ts +12 -0
  36. package/dist/host/layout/templates/auth/screen.d.ts.map +1 -0
  37. package/dist/host/layout/templates/auth/screen.js +648 -0
  38. package/dist/host/layout/templates/auth/screen.js.map +1 -0
  39. package/dist/host/layout/templates/auth/session.d.ts +2 -0
  40. package/dist/host/layout/templates/auth/session.d.ts.map +1 -0
  41. package/dist/host/layout/templates/auth/session.js +326 -0
  42. package/dist/host/layout/templates/auth/session.js.map +1 -0
  43. package/dist/host/layout/templates/auth/signOut.d.ts +2 -0
  44. package/dist/host/layout/templates/auth/signOut.d.ts.map +1 -0
  45. package/dist/host/layout/templates/auth/signOut.js +43 -0
  46. package/dist/host/layout/templates/auth/signOut.js.map +1 -0
  47. package/dist/host/layout/templates/index.d.ts +11 -0
  48. package/dist/host/layout/templates/index.d.ts.map +1 -0
  49. package/dist/host/layout/templates/index.js +10 -0
  50. package/dist/host/layout/templates/index.js.map +1 -0
  51. package/dist/host/layout/templates/navigation.d.ts +16 -0
  52. package/dist/host/layout/templates/navigation.d.ts.map +1 -0
  53. package/dist/host/layout/templates/navigation.js +332 -0
  54. package/dist/host/layout/templates/navigation.js.map +1 -0
  55. package/dist/host/layout/templates/nestedLayout.d.ts +7 -0
  56. package/dist/host/layout/templates/nestedLayout.d.ts.map +1 -0
  57. package/dist/host/layout/templates/nestedLayout.js +56 -0
  58. package/dist/host/layout/templates/nestedLayout.js.map +1 -0
  59. package/dist/host/layout/templates/redirect.d.ts +2 -0
  60. package/dist/host/layout/templates/redirect.d.ts.map +1 -0
  61. package/dist/host/layout/templates/redirect.js +10 -0
  62. package/dist/host/layout/templates/redirect.js.map +1 -0
  63. package/dist/host/layout/templates/rootLayout.d.ts +28 -0
  64. package/dist/host/layout/templates/rootLayout.d.ts.map +1 -0
  65. package/dist/host/layout/templates/rootLayout.js +507 -0
  66. package/dist/host/layout/templates/rootLayout.js.map +1 -0
  67. package/dist/host/layout/templates/screen.d.ts +6 -0
  68. package/dist/host/layout/templates/screen.d.ts.map +1 -0
  69. package/dist/host/layout/templates/screen.js +94 -0
  70. package/dist/host/layout/templates/screen.js.map +1 -0
  71. package/dist/host/layout/templates/utils/routes.d.ts +3 -0
  72. package/dist/host/layout/templates/utils/routes.d.ts.map +1 -0
  73. package/dist/host/layout/templates/utils/routes.js +15 -0
  74. package/dist/host/layout/templates/utils/routes.js.map +1 -0
  75. package/dist/host/layout/templates/utils/strings.d.ts +3 -0
  76. package/dist/host/layout/templates/utils/strings.d.ts.map +1 -0
  77. package/dist/host/layout/templates/utils/strings.js +7 -0
  78. package/dist/host/layout/templates/utils/strings.js.map +1 -0
  79. package/dist/host/layout/utils/escapeStringLiteral.d.ts +2 -0
  80. package/dist/host/layout/utils/escapeStringLiteral.d.ts.map +1 -0
  81. package/dist/host/layout/utils/escapeStringLiteral.js +8 -0
  82. package/dist/host/layout/utils/escapeStringLiteral.js.map +1 -0
  83. package/dist/host/manifestSystem/auth/index.d.ts +2 -0
  84. package/dist/host/manifestSystem/auth/index.d.ts.map +1 -0
  85. package/dist/host/manifestSystem/auth/index.js +2 -0
  86. package/dist/host/manifestSystem/auth/index.js.map +1 -0
  87. package/dist/host/manifestSystem/auth/shared/global.auth.system.tpl.d.ts +4 -0
  88. package/dist/host/manifestSystem/auth/shared/global.auth.system.tpl.d.ts.map +1 -0
  89. package/dist/host/manifestSystem/auth/shared/global.auth.system.tpl.js +7 -0
  90. package/dist/host/manifestSystem/auth/shared/global.auth.system.tpl.js.map +1 -0
  91. package/dist/host/manifestSystem/auth/shared/index.d.ts +3 -0
  92. package/dist/host/manifestSystem/auth/shared/index.d.ts.map +1 -0
  93. package/dist/host/manifestSystem/auth/shared/index.js +8 -0
  94. package/dist/host/manifestSystem/auth/shared/index.js.map +1 -0
  95. package/dist/host/manifestSystem/index.d.ts +5 -0
  96. package/dist/host/manifestSystem/index.d.ts.map +1 -0
  97. package/dist/host/manifestSystem/index.js +23 -0
  98. package/dist/host/manifestSystem/index.js.map +1 -0
  99. package/dist/host/manifestSystem/types.d.ts +8 -0
  100. package/dist/host/manifestSystem/types.d.ts.map +1 -0
  101. package/dist/host/manifestSystem/types.js +2 -0
  102. package/dist/host/manifestSystem/types.js.map +1 -0
  103. package/dist/host/modules/catalog.d.ts +40 -0
  104. package/dist/host/modules/catalog.d.ts.map +1 -0
  105. package/dist/host/modules/catalog.js +112 -0
  106. package/dist/host/modules/catalog.js.map +1 -0
  107. package/dist/host/modules/layout.d.ts +7 -0
  108. package/dist/host/modules/layout.d.ts.map +1 -0
  109. package/dist/host/modules/layout.js +2 -0
  110. package/dist/host/modules/layout.js.map +1 -0
  111. package/dist/host/modules/runtime/LocalFsTargetAdapter.d.ts +34 -0
  112. package/dist/host/modules/runtime/LocalFsTargetAdapter.d.ts.map +1 -0
  113. package/dist/host/modules/runtime/LocalFsTargetAdapter.js +85 -0
  114. package/dist/host/modules/runtime/LocalFsTargetAdapter.js.map +1 -0
  115. package/dist/host/orchestrator/generatedAppFiles.d.ts +8 -0
  116. package/dist/host/orchestrator/generatedAppFiles.d.ts.map +1 -0
  117. package/dist/host/orchestrator/generatedAppFiles.js +125 -0
  118. package/dist/host/orchestrator/generatedAppFiles.js.map +1 -0
  119. package/dist/host/orchestrator/generatedRouteCleanup.d.ts +5 -0
  120. package/dist/host/orchestrator/generatedRouteCleanup.d.ts.map +1 -0
  121. package/dist/host/orchestrator/generatedRouteCleanup.js +117 -0
  122. package/dist/host/orchestrator/generatedRouteCleanup.js.map +1 -0
  123. package/dist/host/orchestrator/infraGenerator.d.ts +35 -0
  124. package/dist/host/orchestrator/infraGenerator.d.ts.map +1 -0
  125. package/dist/host/orchestrator/infraGenerator.js +135 -0
  126. package/dist/host/orchestrator/infraGenerator.js.map +1 -0
  127. package/dist/host/orchestrator/infraRuntime.d.ts +38 -0
  128. package/dist/host/orchestrator/infraRuntime.d.ts.map +1 -0
  129. package/dist/host/orchestrator/infraRuntime.js +227 -0
  130. package/dist/host/orchestrator/infraRuntime.js.map +1 -0
  131. package/dist/host/orchestrator/infraValidation.d.ts +3 -0
  132. package/dist/host/orchestrator/infraValidation.d.ts.map +1 -0
  133. package/dist/host/orchestrator/infraValidation.js +59 -0
  134. package/dist/host/orchestrator/infraValidation.js.map +1 -0
  135. package/dist/host/orchestrator/moduleManager.d.ts +86 -0
  136. package/dist/host/orchestrator/moduleManager.d.ts.map +1 -0
  137. package/dist/host/orchestrator/moduleManager.js +312 -0
  138. package/dist/host/orchestrator/moduleManager.js.map +1 -0
  139. package/dist/host/orchestrator/projectDeletion.d.ts +27 -0
  140. package/dist/host/orchestrator/projectDeletion.d.ts.map +1 -0
  141. package/dist/host/orchestrator/projectDeletion.js +242 -0
  142. package/dist/host/orchestrator/projectDeletion.js.map +1 -0
  143. package/dist/host/orchestrator/projectManager.d.ts +87 -0
  144. package/dist/host/orchestrator/projectManager.d.ts.map +1 -0
  145. package/dist/host/orchestrator/projectManager.js +371 -0
  146. package/dist/host/orchestrator/projectManager.js.map +1 -0
  147. package/dist/host/orchestrator/projectPaths.d.ts +4 -0
  148. package/dist/host/orchestrator/projectPaths.d.ts.map +1 -0
  149. package/dist/host/orchestrator/projectPaths.js +25 -0
  150. package/dist/host/orchestrator/projectPaths.js.map +1 -0
  151. package/dist/host/orchestrator/projectStore.d.ts +24 -0
  152. package/dist/host/orchestrator/projectStore.d.ts.map +1 -0
  153. package/dist/host/orchestrator/projectStore.js +155 -0
  154. package/dist/host/orchestrator/projectStore.js.map +1 -0
  155. package/dist/host/orchestrator/resolveMutations.d.ts +3 -0
  156. package/dist/host/orchestrator/resolveMutations.d.ts.map +1 -0
  157. package/dist/host/orchestrator/resolveMutations.js +12 -0
  158. package/dist/host/orchestrator/resolveMutations.js.map +1 -0
  159. package/dist/host/orchestrator/scaffolder.d.ts +33 -0
  160. package/dist/host/orchestrator/scaffolder.d.ts.map +1 -0
  161. package/dist/host/orchestrator/scaffolder.js +246 -0
  162. package/dist/host/orchestrator/scaffolder.js.map +1 -0
  163. package/dist/host/orchestrator/templates.d.ts +83 -0
  164. package/dist/host/orchestrator/templates.d.ts.map +1 -0
  165. package/dist/host/orchestrator/templates.js +355 -0
  166. package/dist/host/orchestrator/templates.js.map +1 -0
  167. package/dist/host/orchestrator/workspaceRuntime.d.ts +2 -0
  168. package/dist/host/orchestrator/workspaceRuntime.d.ts.map +1 -0
  169. package/dist/host/orchestrator/workspaceRuntime.js +82 -0
  170. package/dist/host/orchestrator/workspaceRuntime.js.map +1 -0
  171. package/dist/host/templateRegistry/index.d.ts +16 -0
  172. package/dist/host/templateRegistry/index.d.ts.map +1 -0
  173. package/dist/host/templateRegistry/index.js +74 -0
  174. package/dist/host/templateRegistry/index.js.map +1 -0
  175. package/dist/host/utils/requirementsInference.d.ts +4 -0
  176. package/dist/host/utils/requirementsInference.d.ts.map +1 -0
  177. package/dist/host/utils/requirementsInference.js +49 -0
  178. package/dist/host/utils/requirementsInference.js.map +1 -0
  179. package/dist/host/utils/trimOutput.d.ts +7 -0
  180. package/dist/host/utils/trimOutput.d.ts.map +1 -0
  181. package/dist/host/utils/trimOutput.js +32 -0
  182. package/dist/host/utils/trimOutput.js.map +1 -0
  183. package/dist/host/utils/workspaceRoot.d.ts +2 -0
  184. package/dist/host/utils/workspaceRoot.d.ts.map +1 -0
  185. package/dist/host/utils/workspaceRoot.js +33 -0
  186. package/dist/host/utils/workspaceRoot.js.map +1 -0
  187. package/dist/host/zoraExtensions/index.d.ts +11 -0
  188. package/dist/host/zoraExtensions/index.d.ts.map +1 -0
  189. package/dist/host/zoraExtensions/index.js +54 -0
  190. package/dist/host/zoraExtensions/index.js.map +1 -0
  191. package/dist/runtime/appExtensionRegistry.d.ts +3 -0
  192. package/dist/runtime/appExtensionRegistry.d.ts.map +1 -0
  193. package/dist/runtime/appExtensionRegistry.js +8 -0
  194. package/dist/runtime/appExtensionRegistry.js.map +1 -0
  195. package/dist/runtime/index.d.ts +8 -4
  196. package/dist/runtime/index.d.ts.map +1 -1
  197. package/dist/runtime/index.js +8 -4
  198. package/dist/runtime/index.js.map +1 -1
  199. package/dist/runtime/registry.d.ts +7 -0
  200. package/dist/runtime/registry.d.ts.map +1 -0
  201. package/dist/runtime/registry.js +7 -0
  202. package/dist/runtime/registry.js.map +1 -0
  203. package/dist/runtime/runtimeActions.d.ts +19 -0
  204. package/dist/runtime/runtimeActions.d.ts.map +1 -0
  205. package/dist/runtime/runtimeActions.js +5 -0
  206. package/dist/runtime/runtimeActions.js.map +1 -0
  207. package/dist/runtime/useRuntimeAction.d.ts +10 -0
  208. package/dist/runtime/useRuntimeAction.d.ts.map +1 -0
  209. package/dist/runtime/useRuntimeAction.js +30 -0
  210. package/dist/runtime/useRuntimeAction.js.map +1 -0
  211. package/package.json +35 -3
@@ -0,0 +1,332 @@
1
+ import { escapeStringLiteral } from '../utils/escapeStringLiteral';
2
+ function getNavigatorHeaderShownTsx(includeStudio) {
3
+ return includeStudio ? '__DEV__ ? false : true' : 'true';
4
+ }
5
+ function getTabsOptionsTsx(includeStudio) {
6
+ return `{
7
+ headerShown: ${getNavigatorHeaderShownTsx(includeStudio)},
8
+ tabBarActiveTintColor: theme.colors.primary,
9
+ tabBarInactiveTintColor: theme.colors.textSecondary,
10
+ tabBarStyle: {
11
+ backgroundColor: theme.colors.surface,
12
+ borderTopColor: theme.colors.border,
13
+ },
14
+ }`;
15
+ }
16
+ function getDrawerOptionsTsx(includeStudio) {
17
+ return `{
18
+ headerShown: ${getNavigatorHeaderShownTsx(includeStudio)},
19
+ drawerActiveTintColor: theme.colors.primary,
20
+ drawerInactiveTintColor: theme.colors.textSecondary,
21
+ drawerStyle: {
22
+ backgroundColor: theme.colors.background,
23
+ },
24
+ headerStyle: {
25
+ backgroundColor: theme.colors.surface,
26
+ },
27
+ headerTintColor: theme.colors.text,
28
+ }`;
29
+ }
30
+ function getStackOptionsTsx(includeStudio) {
31
+ return `{
32
+ headerShown: ${getNavigatorHeaderShownTsx(includeStudio)},
33
+ }`;
34
+ }
35
+ export function buildNavigatorJsx(args) {
36
+ const { navigator, manifest, includeStudio } = args;
37
+ if (navigator.type === 'tabs') {
38
+ return buildTabsNavigatorJsx({ navigator, manifest, includeStudio });
39
+ }
40
+ if (navigator.type === 'drawer') {
41
+ return buildDrawerNavigatorJsx({ navigator, manifest, includeStudio });
42
+ }
43
+ return buildStackNavigatorJsx({ navigator, manifest, includeStudio });
44
+ }
45
+ function buildTabsNavigatorJsx(args) {
46
+ const { navigator, manifest, includeStudio } = args;
47
+ const hasHiddenRoutes = navigator.routes.some((route) => route.hideInTabBar === true);
48
+ const headerShown = getNavigatorHeaderShownTsx(includeStudio);
49
+ if (!hasHiddenRoutes) {
50
+ const routeMapDeclaration = buildRouteMapDeclaration({ routes: navigator.routes, manifest });
51
+ const screenTemplates = navigator.routes.map((route, index) => buildTabsScreenJsx(route, manifest, index));
52
+ const declarations = [
53
+ routeMapDeclaration,
54
+ `const tabsNavigatorScreenOptions = {
55
+ headerShown: ${headerShown},
56
+ };`,
57
+ `function renderZoraTabBar(props: BottomTabBarProps) {
58
+ return <ZoraTabBar {...(props as Parameters<typeof ZoraTabBar>[0])} routeMap={routeMap} />;
59
+ }`,
60
+ ...screenTemplates.map((screen) => screen.declaration),
61
+ ]
62
+ .filter(Boolean)
63
+ .join('\n');
64
+ const screens = screenTemplates.map((screen) => screen.jsx).join('\n');
65
+ return {
66
+ declarations,
67
+ jsx: `<Tabs tabBar={renderZoraTabBar} screenOptions={tabsNavigatorScreenOptions}>
68
+ ${screens}
69
+ </Tabs>`,
70
+ usesTheme: false,
71
+ usesIcon: false,
72
+ usesZoraTabBar: true,
73
+ usesZoraDrawerContent: false,
74
+ usesZoraNavigationRouteMap: true,
75
+ };
76
+ }
77
+ const screenTemplates = navigator.routes.map((route, index) => buildTabsScreenFallbackJsx(route, manifest, index));
78
+ const declarations = screenTemplates
79
+ .map((screen) => screen.declaration)
80
+ .filter(Boolean)
81
+ .join('\n');
82
+ const screens = screenTemplates.map((screen) => screen.jsx).join('\n');
83
+ const usesIcon = navigator.routes.some((route) => Boolean(route.icon));
84
+ return {
85
+ declarations: [
86
+ `const tabsNavigatorScreenOptions = ${getTabsOptionsTsx(includeStudio)};`,
87
+ declarations,
88
+ ]
89
+ .filter(Boolean)
90
+ .join('\n'),
91
+ jsx: `<Tabs screenOptions={tabsNavigatorScreenOptions}>
92
+ ${screens}
93
+ </Tabs>`,
94
+ usesTheme: true,
95
+ usesIcon,
96
+ usesZoraTabBar: false,
97
+ usesZoraDrawerContent: false,
98
+ usesZoraNavigationRouteMap: false,
99
+ };
100
+ }
101
+ function buildDrawerNavigatorJsx(args) {
102
+ const { navigator, manifest, includeStudio } = args;
103
+ const hasHiddenRoutes = navigator.routes.some((route) => route.hideInTabBar === true);
104
+ const headerShown = getNavigatorHeaderShownTsx(includeStudio);
105
+ if (!hasHiddenRoutes) {
106
+ const routeMapDeclaration = buildRouteMapDeclaration({ routes: navigator.routes, manifest });
107
+ const screenTemplates = navigator.routes.map((route, index) => buildDrawerScreenJsx(route, manifest, index));
108
+ const declarations = [
109
+ routeMapDeclaration,
110
+ `const drawerNavigatorScreenOptions = {
111
+ headerShown: ${headerShown},
112
+ };`,
113
+ `function renderZoraDrawerContent(props: DrawerContentComponentProps) {
114
+ return <ZoraDrawerContent {...(props as Parameters<typeof ZoraDrawerContent>[0])} routeMap={routeMap} />;
115
+ }`,
116
+ ...screenTemplates.map((screen) => screen.declaration),
117
+ ]
118
+ .filter(Boolean)
119
+ .join('\n');
120
+ const screens = screenTemplates.map((screen) => screen.jsx).join('\n');
121
+ return {
122
+ declarations,
123
+ jsx: `<Drawer drawerContent={renderZoraDrawerContent} screenOptions={drawerNavigatorScreenOptions}>
124
+ ${screens}
125
+ </Drawer>`,
126
+ usesTheme: false,
127
+ usesIcon: false,
128
+ usesZoraTabBar: false,
129
+ usesZoraDrawerContent: true,
130
+ usesZoraNavigationRouteMap: true,
131
+ };
132
+ }
133
+ const screenTemplates = navigator.routes.map((route, index) => buildDrawerScreenFallbackJsx(route, manifest, index));
134
+ const declarations = screenTemplates
135
+ .map((screen) => screen.declaration)
136
+ .filter(Boolean)
137
+ .join('\n');
138
+ const screens = screenTemplates.map((screen) => screen.jsx).join('\n');
139
+ const usesIcon = navigator.routes.some((route) => Boolean(route.icon));
140
+ return {
141
+ declarations: [
142
+ `const drawerNavigatorScreenOptions = ${getDrawerOptionsTsx(includeStudio)};`,
143
+ declarations,
144
+ ]
145
+ .filter(Boolean)
146
+ .join('\n'),
147
+ jsx: `<Drawer screenOptions={drawerNavigatorScreenOptions}>
148
+ ${screens}
149
+ </Drawer>`,
150
+ usesTheme: true,
151
+ usesIcon,
152
+ usesZoraTabBar: false,
153
+ usesZoraDrawerContent: false,
154
+ usesZoraNavigationRouteMap: false,
155
+ };
156
+ }
157
+ function buildStackNavigatorJsx(args) {
158
+ const { navigator, manifest, includeStudio } = args;
159
+ const screenTemplates = navigator.routes.map((route, index) => buildStackScreenJsx(route, manifest, index));
160
+ const declarations = screenTemplates
161
+ .map((screen) => screen.declaration)
162
+ .filter(Boolean)
163
+ .join('\n');
164
+ const screens = screenTemplates.map((screen) => screen.jsx).join('\n');
165
+ return {
166
+ declarations: [
167
+ `const stackNavigatorScreenOptions = ${getStackOptionsTsx(includeStudio)};`,
168
+ declarations,
169
+ ]
170
+ .filter(Boolean)
171
+ .join('\n'),
172
+ jsx: `<Stack screenOptions={stackNavigatorScreenOptions}>
173
+ ${screens}
174
+ </Stack>`,
175
+ usesTheme: false,
176
+ usesIcon: false,
177
+ usesZoraTabBar: false,
178
+ usesZoraDrawerContent: false,
179
+ usesZoraNavigationRouteMap: false,
180
+ };
181
+ }
182
+ function buildTabsScreenJsx(route, manifest, index) {
183
+ const label = resolveRouteLabel(route, manifest);
184
+ const optionsConstName = buildScreenOptionsConstName(route, index);
185
+ const headerVisibilityLine = route.navigator ? `\n headerShown: false,` : '';
186
+ return {
187
+ declaration: `const ${optionsConstName} = {
188
+ title: '${label}',
189
+ tabBarLabel: '${label}',${headerVisibilityLine}
190
+ };`,
191
+ jsx: ` <Tabs.Screen key="${route.name}" name="${route.name}" options={${optionsConstName}} />`,
192
+ };
193
+ }
194
+ function buildTabsScreenFallbackJsx(route, manifest, index) {
195
+ const label = resolveRouteLabel(route, manifest);
196
+ const hideHrefOption = route.hideInTabBar ? 'href: null,' : '';
197
+ const hideTabBarOption = route.hideInTabBar ? "tabBarStyle: { display: 'none' }," : '';
198
+ const optionsConstName = buildScreenOptionsConstName(route, index);
199
+ const iconFunctionName = buildScreenIconFunctionName(route, index);
200
+ const optionLines = [
201
+ `title: '${label}',`,
202
+ `tabBarLabel: '${label}',`,
203
+ route.icon ? `tabBarIcon: ${iconFunctionName},` : '',
204
+ hideHrefOption,
205
+ hideTabBarOption,
206
+ ]
207
+ .filter(Boolean)
208
+ .map((line) => ` ${line}`)
209
+ .join('\n');
210
+ return {
211
+ declaration: [
212
+ route.icon
213
+ ? `function ${iconFunctionName}({ color, size }: { color: string; size: number }) {
214
+ return (
215
+ <Icon name="${escapeStringLiteral(route.icon.name)}"${route.icon.provider ? ` provider="${escapeStringLiteral(route.icon.provider)}"` : ''} color={color} size={size} />
216
+ );
217
+ }`
218
+ : '',
219
+ `const ${optionsConstName} = {\n${optionLines}\n};`,
220
+ ]
221
+ .filter(Boolean)
222
+ .join('\n'),
223
+ jsx: ` <Tabs.Screen key="${route.name}" name="${route.name}" options={${optionsConstName}} />`,
224
+ };
225
+ }
226
+ function buildDrawerScreenJsx(route, manifest, index) {
227
+ const label = resolveRouteLabel(route, manifest);
228
+ const optionsConstName = buildScreenOptionsConstName(route, index);
229
+ const headerVisibilityLine = route.navigator ? `\n headerShown: false,` : '';
230
+ return {
231
+ declaration: `const ${optionsConstName} = {
232
+ title: '${label}',
233
+ drawerLabel: '${label}',${headerVisibilityLine}
234
+ };`,
235
+ jsx: ` <Drawer.Screen key="${route.name}" name="${route.name}" options={${optionsConstName}} />`,
236
+ };
237
+ }
238
+ function buildDrawerScreenFallbackJsx(route, manifest, index) {
239
+ const label = resolveRouteLabel(route, manifest);
240
+ const hideDrawerOption = route.hideInTabBar ? "drawerItemStyle: { display: 'none' }," : '';
241
+ const disableHiddenRouteOption = route.hideInTabBar
242
+ ? 'swipeEnabled: false, headerShown: false,'
243
+ : '';
244
+ const optionsConstName = buildScreenOptionsConstName(route, index);
245
+ const iconFunctionName = buildScreenIconFunctionName(route, index);
246
+ const optionLines = [
247
+ `title: '${label}',`,
248
+ `drawerLabel: '${label}',`,
249
+ route.icon ? `drawerIcon: ${iconFunctionName},` : '',
250
+ hideDrawerOption,
251
+ disableHiddenRouteOption,
252
+ ]
253
+ .filter(Boolean)
254
+ .map((line) => ` ${line}`)
255
+ .join('\n');
256
+ return {
257
+ declaration: [
258
+ route.icon
259
+ ? `function ${iconFunctionName}({ color, size }: { color: string; size: number }) {
260
+ return (
261
+ <Icon name="${escapeStringLiteral(route.icon.name)}"${route.icon.provider ? ` provider="${escapeStringLiteral(route.icon.provider)}"` : ''} color={color} size={size} />
262
+ );
263
+ }`
264
+ : '',
265
+ `const ${optionsConstName} = {\n${optionLines}\n};`,
266
+ ]
267
+ .filter(Boolean)
268
+ .join('\n'),
269
+ jsx: ` <Drawer.Screen key="${route.name}" name="${route.name}" options={${optionsConstName}} />`,
270
+ };
271
+ }
272
+ function buildStackScreenJsx(route, manifest, index) {
273
+ const label = resolveRouteLabel(route, manifest);
274
+ const options = [];
275
+ if (route.name === 'index') {
276
+ options.push(`headerTitle: '${label}'`);
277
+ }
278
+ if (route.navigator) {
279
+ options.push('headerShown: false');
280
+ }
281
+ if (options.length === 0) {
282
+ return {
283
+ declaration: '',
284
+ jsx: ` <Stack.Screen key="${route.name}" name="${route.name}" />`,
285
+ };
286
+ }
287
+ const optionsConstName = buildScreenOptionsConstName(route, index);
288
+ return {
289
+ declaration: `const ${optionsConstName} = { ${options.join(', ')} };`,
290
+ jsx: ` <Stack.Screen key="${route.name}" name="${route.name}" options={${optionsConstName}} />`,
291
+ };
292
+ }
293
+ function resolveRouteLabel(route, manifest) {
294
+ const screen = route.screenId ? manifest.screens[route.screenId] : undefined;
295
+ return escapeStringLiteral(route.label ?? screen?.title ?? screen?.name ?? route.name);
296
+ }
297
+ function buildRouteMapDeclaration(args) {
298
+ const { routes, manifest } = args;
299
+ const entries = routes
300
+ .map((route) => {
301
+ const label = resolveRouteLabel(route, manifest);
302
+ const key = escapeStringLiteral(route.name);
303
+ const routeKey = /^[A-Za-z_$][A-Za-z0-9_$]*$/u.test(key) ? key : `'${key}'`;
304
+ const iconSpec = route.icon ? buildRouteIconLiteral(route.icon) : '';
305
+ const iconLine = iconSpec.length > 0 ? `\n icon: ${iconSpec},` : '';
306
+ return ` ${routeKey}: {\n label: '${label}',${iconLine}\n }`;
307
+ })
308
+ .join(',\n');
309
+ return `const routeMap: ZoraNavigationRouteMap = {\n${entries},\n};\n`;
310
+ }
311
+ function buildRouteIconLiteral(icon) {
312
+ const provider = icon.provider ? `, provider: '${escapeStringLiteral(icon.provider)}'` : '';
313
+ const size = icon.size === undefined
314
+ ? ''
315
+ : `, size: ${typeof icon.size === 'number' ? icon.size : `'${escapeStringLiteral(String(icon.size))}'`}`;
316
+ const color = icon.color ? `, color: '${escapeStringLiteral(icon.color)}'` : '';
317
+ return `{ name: '${escapeStringLiteral(icon.name)}'${provider}${size}${color} }`;
318
+ }
319
+ function buildScreenOptionsConstName(route, index) {
320
+ const normalizedName = route.name.replace(/[^a-zA-Z0-9]+/g, ' ').trim();
321
+ const parts = normalizedName.length > 0 ? normalizedName.split(/\s+/) : [];
322
+ const [firstPart = 'route', ...remainingParts] = parts;
323
+ const camelName = [
324
+ firstPart.toLowerCase(),
325
+ ...remainingParts.map((part) => part.charAt(0).toUpperCase() + part.slice(1).toLowerCase()),
326
+ ].join('');
327
+ return `route${index}${camelName.charAt(0).toUpperCase() + camelName.slice(1)}ScreenOptions`;
328
+ }
329
+ function buildScreenIconFunctionName(route, index) {
330
+ return buildScreenOptionsConstName(route, index).replace(/ScreenOptions$/, 'Icon');
331
+ }
332
+ //# sourceMappingURL=navigation.js.map
@@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2B,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AACrF,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { NavigatorSpec } from '@ankhorage/contracts';
2
+ import type { BuiltNavigatorJsx } from './navigation';
3
+ export declare function getNestedLayoutTsx(args: {
4
+ node: NavigatorSpec;
5
+ navigator: BuiltNavigatorJsx;
6
+ }): string;
7
+ //# sourceMappingURL=nestedLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nestedLayout.d.ts","sourceRoot":"","sources":["../../../../src/host/layout/templates/nestedLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGtD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,SAAS,EAAE,iBAAiB,CAAA;CAAE,UAgD7F"}
@@ -0,0 +1,56 @@
1
+ import { joinNonEmptyLines } from './utils/strings';
2
+ export function getNestedLayoutTsx(args) {
3
+ const { node, navigator } = args;
4
+ const themeHook = navigator.usesTheme ? ' const { theme } = useZoraTheme();\n' : '';
5
+ const imports = joinNonEmptyLines([
6
+ navigator.usesZoraNavigationRouteMap
7
+ ? `import type { ZoraNavigationRouteMap } from '@ankhorage/zora';`
8
+ : '',
9
+ navigator.usesTheme ||
10
+ navigator.usesIcon ||
11
+ navigator.usesZoraTabBar ||
12
+ navigator.usesZoraDrawerContent
13
+ ? `import { ${[
14
+ navigator.usesIcon ? 'Icon' : '',
15
+ navigator.usesTheme ? 'useZoraTheme' : '',
16
+ navigator.usesZoraTabBar ? 'ZoraTabBar' : '',
17
+ navigator.usesZoraDrawerContent ? 'ZoraDrawerContent' : '',
18
+ ]
19
+ .filter(Boolean)
20
+ .join(', ')} } from '@ankhorage/zora';`
21
+ : '',
22
+ navigator.usesZoraTabBar
23
+ ? `import type { BottomTabBarProps } from '@react-navigation/bottom-tabs';`
24
+ : '',
25
+ navigator.usesZoraDrawerContent
26
+ ? `import type { DrawerContentComponentProps } from '@react-navigation/drawer';`
27
+ : '',
28
+ node.type === 'drawer'
29
+ ? `import { Drawer } from 'expo-router/drawer';`
30
+ : node.type === 'tabs'
31
+ ? `import { Tabs } from 'expo-router';`
32
+ : `import { Stack } from 'expo-router';`,
33
+ ]);
34
+ return `${imports}
35
+
36
+ export const unstable_settings = {
37
+ initialRouteName: '${resolveGeneratedInitialRouteName(node)}',
38
+ };
39
+
40
+ ${navigator.declarations}
41
+
42
+ export default function Layout() {
43
+ ${themeHook} return (
44
+ ${navigator.jsx}
45
+ );
46
+ }
47
+ `;
48
+ }
49
+ function resolveGeneratedInitialRouteName(node) {
50
+ const routeNames = new Set(node.routes.map((route) => route.name));
51
+ if (node.initialRouteName && routeNames.has(node.initialRouteName)) {
52
+ return node.initialRouteName;
53
+ }
54
+ return node.routes[0]?.name ?? 'index';
55
+ }
56
+ //# sourceMappingURL=nestedLayout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nestedLayout.js","sourceRoot":"","sources":["../../../../src/host/layout/templates/nestedLayout.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,UAAU,kBAAkB,CAAC,IAA2D;IAC5F,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,IAAI,CAAC;IACjC,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,uCAAuC,CAAC,CAAC,CAAC,EAAE,CAAC;IAErF,MAAM,OAAO,GAAG,iBAAiB,CAAC;QAChC,SAAS,CAAC,0BAA0B;YAClC,CAAC,CAAC,gEAAgE;YAClE,CAAC,CAAC,EAAE;QACN,SAAS,CAAC,SAAS;YACnB,SAAS,CAAC,QAAQ;YAClB,SAAS,CAAC,cAAc;YACxB,SAA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AAC,gBAAgB,CAAC;IAC/B,CAAC;IAED,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,OAAO,CAAC;AACzC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function getIndexRedirectRouteTsx(href: string): string;
2
+ //# sourceMappingURL=redirect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redirect.d.ts","sourceRoot":"","sources":["../../../../src/host/layout/templates/redirect.ts"],"names":[],"mappings":"AAEA,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAO7D"}
@@ -0,0 +1,10 @@
1
+ import { escapeStringLiteral } from '../utils/escapeStringLiteral';
2
+ export function getIndexRedirectRouteTsx(href) {
3
+ return `import { Redirect } from 'expo-router';
4
+
5
+ export default function IndexRoute() {
6
+ return <Redirect href={'${escapeStringLiteral(href)}'} />;
7
+ }
8
+ `;
9
+ }
10
+ //# sourceMappingURL=redirect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redirect.js","sourceRoot":"","sources":["../../../../src/host/layout/templates/redirect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,MAAM,UAAU,wBAAwB,CAAC,IAAY;IACnD,OAAO;;;4BAGmB,mBAAmB,CAAC,IAAI,CAAC;;CAEpD,CAAC;AACF,CAAC"}
@@ -0,0 +1,28 @@
1
+ import type { AppManifest } from '@ankhorage/contracts';
2
+ import type { LayoutMutation } from '../../modules/layout';
3
+ import type { BuiltNavigatorJsx } from './navigation';
4
+ interface RootLayoutAuthRuntimeConfig {
5
+ signInRoute: string;
6
+ signInRouteName: string;
7
+ signUpRoute: string;
8
+ signUpRouteName: string;
9
+ postSignInRoute: string;
10
+ publicRoutes: string[];
11
+ }
12
+ interface GetRootLayoutTsxArgs {
13
+ manifest: AppManifest;
14
+ mutations: LayoutMutation[];
15
+ allImports: string;
16
+ allHooks: string;
17
+ innerNavigation: BuiltNavigatorJsx;
18
+ includeStudio: boolean;
19
+ authRuntime?: RootLayoutAuthRuntimeConfig;
20
+ initialRouteNameOverride?: string;
21
+ runtimeModuleDeclarations?: string;
22
+ runtimeProviderEnd?: string[];
23
+ runtimeProviderStart?: string[];
24
+ useStoredAuthSessionCredentialResolver?: boolean;
25
+ }
26
+ export declare function getRootLayoutTsx(args: GetRootLayoutTsxArgs): string;
27
+ export {};
28
+ //# sourceMappingURL=rootLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rootLayout.d.ts","sourceRoot":"","sources":["../../../../src/host/layout/templates/rootLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAGtD,UAAU,2BAA2B;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,WAAW,CAAC;IACtB,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,iBAAiB,CAAC;IACnC,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,2BAA2B,CAAC;IAC1C,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAC;IAChC,sCAAsC,CAAC,EAAE,OAAO,CAAC;CAClD;AAaD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,UAihB1D"}