@prototyp/skeletor 1.2.0 → 1.3.0-beta0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/lib/commonjs/components/Block/Block.js +9 -28
  2. package/lib/commonjs/components/Block/Block.js.map +1 -1
  3. package/lib/commonjs/components/InputFocusScrollView/InputFocusScrollView.js +8 -6
  4. package/lib/commonjs/components/InputFocusScrollView/InputFocusScrollView.js.map +1 -1
  5. package/lib/commonjs/components/Text/Text.js +5 -15
  6. package/lib/commonjs/components/Text/Text.js.map +1 -1
  7. package/lib/commonjs/hooks/skeleform/src/index.js +3 -5
  8. package/lib/commonjs/hooks/skeleform/src/index.js.map +1 -1
  9. package/lib/commonjs/testing/TestingPlayground.js +16 -0
  10. package/lib/commonjs/testing/TestingPlayground.js.map +1 -0
  11. package/lib/commonjs/utils/animations.js +10 -10
  12. package/lib/commonjs/utils/animations.js.map +1 -1
  13. package/lib/commonjs/utils/extract-animation-properties.js +63 -42
  14. package/lib/commonjs/utils/extract-animation-properties.js.map +1 -1
  15. package/lib/commonjs/utils/extract-skeletor-style-properties.js +38 -0
  16. package/lib/commonjs/utils/extract-skeletor-style-properties.js.map +1 -0
  17. package/lib/commonjs/utils/index.js +22 -0
  18. package/lib/commonjs/utils/index.js.map +1 -1
  19. package/lib/commonjs/utils/is-color-value.js +16 -3
  20. package/lib/commonjs/utils/is-color-value.js.map +1 -1
  21. package/lib/commonjs/utils/memoize-styles.js +49 -0
  22. package/lib/commonjs/utils/memoize-styles.js.map +1 -0
  23. package/lib/module/components/Block/Block.js +11 -29
  24. package/lib/module/components/Block/Block.js.map +1 -1
  25. package/lib/module/components/InputFocusScrollView/InputFocusScrollView.js +10 -8
  26. package/lib/module/components/InputFocusScrollView/InputFocusScrollView.js.map +1 -1
  27. package/lib/module/components/Text/Text.js +7 -17
  28. package/lib/module/components/Text/Text.js.map +1 -1
  29. package/lib/module/hooks/skeleform/src/index.js +3 -5
  30. package/lib/module/hooks/skeleform/src/index.js.map +1 -1
  31. package/lib/module/testing/TestingPlayground.js +16 -0
  32. package/lib/module/testing/TestingPlayground.js.map +1 -0
  33. package/lib/module/utils/animations.js +10 -10
  34. package/lib/module/utils/animations.js.map +1 -1
  35. package/lib/module/utils/extract-animation-properties.js +63 -42
  36. package/lib/module/utils/extract-animation-properties.js.map +1 -1
  37. package/lib/module/utils/extract-skeletor-style-properties.js +34 -0
  38. package/lib/module/utils/extract-skeletor-style-properties.js.map +1 -0
  39. package/lib/module/utils/index.js +2 -0
  40. package/lib/module/utils/index.js.map +1 -1
  41. package/lib/module/utils/is-color-value.js +16 -3
  42. package/lib/module/utils/is-color-value.js.map +1 -1
  43. package/lib/module/utils/memoize-styles.js +45 -0
  44. package/lib/module/utils/memoize-styles.js.map +1 -0
  45. package/lib/typescript/commonjs/components/Block/Block.d.ts +2 -1
  46. package/lib/typescript/commonjs/components/Block/Block.d.ts.map +1 -1
  47. package/lib/typescript/commonjs/components/InputFocusScrollView/InputFocusScrollView.d.ts.map +1 -1
  48. package/lib/typescript/commonjs/components/Text/Text.d.ts.map +1 -1
  49. package/lib/typescript/commonjs/hooks/skeleform/src/index.d.ts.map +1 -1
  50. package/lib/typescript/commonjs/hooks/useAnimateParallel.d.ts +2 -2
  51. package/lib/typescript/commonjs/hooks/useAnimateParallel.d.ts.map +1 -1
  52. package/lib/typescript/commonjs/hooks/useAnimateSequence.d.ts +2 -2
  53. package/lib/typescript/commonjs/hooks/useAnimateSequence.d.ts.map +1 -1
  54. package/lib/typescript/commonjs/hooks/useAnimateStagger.d.ts +2 -2
  55. package/lib/typescript/commonjs/hooks/useAnimateStagger.d.ts.map +1 -1
  56. package/lib/typescript/commonjs/hooks/useLoopAnimation.d.ts +3 -3
  57. package/lib/typescript/commonjs/hooks/useLoopAnimation.d.ts.map +1 -1
  58. package/lib/typescript/commonjs/models/Animation.d.ts +23 -21
  59. package/lib/typescript/commonjs/models/Animation.d.ts.map +1 -1
  60. package/lib/typescript/commonjs/testing/TestingPlayground.d.ts +2 -0
  61. package/lib/typescript/commonjs/testing/TestingPlayground.d.ts.map +1 -0
  62. package/lib/typescript/commonjs/utils/animations.d.ts +6 -6
  63. package/lib/typescript/commonjs/utils/animations.d.ts.map +1 -1
  64. package/lib/typescript/commonjs/utils/extract-animation-properties.d.ts +5 -5
  65. package/lib/typescript/commonjs/utils/extract-animation-properties.d.ts.map +1 -1
  66. package/lib/typescript/commonjs/utils/extract-skeletor-style-properties.d.ts +6 -0
  67. package/lib/typescript/commonjs/utils/extract-skeletor-style-properties.d.ts.map +1 -0
  68. package/lib/typescript/commonjs/utils/index.d.ts +2 -0
  69. package/lib/typescript/commonjs/utils/index.d.ts.map +1 -1
  70. package/lib/typescript/commonjs/utils/is-color-value.d.ts +10 -2
  71. package/lib/typescript/commonjs/utils/is-color-value.d.ts.map +1 -1
  72. package/lib/typescript/commonjs/utils/memoize-styles.d.ts +6 -0
  73. package/lib/typescript/commonjs/utils/memoize-styles.d.ts.map +1 -0
  74. package/lib/typescript/module/components/Block/Block.d.ts +2 -1
  75. package/lib/typescript/module/components/Block/Block.d.ts.map +1 -1
  76. package/lib/typescript/module/components/InputFocusScrollView/InputFocusScrollView.d.ts.map +1 -1
  77. package/lib/typescript/module/components/Text/Text.d.ts.map +1 -1
  78. package/lib/typescript/module/hooks/skeleform/src/index.d.ts.map +1 -1
  79. package/lib/typescript/module/hooks/useAnimateParallel.d.ts +2 -2
  80. package/lib/typescript/module/hooks/useAnimateParallel.d.ts.map +1 -1
  81. package/lib/typescript/module/hooks/useAnimateSequence.d.ts +2 -2
  82. package/lib/typescript/module/hooks/useAnimateSequence.d.ts.map +1 -1
  83. package/lib/typescript/module/hooks/useAnimateStagger.d.ts +2 -2
  84. package/lib/typescript/module/hooks/useAnimateStagger.d.ts.map +1 -1
  85. package/lib/typescript/module/hooks/useLoopAnimation.d.ts +3 -3
  86. package/lib/typescript/module/hooks/useLoopAnimation.d.ts.map +1 -1
  87. package/lib/typescript/module/models/Animation.d.ts +23 -21
  88. package/lib/typescript/module/models/Animation.d.ts.map +1 -1
  89. package/lib/typescript/module/testing/TestingPlayground.d.ts +2 -0
  90. package/lib/typescript/module/testing/TestingPlayground.d.ts.map +1 -0
  91. package/lib/typescript/module/utils/animations.d.ts +6 -6
  92. package/lib/typescript/module/utils/animations.d.ts.map +1 -1
  93. package/lib/typescript/module/utils/extract-animation-properties.d.ts +5 -5
  94. package/lib/typescript/module/utils/extract-animation-properties.d.ts.map +1 -1
  95. package/lib/typescript/module/utils/extract-skeletor-style-properties.d.ts +6 -0
  96. package/lib/typescript/module/utils/extract-skeletor-style-properties.d.ts.map +1 -0
  97. package/lib/typescript/module/utils/index.d.ts +2 -0
  98. package/lib/typescript/module/utils/index.d.ts.map +1 -1
  99. package/lib/typescript/module/utils/is-color-value.d.ts +10 -2
  100. package/lib/typescript/module/utils/is-color-value.d.ts.map +1 -1
  101. package/lib/typescript/module/utils/memoize-styles.d.ts +6 -0
  102. package/lib/typescript/module/utils/memoize-styles.d.ts.map +1 -0
  103. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import type { Animated, EasingFunction, ViewStyle } from "react-native";
1
+ import type { Animated, EasingFunction, ScaleTransform, ScaleXTransform, ScaleYTransform, SkewXTransform, SkewYTransform, TranslateXTransform, TranslateYTransform, ViewStyle } from "react-native";
2
2
  export type AnimationConfiguration = {
3
3
  duration?: number;
4
4
  /** Enables or disables native driver. Defaults to true. Unexpected lifecycle behavior might be experience when false. If animations behave weirdly, try changing this. */
@@ -14,21 +14,26 @@ export type StaggerAnimationConfiguration = AnimationConfiguration & {
14
14
  export type AnimationTimelineConfiguration = {
15
15
  [ms: number]: Array<ElementAnimation<any>>;
16
16
  };
17
- type NonAnimatableKeys = "rotation" | "alignItems" | "alignContent" | "alignSelf" | "justifyContent" | "display" | "flexDirection" | "flexWrap" | "overflow" | "position" | "zIndex" | "elevation" | "direction" | "backfaceVisibility" | "borderCurve" | "borderStyle" | "pointerEvents" | "overflow" | "transform";
18
- export type CleanViewStyle = Omit<ViewStyle, NonAnimatableKeys> & {
19
- rotation?: `${number}deg` | `${number}rad`;
20
- };
21
- export type AnimationViewStyle = {
22
- [K in keyof CleanViewStyle]: Exclude<CleanViewStyle[K], Animated.AnimatedNode>;
23
- };
24
- export type AnimationStyle<Keys extends keyof AnimationViewStyle> = {
25
- [K in Keys | keyof AnimationViewStyle]?: AnimationViewStyle[K][];
26
- };
27
- export type Animation<Keys extends keyof AnimationViewStyle = keyof AnimationViewStyle> = {
28
- [K in Keys]: Animated.AnimatedInterpolation<string | number>;
29
- };
30
- export type ElementAnimation<Keys extends keyof AnimationViewStyle> = {
31
- animations: Animation<Keys>;
17
+ type AnimatableValueTypes = string | number;
18
+ export type CustomAnimatableProperties = {
19
+ translateX?: TranslateXTransform["translateX"][];
20
+ translateY?: TranslateYTransform["translateY"][];
21
+ scaleX?: ScaleXTransform["scaleX"][];
22
+ scaleY?: ScaleYTransform["scaleY"][];
23
+ scale?: ScaleTransform["scale"][];
24
+ skewX?: SkewXTransform["skewX"][];
25
+ skewY?: SkewYTransform["skewY"][];
26
+ skew?: SkewXTransform["skewX"][];
27
+ rotation?: Array<`${number}deg` | `${number}rad`>;
28
+ };
29
+ export type NonAnimatableKeys = "alignItems" | "alignContent" | "alignSelf" | "justifyContent" | "display" | "flexDirection" | "flexWrap" | "overflow" | "position" | "zIndex" | "elevation" | "direction" | "backfaceVisibility" | "borderStyle" | "borderCurve" | "pointerEvents" | "shadowOffset" | "textShadowOffset" | "transformMatrix" | "transform";
30
+ export type AnimatableStyleKeys = keyof Exclude<ViewStyle, NonAnimatableKeys> | keyof CustomAnimatableProperties;
31
+ export type AnimationStyle<Keys extends AnimatableStyleKeys> = {
32
+ [K in Keys]: AnimatableValueTypes[];
33
+ };
34
+ export type ComposedAnimationInterpolations<Keys extends AnimatableStyleKeys> = Partial<Record<Keys, Animated.AnimatedInterpolation<string | number>>>;
35
+ export type ElementAnimation<Keys extends AnimatableStyleKeys> = {
36
+ animations: Required<ComposedAnimationInterpolations<Keys>>;
32
37
  forward: Animated.CompositeAnimation;
33
38
  backward: Animated.CompositeAnimation;
34
39
  /** Start animation with onFinished callback. Using forward.start() */
@@ -38,11 +43,8 @@ export type ElementAnimation<Keys extends keyof AnimationViewStyle> = {
38
43
  /** Reset animations to initial value. Using forward.reset() */
39
44
  reset: Animated.CompositeAnimation["reset"];
40
45
  };
41
- export type ViewAnimation<Keys extends keyof AnimationViewStyle> = {
42
- [K in Keys | keyof AnimationViewStyle]?: AnimationViewStyle[K] | Animated.AnimatedInterpolation<string | number>;
46
+ export type Animations = {
47
+ animations?: ComposedAnimationInterpolations<AnimatableStyleKeys>;
43
48
  };
44
- export interface Animations {
45
- animations?: ViewAnimation<keyof AnimationViewStyle>;
46
- }
47
49
  export {};
48
50
  //# sourceMappingURL=Animation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Animation.d.ts","sourceRoot":"","sources":["../../../../src/models/Animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAExE,MAAM,MAAM,sBAAsB,GAAG;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0KAA0K;IAC1K,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,2EAA2E;IAC3E,aAAa,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,sBAAsB,GAAG;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAE5C,CAAC,EAAE,EAAE,MAAM,GAAG,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC;CAC3C,CAAC;AAEF,KAAK,iBAAiB,GACnB,UAAU,GACV,YAAY,GACZ,cAAc,GACd,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SAAS,mBAAmB,IAAI;IAChE,UAAU,EAAE,QAAQ,CAAC,+BAA+B,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5D,OAAO,EAAE,QAAQ,CAAC,kBAAkB,CAAC;IACrC,QAAQ,EAAE,QAAQ,CAAC,kBAAkB,CAAC;IACtC,sEAAsE;IACtE,KAAK,CAAC,UAAU,CAAC,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;IACrC,mGAAmG;IACnG,OAAO,EAAE,CAAC,UAAU,CAAC,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IAC3C,+DAA+D;IAC/D,KAAK,EAAE,QAAQ,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACxB,UAAU,CAAC,EAAE,+BAA+B,CAAC,mBAAmB,CAAC,CAAC;CAClE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=TestingPlayground.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TestingPlayground.d.ts","sourceRoot":"","sources":["../../../../src/testing/TestingPlayground.tsx"],"names":[],"mappings":""}
@@ -1,22 +1,22 @@
1
1
  import { Animated } from "react-native";
2
- import type { Animation, AnimationConfiguration, AnimationStyle, AnimationTimelineConfiguration, CleanViewStyle, ElementAnimation, StaggerAnimationConfiguration } from "../models";
2
+ import type { AnimatableStyleKeys, AnimationConfiguration, AnimationStyle, AnimationTimelineConfiguration, ElementAnimation, StaggerAnimationConfiguration } from "../models";
3
3
  /** Animate styles in parallel.
4
4
  * Example: if you define opacity and top styles, this will start the opacity animation and the top animation at the same time. */
5
- export declare function animateParallel<Styles extends keyof CleanViewStyle>(styles: AnimationStyle<Styles>, config?: AnimationConfiguration): ElementAnimation<Styles>;
5
+ export declare function animateParallel<Styles extends AnimatableStyleKeys>(styles: AnimationStyle<Styles>, config?: AnimationConfiguration): ElementAnimation<Styles>;
6
6
  /** Stagger defined styles animations.
7
7
  * Example: if you define opacity and top styles, this will start the opacity animation and stagger the top animation by stagger amount. */
8
- export declare function animateStagger<Styles extends keyof CleanViewStyle>(styles: AnimationStyle<Styles>, config: StaggerAnimationConfiguration): ElementAnimation<Styles>;
8
+ export declare function animateStagger<Styles extends AnimatableStyleKeys>(styles: AnimationStyle<Styles>, config: StaggerAnimationConfiguration): ElementAnimation<Styles>;
9
9
  /** This will animate the passed in styles in sequence.
10
10
  * Example: if you define opacity and top styles, this will start the opacity animation and then start the top animation when the opacity animation finishes. */
11
- export declare function animateSequence<Styles extends keyof CleanViewStyle>(styles: AnimationStyle<Styles>, config?: AnimationConfiguration): ElementAnimation<Styles>;
11
+ export declare function animateSequence<Styles extends AnimatableStyleKeys>(styles: AnimationStyle<Styles>, config?: AnimationConfiguration): ElementAnimation<Styles>;
12
12
  export declare function createAnimationTimeline(timeline: AnimationTimelineConfiguration): {
13
13
  start: (callback?: Animated.EndCallback) => void;
14
14
  reverse: (callback?: Animated.EndCallback) => void;
15
15
  reset: () => void;
16
16
  };
17
- export declare function loopAnimation<Type extends keyof CleanViewStyle = keyof CleanViewStyle>(animation: ElementAnimation<Type>): {
17
+ export declare function loopAnimation<Type extends AnimatableStyleKeys = AnimatableStyleKeys>(animation: ElementAnimation<Type>): {
18
18
  start: () => void;
19
- animations: Animation<Type>;
19
+ animations: Required<Partial<Record<Type, Animated.AnimatedInterpolation<string | number>>>>;
20
20
  forward: Animated.CompositeAnimation;
21
21
  backward: Animated.CompositeAnimation;
22
22
  reverse: (onFinished?: () => void) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"animations.d.ts","sourceRoot":"","sources":["../../../../src/utils/animations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAU,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EACX,SAAS,EACT,sBAAsB,EACtB,cAAc,EACd,8BAA8B,EAC9B,cAAc,EACd,gBAAgB,EAChB,6BAA6B,EAC7B,MAAM,WAAW,CAAC;AAyFnB;kIAC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AChE,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,EAC9B,MAAM,EAAE,6BAA6B,GACnC,gBAAgB,CAAC,MAAM,CAAC,CAiB1B;AAgCD;gKACgK;AAChK,wBAAgB,eAAe,CAAC,MAAM,SAAS,mBAAmB,EACjE,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,EAC9B,MAAM,CAAC,EAAE,sBAAsB,GAC7B,gBAAgB,CAAC,MAAM,CAAC,CAc1B;AAED,wBAAgB,uBAAuB,CACtC,QAAQ,EAAE,8BAA8B;;;;EAoCxC;AAED,wBAAgB,aAAa,CAC5B,IAAI,SAAS,mBAAmB,GAAG,mBAAmB,EACrD,SAAS,EAAE,gBAAgB,CAAC,IAAI,CAAC;;;;;wBArKrB,CAAC;;EA8Kd"}
@@ -1,8 +1,8 @@
1
1
  import type { MatrixTransform, RotateTransform, RotateXTransform, RotateYTransform, RotateZTransform, ScaleTransform, ScaleXTransform, ScaleYTransform, SkewXTransform, SkewYTransform, TranslateXTransform, TranslateYTransform } from "react-native";
2
- import type { AnimationViewStyle, ViewAnimation } from "../models";
3
- type BaseTransformStyles = RotateTransform | RotateXTransform | RotateYTransform | RotateZTransform | ScaleTransform | ScaleXTransform | ScaleYTransform | TranslateXTransform | TranslateYTransform | SkewXTransform | SkewYTransform | MatrixTransform;
4
- export declare function extractAnimationProperties<Keys extends keyof AnimationViewStyle>(props: ViewAnimation<Keys> | undefined): (ViewAnimation<Keys> & {
5
- transform: BaseTransformStyles[];
6
- }) | undefined;
2
+ import type { ComposedAnimationInterpolations, CustomAnimatableProperties } from "../models";
3
+ type BaseTransformProps = RotateTransform | RotateXTransform | RotateYTransform | RotateZTransform | ScaleTransform | ScaleXTransform | ScaleYTransform | TranslateXTransform | TranslateYTransform | SkewXTransform | SkewYTransform | MatrixTransform;
4
+ export declare function extractAnimationProperties(props: ComposedAnimationInterpolations<keyof CustomAnimatableProperties> | undefined): {
5
+ transform: BaseTransformProps[];
6
+ } | undefined;
7
7
  export {};
8
8
  //# sourceMappingURL=extract-animation-properties.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extract-animation-properties.d.ts","sourceRoot":"","sources":["../../../../src/utils/extract-animation-properties.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,eAAe,EACf,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAEnE,KAAK,mBAAmB,GACrB,eAAe,GACf,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,cAAc,GACd,eAAe,GACf,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,cAAc,GACd,cAAc,GACd,eAAe,CAAC;AAenB,wBAAgB,0BAA0B,CACzC,IAAI,SAAS,MAAM,kBAAkB,EACpC,KAAK,EAAE,aAAa,CAAC,IAAI,CAAC,GAAG,SAAS;eAI3B,mBAAmB,EAAE;eAoCjC"}
1
+ {"version":3,"file":"extract-animation-properties.d.ts","sourceRoot":"","sources":["../../../../src/utils/extract-animation-properties.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,eAAe,EACf,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACX,+BAA+B,EAC/B,0BAA0B,EAC1B,MAAM,WAAW,CAAC;AAEnB,KAAK,kBAAkB,GACpB,eAAe,GACf,gBAAgB,GAChB,gBAAgB,GAChB,gBAAgB,GAChB,cAAc,GACd,eAAe,GACf,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,cAAc,GACd,cAAc,GACd,eAAe,CAAC;AAEnB,wBAAgB,0BAA0B,CACzC,KAAK,EACF,+BAA+B,CAAC,MAAM,0BAA0B,CAAC,GACjE,SAAS;;cAuDZ"}
@@ -0,0 +1,6 @@
1
+ import type { ViewStyle } from "react-native";
2
+ import type { Alignment, Border, Flex, Position, Size, Spacing } from "../models";
3
+ type SkeletorStyleProperties = Alignment & Position & Size & Border & Flex & Spacing;
4
+ export declare function extractSkeletorStyleProperties<T extends SkeletorStyleProperties>(props: T): Partial<ViewStyle>;
5
+ export {};
6
+ //# sourceMappingURL=extract-skeletor-style-properties.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extract-skeletor-style-properties.d.ts","sourceRoot":"","sources":["../../../../src/utils/extract-skeletor-style-properties.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EACX,SAAS,EACT,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,OAAO,EACP,MAAM,WAAW,CAAC;AAYnB,KAAK,uBAAuB,GAAG,SAAS,GACvC,QAAQ,GACR,IAAI,GACJ,MAAM,GACN,IAAI,GACJ,OAAO,CAAC;AAET,wBAAgB,8BAA8B,CAC7C,CAAC,SAAS,uBAAuB,EAChC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,CAwB9B"}
@@ -5,6 +5,8 @@ export * from "./extract-flex-properties";
5
5
  export * from "./extract-gap-properties";
6
6
  export * from "./extract-position-properties";
7
7
  export * from "./extract-size-properties";
8
+ export * from "./extract-skeletor-style-properties";
8
9
  export * from "./is-color-value";
10
+ export * from "./memoize-styles";
9
11
  export * from "./normalize-spacing-values";
10
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qCAAqC,CAAC;AACpD,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,4BAA4B,CAAC"}
@@ -1,3 +1,11 @@
1
- import { type ColorValue } from "react-native";
2
- export declare const isColorValue: (value: React.ReactNode | ColorValue) => value is ColorValue;
1
+ import type { ColorValue } from "react-native";
2
+ /**
3
+ * Checks if a value is a valid React Native color.
4
+ * Supports:
5
+ * - strings (hex, color names)
6
+ * - numbers (RN numeric colors)
7
+ * - PlatformColor objects
8
+ * - DynamicColorIOS objects
9
+ */
10
+ export declare const isColorValue: (value: unknown) => value is ColorValue;
3
11
  //# sourceMappingURL=is-color-value.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-color-value.d.ts","sourceRoot":"","sources":["../../../../src/utils/is-color-value.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAkC,MAAM,cAAc,CAAC;AAE/E,eAAO,MAAM,YAAY,GACxB,OAAO,KAAK,CAAC,SAAS,GAAG,UAAU,KACjC,KAAK,IAAI,UAOX,CAAC"}
1
+ {"version":3,"file":"is-color-value.d.ts","sourceRoot":"","sources":["../../../../src/utils/is-color-value.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,OAAO,KAAG,KAAK,IAAI,UActD,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { ViewStyle } from "react-native";
2
+ /**
3
+ * High-performance memoizeStyle function
4
+ */
5
+ export declare function memoizeStyle<T extends ViewStyle>(obj: T): T;
6
+ //# sourceMappingURL=memoize-styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memoize-styles.d.ts","sourceRoot":"","sources":["../../../../src/utils/memoize-styles.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AA2B9C;;GAEG;AACH,wBAAgB,YAAY,CAAC,CAAC,SAAS,SAAS,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAc3D"}
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "Luka Buljan <luka@prototyp.digital>",
7
7
  "Vlatko Vlahek <vlatko@prototyp.digital>"
8
8
  ],
9
- "version": "1.2.0",
9
+ "version": "1.3.0-beta0",
10
10
  "license": "MIT",
11
11
  "main": "./lib/commonjs/index.js",
12
12
  "module": "./lib/module/index.js",
@@ -35,7 +35,7 @@
35
35
  "react-native": "^0.81.4",
36
36
  "react-native-builder-bob": "^0.40.12",
37
37
  "react-native-safe-area-context": "^5.5.2",
38
- "typescript": "^5.8.3"
38
+ "typescript": "^5.9.3"
39
39
  },
40
40
  "peerDependencies": {
41
41
  "react": ">=19",