canvas-editor-engine 2.1.1 → 2.1.3
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 +15 -9
- package/dist/web-component.d.ts +7 -0
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1571,20 +1571,20 @@ var WebComponent = function(_super) {
|
|
|
1571
1571
|
var toolLayerService = new ToolLayerService(_this.appConfig);
|
|
1572
1572
|
var eventService = new EventService;
|
|
1573
1573
|
var webComponentWrapper = new WebComponentWrapper;
|
|
1574
|
-
|
|
1575
|
-
var toolService = new ToolService(canvasComponent);
|
|
1574
|
+
_this.canvasComponent = new CanvasComponent(_this.appConfig, loggerService, toolLayerService);
|
|
1575
|
+
var toolService = new ToolService(_this.canvasComponent);
|
|
1576
1576
|
var appStoreRepository = new AppStoreRepository;
|
|
1577
1577
|
var throughHistoryService = new ThroughHistoryService(_this.appConfig, appStoreRepository);
|
|
1578
1578
|
new AppStore(throughHistoryService, appStoreRepository);
|
|
1579
|
-
var _a = canvasComponent.getComponent(), canvasTemplate = _a.canvasTemplate, canvasStyle = _a.canvasStyle;
|
|
1580
|
-
|
|
1581
|
-
var pipetteComponent = new PipetteComponent(toolService, loggerService, canvasComponent);
|
|
1579
|
+
var _a = _this.canvasComponent.getComponent(), canvasTemplate = _a.canvasTemplate, canvasStyle = _a.canvasStyle;
|
|
1580
|
+
_this.canvasElement = webComponentWrapper.editorWrap.add(canvasTemplate, canvasStyle);
|
|
1581
|
+
var pipetteComponent = new PipetteComponent(toolService, loggerService, _this.canvasComponent);
|
|
1582
1582
|
var _b = pipetteComponent.getComponent(), pipetteTemplate = _b.pipetteTemplate, pipetteStyle = _b.pipetteStyle;
|
|
1583
1583
|
webComponentWrapper.editorWrap.add(pipetteTemplate, pipetteStyle);
|
|
1584
1584
|
var slotComponent = new SlotComponent(loggerService);
|
|
1585
1585
|
var _c = slotComponent.getComponent("tools"), slotTemplate = _c.slotTemplate, slotStyle = _c.slotStyle;
|
|
1586
1586
|
webComponentWrapper.toolsWrap.add(slotTemplate, slotStyle);
|
|
1587
|
-
var excretionsComponent = new ExcretionsComponent(toolService, loggerService, toolLayerService, canvasComponent);
|
|
1587
|
+
var excretionsComponent = new ExcretionsComponent(toolService, loggerService, toolLayerService, _this.canvasComponent);
|
|
1588
1588
|
new CropService(_this.appConfig, appStoreRepository, excretionsComponent);
|
|
1589
1589
|
var _d = excretionsComponent.getComponent(), excretionsTemplate = _d.excretionsTemplate, excretionsStyle = _d.excretionsStyle;
|
|
1590
1590
|
webComponentWrapper.editorWrap.add(excretionsTemplate, excretionsStyle);
|
|
@@ -1592,18 +1592,24 @@ var WebComponent = function(_super) {
|
|
|
1592
1592
|
var _e = loadingComponent.getComponent(), loadingTemplate = _e.loadingTemplate, loadingStyle = _e.loadingStyle;
|
|
1593
1593
|
webComponentWrapper.editorWrap.add(loadingTemplate, loadingStyle);
|
|
1594
1594
|
shadowRoot.appendChild(webComponentWrapper.baseElement);
|
|
1595
|
-
canvasComponent.simulateSubscriptions();
|
|
1595
|
+
_this.canvasComponent.simulateSubscriptions();
|
|
1596
1596
|
eventService.applyEvents(webComponentWrapper.baseElement);
|
|
1597
1597
|
_this.addEventListener("initial", (function() {
|
|
1598
1598
|
_this.dispatchEvent(new CustomEvent("get-editor-element", {
|
|
1599
1599
|
detail: {
|
|
1600
|
-
editorElement: canvasElement,
|
|
1601
|
-
canvasSelector: canvasComponent.getCanvasSelector()
|
|
1600
|
+
editorElement: _this.canvasElement,
|
|
1601
|
+
canvasSelector: _this.canvasComponent.getCanvasSelector()
|
|
1602
1602
|
}
|
|
1603
1603
|
}));
|
|
1604
1604
|
}));
|
|
1605
1605
|
return _this;
|
|
1606
1606
|
}
|
|
1607
|
+
WebComponent.prototype.initial = function() {
|
|
1608
|
+
return {
|
|
1609
|
+
editorElement: this.canvasElement,
|
|
1610
|
+
canvasSelector: this.canvasComponent.getCanvasSelector()
|
|
1611
|
+
};
|
|
1612
|
+
};
|
|
1607
1613
|
return WebComponent;
|
|
1608
1614
|
}(HTMLElement);
|
|
1609
1615
|
|
package/dist/web-component.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import CanvasComponent from "./components/canvas.component";
|
|
1
2
|
import { TComponent } from "./types/general";
|
|
2
3
|
import AppConfig from "./config";
|
|
3
4
|
export declare class WebComponentWrapper {
|
|
@@ -24,5 +25,11 @@ export declare class WebComponentWrapper {
|
|
|
24
25
|
}
|
|
25
26
|
export default class WebComponent extends HTMLElement {
|
|
26
27
|
appConfig: AppConfig;
|
|
28
|
+
canvasComponent: CanvasComponent;
|
|
29
|
+
canvasElement: HTMLDivElement;
|
|
27
30
|
constructor();
|
|
31
|
+
initial(): {
|
|
32
|
+
editorElement: HTMLDivElement;
|
|
33
|
+
canvasSelector: string;
|
|
34
|
+
};
|
|
28
35
|
}
|