@chatsdk-dev/elements 0.0.1 → 0.1.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/README.md +3 -3
- package/dist/api-CIYPz72L.d.ts +10 -0
- package/dist/api-CIYPz72L.d.ts.map +1 -0
- package/dist/callbacks-PIvHXeEI.d.ts +24 -0
- package/dist/callbacks-PIvHXeEI.d.ts.map +1 -0
- package/dist/chat-element-CCsDDFif.js +441 -0
- package/dist/chat-element-CCsDDFif.js.map +1 -0
- package/dist/chat-element-CSpa62Te.d.ts +53 -0
- package/dist/chat-element-CSpa62Te.d.ts.map +1 -0
- package/dist/chatsdk-provider-BhlChLFd.d.ts +15 -0
- package/dist/chatsdk-provider-BhlChLFd.d.ts.map +1 -0
- package/dist/common/utils.d.ts +14 -0
- package/dist/common/utils.d.ts.map +1 -0
- package/dist/common/utils.js +26 -0
- package/dist/common/utils.js.map +1 -0
- package/dist/components/info-card.d.ts +20 -11
- package/dist/components/info-card.d.ts.map +1 -0
- package/dist/components/info-card.js +38 -1
- package/dist/components/info-card.js.map +1 -0
- package/dist/config-BigIL6TQ.js +29 -0
- package/dist/config-BigIL6TQ.js.map +1 -0
- package/dist/config-CqihvSgz.d.ts +150 -0
- package/dist/config-CqihvSgz.d.ts.map +1 -0
- package/dist/config-D_jVTH_D.d.ts +58 -0
- package/dist/config-D_jVTH_D.d.ts.map +1 -0
- package/dist/context-aSaHw-ac.d.ts +13 -0
- package/dist/context-aSaHw-ac.d.ts.map +1 -0
- package/dist/element-provider-C_nBsftD.d.ts +40 -0
- package/dist/element-provider-C_nBsftD.d.ts.map +1 -0
- package/dist/features/chat/chat-card.d.ts +5 -3
- package/dist/features/chat/chat-card.d.ts.map +1 -0
- package/dist/features/chat/chat-card.js +2 -14
- package/dist/features/chat/chat-element.d.ts +2 -0
- package/dist/features/chat/chat-element.js +2 -0
- package/dist/features/chat/chat-header/chat-header.d.ts +8 -4
- package/dist/features/chat/chat-header/chat-header.d.ts.map +1 -0
- package/dist/features/chat/chat-header/chat-header.js +2 -14
- package/dist/features/chat/chat-header/chat-menu.d.ts +5 -3
- package/dist/features/chat/chat-header/chat-menu.d.ts.map +1 -0
- package/dist/features/chat/chat-header/chat-menu.js +29 -2
- package/dist/features/chat/chat-header/chat-menu.js.map +1 -0
- package/dist/features/chat/chat-history/chat-history-empty.d.ts +5 -3
- package/dist/features/chat/chat-history/chat-history-empty.d.ts.map +1 -0
- package/dist/features/chat/chat-history/chat-history-empty.js +24 -1
- package/dist/features/chat/chat-history/chat-history-empty.js.map +1 -0
- package/dist/features/chat/chat-history/chat-history.d.ts +5 -3
- package/dist/features/chat/chat-history/chat-history.d.ts.map +1 -0
- package/dist/features/chat/chat-history/chat-history.js +2 -14
- package/dist/features/chat/chat-main/chat-main.d.ts +10 -0
- package/dist/features/chat/chat-main/chat-main.d.ts.map +1 -0
- package/dist/features/chat/chat-main/chat-main.js +3 -0
- package/dist/features/chat/chat-main/use-chat.d.ts +23 -0
- package/dist/features/chat/chat-main/use-chat.d.ts.map +1 -0
- package/dist/features/chat/chat-main/use-chat.js +3 -0
- package/dist/features/chat/chat-main/use-initial-messages.d.ts +22 -0
- package/dist/features/chat/chat-main/use-initial-messages.d.ts.map +1 -0
- package/dist/features/chat/chat-main/use-initial-messages.js +2 -0
- package/dist/features/chat/chat-prompt-input.d.ts +20 -12
- package/dist/features/chat/chat-prompt-input.d.ts.map +1 -0
- package/dist/features/chat/chat-prompt-input.js +3 -14
- package/dist/features/chat/chat.context.d.ts +17 -15
- package/dist/features/chat/chat.context.d.ts.map +1 -0
- package/dist/features/chat/chat.context.js +9 -12
- package/dist/features/chat/chat.context.js.map +1 -0
- package/dist/features/chat/index.d.ts +2 -14
- package/dist/features/chat/index.js +2 -14
- package/dist/features/chat/queries/query-keys.d.ts +7 -5
- package/dist/features/chat/queries/query-keys.d.ts.map +1 -0
- package/dist/features/chat/queries/query-keys.js +19 -1
- package/dist/features/chat/queries/query-keys.js.map +1 -0
- package/dist/features/chat/queries/use-create-conversation-mutation.d.ts +27 -23
- package/dist/features/chat/queries/use-create-conversation-mutation.d.ts.map +1 -0
- package/dist/features/chat/queries/use-create-conversation-mutation.js +17 -36
- package/dist/features/chat/queries/use-create-conversation-mutation.js.map +1 -0
- package/dist/features/chat/queries/use-get-chat-query.d.ts +9 -5
- package/dist/features/chat/queries/use-get-chat-query.d.ts.map +1 -0
- package/dist/features/chat/queries/use-get-chat-query.js +2 -14
- package/dist/features/chat/queries/use-get-conversation-query.d.ts +56 -46
- package/dist/features/chat/queries/use-get-conversation-query.d.ts.map +1 -0
- package/dist/features/chat/queries/use-get-conversation-query.js +2 -14
- package/dist/features/chat/queries/use-list-conversations-query.d.ts +27 -23
- package/dist/features/chat/queries/use-list-conversations-query.d.ts.map +1 -0
- package/dist/features/chat/queries/use-list-conversations-query.js +2 -14
- package/dist/features/chat/store.d.ts +10 -8
- package/dist/features/chat/store.d.ts.map +1 -0
- package/dist/features/chat/store.js +15 -1
- package/dist/features/chat/store.js.map +1 -0
- package/dist/features/chat/utils.d.ts +4 -2
- package/dist/features/chat/utils.d.ts.map +1 -0
- package/dist/features/chat/utils.js +15 -1
- package/dist/features/chat/utils.js.map +1 -0
- package/dist/features/data-fetching/use-api-client.d.ts +5 -3
- package/dist/features/data-fetching/use-api-client.d.ts.map +1 -0
- package/dist/features/data-fetching/use-api-client.js +2 -14
- package/dist/features/element/chatsdk-provider.d.ts +2 -0
- package/dist/features/element/chatsdk-provider.js +23 -0
- package/dist/features/element/chatsdk-provider.js.map +1 -0
- package/dist/features/element/constants.d.ts +5 -0
- package/dist/features/element/constants.d.ts.map +1 -0
- package/dist/features/element/constants.js +6 -0
- package/dist/features/element/constants.js.map +1 -0
- package/dist/features/element/element-provider.d.ts +2 -0
- package/dist/features/element/element-provider.js +83 -0
- package/dist/features/element/element-provider.js.map +1 -0
- package/dist/features/element/store.d.ts +2 -0
- package/dist/features/element/store.js +112 -0
- package/dist/features/element/store.js.map +1 -0
- package/dist/features/element/types/api.d.ts +2 -0
- package/dist/features/element/types/api.js +1 -0
- package/dist/features/element/types/callbacks.d.ts +2 -0
- package/dist/features/element/types/callbacks.js +1 -0
- package/dist/features/element/types/config.d.ts +2 -0
- package/dist/features/element/types/config.js +1 -0
- package/dist/features/element/types/context.d.ts +2 -0
- package/dist/features/element/types/context.js +1 -0
- package/dist/features/element/types/locale.d.ts +2 -0
- package/dist/features/element/types/locale.js +1 -0
- package/dist/features/element/types/theme.d.ts +2 -0
- package/dist/features/element/types/theme.js +1 -0
- package/dist/features/element/types/translations.d.ts +2 -0
- package/dist/features/element/types/translations.js +1 -0
- package/dist/features/element/use-element-config.d.ts +40 -0
- package/dist/features/element/use-element-config.d.ts.map +1 -0
- package/dist/features/element/use-element-config.js +39 -0
- package/dist/features/element/use-element-config.js.map +1 -0
- package/dist/features/element/use-merge-global-config.d.ts +20 -0
- package/dist/features/element/use-merge-global-config.d.ts.map +1 -0
- package/dist/features/element/use-merge-global-config.js +34 -0
- package/dist/features/element/use-merge-global-config.js.map +1 -0
- package/dist/features/element/utils.d.ts +2 -0
- package/dist/features/element/utils.js +86 -0
- package/dist/features/element/utils.js.map +1 -0
- package/dist/features/logger/logger.d.ts +2 -9
- package/dist/features/logger/logger.js +15 -1
- package/dist/features/logger/logger.js.map +1 -0
- package/dist/i18n/config.d.ts +2 -61
- package/dist/i18n/config.js +2 -1
- package/dist/i18n/i18next.d.ts +1382 -10
- package/dist/i18n/i18next.d.ts.map +1 -0
- package/dist/i18n/i18next.js +27 -2
- package/dist/i18n/i18next.js.map +1 -0
- package/dist/i18n/utils.d.ts +4 -3
- package/dist/i18n/utils.d.ts.map +1 -0
- package/dist/i18n/utils.js +10 -3
- package/dist/i18n/utils.js.map +1 -0
- package/dist/index.d.ts +5 -20
- package/dist/index.js +68 -20
- package/dist/index.js.map +1 -0
- package/dist/locale-W5Kyyi4X.d.ts +11 -0
- package/dist/locale-W5Kyyi4X.d.ts.map +1 -0
- package/dist/logger-BvmhODdq.d.ts +11 -0
- package/dist/logger-BvmhODdq.d.ts.map +1 -0
- package/dist/store-CGX9oRlE.d.ts +46 -0
- package/dist/store-CGX9oRlE.d.ts.map +1 -0
- package/dist/styles.css +1954 -1963
- package/dist/theme-Cb-RBWbR.d.ts +38 -0
- package/dist/theme-Cb-RBWbR.d.ts.map +1 -0
- package/package.json +18 -50
- package/dist/chunk-2LHKM7RD.js +0 -14
- package/dist/chunk-5UMYP6MD.js +0 -10
- package/dist/chunk-AP4MG32M.js +0 -36
- package/dist/chunk-CFM57HOS.js +0 -358
- package/dist/chunk-EGIUE7H2.js +0 -37
- package/dist/chunk-M5OONVIO.js +0 -90
- package/dist/chunk-MXTBCHYC.js +0 -31
- package/dist/chunk-NIC3MOMY.js +0 -55
- package/dist/chunk-QTRMNIG3.js +0 -83
- package/dist/chunk-R7G3RQLU.js +0 -36
- package/dist/chunk-RJG5D2TM.js +0 -113
- package/dist/chunk-SLJNKQ2G.js +0 -125
- package/dist/chunk-TDEFIW2L.js +0 -9
- package/dist/chunk-TDP6D7U7.js +0 -551
- package/dist/chunk-V2ITXC65.js +0 -24
- package/dist/chunk-VS55HRUS.js +0 -16
- package/dist/chunk-VYDYCGJL.js +0 -25
- package/dist/chunk-X5YUF2YM.js +0 -113
- package/dist/chunk-YX46JVQN.js +0 -78
- package/dist/chunk-YXAMLTTT.js +0 -16
- package/dist/chunk-YXFVHSY4.js +0 -51
- package/dist/chunk-ZCSZX3OI.js +0 -4
- package/dist/common/use-copy-to-clipboard.d.ts +0 -3
- package/dist/common/use-copy-to-clipboard.js +0 -33
- package/dist/common/utilts.d.ts +0 -8
- package/dist/common/utilts.js +0 -28
- package/dist/components/ai-elements/actions.d.ts +0 -13
- package/dist/components/ai-elements/actions.js +0 -42
- package/dist/components/ai-elements/agent.d.ts +0 -31
- package/dist/components/ai-elements/agent.js +0 -77
- package/dist/components/ai-elements/artifact.d.ts +0 -27
- package/dist/components/ai-elements/artifact.js +0 -108
- package/dist/components/ai-elements/attachments.d.ts +0 -57
- package/dist/components/ai-elements/attachments.js +0 -258
- package/dist/components/ai-elements/audio-player.d.ts +0 -33
- package/dist/components/ai-elements/audio-player.js +0 -199
- package/dist/components/ai-elements/canvas.d.ts +0 -10
- package/dist/components/ai-elements/canvas.js +0 -24
- package/dist/components/ai-elements/chain-of-thought.d.ts +0 -34
- package/dist/components/ai-elements/chain-of-thought.js +0 -159
- package/dist/components/ai-elements/checkpoint.d.ts +0 -16
- package/dist/components/ai-elements/checkpoint.js +0 -47
- package/dist/components/ai-elements/code-block.d.ts +0 -48
- package/dist/components/ai-elements/code-block.js +0 -1
- package/dist/components/ai-elements/commit.d.ts +0 -68
- package/dist/components/ai-elements/commit.js +0 -314
- package/dist/components/ai-elements/confirmation.d.ts +0 -52
- package/dist/components/ai-elements/confirmation.js +0 -76
- package/dist/components/ai-elements/connection.d.ts +0 -5
- package/dist/components/ai-elements/connection.js +0 -34
- package/dist/components/ai-elements/context.d.ts +0 -36
- package/dist/components/ai-elements/context.js +0 -320
- package/dist/components/ai-elements/controls.d.ts +0 -8
- package/dist/components/ai-elements/controls.js +0 -17
- package/dist/components/ai-elements/conversation.d.ts +0 -27
- package/dist/components/ai-elements/conversation.js +0 -119
- package/dist/components/ai-elements/edge.d.ts +0 -9
- package/dist/components/ai-elements/edge.js +0 -111
- package/dist/components/ai-elements/environment-variables.d.ts +0 -42
- package/dist/components/ai-elements/environment-variables.js +0 -208
- package/dist/components/ai-elements/file-tree.d.ts +0 -30
- package/dist/components/ai-elements/file-tree.js +0 -212
- package/dist/components/ai-elements/image.d.ts +0 -10
- package/dist/components/ai-elements/image.js +0 -23
- package/dist/components/ai-elements/inline-citation.d.ts +0 -42
- package/dist/components/ai-elements/inline-citation.js +0 -203
- package/dist/components/ai-elements/jsx-preview.d.ts +0 -33
- package/dist/components/ai-elements/jsx-preview.js +0 -206
- package/dist/components/ai-elements/loader.d.ts +0 -9
- package/dist/components/ai-elements/loader.js +0 -115
- package/dist/components/ai-elements/message.d.ts +0 -42
- package/dist/components/ai-elements/message.js +0 -259
- package/dist/components/ai-elements/mic-selector.d.ts +0 -49
- package/dist/components/ai-elements/mic-selector.js +0 -252
- package/dist/components/ai-elements/model-selector.d.ts +0 -39
- package/dist/components/ai-elements/model-selector.js +0 -73
- package/dist/components/ai-elements/node.d.ts +0 -25
- package/dist/components/ai-elements/node.js +0 -41
- package/dist/components/ai-elements/open-in-chat.d.ts +0 -32
- package/dist/components/ai-elements/open-in-chat.js +0 -366
- package/dist/components/ai-elements/package-info.d.ts +0 -32
- package/dist/components/ai-elements/package-info.js +0 -162
- package/dist/components/ai-elements/panel.d.ts +0 -8
- package/dist/components/ai-elements/panel.js +0 -17
- package/dist/components/ai-elements/persona.d.ts +0 -50
- package/dist/components/ai-elements/persona.js +0 -209
- package/dist/components/ai-elements/plan.d.ts +0 -29
- package/dist/components/ai-elements/plan.js +0 -95
- package/dist/components/ai-elements/prompt-input.d.ts +0 -153
- package/dist/components/ai-elements/prompt-input.js +0 -939
- package/dist/components/ai-elements/queue.d.ts +0 -65
- package/dist/components/ai-elements/queue.js +0 -179
- package/dist/components/ai-elements/reasoning.d.ts +0 -30
- package/dist/components/ai-elements/reasoning.js +0 -161
- package/dist/components/ai-elements/response.d.ts +0 -9
- package/dist/components/ai-elements/response.js +0 -33
- package/dist/components/ai-elements/sandbox.d.ts +0 -28
- package/dist/components/ai-elements/sandbox.js +0 -98
- package/dist/components/ai-elements/schema-display.d.ts +0 -58
- package/dist/components/ai-elements/schema-display.js +0 -313
- package/dist/components/ai-elements/shimmer.d.ts +0 -14
- package/dist/components/ai-elements/shimmer.js +0 -1
- package/dist/components/ai-elements/snippet.d.ts +0 -22
- package/dist/components/ai-elements/snippet.js +0 -90
- package/dist/components/ai-elements/sources.d.ts +0 -16
- package/dist/components/ai-elements/sources.js +0 -62
- package/dist/components/ai-elements/speech-input.d.ts +0 -57
- package/dist/components/ai-elements/speech-input.js +0 -206
- package/dist/components/ai-elements/stack-trace.d.ts +0 -42
- package/dist/components/ai-elements/stack-trace.js +0 -377
- package/dist/components/ai-elements/suggestion.d.ts +0 -14
- package/dist/components/ai-elements/suggestion.js +0 -41
- package/dist/components/ai-elements/task.d.ts +0 -18
- package/dist/components/ai-elements/task.js +0 -60
- package/dist/components/ai-elements/terminal.d.ts +0 -31
- package/dist/components/ai-elements/terminal.js +0 -203
- package/dist/components/ai-elements/test-results.d.ts +0 -61
- package/dist/components/ai-elements/test-results.js +0 -349
- package/dist/components/ai-elements/tool.d.ts +0 -35
- package/dist/components/ai-elements/tool.js +0 -2
- package/dist/components/ai-elements/toolbar.d.ts +0 -8
- package/dist/components/ai-elements/toolbar.js +0 -18
- package/dist/components/ai-elements/transcription.d.ts +0 -19
- package/dist/components/ai-elements/transcription.js +0 -90
- package/dist/components/ai-elements/voice-selector.d.ts +0 -66
- package/dist/components/ai-elements/voice-selector.js +0 -332
- package/dist/components/ai-elements/web-preview.d.ts +0 -38
- package/dist/components/ai-elements/web-preview.js +0 -214
- package/dist/components/responsive-alert-dialog.d.ts +0 -19
- package/dist/components/responsive-alert-dialog.js +0 -1
- package/dist/components/responsive-dialog.d.ts +0 -14
- package/dist/components/responsive-dialog.js +0 -1
- package/dist/config-IcWUmjwj.d.ts +0 -239
- package/dist/features/chat/chat-element/chat-element.d.ts +0 -8
- package/dist/features/chat/chat-element/chat-element.js +0 -14
- package/dist/features/chat/chat-element/use-chat.d.ts +0 -21
- package/dist/features/chat/chat-element/use-chat.js +0 -14
- package/dist/features/chat/chat-element/use-initial-messages.d.ts +0 -20
- package/dist/features/chat/chat-element/use-initial-messages.js +0 -14
- package/dist/features/chat/chat-message.d.ts +0 -10
- package/dist/features/chat/chat-message.js +0 -1
- package/dist/features/chat/chat-molecule.d.ts +0 -35
- package/dist/features/chat/chat-molecule.js +0 -14
- package/dist/features/molecule/chatsdk-provider.d.ts +0 -19
- package/dist/features/molecule/chatsdk-provider.js +0 -26
- package/dist/features/molecule/constants.d.ts +0 -3
- package/dist/features/molecule/constants.js +0 -1
- package/dist/features/molecule/molecule-provider.d.ts +0 -39
- package/dist/features/molecule/molecule-provider.js +0 -1
- package/dist/features/molecule/store.d.ts +0 -53
- package/dist/features/molecule/store.js +0 -3
- package/dist/features/molecule/types/api.d.ts +0 -8
- package/dist/features/molecule/types/api.js +0 -1
- package/dist/features/molecule/types/callbacks.d.ts +0 -22
- package/dist/features/molecule/types/callbacks.js +0 -1
- package/dist/features/molecule/types/config.d.ts +0 -10
- package/dist/features/molecule/types/config.js +0 -1
- package/dist/features/molecule/types/context.d.ts +0 -11
- package/dist/features/molecule/types/context.js +0 -1
- package/dist/features/molecule/types/locale.d.ts +0 -9
- package/dist/features/molecule/types/locale.js +0 -1
- package/dist/features/molecule/types/theme.d.ts +0 -38
- package/dist/features/molecule/types/theme.js +0 -1
- package/dist/features/molecule/types/translations.d.ts +0 -10
- package/dist/features/molecule/types/translations.js +0 -1
- package/dist/features/molecule/use-merge-global-config.d.ts +0 -22
- package/dist/features/molecule/use-merge-global-config.js +0 -5
- package/dist/features/molecule/use-molecule-config.d.ts +0 -41
- package/dist/features/molecule/use-molecule-config.js +0 -6
- package/dist/features/molecule/utils.d.ts +0 -10
- package/dist/features/molecule/utils.js +0 -1
|
@@ -1 +1,24 @@
|
|
|
1
|
-
|
|
1
|
+
import { FolderCode } from "lucide-react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import { Empty, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from "@chatsdk-dev/ui/atoms/empty";
|
|
5
|
+
//#region src/features/chat/chat-history/chat-history-empty.tsx
|
|
6
|
+
function ChatHistoryEmpty() {
|
|
7
|
+
const { t } = useTranslation("chat", { keyPrefix: "history.empty" });
|
|
8
|
+
return /* @__PURE__ */ jsx(Empty, {
|
|
9
|
+
className: "w-full h-full hover:bg-blue pb-32",
|
|
10
|
+
children: /* @__PURE__ */ jsxs(EmptyHeader, { children: [
|
|
11
|
+
/* @__PURE__ */ jsx(EmptyMedia, {
|
|
12
|
+
className: "size-8",
|
|
13
|
+
variant: "icon",
|
|
14
|
+
children: /* @__PURE__ */ jsx(FolderCode, { className: "size-4.5" })
|
|
15
|
+
}),
|
|
16
|
+
/* @__PURE__ */ jsx(EmptyTitle, { children: t("title") }),
|
|
17
|
+
/* @__PURE__ */ jsx(EmptyDescription, { children: t("description") })
|
|
18
|
+
] })
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { ChatHistoryEmpty };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=chat-history-empty.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-history-empty.js","names":[],"sources":["../../../../src/features/chat/chat-history/chat-history-empty.tsx"],"sourcesContent":["import { FolderCode } from \"lucide-react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n Empty,\n EmptyDescription,\n EmptyHeader,\n EmptyMedia,\n EmptyTitle,\n} from \"@chatsdk-dev/ui/atoms/empty\";\n\nexport function ChatHistoryEmpty() {\n const { t } = useTranslation(\"chat\", { keyPrefix: \"history.empty\" });\n\n return (\n <Empty className=\"w-full h-full hover:bg-blue pb-32\">\n <EmptyHeader>\n <EmptyMedia className=\"size-8\" variant=\"icon\">\n <FolderCode className=\"size-4.5\" />\n </EmptyMedia>\n <EmptyTitle>{t(\"title\")}</EmptyTitle>\n <EmptyDescription>{t(\"description\")}</EmptyDescription>\n </EmptyHeader>\n </Empty>\n );\n}\n"],"mappings":";;;;;AAWA,SAAgB,mBAAmB;CACjC,MAAM,EAAE,MAAM,eAAe,QAAQ,EAAE,WAAW,iBAAiB,CAAC;AAEpE,QACE,oBAAC,OAAD;EAAO,WAAU;YACf,qBAAC,aAAD,EAAA,UAAA;GACE,oBAAC,YAAD;IAAY,WAAU;IAAS,SAAQ;cACrC,oBAAC,YAAD,EAAY,WAAU,YAAa,CAAA;IACxB,CAAA;GACb,oBAAC,YAAD,EAAA,UAAa,EAAE,QAAQ,EAAc,CAAA;GACrC,oBAAC,kBAAD,EAAA,UAAmB,EAAE,cAAc,EAAoB,CAAA;GAC3C,EAAA,CAAA;EACR,CAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
declare function ChatHistory(): react_jsx_runtime.JSX.Element;
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
2
|
|
|
3
|
+
//#region src/features/chat/chat-history/chat-history.d.ts
|
|
4
|
+
declare function ChatHistory(): react_jsx_runtime0.JSX.Element;
|
|
5
|
+
//#endregion
|
|
5
6
|
export { ChatHistory };
|
|
7
|
+
//# sourceMappingURL=chat-history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-history.d.ts","names":[],"sources":["../../../../src/features/chat/chat-history/chat-history.tsx"],"mappings":";;;iBAegB,WAAA,CAAA,GAAW,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import '../../../chunk-YXAMLTTT.js';
|
|
4
|
-
import '../../../chunk-TDEFIW2L.js';
|
|
5
|
-
import '../../../chunk-M5OONVIO.js';
|
|
6
|
-
import '../../../chunk-VYDYCGJL.js';
|
|
7
|
-
import '../../../chunk-MXTBCHYC.js';
|
|
8
|
-
import '../../../chunk-2LHKM7RD.js';
|
|
9
|
-
import '../../../chunk-5UMYP6MD.js';
|
|
10
|
-
import '../../../chunk-VS55HRUS.js';
|
|
11
|
-
import '../../../chunk-YX46JVQN.js';
|
|
12
|
-
import '../../../chunk-RJG5D2TM.js';
|
|
13
|
-
import '../../../chunk-ZCSZX3OI.js';
|
|
14
|
-
import '../../../chunk-SLJNKQ2G.js';
|
|
1
|
+
import { m as ChatHistory } from "../../../chat-element-CCsDDFif.js";
|
|
2
|
+
export { ChatHistory };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
//#region src/features/chat/chat-main/chat-main.d.ts
|
|
4
|
+
declare function ChatMain(): react_jsx_runtime0.JSX.Element;
|
|
5
|
+
declare namespace ChatMain {
|
|
6
|
+
var displayName: string;
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { ChatMain };
|
|
10
|
+
//# sourceMappingURL=chat-main.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-main.d.ts","names":[],"sources":["../../../../src/features/chat/chat-main/chat-main.tsx"],"mappings":";;;iBAwBgB,QAAA,CAAA,GAAQ,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,kBAAR,QAAA;EAAA,IAAQ,WAAA;AAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as _ai_sdk_react0 from "@ai-sdk/react";
|
|
2
|
+
import * as ai from "ai";
|
|
3
|
+
|
|
4
|
+
//#region src/features/chat/chat-main/use-chat.d.ts
|
|
5
|
+
declare function useChat(): _ai_sdk_react0.UseChatHelpers<ai.UIMessage<unknown, ai.UIDataTypes, ai.UITools> | {
|
|
6
|
+
id: string;
|
|
7
|
+
role: "user" | "assistant" | "system";
|
|
8
|
+
parts: {
|
|
9
|
+
type: "text";
|
|
10
|
+
text: string;
|
|
11
|
+
}[];
|
|
12
|
+
metadata: {
|
|
13
|
+
id: string;
|
|
14
|
+
role: "user" | "assistant" | "system";
|
|
15
|
+
parts: Array<{
|
|
16
|
+
type: "text";
|
|
17
|
+
text: string;
|
|
18
|
+
}>;
|
|
19
|
+
};
|
|
20
|
+
}>;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { useChat };
|
|
23
|
+
//# sourceMappingURL=use-chat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-chat.d.ts","names":[],"sources":["../../../../src/features/chat/chat-main/use-chat.tsx"],"mappings":";;;;iBAWgB,OAAA,CAAA,kBAAO,cAAA,CAAA,EAAA,CAAA,SAAA,UAAA,EAAA,CAAA,WAAA,EAAA,EAAA,CAAA,OAAA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as ai from "ai";
|
|
2
|
+
|
|
3
|
+
//#region src/features/chat/chat-main/use-initial-messages.d.ts
|
|
4
|
+
declare function useInitialMessages(): (ai.UIMessage<unknown, ai.UIDataTypes, ai.UITools> | {
|
|
5
|
+
id: string;
|
|
6
|
+
role: "user" | "assistant" | "system";
|
|
7
|
+
parts: {
|
|
8
|
+
type: "text";
|
|
9
|
+
text: string;
|
|
10
|
+
}[];
|
|
11
|
+
metadata: {
|
|
12
|
+
id: string;
|
|
13
|
+
role: "user" | "assistant" | "system";
|
|
14
|
+
parts: Array<{
|
|
15
|
+
type: "text";
|
|
16
|
+
text: string;
|
|
17
|
+
}>;
|
|
18
|
+
};
|
|
19
|
+
})[];
|
|
20
|
+
//#endregion
|
|
21
|
+
export { useInitialMessages };
|
|
22
|
+
//# sourceMappingURL=use-initial-messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-initial-messages.d.ts","names":[],"sources":["../../../../src/features/chat/chat-main/use-initial-messages.tsx"],"mappings":";;;iBAQgB,kBAAA,CAAA,IAAkB,EAAA,CAAA,SAAA,UAAA,EAAA,CAAA,WAAA,EAAA,EAAA,CAAA,OAAA"}
|
|
@@ -1,16 +1,24 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import {
|
|
3
|
-
import { PromptInputMessage } from
|
|
4
|
-
import {
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
+
import { ChatModelSettings } from "@chatsdk-dev/api-client";
|
|
3
|
+
import { PromptInputMessage } from "@chatsdk-dev/ui/molecules/ai/prompt-input";
|
|
4
|
+
import { ChatStatus } from "ai";
|
|
5
5
|
|
|
6
|
+
//#region src/features/chat/chat-prompt-input.d.ts
|
|
6
7
|
interface ChatPromptInputProps {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
chatId?: string;
|
|
9
|
+
onSubmit: (message: PromptInputMessage, event: React.SubmitEvent<HTMLFormElement>) => void;
|
|
10
|
+
onModelChange?: (model: ChatModelSettings["defaultModel"]) => void;
|
|
11
|
+
onWebSearchChange?: (webSearch: boolean) => void;
|
|
12
|
+
status: ChatStatus;
|
|
13
|
+
ref: React.RefObject<HTMLTextAreaElement | null>;
|
|
13
14
|
}
|
|
14
|
-
declare function ChatPromptInput({
|
|
15
|
-
|
|
15
|
+
declare function ChatPromptInput({
|
|
16
|
+
chatId,
|
|
17
|
+
onSubmit,
|
|
18
|
+
onModelChange,
|
|
19
|
+
status,
|
|
20
|
+
ref
|
|
21
|
+
}: ChatPromptInputProps): react_jsx_runtime0.JSX.Element;
|
|
22
|
+
//#endregion
|
|
16
23
|
export { ChatPromptInput };
|
|
24
|
+
//# sourceMappingURL=chat-prompt-input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-prompt-input.d.ts","names":[],"sources":["../../../src/features/chat/chat-prompt-input.tsx"],"mappings":";;;;;;UAgCU,oBAAA;EACR,MAAA;EACA,QAAA,GACE,OAAA,EAAS,kBAAA,EACT,KAAA,EAAO,KAAA,CAAM,WAAA,CAAY,eAAA;EAE3B,aAAA,IAAiB,KAAA,EAAO,iBAAA;EACxB,iBAAA,IAAqB,SAAA;EACrB,MAAA,EAAQ,UAAA;EACR,GAAA,EAAK,KAAA,CAAM,SAAA,CAAU,mBAAA;AAAA;AAAA,iBAGP,eAAA,CAAA;EACd,MAAA;EACA,QAAA;EACA,aAAA;EACA,MAAA;EACA;AAAA,GACC,oBAAA,GAAoB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
import '../../chunk-TDEFIW2L.js';
|
|
5
|
-
import '../../chunk-M5OONVIO.js';
|
|
6
|
-
import '../../chunk-VYDYCGJL.js';
|
|
7
|
-
import '../../chunk-MXTBCHYC.js';
|
|
8
|
-
import '../../chunk-2LHKM7RD.js';
|
|
9
|
-
import '../../chunk-5UMYP6MD.js';
|
|
10
|
-
import '../../chunk-VS55HRUS.js';
|
|
11
|
-
import '../../chunk-YX46JVQN.js';
|
|
12
|
-
import '../../chunk-RJG5D2TM.js';
|
|
13
|
-
import '../../chunk-ZCSZX3OI.js';
|
|
14
|
-
import '../../chunk-SLJNKQ2G.js';
|
|
1
|
+
"use client";
|
|
2
|
+
import { p as ChatPromptInput } from "../../chat-element-CCsDDFif.js";
|
|
3
|
+
export { ChatPromptInput };
|
|
@@ -1,26 +1,28 @@
|
|
|
1
|
+
//#region src/features/chat/chat.context.d.ts
|
|
1
2
|
type SendMessageData = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
message: string;
|
|
4
|
+
model: string;
|
|
5
|
+
webSearch: boolean;
|
|
5
6
|
};
|
|
6
7
|
interface ChatBaseSettings {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
displayName: string;
|
|
9
|
+
inputPlaceholder: string;
|
|
10
|
+
initialMessages: string[];
|
|
10
11
|
}
|
|
11
12
|
interface ChatModelSettings {
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
model: string;
|
|
14
|
+
temperature: number;
|
|
14
15
|
}
|
|
15
16
|
interface ChatAppearanceSettings {
|
|
16
|
-
|
|
17
|
+
colorScheme: string;
|
|
17
18
|
}
|
|
18
19
|
interface ChatElementProps {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
chatId?: string;
|
|
21
|
+
baseSettings?: ChatBaseSettings;
|
|
22
|
+
modelSettings?: ChatModelSettings;
|
|
23
|
+
appearanceSettings?: ChatAppearanceSettings;
|
|
23
24
|
}
|
|
24
25
|
declare const chatElementDefaultProps: ChatElementProps;
|
|
25
|
-
|
|
26
|
-
export {
|
|
26
|
+
//#endregion
|
|
27
|
+
export { ChatAppearanceSettings, ChatBaseSettings, ChatElementProps, ChatModelSettings, SendMessageData, chatElementDefaultProps };
|
|
28
|
+
//# sourceMappingURL=chat.context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.context.d.ts","names":[],"sources":["../../../src/features/chat/chat.context.tsx"],"mappings":";KAAY,eAAA;EACV,OAAA;EACA,KAAA;EACA,SAAA;AAAA;AAAA,UAGe,gBAAA;EACf,WAAA;EACA,gBAAA;EACA,eAAA;AAAA;AAAA,UAGe,iBAAA;EACf,KAAA;EACA,WAAA;AAAA;AAAA,UAGe,sBAAA;EACf,WAAA;AAAA;AAAA,UAEe,gBAAA;EACf,MAAA;EACA,YAAA,GAAe,gBAAA;EACf,aAAA,GAAgB,iBAAA;EAChB,kBAAA,GAAqB,sBAAA;AAAA;AAAA,cAGV,uBAAA,EAAyB,gBAAA"}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"Hello! If you have any questions, I'm here to help you."
|
|
9
|
-
]
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
|
|
1
|
+
//#region src/features/chat/chat.context.tsx
|
|
2
|
+
const chatElementDefaultProps = { baseSettings: {
|
|
3
|
+
displayName: "AI Assistant",
|
|
4
|
+
inputPlaceholder: "Message...",
|
|
5
|
+
initialMessages: ["Hello! If you have any questions, I'm here to help you."]
|
|
6
|
+
} };
|
|
7
|
+
//#endregion
|
|
13
8
|
export { chatElementDefaultProps };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=chat.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.context.js","names":[],"sources":["../../../src/features/chat/chat.context.tsx"],"sourcesContent":["export type SendMessageData = {\n message: string;\n model: string;\n webSearch: boolean;\n};\n\nexport interface ChatBaseSettings {\n displayName: string;\n inputPlaceholder: string;\n initialMessages: string[];\n}\n\nexport interface ChatModelSettings {\n model: string;\n temperature: number;\n}\n\nexport interface ChatAppearanceSettings {\n colorScheme: string;\n}\nexport interface ChatElementProps {\n chatId?: string;\n baseSettings?: ChatBaseSettings;\n modelSettings?: ChatModelSettings;\n appearanceSettings?: ChatAppearanceSettings;\n}\n\nexport const chatElementDefaultProps: ChatElementProps = {\n baseSettings: {\n // title\n displayName: \"AI Assistant\",\n inputPlaceholder: \"Message...\",\n initialMessages: [\n \"Hello! If you have any questions, I'm here to help you.\",\n ],\n },\n};\n"],"mappings":";AA2BA,MAAa,0BAA4C,EACvD,cAAc;CAEZ,aAAa;CACb,kBAAkB;CAClB,iBAAiB,CACf,0DACD;CACF,EACF"}
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import '../../config-IcWUmjwj.js';
|
|
4
|
-
import '../logger/logger.js';
|
|
5
|
-
import '../molecule/types/api.js';
|
|
6
|
-
import '@chatsdk-dev/api-client';
|
|
7
|
-
import '../molecule/types/context.js';
|
|
8
|
-
import '../molecule/types/locale.js';
|
|
9
|
-
import '@chatsdk-dev/elements/i18n/config';
|
|
10
|
-
import '../molecule/types/theme.js';
|
|
11
|
-
import '@chatsdk-dev/ui/components/typography/text';
|
|
12
|
-
import 'react/jsx-runtime';
|
|
13
|
-
import '../molecule/molecule-provider.js';
|
|
14
|
-
import 'react';
|
|
1
|
+
import { a as useElementComponent, i as useElementCallbacks, n as ElementProvider, o as useElementConfig, r as useElement, t as ChatElement } from "../../chat-element-CSpa62Te.js";
|
|
2
|
+
export { ChatElement, ElementProvider, useElement, useElementCallbacks, useElementComponent, useElementConfig };
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import '../../chunk-YXAMLTTT.js';
|
|
4
|
-
import '../../chunk-TDEFIW2L.js';
|
|
5
|
-
import '../../chunk-M5OONVIO.js';
|
|
6
|
-
import '../../chunk-VYDYCGJL.js';
|
|
7
|
-
import '../../chunk-MXTBCHYC.js';
|
|
8
|
-
import '../../chunk-2LHKM7RD.js';
|
|
9
|
-
import '../../chunk-5UMYP6MD.js';
|
|
10
|
-
import '../../chunk-VS55HRUS.js';
|
|
11
|
-
import '../../chunk-YX46JVQN.js';
|
|
12
|
-
import '../../chunk-RJG5D2TM.js';
|
|
13
|
-
import '../../chunk-ZCSZX3OI.js';
|
|
14
|
-
import '../../chunk-SLJNKQ2G.js';
|
|
1
|
+
import { a as useElementComponent, i as useElementCallbacks, n as ElementProvider, o as useElementConfig, r as useElement, t as ChatElement } from "../../chat-element-CCsDDFif.js";
|
|
2
|
+
export { ChatElement, ElementProvider, useElement, useElementCallbacks, useElementComponent, useElementConfig };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
//#region src/features/chat/queries/query-keys.d.ts
|
|
1
2
|
declare const chatQueryKeys: {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
all: () => readonly ["chat"];
|
|
4
|
+
get: (chatId?: string) => readonly ["chat", "get", string | undefined];
|
|
5
|
+
listConversations: (chatId?: string) => readonly ["chat", "get", string | undefined, "conversations"];
|
|
6
|
+
conversation: (chatId?: string, conversationId?: string | null) => readonly ["chat", "get", string | undefined, "conversation", string | null | undefined];
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
+
//#endregion
|
|
8
9
|
export { chatQueryKeys };
|
|
10
|
+
//# sourceMappingURL=query-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-keys.d.ts","names":[],"sources":["../../../../src/features/chat/queries/query-keys.ts"],"mappings":";cAAa,aAAA;;;;kCAKmB,cAAA;AAAA"}
|
|
@@ -1 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/features/chat/queries/query-keys.ts
|
|
2
|
+
const chatQueryKeys = {
|
|
3
|
+
all: () => ["chat"],
|
|
4
|
+
get: (chatId) => [
|
|
5
|
+
...chatQueryKeys.all(),
|
|
6
|
+
"get",
|
|
7
|
+
chatId
|
|
8
|
+
],
|
|
9
|
+
listConversations: (chatId) => [...chatQueryKeys.get(chatId), "conversations"],
|
|
10
|
+
conversation: (chatId, conversationId) => [
|
|
11
|
+
...chatQueryKeys.get(chatId),
|
|
12
|
+
"conversation",
|
|
13
|
+
conversationId
|
|
14
|
+
]
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { chatQueryKeys };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=query-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-keys.js","names":[],"sources":["../../../../src/features/chat/queries/query-keys.ts"],"sourcesContent":["export const chatQueryKeys = {\n all: () => [\"chat\"] as const,\n get: (chatId?: string) => [...chatQueryKeys.all(), \"get\", chatId] as const,\n listConversations: (chatId?: string) =>\n [...chatQueryKeys.get(chatId), \"conversations\"] as const,\n conversation: (chatId?: string, conversationId?: string | null) =>\n [...chatQueryKeys.get(chatId), \"conversation\", conversationId] as const,\n};\n"],"mappings":";AAAA,MAAa,gBAAgB;CAC3B,WAAW,CAAC,OAAO;CACnB,MAAM,WAAoB;EAAC,GAAG,cAAc,KAAK;EAAE;EAAO;EAAO;CACjE,oBAAoB,WAClB,CAAC,GAAG,cAAc,IAAI,OAAO,EAAE,gBAAgB;CACjD,eAAe,QAAiB,mBAC9B;EAAC,GAAG,cAAc,IAAI,OAAO;EAAE;EAAgB;EAAe;CACjE"}
|
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _tanstack_react_query0 from "@tanstack/react-query";
|
|
2
2
|
|
|
3
|
+
//#region src/features/chat/queries/use-create-conversation-mutation.d.ts
|
|
3
4
|
interface UseCreateConversationMutationProps {
|
|
4
|
-
|
|
5
|
+
chatId?: string;
|
|
5
6
|
}
|
|
6
|
-
declare function useCreateConversationMutation({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
7
|
+
declare function useCreateConversationMutation({
|
|
8
|
+
chatId
|
|
9
|
+
}: UseCreateConversationMutationProps): _tanstack_react_query0.UseMutationResult<{
|
|
10
|
+
actor: {
|
|
11
|
+
id: string;
|
|
12
|
+
type: "default" | "tenant";
|
|
13
|
+
};
|
|
14
|
+
usage: {
|
|
15
|
+
messageCredits: number;
|
|
16
|
+
};
|
|
17
|
+
status: "active" | "archived";
|
|
18
|
+
summary?: string;
|
|
19
|
+
title?: string;
|
|
20
|
+
messages: Array<{
|
|
21
|
+
id: string;
|
|
22
|
+
role: "user" | "assistant" | "system";
|
|
23
|
+
parts: Array<{
|
|
24
|
+
type: "text";
|
|
25
|
+
text: string;
|
|
24
26
|
}>;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
}>;
|
|
28
|
+
_id: string;
|
|
29
|
+
_creationTime: number;
|
|
27
30
|
}, Error, void, unknown>;
|
|
28
|
-
|
|
31
|
+
//#endregion
|
|
29
32
|
export { useCreateConversationMutation };
|
|
33
|
+
//# sourceMappingURL=use-create-conversation-mutation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-create-conversation-mutation.d.ts","names":[],"sources":["../../../../src/features/chat/queries/use-create-conversation-mutation.ts"],"mappings":";;;UAKU,kCAAA;EACR,MAAA;AAAA;AAAA,iBAGc,6BAAA,CAAA;EACd;AAAA,GACC,kCAAA,0BAAkC,iBAAA"}
|
|
@@ -1,38 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
import { useMutation } from '@tanstack/react-query';
|
|
16
|
-
|
|
17
|
-
function useCreateConversationMutation({
|
|
18
|
-
chatId
|
|
19
|
-
}) {
|
|
20
|
-
const client = useApiClient();
|
|
21
|
-
const { context } = useMoleculeConfig();
|
|
22
|
-
return useMutation({
|
|
23
|
-
mutationFn: async () => {
|
|
24
|
-
const { data, error } = await client.chats.conversations.create({
|
|
25
|
-
path: { chatId },
|
|
26
|
-
body: { actorId: context?.actor?.id ?? "" }
|
|
27
|
-
});
|
|
28
|
-
if (error) {
|
|
29
|
-
throw new Error(
|
|
30
|
-
"error" in error ? error.error : "Failed to create conversation"
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
return data;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
1
|
+
import { o as useElementConfig, v as useApiClient } from "../../../chat-element-CCsDDFif.js";
|
|
2
|
+
import { useMutation } from "@tanstack/react-query";
|
|
3
|
+
//#region src/features/chat/queries/use-create-conversation-mutation.ts
|
|
4
|
+
function useCreateConversationMutation({ chatId }) {
|
|
5
|
+
const client = useApiClient();
|
|
6
|
+
const { context } = useElementConfig();
|
|
7
|
+
return useMutation({ mutationFn: async () => {
|
|
8
|
+
const { data, error } = await client.chats.conversations.create({
|
|
9
|
+
path: { chatId },
|
|
10
|
+
body: { actorId: context?.actor?.id ?? "" }
|
|
11
|
+
});
|
|
12
|
+
if (error) throw new Error("error" in error ? error.error : "Failed to create conversation");
|
|
13
|
+
return data;
|
|
14
|
+
} });
|
|
36
15
|
}
|
|
37
|
-
|
|
16
|
+
//#endregion
|
|
38
17
|
export { useCreateConversationMutation };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=use-create-conversation-mutation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-create-conversation-mutation.js","names":[],"sources":["../../../../src/features/chat/queries/use-create-conversation-mutation.ts"],"sourcesContent":["import { useMutation } from \"@tanstack/react-query\";\n\nimport { useApiClient } from \"../../data-fetching/use-api-client\";\nimport { useElementConfig } from \"../chat-element\";\n\ninterface UseCreateConversationMutationProps {\n chatId?: string;\n}\n\nexport function useCreateConversationMutation({\n chatId,\n}: UseCreateConversationMutationProps) {\n const client = useApiClient();\n const { context } = useElementConfig();\n\n return useMutation({\n mutationFn: async () => {\n const { data, error } = await client.chats.conversations.create({\n path: { chatId: chatId! },\n body: { actorId: context?.actor?.id ?? \"\" },\n });\n\n if (error) {\n throw new Error(\n \"error\" in error ? error.error : \"Failed to create conversation\",\n );\n }\n\n return data;\n },\n });\n}\n"],"mappings":";;;AASA,SAAgB,8BAA8B,EAC5C,UACqC;CACrC,MAAM,SAAS,cAAc;CAC7B,MAAM,EAAE,YAAY,kBAAkB;AAEtC,QAAO,YAAY,EACjB,YAAY,YAAY;EACtB,MAAM,EAAE,MAAM,UAAU,MAAM,OAAO,MAAM,cAAc,OAAO;GAC9D,MAAM,EAAU,QAAS;GACzB,MAAM,EAAE,SAAS,SAAS,OAAO,MAAM,IAAI;GAC5C,CAAC;AAEF,MAAI,MACF,OAAM,IAAI,MACR,WAAW,QAAQ,MAAM,QAAQ,gCAClC;AAGH,SAAO;IAEV,CAAC"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as _tanstack_react_query0 from "@tanstack/react-query";
|
|
2
|
+
import * as _chatsdk_dev_api_client0 from "@chatsdk-dev/api-client";
|
|
3
3
|
|
|
4
|
+
//#region src/features/chat/queries/use-get-chat-query.d.ts
|
|
4
5
|
interface UseGetChatQueryProps {
|
|
5
|
-
|
|
6
|
+
chatId?: string;
|
|
6
7
|
}
|
|
7
|
-
declare function useGetChatQuery({
|
|
8
|
-
|
|
8
|
+
declare function useGetChatQuery({
|
|
9
|
+
chatId
|
|
10
|
+
}: UseGetChatQueryProps): _tanstack_react_query0.UseQueryResult<_chatsdk_dev_api_client0.Chat, Error>;
|
|
11
|
+
//#endregion
|
|
9
12
|
export { useGetChatQuery };
|
|
13
|
+
//# sourceMappingURL=use-get-chat-query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-get-chat-query.d.ts","names":[],"sources":["../../../../src/features/chat/queries/use-get-chat-query.ts"],"mappings":";;;;UAKU,oBAAA;EACR,MAAA;AAAA;AAAA,iBAGc,eAAA,CAAA;EAAkB;AAAA,GAAU,oBAAA,GAAoB,sBAAA,CAAA,cAAA,CAAA,wBAAA,CAAA,IAAA,EAAA,KAAA"}
|
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import '../../../chunk-YXAMLTTT.js';
|
|
4
|
-
import '../../../chunk-TDEFIW2L.js';
|
|
5
|
-
import '../../../chunk-M5OONVIO.js';
|
|
6
|
-
import '../../../chunk-VYDYCGJL.js';
|
|
7
|
-
import '../../../chunk-MXTBCHYC.js';
|
|
8
|
-
import '../../../chunk-2LHKM7RD.js';
|
|
9
|
-
import '../../../chunk-5UMYP6MD.js';
|
|
10
|
-
import '../../../chunk-VS55HRUS.js';
|
|
11
|
-
import '../../../chunk-YX46JVQN.js';
|
|
12
|
-
import '../../../chunk-RJG5D2TM.js';
|
|
13
|
-
import '../../../chunk-ZCSZX3OI.js';
|
|
14
|
-
import '../../../chunk-SLJNKQ2G.js';
|
|
1
|
+
import { _ as useGetChatQuery } from "../../../chat-element-CCsDDFif.js";
|
|
2
|
+
export { useGetChatQuery };
|