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.
Files changed (79) hide show
  1. package/dist/index.d.ts +574 -18
  2. package/dist/index.mjs.js +2 -0
  3. package/dist/index.mjs.js.LICENSE.txt +8 -0
  4. package/package.json +36 -30
  5. package/dist/components/canvas.component.d.ts +0 -21
  6. package/dist/components/canvas.component.js +0 -90
  7. package/dist/components/excretions.component.d.ts +0 -32
  8. package/dist/components/excretions.component.js +0 -280
  9. package/dist/components/loading.component.d.ts +0 -14
  10. package/dist/components/loading.component.js +0 -96
  11. package/dist/components/pipette.component.d.ts +0 -23
  12. package/dist/components/pipette.component.js +0 -149
  13. package/dist/components/slot.component.d.ts +0 -10
  14. package/dist/components/slot.component.js +0 -31
  15. package/dist/config.d.ts +0 -23
  16. package/dist/config.js +0 -67
  17. package/dist/filters/collection/vague.d.ts +0 -13
  18. package/dist/filters/collection/vague.js +0 -150
  19. package/dist/filters/index.d.ts +0 -2
  20. package/dist/filters/index.js +0 -5
  21. package/dist/index.js +0 -69
  22. package/dist/services/component.service.d.ts +0 -5
  23. package/dist/services/component.service.js +0 -37
  24. package/dist/services/crop.service.d.ts +0 -7
  25. package/dist/services/crop.service.js +0 -50
  26. package/dist/services/download.service.d.ts +0 -4
  27. package/dist/services/download.service.js +0 -15
  28. package/dist/services/draw.service.d.ts +0 -17
  29. package/dist/services/draw.service.js +0 -152
  30. package/dist/services/event.service.d.ts +0 -16
  31. package/dist/services/event.service.js +0 -35
  32. package/dist/services/logger.service.d.ts +0 -20
  33. package/dist/services/logger.service.js +0 -38
  34. package/dist/services/projects.service.d.ts +0 -11
  35. package/dist/services/projects.service.js +0 -98
  36. package/dist/services/pull-project.service.d.ts +0 -8
  37. package/dist/services/pull-project.service.js +0 -34
  38. package/dist/services/store.service.d.ts +0 -6
  39. package/dist/services/store.service.js +0 -11
  40. package/dist/services/through-history.service.d.ts +0 -12
  41. package/dist/services/through-history.service.js +0 -49
  42. package/dist/services/tool-layers.service.d.ts +0 -4
  43. package/dist/services/tool-layers.service.js +0 -12
  44. package/dist/services/tool.service.d.ts +0 -10
  45. package/dist/services/tool.service.js +0 -56
  46. package/dist/store/history.state.d.ts +0 -15
  47. package/dist/store/history.state.js +0 -76
  48. package/dist/store/image.state.d.ts +0 -30
  49. package/dist/store/image.state.js +0 -70
  50. package/dist/store/store.d.ts +0 -13
  51. package/dist/store/store.js +0 -31
  52. package/dist/types/canvas.d.ts +0 -10
  53. package/dist/types/canvas.js +0 -3
  54. package/dist/types/cursor.d.ts +0 -9
  55. package/dist/types/cursor.js +0 -3
  56. package/dist/types/excretion.d.ts +0 -27
  57. package/dist/types/excretion.js +0 -5
  58. package/dist/types/general.d.ts +0 -24
  59. package/dist/types/general.js +0 -5
  60. package/dist/types/history.d.ts +0 -7
  61. package/dist/types/history.js +0 -2
  62. package/dist/types/image.d.ts +0 -48
  63. package/dist/types/image.js +0 -10
  64. package/dist/types/log.d.ts +0 -13
  65. package/dist/types/log.js +0 -5
  66. package/dist/types/pipette.d.ts +0 -1
  67. package/dist/types/pipette.js +0 -2
  68. package/dist/types/project.d.ts +0 -38
  69. package/dist/types/project.js +0 -14
  70. package/dist/utils/convert.d.ts +0 -12
  71. package/dist/utils/convert.js +0 -27
  72. package/dist/utils/filter.d.ts +0 -21
  73. package/dist/utils/filter.js +0 -150
  74. package/dist/utils/guid4.d.ts +0 -13
  75. package/dist/utils/guid4.js +0 -111
  76. package/dist/utils/project-file-serializer.d.ts +0 -13
  77. package/dist/utils/project-file-serializer.js +0 -79
  78. package/dist/web-component.d.ts +0 -26
  79. package/dist/web-component.js +0 -108
@@ -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;