@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
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { r as RootConfig } from "./config-CqihvSgz.js";
|
|
2
|
+
import React from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/features/element/chatsdk-provider.d.ts
|
|
5
|
+
interface ChatSDKProviderProps {
|
|
6
|
+
config?: RootConfig;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
declare function ChatSDKProvider({
|
|
10
|
+
config,
|
|
11
|
+
children
|
|
12
|
+
}: ChatSDKProviderProps): React.ReactNode;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { ChatSDKProvider as t };
|
|
15
|
+
//# sourceMappingURL=chatsdk-provider-BhlChLFd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatsdk-provider-BhlChLFd.d.ts","names":[],"sources":["../src/features/element/chatsdk-provider.tsx"],"mappings":";;;;UAKU,oBAAA;EACR,MAAA,GAAS,UAAA;EACT,QAAA,EAAU,KAAA,CAAM,SAAA;AAAA;AAAA,iBAGF,eAAA,CAAA;EACd,MAAA;EACA;AAAA,GACC,oBAAA,GAAoB,KAAA,CAAA,SAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//#region src/common/utils.d.ts
|
|
2
|
+
interface FormatRelativeTimeParams {
|
|
3
|
+
date: number | Date;
|
|
4
|
+
now?: Date;
|
|
5
|
+
locale?: string;
|
|
6
|
+
}
|
|
7
|
+
declare function renderRelativeTime({
|
|
8
|
+
date,
|
|
9
|
+
now,
|
|
10
|
+
locale
|
|
11
|
+
}: FormatRelativeTimeParams): string;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { renderRelativeTime };
|
|
14
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/common/utils.ts"],"mappings":";UAAU,wBAAA;EACR,IAAA,WAAe,IAAA;EACf,GAAA,GAAM,IAAA;EACN,MAAA;AAAA;AAAA,iBAGc,kBAAA,CAAA;EACd,IAAA;EACA,GAAA;EACA;AAAA,GACC,wBAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//#region src/common/utils.ts
|
|
2
|
+
function renderRelativeTime({ date, now, locale }) {
|
|
3
|
+
const _date = date instanceof Date ? date : new Date(date);
|
|
4
|
+
const _now = now ?? /* @__PURE__ */ new Date();
|
|
5
|
+
const diffMs = _date.getTime() - _now.getTime();
|
|
6
|
+
const diffSec = Math.round(diffMs / 1e3);
|
|
7
|
+
const diffMin = Math.round(diffSec / 60);
|
|
8
|
+
const diffHr = Math.round(diffMin / 60);
|
|
9
|
+
const diffDay = Math.round(diffHr / 24);
|
|
10
|
+
const diffWeek = Math.round(diffDay / 7);
|
|
11
|
+
const diffMonth = Math.round(diffDay / 30);
|
|
12
|
+
const diffYear = Math.round(diffDay / 365);
|
|
13
|
+
const _locale = locale ?? "en";
|
|
14
|
+
const rtf = new Intl.RelativeTimeFormat(_locale, { numeric: "auto" });
|
|
15
|
+
if (Math.abs(diffSec) < 60) return rtf.format(diffSec, "second");
|
|
16
|
+
if (Math.abs(diffMin) < 60) return rtf.format(diffMin, "minute");
|
|
17
|
+
if (Math.abs(diffHr) < 24) return rtf.format(diffHr, "hour");
|
|
18
|
+
if (Math.abs(diffDay) < 7) return rtf.format(diffDay, "day");
|
|
19
|
+
if (Math.abs(diffWeek) < 4) return rtf.format(diffWeek, "week");
|
|
20
|
+
if (Math.abs(diffMonth) < 12) return rtf.format(diffMonth, "month");
|
|
21
|
+
return rtf.format(diffYear, "year");
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { renderRelativeTime };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../src/common/utils.ts"],"sourcesContent":["interface FormatRelativeTimeParams {\n date: number | Date;\n now?: Date;\n locale?: string;\n}\n\nexport function renderRelativeTime({\n date,\n now,\n locale,\n}: FormatRelativeTimeParams): string {\n const _date = date instanceof Date ? date : new Date(date);\n const _now = now ?? new Date();\n\n const diffMs = _date.getTime() - _now.getTime();\n const diffSec = Math.round(diffMs / 1000);\n const diffMin = Math.round(diffSec / 60);\n const diffHr = Math.round(diffMin / 60);\n const diffDay = Math.round(diffHr / 24);\n const diffWeek = Math.round(diffDay / 7);\n const diffMonth = Math.round(diffDay / 30);\n const diffYear = Math.round(diffDay / 365);\n\n const _locale = locale ?? \"en\";\n const rtf = new Intl.RelativeTimeFormat(_locale, { numeric: \"auto\" });\n\n if (Math.abs(diffSec) < 60) return rtf.format(diffSec, \"second\");\n if (Math.abs(diffMin) < 60) return rtf.format(diffMin, \"minute\");\n if (Math.abs(diffHr) < 24) return rtf.format(diffHr, \"hour\");\n if (Math.abs(diffDay) < 7) return rtf.format(diffDay, \"day\");\n if (Math.abs(diffWeek) < 4) return rtf.format(diffWeek, \"week\");\n if (Math.abs(diffMonth) < 12) return rtf.format(diffMonth, \"month\");\n return rtf.format(diffYear, \"year\");\n}\n"],"mappings":";AAMA,SAAgB,mBAAmB,EACjC,MACA,KACA,UACmC;CACnC,MAAM,QAAQ,gBAAgB,OAAO,OAAO,IAAI,KAAK,KAAK;CAC1D,MAAM,OAAO,uBAAO,IAAI,MAAM;CAE9B,MAAM,SAAS,MAAM,SAAS,GAAG,KAAK,SAAS;CAC/C,MAAM,UAAU,KAAK,MAAM,SAAS,IAAK;CACzC,MAAM,UAAU,KAAK,MAAM,UAAU,GAAG;CACxC,MAAM,SAAS,KAAK,MAAM,UAAU,GAAG;CACvC,MAAM,UAAU,KAAK,MAAM,SAAS,GAAG;CACvC,MAAM,WAAW,KAAK,MAAM,UAAU,EAAE;CACxC,MAAM,YAAY,KAAK,MAAM,UAAU,GAAG;CAC1C,MAAM,WAAW,KAAK,MAAM,UAAU,IAAI;CAE1C,MAAM,UAAU,UAAU;CAC1B,MAAM,MAAM,IAAI,KAAK,mBAAmB,SAAS,EAAE,SAAS,QAAQ,CAAC;AAErE,KAAI,KAAK,IAAI,QAAQ,GAAG,GAAI,QAAO,IAAI,OAAO,SAAS,SAAS;AAChE,KAAI,KAAK,IAAI,QAAQ,GAAG,GAAI,QAAO,IAAI,OAAO,SAAS,SAAS;AAChE,KAAI,KAAK,IAAI,OAAO,GAAG,GAAI,QAAO,IAAI,OAAO,QAAQ,OAAO;AAC5D,KAAI,KAAK,IAAI,QAAQ,GAAG,EAAG,QAAO,IAAI,OAAO,SAAS,MAAM;AAC5D,KAAI,KAAK,IAAI,SAAS,GAAG,EAAG,QAAO,IAAI,OAAO,UAAU,OAAO;AAC/D,KAAI,KAAK,IAAI,UAAU,GAAG,GAAI,QAAO,IAAI,OAAO,WAAW,QAAQ;AACnE,QAAO,IAAI,OAAO,UAAU,OAAO"}
|
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as React$1 from "react";
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
|
+
//#region src/components/info-card.d.ts
|
|
4
5
|
interface InfoCardProps {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
children?: React$1.ReactNode;
|
|
9
|
+
actionLabel?: string;
|
|
10
|
+
onActionClick?: () => void;
|
|
11
|
+
className?: string;
|
|
11
12
|
}
|
|
12
|
-
declare function InfoCard({
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
declare function InfoCard({
|
|
14
|
+
title,
|
|
15
|
+
description,
|
|
16
|
+
children,
|
|
17
|
+
actionLabel,
|
|
18
|
+
onActionClick,
|
|
19
|
+
className
|
|
20
|
+
}: InfoCardProps): react_jsx_runtime0.JSX.Element;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { InfoCard };
|
|
23
|
+
//# sourceMappingURL=info-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info-card.d.ts","names":[],"sources":["../../src/components/info-card.tsx"],"mappings":";;;;UAEU,aAAA;EACR,KAAA;EACA,WAAA;EACA,QAAA,GAAW,OAAA,CAAM,SAAA;EACjB,WAAA;EACA,aAAA;EACA,SAAA;AAAA;AAAA,iBAGc,QAAA,CAAA;EACd,KAAA;EACA,WAAA;EACA,QAAA;EACA,WAAA;EACA,aAAA;EACA;AAAA,GACC,aAAA,GAAa,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1 +1,38 @@
|
|
|
1
|
-
|
|
1
|
+
import "react";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/info-card.tsx
|
|
4
|
+
function InfoCard({ title, description, children, actionLabel, onActionClick, className }) {
|
|
5
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
6
|
+
"data-slot": "info-card",
|
|
7
|
+
className: "rounded-xl border border-gray-200 shadow-sm p-4 bg-white text-gray-900 " + (className ?? ""),
|
|
8
|
+
children: [
|
|
9
|
+
/* @__PURE__ */ jsxs("div", {
|
|
10
|
+
className: "mb-3",
|
|
11
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
12
|
+
className: "text-lg font-semibold",
|
|
13
|
+
children: title
|
|
14
|
+
}), description ? /* @__PURE__ */ jsx("div", {
|
|
15
|
+
className: "text-sm text-gray-500",
|
|
16
|
+
children: description
|
|
17
|
+
}) : null]
|
|
18
|
+
}),
|
|
19
|
+
/* @__PURE__ */ jsx("div", {
|
|
20
|
+
className: "text-sm",
|
|
21
|
+
children
|
|
22
|
+
}),
|
|
23
|
+
actionLabel ? /* @__PURE__ */ jsx("div", {
|
|
24
|
+
className: "mt-4",
|
|
25
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
26
|
+
type: "button",
|
|
27
|
+
className: "inline-flex items-center justify-center rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 active:scale-[0.98]",
|
|
28
|
+
onClick: onActionClick,
|
|
29
|
+
children: actionLabel
|
|
30
|
+
})
|
|
31
|
+
}) : null
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { InfoCard };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=info-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"info-card.js","names":[],"sources":["../../src/components/info-card.tsx"],"sourcesContent":["import * as React from \"react\";\n\ninterface InfoCardProps {\n title: string;\n description?: string;\n children?: React.ReactNode;\n actionLabel?: string;\n onActionClick?: () => void;\n className?: string;\n}\n\nexport function InfoCard({\n title,\n description,\n children,\n actionLabel,\n onActionClick,\n className,\n}: InfoCardProps) {\n return (\n <div\n data-slot=\"info-card\"\n className={\n \"rounded-xl border border-gray-200 shadow-sm p-4 bg-white text-gray-900 \" +\n (className ?? \"\")\n }\n >\n <div className=\"mb-3\">\n <div className=\"text-lg font-semibold\">{title}</div>\n {description ? (\n <div className=\"text-sm text-gray-500\">{description}</div>\n ) : null}\n </div>\n <div className=\"text-sm\">{children}</div>\n {actionLabel ? (\n <div className=\"mt-4\">\n <button\n type=\"button\"\n className=\"inline-flex items-center justify-center rounded-md bg-blue-600 px-4 py-2 text-white hover:bg-blue-700 active:scale-[0.98]\"\n onClick={onActionClick}\n >\n {actionLabel}\n </button>\n </div>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;AAWA,SAAgB,SAAS,EACvB,OACA,aACA,UACA,aACA,eACA,aACgB;AAChB,QACE,qBAAC,OAAD;EACE,aAAU;EACV,WACE,6EACC,aAAa;YAJlB;GAOE,qBAAC,OAAD;IAAK,WAAU;cAAf,CACE,oBAAC,OAAD;KAAK,WAAU;eAAyB;KAAY,CAAA,EACnD,cACC,oBAAC,OAAD;KAAK,WAAU;eAAyB;KAAkB,CAAA,GACxD,KACA;;GACN,oBAAC,OAAD;IAAK,WAAU;IAAW;IAAe,CAAA;GACxC,cACC,oBAAC,OAAD;IAAK,WAAU;cACb,oBAAC,UAAD;KACE,MAAK;KACL,WAAU;KACV,SAAS;eAER;KACM,CAAA;IACL,CAAA,GACJ;GACA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
//#region src/i18n/resources/en.json
|
|
2
|
+
var en_default = { chat: {
|
|
3
|
+
"chat-card": { "insufficient-credits-error": "This AI Chat is currently unavailable. If you are the owner, please check your account." },
|
|
4
|
+
"header": {
|
|
5
|
+
"history-tab-label": "History",
|
|
6
|
+
"menu": {
|
|
7
|
+
"new-conversation-menu-item-label": "Start New Chat",
|
|
8
|
+
"history-menu-item-label": "View History"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
"history": {
|
|
12
|
+
"empty": {
|
|
13
|
+
"title": "No conversations yet...",
|
|
14
|
+
"description": "Start a conversation to see your history here"
|
|
15
|
+
},
|
|
16
|
+
"unitled-conversation": "Untitled conversation",
|
|
17
|
+
"new-conversation": "Start New Conversation"
|
|
18
|
+
}
|
|
19
|
+
} };
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/i18n/config.ts
|
|
22
|
+
const fallbackLng = "en";
|
|
23
|
+
const languages = ["en"];
|
|
24
|
+
const defaultNamespace = "chat";
|
|
25
|
+
const resources = { en: en_default };
|
|
26
|
+
//#endregion
|
|
27
|
+
export { resources as i, fallbackLng as n, languages as r, defaultNamespace as t };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=config-BigIL6TQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-BigIL6TQ.js","names":[],"sources":["../src/i18n/resources/en.json","../src/i18n/config.ts"],"sourcesContent":["","import en from \"./resources/en.json\";\n\n// types\nexport type Locale = (typeof languages)[number];\nexport type Resource = typeof en;\n\n// config\nexport const fallbackLng = \"en\" as const;\nexport const languages = [fallbackLng] as const;\n// namespaces are currently not used\nexport const defaultNamespace = \"chat\";\n\nexport const resources = {\n en,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;ACOA,MAAa,cAAc;AAC3B,MAAa,YAAY,CAAA,KAAa;AAEtC,MAAa,mBAAmB;AAEhC,MAAa,YAAY,EACvB,IAAA,YACD"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { t as Callbacks } from "./callbacks-PIvHXeEI.js";
|
|
2
|
+
import { n as LoggerInput } from "./logger-BvmhODdq.js";
|
|
3
|
+
import { t as APIOptions } from "./api-CIYPz72L.js";
|
|
4
|
+
import { t as Context } from "./context-aSaHw-ac.js";
|
|
5
|
+
import { n as Resource, t as Locale } from "./config-D_jVTH_D.js";
|
|
6
|
+
import { n as LocaleConfig } from "./locale-W5Kyyi4X.js";
|
|
7
|
+
import { i as ThemeConfig } from "./theme-Cb-RBWbR.js";
|
|
8
|
+
|
|
9
|
+
//#region src/features/element/utils.d.ts
|
|
10
|
+
type DeepPartial<T> = { [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P] };
|
|
11
|
+
declare function deepMerge<T extends Record<string, any>>(target: T, ...sources: DeepPartial<T>[]): T;
|
|
12
|
+
declare function mergeConfigs(...args: Partial<RootConfig>[]): Partial<RootConfig>;
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/features/element/types/translations.d.ts
|
|
15
|
+
type TranslationsConfig = DeepPartial<Record<Locale, Resource>>;
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/features/element/types/config.d.ts
|
|
18
|
+
type OptionsConfig = Record<string, object>;
|
|
19
|
+
interface RootConfig {
|
|
20
|
+
/**
|
|
21
|
+
* Context configuration containing reference and other context-specific settings
|
|
22
|
+
* @type Context
|
|
23
|
+
* @category Configuration
|
|
24
|
+
* @details interface Context {
|
|
25
|
+
* tenant?: {
|
|
26
|
+
* id: string;
|
|
27
|
+
* traits?: Record<string, boolean>
|
|
28
|
+
* }
|
|
29
|
+
* user?: {
|
|
30
|
+
* id: string;
|
|
31
|
+
* }
|
|
32
|
+
* }
|
|
33
|
+
*/
|
|
34
|
+
context?: Context;
|
|
35
|
+
/**
|
|
36
|
+
* Theme configuration for styling and layout
|
|
37
|
+
* @type ThemeConfig
|
|
38
|
+
* @category Configuration
|
|
39
|
+
* @details interface ThemeConfig {
|
|
40
|
+
* colorScheme: ColorScheme;
|
|
41
|
+
* font: {
|
|
42
|
+
* body: FontConfig;
|
|
43
|
+
* heading: FontConfig;
|
|
44
|
+
* variants: Record<string, FontConfig>;
|
|
45
|
+
* };
|
|
46
|
+
* defaultRadius: Radius;
|
|
47
|
+
* defaultShadow: Size;
|
|
48
|
+
* components?: ConfigComponents;
|
|
49
|
+
*
|
|
50
|
+
*
|
|
51
|
+
* primary: string;
|
|
52
|
+
* ... see shared-styles.css for all variables
|
|
53
|
+
*
|
|
54
|
+
*/
|
|
55
|
+
theme?: Partial<ThemeConfig>;
|
|
56
|
+
/**
|
|
57
|
+
* API configuration including version, base URL, credentials, and headers
|
|
58
|
+
* @type APIOptions
|
|
59
|
+
* @category Configuration
|
|
60
|
+
* @details interface APIOptions {
|
|
61
|
+
* base?: string;
|
|
62
|
+
* version?: 'internal' | 'v1';
|
|
63
|
+
* body?: any;
|
|
64
|
+
* credentials?: 'include' | 'same-origin' | 'omit';
|
|
65
|
+
* headers?: Record<string, string>;
|
|
66
|
+
* integrity?: string;
|
|
67
|
+
* keepalive?: boolean;
|
|
68
|
+
* method?: string;
|
|
69
|
+
* mode?: 'cors' | 'no-cors' | 'same-origin' | 'navigate';
|
|
70
|
+
* referrer?: string;
|
|
71
|
+
* window?: any;
|
|
72
|
+
* signal?: any;
|
|
73
|
+
* }
|
|
74
|
+
*/
|
|
75
|
+
api?: APIOptions;
|
|
76
|
+
/**
|
|
77
|
+
* Locale configuration for language and currency settings
|
|
78
|
+
* @type LocaleConfig
|
|
79
|
+
* @category Configuration
|
|
80
|
+
* @details type LocaleConfig =
|
|
81
|
+
* | Language
|
|
82
|
+
* | { language: Langugae; formality?: Formality };
|
|
83
|
+
*/
|
|
84
|
+
locale?: LocaleConfig;
|
|
85
|
+
/**
|
|
86
|
+
* Custom translations object for overriding default text strings
|
|
87
|
+
* @type Translations
|
|
88
|
+
* @category Configuration
|
|
89
|
+
* @details interface Translations {
|
|
90
|
+
* en: {
|
|
91
|
+
* chat:{
|
|
92
|
+
* initialPrompt: string;
|
|
93
|
+
* }
|
|
94
|
+
* ...
|
|
95
|
+
* };
|
|
96
|
+
* }
|
|
97
|
+
*/
|
|
98
|
+
translations?: TranslationsConfig;
|
|
99
|
+
/**
|
|
100
|
+
* Logger callback for logging messages, if provided partially, will reuse from most specific (error) to least specific (info)
|
|
101
|
+
* @type Logger
|
|
102
|
+
* @category Configuration
|
|
103
|
+
* @details interface Logger {
|
|
104
|
+
* info?: (message: string) => void;
|
|
105
|
+
* warn?: (message: string) => void;
|
|
106
|
+
* error?: (message: string) => void;
|
|
107
|
+
* } | (message: string) => void
|
|
108
|
+
*/
|
|
109
|
+
logger?: LoggerInput["info"] | LoggerInput;
|
|
110
|
+
/**
|
|
111
|
+
* Options configuration for the component
|
|
112
|
+
* @type OptionsConfig
|
|
113
|
+
* @category Configuration
|
|
114
|
+
* @details type OptionsConfig = Record<string, any>;
|
|
115
|
+
*/
|
|
116
|
+
options?: OptionsConfig;
|
|
117
|
+
}
|
|
118
|
+
type ElementConfig<T extends object, CallbackDataType = unknown> = T & {
|
|
119
|
+
component?: T & {
|
|
120
|
+
defaultProps?: T;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Default props for the component, will be merged with the component props and the global component props
|
|
124
|
+
* Merge order for props resolution from highest to lowest precedence:
|
|
125
|
+
* 1. passed `props`
|
|
126
|
+
* 2. config level `defaultProps`
|
|
127
|
+
* 3. passed `defaultProps`
|
|
128
|
+
* 4. hard coded defaultProps
|
|
129
|
+
* Keep in mind, merges are shallow!
|
|
130
|
+
*
|
|
131
|
+
* @type T
|
|
132
|
+
*/
|
|
133
|
+
defaultProps?: T;
|
|
134
|
+
/** Configuration object to merge and override with global configuration, can be partially overriden by flattened configs (theme, api, locale, etc)
|
|
135
|
+
* @category Configuration
|
|
136
|
+
* @type Config
|
|
137
|
+
* @details interface RootConfig {
|
|
138
|
+
* context?: Context;
|
|
139
|
+
* theme?: ThemeConfig;
|
|
140
|
+
* api?: APIOptions;
|
|
141
|
+
* locale?: LocaleConfig;
|
|
142
|
+
* translations?: TranslationsConfig;
|
|
143
|
+
* logger?: LoggerInput['info'] | LoggerInput;
|
|
144
|
+
* }
|
|
145
|
+
*/
|
|
146
|
+
config?: Partial<RootConfig>;
|
|
147
|
+
} & Callbacks<CallbackDataType>;
|
|
148
|
+
//#endregion
|
|
149
|
+
export { DeepPartial as a, TranslationsConfig as i, OptionsConfig as n, deepMerge as o, RootConfig as r, mergeConfigs as s, ElementConfig as t };
|
|
150
|
+
//# sourceMappingURL=config-CqihvSgz.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-CqihvSgz.d.ts","names":[],"sources":["../src/features/element/utils.ts","../src/features/element/types/translations.ts","../src/features/element/types/config.ts"],"mappings":";;;;;;;;;KAMY,WAAA,oBACE,CAAA,IAAK,CAAA,CAAE,CAAA,mBAAoB,WAAA,CAAY,CAAA,CAAE,CAAA,KAAM,CAAA,CAAE,CAAA;AAAA,iBAQ/C,SAAA,WAAoB,MAAA,cAAA,CAClC,MAAA,EAAQ,CAAA,KACL,OAAA,EAAS,WAAA,CAAY,CAAA,MACvB,CAAA;AAAA,iBAuIa,YAAA,CAAA,GACX,IAAA,EAAM,OAAA,CAAQ,UAAA,MAChB,OAAA,CAAQ,UAAA;;;KCxJC,kBAAA,GAAqB,WAAA,CAAY,MAAA,CAAO,MAAA,EAAQ,QAAA;;;KCKhD,aAAA,GAAgB,MAAA;AAAA,UAEX,UAAA;EFJL;;;;;;;;;;;;;;EEmBV,OAAA,GAAU,OAAA;EFlBE;;;;;;;;;;AAQd;;;;;;;;;;EE+BE,KAAA,GAAQ,OAAA,CAAQ,WAAA;EF/BkB;;;;;;;;;AA0IpC;;;;;;;;;;EEvFE,GAAA,GAAM,UAAA;EFwFW;;;;;;;;EE/EjB,MAAA,GAAS,YAAA;EDxEmB;;;;;;;;;;;;;ECsF5B,YAAA,GAAe,kBAAA;;;;AAjFjB;;;;;AAEA;;EA0FE,MAAA,GAAS,WAAA,WAAsB,WAAA;EA3ErB;;;;;;EAkFV,OAAA,GAAU,aAAA;AAAA;AAAA,KAGA,aAAA,iDAA8D,CAAA;EACxE,SAAA,GAAY,CAAA;IAAM,YAAA,GAAe,CAAA;EAAA;EAtFvB;;;;;;;;;;;EAkGV,YAAA,GAAe,CAAA;EAvBgB;;;;;AAUjC;;;;;;;EA0BE,MAAA,GAAS,OAAA,CAAQ,UAAA;AAAA,IACf,SAAA,CAAU,gBAAA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
//#region src/i18n/resources/en.json.d.ts
|
|
2
|
+
declare let chat: {
|
|
3
|
+
"chat-card": {
|
|
4
|
+
"insufficient-credits-error": string;
|
|
5
|
+
};
|
|
6
|
+
header: {
|
|
7
|
+
"history-tab-label": string;
|
|
8
|
+
menu: {
|
|
9
|
+
"new-conversation-menu-item-label": string;
|
|
10
|
+
"history-menu-item-label": string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
history: {
|
|
14
|
+
empty: {
|
|
15
|
+
title: string;
|
|
16
|
+
description: string;
|
|
17
|
+
};
|
|
18
|
+
"unitled-conversation": string;
|
|
19
|
+
"new-conversation": string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
declare namespace __json_default_export {
|
|
23
|
+
export { chat };
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/i18n/config.d.ts
|
|
27
|
+
type Locale = (typeof languages)[number];
|
|
28
|
+
type Resource = typeof __json_default_export;
|
|
29
|
+
declare const fallbackLng: "en";
|
|
30
|
+
declare const languages: readonly ["en"];
|
|
31
|
+
declare const defaultNamespace = "chat";
|
|
32
|
+
declare const resources: {
|
|
33
|
+
en: {
|
|
34
|
+
chat: {
|
|
35
|
+
"chat-card": {
|
|
36
|
+
"insufficient-credits-error": string;
|
|
37
|
+
};
|
|
38
|
+
header: {
|
|
39
|
+
"history-tab-label": string;
|
|
40
|
+
menu: {
|
|
41
|
+
"new-conversation-menu-item-label": string;
|
|
42
|
+
"history-menu-item-label": string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
history: {
|
|
46
|
+
empty: {
|
|
47
|
+
title: string;
|
|
48
|
+
description: string;
|
|
49
|
+
};
|
|
50
|
+
"unitled-conversation": string;
|
|
51
|
+
"new-conversation": string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
//#endregion
|
|
57
|
+
export { languages as a, fallbackLng as i, Resource as n, resources as o, defaultNamespace as r, Locale as t };
|
|
58
|
+
//# sourceMappingURL=config-D_jVTH_D.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-D_jVTH_D.d.ts","names":["chat","header","menu","history","empty","title","description","__json_default_export","default"],"sources":["../src/i18n/resources/en.json.d.ts","../src/i18n/config.ts"],"mappings":";YAAWA,IAAAA;EACP,WAAA;IACI,4BAAA;EAAA;EAEJC,MAAAA;IACI,mBAAA;IACAC,IAAAA;MACI,kCAAA;MACA,yBAAA;IAAA;EAAA;EAGRC,OAAAA;IACIC,KAAAA;MACIC,KAAAA;MACAC,WAAAA;IAAAA;IAEJ,sBAAA;IACA,kBAAA;EAAA;AAAA;AAAA,kBAIUC,qBAAAA;EAAAA,SACPP,IAAAA;AAAAA;;;KCnBC,MAAA,WAAiB,SAAA;AAAA,KACjB,QAAA,UAAkB,qBAAA;AAAA,cAGjB,WAAA;AAAA,cACA,SAAA;AAAA,cAEA,gBAAA;AAAA,cAEA,SAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
//#region src/features/element/types/context.d.ts
|
|
2
|
+
type Context = {
|
|
3
|
+
tenant?: {
|
|
4
|
+
id?: string;
|
|
5
|
+
traits?: Record<string, boolean>;
|
|
6
|
+
};
|
|
7
|
+
actor?: {
|
|
8
|
+
id?: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Context as t };
|
|
13
|
+
//# sourceMappingURL=context-aSaHw-ac.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-aSaHw-ac.d.ts","names":[],"sources":["../src/features/element/types/context.ts"],"mappings":";KACY,OAAA;EAEV,MAAA;IACE,EAAA;IACA,MAAA,GAAS,MAAA;EAAA;EAGX,KAAA;IACE,EAAA;EAAA;AAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { t as Callbacks } from "./callbacks-PIvHXeEI.js";
|
|
2
|
+
import { r as RootConfig } from "./config-CqihvSgz.js";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/features/element/element-provider.d.ts
|
|
7
|
+
interface ElementContextType<T, W> {
|
|
8
|
+
config: RootConfig;
|
|
9
|
+
component: T;
|
|
10
|
+
callbacks: Callbacks<W>;
|
|
11
|
+
}
|
|
12
|
+
interface ElementProviderProps<T, W> {
|
|
13
|
+
config: RootConfig;
|
|
14
|
+
component: T;
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
callbacks: Callbacks<W>;
|
|
17
|
+
}
|
|
18
|
+
interface CreateElementContextParams {
|
|
19
|
+
name: string;
|
|
20
|
+
}
|
|
21
|
+
declare function createElementContext<T, W>({
|
|
22
|
+
name
|
|
23
|
+
}: CreateElementContextParams): {
|
|
24
|
+
readonly useElement: () => ElementContextType<T, W>;
|
|
25
|
+
readonly useElementConfig: () => RootConfig;
|
|
26
|
+
readonly useElementComponent: () => T;
|
|
27
|
+
readonly useElementCallbacks: () => Callbacks<W>;
|
|
28
|
+
readonly ElementProvider: {
|
|
29
|
+
({
|
|
30
|
+
config,
|
|
31
|
+
component,
|
|
32
|
+
callbacks,
|
|
33
|
+
children
|
|
34
|
+
}: ElementProviderProps<T, W>): react_jsx_runtime0.JSX.Element;
|
|
35
|
+
displayName: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { ElementProviderProps as n, createElementContext as r, ElementContextType as t };
|
|
40
|
+
//# sourceMappingURL=element-provider-C_nBsftD.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"element-provider-C_nBsftD.d.ts","names":[],"sources":["../src/features/element/element-provider.tsx"],"mappings":";;;;;;UAiEiB,kBAAA;EACf,MAAA,EAAQ,UAAA;EACR,SAAA,EAAW,CAAA;EACX,SAAA,EAAW,SAAA,CAAU,CAAA;AAAA;AAAA,UAGN,oBAAA;EACf,MAAA,EAAQ,UAAA;EACR,SAAA,EAAW,CAAA;EACX,QAAA,EAAU,KAAA,CAAM,SAAA;EAChB,SAAA,EAAW,SAAA,CAAU,CAAA;AAAA;AAAA,UAGb,0BAAA;EACR,IAAA;AAAA;AAAA,iBAGc,oBAAA,MAAA,CAAA;EACd;AAAA,GACC,0BAAA;EAAA;;;;;;;;;;OA6BE,oBAAA,CAAqB,CAAA,EAAG,CAAA,IAAE,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
declare function ChatCard(): react_jsx_runtime.JSX.Element | null;
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
2
|
|
|
3
|
+
//#region src/features/chat/chat-card.d.ts
|
|
4
|
+
declare function ChatCard(): react_jsx_runtime0.JSX.Element | null;
|
|
5
|
+
//#endregion
|
|
5
6
|
export { ChatCard };
|
|
7
|
+
//# sourceMappingURL=chat-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-card.d.ts","names":[],"sources":["../../../src/features/chat/chat-card.tsx"],"mappings":";;;iBAegB,QAAA,CAAA,GAAQ,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 { s as ChatCard } from "../../chat-element-CCsDDFif.js";
|
|
2
|
+
export { ChatCard };
|
|
@@ -0,0 +1,2 @@
|
|
|
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 };
|
|
@@ -0,0 +1,2 @@
|
|
|
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,12 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
|
+
//#region src/features/chat/chat-header/chat-header.d.ts
|
|
3
4
|
interface ChatTitleProps {
|
|
4
|
-
|
|
5
|
+
chatId?: string;
|
|
5
6
|
}
|
|
6
|
-
declare function ChatHeader({
|
|
7
|
-
|
|
7
|
+
declare function ChatHeader({
|
|
8
|
+
chatId
|
|
9
|
+
}: ChatTitleProps): react_jsx_runtime0.JSX.Element;
|
|
10
|
+
//#endregion
|
|
8
11
|
export { ChatHeader };
|
|
12
|
+
//# sourceMappingURL=chat-header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-header.d.ts","names":[],"sources":["../../../../src/features/chat/chat-header/chat-header.tsx"],"mappings":";;;UAYU,cAAA;EACR,MAAA;AAAA;AAAA,iBAGc,UAAA,CAAA;EAAa;AAAA,GAAU,cAAA,GAAc,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 { g as ChatHeader } from "../../../chat-element-CCsDDFif.js";
|
|
2
|
+
export { ChatHeader };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
declare function ChatMenu(): react_jsx_runtime.JSX.Element;
|
|
1
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
4
2
|
|
|
3
|
+
//#region src/features/chat/chat-header/chat-menu.d.ts
|
|
4
|
+
declare function ChatMenu(): react_jsx_runtime0.JSX.Element;
|
|
5
|
+
//#endregion
|
|
5
6
|
export { ChatMenu };
|
|
7
|
+
//# sourceMappingURL=chat-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-menu.d.ts","names":[],"sources":["../../../../src/features/chat/chat-header/chat-menu.tsx"],"mappings":";;;iBAagB,QAAA,CAAA,GAAQ,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -1,2 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
import { useChatStore } from "../store.js";
|
|
2
|
+
import { Ellipsis } from "lucide-react";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { useTranslation } from "react-i18next";
|
|
5
|
+
import { buttonVariants } from "@chatsdk-dev/ui/atoms/button";
|
|
6
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "@chatsdk-dev/ui/atoms/dropdown-menu";
|
|
7
|
+
//#region src/features/chat/chat-header/chat-menu.tsx
|
|
8
|
+
function ChatMenu() {
|
|
9
|
+
const { t } = useTranslation();
|
|
10
|
+
const { setSelectedConversationId, setTab, setConversationType } = useChatStore();
|
|
11
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
12
|
+
className: buttonVariants({ variant: "transparent" }),
|
|
13
|
+
children: /* @__PURE__ */ jsx(Ellipsis, { className: "size-4" })
|
|
14
|
+
}), /* @__PURE__ */ jsxs(DropdownMenuContent, { children: [/* @__PURE__ */ jsx(DropdownMenuItem, {
|
|
15
|
+
onClick: () => {
|
|
16
|
+
setConversationType("new");
|
|
17
|
+
setSelectedConversationId();
|
|
18
|
+
setTab("chat");
|
|
19
|
+
},
|
|
20
|
+
children: t("header.menu.new-conversation-menu-item-label")
|
|
21
|
+
}), /* @__PURE__ */ jsx(DropdownMenuItem, {
|
|
22
|
+
onClick: () => setTab("history"),
|
|
23
|
+
children: t("header.menu.history-menu-item-label")
|
|
24
|
+
})] })] });
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
export { ChatMenu };
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=chat-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-menu.js","names":[],"sources":["../../../../src/features/chat/chat-header/chat-menu.tsx"],"sourcesContent":["import { Ellipsis } from \"lucide-react\";\nimport { useTranslation } from \"react-i18next\";\n\nimport { buttonVariants } from \"@chatsdk-dev/ui/atoms/button\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"@chatsdk-dev/ui/atoms/dropdown-menu\";\n\nimport { useChatStore } from \"../store\";\n\nexport function ChatMenu() {\n const { t } = useTranslation();\n const { setSelectedConversationId, setTab, setConversationType } =\n useChatStore();\n\n return (\n <DropdownMenu>\n <DropdownMenuTrigger\n className={buttonVariants({ variant: \"transparent\" })}\n >\n <Ellipsis className=\"size-4\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuItem\n onClick={() => {\n setConversationType(\"new\");\n setSelectedConversationId();\n setTab(\"chat\");\n }}\n >\n {t(\"header.menu.new-conversation-menu-item-label\")}\n </DropdownMenuItem>\n <DropdownMenuItem onClick={() => setTab(\"history\")}>\n {t(\"header.menu.history-menu-item-label\")}\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n"],"mappings":";;;;;;;AAaA,SAAgB,WAAW;CACzB,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,EAAE,2BAA2B,QAAQ,wBACzC,cAAc;AAEhB,QACE,qBAAC,cAAD,EAAA,UAAA,CACE,oBAAC,qBAAD;EACE,WAAW,eAAe,EAAE,SAAS,eAAe,CAAC;YAErD,oBAAC,UAAD,EAAU,WAAU,UAAW,CAAA;EACX,CAAA,EACtB,qBAAC,qBAAD,EAAA,UAAA,CACE,oBAAC,kBAAD;EACE,eAAe;AACb,uBAAoB,MAAM;AAC1B,8BAA2B;AAC3B,UAAO,OAAO;;YAGf,EAAE,+CAA+C;EACjC,CAAA,EACnB,oBAAC,kBAAD;EAAkB,eAAe,OAAO,UAAU;YAC/C,EAAE,sCAAsC;EACxB,CAAA,CACC,EAAA,CAAA,CACT,EAAA,CAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
|
|
3
|
-
declare function ChatHistoryEmpty(): 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-empty.d.ts
|
|
4
|
+
declare function ChatHistoryEmpty(): react_jsx_runtime0.JSX.Element;
|
|
5
|
+
//#endregion
|
|
5
6
|
export { ChatHistoryEmpty };
|
|
7
|
+
//# sourceMappingURL=chat-history-empty.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-history-empty.d.ts","names":[],"sources":["../../../../src/features/chat/chat-history/chat-history-empty.tsx"],"mappings":";;;iBAWgB,gBAAA,CAAA,GAAgB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|