@node-projects/web-component-designer 0.1.172 → 0.1.174
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.
|
@@ -316,7 +316,7 @@ export class ContextMenu {
|
|
|
316
316
|
close() {
|
|
317
317
|
this._menuElement.remove();
|
|
318
318
|
window.removeEventListener("keyup", this._windowKeyUp);
|
|
319
|
-
window.removeEventListener("mousedown", this._windowDown
|
|
319
|
+
window.removeEventListener("mousedown", this._windowDown);
|
|
320
320
|
window.removeEventListener("resize", this._windowResize);
|
|
321
321
|
setTimeout(() => window.removeEventListener("contextmenu", this._windowDown), 10);
|
|
322
322
|
}
|
|
@@ -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 |
|
|
27
|
+
get usableContainer(): Element | Document | ShadowRoot;
|
|
28
28
|
clone(): Promise<IDesignItem>;
|
|
29
29
|
allMatching(selectors: string): Generator<IDesignItem, void, undefined>;
|
|
30
30
|
replaceNode(newNode: Node): void;
|
|
@@ -608,7 +608,9 @@ export class DesignItem {
|
|
|
608
608
|
return [{ selector: null, declarations: localStyles, specificity: -1 }, ...rules];
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
|
-
catch (err) {
|
|
611
|
+
catch (err) {
|
|
612
|
+
console.warn('getAppliedRules', err);
|
|
613
|
+
}
|
|
612
614
|
}
|
|
613
615
|
styles = [{ selector: null, declarations: localStyles, specificity: -1 }];
|
|
614
616
|
this._stylesCache = styles;
|
|
@@ -112,11 +112,14 @@ export class AbstractStylesheetService {
|
|
|
112
112
|
if (designItem == null)
|
|
113
113
|
return true;
|
|
114
114
|
for (let selector of selectors) {
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
115
|
+
const patched = AbstractStylesheetService.patchStylesheetSelectorForDesigner(selector);
|
|
116
|
+
try {
|
|
117
|
+
if (designItem.element.matches(patched))
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
catch (err) {
|
|
121
|
+
console.warn("invalid selector: ", selector, "patched: " + patched);
|
|
122
|
+
}
|
|
120
123
|
}
|
|
121
124
|
return false;
|
|
122
125
|
}
|
package/package.json
CHANGED