@hozo/engine 0.4.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 +57 -0
- 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/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 +39 -4
- package/dist/class-resolver.d.ts.map +1 -1
- package/dist/class-resolver.js +357 -67
- package/dist/class-resolver.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/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/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/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/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/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/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 +3 -1
- package/dist/spread-styles.d.ts.map +1 -1
- package/dist/spread-styles.js +6 -5
- package/dist/spread-styles.js.map +1 -1
- package/dist/text-inheritance.d.ts +0 -5
- package/dist/text-inheritance.d.ts.map +1 -1
- package/dist/text-inheritance.js +1 -7
- package/dist/text-inheritance.js.map +1 -1
- 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 +17 -1
- package/src/authored-edges.ts +94 -0
- package/src/class-name.native.ts +10 -0
- package/src/class-resolver.ts +424 -76
- package/src/filter-slots.ts +67 -0
- package/src/generated/authored-edges.ts +2 -0
- package/src/generated/class-resolver.ts +1 -0
- package/src/generated/filter-slots.ts +2 -0
- package/src/generated/gradient-slots.ts +2 -0
- package/src/generated/shadow-slots.ts +2 -0
- package/src/gradient-slots.ts +73 -0
- package/src/inline-edges.ts +14 -0
- package/src/shadow-slots.ts +78 -0
- package/src/spread-styles.ts +10 -3
- package/src/text-inheritance.ts +1 -16
- package/src/transform-slots.ts +11 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,62 @@
|
|
|
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
|
+
|
|
3
60
|
## 0.4.0
|
|
4
61
|
|
|
5
62
|
### Minor Changes
|
|
@@ -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":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EAAE,YAAY,EAAqB,MAAM,mBAAmB,CAAA;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAIxD,SAAS,OAAO,CAAC,KAAc,EAAE,IAAU;IACzC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,KAAK,MAAM,IAAI,IAAI,KAAK;YAAE,OAAO,CAAC,IAAI,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AC,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"}
|
|
@@ -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,3 +1,7 @@
|
|
|
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>;
|
|
3
7
|
/**
|
|
@@ -6,7 +10,14 @@ export type StyleObject = Record<string, unknown>;
|
|
|
6
10
|
* slot. The map marks actual generated objects, never class names or private
|
|
7
11
|
* style keys. Only maps containing these fallbacks install this composition.
|
|
8
12
|
*/
|
|
9
|
-
export declare function hozoTextMetricStyles(styles: StyleObject[], defaults: ReadonlyMap<StyleObject, StyleObject>): StyleObject[];
|
|
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[];
|
|
10
21
|
/**
|
|
11
22
|
* The state an element is in when its runtime classes are resolved: what
|
|
12
23
|
* its pressable reports (`pressed`, `hovered`, `focused`, `focusVisible`)
|
|
@@ -41,7 +52,26 @@ export type StateGroup = readonly [readonly string[], StyleObject, number?];
|
|
|
41
52
|
* in a state is reported as it always was; with it, that class applies
|
|
42
53
|
* when its state holds, after the unconditional ones.
|
|
43
54
|
*/
|
|
44
|
-
|
|
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
|
+
};
|
|
45
75
|
/** @internal Generated-data ABI, not a utility parser or a public cascade API. */
|
|
46
76
|
export interface ClassResolverPlan {
|
|
47
77
|
schema: 1;
|
|
@@ -49,11 +79,15 @@ export interface ClassResolverPlan {
|
|
|
49
79
|
unsupported?: Record<string, string>;
|
|
50
80
|
states?: Record<string, readonly StateGroup[]>;
|
|
51
81
|
ambient?: ClassState;
|
|
52
|
-
compose?:
|
|
82
|
+
compose?: Composer;
|
|
53
83
|
/** Ordinals from one complete compiler namespace. Missing means barrier. */
|
|
54
84
|
ordering: {
|
|
55
85
|
schema: 1;
|
|
56
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;
|
|
57
91
|
};
|
|
58
92
|
}
|
|
59
93
|
/**
|
|
@@ -83,5 +117,6 @@ export interface ClassResolverPlan {
|
|
|
83
117
|
* where Tailwind puts a variant too.
|
|
84
118
|
*/
|
|
85
119
|
export declare function createClassResolver(plan: ClassResolverPlan): ClassResolver;
|
|
86
|
-
export declare function createClassResolver(styles: Record<string, StyleObject>, unsupported?: Record<string, string>, compose?:
|
|
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 {};
|
|
87
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;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,WAAW,EAAE,EACrB,QAAQ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