@fluentui-copilot/react-attachments 0.0.0-nightly-20251010-0406-7df7c6d1.1 → 0.0.0-nightly-20251013-0406-7c7739c8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +3 -3
- package/CHANGELOG.md +4 -4
- package/dist/index.d.ts +379 -0
- package/lib/AgentTag.js +1 -0
- package/lib/AgentTag.js.map +1 -0
- package/lib/Attachment.js +1 -0
- package/lib/Attachment.js.map +1 -0
- package/lib/AttachmentList.js +1 -0
- package/lib/AttachmentList.js.map +1 -0
- package/lib/AttachmentOverflowMenu.js +1 -0
- package/lib/AttachmentOverflowMenu.js.map +1 -0
- package/lib/AttachmentOverflowMenuButton.js +1 -0
- package/lib/AttachmentOverflowMenuButton.js.map +1 -0
- package/lib/AttachmentOverflowMenuItem.js +1 -0
- package/lib/AttachmentOverflowMenuItem.js.map +1 -0
- package/lib/components/AgentTag/AgentTag.js +11 -0
- package/lib/components/AgentTag/AgentTag.js.map +1 -0
- package/lib/components/AgentTag/AgentTag.types.js +3 -0
- package/lib/components/AgentTag/AgentTag.types.js.map +1 -0
- package/lib/components/AgentTag/index.js +4 -0
- package/lib/components/AgentTag/index.js.map +1 -0
- package/lib/components/AgentTag/renderAgentTag.js +6 -0
- package/lib/components/AgentTag/renderAgentTag.js.map +1 -0
- package/lib/components/AgentTag/useAgentTag.js +18 -0
- package/lib/components/AgentTag/useAgentTag.js.map +1 -0
- package/lib/components/AgentTag/useAgentTagStyles.styles.js +95 -0
- package/lib/components/AgentTag/useAgentTagStyles.styles.js.map +1 -0
- package/lib/components/AgentTag/useAgentTagStyles.styles.raw.js +66 -0
- package/lib/components/AgentTag/useAgentTagStyles.styles.raw.js.map +1 -0
- package/lib/components/Attachment/Attachment.js +13 -0
- package/lib/components/Attachment/Attachment.js.map +1 -0
- package/lib/components/Attachment/Attachment.types.js +3 -0
- package/lib/components/Attachment/Attachment.types.js.map +1 -0
- package/lib/components/Attachment/index.js +4 -0
- package/lib/components/Attachment/index.js.map +1 -0
- package/lib/components/Attachment/renderAttachment.js +42 -0
- package/lib/components/Attachment/renderAttachment.js.map +1 -0
- package/lib/components/Attachment/useAttachment.js +103 -0
- package/lib/components/Attachment/useAttachment.js.map +1 -0
- package/lib/components/Attachment/useAttachmentStyles.styles.js +348 -0
- package/lib/components/Attachment/useAttachmentStyles.styles.js.map +1 -0
- package/lib/components/Attachment/useAttachmentStyles.styles.raw.js +328 -0
- package/lib/components/Attachment/useAttachmentStyles.styles.raw.js.map +1 -0
- package/lib/components/AttachmentList/AttachmentList.js +14 -0
- package/lib/components/AttachmentList/AttachmentList.js.map +1 -0
- package/lib/components/AttachmentList/AttachmentList.types.js +1 -0
- package/lib/components/AttachmentList/AttachmentList.types.js.map +1 -0
- package/lib/components/AttachmentList/index.js +4 -0
- package/lib/components/AttachmentList/index.js.map +1 -0
- package/lib/components/AttachmentList/renderAttachmentList.js +31 -0
- package/lib/components/AttachmentList/renderAttachmentList.js.map +1 -0
- package/lib/components/AttachmentList/useAttachmentList.js +134 -0
- package/lib/components/AttachmentList/useAttachmentList.js.map +1 -0
- package/lib/components/AttachmentList/useAttachmentListContextValues.js +12 -0
- package/lib/components/AttachmentList/useAttachmentListContextValues.js.map +1 -0
- package/lib/components/AttachmentList/useAttachmentListStyles.styles.js +48 -0
- package/lib/components/AttachmentList/useAttachmentListStyles.styles.js.map +1 -0
- package/lib/components/AttachmentList/useAttachmentListStyles.styles.raw.js +44 -0
- package/lib/components/AttachmentList/useAttachmentListStyles.styles.raw.js.map +1 -0
- package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js +14 -0
- package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js.map +1 -0
- package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js +1 -0
- package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js.map +1 -0
- package/lib/components/AttachmentOverflowMenu/index.js +4 -0
- package/lib/components/AttachmentOverflowMenu/index.js.map +1 -0
- package/lib/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js +13 -0
- package/lib/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js.map +1 -0
- package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js +18 -0
- package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js.map +1 -0
- package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js +12 -0
- package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js +12 -0
- package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js +3 -0
- package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuButton/index.js +4 -0
- package/lib/components/AttachmentOverflowMenuButton/index.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js +15 -0
- package/lib/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +69 -0
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js +116 -0
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.raw.js +102 -0
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.raw.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js +10 -0
- package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js +3 -0
- package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuItem/index.js +4 -0
- package/lib/components/AttachmentOverflowMenuItem/index.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js +13 -0
- package/lib/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +56 -0
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.js +84 -0
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.js.map +1 -0
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js +59 -0
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js.map +1 -0
- package/lib/components/index.js +5 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/utils/useProgressBarStyles.styles.js +54 -0
- package/lib/components/utils/useProgressBarStyles.styles.js.map +1 -0
- package/lib/components/utils/useProgressBarStyles.styles.raw.js +42 -0
- package/lib/components/utils/useProgressBarStyles.styles.raw.js.map +1 -0
- package/lib/contexts/attachmentListContext.js +9 -0
- package/lib/contexts/attachmentListContext.js.map +1 -0
- package/lib/contexts/attachmentOverflowMenuContext.js +9 -0
- package/lib/contexts/attachmentOverflowMenuContext.js.map +1 -0
- package/lib/index.js +8 -0
- package/lib/index.js.map +1 -0
- package/lib-commonjs/AgentTag.js +28 -0
- package/lib-commonjs/AgentTag.js.map +1 -0
- package/lib-commonjs/Attachment.js +31 -0
- package/lib-commonjs/Attachment.js.map +1 -0
- package/lib-commonjs/AttachmentList.js +28 -0
- package/lib-commonjs/AttachmentList.js.map +1 -0
- package/lib-commonjs/AttachmentOverflowMenu.js +25 -0
- package/lib-commonjs/AttachmentOverflowMenu.js.map +1 -0
- package/lib-commonjs/AttachmentOverflowMenuButton.js +28 -0
- package/lib-commonjs/AttachmentOverflowMenuButton.js.map +1 -0
- package/lib-commonjs/AttachmentOverflowMenuItem.js +28 -0
- package/lib-commonjs/AttachmentOverflowMenuItem.js.map +1 -0
- package/lib-commonjs/components/AgentTag/AgentTag.js +21 -0
- package/lib-commonjs/components/AgentTag/AgentTag.js.map +1 -0
- package/lib-commonjs/components/AgentTag/AgentTag.types.js +6 -0
- package/lib-commonjs/components/AgentTag/AgentTag.types.js.map +1 -0
- package/lib-commonjs/components/AgentTag/index.js +31 -0
- package/lib-commonjs/components/AgentTag/index.js.map +1 -0
- package/lib-commonjs/components/AgentTag/renderAgentTag.js +14 -0
- package/lib-commonjs/components/AgentTag/renderAgentTag.js.map +1 -0
- package/lib-commonjs/components/AgentTag/useAgentTag.js +19 -0
- package/lib-commonjs/components/AgentTag/useAgentTag.js.map +1 -0
- package/lib-commonjs/components/AgentTag/useAgentTagStyles.styles.js +145 -0
- package/lib-commonjs/components/AgentTag/useAgentTagStyles.styles.js.map +1 -0
- package/lib-commonjs/components/AgentTag/useAgentTagStyles.styles.raw.js +82 -0
- package/lib-commonjs/components/AgentTag/useAgentTagStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/Attachment/Attachment.js +23 -0
- package/lib-commonjs/components/Attachment/Attachment.js.map +1 -0
- package/lib-commonjs/components/Attachment/Attachment.types.js +6 -0
- package/lib-commonjs/components/Attachment/Attachment.types.js.map +1 -0
- package/lib-commonjs/components/Attachment/index.js +34 -0
- package/lib-commonjs/components/Attachment/index.js.map +1 -0
- package/lib-commonjs/components/Attachment/renderAttachment.js +50 -0
- package/lib-commonjs/components/Attachment/renderAttachment.js.map +1 -0
- package/lib-commonjs/components/Attachment/useAttachment.js +105 -0
- package/lib-commonjs/components/Attachment/useAttachment.js.map +1 -0
- package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.js +550 -0
- package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.js.map +1 -0
- package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.raw.js +347 -0
- package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/AttachmentList.js +25 -0
- package/lib-commonjs/components/AttachmentList/AttachmentList.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/AttachmentList.types.js +4 -0
- package/lib-commonjs/components/AttachmentList/AttachmentList.types.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/index.js +31 -0
- package/lib-commonjs/components/AttachmentList/index.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/renderAttachmentList.js +39 -0
- package/lib-commonjs/components/AttachmentList/renderAttachmentList.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentList.js +137 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentList.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js +22 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.styles.js +67 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.styles.js.map +1 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.styles.raw.js +60 -0
- package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js +24 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js +4 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/index.js +28 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/index.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js +21 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js +21 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js +22 -0
- package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js +23 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js +6 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/index.js +31 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/index.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js +23 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +72 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js +178 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.raw.js +118 -0
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js +21 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js +6 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/index.js +31 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/index.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js +21 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +59 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.js +109 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.js.map +1 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js +75 -0
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/index.js +92 -0
- package/lib-commonjs/components/index.js.map +1 -0
- package/lib-commonjs/components/utils/useProgressBarStyles.styles.js +103 -0
- package/lib-commonjs/components/utils/useProgressBarStyles.styles.js.map +1 -0
- package/lib-commonjs/components/utils/useProgressBarStyles.styles.raw.js +50 -0
- package/lib-commonjs/components/utils/useProgressBarStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/contexts/attachmentListContext.js +30 -0
- package/lib-commonjs/contexts/attachmentListContext.js.map +1 -0
- package/lib-commonjs/contexts/attachmentOverflowMenuContext.js +30 -0
- package/lib-commonjs/contexts/attachmentOverflowMenuContext.js.map +1 -0
- package/lib-commonjs/index.js +122 -0
- package/lib-commonjs/index.js.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { MenuList, MenuPopover, getIntrinsicElementProps, slot, useArrowNavigationGroup, useEventCallback, useFocusFinders, useMergedRefs } from '@fluentui/react-components';
|
|
3
|
+
import { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';
|
|
4
|
+
import { useTimeout } from '@fluentui/react-utilities';
|
|
5
|
+
import { useOverflowMaxVisibleItems } from '@fluentui-copilot/react-utilities';
|
|
6
|
+
import { useOverflowStyles } from '../Attachment';
|
|
7
|
+
import { AttachmentOverflowMenuButton } from '../AttachmentOverflowMenuButton';
|
|
8
|
+
import { attachmentOverflowMenuButtonClassNames } from '../AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles';
|
|
9
|
+
import { AttachmentOverflowMenuItem } from '../AttachmentOverflowMenuItem';
|
|
10
|
+
import { useDesignVersion } from '@fluentui-copilot/react-provider';
|
|
11
|
+
/**
|
|
12
|
+
* Create the state required to render AttachmentList.
|
|
13
|
+
*
|
|
14
|
+
* The returned state can be modified with hooks such as useAttachmentListStyles_unstable,
|
|
15
|
+
* before being passed to renderAttachmentList_unstable.
|
|
16
|
+
*
|
|
17
|
+
* @param props - props from this instance of AttachmentList
|
|
18
|
+
* @param ref - reference to root HTMLElement of AttachmentList
|
|
19
|
+
*/ export const useAttachmentList_unstable = (props, ref)=>{
|
|
20
|
+
const { children, maxVisibleAttachments, onAttachmentDismiss, overflowMenuProps } = props;
|
|
21
|
+
const innerRef = React.useRef(null);
|
|
22
|
+
const [setTimeout] = useTimeout();
|
|
23
|
+
const { targetDocument } = useFluent();
|
|
24
|
+
const designVersion = useDesignVersion(props.designVersion);
|
|
25
|
+
const { findNextFocusable, findPrevFocusable, findLastFocusable } = useFocusFinders();
|
|
26
|
+
const handleAttachmentDismiss = useEventCallback((e, data)=>{
|
|
27
|
+
var _innerRef_current;
|
|
28
|
+
if (!onAttachmentDismiss) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
onAttachmentDismiss(e, data);
|
|
32
|
+
// set focus after attachment dismiss
|
|
33
|
+
const activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;
|
|
34
|
+
if ((_innerRef_current = innerRef.current) === null || _innerRef_current === void 0 ? void 0 : _innerRef_current.contains(activeElement)) {
|
|
35
|
+
// focus on next attachment only if the active element is within the current attachment list
|
|
36
|
+
const next = findNextFocusable(activeElement, {
|
|
37
|
+
container: innerRef.current
|
|
38
|
+
});
|
|
39
|
+
if (next) {
|
|
40
|
+
// focus on the overflow button if the next focusable element is the overflow button.
|
|
41
|
+
// if overflow button is removed from the DOM, focus on the last focusable element in the attachment list.
|
|
42
|
+
if (next.classList.contains(attachmentOverflowMenuButtonClassNames.root)) {
|
|
43
|
+
setTimeout(()=>{
|
|
44
|
+
var _findLastFocusable;
|
|
45
|
+
(_findLastFocusable = findLastFocusable(innerRef.current)) === null || _findLastFocusable === void 0 ? void 0 : _findLastFocusable.focus();
|
|
46
|
+
}, 0);
|
|
47
|
+
} else {
|
|
48
|
+
next.focus();
|
|
49
|
+
}
|
|
50
|
+
} else {
|
|
51
|
+
const prev = findPrevFocusable(activeElement === null || activeElement === void 0 ? void 0 : activeElement.parentElement, {
|
|
52
|
+
container: innerRef.current
|
|
53
|
+
});
|
|
54
|
+
prev === null || prev === void 0 ? void 0 : prev.focus();
|
|
55
|
+
}
|
|
56
|
+
} else {
|
|
57
|
+
// Handles keyboard focus when attachment removed is in the overflow menu. Also handles focus when the overflow button is removed from the DOM.
|
|
58
|
+
setTimeout(()=>{
|
|
59
|
+
var _findLastFocusable;
|
|
60
|
+
(_findLastFocusable = findLastFocusable(innerRef.current)) === null || _findLastFocusable === void 0 ? void 0 : _findLastFocusable.focus();
|
|
61
|
+
}, 0);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
const styles = useOverflowStyles();
|
|
65
|
+
const resolvedChildren = useOverflowMaxVisibleItems({
|
|
66
|
+
children,
|
|
67
|
+
maxVisibleItems: maxVisibleAttachments,
|
|
68
|
+
overflowClassName: styles.overflow
|
|
69
|
+
});
|
|
70
|
+
const attachmentOverflowMenuItems = React.useMemo(()=>{
|
|
71
|
+
if (resolvedChildren && Array.isArray(resolvedChildren)) {
|
|
72
|
+
return resolvedChildren.filter((child)=>/*#__PURE__*/ React.isValidElement(child)).map((child)=>child.props).map((attachment)=>{
|
|
73
|
+
const dismissButton = slot.optional(attachment.dismissButton, {
|
|
74
|
+
elementType: 'button'
|
|
75
|
+
});
|
|
76
|
+
return /*#__PURE__*/ React.createElement(AttachmentOverflowMenuItem, {
|
|
77
|
+
...attachment,
|
|
78
|
+
key: attachment.id,
|
|
79
|
+
onClick: dismissButton === null || dismissButton === void 0 ? void 0 : dismissButton.onClick
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return [];
|
|
84
|
+
}, [
|
|
85
|
+
resolvedChildren
|
|
86
|
+
]);
|
|
87
|
+
const arrowNavigationProps = useArrowNavigationGroup({
|
|
88
|
+
circular: true,
|
|
89
|
+
axis: 'both',
|
|
90
|
+
memorizeCurrent: true
|
|
91
|
+
});
|
|
92
|
+
const shouldUseOverflow = maxVisibleAttachments !== undefined;
|
|
93
|
+
return {
|
|
94
|
+
designVersion,
|
|
95
|
+
onAttachmentDismiss: handleAttachmentDismiss,
|
|
96
|
+
shouldUseOverflow,
|
|
97
|
+
numberOfAttachments: resolvedChildren.length,
|
|
98
|
+
overflowMenuProps,
|
|
99
|
+
components: {
|
|
100
|
+
root: 'div',
|
|
101
|
+
menuList: MenuList,
|
|
102
|
+
menuPopover: MenuPopover,
|
|
103
|
+
overflowMenuButton: 'span'
|
|
104
|
+
},
|
|
105
|
+
root: slot.always(getIntrinsicElementProps('div', {
|
|
106
|
+
'aria-label': 'Attachments',
|
|
107
|
+
ref: useMergedRefs(ref, innerRef),
|
|
108
|
+
role: 'toolbar',
|
|
109
|
+
...arrowNavigationProps,
|
|
110
|
+
...props,
|
|
111
|
+
children: resolvedChildren
|
|
112
|
+
}), {
|
|
113
|
+
elementType: 'div'
|
|
114
|
+
}),
|
|
115
|
+
menuList: slot.optional(props.menuList, {
|
|
116
|
+
defaultProps: {
|
|
117
|
+
children: attachmentOverflowMenuItems
|
|
118
|
+
},
|
|
119
|
+
elementType: MenuList,
|
|
120
|
+
renderByDefault: true
|
|
121
|
+
}),
|
|
122
|
+
menuPopover: slot.optional(props.menuPopover, {
|
|
123
|
+
elementType: MenuPopover,
|
|
124
|
+
renderByDefault: true
|
|
125
|
+
}),
|
|
126
|
+
overflowMenuButton: slot.optional(props.overflowMenuButton, {
|
|
127
|
+
defaultProps: {
|
|
128
|
+
children: /*#__PURE__*/ React.createElement(AttachmentOverflowMenuButton, null)
|
|
129
|
+
},
|
|
130
|
+
elementType: 'span',
|
|
131
|
+
renderByDefault: true
|
|
132
|
+
})
|
|
133
|
+
};
|
|
134
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentList.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n MenuList,\n MenuPopover,\n getIntrinsicElementProps,\n slot,\n useArrowNavigationGroup,\n useEventCallback,\n useFocusFinders,\n useMergedRefs,\n} from '@fluentui/react-components';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useTimeout } from '@fluentui/react-utilities';\nimport { useOverflowMaxVisibleItems } from '@fluentui-copilot/react-utilities';\nimport { useOverflowStyles } from '../Attachment';\nimport { AttachmentOverflowMenuButton } from '../AttachmentOverflowMenuButton';\nimport { attachmentOverflowMenuButtonClassNames } from '../AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles';\nimport { AttachmentOverflowMenuItem } from '../AttachmentOverflowMenuItem';\nimport { useDesignVersion } from '@fluentui-copilot/react-provider';\nimport type { AttachmentListProps, AttachmentListState } from './AttachmentList.types';\nimport type { AttachmentProps } from '../Attachment/Attachment.types';\n\n/**\n * Create the state required to render AttachmentList.\n *\n * The returned state can be modified with hooks such as useAttachmentListStyles_unstable,\n * before being passed to renderAttachmentList_unstable.\n *\n * @param props - props from this instance of AttachmentList\n * @param ref - reference to root HTMLElement of AttachmentList\n */\nexport const useAttachmentList_unstable = (\n props: AttachmentListProps,\n ref: React.Ref<HTMLDivElement>,\n): AttachmentListState => {\n const { children, maxVisibleAttachments, onAttachmentDismiss, overflowMenuProps } = props;\n const innerRef = React.useRef<HTMLDivElement>(null);\n const [setTimeout] = useTimeout();\n const { targetDocument } = useFluent();\n\n const designVersion = useDesignVersion(props.designVersion);\n const { findNextFocusable, findPrevFocusable, findLastFocusable } = useFocusFinders();\n const handleAttachmentDismiss: AttachmentListState['onAttachmentDismiss'] = useEventCallback((e, data) => {\n if (!onAttachmentDismiss) {\n return;\n }\n\n onAttachmentDismiss(e, data);\n\n // set focus after attachment dismiss\n const activeElement = targetDocument?.activeElement;\n if (innerRef.current?.contains(activeElement as HTMLElement)) {\n // focus on next attachment only if the active element is within the current attachment list\n const next = findNextFocusable(activeElement as HTMLElement, { container: innerRef.current });\n if (next) {\n // focus on the overflow button if the next focusable element is the overflow button.\n // if overflow button is removed from the DOM, focus on the last focusable element in the attachment list.\n if (next.classList.contains(attachmentOverflowMenuButtonClassNames.root)) {\n setTimeout(() => {\n findLastFocusable(innerRef.current as HTMLElement)?.focus();\n }, 0);\n } else {\n next.focus();\n }\n } else {\n const prev = findPrevFocusable(activeElement?.parentElement as HTMLElement, { container: innerRef.current });\n prev?.focus();\n }\n } else {\n // Handles keyboard focus when attachment removed is in the overflow menu. Also handles focus when the overflow button is removed from the DOM.\n setTimeout(() => {\n findLastFocusable(innerRef.current as HTMLElement)?.focus();\n }, 0);\n }\n });\n\n const styles = useOverflowStyles();\n const resolvedChildren = useOverflowMaxVisibleItems({\n children,\n maxVisibleItems: maxVisibleAttachments,\n overflowClassName: styles.overflow,\n });\n\n const attachmentOverflowMenuItems = React.useMemo(() => {\n if (resolvedChildren && Array.isArray(resolvedChildren)) {\n return resolvedChildren\n .filter(child => React.isValidElement(child))\n .map(child => (child as React.ReactElement<AttachmentProps>).props)\n .map(attachment => {\n const dismissButton = slot.optional(attachment.dismissButton, { elementType: 'button' });\n return (\n <AttachmentOverflowMenuItem\n {...attachment}\n key={attachment.id}\n onClick={dismissButton?.onClick as AttachmentProps['onClick']}\n />\n );\n });\n }\n return [];\n }, [resolvedChildren]);\n\n const arrowNavigationProps = useArrowNavigationGroup({\n circular: true,\n axis: 'both',\n memorizeCurrent: true,\n });\n\n const shouldUseOverflow = maxVisibleAttachments !== undefined;\n\n return {\n designVersion,\n onAttachmentDismiss: handleAttachmentDismiss,\n shouldUseOverflow,\n numberOfAttachments: resolvedChildren.length,\n overflowMenuProps,\n components: {\n root: 'div',\n menuList: MenuList,\n menuPopover: MenuPopover,\n overflowMenuButton: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n 'aria-label': 'Attachments',\n ref: useMergedRefs(ref, innerRef),\n role: 'toolbar',\n ...arrowNavigationProps,\n ...props,\n children: resolvedChildren,\n }),\n { elementType: 'div' },\n ),\n menuList: slot.optional(props.menuList, {\n defaultProps: { children: attachmentOverflowMenuItems },\n elementType: MenuList,\n renderByDefault: true,\n }),\n menuPopover: slot.optional(props.menuPopover, { elementType: MenuPopover, renderByDefault: true }),\n overflowMenuButton: slot.optional(props.overflowMenuButton, {\n defaultProps: { children: <AttachmentOverflowMenuButton /> },\n elementType: 'span',\n renderByDefault: true,\n }),\n };\n};\n"],"names":["React","MenuList","MenuPopover","getIntrinsicElementProps","slot","useArrowNavigationGroup","useEventCallback","useFocusFinders","useMergedRefs","useFluent_unstable","useFluent","useTimeout","useOverflowMaxVisibleItems","useOverflowStyles","AttachmentOverflowMenuButton","attachmentOverflowMenuButtonClassNames","AttachmentOverflowMenuItem","useDesignVersion","useAttachmentList_unstable","props","ref","children","maxVisibleAttachments","onAttachmentDismiss","overflowMenuProps","innerRef","useRef","setTimeout","targetDocument","designVersion","findNextFocusable","findPrevFocusable","findLastFocusable","handleAttachmentDismiss","e","data","activeElement","current","contains","next","container","classList","root","focus","prev","parentElement","styles","resolvedChildren","maxVisibleItems","overflowClassName","overflow","attachmentOverflowMenuItems","useMemo","Array","isArray","filter","child","isValidElement","map","attachment","dismissButton","optional","elementType","key","id","onClick","arrowNavigationProps","circular","axis","memorizeCurrent","shouldUseOverflow","undefined","numberOfAttachments","length","components","menuList","menuPopover","overflowMenuButton","always","role","defaultProps","renderByDefault"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,QAAQ,EACRC,WAAW,EACXC,wBAAwB,EACxBC,IAAI,EACJC,uBAAuB,EACvBC,gBAAgB,EAChBC,eAAe,EACfC,aAAa,QACR,6BAA6B;AACpC,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,UAAU,QAAQ,4BAA4B;AACvD,SAASC,0BAA0B,QAAQ,oCAAoC;AAC/E,SAASC,iBAAiB,QAAQ,gBAAgB;AAClD,SAASC,4BAA4B,QAAQ,kCAAkC;AAC/E,SAASC,sCAAsC,QAAQ,+EAA+E;AACtI,SAASC,0BAA0B,QAAQ,gCAAgC;AAC3E,SAASC,gBAAgB,QAAQ,mCAAmC;AAIpE;;;;;;;;CAQC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEA,MAAM,EAAEC,QAAQ,EAAEC,qBAAqB,EAAEC,mBAAmB,EAAEC,iBAAiB,EAAE,GAAGL;IACpF,MAAMM,WAAWzB,MAAM0B,MAAM,CAAiB;IAC9C,MAAM,CAACC,WAAW,GAAGhB;IACrB,MAAM,EAAEiB,cAAc,EAAE,GAAGlB;IAE3B,MAAMmB,gBAAgBZ,iBAAiBE,MAAMU,aAAa;IAC1D,MAAM,EAAEC,iBAAiB,EAAEC,iBAAiB,EAAEC,iBAAiB,EAAE,GAAGzB;IACpE,MAAM0B,0BAAsE3B,iBAAiB,CAAC4B,GAAGC;YAS3FV;QARJ,IAAI,CAACF,qBAAqB;YACxB;QACF;QAEAA,oBAAoBW,GAAGC;QAEvB,qCAAqC;QACrC,MAAMC,gBAAgBR,2BAAAA,qCAAAA,eAAgBQ,aAAa;QACnD,KAAIX,oBAAAA,SAASY,OAAO,cAAhBZ,wCAAAA,kBAAkBa,QAAQ,CAACF,gBAA+B;YAC5D,4FAA4F;YAC5F,MAAMG,OAAOT,kBAAkBM,eAA8B;gBAAEI,WAAWf,SAASY,OAAO;YAAC;YAC3F,IAAIE,MAAM;gBACR,qFAAqF;gBACrF,0GAA0G;gBAC1G,IAAIA,KAAKE,SAAS,CAACH,QAAQ,CAACvB,uCAAuC2B,IAAI,GAAG;oBACxEf,WAAW;4BACTK;yBAAAA,qBAAAA,kBAAkBP,SAASY,OAAO,eAAlCL,yCAAAA,mBAAoDW,KAAK;oBAC3D,GAAG;gBACL,OAAO;oBACLJ,KAAKI,KAAK;gBACZ;YACF,OAAO;gBACL,MAAMC,OAAOb,kBAAkBK,0BAAAA,oCAAAA,cAAeS,aAAa,EAAiB;oBAAEL,WAAWf,SAASY,OAAO;gBAAC;gBAC1GO,iBAAAA,2BAAAA,KAAMD,KAAK;YACb;QACF,OAAO;YACL,+IAA+I;YAC/IhB,WAAW;oBACTK;iBAAAA,qBAAAA,kBAAkBP,SAASY,OAAO,eAAlCL,yCAAAA,mBAAoDW,KAAK;YAC3D,GAAG;QACL;IACF;IAEA,MAAMG,SAASjC;IACf,MAAMkC,mBAAmBnC,2BAA2B;QAClDS;QACA2B,iBAAiB1B;QACjB2B,mBAAmBH,OAAOI,QAAQ;IACpC;IAEA,MAAMC,8BAA8BnD,MAAMoD,OAAO,CAAC;QAChD,IAAIL,oBAAoBM,MAAMC,OAAO,CAACP,mBAAmB;YACvD,OAAOA,iBACJQ,MAAM,CAACC,CAAAA,sBAASxD,MAAMyD,cAAc,CAACD,QACrCE,GAAG,CAACF,CAAAA,QAAS,AAACA,MAA8CrC,KAAK,EACjEuC,GAAG,CAACC,CAAAA;gBACH,MAAMC,gBAAgBxD,KAAKyD,QAAQ,CAACF,WAAWC,aAAa,EAAE;oBAAEE,aAAa;gBAAS;gBACtF,qBACE,oBAAC9C;oBACE,GAAG2C,UAAU;oBACdI,KAAKJ,WAAWK,EAAE;oBAClBC,OAAO,EAAEL,0BAAAA,oCAAAA,cAAeK,OAAO;;YAGrC;QACJ;QACA,OAAO,EAAE;IACX,GAAG;QAAClB;KAAiB;IAErB,MAAMmB,uBAAuB7D,wBAAwB;QACnD8D,UAAU;QACVC,MAAM;QACNC,iBAAiB;IACnB;IAEA,MAAMC,oBAAoBhD,0BAA0BiD;IAEpD,OAAO;QACL1C;QACAN,qBAAqBU;QACrBqC;QACAE,qBAAqBzB,iBAAiB0B,MAAM;QAC5CjD;QACAkD,YAAY;YACVhC,MAAM;YACNiC,UAAU1E;YACV2E,aAAa1E;YACb2E,oBAAoB;QACtB;QACAnC,MAAMtC,KAAK0E,MAAM,CACf3E,yBAAyB,OAAO;YAC9B,cAAc;YACdiB,KAAKZ,cAAcY,KAAKK;YACxBsD,MAAM;YACN,GAAGb,oBAAoB;YACvB,GAAG/C,KAAK;YACRE,UAAU0B;QACZ,IACA;YAAEe,aAAa;QAAM;QAEvBa,UAAUvE,KAAKyD,QAAQ,CAAC1C,MAAMwD,QAAQ,EAAE;YACtCK,cAAc;gBAAE3D,UAAU8B;YAA4B;YACtDW,aAAa7D;YACbgF,iBAAiB;QACnB;QACAL,aAAaxE,KAAKyD,QAAQ,CAAC1C,MAAMyD,WAAW,EAAE;YAAEd,aAAa5D;YAAa+E,iBAAiB;QAAK;QAChGJ,oBAAoBzE,KAAKyD,QAAQ,CAAC1C,MAAM0D,kBAAkB,EAAE;YAC1DG,cAAc;gBAAE3D,wBAAU,oBAACP;YAAgC;YAC3DgD,aAAa;YACbmB,iBAAiB;QACnB;IACF;AACF,EAAE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function useAttachmentListContextValues_unstable(state) {
|
|
2
|
+
const { numberOfAttachments, onAttachmentDismiss, shouldUseOverflow } = state;
|
|
3
|
+
// This context is created with "@fluentui/react-context-selector", there is no sense to memoize it
|
|
4
|
+
const attachmentList = {
|
|
5
|
+
numberOfAttachments,
|
|
6
|
+
onAttachmentDismiss,
|
|
7
|
+
shouldUseOverflow
|
|
8
|
+
};
|
|
9
|
+
return {
|
|
10
|
+
attachmentList
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentListContextValues.ts"],"sourcesContent":["import type { AttachmentListContextValues, AttachmentListState } from './AttachmentList.types';\n\nexport function useAttachmentListContextValues_unstable(state: AttachmentListState): AttachmentListContextValues {\n const { numberOfAttachments, onAttachmentDismiss, shouldUseOverflow } = state;\n\n // This context is created with \"@fluentui/react-context-selector\", there is no sense to memoize it\n const attachmentList = {\n numberOfAttachments,\n onAttachmentDismiss,\n shouldUseOverflow,\n };\n\n return { attachmentList };\n}\n"],"names":["useAttachmentListContextValues_unstable","state","numberOfAttachments","onAttachmentDismiss","shouldUseOverflow","attachmentList"],"rangeMappings":";;;;;;;;;;;","mappings":"AAEA,OAAO,SAASA,wCAAwCC,KAA0B;IAChF,MAAM,EAAEC,mBAAmB,EAAEC,mBAAmB,EAAEC,iBAAiB,EAAE,GAAGH;IAExE,mGAAmG;IACnG,MAAMI,iBAAiB;QACrBH;QACAC;QACAC;IACF;IAEA,OAAO;QAAEC;IAAe;AAC1B"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { __resetStyles, __styles, mergeClasses } from '@fluentui/react-components';
|
|
2
|
+
import { tokens } from '@fluentui-copilot/tokens';
|
|
3
|
+
export const attachmentListClassNames = {
|
|
4
|
+
root: 'fai-AttachmentList',
|
|
5
|
+
menuList: 'fai-AttachmentList__menuList',
|
|
6
|
+
menuPopover: 'fai-AttachmentList__menuPopover',
|
|
7
|
+
overflowMenuButton: 'fai-AttachmentList__overflowMenuButton'
|
|
8
|
+
};
|
|
9
|
+
const useRootBaseClassName = __resetStyles("r168fwfa", null, [".r168fwfa{column-gap:var(--spacingHorizontalSNudge);display:flex;flex-direction:row;flex-shrink:0;flex-wrap:wrap;row-gap:var(--spacingVerticalXS);}"]);
|
|
10
|
+
const useOverflowMenuButtonBaseClassName = __resetStyles("rvxcmzt", null, [".rvxcmzt{display:inline-flex;}"]);
|
|
11
|
+
const useOverflowMenuPopoverNextStyles = __styles({
|
|
12
|
+
borderRadius: {
|
|
13
|
+
Beyfa6y: 0,
|
|
14
|
+
Bbmb7ep: 0,
|
|
15
|
+
Btl43ni: 0,
|
|
16
|
+
B7oj6ja: 0,
|
|
17
|
+
Dimara: "f1pwvjsv"
|
|
18
|
+
}
|
|
19
|
+
}, {
|
|
20
|
+
d: [[".f1pwvjsv{border-radius:var(--borderRadius4XL);}", {
|
|
21
|
+
p: -1
|
|
22
|
+
}]]
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* Apply styling to the AttachmentList slots based on the state
|
|
26
|
+
*/
|
|
27
|
+
export const useAttachmentListStyles_unstable = state => {
|
|
28
|
+
'use no memo';
|
|
29
|
+
|
|
30
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
31
|
+
const overflowMenuButtonClassName = useOverflowMenuButtonBaseClassName();
|
|
32
|
+
const overflowMenuPopoverNextStyles = useOverflowMenuPopoverNextStyles();
|
|
33
|
+
const {
|
|
34
|
+
designVersion
|
|
35
|
+
} = state;
|
|
36
|
+
state.root.className = mergeClasses(attachmentListClassNames.root, rootBaseClassName, state.root.className);
|
|
37
|
+
if (state.menuList) {
|
|
38
|
+
state.menuList.className = mergeClasses(attachmentListClassNames.menuList, state.menuList.className);
|
|
39
|
+
}
|
|
40
|
+
if (state.menuPopover) {
|
|
41
|
+
state.menuPopover.className = mergeClasses(attachmentListClassNames.menuPopover, designVersion === 'next' && overflowMenuPopoverNextStyles.borderRadius, state.menuPopover.className);
|
|
42
|
+
}
|
|
43
|
+
if (state.overflowMenuButton) {
|
|
44
|
+
state.overflowMenuButton.className = mergeClasses(attachmentListClassNames.overflowMenuButton, overflowMenuButtonClassName, state.overflowMenuButton.className);
|
|
45
|
+
}
|
|
46
|
+
return state;
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=useAttachmentListStyles.styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentListStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport type { AttachmentListSlots, AttachmentListState } from './AttachmentList.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentListClassNames: SlotClassNames<AttachmentListSlots> = {\n root: 'fai-AttachmentList',\n menuList: 'fai-AttachmentList__menuList',\n menuPopover: 'fai-AttachmentList__menuPopover',\n overflowMenuButton: 'fai-AttachmentList__overflowMenuButton',\n};\n\nconst useRootBaseClassName = makeResetStyles({\n columnGap: tokens.spacingHorizontalSNudge,\n display: 'flex',\n flexDirection: 'row',\n flexShrink: 0,\n flexWrap: 'wrap',\n rowGap: tokens.spacingVerticalXS,\n});\n\nconst useOverflowMenuButtonBaseClassName = makeResetStyles({\n display: 'inline-flex',\n});\n\nconst useOverflowMenuPopoverNextStyles = makeStyles({\n borderRadius: {\n borderRadius: tokens.borderRadius4XL,\n },\n});\n\n/**\n * Apply styling to the AttachmentList slots based on the state\n */\nexport const useAttachmentListStyles_unstable = (state: AttachmentListState): AttachmentListState => {\n 'use no memo';\n\n const rootBaseClassName = useRootBaseClassName();\n const overflowMenuButtonClassName = useOverflowMenuButtonBaseClassName();\n const overflowMenuPopoverNextStyles = useOverflowMenuPopoverNextStyles();\n const { designVersion } = state;\n\n state.root.className = mergeClasses(attachmentListClassNames.root, rootBaseClassName, state.root.className);\n\n if (state.menuList) {\n state.menuList.className = mergeClasses(attachmentListClassNames.menuList, state.menuList.className);\n }\n if (state.menuPopover) {\n state.menuPopover.className = mergeClasses(\n attachmentListClassNames.menuPopover,\n designVersion === 'next' && overflowMenuPopoverNextStyles.borderRadius,\n state.menuPopover.className,\n );\n }\n\n if (state.overflowMenuButton) {\n state.overflowMenuButton.className = mergeClasses(\n attachmentListClassNames.overflowMenuButton,\n overflowMenuButtonClassName,\n state.overflowMenuButton.className,\n );\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","attachmentListClassNames","root","menuList","menuPopover","overflowMenuButton","useRootBaseClassName","columnGap","spacingHorizontalSNudge","display","flexDirection","flexShrink","flexWrap","rowGap","spacingVerticalXS","useOverflowMenuButtonBaseClassName","useOverflowMenuPopoverNextStyles","borderRadius","borderRadius4XL","useAttachmentListStyles_unstable","state","rootBaseClassName","overflowMenuButtonClassName","overflowMenuPopoverNextStyles","designVersion","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,6BAA6B;AACvF,SAASC,MAAM,QAAQ,2BAA2B;AAIlD,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;IACNC,UAAU;IACVC,aAAa;IACbC,oBAAoB;AACtB,EAAE;AAEF,MAAMC,uBAAuBT,gBAAgB;IAC3CU,WAAWP,OAAOQ,uBAAuB;IACzCC,SAAS;IACTC,eAAe;IACfC,YAAY;IACZC,UAAU;IACVC,QAAQb,OAAOc,iBAAiB;AAClC;AAEA,MAAMC,qCAAqClB,gBAAgB;IACzDY,SAAS;AACX;AAEA,MAAMO,mCAAmClB,WAAW;IAClDmB,cAAc;QACZA,cAAcjB,OAAOkB,eAAe;IACtC;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,mCAAmC,CAACC;IAC/C;IAEA,MAAMC,oBAAoBf;IAC1B,MAAMgB,8BAA8BP;IACpC,MAAMQ,gCAAgCP;IACtC,MAAM,EAAEQ,aAAa,EAAE,GAAGJ;IAE1BA,MAAMlB,IAAI,CAACuB,SAAS,GAAG1B,aAAaE,yBAAyBC,IAAI,EAAEmB,mBAAmBD,MAAMlB,IAAI,CAACuB,SAAS;IAE1G,IAAIL,MAAMjB,QAAQ,EAAE;QAClBiB,MAAMjB,QAAQ,CAACsB,SAAS,GAAG1B,aAAaE,yBAAyBE,QAAQ,EAAEiB,MAAMjB,QAAQ,CAACsB,SAAS;IACrG;IACA,IAAIL,MAAMhB,WAAW,EAAE;QACrBgB,MAAMhB,WAAW,CAACqB,SAAS,GAAG1B,aAC5BE,yBAAyBG,WAAW,EACpCoB,kBAAkB,UAAUD,8BAA8BN,YAAY,EACtEG,MAAMhB,WAAW,CAACqB,SAAS;IAE/B;IAEA,IAAIL,MAAMf,kBAAkB,EAAE;QAC5Be,MAAMf,kBAAkB,CAACoB,SAAS,GAAG1B,aACnCE,yBAAyBI,kBAAkB,EAC3CiB,6BACAF,MAAMf,kBAAkB,CAACoB,SAAS;IAEtC;IAEA,OAAOL;AACT,EAAE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { makeResetStyles, makeStyles, mergeClasses } from '@fluentui/react-components';
|
|
2
|
+
import { tokens } from '@fluentui-copilot/tokens';
|
|
3
|
+
export const attachmentListClassNames = {
|
|
4
|
+
root: 'fai-AttachmentList',
|
|
5
|
+
menuList: 'fai-AttachmentList__menuList',
|
|
6
|
+
menuPopover: 'fai-AttachmentList__menuPopover',
|
|
7
|
+
overflowMenuButton: 'fai-AttachmentList__overflowMenuButton'
|
|
8
|
+
};
|
|
9
|
+
const useRootBaseClassName = makeResetStyles({
|
|
10
|
+
columnGap: tokens.spacingHorizontalSNudge,
|
|
11
|
+
display: 'flex',
|
|
12
|
+
flexDirection: 'row',
|
|
13
|
+
flexShrink: 0,
|
|
14
|
+
flexWrap: 'wrap',
|
|
15
|
+
rowGap: tokens.spacingVerticalXS
|
|
16
|
+
});
|
|
17
|
+
const useOverflowMenuButtonBaseClassName = makeResetStyles({
|
|
18
|
+
display: 'inline-flex'
|
|
19
|
+
});
|
|
20
|
+
const useOverflowMenuPopoverNextStyles = makeStyles({
|
|
21
|
+
borderRadius: {
|
|
22
|
+
borderRadius: tokens.borderRadius4XL
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
/**
|
|
26
|
+
* Apply styling to the AttachmentList slots based on the state
|
|
27
|
+
*/ export const useAttachmentListStyles_unstable = (state)=>{
|
|
28
|
+
'use no memo';
|
|
29
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
30
|
+
const overflowMenuButtonClassName = useOverflowMenuButtonBaseClassName();
|
|
31
|
+
const overflowMenuPopoverNextStyles = useOverflowMenuPopoverNextStyles();
|
|
32
|
+
const { designVersion } = state;
|
|
33
|
+
state.root.className = mergeClasses(attachmentListClassNames.root, rootBaseClassName, state.root.className);
|
|
34
|
+
if (state.menuList) {
|
|
35
|
+
state.menuList.className = mergeClasses(attachmentListClassNames.menuList, state.menuList.className);
|
|
36
|
+
}
|
|
37
|
+
if (state.menuPopover) {
|
|
38
|
+
state.menuPopover.className = mergeClasses(attachmentListClassNames.menuPopover, designVersion === 'next' && overflowMenuPopoverNextStyles.borderRadius, state.menuPopover.className);
|
|
39
|
+
}
|
|
40
|
+
if (state.overflowMenuButton) {
|
|
41
|
+
state.overflowMenuButton.className = mergeClasses(attachmentListClassNames.overflowMenuButton, overflowMenuButtonClassName, state.overflowMenuButton.className);
|
|
42
|
+
}
|
|
43
|
+
return state;
|
|
44
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentListStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport type { AttachmentListSlots, AttachmentListState } from './AttachmentList.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const attachmentListClassNames: SlotClassNames<AttachmentListSlots> = {\n root: 'fai-AttachmentList',\n menuList: 'fai-AttachmentList__menuList',\n menuPopover: 'fai-AttachmentList__menuPopover',\n overflowMenuButton: 'fai-AttachmentList__overflowMenuButton',\n};\n\nconst useRootBaseClassName = makeResetStyles({\n columnGap: tokens.spacingHorizontalSNudge,\n display: 'flex',\n flexDirection: 'row',\n flexShrink: 0,\n flexWrap: 'wrap',\n rowGap: tokens.spacingVerticalXS,\n});\n\nconst useOverflowMenuButtonBaseClassName = makeResetStyles({\n display: 'inline-flex',\n});\n\nconst useOverflowMenuPopoverNextStyles = makeStyles({\n borderRadius: {\n borderRadius: tokens.borderRadius4XL,\n },\n});\n\n/**\n * Apply styling to the AttachmentList slots based on the state\n */\nexport const useAttachmentListStyles_unstable = (state: AttachmentListState): AttachmentListState => {\n 'use no memo';\n\n const rootBaseClassName = useRootBaseClassName();\n const overflowMenuButtonClassName = useOverflowMenuButtonBaseClassName();\n const overflowMenuPopoverNextStyles = useOverflowMenuPopoverNextStyles();\n const { designVersion } = state;\n\n state.root.className = mergeClasses(attachmentListClassNames.root, rootBaseClassName, state.root.className);\n\n if (state.menuList) {\n state.menuList.className = mergeClasses(attachmentListClassNames.menuList, state.menuList.className);\n }\n if (state.menuPopover) {\n state.menuPopover.className = mergeClasses(\n attachmentListClassNames.menuPopover,\n designVersion === 'next' && overflowMenuPopoverNextStyles.borderRadius,\n state.menuPopover.className,\n );\n }\n\n if (state.overflowMenuButton) {\n state.overflowMenuButton.className = mergeClasses(\n attachmentListClassNames.overflowMenuButton,\n overflowMenuButtonClassName,\n state.overflowMenuButton.className,\n );\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","attachmentListClassNames","root","menuList","menuPopover","overflowMenuButton","useRootBaseClassName","columnGap","spacingHorizontalSNudge","display","flexDirection","flexShrink","flexWrap","rowGap","spacingVerticalXS","useOverflowMenuButtonBaseClassName","useOverflowMenuPopoverNextStyles","borderRadius","borderRadius4XL","useAttachmentListStyles_unstable","state","rootBaseClassName","overflowMenuButtonClassName","overflowMenuPopoverNextStyles","designVersion","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,6BAA6B;AACvF,SAASC,MAAM,QAAQ,2BAA2B;AAIlD,OAAO,MAAMC,2BAAgE;IAC3EC,MAAM;IACNC,UAAU;IACVC,aAAa;IACbC,oBAAoB;AACtB,EAAE;AAEF,MAAMC,uBAAuBT,gBAAgB;IAC3CU,WAAWP,OAAOQ,uBAAuB;IACzCC,SAAS;IACTC,eAAe;IACfC,YAAY;IACZC,UAAU;IACVC,QAAQb,OAAOc,iBAAiB;AAClC;AAEA,MAAMC,qCAAqClB,gBAAgB;IACzDY,SAAS;AACX;AAEA,MAAMO,mCAAmClB,WAAW;IAClDmB,cAAc;QACZA,cAAcjB,OAAOkB,eAAe;IACtC;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,mCAAmC,CAACC;IAC/C;IAEA,MAAMC,oBAAoBf;IAC1B,MAAMgB,8BAA8BP;IACpC,MAAMQ,gCAAgCP;IACtC,MAAM,EAAEQ,aAAa,EAAE,GAAGJ;IAE1BA,MAAMlB,IAAI,CAACuB,SAAS,GAAG1B,aAAaE,yBAAyBC,IAAI,EAAEmB,mBAAmBD,MAAMlB,IAAI,CAACuB,SAAS;IAE1G,IAAIL,MAAMjB,QAAQ,EAAE;QAClBiB,MAAMjB,QAAQ,CAACsB,SAAS,GAAG1B,aAAaE,yBAAyBE,QAAQ,EAAEiB,MAAMjB,QAAQ,CAACsB,SAAS;IACrG;IACA,IAAIL,MAAMhB,WAAW,EAAE;QACrBgB,MAAMhB,WAAW,CAACqB,SAAS,GAAG1B,aAC5BE,yBAAyBG,WAAW,EACpCoB,kBAAkB,UAAUD,8BAA8BN,YAAY,EACtEG,MAAMhB,WAAW,CAACqB,SAAS;IAE/B;IAEA,IAAIL,MAAMf,kBAAkB,EAAE;QAC5Be,MAAMf,kBAAkB,CAACoB,SAAS,GAAG1B,aACnCE,yBAAyBI,kBAAkB,EAC3CiB,6BACAF,MAAMf,kBAAkB,CAACoB,SAAS;IAEtC;IAEA,OAAOL;AACT,EAAE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useAttachmentOverflowMenu_unstable } from './useAttachmentOverflowMenu';
|
|
2
|
+
import { renderAttachmentOverflowMenu_unstable } from './renderAttachmentOverflowMenu';
|
|
3
|
+
import { useAttachmentOverflowMenuContextValues_unstable } from './useAttachmentOverflowMenuContextValues';
|
|
4
|
+
import { useMenuContextValues_unstable } from '@fluentui/react-components';
|
|
5
|
+
export const AttachmentOverflowMenu = (props)=>{
|
|
6
|
+
const state = useAttachmentOverflowMenu_unstable(props);
|
|
7
|
+
const menuContextValues = useMenuContextValues_unstable(state);
|
|
8
|
+
const attachmentOverflowMenuContextValues = useAttachmentOverflowMenuContextValues_unstable(state);
|
|
9
|
+
return renderAttachmentOverflowMenu_unstable(state, {
|
|
10
|
+
menuContextValues,
|
|
11
|
+
attachmentOverflowMenuContextValues
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
AttachmentOverflowMenu.displayName = 'AttachmentOverflowMenu';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AttachmentOverflowMenu.tsx"],"sourcesContent":["import type * as React from 'react';\nimport { useAttachmentOverflowMenu_unstable } from './useAttachmentOverflowMenu';\nimport { renderAttachmentOverflowMenu_unstable } from './renderAttachmentOverflowMenu';\nimport { useAttachmentOverflowMenuContextValues_unstable } from './useAttachmentOverflowMenuContextValues';\nimport { useMenuContextValues_unstable } from '@fluentui/react-components';\nimport type { AttachmentOverflowMenuProps } from './AttachmentOverflowMenu.types';\n\nexport const AttachmentOverflowMenu: React.FC<AttachmentOverflowMenuProps> = props => {\n const state = useAttachmentOverflowMenu_unstable(props);\n const menuContextValues = useMenuContextValues_unstable(state);\n const attachmentOverflowMenuContextValues = useAttachmentOverflowMenuContextValues_unstable(state);\n\n return renderAttachmentOverflowMenu_unstable(state, { menuContextValues, attachmentOverflowMenuContextValues });\n};\n\nAttachmentOverflowMenu.displayName = 'AttachmentOverflowMenu';\n"],"names":["useAttachmentOverflowMenu_unstable","renderAttachmentOverflowMenu_unstable","useAttachmentOverflowMenuContextValues_unstable","useMenuContextValues_unstable","AttachmentOverflowMenu","props","state","menuContextValues","attachmentOverflowMenuContextValues","displayName"],"rangeMappings":";;;;;;;;;;;;;","mappings":"AACA,SAASA,kCAAkC,QAAQ,8BAA8B;AACjF,SAASC,qCAAqC,QAAQ,iCAAiC;AACvF,SAASC,+CAA+C,QAAQ,2CAA2C;AAC3G,SAASC,6BAA6B,QAAQ,6BAA6B;AAG3E,OAAO,MAAMC,yBAAgEC,CAAAA;IAC3E,MAAMC,QAAQN,mCAAmCK;IACjD,MAAME,oBAAoBJ,8BAA8BG;IACxD,MAAME,sCAAsCN,gDAAgDI;IAE5F,OAAOL,sCAAsCK,OAAO;QAAEC;QAAmBC;IAAoC;AAC/G,EAAE;AAEFJ,uBAAuBK,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AttachmentOverflowMenu.types.ts"],"sourcesContent":["import type { MenuProps, MenuSlots, MenuState } from '@fluentui/react-components';\nimport type { AttachmentOverflowMenuContextValue } from '../../contexts/attachmentOverflowMenuContext';\n\nexport type AttachmentOverflowMenuSlots = MenuSlots;\n\n/**\n * AttachmentOverflowMenu Props\n */\nexport type AttachmentOverflowMenuProps = MenuProps;\n\n/**\n * State used in rendering AttachmentOverflowMenu\n */\nexport type AttachmentOverflowMenuState = MenuState & {\n isOverflowing: boolean;\n overflowButtonRef?: React.MutableRefObject<HTMLButtonElement | null>;\n overflowCount: number;\n};\n\nexport type AttachmentOverflowMenuContextValues = {\n attachmentOverflowMenu: AttachmentOverflowMenuContextValue;\n};\n"],"names":[],"rangeMappings":"","mappings":"AAmBA,WAEE"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { AttachmentOverflowMenu } from './AttachmentOverflowMenu';
|
|
2
|
+
export { renderAttachmentOverflowMenu_unstable } from './renderAttachmentOverflowMenu';
|
|
3
|
+
export { useAttachmentOverflowMenu_unstable } from './useAttachmentOverflowMenu';
|
|
4
|
+
export { useAttachmentOverflowMenuContextValues_unstable } from './useAttachmentOverflowMenuContextValues';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export { AttachmentOverflowMenu } from './AttachmentOverflowMenu';\nexport type { AttachmentOverflowMenuContextValues, AttachmentOverflowMenuProps, AttachmentOverflowMenuSlots, AttachmentOverflowMenuState } from './AttachmentOverflowMenu.types';\nexport { renderAttachmentOverflowMenu_unstable } from './renderAttachmentOverflowMenu';\nexport { useAttachmentOverflowMenu_unstable } from './useAttachmentOverflowMenu';\nexport { useAttachmentOverflowMenuContextValues_unstable } from './useAttachmentOverflowMenuContextValues';\n"],"names":["AttachmentOverflowMenu","renderAttachmentOverflowMenu_unstable","useAttachmentOverflowMenu_unstable","useAttachmentOverflowMenuContextValues_unstable"],"rangeMappings":";;;","mappings":"AAAA,SAASA,sBAAsB,QAAQ,2BAA2B;AAElE,SAASC,qCAAqC,QAAQ,iCAAiC;AACvF,SAASC,kCAAkC,QAAQ,8BAA8B;AACjF,SAASC,+CAA+C,QAAQ,2CAA2C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import { assertSlots, renderMenu_unstable } from '@fluentui/react-components';
|
|
3
|
+
import { AttachmentOverflowMenuProvider } from '../../contexts/attachmentOverflowMenuContext';
|
|
4
|
+
/**
|
|
5
|
+
* Render the final JSX of AttachmentOverflowMenu
|
|
6
|
+
*/ export const renderAttachmentOverflowMenu_unstable = (state, contextValues)=>{
|
|
7
|
+
const { menuContextValues, attachmentOverflowMenuContextValues } = contextValues;
|
|
8
|
+
assertSlots(state);
|
|
9
|
+
return state.isOverflowing ? /*#__PURE__*/ _jsx(AttachmentOverflowMenuProvider, {
|
|
10
|
+
value: attachmentOverflowMenuContextValues.attachmentOverflowMenu,
|
|
11
|
+
children: renderMenu_unstable(state, menuContextValues)
|
|
12
|
+
}) : null;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderAttachmentOverflowMenu.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots, renderMenu_unstable } from '@fluentui/react-components';\nimport type { JSXElement } from '@fluentui/react-components';\nimport { AttachmentOverflowMenuProvider } from '../../contexts/attachmentOverflowMenuContext';\nimport type {\n AttachmentOverflowMenuState,\n AttachmentOverflowMenuSlots,\n AttachmentOverflowMenuContextValues,\n} from './AttachmentOverflowMenu.types';\nimport type { MenuContextValues } from '@fluentui/react-components';\n\n/**\n * Render the final JSX of AttachmentOverflowMenu\n */\nexport const renderAttachmentOverflowMenu_unstable = (\n state: AttachmentOverflowMenuState,\n contextValues: {\n menuContextValues: MenuContextValues;\n attachmentOverflowMenuContextValues: AttachmentOverflowMenuContextValues;\n },\n): JSXElement | null => {\n const { menuContextValues, attachmentOverflowMenuContextValues } = contextValues;\n assertSlots<AttachmentOverflowMenuSlots>(state);\n\n return state.isOverflowing ? (\n <AttachmentOverflowMenuProvider value={attachmentOverflowMenuContextValues.attachmentOverflowMenu}>\n {renderMenu_unstable(state, menuContextValues)}\n </AttachmentOverflowMenuProvider>\n ) : null;\n};\n"],"names":["assertSlots","renderMenu_unstable","AttachmentOverflowMenuProvider","renderAttachmentOverflowMenu_unstable","state","contextValues","menuContextValues","attachmentOverflowMenuContextValues","isOverflowing","value","attachmentOverflowMenu"],"rangeMappings":";;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,EAAEC,mBAAmB,QAAQ,6BAA6B;AAE9E,SAASC,8BAA8B,QAAQ,+CAA+C;AAQ9F;;CAEC,GACD,OAAO,MAAMC,wCAAwC,CACnDC,OACAC;IAKA,MAAM,EAAEC,iBAAiB,EAAEC,mCAAmC,EAAE,GAAGF;IACnEL,YAAyCI;IAEzC,OAAOA,MAAMI,aAAa,iBACxB,KAACN;QAA+BO,OAAOF,oCAAoCG,sBAAsB;kBAC9FT,oBAAoBG,OAAOE;SAE5B;AACN,EAAE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useMenu_unstable, useOverflowMenu } from '@fluentui/react-components';
|
|
2
|
+
/**
|
|
3
|
+
* Create the state required to render AttachmentOverflowMenu.
|
|
4
|
+
*
|
|
5
|
+
* The returned state can be modified with hooks such as useAttachmentOverflowMenuStyles_unstable,
|
|
6
|
+
* before being passed to renderAttachmentOverflowMenu_unstable.
|
|
7
|
+
*
|
|
8
|
+
* @param props - props from this instance of AttachmentOverflowMenu
|
|
9
|
+
*/ export const useAttachmentOverflowMenu_unstable = (props)=>{
|
|
10
|
+
const menuState = useMenu_unstable(props);
|
|
11
|
+
const { isOverflowing, ref: overflowButtonRef, overflowCount } = useOverflowMenu();
|
|
12
|
+
return {
|
|
13
|
+
...menuState,
|
|
14
|
+
isOverflowing,
|
|
15
|
+
overflowButtonRef,
|
|
16
|
+
overflowCount
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentOverflowMenu.ts"],"sourcesContent":["import { useMenu_unstable, useOverflowMenu } from '@fluentui/react-components';\nimport type { AttachmentOverflowMenuProps, AttachmentOverflowMenuState } from './AttachmentOverflowMenu.types';\n\n/**\n * Create the state required to render AttachmentOverflowMenu.\n *\n * The returned state can be modified with hooks such as useAttachmentOverflowMenuStyles_unstable,\n * before being passed to renderAttachmentOverflowMenu_unstable.\n *\n * @param props - props from this instance of AttachmentOverflowMenu\n */\nexport const useAttachmentOverflowMenu_unstable = (props: AttachmentOverflowMenuProps): AttachmentOverflowMenuState => {\n const menuState = useMenu_unstable(props);\n const { isOverflowing, ref: overflowButtonRef, overflowCount } = useOverflowMenu<HTMLButtonElement>();\n\n return {\n ...menuState,\n isOverflowing,\n overflowButtonRef,\n overflowCount,\n };\n};\n"],"names":["useMenu_unstable","useOverflowMenu","useAttachmentOverflowMenu_unstable","props","menuState","isOverflowing","ref","overflowButtonRef","overflowCount"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,gBAAgB,EAAEC,eAAe,QAAQ,6BAA6B;AAG/E;;;;;;;CAOC,GACD,OAAO,MAAMC,qCAAqC,CAACC;IACjD,MAAMC,YAAYJ,iBAAiBG;IACnC,MAAM,EAAEE,aAAa,EAAEC,KAAKC,iBAAiB,EAAEC,aAAa,EAAE,GAAGP;IAEjE,OAAO;QACL,GAAGG,SAAS;QACZC;QACAE;QACAC;IACF;AACF,EAAE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function useAttachmentOverflowMenuContextValues_unstable(state) {
|
|
2
|
+
const { isOverflowing, overflowButtonRef, overflowCount } = state;
|
|
3
|
+
// This context is created with "@fluentui/react-context-selector", there is no sense to memoize it
|
|
4
|
+
const attachmentOverflowMenu = {
|
|
5
|
+
isOverflowing,
|
|
6
|
+
overflowButtonRef,
|
|
7
|
+
overflowCount
|
|
8
|
+
};
|
|
9
|
+
return {
|
|
10
|
+
attachmentOverflowMenu
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentOverflowMenuContextValues.ts"],"sourcesContent":["import type { AttachmentOverflowMenuContextValues, AttachmentOverflowMenuState } from './AttachmentOverflowMenu.types';\n\nexport function useAttachmentOverflowMenuContextValues_unstable(\n state: AttachmentOverflowMenuState,\n): AttachmentOverflowMenuContextValues {\n const { isOverflowing, overflowButtonRef, overflowCount } = state;\n\n // This context is created with \"@fluentui/react-context-selector\", there is no sense to memoize it\n const attachmentOverflowMenu = {\n isOverflowing,\n overflowButtonRef,\n overflowCount,\n };\n\n return { attachmentOverflowMenu };\n}\n"],"names":["useAttachmentOverflowMenuContextValues_unstable","state","isOverflowing","overflowButtonRef","overflowCount","attachmentOverflowMenu"],"rangeMappings":";;;;;;;;;;;","mappings":"AAEA,OAAO,SAASA,gDACdC,KAAkC;IAElC,MAAM,EAAEC,aAAa,EAAEC,iBAAiB,EAAEC,aAAa,EAAE,GAAGH;IAE5D,mGAAmG;IACnG,MAAMI,yBAAyB;QAC7BH;QACAC;QACAC;IACF;IAEA,OAAO;QAAEC;IAAuB;AAClC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useAttachmentOverflowMenuButton_unstable } from './useAttachmentOverflowMenuButton';
|
|
3
|
+
import { renderAttachmentOverflowMenuButton_unstable } from './renderAttachmentOverflowMenuButton';
|
|
4
|
+
import { useAttachmentOverflowMenuButtonStyles_unstable } from './useAttachmentOverflowMenuButtonStyles.styles';
|
|
5
|
+
import { useCustomStyleHook } from '@fluentui-copilot/react-provider';
|
|
6
|
+
export const AttachmentOverflowMenuButton = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
7
|
+
const state = useAttachmentOverflowMenuButton_unstable(props, ref);
|
|
8
|
+
useAttachmentOverflowMenuButtonStyles_unstable(state);
|
|
9
|
+
useCustomStyleHook('useAttachmentOverflowMenuButtonStyles')(state);
|
|
10
|
+
return renderAttachmentOverflowMenuButton_unstable(state);
|
|
11
|
+
});
|
|
12
|
+
AttachmentOverflowMenuButton.displayName = 'AttachmentOverflowMenuButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AttachmentOverflowMenuButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useAttachmentOverflowMenuButton_unstable } from './useAttachmentOverflowMenuButton';\nimport { renderAttachmentOverflowMenuButton_unstable } from './renderAttachmentOverflowMenuButton';\nimport { useAttachmentOverflowMenuButtonStyles_unstable } from './useAttachmentOverflowMenuButtonStyles.styles';\nimport type { AttachmentOverflowMenuButtonProps } from './AttachmentOverflowMenuButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { useCustomStyleHook } from '@fluentui-copilot/react-provider';\n\nexport const AttachmentOverflowMenuButton: ForwardRefComponent<AttachmentOverflowMenuButtonProps> = React.forwardRef(\n (props, ref) => {\n const state = useAttachmentOverflowMenuButton_unstable(props, ref);\n\n useAttachmentOverflowMenuButtonStyles_unstable(state);\n useCustomStyleHook('useAttachmentOverflowMenuButtonStyles')(state);\n\n return renderAttachmentOverflowMenuButton_unstable(state);\n },\n);\n\nAttachmentOverflowMenuButton.displayName = 'AttachmentOverflowMenuButton';\n"],"names":["React","useAttachmentOverflowMenuButton_unstable","renderAttachmentOverflowMenuButton_unstable","useAttachmentOverflowMenuButtonStyles_unstable","useCustomStyleHook","AttachmentOverflowMenuButton","forwardRef","props","ref","state","displayName"],"rangeMappings":";;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wCAAwC,QAAQ,oCAAoC;AAC7F,SAASC,2CAA2C,QAAQ,uCAAuC;AACnG,SAASC,8CAA8C,QAAQ,iDAAiD;AAGhH,SAASC,kBAAkB,QAAQ,mCAAmC;AAEtE,OAAO,MAAMC,6CAAuFL,MAAMM,UAAU,CAClH,CAACC,OAAOC;IACN,MAAMC,QAAQR,yCAAyCM,OAAOC;IAE9DL,+CAA+CM;IAC/CL,mBAAmB,yCAAyCK;IAE5D,OAAOP,4CAA4CO;AACrD,GACA;AAEFJ,6BAA6BK,WAAW,GAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["AttachmentOverflowMenuButton.types.ts"],"sourcesContent":["import type { CopilotMode, DesignVersion } from '@fluentui-copilot/react-provider';\nimport type { ComponentProps, ComponentState, ProgressBar, Slot } from '@fluentui/react-components';\nimport type { AttachmentOverflowMenuState } from '../AttachmentOverflowMenu';\n\nexport type AttachmentOverflowMenuButtonSlots = {\n root: NonNullable<Slot<'button'>>;\n progress: NonNullable<Slot<typeof ProgressBar>>;\n};\n\n/**\n * AttachmentOverflowMenuButton Props\n */\nexport type AttachmentOverflowMenuButtonProps = ComponentProps<Partial<AttachmentOverflowMenuButtonSlots>> &\n CopilotMode &\n DesignVersion & {\n /**\n * Toggle prop to indicate that there are Attachments in the overflow menu that's currently loading.\n * Setting this to true will show an indeterminate progress bar on the button.\n * @default false\n */\n isLoading?: boolean;\n text?: string | ((overflowCount: number) => React.ReactNode);\n };\n\n/**\n * State used in rendering AttachmentOverflowMenuButton\n */\nexport type AttachmentOverflowMenuButtonState = ComponentState<AttachmentOverflowMenuButtonSlots> &\n Pick<AttachmentOverflowMenuState, 'isOverflowing' | 'overflowCount'> &\n Pick<AttachmentOverflowMenuButtonProps, 'isLoading'> &\n Pick<Required<AttachmentOverflowMenuButtonProps>, 'designVersion' | 'mode'> & {\n /**\n * True when all attachments are overflowed into the overflow menu.\n */\n fullyOverflowed: boolean;\n };\n"],"names":[],"rangeMappings":";;","mappings":"AAwBA;;CAEC,GACD,WAQI"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { AttachmentOverflowMenuButton } from './AttachmentOverflowMenuButton';
|
|
2
|
+
export { renderAttachmentOverflowMenuButton_unstable } from './renderAttachmentOverflowMenuButton';
|
|
3
|
+
export { useAttachmentOverflowMenuButton_unstable } from './useAttachmentOverflowMenuButton';
|
|
4
|
+
export { attachmentOverflowMenuButtonClassNames, useAttachmentOverflowMenuButtonStyles_unstable } from './useAttachmentOverflowMenuButtonStyles.styles';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export { AttachmentOverflowMenuButton } from './AttachmentOverflowMenuButton';\nexport type { AttachmentOverflowMenuButtonProps, AttachmentOverflowMenuButtonSlots, AttachmentOverflowMenuButtonState } from './AttachmentOverflowMenuButton.types';\nexport { renderAttachmentOverflowMenuButton_unstable } from './renderAttachmentOverflowMenuButton';\nexport { useAttachmentOverflowMenuButton_unstable } from './useAttachmentOverflowMenuButton';\nexport { attachmentOverflowMenuButtonClassNames, useAttachmentOverflowMenuButtonStyles_unstable } from './useAttachmentOverflowMenuButtonStyles.styles';\n"],"names":["AttachmentOverflowMenuButton","renderAttachmentOverflowMenuButton_unstable","useAttachmentOverflowMenuButton_unstable","attachmentOverflowMenuButtonClassNames","useAttachmentOverflowMenuButtonStyles_unstable"],"rangeMappings":";;;","mappings":"AAAA,SAASA,4BAA4B,QAAQ,iCAAiC;AAE9E,SAASC,2CAA2C,QAAQ,uCAAuC;AACnG,SAASC,wCAAwC,QAAQ,oCAAoC;AAC7F,SAASC,sCAAsC,EAAEC,8CAA8C,QAAQ,iDAAiD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import { MenuTrigger, assertSlots } from '@fluentui/react-components';
|
|
3
|
+
/**
|
|
4
|
+
* Render the final JSX of AttachmentOverflowMenuButton
|
|
5
|
+
*/ export const renderAttachmentOverflowMenuButton_unstable = (state)=>{
|
|
6
|
+
assertSlots(state);
|
|
7
|
+
return state.isOverflowing ? /*#__PURE__*/ _jsx(MenuTrigger, {
|
|
8
|
+
children: /*#__PURE__*/ _jsxs(state.root, {
|
|
9
|
+
children: [
|
|
10
|
+
state.root.children,
|
|
11
|
+
state.isLoading && /*#__PURE__*/ _jsx(state.progress, {})
|
|
12
|
+
]
|
|
13
|
+
})
|
|
14
|
+
}) : null;
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["renderAttachmentOverflowMenuButton.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { MenuTrigger, assertSlots } from '@fluentui/react-components';\nimport type { JSXElement } from '@fluentui/react-components';\nimport type {\n AttachmentOverflowMenuButtonState,\n AttachmentOverflowMenuButtonSlots,\n} from './AttachmentOverflowMenuButton.types';\n\n/**\n * Render the final JSX of AttachmentOverflowMenuButton\n */\nexport const renderAttachmentOverflowMenuButton_unstable = (\n state: AttachmentOverflowMenuButtonState,\n): JSXElement | null => {\n assertSlots<AttachmentOverflowMenuButtonSlots>(state);\n\n return state.isOverflowing ? (\n <MenuTrigger>\n <state.root>\n {state.root.children}\n {state.isLoading && <state.progress />}\n </state.root>\n </MenuTrigger>\n ) : null;\n};\n"],"names":["MenuTrigger","assertSlots","renderAttachmentOverflowMenuButton_unstable","state","isOverflowing","root","children","isLoading","progress"],"rangeMappings":";;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,SAASA,WAAW,EAAEC,WAAW,QAAQ,6BAA6B;AAOtE;;CAEC,GACD,OAAO,MAAMC,8CAA8C,CACzDC;IAEAF,YAA+CE;IAE/C,OAAOA,MAAMC,aAAa,iBACxB,KAACJ;kBACC,cAAA,MAACG,MAAME,IAAI;;gBACRF,MAAME,IAAI,CAACC,QAAQ;gBACnBH,MAAMI,SAAS,kBAAI,KAACJ,MAAMK,QAAQ;;;SAGrC;AACN,EAAE"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useCopilotMode, useDesignVersion } from '@fluentui-copilot/react-provider';
|
|
3
|
+
import { ProgressBar, getIntrinsicElementProps, slot, useMergedRefs } from '@fluentui/react-components';
|
|
4
|
+
import { useAttachmentOverflowMenuContext_unstable } from '../../contexts/attachmentOverflowMenuContext';
|
|
5
|
+
import { Attach20Regular, Attach24Regular } from '@fluentui/react-icons';
|
|
6
|
+
import { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';
|
|
7
|
+
/**
|
|
8
|
+
* Create the state required to render AttachmentOverflowMenuButton.
|
|
9
|
+
*
|
|
10
|
+
* The returned state can be modified with hooks such as useAttachmentOverflowMenuButtonStyles_unstable,
|
|
11
|
+
* before being passed to renderAttachmentOverflowMenuButton_unstable.
|
|
12
|
+
*
|
|
13
|
+
* @param props - props from this instance of AttachmentOverflowMenuButton
|
|
14
|
+
* @param ref - reference to root HTMLElement of AttachmentOverflowMenuButton
|
|
15
|
+
*/ export const useAttachmentOverflowMenuButton_unstable = (props, ref)=>{
|
|
16
|
+
const { isOverflowing, overflowCount, overflowButtonRef } = useAttachmentOverflowMenuContext_unstable((context)=>context);
|
|
17
|
+
const { numberOfAttachments } = useAttachmentListContext_unstable((context)=>context);
|
|
18
|
+
const fullyOverflowed = overflowCount >= numberOfAttachments;
|
|
19
|
+
const isLoading = !!props.isLoading;
|
|
20
|
+
const designVersion = useDesignVersion(props.designVersion);
|
|
21
|
+
const mode = useCopilotMode(props.mode);
|
|
22
|
+
const buttonText = defaultButtonText(props, overflowCount, designVersion, mode, fullyOverflowed);
|
|
23
|
+
return {
|
|
24
|
+
components: {
|
|
25
|
+
root: 'button',
|
|
26
|
+
progress: ProgressBar
|
|
27
|
+
},
|
|
28
|
+
root: slot.always(getIntrinsicElementProps('button', {
|
|
29
|
+
ref: useMergedRefs(ref, overflowButtonRef),
|
|
30
|
+
...props
|
|
31
|
+
}), {
|
|
32
|
+
defaultProps: {
|
|
33
|
+
children: buttonText
|
|
34
|
+
},
|
|
35
|
+
elementType: 'button'
|
|
36
|
+
}),
|
|
37
|
+
progress: slot.always(props.progress, {
|
|
38
|
+
defaultProps: {
|
|
39
|
+
value: undefined,
|
|
40
|
+
shape: 'square',
|
|
41
|
+
thickness: 'large',
|
|
42
|
+
'aria-label': 'Loading'
|
|
43
|
+
},
|
|
44
|
+
elementType: ProgressBar
|
|
45
|
+
}),
|
|
46
|
+
fullyOverflowed,
|
|
47
|
+
isOverflowing,
|
|
48
|
+
overflowCount,
|
|
49
|
+
isLoading,
|
|
50
|
+
designVersion,
|
|
51
|
+
mode
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
function defaultButtonText(props, overflowCount, designVersion, copilotMode, fullyOverflowed) {
|
|
55
|
+
if (props.children) {
|
|
56
|
+
return props.children;
|
|
57
|
+
}
|
|
58
|
+
if (props.text) {
|
|
59
|
+
if (typeof props.text === 'function') {
|
|
60
|
+
return props.text(overflowCount);
|
|
61
|
+
} else {
|
|
62
|
+
return props.text;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (designVersion === 'next' && fullyOverflowed) {
|
|
66
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, copilotMode === 'canvas' ? /*#__PURE__*/ React.createElement(Attach24Regular, null) : /*#__PURE__*/ React.createElement(Attach20Regular, null), overflowCount);
|
|
67
|
+
}
|
|
68
|
+
return `+${overflowCount}`;
|
|
69
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useAttachmentOverflowMenuButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { CopilotMode, DesignVersion } from '@fluentui-copilot/react-provider';\nimport { useCopilotMode, useDesignVersion } from '@fluentui-copilot/react-provider';\nimport { ProgressBar, getIntrinsicElementProps, slot, useMergedRefs } from '@fluentui/react-components';\nimport { useAttachmentOverflowMenuContext_unstable } from '../../contexts/attachmentOverflowMenuContext';\nimport type {\n AttachmentOverflowMenuButtonProps,\n AttachmentOverflowMenuButtonState,\n} from './AttachmentOverflowMenuButton.types';\nimport { Attach20Regular, Attach24Regular } from '@fluentui/react-icons';\nimport { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';\n\n/**\n * Create the state required to render AttachmentOverflowMenuButton.\n *\n * The returned state can be modified with hooks such as useAttachmentOverflowMenuButtonStyles_unstable,\n * before being passed to renderAttachmentOverflowMenuButton_unstable.\n *\n * @param props - props from this instance of AttachmentOverflowMenuButton\n * @param ref - reference to root HTMLElement of AttachmentOverflowMenuButton\n */\nexport const useAttachmentOverflowMenuButton_unstable = (\n props: AttachmentOverflowMenuButtonProps,\n ref: React.Ref<HTMLButtonElement>,\n): AttachmentOverflowMenuButtonState => {\n const { isOverflowing, overflowCount, overflowButtonRef } = useAttachmentOverflowMenuContext_unstable(\n context => context,\n );\n const { numberOfAttachments } = useAttachmentListContext_unstable(context => context);\n\n const fullyOverflowed = overflowCount >= numberOfAttachments;\n const isLoading = !!props.isLoading;\n\n const designVersion = useDesignVersion(props.designVersion);\n const mode = useCopilotMode(props.mode);\n\n const buttonText = defaultButtonText(props, overflowCount, designVersion, mode, fullyOverflowed);\n\n return {\n components: {\n root: 'button',\n progress: ProgressBar,\n },\n root: slot.always(\n getIntrinsicElementProps('button', {\n ref: useMergedRefs(ref, overflowButtonRef),\n ...props,\n }),\n {\n defaultProps: {\n children: buttonText,\n },\n elementType: 'button',\n },\n ),\n progress: slot.always(props.progress, {\n defaultProps: { value: undefined, shape: 'square', thickness: 'large', 'aria-label': 'Loading' },\n elementType: ProgressBar,\n }),\n fullyOverflowed,\n isOverflowing,\n overflowCount,\n isLoading,\n designVersion,\n mode,\n };\n};\n\nfunction defaultButtonText(\n props: AttachmentOverflowMenuButtonProps,\n overflowCount: number,\n designVersion: DesignVersion['designVersion'],\n copilotMode: CopilotMode['mode'],\n fullyOverflowed: boolean,\n) {\n if (props.children) {\n return props.children;\n }\n\n if (props.text) {\n if (typeof props.text === 'function') {\n return props.text(overflowCount);\n } else {\n return props.text;\n }\n }\n\n if (designVersion === 'next' && fullyOverflowed) {\n return (\n <>\n {copilotMode === 'canvas' ? <Attach24Regular /> : <Attach20Regular />}\n {overflowCount}\n </>\n );\n }\n\n return `+${overflowCount}`;\n}\n"],"names":["React","useCopilotMode","useDesignVersion","ProgressBar","getIntrinsicElementProps","slot","useMergedRefs","useAttachmentOverflowMenuContext_unstable","Attach20Regular","Attach24Regular","useAttachmentListContext_unstable","useAttachmentOverflowMenuButton_unstable","props","ref","isOverflowing","overflowCount","overflowButtonRef","context","numberOfAttachments","fullyOverflowed","isLoading","designVersion","mode","buttonText","defaultButtonText","components","root","progress","always","defaultProps","children","elementType","value","undefined","shape","thickness","copilotMode","text"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,cAAc,EAAEC,gBAAgB,QAAQ,mCAAmC;AACpF,SAASC,WAAW,EAAEC,wBAAwB,EAAEC,IAAI,EAAEC,aAAa,QAAQ,6BAA6B;AACxG,SAASC,yCAAyC,QAAQ,+CAA+C;AAKzG,SAASC,eAAe,EAAEC,eAAe,QAAQ,wBAAwB;AACzE,SAASC,iCAAiC,QAAQ,uCAAuC;AAEzF;;;;;;;;CAQC,GACD,OAAO,MAAMC,2CAA2C,CACtDC,OACAC;IAEA,MAAM,EAAEC,aAAa,EAAEC,aAAa,EAAEC,iBAAiB,EAAE,GAAGT,0CAC1DU,CAAAA,UAAWA;IAEb,MAAM,EAAEC,mBAAmB,EAAE,GAAGR,kCAAkCO,CAAAA,UAAWA;IAE7E,MAAME,kBAAkBJ,iBAAiBG;IACzC,MAAME,YAAY,CAAC,CAACR,MAAMQ,SAAS;IAEnC,MAAMC,gBAAgBnB,iBAAiBU,MAAMS,aAAa;IAC1D,MAAMC,OAAOrB,eAAeW,MAAMU,IAAI;IAEtC,MAAMC,aAAaC,kBAAkBZ,OAAOG,eAAeM,eAAeC,MAAMH;IAEhF,OAAO;QACLM,YAAY;YACVC,MAAM;YACNC,UAAUxB;QACZ;QACAuB,MAAMrB,KAAKuB,MAAM,CACfxB,yBAAyB,UAAU;YACjCS,KAAKP,cAAcO,KAAKG;YACxB,GAAGJ,KAAK;QACV,IACA;YACEiB,cAAc;gBACZC,UAAUP;YACZ;YACAQ,aAAa;QACf;QAEFJ,UAAUtB,KAAKuB,MAAM,CAAChB,MAAMe,QAAQ,EAAE;YACpCE,cAAc;gBAAEG,OAAOC;gBAAWC,OAAO;gBAAUC,WAAW;gBAAS,cAAc;YAAU;YAC/FJ,aAAa5B;QACf;QACAgB;QACAL;QACAC;QACAK;QACAC;QACAC;IACF;AACF,EAAE;AAEF,SAASE,kBACPZ,KAAwC,EACxCG,aAAqB,EACrBM,aAA6C,EAC7Ce,WAAgC,EAChCjB,eAAwB;IAExB,IAAIP,MAAMkB,QAAQ,EAAE;QAClB,OAAOlB,MAAMkB,QAAQ;IACvB;IAEA,IAAIlB,MAAMyB,IAAI,EAAE;QACd,IAAI,OAAOzB,MAAMyB,IAAI,KAAK,YAAY;YACpC,OAAOzB,MAAMyB,IAAI,CAACtB;QACpB,OAAO;YACL,OAAOH,MAAMyB,IAAI;QACnB;IACF;IAEA,IAAIhB,kBAAkB,UAAUF,iBAAiB;QAC/C,qBACE,0CACGiB,gBAAgB,yBAAW,oBAAC3B,uCAAqB,oBAACD,wBAClDO;IAGP;IAEA,OAAO,CAAC,CAAC,EAAEA,cAAc,CAAC;AAC5B"}
|