@wave3d/core 0.1.0 → 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/README.md +7 -1
- package/dist/index.d.ts +2 -2
- package/dist/renderer/WaveRenderer.d.ts +3 -3
- package/dist/renderer/WaveRenderer.js +21 -10
- package/dist/renderer/WaveRenderer.js.map +1 -1
- package/dist/shell/createWave.d.ts +16 -1
- package/dist/shell/createWave.js +5 -0
- package/dist/shell/createWave.js.map +1 -1
- package/dist/standalone/wave3d.standalone.js +618 -633
- package/dist/standalone.d.ts +2 -2
- package/dist/standalone.js.map +1 -1
- package/package.json +1 -1
- package/skills/wave3d/SKILL.md +7 -4
package/dist/standalone.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BackgroundImageFit, BackgroundMode, BasicGradientType, BlendMode, ColorStop, DEFAULT_LIGHT_POSITION, GradientType, LightConfig, MAX_COLORS, MAX_LIGHTS, MAX_MESH_POINTS, MAX_NOISE_BANDS, MAX_WAVES, MeshGradientPoint, NoiseBand, PaletteSource, SceneConfig, StudioConfig, Vec2, Vec3, WaveConfig, createDefaultConfig, createDefaultMeshPoints, createLight, createNoiseBand, ensureCamera, ensureSceneDefaults, ensureStudioConfig, makeStops, makeWave, makeWaveSpread, normalizeBackground, normalizeWave, resizeWaves } from "./config/model.js";
|
|
2
2
|
import { WaveRenderer } from "./renderer/WaveRenderer.js";
|
|
3
|
-
import { FallbackReason, WaveHandle, WaveOptions, WaveState } from "./shell/createWave.js";
|
|
3
|
+
import { FallbackReason, SnapshotOptions, WaveHandle, WaveOptions, WaveState } from "./shell/createWave.js";
|
|
4
4
|
import { PRESETS } from "./presets.js";
|
|
5
5
|
|
|
6
6
|
//#region src/standalone.d.ts
|
|
@@ -9,5 +9,5 @@ declare function createWave(container: HTMLElement, config?: Partial<StudioConfi
|
|
|
9
9
|
/** The drop-in embed contract: an alias of {@link createWave}. */
|
|
10
10
|
declare const mountWave: typeof createWave;
|
|
11
11
|
//#endregion
|
|
12
|
-
export { BackgroundImageFit, BackgroundMode, BasicGradientType, BlendMode, ColorStop, DEFAULT_LIGHT_POSITION, type FallbackReason, GradientType, LightConfig, MAX_COLORS, MAX_LIGHTS, MAX_MESH_POINTS, MAX_NOISE_BANDS, MAX_WAVES, MeshGradientPoint, NoiseBand, PRESETS, PaletteSource, SceneConfig, StudioConfig, Vec2, Vec3, WaveConfig, type WaveHandle, type WaveOptions, WaveRenderer, type WaveState, createDefaultConfig, createDefaultMeshPoints, createLight, createNoiseBand, createWave, ensureCamera, ensureSceneDefaults, ensureStudioConfig, makeStops, makeWave, makeWaveSpread, mountWave, normalizeBackground, normalizeWave, resizeWaves };
|
|
12
|
+
export { BackgroundImageFit, BackgroundMode, BasicGradientType, BlendMode, ColorStop, DEFAULT_LIGHT_POSITION, type FallbackReason, GradientType, LightConfig, MAX_COLORS, MAX_LIGHTS, MAX_MESH_POINTS, MAX_NOISE_BANDS, MAX_WAVES, MeshGradientPoint, NoiseBand, PRESETS, PaletteSource, SceneConfig, type SnapshotOptions, StudioConfig, Vec2, Vec3, WaveConfig, type WaveHandle, type WaveOptions, WaveRenderer, type WaveState, createDefaultConfig, createDefaultMeshPoints, createLight, createNoiseBand, createWave, ensureCamera, ensureSceneDefaults, ensureStudioConfig, makeStops, makeWave, makeWaveSpread, mountWave, normalizeBackground, normalizeWave, resizeWaves };
|
|
13
13
|
//# sourceMappingURL=standalone.d.ts.map
|
package/dist/standalone.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standalone.js","names":["core"],"sources":["../src/standalone.ts"],"sourcesContent":["// The single-file CDN / standalone build entry. Unlike the `.` shell — which fetches the engine on\n// demand — this statically imports the engine (three bundled in) and pre-binds createWave/mountWave\n// with a synchronous loadCore, so a plain <script type=\"module\"> from a CDN upgrades with no extra\n// network round-trip. This is also the runtime the studio inlines into its exported embed HTML.\nimport * as core from \"./core-loader\";\nimport { createWaveImpl } from \"./shell/createWave\";\nimport type { WaveOptions, WaveHandle } from \"./shell/createWave\";\nimport type { StudioConfig } from \"./config/model\";\n\n// Synchronous core — the engine is already bundled into this file, so there is no dynamic import\n// (which is exactly why the standalone stays a single file: createWaveImpl never references the\n// public createWave's `import(\"./core-loader\")` default).\nconst loadCore = (): Promise<typeof core> => Promise.resolve(core);\n\n/** {@link createWaveImpl} with the engine already bundled in (synchronous upgrade). */\nexport function createWave(\n container: HTMLElement,\n config: Partial<StudioConfig> = {},\n options: WaveOptions = {},\n): WaveHandle {\n return createWaveImpl(loadCore, container, config, options);\n}\n\n/** The drop-in embed contract: an alias of {@link createWave}. */\nexport const mountWave = createWave;\n\n// CDN users get the raw engine, presets, and full model directly too.\nexport { WaveRenderer } from \"./renderer/WaveRenderer\";\nexport { PRESETS } from \"./presets\";\nexport * from \"./config/model\";\nexport type {
|
|
1
|
+
{"version":3,"file":"standalone.js","names":["core"],"sources":["../src/standalone.ts"],"sourcesContent":["// The single-file CDN / standalone build entry. Unlike the `.` shell — which fetches the engine on\n// demand — this statically imports the engine (three bundled in) and pre-binds createWave/mountWave\n// with a synchronous loadCore, so a plain <script type=\"module\"> from a CDN upgrades with no extra\n// network round-trip. This is also the runtime the studio inlines into its exported embed HTML.\nimport * as core from \"./core-loader\";\nimport { createWaveImpl } from \"./shell/createWave\";\nimport type { WaveOptions, WaveHandle } from \"./shell/createWave\";\nimport type { StudioConfig } from \"./config/model\";\n\n// Synchronous core — the engine is already bundled into this file, so there is no dynamic import\n// (which is exactly why the standalone stays a single file: createWaveImpl never references the\n// public createWave's `import(\"./core-loader\")` default).\nconst loadCore = (): Promise<typeof core> => Promise.resolve(core);\n\n/** {@link createWaveImpl} with the engine already bundled in (synchronous upgrade). */\nexport function createWave(\n container: HTMLElement,\n config: Partial<StudioConfig> = {},\n options: WaveOptions = {},\n): WaveHandle {\n return createWaveImpl(loadCore, container, config, options);\n}\n\n/** The drop-in embed contract: an alias of {@link createWave}. */\nexport const mountWave = createWave;\n\n// CDN users get the raw engine, presets, and full model directly too.\nexport { WaveRenderer } from \"./renderer/WaveRenderer\";\nexport { PRESETS } from \"./presets\";\nexport * from \"./config/model\";\nexport type {\n WaveOptions,\n WaveHandle,\n WaveState,\n FallbackReason,\n SnapshotOptions,\n} from \"./shell/createWave\";\n"],"mappings":";;;;;;AAYA,MAAM,iBAAuC,QAAQ,QAAQA,mBAAI;;AAGjE,SAAgB,WACd,WACA,SAAgC,CAAC,GACjC,UAAuB,CAAC,GACZ;CACZ,OAAO,eAAe,UAAU,WAAW,QAAQ,OAAO;AAC5D;;AAGA,MAAa,YAAY"}
|
package/package.json
CHANGED
package/skills/wave3d/SKILL.md
CHANGED
|
@@ -33,9 +33,9 @@ load**. Framework-agnostic core, with React and web-component adapters.
|
|
|
33
33
|
## Install
|
|
34
34
|
|
|
35
35
|
```sh
|
|
36
|
-
pnpm add @wave3d/react
|
|
37
|
-
pnpm add @wave3d/element
|
|
38
|
-
pnpm add @wave3d/core three
|
|
36
|
+
pnpm add @wave3d/react three # React
|
|
37
|
+
pnpm add @wave3d/element three # <wave-3d> for Vue / Svelte / plain HTML
|
|
38
|
+
pnpm add @wave3d/core three # framework-agnostic createWave
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
`three` is a **peer dependency** of `@wave3d/core` (`>=0.180 <1`). For TypeScript, also add
|
|
@@ -125,7 +125,10 @@ The shell shows a poster immediately, then crossfades to the live wave.
|
|
|
125
125
|
|
|
126
126
|
- **Poster source:** the `poster` option/prop (URL or data-URI), or — for SSR — an
|
|
127
127
|
`<img data-wave3d-poster>` you render inside the container; the shell **adopts** it (no hydration
|
|
128
|
-
flash). React: pass it as a child.
|
|
128
|
+
flash). React: pass it as a child.
|
|
129
|
+
- **Make a poster:** the studio's Export dialog, or capture the live frame at runtime — once
|
|
130
|
+
running, `handle.snapshot()` (core/element) or `onReady(renderer)` → `renderer.captureImage()`
|
|
131
|
+
(React) resolves an image Blob you can host and feed back as the `poster`.
|
|
129
132
|
- **`onFallback(reason)`** fires when the shell keeps the poster instead of upgrading; reasons:
|
|
130
133
|
`"no-webgl" | "reduced-motion" | "save-data" | "context-lost" | "load-error"`.
|
|
131
134
|
- **`onStateChange(state)`**: `"poster" → "loading" → "running"`, or `"fallback"`.
|