@liveblocks/core 2.9.0 → 2.9.2-emails1
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.d.mts +39 -2
- package/dist/index.d.ts +39 -2
- package/dist/index.js +30 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +29 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ var __export = (target, all) => {
|
|
|
6
6
|
|
|
7
7
|
// src/version.ts
|
|
8
8
|
var PKG_NAME = "@liveblocks/core";
|
|
9
|
-
var PKG_VERSION = "2.9.
|
|
9
|
+
var PKG_VERSION = "2.9.2-emails1";
|
|
10
10
|
var PKG_FORMAT = "esm";
|
|
11
11
|
|
|
12
12
|
// src/dupe-detection.ts
|
|
@@ -1990,8 +1990,8 @@ function convertToCommentData(data) {
|
|
|
1990
1990
|
}
|
|
1991
1991
|
}
|
|
1992
1992
|
function convertToThreadData(data) {
|
|
1993
|
-
const updatedAt = data.updatedAt ? new Date(data.updatedAt) : void 0;
|
|
1994
1993
|
const createdAt = new Date(data.createdAt);
|
|
1994
|
+
const updatedAt = new Date(data.updatedAt);
|
|
1995
1995
|
const comments = data.comments.map(
|
|
1996
1996
|
(comment) => convertToCommentData(comment)
|
|
1997
1997
|
);
|
|
@@ -2227,7 +2227,7 @@ function createNotificationsApi({
|
|
|
2227
2227
|
};
|
|
2228
2228
|
}
|
|
2229
2229
|
async function getUserThreadsSince_experimental(options) {
|
|
2230
|
-
const json = await fetchJson(url`/v2/c/threads`, void 0, {
|
|
2230
|
+
const json = await fetchJson(url`/v2/c/threads/delta`, void 0, {
|
|
2231
2231
|
since: options.since.toISOString()
|
|
2232
2232
|
});
|
|
2233
2233
|
return {
|
|
@@ -6495,7 +6495,7 @@ ${Array.from(traces).join("\n\n")}`
|
|
|
6495
6495
|
}
|
|
6496
6496
|
async function getThreadsSince(options2) {
|
|
6497
6497
|
const response = await fetchCommentsApi(
|
|
6498
|
-
url`/v2/c/rooms/${config.roomId}/threads`,
|
|
6498
|
+
url`/v2/c/rooms/${config.roomId}/threads/delta`,
|
|
6499
6499
|
{ since: options2?.since?.toISOString() },
|
|
6500
6500
|
{
|
|
6501
6501
|
headers: {
|
|
@@ -7730,6 +7730,22 @@ async function stringifyCommentBody(body, options) {
|
|
|
7730
7730
|
return blocks.join(separator);
|
|
7731
7731
|
}
|
|
7732
7732
|
|
|
7733
|
+
// src/comments/comment-url.ts
|
|
7734
|
+
var PLACEHOLDER_BASE_URL = "https://localhost:9999";
|
|
7735
|
+
var ABSOLUTE_URL_REGEX = /^[a-zA-Z][a-zA-Z\d+\-.]*?:/;
|
|
7736
|
+
function generateCommentUrl({
|
|
7737
|
+
roomUrl,
|
|
7738
|
+
commentId
|
|
7739
|
+
}) {
|
|
7740
|
+
const isAbsolute = ABSOLUTE_URL_REGEX.test(roomUrl);
|
|
7741
|
+
const urlObject = new URL(
|
|
7742
|
+
roomUrl,
|
|
7743
|
+
isAbsolute ? void 0 : PLACEHOLDER_BASE_URL
|
|
7744
|
+
);
|
|
7745
|
+
urlObject.hash = `#${commentId}`;
|
|
7746
|
+
return isAbsolute ? urlObject.href : urlObject.href.replace(PLACEHOLDER_BASE_URL, "");
|
|
7747
|
+
}
|
|
7748
|
+
|
|
7733
7749
|
// src/crdts/utils.ts
|
|
7734
7750
|
function toPlainLson(lson) {
|
|
7735
7751
|
if (lson instanceof LiveObject) {
|
|
@@ -8187,6 +8203,7 @@ export {
|
|
|
8187
8203
|
LiveObject,
|
|
8188
8204
|
NotificationsApiError,
|
|
8189
8205
|
OpCode,
|
|
8206
|
+
Promise_withResolvers,
|
|
8190
8207
|
ServerMsgCode,
|
|
8191
8208
|
StopRetrying2 as StopRetrying,
|
|
8192
8209
|
WebsocketCloseCodes,
|
|
@@ -8214,8 +8231,14 @@ export {
|
|
|
8214
8231
|
detectDupes,
|
|
8215
8232
|
errorIf,
|
|
8216
8233
|
freeze,
|
|
8234
|
+
generateCommentUrl,
|
|
8217
8235
|
getMentionedIdsFromCommentBody,
|
|
8236
|
+
html,
|
|
8237
|
+
htmlSafe,
|
|
8218
8238
|
isChildCrdt,
|
|
8239
|
+
isCommentBodyLink,
|
|
8240
|
+
isCommentBodyMention,
|
|
8241
|
+
isCommentBodyText,
|
|
8219
8242
|
isJsonArray,
|
|
8220
8243
|
isJsonObject,
|
|
8221
8244
|
isJsonScalar,
|
|
@@ -8235,10 +8258,12 @@ export {
|
|
|
8235
8258
|
objectToQuery,
|
|
8236
8259
|
patchLiveObjectKey,
|
|
8237
8260
|
raise,
|
|
8261
|
+
resolveUsersInCommentBody,
|
|
8238
8262
|
shallow,
|
|
8239
8263
|
stringify,
|
|
8240
8264
|
stringifyCommentBody,
|
|
8241
8265
|
throwUsageError,
|
|
8266
|
+
toAbsoluteUrl,
|
|
8242
8267
|
toPlainLson,
|
|
8243
8268
|
tryParseJson,
|
|
8244
8269
|
url,
|