@wix/zero-config-implementation 1.20.0 → 1.21.0
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.
- package/dist/index.js +6495 -6324
- package/dist/information-extractors/css/selector-matcher.d.ts +4 -1
- package/dist/information-extractors/css/types.d.ts +10 -0
- package/dist/manifest-pipeline.d.ts +1 -0
- package/package.json +2 -2
- package/src/converters/data-item-builder.ts +1 -1
- package/src/converters/to-editor-component.ts +188 -34
- package/src/information-extractors/css/parse.ts +161 -34
- package/src/information-extractors/css/selector-matcher.ts +29 -2
- package/src/information-extractors/css/types.ts +11 -0
- package/src/manifest-pipeline.ts +6 -2
package/src/manifest-pipeline.ts
CHANGED
|
@@ -39,6 +39,7 @@ export interface ExtractedCssInfo {
|
|
|
39
39
|
|
|
40
40
|
export interface ComponentInfoWithCss extends CoupledComponentInfo {
|
|
41
41
|
css: ExtractedCssInfo[]
|
|
42
|
+
varUsedByTraceId: Map<string, Set<string>>
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
/** The result of processing a single component through the manifest pipeline. */
|
|
@@ -147,13 +148,15 @@ export function processComponent(
|
|
|
147
148
|
warnings.push(...cssWarnings)
|
|
148
149
|
|
|
149
150
|
// Match CSS selectors to elements
|
|
151
|
+
let varUsedByTraceId = new Map<string, Set<string>>()
|
|
150
152
|
if (html && extractedElements.length > 0 && css.length > 0) {
|
|
151
153
|
try {
|
|
152
|
-
const
|
|
154
|
+
const matchResult = matchCssSelectors(html, extractedElements, css)
|
|
153
155
|
enhancedInfo = {
|
|
154
156
|
...enhancedInfo,
|
|
155
|
-
elements: convertElements(
|
|
157
|
+
elements: convertElements(matchResult.elements),
|
|
156
158
|
}
|
|
159
|
+
varUsedByTraceId = matchResult.varUsedByTraceId
|
|
157
160
|
} catch (error) {
|
|
158
161
|
warnings.push({
|
|
159
162
|
componentName: componentInfo.componentName,
|
|
@@ -168,6 +171,7 @@ export function processComponent(
|
|
|
168
171
|
component: {
|
|
169
172
|
...enhancedInfo,
|
|
170
173
|
css,
|
|
174
|
+
varUsedByTraceId,
|
|
171
175
|
},
|
|
172
176
|
warnings,
|
|
173
177
|
}
|