Skip to content

Commit e41d5a7

Browse files
authored
Merge pull request Paul-Borisov#9 from Paul-Borisov/beta-1.3
Beta 1.3
2 parents 1ceef09 + 79ea54e commit e41d5a7

File tree

8 files changed

+66
-25
lines changed

8 files changed

+66
-25
lines changed

package/azure-openai-chat.sppkg

244 Bytes
Binary file not shown.

spfx-latest/src/components/Chat.module.scss

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,15 @@ $selection: $ms-color-gray150;
267267
border: 1px #ccc solid;
268268
border-radius: 8px;
269269
height: 34px;
270-
padding: 15px 15px 0 15px;
270+
padding: 15px 15px 0 60px;
271271
@include scrollbars(1.4ex, $ms-color-gray120, rgba(0, 0, 0, 0.2));
272272
z-index: 10;
273+
&.noLeftMargin {
274+
padding-left: 15px;
275+
}
276+
&.shortLeftMargin {
277+
padding-left: 35px;
278+
}
273279
}
274280
.linkButton {
275281
flex: 0 0 35px;
@@ -292,6 +298,9 @@ $selection: $ms-color-gray150;
292298
background-color: $hover-color;
293299
}
294300
}
301+
i {
302+
color: #000;
303+
}
295304
}
296305
.requestCharsCount {
297306
font-size: 12px;

spfx-latest/src/components/ContentPanel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ const ContentPanel: FunctionComponent<IContentPanelProps> = ({ props }) => {
297297
signalReload,
298298
isCustomPanelOpen,
299299
isStreamProgress,
300-
fileUpload,
301300
setIsStreamProgress,
302301
setSignalReload,
303302
setModel
@@ -316,7 +315,8 @@ const ContentPanel: FunctionComponent<IContentPanelProps> = ({ props }) => {
316315
resizePrompt,
317316
setPrompt,
318317
submitPayload,
319-
panelLanguageModels
318+
panelLanguageModels,
319+
fileUpload
320320
);
321321

322322
const contentArea = elements.getContentArea(responseContentError, panelContentPane, promptContainer);

spfx-latest/src/components/ContentPanelElements.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export default class ContentPanelElements {
8787
const isPdfSupported = true;
8888
// Upload button should be visible only if Enable integrations is turned on in web part settings.
8989
return props.functions && (isVisionSupported || isPdfSupported) ? (
90-
<TooltipHost content={strings.TextUploadFiles}>
90+
<>
9191
{getSimpleDialog(strings.TextUpload, strings.TextUploadFiles, showUploadDialog, setShowUploadDialog, [
9292
<UploadFiles
9393
setImageUrls={isVisionSupported ? setImageUrls : undefined}
@@ -96,12 +96,12 @@ export default class ContentPanelElements {
9696
/>,
9797
])}
9898
<span className={[styles.fileUploadIcon, imageUrls?.length > 0 ? styles.selected : undefined].join(' ').trim()}>
99-
<FontIcon iconName="SkypeCircleArrow" onClick={() => setShowUploadDialog(true)} />
99+
<FontIcon iconName="Attach" onClick={() => setShowUploadDialog(true)} title={strings.TextUploadFiles} />
100100
<span className={[styles.fileCounter, props.promptAtBottom ? styles.promptAtBottom : undefined].join(' ').trim()}>
101101
{imageUrls?.length ? `(${imageUrls?.length})` : pdfFileContent ? `(${Object.keys(pdfFileContent).length})` : ''}
102102
</span>
103103
</span>
104-
</TooltipHost>
104+
</>
105105
) : null;
106106
}
107107

@@ -145,7 +145,6 @@ export default class ContentPanelElements {
145145
signalReload: boolean,
146146
isCustomPanelOpen: boolean,
147147
isStreamProgress: boolean,
148-
fileUpload: JSX.Element,
149148
setIsStreamProgress: (state: boolean) => void,
150149
setSignalReload: (state: boolean) => void,
151150
setModel: (newModel: string) => void
@@ -186,7 +185,6 @@ export default class ContentPanelElements {
186185
);
187186
}
188187
)}
189-
{fileUpload}
190188
</div>
191189
);
192190
}
@@ -232,7 +230,8 @@ export default class ContentPanelElements {
232230
resizePrompt: (e: any) => void,
233231
setPrompt: (text: string) => void,
234232
submitPayload: () => void,
235-
panelLanguageModels: JSX.Element
233+
panelLanguageModels: JSX.Element,
234+
fileUpload: JSX.Element
236235
): JSX.Element {
237236
const props = this.props;
238237

@@ -260,6 +259,8 @@ export default class ContentPanelElements {
260259
}}
261260
/>
262261
) : null}
262+
{fileUpload}
263+
{props.voiceInput ? <VoiceInput setText={setPrompt} shortLeftMargin={!props.functions} /> : null}
263264
<textarea
264265
ref={refPromptArea}
265266
placeholder={strings.TextSendMessage}
@@ -277,9 +278,15 @@ export default class ContentPanelElements {
277278
disabled={
278279
isProgress || isStreamProgress || (chatHistoryParams.maxContentLengthExceeded && !props.unlimitedHistoryLength)
279280
}
281+
className={
282+
!props.functions && !props.voiceInput
283+
? styles.noLeftMargin
284+
: !(props.functions && props.voiceInput)
285+
? styles.shortLeftMargin
286+
: undefined
287+
}
280288
/>
281289
{(!chatHistoryParams.maxContentLengthExceeded || props.unlimitedHistoryLength) && submitButton}
282-
{props.voiceInput ? <VoiceInput setText={setPrompt} /> : null}
283290
</div>
284291
<div className={styles.requestCharsCount}>
285292
{!chatHistoryParams.maxContentLengthExceeded || props.unlimitedHistoryLength

spfx-latest/src/components/UploadFiles.module.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
cursor: pointer;
2020
font-size: 150%;
2121
i {
22-
rotate: 100grad;
22+
rotate: 150grad;
2323
}
2424
.fileCounter {
2525
margin-left: 5px;
@@ -32,4 +32,8 @@
3232
&.selected {
3333
margin-right: 0px;
3434
}
35+
position: absolute;
36+
z-index: 65535;
37+
margin-top: 12px;
38+
margin-left: 10px;
3539
}

spfx-latest/src/shared/components/Speech/Speech.module.scss

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,24 @@
55
&.unavailable {
66
color: #ccc;
77
}
8+
position: absolute;
9+
z-index: 65535;
10+
margin-top: 15px;
11+
margin-left: 35px;
12+
&.shortLeftMargin {
13+
margin-left: 10px;
14+
}
15+
}
16+
.bgwhite {
17+
background-color: #fff;
18+
}
19+
.speech {
20+
position: relative;
21+
margin-left: 10px;
22+
margin-top: 0;
823
}
924
.stop {
10-
color: red;
25+
color: red !important;
1126
border-radius: 50%;
1227
box-shadow: 0px 0px 1px 1px #0000001a;
1328
animation: pulseAnimation 2s infinite;

spfx-latest/src/shared/components/Speech/VoiceInput.tsx

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import styles from './Speech.module.scss';
1010

1111
interface IVoiceInput extends IVoice {
1212
setText?: (text: string) => void;
13+
shortLeftMargin?: boolean;
1314
}
1415

1516
const VoiceInput: React.FunctionComponent<IVoiceInput> = (props) => {
@@ -41,25 +42,30 @@ const VoiceInput: React.FunctionComponent<IVoiceInput> = (props) => {
4142
return isAvailable ? (
4243
<>
4344
{!started ? (
44-
<TooltipHost content={props.tooltip ?? strings.TextVoiceInput}>
45-
<FontIcon iconName={'Microphone'} className={styles.microphone} onClick={() => setShowLocales(true)} />
46-
</TooltipHost>
45+
<FontIcon
46+
iconName={'Microphone'}
47+
className={[styles.microphone, props.shortLeftMargin ? styles.shortLeftMargin : undefined].join(' ')}
48+
onClick={() => setShowLocales(true)}
49+
title={props.tooltip ?? strings.TextVoiceInput}
50+
/>
4751
) : (
48-
<TooltipHost content={strings.TextStop}>
49-
<FontIcon
50-
iconName={'CircleStopSolid'}
51-
className={[styles.microphone, styles.stop].join(' ')}
52-
onClick={() => handleSpeechRecognition()}
53-
/>
54-
</TooltipHost>
52+
<FontIcon
53+
iconName={'CircleStopSolid'}
54+
className={[styles.microphone, styles.stop, props.shortLeftMargin ? styles.shortLeftMargin : undefined].join(' ')}
55+
onClick={() => handleSpeechRecognition()}
56+
title={strings.TextStop}
57+
/>
5558
)}
5659
{showLocales ? (
5760
<Languages handleSelection={handleSpeechRecognition} isOpen={showLocales} setIsOpen={setShowLocales} />
5861
) : null}
5962
</>
6063
) : (
6164
<TooltipHost content={strings.TextDeviceUnavailable}>
62-
<FontIcon iconName={'Microphone'} className={[styles.microphone, styles.unavailable].join(' ')} />
65+
<FontIcon
66+
iconName={'Microphone'}
67+
className={[styles.microphone, styles.unavailable, props.shortLeftMargin ? styles.shortLeftMargin : undefined].join(' ')}
68+
/>
6369
</TooltipHost>
6470
);
6571
};

spfx-latest/src/shared/components/Speech/VoiceOutput.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const VoiceOutput: React.FunctionComponent<IVoiceOutput> = (props) => {
6565
<TooltipHost content={props.tooltip ?? strings.TextVoiceOutput}>
6666
<FontIcon
6767
iconName={'InternetSharing'}
68-
className={styles.microphone}
68+
className={[styles.microphone, styles.speech].join(' ')}
6969
onClick={() => {
7070
if (!props.getAudio) {
7171
if (speechSynthesis.speaking) return;
@@ -97,7 +97,7 @@ const VoiceOutput: React.FunctionComponent<IVoiceOutput> = (props) => {
9797
<TooltipHost content={strings.TextStop}>
9898
<FontIcon
9999
iconName={!!props.getAudio && !player ? 'ProgressLoopInner' : 'CircleStopSolid'}
100-
className={[styles.microphone, styles.stop].join(' ')}
100+
className={[styles.microphone, styles.stop, styles.speech, styles.bgwhite].join(' ')}
101101
onClick={() => {
102102
if (!props.getAudio) {
103103
handleSpeechOutput();

0 commit comments

Comments
 (0)