diff --git a/.changeset/forty-pears-nail.md b/.changeset/forty-pears-nail.md new file mode 100644 index 00000000..ecebacd1 --- /dev/null +++ b/.changeset/forty-pears-nail.md @@ -0,0 +1,5 @@ +--- +'@288-toolkit/sprite-animation': major +--- + +Breaking: upgrade to svelte-5 diff --git a/packages/components/dismissable/vitest.config.js b/packages/components/dismissable/vitest.config.js index d7b1f54a..bb9613a1 100644 --- a/packages/components/dismissable/vitest.config.js +++ b/packages/components/dismissable/vitest.config.js @@ -1,5 +1,6 @@ import { svelteInlineComponent } from '@288-toolkit/vite-plugin-svelte-inline-component'; import { sveltekit } from '@sveltejs/kit/vite'; +import { svelteTesting } from '@testing-library/svelte/vite'; import { defineProject, mergeConfig } from 'vitest/config'; import baseConfig from '../../../vitest.shared'; @@ -10,6 +11,6 @@ export default mergeConfig( setupFiles: ['./test/setup.ts'], alias: [{ find: /^svelte$/, replacement: 'svelte/internal' }] }, - plugins: [sveltekit(), svelteInlineComponent()] + plugins: [sveltekit(), svelteTesting(), svelteInlineComponent()] }) ); diff --git a/packages/components/sprite-animation/README.md b/packages/components/sprite-animation/README.md index 2975cfd7..f2ee8311 100644 --- a/packages/components/sprite-animation/README.md +++ b/packages/components/sprite-animation/README.md @@ -19,69 +19,14 @@ less than one, it won't start the animation. ## Props -### url - -The URL of the sprite. - -```ts -export let url: string; -``` - -### width - -The width in pixels of a single frame in the sprite. - -```ts -export let width: number; -``` - -### height - -The height in pixels of a single frame in the sprite. - -```ts -export let height: number; -``` - -### speed - -The speed in milliseconds of the animation. Default: 100ms. - -```ts -export let speed = 100; -``` - -### cols - -The number of columns in the sprite. - -```ts -export let cols = 1; -``` - -### rows - -The number of rows in the sprite. - -```ts -export let rows = 1; -``` - -### loop - -Whether the animation should loop. - -```ts -export let loop = true; -``` - -### still - -The still image to show when the animation is not running. - -```ts -export let still: Maybe = null; -``` +- `url` - `string`: The URL of the sprite. +- `width` - `number`: The width in pixels of a single frame in the sprite. +- `height` - `number`: The height in pixels of a single frame in the sprite. +- `speed` - `number`: The speed in milliseconds of the animation. Default: 100ms. +- `cols` - `number`: The number of columns in the sprite. +- `rows` - `number`: The number of rows in the sprite. +- `loop` - `boolean`: Whether the animation should loop. +- `still` - `string`: The still image to show when the animation is not running. ## Example diff --git a/packages/components/sprite-animation/package.json b/packages/components/sprite-animation/package.json index 73b37754..650705f1 100644 --- a/packages/components/sprite-animation/package.json +++ b/packages/components/sprite-animation/package.json @@ -28,17 +28,17 @@ } }, "peerDependencies": { - "svelte": "4.x || 5.x", - "motion": "10.x" + "motion": "11.x", + "svelte": "5.x" }, "dependencies": { "@288-toolkit/device": "workspace:^", "@288-toolkit/types": "workspace:^", - "esm-env": "1.0.0" + "esm-env": "1.2.2" }, "devDependencies": { "@288-toolkit/vite-plugin-svelte-inline-component": "workspace:^", - "@testing-library/svelte": "^5.1.0", - "svelte-preprocess": "5.1.4" + "@testing-library/jest-dom": "^6.6.3", + "@testing-library/svelte": "^5.2.6" } } diff --git a/packages/components/sprite-animation/src/lib/SpriteAnimation.svelte b/packages/components/sprite-animation/src/lib/SpriteAnimation.svelte index 816d8549..ef262cc1 100644 --- a/packages/components/sprite-animation/src/lib/SpriteAnimation.svelte +++ b/packages/components/sprite-animation/src/lib/SpriteAnimation.svelte @@ -1,4 +1,4 @@ - @@ -189,11 +204,11 @@ --background-size: {cols * 100}% {rows * 100}%; --padding-bottom: {paddingRatio}%; " - /> + > {/if}