@opentabs-dev/opentabs-plugin-discord 0.0.75 → 0.0.76

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.
@@ -15169,21 +15169,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15169
15169
  };
15170
15170
  var src_default = new DiscordPlugin();
15171
15171
 
15172
- // dist/_adapter_entry_0afe5675-aa72-405d-8780-6d29ae4706dc.ts
15172
+ // dist/_adapter_entry_391d0397-f432-4821-bcd1-f4d8bf6321f2.ts
15173
15173
  if (!globalThis.__openTabs) {
15174
15174
  globalThis.__openTabs = {};
15175
15175
  } else {
15176
15176
  const desc = Object.getOwnPropertyDescriptor(globalThis.__openTabs, "adapters");
15177
15177
  if (desc && !desc.writable) {
15178
- const ot2 = globalThis.__openTabs;
15178
+ const ot3 = globalThis.__openTabs;
15179
15179
  const newAdaptersObj = {};
15180
- if (ot2.adapters) {
15181
- for (const key of Object.keys(ot2.adapters)) {
15182
- const d = Object.getOwnPropertyDescriptor(ot2.adapters, key);
15180
+ if (ot3.adapters) {
15181
+ for (const key of Object.keys(ot3.adapters)) {
15182
+ const d = Object.getOwnPropertyDescriptor(ot3.adapters, key);
15183
15183
  if (d) Object.defineProperty(newAdaptersObj, key, d);
15184
15184
  }
15185
15185
  }
15186
- globalThis.__openTabs = Object.assign({}, ot2, { adapters: newAdaptersObj });
15186
+ globalThis.__openTabs = Object.assign({}, ot3, { adapters: newAdaptersObj });
15187
15187
  }
15188
15188
  }
15189
15189
  if (!globalThis.__openTabs.adapters) {
@@ -15221,6 +15221,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15221
15221
  }
15222
15222
  };
15223
15223
  var restoreTransport = setLogTransport ? setLogTransport(logTransport) : void 0;
15224
+ var ot2 = globalThis.__openTabs;
15225
+ ot2._notifyReadinessChanged = () => {
15226
+ try {
15227
+ const nonce = globalThis.__openTabs?._readinessNonce;
15228
+ if (nonce) {
15229
+ window.postMessage({ type: "opentabs:readiness-changed", plugin: "discord", nonce }, "*");
15230
+ }
15231
+ } catch {
15232
+ }
15233
+ };
15224
15234
  var existing = adapters["discord"];
15225
15235
  if (existing) {
15226
15236
  if (typeof existing.teardown === "function") {
@@ -15232,7 +15242,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15232
15242
  }
15233
15243
  }
15234
15244
  if (!Reflect.deleteProperty(adapters, "discord")) {
15235
- const ot2 = globalThis.__openTabs;
15245
+ const ot3 = globalThis.__openTabs;
15236
15246
  const newAdapters = {};
15237
15247
  for (const key of Object.keys(adapters)) {
15238
15248
  if (key !== "discord") {
@@ -15240,7 +15250,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15240
15250
  if (desc) Object.defineProperty(newAdapters, key, desc);
15241
15251
  }
15242
15252
  }
15243
- globalThis.__openTabs = Object.assign({}, ot2, { adapters: newAdapters });
15253
+ globalThis.__openTabs = Object.assign({}, ot3, { adapters: newAdapters });
15244
15254
  }
15245
15255
  var hasLifecycleHooks = typeof src_default.onToolInvocationStart === "function" || typeof src_default.onToolInvocationEnd === "function";
15246
15256
  for (const tool of src_default.tools) {
@@ -15301,12 +15311,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15301
15311
  }
15302
15312
  }
15303
15313
  };
15304
- const ot2 = globalThis.__openTabs;
15305
- if (!ot2._navigationInterceptor) {
15314
+ const ot3 = globalThis.__openTabs;
15315
+ if (!ot3._navigationInterceptor) {
15306
15316
  const origPushState = history.pushState.bind(history);
15307
15317
  const origReplaceState = history.replaceState.bind(history);
15308
15318
  const callbacks = /* @__PURE__ */ new Map();
15309
- ot2._navigationInterceptor = { callbacks, origPushState, origReplaceState };
15319
+ ot3._navigationInterceptor = { callbacks, origPushState, origReplaceState };
15310
15320
  history.pushState = function(...args) {
15311
15321
  origPushState(...args);
15312
15322
  for (const cb of callbacks.values()) {
@@ -15320,7 +15330,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15320
15330
  }
15321
15331
  };
15322
15332
  }
15323
- const interceptor = ot2._navigationInterceptor;
15333
+ const interceptor = ot3._navigationInterceptor;
15324
15334
  interceptor.callbacks.set("discord", checkUrl);
15325
15335
  window.addEventListener("popstate", checkUrl);
15326
15336
  window.addEventListener("hashchange", checkUrl);
@@ -15375,5 +15385,5 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15375
15385
  };
15376
15386
  delete src_default.onDeactivate;
15377
15387
  }
15378
- })();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["discord"]){var a=o.adapters["discord"];a.__adapterHash="c15a26519999c6bdf8200ab401fb08a824ba1bf03f104d6c07ced0c65af548e4";if(a.tools&&Array.isArray(a.tools)){for(var i=0;i<a.tools.length;i++){Object.freeze(a.tools[i]);}Object.freeze(a.tools);}Object.freeze(a);Object.defineProperty(o.adapters,"discord",{value:a,writable:false,configurable:false,enumerable:true});Object.defineProperty(o,"adapters",{value:o.adapters,writable:false,configurable:false});}})();
15388
+ })();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["discord"]){var a=o.adapters["discord"];a.__adapterHash="6034396fc82208dc894add1329f2c0bc9184c8490c5a57ec63ebe26b819bd5d6";if(a.tools&&Array.isArray(a.tools)){for(var i=0;i<a.tools.length;i++){Object.freeze(a.tools[i]);}Object.freeze(a.tools);}Object.freeze(a);Object.defineProperty(o.adapters,"discord",{value:a,writable:false,configurable:false,enumerable:true});Object.defineProperty(o,"adapters",{value:o.adapters,writable:false,configurable:false});}})();
15379
15389
  //# sourceMappingURL=adapter.iife.js.map