reachat 1.0.2 → 1.0.3
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/SessionsList/SessionGroups.d.ts +1 -1
- package/dist/index.js +20 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +22 -2
- package/dist/index.umd.cjs.map +1 -1
- package/dist/{utils.d.ts → utils/grouping.d.ts} +1 -1
- package/dist/utils/useDimensions.d.ts +4 -0
- package/package.json +1 -2
- /package/dist/{utils.spec.d.ts → utils/grouping.spec.d.ts} +0 -0
package/dist/index.umd.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react/jsx-runtime"), require("react"), require("reablocks"), require("@radix-ui/react-slot"), require("framer-motion"), require("react-markdown"), require("remark-gfm"), require("react-syntax-highlighter"), require("mdast-util-find-and-replace"), require("remark-youtube"), require("reakeys"), require("
|
|
3
|
-
})(this, function(exports2, jsxRuntime, React, reablocks, reactSlot, framerMotion, ReactMarkdown, remarkGfm, reactSyntaxHighlighter, mdastUtilFindAndReplace, remarkYoutube, reakeys,
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react/jsx-runtime"), require("react"), require("reablocks"), require("@radix-ui/react-slot"), require("framer-motion"), require("react-markdown"), require("remark-gfm"), require("react-syntax-highlighter"), require("mdast-util-find-and-replace"), require("remark-youtube"), require("reakeys"), require("date-fns")) : typeof define === "function" && define.amd ? define(["exports", "react/jsx-runtime", "react", "reablocks", "@radix-ui/react-slot", "framer-motion", "react-markdown", "remark-gfm", "react-syntax-highlighter", "mdast-util-find-and-replace", "remark-youtube", "reakeys", "date-fns"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.reablocks = {}, global.jsxRuntime, global.React, global.reablocks, global.reactSlot, global.framerMotion, global.ReactMarkdown, global.remarkGfm, global.reactSyntaxHighlighter, global.mdastUtilFindAndReplace, global.remarkYoutube, global.reakeys, global.dateFns));
|
|
3
|
+
})(this, function(exports2, jsxRuntime, React, reablocks, reactSlot, framerMotion, ReactMarkdown, remarkGfm, reactSyntaxHighlighter, mdastUtilFindAndReplace, remarkYoutube, reakeys, dateFns) {
|
|
4
4
|
"use strict";
|
|
5
5
|
function _interopNamespaceDefault(e) {
|
|
6
6
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
@@ -1637,6 +1637,26 @@ ${response}`),
|
|
|
1637
1637
|
stop: "px-4 py-2 bg-red-500 text-white rounded hover:bg-red-700"
|
|
1638
1638
|
}
|
|
1639
1639
|
};
|
|
1640
|
+
const useDimensions = () => {
|
|
1641
|
+
const [ref, setRef] = React.useState(null);
|
|
1642
|
+
const [width, setWidth] = React.useState(void 0);
|
|
1643
|
+
const observe = React.useCallback((element) => {
|
|
1644
|
+
if (element) setRef(element);
|
|
1645
|
+
}, []);
|
|
1646
|
+
React.useEffect(() => {
|
|
1647
|
+
if (!ref) return;
|
|
1648
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
1649
|
+
for (let entry of entries) {
|
|
1650
|
+
setWidth(entry.contentRect.width);
|
|
1651
|
+
}
|
|
1652
|
+
});
|
|
1653
|
+
resizeObserver.observe(ref);
|
|
1654
|
+
return () => {
|
|
1655
|
+
resizeObserver.disconnect();
|
|
1656
|
+
};
|
|
1657
|
+
}, [ref]);
|
|
1658
|
+
return { width, observe };
|
|
1659
|
+
};
|
|
1640
1660
|
const Chat = ({
|
|
1641
1661
|
children,
|
|
1642
1662
|
viewType = "console",
|