@tsparticles/shape-text 4.0.0-beta.0 → 4.0.0-beta.2

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,2 +1,2 @@
1
- "use strict";(this.webpackChunk_tsparticles_shape_text=this.webpackChunk_tsparticles_shape_text||[]).push([[942],{942(t,e,a){a.d(e,{TextDrawer:()=>l});var i=a(303),s=a(183),n=a(425);class l{draw(t){(0,s.m)(t)}async init(t){let e=t.actualOptions;if(s.u.find(t=>(0,i.isInArray)(t,e.particles.shape.type))){let t=s.u.map(t=>e.particles.shape.options[t]).find(t=>!!t),a=[];(0,i.executeOnSingleOrMultiple)(t,t=>{a.push((0,n.loadFont)(t.font,t.weight))}),await Promise.all(a)}}particleInit(t,e){if(!e.shape||!s.u.includes(e.shape))return;let a=e.shapeData;if(void 0===a)return;let n=a.value;n&&(e.textLines=(0,i.itemFromSingleOrMultiple)(n,e.randomIndexData)?.split(`
1
+ "use strict";(this.webpackChunk_tsparticles_shape_text=this.webpackChunk_tsparticles_shape_text||[]).push([[834],{834(t,e,a){a.d(e,{TextDrawer:()=>l});var i=a(303),s=a(131),n=a(425);class l{draw(t){(0,s.m)(t)}async init(t){let e=t.actualOptions;if(s.u.find(t=>(0,i.isInArray)(t,e.particles.shape.type))){let t=s.u.map(t=>e.particles.shape.options[t]).find(t=>!!t),a=[];(0,i.executeOnSingleOrMultiple)(t,t=>{a.push((0,n.loadFont)(t.font,t.weight))}),await Promise.all(a)}}particleInit(t,e){if(!e.shape||!s.u.includes(e.shape))return;let a=e.shapeData;if(void 0===a)return;let n=a.value;n&&(e.textLines=(0,i.itemFromSingleOrMultiple)(n,e.randomIndexData)?.split(`
2
2
  `)??[],e.maxTextLength=e.textLines.length?Math.max(...e.textLines.map(t=>t.length)):e.textLines[0]?.length??0)}}}}]);
package/browser/Utils.js CHANGED
@@ -1,4 +1,4 @@
1
- import { double, half, itemFromSingleOrMultiple } from "@tsparticles/engine";
1
+ import { double, half, itemFromSingleOrMultiple, } from "@tsparticles/engine";
2
2
  export const validTypes = ["text", "character", "char", "multiline-text"];
3
3
  const firstIndex = 0, minLength = 0;
4
4
  export function drawText(data) {
package/browser/index.js CHANGED
@@ -1,8 +1,9 @@
1
+ import {} from "@tsparticles/engine";
1
2
  import { validTypes } from "./Utils.js";
2
3
  export async function loadTextShape(engine) {
3
- engine.checkVersion("4.0.0-beta.0");
4
- await engine.register(e => {
5
- e.addShape(validTypes, async () => {
4
+ engine.checkVersion("4.0.0-beta.2");
5
+ await engine.pluginManager.register(e => {
6
+ e.pluginManager.addShape(validTypes, async () => {
6
7
  const { TextDrawer } = await import("./TextDrawer.js");
7
8
  return new TextDrawer();
8
9
  });
package/cjs/Utils.js CHANGED
@@ -1,4 +1,4 @@
1
- import { double, half, itemFromSingleOrMultiple } from "@tsparticles/engine";
1
+ import { double, half, itemFromSingleOrMultiple, } from "@tsparticles/engine";
2
2
  export const validTypes = ["text", "character", "char", "multiline-text"];
3
3
  const firstIndex = 0, minLength = 0;
4
4
  export function drawText(data) {
package/cjs/index.js CHANGED
@@ -1,8 +1,9 @@
1
+ import {} from "@tsparticles/engine";
1
2
  import { validTypes } from "./Utils.js";
2
3
  export async function loadTextShape(engine) {
3
- engine.checkVersion("4.0.0-beta.0");
4
- await engine.register(e => {
5
- e.addShape(validTypes, async () => {
4
+ engine.checkVersion("4.0.0-beta.2");
5
+ await engine.pluginManager.register(e => {
6
+ e.pluginManager.addShape(validTypes, async () => {
6
7
  const { TextDrawer } = await import("./TextDrawer.js");
7
8
  return new TextDrawer();
8
9
  });
@@ -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.2
8
8
  */
9
9
  "use strict";
10
10
  /*
package/esm/Utils.js CHANGED
@@ -1,4 +1,4 @@
1
- import { double, half, itemFromSingleOrMultiple } from "@tsparticles/engine";
1
+ import { double, half, itemFromSingleOrMultiple, } from "@tsparticles/engine";
2
2
  export const validTypes = ["text", "character", "char", "multiline-text"];
3
3
  const firstIndex = 0, minLength = 0;
4
4
  export function drawText(data) {
package/esm/index.js CHANGED
@@ -1,8 +1,9 @@
1
+ import {} from "@tsparticles/engine";
1
2
  import { validTypes } from "./Utils.js";
2
3
  export async function loadTextShape(engine) {
3
- engine.checkVersion("4.0.0-beta.0");
4
- await engine.register(e => {
5
- e.addShape(validTypes, async () => {
4
+ engine.checkVersion("4.0.0-beta.2");
5
+ await engine.pluginManager.register(e => {
6
+ e.pluginManager.addShape(validTypes, async () => {
6
7
  const { TextDrawer } = await import("./TextDrawer.js");
7
8
  return new TextDrawer();
8
9
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/shape-text",
3
- "version": "4.0.0-beta.0",
3
+ "version": "4.0.0-beta.2",
4
4
  "description": "tsParticles text shape",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -53,14 +53,13 @@
53
53
  "browser": "./browser/index.js",
54
54
  "import": "./esm/index.js",
55
55
  "require": "./cjs/index.js",
56
- "umd": "./umd/index.js",
57
- "default": "./cjs/index.js"
56
+ "default": "./esm/index.js"
58
57
  },
59
58
  "./package.json": "./package.json"
60
59
  },
61
- "dependencies": {
62
- "@tsparticles/canvas-utils": "4.0.0-beta.0",
63
- "@tsparticles/engine": "4.0.0-beta.0"
60
+ "peerDependencies": {
61
+ "@tsparticles/canvas-utils": "4.0.0-beta.1",
62
+ "@tsparticles/engine": "4.0.0-beta.1"
64
63
  },
65
64
  "publishConfig": {
66
65
  "access": "public"