@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,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useAttachmentList_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useAttachmentList_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
14
|
+
const _reactsharedcontexts = require("@fluentui/react-shared-contexts");
|
|
15
|
+
const _reactutilities = require("@fluentui/react-utilities");
|
|
16
|
+
const _reactutilities1 = require("@fluentui-copilot/react-utilities");
|
|
17
|
+
const _Attachment = require("../Attachment");
|
|
18
|
+
const _AttachmentOverflowMenuButton = require("../AttachmentOverflowMenuButton");
|
|
19
|
+
const _useAttachmentOverflowMenuButtonStylesstyles = require("../AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles");
|
|
20
|
+
const _AttachmentOverflowMenuItem = require("../AttachmentOverflowMenuItem");
|
|
21
|
+
const _reactprovider = require("@fluentui-copilot/react-provider");
|
|
22
|
+
const useAttachmentList_unstable = (props, ref)=>{
|
|
23
|
+
const { children, maxVisibleAttachments, onAttachmentDismiss, overflowMenuProps } = props;
|
|
24
|
+
const innerRef = _react.useRef(null);
|
|
25
|
+
const [setTimeout] = (0, _reactutilities.useTimeout)();
|
|
26
|
+
const { targetDocument } = (0, _reactsharedcontexts.useFluent_unstable)();
|
|
27
|
+
const designVersion = (0, _reactprovider.useDesignVersion)(props.designVersion);
|
|
28
|
+
const { findNextFocusable, findPrevFocusable, findLastFocusable } = (0, _reactcomponents.useFocusFinders)();
|
|
29
|
+
const handleAttachmentDismiss = (0, _reactcomponents.useEventCallback)((e, data)=>{
|
|
30
|
+
var _innerRef_current;
|
|
31
|
+
if (!onAttachmentDismiss) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
onAttachmentDismiss(e, data);
|
|
35
|
+
// set focus after attachment dismiss
|
|
36
|
+
const activeElement = targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement;
|
|
37
|
+
if ((_innerRef_current = innerRef.current) === null || _innerRef_current === void 0 ? void 0 : _innerRef_current.contains(activeElement)) {
|
|
38
|
+
// focus on next attachment only if the active element is within the current attachment list
|
|
39
|
+
const next = findNextFocusable(activeElement, {
|
|
40
|
+
container: innerRef.current
|
|
41
|
+
});
|
|
42
|
+
if (next) {
|
|
43
|
+
// focus on the overflow button if the next focusable element is the overflow button.
|
|
44
|
+
// if overflow button is removed from the DOM, focus on the last focusable element in the attachment list.
|
|
45
|
+
if (next.classList.contains(_useAttachmentOverflowMenuButtonStylesstyles.attachmentOverflowMenuButtonClassNames.root)) {
|
|
46
|
+
setTimeout(()=>{
|
|
47
|
+
var _findLastFocusable;
|
|
48
|
+
(_findLastFocusable = findLastFocusable(innerRef.current)) === null || _findLastFocusable === void 0 ? void 0 : _findLastFocusable.focus();
|
|
49
|
+
}, 0);
|
|
50
|
+
} else {
|
|
51
|
+
next.focus();
|
|
52
|
+
}
|
|
53
|
+
} else {
|
|
54
|
+
const prev = findPrevFocusable(activeElement === null || activeElement === void 0 ? void 0 : activeElement.parentElement, {
|
|
55
|
+
container: innerRef.current
|
|
56
|
+
});
|
|
57
|
+
prev === null || prev === void 0 ? void 0 : prev.focus();
|
|
58
|
+
}
|
|
59
|
+
} else {
|
|
60
|
+
// Handles keyboard focus when attachment removed is in the overflow menu. Also handles focus when the overflow button is removed from the DOM.
|
|
61
|
+
setTimeout(()=>{
|
|
62
|
+
var _findLastFocusable;
|
|
63
|
+
(_findLastFocusable = findLastFocusable(innerRef.current)) === null || _findLastFocusable === void 0 ? void 0 : _findLastFocusable.focus();
|
|
64
|
+
}, 0);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
const styles = (0, _Attachment.useOverflowStyles)();
|
|
68
|
+
const resolvedChildren = (0, _reactutilities1.useOverflowMaxVisibleItems)({
|
|
69
|
+
children,
|
|
70
|
+
maxVisibleItems: maxVisibleAttachments,
|
|
71
|
+
overflowClassName: styles.overflow
|
|
72
|
+
});
|
|
73
|
+
const attachmentOverflowMenuItems = _react.useMemo(()=>{
|
|
74
|
+
if (resolvedChildren && Array.isArray(resolvedChildren)) {
|
|
75
|
+
return resolvedChildren.filter((child)=>/*#__PURE__*/ _react.isValidElement(child)).map((child)=>child.props).map((attachment)=>{
|
|
76
|
+
const dismissButton = _reactcomponents.slot.optional(attachment.dismissButton, {
|
|
77
|
+
elementType: 'button'
|
|
78
|
+
});
|
|
79
|
+
return /*#__PURE__*/ _react.createElement(_AttachmentOverflowMenuItem.AttachmentOverflowMenuItem, {
|
|
80
|
+
...attachment,
|
|
81
|
+
key: attachment.id,
|
|
82
|
+
onClick: dismissButton === null || dismissButton === void 0 ? void 0 : dismissButton.onClick
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
return [];
|
|
87
|
+
}, [
|
|
88
|
+
resolvedChildren
|
|
89
|
+
]);
|
|
90
|
+
const arrowNavigationProps = (0, _reactcomponents.useArrowNavigationGroup)({
|
|
91
|
+
circular: true,
|
|
92
|
+
axis: 'both',
|
|
93
|
+
memorizeCurrent: true
|
|
94
|
+
});
|
|
95
|
+
const shouldUseOverflow = maxVisibleAttachments !== undefined;
|
|
96
|
+
return {
|
|
97
|
+
designVersion,
|
|
98
|
+
onAttachmentDismiss: handleAttachmentDismiss,
|
|
99
|
+
shouldUseOverflow,
|
|
100
|
+
numberOfAttachments: resolvedChildren.length,
|
|
101
|
+
overflowMenuProps,
|
|
102
|
+
components: {
|
|
103
|
+
root: 'div',
|
|
104
|
+
menuList: _reactcomponents.MenuList,
|
|
105
|
+
menuPopover: _reactcomponents.MenuPopover,
|
|
106
|
+
overflowMenuButton: 'span'
|
|
107
|
+
},
|
|
108
|
+
root: _reactcomponents.slot.always((0, _reactcomponents.getIntrinsicElementProps)('div', {
|
|
109
|
+
'aria-label': 'Attachments',
|
|
110
|
+
ref: (0, _reactcomponents.useMergedRefs)(ref, innerRef),
|
|
111
|
+
role: 'toolbar',
|
|
112
|
+
...arrowNavigationProps,
|
|
113
|
+
...props,
|
|
114
|
+
children: resolvedChildren
|
|
115
|
+
}), {
|
|
116
|
+
elementType: 'div'
|
|
117
|
+
}),
|
|
118
|
+
menuList: _reactcomponents.slot.optional(props.menuList, {
|
|
119
|
+
defaultProps: {
|
|
120
|
+
children: attachmentOverflowMenuItems
|
|
121
|
+
},
|
|
122
|
+
elementType: _reactcomponents.MenuList,
|
|
123
|
+
renderByDefault: true
|
|
124
|
+
}),
|
|
125
|
+
menuPopover: _reactcomponents.slot.optional(props.menuPopover, {
|
|
126
|
+
elementType: _reactcomponents.MenuPopover,
|
|
127
|
+
renderByDefault: true
|
|
128
|
+
}),
|
|
129
|
+
overflowMenuButton: _reactcomponents.slot.optional(props.overflowMenuButton, {
|
|
130
|
+
defaultProps: {
|
|
131
|
+
children: /*#__PURE__*/ _react.createElement(_AttachmentOverflowMenuButton.AttachmentOverflowMenuButton, null)
|
|
132
|
+
},
|
|
133
|
+
elementType: 'span',
|
|
134
|
+
renderByDefault: true
|
|
135
|
+
})
|
|
136
|
+
};
|
|
137
|
+
};
|
|
@@ -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":["useAttachmentList_unstable","props","ref","children","maxVisibleAttachments","onAttachmentDismiss","overflowMenuProps","innerRef","React","useRef","setTimeout","useTimeout","targetDocument","useFluent","designVersion","useDesignVersion","findNextFocusable","findPrevFocusable","findLastFocusable","useFocusFinders","handleAttachmentDismiss","useEventCallback","e","data","activeElement","current","contains","next","container","classList","attachmentOverflowMenuButtonClassNames","root","focus","prev","parentElement","styles","useOverflowStyles","resolvedChildren","useOverflowMaxVisibleItems","maxVisibleItems","overflowClassName","overflow","attachmentOverflowMenuItems","useMemo","Array","isArray","filter","child","isValidElement","map","attachment","dismissButton","slot","optional","elementType","createElement","AttachmentOverflowMenuItem","key","id","onClick","arrowNavigationProps","useArrowNavigationGroup","circular","axis","memorizeCurrent","shouldUseOverflow","undefined","numberOfAttachments","length","components","menuList","MenuList","menuPopover","MenuPopover","overflowMenuButton","always","getIntrinsicElementProps","useMergedRefs","role","defaultProps","renderByDefault","AttachmentOverflowMenuButton"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useAttachmentListContextValues_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useAttachmentListContextValues_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
function useAttachmentListContextValues_unstable(state) {
|
|
12
|
+
const { numberOfAttachments, onAttachmentDismiss, shouldUseOverflow } = state;
|
|
13
|
+
// This context is created with "@fluentui/react-context-selector", there is no sense to memoize it
|
|
14
|
+
const attachmentList = {
|
|
15
|
+
numberOfAttachments,
|
|
16
|
+
onAttachmentDismiss,
|
|
17
|
+
shouldUseOverflow
|
|
18
|
+
};
|
|
19
|
+
return {
|
|
20
|
+
attachmentList
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -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":";;;;+BAEgBA;;;eAAAA;;;AAAT,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,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
attachmentListClassNames: function() {
|
|
13
|
+
return attachmentListClassNames;
|
|
14
|
+
},
|
|
15
|
+
useAttachmentListStyles_unstable: function() {
|
|
16
|
+
return useAttachmentListStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
20
|
+
const attachmentListClassNames = {
|
|
21
|
+
root: 'fai-AttachmentList',
|
|
22
|
+
menuList: 'fai-AttachmentList__menuList',
|
|
23
|
+
menuPopover: 'fai-AttachmentList__menuPopover',
|
|
24
|
+
overflowMenuButton: 'fai-AttachmentList__overflowMenuButton'
|
|
25
|
+
};
|
|
26
|
+
const useRootBaseClassName = (0, _reactcomponents.__resetStyles)("r168fwfa", null, [
|
|
27
|
+
".r168fwfa{column-gap:var(--spacingHorizontalSNudge);display:flex;flex-direction:row;flex-shrink:0;flex-wrap:wrap;row-gap:var(--spacingVerticalXS);}"
|
|
28
|
+
]);
|
|
29
|
+
const useOverflowMenuButtonBaseClassName = (0, _reactcomponents.__resetStyles)("rvxcmzt", null, [
|
|
30
|
+
".rvxcmzt{display:inline-flex;}"
|
|
31
|
+
]);
|
|
32
|
+
const useOverflowMenuPopoverNextStyles = (0, _reactcomponents.__styles)({
|
|
33
|
+
borderRadius: {
|
|
34
|
+
Beyfa6y: 0,
|
|
35
|
+
Bbmb7ep: 0,
|
|
36
|
+
Btl43ni: 0,
|
|
37
|
+
B7oj6ja: 0,
|
|
38
|
+
Dimara: "f1pwvjsv"
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
d: [
|
|
42
|
+
[
|
|
43
|
+
".f1pwvjsv{border-radius:var(--borderRadius4XL);}",
|
|
44
|
+
{
|
|
45
|
+
p: -1
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
]
|
|
49
|
+
});
|
|
50
|
+
const useAttachmentListStyles_unstable = (state)=>{
|
|
51
|
+
'use no memo';
|
|
52
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
53
|
+
const overflowMenuButtonClassName = useOverflowMenuButtonBaseClassName();
|
|
54
|
+
const overflowMenuPopoverNextStyles = useOverflowMenuPopoverNextStyles();
|
|
55
|
+
const { designVersion } = state;
|
|
56
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(attachmentListClassNames.root, rootBaseClassName, state.root.className);
|
|
57
|
+
if (state.menuList) {
|
|
58
|
+
state.menuList.className = (0, _reactcomponents.mergeClasses)(attachmentListClassNames.menuList, state.menuList.className);
|
|
59
|
+
}
|
|
60
|
+
if (state.menuPopover) {
|
|
61
|
+
state.menuPopover.className = (0, _reactcomponents.mergeClasses)(attachmentListClassNames.menuPopover, designVersion === 'next' && overflowMenuPopoverNextStyles.borderRadius, state.menuPopover.className);
|
|
62
|
+
}
|
|
63
|
+
if (state.overflowMenuButton) {
|
|
64
|
+
state.overflowMenuButton.className = (0, _reactcomponents.mergeClasses)(attachmentListClassNames.overflowMenuButton, overflowMenuButtonClassName, state.overflowMenuButton.className);
|
|
65
|
+
}
|
|
66
|
+
return state;
|
|
67
|
+
}; //# 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":["attachmentListClassNames","useAttachmentListStyles_unstable","root","menuList","menuPopover","overflowMenuButton","useRootBaseClassName","makeResetStyles","columnGap","spacingHorizontalSNudge","display","__styles","flexDirection","flexShrink","flexWrap","rowGap","tokens","B7oj6ja","Dimara","useOverflowMenuButtonBaseClassName","d","useOverflowMenuPopoverNextStyles","borderRadius","rootBaseClassName","overflowMenuButtonClassName","overflowMenuPopoverNextStyles","state","designVersion","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,wBAAAA;eAAAA;;IA6BNC,gCAAMA;eAANA;;;iCAlC2C;AAK3C,MAAMD,2BAAgE;UAC3EE;cACAC;iBACAC;wBACAC;AACF;AAEA,MAAMC,uBAAuBC,IAAAA,8BAAAA,EAAAA,YAAgB,MAAA;IAAA;CAAA;MAC3CC,qCAAkBC,IAAAA,8BAAuB,EAAA,WAAA,MAAA;IAAA;CAAA;MACzCC,mCAASC,IAAAA,yBAAA,EAAA;kBACTC;QACAC,SAAAA;QACAC,SAAAA;QACAC,SAAQC;QACVC,SAAA;QAEAC,QAAMC;;AAEN,GAAA;IAEAC,GAAA;QAAMC;YAAAA;YAA8C;gBAClDC,GAAAA,CAAAA;;;;;AAQF,MAAOrB,mCAAMA,CAAAA;;UAIXsB,oBAAMC;UACNA,8BAAMC;UACNA,gCAA0BC;UAE1BA,EAEAC,aAAUxB;UAEVD,IAAA,CAAA0B,SAAA,GAAAC,IAAAA,6BAAA,EAAA7B,yBAAAE,IAAA,EAAAqB,mBAAAG,MAAAxB,IAAA,CAAA0B,SAAA;QACAF,MAAIA,QAAMtB,EAAAA;cACRsB,QAAMtB,CAAAA,SAAYwB,GAAAA,IAAAA,6BAAYC,EAAAA,yBAC5B7B,QAAyBI,EAAAA,MAAAA,QACzBuB,CAAAA,SAAAA;;QAKJD,MAAIA,WAAMrB,EAAAA;cACRqB,WAAMrB,CAAAA,SAAAA,GAAmBuB,IAAAA,6BAAYC,EAAAA,yBACnC7B,WAAyBK,EAAAA,kBACzBmB,UAAAA,8BACMnB,YAAAA,EAAmBuB,MAAAA,WAAS,CAAAA,SAAA;;QAItCF,MAAOA,kBAAAA,EAAAA;QACPA,MAAArB,kBAAA,CAAAuB,SAAA,GAAAC,IAAAA,6BAAA,EAAA7B,yBAAAK,kBAAA,EAAAmB,6BAAAE,MAAArB,kBAAA,CAAAuB,SAAA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
attachmentListClassNames: function() {
|
|
13
|
+
return attachmentListClassNames;
|
|
14
|
+
},
|
|
15
|
+
useAttachmentListStyles_unstable: function() {
|
|
16
|
+
return useAttachmentListStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
20
|
+
const _tokens = require("@fluentui-copilot/tokens");
|
|
21
|
+
const attachmentListClassNames = {
|
|
22
|
+
root: 'fai-AttachmentList',
|
|
23
|
+
menuList: 'fai-AttachmentList__menuList',
|
|
24
|
+
menuPopover: 'fai-AttachmentList__menuPopover',
|
|
25
|
+
overflowMenuButton: 'fai-AttachmentList__overflowMenuButton'
|
|
26
|
+
};
|
|
27
|
+
const useRootBaseClassName = (0, _reactcomponents.makeResetStyles)({
|
|
28
|
+
columnGap: _tokens.tokens.spacingHorizontalSNudge,
|
|
29
|
+
display: 'flex',
|
|
30
|
+
flexDirection: 'row',
|
|
31
|
+
flexShrink: 0,
|
|
32
|
+
flexWrap: 'wrap',
|
|
33
|
+
rowGap: _tokens.tokens.spacingVerticalXS
|
|
34
|
+
});
|
|
35
|
+
const useOverflowMenuButtonBaseClassName = (0, _reactcomponents.makeResetStyles)({
|
|
36
|
+
display: 'inline-flex'
|
|
37
|
+
});
|
|
38
|
+
const useOverflowMenuPopoverNextStyles = (0, _reactcomponents.makeStyles)({
|
|
39
|
+
borderRadius: {
|
|
40
|
+
borderRadius: _tokens.tokens.borderRadius4XL
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
const useAttachmentListStyles_unstable = (state)=>{
|
|
44
|
+
'use no memo';
|
|
45
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
46
|
+
const overflowMenuButtonClassName = useOverflowMenuButtonBaseClassName();
|
|
47
|
+
const overflowMenuPopoverNextStyles = useOverflowMenuPopoverNextStyles();
|
|
48
|
+
const { designVersion } = state;
|
|
49
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(attachmentListClassNames.root, rootBaseClassName, state.root.className);
|
|
50
|
+
if (state.menuList) {
|
|
51
|
+
state.menuList.className = (0, _reactcomponents.mergeClasses)(attachmentListClassNames.menuList, state.menuList.className);
|
|
52
|
+
}
|
|
53
|
+
if (state.menuPopover) {
|
|
54
|
+
state.menuPopover.className = (0, _reactcomponents.mergeClasses)(attachmentListClassNames.menuPopover, designVersion === 'next' && overflowMenuPopoverNextStyles.borderRadius, state.menuPopover.className);
|
|
55
|
+
}
|
|
56
|
+
if (state.overflowMenuButton) {
|
|
57
|
+
state.overflowMenuButton.className = (0, _reactcomponents.mergeClasses)(attachmentListClassNames.overflowMenuButton, overflowMenuButtonClassName, state.overflowMenuButton.className);
|
|
58
|
+
}
|
|
59
|
+
return state;
|
|
60
|
+
};
|
|
@@ -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":["attachmentListClassNames","useAttachmentListStyles_unstable","root","menuList","menuPopover","overflowMenuButton","useRootBaseClassName","makeResetStyles","columnGap","tokens","spacingHorizontalSNudge","display","flexDirection","flexShrink","flexWrap","rowGap","spacingVerticalXS","useOverflowMenuButtonBaseClassName","useOverflowMenuPopoverNextStyles","makeStyles","borderRadius","borderRadius4XL","state","rootBaseClassName","overflowMenuButtonClassName","overflowMenuPopoverNextStyles","designVersion","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,wBAAAA;eAAAA;;IA6BAC,gCAAAA;eAAAA;;;iCAlC6C;wBACnC;AAIhB,MAAMD,2BAAgE;IAC3EE,MAAM;IACNC,UAAU;IACVC,aAAa;IACbC,oBAAoB;AACtB;AAEA,MAAMC,uBAAuBC,IAAAA,gCAAAA,EAAgB;IAC3CC,WAAWC,cAAAA,CAAOC,uBAAuB;IACzCC,SAAS;IACTC,eAAe;IACfC,YAAY;IACZC,UAAU;IACVC,QAAQN,cAAAA,CAAOO,iBAAiB;AAClC;AAEA,MAAMC,qCAAqCV,IAAAA,gCAAAA,EAAgB;IACzDI,SAAS;AACX;AAEA,MAAMO,mCAAmCC,IAAAA,2BAAAA,EAAW;IAClDC,cAAc;QACZA,cAAcX,cAAAA,CAAOY,eAAe;IACtC;AACF;AAKO,MAAMpB,mCAAmC,CAACqB;IAC/C;IAEA,MAAMC,oBAAoBjB;IAC1B,MAAMkB,8BAA8BP;IACpC,MAAMQ,gCAAgCP;IACtC,MAAM,EAAEQ,aAAa,EAAE,GAAGJ;IAE1BA,MAAMpB,IAAI,CAACyB,SAAS,GAAGC,IAAAA,6BAAAA,EAAa5B,yBAAyBE,IAAI,EAAEqB,mBAAmBD,MAAMpB,IAAI,CAACyB,SAAS;IAE1G,IAAIL,MAAMnB,QAAQ,EAAE;QAClBmB,MAAMnB,QAAQ,CAACwB,SAAS,GAAGC,IAAAA,6BAAAA,EAAa5B,yBAAyBG,QAAQ,EAAEmB,MAAMnB,QAAQ,CAACwB,SAAS;IACrG;IACA,IAAIL,MAAMlB,WAAW,EAAE;QACrBkB,MAAMlB,WAAW,CAACuB,SAAS,GAAGC,IAAAA,6BAAAA,EAC5B5B,yBAAyBI,WAAW,EACpCsB,kBAAkB,UAAUD,8BAA8BL,YAAY,EACtEE,MAAMlB,WAAW,CAACuB,SAAS;IAE/B;IAEA,IAAIL,MAAMjB,kBAAkB,EAAE;QAC5BiB,MAAMjB,kBAAkB,CAACsB,SAAS,GAAGC,IAAAA,6BAAAA,EACnC5B,yBAAyBK,kBAAkB,EAC3CmB,6BACAF,MAAMjB,kBAAkB,CAACsB,SAAS;IAEtC;IAEA,OAAOL;AACT"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "AttachmentOverflowMenu", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return AttachmentOverflowMenu;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _useAttachmentOverflowMenu = require("./useAttachmentOverflowMenu");
|
|
12
|
+
const _renderAttachmentOverflowMenu = require("./renderAttachmentOverflowMenu");
|
|
13
|
+
const _useAttachmentOverflowMenuContextValues = require("./useAttachmentOverflowMenuContextValues");
|
|
14
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
15
|
+
const AttachmentOverflowMenu = (props)=>{
|
|
16
|
+
const state = (0, _useAttachmentOverflowMenu.useAttachmentOverflowMenu_unstable)(props);
|
|
17
|
+
const menuContextValues = (0, _reactcomponents.useMenuContextValues_unstable)(state);
|
|
18
|
+
const attachmentOverflowMenuContextValues = (0, _useAttachmentOverflowMenuContextValues.useAttachmentOverflowMenuContextValues_unstable)(state);
|
|
19
|
+
return (0, _renderAttachmentOverflowMenu.renderAttachmentOverflowMenu_unstable)(state, {
|
|
20
|
+
menuContextValues,
|
|
21
|
+
attachmentOverflowMenuContextValues
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
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":["AttachmentOverflowMenu","props","state","useAttachmentOverflowMenu_unstable","menuContextValues","useMenuContextValues_unstable","attachmentOverflowMenuContextValues","useAttachmentOverflowMenuContextValues_unstable","renderAttachmentOverflowMenu_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAOaA;;;eAAAA;;;2CANsC;8CACG;wDACU;iCAClB;AAGvC,MAAMA,yBAAgEC,CAAAA;IAC3E,MAAMC,QAAQC,IAAAA,6DAAAA,EAAmCF;IACjD,MAAMG,oBAAoBC,IAAAA,8CAAAA,EAA8BH;IACxD,MAAMI,sCAAsCC,IAAAA,uFAAAA,EAAgDL;IAE5F,OAAOM,IAAAA,mEAAAA,EAAsCN,OAAO;QAAEE;QAAmBE;IAAoC;AAC/G;AAEAN,uBAAuBS,WAAW,GAAG"}
|
|
@@ -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":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
AttachmentOverflowMenu: function() {
|
|
13
|
+
return _AttachmentOverflowMenu.AttachmentOverflowMenu;
|
|
14
|
+
},
|
|
15
|
+
renderAttachmentOverflowMenu_unstable: function() {
|
|
16
|
+
return _renderAttachmentOverflowMenu.renderAttachmentOverflowMenu_unstable;
|
|
17
|
+
},
|
|
18
|
+
useAttachmentOverflowMenuContextValues_unstable: function() {
|
|
19
|
+
return _useAttachmentOverflowMenuContextValues.useAttachmentOverflowMenuContextValues_unstable;
|
|
20
|
+
},
|
|
21
|
+
useAttachmentOverflowMenu_unstable: function() {
|
|
22
|
+
return _useAttachmentOverflowMenu.useAttachmentOverflowMenu_unstable;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
const _AttachmentOverflowMenu = require("./AttachmentOverflowMenu");
|
|
26
|
+
const _renderAttachmentOverflowMenu = require("./renderAttachmentOverflowMenu");
|
|
27
|
+
const _useAttachmentOverflowMenu = require("./useAttachmentOverflowMenu");
|
|
28
|
+
const _useAttachmentOverflowMenuContextValues = require("./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","useAttachmentOverflowMenuContextValues_unstable","useAttachmentOverflowMenu_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,sBAAsB;eAAtBA,8CAAsB;;IAEtBC,qCAAqC;eAArCA,mEAAqC;;IAErCC,+CAA+C;eAA/CA,uFAA+C;;IAD/CC,kCAAkC;eAAlCA,6DAAkC;;;wCAHJ;8CAEe;2CACH;wDACa"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderAttachmentOverflowMenu_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return renderAttachmentOverflowMenu_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
|
12
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
13
|
+
const _attachmentOverflowMenuContext = require("../../contexts/attachmentOverflowMenuContext");
|
|
14
|
+
const renderAttachmentOverflowMenu_unstable = (state, contextValues)=>{
|
|
15
|
+
const { menuContextValues, attachmentOverflowMenuContextValues } = contextValues;
|
|
16
|
+
(0, _reactcomponents.assertSlots)(state);
|
|
17
|
+
return state.isOverflowing ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_attachmentOverflowMenuContext.AttachmentOverflowMenuProvider, {
|
|
18
|
+
value: attachmentOverflowMenuContextValues.attachmentOverflowMenu,
|
|
19
|
+
children: (0, _reactcomponents.renderMenu_unstable)(state, menuContextValues)
|
|
20
|
+
}) : null;
|
|
21
|
+
};
|
|
@@ -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":["renderAttachmentOverflowMenu_unstable","state","contextValues","menuContextValues","attachmentOverflowMenuContextValues","assertSlots","isOverflowing","_jsx","AttachmentOverflowMenuProvider","value","attachmentOverflowMenu","renderMenu_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgBaA;;;eAAAA;;;4BAfb;iCAEiD;+CAEF;AAWxC,MAAMA,wCAAwC,CACnDC,OACAC;IAKA,MAAM,EAAEC,iBAAiB,EAAEC,mCAAmC,EAAE,GAAGF;IACnEG,IAAAA,4BAAAA,EAAyCJ;IAEzC,OAAOA,MAAMK,aAAa,GAAA,WAAA,GACxBC,IAAAA,eAAA,EAACC,6DAAAA,EAAAA;QAA+BC,OAAOL,oCAAoCM,sBAAsB;kBAC9FC,IAAAA,oCAAAA,EAAoBV,OAAOE;SAE5B;AACN"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useAttachmentOverflowMenu_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useAttachmentOverflowMenu_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
12
|
+
const useAttachmentOverflowMenu_unstable = (props)=>{
|
|
13
|
+
const menuState = (0, _reactcomponents.useMenu_unstable)(props);
|
|
14
|
+
const { isOverflowing, ref: overflowButtonRef, overflowCount } = (0, _reactcomponents.useOverflowMenu)();
|
|
15
|
+
return {
|
|
16
|
+
...menuState,
|
|
17
|
+
isOverflowing,
|
|
18
|
+
overflowButtonRef,
|
|
19
|
+
overflowCount
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -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":["useAttachmentOverflowMenu_unstable","props","menuState","useMenu_unstable","isOverflowing","ref","overflowButtonRef","overflowCount","useOverflowMenu"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWaA;;;eAAAA;;;iCAXqC;AAW3C,MAAMA,qCAAqC,CAACC;IACjD,MAAMC,YAAYC,IAAAA,iCAAAA,EAAiBF;IACnC,MAAM,EAAEG,aAAa,EAAEC,KAAKC,iBAAiB,EAAEC,aAAa,EAAE,GAAGC,IAAAA,gCAAAA;IAEjE,OAAO;QACL,GAAGN,SAAS;QACZE;QACAE;QACAC;IACF;AACF"}
|
package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useAttachmentOverflowMenuContextValues_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useAttachmentOverflowMenuContextValues_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
function useAttachmentOverflowMenuContextValues_unstable(state) {
|
|
12
|
+
const { isOverflowing, overflowButtonRef, overflowCount } = state;
|
|
13
|
+
// This context is created with "@fluentui/react-context-selector", there is no sense to memoize it
|
|
14
|
+
const attachmentOverflowMenu = {
|
|
15
|
+
isOverflowing,
|
|
16
|
+
overflowButtonRef,
|
|
17
|
+
overflowCount
|
|
18
|
+
};
|
|
19
|
+
return {
|
|
20
|
+
attachmentOverflowMenu
|
|
21
|
+
};
|
|
22
|
+
}
|
package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js.map
ADDED
|
@@ -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":";;;;+BAEgBA;;;eAAAA;;;AAAT,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,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "AttachmentOverflowMenuButton", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return AttachmentOverflowMenuButton;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _useAttachmentOverflowMenuButton = require("./useAttachmentOverflowMenuButton");
|
|
14
|
+
const _renderAttachmentOverflowMenuButton = require("./renderAttachmentOverflowMenuButton");
|
|
15
|
+
const _useAttachmentOverflowMenuButtonStylesstyles = require("./useAttachmentOverflowMenuButtonStyles.styles");
|
|
16
|
+
const _reactprovider = require("@fluentui-copilot/react-provider");
|
|
17
|
+
const AttachmentOverflowMenuButton = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
18
|
+
const state = (0, _useAttachmentOverflowMenuButton.useAttachmentOverflowMenuButton_unstable)(props, ref);
|
|
19
|
+
(0, _useAttachmentOverflowMenuButtonStylesstyles.useAttachmentOverflowMenuButtonStyles_unstable)(state);
|
|
20
|
+
(0, _reactprovider.useCustomStyleHook)('useAttachmentOverflowMenuButtonStyles')(state);
|
|
21
|
+
return (0, _renderAttachmentOverflowMenuButton.renderAttachmentOverflowMenuButton_unstable)(state);
|
|
22
|
+
});
|
|
23
|
+
AttachmentOverflowMenuButton.displayName = 'AttachmentOverflowMenuButton';
|
package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js.map
ADDED
|
@@ -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":["AttachmentOverflowMenuButton","React","forwardRef","props","ref","state","useAttachmentOverflowMenuButton_unstable","useAttachmentOverflowMenuButtonStyles_unstable","useCustomStyleHook","renderAttachmentOverflowMenuButton_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;iDACkC;oDACG;6DACG;+BAG5B;AAE5B,MAAMA,+BAAAA,WAAAA,GAAuFC,OAAMC,UAAU,CAClH,CAACC,OAAOC;IACN,MAAMC,QAAQC,IAAAA,yEAAAA,EAAyCH,OAAOC;IAE9DG,IAAAA,2FAAAA,EAA+CF;IAC/CG,IAAAA,iCAAAA,EAAmB,yCAAyCH;IAE5D,OAAOI,IAAAA,+EAAAA,EAA4CJ;AACrD;AAGFL,6BAA6BU,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"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
AttachmentOverflowMenuButton: function() {
|
|
13
|
+
return _AttachmentOverflowMenuButton.AttachmentOverflowMenuButton;
|
|
14
|
+
},
|
|
15
|
+
attachmentOverflowMenuButtonClassNames: function() {
|
|
16
|
+
return _useAttachmentOverflowMenuButtonStylesstyles.attachmentOverflowMenuButtonClassNames;
|
|
17
|
+
},
|
|
18
|
+
renderAttachmentOverflowMenuButton_unstable: function() {
|
|
19
|
+
return _renderAttachmentOverflowMenuButton.renderAttachmentOverflowMenuButton_unstable;
|
|
20
|
+
},
|
|
21
|
+
useAttachmentOverflowMenuButtonStyles_unstable: function() {
|
|
22
|
+
return _useAttachmentOverflowMenuButtonStylesstyles.useAttachmentOverflowMenuButtonStyles_unstable;
|
|
23
|
+
},
|
|
24
|
+
useAttachmentOverflowMenuButton_unstable: function() {
|
|
25
|
+
return _useAttachmentOverflowMenuButton.useAttachmentOverflowMenuButton_unstable;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const _AttachmentOverflowMenuButton = require("./AttachmentOverflowMenuButton");
|
|
29
|
+
const _renderAttachmentOverflowMenuButton = require("./renderAttachmentOverflowMenuButton");
|
|
30
|
+
const _useAttachmentOverflowMenuButton = require("./useAttachmentOverflowMenuButton");
|
|
31
|
+
const _useAttachmentOverflowMenuButtonStylesstyles = require("./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","attachmentOverflowMenuButtonClassNames","renderAttachmentOverflowMenuButton_unstable","useAttachmentOverflowMenuButtonStyles_unstable","useAttachmentOverflowMenuButton_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,4BAA4B;eAA5BA,0DAA4B;;IAI5BC,sCAAsC;eAAtCA,mFAAsC;;IAFtCC,2CAA2C;eAA3CA,+EAA2C;;IAEHC,8CAA8C;eAA9CA,2FAA8C;;IADtFC,wCAAwC;eAAxCA,yEAAwC;;;8CAHJ;oDAEe;iDACH;6DAC8C"}
|
package/lib-commonjs/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "renderAttachmentOverflowMenuButton_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return renderAttachmentOverflowMenuButton_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
|
12
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
13
|
+
const renderAttachmentOverflowMenuButton_unstable = (state)=>{
|
|
14
|
+
(0, _reactcomponents.assertSlots)(state);
|
|
15
|
+
return state.isOverflowing ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactcomponents.MenuTrigger, {
|
|
16
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
|
|
17
|
+
children: [
|
|
18
|
+
state.root.children,
|
|
19
|
+
state.isLoading && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.progress, {})
|
|
20
|
+
]
|
|
21
|
+
})
|
|
22
|
+
}) : null;
|
|
23
|
+
};
|
|
@@ -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":["renderAttachmentOverflowMenuButton_unstable","state","assertSlots","isOverflowing","_jsx","MenuTrigger","_jsxs","root","children","isLoading","progress"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAaaA;;;eAAAA;;;4BAZb;iCAEyC;AAUlC,MAAMA,8CAA8C,CACzDC;IAEAC,IAAAA,4BAAAA,EAA+CD;IAE/C,OAAOA,MAAME,aAAa,GAAA,WAAA,GACxBC,IAAAA,eAAA,EAACC,4BAAAA,EAAAA;kBACC,WAAA,GAAAC,IAAAA,gBAAA,EAACL,MAAMM,IAAI,EAAA;;gBACRN,MAAMM,IAAI,CAACC,QAAQ;gBACnBP,MAAMQ,SAAS,IAAA,WAAA,GAAIL,IAAAA,eAAA,EAACH,MAAMS,QAAQ,EAAA,CAAA;;;SAGrC;AACN"}
|