@opentabs-dev/opentabs-plugin-panda-express 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.
@@ -245,18 +245,18 @@
245
245
 
246
246
  // node_modules/@opentabs-dev/plugin-sdk/dist/storage.js
247
247
  var getLocalStorage = (key) => {
248
- try {
249
- return localStorage.getItem(key);
250
- } catch {
251
- }
252
248
  let storage;
253
249
  try {
254
- storage = localStorage;
250
+ storage = window.localStorage;
255
251
  } catch {
256
252
  return null;
257
253
  }
258
- if (storage !== void 0) {
259
- return null;
254
+ if (storage) {
255
+ try {
256
+ return storage.getItem(key);
257
+ } catch {
258
+ return null;
259
+ }
260
260
  }
261
261
  try {
262
262
  const iframe = document.createElement("iframe");
@@ -14897,21 +14897,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14897
14897
  };
14898
14898
  var src_default = new PandaExpressPlugin();
14899
14899
 
14900
- // dist/_adapter_entry_9bc3e28c-5c0e-4745-9160-4b8a687f536a.ts
14900
+ // dist/_adapter_entry_b09e2ea0-43c0-401a-bc19-b200d817f3d7.ts
14901
14901
  if (!globalThis.__openTabs) {
14902
14902
  globalThis.__openTabs = {};
14903
14903
  } else {
14904
14904
  const desc = Object.getOwnPropertyDescriptor(globalThis.__openTabs, "adapters");
14905
14905
  if (desc && !desc.writable) {
14906
- const ot2 = globalThis.__openTabs;
14906
+ const ot3 = globalThis.__openTabs;
14907
14907
  const newAdaptersObj = {};
14908
- if (ot2.adapters) {
14909
- for (const key of Object.keys(ot2.adapters)) {
14910
- const d = Object.getOwnPropertyDescriptor(ot2.adapters, key);
14908
+ if (ot3.adapters) {
14909
+ for (const key of Object.keys(ot3.adapters)) {
14910
+ const d = Object.getOwnPropertyDescriptor(ot3.adapters, key);
14911
14911
  if (d) Object.defineProperty(newAdaptersObj, key, d);
14912
14912
  }
14913
14913
  }
14914
- globalThis.__openTabs = Object.assign({}, ot2, { adapters: newAdaptersObj });
14914
+ globalThis.__openTabs = Object.assign({}, ot3, { adapters: newAdaptersObj });
14915
14915
  }
14916
14916
  }
14917
14917
  if (!globalThis.__openTabs.adapters) {
@@ -14949,6 +14949,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14949
14949
  }
14950
14950
  };
14951
14951
  var restoreTransport = setLogTransport ? setLogTransport(logTransport) : void 0;
14952
+ var ot2 = globalThis.__openTabs;
14953
+ ot2._notifyReadinessChanged = () => {
14954
+ try {
14955
+ const nonce = globalThis.__openTabs?._readinessNonce;
14956
+ if (nonce) {
14957
+ window.postMessage({ type: "opentabs:readiness-changed", plugin: "panda-express", nonce }, "*");
14958
+ }
14959
+ } catch {
14960
+ }
14961
+ };
14952
14962
  var existing = adapters["panda-express"];
14953
14963
  if (existing) {
14954
14964
  if (typeof existing.teardown === "function") {
@@ -14960,7 +14970,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14960
14970
  }
14961
14971
  }
14962
14972
  if (!Reflect.deleteProperty(adapters, "panda-express")) {
14963
- const ot2 = globalThis.__openTabs;
14973
+ const ot3 = globalThis.__openTabs;
14964
14974
  const newAdapters = {};
14965
14975
  for (const key of Object.keys(adapters)) {
14966
14976
  if (key !== "panda-express") {
@@ -14968,7 +14978,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
14968
14978
  if (desc) Object.defineProperty(newAdapters, key, desc);
14969
14979
  }
14970
14980
  }
14971
- globalThis.__openTabs = Object.assign({}, ot2, { adapters: newAdapters });
14981
+ globalThis.__openTabs = Object.assign({}, ot3, { adapters: newAdapters });
14972
14982
  }
14973
14983
  var hasLifecycleHooks = typeof src_default.onToolInvocationStart === "function" || typeof src_default.onToolInvocationEnd === "function";
14974
14984
  for (const tool of src_default.tools) {
@@ -15029,12 +15039,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15029
15039
  }
15030
15040
  }
15031
15041
  };
15032
- const ot2 = globalThis.__openTabs;
15033
- if (!ot2._navigationInterceptor) {
15042
+ const ot3 = globalThis.__openTabs;
15043
+ if (!ot3._navigationInterceptor) {
15034
15044
  const origPushState = history.pushState.bind(history);
15035
15045
  const origReplaceState = history.replaceState.bind(history);
15036
15046
  const callbacks = /* @__PURE__ */ new Map();
15037
- ot2._navigationInterceptor = { callbacks, origPushState, origReplaceState };
15047
+ ot3._navigationInterceptor = { callbacks, origPushState, origReplaceState };
15038
15048
  history.pushState = function(...args) {
15039
15049
  origPushState(...args);
15040
15050
  for (const cb of callbacks.values()) {
@@ -15048,7 +15058,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15048
15058
  }
15049
15059
  };
15050
15060
  }
15051
- const interceptor = ot2._navigationInterceptor;
15061
+ const interceptor = ot3._navigationInterceptor;
15052
15062
  interceptor.callbacks.set("panda-express", checkUrl);
15053
15063
  window.addEventListener("popstate", checkUrl);
15054
15064
  window.addEventListener("hashchange", checkUrl);
@@ -15103,5 +15113,5 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15103
15113
  };
15104
15114
  delete src_default.onDeactivate;
15105
15115
  }
15106
- })();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["panda-express"]){var a=o.adapters["panda-express"];a.__adapterHash="b9bad10847cb5383e1aba585dfaa9ed73c9ce996cbe8b559509a599b2c5a2e53";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,"panda-express",{value:a,writable:false,configurable:false,enumerable:true});Object.defineProperty(o,"adapters",{value:o.adapters,writable:false,configurable:false});}})();
15116
+ })();(function(){var o=(globalThis).__openTabs;if(o&&o.adapters&&o.adapters["panda-express"]){var a=o.adapters["panda-express"];a.__adapterHash="75d3c94a9bce45f99633238cc0be6bd5d5a14d7b81252b192c442fe7a182ec0c";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,"panda-express",{value:a,writable:false,configurable:false,enumerable:true});Object.defineProperty(o,"adapters",{value:o.adapters,writable:false,configurable:false});}})();
15107
15117
  //# sourceMappingURL=adapter.iife.js.map