canvas-editor-engine 1.0.13 → 1.0.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,6 +2,7 @@ import ComponentService from "../services/component.service";
2
2
  import type { IExcretionsCoords, TExcretionStyle, TExcretionToolState } from "../types/excretion";
3
3
  export default class ExcretionsComponent extends ComponentService {
4
4
  private static template;
5
+ private static templateExcretion;
5
6
  private static css;
6
7
  static excretionWrap: HTMLElement;
7
8
  private static _excretions;
@@ -109,7 +109,7 @@ class ExcretionsComponent extends component_service_1.default {
109
109
  const wrapOptions = {
110
110
  className: 'excretion',
111
111
  };
112
- const excretionTemplate = ExcretionsComponent.getTemplate('', wrapOptions);
112
+ const excretionTemplate = ExcretionsComponent.getTemplate(ExcretionsComponent.templateExcretion, wrapOptions);
113
113
  ExcretionsComponent.clearExcretionsCoords();
114
114
  const tempStart = {
115
115
  start: cursorPosition,
@@ -184,6 +184,11 @@ class ExcretionsComponent extends component_service_1.default {
184
184
  }
185
185
  }
186
186
  ExcretionsComponent.template = ``;
187
+ ExcretionsComponent.templateExcretion = `
188
+ <button type="button" class="crop-button">
189
+ <svg fill="#ffffff" viewBox="0 0 1920 1920" xmlns="http://www.w3.org/2000/svg" stroke="#ffffff"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path fill-rule="evenodd" clip-rule="evenodd" d="M426.667 0h106.666v1386.67H1920v106.66H426.667V0zM320 426.667H0v106.666h320V426.667zm320 0v106.666h746.67V1280h106.66V426.667H640zM1493.33 1600h-106.66v320h106.66v-320z"></path> </g></svg>
190
+ </button>
191
+ `;
187
192
  ExcretionsComponent.css = `
188
193
  .excretion {
189
194
  display: flex;
@@ -199,6 +204,16 @@ ExcretionsComponent.css = `
199
204
  box-shadow: 0px 0px 0px calc(100vw + 100vh) #50505070;
200
205
  }
201
206
 
207
+ .crop-button {
208
+ position: absolute;
209
+ padding: 3px;
210
+ right: -5px;
211
+ top: 0;
212
+ background: #23222270;
213
+ border: none;
214
+ border-radius: 4px;
215
+ }
216
+
202
217
  @keyframes border-dance {
203
218
  0% {
204
219
  background-position: left top, right bottom, left bottom, right top;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "canvas-editor-engine",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "description": "CanvasEditorEngine library, use: [typescript] [canvas]",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",