@hozo/primitives 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -0
- package/README.md +1 -1
- package/dist/button-host-attributes.d.ts +20 -0
- package/dist/button-host-attributes.d.ts.map +1 -0
- package/dist/button-host-attributes.js +47 -0
- package/dist/button-host-attributes.js.map +1 -0
- package/dist/button-host-props.native.d.ts +8 -0
- package/dist/button-host-props.native.d.ts.map +1 -0
- package/dist/button-host-props.native.js +20 -0
- package/dist/button-host-props.native.js.map +1 -0
- package/dist/foundation.d.ts +45 -4
- package/dist/foundation.d.ts.map +1 -1
- package/dist/foundation.js +52 -6
- package/dist/foundation.js.map +1 -1
- package/dist/foundation.native.d.ts +34 -7
- package/dist/foundation.native.d.ts.map +1 -1
- package/dist/foundation.native.js +21 -5
- package/dist/foundation.native.js.map +1 -1
- package/dist/generated/button-dom-props.d.ts +11 -0
- package/dist/generated/button-dom-props.d.ts.map +1 -0
- package/dist/generated/button-dom-props.js +155 -0
- package/dist/generated/button-dom-props.js.map +1 -0
- package/dist/generated/button-props.d.ts +3 -0
- package/dist/generated/button-props.d.ts.map +1 -0
- package/dist/generated/button-props.js +5 -0
- package/dist/generated/button-props.js.map +1 -0
- package/dist/generated/button-props.native.d.ts +2 -0
- package/dist/generated/button-props.native.d.ts.map +1 -0
- package/dist/generated/button-props.native.js +2 -0
- package/dist/generated/button-props.native.js.map +1 -0
- package/dist/generated/inherited-leaves.d.ts +2 -0
- package/dist/generated/inherited-leaves.d.ts.map +1 -0
- package/dist/generated/inherited-leaves.js +4 -0
- package/dist/generated/inherited-leaves.js.map +1 -0
- package/dist/generated/native-disabled.d.ts +2 -0
- package/dist/generated/native-disabled.d.ts.map +1 -0
- package/dist/generated/native-disabled.js +2 -0
- package/dist/generated/native-disabled.js.map +1 -0
- package/dist/generated/text-input-dom-props.d.ts +7 -0
- package/dist/generated/text-input-dom-props.d.ts.map +1 -0
- package/dist/generated/text-input-dom-props.js +130 -0
- package/dist/generated/text-input-dom-props.js.map +1 -0
- package/dist/generated/text-input.native.d.ts +1 -1
- package/dist/generated/text-input.native.d.ts.map +1 -1
- package/dist/generated/text-input.native.js +1 -1
- package/dist/generated/text-input.native.js.map +1 -1
- package/dist/generated/text.d.ts +1 -1
- package/dist/generated/text.d.ts.map +1 -1
- package/dist/generated/text.js +4 -1
- package/dist/generated/text.js.map +1 -1
- package/dist/generated/view-dom-props.d.ts +8 -0
- package/dist/generated/view-dom-props.d.ts.map +1 -0
- package/dist/generated/view-dom-props.js +241 -0
- package/dist/generated/view-dom-props.js.map +1 -0
- package/dist/inherited-leaves.native.d.ts +28 -0
- package/dist/inherited-leaves.native.d.ts.map +1 -0
- package/dist/inherited-leaves.native.js +49 -0
- package/dist/inherited-leaves.native.js.map +1 -0
- package/dist/inherited-text-scope.d.ts +8 -0
- package/dist/inherited-text-scope.d.ts.map +1 -0
- package/dist/inherited-text-scope.js +10 -0
- package/dist/inherited-text-scope.js.map +1 -0
- package/dist/link.d.ts +4 -3
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +9 -1
- package/dist/link.js.map +1 -1
- package/dist/link.native.d.ts +1 -1
- package/dist/link.native.d.ts.map +1 -1
- package/dist/link.native.js +7 -1
- package/dist/link.native.js.map +1 -1
- package/dist/native-disabled.d.ts +13 -0
- package/dist/native-disabled.d.ts.map +1 -0
- package/dist/native-disabled.js +13 -0
- package/dist/native-disabled.js.map +1 -0
- package/dist/presence.native.d.ts.map +1 -1
- package/dist/presence.native.js +1 -1
- package/dist/presence.native.js.map +1 -1
- package/dist/pressable.d.ts.map +1 -1
- package/dist/pressable.js +8 -1
- package/dist/pressable.js.map +1 -1
- package/dist/pressable.native.d.ts +23 -2
- package/dist/pressable.native.d.ts.map +1 -1
- package/dist/pressable.native.js +57 -46
- package/dist/pressable.native.js.map +1 -1
- package/dist/text-color-transition.native.d.ts +12 -0
- package/dist/text-color-transition.native.d.ts.map +1 -0
- package/dist/text-color-transition.native.js +87 -0
- package/dist/text-color-transition.native.js.map +1 -0
- package/dist/text-input-props.native.d.ts +10 -0
- package/dist/text-input-props.native.d.ts.map +1 -0
- package/dist/text-input-props.native.js +15 -0
- package/dist/text-input-props.native.js.map +1 -0
- package/dist/text-input.native.d.ts +19 -0
- package/dist/text-input.native.d.ts.map +1 -0
- package/dist/text-input.native.js +32 -0
- package/dist/text-input.native.js.map +1 -0
- package/package.json +35 -7
- package/src/button-host-attributes.ts +56 -0
- package/src/button-host-props.native.ts +22 -0
- package/src/foundation.native.tsx +59 -8
- package/src/foundation.tsx +119 -5
- package/src/generated/button-dom-props.ts +159 -0
- package/src/generated/button-props.native.ts +1 -0
- package/src/generated/button-props.ts +4 -0
- package/src/generated/inherited-leaves.ts +3 -0
- package/src/generated/native-disabled.ts +1 -0
- package/src/generated/text-input-dom-props.ts +128 -0
- package/src/generated/text-input.native.ts +1 -4
- package/src/generated/text.ts +5 -0
- package/src/generated/view-dom-props.ts +267 -0
- package/src/inherited-leaves.native.tsx +83 -0
- package/src/inherited-text-scope.tsx +27 -0
- package/src/link.native.tsx +17 -13
- package/src/link.ts +12 -0
- package/src/native-disabled.ts +23 -0
- package/src/presence.native.tsx +1 -1
- package/src/pressable.native.tsx +90 -42
- package/src/pressable.ts +8 -1
- package/src/text-color-transition.native.ts +96 -0
- package/src/text-input-props.native.ts +26 -0
- package/src/text-input.native.tsx +57 -0
- package/dist/generated/animated.d.ts +0 -2
- package/dist/generated/animated.d.ts.map +0 -1
- package/dist/generated/animated.js +0 -3
- package/dist/generated/animated.js.map +0 -1
- package/dist/presence-context.d.ts +0 -15
- package/dist/presence-context.d.ts.map +0 -1
- package/dist/presence-context.js +0 -11
- package/dist/presence-context.js.map +0 -1
- package/dist/runtime-transition.native.d.ts +0 -30
- package/dist/runtime-transition.native.d.ts.map +0 -1
- package/dist/runtime-transition.native.js +0 -183
- package/dist/runtime-transition.native.js.map +0 -1
- package/src/generated/animated.ts +0 -6
- package/src/presence-context.ts +0 -27
- package/src/runtime-transition.native.tsx +0 -244
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,72 @@
|
|
|
1
1
|
# @hozo/primitives
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#2051](https://github.com/iray-tno/hozo/pull/2051) [`9a5c4ac`](https://github.com/iray-tno/hozo/commit/9a5c4ac57fdc996649a323c72b4be55aeb221cd7) Thanks [@iray-tno](https://github.com/iray-tno)! - On Native, text classes on a container now reach a `Text` the compiler cannot see: one rendered by a component from another file, passed in as `children`, or returned by an expression. `<View className="text-red-500 text-lg"><Label /></View>` colours and sizes `Label`'s text, as it does on the Web. Before, React Native's `Text` inherited only from an enclosing `Text`, so the classes stopped at the component boundary and nothing reported it.
|
|
8
|
+
|
|
9
|
+
Where the compiler can see the `Text`, nothing changes: the classes are still copied onto it. Only what it cannot see is read at run time. An outermost `Text` that does not set all of colour, size, weight, line height, letter spacing, alignment and transform reads the rest from the nearest container. A container whose children include one it cannot see wraps them in a scope that renders no host. See [decision 013](https://github.com/iray-tno/hozo/blob/main/docs/decisions/013-text-inheritance-compiled-where-visible.md).
|
|
10
|
+
|
|
11
|
+
To keep the previous behaviour, pass `nativeTextInheritance: 'compiled'` to `withHozo`.
|
|
12
|
+
|
|
13
|
+
- [#2059](https://github.com/iray-tno/hozo/pull/2059) [`cca1211`](https://github.com/iray-tno/hozo/commit/cca1211b176ec411112275399fc582a92a50efbe) Thanks [@iray-tno](https://github.com/iray-tno)! - RFC 006's whole-component Native text inheritance route is removed, now that [decision 013](https://github.com/iray-tno/hozo/blob/main/docs/decisions/013-text-inheritance-compiled-where-visible.md) is the default. The internal `textInheritance` and `textStatic` compile options are gone. So are the generated components that only that route emitted: `HozoInheritedText`, `HozoInheritedView`, `HozoInheritedRelativeText`, `HozoInheritedPressable` and `HozoInheritedLabel`, with their `@hozo/core/generated/*` and `@hozo/primitives/generated/*` entries. Compiled output never referred to them unless the internal option was set. Native Chip's internal `hozoInheritedLabel` and `hozoInheritedText` props are gone too, along with the colour-motion field of the inheritance protocol, which only RFC 006's pressable published.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#1760](https://github.com/iray-tno/hozo/pull/1760) [`e5c848d`](https://github.com/iray-tno/hozo/commit/e5c848de8f4ff732fc7fc4a2d343e34938df1800) Thanks [@iray-tno](https://github.com/iray-tno)! - `Button` takes `accessibilityState` and `aria-controls`, so a menu or disclosure trigger can say whether what it opens is open and which element that is. On the Web they become `aria-expanded` and its kin and `aria-controls`, compiled or not, named or spread. On React Native `accessibilityState` reaches the Pressable and `aria-controls` is dropped. `accessibilityState.disabled` disables the button as the `disabled` prop does.
|
|
18
|
+
|
|
19
|
+
- [#1684](https://github.com/iray-tno/hozo/pull/1684) [`6cf46e3`](https://github.com/iray-tno/hozo/commit/6cf46e30640459d327305ffce8b38d26e27b3a9b) Thanks [@iray-tno](https://github.com/iray-tno)! - `Image` declares `width`, `height`, `loading`, `decoding` and `fetchPriority`. The uncompiled Web `Image` now forwards them to the `<img>`, as compiled output already did, so a server-rendered page reserves the image's box and lazy-loads it with or without the compiler ([#1674](https://github.com/iray-tno/hozo/issues/1674)). On React Native, `width` and `height` are React Native's own props, and the three loading hints type-check but are ignored.
|
|
20
|
+
|
|
21
|
+
- [#2158](https://github.com/iray-tno/hozo/pull/2158) [`b4bc0e3`](https://github.com/iray-tno/hozo/commit/b4bc0e3bec63c02a0d97b55b256714985385372f) Thanks [@iray-tno](https://github.com/iray-tno)! - `group-hover:`, `group-focus:`, `group-focus-visible:` and `group-pressed:` now work on a `View` inside a `Pressable`, `Button` or `Link` on React Native, as they already did on a `Text`. Before, a `group` card could restyle its label but not the box beside it, and the build refused the View with a message saying nothing above it was a Pressable. A `group-*:` the Pressable does not hand down, such as `group-aria-checked:`, is still refused, now with a message that says which state is missing instead of claiming there is no Pressable.
|
|
22
|
+
- Updated dependencies [[`cb4b456`](https://github.com/iray-tno/hozo/commit/cb4b4564ddb95d7ecb6f729433bf5c956788b53e), [`ba5beaf`](https://github.com/iray-tno/hozo/commit/ba5beaf2fbaff50a5b6bb1595ee156cae9dd5a1c), [`43d6add`](https://github.com/iray-tno/hozo/commit/43d6add1b83dce0acda189ce9a1b610fb4a9d70d), [`0001fc4`](https://github.com/iray-tno/hozo/commit/0001fc442e38955770974fb5377002e4deb4b95f), [`ed04074`](https://github.com/iray-tno/hozo/commit/ed04074de82890b87590afb537a0bea99b2751a7), [`6cf46e3`](https://github.com/iray-tno/hozo/commit/6cf46e30640459d327305ffce8b38d26e27b3a9b), [`052b447`](https://github.com/iray-tno/hozo/commit/052b447351a669a12c5b8ced61bef5d07dc8a604), [`43680e3`](https://github.com/iray-tno/hozo/commit/43680e3643ba9f3f6e01f5c7aa885feb8e5c7b04), [`35cc5c3`](https://github.com/iray-tno/hozo/commit/35cc5c31ce90497de9a6f345e884af2d20a6bc60), [`5c823ee`](https://github.com/iray-tno/hozo/commit/5c823ee87f1996f7011290af68702ef7f19e5388), [`70643e9`](https://github.com/iray-tno/hozo/commit/70643e959d229a75fcdbd1316f9a972efb4a2622), [`3a3a8d5`](https://github.com/iray-tno/hozo/commit/3a3a8d52d64d0d580d9afaa298977c5c33f295f2), [`45eda5b`](https://github.com/iray-tno/hozo/commit/45eda5b451bdf1449c7c16172c03b2a9e743aaa6), [`cca1211`](https://github.com/iray-tno/hozo/commit/cca1211b176ec411112275399fc582a92a50efbe), [`4f62450`](https://github.com/iray-tno/hozo/commit/4f624503a4fb9f4af6f699f7d2deb55b69a72c36), [`ddd7c73`](https://github.com/iray-tno/hozo/commit/ddd7c73d09768ad8fbcf55c40859729b7271ea1a), [`2d28017`](https://github.com/iray-tno/hozo/commit/2d2801735d14c61193610e74bc6178f15b79d07e), [`cabc969`](https://github.com/iray-tno/hozo/commit/cabc9695ae805afa2c690aebcad5657f76f95eac), [`3f1754a`](https://github.com/iray-tno/hozo/commit/3f1754a523e62dc44ccc3da7294e9510e5203302), [`b3cf38b`](https://github.com/iray-tno/hozo/commit/b3cf38b30f2fe748c4f73110d01de2566826355a)]:
|
|
23
|
+
- @hozo/engine@0.5.0
|
|
24
|
+
- @hozo/behaviors@0.5.0
|
|
25
|
+
|
|
26
|
+
## 0.4.0
|
|
27
|
+
|
|
28
|
+
### Minor Changes
|
|
29
|
+
|
|
30
|
+
- [#1462](https://github.com/iray-tno/hozo/pull/1462) [`b0c6f22`](https://github.com/iray-tno/hozo/commit/b0c6f220c74d8a5c5a0c13bcf5fc9f8b97a25419) Thanks [@iray-tno](https://github.com/iray-tno)! - `HozoAnimated` can animate position and size (`start`, `end`, `top`, `left`, `width`, `height` and the rest) between numbers, when its transition spec names them in the new `properties` list (`inset-inline-start`, `width`, `all`, ...). Without `properties` nothing new animates.
|
|
31
|
+
|
|
32
|
+
- [#1462](https://github.com/iray-tno/hozo/pull/1462) [`add3e7b`](https://github.com/iray-tno/hozo/commit/add3e7b2c5a152c770eabee7d09d723e925958e1) Thanks [@iray-tno](https://github.com/iray-tno)! - `HozoAnimated` and `PresenceContext` move from `@hozo/primitives` to `@hozo/engine` (`@hozo/engine/generated/animated`), so `@hozo/patterns` can run them. `@hozo/primitives/generated/animated` is gone; compiled output imports them through `@hozo/core/generated/animated` as before.
|
|
33
|
+
|
|
34
|
+
- [#1597](https://github.com/iray-tno/hozo/pull/1597) [`b3df5b7`](https://github.com/iray-tno/hozo/commit/b3df5b73a8ec104fe407d89472e4339411de311d) Thanks [@iray-tno](https://github.com/iray-tno)! - React Native 0.87 is now the lowest supported version (`react-native: >=0.87`), and `@hozo/media`'s Expo peers move to SDK 58 (`expo-video`, `expo-audio` and `expo-asset` `>=58 <59`). Native gradients go under `backgroundImage` again: the `experimental_backgroundImage` spelling existed only for React Native 0.86, which read nothing else.
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- [#1099](https://github.com/iray-tno/hozo/pull/1099) [`d7dd5b9`](https://github.com/iray-tno/hozo/commit/d7dd5b9d91a77c6cf647ba2de6fb321f8e558613) Thanks [@iray-tno](https://github.com/iray-tno)! - A `Button` whose props reach it through a rest spread (`function B({ href, ...rest }) { return <Button {...rest} /> }`) works again on the Web. Since the compiler started deciding such a Button's element at build time, the spread reached the `<button>` or `<a>` raw, so `onPress` never became `onClick` and clicking an `@hozo/ui` Button did nothing. The spread now goes through the same translation as the uncompiled `Button`: `onPress`, `accessibilityLabel`, `accessibilityHint`, `testID`, `nativeID`, `disabled` and `data-*`. On an anchor, a press is still suppressed while disabled.
|
|
39
|
+
|
|
40
|
+
- [#1148](https://github.com/iray-tno/hozo/pull/1148) [`27536fc`](https://github.com/iray-tno/hozo/commit/27536fc602947b8928df7fa4d8940363fc0e3a67) Thanks [@iray-tno](https://github.com/iray-tno)! - On the Web a `Button` forwards `tabIndex`, so a `Button` in a `Toolbar` takes the roving tab stop the toolbar hands it, and the toolbar is one tab stop. Before this, every item stayed in the tab order. On a link that is disabled, the tab stop is still `-1`.
|
|
41
|
+
|
|
42
|
+
- [#1142](https://github.com/iray-tno/hozo/pull/1142) [`99892e2`](https://github.com/iray-tno/hozo/commit/99892e25f536991e2966aa60769bd7155d5d8336) Thanks [@iray-tno](https://github.com/iray-tno)! - A `Button` forwards what a wrapper needs to make it a trigger. That means `Tooltip` now opens around a `Button`, including `@hozo/ui`'s, whether it is compiled or not.
|
|
43
|
+
|
|
44
|
+
- On the Web: `ref`, `onFocus`, `onBlur`, `onKeyDown`, `onPointerEnter`, `onPointerLeave` and `aria-describedby`.
|
|
45
|
+
- On React Native: `ref`, `onFocus`, `onBlur`, `onHoverIn`, `onHoverOut` and `onLongPress`.
|
|
46
|
+
|
|
47
|
+
Before this, the uncompiled `Button` and the translation of a spread onto a compiled one both dropped these props. Other props it does not name are still not forwarded.
|
|
48
|
+
|
|
49
|
+
- [#1384](https://github.com/iray-tno/hozo/pull/1384) [`1b54676`](https://github.com/iray-tno/hozo/commit/1b54676fbc476f848d2e834a9443fde0bf888ce9) Thanks [@iray-tno](https://github.com/iray-tno)! - A windowed `CodeBlock` now windows on the Web too: only the lines near the visible ones are mounted, the rest are held as space, and an unwrapped block keeps its scrolling width with a hidden copy of the widest line. The lines stay one `<pre><code>`.
|
|
50
|
+
|
|
51
|
+
- [#1213](https://github.com/iray-tno/hozo/pull/1213) [`ffd5b6b`](https://github.com/iray-tno/hozo/commit/ffd5b6bbb0021d512d416fc5d8ae7441cc18c463) Thanks [@iray-tno](https://github.com/iray-tno)! - On the Web, a server-rendered `Image` whose `src` has already failed before hydration (`complete && naturalWidth === 0` when the ref attaches) now falls back to `defaultSource`, both directly and through a compiled spread.
|
|
52
|
+
|
|
53
|
+
- [#1039](https://github.com/iray-tno/hozo/pull/1039) [`cf7773e`](https://github.com/iray-tno/hozo/commit/cf7773edcfd5f9d9cb42e35489ce1b15e35312bb) Thanks [@iray-tno](https://github.com/iray-tno)! - A Text nested in `@hozo/ui`'s `Checkbox` or `Switch` label now takes their `hover:`, `active:` and `focus-visible:` text classes on Native. `@hozo/patterns`' pressable provides its state through `HozoInteractionContext`, now in `@hozo/behaviors/pressable-interaction` and shared with `@hozo/primitives`, so the `HozoText` a caller's Text compiles to reads it.
|
|
54
|
+
|
|
55
|
+
- [#1155](https://github.com/iray-tno/hozo/pull/1155) [`416d627`](https://github.com/iray-tno/hozo/commit/416d627e8afc6a3f321c95dbe1f74b630d173d7b) Thanks [@iray-tno](https://github.com/iray-tno)! - On the Web, a spread onto a compiled `View`, `Text` or `Image` keeps the props that need the element.
|
|
56
|
+
|
|
57
|
+
- **`onLayout`** is called on mount and when the layout changes, as it is uncompiled. It is not called again on a re-render.
|
|
58
|
+
- **The responder props** (`onStartShouldSetResponder`, `onResponderGrant`, `onResponderMove`, …) claim and release the pointer on a `View`.
|
|
59
|
+
- **An `Image` whose `src` fails to load falls back to `defaultSource`.**
|
|
60
|
+
|
|
61
|
+
Before this, these reached the DOM raw and did nothing. The spread's translation now adds a callback ref when the spread carries one of them. `@hozo/engine` exports `createSpreadResponder` for it: the responder without a hook.
|
|
62
|
+
|
|
63
|
+
- [#1119](https://github.com/iray-tno/hozo/pull/1119) [`242253d`](https://github.com/iray-tno/hozo/commit/242253da3910698e0838d74cbc9d51e1ca5995d6) Thanks [@iray-tno](https://github.com/iray-tno)! - A `TextInput` whose props reach it through a spread (`function F(props) { return <TextInput {...props} /> }`) works on the Web. The spread reached the `<input>` or `<textarea>` raw, so `onChangeText` was never called and a controlled `@hozo/ui` `Input` could not be typed into. The spread now goes through the same translation as the uncompiled `TextInput`: `onChangeText`, `onSubmitEditing`, `editable`, `keyboardType`, `secureTextEntry`, `returnKeyType`, `autoCorrect`, the `accessibility*` props, `testID` and `nativeID`. A named `onChangeText` that is `undefined` no longer throws when the field is typed into.
|
|
64
|
+
|
|
65
|
+
- [#1124](https://github.com/iray-tno/hozo/pull/1124) [`e7d97e9`](https://github.com/iray-tno/hozo/commit/e7d97e981615355534d0ea20c4a70410556cbda4) Thanks [@iray-tno](https://github.com/iray-tno)! - A `View`, `Text`, `Image` or document primitive whose props reach it through a spread (`function Box(props) { return <View {...props} /> }`) keeps them on the Web. The spread reached the element raw, so `accessibilityLabel`, `accessibilityHint`, `testID`, `nativeID`, `pointerEvents`, `accessibilityState`, `accessibilityValue` and `accessibilityLiveRegion` became unknown attributes, and the element lost its accessible name. The spread now goes through the same translation as the uncompiled primitive. On an `Image` it also resolves an object or list `src` and uses the accessibility label as `alt`.
|
|
66
|
+
- Updated dependencies [[`4270a72`](https://github.com/iray-tno/hozo/commit/4270a727b14605d7ff5c9831238e60cb518e3ed6), [`1c052da`](https://github.com/iray-tno/hozo/commit/1c052dad66426e8a4acd462c776f161249330c35), [`480e00a`](https://github.com/iray-tno/hozo/commit/480e00a0d6e165b92beb8dbf9310710fcceb7fd1), [`fac2f53`](https://github.com/iray-tno/hozo/commit/fac2f53a7636c7373cf22c4d49fcf5a137bb08ec), [`add3e7b`](https://github.com/iray-tno/hozo/commit/add3e7b2c5a152c770eabee7d09d723e925958e1), [`e4734c8`](https://github.com/iray-tno/hozo/commit/e4734c832c6469edc4ba88a7e09209b2b2ccd29b), [`b59995e`](https://github.com/iray-tno/hozo/commit/b59995e108e4cc9b6d093c2487cebece0d02a707), [`d5a1a1e`](https://github.com/iray-tno/hozo/commit/d5a1a1ee6a55dd50c6c2f91289a11a8665dd9d74), [`c1ca21a`](https://github.com/iray-tno/hozo/commit/c1ca21afee0e3f4dd92110570f3ff3775b01c4cf), [`5cbbb5d`](https://github.com/iray-tno/hozo/commit/5cbbb5de2ba68dd8e44c1939535a84f5325bb950), [`cf7773e`](https://github.com/iray-tno/hozo/commit/cf7773edcfd5f9d9cb42e35489ce1b15e35312bb), [`c4696a4`](https://github.com/iray-tno/hozo/commit/c4696a4660ceb546fc9e29bc18d1fe73979681e5), [`b3df5b7`](https://github.com/iray-tno/hozo/commit/b3df5b73a8ec104fe407d89472e4339411de311d), [`c9a3b4d`](https://github.com/iray-tno/hozo/commit/c9a3b4d61541024c66165c91a4b7e2a75c9a203c), [`416d627`](https://github.com/iray-tno/hozo/commit/416d627e8afc6a3f321c95dbe1f74b630d173d7b), [`37a9151`](https://github.com/iray-tno/hozo/commit/37a915152634d8e25dfa9b2958661d4bc8f0a134)]:
|
|
67
|
+
- @hozo/behaviors@0.4.0
|
|
68
|
+
- @hozo/engine@0.4.0
|
|
69
|
+
|
|
3
70
|
## 0.3.0
|
|
4
71
|
|
|
5
72
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -71,6 +71,6 @@ backdrop blur. Those have no Web implementation to speak of, because they lower
|
|
|
71
71
|
|
|
72
72
|
---
|
|
73
73
|
|
|
74
|
-
Part of [Hozo](https://iray-tno.github.io/hozo/), a
|
|
74
|
+
Part of [Hozo](https://iray-tno.github.io/hozo/), a universal UI framework for React Native, compiled by Rust, with native semantics on every platform, first-class accessibility, and diagnostics for humans and AI agents alike. Most applications install [`@hozo/core`](https://www.npmjs.com/package/@hozo/core) and one build integration; see [Getting started](https://iray-tno.github.io/hozo/docs/getting-started/). Source and issues: [github.com/iray-tno/hozo](https://github.com/iray-tno/hozo).
|
|
75
75
|
|
|
76
76
|
<!-- /generated: package-footer -->
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** The documented DOM metadata channel; never forward arbitrary leftover props. */
|
|
2
|
+
export interface ButtonDataProps {
|
|
3
|
+
[name: `data-${string}`]: string | number | boolean | undefined;
|
|
4
|
+
}
|
|
5
|
+
export declare function buttonDataProps(props: ButtonDataProps): ButtonDataProps;
|
|
6
|
+
/**
|
|
7
|
+
* What a wrapper hands a Button to make it a trigger, by platform.
|
|
8
|
+
*
|
|
9
|
+
* `Tooltip` clones its child with a ref to position against, the handlers
|
|
10
|
+
* that open it, and -- on the Web -- `aria-describedby` naming the bubble.
|
|
11
|
+
* A Button that dropped them was a trigger nothing could hear (#1137).
|
|
12
|
+
* `Toolbar` hands its items a roving `tabIndex` on the Web, and a Button
|
|
13
|
+
* that dropped it left every item a tab stop of its own.
|
|
14
|
+
* Still a list rather than "every leftover prop": the rule above stands,
|
|
15
|
+
* and these are the ones a known wrapper writes.
|
|
16
|
+
*/
|
|
17
|
+
export declare const BUTTON_TRIGGER_PROPS_WEB: readonly ['ref', 'onFocus', 'onBlur', 'onKeyDown', 'onPointerEnter', 'onPointerLeave', 'aria-describedby', 'tabIndex'];
|
|
18
|
+
export declare const BUTTON_TRIGGER_PROPS_NATIVE: readonly ['ref', 'onFocus', 'onBlur', 'onHoverIn', 'onHoverOut', 'onLongPress'];
|
|
19
|
+
export declare function buttonTriggerProps(props: Record<string, unknown>, names: readonly string[]): Record<string, unknown>;
|
|
20
|
+
//# sourceMappingURL=button-host-attributes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-host-attributes.d.ts","sourceRoot":"","sources":["../src/button-host-attributes.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,MAAM,WAAW,eAAe;IAC9B,CAAC,IAAI,EAAE,QAAQ,MAAM,EAAE,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAA;CAChE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,eAAe,GAAG,eAAe,CAQvE;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,wBAAwB,YACnC,KAAK,EACL,SAAS,EACT,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,CACF,CAAA;AAEV,eAAO,MAAM,2BAA2B,YACtC,KAAK,EACL,SAAS,EACT,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,aAAa,CACL,CAAA;AAEV,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,KAAK,EAAE,SAAS,MAAM,EAAE,GACvB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAMzB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export function buttonDataProps(props) {
|
|
2
|
+
const data = {};
|
|
3
|
+
for (const name in props) {
|
|
4
|
+
if (Object.hasOwn(props, name) && name.startsWith('data-')) {
|
|
5
|
+
data[name] = props[name];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return data;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* What a wrapper hands a Button to make it a trigger, by platform.
|
|
12
|
+
*
|
|
13
|
+
* `Tooltip` clones its child with a ref to position against, the handlers
|
|
14
|
+
* that open it, and -- on the Web -- `aria-describedby` naming the bubble.
|
|
15
|
+
* A Button that dropped them was a trigger nothing could hear (#1137).
|
|
16
|
+
* `Toolbar` hands its items a roving `tabIndex` on the Web, and a Button
|
|
17
|
+
* that dropped it left every item a tab stop of its own.
|
|
18
|
+
* Still a list rather than "every leftover prop": the rule above stands,
|
|
19
|
+
* and these are the ones a known wrapper writes.
|
|
20
|
+
*/
|
|
21
|
+
export const BUTTON_TRIGGER_PROPS_WEB = [
|
|
22
|
+
'ref',
|
|
23
|
+
'onFocus',
|
|
24
|
+
'onBlur',
|
|
25
|
+
'onKeyDown',
|
|
26
|
+
'onPointerEnter',
|
|
27
|
+
'onPointerLeave',
|
|
28
|
+
'aria-describedby',
|
|
29
|
+
'tabIndex',
|
|
30
|
+
];
|
|
31
|
+
export const BUTTON_TRIGGER_PROPS_NATIVE = [
|
|
32
|
+
'ref',
|
|
33
|
+
'onFocus',
|
|
34
|
+
'onBlur',
|
|
35
|
+
'onHoverIn',
|
|
36
|
+
'onHoverOut',
|
|
37
|
+
'onLongPress',
|
|
38
|
+
];
|
|
39
|
+
export function buttonTriggerProps(props, names) {
|
|
40
|
+
const out = {};
|
|
41
|
+
for (const name of names) {
|
|
42
|
+
if (Object.hasOwn(props, name))
|
|
43
|
+
out[name] = props[name];
|
|
44
|
+
}
|
|
45
|
+
return out;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=button-host-attributes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-host-attributes.js","sourceRoot":"","sources":["../src/button-host-attributes.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,eAAe,CAAC,KAAsB;IACpD,MAAM,IAAI,GAAoB,EAAE,CAAA;IAChC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YAC3D,IAAI,CAAC,IAAwB,CAAC,GAAG,KAAK,CAAC,IAAwB,CAAC,CAAA;QAClE,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,KAAK;IACL,SAAS;IACT,QAAQ;IACR,WAAW;IACX,gBAAgB;IAChB,gBAAgB;IAChB,kBAAkB;IAClB,UAAU;CACF,CAAA;AAEV,MAAM,CAAC,MAAM,2BAA2B,GAAG;IACzC,KAAK;IACL,SAAS;IACT,QAAQ;IACR,WAAW;IACX,YAAY;IACZ,aAAa;CACL,CAAA;AAEV,MAAM,UAAU,kBAAkB,CAChC,KAA8B,EAC9B,KAAwB;IAExB,MAAM,GAAG,GAA4B,EAAE,CAAA;IACvC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC;YAAE,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,CAAA;IACzD,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Preserve evaluation/identity of authored props, but name the platform
|
|
3
|
+
* boundary: RN has no DOM dataset. Metadata is not an accessibility label
|
|
4
|
+
* or nativeID. Do not fabricate either from an application's data channel.
|
|
5
|
+
* The compiler uses this for opaque spreads; the fallback uses it too.
|
|
6
|
+
*/
|
|
7
|
+
export declare function hozoButtonProps<T>(props: T): T;
|
|
8
|
+
//# sourceMappingURL=button-host-props.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-host-props.native.d.ts","sourceRoot":"","sources":["../src/button-host-props.native.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAa9C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
let warned = false;
|
|
2
|
+
/**
|
|
3
|
+
* Preserve evaluation/identity of authored props, but name the platform
|
|
4
|
+
* boundary: RN has no DOM dataset. Metadata is not an accessibility label
|
|
5
|
+
* or nativeID. Do not fabricate either from an application's data channel.
|
|
6
|
+
* The compiler uses this for opaque spreads; the fallback uses it too.
|
|
7
|
+
*/
|
|
8
|
+
export function hozoButtonProps(props) {
|
|
9
|
+
if (!warned && props !== null && typeof props === 'object') {
|
|
10
|
+
for (const name in props) {
|
|
11
|
+
if (Object.hasOwn(props, name) && name.startsWith('data-')) {
|
|
12
|
+
warned = true;
|
|
13
|
+
console.warn('[hozo] Button data-* metadata requires a Web DOM dataset; React Native does not consume it. nativeID remains available on both platforms. No data values are mapped to accessibility props.');
|
|
14
|
+
break;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return props;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=button-host-props.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-host-props.native.js","sourceRoot":"","sources":["../src/button-host-props.native.ts"],"names":[],"mappings":"AAAA,IAAI,MAAM,GAAG,KAAK,CAAA;AAElB;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAI,KAAQ;IACzC,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC3D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC3D,MAAM,GAAG,IAAI,CAAA;gBACb,OAAO,CAAC,IAAI,CACV,6LAA6L,CAC9L,CAAA;gBACD,MAAK;YACP,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC"}
|
package/dist/foundation.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type HozoDomStyle, type ResponderProps } from '@hozo/engine';
|
|
2
|
-
import { type AriaRole, type CSSProperties, type MouseEventHandler, type ReactNode, type Ref } from 'react';
|
|
2
|
+
import { type AriaRole, type CSSProperties, type FocusEventHandler, type KeyboardEventHandler, type MouseEventHandler, type PointerEventHandler, type ReactNode, type Ref } from 'react';
|
|
3
|
+
import { type ButtonDataProps } from './button-host-attributes.ts';
|
|
3
4
|
import { HozoPressable, type HozoPressableProps } from './pressable.ts';
|
|
4
5
|
import { HozoTextInput, type HozoTextInputProps } from './text-input.ts';
|
|
5
6
|
export type { HozoResponderEvent, HozoResponderTouch, HozoTouchHistory, HozoTouchTrack, ResponderProps, } from '@hozo/engine';
|
|
@@ -57,6 +58,16 @@ export interface ImageProps extends UniversalProps {
|
|
|
57
58
|
defaultSource?: HozoImageSource;
|
|
58
59
|
alt?: string;
|
|
59
60
|
accessibilityLabel?: string;
|
|
61
|
+
/**
|
|
62
|
+
* The image's intrinsic size, so the browser reserves its box before the
|
|
63
|
+
* file arrives (#1674). React Native's `Image` takes the same two props.
|
|
64
|
+
*/
|
|
65
|
+
width?: number;
|
|
66
|
+
height?: number;
|
|
67
|
+
/** Web only; React Native ignores them. */
|
|
68
|
+
loading?: 'eager' | 'lazy';
|
|
69
|
+
decoding?: 'async' | 'auto' | 'sync';
|
|
70
|
+
fetchPriority?: 'auto' | 'high' | 'low';
|
|
60
71
|
onLoad?: (event: unknown) => void;
|
|
61
72
|
onError?: (event: unknown) => void;
|
|
62
73
|
ref?: Ref<HTMLImageElement>;
|
|
@@ -66,7 +77,7 @@ export interface HozoImageSourceObject {
|
|
|
66
77
|
default?: string;
|
|
67
78
|
}
|
|
68
79
|
export type HozoImageSource = string | number | HozoImageSourceObject | readonly HozoImageSourceObject[];
|
|
69
|
-
export declare function Image({ className, src, defaultSource, alt, accessibilityLabel, onLoad, onError, onLayout, ref, ...universal }: ImageProps): import("react").JSX.Element;
|
|
80
|
+
export declare function Image({ className, src, defaultSource, alt, accessibilityLabel, width, height, loading, decoding, fetchPriority, onLoad, onError, onLayout, ref, ...universal }: ImageProps): import("react").JSX.Element;
|
|
70
81
|
export { HozoPressable as Pressable, type HozoPressableProps as PressableProps, HozoTextInput as TextInput, type HozoTextInputProps as TextInputProps, };
|
|
71
82
|
export interface LinkProps {
|
|
72
83
|
className?: string;
|
|
@@ -85,9 +96,10 @@ export interface LinkProps {
|
|
|
85
96
|
replace?: boolean;
|
|
86
97
|
prefetch?: boolean;
|
|
87
98
|
onPress?: MouseEventHandler<HTMLAnchorElement>;
|
|
99
|
+
disabled?: boolean;
|
|
88
100
|
}
|
|
89
101
|
export declare function Link({ children, ...props }: LinkProps): import("react").JSX.Element;
|
|
90
|
-
export interface ButtonProps {
|
|
102
|
+
export interface ButtonProps extends ButtonDataProps {
|
|
91
103
|
className?: string;
|
|
92
104
|
children?: ReactNode;
|
|
93
105
|
onPress?: MouseEventHandler<HTMLElement>;
|
|
@@ -102,6 +114,35 @@ export interface ButtonProps {
|
|
|
102
114
|
rel?: string;
|
|
103
115
|
download?: boolean | string;
|
|
104
116
|
testID?: string;
|
|
117
|
+
/** Stable host ID: DOM id on Web, nativeID on React Native. */
|
|
118
|
+
nativeID?: string;
|
|
119
|
+
/**
|
|
120
|
+
* What a wrapper writes to make this a trigger -- `Tooltip` positions
|
|
121
|
+
* against the ref, opens on these handlers, and names its bubble with
|
|
122
|
+
* `aria-describedby` (#1137). Forwarded to the element as given.
|
|
123
|
+
*/
|
|
124
|
+
ref?: Ref<HTMLElement>;
|
|
125
|
+
onFocus?: FocusEventHandler<HTMLElement>;
|
|
126
|
+
onBlur?: FocusEventHandler<HTMLElement>;
|
|
127
|
+
onKeyDown?: KeyboardEventHandler<HTMLElement>;
|
|
128
|
+
onPointerEnter?: PointerEventHandler<HTMLElement>;
|
|
129
|
+
onPointerLeave?: PointerEventHandler<HTMLElement>;
|
|
130
|
+
'aria-describedby'?: string;
|
|
131
|
+
/** A roving tab stop, as `Toolbar` hands its items. */
|
|
132
|
+
tabIndex?: number;
|
|
133
|
+
/**
|
|
134
|
+
* The same state `View` and `Pressable` take: a menu or disclosure trigger
|
|
135
|
+
* says whether what it opens is open with `expanded` (#1704). Becomes
|
|
136
|
+
* `aria-*` on the Web and `accessibilityState` on React Native.
|
|
137
|
+
* `disabled` here disables the button as the `disabled` prop does.
|
|
138
|
+
*/
|
|
139
|
+
accessibilityState?: UniversalProps['accessibilityState'];
|
|
140
|
+
/**
|
|
141
|
+
* The id of what this button opens or changes, beside `expanded`. Web
|
|
142
|
+
* only: React Native has no relationship between views to put it in, and
|
|
143
|
+
* dropping it changes nothing that can be seen or pressed there.
|
|
144
|
+
*/
|
|
145
|
+
'aria-controls'?: string;
|
|
105
146
|
}
|
|
106
|
-
export declare function Button({ className, children, onPress,
|
|
147
|
+
export declare function Button({ className, children, onPress, accessibilityLabel, accessibilityHint, href, external, replace, prefetch, target, rel, download, testID, nativeID, accessibilityState: state, 'aria-controls': controls, disabled: disabledProp, ...metadata }: ButtonProps): import("react").JSX.Element;
|
|
107
148
|
//# sourceMappingURL=foundation.d.ts.map
|
package/dist/foundation.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foundation.d.ts","sourceRoot":"","sources":["../src/foundation.tsx"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,YAAY,EAIjB,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,SAAS,EACd,KAAK,GAAG,EAKT,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"foundation.d.ts","sourceRoot":"","sources":["../src/foundation.tsx"],"names":[],"mappings":"AAKA,OAAO,EACL,KAAK,YAAY,EAIjB,KAAK,cAAc,EAEpB,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,GAAG,EAKT,MAAM,OAAO,CAAA;AACd,OAAO,EAEL,KAAK,eAAe,EAGrB,MAAM,6BAA6B,CAAA;AAEpC,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,M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CAAC,CAAA;IAC7C,cAAc,CAAC,EAAE,mBAAmB,CAAC,WAAW,CAAC,CAAA;IACjD,cAAc,CAAC,EAAE,mBAAmB,CAAC,WAAW,CAAC,CAAA;IACjD,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,uDAAuD;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,cAAc,CAAC,oBAAoB,CAAC,CAAA;IACzD;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,wBAAgB,MAAM,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,OAAO,EACP,kBAAkB,EAClB,iBAAiB,EACjB,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,MAAM,EACN,GAAG,EACH,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,kBAAkB,EAAE,KAAK,EACzB,eAAe,EAAE,QAAQ,EACzB,QAAQ,EAAE,YAAY,EACtB,GAAG,QAAQ,EACZ,EAAE,WAAW,+BAwDb"}
|
package/dist/foundation.js
CHANGED
|
@@ -5,6 +5,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
5
5
|
// requirement.
|
|
6
6
|
import { hozoDomStyle, hozoViewBase, hozoViewClassName, useResponderDomProps, } from '@hozo/engine';
|
|
7
7
|
import { useCallback, useEffect, useRef, useState, } from 'react';
|
|
8
|
+
import { BUTTON_TRIGGER_PROPS_WEB, buttonDataProps, buttonTriggerProps, } from './button-host-attributes.js';
|
|
8
9
|
import { HozoLink } from './link.js';
|
|
9
10
|
import { HozoPressable } from './pressable.js';
|
|
10
11
|
import { HozoTextInput } from './text-input.js';
|
|
@@ -110,11 +111,45 @@ function webImageSource(source) {
|
|
|
110
111
|
? object.default
|
|
111
112
|
: undefined;
|
|
112
113
|
}
|
|
113
|
-
export function Image({ className, src, defaultSource, alt, accessibilityLabel, onLoad, onError, onLayout, ref, ...universal }) {
|
|
114
|
+
export function Image({ className, src, defaultSource, alt, accessibilityLabel, width, height, loading, decoding, fetchPriority, onLoad, onError, onLayout, ref, ...universal }) {
|
|
114
115
|
const { setRef } = useLayoutRef(onLayout, ref);
|
|
115
116
|
const [failedSource, setFailedSource] = useState();
|
|
116
|
-
const
|
|
117
|
-
|
|
117
|
+
const primary = webImageSource(src);
|
|
118
|
+
const fallback = webImageSource(defaultSource);
|
|
119
|
+
const webSrc = (failedSource === src ? undefined : primary) ?? fallback;
|
|
120
|
+
// A server-rendered `<img>` starts loading before React hydrates, so its
|
|
121
|
+
// `error` event may already have fired when `onError` is attached (#1156).
|
|
122
|
+
// `complete && naturalWidth === 0` spots that, and `decode()` separates a
|
|
123
|
+
// broken load from a widthless SVG that some browsers report as 0px wide.
|
|
124
|
+
// The caller's `onError` is not synthesized here because the native error
|
|
125
|
+
// event has already come and gone before hydration.
|
|
126
|
+
const stateRef = useRef({ src, primary, fallback, failedSource });
|
|
127
|
+
stateRef.current = { src, primary, fallback, failedSource };
|
|
128
|
+
const imageRef = useCallback((node) => {
|
|
129
|
+
setRef(node);
|
|
130
|
+
const current = stateRef.current;
|
|
131
|
+
if (node &&
|
|
132
|
+
current.primary &&
|
|
133
|
+
current.fallback &&
|
|
134
|
+
current.failedSource !== current.src &&
|
|
135
|
+
node.complete &&
|
|
136
|
+
node.naturalWidth === 0) {
|
|
137
|
+
const failed = current.src;
|
|
138
|
+
if (typeof node.decode === 'function') {
|
|
139
|
+
node.decode().then(undefined, () => {
|
|
140
|
+
if (stateRef.current.src === failed)
|
|
141
|
+
setFailedSource(failed);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
setFailedSource(failed);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}, [setRef]);
|
|
149
|
+
return (_jsx("img", { ref: imageRef, className: className, src: webSrc, alt: alt ?? accessibilityLabel ?? '',
|
|
150
|
+
// Forwarded as the compiled `<img>` forwards them, so a page renders
|
|
151
|
+
// the same with or without the compiler (#1674).
|
|
152
|
+
width: width, height: height, loading: loading, decoding: decoding, fetchPriority: fetchPriority, onLoad: onLoad, onError: (event) => {
|
|
118
153
|
setFailedSource(src);
|
|
119
154
|
onError?.(event);
|
|
120
155
|
}, ...universalDomProps(universal) }));
|
|
@@ -123,10 +158,21 @@ export { HozoPressable as Pressable, HozoTextInput as TextInput, };
|
|
|
123
158
|
export function Link({ children, ...props }) {
|
|
124
159
|
return _jsx(HozoLink, { ...props, children: children });
|
|
125
160
|
}
|
|
126
|
-
export function Button({ className, children, onPress,
|
|
161
|
+
export function Button({ className, children, onPress, accessibilityLabel, accessibilityHint, href, external, replace, prefetch, target, rel, download, testID, nativeID, accessibilityState: state, 'aria-controls': controls, disabled: disabledProp, ...metadata }) {
|
|
162
|
+
// Either spelling disables it, as the compiled element does.
|
|
163
|
+
const disabled = state?.disabled === true ? true : disabledProp;
|
|
164
|
+
const data = {
|
|
165
|
+
...buttonDataProps(metadata),
|
|
166
|
+
...buttonTriggerProps(metadata, BUTTON_TRIGGER_PROPS_WEB),
|
|
167
|
+
'aria-selected': state?.selected,
|
|
168
|
+
'aria-checked': state?.checked,
|
|
169
|
+
'aria-busy': state?.busy,
|
|
170
|
+
'aria-expanded': state?.expanded,
|
|
171
|
+
'aria-controls': controls,
|
|
172
|
+
};
|
|
127
173
|
if (href != null) {
|
|
128
|
-
return (_jsx(HozoLink, { href: href, external: external, replace: replace, prefetch: prefetch, target: target, rel: rel, download: download, className: className, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint, disabled: disabled, testID: testID, onPress: onPress, children: children }));
|
|
174
|
+
return (_jsx(HozoLink, { ...data, href: href, external: external, replace: replace, prefetch: prefetch, target: target, rel: rel, download: download, className: className, accessibilityLabel: accessibilityLabel, accessibilityHint: accessibilityHint, disabled: disabled, testID: testID, nativeID: nativeID, onPress: onPress, children: children }));
|
|
129
175
|
}
|
|
130
|
-
return (_jsxs(_Fragment, { children: [hozoViewBase(), _jsx("button", { type: "button", className: className, disabled: disabled, "data-hozo-disabled": disabled ? '' : undefined, "data-hozo-pressable": onPress && !disabled ? '' : undefined, "aria-label": accessibilityLabel, "aria-description": accessibilityHint, "data-testid": testID, onClick: onPress, children: children })] }));
|
|
176
|
+
return (_jsxs(_Fragment, { children: [hozoViewBase(), _jsx("button", { ...data, type: "button", className: className, disabled: disabled, "data-hozo-disabled": disabled ? '' : undefined, "aria-disabled": disabled, "data-hozo-pressable": onPress && !disabled ? '' : undefined, "aria-label": accessibilityLabel, "aria-description": accessibilityHint, "data-testid": testID, id: nativeID, onClick: onPress, children: children })] }));
|
|
131
177
|
}
|
|
132
178
|
//# sourceMappingURL=foundation.js.map
|
package/dist/foundation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foundation.js","sourceRoot":"","sources":["../src/foundation.tsx"],"names":[],"mappings":";AAAA,yEAAyE;AACzE,4EAA4E;AAC5E,uEAAuE;AACvE,eAAe;AAEf,OAAO,EAEL,YAAY,EACZ,YAAY,EACZ,iBAAiB,EAEjB,oBAAoB,GACrB,MAAM,cAAc,CAAA;AACrB,OAAO,
|
|
1
|
+
{"version":3,"file":"foundation.js","sourceRoot":"","sources":["../src/foundation.tsx"],"names":[],"mappings":";AAAA,yEAAyE;AACzE,4EAA4E;AAC5E,uEAAuE;AACvE,eAAe;AAEf,OAAO,EAEL,YAAY,EACZ,YAAY,EACZ,iBAAiB,EAEjB,oBAAoB,GACrB,MAAM,cAAc,CAAA;AACrB,OAAO,EASL,WAAW,EACX,SAAS,EACT,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAA;AACd,OAAO,EACL,wBAAwB,EAExB,eAAe,EACf,kBAAkB,GACnB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AACpC,OAAO,EAAE,aAAa,EAA2B,MAAM,gBAAgB,CAAA;AACvE,OAAO,EAAE,aAAa,EAA2B,MA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AAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,kBAAkB,EACtC,iBAAiB,EAAE,iBAAiB,EACpC,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAA+C,YAEvD,QAAQ,GACA,CACZ,CAAA;IACH,CAAC;IACD,OAAO,CACL,8BACG,YAAY,EAAE,EACf,oBACM,IAAI,EACR,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,wBACE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,mBAC9B,QAAQ,yBACF,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,gBAC9C,kBAAkB,sBACZ,iBAAiB,iBACtB,MAAM,EACnB,EAAE,EAAE,QAAQ,EACZ,OAAO,EAAE,OAA+C,YAEvD,QAAQ,GACF,IACR,CACJ,CAAA;AACH,CAAC"}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import React, { type ReactNode, type Ref } from 'react';
|
|
2
|
-
import { type AccessibilityRole, type
|
|
1
|
+
import React, { type ComponentRef, type ReactNode, type Ref } from 'react';
|
|
2
|
+
import { type AccessibilityRole, type AccessibilityState, Pressable as RNPressable, type PressableProps as RNPressableProps, TextInput as RNTextInput, type TextProps as RNTextProps, type StyleProp, type TextStyle, type ViewStyle } from 'react-native';
|
|
3
|
+
import { type ButtonDataProps } from './button-host-attributes.ts';
|
|
4
|
+
import { type NativeTextInputProps } from './text-input-props.native.ts';
|
|
3
5
|
export type { HozoResponderEvent, HozoResponderTouch, HozoTouchHistory, HozoTouchTrack, ResponderProps, } from '@hozo/engine';
|
|
4
|
-
export type { ImageProps,
|
|
5
|
-
export { Image,
|
|
6
|
+
export type { ImageProps, ViewProps, } from 'react-native';
|
|
7
|
+
export { Image, View } from 'react-native';
|
|
8
|
+
export type TextInputProps = NativeTextInputProps & {
|
|
9
|
+
ref?: Ref<ComponentRef<typeof RNTextInput>>;
|
|
10
|
+
};
|
|
11
|
+
/** The canonical disabled contract also applies outside compiler-owned JSX. */
|
|
12
|
+
export declare function TextInput({ ref, ...props }: TextInputProps): React.JSX.Element;
|
|
6
13
|
export type { HozoImageSource, HozoImageSourceObject, HozoLayoutEvent, HozoLayoutRectangle, HozoStyle, UniversalProps, } from './foundation.tsx';
|
|
7
14
|
export type TextProps = RNTextProps;
|
|
8
15
|
export declare function Text({ children, style, ...props }: TextProps): React.JSX.Element;
|
|
@@ -20,7 +27,7 @@ export interface PressableProps extends RNPressableProps {
|
|
|
20
27
|
* A caller needs it to hand the control to something else: `Dialog`'s
|
|
21
28
|
* `restoreFocusTo` is where this came up (#462).
|
|
22
29
|
*/
|
|
23
|
-
ref?: Ref<
|
|
30
|
+
ref?: Ref<ComponentRef<typeof RNPressable>>;
|
|
24
31
|
href?: string;
|
|
25
32
|
external?: boolean;
|
|
26
33
|
replace?: boolean;
|
|
@@ -43,6 +50,7 @@ export interface LinkProps {
|
|
|
43
50
|
onPress?: (event: {
|
|
44
51
|
defaultPrevented?: boolean;
|
|
45
52
|
}) => void;
|
|
53
|
+
disabled?: boolean;
|
|
46
54
|
style?: StyleProp<TextStyle>;
|
|
47
55
|
testID?: string;
|
|
48
56
|
nativeID?: string;
|
|
@@ -51,7 +59,7 @@ export interface LinkProps {
|
|
|
51
59
|
accessibilityRole?: AccessibilityRole;
|
|
52
60
|
}
|
|
53
61
|
export declare function Link({ href, external, replace, prefetch, target: _target, rel: _rel, download: _download, ...props }: LinkProps): React.JSX.Element;
|
|
54
|
-
export interface ButtonProps {
|
|
62
|
+
export interface ButtonProps extends ButtonDataProps {
|
|
55
63
|
className?: string;
|
|
56
64
|
children?: ReactNode;
|
|
57
65
|
onPress?: RNPressableProps['onPress'];
|
|
@@ -67,7 +75,26 @@ export interface ButtonProps {
|
|
|
67
75
|
download?: boolean | string;
|
|
68
76
|
style?: StyleProp<ViewStyle>;
|
|
69
77
|
testID?: string;
|
|
78
|
+
nativeID?: string;
|
|
79
|
+
/**
|
|
80
|
+
* What a wrapper writes to make this a trigger -- `Tooltip` measures the
|
|
81
|
+
* ref and opens on hover or a long press (#1137). Forwarded to the
|
|
82
|
+
* Pressable as given.
|
|
83
|
+
*/
|
|
84
|
+
ref?: Ref<ComponentRef<typeof RNPressable>>;
|
|
85
|
+
onFocus?: RNPressableProps['onFocus'];
|
|
86
|
+
onBlur?: RNPressableProps['onBlur'];
|
|
87
|
+
onHoverIn?: RNPressableProps['onHoverIn'];
|
|
88
|
+
onHoverOut?: RNPressableProps['onHoverOut'];
|
|
89
|
+
onLongPress?: RNPressableProps['onLongPress'];
|
|
90
|
+
/** As the Web half: `expanded` and the rest, `disabled` merged with the prop. */
|
|
91
|
+
accessibilityState?: AccessibilityState;
|
|
92
|
+
/**
|
|
93
|
+
* Accepted so one source type-checks on both platforms, and dropped: React
|
|
94
|
+
* Native has no relationship between views to carry it (#1704).
|
|
95
|
+
*/
|
|
96
|
+
'aria-controls'?: string;
|
|
70
97
|
}
|
|
71
98
|
export type ButtonNativeProps = ButtonProps;
|
|
72
|
-
export declare function Button({ children, onPress, disabled, accessibilityLabel, accessibilityHint, href, external, replace, prefetch, style, testID, }: ButtonProps): React.JSX.Element;
|
|
99
|
+
export declare function Button({ children, onPress, disabled, accessibilityLabel, accessibilityHint, href, external, replace, prefetch, style, testID, nativeID, accessibilityState: state, 'aria-controls': _controls, ...metadata }: ButtonProps): React.JSX.Element;
|
|
73
100
|
//# sourceMappingURL=foundation.native.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foundation.native.d.ts","sourceRoot":"","sources":["../src/foundation.native.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAsB,KAAK,SAA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B,CAAC,QAAQ,CAAC,CAAA;IACnC,SAAS,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAA;IACzC,UAAU,CAAC,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAA;IAC3C,WAAW,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAA;IAC7C,iFAAiF;IACjF,kBAAkB,CAAC,EAAE,kBAAkB,CAAA;IACvC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,MAAM,iBAAiB,GAAG,WAAW,CAAA;AAE3C,wBAAgB,MAAM,CAAC,EACrB,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,kBAAkB,EAClB,iBAAiB,EACjB,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,KAAK,EACL,MAAM,EACN,QAAQ,EACR,kBAAkB,EAAE,KAAK,EACzB,eAAe,EAAE,SAAS,EAC1B,GAAG,QAAQ,EACZ,EAAE,WAAW,qBAoCb"}
|
|
@@ -2,9 +2,17 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { hozoTextChildren } from '@hozo/behaviors';
|
|
3
3
|
import { HozoTextSizeContext } from '@hozo/engine';
|
|
4
4
|
import React, {} from 'react';
|
|
5
|
-
import { Pressable as RNPressable, Text as RNText, StyleSheet, } from 'react-native';
|
|
5
|
+
import { Pressable as RNPressable, Text as RNText, TextInput as RNTextInput, StyleSheet, } from 'react-native';
|
|
6
|
+
import { BUTTON_TRIGGER_PROPS_NATIVE, buttonDataProps, buttonTriggerProps, } from './button-host-attributes.js';
|
|
7
|
+
import { hozoButtonProps } from './button-host-props.native.js';
|
|
6
8
|
import { HozoLink } from './link.native.js';
|
|
7
|
-
|
|
9
|
+
import { nativeDisabledProps } from './native-disabled.js';
|
|
10
|
+
import { nativeTextInputProps } from './text-input-props.native.js';
|
|
11
|
+
export { Image, View } from 'react-native';
|
|
12
|
+
/** The canonical disabled contract also applies outside compiler-owned JSX. */
|
|
13
|
+
export function TextInput({ ref, ...props }) {
|
|
14
|
+
return _jsx(RNTextInput, { ...nativeTextInputProps(props), ref: ref });
|
|
15
|
+
}
|
|
8
16
|
export function Text({ children, style, ...props }) {
|
|
9
17
|
const size = StyleSheet.flatten(style)?.fontSize;
|
|
10
18
|
const text = React.createElement(RNText, { style, ...props }, children);
|
|
@@ -13,6 +21,7 @@ export function Text({ children, style, ...props }) {
|
|
|
13
21
|
return _jsx(HozoTextSizeContext.Provider, { value: size, children: text });
|
|
14
22
|
}
|
|
15
23
|
export function Pressable({ href, external, replace, prefetch, target: _target, rel: _rel, download: _download, ...props }) {
|
|
24
|
+
props = nativeDisabledProps(props);
|
|
16
25
|
if (href === undefined)
|
|
17
26
|
return _jsx(RNPressable, { ...props });
|
|
18
27
|
const Link = HozoLink;
|
|
@@ -22,14 +31,18 @@ export function Link({ href, external, replace, prefetch, target: _target, rel:
|
|
|
22
31
|
const NativeLink = HozoLink;
|
|
23
32
|
return (_jsx(NativeLink, { href: href, external: external, replace: replace, prefetch: prefetch, ...props }));
|
|
24
33
|
}
|
|
25
|
-
export function Button({ children, onPress, disabled, accessibilityLabel, accessibilityHint, href, external, replace, prefetch, style, testID, }) {
|
|
34
|
+
export function Button({ children, onPress, disabled, accessibilityLabel, accessibilityHint, href, external, replace, prefetch, style, testID, nativeID, accessibilityState: state, 'aria-controls': _controls, ...metadata }) {
|
|
35
|
+
const off = state?.disabled === true ? true : disabled;
|
|
26
36
|
const shared = {
|
|
27
|
-
|
|
37
|
+
...hozoButtonProps(buttonDataProps(metadata)),
|
|
38
|
+
...buttonTriggerProps(metadata, BUTTON_TRIGGER_PROPS_NATIVE),
|
|
39
|
+
disabled: off,
|
|
28
40
|
accessibilityLabel,
|
|
29
41
|
accessibilityHint,
|
|
30
|
-
accessibilityState:
|
|
42
|
+
accessibilityState: state === undefined && off === undefined ? undefined : { ...state, disabled: off },
|
|
31
43
|
style,
|
|
32
44
|
testID,
|
|
45
|
+
nativeID,
|
|
33
46
|
};
|
|
34
47
|
if (href !== undefined) {
|
|
35
48
|
const NativeLink = HozoLink;
|
|
@@ -37,4 +50,7 @@ export function Button({ children, onPress, disabled, accessibilityLabel, access
|
|
|
37
50
|
}
|
|
38
51
|
return (_jsx(RNPressable, { accessibilityRole: "button", onPress: onPress, ...shared, children: hozoTextChildren(children) }));
|
|
39
52
|
}
|
|
53
|
+
// A label a pressable can hand its text styles to (#876); see `hozoTextStyle`.
|
|
54
|
+
;
|
|
55
|
+
Text.hozoLabelText = true;
|
|
40
56
|
//# sourceMappingURL=foundation.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foundation.native.js","sourceRoot":"","sources":["../src/foundation.native.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"foundation.native.js","sourceRoot":"","sources":["../src/foundation.native.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,EAAmE,MAAM,OAAO,CAAA;AAC9F,OAAO,EAGL,SAAS,IAAI,WAAW,EAExB,IAAI,IAAI,MAAM,EACd,SAAS,IAAI,WAAW,EAGxB,UAAU,GAGX,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,2BAA2B,EAE3B,eAAe,EACf,kBAAkB,GACnB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAmB,CAAA;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,EAA6B,oBAAoB,EAAE,MAAM,8BAA8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