@getforma/core 0.8.2 → 0.9.0
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 +2 -0
- package/dist/forma-runtime-csp.js +1 -1
- package/dist/forma-runtime.js +1 -1
- package/dist/formajs-runtime-hardened.global.js +1 -1
- package/dist/formajs-runtime-hardened.global.js.map +1 -1
- package/dist/formajs-runtime.global.js +1 -1
- package/dist/formajs-runtime.global.js.map +1 -1
- package/dist/runtime-hardened.cjs +17 -0
- package/dist/runtime-hardened.cjs.map +1 -1
- package/dist/runtime-hardened.js +17 -0
- package/dist/runtime-hardened.js.map +1 -1
- package/dist/runtime.cjs +17 -0
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.js +17 -0
- package/dist/runtime.js.map +1 -1
- package/package.json +3 -1
package/dist/runtime-hardened.js
CHANGED
|
@@ -2742,6 +2742,23 @@ function mountScope(root) {
|
|
|
2742
2742
|
}
|
|
2743
2743
|
const scope = initScope(root);
|
|
2744
2744
|
const disposers = [];
|
|
2745
|
+
const refsMap = /* @__PURE__ */ new Map();
|
|
2746
|
+
const refEls = root.querySelectorAll("[data-ref]");
|
|
2747
|
+
for (let i = 0; i < refEls.length; i++) {
|
|
2748
|
+
const el = refEls[i];
|
|
2749
|
+
const name = el.getAttribute("data-ref");
|
|
2750
|
+
if (name) refsMap.set(name, el);
|
|
2751
|
+
}
|
|
2752
|
+
const rootRefName = root.getAttribute("data-ref");
|
|
2753
|
+
if (rootRefName) refsMap.set(rootRefName, root);
|
|
2754
|
+
scope.getters["$refs"] = () => new Proxy({}, {
|
|
2755
|
+
get(_, name) {
|
|
2756
|
+
return refsMap.get(name) ?? void 0;
|
|
2757
|
+
},
|
|
2758
|
+
has(_, name) {
|
|
2759
|
+
return refsMap.has(name);
|
|
2760
|
+
}
|
|
2761
|
+
});
|
|
2745
2762
|
bindElement(root, scope, disposers);
|
|
2746
2763
|
let boundCount = 0;
|
|
2747
2764
|
const selector = buildDirectiveSelector();
|