fscss 1.1.21 → 1.1.22
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/e/exec.js +1695 -1
- package/e/xfscss.js +1720 -1
- package/exec.js +1695 -1
- package/lib/functions/all.js +19 -24
- package/package.json +1 -1
- package/xfscss.js +1720 -1
package/lib/functions/all.js
CHANGED
|
@@ -123,42 +123,37 @@ function parseConditionBlocks(block) {
|
|
|
123
123
|
}
|
|
124
124
|
return blocks;
|
|
125
125
|
}
|
|
126
|
+
|
|
126
127
|
function procExC(css) {
|
|
127
128
|
const regex = /exec\((_log|_error|_warn|_info),\s*(?:"([^"]*)"|'([^']*)'|([^)]*))\)/g;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
|
|
130
|
+
const methodMap = {
|
|
131
|
+
_log: console.log,
|
|
132
|
+
_error: console.error,
|
|
133
|
+
_warn: console.warn,
|
|
134
|
+
_info: console.info,
|
|
135
|
+
};
|
|
136
|
+
|
|
132
137
|
const cleanedCSS = css.replace(regex, (full, method, dQ, sQ, raw) => {
|
|
133
|
-
const arg = dQ
|
|
134
|
-
|
|
135
|
-
if (![
|
|
138
|
+
const arg = dQ ?? sQ ?? raw;
|
|
139
|
+
|
|
140
|
+
if (!methodMap[method]) {
|
|
136
141
|
console.warn(`fscss[exec(console)]: Unsupported method: ${method}`);
|
|
137
|
-
return '';
|
|
142
|
+
return '';
|
|
138
143
|
}
|
|
139
|
-
|
|
144
|
+
|
|
140
145
|
if (!arg) {
|
|
141
146
|
console.warn(`fscss[exec(console)]: Empty argument for method: ${method}`);
|
|
142
|
-
return '';
|
|
147
|
+
return '';
|
|
143
148
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
return '';
|
|
149
|
+
|
|
150
|
+
methodMap[method](arg);
|
|
151
|
+
return '';
|
|
147
152
|
});
|
|
148
|
-
|
|
149
|
-
// Run console code safely
|
|
150
|
-
if (jsCode) {
|
|
151
|
-
try {
|
|
152
|
-
new Function(jsCode)();
|
|
153
|
-
} catch (e) {
|
|
154
|
-
console.error("fscss[exec(console)]: Error executing transformed code:", e);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
153
|
+
|
|
158
154
|
return cleanedCSS;
|
|
159
155
|
}
|
|
160
156
|
|
|
161
|
-
|
|
162
157
|
function procEv(css) {
|
|
163
158
|
const functionMap = {};
|
|
164
159
|
const funcDefRegex = /@event\s+([\w-]+)\(([^)]*)\)\s*:?{/g;
|