@devvit/ui-renderer 0.11.3-next-2024-11-13-ad36b8d4e.0 → 0.11.3-next-2024-11-13-0503dede1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/blocks/components/devvit-blocks-web-view.d.ts.map +1 -1
- package/blocks/components/devvit-blocks-web-view.js +1 -1
- package/blocks/components/devvit-blocks-web-view.js.map +1 -1
- package/devvit-custom-post-meta.min.json +4 -4
- package/devvit-custom-post.min.js +1 -1
- package/devvit-custom-post.min.js.map +2 -2
- package/devvit-surface-meta.min.json +4 -4
- package/devvit-surface.min.js +1 -1
- package/devvit-surface.min.js.map +2 -2
- package/package.json +8 -8
@@ -8439,7 +8439,7 @@
|
|
8439
8439
|
"format": "esm"
|
8440
8440
|
},
|
8441
8441
|
"library/src/blocks/components/devvit-blocks-web-view.ts": {
|
8442
|
-
"bytes":
|
8442
|
+
"bytes": 8567,
|
8443
8443
|
"imports": [
|
8444
8444
|
{
|
8445
8445
|
"path": "../protos/dist/types/devvit/ui/effects/web_view/v1alpha/post_message.js",
|
@@ -9179,7 +9179,7 @@
|
|
9179
9179
|
"imports": [],
|
9180
9180
|
"exports": [],
|
9181
9181
|
"inputs": {},
|
9182
|
-
"bytes":
|
9182
|
+
"bytes": 6679096
|
9183
9183
|
},
|
9184
9184
|
"dist/devvit-surface.min.js": {
|
9185
9185
|
"imports": [
|
@@ -9797,7 +9797,7 @@
|
|
9797
9797
|
"bytesInOutput": 929
|
9798
9798
|
},
|
9799
9799
|
"library/src/blocks/components/devvit-blocks-web-view.ts": {
|
9800
|
-
"bytesInOutput":
|
9800
|
+
"bytesInOutput": 3547
|
9801
9801
|
},
|
9802
9802
|
"library/src/blocks/templates/renderWebViewBlock.ts": {
|
9803
9803
|
"bytesInOutput": 542
|
@@ -9893,7 +9893,7 @@
|
|
9893
9893
|
"bytesInOutput": 6630
|
9894
9894
|
}
|
9895
9895
|
},
|
9896
|
-
"bytes":
|
9896
|
+
"bytes": 2049234
|
9897
9897
|
}
|
9898
9898
|
}
|
9899
9899
|
}
|
package/devvit-surface.min.js
CHANGED
@@ -608,7 +608,7 @@ button inline-flex`},rN=e=>{let{createElement:n}=Ke(),{attributes:i,selected:d,r
|
|
608
608
|
sandbox="allow-scripts ${i}"
|
609
609
|
referrerpolicy="origin"
|
610
610
|
@load="${ln(this,Cn,rx)}"
|
611
|
-
></iframe>`}};su=new WeakMap,fu=new WeakMap,Fc=new WeakMap,Uc=new WeakMap,Cn=new WeakSet,Wp=function(){ln(this,Cn,lu).call(this,"WebView reset. Clearing queued messages:",x(this,fu).length),x(this,fu).length=0},Zc=new WeakMap,Gp=function(){if(this.state&&x(this,su)){let i={state:this.state};ln(this,Cn,Lc).call(this,"devvit-state",i),ln(this,Cn,Lc).call(this,"stateUpdate",
|
611
|
+
></iframe>`}};su=new WeakMap,fu=new WeakMap,Fc=new WeakMap,Uc=new WeakMap,Cn=new WeakSet,Wp=function(){ln(this,Cn,lu).call(this,"WebView reset. Clearing queued messages:",x(this,fu).length),x(this,fu).length=0},Zc=new WeakMap,Gp=function(){if(this.state&&x(this,su)){let i={state:this.state};ln(this,Cn,Lc).call(this,"devvit-state",i),ln(this,Cn,Lc).call(this,"stateUpdate",this.state)}},rx=function(){if(!x(this,su)&&this.src){ln(this,Cn,lu).call(this,"Page loaded. Sending initial state."),_e(this,su,!0),ln(this,Cn,Gp).call(this),ln(this,Cn,lu).call(this,"Sending",x(this,fu).length,"queued messages");for(let i of x(this,fu))ln(this,Cn,Lc).call(this,"devvit-message",i)}},Lc=function(i,d){let r={type:i,data:d},t=this._targetOrigin?{targetOrigin:this._targetOrigin}:{};this._iframe?.contentWindow?.postMessage(r,t),ln(this,Cn,lu).call(this,()=>["Sending message:",JSON.stringify(r)])},lu=function(i){globalThis.devvit?.debug.webView&&console.log.apply(null,[`[webView${this.id?`#${this.id}`:""}]`,...typeof i=="function"?i():i])},De([En({type:String})],Wr.prototype,"src",2),De([En({type:Boolean,attribute:"dev-mode"})],Wr.prototype,"devMode",2),De([En({attribute:!1})],Wr.prototype,"state",2),De([fl()],Wr.prototype,"_originDiffers",2),De([fl()],Wr.prototype,"_targetOrigin",2),De([fl()],Wr.prototype,"pendingSrc",2),De([d4("iframe")],Wr.prototype,"_iframe",2),Wr=De([T0("devvit-blocks-web-view")],Wr);function dx(e,n){let{html:i,styleMap:d,ifDefined:r}=Ke();if(!e.config?.webviewConfig)return console.error("Invalid block: WebView missing WebViewConfig"),ve;let{id:t}=e,{url:s,state:f}=e.config.webviewConfig,c={...Fi(e,n)},v={...Ui(e,n)},w=UN(e,n),b=n.resolveWebViewUrl?.(s);return i`<devvit-blocks-web-view
|
612
612
|
id="${r(t)}"
|
613
613
|
src="${b}"
|
614
614
|
class="${Li(c)}"
|