canvas-editor-engine 1.0.58 → 1.0.59
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.
@@ -8,14 +8,9 @@ export declare class EventAtom implements ControlEvent {
|
|
8
8
|
name: string;
|
9
9
|
action: (args?: any) => any;
|
10
10
|
}
|
11
|
-
export
|
12
|
-
abstract applyEvents(baseElement: HTMLDivElement): void;
|
13
|
-
}
|
14
|
-
export default class EventService implements AbstractEventService {
|
15
|
-
private baseElement;
|
11
|
+
export default class EventService {
|
16
12
|
static eventList: EventAtom[];
|
17
|
-
constructor(baseElement: HTMLDivElement);
|
18
13
|
static subcribe(controlEvent: ControlEvent): void;
|
19
14
|
static dispatch(name: ControlEvent['name'], eventArgs?: any): void;
|
20
|
-
applyEvents(): void;
|
15
|
+
static applyEvents(baseElement: HTMLDivElement): void;
|
21
16
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.EventAtom = exports.ControlEvent = void 0;
|
4
4
|
const guid4_1 = require("../utils/guid4");
|
5
5
|
class ControlEvent {
|
6
6
|
name;
|
@@ -13,15 +13,8 @@ class EventAtom {
|
|
13
13
|
action;
|
14
14
|
}
|
15
15
|
exports.EventAtom = EventAtom;
|
16
|
-
class AbstractEventService {
|
17
|
-
}
|
18
|
-
exports.AbstractEventService = AbstractEventService;
|
19
16
|
class EventService {
|
20
|
-
baseElement;
|
21
17
|
static eventList;
|
22
|
-
constructor(baseElement) {
|
23
|
-
this.baseElement = baseElement;
|
24
|
-
}
|
25
18
|
static subcribe(controlEvent) {
|
26
19
|
const eventAtom = {
|
27
20
|
id: new guid4_1.Guid4().finite,
|
@@ -33,9 +26,9 @@ class EventService {
|
|
33
26
|
const eventAtom = EventService.eventList.find((event) => event.name === name);
|
34
27
|
eventAtom.action(eventArgs);
|
35
28
|
}
|
36
|
-
applyEvents() {
|
29
|
+
static applyEvents(baseElement) {
|
37
30
|
EventService.eventList.forEach((event) => {
|
38
|
-
|
31
|
+
baseElement.addEventListener(event.name, event.action);
|
39
32
|
});
|
40
33
|
}
|
41
34
|
}
|
package/dist/web-component.js
CHANGED
@@ -94,8 +94,7 @@ class WebComponent extends HTMLElement {
|
|
94
94
|
// webComponentWrapper.editorWrap.add(loadingTemplate, loadingStyle);
|
95
95
|
shadowRoot.appendChild(webComponentWrapper.baseElement);
|
96
96
|
canvas_component_1.default.simulateSubscriptions();
|
97
|
-
|
98
|
-
eventService.applyEvents();
|
97
|
+
event_service_1.default.applyEvents(webComponentWrapper.baseElement);
|
99
98
|
this.addEventListener('initial', () => {
|
100
99
|
this.dispatchEvent(new CustomEvent('get-editor-element', {
|
101
100
|
detail: {
|