@tsparticles/engine 4.0.0-alpha.3 → 4.0.0-alpha.5
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/794.min.js +2 -0
- package/794.min.js.LICENSE.txt +1 -0
- package/README.md +2 -5
- package/browser/Core/Canvas.js +3 -3
- package/browser/Core/Container.js +35 -155
- package/browser/Core/Engine.js +32 -78
- package/browser/Core/Particle.js +5 -10
- package/browser/Core/Particles.js +36 -25
- package/browser/Core/Utils/Constants.js +2 -2
- package/browser/Core/Utils/EventListeners.js +5 -250
- package/browser/Options/Classes/Options.js +7 -75
- package/browser/Options/Classes/Particles/ParticlesOptions.js +5 -11
- package/{esm/Options/Classes/Interactivity/Events → browser/Options/Classes}/ResizeEvent.js +1 -1
- package/browser/Utils/ColorUtils.js +7 -5
- package/browser/Utils/Utils.js +33 -36
- package/browser/exports.js +1 -21
- package/cjs/Core/Canvas.js +3 -3
- package/cjs/Core/Container.js +35 -155
- package/cjs/Core/Engine.js +32 -78
- package/cjs/Core/Particle.js +5 -10
- package/cjs/Core/Particles.js +36 -25
- package/cjs/Core/Utils/Constants.js +2 -2
- package/cjs/Core/Utils/EventListeners.js +5 -250
- package/cjs/Options/Classes/Options.js +7 -75
- package/cjs/Options/Classes/Particles/ParticlesOptions.js +5 -11
- package/cjs/Options/Classes/{Interactivity/Events/ResizeEvent.js → ResizeEvent.js} +1 -1
- package/cjs/Utils/ColorUtils.js +7 -5
- package/cjs/Utils/Utils.js +33 -36
- package/cjs/exports.js +1 -21
- package/dist_browser_Core_Container_js.js +6 -16
- package/esm/Core/Canvas.js +3 -3
- package/esm/Core/Container.js +35 -155
- package/esm/Core/Engine.js +32 -78
- package/esm/Core/Particle.js +5 -10
- package/esm/Core/Particles.js +36 -25
- package/esm/Core/Utils/Constants.js +2 -2
- package/esm/Core/Utils/EventListeners.js +5 -250
- package/esm/Options/Classes/Options.js +7 -75
- package/esm/Options/Classes/Particles/ParticlesOptions.js +5 -11
- package/{browser/Options/Classes/Interactivity/Events → esm/Options/Classes}/ResizeEvent.js +1 -1
- package/esm/Utils/ColorUtils.js +7 -5
- package/esm/Utils/Utils.js +33 -36
- package/esm/exports.js +1 -21
- package/package.json +1 -1
- package/report.html +1 -1
- package/tsparticles.engine.js +14 -206
- package/tsparticles.engine.min.js +1 -1
- package/tsparticles.engine.min.js.LICENSE.txt +1 -1
- package/types/Core/Container.d.ts +3 -15
- package/types/Core/Engine.d.ts +8 -19
- package/types/Core/Interfaces/IContainerPlugin.d.ts +8 -1
- package/types/Core/Interfaces/IPlugin.d.ts +5 -1
- package/types/Core/Particle.d.ts +0 -2
- package/types/Core/Particles.d.ts +1 -5
- package/types/Core/Utils/Constants.d.ts +2 -2
- package/types/Core/Utils/EventListeners.d.ts +0 -14
- package/types/Options/Classes/Options.d.ts +2 -11
- package/types/Options/Classes/Particles/ParticlesOptions.d.ts +0 -2
- package/types/Options/Classes/ResizeEvent.d.ts +9 -0
- package/types/Options/Interfaces/IOptions.d.ts +2 -8
- package/types/Options/Interfaces/Particles/IParticlesOptions.d.ts +0 -3
- package/types/Types/EngineInitializers.d.ts +10 -0
- package/types/Utils/Utils.d.ts +4 -6
- package/types/export-types.d.ts +3 -19
- package/types/exports.d.ts +1 -21
- package/umd/Core/Canvas.js +3 -3
- package/umd/Core/Container.js +35 -155
- package/umd/Core/Engine.js +33 -79
- package/umd/Core/Particle.js +6 -11
- package/umd/Core/Particles.js +37 -26
- package/umd/Core/Utils/Constants.js +3 -3
- package/umd/Core/Utils/EventListeners.js +7 -252
- package/umd/Options/Classes/Options.js +7 -75
- package/umd/Options/Classes/Particles/ParticlesOptions.js +5 -11
- package/umd/Options/Classes/{Interactivity/Events/ResizeEvent.js → ResizeEvent.js} +2 -2
- package/umd/Utils/ColorUtils.js +7 -5
- package/umd/Utils/Utils.js +34 -39
- package/umd/exports.js +2 -22
- package/638.min.js +0 -2
- package/638.min.js.LICENSE.txt +0 -1
- package/browser/Core/Interfaces/IMouseData.js +0 -1
- package/browser/Core/Interfaces/IParticlesInteractor.js +0 -1
- package/browser/Core/Utils/ExternalInteractorBase.js +0 -7
- package/browser/Core/Utils/InteractionManager.js +0 -60
- package/browser/Core/Utils/ParticlesInteractorBase.js +0 -7
- package/browser/Enums/InteractivityDetect.js +0 -6
- package/browser/Enums/Modes/ResponsiveMode.js +0 -5
- package/browser/Enums/Modes/ThemeMode.js +0 -6
- package/browser/Enums/Types/DivType.js +0 -5
- package/browser/Enums/Types/InteractorType.js +0 -5
- package/browser/Options/Classes/Interactivity/Events/ClickEvent.js +0 -18
- package/browser/Options/Classes/Interactivity/Events/DivEvent.js +0 -27
- package/browser/Options/Classes/Interactivity/Events/Events.js +0 -30
- package/browser/Options/Classes/Interactivity/Events/HoverEvent.js +0 -21
- package/browser/Options/Classes/Interactivity/Events/Parallax.js +0 -22
- package/browser/Options/Classes/Interactivity/Interactivity.js +0 -22
- package/browser/Options/Classes/Interactivity/Modes/Modes.js +0 -25
- package/browser/Options/Classes/ManualParticle.js +0 -21
- package/browser/Options/Classes/Responsive.js +0 -29
- package/browser/Options/Classes/Theme/Theme.js +0 -21
- package/browser/Options/Classes/Theme/ThemeDefault.js +0 -23
- package/browser/Options/Interfaces/IManualParticle.js +0 -1
- package/browser/Options/Interfaces/IResponsive.js +0 -1
- package/browser/Options/Interfaces/Interactivity/Events/IClickEvent.js +0 -1
- package/browser/Options/Interfaces/Interactivity/Events/IDivEvent.js +0 -1
- package/browser/Options/Interfaces/Interactivity/Events/IEvents.js +0 -1
- package/browser/Options/Interfaces/Interactivity/Events/IHoverEvent.js +0 -1
- package/browser/Options/Interfaces/Interactivity/Events/IParallax.js +0 -1
- package/browser/Options/Interfaces/Interactivity/IInteractivity.js +0 -1
- package/browser/Options/Interfaces/Interactivity/Modes/IModeDiv.js +0 -1
- package/browser/Options/Interfaces/Interactivity/Modes/IModes.js +0 -1
- package/browser/Options/Interfaces/Theme/ITheme.js +0 -1
- package/browser/Options/Interfaces/Theme/IThemeDefault.js +0 -1
- package/cjs/Core/Interfaces/IContainerInteractivity.js +0 -1
- package/cjs/Core/Interfaces/IExternalInteractor.js +0 -1
- package/cjs/Core/Interfaces/IInteractor.js +0 -1
- package/cjs/Core/Interfaces/IMouseData.js +0 -1
- package/cjs/Core/Interfaces/IParticlesInteractor.js +0 -1
- package/cjs/Core/Utils/ExternalInteractorBase.js +0 -7
- package/cjs/Core/Utils/InteractionManager.js +0 -60
- package/cjs/Core/Utils/ParticlesInteractorBase.js +0 -7
- package/cjs/Enums/InteractivityDetect.js +0 -6
- package/cjs/Enums/Modes/ResponsiveMode.js +0 -5
- package/cjs/Enums/Modes/ThemeMode.js +0 -6
- package/cjs/Enums/Types/DivType.js +0 -5
- package/cjs/Enums/Types/InteractorType.js +0 -5
- package/cjs/Options/Classes/Interactivity/Events/ClickEvent.js +0 -18
- package/cjs/Options/Classes/Interactivity/Events/DivEvent.js +0 -27
- package/cjs/Options/Classes/Interactivity/Events/Events.js +0 -30
- package/cjs/Options/Classes/Interactivity/Events/HoverEvent.js +0 -21
- package/cjs/Options/Classes/Interactivity/Events/Parallax.js +0 -22
- package/cjs/Options/Classes/Interactivity/Interactivity.js +0 -22
- package/cjs/Options/Classes/Interactivity/Modes/Modes.js +0 -25
- package/cjs/Options/Classes/ManualParticle.js +0 -21
- package/cjs/Options/Classes/Responsive.js +0 -29
- package/cjs/Options/Classes/Theme/Theme.js +0 -21
- package/cjs/Options/Classes/Theme/ThemeDefault.js +0 -23
- package/cjs/Options/Interfaces/IManualParticle.js +0 -1
- package/cjs/Options/Interfaces/IResponsive.js +0 -1
- package/cjs/Options/Interfaces/Interactivity/Events/IClickEvent.js +0 -1
- package/cjs/Options/Interfaces/Interactivity/Events/IDivEvent.js +0 -1
- package/cjs/Options/Interfaces/Interactivity/Events/IEvents.js +0 -1
- package/cjs/Options/Interfaces/Interactivity/Events/IHoverEvent.js +0 -1
- package/cjs/Options/Interfaces/Interactivity/Events/IParallax.js +0 -1
- package/cjs/Options/Interfaces/Interactivity/IInteractivity.js +0 -1
- package/cjs/Options/Interfaces/Interactivity/Modes/IModeDiv.js +0 -1
- package/cjs/Options/Interfaces/Interactivity/Modes/IModes.js +0 -1
- package/cjs/Options/Interfaces/Theme/ITheme.js +0 -1
- package/cjs/Options/Interfaces/Theme/IThemeDefault.js +0 -1
- package/esm/Core/Interfaces/IContainerInteractivity.js +0 -1
- package/esm/Core/Interfaces/IExternalInteractor.js +0 -1
- package/esm/Core/Interfaces/IInteractor.js +0 -1
- package/esm/Core/Interfaces/IMouseData.js +0 -1
- package/esm/Core/Interfaces/IParticlesInteractor.js +0 -1
- package/esm/Core/Utils/ExternalInteractorBase.js +0 -7
- package/esm/Core/Utils/InteractionManager.js +0 -60
- package/esm/Core/Utils/ParticlesInteractorBase.js +0 -7
- package/esm/Enums/InteractivityDetect.js +0 -6
- package/esm/Enums/Modes/ResponsiveMode.js +0 -5
- package/esm/Enums/Modes/ThemeMode.js +0 -6
- package/esm/Enums/Types/DivType.js +0 -5
- package/esm/Enums/Types/InteractorType.js +0 -5
- package/esm/Options/Classes/Interactivity/Events/ClickEvent.js +0 -18
- package/esm/Options/Classes/Interactivity/Events/DivEvent.js +0 -27
- package/esm/Options/Classes/Interactivity/Events/Events.js +0 -30
- package/esm/Options/Classes/Interactivity/Events/HoverEvent.js +0 -21
- package/esm/Options/Classes/Interactivity/Events/Parallax.js +0 -22
- package/esm/Options/Classes/Interactivity/Interactivity.js +0 -22
- package/esm/Options/Classes/Interactivity/Modes/Modes.js +0 -25
- package/esm/Options/Classes/ManualParticle.js +0 -21
- package/esm/Options/Classes/Responsive.js +0 -29
- package/esm/Options/Classes/Theme/Theme.js +0 -21
- package/esm/Options/Classes/Theme/ThemeDefault.js +0 -23
- package/esm/Options/Interfaces/IManualParticle.js +0 -1
- package/esm/Options/Interfaces/IResponsive.js +0 -1
- package/esm/Options/Interfaces/Interactivity/Events/IClickEvent.js +0 -1
- package/esm/Options/Interfaces/Interactivity/Events/IDivEvent.js +0 -1
- package/esm/Options/Interfaces/Interactivity/Events/IEvents.js +0 -1
- package/esm/Options/Interfaces/Interactivity/Events/IHoverEvent.js +0 -1
- package/esm/Options/Interfaces/Interactivity/Events/IParallax.js +0 -1
- package/esm/Options/Interfaces/Interactivity/IInteractivity.js +0 -1
- package/esm/Options/Interfaces/Interactivity/Modes/IModeDiv.js +0 -1
- package/esm/Options/Interfaces/Interactivity/Modes/IModes.js +0 -1
- package/esm/Options/Interfaces/Theme/ITheme.js +0 -1
- package/esm/Options/Interfaces/Theme/IThemeDefault.js +0 -1
- package/types/Core/Interfaces/IContainerInteractivity.d.ts +0 -6
- package/types/Core/Interfaces/IExternalInteractor.d.ts +0 -12
- package/types/Core/Interfaces/IInteractor.d.ts +0 -16
- package/types/Core/Interfaces/IMouseData.d.ts +0 -9
- package/types/Core/Interfaces/IParticlesInteractor.d.ts +0 -7
- package/types/Core/Utils/ExternalInteractorBase.d.ts +0 -15
- package/types/Core/Utils/InteractionManager.d.ts +0 -17
- package/types/Core/Utils/ParticlesInteractorBase.d.ts +0 -15
- package/types/Enums/InteractivityDetect.d.ts +0 -5
- package/types/Enums/Modes/ResponsiveMode.d.ts +0 -4
- package/types/Enums/Modes/ThemeMode.d.ts +0 -5
- package/types/Enums/Types/DivType.d.ts +0 -4
- package/types/Enums/Types/InteractorType.d.ts +0 -4
- package/types/Options/Classes/Interactivity/Events/ClickEvent.d.ts +0 -10
- package/types/Options/Classes/Interactivity/Events/DivEvent.d.ts +0 -13
- package/types/Options/Classes/Interactivity/Events/Events.d.ts +0 -16
- package/types/Options/Classes/Interactivity/Events/HoverEvent.d.ts +0 -12
- package/types/Options/Classes/Interactivity/Events/Parallax.d.ts +0 -10
- package/types/Options/Classes/Interactivity/Events/ResizeEvent.d.ts +0 -9
- package/types/Options/Classes/Interactivity/Interactivity.d.ts +0 -16
- package/types/Options/Classes/Interactivity/Modes/Modes.d.ts +0 -12
- package/types/Options/Classes/ManualParticle.d.ts +0 -10
- package/types/Options/Classes/Responsive.d.ts +0 -12
- package/types/Options/Classes/Theme/Theme.d.ts +0 -12
- package/types/Options/Classes/Theme/ThemeDefault.d.ts +0 -11
- package/types/Options/Interfaces/IManualParticle.d.ts +0 -7
- package/types/Options/Interfaces/IResponsive.d.ts +0 -7
- package/types/Options/Interfaces/Interactivity/Events/IClickEvent.d.ts +0 -5
- package/types/Options/Interfaces/Interactivity/Events/IDivEvent.d.ts +0 -8
- package/types/Options/Interfaces/Interactivity/Events/IEvents.d.ts +0 -11
- package/types/Options/Interfaces/Interactivity/Events/IHoverEvent.d.ts +0 -7
- package/types/Options/Interfaces/Interactivity/Events/IParallax.d.ts +0 -5
- package/types/Options/Interfaces/Interactivity/IInteractivity.d.ts +0 -9
- package/types/Options/Interfaces/Interactivity/Modes/IModeDiv.d.ts +0 -4
- package/types/Options/Interfaces/Interactivity/Modes/IModes.d.ts +0 -1
- package/types/Options/Interfaces/Theme/ITheme.d.ts +0 -7
- package/types/Options/Interfaces/Theme/IThemeDefault.d.ts +0 -6
- package/umd/Core/Interfaces/IExternalInteractor.js +0 -12
- package/umd/Core/Interfaces/IInteractor.js +0 -12
- package/umd/Core/Interfaces/IMouseData.js +0 -12
- package/umd/Core/Interfaces/IParticlesInteractor.js +0 -12
- package/umd/Core/Utils/ExternalInteractorBase.js +0 -21
- package/umd/Core/Utils/InteractionManager.js +0 -74
- package/umd/Core/Utils/ParticlesInteractorBase.js +0 -21
- package/umd/Enums/InteractivityDetect.js +0 -19
- package/umd/Enums/Modes/ResponsiveMode.js +0 -18
- package/umd/Enums/Modes/ThemeMode.js +0 -19
- package/umd/Enums/Types/DivType.js +0 -18
- package/umd/Enums/Types/InteractorType.js +0 -18
- package/umd/Options/Classes/Interactivity/Events/ClickEvent.js +0 -32
- package/umd/Options/Classes/Interactivity/Events/DivEvent.js +0 -41
- package/umd/Options/Classes/Interactivity/Events/Events.js +0 -44
- package/umd/Options/Classes/Interactivity/Events/HoverEvent.js +0 -35
- package/umd/Options/Classes/Interactivity/Events/Parallax.js +0 -36
- package/umd/Options/Classes/Interactivity/Interactivity.js +0 -36
- package/umd/Options/Classes/Interactivity/Modes/Modes.js +0 -39
- package/umd/Options/Classes/ManualParticle.js +0 -35
- package/umd/Options/Classes/Responsive.js +0 -43
- package/umd/Options/Classes/Theme/Theme.js +0 -35
- package/umd/Options/Classes/Theme/ThemeDefault.js +0 -37
- package/umd/Options/Interfaces/IManualParticle.js +0 -12
- package/umd/Options/Interfaces/IResponsive.js +0 -12
- package/umd/Options/Interfaces/Interactivity/Events/IClickEvent.js +0 -12
- package/umd/Options/Interfaces/Interactivity/Events/IDivEvent.js +0 -12
- package/umd/Options/Interfaces/Interactivity/Events/IEvents.js +0 -12
- package/umd/Options/Interfaces/Interactivity/Events/IHoverEvent.js +0 -12
- package/umd/Options/Interfaces/Interactivity/Events/IParallax.js +0 -12
- package/umd/Options/Interfaces/Interactivity/IInteractivity.js +0 -12
- package/umd/Options/Interfaces/Interactivity/Modes/IModeDiv.js +0 -12
- package/umd/Options/Interfaces/Interactivity/Modes/IModes.js +0 -12
- package/umd/Options/Interfaces/Theme/ITheme.js +0 -12
- package/umd/Options/Interfaces/Theme/IThemeDefault.js +0 -12
- /package/browser/Options/Interfaces/{Interactivity/Events/IResizeEvent.js → IResizeEvent.js} +0 -0
- /package/browser/{Core/Interfaces/IContainerInteractivity.js → Types/EngineInitializers.js} +0 -0
- /package/cjs/Options/Interfaces/{Interactivity/Events/IResizeEvent.js → IResizeEvent.js} +0 -0
- /package/{browser/Core/Interfaces/IExternalInteractor.js → cjs/Types/EngineInitializers.js} +0 -0
- /package/esm/Options/Interfaces/{Interactivity/Events/IResizeEvent.js → IResizeEvent.js} +0 -0
- /package/{browser/Core/Interfaces/IInteractor.js → esm/Types/EngineInitializers.js} +0 -0
- /package/types/Options/Interfaces/{Interactivity/Events/IResizeEvent.d.ts → IResizeEvent.d.ts} +0 -0
- /package/umd/Options/Interfaces/{Interactivity/Events/IResizeEvent.js → IResizeEvent.js} +0 -0
- /package/umd/{Core/Interfaces/IContainerInteractivity.js → Types/EngineInitializers.js} +0 -0
package/esm/Utils/Utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { clamp, collisionVelocity, getDistances, getRandom, getRangeMax, getRangeMin, getRangeValue, randomInRangeValue, } from "./MathUtils.js";
|
|
2
2
|
import { half, millisecondsToSeconds, percentDenominator } from "../Core/Utils/Constants.js";
|
|
3
|
-
import { isArray, isNull, isObject } from "./TypeUtils.js";
|
|
3
|
+
import { isArray, isBoolean, isNull, isObject } from "./TypeUtils.js";
|
|
4
4
|
import { AnimationMode } from "../Enums/Modes/AnimationMode.js";
|
|
5
5
|
import { AnimationStatus } from "../Enums/AnimationStatus.js";
|
|
6
6
|
import { DestroyType } from "../Enums/Types/DestroyType.js";
|
|
@@ -21,12 +21,6 @@ function memoize(fn) {
|
|
|
21
21
|
return result;
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
function checkSelector(element, selectors) {
|
|
25
|
-
const res = executeOnSingleOrMultiple(selectors, selector => {
|
|
26
|
-
return element.matches(selector);
|
|
27
|
-
});
|
|
28
|
-
return isArray(res) ? res.some(t => t) : res;
|
|
29
|
-
}
|
|
30
24
|
export function hasMatchMedia() {
|
|
31
25
|
return typeof matchMedia !== "undefined";
|
|
32
26
|
}
|
|
@@ -104,11 +98,15 @@ export function deepExtend(destination, ...sources) {
|
|
|
104
98
|
continue;
|
|
105
99
|
}
|
|
106
100
|
const sourceIsArray = Array.isArray(source);
|
|
107
|
-
if (sourceIsArray
|
|
108
|
-
destination
|
|
101
|
+
if (sourceIsArray) {
|
|
102
|
+
if (!Array.isArray(destination)) {
|
|
103
|
+
destination = [];
|
|
104
|
+
}
|
|
109
105
|
}
|
|
110
|
-
else
|
|
111
|
-
destination
|
|
106
|
+
else {
|
|
107
|
+
if (!isObject(destination) || Array.isArray(destination)) {
|
|
108
|
+
destination = {};
|
|
109
|
+
}
|
|
112
110
|
}
|
|
113
111
|
for (const key in source) {
|
|
114
112
|
if (key === "__proto__") {
|
|
@@ -123,31 +121,6 @@ export function deepExtend(destination, ...sources) {
|
|
|
123
121
|
}
|
|
124
122
|
return destination;
|
|
125
123
|
}
|
|
126
|
-
export function isDivModeEnabled(mode, divs) {
|
|
127
|
-
return !!findItemFromSingleOrMultiple(divs, t => t.enable && isInArray(mode, t.mode));
|
|
128
|
-
}
|
|
129
|
-
export function divModeExecute(mode, divs, callback) {
|
|
130
|
-
executeOnSingleOrMultiple(divs, div => {
|
|
131
|
-
const divMode = div.mode, divEnabled = div.enable;
|
|
132
|
-
if (divEnabled && isInArray(mode, divMode)) {
|
|
133
|
-
singleDivModeExecute(div, callback);
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
export function singleDivModeExecute(div, callback) {
|
|
138
|
-
const selectors = div.selectors;
|
|
139
|
-
executeOnSingleOrMultiple(selectors, selector => {
|
|
140
|
-
callback(selector, div);
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
export function divMode(divs, element) {
|
|
144
|
-
if (!element || !divs) {
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
return findItemFromSingleOrMultiple(divs, div => {
|
|
148
|
-
return checkSelector(element, div.selectors);
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
124
|
export function circleBounceDataFromParticle(p) {
|
|
152
125
|
return {
|
|
153
126
|
position: p.getPosition(),
|
|
@@ -368,3 +341,27 @@ function computeFullScreenStyle(zIndex) {
|
|
|
368
341
|
return fullScreenStyle;
|
|
369
342
|
}
|
|
370
343
|
export const getFullScreenStyle = memoize(computeFullScreenStyle);
|
|
344
|
+
export function manageListener(element, event, handler, add, options) {
|
|
345
|
+
if (add) {
|
|
346
|
+
let addOptions = { passive: true };
|
|
347
|
+
if (isBoolean(options)) {
|
|
348
|
+
addOptions.capture = options;
|
|
349
|
+
}
|
|
350
|
+
else if (options !== undefined) {
|
|
351
|
+
addOptions = options;
|
|
352
|
+
}
|
|
353
|
+
element.addEventListener(event, handler, addOptions);
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
const removeOptions = options;
|
|
357
|
+
element.removeEventListener(event, handler, removeOptions);
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
export async function getItemsFromInitializer(container, map, initializers, force = false) {
|
|
361
|
+
let res = map.get(container);
|
|
362
|
+
if (!res || force) {
|
|
363
|
+
res = await Promise.all([...initializers.values()].map(t => t(container)));
|
|
364
|
+
map.set(container, res);
|
|
365
|
+
}
|
|
366
|
+
return res;
|
|
367
|
+
}
|
package/esm/exports.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
export * from "./Core/Utils/Constants.js";
|
|
2
|
-
export * from "./Core/Utils/ExternalInteractorBase.js";
|
|
3
|
-
export * from "./Core/Utils/ParticlesInteractorBase.js";
|
|
4
2
|
export * from "./Core/Utils/Point.js";
|
|
5
3
|
export * from "./Core/Utils/Ranges.js";
|
|
6
4
|
export * from "./Core/Utils/Vectors.js";
|
|
@@ -11,36 +9,20 @@ export * from "./Enums/Modes/AnimationMode.js";
|
|
|
11
9
|
export * from "./Enums/Modes/LimitMode.js";
|
|
12
10
|
export * from "./Enums/Modes/OutMode.js";
|
|
13
11
|
export * from "./Enums/Modes/PixelMode.js";
|
|
14
|
-
export * from "./Enums/Modes/ThemeMode.js";
|
|
15
|
-
export * from "./Enums/Modes/ResponsiveMode.js";
|
|
16
12
|
export * from "./Enums/Types/AlterType.js";
|
|
17
13
|
export * from "./Enums/Types/DestroyType.js";
|
|
18
14
|
export * from "./Enums/Types/GradientType.js";
|
|
19
|
-
export * from "./Enums/Types/InteractorType.js";
|
|
20
15
|
export * from "./Enums/Types/ParticleOutType.js";
|
|
21
16
|
export * from "./Enums/Types/StartValueType.js";
|
|
22
|
-
export * from "./Enums/Types/DivType.js";
|
|
23
17
|
export * from "./Enums/Types/EasingType.js";
|
|
24
18
|
export * from "./Enums/Types/EventType.js";
|
|
25
19
|
export * from "./Enums/AnimationStatus.js";
|
|
26
|
-
export * from "./Enums/InteractivityDetect.js";
|
|
27
20
|
export * from "./Options/Classes/AnimatableColor.js";
|
|
28
21
|
export * from "./Options/Classes/AnimationOptions.js";
|
|
29
22
|
export * from "./Options/Classes/Background/Background.js";
|
|
30
23
|
export * from "./Options/Classes/ColorAnimation.js";
|
|
31
24
|
export * from "./Options/Classes/FullScreen/FullScreen.js";
|
|
32
25
|
export * from "./Options/Classes/HslAnimation.js";
|
|
33
|
-
export * from "./Options/Classes/Interactivity/Events/ClickEvent.js";
|
|
34
|
-
export * from "./Options/Classes/Interactivity/Events/DivEvent.js";
|
|
35
|
-
export * from "./Options/Classes/Interactivity/Events/ClickEvent.js";
|
|
36
|
-
export * from "./Options/Classes/Interactivity/Events/DivEvent.js";
|
|
37
|
-
export * from "./Options/Classes/Interactivity/Events/Events.js";
|
|
38
|
-
export * from "./Options/Classes/Interactivity/Events/HoverEvent.js";
|
|
39
|
-
export * from "./Options/Classes/Interactivity/Events/Parallax.js";
|
|
40
|
-
export * from "./Options/Classes/Interactivity/Events/ResizeEvent.js";
|
|
41
|
-
export * from "./Options/Classes/Interactivity/Interactivity.js";
|
|
42
|
-
export * from "./Options/Classes/Interactivity/Modes/Modes.js";
|
|
43
|
-
export * from "./Options/Classes/ManualParticle.js";
|
|
44
26
|
export * from "./Options/Classes/Options.js";
|
|
45
27
|
export * from "./Options/Classes/OptionsColor.js";
|
|
46
28
|
export * from "./Options/Classes/Particles/Bounce/ParticlesBounce.js";
|
|
@@ -64,9 +46,7 @@ export * from "./Options/Classes/Particles/Shape/Shape.js";
|
|
|
64
46
|
export * from "./Options/Classes/Particles/Size/Size.js";
|
|
65
47
|
export * from "./Options/Classes/Particles/Size/SizeAnimation.js";
|
|
66
48
|
export * from "./Options/Classes/Particles/ZIndex/ZIndex.js";
|
|
67
|
-
export * from "./Options/Classes/
|
|
68
|
-
export * from "./Options/Classes/Theme/Theme.js";
|
|
69
|
-
export * from "./Options/Classes/Theme/ThemeDefault.js";
|
|
49
|
+
export * from "./Options/Classes/ResizeEvent.js";
|
|
70
50
|
export * from "./Options/Classes/ValueWithRandom.js";
|
|
71
51
|
export * from "./Utils/CanvasUtils.js";
|
|
72
52
|
export * from "./Utils/ColorUtils.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/engine",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.5",
|
|
4
4
|
"description": "Easily create highly customizable particle, confetti and fireworks animations and use them as animated backgrounds for your website. Ready to use components available also for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, Inferno.",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"scripts": {
|
package/report.html
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8"/>
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
6
|
-
<title>@tsparticles/engine [
|
|
6
|
+
<title>@tsparticles/engine [21 Jan 2026 at 18:49]</title>
|
|
7
7
|
<link rel="shortcut icon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAABrVBMVEUAAAD///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////+O1foceMD///+J0/qK1Pr7/v8Xdr/9///W8P4UdL7L7P0Scr2r4Pyj3vwad8D5/f/2/f+55f3E6f34+/2H0/ojfMKpzOd0rNgQcb3F3O/j9f7c8v6g3Pz0/P/w+v/q+P7n9v6T1/uQ1vuE0vqLut/y+v+Z2fvt+f+15Pzv9fuc2/vR7v2V2Pvd6/bg9P7I6/285/2y4/yp3/zp8vk8i8kqgMT7/P31+fyv4vxGkcz6/P6/6P3j7vfS5PNnpNUxhcbO7f7F6v3O4vHK3/DA2u631Ouy0eqXweKJud5wqthfoNMMbLvY8f73+v2dxeR8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