@onereach/ui-components-vue2 26.9.0 → 26.9.1-beta.5984.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.
@@ -63,7 +63,7 @@ export { ModalSize, OrModalV3 } from './or-modal-v3/index.js';
63
63
  export { NotificationVariant, OrNotificationV3, VariantToIconName } from './or-notification-v3/index.js';
64
64
  export { OrOverlayV3 } from './or-overlay-v3/index.js';
65
65
  export { OrPaginationV3 } from './or-pagination-v3/index.js';
66
- export { OrPopoverV3, PopoverPlacement, PopoverVariant, isPrevented } from './or-popover-v3/index.js';
66
+ export { OrPopoverV3, PopoverPlacement, PopoverVariant, isCrossOriginIframe, isPrevented, safeAutoUpdate } from './or-popover-v3/index.js';
67
67
  export { OrProgressV3, ProgressColor, ProgressType } from './or-progress-v3/index.js';
68
68
  export { OrRadioGroupV3 } from './or-radio-group-v3/index.js';
69
69
  export { OrRadioV3 } from './or-radio-v3/index.js';
@@ -1,4 +1,4 @@
1
- import { computePosition, offset, shift, flip, hide, size, autoUpdate } from '@floating-ui/dom';
1
+ import { computePosition, autoUpdate, offset, shift, flip, hide, size } from '@floating-ui/dom';
2
2
  import { t as te, a as re, G } from '../../useValidationAttributes-Da9U8-T7-fd6d5d7d.js';
3
3
  import { onClickOutside } from '@vueuse/core';
4
4
  import { computed, unref, ref, shallowRef, watch, getCurrentScope, onScopeDispose, shallowReadonly, defineComponent, toRefs, toRef } from 'vue-demi';
@@ -174,6 +174,36 @@ var PopoverPlacement;
174
174
  PopoverPlacement["RightEnd"] = "right-end";
175
175
  })(PopoverPlacement || (PopoverPlacement = {}));
176
176
 
177
+ /**
178
+ * True when this document runs in a cross-origin iframe.
179
+ * Parent `window` access throws or is blocked (Safari logs SecurityError for frameElement).
180
+ */
181
+ function isCrossOriginIframe() {
182
+ if (typeof window === 'undefined' || window.self === window.top) {
183
+ return false;
184
+ }
185
+ try {
186
+ return !window.parent || !Object.getPrototypeOf(window.parent);
187
+ } catch {
188
+ return true;
189
+ }
190
+ }
191
+ /**
192
+ * Wrapper around Floating UI `autoUpdate` for embedded apps.
193
+ * Disables ancestor scroll/resize tracking in cross-origin iframes where Floating UI
194
+ * cannot safely traverse into the parent frame.
195
+ */
196
+ const safeAutoUpdate = (reference, floating, update, options = {}) => {
197
+ if (isCrossOriginIframe()) {
198
+ return autoUpdate(reference, floating, update, {
199
+ ...options,
200
+ ancestorScroll: false,
201
+ ancestorResize: false
202
+ });
203
+ }
204
+ return autoUpdate(reference, floating, update, options);
205
+ };
206
+
177
207
  const Popover = [
178
208
  // Position
179
209
  'absolute'];
@@ -357,7 +387,7 @@ var script = defineComponent({
357
387
  }
358
388
  })],
359
389
  whileElementsMounted(...args) {
360
- return autoUpdate(...args, {
390
+ return safeAutoUpdate(...args, {
361
391
  animationFrame: true
362
392
  });
363
393
  }
@@ -462,4 +492,4 @@ const __vue_component__ = /*#__PURE__*/normalizeComponent({
462
492
  }, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
463
493
  var OrPopover = __vue_component__;
464
494
 
465
- export { OrPopover as OrPopoverV3, PopoverPlacement, PopoverVariant, isPrevented };
495
+ export { OrPopover as OrPopoverV3, PopoverPlacement, PopoverVariant, isCrossOriginIframe, isPrevented, safeAutoUpdate };
@@ -1 +1,2 @@
1
1
  export * from './isPrevented';
2
+ export * from './safeAutoUpdate';
@@ -0,0 +1,14 @@
1
+ import { autoUpdate } from '@floating-ui/dom';
2
+ /**
3
+ * True when this document runs in a cross-origin iframe.
4
+ * Parent `window` access throws or is blocked (Safari logs SecurityError for frameElement).
5
+ */
6
+ export declare function isCrossOriginIframe(): boolean;
7
+ type AutoUpdateFn = typeof autoUpdate;
8
+ /**
9
+ * Wrapper around Floating UI `autoUpdate` for embedded apps.
10
+ * Disables ancestor scroll/resize tracking in cross-origin iframes where Floating UI
11
+ * cannot safely traverse into the parent frame.
12
+ */
13
+ export declare const safeAutoUpdate: AutoUpdateFn;
14
+ export {};
package/dist/esm/index.js CHANGED
@@ -69,7 +69,7 @@ export { ModalSize, OrModalV3 } from './components/or-modal-v3/index.js';
69
69
  export { NotificationVariant, OrNotificationV3, VariantToIconName } from './components/or-notification-v3/index.js';
70
70
  export { OrOverlayV3 } from './components/or-overlay-v3/index.js';
71
71
  export { OrPaginationV3 } from './components/or-pagination-v3/index.js';
72
- export { OrPopoverV3, PopoverPlacement, PopoverVariant, isPrevented } from './components/or-popover-v3/index.js';
72
+ export { OrPopoverV3, PopoverPlacement, PopoverVariant, isCrossOriginIframe, isPrevented, safeAutoUpdate } from './components/or-popover-v3/index.js';
73
73
  export { OrProgressV3, ProgressColor, ProgressType } from './components/or-progress-v3/index.js';
74
74
  export { OrRadioGroupV3 } from './components/or-radio-group-v3/index.js';
75
75
  export { OrRadioV3 } from './components/or-radio-v3/index.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components-vue2",
3
- "version": "26.9.0",
3
+ "version": "26.9.1-beta.5984.0",
4
4
  "description": "Vue components library for v2",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -38,10 +38,10 @@
38
38
  "@codemirror/lint": "^6",
39
39
  "@codemirror/state": "^6",
40
40
  "@codemirror/view": "^6",
41
- "@floating-ui/dom": "1.5.3",
41
+ "@floating-ui/dom": "1.6.13",
42
42
  "@lezer/highlight": "*",
43
- "@onereach/styles": "^26.9.0",
44
- "@onereach/ui-components-common": "^26.9.0",
43
+ "@onereach/styles": "^26.9.1-beta.5984.0",
44
+ "@onereach/ui-components-common": "^26.9.1-beta.5984.0",
45
45
  "@splidejs/splide": "4.0.6",
46
46
  "@tiptap/core": "2.27.1",
47
47
  "@tiptap/extension-blockquote": "2.27.1",
@@ -102,6 +102,5 @@
102
102
  "publishConfig": {
103
103
  "access": "public"
104
104
  },
105
- "npmUnpacked": "4.15.2",
106
- "gitHead": "8b1ea26b94c70d2eb9292af2c67dafa7f761c495"
105
+ "npmUnpacked": "4.15.2"
107
106
  }