visualfries 0.1.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 +21 -0
- package/README.md +213 -0
- package/dist/DIContainer.d.ts +4 -0
- package/dist/DIContainer.js +145 -0
- package/dist/SceneBuilder.svelte.d.ts +8574 -0
- package/dist/SceneBuilder.svelte.js +409 -0
- package/dist/adapters/subtitleHelpers.d.ts +2 -0
- package/dist/adapters/subtitleHelpers.js +187 -0
- package/dist/animations/AnimationContext.d.ts +17 -0
- package/dist/animations/AnimationContext.js +72 -0
- package/dist/animations/AnimationPresetsRegister.d.ts +362 -0
- package/dist/animations/AnimationPresetsRegister.js +20 -0
- package/dist/animations/AnimationSetup.d.ts +8 -0
- package/dist/animations/AnimationSetup.js +30 -0
- package/dist/animations/SplitTextCache.d.ts +28 -0
- package/dist/animations/SplitTextCache.js +68 -0
- package/dist/animations/animationBuilder.d.ts +31 -0
- package/dist/animations/animationBuilder.js +255 -0
- package/dist/animations/animationPreset.d.ts +7 -0
- package/dist/animations/animationPreset.js +31 -0
- package/dist/animations/builders/AnimationPresetFactory.d.ts +43 -0
- package/dist/animations/builders/AnimationPresetFactory.js +139 -0
- package/dist/animations/builders/LineHighlighterAnimationBuilder.d.ts +16 -0
- package/dist/animations/builders/LineHighlighterAnimationBuilder.js +183 -0
- package/dist/animations/builders/WordHighlighterAnimationBuilder.d.ts +15 -0
- package/dist/animations/builders/WordHighlighterAnimationBuilder.js +180 -0
- package/dist/animations/engines/AnimationEngineAdaptor.d.ts +107 -0
- package/dist/animations/engines/AnimationEngineAdaptor.js +1 -0
- package/dist/animations/engines/GSAPEngineAdaptor.d.ts +21 -0
- package/dist/animations/engines/GSAPEngineAdaptor.js +145 -0
- package/dist/animations/presets/index.d.ts +2 -0
- package/dist/animations/presets/index.js +3 -0
- package/dist/animations/presets/lines.d.ts +52 -0
- package/dist/animations/presets/lines.js +547 -0
- package/dist/animations/presets/words.d.ts +31 -0
- package/dist/animations/presets/words.js +268 -0
- package/dist/animations/transformers/AnimationReferenceTransformer.d.ts +9 -0
- package/dist/animations/transformers/AnimationReferenceTransformer.js +114 -0
- package/dist/builders/PixiComponentBuilder.d.ts +63 -0
- package/dist/builders/PixiComponentBuilder.js +112 -0
- package/dist/builders/_ComponentState.svelte.d.ts +795 -0
- package/dist/builders/_ComponentState.svelte.js +203 -0
- package/dist/builders/html/HtmlBuilder.d.ts +66 -0
- package/dist/builders/html/HtmlBuilder.js +171 -0
- package/dist/builders/html/HtmlBuilderFactory.d.ts +27 -0
- package/dist/builders/html/HtmlBuilderFactory.js +30 -0
- package/dist/builders/html/StyleBuilder.d.ts +13 -0
- package/dist/builders/html/StyleBuilder.js +133 -0
- package/dist/builders/html/StyleProcessor.d.ts +9 -0
- package/dist/builders/html/StyleProcessor.js +1 -0
- package/dist/builders/html/TextComponentHtmlBuilder.d.ts +16 -0
- package/dist/builders/html/TextComponentHtmlBuilder.js +93 -0
- package/dist/builders/html/TextShadowBuilder.d.ts +60 -0
- package/dist/builders/html/TextShadowBuilder.js +227 -0
- package/dist/builders/html/processors/AppearanceStyleProcessor.d.ts +5 -0
- package/dist/builders/html/processors/AppearanceStyleProcessor.js +57 -0
- package/dist/builders/html/processors/TextAppearanceStyleProcessor.d.ts +5 -0
- package/dist/builders/html/processors/TextAppearanceStyleProcessor.js +37 -0
- package/dist/builders/html/processors/TextEffectsStyleProcessor.d.ts +6 -0
- package/dist/builders/html/processors/TextEffectsStyleProcessor.js +68 -0
- package/dist/commands/Command.d.ts +6 -0
- package/dist/commands/Command.js +1 -0
- package/dist/commands/CommandRunner.d.ts +28 -0
- package/dist/commands/CommandRunner.js +81 -0
- package/dist/commands/CommandTypes.d.ts +11 -0
- package/dist/commands/CommandTypes.js +13 -0
- package/dist/commands/PauseCommand.d.ts +4 -0
- package/dist/commands/PauseCommand.js +5 -0
- package/dist/commands/PlayCommand.d.ts +4 -0
- package/dist/commands/PlayCommand.js +6 -0
- package/dist/commands/RenderCommand.d.ts +15 -0
- package/dist/commands/RenderCommand.js +18 -0
- package/dist/commands/RenderFrameCommand.d.ts +17 -0
- package/dist/commands/RenderFrameCommand.js +93 -0
- package/dist/commands/ReplaceSourceOnTimeCommand.d.ts +4 -0
- package/dist/commands/ReplaceSourceOnTimeCommand.js +22 -0
- package/dist/commands/SeekCommand.d.ts +15 -0
- package/dist/commands/SeekCommand.js +39 -0
- package/dist/commands/UpdateComponentCommand.d.ts +4 -0
- package/dist/commands/UpdateComponentCommand.js +17 -0
- package/dist/components/AnimatedGIF.d.ts +201 -0
- package/dist/components/AnimatedGIF.js +391 -0
- package/dist/components/Component.svelte.d.ts +33 -0
- package/dist/components/Component.svelte.js +152 -0
- package/dist/components/ComponentContext.svelte.d.ts +33 -0
- package/dist/components/ComponentContext.svelte.js +105 -0
- package/dist/components/hooks/AnimationHook.d.ts +25 -0
- package/dist/components/hooks/AnimationHook.js +180 -0
- package/dist/components/hooks/CanvasShapeHook.d.ts +12 -0
- package/dist/components/hooks/CanvasShapeHook.js +229 -0
- package/dist/components/hooks/HtmlAnimationHook.d.ts +8 -0
- package/dist/components/hooks/HtmlAnimationHook.js +70 -0
- package/dist/components/hooks/HtmlTextHook.d.ts +16 -0
- package/dist/components/hooks/HtmlTextHook.js +102 -0
- package/dist/components/hooks/HtmlToCanvasHook.d.ts +16 -0
- package/dist/components/hooks/HtmlToCanvasHook.js +148 -0
- package/dist/components/hooks/ImageHook.d.ts +10 -0
- package/dist/components/hooks/ImageHook.js +45 -0
- package/dist/components/hooks/MediaHook.d.ts +15 -0
- package/dist/components/hooks/MediaHook.js +252 -0
- package/dist/components/hooks/MediaSeekingHook.d.ts +12 -0
- package/dist/components/hooks/MediaSeekingHook.js +204 -0
- package/dist/components/hooks/PixiDisplayObjectHook.d.ts +15 -0
- package/dist/components/hooks/PixiDisplayObjectHook.js +77 -0
- package/dist/components/hooks/PixiGifHook.d.ts +15 -0
- package/dist/components/hooks/PixiGifHook.js +97 -0
- package/dist/components/hooks/PixiProgressShapeHook.d.ts +12 -0
- package/dist/components/hooks/PixiProgressShapeHook.js +128 -0
- package/dist/components/hooks/PixiSplitScreenDisplayObjectHook.d.ts +21 -0
- package/dist/components/hooks/PixiSplitScreenDisplayObjectHook.js +210 -0
- package/dist/components/hooks/PixiTextureHook.d.ts +7 -0
- package/dist/components/hooks/PixiTextureHook.js +29 -0
- package/dist/components/hooks/PixiVideoTextureHook.d.ts +10 -0
- package/dist/components/hooks/PixiVideoTextureHook.js +35 -0
- package/dist/components/hooks/SubtitlesHook.d.ts +88 -0
- package/dist/components/hooks/SubtitlesHook.js +199 -0
- package/dist/components/hooks/VerifyGifHook.d.ts +7 -0
- package/dist/components/hooks/VerifyGifHook.js +27 -0
- package/dist/components/hooks/VerifyImageHook.d.ts +7 -0
- package/dist/components/hooks/VerifyImageHook.js +27 -0
- package/dist/components/hooks/VerifyMediaHook.d.ts +7 -0
- package/dist/components/hooks/VerifyMediaHook.js +21 -0
- package/dist/components/hooks/shapes/progress/CustomProgressRenderer.d.ts +8 -0
- package/dist/components/hooks/shapes/progress/CustomProgressRenderer.js +53 -0
- package/dist/components/hooks/shapes/progress/DoubleProgressRenderer.d.ts +8 -0
- package/dist/components/hooks/shapes/progress/DoubleProgressRenderer.js +69 -0
- package/dist/components/hooks/shapes/progress/LinearProgressRenderer.d.ts +8 -0
- package/dist/components/hooks/shapes/progress/LinearProgressRenderer.js +60 -0
- package/dist/components/hooks/shapes/progress/PerimeterProgressRenderer.d.ts +9 -0
- package/dist/components/hooks/shapes/progress/PerimeterProgressRenderer.js +213 -0
- package/dist/components/hooks/shapes/progress/ProgressRenderer.d.ts +17 -0
- package/dist/components/hooks/shapes/progress/ProgressRenderer.js +75 -0
- package/dist/components/hooks/shapes/progress/RadialProgressRenderer.d.ts +8 -0
- package/dist/components/hooks/shapes/progress/RadialProgressRenderer.js +50 -0
- package/dist/components/hooks/shapes/progress/index.d.ts +6 -0
- package/dist/components/hooks/shapes/progress/index.js +6 -0
- package/dist/composers/componentComposer.d.ts +55 -0
- package/dist/composers/componentComposer.js +118 -0
- package/dist/composers/layerComposer.d.ts +46 -0
- package/dist/composers/layerComposer.js +79 -0
- package/dist/composers/sceneComposer.d.ts +48 -0
- package/dist/composers/sceneComposer.js +92 -0
- package/dist/constants.d.ts +12 -0
- package/dist/constants.js +14 -0
- package/dist/directors/ComponentDirector.d.ts +20 -0
- package/dist/directors/ComponentDirector.js +86 -0
- package/dist/factories/SceneBuilderFactory.d.ts +15 -0
- package/dist/factories/SceneBuilderFactory.js +51 -0
- package/dist/fonts/GoogleFontsProvider.d.ts +12 -0
- package/dist/fonts/GoogleFontsProvider.js +125 -0
- package/dist/fonts/fontLoader.d.ts +15 -0
- package/dist/fonts/fontLoader.js +41 -0
- package/dist/fonts/types.d.ts +1 -0
- package/dist/fonts/types.js +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +14 -0
- package/dist/layers/Layer.svelte.d.ts +8492 -0
- package/dist/layers/Layer.svelte.js +125 -0
- package/dist/managers/AppManager.svelte.d.ts +23 -0
- package/dist/managers/AppManager.svelte.js +89 -0
- package/dist/managers/ComponentsManager.svelte.d.ts +49 -0
- package/dist/managers/ComponentsManager.svelte.js +247 -0
- package/dist/managers/DomManager.d.ts +18 -0
- package/dist/managers/DomManager.js +73 -0
- package/dist/managers/EventManager.d.ts +7 -0
- package/dist/managers/EventManager.js +22 -0
- package/dist/managers/LayersManager.svelte.d.ts +8499 -0
- package/dist/managers/LayersManager.svelte.js +176 -0
- package/dist/managers/MediaManager.d.ts +32 -0
- package/dist/managers/MediaManager.js +243 -0
- package/dist/managers/RenderManager.d.ts +23 -0
- package/dist/managers/RenderManager.js +59 -0
- package/dist/managers/StateManager.svelte.d.ts +8746 -0
- package/dist/managers/StateManager.svelte.js +272 -0
- package/dist/managers/SubtitlesManager.svelte.d.ts +261 -0
- package/dist/managers/SubtitlesManager.svelte.js +1385 -0
- package/dist/managers/TimeManager.svelte.d.ts +6 -0
- package/dist/managers/TimeManager.svelte.js +18 -0
- package/dist/managers/TimelineManager.svelte.d.ts +25 -0
- package/dist/managers/TimelineManager.svelte.js +152 -0
- package/dist/registers.d.ts +12 -0
- package/dist/registers.js +29 -0
- package/dist/schemas/runtime/index.d.ts +3 -0
- package/dist/schemas/runtime/index.js +4 -0
- package/dist/schemas/runtime/types.d.ts +323 -0
- package/dist/schemas/runtime/types.js +12 -0
- package/dist/schemas/scene/animations.d.ts +89738 -0
- package/dist/schemas/scene/animations.js +211 -0
- package/dist/schemas/scene/components.js +515 -0
- package/dist/schemas/scene/core.js +160 -0
- package/dist/schemas/scene/index.d.ts +22 -0
- package/dist/schemas/scene/index.js +10 -0
- package/dist/schemas/scene/properties.d.ts +914 -0
- package/dist/schemas/scene/properties.js +398 -0
- package/dist/schemas/scene/subtitles.d.ts +1141 -0
- package/dist/schemas/scene/subtitles.js +111 -0
- package/dist/schemas/scene/utils.d.ts +1 -0
- package/dist/schemas/scene/utils.js +5 -0
- package/dist/seeds/SeedFactory.d.ts +59 -0
- package/dist/seeds/SeedFactory.js +99 -0
- package/dist/seeds/index.d.ts +8 -0
- package/dist/seeds/index.js +8 -0
- package/dist/transformers/ColorTransformer.d.ts +5 -0
- package/dist/transformers/ColorTransformer.js +67 -0
- package/dist/transformers/PixiColorTransformer.d.ts +22 -0
- package/dist/transformers/PixiColorTransformer.js +104 -0
- package/dist/utils/canvas.d.ts +6 -0
- package/dist/utils/canvas.js +18 -0
- package/dist/utils/document.d.ts +2 -0
- package/dist/utils/document.js +36 -0
- package/dist/utils/emoji.d.ts +10 -0
- package/dist/utils/emoji.js +51 -0
- package/dist/utils/html.d.ts +4 -0
- package/dist/utils/html.js +45 -0
- package/dist/utils/svgGenerator.d.ts +20 -0
- package/dist/utils/svgGenerator.js +103 -0
- package/dist/utils/utils.d.ts +5 -0
- package/dist/utils/utils.js +125 -0
- package/package.json +96 -0
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import type { AnimationPreset } from "..";
|
|
2
|
+
export declare class AnimationPresetsRegister {
|
|
3
|
+
#private;
|
|
4
|
+
private presets;
|
|
5
|
+
constructor();
|
|
6
|
+
register(preset: AnimationPreset): void;
|
|
7
|
+
getPresets(): Map<string, {
|
|
8
|
+
id: string;
|
|
9
|
+
timeline: {
|
|
10
|
+
tweens: {
|
|
11
|
+
method: "set" | "to" | "from" | "fromTo";
|
|
12
|
+
vars: {
|
|
13
|
+
duration?: string | number | boolean | {
|
|
14
|
+
fromData: string;
|
|
15
|
+
mode: "cycle" | "useFallback" | "clamp";
|
|
16
|
+
fallbackValue?: any;
|
|
17
|
+
} | {
|
|
18
|
+
type: "byIndex";
|
|
19
|
+
expression: string;
|
|
20
|
+
fallbackValue?: any;
|
|
21
|
+
} | null | undefined;
|
|
22
|
+
from?: import("zod").objectOutputType<{
|
|
23
|
+
opacity: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean, import("zod").ZodNull, import("zod").ZodObject<{
|
|
24
|
+
fromData: import("zod").ZodString;
|
|
25
|
+
mode: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodEnum<["cycle", "useFallback", "clamp"]>>>;
|
|
26
|
+
fallbackValue: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
27
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
28
|
+
fromData: string;
|
|
29
|
+
mode: "cycle" | "useFallback" | "clamp";
|
|
30
|
+
fallbackValue?: any;
|
|
31
|
+
}, {
|
|
32
|
+
fromData: string;
|
|
33
|
+
mode?: "cycle" | "useFallback" | "clamp" | undefined;
|
|
34
|
+
fallbackValue?: any;
|
|
35
|
+
}>, import("zod").ZodObject<{
|
|
36
|
+
type: import("zod").ZodLiteral<"byIndex">;
|
|
37
|
+
expression: import("zod").ZodString;
|
|
38
|
+
fallbackValue: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
39
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
40
|
+
type: "byIndex";
|
|
41
|
+
expression: string;
|
|
42
|
+
fallbackValue?: any;
|
|
43
|
+
}, {
|
|
44
|
+
type: "byIndex";
|
|
45
|
+
expression: string;
|
|
46
|
+
fallbackValue?: any;
|
|
47
|
+
}>]>>;
|
|
48
|
+
x: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean, import("zod").ZodNull, import("zod").ZodObject<{
|
|
49
|
+
fromData: import("zod").ZodString;
|
|
50
|
+
mode: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodEnum<["cycle", "useFallback", "clamp"]>>>;
|
|
51
|
+
fallbackValue: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
52
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
53
|
+
fromData: string;
|
|
54
|
+
mode: "cycle" | "useFallback" | "clamp";
|
|
55
|
+
fallbackValue?: any;
|
|
56
|
+
}, {
|
|
57
|
+
fromData: string;
|
|
58
|
+
mode?: "cycle" | "useFallback" | "clamp" | undefined;
|
|
59
|
+
fallbackValue?: any;
|
|
60
|
+
}>, import("zod").ZodObject<{
|
|
61
|
+
type: import("zod").ZodLiteral<"byIndex">;
|
|
62
|
+
expression: import("zod").ZodString;
|
|
63
|
+
fallbackValue: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
64
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
65
|
+
type: "byIndex";
|
|
66
|
+
expression: string;
|
|
67
|
+
fallbackValue?: any;
|
|
68
|
+
}, {
|
|
69
|
+
type: "byIndex";
|
|
70
|
+
expression: string;
|
|
71
|
+
fallbackValue?: any;
|
|
72
|
+
}>]>>;
|
|
73
|
+
y: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean, import("zod").ZodNull, import("zod").ZodObject<{
|
|
74
|
+
fromData: import("zod").ZodString;
|
|
75
|
+
mode: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodEnum<["cycle", "useFallback", "clamp"]>>>;
|
|
76
|
+
fallbackValue: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
77
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
78
|
+
fromData: string;
|
|
79
|
+
mode: "cycle" | "useFallback" | "clamp";
|
|
80
|
+
fallbackValue?: any;
|
|
81
|
+
}, {
|
|
82
|
+
fromData: string;
|
|
83
|
+
mode?: "cycle" | "useFallback" | "clamp" | undefined;
|
|
84
|
+
fallbackValue?: any;
|
|
85
|
+
}>, import("zod").ZodObject<{
|
|
86
|
+
type: import("zod").ZodLiteral<"byIndex">;
|
|
87
|
+
expression: import("zod").ZodString;
|
|
88
|
+
fallbackValue: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
89
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
90
|
+
type: "byIndex";
|
|
91
|
+
expression: string;
|
|
92
|
+
fallbackValue?: any;
|
|
93
|
+
}, {
|
|
94
|
+
type: "byIndex";
|
|
95
|
+
expression: string;
|
|
96
|
+
fallbackValue?: any;
|
|
97
|
+
}>]>>;
|
|
98
|
+
scale: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean, import("zod").ZodNull, import("zod").ZodObject<{
|
|
99
|
+
fromData: import("zod").ZodString;
|
|
100
|
+
mode: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodEnum<["cycle", "useFallback", "clamp"]>>>;
|
|
101
|
+
fallbackValue: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
102
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
103
|
+
fromData: string;
|
|
104
|
+
mode: "cycle" | "useFallback" | "clamp";
|
|
105
|
+
fallbackValue?: any;
|
|
106
|
+
}, {
|
|
107
|
+
fromData: string;
|
|
108
|
+
mode?: "cycle" | "useFallback" | "clamp" | undefined;
|
|
109
|
+
fallbackValue?: any;
|
|
110
|
+
}>, import("zod").ZodObject<{
|
|
111
|
+
type: import("zod").ZodLiteral<"byIndex">;
|
|
112
|
+
expression: import("zod").ZodString;
|
|
113
|
+
fallbackValue: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
114
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
115
|
+
type: "byIndex";
|
|
116
|
+
expression: string;
|
|
117
|
+
fallbackValue?: any;
|
|
118
|
+
}, {
|
|
119
|
+
type: "byIndex";
|
|
120
|
+
expression: string;
|
|
121
|
+
fallbackValue?: any;
|
|
122
|
+
}>]>>;
|
|
123
|
+
scaleX: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean, import("zod").ZodNull, import("zod").ZodObject<{
|
|
124
|
+
fromData: import("zod").ZodString;
|
|
125
|
+
mode: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodEnum<["cycle", "useFallback", "clamp"]>>>;
|
|
126
|
+
fallbackValue: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
127
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
128
|
+
fromData: string;
|
|
129
|
+
mode: "cycle" | "useFallback" | "clamp";
|
|
130
|
+
fallbackValue?: any;
|
|
131
|
+
}, {
|
|
132
|
+
fromData: string;
|
|
133
|
+
mode?: "cycle" | "useFallback" | "clamp" | undefined;
|
|
134
|
+
fallbackValue?: any;
|
|
135
|
+
}>, import("zod").ZodObject<{
|
|
136
|
+
type: import("zod").ZodLiteral<"byIndex">;
|
|
137
|
+
expression: import("zod").ZodString;
|
|
138
|
+
fallbackValue: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
139
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
140
|
+
type: "byIndex";
|
|
141
|
+
expression: string;
|
|
142
|
+
fallbackValue?: any;
|
|
143
|
+
}, {
|
|
144
|
+
type: "byIndex";
|
|
145
|
+
expression: string;
|
|
146
|
+
fallbackValue?: any;
|
|
147
|
+
}>]>>;
|
|
148
|
+
scaleY: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean, import("zod").ZodNull, import("zod").ZodObject<{
|
|
149
|
+
fromData: import("zod").ZodString;
|
|
150
|
+
mode: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodEnum<["cycle", "useFallback", "clamp"]>>>;
|
|
151
|
+
fallbackValue: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
152
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
153
|
+
fromData: string;
|
|
154
|
+
mode: "cycle" | "useFallback" | "clamp";
|
|
155
|
+
fallbackValue?: any;
|
|
156
|
+
}, {
|
|
157
|
+
fromData: string;
|
|
158
|
+
mode?: "cycle" | "useFallback" | "clamp" | undefined;
|
|
159
|
+
fallbackValue?: any;
|
|
160
|
+
}>, import("zod").ZodObject<{
|
|
161
|
+
type: import("zod").ZodLiteral<"byIndex">;
|
|
162
|
+
expression: import("zod").ZodString;
|
|
163
|
+
fallbackValue: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
164
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
165
|
+
type: "byIndex";
|
|
166
|
+
expression: string;
|
|
167
|
+
fallbackValue?: any;
|
|
168
|
+
}, {
|
|
169
|
+
type: "byIndex";
|
|
170
|
+
expression: string;
|
|
171
|
+
fallbackValue?: any;
|
|
172
|
+
}>]>>;
|
|
173
|
+
rotation: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean, import("zod").ZodNull, import("zod").ZodObject<{
|
|
174
|
+
fromData: import("zod").ZodString;
|
|
175
|
+
mode: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodEnum<["cycle", "useFallback", "clamp"]>>>;
|
|
176
|
+
fallbackValue: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
177
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
178
|
+
fromData: string;
|
|
179
|
+
mode: "cycle" | "useFallback" | "clamp";
|
|
180
|
+
fallbackValue?: any;
|
|
181
|
+
}, {
|
|
182
|
+
fromData: string;
|
|
183
|
+
mode?: "cycle" | "useFallback" | "clamp" | undefined;
|
|
184
|
+
fallbackValue?: any;
|
|
185
|
+
}>, import("zod").ZodObject<{
|
|
186
|
+
type: import("zod").ZodLiteral<"byIndex">;
|
|
187
|
+
expression: import("zod").ZodString;
|
|
188
|
+
fallbackValue: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
189
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
190
|
+
type: "byIndex";
|
|
191
|
+
expression: string;
|
|
192
|
+
fallbackValue?: any;
|
|
193
|
+
}, {
|
|
194
|
+
type: "byIndex";
|
|
195
|
+
expression: string;
|
|
196
|
+
fallbackValue?: any;
|
|
197
|
+
}>]>>;
|
|
198
|
+
width: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean, import("zod").ZodNull, import("zod").ZodObject<{
|
|
199
|
+
fromData: import("zod").ZodString;
|
|
200
|
+
mode: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodEnum<["cycle", "useFallback", "clamp"]>>>;
|
|
201
|
+
fallbackValue: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
202
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
203
|
+
fromData: string;
|
|
204
|
+
mode: "cycle" | "useFallback" | "clamp";
|
|
205
|
+
fallbackValue?: any;
|
|
206
|
+
}, {
|
|
207
|
+
fromData: string;
|
|
208
|
+
mode?: "cycle" | "useFallback" | "clamp" | undefined;
|
|
209
|
+
fallbackValue?: any;
|
|
210
|
+
}>, import("zod").ZodObject<{
|
|
211
|
+
type: import("zod").ZodLiteral<"byIndex">;
|
|
212
|
+
expression: import("zod").ZodString;
|
|
213
|
+
fallbackValue: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
214
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
215
|
+
type: "byIndex";
|
|
216
|
+
expression: string;
|
|
217
|
+
fallbackValue?: any;
|
|
218
|
+
}, {
|
|
219
|
+
type: "byIndex";
|
|
220
|
+
expression: string;
|
|
221
|
+
fallbackValue?: any;
|
|
222
|
+
}>]>>;
|
|
223
|
+
height: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean, import("zod").ZodNull, import("zod").ZodObject<{
|
|
224
|
+
fromData: import("zod").ZodString;
|
|
225
|
+
mode: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodEnum<["cycle", "useFallback", "clamp"]>>>;
|
|
226
|
+
fallbackValue: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
227
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
228
|
+
fromData: string;
|
|
229
|
+
mode: "cycle" | "useFallback" | "clamp";
|
|
230
|
+
fallbackValue?: any;
|
|
231
|
+
}, {
|
|
232
|
+
fromData: string;
|
|
233
|
+
mode?: "cycle" | "useFallback" | "clamp" | undefined;
|
|
234
|
+
fallbackValue?: any;
|
|
235
|
+
}>, import("zod").ZodObject<{
|
|
236
|
+
type: import("zod").ZodLiteral<"byIndex">;
|
|
237
|
+
expression: import("zod").ZodString;
|
|
238
|
+
fallbackValue: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
239
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
240
|
+
type: "byIndex";
|
|
241
|
+
expression: string;
|
|
242
|
+
fallbackValue?: any;
|
|
243
|
+
}, {
|
|
244
|
+
type: "byIndex";
|
|
245
|
+
expression: string;
|
|
246
|
+
fallbackValue?: any;
|
|
247
|
+
}>]>>;
|
|
248
|
+
color: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean, import("zod").ZodNull, import("zod").ZodObject<{
|
|
249
|
+
fromData: import("zod").ZodString;
|
|
250
|
+
mode: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodEnum<["cycle", "useFallback", "clamp"]>>>;
|
|
251
|
+
fallbackValue: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
252
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
253
|
+
fromData: string;
|
|
254
|
+
mode: "cycle" | "useFallback" | "clamp";
|
|
255
|
+
fallbackValue?: any;
|
|
256
|
+
}, {
|
|
257
|
+
fromData: string;
|
|
258
|
+
mode?: "cycle" | "useFallback" | "clamp" | undefined;
|
|
259
|
+
fallbackValue?: any;
|
|
260
|
+
}>, import("zod").ZodObject<{
|
|
261
|
+
type: import("zod").ZodLiteral<"byIndex">;
|
|
262
|
+
expression: import("zod").ZodString;
|
|
263
|
+
fallbackValue: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
264
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
265
|
+
type: "byIndex";
|
|
266
|
+
expression: string;
|
|
267
|
+
fallbackValue?: any;
|
|
268
|
+
}, {
|
|
269
|
+
type: "byIndex";
|
|
270
|
+
expression: string;
|
|
271
|
+
fallbackValue?: any;
|
|
272
|
+
}>]>>;
|
|
273
|
+
}, import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodNumber, import("zod").ZodBoolean, import("zod").ZodNull, import("zod").ZodObject<{
|
|
274
|
+
fromData: import("zod").ZodString;
|
|
275
|
+
mode: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodEnum<["cycle", "useFallback", "clamp"]>>>;
|
|
276
|
+
fallbackValue: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
277
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
278
|
+
fromData: string;
|
|
279
|
+
mode: "cycle" | "useFallback" | "clamp";
|
|
280
|
+
fallbackValue?: any;
|
|
281
|
+
}, {
|
|
282
|
+
fromData: string;
|
|
283
|
+
mode?: "cycle" | "useFallback" | "clamp" | undefined;
|
|
284
|
+
fallbackValue?: any;
|
|
285
|
+
}>, import("zod").ZodObject<{
|
|
286
|
+
type: import("zod").ZodLiteral<"byIndex">;
|
|
287
|
+
expression: import("zod").ZodString;
|
|
288
|
+
fallbackValue: import("zod").ZodOptional<import("zod").ZodAny>;
|
|
289
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
290
|
+
type: "byIndex";
|
|
291
|
+
expression: string;
|
|
292
|
+
fallbackValue?: any;
|
|
293
|
+
}, {
|
|
294
|
+
type: "byIndex";
|
|
295
|
+
expression: string;
|
|
296
|
+
fallbackValue?: any;
|
|
297
|
+
}>]>, "strip"> | undefined;
|
|
298
|
+
ease?: string | undefined;
|
|
299
|
+
delay?: string | number | boolean | {
|
|
300
|
+
fromData: string;
|
|
301
|
+
mode: "cycle" | "useFallback" | "clamp";
|
|
302
|
+
fallbackValue?: any;
|
|
303
|
+
} | {
|
|
304
|
+
type: "byIndex";
|
|
305
|
+
expression: string;
|
|
306
|
+
fallbackValue?: any;
|
|
307
|
+
} | null | undefined;
|
|
308
|
+
stagger?: number | {
|
|
309
|
+
type?: "fromData" | undefined;
|
|
310
|
+
from?: string | number | undefined;
|
|
311
|
+
ease?: string | undefined;
|
|
312
|
+
dataKey?: string | undefined;
|
|
313
|
+
referencePoint?: "tweenStart" | undefined;
|
|
314
|
+
each?: number | undefined;
|
|
315
|
+
grid?: [number | "auto", number | "auto"] | undefined;
|
|
316
|
+
axis?: "x" | "y" | undefined;
|
|
317
|
+
amount?: number | undefined;
|
|
318
|
+
} | undefined;
|
|
319
|
+
} & {
|
|
320
|
+
[k: string]: any;
|
|
321
|
+
};
|
|
322
|
+
position?: string | number | {
|
|
323
|
+
anchor: string;
|
|
324
|
+
alignTween: "center" | "start" | "end";
|
|
325
|
+
offset: string;
|
|
326
|
+
anchorPoint?: "start" | "end" | undefined;
|
|
327
|
+
} | undefined;
|
|
328
|
+
}[];
|
|
329
|
+
id?: string | undefined;
|
|
330
|
+
position?: string | number | {
|
|
331
|
+
anchor: string;
|
|
332
|
+
alignTween: "center" | "start" | "end";
|
|
333
|
+
offset: string;
|
|
334
|
+
anchorPoint?: "start" | "end" | undefined;
|
|
335
|
+
} | undefined;
|
|
336
|
+
target?: string | undefined;
|
|
337
|
+
}[];
|
|
338
|
+
presetId?: string | undefined;
|
|
339
|
+
version?: string | undefined;
|
|
340
|
+
description?: string | undefined;
|
|
341
|
+
duration?: number | undefined;
|
|
342
|
+
data?: Record<string, any> | undefined;
|
|
343
|
+
setup?: ({
|
|
344
|
+
type: "style";
|
|
345
|
+
properties: {} & {
|
|
346
|
+
[k: string]: string | number | boolean | {
|
|
347
|
+
fromData: string;
|
|
348
|
+
mode: "cycle" | "useFallback" | "clamp";
|
|
349
|
+
fallbackValue?: any;
|
|
350
|
+
} | {
|
|
351
|
+
type: "byIndex";
|
|
352
|
+
expression: string;
|
|
353
|
+
fallbackValue?: any;
|
|
354
|
+
} | null;
|
|
355
|
+
};
|
|
356
|
+
} | {
|
|
357
|
+
type: "splitText";
|
|
358
|
+
by: "words" | "lines" | "chars";
|
|
359
|
+
})[] | undefined;
|
|
360
|
+
revertAfterComplete?: boolean | undefined;
|
|
361
|
+
}>;
|
|
362
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as systemPresets from "./presets/index.js";
|
|
2
|
+
export class AnimationPresetsRegister {
|
|
3
|
+
presets = new Map();
|
|
4
|
+
constructor() {
|
|
5
|
+
this.#registerSystemPresets();
|
|
6
|
+
}
|
|
7
|
+
#registerSystemPresets() {
|
|
8
|
+
Object.values(systemPresets).forEach((preset) => {
|
|
9
|
+
if (preset && typeof preset === 'object' && 'id' in preset) {
|
|
10
|
+
this.presets.set(preset.id, preset);
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
register(preset) {
|
|
15
|
+
this.presets.set(preset.id, preset);
|
|
16
|
+
}
|
|
17
|
+
getPresets() {
|
|
18
|
+
return this.presets;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AnimationContext } from './AnimationContext.ts';
|
|
2
|
+
import type { AnimationEngineAdaptor } from './engines/AnimationEngineAdaptor.ts';
|
|
3
|
+
export declare class AnimationSetup {
|
|
4
|
+
private animationContext;
|
|
5
|
+
private engineAdaptor;
|
|
6
|
+
constructor(animationContext: AnimationContext, engineAdaptor: AnimationEngineAdaptor);
|
|
7
|
+
process(): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export class AnimationSetup {
|
|
2
|
+
animationContext;
|
|
3
|
+
engineAdaptor;
|
|
4
|
+
constructor(animationContext, engineAdaptor) {
|
|
5
|
+
this.animationContext = animationContext;
|
|
6
|
+
this.engineAdaptor = engineAdaptor;
|
|
7
|
+
}
|
|
8
|
+
process() {
|
|
9
|
+
// TODO: Implement setup processing
|
|
10
|
+
const setup = this.animationContext.preset.preset.setup;
|
|
11
|
+
if (!setup)
|
|
12
|
+
return;
|
|
13
|
+
for (const step of setup) {
|
|
14
|
+
if (step.type === 'style') {
|
|
15
|
+
// if (this.animationContext.rootElement instanceof HTMLElement) {
|
|
16
|
+
// for (const property in step.properties) {
|
|
17
|
+
// this.animationContext.rootElement.style[property] = step.properties[property];
|
|
18
|
+
// }
|
|
19
|
+
// }
|
|
20
|
+
}
|
|
21
|
+
if (step.type === 'splitText' && ['words', 'lines', 'chars'].includes(step.by)) {
|
|
22
|
+
// prepare cache
|
|
23
|
+
// this.animationContext.splitTextCache.getSplitText(
|
|
24
|
+
// this.animationContext.rootElement,
|
|
25
|
+
// step.by
|
|
26
|
+
// );
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Singleton cache for SplitText instances.
|
|
3
|
+
* This ensures we only split text once per element and split type,
|
|
4
|
+
* preventing multiple splits on the same element when accessed from different contexts.
|
|
5
|
+
*/
|
|
6
|
+
export declare class SplitTextCache {
|
|
7
|
+
private cache;
|
|
8
|
+
constructor();
|
|
9
|
+
/**
|
|
10
|
+
* Get or create a SplitText instance for an element and split type
|
|
11
|
+
* @param element The HTML element to split
|
|
12
|
+
* @param splitType The type of split ('words', 'lines', 'chars')
|
|
13
|
+
* @returns The SplitText result array for the requested split type
|
|
14
|
+
*/
|
|
15
|
+
getSplitText(element: HTMLElement, splitType: 'words' | 'lines' | 'chars'): any;
|
|
16
|
+
/**
|
|
17
|
+
* Clear the entire cache or just entries for a specific element
|
|
18
|
+
* @param element Optional element to clear cache for just that element
|
|
19
|
+
*/
|
|
20
|
+
clearCache(element?: HTMLElement): void;
|
|
21
|
+
/**
|
|
22
|
+
* Generate a unique ID for an element that doesn't have an ID
|
|
23
|
+
* Uses a WeakMap to store references to elements without modifying them
|
|
24
|
+
*/
|
|
25
|
+
private elementMap;
|
|
26
|
+
private elementCounter;
|
|
27
|
+
private generateElementId;
|
|
28
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { SplitText } from 'gsap/SplitText';
|
|
2
|
+
import gsap from 'gsap';
|
|
3
|
+
/**
|
|
4
|
+
* Singleton cache for SplitText instances.
|
|
5
|
+
* This ensures we only split text once per element and split type,
|
|
6
|
+
* preventing multiple splits on the same element when accessed from different contexts.
|
|
7
|
+
*/
|
|
8
|
+
export class SplitTextCache {
|
|
9
|
+
cache = new Map();
|
|
10
|
+
constructor() {
|
|
11
|
+
gsap.registerPlugin(SplitText);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Get or create a SplitText instance for an element and split type
|
|
15
|
+
* @param element The HTML element to split
|
|
16
|
+
* @param splitType The type of split ('words', 'lines', 'chars')
|
|
17
|
+
* @returns The SplitText result array for the requested split type
|
|
18
|
+
*/
|
|
19
|
+
getSplitText(element, splitType) {
|
|
20
|
+
// Generate a unique cache key based on element ID/reference and split type
|
|
21
|
+
const elementId = element.id || this.generateElementId(element);
|
|
22
|
+
const cacheKey = `${elementId}_${splitType}`;
|
|
23
|
+
// Check if we already have this split in the cache
|
|
24
|
+
if (!this.cache.has(cacheKey)) {
|
|
25
|
+
// Create and cache a new SplitText instance
|
|
26
|
+
const splitText = new SplitText(element, {
|
|
27
|
+
type: splitType,
|
|
28
|
+
reduceWhiteSpace: false,
|
|
29
|
+
preserveSpaces: true,
|
|
30
|
+
autoSplit: true,
|
|
31
|
+
aria: 'none'
|
|
32
|
+
});
|
|
33
|
+
this.cache.set(cacheKey, splitText);
|
|
34
|
+
}
|
|
35
|
+
// Return the cached split elements
|
|
36
|
+
return this.cache.get(cacheKey)[splitType];
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Clear the entire cache or just entries for a specific element
|
|
40
|
+
* @param element Optional element to clear cache for just that element
|
|
41
|
+
*/
|
|
42
|
+
clearCache(element) {
|
|
43
|
+
if (element) {
|
|
44
|
+
const elementId = element.id || this.generateElementId(element);
|
|
45
|
+
// Remove all entries starting with this element's ID
|
|
46
|
+
for (const key of this.cache.keys()) {
|
|
47
|
+
if (key.startsWith(`${elementId}_`)) {
|
|
48
|
+
this.cache.delete(key);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
this.cache.clear();
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Generate a unique ID for an element that doesn't have an ID
|
|
58
|
+
* Uses a WeakMap to store references to elements without modifying them
|
|
59
|
+
*/
|
|
60
|
+
elementMap = new WeakMap();
|
|
61
|
+
elementCounter = 0;
|
|
62
|
+
generateElementId(element) {
|
|
63
|
+
if (!this.elementMap.has(element)) {
|
|
64
|
+
this.elementMap.set(element, `split-text-el-${this.elementCounter++}`);
|
|
65
|
+
}
|
|
66
|
+
return this.elementMap.get(element);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { AnimationContext } from './AnimationContext.js';
|
|
2
|
+
import type { AnimationEngineAdaptor, EngineTimeline } from './engines/AnimationEngineAdaptor.js';
|
|
3
|
+
export declare class AnimationBuilder {
|
|
4
|
+
private animationContext;
|
|
5
|
+
private engineAdaptor;
|
|
6
|
+
private mainTimeline;
|
|
7
|
+
private labels;
|
|
8
|
+
constructor(animationContext: AnimationContext, engineAdaptor: AnimationEngineAdaptor);
|
|
9
|
+
build(): EngineTimeline;
|
|
10
|
+
private processSetupSteps;
|
|
11
|
+
private ensureItemHasId;
|
|
12
|
+
private buildTimelineItems;
|
|
13
|
+
private isValidTargets;
|
|
14
|
+
private addSequenceItemToTimeline;
|
|
15
|
+
private addItemLabelIfNeeded;
|
|
16
|
+
private processTweens;
|
|
17
|
+
private resolveTargets;
|
|
18
|
+
private resolveTweenVars;
|
|
19
|
+
private isObject;
|
|
20
|
+
private resolveValue;
|
|
21
|
+
private isFromDataValue;
|
|
22
|
+
private isByIndexValue;
|
|
23
|
+
private resolveFromDataValue;
|
|
24
|
+
private createArrayAccessFunction;
|
|
25
|
+
private resolveByIndexValue;
|
|
26
|
+
private calculatePosition;
|
|
27
|
+
private resolveStringPosition;
|
|
28
|
+
private resolveObjectPosition;
|
|
29
|
+
private resolveAnchor;
|
|
30
|
+
private buildPositionString;
|
|
31
|
+
}
|