@popmelt.com/core 0.20.2 → 0.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{a as t,b as e}from"./chunk-UU5DZDRD.mjs";import"./chunk-N2ZEZCHO.mjs";import"./chunk-J3UIBBU2.mjs";import{createElement as m}from"react";import{createRoot as i}from"react-dom/client";function f(r,n){let o=i(r);return o.render(m(e,n)),()=>{o.unmount(),t()}}export{f as mountBrowserRuntime};
@@ -0,0 +1,15 @@
1
+ import { P as PopmeltOptions } from './options-5yRxW1AX.mjs';
2
+ import './subjects-DzjWdlAk.mjs';
3
+ import './video-adapter-CCLbp86L.mjs';
4
+
5
+ type PopmeltMount = {
6
+ /** Remove this integration's UI and subscriptions; saved work is retained. */
7
+ unmount(): void;
8
+ };
9
+ /**
10
+ * Experimental standalone entry. Explicitly enable only in development.
11
+ * Importing this entry (including during SSR) does not load the UI renderer.
12
+ */
13
+ declare function mountPopmelt(options?: PopmeltOptions): Promise<PopmeltMount>;
14
+
15
+ export { type PopmeltMount, PopmeltOptions, mountPopmelt };
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ var p={unmount(){}},m="[data-popmelt-browser-host]";async function a(e={}){if(!e.enabled||typeof document>"u")return p;if(document.querySelector(`${m}, [data-popmelt-top-layer-host]`))throw new Error("Popmelt is already mounted. Unmount it before mounting again.");let o=document.createElement("div");o.setAttribute("data-popmelt-browser-host",""),o.setAttribute("data-devtools",""),document.documentElement.appendChild(o);let d=[["__POPMELT_PROJECT_ID__",e.projectId],["__POPMELT_BRIDGE_URL__",e.bridgeUrl]].flatMap(([t,n])=>{if(n===void 0)return[];let r=Object.prototype.hasOwnProperty.call(window,t),u=window[t],i=n??void 0;return window[t]=i,[()=>{window[t]===i&&(r?window[t]=u:delete window[t])}]}),s=()=>{o.remove();for(let t of d)t()};try{let{mountBrowserRuntime:t}=await import("./browser-runtime-OVKRUB6I.mjs");if(!o.isConnected)throw new Error("Popmelt mount was removed before startup.");let n=t(o,e),r=!0;return{unmount(){if(r){r=!1;try{n()}finally{s()}}}}}catch(t){throw s(),t}}export{a as mountPopmelt};
@@ -0,0 +1 @@
1
+ import{a as o,b as d,c as l,d as s}from"./chunk-V25ZE6LB.mjs";function g(r){let p=r?.basePath??"/popmelt",e={port:null,projectId:null},n="virtual:popmelt/bridge",i=`\0${n}`;return{name:"popmelt",resolveId(t){if(t===n)return i},load(t){if(t===i)return`export const bridgeUrl = ${JSON.stringify(e.port===null?null:`http://localhost:${e.port}`)}; export const projectId = ${JSON.stringify(e.projectId)};`},async configureServer(t){e=await o(r,t,5173),await d(e,t),t.middlewares.use(l(p,()=>e))},transformIndexHtml(){if(e.port!==null)return[{tag:"script",attrs:{type:"text/javascript"},children:s(e),injectTo:"head-prepend"}]}}}export{g as a};