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

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 (20) hide show
  1. package/dist/dist-cjs/communication-react/index.js +35 -34
  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/styles/ChatMessageComponent.styles.d.ts +8 -0
  13. package/dist/dist-esm/react-components/src/components/styles/ChatMessageComponent.styles.js +23 -2
  14. package/dist/dist-esm/react-components/src/components/styles/ChatMessageComponent.styles.js.map +1 -1
  15. package/dist/dist-esm/react-components/src/components/styles/EditBox.styles.js +2 -2
  16. package/dist/dist-esm/react-components/src/components/styles/EditBox.styles.js.map +1 -1
  17. package/dist/dist-esm/react-components/src/components/styles/InputBoxComponent.style.d.ts +0 -4
  18. package/dist/dist-esm/react-components/src/components/styles/InputBoxComponent.style.js +0 -9
  19. package/dist/dist-esm/react-components/src/components/styles/InputBoxComponent.style.js.map +1 -1
  20. 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-202310140012';
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);