canvasengine 2.0.0-beta.24 → 2.0.0-beta.25
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/DebugRenderer-LPVGoCBJ.js +172 -0
- package/dist/DebugRenderer-LPVGoCBJ.js.map +1 -0
- package/dist/components/Canvas.d.ts +18 -0
- package/dist/components/Canvas.d.ts.map +1 -0
- package/dist/components/Container.d.ts +79 -0
- package/dist/components/Container.d.ts.map +1 -0
- package/dist/components/DOMContainer.d.ts +76 -0
- package/dist/components/DOMContainer.d.ts.map +1 -0
- package/dist/components/DOMElement.d.ts +44 -0
- package/dist/components/DOMElement.d.ts.map +1 -0
- package/dist/components/DisplayObject.d.ts +81 -0
- package/dist/components/DisplayObject.d.ts.map +1 -0
- package/dist/components/Graphic.d.ts +65 -0
- package/dist/components/Graphic.d.ts.map +1 -0
- package/dist/components/Mesh.d.ts +201 -0
- package/dist/components/Mesh.d.ts.map +1 -0
- package/dist/components/NineSliceSprite.d.ts +17 -0
- package/dist/components/NineSliceSprite.d.ts.map +1 -0
- package/dist/components/ParticleEmitter.d.ts +5 -0
- package/dist/components/ParticleEmitter.d.ts.map +1 -0
- package/dist/components/Scene.d.ts +2 -0
- package/dist/components/Scene.d.ts.map +1 -0
- package/dist/components/Sprite.d.ts +173 -0
- package/dist/components/Sprite.d.ts.map +1 -0
- package/dist/components/Text.d.ts +21 -0
- package/dist/components/Text.d.ts.map +1 -0
- package/dist/components/TilingSprite.d.ts +18 -0
- package/dist/components/TilingSprite.d.ts.map +1 -0
- package/dist/components/Video.d.ts +15 -0
- package/dist/components/Video.d.ts.map +1 -0
- package/dist/components/Viewport.d.ts +105 -0
- package/dist/components/Viewport.d.ts.map +1 -0
- package/dist/components/index.d.ts +16 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/types/DisplayObject.d.ts +106 -0
- package/dist/components/types/DisplayObject.d.ts.map +1 -0
- package/dist/components/types/MouseEvent.d.ts +4 -0
- package/dist/components/types/MouseEvent.d.ts.map +1 -0
- package/dist/components/types/Spritesheet.d.ts +366 -0
- package/dist/components/types/Spritesheet.d.ts.map +1 -0
- package/dist/components/types/index.d.ts +5 -0
- package/dist/components/types/index.d.ts.map +1 -0
- package/dist/directives/Drag.d.ts +70 -0
- package/dist/directives/Drag.d.ts.map +1 -0
- package/dist/directives/KeyboardControls.d.ts +530 -0
- package/dist/directives/KeyboardControls.d.ts.map +1 -0
- package/dist/directives/Scheduler.d.ts +36 -0
- package/dist/directives/Scheduler.d.ts.map +1 -0
- package/dist/directives/Sound.d.ts +26 -0
- package/dist/directives/Sound.d.ts.map +1 -0
- package/dist/directives/Transition.d.ts +11 -0
- package/dist/directives/Transition.d.ts.map +1 -0
- package/dist/directives/ViewportCull.d.ts +12 -0
- package/dist/directives/ViewportCull.d.ts.map +1 -0
- package/dist/directives/ViewportFollow.d.ts +19 -0
- package/dist/directives/ViewportFollow.d.ts.map +1 -0
- package/dist/directives/index.d.ts +2 -0
- package/dist/directives/index.d.ts.map +1 -0
- package/dist/engine/animation.d.ts +59 -0
- package/dist/engine/animation.d.ts.map +1 -0
- package/dist/engine/bootstrap.d.ts +16 -0
- package/dist/engine/bootstrap.d.ts.map +1 -0
- package/dist/engine/directive.d.ts +14 -0
- package/dist/engine/directive.d.ts.map +1 -0
- package/dist/engine/reactive.d.ts +68 -0
- package/dist/engine/reactive.d.ts.map +1 -0
- package/dist/engine/signal.d.ts +72 -0
- package/dist/engine/signal.d.ts.map +1 -0
- package/dist/engine/trigger.d.ts +51 -0
- package/dist/engine/trigger.d.ts.map +1 -0
- package/dist/engine/utils.d.ts +90 -0
- package/dist/engine/utils.d.ts.map +1 -0
- package/dist/hooks/addContext.d.ts +2 -0
- package/dist/hooks/addContext.d.ts.map +1 -0
- package/dist/hooks/useProps.d.ts +42 -0
- package/dist/hooks/useProps.d.ts.map +1 -0
- package/dist/hooks/useRef.d.ts +5 -0
- package/dist/hooks/useRef.d.ts.map +1 -0
- package/dist/index-5TTorHyA.js +10931 -0
- package/dist/index-5TTorHyA.js.map +1 -0
- package/dist/index.d.ts +15 -1287
- package/dist/index.d.ts.map +1 -0
- package/dist/index.global.js +28 -1442
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +62 -2
- package/dist/index.js.map +1 -1
- package/dist/utils/Ease.d.ts +17 -0
- package/dist/utils/Ease.d.ts.map +1 -0
- package/dist/utils/RadialGradient.d.ts +58 -0
- package/dist/utils/RadialGradient.d.ts.map +1 -0
- package/dist/utils/functions.d.ts +2 -0
- package/dist/utils/functions.d.ts.map +1 -0
- package/package.json +6 -4
- package/tsconfig.json +17 -0
- package/vite.config.ts +39 -0
- package/tsup.config.ts +0 -18
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const Easing: {
|
|
2
|
+
linear: import('popmotion').Easing;
|
|
3
|
+
easeIn: import('popmotion').Easing;
|
|
4
|
+
easeInOut: import('popmotion').Easing;
|
|
5
|
+
easeOut: import('popmotion').Easing;
|
|
6
|
+
circIn: import('popmotion').Easing;
|
|
7
|
+
circInOut: import('popmotion').Easing;
|
|
8
|
+
circOut: import('popmotion').Easing;
|
|
9
|
+
backIn: import('popmotion').Easing;
|
|
10
|
+
backInOut: import('popmotion').Easing;
|
|
11
|
+
backOut: import('popmotion').Easing;
|
|
12
|
+
anticipate: import('popmotion').Easing;
|
|
13
|
+
bounceIn: import('popmotion').Easing;
|
|
14
|
+
bounceInOut: (p: number) => number;
|
|
15
|
+
bounceOut: (p: number) => number;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=Ease.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Ease.d.ts","sourceRoot":"","sources":["../../src/utils/Ease.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;CAelB,CAAA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Texture, Matrix } from 'pixi.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Creates a radial gradient texture that can be used in PixiJS.
|
|
5
|
+
* @example
|
|
6
|
+
* const gradient = new RadialGradient(size, size, 0, size, size, 0);
|
|
7
|
+
* gradient.addColorStop(0, "rgba(255, 255, 0, 1)");
|
|
8
|
+
* gradient.addColorStop(0.5, "rgba(255, 255, 0, 0.3)");
|
|
9
|
+
* gradient.addColorStop(0.8, "rgba(255, 255, 0, 0)");
|
|
10
|
+
*/
|
|
11
|
+
export declare class RadialGradient {
|
|
12
|
+
private x0;
|
|
13
|
+
private y0;
|
|
14
|
+
private x1;
|
|
15
|
+
private y1;
|
|
16
|
+
private x2;
|
|
17
|
+
private y2;
|
|
18
|
+
private focalPoint;
|
|
19
|
+
private canvas;
|
|
20
|
+
private ctx;
|
|
21
|
+
private gradient;
|
|
22
|
+
private texture;
|
|
23
|
+
transform: Matrix;
|
|
24
|
+
size: number;
|
|
25
|
+
/**
|
|
26
|
+
* Creates a new RadialGradient instance
|
|
27
|
+
* @param x0 - The x-coordinate of the starting circle
|
|
28
|
+
* @param y0 - The y-coordinate of the starting circle
|
|
29
|
+
* @param x1 - The x-coordinate of the ending circle
|
|
30
|
+
* @param y1 - The y-coordinate of the ending circle
|
|
31
|
+
* @param x2 - The x-coordinate for gradient transformation
|
|
32
|
+
* @param y2 - The y-coordinate for gradient transformation
|
|
33
|
+
* @param focalPoint - The focal point of the gradient (0-1), defaults to 0
|
|
34
|
+
*/
|
|
35
|
+
constructor(x0: number, y0: number, x1: number, y1: number, x2: number, y2: number, focalPoint?: number);
|
|
36
|
+
/**
|
|
37
|
+
* Adds a color stop to the gradient
|
|
38
|
+
* @param offset - The position of the color stop (0-1)
|
|
39
|
+
* @param color - The color value (any valid CSS color string)
|
|
40
|
+
*/
|
|
41
|
+
addColorStop(offset: number, color: string): void;
|
|
42
|
+
/**
|
|
43
|
+
* Renders the gradient and returns the texture with its transformation matrix
|
|
44
|
+
* @param options - Render options
|
|
45
|
+
* @param options.translate - Optional translation coordinates
|
|
46
|
+
* @returns Object containing the texture and transformation matrix
|
|
47
|
+
*/
|
|
48
|
+
render({ translate }?: {
|
|
49
|
+
translate?: {
|
|
50
|
+
x: number;
|
|
51
|
+
y: number;
|
|
52
|
+
};
|
|
53
|
+
}): {
|
|
54
|
+
texture: Texture<import('pixi.js').TextureSource<any>>;
|
|
55
|
+
matrix: Matrix;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=RadialGradient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadialGradient.d.ts","sourceRoot":"","sources":["../../src/utils/RadialGradient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAA2B,MAAM,EAAE,MAAM,SAAS,CAAC;AAEnE;;;;;;;GAOG;AACH,qBAAa,cAAc;IAoBvB,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,EAAE;IACV,OAAO,CAAC,UAAU;IAzBpB,OAAO,CAAC,MAAM,CAAoB;IAClC,OAAO,CAAC,GAAG,CAAkC;IAC7C,OAAO,CAAC,QAAQ,CAA+B;IAC/C,OAAO,CAAC,OAAO,CAAwB;IAChC,SAAS,EAAE,MAAM,CAAC;IAElB,IAAI,SAAO;IAElB;;;;;;;;;OASG;gBAEO,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,UAAU,GAAE,MAAU;IAsBhC;;;;OAIG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAM1C;;;;;OAKG;IACH,MAAM,CAAC,EAAE,SAAS,EAAE,GAAE;QAAE,SAAS,CAAC,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAO;;;;CAuCpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functions.d.ts","sourceRoot":"","sources":["../../src/utils/functions.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,WAMhD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "canvasengine",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.25",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
"yoga-layout": "^3.2.1"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@types/howler": "^2.2.11"
|
|
22
|
+
"@types/howler": "^2.2.11",
|
|
23
|
+
"vite": "^5.0.0",
|
|
24
|
+
"vite-plugin-dts": "^3.0.0"
|
|
23
25
|
},
|
|
24
26
|
"author": "Samuel Ronce",
|
|
25
27
|
"license": "MIT",
|
|
@@ -41,7 +43,7 @@
|
|
|
41
43
|
"access": "public"
|
|
42
44
|
},
|
|
43
45
|
"scripts": {
|
|
44
|
-
"build": "
|
|
45
|
-
"dev": "
|
|
46
|
+
"build": "vite build",
|
|
47
|
+
"dev": "vite build --watch"
|
|
46
48
|
}
|
|
47
49
|
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "dist",
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"emitDeclarationOnly": false,
|
|
7
|
+
"declarationMap": true,
|
|
8
|
+
"rootDir": "src"
|
|
9
|
+
},
|
|
10
|
+
"include": [
|
|
11
|
+
"src/**/*"
|
|
12
|
+
],
|
|
13
|
+
"exclude": [
|
|
14
|
+
"dist",
|
|
15
|
+
"node_modules"
|
|
16
|
+
]
|
|
17
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
|
+
import { resolve } from 'path'
|
|
3
|
+
import dts from 'vite-plugin-dts'
|
|
4
|
+
|
|
5
|
+
export default defineConfig({
|
|
6
|
+
plugins: [dts()],
|
|
7
|
+
build: {
|
|
8
|
+
lib: {
|
|
9
|
+
entry: resolve(__dirname, 'src/index.ts'),
|
|
10
|
+
name: 'CanvasEngine'
|
|
11
|
+
},
|
|
12
|
+
rollupOptions: {
|
|
13
|
+
external: ['pixi.js'],
|
|
14
|
+
output: [
|
|
15
|
+
// ESM build
|
|
16
|
+
{
|
|
17
|
+
format: 'es',
|
|
18
|
+
dir: 'dist',
|
|
19
|
+
entryFileNames: 'index.js'
|
|
20
|
+
},
|
|
21
|
+
// IIFE build for global usage
|
|
22
|
+
{
|
|
23
|
+
format: 'iife',
|
|
24
|
+
dir: 'dist',
|
|
25
|
+
entryFileNames: 'index.global.js',
|
|
26
|
+
name: 'CanvasEngine',
|
|
27
|
+
globals: {
|
|
28
|
+
'pixi.js': 'PIXI'
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
},
|
|
33
|
+
minify: true,
|
|
34
|
+
sourcemap: true
|
|
35
|
+
},
|
|
36
|
+
define: {
|
|
37
|
+
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'production')
|
|
38
|
+
}
|
|
39
|
+
})
|
package/tsup.config.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'tsup'
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
format: ['esm', 'iife'],
|
|
5
|
-
target: 'es2020',
|
|
6
|
-
splitting: true,
|
|
7
|
-
clean: true,
|
|
8
|
-
shims: false,
|
|
9
|
-
minify: true,
|
|
10
|
-
dts: true,
|
|
11
|
-
sourcemap: true,
|
|
12
|
-
entry: ['src/index.ts'],
|
|
13
|
-
outDir: 'dist',
|
|
14
|
-
define: {
|
|
15
|
-
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'production')
|
|
16
|
-
},
|
|
17
|
-
globalName: 'CanvasEngine'
|
|
18
|
-
})
|