@onsvisual/svelte-components 0.1.13 → 0.1.15
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.
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
/** @typedef {typeof __propDef.slots} EmbedSlots */
|
|
4
4
|
export default class Embed extends SvelteComponentTyped<{
|
|
5
5
|
pymChild?: any;
|
|
6
|
+
polling?: boolean;
|
|
6
7
|
}, {
|
|
7
8
|
load: CustomEvent<any>;
|
|
8
9
|
} & {
|
|
@@ -18,6 +19,7 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
18
19
|
declare const __propDef: {
|
|
19
20
|
props: {
|
|
20
21
|
pymChild?: object;
|
|
22
|
+
polling?: boolean;
|
|
21
23
|
};
|
|
22
24
|
events: {
|
|
23
25
|
load: CustomEvent<any>;
|
|
@@ -7,22 +7,25 @@
|
|
|
7
7
|
* @type {object}
|
|
8
8
|
*/
|
|
9
9
|
export let pymChild = null;
|
|
10
|
+
export let polling = true;
|
|
10
11
|
|
|
11
12
|
const dispatch = createEventDispatcher();
|
|
12
13
|
|
|
13
14
|
onMount(() => {
|
|
14
15
|
pymChild = new pym.Child();
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
if (polling) {
|
|
18
|
+
setInterval(() => {
|
|
19
|
+
pymChild.sendMessage(
|
|
20
|
+
"height",
|
|
21
|
+
Math.max(document.body.scrollHeight, document.body.offsetHeight)
|
|
22
|
+
);
|
|
23
|
+
}, 500);
|
|
24
|
+
}
|
|
22
25
|
|
|
23
26
|
const href = document.location.href;
|
|
24
27
|
const parentUrl = new URLSearchParams(document.location.search).get("parentUrl");
|
|
25
|
-
dispatch("load", { href, parentUrl });
|
|
28
|
+
dispatch("load", { href, parentUrl, pymChild });
|
|
26
29
|
});
|
|
27
30
|
</script>
|
|
28
31
|
|