@hozo/engine 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 (168) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +78 -0
  3. package/dist/activate.d.ts +14 -0
  4. package/dist/activate.d.ts.map +1 -0
  5. package/dist/activate.js +38 -0
  6. package/dist/activate.js.map +1 -0
  7. package/dist/ambient.d.ts +79 -0
  8. package/dist/ambient.d.ts.map +1 -0
  9. package/dist/ambient.js +117 -0
  10. package/dist/ambient.js.map +1 -0
  11. package/dist/backdrop.d.ts +36 -0
  12. package/dist/backdrop.d.ts.map +1 -0
  13. package/dist/backdrop.js +41 -0
  14. package/dist/backdrop.js.map +1 -0
  15. package/dist/class-name.native.d.ts +20 -0
  16. package/dist/class-name.native.d.ts.map +1 -0
  17. package/dist/class-name.native.js +34 -0
  18. package/dist/class-name.native.js.map +1 -0
  19. package/dist/class-resolver.d.ts +26 -0
  20. package/dist/class-resolver.d.ts.map +1 -0
  21. package/dist/class-resolver.js +56 -0
  22. package/dist/class-resolver.js.map +1 -0
  23. package/dist/color-transition.d.ts +3 -0
  24. package/dist/color-transition.d.ts.map +1 -0
  25. package/dist/color-transition.js +31 -0
  26. package/dist/color-transition.js.map +1 -0
  27. package/dist/dom-style.d.ts +10 -0
  28. package/dist/dom-style.d.ts.map +1 -0
  29. package/dist/dom-style.js +145 -0
  30. package/dist/dom-style.js.map +1 -0
  31. package/dist/dom-style.native.d.ts +7 -0
  32. package/dist/dom-style.native.d.ts.map +1 -0
  33. package/dist/dom-style.native.js +9 -0
  34. package/dist/dom-style.native.js.map +1 -0
  35. package/dist/external-link.d.ts +6 -0
  36. package/dist/external-link.d.ts.map +1 -0
  37. package/dist/external-link.js +9 -0
  38. package/dist/external-link.js.map +1 -0
  39. package/dist/generated/animation.d.ts +2 -0
  40. package/dist/generated/animation.d.ts.map +1 -0
  41. package/dist/generated/animation.js +3 -0
  42. package/dist/generated/animation.js.map +1 -0
  43. package/dist/generated/class-resolver.d.ts +2 -0
  44. package/dist/generated/class-resolver.d.ts.map +1 -0
  45. package/dist/generated/class-resolver.js +3 -0
  46. package/dist/generated/class-resolver.js.map +1 -0
  47. package/dist/generated/dom-style.d.ts +2 -0
  48. package/dist/generated/dom-style.d.ts.map +1 -0
  49. package/dist/generated/dom-style.js +2 -0
  50. package/dist/generated/dom-style.js.map +1 -0
  51. package/dist/generated/dom-style.native.d.ts +2 -0
  52. package/dist/generated/dom-style.native.d.ts.map +1 -0
  53. package/dist/generated/dom-style.native.js +2 -0
  54. package/dist/generated/dom-style.native.js.map +1 -0
  55. package/dist/generated/environment.d.ts +2 -0
  56. package/dist/generated/environment.d.ts.map +1 -0
  57. package/dist/generated/environment.js +5 -0
  58. package/dist/generated/environment.js.map +1 -0
  59. package/dist/generated/image-source.d.ts +2 -0
  60. package/dist/generated/image-source.d.ts.map +1 -0
  61. package/dist/generated/image-source.js +3 -0
  62. package/dist/generated/image-source.js.map +1 -0
  63. package/dist/generated/interactive.d.ts +2 -0
  64. package/dist/generated/interactive.d.ts.map +1 -0
  65. package/dist/generated/interactive.js +2 -0
  66. package/dist/generated/interactive.js.map +1 -0
  67. package/dist/generated/safe-area.d.ts +2 -0
  68. package/dist/generated/safe-area.d.ts.map +1 -0
  69. package/dist/generated/safe-area.js +4 -0
  70. package/dist/generated/safe-area.js.map +1 -0
  71. package/dist/generated/scrollable.d.ts +2 -0
  72. package/dist/generated/scrollable.d.ts.map +1 -0
  73. package/dist/generated/scrollable.js +2 -0
  74. package/dist/generated/scrollable.js.map +1 -0
  75. package/dist/hooks.native.d.ts +92 -0
  76. package/dist/hooks.native.d.ts.map +1 -0
  77. package/dist/hooks.native.js +284 -0
  78. package/dist/hooks.native.js.map +1 -0
  79. package/dist/image-source.native.d.ts +5 -0
  80. package/dist/image-source.native.d.ts.map +1 -0
  81. package/dist/image-source.native.js +5 -0
  82. package/dist/image-source.native.js.map +1 -0
  83. package/dist/index.d.ts +11 -0
  84. package/dist/index.d.ts.map +1 -0
  85. package/dist/index.js +30 -0
  86. package/dist/index.js.map +1 -0
  87. package/dist/index.native.d.ts +8 -0
  88. package/dist/index.native.d.ts.map +1 -0
  89. package/dist/index.native.js +28 -0
  90. package/dist/index.native.js.map +1 -0
  91. package/dist/interactive.d.ts +31 -0
  92. package/dist/interactive.d.ts.map +1 -0
  93. package/dist/interactive.js +64 -0
  94. package/dist/interactive.js.map +1 -0
  95. package/dist/navigation-context.d.ts +11 -0
  96. package/dist/navigation-context.d.ts.map +1 -0
  97. package/dist/navigation-context.js +12 -0
  98. package/dist/navigation-context.js.map +1 -0
  99. package/dist/navigation-entry.d.ts +3 -0
  100. package/dist/navigation-entry.d.ts.map +1 -0
  101. package/dist/navigation-entry.js +3 -0
  102. package/dist/navigation-entry.js.map +1 -0
  103. package/dist/navigation-entry.native.d.ts +2 -0
  104. package/dist/navigation-entry.native.d.ts.map +1 -0
  105. package/dist/navigation-entry.native.js +6 -0
  106. package/dist/navigation-entry.native.js.map +1 -0
  107. package/dist/navigation.d.ts +34 -0
  108. package/dist/navigation.d.ts.map +1 -0
  109. package/dist/navigation.js +27 -0
  110. package/dist/navigation.js.map +1 -0
  111. package/dist/project.d.ts +10 -0
  112. package/dist/project.d.ts.map +1 -0
  113. package/dist/project.js +10 -0
  114. package/dist/project.js.map +1 -0
  115. package/dist/project.native.d.ts +2 -0
  116. package/dist/project.native.d.ts.map +1 -0
  117. package/dist/project.native.js +2 -0
  118. package/dist/project.native.js.map +1 -0
  119. package/dist/responder.d.ts +100 -0
  120. package/dist/responder.d.ts.map +1 -0
  121. package/dist/responder.js +256 -0
  122. package/dist/responder.js.map +1 -0
  123. package/dist/safe-area.native.d.ts +18 -0
  124. package/dist/safe-area.native.d.ts.map +1 -0
  125. package/dist/safe-area.native.js +72 -0
  126. package/dist/safe-area.native.js.map +1 -0
  127. package/dist/scrollable.d.ts +16 -0
  128. package/dist/scrollable.d.ts.map +1 -0
  129. package/dist/scrollable.js +114 -0
  130. package/dist/scrollable.js.map +1 -0
  131. package/dist/text-size.d.ts +12 -0
  132. package/dist/text-size.d.ts.map +1 -0
  133. package/dist/text-size.js +22 -0
  134. package/dist/text-size.js.map +1 -0
  135. package/package.json +131 -0
  136. package/src/activate.ts +45 -0
  137. package/src/ambient.ts +199 -0
  138. package/src/backdrop.ts +66 -0
  139. package/src/class-name.native.ts +53 -0
  140. package/src/class-resolver.ts +74 -0
  141. package/src/color-transition.ts +27 -0
  142. package/src/dom-style.native.ts +13 -0
  143. package/src/dom-style.ts +173 -0
  144. package/src/external-link.ts +12 -0
  145. package/src/generated/animation.ts +2 -0
  146. package/src/generated/class-resolver.ts +2 -0
  147. package/src/generated/dom-style.native.ts +1 -0
  148. package/src/generated/dom-style.ts +1 -0
  149. package/src/generated/environment.ts +10 -0
  150. package/src/generated/image-source.ts +2 -0
  151. package/src/generated/interactive.ts +1 -0
  152. package/src/generated/safe-area.ts +3 -0
  153. package/src/generated/scrollable.ts +1 -0
  154. package/src/hooks.native.ts +408 -0
  155. package/src/image-source.native.ts +4 -0
  156. package/src/index.native.ts +38 -0
  157. package/src/index.ts +50 -0
  158. package/src/interactive.ts +68 -0
  159. package/src/navigation-context.tsx +20 -0
  160. package/src/navigation-entry.native.ts +5 -0
  161. package/src/navigation-entry.ts +12 -0
  162. package/src/navigation.ts +55 -0
  163. package/src/project.native.ts +1 -0
  164. package/src/project.ts +9 -0
  165. package/src/responder.ts +372 -0
  166. package/src/safe-area.native.ts +87 -0
  167. package/src/scrollable.ts +119 -0
  168. package/src/text-size.ts +25 -0
@@ -0,0 +1,284 @@
1
+ // The React Native glue for `./ambient.ts`. Deliberately thin -- all the
2
+ // logic worth testing lives there, free of `react`/`react-native` imports
3
+ // so it can be tested without a device or a native module registry. This
4
+ // file is the part that can only be verified by running an app, same
5
+ // division as `@hozo/metro`'s `index.ts`.
6
+ //
7
+ // Generated components call these; nothing here is meant to be imported by
8
+ // hand.
9
+ import { useEffect, useMemo, useRef, useSyncExternalStore } from 'react';
10
+ import { AccessibilityInfo, Animated, Appearance, Dimensions, Easing, I18nManager, } from 'react-native';
11
+ import { bucketFor, createStore, ENVIRONMENT_FACTS, isAtLeast, isPortrait, sameViewport, } from './ambient.js';
12
+ /// `Dimensions` hands back more than the two numbers wanted here (`scale`,
13
+ /// `fontScale`), and a fresh object every event. Narrowing it is what makes
14
+ /// the store's change check able to see that nothing moved.
15
+ function viewportOf({ width, height }) {
16
+ return { width, height };
17
+ }
18
+ // One subscription per app, not per component. See ./ambient.ts.
19
+ const colorSchemeStore = createStore(Appearance.getColorScheme());
20
+ Appearance.addChangeListener(({ colorScheme }) => {
21
+ colorSchemeStore.set(colorScheme);
22
+ });
23
+ function sameScaledSize(left, right) {
24
+ return (left.width === right.width &&
25
+ left.height === right.height &&
26
+ left.scale === right.scale &&
27
+ left.fontScale === right.fontScale);
28
+ }
29
+ const initialWindow = Dimensions.get('window');
30
+ const breakpointStore = createStore(bucketFor(initialWindow.width));
31
+ // A second store over the same event, holding the size itself rather than
32
+ // the bucket. Kept separate on purpose: a component using only `md:`
33
+ // must not re-render on every resize that doesn't cross a breakpoint, and
34
+ // it wouldn't if these shared one snapshot.
35
+ const viewportStore = createStore(viewportOf(initialWindow), sameViewport);
36
+ const windowDimensionsStore = createStore(initialWindow, sameScaledSize);
37
+ const orientationStore = createStore(isPortrait(initialWindow));
38
+ Dimensions.addEventListener('change', ({ window }) => {
39
+ breakpointStore.set(bucketFor(window.width));
40
+ viewportStore.set(viewportOf(window));
41
+ windowDimensionsStore.set(window);
42
+ orientationStore.set(isPortrait(window));
43
+ });
44
+ /** Whether the OS is in dark mode. Drives `dark:` utilities. */
45
+ export function useHozoDark() {
46
+ return useSyncExternalStore(colorSchemeStore.subscribe, () => colorSchemeStore.get() === 'dark', () => colorSchemeStore.get() === 'dark');
47
+ }
48
+ /** React Native's color-scheme hook, backed by Hozo's shared native listener. */
49
+ export function useColorScheme() {
50
+ return useSyncExternalStore(colorSchemeStore.subscribe, colorSchemeStore.get, colorSchemeStore.get);
51
+ }
52
+ /**
53
+ * Whether the viewport is at least as wide as `name`'s breakpoint. Drives
54
+ * `sm:`/`md:`/`lg:`/`xl:`/`2xl:` utilities.
55
+ *
56
+ * Takes the name rather than returning the current bucket so the call
57
+ * reads as the condition it was compiled from: `md:` becomes
58
+ * `useHozoBreakpoint('md')`.
59
+ */
60
+ export function useHozoBreakpoint(name) {
61
+ const bucket = useSyncExternalStore(breakpointStore.subscribe, breakpointStore.get, breakpointStore.get);
62
+ return isAtLeast(bucket, name);
63
+ }
64
+ /**
65
+ * Whether the window is at least `px` wide. Drives `min-[500px]:` and,
66
+ * negated, `max-[…]:` and `max-<breakpoint>:`.
67
+ *
68
+ * A threshold rather than a bucket, because an arbitrary one is by
69
+ * definition not one of the five. Just as cheap, though, and for a reason
70
+ * worth stating: the snapshot is the *predicate*, not the width, so React
71
+ * compares a boolean and skips the render on every resize that doesn't
72
+ * cross `px`. Rounding to buckets buys nothing over that -- it is the
73
+ * older of the two ideas, not the cheaper one.
74
+ */
75
+ export function useHozoWidthAtLeast(px) {
76
+ return useSyncExternalStore(viewportStore.subscribe, () => viewportStore.get().width >= px, () => viewportStore.get().width >= px);
77
+ }
78
+ /**
79
+ * The current window size. Drives the viewport-relative sizes -- `h-screen`
80
+ * compiles to `{ height: useHozoViewport().height }`.
81
+ *
82
+ * The window, not the screen: the window excludes system UI the app can't
83
+ * draw under, which is the closer analogue of the Web viewport. It does not
84
+ * subtract a notch or a home indicator, so a full-bleed layout still wants
85
+ * a safe-area inset on top of this -- exactly as it does on Web.
86
+ *
87
+ * Unlike the two above, this re-renders on every window change rather than
88
+ * only when a breakpoint is crossed. That is unavoidable for a size that
89
+ * has to track the window exactly, and it's why this is a separate store
90
+ * rather than the breakpoints being rebuilt on top of it.
91
+ */
92
+ export function useHozoViewport() {
93
+ return useSyncExternalStore(viewportStore.subscribe, viewportStore.get, viewportStore.get);
94
+ }
95
+ /** React Native's window dimensions, backed by Hozo's shared native listener. */
96
+ export function useWindowDimensions() {
97
+ return useSyncExternalStore(windowDimensionsStore.subscribe, windowDimensionsStore.get, windowDimensionsStore.get);
98
+ }
99
+ const DURATIONS = {
100
+ spin: 1000,
101
+ // Tailwind's `pulse` is 2s and the others are 1s.
102
+ pulse: 2000,
103
+ bounce: 1000,
104
+ ping: 1000,
105
+ };
106
+ /**
107
+ * The easing for one animation, built when it is asked for.
108
+ *
109
+ * A function rather than a table, because a table is evaluated at import
110
+ * time and `Easing.bezier` would be called on every native import of this
111
+ * package -- which is how the accessibility settings above ended up
112
+ * needing the same treatment. Nothing here should run for a project that
113
+ * imports the module and never animates.
114
+ */
115
+ function easingFor(name) {
116
+ switch (name) {
117
+ // `cubic-bezier(.4,0,.6,1)`, which is symmetric, so the fade out and
118
+ // back read as one breath rather than two movements.
119
+ case 'pulse':
120
+ return Easing.bezier(0.4, 0, 0.6, 1);
121
+ case 'ping':
122
+ return Easing.bezier(0, 0, 0.2, 1);
123
+ // Linear on purpose for the bounce: its shape is in the interpolation
124
+ // below, and easing it again would ease it twice.
125
+ default:
126
+ return Easing.linear;
127
+ }
128
+ }
129
+ export function useHozoAnimation(name) {
130
+ const progress = useRef(new Animated.Value(0)).current;
131
+ useEffect(() => {
132
+ progress.setValue(0);
133
+ const animation = Animated.loop(Animated.timing(progress, {
134
+ toValue: 1,
135
+ duration: DURATIONS[name],
136
+ easing: easingFor(name),
137
+ useNativeDriver: true,
138
+ }));
139
+ animation.start();
140
+ return () => animation.stop();
141
+ }, [progress, name]);
142
+ return useMemo(() => {
143
+ switch (name) {
144
+ case 'spin':
145
+ return {
146
+ transform: [
147
+ {
148
+ rotate: progress.interpolate({ inputRange: [0, 1], outputRange: ['0deg', '360deg'] }),
149
+ },
150
+ ],
151
+ };
152
+ case 'pulse':
153
+ return {
154
+ opacity: progress.interpolate({ inputRange: [0, 0.5, 1], outputRange: [1, 0.5, 1] }),
155
+ };
156
+ case 'bounce':
157
+ return {
158
+ transform: [
159
+ {
160
+ // A percentage, because Tailwind's bounce is -25% of the
161
+ // element's own height and a pixel figure would be right at
162
+ // one size only. React Native has taken percentages in
163
+ // `translateY` since 0.76, below this package's floor of 0.86.
164
+ //
165
+ // The two halves are not symmetric: Tailwind eases the rise
166
+ // with `cubic-bezier(.8,0,1,1)` and the fall with
167
+ // `cubic-bezier(0,0,.2,1)`, so it leaves slowly and lands
168
+ // quickly. The extra input points are that asymmetry drawn
169
+ // out, since one `Animated.timing` cannot hold two easings.
170
+ translateY: progress.interpolate({
171
+ inputRange: [0, 0.25, 0.5, 0.75, 1],
172
+ outputRange: ['0%', '-15%', '-25%', '-10%', '0%'],
173
+ }),
174
+ },
175
+ ],
176
+ };
177
+ case 'ping':
178
+ return {
179
+ opacity: progress.interpolate({ inputRange: [0, 1], outputRange: [1, 0] }),
180
+ transform: [{ scale: progress.interpolate({ inputRange: [0, 1], outputRange: [1, 2] }) }],
181
+ };
182
+ }
183
+ }, [progress, name]);
184
+ }
185
+ // The environment queries, on the same one-subscription-per-app footing as
186
+ // `dark:` above. Four facts answer seven queries: `motion-safe` is
187
+ // `motion-reduce` negated, `landscape` is `portrait` negated, `ltr` is
188
+ // `rtl` negated.
189
+ const reduceMotionStore = createStore(false);
190
+ const invertColorsStore = createStore(false);
191
+ // The four Tailwind has no name for. Three are iOS-only, and React Native
192
+ // resolves those to `false` on Android rather than rejecting them, so
193
+ // nothing here needs a platform check: a style that does not fire where
194
+ // the setting does not exist is correct.
195
+ const reduceTransparencyStore = createStore(false);
196
+ const boldTextStore = createStore(false);
197
+ const grayscaleStore = createStore(false);
198
+ const screenReaderStore = createStore(false);
199
+ // `contrast-more:` alone has two settings behind it, one per platform, and
200
+ // they get a store each rather than sharing one. Sharing would mean two
201
+ // asynchronous reads racing to write the same value: on a device where one
202
+ // method is present and the other resolves `false`, whichever landed last
203
+ // would win and the answer would depend on scheduling. Two stores combined
204
+ // at read time cannot do that.
205
+ const darkerSystemColorsStore = createStore(false);
206
+ const highTextContrastStore = createStore(false);
207
+ // Asynchronous, unlike `Appearance.getColorScheme()`: these cross to the
208
+ // platform. The store starts at `false` and corrects itself, which is the
209
+ // right way round -- a first frame that under-reports reduced motion
210
+ // animates once, and one that over-reports it silently drops an animation
211
+ // the user asked for.
212
+ void AccessibilityInfo.isReduceMotionEnabled().then((value) => reduceMotionStore.set(value));
213
+ void AccessibilityInfo.isInvertColorsEnabled().then((value) => invertColorsStore.set(value));
214
+ AccessibilityInfo.addEventListener('reduceMotionChanged', (value) => reduceMotionStore.set(value));
215
+ AccessibilityInfo.addEventListener('invertColorsChanged', (value) => invertColorsStore.set(value));
216
+ // Asked for by name rather than called directly, because this runs at
217
+ // import time and a missing method there takes the whole app down before
218
+ // anything renders. These four are newer than the two above and are not
219
+ // all present on every React Native version or every platform's native
220
+ // module -- and a setting Hozo cannot read is a `false`, which is what the
221
+ // store already holds.
222
+ function track(read, event, store) {
223
+ const method = AccessibilityInfo[read];
224
+ if (typeof method !== 'function')
225
+ return;
226
+ void method
227
+ .call(AccessibilityInfo)
228
+ .then((value) => store.set(value))
229
+ // A rejection is the same answer as a missing method: unknown, and
230
+ // `false` is the safe reading of unknown for all four.
231
+ .catch(() => { });
232
+ AccessibilityInfo.addEventListener(event, (value) => store.set(value));
233
+ }
234
+ track('isReduceTransparencyEnabled', 'reduceTransparencyChanged', reduceTransparencyStore);
235
+ track('isBoldTextEnabled', 'boldTextChanged', boldTextStore);
236
+ track('isGrayscaleEnabled', 'grayscaleChanged', grayscaleStore);
237
+ // The one that changes mid-session more than any of the others: someone
238
+ // turning VoiceOver on to read a screen they are already looking at is the
239
+ // ordinary case, not an edge one.
240
+ track('isScreenReaderEnabled', 'screenReaderChanged', screenReaderStore);
241
+ // iOS's Increase Contrast, which is the same OS setting Safari writes
242
+ // `prefers-contrast: more` from -- so a component styled with
243
+ // `contrast-more:` behaves the same in a WebView and in a native screen.
244
+ track('isDarkerSystemColorsEnabled', 'darkerSystemColorsChanged', darkerSystemColorsStore);
245
+ // Android's is narrower: high-contrast *text*, not a general contrast
246
+ // increase. Read as the nearest thing that platform has rather than left
247
+ // unanswered, which would make `contrast-more:` iOS-only in practice.
248
+ track('isHighTextContrastEnabled', 'highTextContrastChanged', highTextContrastStore);
249
+ /**
250
+ * Whether an environment query holds. Drives `motion-reduce:`, `ltr:` and
251
+ * the rest.
252
+ *
253
+ * `I18nManager.isRTL` has no store because it has no event: React Native
254
+ * requires a reload for a direction change to take effect, so within one
255
+ * run it is a constant.
256
+ */
257
+ export function useHozoEnvironment(query) {
258
+ const { fact, negate } = ENVIRONMENT_FACTS[query];
259
+ const reduceMotion = useSyncExternalStore(reduceMotionStore.subscribe, reduceMotionStore.get, reduceMotionStore.get);
260
+ const invertColors = useSyncExternalStore(invertColorsStore.subscribe, invertColorsStore.get, invertColorsStore.get);
261
+ const portrait = useSyncExternalStore(orientationStore.subscribe, orientationStore.get, orientationStore.get);
262
+ const reduceTransparency = useSyncExternalStore(reduceTransparencyStore.subscribe, reduceTransparencyStore.get, reduceTransparencyStore.get);
263
+ const boldText = useSyncExternalStore(boldTextStore.subscribe, boldTextStore.get, boldTextStore.get);
264
+ const grayscale = useSyncExternalStore(grayscaleStore.subscribe, grayscaleStore.get, grayscaleStore.get);
265
+ const screenReader = useSyncExternalStore(screenReaderStore.subscribe, screenReaderStore.get, screenReaderStore.get);
266
+ const darkerSystemColors = useSyncExternalStore(darkerSystemColorsStore.subscribe, darkerSystemColorsStore.get, darkerSystemColorsStore.get);
267
+ const highTextContrast = useSyncExternalStore(highTextContrastStore.subscribe, highTextContrastStore.get, highTextContrastStore.get);
268
+ const value = {
269
+ reduceMotion,
270
+ invertColors,
271
+ portrait,
272
+ rtl: I18nManager.isRTL,
273
+ reduceTransparency,
274
+ boldText,
275
+ grayscale,
276
+ screenReader,
277
+ // Either platform's setting answers the query. Only one of the two can
278
+ // be true on a given device -- each method exists on one platform --
279
+ // so the `||` is a union of platforms rather than of settings.
280
+ contrastMore: darkerSystemColors || highTextContrast,
281
+ }[fact];
282
+ return negate ? !value : value;
283
+ }
284
+ //# sourceMappingURL=hooks.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks.native.js","sourceRoot":"","sources":["../src/hooks.native.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,0EAA0E;AAC1E,yEAAyE;AACzE,qEAAqE;AACrE,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,QAAQ;AAER,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,OAAO,CAAA;AACxE,OAAO,EACL,iBAAiB,EACjB,QAAQ,EACR,UAAU,EAEV,UAAU,EACV,MAAM,EACN,WAAW,GAEZ,MAAM,cAAc,CAAA;AAErB,OAAO,EAEL,SAAS,EACT,WAAW,EACX,iBAAiB,EAEjB,SAAS,EACT,UAAU,EACV,YAAY,GAEb,MAAM,cAAc,CAAA;AAErB,2EAA2E;AAC3E,4EAA4E;AAC5E,4DAA4D;AAC5D,SAAS,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,EAAqC;IACtE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAA;AAC1B,CAAC;AAED,iEAAiE;AAEjE,MAAM,gBAAgB,GAAG,WAAW,CAAyB,UAAU,CAAC,cAAc,EAAE,CAAC,CAAA;AACzF,UAAU,CAAC,iBAAiB,CAAC,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE;IAC/C,gBAAgB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;AACnC,CAAC,CAAC,CAAA;AAEF,SAAS,cAAc,CAAC,IAAgB,EAAE,KAAiB;IACzD,OAAO,CACL,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK;QAC1B,IAAI,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;QAC5B,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC,KAAK;QAC1B,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,SAAS,CACnC,CAAA;AACH,CAAC;AAED,MAAM,aAAa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;IACP,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAA;AAChC,CAAC"}
@@ -0,0 +1,5 @@
1
+ /** Normalizes Hozo's universal Image `src` to React Native's source shape. */
2
+ export declare function hozoImageSource<T extends number | object>(src: string | T): {
3
+ uri: string;
4
+ } | T;
5
+ //# sourceMappingURL=image-source.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-source.native.d.ts","sourceRoot":"","sources":["../src/image-source.native.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,GAAG,CAAC,CAE/F"}
@@ -0,0 +1,5 @@
1
+ /** Normalizes Hozo's universal Image `src` to React Native's source shape. */
2
+ export function hozoImageSource(src) {
3
+ return typeof src === 'string' ? { uri: src } : src;
4
+ }
5
+ //# sourceMappingURL=image-source.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-source.native.js","sourceRoot":"","sources":["../src/image-source.native.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,MAAM,UAAU,eAAe,CAA4B,GAAe;IACxE,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAA;AACrD,CAAC"}
@@ -0,0 +1,11 @@
1
+ export { hozoActivateKeyDown, hozoActivateKeyUp } from './activate.ts';
2
+ export { configureHozoBackdropFilter, createExpoBlurAdapter, type ExpoBlurAdapterOptions, type HozoBackdropFilterAdapter, type HozoBackdropFilterAdapterProps, hozoBackdropFilterAdapter, } from './backdrop.ts';
3
+ export { type ClassResolver, createClassResolver, type StyleObject } from './class-resolver.ts';
4
+ export { blendColor } from './color-transition.ts';
5
+ export { type HozoDomStyle, hozoDomProps, hozoDomStyle } from './dom-style.ts';
6
+ export { externalLinkAttributes } from './external-link.ts';
7
+ export { hozoInteractive } from './interactive.ts';
8
+ export { type HozoResponderEvent, type HozoResponderTouch, type HozoTouchHistory, type HozoTouchTrack, type ResponderProps, useResponderDomProps, } from './responder.ts';
9
+ export { hozoScrollable } from './scrollable.ts';
10
+ export { HOZO_DEFAULT_FONT_SIZE, HozoTextSizeContext, useHozoTextSize, } from './text-size.ts';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACtE,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,EACnC,yBAAyB,GAC1B,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,KAAK,aAAa,EAAE,mBAAmB,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,KAAK,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,oBAAoB,GACrB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,GAChB,MAAM,gBAAgB,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,30 @@
1
+ // The only thing Hozo ships to a device, and it exists for exactly one
2
+ // reason: React Native has no CSS engine.
3
+ //
4
+ // On Web, a `className` the compiler couldn't read needs no runtime at all
5
+ // -- the class string reaches the DOM, and the browser matches it against
6
+ // the generated candidate stylesheet by itself. Native has nothing to hand
7
+ // the string to, so this closes that one gap and nothing else.
8
+ //
9
+ // One exception, added later: a `<div role="button">` that Hozo put in the
10
+ // tab order needs Enter and Space wired up, and only script can do that.
11
+ // See `./activate.ts`.
12
+ //
13
+ // Compare `react-native-css`, which implements a genuine CSS engine in JS:
14
+ // specificity sorting, media/container query evaluation, CSS variables, a
15
+ // reactive observable graph. It needs all of that because it accepts
16
+ // arbitrary CSS. This resolver handles only *single Tailwind utility
17
+ // classes*, which are all the same specificity -- so "later in the string
18
+ // wins" is the entire cascade, and React Native's own style-array merging
19
+ // already implements that. Hence a lookup, not an engine.
20
+ export { hozoActivateKeyDown, hozoActivateKeyUp } from './activate.js';
21
+ export { configureHozoBackdropFilter, createExpoBlurAdapter, hozoBackdropFilterAdapter, } from './backdrop.js';
22
+ export { createClassResolver } from './class-resolver.js';
23
+ export { blendColor } from './color-transition.js';
24
+ export { hozoDomProps, hozoDomStyle } from './dom-style.js';
25
+ export { externalLinkAttributes } from './external-link.js';
26
+ export { hozoInteractive } from './interactive.js';
27
+ export { useResponderDomProps, } from './responder.js';
28
+ export { hozoScrollable } from './scrollable.js';
29
+ export { HOZO_DEFAULT_FONT_SIZE, HozoTextSizeContext, useHozoTextSize, } from './text-size.js';
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,0EAA0E;AAC1E,2EAA2E;AAC3E,+DAA+D;AAC/D,EAAE;AACF,2EAA2E;AAC3E,yEAAyE;AACzE,uBAAuB;AACvB,EAAE;AACF,2EAA2E;AAC3E,0EAA0E;AAC1E,qEAAqE;AACrE,qEAAqE;AACrE,0EAA0E;AAC1E,0EAA0E;AAC1E,0DAA0D;AAE1D,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACtE,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EAIrB,yBAAyB,GAC1B,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAsB,mBAAmB,EAAoB,MAAM,qBAAqB,CAAA;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAqB,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAML,oBAAoB,GACrB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,GAChB,MAAM,gBAAgB,CAAA"}
@@ -0,0 +1,8 @@
1
+ import './class-name.native.ts';
2
+ export type { BreakpointName, Viewport } from './ambient.ts';
3
+ export { type HozoDomStyle, hozoDomProps, hozoDomStyle } from './dom-style.native.ts';
4
+ export { type HozoAnimation, useHozoAnimation, useHozoBreakpoint, useHozoDark, useHozoEnvironment, useHozoViewport, useHozoWidthAtLeast, } from './hooks.native.ts';
5
+ export { hozoImageSource } from './image-source.native.ts';
6
+ export * from './index.ts';
7
+ export { type HozoSafeAreaInsets, useHozoSafeArea } from './safe-area.native.ts';
8
+ //# sourceMappingURL=index.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAmBA,OAAO,wBAAwB,CAAA;AAE/B,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAI5D,OAAO,EAAE,KAAK,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACrF,OAAO,EACL,KAAK,aAAa,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,mBAAmB,GACpB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,KAAK,kBAAkB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA"}
@@ -0,0 +1,28 @@
1
+ // The React Native entry point for `@hozo/engine`.
2
+ //
3
+ // Metro resolves a platform extension ahead of the plain file, so an app
4
+ // importing `@hozo/engine` gets this on device and `./index.ts` on Web.
5
+ // That split is what lets the parts needing `react`/`react-native` be
6
+ // exported at all: `./index.ts` is imported by the Web build too, where
7
+ // those modules don't exist.
8
+ //
9
+ // Generated infrastructure such as `useHozoDark` remains reachable here,
10
+ // but compiled output imports it leaf by leaf from `./generated/*` (through
11
+ // `@hozo/core/generated/*`). Compiler-generated React components are owned
12
+ // by domain packages, including `@hozo/primitives/generated/*` for Native
13
+ // layout boundaries.
14
+ // The `className` prop, for TypeScript only. Imported for its side
15
+ // effect: the file declares nothing at runtime and augments React
16
+ // Native's prop interfaces so an app can be type-checked against the same
17
+ // source the compiler reads. See the file for why it is here rather than
18
+ // in `@hozo/core`.
19
+ import './class-name.native.js';
20
+ // `index.ts` names the Web implementation explicitly after TypeScript
21
+ // emits it. Override that star export so Metro never sends DOM conversion
22
+ // through a native render path.
23
+ export { hozoDomProps, hozoDomStyle } from './dom-style.native.js';
24
+ export { useHozoAnimation, useHozoBreakpoint, useHozoDark, useHozoEnvironment, useHozoViewport, useHozoWidthAtLeast, } from './hooks.native.js';
25
+ export { hozoImageSource } from './image-source.native.js';
26
+ export * from './index.js';
27
+ export { useHozoSafeArea } from './safe-area.native.js';
28
+ //# sourceMappingURL=index.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.native.js","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,EAAE;AACF,yEAAyE;AACzE,wEAAwE;AACxE,sEAAsE;AACtE,wEAAwE;AACxE,6BAA6B;AAC7B,EAAE;AACF,yEAAyE;AACzE,4EAA4E;AAC5E,2EAA2E;AAC3E,0EAA0E;AAC1E,qBAAqB;AAErB,mEAAmE;AACnE,kEAAkE;AAClE,0EAA0E;AAC1E,yEAAyE;AACzE,mBAAmB;AACnB,OAAO,wBAAwB,CAAA;AAG/B,sEAAsE;AACtE,0EAA0E;AAC1E,gCAAgC;AAChC,OAAO,EAAqB,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACrF,OAAO,EAEL,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,mBAAmB,GACpB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,cAAc,YAAY,CAAA;AAC1B,OAAO,EAA2B,eAAe,EAAE,MAAM,uBAAuB,CAAA"}
@@ -0,0 +1,31 @@
1
+ import { hozoActivateKeyDown, hozoActivateKeyUp } from './activate.ts';
2
+ /** What React hands a click handler on the element Hozo synthesized. */
3
+ type PressHandler = (event: never) => void;
4
+ /**
5
+ * The props that make an element a control, and unmake it when disabled.
6
+ *
7
+ * `tabIndex` is `-1` rather than absent when disabled: it leaves the tab
8
+ * order, which is the decision, while staying reachable by `focus()`,
9
+ * which is what focus management and roving tabindex need. See 001's
10
+ * rule 1a.
11
+ *
12
+ * Both branches carry the same keys so that spreading this never leaves a
13
+ * stale attribute behind from the previous render.
14
+ */
15
+ export declare function hozoInteractive(onPress?: PressHandler, disabled?: unknown): {
16
+ 'aria-disabled': boolean;
17
+ 'data-hozo-disabled': string;
18
+ tabIndex: number;
19
+ onClick: undefined;
20
+ onKeyDown: undefined;
21
+ onKeyUp: undefined;
22
+ } | {
23
+ 'aria-disabled': undefined;
24
+ 'data-hozo-disabled': undefined;
25
+ tabIndex: number;
26
+ onClick: PressHandler | undefined;
27
+ onKeyDown: typeof hozoActivateKeyDown;
28
+ onKeyUp: typeof hozoActivateKeyUp;
29
+ };
30
+ export {};
31
+ //# sourceMappingURL=interactive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactive.d.ts","sourceRoot":"","sources":["../src/interactive.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAEtE,wEAAwE;AACxE,KAAK,YAAY,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;AAE1C;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,OAAO;;;;;;;;;;;;;;EA+BzE"}
@@ -0,0 +1,64 @@
1
+ // Everything `disabled` means, in one place.
2
+ //
3
+ // `docs/decisions/001-disabled-and-focus.md` settles it as five things at
4
+ // once: inoperable, announced as disabled, present in the accessibility
5
+ // tree, out of the tab order, and -- for an element Hozo made interactive
6
+ // itself -- not activatable by Enter or Space either.
7
+ //
8
+ // Five things emitted as five independent expressions is exactly how they
9
+ // come apart, and they had. The compiled path announced `aria-disabled`
10
+ // and then ran the handler anyway; the fallback component in `@hozo/core`
11
+ // suppressed the handler but had no keyboard activation to suppress. Two
12
+ // paths, two different wrong answers, from one prop.
13
+ //
14
+ // So both call this instead. A drift between them now needs someone to
15
+ // edit this file and mean it.
16
+ //
17
+ // Only for elements Hozo had to synthesize -- a `<div role="button">`. A
18
+ // real `<button>` takes the `disabled` attribute and the browser does all
19
+ // five, which is why `Button` does not come through here.
20
+ import { hozoActivateKeyDown, hozoActivateKeyUp } from './activate.js';
21
+ /**
22
+ * The props that make an element a control, and unmake it when disabled.
23
+ *
24
+ * `tabIndex` is `-1` rather than absent when disabled: it leaves the tab
25
+ * order, which is the decision, while staying reachable by `focus()`,
26
+ * which is what focus management and roving tabindex need. See 001's
27
+ * rule 1a.
28
+ *
29
+ * Both branches carry the same keys so that spreading this never leaves a
30
+ * stale attribute behind from the previous render.
31
+ */
32
+ export function hozoInteractive(onPress, disabled) {
33
+ return disabled
34
+ ? {
35
+ 'aria-disabled': true,
36
+ // The styling hook, kept separate from how the state is said.
37
+ // `disabled:opacity-50` compiles to `[data-hozo-disabled]`, which
38
+ // works on any element -- `:disabled` matches form controls only,
39
+ // so on the `<div>` a Pressable becomes it matched nothing.
40
+ //
41
+ // An empty string, not `true`: React renders `data-x={false}` as
42
+ // the string `"false"` (unlike `aria-*` and unlike known boolean
43
+ // attributes), and `[data-hozo-disabled]` matches on presence, so
44
+ // a boolean here would have made every control permanently
45
+ // disabled-looking. `undefined` is the only value React omits.
46
+ 'data-hozo-disabled': '',
47
+ tabIndex: -1,
48
+ onClick: undefined,
49
+ onKeyDown: undefined,
50
+ onKeyUp: undefined,
51
+ }
52
+ : {
53
+ // Not `false`: an element that was never disabled says nothing
54
+ // about it, and `aria-disabled="false"` on every control in a page
55
+ // is noise a screen reader has to read past.
56
+ 'aria-disabled': undefined,
57
+ 'data-hozo-disabled': undefined,
58
+ tabIndex: 0,
59
+ onClick: onPress,
60
+ onKeyDown: hozoActivateKeyDown,
61
+ onKeyUp: hozoActivateKeyUp,
62
+ };
63
+ }
64
+ //# sourceMappingURL=interactive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactive.js","sourceRoot":"","sources":["../src/interactive.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,EAAE;AACF,0EAA0E;AAC1E,wEAAwE;AACxE,0EAA0E;AAC1E,sDAAsD;AACtD,EAAE;AACF,0EAA0E;AAC1E,wEAAwE;AACxE,0EAA0E;AAC1E,yEAAyE;AACzE,qDAAqD;AACrD,EAAE;AACF,uEAAuE;AACvE,8BAA8B;AAC9B,EAAE;AACF,yEAAyE;AACzE,0EAA0E;AAC1E,0DAA0D;AAE1D,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAKtE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAAC,OAAsB,EAAE,QAAkB;IACxE,OAAO,QAAQ;QACb,CAAC,CAAC;YACE,eAAe,EAAE,IAAI;YACrB,8DAA8D;YAC9D,kEAAkE;YAClE,kEAAkE;YAClE,4DAA4D;YAC5D,EAAE;YACF,iEAAiE;YACjE,iEAAiE;YACjE,kEAAkE;YAClE,2DAA2D;YAC3D,+DAA+D;YAC/D,oBAAoB,EAAE,EAAE;YACxB,QAAQ,EAAE,CAAC,CAAC;YACZ,OAAO,EAAE,SAAS;YAClB,SAAS,EAAE,SAAS;YACpB,OAAO,EAAE,SAAS;SACnB;QACH,CAAC,CAAC;YACE,+DAA+D;YAC/D,mEAAmE;YACnE,6CAA6C;YAC7C,eAAe,EAAE,SAAS;YAC1B,oBAAoB,EAAE,SAAS;YAC/B,QAAQ,EAAE,CAAC;YACX,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,mBAAmB;YAC9B,OAAO,EAAE,iBAAiB;SAC3B,CAAA;AACP,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { HozoNavigationAdapter } from './navigation.ts';
3
+ export interface HozoNavigationProviderProps {
4
+ adapter: HozoNavigationAdapter;
5
+ children?: ReactNode;
6
+ }
7
+ /** Internal provider used by the public `@hozo/navigation` integration. */
8
+ export declare function HozoNavigationProvider({ adapter, children }: HozoNavigationProviderProps): import("react").JSX.Element;
9
+ /** Returns null when an application deliberately has no router integration. */
10
+ export declare function useHozoNavigation(): HozoNavigationAdapter | null;
11
+ //# sourceMappingURL=navigation-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation-context.d.ts","sourceRoot":"","sources":["../src/navigation-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,SAAS,EAAc,MAAM,OAAO,CAAA;AAEjE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAI5D,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,qBAAqB,CAAA;IAC9B,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAED,2EAA2E;AAC3E,wBAAgB,sBAAsB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,2BAA2B,+BAExF;AAED,+EAA+E;AAC/E,wBAAgB,iBAAiB,IAAI,qBAAqB,GAAG,IAAI,CAEhE"}
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext } from 'react';
3
+ const NavigationContext = createContext(null);
4
+ /** Internal provider used by the public `@hozo/navigation` integration. */
5
+ export function HozoNavigationProvider({ adapter, children }) {
6
+ return _jsx(NavigationContext, { value: adapter, children: children });
7
+ }
8
+ /** Returns null when an application deliberately has no router integration. */
9
+ export function useHozoNavigation() {
10
+ return useContext(NavigationContext);
11
+ }
12
+ //# sourceMappingURL=navigation-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation-context.js","sourceRoot":"","sources":["../src/navigation-context.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAkB,UAAU,EAAE,MAAM,OAAO,CAAA;AAIjE,MAAM,iBAAiB,GAAG,aAAa,CAA+B,IAAI,CAAC,CAAA;AAO3E,2EAA2E;AAC3E,MAAM,UAAU,sBAAsB,CAAC,EAAE,OAAO,EAAE,QAAQ,EAA+B;IACvF,OAAO,KAAC,iBAAiB,IAAC,KAAK,EAAE,OAAO,YAAG,QAAQ,GAAqB,CAAA;AAC1E,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,iBAAiB;IAC/B,OAAO,UAAU,CAAC,iBAAiB,CAAC,CAAA;AACtC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { activateHozoNavigation, type HozoNavigationAdapter, type HozoNavigationFallback, type HozoNavigationRequest, prefetchHozoNavigation, } from './navigation.ts';
2
+ export { HozoNavigationProvider, type HozoNavigationProviderProps, useHozoNavigation, } from './navigation-context.tsx';
3
+ //# sourceMappingURL=navigation-entry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation-entry.d.ts","sourceRoot":"","sources":["../src/navigation-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,sBAAsB,GACvB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,sBAAsB,EACtB,KAAK,2BAA2B,EAChC,iBAAiB,GAClB,MAAM,0BAA0B,CAAA"}
@@ -0,0 +1,3 @@
1
+ export { activateHozoNavigation, prefetchHozoNavigation, } from './navigation.js';
2
+ export { HozoNavigationProvider, useHozoNavigation, } from './navigation-context.js';
3
+ //# sourceMappingURL=navigation-entry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation-entry.js","sourceRoot":"","sources":["../src/navigation-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EAItB,sBAAsB,GACvB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,sBAAsB,EAEtB,iBAAiB,GAClB,MAAM,yBAA0B,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './navigation-entry.ts';
2
+ //# sourceMappingURL=navigation-entry.native.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation-entry.native.d.ts","sourceRoot":"","sources":["../src/navigation-entry.native.ts"],"names":[],"mappings":"AAIA,cAAc,uBAAuB,CAAA"}
@@ -0,0 +1,6 @@
1
+ // Keep the subpath resolvable through package `react-native` conditions.
2
+ // The contract and context are platform-neutral; this file exists because
3
+ // every runtime subpath names its Native target explicitly in the generated
4
+ // package exports map.
5
+ export * from './navigation-entry.js';
6
+ //# sourceMappingURL=navigation-entry.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation-entry.native.js","sourceRoot":"","sources":["../src/navigation-entry.native.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,0EAA0E;AAC1E,4EAA4E;AAC5E,uBAAuB;AACvB,cAAc,uBAAuB,CAAA"}