@shapesos/clay 0.8.0 → 0.8.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/chat.cjs +19 -24
- package/dist/chat.cjs.map +1 -1
- package/dist/chat.js +1 -1
- package/dist/{chunk-KYTNUZO6.js → chunk-2EZFFUCL.js} +4 -9
- package/dist/chunk-2EZFFUCL.js.map +1 -0
- package/dist/index.cjs +37 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-KYTNUZO6.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -16754,7 +16754,6 @@ function typographyMixin(type) {
|
|
|
16754
16754
|
}
|
|
16755
16755
|
|
|
16756
16756
|
// src/components/chat/chat-message-content/chat-message-content.tsx
|
|
16757
|
-
var import_react3 = require("react");
|
|
16758
16757
|
var import_react_markdown = __toESM(require("react-markdown"), 1);
|
|
16759
16758
|
var import_remark_breaks = __toESM(require("remark-breaks"), 1);
|
|
16760
16759
|
var import_remark_gfm = __toESM(require("remark-gfm"), 1);
|
|
@@ -16940,21 +16939,17 @@ function ChatMessageContent({ content: content2, messageId }) {
|
|
|
16940
16939
|
const t = line.trim();
|
|
16941
16940
|
return !(t.startsWith("<!-- table-title:") && t.endsWith("-->"));
|
|
16942
16941
|
}).join("\n");
|
|
16943
|
-
const markdownComponents =
|
|
16944
|
-
() => ({
|
|
16945
|
-
|
|
16946
|
-
}),
|
|
16947
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- counter is intentionally a fresh object each render for sequential table indexing
|
|
16948
|
-
[messageId]
|
|
16949
|
-
);
|
|
16942
|
+
const markdownComponents = {
|
|
16943
|
+
table: ((tableProps) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ScrollableTable, { ...tableProps, messageId, counter }))
|
|
16944
|
+
};
|
|
16950
16945
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ContentWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_markdown.default, { remarkPlugins: [import_remark_gfm.default, import_remark_breaks.default], components: markdownComponents, children: sanitizedContent }) });
|
|
16951
16946
|
}
|
|
16952
16947
|
|
|
16953
16948
|
// src/components/chat/chat-message-actions/chat-message-actions.tsx
|
|
16954
|
-
var
|
|
16949
|
+
var import_react6 = require("react");
|
|
16955
16950
|
|
|
16956
16951
|
// node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs
|
|
16957
|
-
var
|
|
16952
|
+
var import_react3 = require("react");
|
|
16958
16953
|
|
|
16959
16954
|
// node_modules/@tabler/icons-react/dist/esm/defaultAttributes.mjs
|
|
16960
16955
|
var defaultAttributes = {
|
|
@@ -16981,8 +16976,8 @@ var defaultAttributes = {
|
|
|
16981
16976
|
|
|
16982
16977
|
// node_modules/@tabler/icons-react/dist/esm/createReactComponent.mjs
|
|
16983
16978
|
var createReactComponent = (type, iconName, iconNamePascal, iconNode) => {
|
|
16984
|
-
const Component = (0,
|
|
16985
|
-
({ color = "currentColor", size = 24, stroke = 2, title, className, children, ...rest }, ref) => (0,
|
|
16979
|
+
const Component = (0, import_react3.forwardRef)(
|
|
16980
|
+
({ color = "currentColor", size = 24, stroke = 2, title, className, children, ...rest }, ref) => (0, import_react3.createElement)(
|
|
16986
16981
|
"svg",
|
|
16987
16982
|
{
|
|
16988
16983
|
ref,
|
|
@@ -16999,8 +16994,8 @@ var createReactComponent = (type, iconName, iconNamePascal, iconNode) => {
|
|
|
16999
16994
|
...rest
|
|
17000
16995
|
},
|
|
17001
16996
|
[
|
|
17002
|
-
title && (0,
|
|
17003
|
-
...iconNode.map(([tag, attrs]) => (0,
|
|
16997
|
+
title && (0, import_react3.createElement)("title", { key: "svg-title" }, title),
|
|
16998
|
+
...iconNode.map(([tag, attrs]) => (0, import_react3.createElement)(tag, attrs)),
|
|
17004
16999
|
...Array.isArray(children) ? children : [children]
|
|
17005
17000
|
]
|
|
17006
17001
|
)
|
|
@@ -17026,7 +17021,7 @@ var __iconNode4 = [["path", { "d": "M7 11v8a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-7
|
|
|
17026
17021
|
var IconThumbUp = createReactComponent("outline", "thumb-up", "ThumbUp", __iconNode4);
|
|
17027
17022
|
|
|
17028
17023
|
// src/components/icon/icon.tsx
|
|
17029
|
-
var
|
|
17024
|
+
var import_react4 = require("react");
|
|
17030
17025
|
|
|
17031
17026
|
// src/components/icon/icon-styles.ts
|
|
17032
17027
|
var import_styled_components3 = __toESM(require("styled-components"), 1);
|
|
@@ -17053,7 +17048,7 @@ var IconWrapper = import_styled_components3.default.span`
|
|
|
17053
17048
|
// src/components/icon/icon.tsx
|
|
17054
17049
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
17055
17050
|
var DEFAULT_SIZE = 16;
|
|
17056
|
-
var Icon = (0,
|
|
17051
|
+
var Icon = (0, import_react4.forwardRef)(function Icon2({ icon: IconComponent, size = DEFAULT_SIZE, color, className, "aria-label": ariaLabel }, ref) {
|
|
17057
17052
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
17058
17053
|
IconWrapper,
|
|
17059
17054
|
{
|
|
@@ -17146,7 +17141,7 @@ function IconButton({
|
|
|
17146
17141
|
}
|
|
17147
17142
|
|
|
17148
17143
|
// src/components/chat/hooks/use-copy-to-clipboard.ts
|
|
17149
|
-
var
|
|
17144
|
+
var import_react5 = require("react");
|
|
17150
17145
|
|
|
17151
17146
|
// src/utils/clipboard.ts
|
|
17152
17147
|
function copyToClipboard(text2, options) {
|
|
@@ -17174,14 +17169,14 @@ function markdownToPlainText(markdown) {
|
|
|
17174
17169
|
// src/components/chat/hooks/use-copy-to-clipboard.ts
|
|
17175
17170
|
var RESET_DELAY_MS = 2e3;
|
|
17176
17171
|
function useCopyToClipboard() {
|
|
17177
|
-
const [isCopied, setIsCopied] = (0,
|
|
17178
|
-
const timeoutRef = (0,
|
|
17179
|
-
(0,
|
|
17172
|
+
const [isCopied, setIsCopied] = (0, import_react5.useState)(false);
|
|
17173
|
+
const timeoutRef = (0, import_react5.useRef)(null);
|
|
17174
|
+
(0, import_react5.useEffect)(() => {
|
|
17180
17175
|
return () => {
|
|
17181
17176
|
if (timeoutRef.current) clearTimeout(timeoutRef.current);
|
|
17182
17177
|
};
|
|
17183
17178
|
}, []);
|
|
17184
|
-
const copy = (0,
|
|
17179
|
+
const copy = (0, import_react5.useCallback)((text2) => {
|
|
17185
17180
|
copyToClipboard(markdownToPlainText(text2), {
|
|
17186
17181
|
onSuccess: () => {
|
|
17187
17182
|
setIsCopied(true);
|
|
@@ -17225,14 +17220,14 @@ var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
|
17225
17220
|
function ChatMessageActions({ className, messageId, content: content2, role, isHelpful }) {
|
|
17226
17221
|
const { onCopyMessage, onThumbUpClick, onThumbDownClick } = useChatContext();
|
|
17227
17222
|
const { isCopied, copy } = useCopyToClipboard();
|
|
17228
|
-
const handleCopy = (0,
|
|
17223
|
+
const handleCopy = (0, import_react6.useCallback)(() => {
|
|
17229
17224
|
copy(content2);
|
|
17230
17225
|
onCopyMessage?.(messageId);
|
|
17231
17226
|
}, [content2, messageId, copy, onCopyMessage]);
|
|
17232
|
-
const handleThumbUp = (0,
|
|
17227
|
+
const handleThumbUp = (0, import_react6.useCallback)(() => {
|
|
17233
17228
|
onThumbUpClick?.(messageId, isHelpful === true ? null : true);
|
|
17234
17229
|
}, [messageId, isHelpful, onThumbUpClick]);
|
|
17235
|
-
const handleThumbDown = (0,
|
|
17230
|
+
const handleThumbDown = (0, import_react6.useCallback)(() => {
|
|
17236
17231
|
onThumbDownClick?.(messageId, isHelpful === false ? null : false);
|
|
17237
17232
|
}, [messageId, isHelpful, onThumbDownClick]);
|
|
17238
17233
|
const isAssistant = role === MESSAGE_ROLE.ASSISTANT;
|
|
@@ -17380,7 +17375,7 @@ function IconCtrl(props) {
|
|
|
17380
17375
|
}
|
|
17381
17376
|
|
|
17382
17377
|
// src/components/lottie/lottie.tsx
|
|
17383
|
-
var
|
|
17378
|
+
var import_react8 = require("react");
|
|
17384
17379
|
|
|
17385
17380
|
// src/components/lottie/lottie-styles.ts
|
|
17386
17381
|
var import_styled_components8 = __toESM(require("styled-components"), 1);
|
|
@@ -17396,7 +17391,7 @@ var LottieContainer = import_styled_components8.default.div`
|
|
|
17396
17391
|
`;
|
|
17397
17392
|
|
|
17398
17393
|
// src/components/lottie/use-lottie.ts
|
|
17399
|
-
var
|
|
17394
|
+
var import_react7 = require("react");
|
|
17400
17395
|
var import_lottie_web = __toESM(require_lottie(), 1);
|
|
17401
17396
|
function useLottie({
|
|
17402
17397
|
animationData: animationData2,
|
|
@@ -17411,17 +17406,17 @@ function useLottie({
|
|
|
17411
17406
|
onLoopComplete,
|
|
17412
17407
|
onEnterFrame
|
|
17413
17408
|
}) {
|
|
17414
|
-
const containerRef = (0,
|
|
17415
|
-
const animationRef = (0,
|
|
17416
|
-
const onAnimationLoadedRef = (0,
|
|
17417
|
-
const onCompleteRef = (0,
|
|
17418
|
-
const onLoopCompleteRef = (0,
|
|
17419
|
-
const onEnterFrameRef = (0,
|
|
17409
|
+
const containerRef = (0, import_react7.useRef)(null);
|
|
17410
|
+
const animationRef = (0, import_react7.useRef)(null);
|
|
17411
|
+
const onAnimationLoadedRef = (0, import_react7.useRef)(onAnimationLoaded);
|
|
17412
|
+
const onCompleteRef = (0, import_react7.useRef)(onComplete);
|
|
17413
|
+
const onLoopCompleteRef = (0, import_react7.useRef)(onLoopComplete);
|
|
17414
|
+
const onEnterFrameRef = (0, import_react7.useRef)(onEnterFrame);
|
|
17420
17415
|
onAnimationLoadedRef.current = onAnimationLoaded;
|
|
17421
17416
|
onCompleteRef.current = onComplete;
|
|
17422
17417
|
onLoopCompleteRef.current = onLoopComplete;
|
|
17423
17418
|
onEnterFrameRef.current = onEnterFrame;
|
|
17424
|
-
(0,
|
|
17419
|
+
(0, import_react7.useEffect)(() => {
|
|
17425
17420
|
if (!containerRef.current) return;
|
|
17426
17421
|
const anim = import_lottie_web.default.loadAnimation({
|
|
17427
17422
|
container: containerRef.current,
|
|
@@ -17514,7 +17509,7 @@ function createLottieRef(animationRef) {
|
|
|
17514
17509
|
|
|
17515
17510
|
// src/components/lottie/lottie.tsx
|
|
17516
17511
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
17517
|
-
var Lottie = (0,
|
|
17512
|
+
var Lottie = (0, import_react8.forwardRef)(function Lottie2({
|
|
17518
17513
|
animationData: animationData2,
|
|
17519
17514
|
autoplay,
|
|
17520
17515
|
loop,
|
|
@@ -17544,7 +17539,7 @@ var Lottie = (0, import_react9.forwardRef)(function Lottie2({
|
|
|
17544
17539
|
onLoopComplete,
|
|
17545
17540
|
onEnterFrame
|
|
17546
17541
|
});
|
|
17547
|
-
(0,
|
|
17542
|
+
(0, import_react8.useImperativeHandle)(ref, () => createLottieRef(animationRef), [animationRef]);
|
|
17548
17543
|
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
17549
17544
|
LottieContainer,
|
|
17550
17545
|
{
|
|
@@ -17559,7 +17554,7 @@ var Lottie = (0, import_react9.forwardRef)(function Lottie2({
|
|
|
17559
17554
|
});
|
|
17560
17555
|
|
|
17561
17556
|
// src/components/text-area/text-area.tsx
|
|
17562
|
-
var
|
|
17557
|
+
var import_react9 = require("react");
|
|
17563
17558
|
|
|
17564
17559
|
// src/utils/merge-refs.ts
|
|
17565
17560
|
function mergeRefs(...refs) {
|
|
@@ -17600,16 +17595,16 @@ var StyledTextArea = import_styled_components9.default.textarea`
|
|
|
17600
17595
|
|
|
17601
17596
|
// src/components/text-area/text-area.tsx
|
|
17602
17597
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
17603
|
-
var TextArea = (0,
|
|
17604
|
-
const internalRef = (0,
|
|
17605
|
-
(0,
|
|
17598
|
+
var TextArea = (0, import_react9.forwardRef)(function TextArea2({ value: value2, onChange, placeholder, maxHeight, rows = 1, autoFocus, onKeyDown, disabled, className }, externalRef) {
|
|
17599
|
+
const internalRef = (0, import_react9.useRef)(null);
|
|
17600
|
+
(0, import_react9.useLayoutEffect)(() => {
|
|
17606
17601
|
const el = internalRef.current;
|
|
17607
17602
|
if (el) {
|
|
17608
17603
|
el.style.height = "auto";
|
|
17609
17604
|
el.style.height = `${el.scrollHeight}px`;
|
|
17610
17605
|
}
|
|
17611
17606
|
}, [value2]);
|
|
17612
|
-
const handleChange = (0,
|
|
17607
|
+
const handleChange = (0, import_react9.useCallback)(
|
|
17613
17608
|
(e) => {
|
|
17614
17609
|
onChange(e.target.value);
|
|
17615
17610
|
},
|
|
@@ -17699,7 +17694,7 @@ function convertTableToCSV(table) {
|
|
|
17699
17694
|
}
|
|
17700
17695
|
|
|
17701
17696
|
// src/components/button/button.tsx
|
|
17702
|
-
var
|
|
17697
|
+
var import_react10 = require("react");
|
|
17703
17698
|
|
|
17704
17699
|
// src/components/button/button-styles.ts
|
|
17705
17700
|
var import_styled_components10 = __toESM(require("styled-components"), 1);
|
|
@@ -17797,7 +17792,7 @@ var ICON_POSITION = {
|
|
|
17797
17792
|
|
|
17798
17793
|
// src/components/button/button.tsx
|
|
17799
17794
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
17800
|
-
var Button2 = (0,
|
|
17795
|
+
var Button2 = (0, import_react10.forwardRef)(function Button3({
|
|
17801
17796
|
children,
|
|
17802
17797
|
variant = BUTTON_VARIANT.SOLID,
|
|
17803
17798
|
size = BUTTON_SIZE.M,
|