Skip to content

Commit 728b590

Browse files
committed
fix samples changes
1 parent 23da14c commit 728b590

13 files changed

Lines changed: 116 additions & 128 deletions

File tree

samples/01.getting-started/d.es5-direct-line-speech/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en-US">
33
<head>
44
<title>Web Chat: Full-featured bundle with ES5 polyfills and Direct Line Speech channel</title>

samples/01.getting-started/k.direct-line-token/public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

samples/02.branding-styling-and-customization/j.activity-grouping/comprehensive.html

Lines changed: 40 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en-US">
33
<head>
44
<title>Web Chat: Activity grouping</title>
@@ -56,8 +56,7 @@
5656
border: solid 2px #ccc;
5757
border-radius: 4px;
5858
bottom: 0;
59-
font-family:
60-
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
59+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
6160
'Helvetica Neue', sans-serif;
6261
font-size: 14px;
6362
margin: 10px;
@@ -261,7 +260,8 @@
261260
],
262261
from: { role: 'bot' },
263262
id: '2.1',
264-
text: 'Esse pariatur enim reprehenderit magna anim in. Eiusmod eiusmod officia laboris aute proident officia.',
263+
text:
264+
'Esse pariatur enim reprehenderit magna anim in. Eiusmod eiusmod officia laboris aute proident officia.',
265265
timestamp: new Date().toISOString(),
266266
type: 'message'
267267
});
@@ -343,20 +343,19 @@
343343
const styleComboNumber = getComboNumber(styleValues);
344344
const setStyleComboNumber = useCallback(value => comboNumberSetter(value, styleSetters), [...styleSetters]);
345345

346-
const handleStyleComboNumberChange = useCallback(
347-
({ target: { value } }) => setStyleComboNumber(value),
348-
[setStyleComboNumber]
349-
);
346+
const handleStyleComboNumberChange = useCallback(({ target: { value } }) => setStyleComboNumber(value), [
347+
setStyleComboNumber
348+
]);
350349

351-
const handlePlusOneStyleComboNumber = useCallback(
352-
() => setStyleComboNumber(styleComboNumber + 1),
353-
[styleComboNumber, setStyleComboNumber]
354-
);
350+
const handlePlusOneStyleComboNumber = useCallback(() => setStyleComboNumber(styleComboNumber + 1), [
351+
styleComboNumber,
352+
setStyleComboNumber
353+
]);
355354

356-
const handleMinusOneStyleComboNumber = useCallback(
357-
() => setStyleComboNumber(styleComboNumber - 1),
358-
[styleComboNumber, setStyleComboNumber]
359-
);
355+
const handleMinusOneStyleComboNumber = useCallback(() => setStyleComboNumber(styleComboNumber - 1), [
356+
styleComboNumber,
357+
setStyleComboNumber
358+
]);
360359

361360
const viewValueAndSetters = [
362361
[wide, setWide],
@@ -369,20 +368,19 @@
369368
const viewComboNumber = getComboNumber(viewValues);
370369
const setViewComboNumber = useCallback(value => comboNumberSetter(value, viewSetters), [...viewSetters]);
371370

372-
const handleViewComboNumberChange = useCallback(
373-
({ target: { value } }) => setViewComboNumber(value),
374-
[setViewComboNumber]
375-
);
371+
const handleViewComboNumberChange = useCallback(({ target: { value } }) => setViewComboNumber(value), [
372+
setViewComboNumber
373+
]);
376374

377-
const handlePlusOneViewComboNumber = useCallback(
378-
() => setViewComboNumber(viewComboNumber + 1),
379-
[viewComboNumber, setViewComboNumber]
380-
);
375+
const handlePlusOneViewComboNumber = useCallback(() => setViewComboNumber(viewComboNumber + 1), [
376+
viewComboNumber,
377+
setViewComboNumber
378+
]);
381379

382-
const handleMinusOneViewComboNumber = useCallback(
383-
() => setViewComboNumber(viewComboNumber - 1),
384-
[viewComboNumber, setViewComboNumber]
385-
);
380+
const handleMinusOneViewComboNumber = useCallback(() => setViewComboNumber(viewComboNumber - 1), [
381+
viewComboNumber,
382+
setViewComboNumber
383+
]);
386384

387385
const handleAddMessage = useCallback(() => {
388386
activityDeferredObservable.next({
@@ -410,10 +408,9 @@
410408
setShowAvatarInGroup('status');
411409
}, [setShowAvatarForEveryActivity, setShowAvatarInGroup]);
412410

413-
const setShowAvatarInGroupType = useCallback(
414-
sender => setShowAvatarInGroup('sender'),
415-
[setShowAvatarInGroup]
416-
);
411+
const setShowAvatarInGroupType = useCallback(sender => setShowAvatarInGroup('sender'), [
412+
setShowAvatarInGroup
413+
]);
417414

418415
const groupingValueAndSetters = [
419416
[!showAvatarForEveryActivity && showAvatarInGroup === 'status', setShowAvatarInGroupType],
@@ -424,25 +421,24 @@
424421
const groupingSetters = groupingValueAndSetters.map(([_, setter]) => setter);
425422

426423
const groupingComboNumber = getComboNumber(groupingValues);
427-
const setGroupingComboNumber = useCallback(
428-
value => comboNumberSetter(value, groupingSetters),
429-
[...groupingSetters]
430-
);
424+
const setGroupingComboNumber = useCallback(value => comboNumberSetter(value, groupingSetters), [
425+
...groupingSetters
426+
]);
431427

432428
const handleGroupingComboNumberChange = useCallback(
433429
({ target: { value } }) => setGroupingComboNumber(value),
434430
[setGroupingComboNumber]
435431
);
436432

437-
const handlePlusOneGroupingComboNumber = useCallback(
438-
() => setGroupingComboNumber(groupingComboNumber + 1),
439-
[groupingComboNumber, setGroupingComboNumber]
440-
);
433+
const handlePlusOneGroupingComboNumber = useCallback(() => setGroupingComboNumber(groupingComboNumber + 1), [
434+
groupingComboNumber,
435+
setGroupingComboNumber
436+
]);
441437

442-
const handleMinusOneGroupingComboNumber = useCallback(
443-
() => setGroupingComboNumber(groupingComboNumber - 1),
444-
[groupingComboNumber, setGroupingComboNumber]
445-
);
438+
const handleMinusOneGroupingComboNumber = useCallback(() => setGroupingComboNumber(groupingComboNumber - 1), [
439+
groupingComboNumber,
440+
setGroupingComboNumber
441+
]);
446442

447443
const styleOptions = useMemo(
448444
() => ({

samples/02.branding-styling-and-customization/j.grouping-avatar/comprehensive.html

Lines changed: 40 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en-US">
33
<head>
44
<title>Web Chat: Enable recomposition mode</title>
@@ -57,8 +57,7 @@
5757
border: solid 2px #ccc;
5858
border-radius: 4px;
5959
bottom: 0;
60-
font-family:
61-
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
60+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
6261
'Helvetica Neue', sans-serif;
6362
font-size: 14px;
6463
margin: 10px;
@@ -262,7 +261,8 @@
262261
],
263262
from: { role: 'bot' },
264263
id: '2.1',
265-
text: 'Esse pariatur enim reprehenderit magna anim in. Eiusmod eiusmod officia laboris aute proident officia.',
264+
text:
265+
'Esse pariatur enim reprehenderit magna anim in. Eiusmod eiusmod officia laboris aute proident officia.',
266266
timestamp: new Date().toISOString(),
267267
type: 'message'
268268
});
@@ -344,20 +344,19 @@
344344
const styleComboNumber = getComboNumber(styleValues);
345345
const setStyleComboNumber = useCallback(value => comboNumberSetter(value, styleSetters), [...styleSetters]);
346346

347-
const handleStyleComboNumberChange = useCallback(
348-
({ target: { value } }) => setStyleComboNumber(value),
349-
[setStyleComboNumber]
350-
);
347+
const handleStyleComboNumberChange = useCallback(({ target: { value } }) => setStyleComboNumber(value), [
348+
setStyleComboNumber
349+
]);
351350

352-
const handlePlusOneStyleComboNumber = useCallback(
353-
() => setStyleComboNumber(styleComboNumber + 1),
354-
[styleComboNumber, setStyleComboNumber]
355-
);
351+
const handlePlusOneStyleComboNumber = useCallback(() => setStyleComboNumber(styleComboNumber + 1), [
352+
styleComboNumber,
353+
setStyleComboNumber
354+
]);
356355

357-
const handleMinusOneStyleComboNumber = useCallback(
358-
() => setStyleComboNumber(styleComboNumber - 1),
359-
[styleComboNumber, setStyleComboNumber]
360-
);
356+
const handleMinusOneStyleComboNumber = useCallback(() => setStyleComboNumber(styleComboNumber - 1), [
357+
styleComboNumber,
358+
setStyleComboNumber
359+
]);
361360

362361
const viewValueAndSetters = [
363362
[wide, setWide],
@@ -370,20 +369,19 @@
370369
const viewComboNumber = getComboNumber(viewValues);
371370
const setViewComboNumber = useCallback(value => comboNumberSetter(value, viewSetters), [...viewSetters]);
372371

373-
const handleViewComboNumberChange = useCallback(
374-
({ target: { value } }) => setViewComboNumber(value),
375-
[setViewComboNumber]
376-
);
372+
const handleViewComboNumberChange = useCallback(({ target: { value } }) => setViewComboNumber(value), [
373+
setViewComboNumber
374+
]);
377375

378-
const handlePlusOneViewComboNumber = useCallback(
379-
() => setViewComboNumber(viewComboNumber + 1),
380-
[viewComboNumber, setViewComboNumber]
381-
);
376+
const handlePlusOneViewComboNumber = useCallback(() => setViewComboNumber(viewComboNumber + 1), [
377+
viewComboNumber,
378+
setViewComboNumber
379+
]);
382380

383-
const handleMinusOneViewComboNumber = useCallback(
384-
() => setViewComboNumber(viewComboNumber - 1),
385-
[viewComboNumber, setViewComboNumber]
386-
);
381+
const handleMinusOneViewComboNumber = useCallback(() => setViewComboNumber(viewComboNumber - 1), [
382+
viewComboNumber,
383+
setViewComboNumber
384+
]);
387385

388386
const handleAddMessage = useCallback(() => {
389387
activityDeferredObservable.next({
@@ -411,10 +409,9 @@
411409
setShowAvatarInGroup('status');
412410
}, [setShowAvatarForEveryActivity, setShowAvatarInGroup]);
413411

414-
const setShowAvatarInGroupType = useCallback(
415-
sender => setShowAvatarInGroup('sender'),
416-
[setShowAvatarInGroup]
417-
);
412+
const setShowAvatarInGroupType = useCallback(sender => setShowAvatarInGroup('sender'), [
413+
setShowAvatarInGroup
414+
]);
418415

419416
const groupingValueAndSetters = [
420417
[!showAvatarForEveryActivity && showAvatarInGroup === 'status', setShowAvatarInGroupType],
@@ -425,25 +422,24 @@
425422
const groupingSetters = groupingValueAndSetters.map(([_, setter]) => setter);
426423

427424
const groupingComboNumber = getComboNumber(groupingValues);
428-
const setGroupingComboNumber = useCallback(
429-
value => comboNumberSetter(value, groupingSetters),
430-
[...groupingSetters]
431-
);
425+
const setGroupingComboNumber = useCallback(value => comboNumberSetter(value, groupingSetters), [
426+
...groupingSetters
427+
]);
432428

433429
const handleGroupingComboNumberChange = useCallback(
434430
({ target: { value } }) => setGroupingComboNumber(value),
435431
[setGroupingComboNumber]
436432
);
437433

438-
const handlePlusOneGroupingComboNumber = useCallback(
439-
() => setGroupingComboNumber(groupingComboNumber + 1),
440-
[groupingComboNumber, setGroupingComboNumber]
441-
);
434+
const handlePlusOneGroupingComboNumber = useCallback(() => setGroupingComboNumber(groupingComboNumber + 1), [
435+
groupingComboNumber,
436+
setGroupingComboNumber
437+
]);
442438

443-
const handleMinusOneGroupingComboNumber = useCallback(
444-
() => setGroupingComboNumber(groupingComboNumber - 1),
445-
[groupingComboNumber, setGroupingComboNumber]
446-
);
439+
const handleMinusOneGroupingComboNumber = useCallback(() => setGroupingComboNumber(groupingComboNumber - 1), [
440+
groupingComboNumber,
441+
setGroupingComboNumber
442+
]);
447443

448444
const styleOptions = useMemo(
449445
() => ({

samples/03.speech/a.direct-line-speech/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en-US">
33
<head>
44
<title>Web Chat: Using Direct Line Speech</title>

samples/03.speech/h.select-audio-input-device/comprehensive.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en-US">
33
<head>
44
<title>Web Chat: Cognitive Services Speech Services with selectable audio input device</title>

samples/05.custom-components/k.per-message-avatar/comprehensive.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@
4444
border-radius: 4px;
4545
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
4646
flex-shrink: 0;
47-
font-family:
48-
-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
47+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
4948
'Helvetica Neue', sans-serif;
5049
font-size: 14px;
5150
margin: 10px;

samples/07.advanced-web-chat-apps/a.upload-to-azure-storage/web/public/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
@@ -98,7 +98,7 @@
9898

9999
// When Web Chat wants to send files, we intercept this action and send an event instead.
100100
if (type === 'WEB_CHAT/SEND_FILES') {
101-
(async function () {
101+
(async function() {
102102
// Tells the bot that you are uploading files. This is optional.
103103
dispatch({ type: 'WEB_CHAT/SEND_TYPING' });
104104

samples/07.advanced-web-chat-apps/b.sso-for-enterprise/app/public/index.html

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
@@ -151,31 +151,28 @@
151151

152152
WebChat.renderWebChat(
153153
{
154-
cardActionMiddleware:
155-
() =>
156-
next =>
157-
async ({ cardAction, getSignInUrl }) => {
158-
// To sign in, the bot will send a card action with a custom URL.
159-
// We are using "about:blank" as the placeholder URL.
160-
const { type, value } = cardAction;
161-
162-
if (type === 'openUrl' && value === 'about:blank#sign-into-aad') {
163-
// Request the page to start sign-in flow for Azure Active Directory.
164-
const signInEvent = new Event('signin');
165-
166-
signInEvent.data = { provider: 'aad' };
167-
window.dispatchEvent(signInEvent);
168-
} else if (type === 'openUrl' && value === 'about:blank#sign-into-github') {
169-
// Request the page to start sign-in flow for GitHub OAuth app.
170-
const signInEvent = new Event('signin');
171-
172-
signInEvent.data = { provider: 'github' };
173-
window.dispatchEvent(signInEvent);
174-
} else {
175-
// Non-SSO related actions, fallback to default behavior.
176-
return next({ cardAction, getSignInUrl });
177-
}
178-
},
154+
cardActionMiddleware: () => next => async ({ cardAction, getSignInUrl }) => {
155+
// To sign in, the bot will send a card action with a custom URL.
156+
// We are using "about:blank" as the placeholder URL.
157+
const { type, value } = cardAction;
158+
159+
if (type === 'openUrl' && value === 'about:blank#sign-into-aad') {
160+
// Request the page to start sign-in flow for Azure Active Directory.
161+
const signInEvent = new Event('signin');
162+
163+
signInEvent.data = { provider: 'aad' };
164+
window.dispatchEvent(signInEvent);
165+
} else if (type === 'openUrl' && value === 'about:blank#sign-into-github') {
166+
// Request the page to start sign-in flow for GitHub OAuth app.
167+
const signInEvent = new Event('signin');
168+
169+
signInEvent.data = { provider: 'github' };
170+
window.dispatchEvent(signInEvent);
171+
} else {
172+
// Non-SSO related actions, fallback to default behavior.
173+
return next({ cardAction, getSignInUrl });
174+
}
175+
},
179176
directLine: WebChat.createDirectLine({ token }),
180177
store,
181178
styleOptions: {

samples/07.advanced-web-chat-apps/c.sso-for-intranet/web/public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />

0 commit comments

Comments
 (0)