canvas-editor-engine 1.0.68 → 1.0.69

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,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EventAtom = exports.ControlEvent = void 0;
4
+ const guid4_1 = require("../utils/guid4");
4
5
  class ControlEvent {
5
6
  name;
6
7
  action;
@@ -15,9 +16,8 @@ exports.EventAtom = EventAtom;
15
16
  class EventService {
16
17
  static eventList = [];
17
18
  static subcribe(controlEvent) {
18
- // const guid4 = new Guid4().finite;
19
19
  const eventAtom = {
20
- id: "42141-241241-412412-421241",
20
+ id: new guid4_1.Guid4().finite,
21
21
  ...controlEvent
22
22
  };
23
23
  EventService.eventList.push(eventAtom);
@@ -1,6 +1,6 @@
1
1
  import { IGUID4 } from "../types/general";
2
2
  export declare class Guid4 {
3
- static stack: IGUID4[];
3
+ stack: IGUID4[];
4
4
  guid4: IGUID4;
5
5
  constructor();
6
6
  private generate;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Guid4 = void 0;
4
4
  class Guid4 {
5
- static stack = [];
5
+ stack = [];
6
6
  guid4;
7
7
  constructor() {
8
8
  this.generate(this.attempt);
@@ -14,9 +14,9 @@ class Guid4 {
14
14
  getFactor(guid4) {
15
15
  return (attempt) => {
16
16
  guid4 = this.Guid4;
17
- if (!Guid4.stack.includes(guid4)) {
17
+ if (!this.stack.includes(guid4)) {
18
18
  attempt.current = attempt.max;
19
- Guid4.stack.push(guid4);
19
+ this.stack.push(guid4);
20
20
  }
21
21
  };
22
22
  }
@@ -45,8 +45,13 @@ class Guid4 {
45
45
  return formattedChar.toString(16);
46
46
  }
47
47
  get finite() {
48
- const isFound = (item) => !!item;
49
- return Guid4.stack.findLast(isFound);
48
+ const guid4 = this.stack[this.stack?.length];
49
+ if (!!guid4) {
50
+ return guid4;
51
+ }
52
+ else {
53
+ throw new Error("Guid4 not generate");
54
+ }
50
55
  }
51
56
  ;
52
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "canvas-editor-engine",
3
- "version": "1.0.68",
3
+ "version": "1.0.69",
4
4
  "description": "CanvasEditorEngine library, use: [typescript] [canvas]",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",