@opentabs-dev/opentabs-plugin-discord 0.0.74 → 0.0.75
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.
- package/dist/adapter.iife.js +13 -23
- package/dist/adapter.iife.js.map +3 -3
- package/dist/early-inject.d.ts +1 -0
- package/dist/early-inject.d.ts.map +1 -0
- package/dist/early-inject.js +20 -0
- package/dist/early-inject.js.map +1 -0
- package/dist/tools.json +1 -1
- package/package.json +3 -3
package/dist/adapter.iife.js
CHANGED
|
@@ -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/
|
|
15172
|
+
// dist/_adapter_entry_0afe5675-aa72-405d-8780-6d29ae4706dc.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
|
|
15178
|
+
const ot2 = globalThis.__openTabs;
|
|
15179
15179
|
const newAdaptersObj = {};
|
|
15180
|
-
if (
|
|
15181
|
-
for (const key of Object.keys(
|
|
15182
|
-
const d = Object.getOwnPropertyDescriptor(
|
|
15180
|
+
if (ot2.adapters) {
|
|
15181
|
+
for (const key of Object.keys(ot2.adapters)) {
|
|
15182
|
+
const d = Object.getOwnPropertyDescriptor(ot2.adapters, key);
|
|
15183
15183
|
if (d) Object.defineProperty(newAdaptersObj, key, d);
|
|
15184
15184
|
}
|
|
15185
15185
|
}
|
|
15186
|
-
globalThis.__openTabs = Object.assign({},
|
|
15186
|
+
globalThis.__openTabs = Object.assign({}, ot2, { adapters: newAdaptersObj });
|
|
15187
15187
|
}
|
|
15188
15188
|
}
|
|
15189
15189
|
if (!globalThis.__openTabs.adapters) {
|
|
@@ -15221,16 +15221,6 @@ 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
|
-
};
|
|
15234
15224
|
var existing = adapters["discord"];
|
|
15235
15225
|
if (existing) {
|
|
15236
15226
|
if (typeof existing.teardown === "function") {
|
|
@@ -15242,7 +15232,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15242
15232
|
}
|
|
15243
15233
|
}
|
|
15244
15234
|
if (!Reflect.deleteProperty(adapters, "discord")) {
|
|
15245
|
-
const
|
|
15235
|
+
const ot2 = globalThis.__openTabs;
|
|
15246
15236
|
const newAdapters = {};
|
|
15247
15237
|
for (const key of Object.keys(adapters)) {
|
|
15248
15238
|
if (key !== "discord") {
|
|
@@ -15250,7 +15240,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15250
15240
|
if (desc) Object.defineProperty(newAdapters, key, desc);
|
|
15251
15241
|
}
|
|
15252
15242
|
}
|
|
15253
|
-
globalThis.__openTabs = Object.assign({},
|
|
15243
|
+
globalThis.__openTabs = Object.assign({}, ot2, { adapters: newAdapters });
|
|
15254
15244
|
}
|
|
15255
15245
|
var hasLifecycleHooks = typeof src_default.onToolInvocationStart === "function" || typeof src_default.onToolInvocationEnd === "function";
|
|
15256
15246
|
for (const tool of src_default.tools) {
|
|
@@ -15311,12 +15301,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15311
15301
|
}
|
|
15312
15302
|
}
|
|
15313
15303
|
};
|
|
15314
|
-
const
|
|
15315
|
-
if (!
|
|
15304
|
+
const ot2 = globalThis.__openTabs;
|
|
15305
|
+
if (!ot2._navigationInterceptor) {
|
|
15316
15306
|
const origPushState = history.pushState.bind(history);
|
|
15317
15307
|
const origReplaceState = history.replaceState.bind(history);
|
|
15318
15308
|
const callbacks = /* @__PURE__ */ new Map();
|
|
15319
|
-
|
|
15309
|
+
ot2._navigationInterceptor = { callbacks, origPushState, origReplaceState };
|
|
15320
15310
|
history.pushState = function(...args) {
|
|
15321
15311
|
origPushState(...args);
|
|
15322
15312
|
for (const cb of callbacks.values()) {
|
|
@@ -15330,7 +15320,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15330
15320
|
}
|
|
15331
15321
|
};
|
|
15332
15322
|
}
|
|
15333
|
-
const interceptor =
|
|
15323
|
+
const interceptor = ot2._navigationInterceptor;
|
|
15334
15324
|
interceptor.callbacks.set("discord", checkUrl);
|
|
15335
15325
|
window.addEventListener("popstate", checkUrl);
|
|
15336
15326
|
window.addEventListener("hashchange", checkUrl);
|
|
@@ -15385,5 +15375,5 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15385
15375
|
};
|
|
15386
15376
|
delete src_default.onDeactivate;
|
|
15387
15377
|
}
|
|
15388
|
-
})();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["discord"]){var a=o.adapters["discord"];a.__adapterHash="
|
|
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});}})();
|
|
15389
15379
|
//# sourceMappingURL=adapter.iife.js.map
|