@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
package/dist/chunk-M5OONVIO.js
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
|
2
|
-
import { createContext, use } from 'react';
|
|
3
|
-
import { I18nextProvider } from 'react-i18next';
|
|
4
|
-
import { languages } from '@chatsdk-dev/elements/i18n/config';
|
|
5
|
-
import { i18n } from '@chatsdk-dev/elements/i18n/i18next';
|
|
6
|
-
import { getLocaleChainFromLocale } from '@chatsdk-dev/elements/i18n/utils';
|
|
7
|
-
import { jsx } from 'react/jsx-runtime';
|
|
8
|
-
|
|
9
|
-
// src/features/molecule/molecule-provider.tsx
|
|
10
|
-
var queryClient = new QueryClient();
|
|
11
|
-
function MoleculeTranslationsProvider({
|
|
12
|
-
localeConfig,
|
|
13
|
-
translationsConfig,
|
|
14
|
-
children
|
|
15
|
-
}) {
|
|
16
|
-
let language = localeConfig?.language;
|
|
17
|
-
if (language && !languages.includes(language)) {
|
|
18
|
-
const [_languageTag] = getLocaleChainFromLocale(language);
|
|
19
|
-
if (_languageTag && languages.includes(_languageTag)) {
|
|
20
|
-
language = _languageTag;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
let _i18n = i18n;
|
|
24
|
-
if (language && (i18n.language !== language || i18n.options.formality !== localeConfig?.formality) && Object.keys(i18n.services.resourceStore.data).includes(language)) {
|
|
25
|
-
_i18n = i18n.cloneInstance({
|
|
26
|
-
lng: language,
|
|
27
|
-
formality: localeConfig?.formality
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
if (translationsConfig) {
|
|
31
|
-
for (const [namespace, translations] of Object.entries(
|
|
32
|
-
translationsConfig
|
|
33
|
-
)) {
|
|
34
|
-
for (const [language2, resource] of Object.entries(translations)) {
|
|
35
|
-
_i18n.addResourceBundle(language2, namespace, resource, true, true);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return /* @__PURE__ */ jsx(I18nextProvider, { i18n: _i18n, defaultNS: "molecules", children });
|
|
40
|
-
}
|
|
41
|
-
function createMoleculeContext({
|
|
42
|
-
name
|
|
43
|
-
}) {
|
|
44
|
-
const MoleculeContext = createContext(null);
|
|
45
|
-
function useMolecule() {
|
|
46
|
-
const v = use(MoleculeContext);
|
|
47
|
-
if (!v) throw new Error("Must be used within its MoleculeProvider");
|
|
48
|
-
return v;
|
|
49
|
-
}
|
|
50
|
-
function useMoleculeConfig() {
|
|
51
|
-
const v = use(MoleculeContext);
|
|
52
|
-
if (!v) throw new Error("Must be used within its MoleculeProvider");
|
|
53
|
-
return v.config;
|
|
54
|
-
}
|
|
55
|
-
function useMoleculeComponent() {
|
|
56
|
-
const v = use(MoleculeContext);
|
|
57
|
-
if (!v) throw new Error("Must be used within its MoleculeProvider");
|
|
58
|
-
return v.component;
|
|
59
|
-
}
|
|
60
|
-
function useMoleculeCallbacks() {
|
|
61
|
-
const v = use(MoleculeContext);
|
|
62
|
-
if (!v) throw new Error("Must be used within its MoleculeProvider");
|
|
63
|
-
return v.callbacks;
|
|
64
|
-
}
|
|
65
|
-
function TypedMoleculeProvider({
|
|
66
|
-
config = {},
|
|
67
|
-
component,
|
|
68
|
-
callbacks,
|
|
69
|
-
children
|
|
70
|
-
}) {
|
|
71
|
-
return /* @__PURE__ */ jsx(MoleculeContext.Provider, { value: { config, component, callbacks }, children: /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx(
|
|
72
|
-
MoleculeTranslationsProvider,
|
|
73
|
-
{
|
|
74
|
-
localeConfig: config.locale,
|
|
75
|
-
translationsConfig: config.translations,
|
|
76
|
-
children
|
|
77
|
-
}
|
|
78
|
-
) }) });
|
|
79
|
-
}
|
|
80
|
-
TypedMoleculeProvider.displayName = `MoleculeProvider<${name}>`;
|
|
81
|
-
return {
|
|
82
|
-
useMolecule,
|
|
83
|
-
useMoleculeConfig,
|
|
84
|
-
useMoleculeComponent,
|
|
85
|
-
useMoleculeCallbacks,
|
|
86
|
-
MoleculeProvider: TypedMoleculeProvider
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
export { createMoleculeContext };
|
package/dist/chunk-MXTBCHYC.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { getLogger } from './chunk-VS55HRUS.js';
|
|
2
|
-
import { useChatSDKStore } from './chunk-YX46JVQN.js';
|
|
3
|
-
import { mergeConfigs } from './chunk-RJG5D2TM.js';
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { useShallow } from 'zustand/react/shallow';
|
|
6
|
-
|
|
7
|
-
function useMergeGlobalConfig(config) {
|
|
8
|
-
const globalConfig = useChatSDKStore(
|
|
9
|
-
useShallow((state) => ({
|
|
10
|
-
theme: state.theme,
|
|
11
|
-
locale: state.locale,
|
|
12
|
-
context: state.context,
|
|
13
|
-
api: state.api,
|
|
14
|
-
translations: state.translations,
|
|
15
|
-
logger: state.logger,
|
|
16
|
-
options: state.options
|
|
17
|
-
}))
|
|
18
|
-
);
|
|
19
|
-
const withGlobalConfig = React.useMemo(() => {
|
|
20
|
-
return mergeConfigs(globalConfig, config || {});
|
|
21
|
-
}, [globalConfig, config]);
|
|
22
|
-
const resolvedLogger = getLogger(withGlobalConfig.logger);
|
|
23
|
-
const resolvedLocale = withGlobalConfig.locale ? typeof withGlobalConfig.locale === "object" ? withGlobalConfig.locale : { language: withGlobalConfig.locale, formality: "formal" } : void 0;
|
|
24
|
-
return {
|
|
25
|
-
...withGlobalConfig,
|
|
26
|
-
logger: resolvedLogger,
|
|
27
|
-
locale: resolvedLocale
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { useMergeGlobalConfig };
|
package/dist/chunk-NIC3MOMY.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { cn } from '@chatsdk-dev/ui/lib/utils';
|
|
2
|
-
import { motion } from 'motion/react';
|
|
3
|
-
import { memo, useMemo } from 'react';
|
|
4
|
-
import { jsx } from 'react/jsx-runtime';
|
|
5
|
-
|
|
6
|
-
// src/components/ai-elements/shimmer.tsx
|
|
7
|
-
var motionComponentCache = /* @__PURE__ */ new Map();
|
|
8
|
-
var getMotionComponent = (element) => {
|
|
9
|
-
let component = motionComponentCache.get(element);
|
|
10
|
-
if (!component) {
|
|
11
|
-
component = motion.create(element);
|
|
12
|
-
motionComponentCache.set(element, component);
|
|
13
|
-
}
|
|
14
|
-
return component;
|
|
15
|
-
};
|
|
16
|
-
var ShimmerComponent = ({
|
|
17
|
-
children,
|
|
18
|
-
as: Component = "p",
|
|
19
|
-
className,
|
|
20
|
-
duration = 2,
|
|
21
|
-
spread = 2
|
|
22
|
-
}) => {
|
|
23
|
-
const MotionComponent = getMotionComponent(
|
|
24
|
-
Component
|
|
25
|
-
);
|
|
26
|
-
const dynamicSpread = useMemo(
|
|
27
|
-
() => (children?.length ?? 0) * spread,
|
|
28
|
-
[children, spread]
|
|
29
|
-
);
|
|
30
|
-
return /* @__PURE__ */ jsx(
|
|
31
|
-
MotionComponent,
|
|
32
|
-
{
|
|
33
|
-
animate: { backgroundPosition: "0% center" },
|
|
34
|
-
className: cn(
|
|
35
|
-
"relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent",
|
|
36
|
-
"[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]",
|
|
37
|
-
className
|
|
38
|
-
),
|
|
39
|
-
initial: { backgroundPosition: "100% center" },
|
|
40
|
-
style: {
|
|
41
|
-
"--spread": `${dynamicSpread}px`,
|
|
42
|
-
backgroundImage: "var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))"
|
|
43
|
-
},
|
|
44
|
-
transition: {
|
|
45
|
-
duration,
|
|
46
|
-
ease: "linear",
|
|
47
|
-
repeat: Number.POSITIVE_INFINITY
|
|
48
|
-
},
|
|
49
|
-
children
|
|
50
|
-
}
|
|
51
|
-
);
|
|
52
|
-
};
|
|
53
|
-
var Shimmer = memo(ShimmerComponent);
|
|
54
|
-
|
|
55
|
-
export { Shimmer };
|
package/dist/chunk-QTRMNIG3.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { cloneElement } from 'react';
|
|
2
|
-
import { AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogCancel, AlertDialogAction } from '@chatsdk-dev/ui/components/alert-dialog';
|
|
3
|
-
import { Button } from '@chatsdk-dev/ui/components/button';
|
|
4
|
-
import { ButtonLoaderIcon } from '@chatsdk-dev/ui/components/button-loader';
|
|
5
|
-
import { Drawer, DrawerTrigger, DrawerContent, DrawerHeader, DrawerTitle, DrawerDescription, DrawerFooter, DrawerClose } from '@chatsdk-dev/ui/components/drawer';
|
|
6
|
-
import { useBreakpoint } from '@chatsdk-dev/ui/hooks/use-breakpoint';
|
|
7
|
-
import { useControllableState } from '@chatsdk-dev/ui/hooks/use-controllable-state';
|
|
8
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
9
|
-
|
|
10
|
-
// src/components/responsive-alert-dialog.tsx
|
|
11
|
-
function ResponsiveAlertDialog({
|
|
12
|
-
open,
|
|
13
|
-
onOpenChange,
|
|
14
|
-
children,
|
|
15
|
-
trigger,
|
|
16
|
-
title,
|
|
17
|
-
titleIcon,
|
|
18
|
-
description,
|
|
19
|
-
isPending,
|
|
20
|
-
action,
|
|
21
|
-
onAction,
|
|
22
|
-
cancelLabel,
|
|
23
|
-
onCancel
|
|
24
|
-
}) {
|
|
25
|
-
const [openState, setOpenState] = useControllableState({
|
|
26
|
-
value: open,
|
|
27
|
-
defaultValue: false,
|
|
28
|
-
onChange: onOpenChange
|
|
29
|
-
});
|
|
30
|
-
const sm = useBreakpoint("sm");
|
|
31
|
-
if (sm) {
|
|
32
|
-
return /* @__PURE__ */ jsxs(AlertDialog, { open: openState, onOpenChange: setOpenState, children: [
|
|
33
|
-
trigger && /* @__PURE__ */ jsx(
|
|
34
|
-
AlertDialogTrigger,
|
|
35
|
-
{
|
|
36
|
-
render: (props) => cloneElement(trigger, props)
|
|
37
|
-
}
|
|
38
|
-
),
|
|
39
|
-
/* @__PURE__ */ jsxs(AlertDialogContent, { className: "sm:max-w-106", children: [
|
|
40
|
-
/* @__PURE__ */ jsx(AlertDialogHeader, { children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
41
|
-
titleIcon,
|
|
42
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
43
|
-
/* @__PURE__ */ jsx(AlertDialogTitle, { children: title }),
|
|
44
|
-
/* @__PURE__ */ jsx(AlertDialogDescription, { children: description })
|
|
45
|
-
] })
|
|
46
|
-
] }) }),
|
|
47
|
-
children,
|
|
48
|
-
/* @__PURE__ */ jsxs(AlertDialogFooter, { children: [
|
|
49
|
-
cancelLabel && /* @__PURE__ */ jsx(AlertDialogCancel, { onClick: onCancel, children: cancelLabel }),
|
|
50
|
-
typeof action === "string" ? /* @__PURE__ */ jsx(
|
|
51
|
-
AlertDialogAction,
|
|
52
|
-
{
|
|
53
|
-
onClick: onAction,
|
|
54
|
-
disabled: isPending,
|
|
55
|
-
variant: "destructive",
|
|
56
|
-
className: "relative inline-flex px-7",
|
|
57
|
-
children: /* @__PURE__ */ jsxs("div", { className: "relative flex items-center justify-center", children: [
|
|
58
|
-
isPending && /* @__PURE__ */ jsx(ButtonLoaderIcon, {}),
|
|
59
|
-
action
|
|
60
|
-
] })
|
|
61
|
-
}
|
|
62
|
-
) : action
|
|
63
|
-
] })
|
|
64
|
-
] })
|
|
65
|
-
] });
|
|
66
|
-
}
|
|
67
|
-
return /* @__PURE__ */ jsxs(Drawer, { open: openState, onOpenChange: setOpenState, children: [
|
|
68
|
-
/* @__PURE__ */ jsx(DrawerTrigger, { asChild: true, children: trigger }),
|
|
69
|
-
/* @__PURE__ */ jsxs(DrawerContent, { children: [
|
|
70
|
-
/* @__PURE__ */ jsxs(DrawerHeader, { className: "text-left", children: [
|
|
71
|
-
/* @__PURE__ */ jsx(DrawerTitle, { children: title }),
|
|
72
|
-
/* @__PURE__ */ jsx(DrawerDescription, { children: description })
|
|
73
|
-
] }),
|
|
74
|
-
children,
|
|
75
|
-
/* @__PURE__ */ jsxs(DrawerFooter, { className: "pt-2", children: [
|
|
76
|
-
cancelLabel && /* @__PURE__ */ jsx(DrawerClose, { asChild: true, children: /* @__PURE__ */ jsx(Button, { variant: "outline", children: cancelLabel }) }),
|
|
77
|
-
typeof action === "string" ? /* @__PURE__ */ jsx(Button, { variant: "destructive", onClick: onAction, children: action }) : action
|
|
78
|
-
] })
|
|
79
|
-
] })
|
|
80
|
-
] });
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export { ResponsiveAlertDialog };
|
package/dist/chunk-R7G3RQLU.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// src/i18n/resources/en.json
|
|
2
|
-
var en_default = {
|
|
3
|
-
chat: {
|
|
4
|
-
"chat-card": {
|
|
5
|
-
"insufficient-credits-error": "This AI Chat is currently unavailable. If you are the owner, please check your account."
|
|
6
|
-
},
|
|
7
|
-
header: {
|
|
8
|
-
"history-tab-label": "History",
|
|
9
|
-
menu: {
|
|
10
|
-
"new-conversation-menu-item-label": "Start New Chat",
|
|
11
|
-
"history-menu-item-label": "View History"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
history: {
|
|
15
|
-
empty: {
|
|
16
|
-
title: "No conversations yet...",
|
|
17
|
-
description: "Start a conversation to see your history here"
|
|
18
|
-
},
|
|
19
|
-
"unitled-conversation": "Untitled conversation",
|
|
20
|
-
"new-conversation": "Start New Conversation"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
// src/i18n/config.ts
|
|
26
|
-
var cookieName = "i18next";
|
|
27
|
-
var headerName = "x-i18next-current-language";
|
|
28
|
-
var fallbackLng = "en";
|
|
29
|
-
var languages = [fallbackLng];
|
|
30
|
-
var namespaces = ["chat"];
|
|
31
|
-
var defaultNamespace = "chat";
|
|
32
|
-
var resources = {
|
|
33
|
-
en: en_default
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export { cookieName, defaultNamespace, fallbackLng, headerName, languages, namespaces, resources };
|
package/dist/chunk-RJG5D2TM.js
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
// src/features/molecule/utils.ts
|
|
2
|
-
function isObject(item) {
|
|
3
|
-
return item !== null && typeof item === "object" && !Array.isArray(item);
|
|
4
|
-
}
|
|
5
|
-
function deepMerge(target, ...sources) {
|
|
6
|
-
const result = { ...target };
|
|
7
|
-
for (const source of sources) {
|
|
8
|
-
if (!isObject(source)) {
|
|
9
|
-
continue;
|
|
10
|
-
}
|
|
11
|
-
for (const key in source) {
|
|
12
|
-
const targetValue = result[key];
|
|
13
|
-
const sourceValue = source[key];
|
|
14
|
-
if (Array.isArray(targetValue) && Array.isArray(sourceValue)) {
|
|
15
|
-
result[key] = sourceValue;
|
|
16
|
-
} else if (isObject(targetValue) && isObject(sourceValue)) {
|
|
17
|
-
result[key] = deepMerge(
|
|
18
|
-
targetValue,
|
|
19
|
-
sourceValue
|
|
20
|
-
);
|
|
21
|
-
} else if (sourceValue !== void 0 && sourceValue !== null) {
|
|
22
|
-
result[key] = sourceValue;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return result;
|
|
27
|
-
}
|
|
28
|
-
function mergeObjectsOneLevel(a, b) {
|
|
29
|
-
if (!a && !b) return void 0;
|
|
30
|
-
if (!b) return a;
|
|
31
|
-
if (!a) return b;
|
|
32
|
-
const result = { ...a };
|
|
33
|
-
for (const key in b) {
|
|
34
|
-
result[key] = { ...result[key], ...b[key] };
|
|
35
|
-
}
|
|
36
|
-
return result;
|
|
37
|
-
}
|
|
38
|
-
function mergeFont(...fontConfigurations) {
|
|
39
|
-
if (!fontConfigurations) {
|
|
40
|
-
return void 0;
|
|
41
|
-
}
|
|
42
|
-
return Object.entries(fontConfigurations).reduce(
|
|
43
|
-
(acc, [key, value]) => {
|
|
44
|
-
return { ...acc, [key]: value };
|
|
45
|
-
},
|
|
46
|
-
{}
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
function mergeTheme(...args) {
|
|
50
|
-
const mergedTheme = args.reduce(
|
|
51
|
-
(acc, curr) => {
|
|
52
|
-
if (!curr) return acc;
|
|
53
|
-
const { font: accFont, components: accComponents } = acc || {};
|
|
54
|
-
const currFiltered = Object.fromEntries(
|
|
55
|
-
Object.entries(curr).filter(
|
|
56
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
57
|
-
([_, value]) => value !== void 0 && value !== null
|
|
58
|
-
)
|
|
59
|
-
) || {};
|
|
60
|
-
const {
|
|
61
|
-
font: currFont,
|
|
62
|
-
components: currComponents,
|
|
63
|
-
...currRest
|
|
64
|
-
} = currFiltered || {};
|
|
65
|
-
const font = mergeFont(accFont || {}, currFont || {});
|
|
66
|
-
acc.components = accComponents || currComponents ? Object.keys({ ...accComponents, ...currComponents }).reduce(
|
|
67
|
-
(merged, key) => ({
|
|
68
|
-
...merged,
|
|
69
|
-
[key]: typeof accComponents?.[key] === "object" && typeof currComponents?.[key] === "object" ? {
|
|
70
|
-
...accComponents?.[key] || {},
|
|
71
|
-
...currComponents?.[key] || {}
|
|
72
|
-
} : currComponents?.[key] ?? accComponents?.[key]
|
|
73
|
-
}),
|
|
74
|
-
{}
|
|
75
|
-
) : void 0;
|
|
76
|
-
return { ...acc, ...currRest, font };
|
|
77
|
-
},
|
|
78
|
-
{}
|
|
79
|
-
);
|
|
80
|
-
return mergedTheme;
|
|
81
|
-
}
|
|
82
|
-
function mergeContext(globalContext, context) {
|
|
83
|
-
return { ...deepMerge(globalContext || {}, context || {}) };
|
|
84
|
-
}
|
|
85
|
-
function mergeLocale(globalLocale, locale) {
|
|
86
|
-
return locale || globalLocale;
|
|
87
|
-
}
|
|
88
|
-
function mergeTranslations(...args) {
|
|
89
|
-
const filteredArgs = args.filter((arg) => arg !== void 0);
|
|
90
|
-
return deepMerge({}, ...filteredArgs);
|
|
91
|
-
}
|
|
92
|
-
function mergeApi(globalApi, api) {
|
|
93
|
-
return { ...globalApi, ...api };
|
|
94
|
-
}
|
|
95
|
-
function mergeLogger(globalLogger, logger) {
|
|
96
|
-
return logger || globalLogger;
|
|
97
|
-
}
|
|
98
|
-
function mergeConfigs(...args) {
|
|
99
|
-
return args.reduce((acc, curr) => {
|
|
100
|
-
return {
|
|
101
|
-
...acc,
|
|
102
|
-
...curr,
|
|
103
|
-
theme: mergeTheme(acc.theme, curr.theme),
|
|
104
|
-
context: mergeContext(acc.context, curr.context),
|
|
105
|
-
locale: mergeLocale(acc.locale, curr.locale),
|
|
106
|
-
translations: mergeTranslations(acc.translations, curr.translations),
|
|
107
|
-
api: mergeApi(acc.api, curr.api),
|
|
108
|
-
logger: mergeLogger(acc.logger, curr.logger)
|
|
109
|
-
};
|
|
110
|
-
}, {});
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export { deepMerge, mergeApi, mergeConfigs, mergeContext, mergeFont, mergeLocale, mergeLogger, mergeObjectsOneLevel, mergeTheme, mergeTranslations };
|
package/dist/chunk-SLJNKQ2G.js
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { UserIcon, BotIcon, RefreshCcwIcon, CopyIcon } from 'lucide-react';
|
|
2
|
-
import { Fragment } from 'react';
|
|
3
|
-
import { Reasoning, ReasoningTrigger, ReasoningContent } from '@chatsdk-dev/elements/components/ai-elements/reasoning';
|
|
4
|
-
import { Sources, SourcesTrigger, SourcesContent, Source } from '@chatsdk-dev/elements/components/ai-elements/sources';
|
|
5
|
-
import { useCopyToClipboard } from '@chatsdk-dev/elements/common/use-copy-to-clipboard';
|
|
6
|
-
import { Actions, Action } from '@chatsdk-dev/elements/components/ai-elements/actions';
|
|
7
|
-
import { Message, MessageContent } from '@chatsdk-dev/elements/components/ai-elements/message';
|
|
8
|
-
import { Response } from '@chatsdk-dev/elements/components/ai-elements/response';
|
|
9
|
-
import { cn } from '@chatsdk-dev/ui/lib/utils';
|
|
10
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
11
|
-
|
|
12
|
-
// src/features/chat/chat-message.tsx
|
|
13
|
-
function ChatMessage({
|
|
14
|
-
messages,
|
|
15
|
-
withAvatar = false
|
|
16
|
-
}) {
|
|
17
|
-
const [, copyToClipboard] = useCopyToClipboard();
|
|
18
|
-
return messages.map((message, messageIndex) => {
|
|
19
|
-
const isUser = message.role === "user";
|
|
20
|
-
const isAssistant = message.role === "assistant";
|
|
21
|
-
if (!message.parts.length) {
|
|
22
|
-
return null;
|
|
23
|
-
}
|
|
24
|
-
return /* @__PURE__ */ jsxs("div", { children: [
|
|
25
|
-
isAssistant && message.parts.filter((part) => part.type === "source-url").length > 0 && /* @__PURE__ */ jsxs(Sources, { children: [
|
|
26
|
-
/* @__PURE__ */ jsx(
|
|
27
|
-
SourcesTrigger,
|
|
28
|
-
{
|
|
29
|
-
count: message.parts.filter((part) => part.type === "source-url").length
|
|
30
|
-
}
|
|
31
|
-
),
|
|
32
|
-
message.parts.filter((part) => part.type === "source-url").map((part, i) => /* @__PURE__ */ jsx(SourcesContent, { children: /* @__PURE__ */ jsx(
|
|
33
|
-
Source,
|
|
34
|
-
{
|
|
35
|
-
href: part.url,
|
|
36
|
-
title: part.url
|
|
37
|
-
},
|
|
38
|
-
`${message.id}-${i}`
|
|
39
|
-
) }, `${message.id}-${i}`))
|
|
40
|
-
] }),
|
|
41
|
-
message.parts.map((part, messagePartIndex) => {
|
|
42
|
-
switch (part.type) {
|
|
43
|
-
case "text":
|
|
44
|
-
if (!part.text) {
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
48
|
-
/* @__PURE__ */ jsxs(
|
|
49
|
-
Message,
|
|
50
|
-
{
|
|
51
|
-
className: cn("flex gap-1.5", isUser && "flex-row-reverse"),
|
|
52
|
-
from: message.role,
|
|
53
|
-
children: [
|
|
54
|
-
withAvatar && /* @__PURE__ */ jsx(
|
|
55
|
-
"div",
|
|
56
|
-
{
|
|
57
|
-
className: cn(
|
|
58
|
-
"flex size-7 shrink-0 items-center justify-center rounded-full border text-xs",
|
|
59
|
-
isUser ? "bg-primary text-primary-foreground border-primary" : isAssistant ? "bg-zinc-100 text-zinc-600 border-zinc-200 dark:bg-zinc-800 dark:text-zinc-400 dark:border-zinc-700" : "bg-amber-50 text-amber-600 border-amber-200 dark:bg-amber-950 dark:text-amber-400 dark:border-amber-800"
|
|
60
|
-
),
|
|
61
|
-
children: isUser ? /* @__PURE__ */ jsx(UserIcon, { className: "size-3.5" }) : /* @__PURE__ */ jsx(BotIcon, { className: "size-3.5" })
|
|
62
|
-
}
|
|
63
|
-
),
|
|
64
|
-
/* @__PURE__ */ jsx(
|
|
65
|
-
MessageContent,
|
|
66
|
-
{
|
|
67
|
-
className: cn(
|
|
68
|
-
"rounded-lg px-3 py-2 text-sm",
|
|
69
|
-
isUser ? "bg-primary text-primary-foreground rounded-tr-sm" : isAssistant ? "bg-zinc-100 text-zinc-800 dark:bg-zinc-800 dark:text-zinc-100 rounded-tl-sm ring-1 ring-zinc-200 dark:ring-zinc-700" : "bg-amber-50 text-amber-800 dark:bg-amber-950 dark:text-amber-200 rounded-tl-sm ring-1 ring-amber-200 dark:ring-amber-800 italic"
|
|
70
|
-
),
|
|
71
|
-
children: /* @__PURE__ */ jsx(Response, { children: part.text })
|
|
72
|
-
}
|
|
73
|
-
)
|
|
74
|
-
]
|
|
75
|
-
}
|
|
76
|
-
),
|
|
77
|
-
isAssistant && /* @__PURE__ */ jsxs(
|
|
78
|
-
Actions,
|
|
79
|
-
{
|
|
80
|
-
className: cn(
|
|
81
|
-
"mt-[-6px] ml-[-10px] mb-[-20px]",
|
|
82
|
-
withAvatar && "ml-6"
|
|
83
|
-
),
|
|
84
|
-
children: [
|
|
85
|
-
/* @__PURE__ */ jsx(
|
|
86
|
-
Action,
|
|
87
|
-
{
|
|
88
|
-
label: "Retry",
|
|
89
|
-
children: /* @__PURE__ */ jsx(RefreshCcwIcon, { className: "size-3" })
|
|
90
|
-
}
|
|
91
|
-
),
|
|
92
|
-
/* @__PURE__ */ jsx(
|
|
93
|
-
Action,
|
|
94
|
-
{
|
|
95
|
-
onClick: () => copyToClipboard?.(part.text),
|
|
96
|
-
label: "Copy",
|
|
97
|
-
children: /* @__PURE__ */ jsx(CopyIcon, { className: "size-3" })
|
|
98
|
-
}
|
|
99
|
-
)
|
|
100
|
-
]
|
|
101
|
-
}
|
|
102
|
-
)
|
|
103
|
-
] }, `${message.id}-${messagePartIndex}`);
|
|
104
|
-
case "reasoning":
|
|
105
|
-
return /* @__PURE__ */ jsxs(
|
|
106
|
-
Reasoning,
|
|
107
|
-
{
|
|
108
|
-
className: "w-full",
|
|
109
|
-
isStreaming: status === "streaming" && messageIndex === message.parts.length - 1 && message.id === messages.at(-1)?.id,
|
|
110
|
-
children: [
|
|
111
|
-
/* @__PURE__ */ jsx(ReasoningTrigger, {}),
|
|
112
|
-
/* @__PURE__ */ jsx(ReasoningContent, { children: part.text })
|
|
113
|
-
]
|
|
114
|
-
},
|
|
115
|
-
`${message.id}-${messagePartIndex}`
|
|
116
|
-
);
|
|
117
|
-
default:
|
|
118
|
-
return null;
|
|
119
|
-
}
|
|
120
|
-
})
|
|
121
|
-
] }, message.id);
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export { ChatMessage };
|
package/dist/chunk-TDEFIW2L.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// src/features/chat/queries/query-keys.ts
|
|
2
|
-
var chatQueryKeys = {
|
|
3
|
-
all: () => ["chat"],
|
|
4
|
-
get: (chatId) => [...chatQueryKeys.all(), "get", chatId],
|
|
5
|
-
listConversations: (chatId) => [...chatQueryKeys.get(chatId), "conversations"],
|
|
6
|
-
conversation: (chatId, conversationId) => [...chatQueryKeys.get(chatId), "conversation", conversationId]
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export { chatQueryKeys };
|