@tsparticles/shape-line 3.9.0 → 4.0.0-alpha.0

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/727.min.js ADDED
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 727.min.js.LICENSE.txt */
2
+ (this.webpackChunk_tsparticles_shape_line=this.webpackChunk_tsparticles_shape_line||[]).push([[727],{727(e,t,s){s.d(t,{LineDrawer:()=>a});class a{constructor(){this.validTypes=["line"]}draw(e){!function(e){const{context:t,particle:s,radius:a}=e,i=s.shapeData;t.moveTo(-a,0),t.lineTo(a,0),t.lineCap=i?.cap??"butt"}(e)}getSidesCount(){return 1}}}}]);
@@ -0,0 +1 @@
1
+ /*! tsParticles Line Shape v4.0.0-alpha.0 by Matteo Bruni */
package/browser/index.js CHANGED
@@ -1,5 +1,7 @@
1
- import { LineDrawer } from "./LineDrawer.js";
2
- export async function loadLineShape(engine, refresh = true) {
3
- engine.checkVersion("3.9.0");
4
- await engine.addShape(new LineDrawer(), refresh);
1
+ export function loadLineShape(engine) {
2
+ engine.checkVersion("4.0.0-alpha.0");
3
+ engine.register(async (e) => {
4
+ const { LineDrawer } = await import("./LineDrawer.js");
5
+ e.addShape(new LineDrawer());
6
+ });
5
7
  }
package/cjs/LineDrawer.js CHANGED
@@ -1,17 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LineDrawer = void 0;
4
- const Utils_js_1 = require("./Utils.js");
1
+ import { drawLine } from "./Utils.js";
5
2
  const sides = 1;
6
- class LineDrawer {
3
+ export class LineDrawer {
7
4
  constructor() {
8
5
  this.validTypes = ["line"];
9
6
  }
10
7
  draw(data) {
11
- (0, Utils_js_1.drawLine)(data);
8
+ drawLine(data);
12
9
  }
13
10
  getSidesCount() {
14
11
  return sides;
15
12
  }
16
13
  }
17
- exports.LineDrawer = LineDrawer;
package/cjs/Utils.js CHANGED
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.drawLine = drawLine;
4
- function drawLine(data) {
1
+ export function drawLine(data) {
5
2
  const { context, particle, radius } = data, shapeData = particle.shapeData, centerY = 0;
6
3
  context.moveTo(-radius, centerY);
7
4
  context.lineTo(radius, centerY);
package/cjs/index.js CHANGED
@@ -1,8 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.loadLineShape = loadLineShape;
4
- const LineDrawer_js_1 = require("./LineDrawer.js");
5
- async function loadLineShape(engine, refresh = true) {
6
- engine.checkVersion("3.9.0");
7
- await engine.addShape(new LineDrawer_js_1.LineDrawer(), refresh);
1
+ export function loadLineShape(engine) {
2
+ engine.checkVersion("4.0.0-alpha.0");
3
+ engine.register(async (e) => {
4
+ const { LineDrawer } = await import("./LineDrawer.js");
5
+ e.addShape(new LineDrawer());
6
+ });
8
7
  }
@@ -0,0 +1,40 @@
1
+ /*!
2
+ * Author : Matteo Bruni
3
+ * MIT license: https://opensource.org/licenses/MIT
4
+ * Demo / Generator : https://particles.js.org/
5
+ * GitHub : https://www.github.com/matteobruni/tsparticles
6
+ * How to use? : Check the GitHub README
7
+ * v4.0.0-alpha.0
8
+ */
9
+ "use strict";
10
+ /*
11
+ * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
12
+ * This devtool is neither made for production nor for readable output files.
13
+ * It uses "eval()" calls to create a separate source file in the browser devtools.
14
+ * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
15
+ * or disable the default devtool with "devtool: false".
16
+ * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
17
+ */
18
+ (this["webpackChunk_tsparticles_shape_line"] = this["webpackChunk_tsparticles_shape_line"] || []).push([["dist_browser_LineDrawer_js"],{
19
+
20
+ /***/ "./dist/browser/LineDrawer.js"
21
+ /*!************************************!*\
22
+ !*** ./dist/browser/LineDrawer.js ***!
23
+ \************************************/
24
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
25
+
26
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LineDrawer: () => (/* binding */ LineDrawer)\n/* harmony export */ });\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Utils.js */ \"./dist/browser/Utils.js\");\n\nconst sides = 1;\nclass LineDrawer {\n constructor() {\n this.validTypes = [\"line\"];\n }\n draw(data) {\n (0,_Utils_js__WEBPACK_IMPORTED_MODULE_0__.drawLine)(data);\n }\n getSidesCount() {\n return sides;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/shape-line/./dist/browser/LineDrawer.js?\n}");
27
+
28
+ /***/ },
29
+
30
+ /***/ "./dist/browser/Utils.js"
31
+ /*!*******************************!*\
32
+ !*** ./dist/browser/Utils.js ***!
33
+ \*******************************/
34
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
35
+
36
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ drawLine: () => (/* binding */ drawLine)\n/* harmony export */ });\nfunction drawLine(data) {\n const {\n context,\n particle,\n radius\n } = data,\n shapeData = particle.shapeData,\n centerY = 0;\n context.moveTo(-radius, centerY);\n context.lineTo(radius, centerY);\n context.lineCap = shapeData?.cap ?? \"butt\";\n}\n\n//# sourceURL=webpack://@tsparticles/shape-line/./dist/browser/Utils.js?\n}");
37
+
38
+ /***/ }
39
+
40
+ }]);
package/esm/index.js CHANGED
@@ -1,5 +1,7 @@
1
- import { LineDrawer } from "./LineDrawer.js";
2
- export async function loadLineShape(engine, refresh = true) {
3
- engine.checkVersion("3.9.0");
4
- await engine.addShape(new LineDrawer(), refresh);
1
+ export function loadLineShape(engine) {
2
+ engine.checkVersion("4.0.0-alpha.0");
3
+ engine.register(async (e) => {
4
+ const { LineDrawer } = await import("./LineDrawer.js");
5
+ e.addShape(new LineDrawer());
6
+ });
5
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/shape-line",
3
- "version": "3.9.0",
3
+ "version": "4.0.0-alpha.0",
4
4
  "description": "tsParticles line shape",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -59,9 +59,10 @@
59
59
  "./package.json": "./package.json"
60
60
  },
61
61
  "dependencies": {
62
- "@tsparticles/engine": "3.9.0"
62
+ "@tsparticles/engine": "4.0.0-alpha.0"
63
63
  },
64
64
  "publishConfig": {
65
65
  "access": "public"
66
- }
66
+ },
67
+ "type": "module"
67
68
  }