@sprite-motion/react 0.1.2 → 0.2.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/README.md +8 -69
- package/dist/index.cjs +18 -87
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -27
- package/dist/index.d.ts +5 -27
- package/dist/index.js +18 -86
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -1,84 +1,23 @@
|
|
|
1
1
|
# @sprite-motion/react
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> **Deprecated** — use [`mason-sprite/react`](https://www.npmjs.com/package/mason-sprite) instead.
|
|
4
|
+
> This package is a compatibility shim. See [MIGRATION.md](https://github.com/FE-HyunSu/sprite-motion/blob/main/MIGRATION.md).
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## Install
|
|
6
|
+
## Migrate
|
|
8
7
|
|
|
9
8
|
```bash
|
|
10
|
-
npm install
|
|
9
|
+
npm install mason-sprite
|
|
11
10
|
```
|
|
12
11
|
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
12
|
```tsx
|
|
13
|
+
// Before
|
|
16
14
|
import { SpriteAnimation } from '@sprite-motion/react';
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
rows={4}
|
|
21
|
-
cols={4}
|
|
22
|
-
fps={12}
|
|
23
|
-
loop
|
|
24
|
-
width={128}
|
|
25
|
-
height={128}
|
|
26
|
-
/>
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
## Playback Controls
|
|
30
|
-
|
|
31
|
-
```tsx
|
|
32
|
-
import { useRef } from 'react';
|
|
33
|
-
import { SpriteAnimation, type SpriteAnimationHandle } from '@sprite-motion/react';
|
|
34
|
-
|
|
35
|
-
const ref = useRef<SpriteAnimationHandle>(null);
|
|
36
|
-
|
|
37
|
-
ref.current?.play();
|
|
38
|
-
ref.current?.pause();
|
|
39
|
-
ref.current?.stop();
|
|
40
|
-
ref.current?.goToFrame(3);
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
## Hook
|
|
44
|
-
|
|
45
|
-
```tsx
|
|
46
|
-
import { useSpriteAnimation } from '@sprite-motion/react';
|
|
47
|
-
|
|
48
|
-
const { ref, state, play, pause, stop, goToFrame } = useSpriteAnimation({
|
|
49
|
-
src: '/sprite.png',
|
|
50
|
-
rows: 4,
|
|
51
|
-
cols: 4,
|
|
52
|
-
fps: 12,
|
|
53
|
-
});
|
|
16
|
+
// After
|
|
17
|
+
import { Sprite } from 'mason-sprite/react';
|
|
54
18
|
```
|
|
55
19
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
| Prop | Type | Default | Description |
|
|
59
|
-
|------|------|---------|-------------|
|
|
60
|
-
| `src` | `string` | — | Sprite sheet image URL |
|
|
61
|
-
| `rows` | `number` | — | Number of rows |
|
|
62
|
-
| `cols` | `number` | — | Number of columns |
|
|
63
|
-
| `fps` | `number` | `12` | Frames per second |
|
|
64
|
-
| `loop` | `boolean` | `true` | Loop animation |
|
|
65
|
-
| `width` | `number` | `128` | Display width (px) |
|
|
66
|
-
| `height` | `number` | `128` | Display height (px) |
|
|
67
|
-
| `autoPlay` | `boolean` | `true` | Start on mount |
|
|
68
|
-
| `renderer` | `'css' \| 'canvas'` | `'css'` | Rendering mode |
|
|
69
|
-
| `onComplete` | `() => void` | — | Called when a non-looping animation finishes |
|
|
70
|
-
| `onFrameChange` | `(frame: number) => void` | — | Called on each frame change |
|
|
71
|
-
|
|
72
|
-
## Renderers
|
|
73
|
-
|
|
74
|
-
- **CSS (default)** — lightweight, uses `background-position`
|
|
75
|
-
- **Canvas** — uses `drawImage`, good for custom drawing
|
|
76
|
-
|
|
77
|
-
## Related Packages
|
|
78
|
-
|
|
79
|
-
- [`@sprite-motion/core`](https://www.npmjs.com/package/@sprite-motion/core) — framework-agnostic engine
|
|
80
|
-
- [`@sprite-motion/vue`](https://www.npmjs.com/package/@sprite-motion/vue)
|
|
81
|
-
- [`@sprite-motion/svelte`](https://www.npmjs.com/package/@sprite-motion/svelte)
|
|
20
|
+
Existing code on v0.2.0 still works — `SpriteAnimation` is aliased to `Sprite`.
|
|
82
21
|
|
|
83
22
|
## License
|
|
84
23
|
|
package/dist/index.cjs
CHANGED
|
@@ -20,101 +20,32 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var index_exports = {};
|
|
22
22
|
__export(index_exports, {
|
|
23
|
+
Sprite: () => import_react.Sprite,
|
|
23
24
|
SpriteAnimation: () => SpriteAnimation,
|
|
24
|
-
useSpriteAnimation: () =>
|
|
25
|
+
useSpriteAnimation: () => import_react.useSprite
|
|
25
26
|
});
|
|
26
27
|
module.exports = __toCommonJS(index_exports);
|
|
28
|
+
var import_react = require("mason-sprite/react");
|
|
27
29
|
|
|
28
|
-
// src/
|
|
29
|
-
var
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
totalFrames: options.rows * options.cols,
|
|
40
|
-
isPlaying: false,
|
|
41
|
-
isLoaded: false
|
|
42
|
-
});
|
|
43
|
-
const { enabled = true, ...animatorOptions } = options;
|
|
44
|
-
(0, import_react.useEffect)(() => {
|
|
45
|
-
if (!enabled) return;
|
|
46
|
-
const animator = new import_core.SpriteAnimator(animatorOptions);
|
|
47
|
-
animatorRef.current = animator;
|
|
48
|
-
const unsubscribe = animator.subscribe(setState);
|
|
49
|
-
queueMicrotask(() => {
|
|
50
|
-
if (ref.current) {
|
|
51
|
-
animator.attach(ref.current);
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
return () => {
|
|
55
|
-
unsubscribe();
|
|
56
|
-
animator.destroy();
|
|
57
|
-
animatorRef.current = null;
|
|
58
|
-
};
|
|
59
|
-
}, [enabled]);
|
|
60
|
-
(0, import_react.useEffect)(() => {
|
|
61
|
-
animatorRef.current?.updateOptions(animatorOptions);
|
|
62
|
-
}, [
|
|
63
|
-
animatorOptions.src,
|
|
64
|
-
animatorOptions.rows,
|
|
65
|
-
animatorOptions.cols,
|
|
66
|
-
animatorOptions.fps,
|
|
67
|
-
animatorOptions.loop,
|
|
68
|
-
animatorOptions.width,
|
|
69
|
-
animatorOptions.height,
|
|
70
|
-
animatorOptions.autoPlay,
|
|
71
|
-
animatorOptions.renderer
|
|
72
|
-
]);
|
|
73
|
-
return {
|
|
74
|
-
ref,
|
|
75
|
-
state,
|
|
76
|
-
play: () => animatorRef.current?.play(),
|
|
77
|
-
pause: () => animatorRef.current?.pause(),
|
|
78
|
-
stop: () => animatorRef.current?.stop(),
|
|
79
|
-
goToFrame: (frame) => animatorRef.current?.goToFrame(frame)
|
|
80
|
-
};
|
|
30
|
+
// src/warn.ts
|
|
31
|
+
var MIGRATION_URL = "https://github.com/FE-HyunSu/sprite-motion/blob/main/MIGRATION.md";
|
|
32
|
+
var warned = false;
|
|
33
|
+
function warnDeprecation(packageName) {
|
|
34
|
+
if (warned || typeof console === "undefined") return;
|
|
35
|
+
warned = true;
|
|
36
|
+
console.warn(
|
|
37
|
+
`[${packageName}] This package is deprecated and will receive no further updates.
|
|
38
|
+
Please migrate to mason-sprite: npm install mason-sprite
|
|
39
|
+
Migration guide: ${MIGRATION_URL}`
|
|
40
|
+
);
|
|
81
41
|
}
|
|
82
42
|
|
|
83
|
-
// src/
|
|
84
|
-
|
|
85
|
-
var SpriteAnimation =
|
|
86
|
-
function SpriteAnimation2({ className, style, ...options }, ref) {
|
|
87
|
-
const { ref: targetRef, play, pause, stop, goToFrame } = useSpriteAnimation(options);
|
|
88
|
-
(0, import_react2.useImperativeHandle)(ref, () => ({ play, pause, stop, goToFrame }), [
|
|
89
|
-
play,
|
|
90
|
-
pause,
|
|
91
|
-
stop,
|
|
92
|
-
goToFrame
|
|
93
|
-
]);
|
|
94
|
-
if (options.renderer === "canvas") {
|
|
95
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
96
|
-
"canvas",
|
|
97
|
-
{
|
|
98
|
-
ref: targetRef,
|
|
99
|
-
className,
|
|
100
|
-
style
|
|
101
|
-
}
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
105
|
-
"div",
|
|
106
|
-
{
|
|
107
|
-
ref: targetRef,
|
|
108
|
-
className,
|
|
109
|
-
style,
|
|
110
|
-
role: "img",
|
|
111
|
-
"aria-label": "Sprite animation"
|
|
112
|
-
}
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
);
|
|
43
|
+
// src/index.ts
|
|
44
|
+
warnDeprecation("@sprite-motion/react");
|
|
45
|
+
var SpriteAnimation = import_react.Sprite;
|
|
116
46
|
// Annotate the CommonJS export names for ESM import in node:
|
|
117
47
|
0 && (module.exports = {
|
|
48
|
+
Sprite,
|
|
118
49
|
SpriteAnimation,
|
|
119
50
|
useSpriteAnimation
|
|
120
51
|
});
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/warn.ts"],"sourcesContent":["import { Sprite, useSprite } from 'mason-sprite/react';\nimport type {\n SpriteHandle,\n SpriteProps,\n UseSpriteOptions,\n UseSpriteReturn,\n} from 'mason-sprite/react';\nimport { warnDeprecation } from './warn.js';\n\nwarnDeprecation('@sprite-motion/react');\n\n/** @deprecated Use `Sprite` from `mason-sprite/react` */\nexport const SpriteAnimation = Sprite;\n\nexport { Sprite, useSprite as useSpriteAnimation };\n\nexport type {\n SpriteHandle as SpriteAnimationHandle,\n SpriteProps as SpriteAnimationProps,\n UseSpriteOptions as UseSpriteAnimationOptions,\n UseSpriteReturn as UseSpriteAnimationReturn,\n};\n","const MIGRATION_URL =\n 'https://github.com/FE-HyunSu/sprite-motion/blob/main/MIGRATION.md';\n\nlet warned = false;\n\nexport function warnDeprecation(packageName: string): void {\n if (warned || typeof console === 'undefined') return;\n warned = true;\n console.warn(\n `[${packageName}] This package is deprecated and will receive no further updates.\\n` +\n `Please migrate to mason-sprite: npm install mason-sprite\\n` +\n `Migration guide: ${MIGRATION_URL}`,\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkC;;;ACAlC,IAAM,gBACJ;AAEF,IAAI,SAAS;AAEN,SAAS,gBAAgB,aAA2B;AACzD,MAAI,UAAU,OAAO,YAAY,YAAa;AAC9C,WAAS;AACT,UAAQ;AAAA,IACN,IAAI,WAAW;AAAA;AAAA,mBAEO,aAAa;AAAA,EACrC;AACF;;;ADJA,gBAAgB,sBAAsB;AAG/B,IAAM,kBAAkB;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,30 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SpriteProps, SpriteHandle } from 'mason-sprite/react';
|
|
3
|
+
export { Sprite, SpriteHandle as SpriteAnimationHandle, SpriteProps as SpriteAnimationProps, UseSpriteOptions as UseSpriteAnimationOptions, UseSpriteReturn as UseSpriteAnimationReturn, useSprite as useSpriteAnimation } from 'mason-sprite/react';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
style?: React.CSSProperties;
|
|
7
|
-
}
|
|
8
|
-
interface SpriteAnimationHandle {
|
|
9
|
-
play: () => void;
|
|
10
|
-
pause: () => void;
|
|
11
|
-
stop: () => void;
|
|
12
|
-
goToFrame: (frame: number) => void;
|
|
13
|
-
}
|
|
14
|
-
declare const SpriteAnimation: react.ForwardRefExoticComponent<SpriteAnimationProps & react.RefAttributes<SpriteAnimationHandle>>;
|
|
5
|
+
/** @deprecated Use `Sprite` from `mason-sprite/react` */
|
|
6
|
+
declare const SpriteAnimation: react.ForwardRefExoticComponent<SpriteProps & react.RefAttributes<SpriteHandle>>;
|
|
15
7
|
|
|
16
|
-
|
|
17
|
-
/** Skip auto-attach; useful when controlling the target manually */
|
|
18
|
-
enabled?: boolean;
|
|
19
|
-
}
|
|
20
|
-
interface UseSpriteAnimationReturn {
|
|
21
|
-
ref: React.RefObject<HTMLElement | HTMLCanvasElement | null>;
|
|
22
|
-
state: SpriteAnimationState;
|
|
23
|
-
play: () => void;
|
|
24
|
-
pause: () => void;
|
|
25
|
-
stop: () => void;
|
|
26
|
-
goToFrame: (frame: number) => void;
|
|
27
|
-
}
|
|
28
|
-
declare function useSpriteAnimation(options: UseSpriteAnimationOptions): UseSpriteAnimationReturn;
|
|
29
|
-
|
|
30
|
-
export { SpriteAnimation, type SpriteAnimationHandle, type SpriteAnimationProps, type UseSpriteAnimationOptions, type UseSpriteAnimationReturn, useSpriteAnimation };
|
|
8
|
+
export { SpriteAnimation };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,30 +1,8 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SpriteProps, SpriteHandle } from 'mason-sprite/react';
|
|
3
|
+
export { Sprite, SpriteHandle as SpriteAnimationHandle, SpriteProps as SpriteAnimationProps, UseSpriteOptions as UseSpriteAnimationOptions, UseSpriteReturn as UseSpriteAnimationReturn, useSprite as useSpriteAnimation } from 'mason-sprite/react';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
style?: React.CSSProperties;
|
|
7
|
-
}
|
|
8
|
-
interface SpriteAnimationHandle {
|
|
9
|
-
play: () => void;
|
|
10
|
-
pause: () => void;
|
|
11
|
-
stop: () => void;
|
|
12
|
-
goToFrame: (frame: number) => void;
|
|
13
|
-
}
|
|
14
|
-
declare const SpriteAnimation: react.ForwardRefExoticComponent<SpriteAnimationProps & react.RefAttributes<SpriteAnimationHandle>>;
|
|
5
|
+
/** @deprecated Use `Sprite` from `mason-sprite/react` */
|
|
6
|
+
declare const SpriteAnimation: react.ForwardRefExoticComponent<SpriteProps & react.RefAttributes<SpriteHandle>>;
|
|
15
7
|
|
|
16
|
-
|
|
17
|
-
/** Skip auto-attach; useful when controlling the target manually */
|
|
18
|
-
enabled?: boolean;
|
|
19
|
-
}
|
|
20
|
-
interface UseSpriteAnimationReturn {
|
|
21
|
-
ref: React.RefObject<HTMLElement | HTMLCanvasElement | null>;
|
|
22
|
-
state: SpriteAnimationState;
|
|
23
|
-
play: () => void;
|
|
24
|
-
pause: () => void;
|
|
25
|
-
stop: () => void;
|
|
26
|
-
goToFrame: (frame: number) => void;
|
|
27
|
-
}
|
|
28
|
-
declare function useSpriteAnimation(options: UseSpriteAnimationOptions): UseSpriteAnimationReturn;
|
|
29
|
-
|
|
30
|
-
export { SpriteAnimation, type SpriteAnimationHandle, type SpriteAnimationProps, type UseSpriteAnimationOptions, type UseSpriteAnimationReturn, useSpriteAnimation };
|
|
8
|
+
export { SpriteAnimation };
|
package/dist/index.js
CHANGED
|
@@ -1,93 +1,25 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
import {
|
|
1
|
+
// src/index.ts
|
|
2
|
+
import { Sprite, useSprite } from "mason-sprite/react";
|
|
3
3
|
|
|
4
|
-
// src/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
});
|
|
16
|
-
const { enabled = true, ...animatorOptions } = options;
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
if (!enabled) return;
|
|
19
|
-
const animator = new SpriteAnimator(animatorOptions);
|
|
20
|
-
animatorRef.current = animator;
|
|
21
|
-
const unsubscribe = animator.subscribe(setState);
|
|
22
|
-
queueMicrotask(() => {
|
|
23
|
-
if (ref.current) {
|
|
24
|
-
animator.attach(ref.current);
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
return () => {
|
|
28
|
-
unsubscribe();
|
|
29
|
-
animator.destroy();
|
|
30
|
-
animatorRef.current = null;
|
|
31
|
-
};
|
|
32
|
-
}, [enabled]);
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
animatorRef.current?.updateOptions(animatorOptions);
|
|
35
|
-
}, [
|
|
36
|
-
animatorOptions.src,
|
|
37
|
-
animatorOptions.rows,
|
|
38
|
-
animatorOptions.cols,
|
|
39
|
-
animatorOptions.fps,
|
|
40
|
-
animatorOptions.loop,
|
|
41
|
-
animatorOptions.width,
|
|
42
|
-
animatorOptions.height,
|
|
43
|
-
animatorOptions.autoPlay,
|
|
44
|
-
animatorOptions.renderer
|
|
45
|
-
]);
|
|
46
|
-
return {
|
|
47
|
-
ref,
|
|
48
|
-
state,
|
|
49
|
-
play: () => animatorRef.current?.play(),
|
|
50
|
-
pause: () => animatorRef.current?.pause(),
|
|
51
|
-
stop: () => animatorRef.current?.stop(),
|
|
52
|
-
goToFrame: (frame) => animatorRef.current?.goToFrame(frame)
|
|
53
|
-
};
|
|
4
|
+
// src/warn.ts
|
|
5
|
+
var MIGRATION_URL = "https://github.com/FE-HyunSu/sprite-motion/blob/main/MIGRATION.md";
|
|
6
|
+
var warned = false;
|
|
7
|
+
function warnDeprecation(packageName) {
|
|
8
|
+
if (warned || typeof console === "undefined") return;
|
|
9
|
+
warned = true;
|
|
10
|
+
console.warn(
|
|
11
|
+
`[${packageName}] This package is deprecated and will receive no further updates.
|
|
12
|
+
Please migrate to mason-sprite: npm install mason-sprite
|
|
13
|
+
Migration guide: ${MIGRATION_URL}`
|
|
14
|
+
);
|
|
54
15
|
}
|
|
55
16
|
|
|
56
|
-
// src/
|
|
57
|
-
|
|
58
|
-
var SpriteAnimation =
|
|
59
|
-
function SpriteAnimation2({ className, style, ...options }, ref) {
|
|
60
|
-
const { ref: targetRef, play, pause, stop, goToFrame } = useSpriteAnimation(options);
|
|
61
|
-
useImperativeHandle(ref, () => ({ play, pause, stop, goToFrame }), [
|
|
62
|
-
play,
|
|
63
|
-
pause,
|
|
64
|
-
stop,
|
|
65
|
-
goToFrame
|
|
66
|
-
]);
|
|
67
|
-
if (options.renderer === "canvas") {
|
|
68
|
-
return /* @__PURE__ */ jsx(
|
|
69
|
-
"canvas",
|
|
70
|
-
{
|
|
71
|
-
ref: targetRef,
|
|
72
|
-
className,
|
|
73
|
-
style
|
|
74
|
-
}
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
return /* @__PURE__ */ jsx(
|
|
78
|
-
"div",
|
|
79
|
-
{
|
|
80
|
-
ref: targetRef,
|
|
81
|
-
className,
|
|
82
|
-
style,
|
|
83
|
-
role: "img",
|
|
84
|
-
"aria-label": "Sprite animation"
|
|
85
|
-
}
|
|
86
|
-
);
|
|
87
|
-
}
|
|
88
|
-
);
|
|
17
|
+
// src/index.ts
|
|
18
|
+
warnDeprecation("@sprite-motion/react");
|
|
19
|
+
var SpriteAnimation = Sprite;
|
|
89
20
|
export {
|
|
21
|
+
Sprite,
|
|
90
22
|
SpriteAnimation,
|
|
91
|
-
useSpriteAnimation
|
|
23
|
+
useSprite as useSpriteAnimation
|
|
92
24
|
};
|
|
93
25
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/warn.ts"],"sourcesContent":["import { Sprite, useSprite } from 'mason-sprite/react';\nimport type {\n SpriteHandle,\n SpriteProps,\n UseSpriteOptions,\n UseSpriteReturn,\n} from 'mason-sprite/react';\nimport { warnDeprecation } from './warn.js';\n\nwarnDeprecation('@sprite-motion/react');\n\n/** @deprecated Use `Sprite` from `mason-sprite/react` */\nexport const SpriteAnimation = Sprite;\n\nexport { Sprite, useSprite as useSpriteAnimation };\n\nexport type {\n SpriteHandle as SpriteAnimationHandle,\n SpriteProps as SpriteAnimationProps,\n UseSpriteOptions as UseSpriteAnimationOptions,\n UseSpriteReturn as UseSpriteAnimationReturn,\n};\n","const MIGRATION_URL =\n 'https://github.com/FE-HyunSu/sprite-motion/blob/main/MIGRATION.md';\n\nlet warned = false;\n\nexport function warnDeprecation(packageName: string): void {\n if (warned || typeof console === 'undefined') return;\n warned = true;\n console.warn(\n `[${packageName}] This package is deprecated and will receive no further updates.\\n` +\n `Please migrate to mason-sprite: npm install mason-sprite\\n` +\n `Migration guide: ${MIGRATION_URL}`,\n );\n}\n"],"mappings":";AAAA,SAAS,QAAQ,iBAAiB;;;ACAlC,IAAM,gBACJ;AAEF,IAAI,SAAS;AAEN,SAAS,gBAAgB,aAA2B;AACzD,MAAI,UAAU,OAAO,YAAY,YAAa;AAC9C,WAAS;AACT,UAAQ;AAAA,IACN,IAAI,WAAW;AAAA;AAAA,mBAEO,aAAa;AAAA,EACrC;AACF;;;ADJA,gBAAgB,sBAAsB;AAG/B,IAAM,kBAAkB;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sprite-motion/react",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "[DEPRECATED] Use mason-sprite/react instead — compatibility shim for @sprite-motion/react",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -31,17 +31,12 @@
|
|
|
31
31
|
"bugs": {
|
|
32
32
|
"url": "https://github.com/FE-HyunSu/sprite-motion/issues"
|
|
33
33
|
},
|
|
34
|
-
"scripts": {
|
|
35
|
-
"build": "tsup",
|
|
36
|
-
"typecheck": "tsc --noEmit",
|
|
37
|
-
"dev": "tsup --watch"
|
|
38
|
-
},
|
|
39
34
|
"peerDependencies": {
|
|
40
35
|
"react": ">=17",
|
|
41
36
|
"react-dom": ">=17"
|
|
42
37
|
},
|
|
43
38
|
"dependencies": {
|
|
44
|
-
"
|
|
39
|
+
"mason-sprite": "0.1.1"
|
|
45
40
|
},
|
|
46
41
|
"devDependencies": {
|
|
47
42
|
"@types/react": "^19.1.6",
|
|
@@ -59,5 +54,10 @@
|
|
|
59
54
|
"react",
|
|
60
55
|
"spritesheet"
|
|
61
56
|
],
|
|
62
|
-
"license": "MIT"
|
|
63
|
-
|
|
57
|
+
"license": "MIT",
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "tsup",
|
|
60
|
+
"typecheck": "tsc --noEmit",
|
|
61
|
+
"dev": "tsup --watch"
|
|
62
|
+
}
|
|
63
|
+
}
|