@node-projects/web-component-designer 0.1.182 → 0.1.184
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.
|
@@ -23,14 +23,16 @@ export class CssCurrentPropertiesService extends AbstractCssPropertiesService {
|
|
|
23
23
|
async getProperties(designItem) {
|
|
24
24
|
if (!designItem || designItem.nodeType != NodeType.Element)
|
|
25
25
|
return [];
|
|
26
|
-
let styles = designItem.getAllStyles().
|
|
26
|
+
let styles = designItem.getAllStyles().reverse().sort((a, b) => {
|
|
27
27
|
if (a.specificity == null)
|
|
28
28
|
return -1;
|
|
29
29
|
if (b.specificity == null)
|
|
30
30
|
return 1;
|
|
31
31
|
if (a.specificity.A > b.specificity.A || a.specificity.B > b.specificity.B || a.specificity.C > b.specificity.C)
|
|
32
32
|
return -1;
|
|
33
|
-
|
|
33
|
+
if (a.specificity.A === b.specificity.A && a.specificity.B === b.specificity.B && a.specificity.C === b.specificity.C)
|
|
34
|
+
return 0;
|
|
35
|
+
return 1;
|
|
34
36
|
});
|
|
35
37
|
let arr = styles.map(x => ({
|
|
36
38
|
name: (x.selector ?? localName) + (x.specificity ? ' (' + x.specificity.A + '-' + x.specificity.B + '-' + x.specificity.C + ')' : ''), description: x.stylesheetName ?? '', properties: [
|
package/dist/index.d.ts
CHANGED
|
@@ -140,6 +140,7 @@ export type { ISelectionService } from "./elements/services/selectionService/ISe
|
|
|
140
140
|
export * from "./elements/services/selectionService/SelectionService.js";
|
|
141
141
|
export type { IStyleRule, IStyleDeclaration, IStylesheet, IStylesheetService, IDocumentStylesheet } from "./elements/services/stylesheetService/IStylesheetService.js";
|
|
142
142
|
export * from "./elements/services/stylesheetService/AbstractStylesheetService.js";
|
|
143
|
+
export * from "./elements/services/stylesheetService/SpecifityCalculator.js";
|
|
143
144
|
export * from "./elements/services/undoService/ChangeGroup.js";
|
|
144
145
|
export type { ITransactionItem } from "./elements/services/undoService/ITransactionItem.js";
|
|
145
146
|
export type { IUndoService } from "./elements/services/undoService/IUndoService.js";
|
package/dist/index.js
CHANGED
|
@@ -93,6 +93,7 @@ export * from "./elements/services/refactorService/BindingsRefactorService.js";
|
|
|
93
93
|
export * from "./elements/services/refactorService/TextRefactorService.js";
|
|
94
94
|
export * from "./elements/services/selectionService/SelectionService.js";
|
|
95
95
|
export * from "./elements/services/stylesheetService/AbstractStylesheetService.js";
|
|
96
|
+
export * from "./elements/services/stylesheetService/SpecifityCalculator.js";
|
|
96
97
|
export * from "./elements/services/undoService/ChangeGroup.js";
|
|
97
98
|
export * from "./elements/services/undoService/UndoService.js";
|
|
98
99
|
export * from "./elements/services/undoService/transactionItems/AttributeChangeAction.js";
|
package/package.json
CHANGED