@getforma/core 0.8.1 → 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.
@@ -2744,6 +2744,23 @@ function mountScope(root) {
2744
2744
  }
2745
2745
  const scope = initScope(root);
2746
2746
  const disposers = [];
2747
+ const refsMap = /* @__PURE__ */ new Map();
2748
+ const refEls = root.querySelectorAll("[data-ref]");
2749
+ for (let i = 0; i < refEls.length; i++) {
2750
+ const el = refEls[i];
2751
+ const name = el.getAttribute("data-ref");
2752
+ if (name) refsMap.set(name, el);
2753
+ }
2754
+ const rootRefName = root.getAttribute("data-ref");
2755
+ if (rootRefName) refsMap.set(rootRefName, root);
2756
+ scope.getters["$refs"] = () => new Proxy({}, {
2757
+ get(_, name) {
2758
+ return refsMap.get(name) ?? void 0;
2759
+ },
2760
+ has(_, name) {
2761
+ return refsMap.has(name);
2762
+ }
2763
+ });
2747
2764
  bindElement(root, scope, disposers);
2748
2765
  let boundCount = 0;
2749
2766
  const selector = buildDirectiveSelector();