@tsparticles/plugin-hex-color 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.
@@ -1 +1 @@
1
- "use strict";(this.webpackChunk_tsparticles_plugin_hex_color=this.webpackChunk_tsparticles_plugin_hex_color||[]).push([[864],{864(r,e,a){var t,s;a.d(e,{HexColorManager:()=>p}),(s=t||(t={}))[s.r=1]="r",s[s.g=2]="g",s[s.b=3]="b",s[s.a=4]="a";let n=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i;class p{accepts(r){return r.startsWith("#")}handleColor(r){return this._parseString(r.value)}handleRangeColor(r){return this._parseString(r.value)}parseString(r){return this._parseString(r)}_parseString(r){if("string"!=typeof r||!this.accepts(r))return;let e=r.replace(n,(r,e,a,t,s)=>e+e+a+a+t+t+(void 0===s?"":s+s)),a=i.exec(e);return a?{a:a[t.a]?Number.parseInt(a[t.a],16)/255:1,b:Number.parseInt(a[t.b]??"0",16),g:Number.parseInt(a[t.g]??"0",16),r:Number.parseInt(a[t.r]??"0",16)}:void 0}}}}]);
1
+ "use strict";(this.webpackChunk_tsparticles_plugin_hex_color=this.webpackChunk_tsparticles_plugin_hex_color||[]).push([[237],{237(r,e,a){var t,s;a.d(e,{HexColorManager:()=>p}),(s=t||(t={}))[s.r=1]="r",s[s.g=2]="g",s[s.b=3]="b",s[s.a=4]="a";let n=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i;class p{accepts(r){return r.startsWith("#")}handleColor(r){return this._parseString(r.value)}handleRangeColor(r){return this._parseString(r.value)}parseString(r){return this._parseString(r)}_parseString(r){if("string"!=typeof r||!this.accepts(r))return;let e=r.replace(n,(r,e,a,t,s)=>e+e+a+a+t+t+(void 0===s?"":s+s)),a=i.exec(e);return a?{a:a[t.a]?Number.parseInt(a[t.a],16)/255:1,b:Number.parseInt(a[t.b]??"0",16),g:Number.parseInt(a[t.g]??"0",16),r:Number.parseInt(a[t.r]??"0",16)}:void 0}}}}]);
package/README.md CHANGED
@@ -8,6 +8,12 @@
8
8
 
9
9
  [tsParticles](https://github.com/tsparticles/tsparticles) plugin for adding the hex color support.
10
10
 
11
+ ## Quick checklist
12
+
13
+ 1. Install `@tsparticles/engine` (or use the CDN bundle below)
14
+ 2. Call the package loader function(s) before `tsParticles.load(...)`
15
+ 3. Apply the package options in your `tsParticles.load(...)` config
16
+
11
17
  ## How to use it
12
18
 
13
19
  ### CDN / Vanilla JS / jQuery
@@ -72,3 +78,19 @@ import { loadHexColorPlugin } from "@tsparticles/plugin-hex-color";
72
78
  await loadHexColorPlugin();
73
79
  })();
74
80
  ```
81
+
82
+ ## Option mapping
83
+
84
+ - This package primarily extends runtime behavior or rendering and may not expose a single dedicated root options key.
85
+ - Use the usage example in this README and combine with the nearest options section in the docs.
86
+
87
+ ## Common pitfalls
88
+
89
+ - Calling `tsParticles.load(...)` before `loadHexColorPlugin(...)`
90
+ - Verify required peer packages before enabling advanced options
91
+ - Change one option group at a time to isolate regressions quickly
92
+
93
+ ## Related docs
94
+
95
+ - All packages catalog: <https://github.com/tsparticles/tsparticles>
96
+ - Main docs: <https://particles.js.org/docs/>
package/browser/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export async function loadHexColorPlugin(engine) {
2
- engine.checkVersion("4.0.0-beta.0");
3
- await engine.register(async (e) => {
2
+ engine.checkVersion("4.0.0-beta.10");
3
+ await engine.pluginManager.register(async (e) => {
4
4
  const { HexColorManager } = await import("./HexColorManager.js");
5
- e.addColorManager("hex", new HexColorManager());
5
+ e.pluginManager.addColorManager("hex", new HexColorManager());
6
6
  });
7
7
  }
package/cjs/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export async function loadHexColorPlugin(engine) {
2
- engine.checkVersion("4.0.0-beta.0");
3
- await engine.register(async (e) => {
2
+ engine.checkVersion("4.0.0-beta.10");
3
+ await engine.pluginManager.register(async (e) => {
4
4
  const { HexColorManager } = await import("./HexColorManager.js");
5
- e.addColorManager("hex", new HexColorManager());
5
+ e.pluginManager.addColorManager("hex", new HexColorManager());
6
6
  });
7
7
  }
@@ -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.0
7
+ * v4.0.0-beta.10
8
8
  */
9
9
  "use strict";
10
10
  /*
package/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export async function loadHexColorPlugin(engine) {
2
- engine.checkVersion("4.0.0-beta.0");
3
- await engine.register(async (e) => {
2
+ engine.checkVersion("4.0.0-beta.10");
3
+ await engine.pluginManager.register(async (e) => {
4
4
  const { HexColorManager } = await import("./HexColorManager.js");
5
- e.addColorManager("hex", new HexColorManager());
5
+ e.pluginManager.addColorManager("hex", new HexColorManager());
6
6
  });
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/plugin-hex-color",
3
- "version": "4.0.0-beta.0",
3
+ "version": "4.0.0-beta.10",
4
4
  "description": "tsParticles hex color plugin",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -94,13 +94,12 @@
94
94
  "browser": "./browser/index.js",
95
95
  "import": "./esm/index.js",
96
96
  "require": "./cjs/index.js",
97
- "umd": "./umd/index.js",
98
- "default": "./cjs/index.js"
97
+ "default": "./esm/index.js"
99
98
  },
100
99
  "./package.json": "./package.json"
101
100
  },
102
- "dependencies": {
103
- "@tsparticles/engine": "4.0.0-beta.0"
101
+ "peerDependencies": {
102
+ "@tsparticles/engine": "4.0.0-beta.10"
104
103
  },
105
104
  "publishConfig": {
106
105
  "access": "public"