@viji-dev/sdk 1.0.0 → 1.0.1
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 +155 -60
- package/bin/viji.js +9 -29
- package/dist/assets/artist-dts-BHUsvSI6.js +613 -0
- package/dist/assets/artist-dts-p5-Cyw8vmy_.js +736 -0
- package/dist/assets/core-CiQx3w0t.js +12 -0
- package/dist/assets/dark-plus-C3mMm8J8.js +1 -0
- package/dist/assets/docs-api-PBLtY4Ni.js +12381 -0
- package/dist/assets/engine-javascript-CXyY7cc8.js +141 -0
- package/dist/assets/essentia-wasm.web-0S-sW98u-CYV1l1zv.js +38 -0
- package/dist/assets/essentia.js-core.es-DnrJE0uR-DOSrF5_G.js +32 -0
- package/dist/assets/glsl-DMyvO4G4.js +1 -0
- package/dist/assets/index-BhFxsauQ.js +215 -0
- package/dist/assets/index-BqhVeA7U.css +1 -0
- package/dist/assets/index-T4TOjvD0.js +1 -0
- package/dist/assets/index-Wz9WqGqz.js +52 -0
- package/dist/assets/index-t24aGwla.js +1 -0
- package/dist/assets/javascript-wDzz0qaB.js +1 -0
- package/dist/assets/shader-uniforms-GdaUkQPK.js +1 -0
- package/dist/assets/typescript-BPQ3VLAy.js +1 -0
- package/dist/assets/viji.worker-CQSJ0SiO-ljtBlcNZ.js +27018 -0
- package/{index.html → dist/index.html} +2 -1
- package/package.json +31 -35
- package/src/cli/commands/build.js +50 -99
- package/src/cli/commands/create.js +32 -47
- package/src/cli/commands/dev.js +30 -97
- package/src/cli/server/dev-server.js +233 -0
- package/src/cli/server/scene-scanner.js +93 -0
- package/src/cli/server/vite-scene-plugin.d.ts +2 -0
- package/src/cli/server/vite-scene-plugin.js +134 -0
- package/src/cli/utils/cli-utils.js +29 -139
- package/src/cli/utils/scene-compiler.js +10 -17
- package/src/templates/scene-templates.js +85 -0
- package/.gitignore +0 -29
- package/eslint.config.js +0 -37
- package/postcss.config.js +0 -6
- package/scenes/audio-visualizer/main.js +0 -287
- package/scenes/core-demo/main.js +0 -532
- package/scenes/demo-scene/main.js +0 -619
- package/scenes/global.d.ts +0 -15
- package/scenes/particle-system/main.js +0 -349
- package/scenes/tsconfig.json +0 -12
- package/scenes/video-mirror/main.ts +0 -436
- package/src/App.css +0 -42
- package/src/App.tsx +0 -279
- package/src/cli/commands/init.js +0 -262
- package/src/components/SDKPage.tsx +0 -337
- package/src/components/core/CoreContainer.tsx +0 -126
- package/src/components/ui/DeviceSelectionList.tsx +0 -137
- package/src/components/ui/FPSCounter.tsx +0 -78
- package/src/components/ui/FileDropzonePanel.tsx +0 -120
- package/src/components/ui/FileListPanel.tsx +0 -285
- package/src/components/ui/InputExpansionPanel.tsx +0 -31
- package/src/components/ui/MediaPlayerControls.tsx +0 -191
- package/src/components/ui/MenuContainer.tsx +0 -71
- package/src/components/ui/ParametersMenu.tsx +0 -797
- package/src/components/ui/ProjectSwitcherMenu.tsx +0 -192
- package/src/components/ui/QuickInputControls.tsx +0 -542
- package/src/components/ui/SDKMenuSystem.tsx +0 -96
- package/src/components/ui/SettingsMenu.tsx +0 -346
- package/src/components/ui/SimpleInputControls.tsx +0 -137
- package/src/index.css +0 -68
- package/src/main.tsx +0 -10
- package/src/scenes-hmr.ts +0 -158
- package/src/services/project-filesystem.ts +0 -436
- package/src/stores/scene-player/index.ts +0 -3
- package/src/stores/scene-player/input-manager.store.ts +0 -1045
- package/src/stores/scene-player/scene-session.store.ts +0 -659
- package/src/styles/globals.css +0 -111
- package/src/templates/minimal-template.js +0 -11
- package/src/utils/debounce.js +0 -34
- package/src/vite-env.d.ts +0 -1
- package/tailwind.config.js +0 -18
- package/tsconfig.app.json +0 -27
- package/tsconfig.json +0 -27
- package/tsconfig.node.json +0 -27
- package/vite.config.ts +0 -54
- /package/{public → dist}/favicon.png +0 -0
package/src/styles/globals.css
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
@tailwind base;
|
|
2
|
-
@tailwind components;
|
|
3
|
-
@tailwind utilities;
|
|
4
|
-
|
|
5
|
-
/* Force HeroUI Select components to show white text for selected values */
|
|
6
|
-
[data-slot="trigger"] [data-slot="value"] {
|
|
7
|
-
color: white !important;
|
|
8
|
-
opacity: 1 !important;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/* Ensure Select dropdown items are also white */
|
|
12
|
-
[data-slot="listbox"] [data-slot="base"] {
|
|
13
|
-
color: white !important;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/* Force white text in all Select components in visualizer */
|
|
17
|
-
.visualizer-select [data-slot="value"] {
|
|
18
|
-
color: white !important;
|
|
19
|
-
opacity: 1 !important;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/* Hero UI CSS Variables - Essential for proper theming */
|
|
23
|
-
:root {
|
|
24
|
-
color-scheme: light dark;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
[data-theme="light"] {
|
|
28
|
-
color-scheme: light;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
[data-theme="dark"] {
|
|
32
|
-
color-scheme: dark;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/* Ensure Hero UI components render properly */
|
|
36
|
-
.heroui-provider {
|
|
37
|
-
isolation: isolate;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/* Custom styles for better form appearance */
|
|
41
|
-
.backdrop-blur-sm {
|
|
42
|
-
backdrop-filter: blur(8px);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
/* Ensure proper text rendering */
|
|
46
|
-
.bg-clip-text {
|
|
47
|
-
-webkit-background-clip: text;
|
|
48
|
-
background-clip: text;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
html {
|
|
52
|
-
scroll-behavior: smooth;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
body {
|
|
56
|
-
margin: 0;
|
|
57
|
-
min-height: 100vh;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/* Repeating Viji pattern background (used as thumbnail fallback) */
|
|
61
|
-
.bg-viji-pattern {
|
|
62
|
-
background-image: url('../assets/pattern_viji_x4.png');
|
|
63
|
-
background-repeat: repeat;
|
|
64
|
-
background-size: auto;
|
|
65
|
-
background-position: 0 0;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/* Marquee with side fade */
|
|
69
|
-
.marquee-fade {
|
|
70
|
-
position: relative;
|
|
71
|
-
overflow: hidden;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.marquee-fade::before,
|
|
75
|
-
.marquee-fade::after {
|
|
76
|
-
content: '';
|
|
77
|
-
position: absolute;
|
|
78
|
-
top: 0;
|
|
79
|
-
bottom: 0;
|
|
80
|
-
width: 24px;
|
|
81
|
-
pointer-events: none;
|
|
82
|
-
z-index: 1;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.marquee-fade::before {
|
|
86
|
-
left: 0;
|
|
87
|
-
background: linear-gradient(to right, rgba(17,17,17,1), rgba(17,17,17,0));
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.marquee-fade::after {
|
|
91
|
-
right: 0;
|
|
92
|
-
background: linear-gradient(to left, rgba(17,17,17,1), rgba(17,17,17,0));
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.marquee-content {
|
|
96
|
-
display: inline-block;
|
|
97
|
-
padding-left: 8px;
|
|
98
|
-
animation: marquee-scroll 10s linear infinite;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
@keyframes marquee-scroll {
|
|
102
|
-
0% {
|
|
103
|
-
transform: translateX(0%);
|
|
104
|
-
}
|
|
105
|
-
50% {
|
|
106
|
-
transform: translateX(-50%);
|
|
107
|
-
}
|
|
108
|
-
100% {
|
|
109
|
-
transform: translateX(0%);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// Shared minimal scene template for new projects (single source of truth)
|
|
2
|
-
// Used by both the SDK UI fallback and CLI create command
|
|
3
|
-
|
|
4
|
-
export function getMinimalSceneTemplate(lang = 'js') {
|
|
5
|
-
if (lang === 'ts') {
|
|
6
|
-
return `// New TypeScript Scene\n\n// Parameter declarations\n// const speed = viji.slider(1.0, { min: 0.1, max: 3.0, label: 'Speed' });\n// const color = viji.color('#ff0000', { label: 'Color' });\n\nfunction render(viji: any) {\n // Your scene code here\n}\n`;
|
|
7
|
-
}
|
|
8
|
-
return `// New JavaScript Scene\n\n// Parameter declarations\n// const speed = viji.slider(1.0, { min: 0.1, max: 3.0, label: 'Speed' });\n// const color = viji.color('#ff0000', { label: 'Color' });\n\nfunction render(viji) {\n // Your scene code here\n}\n`;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
package/src/utils/debounce.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Debounce utility for hot reload and other operations
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
export function debounce(func, wait, immediate) {
|
|
6
|
-
let timeout;
|
|
7
|
-
|
|
8
|
-
return function executedFunction(...args) {
|
|
9
|
-
const later = () => {
|
|
10
|
-
timeout = null;
|
|
11
|
-
if (!immediate) func(...args);
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const callNow = immediate && !timeout;
|
|
15
|
-
|
|
16
|
-
clearTimeout(timeout);
|
|
17
|
-
timeout = setTimeout(later, wait);
|
|
18
|
-
|
|
19
|
-
if (callNow) func(...args);
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export function throttle(func, limit) {
|
|
24
|
-
let inThrottle;
|
|
25
|
-
|
|
26
|
-
return function(...args) {
|
|
27
|
-
if (!inThrottle) {
|
|
28
|
-
func.apply(this, args);
|
|
29
|
-
inThrottle = true;
|
|
30
|
-
setTimeout(() => inThrottle = false, limit);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
|
package/src/vite-env.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
package/tailwind.config.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { heroui } from "@heroui/react";
|
|
2
|
-
|
|
3
|
-
/** @type {import('tailwindcss').Config} */
|
|
4
|
-
export default {
|
|
5
|
-
content: [
|
|
6
|
-
"./index.html",
|
|
7
|
-
"./src/**/*.{js,ts,jsx,tsx}",
|
|
8
|
-
"./node_modules/@heroui/react/dist/**/*.{js,ts,jsx,tsx}",
|
|
9
|
-
"./node_modules/@heroui/**/dist/**/*.{js,ts,jsx,tsx}",
|
|
10
|
-
],
|
|
11
|
-
theme: {
|
|
12
|
-
extend: {},
|
|
13
|
-
},
|
|
14
|
-
darkMode: "class",
|
|
15
|
-
plugins: [heroui({
|
|
16
|
-
addCommonColors: true,
|
|
17
|
-
})],
|
|
18
|
-
};
|
package/tsconfig.app.json
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
4
|
-
"target": "ES2022",
|
|
5
|
-
"useDefineForClassFields": true,
|
|
6
|
-
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
-
"module": "ESNext",
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
|
|
10
|
-
/* Bundler mode */
|
|
11
|
-
"moduleResolution": "bundler",
|
|
12
|
-
"allowImportingTsExtensions": true,
|
|
13
|
-
"verbatimModuleSyntax": true,
|
|
14
|
-
"moduleDetection": "force",
|
|
15
|
-
"noEmit": true,
|
|
16
|
-
"jsx": "react-jsx",
|
|
17
|
-
|
|
18
|
-
/* Linting */
|
|
19
|
-
"strict": true,
|
|
20
|
-
"noUnusedLocals": true,
|
|
21
|
-
"noUnusedParameters": true,
|
|
22
|
-
"erasableSyntaxOnly": true,
|
|
23
|
-
"noFallthroughCasesInSwitch": true,
|
|
24
|
-
"noUncheckedSideEffectImports": true
|
|
25
|
-
},
|
|
26
|
-
"include": ["src"]
|
|
27
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2020",
|
|
4
|
-
"useDefineForClassFields": true,
|
|
5
|
-
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
6
|
-
"module": "ESNext",
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"moduleResolution": "bundler",
|
|
9
|
-
"allowImportingTsExtensions": true,
|
|
10
|
-
"resolveJsonModule": true,
|
|
11
|
-
"isolatedModules": true,
|
|
12
|
-
"noEmit": true,
|
|
13
|
-
"jsx": "react-jsx",
|
|
14
|
-
"strict": true,
|
|
15
|
-
"noUnusedLocals": true,
|
|
16
|
-
"noUnusedParameters": true,
|
|
17
|
-
"noFallthroughCasesInSwitch": true,
|
|
18
|
-
"baseUrl": ".",
|
|
19
|
-
"paths": {
|
|
20
|
-
"@/*": ["src/*"]
|
|
21
|
-
},
|
|
22
|
-
"moduleDetection": "force"
|
|
23
|
-
},
|
|
24
|
-
"include": ["src", "scenes"],
|
|
25
|
-
"exclude": ["src/components/ui-disabled", "src/stores-disabled", "src/hooks-disabled"],
|
|
26
|
-
"references": [{ "path": "./tsconfig.node.json" }]
|
|
27
|
-
}
|
package/tsconfig.node.json
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"composite": true,
|
|
4
|
-
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
5
|
-
"target": "ES2023",
|
|
6
|
-
"lib": ["ES2023"],
|
|
7
|
-
"module": "ESNext",
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
|
|
10
|
-
/* Bundler mode */
|
|
11
|
-
"moduleResolution": "bundler",
|
|
12
|
-
"allowImportingTsExtensions": true,
|
|
13
|
-
"verbatimModuleSyntax": true,
|
|
14
|
-
"moduleDetection": "force",
|
|
15
|
-
"declaration": true,
|
|
16
|
-
"emitDeclarationOnly": true,
|
|
17
|
-
|
|
18
|
-
/* Linting */
|
|
19
|
-
"strict": true,
|
|
20
|
-
"noUnusedLocals": true,
|
|
21
|
-
"noUnusedParameters": true,
|
|
22
|
-
"erasableSyntaxOnly": true,
|
|
23
|
-
"noFallthroughCasesInSwitch": true,
|
|
24
|
-
"noUncheckedSideEffectImports": true
|
|
25
|
-
},
|
|
26
|
-
"include": ["vite.config.ts"]
|
|
27
|
-
}
|
package/vite.config.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite'
|
|
2
|
-
import react from '@vitejs/plugin-react'
|
|
3
|
-
import { fileURLToPath, URL } from 'node:url'
|
|
4
|
-
|
|
5
|
-
// https://vite.dev/config/
|
|
6
|
-
export default defineConfig(({ mode }) => {
|
|
7
|
-
return {
|
|
8
|
-
plugins: [react()],
|
|
9
|
-
resolve: {
|
|
10
|
-
alias: {
|
|
11
|
-
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
12
|
-
'/scenes': fileURLToPath(new URL('./scenes', import.meta.url)),
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
worker: {
|
|
16
|
-
format: 'es',
|
|
17
|
-
plugins: () => [react()],
|
|
18
|
-
},
|
|
19
|
-
optimizeDeps: {
|
|
20
|
-
exclude: ['@viji-dev/core'],
|
|
21
|
-
include: [
|
|
22
|
-
'react',
|
|
23
|
-
'react-dom',
|
|
24
|
-
'@heroui/react',
|
|
25
|
-
'zustand'
|
|
26
|
-
],
|
|
27
|
-
},
|
|
28
|
-
build: {
|
|
29
|
-
target: 'esnext',
|
|
30
|
-
rollupOptions: {
|
|
31
|
-
output: { format: 'es' },
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
server: {
|
|
35
|
-
host: '0.0.0.0',
|
|
36
|
-
open: true,
|
|
37
|
-
fs: {
|
|
38
|
-
// Allow serving files from project root (so /scenes is watched)
|
|
39
|
-
allow: ['..', '.', '../scenes']
|
|
40
|
-
},
|
|
41
|
-
headers: {
|
|
42
|
-
// Temporarily relax CORS headers to allow VijiCore iframes
|
|
43
|
-
// 'Cross-Origin-Embedder-Policy': 'credentialless',
|
|
44
|
-
// 'Cross-Origin-Opener-Policy': 'same-origin',
|
|
45
|
-
'Access-Control-Allow-Origin': '*',
|
|
46
|
-
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
|
|
47
|
-
'Access-Control-Allow-Headers': 'Content-Type, Authorization',
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
define: {
|
|
51
|
-
__DEV__: mode === 'development',
|
|
52
|
-
},
|
|
53
|
-
}
|
|
54
|
-
})
|
|
File without changes
|