@asgard-js/react 0.0.4 → 0.0.5

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.
Files changed (90) hide show
  1. package/README.md +85 -4
  2. package/dist/components/chatbot/chatbot-body.d.ts +4 -0
  3. package/dist/components/chatbot/chatbot-body.d.ts.map +1 -0
  4. package/dist/components/chatbot/chatbot-footer/chatbot-footer.d.ts +4 -0
  5. package/dist/components/chatbot/chatbot-footer/chatbot-footer.d.ts.map +1 -0
  6. package/dist/components/chatbot/chatbot-footer/index.d.ts +2 -0
  7. package/dist/components/chatbot/chatbot-footer/index.d.ts.map +1 -0
  8. package/dist/components/chatbot/chatbot-footer/speech-input-button.d.ts +9 -0
  9. package/dist/components/chatbot/chatbot-footer/speech-input-button.d.ts.map +1 -0
  10. package/dist/components/chatbot/chatbot-header.d.ts +10 -0
  11. package/dist/components/chatbot/chatbot-header.d.ts.map +1 -0
  12. package/dist/components/chatbot/chatbot.d.ts +20 -0
  13. package/dist/components/chatbot/chatbot.d.ts.map +1 -0
  14. package/dist/components/chatbot/profile-icon.d.ts +8 -0
  15. package/dist/components/chatbot/profile-icon.d.ts.map +1 -0
  16. package/dist/components/conversation-message-renderer/conversation-message-renderer.d.ts +9 -0
  17. package/dist/components/conversation-message-renderer/conversation-message-renderer.d.ts.map +1 -0
  18. package/dist/components/conversation-message-renderer/index.d.ts +2 -0
  19. package/dist/components/conversation-message-renderer/index.d.ts.map +1 -0
  20. package/dist/components/index.d.ts +2 -0
  21. package/dist/components/index.d.ts.map +1 -0
  22. package/dist/components/templates/avatar/avatar.d.ts +8 -0
  23. package/dist/components/templates/avatar/avatar.d.ts.map +1 -0
  24. package/dist/components/templates/avatar/index.d.ts +2 -0
  25. package/dist/components/templates/avatar/index.d.ts.map +1 -0
  26. package/dist/components/templates/bot-typing-box/bot-typing-box.d.ts +9 -0
  27. package/dist/components/templates/bot-typing-box/bot-typing-box.d.ts.map +1 -0
  28. package/dist/components/templates/bot-typing-box/bot-typing-placeholder.d.ts +8 -0
  29. package/dist/components/templates/bot-typing-box/bot-typing-placeholder.d.ts.map +1 -0
  30. package/dist/components/templates/bot-typing-box/index.d.ts +3 -0
  31. package/dist/components/templates/bot-typing-box/index.d.ts.map +1 -0
  32. package/dist/components/templates/bot-typing-box/resize-observer-box.d.ts +9 -0
  33. package/dist/components/templates/bot-typing-box/resize-observer-box.d.ts.map +1 -0
  34. package/dist/components/templates/button-template/button-template.d.ts +9 -0
  35. package/dist/components/templates/button-template/button-template.d.ts.map +1 -0
  36. package/dist/components/templates/button-template/card.d.ts +9 -0
  37. package/dist/components/templates/button-template/card.d.ts.map +1 -0
  38. package/dist/components/templates/button-template/index.d.ts +2 -0
  39. package/dist/components/templates/button-template/index.d.ts.map +1 -0
  40. package/dist/components/templates/carousel-template/carousel-template.d.ts +9 -0
  41. package/dist/components/templates/carousel-template/carousel-template.d.ts.map +1 -0
  42. package/dist/components/templates/carousel-template/index.d.ts +2 -0
  43. package/dist/components/templates/carousel-template/index.d.ts.map +1 -0
  44. package/dist/components/templates/hint-template/hint-template.d.ts +9 -0
  45. package/dist/components/templates/hint-template/hint-template.d.ts.map +1 -0
  46. package/dist/components/templates/hint-template/index.d.ts +2 -0
  47. package/dist/components/templates/hint-template/index.d.ts.map +1 -0
  48. package/dist/components/templates/index.d.ts +8 -0
  49. package/dist/components/templates/index.d.ts.map +1 -0
  50. package/dist/components/templates/quick-replies/index.d.ts +2 -0
  51. package/dist/components/templates/quick-replies/index.d.ts.map +1 -0
  52. package/dist/components/templates/quick-replies/quick-replies.d.ts +10 -0
  53. package/dist/components/templates/quick-replies/quick-replies.d.ts.map +1 -0
  54. package/dist/components/templates/template-box/index.d.ts +3 -0
  55. package/dist/components/templates/template-box/index.d.ts.map +1 -0
  56. package/dist/components/templates/template-box/template-box-content.d.ts +12 -0
  57. package/dist/components/templates/template-box/template-box-content.d.ts.map +1 -0
  58. package/dist/components/templates/template-box/template-box.d.ts +14 -0
  59. package/dist/components/templates/template-box/template-box.d.ts.map +1 -0
  60. package/dist/components/templates/text-template/index.d.ts +2 -0
  61. package/dist/components/templates/text-template/index.d.ts.map +1 -0
  62. package/dist/components/templates/text-template/text-template.d.ts +9 -0
  63. package/dist/components/templates/text-template/text-template.d.ts.map +1 -0
  64. package/dist/components/templates/time/index.d.ts +2 -0
  65. package/dist/components/templates/time/index.d.ts.map +1 -0
  66. package/dist/components/templates/time/time.d.ts +9 -0
  67. package/dist/components/templates/time/time.d.ts.map +1 -0
  68. package/dist/context/asgard-service-context.d.ts +35 -0
  69. package/dist/context/asgard-service-context.d.ts.map +1 -0
  70. package/dist/context/asgard-theme-context.d.ts +17 -0
  71. package/dist/context/asgard-theme-context.d.ts.map +1 -0
  72. package/dist/hooks/index.d.ts +4 -0
  73. package/dist/hooks/index.d.ts.map +1 -0
  74. package/dist/hooks/use-asgard-service-client.d.ts +8 -0
  75. package/dist/hooks/use-asgard-service-client.d.ts.map +1 -0
  76. package/dist/hooks/use-channel.d.ts +21 -0
  77. package/dist/hooks/use-channel.d.ts.map +1 -0
  78. package/dist/hooks/use-debounce.d.ts +2 -0
  79. package/dist/hooks/use-debounce.d.ts.map +1 -0
  80. package/dist/index.d.ts +3 -0
  81. package/dist/index.d.ts.map +1 -0
  82. package/dist/index.js +457 -471
  83. package/dist/style.css +1 -1
  84. package/dist/utils/deep-merge.d.ts +3 -0
  85. package/dist/utils/deep-merge.d.ts.map +1 -0
  86. package/dist/utils/format-time.d.ts +2 -0
  87. package/dist/utils/format-time.d.ts.map +1 -0
  88. package/dist/utils/index.d.ts +2 -0
  89. package/dist/utils/index.d.ts.map +1 -0
  90. package/package.json +1 -1
package/README.md CHANGED
@@ -1,7 +1,88 @@
1
- # @asgard-js/react
1
+ # AsgardJs React
2
2
 
3
- This library was generated with [Nx](https://nx.dev).
3
+ This package provides React components and hooks for integrating with the Asgard AI platform, allowing you to build interactive chat interfaces.
4
4
 
5
- ## Running unit tests
5
+ ## Installation
6
6
 
7
- Run `nx test @asgard-js/react` to execute the unit tests via [Vitest](https://vitest.dev/).
7
+ To install the React package, use the following command:
8
+
9
+ ```sh
10
+ yarn add asgardjs-react
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ Here's a basic example of how to use the React components:
16
+
17
+ ```javascript
18
+ import React from 'react';
19
+ import { Chatbot } from 'asgardjs-react';
20
+
21
+ const App = () => {
22
+ return (
23
+ <Chatbot
24
+ title="Asgard AI Chatbot"
25
+ config={{
26
+ apiKey: 'your-api-key',
27
+ endpoint: 'https://api.asgard-ai.com',
28
+ }}
29
+ customChannelId="your-channel-id"
30
+ initMessages={[]}
31
+ fullScreen={false}
32
+ avatar="https://example.com/avatar.png"
33
+ botTypingPlaceholder="Bot is typing..."
34
+ options={{ showDebugMessage: true }}
35
+ />
36
+ );
37
+ };
38
+
39
+ export default App;
40
+ ```
41
+
42
+ ### Chatbot Component Props
43
+
44
+ - **title**: `string` - The title of the chatbot.
45
+ - **config**: `ClientConfig` - Configuration object for the Asgard service client.
46
+ - **customChannelId**: `string` - Custom channel identifier.
47
+ - **initMessages**: `ConversationMessage[]` - Initial messages to display in the chat.
48
+ - **fullScreen**: `boolean` - Whether the chatbot should be displayed in full screen.
49
+ - **avatar**: `string` - URL of the avatar image for the chatbot.
50
+ - **botTypingPlaceholder**: `string` - Placeholder text to show when the bot is typing.
51
+ - **options**: `object` - Additional options, such as `showDebugMessage`.
52
+
53
+ ## Development
54
+
55
+ To start developing the React package, follow these steps:
56
+
57
+ 1. Clone the repository and navigate to the `packages/react` directory.
58
+ 2. Install dependencies:
59
+
60
+ ```sh
61
+ yarn install
62
+ ```
63
+
64
+ 3. Build the package:
65
+
66
+ ```sh
67
+ yarn build
68
+ ```
69
+
70
+ 4. Run tests to ensure everything is working:
71
+
72
+ ```sh
73
+ yarn test
74
+ ```
75
+
76
+ 5. Start the development server:
77
+
78
+ ```sh
79
+ yarn start
80
+ ```
81
+
82
+ ## Contributing
83
+
84
+ We welcome contributions! Please read our [contributing guide](../../CONTRIBUTING.md) to get started.
85
+
86
+ ## License
87
+
88
+ This project is licensed under the MIT License - see the [LICENSE](../../LICENSE) file for details.
@@ -0,0 +1,4 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ export declare function ChatbotBody(): ReactNode;
4
+ //# sourceMappingURL=chatbot-body.d.ts.map
@@ -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,EAAsB,MAAM,OAAO,CAAC;AAOtD,wBAAgB,WAAW,IAAI,SAAS,CAiCvC"}
@@ -0,0 +1,4 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ export declare function ChatbotFooter(): ReactNode;
4
+ //# sourceMappingURL=chatbot-footer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chatbot-footer.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/chatbot-footer/chatbot-footer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,SAAS,EAKV,MAAM,OAAO,CAAC;AAQf,wBAAgB,aAAa,IAAI,SAAS,CAiGzC"}
@@ -0,0 +1,2 @@
1
+ export * from './chatbot-footer';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/chatbot-footer/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Dispatch, ReactNode, SetStateAction } from 'react';
2
+
3
+ interface SpeechInputButtonProps {
4
+ setValue: Dispatch<SetStateAction<string>>;
5
+ className?: string;
6
+ }
7
+ export declare function SpeechInputButton(props: SpeechInputButtonProps): ReactNode;
8
+ export {};
9
+ //# sourceMappingURL=speech-input-button.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"speech-input-button.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/chatbot-footer/speech-input-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAER,SAAS,EACT,cAAc,EAMf,MAAM,OAAO,CAAC;AAIf,UAAU,sBAAsB;IAC9B,QAAQ,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,GAAG,SAAS,CA6G1E"}
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ interface ChatbotHeaderProps {
4
+ title: string;
5
+ onClose?: () => void;
6
+ onReset?: () => void;
7
+ }
8
+ export declare function ChatbotHeader(props: ChatbotHeaderProps): ReactNode;
9
+ export {};
10
+ //# sourceMappingURL=chatbot-header.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chatbot-header.d.ts","sourceRoot":"","sources":["../../../src/components/chatbot/chatbot-header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,SAAS,EAAwB,MAAM,OAAO,CAAC;AAQ3E,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,SAAS,CAuDlE"}
@@ -0,0 +1,20 @@
1
+ import { AsgardThemeContextValue } from '../../context/asgard-theme-context';
2
+ import { ClientConfig, ConversationMessage } from '@asgard-js/core';
3
+ import { ReactNode } from 'react';
4
+
5
+ interface ChatbotProps {
6
+ title: string;
7
+ theme?: Partial<AsgardThemeContextValue>;
8
+ config: ClientConfig;
9
+ customChannelId: string;
10
+ initMessages?: ConversationMessage[];
11
+ debugMode?: boolean;
12
+ fullScreen?: boolean;
13
+ avatar?: string;
14
+ botTypingPlaceholder?: string;
15
+ onReset?: () => void;
16
+ onClose?: () => void;
17
+ }
18
+ export declare function Chatbot(props: ChatbotProps): ReactNode;
19
+ export {};
20
+ //# 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,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,EAEL,uBAAuB,EACxB,MAAM,kCAAkC,CAAC;AAO1C,UAAU,YAAY;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACzC,MAAM,EAAE,YAAY,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACrC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,GAAG,SAAS,CAmCtD"}
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ interface ProfileIconProps {
4
+ avatar?: string;
5
+ }
6
+ export declare function ProfileIcon(props: ProfileIconProps): ReactNode;
7
+ export {};
8
+ //# sourceMappingURL=profile-icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile-icon.d.ts","sourceRoot":"","sources":["../../../src/components/chatbot/profile-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlC,UAAU,gBAAgB;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,SAAS,CAkB9D"}
@@ -0,0 +1,9 @@
1
+ import { ConversationMessage } from '@asgard-js/core';
2
+ import { ReactNode } from 'react';
3
+
4
+ interface ConversationMessageRendererProps {
5
+ message: 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,EAAuB,MAAM,iBAAiB,CAAC;AAS3E,UAAU,gCAAgC;IACxC,OAAO,EAAE,mBAAmB,CAAC;CAC9B;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,gCAAgC,GACtC,SAAS,CA4BX"}
@@ -0,0 +1,2 @@
1
+ export * from './conversation-message-renderer';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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,2 @@
1
+ export * from './chatbot/chatbot';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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,8 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ interface AvatarProps {
4
+ avatar?: string;
5
+ }
6
+ export declare const Avatar: import('react').MemoExoticComponent<(props: AvatarProps) => ReactNode>;
7
+ export {};
8
+ //# sourceMappingURL=avatar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/avatar/avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,SAAS,EAAE,MAAM,OAAO,CAAC;AAIxC,UAAU,WAAW;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,MAAM,8CAAgB,WAAW,KAAG,SAAS,CAYxD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './avatar';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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,9 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ interface BotTypingBoxProps {
4
+ isTyping: boolean;
5
+ typingText: string | null;
6
+ }
7
+ export declare function BotTypingBox(props: BotTypingBoxProps): ReactNode;
8
+ export {};
9
+ //# sourceMappingURL=bot-typing-box.d.ts.map
@@ -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;AAS/C,UAAU,iBAAiB;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CA+BhE"}
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ interface BotTypingPlaceholderProps {
4
+ placeholder: string;
5
+ }
6
+ export declare function BotTypingPlaceholder(props: BotTypingPlaceholderProps): ReactNode;
7
+ export {};
8
+ //# sourceMappingURL=bot-typing-placeholder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bot-typing-placeholder.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/bot-typing-box/bot-typing-placeholder.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AAI3C,UAAU,yBAAyB;IACjC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,yBAAyB,GAC/B,SAAS,CAiBX"}
@@ -0,0 +1,3 @@
1
+ export * from './bot-typing-box';
2
+ export * from './bot-typing-placeholder';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -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;AACjC,cAAc,0BAA0B,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 { ReactNode } from 'react';
2
+ import { ConversationBotMessage } from '@asgard-js/core';
3
+
4
+ interface ButtonTemplateProps {
5
+ message: 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":"AAAA,OAAO,EAAyB,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMlC,UAAU,mBAAmB;IAC3B,OAAO,EAAE,sBAAsB,CAAC;CACjC;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,SAAS,CAkBpE"}
@@ -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,CAsEhD"}
@@ -0,0 +1,2 @@
1
+ export * from './button-template';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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 '@asgard-js/core';
2
+ import { ReactNode } from 'react';
3
+
4
+ interface CarouselTemplateProps {
5
+ message: 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;AAKlC,OAAO,EAEL,sBAAsB,EACvB,MAAM,iBAAiB,CAAC;AAIzB,UAAU,qBAAqB;IAC7B,OAAO,EAAE,sBAAsB,CAAC;CACjC;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,SAAS,CAkBxE"}
@@ -0,0 +1,2 @@
1
+ export * from './carousel-template';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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 '@asgard-js/core';
2
+ import { ReactNode } from 'react';
3
+
4
+ interface HintTemplateProps {
5
+ message: 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;AAGlC,OAAO,EAAE,mBAAmB,EAAuB,MAAM,iBAAiB,CAAC;AAE3E,UAAU,iBAAiB;IACzB,OAAO,EAAE,mBAAmB,CAAC;CAC9B;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CAehE"}
@@ -0,0 +1,2 @@
1
+ export * from './hint-template';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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,2 @@
1
+ export * from './quick-replies';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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,10 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ interface QuickRepliesProps {
4
+ quickReplies: {
5
+ text: string;
6
+ }[];
7
+ }
8
+ export declare function QuickReplies(props: QuickRepliesProps): ReactNode;
9
+ export {};
10
+ //# sourceMappingURL=quick-replies.d.ts.map
@@ -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,CA8BhE"}
@@ -0,0 +1,3 @@
1
+ export * from './template-box';
2
+ export * from './template-box-content';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -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,2 @@
1
+ export * from './text-template';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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 '@asgard-js/core';
2
+ import { ReactNode } from 'react';
3
+
4
+ interface TextTemplateProps {
5
+ message: 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,iBAAiB,CAAC;AAOtD,UAAU,iBAAiB;IACzB,OAAO,EAAE,mBAAmB,CAAC;CAC9B;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CA6BhE"}
@@ -0,0 +1,2 @@
1
+ export * from './time';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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,9 @@
1
+ import { ReactNode } from 'react';
2
+
3
+ interface TimeProps {
4
+ time?: Date;
5
+ className?: string;
6
+ }
7
+ export declare function Time(props: TimeProps): ReactNode;
8
+ export {};
9
+ //# sourceMappingURL=time.d.ts.map
@@ -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,35 @@
1
+ import { UseChannelReturn } from '../hooks';
2
+ import { DetailedHTMLProps, HTMLAttributes, ReactNode, RefObject } from 'react';
3
+ import { AsgardServiceClient, ClientConfig, ConversationMessage } from '@asgard-js/core';
4
+
5
+ interface AsgardServiceContextType {
6
+ avatar?: string;
7
+ client: AsgardServiceClient | null;
8
+ isOpen: boolean;
9
+ isResetting: boolean;
10
+ isConnecting: boolean;
11
+ messages: Map<string, ConversationMessage> | null;
12
+ messageBoxBottomRef: RefObject<HTMLDivElement>;
13
+ sendMessage?: UseChannelReturn['sendMessage'];
14
+ resetChannel?: UseChannelReturn['resetChannel'];
15
+ closeChannel?: UseChannelReturn['closeChannel'];
16
+ botTypingPlaceholder?: string;
17
+ }
18
+ export declare const AsgardServiceContext: import('react').Context<AsgardServiceContextType>;
19
+ interface AsgardServiceContextProviderProps extends DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
20
+ children: ReactNode;
21
+ avatar?: string;
22
+ config: ClientConfig;
23
+ botTypingPlaceholder?: string;
24
+ customChannelId: string;
25
+ customMessageId?: string;
26
+ delayTime?: number;
27
+ options?: {
28
+ showDebugMessage?: boolean;
29
+ };
30
+ initMessages?: ConversationMessage[];
31
+ }
32
+ export declare function AsgardServiceContextProvider(props: AsgardServiceContextProviderProps): ReactNode;
33
+ export declare function useAsgardContext(): AsgardServiceContextType;
34
+ export {};
35
+ //# 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":"AAAA,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAEL,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,SAAS,EAIV,MAAM,OAAO,CAAC;AACf,OAAO,EAGL,gBAAgB,EACjB,MAAM,WAAW,CAAC;AAGnB,UAAU,wBAAwB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACnC,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAAG,IAAI,CAAC;IAClD,mBAAmB,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IAC/C,WAAW,CAAC,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;IAC9C,YAAY,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAChD,YAAY,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAC;IAChD,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,eAAO,MAAM,oBAAoB,mDAS/B,CAAC;AAEH,UAAU,iCACR,SAAQ,iBAAiB,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,cAAc,CAAC;IACzE,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,YAAY,CAAC;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE;QAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IACzC,YAAY,CAAC,EAAE,mBAAmB,EAAE,CAAC;CACtC;AAED,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,iCAAiC,GACvC,SAAS,CAsEX;AAED,wBAAgB,gBAAgB,IAAI,wBAAwB,CAE3D"}
@@ -0,0 +1,17 @@
1
+ import { CSSProperties, PropsWithChildren, ReactNode } from 'react';
2
+
3
+ export interface AsgardThemeContextValue {
4
+ chatbot: Pick<CSSProperties, 'width' | 'height' | 'maxWidth' | 'minWidth' | 'maxHeight' | 'minHeight' | 'backgroundColor' | 'borderColor' | 'borderRadius'> & {
5
+ contentMaxWidth?: CSSProperties['maxWidth'];
6
+ };
7
+ botMessage: Pick<CSSProperties, 'color' | 'backgroundColor'>;
8
+ userMessage: Pick<CSSProperties, 'color' | 'backgroundColor'>;
9
+ }
10
+ export declare const defaultAsgardThemeContextValue: AsgardThemeContextValue;
11
+ export declare const AsgardThemeContext: import('react').Context<AsgardThemeContextValue>;
12
+ export declare function AsgardThemeContextProvider(props: PropsWithChildren<{
13
+ fullScreen?: boolean;
14
+ theme?: Partial<AsgardThemeContextValue>;
15
+ }>): ReactNode;
16
+ export declare function useAsgardThemeContext(): AsgardThemeContextValue;
17
+ //# sourceMappingURL=asgard-theme-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asgard-theme-context.d.ts","sourceRoot":"","sources":["../../src/context/asgard-theme-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,aAAa,EACb,iBAAiB,EACjB,SAAS,EAGV,MAAM,OAAO,CAAC;AAGf,MAAM,WAAW,uBAAuB;IACtC,OAAO,EAAE,IAAI,CACX,aAAa,EACX,OAAO,GACP,QAAQ,GACR,UAAU,GACV,UAAU,GACV,WAAW,GACX,WAAW,GACX,iBAAiB,GACjB,aAAa,GACb,cAAc,CACjB,GAAG;QACF,eAAe,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;KAC7C,CAAC;IACF,UAAU,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,iBAAiB,CAAC,CAAC;IAC7D,WAAW,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,iBAAiB,CAAC,CAAC;CAC/D;AAED,eAAO,MAAM,8BAA8B,EAAE,uBAiB5C,CAAC;AAEF,eAAO,MAAM,kBAAkB,kDAE9B,CAAC;AAEF,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,iBAAiB,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAAC;CAC1C,CAAC,GACD,SAAS,CAyBX;AAED,wBAAgB,qBAAqB,IAAI,uBAAuB,CAE/D"}
@@ -0,0 +1,4 @@
1
+ export * from './use-asgard-service-client';
2
+ export * from './use-channel';
3
+ export * from './use-debounce';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -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,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"}