agentation-vue 0.2.12 → 0.2.13

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.
@@ -43,6 +43,12 @@ function isHostDisabled(el) {
43
43
  return Boolean(el.disabled);
44
44
  return false;
45
45
  }
46
+ function getTooltipContainer(el) {
47
+ const root = el.getRootNode();
48
+ if (root instanceof ShadowRoot)
49
+ return root;
50
+ return document.body;
51
+ }
46
52
  function createTooltipElement(value) {
47
53
  const tooltipEl = document.createElement("div");
48
54
  tooltipEl.className = "__va-tooltip";
@@ -125,8 +131,9 @@ function showTooltipNow(el) {
125
131
  state.tooltipEl = createTooltipElement(state.value);
126
132
  else
127
133
  updateTooltipContent(state.tooltipEl, state.value);
128
- if (!document.body.contains(state.tooltipEl))
129
- document.body.appendChild(state.tooltipEl);
134
+ const container = getTooltipContainer(el);
135
+ if (state.tooltipEl.parentNode !== container)
136
+ container.appendChild(state.tooltipEl);
130
137
  positionTooltip(el);
131
138
  state.tooltipEl.classList.add("__va-tooltip--visible");
132
139
  attachWindowListeners(el);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentation-vue",
3
- "version": "0.2.12",
3
+ "version": "0.2.13",
4
4
  "description": "Visual feedback tool for AI coding agents — Vue 2.7 & 3",
5
5
  "author": "Dorian Becker",
6
6
  "license": "PolyForm-Shield-1.0.0",