@asgard-js/react 0.0.29 → 0.0.32-canary.0
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/.babelrc +12 -0
- package/README.md +13 -13
- package/dist/components/chatbot/chatbot-header/chatbot-header.d.ts +1 -1
- package/dist/components/chatbot/chatbot-header/chatbot-header.d.ts.map +1 -1
- package/dist/components/chatbot/chatbot.d.ts +2 -1
- package/dist/components/chatbot/chatbot.d.ts.map +1 -1
- package/dist/components/templates/button-template/card.d.ts.map +1 -1
- package/dist/components/templates/text-template/{use-markdown-renderer.d.ts → use-react-markdown-renderer.d.ts} +3 -1
- package/dist/components/templates/text-template/use-react-markdown-renderer.d.ts.map +1 -0
- package/dist/context/asgard-template-context.d.ts +2 -0
- package/dist/context/asgard-template-context.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/use-channel.d.ts +1 -1
- package/dist/hooks/use-channel.d.ts.map +1 -1
- package/dist/index.js +74570 -54207
- package/dist/style.css +1 -1
- package/dist/utils/uri-validation.d.ts +20 -0
- package/dist/utils/uri-validation.d.ts.map +1 -0
- package/eslint.config.cjs +12 -0
- package/package.json +15 -9
- package/src/components/chatbot/chatbot-body/chatbot-body.module.scss +13 -0
- package/src/components/chatbot/chatbot-body/chatbot-body.tsx +45 -0
- package/src/components/chatbot/chatbot-body/conversation-message-renderer.tsx +55 -0
- package/src/components/chatbot/chatbot-body/index.ts +1 -0
- package/src/components/chatbot/chatbot-container/chatbot-container.module.scss +41 -0
- package/src/components/chatbot/chatbot-container/chatbot-container.tsx +49 -0
- package/src/components/chatbot/chatbot-container/chatbot-full-screen-container.tsx +54 -0
- package/src/components/chatbot/chatbot-footer/chatbot-footer.module.scss +67 -0
- package/src/components/chatbot/chatbot-footer/chatbot-footer.tsx +140 -0
- package/src/components/chatbot/chatbot-footer/index.ts +1 -0
- package/src/components/chatbot/chatbot-footer/speech-input-button.tsx +132 -0
- package/src/components/chatbot/chatbot-header/chatbot-header.module.scss +48 -0
- package/src/components/chatbot/chatbot-header/chatbot-header.tsx +98 -0
- package/src/components/chatbot/chatbot-header/index.ts +1 -0
- package/src/components/chatbot/chatbot.spec.tsx +8 -0
- package/src/components/chatbot/chatbot.tsx +118 -0
- package/src/components/chatbot/profile-icon.tsx +26 -0
- package/src/components/index.ts +2 -0
- package/src/components/templates/avatar/avatar.module.scss +6 -0
- package/src/components/templates/avatar/avatar.tsx +28 -0
- package/src/components/templates/avatar/index.ts +1 -0
- package/src/components/templates/button-template/button-template.module.scss +0 -0
- package/src/components/templates/button-template/button-template.tsx +45 -0
- package/src/components/templates/button-template/card.module.scss +58 -0
- package/src/components/templates/button-template/card.spec.tsx +213 -0
- package/src/components/templates/button-template/card.tsx +123 -0
- package/src/components/templates/button-template/index.ts +1 -0
- package/src/components/templates/carousel-template/carousel-template.module.scss +15 -0
- package/src/components/templates/carousel-template/carousel-template.tsx +48 -0
- package/src/components/templates/carousel-template/index.ts +1 -0
- package/src/components/templates/chart-template/chart-template.module.scss +52 -0
- package/src/components/templates/chart-template/chart-template.tsx +76 -0
- package/src/components/templates/chart-template/index.ts +1 -0
- package/src/components/templates/hint-template/hint-template.module.scss +39 -0
- package/src/components/templates/hint-template/hint-template.tsx +71 -0
- package/src/components/templates/hint-template/index.ts +1 -0
- package/src/components/templates/image-template/image-template.module.scss +67 -0
- package/src/components/templates/image-template/image-template.tsx +58 -0
- package/src/components/templates/image-template/index.ts +1 -0
- package/src/components/templates/index.ts +10 -0
- package/src/components/templates/quick-replies/index.ts +1 -0
- package/src/components/templates/quick-replies/quick-replies.module.scss +16 -0
- package/src/components/templates/quick-replies/quick-replies.tsx +44 -0
- package/src/components/templates/template-box/index.ts +2 -0
- package/src/components/templates/template-box/template-box-content.module.scss +13 -0
- package/src/components/templates/template-box/template-box-content.tsx +30 -0
- package/src/components/templates/template-box/template-box.module.scss +19 -0
- package/src/components/templates/template-box/template-box.tsx +48 -0
- package/src/components/templates/text-template/bot-typing-box.tsx +81 -0
- package/src/components/templates/text-template/bot-typing-placeholder.tsx +28 -0
- package/src/components/templates/text-template/index.ts +3 -0
- package/src/components/templates/text-template/text-template.module.scss +131 -0
- package/src/components/templates/text-template/text-template.tsx +90 -0
- package/src/components/templates/text-template/use-react-markdown-renderer.spec.tsx +758 -0
- package/src/components/templates/text-template/use-react-markdown-renderer.tsx +264 -0
- package/src/components/templates/time/index.ts +1 -0
- package/src/components/templates/time/time.module.scss +6 -0
- package/src/components/templates/time/time.tsx +34 -0
- package/src/context/asgard-app-initialization-context.tsx +154 -0
- package/src/context/asgard-service-context.tsx +139 -0
- package/src/context/asgard-template-context.tsx +83 -0
- package/src/context/asgard-theme-context.tsx +401 -0
- package/src/context/index.ts +4 -0
- package/src/hooks/index.ts +11 -0
- package/src/hooks/use-asgard-service-client.ts +68 -0
- package/src/hooks/use-channel.ts +154 -0
- package/src/hooks/use-debounce.ts +18 -0
- package/src/hooks/use-deep-compare-memo.ts +19 -0
- package/src/hooks/use-is-on-screen-keyboard-open.ts +43 -0
- package/src/hooks/use-on-screen-keyboard-scroll-fix.ts +15 -0
- package/src/hooks/use-prevent-over-scrolling.ts +77 -0
- package/src/hooks/use-resize-observer.tsx +27 -0
- package/src/hooks/use-update-vh.ts +30 -0
- package/src/hooks/use-viewport-size.ts +51 -0
- package/src/icons/add_a_photo.svg +3 -0
- package/src/icons/bot.svg +14 -0
- package/src/icons/close.svg +3 -0
- package/src/icons/distance.svg +3 -0
- package/src/icons/mic.svg +3 -0
- package/src/icons/photo_library.svg +3 -0
- package/src/icons/profile.svg +28 -0
- package/src/icons/refresh.svg +3 -0
- package/src/icons/send.svg +3 -0
- package/src/icons/stop.svg +22 -0
- package/src/icons/volume_up.svg +3 -0
- package/src/index.ts +4 -0
- package/src/models/bot-provider.ts +108 -0
- package/src/styles/_index.scss +1 -0
- package/src/styles/_styles.scss +11 -0
- package/src/styles/colors/_colors.scss +10 -0
- package/src/styles/colors/_index.scss +1 -0
- package/src/styles/colors/_variables.scss +72 -0
- package/src/styles/palette/_index.scss +1 -0
- package/src/styles/palette/_palette.scss +42 -0
- package/src/styles/palette/_variables.scss +40 -0
- package/src/styles/radius/_index.scss +1 -0
- package/src/styles/radius/_radius.scss +8 -0
- package/src/styles/radius/_variables.scss +12 -0
- package/src/styles/spacing/_index.scss +1 -0
- package/src/styles/spacing/_spacing.scss +8 -0
- package/src/styles/spacing/_variables.scss +13 -0
- package/src/styles/utils/_index.scss +1 -0
- package/src/styles/utils/_map.scss +22 -0
- package/src/test-setup.ts +1 -0
- package/src/utils/deep-merge.ts +23 -0
- package/src/utils/extractors.ts +20 -0
- package/src/utils/format-time.ts +8 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/is.ts +72 -0
- package/src/utils/selectors.ts +7 -0
- package/src/utils/uri-validation.spec.ts +208 -0
- package/src/utils/uri-validation.ts +103 -0
- package/tsconfig.json +16 -0
- package/tsconfig.lib.json +62 -0
- package/tsconfig.spec.json +36 -0
- package/vite.config.ts +63 -0
- package/dist/components/templates/text-template/use-markdown-renderer.d.ts.map +0 -1
package/.babelrc
ADDED
package/README.md
CHANGED
|
@@ -62,6 +62,7 @@ const App = () => {
|
|
|
62
62
|
fullScreen={false}
|
|
63
63
|
avatar="https://example.com/avatar.png"
|
|
64
64
|
botTypingPlaceholder="Bot is typing..."
|
|
65
|
+
defaultLinkTarget="_blank"
|
|
65
66
|
onReset={() => {
|
|
66
67
|
console.log('Chat reset');
|
|
67
68
|
}}
|
|
@@ -93,6 +94,7 @@ export default App;
|
|
|
93
94
|
**Important**: The `endpoint` configuration option is deprecated. Use `botProviderEndpoint` instead for simplified configuration.
|
|
94
95
|
|
|
95
96
|
### Before (Deprecated)
|
|
97
|
+
|
|
96
98
|
```javascript
|
|
97
99
|
config: {
|
|
98
100
|
apiKey: 'your-api-key',
|
|
@@ -102,15 +104,17 @@ config: {
|
|
|
102
104
|
```
|
|
103
105
|
|
|
104
106
|
### After (Recommended)
|
|
107
|
+
|
|
105
108
|
```javascript
|
|
106
109
|
config: {
|
|
107
|
-
apiKey: 'your-api-key',
|
|
110
|
+
apiKey: 'your-api-key',
|
|
108
111
|
botProviderEndpoint: 'https://api.asgard-ai.com/ns/{namespace}/bot-provider/{botProviderId}',
|
|
109
112
|
// SSE endpoint is automatically derived as: botProviderEndpoint + '/message/sse'
|
|
110
113
|
}
|
|
111
114
|
```
|
|
112
115
|
|
|
113
116
|
**Benefits:**
|
|
117
|
+
|
|
114
118
|
- Simplified configuration with single endpoint
|
|
115
119
|
- Reduced chance of configuration errors
|
|
116
120
|
- Automatic endpoint derivation
|
|
@@ -119,7 +123,7 @@ config: {
|
|
|
119
123
|
|
|
120
124
|
### Chatbot Component Props
|
|
121
125
|
|
|
122
|
-
- **title
|
|
126
|
+
- **title?**: `string` - The title of the chatbot (optional). If not provided, will use the value from the API if available.
|
|
123
127
|
- **config**: `ClientConfig` - Configuration object for the Asgard service client, including:
|
|
124
128
|
- `apiKey`: `string` (required) - API key for authentication
|
|
125
129
|
- `botProviderEndpoint`: `string` (required) - Bot provider endpoint URL (SSE endpoint will be auto-derived)
|
|
@@ -142,6 +146,7 @@ config: {
|
|
|
142
146
|
- **fullScreen**: `boolean` - Display chatbot in full screen mode, defaults to `false`
|
|
143
147
|
- **avatar**: `string` - URL for the chatbot's avatar image
|
|
144
148
|
- **botTypingPlaceholder**: `string` - Text to display while the bot is typing
|
|
149
|
+
- **defaultLinkTarget?**: `'_blank' | '_self' | '_parent' | '_top'` - Default target for opening URIs when not specified by the API. Defaults to `'_blank'` (opens in new tab).
|
|
145
150
|
- **theme**: `Partial<AsgardThemeContextValue>` - Custom theme configuration
|
|
146
151
|
- **onReset**: `() => void` - Callback function when chat is reset
|
|
147
152
|
- **onClose**: `() => void` - Callback function when chat is closed
|
|
@@ -227,13 +232,13 @@ export interface AsgardThemeContextValue {
|
|
|
227
232
|
HintMessageTemplate: Partial<{ style: CSSProperties }>;
|
|
228
233
|
ImageMessageTemplate: Partial<{ style: CSSProperties }>;
|
|
229
234
|
ChartMessageTemplate: Partial<{ style: CSSProperties }>;
|
|
230
|
-
ButtonMessageTemplate: Partial<{
|
|
235
|
+
ButtonMessageTemplate: Partial<{
|
|
231
236
|
style: CSSProperties;
|
|
232
237
|
button?: {
|
|
233
238
|
style: CSSProperties;
|
|
234
239
|
};
|
|
235
240
|
}>;
|
|
236
|
-
CarouselMessageTemplate: Partial<{
|
|
241
|
+
CarouselMessageTemplate: Partial<{
|
|
237
242
|
style: CSSProperties;
|
|
238
243
|
card: {
|
|
239
244
|
style: CSSProperties;
|
|
@@ -394,29 +399,22 @@ The React package includes comprehensive tests using Vitest and React Testing Li
|
|
|
394
399
|
|
|
395
400
|
```sh
|
|
396
401
|
# Run tests once
|
|
397
|
-
npm test
|
|
398
|
-
# or
|
|
399
402
|
yarn test:react
|
|
400
403
|
|
|
401
404
|
# Run tests in watch mode
|
|
402
|
-
npm run test:watch
|
|
403
|
-
# or
|
|
404
405
|
yarn test:react:watch
|
|
405
406
|
|
|
406
407
|
# Run tests with UI
|
|
407
|
-
npm run test:ui
|
|
408
|
-
# or
|
|
409
408
|
yarn test:react:ui
|
|
410
409
|
|
|
411
410
|
# Run tests with coverage
|
|
412
|
-
npm run test:coverage
|
|
413
|
-
# or
|
|
414
411
|
yarn test:react:coverage
|
|
415
412
|
```
|
|
416
413
|
|
|
417
414
|
### Test Structure
|
|
418
415
|
|
|
419
416
|
Tests are located alongside source files with `.spec.tsx` extensions:
|
|
417
|
+
|
|
420
418
|
- `src/components/chatbot/chatbot.spec.tsx` - React component tests
|
|
421
419
|
- Test environment: jsdom with React Testing Library
|
|
422
420
|
- Setup file: `src/test-setup.ts` (includes jest-dom)
|
|
@@ -425,6 +423,7 @@ Tests are located alongside source files with `.spec.tsx` extensions:
|
|
|
425
423
|
### Writing Tests
|
|
426
424
|
|
|
427
425
|
The package uses Vitest for testing with the following setup:
|
|
426
|
+
|
|
428
427
|
- TypeScript support
|
|
429
428
|
- jsdom environment for DOM APIs
|
|
430
429
|
- React Testing Library for component testing
|
|
@@ -433,6 +432,7 @@ The package uses Vitest for testing with the following setup:
|
|
|
433
432
|
- Coverage reporting with v8 provider
|
|
434
433
|
|
|
435
434
|
Example test structure:
|
|
435
|
+
|
|
436
436
|
```javascript
|
|
437
437
|
import { describe, it, expect } from 'vitest';
|
|
438
438
|
import { render } from '@testing-library/react';
|
|
@@ -492,7 +492,7 @@ yarn watch:react
|
|
|
492
492
|
yarn serve:react-demo
|
|
493
493
|
```
|
|
494
494
|
|
|
495
|
-
Setup your npm
|
|
495
|
+
Setup your npm registry token for yarn publishing:
|
|
496
496
|
|
|
497
497
|
```sh
|
|
498
498
|
cd ~/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot-header.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/chatbot-header/chatbot-header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,SAAS,EAAwB,MAAM,OAAO,CAAC;AAY3E,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"chatbot-header.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/chatbot-header/chatbot-header.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,SAAS,EAAwB,MAAM,OAAO,CAAC;AAY3E,UAAU,kBAAkB;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,SAAS,EAAE,CAAC;IAC5B,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,SAAS,CA6ElE"}
|
|
@@ -6,7 +6,7 @@ import { ReactNode, CSSProperties } from 'react';
|
|
|
6
6
|
interface ChatbotProps extends AsgardTemplateContextValue {
|
|
7
7
|
className?: string;
|
|
8
8
|
style?: CSSProperties;
|
|
9
|
-
title
|
|
9
|
+
title?: string;
|
|
10
10
|
customActions?: ReactNode[];
|
|
11
11
|
theme?: Partial<AsgardThemeContextValue>;
|
|
12
12
|
config: ClientConfig;
|
|
@@ -22,6 +22,7 @@ interface ChatbotProps extends AsgardTemplateContextValue {
|
|
|
22
22
|
onReset?: () => void;
|
|
23
23
|
onClose?: () => void;
|
|
24
24
|
loadingComponent?: ReactNode;
|
|
25
|
+
defaultLinkTarget?: '_blank' | '_self' | '_parent' | '_top';
|
|
25
26
|
}
|
|
26
27
|
export interface ChatbotRef {
|
|
27
28
|
serviceContext?: AsgardServiceContextValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chatbot.d.ts","sourceRoot":"","sources":["../../../src/components/chatbot/chatbot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4B,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAEL,uBAAuB,EACxB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAEL,yBAAyB,EAEzB,0BAA0B,EAE1B,iCAAiC,EAClC,MAAM,aAAa,CAAC;AAMrB,UAAU,YAAa,SAAQ,0BAA0B;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"chatbot.d.ts","sourceRoot":"","sources":["../../../src/components/chatbot/chatbot.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4B,SAAS,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAEL,uBAAuB,EACxB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAEL,yBAAyB,EAEzB,0BAA0B,EAE1B,iCAAiC,EAClC,MAAM,aAAa,CAAC;AAMrB,UAAU,YAAa,SAAQ,0BAA0B;IACvD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,SAAS,EAAE,CAAC;IAC5B,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,YAAY,CAAC,EAAE,iCAAiC,CAAC,cAAc,CAAC,CAAC;IACjE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,2BAA2B,CAAC,EAAE,OAAO,CAAC;IACtC,4BAA4B,CAAC,EAAE,OAAO,CAAC;IACvC,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,gBAAgB,CAAC,EAAE,SAAS,CAAC;IAC7B,iBAAiB,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;CAC7D;AAED,MAAM,WAAW,UAAU;IACzB,cAAc,CAAC,EAAE,yBAAyB,CAAC;CAC5C;AAED,eAAO,MAAM,OAAO,qGAwElB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/button-template/card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EAGT,aAAa,EACd,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/button-template/card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EAGT,aAAa,EACd,MAAM,OAAO,CAAC;AAEf,OAAO,EAEL,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AAMzB,UAAU,SAAS;IACjB,QAAQ,EAAE,qBAAqB,GAAG,uBAAuB,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;IAC7E,WAAW,CAAC,EAAE;QACZ,KAAK,CAAC,EAAE,aAAa,CAAC;QACtB,MAAM,CAAC,EAAE;YACP,KAAK,CAAC,EAAE,aAAa,CAAC;SACvB,CAAC;KACH,CAAC;CACH;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CA8FhD"}
|
|
@@ -4,6 +4,8 @@ interface MarkdownRenderResult {
|
|
|
4
4
|
htmlBlocks: ReactNode;
|
|
5
5
|
lastTypingText: string;
|
|
6
6
|
}
|
|
7
|
+
export declare const MAX_CACHE_SIZE = 100;
|
|
8
|
+
export declare function manageCacheSize(cache: Map<string, ReactNode>): void;
|
|
7
9
|
export declare function useMarkdownRenderer(markdownText: string, delay?: number): MarkdownRenderResult;
|
|
8
10
|
export {};
|
|
9
|
-
//# sourceMappingURL=use-markdown-renderer.d.ts.map
|
|
11
|
+
//# sourceMappingURL=use-react-markdown-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-react-markdown-renderer.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/text-template/use-react-markdown-renderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EAMV,MAAM,OAAO,CAAC;AAMf,OAAO,0BAA0B,CAAC;AAKlC,UAAU,oBAAoB;IAC5B,UAAU,EAAE,SAAS,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;CACxB;AAQD,eAAO,MAAM,cAAc,MAAM,CAAC;AAGlC,wBAAgB,eAAe,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAI,CAQnE;AAuHD,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,MAAM,EACpB,KAAK,SAAM,GACV,oBAAoB,CAqGtB"}
|
|
@@ -9,6 +9,7 @@ export interface AsgardTemplateContextValue {
|
|
|
9
9
|
sendMessage: (payload: Pick<FetchSsePayload, 'text' | 'payload'>) => void;
|
|
10
10
|
};
|
|
11
11
|
}) => void;
|
|
12
|
+
defaultLinkTarget?: '_blank' | '_self' | '_parent' | '_top';
|
|
12
13
|
}
|
|
13
14
|
export declare const AsgardTemplateContext: import('react').Context<AsgardTemplateContextValue>;
|
|
14
15
|
interface AsgardTemplateContextProviderProps extends PropsWithChildren {
|
|
@@ -19,6 +20,7 @@ interface AsgardTemplateContextProviderProps extends PropsWithChildren {
|
|
|
19
20
|
sendMessage: (payload: Pick<FetchSsePayload, 'text' | 'payload'>) => void;
|
|
20
21
|
};
|
|
21
22
|
}) => void;
|
|
23
|
+
defaultLinkTarget?: '_blank' | '_self' | '_parent' | '_top';
|
|
22
24
|
}
|
|
23
25
|
export declare function AsgardTemplateContextProvider(props: AsgardTemplateContextProviderProps): ReactNode;
|
|
24
26
|
export declare function useAsgardTemplateContext(): AsgardTemplateContextValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asgard-template-context.d.ts","sourceRoot":"","sources":["../../src/context/asgard-template-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EACjB,SAAS,EAGV,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE5E,MAAM,WAAW,0BAA0B;IACzC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,wBAAwB,KAAK,IAAI,CAAC;IAC3D,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,wBAAwB,KAAK,SAAS,CAAC;IACxE,kBAAkB,CAAC,EAAE,CACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,EACE,GAAG,GACJ,EAAE;QACD,GAAG,EAAE;YACH,WAAW,EAAE,CACX,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC,KAC/C,IAAI,CAAC;SACX,CAAC;KACH,KACE,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"asgard-template-context.d.ts","sourceRoot":"","sources":["../../src/context/asgard-template-context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EACjB,SAAS,EAGV,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAE5E,MAAM,WAAW,0BAA0B;IACzC,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,wBAAwB,KAAK,IAAI,CAAC;IAC3D,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,wBAAwB,KAAK,SAAS,CAAC;IACxE,kBAAkB,CAAC,EAAE,CACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,EACE,GAAG,GACJ,EAAE;QACD,GAAG,EAAE;YACH,WAAW,EAAE,CACX,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC,KAC/C,IAAI,CAAC;SACX,CAAC;KACH,KACE,IAAI,CAAC;IACV,iBAAiB,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;CAC7D;AAED,eAAO,MAAM,qBAAqB,qDAKhC,CAAC;AAEH,UAAU,kCAAmC,SAAQ,iBAAiB;IACpE,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,wBAAwB,KAAK,IAAI,CAAC;IAC3D,oBAAoB,CAAC,EAAE,CAAC,OAAO,EAAE,wBAAwB,KAAK,SAAS,CAAC;IACxE,kBAAkB,CAAC,EAAE,CACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,EACE,GAAG,GACJ,EAAE;QACD,GAAG,EAAE;YACH,WAAW,EAAE,CACX,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC,KAC/C,IAAI,CAAC;SACX,CAAC;KACH,KACE,IAAI,CAAC;IACV,iBAAiB,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;CAC7D;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,kCAAkC,GACxC,SAAS,CAwBX;AAED,wBAAgB,wBAAwB,IAAI,0BAA0B,CAErE"}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export * from './use-prevent-over-scrolling';
|
|
|
8
8
|
export * from './use-update-vh';
|
|
9
9
|
export * from './use-resize-observer';
|
|
10
10
|
export * from './use-deep-compare-memo';
|
|
11
|
-
export * from '../components/templates/text-template/use-markdown-renderer';
|
|
11
|
+
export * from '../components/templates/text-template/use-react-markdown-renderer';
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +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;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,
|
|
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;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oEAAoE,CAAC"}
|
|
@@ -17,7 +17,7 @@ export interface UseChannelReturn {
|
|
|
17
17
|
isConnecting: boolean;
|
|
18
18
|
conversation: Conversation | null;
|
|
19
19
|
sendMessage?: (payload: Pick<FetchSsePayload, 'text' | 'payload'>) => void;
|
|
20
|
-
resetChannel?: (payload
|
|
20
|
+
resetChannel?: (payload?: Pick<FetchSsePayload, 'text' | 'payload'>) => void;
|
|
21
21
|
closeChannel?: () => void;
|
|
22
22
|
}
|
|
23
23
|
export declare function useChannel(props: UseChannelProps): UseChannelReturn;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-channel.d.ts","sourceRoot":"","sources":["../../src/hooks/use-channel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAGnB,YAAY,EACZ,mBAAmB,EACnB,SAAS,EACT,eAAe,EACf,WAAW,EACZ,MAAM,iBAAiB,CAAC;AAGzB,MAAM,WAAW,eAAe;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACzD,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACnC,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACrC,YAAY,CAAC,EAAE,CACb,QAAQ,EAAE,WAAW,CAAC,SAAS,CAAC,EAChC,OAAO,EAAE;QACP,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;KACnC,KACE,IAAI,CAAC;CACX;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC,KAAK,IAAI,CAAC;IAC3E,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"use-channel.d.ts","sourceRoot":"","sources":["../../src/hooks/use-channel.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EAGnB,YAAY,EACZ,mBAAmB,EACnB,SAAS,EACT,eAAe,EACf,WAAW,EACZ,MAAM,iBAAiB,CAAC;AAGzB,MAAM,WAAW,eAAe;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACzD,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACnC,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACrC,YAAY,CAAC,EAAE,CACb,QAAQ,EAAE,WAAW,CAAC,SAAS,CAAC,EAChC,OAAO,EAAE;QACP,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;KACnC,KACE,IAAI,CAAC;CACX;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,OAAO,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,YAAY,EAAE,YAAY,GAAG,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC,KAAK,IAAI,CAAC;IAC3E,YAAY,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,SAAS,CAAC,KAAK,IAAI,CAAC;IAC7E,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,gBAAgB,CAoHnE"}
|