@liveblocks/react-ui 2.15.0-debug1 → 2.15.1
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/_private/index.js +1 -0
- package/dist/_private/index.js.map +1 -1
- package/dist/_private/index.mjs +1 -0
- package/dist/_private/index.mjs.map +1 -1
- package/dist/components/Comment.js +8 -6
- package/dist/components/Comment.js.map +1 -1
- package/dist/components/Comment.mjs +5 -3
- package/dist/components/Comment.mjs.map +1 -1
- package/dist/components/Composer.js +5 -2
- package/dist/components/Composer.js.map +1 -1
- package/dist/components/Composer.mjs +9 -7
- package/dist/components/Composer.mjs.map +1 -1
- package/dist/components/HistoryVersionSummary.js +4 -10
- package/dist/components/HistoryVersionSummary.js.map +1 -1
- package/dist/components/HistoryVersionSummary.mjs +4 -10
- package/dist/components/HistoryVersionSummary.mjs.map +1 -1
- package/dist/components/HistoryVersionSummaryList.js +2 -0
- package/dist/components/HistoryVersionSummaryList.js.map +1 -1
- package/dist/components/HistoryVersionSummaryList.mjs +2 -0
- package/dist/components/HistoryVersionSummaryList.mjs.map +1 -1
- package/dist/components/InboxNotification.js +2 -0
- package/dist/components/InboxNotification.js.map +1 -1
- package/dist/components/InboxNotification.mjs +2 -0
- package/dist/components/InboxNotification.mjs.map +1 -1
- package/dist/components/InboxNotificationList.js +2 -0
- package/dist/components/InboxNotificationList.js.map +1 -1
- package/dist/components/InboxNotificationList.mjs +4 -2
- package/dist/components/InboxNotificationList.mjs.map +1 -1
- package/dist/components/Thread.js +2 -0
- package/dist/components/Thread.js.map +1 -1
- package/dist/components/Thread.mjs +2 -0
- package/dist/components/Thread.mjs.map +1 -1
- package/dist/components/internal/Attachment.js +4 -6
- package/dist/components/internal/Attachment.js.map +1 -1
- package/dist/components/internal/Attachment.mjs +6 -8
- package/dist/components/internal/Attachment.mjs.map +1 -1
- package/dist/components/internal/Avatar.js +2 -0
- package/dist/components/internal/Avatar.js.map +1 -1
- package/dist/components/internal/Avatar.mjs +2 -0
- package/dist/components/internal/Avatar.mjs.map +1 -1
- package/dist/components/internal/Button.js +2 -0
- package/dist/components/internal/Button.js.map +1 -1
- package/dist/components/internal/Button.mjs +2 -0
- package/dist/components/internal/Button.mjs.map +1 -1
- package/dist/components/internal/Dropdown.js +2 -0
- package/dist/components/internal/Dropdown.js.map +1 -1
- package/dist/components/internal/Dropdown.mjs +3 -1
- package/dist/components/internal/Dropdown.mjs.map +1 -1
- package/dist/components/internal/EmojiPicker.mjs +2 -2
- package/dist/components/internal/Room.js +2 -0
- package/dist/components/internal/Room.js.map +1 -1
- package/dist/components/internal/Room.mjs +2 -0
- package/dist/components/internal/Room.mjs.map +1 -1
- package/dist/components/internal/Tooltip.js +2 -0
- package/dist/components/internal/Tooltip.js.map +1 -1
- package/dist/components/internal/Tooltip.mjs +2 -0
- package/dist/components/internal/Tooltip.mjs.map +1 -1
- package/dist/components/internal/User.js +2 -0
- package/dist/components/internal/User.js.map +1 -1
- package/dist/components/internal/User.mjs +2 -0
- package/dist/components/internal/User.mjs.map +1 -1
- package/dist/components.js +2 -0
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +2 -0
- package/dist/components.mjs.map +1 -1
- package/dist/config.js +2 -0
- package/dist/config.js.map +1 -1
- package/dist/config.mjs +2 -0
- package/dist/config.mjs.map +1 -1
- package/dist/icons/index.js +42 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/icons/index.mjs +19 -0
- package/dist/icons/index.mjs.map +1 -0
- package/dist/overrides.js +2 -0
- package/dist/overrides.js.map +1 -1
- package/dist/overrides.mjs +2 -0
- package/dist/overrides.mjs.map +1 -1
- package/dist/primitives/Composer/index.js +15 -13
- package/dist/primitives/Composer/index.js.map +1 -1
- package/dist/primitives/Composer/index.mjs +11 -9
- package/dist/primitives/Composer/index.mjs.map +1 -1
- package/dist/primitives/Composer/utils.js +2 -1
- package/dist/primitives/Composer/utils.js.map +1 -1
- package/dist/primitives/Composer/utils.mjs +4 -3
- package/dist/primitives/Composer/utils.mjs.map +1 -1
- package/dist/primitives/EmojiPicker/index.js +2 -0
- package/dist/primitives/EmojiPicker/index.js.map +1 -1
- package/dist/primitives/EmojiPicker/index.mjs +4 -2
- package/dist/primitives/EmojiPicker/index.mjs.map +1 -1
- package/dist/primitives/FileSize.js +2 -0
- package/dist/primitives/FileSize.js.map +1 -1
- package/dist/primitives/FileSize.mjs +2 -0
- package/dist/primitives/FileSize.mjs.map +1 -1
- package/dist/primitives/Timestamp.js +2 -0
- package/dist/primitives/Timestamp.js.map +1 -1
- package/dist/primitives/Timestamp.mjs +2 -0
- package/dist/primitives/Timestamp.mjs.map +1 -1
- package/dist/slate/plugins/auto-links.mjs +1 -1
- package/dist/slate/plugins/custom-links.mjs +1 -1
- package/dist/slate/plugins/mentions.mjs +1 -1
- package/dist/utils/Persist.js +2 -0
- package/dist/utils/Persist.js.map +1 -1
- package/dist/utils/Persist.mjs +3 -1
- package/dist/utils/Persist.mjs.map +1 -1
- package/dist/utils/Portal.js +2 -0
- package/dist/utils/Portal.js.map +1 -1
- package/dist/utils/Portal.mjs +2 -0
- package/dist/utils/Portal.mjs.map +1 -1
- package/dist/utils/use-visible.js +22 -0
- package/dist/utils/use-visible.js.map +1 -1
- package/dist/utils/use-visible.mjs +23 -2
- package/dist/utils/use-visible.mjs.map +1 -1
- package/dist/version.js +2 -2
- package/dist/version.js.map +1 -1
- package/dist/version.mjs +2 -2
- package/dist/version.mjs.map +1 -1
- package/package.json +8 -21
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Room.mjs","sources":["../../../src/components/internal/Room.tsx"],"sourcesContent":["\"use client\";\n\nimport { useRoomInfo } from \"@liveblocks/react\";\nimport type { ComponentProps } from \"react\";\nimport { useMemo } from \"react\";\n\nimport { classNames } from \"../../utils/class-names\";\n\nexport interface RoomProps extends ComponentProps<\"span\"> {\n roomId: string;\n}\n\nexport function Room({ roomId, className, ...props }: RoomProps) {\n const { info, isLoading } = useRoomInfo(roomId);\n const resolvedRoomName = useMemo(() => {\n return info?.name ?? roomId;\n }, [info?.name, roomId]);\n\n return (\n <span\n className={classNames(\"lb-name lb-room\", className)}\n data-loading={isLoading ? \"\" : undefined}\n {...props}\n >\n {isLoading ? null : resolvedRoomName}\n </span>\n );\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Room.mjs","sources":["../../../src/components/internal/Room.tsx"],"sourcesContent":["\"use client\";\n\nimport { useRoomInfo } from \"@liveblocks/react\";\nimport type { ComponentProps } from \"react\";\nimport { useMemo } from \"react\";\n\nimport { classNames } from \"../../utils/class-names\";\n\nexport interface RoomProps extends ComponentProps<\"span\"> {\n roomId: string;\n}\n\nexport function Room({ roomId, className, ...props }: RoomProps) {\n const { info, isLoading } = useRoomInfo(roomId);\n const resolvedRoomName = useMemo(() => {\n return info?.name ?? roomId;\n }, [info?.name, roomId]);\n\n return (\n <span\n className={classNames(\"lb-name lb-room\", className)}\n data-loading={isLoading ? \"\" : undefined}\n {...props}\n >\n {isLoading ? null : resolvedRoomName}\n </span>\n );\n}\n"],"names":[],"mappings":";;;;;;AAAA;AAYO;AACL;AACA;AACE;AAAqB;AAGvB;AACG;AACmD;AACnB;AAC3B;AAEgB;AAG1B;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -27,6 +28,7 @@ function _interopNamespaceDefault(e) {
|
|
|
27
28
|
|
|
28
29
|
var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(TooltipPrimitive);
|
|
29
30
|
|
|
31
|
+
|
|
30
32
|
const KEYS = {
|
|
31
33
|
alt: () => ({ title: "Alt", key: "\u2325" }),
|
|
32
34
|
mod: () => isApple.isApple() ? { title: "Command", key: "\u2318" } : { title: "Ctrl", key: "\u2303" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sources":["../../../src/components/internal/Tooltip.tsx"],"sourcesContent":["\"use client\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { forwardRef, useMemo } from \"react\";\n\nimport { useLiveblocksUIConfig } from \"../../config\";\nimport {\n FLOATING_ELEMENT_COLLISION_PADDING,\n FLOATING_ELEMENT_SIDE_OFFSET,\n} from \"../../constants\";\nimport { classNames } from \"../../utils/class-names\";\nimport { isApple } from \"../../utils/is-apple\";\n\nconst KEYS = {\n alt: () => ({ title: \"Alt\", key: \"⌥\" }),\n mod: () =>\n isApple() ? { title: \"Command\", key: \"⌘\" } : { title: \"Ctrl\", key: \"⌃\" },\n shift: () => {\n return { title: \"Shift\", key: \"⇧\" };\n },\n enter: () => {\n return { title: \"Enter\", key: \"⏎\" };\n },\n} as const;\n\nexport interface TooltipProps\n extends Pick<TooltipPrimitive.TooltipTriggerProps, \"children\">,\n Omit<TooltipPrimitive.TooltipContentProps, \"content\"> {\n content: ReactNode;\n multiline?: boolean;\n}\n\nexport interface ShortcutTooltipProps extends TooltipProps {\n shortcut?: ReactNode;\n}\n\nexport interface ShortcutTooltipKeyProps extends ComponentProps<\"abbr\"> {\n name: keyof typeof KEYS;\n}\n\nexport const Tooltip = forwardRef<HTMLButtonElement, TooltipProps>(\n ({ children, content, multiline, className, ...props }, forwardedRef) => {\n const { portalContainer } = useLiveblocksUIConfig();\n\n return (\n <TooltipPrimitive.Root disableHoverableContent>\n <TooltipPrimitive.Trigger asChild ref={forwardedRef}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal container={portalContainer}>\n <TooltipPrimitive.Content\n className={classNames(\n \"lb-root lb-portal lb-tooltip\",\n multiline && \"lb-tooltip:multiline\",\n className\n )}\n side=\"top\"\n align=\"center\"\n sideOffset={FLOATING_ELEMENT_SIDE_OFFSET}\n collisionPadding={FLOATING_ELEMENT_COLLISION_PADDING}\n {...props}\n >\n {content}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n }\n);\n\nexport const ShortcutTooltip = forwardRef<\n HTMLButtonElement,\n ShortcutTooltipProps\n>(({ children, content, shortcut, ...props }, forwardedRef) => {\n return (\n <Tooltip\n content={\n <>\n {content}\n {shortcut && <kbd className=\"lb-tooltip-shortcut\">{shortcut}</kbd>}\n </>\n }\n {...props}\n ref={forwardedRef}\n >\n {children}\n </Tooltip>\n );\n});\n\nexport function ShortcutTooltipKey({\n name,\n ...props\n}: ShortcutTooltipKeyProps) {\n const { title, key } = useMemo(() => KEYS[name]?.(), [name]);\n\n return (\n <abbr title={title} {...props}>\n {key}\n </abbr>\n );\n}\n\nexport { TooltipProvider } from \"@radix-ui/react-tooltip\";\n"],"names":[
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sources":["../../../src/components/internal/Tooltip.tsx"],"sourcesContent":["\"use client\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { forwardRef, useMemo } from \"react\";\n\nimport { useLiveblocksUIConfig } from \"../../config\";\nimport {\n FLOATING_ELEMENT_COLLISION_PADDING,\n FLOATING_ELEMENT_SIDE_OFFSET,\n} from \"../../constants\";\nimport { classNames } from \"../../utils/class-names\";\nimport { isApple } from \"../../utils/is-apple\";\n\nconst KEYS = {\n alt: () => ({ title: \"Alt\", key: \"⌥\" }),\n mod: () =>\n isApple() ? { title: \"Command\", key: \"⌘\" } : { title: \"Ctrl\", key: \"⌃\" },\n shift: () => {\n return { title: \"Shift\", key: \"⇧\" };\n },\n enter: () => {\n return { title: \"Enter\", key: \"⏎\" };\n },\n} as const;\n\nexport interface TooltipProps\n extends Pick<TooltipPrimitive.TooltipTriggerProps, \"children\">,\n Omit<TooltipPrimitive.TooltipContentProps, \"content\"> {\n content: ReactNode;\n multiline?: boolean;\n}\n\nexport interface ShortcutTooltipProps extends TooltipProps {\n shortcut?: ReactNode;\n}\n\nexport interface ShortcutTooltipKeyProps extends ComponentProps<\"abbr\"> {\n name: keyof typeof KEYS;\n}\n\nexport const Tooltip = forwardRef<HTMLButtonElement, TooltipProps>(\n ({ children, content, multiline, className, ...props }, forwardedRef) => {\n const { portalContainer } = useLiveblocksUIConfig();\n\n return (\n <TooltipPrimitive.Root disableHoverableContent>\n <TooltipPrimitive.Trigger asChild ref={forwardedRef}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal container={portalContainer}>\n <TooltipPrimitive.Content\n className={classNames(\n \"lb-root lb-portal lb-tooltip\",\n multiline && \"lb-tooltip:multiline\",\n className\n )}\n side=\"top\"\n align=\"center\"\n sideOffset={FLOATING_ELEMENT_SIDE_OFFSET}\n collisionPadding={FLOATING_ELEMENT_COLLISION_PADDING}\n {...props}\n >\n {content}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n }\n);\n\nexport const ShortcutTooltip = forwardRef<\n HTMLButtonElement,\n ShortcutTooltipProps\n>(({ children, content, shortcut, ...props }, forwardedRef) => {\n return (\n <Tooltip\n content={\n <>\n {content}\n {shortcut && <kbd className=\"lb-tooltip-shortcut\">{shortcut}</kbd>}\n </>\n }\n {...props}\n ref={forwardedRef}\n >\n {children}\n </Tooltip>\n );\n});\n\nexport function ShortcutTooltipKey({\n name,\n ...props\n}: ShortcutTooltipKeyProps) {\n const { title, key } = useMemo(() => KEYS[name]?.(), [name]);\n\n return (\n <abbr title={title} {...props}>\n {key}\n </abbr>\n );\n}\n\nexport { TooltipProvider } from \"@radix-ui/react-tooltip\";\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAcA;AAAa;AAC0B;AAEoC;AAEvE;AAAkC;AACpC;AAEE;AAAkC;AAEtC;AAiBO;AAAgB;AAEnB;AAEA;AACG;AAA6C;AAC5C;AAAC;AAAgC;AAAM;AACpC;AACH;AACC;AAAmC;AACjC;AACY;AACT;AACa;AACb;AACF;AACK;AACC;AACM;AACM;AACd;AAEH;AACH;AACF;AAAA;AACF;AAGN;AAEa;AAIX;AACG;AAEG;AACG;AAAA;AACa;AAAc;AAAuB;AAAS;AAAA;AAC9D;AAEE;AACC;AAEJ;AAGP;AAEO;AAA4B;AACjC;AAEF;AACE;AAEA;AACG;AAAK;AAAkB;AACrB;AAGP;;;;;;;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
3
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
3
4
|
export { TooltipProvider } from '@radix-ui/react-tooltip';
|
|
@@ -7,6 +8,7 @@ import { FLOATING_ELEMENT_SIDE_OFFSET, FLOATING_ELEMENT_COLLISION_PADDING } from
|
|
|
7
8
|
import { classNames } from '../../utils/class-names.mjs';
|
|
8
9
|
import { isApple } from '../../utils/is-apple.mjs';
|
|
9
10
|
|
|
11
|
+
|
|
10
12
|
const KEYS = {
|
|
11
13
|
alt: () => ({ title: "Alt", key: "\u2325" }),
|
|
12
14
|
mod: () => isApple() ? { title: "Command", key: "\u2318" } : { title: "Ctrl", key: "\u2303" },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.mjs","sources":["../../../src/components/internal/Tooltip.tsx"],"sourcesContent":["\"use client\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { forwardRef, useMemo } from \"react\";\n\nimport { useLiveblocksUIConfig } from \"../../config\";\nimport {\n FLOATING_ELEMENT_COLLISION_PADDING,\n FLOATING_ELEMENT_SIDE_OFFSET,\n} from \"../../constants\";\nimport { classNames } from \"../../utils/class-names\";\nimport { isApple } from \"../../utils/is-apple\";\n\nconst KEYS = {\n alt: () => ({ title: \"Alt\", key: \"⌥\" }),\n mod: () =>\n isApple() ? { title: \"Command\", key: \"⌘\" } : { title: \"Ctrl\", key: \"⌃\" },\n shift: () => {\n return { title: \"Shift\", key: \"⇧\" };\n },\n enter: () => {\n return { title: \"Enter\", key: \"⏎\" };\n },\n} as const;\n\nexport interface TooltipProps\n extends Pick<TooltipPrimitive.TooltipTriggerProps, \"children\">,\n Omit<TooltipPrimitive.TooltipContentProps, \"content\"> {\n content: ReactNode;\n multiline?: boolean;\n}\n\nexport interface ShortcutTooltipProps extends TooltipProps {\n shortcut?: ReactNode;\n}\n\nexport interface ShortcutTooltipKeyProps extends ComponentProps<\"abbr\"> {\n name: keyof typeof KEYS;\n}\n\nexport const Tooltip = forwardRef<HTMLButtonElement, TooltipProps>(\n ({ children, content, multiline, className, ...props }, forwardedRef) => {\n const { portalContainer } = useLiveblocksUIConfig();\n\n return (\n <TooltipPrimitive.Root disableHoverableContent>\n <TooltipPrimitive.Trigger asChild ref={forwardedRef}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal container={portalContainer}>\n <TooltipPrimitive.Content\n className={classNames(\n \"lb-root lb-portal lb-tooltip\",\n multiline && \"lb-tooltip:multiline\",\n className\n )}\n side=\"top\"\n align=\"center\"\n sideOffset={FLOATING_ELEMENT_SIDE_OFFSET}\n collisionPadding={FLOATING_ELEMENT_COLLISION_PADDING}\n {...props}\n >\n {content}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n }\n);\n\nexport const ShortcutTooltip = forwardRef<\n HTMLButtonElement,\n ShortcutTooltipProps\n>(({ children, content, shortcut, ...props }, forwardedRef) => {\n return (\n <Tooltip\n content={\n <>\n {content}\n {shortcut && <kbd className=\"lb-tooltip-shortcut\">{shortcut}</kbd>}\n </>\n }\n {...props}\n ref={forwardedRef}\n >\n {children}\n </Tooltip>\n );\n});\n\nexport function ShortcutTooltipKey({\n name,\n ...props\n}: ShortcutTooltipKeyProps) {\n const { title, key } = useMemo(() => KEYS[name]?.(), [name]);\n\n return (\n <abbr title={title} {...props}>\n {key}\n </abbr>\n );\n}\n\nexport { TooltipProvider } from \"@radix-ui/react-tooltip\";\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tooltip.mjs","sources":["../../../src/components/internal/Tooltip.tsx"],"sourcesContent":["\"use client\";\n\nimport * as TooltipPrimitive from \"@radix-ui/react-tooltip\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport { forwardRef, useMemo } from \"react\";\n\nimport { useLiveblocksUIConfig } from \"../../config\";\nimport {\n FLOATING_ELEMENT_COLLISION_PADDING,\n FLOATING_ELEMENT_SIDE_OFFSET,\n} from \"../../constants\";\nimport { classNames } from \"../../utils/class-names\";\nimport { isApple } from \"../../utils/is-apple\";\n\nconst KEYS = {\n alt: () => ({ title: \"Alt\", key: \"⌥\" }),\n mod: () =>\n isApple() ? { title: \"Command\", key: \"⌘\" } : { title: \"Ctrl\", key: \"⌃\" },\n shift: () => {\n return { title: \"Shift\", key: \"⇧\" };\n },\n enter: () => {\n return { title: \"Enter\", key: \"⏎\" };\n },\n} as const;\n\nexport interface TooltipProps\n extends Pick<TooltipPrimitive.TooltipTriggerProps, \"children\">,\n Omit<TooltipPrimitive.TooltipContentProps, \"content\"> {\n content: ReactNode;\n multiline?: boolean;\n}\n\nexport interface ShortcutTooltipProps extends TooltipProps {\n shortcut?: ReactNode;\n}\n\nexport interface ShortcutTooltipKeyProps extends ComponentProps<\"abbr\"> {\n name: keyof typeof KEYS;\n}\n\nexport const Tooltip = forwardRef<HTMLButtonElement, TooltipProps>(\n ({ children, content, multiline, className, ...props }, forwardedRef) => {\n const { portalContainer } = useLiveblocksUIConfig();\n\n return (\n <TooltipPrimitive.Root disableHoverableContent>\n <TooltipPrimitive.Trigger asChild ref={forwardedRef}>\n {children}\n </TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal container={portalContainer}>\n <TooltipPrimitive.Content\n className={classNames(\n \"lb-root lb-portal lb-tooltip\",\n multiline && \"lb-tooltip:multiline\",\n className\n )}\n side=\"top\"\n align=\"center\"\n sideOffset={FLOATING_ELEMENT_SIDE_OFFSET}\n collisionPadding={FLOATING_ELEMENT_COLLISION_PADDING}\n {...props}\n >\n {content}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n );\n }\n);\n\nexport const ShortcutTooltip = forwardRef<\n HTMLButtonElement,\n ShortcutTooltipProps\n>(({ children, content, shortcut, ...props }, forwardedRef) => {\n return (\n <Tooltip\n content={\n <>\n {content}\n {shortcut && <kbd className=\"lb-tooltip-shortcut\">{shortcut}</kbd>}\n </>\n }\n {...props}\n ref={forwardedRef}\n >\n {children}\n </Tooltip>\n );\n});\n\nexport function ShortcutTooltipKey({\n name,\n ...props\n}: ShortcutTooltipKeyProps) {\n const { title, key } = useMemo(() => KEYS[name]?.(), [name]);\n\n return (\n <abbr title={title} {...props}>\n {key}\n </abbr>\n );\n}\n\nexport { TooltipProvider } from \"@radix-ui/react-tooltip\";\n"],"names":[],"mappings":";;;;;;;;;;AAAA;AAcA;AAAa;AAC0B;AAEoC;AAEvE;AAAkC;AACpC;AAEE;AAAkC;AAEtC;AAiBO;AAAgB;AAEnB;AAEA;AACG;AAA6C;AAC5C;AAAC;AAAgC;AAAM;AACpC;AACH;AACC;AAAmC;AACjC;AACY;AACT;AACa;AACb;AACF;AACK;AACC;AACM;AACM;AACd;AAEH;AACH;AACF;AAAA;AACF;AAGN;AAEa;AAIX;AACG;AAEG;AACG;AAAA;AACa;AAAc;AAAuB;AAAS;AAAA;AAC9D;AAEE;AACC;AAEJ;AAGP;AAEO;AAA4B;AACjC;AAEF;AACE;AAEA;AACG;AAAK;AAAkB;AACrB;AAGP;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -7,6 +8,7 @@ var overrides = require('../../overrides.js');
|
|
|
7
8
|
var shared = require('../../shared.js');
|
|
8
9
|
var classNames = require('../../utils/class-names.js');
|
|
9
10
|
|
|
11
|
+
|
|
10
12
|
function User({ userId, replaceSelf, className, ...props }) {
|
|
11
13
|
const currentId = shared.useCurrentUserId();
|
|
12
14
|
const { user, isLoading } = react.useUser(userId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"User.js","sources":["../../../src/components/internal/User.tsx"],"sourcesContent":["\"use client\";\n\nimport { useUser } from \"@liveblocks/react\";\nimport type { ComponentProps } from \"react\";\nimport { useMemo } from \"react\";\n\nimport { useOverrides } from \"../../overrides\";\nimport { useCurrentUserId } from \"../../shared\";\nimport { classNames } from \"../../utils/class-names\";\n\nexport interface UserProps extends ComponentProps<\"span\"> {\n /**\n * The user ID to display the user name for.\n */\n userId: string;\n\n /**\n * Whether to replace the user name with \"you\" ($.USER_SELF) for the current user.\n */\n replaceSelf?: boolean;\n}\n\nexport function User({ userId, replaceSelf, className, ...props }: UserProps) {\n const currentId = useCurrentUserId();\n const { user, isLoading } = useUser(userId);\n const $ = useOverrides();\n const resolvedUserName = useMemo(() => {\n return replaceSelf && currentId === userId\n ? $.USER_SELF\n : user?.name ?? $.USER_UNKNOWN;\n }, [replaceSelf, currentId, userId, $.USER_SELF, $.USER_UNKNOWN, user?.name]);\n\n return (\n <span\n className={classNames(\"lb-name lb-user\", className)}\n data-loading={isLoading ? \"\" : undefined}\n {...props}\n >\n {isLoading ? null : resolvedUserName}\n </span>\n );\n}\n"],"names":[
|
|
1
|
+
{"version":3,"file":"User.js","sources":["../../../src/components/internal/User.tsx"],"sourcesContent":["\"use client\";\n\nimport { useUser } from \"@liveblocks/react\";\nimport type { ComponentProps } from \"react\";\nimport { useMemo } from \"react\";\n\nimport { useOverrides } from \"../../overrides\";\nimport { useCurrentUserId } from \"../../shared\";\nimport { classNames } from \"../../utils/class-names\";\n\nexport interface UserProps extends ComponentProps<\"span\"> {\n /**\n * The user ID to display the user name for.\n */\n userId: string;\n\n /**\n * Whether to replace the user name with \"you\" ($.USER_SELF) for the current user.\n */\n replaceSelf?: boolean;\n}\n\nexport function User({ userId, replaceSelf, className, ...props }: UserProps) {\n const currentId = useCurrentUserId();\n const { user, isLoading } = useUser(userId);\n const $ = useOverrides();\n const resolvedUserName = useMemo(() => {\n return replaceSelf && currentId === userId\n ? $.USER_SELF\n : user?.name ?? $.USER_UNKNOWN;\n }, [replaceSelf, currentId, userId, $.USER_SELF, $.USER_UNKNOWN, user?.name]);\n\n return (\n <span\n className={classNames(\"lb-name lb-user\", className)}\n data-loading={isLoading ? \"\" : undefined}\n {...props}\n >\n {isLoading ? null : resolvedUserName}\n </span>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;AAAA;AAsBO;AACL;AACA;AACA;AACA;AACE;AAEoB;AAGtB;AACG;AACmD;AACnB;AAC3B;AAEgB;AAG1B;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { useUser } from '@liveblocks/react';
|
|
3
4
|
import { useMemo } from 'react';
|
|
@@ -5,6 +6,7 @@ import { useOverrides } from '../../overrides.mjs';
|
|
|
5
6
|
import { useCurrentUserId } from '../../shared.mjs';
|
|
6
7
|
import { classNames } from '../../utils/class-names.mjs';
|
|
7
8
|
|
|
9
|
+
|
|
8
10
|
function User({ userId, replaceSelf, className, ...props }) {
|
|
9
11
|
const currentId = useCurrentUserId();
|
|
10
12
|
const { user, isLoading } = useUser(userId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"User.mjs","sources":["../../../src/components/internal/User.tsx"],"sourcesContent":["\"use client\";\n\nimport { useUser } from \"@liveblocks/react\";\nimport type { ComponentProps } from \"react\";\nimport { useMemo } from \"react\";\n\nimport { useOverrides } from \"../../overrides\";\nimport { useCurrentUserId } from \"../../shared\";\nimport { classNames } from \"../../utils/class-names\";\n\nexport interface UserProps extends ComponentProps<\"span\"> {\n /**\n * The user ID to display the user name for.\n */\n userId: string;\n\n /**\n * Whether to replace the user name with \"you\" ($.USER_SELF) for the current user.\n */\n replaceSelf?: boolean;\n}\n\nexport function User({ userId, replaceSelf, className, ...props }: UserProps) {\n const currentId = useCurrentUserId();\n const { user, isLoading } = useUser(userId);\n const $ = useOverrides();\n const resolvedUserName = useMemo(() => {\n return replaceSelf && currentId === userId\n ? $.USER_SELF\n : user?.name ?? $.USER_UNKNOWN;\n }, [replaceSelf, currentId, userId, $.USER_SELF, $.USER_UNKNOWN, user?.name]);\n\n return (\n <span\n className={classNames(\"lb-name lb-user\", className)}\n data-loading={isLoading ? \"\" : undefined}\n {...props}\n >\n {isLoading ? null : resolvedUserName}\n </span>\n );\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"User.mjs","sources":["../../../src/components/internal/User.tsx"],"sourcesContent":["\"use client\";\n\nimport { useUser } from \"@liveblocks/react\";\nimport type { ComponentProps } from \"react\";\nimport { useMemo } from \"react\";\n\nimport { useOverrides } from \"../../overrides\";\nimport { useCurrentUserId } from \"../../shared\";\nimport { classNames } from \"../../utils/class-names\";\n\nexport interface UserProps extends ComponentProps<\"span\"> {\n /**\n * The user ID to display the user name for.\n */\n userId: string;\n\n /**\n * Whether to replace the user name with \"you\" ($.USER_SELF) for the current user.\n */\n replaceSelf?: boolean;\n}\n\nexport function User({ userId, replaceSelf, className, ...props }: UserProps) {\n const currentId = useCurrentUserId();\n const { user, isLoading } = useUser(userId);\n const $ = useOverrides();\n const resolvedUserName = useMemo(() => {\n return replaceSelf && currentId === userId\n ? $.USER_SELF\n : user?.name ?? $.USER_UNKNOWN;\n }, [replaceSelf, currentId, userId, $.USER_SELF, $.USER_UNKNOWN, user?.name]);\n\n return (\n <span\n className={classNames(\"lb-name lb-user\", className)}\n data-loading={isLoading ? \"\" : undefined}\n {...props}\n >\n {isLoading ? null : resolvedUserName}\n </span>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;AAsBO;AACL;AACA;AACA;AACA;AACE;AAEoB;AAGtB;AACG;AACmD;AACnB;AAC3B;AAEgB;AAG1B;;"}
|
package/dist/components.js
CHANGED
package/dist/components.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sources":["../src/components.tsx"],"sourcesContent":["\"use client\";\n\nimport type {\n ComponentPropsWithoutRef,\n ComponentType,\n PropsWithChildren,\n} from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\n\nexport interface GlobalComponents {\n Anchor: ComponentType<ComponentPropsWithoutRef<\"a\">> | \"a\";\n}\n\nexport type Components = GlobalComponents;\n\ntype ComponentsProviderProps = PropsWithChildren<{\n components?: Partial<Components>;\n}>;\n\nexport const defaultComponents: Components = {\n Anchor: \"a\",\n};\n\nexport const ComponentsContext = createContext<Components | undefined>(\n undefined\n);\n\nexport function useComponents(components?: Partial<Components>): Components {\n const contextComponents = useContext(ComponentsContext);\n\n return useMemo(\n () => ({\n ...defaultComponents,\n ...contextComponents,\n ...components,\n }),\n [contextComponents, components]\n );\n}\n\nexport function ComponentsProvider({\n children,\n components: providerComponents,\n}: ComponentsProviderProps) {\n const contextComponents = useContext(ComponentsContext);\n const components = useMemo(\n () => ({\n ...defaultComponents,\n ...contextComponents,\n ...providerComponents,\n }),\n [contextComponents, providerComponents]\n );\n\n return (\n <ComponentsContext.Provider value={components}>\n {children}\n </ComponentsContext.Provider>\n );\n}\n"],"names":[
|
|
1
|
+
{"version":3,"file":"components.js","sources":["../src/components.tsx"],"sourcesContent":["\"use client\";\n\nimport type {\n ComponentPropsWithoutRef,\n ComponentType,\n PropsWithChildren,\n} from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\n\nexport interface GlobalComponents {\n Anchor: ComponentType<ComponentPropsWithoutRef<\"a\">> | \"a\";\n}\n\nexport type Components = GlobalComponents;\n\ntype ComponentsProviderProps = PropsWithChildren<{\n components?: Partial<Components>;\n}>;\n\nexport const defaultComponents: Components = {\n Anchor: \"a\",\n};\n\nexport const ComponentsContext = createContext<Components | undefined>(\n undefined\n);\n\nexport function useComponents(components?: Partial<Components>): Components {\n const contextComponents = useContext(ComponentsContext);\n\n return useMemo(\n () => ({\n ...defaultComponents,\n ...contextComponents,\n ...components,\n }),\n [contextComponents, components]\n );\n}\n\nexport function ComponentsProvider({\n children,\n components: providerComponents,\n}: ComponentsProviderProps) {\n const contextComponents = useContext(ComponentsContext);\n const components = useMemo(\n () => ({\n ...defaultComponents,\n ...contextComponents,\n ...providerComponents,\n }),\n [contextComponents, providerComponents]\n );\n\n return (\n <ComponentsContext.Provider value={components}>\n {children}\n </ComponentsContext.Provider>\n );\n}\n"],"names":[],"mappings":";;;;;;AAAA;AAmBO;AAAsC;AAE7C;AAEO;AAA0B;AAEjC;AAEO;AACL;AAEA;AAAO;AACE;AACF;AACA;AACA;AACL;AAC8B;AAElC;AAEO;AAA4B;AACjC;AAEF;AACE;AACA;AAAmB;AACV;AACF;AACA;AACA;AACL;AACsC;AAGxC;AACG;AAAkC;AAChC;AAGP;;;;;"}
|
package/dist/components.mjs
CHANGED
package/dist/components.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.mjs","sources":["../src/components.tsx"],"sourcesContent":["\"use client\";\n\nimport type {\n ComponentPropsWithoutRef,\n ComponentType,\n PropsWithChildren,\n} from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\n\nexport interface GlobalComponents {\n Anchor: ComponentType<ComponentPropsWithoutRef<\"a\">> | \"a\";\n}\n\nexport type Components = GlobalComponents;\n\ntype ComponentsProviderProps = PropsWithChildren<{\n components?: Partial<Components>;\n}>;\n\nexport const defaultComponents: Components = {\n Anchor: \"a\",\n};\n\nexport const ComponentsContext = createContext<Components | undefined>(\n undefined\n);\n\nexport function useComponents(components?: Partial<Components>): Components {\n const contextComponents = useContext(ComponentsContext);\n\n return useMemo(\n () => ({\n ...defaultComponents,\n ...contextComponents,\n ...components,\n }),\n [contextComponents, components]\n );\n}\n\nexport function ComponentsProvider({\n children,\n components: providerComponents,\n}: ComponentsProviderProps) {\n const contextComponents = useContext(ComponentsContext);\n const components = useMemo(\n () => ({\n ...defaultComponents,\n ...contextComponents,\n ...providerComponents,\n }),\n [contextComponents, providerComponents]\n );\n\n return (\n <ComponentsContext.Provider value={components}>\n {children}\n </ComponentsContext.Provider>\n );\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"components.mjs","sources":["../src/components.tsx"],"sourcesContent":["\"use client\";\n\nimport type {\n ComponentPropsWithoutRef,\n ComponentType,\n PropsWithChildren,\n} from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\n\nexport interface GlobalComponents {\n Anchor: ComponentType<ComponentPropsWithoutRef<\"a\">> | \"a\";\n}\n\nexport type Components = GlobalComponents;\n\ntype ComponentsProviderProps = PropsWithChildren<{\n components?: Partial<Components>;\n}>;\n\nexport const defaultComponents: Components = {\n Anchor: \"a\",\n};\n\nexport const ComponentsContext = createContext<Components | undefined>(\n undefined\n);\n\nexport function useComponents(components?: Partial<Components>): Components {\n const contextComponents = useContext(ComponentsContext);\n\n return useMemo(\n () => ({\n ...defaultComponents,\n ...contextComponents,\n ...components,\n }),\n [contextComponents, components]\n );\n}\n\nexport function ComponentsProvider({\n children,\n components: providerComponents,\n}: ComponentsProviderProps) {\n const contextComponents = useContext(ComponentsContext);\n const components = useMemo(\n () => ({\n ...defaultComponents,\n ...contextComponents,\n ...providerComponents,\n }),\n [contextComponents, providerComponents]\n );\n\n return (\n <ComponentsContext.Provider value={components}>\n {children}\n </ComponentsContext.Provider>\n );\n}\n"],"names":[],"mappings":";;;;AAAA;AAmBO;AAAsC;AAE7C;AAEO;AAA0B;AAEjC;AAEO;AACL;AAEA;AAAO;AACE;AACF;AACA;AACA;AACL;AAC8B;AAElC;AAEO;AAA4B;AACjC;AAEF;AACE;AACA;AAAmB;AACV;AACF;AACA;AACA;AACL;AACsC;AAGxC;AACG;AAAkC;AAChC;AAGP;;"}
|
package/dist/config.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -5,6 +6,7 @@ var react = require('react');
|
|
|
5
6
|
var components = require('./components.js');
|
|
6
7
|
var overrides = require('./overrides.js');
|
|
7
8
|
|
|
9
|
+
|
|
8
10
|
const LiveblocksUIConfigContext = react.createContext({});
|
|
9
11
|
function useLiveblocksUIConfig() {
|
|
10
12
|
return react.useContext(LiveblocksUIConfigContext);
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../src/config.tsx"],"sourcesContent":["\"use client\";\n\nimport type { PropsWithChildren } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\n\nimport { type Components, ComponentsProvider } from \"./components\";\nimport type { Overrides } from \"./overrides\";\nimport { OverridesProvider } from \"./overrides\";\n\ntype LiveblocksUIConfigProps = PropsWithChildren<{\n /**\n * Override the components' strings.\n */\n overrides?: Partial<Overrides>;\n\n /**\n * Override the components' components.\n */\n components?: Partial<Components>;\n\n /**\n * The container to render the portal into.\n */\n portalContainer?: HTMLElement;\n\n /**\n * When `preventUnsavedChanges` is set on your Liveblocks client (or set on\n * <LiveblocksProvider>), then closing a browser tab will be prevented when\n * there are unsaved changes.\n *\n * By default, that will include draft texts or attachments that are (being)\n * uploaded via comments/threads composers, but not submitted yet.\n *\n * If you want to prevent unsaved changes with Liveblocks, but not for\n * composers, you can opt-out by setting this option to `false`.\n */\n preventUnsavedComposerChanges?: boolean;\n}>;\n\ninterface LiveblocksUIConfigContext {\n portalContainer?: HTMLElement;\n preventUnsavedComposerChanges?: boolean;\n}\n\nconst LiveblocksUIConfigContext = createContext<LiveblocksUIConfigContext>({});\n\nexport function useLiveblocksUIConfig() {\n return useContext(LiveblocksUIConfigContext);\n}\n\n/**\n * Set configuration options for all components.\n *\n * @example\n * <LiveblocksUIConfig overrides={{ locale: \"fr\", USER_UNKNOWN: \"Anonyme\", ... }}>\n * <App />\n * </LiveblocksUIConfig>\n */\nexport function LiveblocksUIConfig({\n overrides,\n components,\n portalContainer,\n preventUnsavedComposerChanges = true,\n children,\n}: LiveblocksUIConfigProps) {\n const liveblocksUIConfig = useMemo(\n () => ({ portalContainer, preventUnsavedComposerChanges }),\n [portalContainer, preventUnsavedComposerChanges]\n );\n\n return (\n <LiveblocksUIConfigContext.Provider value={liveblocksUIConfig}>\n <OverridesProvider overrides={overrides}>\n <ComponentsProvider components={components}>\n {children}\n </ComponentsProvider>\n </OverridesProvider>\n </LiveblocksUIConfigContext.Provider>\n );\n}\n"],"names":[
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../src/config.tsx"],"sourcesContent":["\"use client\";\n\nimport type { PropsWithChildren } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\n\nimport { type Components, ComponentsProvider } from \"./components\";\nimport type { Overrides } from \"./overrides\";\nimport { OverridesProvider } from \"./overrides\";\n\ntype LiveblocksUIConfigProps = PropsWithChildren<{\n /**\n * Override the components' strings.\n */\n overrides?: Partial<Overrides>;\n\n /**\n * Override the components' components.\n */\n components?: Partial<Components>;\n\n /**\n * The container to render the portal into.\n */\n portalContainer?: HTMLElement;\n\n /**\n * When `preventUnsavedChanges` is set on your Liveblocks client (or set on\n * <LiveblocksProvider>), then closing a browser tab will be prevented when\n * there are unsaved changes.\n *\n * By default, that will include draft texts or attachments that are (being)\n * uploaded via comments/threads composers, but not submitted yet.\n *\n * If you want to prevent unsaved changes with Liveblocks, but not for\n * composers, you can opt-out by setting this option to `false`.\n */\n preventUnsavedComposerChanges?: boolean;\n}>;\n\ninterface LiveblocksUIConfigContext {\n portalContainer?: HTMLElement;\n preventUnsavedComposerChanges?: boolean;\n}\n\nconst LiveblocksUIConfigContext = createContext<LiveblocksUIConfigContext>({});\n\nexport function useLiveblocksUIConfig() {\n return useContext(LiveblocksUIConfigContext);\n}\n\n/**\n * Set configuration options for all components.\n *\n * @example\n * <LiveblocksUIConfig overrides={{ locale: \"fr\", USER_UNKNOWN: \"Anonyme\", ... }}>\n * <App />\n * </LiveblocksUIConfig>\n */\nexport function LiveblocksUIConfig({\n overrides,\n components,\n portalContainer,\n preventUnsavedComposerChanges = true,\n children,\n}: LiveblocksUIConfigProps) {\n const liveblocksUIConfig = useMemo(\n () => ({ portalContainer, preventUnsavedComposerChanges }),\n [portalContainer, preventUnsavedComposerChanges]\n );\n\n return (\n <LiveblocksUIConfigContext.Provider value={liveblocksUIConfig}>\n <OverridesProvider overrides={overrides}>\n <ComponentsProvider components={components}>\n {children}\n </ComponentsProvider>\n </OverridesProvider>\n </LiveblocksUIConfigContext.Provider>\n );\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;AA4CA;AAEO;AACL;AACF;AAUO;AAA4B;AACjC;AACA;AACA;AACgC;AAElC;AACE;AAA2B;AAC+B;AACT;AAGjD;AACG;AAA0C;AACxC;AAAkB;AAChB;AAAmB;AACjB;AACH;AACF;AAGN;;;"}
|
package/dist/config.mjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { createContext, useContext, useMemo } from 'react';
|
|
3
4
|
import { ComponentsProvider } from './components.mjs';
|
|
4
5
|
import { OverridesProvider } from './overrides.mjs';
|
|
5
6
|
|
|
7
|
+
|
|
6
8
|
const LiveblocksUIConfigContext = createContext({});
|
|
7
9
|
function useLiveblocksUIConfig() {
|
|
8
10
|
return useContext(LiveblocksUIConfigContext);
|
package/dist/config.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.mjs","sources":["../src/config.tsx"],"sourcesContent":["\"use client\";\n\nimport type { PropsWithChildren } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\n\nimport { type Components, ComponentsProvider } from \"./components\";\nimport type { Overrides } from \"./overrides\";\nimport { OverridesProvider } from \"./overrides\";\n\ntype LiveblocksUIConfigProps = PropsWithChildren<{\n /**\n * Override the components' strings.\n */\n overrides?: Partial<Overrides>;\n\n /**\n * Override the components' components.\n */\n components?: Partial<Components>;\n\n /**\n * The container to render the portal into.\n */\n portalContainer?: HTMLElement;\n\n /**\n * When `preventUnsavedChanges` is set on your Liveblocks client (or set on\n * <LiveblocksProvider>), then closing a browser tab will be prevented when\n * there are unsaved changes.\n *\n * By default, that will include draft texts or attachments that are (being)\n * uploaded via comments/threads composers, but not submitted yet.\n *\n * If you want to prevent unsaved changes with Liveblocks, but not for\n * composers, you can opt-out by setting this option to `false`.\n */\n preventUnsavedComposerChanges?: boolean;\n}>;\n\ninterface LiveblocksUIConfigContext {\n portalContainer?: HTMLElement;\n preventUnsavedComposerChanges?: boolean;\n}\n\nconst LiveblocksUIConfigContext = createContext<LiveblocksUIConfigContext>({});\n\nexport function useLiveblocksUIConfig() {\n return useContext(LiveblocksUIConfigContext);\n}\n\n/**\n * Set configuration options for all components.\n *\n * @example\n * <LiveblocksUIConfig overrides={{ locale: \"fr\", USER_UNKNOWN: \"Anonyme\", ... }}>\n * <App />\n * </LiveblocksUIConfig>\n */\nexport function LiveblocksUIConfig({\n overrides,\n components,\n portalContainer,\n preventUnsavedComposerChanges = true,\n children,\n}: LiveblocksUIConfigProps) {\n const liveblocksUIConfig = useMemo(\n () => ({ portalContainer, preventUnsavedComposerChanges }),\n [portalContainer, preventUnsavedComposerChanges]\n );\n\n return (\n <LiveblocksUIConfigContext.Provider value={liveblocksUIConfig}>\n <OverridesProvider overrides={overrides}>\n <ComponentsProvider components={components}>\n {children}\n </ComponentsProvider>\n </OverridesProvider>\n </LiveblocksUIConfigContext.Provider>\n );\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.mjs","sources":["../src/config.tsx"],"sourcesContent":["\"use client\";\n\nimport type { PropsWithChildren } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\n\nimport { type Components, ComponentsProvider } from \"./components\";\nimport type { Overrides } from \"./overrides\";\nimport { OverridesProvider } from \"./overrides\";\n\ntype LiveblocksUIConfigProps = PropsWithChildren<{\n /**\n * Override the components' strings.\n */\n overrides?: Partial<Overrides>;\n\n /**\n * Override the components' components.\n */\n components?: Partial<Components>;\n\n /**\n * The container to render the portal into.\n */\n portalContainer?: HTMLElement;\n\n /**\n * When `preventUnsavedChanges` is set on your Liveblocks client (or set on\n * <LiveblocksProvider>), then closing a browser tab will be prevented when\n * there are unsaved changes.\n *\n * By default, that will include draft texts or attachments that are (being)\n * uploaded via comments/threads composers, but not submitted yet.\n *\n * If you want to prevent unsaved changes with Liveblocks, but not for\n * composers, you can opt-out by setting this option to `false`.\n */\n preventUnsavedComposerChanges?: boolean;\n}>;\n\ninterface LiveblocksUIConfigContext {\n portalContainer?: HTMLElement;\n preventUnsavedComposerChanges?: boolean;\n}\n\nconst LiveblocksUIConfigContext = createContext<LiveblocksUIConfigContext>({});\n\nexport function useLiveblocksUIConfig() {\n return useContext(LiveblocksUIConfigContext);\n}\n\n/**\n * Set configuration options for all components.\n *\n * @example\n * <LiveblocksUIConfig overrides={{ locale: \"fr\", USER_UNKNOWN: \"Anonyme\", ... }}>\n * <App />\n * </LiveblocksUIConfig>\n */\nexport function LiveblocksUIConfig({\n overrides,\n components,\n portalContainer,\n preventUnsavedComposerChanges = true,\n children,\n}: LiveblocksUIConfigProps) {\n const liveblocksUIConfig = useMemo(\n () => ({ portalContainer, preventUnsavedComposerChanges }),\n [portalContainer, preventUnsavedComposerChanges]\n );\n\n return (\n <LiveblocksUIConfigContext.Provider value={liveblocksUIConfig}>\n <OverridesProvider overrides={overrides}>\n <ComponentsProvider components={components}>\n {children}\n </ComponentsProvider>\n </OverridesProvider>\n </LiveblocksUIConfigContext.Provider>\n );\n}\n"],"names":[],"mappings":";;;;;;AAAA;AA4CA;AAEO;AACL;AACF;AAUO;AAA4B;AACjC;AACA;AACA;AACgC;AAElC;AACE;AAA2B;AAC+B;AACT;AAGjD;AACG;AAA0C;AACxC;AAAkB;AAChB;AAAmB;AACjB;AACH;AACF;AAGN;;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ArrowDown = require('./ArrowDown.js');
|
|
4
|
+
var ArrowUp = require('./ArrowUp.js');
|
|
5
|
+
var Attachment = require('./Attachment.js');
|
|
6
|
+
var Check = require('./Check.js');
|
|
7
|
+
var Cross = require('./Cross.js');
|
|
8
|
+
var Delete = require('./Delete.js');
|
|
9
|
+
var Edit = require('./Edit.js');
|
|
10
|
+
var Ellipsis = require('./Ellipsis.js');
|
|
11
|
+
var Emoji = require('./Emoji.js');
|
|
12
|
+
var EmojiAdd = require('./EmojiAdd.js');
|
|
13
|
+
var Mention = require('./Mention.js');
|
|
14
|
+
var Resolve = require('./Resolve.js');
|
|
15
|
+
var Resolved = require('./Resolved.js');
|
|
16
|
+
var Restore = require('./Restore.js');
|
|
17
|
+
var Search = require('./Search.js');
|
|
18
|
+
var Send = require('./Send.js');
|
|
19
|
+
var Spinner = require('./Spinner.js');
|
|
20
|
+
var Warning = require('./Warning.js');
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
exports.ArrowDownIcon = ArrowDown.ArrowDownIcon;
|
|
25
|
+
exports.ArrowUpIcon = ArrowUp.ArrowUpIcon;
|
|
26
|
+
exports.AttachmentIcon = Attachment.AttachmentIcon;
|
|
27
|
+
exports.CheckIcon = Check.CheckIcon;
|
|
28
|
+
exports.CrossIcon = Cross.CrossIcon;
|
|
29
|
+
exports.DeleteIcon = Delete.DeleteIcon;
|
|
30
|
+
exports.EditIcon = Edit.EditIcon;
|
|
31
|
+
exports.EllipsisIcon = Ellipsis.EllipsisIcon;
|
|
32
|
+
exports.EmojiIcon = Emoji.EmojiIcon;
|
|
33
|
+
exports.EmojiAddIcon = EmojiAdd.EmojiAddIcon;
|
|
34
|
+
exports.MentionIcon = Mention.MentionIcon;
|
|
35
|
+
exports.ResolveIcon = Resolve.ResolveIcon;
|
|
36
|
+
exports.ResolvedIcon = Resolved.ResolvedIcon;
|
|
37
|
+
exports.RestoreIcon = Restore.RestoreIcon;
|
|
38
|
+
exports.SearchIcon = Search.SearchIcon;
|
|
39
|
+
exports.SendIcon = Send.SendIcon;
|
|
40
|
+
exports.SpinnerIcon = Spinner.SpinnerIcon;
|
|
41
|
+
exports.WarningIcon = Warning.WarningIcon;
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { ArrowDownIcon } from './ArrowDown.mjs';
|
|
2
|
+
export { ArrowUpIcon } from './ArrowUp.mjs';
|
|
3
|
+
export { AttachmentIcon } from './Attachment.mjs';
|
|
4
|
+
export { CheckIcon } from './Check.mjs';
|
|
5
|
+
export { CrossIcon } from './Cross.mjs';
|
|
6
|
+
export { DeleteIcon } from './Delete.mjs';
|
|
7
|
+
export { EditIcon } from './Edit.mjs';
|
|
8
|
+
export { EllipsisIcon } from './Ellipsis.mjs';
|
|
9
|
+
export { EmojiIcon } from './Emoji.mjs';
|
|
10
|
+
export { EmojiAddIcon } from './EmojiAdd.mjs';
|
|
11
|
+
export { MentionIcon } from './Mention.mjs';
|
|
12
|
+
export { ResolveIcon } from './Resolve.mjs';
|
|
13
|
+
export { ResolvedIcon } from './Resolved.mjs';
|
|
14
|
+
export { RestoreIcon } from './Restore.mjs';
|
|
15
|
+
export { SearchIcon } from './Search.mjs';
|
|
16
|
+
export { SendIcon } from './Send.mjs';
|
|
17
|
+
export { SpinnerIcon } from './Spinner.mjs';
|
|
18
|
+
export { WarningIcon } from './Warning.mjs';
|
|
19
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}
|
package/dist/overrides.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -6,6 +7,7 @@ var react = require('react');
|
|
|
6
7
|
var Emoji = require('./components/internal/Emoji.js');
|
|
7
8
|
var pluralize = require('./utils/pluralize.js');
|
|
8
9
|
|
|
10
|
+
|
|
9
11
|
const defaultOverrides = {
|
|
10
12
|
locale: "en",
|
|
11
13
|
dir: "ltr",
|
package/dist/overrides.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overrides.js","sources":["../src/overrides.tsx"],"sourcesContent":["\"use client\";\n\nimport { assertNever } from \"@liveblocks/core\";\nimport type { PropsWithChildren, ReactNode } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\n\nimport { Emoji } from \"./components/internal/Emoji\";\nimport type { ComposerBodyMark, Direction } from \"./types\";\nimport { pluralize } from \"./utils/pluralize\";\n\nexport interface LocalizationOverrides {\n locale: string;\n dir: Direction;\n}\n\nexport interface GlobalOverrides {\n USER_SELF: string;\n USER_UNKNOWN: string;\n LIST_REMAINING: (count: number) => string;\n LIST_REMAINING_USERS: (count: number) => string;\n LIST_REMAINING_COMMENTS: (count: number) => string;\n EMOJI_PICKER_SEARCH_PLACEHOLDER: string;\n EMOJI_PICKER_EMPTY: ReactNode;\n EMOJI_PICKER_ERROR: (error: Error) => ReactNode;\n ATTACHMENT_TOO_LARGE: (maxSize?: string) => string;\n ATTACHMENT_ERROR: (error: Error) => string;\n}\n\nexport interface CommentOverrides {\n COMMENT_EDITED: ReactNode;\n COMMENT_DELETED: ReactNode;\n COMMENT_MORE: string;\n COMMENT_EDIT: string;\n COMMENT_EDIT_COMPOSER_PLACEHOLDER: string;\n COMMENT_EDIT_COMPOSER_CANCEL: string;\n COMMENT_EDIT_COMPOSER_SAVE: string;\n COMMENT_DELETE: string;\n COMMENT_DELETE_ATTACHMENT: string;\n COMMENT_ADD_REACTION: string;\n COMMENT_REACTION_LIST: (\n list: ReactNode,\n emoji: string,\n count: number\n ) => ReactNode;\n COMMENT_REACTION_DESCRIPTION: (emoji: string, count: number) => string;\n}\n\nexport interface ComposerOverrides {\n COMPOSER_INSERT_MENTION: string;\n COMPOSER_INSERT_EMOJI: string;\n COMPOSER_ATTACH_FILES: string;\n COMPOSER_REMOVE_ATTACHMENT: string;\n COMPOSER_PLACEHOLDER: string;\n COMPOSER_SEND: string;\n COMPOSER_TOGGLE_MARK: (mark: ComposerBodyMark) => string;\n}\n\nexport interface ThreadOverrides {\n THREAD_RESOLVE: string;\n THREAD_UNRESOLVE: string;\n THREAD_NEW_INDICATOR: string;\n THREAD_NEW_INDICATOR_DESCRIPTION: string;\n THREAD_COMPOSER_PLACEHOLDER: string;\n THREAD_COMPOSER_SEND: string;\n}\n\nexport interface InboxNotificationOverrides {\n INBOX_NOTIFICATION_MORE: string;\n INBOX_NOTIFICATION_MARK_AS_READ: string;\n INBOX_NOTIFICATION_DELETE: string;\n INBOX_NOTIFICATION_THREAD_COMMENTS_LIST: (\n list: ReactNode,\n room: ReactNode | undefined,\n count: number\n ) => ReactNode;\n INBOX_NOTIFICATION_THREAD_MENTION: (\n user: ReactNode,\n room: ReactNode | undefined\n ) => ReactNode;\n INBOX_NOTIFICATION_TEXT_MENTION: (\n user: ReactNode,\n room: ReactNode | undefined\n ) => ReactNode;\n}\n\nexport interface HistoryVersionPreviewOverrides {\n HISTORY_VERSION_PREVIEW_AUTHORS_LIST: (list: ReactNode) => ReactNode;\n HISTORY_VERSION_PREVIEW_RESTORE: string;\n HISTORY_VERSION_PREVIEW_EMPTY: ReactNode;\n HISTORY_VERSION_PREVIEW_ERROR: (error: Error) => ReactNode;\n}\n\nexport type Overrides = LocalizationOverrides &\n GlobalOverrides &\n ComposerOverrides &\n CommentOverrides &\n ThreadOverrides &\n InboxNotificationOverrides &\n HistoryVersionPreviewOverrides;\n\ntype OverridesProviderProps = PropsWithChildren<{\n overrides?: Partial<Overrides>;\n}>;\n\nexport const defaultOverrides: Overrides = {\n locale: \"en\",\n dir: \"ltr\",\n USER_SELF: \"you\",\n USER_UNKNOWN: \"Anonymous\",\n LIST_REMAINING: (count) => `${count} more`,\n LIST_REMAINING_USERS: (count) => `${count} ${pluralize(count, \"other\")}`,\n LIST_REMAINING_COMMENTS: (count) =>\n `${count} more ${pluralize(count, \"comment\")}`,\n EMOJI_PICKER_SEARCH_PLACEHOLDER: \"Search…\",\n EMOJI_PICKER_EMPTY: \"No emoji found.\",\n EMOJI_PICKER_ERROR: () =>\n \"There was an error while getting the list of emoji.\",\n ATTACHMENT_TOO_LARGE: (maxSize) =>\n maxSize ? `The file is larger than ${maxSize}` : \"The file is too large\",\n ATTACHMENT_ERROR: () => \"The file couldn’t be uploaded.\",\n COMPOSER_INSERT_MENTION: \"Mention someone\",\n COMPOSER_INSERT_EMOJI: \"Add emoji\",\n COMPOSER_ATTACH_FILES: \"Attach files\",\n COMPOSER_REMOVE_ATTACHMENT: \"Remove attachment\",\n COMPOSER_PLACEHOLDER: \"Write a comment…\",\n COMPOSER_SEND: \"Send\",\n COMPOSER_TOGGLE_MARK: (format) => {\n switch (format) {\n case \"bold\":\n return \"Bold\";\n case \"italic\":\n return \"Italic\";\n case \"strikethrough\":\n return \"Strikethrough\";\n case \"code\":\n return \"Inline code\";\n default:\n return assertNever(format, \"Unexpected mark\");\n }\n },\n COMMENT_EDITED: \"(edited)\",\n COMMENT_DELETED: \"This comment has been deleted.\",\n COMMENT_MORE: \"More\",\n COMMENT_EDIT: \"Edit comment\",\n COMMENT_EDIT_COMPOSER_PLACEHOLDER: \"Edit comment…\",\n COMMENT_EDIT_COMPOSER_CANCEL: \"Cancel\",\n COMMENT_EDIT_COMPOSER_SAVE: \"Save\",\n COMMENT_DELETE: \"Delete comment\",\n COMMENT_DELETE_ATTACHMENT: \"Delete attachment\",\n COMMENT_ADD_REACTION: \"Add reaction\",\n COMMENT_REACTION_LIST: (list, emoji) => (\n <>\n {list} reacted with <Emoji emoji={emoji} />\n </>\n ),\n COMMENT_REACTION_DESCRIPTION: (emoji, count) =>\n `${count} ${pluralize(count, \"reaction\")}, react with ${emoji}`,\n THREAD_RESOLVE: \"Resolve thread\",\n THREAD_UNRESOLVE: \"Re-open thread\",\n THREAD_NEW_INDICATOR: \"New\",\n THREAD_NEW_INDICATOR_DESCRIPTION: \"New comments\",\n THREAD_COMPOSER_PLACEHOLDER: \"Reply to thread…\",\n THREAD_COMPOSER_SEND: \"Reply\",\n INBOX_NOTIFICATION_MORE: \"More\",\n INBOX_NOTIFICATION_MARK_AS_READ: \"Mark as read\",\n INBOX_NOTIFICATION_DELETE: \"Delete notification\",\n INBOX_NOTIFICATION_THREAD_COMMENTS_LIST: (\n list: ReactNode,\n room: ReactNode\n ) => (\n <>\n {list} commented\n {room ? <> in {room}</> : <> in a thread</>}\n </>\n ),\n INBOX_NOTIFICATION_THREAD_MENTION: (user: ReactNode, room: ReactNode) => (\n <>\n {user} mentioned you{room ? <> in {room}</> : null}\n </>\n ),\n INBOX_NOTIFICATION_TEXT_MENTION: (user: ReactNode, room: ReactNode) => (\n <>\n {user} mentioned you{room ? <> in {room}</> : null}\n </>\n ),\n HISTORY_VERSION_PREVIEW_AUTHORS_LIST: (list: ReactNode) => (\n <>Edits from {list}</>\n ),\n HISTORY_VERSION_PREVIEW_RESTORE: \"Restore\",\n HISTORY_VERSION_PREVIEW_EMPTY: \"No content.\",\n HISTORY_VERSION_PREVIEW_ERROR: () =>\n \"There was an error while getting this version.\",\n};\n\nexport const OverridesContext = createContext<Overrides | undefined>(undefined);\n\nexport function useOverrides(overrides?: Partial<Overrides>): Overrides {\n const contextOverrides = useContext(OverridesContext);\n\n return useMemo(\n () => ({\n ...defaultOverrides,\n ...contextOverrides,\n ...overrides,\n }),\n [contextOverrides, overrides]\n );\n}\n\nexport function OverridesProvider({\n children,\n overrides: providerOverrides,\n}: OverridesProviderProps) {\n const contextOverrides = useContext(OverridesContext);\n const overrides = useMemo(\n () => ({\n ...defaultOverrides,\n ...contextOverrides,\n ...providerOverrides,\n }),\n [contextOverrides, providerOverrides]\n );\n\n return (\n <OverridesContext.Provider value={overrides}>\n {children}\n </OverridesContext.Provider>\n );\n}\n"],"names":["pluralize","assertNever","jsxs","Fragment","jsx","Emoji","createContext","useContext","useMemo"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"overrides.js","sources":["../src/overrides.tsx"],"sourcesContent":["\"use client\";\n\nimport { assertNever } from \"@liveblocks/core\";\nimport type { PropsWithChildren, ReactNode } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\n\nimport { Emoji } from \"./components/internal/Emoji\";\nimport type { ComposerBodyMark, Direction } from \"./types\";\nimport { pluralize } from \"./utils/pluralize\";\n\nexport interface LocalizationOverrides {\n locale: string;\n dir: Direction;\n}\n\nexport interface GlobalOverrides {\n USER_SELF: string;\n USER_UNKNOWN: string;\n LIST_REMAINING: (count: number) => string;\n LIST_REMAINING_USERS: (count: number) => string;\n LIST_REMAINING_COMMENTS: (count: number) => string;\n EMOJI_PICKER_SEARCH_PLACEHOLDER: string;\n EMOJI_PICKER_EMPTY: ReactNode;\n EMOJI_PICKER_ERROR: (error: Error) => ReactNode;\n ATTACHMENT_TOO_LARGE: (maxSize?: string) => string;\n ATTACHMENT_ERROR: (error: Error) => string;\n}\n\nexport interface CommentOverrides {\n COMMENT_EDITED: ReactNode;\n COMMENT_DELETED: ReactNode;\n COMMENT_MORE: string;\n COMMENT_EDIT: string;\n COMMENT_EDIT_COMPOSER_PLACEHOLDER: string;\n COMMENT_EDIT_COMPOSER_CANCEL: string;\n COMMENT_EDIT_COMPOSER_SAVE: string;\n COMMENT_DELETE: string;\n COMMENT_DELETE_ATTACHMENT: string;\n COMMENT_ADD_REACTION: string;\n COMMENT_REACTION_LIST: (\n list: ReactNode,\n emoji: string,\n count: number\n ) => ReactNode;\n COMMENT_REACTION_DESCRIPTION: (emoji: string, count: number) => string;\n}\n\nexport interface ComposerOverrides {\n COMPOSER_INSERT_MENTION: string;\n COMPOSER_INSERT_EMOJI: string;\n COMPOSER_ATTACH_FILES: string;\n COMPOSER_REMOVE_ATTACHMENT: string;\n COMPOSER_PLACEHOLDER: string;\n COMPOSER_SEND: string;\n COMPOSER_TOGGLE_MARK: (mark: ComposerBodyMark) => string;\n}\n\nexport interface ThreadOverrides {\n THREAD_RESOLVE: string;\n THREAD_UNRESOLVE: string;\n THREAD_NEW_INDICATOR: string;\n THREAD_NEW_INDICATOR_DESCRIPTION: string;\n THREAD_COMPOSER_PLACEHOLDER: string;\n THREAD_COMPOSER_SEND: string;\n}\n\nexport interface InboxNotificationOverrides {\n INBOX_NOTIFICATION_MORE: string;\n INBOX_NOTIFICATION_MARK_AS_READ: string;\n INBOX_NOTIFICATION_DELETE: string;\n INBOX_NOTIFICATION_THREAD_COMMENTS_LIST: (\n list: ReactNode,\n room: ReactNode | undefined,\n count: number\n ) => ReactNode;\n INBOX_NOTIFICATION_THREAD_MENTION: (\n user: ReactNode,\n room: ReactNode | undefined\n ) => ReactNode;\n INBOX_NOTIFICATION_TEXT_MENTION: (\n user: ReactNode,\n room: ReactNode | undefined\n ) => ReactNode;\n}\n\nexport interface HistoryVersionPreviewOverrides {\n HISTORY_VERSION_PREVIEW_AUTHORS_LIST: (list: ReactNode) => ReactNode;\n HISTORY_VERSION_PREVIEW_RESTORE: string;\n HISTORY_VERSION_PREVIEW_EMPTY: ReactNode;\n HISTORY_VERSION_PREVIEW_ERROR: (error: Error) => ReactNode;\n}\n\nexport type Overrides = LocalizationOverrides &\n GlobalOverrides &\n ComposerOverrides &\n CommentOverrides &\n ThreadOverrides &\n InboxNotificationOverrides &\n HistoryVersionPreviewOverrides;\n\ntype OverridesProviderProps = PropsWithChildren<{\n overrides?: Partial<Overrides>;\n}>;\n\nexport const defaultOverrides: Overrides = {\n locale: \"en\",\n dir: \"ltr\",\n USER_SELF: \"you\",\n USER_UNKNOWN: \"Anonymous\",\n LIST_REMAINING: (count) => `${count} more`,\n LIST_REMAINING_USERS: (count) => `${count} ${pluralize(count, \"other\")}`,\n LIST_REMAINING_COMMENTS: (count) =>\n `${count} more ${pluralize(count, \"comment\")}`,\n EMOJI_PICKER_SEARCH_PLACEHOLDER: \"Search…\",\n EMOJI_PICKER_EMPTY: \"No emoji found.\",\n EMOJI_PICKER_ERROR: () =>\n \"There was an error while getting the list of emoji.\",\n ATTACHMENT_TOO_LARGE: (maxSize) =>\n maxSize ? `The file is larger than ${maxSize}` : \"The file is too large\",\n ATTACHMENT_ERROR: () => \"The file couldn’t be uploaded.\",\n COMPOSER_INSERT_MENTION: \"Mention someone\",\n COMPOSER_INSERT_EMOJI: \"Add emoji\",\n COMPOSER_ATTACH_FILES: \"Attach files\",\n COMPOSER_REMOVE_ATTACHMENT: \"Remove attachment\",\n COMPOSER_PLACEHOLDER: \"Write a comment…\",\n COMPOSER_SEND: \"Send\",\n COMPOSER_TOGGLE_MARK: (format) => {\n switch (format) {\n case \"bold\":\n return \"Bold\";\n case \"italic\":\n return \"Italic\";\n case \"strikethrough\":\n return \"Strikethrough\";\n case \"code\":\n return \"Inline code\";\n default:\n return assertNever(format, \"Unexpected mark\");\n }\n },\n COMMENT_EDITED: \"(edited)\",\n COMMENT_DELETED: \"This comment has been deleted.\",\n COMMENT_MORE: \"More\",\n COMMENT_EDIT: \"Edit comment\",\n COMMENT_EDIT_COMPOSER_PLACEHOLDER: \"Edit comment…\",\n COMMENT_EDIT_COMPOSER_CANCEL: \"Cancel\",\n COMMENT_EDIT_COMPOSER_SAVE: \"Save\",\n COMMENT_DELETE: \"Delete comment\",\n COMMENT_DELETE_ATTACHMENT: \"Delete attachment\",\n COMMENT_ADD_REACTION: \"Add reaction\",\n COMMENT_REACTION_LIST: (list, emoji) => (\n <>\n {list} reacted with <Emoji emoji={emoji} />\n </>\n ),\n COMMENT_REACTION_DESCRIPTION: (emoji, count) =>\n `${count} ${pluralize(count, \"reaction\")}, react with ${emoji}`,\n THREAD_RESOLVE: \"Resolve thread\",\n THREAD_UNRESOLVE: \"Re-open thread\",\n THREAD_NEW_INDICATOR: \"New\",\n THREAD_NEW_INDICATOR_DESCRIPTION: \"New comments\",\n THREAD_COMPOSER_PLACEHOLDER: \"Reply to thread…\",\n THREAD_COMPOSER_SEND: \"Reply\",\n INBOX_NOTIFICATION_MORE: \"More\",\n INBOX_NOTIFICATION_MARK_AS_READ: \"Mark as read\",\n INBOX_NOTIFICATION_DELETE: \"Delete notification\",\n INBOX_NOTIFICATION_THREAD_COMMENTS_LIST: (\n list: ReactNode,\n room: ReactNode\n ) => (\n <>\n {list} commented\n {room ? <> in {room}</> : <> in a thread</>}\n </>\n ),\n INBOX_NOTIFICATION_THREAD_MENTION: (user: ReactNode, room: ReactNode) => (\n <>\n {user} mentioned you{room ? <> in {room}</> : null}\n </>\n ),\n INBOX_NOTIFICATION_TEXT_MENTION: (user: ReactNode, room: ReactNode) => (\n <>\n {user} mentioned you{room ? <> in {room}</> : null}\n </>\n ),\n HISTORY_VERSION_PREVIEW_AUTHORS_LIST: (list: ReactNode) => (\n <>Edits from {list}</>\n ),\n HISTORY_VERSION_PREVIEW_RESTORE: \"Restore\",\n HISTORY_VERSION_PREVIEW_EMPTY: \"No content.\",\n HISTORY_VERSION_PREVIEW_ERROR: () =>\n \"There was an error while getting this version.\",\n};\n\nexport const OverridesContext = createContext<Overrides | undefined>(undefined);\n\nexport function useOverrides(overrides?: Partial<Overrides>): Overrides {\n const contextOverrides = useContext(OverridesContext);\n\n return useMemo(\n () => ({\n ...defaultOverrides,\n ...contextOverrides,\n ...overrides,\n }),\n [contextOverrides, overrides]\n );\n}\n\nexport function OverridesProvider({\n children,\n overrides: providerOverrides,\n}: OverridesProviderProps) {\n const contextOverrides = useContext(OverridesContext);\n const overrides = useMemo(\n () => ({\n ...defaultOverrides,\n ...contextOverrides,\n ...providerOverrides,\n }),\n [contextOverrides, providerOverrides]\n );\n\n return (\n <OverridesContext.Provider value={overrides}>\n {children}\n </OverridesContext.Provider>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AAAA;AAwGO;AAAoC;AACjC;AACH;AACM;AACG;AACgB;AACuC;AAExB;AACZ;AACb;AAElB;AAEiD;AAC3B;AACC;AACF;AACA;AACK;AACN;AACP;AAEb;AAAgB;AAEZ;AAAO;AAEP;AAAO;AAEP;AAAO;AAEP;AAAO;AAEP;AAA4C;AAChD;AACF;AACgB;AACC;AACH;AACA;AACqB;AACL;AACF;AACZ;AACW;AACL;AAEpB;AACG;AAAA;AAAK;AAAe;AAAM;AAAc;AAAA;AAC3C;AAGwD;AAC1C;AACE;AACI;AACY;AACL;AACP;AACG;AACQ;AACN;AAKzB;AACG;AAAA;AAAK;AACE;AAAE;AAAA;AAAK;AAAA;AAAW;AAAE;AAAY;AAAA;AAC1C;AAGA;AACG;AAAA;AAAK;AAAsB;AAAE;AAAA;AAAK;AAAA;AAAW;AAAA;AAChD;AAGA;AACG;AAAA;AAAK;AAAsB;AAAE;AAAA;AAAK;AAAA;AAAW;AAAA;AAChD;AAGA;AAAE;AAAA;AAAY;AAAA;AAAK;AAEY;AACF;AAGjC;AAEa;AAEN;AACL;AAEA;AAAO;AACE;AACF;AACA;AACA;AACL;AAC4B;AAEhC;AAEO;AAA2B;AAChC;AAEF;AACE;AACA;AAAkB;AACT;AACF;AACA;AACA;AACL;AACoC;AAGtC;AACG;AAAiC;AAC/B;AAGP;;;;;"}
|
package/dist/overrides.mjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { assertNever } from '@liveblocks/core';
|
|
3
4
|
import { createContext, useContext, useMemo } from 'react';
|
|
4
5
|
import { Emoji } from './components/internal/Emoji.mjs';
|
|
5
6
|
import { pluralize } from './utils/pluralize.mjs';
|
|
6
7
|
|
|
8
|
+
|
|
7
9
|
const defaultOverrides = {
|
|
8
10
|
locale: "en",
|
|
9
11
|
dir: "ltr",
|
package/dist/overrides.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"overrides.mjs","sources":["../src/overrides.tsx"],"sourcesContent":["\"use client\";\n\nimport { assertNever } from \"@liveblocks/core\";\nimport type { PropsWithChildren, ReactNode } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\n\nimport { Emoji } from \"./components/internal/Emoji\";\nimport type { ComposerBodyMark, Direction } from \"./types\";\nimport { pluralize } from \"./utils/pluralize\";\n\nexport interface LocalizationOverrides {\n locale: string;\n dir: Direction;\n}\n\nexport interface GlobalOverrides {\n USER_SELF: string;\n USER_UNKNOWN: string;\n LIST_REMAINING: (count: number) => string;\n LIST_REMAINING_USERS: (count: number) => string;\n LIST_REMAINING_COMMENTS: (count: number) => string;\n EMOJI_PICKER_SEARCH_PLACEHOLDER: string;\n EMOJI_PICKER_EMPTY: ReactNode;\n EMOJI_PICKER_ERROR: (error: Error) => ReactNode;\n ATTACHMENT_TOO_LARGE: (maxSize?: string) => string;\n ATTACHMENT_ERROR: (error: Error) => string;\n}\n\nexport interface CommentOverrides {\n COMMENT_EDITED: ReactNode;\n COMMENT_DELETED: ReactNode;\n COMMENT_MORE: string;\n COMMENT_EDIT: string;\n COMMENT_EDIT_COMPOSER_PLACEHOLDER: string;\n COMMENT_EDIT_COMPOSER_CANCEL: string;\n COMMENT_EDIT_COMPOSER_SAVE: string;\n COMMENT_DELETE: string;\n COMMENT_DELETE_ATTACHMENT: string;\n COMMENT_ADD_REACTION: string;\n COMMENT_REACTION_LIST: (\n list: ReactNode,\n emoji: string,\n count: number\n ) => ReactNode;\n COMMENT_REACTION_DESCRIPTION: (emoji: string, count: number) => string;\n}\n\nexport interface ComposerOverrides {\n COMPOSER_INSERT_MENTION: string;\n COMPOSER_INSERT_EMOJI: string;\n COMPOSER_ATTACH_FILES: string;\n COMPOSER_REMOVE_ATTACHMENT: string;\n COMPOSER_PLACEHOLDER: string;\n COMPOSER_SEND: string;\n COMPOSER_TOGGLE_MARK: (mark: ComposerBodyMark) => string;\n}\n\nexport interface ThreadOverrides {\n THREAD_RESOLVE: string;\n THREAD_UNRESOLVE: string;\n THREAD_NEW_INDICATOR: string;\n THREAD_NEW_INDICATOR_DESCRIPTION: string;\n THREAD_COMPOSER_PLACEHOLDER: string;\n THREAD_COMPOSER_SEND: string;\n}\n\nexport interface InboxNotificationOverrides {\n INBOX_NOTIFICATION_MORE: string;\n INBOX_NOTIFICATION_MARK_AS_READ: string;\n INBOX_NOTIFICATION_DELETE: string;\n INBOX_NOTIFICATION_THREAD_COMMENTS_LIST: (\n list: ReactNode,\n room: ReactNode | undefined,\n count: number\n ) => ReactNode;\n INBOX_NOTIFICATION_THREAD_MENTION: (\n user: ReactNode,\n room: ReactNode | undefined\n ) => ReactNode;\n INBOX_NOTIFICATION_TEXT_MENTION: (\n user: ReactNode,\n room: ReactNode | undefined\n ) => ReactNode;\n}\n\nexport interface HistoryVersionPreviewOverrides {\n HISTORY_VERSION_PREVIEW_AUTHORS_LIST: (list: ReactNode) => ReactNode;\n HISTORY_VERSION_PREVIEW_RESTORE: string;\n HISTORY_VERSION_PREVIEW_EMPTY: ReactNode;\n HISTORY_VERSION_PREVIEW_ERROR: (error: Error) => ReactNode;\n}\n\nexport type Overrides = LocalizationOverrides &\n GlobalOverrides &\n ComposerOverrides &\n CommentOverrides &\n ThreadOverrides &\n InboxNotificationOverrides &\n HistoryVersionPreviewOverrides;\n\ntype OverridesProviderProps = PropsWithChildren<{\n overrides?: Partial<Overrides>;\n}>;\n\nexport const defaultOverrides: Overrides = {\n locale: \"en\",\n dir: \"ltr\",\n USER_SELF: \"you\",\n USER_UNKNOWN: \"Anonymous\",\n LIST_REMAINING: (count) => `${count} more`,\n LIST_REMAINING_USERS: (count) => `${count} ${pluralize(count, \"other\")}`,\n LIST_REMAINING_COMMENTS: (count) =>\n `${count} more ${pluralize(count, \"comment\")}`,\n EMOJI_PICKER_SEARCH_PLACEHOLDER: \"Search…\",\n EMOJI_PICKER_EMPTY: \"No emoji found.\",\n EMOJI_PICKER_ERROR: () =>\n \"There was an error while getting the list of emoji.\",\n ATTACHMENT_TOO_LARGE: (maxSize) =>\n maxSize ? `The file is larger than ${maxSize}` : \"The file is too large\",\n ATTACHMENT_ERROR: () => \"The file couldn’t be uploaded.\",\n COMPOSER_INSERT_MENTION: \"Mention someone\",\n COMPOSER_INSERT_EMOJI: \"Add emoji\",\n COMPOSER_ATTACH_FILES: \"Attach files\",\n COMPOSER_REMOVE_ATTACHMENT: \"Remove attachment\",\n COMPOSER_PLACEHOLDER: \"Write a comment…\",\n COMPOSER_SEND: \"Send\",\n COMPOSER_TOGGLE_MARK: (format) => {\n switch (format) {\n case \"bold\":\n return \"Bold\";\n case \"italic\":\n return \"Italic\";\n case \"strikethrough\":\n return \"Strikethrough\";\n case \"code\":\n return \"Inline code\";\n default:\n return assertNever(format, \"Unexpected mark\");\n }\n },\n COMMENT_EDITED: \"(edited)\",\n COMMENT_DELETED: \"This comment has been deleted.\",\n COMMENT_MORE: \"More\",\n COMMENT_EDIT: \"Edit comment\",\n COMMENT_EDIT_COMPOSER_PLACEHOLDER: \"Edit comment…\",\n COMMENT_EDIT_COMPOSER_CANCEL: \"Cancel\",\n COMMENT_EDIT_COMPOSER_SAVE: \"Save\",\n COMMENT_DELETE: \"Delete comment\",\n COMMENT_DELETE_ATTACHMENT: \"Delete attachment\",\n COMMENT_ADD_REACTION: \"Add reaction\",\n COMMENT_REACTION_LIST: (list, emoji) => (\n <>\n {list} reacted with <Emoji emoji={emoji} />\n </>\n ),\n COMMENT_REACTION_DESCRIPTION: (emoji, count) =>\n `${count} ${pluralize(count, \"reaction\")}, react with ${emoji}`,\n THREAD_RESOLVE: \"Resolve thread\",\n THREAD_UNRESOLVE: \"Re-open thread\",\n THREAD_NEW_INDICATOR: \"New\",\n THREAD_NEW_INDICATOR_DESCRIPTION: \"New comments\",\n THREAD_COMPOSER_PLACEHOLDER: \"Reply to thread…\",\n THREAD_COMPOSER_SEND: \"Reply\",\n INBOX_NOTIFICATION_MORE: \"More\",\n INBOX_NOTIFICATION_MARK_AS_READ: \"Mark as read\",\n INBOX_NOTIFICATION_DELETE: \"Delete notification\",\n INBOX_NOTIFICATION_THREAD_COMMENTS_LIST: (\n list: ReactNode,\n room: ReactNode\n ) => (\n <>\n {list} commented\n {room ? <> in {room}</> : <> in a thread</>}\n </>\n ),\n INBOX_NOTIFICATION_THREAD_MENTION: (user: ReactNode, room: ReactNode) => (\n <>\n {user} mentioned you{room ? <> in {room}</> : null}\n </>\n ),\n INBOX_NOTIFICATION_TEXT_MENTION: (user: ReactNode, room: ReactNode) => (\n <>\n {user} mentioned you{room ? <> in {room}</> : null}\n </>\n ),\n HISTORY_VERSION_PREVIEW_AUTHORS_LIST: (list: ReactNode) => (\n <>Edits from {list}</>\n ),\n HISTORY_VERSION_PREVIEW_RESTORE: \"Restore\",\n HISTORY_VERSION_PREVIEW_EMPTY: \"No content.\",\n HISTORY_VERSION_PREVIEW_ERROR: () =>\n \"There was an error while getting this version.\",\n};\n\nexport const OverridesContext = createContext<Overrides | undefined>(undefined);\n\nexport function useOverrides(overrides?: Partial<Overrides>): Overrides {\n const contextOverrides = useContext(OverridesContext);\n\n return useMemo(\n () => ({\n ...defaultOverrides,\n ...contextOverrides,\n ...overrides,\n }),\n [contextOverrides, overrides]\n );\n}\n\nexport function OverridesProvider({\n children,\n overrides: providerOverrides,\n}: OverridesProviderProps) {\n const contextOverrides = useContext(OverridesContext);\n const overrides = useMemo(\n () => ({\n ...defaultOverrides,\n ...contextOverrides,\n ...providerOverrides,\n }),\n [contextOverrides, providerOverrides]\n );\n\n return (\n <OverridesContext.Provider value={overrides}>\n {children}\n </OverridesContext.Provider>\n );\n}\n"],"names":[],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"overrides.mjs","sources":["../src/overrides.tsx"],"sourcesContent":["\"use client\";\n\nimport { assertNever } from \"@liveblocks/core\";\nimport type { PropsWithChildren, ReactNode } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\n\nimport { Emoji } from \"./components/internal/Emoji\";\nimport type { ComposerBodyMark, Direction } from \"./types\";\nimport { pluralize } from \"./utils/pluralize\";\n\nexport interface LocalizationOverrides {\n locale: string;\n dir: Direction;\n}\n\nexport interface GlobalOverrides {\n USER_SELF: string;\n USER_UNKNOWN: string;\n LIST_REMAINING: (count: number) => string;\n LIST_REMAINING_USERS: (count: number) => string;\n LIST_REMAINING_COMMENTS: (count: number) => string;\n EMOJI_PICKER_SEARCH_PLACEHOLDER: string;\n EMOJI_PICKER_EMPTY: ReactNode;\n EMOJI_PICKER_ERROR: (error: Error) => ReactNode;\n ATTACHMENT_TOO_LARGE: (maxSize?: string) => string;\n ATTACHMENT_ERROR: (error: Error) => string;\n}\n\nexport interface CommentOverrides {\n COMMENT_EDITED: ReactNode;\n COMMENT_DELETED: ReactNode;\n COMMENT_MORE: string;\n COMMENT_EDIT: string;\n COMMENT_EDIT_COMPOSER_PLACEHOLDER: string;\n COMMENT_EDIT_COMPOSER_CANCEL: string;\n COMMENT_EDIT_COMPOSER_SAVE: string;\n COMMENT_DELETE: string;\n COMMENT_DELETE_ATTACHMENT: string;\n COMMENT_ADD_REACTION: string;\n COMMENT_REACTION_LIST: (\n list: ReactNode,\n emoji: string,\n count: number\n ) => ReactNode;\n COMMENT_REACTION_DESCRIPTION: (emoji: string, count: number) => string;\n}\n\nexport interface ComposerOverrides {\n COMPOSER_INSERT_MENTION: string;\n COMPOSER_INSERT_EMOJI: string;\n COMPOSER_ATTACH_FILES: string;\n COMPOSER_REMOVE_ATTACHMENT: string;\n COMPOSER_PLACEHOLDER: string;\n COMPOSER_SEND: string;\n COMPOSER_TOGGLE_MARK: (mark: ComposerBodyMark) => string;\n}\n\nexport interface ThreadOverrides {\n THREAD_RESOLVE: string;\n THREAD_UNRESOLVE: string;\n THREAD_NEW_INDICATOR: string;\n THREAD_NEW_INDICATOR_DESCRIPTION: string;\n THREAD_COMPOSER_PLACEHOLDER: string;\n THREAD_COMPOSER_SEND: string;\n}\n\nexport interface InboxNotificationOverrides {\n INBOX_NOTIFICATION_MORE: string;\n INBOX_NOTIFICATION_MARK_AS_READ: string;\n INBOX_NOTIFICATION_DELETE: string;\n INBOX_NOTIFICATION_THREAD_COMMENTS_LIST: (\n list: ReactNode,\n room: ReactNode | undefined,\n count: number\n ) => ReactNode;\n INBOX_NOTIFICATION_THREAD_MENTION: (\n user: ReactNode,\n room: ReactNode | undefined\n ) => ReactNode;\n INBOX_NOTIFICATION_TEXT_MENTION: (\n user: ReactNode,\n room: ReactNode | undefined\n ) => ReactNode;\n}\n\nexport interface HistoryVersionPreviewOverrides {\n HISTORY_VERSION_PREVIEW_AUTHORS_LIST: (list: ReactNode) => ReactNode;\n HISTORY_VERSION_PREVIEW_RESTORE: string;\n HISTORY_VERSION_PREVIEW_EMPTY: ReactNode;\n HISTORY_VERSION_PREVIEW_ERROR: (error: Error) => ReactNode;\n}\n\nexport type Overrides = LocalizationOverrides &\n GlobalOverrides &\n ComposerOverrides &\n CommentOverrides &\n ThreadOverrides &\n InboxNotificationOverrides &\n HistoryVersionPreviewOverrides;\n\ntype OverridesProviderProps = PropsWithChildren<{\n overrides?: Partial<Overrides>;\n}>;\n\nexport const defaultOverrides: Overrides = {\n locale: \"en\",\n dir: \"ltr\",\n USER_SELF: \"you\",\n USER_UNKNOWN: \"Anonymous\",\n LIST_REMAINING: (count) => `${count} more`,\n LIST_REMAINING_USERS: (count) => `${count} ${pluralize(count, \"other\")}`,\n LIST_REMAINING_COMMENTS: (count) =>\n `${count} more ${pluralize(count, \"comment\")}`,\n EMOJI_PICKER_SEARCH_PLACEHOLDER: \"Search…\",\n EMOJI_PICKER_EMPTY: \"No emoji found.\",\n EMOJI_PICKER_ERROR: () =>\n \"There was an error while getting the list of emoji.\",\n ATTACHMENT_TOO_LARGE: (maxSize) =>\n maxSize ? `The file is larger than ${maxSize}` : \"The file is too large\",\n ATTACHMENT_ERROR: () => \"The file couldn’t be uploaded.\",\n COMPOSER_INSERT_MENTION: \"Mention someone\",\n COMPOSER_INSERT_EMOJI: \"Add emoji\",\n COMPOSER_ATTACH_FILES: \"Attach files\",\n COMPOSER_REMOVE_ATTACHMENT: \"Remove attachment\",\n COMPOSER_PLACEHOLDER: \"Write a comment…\",\n COMPOSER_SEND: \"Send\",\n COMPOSER_TOGGLE_MARK: (format) => {\n switch (format) {\n case \"bold\":\n return \"Bold\";\n case \"italic\":\n return \"Italic\";\n case \"strikethrough\":\n return \"Strikethrough\";\n case \"code\":\n return \"Inline code\";\n default:\n return assertNever(format, \"Unexpected mark\");\n }\n },\n COMMENT_EDITED: \"(edited)\",\n COMMENT_DELETED: \"This comment has been deleted.\",\n COMMENT_MORE: \"More\",\n COMMENT_EDIT: \"Edit comment\",\n COMMENT_EDIT_COMPOSER_PLACEHOLDER: \"Edit comment…\",\n COMMENT_EDIT_COMPOSER_CANCEL: \"Cancel\",\n COMMENT_EDIT_COMPOSER_SAVE: \"Save\",\n COMMENT_DELETE: \"Delete comment\",\n COMMENT_DELETE_ATTACHMENT: \"Delete attachment\",\n COMMENT_ADD_REACTION: \"Add reaction\",\n COMMENT_REACTION_LIST: (list, emoji) => (\n <>\n {list} reacted with <Emoji emoji={emoji} />\n </>\n ),\n COMMENT_REACTION_DESCRIPTION: (emoji, count) =>\n `${count} ${pluralize(count, \"reaction\")}, react with ${emoji}`,\n THREAD_RESOLVE: \"Resolve thread\",\n THREAD_UNRESOLVE: \"Re-open thread\",\n THREAD_NEW_INDICATOR: \"New\",\n THREAD_NEW_INDICATOR_DESCRIPTION: \"New comments\",\n THREAD_COMPOSER_PLACEHOLDER: \"Reply to thread…\",\n THREAD_COMPOSER_SEND: \"Reply\",\n INBOX_NOTIFICATION_MORE: \"More\",\n INBOX_NOTIFICATION_MARK_AS_READ: \"Mark as read\",\n INBOX_NOTIFICATION_DELETE: \"Delete notification\",\n INBOX_NOTIFICATION_THREAD_COMMENTS_LIST: (\n list: ReactNode,\n room: ReactNode\n ) => (\n <>\n {list} commented\n {room ? <> in {room}</> : <> in a thread</>}\n </>\n ),\n INBOX_NOTIFICATION_THREAD_MENTION: (user: ReactNode, room: ReactNode) => (\n <>\n {user} mentioned you{room ? <> in {room}</> : null}\n </>\n ),\n INBOX_NOTIFICATION_TEXT_MENTION: (user: ReactNode, room: ReactNode) => (\n <>\n {user} mentioned you{room ? <> in {room}</> : null}\n </>\n ),\n HISTORY_VERSION_PREVIEW_AUTHORS_LIST: (list: ReactNode) => (\n <>Edits from {list}</>\n ),\n HISTORY_VERSION_PREVIEW_RESTORE: \"Restore\",\n HISTORY_VERSION_PREVIEW_EMPTY: \"No content.\",\n HISTORY_VERSION_PREVIEW_ERROR: () =>\n \"There was an error while getting this version.\",\n};\n\nexport const OverridesContext = createContext<Overrides | undefined>(undefined);\n\nexport function useOverrides(overrides?: Partial<Overrides>): Overrides {\n const contextOverrides = useContext(OverridesContext);\n\n return useMemo(\n () => ({\n ...defaultOverrides,\n ...contextOverrides,\n ...overrides,\n }),\n [contextOverrides, overrides]\n );\n}\n\nexport function OverridesProvider({\n children,\n overrides: providerOverrides,\n}: OverridesProviderProps) {\n const contextOverrides = useContext(OverridesContext);\n const overrides = useMemo(\n () => ({\n ...defaultOverrides,\n ...contextOverrides,\n ...providerOverrides,\n }),\n [contextOverrides, providerOverrides]\n );\n\n return (\n <OverridesContext.Provider value={overrides}>\n {children}\n </OverridesContext.Provider>\n );\n}\n"],"names":[],"mappings":";;;;;;;AAAA;AAwGO;AAAoC;AACjC;AACH;AACM;AACG;AACgB;AACuC;AAExB;AACZ;AACb;AAElB;AAEiD;AAC3B;AACC;AACF;AACA;AACK;AACN;AACP;AAEb;AAAgB;AAEZ;AAAO;AAEP;AAAO;AAEP;AAAO;AAEP;AAAO;AAEP;AAA4C;AAChD;AACF;AACgB;AACC;AACH;AACA;AACqB;AACL;AACF;AACZ;AACW;AACL;AAEpB;AACG;AAAA;AAAK;AAAe;AAAM;AAAc;AAAA;AAC3C;AAGwD;AAC1C;AACE;AACI;AACY;AACL;AACP;AACG;AACQ;AACN;AAKzB;AACG;AAAA;AAAK;AACE;AAAE;AAAA;AAAK;AAAA;AAAW;AAAE;AAAY;AAAA;AAC1C;AAGA;AACG;AAAA;AAAK;AAAsB;AAAE;AAAA;AAAK;AAAA;AAAW;AAAA;AAChD;AAGA;AACG;AAAA;AAAK;AAAsB;AAAE;AAAA;AAAK;AAAA;AAAW;AAAA;AAChD;AAGA;AAAE;AAAA;AAAY;AAAA;AAAK;AAEY;AACF;AAGjC;AAEa;AAEN;AACL;AAEA;AAAO;AACE;AACF;AACA;AACA;AACL;AAC4B;AAEhC;AAEO;AAA2B;AAChC;AAEF;AACE;AACA;AAAkB;AACT;AACF;AACA;AACA;AACL;AACoC;AAGtC;AACG;AAAiC;AAC/B;AAGP;;"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use client";
|
|
1
2
|
'use strict';
|
|
2
3
|
|
|
3
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
@@ -28,9 +29,9 @@ var useIndex = require('../../utils/use-index.js');
|
|
|
28
29
|
var useInitial = require('../../utils/use-initial.js');
|
|
29
30
|
var useObservable = require('../../utils/use-observable.js');
|
|
30
31
|
var useRefs = require('../../utils/use-refs.js');
|
|
31
|
-
var utils
|
|
32
|
+
var utils = require('../Comment/utils.js');
|
|
32
33
|
var contexts = require('./contexts.js');
|
|
33
|
-
var utils = require('./utils.js');
|
|
34
|
+
var utils$1 = require('./utils.js');
|
|
34
35
|
|
|
35
36
|
function _interopNamespaceDefault(e) {
|
|
36
37
|
var n = Object.create(null);
|
|
@@ -51,6 +52,7 @@ function _interopNamespaceDefault(e) {
|
|
|
51
52
|
|
|
52
53
|
var TogglePrimitive__namespace = /*#__PURE__*/_interopNamespaceDefault(TogglePrimitive);
|
|
53
54
|
|
|
55
|
+
|
|
54
56
|
const MENTION_SUGGESTIONS_POSITION = "top";
|
|
55
57
|
const FLOATING_TOOLBAR_POSITION = "top";
|
|
56
58
|
const COMPOSER_MENTION_NAME = "ComposerMention";
|
|
@@ -115,7 +117,7 @@ function ComposerEditorLinkWrapper({
|
|
|
115
117
|
children
|
|
116
118
|
}) {
|
|
117
119
|
const href = react.useMemo(
|
|
118
|
-
() => utils
|
|
120
|
+
() => utils.toAbsoluteUrl(element.url) ?? element.url,
|
|
119
121
|
[element.url]
|
|
120
122
|
);
|
|
121
123
|
return /* @__PURE__ */ jsxRuntime.jsx("span", {
|
|
@@ -143,7 +145,7 @@ function ComposerEditorMentionSuggestionsWrapper({
|
|
|
143
145
|
const { onEditorChange } = contexts.useComposerEditorContext();
|
|
144
146
|
const { isFocused } = contexts.useComposer();
|
|
145
147
|
const { portalContainer } = config.useLiveblocksUIConfig();
|
|
146
|
-
const [contentRef, contentZIndex] = utils.useContentZIndex();
|
|
148
|
+
const [contentRef, contentZIndex] = utils$1.useContentZIndex();
|
|
147
149
|
const isOpen = isFocused && mentionDraft?.range !== void 0 && userIds !== void 0;
|
|
148
150
|
const {
|
|
149
151
|
refs: { setReference, setFloating },
|
|
@@ -152,7 +154,7 @@ function ComposerEditorMentionSuggestionsWrapper({
|
|
|
152
154
|
placement,
|
|
153
155
|
x,
|
|
154
156
|
y
|
|
155
|
-
} = utils.useFloatingWithOptions({
|
|
157
|
+
} = utils$1.useFloatingWithOptions({
|
|
156
158
|
position,
|
|
157
159
|
dir,
|
|
158
160
|
alignment: "start",
|
|
@@ -212,7 +214,7 @@ function ComposerEditorFloatingToolbarWrapper({
|
|
|
212
214
|
const { onEditorChange } = contexts.useComposerEditorContext();
|
|
213
215
|
const { isFocused } = contexts.useComposer();
|
|
214
216
|
const { portalContainer } = config.useLiveblocksUIConfig();
|
|
215
|
-
const [contentRef, contentZIndex] = utils.useContentZIndex();
|
|
217
|
+
const [contentRef, contentZIndex] = utils$1.useContentZIndex();
|
|
216
218
|
const [isPointerDown, setPointerDown] = react.useState(false);
|
|
217
219
|
const isOpen = isFocused && !isPointerDown && hasFloatingToolbarRange;
|
|
218
220
|
const {
|
|
@@ -222,7 +224,7 @@ function ComposerEditorFloatingToolbarWrapper({
|
|
|
222
224
|
placement,
|
|
223
225
|
x,
|
|
224
226
|
y
|
|
225
|
-
} = utils.useFloatingWithOptions({
|
|
227
|
+
} = utils$1.useFloatingWithOptions({
|
|
226
228
|
type: "range",
|
|
227
229
|
position,
|
|
228
230
|
dir,
|
|
@@ -291,7 +293,7 @@ const ComposerFloatingToolbar = react.forwardRef(({ children, onPointerDown, sty
|
|
|
291
293
|
} = contexts.useComposerFloatingToolbarContext(COMPOSER_FLOATING_TOOLBAR_NAME);
|
|
292
294
|
const mergedRefs = useRefs.useRefs(forwardedRef, contentRef, ref);
|
|
293
295
|
const [side, align] = react.useMemo(
|
|
294
|
-
() => utils.getSideAndAlignFromFloatingPlacement(placement),
|
|
296
|
+
() => utils$1.getSideAndAlignFromFloatingPlacement(placement),
|
|
295
297
|
[placement]
|
|
296
298
|
);
|
|
297
299
|
const Component = asChild ? reactSlot.Slot : "div";
|
|
@@ -425,7 +427,7 @@ const ComposerSuggestions = react.forwardRef(({ children, style, asChild, ...pro
|
|
|
425
427
|
} = contexts.useComposerSuggestionsContext(COMPOSER_SUGGESTIONS_NAME);
|
|
426
428
|
const mergedRefs = useRefs.useRefs(forwardedRef, contentRef, ref);
|
|
427
429
|
const [side, align] = react.useMemo(
|
|
428
|
-
() => utils.getSideAndAlignFromFloatingPlacement(placement),
|
|
430
|
+
() => utils$1.getSideAndAlignFromFloatingPlacement(placement),
|
|
429
431
|
[placement]
|
|
430
432
|
);
|
|
431
433
|
const Component = asChild ? reactSlot.Slot : "div";
|
|
@@ -578,7 +580,7 @@ const ComposerEditor = react.forwardRef(
|
|
|
578
580
|
const isDisabled = isComposerDisabled || disabled;
|
|
579
581
|
const initialBody = useInitial.useInitial(defaultValue ?? emptyCommentBody);
|
|
580
582
|
const initialEditorValue = react.useMemo(() => {
|
|
581
|
-
return utils.commentBodyToComposerBody(initialBody);
|
|
583
|
+
return utils$1.commentBodyToComposerBody(initialBody);
|
|
582
584
|
}, [initialBody]);
|
|
583
585
|
const { Link, Mention, MentionSuggestions, FloatingToolbar } = react.useMemo(
|
|
584
586
|
() => ({ ...defaultEditorComponents, ...components }),
|
|
@@ -881,7 +883,7 @@ const ComposerForm = react.forwardRef(
|
|
|
881
883
|
addAttachments,
|
|
882
884
|
removeAttachment,
|
|
883
885
|
clearAttachments
|
|
884
|
-
} = utils.useComposerAttachmentsManager(defaultAttachments, {
|
|
886
|
+
} = utils$1.useComposerAttachmentsManager(defaultAttachments, {
|
|
885
887
|
maxFileSize: maxAttachmentSize,
|
|
886
888
|
roomId
|
|
887
889
|
});
|
|
@@ -1033,7 +1035,7 @@ const ComposerForm = react.forwardRef(
|
|
|
1033
1035
|
event.preventDefault();
|
|
1034
1036
|
return;
|
|
1035
1037
|
}
|
|
1036
|
-
const body = utils.composerBodyToCommentBody(
|
|
1038
|
+
const body = utils$1.composerBodyToCommentBody(
|
|
1037
1039
|
editor.children
|
|
1038
1040
|
);
|
|
1039
1041
|
const commentAttachments = attachments.filter(
|
|
@@ -1182,7 +1184,7 @@ const ComposerAttachmentsDropArea = react.forwardRef(
|
|
|
1182
1184
|
const Component = asChild ? reactSlot.Slot : "div";
|
|
1183
1185
|
const { isDisabled: isComposerDisabled } = contexts.useComposer();
|
|
1184
1186
|
const isDisabled = isComposerDisabled || disabled;
|
|
1185
|
-
const [, dropAreaProps] = utils.useComposerAttachmentsDropArea({
|
|
1187
|
+
const [, dropAreaProps] = utils$1.useComposerAttachmentsDropArea({
|
|
1186
1188
|
onDragEnter,
|
|
1187
1189
|
onDragLeave,
|
|
1188
1190
|
onDragOver,
|