canvas-editor-engine 2.1.2 → 2.1.4
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/dist/index.mjs +29 -40
- package/dist/web-component.d.ts +6 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1567,53 +1567,45 @@ var WebComponent = function(_super) {
|
|
|
1567
1567
|
var shadowRoot = _this.attachShadow({
|
|
1568
1568
|
mode: "open"
|
|
1569
1569
|
});
|
|
1570
|
+
_this.webComponentWrapper = new WebComponentWrapper;
|
|
1571
|
+
shadowRoot.appendChild(_this.webComponentWrapper.baseElement);
|
|
1572
|
+
return _this;
|
|
1573
|
+
}
|
|
1574
|
+
WebComponent.prototype.init = function(appConfig) {
|
|
1575
|
+
this.appConfig = appConfig;
|
|
1570
1576
|
var loggerService = new LoggerService;
|
|
1571
|
-
var toolLayerService = new ToolLayerService(
|
|
1577
|
+
var toolLayerService = new ToolLayerService(this.appConfig);
|
|
1572
1578
|
var eventService = new EventService;
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
var toolService = new ToolService(_this.canvasComponent);
|
|
1579
|
+
this.canvasComponent = new CanvasComponent(this.appConfig, loggerService, toolLayerService);
|
|
1580
|
+
var toolService = new ToolService(this.canvasComponent);
|
|
1576
1581
|
var appStoreRepository = new AppStoreRepository;
|
|
1577
|
-
var throughHistoryService = new ThroughHistoryService(
|
|
1582
|
+
var throughHistoryService = new ThroughHistoryService(this.appConfig, appStoreRepository);
|
|
1578
1583
|
new AppStore(throughHistoryService, appStoreRepository);
|
|
1579
|
-
var _a =
|
|
1580
|
-
|
|
1581
|
-
var pipetteComponent = new PipetteComponent(toolService, loggerService,
|
|
1584
|
+
var _a = this.canvasComponent.getComponent(), canvasTemplate = _a.canvasTemplate, canvasStyle = _a.canvasStyle;
|
|
1585
|
+
this.canvasElement = this.webComponentWrapper.editorWrap.add(canvasTemplate, canvasStyle);
|
|
1586
|
+
var pipetteComponent = new PipetteComponent(toolService, loggerService, this.canvasComponent);
|
|
1582
1587
|
var _b = pipetteComponent.getComponent(), pipetteTemplate = _b.pipetteTemplate, pipetteStyle = _b.pipetteStyle;
|
|
1583
|
-
webComponentWrapper.editorWrap.add(pipetteTemplate, pipetteStyle);
|
|
1588
|
+
this.webComponentWrapper.editorWrap.add(pipetteTemplate, pipetteStyle);
|
|
1584
1589
|
var slotComponent = new SlotComponent(loggerService);
|
|
1585
1590
|
var _c = slotComponent.getComponent("tools"), slotTemplate = _c.slotTemplate, slotStyle = _c.slotStyle;
|
|
1586
|
-
webComponentWrapper.toolsWrap.add(slotTemplate, slotStyle);
|
|
1587
|
-
var excretionsComponent = new ExcretionsComponent(toolService, loggerService, toolLayerService,
|
|
1588
|
-
new CropService(
|
|
1591
|
+
this.webComponentWrapper.toolsWrap.add(slotTemplate, slotStyle);
|
|
1592
|
+
var excretionsComponent = new ExcretionsComponent(toolService, loggerService, toolLayerService, this.canvasComponent);
|
|
1593
|
+
new CropService(this.appConfig, appStoreRepository, excretionsComponent);
|
|
1589
1594
|
var _d = excretionsComponent.getComponent(), excretionsTemplate = _d.excretionsTemplate, excretionsStyle = _d.excretionsStyle;
|
|
1590
|
-
webComponentWrapper.editorWrap.add(excretionsTemplate, excretionsStyle);
|
|
1595
|
+
this.webComponentWrapper.editorWrap.add(excretionsTemplate, excretionsStyle);
|
|
1591
1596
|
var loadingComponent = new LoadingComponent(loggerService, eventService);
|
|
1592
1597
|
var _e = loadingComponent.getComponent(), loadingTemplate = _e.loadingTemplate, loadingStyle = _e.loadingStyle;
|
|
1593
|
-
webComponentWrapper.editorWrap.add(loadingTemplate, loadingStyle);
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
}));
|
|
1605
|
-
return _this;
|
|
1606
|
-
}
|
|
1607
|
-
Object.defineProperty(WebComponent.prototype, "initial", {
|
|
1608
|
-
get: function() {
|
|
1609
|
-
return {
|
|
1610
|
-
editorElement: this.canvasElement,
|
|
1611
|
-
canvasSelector: this.canvasComponent.getCanvasSelector()
|
|
1612
|
-
};
|
|
1613
|
-
},
|
|
1614
|
-
enumerable: false,
|
|
1615
|
-
configurable: true
|
|
1616
|
-
});
|
|
1598
|
+
this.webComponentWrapper.editorWrap.add(loadingTemplate, loadingStyle);
|
|
1599
|
+
this.canvasComponent.simulateSubscriptions();
|
|
1600
|
+
eventService.applyEvents(this.webComponentWrapper.baseElement);
|
|
1601
|
+
return this.initial();
|
|
1602
|
+
};
|
|
1603
|
+
WebComponent.prototype.initial = function() {
|
|
1604
|
+
return {
|
|
1605
|
+
editorElement: this.canvasElement,
|
|
1606
|
+
canvasSelector: this.canvasComponent.getCanvasSelector()
|
|
1607
|
+
};
|
|
1608
|
+
};
|
|
1617
1609
|
return WebComponent;
|
|
1618
1610
|
}(HTMLElement);
|
|
1619
1611
|
|
|
@@ -2214,9 +2206,6 @@ var CanvasEditorEngine = function() {
|
|
|
2214
2206
|
this.appConfig = appConfig;
|
|
2215
2207
|
}
|
|
2216
2208
|
CanvasEditorEngine.prototype.getInitial = function() {
|
|
2217
|
-
Object.defineProperty(WebComponent.prototype, "appConfig", {
|
|
2218
|
-
value: this.appConfig
|
|
2219
|
-
});
|
|
2220
2209
|
return {
|
|
2221
2210
|
tag: this.appConfig.WEB_COMPONENT_TAG_NAME,
|
|
2222
2211
|
component: WebComponent
|
package/dist/web-component.d.ts
CHANGED
|
@@ -27,8 +27,13 @@ export default class WebComponent extends HTMLElement {
|
|
|
27
27
|
appConfig: AppConfig;
|
|
28
28
|
canvasComponent: CanvasComponent;
|
|
29
29
|
canvasElement: HTMLDivElement;
|
|
30
|
+
webComponentWrapper: WebComponentWrapper;
|
|
30
31
|
constructor();
|
|
31
|
-
|
|
32
|
+
init(appConfig: AppConfig): {
|
|
33
|
+
editorElement: HTMLDivElement;
|
|
34
|
+
canvasSelector: string;
|
|
35
|
+
};
|
|
36
|
+
initial(): {
|
|
32
37
|
editorElement: HTMLDivElement;
|
|
33
38
|
canvasSelector: string;
|
|
34
39
|
};
|