@liveblocks/core 2.9.3-emails1 → 2.9.3-experimental1

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 CHANGED
@@ -381,6 +381,7 @@ declare type LiveListUpdateDelta = {
381
381
  } | {
382
382
  type: "delete";
383
383
  index: number;
384
+ deletedItem: Lson;
384
385
  } | {
385
386
  type: "move";
386
387
  index: number;
@@ -2665,44 +2666,16 @@ declare type StringifyCommentBodyOptions<U extends BaseUserMeta = DU> = {
2665
2666
  */
2666
2667
  resolveUsers?: (args: ResolveUsersArgs) => OptionalPromise<(U["info"] | undefined)[] | undefined>;
2667
2668
  };
2668
- declare function isCommentBodyText(element: CommentBodyElement): element is CommentBodyText;
2669
- declare function isCommentBodyMention(element: CommentBodyElement): element is CommentBodyMention;
2670
- declare function isCommentBodyLink(element: CommentBodyElement): element is CommentBodyLink;
2671
2669
  /**
2672
2670
  * Get an array of each user's ID that has been mentioned in a `CommentBody`.
2673
2671
  */
2674
2672
  declare function getMentionedIdsFromCommentBody(body: CommentBody): string[];
2675
- declare function resolveUsersInCommentBody<U extends BaseUserMeta>(body: CommentBody, resolveUsers?: (args: ResolveUsersArgs) => OptionalPromise<(U["info"] | undefined)[] | undefined>): Promise<Map<string, U["info"]>>;
2676
- declare function htmlSafe(value: string): HtmlSafeString;
2677
- declare class HtmlSafeString {
2678
- private _strings;
2679
- private _values;
2680
- constructor(strings: readonly string[], values: readonly (string | string[] | HtmlSafeString | HtmlSafeString[])[]);
2681
- toString(): string;
2682
- }
2683
- /**
2684
- * Build an HTML string from a template literal where the values are escaped.
2685
- * Nested calls are supported and won't be escaped.
2686
- */
2687
- declare function html(strings: TemplateStringsArray, ...values: (string | string[] | HtmlSafeString | HtmlSafeString[])[]): string;
2688
- /**
2689
- * Helper function to convert a URL (relative or absolute) to an absolute URL.
2690
- *
2691
- * @param url The URL to convert to an absolute URL (relative or absolute).
2692
- * @returns The absolute URL or undefined if the URL is invalid.
2693
- */
2694
- declare function toAbsoluteUrl(url: string): string | undefined;
2695
2673
  /**
2696
2674
  * Convert a `CommentBody` into either a plain string,
2697
2675
  * Markdown, HTML, or a custom format.
2698
2676
  */
2699
2677
  declare function stringifyCommentBody(body: CommentBody, options?: StringifyCommentBodyOptions<BaseUserMeta>): Promise<string>;
2700
2678
 
2701
- declare function generateCommentUrl({ roomUrl, commentId, }: {
2702
- roomUrl: string;
2703
- commentId: string;
2704
- }): string;
2705
-
2706
2679
  /**
2707
2680
  * Converts a plain comment data object (usually returned by the API) to a comment data object that can be used by the client.
2708
2681
  * This is necessary because the plain data object stores dates as ISO strings, but the client expects them as Date objects.
@@ -2815,15 +2788,6 @@ declare class StopRetrying extends Error {
2815
2788
 
2816
2789
  declare function chunk<T>(array: T[], size: number): T[][];
2817
2790
 
2818
- /**
2819
- * Drop-in replacement for the ES2024 Promise.withResolvers() API.
2820
- */
2821
- declare function Promise_withResolvers<T>(): {
2822
- promise: Promise<T>;
2823
- resolve: (value: T) => void;
2824
- reject: (reason: unknown) => void;
2825
- };
2826
-
2827
2791
  declare function createThreadId(): string;
2828
2792
  declare function createCommentId(): string;
2829
2793
  declare function createInboxNotificationId(): string;
@@ -3213,4 +3177,4 @@ declare type EnsureJson<T> = T extends Json ? T : T extends Array<infer I> ? (En
3213
3177
  [K in keyof T as EnsureJson<T[K]> extends never ? never : K]: EnsureJson<T[K]>;
3214
3178
  };
3215
3179
 
3216
- export { type AckOp, type ActivityData, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type BaseActivitiesData, type BaseAuthResult, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type CommentAttachment, type CommentBody, type CommentBodyBlockElement, type CommentBodyElement, type CommentBodyInlineElement, type CommentBodyLink, type CommentBodyLinkElementArgs, type CommentBodyMention, type CommentBodyMentionElementArgs, type CommentBodyParagraph, type CommentBodyParagraphElementArgs, type CommentBodyText, type CommentBodyTextElementArgs, type CommentData, type CommentDataPlain, type CommentLocalAttachment, type CommentMixedAttachment, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, CommentsApiError, type CommentsEventServerMsg, CrdtType, type CreateListOp, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type CustomAuthenticationResult, type DAD, type DE, type DM, type DP, type DRI, type DS, type DU, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type History, type HistoryVersion, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IdTuple, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LostConnectionEvent, type Lson, type LsonObject, type NoInfr, type NodeMap, NotificationsApiError, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalPromise, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialUnless, type Patchable, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type PrivateClientApi, type PrivateRoomApi, Promise_withResolvers, type QueryMetadata, type QueryParams, type RejectedStorageOpServerMsg, type Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomNotificationSettings, type RoomStateServerMsg, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, type Status, StopRetrying, type StorageStatus, type StorageUpdate, type Store, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type User, type UserJoinServerMsg, type UserLeftServerMsg, WebsocketCloseCodes, type YDocUpdateServerMsg, ackOp, asPos, assert, assertNever, autoRetry, b64decode, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToInboxNotificationData, convertToThreadData, createClient, createCommentId, createInboxNotificationId, createStore, createThreadId, deprecate, deprecateIf, detectDupes, errorIf, freeze, generateCommentUrl, getMentionedIdsFromCommentBody, html, htmlSafe, isChildCrdt, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isPlainObject, isRootCrdt, kInternal, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, raise, resolveUsersInCommentBody, shallow, stringify, stringifyCommentBody, throwUsageError, toAbsoluteUrl, toPlainLson, tryParseJson, url, urljoin, wait, withTimeout };
3180
+ export { type AckOp, type ActivityData, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type BaseActivitiesData, type BaseAuthResult, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type CommentAttachment, type CommentBody, type CommentBodyBlockElement, type CommentBodyElement, type CommentBodyInlineElement, type CommentBodyLink, type CommentBodyLinkElementArgs, type CommentBodyMention, type CommentBodyMentionElementArgs, type CommentBodyParagraph, type CommentBodyParagraphElementArgs, type CommentBodyText, type CommentBodyTextElementArgs, type CommentData, type CommentDataPlain, type CommentLocalAttachment, type CommentMixedAttachment, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, CommentsApiError, type CommentsEventServerMsg, CrdtType, type CreateListOp, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type CustomAuthenticationResult, type DAD, type DE, type DM, type DP, type DRI, type DS, type DU, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type History, type HistoryVersion, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IdTuple, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LostConnectionEvent, type Lson, type LsonObject, type NoInfr, type NodeMap, NotificationsApiError, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalPromise, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialUnless, type Patchable, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type PrivateClientApi, type PrivateRoomApi, type QueryMetadata, type QueryParams, type RejectedStorageOpServerMsg, type Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomNotificationSettings, type RoomStateServerMsg, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, type Status, StopRetrying, type StorageStatus, type StorageUpdate, type Store, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type User, type UserJoinServerMsg, type UserLeftServerMsg, WebsocketCloseCodes, type YDocUpdateServerMsg, ackOp, asPos, assert, assertNever, autoRetry, b64decode, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToInboxNotificationData, convertToThreadData, createClient, createCommentId, createInboxNotificationId, createStore, createThreadId, deprecate, deprecateIf, detectDupes, errorIf, freeze, getMentionedIdsFromCommentBody, isChildCrdt, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isPlainObject, isRootCrdt, kInternal, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, raise, shallow, stringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, url, urljoin, wait, withTimeout };
package/dist/index.d.ts CHANGED
@@ -381,6 +381,7 @@ declare type LiveListUpdateDelta = {
381
381
  } | {
382
382
  type: "delete";
383
383
  index: number;
384
+ deletedItem: Lson;
384
385
  } | {
385
386
  type: "move";
386
387
  index: number;
@@ -2665,44 +2666,16 @@ declare type StringifyCommentBodyOptions<U extends BaseUserMeta = DU> = {
2665
2666
  */
2666
2667
  resolveUsers?: (args: ResolveUsersArgs) => OptionalPromise<(U["info"] | undefined)[] | undefined>;
2667
2668
  };
2668
- declare function isCommentBodyText(element: CommentBodyElement): element is CommentBodyText;
2669
- declare function isCommentBodyMention(element: CommentBodyElement): element is CommentBodyMention;
2670
- declare function isCommentBodyLink(element: CommentBodyElement): element is CommentBodyLink;
2671
2669
  /**
2672
2670
  * Get an array of each user's ID that has been mentioned in a `CommentBody`.
2673
2671
  */
2674
2672
  declare function getMentionedIdsFromCommentBody(body: CommentBody): string[];
2675
- declare function resolveUsersInCommentBody<U extends BaseUserMeta>(body: CommentBody, resolveUsers?: (args: ResolveUsersArgs) => OptionalPromise<(U["info"] | undefined)[] | undefined>): Promise<Map<string, U["info"]>>;
2676
- declare function htmlSafe(value: string): HtmlSafeString;
2677
- declare class HtmlSafeString {
2678
- private _strings;
2679
- private _values;
2680
- constructor(strings: readonly string[], values: readonly (string | string[] | HtmlSafeString | HtmlSafeString[])[]);
2681
- toString(): string;
2682
- }
2683
- /**
2684
- * Build an HTML string from a template literal where the values are escaped.
2685
- * Nested calls are supported and won't be escaped.
2686
- */
2687
- declare function html(strings: TemplateStringsArray, ...values: (string | string[] | HtmlSafeString | HtmlSafeString[])[]): string;
2688
- /**
2689
- * Helper function to convert a URL (relative or absolute) to an absolute URL.
2690
- *
2691
- * @param url The URL to convert to an absolute URL (relative or absolute).
2692
- * @returns The absolute URL or undefined if the URL is invalid.
2693
- */
2694
- declare function toAbsoluteUrl(url: string): string | undefined;
2695
2673
  /**
2696
2674
  * Convert a `CommentBody` into either a plain string,
2697
2675
  * Markdown, HTML, or a custom format.
2698
2676
  */
2699
2677
  declare function stringifyCommentBody(body: CommentBody, options?: StringifyCommentBodyOptions<BaseUserMeta>): Promise<string>;
2700
2678
 
2701
- declare function generateCommentUrl({ roomUrl, commentId, }: {
2702
- roomUrl: string;
2703
- commentId: string;
2704
- }): string;
2705
-
2706
2679
  /**
2707
2680
  * Converts a plain comment data object (usually returned by the API) to a comment data object that can be used by the client.
2708
2681
  * This is necessary because the plain data object stores dates as ISO strings, but the client expects them as Date objects.
@@ -2815,15 +2788,6 @@ declare class StopRetrying extends Error {
2815
2788
 
2816
2789
  declare function chunk<T>(array: T[], size: number): T[][];
2817
2790
 
2818
- /**
2819
- * Drop-in replacement for the ES2024 Promise.withResolvers() API.
2820
- */
2821
- declare function Promise_withResolvers<T>(): {
2822
- promise: Promise<T>;
2823
- resolve: (value: T) => void;
2824
- reject: (reason: unknown) => void;
2825
- };
2826
-
2827
2791
  declare function createThreadId(): string;
2828
2792
  declare function createCommentId(): string;
2829
2793
  declare function createInboxNotificationId(): string;
@@ -3213,4 +3177,4 @@ declare type EnsureJson<T> = T extends Json ? T : T extends Array<infer I> ? (En
3213
3177
  [K in keyof T as EnsureJson<T[K]> extends never ? never : K]: EnsureJson<T[K]>;
3214
3178
  };
3215
3179
 
3216
- export { type AckOp, type ActivityData, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type BaseActivitiesData, type BaseAuthResult, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type CommentAttachment, type CommentBody, type CommentBodyBlockElement, type CommentBodyElement, type CommentBodyInlineElement, type CommentBodyLink, type CommentBodyLinkElementArgs, type CommentBodyMention, type CommentBodyMentionElementArgs, type CommentBodyParagraph, type CommentBodyParagraphElementArgs, type CommentBodyText, type CommentBodyTextElementArgs, type CommentData, type CommentDataPlain, type CommentLocalAttachment, type CommentMixedAttachment, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, CommentsApiError, type CommentsEventServerMsg, CrdtType, type CreateListOp, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type CustomAuthenticationResult, type DAD, type DE, type DM, type DP, type DRI, type DS, type DU, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type History, type HistoryVersion, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IdTuple, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LostConnectionEvent, type Lson, type LsonObject, type NoInfr, type NodeMap, NotificationsApiError, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalPromise, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialUnless, type Patchable, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type PrivateClientApi, type PrivateRoomApi, Promise_withResolvers, type QueryMetadata, type QueryParams, type RejectedStorageOpServerMsg, type Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomNotificationSettings, type RoomStateServerMsg, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, type Status, StopRetrying, type StorageStatus, type StorageUpdate, type Store, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type User, type UserJoinServerMsg, type UserLeftServerMsg, WebsocketCloseCodes, type YDocUpdateServerMsg, ackOp, asPos, assert, assertNever, autoRetry, b64decode, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToInboxNotificationData, convertToThreadData, createClient, createCommentId, createInboxNotificationId, createStore, createThreadId, deprecate, deprecateIf, detectDupes, errorIf, freeze, generateCommentUrl, getMentionedIdsFromCommentBody, html, htmlSafe, isChildCrdt, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isPlainObject, isRootCrdt, kInternal, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, raise, resolveUsersInCommentBody, shallow, stringify, stringifyCommentBody, throwUsageError, toAbsoluteUrl, toPlainLson, tryParseJson, url, urljoin, wait, withTimeout };
3180
+ export { type AckOp, type ActivityData, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type BaseActivitiesData, type BaseAuthResult, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type CommentAttachment, type CommentBody, type CommentBodyBlockElement, type CommentBodyElement, type CommentBodyInlineElement, type CommentBodyLink, type CommentBodyLinkElementArgs, type CommentBodyMention, type CommentBodyMentionElementArgs, type CommentBodyParagraph, type CommentBodyParagraphElementArgs, type CommentBodyText, type CommentBodyTextElementArgs, type CommentData, type CommentDataPlain, type CommentLocalAttachment, type CommentMixedAttachment, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, CommentsApiError, type CommentsEventServerMsg, CrdtType, type CreateListOp, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type CustomAuthenticationResult, type DAD, type DE, type DM, type DP, type DRI, type DS, type DU, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type History, type HistoryVersion, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IdTuple, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LostConnectionEvent, type Lson, type LsonObject, type NoInfr, type NodeMap, NotificationsApiError, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalPromise, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialUnless, type Patchable, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type PrivateClientApi, type PrivateRoomApi, type QueryMetadata, type QueryParams, type RejectedStorageOpServerMsg, type Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomNotificationSettings, type RoomStateServerMsg, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, type Status, StopRetrying, type StorageStatus, type StorageUpdate, type Store, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type User, type UserJoinServerMsg, type UserLeftServerMsg, WebsocketCloseCodes, type YDocUpdateServerMsg, ackOp, asPos, assert, assertNever, autoRetry, b64decode, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToInboxNotificationData, convertToThreadData, createClient, createCommentId, createInboxNotificationId, createStore, createThreadId, deprecate, deprecateIf, detectDupes, errorIf, freeze, getMentionedIdsFromCommentBody, isChildCrdt, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isPlainObject, isRootCrdt, kInternal, legacy_patchImmutableObject, lsonToJson, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, raise, shallow, stringify, stringifyCommentBody, throwUsageError, toPlainLson, tryParseJson, url, urljoin, wait, withTimeout };
package/dist/index.js 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.3-emails1";
9
+ var PKG_VERSION = "2.9.3-experimental1";
10
10
  var PKG_FORMAT = "cjs";
11
11
 
12
12
  // src/dupe-detection.ts
@@ -2868,15 +2868,15 @@ var LiveList = class _LiveList extends AbstractCrdt {
2868
2868
  this._implicitlyDeletedItems.add(
2869
2869
  this._items[indexOfItemWithSamePosition]
2870
2870
  );
2871
- this._items.splice(indexOfItemWithSamePosition, 1);
2872
- delta.push(deleteDelta(indexOfItemWithSamePosition));
2871
+ const [prevNode] = this._items.splice(indexOfItemWithSamePosition, 1);
2872
+ delta.push(deleteDelta(indexOfItemWithSamePosition, prevNode));
2873
2873
  }
2874
- const previousIndex = this._items.indexOf(existingItem);
2874
+ const prevIndex = this._items.indexOf(existingItem);
2875
2875
  existingItem._setParentLink(this, op.parentKey);
2876
2876
  this._sortItems();
2877
2877
  const newIndex = this._items.indexOf(existingItem);
2878
- if (newIndex !== previousIndex) {
2879
- delta.push(moveDelta(previousIndex, newIndex, existingItem));
2878
+ if (newIndex !== prevIndex) {
2879
+ delta.push(moveDelta(prevIndex, newIndex, existingItem));
2880
2880
  }
2881
2881
  return {
2882
2882
  modified: delta.length > 0 ? makeUpdate(this, delta) : false,
@@ -3105,11 +3105,11 @@ var LiveList = class _LiveList extends AbstractCrdt {
3105
3105
  modified: false
3106
3106
  };
3107
3107
  }
3108
- this._items.splice(indexToDelete, 1);
3108
+ const [previousNode] = this._items.splice(indexToDelete, 1);
3109
3109
  this.invalidate();
3110
3110
  child._detach();
3111
3111
  return {
3112
- modified: makeUpdate(this, [deleteDelta(indexToDelete)]),
3112
+ modified: makeUpdate(this, [deleteDelta(indexToDelete, previousNode)]),
3113
3113
  reverse
3114
3114
  };
3115
3115
  }
@@ -3387,7 +3387,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
3387
3387
  }
3388
3388
  const item = this._items[index];
3389
3389
  item._detach();
3390
- this._items.splice(index, 1);
3390
+ const [prev] = this._items.splice(index, 1);
3391
3391
  this.invalidate();
3392
3392
  if (this._pool) {
3393
3393
  const childRecordId = item._id;
@@ -3395,7 +3395,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
3395
3395
  const storageUpdates = /* @__PURE__ */ new Map();
3396
3396
  storageUpdates.set(
3397
3397
  nn(this._id),
3398
- makeUpdate(this, [deleteDelta(index)])
3398
+ makeUpdate(this, [deleteDelta(index, prev)])
3399
3399
  );
3400
3400
  this._pool.dispatch(
3401
3401
  [
@@ -3429,7 +3429,7 @@ var LiveList = class _LiveList extends AbstractCrdt {
3429
3429
  reverseOps.push(
3430
3430
  ...item._toOps(nn(this._id), item._getParentKeyOrThrow())
3431
3431
  );
3432
- updateDelta.push(deleteDelta(0));
3432
+ updateDelta.push(deleteDelta(0, item));
3433
3433
  }
3434
3434
  }
3435
3435
  this._items = [];
@@ -3654,10 +3654,11 @@ function setDelta(index, item) {
3654
3654
  item: item instanceof LiveRegister ? item.data : item
3655
3655
  };
3656
3656
  }
3657
- function deleteDelta(index) {
3657
+ function deleteDelta(index, deletedNode) {
3658
3658
  return {
3659
+ type: "delete",
3659
3660
  index,
3660
- type: "delete"
3661
+ deletedItem: deletedNode instanceof LiveRegister ? deletedNode.data : deletedNode
3661
3662
  };
3662
3663
  }
3663
3664
  function insertDelta(index, item) {
@@ -3669,10 +3670,10 @@ function insertDelta(index, item) {
3669
3670
  }
3670
3671
  function moveDelta(previousIndex, index, item) {
3671
3672
  return {
3672
- index,
3673
3673
  type: "move",
3674
- previousIndex,
3675
- item: item instanceof LiveRegister ? item.data : item
3674
+ index,
3675
+ item: item instanceof LiveRegister ? item.data : item,
3676
+ previousIndex
3676
3677
  };
3677
3678
  }
3678
3679
  function HACK_addIntentAndDeletedIdToOperation(ops, deletedId) {
@@ -7730,22 +7731,6 @@ async function stringifyCommentBody(body, options) {
7730
7731
  return blocks.join(separator);
7731
7732
  }
7732
7733
 
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
-
7749
7734
  // src/crdts/utils.ts
7750
7735
  function toPlainLson(lson) {
7751
7736
  if (lson instanceof LiveObject) {
@@ -8261,14 +8246,5 @@ detectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);
8261
8246
 
8262
8247
 
8263
8248
 
8264
-
8265
-
8266
-
8267
-
8268
-
8269
-
8270
-
8271
-
8272
-
8273
- exports.ClientMsgCode = ClientMsgCode; exports.CommentsApiError = CommentsApiError; exports.CrdtType = CrdtType; exports.LiveList = LiveList; exports.LiveMap = LiveMap; exports.LiveObject = LiveObject; exports.NotificationsApiError = NotificationsApiError; exports.OpCode = OpCode; exports.Promise_withResolvers = Promise_withResolvers; exports.ServerMsgCode = ServerMsgCode; exports.StopRetrying = StopRetrying2; exports.WebsocketCloseCodes = WebsocketCloseCodes; exports.ackOp = ackOp; exports.asPos = asPos; exports.assert = assert; exports.assertNever = assertNever; exports.autoRetry = autoRetry; exports.b64decode = b64decode; exports.chunk = chunk; exports.cloneLson = cloneLson; exports.compactObject = compactObject; exports.console = fancy_console_exports; exports.convertToCommentData = convertToCommentData; exports.convertToCommentUserReaction = convertToCommentUserReaction; exports.convertToInboxNotificationData = convertToInboxNotificationData; exports.convertToThreadData = convertToThreadData; exports.createClient = createClient; exports.createCommentId = createCommentId; exports.createInboxNotificationId = createInboxNotificationId; exports.createStore = createStore; exports.createThreadId = createThreadId; exports.deprecate = deprecate; exports.deprecateIf = deprecateIf; exports.detectDupes = detectDupes; exports.errorIf = errorIf; exports.freeze = freeze; exports.generateCommentUrl = generateCommentUrl; exports.getMentionedIdsFromCommentBody = getMentionedIdsFromCommentBody; exports.html = html; exports.htmlSafe = htmlSafe; exports.isChildCrdt = isChildCrdt; exports.isCommentBodyLink = isCommentBodyLink; exports.isCommentBodyMention = isCommentBodyMention; exports.isCommentBodyText = isCommentBodyText; exports.isJsonArray = isJsonArray; exports.isJsonObject = isJsonObject; exports.isJsonScalar = isJsonScalar; exports.isLiveNode = isLiveNode; exports.isPlainObject = isPlainObject; exports.isRootCrdt = isRootCrdt; exports.kInternal = kInternal; exports.legacy_patchImmutableObject = legacy_patchImmutableObject; exports.lsonToJson = lsonToJson; exports.makeEventSource = makeEventSource; exports.makePoller = makePoller; exports.makePosition = makePosition; exports.mapValues = mapValues; exports.memoizeOnSuccess = memoizeOnSuccess; exports.nanoid = nanoid; exports.nn = nn; exports.objectToQuery = objectToQuery; exports.patchLiveObjectKey = patchLiveObjectKey; exports.raise = raise; exports.resolveUsersInCommentBody = resolveUsersInCommentBody; exports.shallow = shallow; exports.stringify = stringify; exports.stringifyCommentBody = stringifyCommentBody; exports.throwUsageError = throwUsageError; exports.toAbsoluteUrl = toAbsoluteUrl; exports.toPlainLson = toPlainLson; exports.tryParseJson = tryParseJson; exports.url = url; exports.urljoin = urljoin; exports.wait = wait; exports.withTimeout = withTimeout;
8249
+ exports.ClientMsgCode = ClientMsgCode; exports.CommentsApiError = CommentsApiError; exports.CrdtType = CrdtType; exports.LiveList = LiveList; exports.LiveMap = LiveMap; exports.LiveObject = LiveObject; exports.NotificationsApiError = NotificationsApiError; exports.OpCode = OpCode; exports.ServerMsgCode = ServerMsgCode; exports.StopRetrying = StopRetrying2; exports.WebsocketCloseCodes = WebsocketCloseCodes; exports.ackOp = ackOp; exports.asPos = asPos; exports.assert = assert; exports.assertNever = assertNever; exports.autoRetry = autoRetry; exports.b64decode = b64decode; exports.chunk = chunk; exports.cloneLson = cloneLson; exports.compactObject = compactObject; exports.console = fancy_console_exports; exports.convertToCommentData = convertToCommentData; exports.convertToCommentUserReaction = convertToCommentUserReaction; exports.convertToInboxNotificationData = convertToInboxNotificationData; exports.convertToThreadData = convertToThreadData; exports.createClient = createClient; exports.createCommentId = createCommentId; exports.createInboxNotificationId = createInboxNotificationId; exports.createStore = createStore; exports.createThreadId = createThreadId; exports.deprecate = deprecate; exports.deprecateIf = deprecateIf; exports.detectDupes = detectDupes; exports.errorIf = errorIf; exports.freeze = freeze; exports.getMentionedIdsFromCommentBody = getMentionedIdsFromCommentBody; exports.isChildCrdt = isChildCrdt; exports.isJsonArray = isJsonArray; exports.isJsonObject = isJsonObject; exports.isJsonScalar = isJsonScalar; exports.isLiveNode = isLiveNode; exports.isPlainObject = isPlainObject; exports.isRootCrdt = isRootCrdt; exports.kInternal = kInternal; exports.legacy_patchImmutableObject = legacy_patchImmutableObject; exports.lsonToJson = lsonToJson; exports.makeEventSource = makeEventSource; exports.makePoller = makePoller; exports.makePosition = makePosition; exports.mapValues = mapValues; exports.memoizeOnSuccess = memoizeOnSuccess; exports.nanoid = nanoid; exports.nn = nn; exports.objectToQuery = objectToQuery; exports.patchLiveObjectKey = patchLiveObjectKey; exports.raise = raise; exports.shallow = shallow; exports.stringify = stringify; exports.stringifyCommentBody = stringifyCommentBody; exports.throwUsageError = throwUsageError; exports.toPlainLson = toPlainLson; exports.tryParseJson = tryParseJson; exports.url = url; exports.urljoin = urljoin; exports.wait = wait; exports.withTimeout = withTimeout;
8274
8250
  //# sourceMappingURL=index.js.map