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.
Files changed (108) hide show
  1. package/.eslintrc.yml +5 -109
  2. package/.prettierrc.yml +1 -1
  3. package/README.md +1 -1
  4. package/lib/AddFullBundle.d.ts.map +1 -1
  5. package/lib/AddFullBundle.js +1 -2
  6. package/lib/FullComposer.d.ts.map +1 -1
  7. package/lib/FullComposer.js +3 -3
  8. package/lib/FullReactWebChat.js +2 -2
  9. package/lib/adaptiveCards/Attachment/AdaptiveCardAttachment.d.ts +1 -1
  10. package/lib/adaptiveCards/Attachment/AdaptiveCardAttachment.d.ts.map +1 -1
  11. package/lib/adaptiveCards/Attachment/AdaptiveCardAttachment.js +3 -1
  12. package/lib/adaptiveCards/Attachment/AdaptiveCardBuilder.d.ts +1 -1
  13. package/lib/adaptiveCards/Attachment/AdaptiveCardBuilder.d.ts.map +1 -1
  14. package/lib/adaptiveCards/Attachment/AdaptiveCardBuilder.js +10 -3
  15. package/lib/adaptiveCards/Attachment/AdaptiveCardContent.js +2 -2
  16. package/lib/adaptiveCards/Attachment/AdaptiveCardRenderer.d.ts +3 -2
  17. package/lib/adaptiveCards/Attachment/AdaptiveCardRenderer.d.ts.map +1 -1
  18. package/lib/adaptiveCards/Attachment/AdaptiveCardRenderer.js +138 -74
  19. package/lib/adaptiveCards/Attachment/AnimationCardContent.d.ts +1 -1
  20. package/lib/adaptiveCards/Attachment/AnimationCardContent.d.ts.map +1 -1
  21. package/lib/adaptiveCards/Attachment/AnimationCardContent.js +3 -1
  22. package/lib/adaptiveCards/Attachment/AudioCardContent.d.ts +1 -1
  23. package/lib/adaptiveCards/Attachment/AudioCardContent.d.ts.map +1 -1
  24. package/lib/adaptiveCards/Attachment/AudioCardContent.js +3 -1
  25. package/lib/adaptiveCards/Attachment/HeroCardContent.d.ts +1 -1
  26. package/lib/adaptiveCards/Attachment/HeroCardContent.d.ts.map +1 -1
  27. package/lib/adaptiveCards/Attachment/HeroCardContent.js +4 -2
  28. package/lib/adaptiveCards/Attachment/OAuthCardContent.d.ts +1 -1
  29. package/lib/adaptiveCards/Attachment/OAuthCardContent.d.ts.map +1 -1
  30. package/lib/adaptiveCards/Attachment/OAuthCardContent.js +3 -1
  31. package/lib/adaptiveCards/Attachment/ReceiptCardContent.d.ts +1 -1
  32. package/lib/adaptiveCards/Attachment/ReceiptCardContent.d.ts.map +1 -1
  33. package/lib/adaptiveCards/Attachment/ReceiptCardContent.js +3 -1
  34. package/lib/adaptiveCards/Attachment/SignInCardContent.d.ts +1 -1
  35. package/lib/adaptiveCards/Attachment/SignInCardContent.d.ts.map +1 -1
  36. package/lib/adaptiveCards/Attachment/SignInCardContent.js +1 -1
  37. package/lib/adaptiveCards/Attachment/ThumbnailCardContent.d.ts +1 -1
  38. package/lib/adaptiveCards/Attachment/ThumbnailCardContent.d.ts.map +1 -1
  39. package/lib/adaptiveCards/Attachment/ThumbnailCardContent.js +3 -1
  40. package/lib/adaptiveCards/Attachment/VideoCardContent.d.ts +1 -1
  41. package/lib/adaptiveCards/Attachment/VideoCardContent.d.ts.map +1 -1
  42. package/lib/adaptiveCards/Attachment/VideoCardContent.js +5 -3
  43. package/lib/adaptiveCards/Styles/StyleSet/AdaptiveCardRenderer.d.ts +3 -0
  44. package/lib/adaptiveCards/Styles/StyleSet/AdaptiveCardRenderer.d.ts.map +1 -1
  45. package/lib/adaptiveCards/Styles/StyleSet/AdaptiveCardRenderer.js +8 -1
  46. package/lib/adaptiveCards/Styles/adaptiveCardHostConfig.js +2 -2
  47. package/lib/adaptiveCards/Styles/createAdaptiveCardsStyleSet.js +2 -2
  48. package/lib/adaptiveCards/createAdaptiveCardsAttachmentMiddleware.d.ts.map +1 -1
  49. package/lib/adaptiveCards/createAdaptiveCardsAttachmentMiddleware.js +26 -29
  50. package/lib/adaptiveCards/normalizeStyleOptions.js +2 -2
  51. package/lib/addVersion.js +2 -2
  52. package/lib/createDirectLineSpeechAdapters.d.ts +1 -1
  53. package/lib/createDirectLineSpeechAdapters.d.ts.map +1 -1
  54. package/lib/createDirectLineSpeechAdapters.js +1 -1
  55. package/lib/createFullStyleSet.d.ts +325 -56
  56. package/lib/createFullStyleSet.d.ts.map +1 -1
  57. package/lib/createFullStyleSet.js +2 -2
  58. package/lib/fullBundleDefaultStyleOptions.js +2 -2
  59. package/lib/index-es5.d.ts +1 -21
  60. package/lib/index-es5.d.ts.map +1 -1
  61. package/lib/index-es5.js +4 -44
  62. package/lib/index-minimal.js +22 -20
  63. package/lib/index.d.ts +30 -8
  64. package/lib/index.d.ts.map +1 -1
  65. package/lib/index.js +11 -8
  66. package/lib/polyfill.d.ts +23 -0
  67. package/lib/polyfill.d.ts.map +1 -0
  68. package/lib/polyfill.js +46 -0
  69. package/lib/renderMarkdown.d.ts.map +1 -1
  70. package/lib/renderMarkdown.js +34 -6
  71. package/lib/speech/CustomAudioInputStream.d.ts.map +1 -1
  72. package/lib/speech/CustomAudioInputStream.js +40 -15
  73. package/lib/speech/bytesPerSample.d.ts.map +1 -1
  74. package/lib/speech/bytesPerSample.js +3 -1
  75. package/lib/speech/createAudioConfig.d.ts.map +1 -1
  76. package/lib/speech/createAudioConfig.js +9 -3
  77. package/lib/speech/createMicrophoneAudioConfigAndAudioContext.d.ts.map +1 -1
  78. package/lib/speech/createMicrophoneAudioConfigAndAudioContext.js +3 -1
  79. package/lib/speech/getUserMedia.d.ts.map +1 -1
  80. package/lib/speech/getUserMedia.js +5 -2
  81. package/package.json +43 -43
  82. package/src/AddFullBundle.tsx +0 -1
  83. package/src/FullComposer.tsx +2 -0
  84. package/src/adaptiveCards/Attachment/AdaptiveCardAttachment.tsx +3 -1
  85. package/src/adaptiveCards/Attachment/AdaptiveCardBuilder.ts +8 -3
  86. package/src/adaptiveCards/Attachment/AdaptiveCardRenderer.tsx +183 -89
  87. package/src/adaptiveCards/Attachment/AnimationCardContent.tsx +3 -1
  88. package/src/adaptiveCards/Attachment/AudioCardContent.tsx +3 -1
  89. package/src/adaptiveCards/Attachment/HeroCardContent.tsx +4 -2
  90. package/src/adaptiveCards/Attachment/OAuthCardContent.tsx +3 -1
  91. package/src/adaptiveCards/Attachment/ReceiptCardContent.tsx +28 -48
  92. package/src/adaptiveCards/Attachment/SignInCardContent.tsx +1 -1
  93. package/src/adaptiveCards/Attachment/ThumbnailCardContent.tsx +3 -1
  94. package/src/adaptiveCards/Attachment/VideoCardContent.tsx +5 -3
  95. package/src/adaptiveCards/Styles/StyleSet/AdaptiveCardRenderer.ts +8 -0
  96. package/src/adaptiveCards/createAdaptiveCardsAttachmentMiddleware.tsx +0 -1
  97. package/src/createCognitiveServicesSpeechServicesPonyfillFactory.spec.js +2 -3
  98. package/src/createDirectLineSpeechAdapters.ts +1 -1
  99. package/src/index-es5.ts +3 -26
  100. package/src/polyfill.ts +29 -0
  101. package/src/renderMarkdown.ts +40 -4
  102. package/src/speech/CustomAudioInputStream.ts +38 -7
  103. package/src/speech/bytesPerSample.ts +2 -0
  104. package/src/speech/createAudioConfig.spec.js +1 -1
  105. package/src/speech/createAudioConfig.ts +7 -0
  106. package/src/speech/createMicrophoneAudioConfigAndAudioContext.ts +2 -0
  107. package/src/speech/getUserMedia.ts +4 -1
  108. package/.eslintignore +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "botframework-webchat",
3
- "version": "4.14.1",
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.14.6",
36
- "adaptivecards": "2.9.0",
37
- "botframework-directlinejs": "0.15.0",
38
- "botframework-directlinespeech-sdk": "4.14.1",
39
- "botframework-webchat-api": "4.14.1",
40
- "botframework-webchat-component": "4.14.1",
41
- "botframework-webchat-core": "4.14.1",
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.15.2",
44
- "markdown-it": "12.1.0",
45
- "markdown-it-attrs": "4.0.0",
46
- "markdown-it-attrs-es5": "2.0.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": "5.2.1",
56
+ "memoize-one": "6.0.0",
50
57
  "microsoft-cognitiveservices-speech-sdk": "1.17.0",
51
- "prop-types": "15.7.2",
52
- "sanitize-html": "2.4.0",
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.14.5",
60
- "@babel/core": "^7.14.6",
61
- "@babel/plugin-proposal-class-properties": "^7.14.5",
62
- "@babel/plugin-proposal-object-rest-spread": "^7.14.7",
63
- "@babel/plugin-transform-runtime": "^7.14.5",
64
- "@babel/preset-env": "^7.14.7",
65
- "@babel/preset-react": "^7.14.5",
66
- "@babel/preset-typescript": "^7.14.5",
67
- "@types/node": "^16.3.1",
68
- "@types/react": "^17.0.14",
69
- "@typescript-eslint/eslint-plugin": "^4.28.3",
70
- "@typescript-eslint/parser": "^4.28.3",
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": "^6.2.0",
75
- "eslint": "^7.30.0",
76
- "eslint-plugin-prettier": "^3.4.0",
77
- "eslint-plugin-react": "^7.24.0",
78
- "eslint-plugin-react-hooks": "^4.2.0",
79
- "isomorphic-react": "4.14.1",
80
- "isomorphic-react-dom": "4.14.1",
81
- "prettier": "^2.3.2",
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": {
@@ -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,
@@ -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
- textblock[prop] = template[prop];
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
  });