@canvas-commons/core 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/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@canvas-commons/core",
3
+ "version": "0.2.0",
4
+ "description": "Web-based tool for creating animations programmatically",
5
+ "type": "module",
6
+ "main": "./lib/index.js",
7
+ "types": "./lib/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./lib/index.d.ts",
11
+ "default": "./lib/index.js"
12
+ },
13
+ "./project": {
14
+ "types": "./project.d.ts"
15
+ },
16
+ "./shaders/*": "./shaders/*",
17
+ "./tsconfig.project.json": "./tsconfig.project.json",
18
+ "./package.json": "./package.json"
19
+ },
20
+ "engines": {
21
+ "node": ">=20.19.0"
22
+ },
23
+ "author": "canvas-commons",
24
+ "homepage": "https://canvascommons.io/",
25
+ "bugs": "https://github.com/canvas-commons/canvas-commons/issues",
26
+ "license": "MIT",
27
+ "sideEffects": false,
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/canvas-commons/canvas-commons.git",
31
+ "directory": "packages/core"
32
+ },
33
+ "files": [
34
+ "lib",
35
+ "tsconfig.project.json",
36
+ "project.d.ts",
37
+ "shaders"
38
+ ],
39
+ "dependencies": {
40
+ "chroma-js": "^3.2.0"
41
+ },
42
+ "devDependencies": {
43
+ "@types/chroma-js": "3.1.2",
44
+ "jsdom": "^29.1.0",
45
+ "vitest": "^4.1.0"
46
+ },
47
+ "scripts": {
48
+ "dev": "tsdown --watch",
49
+ "build": "tsdown",
50
+ "test": "vitest run",
51
+ "lint:pkg": "publint --strict && attw --pack . --profile esm-only --ignore-rules internal-resolution-error"
52
+ }
53
+ }
package/project.d.ts ADDED
@@ -0,0 +1,29 @@
1
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2
+ /// <reference types="vite/client" />
3
+
4
+ declare module '*?img' {
5
+ const value: Promise<HTMLImageElement>;
6
+ export = value;
7
+ }
8
+
9
+ declare module '*?anim' {
10
+ const value: Promise<HTMLImageElement[]>;
11
+ export = value;
12
+ }
13
+
14
+ declare module '*.csv' {
15
+ const value: unknown;
16
+ export = value;
17
+ }
18
+
19
+ declare module '*.glsl' {
20
+ const value: string;
21
+ export = value;
22
+ }
23
+
24
+ declare module '*?scene' {
25
+ const value: import('@canvas-commons/core').FullSceneDescription;
26
+ export = value;
27
+ }
28
+
29
+ declare type Callback = (...args: any[]) => void;
@@ -0,0 +1,15 @@
1
+ in vec2 screenUV;
2
+ in vec2 sourceUV;
3
+ in vec2 destinationUV;
4
+
5
+ out vec4 outColor;
6
+
7
+ uniform float time;
8
+ uniform float deltaTime;
9
+ uniform float framerate;
10
+ uniform int frame;
11
+ uniform vec2 resolution;
12
+ uniform sampler2D sourceTexture;
13
+ uniform sampler2D destinationTexture;
14
+ uniform mat4 sourceMatrix;
15
+ uniform mat4 destinationMatrix;
@@ -0,0 +1,8 @@
1
+ #version 300 es
2
+ precision highp float;
3
+
4
+ #include "./common.glsl"
5
+
6
+ void main() {
7
+ outColor = textureLod(sourceTexture, sourceUV, 0.0);
8
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "compilerOptions": {
3
+ "sourceMap": true,
4
+ "noImplicitAny": true,
5
+ "strictNullChecks": false,
6
+ "module": "esnext",
7
+ "target": "es2020",
8
+ "allowJs": true,
9
+ "noEmit": true,
10
+ "moduleResolution": "bundler",
11
+ "resolveJsonModule": true,
12
+ "allowSyntheticDefaultImports": true,
13
+ "experimentalDecorators": true
14
+ }
15
+ }