@uxpilot/openai-astra-shape-cue 1.0.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/LICENSE.md +39 -0
- package/README.md +126 -0
- package/SETTINGS.md +260 -0
- package/THIRD_PARTY_NOTICES.md +53 -0
- package/dist/astra.min.js +4876 -0
- package/dist/index.d.ts +92 -0
- package/dist/index.js +4876 -0
- package/dist/panel.css +178 -0
- package/dist/react.d.ts +27 -0
- package/dist/react.js +50 -0
- package/dist/settings.d.ts +188 -0
- package/examples/ReactHero.jsx +34 -0
- package/examples/customize.html +21 -0
- package/examples/index.html +25 -0
- package/examples/two-rings.svg +4 -0
- package/package.json +24 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export type BuiltinShape = "star" | "heart" | "infinity" | "hexagon" | "spiral";
|
|
2
|
+
import type { EngineConfig, EngineSettingValues } from './settings.js';
|
|
3
|
+
export type { EngineConfig, EngineSettingValues } from './settings.js';
|
|
4
|
+
export interface ScrollOptions {
|
|
5
|
+
/** Entry progress interval over which particles gather; default [0, .36]. */
|
|
6
|
+
gather?: [number, number];
|
|
7
|
+
/** Exit interval over which they disperse; default [.5, .86]. */
|
|
8
|
+
disperse?: [number, number];
|
|
9
|
+
}
|
|
10
|
+
export interface ParticleOptions {
|
|
11
|
+
density?: number;
|
|
12
|
+
size?: number;
|
|
13
|
+
intensity?: number;
|
|
14
|
+
scatter?: number;
|
|
15
|
+
twinkle?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface AnimationOptions {
|
|
18
|
+
/** Particle travel multiplier, 0–3. */
|
|
19
|
+
speed?: number;
|
|
20
|
+
/** Approximate gather settling duration in seconds, 1–10. */
|
|
21
|
+
duration?: number;
|
|
22
|
+
/** Pause/resume particle flow; pointer interactions remain available. */
|
|
23
|
+
playing?: boolean;
|
|
24
|
+
}
|
|
25
|
+
export type Shape = BuiltinShape | string | { id?: string; label?: string; width: number; height: number; paths: string[]; strokeWidth?: number };
|
|
26
|
+
export interface CueOptions {
|
|
27
|
+
shape?: Shape;
|
|
28
|
+
transform?: "scroll" | "load" | "off";
|
|
29
|
+
interaction?: "rotate" | "depth-lens" | "none";
|
|
30
|
+
autoRotate?: boolean;
|
|
31
|
+
ambient?: boolean;
|
|
32
|
+
parallax?: boolean;
|
|
33
|
+
holdAtEnd?: boolean;
|
|
34
|
+
palette?: "astra" | "aurora" | "ember";
|
|
35
|
+
background?: string;
|
|
36
|
+
padding?: number;
|
|
37
|
+
tier?: 0 | 1 | 2 | 3;
|
|
38
|
+
interactionLabel?: string;
|
|
39
|
+
/** 1–8 hex colors. null restores the named palette (Astra by default). */
|
|
40
|
+
colors?: string[] | null;
|
|
41
|
+
particles?: ParticleOptions;
|
|
42
|
+
animation?: AnimationOptions;
|
|
43
|
+
bloom?: number;
|
|
44
|
+
scroll?: ScrollOptions;
|
|
45
|
+
config?: EngineConfig;
|
|
46
|
+
}
|
|
47
|
+
export interface Cue {
|
|
48
|
+
readonly host: HTMLElement;
|
|
49
|
+
readonly status: "loading" | "ready" | "error";
|
|
50
|
+
setShape(shape: Shape): this;
|
|
51
|
+
/** Local SVG load with 2 MB limit and last-upload-wins semantics. */
|
|
52
|
+
loadSVG(source: File | Blob | string): Promise<this>;
|
|
53
|
+
getOptions(): CueOptions;
|
|
54
|
+
onChange(listener: (options: CueOptions) => void): () => void;
|
|
55
|
+
/** 0 = entering viewport; 1 = exited; null = follow window scroll again. */
|
|
56
|
+
setScrollProgress(progress: number | null): this;
|
|
57
|
+
/** Apply a partial update. Omitted settings retain their current value. */
|
|
58
|
+
update(options: CueOptions): this;
|
|
59
|
+
setColors(colors: string[] | null): this;
|
|
60
|
+
pause(): this;
|
|
61
|
+
play(): this;
|
|
62
|
+
setTransform(mode: "scroll" | "load" | "off"): this;
|
|
63
|
+
setPalette(palette: "astra" | "aurora" | "ember"): this;
|
|
64
|
+
setBackground(color: string): this;
|
|
65
|
+
setAmbient(enabled: boolean): this;
|
|
66
|
+
set<K extends keyof EngineSettingValues>(path: K, value: EngineSettingValues[K]): this;
|
|
67
|
+
rotate(dx: number, dy: number): this;
|
|
68
|
+
replay(): this;
|
|
69
|
+
rebuild(): this;
|
|
70
|
+
invalidate(): void;
|
|
71
|
+
dispose(): void;
|
|
72
|
+
}
|
|
73
|
+
/** Register <astra-shape-cue>. Call only in a browser. */
|
|
74
|
+
export function registerShapeCue(): void;
|
|
75
|
+
/** Create a cue on an empty, dedicated element with explicit dimensions. */
|
|
76
|
+
export function createShapeCue(host: HTMLElement, options?: CueOptions): Cue;
|
|
77
|
+
/** Mount the optional settings panel. Load @uxpilot/openai-astra-shape-cue/panel.css. */
|
|
78
|
+
export function mountControls(cue: Cue, host: HTMLElement): () => void;
|
|
79
|
+
export interface ControlDefinition {
|
|
80
|
+
key: string;
|
|
81
|
+
label: string;
|
|
82
|
+
kind: 'range' | 'checkbox' | 'select';
|
|
83
|
+
optionPath: string;
|
|
84
|
+
defaultValue: unknown;
|
|
85
|
+
min?: number;
|
|
86
|
+
max?: number;
|
|
87
|
+
step?: number;
|
|
88
|
+
choices?: string[];
|
|
89
|
+
}
|
|
90
|
+
/** One definition for each engine setting displayed in the stock panel. */
|
|
91
|
+
export function getControlDefinitions(): ControlDefinition[];
|
|
92
|
+
export const version: string;
|