@vnejs/uis.react.sprite 0.1.6 → 0.1.7

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/dist/Sprite.d.ts CHANGED
@@ -1,9 +1,3 @@
1
- export declare const Sprite: ({ parts, indexSrc, boxProps, partsProps, transition, transitionBox }: {
2
- parts?: any[];
3
- indexSrc?: string;
4
- boxProps?: {};
5
- partsProps?: {};
6
- transition?: any;
7
- transitionBox?: any;
8
- }) => import("react/jsx-runtime").JSX.Element;
1
+ import { type SpriteProps } from "./Sprite.types.js";
2
+ export declare const Sprite: ({ parts, indexSrc, boxProps, partsProps, transition, transitionBox, }: SpriteProps) => import("react/jsx-runtime").JSX.Element;
9
3
  //# sourceMappingURL=Sprite.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Sprite.d.ts","sourceRoot":"","sources":["../src/Sprite.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,MAAM,GAAI;;;;;;;CAAsG,4CAyB5H,CAAC"}
1
+ {"version":3,"file":"Sprite.d.ts","sourceRoot":"","sources":["../src/Sprite.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIrD,eAAO,MAAM,MAAM,GAAI,uEAOpB,WAAW,4CAyBb,CAAC"}
package/dist/Sprite.js CHANGED
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useMemo } from "react";
3
3
  import { Image, PositionBox } from "@vnejs/uis.react";
4
4
  const POSE_STYLE = { opacity: 0, visibility: "hidden" };
5
- export const Sprite = ({ parts = [], indexSrc = "", boxProps = {}, partsProps = {}, transition = null, transitionBox = null }) => {
5
+ export const Sprite = ({ parts = [], indexSrc = "", boxProps = {}, partsProps = {}, transition = null, transitionBox = null, }) => {
6
6
  const realBoxProps = useMemo(() => {
7
7
  const result = { ...boxProps };
8
8
  if (transitionBox !== null)
@@ -1 +1 @@
1
- {"version":3,"file":"Sprite.js","sourceRoot":"","sources":["../src/Sprite.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,UAAU,GAAwB,EAAE,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;AAE7E,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG,EAAE,EAAE,QAAQ,GAAG,EAAE,EAAE,QAAQ,GAAG,EAAE,EAAE,UAAU,GAAG,EAAE,EAAE,UAAU,GAAG,IAAI,EAAE,aAAa,GAAG,IAAI,EAAE,EAAE,EAAE;IAC/H,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE;QAChC,MAAM,MAAM,GAAwB,EAAE,GAAG,QAAQ,EAAE,CAAC;QAEpD,IAAI,aAAa,KAAK,IAAI;YAAE,MAAM,CAAC,UAAU,GAAG,aAAa,CAAC;QAE9D,OAAO,MAAM,CAAC;IAChB,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC;IAE9B,OAAO,CACL,MAAC,WAAW,OAAK,YAAY,aAC1B,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CACvB,KAAC,KAAK,OAEA,KAAK,KACL,UAAU,EACd,UAAU,EAAE,UAAU,IAHjB,CAAC,CAIN,CACH,CAAC,EACF,cACE,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,UAAU,GACjB,IACU,CACf,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"file":"Sprite.js","sourceRoot":"","sources":["../src/Sprite.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAItD,MAAM,UAAU,GAAkB,EAAE,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,QAAQ,EAAE,CAAC;AAEvE,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EACrB,KAAK,GAAG,EAAE,EACV,QAAQ,GAAG,EAAE,EACb,QAAQ,GAAG,EAAE,EACb,UAAU,GAAG,EAAE,EACf,UAAU,GAAG,IAAI,EACjB,aAAa,GAAG,IAAI,GACR,EAAE,EAAE;IAChB,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,EAAE;QAChC,MAAM,MAAM,GAA4B,EAAE,GAAG,QAAQ,EAAE,CAAC;QAExD,IAAI,aAAa,KAAK,IAAI;YAAE,MAAM,CAAC,UAAU,GAAG,aAAa,CAAC;QAE9D,OAAO,MAAM,CAAC;IAChB,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC;IAE9B,OAAO,CACL,MAAC,WAAW,OAAK,YAAY,aAC1B,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CACvB,KAAC,KAAK,OAEA,KAAK,KACL,UAAU,EACd,UAAU,EAAE,UAAU,IAHjB,CAAC,CAIN,CACH,CAAC,EACF,cACE,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,UAAU,GACjB,IACU,CACf,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,48 @@
1
+ import type { ReactNode } from "react";
2
+ export type SpriteImagePartProps = {
3
+ translateX?: number;
4
+ translateY?: number;
5
+ scale?: number;
6
+ transition?: number;
7
+ opacity?: number | null;
8
+ src?: string | Array<{
9
+ url: string;
10
+ duration: number;
11
+ transition: number;
12
+ randomDuration?: number;
13
+ }>;
14
+ className?: string;
15
+ filter?: string;
16
+ withHover?: boolean;
17
+ isSwitchDisabled?: boolean;
18
+ isAllSrcRendered?: boolean;
19
+ };
20
+ export type SpriteBoxProps = {
21
+ top?: number | string | null;
22
+ right?: number | string | null;
23
+ bottom?: number | string | null;
24
+ left?: number | string | null;
25
+ translateX?: number | string | null;
26
+ translateY?: number | string | null;
27
+ transformOriginX?: number | null;
28
+ transformOriginY?: number | null;
29
+ scale?: number | null;
30
+ transition?: number | null;
31
+ zIndex?: number | null;
32
+ opacity?: number | null;
33
+ background?: string | null;
34
+ clip?: string | null;
35
+ mask?: string | null;
36
+ filter?: string | null;
37
+ className?: string;
38
+ children?: ReactNode;
39
+ };
40
+ export type SpriteProps = {
41
+ parts?: SpriteImagePartProps[];
42
+ indexSrc?: string;
43
+ boxProps?: SpriteBoxProps;
44
+ partsProps?: Partial<SpriteImagePartProps>;
45
+ transition?: number | null;
46
+ transitionBox?: number | null;
47
+ };
48
+ //# sourceMappingURL=Sprite.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sprite.types.d.ts","sourceRoot":"","sources":["../src/Sprite.types.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,oBAAoB,GAAG;IACjC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACrG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AA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aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Sprite.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Sprite.types.js","sourceRoot":"","sources":["../src/Sprite.types.tsx"],"names":[],"mappings":""}
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
- export * from "./Sprite";
1
+ export * from "./Sprite.types.js";
2
+ export * from "./Sprite.js";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC"}
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
- export * from "./Sprite";
1
+ export * from "./Sprite.types.js";
2
+ export * from "./Sprite.js";
2
3
  //# 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,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vnejs/uis.react.sprite",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
package/src/Sprite.tsx CHANGED
@@ -1,11 +1,22 @@
1
1
  import { useMemo } from "react";
2
+ import type { CSSProperties } from "react";
3
+
2
4
  import { Image, PositionBox } from "@vnejs/uis.react";
3
5
 
4
- const POSE_STYLE: Record<string, any> = { opacity: 0, visibility: "hidden" };
6
+ import { type SpriteProps } from "./Sprite.types.js";
7
+
8
+ const POSE_STYLE: CSSProperties = { opacity: 0, visibility: "hidden" };
5
9
 
6
- export const Sprite = ({ parts = [], indexSrc = "", boxProps = {}, partsProps = {}, transition = null, transitionBox = null }) => {
10
+ export const Sprite = ({
11
+ parts = [],
12
+ indexSrc = "",
13
+ boxProps = {},
14
+ partsProps = {},
15
+ transition = null,
16
+ transitionBox = null,
17
+ }: SpriteProps) => {
7
18
  const realBoxProps = useMemo(() => {
8
- const result: Record<string, any> = { ...boxProps };
19
+ const result: Record<string, unknown> = { ...boxProps };
9
20
 
10
21
  if (transitionBox !== null) result.transition = transitionBox;
11
22
 
@@ -0,0 +1,45 @@
1
+ import type { ReactNode } from "react";
2
+
3
+ export type SpriteImagePartProps = {
4
+ translateX?: number;
5
+ translateY?: number;
6
+ scale?: number;
7
+ transition?: number;
8
+ opacity?: number | null;
9
+ src?: string | Array<{ url: string; duration: number; transition: number; randomDuration?: number }>;
10
+ className?: string;
11
+ filter?: string;
12
+ withHover?: boolean;
13
+ isSwitchDisabled?: boolean;
14
+ isAllSrcRendered?: boolean;
15
+ };
16
+
17
+ export type SpriteBoxProps = {
18
+ top?: number | string | null;
19
+ right?: number | string | null;
20
+ bottom?: number | string | null;
21
+ left?: number | string | null;
22
+ translateX?: number | string | null;
23
+ translateY?: number | string | null;
24
+ transformOriginX?: number | null;
25
+ transformOriginY?: number | null;
26
+ scale?: number | null;
27
+ transition?: number | null;
28
+ zIndex?: number | null;
29
+ opacity?: number | null;
30
+ background?: string | null;
31
+ clip?: string | null;
32
+ mask?: string | null;
33
+ filter?: string | null;
34
+ className?: string;
35
+ children?: ReactNode;
36
+ };
37
+
38
+ export type SpriteProps = {
39
+ parts?: SpriteImagePartProps[];
40
+ indexSrc?: string;
41
+ boxProps?: SpriteBoxProps;
42
+ partsProps?: Partial<SpriteImagePartProps>;
43
+ transition?: number | null;
44
+ transitionBox?: number | null;
45
+ };
package/src/index.ts CHANGED
@@ -1 +1,2 @@
1
- export * from "./Sprite";
1
+ export * from "./Sprite.types.js";
2
+ export * from "./Sprite.js";
package/tsconfig.json CHANGED
@@ -8,7 +8,6 @@
8
8
  "src/**/*.ts",
9
9
  "src/**/*.tsx",
10
10
  "../../../globals.d.ts",
11
- "../../peer-modules.d.ts"
12
11
  ],
13
12
  "exclude": [
14
13
  "dist",