canvas-editor-engine 2.3.51 → 2.3.52

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 CHANGED
@@ -2562,11 +2562,25 @@ var DrawLayersService = function() {
2562
2562
  if (options === null || options === void 0 ? void 0 : options.direction) {
2563
2563
  switch (options.direction) {
2564
2564
  case "up":
2565
- newOrder = layer.order - 1;
2565
+ newOrder = layer.order + 1;
2566
2566
  break;
2567
2567
 
2568
2568
  case "down":
2569
- newOrder = layer.order + 1;
2569
+ newOrder = layer.order - 1;
2570
+ break;
2571
+
2572
+ case "front":
2573
+ var mostMax = _this.layerList.sort((function(a, b) {
2574
+ return a.order - b.order;
2575
+ }))[0];
2576
+ newOrder = mostMax.order;
2577
+ break;
2578
+
2579
+ case "back":
2580
+ var mostMin = _this.layerList.sort((function(a, b) {
2581
+ return b.order - a.order;
2582
+ }))[0];
2583
+ newOrder = mostMin.order;
2570
2584
  break;
2571
2585
  }
2572
2586
  }
@@ -13,7 +13,7 @@ export interface ILayerUpdate {
13
13
  export type TReducerNames = 'SET_LAYERS' | 'UPDATE_LAYER' | 'ADD_LAYER' | 'REMOVE_LAYER';
14
14
  export interface IUpdateLayerOptions {
15
15
  to?: number;
16
- direction?: 'up' | 'down';
16
+ direction?: 'up' | 'down' | 'front' | 'back';
17
17
  addendum?: {
18
18
  operation: 'add' | 'subtract' | 'multiplication' | 'division';
19
19
  value: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "canvas-editor-engine",
3
- "version": "2.3.51",
3
+ "version": "2.3.52",
4
4
  "description": "CanvasEditorEngine library, use: [typescript] [canvas]",
5
5
  "main": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",