@mintjamsinc/ichigojs 0.1.46 → 0.1.48
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/ichigo.cjs +9 -5
- package/dist/ichigo.cjs.map +1 -1
- package/dist/ichigo.esm.js +9 -5
- package/dist/ichigo.esm.js.map +1 -1
- package/dist/ichigo.esm.min.js +1 -1
- package/dist/ichigo.min.cjs +1 -1
- package/dist/ichigo.umd.js +9 -5
- package/dist/ichigo.umd.js.map +1 -1
- package/dist/ichigo.umd.min.js +1 -1
- package/package.json +1 -1
package/dist/ichigo.cjs
CHANGED
|
@@ -7501,13 +7501,15 @@
|
|
|
7501
7501
|
}
|
|
7502
7502
|
else if (typeof cls === 'object' && cls !== null) {
|
|
7503
7503
|
// Handle object format within array: { className: condition }
|
|
7504
|
-
|
|
7504
|
+
// Keys may contain space-separated class names
|
|
7505
|
+
return Object.keys(cls).filter(key => cls[key]).flatMap(key => key.split(/\s+/).filter(Boolean));
|
|
7505
7506
|
}
|
|
7506
7507
|
return [];
|
|
7507
7508
|
});
|
|
7508
7509
|
}
|
|
7509
7510
|
else if (typeof value === 'object' && value !== null) {
|
|
7510
|
-
|
|
7511
|
+
// Keys may contain space-separated class names
|
|
7512
|
+
newClasses = Object.keys(value).filter(key => value[key]).flatMap(key => key.split(/\s+/).filter(Boolean));
|
|
7511
7513
|
}
|
|
7512
7514
|
// Remove previously managed classes
|
|
7513
7515
|
this.#managedClasses.forEach(cls => element.classList.remove(cls));
|
|
@@ -8619,8 +8621,10 @@
|
|
|
8619
8621
|
* @param functionDependencies A dictionary mapping function names to their dependencies.
|
|
8620
8622
|
*/
|
|
8621
8623
|
constructor(text, functionDependencies) {
|
|
8622
|
-
// Extract expressions in {{...}} using regex
|
|
8623
|
-
|
|
8624
|
+
// Extract expressions in {{...}} using regex.
|
|
8625
|
+
// Allow `}` inside the expression as long as it is not followed by another `}`,
|
|
8626
|
+
// so that object literals like `{ short: true }` are captured correctly.
|
|
8627
|
+
const regex = /\{\{((?:[^}]|\}(?!\}))+)\}\}/g;
|
|
8624
8628
|
const matches = Array.from(text.matchAll(regex));
|
|
8625
8629
|
// Gather identifiers from the extracted expressions
|
|
8626
8630
|
this.#identifiers = [];
|
|
@@ -8676,7 +8680,7 @@
|
|
|
8676
8680
|
* @returns True if the text contains expressions, false otherwise.
|
|
8677
8681
|
*/
|
|
8678
8682
|
static containsExpression(text) {
|
|
8679
|
-
const regex = /\{\{([^}]+)\}\}/g;
|
|
8683
|
+
const regex = /\{\{((?:[^}]|\}(?!\}))+)\}\}/g;
|
|
8680
8684
|
return regex.test(text);
|
|
8681
8685
|
}
|
|
8682
8686
|
/**
|