-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathindex.html
More file actions
920 lines (844 loc) · 45.5 KB
/
index.html
File metadata and controls
920 lines (844 loc) · 45.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
<!doctype html>
<html lang="en-US">
<head>
<title>Two Chat panes side-by-side using Fluent theme</title>
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
<script type="importmap">
{
"imports": {
"react": "https://esm.sh/react@18.3.1",
"react-dom": "https://esm.sh/react-dom@18.3.1",
"react-dom/": "https://esm.sh/react-dom@18.3.1/",
"@fluentui/react-components": "https://esm.sh/@fluentui/react-components?deps=react@18.3.1&exports=FluentProvider,createDarkTheme"
}
}
</script>
<script crossorigin="anonymous" src="/test-harness.js"></script>
<script crossorigin="anonymous" src="/test-page-object.js"></script>
<script type="module">
import React from 'react';
window.React = React;
</script>
<script defer crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
<script defer crossorigin="anonymous" src="/__dist__/botframework-webchat-fluent-theme.production.min.js"></script>
<style>
:root:has(.theme-provider.light) {
--colorBrandBackground2: hsl(237, 100%, 96%);
--colorBrandForeground1: hsl(237, 99%, 28%);
--colorBrandForegroundLink: hsl(237, 99%, 28%);
--colorBrandForegroundLinkHover: hsl(237, 98%, 24%);
--colorBrandForegroundLinkPressed: hsl(237, 98%, 18%);
--colorBrandForegroundLinkSelected: hsl(237, 99%, 28%);
--colorCompoundBrandForeground1Hover: hsl(237, 97%, 31%);
--colorBrandForeground2Hover: hsl(237, 36%, 42%);
--colorBrandStroke2Hover: hsl(237, 89%, 82%);
--colorBrandBackground2Hover: hsl(237, 75%, 92%);
--colorBrandForeground2Pressed: hsl(237, 26%, 27%);
--colorBrandStroke2Pressed: hsl(237, 49%, 57%);
--colorBrandBackground2Pressed: hsl(237, 87%, 85%);
--colorBrandStroke2: hsl(237, 53%, 68%);
--shadow2: 0 0 2px rgba(0, 0, 0, 12%), 0 1px 2px rgba(0, 0, 0, 14%);
}
body:has(.theme-provider.dark) {
/* The background is a decorative "Endless Clouds" pattern from https://www.heropatterns.com/ under CC BY 4.0. */
background: #070707 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 28' width='56' height='28'%3E%3Cpath fill='%23111111' fill-opacity='0.4' d='M56 26v2h-7.75c2.3-1.27 4.94-2 7.75-2zm-26 2a2 2 0 1 0-4 0h-4.09A25.98 25.98 0 0 0 0 16v-2c.67 0 1.34.02 2 .07V14a2 2 0 0 0-2-2v-2a4 4 0 0 1 3.98 3.6 28.09 28.09 0 0 1 2.8-3.86A8 8 0 0 0 0 6V4a9.99 9.99 0 0 1 8.17 4.23c.94-.95 1.96-1.83 3.03-2.63A13.98 13.98 0 0 0 0 0h7.75c2 1.1 3.73 2.63 5.1 4.45 1.12-.72 2.3-1.37 3.53-1.93A20.1 20.1 0 0 0 14.28 0h2.7c.45.56.88 1.14 1.29 1.74 1.3-.48 2.63-.87 4-1.15-.11-.2-.23-.4-.36-.59H26v.07a28.4 28.4 0 0 1 4 0V0h4.09l-.37.59c1.38.28 2.72.67 4.01 1.15.4-.6.84-1.18 1.3-1.74h2.69a20.1 20.1 0 0 0-2.1 2.52c1.23.56 2.41 1.2 3.54 1.93A16.08 16.08 0 0 1 48.25 0H56c-4.58 0-8.65 2.2-11.2 5.6 1.07.8 2.09 1.68 3.03 2.63A9.99 9.99 0 0 1 56 4v2a8 8 0 0 0-6.77 3.74c1.03 1.2 1.97 2.5 2.79 3.86A4 4 0 0 1 56 10v2a2 2 0 0 0-2 2.07 28.4 28.4 0 0 1 2-.07v2c-9.2 0-17.3 4.78-21.91 12H30zM7.75 28H0v-2c2.81 0 5.46.73 7.75 2zM56 20v2c-5.6 0-10.65 2.3-14.28 6h-2.7c4.04-4.89 10.15-8 16.98-8zm-39.03 8h-2.69C10.65 24.3 5.6 22 0 22v-2c6.83 0 12.94 3.11 16.97 8zm15.01-.4a28.09 28.09 0 0 1 2.8-3.86 8 8 0 0 0-13.55 0c1.03 1.2 1.97 2.5 2.79 3.86a4 4 0 0 1 7.96 0zm14.29-11.86c1.3-.48 2.63-.87 4-1.15a25.99 25.99 0 0 0-44.55 0c1.38.28 2.72.67 4.01 1.15a21.98 21.98 0 0 1 36.54 0zm-5.43 2.71c1.13-.72 2.3-1.37 3.54-1.93a19.98 19.98 0 0 0-32.76 0c1.23.56 2.41 1.2 3.54 1.93a15.98 15.98 0 0 1 25.68 0zm-4.67 3.78c.94-.95 1.96-1.83 3.03-2.63a13.98 13.98 0 0 0-22.4 0c1.07.8 2.09 1.68 3.03 2.63a9.99 9.99 0 0 1 16.34 0z'%3E%3C/path%3E%3C/svg%3E");
}
#webchat {
width: 1460px;
height: 700px;
box-sizing: border-box;
background: hsla(237, 80%, 60%, 0.05);
padding: 32px;
display: flex;
gap: 16px;
}
.theme-provider.dark {
background: hsla(237, 80%, 60%, 0.05);
}
.theme-provider {
display: contents;
}
.webchat-left,
.webchat-right {
width: 680px;
height: 100%;
box-sizing: border-box;
}
.webchat-right {
flex: auto;
background: hsla(0, 0%, 100%, 0.6);
border-radius: 8px;
box-shadow: var(--shadow2);
padding: 14px 4px;
}
.theme-provider.dark .webchat-right {
background: hsla(0, 0%, 0%, 0.6);
}
.webchat-left .webchat-fluent .sendbox__sendbox {
grid-template:
[telephone-keypad-start] "text-area controls"[attachment-bar telephone-keypad-end] / [telephone-keypad text-area attachment-bar] 5fr [controls] 1fr;
}
.border-loader__loader,
.border-flair {
animation-delay: -1s !important;
animation-play-state: paused !important;
}
</style>
</head>
<body>
<main id="webchat"></main>
<script type="module">
import React from 'react';
import { createRoot } from 'react-dom/client';
import { FluentProvider, createDarkTheme } from '@fluentui/react-components';
run(async function () {
const {
WebChat: { FluentThemeProvider, ReactWebChat },
} = window; // Imports in UMD fashion.
await host.sendDevToolsCommand('Emulation.setEmulatedMedia', {
features: [{ name: 'prefers-reduced-motion', value: 'reduce' }]
});
await host.windowSize(1460, 700, document.getElementById('webchat'));
let timestampStart = new Date(2020, 7, 9).getTime();
const timestamp = () => new Date(timestampStart += 100).toISOString();
const searchParams = new URLSearchParams(location.search);
const [leftTranscriptIndex = 0, rightTranscriptIndex = 1] = searchParams.getAll('transcript');
const [leftVariant = 'fluent', rightVariant = 'copilot'] = searchParams.getAll('variant');
const sendBoxIndexes = searchParams.getAll('focus');
const activeFocusPresets = searchParams.getAll('focus-preset');
const adjustStyleOptions = Object.fromEntries(['codeBlockTheme']
.map(key => [key,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oPAGu2ozpX8i3bb8EX+idGricqayXRMjMhgMxq6aP0TYN5fbjUF5KZaL5o4nkpOlcBJeBJyncsWL0ElTE0AVDR0dHS8QBb1542ZTyauEB98iF4wlw0iR/Ji9myCrRYIIJOOprvpqiCgJHOTzefqnUuHFss0rJ00hw0kOEyeZTfmSRMjo7Gp69aShg20aJX3lI6BMOePQ+jVjcK6HaUrRVHLSBWkikE6ecnZ9Lnn1pLafxEbAkS0TF4yfNI4MP0G3Lb7SWWk2mw1nJYpYVNVUX4MfuorRe/fuPb5y++rJU8g/JkvMUWn0ZpPhTOAJObiIZars+vz5cPr+/fvHjSBBKUaxLUel2r1R/Bqhn0RWqwlpMkhQE2TqrK1XJezaHyJrfCIJdvJVV/9BZDap1CToRU34B5FZn0OCX9LWqxJF8PhFwd83/rZ7ddgisylOTUJQ0qLhizSpAglBMZkSRGhAhEXSkpC0dpF0ESdpUuUkNGVuDDiz0WAihEUKUTHHciXefi7SJAokVE3fmSdtHrFMGWoSuuZvzJMuUulICFu7eKOE28/TKOQklGmzpYr0iTEkpAlRMElao1SIQps8K9sS8ByFXQRTVLbICYniU2UkDAna7E3iJqRelQBRWIpevNNwYcgJ6dSosgQSthJ3Dz2P9JiQ4Sw6c5MlkMhkVWnlJKwJMm3mTsPfRCZ9nCI6rCKOitamZm+C6fd5ZNXHZ2SpAfofybRZmXG7Nxn9V85otOo1qowEhVog/y+oEjIzcuJUKC4uJyM1kXr+e3jx1CqQVqeOIZEiRYoUKVKkSJEiRYoUtL4DkaWZtZT0Fr4AAAAASUVORK5CYII=';
const aiMessageEntity = {
'@context': 'https://schema.org',
'@id': '',
'@type': 'Message',
keywords: ['AIGeneratedContent'],
type: 'https://schema.org/Message',
author: {
'@context': 'https://schema.org',
'@type': 'Person',
image: botIcon,
name: 'Onboarding Buddy',
}
};
const waveSvg = `data:image/svg+xml;utf8,${encodeURIComponent(`
<svg viewBox="0 50 400 100" xmlns="http://www.w3.org/2000/svg">
<!-- Primary Wave -->
<path d="M0,100 C50,50 100,150 150,100 C200,50 250,150 300,100 C350,50 400,150 400,100"
stroke="#3B82F6" fill="none" stroke-width="2" opacity="0.5"/>
<!-- Second Harmonic -->
<path d="M0,100 C25,75 50,125 75,100 C100,75 125,125 150,100 C175,75 200,125 225,100 C250,75 275,125 300,100 C325,75 350,125 375,100 C400,75 400,125 400,100"
stroke="#10B981" fill="none" stroke-width="2" opacity="0.5"/>
<!-- Combined Wave -->
<path d="M0,100 C40,30 80,170 120,100 C160,30 200,170 240,100 C280,30 320,170 360,100 C380,65 400,135 400,100"
stroke="#EF4444" fill="none" stroke-width="3"/>
<!-- Grid Lines -->
<line x1="0" y1="100" x2="400" y2="100" stroke="#CBD5E1" stroke-width="0.5" stroke-dasharray="4"/>
<line x1="100" y1="0" x2="100" y2="200" stroke="#CBD5E1" stroke-width="0.5" stroke-dasharray="4"/>
<line x1="200" y1="0" x2="200" y2="200" stroke="#CBD5E1" stroke-width="0.5" stroke-dasharray="4"/>
<line x1="300" y1="0" x2="300" y2="200" stroke="#CBD5E1" stroke-width="0.5" stroke-dasharray="4"/>
</svg>`)}`;
const transcripts = [[
{
timestamp: timestamp(),
from: { role: 'bot' },
id: '1.0',
text: `Great! Your copilot will maintain a polite, friendly, professional, and fun while assisting team members with onboarding tasks.
Are there any topics or tasks this copilot shouldn’t help with or talk about?`,
type: 'message'
},
{
timestamp: timestamp(),
channelData: { state: 'sent' },
from: { role: 'user' },
id: '1.1',
text: 'No',
type: 'message'
},
{
timestamp: timestamp(),
from: { role: 'bot' },
id: '2.0',
text: 'Is there a website or datasource that has knowledge that will be necessary for Onboarding Buddy?',
type: 'message'
},
{
timestamp: timestamp(),
channelData: { state: 'sent' },
from: { role: 'user' },
id: '2.1',
text: 'https://sharepoint.contoso.com/newhires/',
type: 'message'
},
{
timestamp: timestamp(),
from: { role: 'bot' },
id: '3.0',
text: `https://sharepoint.contoso.com/team/ has been added as a Knowledge source.
You can preview your extension at any time.`,
type: 'message'
},
{
timestamp: timestamp(),
from: { role: 'user' },
id: '4.0',
text: '',
channelData: {
state: 'sent',
attachmentSizes: [65 * 1024]
},
attachments: [
{
contentType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
name: 'Onboarding Checklist.doc'
}
],
type: 'message'
},
{
timestamp: timestamp(),
from: { role: 'bot' },
suggestedActions: {
actions: [
{
displayText: 'What else should I say?',
text: 'What else should I say?',
title: 'What else should I say?',
type: 'messageBack'
},
]
},
entities: [
{
"@context": "https://schema.org",
"@id": "cite:1",
"@type": "Claim",
type: "https://schema.org/Claim",
text: "The onboarding process is crucial for new hires. It helps them understand company culture, policies, and their role. A well-structured onboarding program can significantly improve employee retention and productivity."
}
],
text: `Great! I've reviewed the Onboarding Checklist.doc[1]\u200C[2]. Here are some key points to include in your Onboarding Buddy's knowledge base:
1. Welcome package preparation[1]
2. IT setup and access provisioning[1]
3. First-day orientation schedule
4. Introduction to company policies[2]
5. Team meet-and-greet sessions[3]
[1]: https://sharepoint.contoso.com/newhires/Onboarding%20Checklist.doc
[2]: https://sharepoint.contoso.com/team/ \"Company SharePoint\"
[3]: cite:1 \"Importance of Onboarding\"
`,
type: "message"
}
], [
{
timestamp: timestamp(),
entities: [
{
'@context': 'https://schema.org',
'@id': '',
'@type': 'Message',
keywords: ['PreChatMessage'],
type: 'https://schema.org/Message',
author: {
'@context': 'https://schema.org',
'@type': 'Person',
type: 'https://schema.org/Person',
image: botIcon,
description: 'Ready to explore? Select one of the suggestions below to get started...',
name: 'Onboarding Buddy',
}
}
],
suggestedActions: {
actions: [
{
image: `data:image/svg+xml;utf8,${encodeURIComponent('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5C2 4.22386 2.22386 4 2.5 4H13.5C13.7761 4 14 4.22386 14 4.5C14 4.77614 13.7761 5 13.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM2 9.5C2 9.22386 2.22386 9 2.5 9H17.5C17.7761 9 18 9.22386 18 9.5C18 9.77614 17.7761 10 17.5 10H2.5C2.22386 10 2 9.77614 2 9.5ZM2.5 14C2.22386 14 2 14.2239 2 14.5C2 14.7761 2.22386 15 2.5 15H11.5C11.7761 15 12 14.7761 12 14.5C12 14.2239 11.7761 14 11.5 14H2.5Z" fill="#707070"/></svg>')}`,
// fill="#999999" in dark theme
text: 'Track new hire tasks.',
type: 'messageBack',
title: 'Checklist'
},
{
image: `data:image/svg+xml;utf8,${encodeURIComponent('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M17.1813 2.92689C16.0291 1.71505 14.1047 1.69077 12.9222 2.87317L3.54741 12.2475C3.21958 12.5754 2.99204 12.9899 2.89148 13.4424L2.01387 17.3923C1.97678 17.5592 2.02754 17.7335 2.14844 17.8544C2.26934 17.9753 2.44362 18.026 2.6105 17.9889L6.53689 17.1157C7.00432 17.0118 7.43243 16.7767 7.77103 16.4381L17.129 7.08003C18.27 5.939 18.2933 4.09631 17.1813 2.92689ZM13.6293 3.58029C14.4143 2.79538 15.6917 2.8115 16.4566 3.61596C17.1948 4.39225 17.1793 5.61548 16.4219 6.37293L15.7507 7.04418L12.958 4.25155L13.6293 3.58029ZM12.2509 4.95864L15.0436 7.7513L7.06391 15.731C6.85976 15.9352 6.60164 16.0769 6.31982 16.1396L3.1605 16.8421L3.86768 13.6593C3.92698 13.3924 4.06117 13.148 4.2545 12.9547L12.2509 4.95864Z" fill="#707070"/></svg>')}`,
// fill="#999999" in dark theme
text: 'Set up your laptop',
type: 'messageBack',
title: 'Equipment'
},
{
image: `data:image/svg+xml;utf8,${encodeURIComponent('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.49279 4.90114C8.13479 4.9711 7.7439 5.20337 7.43474 5.74712C7.29826 5.98718 6.99301 6.07114 6.75296 5.93465C6.5129 5.79817 6.42894 5.49292 6.56543 5.25287C7.00628 4.47749 7.63328 4.0502 8.30099 3.9197C8.9539 3.7921 9.60295 3.95667 10.0932 4.28126C10.5768 4.6015 10.9679 5.12423 10.9804 5.75187C10.9934 6.40602 10.5946 6.99672 9.86123 7.43036C9.36263 7.7252 9.16869 7.92513 9.08626 8.05795C9.01687 8.16975 9.00009 8.27172 9.00009 8.5C9.00009 8.77614 8.77623 9 8.50009 9C8.22394 9 8.00009 8.77614 8.00009 8.5C8.00009 8.22827 8.01399 7.88929 8.2366 7.53061C8.44617 7.19295 8.80555 6.89287 9.35222 6.5696C9.88718 6.25326 9.98416 5.95168 9.98059 5.77173C9.97649 5.56527 9.83866 5.31208 9.54108 5.11505C9.25005 4.92235 8.86559 4.82828 8.49279 4.90114ZM8.75 11.5C9.16421 11.5 9.5 11.1642 9.5 10.75C9.5 10.3358 9.16421 10 8.75 10C8.33579 10 8 10.3358 8 10.75C8 11.1642 8.33579 11.5 8.75 11.5ZM8.50019 1C4.91034 1 2.00019 3.91015 2.00019 7.5C2.00019 8.651 2.29978 9.73335 2.82544 10.6719L2.0297 12.7542C1.73642 13.5216 2.4424 14.2957 3.23352 14.0741L5.7209 13.3774C6.5641 13.7768 7.50671 14 8.50019 14C12.09 14 15.0002 11.0899 15.0002 7.5C15.0002 3.91015 12.09 1 8.50019 1ZM3.00019 7.5C3.00019 4.46243 5.46263 2 8.50019 2C11.5378 2 14.0002 4.46243 14.0002 7.5C14.0002 10.5376 11.5378 13 8.50019 13C7.59806 13 6.74803 12.7832 5.99798 12.3993L5.82377 12.3101L2.96381 13.1111L3.93292 10.5753L3.80463 10.3655C3.29438 9.53135 3.00019 8.55079 3.00019 7.5ZM11.4628 17C9.49315 17 7.72814 16.1239 6.53613 14.7402C7.09918 14.8926 7.68851 14.981 8.29584 14.9973C9.19123 15.629 10.2837 16 11.4628 16C12.3649 16 13.2149 15.7832 13.965 15.3993L14.1392 15.3101L16.9992 16.1111L16.0301 13.5752L16.1583 13.3655C16.6686 12.5313 16.9628 11.5508 16.9628 10.5C16.9628 9.34552 16.6071 8.27414 15.9993 7.38943C15.9905 6.78165 15.9095 6.19137 15.7643 5.6268C17.1125 6.81779 17.9628 8.5596 17.9628 10.5C17.9628 11.651 17.6632 12.7333 17.1375 13.6719L17.9333 15.7542C18.2266 16.5216 17.5206 17.2957 16.7295 17.0741L14.2421 16.3774C13.3989 16.7768 12.4563 17 11.4628 17Z" fill="#707070"/></svg>')}`,
// fill="#999999" in dark theme
text: 'Join groups and lists',
type: 'messageBack',
title: 'Groups'
},
{
image: `data:image/svg+xml;utf8,${encodeURIComponent('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5C2 4.22386 2.22386 4 2.5 4H13.5C13.7761 4 14 4.22386 14 4.5C14 4.77614 13.7761 5 13.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM2 9.5C2 9.22386 2.22386 9 2.5 9H17.5C17.7761 9 18 9.22386 18 9.5C18 9.77614 17.7761 10 17.5 10H2.5C2.22386 10 2 9.77614 2 9.5ZM2.5 14C2.22386 14 2 14.2239 2 14.5C2 14.7761 2.22386 15 2.5 15H11.5C11.7761 15 12 14.7761 12 14.5C12 14.2239 11.7761 14 11.5 14H2.5Z" fill="#707070"/></svg>')}`,
// fill="#999999" in dark theme
text: 'Access team boards.',
type: 'messageBack',
title: 'Boards'
},
{
image: `data:image/svg+xml;utf8,${encodeURIComponent('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5C2 4.22386 2.22386 4 2.5 4H13.5C13.7761 4 14 4.22386 14 4.5C14 4.77614 13.7761 5 13.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM2 9.5C2 9.22386 2.22386 9 2.5 9H17.5C17.7761 9 18 9.22386 18 9.5C18 9.77614 17.7761 10 17.5 10H2.5C2.22386 10 2 9.77614 2 9.5ZM2.5 14C2.22386 14 2 14.2239 2 14.5C2 14.7761 2.22386 15 2.5 15H11.5C11.7761 15 12 14.7761 12 14.5C12 14.2239 11.7761 14 11.5 14H2.5Z" fill="#707070"/></svg>')}`,
// fill="#999999" in dark theme
text: 'Meet your teammates.',
type: 'messageBack',
title: 'Connect'
},
{
image: `data:image/svg+xml;utf8,${encodeURIComponent('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M2 4.5C2 4.22386 2.22386 4 2.5 4H13.5C13.7761 4 14 4.22386 14 4.5C14 4.77614 13.7761 5 13.5 5H2.5C2.22386 5 2 4.77614 2 4.5ZM2 9.5C2 9.22386 2.22386 9 2.5 9H17.5C17.7761 9 18 9.22386 18 9.5C18 9.77614 17.7761 10 17.5 10H2.5C2.22386 10 2 9.77614 2 9.5ZM2.5 14C2.22386 14 2 14.2239 2 14.5C2 14.7761 2.22386 15 2.5 15H11.5C11.7761 15 12 14.7761 12 14.5C12 14.2239 11.7761 14 11.5 14H2.5Z" fill="#707070"/></svg>')}`,
// fill="#999999" in dark theme
text: 'Browse team projects.',
type: 'messageBack',
title: 'Projects'
}
],
to: []
},
type: 'message'
}
], [
{
timestamp: timestamp(),
from: { "role": "user" },
id: "1.0",
text: "Hi, I'm a new employee starting today. Can you help me with the onboarding process?",
type: "message"
},
{
timestamp: timestamp(),
from: { role: 'bot' },
entities: [aiMessageEntity],
id: "1.1",
text: "Welcome to the team! \n\n I'd be happy to assist you with your onboarding. Let's start with the essentials. Have you received your welcome package yet?",
type: "message",
textFormat: "plain"
},
{
timestamp: timestamp(),
from: { "role": "user" },
id: "2.0",
text: "Yes, I got it this morning.",
type: "message"
},
{
timestamp: timestamp(),
from: { role: 'bot' },
entities: [aiMessageEntity],
id: "2.1",
text: `Great! Let's go through the next steps:
1. IT Setup: Have you received your company laptop and login credentials?
2. First-day orientation: I can provide you with today's schedule.
3. Company policies: I can guide you through the most important ones.
4. Team introductions: Would you like me to arrange meet-and-greets with your colleagues?
Which of these would you like to start with?`,
type: "message"
},
{
timestamp: timestamp(),
from: { "role": "user" },
id: "3.0",
text: "I have my laptop, but I'm not sure about my login credentials. Can you help with that?",
type: "message"
},
{
timestamp: timestamp(),
from: { role: 'bot' },
entities: [aiMessageEntity],
id: "3.1",
text: `Of course! Your login credentials should have been emailed to your personal email address. If you haven't received them, I can help you contact our IT support team.
Here's what you need to do:
1. Check your personal email inbox and spam folder for an email from it-support@contoso.com
2. If you can't find the email, I can generate a support ticket for you right away.
Would you like me to create a support ticket?`,
type: "message"
},
{
timestamp: timestamp(),
from: { "role": "user" },
id: "4.0",
text: "I found the email, thanks! What's next on the checklist?",
type: "message"
},
{
timestamp: timestamp(),
from: { role: 'bot' },
entities: [aiMessageEntity],
id: "4.1",
text: `Excellent! I'm glad you found your credentials. The next item on our onboarding checklist is your first-day orientation. Here's your schedule for today:
9:00 AM - Welcome meeting with HR
10:00 AM - Company overview presentation
11:30 AM - Tour of the office
1:00 PM - Lunch with your team
2:30 PM - IT systems training
4:00 PM - Meet with your direct supervisor
Is there anything on this schedule you'd like more information about?`,
type: "message"
},
{
timestamp: timestamp(),
from: { "role": "user" },
id: "5.0",
text: "This is helpful, thanks! Can you tell me more about the company policies I need to know?",
type: "message"
},
{
timestamp: timestamp(),
from: { role: 'bot' },
entities: [aiMessageEntity],
id: "5.1",
text: `Certainly! Here are the key company policies you should be aware of:
1. Code of Conduct: Outlines expected behavior and ethical standards.
2. IT Usage Policy: Guidelines for using company computers and networks.
3. Confidentiality Agreement: Explains how to handle sensitive information.
4. Time Off and Leave Policy: Details vacation, sick days, and other leave types.
5. Remote Work Policy: Explains our hybrid work model and expectations.
You can find detailed information on all these policies in the Employee Handbook, which is available at:
[Employee Handbook](https://sharepoint.contoso.com/newhires/EmployeeHandbook.pdf)
Would you like me to summarize any specific policy for you?`,
type: "message"
},
{
timestamp: timestamp(),
from: { "role": "user" },
id: "6.0",
text: "The Remote Work Policy sounds interesting. Can you give me a quick overview?",
type: "message"
},
{
timestamp: timestamp(),
from: { role: 'bot' },
entities: [aiMessageEntity],
id: "6.1",
text: `Certainly! Here's a brief overview of our Remote Work Policy:
1. Hybrid Model: We operate on a 3-2 model (3 days in office, 2 days remote per week).
2. Core Hours: All employees should be available online from 10 AM to 3 PM, regardless of location.
3. Equipment: The company provides necessary equipment for home offices.
4. Security: VPN must be used when accessing company resources remotely.
5. Communication: Teams is our primary platform for remote collaboration.
6. Productivity: Regular check-ins with supervisors to ensure work progress.
Remember, this is just a summary. For full details, please refer to the Employee Handbook.
Is there anything specific about the Remote Work Policy you'd like to know more about?`,
type: "message"
},
{
timestamp: timestamp(),
from: { "role": "user" },
id: "7.0",
text: "That's great, thanks! I think I'm all set for now. Is there anything else I should know for my first day?",
type: "message"
},
{
timestamp: timestamp(),
from: { role: 'bot' },
entities: [
aiMessageEntity,
{
"@context": "https://schema.org",
"@id": "cite:1",
"@type": "Claim",
type: "https://schema.org/Claim",
text: "The onboarding process is crucial for new hires. It helps them understand company culture, policies, and their role. A well-structured onboarding program can significantly improve employee retention and productivity."
}
],
suggestedActions: {
actions: [
{
displayText: 'Tell me more about onboarding process',
text: 'Tell me more about onboarding process',
title: 'Tell me more about onboarding process',
type: 'messageBack'
}
]
},
id: "7.1",
text: `I'm glad I could help! For your first day, here are some tips[1]:
1. Dress Code: Business casual dress code[2].
2. Lunch: The cafeteria is on the 2nd floor[3], or you can join your team for lunch as scheduled.
3. Building Access: Your employee badge will be provided during your welcome meeting with HR[4].
4. Questions: Don't hesitate to ask questions - everyone is here to help you succeed[5]!
5. Parking: Park in the 'New Employee' spots first week[6]\u200C[7].
Otherwise parking permit is required[7].
[1]: https://sharepoint.contoso.com/newhires/FirstDayTips.pdf \"Contoso First Day Tips\"
[2]: https://sharepoint.contoso.com/hr/DressCodePolicy.pdf \"Contoso Dress Code Policy\"
[3]: https://sharepoint.contoso.com/facilities/CafeteriaMenu.pdf \"Contoso Cafeteria Information and Weekly Menu\"
[4]: https://sharepoint.contoso.com/security/BadgeAccessGuide.pdf \"Contoso Building Access and Badge Information\"
[5]: https://sharepoint.contoso.com/hr/NewHireFAQ.pdf \"Frequently Asked Questions for New Hires\"
[6]: https://sharepoint.contoso.com/facilities/ParkingMap.pdf \"Contoso Office Parking Map\"
[7]: cite:1 \"Meet the Contoso Team\"`,
type: "message"
}
], [
{
timestamp: timestamp(),
from: { "role": "user" },
id: "6.0",
text: "Help me access my team’s sprint board?",
type: "message"
},
{
timestamp: timestamp(),
from: { role: 'bot' },
entities: [aiMessageEntity],
id: "7.1",
text: `To access your team's sprint board, you can follow these steps:
Check if you have the necessary permissions to access the sprint board. You might need to be part of a specific security group or have a particular role assigned to you.
1. If you're unsure about your access rights or need to request access, you can reach out to your team.
2. Once you have access, you can navigate to the board through the Azure DevOps portal. Look for the board under the 'Boards' tab in your project's dashboard.
If your access is still pending, consider emailing your manager to remind them to give you access.`,
type: "message"
},
{
timestamp: timestamp(),
from: { role: 'channel' },
text: `Extension refreshed`,
type: 'message'
}
], [
{
timestamp: timestamp(),
from: { "role": "user" },
id: "6.0",
text: "Start onboarding",
type: "message"
},
{
timestamp: timestamp(),
from: { role: 'bot' },
entities: [{
...aiMessageEntity,
keywords: []
}],
id: "a4c0c01d-c06e-4dde-9278-265c607b545b",
type: "typing",
text: "Processing your request…",
channelData: {
streamType: "informative",
streamSequence: 1
}
},
{
timestamp: timestamp(),
from: { role: 'bot' },
entities: [aiMessageEntity],
id: "a4c0c01d-c06e-4dde-9278-265c607b545b-89",
type: "typing",
text: "Hello there! I'm your Onboarding Buddy, here to guide you through your first days at our company. Let's go over some important information:\n\n- Your **orientation session** is scheduled for tomorrow at **9:00 AM** in the main conference room.",
channelData: {
streamType: "streaming",
streamId: "a4c0c01d-c06e-4dde-9278-265c607b5457",
streamSequence: 90
}
},
{
timestamp: timestamp(),
from: { role: 'bot' },
entities: [aiMessageEntity],
id: "a4c0c01d-c06e-4dde-9278-265c607b545b-82",
type: "message",
text: "- Don't forget to complete your **new hire paperwork** by the end of this week. This includes your tax forms, benefits enrollment, and emergency contact information.\n\nGood luck!",
channelData: {
streamType: "final",
streamId: "a4c0c01d-c06e-4dde-9278-265c607b5457",
streamSequence: 99
}
}
], [
{
timestamp: timestamp(),
from: { "role": "user" },
id: "6.0",
text: `Help me to create a beautiful visualization of harmonic waves using Python, complete the following code:
\`\`\`python
def plot_sine_waves():
t = np.linspace(0, 10, 1000)
\`\`\``,
type: "message"
},
{
timestamp: timestamp(),
from: { role: 'bot' },
entities: [{
...aiMessageEntity,
isBasedOn: {
'@type': 'SoftwareSourceCode',
'programmingLanguage': 'python',
"text": `import numpy as np
import matplotlib.pyplot as plt
def plot_sine_waves():
"""Create a beautiful visualization of sine waves with different frequencies."""
# Generate time points
t = np.linspace(0, 10, 1000)
# Create waves with different frequencies and phases
wave1 = np.sin(t)
wave2 = 0.5 * np.sin(2 * t + np.pi/4)
wave3 = 0.3 * np.sin(3 * t + np.pi/3)
# Combine waves
combined = wave1 + wave2 + wave3
# Create a stylish plot
plt.style.use('seaborn-darkgrid')
plt.figure(figsize=(12, 8))
# Plot individual waves
plt.plot(t, wave1, label='Primary Wave', alpha=0.5)
plt.plot(t, wave2, label='Second Harmonic', alpha=0.5)
plt.plot(t, wave3, label='Third Harmonic', alpha=0.5)
# Plot combined wave with a thicker line
plt.plot(t, combined, 'r-',
label='Combined Wave',
linewidth=2)
plt.title('Harmonic Wave Composition', fontsize=14)
plt.xlabel('Time', fontsize=12)
plt.ylabel('Amplitude', fontsize=12)
plt.legend()
plt.grid(True, alpha=0.3)
# Show the plot
plt.tight_layout()
plt.show()
# Generate the visualization
plot_sine_waves()`
}
}],
id: "a4c0c01d-c06e-4dde-9278-265c607b545b-82",
type: "message",
text: `This example demonstrates creating a visualization of harmonic waves using Python's Matplotlib library. The code generates three sine waves with different frequencies and phases, then combines them to show wave interference patterns.
<img alt="wave plot" src="${waveSvg}">
Use the command to install required dependencies:
$ pip install numpy matplotlib`
}
], [
{
from: {
role: "bot"
},
id: "a-00000",
type: "message",
text: "This is compleded feedback action example.",
timestamp: timestamp(),
entities: [
{
...aiMessageEntity,
keywords: ['AIGeneratedContent', 'AllowCopy'],
potentialAction: [
{
"@type": "LikeAction",
actionStatus: "CompletedActionStatus",
target: {
"@type": "EntryPoint",
urlTemplate: "ms-directline://postback?interaction=like"
}
},
{
"@type": "DislikeAction",
actionStatus: "PotentialActionStatus",
result: {
"@type": "Review",
reviewBody: "I don't like it.",
"reviewBody-input": {
"@type": "PropertyValueSpecification",
valueMinLength: 3,
valueName: "reason"
}
},
target: {
"@type": "EntryPoint",
urlTemplate: "ms-directline://postback?interaction=dislike{&reason}"
}
}
]
}
]
},
{
from: {
role: "bot"
},
id: "a-00001",
type: "message",
text: "Hi! I'm Cody, the devbot. How can I help?",
timestamp: timestamp(),
entities: [
{
...aiMessageEntity,
keywords: ['AIGeneratedContent', 'AllowCopy'],
potentialAction: [
{
"@type": "LikeAction",
actionStatus: "PotentialActionStatus",
target: {
"@type": "EntryPoint",
urlTemplate: "ms-directline://postback?interaction=like"
}
},
{
"@type": "DislikeAction",
actionStatus: "PotentialActionStatus",
result: {
"@type": "Review",
reviewBody: "I don't like it.",
"reviewBody-input": {
"@type": "PropertyValueSpecification",
valueMinLength: 3,
valueName: "reason"
}
},
target: {
"@type": "EntryPoint",
urlTemplate: "ms-directline://postback?interaction=dislike{&reason}"
}
}
]
}
]
}
]];
const leftStore = testHelpers.createStore();
const leftDirectLine = await testHelpers.createDirectLineWithTranscript(transcripts.at(leftTranscriptIndex));
const rightStore = testHelpers.createStore();
const rightDirectLine = await testHelpers.createDirectLineWithTranscript(transcripts.at(rightTranscriptIndex));
const root = createRoot(document.getElementById('webchat'));
const customBrandRamp = {
'10': '#12174c',
'20': '#1a1f5b',
'30': '#21276a',
'40': '#293079',
'50': '#303788',
'60': '#384097',
'70': '#4049a7',
'80': '#151e80',
'90': '#4f59c5',
'100': '#5661d4',
'110': '#5e69e3',
'120': '#7982e8',
'130': '#949bec',
'140': '#afb5f1',
'150': '#c9cdf6',
'160': '#e4e6fa'
};
const App = () => {
const theme = searchParams.get('theme');
const isDarkTheme = theme === 'fluent-dark';
const fluentProviderTheme = isDarkTheme ? {
...createDarkTheme(customBrandRamp),
colorNeutralBackground1Disabled: '#101010',
colorNeutralBackground1Hover: '#101010',
colorNeutralForeground5: '#424242'
} : undefined;
return React.createElement(FluentProvider, {
className: `theme-provider ${isDarkTheme ? 'dark' : 'light'}`,
theme: fluentProviderTheme
},
React.createElement('div', { className: "webchat-left" },
React.createElement(FluentThemeProvider, { variant: leftVariant },
React.createElement(ReactWebChat, {
directLine: leftDirectLine,
store: leftStore,
overrideLocalizedStrings: {
TEXT_INPUT_PLACEHOLDER: 'Describe how your copilot should behave'
},
styleOptions: {
maxMessageLength: null,
...adjustStyleOptions
}
})
)
),
React.createElement('div', { className: "webchat-right" },
React.createElement(FluentThemeProvider, { variant: rightVariant },
React.createElement(ReactWebChat, {
directLine: rightDirectLine,
store: rightStore,
overrideLocalizedStrings: {
TEXT_INPUT_PLACEHOLDER: 'Ask a work question or use / to reference people, files and more',
ACTIVITY_CODE_CAUTION: 'AI-generated code. Review and use carefully. [More info on FAQ](https://aka.ms/AIandCopilotFAQs).'
},
styleOptions: {
groupTimestamp: 1,
timestampFormat: 'absolute',
botAvatarBackgroundColor: '#304E7A',
...adjustStyleOptions
}
})
)
)
);
}
root.render(
React.createElement(App)
);
await host.snapshot('local');
const focusPresetsMap = new Map(Object.entries({
navigation: async sendbox => {
sendbox.focus();
await host.sendKeys('Next message');
await host.snapshot('local');
await host.sendKeys('ENTER');
// hide timestamp to not fail snapshot if is not relative
sendbox.parentElement.parentElement.parentElement.parentElement.querySelector('.webchat__basic-transcript__activity:last-child .stacked-layout__status').style.opacity = 0;
await host.snapshot('local');
await host.sendShiftTab();
await host.snapshot('local');
await host.sendKeys('HOME');
await host.snapshot('local');
await host.sendKeys('END');
await host.snapshot('local');
await host.sendKeys('ARROW_UP');
await host.snapshot('local');
await host.sendKeys('ENTER');
await host.sendShiftTab();
await host.snapshot('local');
await host.sendKeys('ENTER');
await host.snapshot('local');
await host.sendKeys('ESCAPE');
},
viewCode: async sendbox => {
sendbox.focus();
await host.sendShiftTab();
await host.sendKeys('ARROW_UP');
await host.sendKeys('ENTER');
await host.snapshot('local');
await host.sendKeys('TAB');
await host.snapshot('local');
await host.sendKeys('ENTER');
await host.snapshot('local');
await host.sendKeys('ENTER');
await host.snapshot('local');
},
likeDislike: async sendbox => {
sendbox.focus();
await host.sendShiftTab();
await host.sendKeys('ARROW_UP');
await host.sendKeys('ENTER');
await host.snapshot('local');
await host.sendKeys('TAB');
await host.snapshot('local');
await host.sendKeys('SPACE');
await host.snapshot('local');
await host.sendKeys('TAB');
await host.snapshot('local');
await host.sendKeys('SPACE');
await host.snapshot('local');
await host.sendKeys('SPACE'); // Clear feedback but still focused on feedback button
await host.sendKeys('ESCAPE'); // Focus on activity
await host.sendKeys('ESCAPE'); // Clear activity selection
await host.snapshot('local');
}
}));
const sendboxes = Array.from(document.querySelectorAll(`[data-testid="${WebChat.testIds.sendBoxTextBox}"]`))
.filter((_, index) => sendBoxIndexes.includes(String(index)));
const focusPresets = activeFocusPresets
.map(presetName => focusPresetsMap.get(presetName))
.filter(preset => preset)
if (!focusPresets.length) focusPresets.push(focusPresetsMap.get('navigation'));
for (const preset of focusPresets) {
for (const sendbox of sendboxes) {
await preset(sendbox)
}
}
}, { skipCheckAccessibility: true });
window.checkAccessibility = async () => {}
</script>
</body>
</html>