@azure/communication-react 1.9.0-alpha-202310130013 → 1.9.0-alpha-202310170013

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 (30) hide show
  1. package/dist/dist-cjs/communication-react/index.js +69 -53
  2. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  3. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  5. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js +7 -5
  6. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js.map +1 -1
  7. package/dist/dist-esm/react-components/src/components/InputBoxComponent.d.ts +1 -5
  8. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js +4 -5
  9. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js.map +1 -1
  10. package/dist/dist-esm/react-components/src/components/SendBox.js +1 -1
  11. package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
  12. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js +7 -3
  13. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js.map +1 -1
  14. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.d.ts +4 -0
  15. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js +22 -14
  16. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js.map +1 -1
  17. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.styles.d.ts +2 -2
  18. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.styles.js +8 -5
  19. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.styles.js.map +1 -1
  20. package/dist/dist-esm/react-components/src/components/styles/ChatMessageComponent.styles.d.ts +8 -0
  21. package/dist/dist-esm/react-components/src/components/styles/ChatMessageComponent.styles.js +23 -2
  22. package/dist/dist-esm/react-components/src/components/styles/ChatMessageComponent.styles.js.map +1 -1
  23. package/dist/dist-esm/react-components/src/components/styles/EditBox.styles.js +2 -2
  24. package/dist/dist-esm/react-components/src/components/styles/EditBox.styles.js.map +1 -1
  25. package/dist/dist-esm/react-components/src/components/styles/InputBoxComponent.style.d.ts +0 -4
  26. package/dist/dist-esm/react-components/src/components/styles/InputBoxComponent.style.js +0 -9
  27. package/dist/dist-esm/react-components/src/components/styles/InputBoxComponent.style.js.map +1 -1
  28. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.d.ts +1 -0
  29. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
  30. package/package.json +9 -9
@@ -177,7 +177,7 @@ const _isValidIdentifier = (identifier) => {
177
177
  // Copyright (c) Microsoft Corporation.
178
178
  // Licensed under the MIT License.
179
179
  // GENERATED FILE. DO NOT EDIT MANUALLY.
180
- var telemetryVersion = '1.9.0-alpha-202310130013';
180
+ var telemetryVersion = '1.9.0-alpha-202310170013';
181
181
 
182
182
  // Copyright (c) Microsoft Corporation.
183
183
  /**
@@ -6190,12 +6190,6 @@ const inputBoxStyle = react.mergeStyles({
6190
6190
  fontSize: '0.875rem'
6191
6191
  }
6192
6192
  });
6193
- /**
6194
- * @private
6195
- */
6196
- const inputBoxNewLineSpaceAffordance = {
6197
- marginBottom: '2rem'
6198
- };
6199
6193
  /**
6200
6194
  *
6201
6195
  * @private
@@ -6242,21 +6236,6 @@ const inputButtonStyle = react.mergeStyles({
6242
6236
  backgroundColor: 'transparent'
6243
6237
  }
6244
6238
  });
6245
- /**
6246
- * @private
6247
- */
6248
- const newLineButtonsContainerStyle = {
6249
- position: 'absolute',
6250
- right: '0.8rem',
6251
- bottom: '0.6rem',
6252
- gap: '0'
6253
- };
6254
- /**
6255
- * @private
6256
- */
6257
- const sameLineButtonsContainerStyle = {
6258
- alignSelf: 'end'
6259
- };
6260
6239
  /**
6261
6240
  * @private
6262
6241
  */
@@ -7905,7 +7884,7 @@ const TextFieldWithMention = (props) => {
7905
7884
  const InputBoxComponent = (props) => {
7906
7885
  const { styles, id, 'data-ui-id': dataUiId, textValue, onChange, textFieldRef, placeholderText, onKeyDown, onEnterKeyDown, supportNewline, inputClassName, errorMessage, disabled, children } = props;
7907
7886
  const mergedRootStyle = react.mergeStyles(inputBoxWrapperStyle, styles === null || styles === void 0 ? void 0 : styles.root);
7908
- const mergedInputFieldStyle = react.mergeStyles(inputBoxStyle, inputClassName, props.inlineChildren ? {} : inputBoxNewLineSpaceAffordance);
7887
+ const mergedInputFieldStyle = react.mergeStyles(inputBoxStyle, inputClassName);
7909
7888
  const mergedTextContainerStyle = react.mergeStyles(textContainerStyle, styles === null || styles === void 0 ? void 0 : styles.textFieldContainer);
7910
7889
  const mergedTextFieldStyle = react.concatStyleSets(textFieldStyle, {
7911
7890
  fieldGroup: styles === null || styles === void 0 ? void 0 : styles.textField,
@@ -7915,7 +7894,6 @@ const InputBoxComponent = (props) => {
7915
7894
  padding: '0 0'
7916
7895
  }
7917
7896
  });
7918
- const mergedChildrenStyle = react.mergeStyles(props.inlineChildren ? sameLineButtonsContainerStyle : newLineButtonsContainerStyle);
7919
7897
  const onTextFieldKeyDown = React.useCallback((ev) => {
7920
7898
  if (isEnterKeyEventFromCompositionSession(ev)) {
7921
7899
  return;
@@ -7927,7 +7905,7 @@ const InputBoxComponent = (props) => {
7927
7905
  onKeyDown && onKeyDown(ev);
7928
7906
  }, [onEnterKeyDown, onKeyDown, supportNewline]);
7929
7907
  const onRenderChildren = () => {
7930
- return (React__default["default"].createElement(react.Stack, { horizontal: true, className: mergedChildrenStyle }, children));
7908
+ return React__default["default"].createElement(React__default["default"].Fragment, null, children);
7931
7909
  };
7932
7910
  const renderTextField = () => {
7933
7911
  const textFieldProps = {
@@ -7944,7 +7922,7 @@ const InputBoxComponent = (props) => {
7944
7922
  styles: mergedTextFieldStyle,
7945
7923
  disabled,
7946
7924
  errorMessage,
7947
- onRenderSuffix: onRenderChildren
7925
+ onRenderSuffix: props.children ? onRenderChildren : undefined
7948
7926
  };
7949
7927
  /* @conditional-compile-remove(mention) */
7950
7928
  const textFieldWithMentionProps = {
@@ -8316,7 +8294,7 @@ const SendBox = (props) => {
8316
8294
  hasErrorMessage: !!errorMessage,
8317
8295
  disabled: !!disabled
8318
8296
  })) },
8319
- React__default["default"].createElement(InputBoxComponent, { autoFocus: autoFocus, "data-ui-id": ids.sendboxTextField, inlineChildren: true, disabled: disabled, errorMessage: onRenderSystemMessage ? onRenderSystemMessage(errorMessage) : errorMessage, textFieldRef: sendTextFieldRef, id: "sendbox", placeholderText: strings.placeholderText, textValue: textValue, onChange: (_, newValue) => setText(newValue), onKeyDown: (ev) => {
8297
+ React__default["default"].createElement(InputBoxComponent, { autoFocus: autoFocus, "data-ui-id": ids.sendboxTextField, disabled: disabled, errorMessage: onRenderSystemMessage ? onRenderSystemMessage(errorMessage) : errorMessage, textFieldRef: sendTextFieldRef, id: "sendbox", placeholderText: strings.placeholderText, textValue: textValue, onChange: (_, newValue) => setText(newValue), onKeyDown: (ev) => {
8320
8298
  const keyWasSendingMessage = ev.key === 'Enter' && (ev.shiftKey === false || !supportNewline);
8321
8299
  if (!keyWasSendingMessage) {
8322
8300
  onTyping === null || onTyping === void 0 ? void 0 : onTyping();
@@ -9008,10 +8986,10 @@ const editBoxStyle = react.mergeStyles({
9008
8986
  * @private
9009
8987
  */
9010
8988
  const editingButtonStyle = react.mergeStyles({
9011
- margin: 'auto 0',
8989
+ margin: '0',
9012
8990
  width: '2.125rem',
9013
8991
  height: '2.125rem',
9014
- padding: '0.25rem 0 0 0'
8992
+ padding: '0.375rem 0 0 0'
9015
8993
  });
9016
8994
  /**
9017
8995
  * @private
@@ -9073,7 +9051,26 @@ const chatMessageEditedTagStyle = (theme) => react.mergeStyles({ fontWeight: rea
9073
9051
  /**
9074
9052
  * @private
9075
9053
  */
9076
- const chatMessageFailedTagStyle = (theme) => react.mergeStyles({ fontWeight: react.FontWeights.regular, color: theme.semanticColors.errorText });
9054
+ const chatMessageFailedTagStyle = (theme) => react.mergeStyles({
9055
+ fontWeight: react.FontWeights.regular,
9056
+ color: theme.semanticColors.errorText,
9057
+ fontSize: theme.fonts.smallPlus.fontSize,
9058
+ lineHeight: '1rem'
9059
+ });
9060
+ /**
9061
+ * @private
9062
+ */
9063
+ const chatMessageFailedTagStackItemStyle = react.mergeStyles({
9064
+ alignSelf: 'end',
9065
+ paddingBottom: '0.25rem'
9066
+ });
9067
+ /**
9068
+ * @private
9069
+ */
9070
+ const editChatMessageButtonsStackStyle = react.mergeStyles({
9071
+ padding: '0 0.5rem 0.5rem 0.5rem',
9072
+ marginTop: '-0.25rem'
9073
+ });
9077
9074
  /**
9078
9075
  * @private
9079
9076
  */
@@ -9090,7 +9087,9 @@ const useChatMessageEditContainerStyles = reactComponents.makeStyles({
9090
9087
  root: {
9091
9088
  paddingTop: '1.25rem' //height of the menu button + marginBottom
9092
9089
  },
9093
- body: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, reactComponents.shorthands.padding(0)), { backgroundColor: 'transparent', width: '100%', boxSizing: 'border-box' }), reactComponents.shorthands.border(`${defaultSendBoxInactiveBorderThicknessREM}rem`, 'solid')), reactComponents.shorthands.borderRadius(reactComponents.tokens.borderRadiusMedium)), reactComponents.shorthands.margin(`${defaultSendBoxActiveBorderThicknessREM - defaultSendBoxInactiveBorderThicknessREM}rem`)), { '&:hover, &:active, &:focus, &:focus-within': Object.assign(Object.assign({}, reactComponents.shorthands.margin('0rem')), reactComponents.shorthands.borderWidth(`${defaultSendBoxActiveBorderThicknessREM}rem`)) }),
9090
+ body: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, reactComponents.shorthands.padding(0)), { backgroundColor: 'transparent', boxSizing: 'border-box' }), reactComponents.shorthands.border(`${defaultSendBoxInactiveBorderThicknessREM}rem`, 'solid')), reactComponents.shorthands.borderRadius(reactComponents.tokens.borderRadiusMedium)), reactComponents.shorthands.margin(`${defaultSendBoxActiveBorderThicknessREM - defaultSendBoxInactiveBorderThicknessREM}rem`)), {
9091
+ // Width should be updated on hover to include the border width change
9092
+ width: `calc(100% - ${defaultSendBoxActiveBorderThicknessREM}rem)`, '&:hover, &:active, &:focus, &:focus-within': Object.assign(Object.assign(Object.assign({}, reactComponents.shorthands.margin('0rem')), reactComponents.shorthands.borderWidth(`${defaultSendBoxActiveBorderThicknessREM}rem`)), { width: '100%' }) }),
9094
9093
  bodyError: Object.assign({}, reactComponents.shorthands.borderColor(errorTextColor)),
9095
9094
  bodyDefault: Object.assign(Object.assign({}, reactComponents.shorthands.borderColor(reactComponents.tokens.colorNeutralStrokeAccessible)), { '&:hover, &:active, &:focus, &:focus-within': Object.assign({}, reactComponents.shorthands.borderColor(reactComponents.tokens.colorCompoundBrandStroke)) })
9096
9095
  });
@@ -9187,7 +9186,7 @@ const ChatMessageComponentAsEditBox = (props) => {
9187
9186
  }, [attachedFilesMetadata]);
9188
9187
  const getContent = () => {
9189
9188
  return (React__default["default"].createElement(React__default["default"].Fragment, null,
9190
- React__default["default"].createElement(InputBoxComponent, { inlineChildren: false, id: 'editbox', textFieldRef: editTextFieldRef, inputClassName: editBoxStyle, placeholderText: strings.editBoxPlaceholderText, textValue: textValue, onChange: setText, onKeyDown: (ev) => {
9189
+ React__default["default"].createElement(InputBoxComponent, { id: 'editbox', textFieldRef: editTextFieldRef, inputClassName: editBoxStyle, placeholderText: strings.editBoxPlaceholderText, textValue: textValue, onChange: setText, onKeyDown: (ev) => {
9191
9190
  if (ev.key === 'ArrowUp' || ev.key === 'ArrowDown') {
9192
9191
  ev.stopPropagation();
9193
9192
  }
@@ -9198,7 +9197,10 @@ const ChatMessageComponentAsEditBox = (props) => {
9198
9197
  });
9199
9198
  }, supportNewline: false, maxLength: MAXIMUM_LENGTH_OF_MESSAGE, errorMessage: textTooLongMessage, styles: editBoxStyles,
9200
9199
  /* @conditional-compile-remove(mention) */
9201
- mentionLookupOptions: mentionLookupOptions },
9200
+ mentionLookupOptions: mentionLookupOptions }),
9201
+ React__default["default"].createElement(react.Stack, { horizontal: true, horizontalAlign: "end", verticalAlign: "start", className: editChatMessageButtonsStackStyle, tokens: { childrenGap: '0.25rem' } },
9202
+ message.failureReason && (React__default["default"].createElement(react.Stack.Item, { grow: true, className: chatMessageFailedTagStackItemStyle },
9203
+ React__default["default"].createElement("div", { className: chatMessageFailedTagStyle(theme) }, message.failureReason))),
9202
9204
  React__default["default"].createElement(InputBoxButton, { className: editingButtonStyle, ariaLabel: strings.editBoxCancelButton, tooltipContent: strings.editBoxCancelButton, onRenderIcon: onRenderThemedCancelIcon, onClick: () => {
9203
9205
  onCancel && onCancel(message.messageId);
9204
9206
  }, id: 'dismissIconWrapper' }),
@@ -9209,7 +9211,6 @@ const ChatMessageComponentAsEditBox = (props) => {
9209
9211
  });
9210
9212
  e.stopPropagation();
9211
9213
  }, id: 'submitIconWrapper' })),
9212
- message.failureReason && (React__default["default"].createElement("div", { className: react.mergeStyles(chatMessageFailedTagStyle(theme), { padding: '0.5rem' }) }, message.failureReason)),
9213
9214
  onRenderFileUploads()));
9214
9215
  };
9215
9216
  const bodyClassName = reactComponents.mergeClasses(editContainerStyles.body, message.failureReason !== undefined ? editContainerStyles.bodyError : editContainerStyles.bodyDefault);
@@ -17607,19 +17608,17 @@ const videoEffectsItemContainerStyles = (args) => {
17607
17608
  color: args.theme.palette.neutralPrimary,
17608
17609
  cursor: args.disabled ? 'default' : 'pointer',
17609
17610
  height: VideoEffectsItemContainerHeight,
17610
- position: 'relative',
17611
17611
  width: VideoEffectsItemContainerWidth,
17612
+ border: args.isSelected
17613
+ ? `${borderActiveThickness} solid ${args.theme.palette.themePrimary}`
17614
+ : `${borderDefaultThickness} solid ${args.theme.palette.neutralQuaternaryAlt}`,
17612
17615
  // Use :after to display a border element. This is used to prevent the background image
17613
17616
  // resizing when the border thichkness is changed. We also want the border to be inside
17614
17617
  // the frame of the container, i.e. we want it to expand inwards and not outwards when
17615
17618
  // border thickness changes from hover/selection.
17616
17619
  ':after': {
17617
17620
  content: '""',
17618
- position: 'absolute',
17619
17621
  boxSizing: 'border-box',
17620
- border: args.isSelected
17621
- ? `${borderActiveThickness} solid ${args.theme.palette.themePrimary}`
17622
- : `${borderDefaultThickness} solid ${args.theme.palette.neutralQuaternaryAlt}`,
17623
17622
  height: '100%',
17624
17623
  width: '100%',
17625
17624
  borderRadius: '0.25rem'
@@ -17631,6 +17630,11 @@ const videoEffectsItemContainerStyles = (args) => {
17631
17630
  : `${borderActiveThickness} solid ${args.theme.palette.themePrimary}`
17632
17631
  }
17633
17632
  }
17633
+ },
17634
+ rootFocused: {
17635
+ ':after': {
17636
+ outline: `2px solid ${args.theme.palette.neutralQuaternaryAlt}`
17637
+ }
17634
17638
  }
17635
17639
  };
17636
17640
  };
@@ -17653,19 +17657,27 @@ const _VideoEffectsItem = (props) => {
17653
17657
  disabled,
17654
17658
  backgroundImage
17655
17659
  }), [backgroundImage, disabled, isSelected, theme]);
17660
+ const componentRef = React__default["default"].createRef();
17661
+ React.useEffect(() => {
17662
+ if (props.focusOnMount && componentRef.current) {
17663
+ componentRef.current.focus();
17664
+ }
17665
+ }, [componentRef, props.focusOnMount]);
17656
17666
  return (React__default["default"].createElement(react.TooltipHost, Object.assign({}, props.tooltipProps),
17657
- React__default["default"].createElement(react.Stack, { key: props.itemKey, className: react.mergeStyles((_d = props.styles) === null || _d === void 0 ? void 0 : _d.root), verticalAlign: "center", horizontalAlign: "center", styles: containerStyles, "data-ui-id": `video-effects-item`, onClick: disabled ? undefined : () => { var _a; return (_a = props.onSelect) === null || _a === void 0 ? void 0 : _a.call(props, props.itemKey); }, onKeyDown: disabled
17658
- ? undefined
17659
- : (e) => {
17660
- var _a;
17661
- if (e.key === 'Enter' || e.key === ' ') {
17662
- (_a = props.onSelect) === null || _a === void 0 ? void 0 : _a.call(props, props.itemKey);
17663
- }
17664
- }, tabIndex: props.disabled ? -1 : 0, "aria-label": (_e = props.ariaLabel) !== null && _e !== void 0 ? _e : props.itemKey, "aria-disabled": props.disabled, role: "button" },
17665
- props.iconProps && (React__default["default"].createElement(react.Stack.Item, { styles: { root: (_f = props.styles) === null || _f === void 0 ? void 0 : _f.iconContainer } },
17666
- React__default["default"].createElement(react.Icon, Object.assign({}, props.iconProps)))),
17667
- props.title && (React__default["default"].createElement(react.Stack.Item, { styles: { root: (_g = props.styles) === null || _g === void 0 ? void 0 : _g.textContainer } },
17668
- React__default["default"].createElement(react.Text, { variant: "small" }, props.title))))));
17667
+ React__default["default"].createElement(react.Stack, { key: props.itemKey, className: react.mergeStyles((_d = props.styles) === null || _d === void 0 ? void 0 : _d.root), verticalAlign: "center", horizontalAlign: "center", "data-ui-id": `video-effects-item`, "aria-label": (_e = props.ariaLabel) !== null && _e !== void 0 ? _e : props.itemKey, "aria-disabled": props.disabled },
17668
+ React__default["default"].createElement(react.DefaultButton, { styles: containerStyles(), onClick: disabled ? undefined : () => { var _a; return (_a = props.onSelect) === null || _a === void 0 ? void 0 : _a.call(props, props.itemKey); }, componentRef: componentRef, autoFocus: props.focusOnMount, onKeyDown: disabled
17669
+ ? undefined
17670
+ : (e) => {
17671
+ var _a;
17672
+ if (e.key === 'Enter' || e.key === ' ') {
17673
+ (_a = props.onSelect) === null || _a === void 0 ? void 0 : _a.call(props, props.itemKey);
17674
+ }
17675
+ } },
17676
+ React__default["default"].createElement(react.Stack, { horizontalAlign: 'center', tokens: { childrenGap: '0.15rem' } },
17677
+ props.iconProps && (React__default["default"].createElement(react.Stack.Item, { styles: { root: (_f = props.styles) === null || _f === void 0 ? void 0 : _f.iconContainer } },
17678
+ React__default["default"].createElement(react.Icon, Object.assign({}, props.iconProps)))),
17679
+ props.title && (React__default["default"].createElement(react.Stack.Item, { styles: { root: (_g = props.styles) === null || _g === void 0 ? void 0 : _g.textContainer } },
17680
+ React__default["default"].createElement(react.Text, { variant: "small" }, props.title))))))));
17669
17681
  };
17670
17682
 
17671
17683
  // Copyright (c) Microsoft Corporation.
@@ -17706,8 +17718,12 @@ const _VideoBackgroundEffectsPicker = (props) => {
17706
17718
  optionsByRow.map((options, rowIndex) => {
17707
17719
  var _a;
17708
17720
  return (React__default["default"].createElement(react.Stack, { className: react.mergeStyles((_a = props.styles) === null || _a === void 0 ? void 0 : _a.rowRoot), wrap: props.itemsPerRow === 'wrap', horizontal: true, key: rowIndex, tokens: { childrenGap: '0.5rem' }, "data-ui-id": "video-effects-picker-row" },
17709
- options.map((option) => (React__default["default"].createElement(react.FocusZone, { key: option.itemKey, shouldFocusOnMount: option.itemKey.includes('none') },
17710
- React__default["default"].createElement(_VideoEffectsItem, Object.assign({}, option, { itemKey: option.itemKey }))))),
17721
+ options.map((option, i) => {
17722
+ if (i === 0 && rowIndex === 0) {
17723
+ return (React__default["default"].createElement(_VideoEffectsItem, Object.assign({}, option, { itemKey: option.itemKey, key: option.itemKey, focusOnMount: true })));
17724
+ }
17725
+ return React__default["default"].createElement(_VideoEffectsItem, Object.assign({}, option, { itemKey: option.itemKey, key: option.itemKey }));
17726
+ }),
17711
17727
  fillCount > 0 &&
17712
17728
  rowIndex === optionsByRow.length - 1 &&
17713
17729
  Array.from({ length: fillCount }).map((_, index) => (React__default["default"].createElement(react.Stack, { key: index, styles: hiddenVideoEffectsItemContainerStyles, "data-ui-id": "video-effects-hidden-item" })))));