@hozo/engine 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 +83 -0
- package/README.md +8 -4
- package/dist/authored-edges.d.ts +24 -0
- package/dist/authored-edges.d.ts.map +1 -0
- package/dist/authored-edges.js +73 -0
- package/dist/authored-edges.js.map +1 -0
- package/dist/authored-gap.d.ts +11 -0
- package/dist/authored-gap.d.ts.map +1 -0
- package/dist/authored-gap.js +45 -0
- package/dist/authored-gap.js.map +1 -0
- package/dist/class-name.native.d.ts +6 -0
- package/dist/class-name.native.d.ts.map +1 -1
- package/dist/class-name.native.js.map +1 -1
- package/dist/class-resolver.d.ts +77 -4
- package/dist/class-resolver.d.ts.map +1 -1
- package/dist/class-resolver.js +461 -34
- package/dist/class-resolver.js.map +1 -1
- package/dist/class-transition.d.ts +32 -0
- package/dist/class-transition.d.ts.map +1 -0
- package/dist/class-transition.js +48 -0
- package/dist/class-transition.js.map +1 -0
- package/dist/color-transition.d.ts +2 -0
- package/dist/color-transition.d.ts.map +1 -1
- package/dist/color-transition.js +4 -0
- package/dist/color-transition.js.map +1 -1
- package/dist/cx.d.ts +4 -0
- package/dist/cx.d.ts.map +1 -0
- package/dist/cx.js +17 -0
- package/dist/cx.js.map +1 -0
- package/dist/dom-style.d.ts +1 -0
- package/dist/dom-style.d.ts.map +1 -1
- package/dist/dom-style.js +4 -0
- package/dist/dom-style.js.map +1 -1
- package/dist/filter-slots.d.ts +11 -0
- package/dist/filter-slots.d.ts.map +1 -0
- package/dist/filter-slots.js +57 -0
- package/dist/filter-slots.js.map +1 -0
- package/dist/gap-styles.d.ts +3 -0
- package/dist/gap-styles.d.ts.map +1 -0
- package/dist/gap-styles.js +7 -0
- package/dist/gap-styles.js.map +1 -0
- package/dist/generated/animated.d.ts +3 -0
- package/dist/generated/animated.d.ts.map +1 -0
- package/dist/generated/animated.js +7 -0
- package/dist/generated/animated.js.map +1 -0
- package/dist/generated/authored-edges.d.ts +2 -0
- package/dist/generated/authored-edges.d.ts.map +1 -0
- package/dist/generated/authored-edges.js +3 -0
- package/dist/generated/authored-edges.js.map +1 -0
- package/dist/generated/class-resolver.d.ts +1 -1
- package/dist/generated/class-resolver.d.ts.map +1 -1
- package/dist/generated/class-resolver.js +1 -1
- package/dist/generated/class-resolver.js.map +1 -1
- package/dist/generated/filter-slots.d.ts +2 -0
- package/dist/generated/filter-slots.d.ts.map +1 -0
- package/dist/generated/filter-slots.js +3 -0
- package/dist/generated/filter-slots.js.map +1 -0
- package/dist/generated/gap-styles.d.ts +3 -0
- package/dist/generated/gap-styles.d.ts.map +1 -0
- package/dist/generated/gap-styles.js +4 -0
- package/dist/generated/gap-styles.js.map +1 -0
- package/dist/generated/gradient-slots.d.ts +2 -0
- package/dist/generated/gradient-slots.d.ts.map +1 -0
- package/dist/generated/gradient-slots.js +3 -0
- package/dist/generated/gradient-slots.js.map +1 -0
- package/dist/generated/safe-area.d.ts +1 -1
- package/dist/generated/safe-area.d.ts.map +1 -1
- package/dist/generated/safe-area.js +1 -1
- package/dist/generated/safe-area.js.map +1 -1
- package/dist/generated/shadow-slots.d.ts +2 -0
- package/dist/generated/shadow-slots.d.ts.map +1 -0
- package/dist/generated/shadow-slots.js +3 -0
- package/dist/generated/shadow-slots.js.map +1 -0
- package/dist/generated/spread-styles.d.ts +2 -0
- package/dist/generated/spread-styles.d.ts.map +1 -0
- package/dist/generated/spread-styles.js +3 -0
- package/dist/generated/spread-styles.js.map +1 -0
- package/dist/generated/text-inheritance-protocol.d.ts +3 -0
- package/dist/generated/text-inheritance-protocol.d.ts.map +1 -0
- package/dist/generated/text-inheritance-protocol.js +3 -0
- package/dist/generated/text-inheritance-protocol.js.map +1 -0
- package/dist/generated/text-size-context.d.ts +2 -0
- package/dist/generated/text-size-context.d.ts.map +1 -0
- package/dist/generated/text-size-context.js +3 -0
- package/dist/generated/text-size-context.js.map +1 -0
- package/dist/gradient-slots.d.ts +19 -0
- package/dist/gradient-slots.d.ts.map +1 -0
- package/dist/gradient-slots.js +61 -0
- package/dist/gradient-slots.js.map +1 -0
- package/dist/hooks.native.js +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/inline-edges.d.ts +8 -0
- package/dist/inline-edges.d.ts.map +1 -0
- package/dist/inline-edges.js +13 -0
- package/dist/inline-edges.js.map +1 -0
- package/dist/presence-context.d.ts +15 -0
- package/dist/presence-context.d.ts.map +1 -0
- package/dist/presence-context.js +11 -0
- package/dist/presence-context.js.map +1 -0
- package/dist/project.d.ts +8 -0
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +7 -0
- package/dist/project.js.map +1 -1
- package/dist/project.native.d.ts +1 -1
- package/dist/project.native.d.ts.map +1 -1
- package/dist/project.native.js +1 -1
- package/dist/project.native.js.map +1 -1
- package/dist/responder.d.ts +34 -0
- package/dist/responder.d.ts.map +1 -1
- package/dist/responder.js +52 -0
- package/dist/responder.js.map +1 -1
- package/dist/runtime-transition.native.d.ts +37 -0
- package/dist/runtime-transition.native.d.ts.map +1 -0
- package/dist/runtime-transition.native.js +252 -0
- package/dist/runtime-transition.native.js.map +1 -0
- package/dist/safe-area.native.d.ts +12 -0
- package/dist/safe-area.native.d.ts.map +1 -1
- package/dist/safe-area.native.js +44 -21
- package/dist/safe-area.native.js.map +1 -1
- package/dist/shadow-slots.d.ts +26 -0
- package/dist/shadow-slots.d.ts.map +1 -0
- package/dist/shadow-slots.js +59 -0
- package/dist/shadow-slots.js.map +1 -0
- package/dist/spread-styles.d.ts +16 -0
- package/dist/spread-styles.d.ts.map +1 -0
- package/dist/spread-styles.js +57 -0
- package/dist/spread-styles.js.map +1 -0
- package/dist/text-inheritance.d.ts +30 -0
- package/dist/text-inheritance.d.ts.map +1 -0
- package/dist/text-inheritance.js +42 -0
- package/dist/text-inheritance.js.map +1 -0
- package/dist/text-style.d.ts +8 -0
- package/dist/text-style.d.ts.map +1 -0
- package/dist/text-style.js +34 -0
- package/dist/text-style.js.map +1 -0
- package/dist/transform-slots.d.ts +1 -1
- package/dist/transform-slots.d.ts.map +1 -1
- package/dist/transform-slots.js +12 -5
- package/dist/transform-slots.js.map +1 -1
- package/package.json +38 -2
- package/src/authored-edges.ts +94 -0
- package/src/authored-gap.ts +41 -0
- package/src/class-name.native.ts +10 -0
- package/src/class-resolver.ts +574 -20
- package/src/class-transition.ts +71 -0
- package/src/color-transition.ts +5 -0
- package/src/cx.ts +18 -0
- package/src/dom-style.ts +3 -0
- package/src/filter-slots.ts +67 -0
- package/src/gap-styles.ts +11 -0
- package/src/generated/animated.ts +15 -0
- package/src/generated/authored-edges.ts +2 -0
- package/src/generated/class-resolver.ts +8 -1
- package/src/generated/filter-slots.ts +2 -0
- package/src/generated/gap-styles.ts +3 -0
- package/src/generated/gradient-slots.ts +2 -0
- package/src/generated/safe-area.ts +5 -1
- package/src/generated/shadow-slots.ts +2 -0
- package/src/generated/spread-styles.ts +2 -0
- package/src/generated/text-inheritance-protocol.ts +9 -0
- package/src/generated/text-size-context.ts +2 -0
- package/src/gradient-slots.ts +73 -0
- package/src/hooks.native.ts +1 -1
- package/src/index.ts +17 -2
- package/src/inline-edges.ts +14 -0
- package/src/presence-context.ts +27 -0
- package/src/project.native.ts +1 -1
- package/src/project.ts +9 -0
- package/src/responder.ts +52 -0
- package/src/runtime-transition.native.tsx +324 -0
- package/src/safe-area.native.ts +59 -24
- package/src/shadow-slots.ts +78 -0
- package/src/spread-styles.ts +81 -0
- package/src/text-inheritance.ts +60 -0
- package/src/text-style.ts +35 -0
- package/src/transform-slots.ts +11 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,88 @@
|
|
|
1
1
|
# @hozo/engine
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#2072](https://github.com/iray-tno/hozo/pull/2072) [`5c823ee`](https://github.com/iray-tno/hozo/commit/5c823ee87f1996f7011290af68702ef7f19e5388) Thanks [@iray-tno](https://github.com/iray-tno)! - On React Native, a physical inline utility on its own (`pl-4`, `mr-2`, `left-3`, `border-l-2`) now keeps its side in RTL, as in Tailwind. Before, React Native's default left/right swap moved it to the other side. Where the swap would change the result, both the static compiler and the generated candidate map emit the edge as `start`/`end` for the current direction, so the result no longer depends on the swap setting. A utility that writes both sides alike (`p-4`) is unchanged.
|
|
8
|
+
|
|
9
|
+
This changes behaviour for an RTL app that relied on the swap to mirror physical classes. To mirror, use the logical classes (`ps-*`, `pe-*`, `ms-*`, `me-*`, `start-*`, `end-*`).
|
|
10
|
+
|
|
11
|
+
- [#2074](https://github.com/iray-tno/hozo/pull/2074) [`b3cf38b`](https://github.com/iray-tno/hozo/commit/b3cf38b30f2fe748c4f73110d01de2566826355a) Thanks [@iray-tno](https://github.com/iray-tno)! - On React Native, a development build now warns once about each class it is handed at run time and cannot find in the project's class map, such as `` `bg-${color}-500` `` with a colour the build never saw. Before, such a class just did not apply, with no message. Release builds do not warn.
|
|
12
|
+
|
|
13
|
+
Some names are meant to mark an element rather than style it, such as `js-row` or a name a test selects by. List those in the new `markerClasses` option, as exact names or as prefixes ending in `*`, and they are not warned about. Tailwind's own `group` and `peer` never need listing. The build-time `CLASS_NOT_IN_RUNTIME_MAP` check skips declared markers too.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#1996](https://github.com/iray-tno/hozo/pull/1996) [`cb4b456`](https://github.com/iray-tno/hozo/commit/cb4b4564ddb95d7ecb6f729433bf5c956788b53e) Thanks [@iray-tno](https://github.com/iray-tno)! - Preserve an absolute leading register supplementing a theme text colour in generated Web and Native runtime candidates.
|
|
18
|
+
|
|
19
|
+
- [#1996](https://github.com/iray-tno/hozo/pull/1996) [`ba5beaf`](https://github.com/iray-tno/hozo/commit/ba5beaf2fbaff50a5b6bb1595ee156cae9dd5a1c) Thanks [@iray-tno](https://github.com/iray-tno)! - Keep captured leading registers when a Text owner combines static and runtime classes, without overriding explicit authored styles.
|
|
20
|
+
|
|
21
|
+
- [#2014](https://github.com/iray-tno/hozo/pull/2014) [`0001fc4`](https://github.com/iray-tno/hozo/commit/0001fc442e38955770974fb5377002e4deb4b95f) Thanks [@iray-tno](https://github.com/iray-tno)! - Use the captured Tailwind order when the state styles in a Native class
|
|
22
|
+
string are all ranked, even if another candidate in the project is
|
|
23
|
+
unassessed. Generated Native maps no longer need a separate flag for
|
|
24
|
+
fully ranked state styles.
|
|
25
|
+
|
|
26
|
+
- [#1996](https://github.com/iray-tno/hozo/pull/1996) [`ed04074`](https://github.com/iray-tno/hozo/commit/ed04074de82890b87590afb537a0bea99b2751a7) Thanks [@iray-tno](https://github.com/iray-tno)! - Use Tailwind's captured order for equal-specificity hover and press font sizes, without shipping the older Native variant tie in size-only conditional tables.
|
|
27
|
+
|
|
28
|
+
- [#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.
|
|
29
|
+
|
|
30
|
+
- [#1977](https://github.com/iray-tno/hozo/pull/1977) [`052b447`](https://github.com/iray-tno/hozo/commit/052b447351a669a12c5b8ced61bef5d07dc8a604) Thanks [@iray-tno](https://github.com/iray-tno)! - Keep shared Tailwind order for dynamic Native text and physical padding when an independent background-colour candidate is unranked.
|
|
31
|
+
|
|
32
|
+
- [#1977](https://github.com/iray-tno/hozo/pull/1977) [`43680e3`](https://github.com/iray-tno/hozo/commit/43680e3643ba9f3f6e01f5c7aa885feb8e5c7b04) Thanks [@iray-tno](https://github.com/iray-tno)! - Keep explicit line height when a Native Text or TextInput mixes compiled font sizes with runtime classes.
|
|
33
|
+
|
|
34
|
+
- [#2075](https://github.com/iray-tno/hozo/pull/2075) [`35cc5c3`](https://github.com/iray-tno/hozo/commit/35cc5c31ce90497de9a6f345e884af2d20a6bc60) Thanks [@iray-tno](https://github.com/iray-tno)! - A `style` prop now wins over the classes on the inline edges it writes on React Native. `className="px-8" style={{ paddingRight: 99 }}` used to keep the class's 32, because Yoga prefers `paddingEnd` to `paddingRight` in any order. The authored edge keeps React Native's own meaning, RTL swap included.
|
|
35
|
+
|
|
36
|
+
- [#2078](https://github.com/iray-tno/hozo/pull/2078) [`70643e9`](https://github.com/iray-tno/hozo/commit/70643e959d229a75fcdbd1316f9a972efb4a2622) Thanks [@iray-tno](https://github.com/iray-tno)! - On React Native, a `style` passed through a spread now wins the inline edges it writes over the element's classes, as a named `style` does since the previous release. `<Button style={{ paddingRight: 24 }} />` used to keep the button's `px-*` padding on that side, because the wrapper hands `style` on with `{...rest}` and Yoga prefers the class's `paddingEnd` to `paddingRight`.
|
|
37
|
+
|
|
38
|
+
- [#2036](https://github.com/iray-tno/hozo/pull/2036) [`3a3a8d5`](https://github.com/iray-tno/hozo/commit/3a3a8d52d64d0d580d9afaa298977c5c33f295f2) Thanks [@iray-tno](https://github.com/iray-tno)! - On React Native, an element whose classes write an inline edge both logically and physically (`px-8 pl-1`, `ps-8 pl-1`, and the margin, inset and border width and colour counterparts) now lays out as Tailwind does in both directions. The physical writes are emitted as `start`/`end` for the current direction, so the order Tailwind settled decides. Before, Yoga let `paddingStart` beat `paddingLeft` whatever the order, and React Native's default RTL left/right swap moved the physical write to the other side. Both the static compiler and the generated candidate map do this; an element that writes a family only physically or only logically is unchanged.
|
|
39
|
+
|
|
40
|
+
- [#1996](https://github.com/iray-tno/hozo/pull/1996) [`45eda5b`](https://github.com/iray-tno/hozo/commit/45eda5b451bdf1449c7c16172c03b2a9e743aaa6) Thanks [@iray-tno](https://github.com/iray-tno)! - Keep Tailwind's font-size winner for adjacent conditional size utilities with the same guard in a mixed, dynamic Native class string.
|
|
41
|
+
|
|
42
|
+
- [#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.
|
|
43
|
+
|
|
44
|
+
- [#1996](https://github.com/iray-tno/hozo/pull/1996) [`4f62450`](https://github.com/iray-tno/hozo/commit/4f624503a4fb9f4af6f699f7d2deb55b69a72c36) Thanks [@iray-tno](https://github.com/iray-tno)! - Keep assessed Tailwind order between Native state styles even when a resting utility cannot be ranked, without shipping redundant owner variant ranks for those state maps.
|
|
45
|
+
|
|
46
|
+
- [#2014](https://github.com/iray-tno/hozo/pull/2014) [`ddd7c73`](https://github.com/iray-tno/hozo/commit/ddd7c73d09768ad8fbcf55c40859729b7271ea1a) Thanks [@iray-tno](https://github.com/iray-tno)! - Keep assessed Native state styles in the captured Tailwind order when an
|
|
47
|
+
unranked resting style is present, without moving styles across unknown state
|
|
48
|
+
writes or Native specificity boundaries.
|
|
49
|
+
|
|
50
|
+
- [#1996](https://github.com/iray-tno/hozo/pull/1996) [`2d28017`](https://github.com/iray-tno/hozo/commit/2d2801735d14c61193610e74bc6178f15b79d07e) Thanks [@iray-tno](https://github.com/iray-tno)! - Preserve assessed Native state order beside conditional colour-only writers proven independent of those styles.
|
|
51
|
+
|
|
52
|
+
- [#2014](https://github.com/iray-tno/hozo/pull/2014) [`cabc969`](https://github.com/iray-tno/hozo/commit/cabc9695ae805afa2c690aebcad5657f76f95eac) Thanks [@iray-tno](https://github.com/iray-tno)! - Keep Tailwind's order for assessed RTL/LTR styles when an independent
|
|
53
|
+
resting background would otherwise send the class string through fallback.
|
|
54
|
+
Unknown writes still pin their position.
|
|
55
|
+
|
|
56
|
+
- [#2014](https://github.com/iray-tno/hozo/pull/2014) [`3f1754a`](https://github.com/iray-tno/hozo/commit/3f1754a523e62dc44ccc3da7294e9510e5203302) Thanks [@iray-tno](https://github.com/iray-tno)! - Keep assessed Tailwind order in the resting part of a Native class string
|
|
57
|
+
even when an unrelated unknown write prevents use of the complete order
|
|
58
|
+
plan. Do not move a style across an unproven boundary.
|
|
59
|
+
|
|
60
|
+
## 0.4.0
|
|
61
|
+
|
|
62
|
+
### Minor Changes
|
|
63
|
+
|
|
64
|
+
- [#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.
|
|
65
|
+
|
|
66
|
+
- [#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.
|
|
67
|
+
|
|
68
|
+
- [#1462](https://github.com/iray-tno/hozo/pull/1462) [`c9a3b4d`](https://github.com/iray-tno/hozo/commit/c9a3b4d61541024c66165c91a4b7e2a75c9a203c) Thanks [@iray-tno](https://github.com/iray-tno)! - The Native candidate module now emits a `hozoClassTransitions` table for transition utilities (`transition-*`, `duration-*`, `delay-*`, `ease-*`, also under `motion-reduce:` / `motion-safe:`) instead of reporting them as Web-only, and `@hozo/engine` adds `createClassTransitions` to read a runtime class string into a `HozoAnimated` transition spec.
|
|
69
|
+
|
|
70
|
+
### Patch Changes
|
|
71
|
+
|
|
72
|
+
- [#1473](https://github.com/iray-tno/hozo/pull/1473) [`fac2f53`](https://github.com/iray-tno/hozo/commit/fac2f53a7636c7373cf22c4d49fcf5a137bb08ec) Thanks [@iray-tno](https://github.com/iray-tno)! - An interrupted `HozoAnimated` transition now starts from where its numbers had got to (opacity, and the position and size keys its spec names), rather than jumping to the previous target first. A panel closed halfway through opening shrinks from its current height.
|
|
73
|
+
|
|
74
|
+
- [#1348](https://github.com/iray-tno/hozo/pull/1348) [`b59995e`](https://github.com/iray-tno/hozo/commit/b59995e108e4cc9b6d093c2487cebece0d02a707) Thanks [@iray-tno](https://github.com/iray-tno)! - The Native `Menu` sheet clears the home indicator and the Android gesture handle: it adds the bottom inset an app's `<SafeAreaProvider>` reports below its own padding, and nothing in an app without one. `@hozo/engine` gains `useHozoProvidedSafeArea()` for that, which reads zeros instead of throwing when the provider or `react-native-safe-area-context` is missing, and the missing-package warning for a safe-area class now fires when such a class first renders rather than whenever the Native entry loads.
|
|
75
|
+
|
|
76
|
+
- [#1056](https://github.com/iray-tno/hozo/pull/1056) [`c1ca21a`](https://github.com/iray-tno/hozo/commit/c1ca21afee0e3f4dd92110570f3ff3775b01c4cf) Thanks [@iray-tno](https://github.com/iray-tno)! - On Native, a `style` a caller passes through a component's `{...rest}` no longer replaces the styles compiled from its classes: the two compose, classes first and the caller's style after, as the owner itself composes them. Elements whose spreads cannot carry `style` compile as before.
|
|
77
|
+
|
|
78
|
+
- [#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.
|
|
79
|
+
|
|
80
|
+
- **`onLayout`** is called on mount and when the layout changes, as it is uncompiled. It is not called again on a re-render.
|
|
81
|
+
- **The responder props** (`onStartShouldSetResponder`, `onResponderGrant`, `onResponderMove`, …) claim and release the pointer on a `View`.
|
|
82
|
+
- **An `Image` whose `src` fails to load falls back to `defaultSource`.**
|
|
83
|
+
|
|
84
|
+
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.
|
|
85
|
+
|
|
3
86
|
## 0.3.0
|
|
4
87
|
|
|
5
88
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ negated known sibling predicates such as `not-first:`/`not-last:`, and negated
|
|
|
31
31
|
supported environment queries such as `not-motion-reduce:` reuse the positive
|
|
32
32
|
predicate, including when stacked with other supported conditions. Prop predicates
|
|
33
33
|
need the same readable driver as their positive form; `not-disabled:` without a
|
|
34
|
-
|
|
34
|
+
readable disabled fact or an unreadable ARIA state is still a diagnostic, not a false value
|
|
35
35
|
to invert. `not-enabled:` follows the existing `enabled:` contract: without a
|
|
36
36
|
`disabled` prop, enabled is known true and its negation does not apply. Unknown
|
|
37
37
|
sibling positions and unsupported environment queries remain diagnostics too.
|
|
@@ -44,8 +44,12 @@ negated focus-visible alone enables the same pointer/keyboard modality inference
|
|
|
44
44
|
as its positive form. Text in that interaction context uses the owner's state,
|
|
45
45
|
not an independent text focus target, just as positive focus variants do. No new
|
|
46
46
|
store or subscription is added. Other elements without a readable focus driver
|
|
47
|
-
remain diagnostics.
|
|
48
|
-
|
|
47
|
+
remain diagnostics. Dynamic class maps also carry negated ARIA predicates as
|
|
48
|
+
compiler-owned `!aria-…` keys, prepared once by the resolver from the underlying
|
|
49
|
+
owner facts. Missing facts remain unassessed, including under negation; no new
|
|
50
|
+
owner-state fields or subscriptions are needed. Both ordinary and ordered maps
|
|
51
|
+
use this same matcher. Non-ARIA dynamic selector negations such as `not-hover:`
|
|
52
|
+
remain unwired; their static lowering is a separate capability.
|
|
49
53
|
|
|
50
54
|
**Interaction state infrastructure.** The canonical `HozoPressable` in `@hozo/primitives` tracks
|
|
51
55
|
pressed, hovered, focused and focus-visible state using the shared helpers owned here. Focus-visible
|
|
@@ -107,6 +111,6 @@ rendering boundaries and their layout solvers are owned by `@hozo/primitives`.
|
|
|
107
111
|
|
|
108
112
|
---
|
|
109
113
|
|
|
110
|
-
Part of [Hozo](https://iray-tno.github.io/hozo/), a
|
|
114
|
+
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).
|
|
111
115
|
|
|
112
116
|
<!-- /generated: package-footer -->
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compose an element's class styles with its author's `style` so the author
|
|
3
|
+
* wins every inline edge it writes, as an inline style beats a class on the
|
|
4
|
+
* Web (#2050). React Native does not compose that way: Yoga prefers
|
|
5
|
+
* `paddingEnd` to `paddingRight` whatever the order, so
|
|
6
|
+
* `className="px-8" style={{ paddingRight: 99 }}` kept the class's 32.
|
|
7
|
+
*
|
|
8
|
+
* The author's edge keeps the side React Native gives it on its own,
|
|
9
|
+
* swap included, so a `style` means the same beside a class as without one.
|
|
10
|
+
* Only the families the author writes are rewritten, to start/end for this
|
|
11
|
+
* direction, which the swap leaves alone; everything else is the usual
|
|
12
|
+
* last-wins flattening. Authored objects are never mutated.
|
|
13
|
+
*/
|
|
14
|
+
export declare function hozoAuthoredEdges(classes: readonly unknown[], authored: readonly unknown[], rtl: boolean, swap: boolean): unknown;
|
|
15
|
+
/**
|
|
16
|
+
* `hozoSpreadStyles` for an element whose classes write a start or end edge:
|
|
17
|
+
* a style the caller passes through a spread (`<Button style={…} />` into
|
|
18
|
+
* `<Pressable className="px-4" {...rest} />`) wins its inline edges the same
|
|
19
|
+
* way (#2050). `gap` also projects the caller's `gap`, as
|
|
20
|
+
* `hozoGapSpreadStyles` does. Curried so the generated call keeps the
|
|
21
|
+
* ordinary spread arguments.
|
|
22
|
+
*/
|
|
23
|
+
export declare function hozoEdgeSpreadStyles(rtl: boolean, swap: boolean, gap: boolean): (styles: Readonly<Record<string, unknown>>, writtenLast: readonly string[], ...sources: readonly unknown[]) => Record<string, unknown>;
|
|
24
|
+
//# sourceMappingURL=authored-edges.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authored-edges.d.ts","sourceRoot":"","sources":["../src/authored-edges.ts"],"names":[],"mappings":"AAgCA;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,SAAS,OAAO,EAAE,EAC3B,QAAQ,EAAE,SAAS,OAAO,EAAE,EAC5B,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,OAAO,GACZ,OAAO,CAoBT;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,YAElE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,eAC5B,SAAS,MAAM,EAAE,cAClB,SAAS,OAAO,EAAE,KAC7B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAQ3B"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { hozoAuthoredStyle } from './authored-gap.js';
|
|
2
|
+
import { INLINE_EDGES } from './inline-edges.js';
|
|
3
|
+
import { composeSpreadStyles } from './spread-styles.js';
|
|
4
|
+
function flatten(input, into) {
|
|
5
|
+
if (Array.isArray(input)) {
|
|
6
|
+
for (const item of input)
|
|
7
|
+
flatten(item, into);
|
|
8
|
+
}
|
|
9
|
+
else if (input && typeof input === 'object') {
|
|
10
|
+
Object.assign(into, input);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The start and end a flat style resolves to on its own, as React Native lays
|
|
15
|
+
* it out: without the swap Yoga prefers `paddingStart` to `paddingLeft`, and
|
|
16
|
+
* `paddingLeft` is the start in LTR and the end in RTL; with the swap (RTL
|
|
17
|
+
* only) `paddingLeft` is rewritten to `paddingStart` and overwrites it.
|
|
18
|
+
*/
|
|
19
|
+
function sides(style, [start, end, left, right], rtl, swap) {
|
|
20
|
+
const atStart = rtl && !swap ? style[right] : style[left];
|
|
21
|
+
const atEnd = rtl && !swap ? style[left] : style[right];
|
|
22
|
+
if (rtl && swap)
|
|
23
|
+
return [atStart ?? style[start], atEnd ?? style[end]];
|
|
24
|
+
return [style[start] ?? atStart, style[end] ?? atEnd];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Compose an element's class styles with its author's `style` so the author
|
|
28
|
+
* wins every inline edge it writes, as an inline style beats a class on the
|
|
29
|
+
* Web (#2050). React Native does not compose that way: Yoga prefers
|
|
30
|
+
* `paddingEnd` to `paddingRight` whatever the order, so
|
|
31
|
+
* `className="px-8" style={{ paddingRight: 99 }}` kept the class's 32.
|
|
32
|
+
*
|
|
33
|
+
* The author's edge keeps the side React Native gives it on its own,
|
|
34
|
+
* swap included, so a `style` means the same beside a class as without one.
|
|
35
|
+
* Only the families the author writes are rewritten, to start/end for this
|
|
36
|
+
* direction, which the swap leaves alone; everything else is the usual
|
|
37
|
+
* last-wins flattening. Authored objects are never mutated.
|
|
38
|
+
*/
|
|
39
|
+
export function hozoAuthoredEdges(classes, authored, rtl, swap) {
|
|
40
|
+
const own = {};
|
|
41
|
+
flatten(authored, own);
|
|
42
|
+
const families = INLINE_EDGES.filter((family) => family.some((key) => Object.hasOwn(own, key) && own[key] !== undefined));
|
|
43
|
+
if (families.length === 0)
|
|
44
|
+
return [classes, authored];
|
|
45
|
+
const base = {};
|
|
46
|
+
flatten(classes, base);
|
|
47
|
+
const flat = { ...base, ...own };
|
|
48
|
+
for (const family of families) {
|
|
49
|
+
const [ownStart, ownEnd] = sides(own, family, rtl, swap);
|
|
50
|
+
const [baseStart, baseEnd] = sides(base, family, rtl, swap);
|
|
51
|
+
for (const key of family)
|
|
52
|
+
delete flat[key];
|
|
53
|
+
const start = ownStart ?? baseStart;
|
|
54
|
+
const end = ownEnd ?? baseEnd;
|
|
55
|
+
if (start !== undefined)
|
|
56
|
+
flat[family[0]] = start;
|
|
57
|
+
if (end !== undefined)
|
|
58
|
+
flat[family[1]] = end;
|
|
59
|
+
}
|
|
60
|
+
return flat;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* `hozoSpreadStyles` for an element whose classes write a start or end edge:
|
|
64
|
+
* a style the caller passes through a spread (`<Button style={…} />` into
|
|
65
|
+
* `<Pressable className="px-4" {...rest} />`) wins its inline edges the same
|
|
66
|
+
* way (#2050). `gap` also projects the caller's `gap`, as
|
|
67
|
+
* `hozoGapSpreadStyles` does. Curried so the generated call keeps the
|
|
68
|
+
* ordinary spread arguments.
|
|
69
|
+
*/
|
|
70
|
+
export function hozoEdgeSpreadStyles(rtl, swap, gap) {
|
|
71
|
+
return (styles, writtenLast, ...sources) => composeSpreadStyles(styles, writtenLast, sources, gap ? hozoAuthoredStyle : undefined, (generated, author) => hozoAuthoredEdges([generated], [author], rtl, swap));
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=authored-edges.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authored-edges.js","sourceRoot":"","sources":["../src/authored-edges.ts"],"names":[],"mappings":"AAA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C,CAAC,CAAC,GAAG,GAAG,CAAA;IAC9C,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,GAAY,EAAE,IAAa,EAAE,GAAY;IAC5E,OAAO,CACL,MAAyC,EACzC,WAA8B,EAC9B,GAAG,OAA2B,EACL,EAAE,CAC3B,mBAAmB,CACjB,MAAM,EACN,WAAW,EACX,OAAO,EACP,GAAG,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,SAAS,EACnC,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC,iBAAiB,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,CAC3E,CAAA;AACL,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project a flattened author's StyleProp, not a mixture with compiled styles.
|
|
3
|
+
* Yoga prefers an axis gutter to `gap` regardless of object key/array order.
|
|
4
|
+
* CSS needs the effective longhands instead, or a later shorthand erases the
|
|
5
|
+
* axis. The caller owns this flat object; authored objects are never mutated.
|
|
6
|
+
* Keep CSS-only strings untouched rather than pretending RN accepts them.
|
|
7
|
+
*/
|
|
8
|
+
export declare function projectAuthoredGap(style: Record<string, unknown>): void;
|
|
9
|
+
/** Generated Native code calls this before mixing an author with class axes. */
|
|
10
|
+
export declare function hozoAuthoredStyle<T>(input: T): T;
|
|
11
|
+
//# sourceMappingURL=authored-gap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authored-gap.d.ts","sourceRoot":"","sources":["../src/authored-gap.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAcvE;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAgBhD"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Project a flattened author's StyleProp, not a mixture with compiled styles.
|
|
3
|
+
* Yoga prefers an axis gutter to `gap` regardless of object key/array order.
|
|
4
|
+
* CSS needs the effective longhands instead, or a later shorthand erases the
|
|
5
|
+
* axis. The caller owns this flat object; authored objects are never mutated.
|
|
6
|
+
* Keep CSS-only strings untouched rather than pretending RN accepts them.
|
|
7
|
+
*/
|
|
8
|
+
export function projectAuthoredGap(style) {
|
|
9
|
+
const gap = style.gap;
|
|
10
|
+
if (gap === undefined)
|
|
11
|
+
return;
|
|
12
|
+
if (!(typeof gap === 'number' && Number.isFinite(gap) && gap >= 0) &&
|
|
13
|
+
!(typeof gap === 'string' && /^(?:\d+(?:\.\d+)?|\.\d+)%$/.test(gap)))
|
|
14
|
+
return;
|
|
15
|
+
if (!Object.hasOwn(style, 'gap'))
|
|
16
|
+
return;
|
|
17
|
+
const row = style.rowGap ?? gap;
|
|
18
|
+
const column = style.columnGap ?? gap;
|
|
19
|
+
delete style.gap;
|
|
20
|
+
style.rowGap = row;
|
|
21
|
+
style.columnGap = column;
|
|
22
|
+
}
|
|
23
|
+
/** Generated Native code calls this before mixing an author with class axes. */
|
|
24
|
+
export function hozoAuthoredStyle(input) {
|
|
25
|
+
if (!input || typeof input !== 'object')
|
|
26
|
+
return input;
|
|
27
|
+
if (!Array.isArray(input) && (!('gap' in input) || !Object.hasOwn(input, 'gap')))
|
|
28
|
+
return input;
|
|
29
|
+
// Flatten only the author's contribution. Reading it once also avoids a
|
|
30
|
+
// pre-scan that would evaluate style accessors again during composition.
|
|
31
|
+
const flat = {};
|
|
32
|
+
function visit(value) {
|
|
33
|
+
if (Array.isArray(value)) {
|
|
34
|
+
for (const item of value)
|
|
35
|
+
visit(item);
|
|
36
|
+
}
|
|
37
|
+
else if (value && typeof value === 'object') {
|
|
38
|
+
Object.assign(flat, value);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
visit(input);
|
|
42
|
+
projectAuthoredGap(flat);
|
|
43
|
+
return flat;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=authored-gap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authored-gap.js","sourceRoot":"","sources":["../src/authored-gap.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAA8B;IAC/D,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAA;IACrB,IAAI,GAAG,KAAK,SAAS;QAAE,OAAM;IAC7B,IACE,CAAC,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;QAC9D,CAAC,CAAC,OAAO,GAAG,KAAK,QAAQ,IAAI,4BAA4B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEpE,OAAM;IACR,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC;QAAE,OAAM;IACxC,MAAM,GAAG,GAAG,KAAK,CAAC,MAAM,IAAI,GAAG,CAAA;IAC/B,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,IAAI,GAAG,CAAA;IACrC,OAAO,KAAK,CAAC,GAAG,CAAA;IAChB,KAAK,CAAC,MAAM,GAAG,GAAG,CAAA;IAClB,KAAK,CAAC,SAAS,GAAG,MAAM,CAAA;AAC1B,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,iBAAiB,CAAI,KAAQ;IAC3C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAA;IACrD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAAE,OAAO,KAAK,CAAA;IAC9F,wEAAwE;IACxE,yEAAyE;IACzE,MAAM,IAAI,GAA4B,EAAE,CAAA;IACxC,SAAS,KAAK,CAAC,KAAc;QAC3B,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,KAAK,MAAM,IAAI,IAAI,KAAK;gBAAE,KAAK,CAAC,IAAI,CAAC,CAAA;QACvC,CAAC;aAAM,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9C,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;IACD,KAAK,CAAC,KAAK,CAAC,CAAA;IACZ,kBAAkB,CAAC,IAAI,CAAC,CAAA;IACxB,OAAO,IAAS,CAAA;AAClB,CAAC"}
|
|
@@ -10,6 +10,12 @@ declare module 'react-native' {
|
|
|
10
10
|
interface ImagePropsBase {
|
|
11
11
|
/** Tailwind classes the compiler lowers to a `StyleSheet` entry. */
|
|
12
12
|
className?: string;
|
|
13
|
+
/** Web only. */
|
|
14
|
+
loading?: 'eager' | 'lazy';
|
|
15
|
+
/** Web only. */
|
|
16
|
+
decoding?: 'async' | 'auto' | 'sync';
|
|
17
|
+
/** Web only. */
|
|
18
|
+
fetchPriority?: 'auto' | 'high' | 'low';
|
|
13
19
|
}
|
|
14
20
|
interface FlatListProps<ItemT> {
|
|
15
21
|
/** Tailwind classes the compiler lowers to a `StyleSheet` entry. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class-name.native.d.ts","sourceRoot":"","sources":["../src/class-name.native.ts"],"names":[],"mappings":"AAiCA,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,SAAS;QACjB,oEAAoE;QACpE,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB;IACD,UAAU,SAAS;QACjB,oEAAoE;QACpE,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB;IACD,UAAU,cAAc;QACtB,oEAAoE;QACpE,SAAS,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"class-name.native.d.ts","sourceRoot":"","sources":["../src/class-name.native.ts"],"names":[],"mappings":"AAiCA,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,SAAS;QACjB,oEAAoE;QACpE,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB;IACD,UAAU,SAAS;QACjB,oEAAoE;QACpE,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB;IACD,UAAU,cAAc;QACtB,oEAAoE;QACpE,SAAS,CAAC,EAAE,MAAM,CAAA;QAKlB,gBAAgB;QAChB,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;QAC1B,gBAAgB;QAChB,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAA;QACpC,gBAAgB;QAChB,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAA;KACxC;IACD,UAAU,aAAa,CAAC,KAAK;QAC3B,oEAAoE;QACpE,SAAS,CAAC,EAAE,MAAM,CAAA;KACnB;CACF;AAED,OAAO,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class-name.native.js","sourceRoot":"","sources":["../src/class-name.native.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,EAAE;AACF,+DAA+D;AAC/D,wEAAwE;AACxE,2EAA2E;AAC3E,iCAAiC;AACjC,EAAE;AACF,wEAAwE;AACxE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,0EAA0E;AAC1E,2EAA2E;AAC3E,yEAAyE;AACzE,+CAA+C;AAC/C,EAAE;AACF,yEAAyE;AACzE,uDAAuD;AACvD,EAAE;AACF,gDAAgD;AAChD,+BAA+B;AAC/B,EAAE;AACF,yEAAyE;AACzE,yEAAyE;AACzE,yEAAyE;AACzE,EAAE;AACF,0EAA0E;AAC1E,wEAAwE;AACxE,wEAAwE;AACxE,0EAA0E;AAC1E,0EAA0E;AAC1E,yDAAyD;
|
|
1
|
+
{"version":3,"file":"class-name.native.js","sourceRoot":"","sources":["../src/class-name.native.ts"],"names":[],"mappings":"AAAA,gEAAgE;AAChE,EAAE;AACF,+DAA+D;AAC/D,wEAAwE;AACxE,2EAA2E;AAC3E,iCAAiC;AACjC,EAAE;AACF,wEAAwE;AACxE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,0EAA0E;AAC1E,2EAA2E;AAC3E,yEAAyE;AACzE,+CAA+C;AAC/C,EAAE;AACF,yEAAyE;AACzE,uDAAuD;AACvD,EAAE;AACF,gDAAgD;AAChD,+BAA+B;AAC/B,EAAE;AACF,yEAAyE;AACzE,yEAAyE;AACzE,yEAAyE;AACzE,EAAE;AACF,0EAA0E;AAC1E,wEAAwE;AACxE,wEAAwE;AACxE,0EAA0E;AAC1E,0EAA0E;AAC1E,yDAAyD;AA+BzD,OAAO,EAAE,CAAA"}
|
package/dist/class-resolver.d.ts
CHANGED
|
@@ -1,19 +1,46 @@
|
|
|
1
|
+
import type { FilterSlots } from './filter-slots.ts';
|
|
2
|
+
import type { GradientSlots } from './gradient-slots.ts';
|
|
3
|
+
import type { ShadowSlots } from './shadow-slots.ts';
|
|
4
|
+
import type { TransformSlots } from './transform-slots.ts';
|
|
1
5
|
/** A React Native style object, as the compiler emits it. */
|
|
2
6
|
export type StyleObject = Record<string, unknown>;
|
|
7
|
+
/**
|
|
8
|
+
* Compiler-owned text-size fallbacks are not explicit line heights. CSS's
|
|
9
|
+
* --tw-leading register survives a later font-size rule; RN has one numeric
|
|
10
|
+
* slot. The map marks actual generated objects, never class names or private
|
|
11
|
+
* style keys. Only maps containing these fallbacks install this composition.
|
|
12
|
+
*/
|
|
13
|
+
export declare function hozoTextMetricStyles(styles: StyleObject[], defaults: ReadonlyMap<StyleObject, StyleObject>, registers?: ReadonlyMap<StyleObject, StyleObject>): StyleObject[];
|
|
14
|
+
type TextMetricStyle = StyleObject | readonly TextMetricStyle[] | false | null | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* A compiled text owner sees both its own entries and selected caller entries.
|
|
17
|
+
* Keep the array order for every other field, and keep the last explicit
|
|
18
|
+
* leading if a later font-size fallback would cover it.
|
|
19
|
+
*/
|
|
20
|
+
export declare function hozoMixedTextMetricStyles(styles: readonly TextMetricStyle[], ownDefaults: readonly StyleObject[], candidateDefaults?: ReadonlySet<StyleObject> | ReadonlyMap<StyleObject, StyleObject>, candidateRegisters?: ReadonlyMap<StyleObject, StyleObject>, ownRegisters?: readonly (readonly [StyleObject, number])[]): readonly TextMetricStyle[];
|
|
3
21
|
/**
|
|
4
22
|
* The state an element is in when its runtime classes are resolved: what
|
|
5
23
|
* its pressable reports (`pressed`, `hovered`, `focused`, `focusVisible`)
|
|
6
24
|
* and what its props say: `disabled`, and `aria-checked`, `aria-selected` and
|
|
7
25
|
* the rest under their attribute names, so `aria-pressed` cannot be read as
|
|
8
|
-
* the pointer's `pressed`.
|
|
26
|
+
* the pointer's `pressed`. Plain data-presence conditions use `data-foo`
|
|
27
|
+
* booleans supplied by the actual owner: true means the attribute is present,
|
|
28
|
+
* false means absent, and a missing key is unassessed (and diagnosed).
|
|
29
|
+
* Simple equality predicates use `data-foo=value` booleans, with case-sensitive
|
|
30
|
+
* safe token values normalized at build time. Presence cannot satisfy equality.
|
|
31
|
+
* These are normalized facts, not raw HTML attribute values or selectors.
|
|
9
32
|
*/
|
|
10
33
|
export type ClassState = Readonly<Record<string, unknown>>;
|
|
11
34
|
/**
|
|
12
35
|
* A class that applies only in a state: the state keys that all have to
|
|
13
36
|
* hold, and the style it applies then. `active:opacity-80` is
|
|
14
37
|
* `[['pressed'], { opacity: 0.8 }]`.
|
|
38
|
+
* Generated Tailwind owner states may append a cached cascade rank; legacy
|
|
39
|
+
* two-entry groups and mixed/unranked conditional domains keep their order.
|
|
40
|
+
* `!aria-…` is compiler-owned negative-predicate data. It still requires the
|
|
41
|
+
* underlying owner fact; an absent fact is not a measured false value.
|
|
15
42
|
*/
|
|
16
|
-
export type StateGroup = readonly [readonly string[], StyleObject];
|
|
43
|
+
export type StateGroup = readonly [readonly string[], StyleObject, number?];
|
|
17
44
|
/**
|
|
18
45
|
* Resolves whitespace-separated class names to React Native style objects.
|
|
19
46
|
*
|
|
@@ -25,7 +52,44 @@ export type StateGroup = readonly [readonly string[], StyleObject];
|
|
|
25
52
|
* in a state is reported as it always was; with it, that class applies
|
|
26
53
|
* when its state holds, after the unconditional ones.
|
|
27
54
|
*/
|
|
28
|
-
|
|
55
|
+
type Composer = (styles: StyleObject[], deferred?: number) => StyleObject[];
|
|
56
|
+
export type ClassResolver = ((value: unknown, state?: ClassState, deferred?: number) => StyleObject[]) & {
|
|
57
|
+
/** @internal Compiler-generated identities for mixed effect boundaries. */
|
|
58
|
+
shadowSlots?: ReadonlyMap<StyleObject, ShadowSlots>;
|
|
59
|
+
gradientSlots?: ReadonlyMap<StyleObject, GradientSlots>;
|
|
60
|
+
transformSlots?: ReadonlyMap<StyleObject, TransformSlots>;
|
|
61
|
+
filterSlots?: ReadonlyMap<StyleObject, FilterSlots>;
|
|
62
|
+
/** @internal Identity of implicit leading, including on maps without explicit leading. */
|
|
63
|
+
fontDefaults?: ReadonlySet<StyleObject> | ReadonlyMap<StyleObject, StyleObject>;
|
|
64
|
+
/** @internal Captured register writes keyed by original generated style. */
|
|
65
|
+
leadingRegisters?: ReadonlyMap<StyleObject, StyleObject>;
|
|
66
|
+
/** @internal Bit mask of this namespace's installed deferrable composers. */
|
|
67
|
+
effectMask?: number;
|
|
68
|
+
/**
|
|
69
|
+
* @internal Development only. Warn once about each name absent from the map,
|
|
70
|
+
* unless `markers` declares it: an exact name, or a prefix ending in `*`.
|
|
71
|
+
* The bundler calls it behind `__DEV__`, so a release build never does.
|
|
72
|
+
*/
|
|
73
|
+
warnUnknownClasses?: (markers: readonly string[]) => void;
|
|
74
|
+
};
|
|
75
|
+
/** @internal Generated-data ABI, not a utility parser or a public cascade API. */
|
|
76
|
+
export interface ClassResolverPlan {
|
|
77
|
+
schema: 1;
|
|
78
|
+
styles: Record<string, StyleObject>;
|
|
79
|
+
unsupported?: Record<string, string>;
|
|
80
|
+
states?: Record<string, readonly StateGroup[]>;
|
|
81
|
+
ambient?: ClassState;
|
|
82
|
+
compose?: Composer;
|
|
83
|
+
/** Ordinals from one complete compiler namespace. Missing means barrier. */
|
|
84
|
+
ordering: {
|
|
85
|
+
schema: 1;
|
|
86
|
+
ranks: Readonly<Record<string, readonly number[]>>;
|
|
87
|
+
/** Compiler-proven disjoint sets: unranked colours and admitted ranked scalars. */
|
|
88
|
+
independentColors?: readonly [barriers: string, independent: string];
|
|
89
|
+
/** Lists disjoint colour writers. Older schema-1 maps may send a redundant true. */
|
|
90
|
+
rankedStates?: true | string;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
29
93
|
/**
|
|
30
94
|
* Builds a resolver over one project's candidate map.
|
|
31
95
|
*
|
|
@@ -44,6 +108,15 @@ export type ClassResolver = (value: unknown, state?: ClassState) => StyleObject[
|
|
|
44
108
|
* state (#886). Those need no tracking here: the pressable that renders
|
|
45
109
|
* the element already tracks it and hands it in, so this stays a function
|
|
46
110
|
* of the class string and that state.
|
|
111
|
+
*
|
|
112
|
+
* `ambient` holds facts that cannot change while the app runs, so no
|
|
113
|
+
* element has to supply them: `rtl` and `ltr`, because React Native needs
|
|
114
|
+
* a reload for a direction change to take effect. A class conditioned on
|
|
115
|
+
* them alone is decided once, when its string is first resolved, and then
|
|
116
|
+
* cached like an unconditional one -- after the unconditional ones, which is
|
|
117
|
+
* where Tailwind puts a variant too.
|
|
47
118
|
*/
|
|
48
|
-
export declare function createClassResolver(
|
|
119
|
+
export declare function createClassResolver(plan: ClassResolverPlan): ClassResolver;
|
|
120
|
+
export declare function createClassResolver(styles: Record<string, StyleObject>, unsupported?: Record<string, string>, compose?: Composer, states?: Record<string, readonly StateGroup[]>, ambient?: ClassState): ClassResolver;
|
|
121
|
+
export {};
|
|
49
122
|
//# sourceMappingURL=class-resolver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class-resolver.d.ts","sourceRoot":"","sources":["../src/class-resolver.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAEjD
|
|
1
|
+
{"version":3,"file":"class-resolver.d.ts","sourceRoot":"","sources":["../src/class-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAExD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,6DAA6D;AAC7D,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAEjD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,WAAW,EAAE,EACrB,QAAQ,EAAE,WAAW,CAAC,WAAW,EAAE,WAAW,CAAC,EAC/C,SAAS,CAAC,EAAE,WAAW,CAAC,WAAW,EAAE,WAAW,CAAC,GAChD,WAAW,EAAE,CAyBf;AAED,KAAK,eAAe,GAAG,WAAW,GAAG,SAAS,eAAe,EAAE,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,CAAA;AAE1F;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,SAAS,eAAe,EAAE,EAClC,WAAW,EAAE,SAAS,WAAW,EAAE,EACnC,iBAAiB,CAAC,EAAE,WAAW,CAAC,WAAW,CAAC,GAAG,WAAW,CAAC,WAAW,EAAE,WAAW,CAAC,EACpF,kBAAkB,CAAC,EAAE,WAAW,CAAC,WAAW,EAAE,WAAW,CAAC,EAC1D,Y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