botframework-webchat 4.15.8-main.20230331.0e770c8 → 4.15.8-main.20230412.960a5a5
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/dist/webchat-es5.js +1 -1
- package/dist/webchat-minimal.js +1 -1
- package/dist/webchat.js +1 -1
- package/lib/adaptiveCards/Attachment/AdaptiveCardHacks/useRoleModEffect.d.ts +28 -0
- package/lib/adaptiveCards/Attachment/AdaptiveCardHacks/useRoleModEffect.d.ts.map +1 -0
- package/lib/adaptiveCards/Attachment/AdaptiveCardHacks/useRoleModEffect.js +50 -0
- package/lib/adaptiveCards/Attachment/AdaptiveCardRenderer.d.ts.map +1 -1
- package/lib/adaptiveCards/Attachment/AdaptiveCardRenderer.js +12 -3
- package/lib/adaptiveCards/AttachmentForScreenReader/AdaptiveCardAttachment.js +16 -13
- package/lib/adaptiveCards/Styles/StyleSet/AdaptiveCardRenderer.js +5 -5
- package/lib/adaptiveCards/defaultStyleOptions.js +2 -2
- package/lib/addVersion.js +1 -1
- package/package.json +7 -7
- package/src/adaptiveCards/Attachment/AdaptiveCardHacks/useRoleModEffect.ts +52 -0
- package/src/adaptiveCards/Attachment/AdaptiveCardRenderer.tsx +7 -1
- package/src/adaptiveCards/AttachmentForScreenReader/AdaptiveCardAttachment.js +23 -13
- package/src/adaptiveCards/Styles/StyleSet/AdaptiveCardRenderer.ts +4 -4
- package/src/adaptiveCards/defaultStyleOptions.ts +1 -1
|
@@ -27,15 +27,20 @@ function walkAllItems(node, fn) {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
const AdaptiveCardChoiceSetInput = ({ input: { choices, defaultValue } }) => {
|
|
30
|
+
const AdaptiveCardChoiceSetInput = ({ input: { choices, defaultValue, label } }) => {
|
|
31
31
|
const labelId = useUniqueId('webchat__id');
|
|
32
32
|
const defaultChoice = choices.find(({ value }) => defaultValue === value || (!defaultValue && !value));
|
|
33
33
|
|
|
34
34
|
return (
|
|
35
35
|
<div>
|
|
36
|
-
<select
|
|
36
|
+
<select
|
|
37
|
+
aria-label={label}
|
|
38
|
+
aria-labelledby={!label && defaultChoice ? labelId : undefined}
|
|
39
|
+
defaultValue={defaultValue}
|
|
40
|
+
tabIndex={-1}
|
|
41
|
+
>
|
|
37
42
|
{choices.map(choice => (
|
|
38
|
-
<option id={choice === defaultChoice ? labelId : undefined} key={choice.value} value={choice.value}>
|
|
43
|
+
<option id={!label && choice === defaultChoice ? labelId : undefined} key={choice.value} value={choice.value}>
|
|
39
44
|
{choice.title}
|
|
40
45
|
</option>
|
|
41
46
|
))}
|
|
@@ -53,6 +58,7 @@ AdaptiveCardChoiceSetInput.propTypes = {
|
|
|
53
58
|
})
|
|
54
59
|
),
|
|
55
60
|
defaultValue: PropTypes.any,
|
|
61
|
+
label: PropTypes.string,
|
|
56
62
|
value: PropTypes.any
|
|
57
63
|
}).isRequired
|
|
58
64
|
};
|
|
@@ -117,13 +123,15 @@ const AdaptiveCardAttachment = ({ content }) => {
|
|
|
117
123
|
input instanceof ChoiceSetInput ? (
|
|
118
124
|
<AdaptiveCardChoiceSetInput input={input} key={index} />
|
|
119
125
|
) : input instanceof DateInput ? (
|
|
120
|
-
<
|
|
126
|
+
<label key={index}>
|
|
127
|
+
{input.title}
|
|
121
128
|
<input placeholder={input.placeholder} tabIndex={-1} type="date" />
|
|
122
|
-
</
|
|
129
|
+
</label>
|
|
123
130
|
) : input instanceof NumberInput ? (
|
|
124
|
-
<
|
|
131
|
+
<label key={index}>
|
|
132
|
+
{input.title}
|
|
125
133
|
<input placeholder={input.placeholder} tabIndex={-1} type="number" />
|
|
126
|
-
</
|
|
134
|
+
</label>
|
|
127
135
|
) : input instanceof OpenUrlAction || input instanceof ShowCardAction || input instanceof SubmitAction ? (
|
|
128
136
|
<div key={index}>
|
|
129
137
|
<button tabIndex={-1} type="button">
|
|
@@ -131,18 +139,20 @@ const AdaptiveCardAttachment = ({ content }) => {
|
|
|
131
139
|
</button>
|
|
132
140
|
</div>
|
|
133
141
|
) : input instanceof TextInput ? (
|
|
134
|
-
<
|
|
142
|
+
<label key={index}>
|
|
143
|
+
{input.title}
|
|
135
144
|
<input placeholder={input.placeholder} tabIndex={-1} type="text" />
|
|
136
|
-
</
|
|
145
|
+
</label>
|
|
137
146
|
) : input instanceof TimeInput ? (
|
|
138
|
-
<
|
|
147
|
+
<label key={index}>
|
|
148
|
+
{input.title}
|
|
139
149
|
<input placeholder={input.placeholder} tabIndex={-1} type="time" />
|
|
140
|
-
</
|
|
150
|
+
</label>
|
|
141
151
|
) : input instanceof ToggleInput ? (
|
|
142
|
-
<
|
|
152
|
+
<label key={index}>
|
|
143
153
|
{input.title}
|
|
144
154
|
<input defaultChecked={input.value === input.valueOn} tabIndex={-1} type="checkbox" />
|
|
145
|
-
</
|
|
155
|
+
</label>
|
|
146
156
|
) : (
|
|
147
157
|
false
|
|
148
158
|
)
|
|
@@ -57,8 +57,8 @@ export default function ({
|
|
|
57
57
|
|
|
58
58
|
'& .ac-pushButton, & input, & select, & textarea': {
|
|
59
59
|
'&[aria-disabled="true"]': {
|
|
60
|
-
backgroundColor: '
|
|
61
|
-
borderColor: '
|
|
60
|
+
backgroundColor: 'rgba(239, 239, 239, 0.3)',
|
|
61
|
+
borderColor: 'rgba(118, 118, 118, 0.3)',
|
|
62
62
|
borderStyle: 'solid',
|
|
63
63
|
borderWidth: 1,
|
|
64
64
|
color: '#545454'
|
|
@@ -66,8 +66,8 @@ export default function ({
|
|
|
66
66
|
},
|
|
67
67
|
|
|
68
68
|
'& .ac-pushButton[aria-disabled="true"]': {
|
|
69
|
-
backgroundColor: '#
|
|
70
|
-
color: '#
|
|
69
|
+
backgroundColor: '#EEE',
|
|
70
|
+
color: '#4F4F4F'
|
|
71
71
|
},
|
|
72
72
|
|
|
73
73
|
'& .ac-pushButton[aria-pressed="true"]': {
|
|
@@ -2,7 +2,7 @@ import AdaptiveCardsStyleOptions from './AdaptiveCardsStyleOptions';
|
|
|
2
2
|
|
|
3
3
|
const ADAPTIVE_CARDS_DEFAULT_STYLE_OPTIONS: Required<AdaptiveCardsStyleOptions> = {
|
|
4
4
|
adaptiveCardsParserMaxVersion: undefined,
|
|
5
|
-
cardEmphasisBackgroundColor: '#
|
|
5
|
+
cardEmphasisBackgroundColor: '#F9F9F9',
|
|
6
6
|
cardPushButtonBackgroundColor: '#0063B1',
|
|
7
7
|
cardPushButtonTextColor: 'White',
|
|
8
8
|
richCardWrapTitle: false
|