@asgard-js/react 0.0.1
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 +7 -0
- package/dist/components/chatbot/chatbot-body.d.ts +4 -0
- package/dist/components/chatbot/chatbot-body.d.ts.map +1 -0
- package/dist/components/chatbot/chatbot-footer.d.ts +4 -0
- package/dist/components/chatbot/chatbot-footer.d.ts.map +1 -0
- package/dist/components/chatbot/chatbot-header.d.ts +4 -0
- package/dist/components/chatbot/chatbot-header.d.ts.map +1 -0
- package/dist/components/chatbot/chatbot.d.ts +12 -0
- package/dist/components/chatbot/chatbot.d.ts.map +1 -0
- package/dist/components/conversation-message-renderer/conversation-message-renderer.d.ts +9 -0
- package/dist/components/conversation-message-renderer/conversation-message-renderer.d.ts.map +1 -0
- package/dist/components/conversation-message-renderer/index.d.ts +2 -0
- package/dist/components/conversation-message-renderer/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/message-box/message-box.d.ts +9 -0
- package/dist/components/message-box/message-box.d.ts.map +1 -0
- package/dist/components/templates/avatar/avatar.d.ts +4 -0
- package/dist/components/templates/avatar/avatar.d.ts.map +1 -0
- package/dist/components/templates/avatar/index.d.ts +2 -0
- package/dist/components/templates/avatar/index.d.ts.map +1 -0
- package/dist/components/templates/bot-typing-box/bot-typing-box.d.ts +4 -0
- package/dist/components/templates/bot-typing-box/bot-typing-box.d.ts.map +1 -0
- package/dist/components/templates/bot-typing-box/index.d.ts +2 -0
- package/dist/components/templates/bot-typing-box/index.d.ts.map +1 -0
- package/dist/components/templates/bot-typing-box/resize-observer-box.d.ts +9 -0
- package/dist/components/templates/bot-typing-box/resize-observer-box.d.ts.map +1 -0
- package/dist/components/templates/button-template/button-template.d.ts +9 -0
- package/dist/components/templates/button-template/button-template.d.ts.map +1 -0
- package/dist/components/templates/button-template/card.d.ts +9 -0
- package/dist/components/templates/button-template/card.d.ts.map +1 -0
- package/dist/components/templates/button-template/index.d.ts +2 -0
- package/dist/components/templates/button-template/index.d.ts.map +1 -0
- package/dist/components/templates/carousel-template/carousel-template.d.ts +9 -0
- package/dist/components/templates/carousel-template/carousel-template.d.ts.map +1 -0
- package/dist/components/templates/carousel-template/index.d.ts +2 -0
- package/dist/components/templates/carousel-template/index.d.ts.map +1 -0
- package/dist/components/templates/hint-template/hint-template.d.ts +9 -0
- package/dist/components/templates/hint-template/hint-template.d.ts.map +1 -0
- package/dist/components/templates/hint-template/index.d.ts +2 -0
- package/dist/components/templates/hint-template/index.d.ts.map +1 -0
- package/dist/components/templates/index.d.ts +8 -0
- package/dist/components/templates/index.d.ts.map +1 -0
- package/dist/components/templates/quick-replies/index.d.ts +2 -0
- package/dist/components/templates/quick-replies/index.d.ts.map +1 -0
- package/dist/components/templates/quick-replies/quick-replies.d.ts +10 -0
- package/dist/components/templates/quick-replies/quick-replies.d.ts.map +1 -0
- package/dist/components/templates/template-box/index.d.ts +3 -0
- package/dist/components/templates/template-box/index.d.ts.map +1 -0
- package/dist/components/templates/template-box/template-box-content.d.ts +12 -0
- package/dist/components/templates/template-box/template-box-content.d.ts.map +1 -0
- package/dist/components/templates/template-box/template-box.d.ts +14 -0
- package/dist/components/templates/template-box/template-box.d.ts.map +1 -0
- package/dist/components/templates/text-template/index.d.ts +2 -0
- package/dist/components/templates/text-template/index.d.ts.map +1 -0
- package/dist/components/templates/text-template/text-template.d.ts +9 -0
- package/dist/components/templates/text-template/text-template.d.ts.map +1 -0
- package/dist/components/templates/time/index.d.ts +2 -0
- package/dist/components/templates/time/index.d.ts.map +1 -0
- package/dist/components/templates/time/time.d.ts +9 -0
- package/dist/components/templates/time/time.d.ts.map +1 -0
- package/dist/context/asgard-service-context.d.ts +22 -0
- package/dist/context/asgard-service-context.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/use-asgard-service-client.d.ts +8 -0
- package/dist/hooks/use-asgard-service-client.d.ts.map +1 -0
- package/dist/hooks/use-channel.d.ts +30 -0
- package/dist/hooks/use-channel.d.ts.map +1 -0
- package/dist/hooks/use-chatbot-typing.d.ts +11 -0
- package/dist/hooks/use-chatbot-typing.d.ts.map +1 -0
- package/dist/hooks/use-debounce.d.ts +2 -0
- package/dist/hooks/use-debounce.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +533 -0
- package/dist/style.css +1 -0
- package/dist/utils/format-time.d.ts +2 -0
- package/dist/utils/format-time.d.ts.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/package.json +31 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatbot-body.d.ts","sourceRoot":"","sources":["../../../src/components/chatbot/chatbot-body.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAa,MAAM,OAAO,CAAC;AAM7C,wBAAgB,WAAW,IAAI,SAAS,CAmBvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatbot-footer.d.ts","sourceRoot":"","sources":["../../../src/components/chatbot/chatbot-footer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,SAAS,EAGV,MAAM,OAAO,CAAC;AAIf,wBAAgB,aAAa,IAAI,SAAS,CAkCzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatbot-header.d.ts","sourceRoot":"","sources":["../../../src/components/chatbot/chatbot-header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlC,wBAAgB,aAAa,IAAI,SAAS,CAEzC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ConversationMessage } from '../../hooks';
|
|
2
|
+
import { ClientConfig } from '@asgard-js/core';
|
|
3
|
+
import { ReactNode } from 'react';
|
|
4
|
+
|
|
5
|
+
interface ChatbotProps {
|
|
6
|
+
config: ClientConfig;
|
|
7
|
+
customChannelId: string;
|
|
8
|
+
initConversation?: ConversationMessage[];
|
|
9
|
+
}
|
|
10
|
+
export declare function Chatbot(props: ChatbotProps): ReactNode;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=chatbot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chatbot.d.ts","sourceRoot":"","sources":["../../../src/components/chatbot/chatbot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAM/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAEhD,UAAU,YAAY;IACpB,MAAM,EAAE,YAAY,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,mBAAmB,EAAE,CAAC;CAC1C;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAetD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ConversationMessage } from '../../hooks';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface ConversationMessageRendererProps {
|
|
5
|
+
conversationMessage: ConversationMessage;
|
|
6
|
+
}
|
|
7
|
+
export declare function ConversationMessageRenderer(props: ConversationMessageRendererProps): ReactNode;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=conversation-message-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation-message-renderer.d.ts","sourceRoot":"","sources":["../../../src/components/conversation-message-renderer/conversation-message-renderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAShD,UAAU,gCAAgC;IACxC,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,gCAAgC,GACtC,SAAS,CAqBX"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/conversation-message-renderer/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ConversationMessage } from '../../hooks';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface MessageBoxProps {
|
|
5
|
+
conversationMessage: ConversationMessage;
|
|
6
|
+
}
|
|
7
|
+
export declare function MessageBox(props: MessageBoxProps): ReactNode;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=message-box.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-box.d.ts","sourceRoot":"","sources":["../../../src/components/message-box/message-box.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAKhD,UAAU,eAAe;IACvB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C;AAGD,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,SAAS,CAsC5D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/avatar/avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlC,wBAAgB,MAAM,IAAI,SAAS,CAqBlC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/avatar/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bot-typing-box.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/bot-typing-box/bot-typing-box.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAe,MAAM,OAAO,CAAC;AAQ/C,wBAAgB,YAAY,IAAI,SAAS,CA4BxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/bot-typing-box/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
interface ResizeObserverBoxProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
onResize: (width: number, height: number) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function ResizeObserverBox(props: ResizeObserverBoxProps): ReactNode;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=resize-observer-box.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resize-observer-box.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/bot-typing-box/resize-observer-box.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AAErD,UAAU,sBAAsB;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;CACnD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,SAAS,CAsB1E"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ConversationBotMessage } from '../../../hooks';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface ButtonTemplateProps {
|
|
5
|
+
conversationMessage: ConversationBotMessage;
|
|
6
|
+
}
|
|
7
|
+
export declare function ButtonTemplate(props: ButtonTemplateProps): ReactNode;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=button-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button-template.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/button-template/button-template.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAKnD,UAAU,mBAAmB;IAC3B,mBAAmB,EAAE,sBAAsB,CAAC;CAC7C;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,SAAS,CAiBpE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ButtonMessageTemplate, CarouselMessageTemplate } from '@asgard-js/core';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface CardProps {
|
|
5
|
+
template: ButtonMessageTemplate | CarouselMessageTemplate['columns'][number];
|
|
6
|
+
}
|
|
7
|
+
export declare function Card(props: CardProps): ReactNode;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/button-template/card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,SAAS,EAAwB,MAAM,OAAO,CAAC;AAE3E,OAAO,EAEL,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AAGzB,UAAU,SAAS;IACjB,QAAQ,EAAE,qBAAqB,GAAG,uBAAuB,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;CAC9E;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CAqEhD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/button-template/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ConversationBotMessage } from '../../../hooks';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface CarouselTemplateProps {
|
|
5
|
+
conversationMessage: ConversationBotMessage;
|
|
6
|
+
}
|
|
7
|
+
export declare function CarouselTemplate(props: CarouselTemplateProps): ReactNode;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=carousel-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel-template.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/carousel-template/carousel-template.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAQnD,UAAU,qBAAqB;IAC7B,mBAAmB,EAAE,sBAAsB,CAAC;CAC7C;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,SAAS,CAiBxE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/carousel-template/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ConversationMessage } from '../../../hooks';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface HintTemplateProps {
|
|
5
|
+
conversationMessage: ConversationMessage;
|
|
6
|
+
}
|
|
7
|
+
export declare function HintTemplate(props: HintTemplateProps): ReactNode;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=hint-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hint-template.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/hint-template/hint-template.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAIhD,UAAU,iBAAiB;IACzB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CAehE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/hint-template/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './template-box';
|
|
2
|
+
export * from './bot-typing-box';
|
|
3
|
+
export * from './button-template';
|
|
4
|
+
export * from './text-template';
|
|
5
|
+
export * from './carousel-template';
|
|
6
|
+
export * from './hint-template';
|
|
7
|
+
export * from './quick-replies';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/templates/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AAEjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAEhC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/quick-replies/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quick-replies.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/quick-replies/quick-replies.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAe,MAAM,OAAO,CAAC;AAI/C,UAAU,iBAAiB;IACzB,YAAY,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAClC;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CA6BhE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/template-box/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
interface TemplateBoxContentProps {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
time?: Date;
|
|
6
|
+
quickReplies?: {
|
|
7
|
+
text: string;
|
|
8
|
+
}[];
|
|
9
|
+
}
|
|
10
|
+
export declare function TemplateBoxContent(props: TemplateBoxContentProps): ReactNode;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=template-box-content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-box-content.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/template-box/template-box-content.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKlC,UAAU,uBAAuB;IAC/B,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,YAAY,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACnC;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,GAAG,SAAS,CAY5E"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
type TemplateBoxProps = {
|
|
4
|
+
type: 'user';
|
|
5
|
+
direction: 'horizontal';
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
} | {
|
|
8
|
+
type: 'bot';
|
|
9
|
+
direction: 'horizontal' | 'vertical';
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
};
|
|
12
|
+
export declare function TemplateBox(props: TemplateBoxProps): ReactNode;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=template-box.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-box.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/template-box/template-box.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AAI3C,KAAK,gBAAgB,GACjB;IACE,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,YAAY,CAAC;IACxB,QAAQ,EAAE,SAAS,CAAC;CACrB,GACD;IACE,IAAI,EAAE,KAAK,CAAC;IACZ,SAAS,EAAE,YAAY,GAAG,UAAU,CAAC;IACrC,QAAQ,EAAE,SAAS,CAAC;CACrB,CAAC;AAEN,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,SAAS,CAoB9D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/text-template/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ConversationMessage } from '../../../hooks';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
interface TextTemplateProps {
|
|
5
|
+
conversationMessage: ConversationMessage;
|
|
6
|
+
}
|
|
7
|
+
export declare function TextTemplate(props: TextTemplateProps): ReactNode;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=text-template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-template.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/text-template/text-template.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAMhD,UAAU,iBAAiB;IACzB,mBAAmB,EAAE,mBAAmB,CAAC;CAC1C;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CA2BhE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/time/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/time/time.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKlC,UAAU,SAAS;IACjB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CAMhD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ConversationMessage, UseChannelReturn, UseChatbotTypingReturn } from '../hooks';
|
|
2
|
+
import { DetailedHTMLProps, HTMLAttributes, ReactNode, RefObject } from 'react';
|
|
3
|
+
import { AsgardServiceClient, ClientConfig } from '@asgard-js/core';
|
|
4
|
+
|
|
5
|
+
interface AsgardServiceContextType extends Pick<UseChatbotTypingReturn, 'isTyping' | 'displayText'>, Pick<UseChannelReturn, 'conversation' | 'sendMessage'> {
|
|
6
|
+
client: AsgardServiceClient | null;
|
|
7
|
+
messageBoxBottomRef: RefObject<HTMLDivElement>;
|
|
8
|
+
isConnectionProcessing: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const AsgardServiceContext: import('react').Context<AsgardServiceContextType>;
|
|
11
|
+
interface AsgardServiceContextProviderProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
config: ClientConfig;
|
|
14
|
+
customChannelId: string;
|
|
15
|
+
customMessageId?: string;
|
|
16
|
+
delayTime?: number;
|
|
17
|
+
initConversation?: ConversationMessage[];
|
|
18
|
+
}
|
|
19
|
+
export declare function AsgardServiceContextProvider(props: AsgardServiceContextProviderProps): ReactNode;
|
|
20
|
+
export declare function useAsgardContext(): AsgardServiceContextType;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=asgard-service-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asgard-service-context.d.ts","sourceRoot":"","sources":["../../src/context/asgard-service-context.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAEL,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,SAAS,EAIV,MAAM,OAAO,CAAC;AACf,OAAO,EACL,mBAAmB,EAGnB,gBAAgB,EAEhB,sBAAsB,EACvB,MAAM,WAAW,CAAC;AAEnB,UAAU,wBACR,SAAQ,IAAI,CAAC,sBAAsB,EAAE,UAAU,GAAG,aAAa,CAAC,EAC9D,IAAI,CAAC,gBAAgB,EAAE,cAAc,GAAG,aAAa,CAAC;IACxD,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACnC,mBAAmB,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IAC/C,sBAAsB,EAAE,OAAO,CAAC;CACjC;AAED,eAAO,MAAM,oBAAoB,mDAQ/B,CAAC;AAEH,UAAU,iCACR,SAAQ,iBAAiB,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;IACzE,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,EAAE,YAAY,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,mBAAmB,EAAE,CAAC;CAC1C;AAED,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,iCAAiC,GACvC,SAAS,CAqDX;AAED,wBAAgB,gBAAgB,IAAI,wBAAwB,CAE3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ClientConfig, AsgardServiceClient } from '@asgard-js/core';
|
|
2
|
+
|
|
3
|
+
interface UseAsgardServiceClientProps {
|
|
4
|
+
config: ClientConfig;
|
|
5
|
+
}
|
|
6
|
+
export declare function useAsgardServiceClient(props: UseAsgardServiceClientProps): AsgardServiceClient | null;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=use-asgard-service-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-asgard-service-client.d.ts","sourceRoot":"","sources":["../../src/hooks/use-asgard-service-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGpE,UAAU,2BAA2B;IACnC,MAAM,EAAE,YAAY,CAAC;CACtB;AAED,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,2BAA2B,GACjC,mBAAmB,GAAG,IAAI,CAmB5B"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { UseChatbotTypingReturn } from './use-chatbot-typing';
|
|
2
|
+
import { AsgardServiceClient, EventType, Message, SSEResponse } from '@asgard-js/core';
|
|
3
|
+
|
|
4
|
+
export type ConversationUserMessage = {
|
|
5
|
+
type: 'user';
|
|
6
|
+
customMessageId?: string;
|
|
7
|
+
text: string;
|
|
8
|
+
time: Date;
|
|
9
|
+
};
|
|
10
|
+
export type ConversationBotMessage = {
|
|
11
|
+
type: 'bot';
|
|
12
|
+
eventType: EventType;
|
|
13
|
+
message: Message;
|
|
14
|
+
time: Date;
|
|
15
|
+
};
|
|
16
|
+
export type ConversationMessage = ConversationUserMessage | ConversationBotMessage;
|
|
17
|
+
interface UseChannelProps extends Pick<UseChatbotTypingReturn, 'startTyping' | 'onTyping' | 'stopTyping'> {
|
|
18
|
+
client: AsgardServiceClient | null;
|
|
19
|
+
customChannelId: string;
|
|
20
|
+
initConversation?: ConversationMessage[];
|
|
21
|
+
onResetChannelInit?: (event: SSEResponse<EventType.INIT>) => void;
|
|
22
|
+
}
|
|
23
|
+
export interface UseChannelReturn {
|
|
24
|
+
conversation: ConversationMessage[];
|
|
25
|
+
isConnectionProcessing: boolean;
|
|
26
|
+
sendMessage: (text: string, customMessageId?: string) => void;
|
|
27
|
+
}
|
|
28
|
+
export declare function useChannel(props: UseChannelProps): UseChannelReturn;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=use-channel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-channel.d.ts","sourceRoot":"","sources":["../../src/hooks/use-channel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,SAAS,EAET,OAAO,EACP,WAAW,EACZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,KAAK,CAAC;IACZ,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,IAAI,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAC3B,uBAAuB,GACvB,sBAAsB,CAAC;AAE3B,UAAU,eACR,SAAQ,IAAI,CACV,sBAAsB,EACtB,aAAa,GAAG,UAAU,GAAG,YAAY,CAC1C;IACD,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACnC,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACzC,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;CACnE;AAED,MAAM,WAAW,gBAAgB;IAC/B,YAAY,EAAE,mBAAmB,EAAE,CAAC;IACpC,sBAAsB,EAAE,OAAO,CAAC;IAChC,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/D;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,gBAAgB,CA+GnE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Message } from '@asgard-js/core';
|
|
2
|
+
|
|
3
|
+
export interface UseChatbotTypingReturn {
|
|
4
|
+
isTyping: boolean;
|
|
5
|
+
displayText: string | null;
|
|
6
|
+
startTyping: (message: Message) => void;
|
|
7
|
+
onTyping: (message: Message) => void;
|
|
8
|
+
stopTyping: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function useChatbotTyping(): UseChatbotTypingReturn;
|
|
11
|
+
//# sourceMappingURL=use-chatbot-typing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-chatbot-typing.d.ts","sourceRoot":"","sources":["../../src/hooks/use-chatbot-typing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAI1C,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,wBAAgB,gBAAgB,IAAI,sBAAsB,CAwBzD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-debounce.d.ts","sourceRoot":"","sources":["../../src/hooks/use-debounce.ts"],"names":[],"mappings":"AAEA,wBAAgB,WAAW,CAAC,SAAS,EACnC,KAAK,EAAE,SAAS,EAChB,KAAK,CAAC,EAAE,MAAM,GACb,SAAS,CAYX"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
import { jsx as o, jsxs as i } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as q, useEffect as m, useState as C, useCallback as h, createContext as Q, useMemo as A, useContext as W } from "react";
|
|
3
|
+
import { AsgardServiceClient as X, FetchSSEAction as z, EventType as S, MessageTemplateType as w } from "@asgard-js/core";
|
|
4
|
+
function J(n) {
|
|
5
|
+
const { config: t } = n, e = q(null);
|
|
6
|
+
return e.current || (e.current = new X(t)), m(() => () => {
|
|
7
|
+
e.current && (e.current.close(), e.current = null);
|
|
8
|
+
}, [t]), e.current;
|
|
9
|
+
}
|
|
10
|
+
function Y(n) {
|
|
11
|
+
const {
|
|
12
|
+
client: t,
|
|
13
|
+
customChannelId: e,
|
|
14
|
+
initConversation: s,
|
|
15
|
+
onResetChannelInit: c,
|
|
16
|
+
startTyping: l,
|
|
17
|
+
onTyping: r,
|
|
18
|
+
stopTyping: a
|
|
19
|
+
} = n;
|
|
20
|
+
if (!t)
|
|
21
|
+
throw new Error("Client instance is required");
|
|
22
|
+
if (!e)
|
|
23
|
+
throw new Error("Custom channel id is required");
|
|
24
|
+
const [_, u] = C(!1), [p, v] = C(
|
|
25
|
+
s ?? []
|
|
26
|
+
);
|
|
27
|
+
m(() => {
|
|
28
|
+
console.log("conversation", p);
|
|
29
|
+
}, [p]), m(() => {
|
|
30
|
+
t.setChannel(
|
|
31
|
+
{
|
|
32
|
+
customChannelId: e,
|
|
33
|
+
customMessageId: "",
|
|
34
|
+
text: ""
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
onStart: () => u(!0),
|
|
38
|
+
onCompleted: () => u(!1)
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
}, [t, e]);
|
|
42
|
+
const B = h(
|
|
43
|
+
(d, g) => {
|
|
44
|
+
v(
|
|
45
|
+
(b) => b.concat({
|
|
46
|
+
type: "user",
|
|
47
|
+
customMessageId: g,
|
|
48
|
+
text: d,
|
|
49
|
+
time: /* @__PURE__ */ new Date()
|
|
50
|
+
})
|
|
51
|
+
), t.sendMessage(
|
|
52
|
+
{
|
|
53
|
+
customChannelId: e,
|
|
54
|
+
customMessageId: g,
|
|
55
|
+
text: d
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
onStart: () => u(!0),
|
|
59
|
+
onCompleted: () => u(!1)
|
|
60
|
+
}
|
|
61
|
+
);
|
|
62
|
+
},
|
|
63
|
+
[t, e]
|
|
64
|
+
);
|
|
65
|
+
return m(() => {
|
|
66
|
+
c && t.on(z.RESET_CHANNEL, S.INIT, c);
|
|
67
|
+
}, [t, c]), m(() => {
|
|
68
|
+
t.on(z.NONE, S.MESSAGE_START, (d) => {
|
|
69
|
+
l(d.fact.messageStart.message);
|
|
70
|
+
});
|
|
71
|
+
}, [t, l]), m(() => {
|
|
72
|
+
t.on(z.NONE, S.MESSAGE_DELTA, (d) => {
|
|
73
|
+
r(d.fact.messageDelta.message);
|
|
74
|
+
});
|
|
75
|
+
}, [t, r]), m(() => {
|
|
76
|
+
t.on(z.NONE, S.MESSAGE_COMPLETE, (d) => {
|
|
77
|
+
const { eventType: g, fact: b } = d, T = b.messageComplete.message;
|
|
78
|
+
T.isDebug || v(
|
|
79
|
+
(E) => E.concat({
|
|
80
|
+
type: "bot",
|
|
81
|
+
eventType: g,
|
|
82
|
+
message: T,
|
|
83
|
+
time: /* @__PURE__ */ new Date()
|
|
84
|
+
})
|
|
85
|
+
), a();
|
|
86
|
+
});
|
|
87
|
+
}, [t, a]), {
|
|
88
|
+
conversation: p,
|
|
89
|
+
sendMessage: B,
|
|
90
|
+
isConnectionProcessing: _
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function tt(n, t) {
|
|
94
|
+
const [e, s] = C(n);
|
|
95
|
+
return m(() => {
|
|
96
|
+
const c = window.setTimeout(() => {
|
|
97
|
+
s(n);
|
|
98
|
+
}, t ?? 300);
|
|
99
|
+
return () => clearTimeout(c);
|
|
100
|
+
}, [n, t]), e;
|
|
101
|
+
}
|
|
102
|
+
function et() {
|
|
103
|
+
const [n, t] = C(!1), [e, s] = C(null), c = h(() => t(!0), [t]), l = h((_) => {
|
|
104
|
+
s((u) => (u ?? "") + _.text);
|
|
105
|
+
}, []), r = h(() => {
|
|
106
|
+
t(!1), s(null);
|
|
107
|
+
}, [t]);
|
|
108
|
+
return {
|
|
109
|
+
isTyping: tt(n, 500),
|
|
110
|
+
displayText: e,
|
|
111
|
+
startTyping: c,
|
|
112
|
+
onTyping: l,
|
|
113
|
+
stopTyping: r
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
const U = Q({
|
|
117
|
+
client: null,
|
|
118
|
+
isTyping: !1,
|
|
119
|
+
displayText: null,
|
|
120
|
+
messageBoxBottomRef: { current: null },
|
|
121
|
+
isConnectionProcessing: !1,
|
|
122
|
+
conversation: [],
|
|
123
|
+
sendMessage: () => {
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
function nt(n) {
|
|
127
|
+
const {
|
|
128
|
+
children: t,
|
|
129
|
+
config: e,
|
|
130
|
+
customChannelId: s,
|
|
131
|
+
customMessageId: c,
|
|
132
|
+
delayTime: l,
|
|
133
|
+
initConversation: r,
|
|
134
|
+
...a
|
|
135
|
+
} = n, _ = q(null), u = J({ config: e }), { isTyping: p, displayText: v, startTyping: B, onTyping: d, stopTyping: g } = et(), { sendMessage: b, conversation: T, isConnectionProcessing: E } = Y({
|
|
136
|
+
client: u,
|
|
137
|
+
customChannelId: s,
|
|
138
|
+
startTyping: B,
|
|
139
|
+
onTyping: d,
|
|
140
|
+
stopTyping: g,
|
|
141
|
+
initConversation: r
|
|
142
|
+
}), K = A(
|
|
143
|
+
() => ({
|
|
144
|
+
client: u,
|
|
145
|
+
isTyping: p,
|
|
146
|
+
displayText: v,
|
|
147
|
+
messageBoxBottomRef: _,
|
|
148
|
+
isConnectionProcessing: E,
|
|
149
|
+
conversation: T,
|
|
150
|
+
sendMessage: b
|
|
151
|
+
}),
|
|
152
|
+
[
|
|
153
|
+
u,
|
|
154
|
+
T,
|
|
155
|
+
v,
|
|
156
|
+
_,
|
|
157
|
+
E,
|
|
158
|
+
p,
|
|
159
|
+
b
|
|
160
|
+
]
|
|
161
|
+
);
|
|
162
|
+
return /* @__PURE__ */ o(U.Provider, { value: K, children: /* @__PURE__ */ o("div", { ...a, children: t }) });
|
|
163
|
+
}
|
|
164
|
+
function k() {
|
|
165
|
+
return W(U);
|
|
166
|
+
}
|
|
167
|
+
const ot = "_chatbot_header_uinpm_1", st = {
|
|
168
|
+
chatbot_header: ot
|
|
169
|
+
};
|
|
170
|
+
function ct() {
|
|
171
|
+
return /* @__PURE__ */ o("div", { className: st.chatbot_header, children: "Header" });
|
|
172
|
+
}
|
|
173
|
+
const rt = "_chatbot_body_okhax_1", it = {
|
|
174
|
+
chatbot_body: rt
|
|
175
|
+
}, at = "_template_box_1ozig_1", f = {
|
|
176
|
+
template_box: at,
|
|
177
|
+
"template_box--bot": "_template_box--bot_1ozig_7",
|
|
178
|
+
"template_box--horizontal": "_template_box--horizontal_1ozig_7",
|
|
179
|
+
"template_box--vertical": "_template_box--vertical_1ozig_10",
|
|
180
|
+
"template_box--user": "_template_box--user_1ozig_14"
|
|
181
|
+
};
|
|
182
|
+
function L(n) {
|
|
183
|
+
var t, e, s = "";
|
|
184
|
+
if (typeof n == "string" || typeof n == "number") s += n;
|
|
185
|
+
else if (typeof n == "object") if (Array.isArray(n)) {
|
|
186
|
+
var c = n.length;
|
|
187
|
+
for (t = 0; t < c; t++) n[t] && (e = L(n[t])) && (s && (s += " "), s += e);
|
|
188
|
+
} else for (e in n) n[e] && (s && (s += " "), s += e);
|
|
189
|
+
return s;
|
|
190
|
+
}
|
|
191
|
+
function x() {
|
|
192
|
+
for (var n, t, e = 0, s = "", c = arguments.length; e < c; e++) (n = arguments[e]) && (t = L(n)) && (s && (s += " "), s += t);
|
|
193
|
+
return s;
|
|
194
|
+
}
|
|
195
|
+
function M(n) {
|
|
196
|
+
const { type: t, direction: e = "horizontal", children: s } = n, c = A(() => {
|
|
197
|
+
switch (t) {
|
|
198
|
+
case "user":
|
|
199
|
+
return x(f.template_box, f["template_box--user"]);
|
|
200
|
+
case "bot":
|
|
201
|
+
default:
|
|
202
|
+
return x(
|
|
203
|
+
f.template_box,
|
|
204
|
+
f["template_box--bot"],
|
|
205
|
+
e === "horizontal" ? f["template_box--horizontal"] : f["template_box--vertical"]
|
|
206
|
+
);
|
|
207
|
+
}
|
|
208
|
+
}, [e, t]);
|
|
209
|
+
return /* @__PURE__ */ o("div", { className: c, children: s });
|
|
210
|
+
}
|
|
211
|
+
const lt = "_template_box_content_12ojl_1", _t = "_content_12ojl_7", D = {
|
|
212
|
+
template_box_content: lt,
|
|
213
|
+
content: _t
|
|
214
|
+
}, ut = "_quick_replies_box_19pe0_1", dt = "_quick_reply_19pe0_7", V = {
|
|
215
|
+
quick_replies_box: ut,
|
|
216
|
+
quick_reply: dt
|
|
217
|
+
};
|
|
218
|
+
function mt(n) {
|
|
219
|
+
const { quickReplies: t } = n, { sendMessage: e } = k(), s = h(
|
|
220
|
+
(c) => {
|
|
221
|
+
e(c);
|
|
222
|
+
},
|
|
223
|
+
[e]
|
|
224
|
+
);
|
|
225
|
+
return t != null && t.length ? /* @__PURE__ */ o("div", { className: V.quick_replies_box, children: t.map((c) => /* @__PURE__ */ o(
|
|
226
|
+
"div",
|
|
227
|
+
{
|
|
228
|
+
className: V.quick_reply,
|
|
229
|
+
onClick: () => s(c.text),
|
|
230
|
+
children: c.text
|
|
231
|
+
},
|
|
232
|
+
c.text
|
|
233
|
+
)) }) : null;
|
|
234
|
+
}
|
|
235
|
+
function F(n) {
|
|
236
|
+
return n.toLocaleTimeString("zh-TW", {
|
|
237
|
+
timeZone: "Asia/Taipei",
|
|
238
|
+
hour: "2-digit",
|
|
239
|
+
minute: "2-digit",
|
|
240
|
+
hour12: !1
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
const ht = "_time_rgg92_1", pt = {
|
|
244
|
+
time: ht
|
|
245
|
+
};
|
|
246
|
+
function $(n) {
|
|
247
|
+
const { time: t, className: e } = n;
|
|
248
|
+
return t ? /* @__PURE__ */ o("div", { className: x(pt.time, e), children: F(t) }) : null;
|
|
249
|
+
}
|
|
250
|
+
function H(n) {
|
|
251
|
+
const { quickReplies: t, time: e, children: s } = n;
|
|
252
|
+
return /* @__PURE__ */ i("div", { className: D.template_box_content, children: [
|
|
253
|
+
/* @__PURE__ */ i("div", { className: D.content, children: [
|
|
254
|
+
s,
|
|
255
|
+
/* @__PURE__ */ o($, { time: e })
|
|
256
|
+
] }),
|
|
257
|
+
!!(t != null && t.length) && /* @__PURE__ */ o(mt, { quickReplies: t })
|
|
258
|
+
] });
|
|
259
|
+
}
|
|
260
|
+
const gt = "_bot_avatar_14r1r_1", bt = {
|
|
261
|
+
bot_avatar: gt
|
|
262
|
+
};
|
|
263
|
+
function I() {
|
|
264
|
+
return /* @__PURE__ */ o("div", { className: bt.bot_avatar, children: /* @__PURE__ */ i(
|
|
265
|
+
"svg",
|
|
266
|
+
{
|
|
267
|
+
width: "25",
|
|
268
|
+
height: "24",
|
|
269
|
+
viewBox: "0 0 25 24",
|
|
270
|
+
fill: "none",
|
|
271
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
272
|
+
children: [
|
|
273
|
+
/* @__PURE__ */ o(
|
|
274
|
+
"path",
|
|
275
|
+
{
|
|
276
|
+
d: "M0.40625 12C0.40625 5.37258 5.77883 0 12.4062 0C19.0337 0 24.4062 5.37258 24.4062 12C24.4062 18.6274 19.0337 24 12.4062 24C5.77883 24 0.40625 18.6274 0.40625 12Z",
|
|
277
|
+
fill: "#585858"
|
|
278
|
+
}
|
|
279
|
+
),
|
|
280
|
+
/* @__PURE__ */ o(
|
|
281
|
+
"path",
|
|
282
|
+
{
|
|
283
|
+
d: "M6.40625 18.75V15C6.40625 14.5875 6.55313 14.2344 6.84688 13.9406C7.14063 13.6469 7.49375 13.5 7.90625 13.5H16.9062C17.3188 13.5 17.6719 13.6469 17.9656 13.9406C18.2594 14.2344 18.4062 14.5875 18.4062 15V18.75H6.40625ZM10.1562 12.75C9.11875 12.75 8.23438 12.3844 7.50312 11.6531C6.77187 10.9219 6.40625 10.0375 6.40625 9C6.40625 7.9625 6.77187 7.07812 7.50312 6.34687C8.23438 5.61562 9.11875 5.25 10.1562 5.25H14.6562C15.6938 5.25 16.5781 5.61562 17.3094 6.34687C18.0406 7.07812 18.4062 7.9625 18.4062 9C18.4062 10.0375 18.0406 10.9219 17.3094 11.6531C16.5781 12.3844 15.6938 12.75 14.6562 12.75H10.1562ZM7.90625 17.25H16.9062V15H7.90625V17.25ZM10.1562 11.25H14.6562C15.2812 11.25 15.8125 11.0312 16.25 10.5938C16.6875 10.1562 16.9062 9.625 16.9062 9C16.9062 8.375 16.6875 7.84375 16.25 7.40625C15.8125 6.96875 15.2812 6.75 14.6562 6.75H10.1562C9.53125 6.75 9 6.96875 8.5625 7.40625C8.125 7.84375 7.90625 8.375 7.90625 9C7.90625 9.625 8.125 10.1562 8.5625 10.5938C9 11.0312 9.53125 11.25 10.1562 11.25ZM10.1562 9.75C10.3688 9.75 10.5469 9.67812 10.6906 9.53438C10.8344 9.39062 10.9062 9.2125 10.9062 9C10.9062 8.7875 10.8344 8.60938 10.6906 8.46562C10.5469 8.32187 10.3688 8.25 10.1562 8.25C9.94375 8.25 9.76562 8.32187 9.62187 8.46562C9.47812 8.60938 9.40625 8.7875 9.40625 9C9.40625 9.2125 9.47812 9.39062 9.62187 9.53438C9.76562 9.67812 9.94375 9.75 10.1562 9.75ZM14.6562 9.75C14.8687 9.75 15.0469 9.67812 15.1906 9.53438C15.3344 9.39062 15.4062 9.2125 15.4062 9C15.4062 8.7875 15.3344 8.60938 15.1906 8.46562C15.0469 8.32187 14.8687 8.25 14.6562 8.25C14.4438 8.25 14.2656 8.32187 14.1219 8.46562C13.9781 8.60938 13.9062 8.7875 13.9062 9C13.9062 9.2125 13.9781 9.39062 14.1219 9.53438C14.2656 9.67812 14.4438 9.75 14.6562 9.75Z",
|
|
284
|
+
fill: "white"
|
|
285
|
+
}
|
|
286
|
+
)
|
|
287
|
+
]
|
|
288
|
+
}
|
|
289
|
+
) });
|
|
290
|
+
}
|
|
291
|
+
const ft = "_text_1b4yq_1", yt = "_dot_1b4yq_18", Ct = "_blink_1b4yq_1", y = {
|
|
292
|
+
text: ft,
|
|
293
|
+
"text--bot": "_text--bot_1b4yq_7",
|
|
294
|
+
"typing-indicator": "_typing-indicator_1b4yq_13",
|
|
295
|
+
dot: yt,
|
|
296
|
+
blink: Ct
|
|
297
|
+
};
|
|
298
|
+
function xt(n) {
|
|
299
|
+
const { children: t, onResize: e } = n, s = q(null);
|
|
300
|
+
return m(() => {
|
|
301
|
+
const c = new ResizeObserver((l) => {
|
|
302
|
+
for (const r of l) {
|
|
303
|
+
const { width: a, height: _ } = r.contentRect;
|
|
304
|
+
e(a, _);
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
return s.current && c.observe(s.current), () => {
|
|
308
|
+
c.disconnect();
|
|
309
|
+
};
|
|
310
|
+
}, [s, e]), /* @__PURE__ */ o("div", { ref: s, children: t });
|
|
311
|
+
}
|
|
312
|
+
function vt() {
|
|
313
|
+
const { isTyping: n, displayText: t, messageBoxBottomRef: e } = k(), s = h(() => {
|
|
314
|
+
var c;
|
|
315
|
+
(c = e.current) == null || c.scrollIntoView({ behavior: "smooth" });
|
|
316
|
+
}, [e]);
|
|
317
|
+
return n ? /* @__PURE__ */ i(M, { type: "bot", direction: "horizontal", children: [
|
|
318
|
+
/* @__PURE__ */ o(I, {}),
|
|
319
|
+
/* @__PURE__ */ o(H, { time: /* @__PURE__ */ new Date(), children: /* @__PURE__ */ o("div", { className: x(y.text, y["text--bot"]), children: /* @__PURE__ */ i(xt, { onResize: s, children: [
|
|
320
|
+
/* @__PURE__ */ o("span", { children: t ?? "" }),
|
|
321
|
+
n && /* @__PURE__ */ i("span", { className: y["typing-indicator"], children: [
|
|
322
|
+
/* @__PURE__ */ o("div", { className: y.dot }),
|
|
323
|
+
/* @__PURE__ */ o("div", { className: y.dot }),
|
|
324
|
+
/* @__PURE__ */ o("div", { className: y.dot })
|
|
325
|
+
] })
|
|
326
|
+
] }) }) })
|
|
327
|
+
] }) : null;
|
|
328
|
+
}
|
|
329
|
+
const Tt = "_card_root_1ygom_1", Nt = "_card_content_1ygom_10", wt = "_card_title_1ygom_17", Mt = "_card_description_1ygom_23", kt = "_card_actions_1ygom_37", N = {
|
|
330
|
+
card_root: Tt,
|
|
331
|
+
card_content: Nt,
|
|
332
|
+
card_title: wt,
|
|
333
|
+
card_description: Mt,
|
|
334
|
+
card_actions: kt
|
|
335
|
+
};
|
|
336
|
+
function G(n) {
|
|
337
|
+
var r;
|
|
338
|
+
const { template: t } = n, { sendMessage: e } = k(), s = A(() => (t == null ? void 0 : t.thumbnailImageUrl.replace(/^http:/, "").replace(/^https:/, "")) || "https://via.assets.so/img.jpg?w=200&h=270&tc=white&bg=#eeeeee", [t]), c = A(() => {
|
|
339
|
+
switch (t == null ? void 0 : t.imageAspectRatio) {
|
|
340
|
+
case "square":
|
|
341
|
+
return "1 / 1";
|
|
342
|
+
case "rectangle":
|
|
343
|
+
default:
|
|
344
|
+
return "1.51 / 1";
|
|
345
|
+
}
|
|
346
|
+
}, [t]), l = h(
|
|
347
|
+
(a) => function() {
|
|
348
|
+
switch (a.type) {
|
|
349
|
+
case "message":
|
|
350
|
+
e(a.text);
|
|
351
|
+
return;
|
|
352
|
+
case "uri":
|
|
353
|
+
window.open(a.uri, "_blank");
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
},
|
|
357
|
+
[e]
|
|
358
|
+
);
|
|
359
|
+
return /* @__PURE__ */ i("div", { className: N.card_root, children: [
|
|
360
|
+
(t == null ? void 0 : t.thumbnailImageUrl) && /* @__PURE__ */ o(
|
|
361
|
+
"img",
|
|
362
|
+
{
|
|
363
|
+
alt: t == null ? void 0 : t.title,
|
|
364
|
+
src: s,
|
|
365
|
+
style: {
|
|
366
|
+
display: "block",
|
|
367
|
+
width: "100%",
|
|
368
|
+
objectFit: t == null ? void 0 : t.imageSize,
|
|
369
|
+
aspectRatio: c
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
),
|
|
373
|
+
/* @__PURE__ */ i("div", { className: N.card_content, children: [
|
|
374
|
+
/* @__PURE__ */ o("h5", { className: N.card_title, children: t == null ? void 0 : t.title }),
|
|
375
|
+
/* @__PURE__ */ o("div", { className: N.card_description, children: t == null ? void 0 : t.text }),
|
|
376
|
+
/* @__PURE__ */ o("div", { className: N.card_actions, children: (r = t == null ? void 0 : t.buttons) == null ? void 0 : r.map((a, _) => /* @__PURE__ */ o("button", { onClick: l(a.action), children: a.label }, _)) })
|
|
377
|
+
] })
|
|
378
|
+
] });
|
|
379
|
+
}
|
|
380
|
+
function Et(n) {
|
|
381
|
+
const { conversationMessage: t } = n, e = t.message.template;
|
|
382
|
+
return /* @__PURE__ */ i(M, { type: "bot", direction: "horizontal", children: [
|
|
383
|
+
/* @__PURE__ */ o(I, {}),
|
|
384
|
+
/* @__PURE__ */ o(
|
|
385
|
+
H,
|
|
386
|
+
{
|
|
387
|
+
time: t.time,
|
|
388
|
+
quickReplies: e == null ? void 0 : e.quickReplies,
|
|
389
|
+
children: /* @__PURE__ */ o(G, { template: e })
|
|
390
|
+
}
|
|
391
|
+
)
|
|
392
|
+
] });
|
|
393
|
+
}
|
|
394
|
+
const zt = "_text_1p20y_1", St = "_content_1p20y_19", R = {
|
|
395
|
+
text: zt,
|
|
396
|
+
"text--user": "_text--user_1p20y_7",
|
|
397
|
+
"text--bot": "_text--bot_1p20y_13",
|
|
398
|
+
content: St
|
|
399
|
+
};
|
|
400
|
+
function O(n) {
|
|
401
|
+
var e;
|
|
402
|
+
const { conversationMessage: t } = n;
|
|
403
|
+
return t.type === "user" ? /* @__PURE__ */ i(M, { type: "user", direction: "horizontal", children: [
|
|
404
|
+
/* @__PURE__ */ o("div", { className: x(R.text, R["text--user"]), children: t.text }),
|
|
405
|
+
/* @__PURE__ */ o($, { time: t.time })
|
|
406
|
+
] }) : /* @__PURE__ */ i(M, { type: "bot", direction: "horizontal", children: [
|
|
407
|
+
/* @__PURE__ */ o(I, {}),
|
|
408
|
+
/* @__PURE__ */ o(
|
|
409
|
+
H,
|
|
410
|
+
{
|
|
411
|
+
time: t.time,
|
|
412
|
+
quickReplies: (e = t.message.template) == null ? void 0 : e.quickReplies,
|
|
413
|
+
children: /* @__PURE__ */ o("div", { className: x(R.text, R["text--bot"]), children: t.message.text })
|
|
414
|
+
}
|
|
415
|
+
)
|
|
416
|
+
] });
|
|
417
|
+
}
|
|
418
|
+
const Rt = "_carousel_root_sv1hc_1", At = "_carousel_time_sv1hc_12", P = {
|
|
419
|
+
carousel_root: Rt,
|
|
420
|
+
carousel_time: At
|
|
421
|
+
};
|
|
422
|
+
function It(n) {
|
|
423
|
+
var s;
|
|
424
|
+
const { conversationMessage: t } = n, e = t.message.template;
|
|
425
|
+
return /* @__PURE__ */ i(M, { type: "bot", direction: "vertical", children: [
|
|
426
|
+
/* @__PURE__ */ o(I, {}),
|
|
427
|
+
/* @__PURE__ */ o("div", { className: P.carousel_root, children: (s = e.columns) == null ? void 0 : s.map((c, l) => /* @__PURE__ */ o(G, { template: c }, l)) }),
|
|
428
|
+
/* @__PURE__ */ o($, { className: P.carousel_time, time: t.time })
|
|
429
|
+
] });
|
|
430
|
+
}
|
|
431
|
+
const Bt = "_hint_root_4opfe_1", qt = "_time_4opfe_15", Z = {
|
|
432
|
+
hint_root: Bt,
|
|
433
|
+
time: qt
|
|
434
|
+
};
|
|
435
|
+
function $t(n) {
|
|
436
|
+
const { conversationMessage: t } = n;
|
|
437
|
+
if (t.type === "user") return null;
|
|
438
|
+
const e = t.message.template;
|
|
439
|
+
return e.type !== w.HINT ? null : /* @__PURE__ */ i("div", { className: Z.hint_root, children: [
|
|
440
|
+
/* @__PURE__ */ o("div", { className: Z.time, children: F(t.time) }),
|
|
441
|
+
e.text
|
|
442
|
+
] });
|
|
443
|
+
}
|
|
444
|
+
function Ht(n) {
|
|
445
|
+
const { conversationMessage: t } = n;
|
|
446
|
+
if (t.type === "user")
|
|
447
|
+
return /* @__PURE__ */ o(O, { conversationMessage: t });
|
|
448
|
+
const e = t.message.template;
|
|
449
|
+
switch (e == null ? void 0 : e.type) {
|
|
450
|
+
case w.TEXT:
|
|
451
|
+
return /* @__PURE__ */ o(O, { conversationMessage: t });
|
|
452
|
+
case w.HINT:
|
|
453
|
+
return /* @__PURE__ */ o($t, { conversationMessage: t });
|
|
454
|
+
case w.BUTTON:
|
|
455
|
+
return /* @__PURE__ */ o(Et, { conversationMessage: t });
|
|
456
|
+
case w.CAROUSEL:
|
|
457
|
+
return /* @__PURE__ */ o(It, { conversationMessage: t });
|
|
458
|
+
default:
|
|
459
|
+
return /* @__PURE__ */ o("div", { children: "Unknown template" });
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
function Dt() {
|
|
463
|
+
const { conversation: n, messageBoxBottomRef: t } = k();
|
|
464
|
+
return m(() => {
|
|
465
|
+
var e;
|
|
466
|
+
(e = t.current) == null || e.scrollIntoView({ behavior: "smooth" });
|
|
467
|
+
}, [n, t]), /* @__PURE__ */ i("div", { className: it.chatbot_body, children: [
|
|
468
|
+
n.map((e) => /* @__PURE__ */ o(
|
|
469
|
+
Ht,
|
|
470
|
+
{
|
|
471
|
+
conversationMessage: e
|
|
472
|
+
},
|
|
473
|
+
crypto.randomUUID()
|
|
474
|
+
)),
|
|
475
|
+
/* @__PURE__ */ o(vt, {}),
|
|
476
|
+
/* @__PURE__ */ o("div", { ref: t })
|
|
477
|
+
] });
|
|
478
|
+
}
|
|
479
|
+
const Vt = "_chatbot_footer_1i661_1", Ot = "_chatbot_input_1i661_5", j = {
|
|
480
|
+
chatbot_footer: Vt,
|
|
481
|
+
chatbot_input: Ot
|
|
482
|
+
};
|
|
483
|
+
function Pt() {
|
|
484
|
+
const { sendMessage: n, isConnectionProcessing: t } = k(), [e, s] = C(""), c = h(
|
|
485
|
+
(r) => {
|
|
486
|
+
s(r.target.value);
|
|
487
|
+
},
|
|
488
|
+
[]
|
|
489
|
+
), l = h(
|
|
490
|
+
(r) => {
|
|
491
|
+
r.key === "Enter" && (n(e), s(""));
|
|
492
|
+
},
|
|
493
|
+
[n, e]
|
|
494
|
+
);
|
|
495
|
+
return /* @__PURE__ */ o("div", { className: j.chatbot_footer, children: /* @__PURE__ */ o(
|
|
496
|
+
"input",
|
|
497
|
+
{
|
|
498
|
+
className: j.chatbot_input,
|
|
499
|
+
disabled: t,
|
|
500
|
+
value: e,
|
|
501
|
+
placeholder: "Enter message",
|
|
502
|
+
onChange: c,
|
|
503
|
+
onKeyDown: l
|
|
504
|
+
}
|
|
505
|
+
) });
|
|
506
|
+
}
|
|
507
|
+
const Zt = "_chatbot_root_1tkt9_1", jt = {
|
|
508
|
+
chatbot_root: Zt
|
|
509
|
+
};
|
|
510
|
+
function Gt(n) {
|
|
511
|
+
const { config: t, customChannelId: e, initConversation: s } = n;
|
|
512
|
+
return /* @__PURE__ */ i(
|
|
513
|
+
nt,
|
|
514
|
+
{
|
|
515
|
+
className: jt.chatbot_root,
|
|
516
|
+
config: t,
|
|
517
|
+
customChannelId: e,
|
|
518
|
+
initConversation: s,
|
|
519
|
+
children: [
|
|
520
|
+
/* @__PURE__ */ o(ct, {}),
|
|
521
|
+
/* @__PURE__ */ o(Dt, {}),
|
|
522
|
+
/* @__PURE__ */ o(Pt, {})
|
|
523
|
+
]
|
|
524
|
+
}
|
|
525
|
+
);
|
|
526
|
+
}
|
|
527
|
+
export {
|
|
528
|
+
Gt as Chatbot,
|
|
529
|
+
J as useAsgardServiceClient,
|
|
530
|
+
Y as useChannel,
|
|
531
|
+
et as useChatbotTyping,
|
|
532
|
+
tt as useDebounce
|
|
533
|
+
};
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._chatbot_header_uinpm_1{padding:16px}._chatbot_body_okhax_1{display:flex;flex-direction:column;padding:16px;gap:16px;border-top:1px solid #434343;border-bottom:1px solid #434343;overflow-x:hidden;overflow-y:scroll}._template_box_1ozig_1{width:100%;display:flex;gap:8px}._template_box--bot_1ozig_7._template_box--horizontal_1ozig_7{flex-direction:row}._template_box--bot_1ozig_7._template_box--vertical_1ozig_10{flex-direction:column}._template_box--user_1ozig_14{flex-direction:row-reverse}._template_box_content_12ojl_1{display:flex;flex-direction:column;gap:8px}._content_12ojl_7{display:flex;flex-direction:row;gap:8px}._quick_replies_box_19pe0_1{display:flex;flex-wrap:wrap;gap:8px}._quick_reply_19pe0_7{font-size:13px;padding:4px 8px;border-radius:8px;border:1px solid #434343;background:#58585833;color:#fff;cursor:pointer}._time_rgg92_1{display:flex;align-items:flex-end;font-size:12px;color:#8c8c8c}._bot_avatar_14r1r_1{flex:0 0 auto;width:24px;height:24px}._text_1b4yq_1{padding:8px 12px;border-radius:8px;color:#fff}._text--bot_1b4yq_7{max-width:223px;background:#585858;border-top-left-radius:0}._typing-indicator_1b4yq_13{display:inline-flex;align-items:flex-end;justify-content:center}._typing-indicator_1b4yq_13 ._dot_1b4yq_18{width:2px;height:2px;margin:0 2px;background-color:#fff;border-radius:50%;animation:_blink_1b4yq_1 1.4s infinite ease-in-out both}._typing-indicator_1b4yq_13 ._dot_1b4yq_18:nth-child(1){animation-delay:0s}._typing-indicator_1b4yq_13 ._dot_1b4yq_18:nth-child(2){animation-delay:.2s}._typing-indicator_1b4yq_13 ._dot_1b4yq_18:nth-child(3){animation-delay:.4s}@keyframes _blink_1b4yq_1{0%,80%,to{opacity:.2;transform:translateY(0)}40%{opacity:1;transform:translateY(-5px)}}._card_root_1ygom_1{width:255px;height:368px;max-height:380px;border-radius:8px;background:#333;overflow:hidden}._card_content_1ygom_10{display:flex;flex-direction:column;gap:8px;padding:12px}._card_title_1ygom_17{color:#fff;margin:0;font-size:15px}._card_description_1ygom_23{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;color:#8c8c8c;font-size:13px;font-weight:400;line-height:20px;text-underline-position:from-font;text-decoration-skip-ink:none;text-overflow:ellipsis}._card_actions_1ygom_37{display:flex;flex-direction:column;gap:8px}._card_actions_1ygom_37>button{width:100%;height:32px;line-height:32px;text-align:center;border:none;border-radius:4px;background:#4767eb;color:#fff;font-size:15px;cursor:pointer}._text_1p20y_1{padding:8px 12px;border-radius:8px;color:#fff}._text--user_1p20y_7{max-width:255px;background:#4767eb;border-top-right-radius:0}._text--bot_1p20y_13{max-width:223px;background:#585858;border-top-left-radius:0}._content_1p20y_19{display:flex;flex-direction:column;gap:8px}._carousel_root_sv1hc_1{width:100%;display:flex;flex-wrap:nowrap;overflow-x:scroll;gap:8px}._carousel_root_sv1hc_1>div{flex:0 0 auto}._carousel_time_sv1hc_12{justify-content:flex-end}._hint_root_4opfe_1{margin:0 auto;display:flex;flex-direction:column;align-items:center;max-width:304px;padding:4px 12px;gap:4px;border-radius:2px;background:#58585833;font-size:13px;color:#fff}._time_4opfe_15{font-size:12px;color:#8c8c8c}._chatbot_footer_1i661_1{padding:16px}._chatbot_input_1i661_5{height:20px;max-height:240px;padding:8px 8px 8px 12px;background:#1f1f1f;border:1px solid rgb(67,67,67);border-radius:2px;color:#8c8c8c}._chatbot_root_1tkt9_1{width:375px;height:640px;background-color:#141414;border-radius:8px;font-size:15px;display:grid;grid-template-rows:max-content auto max-content}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-time.d.ts","sourceRoot":"","sources":["../../src/utils/format-time.ts"],"names":[],"mappings":"AAAA,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAO7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@asgard-js/react",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"nx": {
|
|
8
|
+
"name": "@asgard-js/react",
|
|
9
|
+
"projectType": "library",
|
|
10
|
+
"sourceRoot": "packages/react/src"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"!**/*.tsbuildinfo"
|
|
15
|
+
],
|
|
16
|
+
"exports": {
|
|
17
|
+
"./package.json": "./package.json",
|
|
18
|
+
"./style": "./dist/style.css",
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js"
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"module": "./dist/index.js",
|
|
26
|
+
"type": "module",
|
|
27
|
+
"main": "./dist/index.js",
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"clsx": "^2.1.1"
|
|
30
|
+
}
|
|
31
|
+
}
|