@asgard-js/react 0.0.24 → 0.0.26
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 +165 -9
- package/dist/components/chatbot/chatbot-footer/chatbot-footer.d.ts.map +1 -1
- package/dist/components/chatbot/chatbot-header/chatbot-header.d.ts.map +1 -1
- package/dist/components/templates/button-template/button-template.d.ts.map +1 -1
- package/dist/components/templates/button-template/card.d.ts +7 -1
- package/dist/components/templates/button-template/card.d.ts.map +1 -1
- package/dist/components/templates/carousel-template/carousel-template.d.ts.map +1 -1
- package/dist/components/templates/chart-template/chart-template.d.ts.map +1 -1
- package/dist/components/templates/time/time.d.ts.map +1 -1
- package/dist/context/asgard-app-initialization-context.d.ts +24 -3
- package/dist/context/asgard-app-initialization-context.d.ts.map +1 -1
- package/dist/context/asgard-theme-context.d.ts +23 -0
- package/dist/context/asgard-theme-context.d.ts.map +1 -1
- package/dist/index.js +8871 -8646
- package/dist/models/bot-provider.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/test-setup.d.ts +2 -0
- package/dist/test-setup.d.ts.map +1 -0
- package/package.json +21 -2
package/README.md
CHANGED
|
@@ -48,13 +48,9 @@ const App = () => {
|
|
|
48
48
|
title="Asgard AI Chatbot"
|
|
49
49
|
config={{
|
|
50
50
|
apiKey: 'your-api-key',
|
|
51
|
-
endpoint:
|
|
52
|
-
'https://api.asgard-ai.com/ns/{namespace}/bot-provider/{botProviderId}/message/sse',
|
|
53
51
|
botProviderEndpoint:
|
|
54
52
|
'https://api.asgard-ai.com/ns/{namespace}/bot-provider/{botProviderId}',
|
|
55
|
-
|
|
56
|
-
console.error('Execution error:', error);
|
|
57
|
-
},
|
|
53
|
+
debugMode: true, // Enable to see deprecation warnings
|
|
58
54
|
transformSsePayload: (payload) => {
|
|
59
55
|
return payload;
|
|
60
56
|
},
|
|
@@ -92,13 +88,42 @@ const App = () => {
|
|
|
92
88
|
export default App;
|
|
93
89
|
```
|
|
94
90
|
|
|
91
|
+
## Migration from `endpoint` to `botProviderEndpoint`
|
|
92
|
+
|
|
93
|
+
**Important**: The `endpoint` configuration option is deprecated. Use `botProviderEndpoint` instead for simplified configuration.
|
|
94
|
+
|
|
95
|
+
### Before (Deprecated)
|
|
96
|
+
```javascript
|
|
97
|
+
config: {
|
|
98
|
+
apiKey: 'your-api-key',
|
|
99
|
+
endpoint: 'https://api.asgard-ai.com/ns/{namespace}/bot-provider/{botProviderId}/message/sse',
|
|
100
|
+
botProviderEndpoint: 'https://api.asgard-ai.com/ns/{namespace}/bot-provider/{botProviderId}',
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### After (Recommended)
|
|
105
|
+
```javascript
|
|
106
|
+
config: {
|
|
107
|
+
apiKey: 'your-api-key',
|
|
108
|
+
botProviderEndpoint: 'https://api.asgard-ai.com/ns/{namespace}/bot-provider/{botProviderId}',
|
|
109
|
+
// SSE endpoint is automatically derived as: botProviderEndpoint + '/message/sse'
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Benefits:**
|
|
114
|
+
- Simplified configuration with single endpoint
|
|
115
|
+
- Reduced chance of configuration errors
|
|
116
|
+
- Automatic endpoint derivation
|
|
117
|
+
|
|
118
|
+
**Backward Compatibility:** Existing code using `endpoint` will continue to work but may show deprecation warnings when `debugMode` is enabled.
|
|
119
|
+
|
|
95
120
|
### Chatbot Component Props
|
|
96
121
|
|
|
97
122
|
- **title**: `string` - The title of the chatbot.
|
|
98
123
|
- **config**: `ClientConfig` - Configuration object for the Asgard service client, including:
|
|
99
124
|
- `apiKey`: `string` (required) - API key for authentication
|
|
100
|
-
- `
|
|
101
|
-
- `
|
|
125
|
+
- `botProviderEndpoint`: `string` (required) - Bot provider endpoint URL (SSE endpoint will be auto-derived)
|
|
126
|
+
- `endpoint?`: `string` (deprecated) - Legacy API endpoint URL. Use `botProviderEndpoint` instead.
|
|
102
127
|
- `transformSsePayload?`: `(payload: FetchSsePayload) => FetchSsePayload` - SSE payload transformer
|
|
103
128
|
- `debugMode?`: `boolean` - Enable debug mode, defaults to `false`
|
|
104
129
|
- `onRunInit?`: `InitEventHandler` - Handler for run initialization events
|
|
@@ -148,12 +173,22 @@ export interface AsgardThemeContextValue {
|
|
|
148
173
|
| 'borderRadius'
|
|
149
174
|
> & {
|
|
150
175
|
contentMaxWidth?: CSSProperties['maxWidth'];
|
|
176
|
+
backgroundColor?: CSSProperties['backgroundColor'];
|
|
177
|
+
borderColor?: CSSProperties['borderColor'];
|
|
178
|
+
inactiveColor?: CSSProperties['color'];
|
|
179
|
+
primaryComponent?: {
|
|
180
|
+
mainColor?: CSSProperties['color'];
|
|
181
|
+
secondaryColor?: CSSProperties['color'];
|
|
182
|
+
};
|
|
151
183
|
style?: CSSProperties;
|
|
152
184
|
header?: Partial<{
|
|
153
185
|
style: CSSProperties;
|
|
154
186
|
title: {
|
|
155
187
|
style: CSSProperties;
|
|
156
188
|
};
|
|
189
|
+
actionButton?: {
|
|
190
|
+
style: CSSProperties;
|
|
191
|
+
};
|
|
157
192
|
}>;
|
|
158
193
|
body?: Partial<{
|
|
159
194
|
style: CSSProperties;
|
|
@@ -162,6 +197,7 @@ export interface AsgardThemeContextValue {
|
|
|
162
197
|
style: CSSProperties;
|
|
163
198
|
textArea: {
|
|
164
199
|
style: CSSProperties;
|
|
200
|
+
'::placeholder': CSSProperties;
|
|
165
201
|
};
|
|
166
202
|
submitButton: {
|
|
167
203
|
style: CSSProperties;
|
|
@@ -184,12 +220,28 @@ export interface AsgardThemeContextValue {
|
|
|
184
220
|
style: CSSProperties;
|
|
185
221
|
};
|
|
186
222
|
}>;
|
|
223
|
+
time?: Partial<{
|
|
224
|
+
style: CSSProperties;
|
|
225
|
+
}>;
|
|
187
226
|
TextMessageTemplate: Partial<{ style: CSSProperties }>;
|
|
188
227
|
HintMessageTemplate: Partial<{ style: CSSProperties }>;
|
|
189
228
|
ImageMessageTemplate: Partial<{ style: CSSProperties }>;
|
|
190
229
|
ChartMessageTemplate: Partial<{ style: CSSProperties }>;
|
|
191
|
-
ButtonMessageTemplate: Partial<{
|
|
192
|
-
|
|
230
|
+
ButtonMessageTemplate: Partial<{
|
|
231
|
+
style: CSSProperties;
|
|
232
|
+
button?: {
|
|
233
|
+
style: CSSProperties;
|
|
234
|
+
};
|
|
235
|
+
}>;
|
|
236
|
+
CarouselMessageTemplate: Partial<{
|
|
237
|
+
style: CSSProperties;
|
|
238
|
+
card: {
|
|
239
|
+
style: CSSProperties;
|
|
240
|
+
button?: {
|
|
241
|
+
style: CSSProperties;
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
}>;
|
|
193
245
|
|
|
194
246
|
// Didn't implement yet
|
|
195
247
|
VideoMessageTemplate: Partial<{ style: CSSProperties }>;
|
|
@@ -218,6 +270,9 @@ const defaultTheme = {
|
|
|
218
270
|
title: {
|
|
219
271
|
style: {},
|
|
220
272
|
},
|
|
273
|
+
actionButton: {
|
|
274
|
+
style: {},
|
|
275
|
+
},
|
|
221
276
|
},
|
|
222
277
|
body: {
|
|
223
278
|
style: {},
|
|
@@ -226,6 +281,9 @@ const defaultTheme = {
|
|
|
226
281
|
style: {},
|
|
227
282
|
textArea: {
|
|
228
283
|
style: {},
|
|
284
|
+
'::placeholder': {
|
|
285
|
+
color: 'var(--asg-color-text-placeholder)',
|
|
286
|
+
},
|
|
229
287
|
},
|
|
230
288
|
submitButton: {
|
|
231
289
|
style: {},
|
|
@@ -250,6 +308,9 @@ const defaultTheme = {
|
|
|
250
308
|
style: {},
|
|
251
309
|
},
|
|
252
310
|
},
|
|
311
|
+
time: {
|
|
312
|
+
style: {},
|
|
313
|
+
},
|
|
253
314
|
TextMessageTemplate: {
|
|
254
315
|
style: {},
|
|
255
316
|
},
|
|
@@ -273,9 +334,22 @@ const defaultTheme = {
|
|
|
273
334
|
},
|
|
274
335
|
ButtonMessageTemplate: {
|
|
275
336
|
style: {},
|
|
337
|
+
button: {
|
|
338
|
+
style: {
|
|
339
|
+
border: '1px solid var(--asg-color-border)',
|
|
340
|
+
},
|
|
341
|
+
},
|
|
276
342
|
},
|
|
277
343
|
CarouselMessageTemplate: {
|
|
278
344
|
style: {},
|
|
345
|
+
card: {
|
|
346
|
+
style: {},
|
|
347
|
+
button: {
|
|
348
|
+
style: {
|
|
349
|
+
border: '1px solid var(--asg-color-border)',
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
},
|
|
279
353
|
},
|
|
280
354
|
},
|
|
281
355
|
};
|
|
@@ -312,6 +386,79 @@ const App = () => {
|
|
|
312
386
|
|
|
313
387
|
Note: When `fullScreen` prop is set to `true`, the chatbot's width and height will be set to `100vw` and `100vh` respectively, and `borderRadius` will be set to zero, regardless of theme settings.
|
|
314
388
|
|
|
389
|
+
## Testing
|
|
390
|
+
|
|
391
|
+
The React package includes comprehensive tests using Vitest and React Testing Library.
|
|
392
|
+
|
|
393
|
+
### Running Tests
|
|
394
|
+
|
|
395
|
+
```sh
|
|
396
|
+
# Run tests once
|
|
397
|
+
npm test
|
|
398
|
+
# or
|
|
399
|
+
yarn test:react
|
|
400
|
+
|
|
401
|
+
# Run tests in watch mode
|
|
402
|
+
npm run test:watch
|
|
403
|
+
# or
|
|
404
|
+
yarn test:react:watch
|
|
405
|
+
|
|
406
|
+
# Run tests with UI
|
|
407
|
+
npm run test:ui
|
|
408
|
+
# or
|
|
409
|
+
yarn test:react:ui
|
|
410
|
+
|
|
411
|
+
# Run tests with coverage
|
|
412
|
+
npm run test:coverage
|
|
413
|
+
# or
|
|
414
|
+
yarn test:react:coverage
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
### Test Structure
|
|
418
|
+
|
|
419
|
+
Tests are located alongside source files with `.spec.tsx` extensions:
|
|
420
|
+
- `src/components/chatbot/chatbot.spec.tsx` - React component tests
|
|
421
|
+
- Test environment: jsdom with React Testing Library
|
|
422
|
+
- Setup file: `src/test-setup.ts` (includes jest-dom)
|
|
423
|
+
- Coverage reports available in `test-output/vitest/coverage/`
|
|
424
|
+
|
|
425
|
+
### Writing Tests
|
|
426
|
+
|
|
427
|
+
The package uses Vitest for testing with the following setup:
|
|
428
|
+
- TypeScript support
|
|
429
|
+
- jsdom environment for DOM APIs
|
|
430
|
+
- React Testing Library for component testing
|
|
431
|
+
- jest-dom matchers for enhanced assertions
|
|
432
|
+
- ESLint integration
|
|
433
|
+
- Coverage reporting with v8 provider
|
|
434
|
+
|
|
435
|
+
Example test structure:
|
|
436
|
+
```javascript
|
|
437
|
+
import { describe, it, expect } from 'vitest';
|
|
438
|
+
import { render } from '@testing-library/react';
|
|
439
|
+
import '@testing-library/jest-dom';
|
|
440
|
+
import { Chatbot } from './chatbot';
|
|
441
|
+
|
|
442
|
+
describe('Chatbot Component', () => {
|
|
443
|
+
it('should render without crashing', () => {
|
|
444
|
+
const config = {
|
|
445
|
+
botProviderEndpoint: 'https://api.example.com/bot-provider/bp-123',
|
|
446
|
+
apiKey: 'test-key',
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
const { container } = render(
|
|
450
|
+
<Chatbot
|
|
451
|
+
title="Test Chatbot"
|
|
452
|
+
config={config}
|
|
453
|
+
customChannelId="test-channel"
|
|
454
|
+
/>
|
|
455
|
+
);
|
|
456
|
+
|
|
457
|
+
expect(container).toBeInTheDocument();
|
|
458
|
+
});
|
|
459
|
+
});
|
|
460
|
+
```
|
|
461
|
+
|
|
315
462
|
## Development
|
|
316
463
|
|
|
317
464
|
To develop the React package locally, follow these steps:
|
|
@@ -345,6 +492,14 @@ yarn watch:react
|
|
|
345
492
|
yarn serve:react-demo
|
|
346
493
|
```
|
|
347
494
|
|
|
495
|
+
Setup your npm release token:
|
|
496
|
+
|
|
497
|
+
```sh
|
|
498
|
+
cd ~/
|
|
499
|
+
touch .npmrc
|
|
500
|
+
echo "//registry.npmjs.org/:_authToken={{YOUR_TOKEN}}" >> .npmrc
|
|
501
|
+
```
|
|
502
|
+
|
|
348
503
|
For working with both core and React packages:
|
|
349
504
|
|
|
350
505
|
```sh
|
|
@@ -353,6 +508,7 @@ yarn lint:packages
|
|
|
353
508
|
|
|
354
509
|
# Build core package (required for React package)
|
|
355
510
|
yarn build:core
|
|
511
|
+
yarn build:react
|
|
356
512
|
|
|
357
513
|
# Release packages
|
|
358
514
|
yarn release:core # Release core package
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"chatbot-footer.d.ts","sourceRoot":"","sources":["../../../../src/components/chatbot/chatbot-footer/chatbot-footer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,SAAS,EAMV,MAAM,OAAO,CAAC;AAQf,wBAAgB,aAAa,IAAI,SAAS,CA0HzC"}
|
|
@@ -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;AAS3E,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,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,
|
|
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;AAS3E,UAAU,kBAAkB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,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,CAwElE"}
|
|
@@ -1 +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;AAOlC,UAAU,mBAAmB;IAC3B,OAAO,EAAE,sBAAsB,CAAC;CACjC;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,SAAS,
|
|
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;AAOlC,UAAU,mBAAmB;IAC3B,OAAO,EAAE,sBAAsB,CAAC;CACjC;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,SAAS,CAgCpE"}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { ButtonMessageTemplate, CarouselMessageTemplate } from '@asgard-js/core';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
2
|
+
import { ReactNode, CSSProperties } from 'react';
|
|
3
3
|
|
|
4
4
|
interface CardProps {
|
|
5
5
|
template: ButtonMessageTemplate | CarouselMessageTemplate['columns'][number];
|
|
6
|
+
customStyle?: {
|
|
7
|
+
style?: CSSProperties;
|
|
8
|
+
button?: {
|
|
9
|
+
style?: CSSProperties;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
6
12
|
}
|
|
7
13
|
export declare function Card(props: CardProps): ReactNode;
|
|
8
14
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/button-template/card.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
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;AAKzB,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,CA2FhD"}
|
|
@@ -1 +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;AAKzB,UAAU,qBAAqB;IAC7B,OAAO,EAAE,sBAAsB,CAAC;CACjC;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,SAAS,
|
|
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;AAKzB,UAAU,qBAAqB;IAC7B,OAAO,EAAE,sBAAsB,CAAC;CACjC;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,SAAS,CA8BxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chart-template.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/chart-template/chart-template.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"chart-template.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/chart-template/chart-template.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAoC,MAAM,OAAO,CAAC;AAGpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AASzD,UAAU,kBAAkB;IAC1B,OAAO,EAAE,sBAAsB,CAAC;CACjC;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,GAAG,SAAS,CA2DlE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/time/time.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../../../src/components/templates/time/time.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AAM3C,UAAU,SAAS;IACjB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CAsBhD"}
|
|
@@ -6,11 +6,32 @@ type AsyncInitializers = {
|
|
|
6
6
|
};
|
|
7
7
|
export interface Annotations {
|
|
8
8
|
embedConfig: {
|
|
9
|
+
avatar?: string;
|
|
10
|
+
botTypingPlaceholder?: string;
|
|
11
|
+
debugMode?: boolean;
|
|
12
|
+
fullScreen?: boolean;
|
|
13
|
+
inputPlaceholder?: string;
|
|
9
14
|
theme: {
|
|
10
|
-
chatbot:
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
chatbot: {
|
|
16
|
+
backgroundColor?: string;
|
|
17
|
+
borderColor?: string;
|
|
18
|
+
inactiveColor?: string;
|
|
19
|
+
primaryComponent?: {
|
|
20
|
+
mainColor?: string;
|
|
21
|
+
secondaryColor?: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
botMessage: {
|
|
25
|
+
backgroundColor?: string;
|
|
26
|
+
carouselButtonBackgroundColor?: string;
|
|
27
|
+
color?: string;
|
|
28
|
+
};
|
|
29
|
+
userMessage: {
|
|
30
|
+
backgroundColor?: string;
|
|
31
|
+
color?: string;
|
|
32
|
+
};
|
|
13
33
|
};
|
|
34
|
+
title?: string;
|
|
14
35
|
};
|
|
15
36
|
}
|
|
16
37
|
export interface AsgardAppInitializationContextValue {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asgard-app-initialization-context.d.ts","sourceRoot":"","sources":["../../src/context/asgard-app-initialization-context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAKZ,iBAAiB,EACjB,SAAS,EACV,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAM/C,KAAK,iBAAiB,GAAG;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CACvC,CAAC;AAEF,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE;QACX,KAAK,EAAE;YACL,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"asgard-app-initialization-context.d.ts","sourceRoot":"","sources":["../../src/context/asgard-app-initialization-context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAKZ,iBAAiB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,2CAA2C;IAC1D,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,YAAY,CAAC;IACrB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,gBAAgB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACpC;AAED,eAAO,MAAM,sCAAsC,UAC1C,iBAAiB,CAAC,2CAA2C,CAAC,KACpE,SA4EF,CAAC;AAEF,eAAO,MAAM,iCAAiC,QACxC,mCACwC,CAAC"}
|
|
@@ -3,12 +3,22 @@ import { CSSProperties, PropsWithChildren, ReactNode } from 'react';
|
|
|
3
3
|
export interface AsgardThemeContextValue {
|
|
4
4
|
chatbot: Pick<CSSProperties, 'width' | 'height' | 'maxWidth' | 'minWidth' | 'maxHeight' | 'minHeight' | 'backgroundColor' | 'borderColor' | 'borderRadius'> & {
|
|
5
5
|
contentMaxWidth?: CSSProperties['maxWidth'];
|
|
6
|
+
backgroundColor?: CSSProperties['backgroundColor'];
|
|
7
|
+
borderColor?: CSSProperties['borderColor'];
|
|
8
|
+
inactiveColor?: CSSProperties['color'];
|
|
9
|
+
primaryComponent?: {
|
|
10
|
+
mainColor?: CSSProperties['color'];
|
|
11
|
+
secondaryColor?: CSSProperties['color'];
|
|
12
|
+
};
|
|
6
13
|
style?: CSSProperties;
|
|
7
14
|
header?: Partial<{
|
|
8
15
|
style: CSSProperties;
|
|
9
16
|
title: {
|
|
10
17
|
style: CSSProperties;
|
|
11
18
|
};
|
|
19
|
+
actionButton?: {
|
|
20
|
+
style: CSSProperties;
|
|
21
|
+
};
|
|
12
22
|
}>;
|
|
13
23
|
body?: Partial<{
|
|
14
24
|
style: CSSProperties;
|
|
@@ -17,6 +27,7 @@ export interface AsgardThemeContextValue {
|
|
|
17
27
|
style: CSSProperties;
|
|
18
28
|
textArea: {
|
|
19
29
|
style: CSSProperties;
|
|
30
|
+
'::placeholder': CSSProperties;
|
|
20
31
|
};
|
|
21
32
|
submitButton: {
|
|
22
33
|
style: CSSProperties;
|
|
@@ -39,6 +50,9 @@ export interface AsgardThemeContextValue {
|
|
|
39
50
|
style: CSSProperties;
|
|
40
51
|
};
|
|
41
52
|
}>;
|
|
53
|
+
time?: Partial<{
|
|
54
|
+
style: CSSProperties;
|
|
55
|
+
}>;
|
|
42
56
|
/**
|
|
43
57
|
* TBD: Fill the necessary properties based on the requirements.
|
|
44
58
|
*/
|
|
@@ -86,12 +100,21 @@ export interface AsgardThemeContextValue {
|
|
|
86
100
|
*/
|
|
87
101
|
ButtonMessageTemplate: Partial<{
|
|
88
102
|
style: CSSProperties;
|
|
103
|
+
button?: {
|
|
104
|
+
style: CSSProperties;
|
|
105
|
+
};
|
|
89
106
|
}>;
|
|
90
107
|
/**
|
|
91
108
|
* TBD: Fill the necessary properties based on the requirements.
|
|
92
109
|
*/
|
|
93
110
|
CarouselMessageTemplate: Partial<{
|
|
94
111
|
style: CSSProperties;
|
|
112
|
+
card: {
|
|
113
|
+
style: CSSProperties;
|
|
114
|
+
button?: {
|
|
115
|
+
style: CSSProperties;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
95
118
|
}>;
|
|
96
119
|
}>;
|
|
97
120
|
}
|
|
@@ -1 +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,EAIV,MAAM,OAAO,CAAC;
|
|
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,EAIV,MAAM,OAAO,CAAC;AAOf,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,CACj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