@getforma/core 1.0.8 → 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/{chunk-TBWZZ3SI.js → chunk-3G7ET4O5.js} +32 -8
- package/dist/chunk-3G7ET4O5.js.map +1 -0
- package/dist/{chunk-BARF67I6.cjs → chunk-6FW5E54W.cjs} +32 -6
- package/dist/chunk-6FW5E54W.cjs.map +1 -0
- package/dist/{chunk-7Q7LIV23.js → chunk-AFRFF7XL.js} +64 -20
- package/dist/chunk-AFRFF7XL.js.map +1 -0
- package/dist/{chunk-7L3KHGEA.cjs → chunk-T33QUD2Y.cjs} +95 -51
- package/dist/chunk-T33QUD2Y.cjs.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/formajs.global.js +100 -24
- package/dist/formajs.global.js.map +1 -1
- package/dist/http.cjs +2 -2
- package/dist/http.js +1 -1
- package/dist/index.cjs +63 -52
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -1
- package/dist/index.d.ts +25 -1
- package/dist/index.js +14 -7
- package/dist/index.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 +41 -25
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.js +20 -4
- package/dist/runtime.js.map +1 -1
- package/dist/server.cjs +4 -4
- package/dist/server.js +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/chunk-7L3KHGEA.cjs.map +0 -1
- package/dist/chunk-7Q7LIV23.js.map +0 -1
- package/dist/chunk-BARF67I6.cjs.map +0 -1
- package/dist/chunk-TBWZZ3SI.js.map +0 -1
package/dist/runtime.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { reconcileList } from './chunk-
|
|
2
|
-
import {
|
|
1
|
+
import { reconcileList } from './chunk-AFRFF7XL.js';
|
|
2
|
+
import { isEventHandlerAttr, isUrlAttr, isDangerousUrl } from './chunk-2QQBKQIF.js';
|
|
3
|
+
import { internalEffect, batch } from './chunk-3G7ET4O5.js';
|
|
3
4
|
import { createSignal, createComputed } from './chunk-HLM5BZZQ.js';
|
|
4
5
|
|
|
5
6
|
// src/dom/reconcile.ts
|
|
@@ -333,6 +334,11 @@ function createReconciler(config) {
|
|
|
333
334
|
}
|
|
334
335
|
|
|
335
336
|
// src/runtime.ts
|
|
337
|
+
function isUnsafeAttrBinding(name, value) {
|
|
338
|
+
if (isEventHandlerAttr(name)) return true;
|
|
339
|
+
if (isUrlAttr(name) && isDangerousUrl(value)) return true;
|
|
340
|
+
return false;
|
|
341
|
+
}
|
|
336
342
|
var _refetchRegistry = /* @__PURE__ */ new Map();
|
|
337
343
|
function $refetch(id) {
|
|
338
344
|
const fn = _refetchRegistry.get(id);
|
|
@@ -1335,7 +1341,12 @@ function cloneAttributeTemplates(el, item) {
|
|
|
1335
1341
|
if (attr.value.includes("{item")) {
|
|
1336
1342
|
const compiled = compileTemplate(attr.value);
|
|
1337
1343
|
entries.push({ attr: attr.name, compiled });
|
|
1338
|
-
|
|
1344
|
+
const value = evaluateCompiledTemplate(compiled, item);
|
|
1345
|
+
if (isUnsafeAttrBinding(attr.name, value)) {
|
|
1346
|
+
node.removeAttribute(attr.name);
|
|
1347
|
+
} else {
|
|
1348
|
+
node.setAttribute(attr.name, value);
|
|
1349
|
+
}
|
|
1339
1350
|
}
|
|
1340
1351
|
}
|
|
1341
1352
|
if (entries.length > 0) {
|
|
@@ -2177,7 +2188,12 @@ function bindElement(el, scope, disposers) {
|
|
|
2177
2188
|
if (val == null || val === false) {
|
|
2178
2189
|
el.removeAttribute(attrName);
|
|
2179
2190
|
} else {
|
|
2180
|
-
|
|
2191
|
+
const str = String(val);
|
|
2192
|
+
if (isUnsafeAttrBinding(attrName, str)) {
|
|
2193
|
+
el.removeAttribute(attrName);
|
|
2194
|
+
} else {
|
|
2195
|
+
el.setAttribute(attrName, str);
|
|
2196
|
+
}
|
|
2181
2197
|
}
|
|
2182
2198
|
});
|
|
2183
2199
|
disposers.push(dispose);
|