@node-projects/web-component-designer 0.0.211 → 0.0.212
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.
|
@@ -15,6 +15,7 @@ export declare class DocumentContainer extends BaseCustomWebComponentLazyAppend
|
|
|
15
15
|
demoView: IDemoView & HTMLElement;
|
|
16
16
|
additionalData: any;
|
|
17
17
|
private _firstLoad;
|
|
18
|
+
private _stylesheetChangedEventRegistered;
|
|
18
19
|
private _additionalStyle;
|
|
19
20
|
set additionalStyleString(style: string);
|
|
20
21
|
get additionalStyleString(): string;
|
|
@@ -8,6 +8,7 @@ export class DocumentContainer extends BaseCustomWebComponentLazyAppend {
|
|
|
8
8
|
demoView;
|
|
9
9
|
additionalData;
|
|
10
10
|
_firstLoad = true;
|
|
11
|
+
_stylesheetChangedEventRegistered;
|
|
11
12
|
_additionalStyle;
|
|
12
13
|
set additionalStyleString(style) {
|
|
13
14
|
this._additionalStyle = style;
|
|
@@ -21,19 +22,12 @@ export class DocumentContainer extends BaseCustomWebComponentLazyAppend {
|
|
|
21
22
|
_additionalStylesheets;
|
|
22
23
|
set additionalStylesheets(stylesheets) {
|
|
23
24
|
this._additionalStylesheets = stylesheets;
|
|
24
|
-
if (!this.instanceServiceContainer.stylesheetService) {
|
|
25
|
-
const stylesheetService = this.designerView.serviceContainer.getLastService('stylesheetService');
|
|
26
|
-
if (stylesheetService) {
|
|
27
|
-
const instance = stylesheetService(this.designerView.designerCanvas);
|
|
28
|
-
this.instanceServiceContainer.register("stylesheetService", instance);
|
|
29
|
-
instance.stylesheetChanged.on(e => this.additionalStylesheetChanged.emit({ name: e.name, newStyle: e.newStyle, oldStyle: e.oldStyle, changeSource: e.changeSource }));
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
console.warn("no Stylesheet-Service registered, but additionalStylesheets are used.");
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
25
|
if (this.designerView.instanceServiceContainer.stylesheetService)
|
|
36
26
|
this.designerView.instanceServiceContainer.stylesheetService.setStylesheets(stylesheets);
|
|
27
|
+
if (!this._stylesheetChangedEventRegistered) {
|
|
28
|
+
this._stylesheetChangedEventRegistered = true;
|
|
29
|
+
this.designerView.instanceServiceContainer.stylesheetService.stylesheetChanged.on(e => this.additionalStylesheetChanged.emit({ name: e.name, newStyle: e.newStyle, oldStyle: e.oldStyle, changeSource: e.changeSource }));
|
|
30
|
+
}
|
|
37
31
|
}
|
|
38
32
|
;
|
|
39
33
|
get additionalStylesheets() {
|
|
@@ -150,6 +144,7 @@ export class DocumentContainer extends BaseCustomWebComponentLazyAppend {
|
|
|
150
144
|
}
|
|
151
145
|
dispose() {
|
|
152
146
|
this.codeView.dispose();
|
|
147
|
+
this.demoView.dispose();
|
|
153
148
|
}
|
|
154
149
|
executeCommand(command) {
|
|
155
150
|
if (this._tabControl.selectedIndex === 0 || this._tabControl.selectedIndex === 2)
|
|
@@ -433,21 +433,21 @@ export class DesignerCanvas extends BaseCustomWebComponentLazyAppend {
|
|
|
433
433
|
const contentService = this.serviceContainer.getLastService('contentService');
|
|
434
434
|
if (contentService)
|
|
435
435
|
this.instanceServiceContainer.register("contentService", contentService(this));
|
|
436
|
-
this.
|
|
437
|
-
|
|
436
|
+
const stylesheetService = this.serviceContainer.getLastService('stylesheetService');
|
|
437
|
+
if (stylesheetService) {
|
|
438
|
+
const instance = stylesheetService(this);
|
|
439
|
+
this.instanceServiceContainer.register("stylesheetService", instance);
|
|
440
|
+
this.instanceServiceContainer.stylesheetService.stylesheetChanged.on((ss) => {
|
|
441
|
+
if (ss.changeSource == 'extern') {
|
|
442
|
+
const ssca = new StylesheetChangedAction(this.instanceServiceContainer.stylesheetService, ss.name, ss.newStyle, ss.oldStyle);
|
|
443
|
+
this.instanceServiceContainer.undoService.execute(ssca);
|
|
444
|
+
}
|
|
438
445
|
this.applyAllStyles();
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
this.applyAllStyles();
|
|
445
|
-
});
|
|
446
|
-
this.instanceServiceContainer.stylesheetService.stylesheetsChanged.on(() => {
|
|
447
|
-
this.applyAllStyles();
|
|
448
|
-
});
|
|
449
|
-
}
|
|
450
|
-
});
|
|
446
|
+
});
|
|
447
|
+
this.instanceServiceContainer.stylesheetService.stylesheetsChanged.on(() => {
|
|
448
|
+
this.applyAllStyles();
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
451
|
this.extensionManager = new ExtensionManager(this);
|
|
452
452
|
this.overlayLayer = new OverlayLayerView(serviceContainer);
|
|
453
453
|
this.overlayLayer.style.pointerEvents = 'none';
|