@node-projects/web-component-designer 0.0.123 → 0.0.125

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.
@@ -34,6 +34,7 @@ export declare class DesignerCanvas extends BaseCustomWebComponentLazyAppend imp
34
34
  private _scaleFactor;
35
35
  private _canvasOffset;
36
36
  private _currentContextMenu;
37
+ private _backgroundImage;
37
38
  get zoomFactor(): number;
38
39
  set zoomFactor(value: number);
39
40
  get scaleFactor(): number;
@@ -66,6 +67,8 @@ export declare class DesignerCanvas extends BaseCustomWebComponentLazyAppend imp
66
67
  get designerOffsetHeight(): number;
67
68
  set additionalStyles(value: CSSStyleSheet[]);
68
69
  executeCommand(command: IUiCommand): Promise<void>;
70
+ disableBackgroud(): void;
71
+ enableBackground(): void;
69
72
  zoomToFit(): void;
70
73
  canExecuteCommand(command: IUiCommand): boolean;
71
74
  handleSelectAll(): void;
@@ -41,6 +41,7 @@ export class DesignerCanvas extends BaseCustomWebComponentLazyAppend {
41
41
  _scaleFactor = 1; //if scale css property is used this need to be the scale value
42
42
  _canvasOffset = { x: 0, y: 0 };
43
43
  _currentContextMenu;
44
+ _backgroundImage;
44
45
  get zoomFactor() {
45
46
  return this._zoomFactor;
46
47
  }
@@ -234,8 +235,7 @@ export class DesignerCanvas extends BaseCustomWebComponentLazyAppend {
234
235
  {
235
236
  if (!this.instanceServiceContainer.selectionService.primarySelection) {
236
237
  this.zoomToFit();
237
- const backgroundImage = this._canvas.style.backgroundImage;
238
- this._canvas.style.backgroundImage = 'none';
238
+ this.disableBackgroud();
239
239
  await sleep(100);
240
240
  const el = this.rootDesignItem.element;
241
241
  const sel = this.instanceServiceContainer.selectionService.selectedElements;
@@ -243,7 +243,7 @@ export class DesignerCanvas extends BaseCustomWebComponentLazyAppend {
243
243
  const screenshot = await Screenshot.takeScreenshot(el, el.clientWidth, el.clientHeight);
244
244
  await exportData(dataURItoBlob(screenshot), "screenshot.png");
245
245
  this.instanceServiceContainer.selectionService.setSelectedElements(sel);
246
- this._canvas.style.backgroundImage = backgroundImage;
246
+ this.enableBackground();
247
247
  }
248
248
  else {
249
249
  if (!Screenshot.screenshotsEnabled) {
@@ -302,6 +302,13 @@ export class DesignerCanvas extends BaseCustomWebComponentLazyAppend {
302
302
  break;
303
303
  }
304
304
  }
305
+ disableBackgroud() {
306
+ this._backgroundImage = this._canvas.style.backgroundImage;
307
+ this._canvas.style.backgroundImage = 'none';
308
+ }
309
+ enableBackground() {
310
+ this._canvas.style.backgroundImage = this._backgroundImage;
311
+ }
305
312
  zoomToFit() {
306
313
  const autoZomOffset = 10;
307
314
  let maxX = 0, maxY = 0, minX = 0, minY = 0;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "description": "A UI designer for Polymer apps",
3
3
  "name": "@node-projects/web-component-designer",
4
- "version": "0.0.123",
4
+ "version": "0.0.125",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "author": "",