@torpor/view 0.4.3 → 0.4.5
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/CHANGELOG.md +12 -0
- package/dist/compile.cjs +9 -11
- package/dist/compile.cjs.map +1 -1
- package/dist/compile.js +9 -11
- package/dist/compile.js.map +1 -1
- package/package.json +1 -1
- package/src/compile/build/client/replaceForVarNames.ts +1 -1
- package/src/compile/parse/scopeStyles.ts +13 -12
package/CHANGELOG.md
CHANGED
package/dist/compile.cjs
CHANGED
|
@@ -682,7 +682,7 @@ function printDebug(varName, status, b) {}
|
|
|
682
682
|
* Variables used within a for loop need to be retrieved from the loop data.
|
|
683
683
|
*/
|
|
684
684
|
function replaceForVarNames(value, status) {
|
|
685
|
-
for (let varName of status.forVarNames) value = value.replaceAll(new RegExp(`(^|\\s|\\(|\\[|\\{|!)${varName[0]}($|\\s
|
|
685
|
+
for (let varName of status.forVarNames) value = value.replaceAll(new RegExp(`(^|\\s|\\(|\\[|\\{|!)${varName[0]}($|\\s|\\.|,|\\(|\\)|\\[|\\]|\\}|;)`, "g"), `$1${varName[1]}$2`);
|
|
686
686
|
return value;
|
|
687
687
|
}
|
|
688
688
|
|
|
@@ -3363,16 +3363,14 @@ function scopeStyles(status) {
|
|
|
3363
3363
|
}
|
|
3364
3364
|
}
|
|
3365
3365
|
function scopeStylesOnNode(node, selectors) {
|
|
3366
|
-
if (isElementNode(node) || isComponentNode(node)) {
|
|
3367
|
-
|
|
3368
|
-
if (
|
|
3369
|
-
if (
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
node.scopeStyles = scopeStyles$1;
|
|
3375
|
-
}
|
|
3366
|
+
if (isElementNode(node) || isComponentNode(node)) node.scopeStyles = selectors.includes(node.tagName) || node.attributes.find((a) => {
|
|
3367
|
+
if (a.name === "class" && a.reactive) return true;
|
|
3368
|
+
else if (a.name === "id" && a.value) {
|
|
3369
|
+
if (selectors.includes(`#${trimQuotes(a.value)}`)) return true;
|
|
3370
|
+
} else if (a.name === "class" && a.value) {
|
|
3371
|
+
for (let classname of trimQuotes(a.value).split(/\s+/)) if (selectors.includes(`.${classname}`)) return true;
|
|
3372
|
+
}
|
|
3373
|
+
}) !== void 0;
|
|
3376
3374
|
if (isParentNode(node)) for (let child of node.children) scopeStylesOnNode(child, selectors);
|
|
3377
3375
|
}
|
|
3378
3376
|
function collectStyleSelectors(block, selectors) {
|