@ankhorage/zora 25.8.13 → 25.8.15

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 (68) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/dist/features/button/utils/resolveButtonThemeRecipe.d.ts +1 -1
  4. package/dist/features/matrix-grid/adapters/inbound/MatrixGrid.d.ts.map +1 -1
  5. package/dist/features/matrix-grid/adapters/inbound/MatrixGrid.js +11 -8
  6. package/dist/features/matrix-grid/adapters/inbound/MatrixGrid.js.map +1 -1
  7. package/dist/features/matrix-grid/adapters/inbound/useMatrixGridKeyboardFocus.d.ts +1 -1
  8. package/dist/features/matrix-grid/adapters/inbound/useMatrixGridKeyboardFocus.d.ts.map +1 -1
  9. package/dist/features/matrix-grid/adapters/inbound/useMatrixGridKeyboardFocus.js +25 -5
  10. package/dist/features/matrix-grid/adapters/inbound/useMatrixGridKeyboardFocus.js.map +1 -1
  11. package/dist/features/matrix-grid/application/resolveMatrixGridSelection.d.ts +1 -1
  12. package/dist/features/matrix-grid/application/resolveMatrixGridSelection.d.ts.map +1 -1
  13. package/dist/features/matrix-grid/application/resolveMatrixGridSelection.js +5 -2
  14. package/dist/features/matrix-grid/application/resolveMatrixGridSelection.js.map +1 -1
  15. package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.d.ts +4 -0
  16. package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.d.ts.map +1 -0
  17. package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.js +187 -0
  18. package/dist/features/registry/ZORA_BASE_COMPONENT_REGISTRY.js.map +1 -0
  19. package/dist/features/registry/ZORA_COMPONENT_REGISTRY.d.ts +1 -0
  20. package/dist/features/registry/ZORA_COMPONENT_REGISTRY.d.ts.map +1 -1
  21. package/dist/features/registry/ZORA_COMPONENT_REGISTRY.js +4 -185
  22. package/dist/features/registry/ZORA_COMPONENT_REGISTRY.js.map +1 -1
  23. package/dist/features/registry/createZoraComponentRegistry.d.ts +4 -0
  24. package/dist/features/registry/createZoraComponentRegistry.d.ts.map +1 -0
  25. package/dist/features/registry/createZoraComponentRegistry.js +6 -0
  26. package/dist/features/registry/createZoraComponentRegistry.js.map +1 -0
  27. package/dist/features/registry/public.d.ts +2 -0
  28. package/dist/features/registry/public.d.ts.map +1 -1
  29. package/dist/features/registry/public.js +2 -0
  30. package/dist/features/registry/public.js.map +1 -1
  31. package/dist/features/registry/readerFreeRegistry.d.ts +3 -0
  32. package/dist/features/registry/readerFreeRegistry.d.ts.map +1 -0
  33. package/dist/features/registry/readerFreeRegistry.js +3 -0
  34. package/dist/features/registry/readerFreeRegistry.js.map +1 -0
  35. package/dist/index.d.ts +1 -126
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +1 -77
  38. package/dist/index.js.map +1 -1
  39. package/dist/readerFree.d.ts +129 -0
  40. package/dist/readerFree.d.ts.map +1 -0
  41. package/dist/readerFree.js +79 -0
  42. package/dist/readerFree.js.map +1 -0
  43. package/dist/types/matrix-grid.d.ts +2 -0
  44. package/dist/types/matrix-grid.d.ts.map +1 -1
  45. package/dist/types/matrix-grid.js.map +1 -1
  46. package/package.json +17 -2
  47. package/src/features/layout/public.test.ts +2 -1
  48. package/src/features/matrix-grid/adapters/inbound/MatrixGrid.protected-focus.test.tsx +252 -0
  49. package/src/features/matrix-grid/adapters/inbound/MatrixGrid.test.tsx +79 -0
  50. package/src/features/matrix-grid/adapters/inbound/MatrixGrid.tsx +16 -5
  51. package/src/features/matrix-grid/adapters/inbound/useMatrixGridKeyboardFocus.ts +31 -4
  52. package/src/features/matrix-grid/application/resolveMatrixGridSelection.test.ts +20 -13
  53. package/src/features/matrix-grid/application/resolveMatrixGridSelection.ts +3 -0
  54. package/src/features/progress/adapters/inbound/ProgressRing.test.ts +6 -4
  55. package/src/features/reader/adapters/inbound/Reader.test.ts +1 -1
  56. package/src/features/reader/utils/resolveReaderProgress.test.ts +1 -1
  57. package/src/features/registry/ZORA_BASE_COMPONENT_REGISTRY.ts +236 -0
  58. package/src/features/registry/ZORA_COMPONENT_REGISTRY.ts +4 -233
  59. package/src/features/registry/createZoraComponentRegistry.ts +9 -0
  60. package/src/features/registry/public.ts +2 -0
  61. package/src/features/registry/readerFreeRegistry.ts +2 -0
  62. package/src/features/registry/registry.test.ts +36 -5
  63. package/src/features/uploader/public.test.ts +3 -2
  64. package/src/index.ts +1 -533
  65. package/src/interactionPolicy.test.ts +1 -1
  66. package/src/readerFree.ts +538 -0
  67. package/src/types/matrix-grid.ts +2 -0
  68. package/web-dist/components/matrix-grid/MatrixGrid.js +41 -16
@@ -0,0 +1,236 @@
1
+ import type { InteractionPolicyProps } from '@ankhorage/surface';
2
+ import type React from 'react';
3
+
4
+ import type { ZoraComponentRegistry } from '../../types/registry';
5
+ import { Accordion, AccordionItem } from '../accordion/public';
6
+ import { ActivityIndicator } from '../activity-indicator/public';
7
+ import { AppBar } from '../app-bar/public';
8
+ import { AppHeader } from '../app-header/public';
9
+ import {
10
+ AuthScreen,
11
+ ForgotPasswordForm,
12
+ OAuthProviderButton,
13
+ OAuthProviderList,
14
+ OtpForm,
15
+ SignInForm,
16
+ SignUpForm,
17
+ } from '../auth/public';
18
+ import { Avatar, AvatarGroup } from '../avatar/public';
19
+ import { Badge } from '../badge/public';
20
+ import { BottomSheet } from '../bottom-sheet/public';
21
+ import { Breadcrumbs } from '../breadcrumbs/public';
22
+ import { Button, ButtonGroup, IconButton } from '../button/public';
23
+ import { Card, MediaCard, MetricCard, PostCard, ProductCard } from '../card/public';
24
+ import { ChatListItem, MessageBubble } from '../chat/public';
25
+ import { ChessBoard, OpeningBook } from '../chess/public';
26
+ import { Chip, ChipGroup } from '../chip/public';
27
+ import { CollectionEditor } from '../collection-editor/public';
28
+ import { ContentRail } from '../content-rail/public';
29
+ import { DataTable } from '../data-table/public';
30
+ import { DatePicker } from '../date-picker/public';
31
+ import { Dialog } from '../dialog/public';
32
+ import { EmptyState } from '../empty-state/public';
33
+ import { Explorer, FileExplorer, MediaExplorer } from '../explorer/public';
34
+ import { Checkbox, CheckboxGroup } from '../form/checkbox/public';
35
+ import { Field, Form, FormActions, FormError } from '../form/public';
36
+ import { Radio, RadioGroup } from '../form/radio/public';
37
+ import { SearchInput } from '../form/search-input/public';
38
+ import { Select } from '../form/select/public';
39
+ import { Switch } from '../form/switch/public';
40
+ import { TextInput } from '../form/text-input/public';
41
+ import {
42
+ Game,
43
+ GameEntity,
44
+ GameField,
45
+ GameInputZone,
46
+ GameMeasurementProbe,
47
+ GameOverlay,
48
+ } from '../game/public';
49
+ import { Gradient } from '../gradient/public';
50
+ import { GridInteractions } from '../grid-interactions/public';
51
+ import { GridLineOverlay, GridRuler } from '../grid-rulers/public';
52
+ import { GridView, TileGrid } from '../grid-view/public';
53
+ import { Hero } from '../hero/public';
54
+ import { Icon } from '../icon/public';
55
+ import { Image } from '../image/public';
56
+ import { KeyboardAvoidingView } from '../keyboard-avoiding-view/public';
57
+ import { AppShell, Divider, Grid, Screen, ScrollView, View } from '../layout/public';
58
+ import { FlatList, List, ListItem, ListSection, SectionList } from '../list/public';
59
+ import { MatrixGrid } from '../matrix-grid/public';
60
+ import { MissingElement } from '../missing-element/public';
61
+ import { Pagination } from '../pagination/public';
62
+ import { PaletteItem } from '../palette-item/public';
63
+ import { PopoverMenu } from '../popover-menu/public';
64
+ import { Progress, ProgressRing } from '../progress/public';
65
+ import { Rating } from '../rating/public';
66
+ import { BarcodeScannerView, CameraPermissionView, ScanOverlay } from '../scanner/public';
67
+ import { ScreenSection, SectionHeader } from '../section/public';
68
+ import { SelectableItem } from '../selection/public';
69
+ import { Skeleton, SkeletonCard, SkeletonList, SkeletonText } from '../skeleton/public';
70
+ import { SpatialGrid } from '../spatial-grid/public';
71
+ import { Surface } from '../surface/public';
72
+ import {
73
+ CardBack,
74
+ CardHand,
75
+ PlayingCard,
76
+ PokerTrainingTable,
77
+ TabletopTable,
78
+ } from '../tabletop/public';
79
+ import { Tab, TabList, TabPanel, Tabs } from '../tabs/public';
80
+ import { ThemeModeToggle } from '../theme/adapters/inbound/ThemeModeToggle';
81
+ import { TimeGrid } from '../time-grid/public';
82
+ import { TimePicker } from '../time-picker/public';
83
+ import { Timeline } from '../timeline/public';
84
+ import { Toast } from '../toast/public';
85
+ import { Toolbar } from '../toolbar/public';
86
+ import { TreeItem, TreeView } from '../tree-view/public';
87
+ import { Heading, Text } from '../typography/public';
88
+ import { Uploader } from '../uploader/public';
89
+
90
+ type ComponentPropsFor<K extends keyof typeof _ZORA_BASE_COMPONENT_REGISTRY> = React.ComponentProps<
91
+ (typeof _ZORA_BASE_COMPONENT_REGISTRY)[K]
92
+ >;
93
+
94
+ type AcceptsSurfaceInteractionPolicyProps<P> = 'interactionPolicy' extends keyof P
95
+ ? InteractionPolicyProps extends Pick<P, 'interactionPolicy'>
96
+ ? Pick<P, 'interactionPolicy'> extends InteractionPolicyProps
97
+ ? true
98
+ : false
99
+ : false
100
+ : false;
101
+
102
+ type RegistryInteractionPolicyContract = {
103
+ [K in keyof typeof _ZORA_BASE_COMPONENT_REGISTRY]: AcceptsSurfaceInteractionPolicyProps<
104
+ ComponentPropsFor<K>
105
+ >;
106
+ };
107
+
108
+ type _AssertTrue<T extends true> = T;
109
+ type _RegistryInteractionPolicyCheck = _AssertTrue<
110
+ RegistryInteractionPolicyContract[keyof typeof _ZORA_BASE_COMPONENT_REGISTRY]
111
+ >;
112
+
113
+ const _ZORA_BASE_COMPONENT_REGISTRY = {
114
+ Accordion,
115
+ AccordionItem,
116
+ ActivityIndicator,
117
+ AppBar,
118
+ AppHeader,
119
+ Avatar,
120
+ AvatarGroup,
121
+ Badge,
122
+ Breadcrumbs,
123
+ Button,
124
+ ButtonGroup,
125
+ Card,
126
+ Checkbox,
127
+ CheckboxGroup,
128
+ Chip,
129
+ ChipGroup,
130
+ DataTable,
131
+ DatePicker,
132
+ Dialog,
133
+ Form,
134
+ FormActions,
135
+ FormError,
136
+ Field,
137
+ Gradient,
138
+ Game,
139
+ GameEntity,
140
+ GameField,
141
+ GameInputZone,
142
+ GameMeasurementProbe,
143
+ GameOverlay,
144
+ Heading,
145
+ Icon,
146
+ IconButton,
147
+ Image,
148
+ KeyboardAvoidingView,
149
+ TextInput,
150
+ MediaCard,
151
+ MetricCard,
152
+ Pagination,
153
+ PopoverMenu,
154
+ Progress,
155
+ ProgressRing,
156
+ Radio,
157
+ RadioGroup,
158
+ Rating,
159
+ SearchInput,
160
+ Select,
161
+ Switch,
162
+ Skeleton,
163
+ SkeletonCard,
164
+ SkeletonList,
165
+ SkeletonText,
166
+ Tab,
167
+ TabList,
168
+ TabPanel,
169
+ Tabs,
170
+ Text,
171
+ TimePicker,
172
+ Toast,
173
+ Toolbar,
174
+ Uploader,
175
+ BottomSheet,
176
+ FlatList,
177
+ SectionList,
178
+ ScrollView,
179
+ View,
180
+ ThemeModeToggle,
181
+ Divider,
182
+ Grid,
183
+ Surface,
184
+ AppShell,
185
+ Screen,
186
+ ScreenSection,
187
+ AuthScreen,
188
+ ForgotPasswordForm,
189
+ OAuthProviderButton,
190
+ OAuthProviderList,
191
+ OtpForm,
192
+ SignInForm,
193
+ SignUpForm,
194
+ ChatListItem,
195
+ ChessBoard,
196
+ CollectionEditor,
197
+ ContentRail,
198
+ EmptyState,
199
+ Explorer,
200
+ FileExplorer,
201
+ GridLineOverlay,
202
+ GridRuler,
203
+ GridInteractions,
204
+ GridView,
205
+ TileGrid,
206
+ TimeGrid,
207
+ MatrixGrid,
208
+ MediaExplorer,
209
+ Hero,
210
+ List,
211
+ ListItem,
212
+ ListSection,
213
+ MessageBubble,
214
+ OpeningBook,
215
+ MissingElement,
216
+ PostCard,
217
+ ProductCard,
218
+ BarcodeScannerView,
219
+ CameraPermissionView,
220
+ ScanOverlay,
221
+ SectionHeader,
222
+ SelectableItem,
223
+ SpatialGrid,
224
+ PaletteItem,
225
+ CardBack,
226
+ CardHand,
227
+ PlayingCard,
228
+ TabletopTable,
229
+ PokerTrainingTable,
230
+ Timeline,
231
+ TreeItem,
232
+ TreeView,
233
+ } as const satisfies ZoraComponentRegistry;
234
+
235
+ /*** The core ZORA runtime component registry, excluding separately selected feature entries such as Reader. */
236
+ export const ZORA_BASE_COMPONENT_REGISTRY: ZoraComponentRegistry = _ZORA_BASE_COMPONENT_REGISTRY;
@@ -1,237 +1,8 @@
1
- import type { InteractionPolicyProps } from '@ankhorage/surface';
2
- import type React from 'react';
3
-
4
1
  import type { ZoraComponentRegistry } from '../../types/registry';
5
- import { Accordion, AccordionItem } from '../accordion/public';
6
- import { ActivityIndicator } from '../activity-indicator/public';
7
- import { AppBar } from '../app-bar/public';
8
- import { AppHeader } from '../app-header/public';
9
- import {
10
- AuthScreen,
11
- ForgotPasswordForm,
12
- OAuthProviderButton,
13
- OAuthProviderList,
14
- OtpForm,
15
- SignInForm,
16
- SignUpForm,
17
- } from '../auth/public';
18
- import { Avatar, AvatarGroup } from '../avatar/public';
19
- import { Badge } from '../badge/public';
20
- import { BottomSheet } from '../bottom-sheet/public';
21
- import { Breadcrumbs } from '../breadcrumbs/public';
22
- import { Button, ButtonGroup, IconButton } from '../button/public';
23
- import { Card, MediaCard, MetricCard, PostCard, ProductCard } from '../card/public';
24
- import { ChatListItem, MessageBubble } from '../chat/public';
25
- import { ChessBoard, OpeningBook } from '../chess/public';
26
- import { Chip, ChipGroup } from '../chip/public';
27
- import { CollectionEditor } from '../collection-editor/public';
28
- import { ContentRail } from '../content-rail/public';
29
- import { DataTable } from '../data-table/public';
30
- import { DatePicker } from '../date-picker/public';
31
- import { Dialog } from '../dialog/public';
32
- import { EmptyState } from '../empty-state/public';
33
- import { Explorer, FileExplorer, MediaExplorer } from '../explorer/public';
34
- import { Checkbox, CheckboxGroup } from '../form/checkbox/public';
35
- import { Field, Form, FormActions, FormError } from '../form/public';
36
- import { Radio, RadioGroup } from '../form/radio/public';
37
- import { SearchInput } from '../form/search-input/public';
38
- import { Select } from '../form/select/public';
39
- import { Switch } from '../form/switch/public';
40
- import { TextInput } from '../form/text-input/public';
41
- import {
42
- Game,
43
- GameEntity,
44
- GameField,
45
- GameInputZone,
46
- GameMeasurementProbe,
47
- GameOverlay,
48
- } from '../game/public';
49
- import { Gradient } from '../gradient/public';
50
- import { GridInteractions } from '../grid-interactions/public';
51
- import { GridLineOverlay, GridRuler } from '../grid-rulers/public';
52
- import { GridView, TileGrid } from '../grid-view/public';
53
- import { Hero } from '../hero/public';
54
- import { Icon } from '../icon/public';
55
- import { Image } from '../image/public';
56
- import { KeyboardAvoidingView } from '../keyboard-avoiding-view/public';
57
- import { AppShell, Divider, Grid, Screen, ScrollView, View } from '../layout/public';
58
- import { FlatList, List, ListItem, ListSection, SectionList } from '../list/public';
59
- import { MatrixGrid } from '../matrix-grid/public';
60
- import { MissingElement } from '../missing-element/public';
61
- import { Pagination } from '../pagination/public';
62
- import { PaletteItem } from '../palette-item/public';
63
- import { PopoverMenu } from '../popover-menu/public';
64
- import { Progress, ProgressRing } from '../progress/public';
65
- import { Rating } from '../rating/public';
66
2
  import { Reader } from '../reader/public';
67
- import { BarcodeScannerView, CameraPermissionView, ScanOverlay } from '../scanner/public';
68
- import { ScreenSection, SectionHeader } from '../section/public';
69
- import { SelectableItem } from '../selection/public';
70
- import { Skeleton, SkeletonCard, SkeletonList, SkeletonText } from '../skeleton/public';
71
- import { SpatialGrid } from '../spatial-grid/public';
72
- import { Surface } from '../surface/public';
73
- import {
74
- CardBack,
75
- CardHand,
76
- PlayingCard,
77
- PokerTrainingTable,
78
- TabletopTable,
79
- } from '../tabletop/public';
80
- import { Tab, TabList, TabPanel, Tabs } from '../tabs/public';
81
- import { ThemeModeToggle } from '../theme/adapters/inbound/ThemeModeToggle';
82
- import { TimeGrid } from '../time-grid/public';
83
- import { TimePicker } from '../time-picker/public';
84
- import { Timeline } from '../timeline/public';
85
- import { Toast } from '../toast/public';
86
- import { Toolbar } from '../toolbar/public';
87
- import { TreeItem, TreeView } from '../tree-view/public';
88
- import { Heading, Text } from '../typography/public';
89
- import { Uploader } from '../uploader/public';
90
-
91
- type ComponentPropsFor<K extends keyof typeof _ZORA_COMPONENT_REGISTRY> = React.ComponentProps<
92
- (typeof _ZORA_COMPONENT_REGISTRY)[K]
93
- >;
94
-
95
- type AcceptsSurfaceInteractionPolicyProps<P> = 'interactionPolicy' extends keyof P
96
- ? InteractionPolicyProps extends Pick<P, 'interactionPolicy'>
97
- ? Pick<P, 'interactionPolicy'> extends InteractionPolicyProps
98
- ? true
99
- : false
100
- : false
101
- : false;
3
+ import { createZoraComponentRegistry } from './createZoraComponentRegistry';
102
4
 
103
- type RegistryInteractionPolicyContract = {
104
- [K in keyof typeof _ZORA_COMPONENT_REGISTRY]: AcceptsSurfaceInteractionPolicyProps<
105
- ComponentPropsFor<K>
106
- >;
107
- };
108
-
109
- type _AssertTrue<T extends true> = T;
110
- type _RegistryInteractionPolicyCheck = _AssertTrue<
111
- RegistryInteractionPolicyContract[keyof typeof _ZORA_COMPONENT_REGISTRY]
112
- >;
113
-
114
- const _ZORA_COMPONENT_REGISTRY = {
115
- Accordion,
116
- AccordionItem,
117
- ActivityIndicator,
118
- AppBar,
119
- AppHeader,
120
- Avatar,
121
- AvatarGroup,
122
- Badge,
123
- Breadcrumbs,
124
- Button,
125
- ButtonGroup,
126
- Card,
127
- Checkbox,
128
- CheckboxGroup,
129
- Chip,
130
- ChipGroup,
131
- DataTable,
132
- DatePicker,
133
- Dialog,
134
- Form,
135
- FormActions,
136
- FormError,
137
- Field,
138
- Gradient,
139
- Game,
140
- GameEntity,
141
- GameField,
142
- GameInputZone,
143
- GameMeasurementProbe,
144
- GameOverlay,
145
- Heading,
146
- Icon,
147
- IconButton,
148
- Image,
149
- KeyboardAvoidingView,
150
- TextInput,
151
- MediaCard,
152
- MetricCard,
153
- Pagination,
154
- PopoverMenu,
155
- Progress,
156
- ProgressRing,
157
- Radio,
158
- RadioGroup,
159
- Rating,
160
- SearchInput,
161
- Select,
162
- Switch,
163
- Skeleton,
164
- SkeletonCard,
165
- SkeletonList,
166
- SkeletonText,
167
- Tab,
168
- TabList,
169
- TabPanel,
170
- Tabs,
171
- Text,
172
- TimePicker,
173
- Toast,
174
- Toolbar,
175
- Uploader,
176
- BottomSheet,
177
- FlatList,
178
- SectionList,
179
- ScrollView,
180
- View,
181
- ThemeModeToggle,
182
- Divider,
183
- Grid,
184
- Surface,
185
- AppShell,
186
- Screen,
187
- ScreenSection,
188
- AuthScreen,
189
- ForgotPasswordForm,
190
- OAuthProviderButton,
191
- OAuthProviderList,
192
- OtpForm,
193
- SignInForm,
194
- SignUpForm,
195
- ChatListItem,
196
- ChessBoard,
197
- CollectionEditor,
198
- ContentRail,
199
- EmptyState,
200
- Explorer,
201
- FileExplorer,
202
- GridLineOverlay,
203
- GridRuler,
204
- GridInteractions,
205
- GridView,
206
- TileGrid,
207
- TimeGrid,
208
- MatrixGrid,
209
- MediaExplorer,
210
- Hero,
211
- List,
212
- ListItem,
213
- ListSection,
214
- MessageBubble,
215
- OpeningBook,
216
- MissingElement,
217
- PostCard,
218
- ProductCard,
5
+ /*** The complete ZORA runtime component registry, including the public Reader component. */
6
+ export const ZORA_COMPONENT_REGISTRY: ZoraComponentRegistry = createZoraComponentRegistry({
219
7
  Reader,
220
- BarcodeScannerView,
221
- CameraPermissionView,
222
- ScanOverlay,
223
- SectionHeader,
224
- SelectableItem,
225
- SpatialGrid,
226
- PaletteItem,
227
- CardBack,
228
- CardHand,
229
- PlayingCard,
230
- TabletopTable,
231
- PokerTrainingTable,
232
- Timeline,
233
- TreeItem,
234
- TreeView,
235
- } as const satisfies ZoraComponentRegistry;
236
-
237
- export const ZORA_COMPONENT_REGISTRY: ZoraComponentRegistry = _ZORA_COMPONENT_REGISTRY;
8
+ });
@@ -0,0 +1,9 @@
1
+ import type { ZoraComponentRegistry } from '../../types/registry';
2
+ import { ZORA_BASE_COMPONENT_REGISTRY } from './ZORA_BASE_COMPONENT_REGISTRY';
3
+
4
+ /*** Build a runtime component registry from ZORA's Reader-free base and explicitly selected feature entries. */
5
+ export function createZoraComponentRegistry(
6
+ extensions: ZoraComponentRegistry = {},
7
+ ): ZoraComponentRegistry {
8
+ return { ...ZORA_BASE_COMPONENT_REGISTRY, ...extensions };
9
+ }
@@ -1 +1,3 @@
1
+ export { createZoraComponentRegistry } from './createZoraComponentRegistry';
2
+ export { ZORA_BASE_COMPONENT_REGISTRY } from './ZORA_BASE_COMPONENT_REGISTRY';
1
3
  export { ZORA_COMPONENT_REGISTRY } from './ZORA_COMPONENT_REGISTRY';
@@ -0,0 +1,2 @@
1
+ export { createZoraComponentRegistry } from './createZoraComponentRegistry';
2
+ export { ZORA_BASE_COMPONENT_REGISTRY } from './ZORA_BASE_COMPONENT_REGISTRY';
@@ -53,7 +53,7 @@ async function listRuntimeRegistryEntries(): Promise<readonly string[]> {
53
53
  }
54
54
 
55
55
  async function listPublicConcreteComponentExports(): Promise<readonly string[]> {
56
- const source = await Bun.file('src/index.ts').text();
56
+ const source = await Bun.file('src/readerFree.ts').text();
57
57
  const componentExports = Array.from(
58
58
  source.matchAll(
59
59
  /export\s+\{([^}]+)\}\s+from '\.\/(components\/[^']+|features\/[^']+|foundation|layout\/[^']+|patterns\/[^']+)';/g,
@@ -64,7 +64,7 @@ async function listPublicConcreteComponentExports(): Promise<readonly string[]>
64
64
  .filter((name) => /^[A-Z][A-Za-z0-9]+$/.test(name))
65
65
  .filter((name) => !NON_RUNTIME_COMPONENT_EXPORTS.has(name));
66
66
 
67
- return [...componentExports, ...RUNTIME_THEME_COMPONENT_EXPORTS].sort();
67
+ return [...componentExports, 'Reader', ...RUNTIME_THEME_COMPONENT_EXPORTS].sort();
68
68
  }
69
69
 
70
70
  describe('ZORA_COMPONENT_REGISTRY', () => {
@@ -78,9 +78,40 @@ describe('ZORA_COMPONENT_REGISTRY', () => {
78
78
  expect(registryEntries).toContain('View');
79
79
  expect(registryEntries).toContain('AppHeader');
80
80
  expect(source).toContain("export type { ZoraComponentRegistry } from './types/registry';");
81
- expect(source).toContain(
82
- "export { ZORA_COMPONENT_REGISTRY } from './features/registry/public';",
83
- );
81
+ expect(source).toContain('ZORA_COMPONENT_REGISTRY');
82
+ });
83
+
84
+ test('publishes Reader-free registry and root-surface composition boundaries', async () => {
85
+ const [baseSource, compositionSource, packageJson, readerFreeSource, readerFreeRootSource] =
86
+ await Promise.all([
87
+ Bun.file('src/features/registry/ZORA_BASE_COMPONENT_REGISTRY.ts').text(),
88
+ Bun.file('src/features/registry/createZoraComponentRegistry.ts').text(),
89
+ Bun.file('package.json').json() as Promise<{ readonly exports: Record<string, unknown> }>,
90
+ Bun.file('src/features/registry/readerFreeRegistry.ts').text(),
91
+ Bun.file('src/readerFree.ts').text(),
92
+ ]);
93
+
94
+ expect(baseSource).not.toContain("from '../reader/public'");
95
+ expect(compositionSource).toContain('ZORA_BASE_COMPONENT_REGISTRY');
96
+ expect(readerFreeSource).toContain('ZORA_BASE_COMPONENT_REGISTRY');
97
+ expect(readerFreeSource).toContain('createZoraComponentRegistry');
98
+ expect(readerFreeSource).not.toContain('ZORA_COMPONENT_REGISTRY');
99
+ expect(readerFreeRootSource).not.toContain("from './features/reader/public'");
100
+ expect(readerFreeRootSource).not.toContain('ZORA_COMPONENT_REGISTRY');
101
+ expect(packageJson.exports['./registry']).toEqual({
102
+ 'react-native': './src/features/registry/readerFreeRegistry.ts',
103
+ browser: './src/features/registry/readerFreeRegistry.ts',
104
+ types: './dist/features/registry/readerFreeRegistry.d.ts',
105
+ import: './dist/features/registry/readerFreeRegistry.js',
106
+ default: './dist/features/registry/readerFreeRegistry.js',
107
+ });
108
+ expect(packageJson.exports['./reader-free']).toEqual({
109
+ 'react-native': './src/readerFree.ts',
110
+ browser: './src/readerFree.ts',
111
+ types: './dist/readerFree.d.ts',
112
+ import: './dist/readerFree.js',
113
+ default: './dist/readerFree.js',
114
+ });
84
115
  });
85
116
 
86
117
  test('covers every public concrete ZORA component export supported for runtime rendering', async () => {
@@ -6,15 +6,16 @@ describe('ZORA Uploader public contract', () => {
6
6
  dependencies: Readonly<Record<string, string>>;
7
7
  exports: Readonly<Record<string, unknown>>;
8
8
  };
9
- const [rootSource, publicSource] = await Promise.all([
9
+ const [rootSource, readerFreeSource, publicSource] = await Promise.all([
10
10
  Bun.file('src/index.ts').text(),
11
+ Bun.file('src/readerFree.ts').text(),
11
12
  Bun.file('src/features/uploader/public.ts').text(),
12
13
  ]);
13
14
 
14
15
  expect(packageJson.exports['./uploader']).toBeDefined();
15
16
  expect(packageJson.dependencies['expo-image-picker']).toMatch(/^~57\./u);
16
17
  expect(packageJson.dependencies['expo-document-picker']).toMatch(/^~57\./u);
17
- expect(rootSource).toContain("from './features/uploader/public'");
18
+ expect(`${rootSource}\n${readerFreeSource}`).toContain("from './features/uploader/public'");
18
19
  expect(publicSource).toContain('export { Uploader }');
19
20
  expect(publicSource).toContain('export { validateUploadAsset }');
20
21
  });