canvas-editor-engine 1.2.1 → 1.2.2
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.d.ts +574 -18
- package/dist/index.mjs.js +2 -0
- package/dist/index.mjs.js.LICENSE.txt +8 -0
- package/package.json +36 -30
- package/dist/components/canvas.component.d.ts +0 -21
- package/dist/components/canvas.component.js +0 -90
- package/dist/components/excretions.component.d.ts +0 -32
- package/dist/components/excretions.component.js +0 -280
- package/dist/components/loading.component.d.ts +0 -14
- package/dist/components/loading.component.js +0 -96
- package/dist/components/pipette.component.d.ts +0 -23
- package/dist/components/pipette.component.js +0 -149
- package/dist/components/slot.component.d.ts +0 -10
- package/dist/components/slot.component.js +0 -31
- package/dist/config.d.ts +0 -23
- package/dist/config.js +0 -67
- package/dist/filters/collection/vague.d.ts +0 -13
- package/dist/filters/collection/vague.js +0 -150
- package/dist/filters/index.d.ts +0 -2
- package/dist/filters/index.js +0 -5
- package/dist/index.js +0 -69
- package/dist/services/component.service.d.ts +0 -5
- package/dist/services/component.service.js +0 -37
- package/dist/services/crop.service.d.ts +0 -7
- package/dist/services/crop.service.js +0 -50
- package/dist/services/download.service.d.ts +0 -4
- package/dist/services/download.service.js +0 -15
- package/dist/services/draw.service.d.ts +0 -17
- package/dist/services/draw.service.js +0 -152
- package/dist/services/event.service.d.ts +0 -16
- package/dist/services/event.service.js +0 -35
- package/dist/services/logger.service.d.ts +0 -20
- package/dist/services/logger.service.js +0 -38
- package/dist/services/projects.service.d.ts +0 -11
- package/dist/services/projects.service.js +0 -98
- package/dist/services/pull-project.service.d.ts +0 -8
- package/dist/services/pull-project.service.js +0 -34
- package/dist/services/store.service.d.ts +0 -6
- package/dist/services/store.service.js +0 -11
- package/dist/services/through-history.service.d.ts +0 -12
- package/dist/services/through-history.service.js +0 -49
- package/dist/services/tool-layers.service.d.ts +0 -4
- package/dist/services/tool-layers.service.js +0 -12
- package/dist/services/tool.service.d.ts +0 -10
- package/dist/services/tool.service.js +0 -56
- package/dist/store/history.state.d.ts +0 -15
- package/dist/store/history.state.js +0 -76
- package/dist/store/image.state.d.ts +0 -30
- package/dist/store/image.state.js +0 -70
- package/dist/store/store.d.ts +0 -13
- package/dist/store/store.js +0 -31
- package/dist/types/canvas.d.ts +0 -10
- package/dist/types/canvas.js +0 -3
- package/dist/types/cursor.d.ts +0 -9
- package/dist/types/cursor.js +0 -3
- package/dist/types/excretion.d.ts +0 -27
- package/dist/types/excretion.js +0 -5
- package/dist/types/general.d.ts +0 -24
- package/dist/types/general.js +0 -5
- package/dist/types/history.d.ts +0 -7
- package/dist/types/history.js +0 -2
- package/dist/types/image.d.ts +0 -48
- package/dist/types/image.js +0 -10
- package/dist/types/log.d.ts +0 -13
- package/dist/types/log.js +0 -5
- package/dist/types/pipette.d.ts +0 -1
- package/dist/types/pipette.js +0 -2
- package/dist/types/project.d.ts +0 -38
- package/dist/types/project.js +0 -14
- package/dist/utils/convert.d.ts +0 -12
- package/dist/utils/convert.js +0 -27
- package/dist/utils/filter.d.ts +0 -21
- package/dist/utils/filter.js +0 -150
- package/dist/utils/guid4.d.ts +0 -13
- package/dist/utils/guid4.js +0 -111
- package/dist/utils/project-file-serializer.d.ts +0 -13
- package/dist/utils/project-file-serializer.js +0 -79
- package/dist/web-component.d.ts +0 -26
- package/dist/web-component.js +0 -108
package/dist/web-component.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WebComponentWrapper = void 0;
|
|
4
|
-
const canvas_component_1 = require("./components/canvas.component");
|
|
5
|
-
const excretions_component_1 = require("./components/excretions.component");
|
|
6
|
-
const loading_component_1 = require("./components/loading.component");
|
|
7
|
-
const pipette_component_1 = require("./components/pipette.component");
|
|
8
|
-
const slot_component_1 = require("./components/slot.component");
|
|
9
|
-
const event_service_1 = require("./services/event.service");
|
|
10
|
-
class WebComponentWrapper {
|
|
11
|
-
baseElement;
|
|
12
|
-
editorWrapElement;
|
|
13
|
-
stylesWrapElement;
|
|
14
|
-
toolsWrapElement;
|
|
15
|
-
constructor() {
|
|
16
|
-
const base = document.createElement('div');
|
|
17
|
-
base.className = 'wc-editor';
|
|
18
|
-
base.style.position = 'relative';
|
|
19
|
-
base.style.display = 'flex';
|
|
20
|
-
base.style.overflow = 'hidden';
|
|
21
|
-
const stylesWrap = document.createElement('div');
|
|
22
|
-
stylesWrap.className = 'styles-wrap';
|
|
23
|
-
const editorWrap = document.createElement('div');
|
|
24
|
-
editorWrap.className = 'editor-wrap';
|
|
25
|
-
editorWrap.style.position = 'relative';
|
|
26
|
-
editorWrap.style.display = 'flex';
|
|
27
|
-
editorWrap.style.overflow = 'hidden';
|
|
28
|
-
const toolsWrap = document.createElement('div');
|
|
29
|
-
toolsWrap.className = 'tools-wrap';
|
|
30
|
-
toolsWrap.style.position = 'relative';
|
|
31
|
-
toolsWrap.style.display = 'flex';
|
|
32
|
-
base.appendChild(stylesWrap);
|
|
33
|
-
base.appendChild(editorWrap);
|
|
34
|
-
base.appendChild(toolsWrap);
|
|
35
|
-
this.baseElement = base;
|
|
36
|
-
this.stylesWrapElement = stylesWrap;
|
|
37
|
-
this.editorWrapElement = editorWrap;
|
|
38
|
-
this.toolsWrapElement = toolsWrap;
|
|
39
|
-
this._baseStyle();
|
|
40
|
-
}
|
|
41
|
-
get base() {
|
|
42
|
-
return this._methods(this.baseElement);
|
|
43
|
-
}
|
|
44
|
-
;
|
|
45
|
-
get editorWrap() {
|
|
46
|
-
return this._methods(this.editorWrapElement);
|
|
47
|
-
}
|
|
48
|
-
;
|
|
49
|
-
get stylesWrap() {
|
|
50
|
-
return this._methods(this.stylesWrapElement);
|
|
51
|
-
}
|
|
52
|
-
;
|
|
53
|
-
get toolsWrap() {
|
|
54
|
-
return this._methods(this.toolsWrapElement);
|
|
55
|
-
}
|
|
56
|
-
;
|
|
57
|
-
_methods(elementWrapper) {
|
|
58
|
-
return {
|
|
59
|
-
add: (component, style) => this._add(elementWrapper, component, style),
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
_add(elementWrapper, component, style) {
|
|
63
|
-
const componentElement = elementWrapper.appendChild(component);
|
|
64
|
-
if (!!style) {
|
|
65
|
-
this.stylesWrapElement.appendChild(style);
|
|
66
|
-
}
|
|
67
|
-
return componentElement;
|
|
68
|
-
}
|
|
69
|
-
_baseStyle() {
|
|
70
|
-
const style = document.createElement('style');
|
|
71
|
-
style.innerHTML = `
|
|
72
|
-
* {
|
|
73
|
-
user-select: none;
|
|
74
|
-
}
|
|
75
|
-
`;
|
|
76
|
-
this.stylesWrapElement.appendChild(style);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
exports.WebComponentWrapper = WebComponentWrapper;
|
|
80
|
-
class WebComponent extends HTMLElement {
|
|
81
|
-
constructor() {
|
|
82
|
-
super();
|
|
83
|
-
const shadowRoot = this.attachShadow({ mode: "open" });
|
|
84
|
-
const webComponentWrapper = new WebComponentWrapper();
|
|
85
|
-
const { canvasTemplate, canvasStyle } = canvas_component_1.default.getComponent();
|
|
86
|
-
const canvasElement = webComponentWrapper.editorWrap.add(canvasTemplate, canvasStyle);
|
|
87
|
-
const { pipetteTemplate, pipetteStyle } = pipette_component_1.default.getComponent();
|
|
88
|
-
webComponentWrapper.editorWrap.add(pipetteTemplate, pipetteStyle);
|
|
89
|
-
const { slotTemplate, slotStyle } = slot_component_1.default.getComponent('tools');
|
|
90
|
-
webComponentWrapper.toolsWrap.add(slotTemplate, slotStyle);
|
|
91
|
-
const { excretionsTemplate, excretionsStyle } = excretions_component_1.default.getComponent();
|
|
92
|
-
webComponentWrapper.editorWrap.add(excretionsTemplate, excretionsStyle);
|
|
93
|
-
const { loadingTemplate, loadingStyle } = loading_component_1.default.getComponent();
|
|
94
|
-
webComponentWrapper.editorWrap.add(loadingTemplate, loadingStyle);
|
|
95
|
-
shadowRoot.appendChild(webComponentWrapper.baseElement);
|
|
96
|
-
canvas_component_1.default.simulateSubscriptions();
|
|
97
|
-
event_service_1.default.applyEvents(webComponentWrapper.baseElement);
|
|
98
|
-
this.addEventListener('initial', () => {
|
|
99
|
-
this.dispatchEvent(new CustomEvent('get-editor-element', {
|
|
100
|
-
detail: {
|
|
101
|
-
editorElement: canvasElement,
|
|
102
|
-
canvasSelector: canvas_component_1.default.getCanvasSelector(),
|
|
103
|
-
}
|
|
104
|
-
}));
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
exports.default = WebComponent;
|