@devvit/ui-renderer 0.11.0-next-2024-08-12-83913eda6.0 → 0.11.0-next-2024-08-12-6f94c09c6.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.
@@ -1 +1 @@
1
- {"version":3,"file":"devvit-surface.d.ts","sourceRoot":"","sources":["../../library/src/client/devvit-surface.ts"],"names":[],"mappings":"AAAA,OAAO,kEAAkE,CAAC;AAE1E,OAAO,KAAK,EAGV,YAAY,EACZ,QAAQ,EAGR,UAAU,EACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAIL,YAAY,EACb,MAAM,gBAAgB,CAAC;AAMxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAEvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAMvC,OAAO,KAAK,EAEV,uBAAuB,EAEvB,mBAAmB,EACnB,aAAa,EACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAKxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,gDAAgD,CAAC;AACxD,OAAO,+CAA+C,CAAC;AACvD,OAAO,8BAA8B,CAAC;AAEtC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,gBAAgB,EAAE,aAAa,CAAC;KACjC;IACD,UAAU,mBAAmB;QAC3B,sBAAsB,EAAE,uBAAuB,CAAC;QAChD,kBAAkB,EAAE,mBAAmB,CAAC;QACxC,iBAAiB,EAAE,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,QAAQ,CAAC,GAAG;YACrE,MAAM,EAAE,aAAa,CAAC;SACvB,CAAC;KACH;CACF;AAED,KAAK,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;A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O,CAAS;IACrC,4DAA4D;IACzB,MAAM,CAAC,EAAE,WAAW,CAAC;IACxD,0EAA0E;IAE1E,qBAAqB,EAAE,OAAO,CAAS;IACvC,8DAA8D;IAE9D,uBAAuB,EAAE,OAAO,CAAS;IAEzC,kBAAkB,EAAE,MAAM,CAAM;IAEhC,mBAAmB,EAAE,OAAO,CAAS;IACrC,cAAc,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACxC,+FAA+F;IACtF,UAAU,CAAC,EAAE,YAAY,CAAC;IAE1B,OAAO,CAAC,UAAU,CAAC,CAAoB;;IAajC,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IA8CxC,oBAAoB,IAAI,IAAI;cAYlB,MAAM;cAiBA,UAAU,CAAC,KAAK,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;CAyIhF"}
@@ -193,17 +193,25 @@ let DevvitSurface = class DevvitSurface extends LitElement {
193
193
  });
194
194
  __classPrivateFieldGet(this, _DevvitSurface_dispatcher, "f").runtimeDebugLogging = this.runtimeDebugLogging;
195
195
  __classPrivateFieldGet(this, _DevvitSurface_dispatcher, "f").metadata = this.metadata;
196
- __classPrivateFieldGet(this, _DevvitSurface_dispatcher, "f").remoteLoad(this.remoteApp);
196
+ if (props.has('remoteApp')) {
197
+ if (devvit?.debug.surface)
198
+ console.debug(`[surface] remoteApp ${this.remoteApp ? 'defined' : 'undefined'}`);
199
+ __classPrivateFieldGet(this, _DevvitSurface_dispatcher, "f").remoteLoad(this.remoteApp);
200
+ }
197
201
  if (props.has('localRuntimeCode')) {
202
+ if (devvit?.debug.surface)
203
+ console.debug(`[surface] local runtime ${this.localRuntimeCode ? 'loading' : 'unloading'}`);
198
204
  __classPrivateFieldGet(this, _DevvitSurface_dispatcher, "f").localLoadWorker(this.localRuntimeCode);
199
205
  }
200
206
  if (props.has('bundle') && this.bundle) {
201
207
  if (devvit?.debug.surface)
202
- console.debug(`[surface] Loading a new bundle....`);
208
+ console.debug(`[surface] bundle loading`);
203
209
  await __classPrivateFieldGet(this, _DevvitSurface_dispatcher, "f").localLoad(this.bundle);
204
- if (props.has('bundle')) {
210
+ if (devvit?.debug.surface)
211
+ console.debug('[surface] bundle loaded');
212
+ if (props.get('bundle')) {
205
213
  if (devvit?.debug.surface)
206
- console.debug('[surface] Should reset app state due to bundle changing?');
214
+ console.debug('[runtime][surface] reset runtime state');
207
215
  __classPrivateFieldSet(this, _DevvitSurface_rootHeight, undefined, "f");
208
216
  this.renderResponse = undefined;
209
217
  // Bundle was _replaced_ (likely devvit-preview). Require a new render.
@@ -10762,7 +10762,7 @@
10762
10762
  "format": "esm"
10763
10763
  },
10764
10764
  "library/src/client/devvit-surface.ts": {
10765
- "bytes": 11842,
10765
+ "bytes": 12178,
10766
10766
  "imports": [
10767
10767
  {
10768
10768
  "path": "../../node_modules/@reddit/faceplate-ui/templateRenderingStrategy/clientStrategy.js",
@@ -10863,7 +10863,7 @@
10863
10863
  "imports": [],
10864
10864
  "exports": [],
10865
10865
  "inputs": {},
10866
- "bytes": 12018239
10866
+ "bytes": 12018772
10867
10867
  },
10868
10868
  "dist/devvit-surface.min.js": {
10869
10869
  "imports": [
@@ -11742,10 +11742,10 @@
11742
11742
  "bytesInOutput": 1710
11743
11743
  },
11744
11744
  "library/src/client/devvit-surface.ts": {
11745
- "bytesInOutput": 4764
11745
+ "bytesInOutput": 5035
11746
11746
  }
11747
11747
  },
11748
- "bytes": 4364337
11748
+ "bytes": 4364608
11749
11749
  }
11750
11750
  }
11751
11751
  }
@@ -1459,7 +1459,7 @@ button inline-flex items-center justify-center`},MG=e=>{let{createElement:t}=zn(
1459
1459
  >
1460
1460
  <slot slot="empty-state-image" name="empty-state-image"></slot>
1461
1461
  </devvit-blocks-renderer>
1462
- </div>`:fs`<slot></slot>`}async willUpdate(i){Ft(this,Kr)&&(Ft(this,Kr).setEnv({colorScheme:this.scheme,dimensions:this.dimensions,locale:void 0,timezone:void 0}),Ft(this,Kr).setProps({...this.requestProps,postId:this.requestProps?.postId?IG(this.requestProps.postId):void 0}),Ft(this,Kr).runtimeDebugLogging=this.runtimeDebugLogging,Ft(this,Kr).metadata=this.metadata,Ft(this,Kr).remoteLoad(this.remoteApp),i.has("localRuntimeCode")&&Ft(this,Kr).localLoadWorker(this.localRuntimeCode),i.has("bundle")&&this.bundle&&(devvit?.debug.surface&&console.debug("[surface] Loading a new bundle...."),await Ft(this,Kr).localLoad(this.bundle),i.has("bundle")&&(devvit?.debug.surface&&console.debug("[surface] Should reset app state due to bundle changing?"),va(this,cv,void 0),this.renderResponse=void 0,Ft(this,Kr).resetAppState())),this.dimensions&&(!Ft(this,Kr).hasRendered||i.has("bundle")?(Ft(this,Kr).hasRendered=!0,Ft(this,Kr).submit([{blocking:{}}])):i.has("dimensions")&&Ft(this,Kr).submit([{resize:{}}])))}};cv=new WeakMap,hv=new WeakMap,pv=new WeakMap,Kr=new WeakMap,HS=new WeakMap,$S=new WeakMap,zS=new WeakMap,WS=new WeakMap,j3=new WeakSet,ZS=function(i,a){this.dispatchEvent(o8(i,a))},KS=new WeakMap,Sn([jn({attribute:!1})],ts.prototype,"remoteApp",2),Sn([jn({attribute:!1})],ts.prototype,"bundle",2),Sn([jn({attribute:!1})],ts.prototype,"localRuntimeCode",2),Sn([jn({attribute:!1})],ts.prototype,"metadata",2),Sn([jn({attribute:"requestProps",type:Object})],ts.prototype,"requestProps",2),Sn([jn({attribute:"runtime-debug-logging",type:Boolean})],ts.prototype,"runtimeDebugLogging",2),Sn([jn({attribute:"scheme"})],ts.prototype,"scheme",2),Sn([jn({attribute:"use-experimental-blocks",type:Boolean})],ts.prototype,"useExperimentalBlocks",2),Sn([jn({attribute:"use-speculative-execution",type:Boolean})],ts.prototype,"useSpeculativeExecution",2),Sn([jn({type:String})],ts.prototype,"webviewUrlTemplate",2),Sn([jn({attribute:"disable-asset-sandbox",type:Boolean})],ts.prototype,"disableAssetSandbox",2),Sn([r3()],ts.prototype,"dimensions",2),Sn([r3()],ts.prototype,"_rootBlock",2),ts=Sn([xm("devvit-surface")],ts);export{ts as DevvitSurface};
1462
+ </div>`:fs`<slot></slot>`}async willUpdate(i){Ft(this,Kr)&&(Ft(this,Kr).setEnv({colorScheme:this.scheme,dimensions:this.dimensions,locale:void 0,timezone:void 0}),Ft(this,Kr).setProps({...this.requestProps,postId:this.requestProps?.postId?IG(this.requestProps.postId):void 0}),Ft(this,Kr).runtimeDebugLogging=this.runtimeDebugLogging,Ft(this,Kr).metadata=this.metadata,i.has("remoteApp")&&(devvit?.debug.surface&&console.debug(`[surface] remoteApp ${this.remoteApp?"defined":"undefined"}`),Ft(this,Kr).remoteLoad(this.remoteApp)),i.has("localRuntimeCode")&&(devvit?.debug.surface&&console.debug(`[surface] local runtime ${this.localRuntimeCode?"loading":"unloading"}`),Ft(this,Kr).localLoadWorker(this.localRuntimeCode)),i.has("bundle")&&this.bundle&&(devvit?.debug.surface&&console.debug("[surface] bundle loading"),await Ft(this,Kr).localLoad(this.bundle),devvit?.debug.surface&&console.debug("[surface] bundle loaded"),i.get("bundle")&&(devvit?.debug.surface&&console.debug("[runtime][surface] reset runtime state"),va(this,cv,void 0),this.renderResponse=void 0,Ft(this,Kr).resetAppState())),this.dimensions&&(!Ft(this,Kr).hasRendered||i.has("bundle")?(Ft(this,Kr).hasRendered=!0,Ft(this,Kr).submit([{blocking:{}}])):i.has("dimensions")&&Ft(this,Kr).submit([{resize:{}}])))}};cv=new WeakMap,hv=new WeakMap,pv=new WeakMap,Kr=new WeakMap,HS=new WeakMap,$S=new WeakMap,zS=new WeakMap,WS=new WeakMap,j3=new WeakSet,ZS=function(i,a){this.dispatchEvent(o8(i,a))},KS=new WeakMap,Sn([jn({attribute:!1})],ts.prototype,"remoteApp",2),Sn([jn({attribute:!1})],ts.prototype,"bundle",2),Sn([jn({attribute:!1})],ts.prototype,"localRuntimeCode",2),Sn([jn({attribute:!1})],ts.prototype,"metadata",2),Sn([jn({attribute:"requestProps",type:Object})],ts.prototype,"requestProps",2),Sn([jn({attribute:"runtime-debug-logging",type:Boolean})],ts.prototype,"runtimeDebugLogging",2),Sn([jn({attribute:"scheme"})],ts.prototype,"scheme",2),Sn([jn({attribute:"use-experimental-blocks",type:Boolean})],ts.prototype,"useExperimentalBlocks",2),Sn([jn({attribute:"use-speculative-execution",type:Boolean})],ts.prototype,"useSpeculativeExecution",2),Sn([jn({type:String})],ts.prototype,"webviewUrlTemplate",2),Sn([jn({attribute:"disable-asset-sandbox",type:Boolean})],ts.prototype,"disableAssetSandbox",2),Sn([r3()],ts.prototype,"dimensions",2),Sn([r3()],ts.prototype,"_rootBlock",2),ts=Sn([xm("devvit-surface")],ts);export{ts as DevvitSurface};
1463
1463
  /*! Bundled license information:
1464
1464
 
1465
1465
  @dotlottie/player-component/dist/dist-TF5BXIJN-GNSUL5QU.mjs: