exodeui 6.3.6 → 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 +3639 -3566
- package/dist/src/ExodeUICanvas.d.ts +24 -25
- 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 +43 -2
- package/package.json +1 -1
|
@@ -1,38 +1,33 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ExodeUIEngine } from './engine';
|
|
3
|
-
import { Artboard, Fit, Alignment, ComponentEvent
|
|
3
|
+
import { Artboard, Fit, Alignment, ComponentEvent } from './types';
|
|
4
4
|
|
|
5
5
|
export interface ExodeUICanvasProps {
|
|
6
6
|
artboard?: Artboard;
|
|
7
7
|
src?: string;
|
|
8
|
-
className?: string;
|
|
9
|
-
style?: React.CSSProperties;
|
|
10
|
-
autoPlay?: boolean;
|
|
11
|
-
fit?: Fit;
|
|
12
|
-
alignment?: Alignment;
|
|
13
|
-
enableSEO?: boolean;
|
|
14
|
-
seo?: SEOConfig;
|
|
15
8
|
onReady?: (engine: ExodeUIEngine) => void;
|
|
16
|
-
onTrigger?: (
|
|
17
|
-
onInputUpdate?: (
|
|
9
|
+
onTrigger?: (triggerId: string, metadata?: any) => void;
|
|
10
|
+
onInputUpdate?: (inputs: Record<string, any>) => void;
|
|
18
11
|
onComponentChange?: (event: ComponentEvent) => void;
|
|
19
|
-
onToggle?: (
|
|
20
|
-
onInputChange?: (
|
|
21
|
-
onInputFocus?: (
|
|
22
|
-
onInputBlur?: (
|
|
23
|
-
onLog?: (
|
|
24
|
-
onLogicUpdate?: (
|
|
25
|
-
onButtonClick?: (
|
|
26
|
-
onGraphPointClick?: (
|
|
27
|
-
objectId: string;
|
|
28
|
-
componentName: string;
|
|
29
|
-
datasetIndex: number;
|
|
30
|
-
pointIndex: number;
|
|
31
|
-
value: number;
|
|
32
|
-
label: string;
|
|
33
|
-
}) => void;
|
|
12
|
+
onToggle?: (id: string, active: boolean) => void;
|
|
13
|
+
onInputChange?: (id: string, value: string) => void;
|
|
14
|
+
onInputFocus?: (id: string) => void;
|
|
15
|
+
onInputBlur?: (id: string) => void;
|
|
16
|
+
onLog?: (message: string, level: 'info' | 'warn' | 'error') => void;
|
|
17
|
+
onLogicUpdate?: (state: any) => void;
|
|
18
|
+
onButtonClick?: (id: string) => void;
|
|
19
|
+
onGraphPointClick?: (graphId: string, point: any) => void;
|
|
34
20
|
currentTime?: number;
|
|
35
21
|
revision?: number;
|
|
22
|
+
fit?: Fit;
|
|
23
|
+
alignment?: Alignment;
|
|
24
|
+
style?: React.CSSProperties;
|
|
25
|
+
autoPlay?: boolean;
|
|
26
|
+
enableSEO?: boolean;
|
|
27
|
+
seo?: {
|
|
28
|
+
title?: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
};
|
|
36
31
|
scrollY?: number;
|
|
37
32
|
scrollX?: number;
|
|
38
33
|
mouseX?: number;
|
|
@@ -40,5 +35,9 @@ export interface ExodeUICanvasProps {
|
|
|
40
35
|
isMouseDown?: boolean;
|
|
41
36
|
inputs?: Record<string, any>;
|
|
42
37
|
interactive?: boolean;
|
|
38
|
+
onNavigation?: (target: {
|
|
39
|
+
type: 'artboard' | 'url';
|
|
40
|
+
value: string;
|
|
41
|
+
}) => void;
|
|
43
42
|
}
|
|
44
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
|
@@ -51,6 +51,21 @@ export interface Shadow {
|
|
|
51
51
|
export interface Blur {
|
|
52
52
|
amount: number;
|
|
53
53
|
}
|
|
54
|
+
export interface RepeaterConfig {
|
|
55
|
+
isEnabled: boolean;
|
|
56
|
+
type: 'Linear' | 'Grid' | 'Radial';
|
|
57
|
+
count: number;
|
|
58
|
+
offsetX?: number;
|
|
59
|
+
offsetY?: number;
|
|
60
|
+
rotation?: number;
|
|
61
|
+
scale?: number;
|
|
62
|
+
cols?: number;
|
|
63
|
+
gapX?: number;
|
|
64
|
+
gapY?: number;
|
|
65
|
+
radius?: number;
|
|
66
|
+
startAngle?: number;
|
|
67
|
+
endAngle?: number;
|
|
68
|
+
}
|
|
54
69
|
export interface DesignTokens {
|
|
55
70
|
colors: Record<string, string>;
|
|
56
71
|
typography: Record<string, {
|
|
@@ -426,13 +441,23 @@ export interface Trigger {
|
|
|
426
441
|
}
|
|
427
442
|
export interface Interaction {
|
|
428
443
|
id: string;
|
|
429
|
-
event: 'onClick' | 'onHold' | 'pointerDown' | 'pointerUp' | 'hover';
|
|
430
|
-
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;
|
|
431
446
|
targetInputId?: string;
|
|
432
447
|
targetProperty?: string;
|
|
433
448
|
targetObjectId?: string;
|
|
449
|
+
targetArtboard?: string;
|
|
450
|
+
targetState?: string;
|
|
451
|
+
navigateUrl?: string;
|
|
434
452
|
value?: any;
|
|
453
|
+
targetAnimationId?: string;
|
|
454
|
+
subAnimationIds?: string[];
|
|
455
|
+
playMode?: 'single' | 'all' | 'custom';
|
|
456
|
+
triggers?: string[];
|
|
457
|
+
triggerLogic?: 'OR' | 'AND';
|
|
435
458
|
conditions?: Condition[];
|
|
459
|
+
delayValue?: number;
|
|
460
|
+
intervalValue?: number;
|
|
436
461
|
}
|
|
437
462
|
export interface Physics {
|
|
438
463
|
enabled: boolean;
|
|
@@ -510,6 +535,7 @@ export interface ShapeObject {
|
|
|
510
535
|
autoLayout?: AutoLayoutConfig;
|
|
511
536
|
layoutProps?: LayoutProps;
|
|
512
537
|
altText?: string;
|
|
538
|
+
repeaterConfig?: RepeaterConfig;
|
|
513
539
|
}
|
|
514
540
|
export interface Keyframe {
|
|
515
541
|
time: number;
|
|
@@ -521,11 +547,24 @@ export interface Track {
|
|
|
521
547
|
property: string;
|
|
522
548
|
keyframes: Keyframe[];
|
|
523
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
|
+
}
|
|
524
562
|
export interface Animation {
|
|
525
563
|
id: string;
|
|
526
564
|
name: string;
|
|
527
565
|
duration: number;
|
|
528
566
|
tracks: Track[];
|
|
567
|
+
playInstances?: PlayInstance[];
|
|
529
568
|
}
|
|
530
569
|
export declare enum ConditionOp {
|
|
531
570
|
Equal = "Equal",
|
|
@@ -707,6 +746,8 @@ export interface Artboard {
|
|
|
707
746
|
autoLayout?: AutoLayoutConfig;
|
|
708
747
|
layoutProps?: LayoutProps;
|
|
709
748
|
seo?: SEOConfig;
|
|
749
|
+
startupAnimationId?: string;
|
|
750
|
+
startupSubAnimationIds?: string[];
|
|
710
751
|
lastModified?: number;
|
|
711
752
|
}
|
|
712
753
|
export type Fit = 'Cover' | 'Contain' | 'Fill' | 'FitWidth' | 'FitHeight' | 'None' | 'ScaleDown';
|