@node-projects/web-component-designer 0.1.79 → 0.1.81

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.
@@ -153,7 +153,10 @@ export class DesignItem {
153
153
  }
154
154
  set id(value) {
155
155
  this.element.id = value;
156
- this.setAttribute("id", value);
156
+ if (this.id)
157
+ this.setAttribute("id", value);
158
+ else
159
+ this.removeAttribute("id");
157
160
  }
158
161
  get isRootItem() {
159
162
  return this.instanceServiceContainer.contentService.rootDesignItem === this;
@@ -0,0 +1,16 @@
1
+ import { IPoint } from "../../../interfaces/IPoint";
2
+ export interface IMultiplayerService {
3
+ signOn(userInfo: userInfo): any;
4
+ }
5
+ export type userInfo = {
6
+ name: string;
7
+ color: string;
8
+ };
9
+ export type userContext = {
10
+ name: string;
11
+ };
12
+ export type cursor = {
13
+ point: IPoint;
14
+ state: 'none' | 'pointing' | 'chat';
15
+ document: string;
16
+ };
@@ -0,0 +1,6 @@
1
+ import { TypedEvent } from "@node-projects/base-custom-webcomponent";
2
+ import { userInfo } from "./IMultiplayerService";
3
+ export declare class MultiplayerService {
4
+ constructor(getUserInfo: () => userInfo, sendMessage: (message: any) => void, messageReceived: () => any);
5
+ cursorsChanged: TypedEvent<string>;
6
+ }
@@ -0,0 +1,5 @@
1
+ export class MultiplayerService {
2
+ constructor(getUserInfo, sendMessage, messageReceived) {
3
+ }
4
+ cursorsChanged;
5
+ }
@@ -18,7 +18,7 @@ export class CommonPropertiesService extends AbstractPropertiesService {
18
18
  service: this,
19
19
  attributeName: "class",
20
20
  propertyName: "className",
21
- propertyType: PropertyType.propertyAndAttribute
21
+ propertyType: PropertyType.attribute
22
22
  }, {
23
23
  name: "title",
24
24
  type: "string",
@@ -247,12 +247,6 @@ export class DesignerCanvas extends BaseCustomWebComponentLazyAppend {
247
247
  #node-projects-designer-search-container > #node-projects-designer-search-close::after {
248
248
  transform: translate(-50%, -50%) rotate(-45deg);
249
249
  }
250
-
251
- #node-projects-designer-canvas-canvas {
252
- margin: 0;
253
- padding: 0;
254
- border: none;
255
- }
256
250
  `;
257
251
  static template = html `
258
252
  <div style="display: flex;flex-direction: column;width: 100%;height: 100%; margin: 0 !important; padding: 0 !important; border: none !important;">
@@ -102,6 +102,7 @@ export class PropertyGridWithHeader extends BaseCustomWebComponentLazyAppend {
102
102
  e.preventDefault();
103
103
  e.stopPropagation();
104
104
  }
105
+ PropertyGridPropertyList.refreshIsSetElementAndEditorForDesignItems(this._idRect, this._propertiesService.idProperty, this._instanceServiceContainer.selectionService.selectedElements, this._propertiesService);
105
106
  };
106
107
  this._content.onkeydown = e => {
107
108
  if (e.key == 'Enter') {
@@ -113,13 +114,18 @@ export class PropertyGridWithHeader extends BaseCustomWebComponentLazyAppend {
113
114
  e.preventDefault();
114
115
  e.stopPropagation();
115
116
  }
117
+ PropertyGridPropertyList.refreshIsSetElementAndEditorForDesignItems(this._contentRect, this._propertiesService.contentProperty, this._instanceServiceContainer.selectionService.selectedElements, this._propertiesService);
118
+ PropertyGridPropertyList.refreshIsSetElementAndEditorForDesignItems(this._innerRect, this._propertiesService.innerHtmlProperty, this._instanceServiceContainer.selectionService.selectedElements, this._propertiesService);
116
119
  };
117
120
  let pSel;
118
121
  this._id.onfocus = e => {
119
122
  pSel = this._instanceServiceContainer.selectionService.primarySelection;
120
123
  };
121
124
  this._id.onblur = e => {
122
- pSel.id = this._id.value;
125
+ if (pSel)
126
+ pSel.id = this._id.value;
127
+ pSel = null;
128
+ PropertyGridPropertyList.refreshIsSetElementAndEditorForDesignItems(this._idRect, this._propertiesService.idProperty, this._instanceServiceContainer.selectionService.selectedElements, this._propertiesService);
123
129
  };
124
130
  }
125
131
  set serviceContainer(value) {
@@ -145,6 +151,7 @@ export class PropertyGridWithHeader extends BaseCustomWebComponentLazyAppend {
145
151
  this._type.value = this._instanceServiceContainer.selectionService.primarySelection?.node?.nodeName ?? '';
146
152
  }
147
153
  this._type.title = this._type.value;
154
+ this._id.blur();
148
155
  this._id.value = this._instanceServiceContainer.selectionService.primarySelection?.id ?? '';
149
156
  if (this._instanceServiceContainer.selectionService.primarySelection?.element?.nodeType != NodeType.Element) {
150
157
  this._content.value = this._instanceServiceContainer.selectionService.primarySelection?.content ?? '';
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.1.79",
4
+ "version": "0.1.81",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "author": "jochen.kuehner@gmx.de",