@pooflabs/web 0.0.51 → 0.0.53
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-D2XrI-Bi.esm.js → index-B0NsBBNE.esm.js} +2 -2
- package/dist/{index-D2XrI-Bi.esm.js.map → index-B0NsBBNE.esm.js.map} +1 -1
- package/dist/{index-CBXqUvfd.esm.js → index-Cdm_PDUQ.esm.js} +38 -14
- package/dist/index-Cdm_PDUQ.esm.js.map +1 -0
- package/dist/{index-wKMEBSXZ.js → index-DQjARwrG.js} +2 -2
- package/dist/{index-wKMEBSXZ.js.map → index-DQjARwrG.js.map} +1 -1
- package/dist/{index-BhxonHm1.js → index-m8DmKiJ7.js} +38 -14
- package/dist/index-m8DmKiJ7.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/dist/index-BhxonHm1.js.map +0 -1
- package/dist/index-CBXqUvfd.esm.js.map +0 -1
|
@@ -9696,8 +9696,10 @@ async function get$2(path, opts = {}) {
|
|
|
9696
9696
|
if (!normalizedPath || normalizedPath.length === 0) {
|
|
9697
9697
|
return new Error("Invalid path provided.");
|
|
9698
9698
|
}
|
|
9699
|
-
// Create cache key combining path and
|
|
9700
|
-
const
|
|
9699
|
+
// Create cache key combining path, prompt, includeSubPaths, and shape
|
|
9700
|
+
const shapeKey = opts.shape ? JSON.stringify(opts.shape) : '';
|
|
9701
|
+
const includeSubPathsKey = opts.includeSubPaths ? ':subpaths' : '';
|
|
9702
|
+
const cacheKey = `${normalizedPath}:${opts.prompt || ''}${includeSubPathsKey}:${shapeKey}`;
|
|
9701
9703
|
const now = Date.now();
|
|
9702
9704
|
// Check for valid cache entry if not bypassing cache
|
|
9703
9705
|
if (!opts.bypassCache && getCache[cacheKey] && now < getCache[cacheKey].expiresAt) {
|
|
@@ -9718,15 +9720,20 @@ async function get$2(path, opts = {}) {
|
|
|
9718
9720
|
// Cache miss or bypass - proceed with API request
|
|
9719
9721
|
const pathIsDocument = normalizedPath.split("/").length % 2 === 0;
|
|
9720
9722
|
let response;
|
|
9723
|
+
// Build common query params
|
|
9724
|
+
const includeSubPathsParam = opts.includeSubPaths ? '&includeSubPaths=true' : '';
|
|
9725
|
+
const shapeParam = opts.shape ? `&shape=${encodeURIComponent(JSON.stringify(opts.shape))}` : '';
|
|
9721
9726
|
if (pathIsDocument) {
|
|
9722
9727
|
const itemId = encodeURIComponent(normalizedPath);
|
|
9723
|
-
|
|
9728
|
+
// For documents, query params go after the path
|
|
9729
|
+
const queryParams = [includeSubPathsParam, shapeParam].filter(p => p).join('');
|
|
9730
|
+
const apiPath = queryParams ? `items/${itemId}?${queryParams.substring(1)}` : `items/${itemId}`;
|
|
9724
9731
|
response = await makeApiRequest('GET', apiPath, null, opts._overrides);
|
|
9725
9732
|
}
|
|
9726
9733
|
else {
|
|
9727
9734
|
const path = encodeURIComponent(normalizedPath);
|
|
9728
9735
|
const promptQueryParam = (opts === null || opts === void 0 ? void 0 : opts.prompt) ? `&prompt=${btoa(opts.prompt)}` : "";
|
|
9729
|
-
const apiPath = `items?path=${path}${promptQueryParam}`;
|
|
9736
|
+
const apiPath = `items?path=${path}${promptQueryParam}${includeSubPathsParam}${shapeParam}`;
|
|
9730
9737
|
response = await makeApiRequest('GET', apiPath, null, opts._overrides);
|
|
9731
9738
|
}
|
|
9732
9739
|
// Cache the response (unless bypassing cache)
|
|
@@ -10142,9 +10149,10 @@ const WS_V2_PATH = '/ws/v2';
|
|
|
10142
10149
|
function generateSubscriptionId() {
|
|
10143
10150
|
return `sub_${Date.now()}_${Math.random().toString(36).substring(2, 11)}`;
|
|
10144
10151
|
}
|
|
10145
|
-
function getCacheKey(path, prompt) {
|
|
10152
|
+
function getCacheKey(path, prompt, shape) {
|
|
10146
10153
|
const normalizedPath = path.startsWith('/') ? path.slice(1) : path;
|
|
10147
|
-
|
|
10154
|
+
const shapeKey = shape && Object.keys(shape).length > 0 ? JSON.stringify(shape) : '';
|
|
10155
|
+
return `${normalizedPath}:${prompt || 'default'}:${shapeKey}`;
|
|
10148
10156
|
}
|
|
10149
10157
|
function isTokenExpired(token) {
|
|
10150
10158
|
try {
|
|
@@ -10310,7 +10318,7 @@ function handleServerMessage(connection, message) {
|
|
|
10310
10318
|
const subscription = connection.subscriptions.get(message.subscriptionId);
|
|
10311
10319
|
if (subscription) {
|
|
10312
10320
|
// Update cache
|
|
10313
|
-
const cacheKey = getCacheKey(subscription.path, subscription.prompt);
|
|
10321
|
+
const cacheKey = getCacheKey(subscription.path, subscription.prompt, subscription.shape);
|
|
10314
10322
|
responseCache.set(cacheKey, { data: message.data, timestamp: Date.now() });
|
|
10315
10323
|
// Store last data
|
|
10316
10324
|
subscription.lastData = message.data;
|
|
@@ -10338,7 +10346,7 @@ function handleServerMessage(connection, message) {
|
|
|
10338
10346
|
const subscription = connection.subscriptions.get(message.subscriptionId);
|
|
10339
10347
|
if (subscription) {
|
|
10340
10348
|
// Update cache
|
|
10341
|
-
const cacheKey = getCacheKey(subscription.path, subscription.prompt);
|
|
10349
|
+
const cacheKey = getCacheKey(subscription.path, subscription.prompt, subscription.shape);
|
|
10342
10350
|
responseCache.set(cacheKey, { data: message.data, timestamp: Date.now() });
|
|
10343
10351
|
// Store last data
|
|
10344
10352
|
subscription.lastData = message.data;
|
|
@@ -10391,6 +10399,9 @@ function sendSubscribe(connection, subscription) {
|
|
|
10391
10399
|
path: subscription.path,
|
|
10392
10400
|
prompt: subscription.prompt ? btoa(subscription.prompt) : undefined,
|
|
10393
10401
|
includeSubPaths: subscription.includeSubPaths,
|
|
10402
|
+
shape: subscription.shape && Object.keys(subscription.shape).length > 0
|
|
10403
|
+
? subscription.shape
|
|
10404
|
+
: undefined,
|
|
10394
10405
|
};
|
|
10395
10406
|
try {
|
|
10396
10407
|
connection.ws.send(JSON.stringify(message));
|
|
@@ -10422,7 +10433,7 @@ function sendUnsubscribe(connection, subscriptionId) {
|
|
|
10422
10433
|
async function subscribeV2(path, subscriptionOptions) {
|
|
10423
10434
|
const config = await getConfig();
|
|
10424
10435
|
const normalizedPath = path.startsWith('/') ? path.slice(1) : path;
|
|
10425
|
-
const cacheKey = getCacheKey(normalizedPath, subscriptionOptions.prompt);
|
|
10436
|
+
const cacheKey = getCacheKey(normalizedPath, subscriptionOptions.prompt, subscriptionOptions.shape);
|
|
10426
10437
|
// Deliver cached data immediately if available
|
|
10427
10438
|
const cachedEntry = responseCache.get(cacheKey);
|
|
10428
10439
|
if (cachedEntry && Date.now() - cachedEntry.timestamp < CACHE_TTL && subscriptionOptions.onData) {
|
|
@@ -10433,10 +10444,12 @@ async function subscribeV2(path, subscriptionOptions) {
|
|
|
10433
10444
|
}
|
|
10434
10445
|
// Get or create connection for this appId
|
|
10435
10446
|
const connection = await getOrCreateConnection(config.appId, config.isServer);
|
|
10436
|
-
// Check if we already have a subscription for this path+prompt
|
|
10447
|
+
// Check if we already have a subscription for this path+prompt+shape
|
|
10448
|
+
const shapeKey = subscriptionOptions.shape ? JSON.stringify(subscriptionOptions.shape) : '';
|
|
10437
10449
|
let existingSubscription;
|
|
10438
10450
|
for (const sub of connection.subscriptions.values()) {
|
|
10439
|
-
|
|
10451
|
+
const subShapeKey = sub.shape ? JSON.stringify(sub.shape) : '';
|
|
10452
|
+
if (sub.path === normalizedPath && sub.prompt === subscriptionOptions.prompt && subShapeKey === shapeKey) {
|
|
10440
10453
|
existingSubscription = sub;
|
|
10441
10454
|
break;
|
|
10442
10455
|
}
|
|
@@ -10461,6 +10474,7 @@ async function subscribeV2(path, subscriptionOptions) {
|
|
|
10461
10474
|
subscriptionId,
|
|
10462
10475
|
path: normalizedPath,
|
|
10463
10476
|
prompt: subscriptionOptions.prompt,
|
|
10477
|
+
shape: subscriptionOptions.shape,
|
|
10464
10478
|
includeSubPaths: false,
|
|
10465
10479
|
callbacks: [subscriptionOptions],
|
|
10466
10480
|
lastData: undefined,
|
|
@@ -13087,7 +13101,7 @@ async function loadDependencies() {
|
|
|
13087
13101
|
const [reactModule, reactDomModule, phantomModule] = await Promise.all([
|
|
13088
13102
|
import('react'),
|
|
13089
13103
|
import('react-dom/client'),
|
|
13090
|
-
Promise.resolve().then(function () { return require('./index-
|
|
13104
|
+
Promise.resolve().then(function () { return require('./index-DQjARwrG.js'); })
|
|
13091
13105
|
]);
|
|
13092
13106
|
// Extract default export from ESM module namespace
|
|
13093
13107
|
// Dynamic import() returns { default: Module, ...exports }, not the module directly
|
|
@@ -13385,7 +13399,7 @@ class PhantomWalletProvider {
|
|
|
13385
13399
|
let socialBtnContainer = null;
|
|
13386
13400
|
let didAutoClick = false;
|
|
13387
13401
|
const enhanceModal = () => {
|
|
13388
|
-
var _a, _b;
|
|
13402
|
+
var _a, _b, _c;
|
|
13389
13403
|
const overlayEl = ((_a = that.containerElement) === null || _a === void 0 ? void 0 : _a.querySelector('div[style*="z-index"]'))
|
|
13390
13404
|
|| document.querySelector('div[style*="z-index: 9999"]');
|
|
13391
13405
|
const modalCard = overlayEl === null || overlayEl === void 0 ? void 0 : overlayEl.firstElementChild;
|
|
@@ -13418,6 +13432,16 @@ class PhantomWalletProvider {
|
|
|
13418
13432
|
break;
|
|
13419
13433
|
}
|
|
13420
13434
|
}
|
|
13435
|
+
// Hide the "OR" divider that appears between injected wallet and deeplink
|
|
13436
|
+
const allSpans = modalCard.querySelectorAll('span');
|
|
13437
|
+
for (const span of allSpans) {
|
|
13438
|
+
if (((_c = span.textContent) === null || _c === void 0 ? void 0 : _c.trim()) === 'OR') {
|
|
13439
|
+
const dividerContainer = span.parentElement;
|
|
13440
|
+
if (dividerContainer)
|
|
13441
|
+
dividerContainer.style.display = 'none';
|
|
13442
|
+
break;
|
|
13443
|
+
}
|
|
13444
|
+
}
|
|
13421
13445
|
// Inject the email login button if not already present
|
|
13422
13446
|
if (socialBtnContainer || modalCard.querySelector('[data-privy-fallback-btn]'))
|
|
13423
13447
|
return;
|
|
@@ -34230,4 +34254,4 @@ exports.signSessionCreateMessage = signSessionCreateMessage;
|
|
|
34230
34254
|
exports.signTransaction = signTransaction;
|
|
34231
34255
|
exports.subscribe = subscribe;
|
|
34232
34256
|
exports.useAuth = useAuth;
|
|
34233
|
-
//# sourceMappingURL=index-
|
|
34257
|
+
//# sourceMappingURL=index-m8DmKiJ7.js.map
|