@iframe-resizer/vue 6.0.0-beta.7 → 6.0.0-beta.8
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 +1 -1
- package/iframe-resizer.vue +2 -7
- package/index.cjs.js +2 -2
- package/index.cjs.js.map +1 -1
- package/index.esm.js +2 -2
- package/index.esm.js.map +1 -1
- package/index.umd.js +2 -2
- package/index.umd.js.map +1 -1
- package/package.json +9 -5
package/README.md
CHANGED
package/iframe-resizer.vue
CHANGED
|
@@ -7,15 +7,10 @@
|
|
|
7
7
|
import type { PropType } from 'vue'
|
|
8
8
|
import connectResizer from '@iframe-resizer/core'
|
|
9
9
|
import type { IframeObject, LogOption } from '@iframe-resizer/core'
|
|
10
|
+
import { esModuleInterop } from '@iframe-resizer/common'
|
|
11
|
+
import { COLLAPSE, EXPAND } from '@iframe-resizer/common/consts'
|
|
10
12
|
import acg from 'auto-console-group'
|
|
11
13
|
|
|
12
|
-
const EXPAND = 'expanded'
|
|
13
|
-
const COLLAPSE = 'collapsed'
|
|
14
|
-
|
|
15
|
-
const esModuleInterop = (mod: any) =>
|
|
16
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
17
|
-
mod?.__esModule ? mod.default : mod
|
|
18
|
-
|
|
19
14
|
// Deal with UMD not converting default exports to named exports
|
|
20
15
|
const createAutoConsoleGroup = esModuleInterop(acg)
|
|
21
16
|
|
package/index.cjs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/vue 6.0.0-beta.
|
|
4
|
+
* @module iframe-resizer/vue 6.0.0-beta.8 (esm) - 2026-04-13
|
|
5
5
|
*
|
|
6
6
|
* @license GPL-3.0 For use with GPL compliant sites (fully published front & backend source code)
|
|
7
7
|
* Alternatively for commercial use, you can purchase a license from
|
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
"use strict";const e=require("vue"),o=require("@iframe-resizer/core"),
|
|
20
|
+
"use strict";const e=require("vue"),o=require("@iframe-resizer/core"),r=require("@iframe-resizer/common"),n=require("@iframe-resizer/common/consts"),s=require("auto-console-group"),a=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:e=>{switch(e){case n.COLLAPSE:case n.EXPAND: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(a,{expose:i,emit:t}){const l=r.esModuleInterop(s),u=a,c=t,d=e.ref(null),m=e.ref(null);return e.onMounted(()=>{const r=l(),s=d.value,a={...Object.fromEntries(Object.entries(e.toRaw(u)).filter(([,e])=>void 0!==e)),waitForLoad:!0,onBeforeClose:()=>(r.event("Blocked Close Event"),r.warn("Close method is disabled, use Vue to remove iframe"),!1),onReady:(...e)=>c("onReady",...e),onMessage:(...e)=>c("onMessage",...e),onResized:(...e)=>c("onResized",...e)};r.label(`vue(${s.id})`),r.event("setup"),m.value=o(a)(s),r.expand(a.logExpand),[n.COLLAPSE,n.EXPAND,!0].includes(a.log)&&r.log("Created Vue component")}),e.onBeforeUnmount(()=>{m.value?.disconnect()}),i({moveToAnchor:e=>m.value?.moveToAnchor(e),sendMessage:(e,o)=>m.value?.sendMessage(e,o)}),(o,r)=>(e.openBlock(),e.createElementBlock("iframe",e.mergeProps({ref_key:"iframeRef",ref:d},o.$attrs),null,16))}}),i={install(e){e.component("IframeResizer",a)}};module.exports=i;
|
|
21
21
|
//# 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
|
|
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 { esModuleInterop } from '@iframe-resizer/common'\n import { COLLAPSE, EXPAND } from '@iframe-resizer/common/consts'\n import acg from 'auto-console-group'\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":["createAutoConsoleGroup","esModuleInterop","acg","props","__props","emit","__emit","iframeRef","ref","resizer","onMounted","consoleGroup","iframe","value","options","Object","fromEntries","entries","toRaw","filter","waitForLoad","onBeforeClose","event","warn","onReady","args","onMessage","onResized","label","id","connectResizer","expand","logExpand","COLLAPSE","EXPAND","includes","log","onBeforeUnmount","disconnect","__expose","moveToAnchor","anchor","sendMessage","msg","target","_openBlock","_createElementBlock","_mergeProps","$attrs","index","install","app","component","IframeResizer"],"mappings":";;;;;;;;;;;;;;;;;;;quBAcE,MAAMA,EAAyBC,EAAAA,gBAAgBC,GAIzCC,EAAQC,EAuCRC,EAAOC,EAMPC,EAAYC,EAAAA,IAA8B,MAC1CC,EAAUD,EAAAA,IAAyB,aAEzCE,EAAAA,UAAU,KACR,MAAMC,EAAeX,IAEfY,EAASL,EAAUM,MACnBC,EAAe,IAChBC,OAAOC,YACRD,OAAOE,QAAQC,EAAAA,MAAMf,IAAQgB,OAAO,EAAC,CAAGN,UAAqB,IAAVA,IAErDO,aAAa,EAEbC,cAAe,KACbV,EAAaW,MAAM,uBACnBX,EAAaY,KAAK,uDACX,GAETC,QAAS,IAAIC,IAAgBpB,EAAK,aAAcoB,GAChDC,UAAW,IAAID,IAAgBpB,EAAK,eAAgBoB,GACpDE,UAAW,IAAIF,IAAgBpB,EAAK,eAAgBoB,IAGtDd,EAAaiB,MAAM,OAAOhB,EAAOiB,OACjClB,EAAaW,MAAM,SAEnBb,EAAQI,MAAQiB,EAAehB,EAAfgB,CAAwBlB,GAExCD,EAAaoB,OAAOjB,EAAQkB,WACxB,CAACC,EAAAA,SAAUC,UAAQ,GAAMC,SAASrB,EAAQsB,MAC5CzB,EAAayB,IAAI,2BAIrBC,EAAAA,gBAAgB,KACd5B,EAAQI,OAAOyB,eAGjBC,EAAa,CACXC,aAAeC,GAAmBhC,EAAQI,OAAO2B,aAAaC,GAC9DC,YAAa,CAACC,EAAUC,IACtBnC,EAAQI,OAAO6B,YAAYC,EAAKC,aAvGpCC,EAAAA,YAAAC,EAAAA,mBAAiD,SAAjDC,aAAiD,SAArC,YAAJvC,IAAID,GAAoByC,EAAAA,QAAM,KAAA,QCGxCC,EAAe,CACb,OAAAC,CAAQC,GACNA,EAAIC,UAAU,gBAAiBC,EACjC"}
|
package/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/vue 6.0.0-beta.
|
|
4
|
+
* @module iframe-resizer/vue 6.0.0-beta.8 (esm) - 2026-04-13
|
|
5
5
|
*
|
|
6
6
|
* @license GPL-3.0 For use with GPL compliant sites (fully published front & backend source code)
|
|
7
7
|
* Alternatively for commercial use, you can purchase a license from
|
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
import{defineComponent as e,ref as o,onMounted as
|
|
20
|
+
import{defineComponent as e,ref as o,onMounted as r,toRaw as n,onBeforeUnmount as a,openBlock as s,createElementBlock as i,mergeProps as t}from"vue";import l from"@iframe-resizer/core";import{esModuleInterop as m}from"@iframe-resizer/common";import{COLLAPSE as c,EXPAND as d}from"@iframe-resizer/common/consts";import u from"auto-console-group";const f=/* @__PURE__ */e({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:e=>{switch(e){case c:case d: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(e,{expose:f,emit:g}){const p=m(u),v=e,b=g,y=o(null),z=o(null);return r(()=>{const e=p(),o=y.value,r={...Object.fromEntries(Object.entries(n(v)).filter(([,e])=>void 0!==e)),waitForLoad:!0,onBeforeClose:()=>(e.event("Blocked Close Event"),e.warn("Close method is disabled, use Vue to remove iframe"),!1),onReady:(...e)=>b("onReady",...e),onMessage:(...e)=>b("onMessage",...e),onResized:(...e)=>b("onResized",...e)};e.label(`vue(${o.id})`),e.event("setup"),z.value=l(r)(o),e.expand(r.logExpand),[c,d,!0].includes(r.log)&&e.log("Created Vue component")}),a(()=>{z.value?.disconnect()}),f({moveToAnchor:e=>z.value?.moveToAnchor(e),sendMessage:(e,o)=>z.value?.sendMessage(e,o)}),(e,o)=>(s(),i("iframe",t({ref_key:"iframeRef",ref:y},e.$attrs),null,16))}}),g={install(e){e.component("IframeResizer",f)}};export{g as default};
|
|
21
21
|
//# sourceMappingURL=index.esm.js.map
|
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
|
|
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 { esModuleInterop } from '@iframe-resizer/common'\n import { COLLAPSE, EXPAND } from '@iframe-resizer/common/consts'\n import acg from 'auto-console-group'\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":["createAutoConsoleGroup","esModuleInterop","acg","props","__props","emit","__emit","iframeRef","ref","resizer","onMounted","consoleGroup","iframe","value","options","Object","fromEntries","entries","toRaw","filter","waitForLoad","onBeforeClose","event","warn","onReady","args","onMessage","onResized","label","id","connectResizer","expand","logExpand","COLLAPSE","EXPAND","includes","log","onBeforeUnmount","disconnect","__expose","moveToAnchor","anchor","sendMessage","msg","target","_openBlock","_createElementBlock","_mergeProps","$attrs","index","install","app","component","IframeResizer"],"mappings":";;;;;;;;;;;;;;;;;;;83BAcE,MAAMA,EAAyBC,EAAgBC,GAIzCC,EAAQC,EAuCRC,EAAOC,EAMPC,EAAYC,EAA8B,MAC1CC,EAAUD,EAAyB,aAEzCE,EAAU,KACR,MAAMC,EAAeX,IAEfY,EAASL,EAAUM,MACnBC,EAAe,IAChBC,OAAOC,YACRD,OAAOE,QAAQC,EAAMf,IAAQgB,OAAO,EAAC,CAAGN,UAAqB,IAAVA,IAErDO,aAAa,EAEbC,cAAe,KACbV,EAAaW,MAAM,uBACnBX,EAAaY,KAAK,uDACX,GAETC,QAAS,IAAIC,IAAgBpB,EAAK,aAAcoB,GAChDC,UAAW,IAAID,IAAgBpB,EAAK,eAAgBoB,GACpDE,UAAW,IAAIF,IAAgBpB,EAAK,eAAgBoB,IAGtDd,EAAaiB,MAAM,OAAOhB,EAAOiB,OACjClB,EAAaW,MAAM,SAEnBb,EAAQI,MAAQiB,EAAehB,EAAfgB,CAAwBlB,GAExCD,EAAaoB,OAAOjB,EAAQkB,WACxB,CAACC,EAAUC,GAAQ,GAAMC,SAASrB,EAAQsB,MAC5CzB,EAAayB,IAAI,2BAIrBC,EAAgB,KACd5B,EAAQI,OAAOyB,eAGjBC,EAAa,CACXC,aAAeC,GAAmBhC,EAAQI,OAAO2B,aAAaC,GAC9DC,YAAa,CAACC,EAAUC,IACtBnC,EAAQI,OAAO6B,YAAYC,EAAKC,aAvGpCC,IAAAC,EAAiD,SAAjDC,EAAiD,SAArC,YAAJvC,IAAID,GAAoByC,EAAAA,QAAM,KAAA,QCGxCC,EAAe,CACb,OAAAC,CAAQC,GACNA,EAAIC,UAAU,gBAAiBC,EACjC"}
|
package/index.umd.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @preserve
|
|
3
3
|
*
|
|
4
|
-
* @module iframe-resizer/vue 6.0.0-beta.
|
|
4
|
+
* @module iframe-resizer/vue 6.0.0-beta.8 (esm) - 2026-04-13
|
|
5
5
|
*
|
|
6
6
|
* @license GPL-3.0 For use with GPL compliant sites (fully published front & backend source code)
|
|
7
7
|
* Alternatively for commercial use, you can purchase a license from
|
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("@iframe-resizer/core"),require("auto-console-group")):"function"==typeof define&&define.amd?define(["vue","@iframe-resizer/core","auto-console-group"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).IframeResizer=o(e.Vue,e.connectResizer,e.acg)}(this,function(e,o,n){"use strict";const
|
|
20
|
+
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("vue"),require("@iframe-resizer/core"),require("@iframe-resizer/common"),require("@iframe-resizer/common/consts"),require("auto-console-group")):"function"==typeof define&&define.amd?define(["vue","@iframe-resizer/core","@iframe-resizer/common","@iframe-resizer/common/consts","auto-console-group"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).IframeResizer=o(e.Vue,e.connectResizer,e.iframeResizerCommon,e.iframeResizerConsts,e.acg)}(this,function(e,o,r,n,i){"use strict";const s=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:e=>{switch(e){case n.COLLAPSE:case n.EXPAND: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(s,{expose:t,emit:a}){const u=r.esModuleInterop(i),l=s,c=a,m=e.ref(null),d=e.ref(null);return e.onMounted(()=>{const r=u(),i=m.value,s={...Object.fromEntries(Object.entries(e.toRaw(l)).filter(([,e])=>void 0!==e)),waitForLoad:!0,onBeforeClose:()=>(r.event("Blocked Close Event"),r.warn("Close method is disabled, use Vue to remove iframe"),!1),onReady:(...e)=>c("onReady",...e),onMessage:(...e)=>c("onMessage",...e),onResized:(...e)=>c("onResized",...e)};r.label(`vue(${i.id})`),r.event("setup"),d.value=o(s)(i),r.expand(s.logExpand),[n.COLLAPSE,n.EXPAND,!0].includes(s.log)&&r.log("Created Vue component")}),e.onBeforeUnmount(()=>{d.value?.disconnect()}),t({moveToAnchor:e=>d.value?.moveToAnchor(e),sendMessage:(e,o)=>d.value?.sendMessage(e,o)}),(o,r)=>(e.openBlock(),e.createElementBlock("iframe",e.mergeProps({ref_key:"iframeRef",ref:m},o.$attrs),null,16))}});return{install(e){e.component("IframeResizer",s)}}});
|
|
21
21
|
//# 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
|
|
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 { esModuleInterop } from '@iframe-resizer/common'\n import { COLLAPSE, EXPAND } from '@iframe-resizer/common/consts'\n import acg from 'auto-console-group'\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":["createAutoConsoleGroup","esModuleInterop","acg","props","__props","emit","__emit","iframeRef","ref","resizer","onMounted","consoleGroup","iframe","value","options","Object","fromEntries","entries","toRaw","filter","waitForLoad","onBeforeClose","event","warn","onReady","args","onMessage","onResized","label","id","connectResizer","expand","logExpand","COLLAPSE","EXPAND","includes","log","onBeforeUnmount","disconnect","__expose","moveToAnchor","anchor","sendMessage","msg","target","_openBlock","_createElementBlock","_mergeProps","$attrs","install","app","component","IframeResizer"],"mappings":";;;;;;;;;;;;;;;;;;;wnCAcE,MAAMA,EAAyBC,EAAAA,gBAAgBC,GAIzCC,EAAQC,EAuCRC,EAAOC,EAMPC,EAAYC,EAAAA,IAA8B,MAC1CC,EAAUD,EAAAA,IAAyB,aAEzCE,EAAAA,UAAU,KACR,MAAMC,EAAeX,IAEfY,EAASL,EAAUM,MACnBC,EAAe,IAChBC,OAAOC,YACRD,OAAOE,QAAQC,EAAAA,MAAMf,IAAQgB,OAAO,EAAC,CAAGN,UAAqB,IAAVA,IAErDO,aAAa,EAEbC,cAAe,KACbV,EAAaW,MAAM,uBACnBX,EAAaY,KAAK,uDACX,GAETC,QAAS,IAAIC,IAAgBpB,EAAK,aAAcoB,GAChDC,UAAW,IAAID,IAAgBpB,EAAK,eAAgBoB,GACpDE,UAAW,IAAIF,IAAgBpB,EAAK,eAAgBoB,IAGtDd,EAAaiB,MAAM,OAAOhB,EAAOiB,OACjClB,EAAaW,MAAM,SAEnBb,EAAQI,MAAQiB,EAAehB,EAAfgB,CAAwBlB,GAExCD,EAAaoB,OAAOjB,EAAQkB,WACxB,CAACC,EAAAA,SAAUC,UAAQ,GAAMC,SAASrB,EAAQsB,MAC5CzB,EAAayB,IAAI,2BAIrBC,EAAAA,gBAAgB,KACd5B,EAAQI,OAAOyB,eAGjBC,EAAa,CACXC,aAAeC,GAAmBhC,EAAQI,OAAO2B,aAAaC,GAC9DC,YAAa,CAACC,EAAUC,IACtBnC,EAAQI,OAAO6B,YAAYC,EAAKC,aAvGpCC,EAAAA,YAAAC,EAAAA,mBAAiD,SAAjDC,aAAiD,SAArC,YAAJvC,IAAID,GAAoByC,EAAAA,QAAM,KAAA,cCGzB,CACb,OAAAC,CAAQC,GACNA,EAAIC,UAAU,gBAAiBC,EACjC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iframe-resizer/vue",
|
|
3
|
-
"version": "6.0.0-beta.
|
|
3
|
+
"version": "6.0.0-beta.8",
|
|
4
4
|
"license": "GPL-3.0",
|
|
5
5
|
"homepage": "https://iframe-resizer.com",
|
|
6
6
|
"author": {
|
|
@@ -20,8 +20,12 @@
|
|
|
20
20
|
"main": "index.umd.js",
|
|
21
21
|
"module": "index.esm.js",
|
|
22
22
|
"types": "index.d.ts",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"import": "./index.esm.js",
|
|
26
|
+
"require": "./index.umd.js"
|
|
27
|
+
},
|
|
28
|
+
"./sfc": "./iframe-resizer.vue"
|
|
25
29
|
},
|
|
26
30
|
"peerDependencies": {
|
|
27
31
|
"vue": "^3.3.0"
|
|
@@ -40,8 +44,8 @@
|
|
|
40
44
|
"vue"
|
|
41
45
|
],
|
|
42
46
|
"dependencies": {
|
|
43
|
-
"@iframe-resizer/common": "6.0.0-beta.
|
|
44
|
-
"@iframe-resizer/core": "6.0.0-beta.
|
|
47
|
+
"@iframe-resizer/common": "6.0.0-beta.8",
|
|
48
|
+
"@iframe-resizer/core": "6.0.0-beta.8",
|
|
45
49
|
"auto-console-group": "1.3.0"
|
|
46
50
|
}
|
|
47
51
|
}
|