@chatsdk-dev/elements 0.0.1 → 0.1.2
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 +82 -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,38 @@
|
|
|
1
|
+
import { TextVariants } from "@chatsdk-dev/ui/atoms/typography/text";
|
|
2
|
+
|
|
3
|
+
//#region src/features/element/types/theme.d.ts
|
|
4
|
+
type ColorScheme = "light" | "dark" | "system";
|
|
5
|
+
type FontConfig = {
|
|
6
|
+
size: string;
|
|
7
|
+
lineHeight?: string;
|
|
8
|
+
letterSpacing?: string;
|
|
9
|
+
weight?: string;
|
|
10
|
+
family?: string;
|
|
11
|
+
style?: string;
|
|
12
|
+
transform?: string;
|
|
13
|
+
color?: string;
|
|
14
|
+
face?: Partial<{ [key in "400" | "500" | "600" | "700"]: {
|
|
15
|
+
normal?: string;
|
|
16
|
+
italic?: string;
|
|
17
|
+
} }>;
|
|
18
|
+
};
|
|
19
|
+
type RawFontProps = {
|
|
20
|
+
fontFamily?: string;
|
|
21
|
+
fontSize: number;
|
|
22
|
+
fontWeight: number;
|
|
23
|
+
lineHeight: number;
|
|
24
|
+
};
|
|
25
|
+
type ThemeConfig = {
|
|
26
|
+
colorScheme: ColorScheme;
|
|
27
|
+
font: {
|
|
28
|
+
body: FontConfig;
|
|
29
|
+
heading: FontConfig;
|
|
30
|
+
variants: Record<NonNullable<TextVariants["variant"]>, RawFontProps>;
|
|
31
|
+
};
|
|
32
|
+
defaultRadius: string;
|
|
33
|
+
defaultShadow: string;
|
|
34
|
+
components?: Record<string, object>;
|
|
35
|
+
};
|
|
36
|
+
//#endregion
|
|
37
|
+
export { ThemeConfig as i, FontConfig as n, RawFontProps as r, ColorScheme as t };
|
|
38
|
+
//# sourceMappingURL=theme-Cb-RBWbR.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-Cb-RBWbR.d.ts","names":[],"sources":["../src/features/element/types/theme.ts"],"mappings":";;;KAEY,WAAA;AAAA,KAEA,UAAA;EACV,IAAA;EACA,UAAA;EACA,aAAA;EACA,MAAA;EACA,MAAA;EACA,KAAA;EACA,SAAA;EACA,KAAA;EAEA,IAAA,GAAO,OAAA;IAEH,MAAA;IACA,MAAA;EAAA;AAAA;AAAA,KAKM,YAAA;EACV,UAAA;EACA,QAAA;EACA,UAAA;EACA,UAAA;AAAA;AAAA,KAGU,WAAA;EACV,WAAA,EAAa,WAAA;EACb,IAAA;IACE,IAAA,EAAM,UAAA;IACN,OAAA,EAAS,UAAA;IACT,QAAA,EAAU,MAAA,CAAO,WAAA,CAAY,YAAA,cAA0B,YAAA;EAAA;EAEzD,aAAA;EACA,aAAA;EACA,UAAA,GAAa,MAAA;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatsdk-dev/elements",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -17,31 +17,7 @@
|
|
|
17
17
|
"import": "./dist/index.js",
|
|
18
18
|
"default": "./dist/index.js"
|
|
19
19
|
},
|
|
20
|
-
"./styles.css": "./dist/styles.css"
|
|
21
|
-
"./i18n/*": {
|
|
22
|
-
"types": "./dist/i18n/*.d.ts",
|
|
23
|
-
"default": "./dist/i18n/*.js"
|
|
24
|
-
},
|
|
25
|
-
"./components/*": {
|
|
26
|
-
"types": "./dist/components/*.d.ts",
|
|
27
|
-
"default": "./dist/components/*.js"
|
|
28
|
-
},
|
|
29
|
-
"./chat": {
|
|
30
|
-
"types": "./dist/features/chat/index.d.ts",
|
|
31
|
-
"default": "./dist/features/chat/index.js"
|
|
32
|
-
},
|
|
33
|
-
"./molecules/*": {
|
|
34
|
-
"types": "./dist/features/molecule/*.d.ts",
|
|
35
|
-
"default": "./dist/features/molecule/*.js"
|
|
36
|
-
},
|
|
37
|
-
"./common/*": {
|
|
38
|
-
"types": "./dist/common/*.d.ts",
|
|
39
|
-
"default": "./dist/common/*.js"
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
"publishConfig": {
|
|
43
|
-
"access": "public",
|
|
44
|
-
"registry": "https://registry.npmjs.org/"
|
|
20
|
+
"./styles.css": "./dist/styles.css"
|
|
45
21
|
},
|
|
46
22
|
"peerDependencies": {
|
|
47
23
|
"react": ">=18",
|
|
@@ -49,30 +25,14 @@
|
|
|
49
25
|
},
|
|
50
26
|
"dependencies": {
|
|
51
27
|
"@ai-sdk/react": "3.0.118",
|
|
52
|
-
"@radix-ui/react-use-controllable-state": "^1.2.2",
|
|
53
|
-
"@rive-app/react-webgl2": "^4.27.2",
|
|
54
|
-
"@streamdown/cjk": "^1.0.3",
|
|
55
|
-
"@streamdown/code": "^1.1.1",
|
|
56
|
-
"@streamdown/math": "^1.0.2",
|
|
57
|
-
"@streamdown/mermaid": "^1.0.2",
|
|
58
28
|
"@tanstack/react-query": "^5.94.5",
|
|
59
|
-
"@xyflow/react": "^12.10.1",
|
|
60
29
|
"ai": "^6.0.134",
|
|
61
|
-
"ansi-to-react": "^6.2.6",
|
|
62
30
|
"i18next": "^25.10.3",
|
|
63
31
|
"lucide-react": "^0.577.0",
|
|
64
|
-
"media-chrome": "^4.18.2",
|
|
65
|
-
"motion": "^12.38.0",
|
|
66
|
-
"nanoid": "^5.1.7",
|
|
67
32
|
"react-i18next": "^16.6.0",
|
|
68
|
-
"react-jsx-parser": "^2.4.1",
|
|
69
|
-
"shiki": "^4.0.2",
|
|
70
|
-
"streamdown": "^2.5.0",
|
|
71
|
-
"tokenlens": "^1.3.1",
|
|
72
|
-
"use-stick-to-bottom": "^1.1.3",
|
|
73
33
|
"zustand": "^5.0.12",
|
|
74
|
-
"@chatsdk-dev/
|
|
75
|
-
"@chatsdk-dev/
|
|
34
|
+
"@chatsdk-dev/ui": "0.1.2",
|
|
35
|
+
"@chatsdk-dev/api-client": "0.1.2"
|
|
76
36
|
},
|
|
77
37
|
"devDependencies": {
|
|
78
38
|
"@storybook/react": "10.2.19",
|
|
@@ -83,13 +43,16 @@
|
|
|
83
43
|
"@types/react-dom": "19.2.3",
|
|
84
44
|
"eslint": "^9.39.4",
|
|
85
45
|
"glob": "^10.4.5",
|
|
46
|
+
"postcss": "^8.5.8",
|
|
47
|
+
"postcss-cli": "^11.0.1",
|
|
48
|
+
"postcss-prefix-selector": "^2.1.1",
|
|
86
49
|
"storybook": "10.2.19",
|
|
87
50
|
"tailwindcss": "^4.2.2",
|
|
88
|
-
"
|
|
51
|
+
"tsdown": "^0.21.5",
|
|
89
52
|
"typescript": "5.9.3",
|
|
90
|
-
"@chatsdk-dev/eslint-config": "0.0.0",
|
|
91
53
|
"@chatsdk-dev/tailwind-config": "0.0.0",
|
|
92
|
-
"@chatsdk-dev/typescript-config": "0.0.0"
|
|
54
|
+
"@chatsdk-dev/typescript-config": "0.0.0",
|
|
55
|
+
"@chatsdk-dev/eslint-config": "0.0.0"
|
|
93
56
|
},
|
|
94
57
|
"keywords": [
|
|
95
58
|
"react",
|
|
@@ -104,13 +67,18 @@
|
|
|
104
67
|
"url": "https://github.com/Mimameid/chatsdk.git",
|
|
105
68
|
"directory": "packages/elements"
|
|
106
69
|
},
|
|
70
|
+
"publishConfig": {
|
|
71
|
+
"access": "public"
|
|
72
|
+
},
|
|
107
73
|
"scripts": {
|
|
108
74
|
"build": "pnpm run build:clean && pnpm run build:lib && pnpm run build:styles",
|
|
109
75
|
"build:clean": "rm -rf dist",
|
|
110
|
-
"build:lib": "
|
|
111
|
-
"build:styles": "
|
|
76
|
+
"build:lib": "tsdown",
|
|
77
|
+
"build:styles": "pnpm run build:styles:tw && pnpm run build:styles:scope",
|
|
78
|
+
"build:styles:tw": "tailwindcss -i ./src/styles.css -o ./dist/styles.css",
|
|
79
|
+
"build:styles:scope": "postcss ./dist/styles.css -o ./dist/styles.css",
|
|
112
80
|
"dev:styles": "tailwindcss -i ./src/styles.css -o ./dist/styles.css --watch",
|
|
113
|
-
"dev:lib": "
|
|
81
|
+
"dev:lib": "tsdown --watch",
|
|
114
82
|
"dev:ts": "tsc --watch --noEmit",
|
|
115
83
|
"dev:storybook": "pnpm -C . run dev:styles & pnpm -C . run storybook",
|
|
116
84
|
"check-types": "tsc --noEmit",
|
package/dist/chunk-2LHKM7RD.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { create } from 'zustand';
|
|
2
|
-
|
|
3
|
-
// src/features/chat/store.ts
|
|
4
|
-
var createChatStore = () => create((set) => ({
|
|
5
|
-
tab: "chat",
|
|
6
|
-
conversationType: "new",
|
|
7
|
-
selectedConversationId: void 0,
|
|
8
|
-
setTab: (tab) => set({ tab }),
|
|
9
|
-
setSelectedConversationId: (id) => set({ selectedConversationId: id }),
|
|
10
|
-
setConversationType: (type) => set({ conversationType: type })
|
|
11
|
-
}));
|
|
12
|
-
var useChatStore = createChatStore();
|
|
13
|
-
|
|
14
|
-
export { useChatStore };
|
package/dist/chunk-5UMYP6MD.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// src/features/chat/utils.ts
|
|
2
|
-
function getInitialMessagesFromStrings(messages) {
|
|
3
|
-
return messages.map((message) => ({
|
|
4
|
-
id: crypto.randomUUID(),
|
|
5
|
-
role: "assistant",
|
|
6
|
-
parts: [{ type: "text", text: message }]
|
|
7
|
-
}));
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export { getInitialMessagesFromStrings };
|
package/dist/chunk-AP4MG32M.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { useChatStore } from './chunk-2LHKM7RD.js';
|
|
2
|
-
import { Ellipsis } from 'lucide-react';
|
|
3
|
-
import { useTranslation } from 'react-i18next';
|
|
4
|
-
import { buttonVariants } from '@chatsdk-dev/ui/components/button';
|
|
5
|
-
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem } from '@chatsdk-dev/ui/components/dropdown-menu';
|
|
6
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
7
|
-
|
|
8
|
-
function ChatMenu() {
|
|
9
|
-
const { t } = useTranslation();
|
|
10
|
-
const { setSelectedConversationId, setTab, setConversationType } = useChatStore();
|
|
11
|
-
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
12
|
-
/* @__PURE__ */ jsx(
|
|
13
|
-
DropdownMenuTrigger,
|
|
14
|
-
{
|
|
15
|
-
className: buttonVariants({ variant: "transparent" }),
|
|
16
|
-
children: /* @__PURE__ */ jsx(Ellipsis, { className: "size-4" })
|
|
17
|
-
}
|
|
18
|
-
),
|
|
19
|
-
/* @__PURE__ */ jsxs(DropdownMenuContent, { children: [
|
|
20
|
-
/* @__PURE__ */ jsx(
|
|
21
|
-
DropdownMenuItem,
|
|
22
|
-
{
|
|
23
|
-
onClick: () => {
|
|
24
|
-
setConversationType("new");
|
|
25
|
-
setSelectedConversationId();
|
|
26
|
-
setTab("chat");
|
|
27
|
-
},
|
|
28
|
-
children: t("header.menu.new-conversation-menu-item-label")
|
|
29
|
-
}
|
|
30
|
-
),
|
|
31
|
-
/* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => setTab("history"), children: t("header.menu.history-menu-item-label") })
|
|
32
|
-
] })
|
|
33
|
-
] });
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export { ChatMenu };
|
package/dist/chunk-CFM57HOS.js
DELETED
|
@@ -1,358 +0,0 @@
|
|
|
1
|
-
import { Button } from '@chatsdk-dev/ui/components/button';
|
|
2
|
-
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from '@chatsdk-dev/ui/components/select';
|
|
3
|
-
import { cn } from '@chatsdk-dev/ui/lib/utils';
|
|
4
|
-
import { CheckIcon, CopyIcon } from 'lucide-react';
|
|
5
|
-
import { createContext, memo, useMemo, useState, useRef, useEffect, useContext, useCallback } from 'react';
|
|
6
|
-
import { createHighlighter } from 'shiki';
|
|
7
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
|
-
|
|
9
|
-
// src/components/ai-elements/code-block.tsx
|
|
10
|
-
var isItalic = (fontStyle) => fontStyle && fontStyle & 1;
|
|
11
|
-
var isBold = (fontStyle) => fontStyle && fontStyle & 2;
|
|
12
|
-
var isUnderline = (fontStyle) => (
|
|
13
|
-
// oxlint-disable-next-line eslint(no-bitwise)
|
|
14
|
-
fontStyle && fontStyle & 4
|
|
15
|
-
);
|
|
16
|
-
var addKeysToTokens = (lines) => lines.map((line, lineIdx) => ({
|
|
17
|
-
key: `line-${lineIdx}`,
|
|
18
|
-
tokens: line.map((token, tokenIdx) => ({
|
|
19
|
-
key: `line-${lineIdx}-${tokenIdx}`,
|
|
20
|
-
token
|
|
21
|
-
}))
|
|
22
|
-
}));
|
|
23
|
-
var TokenSpan = ({ token }) => /* @__PURE__ */ jsx(
|
|
24
|
-
"span",
|
|
25
|
-
{
|
|
26
|
-
className: "dark:!bg-[var(--shiki-dark-bg)] dark:!text-[var(--shiki-dark)]",
|
|
27
|
-
style: {
|
|
28
|
-
backgroundColor: token.bgColor,
|
|
29
|
-
color: token.color,
|
|
30
|
-
fontStyle: isItalic(token.fontStyle) ? "italic" : void 0,
|
|
31
|
-
fontWeight: isBold(token.fontStyle) ? "bold" : void 0,
|
|
32
|
-
textDecoration: isUnderline(token.fontStyle) ? "underline" : void 0,
|
|
33
|
-
...token.htmlStyle
|
|
34
|
-
},
|
|
35
|
-
children: token.content
|
|
36
|
-
}
|
|
37
|
-
);
|
|
38
|
-
var LINE_NUMBER_CLASSES = cn(
|
|
39
|
-
"block",
|
|
40
|
-
"before:content-[counter(line)]",
|
|
41
|
-
"before:inline-block",
|
|
42
|
-
"before:[counter-increment:line]",
|
|
43
|
-
"before:w-8",
|
|
44
|
-
"before:mr-4",
|
|
45
|
-
"before:text-right",
|
|
46
|
-
"before:text-muted-foreground/50",
|
|
47
|
-
"before:font-mono",
|
|
48
|
-
"before:select-none"
|
|
49
|
-
);
|
|
50
|
-
var LineSpan = ({
|
|
51
|
-
keyedLine,
|
|
52
|
-
showLineNumbers
|
|
53
|
-
}) => /* @__PURE__ */ jsx("span", { className: showLineNumbers ? LINE_NUMBER_CLASSES : "block", children: keyedLine.tokens.length === 0 ? "\n" : keyedLine.tokens.map(({ token, key }) => /* @__PURE__ */ jsx(TokenSpan, { token }, key)) });
|
|
54
|
-
var CodeBlockContext = createContext({
|
|
55
|
-
code: ""
|
|
56
|
-
});
|
|
57
|
-
var highlighterCache = /* @__PURE__ */ new Map();
|
|
58
|
-
var tokensCache = /* @__PURE__ */ new Map();
|
|
59
|
-
var subscribers = /* @__PURE__ */ new Map();
|
|
60
|
-
var getTokensCacheKey = (code, language) => {
|
|
61
|
-
const start = code.slice(0, 100);
|
|
62
|
-
const end = code.length > 100 ? code.slice(-100) : "";
|
|
63
|
-
return `${language}:${code.length}:${start}:${end}`;
|
|
64
|
-
};
|
|
65
|
-
var getHighlighter = (language) => {
|
|
66
|
-
const cached = highlighterCache.get(language);
|
|
67
|
-
if (cached) {
|
|
68
|
-
return cached;
|
|
69
|
-
}
|
|
70
|
-
const highlighterPromise = createHighlighter({
|
|
71
|
-
langs: [language],
|
|
72
|
-
themes: ["github-light", "github-dark"]
|
|
73
|
-
});
|
|
74
|
-
highlighterCache.set(language, highlighterPromise);
|
|
75
|
-
return highlighterPromise;
|
|
76
|
-
};
|
|
77
|
-
var createRawTokens = (code) => ({
|
|
78
|
-
bg: "transparent",
|
|
79
|
-
fg: "inherit",
|
|
80
|
-
tokens: code.split("\n").map(
|
|
81
|
-
(line) => line === "" ? [] : [
|
|
82
|
-
{
|
|
83
|
-
color: "inherit",
|
|
84
|
-
content: line
|
|
85
|
-
}
|
|
86
|
-
]
|
|
87
|
-
)
|
|
88
|
-
});
|
|
89
|
-
var highlightCode = (code, language, callback) => {
|
|
90
|
-
const tokensCacheKey = getTokensCacheKey(code, language);
|
|
91
|
-
const cached = tokensCache.get(tokensCacheKey);
|
|
92
|
-
if (cached) {
|
|
93
|
-
return cached;
|
|
94
|
-
}
|
|
95
|
-
if (callback) {
|
|
96
|
-
if (!subscribers.has(tokensCacheKey)) {
|
|
97
|
-
subscribers.set(tokensCacheKey, /* @__PURE__ */ new Set());
|
|
98
|
-
}
|
|
99
|
-
subscribers.get(tokensCacheKey)?.add(callback);
|
|
100
|
-
}
|
|
101
|
-
getHighlighter(language).then((highlighter) => {
|
|
102
|
-
const availableLangs = highlighter.getLoadedLanguages();
|
|
103
|
-
const langToUse = availableLangs.includes(language) ? language : "text";
|
|
104
|
-
const result = highlighter.codeToTokens(code, {
|
|
105
|
-
lang: langToUse,
|
|
106
|
-
themes: {
|
|
107
|
-
dark: "github-dark",
|
|
108
|
-
light: "github-light"
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
const tokenized = {
|
|
112
|
-
bg: result.bg ?? "transparent",
|
|
113
|
-
fg: result.fg ?? "inherit",
|
|
114
|
-
tokens: result.tokens
|
|
115
|
-
};
|
|
116
|
-
tokensCache.set(tokensCacheKey, tokenized);
|
|
117
|
-
const subs = subscribers.get(tokensCacheKey);
|
|
118
|
-
if (subs) {
|
|
119
|
-
for (const sub of subs) {
|
|
120
|
-
sub(tokenized);
|
|
121
|
-
}
|
|
122
|
-
subscribers.delete(tokensCacheKey);
|
|
123
|
-
}
|
|
124
|
-
}).catch((error) => {
|
|
125
|
-
console.error("Failed to highlight code:", error);
|
|
126
|
-
subscribers.delete(tokensCacheKey);
|
|
127
|
-
});
|
|
128
|
-
return null;
|
|
129
|
-
};
|
|
130
|
-
var CodeBlockBody = memo(
|
|
131
|
-
({
|
|
132
|
-
tokenized,
|
|
133
|
-
showLineNumbers,
|
|
134
|
-
className
|
|
135
|
-
}) => {
|
|
136
|
-
const preStyle = useMemo(
|
|
137
|
-
() => ({
|
|
138
|
-
backgroundColor: tokenized.bg,
|
|
139
|
-
color: tokenized.fg
|
|
140
|
-
}),
|
|
141
|
-
[tokenized.bg, tokenized.fg]
|
|
142
|
-
);
|
|
143
|
-
const keyedLines = useMemo(
|
|
144
|
-
() => addKeysToTokens(tokenized.tokens),
|
|
145
|
-
[tokenized.tokens]
|
|
146
|
-
);
|
|
147
|
-
return /* @__PURE__ */ jsx(
|
|
148
|
-
"pre",
|
|
149
|
-
{
|
|
150
|
-
className: cn(
|
|
151
|
-
"dark:!bg-[var(--shiki-dark-bg)] dark:!text-[var(--shiki-dark)] m-0 p-4 text-sm",
|
|
152
|
-
className
|
|
153
|
-
),
|
|
154
|
-
style: preStyle,
|
|
155
|
-
children: /* @__PURE__ */ jsx(
|
|
156
|
-
"code",
|
|
157
|
-
{
|
|
158
|
-
className: cn(
|
|
159
|
-
"font-mono text-sm",
|
|
160
|
-
showLineNumbers && "[counter-increment:line_0] [counter-reset:line]"
|
|
161
|
-
),
|
|
162
|
-
children: keyedLines.map((keyedLine) => /* @__PURE__ */ jsx(
|
|
163
|
-
LineSpan,
|
|
164
|
-
{
|
|
165
|
-
keyedLine,
|
|
166
|
-
showLineNumbers
|
|
167
|
-
},
|
|
168
|
-
keyedLine.key
|
|
169
|
-
))
|
|
170
|
-
}
|
|
171
|
-
)
|
|
172
|
-
}
|
|
173
|
-
);
|
|
174
|
-
},
|
|
175
|
-
(prevProps, nextProps) => prevProps.tokenized === nextProps.tokenized && prevProps.showLineNumbers === nextProps.showLineNumbers && prevProps.className === nextProps.className
|
|
176
|
-
);
|
|
177
|
-
CodeBlockBody.displayName = "CodeBlockBody";
|
|
178
|
-
var CodeBlockContainer = ({
|
|
179
|
-
className,
|
|
180
|
-
language,
|
|
181
|
-
style,
|
|
182
|
-
...props
|
|
183
|
-
}) => /* @__PURE__ */ jsx(
|
|
184
|
-
"div",
|
|
185
|
-
{
|
|
186
|
-
className: cn(
|
|
187
|
-
"group relative w-full overflow-hidden rounded-md border bg-background text-foreground",
|
|
188
|
-
className
|
|
189
|
-
),
|
|
190
|
-
"data-language": language,
|
|
191
|
-
style: {
|
|
192
|
-
containIntrinsicSize: "auto 200px",
|
|
193
|
-
contentVisibility: "auto",
|
|
194
|
-
...style
|
|
195
|
-
},
|
|
196
|
-
...props
|
|
197
|
-
}
|
|
198
|
-
);
|
|
199
|
-
var CodeBlockHeader = ({
|
|
200
|
-
children,
|
|
201
|
-
className,
|
|
202
|
-
...props
|
|
203
|
-
}) => /* @__PURE__ */ jsx(
|
|
204
|
-
"div",
|
|
205
|
-
{
|
|
206
|
-
className: cn(
|
|
207
|
-
"flex items-center justify-between border-b bg-muted/80 px-3 py-2 text-muted-foreground text-xs",
|
|
208
|
-
className
|
|
209
|
-
),
|
|
210
|
-
...props,
|
|
211
|
-
children
|
|
212
|
-
}
|
|
213
|
-
);
|
|
214
|
-
var CodeBlockTitle = ({
|
|
215
|
-
children,
|
|
216
|
-
className,
|
|
217
|
-
...props
|
|
218
|
-
}) => /* @__PURE__ */ jsx("div", { className: cn("flex items-center gap-2", className), ...props, children });
|
|
219
|
-
var CodeBlockFilename = ({
|
|
220
|
-
children,
|
|
221
|
-
className,
|
|
222
|
-
...props
|
|
223
|
-
}) => /* @__PURE__ */ jsx("span", { className: cn("font-mono", className), ...props, children });
|
|
224
|
-
var CodeBlockActions = ({
|
|
225
|
-
children,
|
|
226
|
-
className,
|
|
227
|
-
...props
|
|
228
|
-
}) => /* @__PURE__ */ jsx(
|
|
229
|
-
"div",
|
|
230
|
-
{
|
|
231
|
-
className: cn("-my-1 -mr-1 flex items-center gap-2", className),
|
|
232
|
-
...props,
|
|
233
|
-
children
|
|
234
|
-
}
|
|
235
|
-
);
|
|
236
|
-
var CodeBlockContent = ({
|
|
237
|
-
code,
|
|
238
|
-
language,
|
|
239
|
-
showLineNumbers = false
|
|
240
|
-
}) => {
|
|
241
|
-
const rawTokens = useMemo(() => createRawTokens(code), [code]);
|
|
242
|
-
const syncTokens = useMemo(
|
|
243
|
-
() => highlightCode(code, language) ?? rawTokens,
|
|
244
|
-
[code, language, rawTokens]
|
|
245
|
-
);
|
|
246
|
-
const [asyncTokens, setAsyncTokens] = useState(null);
|
|
247
|
-
const asyncKeyRef = useRef({ code, language });
|
|
248
|
-
if (asyncKeyRef.current.code !== code || asyncKeyRef.current.language !== language) {
|
|
249
|
-
asyncKeyRef.current = { code, language };
|
|
250
|
-
setAsyncTokens(null);
|
|
251
|
-
}
|
|
252
|
-
useEffect(() => {
|
|
253
|
-
let cancelled = false;
|
|
254
|
-
highlightCode(code, language, (result) => {
|
|
255
|
-
if (!cancelled) {
|
|
256
|
-
setAsyncTokens(result);
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
return () => {
|
|
260
|
-
cancelled = true;
|
|
261
|
-
};
|
|
262
|
-
}, [code, language]);
|
|
263
|
-
const tokenized = asyncTokens ?? syncTokens;
|
|
264
|
-
return /* @__PURE__ */ jsx("div", { className: "relative overflow-auto", children: /* @__PURE__ */ jsx(CodeBlockBody, { showLineNumbers, tokenized }) });
|
|
265
|
-
};
|
|
266
|
-
var CodeBlock = ({
|
|
267
|
-
code,
|
|
268
|
-
language,
|
|
269
|
-
showLineNumbers = false,
|
|
270
|
-
className,
|
|
271
|
-
children,
|
|
272
|
-
...props
|
|
273
|
-
}) => {
|
|
274
|
-
const contextValue = useMemo(() => ({ code }), [code]);
|
|
275
|
-
return /* @__PURE__ */ jsx(CodeBlockContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsxs(CodeBlockContainer, { className, language, ...props, children: [
|
|
276
|
-
children,
|
|
277
|
-
/* @__PURE__ */ jsx(
|
|
278
|
-
CodeBlockContent,
|
|
279
|
-
{
|
|
280
|
-
code,
|
|
281
|
-
language,
|
|
282
|
-
showLineNumbers
|
|
283
|
-
}
|
|
284
|
-
)
|
|
285
|
-
] }) });
|
|
286
|
-
};
|
|
287
|
-
var CodeBlockCopyButton = ({
|
|
288
|
-
onCopy,
|
|
289
|
-
onError,
|
|
290
|
-
timeout = 2e3,
|
|
291
|
-
children,
|
|
292
|
-
className,
|
|
293
|
-
...props
|
|
294
|
-
}) => {
|
|
295
|
-
const [isCopied, setIsCopied] = useState(false);
|
|
296
|
-
const timeoutRef = useRef(0);
|
|
297
|
-
const { code } = useContext(CodeBlockContext);
|
|
298
|
-
const copyToClipboard = useCallback(async () => {
|
|
299
|
-
if (typeof window === "undefined" || !navigator?.clipboard?.writeText) {
|
|
300
|
-
onError?.(new Error("Clipboard API not available"));
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
try {
|
|
304
|
-
if (!isCopied) {
|
|
305
|
-
await navigator.clipboard.writeText(code);
|
|
306
|
-
setIsCopied(true);
|
|
307
|
-
onCopy?.();
|
|
308
|
-
timeoutRef.current = window.setTimeout(
|
|
309
|
-
() => setIsCopied(false),
|
|
310
|
-
timeout
|
|
311
|
-
);
|
|
312
|
-
}
|
|
313
|
-
} catch (error) {
|
|
314
|
-
onError?.(error);
|
|
315
|
-
}
|
|
316
|
-
}, [code, onCopy, onError, timeout, isCopied]);
|
|
317
|
-
useEffect(
|
|
318
|
-
() => () => {
|
|
319
|
-
window.clearTimeout(timeoutRef.current);
|
|
320
|
-
},
|
|
321
|
-
[]
|
|
322
|
-
);
|
|
323
|
-
const Icon = isCopied ? CheckIcon : CopyIcon;
|
|
324
|
-
return /* @__PURE__ */ jsx(
|
|
325
|
-
Button,
|
|
326
|
-
{
|
|
327
|
-
className: cn("shrink-0", className),
|
|
328
|
-
onClick: copyToClipboard,
|
|
329
|
-
size: "icon",
|
|
330
|
-
variant: "ghost",
|
|
331
|
-
...props,
|
|
332
|
-
children: children ?? /* @__PURE__ */ jsx(Icon, { size: 14 })
|
|
333
|
-
}
|
|
334
|
-
);
|
|
335
|
-
};
|
|
336
|
-
var CodeBlockLanguageSelector = (props) => /* @__PURE__ */ jsx(Select, { ...props });
|
|
337
|
-
var CodeBlockLanguageSelectorTrigger = ({
|
|
338
|
-
className,
|
|
339
|
-
...props
|
|
340
|
-
}) => /* @__PURE__ */ jsx(
|
|
341
|
-
SelectTrigger,
|
|
342
|
-
{
|
|
343
|
-
className: cn(
|
|
344
|
-
"h-7 border-none bg-transparent px-2 text-xs shadow-none",
|
|
345
|
-
className
|
|
346
|
-
),
|
|
347
|
-
size: "sm",
|
|
348
|
-
...props
|
|
349
|
-
}
|
|
350
|
-
);
|
|
351
|
-
var CodeBlockLanguageSelectorValue = (props) => /* @__PURE__ */ jsx(SelectValue, { ...props });
|
|
352
|
-
var CodeBlockLanguageSelectorContent = ({
|
|
353
|
-
align = "end",
|
|
354
|
-
...props
|
|
355
|
-
}) => /* @__PURE__ */ jsx(SelectContent, { align, ...props });
|
|
356
|
-
var CodeBlockLanguageSelectorItem = (props) => /* @__PURE__ */ jsx(SelectItem, { ...props });
|
|
357
|
-
|
|
358
|
-
export { CodeBlock, CodeBlockActions, CodeBlockContainer, CodeBlockContent, CodeBlockCopyButton, CodeBlockFilename, CodeBlockHeader, CodeBlockLanguageSelector, CodeBlockLanguageSelectorContent, CodeBlockLanguageSelectorItem, CodeBlockLanguageSelectorTrigger, CodeBlockLanguageSelectorValue, CodeBlockTitle, highlightCode };
|
package/dist/chunk-EGIUE7H2.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
|
|
3
|
-
// src/components/info-card.tsx
|
|
4
|
-
function InfoCard({
|
|
5
|
-
title,
|
|
6
|
-
description,
|
|
7
|
-
children,
|
|
8
|
-
actionLabel,
|
|
9
|
-
onActionClick,
|
|
10
|
-
className
|
|
11
|
-
}) {
|
|
12
|
-
return /* @__PURE__ */ jsxs(
|
|
13
|
-
"div",
|
|
14
|
-
{
|
|
15
|
-
"data-slot": "info-card",
|
|
16
|
-
className: "rounded-xl border border-gray-200 shadow-sm p-4 bg-white text-gray-900 " + (className ?? ""),
|
|
17
|
-
children: [
|
|
18
|
-
/* @__PURE__ */ jsxs("div", { className: "mb-3", children: [
|
|
19
|
-
/* @__PURE__ */ jsx("div", { className: "text-lg font-semibold", children: title }),
|
|
20
|
-
description ? /* @__PURE__ */ jsx("div", { className: "text-sm text-gray-500", children: description }) : null
|
|
21
|
-
] }),
|
|
22
|
-
/* @__PURE__ */ jsx("div", { className: "text-sm", children }),
|
|
23
|
-
actionLabel ? /* @__PURE__ */ jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsx(
|
|
24
|
-
"button",
|
|
25
|
-
{
|
|
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
|
-
}
|
|
36
|
-
|
|
37
|
-
export { InfoCard };
|