veo-sdk 0.6.0 → 0.6.1

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.
@@ -3164,13 +3164,83 @@ function markerOffset(anchor, marker, position, offset6) {
3164
3164
  }
3165
3165
  return { x: x + offset6.x, y: y + offset6.y };
3166
3166
  }
3167
+ var NO_CHILDREN = /* @__PURE__ */ new Set([
3168
+ "img",
3169
+ "input",
3170
+ "textarea",
3171
+ "select",
3172
+ "iframe",
3173
+ "video",
3174
+ "audio",
3175
+ "canvas",
3176
+ "br",
3177
+ "hr",
3178
+ "svg",
3179
+ "object",
3180
+ "embed"
3181
+ ]);
3182
+ function canNest(anchor) {
3183
+ const win = anchor.ownerDocument.defaultView;
3184
+ if (!win || !(anchor instanceof win.HTMLElement)) return false;
3185
+ if (NO_CHILDREN.has(anchor.tagName.toLowerCase())) return false;
3186
+ const cs = win.getComputedStyle(anchor);
3187
+ if (cs.display === "contents") return false;
3188
+ const tokens = `${cs.overflow} ${cs.overflowX} ${cs.overflowY}`.split(/\s+/).filter(Boolean);
3189
+ return tokens.every((t) => t === "visible");
3190
+ }
3167
3191
  function attachMarker(anchor, host, marker) {
3168
3192
  host.style.position = "absolute";
3169
3193
  host.style.zIndex = String(num(marker.zIndex, DEFAULT_MARKER_Z));
3170
3194
  host.style.margin = "0";
3195
+ const position = marker.position ?? "top-right";
3196
+ const offset6 = { x: num(marker.offsetX, 0), y: num(marker.offsetY, 0) };
3197
+ const markerSize = () => {
3198
+ const m = host.getBoundingClientRect();
3199
+ return { width: m.width, height: m.height };
3200
+ };
3201
+ if (canNest(anchor)) {
3202
+ const win = anchor.ownerDocument.defaultView;
3203
+ const prevPosition = anchor.style.position;
3204
+ const computed = win.getComputedStyle(anchor).position;
3205
+ if (!computed || computed === "static") anchor.style.position = "relative";
3206
+ anchor.appendChild(host);
3207
+ const swallowClick = (e) => {
3208
+ e.preventDefault();
3209
+ e.stopPropagation();
3210
+ };
3211
+ const swallow = (e) => e.stopPropagation();
3212
+ host.addEventListener("click", swallowClick);
3213
+ host.addEventListener("pointerdown", swallow);
3214
+ host.addEventListener("mousedown", swallow);
3215
+ const update2 = () => {
3216
+ const { x, y } = markerOffset(
3217
+ {
3218
+ left: -anchor.clientLeft,
3219
+ top: -anchor.clientTop,
3220
+ width: anchor.offsetWidth,
3221
+ height: anchor.offsetHeight
3222
+ },
3223
+ markerSize(),
3224
+ position,
3225
+ offset6
3226
+ );
3227
+ host.style.left = `${Math.round(x)}px`;
3228
+ host.style.top = `${Math.round(y)}px`;
3229
+ };
3230
+ update2();
3231
+ const stop2 = autoUpdate(anchor, host, update2, { ancestorScroll: false, layoutShift: false });
3232
+ return () => {
3233
+ stop2();
3234
+ host.removeEventListener("click", swallowClick);
3235
+ host.removeEventListener("pointerdown", swallow);
3236
+ host.removeEventListener("mousedown", swallow);
3237
+ host.remove();
3238
+ anchor.style.position = prevPosition;
3239
+ };
3240
+ }
3241
+ anchor.ownerDocument.body.appendChild(host);
3171
3242
  const update = () => {
3172
3243
  const a = anchor.getBoundingClientRect();
3173
- const m = host.getBoundingClientRect();
3174
3244
  const { x, y } = markerOffset(
3175
3245
  {
3176
3246
  left: a.left + window.scrollX,
@@ -3178,15 +3248,19 @@ function attachMarker(anchor, host, marker) {
3178
3248
  width: a.width,
3179
3249
  height: a.height
3180
3250
  },
3181
- { width: m.width, height: m.height },
3182
- marker.position ?? "top-right",
3183
- { x: num(marker.offsetX, 0), y: num(marker.offsetY, 0) }
3251
+ markerSize(),
3252
+ position,
3253
+ offset6
3184
3254
  );
3185
3255
  host.style.left = `${Math.round(x)}px`;
3186
3256
  host.style.top = `${Math.round(y)}px`;
3187
3257
  };
3188
3258
  update();
3189
- return autoUpdate(anchor, host, update);
3259
+ const stop = autoUpdate(anchor, host, update);
3260
+ return () => {
3261
+ stop();
3262
+ host.remove();
3263
+ };
3190
3264
  }
3191
3265
 
3192
3266
  // src/plugins/guides/renderers/composite-renderer.ts
@@ -3715,9 +3789,7 @@ var CompositeRenderer = class extends BaseRenderer {
3715
3789
  root.appendChild(wrapper);
3716
3790
  if (marker) {
3717
3791
  host.style.display = "inline-block";
3718
- (anchor.ownerDocument ?? document).body.appendChild(host);
3719
3792
  this.registerCleanup(attachMarker(anchor, host, marker));
3720
- this.registerCleanup(() => host.remove());
3721
3793
  } else {
3722
3794
  host.style.display = "inline-block";
3723
3795
  const pos = inlinePosOf(step.inlinePosition);
@@ -4815,5 +4887,5 @@ function buildSelectorPath(element, maxAncestors = 5) {
4815
4887
  }
4816
4888
 
4817
4889
  export { ALWAYS_BLOCK_SELECTORS, BadgeRenderer, BannerRenderer, CompositeRenderer, CustomRenderer, DEFAULT_AUTOCAPTURE_CONFIG, DEFAULT_TRACKER_BATCH_SIZE, DEFAULT_TRACKER_FLUSH_INTERVAL_MS, DEFAULT_TRACKER_MAX_RETRIES, FREQUENCY_CACHE_KEY_PREFIX, FREQUENCY_CACHE_MAX_ENTRIES, FREQUENCY_CACHE_TTL_MS, FormRenderer, GUIDE_STYLES, InlineCustomRenderer, InlineFormRenderer, InlineRenderer, MAX_ANCESTORS, ModalRenderer, PRIORITY_ATTRIBUTES, RAW_BLOCK_ATTR, SENSITIVE_ATTRIBUTES, TooltipRenderer, WALKTHROUGH_ABANDONMENT_TIMEOUT_MS, WALKTHROUGH_STATE_KEY_PREFIX, WalkthroughRenderer, activationDelayMs, applyBlockStyle, buildContentBlock, buildSelectorPath, clearBuilderToken, clearPreviewToken, closeGuidePreview, filterHumanClasses, getPreviewToken, groupLayout, hasDocument, hasLocalStorage, hasNavigatorSendBeacon, hasWindow, isAutomaticActivation, isBuilderMode, isDeviceAllowed, isSnoozed, previewGuide, resolveBuilderContext, resolveBuilderToken, stepMatchesPage, uuidv7 };
4818
- //# sourceMappingURL=chunk-O6USA4TU.mjs.map
4819
- //# sourceMappingURL=chunk-O6USA4TU.mjs.map
4890
+ //# sourceMappingURL=chunk-NGP7IJVE.mjs.map
4891
+ //# sourceMappingURL=chunk-NGP7IJVE.mjs.map