gsap-nuxt-module 1.1.1 → 1.1.4
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/module.d.mts +5 -2
- package/dist/module.json +3 -3
- package/dist/module.mjs +2 -2
- package/dist/runtime/composables/createGsapComposable.d.ts +248 -0
- package/dist/runtime/composables/createGsapComposable.js +12 -0
- package/dist/runtime/create-gsap-composable.d.ts +6 -0
- package/dist/runtime/create-gsap-composable.js +13 -0
- package/dist/runtime/gsap-plugins.d.ts +176 -86
- package/dist/runtime/gsap-plugins.js +26 -11
- package/dist/runtime/plugin.d.ts +0 -3
- package/dist/runtime/plugin.js +29 -8
- package/dist/types.d.mts +3 -1
- package/package.json +7 -8
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -8
- package/dist/runtime/composables/useCustomEase.d.ts +0 -1
- package/dist/runtime/composables/useCustomEase.js +0 -8
- package/dist/runtime/composables/useDraggable.d.ts +0 -1
- package/dist/runtime/composables/useDraggable.js +0 -8
- package/dist/runtime/composables/useFlip.d.ts +0 -1
- package/dist/runtime/composables/useFlip.js +0 -8
- package/dist/runtime/composables/useObserver.d.ts +0 -1
- package/dist/runtime/composables/useObserver.js +0 -8
- package/dist/runtime/composables/useScrollToPlugin.d.ts +0 -1
- package/dist/runtime/composables/useScrollToPlugin.js +0 -8
- package/dist/runtime/composables/useScrollTrigger.d.ts +0 -1
- package/dist/runtime/composables/useScrollTrigger.js +0 -8
- package/dist/types.d.ts +0 -1
package/dist/module.d.mts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
+
import { gsapPlugins } from '../dist/runtime/gsap-plugins.js';
|
|
2
3
|
|
|
4
|
+
type GSAPPluginName = keyof typeof gsapPlugins;
|
|
3
5
|
interface ModuleOptions {
|
|
4
|
-
plugins?:
|
|
6
|
+
plugins?: GSAPPluginName[];
|
|
5
7
|
}
|
|
6
8
|
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
7
9
|
|
|
8
|
-
export {
|
|
10
|
+
export { _default as default };
|
|
11
|
+
export type { GSAPPluginName, ModuleOptions };
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fileURLToPath } from 'node:url';
|
|
2
2
|
import { defineNuxtModule, createResolver, addPlugin, addImportsDir } from '@nuxt/kit';
|
|
3
3
|
|
|
4
|
-
const module = defineNuxtModule({
|
|
4
|
+
const module$1 = defineNuxtModule({
|
|
5
5
|
meta: {
|
|
6
6
|
name: "gsap-nuxt-module",
|
|
7
7
|
configKey: "gsap",
|
|
@@ -24,4 +24,4 @@ const module = defineNuxtModule({
|
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
|
|
27
|
-
export { module as default };
|
|
27
|
+
export { module$1 as default };
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
export declare const useScrollTrigger: () => {
|
|
2
|
+
new (vars: ScrollTrigger.StaticVars, animation?: gsap.core.Animation): {
|
|
3
|
+
readonly animation?: gsap.core.Animation | undefined;
|
|
4
|
+
readonly callbackAnimation?: gsap.core.Animation | undefined;
|
|
5
|
+
readonly direction: number;
|
|
6
|
+
readonly end: number;
|
|
7
|
+
readonly isActive: boolean;
|
|
8
|
+
readonly pin?: Element;
|
|
9
|
+
readonly progress: number;
|
|
10
|
+
readonly scroller: Element | Window;
|
|
11
|
+
readonly start: number;
|
|
12
|
+
readonly trigger?: Element;
|
|
13
|
+
readonly vars: ScrollTrigger.Vars;
|
|
14
|
+
disable(revert?: boolean, allowAnimation?: boolean): void;
|
|
15
|
+
enable(reset?: boolean, refresh?: boolean): void;
|
|
16
|
+
endAnimation(): void;
|
|
17
|
+
getTween(snap?: boolean): gsap.core.Tween;
|
|
18
|
+
getTrailing(name?: string | boolean | null): ScrollTrigger[];
|
|
19
|
+
getVelocity(): number;
|
|
20
|
+
kill(reset?: boolean, allowAnimation?: boolean): void;
|
|
21
|
+
labelToScroll(label: string): number;
|
|
22
|
+
next(): ScrollTrigger | undefined;
|
|
23
|
+
previous(): ScrollTrigger | undefined;
|
|
24
|
+
refresh(): void;
|
|
25
|
+
scroll(): number;
|
|
26
|
+
scroll(position: number): void;
|
|
27
|
+
tweenTo(position: number): gsap.core.Tween;
|
|
28
|
+
update(reset?: boolean, recordVelocity?: boolean, forceFake?: boolean): void;
|
|
29
|
+
};
|
|
30
|
+
readonly version: string;
|
|
31
|
+
readonly isTouch: number;
|
|
32
|
+
addEventListener(event: "scrollStart" | "scrollEnd" | "refreshInit" | "refresh" | "matchMedia" | "revert", callback: gsap.Callback): void;
|
|
33
|
+
batch(targets: gsap.DOMTarget, vars: ScrollTrigger.BatchVars): ScrollTrigger[];
|
|
34
|
+
clearMatchMedia(name?: string): void;
|
|
35
|
+
clearScrollMemory(scrollRestoration?: string): void;
|
|
36
|
+
config(vars: ScrollTrigger.ConfigVars): void;
|
|
37
|
+
create(vars: ScrollTrigger.StaticVars): ScrollTrigger;
|
|
38
|
+
defaults(vars: ScrollTrigger.StaticVars): ScrollTrigger.StaticVars;
|
|
39
|
+
getAll(): ScrollTrigger[];
|
|
40
|
+
disable(reset?: boolean, kill?: boolean): void;
|
|
41
|
+
enable(): void;
|
|
42
|
+
getById(id: string): ScrollTrigger | undefined;
|
|
43
|
+
getScrollFunc(element: gsap.DOMTarget | Window, horizontal?: boolean): ScrollTrigger.ScrollFunc;
|
|
44
|
+
isInViewport(element: Element | string, ratio?: number, horizontal?: boolean): boolean;
|
|
45
|
+
isScrolling(): boolean;
|
|
46
|
+
killAll(allowListeners?: boolean): void;
|
|
47
|
+
matchMedia(vars: ScrollTrigger.MatchMediaObject): void;
|
|
48
|
+
maxScroll(target: HTMLElement | Window, horizontal?: boolean): number;
|
|
49
|
+
normalizeScroll(enable?: boolean | ScrollTrigger.NormalizeVars | Observer): Observer | undefined;
|
|
50
|
+
normalizeScroll(): Observer | undefined;
|
|
51
|
+
observe(vars: Observer.ObserverVars): Observer;
|
|
52
|
+
positionInViewport(element: Element | string, referencePoint?: string | number, horizontal?: boolean): number;
|
|
53
|
+
refresh(safe?: boolean): void;
|
|
54
|
+
register(core: typeof gsap): void;
|
|
55
|
+
removeEventListener(event: "scrollStart" | "scrollEnd" | "refreshInit" | "refresh" | "matchMedia" | "revert", callback: gsap.Callback): void;
|
|
56
|
+
saveStyles(targets: gsap.DOMTarget): void;
|
|
57
|
+
scrollerProxy(scroller: gsap.DOMTarget, vars?: ScrollTrigger.ScrollerProxyVars): void;
|
|
58
|
+
snapDirectional(incrementOrArray: number | number[]): ScrollTrigger.SnapDirectionalFunc;
|
|
59
|
+
sort(func?: Function): ScrollTrigger[];
|
|
60
|
+
update(): void;
|
|
61
|
+
};
|
|
62
|
+
export declare const useScrollSmoother: () => {
|
|
63
|
+
new (vars: ScrollSmoother.Vars): {
|
|
64
|
+
readonly scrollTrigger: ScrollTrigger;
|
|
65
|
+
readonly progress: number;
|
|
66
|
+
readonly normalizer?: Observer;
|
|
67
|
+
content(element: gsap.DOMTarget): /*elided*/ any;
|
|
68
|
+
content(): HTMLElement;
|
|
69
|
+
effects(targets: gsap.DOMTarget, vars?: ScrollSmoother.EffectsVars | null): ScrollTrigger[];
|
|
70
|
+
effects(): ScrollTrigger[];
|
|
71
|
+
getVelocity(): number;
|
|
72
|
+
kill(): void;
|
|
73
|
+
offset(target: gsap.DOMTarget, position?: string, ignoreSpeed?: boolean): number;
|
|
74
|
+
paused(value: boolean): /*elided*/ any;
|
|
75
|
+
paused(): boolean;
|
|
76
|
+
refresh(soft?: boolean, force?: boolean): void;
|
|
77
|
+
scrollTo(target: gsap.DOMTarget | number, smooth?: boolean, position?: string): void;
|
|
78
|
+
scrollTop(position: number): /*elided*/ any;
|
|
79
|
+
scrollTop(): number;
|
|
80
|
+
smooth(value: number): void;
|
|
81
|
+
smooth(): number;
|
|
82
|
+
wrapper(element: gsap.DOMTarget): /*elided*/ any;
|
|
83
|
+
wrapper(): HTMLElement;
|
|
84
|
+
};
|
|
85
|
+
readonly version: string;
|
|
86
|
+
create(vars: ScrollSmoother.Vars): ScrollSmoother;
|
|
87
|
+
get(): ScrollSmoother | undefined;
|
|
88
|
+
refresh(safe?: boolean): void;
|
|
89
|
+
};
|
|
90
|
+
export declare const useSplitText: () => {
|
|
91
|
+
new (target: gsap.DOMTarget, vars?: SplitText.Vars): {
|
|
92
|
+
readonly chars: Element[];
|
|
93
|
+
readonly lines: Element[];
|
|
94
|
+
readonly words: Element[];
|
|
95
|
+
readonly masks: Element[];
|
|
96
|
+
readonly elements: Element[];
|
|
97
|
+
readonly isSplit: boolean;
|
|
98
|
+
kill(): void;
|
|
99
|
+
revert(): void;
|
|
100
|
+
split(vars: SplitText.Vars): SplitText;
|
|
101
|
+
};
|
|
102
|
+
create(target: gsap.DOMTarget, vars?: SplitText.Vars): SplitText;
|
|
103
|
+
};
|
|
104
|
+
export declare const useMotionPathHelper: () => {
|
|
105
|
+
new (target: gsap.DOMTarget, vars?: MotionPathHelper.Vars): {
|
|
106
|
+
kill(): void;
|
|
107
|
+
};
|
|
108
|
+
create(target: gsap.DOMTarget, vars?: MotionPathHelper.Vars): MotionPathHelper;
|
|
109
|
+
editPath(target: gsap.DOMTarget, vars?: MotionPathHelper.EditPathVars): MotionPathHelper;
|
|
110
|
+
};
|
|
111
|
+
export declare const useDraggable: () => {
|
|
112
|
+
new (target: gsap.DOMTarget, vars?: Draggable.Vars): {
|
|
113
|
+
readonly autoScroll: number;
|
|
114
|
+
readonly deltaX: number;
|
|
115
|
+
readonly deltaY: number;
|
|
116
|
+
readonly endRotation: number;
|
|
117
|
+
readonly endX: number;
|
|
118
|
+
readonly endY: number;
|
|
119
|
+
readonly isDragging: boolean;
|
|
120
|
+
readonly isPressed: boolean;
|
|
121
|
+
readonly isThrowing: boolean;
|
|
122
|
+
readonly lockAxis: boolean;
|
|
123
|
+
readonly maxRotation: number;
|
|
124
|
+
readonly maxX: number;
|
|
125
|
+
readonly maxY: number;
|
|
126
|
+
readonly minX: number;
|
|
127
|
+
readonly minY: number;
|
|
128
|
+
readonly minRotation: number;
|
|
129
|
+
readonly pointerEvent: TouchEvent | PointerEvent;
|
|
130
|
+
readonly pointerX: number;
|
|
131
|
+
readonly pointerY: number;
|
|
132
|
+
readonly rotation: number;
|
|
133
|
+
readonly scrollProxy: any;
|
|
134
|
+
readonly startX: number;
|
|
135
|
+
readonly startY: number;
|
|
136
|
+
readonly target: HTMLElement | SVGElement;
|
|
137
|
+
readonly tween: gsap.core.Tween;
|
|
138
|
+
readonly vars: Draggable.Vars;
|
|
139
|
+
readonly x: number;
|
|
140
|
+
readonly y: number;
|
|
141
|
+
addEventListener(type: Draggable.CallbackType, callback: gsap.Callback): void;
|
|
142
|
+
applyBounds(bounds: gsap.DOMTarget | Draggable.BoundsMinMax | Draggable.BoundsRectangle | Draggable.BoundsRotation): void;
|
|
143
|
+
disable(type?: string | object): /*elided*/ any;
|
|
144
|
+
dispatchEvent(type: Draggable.CallbackType): boolean;
|
|
145
|
+
enable(type?: string | object): /*elided*/ any;
|
|
146
|
+
enabled(value: boolean): /*elided*/ any;
|
|
147
|
+
enabled(): boolean;
|
|
148
|
+
endDrag(event: Event): void;
|
|
149
|
+
getDirection(from: "start" | "velocity" | gsap.DOMTarget): Draggable.Direction;
|
|
150
|
+
hitTest(testObject: Draggable.TestObject, threshold?: number | string): boolean;
|
|
151
|
+
kill(): /*elided*/ any;
|
|
152
|
+
removeEventListener(type: Draggable.CallbackType, callback: gsap.Callback): void;
|
|
153
|
+
startDrag(event: Event, align?: boolean): void;
|
|
154
|
+
timeSinceDrag(): number;
|
|
155
|
+
update(applyBounds?: boolean, sticky?: boolean): /*elided*/ any;
|
|
156
|
+
};
|
|
157
|
+
version: string;
|
|
158
|
+
zIndex: number;
|
|
159
|
+
create(target: gsap.DOMTarget, vars?: Draggable.Vars): Draggable[];
|
|
160
|
+
get(target: gsap.DOMTarget): Draggable;
|
|
161
|
+
hitTest(testObject1: Draggable.TestObject, testObject2: Draggable.TestObject, threshold?: number | string): boolean;
|
|
162
|
+
timeSinceDrag(): number;
|
|
163
|
+
};
|
|
164
|
+
export declare const useFlip: () => {
|
|
165
|
+
new (): {};
|
|
166
|
+
readonly version: string;
|
|
167
|
+
batch(id?: string): FlipBatch;
|
|
168
|
+
convertCoordinates(fromElement: Element, toElement: Element): gsap.plugins.Matrix2D;
|
|
169
|
+
convertCoordinates(fromElement: Element, toElement: Element, point: gsap.Point2D): gsap.Point2D;
|
|
170
|
+
fit(fromElement: gsap.DOMTarget, toElement: gsap.DOMTarget | Flip.FlipState, vars?: Flip.FitVars): gsap.core.Tween | object | null;
|
|
171
|
+
from(state: Flip.FlipState, vars?: Flip.FromToVars): gsap.core.Timeline;
|
|
172
|
+
getState(targets: gsap.DOMTarget, vars?: Flip.FlipStateVars | string): Flip.FlipState;
|
|
173
|
+
getByTarget(target: Element | string): gsap.core.Timeline | null;
|
|
174
|
+
isFlipping(target: gsap.DOMTarget): boolean;
|
|
175
|
+
killFlipsOf(targets: gsap.DOMTarget, complete?: boolean): void;
|
|
176
|
+
makeAbsolute(targets: gsap.DOMTarget | Flip.FlipState[]): Element[];
|
|
177
|
+
to(state: Flip.FlipState, vars?: Flip.FromToVars): gsap.core.Timeline;
|
|
178
|
+
register(core: typeof gsap): void;
|
|
179
|
+
ElementState: typeof Flip.ElementState;
|
|
180
|
+
FlipState: typeof Flip.FlipState;
|
|
181
|
+
};
|
|
182
|
+
export declare const useObserver: () => {
|
|
183
|
+
new (): {
|
|
184
|
+
readonly deltaX: number;
|
|
185
|
+
readonly deltaY: number;
|
|
186
|
+
readonly event: Event;
|
|
187
|
+
readonly isDragging: boolean;
|
|
188
|
+
readonly isEnabled: boolean;
|
|
189
|
+
readonly isPressed: boolean;
|
|
190
|
+
readonly startX?: number;
|
|
191
|
+
readonly startY?: number;
|
|
192
|
+
readonly target: Element;
|
|
193
|
+
readonly vars: Observer.ObserverVars;
|
|
194
|
+
readonly velocityX: number;
|
|
195
|
+
readonly velocityY: number;
|
|
196
|
+
readonly x?: number;
|
|
197
|
+
readonly y?: number;
|
|
198
|
+
readonly axis?: string | null;
|
|
199
|
+
disable(): void;
|
|
200
|
+
enable(): /*elided*/ any;
|
|
201
|
+
kill(): void;
|
|
202
|
+
scrollX(): number;
|
|
203
|
+
scrollX(position: number): void;
|
|
204
|
+
scrollY(): number;
|
|
205
|
+
scrollY(position: number): void;
|
|
206
|
+
};
|
|
207
|
+
readonly isTouch: number;
|
|
208
|
+
readonly eventTypes: string[];
|
|
209
|
+
readonly version: string;
|
|
210
|
+
create(vars: Observer.ObserverVars): Observer;
|
|
211
|
+
getAll(): Observer[];
|
|
212
|
+
getById(id: string): Observer | undefined;
|
|
213
|
+
};
|
|
214
|
+
export declare const useGSDevTools: () => {
|
|
215
|
+
new (target: gsap.DOMTarget, vars?: GSDevTools.Vars): {
|
|
216
|
+
kill(): void;
|
|
217
|
+
};
|
|
218
|
+
create(vars?: GSDevTools.Vars): GSDevTools;
|
|
219
|
+
getById(id: string): GSDevTools | null;
|
|
220
|
+
};
|
|
221
|
+
export declare const useCustomEase: () => {
|
|
222
|
+
new (id: string, data?: string | number[], config?: CustomEaseConfig): {
|
|
223
|
+
id: string;
|
|
224
|
+
ease: EaseFunction;
|
|
225
|
+
data: string | number[];
|
|
226
|
+
segment: number[];
|
|
227
|
+
setData(data?: string | number[], config?: CustomEaseConfig): /*elided*/ any;
|
|
228
|
+
getSVGData(config?: CustomEaseConfig): string;
|
|
229
|
+
};
|
|
230
|
+
create(id: string, data?: string | number[], config?: CustomEaseConfig): EaseFunction;
|
|
231
|
+
register(core: object): void;
|
|
232
|
+
get(id: string): EaseFunction;
|
|
233
|
+
getSVGData(ease: CustomEase | EaseFunction | string, config?: CustomEaseConfig): string;
|
|
234
|
+
};
|
|
235
|
+
export declare const useCustomWiggle: () => {
|
|
236
|
+
new (id: string, vars?: CustomWiggleVars): {
|
|
237
|
+
ease: EaseFunction;
|
|
238
|
+
};
|
|
239
|
+
create(id: string, vars?: CustomWiggleVars): EaseFunction;
|
|
240
|
+
register(core: object): void;
|
|
241
|
+
};
|
|
242
|
+
export declare const useCustomBounce: () => {
|
|
243
|
+
new (id: string, vars?: CustomBounceVars): {
|
|
244
|
+
ease: EaseFunction;
|
|
245
|
+
};
|
|
246
|
+
create(id: string, vars?: CustomBounceVars): EaseFunction;
|
|
247
|
+
register(core: object): void;
|
|
248
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createGsapComposable } from "../create-gsap-composable.js";
|
|
2
|
+
export const useScrollTrigger = createGsapComposable("ScrollTrigger");
|
|
3
|
+
export const useScrollSmoother = createGsapComposable("ScrollSmoother");
|
|
4
|
+
export const useSplitText = createGsapComposable("SplitText");
|
|
5
|
+
export const useMotionPathHelper = createGsapComposable("MotionPathHelper");
|
|
6
|
+
export const useDraggable = createGsapComposable("Draggable");
|
|
7
|
+
export const useFlip = createGsapComposable("Flip");
|
|
8
|
+
export const useObserver = createGsapComposable("Observer");
|
|
9
|
+
export const useGSDevTools = createGsapComposable("GSDevTools");
|
|
10
|
+
export const useCustomEase = createGsapComposable("CustomEase");
|
|
11
|
+
export const useCustomWiggle = createGsapComposable("CustomWiggle");
|
|
12
|
+
export const useCustomBounce = createGsapComposable("CustomBounce");
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Factory to create GSAP plugin composables.
|
|
3
|
+
* @param pluginName - Name of the GSAP plugin as provided in nuxtApp injects.
|
|
4
|
+
* @param fallbackMessage - Optional error message for missing plugin.
|
|
5
|
+
*/
|
|
6
|
+
export declare function createGsapComposable<T>(pluginName: string, fallbackMessage?: string): () => T;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useNuxtApp } from "#app";
|
|
2
|
+
export function createGsapComposable(pluginName, fallbackMessage) {
|
|
3
|
+
return () => {
|
|
4
|
+
const nuxtApp = useNuxtApp();
|
|
5
|
+
const plugin = nuxtApp[`$${pluginName}`];
|
|
6
|
+
if (!plugin) {
|
|
7
|
+
throw new Error(
|
|
8
|
+
fallbackMessage || `[use${pluginName}] ${pluginName} is not registered! Did you enable it in nuxt.config.ts?`
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
return plugin;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -1,7 +1,147 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This object contains lazy-loaded GSAP plugins for use in the application.
|
|
3
|
+
*
|
|
3
4
|
*/
|
|
4
5
|
export declare const gsapPlugins: {
|
|
6
|
+
ScrollTrigger: () => Promise<{
|
|
7
|
+
new (vars: ScrollTrigger.StaticVars, animation?: gsap.core.Animation): {
|
|
8
|
+
readonly animation?: gsap.core.Animation | undefined;
|
|
9
|
+
readonly callbackAnimation?: gsap.core.Animation | undefined;
|
|
10
|
+
readonly direction: number;
|
|
11
|
+
readonly end: number;
|
|
12
|
+
readonly isActive: boolean;
|
|
13
|
+
readonly pin?: Element;
|
|
14
|
+
readonly progress: number;
|
|
15
|
+
readonly scroller: Element | Window;
|
|
16
|
+
readonly start: number;
|
|
17
|
+
readonly trigger?: Element;
|
|
18
|
+
readonly vars: ScrollTrigger.Vars;
|
|
19
|
+
disable(revert?: boolean, allowAnimation?: boolean): void;
|
|
20
|
+
enable(reset?: boolean, refresh?: boolean): void;
|
|
21
|
+
endAnimation(): void;
|
|
22
|
+
getTween(snap?: boolean): gsap.core.Tween;
|
|
23
|
+
getTrailing(name?: string | boolean | null): ScrollTrigger[];
|
|
24
|
+
getVelocity(): number;
|
|
25
|
+
kill(reset?: boolean, allowAnimation?: boolean): void;
|
|
26
|
+
labelToScroll(label: string): number;
|
|
27
|
+
next(): ScrollTrigger | undefined;
|
|
28
|
+
previous(): ScrollTrigger | undefined;
|
|
29
|
+
refresh(): void;
|
|
30
|
+
scroll(): number;
|
|
31
|
+
scroll(position: number): void;
|
|
32
|
+
tweenTo(position: number): gsap.core.Tween;
|
|
33
|
+
update(reset?: boolean, recordVelocity?: boolean, forceFake?: boolean): void;
|
|
34
|
+
};
|
|
35
|
+
readonly version: string;
|
|
36
|
+
readonly isTouch: number;
|
|
37
|
+
addEventListener(event: "scrollStart" | "scrollEnd" | "refreshInit" | "refresh" | "matchMedia" | "revert", callback: gsap.Callback): void;
|
|
38
|
+
batch(targets: gsap.DOMTarget, vars: ScrollTrigger.BatchVars): ScrollTrigger[];
|
|
39
|
+
clearMatchMedia(name?: string): void;
|
|
40
|
+
clearScrollMemory(scrollRestoration?: string): void;
|
|
41
|
+
config(vars: ScrollTrigger.ConfigVars): void;
|
|
42
|
+
create(vars: ScrollTrigger.StaticVars): ScrollTrigger;
|
|
43
|
+
defaults(vars: ScrollTrigger.StaticVars): ScrollTrigger.StaticVars;
|
|
44
|
+
getAll(): ScrollTrigger[];
|
|
45
|
+
disable(reset?: boolean, kill?: boolean): void;
|
|
46
|
+
enable(): void;
|
|
47
|
+
getById(id: string): ScrollTrigger | undefined;
|
|
48
|
+
getScrollFunc(element: gsap.DOMTarget | Window, horizontal?: boolean): ScrollTrigger.ScrollFunc;
|
|
49
|
+
isInViewport(element: Element | string, ratio?: number, horizontal?: boolean): boolean;
|
|
50
|
+
isScrolling(): boolean;
|
|
51
|
+
killAll(allowListeners?: boolean): void;
|
|
52
|
+
matchMedia(vars: ScrollTrigger.MatchMediaObject): void;
|
|
53
|
+
maxScroll(target: HTMLElement | Window, horizontal?: boolean): number;
|
|
54
|
+
normalizeScroll(enable?: boolean | ScrollTrigger.NormalizeVars | Observer): Observer | undefined;
|
|
55
|
+
normalizeScroll(): Observer | undefined;
|
|
56
|
+
observe(vars: Observer.ObserverVars): Observer;
|
|
57
|
+
positionInViewport(element: Element | string, referencePoint?: string | number, horizontal?: boolean): number;
|
|
58
|
+
refresh(safe?: boolean): void;
|
|
59
|
+
register(core: typeof gsap): void;
|
|
60
|
+
removeEventListener(event: "scrollStart" | "scrollEnd" | "refreshInit" | "refresh" | "matchMedia" | "revert", callback: gsap.Callback): void;
|
|
61
|
+
saveStyles(targets: gsap.DOMTarget): void;
|
|
62
|
+
scrollerProxy(scroller: gsap.DOMTarget, vars?: ScrollTrigger.ScrollerProxyVars): void;
|
|
63
|
+
snapDirectional(incrementOrArray: number | number[]): ScrollTrigger.SnapDirectionalFunc;
|
|
64
|
+
sort(func?: Function): ScrollTrigger[];
|
|
65
|
+
update(): void;
|
|
66
|
+
}>;
|
|
67
|
+
ScrollToPlugin: () => Promise<{
|
|
68
|
+
new (): {};
|
|
69
|
+
config(vars: ScrollToPlugin.ConfigVars): void;
|
|
70
|
+
max(element: gsap.DOMTarget): number;
|
|
71
|
+
offset(element: gsap.DOMTarget, container?: gsap.DOMTarget): number;
|
|
72
|
+
}>;
|
|
73
|
+
ScrollSmoother: () => Promise<{
|
|
74
|
+
new (vars: ScrollSmoother.Vars): {
|
|
75
|
+
readonly scrollTrigger: ScrollTrigger;
|
|
76
|
+
readonly progress: number;
|
|
77
|
+
readonly normalizer?: Observer;
|
|
78
|
+
content(element: gsap.DOMTarget): /*elided*/ any;
|
|
79
|
+
content(): HTMLElement;
|
|
80
|
+
effects(targets: gsap.DOMTarget, vars?: ScrollSmoother.EffectsVars | null): ScrollTrigger[];
|
|
81
|
+
effects(): ScrollTrigger[];
|
|
82
|
+
getVelocity(): number;
|
|
83
|
+
kill(): void;
|
|
84
|
+
offset(target: gsap.DOMTarget, position?: string, ignoreSpeed?: boolean): number;
|
|
85
|
+
paused(value: boolean): /*elided*/ any;
|
|
86
|
+
paused(): boolean;
|
|
87
|
+
refresh(soft?: boolean, force?: boolean): void;
|
|
88
|
+
scrollTo(target: gsap.DOMTarget | number, smooth?: boolean, position?: string): void;
|
|
89
|
+
scrollTop(position: number): /*elided*/ any;
|
|
90
|
+
scrollTop(): number;
|
|
91
|
+
smooth(value: number): void;
|
|
92
|
+
smooth(): number;
|
|
93
|
+
wrapper(element: gsap.DOMTarget): /*elided*/ any;
|
|
94
|
+
wrapper(): HTMLElement;
|
|
95
|
+
};
|
|
96
|
+
readonly version: string;
|
|
97
|
+
create(vars: ScrollSmoother.Vars): ScrollSmoother;
|
|
98
|
+
get(): ScrollSmoother | undefined;
|
|
99
|
+
refresh(safe?: boolean): void;
|
|
100
|
+
}>;
|
|
101
|
+
SplitText: () => Promise<{
|
|
102
|
+
new (target: gsap.DOMTarget, vars?: SplitText.Vars): {
|
|
103
|
+
readonly chars: Element[];
|
|
104
|
+
readonly lines: Element[];
|
|
105
|
+
readonly words: Element[];
|
|
106
|
+
readonly masks: Element[];
|
|
107
|
+
readonly elements: Element[];
|
|
108
|
+
readonly isSplit: boolean;
|
|
109
|
+
kill(): void;
|
|
110
|
+
revert(): void;
|
|
111
|
+
split(vars: SplitText.Vars): SplitText;
|
|
112
|
+
};
|
|
113
|
+
create(target: gsap.DOMTarget, vars?: SplitText.Vars): SplitText;
|
|
114
|
+
}>;
|
|
115
|
+
ScrambleTextPlugin: () => Promise<gsap.plugins.ScrambleTextPlugin>;
|
|
116
|
+
TextPlugin: () => Promise<gsap.plugins.TextPlugin>;
|
|
117
|
+
DrawSVGPlugin: () => Promise<gsap.plugins.DrawSVGPlugin>;
|
|
118
|
+
MorphSVGPlugin: () => Promise<gsap.plugins.MorphSVGPlugin>;
|
|
119
|
+
MotionPathPlugin: () => Promise<gsap.plugins.MotionPathPlugin>;
|
|
120
|
+
MotionPathHelper: () => Promise<{
|
|
121
|
+
new (target: gsap.DOMTarget, vars?: MotionPathHelper.Vars): {
|
|
122
|
+
kill(): void;
|
|
123
|
+
};
|
|
124
|
+
create(target: gsap.DOMTarget, vars?: MotionPathHelper.Vars): MotionPathHelper;
|
|
125
|
+
editPath(target: gsap.DOMTarget, vars?: MotionPathHelper.EditPathVars): MotionPathHelper;
|
|
126
|
+
}>;
|
|
127
|
+
Flip: () => Promise<{
|
|
128
|
+
new (): {};
|
|
129
|
+
readonly version: string;
|
|
130
|
+
batch(id?: string): FlipBatch;
|
|
131
|
+
convertCoordinates(fromElement: Element, toElement: Element): gsap.plugins.Matrix2D;
|
|
132
|
+
convertCoordinates(fromElement: Element, toElement: Element, point: gsap.Point2D): gsap.Point2D;
|
|
133
|
+
fit(fromElement: gsap.DOMTarget, toElement: gsap.DOMTarget | Flip.FlipState, vars?: Flip.FitVars): gsap.core.Tween | object | null;
|
|
134
|
+
from(state: Flip.FlipState, vars?: Flip.FromToVars): gsap.core.Timeline;
|
|
135
|
+
getState(targets: gsap.DOMTarget, vars?: Flip.FlipStateVars | string): Flip.FlipState;
|
|
136
|
+
getByTarget(target: Element | string): gsap.core.Timeline | null;
|
|
137
|
+
isFlipping(target: gsap.DOMTarget): boolean;
|
|
138
|
+
killFlipsOf(targets: gsap.DOMTarget, complete?: boolean): void;
|
|
139
|
+
makeAbsolute(targets: gsap.DOMTarget | Flip.FlipState[]): Element[];
|
|
140
|
+
to(state: Flip.FlipState, vars?: Flip.FromToVars): gsap.core.Timeline;
|
|
141
|
+
register(core: typeof gsap): void;
|
|
142
|
+
ElementState: typeof Flip.ElementState;
|
|
143
|
+
FlipState: typeof Flip.FlipState;
|
|
144
|
+
}>;
|
|
5
145
|
Draggable: () => Promise<{
|
|
6
146
|
new (target: gsap.DOMTarget, vars?: Draggable.Vars): {
|
|
7
147
|
readonly autoScroll: number;
|
|
@@ -55,26 +195,7 @@ export declare const gsapPlugins: {
|
|
|
55
195
|
hitTest(testObject1: Draggable.TestObject, testObject2: Draggable.TestObject, threshold?: number | string): boolean;
|
|
56
196
|
timeSinceDrag(): number;
|
|
57
197
|
}>;
|
|
58
|
-
|
|
59
|
-
Flip: () => Promise<{
|
|
60
|
-
new (): {};
|
|
61
|
-
readonly version: string;
|
|
62
|
-
batch(id?: string): FlipBatch;
|
|
63
|
-
convertCoordinates(fromElement: Element, toElement: Element): gsap.plugins.Matrix2D;
|
|
64
|
-
convertCoordinates(fromElement: Element, toElement: Element, point: gsap.Point2D): gsap.Point2D;
|
|
65
|
-
fit(fromElement: gsap.DOMTarget, toElement: gsap.DOMTarget | Flip.FlipState, vars?: Flip.FitVars): gsap.core.Tween | object | null;
|
|
66
|
-
from(state: Flip.FlipState, vars?: Flip.FromToVars): gsap.core.Timeline;
|
|
67
|
-
getState(targets: gsap.DOMTarget, vars?: Flip.FlipStateVars | string): Flip.FlipState;
|
|
68
|
-
getByTarget(target: Element | string): gsap.core.Timeline | null;
|
|
69
|
-
isFlipping(target: gsap.DOMTarget): boolean;
|
|
70
|
-
killFlipsOf(targets: gsap.DOMTarget, complete?: boolean): void;
|
|
71
|
-
makeAbsolute(targets: gsap.DOMTarget | Flip.FlipState[]): Element[];
|
|
72
|
-
to(state: Flip.FlipState, vars?: Flip.FromToVars): gsap.core.Timeline;
|
|
73
|
-
register(core: typeof gsap): void;
|
|
74
|
-
ElementState: typeof Flip.ElementState;
|
|
75
|
-
FlipState: typeof Flip.FlipState;
|
|
76
|
-
}>;
|
|
77
|
-
MotionPathPlugin: () => Promise<gsap.plugins.MotionPathPlugin>;
|
|
198
|
+
InertiaPlugin: () => Promise<gsap.plugins.InertiaPlugin>;
|
|
78
199
|
Observer: () => Promise<{
|
|
79
200
|
new (): {
|
|
80
201
|
readonly deltaX: number;
|
|
@@ -108,76 +229,45 @@ export declare const gsapPlugins: {
|
|
|
108
229
|
getById(id: string): Observer | undefined;
|
|
109
230
|
}>;
|
|
110
231
|
PixiPlugin: () => Promise<gsap.plugins.PixiPlugin>;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
232
|
+
EaselPlugin: () => Promise<gsap.plugins.EaselPlugin>;
|
|
233
|
+
Physics2DPlugin: () => Promise<gsap.plugins.Physics2DPlugin>;
|
|
234
|
+
PhysicsPropsPlugin: () => Promise<gsap.plugins.PhysicsPropsPlugin>;
|
|
235
|
+
GSDevTools: () => Promise<{
|
|
236
|
+
new (target: gsap.DOMTarget, vars?: GSDevTools.Vars): {
|
|
237
|
+
kill(): void;
|
|
238
|
+
};
|
|
239
|
+
create(vars?: GSDevTools.Vars): GSDevTools;
|
|
240
|
+
getById(id: string): GSDevTools | null;
|
|
116
241
|
}>;
|
|
117
|
-
|
|
118
|
-
new (
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
readonly progress: number;
|
|
126
|
-
readonly scroller: Element | Window;
|
|
127
|
-
readonly start: number;
|
|
128
|
-
readonly trigger?: Element;
|
|
129
|
-
readonly vars: ScrollTrigger.Vars;
|
|
130
|
-
disable(revert?: boolean, allowAnimation?: boolean): void;
|
|
131
|
-
enable(reset?: boolean, refresh?: boolean): void;
|
|
132
|
-
endAnimation(): void;
|
|
133
|
-
getTween(snap?: boolean): gsap.core.Tween;
|
|
134
|
-
getTrailing(name?: string | boolean | null): ScrollTrigger[];
|
|
135
|
-
getVelocity(): number;
|
|
136
|
-
kill(reset?: boolean, allowAnimation?: boolean): void;
|
|
137
|
-
labelToScroll(label: string): number;
|
|
138
|
-
next(): ScrollTrigger | undefined;
|
|
139
|
-
previous(): ScrollTrigger | undefined;
|
|
140
|
-
refresh(): void;
|
|
141
|
-
scroll(): number;
|
|
142
|
-
scroll(position: number): void;
|
|
143
|
-
tweenTo(position: number): gsap.core.Tween;
|
|
144
|
-
update(reset?: boolean, recordVelocity?: boolean, forceFake?: boolean): void;
|
|
242
|
+
CustomEase: () => Promise<{
|
|
243
|
+
new (id: string, data?: string | number[], config?: CustomEaseConfig): {
|
|
244
|
+
id: string;
|
|
245
|
+
ease: EaseFunction;
|
|
246
|
+
data: string | number[];
|
|
247
|
+
segment: number[];
|
|
248
|
+
setData(data?: string | number[], config?: CustomEaseConfig): /*elided*/ any;
|
|
249
|
+
getSVGData(config?: CustomEaseConfig): string;
|
|
145
250
|
};
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
clearMatchMedia(name?: string): void;
|
|
151
|
-
clearScrollMemory(scrollRestoration?: string): void;
|
|
152
|
-
config(vars: ScrollTrigger.ConfigVars): void;
|
|
153
|
-
create(vars: ScrollTrigger.StaticVars): ScrollTrigger;
|
|
154
|
-
defaults(vars: ScrollTrigger.StaticVars): ScrollTrigger.StaticVars;
|
|
155
|
-
getAll(): ScrollTrigger[];
|
|
156
|
-
disable(reset?: boolean, kill?: boolean): void;
|
|
157
|
-
enable(): void;
|
|
158
|
-
getById(id: string): ScrollTrigger | undefined;
|
|
159
|
-
getScrollFunc(element: gsap.DOMTarget | Window, horizontal?: boolean): ScrollTrigger.ScrollFunc;
|
|
160
|
-
isInViewport(element: Element | string, ratio?: number, horizontal?: boolean): boolean;
|
|
161
|
-
isScrolling(): boolean;
|
|
162
|
-
killAll(allowListeners?: boolean): void;
|
|
163
|
-
matchMedia(vars: ScrollTrigger.MatchMediaObject): void;
|
|
164
|
-
maxScroll(target: HTMLElement | Window, horizontal?: boolean): number;
|
|
165
|
-
normalizeScroll(enable?: boolean | ScrollTrigger.NormalizeVars | Observer): Observer | undefined;
|
|
166
|
-
normalizeScroll(): Observer | undefined;
|
|
167
|
-
observe(vars: Observer.ObserverVars): Observer;
|
|
168
|
-
positionInViewport(element: Element | string, referencePoint?: string | number, horizontal?: boolean): number;
|
|
169
|
-
refresh(safe?: boolean): void;
|
|
170
|
-
register(core: typeof gsap): void;
|
|
171
|
-
removeEventListener(event: "scrollStart" | "scrollEnd" | "refreshInit" | "refresh" | "matchMedia", callback: gsap.Callback): void;
|
|
172
|
-
saveStyles(targets: gsap.DOMTarget): void;
|
|
173
|
-
scrollerProxy(scroller: gsap.DOMTarget, vars?: ScrollTrigger.ScrollerProxyVars): void;
|
|
174
|
-
snapDirectional(incrementOrArray: number | number[]): ScrollTrigger.SnapDirectionalFunc;
|
|
175
|
-
sort(func?: Function): ScrollTrigger[];
|
|
176
|
-
update(): void;
|
|
251
|
+
create(id: string, data?: string | number[], config?: CustomEaseConfig): EaseFunction;
|
|
252
|
+
register(core: object): void;
|
|
253
|
+
get(id: string): EaseFunction;
|
|
254
|
+
getSVGData(ease: CustomEase | EaseFunction | string, config?: CustomEaseConfig): string;
|
|
177
255
|
}>;
|
|
178
|
-
TextPlugin: () => Promise<gsap.plugins.TextPlugin>;
|
|
179
256
|
RoughEase: () => Promise<gsap.RoughEase>;
|
|
180
257
|
ExpoScaleEase: () => Promise<gsap.ExpoScaleEase>;
|
|
181
258
|
SlowMo: () => Promise<gsap.SlowMo>;
|
|
182
|
-
|
|
259
|
+
CustomBounce: () => Promise<{
|
|
260
|
+
new (id: string, vars?: CustomBounceVars): {
|
|
261
|
+
ease: EaseFunction;
|
|
262
|
+
};
|
|
263
|
+
create(id: string, vars?: CustomBounceVars): EaseFunction;
|
|
264
|
+
register(core: object): void;
|
|
265
|
+
}>;
|
|
266
|
+
CustomWiggle: () => Promise<{
|
|
267
|
+
new (id: string, vars?: CustomWiggleVars): {
|
|
268
|
+
ease: EaseFunction;
|
|
269
|
+
};
|
|
270
|
+
create(id: string, vars?: CustomWiggleVars): EaseFunction;
|
|
271
|
+
register(core: object): void;
|
|
272
|
+
}>;
|
|
183
273
|
};
|
|
@@ -1,18 +1,33 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export const gsapPlugins = {
|
|
2
|
+
// Scroll Plugins
|
|
3
|
+
ScrollTrigger: () => import("gsap/ScrollTrigger").then((mod) => mod.ScrollTrigger),
|
|
4
|
+
ScrollToPlugin: () => import("gsap/ScrollToPlugin").then((mod) => mod.ScrollToPlugin),
|
|
5
|
+
ScrollSmoother: () => import("gsap/ScrollSmoother").then((mod) => mod.ScrollSmoother),
|
|
6
|
+
// Text Plugins
|
|
7
|
+
SplitText: () => import("gsap/SplitText").then((mod) => mod.SplitText),
|
|
8
|
+
ScrambleTextPlugin: () => import("gsap/ScrambleTextPlugin").then((mod) => mod.ScrambleTextPlugin),
|
|
9
|
+
TextPlugin: () => import("gsap/TextPlugin").then((mod) => mod.TextPlugin),
|
|
10
|
+
// SVG Plugins
|
|
11
|
+
DrawSVGPlugin: () => import("gsap/DrawSVGPlugin").then((mod) => mod.DrawSVGPlugin),
|
|
12
|
+
MorphSVGPlugin: () => import("gsap/MorphSVGPlugin").then((mod) => mod.MorphSVGPlugin),
|
|
5
13
|
MotionPathPlugin: () => import("gsap/MotionPathPlugin").then((mod) => mod.MotionPathPlugin),
|
|
14
|
+
MotionPathHelper: () => import("gsap/MotionPathHelper").then((mod) => mod.MotionPathHelper),
|
|
15
|
+
// UI Plugins
|
|
16
|
+
Flip: () => import("gsap/Flip").then((mod) => mod.Flip),
|
|
17
|
+
Draggable: () => import("gsap/Draggable").then((mod) => mod.Draggable),
|
|
18
|
+
InertiaPlugin: () => import("gsap/InertiaPlugin").then((mod) => mod.InertiaPlugin),
|
|
6
19
|
Observer: () => import("gsap/Observer").then((mod) => mod.Observer),
|
|
20
|
+
// Other Plugins
|
|
7
21
|
PixiPlugin: () => import("gsap/PixiPlugin").then((mod) => mod.PixiPlugin),
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
22
|
+
EaselPlugin: () => import("gsap/EaselPlugin").then((mod) => mod.EaselPlugin),
|
|
23
|
+
Physics2DPlugin: () => import("gsap/Physics2DPlugin").then((mod) => mod.Physics2DPlugin),
|
|
24
|
+
PhysicsPropsPlugin: () => import("gsap/PhysicsPropsPlugin").then((mod) => mod.PhysicsPropsPlugin),
|
|
25
|
+
GSDevTools: () => import("gsap/GSDevTools").then((mod) => mod.GSDevTools),
|
|
26
|
+
// Eases
|
|
27
|
+
CustomEase: () => import("gsap/CustomEase").then((mod) => mod.CustomEase),
|
|
11
28
|
RoughEase: () => import("gsap/EasePack").then((mod) => mod.RoughEase),
|
|
12
29
|
ExpoScaleEase: () => import("gsap/EasePack").then((mod) => mod.ExpoScaleEase),
|
|
13
30
|
SlowMo: () => import("gsap/EasePack").then((mod) => mod.SlowMo),
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
export const gsapPlugins = {
|
|
17
|
-
...gsapCorePlugins
|
|
31
|
+
CustomBounce: () => import("gsap/CustomBounce").then((mod) => mod.CustomBounce),
|
|
32
|
+
CustomWiggle: () => import("gsap/CustomWiggle").then((mod) => mod.CustomWiggle)
|
|
18
33
|
};
|
package/dist/runtime/plugin.d.ts
CHANGED
package/dist/runtime/plugin.js
CHANGED
|
@@ -1,16 +1,37 @@
|
|
|
1
1
|
import { gsap } from "gsap";
|
|
2
2
|
import { gsapPlugins } from "./gsap-plugins.js";
|
|
3
3
|
import { defineNuxtPlugin, useRuntimeConfig } from "#app";
|
|
4
|
-
export default defineNuxtPlugin(async (
|
|
4
|
+
export default defineNuxtPlugin(async (nuxtApp) => {
|
|
5
5
|
const config = useRuntimeConfig().public.gsap;
|
|
6
|
-
const pluginsToRegister = config.plugins || [];
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const pluginsToRegister = new Set(config.plugins || []);
|
|
7
|
+
const pluginDependencies = {
|
|
8
|
+
ScrollSmoother: ["ScrollTrigger"],
|
|
9
|
+
CustomWiggle: ["CustomEase"],
|
|
10
|
+
CustomBounce: ["CustomEase"]
|
|
11
|
+
};
|
|
12
|
+
const resolvedPlugins = /* @__PURE__ */ new Set();
|
|
13
|
+
const resolvePlugin = (plugin) => {
|
|
14
|
+
if (resolvedPlugins.has(plugin)) return;
|
|
15
|
+
const deps = pluginDependencies[plugin] || [];
|
|
16
|
+
deps.forEach(resolvePlugin);
|
|
17
|
+
resolvedPlugins.add(plugin);
|
|
18
|
+
};
|
|
19
|
+
for (const plugin of pluginsToRegister) {
|
|
20
|
+
resolvePlugin(plugin);
|
|
21
|
+
}
|
|
22
|
+
for (const pluginName of resolvedPlugins) {
|
|
23
|
+
const loader = gsapPlugins[pluginName];
|
|
24
|
+
if (!loader) {
|
|
25
|
+
throw new Error(
|
|
26
|
+
`[gsap-nuxt-module] Plugin "${pluginName}" not found. Available plugins: ${Object.keys(gsapPlugins).join(", ")}`
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
const plugin = await loader();
|
|
11
31
|
gsap.registerPlugin(plugin);
|
|
12
|
-
|
|
13
|
-
|
|
32
|
+
nuxtApp.provide(pluginName, plugin);
|
|
33
|
+
} catch (err) {
|
|
34
|
+
console.error(`[gsap-nuxt-module] Failed to load plugin "${pluginName}":`, err);
|
|
14
35
|
}
|
|
15
36
|
}
|
|
16
37
|
});
|
package/dist/types.d.mts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gsap-nuxt-module",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "GSAP integration for Nuxt.",
|
|
5
5
|
"repository": "LucaArgentieri/gsap-nuxt-module",
|
|
6
6
|
"author": "Luca Argentieri",
|
|
@@ -13,13 +13,12 @@
|
|
|
13
13
|
],
|
|
14
14
|
"exports": {
|
|
15
15
|
".": {
|
|
16
|
-
"types": "./dist/types.d.ts",
|
|
17
16
|
"import": "./dist/module.mjs",
|
|
18
|
-
"
|
|
17
|
+
"types": "./dist/types.d.mts"
|
|
19
18
|
}
|
|
20
19
|
},
|
|
21
|
-
"main": "./dist/module.
|
|
22
|
-
"types": "./dist/types.d.
|
|
20
|
+
"main": "./dist/module.mjs",
|
|
21
|
+
"types": "./dist/types.d.mts",
|
|
23
22
|
"files": [
|
|
24
23
|
"dist"
|
|
25
24
|
],
|
|
@@ -36,19 +35,19 @@
|
|
|
36
35
|
},
|
|
37
36
|
"dependencies": {
|
|
38
37
|
"@nuxt/kit": "^3.15.4",
|
|
39
|
-
"gsap": "^3.
|
|
38
|
+
"gsap": "^3.14.1"
|
|
40
39
|
},
|
|
41
40
|
"devDependencies": {
|
|
42
41
|
"@nuxt/devtools": "^2.1.0",
|
|
43
42
|
"@nuxt/eslint-config": "^1.1.0",
|
|
44
|
-
"@nuxt/module-builder": "^0.
|
|
43
|
+
"@nuxt/module-builder": "^1.0.1",
|
|
45
44
|
"@nuxt/schema": "^3.15.4",
|
|
46
45
|
"@nuxt/test-utils": "^3.17.0",
|
|
47
46
|
"@types/node": "latest",
|
|
48
47
|
"changelogen": "^0.6.0",
|
|
49
48
|
"eslint": "^9.21.0",
|
|
50
49
|
"nuxt": "^3.15.4",
|
|
51
|
-
"typescript": "
|
|
50
|
+
"typescript": "^5.9.3",
|
|
52
51
|
"vitest": "^3.0.7",
|
|
53
52
|
"vue-tsc": "^2.2.4"
|
|
54
53
|
}
|
package/dist/module.cjs
DELETED
package/dist/module.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
|
|
3
|
-
interface ModuleOptions {
|
|
4
|
-
plugins?: ('Draggable' | 'EaselPlugin' | 'Flip' | 'MotionPathPlugin' | 'Observer' | 'PixiPlugin' | 'ScrollToPlugin' | 'ScrollTrigger' | 'TextPlugin' | 'RoughEase' | 'ExpoScaleEase' | 'SlowMo' | 'CustomEase')[];
|
|
5
|
-
}
|
|
6
|
-
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
7
|
-
|
|
8
|
-
export { type ModuleOptions, _default as default };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useCustomEase: () => typeof CustomEase;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { useNuxtApp } from "#app";
|
|
2
|
-
export const useCustomEase = () => {
|
|
3
|
-
const { $CustomEase } = useNuxtApp();
|
|
4
|
-
if (!$CustomEase) {
|
|
5
|
-
throw new Error("[useCustomEase] CustomEase not registered! Did you enable it in nuxt.config.ts?");
|
|
6
|
-
}
|
|
7
|
-
return $CustomEase;
|
|
8
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useDraggable: () => typeof Draggable | undefined;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useFlip: () => typeof Flip;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useObserver: () => typeof Observer;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useScrollToPlugin: () => typeof ScrollToPlugin;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { useNuxtApp } from "#app";
|
|
2
|
-
export const useScrollToPlugin = () => {
|
|
3
|
-
const { $ScrollToPlugin } = useNuxtApp();
|
|
4
|
-
if (!$ScrollToPlugin) {
|
|
5
|
-
throw new Error("[useScrollToPlugin] ScrollToPlugin not registered! Did you enable it in nuxt.config.ts?");
|
|
6
|
-
}
|
|
7
|
-
return $ScrollToPlugin;
|
|
8
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useScrollTrigger: () => typeof ScrollTrigger;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { useNuxtApp } from "#app";
|
|
2
|
-
export const useScrollTrigger = () => {
|
|
3
|
-
const { $ScrollTrigger } = useNuxtApp();
|
|
4
|
-
if (!$ScrollTrigger) {
|
|
5
|
-
throw new Error("[useScrollTrigger] ScrollTrigger not registered! Did you enable it in nuxt.config.ts?");
|
|
6
|
-
}
|
|
7
|
-
return $ScrollTrigger;
|
|
8
|
-
};
|
package/dist/types.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { type ModuleOptions, default } from './module'
|