canvas-editor-engine 1.0.68 → 1.0.69
Sign up to get free protection for your applications and to get access to all the features.
@@ -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:
|
20
|
+
id: new guid4_1.Guid4().finite,
|
21
21
|
...controlEvent
|
22
22
|
};
|
23
23
|
EventService.eventList.push(eventAtom);
|
package/dist/utils/guid4.d.ts
CHANGED
package/dist/utils/guid4.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.Guid4 = void 0;
|
4
4
|
class Guid4 {
|
5
|
-
|
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 (!
|
17
|
+
if (!this.stack.includes(guid4)) {
|
18
18
|
attempt.current = attempt.max;
|
19
|
-
|
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
|
49
|
-
|
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
|
}
|