@getforma/core 1.0.9 → 1.0.10
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/README.md +1 -1
- package/dist/chunk-263HW3KN.cjs +35 -0
- package/dist/chunk-263HW3KN.cjs.map +1 -0
- package/dist/chunk-2QQBKQIF.js +30 -0
- package/dist/chunk-2QQBKQIF.js.map +1 -0
- package/dist/forma-runtime-csp.js +40 -2
- package/dist/forma-runtime.js +40 -2
- package/dist/formajs-runtime-hardened.global.js +40 -2
- package/dist/formajs-runtime-hardened.global.js.map +1 -1
- package/dist/formajs-runtime.global.js +40 -2
- package/dist/formajs-runtime.global.js.map +1 -1
- package/dist/runtime-hardened.cjs +40 -2
- package/dist/runtime-hardened.cjs.map +1 -1
- package/dist/runtime-hardened.js +40 -2
- package/dist/runtime-hardened.js.map +1 -1
- package/dist/runtime.cjs +18 -2
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.js +18 -2
- package/dist/runtime.js.map +1 -1
- package/dist/ssr/index.cjs +23 -42
- package/dist/ssr/index.cjs.map +1 -1
- package/dist/ssr/index.js +23 -42
- package/dist/ssr/index.js.map +1 -1
- package/package.json +2 -2
package/dist/runtime.cjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkT33QUD2Y_cjs = require('./chunk-T33QUD2Y.cjs');
|
|
4
|
+
var chunk263HW3KN_cjs = require('./chunk-263HW3KN.cjs');
|
|
4
5
|
var chunk6FW5E54W_cjs = require('./chunk-6FW5E54W.cjs');
|
|
5
6
|
var chunkQLPCVK7C_cjs = require('./chunk-QLPCVK7C.cjs');
|
|
6
7
|
|
|
@@ -335,6 +336,11 @@ function createReconciler(config) {
|
|
|
335
336
|
}
|
|
336
337
|
|
|
337
338
|
// src/runtime.ts
|
|
339
|
+
function isUnsafeAttrBinding(name, value) {
|
|
340
|
+
if (chunk263HW3KN_cjs.isEventHandlerAttr(name)) return true;
|
|
341
|
+
if (chunk263HW3KN_cjs.isUrlAttr(name) && chunk263HW3KN_cjs.isDangerousUrl(value)) return true;
|
|
342
|
+
return false;
|
|
343
|
+
}
|
|
338
344
|
var _refetchRegistry = /* @__PURE__ */ new Map();
|
|
339
345
|
function $refetch(id) {
|
|
340
346
|
const fn = _refetchRegistry.get(id);
|
|
@@ -1337,7 +1343,12 @@ function cloneAttributeTemplates(el, item) {
|
|
|
1337
1343
|
if (attr.value.includes("{item")) {
|
|
1338
1344
|
const compiled = compileTemplate(attr.value);
|
|
1339
1345
|
entries.push({ attr: attr.name, compiled });
|
|
1340
|
-
|
|
1346
|
+
const value = evaluateCompiledTemplate(compiled, item);
|
|
1347
|
+
if (isUnsafeAttrBinding(attr.name, value)) {
|
|
1348
|
+
node.removeAttribute(attr.name);
|
|
1349
|
+
} else {
|
|
1350
|
+
node.setAttribute(attr.name, value);
|
|
1351
|
+
}
|
|
1341
1352
|
}
|
|
1342
1353
|
}
|
|
1343
1354
|
if (entries.length > 0) {
|
|
@@ -2179,7 +2190,12 @@ function bindElement(el, scope, disposers) {
|
|
|
2179
2190
|
if (val == null || val === false) {
|
|
2180
2191
|
el.removeAttribute(attrName);
|
|
2181
2192
|
} else {
|
|
2182
|
-
|
|
2193
|
+
const str = String(val);
|
|
2194
|
+
if (isUnsafeAttrBinding(attrName, str)) {
|
|
2195
|
+
el.removeAttribute(attrName);
|
|
2196
|
+
} else {
|
|
2197
|
+
el.setAttribute(attrName, str);
|
|
2198
|
+
}
|
|
2183
2199
|
}
|
|
2184
2200
|
});
|
|
2185
2201
|
disposers.push(dispose);
|