@shapesos/clay 0.9.0 → 0.10.0
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/README.md +46 -1
- package/dist/blocks.cjs +650 -0
- package/dist/blocks.cjs.map +1 -0
- package/dist/blocks.d.cts +29 -0
- package/dist/blocks.d.ts +29 -0
- package/dist/blocks.js +21 -0
- package/dist/blocks.js.map +1 -0
- package/dist/chat.cjs +89 -47
- package/dist/chat.cjs.map +1 -1
- package/dist/chat.d.cts +7 -3
- package/dist/chat.d.ts +7 -3
- package/dist/chat.js +3 -2
- package/dist/chunk-OKPNST44.js +1 -0
- package/dist/chunk-OKPNST44.js.map +1 -0
- package/dist/chunk-R3BGPOAM.js +230 -0
- package/dist/chunk-R3BGPOAM.js.map +1 -0
- package/dist/{chunk-TDMJUF4A.js → chunk-WPQQVKWY.js} +4 -4
- package/dist/{chunk-A77BGJH4.js → chunk-WS4IPADR.js} +34 -201
- package/dist/chunk-WS4IPADR.js.map +1 -0
- package/dist/index.cjs +129 -75
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +27 -12
- package/dist/text-area.js +2 -2
- package/dist/types-Q9aqd9nq.d.cts +34 -0
- package/dist/types-Q9aqd9nq.d.ts +34 -0
- package/package.json +6 -1
- package/dist/chunk-A77BGJH4.js.map +0 -1
- /package/dist/{chunk-TDMJUF4A.js.map → chunk-WPQQVKWY.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -16345,6 +16345,9 @@ __export(src_exports, {
|
|
|
16345
16345
|
BUTTON_INTENT: () => BUTTON_INTENT,
|
|
16346
16346
|
BUTTON_SIZE: () => BUTTON_SIZE,
|
|
16347
16347
|
BUTTON_VARIANT: () => BUTTON_VARIANT,
|
|
16348
|
+
Block: () => Block,
|
|
16349
|
+
BlockContext: () => BlockContext,
|
|
16350
|
+
BlockServices: () => BlockServices,
|
|
16348
16351
|
Button: () => Button2,
|
|
16349
16352
|
ChatContext: () => ChatContext,
|
|
16350
16353
|
ChatMessage: () => ChatMessage,
|
|
@@ -16357,6 +16360,8 @@ __export(src_exports, {
|
|
|
16357
16360
|
Lottie: () => Lottie,
|
|
16358
16361
|
MESSAGE_ROLE: () => MESSAGE_ROLE,
|
|
16359
16362
|
TextArea: () => TextArea,
|
|
16363
|
+
TextBlockService: () => TextBlockService,
|
|
16364
|
+
blockTypes: () => blockTypes,
|
|
16360
16365
|
colors: () => colors,
|
|
16361
16366
|
convertTableToCSV: () => convertTableToCSV,
|
|
16362
16367
|
fontFamilies: () => fontFamilies,
|
|
@@ -16366,6 +16371,7 @@ __export(src_exports, {
|
|
|
16366
16371
|
typographyMixin: () => typographyMixin,
|
|
16367
16372
|
typographyStyles: () => typographyStyles,
|
|
16368
16373
|
typographyTypes: () => typographyTypes,
|
|
16374
|
+
useBlockContext: () => useBlockContext,
|
|
16369
16375
|
useChatContext: () => useChatContext,
|
|
16370
16376
|
useCopyToClipboard: () => useCopyToClipboard
|
|
16371
16377
|
});
|
|
@@ -16754,26 +16760,19 @@ function typographyMixin(type) {
|
|
|
16754
16760
|
].join(";\n ");
|
|
16755
16761
|
}
|
|
16756
16762
|
|
|
16757
|
-
// src/components/
|
|
16763
|
+
// src/components/blocks/text-block/text-block.tsx
|
|
16758
16764
|
var import_react_markdown = __toESM(require("react-markdown"), 1);
|
|
16759
16765
|
var import_remark_breaks = __toESM(require("remark-breaks"), 1);
|
|
16760
16766
|
var import_remark_gfm = __toESM(require("remark-gfm"), 1);
|
|
16761
16767
|
|
|
16762
|
-
// src/components/
|
|
16763
|
-
var import_react2 = require("react");
|
|
16764
|
-
|
|
16765
|
-
// src/components/chat/chat-context/chat-context.ts
|
|
16768
|
+
// src/components/blocks/block-context/block-context.tsx
|
|
16766
16769
|
var import_react = require("react");
|
|
16767
|
-
var
|
|
16768
|
-
function
|
|
16769
|
-
|
|
16770
|
-
if (!context) {
|
|
16771
|
-
throw new Error("useChatContext must be used within a Chat.Root component");
|
|
16772
|
-
}
|
|
16773
|
-
return context;
|
|
16770
|
+
var BlockContext = (0, import_react.createContext)(null);
|
|
16771
|
+
function useBlockContext() {
|
|
16772
|
+
return (0, import_react.useContext)(BlockContext) ?? {};
|
|
16774
16773
|
}
|
|
16775
16774
|
|
|
16776
|
-
// src/components/
|
|
16775
|
+
// src/components/blocks/scrollable-table/scrollable-table-styles.ts
|
|
16777
16776
|
var import_styled_components = __toESM(require("styled-components"), 1);
|
|
16778
16777
|
var TableContainer = import_styled_components.default.div`
|
|
16779
16778
|
position: relative;
|
|
@@ -16795,27 +16794,34 @@ var TableActionsDivider = import_styled_components.default.div`
|
|
|
16795
16794
|
margin-block: 8px 0;
|
|
16796
16795
|
`;
|
|
16797
16796
|
|
|
16798
|
-
// src/components/
|
|
16797
|
+
// src/components/blocks/scrollable-table/scrollable-table.tsx
|
|
16799
16798
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
16800
|
-
function ScrollableTable({ node: _node,
|
|
16799
|
+
function ScrollableTable({ node: _node, counter, ...props }) {
|
|
16801
16800
|
const currentIndex = counter ? counter.value : 0;
|
|
16802
16801
|
if (counter) {
|
|
16803
16802
|
counter.value += 1;
|
|
16804
16803
|
}
|
|
16805
|
-
const
|
|
16806
|
-
const TableActions = context?.TableActions;
|
|
16804
|
+
const { TableActions } = useBlockContext();
|
|
16807
16805
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(TableContainer, { children: [
|
|
16808
16806
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableScroll, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("table", { ...props }) }),
|
|
16809
|
-
TableActions &&
|
|
16810
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableActionsWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableActions, {
|
|
16807
|
+
TableActions && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
16808
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableActionsWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableActions, { tableIndex: currentIndex }) }),
|
|
16811
16809
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TableActionsDivider, {})
|
|
16812
16810
|
] })
|
|
16813
16811
|
] });
|
|
16814
16812
|
}
|
|
16815
16813
|
|
|
16816
|
-
// src/components/
|
|
16814
|
+
// src/components/blocks/text-block/sanitize.ts
|
|
16815
|
+
function sanitize(text2) {
|
|
16816
|
+
return text2.split("\n").filter((line) => {
|
|
16817
|
+
const t = line.trim();
|
|
16818
|
+
return !(t.startsWith("<!-- table-title:") && t.endsWith("-->"));
|
|
16819
|
+
}).join("\n");
|
|
16820
|
+
}
|
|
16821
|
+
|
|
16822
|
+
// src/components/blocks/text-block/text-block-styles.ts
|
|
16817
16823
|
var import_styled_components2 = __toESM(require("styled-components"), 1);
|
|
16818
|
-
var
|
|
16824
|
+
var TextBlockWrapper = import_styled_components2.default.div`
|
|
16819
16825
|
${typographyMixin(typographyTypes.GEIST_BODY_S_REGULAR)};
|
|
16820
16826
|
color: ${colors["brown-100"]};
|
|
16821
16827
|
word-break: break-word;
|
|
@@ -16932,18 +16938,53 @@ var ContentWrapper = import_styled_components2.default.div`
|
|
|
16932
16938
|
}
|
|
16933
16939
|
`;
|
|
16934
16940
|
|
|
16935
|
-
// src/components/
|
|
16941
|
+
// src/components/blocks/text-block/text-block.tsx
|
|
16936
16942
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
16937
|
-
function
|
|
16943
|
+
function TextBlock({ block }) {
|
|
16938
16944
|
const counter = { value: 0 };
|
|
16939
|
-
const sanitizedContent = content2.split("\n").filter((line) => {
|
|
16940
|
-
const t = line.trim();
|
|
16941
|
-
return !(t.startsWith("<!-- table-title:") && t.endsWith("-->"));
|
|
16942
|
-
}).join("\n");
|
|
16943
16945
|
const markdownComponents = {
|
|
16944
|
-
table: ((tableProps) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ScrollableTable, { ...tableProps,
|
|
16946
|
+
table: ((tableProps) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ScrollableTable, { ...tableProps, counter }))
|
|
16945
16947
|
};
|
|
16946
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
16948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(TextBlockWrapper, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_markdown.default, { remarkPlugins: [import_remark_gfm.default, import_remark_breaks.default], components: markdownComponents, children: sanitize(block.payload.text) }) });
|
|
16949
|
+
}
|
|
16950
|
+
|
|
16951
|
+
// src/components/blocks/types.ts
|
|
16952
|
+
var blockTypes = {
|
|
16953
|
+
TEXT: "TEXT"
|
|
16954
|
+
};
|
|
16955
|
+
|
|
16956
|
+
// src/components/blocks/block-services/text-block-service.ts
|
|
16957
|
+
var TextBlockService = {
|
|
16958
|
+
type: blockTypes.TEXT,
|
|
16959
|
+
Component: TextBlock
|
|
16960
|
+
};
|
|
16961
|
+
|
|
16962
|
+
// src/components/blocks/block-services/index.ts
|
|
16963
|
+
var BlockServices = {
|
|
16964
|
+
[TextBlockService.type]: TextBlockService
|
|
16965
|
+
};
|
|
16966
|
+
|
|
16967
|
+
// src/components/blocks/block/block.tsx
|
|
16968
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
16969
|
+
function Block({ block }) {
|
|
16970
|
+
const service = BlockServices[block.type];
|
|
16971
|
+
if (!service) return null;
|
|
16972
|
+
const { Component } = service;
|
|
16973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Component, { block });
|
|
16974
|
+
}
|
|
16975
|
+
|
|
16976
|
+
// src/components/chat/chat-message/chat-message.tsx
|
|
16977
|
+
var import_react7 = require("react");
|
|
16978
|
+
|
|
16979
|
+
// src/components/chat/chat-context/chat-context.ts
|
|
16980
|
+
var import_react2 = require("react");
|
|
16981
|
+
var ChatContext = (0, import_react2.createContext)(null);
|
|
16982
|
+
function useChatContext() {
|
|
16983
|
+
const context = (0, import_react2.useContext)(ChatContext);
|
|
16984
|
+
if (!context) {
|
|
16985
|
+
throw new Error("useChatContext must be used within a Chat.Root component");
|
|
16986
|
+
}
|
|
16987
|
+
return context;
|
|
16947
16988
|
}
|
|
16948
16989
|
|
|
16949
16990
|
// src/components/chat/chat-message-actions/chat-message-actions.tsx
|
|
@@ -17047,10 +17088,10 @@ var IconWrapper = import_styled_components3.default.span`
|
|
|
17047
17088
|
`;
|
|
17048
17089
|
|
|
17049
17090
|
// src/components/icon/icon.tsx
|
|
17050
|
-
var
|
|
17091
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
17051
17092
|
var DEFAULT_SIZE = 16;
|
|
17052
17093
|
var Icon = (0, import_react4.forwardRef)(function Icon2({ icon: IconComponent, size = DEFAULT_SIZE, color, className, "aria-label": ariaLabel }, ref) {
|
|
17053
|
-
return /* @__PURE__ */ (0,
|
|
17094
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
17054
17095
|
IconWrapper,
|
|
17055
17096
|
{
|
|
17056
17097
|
ref,
|
|
@@ -17058,7 +17099,7 @@ var Icon = (0, import_react4.forwardRef)(function Icon2({ icon: IconComponent, s
|
|
|
17058
17099
|
$color: color,
|
|
17059
17100
|
"aria-label": ariaLabel,
|
|
17060
17101
|
role: ariaLabel ? "img" : void 0,
|
|
17061
|
-
children: /* @__PURE__ */ (0,
|
|
17102
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(IconComponent, { width: size, height: size, strokeWidth: getStrokeWidth(size) })
|
|
17062
17103
|
}
|
|
17063
17104
|
);
|
|
17064
17105
|
});
|
|
@@ -17107,7 +17148,7 @@ var Button = import_styled_components4.default.button`
|
|
|
17107
17148
|
`;
|
|
17108
17149
|
|
|
17109
17150
|
// src/components/icon-button/icon-button.tsx
|
|
17110
|
-
var
|
|
17151
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
17111
17152
|
var ICON_SIZE_BY_BUTTON_SIZE = {
|
|
17112
17153
|
small: 16,
|
|
17113
17154
|
medium: 20
|
|
@@ -17124,7 +17165,7 @@ function IconButton({
|
|
|
17124
17165
|
as,
|
|
17125
17166
|
"aria-label": ariaLabel
|
|
17126
17167
|
}) {
|
|
17127
|
-
return /* @__PURE__ */ (0,
|
|
17168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
17128
17169
|
Button,
|
|
17129
17170
|
{
|
|
17130
17171
|
className,
|
|
@@ -17136,7 +17177,7 @@ function IconButton({
|
|
|
17136
17177
|
disabled,
|
|
17137
17178
|
onClick: disabled ? void 0 : onClick,
|
|
17138
17179
|
"aria-label": ariaLabel,
|
|
17139
|
-
children: /* @__PURE__ */ (0,
|
|
17180
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon, { icon, size: ICON_SIZE_BY_BUTTON_SIZE[size] })
|
|
17140
17181
|
}
|
|
17141
17182
|
);
|
|
17142
17183
|
}
|
|
@@ -17221,7 +17262,7 @@ var AnimatedAction = import_styled_components5.default.div`
|
|
|
17221
17262
|
`;
|
|
17222
17263
|
|
|
17223
17264
|
// src/components/chat/chat-message-actions/chat-message-actions.tsx
|
|
17224
|
-
var
|
|
17265
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
17225
17266
|
function ChatMessageActions({ className, messageId, content: content2, role, isHelpful }) {
|
|
17226
17267
|
const { onCopyMessage, onThumbUpClick, onThumbDownClick } = useChatContext();
|
|
17227
17268
|
const { isCopied, copy } = useCopyToClipboard();
|
|
@@ -17237,8 +17278,8 @@ function ChatMessageActions({ className, messageId, content: content2, role, isH
|
|
|
17237
17278
|
}, [messageId, isHelpful, onThumbDownClick]);
|
|
17238
17279
|
const isAssistant = role === MESSAGE_ROLE.ASSISTANT;
|
|
17239
17280
|
const hasFeedback = isAssistant && (onThumbUpClick || onThumbDownClick);
|
|
17240
|
-
return /* @__PURE__ */ (0,
|
|
17241
|
-
/* @__PURE__ */ (0,
|
|
17281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(ActionsContainer, { $role: role, className, children: [
|
|
17282
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
17242
17283
|
IconButton,
|
|
17243
17284
|
{
|
|
17244
17285
|
icon: isCopied ? IconCheck : IconCopy,
|
|
@@ -17246,7 +17287,7 @@ function ChatMessageActions({ className, messageId, content: content2, role, isH
|
|
|
17246
17287
|
"aria-label": isCopied ? "Copied" : "Copy message"
|
|
17247
17288
|
}
|
|
17248
17289
|
),
|
|
17249
|
-
hasFeedback && /* @__PURE__ */ (0,
|
|
17290
|
+
hasFeedback && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AnimatedAction, { $visible: isHelpful !== false, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
17250
17291
|
IconButton,
|
|
17251
17292
|
{
|
|
17252
17293
|
icon: IconThumbUp,
|
|
@@ -17255,7 +17296,7 @@ function ChatMessageActions({ className, messageId, content: content2, role, isH
|
|
|
17255
17296
|
"aria-label": "Good response"
|
|
17256
17297
|
}
|
|
17257
17298
|
) }),
|
|
17258
|
-
hasFeedback && /* @__PURE__ */ (0,
|
|
17299
|
+
hasFeedback && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(AnimatedAction, { $visible: isHelpful !== true, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
17259
17300
|
IconButton,
|
|
17260
17301
|
{
|
|
17261
17302
|
icon: IconThumbDown,
|
|
@@ -17297,15 +17338,22 @@ var MessageBubble = import_styled_components6.default.div`
|
|
|
17297
17338
|
`;
|
|
17298
17339
|
|
|
17299
17340
|
// src/components/chat/chat-message/chat-message.tsx
|
|
17300
|
-
var
|
|
17341
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
17301
17342
|
function ChatMessage({ message }) {
|
|
17302
|
-
|
|
17303
|
-
|
|
17304
|
-
|
|
17343
|
+
const { TableActions: ChatTableActions } = useChatContext();
|
|
17344
|
+
const blockContextValue = (0, import_react7.useMemo)(
|
|
17345
|
+
() => ({
|
|
17346
|
+
TableActions: ChatTableActions ? ({ tableIndex }) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ChatTableActions, { messageId: message.id, tableIndex }) : void 0
|
|
17347
|
+
}),
|
|
17348
|
+
[ChatTableActions, message.id]
|
|
17349
|
+
);
|
|
17350
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MessageRow, { $role: message.role, role: "article", "aria-label": `${message.role} message`, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(MessageContainer, { $role: message.role, children: [
|
|
17351
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MessageBubble, { $role: message.role, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(BlockContext.Provider, { value: blockContextValue, children: message.blocks.map((block, index2) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Block, { block }, index2)) }) }),
|
|
17352
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
17305
17353
|
ChatMessageActions,
|
|
17306
17354
|
{
|
|
17307
17355
|
messageId: message.id,
|
|
17308
|
-
content: message.
|
|
17356
|
+
content: message.fallbackText,
|
|
17309
17357
|
role: message.role,
|
|
17310
17358
|
isHelpful: message.isHelpful
|
|
17311
17359
|
}
|
|
@@ -17350,20 +17398,20 @@ var Key = import_styled_components7.default.kbd`
|
|
|
17350
17398
|
`;
|
|
17351
17399
|
|
|
17352
17400
|
// src/components/keyboard-shortcut/keyboard-shortcut.tsx
|
|
17353
|
-
var
|
|
17401
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
17354
17402
|
function KeyboardShortcut({
|
|
17355
17403
|
keys,
|
|
17356
17404
|
variant = KEYBOARD_SHORTCUT_VARIANTS.OUTLINED,
|
|
17357
17405
|
className
|
|
17358
17406
|
}) {
|
|
17359
|
-
return /* @__PURE__ */ (0,
|
|
17407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Wrapper, { className, children: keys.map((KeyComponent, index2) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Key, { $variant: variant, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon, { icon: KeyComponent, size: 12 }) }, index2)) });
|
|
17360
17408
|
}
|
|
17361
17409
|
|
|
17362
17410
|
// src/components/keyboard-shortcut/icons/icon-ctrl.tsx
|
|
17363
|
-
var
|
|
17411
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
17364
17412
|
function IconCtrl(props) {
|
|
17365
17413
|
const { width: width2 = 24, height: height2 = 24, ...rest } = props;
|
|
17366
|
-
return /* @__PURE__ */ (0,
|
|
17414
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: width2, height: height2, fill: "none", ...rest, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
17367
17415
|
"text",
|
|
17368
17416
|
{
|
|
17369
17417
|
x: "50%",
|
|
@@ -17380,7 +17428,7 @@ function IconCtrl(props) {
|
|
|
17380
17428
|
}
|
|
17381
17429
|
|
|
17382
17430
|
// src/components/lottie/lottie.tsx
|
|
17383
|
-
var
|
|
17431
|
+
var import_react9 = require("react");
|
|
17384
17432
|
|
|
17385
17433
|
// src/components/lottie/lottie-styles.ts
|
|
17386
17434
|
var import_styled_components8 = __toESM(require("styled-components"), 1);
|
|
@@ -17396,7 +17444,7 @@ var LottieContainer = import_styled_components8.default.div`
|
|
|
17396
17444
|
`;
|
|
17397
17445
|
|
|
17398
17446
|
// src/components/lottie/use-lottie.ts
|
|
17399
|
-
var
|
|
17447
|
+
var import_react8 = require("react");
|
|
17400
17448
|
var import_lottie_web = __toESM(require_lottie(), 1);
|
|
17401
17449
|
function useLottie({
|
|
17402
17450
|
animationData: animationData2,
|
|
@@ -17411,17 +17459,17 @@ function useLottie({
|
|
|
17411
17459
|
onLoopComplete,
|
|
17412
17460
|
onEnterFrame
|
|
17413
17461
|
}) {
|
|
17414
|
-
const containerRef = (0,
|
|
17415
|
-
const animationRef = (0,
|
|
17416
|
-
const onAnimationLoadedRef = (0,
|
|
17417
|
-
const onCompleteRef = (0,
|
|
17418
|
-
const onLoopCompleteRef = (0,
|
|
17419
|
-
const onEnterFrameRef = (0,
|
|
17462
|
+
const containerRef = (0, import_react8.useRef)(null);
|
|
17463
|
+
const animationRef = (0, import_react8.useRef)(null);
|
|
17464
|
+
const onAnimationLoadedRef = (0, import_react8.useRef)(onAnimationLoaded);
|
|
17465
|
+
const onCompleteRef = (0, import_react8.useRef)(onComplete);
|
|
17466
|
+
const onLoopCompleteRef = (0, import_react8.useRef)(onLoopComplete);
|
|
17467
|
+
const onEnterFrameRef = (0, import_react8.useRef)(onEnterFrame);
|
|
17420
17468
|
onAnimationLoadedRef.current = onAnimationLoaded;
|
|
17421
17469
|
onCompleteRef.current = onComplete;
|
|
17422
17470
|
onLoopCompleteRef.current = onLoopComplete;
|
|
17423
17471
|
onEnterFrameRef.current = onEnterFrame;
|
|
17424
|
-
(0,
|
|
17472
|
+
(0, import_react8.useEffect)(() => {
|
|
17425
17473
|
if (!containerRef.current) return;
|
|
17426
17474
|
const anim = import_lottie_web.default.loadAnimation({
|
|
17427
17475
|
container: containerRef.current,
|
|
@@ -17513,8 +17561,8 @@ function createLottieRef(animationRef) {
|
|
|
17513
17561
|
}
|
|
17514
17562
|
|
|
17515
17563
|
// src/components/lottie/lottie.tsx
|
|
17516
|
-
var
|
|
17517
|
-
var Lottie = (0,
|
|
17564
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
17565
|
+
var Lottie = (0, import_react9.forwardRef)(function Lottie2({
|
|
17518
17566
|
animationData: animationData2,
|
|
17519
17567
|
autoplay,
|
|
17520
17568
|
loop,
|
|
@@ -17544,8 +17592,8 @@ var Lottie = (0, import_react8.forwardRef)(function Lottie2({
|
|
|
17544
17592
|
onLoopComplete,
|
|
17545
17593
|
onEnterFrame
|
|
17546
17594
|
});
|
|
17547
|
-
(0,
|
|
17548
|
-
return /* @__PURE__ */ (0,
|
|
17595
|
+
(0, import_react9.useImperativeHandle)(ref, () => createLottieRef(animationRef), [animationRef]);
|
|
17596
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
17549
17597
|
LottieContainer,
|
|
17550
17598
|
{
|
|
17551
17599
|
ref: containerRef,
|
|
@@ -17559,7 +17607,7 @@ var Lottie = (0, import_react8.forwardRef)(function Lottie2({
|
|
|
17559
17607
|
});
|
|
17560
17608
|
|
|
17561
17609
|
// src/components/text-area/text-area.tsx
|
|
17562
|
-
var
|
|
17610
|
+
var import_react10 = require("react");
|
|
17563
17611
|
|
|
17564
17612
|
// src/utils/merge-refs.ts
|
|
17565
17613
|
function mergeRefs(...refs) {
|
|
@@ -17599,23 +17647,23 @@ var StyledTextArea = import_styled_components9.default.textarea`
|
|
|
17599
17647
|
`;
|
|
17600
17648
|
|
|
17601
17649
|
// src/components/text-area/text-area.tsx
|
|
17602
|
-
var
|
|
17603
|
-
var TextArea = (0,
|
|
17604
|
-
const internalRef = (0,
|
|
17605
|
-
(0,
|
|
17650
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
17651
|
+
var TextArea = (0, import_react10.forwardRef)(function TextArea2({ value: value2, onChange, placeholder, maxHeight, rows = 1, autoFocus, onKeyDown, disabled, className }, externalRef) {
|
|
17652
|
+
const internalRef = (0, import_react10.useRef)(null);
|
|
17653
|
+
(0, import_react10.useLayoutEffect)(() => {
|
|
17606
17654
|
const el = internalRef.current;
|
|
17607
17655
|
if (el) {
|
|
17608
17656
|
el.style.height = "auto";
|
|
17609
17657
|
el.style.height = `${el.scrollHeight}px`;
|
|
17610
17658
|
}
|
|
17611
17659
|
}, [value2]);
|
|
17612
|
-
const handleChange = (0,
|
|
17660
|
+
const handleChange = (0, import_react10.useCallback)(
|
|
17613
17661
|
(e) => {
|
|
17614
17662
|
onChange(e.target.value);
|
|
17615
17663
|
},
|
|
17616
17664
|
[onChange]
|
|
17617
17665
|
);
|
|
17618
|
-
return /* @__PURE__ */ (0,
|
|
17666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
17619
17667
|
StyledTextArea,
|
|
17620
17668
|
{
|
|
17621
17669
|
ref: mergeRefs(internalRef, externalRef),
|
|
@@ -17699,7 +17747,7 @@ function convertTableToCSV(table) {
|
|
|
17699
17747
|
}
|
|
17700
17748
|
|
|
17701
17749
|
// src/components/button/button.tsx
|
|
17702
|
-
var
|
|
17750
|
+
var import_react11 = require("react");
|
|
17703
17751
|
|
|
17704
17752
|
// src/components/button/button-styles.ts
|
|
17705
17753
|
var import_styled_components10 = __toESM(require("styled-components"), 1);
|
|
@@ -17821,8 +17869,8 @@ var StyledButton = import_styled_components10.default.button`
|
|
|
17821
17869
|
`;
|
|
17822
17870
|
|
|
17823
17871
|
// src/components/button/button.tsx
|
|
17824
|
-
var
|
|
17825
|
-
var Button2 = (0,
|
|
17872
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
17873
|
+
var Button2 = (0, import_react11.forwardRef)(function Button3({
|
|
17826
17874
|
children,
|
|
17827
17875
|
variant = BUTTON_VARIANT.SOLID,
|
|
17828
17876
|
intent = BUTTON_INTENT.PRIMARY,
|
|
@@ -17834,8 +17882,8 @@ var Button2 = (0, import_react10.forwardRef)(function Button3({
|
|
|
17834
17882
|
className,
|
|
17835
17883
|
"aria-label": ariaLabel
|
|
17836
17884
|
}, ref) {
|
|
17837
|
-
const iconElement = icon ? /* @__PURE__ */ (0,
|
|
17838
|
-
return /* @__PURE__ */ (0,
|
|
17885
|
+
const iconElement = icon ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Icon, { icon, size: 16 }) : null;
|
|
17886
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
17839
17887
|
StyledButton,
|
|
17840
17888
|
{
|
|
17841
17889
|
ref,
|
|
@@ -17849,7 +17897,7 @@ var Button2 = (0, import_react10.forwardRef)(function Button3({
|
|
|
17849
17897
|
"aria-label": ariaLabel,
|
|
17850
17898
|
children: [
|
|
17851
17899
|
iconPosition === ICON_POSITION.LEADING && iconElement,
|
|
17852
|
-
/* @__PURE__ */ (0,
|
|
17900
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children }),
|
|
17853
17901
|
iconPosition === ICON_POSITION.TRAILING && iconElement
|
|
17854
17902
|
]
|
|
17855
17903
|
}
|
|
@@ -17860,6 +17908,9 @@ var Button2 = (0, import_react10.forwardRef)(function Button3({
|
|
|
17860
17908
|
BUTTON_INTENT,
|
|
17861
17909
|
BUTTON_SIZE,
|
|
17862
17910
|
BUTTON_VARIANT,
|
|
17911
|
+
Block,
|
|
17912
|
+
BlockContext,
|
|
17913
|
+
BlockServices,
|
|
17863
17914
|
Button,
|
|
17864
17915
|
ChatContext,
|
|
17865
17916
|
ChatMessage,
|
|
@@ -17872,6 +17923,8 @@ var Button2 = (0, import_react10.forwardRef)(function Button3({
|
|
|
17872
17923
|
Lottie,
|
|
17873
17924
|
MESSAGE_ROLE,
|
|
17874
17925
|
TextArea,
|
|
17926
|
+
TextBlockService,
|
|
17927
|
+
blockTypes,
|
|
17875
17928
|
colors,
|
|
17876
17929
|
convertTableToCSV,
|
|
17877
17930
|
fontFamilies,
|
|
@@ -17881,6 +17934,7 @@ var Button2 = (0, import_react10.forwardRef)(function Button3({
|
|
|
17881
17934
|
typographyMixin,
|
|
17882
17935
|
typographyStyles,
|
|
17883
17936
|
typographyTypes,
|
|
17937
|
+
useBlockContext,
|
|
17884
17938
|
useChatContext,
|
|
17885
17939
|
useCopyToClipboard
|
|
17886
17940
|
});
|