forked from microsoft/BotFramework-WebChat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexports.ts
More file actions
123 lines (109 loc) · 4.64 KB
/
exports.ts
File metadata and controls
123 lines (109 loc) · 4.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
import Composer from '../FullComposer';
import ReactWebChat from '../FullReactWebChat';
import AdaptiveCardContent from '../adaptiveCards/Attachment/AdaptiveCardContent';
import AnimationCardContent from '../adaptiveCards/Attachment/AnimationCardContent';
import AudioCardContent from '../adaptiveCards/Attachment/AudioCardContent';
import HeroCardContent from '../adaptiveCards/Attachment/HeroCardContent';
import OAuthCardContent from '../adaptiveCards/Attachment/OAuthCardContent';
import ReceiptCardContent from '../adaptiveCards/Attachment/ReceiptCardContent';
import SignInCardContent from '../adaptiveCards/Attachment/SignInCardContent';
import ThumbnailCardContent from '../adaptiveCards/Attachment/ThumbnailCardContent';
import VideoCardContent from '../adaptiveCards/Attachment/VideoCardContent';
import createAdaptiveCardsAttachmentForScreenReaderMiddleware from '../adaptiveCards/createAdaptiveCardsAttachmentForScreenReaderMiddleware';
import createAdaptiveCardsAttachmentMiddleware from '../adaptiveCards/createAdaptiveCardsAttachmentMiddleware';
import useAdaptiveCardsHostConfig from '../adaptiveCards/hooks/useAdaptiveCardsHostConfig';
import useAdaptiveCardsPackage from '../adaptiveCards/hooks/useAdaptiveCardsPackage';
import createCognitiveServicesSpeechServicesPonyfillFactory from '../createCognitiveServicesSpeechServicesPonyfillFactory';
import defaultCreateDirectLine from '../createDirectLine';
import defaultCreateDirectLineAppServiceExtension from '../createDirectLineAppServiceExtension';
import createDirectLineSpeechAdapters from '../createDirectLineSpeechAdapters';
import createStyleSet from '../createFullStyleSet';
import useStyleOptions from '../hooks/useStyleOptions';
import useStyleSet from '../hooks/useStyleSet';
import {
Components as MinimalComponents,
hooks,
buildInfo as minimalBuildInfo,
version,
withEmoji
} from './exports-minimal';
import renderMarkdown from '../markdown/renderMarkdown';
import coreRenderWebChat from '../renderWebChat';
import { type AdaptiveCardsPackage } from '../types/AdaptiveCardsPackage';
import FullBundleStyleOptions, { StrictFullBundleStyleOptions } from '../types/FullBundleStyleOptions';
import createInterceptedFetch from '../createInterceptedFetch';
import createInterceptedWebSocket from '../createInterceptedWebSocket';
const renderWebChat = coreRenderWebChat.bind(null, ReactWebChat);
const buildInfo = Object.freeze({ ...minimalBuildInfo, variant: 'full' });
export {
concatMiddleware,
Constants,
createBrowserWebSpeechPonyfillFactory,
createStore,
createStoreWithDevTools,
createStoreWithOptions,
decorator,
internal,
testIds,
version
} from './exports-minimal';
export const createDirectLine = (options: Omit<Parameters<typeof defaultCreateDirectLine>[0], 'botAgent'>) => {
(options as any).botAgent &&
console.warn(
'Web Chat: Developers are not currently allowed to set botAgent. See https://github.com/microsoft/BotFramework-WebChat/issues/2119 for more details.'
);
return defaultCreateDirectLine({ ...options, botAgent: `WebChat/${version} (Full)` });
};
export const createDirectLineAppServiceExtension = (
options: Omit<Parameters<typeof defaultCreateDirectLineAppServiceExtension>[0], 'botAgent'>
) => {
(options as any).botAgent &&
console.warn(
'Web Chat: Developers are not currently allowed to set botAgent. See https://github.com/microsoft/BotFramework-WebChat/issues/2119 for more details.'
);
return defaultCreateDirectLineAppServiceExtension({ ...options, botAgent: `WebChat/${version} (Full)` });
};
const patchedHooks = Object.freeze({
...hooks,
useAdaptiveCardsHostConfig,
useAdaptiveCardsPackage,
useStyleOptions,
useStyleSet
});
const AdditionalComponents = Object.freeze({
AdaptiveCardContent,
AnimationCardContent,
AudioCardContent,
Composer,
HeroCardContent,
OAuthCardContent,
ReactWebChat,
ReceiptCardContent,
SignInCardContent,
ThumbnailCardContent,
VideoCardContent
});
const Components: Readonly<typeof MinimalComponents & typeof AdditionalComponents> = Object.freeze({
...MinimalComponents,
...AdditionalComponents
});
type StyleOptions = FullBundleStyleOptions;
type StrictStyleOptions = StrictFullBundleStyleOptions;
export default ReactWebChat;
export {
buildInfo,
Components,
createAdaptiveCardsAttachmentForScreenReaderMiddleware,
createAdaptiveCardsAttachmentMiddleware,
createCognitiveServicesSpeechServicesPonyfillFactory,
createDirectLineSpeechAdapters,
createInterceptedFetch,
createInterceptedWebSocket,
createStyleSet,
patchedHooks as hooks,
ReactWebChat,
renderMarkdown,
renderWebChat,
withEmoji
};
export type { AdaptiveCardsPackage, StrictStyleOptions, StyleOptions };