@tsparticles/interaction-external-trail 4.0.0-beta.0 → 4.0.0-beta.10
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/704.min.js +1 -0
- package/README.md +38 -0
- package/browser/TrailMaker.js +16 -10
- package/browser/index.js +4 -4
- package/cjs/TrailMaker.js +16 -10
- package/cjs/index.js +4 -4
- package/dist_browser_TrailMaker_js.js +2 -2
- package/esm/TrailMaker.js +16 -10
- package/esm/index.js +4 -4
- package/package.json +10 -7
- package/report.html +84 -29
- package/tsparticles.interaction.external.trail.js +2 -2
- package/tsparticles.interaction.external.trail.min.js +2 -2
- package/types/TrailMaker.d.ts +3 -3
- package/983.min.js +0 -1
- package/umd/Options/Classes/Trail.js +0 -49
- package/umd/Options/Classes/TrailColorComponent.js +0 -35
- package/umd/Options/Classes/TrailColorCoords.js +0 -42
- package/umd/Options/Classes/TrailColorWeight.js +0 -33
- package/umd/Options/Classes/TrailOptions.js +0 -12
- package/umd/Options/Interfaces/ITrail.js +0 -12
- package/umd/Options/Interfaces/ITrailColorComponent.js +0 -12
- package/umd/Options/Interfaces/ITrailColorCoords.js +0 -12
- package/umd/Options/Interfaces/ITrailColorWeight.js +0 -12
- package/umd/TrailMaker.js +0 -102
- package/umd/Types.js +0 -12
- package/umd/index.js +0 -62
package/704.min.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(this.webpackChunk_tsparticles_interaction_external_trail=this.webpackChunk_tsparticles_interaction_external_trail||[]).push([[704],{704(t,i,e){e.d(i,{TrailMaker:()=>r});var a=e(303),s=e(702),l=e(398);let n="trail";class r extends s.ExternalInteractorBase{maxDistance=0;_delay;_lastPosition;_pluginManager;constructor(t,i){super(i),this._pluginManager=t,this._delay=0}clear(){}init(){}interact(t,i){let e=this.container;if(!e.retina.reduceFactor)return;let s=e.actualOptions,l=s.interactivity?.modes.trail;if(!l)return;let n=l.delay*a.millisecondsToSeconds/this.container.retina.reduceFactor;if(this._delay<n&&(this._delay+=i.value),this._delay<n)return;let r=t.mouse.position,o=!(l.pauseOnStop&&(r===this._lastPosition||r?.x===this._lastPosition?.x&&r?.y===this._lastPosition?.y));if(r?this._lastPosition={...r}:delete this._lastPosition,o&&r){let t=l.particles,i=l.colorCoords;if(i){let{width:s,height:n}=e.canvas.size,o={x:r.x/s,y:r.y/n},c=(t,i,e)=>{if(!(t?.weights?.x??t?.weights?.y))return;let s=t?.weights,l=o.x*(s?.x??0)+o.y*(s?.y??0),n=t?.value??i,r=(0,a.getRangeMin)(n??0),c=(0,a.getRangeMax)(n??e);return Math.min(c,Math.max(r,r+l*(c-r)))},d=l.particles?.paint?(0,a.itemFromSingleOrMultiple)(l.particles.paint):void 0,h=d?.fill,p=h?(0,a.rangeColorToHsl)(this._pluginManager,a.AnimatableColor.create(void 0,h.color)):void 0,u=c(i.h,p?.h,a.hMax),_=c(i.s,p?.s,a.sMax),y=c(i.l,p?.l,a.lMax);(void 0!==u||void 0!==_||void 0!==y)&&(t=(0,a.deepExtend)({},l.particles,{paint:{fill:{color:{value:{h:u??p?.h,s:_??p?.s,l:y??p?.l}}}}}))}e.particles.push(l.quantity,r,t)}this._delay-=n}isEnabled(t,i){let e=this.container.actualOptions,s=t.mouse,l=(i?.interactivity??e.interactivity)?.events;return!!l&&(s.clicking&&s.inside&&!!s.position&&(0,a.isInArray)(n,l.onClick.mode)||s.inside&&!!s.position&&(0,a.isInArray)(n,l.onHover.mode))}loadModeOptions(t,...i){for(let e of(t.trail??=new l.X,i))t.trail.load(e?.trail)}reset(){}}}}]);
|
package/README.md
CHANGED
|
@@ -9,6 +9,12 @@
|
|
|
9
9
|
[tsParticles](https://github.com/tsparticles/tsparticles) interaction plugin for trail effect around mouse or HTML
|
|
10
10
|
elements.
|
|
11
11
|
|
|
12
|
+
## Quick checklist
|
|
13
|
+
|
|
14
|
+
1. Install `@tsparticles/engine` (or use the CDN bundle below)
|
|
15
|
+
2. Call the package loader function(s) before `tsParticles.load(...)`
|
|
16
|
+
3. Apply the package options in your `tsParticles.load(...)` config
|
|
17
|
+
|
|
12
18
|
## How to use it
|
|
13
19
|
|
|
14
20
|
### CDN / Vanilla JS / jQuery
|
|
@@ -79,3 +85,35 @@ import { loadExternalTrailInteraction } from "@tsparticles/interaction-external-
|
|
|
79
85
|
await loadExternalTrailInteraction(tsParticles);
|
|
80
86
|
})();
|
|
81
87
|
```
|
|
88
|
+
|
|
89
|
+
## Option mapping
|
|
90
|
+
|
|
91
|
+
- Event mode key: `interactivity.events.onHover.mode` or `interactivity.events.onClick.mode` with value `"trail"`
|
|
92
|
+
- Mode options key: `interactivity.modes.trail`
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"interactivity": {
|
|
97
|
+
"events": {
|
|
98
|
+
"onHover": {
|
|
99
|
+
"enable": true,
|
|
100
|
+
"mode": "trail"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"modes": {
|
|
104
|
+
"trail": {}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Common pitfalls
|
|
111
|
+
|
|
112
|
+
- Calling `tsParticles.load(...)` before `loadInteractivityPlugin(...)`
|
|
113
|
+
- Verify required peer packages before enabling advanced options
|
|
114
|
+
- Change one option group at a time to isolate regressions quickly
|
|
115
|
+
|
|
116
|
+
## Related docs
|
|
117
|
+
|
|
118
|
+
- All packages catalog: <https://github.com/tsparticles/tsparticles>
|
|
119
|
+
- Main docs: <https://particles.js.org/docs/>
|
package/browser/TrailMaker.js
CHANGED
|
@@ -5,11 +5,11 @@ const trailMode = "trail", defaultMin = 0, defaultWeight = 0;
|
|
|
5
5
|
export class TrailMaker extends ExternalInteractorBase {
|
|
6
6
|
maxDistance = 0;
|
|
7
7
|
_delay;
|
|
8
|
-
_engine;
|
|
9
8
|
_lastPosition;
|
|
10
|
-
|
|
9
|
+
_pluginManager;
|
|
10
|
+
constructor(pluginManager, container) {
|
|
11
11
|
super(container);
|
|
12
|
-
this.
|
|
12
|
+
this._pluginManager = pluginManager;
|
|
13
13
|
this._delay = 0;
|
|
14
14
|
}
|
|
15
15
|
clear() {
|
|
@@ -52,16 +52,22 @@ export class TrailMaker extends ExternalInteractorBase {
|
|
|
52
52
|
return undefined;
|
|
53
53
|
const w = comp?.weights, factor = norm.x * (w?.x ?? defaultWeight) + norm.y * (w?.y ?? defaultWeight), rangeSource = comp?.value ?? originalValue, min = getRangeMin(rangeSource ?? defaultMin), max = getRangeMax(rangeSource ?? defaultMax), result = min + factor * (max - min);
|
|
54
54
|
return Math.min(max, Math.max(min, result));
|
|
55
|
-
},
|
|
56
|
-
?
|
|
55
|
+
}, trailPaintOptions = trailOptions.particles?.paint
|
|
56
|
+
? itemFromSingleOrMultiple(trailOptions.particles.paint)
|
|
57
|
+
: undefined, fillData = trailPaintOptions?.fill, baseHsl = fillData
|
|
58
|
+
? rangeColorToHsl(this._pluginManager, AnimatableColor.create(undefined, fillData.color))
|
|
57
59
|
: undefined, h = calculateValue(colorCoords.h, baseHsl?.h, hMax), s = calculateValue(colorCoords.s, baseHsl?.s, sMax), l = calculateValue(colorCoords.l, baseHsl?.l, lMax);
|
|
58
60
|
if (h !== undefined || s !== undefined || l !== undefined) {
|
|
59
61
|
particleOptions = deepExtend({}, trailOptions.particles, {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
paint: {
|
|
63
|
+
fill: {
|
|
64
|
+
color: {
|
|
65
|
+
value: {
|
|
66
|
+
h: h ?? baseHsl?.h,
|
|
67
|
+
s: s ?? baseHsl?.s,
|
|
68
|
+
l: l ?? baseHsl?.l,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
65
71
|
},
|
|
66
72
|
},
|
|
67
73
|
});
|
package/browser/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export async function loadExternalTrailInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(async (e) => {
|
|
2
|
+
engine.checkVersion("4.0.0-beta.10");
|
|
3
|
+
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
|
|
5
5
|
ensureInteractivityPluginLoaded(e);
|
|
6
|
-
e.addInteractor?.("externalTrail", async (container) => {
|
|
6
|
+
e.pluginManager.addInteractor?.("externalTrail", async (container) => {
|
|
7
7
|
const { TrailMaker } = await import("./TrailMaker.js");
|
|
8
|
-
return new TrailMaker(e, container);
|
|
8
|
+
return new TrailMaker(e.pluginManager, container);
|
|
9
9
|
});
|
|
10
10
|
});
|
|
11
11
|
}
|
package/cjs/TrailMaker.js
CHANGED
|
@@ -5,11 +5,11 @@ const trailMode = "trail", defaultMin = 0, defaultWeight = 0;
|
|
|
5
5
|
export class TrailMaker extends ExternalInteractorBase {
|
|
6
6
|
maxDistance = 0;
|
|
7
7
|
_delay;
|
|
8
|
-
_engine;
|
|
9
8
|
_lastPosition;
|
|
10
|
-
|
|
9
|
+
_pluginManager;
|
|
10
|
+
constructor(pluginManager, container) {
|
|
11
11
|
super(container);
|
|
12
|
-
this.
|
|
12
|
+
this._pluginManager = pluginManager;
|
|
13
13
|
this._delay = 0;
|
|
14
14
|
}
|
|
15
15
|
clear() {
|
|
@@ -52,16 +52,22 @@ export class TrailMaker extends ExternalInteractorBase {
|
|
|
52
52
|
return undefined;
|
|
53
53
|
const w = comp?.weights, factor = norm.x * (w?.x ?? defaultWeight) + norm.y * (w?.y ?? defaultWeight), rangeSource = comp?.value ?? originalValue, min = getRangeMin(rangeSource ?? defaultMin), max = getRangeMax(rangeSource ?? defaultMax), result = min + factor * (max - min);
|
|
54
54
|
return Math.min(max, Math.max(min, result));
|
|
55
|
-
},
|
|
56
|
-
?
|
|
55
|
+
}, trailPaintOptions = trailOptions.particles?.paint
|
|
56
|
+
? itemFromSingleOrMultiple(trailOptions.particles.paint)
|
|
57
|
+
: undefined, fillData = trailPaintOptions?.fill, baseHsl = fillData
|
|
58
|
+
? rangeColorToHsl(this._pluginManager, AnimatableColor.create(undefined, fillData.color))
|
|
57
59
|
: undefined, h = calculateValue(colorCoords.h, baseHsl?.h, hMax), s = calculateValue(colorCoords.s, baseHsl?.s, sMax), l = calculateValue(colorCoords.l, baseHsl?.l, lMax);
|
|
58
60
|
if (h !== undefined || s !== undefined || l !== undefined) {
|
|
59
61
|
particleOptions = deepExtend({}, trailOptions.particles, {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
paint: {
|
|
63
|
+
fill: {
|
|
64
|
+
color: {
|
|
65
|
+
value: {
|
|
66
|
+
h: h ?? baseHsl?.h,
|
|
67
|
+
s: s ?? baseHsl?.s,
|
|
68
|
+
l: l ?? baseHsl?.l,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
65
71
|
},
|
|
66
72
|
},
|
|
67
73
|
});
|
package/cjs/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export async function loadExternalTrailInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(async (e) => {
|
|
2
|
+
engine.checkVersion("4.0.0-beta.10");
|
|
3
|
+
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
|
|
5
5
|
ensureInteractivityPluginLoaded(e);
|
|
6
|
-
e.addInteractor?.("externalTrail", async (container) => {
|
|
6
|
+
e.pluginManager.addInteractor?.("externalTrail", async (container) => {
|
|
7
7
|
const { TrailMaker } = await import("./TrailMaker.js");
|
|
8
|
-
return new TrailMaker(e, container);
|
|
8
|
+
return new TrailMaker(e.pluginManager, container);
|
|
9
9
|
});
|
|
10
10
|
});
|
|
11
11
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Demo / Generator : https://particles.js.org/
|
|
5
5
|
* GitHub : https://www.github.com/matteobruni/tsparticles
|
|
6
6
|
* How to use? : Check the GitHub README
|
|
7
|
-
* v4.0.0-beta.
|
|
7
|
+
* v4.0.0-beta.10
|
|
8
8
|
*/
|
|
9
9
|
"use strict";
|
|
10
10
|
/*
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
\************************************/
|
|
24
24
|
(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
|
25
25
|
|
|
26
|
-
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TrailMaker: () => (/* binding */ TrailMaker)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\");\n/* harmony import */ var _Options_Classes_Trail_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/Trail.js */ \"./dist/browser/Options/Classes/Trail.js\");\n\n\n\nconst trailMode = \"trail\", defaultMin = 0, defaultWeight = 0;\nclass TrailMaker extends _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_1__.ExternalInteractorBase {\n maxDistance = 0;\n _delay;\n
|
|
26
|
+
eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TrailMaker: () => (/* binding */ TrailMaker)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\");\n/* harmony import */ var _Options_Classes_Trail_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/Trail.js */ \"./dist/browser/Options/Classes/Trail.js\");\n\n\n\nconst trailMode = \"trail\", defaultMin = 0, defaultWeight = 0;\nclass TrailMaker extends _tsparticles_plugin_interactivity__WEBPACK_IMPORTED_MODULE_1__.ExternalInteractorBase {\n maxDistance = 0;\n _delay;\n _lastPosition;\n _pluginManager;\n constructor(pluginManager, container){\n super(container);\n this._pluginManager = pluginManager;\n this._delay = 0;\n }\n clear() {}\n init() {}\n interact(interactivityData, delta) {\n const container = this.container;\n if (!container.retina.reduceFactor) return;\n const options = container.actualOptions, trailOptions = options.interactivity?.modes.trail;\n if (!trailOptions) return;\n const optDelay = trailOptions.delay * _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds / this.container.retina.reduceFactor;\n if (this._delay < optDelay) {\n this._delay += delta.value;\n }\n if (this._delay < optDelay) return;\n const mousePos = interactivityData.mouse.position, canEmit = !(trailOptions.pauseOnStop && (mousePos === this._lastPosition || mousePos?.x === this._lastPosition?.x && mousePos?.y === this._lastPosition?.y));\n if (mousePos) {\n this._lastPosition = {\n ...mousePos\n };\n } else {\n delete this._lastPosition;\n }\n if (canEmit && mousePos) {\n let particleOptions = trailOptions.particles;\n const colorCoords = trailOptions.colorCoords;\n if (colorCoords) {\n const { width, height } = container.canvas.size, norm = {\n x: mousePos.x / width,\n y: mousePos.y / height\n }, hasWeights = (comp)=>{\n return !!(comp?.weights?.x ?? comp?.weights?.y);\n }, calculateValue = (comp, originalValue, defaultMax)=>{\n if (!hasWeights(comp)) return undefined;\n const w = comp?.weights, factor = norm.x * (w?.x ?? defaultWeight) + norm.y * (w?.y ?? defaultWeight), rangeSource = comp?.value ?? originalValue, min = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMin)(rangeSource ?? defaultMin), max = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMax)(rangeSource ?? defaultMax), result = min + factor * (max - min);\n return Math.min(max, Math.max(min, result));\n }, trailPaintOptions = trailOptions.particles?.paint ? (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(trailOptions.particles.paint) : undefined, fillData = trailPaintOptions?.fill, baseHsl = fillData ? (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToHsl)(this._pluginManager, _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.AnimatableColor.create(undefined, fillData.color)) : undefined, h = calculateValue(colorCoords.h, baseHsl?.h, _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.hMax), s = calculateValue(colorCoords.s, baseHsl?.s, _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.sMax), l = calculateValue(colorCoords.l, baseHsl?.l, _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.lMax);\n if (h !== undefined || s !== undefined || l !== undefined) {\n particleOptions = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.deepExtend)({}, trailOptions.particles, {\n paint: {\n fill: {\n color: {\n value: {\n h: h ?? baseHsl?.h,\n s: s ?? baseHsl?.s,\n l: l ?? baseHsl?.l\n }\n }\n }\n }\n });\n }\n }\n container.particles.push(trailOptions.quantity, mousePos, particleOptions);\n }\n this._delay -= optDelay;\n }\n isEnabled(interactivityData, particle) {\n const container = this.container, options = container.actualOptions, mouse = interactivityData.mouse, events = (particle?.interactivity ?? options.interactivity)?.events;\n return !!events && (mouse.clicking && mouse.inside && !!mouse.position && (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isInArray)(trailMode, events.onClick.mode) || mouse.inside && !!mouse.position && (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isInArray)(trailMode, events.onHover.mode));\n }\n loadModeOptions(options, ...sources) {\n options.trail ??= new _Options_Classes_Trail_js__WEBPACK_IMPORTED_MODULE_2__.Trail();\n for (const source of sources){\n options.trail.load(source?.trail);\n }\n }\n reset() {}\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-trail/./dist/browser/TrailMaker.js?\n}");
|
|
27
27
|
|
|
28
28
|
/***/ }
|
|
29
29
|
|
package/esm/TrailMaker.js
CHANGED
|
@@ -5,11 +5,11 @@ const trailMode = "trail", defaultMin = 0, defaultWeight = 0;
|
|
|
5
5
|
export class TrailMaker extends ExternalInteractorBase {
|
|
6
6
|
maxDistance = 0;
|
|
7
7
|
_delay;
|
|
8
|
-
_engine;
|
|
9
8
|
_lastPosition;
|
|
10
|
-
|
|
9
|
+
_pluginManager;
|
|
10
|
+
constructor(pluginManager, container) {
|
|
11
11
|
super(container);
|
|
12
|
-
this.
|
|
12
|
+
this._pluginManager = pluginManager;
|
|
13
13
|
this._delay = 0;
|
|
14
14
|
}
|
|
15
15
|
clear() {
|
|
@@ -52,16 +52,22 @@ export class TrailMaker extends ExternalInteractorBase {
|
|
|
52
52
|
return undefined;
|
|
53
53
|
const w = comp?.weights, factor = norm.x * (w?.x ?? defaultWeight) + norm.y * (w?.y ?? defaultWeight), rangeSource = comp?.value ?? originalValue, min = getRangeMin(rangeSource ?? defaultMin), max = getRangeMax(rangeSource ?? defaultMax), result = min + factor * (max - min);
|
|
54
54
|
return Math.min(max, Math.max(min, result));
|
|
55
|
-
},
|
|
56
|
-
?
|
|
55
|
+
}, trailPaintOptions = trailOptions.particles?.paint
|
|
56
|
+
? itemFromSingleOrMultiple(trailOptions.particles.paint)
|
|
57
|
+
: undefined, fillData = trailPaintOptions?.fill, baseHsl = fillData
|
|
58
|
+
? rangeColorToHsl(this._pluginManager, AnimatableColor.create(undefined, fillData.color))
|
|
57
59
|
: undefined, h = calculateValue(colorCoords.h, baseHsl?.h, hMax), s = calculateValue(colorCoords.s, baseHsl?.s, sMax), l = calculateValue(colorCoords.l, baseHsl?.l, lMax);
|
|
58
60
|
if (h !== undefined || s !== undefined || l !== undefined) {
|
|
59
61
|
particleOptions = deepExtend({}, trailOptions.particles, {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
paint: {
|
|
63
|
+
fill: {
|
|
64
|
+
color: {
|
|
65
|
+
value: {
|
|
66
|
+
h: h ?? baseHsl?.h,
|
|
67
|
+
s: s ?? baseHsl?.s,
|
|
68
|
+
l: l ?? baseHsl?.l,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
65
71
|
},
|
|
66
72
|
},
|
|
67
73
|
});
|
package/esm/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export async function loadExternalTrailInteraction(engine) {
|
|
2
|
-
engine.checkVersion("4.0.0-beta.
|
|
3
|
-
await engine.register(async (e) => {
|
|
2
|
+
engine.checkVersion("4.0.0-beta.10");
|
|
3
|
+
await engine.pluginManager.register(async (e) => {
|
|
4
4
|
const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity");
|
|
5
5
|
ensureInteractivityPluginLoaded(e);
|
|
6
|
-
e.addInteractor?.("externalTrail", async (container) => {
|
|
6
|
+
e.pluginManager.addInteractor?.("externalTrail", async (container) => {
|
|
7
7
|
const { TrailMaker } = await import("./TrailMaker.js");
|
|
8
|
-
return new TrailMaker(e, container);
|
|
8
|
+
return new TrailMaker(e.pluginManager, container);
|
|
9
9
|
});
|
|
10
10
|
});
|
|
11
11
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsparticles/interaction-external-trail",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.10",
|
|
4
4
|
"description": "tsParticles trail external interaction",
|
|
5
5
|
"homepage": "https://particles.js.org",
|
|
6
6
|
"repository": {
|
|
@@ -81,17 +81,20 @@
|
|
|
81
81
|
"browser": "./browser/index.js",
|
|
82
82
|
"import": "./esm/index.js",
|
|
83
83
|
"require": "./cjs/index.js",
|
|
84
|
-
"
|
|
85
|
-
"default": "./cjs/index.js"
|
|
84
|
+
"default": "./esm/index.js"
|
|
86
85
|
},
|
|
87
86
|
"./package.json": "./package.json"
|
|
88
87
|
},
|
|
89
|
-
"
|
|
90
|
-
"@tsparticles/engine": "4.0.0-beta.
|
|
91
|
-
"@tsparticles/plugin-interactivity": "4.0.0-beta.
|
|
88
|
+
"peerDepdendencies": {
|
|
89
|
+
"@tsparticles/engine": "4.0.0-beta.1",
|
|
90
|
+
"@tsparticles/plugin-interactivity": "4.0.0-beta.1"
|
|
92
91
|
},
|
|
93
92
|
"publishConfig": {
|
|
94
93
|
"access": "public"
|
|
95
94
|
},
|
|
96
|
-
"type": "module"
|
|
95
|
+
"type": "module",
|
|
96
|
+
"peerDependencies": {
|
|
97
|
+
"@tsparticles/engine": "4.0.0-beta.10",
|
|
98
|
+
"@tsparticles/plugin-interactivity": "4.0.0-beta.10"
|
|
99
|
+
}
|
|
97
100
|
}
|