@liveblocks/react-ui 2.8.3-tiptap1 → 2.9.0-rc1
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/components/InboxNotificationList.js +19 -2
- package/dist/components/InboxNotificationList.js.map +1 -1
- package/dist/components/InboxNotificationList.mjs +20 -3
- package/dist/components/InboxNotificationList.mjs.map +1 -1
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -3,8 +3,22 @@
|
|
|
3
3
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var classNames = require('../utils/class-names.js');
|
|
6
|
+
var useVisible = require('../utils/use-visible.js');
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
function ReachEndMarker({
|
|
9
|
+
enabled,
|
|
10
|
+
onReachEnd
|
|
11
|
+
}) {
|
|
12
|
+
const markerRef = React.useRef(null);
|
|
13
|
+
useVisible.useVisibleCallback(markerRef, onReachEnd, {
|
|
14
|
+
enabled
|
|
15
|
+
});
|
|
16
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
17
|
+
ref: markerRef,
|
|
18
|
+
style: { height: 0 }
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
const InboxNotificationList = React.forwardRef(({ onReachEnd, children, className, ...props }, forwardedRef) => {
|
|
8
22
|
return /* @__PURE__ */ React.createElement("ol", {
|
|
9
23
|
className: classNames.classNames("lb-root lb-inbox-notification-list", className),
|
|
10
24
|
...props,
|
|
@@ -12,7 +26,10 @@ const InboxNotificationList = React.forwardRef(({ children, className, ...props
|
|
|
12
26
|
}, React.Children.map(children, (child, index) => /* @__PURE__ */ React.createElement("li", {
|
|
13
27
|
key: index,
|
|
14
28
|
className: "lb-inbox-notification-list-item"
|
|
15
|
-
}, child))
|
|
29
|
+
}, child)), onReachEnd && /* @__PURE__ */ React.createElement(ReachEndMarker, {
|
|
30
|
+
onReachEnd,
|
|
31
|
+
enabled: React.Children.count(children) > 0
|
|
32
|
+
}));
|
|
16
33
|
});
|
|
17
34
|
|
|
18
35
|
exports.InboxNotificationList = InboxNotificationList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InboxNotificationList.js","sources":["../../src/components/InboxNotificationList.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport React, { Children, forwardRef } from \"react\";\n\nimport { classNames } from \"../utils/class-names\";\n\nexport
|
|
1
|
+
{"version":3,"file":"InboxNotificationList.js","sources":["../../src/components/InboxNotificationList.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport React, { Children, forwardRef, useRef } from \"react\";\n\nimport { classNames } from \"../utils/class-names\";\nimport { useVisibleCallback } from \"../utils/use-visible\";\n\nexport interface InboxNotificationListProps\n extends ComponentPropsWithoutRef<\"ol\"> {\n onReachEnd?: () => void;\n}\n\nfunction ReachEndMarker({\n enabled,\n onReachEnd,\n}: {\n enabled: boolean;\n onReachEnd: () => void;\n}) {\n const markerRef = useRef<HTMLDivElement>(null);\n\n useVisibleCallback(markerRef, onReachEnd, {\n enabled,\n });\n\n return <div ref={markerRef} style={{ height: 0 }} />;\n}\n\n/**\n * Displays inbox notifications as a list.\n *\n * @example\n * <InboxNotificationList>\n * {inboxNotifications.map((inboxNotification) => (\n * <InboxNotification key={inboxNotification.id} inboxNotification={inboxNotification} />\n * ))}\n * </InboxNotificationList>\n */\nexport const InboxNotificationList = forwardRef<\n HTMLOListElement,\n InboxNotificationListProps\n>(({ onReachEnd, children, className, ...props }, forwardedRef) => {\n return (\n <ol\n className={classNames(\"lb-root lb-inbox-notification-list\", className)}\n {...props}\n ref={forwardedRef}\n >\n {Children.map(children, (child, index) => (\n <li key={index} className=\"lb-inbox-notification-list-item\">\n {child}\n </li>\n ))}\n {/* Render an invisible marker at the end which is tied to an IntersectionObserver to be alerted when the end of the list has been reached */}\n {onReachEnd && (\n <ReachEndMarker\n onReachEnd={onReachEnd}\n enabled={Children.count(children) > 0}\n />\n )}\n </ol>\n );\n});\n"],"names":[],"mappings":";;;;;;;AAaA;AAAwB;AACtB;AAEF;AAIE;AAEA;AAA0C;AACxC;AAGF;AAAQ;AAAS;AAA8B;AACjD;AAYa;AAIX;AACG;AACsE;AACjE;AACC;AAGF;AAAQ;AAAiB;AAMzB;AACC;AACoC;AAK9C;;"}
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import React__default, { forwardRef, Children } from 'react';
|
|
2
|
+
import React__default, { forwardRef, Children, useRef } from 'react';
|
|
3
3
|
import { classNames } from '../utils/class-names.mjs';
|
|
4
|
+
import { useVisibleCallback } from '../utils/use-visible.mjs';
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
function ReachEndMarker({
|
|
7
|
+
enabled,
|
|
8
|
+
onReachEnd
|
|
9
|
+
}) {
|
|
10
|
+
const markerRef = useRef(null);
|
|
11
|
+
useVisibleCallback(markerRef, onReachEnd, {
|
|
12
|
+
enabled
|
|
13
|
+
});
|
|
14
|
+
return /* @__PURE__ */ React__default.createElement("div", {
|
|
15
|
+
ref: markerRef,
|
|
16
|
+
style: { height: 0 }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
const InboxNotificationList = forwardRef(({ onReachEnd, children, className, ...props }, forwardedRef) => {
|
|
6
20
|
return /* @__PURE__ */ React__default.createElement("ol", {
|
|
7
21
|
className: classNames("lb-root lb-inbox-notification-list", className),
|
|
8
22
|
...props,
|
|
@@ -10,7 +24,10 @@ const InboxNotificationList = forwardRef(({ children, className, ...props }, for
|
|
|
10
24
|
}, Children.map(children, (child, index) => /* @__PURE__ */ React__default.createElement("li", {
|
|
11
25
|
key: index,
|
|
12
26
|
className: "lb-inbox-notification-list-item"
|
|
13
|
-
}, child))
|
|
27
|
+
}, child)), onReachEnd && /* @__PURE__ */ React__default.createElement(ReachEndMarker, {
|
|
28
|
+
onReachEnd,
|
|
29
|
+
enabled: Children.count(children) > 0
|
|
30
|
+
}));
|
|
14
31
|
});
|
|
15
32
|
|
|
16
33
|
export { InboxNotificationList };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InboxNotificationList.mjs","sources":["../../src/components/InboxNotificationList.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport React, { Children, forwardRef } from \"react\";\n\nimport { classNames } from \"../utils/class-names\";\n\nexport
|
|
1
|
+
{"version":3,"file":"InboxNotificationList.mjs","sources":["../../src/components/InboxNotificationList.tsx"],"sourcesContent":["\"use client\";\n\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport React, { Children, forwardRef, useRef } from \"react\";\n\nimport { classNames } from \"../utils/class-names\";\nimport { useVisibleCallback } from \"../utils/use-visible\";\n\nexport interface InboxNotificationListProps\n extends ComponentPropsWithoutRef<\"ol\"> {\n onReachEnd?: () => void;\n}\n\nfunction ReachEndMarker({\n enabled,\n onReachEnd,\n}: {\n enabled: boolean;\n onReachEnd: () => void;\n}) {\n const markerRef = useRef<HTMLDivElement>(null);\n\n useVisibleCallback(markerRef, onReachEnd, {\n enabled,\n });\n\n return <div ref={markerRef} style={{ height: 0 }} />;\n}\n\n/**\n * Displays inbox notifications as a list.\n *\n * @example\n * <InboxNotificationList>\n * {inboxNotifications.map((inboxNotification) => (\n * <InboxNotification key={inboxNotification.id} inboxNotification={inboxNotification} />\n * ))}\n * </InboxNotificationList>\n */\nexport const InboxNotificationList = forwardRef<\n HTMLOListElement,\n InboxNotificationListProps\n>(({ onReachEnd, children, className, ...props }, forwardedRef) => {\n return (\n <ol\n className={classNames(\"lb-root lb-inbox-notification-list\", className)}\n {...props}\n ref={forwardedRef}\n >\n {Children.map(children, (child, index) => (\n <li key={index} className=\"lb-inbox-notification-list-item\">\n {child}\n </li>\n ))}\n {/* Render an invisible marker at the end which is tied to an IntersectionObserver to be alerted when the end of the list has been reached */}\n {onReachEnd && (\n <ReachEndMarker\n onReachEnd={onReachEnd}\n enabled={Children.count(children) > 0}\n />\n )}\n </ol>\n );\n});\n"],"names":[],"mappings":";;;;;AAaA;AAAwB;AACtB;AAEF;AAIE;AAEA;AAA0C;AACxC;AAGF;AAAQ;AAAS;AAA8B;AACjD;AAYa;AAIX;AACG;AACsE;AACjE;AACC;AAGF;AAAQ;AAAiB;AAMzB;AACC;AACoC;AAK9C;;"}
|
package/dist/index.d.mts
CHANGED
|
@@ -479,7 +479,9 @@ declare const InboxNotification: React.ForwardRefExoticComponent<InboxNotificati
|
|
|
479
479
|
Avatar: typeof InboxNotificationAvatar;
|
|
480
480
|
};
|
|
481
481
|
|
|
482
|
-
|
|
482
|
+
interface InboxNotificationListProps extends ComponentPropsWithoutRef<"ol"> {
|
|
483
|
+
onReachEnd?: () => void;
|
|
484
|
+
}
|
|
483
485
|
/**
|
|
484
486
|
* Displays inbox notifications as a list.
|
|
485
487
|
*
|
|
@@ -490,7 +492,7 @@ declare type InboxNotificationListProps = ComponentPropsWithoutRef<"ol">;
|
|
|
490
492
|
* ))}
|
|
491
493
|
* </InboxNotificationList>
|
|
492
494
|
*/
|
|
493
|
-
declare const InboxNotificationList: React.ForwardRefExoticComponent<
|
|
495
|
+
declare const InboxNotificationList: React.ForwardRefExoticComponent<InboxNotificationListProps & React.RefAttributes<HTMLOListElement>>;
|
|
494
496
|
|
|
495
497
|
interface ThreadProps<M extends BaseMetadata = DM> extends ComponentPropsWithoutRef<"div"> {
|
|
496
498
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -479,7 +479,9 @@ declare const InboxNotification: React.ForwardRefExoticComponent<InboxNotificati
|
|
|
479
479
|
Avatar: typeof InboxNotificationAvatar;
|
|
480
480
|
};
|
|
481
481
|
|
|
482
|
-
|
|
482
|
+
interface InboxNotificationListProps extends ComponentPropsWithoutRef<"ol"> {
|
|
483
|
+
onReachEnd?: () => void;
|
|
484
|
+
}
|
|
483
485
|
/**
|
|
484
486
|
* Displays inbox notifications as a list.
|
|
485
487
|
*
|
|
@@ -490,7 +492,7 @@ declare type InboxNotificationListProps = ComponentPropsWithoutRef<"ol">;
|
|
|
490
492
|
* ))}
|
|
491
493
|
* </InboxNotificationList>
|
|
492
494
|
*/
|
|
493
|
-
declare const InboxNotificationList: React.ForwardRefExoticComponent<
|
|
495
|
+
declare const InboxNotificationList: React.ForwardRefExoticComponent<InboxNotificationListProps & React.RefAttributes<HTMLOListElement>>;
|
|
494
496
|
|
|
495
497
|
interface ThreadProps<M extends BaseMetadata = DM> extends ComponentPropsWithoutRef<"div"> {
|
|
496
498
|
/**
|
package/dist/version.js
CHANGED
package/dist/version.js.map
CHANGED
|
@@ -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,
|
|
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,YAAA;AACjD,MAAA,UAAA,GAAkD;;;;;;"}
|
package/dist/version.mjs
CHANGED
package/dist/version.mjs.map
CHANGED
|
@@ -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,
|
|
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,YAAA;AACjD,MAAA,UAAA,GAAkD;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liveblocks/react-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.0-rc1",
|
|
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",
|
|
@@ -75,9 +75,9 @@
|
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"@floating-ui/react-dom": "^2.1.1",
|
|
78
|
-
"@liveblocks/client": "2.
|
|
79
|
-
"@liveblocks/core": "2.
|
|
80
|
-
"@liveblocks/react": "2.
|
|
78
|
+
"@liveblocks/client": "2.9.0-rc1",
|
|
79
|
+
"@liveblocks/core": "2.9.0-rc1",
|
|
80
|
+
"@liveblocks/react": "2.9.0-rc1",
|
|
81
81
|
"@radix-ui/react-dropdown-menu": "^2.0.6",
|
|
82
82
|
"@radix-ui/react-popover": "^1.0.7",
|
|
83
83
|
"@radix-ui/react-slot": "^1.0.2",
|