botframework-webchat 4.14.1 → 4.15.2-main.20220413.af6e8a3
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/.eslintrc.yml +5 -109
- package/.prettierrc.yml +1 -1
- package/README.md +1 -1
- package/lib/AddFullBundle.d.ts.map +1 -1
- package/lib/AddFullBundle.js +1 -2
- package/lib/FullComposer.d.ts.map +1 -1
- package/lib/FullComposer.js +3 -3
- package/lib/FullReactWebChat.js +2 -2
- package/lib/adaptiveCards/Attachment/AdaptiveCardAttachment.d.ts +1 -1
- package/lib/adaptiveCards/Attachment/AdaptiveCardAttachment.d.ts.map +1 -1
- package/lib/adaptiveCards/Attachment/AdaptiveCardAttachment.js +3 -1
- package/lib/adaptiveCards/Attachment/AdaptiveCardBuilder.d.ts +1 -1
- package/lib/adaptiveCards/Attachment/AdaptiveCardBuilder.d.ts.map +1 -1
- package/lib/adaptiveCards/Attachment/AdaptiveCardBuilder.js +10 -3
- package/lib/adaptiveCards/Attachment/AdaptiveCardContent.js +2 -2
- package/lib/adaptiveCards/Attachment/AdaptiveCardRenderer.d.ts +3 -2
- package/lib/adaptiveCards/Attachment/AdaptiveCardRenderer.d.ts.map +1 -1
- package/lib/adaptiveCards/Attachment/AdaptiveCardRenderer.js +138 -74
- package/lib/adaptiveCards/Attachment/AnimationCardContent.d.ts +1 -1
- package/lib/adaptiveCards/Attachment/AnimationCardContent.d.ts.map +1 -1
- package/lib/adaptiveCards/Attachment/AnimationCardContent.js +3 -1
- package/lib/adaptiveCards/Attachment/AudioCardContent.d.ts +1 -1
- package/lib/adaptiveCards/Attachment/AudioCardContent.d.ts.map +1 -1
- package/lib/adaptiveCards/Attachment/AudioCardContent.js +3 -1
- package/lib/adaptiveCards/Attachment/HeroCardContent.d.ts +1 -1
- package/lib/adaptiveCards/Attachment/HeroCardContent.d.ts.map +1 -1
- package/lib/adaptiveCards/Attachment/HeroCardContent.js +4 -2
- package/lib/adaptiveCards/Attachment/OAuthCardContent.d.ts +1 -1
- package/lib/adaptiveCards/Attachment/OAuthCardContent.d.ts.map +1 -1
- package/lib/adaptiveCards/Attachment/OAuthCardContent.js +3 -1
- package/lib/adaptiveCards/Attachment/ReceiptCardContent.d.ts +1 -1
- package/lib/adaptiveCards/Attachment/ReceiptCardContent.d.ts.map +1 -1
- package/lib/adaptiveCards/Attachment/ReceiptCardContent.js +3 -1
- package/lib/adaptiveCards/Attachment/SignInCardContent.d.ts +1 -1
- package/lib/adaptiveCards/Attachment/SignInCardContent.d.ts.map +1 -1
- package/lib/adaptiveCards/Attachment/SignInCardContent.js +1 -1
- package/lib/adaptiveCards/Attachment/ThumbnailCardContent.d.ts +1 -1
- package/lib/adaptiveCards/Attachment/ThumbnailCardContent.d.ts.map +1 -1
- package/lib/adaptiveCards/Attachment/ThumbnailCardContent.js +3 -1
- package/lib/adaptiveCards/Attachment/VideoCardContent.d.ts +1 -1
- package/lib/adaptiveCards/Attachment/VideoCardContent.d.ts.map +1 -1
- package/lib/adaptiveCards/Attachment/VideoCardContent.js +5 -3
- package/lib/adaptiveCards/Styles/StyleSet/AdaptiveCardRenderer.d.ts +3 -0
- package/lib/adaptiveCards/Styles/StyleSet/AdaptiveCardRenderer.d.ts.map +1 -1
- package/lib/adaptiveCards/Styles/StyleSet/AdaptiveCardRenderer.js +8 -1
- package/lib/adaptiveCards/Styles/adaptiveCardHostConfig.js +2 -2
- package/lib/adaptiveCards/Styles/createAdaptiveCardsStyleSet.js +2 -2
- package/lib/adaptiveCards/createAdaptiveCardsAttachmentMiddleware.d.ts.map +1 -1
- package/lib/adaptiveCards/createAdaptiveCardsAttachmentMiddleware.js +26 -29
- package/lib/adaptiveCards/normalizeStyleOptions.js +2 -2
- package/lib/addVersion.js +2 -2
- package/lib/createDirectLineSpeechAdapters.d.ts +1 -1
- package/lib/createDirectLineSpeechAdapters.d.ts.map +1 -1
- package/lib/createDirectLineSpeechAdapters.js +1 -1
- package/lib/createFullStyleSet.d.ts +325 -56
- package/lib/createFullStyleSet.d.ts.map +1 -1
- package/lib/createFullStyleSet.js +2 -2
- package/lib/fullBundleDefaultStyleOptions.js +2 -2
- package/lib/index-es5.d.ts +1 -21
- package/lib/index-es5.d.ts.map +1 -1
- package/lib/index-es5.js +4 -44
- package/lib/index-minimal.js +22 -20
- package/lib/index.d.ts +30 -8
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +11 -8
- package/lib/polyfill.d.ts +23 -0
- package/lib/polyfill.d.ts.map +1 -0
- package/lib/polyfill.js +46 -0
- package/lib/renderMarkdown.d.ts.map +1 -1
- package/lib/renderMarkdown.js +34 -6
- package/lib/speech/CustomAudioInputStream.d.ts.map +1 -1
- package/lib/speech/CustomAudioInputStream.js +40 -15
- package/lib/speech/bytesPerSample.d.ts.map +1 -1
- package/lib/speech/bytesPerSample.js +3 -1
- package/lib/speech/createAudioConfig.d.ts.map +1 -1
- package/lib/speech/createAudioConfig.js +9 -3
- package/lib/speech/createMicrophoneAudioConfigAndAudioContext.d.ts.map +1 -1
- package/lib/speech/createMicrophoneAudioConfigAndAudioContext.js +3 -1
- package/lib/speech/getUserMedia.d.ts.map +1 -1
- package/lib/speech/getUserMedia.js +5 -2
- package/package.json +43 -43
- package/src/AddFullBundle.tsx +0 -1
- package/src/FullComposer.tsx +2 -0
- package/src/adaptiveCards/Attachment/AdaptiveCardAttachment.tsx +3 -1
- package/src/adaptiveCards/Attachment/AdaptiveCardBuilder.ts +8 -3
- package/src/adaptiveCards/Attachment/AdaptiveCardRenderer.tsx +183 -89
- package/src/adaptiveCards/Attachment/AnimationCardContent.tsx +3 -1
- package/src/adaptiveCards/Attachment/AudioCardContent.tsx +3 -1
- package/src/adaptiveCards/Attachment/HeroCardContent.tsx +4 -2
- package/src/adaptiveCards/Attachment/OAuthCardContent.tsx +3 -1
- package/src/adaptiveCards/Attachment/ReceiptCardContent.tsx +28 -48
- package/src/adaptiveCards/Attachment/SignInCardContent.tsx +1 -1
- package/src/adaptiveCards/Attachment/ThumbnailCardContent.tsx +3 -1
- package/src/adaptiveCards/Attachment/VideoCardContent.tsx +5 -3
- package/src/adaptiveCards/Styles/StyleSet/AdaptiveCardRenderer.ts +8 -0
- package/src/adaptiveCards/createAdaptiveCardsAttachmentMiddleware.tsx +0 -1
- package/src/createCognitiveServicesSpeechServicesPonyfillFactory.spec.js +2 -3
- package/src/createDirectLineSpeechAdapters.ts +1 -1
- package/src/index-es5.ts +3 -26
- package/src/polyfill.ts +29 -0
- package/src/renderMarkdown.ts +40 -4
- package/src/speech/CustomAudioInputStream.ts +38 -7
- package/src/speech/bytesPerSample.ts +2 -0
- package/src/speech/createAudioConfig.spec.js +1 -1
- package/src/speech/createAudioConfig.ts +7 -0
- package/src/speech/createMicrophoneAudioConfigAndAudioContext.ts +2 -0
- package/src/speech/getUserMedia.ts +4 -1
- package/.eslintignore +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "botframework-webchat",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.15.2-main.20220413.af6e8a3",
|
|
4
4
|
"description": "A highly-customizable web-based chat client for Azure Bot Services.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -22,68 +22,68 @@
|
|
|
22
22
|
"build:babel": "babel src --extensions .js,.ts,.tsx --ignore **/*.spec.js,**/*.spec.ts,**/*.spec.tsx,**/*.test.js,**/*.test.ts,**/*.test.tsx,__tests__/**/*.js,__tests__/**/*.ts,__tests__/**/*.tsx --out-dir lib --verbose",
|
|
23
23
|
"build:typescript": "tsc --project src/tsconfig.json",
|
|
24
24
|
"build:webpack": "webpack-cli",
|
|
25
|
+
"bump": "npm run bump:prod && npm run bump:dev",
|
|
26
|
+
"bump:dev": "npm install $(cat package.json | jq -r '(.devDependencies | keys) - .skipBump | .[]' | awk '{print $1 \"@latest\"}')",
|
|
27
|
+
"bump:prod": "npm install --save-exact $(cat package.json | jq -r '(.dependencies | keys) - .skipBump | .[]' | awk '{print $1 \"@latest\"}')",
|
|
25
28
|
"eslint": "npm run precommit",
|
|
26
29
|
"precommit": "npm run precommit:eslint -- src && npm run precommit:typecheck",
|
|
27
|
-
"precommit:eslint": "eslint",
|
|
30
|
+
"precommit:eslint": "../../node_modules/.bin/eslint --report-unused-disable-directives --max-warnings 0",
|
|
28
31
|
"precommit:typecheck": "tsc --project ./src --emitDeclarationOnly false --esModuleInterop true --noEmit --pretty false",
|
|
29
32
|
"start": "concurrently --kill-others --names \"babel,tsc,webpack\" \"npm run start:babel\" \"npm run start:typescript\" \"npm run start:webpack\"",
|
|
30
33
|
"start:babel": "npm run build:babel -- --skip-initial-build --watch",
|
|
31
34
|
"start:typescript": "npm run build:typescript -- --watch",
|
|
32
35
|
"start:webpack": "npm run build:webpack -- --watch"
|
|
33
36
|
},
|
|
37
|
+
"skipBump": [
|
|
38
|
+
"adaptivecards",
|
|
39
|
+
"microsoft-cognitiveservices-speech-sdk"
|
|
40
|
+
],
|
|
34
41
|
"dependencies": {
|
|
35
|
-
"@babel/runtime": "7.
|
|
36
|
-
"adaptivecards": "2.
|
|
37
|
-
"botframework-directlinejs": "0.15.
|
|
38
|
-
"botframework-directlinespeech-sdk": "4.
|
|
39
|
-
"botframework-webchat-api": "4.
|
|
40
|
-
"botframework-webchat-component": "4.
|
|
41
|
-
"botframework-webchat-core": "4.
|
|
42
|
+
"@babel/runtime": "7.17.2",
|
|
43
|
+
"adaptivecards": "2.10.0",
|
|
44
|
+
"botframework-directlinejs": "0.15.1",
|
|
45
|
+
"botframework-directlinespeech-sdk": "4.15.2-main.20220413.af6e8a3",
|
|
46
|
+
"botframework-webchat-api": "4.15.2-main.20220413.af6e8a3",
|
|
47
|
+
"botframework-webchat-component": "4.15.2-main.20220413.af6e8a3",
|
|
48
|
+
"botframework-webchat-core": "4.15.2-main.20220413.af6e8a3",
|
|
42
49
|
"classnames": "2.3.1",
|
|
43
|
-
"core-js": "3.
|
|
44
|
-
"markdown-it": "12.
|
|
45
|
-
"markdown-it-attrs": "4.
|
|
46
|
-
"markdown-it-attrs-es5": "2.0.
|
|
50
|
+
"core-js": "3.21.1",
|
|
51
|
+
"markdown-it": "12.3.2",
|
|
52
|
+
"markdown-it-attrs": "4.1.3",
|
|
53
|
+
"markdown-it-attrs-es5": "2.0.2",
|
|
47
54
|
"markdown-it-for-inline": "0.1.1",
|
|
48
55
|
"math-random": "2.0.1",
|
|
49
|
-
"memoize-one": "
|
|
56
|
+
"memoize-one": "6.0.0",
|
|
50
57
|
"microsoft-cognitiveservices-speech-sdk": "1.17.0",
|
|
51
|
-
"prop-types": "15.
|
|
52
|
-
"sanitize-html": "2.
|
|
58
|
+
"prop-types": "15.8.1",
|
|
59
|
+
"sanitize-html": "2.7.0",
|
|
53
60
|
"url-search-params-polyfill": "8.1.1",
|
|
54
61
|
"uuid": "8.3.2",
|
|
55
62
|
"web-speech-cognitive-services": "7.1.1",
|
|
56
63
|
"whatwg-fetch": "3.6.2"
|
|
57
64
|
},
|
|
58
65
|
"devDependencies": {
|
|
59
|
-
"@babel/cli": "^7.
|
|
60
|
-
"@babel/core": "^7.
|
|
61
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
62
|
-
"@babel/plugin-proposal-object-rest-spread": "^7.
|
|
63
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
64
|
-
"@babel/preset-env": "^7.
|
|
65
|
-
"@babel/preset-react": "^7.
|
|
66
|
-
"@babel/preset-typescript": "^7.
|
|
67
|
-
"@types/node": "^
|
|
68
|
-
"@types/react": "^17.0.
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"babel-loader": "^8.2.2",
|
|
72
|
-
"babel-plugin-istanbul": "^6.0.0",
|
|
66
|
+
"@babel/cli": "^7.17.6",
|
|
67
|
+
"@babel/core": "^7.17.5",
|
|
68
|
+
"@babel/plugin-proposal-class-properties": "^7.16.7",
|
|
69
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.17.3",
|
|
70
|
+
"@babel/plugin-transform-runtime": "^7.17.0",
|
|
71
|
+
"@babel/preset-env": "^7.16.11",
|
|
72
|
+
"@babel/preset-react": "^7.16.7",
|
|
73
|
+
"@babel/preset-typescript": "^7.16.7",
|
|
74
|
+
"@types/node": "^17.0.21",
|
|
75
|
+
"@types/react": "^17.0.39",
|
|
76
|
+
"babel-loader": "^8.2.3",
|
|
77
|
+
"babel-plugin-istanbul": "^6.1.1",
|
|
73
78
|
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
|
|
74
|
-
"concurrently": "^
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"source-map-loader": "^1.1.3",
|
|
83
|
-
"terser-webpack-plugin": "^4.2.3",
|
|
84
|
-
"typescript": "^4.3.5",
|
|
85
|
-
"webpack": "^5.45.1",
|
|
86
|
-
"webpack-cli": "^4.6.0",
|
|
79
|
+
"concurrently": "^7.0.0",
|
|
80
|
+
"isomorphic-react": "4.15.2-main.20220413.af6e8a3",
|
|
81
|
+
"isomorphic-react-dom": "4.15.2-main.20220413.af6e8a3",
|
|
82
|
+
"source-map-loader": "^3.0.1",
|
|
83
|
+
"terser-webpack-plugin": "^5.3.1",
|
|
84
|
+
"typescript": "^4.6.2",
|
|
85
|
+
"webpack": "^5.70.0",
|
|
86
|
+
"webpack-cli": "^4.9.2",
|
|
87
87
|
"webpack-stats-plugin": "^1.0.3"
|
|
88
88
|
},
|
|
89
89
|
"peerDependencies": {
|
package/src/AddFullBundle.tsx
CHANGED
|
@@ -73,7 +73,6 @@ AddFullBundle.propTypes = {
|
|
|
73
73
|
adaptiveCardHostConfig: PropTypes.any,
|
|
74
74
|
adaptiveCardsHostConfig: PropTypes.any,
|
|
75
75
|
// TypeScript class is not mappable to PropTypes.func
|
|
76
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
77
76
|
// @ts-ignore
|
|
78
77
|
adaptiveCardsPackage: PropTypes.shape({
|
|
79
78
|
AdaptiveCard: PropTypes.func.isRequired,
|
package/src/FullComposer.tsx
CHANGED
|
@@ -13,6 +13,8 @@ const FullComposer: FC<FullComposerProps> = props => (
|
|
|
13
13
|
<AddFullBundle {...props}>
|
|
14
14
|
{extraProps => (
|
|
15
15
|
<Composer {...props} {...extraProps}>
|
|
16
|
+
{/* We need to spread, thus, we cannot we destructuring assignment. */}
|
|
17
|
+
{/* eslint-disable-next-line react/destructuring-assignment */}
|
|
16
18
|
{props.children}
|
|
17
19
|
</Composer>
|
|
18
20
|
)}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DirectLineAttachment } from 'botframework-webchat-core';
|
|
2
1
|
import PropTypes from 'prop-types';
|
|
3
2
|
import React, { FC } from 'react';
|
|
3
|
+
import type { DirectLineAttachment } from 'botframework-webchat-core';
|
|
4
4
|
|
|
5
5
|
import AdaptiveCardContent from './AdaptiveCardContent';
|
|
6
6
|
|
|
@@ -20,6 +20,8 @@ AdaptiveCardAttachment.defaultProps = {
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
AdaptiveCardAttachment.propTypes = {
|
|
23
|
+
// PropTypes cannot fully capture TypeScript types.
|
|
24
|
+
// @ts-ignore
|
|
23
25
|
attachment: PropTypes.shape({
|
|
24
26
|
content: PropTypes.any.isRequired
|
|
25
27
|
}).isRequired,
|
|
@@ -15,8 +15,9 @@ import {
|
|
|
15
15
|
TextSize,
|
|
16
16
|
TextWeight
|
|
17
17
|
} from 'adaptivecards';
|
|
18
|
+
import { isForbiddenPropertyName } from 'botframework-webchat-core';
|
|
19
|
+
import type { DirectLineCardAction } from 'botframework-webchat-core';
|
|
18
20
|
|
|
19
|
-
import { DirectLineCardAction } from 'botframework-webchat-core';
|
|
20
21
|
import AdaptiveCardsPackage from '../../types/AdaptiveCardsPackage';
|
|
21
22
|
import AdaptiveCardsStyleOptions from '../AdaptiveCardsStyleOptions';
|
|
22
23
|
|
|
@@ -96,9 +97,12 @@ export default class AdaptiveCardBuilder {
|
|
|
96
97
|
if (typeof text !== 'undefined') {
|
|
97
98
|
const textblock = new TextBlock();
|
|
98
99
|
|
|
99
|
-
// tslint:disable-next-line:forin
|
|
100
100
|
for (const prop in template) {
|
|
101
|
-
|
|
101
|
+
if (!isForbiddenPropertyName(prop)) {
|
|
102
|
+
// Mitigated through denylisting.
|
|
103
|
+
// eslint-disable-next-line security/detect-object-injection
|
|
104
|
+
textblock[prop] = template[prop];
|
|
105
|
+
}
|
|
102
106
|
}
|
|
103
107
|
|
|
104
108
|
textblock.text = text;
|
|
@@ -119,6 +123,7 @@ export default class AdaptiveCardBuilder {
|
|
|
119
123
|
this.addTextBlock(content.title, {
|
|
120
124
|
color: TextColor.Default,
|
|
121
125
|
size: TextSize.Medium,
|
|
126
|
+
style: 'heading',
|
|
122
127
|
weight: TextWeight.Bolder,
|
|
123
128
|
wrap: richCardWrapTitle
|
|
124
129
|
});
|