@azure/communication-react 1.3.3-alpha-202208280018.0 → 1.3.3-alpha-202208300017.0
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.
- package/dist/communication-react.d.ts +2 -0
- package/dist/dist-cjs/communication-react/index.js +37 -24
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.d.ts +2 -0
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js +4 -4
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/useLongPress.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/utils/useLongPress.js +8 -1
- package/dist/dist-esm/react-components/src/components/utils/useLongPress.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +18 -11
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +4 -2
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/PreparedMoreDrawer.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/PreparedMoreDrawer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/MoreDrawer.js +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/MoreDrawer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.styles.js +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/SendDtmfDialpad.js +2 -2
- package/dist/dist-esm/react-composites/src/composites/common/SendDtmfDialpad.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/SendDtmfDialpad.styles.js +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/SendDtmfDialpad.styles.js.map +1 -1
- package/package.json +8 -8
@@ -4237,6 +4237,8 @@ export declare interface DialpadProps {
|
|
4237
4237
|
onChange?: (input: string) => void;
|
4238
4238
|
/** boolean input to determine when to show/hide delete button, default true */
|
4239
4239
|
showDeleteButton?: boolean;
|
4240
|
+
/** boolean input to determine if dialpad is in mobile view, default false */
|
4241
|
+
isMobile?: boolean;
|
4240
4242
|
styles?: DialpadStyles;
|
4241
4243
|
}
|
4242
4244
|
|
@@ -192,7 +192,7 @@ const fromFlatCommunicationIdentifier = (id) => {
|
|
192
192
|
// Copyright (c) Microsoft Corporation.
|
193
193
|
// Licensed under the MIT license.
|
194
194
|
// GENERATED FILE. DO NOT EDIT MANUALLY.
|
195
|
-
var telemetryVersion = '1.3.3-alpha-
|
195
|
+
var telemetryVersion = '1.3.3-alpha-202208300017.0';
|
196
196
|
|
197
197
|
// Copyright (c) Microsoft Corporation.
|
198
198
|
/**
|
@@ -7824,7 +7824,7 @@ const formatPhoneNumber = (phoneNumber) => {
|
|
7824
7824
|
/**
|
7825
7825
|
* @private
|
7826
7826
|
*/
|
7827
|
-
function useLongPress(onClick, onLongPress) {
|
7827
|
+
function useLongPress(onClick, onLongPress, isMobile) {
|
7828
7828
|
const timerRef = React.useRef();
|
7829
7829
|
const [isLongPress, setIsLongPress] = React.useState(false);
|
7830
7830
|
const [action, setAction] = React.useState(false);
|
@@ -7835,6 +7835,10 @@ function useLongPress(onClick, onLongPress) {
|
|
7835
7835
|
}, 500);
|
7836
7836
|
}
|
7837
7837
|
function handleOnClick() {
|
7838
|
+
// when it's mobile use ontouchstart and ontouchend to fire onclick and onlongpress event
|
7839
|
+
if (isMobile) {
|
7840
|
+
return;
|
7841
|
+
}
|
7838
7842
|
onClick();
|
7839
7843
|
if (isLongPress) {
|
7840
7844
|
onLongPress();
|
@@ -7861,6 +7865,9 @@ function useLongPress(onClick, onLongPress) {
|
|
7861
7865
|
startPressTimer();
|
7862
7866
|
}
|
7863
7867
|
function handleOnTouchEnd() {
|
7868
|
+
if (isMobile) {
|
7869
|
+
isLongPress ? onLongPress() : onClick();
|
7870
|
+
}
|
7864
7871
|
timerRef.current && clearTimeout(timerRef.current);
|
7865
7872
|
}
|
7866
7873
|
return {
|
@@ -7918,14 +7925,14 @@ const DtmfTones = [
|
|
7918
7925
|
const DialpadButton = (props) => {
|
7919
7926
|
var _a, _b, _c, _d;
|
7920
7927
|
const theme = react.useTheme();
|
7921
|
-
const { digit, index, onClick, onLongPress } = props;
|
7928
|
+
const { digit, index, onClick, onLongPress, isMobile = false } = props;
|
7922
7929
|
const clickFunction = React.useCallback(() => __awaiter$p(void 0, void 0, void 0, function* () {
|
7923
7930
|
onClick(digit, index);
|
7924
7931
|
}), [digit, index, onClick]);
|
7925
7932
|
const longPressFunction = React.useCallback(() => __awaiter$p(void 0, void 0, void 0, function* () {
|
7926
7933
|
onLongPress(digit, index);
|
7927
7934
|
}), [digit, index, onLongPress]);
|
7928
|
-
const { handlers } = useLongPress(clickFunction, longPressFunction);
|
7935
|
+
const { handlers } = useLongPress(clickFunction, longPressFunction, isMobile);
|
7929
7936
|
return (React__default['default'].createElement(react.DefaultButton, Object.assign({ "data-test-id": `dialpad-button-${props.index}`, styles: react.concatStyleSets(buttonStyles(), (_a = props.styles) === null || _a === void 0 ? void 0 : _a.button) }, handlers),
|
7930
7937
|
React__default['default'].createElement(react.Stack, null,
|
7931
7938
|
React__default['default'].createElement(react.Text, { className: react.mergeStyles(digitStyles(theme), (_b = props.styles) === null || _b === void 0 ? void 0 : _b.digit) }, props.digit),
|
@@ -7934,7 +7941,7 @@ const DialpadButton = (props) => {
|
|
7934
7941
|
const DialpadContainer = (props) => {
|
7935
7942
|
var _a, _b;
|
7936
7943
|
const theme = react.useTheme();
|
7937
|
-
const { onSendDtmfTone, onClickDialpadButton, textFieldValue, onChange, showDeleteButton = true } = props;
|
7944
|
+
const { onSendDtmfTone, onClickDialpadButton, textFieldValue, onChange, showDeleteButton = true, isMobile = false } = props;
|
7938
7945
|
const [plainTextValue, setPlainTextValue] = React.useState(textFieldValue !== null && textFieldValue !== void 0 ? textFieldValue : '');
|
7939
7946
|
React.useEffect(() => {
|
7940
7947
|
if (onChange) {
|
@@ -8005,7 +8012,7 @@ const DialpadContainer = (props) => {
|
|
8005
8012
|
then use this index to locate the corresponding dtmf tones
|
8006
8013
|
DtmfTones[index]
|
8007
8014
|
*/
|
8008
|
-
index: columnIndex + rowIndex * rows.length, digit: button.digit, letter: button.letter, styles: props.styles, onClick: onClickDialpad, onLongPress: onLongPressDialpad })))));
|
8015
|
+
index: columnIndex + rowIndex * rows.length, digit: button.digit, letter: button.letter, styles: props.styles, onClick: onClickDialpad, onLongPress: onLongPressDialpad, isMobile: isMobile })))));
|
8009
8016
|
}))));
|
8010
8017
|
};
|
8011
8018
|
/**
|
@@ -15056,7 +15063,6 @@ const themedDialpadStyle$1 = (isMobile, theme) => ({
|
|
15056
15063
|
backgroundColor: theme.palette.white,
|
15057
15064
|
fontSize: theme.fonts.large.fontSize,
|
15058
15065
|
padding: '0 0.5rem ',
|
15059
|
-
direction: 'rtl',
|
15060
15066
|
textAlign: 'center',
|
15061
15067
|
':active': {
|
15062
15068
|
padding: '0 0.5rem'
|
@@ -15125,13 +15131,13 @@ const SendDtmfDialpad = (props) => {
|
|
15125
15131
|
return (React__default['default'].createElement(react.Stack, null, showDialpad && (React__default['default'].createElement(react.Stack, { styles: drawerContainerStyles$1 },
|
15126
15132
|
React__default['default'].createElement(_DrawerSurface, { onLightDismiss: onDismissTriggered },
|
15127
15133
|
React__default['default'].createElement(react.Stack, { style: { padding: '1rem' } },
|
15128
|
-
React__default['default'].createElement(Dialpad, Object.assign({ styles: dialpadStyle }, dialpadProps, { showDeleteButton: false, strings: strings }))))))));
|
15134
|
+
React__default['default'].createElement(Dialpad, Object.assign({ styles: dialpadStyle }, dialpadProps, { showDeleteButton: false, strings: strings, isMobile: isMobile }))))))));
|
15129
15135
|
}
|
15130
15136
|
return (React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(react.Modal, { titleAriaId: strings.dialpadModalAriaLabel, isOpen: showDialpad, onDismiss: onDismissTriggered, isBlocking: true, styles: dialpadModalStyle },
|
15131
15137
|
React__default['default'].createElement(react.Stack, { horizontal: true, horizontalAlign: "end", verticalAlign: "center" },
|
15132
15138
|
React__default['default'].createElement(react.IconButton, { iconProps: { iconName: 'Cancel' }, ariaLabel: strings.dialpadCloseModalButtonAriaLabel, onClick: onDismissTriggered, style: { color: theme.palette.black } })),
|
15133
15139
|
React__default['default'].createElement(react.Stack, { style: { overflow: 'hidden' } },
|
15134
|
-
React__default['default'].createElement(Dialpad, Object.assign({ styles: dialpadStyle }, dialpadProps, { showDeleteButton: false, strings: strings }))))));
|
15140
|
+
React__default['default'].createElement(Dialpad, Object.assign({ styles: dialpadStyle }, dialpadProps, { showDeleteButton: false, strings: strings, isMobile: isMobile }))))));
|
15135
15141
|
};
|
15136
15142
|
|
15137
15143
|
// Copyright (c) Microsoft Corporation.
|
@@ -15163,6 +15169,8 @@ const CallControls = (props) => {
|
|
15163
15169
|
}), [localeStrings]);
|
15164
15170
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
15165
15171
|
const holdButtonProps = usePropsFor$1(HoldButton);
|
15172
|
+
/* @conditional-compile-remove(PSTN-calls) */
|
15173
|
+
const alternateCallerId = useAdapter().getState().alternateCallerId;
|
15166
15174
|
/* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(PSTN-calls) */
|
15167
15175
|
const moreButtonContextualMenuItems = () => {
|
15168
15176
|
const items = [];
|
@@ -15196,17 +15204,20 @@ const CallControls = (props) => {
|
|
15196
15204
|
['data-ui-id']: 'hold-button'
|
15197
15205
|
});
|
15198
15206
|
/* @conditional-compile-remove(PSTN-calls) */
|
15199
|
-
|
15200
|
-
|
15201
|
-
|
15202
|
-
|
15203
|
-
|
15204
|
-
|
15205
|
-
|
15206
|
-
|
15207
|
-
styles:
|
15208
|
-
|
15209
|
-
|
15207
|
+
// dtmf tone sending only works for 1:1 PSTN call
|
15208
|
+
if (alternateCallerId) {
|
15209
|
+
items.push({
|
15210
|
+
key: 'showDialpadKey',
|
15211
|
+
text: localeStrings.strings.call.openDtmfDialpadLabel,
|
15212
|
+
onClick: () => {
|
15213
|
+
setShowDialpad(true);
|
15214
|
+
},
|
15215
|
+
iconProps: { iconName: 'PeoplePaneOpenDialpad', styles: { root: { lineHeight: 0 } } },
|
15216
|
+
itemProps: {
|
15217
|
+
styles: buttonFlyoutIncreasedSizeStyles
|
15218
|
+
}
|
15219
|
+
});
|
15220
|
+
}
|
15210
15221
|
return items;
|
15211
15222
|
};
|
15212
15223
|
/* @conditional-compile-remove(PSTN-calls) */
|
@@ -15731,7 +15742,6 @@ const themedDialpadStyle = (isMobile, theme) => ({
|
|
15731
15742
|
backgroundColor: theme.palette.white,
|
15732
15743
|
fontSize: theme.fonts.large.fontSize,
|
15733
15744
|
padding: '0 0.5rem',
|
15734
|
-
direction: 'rtl',
|
15735
15745
|
textAlign: isMobile ? 'center' : 'left',
|
15736
15746
|
':active': {
|
15737
15747
|
padding: '0 0.5rem'
|
@@ -15785,7 +15795,7 @@ const CallingDialpad = (props) => {
|
|
15785
15795
|
const callButtonStyle = React.useMemo(() => themedCallButtonStyle(theme), [theme]);
|
15786
15796
|
const dialpadComponent = () => {
|
15787
15797
|
return (React__default['default'].createElement(React__default['default'].Fragment, null,
|
15788
|
-
React__default['default'].createElement(Dialpad, { styles: dialpadStyle, onChange: setTextFieldInput }),
|
15798
|
+
React__default['default'].createElement(Dialpad, { styles: dialpadStyle, onChange: setTextFieldInput, isMobile: isMobile }),
|
15789
15799
|
React__default['default'].createElement(react.PrimaryButton, { text: strings.dialpadStartCallButtonLabel, onRenderIcon: () => DialpadStartCallIconTrampoline(), onClick: onClickCall, styles: callButtonStyle, disabled: textFieldInput === '' })));
|
15790
15800
|
};
|
15791
15801
|
if (isMobile) {
|
@@ -19068,6 +19078,7 @@ const MoreDrawer = (props) => {
|
|
19068
19078
|
});
|
19069
19079
|
}
|
19070
19080
|
/*@conditional-compile-remove(PSTN-calls) */
|
19081
|
+
// dtmf tone sending only works for 1:1 PSTN call
|
19071
19082
|
if (drawerSelectionOptions !== false && isEnabled(drawerSelectionOptions === null || drawerSelectionOptions === void 0 ? void 0 : drawerSelectionOptions.peopleButton) && props.onClickShowDialpad) {
|
19072
19083
|
drawerMenuItems.push({
|
19073
19084
|
itemKey: 'showDialpadKey',
|
@@ -19310,6 +19321,8 @@ const CallWithChatScreen = (props) => {
|
|
19310
19321
|
dialpadCloseModalButtonAriaLabel: callWithChatStrings.dialpadCloseModalButtonAriaLabel,
|
19311
19322
|
placeholderText: callWithChatStrings.dtmfDialpadPlaceHolderText
|
19312
19323
|
}), [callWithChatStrings]);
|
19324
|
+
/* @conditional-compile-remove(PSTN-calls) */
|
19325
|
+
const alternateCallerId = callAdapter.getState().alternateCallerId;
|
19313
19326
|
return (React__default['default'].createElement("div", { ref: containerRef, className: react.mergeStyles(containerDivStyles) },
|
19314
19327
|
React__default['default'].createElement(react.Stack, { verticalFill: true, grow: true, styles: compositeOuterContainerStyles, id: compositeParentDivId },
|
19315
19328
|
React__default['default'].createElement(react.Stack, { horizontal: true, grow: true },
|
@@ -19326,13 +19339,13 @@ const CallWithChatScreen = (props) => {
|
|
19326
19339
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
19327
19340
|
disableButtonsForHoldScreen: isInLocalHold, callControls: props.callControls, containerHeight: containerHeight, containerWidth: containerWidth,
|
19328
19341
|
/* @conditional-compile-remove(PSTN-calls) */
|
19329
|
-
onClickShowDialpad: onClickShowDialpad })))),
|
19342
|
+
onClickShowDialpad: alternateCallerId ? onClickShowDialpad : undefined })))),
|
19330
19343
|
showControlBar && showDrawer && (React__default['default'].createElement(ChatAdapterProvider, { adapter: chatProps.adapter },
|
19331
19344
|
React__default['default'].createElement(CallAdapterProvider, { adapter: callAdapter },
|
19332
19345
|
React__default['default'].createElement(react.Stack, { styles: drawerContainerStyles$1 },
|
19333
19346
|
React__default['default'].createElement(PreparedMoreDrawer, { callControls: props.callControls, onLightDismiss: closeDrawer, onPeopleButtonClicked: onMoreDrawerPeopleClicked,
|
19334
19347
|
/* @conditional-compile-remove(PSTN-calls) */
|
19335
|
-
onClickShowDialpad: onClickShowDialpad,
|
19348
|
+
onClickShowDialpad: alternateCallerId ? onClickShowDialpad : undefined,
|
19336
19349
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
19337
19350
|
disableButtonsForHoldScreen: isInLocalHold }))))),
|
19338
19351
|
/* @conditional-compile-remove(PSTN-calls) */
|