@iblai/web-utils 1.11.9 → 1.11.11

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/index.js CHANGED
@@ -1119,6 +1119,13 @@ const MENTOR_AI_CONFIG = {
1119
1119
  description: "Allow users to report inappropriate content.",
1120
1120
  type: "boolean",
1121
1121
  },
1122
+ {
1123
+ slug: "enable_chat_history_export",
1124
+ label: "Chat History Export",
1125
+ defaultValue: true,
1126
+ description: "Allow users to export their chat history. When off, the export option is hidden from users.",
1127
+ type: "boolean",
1128
+ },
1122
1129
  {
1123
1130
  slug: "help_center_url",
1124
1131
  label: "Help Center URL",
@@ -1764,6 +1771,24 @@ async function preCacheMentorData(org, mentorId, userId, fetchMentorSettings, fe
1764
1771
  }
1765
1772
  }
1766
1773
 
1774
+ async function openExternalUrl(url) {
1775
+ if (!url || typeof window === "undefined")
1776
+ return;
1777
+ if (!isTauri()) {
1778
+ window.location.href = url;
1779
+ return;
1780
+ }
1781
+ try {
1782
+ const { invoke } = await import('@tauri-apps/api/core');
1783
+ await invoke("open_external_url", { url });
1784
+ }
1785
+ catch (error) {
1786
+ console.error("[openExternalUrl] Failed to open URL via Tauri host, falling back to navigation:", error);
1787
+ // Fallback to normal navigation if the native command is unavailable.
1788
+ window.location.href = url;
1789
+ }
1790
+ }
1791
+
1767
1792
  const useTenantMetadata = ({ org, spa, skip = false, }) => {
1768
1793
  const { data, isLoading, isError } = dataLayer.useGetTenantMetadataQuery([{ org }], {
1769
1794
  skip: skip || !org,
@@ -15011,7 +15036,7 @@ const useStripeUpgrade = ({ redirectUrl, sourcePlatformKey, mainPlatformKey, cur
15011
15036
  return;
15012
15037
  const target = redirectPlan === "free" ? resolvedFreeUrl : resolvedPremiumUrl;
15013
15038
  if (target) {
15014
- window.location.href = target;
15039
+ await openExternalUrl(target);
15015
15040
  }
15016
15041
  }
15017
15042
  catch (_a) {
@@ -19042,6 +19067,7 @@ exports.markdownToPlainText = markdownToPlainText;
19042
19067
  exports.monetizationSlice = monetizationSlice;
19043
19068
  exports.onStatusChange = onStatusChange;
19044
19069
  exports.onUpdate = onUpdate;
19070
+ exports.openExternalUrl = openExternalUrl;
19045
19071
  exports.parseCSV = parseCSV;
19046
19072
  exports.preCacheMentorData = preCacheMentorData;
19047
19073
  exports.rbacReducer = rbacReducer;