@liveblocks/react-ui 2.5.2 → 2.7.0-beta1

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.
Files changed (104) hide show
  1. package/dist/components/Comment.js +61 -3
  2. package/dist/components/Comment.js.map +1 -1
  3. package/dist/components/Comment.mjs +62 -5
  4. package/dist/components/Comment.mjs.map +1 -1
  5. package/dist/components/Composer.js +217 -101
  6. package/dist/components/Composer.js.map +1 -1
  7. package/dist/components/Composer.mjs +220 -104
  8. package/dist/components/Composer.mjs.map +1 -1
  9. package/dist/components/InboxNotification.js +17 -4
  10. package/dist/components/InboxNotification.js.map +1 -1
  11. package/dist/components/InboxNotification.mjs +17 -4
  12. package/dist/components/InboxNotification.mjs.map +1 -1
  13. package/dist/components/Thread.js +2 -0
  14. package/dist/components/Thread.js.map +1 -1
  15. package/dist/components/Thread.mjs +2 -0
  16. package/dist/components/Thread.mjs.map +1 -1
  17. package/dist/components/internal/Attachment.js +226 -0
  18. package/dist/components/internal/Attachment.js.map +1 -0
  19. package/dist/components/internal/Attachment.mjs +224 -0
  20. package/dist/components/internal/Attachment.mjs.map +1 -0
  21. package/dist/components/internal/InboxNotificationThread.js +10 -2
  22. package/dist/components/internal/InboxNotificationThread.js.map +1 -1
  23. package/dist/components/internal/InboxNotificationThread.mjs +11 -3
  24. package/dist/components/internal/InboxNotificationThread.mjs.map +1 -1
  25. package/dist/icons/Attachment.js +15 -0
  26. package/dist/icons/Attachment.js.map +1 -0
  27. package/dist/icons/Attachment.mjs +13 -0
  28. package/dist/icons/Attachment.mjs.map +1 -0
  29. package/dist/icons/Spinner.js +3 -9
  30. package/dist/icons/Spinner.js.map +1 -1
  31. package/dist/icons/Spinner.mjs +4 -10
  32. package/dist/icons/Spinner.mjs.map +1 -1
  33. package/dist/icons/{Missing.js → Warning.js} +3 -3
  34. package/dist/icons/{Missing.js.map → Warning.js.map} +1 -1
  35. package/dist/icons/{Missing.mjs → Warning.mjs} +3 -3
  36. package/dist/icons/{Missing.mjs.map → Warning.mjs.map} +1 -1
  37. package/dist/index.d.mts +70 -4
  38. package/dist/index.d.ts +70 -4
  39. package/dist/index.js.map +1 -1
  40. package/dist/index.mjs.map +1 -1
  41. package/dist/overrides.js +5 -0
  42. package/dist/overrides.js.map +1 -1
  43. package/dist/overrides.mjs +5 -0
  44. package/dist/overrides.mjs.map +1 -1
  45. package/dist/primitives/Composer/contexts.js +17 -3
  46. package/dist/primitives/Composer/contexts.js.map +1 -1
  47. package/dist/primitives/Composer/contexts.mjs +15 -4
  48. package/dist/primitives/Composer/contexts.mjs.map +1 -1
  49. package/dist/primitives/Composer/index.js +185 -26
  50. package/dist/primitives/Composer/index.js.map +1 -1
  51. package/dist/primitives/Composer/index.mjs +188 -31
  52. package/dist/primitives/Composer/index.mjs.map +1 -1
  53. package/dist/primitives/Composer/utils.js +224 -0
  54. package/dist/primitives/Composer/utils.js.map +1 -1
  55. package/dist/primitives/Composer/utils.mjs +222 -1
  56. package/dist/primitives/Composer/utils.mjs.map +1 -1
  57. package/dist/primitives/EmojiPicker/utils.js +2 -2
  58. package/dist/primitives/EmojiPicker/utils.js.map +1 -1
  59. package/dist/primitives/EmojiPicker/utils.mjs +1 -1
  60. package/dist/primitives/EmojiPicker/utils.mjs.map +1 -1
  61. package/dist/primitives/FileSize.js +33 -0
  62. package/dist/primitives/FileSize.js.map +1 -0
  63. package/dist/primitives/FileSize.mjs +31 -0
  64. package/dist/primitives/FileSize.mjs.map +1 -0
  65. package/dist/primitives/index.d.mts +83 -3
  66. package/dist/primitives/index.d.ts +83 -3
  67. package/dist/primitives/index.js +4 -0
  68. package/dist/primitives/index.js.map +1 -1
  69. package/dist/primitives/index.mjs +2 -0
  70. package/dist/primitives/index.mjs.map +1 -1
  71. package/dist/utils/download.js +14 -0
  72. package/dist/utils/download.js.map +1 -0
  73. package/dist/utils/download.mjs +12 -0
  74. package/dist/utils/download.mjs.map +1 -0
  75. package/dist/utils/format-file-size.js +45 -0
  76. package/dist/utils/format-file-size.js.map +1 -0
  77. package/dist/utils/format-file-size.mjs +43 -0
  78. package/dist/utils/format-file-size.mjs.map +1 -0
  79. package/dist/utils/intl.js +6 -0
  80. package/dist/utils/intl.js.map +1 -1
  81. package/dist/utils/intl.mjs +6 -1
  82. package/dist/utils/intl.mjs.map +1 -1
  83. package/dist/utils/use-initial.js +2 -1
  84. package/dist/utils/use-initial.js.map +1 -1
  85. package/dist/utils/use-initial.mjs +3 -2
  86. package/dist/utils/use-initial.mjs.map +1 -1
  87. package/dist/version.js +1 -1
  88. package/dist/version.js.map +1 -1
  89. package/dist/version.mjs +1 -1
  90. package/dist/version.mjs.map +1 -1
  91. package/package.json +4 -4
  92. package/src/styles/dark/index.css +1 -0
  93. package/src/styles/index.css +296 -62
  94. package/src/styles/utils.css +44 -0
  95. package/styles/dark/attributes.css +1 -1
  96. package/styles/dark/attributes.css.map +1 -1
  97. package/styles/dark/media-query.css +1 -1
  98. package/styles/dark/media-query.css.map +1 -1
  99. package/styles.css +1 -1
  100. package/styles.css.map +1 -1
  101. package/dist/utils/chunk.js +0 -12
  102. package/dist/utils/chunk.js.map +0 -1
  103. package/dist/utils/chunk.mjs +0 -10
  104. package/dist/utils/chunk.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileSize.mjs","sources":["../../src/primitives/FileSize.tsx"],"sourcesContent":["\"use client\";\n\nimport { Slot } from \"@radix-ui/react-slot\";\nimport type { ReactNode } from \"react\";\nimport React, { forwardRef, useMemo } from \"react\";\n\nimport type { ComponentPropsWithSlot } from \"../types\";\nimport { formatFileSize } from \"../utils/format-file-size\";\n\nconst FILE_SIZE_NAME = \"FileSize\";\n\nexport interface FileSizeProps\n extends Omit<ComponentPropsWithSlot<\"span\">, \"children\"> {\n /**\n * The file size to display.\n */\n size: number;\n\n /**\n * A function to format the displayed file size.\n */\n children?: (size: number, locale?: string) => ReactNode;\n\n /**\n * The locale used when formatting the file size.\n */\n locale?: string;\n}\n\n/**\n * Displays a formatted file size.\n *\n * @example\n * <FileSize size={100000} />\n */\nexport const FileSize = forwardRef<HTMLSpanElement, FileSizeProps>(\n (\n {\n size,\n locale,\n children: renderChildren = formatFileSize,\n asChild,\n ...props\n },\n forwardedRef\n ) => {\n const Component = asChild ? Slot : \"span\";\n const children = useMemo(\n () =>\n typeof renderChildren === \"function\"\n ? renderChildren(size, locale)\n : renderChildren,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [renderChildren, size]\n );\n\n return (\n <Component {...props} ref={forwardedRef}>\n {children}\n </Component>\n );\n }\n);\n\nif (process.env.NODE_ENV !== \"production\") {\n FileSize.displayName = FILE_SIZE_NAME;\n}\n"],"names":[],"mappings":";;;;;AASA;AA0BO;AAAiB;AAEpB;AACE;AACA;AAC2B;AAC3B;AACG;AAIL;AACA;AAAiB;AAIT;AAEe;AAGvB;AACG;AAAc;AAAY;AAE3B;AAGN;AAEA;AACE;AACF;;"}
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { ElementType, ComponentPropsWithoutRef, ReactNode, ComponentType, FormEvent, PropsWithChildren } from 'react';
3
- import { CommentBody as CommentBody$1 } from '@liveblocks/core';
3
+ import { CommentBody as CommentBody$1, CommentAttachment, CommentMixedAttachment } from '@liveblocks/core';
4
4
 
5
5
  declare type Direction = "ltr" | "rtl";
6
6
  declare type SlotProp = {
@@ -173,13 +173,29 @@ interface ComposerFormProps extends ComponentPropsWithSlot<"form"> {
173
173
  * The event handler called when the form is submitted.
174
174
  */
175
175
  onComposerSubmit?: (comment: ComposerSubmitComment, event: FormEvent<HTMLFormElement>) => Promise<void> | void;
176
+ /**
177
+ * Whether the composer is disabled.
178
+ */
179
+ disabled?: boolean;
180
+ /**
181
+ * The composer's initial attachments.
182
+ */
183
+ defaultAttachments?: CommentAttachment[];
176
184
  }
177
185
  declare type ComposerSubmitProps = ComponentPropsWithSlot<"button">;
186
+ declare type ComposerAttachFilesProps = ComponentPropsWithSlot<"button">;
187
+ interface ComposerAttachmentsDropAreaProps extends ComponentPropsWithSlot<"div"> {
188
+ disabled?: boolean;
189
+ }
178
190
  interface ComposerSubmitComment {
179
191
  /**
180
192
  * The submitted comment's body.
181
193
  */
182
194
  body: CommentBody$1;
195
+ /**
196
+ * The submitted comment's uploaded attachments.
197
+ */
198
+ attachments: CommentAttachment[];
183
199
  }
184
200
 
185
201
  /**
@@ -246,9 +262,27 @@ declare const ComposerForm: React__default.ForwardRefExoticComponent<ComposerFor
246
262
  * <Composer.Submit>Send</Composer.Submit>
247
263
  */
248
264
  declare const ComposerSubmit: React__default.ForwardRefExoticComponent<Omit<React__default.DetailedHTMLProps<React__default.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & SlotProp & React__default.RefAttributes<HTMLButtonElement>>;
265
+ /**
266
+ * A button which opens a file picker to create attachments.
267
+ *
268
+ * @example
269
+ * <Composer.AttachFiles>Attach files</Composer.AttachFiles>
270
+ */
271
+ declare const ComposerAttachFiles: React__default.ForwardRefExoticComponent<Omit<React__default.DetailedHTMLProps<React__default.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & SlotProp & React__default.RefAttributes<HTMLButtonElement>>;
272
+ /**
273
+ * A drop area which accepts files to create attachments.
274
+ *
275
+ * @example
276
+ * <Composer.AttachmentsDropArea>
277
+ * Drop files here
278
+ * </Composer.AttachmentsDropArea>
279
+ */
280
+ declare const ComposerAttachmentsDropArea: React__default.ForwardRefExoticComponent<ComposerAttachmentsDropAreaProps & React__default.RefAttributes<HTMLDivElement>>;
249
281
 
250
282
  declare namespace index$1 {
251
283
  export {
284
+ ComposerAttachFiles as AttachFiles,
285
+ ComposerAttachmentsDropArea as AttachmentsDropArea,
252
286
  ComposerEditor as Editor,
253
287
  ComposerForm as Form,
254
288
  ComposerLink as Link,
@@ -261,6 +295,14 @@ declare namespace index$1 {
261
295
  }
262
296
 
263
297
  declare type ComposerContext = {
298
+ /**
299
+ * Whether the composer is currently disabled.
300
+ */
301
+ isDisabled: boolean;
302
+ /**
303
+ * Whether the composer can currently be submitted.
304
+ */
305
+ canSubmit: boolean;
264
306
  /**
265
307
  * Whether the editor is currently focused.
266
308
  */
@@ -274,7 +316,7 @@ declare type ComposerContext = {
274
316
  */
275
317
  submit: () => void;
276
318
  /**
277
- * Clear the editor programmatically.
319
+ * Clear the composer programmatically.
278
320
  */
279
321
  clear: () => void;
280
322
  /**
@@ -297,10 +339,26 @@ declare type ComposerContext = {
297
339
  * Insert text at the current selection.
298
340
  */
299
341
  insertText: (text: string) => void;
342
+ /**
343
+ * Open a file picker programmatically to create attachments.
344
+ */
345
+ attachFiles: () => void;
346
+ /**
347
+ * The composer's current attachments.
348
+ */
349
+ attachments: CommentMixedAttachment[];
350
+ /**
351
+ * Remove an attachment by its ID.
352
+ */
353
+ removeAttachment: (attachmentId: string) => void;
300
354
  };
301
355
  declare const ComposerContext: React.Context<ComposerContext | null>;
302
356
  declare function useComposer(): ComposerContext;
303
357
 
358
+ declare class AttachmentTooLargeError extends Error {
359
+ name: string;
360
+ }
361
+
304
362
  declare type EmojiPickerContentLoadingProps = ComponentPropsWithoutRef<"div">;
305
363
  declare type EmojiPickerContentEmptyProps = ComponentPropsWithoutRef<"div">;
306
364
  declare type EmojiPickerContentGridProps = ComponentPropsWithoutRef<"div">;
@@ -461,6 +519,28 @@ declare namespace index {
461
519
  };
462
520
  }
463
521
 
522
+ interface FileSizeProps extends Omit<ComponentPropsWithSlot<"span">, "children"> {
523
+ /**
524
+ * The file size to display.
525
+ */
526
+ size: number;
527
+ /**
528
+ * A function to format the displayed file size.
529
+ */
530
+ children?: (size: number, locale?: string) => ReactNode;
531
+ /**
532
+ * The locale used when formatting the file size.
533
+ */
534
+ locale?: string;
535
+ }
536
+ /**
537
+ * Displays a formatted file size.
538
+ *
539
+ * @example
540
+ * <FileSize size={100000} />
541
+ */
542
+ declare const FileSize: React__default.ForwardRefExoticComponent<FileSizeProps & React__default.RefAttributes<HTMLSpanElement>>;
543
+
464
544
  interface TimestampProps extends Omit<ComponentPropsWithSlot<"time">, "children" | "title"> {
465
545
  /**
466
546
  * The date to display.
@@ -499,4 +579,4 @@ interface TimestampProps extends Omit<ComponentPropsWithSlot<"time">, "children"
499
579
  */
500
580
  declare const Timestamp: React__default.ForwardRefExoticComponent<TimestampProps & React__default.RefAttributes<HTMLTimeElement>>;
501
581
 
502
- export { index$2 as Comment, CommentBodyComponents, CommentBodyLinkProps, CommentBodyMentionProps, CommentBodyProps, CommentLinkProps, CommentMentionProps, index$1 as Composer, ComposerContext, ComposerEditorComponents, ComposerEditorLinkProps, ComposerEditorMentionProps, ComposerEditorMentionSuggestionsProps, ComposerEditorProps, ComposerFormProps, ComposerLinkProps, ComposerMentionProps, ComposerSubmitComment, ComposerSubmitProps, ComposerSuggestionsListItemProps, ComposerSuggestionsListProps, index as EmojiPicker, EmojiPickerContentCategoryHeaderProps, EmojiPickerContentComponents, EmojiPickerContentEmojiProps, EmojiPickerContentEmptyProps, EmojiPickerContentErrorProps, EmojiPickerContentGridProps, EmojiPickerContentLoadingProps, EmojiPickerContentProps, EmojiPickerContentRowProps, EmojiPickerRootProps, EmojiPickerSearchProps, Timestamp, TimestampProps, useComposer };
582
+ export { AttachmentTooLargeError, index$2 as Comment, CommentBodyComponents, CommentBodyLinkProps, CommentBodyMentionProps, CommentBodyProps, CommentLinkProps, CommentMentionProps, index$1 as Composer, ComposerAttachFilesProps, ComposerAttachmentsDropAreaProps, ComposerContext, ComposerEditorComponents, ComposerEditorLinkProps, ComposerEditorMentionProps, ComposerEditorMentionSuggestionsProps, ComposerEditorProps, ComposerFormProps, ComposerLinkProps, ComposerMentionProps, ComposerSubmitComment, ComposerSubmitProps, ComposerSuggestionsListItemProps, ComposerSuggestionsListProps, index as EmojiPicker, EmojiPickerContentCategoryHeaderProps, EmojiPickerContentComponents, EmojiPickerContentEmojiProps, EmojiPickerContentEmptyProps, EmojiPickerContentErrorProps, EmojiPickerContentGridProps, EmojiPickerContentLoadingProps, EmojiPickerContentProps, EmojiPickerContentRowProps, EmojiPickerRootProps, EmojiPickerSearchProps, FileSize, FileSizeProps, Timestamp, TimestampProps, useComposer };
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { ElementType, ComponentPropsWithoutRef, ReactNode, ComponentType, FormEvent, PropsWithChildren } from 'react';
3
- import { CommentBody as CommentBody$1 } from '@liveblocks/core';
3
+ import { CommentBody as CommentBody$1, CommentAttachment, CommentMixedAttachment } from '@liveblocks/core';
4
4
 
5
5
  declare type Direction = "ltr" | "rtl";
6
6
  declare type SlotProp = {
@@ -173,13 +173,29 @@ interface ComposerFormProps extends ComponentPropsWithSlot<"form"> {
173
173
  * The event handler called when the form is submitted.
174
174
  */
175
175
  onComposerSubmit?: (comment: ComposerSubmitComment, event: FormEvent<HTMLFormElement>) => Promise<void> | void;
176
+ /**
177
+ * Whether the composer is disabled.
178
+ */
179
+ disabled?: boolean;
180
+ /**
181
+ * The composer's initial attachments.
182
+ */
183
+ defaultAttachments?: CommentAttachment[];
176
184
  }
177
185
  declare type ComposerSubmitProps = ComponentPropsWithSlot<"button">;
186
+ declare type ComposerAttachFilesProps = ComponentPropsWithSlot<"button">;
187
+ interface ComposerAttachmentsDropAreaProps extends ComponentPropsWithSlot<"div"> {
188
+ disabled?: boolean;
189
+ }
178
190
  interface ComposerSubmitComment {
179
191
  /**
180
192
  * The submitted comment's body.
181
193
  */
182
194
  body: CommentBody$1;
195
+ /**
196
+ * The submitted comment's uploaded attachments.
197
+ */
198
+ attachments: CommentAttachment[];
183
199
  }
184
200
 
185
201
  /**
@@ -246,9 +262,27 @@ declare const ComposerForm: React__default.ForwardRefExoticComponent<ComposerFor
246
262
  * <Composer.Submit>Send</Composer.Submit>
247
263
  */
248
264
  declare const ComposerSubmit: React__default.ForwardRefExoticComponent<Omit<React__default.DetailedHTMLProps<React__default.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & SlotProp & React__default.RefAttributes<HTMLButtonElement>>;
265
+ /**
266
+ * A button which opens a file picker to create attachments.
267
+ *
268
+ * @example
269
+ * <Composer.AttachFiles>Attach files</Composer.AttachFiles>
270
+ */
271
+ declare const ComposerAttachFiles: React__default.ForwardRefExoticComponent<Omit<React__default.DetailedHTMLProps<React__default.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & SlotProp & React__default.RefAttributes<HTMLButtonElement>>;
272
+ /**
273
+ * A drop area which accepts files to create attachments.
274
+ *
275
+ * @example
276
+ * <Composer.AttachmentsDropArea>
277
+ * Drop files here
278
+ * </Composer.AttachmentsDropArea>
279
+ */
280
+ declare const ComposerAttachmentsDropArea: React__default.ForwardRefExoticComponent<ComposerAttachmentsDropAreaProps & React__default.RefAttributes<HTMLDivElement>>;
249
281
 
250
282
  declare namespace index$1 {
251
283
  export {
284
+ ComposerAttachFiles as AttachFiles,
285
+ ComposerAttachmentsDropArea as AttachmentsDropArea,
252
286
  ComposerEditor as Editor,
253
287
  ComposerForm as Form,
254
288
  ComposerLink as Link,
@@ -261,6 +295,14 @@ declare namespace index$1 {
261
295
  }
262
296
 
263
297
  declare type ComposerContext = {
298
+ /**
299
+ * Whether the composer is currently disabled.
300
+ */
301
+ isDisabled: boolean;
302
+ /**
303
+ * Whether the composer can currently be submitted.
304
+ */
305
+ canSubmit: boolean;
264
306
  /**
265
307
  * Whether the editor is currently focused.
266
308
  */
@@ -274,7 +316,7 @@ declare type ComposerContext = {
274
316
  */
275
317
  submit: () => void;
276
318
  /**
277
- * Clear the editor programmatically.
319
+ * Clear the composer programmatically.
278
320
  */
279
321
  clear: () => void;
280
322
  /**
@@ -297,10 +339,26 @@ declare type ComposerContext = {
297
339
  * Insert text at the current selection.
298
340
  */
299
341
  insertText: (text: string) => void;
342
+ /**
343
+ * Open a file picker programmatically to create attachments.
344
+ */
345
+ attachFiles: () => void;
346
+ /**
347
+ * The composer's current attachments.
348
+ */
349
+ attachments: CommentMixedAttachment[];
350
+ /**
351
+ * Remove an attachment by its ID.
352
+ */
353
+ removeAttachment: (attachmentId: string) => void;
300
354
  };
301
355
  declare const ComposerContext: React.Context<ComposerContext | null>;
302
356
  declare function useComposer(): ComposerContext;
303
357
 
358
+ declare class AttachmentTooLargeError extends Error {
359
+ name: string;
360
+ }
361
+
304
362
  declare type EmojiPickerContentLoadingProps = ComponentPropsWithoutRef<"div">;
305
363
  declare type EmojiPickerContentEmptyProps = ComponentPropsWithoutRef<"div">;
306
364
  declare type EmojiPickerContentGridProps = ComponentPropsWithoutRef<"div">;
@@ -461,6 +519,28 @@ declare namespace index {
461
519
  };
462
520
  }
463
521
 
522
+ interface FileSizeProps extends Omit<ComponentPropsWithSlot<"span">, "children"> {
523
+ /**
524
+ * The file size to display.
525
+ */
526
+ size: number;
527
+ /**
528
+ * A function to format the displayed file size.
529
+ */
530
+ children?: (size: number, locale?: string) => ReactNode;
531
+ /**
532
+ * The locale used when formatting the file size.
533
+ */
534
+ locale?: string;
535
+ }
536
+ /**
537
+ * Displays a formatted file size.
538
+ *
539
+ * @example
540
+ * <FileSize size={100000} />
541
+ */
542
+ declare const FileSize: React__default.ForwardRefExoticComponent<FileSizeProps & React__default.RefAttributes<HTMLSpanElement>>;
543
+
464
544
  interface TimestampProps extends Omit<ComponentPropsWithSlot<"time">, "children" | "title"> {
465
545
  /**
466
546
  * The date to display.
@@ -499,4 +579,4 @@ interface TimestampProps extends Omit<ComponentPropsWithSlot<"time">, "children"
499
579
  */
500
580
  declare const Timestamp: React__default.ForwardRefExoticComponent<TimestampProps & React__default.RefAttributes<HTMLTimeElement>>;
501
581
 
502
- export { index$2 as Comment, CommentBodyComponents, CommentBodyLinkProps, CommentBodyMentionProps, CommentBodyProps, CommentLinkProps, CommentMentionProps, index$1 as Composer, ComposerContext, ComposerEditorComponents, ComposerEditorLinkProps, ComposerEditorMentionProps, ComposerEditorMentionSuggestionsProps, ComposerEditorProps, ComposerFormProps, ComposerLinkProps, ComposerMentionProps, ComposerSubmitComment, ComposerSubmitProps, ComposerSuggestionsListItemProps, ComposerSuggestionsListProps, index as EmojiPicker, EmojiPickerContentCategoryHeaderProps, EmojiPickerContentComponents, EmojiPickerContentEmojiProps, EmojiPickerContentEmptyProps, EmojiPickerContentErrorProps, EmojiPickerContentGridProps, EmojiPickerContentLoadingProps, EmojiPickerContentProps, EmojiPickerContentRowProps, EmojiPickerRootProps, EmojiPickerSearchProps, Timestamp, TimestampProps, useComposer };
582
+ export { AttachmentTooLargeError, index$2 as Comment, CommentBodyComponents, CommentBodyLinkProps, CommentBodyMentionProps, CommentBodyProps, CommentLinkProps, CommentMentionProps, index$1 as Composer, ComposerAttachFilesProps, ComposerAttachmentsDropAreaProps, ComposerContext, ComposerEditorComponents, ComposerEditorLinkProps, ComposerEditorMentionProps, ComposerEditorMentionSuggestionsProps, ComposerEditorProps, ComposerFormProps, ComposerLinkProps, ComposerMentionProps, ComposerSubmitComment, ComposerSubmitProps, ComposerSuggestionsListItemProps, ComposerSuggestionsListProps, index as EmojiPicker, EmojiPickerContentCategoryHeaderProps, EmojiPickerContentComponents, EmojiPickerContentEmojiProps, EmojiPickerContentEmptyProps, EmojiPickerContentErrorProps, EmojiPickerContentGridProps, EmojiPickerContentLoadingProps, EmojiPickerContentProps, EmojiPickerContentRowProps, EmojiPickerRootProps, EmojiPickerSearchProps, FileSize, FileSizeProps, Timestamp, TimestampProps, useComposer };
@@ -3,7 +3,9 @@
3
3
  var index = require('./Comment/index.js');
4
4
  var index$1 = require('./Composer/index.js');
5
5
  var contexts = require('./Composer/contexts.js');
6
+ var utils = require('./Composer/utils.js');
6
7
  var index$2 = require('./EmojiPicker/index.js');
8
+ var FileSize = require('./FileSize.js');
7
9
  var Timestamp = require('./Timestamp.js');
8
10
 
9
11
 
@@ -11,6 +13,8 @@ var Timestamp = require('./Timestamp.js');
11
13
  exports.Comment = index;
12
14
  exports.Composer = index$1;
13
15
  exports.useComposer = contexts.useComposer;
16
+ exports.AttachmentTooLargeError = utils.AttachmentTooLargeError;
14
17
  exports.EmojiPicker = index$2;
18
+ exports.FileSize = FileSize.FileSize;
15
19
  exports.Timestamp = Timestamp.Timestamp;
16
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
@@ -3,7 +3,9 @@ export { index as Comment };
3
3
  import * as index$1 from './Composer/index.mjs';
4
4
  export { index$1 as Composer };
5
5
  export { useComposer } from './Composer/contexts.mjs';
6
+ export { AttachmentTooLargeError } from './Composer/utils.mjs';
6
7
  import * as index$2 from './EmojiPicker/index.mjs';
7
8
  export { index$2 as EmojiPicker };
9
+ export { FileSize } from './FileSize.mjs';
8
10
  export { Timestamp } from './Timestamp.mjs';
9
11
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ function download(url, name) {
4
+ const a = document.createElement("a");
5
+ a.href = url;
6
+ a.download = name;
7
+ a.style.display = "none";
8
+ document.body.appendChild(a);
9
+ a.click();
10
+ document.body.removeChild(a);
11
+ }
12
+
13
+ exports.download = download;
14
+ //# sourceMappingURL=download.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download.js","sources":["../../src/utils/download.ts"],"sourcesContent":["export function download(url: string, name: string) {\n const a = document.createElement(\"a\");\n a.href = url;\n a.download = name;\n a.style.display = \"none\";\n\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n}\n"],"names":[],"mappings":";;AAAgB,SAAA,QAAA,CAAS,KAAa,IAAc,EAAA;AAClD,EAAM,MAAA,CAAA,GAAI,QAAS,CAAA,aAAA,CAAc,GAAG,CAAA,CAAA;AACpC,EAAA,CAAA,CAAE,IAAO,GAAA,GAAA,CAAA;AACT,EAAA,CAAA,CAAE,QAAW,GAAA,IAAA,CAAA;AACb,EAAA,CAAA,CAAE,MAAM,OAAU,GAAA,MAAA,CAAA;AAElB,EAAS,QAAA,CAAA,IAAA,CAAK,YAAY,CAAC,CAAA,CAAA;AAC3B,EAAA,CAAA,CAAE,KAAM,EAAA,CAAA;AACR,EAAS,QAAA,CAAA,IAAA,CAAK,YAAY,CAAC,CAAA,CAAA;AAC7B;;;;"}
@@ -0,0 +1,12 @@
1
+ function download(url, name) {
2
+ const a = document.createElement("a");
3
+ a.href = url;
4
+ a.download = name;
5
+ a.style.display = "none";
6
+ document.body.appendChild(a);
7
+ a.click();
8
+ document.body.removeChild(a);
9
+ }
10
+
11
+ export { download };
12
+ //# sourceMappingURL=download.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download.mjs","sources":["../../src/utils/download.ts"],"sourcesContent":["export function download(url: string, name: string) {\n const a = document.createElement(\"a\");\n a.href = url;\n a.download = name;\n a.style.display = \"none\";\n\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n}\n"],"names":[],"mappings":"AAAgB,SAAA,QAAA,CAAS,KAAa,IAAc,EAAA;AAClD,EAAM,MAAA,CAAA,GAAI,QAAS,CAAA,aAAA,CAAc,GAAG,CAAA,CAAA;AACpC,EAAA,CAAA,CAAE,IAAO,GAAA,GAAA,CAAA;AACT,EAAA,CAAA,CAAE,QAAW,GAAA,IAAA,CAAA;AACb,EAAA,CAAA,CAAE,MAAM,OAAU,GAAA,MAAA,CAAA;AAElB,EAAS,QAAA,CAAA,IAAA,CAAK,YAAY,CAAC,CAAA,CAAA;AAC3B,EAAA,CAAA,CAAE,KAAM,EAAA,CAAA;AACR,EAAS,QAAA,CAAA,IAAA,CAAK,YAAY,CAAC,CAAA,CAAA;AAC7B;;;;"}
@@ -0,0 +1,45 @@
1
+ 'use strict';
2
+
3
+ var intl = require('./intl.js');
4
+
5
+ const BASE = 1e3;
6
+ const UNITS = ["B", "KB", "MB", "GB"];
7
+ function formatFileSize(bytes, locale) {
8
+ if (bytes === 0) {
9
+ return `0 ${UNITS[1]}`;
10
+ }
11
+ let unit;
12
+ if (bytes === 0) {
13
+ unit = 1;
14
+ } else {
15
+ unit = Math.max(
16
+ 1,
17
+ Math.min(
18
+ Math.floor(Math.log(Math.abs(bytes)) / Math.log(BASE)),
19
+ UNITS.length - 1
20
+ )
21
+ );
22
+ }
23
+ let value = bytes / BASE ** unit;
24
+ let maximumDecimals = 1;
25
+ if (unit === 1) {
26
+ if (value >= 10) {
27
+ maximumDecimals = 0;
28
+ }
29
+ if (value < 0.1 && value > 0) {
30
+ maximumDecimals = 2;
31
+ }
32
+ if (value < 0.01) {
33
+ value = 0.01;
34
+ }
35
+ }
36
+ const formattedUnit = UNITS[unit];
37
+ const formattedValue = intl.numberFormat(locale, {
38
+ minimumFractionDigits: 0,
39
+ maximumFractionDigits: maximumDecimals
40
+ }).format(value);
41
+ return `${formattedValue} ${formattedUnit}`;
42
+ }
43
+
44
+ exports.formatFileSize = formatFileSize;
45
+ //# sourceMappingURL=format-file-size.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-file-size.js","sources":["../../src/utils/format-file-size.ts"],"sourcesContent":["import { numberFormat } from \"./intl\";\n\nconst BASE = 1000;\nconst UNITS = [\"B\", \"KB\", \"MB\", \"GB\"] as const;\n\nexport function formatFileSize(bytes: number, locale?: string) {\n if (bytes === 0) {\n return `0 ${UNITS[1]}`;\n }\n\n let unit: number;\n\n if (bytes === 0) {\n unit = 1;\n } else {\n unit = Math.max(\n 1,\n Math.min(\n Math.floor(Math.log(Math.abs(bytes)) / Math.log(BASE)),\n UNITS.length - 1\n )\n );\n }\n\n let value = bytes / BASE ** unit;\n let maximumDecimals = 1;\n\n if (unit === 1) {\n // Hide decimals for KB values above 10\n if (value >= 10) {\n maximumDecimals = 0;\n }\n\n // Allow 2 decimals instead of 1 for KB values below 0.1\n if (value < 0.1 && value > 0) {\n maximumDecimals = 2;\n }\n\n // Display tiny KB values as 0.01 KB instead of 0 KB\n if (value < 0.01) {\n value = 0.01;\n }\n }\n\n const formattedUnit = UNITS[unit];\n const formattedValue = numberFormat(locale, {\n minimumFractionDigits: 0,\n maximumFractionDigits: maximumDecimals,\n }).format(value);\n\n return `${formattedValue} ${formattedUnit}`;\n}\n"],"names":["numberFormat"],"mappings":";;;;AAEA,MAAM,IAAO,GAAA,GAAA,CAAA;AACb,MAAM,KAAQ,GAAA,CAAC,GAAK,EAAA,IAAA,EAAM,MAAM,IAAI,CAAA,CAAA;AAEpB,SAAA,cAAA,CAAe,OAAe,MAAiB,EAAA;AAC7D,EAAA,IAAI,UAAU,CAAG,EAAA;AACf,IAAA,OAAO,KAAK,KAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,GACpB;AAEA,EAAI,IAAA,IAAA,CAAA;AAEJ,EAAA,IAAI,UAAU,CAAG,EAAA;AACf,IAAO,IAAA,GAAA,CAAA,CAAA;AAAA,GACF,MAAA;AACL,IAAA,IAAA,GAAO,IAAK,CAAA,GAAA;AAAA,MACV,CAAA;AAAA,MACA,IAAK,CAAA,GAAA;AAAA,QACH,IAAK,CAAA,KAAA,CAAM,IAAK,CAAA,GAAA,CAAI,IAAK,CAAA,GAAA,CAAI,KAAK,CAAC,CAAI,GAAA,IAAA,CAAK,GAAI,CAAA,IAAI,CAAC,CAAA;AAAA,QACrD,MAAM,MAAS,GAAA,CAAA;AAAA,OACjB;AAAA,KACF,CAAA;AAAA,GACF;AAEA,EAAI,IAAA,KAAA,GAAQ,QAAQ,IAAQ,IAAA,IAAA,CAAA;AAC5B,EAAA,IAAI,eAAkB,GAAA,CAAA,CAAA;AAEtB,EAAA,IAAI,SAAS,CAAG,EAAA;AAEd,IAAA,IAAI,SAAS,EAAI,EAAA;AACf,MAAkB,eAAA,GAAA,CAAA,CAAA;AAAA,KACpB;AAGA,IAAI,IAAA,KAAA,GAAQ,GAAO,IAAA,KAAA,GAAQ,CAAG,EAAA;AAC5B,MAAkB,eAAA,GAAA,CAAA,CAAA;AAAA,KACpB;AAGA,IAAA,IAAI,QAAQ,IAAM,EAAA;AAChB,MAAQ,KAAA,GAAA,IAAA,CAAA;AAAA,KACV;AAAA,GACF;AAEA,EAAA,MAAM,gBAAgB,KAAM,CAAA,IAAA,CAAA,CAAA;AAC5B,EAAM,MAAA,cAAA,GAAiBA,kBAAa,MAAQ,EAAA;AAAA,IAC1C,qBAAuB,EAAA,CAAA;AAAA,IACvB,qBAAuB,EAAA,eAAA;AAAA,GACxB,CAAE,CAAA,MAAA,CAAO,KAAK,CAAA,CAAA;AAEf,EAAA,OAAO,GAAG,cAAkB,CAAA,CAAA,EAAA,aAAA,CAAA,CAAA,CAAA;AAC9B;;;;"}
@@ -0,0 +1,43 @@
1
+ import { numberFormat } from './intl.mjs';
2
+
3
+ const BASE = 1e3;
4
+ const UNITS = ["B", "KB", "MB", "GB"];
5
+ function formatFileSize(bytes, locale) {
6
+ if (bytes === 0) {
7
+ return `0 ${UNITS[1]}`;
8
+ }
9
+ let unit;
10
+ if (bytes === 0) {
11
+ unit = 1;
12
+ } else {
13
+ unit = Math.max(
14
+ 1,
15
+ Math.min(
16
+ Math.floor(Math.log(Math.abs(bytes)) / Math.log(BASE)),
17
+ UNITS.length - 1
18
+ )
19
+ );
20
+ }
21
+ let value = bytes / BASE ** unit;
22
+ let maximumDecimals = 1;
23
+ if (unit === 1) {
24
+ if (value >= 10) {
25
+ maximumDecimals = 0;
26
+ }
27
+ if (value < 0.1 && value > 0) {
28
+ maximumDecimals = 2;
29
+ }
30
+ if (value < 0.01) {
31
+ value = 0.01;
32
+ }
33
+ }
34
+ const formattedUnit = UNITS[unit];
35
+ const formattedValue = numberFormat(locale, {
36
+ minimumFractionDigits: 0,
37
+ maximumFractionDigits: maximumDecimals
38
+ }).format(value);
39
+ return `${formattedValue} ${formattedUnit}`;
40
+ }
41
+
42
+ export { formatFileSize };
43
+ //# sourceMappingURL=format-file-size.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format-file-size.mjs","sources":["../../src/utils/format-file-size.ts"],"sourcesContent":["import { numberFormat } from \"./intl\";\n\nconst BASE = 1000;\nconst UNITS = [\"B\", \"KB\", \"MB\", \"GB\"] as const;\n\nexport function formatFileSize(bytes: number, locale?: string) {\n if (bytes === 0) {\n return `0 ${UNITS[1]}`;\n }\n\n let unit: number;\n\n if (bytes === 0) {\n unit = 1;\n } else {\n unit = Math.max(\n 1,\n Math.min(\n Math.floor(Math.log(Math.abs(bytes)) / Math.log(BASE)),\n UNITS.length - 1\n )\n );\n }\n\n let value = bytes / BASE ** unit;\n let maximumDecimals = 1;\n\n if (unit === 1) {\n // Hide decimals for KB values above 10\n if (value >= 10) {\n maximumDecimals = 0;\n }\n\n // Allow 2 decimals instead of 1 for KB values below 0.1\n if (value < 0.1 && value > 0) {\n maximumDecimals = 2;\n }\n\n // Display tiny KB values as 0.01 KB instead of 0 KB\n if (value < 0.01) {\n value = 0.01;\n }\n }\n\n const formattedUnit = UNITS[unit];\n const formattedValue = numberFormat(locale, {\n minimumFractionDigits: 0,\n maximumFractionDigits: maximumDecimals,\n }).format(value);\n\n return `${formattedValue} ${formattedUnit}`;\n}\n"],"names":[],"mappings":";;AAEA,MAAM,IAAO,GAAA,GAAA,CAAA;AACb,MAAM,KAAQ,GAAA,CAAC,GAAK,EAAA,IAAA,EAAM,MAAM,IAAI,CAAA,CAAA;AAEpB,SAAA,cAAA,CAAe,OAAe,MAAiB,EAAA;AAC7D,EAAA,IAAI,UAAU,CAAG,EAAA;AACf,IAAA,OAAO,KAAK,KAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,GACpB;AAEA,EAAI,IAAA,IAAA,CAAA;AAEJ,EAAA,IAAI,UAAU,CAAG,EAAA;AACf,IAAO,IAAA,GAAA,CAAA,CAAA;AAAA,GACF,MAAA;AACL,IAAA,IAAA,GAAO,IAAK,CAAA,GAAA;AAAA,MACV,CAAA;AAAA,MACA,IAAK,CAAA,GAAA;AAAA,QACH,IAAK,CAAA,KAAA,CAAM,IAAK,CAAA,GAAA,CAAI,IAAK,CAAA,GAAA,CAAI,KAAK,CAAC,CAAI,GAAA,IAAA,CAAK,GAAI,CAAA,IAAI,CAAC,CAAA;AAAA,QACrD,MAAM,MAAS,GAAA,CAAA;AAAA,OACjB;AAAA,KACF,CAAA;AAAA,GACF;AAEA,EAAI,IAAA,KAAA,GAAQ,QAAQ,IAAQ,IAAA,IAAA,CAAA;AAC5B,EAAA,IAAI,eAAkB,GAAA,CAAA,CAAA;AAEtB,EAAA,IAAI,SAAS,CAAG,EAAA;AAEd,IAAA,IAAI,SAAS,EAAI,EAAA;AACf,MAAkB,eAAA,GAAA,CAAA,CAAA;AAAA,KACpB;AAGA,IAAI,IAAA,KAAA,GAAQ,GAAO,IAAA,KAAA,GAAQ,CAAG,EAAA;AAC5B,MAAkB,eAAA,GAAA,CAAA,CAAA;AAAA,KACpB;AAGA,IAAA,IAAI,QAAQ,IAAM,EAAA;AAChB,MAAQ,KAAA,GAAA,IAAA,CAAA;AAAA,KACV;AAAA,GACF;AAEA,EAAA,MAAM,gBAAgB,KAAM,CAAA,IAAA,CAAA,CAAA;AAC5B,EAAM,MAAA,cAAA,GAAiB,aAAa,MAAQ,EAAA;AAAA,IAC1C,qBAAuB,EAAA,CAAA;AAAA,IACvB,qBAAuB,EAAA,eAAA;AAAA,GACxB,CAAE,CAAA,MAAA,CAAO,KAAK,CAAA,CAAA;AAEf,EAAA,OAAO,GAAG,cAAkB,CAAA,CAAA,EAAA,aAAA,CAAA,CAAA,CAAA;AAC9B;;;;"}
@@ -17,8 +17,14 @@ const listFormat = memoize.memoize(
17
17
  return new Intl.ListFormat(...args);
18
18
  }
19
19
  );
20
+ const numberFormat = memoize.memoize(
21
+ (...args) => {
22
+ return new Intl.NumberFormat(...args);
23
+ }
24
+ );
20
25
 
21
26
  exports.dateTimeFormat = dateTimeFormat;
22
27
  exports.listFormat = listFormat;
28
+ exports.numberFormat = numberFormat;
23
29
  exports.relativeTimeFormat = relativeTimeFormat;
24
30
  //# sourceMappingURL=intl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"intl.js","sources":["../../src/utils/intl.ts"],"sourcesContent":["import { memoize } from \"./memoize\";\n\n// Avoid creating Intl formatters on every invocation.\n\nexport const dateTimeFormat = memoize(\n (...args: ConstructorParameters<(typeof Intl)[\"DateTimeFormat\"]>) => {\n return new Intl.DateTimeFormat(...args);\n }\n);\n\nexport const relativeTimeFormat = memoize(\n (...args: ConstructorParameters<(typeof Intl)[\"RelativeTimeFormat\"]>) => {\n return new Intl.RelativeTimeFormat(...args);\n }\n);\n\nexport const listFormat = memoize(\n (...args: ConstructorParameters<(typeof Intl)[\"ListFormat\"]>) => {\n return new Intl.ListFormat(...args);\n }\n);\n"],"names":["memoize"],"mappings":";;;;AAIO,MAAM,cAAiB,GAAAA,eAAA;AAAA,EAC5B,IAAI,IAAiE,KAAA;AACnE,IAAA,OAAO,IAAI,IAAA,CAAK,cAAe,CAAA,GAAG,IAAI,CAAA,CAAA;AAAA,GACxC;AACF,EAAA;AAEO,MAAM,kBAAqB,GAAAA,eAAA;AAAA,EAChC,IAAI,IAAqE,KAAA;AACvE,IAAA,OAAO,IAAI,IAAA,CAAK,kBAAmB,CAAA,GAAG,IAAI,CAAA,CAAA;AAAA,GAC5C;AACF,EAAA;AAEO,MAAM,UAAa,GAAAA,eAAA;AAAA,EACxB,IAAI,IAA6D,KAAA;AAC/D,IAAA,OAAO,IAAI,IAAA,CAAK,UAAW,CAAA,GAAG,IAAI,CAAA,CAAA;AAAA,GACpC;AACF;;;;;;"}
1
+ {"version":3,"file":"intl.js","sources":["../../src/utils/intl.ts"],"sourcesContent":["import { memoize } from \"./memoize\";\n\n// Avoid creating Intl formatters on every invocation.\n\nexport const dateTimeFormat = memoize(\n (...args: ConstructorParameters<(typeof Intl)[\"DateTimeFormat\"]>) => {\n return new Intl.DateTimeFormat(...args);\n }\n);\n\nexport const relativeTimeFormat = memoize(\n (...args: ConstructorParameters<(typeof Intl)[\"RelativeTimeFormat\"]>) => {\n return new Intl.RelativeTimeFormat(...args);\n }\n);\n\nexport const listFormat = memoize(\n (...args: ConstructorParameters<(typeof Intl)[\"ListFormat\"]>) => {\n return new Intl.ListFormat(...args);\n }\n);\n\nexport const numberFormat = memoize(\n (...args: ConstructorParameters<(typeof Intl)[\"NumberFormat\"]>) => {\n return new Intl.NumberFormat(...args);\n }\n);\n"],"names":["memoize"],"mappings":";;;;AAIO,MAAM,cAAiB,GAAAA,eAAA;AAAA,EAC5B,IAAI,IAAiE,KAAA;AACnE,IAAA,OAAO,IAAI,IAAA,CAAK,cAAe,CAAA,GAAG,IAAI,CAAA,CAAA;AAAA,GACxC;AACF,EAAA;AAEO,MAAM,kBAAqB,GAAAA,eAAA;AAAA,EAChC,IAAI,IAAqE,KAAA;AACvE,IAAA,OAAO,IAAI,IAAA,CAAK,kBAAmB,CAAA,GAAG,IAAI,CAAA,CAAA;AAAA,GAC5C;AACF,EAAA;AAEO,MAAM,UAAa,GAAAA,eAAA;AAAA,EACxB,IAAI,IAA6D,KAAA;AAC/D,IAAA,OAAO,IAAI,IAAA,CAAK,UAAW,CAAA,GAAG,IAAI,CAAA,CAAA;AAAA,GACpC;AACF,EAAA;AAEO,MAAM,YAAe,GAAAA,eAAA;AAAA,EAC1B,IAAI,IAA+D,KAAA;AACjE,IAAA,OAAO,IAAI,IAAA,CAAK,YAAa,CAAA,GAAG,IAAI,CAAA,CAAA;AAAA,GACtC;AACF;;;;;;;"}
@@ -15,6 +15,11 @@ const listFormat = memoize(
15
15
  return new Intl.ListFormat(...args);
16
16
  }
17
17
  );
18
+ const numberFormat = memoize(
19
+ (...args) => {
20
+ return new Intl.NumberFormat(...args);
21
+ }
22
+ );
18
23
 
19
- export { dateTimeFormat, listFormat, relativeTimeFormat };
24
+ export { dateTimeFormat, listFormat, numberFormat, relativeTimeFormat };
20
25
  //# sourceMappingURL=intl.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"intl.mjs","sources":["../../src/utils/intl.ts"],"sourcesContent":["import { memoize } from \"./memoize\";\n\n// Avoid creating Intl formatters on every invocation.\n\nexport const dateTimeFormat = memoize(\n (...args: ConstructorParameters<(typeof Intl)[\"DateTimeFormat\"]>) => {\n return new Intl.DateTimeFormat(...args);\n }\n);\n\nexport const relativeTimeFormat = memoize(\n (...args: ConstructorParameters<(typeof Intl)[\"RelativeTimeFormat\"]>) => {\n return new Intl.RelativeTimeFormat(...args);\n }\n);\n\nexport const listFormat = memoize(\n (...args: ConstructorParameters<(typeof Intl)[\"ListFormat\"]>) => {\n return new Intl.ListFormat(...args);\n }\n);\n"],"names":[],"mappings":";;AAIO,MAAM,cAAiB,GAAA,OAAA;AAAA,EAC5B,IAAI,IAAiE,KAAA;AACnE,IAAA,OAAO,IAAI,IAAA,CAAK,cAAe,CAAA,GAAG,IAAI,CAAA,CAAA;AAAA,GACxC;AACF,EAAA;AAEO,MAAM,kBAAqB,GAAA,OAAA;AAAA,EAChC,IAAI,IAAqE,KAAA;AACvE,IAAA,OAAO,IAAI,IAAA,CAAK,kBAAmB,CAAA,GAAG,IAAI,CAAA,CAAA;AAAA,GAC5C;AACF,EAAA;AAEO,MAAM,UAAa,GAAA,OAAA;AAAA,EACxB,IAAI,IAA6D,KAAA;AAC/D,IAAA,OAAO,IAAI,IAAA,CAAK,UAAW,CAAA,GAAG,IAAI,CAAA,CAAA;AAAA,GACpC;AACF;;;;"}
1
+ {"version":3,"file":"intl.mjs","sources":["../../src/utils/intl.ts"],"sourcesContent":["import { memoize } from \"./memoize\";\n\n// Avoid creating Intl formatters on every invocation.\n\nexport const dateTimeFormat = memoize(\n (...args: ConstructorParameters<(typeof Intl)[\"DateTimeFormat\"]>) => {\n return new Intl.DateTimeFormat(...args);\n }\n);\n\nexport const relativeTimeFormat = memoize(\n (...args: ConstructorParameters<(typeof Intl)[\"RelativeTimeFormat\"]>) => {\n return new Intl.RelativeTimeFormat(...args);\n }\n);\n\nexport const listFormat = memoize(\n (...args: ConstructorParameters<(typeof Intl)[\"ListFormat\"]>) => {\n return new Intl.ListFormat(...args);\n }\n);\n\nexport const numberFormat = memoize(\n (...args: ConstructorParameters<(typeof Intl)[\"NumberFormat\"]>) => {\n return new Intl.NumberFormat(...args);\n }\n);\n"],"names":[],"mappings":";;AAIO,MAAM,cAAiB,GAAA,OAAA;AAAA,EAC5B,IAAI,IAAiE,KAAA;AACnE,IAAA,OAAO,IAAI,IAAA,CAAK,cAAe,CAAA,GAAG,IAAI,CAAA,CAAA;AAAA,GACxC;AACF,EAAA;AAEO,MAAM,kBAAqB,GAAA,OAAA;AAAA,EAChC,IAAI,IAAqE,KAAA;AACvE,IAAA,OAAO,IAAI,IAAA,CAAK,kBAAmB,CAAA,GAAG,IAAI,CAAA,CAAA;AAAA,GAC5C;AACF,EAAA;AAEO,MAAM,UAAa,GAAA,OAAA;AAAA,EACxB,IAAI,IAA6D,KAAA;AAC/D,IAAA,OAAO,IAAI,IAAA,CAAK,UAAW,CAAA,GAAG,IAAI,CAAA,CAAA;AAAA,GACpC;AACF,EAAA;AAEO,MAAM,YAAe,GAAA,OAAA;AAAA,EAC1B,IAAI,IAA+D,KAAA;AACjE,IAAA,OAAO,IAAI,IAAA,CAAK,YAAa,CAAA,GAAG,IAAI,CAAA,CAAA;AAAA,GACtC;AACF;;;;"}
@@ -3,7 +3,8 @@
3
3
  var React = require('react');
4
4
 
5
5
  function useInitial(value) {
6
- return React.useRef(value instanceof Function ? value() : value).current;
6
+ const [initialValue] = React.useState(value);
7
+ return initialValue;
7
8
  }
8
9
 
9
10
  exports.useInitial = useInitial;
@@ -1 +1 @@
1
- {"version":3,"file":"use-initial.js","sources":["../../src/utils/use-initial.ts"],"sourcesContent":["import { useRef } from \"react\";\n\n/**\n * \"Freezes\" a given value, so that it will return the same value/instance on\n * each subsequent render. This can be used to freeze \"initial\" values for\n * custom hooks, much like how `useState(initialState)` or\n * `useRef(initialValue)` works.\n */\nexport function useInitial<T>(value: T | (() => T)): T {\n return useRef(value instanceof Function ? value() : value).current;\n}\n"],"names":["useRef"],"mappings":";;;;AAQO,SAAS,WAAc,KAAyB,EAAA;AACrD,EAAA,OAAOA,aAAO,KAAiB,YAAA,QAAA,GAAW,KAAM,EAAA,GAAI,KAAK,CAAE,CAAA,OAAA,CAAA;AAC7D;;;;"}
1
+ {"version":3,"file":"use-initial.js","sources":["../../src/utils/use-initial.ts"],"sourcesContent":["import { useState } from \"react\";\n\n/**\n * \"Freezes\" a given value, so that it will return the same value/instance on\n * each subsequent render. This can be used to freeze \"initial\" values for\n * custom hooks, much like how `useState(initialState)` or\n * `useRef(initialValue)` works.\n */\nexport function useInitial<T>(value: T | (() => T)): T {\n const [initialValue] = useState(value);\n\n return initialValue;\n}\n"],"names":["useState"],"mappings":";;;;AAQO,SAAS,WAAc,KAAyB,EAAA;AACrD,EAAA,MAAM,CAAC,YAAY,CAAI,GAAAA,cAAA,CAAS,KAAK,CAAA,CAAA;AAErC,EAAO,OAAA,YAAA,CAAA;AACT;;;;"}
@@ -1,7 +1,8 @@
1
- import { useRef } from 'react';
1
+ import { useState } from 'react';
2
2
 
3
3
  function useInitial(value) {
4
- return useRef(value instanceof Function ? value() : value).current;
4
+ const [initialValue] = useState(value);
5
+ return initialValue;
5
6
  }
6
7
 
7
8
  export { useInitial };
@@ -1 +1 @@
1
- {"version":3,"file":"use-initial.mjs","sources":["../../src/utils/use-initial.ts"],"sourcesContent":["import { useRef } from \"react\";\n\n/**\n * \"Freezes\" a given value, so that it will return the same value/instance on\n * each subsequent render. This can be used to freeze \"initial\" values for\n * custom hooks, much like how `useState(initialState)` or\n * `useRef(initialValue)` works.\n */\nexport function useInitial<T>(value: T | (() => T)): T {\n return useRef(value instanceof Function ? value() : value).current;\n}\n"],"names":[],"mappings":";;AAQO,SAAS,WAAc,KAAyB,EAAA;AACrD,EAAA,OAAO,OAAO,KAAiB,YAAA,QAAA,GAAW,KAAM,EAAA,GAAI,KAAK,CAAE,CAAA,OAAA,CAAA;AAC7D;;;;"}
1
+ {"version":3,"file":"use-initial.mjs","sources":["../../src/utils/use-initial.ts"],"sourcesContent":["import { useState } from \"react\";\n\n/**\n * \"Freezes\" a given value, so that it will return the same value/instance on\n * each subsequent render. This can be used to freeze \"initial\" values for\n * custom hooks, much like how `useState(initialState)` or\n * `useRef(initialValue)` works.\n */\nexport function useInitial<T>(value: T | (() => T)): T {\n const [initialValue] = useState(value);\n\n return initialValue;\n}\n"],"names":[],"mappings":";;AAQO,SAAS,WAAc,KAAyB,EAAA;AACrD,EAAA,MAAM,CAAC,YAAY,CAAI,GAAA,QAAA,CAAS,KAAK,CAAA,CAAA;AAErC,EAAO,OAAA,YAAA,CAAA;AACT;;;;"}
package/dist/version.js CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const PKG_NAME = "@liveblocks/react-ui";
4
- const PKG_VERSION = "2.5.2";
4
+ const PKG_VERSION = "2.7.0-beta1";
5
5
  const PKG_FORMAT = "cjs";
6
6
 
7
7
  exports.PKG_FORMAT = PKG_FORMAT;
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sources":["../src/version.ts"],"sourcesContent":["declare const __VERSION__: string;\ndeclare const ROLLUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react-ui\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof ROLLUP_FORMAT === \"string\" && ROLLUP_FORMAT;\n"],"names":[],"mappings":";;AAGO,MAAM,QAAW,GAAA,uBAAA;AACX,MAAA,WAAA,GAAiD,QAAA;AACjD,MAAA,UAAA,GAAkD;;;;;;"}
1
+ {"version":3,"file":"version.js","sources":["../src/version.ts"],"sourcesContent":["declare const __VERSION__: string;\ndeclare const ROLLUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react-ui\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof ROLLUP_FORMAT === \"string\" && ROLLUP_FORMAT;\n"],"names":[],"mappings":";;AAGO,MAAM,QAAW,GAAA,uBAAA;AACX,MAAA,WAAA,GAAiD,cAAA;AACjD,MAAA,UAAA,GAAkD;;;;;;"}
package/dist/version.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  const PKG_NAME = "@liveblocks/react-ui";
2
- const PKG_VERSION = "2.5.2";
2
+ const PKG_VERSION = "2.7.0-beta1";
3
3
  const PKG_FORMAT = "esm";
4
4
 
5
5
  export { PKG_FORMAT, PKG_NAME, PKG_VERSION };
@@ -1 +1 @@
1
- {"version":3,"file":"version.mjs","sources":["../src/version.ts"],"sourcesContent":["declare const __VERSION__: string;\ndeclare const ROLLUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react-ui\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof ROLLUP_FORMAT === \"string\" && ROLLUP_FORMAT;\n"],"names":[],"mappings":"AAGO,MAAM,QAAW,GAAA,uBAAA;AACX,MAAA,WAAA,GAAiD,QAAA;AACjD,MAAA,UAAA,GAAkD;;;;"}
1
+ {"version":3,"file":"version.mjs","sources":["../src/version.ts"],"sourcesContent":["declare const __VERSION__: string;\ndeclare const ROLLUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react-ui\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof ROLLUP_FORMAT === \"string\" && ROLLUP_FORMAT;\n"],"names":[],"mappings":"AAGO,MAAM,QAAW,GAAA,uBAAA;AACX,MAAA,WAAA,GAAiD,cAAA;AACjD,MAAA,UAAA,GAAkD;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liveblocks/react-ui",
3
- "version": "2.5.2",
3
+ "version": "2.7.0-beta1",
4
4
  "description": "A set of React pre-built components for the Liveblocks products. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "commonjs",
@@ -63,9 +63,9 @@
63
63
  },
64
64
  "dependencies": {
65
65
  "@floating-ui/react-dom": "^2.0.8",
66
- "@liveblocks/client": "2.5.2",
67
- "@liveblocks/core": "2.5.2",
68
- "@liveblocks/react": "2.5.2",
66
+ "@liveblocks/client": "2.7.0-beta1",
67
+ "@liveblocks/core": "2.7.0-beta1",
68
+ "@liveblocks/react": "2.7.0-beta1",
69
69
  "@radix-ui/react-dropdown-menu": "^2.0.6",
70
70
  "@radix-ui/react-popover": "^1.0.7",
71
71
  "@radix-ui/react-slot": "^1.0.2",
@@ -16,6 +16,7 @@
16
16
  * Shadows
17
17
  */
18
18
  --lb-inset-shadow: inset 0 0 0 1px rgb(255 255 255 / 6%);
19
+ --lb-highlight-shadow: inset 0 0 0 1px rgb(255 255 255 / 12%);
19
20
  --lb-elevation-shadow: $lb-elevation-shadow;
20
21
  --lb-tooltip-shadow: $lb-tooltip-shadow;
21
22