@node-projects/web-component-designer 0.1.175 → 0.1.176

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.
@@ -232,20 +232,24 @@ export class DocumentContainer extends BaseCustomWebComponentLazyAppend {
232
232
  }
233
233
  ready() {
234
234
  this._tabControl.onSelectedTabChanged.on(i => {
235
- if (i.oldIndex === 0) {
235
+ if (i.oldIndex === tabIndex.designer) {
236
236
  let primarySelection = this.instanceServiceContainer.selectionService.primarySelection;
237
237
  this._content = this.designerView.getHTML();
238
238
  if (this.designerView.instanceServiceContainer.designItemDocumentPositionService) {
239
239
  this._selectionPosition = this.designerView.instanceServiceContainer.designItemDocumentPositionService.getPosition(primarySelection);
240
240
  }
241
241
  }
242
- else if (i.oldIndex === 1) {
242
+ else if (i.oldIndex === tabIndex.code) {
243
243
  this._content = this.codeView.getText();
244
244
  }
245
- else if (i.oldIndex === 2) {
245
+ else if (i.oldIndex === tabIndex.split) {
246
246
  this._designerDiv.appendChild(this.designerView);
247
247
  this._codeDiv.appendChild(this.codeView);
248
248
  }
249
+ else if (i.oldIndex === tabIndex.preview) {
250
+ if (this.demoView?.stopDisplay)
251
+ this.demoView.stopDisplay();
252
+ }
249
253
  if (i.newIndex === tabIndex.designer || i.newIndex === tabIndex.split)
250
254
  this.updateDesignerHtml();
251
255
  if (i.newIndex === tabIndex.code || i.newIndex === tabIndex.split) {
@@ -24,7 +24,7 @@ export declare class DesignItem implements IDesignItem {
24
24
  nodeReplaced: TypedEvent<void>;
25
25
  get window(): Window & typeof globalThis;
26
26
  get document(): Document;
27
- get usableContainer(): Element | Document | ShadowRoot;
27
+ get usableContainer(): Element | ShadowRoot | Document;
28
28
  clone(): Promise<IDesignItem>;
29
29
  allMatching(selectors: string): Generator<IDesignItem, void, undefined>;
30
30
  replaceNode(newNode: Node): void;
@@ -4,4 +4,5 @@ import { InstanceServiceContainer } from '../../services/InstanceServiceContaine
4
4
  import { ServiceContainer } from '../../services/ServiceContainer.js';
5
5
  export interface IDemoView extends IUiCommandHandler, IDisposable, HTMLElement {
6
6
  display(serviceContainer: ServiceContainer, instanceServiceContainer: InstanceServiceContainer, code: string, style: string): any;
7
+ stopDisplay?: () => void;
7
8
  }
@@ -666,7 +666,9 @@ export class DesignerCanvas extends BaseCustomWebComponentLazyAppend {
666
666
  const ssca = new StylesheetChangedAction(this.instanceServiceContainer.stylesheetService, ss.name, ss.newStyle, ss.oldStyle);
667
667
  this.instanceServiceContainer.undoService.execute(ssca);
668
668
  }
669
- this.applyAllStyles();
669
+ else {
670
+ this.applyAllStyles();
671
+ }
670
672
  });
671
673
  this.instanceServiceContainer.stylesheetService.stylesheetsChanged.on(() => {
672
674
  this.applyAllStyles();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "description": "A WYSIWYG designer webcomponent for html components",
3
3
  "name": "@node-projects/web-component-designer",
4
- "version": "0.1.175",
4
+ "version": "0.1.176",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "author": "jochen.kuehner@gmx.de",