@azure/communication-react 1.4.2-alpha-202211020017.0 → 1.4.2-alpha-202211040017.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.
Files changed (73) hide show
  1. package/dist/communication-react.d.ts +29 -17
  2. package/dist/dist-cjs/communication-react/index.js +487 -202
  3. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  5. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  6. package/dist/dist-esm/calling-stateful-client/src/BetaToStableTypes.d.ts +23 -0
  7. package/dist/dist-esm/calling-stateful-client/src/BetaToStableTypes.js +4 -0
  8. package/dist/dist-esm/calling-stateful-client/src/BetaToStableTypes.js.map +1 -0
  9. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarative.d.ts +9 -6
  10. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarative.js +37 -182
  11. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarative.js.map +1 -1
  12. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.d.ts +53 -0
  13. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js +204 -0
  14. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js.map +1 -0
  15. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +5 -1
  16. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  17. package/dist/dist-esm/calling-stateful-client/src/CallDeclarative.js +4 -65
  18. package/dist/dist-esm/calling-stateful-client/src/CallDeclarative.js.map +1 -1
  19. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.d.ts +13 -0
  20. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js +88 -0
  21. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js.map +1 -0
  22. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +2 -2
  23. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  24. package/dist/dist-esm/calling-stateful-client/src/Converter.d.ts +4 -3
  25. package/dist/dist-esm/calling-stateful-client/src/Converter.js +4 -0
  26. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  27. package/dist/dist-esm/calling-stateful-client/src/IncomingCallDeclarative.d.ts +2 -1
  28. package/dist/dist-esm/calling-stateful-client/src/IncomingCallDeclarative.js.map +1 -1
  29. package/dist/dist-esm/calling-stateful-client/src/IncomingCallSubscriber.d.ts +3 -2
  30. package/dist/dist-esm/calling-stateful-client/src/IncomingCallSubscriber.js.map +1 -1
  31. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js +16 -0
  32. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
  33. package/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.d.ts +19 -0
  34. package/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.js +89 -0
  35. package/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.js.map +1 -0
  36. package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.d.ts +23 -0
  37. package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js +48 -0
  38. package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js.map +1 -0
  39. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.d.ts +19 -0
  40. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js +35 -0
  41. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js.map +1 -0
  42. package/dist/dist-esm/calling-stateful-client/src/index.d.ts +1 -1
  43. package/dist/dist-esm/calling-stateful-client/src/index.js.map +1 -1
  44. package/dist/dist-esm/react-components/src/components/BrowserPermissionDenied.d.ts +3 -3
  45. package/dist/dist-esm/react-components/src/components/BrowserPermissionDenied.js +6 -4
  46. package/dist/dist-esm/react-components/src/components/BrowserPermissionDenied.js.map +1 -1
  47. package/dist/dist-esm/react-components/src/components/BrowserPermissionDeniedIOS.d.ts +1 -1
  48. package/dist/dist-esm/react-components/src/components/BrowserPermissionDeniedIOS.js +19 -18
  49. package/dist/dist-esm/react-components/src/components/BrowserPermissionDeniedIOS.js.map +1 -1
  50. package/dist/dist-esm/react-components/src/components/DevicePermissionDropdown.d.ts +4 -0
  51. package/dist/dist-esm/react-components/src/components/DevicePermissionDropdown.js +3 -2
  52. package/dist/dist-esm/react-components/src/components/DevicePermissionDropdown.js.map +1 -1
  53. package/dist/dist-esm/react-components/src/components/DomainPermissions.js +2 -4
  54. package/dist/dist-esm/react-components/src/components/DomainPermissions.js.map +1 -1
  55. package/dist/dist-esm/react-components/src/components/utils.d.ts +4 -0
  56. package/dist/dist-esm/react-components/src/components/utils.js +7 -0
  57. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  58. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +2 -1
  59. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  60. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageCameraDropdown.d.ts +1 -0
  61. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageCameraDropdown.js +1 -1
  62. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageCameraDropdown.js.map +1 -1
  63. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageMicDropdown.d.ts +1 -0
  64. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageMicDropdown.js +1 -1
  65. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageMicDropdown.js.map +1 -1
  66. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.d.ts +1 -0
  67. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +6 -2
  68. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
  69. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +20 -1
  70. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  71. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +2 -1
  72. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  73. package/package.json +8 -8
@@ -0,0 +1,35 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ /**
4
+ * @private
5
+ */
6
+ export const isACSCall = (call) => {
7
+ /* @conditional-compile-remove(teams-identity-support) */
8
+ return call.kind === 'Call';
9
+ return true;
10
+ };
11
+ /**
12
+ * @private
13
+ */
14
+ export const isACSCallAgent = (callAgent) => {
15
+ /* @conditional-compile-remove(teams-identity-support) */
16
+ return callAgent.kind === 'CallAgent';
17
+ return true;
18
+ };
19
+ /**
20
+ * @private
21
+ */
22
+ export const isTeamsCall = (call) => {
23
+ /* @conditional-compile-remove(teams-identity-support) */
24
+ return call.kind === 'TeamsCall';
25
+ return false;
26
+ };
27
+ /**
28
+ * @private
29
+ */
30
+ export const isTeamsCallAgent = (callAgent) => {
31
+ /* @conditional-compile-remove(teams-identity-support) */
32
+ return callAgent.kind === 'TeamsCallAgent';
33
+ return false;
34
+ };
35
+ //# sourceMappingURL=TypeGuards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypeGuards.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/TypeGuards.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAgB,EAAgB,EAAE;IAC1D,yDAAyD;IACzD,OAAO,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC;IAC5B,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,SAA0B,EAA0B,EAAE;IACnF,yDAAyD;IACzD,OAAO,SAAS,CAAC,IAAI,KAAK,WAAW,CAAC;IACtC,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,IAAgB,EAAqB,EAAE;IACjE,yDAAyD;IACzD,OAAO,IAAI,CAAC,IAAI,KAAK,WAAW,CAAC;IACjC,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAA0B,EAA+B,EAAE;IAC1F,yDAAyD;IACzD,OAAO,SAAS,CAAC,IAAI,KAAK,gBAAgB,CAAC;IAC3C,OAAO,KAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Call, CallAgent } from '@azure/communication-calling';\nimport { CallAgentCommon, CallCommon, TeamsCall, TeamsCallAgent } from './BetaToStableTypes';\n\n/**\n * @private\n */\nexport const isACSCall = (call: CallCommon): call is Call => {\n /* @conditional-compile-remove(teams-identity-support) */\n return call.kind === 'Call';\n return true;\n};\n\n/**\n * @private\n */\nexport const isACSCallAgent = (callAgent: CallAgentCommon): callAgent is CallAgent => {\n /* @conditional-compile-remove(teams-identity-support) */\n return callAgent.kind === 'CallAgent';\n return true;\n};\n\n/**\n * @private\n */\nexport const isTeamsCall = (call: CallCommon): call is TeamsCall => {\n /* @conditional-compile-remove(teams-identity-support) */\n return call.kind === 'TeamsCall';\n return false;\n};\n\n/**\n * @private\n */\nexport const isTeamsCallAgent = (callAgent: CallAgentCommon): callAgent is TeamsCallAgent => {\n /* @conditional-compile-remove(teams-identity-support) */\n return callAgent.kind === 'TeamsCallAgent';\n return false;\n};\n"]}
@@ -3,6 +3,6 @@ export type { StatefulCallClient, StatefulCallClientArgs, StatefulCallClientOpti
3
3
  export type { StatefulDeviceManager } from './DeviceManagerDeclarative';
4
4
  export type { CallAgentState, CallClientState, CallError, CallErrors, CallErrorTarget, CallState, DeviceManagerState, DiagnosticsCallFeatureState, IncomingCallState, LocalVideoStreamState, MediaDiagnosticsState, NetworkDiagnosticsState, RecordingCallFeatureState as RecordingCallFeature, RemoteParticipantState, RemoteVideoStreamState, TranscriptionCallFeatureState as TranscriptionCallFeature, VideoStreamRendererViewState } from './CallClientState';
5
5
  export type { CreateViewResult } from './StreamUtils';
6
- export type { DeclarativeCallAgent } from './CallAgentDeclarative';
6
+ export type { DeclarativeCallAgent, IncomingCallManagement } from './CallAgentDeclarative';
7
7
  export type { DeclarativeIncomingCall } from './IncomingCallDeclarative';
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport { createStatefulCallClient } from './StatefulCallClient';\nexport type { StatefulCallClient, StatefulCallClientArgs, StatefulCallClientOptions } from './StatefulCallClient';\nexport type { StatefulDeviceManager } from './DeviceManagerDeclarative';\nexport type {\n CallAgentState,\n CallClientState,\n CallError,\n CallErrors,\n CallErrorTarget,\n CallState,\n DeviceManagerState,\n DiagnosticsCallFeatureState,\n IncomingCallState,\n LocalVideoStreamState,\n MediaDiagnosticsState,\n NetworkDiagnosticsState,\n RecordingCallFeatureState as RecordingCallFeature,\n RemoteParticipantState,\n RemoteVideoStreamState,\n TranscriptionCallFeatureState as TranscriptionCallFeature,\n VideoStreamRendererViewState\n} from './CallClientState';\nexport type { CreateViewResult } from './StreamUtils';\n/* @conditional-compile-remove(one-to-n-calling) */\nexport type { DeclarativeCallAgent } from './CallAgentDeclarative';\n/* @conditional-compile-remove(one-to-n-calling) */\nexport type { DeclarativeIncomingCall } from './IncomingCallDeclarative';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport { createStatefulCallClient } from './StatefulCallClient';\nexport type { StatefulCallClient, StatefulCallClientArgs, StatefulCallClientOptions } from './StatefulCallClient';\nexport type { StatefulDeviceManager } from './DeviceManagerDeclarative';\nexport type {\n CallAgentState,\n CallClientState,\n CallError,\n CallErrors,\n CallErrorTarget,\n CallState,\n DeviceManagerState,\n DiagnosticsCallFeatureState,\n IncomingCallState,\n LocalVideoStreamState,\n MediaDiagnosticsState,\n NetworkDiagnosticsState,\n RecordingCallFeatureState as RecordingCallFeature,\n RemoteParticipantState,\n RemoteVideoStreamState,\n TranscriptionCallFeatureState as TranscriptionCallFeature,\n VideoStreamRendererViewState\n} from './CallClientState';\nexport type { CreateViewResult } from './StreamUtils';\n/* @conditional-compile-remove(one-to-n-calling) */\nexport type { DeclarativeCallAgent, IncomingCallManagement } from './CallAgentDeclarative';\n/* @conditional-compile-remove(one-to-n-calling) */\nexport type { DeclarativeIncomingCall } from './IncomingCallDeclarative';\n"]}
@@ -9,15 +9,15 @@ export interface BrowserPermissionDeniedProps {
9
9
  /**
10
10
  * Action to be taken by the more help link. Possible to send to external page or show other modal.
11
11
  */
12
- onTroubleshootingClick: () => void;
12
+ onTroubleshootingClick?: () => void;
13
13
  /**
14
14
  * Action to be taken by the try again primary button.
15
15
  */
16
- onTryAgainClick: () => void;
16
+ onTryAgainClick?: () => void;
17
17
  /**
18
18
  * Localization strings for BrowserPermissionDenied component.
19
19
  */
20
- strings: BrowserPermissionDeniedStrings;
20
+ strings?: BrowserPermissionDeniedStrings;
21
21
  /**
22
22
  * Allows users to pass in an object contains custom CSS styles.
23
23
  * @Example
@@ -8,6 +8,8 @@ import { useLocale } from '../localization';
8
8
  /* @conditional-compile-remove(call-readiness) */
9
9
  import { iconContainerStyles, iconPrimaryStyles, linkTextStyles, primaryButtonStyles, primaryTextStyles, secondaryTextStyles, textContainerStyles } from './styles/BrowserPermissionDenied.styles';
10
10
  /* @conditional-compile-remove(call-readiness) */
11
+ import { isValidString } from './utils';
12
+ /* @conditional-compile-remove(call-readiness) */
11
13
  const BrowserPermissionDeniedContainer = (props) => {
12
14
  const { onTroubleshootingClick, onTryAgainClick, strings, styles } = props;
13
15
  return (React.createElement(Stack, { style: { padding: '2rem', paddingTop: '2.5rem', maxWidth: '25.375rem' } },
@@ -15,10 +17,10 @@ const BrowserPermissionDeniedContainer = (props) => {
15
17
  React.createElement(Stack, { styles: iconContainerStyles, horizontalAlign: 'center' },
16
18
  React.createElement(Icon, { styles: iconPrimaryStyles, iconName: 'BrowserPermissionDeniedError' }))),
17
19
  React.createElement(Stack, { styles: textContainerStyles },
18
- React.createElement(Text, { styles: primaryTextStyles }, strings.primaryText),
19
- React.createElement(Text, { styles: secondaryTextStyles }, strings.secondaryText),
20
- React.createElement(PrimaryButton, { styles: mergeStyleSets(primaryButtonStyles, styles === null || styles === void 0 ? void 0 : styles.primaryButton), text: strings.primaryButtonText, onClick: onTryAgainClick }),
21
- React.createElement(Link, { styles: mergeStyleSets(linkTextStyles, styles === null || styles === void 0 ? void 0 : styles.troubleshootingLink), onClick: onTroubleshootingClick }, strings.linkText))));
20
+ isValidString(strings === null || strings === void 0 ? void 0 : strings.primaryText) && React.createElement(Text, { styles: primaryTextStyles }, strings === null || strings === void 0 ? void 0 : strings.primaryText),
21
+ isValidString(strings === null || strings === void 0 ? void 0 : strings.secondaryText) && React.createElement(Text, { styles: secondaryTextStyles }, strings === null || strings === void 0 ? void 0 : strings.secondaryText),
22
+ onTryAgainClick && isValidString(strings === null || strings === void 0 ? void 0 : strings.primaryButtonText) && (React.createElement(PrimaryButton, { styles: mergeStyleSets(primaryButtonStyles, styles === null || styles === void 0 ? void 0 : styles.primaryButton), text: strings === null || strings === void 0 ? void 0 : strings.primaryButtonText, onClick: onTryAgainClick })),
23
+ onTroubleshootingClick && isValidString(strings === null || strings === void 0 ? void 0 : strings.linkText) && (React.createElement(Link, { styles: mergeStyleSets(linkTextStyles, styles === null || styles === void 0 ? void 0 : styles.troubleshootingLink), onClick: onTroubleshootingClick }, strings === null || strings === void 0 ? void 0 : strings.linkText)))));
22
24
  };
23
25
  /**
24
26
  * @beta
@@ -1 +1 @@
1
- {"version":3,"file":"BrowserPermissionDenied.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/BrowserPermissionDenied.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,iDAAiD;AACjD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACzF,iDAAiD;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,iDAAiD;AACjD,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,yCAAyC,CAAC;AAiEjD,iDAAiD;AACjD,MAAM,gCAAgC,GAAG,CAAC,KAAmC,EAAe,EAAE;IAC5F,MAAM,EAAE,sBAAsB,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAC3E,OAAO,CACL,oBAAC,KAAK,IAAC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE;QAC5E,oBAAC,KAAK,IAAC,UAAU,QAAC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ed under the MIT license.\n\nimport React from 'react';\nimport { IButtonStyles, ILinkStyles } from '@fluentui/react';\n/* @conditional-compile-remove(call-readiness) */\nimport { Stack, Text, Link, Icon, PrimaryButton, mergeStyleSets } from '@fluentui/react';\n/* @conditional-compile-remove(call-readiness) */\nimport { useLocale } from '../localization';\n/* @conditional-compile-remove(call-readiness) */\nimport { _formatString, _pxToRem } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(call-readiness) */\nimport {\n iconContainerStyles,\n iconPrimaryStyles,\n linkTextStyles,\n primaryButtonStyles,\n primaryTextStyles,\n secondaryTextStyles,\n textContainerStyles\n} from './styles/BrowserPermissionDenied.styles';\nimport { BaseCustomStyles } from '../types';\n\n/**\n * @beta\n * Props for BrowserPermissionDenied component.\n */\nexport interface BrowserPermissionDeniedProps {\n /**\n * Action to be taken by the more help link. Possible to send to external page or show other modal.\n */\n onTroubleshootingClick: () => void;\n /**\n * Action to be taken by the try again primary button.\n */\n onTryAgainClick: () => void;\n /**\n * Localization strings for BrowserPermissionDenied component.\n */\n strings: BrowserPermissionDeniedStrings;\n /**\n * Allows users to pass in an object contains custom CSS styles.\n * @Example\n * ```\n * <BrowserPermissionDenied styles={{ primaryButton: { root: {backgroundColor: 'blue' }}}} />\n * ```\n */\n styles?: BrowserPermissionDeniedStyles;\n}\n\n/**\n * @beta\n * Strings for BrowserPermissionDenied component\n */\nexport interface BrowserPermissionDeniedStrings {\n /**\n * Main button text string.\n */\n primaryButtonText: string;\n /**\n * Main text string.\n */\n primaryText: string;\n /**\n * Subtext string.\n */\n secondaryText: string;\n /**\n * More help link string.\n */\n linkText: string;\n}\n\n/**\n * Fluent styles for {@link BrowserPermissionDenied}.\n *\n * @beta\n */\nexport interface BrowserPermissionDeniedStyles extends BaseCustomStyles {\n /** Styles for the primary button. */\n primaryButton?: IButtonStyles;\n /** Styles for the help troubleshooting link text. */\n troubleshootingLink?: ILinkStyles;\n}\n\n/* @conditional-compile-remove(call-readiness) */\nconst BrowserPermissionDeniedContainer = (props: BrowserPermissionDeniedProps): JSX.Element => {\n const { onTroubleshootingClick, onTryAgainClick, strings, styles } = props;\n return (\n <Stack style={{ padding: '2rem', paddingTop: '2.5rem', maxWidth: '25.375rem' }}>\n <Stack horizontal style={{ paddingBottom: '1.5rem' }} horizontalAlign={'space-between'}>\n <Stack styles={iconContainerStyles} horizontalAlign={'center'}>\n <Icon styles={iconPrimaryStyles} iconName={'BrowserPermissionDeniedError'}></Icon>\n </Stack>\n </Stack>\n <Stack styles={textContainerStyles}>\n <Text styles={primaryTextStyles}>{strings.primaryText}</Text>\n <Text styles={secondaryTextStyles}>{strings.secondaryText}</Text>\n <PrimaryButton\n styles={mergeStyleSets(primaryButtonStyles, styles?.primaryButton)}\n text={strings.primaryButtonText}\n onClick={onTryAgainClick}\n />\n <Link styles={mergeStyleSets(linkTextStyles, styles?.troubleshootingLink)} onClick={onTroubleshootingClick}>\n {strings.linkText}\n </Link>\n </Stack>\n </Stack>\n );\n};\n\n/**\n * @beta\n *\n * Component to allow Contoso to help their end user with their devices should their browser experience device permission issues.\n */\nexport const BrowserPermissionDenied = (props: BrowserPermissionDeniedProps): JSX.Element => {\n /* @conditional-compile-remove(call-readiness) */\n const locale = useLocale().strings.BrowserPermissionDenied;\n /* @conditional-compile-remove(call-readiness) */\n return <BrowserPermissionDeniedContainer {...props} strings={props.strings ? props.strings : locale} />;\n return <></>;\n};\n\"../../../acs-ui-common/src\""]}
1
+ {"version":3,"file":"BrowserPermissionDenied.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/BrowserPermissionDenied.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,iDAAiD;AACjD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACzF,iDAAiD;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBA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E,iBAAiB,CAAC,IAAI,CAC/D,oBAAC,aAAa,IACZ,MAAM,EAAE,cAAc,CAAC,mBAAmB,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,aAAa,CAAC,EAClE,IAAI,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,iBAAiB,EAChC,OAAO,EAAE,eAAe,GACxB,CACH;YAEA,sBAAsB,IAAI,aAAa,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,CAAC,IAAI,CAC7D,oBAAC,IAAI,IAAC,MAAM,EAAE,cAAc,CAAC,cAAc,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,mBAAmB,CAAC,EAAE,OAAO,EAAE,sBAAsB,IACvG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,CACb,CACR,CACK,CACF,CACT,CAAC;AACJ,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,KAAmC,EAAe,EAAE;IAC1F,iDAAiD;IACjD,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC,OAAO,CAAC,uBAAuB,CAAC;IAC3D,iDAAiD;IACjD,OAAO,oBAAC,gCAAgC,oBAAK,KAAK,IAAE,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC;IACxG,OAAO,yCAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React from 'react';\nimport { IButtonStyles, ILinkStyles } from '@fluentui/react';\n/* @conditional-compile-remove(call-readiness) */\nimport { Stack, Text, Link, Icon, PrimaryButton, mergeStyleSets } from '@fluentui/react';\n/* @conditional-compile-remove(call-readiness) */\nimport { useLocale } from '../localization';\n/* @conditional-compile-remove(call-readiness) */\nimport { _formatString, _pxToRem } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(call-readiness) */\nimport {\n iconContainerStyles,\n iconPrimaryStyles,\n linkTextStyles,\n primaryButtonStyles,\n primaryTextStyles,\n secondaryTextStyles,\n textContainerStyles\n} from './styles/BrowserPermissionDenied.styles';\nimport { BaseCustomStyles } from '../types';\n/* @conditional-compile-remove(call-readiness) */\nimport { isValidString } from './utils';\n\n/**\n * @beta\n * Props for BrowserPermissionDenied component.\n */\nexport interface BrowserPermissionDeniedProps {\n /**\n * Action to be taken by the more help link. Possible to send to external page or show other modal.\n */\n onTroubleshootingClick?: () => void;\n /**\n * Action to be taken by the try again primary button.\n */\n onTryAgainClick?: () => void;\n /**\n * Localization strings for BrowserPermissionDenied component.\n */\n strings?: BrowserPermissionDeniedStrings;\n /**\n * Allows users to pass in an object contains custom CSS styles.\n * @Example\n * ```\n * <BrowserPermissionDenied styles={{ primaryButton: { root: {backgroundColor: 'blue' }}}} />\n * ```\n */\n styles?: BrowserPermissionDeniedStyles;\n}\n\n/**\n * @beta\n * Strings for BrowserPermissionDenied component\n */\nexport interface BrowserPermissionDeniedStrings {\n /**\n * Main button text string.\n */\n primaryButtonText: string;\n /**\n * Main text string.\n */\n primaryText: string;\n /**\n * Subtext string.\n */\n secondaryText: string;\n /**\n * More help link string.\n */\n linkText: string;\n}\n\n/**\n * Fluent styles for {@link BrowserPermissionDenied}.\n *\n * @beta\n */\nexport interface BrowserPermissionDeniedStyles extends BaseCustomStyles {\n /** Styles for the primary button. */\n primaryButton?: IButtonStyles;\n /** Styles for the help troubleshooting link text. */\n troubleshootingLink?: ILinkStyles;\n}\n\n/* @conditional-compile-remove(call-readiness) */\nconst BrowserPermissionDeniedContainer = (props: BrowserPermissionDeniedProps): JSX.Element => {\n const { onTroubleshootingClick, onTryAgainClick, strings, styles } = props;\n return (\n <Stack style={{ padding: '2rem', paddingTop: '2.5rem', maxWidth: '25.375rem' }}>\n <Stack horizontal style={{ paddingBottom: '1.5rem' }} horizontalAlign={'space-between'}>\n <Stack styles={iconContainerStyles} horizontalAlign={'center'}>\n <Icon styles={iconPrimaryStyles} iconName={'BrowserPermissionDeniedError'}></Icon>\n </Stack>\n </Stack>\n <Stack styles={textContainerStyles}>\n {isValidString(strings?.primaryText) && <Text styles={primaryTextStyles}>{strings?.primaryText}</Text>}\n {isValidString(strings?.secondaryText) && <Text styles={secondaryTextStyles}>{strings?.secondaryText}</Text>}\n\n {onTryAgainClick && isValidString(strings?.primaryButtonText) && (\n <PrimaryButton\n styles={mergeStyleSets(primaryButtonStyles, styles?.primaryButton)}\n text={strings?.primaryButtonText}\n onClick={onTryAgainClick}\n />\n )}\n\n {onTroubleshootingClick && isValidString(strings?.linkText) && (\n <Link styles={mergeStyleSets(linkTextStyles, styles?.troubleshootingLink)} onClick={onTroubleshootingClick}>\n {strings?.linkText}\n </Link>\n )}\n </Stack>\n </Stack>\n );\n};\n\n/**\n * @beta\n *\n * Component to allow Contoso to help their end user with their devices should their browser experience device permission issues.\n */\nexport const BrowserPermissionDenied = (props: BrowserPermissionDeniedProps): JSX.Element => {\n /* @conditional-compile-remove(call-readiness) */\n const locale = useLocale().strings.BrowserPermissionDenied;\n /* @conditional-compile-remove(call-readiness) */\n return <BrowserPermissionDeniedContainer {...props} strings={props.strings ? props.strings : locale} />;\n return <></>;\n};\n\"../../../acs-ui-common/src\""]}
@@ -8,7 +8,7 @@ export interface BrowserPermissionDeniedIOSProps extends BrowserPermissionDenied
8
8
  /**
9
9
  * Localization strings for BrowserPermissionDeniedIOS component.
10
10
  */
11
- strings: BrowserPermissionDeniedIOSStrings;
11
+ strings?: BrowserPermissionDeniedIOSStrings;
12
12
  /**
13
13
  * Link to image source.
14
14
  *
@@ -10,6 +10,8 @@ import { useLocale } from '../localization';
10
10
  /* @conditional-compile-remove(call-readiness) */
11
11
  import { browserPermissionContainerStyles, iOSImageContainer, iOSStepsCircleStyles, iOSStepsContainerStyles, iOSStepsDigitTextStyles, iOSStepsTextStyles, linkTextStyles, primaryButtonStyles, primaryTextStyles, secondaryTextStyles, textContainerStyles } from './styles/BrowserPermissionDenied.styles';
12
12
  /* @conditional-compile-remove(call-readiness) */
13
+ import { isValidString } from './utils';
14
+ /* @conditional-compile-remove(call-readiness) */
13
15
  const BrowserPermissionDeniedIOSContainer = (props) => {
14
16
  const { imageSource, onTroubleshootingClick, onTryAgainClick, strings, styles } = props;
15
17
  const theme = useTheme();
@@ -17,30 +19,29 @@ const BrowserPermissionDeniedIOSContainer = (props) => {
17
19
  return mergeStyleSets(iOSStepsCircleStyles, { root: { background: theme.palette.neutralLighter } });
18
20
  }, [theme]);
19
21
  return (React.createElement(Stack, { styles: browserPermissionContainerStyles },
20
- imageSource && (React.createElement(Stack, { styles: mergeStyleSets(iOSImageContainer, { root: { background: theme.palette.neutralLighter } }) },
21
- React.createElement(Image, { src: imageSource !== null && imageSource !== void 0 ? imageSource : '', alt: strings.imageAltText, imageFit: ImageFit.centerContain, style: { padding: '1.5rem' } }))),
22
+ imageSource && (React.createElement(Stack, { styles: mergeStyleSets(iOSImageContainer, { root: { background: theme.palette.neutralLighter } }) }, isValidString(strings === null || strings === void 0 ? void 0 : strings.imageAltText) && (React.createElement(Image, { src: imageSource !== null && imageSource !== void 0 ? imageSource : '', alt: strings === null || strings === void 0 ? void 0 : strings.imageAltText, imageFit: ImageFit.centerContain, style: { padding: '1.5rem' } })))),
22
23
  React.createElement(Stack, { style: { padding: '1rem', paddingBottom: '1.25rem' } },
23
24
  React.createElement(Stack, { styles: textContainerStyles },
24
- React.createElement(Text, { styles: primaryTextStyles }, strings.primaryText),
25
- React.createElement(Text, { styles: secondaryTextStyles }, strings.secondaryText),
26
- strings.step1Text && (React.createElement(Stack, { styles: iOSStepsContainerStyles },
25
+ isValidString(strings === null || strings === void 0 ? void 0 : strings.primaryText) && React.createElement(Text, { styles: primaryTextStyles }, strings === null || strings === void 0 ? void 0 : strings.primaryText),
26
+ isValidString(strings === null || strings === void 0 ? void 0 : strings.secondaryText) && React.createElement(Text, { styles: secondaryTextStyles }, strings === null || strings === void 0 ? void 0 : strings.secondaryText),
27
+ isValidString(strings === null || strings === void 0 ? void 0 : strings.step1Text) && (React.createElement(Stack, { styles: iOSStepsContainerStyles },
27
28
  React.createElement(Stack, { horizontalAlign: 'center', styles: stepsCircleStyle },
28
- React.createElement(Text, { styles: iOSStepsDigitTextStyles }, strings.step1DigitText)),
29
- React.createElement(Text, { styles: iOSStepsTextStyles }, strings.step1Text))),
30
- strings.step2Text && (React.createElement(Stack, { styles: iOSStepsContainerStyles },
29
+ React.createElement(Text, { styles: iOSStepsDigitTextStyles }, strings === null || strings === void 0 ? void 0 : strings.step1DigitText)),
30
+ React.createElement(Text, { styles: iOSStepsTextStyles }, strings === null || strings === void 0 ? void 0 : strings.step1Text))),
31
+ isValidString(strings === null || strings === void 0 ? void 0 : strings.step2Text) && (React.createElement(Stack, { styles: iOSStepsContainerStyles },
31
32
  React.createElement(Stack, { horizontalAlign: 'center', styles: stepsCircleStyle },
32
- React.createElement(Text, { styles: iOSStepsDigitTextStyles }, strings.step2DigitText)),
33
- React.createElement(Text, { styles: iOSStepsTextStyles }, strings.step2Text))),
34
- strings.step3Text && (React.createElement(Stack, { styles: iOSStepsContainerStyles },
33
+ React.createElement(Text, { styles: iOSStepsDigitTextStyles }, strings === null || strings === void 0 ? void 0 : strings.step2DigitText)),
34
+ React.createElement(Text, { styles: iOSStepsTextStyles }, strings === null || strings === void 0 ? void 0 : strings.step2Text))),
35
+ isValidString(strings === null || strings === void 0 ? void 0 : strings.step3Text) && (React.createElement(Stack, { styles: iOSStepsContainerStyles },
35
36
  React.createElement(Stack, { horizontalAlign: 'center', styles: stepsCircleStyle },
36
- React.createElement(Text, { styles: iOSStepsDigitTextStyles }, strings.step3DigitText)),
37
- React.createElement(Text, { styles: iOSStepsTextStyles }, strings.step3Text))),
38
- strings.step4Text && (React.createElement(Stack, { styles: mergeStyleSets(iOSStepsContainerStyles, { root: { paddingBottom: '1.5rem' } }) },
37
+ React.createElement(Text, { styles: iOSStepsDigitTextStyles }, strings === null || strings === void 0 ? void 0 : strings.step3DigitText)),
38
+ React.createElement(Text, { styles: iOSStepsTextStyles }, strings === null || strings === void 0 ? void 0 : strings.step3Text))),
39
+ isValidString(strings === null || strings === void 0 ? void 0 : strings.step4Text) && (React.createElement(Stack, { styles: mergeStyleSets(iOSStepsContainerStyles, { root: { paddingBottom: '1.5rem' } }) },
39
40
  React.createElement(Stack, { horizontalAlign: 'center', styles: stepsCircleStyle },
40
- React.createElement(Text, { styles: iOSStepsDigitTextStyles }, strings.step4DigitText)),
41
- React.createElement(Text, { styles: iOSStepsTextStyles }, strings.step4Text))),
42
- React.createElement(PrimaryButton, { styles: mergeStyleSets(primaryButtonStyles, styles === null || styles === void 0 ? void 0 : styles.primaryButton), text: strings.primaryButtonText, onClick: onTryAgainClick }),
43
- React.createElement(Link, { styles: mergeStyleSets(linkTextStyles, styles === null || styles === void 0 ? void 0 : styles.troubleshootingLink), onClick: onTroubleshootingClick }, strings.linkText)))));
41
+ React.createElement(Text, { styles: iOSStepsDigitTextStyles }, strings === null || strings === void 0 ? void 0 : strings.step4DigitText)),
42
+ React.createElement(Text, { styles: iOSStepsTextStyles }, strings === null || strings === void 0 ? void 0 : strings.step4Text))),
43
+ isValidString(strings === null || strings === void 0 ? void 0 : strings.primaryButtonText) && (React.createElement(PrimaryButton, { styles: mergeStyleSets(primaryButtonStyles, styles === null || styles === void 0 ? void 0 : styles.primaryButton), text: strings === null || strings === void 0 ? void 0 : strings.primaryButtonText, onClick: onTryAgainClick })),
44
+ isValidString(strings === null || strings === void 0 ? void 0 : strings.linkText) && (React.createElement(Link, { styles: mergeStyleSets(linkTextStyles, styles === null || styles === void 0 ? void 0 : styles.troubleshootingLink), onClick: onTroubleshootingClick }, strings === null || strings === void 0 ? void 0 : strings.linkText))))));
44
45
  };
45
46
  /**
46
47
  * @beta
@@ -1 +1 @@
1
- {"version":3,"file":"BrowserPermissionDeniedIOS.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/BrowserPermissionDeniedIO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AAO,oBAAC,mCAAmC,oBAAK,KAAK,IAAE,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC;IAC3G,OAAO,yCAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React from 'react';\n/* @conditional-compile-remove(call-readiness) */\nimport { useMemo } from 'react';\n/* @conditional-compile-remove(call-readiness) */\nimport { Stack, Text, Link, PrimaryButton, mergeStyleSets, useTheme, Image, ImageFit } from '@fluentui/react';\n/* @conditional-compile-remove(call-readiness) */\nimport { useLocale } from '../localization';\n/* @conditional-compile-remove(call-readiness) */\nimport { _formatString, _pxToRem } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(call-readiness) */\nimport {\n browserPermissionContainerStyles,\n iOSImageContainer,\n iOSStepsCircleStyles,\n iOSStepsContainerStyles,\n iOSStepsDigitTextStyles,\n iOSStepsTextStyles,\n linkTextStyles,\n primaryButtonStyles,\n primaryTextStyles,\n secondaryTextStyles,\n textContainerStyles\n} from './styles/BrowserPermissionDenied.styles';\nimport { BrowserPermissionDeniedProps, BrowserPermissionDeniedStrings } from './BrowserPermissionDenied';\n\n/**\n * @beta\n * Props for BrowserPermissionDeniedIOS component.\n */\nexport interface BrowserPermissionDeniedIOSProps extends BrowserPermissionDeniedProps {\n /**\n * Localization strings for BrowserPermissionDeniedIOS component.\n */\n strings: BrowserPermissionDeniedIOSStrings;\n /**\n * Link to image source.\n *\n * Image is inserted into the top of the component.\n */\n imageSource?: string;\n}\n\n/**\n * @beta\n * Strings for BrowserPermissionDeniedIOS component\n */\nexport interface BrowserPermissionDeniedIOSStrings extends BrowserPermissionDeniedStrings {\n /**\n * Image alt text\n */\n imageAltText: string;\n /**\n * Main text string.\n */\n primaryText: string;\n /**\n * Subtext string.\n */\n secondaryText: string;\n /**\n * Step 1 string\n */\n step1Text: string;\n /**\n * Step 1 digit string\n */\n step1DigitText: string;\n /**\n * Step 2 string\n */\n step2Text: string;\n /**\n * Step 2 digit string\n */\n step2DigitText: string;\n /**\n * Step 3 string\n */\n step3Text: string;\n /**\n * Step 3 digit string\n */\n step3DigitText: string;\n /**\n * Step 4 string\n */\n step4Text: string;\n /**\n * Step 4 digit string\n */\n step4DigitText: string;\n}\n\n/* @conditional-compile-remove(call-readiness) */\nconst BrowserPermissionDeniedIOSContainer = (props: BrowserPermissionDeniedIOSProps): JSX.Element => {\n const { imageSource, onTroubleshootingClick, onTryAgainClick, strings, styles } = props;\n const theme = useTheme();\n\n const stepsCircleStyle = useMemo(() => {\n return mergeStyleSets(iOSStepsCircleStyles, { root: { background: theme.palette.neutralLighter } });\n }, [theme]);\n\n return (\n <Stack styles={browserPermissionContainerStyles}>\n {imageSource && (\n <Stack styles={mergeStyleSets(iOSImageContainer, { root: { background: theme.palette.neutralLighter } })}>\n <Image\n src={imageSource ?? ''}\n alt={strings.imageAltText}\n imageFit={ImageFit.centerContain}\n style={{ padding: '1.5rem' }}\n />\n </Stack>\n )}\n <Stack style={{ padding: '1rem', paddingBottom: '1.25rem' }}>\n <Stack styles={textContainerStyles}>\n <Text styles={primaryTextStyles}>{strings.primaryText}</Text>\n <Text styles={secondaryTextStyles}>{strings.secondaryText}</Text>\n {strings.step1Text && (\n <Stack styles={iOSStepsContainerStyles}>\n <Stack horizontalAlign={'center'} styles={stepsCircleStyle}>\n <Text styles={iOSStepsDigitTextStyles}>{strings.step1DigitText}</Text>\n </Stack>\n <Text styles={iOSStepsTextStyles}>{strings.step1Text}</Text>\n </Stack>\n )}\n {strings.step2Text && (\n <Stack styles={iOSStepsContainerStyles}>\n <Stack horizontalAlign={'center'} styles={stepsCircleStyle}>\n <Text styles={iOSStepsDigitTextStyles}>{strings.step2DigitText}</Text>\n </Stack>\n <Text styles={iOSStepsTextStyles}>{strings.step2Text}</Text>\n </Stack>\n )}\n {strings.step3Text && (\n <Stack styles={iOSStepsContainerStyles}>\n <Stack horizontalAlign={'center'} styles={stepsCircleStyle}>\n <Text styles={iOSStepsDigitTextStyles}>{strings.step3DigitText}</Text>\n </Stack>\n <Text styles={iOSStepsTextStyles}>{strings.step3Text}</Text>\n </Stack>\n )}\n {strings.step4Text && (\n <Stack styles={mergeStyleSets(iOSStepsContainerStyles, { root: { paddingBottom: '1.5rem' } })}>\n <Stack horizontalAlign={'center'} styles={stepsCircleStyle}>\n <Text styles={iOSStepsDigitTextStyles}>{strings.step4DigitText}</Text>\n </Stack>\n <Text styles={iOSStepsTextStyles}>{strings.step4Text}</Text>\n </Stack>\n )}\n <PrimaryButton\n styles={mergeStyleSets(primaryButtonStyles, styles?.primaryButton)}\n text={strings.primaryButtonText}\n onClick={onTryAgainClick}\n />\n <Link styles={mergeStyleSets(linkTextStyles, styles?.troubleshootingLink)} onClick={onTroubleshootingClick}>\n {strings.linkText}\n </Link>\n </Stack>\n </Stack>\n </Stack>\n );\n};\n\n/**\n * @beta\n *\n * Component to allow Contoso to help their end user with their devices should their browser experience device permission issues.\n */\nexport const BrowserPermissionDeniedIOS = (props: BrowserPermissionDeniedIOSProps): JSX.Element => {\n /* @conditional-compile-remove(call-readiness) */\n const locale = useLocale().strings.BrowserPermissionDeniedIOS;\n /* @conditional-compile-remove(call-readiness) */\n return <BrowserPermissionDeniedIOSContainer {...props} strings={props.strings ? props.strings : locale} />;\n return <></>;\n};\n\"../../../acs-ui-common/src\""]}
1
+ {"version":3,"file":"BrowserPermissionDeniedIOS.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/BrowserPermissionDeniedIOS.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,iDAAiD;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,iDAAiD;AACjD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAA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M,EAAE,cAAc,CAAC,mBAAmB,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,aAAa,CAAC,EAClE,IAAI,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,iBAAiB,EAChC,OAAO,EAAE,eAAe,GACxB,CACH;gBACA,aAAa,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,CAAC,IAAI,CACnC,oBAAC,IAAI,IAAC,MAAM,EAAE,cAAc,CAAC,cAAc,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,mBAAmB,CAAC,EAAE,OAAO,EAAE,sBAAsB,IACvG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,QAAQ,CACb,CACR,CACK,CACF,CACF,CACT,CAAC;AACJ,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,KAAsC,EAAe,EAAE;IAChG,iDAAiD;IACjD,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC,OAAO,CAAC,0BAA0B,CAAC;IAC9D,iDAAiD;IACjD,OAAO,oBAAC,mCAAmC,oBAAK,KAAK,IAAE,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC;IAC3G,OAAO,yCAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React from 'react';\n/* @conditional-compile-remove(call-readiness) */\nimport { useMemo } from 'react';\n/* @conditional-compile-remove(call-readiness) */\nimport { Stack, Text, Link, PrimaryButton, mergeStyleSets, useTheme, Image, ImageFit } from '@fluentui/react';\n/* @conditional-compile-remove(call-readiness) */\nimport { useLocale } from '../localization';\n/* @conditional-compile-remove(call-readiness) */\nimport { _formatString, _pxToRem } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(call-readiness) */\nimport {\n browserPermissionContainerStyles,\n iOSImageContainer,\n iOSStepsCircleStyles,\n iOSStepsContainerStyles,\n iOSStepsDigitTextStyles,\n iOSStepsTextStyles,\n linkTextStyles,\n primaryButtonStyles,\n primaryTextStyles,\n secondaryTextStyles,\n textContainerStyles\n} from './styles/BrowserPermissionDenied.styles';\nimport { BrowserPermissionDeniedProps, BrowserPermissionDeniedStrings } from './BrowserPermissionDenied';\n/* @conditional-compile-remove(call-readiness) */\nimport { isValidString } from './utils';\n\n/**\n * @beta\n * Props for BrowserPermissionDeniedIOS component.\n */\nexport interface BrowserPermissionDeniedIOSProps extends BrowserPermissionDeniedProps {\n /**\n * Localization strings for BrowserPermissionDeniedIOS component.\n */\n strings?: BrowserPermissionDeniedIOSStrings;\n /**\n * Link to image source.\n *\n * Image is inserted into the top of the component.\n */\n imageSource?: string;\n}\n\n/**\n * @beta\n * Strings for BrowserPermissionDeniedIOS component\n */\nexport interface BrowserPermissionDeniedIOSStrings extends BrowserPermissionDeniedStrings {\n /**\n * Image alt text\n */\n imageAltText: string;\n /**\n * Main text string.\n */\n primaryText: string;\n /**\n * Subtext string.\n */\n secondaryText: string;\n /**\n * Step 1 string\n */\n step1Text: string;\n /**\n * Step 1 digit string\n */\n step1DigitText: string;\n /**\n * Step 2 string\n */\n step2Text: string;\n /**\n * Step 2 digit string\n */\n step2DigitText: string;\n /**\n * Step 3 string\n */\n step3Text: string;\n /**\n * Step 3 digit string\n */\n step3DigitText: string;\n /**\n * Step 4 string\n */\n step4Text: string;\n /**\n * Step 4 digit string\n */\n step4DigitText: string;\n}\n\n/* @conditional-compile-remove(call-readiness) */\nconst BrowserPermissionDeniedIOSContainer = (props: BrowserPermissionDeniedIOSProps): JSX.Element => {\n const { imageSource, onTroubleshootingClick, onTryAgainClick, strings, styles } = props;\n const theme = useTheme();\n\n const stepsCircleStyle = useMemo(() => {\n return mergeStyleSets(iOSStepsCircleStyles, { root: { background: theme.palette.neutralLighter } });\n }, [theme]);\n\n return (\n <Stack styles={browserPermissionContainerStyles}>\n {imageSource && (\n <Stack styles={mergeStyleSets(iOSImageContainer, { root: { background: theme.palette.neutralLighter } })}>\n {isValidString(strings?.imageAltText) && (\n <Image\n src={imageSource ?? ''}\n alt={strings?.imageAltText}\n imageFit={ImageFit.centerContain}\n style={{ padding: '1.5rem' }}\n />\n )}\n </Stack>\n )}\n <Stack style={{ padding: '1rem', paddingBottom: '1.25rem' }}>\n <Stack styles={textContainerStyles}>\n {isValidString(strings?.primaryText) && <Text styles={primaryTextStyles}>{strings?.primaryText}</Text>}\n {isValidString(strings?.secondaryText) && <Text styles={secondaryTextStyles}>{strings?.secondaryText}</Text>}\n {isValidString(strings?.step1Text) && (\n <Stack styles={iOSStepsContainerStyles}>\n <Stack horizontalAlign={'center'} styles={stepsCircleStyle}>\n <Text styles={iOSStepsDigitTextStyles}>{strings?.step1DigitText}</Text>\n </Stack>\n <Text styles={iOSStepsTextStyles}>{strings?.step1Text}</Text>\n </Stack>\n )}\n {isValidString(strings?.step2Text) && (\n <Stack styles={iOSStepsContainerStyles}>\n <Stack horizontalAlign={'center'} styles={stepsCircleStyle}>\n <Text styles={iOSStepsDigitTextStyles}>{strings?.step2DigitText}</Text>\n </Stack>\n <Text styles={iOSStepsTextStyles}>{strings?.step2Text}</Text>\n </Stack>\n )}\n {isValidString(strings?.step3Text) && (\n <Stack styles={iOSStepsContainerStyles}>\n <Stack horizontalAlign={'center'} styles={stepsCircleStyle}>\n <Text styles={iOSStepsDigitTextStyles}>{strings?.step3DigitText}</Text>\n </Stack>\n <Text styles={iOSStepsTextStyles}>{strings?.step3Text}</Text>\n </Stack>\n )}\n {isValidString(strings?.step4Text) && (\n <Stack styles={mergeStyleSets(iOSStepsContainerStyles, { root: { paddingBottom: '1.5rem' } })}>\n <Stack horizontalAlign={'center'} styles={stepsCircleStyle}>\n <Text styles={iOSStepsDigitTextStyles}>{strings?.step4DigitText}</Text>\n </Stack>\n <Text styles={iOSStepsTextStyles}>{strings?.step4Text}</Text>\n </Stack>\n )}\n {isValidString(strings?.primaryButtonText) && (\n <PrimaryButton\n styles={mergeStyleSets(primaryButtonStyles, styles?.primaryButton)}\n text={strings?.primaryButtonText}\n onClick={onTryAgainClick}\n />\n )}\n {isValidString(strings?.linkText) && (\n <Link styles={mergeStyleSets(linkTextStyles, styles?.troubleshootingLink)} onClick={onTroubleshootingClick}>\n {strings?.linkText}\n </Link>\n )}\n </Stack>\n </Stack>\n </Stack>\n );\n};\n\n/**\n * @beta\n *\n * Component to allow Contoso to help their end user with their devices should their browser experience device permission issues.\n */\nexport const BrowserPermissionDeniedIOS = (props: BrowserPermissionDeniedIOSProps): JSX.Element => {\n /* @conditional-compile-remove(call-readiness) */\n const locale = useLocale().strings.BrowserPermissionDeniedIOS;\n /* @conditional-compile-remove(call-readiness) */\n return <BrowserPermissionDeniedIOSContainer {...props} strings={props.strings ? props.strings : locale} />;\n return <></>;\n};\n\"../../../acs-ui-common/src\""]}
@@ -40,6 +40,10 @@ export interface _DevicePermissionDropdownProps {
40
40
  * @param constrain - Define constraints for accessing local devices {@link @azure/communication-calling#PermissionConstraints }
41
41
  */
42
42
  askDevicePermission?(constrain: _PermissionConstraints): Promise<void>;
43
+ /**
44
+ * Optional callback when component is clicked
45
+ */
46
+ onClick?: () => void;
43
47
  /**
44
48
  * Define constraints for accessing local devices {@link @azure/communication-calling#PermissionConstraints }
45
49
  */
@@ -8,7 +8,7 @@ import React from 'react';
8
8
  * @internal
9
9
  */
10
10
  export const _DevicePermissionDropdown = (props) => {
11
- const { icon, askDevicePermission, constrain, strings, options, styles } = props;
11
+ const { icon, askDevicePermission, onClick, constrain, strings, options, styles } = props;
12
12
  const onRenderPlaceholder = () => {
13
13
  return (React.createElement(Stack, { horizontal: true, verticalAlign: "center" },
14
14
  icon,
@@ -17,10 +17,11 @@ export const _DevicePermissionDropdown = (props) => {
17
17
  const onRenderCaretDown = () => {
18
18
  return React.createElement(Text, null, strings === null || strings === void 0 ? void 0 : strings.actionButtonContent);
19
19
  };
20
- return (React.createElement(Dropdown, { placeholder: strings === null || strings === void 0 ? void 0 : strings.placeHolderText, label: strings === null || strings === void 0 ? void 0 : strings.label, onRenderPlaceholder: onRenderPlaceholder, onRenderCaretDown: onRenderCaretDown, onClick: () => {
20
+ return (React.createElement(Dropdown, { "data-ui-id": 'permission-dropdown', placeholder: strings === null || strings === void 0 ? void 0 : strings.placeHolderText, label: strings === null || strings === void 0 ? void 0 : strings.label, onRenderPlaceholder: onRenderPlaceholder, onRenderCaretDown: onRenderCaretDown, onClick: () => {
21
21
  if (askDevicePermission) {
22
22
  askDevicePermission(constrain !== null && constrain !== void 0 ? constrain : { video: true, audio: true });
23
23
  }
24
+ onClick === null || onClick === void 0 ? void 0 : onClick();
24
25
  }, options: options !== null && options !== void 0 ? options : [], styles: styles }));
25
26
  };
26
27
  //# sourceMappingURL=DevicePermissionDropdown.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DevicePermissionDropdown.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/DevicePermissionDropdown.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,QAAQ,EAAoC,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC1F,OAAO,KAAK,MAAM,OAAO,CAAC;AA0D1B;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,KAAqC,EAAe,EAAE;IAC9F,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAEjF,MAAM,mBAAmB,GAAG,GAAgB,EAAE;QAC5C,OAAO,CACL,oBAAC,KAAK,IAAC,UAAU,QAAC,aAAa,EAAC,QAAQ;YACrC,IAAI;YACL,oBAAC,IAAI,QAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,CAAQ,CACjC,CACT,CAAC;IACJ,CAAC,CAAC;IAEF,MAAM,iBAAiB,GAAG,GAAgB,EAAE;QAC1C,OAAO,oBAAC,IAAI,QAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,mBAAmB,CAAQ,CAAC;IACrD,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,QAAQ,IACP,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,EACrC,KAAK,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,EACrB,mBAAmB,EAAE,mBAAmB,EACxC,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,EAAE,GAAG,EAAE;YACZ,IAAI,mBAAmB,EAAE;gBACvB,mBAAmB,CAAC,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;aAChE;QACH,CAAC,EACD,OAAO,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,EACtB,MAAM,EAAE,MAAM,GACd,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Dropdown, IDropdownOption, IDropdownStyles, Stack, Text } from '@fluentui/react';\nimport React from 'react';\n\n/**\n * Strings of {@link DevicePermissionDropdown} that can be overridden.\n *\n * @internal\n */\nexport interface _DevicePermissionDropdownStrings {\n /**\n * dropdown label\n */\n\n label?: string;\n /**\n * dropdown placeholder\n */\n placeHolderText: string;\n /** string for action button */\n actionButtonContent?: string;\n}\n\n/**\n * Props for {@link _DevicePermissionDropdown}.\n *\n * @internal\n */\nexport interface _DevicePermissionDropdownProps {\n /**\n * icon shown in dropdown placeholder\n */\n icon?: JSX.Element;\n /**\n * Dropdown content\n */\n options?: IDropdownOption[];\n /**\n * Ask for permissions of devices.\n *\n * @remarks\n * Browser permission window will pop up if permissions are not granted yet\n *\n * @param constrain - Define constraints for accessing local devices {@link @azure/communication-calling#PermissionConstraints }\n */\n askDevicePermission?(constrain: _PermissionConstraints): Promise<void>;\n /**\n * Define constraints for accessing local devices {@link @azure/communication-calling#PermissionConstraints }\n */\n constrain?: _PermissionConstraints;\n /**\n * Strings for devicepermissiondropdown\n */\n strings?: _DevicePermissionDropdownStrings;\n /**\n * Styles for devicepermissiondropdown\n */\n styles?: Partial<IDropdownStyles>;\n}\n\n/**\n * A dropdown to trigger device permission prompt\n *\n * @internal\n */\nexport const _DevicePermissionDropdown = (props: _DevicePermissionDropdownProps): JSX.Element => {\n const { icon, askDevicePermission, constrain, strings, options, styles } = props;\n\n const onRenderPlaceholder = (): JSX.Element => {\n return (\n <Stack horizontal verticalAlign=\"center\">\n {icon}\n <Text>{strings?.placeHolderText}</Text>\n </Stack>\n );\n };\n\n const onRenderCaretDown = (): JSX.Element => {\n return <Text>{strings?.actionButtonContent}</Text>;\n };\n\n return (\n <Dropdown\n placeholder={strings?.placeHolderText}\n label={strings?.label}\n onRenderPlaceholder={onRenderPlaceholder}\n onRenderCaretDown={onRenderCaretDown}\n onClick={() => {\n if (askDevicePermission) {\n askDevicePermission(constrain ?? { video: true, audio: true });\n }\n }}\n options={options ?? []}\n styles={styles}\n />\n );\n};\n\n/**\n * Define constraints for accessing local devices {@link @azure/communication-calling#PermissionConstraints }\n *\n * @internal\n */\nexport type _PermissionConstraints = {\n audio: boolean;\n video: boolean;\n};\n"]}
1
+ {"version":3,"file":"DevicePermissionDropdown.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/DevicePermissionDropdown.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,QAAQ,EAAoC,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC1F,OAAO,KAAK,MAAM,OAAO,CAAC;AA8D1B;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,KAAqC,EAAe,EAAE;IAC9F,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAE1F,MAAM,mBAAmB,GAAG,GAAgB,EAAE;QAC5C,OAAO,CACL,oBAAC,KAAK,IAAC,UAAU,QAAC,aAAa,EAAC,QAAQ;YACrC,IAAI;YACL,oBAAC,IAAI,QAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,CAAQ,CACjC,CACT,CAAC;IACJ,CAAC,CAAC;IAEF,MAAM,iBAAiB,GAAG,GAAgB,EAAE;QAC1C,OAAO,oBAAC,IAAI,QAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,mBAAmB,CAAQ,CAAC;IACrD,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,QAAQ,kBACK,qBAAqB,EACjC,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,EACrC,KAAK,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,EACrB,mBAAmB,EAAE,mBAAmB,EACxC,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,EAAE,GAAG,EAAE;YACZ,IAAI,mBAAmB,EAAE;gBACvB,mBAAmB,CAAC,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;aAChE;YACD,OAAO,aAAP,OAAO,uBAAP,OAAO,EAAI,CAAC;QACd,CAAC,EACD,OAAO,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,EACtB,MAAM,EAAE,MAAM,GACd,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Dropdown, IDropdownOption, IDropdownStyles, Stack, Text } from '@fluentui/react';\nimport React from 'react';\n\n/**\n * Strings of {@link DevicePermissionDropdown} that can be overridden.\n *\n * @internal\n */\nexport interface _DevicePermissionDropdownStrings {\n /**\n * dropdown label\n */\n\n label?: string;\n /**\n * dropdown placeholder\n */\n placeHolderText: string;\n /** string for action button */\n actionButtonContent?: string;\n}\n\n/**\n * Props for {@link _DevicePermissionDropdown}.\n *\n * @internal\n */\nexport interface _DevicePermissionDropdownProps {\n /**\n * icon shown in dropdown placeholder\n */\n icon?: JSX.Element;\n /**\n * Dropdown content\n */\n options?: IDropdownOption[];\n /**\n * Ask for permissions of devices.\n *\n * @remarks\n * Browser permission window will pop up if permissions are not granted yet\n *\n * @param constrain - Define constraints for accessing local devices {@link @azure/communication-calling#PermissionConstraints }\n */\n askDevicePermission?(constrain: _PermissionConstraints): Promise<void>;\n /**\n * Optional callback when component is clicked\n */\n onClick?: () => void;\n /**\n * Define constraints for accessing local devices {@link @azure/communication-calling#PermissionConstraints }\n */\n constrain?: _PermissionConstraints;\n /**\n * Strings for devicepermissiondropdown\n */\n strings?: _DevicePermissionDropdownStrings;\n /**\n * Styles for devicepermissiondropdown\n */\n styles?: Partial<IDropdownStyles>;\n}\n\n/**\n * A dropdown to trigger device permission prompt\n *\n * @internal\n */\nexport const _DevicePermissionDropdown = (props: _DevicePermissionDropdownProps): JSX.Element => {\n const { icon, askDevicePermission, onClick, constrain, strings, options, styles } = props;\n\n const onRenderPlaceholder = (): JSX.Element => {\n return (\n <Stack horizontal verticalAlign=\"center\">\n {icon}\n <Text>{strings?.placeHolderText}</Text>\n </Stack>\n );\n };\n\n const onRenderCaretDown = (): JSX.Element => {\n return <Text>{strings?.actionButtonContent}</Text>;\n };\n\n return (\n <Dropdown\n data-ui-id={'permission-dropdown'}\n placeholder={strings?.placeHolderText}\n label={strings?.label}\n onRenderPlaceholder={onRenderPlaceholder}\n onRenderCaretDown={onRenderCaretDown}\n onClick={() => {\n if (askDevicePermission) {\n askDevicePermission(constrain ?? { video: true, audio: true });\n }\n onClick?.();\n }}\n options={options ?? []}\n styles={styles}\n />\n );\n};\n\n/**\n * Define constraints for accessing local devices {@link @azure/communication-calling#PermissionConstraints }\n *\n * @internal\n */\nexport type _PermissionConstraints = {\n audio: boolean;\n video: boolean;\n};\n"]}
@@ -10,6 +10,8 @@ import { _formatString } from "../../../acs-ui-common/src";
10
10
  /* @conditional-compile-remove(call-readiness) */
11
11
  import { iconContainerStyles, iconPrimaryStyles, linkTextStyles, primaryButtonStyles, primaryTextStyles, secondaryTextStyles, sparkleIconBackdropStyles, textContainerStyles } from './styles/DomainPermissions.styles';
12
12
  /* @conditional-compile-remove(call-readiness) */
13
+ import { isValidString } from './utils';
14
+ /* @conditional-compile-remove(call-readiness) */
13
15
  const DomainPermissionsContainer = (props) => {
14
16
  const { appName, onTroubleshootingClick, onAllowAccessClick, strings } = props;
15
17
  const theme = useTheme();
@@ -40,8 +42,4 @@ export const DomainPermissions = (props) => {
40
42
  return React.createElement(DomainPermissionsContainer, Object.assign({}, props, { strings: props.strings ? props.strings : locale }));
41
43
  return React.createElement(React.Fragment, null);
42
44
  };
43
- /* @conditional-compile-remove(call-readiness) */
44
- const isValidString = (string) => {
45
- return !!string && string.length > 0;
46
- };
47
45
  //# sourceMappingURL=DomainPermissions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DomainPermissions.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/DomainPermissions.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,iDAAiD;AACjD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACnF,iDAAiD;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,iDAAiD;AACjD,OAAO,EAAE,aAAa,EAAY,mCAAgC;AAClE,iDAAiD;AACjD,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,yBAAyB,EACzB,mBAAmB,EACpB,M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Content":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React from 'react';\n/* @conditional-compile-remove(call-readiness) */\nimport { Stack, Text, Link, Icon, useTheme, PrimaryButton } from '@fluentui/react';\n/* @conditional-compile-remove(call-readiness) */\nimport { useLocale } from '../localization';\n/* @conditional-compile-remove(call-readiness) */\nimport { _formatString, _pxToRem } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(call-readiness) */\nimport {\n iconContainerStyles,\n iconPrimaryStyles,\n linkTextStyles,\n primaryButtonStyles,\n primaryTextStyles,\n secondaryTextStyles,\n sparkleIconBackdropStyles,\n textContainerStyles\n} from './styles/DomainPermissions.styles';\n\n/**\n * @beta\n * Props for DomainPermissions component.\n */\nexport interface DomainPermissionsProps {\n /**\n * Name of application calling experience is in.\n */\n appName: string;\n /**\n * Action to be taken by the more help link. Possible to send to external page or show other modal.\n */\n onTroubleshootingClick?: () => void;\n /**\n * Action to be taken by the Allow Access button.\n */\n onAllowAccessClick?: () => void;\n /**\n * Localization strings for DomainPermissions component.\n */\n strings?: DomainPermissionsStrings;\n}\n\n/**\n * @beta\n * Strings for DomainPermissions component\n */\nexport interface DomainPermissionsStrings {\n /**\n * Main text string.\n */\n primaryText: string;\n /**\n * Subtext string.\n */\n secondaryText: string;\n /**\n * More help link string.\n */\n linkText: string;\n /**\n * Primary button text string.\n */\n primaryButtonText: string;\n /**\n * Aira label describing the content of the container\n */\n ariaLabel: string;\n}\n\n/* @conditional-compile-remove(call-readiness) */\nconst DomainPermissionsContainer = (props: DomainPermissionsProps): JSX.Element => {\n const { appName, onTroubleshootingClick, onAllowAccessClick, strings } = props;\n const theme = useTheme();\n return (\n <Stack style={{ padding: '2rem', maxWidth: '25.375rem' }} aria-label={strings?.ariaLabel}>\n <Stack horizontal style={{ paddingBottom: '1rem' }} horizontalAlign={'space-between'}>\n <Stack styles={iconContainerStyles} horizontalAlign={'center'}>\n <Icon styles={iconPrimaryStyles} iconName={'DomainPermissionCamera'}></Icon>\n </Stack>\n <Stack styles={iconContainerStyles} horizontalAlign={'center'}>\n <Icon styles={sparkleIconBackdropStyles(theme)} iconName={'DomainPermissionsSparkle'}></Icon>\n </Stack>\n <Stack styles={iconContainerStyles} horizontalAlign={'center'}>\n <Icon styles={iconPrimaryStyles} iconName={'DomainPermissionMic'}></Icon>\n </Stack>\n </Stack>\n <Stack styles={textContainerStyles}>\n {strings && isValidString(strings?.primaryText) && (\n <Text styles={primaryTextStyles}>{_formatString(strings.primaryText, { appName: appName })}</Text>\n )}\n {strings && isValidString(strings?.secondaryText) && (\n <Text styles={secondaryTextStyles}>{strings?.secondaryText}</Text>\n )}\n\n {onAllowAccessClick && isValidString(strings?.primaryButtonText) && (\n <PrimaryButton styles={primaryButtonStyles} text={strings?.primaryButtonText} onClick={onAllowAccessClick} />\n )}\n {onTroubleshootingClick && isValidString(strings?.linkText) && (\n <Link styles={linkTextStyles} onClick={onTroubleshootingClick}>\n {strings?.linkText}\n </Link>\n )}\n </Stack>\n </Stack>\n );\n};\n\n/**\n * @beta\n *\n * Component to allow Contoso to help their end user with their devices should their permissions be blocked\n * by their browsers settings.\n */\nexport const DomainPermissions = (props: DomainPermissionsProps): JSX.Element => {\n /* @conditional-compile-remove(call-readiness) */\n const locale = useLocale().strings.DomainPermissions;\n /* @conditional-compile-remove(call-readiness) */\n return <DomainPermissionsContainer {...props} strings={props.strings ? props.strings : locale} />;\n return <></>;\n};\n\n/* @conditional-compile-remove(call-readiness) */\nconst isValidString = (string: string | undefined): boolean => {\n return !!string && string.length > 0;\n};\n\"../../../acs-ui-common/src\""]}
1
+ {"version":3,"file":"DomainPermissions.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/DomainPermissions.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,iDAAiD;AACjD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,aA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AAiD;IACjD,OAAO,oBAAC,0BAA0B,oBAAK,KAAK,IAAE,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC;IAClG,OAAO,yCAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React from 'react';\n/* @conditional-compile-remove(call-readiness) */\nimport { Stack, Text, Link, Icon, useTheme, PrimaryButton } from '@fluentui/react';\n/* @conditional-compile-remove(call-readiness) */\nimport { useLocale } from '../localization';\n/* @conditional-compile-remove(call-readiness) */\nimport { _formatString, _pxToRem } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(call-readiness) */\nimport {\n iconContainerStyles,\n iconPrimaryStyles,\n linkTextStyles,\n primaryButtonStyles,\n primaryTextStyles,\n secondaryTextStyles,\n sparkleIconBackdropStyles,\n textContainerStyles\n} from './styles/DomainPermissions.styles';\n/* @conditional-compile-remove(call-readiness) */\nimport { isValidString } from './utils';\n\n/**\n * @beta\n * Props for DomainPermissions component.\n */\nexport interface DomainPermissionsProps {\n /**\n * Name of application calling experience is in.\n */\n appName: string;\n /**\n * Action to be taken by the more help link. Possible to send to external page or show other modal.\n */\n onTroubleshootingClick?: () => void;\n /**\n * Action to be taken by the Allow Access button.\n */\n onAllowAccessClick?: () => void;\n /**\n * Localization strings for DomainPermissions component.\n */\n strings?: DomainPermissionsStrings;\n}\n\n/**\n * @beta\n * Strings for DomainPermissions component\n */\nexport interface DomainPermissionsStrings {\n /**\n * Main text string.\n */\n primaryText: string;\n /**\n * Subtext string.\n */\n secondaryText: string;\n /**\n * More help link string.\n */\n linkText: string;\n /**\n * Primary button text string.\n */\n primaryButtonText: string;\n /**\n * Aira label describing the content of the container\n */\n ariaLabel: string;\n}\n\n/* @conditional-compile-remove(call-readiness) */\nconst DomainPermissionsContainer = (props: DomainPermissionsProps): JSX.Element => {\n const { appName, onTroubleshootingClick, onAllowAccessClick, strings } = props;\n const theme = useTheme();\n return (\n <Stack style={{ padding: '2rem', maxWidth: '25.375rem' }} aria-label={strings?.ariaLabel}>\n <Stack horizontal style={{ paddingBottom: '1rem' }} horizontalAlign={'space-between'}>\n <Stack styles={iconContainerStyles} horizontalAlign={'center'}>\n <Icon styles={iconPrimaryStyles} iconName={'DomainPermissionCamera'}></Icon>\n </Stack>\n <Stack styles={iconContainerStyles} horizontalAlign={'center'}>\n <Icon styles={sparkleIconBackdropStyles(theme)} iconName={'DomainPermissionsSparkle'}></Icon>\n </Stack>\n <Stack styles={iconContainerStyles} horizontalAlign={'center'}>\n <Icon styles={iconPrimaryStyles} iconName={'DomainPermissionMic'}></Icon>\n </Stack>\n </Stack>\n <Stack styles={textContainerStyles}>\n {strings && isValidString(strings?.primaryText) && (\n <Text styles={primaryTextStyles}>{_formatString(strings.primaryText, { appName: appName })}</Text>\n )}\n {strings && isValidString(strings?.secondaryText) && (\n <Text styles={secondaryTextStyles}>{strings?.secondaryText}</Text>\n )}\n\n {onAllowAccessClick && isValidString(strings?.primaryButtonText) && (\n <PrimaryButton styles={primaryButtonStyles} text={strings?.primaryButtonText} onClick={onAllowAccessClick} />\n )}\n {onTroubleshootingClick && isValidString(strings?.linkText) && (\n <Link styles={linkTextStyles} onClick={onTroubleshootingClick}>\n {strings?.linkText}\n </Link>\n )}\n </Stack>\n </Stack>\n );\n};\n\n/**\n * @beta\n *\n * Component to allow Contoso to help their end user with their devices should their permissions be blocked\n * by their browsers settings.\n */\nexport const DomainPermissions = (props: DomainPermissionsProps): JSX.Element => {\n /* @conditional-compile-remove(call-readiness) */\n const locale = useLocale().strings.DomainPermissions;\n /* @conditional-compile-remove(call-readiness) */\n return <DomainPermissionsContainer {...props} strings={props.strings ? props.strings : locale} />;\n return <></>;\n};\n\"../../../acs-ui-common/src\""]}
@@ -64,4 +64,8 @@ export declare const messageBarIconProps: (errorType: ErrorType) => IIconProps |
64
64
  export declare const customIconName: Partial<{
65
65
  [key in ErrorType]: string;
66
66
  }>;
67
+ /**
68
+ * @private
69
+ */
70
+ export declare const isValidString: (string: string | undefined) => boolean;
67
71
  //# sourceMappingURL=utils.d.ts.map
@@ -147,4 +147,11 @@ export const customIconName = {
147
147
  callVideoRecoveredBySystem: 'ErrorBarCallVideoRecoveredBySystem',
148
148
  callMacOsCameraAccessDenied: 'ErrorBarCallMacOsCameraAccessDenied'
149
149
  };
150
+ /* @conditional-compile-remove(call-readiness) */
151
+ /**
152
+ * @private
153
+ */
154
+ export const isValidString = (string) => {
155
+ return !!string && string.length > 0;
156
+ };
150
157
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAc,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAG7D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAAgB,EAAE,MAAc,EAAU,EAAE;IAC5E,OAAO,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAC5F,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,QAAgB,EAAU,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;AAWvF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,eAAiC,EAAE,SAA6B,EAAoB,EAAE;IACjH,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IACjC,KAAK,MAAM,KAAK,IAAI,eAAe,EAA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AM,CAAC,MAAM,mBAAmB,GAAG,CAAC,SAAoB,EAA0B,EAAE;IAClF,MAAM,QAAQ,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;IAC3C,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAC7C,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAA4C;IACrE,qBAAqB,EAAE,+BAA+B;IACtD,kBAAkB,EAAE,4BAA4B;IAChD,qBAAqB,EAAE,+BAA+B;IACtD,0BAA0B,EAAE,oCAAoC;IAChE,2BAA2B,EAAE,qCAAqC;IAClE,6BAA6B,EAAE,uCAAuC;IACtE,+BAA+B,EAAE,yCAAyC;IAC1E,oBAAoB,EAAE,8BAA8B;IACpD,sBAAsB,EAAE,gCAAgC;IACxD,sBAAsB,EAAE,gCAAgC;IACxD,wBAAwB,EAAE,kCAAkC;IAC5D,0BAA0B,EAAE,oCAAoC;IAChE,2BAA2B,EAAE,qCAAqC;CACnE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { IIconProps, MessageBarType } from '@fluentui/react';\nimport { ActiveErrorMessage, ErrorType } from './ErrorBar';\n\n/**\n * @private\n *\n * @param fileName\n * @param length\n * @returns string\n */\nexport const truncatedFileName = (fileName: string, length: number): string => {\n return fileName.substring(0, length).trimEnd() + (fileName.length > length ? '... ' : '');\n};\n\n/**\n * @private\n *\n * @param fileName\n * @returns string\n */\nexport const extension = (fileName: string): string => fileName.split('.').pop() || '';\n\n/**\n * @private\n */\nexport interface DismissedError {\n type: ErrorType;\n dismissedAt: Date;\n activeSince?: Date;\n}\n\n/**\n * @private\n * @param dismissedErrors\n * @param toDismiss\n * @returns DismissedError[]\n * Always returns a new Array so that the state variable is updated, trigerring a render.\n */\nexport const dismissError = (dismissedErrors: DismissedError[], toDismiss: ActiveErrorMessage): DismissedError[] => {\n const now = new Date(Date.now());\n for (const error of dismissedErrors) {\n if (error.type === toDismiss.type) {\n // Bump the timestamp for latest dismissal of this error to now.\n error.dismissedAt = now;\n error.activeSince = toDismiss.timestamp;\n return Array.from(dismissedErrors);\n }\n }\n\n // Record that this error was dismissed for the first time right now.\n return [\n ...dismissedErrors,\n {\n type: toDismiss.type,\n dismissedAt: now,\n activeSince: toDismiss.timestamp\n }\n ];\n};\n\n/**\n * @private\n * @param activeErrorMessages\n * @param dismissedErrors\n * @returns DismissedError[]\n * Returns a new Array if and only if contents change, to avoid re-rendering when nothing was dropped.\n */\nexport const dropDismissalsForInactiveErrors = (\n activeErrorMessages: ActiveErrorMessage[],\n dismissedErrors: DismissedError[]\n): DismissedError[] => {\n const active = new Map();\n for (const message of activeErrorMessages) {\n active.set(message.type, message);\n }\n\n // For an error such that:\n // * It was previously active, and dismissed.\n // * It did not have a timestamp associated with it.\n // * It is no longer active.\n //\n // We remove it from dismissals. When it becomes active again next time, it will be shown again on the UI.\n const shouldDeleteDismissal = (dismissed: DismissedError): boolean =>\n dismissed.activeSince === undefined && active.get(dismissed.type) === undefined;\n\n if (dismissedErrors.some((dismissed) => shouldDeleteDismissal(dismissed))) {\n return dismissedErrors.filter((dismissed) => !shouldDeleteDismissal(dismissed));\n }\n return dismissedErrors;\n};\n\n/**\n * @private\n * @param activeErrorMessages\n * @param dismissedErrors\n * @returns ActiveErrorMessage[]\n */\nexport const errorsToShow = (\n activeErrorMessages: ActiveErrorMessage[],\n dismissedErrors: DismissedError[]\n): ActiveErrorMessage[] => {\n const dismissed: Map<ErrorType, DismissedError> = new Map();\n for (const error of dismissedErrors) {\n dismissed.set(error.type, error);\n }\n\n return activeErrorMessages.filter((error) => {\n const dismissal = dismissed.get(error.type);\n if (!dismissal) {\n // This error was never dismissed.\n return true;\n }\n if (!error.timestamp) {\n // No timestamp associated with the error. In this case, the existence of a dismissal is enough to suppress the error.\n return false;\n }\n // Error has an associated timestamp, so compare with last dismissal.\n return error.timestamp > dismissal.dismissedAt;\n });\n};\n\n/**\n * @private\n * @param errorType\n * @returns MessageBarType\n */\nexport const messageBarType = (errorType: ErrorType): MessageBarType => {\n switch (errorType) {\n case 'callNetworkQualityLow':\n case 'callNoSpeakerFound':\n case 'callNoMicrophoneFound':\n case 'callMicrophoneAccessDenied':\n case 'callMicrophoneMutedBySystem':\n case 'callMicrophoneUnmutedBySystem':\n case 'callMacOsMicrophoneAccessDenied':\n case 'callLocalVideoFreeze':\n case 'callCameraAccessDenied':\n case 'callCameraAlreadyInUse':\n case 'callVideoStoppedBySystem':\n case 'callVideoRecoveredBySystem':\n case 'callMacOsCameraAccessDenied':\n case 'callMacOsScreenShareAccessDenied':\n return MessageBarType.warning;\n default:\n return MessageBarType.error;\n }\n};\n\n/**\n * @private\n * @param errorType\n * @returns IIconProps | undefined\n */\nexport const messageBarIconProps = (errorType: ErrorType): IIconProps | undefined => {\n const iconName = customIconName[errorType];\n return iconName ? { iconName } : undefined;\n};\n\n/**\n * @private\n */\nexport const customIconName: Partial<{ [key in ErrorType]: string }> = {\n callNetworkQualityLow: 'ErrorBarCallNetworkQualityLow',\n callNoSpeakerFound: 'ErrorBarCallNoSpeakerFound',\n callNoMicrophoneFound: 'ErrorBarCallNoMicrophoneFound',\n callMicrophoneAccessDenied: 'ErrorBarCallMicrophoneAccessDenied',\n callMicrophoneMutedBySystem: 'ErrorBarCallMicrophoneMutedBySystem',\n callMicrophoneUnmutedBySystem: 'ErrorBarCallMicrophoneUnmutedBySystem',\n callMacOsMicrophoneAccessDenied: 'ErrorBarCallMacOsMicrophoneAccessDenied',\n callLocalVideoFreeze: 'ErrorBarCallLocalVideoFreeze',\n callCameraAccessDenied: 'ErrorBarCallCameraAccessDenied',\n callCameraAlreadyInUse: 'ErrorBarCallCameraAlreadyInUse',\n callVideoStoppedBySystem: 'ErrorBarCallVideoStoppedBySystem',\n callVideoRecoveredBySystem: 'ErrorBarCallVideoRecoveredBySystem',\n callMacOsCameraAccessDenied: 'ErrorBarCallMacOsCameraAccessDenied'\n};\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAc,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAG7D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,QAAgB,EAAE,MAAc,EAAU,EAAE;IAC5E,OAAO,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,OAAO,EAAE,GAAG,CAAC,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAC5F,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,QAAgB,EAAU,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC;AAWvF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,eAAiC,EAAE,SAA6B,EAAoB,EAAE;IACjH,MAAM,GAAG,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;IACjC,KAAK,MAAM,KAAK,IAAI,eAAe,EAAE;QACnC,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,EAAE;YACjC,gEAAgE;YAChE,KAAK,CAAC,WAAW,GAAG,GAAG,CAAC;YACxB,KAAK,CAAC,WAAW,GAAG,SAAS,CAAC,SAAS,CAAC;YACxC,OAAO,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;SACpC;KACF;IAED,qEAAqE;IACrE,OAAO;QACL,GAAG,eAAe;QAClB;YACE,IAAI,EAAE,SAAS,CAAC,IAAI;YACpB,WAAW,EAAE,GAAG;YAChB,WAAW,EAAE,SAAS,CAAC,SAAS;SACjC;KACF,CAAC;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EAAE,qCAAqC;IAClE,6BAA6B,EAAE,uCAAuC;IACtE,+BAA+B,EAAE,yCAAyC;IAC1E,oBAAoB,EAAE,8BAA8B;IACpD,sBAAsB,EAAE,gCAAgC;IACxD,sBAAsB,EAAE,gCAAgC;IACxD,wBAAwB,EAAE,kCAAkC;IAC5D,0BAA0B,EAAE,oCAAoC;IAChE,2BAA2B,EAAE,qCAAqC;CACnE,CAAC;AAEF,iDAAiD;AACjD;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,MAA0B,EAAW,EAAE;IACnE,OAAO,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;AACvC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { IIconProps, MessageBarType } from '@fluentui/react';\nimport { ActiveErrorMessage, ErrorType } from './ErrorBar';\n\n/**\n * @private\n *\n * @param fileName\n * @param length\n * @returns string\n */\nexport const truncatedFileName = (fileName: string, length: number): string => {\n return fileName.substring(0, length).trimEnd() + (fileName.length > length ? '... ' : '');\n};\n\n/**\n * @private\n *\n * @param fileName\n * @returns string\n */\nexport const extension = (fileName: string): string => fileName.split('.').pop() || '';\n\n/**\n * @private\n */\nexport interface DismissedError {\n type: ErrorType;\n dismissedAt: Date;\n activeSince?: Date;\n}\n\n/**\n * @private\n * @param dismissedErrors\n * @param toDismiss\n * @returns DismissedError[]\n * Always returns a new Array so that the state variable is updated, trigerring a render.\n */\nexport const dismissError = (dismissedErrors: DismissedError[], toDismiss: ActiveErrorMessage): DismissedError[] => {\n const now = new Date(Date.now());\n for (const error of dismissedErrors) {\n if (error.type === toDismiss.type) {\n // Bump the timestamp for latest dismissal of this error to now.\n error.dismissedAt = now;\n error.activeSince = toDismiss.timestamp;\n return Array.from(dismissedErrors);\n }\n }\n\n // Record that this error was dismissed for the first time right now.\n return [\n ...dismissedErrors,\n {\n type: toDismiss.type,\n dismissedAt: now,\n activeSince: toDismiss.timestamp\n }\n ];\n};\n\n/**\n * @private\n * @param activeErrorMessages\n * @param dismissedErrors\n * @returns DismissedError[]\n * Returns a new Array if and only if contents change, to avoid re-rendering when nothing was dropped.\n */\nexport const dropDismissalsForInactiveErrors = (\n activeErrorMessages: ActiveErrorMessage[],\n dismissedErrors: DismissedError[]\n): DismissedError[] => {\n const active = new Map();\n for (const message of activeErrorMessages) {\n active.set(message.type, message);\n }\n\n // For an error such that:\n // * It was previously active, and dismissed.\n // * It did not have a timestamp associated with it.\n // * It is no longer active.\n //\n // We remove it from dismissals. When it becomes active again next time, it will be shown again on the UI.\n const shouldDeleteDismissal = (dismissed: DismissedError): boolean =>\n dismissed.activeSince === undefined && active.get(dismissed.type) === undefined;\n\n if (dismissedErrors.some((dismissed) => shouldDeleteDismissal(dismissed))) {\n return dismissedErrors.filter((dismissed) => !shouldDeleteDismissal(dismissed));\n }\n return dismissedErrors;\n};\n\n/**\n * @private\n * @param activeErrorMessages\n * @param dismissedErrors\n * @returns ActiveErrorMessage[]\n */\nexport const errorsToShow = (\n activeErrorMessages: ActiveErrorMessage[],\n dismissedErrors: DismissedError[]\n): ActiveErrorMessage[] => {\n const dismissed: Map<ErrorType, DismissedError> = new Map();\n for (const error of dismissedErrors) {\n dismissed.set(error.type, error);\n }\n\n return activeErrorMessages.filter((error) => {\n const dismissal = dismissed.get(error.type);\n if (!dismissal) {\n // This error was never dismissed.\n return true;\n }\n if (!error.timestamp) {\n // No timestamp associated with the error. In this case, the existence of a dismissal is enough to suppress the error.\n return false;\n }\n // Error has an associated timestamp, so compare with last dismissal.\n return error.timestamp > dismissal.dismissedAt;\n });\n};\n\n/**\n * @private\n * @param errorType\n * @returns MessageBarType\n */\nexport const messageBarType = (errorType: ErrorType): MessageBarType => {\n switch (errorType) {\n case 'callNetworkQualityLow':\n case 'callNoSpeakerFound':\n case 'callNoMicrophoneFound':\n case 'callMicrophoneAccessDenied':\n case 'callMicrophoneMutedBySystem':\n case 'callMicrophoneUnmutedBySystem':\n case 'callMacOsMicrophoneAccessDenied':\n case 'callLocalVideoFreeze':\n case 'callCameraAccessDenied':\n case 'callCameraAlreadyInUse':\n case 'callVideoStoppedBySystem':\n case 'callVideoRecoveredBySystem':\n case 'callMacOsCameraAccessDenied':\n case 'callMacOsScreenShareAccessDenied':\n return MessageBarType.warning;\n default:\n return MessageBarType.error;\n }\n};\n\n/**\n * @private\n * @param errorType\n * @returns IIconProps | undefined\n */\nexport const messageBarIconProps = (errorType: ErrorType): IIconProps | undefined => {\n const iconName = customIconName[errorType];\n return iconName ? { iconName } : undefined;\n};\n\n/**\n * @private\n */\nexport const customIconName: Partial<{ [key in ErrorType]: string }> = {\n callNetworkQualityLow: 'ErrorBarCallNetworkQualityLow',\n callNoSpeakerFound: 'ErrorBarCallNoSpeakerFound',\n callNoMicrophoneFound: 'ErrorBarCallNoMicrophoneFound',\n callMicrophoneAccessDenied: 'ErrorBarCallMicrophoneAccessDenied',\n callMicrophoneMutedBySystem: 'ErrorBarCallMicrophoneMutedBySystem',\n callMicrophoneUnmutedBySystem: 'ErrorBarCallMicrophoneUnmutedBySystem',\n callMacOsMicrophoneAccessDenied: 'ErrorBarCallMacOsMicrophoneAccessDenied',\n callLocalVideoFreeze: 'ErrorBarCallLocalVideoFreeze',\n callCameraAccessDenied: 'ErrorBarCallCameraAccessDenied',\n callCameraAlreadyInUse: 'ErrorBarCallCameraAlreadyInUse',\n callVideoStoppedBySystem: 'ErrorBarCallVideoStoppedBySystem',\n callVideoRecoveredBySystem: 'ErrorBarCallVideoRecoveredBySystem',\n callMacOsCameraAccessDenied: 'ErrorBarCallMacOsCameraAccessDenied'\n};\n\n/* @conditional-compile-remove(call-readiness) */\n/**\n * @private\n */\nexport const isValidString = (string: string | undefined): boolean => {\n return !!string && string.length > 0;\n};\n"]}
@@ -20,7 +20,7 @@ import { DiagnosticsForwarder } from './DiagnosticsForwarder';
20
20
  import { useEffect, useRef, useState } from 'react';
21
21
  /** Context of call, which is a centralized context for all state updates */
22
22
  class CallContext {
23
- constructor(clientState, isTeamsCall) {
23
+ constructor(clientState, isTeamsCall, maxListeners = 50) {
24
24
  var _a;
25
25
  this.emitter = new EventEmitter();
26
26
  this.state = {
@@ -34,6 +34,7 @@ class CallContext {
34
34
  isTeamsCall,
35
35
  /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId: clientState.alternateCallerId
36
36
  };
37
+ this.emitter.setMaxListeners(maxListeners);
37
38
  }
38
39
  onStateChange(handler) {
39
40
  this.emitter.on('stateChanged', handler);