@iframe-resizer/vue 6.0.0-beta.2 → 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 +1 -1
- package/iframe-resizer.vue +3 -4
- package/iframe-resizer.vue.d.ts +3 -17
- package/index.cjs.js +1 -1
- package/index.cjs.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.esm.js +14 -15
- package/index.esm.js.map +1 -1
- package/index.umd.js +1 -1
- package/index.umd.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
package/iframe-resizer.vue
CHANGED
|
@@ -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 {
|
|
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
|
-
|
|
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<
|
|
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
|
})
|
package/iframe-resizer.vue.d.ts
CHANGED
|
@@ -1,23 +1,9 @@
|
|
|
1
1
|
import type { DefineComponent } from 'vue'
|
|
2
|
-
import type {
|
|
2
|
+
import type { IframeObject, IframeOptions } from '@iframe-resizer/core'
|
|
3
3
|
|
|
4
|
-
export
|
|
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
|
-
|
|
20
|
-
export type IframeResizerMethods = Pick<IFrameObject, 'moveToAnchor' | 'resize' | 'sendMessage'>
|
|
6
|
+
export type IframeResizerMethods = Pick<IframeObject, 'moveToAnchor' | 'sendMessage'>
|
|
21
7
|
|
|
22
8
|
export type IframeResizerEmits = {
|
|
23
9
|
onReady: (...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,
|
|
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 {
|
|
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
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
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const c = "expanded", u = "collapsed",
|
|
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
|
-
|
|
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
|
-
))(
|
|
50
|
+
))(S), p = n, s = m, i = l(null), t = l(null);
|
|
51
51
|
return v(() => {
|
|
52
|
-
const e = f(),
|
|
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(${
|
|
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
|
-
|
|
64
|
+
t.value?.disconnect();
|
|
65
65
|
}), d({
|
|
66
|
-
moveToAnchor: (e) =>
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
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",
|
|
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 {
|
|
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","_mergeProps","$attrs","index","app","IframeResizer"],"mappings":";;;AAWE,MAAMA,IAAS,YACTC,IAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOjB,UAAMC,KALkB,CAACC;AAAA;AAAA,MAEvBA,GAAK,aAAaA,EAAI,UAAUA;AAAA,OAGaC,CAAG,GAI5CC,IAAQC,GAuCRC,IAAOC,GAMPC,IAAYC,EAA8B,IAAI,GAC9CC,IAAUD,EAAyB,IAAI;AAE7C,WAAAE,EAAU,MAAM;AACd,YAAMC,IAAeX,EAAA,GAEfY,IAASL,EAAU,OACnBM,IAAe;AAAA,QACnB,GAAG,OAAO;AAAA,UACR,OAAO,QAAQC,EAAMX,CAAK,CAAC,EAAE,OAAO,CAAC,CAAA,EAAGY,CAAK,MAAMA,MAAU,MAAS;AAAA,QAAA;AAAA,QAExE,aAAa;AAAA,QAEb,eAAe,OACbJ,EAAa,MAAM,qBAAqB,GACxCA,EAAa,KAAK,oDAAoD,GAC/D;AAAA,QAET,SAAS,IAAIK,MAAgBX,EAAK,WAAW,GAAGW,CAAI;AAAA,QACpD,WAAW,IAAIA,MAAgBX,EAAK,aAAa,GAAGW,CAAI;AAAA,QACxD,WAAW,IAAIA,MAAgBX,EAAK,aAAa,GAAGW,CAAI;AAAA,MAAA;AAG1D,MAAAL,EAAa,MAAM,OAAOC,EAAO,EAAE,GAAG,GACtCD,EAAa,MAAM,OAAO,GAE1BF,EAAQ,QAAQQ,EAAeJ,CAAO,EAAED,CAAM,GAE9CD,EAAa,OAAOE,EAAQ,SAAS,GACjC,CAACd,GAAUD,GAAQ,EAAI,EAAE,SAASe,EAAQ,GAAU,KACtDF,EAAa,IAAI,uBAAuB;AAAA,IAE5C,CAAC,GAEDO,EAAgB,MAAM;AACpB,MAAAT,EAAQ,OAAO,WAAA;AAAA,IACjB,CAAC,GAEDU,EAAa;AAAA,MACX,cAAc,CAACC,MAAmBX,EAAQ,OAAO,aAAaW,CAAM;AAAA,MACpE,aAAa,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,
|
|
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 {
|
|
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 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.
|
|
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.
|
|
43
|
+
"@iframe-resizer/core": "6.0.0-beta.3",
|
|
44
44
|
"auto-console-group": "1.3.0"
|
|
45
45
|
}
|
|
46
46
|
}
|