@fluentui-copilot/react-attachments 0.0.0-nightly-20250716-0405-895dbbbf.1 → 0.0.0-nightly-20250717-0405-eecbae35.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/lib/AgentTag.js +0 -1
- package/lib/Attachment.js +0 -1
- package/lib/AttachmentList.js +0 -1
- package/lib/AttachmentOverflowMenu.js +0 -1
- package/lib/AttachmentOverflowMenuButton.js +0 -1
- package/lib/AttachmentOverflowMenuItem.js +0 -1
- package/lib/components/AgentTag/AgentTag.js +4 -5
- package/lib/components/AgentTag/AgentTag.types.js +1 -2
- package/lib/components/AgentTag/index.js +0 -1
- package/lib/components/AgentTag/renderAgentTag.js +3 -5
- package/lib/components/AgentTag/useAgentTag.js +7 -9
- package/lib/components/Attachment/Attachment.js +5 -6
- package/lib/components/Attachment/Attachment.types.js +1 -2
- package/lib/components/Attachment/index.js +0 -1
- package/lib/components/Attachment/renderAttachment.js +36 -31
- package/lib/components/Attachment/useAttachment.js +85 -95
- package/lib/components/AttachmentList/AttachmentList.js +6 -7
- package/lib/components/AttachmentList/AttachmentList.types.js +1 -2
- package/lib/components/AttachmentList/index.js +0 -1
- package/lib/components/AttachmentList/renderAttachmentList.js +25 -25
- package/lib/components/AttachmentList/useAttachmentList.js +113 -124
- package/lib/components/AttachmentList/useAttachmentListContextValues.js +10 -15
- package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js +8 -9
- package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js +1 -2
- package/lib/components/AttachmentOverflowMenu/index.js +0 -1
- package/lib/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js +8 -13
- package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js +9 -15
- package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js +10 -15
- package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js +5 -6
- package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js +1 -2
- package/lib/components/AttachmentOverflowMenuButton/index.js +0 -1
- package/lib/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js +11 -10
- package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +51 -59
- package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js +4 -5
- package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js +1 -2
- package/lib/components/AttachmentOverflowMenuItem/index.js +0 -1
- package/lib/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js +9 -8
- package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +41 -49
- package/lib/components/index.js +0 -1
- package/lib/contexts/attachmentListContext.js +4 -5
- package/lib/contexts/attachmentOverflowMenuContext.js +4 -5
- package/lib/index.js +0 -1
- package/lib-commonjs/AgentTag.js +0 -1
- package/lib-commonjs/Attachment.js +0 -1
- package/lib-commonjs/AttachmentList.js +0 -1
- package/lib-commonjs/AttachmentOverflowMenu.js +0 -1
- package/lib-commonjs/AttachmentOverflowMenuButton.js +0 -1
- package/lib-commonjs/AttachmentOverflowMenuItem.js +0 -1
- package/lib-commonjs/components/AgentTag/AgentTag.js +1 -1
- package/lib-commonjs/components/AgentTag/AgentTag.js.map +1 -1
- package/lib-commonjs/components/AgentTag/AgentTag.types.js +0 -1
- package/lib-commonjs/components/AgentTag/index.js +0 -1
- package/lib-commonjs/components/AgentTag/renderAgentTag.js +1 -1
- package/lib-commonjs/components/AgentTag/renderAgentTag.js.map +1 -1
- package/lib-commonjs/components/AgentTag/useAgentTag.js +1 -1
- package/lib-commonjs/components/AgentTag/useAgentTag.js.map +1 -1
- package/lib-commonjs/components/Attachment/Attachment.js +1 -1
- package/lib-commonjs/components/Attachment/Attachment.js.map +1 -1
- package/lib-commonjs/components/Attachment/Attachment.types.js +0 -1
- package/lib-commonjs/components/Attachment/index.js +0 -1
- package/lib-commonjs/components/Attachment/renderAttachment.js +1 -1
- package/lib-commonjs/components/Attachment/renderAttachment.js.map +1 -1
- package/lib-commonjs/components/Attachment/useAttachment.js +1 -1
- package/lib-commonjs/components/Attachment/useAttachment.js.map +1 -1
- package/lib-commonjs/components/AttachmentList/AttachmentList.js +1 -1
- package/lib-commonjs/components/AttachmentList/AttachmentList.js.map +1 -1
- package/lib-commonjs/components/AttachmentList/AttachmentList.types.js +0 -1
- package/lib-commonjs/components/AttachmentList/index.js +0 -1
- package/lib-commonjs/components/AttachmentList/renderAttachmentList.js +1 -1
- package/lib-commonjs/components/AttachmentList/renderAttachmentList.js.map +1 -1
- package/lib-commonjs/components/AttachmentList/useAttachmentList.js +1 -1
- package/lib-commonjs/components/AttachmentList/useAttachmentList.js.map +1 -1
- package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js +1 -1
- package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js +0 -1
- package/lib-commonjs/components/AttachmentOverflowMenu/index.js +0 -1
- package/lib-commonjs/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js +0 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/index.js +0 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js +0 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/index.js +0 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js.map +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +1 -1
- package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js.map +1 -1
- package/lib-commonjs/components/index.js +0 -1
- package/lib-commonjs/contexts/attachmentListContext.js +1 -1
- package/lib-commonjs/contexts/attachmentListContext.js.map +1 -1
- package/lib-commonjs/contexts/attachmentOverflowMenuContext.js +1 -1
- package/lib-commonjs/contexts/attachmentOverflowMenuContext.js.map +1 -1
- package/lib-commonjs/index.js +0 -1
- package/package.json +4 -4
package/CHANGELOG.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"name": "@fluentui-copilot/react-attachments",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
6
|
-
"tag": "@fluentui-copilot/react-attachments_v0.0.0-nightly-
|
|
7
|
-
"version": "0.0.0-nightly-
|
|
5
|
+
"date": "Thu, 17 Jul 2025 04:13:01 GMT",
|
|
6
|
+
"tag": "@fluentui-copilot/react-attachments_v0.0.0-nightly-20250717-0405-eecbae35.1",
|
|
7
|
+
"version": "0.0.0-nightly-20250717-0405-eecbae35.1",
|
|
8
8
|
"comments": {
|
|
9
9
|
"prerelease": [
|
|
10
10
|
{
|
package/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Change Log - @fluentui-copilot/react-attachments
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 17 Jul 2025 04:13:01 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [0.0.0-nightly-
|
|
7
|
+
## [0.0.0-nightly-20250717-0405-eecbae35.1](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.0.0-nightly-20250717-0405-eecbae35.1)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-attachments_v0.13.2..@fluentui-copilot/react-attachments_v0.0.0-nightly-
|
|
9
|
+
Thu, 17 Jul 2025 04:13:01 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-attachments_v0.13.2..@fluentui-copilot/react-attachments_v0.0.0-nightly-20250717-0405-eecbae35.1)
|
|
11
11
|
|
|
12
12
|
### Changes
|
|
13
13
|
|
package/lib/AgentTag.js
CHANGED
package/lib/Attachment.js
CHANGED
package/lib/AttachmentList.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
1
|
export { AttachmentOverflowMenuButton, attachmentOverflowMenuButtonClassNames, renderAttachmentOverflowMenuButton_unstable, useAttachmentOverflowMenuButtonStyles_unstable, useAttachmentOverflowMenuButton_unstable } from './components/AttachmentOverflowMenuButton/index';
|
|
2
|
-
//# sourceMappingURL=AttachmentOverflowMenuButton.js.map
|
|
@@ -1,2 +1 @@
|
|
|
1
1
|
export { AttachmentOverflowMenuItem, attachmentOverflowMenuItemClassNames, renderAttachmentOverflowMenuItem_unstable, useAttachmentOverflowMenuItemStyles_unstable, useAttachmentOverflowMenuItem_unstable } from './components/AttachmentOverflowMenuItem/index';
|
|
2
|
-
//# sourceMappingURL=AttachmentOverflowMenuItem.js.map
|
|
@@ -3,10 +3,9 @@ import { useAgentTag_unstable } from './useAgentTag';
|
|
|
3
3
|
import { renderAgentTag_unstable } from './renderAgentTag';
|
|
4
4
|
import { useAgentTagStyles_unstable } from './useAgentTagStyles.styles';
|
|
5
5
|
// AgentTag component - TODO: add more docs
|
|
6
|
-
export const AgentTag = /*#__PURE__*/React.forwardRef((props, ref)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
export const AgentTag = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
7
|
+
const state = useAgentTag_unstable(props, ref);
|
|
8
|
+
useAgentTagStyles_unstable(state);
|
|
9
|
+
return renderAgentTag_unstable(state);
|
|
10
10
|
});
|
|
11
11
|
AgentTag.displayName = 'AgentTag';
|
|
12
|
-
//# sourceMappingURL=AgentTag.js.map
|
|
@@ -2,4 +2,3 @@ export { AgentTag } from './AgentTag';
|
|
|
2
2
|
export { renderAgentTag_unstable } from './renderAgentTag';
|
|
3
3
|
export { useAgentTag_unstable } from './useAgentTag';
|
|
4
4
|
export { agentTagClassNames, useAgentTagStyles_unstable } from './useAgentTagStyles.styles';
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { renderAttachment_unstable } from '../Attachment';
|
|
1
|
+
import { renderAttachment_unstable } from '../Attachment';
|
|
2
2
|
/**
|
|
3
3
|
* Render the final JSX of AgentTag
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
return renderAttachment_unstable(state);
|
|
4
|
+
*/ export const renderAgentTag_unstable = (state)=>{
|
|
5
|
+
return renderAttachment_unstable(state);
|
|
7
6
|
};
|
|
8
|
-
//# sourceMappingURL=renderAgentTag.js.map
|
|
@@ -8,13 +8,11 @@ import { useAttachment_unstable } from '..';
|
|
|
8
8
|
*
|
|
9
9
|
* @param props - props from this instance of AgentTag
|
|
10
10
|
* @param ref - reference to root HTMLElement of AgentTag
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return state;
|
|
11
|
+
*/ export const useAgentTag_unstable = (props, ref)=>{
|
|
12
|
+
const state = useAttachment_unstable({
|
|
13
|
+
...props,
|
|
14
|
+
dismissOnly: true,
|
|
15
|
+
designVersion: 'next'
|
|
16
|
+
}, ref);
|
|
17
|
+
return state;
|
|
19
18
|
};
|
|
20
|
-
//# sourceMappingURL=useAgentTag.js.map
|
|
@@ -4,11 +4,10 @@ import { renderAttachment_unstable } from './renderAttachment';
|
|
|
4
4
|
import { useAttachmentStyles_unstable } from './useAttachmentStyles.styles';
|
|
5
5
|
import { useCustomStyleHook } from '@fluentui-copilot/react-provider';
|
|
6
6
|
// Attachment component - TODO: add more docs
|
|
7
|
-
export const Attachment = /*#__PURE__*/React.forwardRef((props, ref)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
export const Attachment = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
8
|
+
const state = useAttachment_unstable(props, ref);
|
|
9
|
+
useAttachmentStyles_unstable(state);
|
|
10
|
+
useCustomStyleHook('useAttachmentStyles')(state);
|
|
11
|
+
return renderAttachment_unstable(state);
|
|
12
12
|
});
|
|
13
13
|
Attachment.displayName = 'Attachment';
|
|
14
|
-
//# sourceMappingURL=Attachment.js.map
|
|
@@ -2,4 +2,3 @@ export { Attachment } from './Attachment';
|
|
|
2
2
|
export { renderAttachment_unstable } from './renderAttachment';
|
|
3
3
|
export { useAttachment_unstable } from './useAttachment';
|
|
4
4
|
export { attachmentClassNames, useAttachmentStyles_unstable, useOverflowStyles } from './useAttachmentStyles.styles';
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,37 +1,42 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { OverflowItem, assertSlots } from '@fluentui/react-components';
|
|
3
3
|
/**
|
|
4
4
|
* Render the final JSX of Attachment
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
} = state;
|
|
13
|
-
const attachment = designVersion === 'next' && dismissOnly ? renderDismissOnly(state) : renderAttachment(state);
|
|
14
|
-
return shouldUseOverflow ? /*#__PURE__*/_jsx(OverflowItem, {
|
|
15
|
-
id: id,
|
|
16
|
-
children: attachment
|
|
17
|
-
}, id) : attachment;
|
|
5
|
+
*/ export const renderAttachment_unstable = (state)=>{
|
|
6
|
+
const { id, shouldUseOverflow, designVersion, dismissOnly } = state;
|
|
7
|
+
const attachment = designVersion === 'next' && dismissOnly ? renderDismissOnly(state) : renderAttachment(state);
|
|
8
|
+
return shouldUseOverflow ? /*#__PURE__*/ _jsx(OverflowItem, {
|
|
9
|
+
id: id,
|
|
10
|
+
children: attachment
|
|
11
|
+
}, id) : attachment;
|
|
18
12
|
};
|
|
19
|
-
const renderAttachment = state
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
13
|
+
const renderAttachment = (state)=>{
|
|
14
|
+
assertSlots(state);
|
|
15
|
+
return /*#__PURE__*/ _jsxs(state.root, {
|
|
16
|
+
children: [
|
|
17
|
+
/*#__PURE__*/ _jsxs(state.primaryAction, {
|
|
18
|
+
children: [
|
|
19
|
+
state.media && !state.imageOnly && /*#__PURE__*/ _jsx(state.media, {}),
|
|
20
|
+
/*#__PURE__*/ _jsx(state.content, {}),
|
|
21
|
+
state.progress && /*#__PURE__*/ _jsx(state.progress, {})
|
|
22
|
+
]
|
|
23
|
+
}),
|
|
24
|
+
/*#__PURE__*/ _jsx(state.dismissButton, {
|
|
25
|
+
children: /*#__PURE__*/ _jsx(state.dismissIcon, {})
|
|
26
|
+
})
|
|
27
|
+
]
|
|
28
|
+
});
|
|
28
29
|
};
|
|
29
|
-
const renderDismissOnly = state
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
30
|
+
const renderDismissOnly = (state)=>{
|
|
31
|
+
assertSlots(state);
|
|
32
|
+
return /*#__PURE__*/ _jsx(state.root, {
|
|
33
|
+
children: /*#__PURE__*/ _jsxs(state.dismissButton, {
|
|
34
|
+
children: [
|
|
35
|
+
state.media && !state.imageOnly && /*#__PURE__*/ _jsx(state.media, {}),
|
|
36
|
+
/*#__PURE__*/ _jsx(state.content, {}),
|
|
37
|
+
state.progress && /*#__PURE__*/ _jsx(state.progress, {}),
|
|
38
|
+
/*#__PURE__*/ _jsx(state.dismissIcon, {})
|
|
39
|
+
]
|
|
40
|
+
})
|
|
41
|
+
});
|
|
36
42
|
};
|
|
37
|
-
//# sourceMappingURL=renderAttachment.js.map
|
|
@@ -11,100 +11,90 @@ import { useCopilotMode, useDesignVersion } from '@fluentui-copilot/react-provid
|
|
|
11
11
|
*
|
|
12
12
|
* @param props - props from this instance of Attachment
|
|
13
13
|
* @param ref - reference to root HTMLElement of Attachment
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const isLoading = !!props.progress;
|
|
28
|
-
const mode = useCopilotMode(props.mode);
|
|
29
|
-
const designVersion = useDesignVersion(props.designVersion);
|
|
30
|
-
const root = slot.always(getIntrinsicElementProps('div', {
|
|
31
|
-
ref,
|
|
32
|
-
...props,
|
|
33
|
-
id: attachmentId
|
|
34
|
-
}), {
|
|
35
|
-
elementType: 'div'
|
|
36
|
-
});
|
|
37
|
-
const primaryAction = slot.always(props.primaryAction, {
|
|
38
|
-
defaultProps: {
|
|
39
|
-
as: dismissOnly ? 'span' : undefined
|
|
40
|
-
},
|
|
41
|
-
elementType: 'button'
|
|
42
|
-
});
|
|
43
|
-
const dismissButton = slot.always(props.dismissButton, {
|
|
44
|
-
defaultProps: {
|
|
45
|
-
'aria-label': 'Remove attachment'
|
|
46
|
-
},
|
|
47
|
-
elementType: 'button'
|
|
48
|
-
});
|
|
49
|
-
dismissButton.onClick = mergeCallbacks(dismissButton.onClick, ev => {
|
|
50
|
-
onAttachmentDismiss === null || onAttachmentDismiss === void 0 ? void 0 : onAttachmentDismiss(ev, {
|
|
51
|
-
content: children,
|
|
52
|
-
media,
|
|
53
|
-
id: attachmentId
|
|
14
|
+
*/ export const useAttachment_unstable = (props, ref)=>{
|
|
15
|
+
const { children, imageOnly, size = 'medium', dismissOnly = false } = props;
|
|
16
|
+
const { onAttachmentDismiss, shouldUseOverflow } = useAttachmentListContext_unstable((context)=>context);
|
|
17
|
+
const attachmentId = useId('attachment-', props.id);
|
|
18
|
+
const isLoading = !!props.progress;
|
|
19
|
+
const mode = useCopilotMode(props.mode);
|
|
20
|
+
const designVersion = useDesignVersion(props.designVersion);
|
|
21
|
+
const root = slot.always(getIntrinsicElementProps('div', {
|
|
22
|
+
ref,
|
|
23
|
+
...props,
|
|
24
|
+
id: attachmentId
|
|
25
|
+
}), {
|
|
26
|
+
elementType: 'div'
|
|
54
27
|
});
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
28
|
+
const primaryAction = slot.always(props.primaryAction, {
|
|
29
|
+
defaultProps: {
|
|
30
|
+
as: dismissOnly ? 'span' : undefined
|
|
31
|
+
},
|
|
32
|
+
elementType: 'button'
|
|
33
|
+
});
|
|
34
|
+
const dismissButton = slot.always(props.dismissButton, {
|
|
35
|
+
defaultProps: {
|
|
36
|
+
'aria-label': 'Remove attachment'
|
|
37
|
+
},
|
|
38
|
+
elementType: 'button'
|
|
39
|
+
});
|
|
40
|
+
dismissButton.onClick = mergeCallbacks(dismissButton.onClick, (ev)=>{
|
|
41
|
+
onAttachmentDismiss === null || onAttachmentDismiss === void 0 ? void 0 : onAttachmentDismiss(ev, {
|
|
42
|
+
content: children,
|
|
43
|
+
media,
|
|
44
|
+
id: attachmentId
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
const media = slot.optional(props.media, {
|
|
48
|
+
elementType: 'span'
|
|
49
|
+
});
|
|
50
|
+
const content = slot.always(props.content, {
|
|
51
|
+
defaultProps: {
|
|
52
|
+
children: props.children
|
|
53
|
+
},
|
|
54
|
+
elementType: 'span'
|
|
55
|
+
});
|
|
56
|
+
const dismissIcon = slot.always(props.dismissIcon, {
|
|
57
|
+
defaultProps: {
|
|
58
|
+
children: size === 'small' ? /*#__PURE__*/ React.createElement(Dismiss12Regular, null) : /*#__PURE__*/ React.createElement(Dismiss20Regular, null)
|
|
59
|
+
},
|
|
60
|
+
elementType: 'span'
|
|
61
|
+
});
|
|
62
|
+
const progress = slot.optional(props.progress, {
|
|
63
|
+
defaultProps: {
|
|
64
|
+
shape: 'square',
|
|
65
|
+
thickness: 'large',
|
|
66
|
+
'aria-labelledby': props.id
|
|
67
|
+
},
|
|
68
|
+
elementType: ProgressBar
|
|
69
|
+
});
|
|
70
|
+
const state = {
|
|
71
|
+
id: attachmentId,
|
|
72
|
+
size,
|
|
73
|
+
components: {
|
|
74
|
+
root: 'div',
|
|
75
|
+
primaryAction: 'button',
|
|
76
|
+
dismissButton: 'button',
|
|
77
|
+
media: 'span',
|
|
78
|
+
content: 'span',
|
|
79
|
+
dismissIcon: 'span',
|
|
80
|
+
progress: ProgressBar
|
|
81
|
+
},
|
|
82
|
+
root,
|
|
83
|
+
primaryAction,
|
|
84
|
+
dismissButton,
|
|
85
|
+
media,
|
|
86
|
+
content,
|
|
87
|
+
dismissIcon,
|
|
88
|
+
progress,
|
|
89
|
+
imageOnly,
|
|
90
|
+
isLoading,
|
|
91
|
+
shouldUseOverflow,
|
|
92
|
+
mode,
|
|
93
|
+
designVersion,
|
|
94
|
+
dismissOnly
|
|
95
|
+
};
|
|
96
|
+
if (state.primaryAction.as === 'span') {
|
|
97
|
+
state.components.primaryAction = 'span';
|
|
98
|
+
}
|
|
99
|
+
return state;
|
|
109
100
|
};
|
|
110
|
-
//# sourceMappingURL=useAttachment.js.map
|
|
@@ -4,12 +4,11 @@ import { renderAttachmentList_unstable } from './renderAttachmentList';
|
|
|
4
4
|
import { useAttachmentListStyles_unstable } from './useAttachmentListStyles.styles';
|
|
5
5
|
import { useAttachmentListContextValues_unstable } from './useAttachmentListContextValues';
|
|
6
6
|
import { useCustomStyleHook } from '@fluentui-copilot/react-provider';
|
|
7
|
-
export const AttachmentList = /*#__PURE__*/React.forwardRef((props, ref)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
export const AttachmentList = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
8
|
+
const state = useAttachmentList_unstable(props, ref);
|
|
9
|
+
const contextValues = useAttachmentListContextValues_unstable(state);
|
|
10
|
+
useAttachmentListStyles_unstable(state);
|
|
11
|
+
useCustomStyleHook('useAttachmentListStyles')(state);
|
|
12
|
+
return renderAttachmentList_unstable(state, contextValues);
|
|
13
13
|
});
|
|
14
14
|
AttachmentList.displayName = 'AttachmentList';
|
|
15
|
-
//# sourceMappingURL=AttachmentList.js.map
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=AttachmentList.types.js.map
|
|
1
|
+
export { };
|
|
@@ -2,4 +2,3 @@ export { AttachmentList } from './AttachmentList';
|
|
|
2
2
|
export { renderAttachmentList_unstable } from './renderAttachmentList';
|
|
3
3
|
export { useAttachmentList_unstable } from './useAttachmentList';
|
|
4
4
|
export { attachmentListClassNames, useAttachmentListStyles_unstable } from './useAttachmentListStyles.styles';
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { Overflow, assertSlots } from '@fluentui/react-components';
|
|
3
3
|
import { AttachmentListProvider } from '../../contexts/attachmentListContext';
|
|
4
4
|
import { AttachmentOverflowMenu } from '../AttachmentOverflowMenu';
|
|
5
5
|
/**
|
|
6
6
|
* Render the final JSX of AttachmentList
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
7
|
+
*/ export const renderAttachmentList_unstable = (state, contextValues)=>{
|
|
8
|
+
assertSlots(state);
|
|
9
|
+
const { overflowMenuProps, root, shouldUseOverflow } = state;
|
|
10
|
+
return /*#__PURE__*/ _jsx(AttachmentListProvider, {
|
|
11
|
+
value: contextValues.attachmentList,
|
|
12
|
+
children: shouldUseOverflow && state.overflowMenuButton && state.menuList && state.menuPopover ? /*#__PURE__*/ _jsx(Overflow, {
|
|
13
|
+
ref: root.ref,
|
|
14
|
+
children: /*#__PURE__*/ _jsxs(state.root, {
|
|
15
|
+
children: [
|
|
16
|
+
root.children,
|
|
17
|
+
/*#__PURE__*/ _jsxs(AttachmentOverflowMenu, {
|
|
18
|
+
positioning: 'above',
|
|
19
|
+
...overflowMenuProps,
|
|
20
|
+
children: [
|
|
21
|
+
/*#__PURE__*/ _jsx(state.overflowMenuButton, {}),
|
|
22
|
+
/*#__PURE__*/ _jsx(state.menuPopover, {
|
|
23
|
+
children: /*#__PURE__*/ _jsx(state.menuList, {})
|
|
24
|
+
})
|
|
25
|
+
]
|
|
26
|
+
})
|
|
27
|
+
]
|
|
28
|
+
})
|
|
29
|
+
}) : /*#__PURE__*/ _jsx(state.root, {})
|
|
30
|
+
});
|
|
30
31
|
};
|
|
31
|
-
//# sourceMappingURL=renderAttachmentList.js.map
|