@azure/communication-react 1.5.1-alpha-202305050017 → 1.5.1-alpha-202305060013

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 (55) hide show
  1. package/dist/communication-react.d.ts +84 -67
  2. package/dist/dist-cjs/communication-react/index.js +1400 -149
  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/communication-react/src/index.d.ts +1 -1
  7. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  8. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.d.ts +3 -3
  9. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js +7 -2
  10. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js.map +1 -1
  11. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.d.ts +2 -0
  12. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js +5 -1
  13. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js.map +1 -1
  14. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.d.ts +4 -4
  15. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js +3 -1
  16. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js.map +1 -1
  17. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.d.ts +2 -2
  18. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +56 -35
  19. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
  20. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.d.ts +10 -0
  21. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js +15 -0
  22. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js.map +1 -0
  23. package/dist/dist-esm/react-components/src/components/InputBoxComponent.d.ts +3 -3
  24. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js +1038 -5
  25. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js.map +1 -1
  26. package/dist/dist-esm/react-components/src/components/MentionPopover.d.ts +121 -0
  27. package/dist/dist-esm/react-components/src/components/MentionPopover.js +125 -0
  28. package/dist/dist-esm/react-components/src/components/MentionPopover.js.map +1 -0
  29. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +4 -4
  30. package/dist/dist-esm/react-components/src/components/MessageThread.js +9 -3
  31. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  32. package/dist/dist-esm/react-components/src/components/SendBox.d.ts +7 -7
  33. package/dist/dist-esm/react-components/src/components/SendBox.js +15 -9
  34. package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
  35. package/dist/dist-esm/react-components/src/components/index.d.ts +2 -2
  36. package/dist/dist-esm/react-components/src/components/index.js +2 -2
  37. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  38. package/dist/dist-esm/react-components/src/components/styles/{AtMentionFlyout.style.d.ts → MentionPopover.style.d.ts} +4 -4
  39. package/dist/dist-esm/react-components/src/components/styles/{AtMentionFlyout.style.js → MentionPopover.style.js} +11 -13
  40. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js.map +1 -0
  41. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +5 -1
  42. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
  43. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.d.ts +4 -4
  44. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js +4 -4
  45. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js.map +1 -1
  46. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +3 -0
  47. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
  48. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +3 -0
  49. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +2 -1
  50. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  51. package/package.json +11 -9
  52. package/dist/dist-esm/react-components/src/components/AtMentionFlyout.d.ts +0 -91
  53. package/dist/dist-esm/react-components/src/components/AtMentionFlyout.js +0 -58
  54. package/dist/dist-esm/react-components/src/components/AtMentionFlyout.js.map +0 -1
  55. package/dist/dist-esm/react-components/src/components/styles/AtMentionFlyout.style.js.map +0 -1
@@ -1,91 +0,0 @@
1
- import React from 'react';
2
- /**
3
- * Props for {@link _AtMentionFlyout}.
4
- *
5
- * @internal
6
- */
7
- export interface _AtMentionFlyoutProps {
8
- /**
9
- * Array of at mention suggestions used to populate the suggestion list
10
- */
11
- suggestions: AtMentionSuggestion[];
12
- /**
13
- * Optional string used as at mention flyout's title.
14
- * @defaultValue `Suggestions`
15
- */
16
- title?: string;
17
- /**
18
- * Optional RefObject used as a reference to position AtMentionFlyout.
19
- */
20
- target?: React.RefObject<Element>;
21
- /**
22
- * Optional callback called when a atMention suggestion is selected.
23
- */
24
- onSuggestionSelected?: (suggestion: AtMentionSuggestion) => void;
25
- /**
26
- * Callback to invoke when the at mention flyout is dismissed
27
- */
28
- onDismiss?: () => void;
29
- /**
30
- * Optional callback to render an item of the atMention suggestions list.
31
- */
32
- onRenderSuggestionItem?: (suggestion: AtMentionSuggestion, onSuggestionSelected?: (suggestion: AtMentionSuggestion) => void) => JSX.Element;
33
- }
34
- /**
35
- * Options to lookup suggestions in the at mention scenario.
36
- *
37
- * @beta
38
- */
39
- export interface AtMentionLookupOptions {
40
- /**
41
- * Optional string to set trigger keyword for mention a specific participant.
42
- *
43
- * @defaultValue `@`
44
- */
45
- trigger?: string;
46
- /**
47
- * Optional callback to fetch a list of at mention suggestions base on the query.
48
- */
49
- onQueryUpdated?: (query: string) => Promise<AtMentionSuggestion[]>;
50
- /**
51
- * Optional callback to render an item of the atMention suggestions list.
52
- */
53
- onRenderSuggestionItem?: (suggestion: AtMentionSuggestion, onSuggestionSelected?: (suggestion: AtMentionSuggestion) => void) => JSX.Element;
54
- }
55
- /**
56
- * Options to display suggestions in the at mention scenario.
57
- *
58
- * @beta
59
- */
60
- export interface AtMentionDisplayOptions {
61
- /**
62
- * Optional callback to override render of an mention in a message thread.
63
- */
64
- onRenderAtMentionSuggestion?: (suggestion: AtMentionSuggestion) => JSX.Element;
65
- }
66
- /**
67
- * Options to lookup suggestions and display mentions in the at mention scenario.
68
- *
69
- * @beta
70
- */
71
- export declare type AtMentionOptions = AtMentionLookupOptions & AtMentionDisplayOptions;
72
- /**
73
- * At mention suggestion's state, as reflected in the UI.
74
- *
75
- * @beta
76
- */
77
- export interface AtMentionSuggestion {
78
- /** User ID of a mentioned participant or 'everyone' for an @everyone suggestion */
79
- userId: string;
80
- /** Type of an at mention suggestion */
81
- suggestionType: string;
82
- /** Display name of a mentioned participant */
83
- displayName: string;
84
- }
85
- /**
86
- * Component to render at mention suggestions.
87
- *
88
- * @internal
89
- */
90
- export declare const _AtMentionFlyout: (props: _AtMentionFlyoutProps) => JSX.Element;
91
- //# sourceMappingURL=AtMentionFlyout.d.ts.map
@@ -1,58 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT license.
3
- import React, { useEffect, useState } from 'react';
4
- import { FocusZone, Persona, PersonaSize, Stack, useTheme } from '@fluentui/react';
5
- import { atMentionFlyoutContainer, headerStyleThemed, suggestionListStyle, suggestionListContainerStyle, suggestionItemStackStyle, suggestionItemWrapperStyle } from './styles/AtMentionFlyout.style';
6
- /* @conditional-compile-remove(at-mention) */
7
- import { useIdentifiers } from '../identifiers';
8
- import { useLocale } from '../localization';
9
- /**
10
- * Component to render at mention suggestions.
11
- *
12
- * @internal
13
- */
14
- export const _AtMentionFlyout = (props) => {
15
- const { suggestions, title = 'Suggestions', target, onRenderSuggestionItem, onSuggestionSelected } = props;
16
- const theme = useTheme();
17
- /* @conditional-compile-remove(at-mention) */
18
- const ids = useIdentifiers();
19
- const localeStrings = useLocale().strings.participantItem;
20
- const [position, setPosition] = useState({ top: 0, right: 0, bottom: 0, left: 0 });
21
- const [hoveredSuggestion, setHoveredSuggestion] = useState(undefined);
22
- // Temporary implementation for AtMentionFlyout's position.
23
- useEffect(() => {
24
- var _a;
25
- const rect = (_a = target === null || target === void 0 ? void 0 : target.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
26
- const { top = 0, left = 0, right = 0, bottom = 0, height = 0 } = rect !== null && rect !== void 0 ? rect : {};
27
- const flyoutHeight = 212;
28
- const flyoutTop = top - flyoutHeight - height - 24;
29
- setPosition({ top: flyoutTop > 0 ? flyoutTop : 0, left, right, bottom });
30
- }, [target]);
31
- const personaRenderer = (displayName) => {
32
- const avatarOptions = {
33
- text: (displayName === null || displayName === void 0 ? void 0 : displayName.trim()) || localeStrings.displayNamePlaceholder,
34
- size: PersonaSize.size28,
35
- initialsColor: theme.palette.neutralLight,
36
- initialsTextColor: theme.palette.neutralSecondary,
37
- showOverflowTooltip: false,
38
- showUnknownPersonaCoin: !(displayName === null || displayName === void 0 ? void 0 : displayName.trim()) || displayName === localeStrings.displayNamePlaceholder
39
- };
40
- return React.createElement(Persona, Object.assign({}, avatarOptions));
41
- };
42
- const defaultOnRenderSuggestionItem = (suggestion) => {
43
- const isSuggestionHovered = (hoveredSuggestion === null || hoveredSuggestion === void 0 ? void 0 : hoveredSuggestion.userId) === suggestion.userId;
44
- return (React.createElement("div", { "data-is-focusable": true, "data-ui-id": ids.atMentionSuggestionItem, key: suggestion.userId, onClick: () => onSuggestionSelected && onSuggestionSelected(suggestion), onMouseEnter: () => setHoveredSuggestion(suggestion), onMouseLeave: () => setHoveredSuggestion(undefined), className: suggestionItemWrapperStyle(theme) },
45
- React.createElement(Stack, { horizontal: true, className: suggestionItemStackStyle(theme, isSuggestionHovered) }, personaRenderer(suggestion.displayName))));
46
- };
47
- return (React.createElement(Stack, { className: atMentionFlyoutContainer(theme, position.left, position.top) },
48
- React.createElement(Stack.Item, { styles: headerStyleThemed(theme), "aria-label": title },
49
- title,
50
- " "),
51
- React.createElement(FocusZone, { className: suggestionListContainerStyle, shouldFocusOnMount: true },
52
- React.createElement(Stack
53
- /* @conditional-compile-remove(at-mention) */
54
- , { "data-ui-id": ids.atMentionSuggestionList, className: suggestionListStyle }, suggestions.map((suggestion) => onRenderSuggestionItem
55
- ? onRenderSuggestionItem(suggestion, onSuggestionSelected)
56
- : defaultOnRenderSuggestionItem(suggestion))))));
57
- };
58
- //# sourceMappingURL=AtMentionFlyout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AtMentionFlyout.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/AtMentionFlyout.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACnF,OAAO,EACL,wBAAwB,EACxB,iBAAiB,EACjB,mBAAmB,EACnB,4BAA4B,EAC5B,wBAAwB,EACxB,0BAA0B,EAC3B,MAAM,gCAAgC,CAAC;AACxC,6CAA6C;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAgG5C;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAA4B,EAAe,EAAE;IAQ5E,MAAM,EAAE,WAAW,EAAE,KAAK,GAAG,aAAa,EAAE,MAAM,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,GAAG,KAAK,CAA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,KAAK,CAAC,IAAI,IAAC,MAAM,EAAE,iBAAiB,CAAC,KAAK,CAAC,gBAAc,KAAK;YAC5D,KAAK;gBACK;QACb,oBAAC,SAAS,IAAC,SAAS,EAAE,4BAA4B,EAAE,kBAAkB,EAAE,IAAI;YAC1E,oBAAC,KAAK;YACJ,6CAA6C;8BACjC,GAAG,CAAC,uBAAuB,EACvC,SAAS,EAAE,mBAAmB,IAE7B,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAC9B,sBAAsB;gBACpB,CAAC,CAAC,sBAAsB,CAAC,UAAU,EAAE,oBAAoB,CAAC;gBAC1D,CAAC,CAAC,6BAA6B,CAAC,UAAU,CAAC,CAC9C,CACK,CACE,CACN,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport React, { useEffect, useState } from 'react';\nimport { FocusZone, Persona, PersonaSize, Stack, useTheme } from '@fluentui/react';\nimport {\n atMentionFlyoutContainer,\n headerStyleThemed,\n suggestionListStyle,\n suggestionListContainerStyle,\n suggestionItemStackStyle,\n suggestionItemWrapperStyle\n} from './styles/AtMentionFlyout.style';\n/* @conditional-compile-remove(at-mention) */\nimport { useIdentifiers } from '../identifiers';\nimport { useLocale } from '../localization';\n\n/**\n * Props for {@link _AtMentionFlyout}.\n *\n * @internal\n */\nexport interface _AtMentionFlyoutProps {\n /**\n * Array of at mention suggestions used to populate the suggestion list\n */\n suggestions: AtMentionSuggestion[];\n /**\n * Optional string used as at mention flyout's title.\n * @defaultValue `Suggestions`\n */\n title?: string;\n /**\n * Optional RefObject used as a reference to position AtMentionFlyout.\n */\n target?: React.RefObject<Element>;\n /**\n * Optional callback called when a atMention suggestion is selected.\n */\n onSuggestionSelected?: (suggestion: AtMentionSuggestion) => void;\n /**\n * Callback to invoke when the at mention flyout is dismissed\n */\n onDismiss?: () => void;\n /**\n * Optional callback to render an item of the atMention suggestions list.\n */\n onRenderSuggestionItem?: (\n suggestion: AtMentionSuggestion,\n onSuggestionSelected?: (suggestion: AtMentionSuggestion) => void\n ) => JSX.Element;\n}\n\n/**\n * Options to lookup suggestions in the at mention scenario.\n *\n * @beta\n */\nexport interface AtMentionLookupOptions {\n /**\n * Optional string to set trigger keyword for mention a specific participant.\n *\n * @defaultValue `@`\n */\n trigger?: string;\n /**\n * Optional callback to fetch a list of at mention suggestions base on the query.\n */\n onQueryUpdated?: (query: string) => Promise<AtMentionSuggestion[]>;\n /**\n * Optional callback to render an item of the atMention suggestions list.\n */\n onRenderSuggestionItem?: (\n suggestion: AtMentionSuggestion,\n onSuggestionSelected?: (suggestion: AtMentionSuggestion) => void\n ) => JSX.Element;\n}\n\n/**\n * Options to display suggestions in the at mention scenario.\n *\n * @beta\n */\nexport interface AtMentionDisplayOptions {\n /**\n * Optional callback to override render of an mention in a message thread.\n */\n onRenderAtMentionSuggestion?: (suggestion: AtMentionSuggestion) => JSX.Element;\n}\n\n/**\n * Options to lookup suggestions and display mentions in the at mention scenario.\n *\n * @beta\n */\nexport type AtMentionOptions = AtMentionLookupOptions & AtMentionDisplayOptions;\n\n/**\n * At mention suggestion's state, as reflected in the UI.\n *\n * @beta\n */\nexport interface AtMentionSuggestion {\n /** User ID of a mentioned participant or 'everyone' for an @everyone suggestion */\n userId: string;\n /** Type of an at mention suggestion */\n suggestionType: string;\n /** Display name of a mentioned participant */\n displayName: string;\n}\n\n/**\n * Component to render at mention suggestions.\n *\n * @internal\n */\nexport const _AtMentionFlyout = (props: _AtMentionFlyoutProps): JSX.Element => {\n // Temporary implementation for AtMentionFlyout's position.\n interface Position {\n top: number;\n right: number;\n bottom: number;\n left: number;\n }\n const { suggestions, title = 'Suggestions', target, onRenderSuggestionItem, onSuggestionSelected } = props;\n const theme = useTheme();\n /* @conditional-compile-remove(at-mention) */\n const ids = useIdentifiers();\n const localeStrings = useLocale().strings.participantItem;\n\n const [position, setPosition] = useState<Position>({ top: 0, right: 0, bottom: 0, left: 0 });\n const [hoveredSuggestion, setHoveredSuggestion] = useState<AtMentionSuggestion | undefined>(undefined);\n\n // Temporary implementation for AtMentionFlyout's position.\n useEffect(() => {\n const rect = target?.current?.getBoundingClientRect();\n const { top = 0, left = 0, right = 0, bottom = 0, height = 0 } = rect ?? {};\n const flyoutHeight = 212;\n const flyoutTop = top - flyoutHeight - height - 24;\n setPosition({ top: flyoutTop > 0 ? flyoutTop : 0, left, right, bottom });\n }, [target]);\n\n const personaRenderer = (displayName?: string): JSX.Element => {\n const avatarOptions = {\n text: displayName?.trim() || localeStrings.displayNamePlaceholder,\n size: PersonaSize.size28,\n initialsColor: theme.palette.neutralLight,\n initialsTextColor: theme.palette.neutralSecondary,\n showOverflowTooltip: false,\n showUnknownPersonaCoin: !displayName?.trim() || displayName === localeStrings.displayNamePlaceholder\n };\n\n return <Persona {...avatarOptions} />;\n };\n\n const defaultOnRenderSuggestionItem = (suggestion: AtMentionSuggestion): JSX.Element => {\n const isSuggestionHovered = hoveredSuggestion?.userId === suggestion.userId;\n return (\n <div\n data-is-focusable={true}\n /* @conditional-compile-remove(at-mention) */\n data-ui-id={ids.atMentionSuggestionItem}\n key={suggestion.userId}\n onClick={() => onSuggestionSelected && onSuggestionSelected(suggestion)}\n onMouseEnter={() => setHoveredSuggestion(suggestion)}\n onMouseLeave={() => setHoveredSuggestion(undefined)}\n className={suggestionItemWrapperStyle(theme)}\n >\n <Stack horizontal className={suggestionItemStackStyle(theme, isSuggestionHovered)}>\n {personaRenderer(suggestion.displayName)}\n </Stack>\n </div>\n );\n };\n\n return (\n <Stack className={atMentionFlyoutContainer(theme, position.left, position.top)}>\n <Stack.Item styles={headerStyleThemed(theme)} aria-label={title}>\n {title} {/* TODO: Localization */}\n </Stack.Item>\n <FocusZone className={suggestionListContainerStyle} shouldFocusOnMount={true}>\n <Stack\n /* @conditional-compile-remove(at-mention) */\n data-ui-id={ids.atMentionSuggestionList}\n className={suggestionListStyle}\n >\n {suggestions.map((suggestion) =>\n onRenderSuggestionItem\n ? onRenderSuggestionItem(suggestion, onSuggestionSelected)\n : defaultOnRenderSuggestionItem(suggestion)\n )}\n </Stack>\n </FocusZone>\n </Stack>\n );\n};\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"AtMentionFlyout.style.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/AtMentionFlyout.style.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAgB,WAAW,EAAS,MAAM,iBAAiB,CAAC;AAEnE;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAAY,EAAE,IAAY,EAAE,GAAW,EAAU,EAAE,CAC1F,WAAW,CAAC;IACV,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,UAAU;IAClB,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,IAAI;IACV,GAAG,EAAE,GAAG;IACR,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,WAAW;IACpC,UAAU,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc;IAC/C,6DAA6D;IAC7D,MAAM,EAAE,qBAAqB,GAAG,CAAC;CAClC,CAAC,CAAC;AAEL;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAY,EAAgB,EAAE;IAC9D,OAAO;QACL,IAAI,EAAE;YACJ,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,gBAAgB;YACrC,MAAM,EAAE,qBAAqB;YAC7B,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ;SACzC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,WAAW,CAAC;IACtD,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,QAAQ;CACpB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,WAAW,CAAC;IAC7C,OAAO,EAAE,gBAAgB;CAC1B,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,KAAY,EAAU,EAAE;IACjE,OAAO,WAAW,CAAC;QACjB,MAAM,EAAE,gBAAgB;QACxB,iBAAiB,EAAE;YACjB,OAAO,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,eAAe;SAC/C;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAAY,EAAE,mBAA4B,EAAU,EAAE;IAC7F,OAAO,WAAW,CAAC;QACjB,KAAK,EAAE,OAAO;QACd,UAAU,EAAE,QAAQ;QACpB,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,WAAW;QACpB,UAAU,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK;KACnF,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { IStackStyles, mergeStyles, Theme } from '@fluentui/react';\n\n/**\n * @private\n * z-index to ensure that chat container has lower z-index than at mention flyout\n */\nexport const CHAT_CONTAINER_ZINDEX = 1;\n\n/**\n * @private\n */\nexport const atMentionFlyoutContainer = (theme: Theme, left: number, top: number): string =>\n mergeStyles({\n width: '10rem',\n height: '13.25rem',\n position: 'absolute',\n left: left,\n top: top,\n boxShadow: theme.effects.elevation16,\n background: theme.semanticColors.bodyBackground,\n // zIndex to set the atMentionFlyout above the chat container\n zIndex: CHAT_CONTAINER_ZINDEX + 1\n });\n\n/**\n * @private\n */\nexport const headerStyleThemed = (theme: Theme): IStackStyles => {\n return {\n root: {\n color: theme.palette.neutralSecondary,\n margin: '0.5rem 1rem 0.25rem',\n fontSize: theme.fonts.smallPlus.fontSize\n }\n };\n};\n\n/**\n * @private\n */\nexport const suggestionListContainerStyle = mergeStyles({\n height: '100%',\n overflowY: 'auto',\n overflowX: 'hidden'\n});\n\n/**\n * @private\n */\nexport const suggestionListStyle = mergeStyles({\n padding: '0.25rem 0rem 0'\n});\n\n/**\n * @private\n */\nexport const suggestionItemWrapperStyle = (theme: Theme): string => {\n return mergeStyles({\n margin: '0.05rem 0.1rem',\n '&:focus-visible': {\n outline: `${theme.palette.black} solid 0.1rem`\n }\n });\n};\n\n/**\n * @private\n */\nexport const suggestionItemStackStyle = (theme: Theme, isSuggestionHovered: boolean): string => {\n return mergeStyles({\n width: '10rem',\n alignItems: 'center',\n height: '36px',\n padding: '0 0.75rem',\n background: isSuggestionHovered ? theme.palette.neutralLight : theme.palette.white\n });\n};\n"]}