@viji-dev/core 0.3.23 → 0.3.24
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 +1427 -1439
- package/dist/artist-dts-p5.js +1 -1
- package/dist/artist-dts.js +1 -1
- package/dist/artist-global.d.ts +35 -31
- package/dist/assets/{viji.worker-DTQvTudb.js → viji.worker-Zg128woJ.js} +321 -121
- package/dist/assets/viji.worker-Zg128woJ.js.map +1 -0
- package/dist/docs-api.js +1079 -122
- package/dist/{essentia-wasm.web-0nilrUD3.js → essentia-wasm.web-Dq7KVAx1.js} +2 -2
- package/dist/{essentia-wasm.web-0nilrUD3.js.map → essentia-wasm.web-Dq7KVAx1.js.map} +1 -1
- package/dist/{index-Bu1euCdl.js → index-C6fMmKQj.js} +48 -167
- package/dist/index-C6fMmKQj.js.map +1 -0
- package/dist/index.d.ts +38 -32
- package/dist/index.js +1 -1
- package/dist/shader-uniforms.js +52 -7
- package/package.json +1 -1
- package/dist/assets/viji.worker-DTQvTudb.js.map +0 -1
- package/dist/index-Bu1euCdl.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -553,6 +553,21 @@ declare interface BeatEvent {
|
|
|
553
553
|
bands?: string[];
|
|
554
554
|
}
|
|
555
555
|
|
|
556
|
+
declare interface ButtonConfig {
|
|
557
|
+
label: string;
|
|
558
|
+
description?: string;
|
|
559
|
+
group?: string;
|
|
560
|
+
category?: ParameterCategory;
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
declare interface ButtonParameter {
|
|
564
|
+
value: boolean;
|
|
565
|
+
label: string;
|
|
566
|
+
description?: string;
|
|
567
|
+
group: string;
|
|
568
|
+
category: ParameterCategory;
|
|
569
|
+
}
|
|
570
|
+
|
|
556
571
|
export declare interface CaptureFrameOptions {
|
|
557
572
|
/** Output format: 'blob' for encoded image, 'bitmap' for GPU-friendly ImageBitmap */
|
|
558
573
|
format?: 'blob' | 'bitmap';
|
|
@@ -845,7 +860,7 @@ declare interface ImageConfig {
|
|
|
845
860
|
}
|
|
846
861
|
|
|
847
862
|
declare interface ImageParameter {
|
|
848
|
-
value: ImageBitmap |
|
|
863
|
+
value: ImageBitmap | null;
|
|
849
864
|
label: string;
|
|
850
865
|
description?: string;
|
|
851
866
|
group: string;
|
|
@@ -867,6 +882,7 @@ export declare interface KeyboardAPI {
|
|
|
867
882
|
ctrl: boolean;
|
|
868
883
|
alt: boolean;
|
|
869
884
|
meta: boolean;
|
|
885
|
+
textureData: Uint8Array;
|
|
870
886
|
}
|
|
871
887
|
|
|
872
888
|
export declare interface KeyboardEventData {
|
|
@@ -887,10 +903,6 @@ export declare interface MouseAPI {
|
|
|
887
903
|
leftButton: boolean;
|
|
888
904
|
rightButton: boolean;
|
|
889
905
|
middleButton: boolean;
|
|
890
|
-
velocity: {
|
|
891
|
-
x: number;
|
|
892
|
-
y: number;
|
|
893
|
-
};
|
|
894
906
|
deltaX: number;
|
|
895
907
|
deltaY: number;
|
|
896
908
|
wheelDelta: number;
|
|
@@ -957,7 +969,7 @@ export declare interface ParameterConfig {
|
|
|
957
969
|
}
|
|
958
970
|
|
|
959
971
|
export declare interface ParameterDefinition {
|
|
960
|
-
type: 'slider' | 'color' | 'toggle' | 'select' | 'text' | 'number' | 'image';
|
|
972
|
+
type: 'slider' | 'color' | 'toggle' | 'select' | 'text' | 'number' | 'image' | 'button';
|
|
961
973
|
defaultValue: any;
|
|
962
974
|
label?: string;
|
|
963
975
|
description?: string;
|
|
@@ -976,7 +988,7 @@ export declare interface ParameterGroup {
|
|
|
976
988
|
parameters: Record<string, ParameterDefinition>;
|
|
977
989
|
}
|
|
978
990
|
|
|
979
|
-
declare type ParameterValue = string | number | boolean | ImageBitmap |
|
|
991
|
+
declare type ParameterValue = string | number | boolean | ImageBitmap | null;
|
|
980
992
|
|
|
981
993
|
declare interface PatternInfo {
|
|
982
994
|
length: number;
|
|
@@ -1031,6 +1043,18 @@ declare interface PLLState {
|
|
|
1031
1043
|
driftRate: number;
|
|
1032
1044
|
}
|
|
1033
1045
|
|
|
1046
|
+
declare interface PointerAPI {
|
|
1047
|
+
x: number;
|
|
1048
|
+
y: number;
|
|
1049
|
+
deltaX: number;
|
|
1050
|
+
deltaY: number;
|
|
1051
|
+
isDown: boolean;
|
|
1052
|
+
wasPressed: boolean;
|
|
1053
|
+
wasReleased: boolean;
|
|
1054
|
+
isInCanvas: boolean;
|
|
1055
|
+
type: 'mouse' | 'touch' | 'none';
|
|
1056
|
+
}
|
|
1057
|
+
|
|
1034
1058
|
declare interface PoseData {
|
|
1035
1059
|
confidence: number;
|
|
1036
1060
|
landmarks: {
|
|
@@ -1155,7 +1179,6 @@ export declare interface TouchAPI {
|
|
|
1155
1179
|
moved: TouchPoint[];
|
|
1156
1180
|
ended: TouchPoint[];
|
|
1157
1181
|
primary: TouchPoint | null;
|
|
1158
|
-
gestures: TouchGestureAPI;
|
|
1159
1182
|
}
|
|
1160
1183
|
|
|
1161
1184
|
export declare interface TouchEventData {
|
|
@@ -1172,27 +1195,6 @@ export declare interface TouchEventData {
|
|
|
1172
1195
|
}>;
|
|
1173
1196
|
}
|
|
1174
1197
|
|
|
1175
|
-
declare interface TouchGestureAPI {
|
|
1176
|
-
isPinching: boolean;
|
|
1177
|
-
isRotating: boolean;
|
|
1178
|
-
isPanning: boolean;
|
|
1179
|
-
isTapping: boolean;
|
|
1180
|
-
pinchScale: number;
|
|
1181
|
-
pinchDelta: number;
|
|
1182
|
-
rotationAngle: number;
|
|
1183
|
-
rotationDelta: number;
|
|
1184
|
-
panDelta: {
|
|
1185
|
-
x: number;
|
|
1186
|
-
y: number;
|
|
1187
|
-
};
|
|
1188
|
-
tapCount: number;
|
|
1189
|
-
lastTapTime: number;
|
|
1190
|
-
tapPosition: {
|
|
1191
|
-
x: number;
|
|
1192
|
-
y: number;
|
|
1193
|
-
} | null;
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1196
1198
|
declare interface TouchPoint {
|
|
1197
1199
|
id: number;
|
|
1198
1200
|
x: number;
|
|
@@ -1203,6 +1205,7 @@ declare interface TouchPoint {
|
|
|
1203
1205
|
radiusY: number;
|
|
1204
1206
|
rotationAngle: number;
|
|
1205
1207
|
force: number;
|
|
1208
|
+
isInCanvas: boolean;
|
|
1206
1209
|
deltaX: number;
|
|
1207
1210
|
deltaY: number;
|
|
1208
1211
|
velocity: {
|
|
@@ -1257,10 +1260,9 @@ export declare type VideoStreamType = 'main' | 'additional' | 'directFrame' | 'd
|
|
|
1257
1260
|
export declare interface VijiAPI {
|
|
1258
1261
|
canvas: OffscreenCanvas;
|
|
1259
1262
|
ctx?: OffscreenCanvasRenderingContext2D;
|
|
1260
|
-
gl?: WebGL2RenderingContext;
|
|
1263
|
+
gl?: WebGLRenderingContext | WebGL2RenderingContext;
|
|
1261
1264
|
width: number;
|
|
1262
1265
|
height: number;
|
|
1263
|
-
pixelRatio: number;
|
|
1264
1266
|
time: number;
|
|
1265
1267
|
deltaTime: number;
|
|
1266
1268
|
frameCount: number;
|
|
@@ -1271,6 +1273,7 @@ export declare interface VijiAPI {
|
|
|
1271
1273
|
mouse: MouseAPI;
|
|
1272
1274
|
keyboard: KeyboardAPI;
|
|
1273
1275
|
touches: TouchAPI;
|
|
1276
|
+
pointer: PointerAPI;
|
|
1274
1277
|
device: DeviceSensorState;
|
|
1275
1278
|
devices: DeviceState[];
|
|
1276
1279
|
slider: (defaultValue: number, config: SliderConfig) => SliderParameter;
|
|
@@ -1280,7 +1283,10 @@ export declare interface VijiAPI {
|
|
|
1280
1283
|
text: (defaultValue: string, config: TextConfig) => TextParameter;
|
|
1281
1284
|
number: (defaultValue: number, config: NumberConfig) => NumberParameter;
|
|
1282
1285
|
image: (defaultValue: null, config: ImageConfig) => ImageParameter;
|
|
1283
|
-
|
|
1286
|
+
button: (config: ButtonConfig) => ButtonParameter;
|
|
1287
|
+
useContext(type: '2d'): OffscreenCanvasRenderingContext2D | null;
|
|
1288
|
+
useContext(type: 'webgl'): WebGLRenderingContext | null;
|
|
1289
|
+
useContext(type: 'webgl2'): WebGL2RenderingContext | null;
|
|
1284
1290
|
}
|
|
1285
1291
|
|
|
1286
1292
|
/**
|
package/dist/index.js
CHANGED
package/dist/shader-uniforms.js
CHANGED
|
@@ -19,11 +19,6 @@ export const shaderUniforms = {
|
|
|
19
19
|
"category": "Core",
|
|
20
20
|
"description": "Current frame number"
|
|
21
21
|
},
|
|
22
|
-
"u_pixelRatio": {
|
|
23
|
-
"type": "float",
|
|
24
|
-
"category": "Core",
|
|
25
|
-
"description": "Device pixel ratio for high-DPI displays"
|
|
26
|
-
},
|
|
27
22
|
"u_fps": {
|
|
28
23
|
"type": "float",
|
|
29
24
|
"category": "Core",
|
|
@@ -59,10 +54,25 @@ export const shaderUniforms = {
|
|
|
59
54
|
"category": "Mouse API",
|
|
60
55
|
"description": "True if middle mouse button is pressed"
|
|
61
56
|
},
|
|
62
|
-
"
|
|
57
|
+
"u_mouseDelta": {
|
|
63
58
|
"type": "vec2",
|
|
64
59
|
"category": "Mouse API",
|
|
65
|
-
"description": "Mouse movement
|
|
60
|
+
"description": "Mouse movement delta in pixels (per frame)"
|
|
61
|
+
},
|
|
62
|
+
"u_mouseWheel": {
|
|
63
|
+
"type": "float",
|
|
64
|
+
"category": "Mouse API",
|
|
65
|
+
"description": "Mouse wheel scroll delta (per frame)"
|
|
66
|
+
},
|
|
67
|
+
"u_mouseWasPressed": {
|
|
68
|
+
"type": "bool",
|
|
69
|
+
"category": "Mouse API",
|
|
70
|
+
"description": "True on the frame a mouse button was pressed"
|
|
71
|
+
},
|
|
72
|
+
"u_mouseWasReleased": {
|
|
73
|
+
"type": "bool",
|
|
74
|
+
"category": "Mouse API",
|
|
75
|
+
"description": "True on the frame a mouse button was released"
|
|
66
76
|
},
|
|
67
77
|
"u_keySpace": {
|
|
68
78
|
"type": "bool",
|
|
@@ -124,6 +134,11 @@ export const shaderUniforms = {
|
|
|
124
134
|
"category": "Keyboard API",
|
|
125
135
|
"description": "True if Right arrow key is pressed"
|
|
126
136
|
},
|
|
137
|
+
"u_keyboard": {
|
|
138
|
+
"type": "sampler2D",
|
|
139
|
+
"category": "Row 0: held state, Row 1: pressed this frame, Row 2: toggle",
|
|
140
|
+
"description": "Keyboard state texture (256x3, LUMINANCE)"
|
|
141
|
+
},
|
|
127
142
|
"u_touchCount": {
|
|
128
143
|
"type": "int",
|
|
129
144
|
"category": "Touch API",
|
|
@@ -154,6 +169,36 @@ export const shaderUniforms = {
|
|
|
154
169
|
"category": "Touch API",
|
|
155
170
|
"description": "Fifth touch point position in pixels"
|
|
156
171
|
},
|
|
172
|
+
"u_pointer": {
|
|
173
|
+
"type": "vec2",
|
|
174
|
+
"category": "Pointer API (unified mouse/touch)",
|
|
175
|
+
"description": "Primary input position in pixels (WebGL coords)"
|
|
176
|
+
},
|
|
177
|
+
"u_pointerDelta": {
|
|
178
|
+
"type": "vec2",
|
|
179
|
+
"category": "Pointer API (unified mouse/touch)",
|
|
180
|
+
"description": "Primary input movement delta (per frame)"
|
|
181
|
+
},
|
|
182
|
+
"u_pointerDown": {
|
|
183
|
+
"type": "bool",
|
|
184
|
+
"category": "Pointer API (unified mouse/touch)",
|
|
185
|
+
"description": "True if primary input is active (left-click or touch)"
|
|
186
|
+
},
|
|
187
|
+
"u_pointerWasPressed": {
|
|
188
|
+
"type": "bool",
|
|
189
|
+
"category": "Pointer API (unified mouse/touch)",
|
|
190
|
+
"description": "True on the frame primary input became active"
|
|
191
|
+
},
|
|
192
|
+
"u_pointerWasReleased": {
|
|
193
|
+
"type": "bool",
|
|
194
|
+
"category": "Pointer API (unified mouse/touch)",
|
|
195
|
+
"description": "True on the frame primary input was released"
|
|
196
|
+
},
|
|
197
|
+
"u_pointerInCanvas": {
|
|
198
|
+
"type": "bool",
|
|
199
|
+
"category": "Pointer API (unified mouse/touch)",
|
|
200
|
+
"description": "True if primary input is inside canvas bounds"
|
|
201
|
+
},
|
|
157
202
|
"u_audioVolume": {
|
|
158
203
|
"type": "float",
|
|
159
204
|
"category": "Audio",
|