@iframe-resizer/vue 6.0.0-beta.1 → 6.0.0-beta.3

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 CHANGED
@@ -7,7 +7,7 @@
7
7
  This package is part of the __[iframe-resizer](https://iframe-resizer.com)__ library, which automatically resizes the height and width of both same-origin and cross-origin iframes to match their content. It also includes a range of features designed to address common issues associated with using iframes.
8
8
 
9
9
 
10
- __For more information, visit [iframe-resizer.com](https://iframe-resizer.com).__
10
+ __For more information, please visit [iframe-resizer.com](https://iframe-resizer.com).__
11
11
 
12
12
  ## Install
13
13
 
@@ -25,4 +25,4 @@ yarn add @iframe-resizer/vue
25
25
 
26
26
  ---
27
27
 
28
- _iframe-resizer version 6.0.0-beta.1 2026-03-25 - 18:13:42.672Z_
28
+ _iframe-resizer version 6.0.0-beta.3 2026-04-10 - 14:34:29.781Z_
@@ -6,7 +6,7 @@
6
6
  import { onBeforeUnmount, onMounted, ref, toRaw } from 'vue'
7
7
  import type { PropType } from 'vue'
8
8
  import connectResizer from '@iframe-resizer/core'
9
- import type { IFrameObject, LogOption } from '@iframe-resizer/core'
9
+ import type { IframeObject, LogOption } from '@iframe-resizer/core'
10
10
  import acg from 'auto-console-group'
11
11
 
12
12
  const EXPAND = 'expanded'
@@ -54,7 +54,7 @@
54
54
  default: undefined,
55
55
  },
56
56
  inPageLinks: Boolean,
57
- offset: Number,
57
+ offsetSize: Number,
58
58
  scrolling: Boolean,
59
59
  tolerance: Number,
60
60
  warningTimeout: Number,
@@ -67,7 +67,7 @@
67
67
  }>()
68
68
 
69
69
  const iframeRef = ref<HTMLIFrameElement | null>(null)
70
- const resizer = ref<IFrameObject | null>(null)
70
+ const resizer = ref<IframeObject | null>(null)
71
71
 
72
72
  onMounted(() => {
73
73
  const consoleGroup = createAutoConsoleGroup()
@@ -106,7 +106,6 @@
106
106
 
107
107
  defineExpose({
108
108
  moveToAnchor: (anchor: string) => resizer.value?.moveToAnchor(anchor),
109
- resize: () => resizer.value?.resize(),
110
109
  sendMessage: (msg: any, target?: string) =>
111
110
  resizer.value?.sendMessage(msg, target),
112
111
  })
@@ -1,25 +1,11 @@
1
1
  import type { DefineComponent } from 'vue'
2
- import type { IFrameObject } from '@iframe-resizer/core'
2
+ import type { IframeObject, IframeOptions } from '@iframe-resizer/core'
3
3
 
4
- export interface IframeResizerProps {
5
- license: string
6
- bodyBackground?: string
7
- bodyMargin?: string
8
- bodyPadding?: string
9
- checkOrigin?: boolean
10
- direction?: string
11
- log?: 'expanded' | 'collapsed' | boolean | number
12
- inPageLinks?: boolean
13
- offset?: number
14
- scrolling?: boolean
15
- tolerance?: number
16
- warningTimeout?: number
17
- }
4
+ export type IframeResizerProps = Omit<IframeOptions, 'id' | 'onBeforeClose'>
18
5
 
19
- /** Methods exposed via defineExpose, accessible on template refs */
20
- export type IframeResizerMethods = Pick<IFrameObject, 'moveToAnchor' | 'resize' | 'sendMessage'>
6
+ export type IframeResizerMethods = Pick<IframeObject, 'moveToAnchor' | 'sendMessage'>
21
7
 
22
- export interface IframeResizerEmits {
8
+ export type IframeResizerEmits = {
23
9
  onReady: (...args: any[]) => void
24
10
  onMessage: (...args: any[]) => void
25
11
  onResized: (...args: any[]) => void
package/index.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";const o=require("vue"),g=require("@iframe-resizer/core"),v=require("auto-console-group"),l="expanded",u="collapsed",R=o.defineComponent({name:"IframeResizer",__name:"iframe-resizer",props:{license:{type:String,required:!0},bodyBackground:String,bodyMargin:String,bodyPadding:String,checkOrigin:{type:Boolean,default:!0},direction:String,log:{type:[String,Boolean,Number],validator:r=>{switch(r){case u:case l:case!1:case!0:case-1:case 0:case 1:case 2:return!0;default:return!1}},default:void 0},inPageLinks:Boolean,offset:Number,scrolling:Boolean,tolerance:Number,warningTimeout:Number},emits:["onReady","onMessage","onResized"],setup(r,{expose:d,emit:f}){const m=(e=>e?.__esModule?e.default:e)(v),p=r,a=f,c=o.ref(null),s=o.ref(null);return o.onMounted(()=>{const e=m(),t=c.value,i={...Object.fromEntries(Object.entries(o.toRaw(p)).filter(([,n])=>n!==void 0)),waitForLoad:!0,onBeforeClose:()=>(e.event("Blocked Close Event"),e.warn("Close method is disabled, use Vue to remove iframe"),!1),onReady:(...n)=>a("onReady",...n),onMessage:(...n)=>a("onMessage",...n),onResized:(...n)=>a("onResized",...n)};e.label(`vue(${t.id})`),e.event("setup"),s.value=g(i)(t),e.expand(i.logExpand),[u,l,!0].includes(i.log)&&e.log("Created Vue component")}),o.onBeforeUnmount(()=>{s.value?.disconnect()}),d({moveToAnchor:e=>s.value?.moveToAnchor(e),resize:()=>s.value?.resize(),sendMessage:(e,t)=>s.value?.sendMessage(e,t)}),(e,t)=>(o.openBlock(),o.createElementBlock("iframe",o.mergeProps({ref_key:"iframeRef",ref:c},e.$attrs),null,16))}}),b={install(r){r.component("IframeResizer",R)}};module.exports=b;
1
+ "use strict";const o=require("vue"),g=require("@iframe-resizer/core"),v=require("auto-console-group"),l="expanded",u="collapsed",R=o.defineComponent({name:"IframeResizer",__name:"iframe-resizer",props:{license:{type:String,required:!0},bodyBackground:String,bodyMargin:String,bodyPadding:String,checkOrigin:{type:Boolean,default:!0},direction:String,log:{type:[String,Boolean,Number],validator:r=>{switch(r){case u:case l:case!1:case!0:case-1:case 0:case 1:case 2:return!0;default:return!1}},default:void 0},inPageLinks:Boolean,offsetSize:Number,scrolling:Boolean,tolerance:Number,warningTimeout:Number},emits:["onReady","onMessage","onResized"],setup(r,{expose:d,emit:f}){const m=(e=>e?.__esModule?e.default:e)(v),p=r,a=f,c=o.ref(null),s=o.ref(null);return o.onMounted(()=>{const e=m(),t=c.value,i={...Object.fromEntries(Object.entries(o.toRaw(p)).filter(([,n])=>n!==void 0)),waitForLoad:!0,onBeforeClose:()=>(e.event("Blocked Close Event"),e.warn("Close method is disabled, use Vue to remove iframe"),!1),onReady:(...n)=>a("onReady",...n),onMessage:(...n)=>a("onMessage",...n),onResized:(...n)=>a("onResized",...n)};e.label(`vue(${t.id})`),e.event("setup"),s.value=g(i)(t),e.expand(i.logExpand),[u,l,!0].includes(i.log)&&e.log("Created Vue component")}),o.onBeforeUnmount(()=>{s.value?.disconnect()}),d({moveToAnchor:e=>s.value?.moveToAnchor(e),sendMessage:(e,t)=>s.value?.sendMessage(e,t)}),(e,t)=>(o.openBlock(),o.createElementBlock("iframe",o.mergeProps({ref_key:"iframeRef",ref:c},e.$attrs),null,16))}}),b={install(r){r.component("IframeResizer",R)}};module.exports=b;
2
2
  //# sourceMappingURL=index.cjs.js.map
package/index.cjs.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../../packages/vue/iframe-resizer.vue","../../packages/vue/index.ts"],"sourcesContent":["<template>\n <iframe ref=\"iframeRef\" v-bind=\"$attrs\"></iframe>\n</template>\n\n<script setup lang=\"ts\">\n import { onBeforeUnmount, onMounted, ref, toRaw } from 'vue'\n import type { PropType } from 'vue'\n import connectResizer from '@iframe-resizer/core'\n import type { IFrameObject, LogOption } from '@iframe-resizer/core'\n import acg from 'auto-console-group'\n\n const EXPAND = 'expanded'\n const COLLAPSE = 'collapsed'\n\n const esModuleInterop = (mod: any) =>\n // eslint-disable-next-line no-underscore-dangle\n mod?.__esModule ? mod.default : mod\n\n // Deal with UMD not converting default exports to named exports\n const createAutoConsoleGroup = esModuleInterop(acg)\n\n defineOptions({ name: 'IframeResizer' })\n\n const props = defineProps({\n license: {\n type: String,\n required: true,\n },\n bodyBackground: String,\n bodyMargin: String,\n bodyPadding: String,\n checkOrigin: {\n type: Boolean,\n default: true,\n },\n direction: String,\n log: {\n type: [String, Boolean, Number] as PropType<LogOption>,\n validator: (value: LogOption) => {\n switch (value) {\n case COLLAPSE:\n case EXPAND:\n case false:\n case true:\n case -1:\n case 0:\n case 1:\n case 2:\n return true\n default:\n return false\n }\n },\n default: undefined,\n },\n inPageLinks: Boolean,\n offset: Number,\n scrolling: Boolean,\n tolerance: Number,\n warningTimeout: Number,\n })\n\n const emit = defineEmits<{\n onReady: [...args: any[]]\n onMessage: [...args: any[]]\n onResized: [...args: any[]]\n }>()\n\n const iframeRef = ref<HTMLIFrameElement | null>(null)\n const resizer = ref<IFrameObject | null>(null)\n\n onMounted(() => {\n const consoleGroup = createAutoConsoleGroup()\n // Template refs are guaranteed populated before onMounted fires\n const iframe = iframeRef.value!\n const options: any = {\n ...Object.fromEntries(\n Object.entries(toRaw(props)).filter(([, value]) => value !== undefined),\n ),\n waitForLoad: true,\n\n onBeforeClose: () => {\n consoleGroup.event('Blocked Close Event')\n consoleGroup.warn('Close method is disabled, use Vue to remove iframe')\n return false\n },\n onReady: (...args: any[]) => emit('onReady', ...args),\n onMessage: (...args: any[]) => emit('onMessage', ...args),\n onResized: (...args: any[]) => emit('onResized', ...args),\n }\n\n consoleGroup.label(`vue(${iframe.id})`)\n consoleGroup.event('setup')\n\n resizer.value = connectResizer(options)(iframe)\n\n consoleGroup.expand(options.logExpand)\n if ([COLLAPSE, EXPAND, true].includes(options.log as any)) {\n consoleGroup.log('Created Vue component')\n }\n })\n\n onBeforeUnmount(() => {\n resizer.value?.disconnect()\n })\n\n defineExpose({\n moveToAnchor: (anchor: string) => resizer.value?.moveToAnchor(anchor),\n resize: () => resizer.value?.resize(),\n sendMessage: (msg: any, target?: string) =>\n resizer.value?.sendMessage(msg, target),\n })\n</script>\n","import type { App } from 'vue'\n\nimport IframeResizer from './iframe-resizer.vue'\n\nexport default {\n install(app: App) {\n app.component('IframeResizer', IframeResizer)\n },\n}\n"],"names":["EXPAND","COLLAPSE","createAutoConsoleGroup","mod","acg","props","__props","emit","__emit","iframeRef","ref","resizer","onMounted","consoleGroup","iframe","options","toRaw","value","args","connectResizer","onBeforeUnmount","__expose","anchor","msg","target","_openBlock","_createElementBlock","_mergeProps","$attrs","index","app","IframeResizer"],"mappings":"sGAWQA,EAAS,WACTC,EAAW,wiBAOjB,MAAMC,GALmBC,GAEvBA,GAAK,WAAaA,EAAI,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b,QAAQC,EAAU,CAChBA,EAAI,UAAU,gBAAiBC,CAAa,CAC9C,CACF"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../../packages/vue/iframe-resizer.vue","../../packages/vue/index.ts"],"sourcesContent":["<template>\n <iframe ref=\"iframeRef\" v-bind=\"$attrs\"></iframe>\n</template>\n\n<script setup lang=\"ts\">\n import { onBeforeUnmount, onMounted, ref, toRaw } from 'vue'\n import type { PropType } from 'vue'\n import connectResizer from '@iframe-resizer/core'\n import type { IframeObject, LogOption } from '@iframe-resizer/core'\n import acg from 'auto-console-group'\n\n const EXPAND = 'expanded'\n const COLLAPSE = 'collapsed'\n\n const esModuleInterop = (mod: any) =>\n // eslint-disable-next-line no-underscore-dangle\n mod?.__esModule ? mod.default : mod\n\n // Deal with UMD not converting default exports to named exports\n const createAutoConsoleGroup = esModuleInterop(acg)\n\n defineOptions({ name: 'IframeResizer' })\n\n const props = defineProps({\n license: {\n type: String,\n required: true,\n },\n bodyBackground: String,\n bodyMargin: String,\n bodyPadding: String,\n checkOrigin: {\n type: Boolean,\n default: true,\n },\n direction: String,\n log: {\n type: [String, Boolean, Number] as PropType<LogOption>,\n validator: (value: LogOption) => {\n switch (value) {\n case COLLAPSE:\n case EXPAND:\n case false:\n case true:\n case -1:\n case 0:\n case 1:\n case 2:\n return true\n default:\n return false\n }\n },\n default: undefined,\n },\n inPageLinks: Boolean,\n offsetSize: Number,\n scrolling: Boolean,\n tolerance: Number,\n warningTimeout: Number,\n })\n\n const emit = defineEmits<{\n onReady: [...args: any[]]\n onMessage: [...args: any[]]\n onResized: [...args: any[]]\n }>()\n\n const iframeRef = ref<HTMLIFrameElement | null>(null)\n const resizer = ref<IframeObject | null>(null)\n\n onMounted(() => {\n const consoleGroup = createAutoConsoleGroup()\n // Template refs are guaranteed populated before onMounted fires\n const iframe = iframeRef.value!\n const options: any = {\n ...Object.fromEntries(\n Object.entries(toRaw(props)).filter(([, value]) => value !== undefined),\n ),\n waitForLoad: true,\n\n onBeforeClose: () => {\n consoleGroup.event('Blocked Close Event')\n consoleGroup.warn('Close method is disabled, use Vue to remove iframe')\n return false\n },\n onReady: (...args: any[]) => emit('onReady', ...args),\n onMessage: (...args: any[]) => emit('onMessage', ...args),\n onResized: (...args: any[]) => emit('onResized', ...args),\n }\n\n consoleGroup.label(`vue(${iframe.id})`)\n consoleGroup.event('setup')\n\n resizer.value = connectResizer(options)(iframe)\n\n consoleGroup.expand(options.logExpand)\n if ([COLLAPSE, EXPAND, true].includes(options.log as any)) {\n consoleGroup.log('Created Vue component')\n }\n })\n\n onBeforeUnmount(() => {\n resizer.value?.disconnect()\n })\n\n defineExpose({\n moveToAnchor: (anchor: string) => resizer.value?.moveToAnchor(anchor),\n sendMessage: (msg: any, target?: string) =>\n resizer.value?.sendMessage(msg, target),\n })\n</script>\n","import type { App } from 'vue'\n\nimport IframeResizer from './iframe-resizer.vue'\n\nexport default {\n install(app: App) {\n app.component('IframeResizer', IframeResizer)\n },\n}\n\nexport type {\n IframeComponent,\n IframeMessageData,\n IframeMouseData,\n IframeObject,\n IframeOptions,\n IframeResizedData,\n IframeScrollData,\n} from '@iframe-resizer/core'\n"],"names":["EXPAND","COLLAPSE","createAutoConsoleGroup","mod","acg","props","__props","emit","__emit","iframeRef","ref","resizer","onMounted","consoleGroup","iframe","options","toRaw","value","args","connectResizer","onBeforeUnmount","__expose","anchor","msg","target","_openBlock","_createElementBlock","_mergeProps","$attrs","index","app","IframeResizer"],"mappings":"sGAWQA,EAAS,WACTC,EAAW,4iBAOjB,MAAMC,GALmBC,GAEvBA,GAAK,WAAaA,EAAI,QAAUA,GAGaC,CAAG,EAI5CC,EAAQC,EAuCRC,EAAOC,EAMPC,EAAYC,EAAAA,IAA8B,IAAI,EAC9CC,EAAUD,EAAAA,IAAyB,IAAI,EAE7CE,OAAAA,EAAAA,UAAU,IAAM,CACd,MAAMC,EAAeX,EAAA,EAEfY,EAASL,EAAU,MACnBM,EAAe,CACnB,GAAG,OAAO,YACR,OAAO,QAAQC,EAAAA,MAAMX,CAAK,CAAC,EAAE,OAAO,CAAC,CAAA,CAAGY,CAAK,IAAMA,IAAU,MAAS,CAAA,EAExE,YAAa,GAEb,cAAe,KACbJ,EAAa,MAAM,qBAAqB,EACxCA,EAAa,KAAK,oDAAoD,EAC/D,IAET,QAAS,IAAIK,IAAgBX,EAAK,UAAW,GAAGW,CAAI,EACpD,UAAW,IAAIA,IAAgBX,EAAK,YAAa,GAAGW,CAAI,EACxD,UAAW,IAAIA,IAAgBX,EAAK,YAAa,GAAGW,CAAI,CAAA,EAG1DL,EAAa,MAAM,OAAOC,EAAO,EAAE,GAAG,EACtCD,EAAa,MAAM,OAAO,EAE1BF,EAAQ,MAAQQ,EAAeJ,CAAO,EAAED,CAAM,EAE9CD,EAAa,OAAOE,EAAQ,SAAS,EACjC,CAACd,EAAUD,EAAQ,EAAI,EAAE,SAASe,EAAQ,GAAU,GACtDF,EAAa,IAAI,uBAAuB,CAE5C,CAAC,EAEDO,EAAAA,gBAAgB,IAAM,CACpBT,EAAQ,OAAO,WAAA,CACjB,CAAC,EAEDU,EAAa,CACX,aAAeC,GAAmBX,EAAQ,OAAO,aAAaW,CAAM,EACpE,YAAa,CAACC,EAAUC,IACtBb,EAAQ,OAAO,YAAYY,EAAKC,CAAM,CAAA,CACzC,UA7GDC,EAAAA,YAAAC,EAAAA,mBAAiD,SAAjDC,aAAiD,SAArC,YAAJ,IAAIlB,CAAA,EAAoBmB,EAAAA,MAAM,EAAA,KAAA,EAAA,MCGxCC,EAAe,CACb,QAAQC,EAAU,CAChBA,EAAI,UAAU,gBAAiBC,CAAa,CAC9C,CACF"}
package/index.d.ts CHANGED
@@ -3,3 +3,4 @@ declare const _default: {
3
3
  install(app: App): void;
4
4
  };
5
5
  export default _default;
6
+ export type { IframeComponent, IframeMessageData, IframeMouseData, IframeObject, IframeOptions, IframeResizedData, IframeScrollData, } from '@iframe-resizer/core';
package/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
- import { defineComponent as g, ref as l, onMounted as v, toRaw as R, onBeforeUnmount as b, openBlock as y, createElementBlock as z, mergeProps as B } from "vue";
2
- import M from "@iframe-resizer/core";
3
- import _ from "auto-console-group";
4
- const c = "expanded", u = "collapsed", k = /* @__PURE__ */ g({
1
+ import { defineComponent as g, ref as l, onMounted as v, toRaw as R, onBeforeUnmount as b, openBlock as y, createElementBlock as B, mergeProps as M } from "vue";
2
+ import z from "@iframe-resizer/core";
3
+ import S from "auto-console-group";
4
+ const c = "expanded", u = "collapsed", _ = /* @__PURE__ */ g({
5
5
  name: "IframeResizer",
6
6
  __name: "iframe-resizer",
7
7
  props: {
@@ -37,7 +37,7 @@ const c = "expanded", u = "collapsed", k = /* @__PURE__ */ g({
37
37
  default: void 0
38
38
  },
39
39
  inPageLinks: Boolean,
40
- offset: Number,
40
+ offsetSize: Number,
41
41
  scrolling: Boolean,
42
42
  tolerance: Number,
43
43
  warningTimeout: Number
@@ -47,9 +47,9 @@ const c = "expanded", u = "collapsed", k = /* @__PURE__ */ g({
47
47
  const f = ((e) => (
48
48
  // eslint-disable-next-line no-underscore-dangle
49
49
  e?.__esModule ? e.default : e
50
- ))(_), p = n, s = m, i = l(null), r = l(null);
50
+ ))(S), p = n, s = m, i = l(null), t = l(null);
51
51
  return v(() => {
52
- const e = f(), t = i.value, a = {
52
+ const e = f(), r = i.value, a = {
53
53
  ...Object.fromEntries(
54
54
  Object.entries(R(p)).filter(([, o]) => o !== void 0)
55
55
  ),
@@ -59,16 +59,15 @@ const c = "expanded", u = "collapsed", k = /* @__PURE__ */ g({
59
59
  onMessage: (...o) => s("onMessage", ...o),
60
60
  onResized: (...o) => s("onResized", ...o)
61
61
  };
62
- e.label(`vue(${t.id})`), e.event("setup"), r.value = M(a)(t), e.expand(a.logExpand), [u, c, !0].includes(a.log) && e.log("Created Vue component");
62
+ e.label(`vue(${r.id})`), e.event("setup"), t.value = z(a)(r), e.expand(a.logExpand), [u, c, !0].includes(a.log) && e.log("Created Vue component");
63
63
  }), b(() => {
64
- r.value?.disconnect();
64
+ t.value?.disconnect();
65
65
  }), d({
66
- moveToAnchor: (e) => r.value?.moveToAnchor(e),
67
- resize: () => r.value?.resize(),
68
- sendMessage: (e, t) => r.value?.sendMessage(e, t)
69
- }), (e, t) => (y(), z(
66
+ moveToAnchor: (e) => t.value?.moveToAnchor(e),
67
+ sendMessage: (e, r) => t.value?.sendMessage(e, r)
68
+ }), (e, r) => (y(), B(
70
69
  "iframe",
71
- B({
70
+ M({
72
71
  ref_key: "iframeRef",
73
72
  ref: i
74
73
  }, e.$attrs),
@@ -79,7 +78,7 @@ const c = "expanded", u = "collapsed", k = /* @__PURE__ */ g({
79
78
  }
80
79
  }), E = {
81
80
  install(n) {
82
- n.component("IframeResizer", k);
81
+ n.component("IframeResizer", _);
83
82
  }
84
83
  };
85
84
  export {
package/index.esm.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":["../../packages/vue/iframe-resizer.vue","../../packages/vue/index.ts"],"sourcesContent":["<template>\n <iframe ref=\"iframeRef\" v-bind=\"$attrs\"></iframe>\n</template>\n\n<script setup lang=\"ts\">\n import { onBeforeUnmount, onMounted, ref, toRaw } from 'vue'\n import type { PropType } from 'vue'\n import connectResizer from '@iframe-resizer/core'\n import type { IFrameObject, LogOption } from '@iframe-resizer/core'\n import acg from 'auto-console-group'\n\n const EXPAND = 'expanded'\n const COLLAPSE = 'collapsed'\n\n const esModuleInterop = (mod: any) =>\n // eslint-disable-next-line no-underscore-dangle\n mod?.__esModule ? mod.default : mod\n\n // Deal with UMD not converting default exports to named exports\n const createAutoConsoleGroup = esModuleInterop(acg)\n\n defineOptions({ name: 'IframeResizer' })\n\n const props = defineProps({\n license: {\n type: String,\n required: true,\n },\n bodyBackground: String,\n bodyMargin: String,\n bodyPadding: String,\n checkOrigin: {\n type: Boolean,\n default: true,\n },\n direction: String,\n log: {\n type: [String, Boolean, Number] as PropType<LogOption>,\n validator: (value: LogOption) => {\n switch (value) {\n case COLLAPSE:\n case EXPAND:\n case false:\n case true:\n case -1:\n case 0:\n case 1:\n case 2:\n return true\n default:\n return false\n }\n },\n default: undefined,\n },\n inPageLinks: Boolean,\n offset: Number,\n scrolling: Boolean,\n tolerance: Number,\n warningTimeout: Number,\n })\n\n const emit = defineEmits<{\n onReady: [...args: any[]]\n onMessage: [...args: any[]]\n onResized: [...args: any[]]\n }>()\n\n const iframeRef = ref<HTMLIFrameElement | null>(null)\n const resizer = ref<IFrameObject | null>(null)\n\n onMounted(() => {\n const consoleGroup = createAutoConsoleGroup()\n // Template refs are guaranteed populated before onMounted fires\n const iframe = iframeRef.value!\n const options: any = {\n ...Object.fromEntries(\n Object.entries(toRaw(props)).filter(([, value]) => value !== undefined),\n ),\n waitForLoad: true,\n\n onBeforeClose: () => {\n consoleGroup.event('Blocked Close Event')\n consoleGroup.warn('Close method is disabled, use Vue to remove iframe')\n return false\n },\n onReady: (...args: any[]) => emit('onReady', ...args),\n onMessage: (...args: any[]) => emit('onMessage', ...args),\n onResized: (...args: any[]) => emit('onResized', ...args),\n }\n\n consoleGroup.label(`vue(${iframe.id})`)\n consoleGroup.event('setup')\n\n resizer.value = connectResizer(options)(iframe)\n\n consoleGroup.expand(options.logExpand)\n if ([COLLAPSE, EXPAND, true].includes(options.log as any)) {\n consoleGroup.log('Created Vue component')\n }\n })\n\n onBeforeUnmount(() => {\n resizer.value?.disconnect()\n })\n\n defineExpose({\n moveToAnchor: (anchor: string) => resizer.value?.moveToAnchor(anchor),\n resize: () => resizer.value?.resize(),\n sendMessage: (msg: any, target?: string) =>\n resizer.value?.sendMessage(msg, target),\n })\n</script>\n","import type { App } from 'vue'\n\nimport IframeResizer from './iframe-resizer.vue'\n\nexport default {\n install(app: App) {\n app.component('IframeResizer', IframeResizer)\n },\n}\n"],"names":["EXPAND","COLLAPSE","createAutoConsoleGroup","mod","acg","props","__props","emit","__emit","iframeRef","ref","resizer","onMounted","consoleGroup","iframe","options","toRaw","value","args","connectResizer","onBeforeUnmount","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AO,aAAaW,CAAM;AAAA,MACpE,QAAQ,MAAMX,EAAQ,OAAO,OAAA;AAAA,MAC7B,aAAa,CAACY,GAAUC,MACtBb,EAAQ,OAAO,YAAYY,GAAKC,CAAM;AAAA,IAAA,CACzC,cA9GDC,KAAAC;AAAAA,MAAiD;AAAA,MAAjDC,EAAiD;AAAA,iBAArC;AAAA,QAAJ,KAAIlB;AAAA,MAAA,GAAoBmB,EAAAA,MAAM;AAAA,MAAA;AAAA,MAAA;AAAA;AAAA,IAAA;AAAA;ICGxCC,IAAe;AAAA,EACb,QAAQC,GAAU;AAChB,IAAAA,EAAI,UAAU,iBAAiBC,CAAa;AAAA,EAC9C;AACF;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../../packages/vue/iframe-resizer.vue","../../packages/vue/index.ts"],"sourcesContent":["<template>\n <iframe ref=\"iframeRef\" v-bind=\"$attrs\"></iframe>\n</template>\n\n<script setup lang=\"ts\">\n import { onBeforeUnmount, onMounted, ref, toRaw } from 'vue'\n import type { PropType } from 'vue'\n import connectResizer from '@iframe-resizer/core'\n import type { IframeObject, LogOption } from '@iframe-resizer/core'\n import acg from 'auto-console-group'\n\n const EXPAND = 'expanded'\n const COLLAPSE = 'collapsed'\n\n const esModuleInterop = (mod: any) =>\n // eslint-disable-next-line no-underscore-dangle\n mod?.__esModule ? mod.default : mod\n\n // Deal with UMD not converting default exports to named exports\n const createAutoConsoleGroup = esModuleInterop(acg)\n\n defineOptions({ name: 'IframeResizer' })\n\n const props = defineProps({\n license: {\n type: String,\n required: true,\n },\n bodyBackground: String,\n bodyMargin: String,\n bodyPadding: String,\n checkOrigin: {\n type: Boolean,\n default: true,\n },\n direction: String,\n log: {\n type: [String, Boolean, Number] as PropType<LogOption>,\n validator: (value: LogOption) => {\n switch (value) {\n case COLLAPSE:\n case EXPAND:\n case false:\n case true:\n case -1:\n case 0:\n case 1:\n case 2:\n return true\n default:\n return false\n }\n },\n default: undefined,\n },\n inPageLinks: Boolean,\n offsetSize: Number,\n scrolling: Boolean,\n tolerance: Number,\n warningTimeout: Number,\n })\n\n const emit = defineEmits<{\n onReady: [...args: any[]]\n onMessage: [...args: any[]]\n onResized: [...args: any[]]\n }>()\n\n const iframeRef = ref<HTMLIFrameElement | null>(null)\n const resizer = ref<IframeObject | null>(null)\n\n onMounted(() => {\n const consoleGroup = createAutoConsoleGroup()\n // Template refs are guaranteed populated before onMounted fires\n const iframe = iframeRef.value!\n const options: any = {\n ...Object.fromEntries(\n Object.entries(toRaw(props)).filter(([, value]) => value !== undefined),\n ),\n waitForLoad: true,\n\n onBeforeClose: () => {\n consoleGroup.event('Blocked Close Event')\n consoleGroup.warn('Close method is disabled, use Vue to remove iframe')\n return false\n },\n onReady: (...args: any[]) => emit('onReady', ...args),\n onMessage: (...args: any[]) => emit('onMessage', ...args),\n onResized: (...args: any[]) => emit('onResized', ...args),\n }\n\n consoleGroup.label(`vue(${iframe.id})`)\n consoleGroup.event('setup')\n\n resizer.value = connectResizer(options)(iframe)\n\n consoleGroup.expand(options.logExpand)\n if ([COLLAPSE, EXPAND, true].includes(options.log as any)) {\n consoleGroup.log('Created Vue component')\n }\n })\n\n onBeforeUnmount(() => {\n resizer.value?.disconnect()\n })\n\n defineExpose({\n moveToAnchor: (anchor: string) => resizer.value?.moveToAnchor(anchor),\n sendMessage: (msg: any, target?: string) =>\n resizer.value?.sendMessage(msg, target),\n })\n</script>\n","import type { App } from 'vue'\n\nimport IframeResizer from './iframe-resizer.vue'\n\nexport default {\n install(app: App) {\n app.component('IframeResizer', IframeResizer)\n },\n}\n\nexport type {\n IframeComponent,\n IframeMessageData,\n IframeMouseData,\n IframeObject,\n IframeOptions,\n IframeResizedData,\n IframeScrollData,\n} from '@iframe-resizer/core'\n"],"names":["EXPAND","COLLAPSE","createAutoConsoleGroup","mod","acg","props","__props","emit","__emit","iframeRef","ref","resizer","onMounted","consoleGroup","iframe","options","toRaw","value","args","connectResizer","onBeforeUnmount","__expose","anchor","msg","target","_openBlock","_createElementBlock","_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,CAACC,GAAUC,MACtBb,EAAQ,OAAO,YAAYY,GAAKC,CAAM;AAAA,IAAA,CACzC,cA7GDC,KAAAC;AAAAA,MAAiD;AAAA,MAAjDC,EAAiD;AAAA,iBAArC;AAAA,QAAJ,KAAIlB;AAAA,MAAA,GAAoBmB,EAAAA,MAAM;AAAA,MAAA;AAAA,MAAA;AAAA;AAAA,IAAA;AAAA;ICGxCC,IAAe;AAAA,EACb,QAAQC,GAAU;AAChB,IAAAA,EAAI,UAAU,iBAAiBC,CAAa;AAAA,EAC9C;AACF;"}
package/index.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r(require("vue"),require("@iframe-resizer/core"),require("auto-console-group")):typeof define=="function"&&define.amd?define(["vue","@iframe-resizer/core","auto-console-group"],r):(e=typeof globalThis<"u"?globalThis:e||self,e.IframeResizer=r(e.Vue,e.connectResizer,e.acg))})(this,(function(e,r,f){"use strict";const u="expanded",d="collapsed",m=e.defineComponent({name:"IframeResizer",__name:"iframe-resizer",props:{license:{type:String,required:!0},bodyBackground:String,bodyMargin:String,bodyPadding:String,checkOrigin:{type:Boolean,default:!0},direction:String,log:{type:[String,Boolean,Number],validator:t=>{switch(t){case d:case u:case!1:case!0:case-1:case 0:case 1:case 2:return!0;default:return!1}},default:void 0},inPageLinks:Boolean,offset:Number,scrolling:Boolean,tolerance:Number,warningTimeout:Number},emits:["onReady","onMessage","onResized"],setup(t,{expose:p,emit:g}){const z=(o=>o?.__esModule?o.default:o)(f),R=t,a=g,l=e.ref(null),s=e.ref(null);return e.onMounted(()=>{const o=z(),i=l.value,c={...Object.fromEntries(Object.entries(e.toRaw(R)).filter(([,n])=>n!==void 0)),waitForLoad:!0,onBeforeClose:()=>(o.event("Blocked Close Event"),o.warn("Close method is disabled, use Vue to remove iframe"),!1),onReady:(...n)=>a("onReady",...n),onMessage:(...n)=>a("onMessage",...n),onResized:(...n)=>a("onResized",...n)};o.label(`vue(${i.id})`),o.event("setup"),s.value=r(c)(i),o.expand(c.logExpand),[d,u,!0].includes(c.log)&&o.log("Created Vue component")}),e.onBeforeUnmount(()=>{s.value?.disconnect()}),p({moveToAnchor:o=>s.value?.moveToAnchor(o),resize:()=>s.value?.resize(),sendMessage:(o,i)=>s.value?.sendMessage(o,i)}),(o,i)=>(e.openBlock(),e.createElementBlock("iframe",e.mergeProps({ref_key:"iframeRef",ref:l},o.$attrs),null,16))}});return{install(t){t.component("IframeResizer",m)}}}));
1
+ (function(e,r){typeof exports=="object"&&typeof module<"u"?module.exports=r(require("vue"),require("@iframe-resizer/core"),require("auto-console-group")):typeof define=="function"&&define.amd?define(["vue","@iframe-resizer/core","auto-console-group"],r):(e=typeof globalThis<"u"?globalThis:e||self,e.IframeResizer=r(e.Vue,e.connectResizer,e.acg))})(this,(function(e,r,f){"use strict";const u="expanded",d="collapsed",m=e.defineComponent({name:"IframeResizer",__name:"iframe-resizer",props:{license:{type:String,required:!0},bodyBackground:String,bodyMargin:String,bodyPadding:String,checkOrigin:{type:Boolean,default:!0},direction:String,log:{type:[String,Boolean,Number],validator:t=>{switch(t){case d:case u:case!1:case!0:case-1:case 0:case 1:case 2:return!0;default:return!1}},default:void 0},inPageLinks:Boolean,offsetSize:Number,scrolling:Boolean,tolerance:Number,warningTimeout:Number},emits:["onReady","onMessage","onResized"],setup(t,{expose:p,emit:g}){const R=(o=>o?.__esModule?o.default:o)(f),y=t,a=g,l=e.ref(null),i=e.ref(null);return e.onMounted(()=>{const o=R(),s=l.value,c={...Object.fromEntries(Object.entries(e.toRaw(y)).filter(([,n])=>n!==void 0)),waitForLoad:!0,onBeforeClose:()=>(o.event("Blocked Close Event"),o.warn("Close method is disabled, use Vue to remove iframe"),!1),onReady:(...n)=>a("onReady",...n),onMessage:(...n)=>a("onMessage",...n),onResized:(...n)=>a("onResized",...n)};o.label(`vue(${s.id})`),o.event("setup"),i.value=r(c)(s),o.expand(c.logExpand),[d,u,!0].includes(c.log)&&o.log("Created Vue component")}),e.onBeforeUnmount(()=>{i.value?.disconnect()}),p({moveToAnchor:o=>i.value?.moveToAnchor(o),sendMessage:(o,s)=>i.value?.sendMessage(o,s)}),(o,s)=>(e.openBlock(),e.createElementBlock("iframe",e.mergeProps({ref_key:"iframeRef",ref:l},o.$attrs),null,16))}});return{install(t){t.component("IframeResizer",m)}}}));
2
2
  //# sourceMappingURL=index.umd.js.map
package/index.umd.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.js","sources":["../../packages/vue/iframe-resizer.vue","../../packages/vue/index.ts"],"sourcesContent":["<template>\n <iframe ref=\"iframeRef\" v-bind=\"$attrs\"></iframe>\n</template>\n\n<script setup lang=\"ts\">\n import { onBeforeUnmount, onMounted, ref, toRaw } from 'vue'\n import type { PropType } from 'vue'\n import connectResizer from '@iframe-resizer/core'\n import type { IFrameObject, LogOption } from '@iframe-resizer/core'\n import acg from 'auto-console-group'\n\n const EXPAND = 'expanded'\n const COLLAPSE = 'collapsed'\n\n const esModuleInterop = (mod: any) =>\n // eslint-disable-next-line no-underscore-dangle\n mod?.__esModule ? mod.default : mod\n\n // Deal with UMD not converting default exports to named exports\n const createAutoConsoleGroup = esModuleInterop(acg)\n\n defineOptions({ name: 'IframeResizer' })\n\n const props = defineProps({\n license: {\n type: String,\n required: true,\n },\n bodyBackground: String,\n bodyMargin: String,\n bodyPadding: String,\n checkOrigin: {\n type: Boolean,\n default: true,\n },\n direction: String,\n log: {\n type: [String, Boolean, Number] as PropType<LogOption>,\n validator: (value: LogOption) => {\n switch (value) {\n case COLLAPSE:\n case EXPAND:\n case false:\n case true:\n case -1:\n case 0:\n case 1:\n case 2:\n return true\n default:\n return false\n }\n },\n default: undefined,\n },\n inPageLinks: Boolean,\n offset: Number,\n scrolling: Boolean,\n tolerance: Number,\n warningTimeout: Number,\n })\n\n const emit = defineEmits<{\n onReady: [...args: any[]]\n onMessage: [...args: any[]]\n onResized: [...args: any[]]\n }>()\n\n const iframeRef = ref<HTMLIFrameElement | null>(null)\n const resizer = ref<IFrameObject | null>(null)\n\n onMounted(() => {\n const consoleGroup = createAutoConsoleGroup()\n // Template refs are guaranteed populated before onMounted fires\n const iframe = iframeRef.value!\n const options: any = {\n ...Object.fromEntries(\n Object.entries(toRaw(props)).filter(([, value]) => value !== undefined),\n ),\n waitForLoad: true,\n\n onBeforeClose: () => {\n consoleGroup.event('Blocked Close Event')\n consoleGroup.warn('Close method is disabled, use Vue to remove iframe')\n return false\n },\n onReady: (...args: any[]) => emit('onReady', ...args),\n onMessage: (...args: any[]) => emit('onMessage', ...args),\n onResized: (...args: any[]) => emit('onResized', ...args),\n }\n\n consoleGroup.label(`vue(${iframe.id})`)\n consoleGroup.event('setup')\n\n resizer.value = connectResizer(options)(iframe)\n\n consoleGroup.expand(options.logExpand)\n if ([COLLAPSE, EXPAND, true].includes(options.log as any)) {\n consoleGroup.log('Created Vue component')\n }\n })\n\n onBeforeUnmount(() => {\n resizer.value?.disconnect()\n })\n\n defineExpose({\n moveToAnchor: (anchor: string) => resizer.value?.moveToAnchor(anchor),\n resize: () => resizer.value?.resize(),\n sendMessage: (msg: any, target?: string) =>\n resizer.value?.sendMessage(msg, target),\n })\n</script>\n","import type { App } from 'vue'\n\nimport IframeResizer from './iframe-resizer.vue'\n\nexport default {\n install(app: App) {\n app.component('IframeResizer', IframeResizer)\n },\n}\n"],"names":["EXPAND","COLLAPSE","createAutoConsoleGroup","mod","acg","props","__props","emit","__emit","iframeRef","ref","resizer","onMounted","consoleGroup","iframe","options","toRaw","value","args","connectResizer","onBeforeUnmount","__expose","anchor","msg","target","_openBlock","_createElementBlock","_mergeProps","$attrs","app","IframeResizer"],"mappings":"gYAWE,MAAMA,EAAS,WACTC,EAAW,wiBAOjB,MAAMC,GALmBC,GAEvBA,GAAK,WAAaA,EAAI,QAAUA,GAGaC,CAAG,EAI5CC,EAAQC,EAuCRC,EAAOC,EAMPC,EAAYC,EAAAA,IAA8B,IAAI,EAC9CC,EAAUD,EAAAA,IAAyB,I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ue/index.ts"],"sourcesContent":["<template>\n <iframe ref=\"iframeRef\" v-bind=\"$attrs\"></iframe>\n</template>\n\n<script setup lang=\"ts\">\n import { onBeforeUnmount, onMounted, ref, toRaw } from 'vue'\n import type { PropType } from 'vue'\n import connectResizer from '@iframe-resizer/core'\n import type { IframeObject, LogOption } from '@iframe-resizer/core'\n import acg from 'auto-console-group'\n\n const EXPAND = 'expanded'\n const COLLAPSE = 'collapsed'\n\n const esModuleInterop = (mod: any) =>\n // eslint-disable-next-line no-underscore-dangle\n mod?.__esModule ? mod.default : mod\n\n // Deal with UMD not converting default exports to named exports\n const createAutoConsoleGroup = esModuleInterop(acg)\n\n defineOptions({ name: 'IframeResizer' })\n\n const props = defineProps({\n license: {\n type: String,\n required: true,\n },\n bodyBackground: String,\n bodyMargin: String,\n bodyPadding: String,\n checkOrigin: {\n type: Boolean,\n default: true,\n },\n direction: String,\n log: {\n type: [String, Boolean, Number] as PropType<LogOption>,\n validator: (value: LogOption) => {\n switch (value) {\n case COLLAPSE:\n case EXPAND:\n case false:\n case true:\n case -1:\n case 0:\n case 1:\n case 2:\n return true\n default:\n return false\n }\n },\n default: undefined,\n },\n inPageLinks: Boolean,\n offsetSize: Number,\n scrolling: Boolean,\n tolerance: Number,\n warningTimeout: Number,\n })\n\n const emit = defineEmits<{\n onReady: [...args: any[]]\n onMessage: [...args: any[]]\n onResized: [...args: any[]]\n }>()\n\n const iframeRef = ref<HTMLIFrameElement | null>(null)\n const resizer = ref<IframeObject | null>(null)\n\n onMounted(() => {\n const consoleGroup = createAutoConsoleGroup()\n // Template refs are guaranteed populated before onMounted fires\n const iframe = iframeRef.value!\n const options: any = {\n ...Object.fromEntries(\n Object.entries(toRaw(props)).filter(([, value]) => value !== undefined),\n ),\n waitForLoad: true,\n\n onBeforeClose: () => {\n consoleGroup.event('Blocked Close Event')\n consoleGroup.warn('Close method is disabled, use Vue to remove iframe')\n return false\n },\n onReady: (...args: any[]) => emit('onReady', ...args),\n onMessage: (...args: any[]) => emit('onMessage', ...args),\n onResized: (...args: any[]) => emit('onResized', ...args),\n }\n\n consoleGroup.label(`vue(${iframe.id})`)\n consoleGroup.event('setup')\n\n resizer.value = connectResizer(options)(iframe)\n\n consoleGroup.expand(options.logExpand)\n if ([COLLAPSE, EXPAND, true].includes(options.log as any)) {\n consoleGroup.log('Created Vue component')\n }\n })\n\n onBeforeUnmount(() => {\n resizer.value?.disconnect()\n })\n\n defineExpose({\n moveToAnchor: (anchor: string) => resizer.value?.moveToAnchor(anchor),\n sendMessage: (msg: any, target?: string) =>\n resizer.value?.sendMessage(msg, target),\n })\n</script>\n","import type { App } from 'vue'\n\nimport IframeResizer from './iframe-resizer.vue'\n\nexport default {\n install(app: App) {\n app.component('IframeResizer', IframeResizer)\n },\n}\n\nexport type {\n IframeComponent,\n IframeMessageData,\n IframeMouseData,\n IframeObject,\n IframeOptions,\n IframeResizedData,\n IframeScrollData,\n} from '@iframe-resizer/core'\n"],"names":["EXPAND","COLLAPSE","createAutoConsoleGroup","mod","acg","props","__props","emit","__emit","iframeRef","ref","resizer","onMounted","consoleGroup","iframe","options","toRaw","value","args","connectResizer","onBeforeUnmount","__expose","anchor","msg","target","_openBlock","_createElementBlock","_mergeProps","$attrs","app","IframeResizer"],"mappings":"gYAWE,MAAMA,EAAS,WACTC,EAAW,4iBAOjB,MAAMC,GALmBC,GAEvBA,GAAK,WAAaA,EAAI,QAAUA,GAGaC,CAAG,EAI5CC,EAAQC,EAuCRC,EAAOC,EAMPC,EAAYC,EAAAA,IAA8B,IAAI,EAC9CC,EAAUD,EAAAA,IAAyB,IAAI,EAE7CE,OAAAA,EAAAA,UAAU,IAAM,CACd,MAAMC,EAAeX,EAAA,EAEfY,EAASL,EAAU,MACnBM,EAAe,CACnB,GAAG,OAAO,YACR,OAAO,QAAQC,EAAAA,MAAMX,CAAK,CAAC,EAAE,OAAO,CAAC,CAAA,CAAGY,CAAK,IAAMA,IAAU,MAAS,CAAA,EAExE,YAAa,GAEb,cAAe,KACbJ,EAAa,MAAM,qBAAqB,EACxCA,EAAa,KAAK,oDAAoD,EAC/D,IAET,QAAS,IAAIK,IAAgBX,EAAK,UAAW,GAAGW,CAAI,EACpD,UAAW,IAAIA,IAAgBX,EAAK,YAAa,GAAGW,CAAI,EACxD,UAAW,IAAIA,IAAgBX,EAAK,YAAa,GAAGW,CAAI,CAAA,EAG1DL,EAAa,MAAM,OAAOC,EAAO,EAAE,GAAG,EACtCD,EAAa,MAAM,OAAO,EAE1BF,EAAQ,MAAQQ,EAAeJ,CAAO,EAAED,CAAM,EAE9CD,EAAa,OAAOE,EAAQ,SAAS,EACjC,CAACd,EAAUD,EAAQ,EAAI,EAAE,SAASe,EAAQ,GAAU,GACtDF,EAAa,IAAI,uBAAuB,CAE5C,CAAC,EAEDO,EAAAA,gBAAgB,IAAM,CACpBT,EAAQ,OAAO,WAAA,CACjB,CAAC,EAEDU,EAAa,CACX,aAAeC,GAAmBX,EAAQ,OAAO,aAAaW,CAAM,EACpE,YAAa,CAACC,EAAUC,IACtBb,EAAQ,OAAO,YAAYY,EAAKC,CAAM,CAAA,CACzC,UA7GDC,EAAAA,YAAAC,EAAAA,mBAAiD,SAAjDC,aAAiD,SAArC,YAAJ,IAAIlB,CAAA,EAAoBmB,EAAAA,MAAM,EAAA,KAAA,EAAA,YCGzB,CACb,QAAQC,EAAU,CAChBA,EAAI,UAAU,gBAAiBC,CAAa,CAC9C,CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iframe-resizer/vue",
3
- "version": "6.0.0-beta.1",
3
+ "version": "6.0.0-beta.3",
4
4
  "license": "GPL-3.0",
5
5
  "homepage": "https://iframe-resizer.com",
6
6
  "author": {
@@ -40,7 +40,7 @@
40
40
  "vue"
41
41
  ],
42
42
  "dependencies": {
43
- "@iframe-resizer/core": "6.0.0-beta.1",
43
+ "@iframe-resizer/core": "6.0.0-beta.3",
44
44
  "auto-console-group": "1.3.0"
45
45
  }
46
46
  }