@opentabs-dev/opentabs-plugin-posthog 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.
- package/dist/adapter.iife.js +23 -13
- package/dist/adapter.iife.js.map +3 -3
- package/dist/tools.json +1 -1
- package/package.json +3 -3
package/dist/adapter.iife.js
CHANGED
|
@@ -15394,21 +15394,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15394
15394
|
};
|
|
15395
15395
|
var src_default = new PostHogPlugin();
|
|
15396
15396
|
|
|
15397
|
-
// dist/
|
|
15397
|
+
// dist/_adapter_entry_4bc3b9c3-5c58-4842-b18f-7ae1d3b7825f.ts
|
|
15398
15398
|
if (!globalThis.__openTabs) {
|
|
15399
15399
|
globalThis.__openTabs = {};
|
|
15400
15400
|
} else {
|
|
15401
15401
|
const desc = Object.getOwnPropertyDescriptor(globalThis.__openTabs, "adapters");
|
|
15402
15402
|
if (desc && !desc.writable) {
|
|
15403
|
-
const
|
|
15403
|
+
const ot3 = globalThis.__openTabs;
|
|
15404
15404
|
const newAdaptersObj = {};
|
|
15405
|
-
if (
|
|
15406
|
-
for (const key of Object.keys(
|
|
15407
|
-
const d = Object.getOwnPropertyDescriptor(
|
|
15405
|
+
if (ot3.adapters) {
|
|
15406
|
+
for (const key of Object.keys(ot3.adapters)) {
|
|
15407
|
+
const d = Object.getOwnPropertyDescriptor(ot3.adapters, key);
|
|
15408
15408
|
if (d) Object.defineProperty(newAdaptersObj, key, d);
|
|
15409
15409
|
}
|
|
15410
15410
|
}
|
|
15411
|
-
globalThis.__openTabs = Object.assign({},
|
|
15411
|
+
globalThis.__openTabs = Object.assign({}, ot3, { adapters: newAdaptersObj });
|
|
15412
15412
|
}
|
|
15413
15413
|
}
|
|
15414
15414
|
if (!globalThis.__openTabs.adapters) {
|
|
@@ -15446,6 +15446,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15446
15446
|
}
|
|
15447
15447
|
};
|
|
15448
15448
|
var restoreTransport = setLogTransport ? setLogTransport(logTransport) : void 0;
|
|
15449
|
+
var ot2 = globalThis.__openTabs;
|
|
15450
|
+
ot2._notifyReadinessChanged = () => {
|
|
15451
|
+
try {
|
|
15452
|
+
const nonce = globalThis.__openTabs?._readinessNonce;
|
|
15453
|
+
if (nonce) {
|
|
15454
|
+
window.postMessage({ type: "opentabs:readiness-changed", plugin: "posthog", nonce }, "*");
|
|
15455
|
+
}
|
|
15456
|
+
} catch {
|
|
15457
|
+
}
|
|
15458
|
+
};
|
|
15449
15459
|
var existing = adapters["posthog"];
|
|
15450
15460
|
if (existing) {
|
|
15451
15461
|
if (typeof existing.teardown === "function") {
|
|
@@ -15457,7 +15467,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15457
15467
|
}
|
|
15458
15468
|
}
|
|
15459
15469
|
if (!Reflect.deleteProperty(adapters, "posthog")) {
|
|
15460
|
-
const
|
|
15470
|
+
const ot3 = globalThis.__openTabs;
|
|
15461
15471
|
const newAdapters = {};
|
|
15462
15472
|
for (const key of Object.keys(adapters)) {
|
|
15463
15473
|
if (key !== "posthog") {
|
|
@@ -15465,7 +15475,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15465
15475
|
if (desc) Object.defineProperty(newAdapters, key, desc);
|
|
15466
15476
|
}
|
|
15467
15477
|
}
|
|
15468
|
-
globalThis.__openTabs = Object.assign({},
|
|
15478
|
+
globalThis.__openTabs = Object.assign({}, ot3, { adapters: newAdapters });
|
|
15469
15479
|
}
|
|
15470
15480
|
var hasLifecycleHooks = typeof src_default.onToolInvocationStart === "function" || typeof src_default.onToolInvocationEnd === "function";
|
|
15471
15481
|
for (const tool of src_default.tools) {
|
|
@@ -15526,12 +15536,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15526
15536
|
}
|
|
15527
15537
|
}
|
|
15528
15538
|
};
|
|
15529
|
-
const
|
|
15530
|
-
if (!
|
|
15539
|
+
const ot3 = globalThis.__openTabs;
|
|
15540
|
+
if (!ot3._navigationInterceptor) {
|
|
15531
15541
|
const origPushState = history.pushState.bind(history);
|
|
15532
15542
|
const origReplaceState = history.replaceState.bind(history);
|
|
15533
15543
|
const callbacks = /* @__PURE__ */ new Map();
|
|
15534
|
-
|
|
15544
|
+
ot3._navigationInterceptor = { callbacks, origPushState, origReplaceState };
|
|
15535
15545
|
history.pushState = function(...args) {
|
|
15536
15546
|
origPushState(...args);
|
|
15537
15547
|
for (const cb of callbacks.values()) {
|
|
@@ -15545,7 +15555,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15545
15555
|
}
|
|
15546
15556
|
};
|
|
15547
15557
|
}
|
|
15548
|
-
const interceptor =
|
|
15558
|
+
const interceptor = ot3._navigationInterceptor;
|
|
15549
15559
|
interceptor.callbacks.set("posthog", checkUrl);
|
|
15550
15560
|
window.addEventListener("popstate", checkUrl);
|
|
15551
15561
|
window.addEventListener("hashchange", checkUrl);
|
|
@@ -15600,5 +15610,5 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15600
15610
|
};
|
|
15601
15611
|
delete src_default.onDeactivate;
|
|
15602
15612
|
}
|
|
15603
|
-
})();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["posthog"]){var a=o.adapters["posthog"];a.__adapterHash="
|
|
15613
|
+
})();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["posthog"]){var a=o.adapters["posthog"];a.__adapterHash="54f085ed9cd99df09ec87181aa110f57f5e5ea68a12d5d9b548f8bfebcfde606";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,"posthog",{value:a,writable:false,configurable:false,enumerable:true});Object.defineProperty(o,"adapters",{value:o.adapters,writable:false,configurable:false});}})();
|
|
15604
15614
|
//# sourceMappingURL=adapter.iife.js.map
|