exodeui 6.3.7 → 6.3.8
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/dist/index.js +33 -33
- package/dist/index.mjs +1567 -1453
- package/dist/src/ExodeUICanvas.d.ts +8 -4
- package/dist/src/__tests__/interaction_flows.test.d.ts +1 -0
- package/dist/src/engine.d.ts +13 -1
- package/dist/src/types.d.ts +27 -2
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ExodeUIEngine } from './engine';
|
|
3
|
-
import { Artboard } from './types';
|
|
3
|
+
import { Artboard, Fit, Alignment, ComponentEvent } from './types';
|
|
4
4
|
|
|
5
5
|
export interface ExodeUICanvasProps {
|
|
6
6
|
artboard?: Artboard;
|
|
@@ -8,7 +8,7 @@ export interface ExodeUICanvasProps {
|
|
|
8
8
|
onReady?: (engine: ExodeUIEngine) => void;
|
|
9
9
|
onTrigger?: (triggerId: string, metadata?: any) => void;
|
|
10
10
|
onInputUpdate?: (inputs: Record<string, any>) => void;
|
|
11
|
-
onComponentChange?: (
|
|
11
|
+
onComponentChange?: (event: ComponentEvent) => void;
|
|
12
12
|
onToggle?: (id: string, active: boolean) => void;
|
|
13
13
|
onInputChange?: (id: string, value: string) => void;
|
|
14
14
|
onInputFocus?: (id: string) => void;
|
|
@@ -19,8 +19,8 @@ export interface ExodeUICanvasProps {
|
|
|
19
19
|
onGraphPointClick?: (graphId: string, point: any) => void;
|
|
20
20
|
currentTime?: number;
|
|
21
21
|
revision?: number;
|
|
22
|
-
fit?:
|
|
23
|
-
alignment?:
|
|
22
|
+
fit?: Fit;
|
|
23
|
+
alignment?: Alignment;
|
|
24
24
|
style?: React.CSSProperties;
|
|
25
25
|
autoPlay?: boolean;
|
|
26
26
|
enableSEO?: boolean;
|
|
@@ -35,5 +35,9 @@ export interface ExodeUICanvasProps {
|
|
|
35
35
|
isMouseDown?: boolean;
|
|
36
36
|
inputs?: Record<string, any>;
|
|
37
37
|
interactive?: boolean;
|
|
38
|
+
onNavigation?: (target: {
|
|
39
|
+
type: 'artboard' | 'url';
|
|
40
|
+
value: string;
|
|
41
|
+
}) => void;
|
|
38
42
|
}
|
|
39
43
|
export declare const ExodeUICanvas: React.ForwardRefExoticComponent<ExodeUICanvasProps & React.RefAttributes<HTMLCanvasElement>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/src/engine.d.ts
CHANGED
|
@@ -55,6 +55,10 @@ export declare class ExodeUIEngine {
|
|
|
55
55
|
private logicNodeState;
|
|
56
56
|
private pointerDownTimes;
|
|
57
57
|
private activeHoverIds;
|
|
58
|
+
private onNavigation?;
|
|
59
|
+
private periodicTriggerTimes;
|
|
60
|
+
private wasInView;
|
|
61
|
+
private scrollProgressLastValue;
|
|
58
62
|
setTriggerCallback(cb: (triggerName: string, animationName: string) => void): void;
|
|
59
63
|
setInputUpdateCallback(cb: (nameOrId: string, value: any) => void): void;
|
|
60
64
|
setComponentChangeCallback(cb: (event: ComponentEvent) => void): void;
|
|
@@ -70,6 +74,10 @@ export declare class ExodeUIEngine {
|
|
|
70
74
|
value: number;
|
|
71
75
|
label: string;
|
|
72
76
|
}) => void): void;
|
|
77
|
+
setNavigationCallback(cb: (target: {
|
|
78
|
+
type: 'artboard' | 'url';
|
|
79
|
+
value: string;
|
|
80
|
+
}) => void): void;
|
|
73
81
|
private ensurePathPoints;
|
|
74
82
|
private svgPathToPoints;
|
|
75
83
|
setOnLogCallback(cb: (msg: string) => void): void;
|
|
@@ -129,6 +137,7 @@ export declare class ExodeUIEngine {
|
|
|
129
137
|
private activeTriggers;
|
|
130
138
|
seek(time: number): void;
|
|
131
139
|
advance(dt: number): void;
|
|
140
|
+
private evaluateContinuousInteractions;
|
|
132
141
|
private solveConstraints;
|
|
133
142
|
private getGlobalTransform;
|
|
134
143
|
private globalToLocal;
|
|
@@ -140,10 +149,13 @@ export declare class ExodeUIEngine {
|
|
|
140
149
|
private handlePointerEvent;
|
|
141
150
|
handleKeyDown(e: KeyboardEvent): void;
|
|
142
151
|
private fireEventForObject;
|
|
152
|
+
private initGlobalAnimationTriggers;
|
|
153
|
+
private triggerGlobalAnimation;
|
|
154
|
+
private handleAnimationFinished;
|
|
143
155
|
private getWorldTransform;
|
|
144
156
|
private hitTest;
|
|
145
157
|
private updateSliderValueFromPointer;
|
|
146
|
-
applyAnimation(anim: SDKAnimation, time: number, filterObjectId?: string): void;
|
|
158
|
+
applyAnimation(anim: SDKAnimation, time: number, filterObjectId?: string | string[]): void;
|
|
147
159
|
private interpolate;
|
|
148
160
|
private interpolateColor;
|
|
149
161
|
private interpolateStops;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -441,13 +441,23 @@ export interface Trigger {
|
|
|
441
441
|
}
|
|
442
442
|
export interface Interaction {
|
|
443
443
|
id: string;
|
|
444
|
-
event: 'onClick' | 'onHold' | 'pointerDown' | 'pointerUp' | 'hover';
|
|
445
|
-
action: 'setInput' | 'fireTrigger' | 'setProperty';
|
|
444
|
+
event: 'onClick' | 'onHold' | 'pointerDown' | 'pointerUp' | 'hover' | string;
|
|
445
|
+
action: 'setInput' | 'fireTrigger' | 'setProperty' | 'Navigate Artboard' | 'Navigate URL' | 'navigate' | 'Play Animation' | 'Stop Animation' | 'Pause Animation' | 'Switch to State' | 'Toggle Boolean' | string;
|
|
446
446
|
targetInputId?: string;
|
|
447
447
|
targetProperty?: string;
|
|
448
448
|
targetObjectId?: string;
|
|
449
|
+
targetArtboard?: string;
|
|
450
|
+
targetState?: string;
|
|
451
|
+
navigateUrl?: string;
|
|
449
452
|
value?: any;
|
|
453
|
+
targetAnimationId?: string;
|
|
454
|
+
subAnimationIds?: string[];
|
|
455
|
+
playMode?: 'single' | 'all' | 'custom';
|
|
456
|
+
triggers?: string[];
|
|
457
|
+
triggerLogic?: 'OR' | 'AND';
|
|
450
458
|
conditions?: Condition[];
|
|
459
|
+
delayValue?: number;
|
|
460
|
+
intervalValue?: number;
|
|
451
461
|
}
|
|
452
462
|
export interface Physics {
|
|
453
463
|
enabled: boolean;
|
|
@@ -537,11 +547,24 @@ export interface Track {
|
|
|
537
547
|
property: string;
|
|
538
548
|
keyframes: Keyframe[];
|
|
539
549
|
}
|
|
550
|
+
export interface PlayInstance {
|
|
551
|
+
id: string;
|
|
552
|
+
trigger: 'on_load' | 'after_delay' | 'after_anim' | 'on_scroll' | 'manual';
|
|
553
|
+
delay?: number;
|
|
554
|
+
afterAnim?: string;
|
|
555
|
+
conditions?: {
|
|
556
|
+
variable: string;
|
|
557
|
+
operator: string;
|
|
558
|
+
value: any;
|
|
559
|
+
}[];
|
|
560
|
+
subAnimationIds?: string[];
|
|
561
|
+
}
|
|
540
562
|
export interface Animation {
|
|
541
563
|
id: string;
|
|
542
564
|
name: string;
|
|
543
565
|
duration: number;
|
|
544
566
|
tracks: Track[];
|
|
567
|
+
playInstances?: PlayInstance[];
|
|
545
568
|
}
|
|
546
569
|
export declare enum ConditionOp {
|
|
547
570
|
Equal = "Equal",
|
|
@@ -723,6 +746,8 @@ export interface Artboard {
|
|
|
723
746
|
autoLayout?: AutoLayoutConfig;
|
|
724
747
|
layoutProps?: LayoutProps;
|
|
725
748
|
seo?: SEOConfig;
|
|
749
|
+
startupAnimationId?: string;
|
|
750
|
+
startupSubAnimationIds?: string[];
|
|
726
751
|
lastModified?: number;
|
|
727
752
|
}
|
|
728
753
|
export type Fit = 'Cover' | 'Contain' | 'Fill' | 'FitWidth' | 'FitHeight' | 'None' | 'ScaleDown';
|