botframework-webchat 4.13.0 → 4.14.2

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 (253) hide show
  1. package/.eslintignore +1 -9
  2. package/.eslintrc.yml +5 -0
  3. package/README.md +33 -36
  4. package/babel.config.json +2 -2
  5. package/babel.sanitize-html.config.json +10 -0
  6. package/lib/AddFullBundle.d.ts +30 -0
  7. package/lib/AddFullBundle.d.ts.map +1 -0
  8. package/lib/AddFullBundle.js +77 -0
  9. package/lib/FullComposer.d.ts +8 -0
  10. package/lib/FullComposer.d.ts.map +1 -0
  11. package/lib/FullComposer.js +6 -16
  12. package/lib/FullReactWebChat.d.ts +8 -0
  13. package/lib/FullReactWebChat.d.ts.map +1 -0
  14. package/lib/FullReactWebChat.js +8 -23
  15. package/lib/adaptiveCards/AdaptiveCardsComposer.d.ts +10 -0
  16. package/lib/adaptiveCards/AdaptiveCardsComposer.d.ts.map +1 -0
  17. package/lib/adaptiveCards/AdaptiveCardsComposer.js +6 -2
  18. package/lib/adaptiveCards/AdaptiveCardsContext.d.ts +8 -0
  19. package/lib/adaptiveCards/AdaptiveCardsContext.d.ts.map +1 -0
  20. package/lib/adaptiveCards/AdaptiveCardsContext.js +3 -3
  21. package/lib/adaptiveCards/AdaptiveCardsStyleOptions.d.ts +5 -3
  22. package/lib/adaptiveCards/AdaptiveCardsStyleOptions.d.ts.map +1 -1
  23. package/lib/adaptiveCards/AdaptiveCardsStyleSet.d.ts +7 -0
  24. package/lib/adaptiveCards/AdaptiveCardsStyleSet.d.ts.map +1 -0
  25. package/lib/{FullBundleStyleOptions.js → adaptiveCards/AdaptiveCardsStyleSet.js} +0 -0
  26. package/lib/adaptiveCards/Attachment/AdaptiveCardAttachment.d.ts +9 -0
  27. package/lib/adaptiveCards/Attachment/AdaptiveCardAttachment.d.ts.map +1 -0
  28. package/lib/adaptiveCards/Attachment/AdaptiveCardAttachment.js +1 -1
  29. package/lib/adaptiveCards/Attachment/AdaptiveCardBuilder.d.ts +28 -0
  30. package/lib/adaptiveCards/Attachment/AdaptiveCardBuilder.d.ts.map +1 -0
  31. package/lib/adaptiveCards/Attachment/AdaptiveCardBuilder.js +4 -4
  32. package/lib/adaptiveCards/Attachment/AdaptiveCardContent.d.ts +9 -0
  33. package/lib/adaptiveCards/Attachment/AdaptiveCardContent.d.ts.map +1 -0
  34. package/lib/adaptiveCards/Attachment/AdaptiveCardContent.js +8 -4
  35. package/lib/adaptiveCards/Attachment/AdaptiveCardRenderer.d.ts +11 -0
  36. package/lib/adaptiveCards/Attachment/AdaptiveCardRenderer.d.ts.map +1 -0
  37. package/lib/adaptiveCards/Attachment/AdaptiveCardRenderer.js +210 -49
  38. package/lib/adaptiveCards/Attachment/AnimationCardContent.d.ts +10 -0
  39. package/lib/adaptiveCards/Attachment/AnimationCardContent.d.ts.map +1 -0
  40. package/lib/adaptiveCards/Attachment/AnimationCardContent.js +1 -1
  41. package/lib/adaptiveCards/Attachment/AudioCardContent.d.ts +10 -0
  42. package/lib/adaptiveCards/Attachment/AudioCardContent.d.ts.map +1 -0
  43. package/lib/adaptiveCards/Attachment/AudioCardContent.js +1 -1
  44. package/lib/adaptiveCards/Attachment/CommonCard.js +11 -6
  45. package/lib/adaptiveCards/Attachment/HeroCardContent.d.ts +10 -0
  46. package/lib/adaptiveCards/Attachment/HeroCardContent.d.ts.map +1 -0
  47. package/lib/adaptiveCards/Attachment/HeroCardContent.js +11 -6
  48. package/lib/adaptiveCards/Attachment/OAuthCardContent.d.ts +10 -0
  49. package/lib/adaptiveCards/Attachment/OAuthCardContent.d.ts.map +1 -0
  50. package/lib/adaptiveCards/Attachment/OAuthCardContent.js +11 -6
  51. package/lib/adaptiveCards/Attachment/ReceiptCardContent.d.ts +10 -0
  52. package/lib/adaptiveCards/Attachment/ReceiptCardContent.d.ts.map +1 -0
  53. package/lib/adaptiveCards/Attachment/ReceiptCardContent.js +11 -6
  54. package/lib/adaptiveCards/Attachment/SignInCardContent.d.ts +10 -0
  55. package/lib/adaptiveCards/Attachment/SignInCardContent.d.ts.map +1 -0
  56. package/lib/adaptiveCards/Attachment/SignInCardContent.js +1 -1
  57. package/lib/adaptiveCards/Attachment/ThumbnailCardContent.d.ts +10 -0
  58. package/lib/adaptiveCards/Attachment/ThumbnailCardContent.d.ts.map +1 -0
  59. package/lib/adaptiveCards/Attachment/ThumbnailCardContent.js +11 -6
  60. package/lib/adaptiveCards/Attachment/VideoCardContent.d.ts +20 -0
  61. package/lib/adaptiveCards/Attachment/VideoCardContent.d.ts.map +1 -0
  62. package/lib/adaptiveCards/Attachment/VideoCardContent.js +7 -5
  63. package/lib/adaptiveCards/AttachmentForScreenReader/AdaptiveCardAttachment.js +7 -3
  64. package/lib/adaptiveCards/AttachmentForScreenReader/RichCardAttachment.js +1 -1
  65. package/lib/adaptiveCards/Styles/StyleSet/AdaptiveCardRenderer.d.ts +56 -0
  66. package/lib/adaptiveCards/Styles/StyleSet/AdaptiveCardRenderer.d.ts.map +1 -0
  67. package/lib/adaptiveCards/Styles/StyleSet/AdaptiveCardRenderer.js +1 -1
  68. package/lib/adaptiveCards/Styles/adaptiveCardHostConfig.d.ts +126 -0
  69. package/lib/adaptiveCards/Styles/adaptiveCardHostConfig.d.ts.map +1 -0
  70. package/lib/adaptiveCards/Styles/adaptiveCardHostConfig.js +29 -9
  71. package/lib/adaptiveCards/Styles/createAdaptiveCardsStyleSet.d.ts +5 -0
  72. package/lib/adaptiveCards/Styles/createAdaptiveCardsStyleSet.d.ts.map +1 -0
  73. package/lib/adaptiveCards/Styles/createAdaptiveCardsStyleSet.js +2 -2
  74. package/lib/adaptiveCards/createAdaptiveCardsAttachmentForScreenReaderMiddleware.d.ts +3 -0
  75. package/lib/adaptiveCards/createAdaptiveCardsAttachmentForScreenReaderMiddleware.d.ts.map +1 -0
  76. package/lib/adaptiveCards/createAdaptiveCardsAttachmentForScreenReaderMiddleware.js +5 -11
  77. package/lib/adaptiveCards/createAdaptiveCardsAttachmentMiddleware.d.ts +3 -0
  78. package/lib/adaptiveCards/createAdaptiveCardsAttachmentMiddleware.d.ts.map +1 -0
  79. package/lib/adaptiveCards/createAdaptiveCardsAttachmentMiddleware.js +29 -39
  80. package/lib/adaptiveCards/defaultStyleOptions.d.ts +4 -0
  81. package/lib/adaptiveCards/defaultStyleOptions.d.ts.map +1 -0
  82. package/lib/adaptiveCards/defaultStyleOptions.js +3 -2
  83. package/lib/adaptiveCards/hooks/internal/useAdaptiveCardsContext.d.ts +3 -0
  84. package/lib/adaptiveCards/hooks/internal/useAdaptiveCardsContext.d.ts.map +1 -0
  85. package/lib/adaptiveCards/hooks/internal/useAdaptiveCardsContext.js +1 -1
  86. package/lib/adaptiveCards/hooks/internal/useParseAdaptiveCardJSON.d.ts +2 -0
  87. package/lib/adaptiveCards/hooks/internal/useParseAdaptiveCardJSON.d.ts.map +1 -0
  88. package/lib/adaptiveCards/hooks/internal/useParseAdaptiveCardJSON.js +7 -5
  89. package/lib/adaptiveCards/hooks/internal/useUniqueId.js +1 -1
  90. package/lib/adaptiveCards/hooks/useAdaptiveCardsHostConfig.d.ts +2 -0
  91. package/lib/adaptiveCards/hooks/useAdaptiveCardsHostConfig.d.ts.map +1 -0
  92. package/lib/adaptiveCards/hooks/useAdaptiveCardsHostConfig.js +3 -5
  93. package/lib/adaptiveCards/hooks/useAdaptiveCardsPackage.d.ts +3 -0
  94. package/lib/adaptiveCards/hooks/useAdaptiveCardsPackage.d.ts.map +1 -0
  95. package/lib/adaptiveCards/hooks/useAdaptiveCardsPackage.js +1 -1
  96. package/lib/adaptiveCards/normalizeStyleOptions.d.ts +3 -0
  97. package/lib/adaptiveCards/normalizeStyleOptions.d.ts.map +1 -0
  98. package/lib/adaptiveCards/normalizeStyleOptions.js +1 -1
  99. package/lib/addVersion.js +2 -2
  100. package/lib/createBrowserWebSpeechPonyfillFactory.d.ts +3 -0
  101. package/lib/createBrowserWebSpeechPonyfillFactory.d.ts.map +1 -0
  102. package/lib/createBrowserWebSpeechPonyfillFactory.js +7 -4
  103. package/lib/createCognitiveServicesSpeechServicesPonyfillFactory.d.ts +17 -0
  104. package/lib/createCognitiveServicesSpeechServicesPonyfillFactory.d.ts.map +1 -0
  105. package/lib/createCognitiveServicesSpeechServicesPonyfillFactory.js +17 -11
  106. package/lib/createDirectLine.d.ts +17 -0
  107. package/lib/createDirectLine.d.ts.map +1 -0
  108. package/lib/createDirectLine.js +3 -2
  109. package/lib/createDirectLineAppServiceExtension.d.ts +7 -0
  110. package/lib/createDirectLineAppServiceExtension.d.ts.map +1 -0
  111. package/lib/createDirectLineAppServiceExtension.js +1 -1
  112. package/lib/createDirectLineSpeechAdapters.d.ts +25 -0
  113. package/lib/createDirectLineSpeechAdapters.d.ts.map +1 -0
  114. package/lib/createDirectLineSpeechAdapters.js +57 -3
  115. package/lib/createFullStyleSet.d.ts +1106 -0
  116. package/lib/createFullStyleSet.d.ts.map +1 -0
  117. package/lib/createFullStyleSet.js +2 -2
  118. package/lib/fullBundleDefaultStyleOptions.js +4 -4
  119. package/lib/hooks/useStyleOptions.d.ts +3 -0
  120. package/lib/hooks/useStyleOptions.d.ts.map +1 -0
  121. package/lib/hooks/useStyleOptions.js +21 -0
  122. package/lib/index-es5.d.ts +24 -20
  123. package/lib/index-es5.d.ts.map +1 -1
  124. package/lib/index-es5.js +2 -2
  125. package/lib/index-minimal.d.ts +9 -6
  126. package/lib/index-minimal.d.ts.map +1 -1
  127. package/lib/index-minimal.js +8 -4
  128. package/lib/index.d.ts +154 -18
  129. package/lib/index.d.ts.map +1 -1
  130. package/lib/index.js +11 -7
  131. package/lib/renderMarkdown.d.ts +6 -0
  132. package/lib/renderMarkdown.d.ts.map +1 -0
  133. package/lib/renderMarkdown.js +5 -2
  134. package/lib/renderWebChat.d.ts +3 -0
  135. package/lib/renderWebChat.d.ts.map +1 -0
  136. package/lib/renderWebChat.js +1 -1
  137. package/lib/speech/CustomAudioInputStream.d.ts +94 -0
  138. package/lib/speech/CustomAudioInputStream.d.ts.map +1 -0
  139. package/lib/speech/CustomAudioInputStream.js +416 -0
  140. package/lib/speech/bytesPerSample.d.ts +2 -0
  141. package/lib/speech/bytesPerSample.d.ts.map +1 -0
  142. package/lib/speech/bytesPerSample.js +12 -0
  143. package/lib/speech/createAudioConfig.d.ts +23 -0
  144. package/lib/speech/createAudioConfig.d.ts.map +1 -0
  145. package/lib/speech/createAudioConfig.js +84 -0
  146. package/lib/speech/createAudioContext.d.ts +3 -0
  147. package/lib/speech/createAudioContext.d.ts.map +1 -0
  148. package/lib/speech/createAudioContext.js +22 -0
  149. package/lib/speech/createMicrophoneAudioConfigAndAudioContext.d.ts +9 -0
  150. package/lib/speech/createMicrophoneAudioConfigAndAudioContext.d.ts.map +1 -0
  151. package/lib/speech/createMicrophoneAudioConfigAndAudioContext.js +161 -0
  152. package/lib/speech/getUserMedia.d.ts +2 -0
  153. package/lib/speech/getUserMedia.d.ts.map +1 -0
  154. package/lib/speech/getUserMedia.js +25 -0
  155. package/lib/types/AdaptiveCardsPackage.d.ts +13 -0
  156. package/lib/types/AdaptiveCardsPackage.d.ts.map +1 -0
  157. package/lib/types/AdaptiveCardsPackage.js +2 -0
  158. package/lib/types/CognitiveServicesAudioOutputFormat.d.ts +3 -0
  159. package/lib/types/CognitiveServicesAudioOutputFormat.d.ts.map +1 -0
  160. package/lib/types/CognitiveServicesAudioOutputFormat.js +2 -0
  161. package/lib/types/CognitiveServicesCredentials.d.ts +18 -0
  162. package/lib/types/CognitiveServicesCredentials.d.ts.map +1 -0
  163. package/lib/types/CognitiveServicesCredentials.js +2 -0
  164. package/lib/types/CognitiveServicesTextNormalization.d.ts +3 -0
  165. package/lib/types/CognitiveServicesTextNormalization.d.ts.map +1 -0
  166. package/lib/types/CognitiveServicesTextNormalization.js +2 -0
  167. package/lib/{FullBundleStyleOptions.d.ts → types/FullBundleStyleOptions.d.ts} +1 -1
  168. package/lib/types/FullBundleStyleOptions.d.ts.map +1 -0
  169. package/lib/types/FullBundleStyleOptions.js +2 -0
  170. package/lib/useComposerProps.d.ts +22 -0
  171. package/lib/useComposerProps.d.ts.map +1 -0
  172. package/lib/useComposerProps.js +6 -8
  173. package/package.json +51 -46
  174. package/src/AddFullBundle.tsx +94 -0
  175. package/src/FullComposer.tsx +38 -0
  176. package/src/FullReactWebChat.tsx +32 -0
  177. package/src/__tests__/createDirectLine.spec.js +2 -0
  178. package/src/__tests__/renderMarkdown.spec.js +1 -1
  179. package/src/__tests__/versionTag.es5.spec.js +3 -0
  180. package/src/__tests__/versionTag.full.spec.js +3 -0
  181. package/src/__tests__/versionTag.minimal.spec.js +3 -0
  182. package/src/adaptiveCards/{AdaptiveCardsComposer.js → AdaptiveCardsComposer.tsx} +17 -5
  183. package/src/adaptiveCards/AdaptiveCardsContext.ts +12 -0
  184. package/src/adaptiveCards/AdaptiveCardsStyleOptions.ts +5 -3
  185. package/src/adaptiveCards/AdaptiveCardsStyleSet.ts +7 -0
  186. package/src/adaptiveCards/Attachment/{AdaptiveCardAttachment.js → AdaptiveCardAttachment.tsx} +8 -2
  187. package/src/adaptiveCards/Attachment/AdaptiveCardBuilder.ts +21 -15
  188. package/src/adaptiveCards/Attachment/{AdaptiveCardContent.js → AdaptiveCardContent.tsx} +8 -2
  189. package/src/adaptiveCards/Attachment/{AdaptiveCardRenderer.js → AdaptiveCardRenderer.tsx} +228 -46
  190. package/src/adaptiveCards/Attachment/{AnimationCardContent.js → AnimationCardContent.tsx} +9 -2
  191. package/src/adaptiveCards/Attachment/{AudioCardContent.js → AudioCardContent.tsx} +9 -2
  192. package/src/adaptiveCards/Attachment/CommonCard.js +2 -1
  193. package/src/adaptiveCards/Attachment/{HeroCardContent.js → HeroCardContent.tsx} +12 -3
  194. package/src/adaptiveCards/Attachment/{OAuthCardContent.js → OAuthCardContent.tsx} +11 -3
  195. package/src/adaptiveCards/Attachment/{ReceiptCardContent.js → ReceiptCardContent.tsx} +58 -28
  196. package/src/adaptiveCards/Attachment/{SignInCardContent.js → SignInCardContent.tsx} +9 -2
  197. package/src/adaptiveCards/Attachment/{ThumbnailCardContent.js → ThumbnailCardContent.tsx} +12 -3
  198. package/src/adaptiveCards/Attachment/{VideoCardContent.js → VideoCardContent.tsx} +15 -3
  199. package/src/adaptiveCards/Styles/StyleSet/AdaptiveCardRenderer.ts +1 -1
  200. package/src/adaptiveCards/Styles/adaptiveCardHostConfig.ts +28 -8
  201. package/src/adaptiveCards/Styles/createAdaptiveCardsStyleSet.spec.js +2 -0
  202. package/src/adaptiveCards/Styles/createAdaptiveCardsStyleSet.ts +7 -4
  203. package/src/adaptiveCards/{createAdaptiveCardsAttachmentForScreenReaderMiddleware.js → createAdaptiveCardsAttachmentForScreenReaderMiddleware.tsx} +16 -15
  204. package/src/adaptiveCards/createAdaptiveCardsAttachmentMiddleware.tsx +45 -0
  205. package/src/adaptiveCards/defaultStyleOptions.ts +2 -1
  206. package/src/adaptiveCards/hooks/internal/{useAdaptiveCardsContext.js → useAdaptiveCardsContext.ts} +1 -1
  207. package/src/adaptiveCards/hooks/internal/{useParseAdaptiveCardJSON.js → useParseAdaptiveCardJSON.ts} +5 -2
  208. package/src/adaptiveCards/hooks/internal/{useUniqueId.js → useUniqueId.ts} +1 -1
  209. package/src/adaptiveCards/hooks/{useAdaptiveCardsHostConfig.js → useAdaptiveCardsHostConfig.ts} +6 -8
  210. package/src/adaptiveCards/hooks/{useAdaptiveCardsPackage.js → useAdaptiveCardsPackage.ts} +2 -1
  211. package/src/createBrowserWebSpeechPonyfillFactory.ts +21 -0
  212. package/src/createCognitiveServicesSpeechServicesPonyfillFactory.spec.js +37 -6
  213. package/src/createCognitiveServicesSpeechServicesPonyfillFactory.ts +78 -0
  214. package/src/createDirectLine.ts +65 -0
  215. package/src/createDirectLineAppServiceExtension.ts +22 -0
  216. package/src/createDirectLineSpeechAdapters.ts +84 -0
  217. package/src/createFullStyleSet.ts +2 -2
  218. package/src/fullBundleDefaultStyleOptions.ts +3 -3
  219. package/src/hooks/useStyleOptions.ts +9 -0
  220. package/src/index-es5.ts +0 -2
  221. package/src/index-minimal.ts +3 -2
  222. package/src/index.ts +22 -10
  223. package/src/{renderMarkdown.js → renderMarkdown.ts} +8 -1
  224. package/src/renderWebChat.tsx +6 -0
  225. package/src/speech/CustomAudioInputStream.ts +325 -0
  226. package/src/speech/bytesPerSample.ts +4 -0
  227. package/src/speech/createAudioConfig.spec.js +23 -0
  228. package/src/speech/createAudioConfig.ts +70 -0
  229. package/src/speech/createAudioContext.ts +16 -0
  230. package/src/speech/createMicrophoneAudioConfigAndAudioContext.ts +146 -0
  231. package/src/speech/getUserMedia.ts +14 -0
  232. package/src/tsconfig.json +1 -1
  233. package/src/types/AdaptiveCardsPackage.ts +23 -0
  234. package/src/types/CognitiveServicesAudioOutputFormat.ts +28 -0
  235. package/src/types/CognitiveServicesCredentials.ts +28 -0
  236. package/src/types/CognitiveServicesTextNormalization.ts +3 -0
  237. package/src/{FullBundleStyleOptions.ts → types/FullBundleStyleOptions.ts} +1 -1
  238. package/src/{useComposerProps.js → useComposerProps.ts} +21 -11
  239. package/webpack.config.js +46 -6
  240. package/lib/FullBundleStyleOptions.d.ts.map +0 -1
  241. package/src/FullComposer.js +0 -40
  242. package/src/FullReactWebChat.js +0 -47
  243. package/src/adaptiveCards/AdaptiveCardsContext.js +0 -5
  244. package/src/adaptiveCards/createAdaptiveCardsAttachmentMiddleware.js +0 -41
  245. package/src/createBrowserWebSpeechPonyfillFactory.js +0 -16
  246. package/src/createCognitiveServicesSpeechServicesPonyfillFactory.js +0 -58
  247. package/src/createDirectLine.js +0 -38
  248. package/src/createDirectLineAppServiceExtension.js +0 -12
  249. package/src/createDirectLineSpeechAdapters.js +0 -5
  250. package/src/index-es5.tsx +0 -49
  251. package/src/index-minimal.tsx +0 -9
  252. package/src/index.tsx +0 -45
  253. package/src/renderWebChat.js +0 -6
@@ -1,58 +0,0 @@
1
- import { AudioConfig } from 'microsoft-cognitiveservices-speech-sdk/distrib/lib/src/sdk/Audio/AudioConfig';
2
- import createPonyfill from 'web-speech-cognitive-services/lib/SpeechServices';
3
-
4
- export default function createCognitiveServicesSpeechServicesPonyfillFactory({
5
- audioConfig,
6
- audioContext,
7
- audioInputDeviceId,
8
- credentials,
9
- enableTelemetry,
10
- speechRecognitionEndpointId,
11
- speechSynthesisDeploymentId,
12
- speechSynthesisOutputFormat,
13
- textNormalization
14
- }) {
15
- if (!window.navigator.mediaDevices && !audioConfig) {
16
- console.warn(
17
- 'botframework-webchat: Your browser does not support Web Audio or the page is not loaded via HTTPS or localhost. Cognitive Services Speech Services is disabled. However, you may pass a custom AudioConfig to enable speech in this environment.'
18
- );
19
-
20
- return () => ({});
21
- }
22
-
23
- if (audioConfig && audioInputDeviceId) {
24
- console.warn(
25
- 'botframework-webchat: "audioConfig" and "audioInputDeviceId" cannot be set at the same time; ignoring "audioInputDeviceId".'
26
- );
27
- }
28
-
29
- // WORKAROUND: We should prevent AudioContext object from being recreated because they may be blessed and UX-wise expensive to recreate.
30
- // In Cognitive Services SDK, if they detect the "end" function is falsy, they will not call "end" but "suspend" instead.
31
- // And on next recognition, they will re-use the AudioContext object.
32
- if (!audioConfig) {
33
- audioConfig = audioInputDeviceId
34
- ? AudioConfig.fromMicrophoneInput(audioInputDeviceId)
35
- : AudioConfig.fromDefaultMicrophoneInput();
36
- }
37
-
38
- return ({ referenceGrammarID } = {}) => {
39
- const { SpeechGrammarList, SpeechRecognition, speechSynthesis, SpeechSynthesisUtterance } = createPonyfill({
40
- audioConfig,
41
- audioContext,
42
- credentials,
43
- enableTelemetry,
44
- referenceGrammars: referenceGrammarID ? [`luis/${referenceGrammarID}-PRODUCTION`] : [],
45
- speechRecognitionEndpointId,
46
- speechSynthesisDeploymentId,
47
- speechSynthesisOutputFormat,
48
- textNormalization
49
- });
50
-
51
- return {
52
- SpeechGrammarList,
53
- SpeechRecognition,
54
- speechSynthesis,
55
- SpeechSynthesisUtterance
56
- };
57
- };
58
- }
@@ -1,38 +0,0 @@
1
- import { DirectLine } from 'botframework-directlinejs';
2
-
3
- export default function createDirectLine({
4
- botAgent,
5
- conversationId,
6
- conversationStartProperties,
7
- domain,
8
- fetch,
9
- pollingInterval,
10
- secret,
11
- streamUrl,
12
- token,
13
- watermark,
14
- webSocket
15
- }) {
16
- return new DirectLine({
17
- botAgent,
18
- conversationId,
19
- conversationStartProperties,
20
- domain,
21
- fetch,
22
- pollingInterval,
23
- secret,
24
- streamUrl,
25
- token,
26
- watermark,
27
- webSocket,
28
- createFormData: attachments => {
29
- const formData = new FormData();
30
-
31
- attachments.forEach(({ contentType, data, filename, name }) => {
32
- formData.append(name, new Blob(data, { contentType }), filename);
33
- });
34
-
35
- return formData;
36
- }
37
- });
38
- }
@@ -1,12 +0,0 @@
1
- import { DirectLineStreaming } from 'botframework-directlinejs';
2
-
3
- export default function createDirectLineAppServiceExtension({ botAgent, conversationId, domain, token }) {
4
- return Promise.resolve(
5
- new DirectLineStreaming({
6
- botAgent,
7
- conversationId,
8
- domain,
9
- token
10
- })
11
- );
12
- }
@@ -1,5 +0,0 @@
1
- import { createAdapters } from 'botframework-directlinespeech-sdk';
2
-
3
- export default function createDirectLineSpeechAdapters(...args) {
4
- return createAdapters(...args);
5
- }
package/src/index-es5.tsx DELETED
@@ -1,49 +0,0 @@
1
- import { FC } from 'react';
2
- import {
3
- Components as ComponentsFromComponent,
4
- ComposerProps,
5
- ReactWebChatProps
6
- } from 'botframework-webchat-component';
7
-
8
- import StyleOptions from './FullBundleStyleOptions';
9
-
10
- type Replace<T1, T2> = Omit<T1, keyof T2> & T2;
11
-
12
- /** Creates a set of styles with support of Adaptive Cards */
13
- declare function createStyleSet(styleOptions: StyleOptions): any;
14
-
15
- declare const Components: Omit<typeof ComponentsFromComponent, 'Composer'> & {
16
- Composer: FC<
17
- Replace<
18
- ComposerProps,
19
- {
20
- /** Style options with support of Adaptive Cards */
21
- styleOptions?: StyleOptions;
22
- }
23
- >
24
- >;
25
- };
26
-
27
- /** React-based Web Chat with support of Adaptive Cards */
28
- declare const ReactWebChat: FC<
29
- Replace<
30
- ReactWebChatProps,
31
- {
32
- /** Style options with support of Adaptive Cards */
33
- styleOptions?: StyleOptions;
34
- }
35
- >
36
- >;
37
-
38
- export default ReactWebChat;
39
- export { Components, createStyleSet };
40
- export type { StyleOptions };
41
-
42
- // Doc:
43
- // - We don't want to export the whole index.ts, we just want to export what the user actually needed
44
- // - That's why we only exporting index.tsx (we cannot name it index.d.ts because TSC won't pick it up)
45
- // - Changing between full bundle and minimal should be very smooth
46
- // - That's why we name both StyleOptions the same
47
- // - To use minimal, import 'botframework-webchat/lib/index-minimal';
48
- // - Declarations need to be emitted to /lib/*.d.ts for code-splitting purpose
49
- // - import 'botframework-webchat/lib/index-minimal' should see IntelliSense support
@@ -1,9 +0,0 @@
1
- import { StyleOptions } from 'botframework-webchat-api';
2
- import ReactWebChat, { Components } from 'botframework-webchat-component';
3
-
4
- /** Creates a set of styles */
5
- declare function createStyleSet(styleOptions: StyleOptions): any;
6
-
7
- export default ReactWebChat;
8
- export { Components, createStyleSet };
9
- export type { StyleOptions };
package/src/index.tsx DELETED
@@ -1,45 +0,0 @@
1
- import { FC } from 'react';
2
- import { ComposerProps, ReactWebChatProps } from 'botframework-webchat-component';
3
-
4
- import StyleOptions from './FullBundleStyleOptions';
5
-
6
- type Replace<T1, T2> = Omit<T1, keyof T2> & T2;
7
-
8
- /** Creates a set of styles with support of Adaptive Cards */
9
- declare function createStyleSet(styleOptions: StyleOptions): any;
10
-
11
- declare const Components: {
12
- Composer: FC<
13
- Replace<
14
- ComposerProps,
15
- {
16
- /** Style options with support of Adaptive Cards */
17
- styleOptions?: StyleOptions;
18
- }
19
- >
20
- >;
21
- };
22
-
23
- /** React-based Web Chat with support of Adaptive Cards */
24
- declare const ReactWebChat: FC<
25
- Replace<
26
- ReactWebChatProps,
27
- {
28
- /** Style options with support of Adaptive Cards */
29
- styleOptions?: StyleOptions;
30
- }
31
- >
32
- >;
33
-
34
- export default ReactWebChat;
35
- export { Components, createStyleSet };
36
- export type { StyleOptions };
37
-
38
- // Doc:
39
- // - We don't want to export the whole index.ts, we just want to export what the user actually needed
40
- // - That's why we only exporting index.tsx (we cannot name it index.d.ts because TSC won't pick it up)
41
- // - Changing between full bundle and minimal should be very smooth
42
- // - That's why we name both StyleOptions the same
43
- // - To use minimal, import 'botframework-webchat/lib/index-minimal';
44
- // - Declarations need to be emitted to /lib/*.d.ts for code-splitting purpose
45
- // - import 'botframework-webchat/lib/index-minimal' should see IntelliSense support
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- import ReactDOM from 'react-dom';
3
-
4
- export default function renderWebChat(ReactWebChat, props, element) {
5
- ReactDOM.render(<ReactWebChat {...props} />, element);
6
- }