@hozo/engine 0.1.0 → 0.3.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 +37 -0
- package/README.md +34 -0
- package/dist/class-resolver.d.ts +28 -5
- package/dist/class-resolver.d.ts.map +1 -1
- package/dist/class-resolver.js +59 -22
- package/dist/class-resolver.js.map +1 -1
- package/dist/color-transition.d.ts.map +1 -1
- package/dist/color-transition.js +6 -0
- package/dist/color-transition.js.map +1 -1
- package/dist/generated/animation.d.ts +1 -0
- package/dist/generated/animation.d.ts.map +1 -1
- package/dist/generated/animation.js +1 -0
- package/dist/generated/animation.js.map +1 -1
- package/dist/generated/transform-slots.d.ts +2 -0
- package/dist/generated/transform-slots.d.ts.map +1 -0
- package/dist/generated/transform-slots.js +4 -0
- package/dist/generated/transform-slots.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/index.native.d.ts +1 -0
- package/dist/index.native.d.ts.map +1 -1
- package/dist/index.native.js +1 -0
- package/dist/index.native.js.map +1 -1
- package/dist/interactive.d.ts +2 -0
- package/dist/interactive.d.ts.map +1 -1
- package/dist/interactive.js +4 -0
- package/dist/interactive.js.map +1 -1
- package/dist/keyframes.native.d.ts +27 -0
- package/dist/keyframes.native.d.ts.map +1 -0
- package/dist/keyframes.native.js +167 -0
- package/dist/keyframes.native.js.map +1 -0
- package/dist/project.d.ts +8 -0
- package/dist/project.d.ts.map +1 -1
- package/dist/project.js +9 -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/transform-slots.d.ts +22 -0
- package/dist/transform-slots.d.ts.map +1 -0
- package/dist/transform-slots.js +108 -0
- package/dist/transform-slots.js.map +1 -0
- package/dist/view-base-css.d.ts +2 -0
- package/dist/view-base-css.d.ts.map +1 -0
- package/dist/view-base-css.js +20 -0
- package/dist/view-base-css.js.map +1 -0
- package/dist/view-base.d.ts +6 -0
- package/dist/view-base.d.ts.map +1 -0
- package/dist/view-base.js +15 -0
- package/dist/view-base.js.map +1 -0
- package/package.json +6 -1
- package/src/class-resolver.ts +93 -26
- package/src/color-transition.ts +6 -0
- package/src/generated/animation.ts +1 -0
- package/src/generated/transform-slots.ts +3 -0
- package/src/index.native.ts +5 -0
- package/src/index.ts +1 -1
- package/src/interactive.ts +4 -0
- package/src/keyframes.native.ts +210 -0
- package/src/project.native.ts +1 -1
- package/src/project.ts +11 -0
- package/src/transform-slots.ts +119 -0
- package/src/view-base-css.ts +19 -0
- package/src/view-base.ts +20 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# @hozo/engine
|
|
2
|
+
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Interrupted colour transitions read the RGBA string produced by their previous
|
|
8
|
+
blend, preserving the intermediate colour when a new transition starts.
|
|
9
|
+
|
|
10
|
+
### Minor Changes
|
|
11
|
+
|
|
12
|
+
- [#923](https://github.com/iray-tno/hozo/pull/923) [`8d58223`](https://github.com/iray-tno/hozo/commit/8d5822322607b6214fa7f57d233a9173a45815b6) Thanks [@iray-tno](https://github.com/iray-tno)! - Resolve Native pattern class-name slots through the project's runtime class resolver. Pattern controls now share the primitive interaction engine and deliver hover, focus, focus-visible and pressed facts to their actual owners instead of reporting pressed alone.
|
|
13
|
+
|
|
14
|
+
Static interaction styles are additionally wired for Chip, ColorPicker swatches, Pagination page controls and CommandPalette pointer-state item slots. Selection slots and nested controls retain their own ownership: a remove button does not inherit its row's focus, and a command item does not borrow the input's focus. Other static state slots and semantic predicates remain subject to their existing diagnostics.
|
|
15
|
+
|
|
16
|
+
Styled Button receives a pressed look; Checkbox and Switch indicators are real elements on both platforms rather than Native-invisible pseudo-elements. Non-transition Native Pressables and their Text children no longer allocate animation values/listeners. Interaction ownership remains mounted when transitions are added or removed. This removes idle animation work, not every initial-mount cost or every platform delivery difference; measured list mount/update tradeoffs remain tracked separately.
|
|
17
|
+
|
|
18
|
+
- [#923](https://github.com/iray-tno/hozo/pull/923) [`8d58223`](https://github.com/iray-tno/hozo/commit/8d5822322607b6214fa7f57d233a9173a45815b6) Thanks [@iray-tno](https://github.com/iray-tno)! - Compile project-defined Tailwind animations and their keyframes for both backends, including keyframes needed by dynamic class candidates. StyleX conditions inside property values now reach the shared condition model.
|
|
19
|
+
|
|
20
|
+
Extend Native negated conditions across supported environment, breakpoint, pixel-width, container, prop, sibling and interaction predicates. Link states use the existing interaction owner, descendant focus-visible follows that owner, and independent transform resets and runtime-state transform families compose without losing their other transform entries. Unsupported predicates are still diagnosed, not assumed false.
|
|
21
|
+
|
|
22
|
+
Respect project radius tokens and built-in radius overrides, discover runtime candidates in quoted class arrays, and preserve separate Native style keys for ternary branches. Caller classes override a component's resting look while explicit state classes retain their precedence. On Web, fallback candidate rules stay below authored Tailwind utilities, and conditional class selection reaches elements that remain components.
|
|
23
|
+
|
|
24
|
+
Native line-breaking utilities that cannot be represented now warn instead of failing the build. This does not implement Android/CJK line-break controls that React Native does not expose.
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- [#923](https://github.com/iray-tno/hozo/pull/923) [`8d58223`](https://github.com/iray-tno/hozo/commit/8d5822322607b6214fa7f57d233a9173a45815b6) Thanks [@iray-tno](https://github.com/iray-tno)! - Uncompiled View, Text and Image forward refs to their platform hosts. Container measurement preserves the host instead of replacing it, and Web View layout defaults agree between compiled output and fallback components.
|
|
29
|
+
|
|
30
|
+
An uncompiled Svg now uses its accessibility label as its name, as the compiled path already did. Web controls, including generated Canvas controls and form/pattern actions, show the shared clickable cursor without giving disabled controls an active pointer.
|
|
31
|
+
|
|
32
|
+
## 0.2.0
|
|
33
|
+
|
|
34
|
+
- Add the Native `useHozoKeyframes` hook and generated animation ABI for the supported project-keyframe subset.
|
|
35
|
+
- Keep the compiled-output engine aligned with 0.2.0 motion/theme lowering. Rebuild output when upgrading rather than mixing compiler and engine versions.
|
|
36
|
+
|
|
37
|
+
See the [Hozo release notes and migration steps](https://github.com/iray-tno/hozo/blob/main/CHANGELOG.md#020) for cross-package changes and measured boundaries.
|
package/README.md
CHANGED
|
@@ -13,6 +13,40 @@ platform adapter, because Hozo does not add a native module to every application
|
|
|
13
13
|
|
|
14
14
|
**Contextual variants.** `dark:`, `sm:`/`md:`/`lg:`, and viewport-relative sizes are media queries on Web and subscriptions on Native. `useHozoDark`, `useHozoBreakpoint` and `useHozoViewport` are separate stores on purpose: a component using only `md:` must not re-render on every resize that does not cross a breakpoint.
|
|
15
15
|
|
|
16
|
+
**Native transform controls.** `rotate-none`, `scale-none`, `translate-none`, and
|
|
17
|
+
`transform-none` reset their own CSS transform property, not every transform.
|
|
18
|
+
For example, `rotate-45 scale-95 md:rotate-none` keeps its scale when the rotation
|
|
19
|
+
is reset. `transform`/`transform-cpu` restore the function-slot chain; they do not
|
|
20
|
+
switch Native rendering to a CPU backend. Unconditional controls compile into
|
|
21
|
+
plain StyleSheet values. Conditional controls and dynamic class strings use one
|
|
22
|
+
small slot composer, without extra state or subscriptions; dynamic results stay
|
|
23
|
+
cached by class string. `transform-gpu` still reports a diagnostic because a
|
|
24
|
+
browser compositing hint cannot force a Native hardware layer. Transform controls
|
|
25
|
+
combined with `starting:`/exit animation frames, or used as independent
|
|
26
|
+
`@keyframes` controls, remain explicitly unwired. Use explicit transform values
|
|
27
|
+
for those animation endpoints.
|
|
28
|
+
|
|
29
|
+
**Native negated variants.** `not-disabled:`, `not-enabled:`, `not-aria-*:`,
|
|
30
|
+
negated known sibling predicates such as `not-first:`/`not-last:`, and negated
|
|
31
|
+
supported environment queries such as `not-motion-reduce:` reuse the positive
|
|
32
|
+
predicate, including when stacked with other supported conditions. Prop predicates
|
|
33
|
+
need the same readable driver as their positive form; `not-disabled:` without a
|
|
34
|
+
`disabled` prop or an unreadable ARIA state is still a diagnostic, not a false value
|
|
35
|
+
to invert. `not-enabled:` follows the existing `enabled:` contract: without a
|
|
36
|
+
`disabled` prop, enabled is known true and its negation does not apply. Unknown
|
|
37
|
+
sibling positions and unsupported environment queries remain diagnostics too.
|
|
38
|
+
Boolean ARIA predicates match the literal `true` state; an optional state object
|
|
39
|
+
can be absent at runtime, and `checked: 'mixed'` is not treated as checked=true.
|
|
40
|
+
Known sibling predicates cost no runtime state; environment queries share their
|
|
41
|
+
existing hook. `not-focus:` and `not-focus-visible:` on Pressable/Button reuse
|
|
42
|
+
their existing interaction callback, including stacked conditions and transitions;
|
|
43
|
+
negated focus-visible alone enables the same pointer/keyboard modality inference
|
|
44
|
+
as its positive form. Text in that interaction context uses the owner's state,
|
|
45
|
+
not an independent text focus target, just as positive focus variants do. No new
|
|
46
|
+
store or subscription is added. Other elements without a readable focus driver
|
|
47
|
+
remain diagnostics. `not-hover:` and other unsupported selector negations remain
|
|
48
|
+
unwired.
|
|
49
|
+
|
|
16
50
|
**Interaction state infrastructure.** The canonical `HozoPressable` in `@hozo/primitives` tracks
|
|
17
51
|
pressed, hovered, focused and focus-visible state using the shared helpers owned here. Focus-visible
|
|
18
52
|
follows the input modality, so a tap does not draw a focus ring and a Tab key does.
|
package/dist/class-resolver.d.ts
CHANGED
|
@@ -1,26 +1,49 @@
|
|
|
1
1
|
/** A React Native style object, as the compiler emits it. */
|
|
2
2
|
export type StyleObject = Record<string, unknown>;
|
|
3
|
+
/**
|
|
4
|
+
* The state an element is in when its runtime classes are resolved: what
|
|
5
|
+
* its pressable reports (`pressed`, `hovered`, `focused`, `focusVisible`)
|
|
6
|
+
* and what its props say: `disabled`, and `aria-checked`, `aria-selected` and
|
|
7
|
+
* the rest under their attribute names, so `aria-pressed` cannot be read as
|
|
8
|
+
* the pointer's `pressed`.
|
|
9
|
+
*/
|
|
10
|
+
export type ClassState = Readonly<Record<string, unknown>>;
|
|
11
|
+
/**
|
|
12
|
+
* A class that applies only in a state: the state keys that all have to
|
|
13
|
+
* hold, and the style it applies then. `active:opacity-80` is
|
|
14
|
+
* `[['pressed'], { opacity: 0.8 }]`.
|
|
15
|
+
*/
|
|
16
|
+
export type StateGroup = readonly [readonly string[], StyleObject];
|
|
3
17
|
/**
|
|
4
18
|
* Resolves whitespace-separated class names to React Native style objects.
|
|
5
19
|
*
|
|
6
20
|
* Returns an array, which is a valid `style` value on its own and also
|
|
7
21
|
* nests inside one -- RN flattens arbitrarily nested style arrays, so
|
|
8
22
|
* callers never have to spread it.
|
|
23
|
+
*
|
|
24
|
+
* `state` is what the element is in. Without it, a class that applies only
|
|
25
|
+
* in a state is reported as it always was; with it, that class applies
|
|
26
|
+
* when its state holds, after the unconditional ones.
|
|
9
27
|
*/
|
|
10
|
-
export type ClassResolver = (value: unknown) => StyleObject[];
|
|
28
|
+
export type ClassResolver = (value: unknown, state?: ClassState) => StyleObject[];
|
|
11
29
|
/**
|
|
12
30
|
* Builds a resolver over one project's candidate map.
|
|
13
31
|
*
|
|
14
32
|
* Called by the generated candidate module rather than by application
|
|
15
|
-
* code: `styles` and `
|
|
16
|
-
* keeps the generated file to data plus one call.
|
|
33
|
+
* code: `styles`, `unsupported` and `states` are build output, and binding
|
|
34
|
+
* them here keeps the generated file to data plus one call.
|
|
17
35
|
*
|
|
18
36
|
* `unsupported` maps a class the compiler *recognized but can't express*
|
|
19
|
-
* as a plain style object -- a
|
|
37
|
+
* as a plain style object -- a utility under a breakpoint or `dark:`, or
|
|
20
38
|
* one that's Web-only -- to the reason. Those are reported when they're
|
|
21
39
|
* actually used rather than at build time, because a class appearing in
|
|
22
40
|
* the project's candidate scan doesn't mean any dynamic expression ever
|
|
23
41
|
* produces it.
|
|
42
|
+
*
|
|
43
|
+
* `states` holds the classes whose only condition is the element's own
|
|
44
|
+
* state (#886). Those need no tracking here: the pressable that renders
|
|
45
|
+
* the element already tracks it and hands it in, so this stays a function
|
|
46
|
+
* of the class string and that state.
|
|
24
47
|
*/
|
|
25
|
-
export declare function createClassResolver(styles: Record<string, StyleObject>, unsupported?: Record<string, string>): ClassResolver;
|
|
48
|
+
export declare function createClassResolver(styles: Record<string, StyleObject>, unsupported?: Record<string, string>, compose?: (styles: StyleObject[]) => StyleObject[], states?: Record<string, readonly StateGroup[]>): ClassResolver;
|
|
26
49
|
//# 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;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,OAAO,KAAK,WAAW,EAAE,CAAA;
|
|
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;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;AAE1D;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,SAAS,CAAC,SAAS,MAAM,EAAE,EAAE,WAAW,CAAC,CAAA;AAElE;;;;;;;;;;GAUG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,UAAU,KAAK,WAAW,EAAE,CAAA;AAYjF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,EACnC,WAAW,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,EACxC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,EAClD,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAAM,GACjD,aAAa,CA0Ef"}
|
package/dist/class-resolver.js
CHANGED
|
@@ -2,55 +2,92 @@
|
|
|
2
2
|
* Builds a resolver over one project's candidate map.
|
|
3
3
|
*
|
|
4
4
|
* Called by the generated candidate module rather than by application
|
|
5
|
-
* code: `styles` and `
|
|
6
|
-
* keeps the generated file to data plus one call.
|
|
5
|
+
* code: `styles`, `unsupported` and `states` are build output, and binding
|
|
6
|
+
* them here keeps the generated file to data plus one call.
|
|
7
7
|
*
|
|
8
8
|
* `unsupported` maps a class the compiler *recognized but can't express*
|
|
9
|
-
* as a plain style object -- a
|
|
9
|
+
* as a plain style object -- a utility under a breakpoint or `dark:`, or
|
|
10
10
|
* one that's Web-only -- to the reason. Those are reported when they're
|
|
11
11
|
* actually used rather than at build time, because a class appearing in
|
|
12
12
|
* the project's candidate scan doesn't mean any dynamic expression ever
|
|
13
13
|
* produces it.
|
|
14
|
+
*
|
|
15
|
+
* `states` holds the classes whose only condition is the element's own
|
|
16
|
+
* state (#886). Those need no tracking here: the pressable that renders
|
|
17
|
+
* the element already tracks it and hands it in, so this stays a function
|
|
18
|
+
* of the class string and that state.
|
|
14
19
|
*/
|
|
15
|
-
export function createClassResolver(styles, unsupported = {}) {
|
|
20
|
+
export function createClassResolver(styles, unsupported = {}, compose, states = {}) {
|
|
16
21
|
// Class strings repeat constantly across renders and list items, and the
|
|
17
22
|
// result is immutable, so each distinct string is resolved once.
|
|
18
23
|
const cache = new Map();
|
|
19
24
|
// Warn once per class, not once per render -- a warning inside a list's
|
|
20
25
|
// render path would otherwise repeat for every row, every frame.
|
|
21
26
|
const warned = new Set();
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const
|
|
27
|
+
const warn = (name, reason) => {
|
|
28
|
+
if (warned.has(name))
|
|
29
|
+
return;
|
|
30
|
+
warned.add(name);
|
|
31
|
+
// eslint-disable-next-line no-console
|
|
32
|
+
console.warn(`[hozo] ${reason}`);
|
|
33
|
+
};
|
|
34
|
+
function resolve(value) {
|
|
35
|
+
const base = [];
|
|
36
|
+
const groups = [];
|
|
37
|
+
const stateClasses = [];
|
|
33
38
|
for (const name of value.split(/\s+/)) {
|
|
34
39
|
if (name === '') {
|
|
35
40
|
continue;
|
|
36
41
|
}
|
|
37
42
|
const style = styles[name];
|
|
38
43
|
if (style) {
|
|
39
|
-
|
|
44
|
+
base.push(style);
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
const conditional = states[name];
|
|
48
|
+
if (conditional) {
|
|
49
|
+
groups.push(...conditional);
|
|
50
|
+
stateClasses.push(name);
|
|
40
51
|
continue;
|
|
41
52
|
}
|
|
42
53
|
// An unknown class isn't necessarily a Hozo problem -- it may be an
|
|
43
54
|
// app's own non-Tailwind class, or a testID-ish marker -- so only the
|
|
44
55
|
// ones the compiler recognized and refused are reported.
|
|
45
56
|
const reason = unsupported[name];
|
|
46
|
-
if (reason
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
57
|
+
if (reason)
|
|
58
|
+
warn(name, reason);
|
|
59
|
+
}
|
|
60
|
+
return { base: compose ? compose(base) : base, raw: base, groups, stateClasses };
|
|
61
|
+
}
|
|
62
|
+
return function hozoClasses(value, state) {
|
|
63
|
+
// Falsy is the normal case, not an error: `cond && 'p-4'` yields
|
|
64
|
+
// `false` whenever the condition is off.
|
|
65
|
+
if (typeof value !== 'string' || value === '') {
|
|
66
|
+
return [];
|
|
67
|
+
}
|
|
68
|
+
let resolved = cache.get(value);
|
|
69
|
+
if (!resolved) {
|
|
70
|
+
resolved = resolve(value);
|
|
71
|
+
cache.set(value, resolved);
|
|
72
|
+
}
|
|
73
|
+
if (resolved.groups.length === 0)
|
|
74
|
+
return resolved.base;
|
|
75
|
+
if (state === undefined) {
|
|
76
|
+
for (const name of resolved.stateClasses) {
|
|
77
|
+
warn(name, `\`${name}\` applies in a state, and this element hands its classes no state to ` +
|
|
78
|
+
'resolve it against. Put it on a Pressable, Button or Link, or write it as a static ' +
|
|
79
|
+
'className so it compiles to a real style variant.');
|
|
50
80
|
}
|
|
81
|
+
return resolved.base;
|
|
51
82
|
}
|
|
52
|
-
|
|
53
|
-
|
|
83
|
+
const active = resolved.groups.filter(([keys]) => keys.every((key) => Boolean(state[key])));
|
|
84
|
+
if (active.length === 0)
|
|
85
|
+
return resolved.base;
|
|
86
|
+
const all = [...resolved.raw, ...active.map(([, style]) => style)];
|
|
87
|
+
// A state style can carry a transform, which `compose` folds into one;
|
|
88
|
+
// so it runs over the whole list, and the result is per render rather
|
|
89
|
+
// than cached -- it changes with the state.
|
|
90
|
+
return compose ? compose(all) : all;
|
|
54
91
|
};
|
|
55
92
|
}
|
|
56
93
|
//# sourceMappingURL=class-resolver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class-resolver.js","sourceRoot":"","sources":["../src/class-resolver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"class-resolver.js","sourceRoot":"","sources":["../src/class-resolver.ts"],"names":[],"mappings":"AA0CA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAmC,EACnC,WAAW,GAA2B,EAAE,EACxC,OAAkD,EAClD,MAAM,GAA0C,EAAE;IAElD,yEAAyE;IACzE,iEAAiE;IACjE,MAAM,KAAK,GAAG,IAAI,GAAG,EAAoB,CAAA;IACzC,wEAAwE;IACxE,iEAAiE;IACjE,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;IAChC,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,MAAc,EAAE,EAAE;QAC5C,IAAI,MAAM,CAAC,GAAG,CAAC,IA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AC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;IACrC,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-transition.d.ts","sourceRoot":"","sources":["../src/color-transition.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"color-transition.d.ts","sourceRoot":"","sources":["../src/color-transition.ts"],"names":[],"mappings":"AAqBA,sFAAsF;AACtF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,UAUpE"}
|
package/dist/color-transition.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
function rgba(color) {
|
|
2
2
|
if (color === 'transparent')
|
|
3
3
|
return [0, 0, 0, 0];
|
|
4
|
+
// An interrupted blend must be able to read its own serialized result.
|
|
5
|
+
const blended = /^rgba\((\d+), (\d+), (\d+), ([\d.e+-]+)\)$/.exec(color);
|
|
6
|
+
if (blended) {
|
|
7
|
+
const channels = blended.slice(1).map(Number);
|
|
8
|
+
return channels.every(Number.isFinite) ? channels : null;
|
|
9
|
+
}
|
|
4
10
|
const match = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(color);
|
|
5
11
|
if (!match)
|
|
6
12
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-transition.js","sourceRoot":"","sources":["../src/color-transition.ts"],"names":[],"mappings":"AAAA,SAAS,IAAI,CAAC,KAAa;IACzB,IAAI,KAAK,KAAK,aAAa;QAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IAChD,MAAM,KAAK,GAAG,2CAA2C,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACrE,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IACvB,IAAI,GAAG,GAAG,KAAK,CAAC,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}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../src/generated/animation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA"}
|
|
1
|
+
{"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../src/generated/animation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACzE,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animation.js","sourceRoot":"","sources":["../../src/generated/animation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,OAAO,EAAsB,gBAAgB,EAAE,MAAM,oBAAoB,CAAA"}
|
|
1
|
+
{"version":3,"file":"animation.js","sourceRoot":"","sources":["../../src/generated/animation.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,OAAO,EAAsB,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACzE,OAAO,EAA6C,gBAAgB,EAAE,MAAM,wBAAwB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform-slots.d.ts","sourceRoot":"","sources":["../../src/generated/transform-slots.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform-slots.js","sourceRoot":"","sources":["../../src/generated/transform-slots.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,qEAAqE;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -8,4 +8,5 @@ export { hozoInteractive } from './interactive.ts';
|
|
|
8
8
|
export { type HozoResponderEvent, type HozoResponderTouch, type HozoTouchHistory, type HozoTouchTrack, type ResponderProps, useResponderDomProps, } from './responder.ts';
|
|
9
9
|
export { hozoScrollable } from './scrollable.ts';
|
|
10
10
|
export { HOZO_DEFAULT_FONT_SIZE, HozoTextSizeContext, useHozoTextSize, } from './text-size.ts';
|
|
11
|
+
export { hozoViewBase, hozoViewClassName } from './view-base.ts';
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACtE,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,EACnC,yBAAyB,GAC1B,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,KAAK,aAAa,EAAE,mBAAmB,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,KAAK,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,oBAAoB,GACrB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACtE,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,EACnC,yBAAyB,GAC1B,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,KAAK,aAAa,EAAE,mBAAmB,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,KAAK,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,oBAAoB,GACrB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,GAChB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -27,4 +27,5 @@ export { hozoInteractive } from './interactive.js';
|
|
|
27
27
|
export { useResponderDomProps, } from './responder.js';
|
|
28
28
|
export { hozoScrollable } from './scrollable.js';
|
|
29
29
|
export { HOZO_DEFAULT_FONT_SIZE, HozoTextSizeContext, useHozoTextSize, } from './text-size.js';
|
|
30
|
+
export { hozoViewBase, hozoViewClassName } from './view-base.js';
|
|
30
31
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,0EAA0E;AAC1E,2EAA2E;AAC3E,+DAA+D;AAC/D,EAAE;AACF,2EAA2E;AAC3E,yEAAyE;AACzE,uBAAuB;AACvB,EAAE;AACF,2EAA2E;AAC3E,0EAA0E;AAC1E,qEAAqE;AACrE,qEAAqE;AACrE,0EAA0E;AAC1E,0EAA0E;AAC1E,0DAA0D;AAE1D,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACtE,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EAIrB,yBAAyB,GAC1B,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAsB,mBAAmB,EAAoB,MAAM,qBAAqB,CAAA;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAqB,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAML,oBAAoB,GACrB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,0EAA0E;AAC1E,2EAA2E;AAC3E,+DAA+D;AAC/D,EAAE;AACF,2EAA2E;AAC3E,yEAAyE;AACzE,uBAAuB;AACvB,EAAE;AACF,2EAA2E;AAC3E,0EAA0E;AAC1E,qEAAqE;AACrE,qEAAqE;AACrE,0EAA0E;AAC1E,0EAA0E;AAC1E,0DAA0D;AAE1D,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AACtE,OAAO,EACL,2BAA2B,EAC3B,qBAAqB,EAIrB,yBAAyB,GAC1B,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAsB,mBAAmB,EAAoB,MAAM,qBAAqB,CAAA;AAC/F,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAqB,YAAY,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAML,oBAAoB,GACrB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,GAChB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA"}
|
package/dist/index.native.d.ts
CHANGED
|
@@ -4,5 +4,6 @@ export { type HozoDomStyle, hozoDomProps, hozoDomStyle } from './dom-style.nativ
|
|
|
4
4
|
export { type HozoAnimation, useHozoAnimation, useHozoBreakpoint, useHozoDark, useHozoEnvironment, useHozoViewport, useHozoWidthAtLeast, } from './hooks.native.ts';
|
|
5
5
|
export { hozoImageSource } from './image-source.native.ts';
|
|
6
6
|
export * from './index.ts';
|
|
7
|
+
export { type HozoKeyframe, type HozoKeyframesSpec, useHozoKeyframes, } from './keyframes.native.ts';
|
|
7
8
|
export { type HozoSafeAreaInsets, useHozoSafeArea } from './safe-area.native.ts';
|
|
8
9
|
//# sourceMappingURL=index.native.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAmBA,OAAO,wBAAwB,CAAA;AAE/B,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAI5D,OAAO,EAAE,KAAK,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACrF,OAAO,EACL,KAAK,aAAa,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,mBAAmB,GACpB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,cAAc,YAAY,CAAA;AAC1B,OAAO,EAAE,KAAK,kBAAkB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAmBA,OAAO,wBAAwB,CAAA;AAE/B,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAI5D,OAAO,EAAE,KAAK,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACrF,OAAO,EACL,KAAK,aAAa,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,mBAAmB,GACpB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,cAAc,YAAY,CAAA;AAC1B,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACtB,gBAAgB,GACjB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,KAAK,kBAAkB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA"}
|
package/dist/index.native.js
CHANGED
|
@@ -24,5 +24,6 @@ export { hozoDomProps, hozoDomStyle } from './dom-style.native.js';
|
|
|
24
24
|
export { useHozoAnimation, useHozoBreakpoint, useHozoDark, useHozoEnvironment, useHozoViewport, useHozoWidthAtLeast, } from './hooks.native.js';
|
|
25
25
|
export { hozoImageSource } from './image-source.native.js';
|
|
26
26
|
export * from './index.js';
|
|
27
|
+
export { useHozoKeyframes, } from './keyframes.native.js';
|
|
27
28
|
export { useHozoSafeArea } from './safe-area.native.js';
|
|
28
29
|
//# sourceMappingURL=index.native.js.map
|
package/dist/index.native.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,EAAE;AACF,yEAAyE;AACzE,wEAAwE;AACxE,sEAAsE;AACtE,wEAAwE;AACxE,6BAA6B;AAC7B,EAAE;AACF,yEAAyE;AACzE,4EAA4E;AAC5E,2EAA2E;AAC3E,0EAA0E;AAC1E,qBAAqB;AAErB,mEAAmE;AACnE,kEAAkE;AAClE,0EAA0E;AAC1E,yEAAyE;AACzE,mBAAmB;AACnB,OAAO,wBAAwB,CAAA;AAG/B,sEAAsE;AACtE,0EAA0E;AAC1E,gCAAgC;AAChC,OAAO,EAAqB,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACrF,OAAO,EAEL,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,mBAAmB,GACpB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,cAAc,YAAY,CAAA;AAC1B,OAAO,EAA2B,eAAe,EAAE,MAAM,uBAAuB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,EAAE;AACF,yEAAyE;AACzE,wEAAwE;AACxE,sEAAsE;AACtE,wEAAwE;AACxE,6BAA6B;AAC7B,EAAE;AACF,yEAAyE;AACzE,4EAA4E;AAC5E,2EAA2E;AAC3E,0EAA0E;AAC1E,qBAAqB;AAErB,mEAAmE;AACnE,kEAAkE;AAClE,0EAA0E;AAC1E,yEAAyE;AACzE,mBAAmB;AACnB,OAAO,wBAAwB,CAAA;AAG/B,sEAAsE;AACtE,0EAA0E;AAC1E,gCAAgC;AAChC,OAAO,EAAqB,YAAY,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACrF,OAAO,EAEL,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,mBAAmB,GACpB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,cAAc,YAAY,CAAA;AAC1B,OAAO,EAGL,gBAAgB,GACjB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAA2B,eAAe,EAAE,MAAM,uBAAuB,CAAA"}
|
package/dist/interactive.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ type PressHandler = (event: never) => void;
|
|
|
15
15
|
export declare function hozoInteractive(onPress?: PressHandler, disabled?: unknown): {
|
|
16
16
|
'aria-disabled': boolean;
|
|
17
17
|
'data-hozo-disabled': string;
|
|
18
|
+
'data-hozo-pressable': undefined;
|
|
18
19
|
tabIndex: number;
|
|
19
20
|
onClick: undefined;
|
|
20
21
|
onKeyDown: undefined;
|
|
@@ -22,6 +23,7 @@ export declare function hozoInteractive(onPress?: PressHandler, disabled?: unkno
|
|
|
22
23
|
} | {
|
|
23
24
|
'aria-disabled': undefined;
|
|
24
25
|
'data-hozo-disabled': undefined;
|
|
26
|
+
'data-hozo-pressable': string | undefined;
|
|
25
27
|
tabIndex: number;
|
|
26
28
|
onClick: PressHandler | undefined;
|
|
27
29
|
onKeyDown: typeof hozoActivateKeyDown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive.d.ts","sourceRoot":"","sources":["../src/interactive.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAEtE,wEAAwE;AACxE,KAAK,YAAY,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;AAE1C;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,OAAO
|
|
1
|
+
{"version":3,"file":"interactive.d.ts","sourceRoot":"","sources":["../src/interactive.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAEtE,wEAAwE;AACxE,KAAK,YAAY,GAAG,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;AAE1C;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,YAAY,EAAE,QAAQ,CAAC,EAAE,OAAO;;;;;;;;;;;;;;;;EAmCzE"}
|
package/dist/interactive.js
CHANGED
|
@@ -44,6 +44,7 @@ export function hozoInteractive(onPress, disabled) {
|
|
|
44
44
|
// a boolean here would have made every control permanently
|
|
45
45
|
// disabled-looking. `undefined` is the only value React omits.
|
|
46
46
|
'data-hozo-disabled': '',
|
|
47
|
+
'data-hozo-pressable': undefined,
|
|
47
48
|
tabIndex: -1,
|
|
48
49
|
onClick: undefined,
|
|
49
50
|
onKeyDown: undefined,
|
|
@@ -55,6 +56,9 @@ export function hozoInteractive(onPress, disabled) {
|
|
|
55
56
|
// is noise a screen reader has to read past.
|
|
56
57
|
'aria-disabled': undefined,
|
|
57
58
|
'data-hozo-disabled': undefined,
|
|
59
|
+
// The pointer cursor's hook (see the view base CSS): present only
|
|
60
|
+
// while clicking does something.
|
|
61
|
+
'data-hozo-pressable': onPress ? '' : undefined,
|
|
58
62
|
tabIndex: 0,
|
|
59
63
|
onClick: onPress,
|
|
60
64
|
onKeyDown: hozoActivateKeyDown,
|
package/dist/interactive.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive.js","sourceRoot":"","sources":["../src/interactive.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,EAAE;AACF,0E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,8BAA8B;AAC9B,EAAE;AACF,yEAAyE;AACzE,0EAA0E;AAC1E,0DAA0D;AAE1D,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AAKtE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAAC,OAAsB,EAAE,QAAkB;IACxE,OAAO,QAAQ;QACb,CAAC,CAAC;YACE,eAAe,EAAE,IAAI;YACrB,8DAA8D;YAC9D,kEAAkE;YAClE,kEAAkE;YAClE,4DAA4D;YAC5D,EAAE;YACF,iEAAiE;YACjE,iEAAiE;YACjE,kEAAkE;YAClE,2DAA2D;YAC3D,+DAA+D;YAC/D,oBAAoB,EAAE,EAAE;YACxB,qBAAqB,EAAE,SAAS;YAChC,QAAQ,EAAE,CAAC,CAAC;YACZ,OAAO,EAAE,SAAS;YAClB,SAAS,EAAE,SAAS;YACpB,OAAO,EAAE,SAAS;SACnB;QACH,CAAC,CAAC;YACE,+DAA+D;YAC/D,mEAAmE;YACnE,6CAA6C;YAC7C,eAAe,EAAE,SAAS;YAC1B,oBAAoB,EAAE,SAAS;YAC/B,kEAAkE;YAClE,iCAAiC;YACjC,qBAAqB,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;YAC/C,QAAQ,EAAE,CAAC;YACX,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,mBAAmB;YAC9B,OAAO,EAAE,iBAAiB;SAC3B,CAAA;AACP,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface HozoKeyframe {
|
|
2
|
+
/** Where the frame sits, 0 to 1: `from`, `50%`, `to`. */
|
|
3
|
+
at: number;
|
|
4
|
+
/** The frame as a React Native style. */
|
|
5
|
+
style: {
|
|
6
|
+
opacity?: number;
|
|
7
|
+
backgroundColor?: string;
|
|
8
|
+
borderColor?: string;
|
|
9
|
+
color?: string;
|
|
10
|
+
transform?: Record<string, number | string>[];
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface HozoKeyframesSpec {
|
|
14
|
+
frames: HozoKeyframe[];
|
|
15
|
+
/** `animation-duration`, in milliseconds. */
|
|
16
|
+
duration: number;
|
|
17
|
+
/** `animation-delay`, in milliseconds. */
|
|
18
|
+
delay?: number;
|
|
19
|
+
/** `animation-timing-function`: a keyword, or a cubic-bezier's four numbers. */
|
|
20
|
+
easing?: 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | [number, number, number, number];
|
|
21
|
+
/** `animation-iteration-count`; `-1` is `infinite`. */
|
|
22
|
+
iterations?: number;
|
|
23
|
+
direction?: 'normal' | 'reverse' | 'alternate' | 'alternate-reverse';
|
|
24
|
+
fillMode?: 'none' | 'forwards' | 'backwards' | 'both';
|
|
25
|
+
}
|
|
26
|
+
export declare function useHozoKeyframes(spec: HozoKeyframesSpec): Record<string, unknown> | null;
|
|
27
|
+
//# sourceMappingURL=keyframes.native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyframes.native.d.ts","sourceRoot":"","sources":["../src/keyframes.native.ts"],"names":[],"mappings":"AAiBA,MAAM,WAAW,YAAY;IAC3B,yDAAyD;IACzD,EAAE,EAAE,MAAM,CAAA;IACV,yCAAyC;IACzC,KAAK,EAAE;QACL,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,eAAe,CAAC,EAAE,MAAM,CAAA;QACxB,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;KAC9C,CAAA;CACF;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,YAAY,EAAE,CAAA;IACtB,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,CAAA;IAChB,0CAA0C;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gFAAgF;IAChF,MAAM,CAAC,EACH,QAAQ,GACR,MAAM,GACN,SAAS,GACT,UAAU,GACV,aAAa,GACb,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;IACpC,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,mBAAmB,CAAA;IACpE,QAAQ,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,WAAW,GAAG,MAAM,CAAA;CACtD;AAoDD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,iBAAiB,kCA6GvD"}
|