@arbidocs/react 0.5.132 → 0.5.134
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/artifacts/index.cjs +2 -2
- package/dist/billing.js +34 -0
- package/dist/billing.js.map +2 -2
- package/dist/calls/in-call-chat.js +1 -1
- package/dist/calls/in-call-chat.js.map +1 -1
- package/dist/calls/livekit/index.cjs +41 -41
- package/dist/calls/livekit/index.d.ts +1 -1
- package/dist/{chunk-VUU32OVP.cjs → chunk-26SZ3DS4.cjs} +6 -6
- package/dist/{chunk-VUU32OVP.cjs.map → chunk-26SZ3DS4.cjs.map} +1 -1
- package/dist/{chunk-MDSWUCCL.cjs → chunk-ZZZYVNFW.cjs} +85 -2
- package/dist/chunk-ZZZYVNFW.cjs.map +1 -0
- package/dist/index.cjs +632 -581
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +206 -3
- package/dist/notifications/notification-types.js +4 -4
- package/dist/notifications/notification-types.js.map +2 -2
- package/dist/notifications/server-notifications.js +2 -2
- package/dist/notifications/server-notifications.js.map +2 -2
- package/dist/query-persist.js +19 -6
- package/dist/query-persist.js.map +2 -2
- package/dist/session/browser-storage.js +84 -0
- package/dist/session/browser-storage.js.map +7 -0
- package/dist/session/index.js +2 -0
- package/dist/session/index.js.map +2 -2
- package/dist/{useAudioRecorder.d-B9rlMI_E.d.ts → useAudioRecorder.d-DYVIWxKQ.d.ts} +1 -1
- package/package.json +3 -3
- package/dist/chunk-MDSWUCCL.cjs.map +0 -1
|
@@ -1771,6 +1771,88 @@ function createUiStateStorage(options = {}) {
|
|
|
1771
1771
|
};
|
|
1772
1772
|
}
|
|
1773
1773
|
|
|
1774
|
+
// src/session/browser-storage.ts
|
|
1775
|
+
function createBrowserStateStorage(databaseName, storeName) {
|
|
1776
|
+
let dbInstance = null;
|
|
1777
|
+
let storageFailed = false;
|
|
1778
|
+
const memoryState = /* @__PURE__ */ new Map();
|
|
1779
|
+
async function withAppStorage(operation) {
|
|
1780
|
+
if (storageFailed) return void 0;
|
|
1781
|
+
try {
|
|
1782
|
+
return await operation();
|
|
1783
|
+
} catch {
|
|
1784
|
+
storageFailed = true;
|
|
1785
|
+
dbInstance?.close();
|
|
1786
|
+
dbInstance = null;
|
|
1787
|
+
console.warn("[persist] Browser storage unavailable; keeping UI state in memory.");
|
|
1788
|
+
return void 0;
|
|
1789
|
+
}
|
|
1790
|
+
}
|
|
1791
|
+
function openDB() {
|
|
1792
|
+
if (dbInstance) return Promise.resolve(dbInstance);
|
|
1793
|
+
if (typeof indexedDB === "undefined") return Promise.resolve(null);
|
|
1794
|
+
return new Promise((resolve, reject) => {
|
|
1795
|
+
const request = indexedDB.open(databaseName, 1);
|
|
1796
|
+
request.onerror = () => reject(request.error);
|
|
1797
|
+
request.onsuccess = () => {
|
|
1798
|
+
dbInstance = request.result;
|
|
1799
|
+
resolve(request.result);
|
|
1800
|
+
};
|
|
1801
|
+
request.onupgradeneeded = (event) => {
|
|
1802
|
+
const db = event.target.result;
|
|
1803
|
+
if (!db.objectStoreNames.contains(storeName))
|
|
1804
|
+
db.createObjectStore(storeName, { keyPath: "key" });
|
|
1805
|
+
};
|
|
1806
|
+
});
|
|
1807
|
+
}
|
|
1808
|
+
function promisify(request) {
|
|
1809
|
+
return new Promise((resolve, reject) => {
|
|
1810
|
+
request.onsuccess = () => resolve(request.result);
|
|
1811
|
+
request.onerror = () => reject(request.error);
|
|
1812
|
+
});
|
|
1813
|
+
}
|
|
1814
|
+
const storage = {
|
|
1815
|
+
async get(key) {
|
|
1816
|
+
const result = await withAppStorage(async () => {
|
|
1817
|
+
const db = await openDB();
|
|
1818
|
+
if (!db) return memoryState.get(key) ?? null;
|
|
1819
|
+
const saved = await promisify(
|
|
1820
|
+
db.transaction([storeName], "readonly").objectStore(storeName).get(key)
|
|
1821
|
+
);
|
|
1822
|
+
return saved?.value ?? null;
|
|
1823
|
+
});
|
|
1824
|
+
return result === void 0 ? memoryState.get(key) ?? null : result;
|
|
1825
|
+
},
|
|
1826
|
+
async set(key, value) {
|
|
1827
|
+
memoryState.set(key, value);
|
|
1828
|
+
await withAppStorage(async () => {
|
|
1829
|
+
const db = await openDB();
|
|
1830
|
+
if (!db) return;
|
|
1831
|
+
await promisify(
|
|
1832
|
+
db.transaction([storeName], "readwrite").objectStore(storeName).put({ key, value })
|
|
1833
|
+
);
|
|
1834
|
+
});
|
|
1835
|
+
},
|
|
1836
|
+
async remove(key) {
|
|
1837
|
+
memoryState.delete(key);
|
|
1838
|
+
await withAppStorage(async () => {
|
|
1839
|
+
const db = await openDB();
|
|
1840
|
+
if (!db) return;
|
|
1841
|
+
await promisify(db.transaction([storeName], "readwrite").objectStore(storeName).delete(key));
|
|
1842
|
+
});
|
|
1843
|
+
},
|
|
1844
|
+
async clear() {
|
|
1845
|
+
memoryState.clear();
|
|
1846
|
+
await withAppStorage(async () => {
|
|
1847
|
+
const db = await openDB();
|
|
1848
|
+
if (!db) return;
|
|
1849
|
+
await promisify(db.transaction([storeName], "readwrite").objectStore(storeName).clear());
|
|
1850
|
+
});
|
|
1851
|
+
}
|
|
1852
|
+
};
|
|
1853
|
+
return storage;
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1774
1856
|
// src/usage-metered.ts
|
|
1775
1857
|
function isUsageMetered(usage, subscription) {
|
|
1776
1858
|
const empty = usage.total_spend === 0 && usage.total_tokens === 0 && usage.total_requests === 0;
|
|
@@ -2101,6 +2183,7 @@ exports.createArbiDocumentSessionStore = createArbiDocumentSessionStore;
|
|
|
2101
2183
|
exports.createArbiLayoutStore = createArbiLayoutStore;
|
|
2102
2184
|
exports.createArbiSessionStore = createArbiSessionStore;
|
|
2103
2185
|
exports.createArbiWorkspaceStore = createArbiWorkspaceStore;
|
|
2186
|
+
exports.createBrowserStateStorage = createBrowserStateStorage;
|
|
2104
2187
|
exports.createDebouncedWriter = createDebouncedWriter;
|
|
2105
2188
|
exports.createSealedDraftStorage = createSealedDraftStorage;
|
|
2106
2189
|
exports.createStoragePersist = createStoragePersist;
|
|
@@ -2162,5 +2245,5 @@ exports.useTransientView = useTransientView;
|
|
|
2162
2245
|
exports.useUserUsageToday = useUserUsageToday;
|
|
2163
2246
|
exports.useWorkspaceActivity = useWorkspaceActivity;
|
|
2164
2247
|
exports.useWorkspaces = useWorkspaces;
|
|
2165
|
-
//# sourceMappingURL=chunk-
|
|
2166
|
-
//# sourceMappingURL=chunk-
|
|
2248
|
+
//# sourceMappingURL=chunk-ZZZYVNFW.cjs.map
|
|
2249
|
+
//# sourceMappingURL=chunk-ZZZYVNFW.cjs.map
|