@reverbia/sdk 1.0.0-next.20260111125102 → 1.0.0-next.20260111125929
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/react/index.cjs +18 -15
- package/dist/react/index.mjs +18 -15
- package/package.json +1 -1
package/dist/react/index.cjs
CHANGED
|
@@ -3397,7 +3397,7 @@ function useChatStorage(options) {
|
|
|
3397
3397
|
`[getMessages] Found ${fileIds.length} placeholder(s) in message ${msg.uniqueId}:`,
|
|
3398
3398
|
fileIds
|
|
3399
3399
|
);
|
|
3400
|
-
|
|
3400
|
+
const fileIdToUrlMap = /* @__PURE__ */ new Map();
|
|
3401
3401
|
for (const fileId of fileIds) {
|
|
3402
3402
|
const placeholder = createFilePlaceholder(fileId);
|
|
3403
3403
|
console.log(
|
|
@@ -3427,26 +3427,29 @@ function useChatStorage(options) {
|
|
|
3427
3427
|
);
|
|
3428
3428
|
}
|
|
3429
3429
|
if (url) {
|
|
3430
|
-
|
|
3431
|
-
placeholder.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"),
|
|
3432
|
-
"g"
|
|
3433
|
-
);
|
|
3434
|
-
const matches = resolvedContent.match(placeholderRegex);
|
|
3435
|
-
const replacement = ``;
|
|
3436
|
-
console.log(
|
|
3437
|
-
`[getMessages] Replacing ${matches?.length || 0} instance(s) of ${placeholder} with:`,
|
|
3438
|
-
replacement
|
|
3439
|
-
);
|
|
3440
|
-
resolvedContent = resolvedContent.replace(
|
|
3441
|
-
placeholderRegex,
|
|
3442
|
-
replacement
|
|
3443
|
-
);
|
|
3430
|
+
fileIdToUrlMap.set(fileId, url);
|
|
3444
3431
|
} else {
|
|
3445
3432
|
console.warn(
|
|
3446
3433
|
`[getMessages] No URL available for ${fileId}, placeholder ${placeholder} will remain in content`
|
|
3447
3434
|
);
|
|
3448
3435
|
}
|
|
3449
3436
|
}
|
|
3437
|
+
const resolvedContent = msg.content.replace(
|
|
3438
|
+
FILE_PLACEHOLDER_REGEX,
|
|
3439
|
+
(match, fileId) => {
|
|
3440
|
+
const url = fileIdToUrlMap.get(fileId);
|
|
3441
|
+
if (url) {
|
|
3442
|
+
console.log(
|
|
3443
|
+
`[getMessages] Replacing ${match} with: `
|
|
3444
|
+
);
|
|
3445
|
+
return ``;
|
|
3446
|
+
}
|
|
3447
|
+
console.warn(
|
|
3448
|
+
`[getMessages] No URL available for ${fileId}, placeholder ${match} will remain in content`
|
|
3449
|
+
);
|
|
3450
|
+
return match;
|
|
3451
|
+
}
|
|
3452
|
+
);
|
|
3450
3453
|
console.log(
|
|
3451
3454
|
`[getMessages] Resolved content length: ${resolvedContent.length}, original length: ${msg.content.length}`
|
|
3452
3455
|
);
|
package/dist/react/index.mjs
CHANGED
|
@@ -3261,7 +3261,7 @@ function useChatStorage(options) {
|
|
|
3261
3261
|
`[getMessages] Found ${fileIds.length} placeholder(s) in message ${msg.uniqueId}:`,
|
|
3262
3262
|
fileIds
|
|
3263
3263
|
);
|
|
3264
|
-
|
|
3264
|
+
const fileIdToUrlMap = /* @__PURE__ */ new Map();
|
|
3265
3265
|
for (const fileId of fileIds) {
|
|
3266
3266
|
const placeholder = createFilePlaceholder(fileId);
|
|
3267
3267
|
console.log(
|
|
@@ -3291,26 +3291,29 @@ function useChatStorage(options) {
|
|
|
3291
3291
|
);
|
|
3292
3292
|
}
|
|
3293
3293
|
if (url) {
|
|
3294
|
-
|
|
3295
|
-
placeholder.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"),
|
|
3296
|
-
"g"
|
|
3297
|
-
);
|
|
3298
|
-
const matches = resolvedContent.match(placeholderRegex);
|
|
3299
|
-
const replacement = ``;
|
|
3300
|
-
console.log(
|
|
3301
|
-
`[getMessages] Replacing ${matches?.length || 0} instance(s) of ${placeholder} with:`,
|
|
3302
|
-
replacement
|
|
3303
|
-
);
|
|
3304
|
-
resolvedContent = resolvedContent.replace(
|
|
3305
|
-
placeholderRegex,
|
|
3306
|
-
replacement
|
|
3307
|
-
);
|
|
3294
|
+
fileIdToUrlMap.set(fileId, url);
|
|
3308
3295
|
} else {
|
|
3309
3296
|
console.warn(
|
|
3310
3297
|
`[getMessages] No URL available for ${fileId}, placeholder ${placeholder} will remain in content`
|
|
3311
3298
|
);
|
|
3312
3299
|
}
|
|
3313
3300
|
}
|
|
3301
|
+
const resolvedContent = msg.content.replace(
|
|
3302
|
+
FILE_PLACEHOLDER_REGEX,
|
|
3303
|
+
(match, fileId) => {
|
|
3304
|
+
const url = fileIdToUrlMap.get(fileId);
|
|
3305
|
+
if (url) {
|
|
3306
|
+
console.log(
|
|
3307
|
+
`[getMessages] Replacing ${match} with: `
|
|
3308
|
+
);
|
|
3309
|
+
return ``;
|
|
3310
|
+
}
|
|
3311
|
+
console.warn(
|
|
3312
|
+
`[getMessages] No URL available for ${fileId}, placeholder ${match} will remain in content`
|
|
3313
|
+
);
|
|
3314
|
+
return match;
|
|
3315
|
+
}
|
|
3316
|
+
);
|
|
3314
3317
|
console.log(
|
|
3315
3318
|
`[getMessages] Resolved content length: ${resolvedContent.length}, original length: ${msg.content.length}`
|
|
3316
3319
|
);
|