@fluentui-copilot/react-attachments 0.9.6 → 0.9.7
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 +16 -1
- package/CHANGELOG.md +11 -2
- package/lib/components/Attachment/useAttachment.js +2 -3
- package/lib/components/Attachment/useAttachment.js.map +1 -1
- package/lib-commonjs/components/Attachment/useAttachment.js +1 -2
- package/lib-commonjs/components/Attachment/useAttachment.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,22 @@
|
|
|
2
2
|
"name": "@fluentui-copilot/react-attachments",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Thu, 01 Aug 2024 22:27:53 GMT",
|
|
6
|
+
"tag": "@fluentui-copilot/react-attachments_v0.9.7",
|
|
7
|
+
"version": "0.9.7",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "tristan.watanabe@gmail.com",
|
|
12
|
+
"package": "@fluentui-copilot/react-attachments",
|
|
13
|
+
"commit": "1a6d72179dfecdfdefc1a10ab8188e22a733f0b4",
|
|
14
|
+
"comment": "fix: remove usage of bundleIcon to address issue that required two clicks to dismiss an Attachment."
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Tue, 23 Jul 2024 00:56:25 GMT",
|
|
6
21
|
"tag": "@fluentui-copilot/react-attachments_v0.9.6",
|
|
7
22
|
"version": "0.9.6",
|
|
8
23
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
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, 01 Aug 2024 22:27:53 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [0.9.7](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.9.7)
|
|
8
|
+
|
|
9
|
+
Thu, 01 Aug 2024 22:27:53 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-attachments_v0.9.6..@fluentui-copilot/react-attachments_v0.9.7)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- fix: remove usage of bundleIcon to address issue that required two clicks to dismiss an Attachment. ([PR #1919](https://github.com/microsoft/fluentai/pull/1919) by tristan.watanabe@gmail.com)
|
|
15
|
+
|
|
7
16
|
## [0.9.6](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-attachments_v0.9.6)
|
|
8
17
|
|
|
9
|
-
Tue, 23 Jul 2024 00:
|
|
18
|
+
Tue, 23 Jul 2024 00:56:25 GMT
|
|
10
19
|
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-attachments_v0.9.5..@fluentui-copilot/react-attachments_v0.9.6)
|
|
11
20
|
|
|
12
21
|
### Patches
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ProgressBar, getIntrinsicElementProps, mergeCallbacks, slot, useId } from '@fluentui/react-components';
|
|
3
|
-
import { Dismiss20Regular
|
|
3
|
+
import { Dismiss20Regular } from '@fluentui/react-icons';
|
|
4
4
|
import { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';
|
|
5
5
|
/**
|
|
6
6
|
* Create the state required to render Attachment.
|
|
@@ -16,7 +16,6 @@ export const useAttachment_unstable = (props, ref) => {
|
|
|
16
16
|
children,
|
|
17
17
|
imageOnly
|
|
18
18
|
} = props;
|
|
19
|
-
const DismissIcon = bundleIcon(Dismiss20Filled, Dismiss20Regular);
|
|
20
19
|
const {
|
|
21
20
|
onAttachmentDismiss,
|
|
22
21
|
shouldUseOverflow
|
|
@@ -57,7 +56,7 @@ export const useAttachment_unstable = (props, ref) => {
|
|
|
57
56
|
});
|
|
58
57
|
const dismissIcon = slot.always(props.dismissIcon, {
|
|
59
58
|
defaultProps: {
|
|
60
|
-
children: /*#__PURE__*/React.createElement(
|
|
59
|
+
children: /*#__PURE__*/React.createElement(Dismiss20Regular, null)
|
|
61
60
|
},
|
|
62
61
|
elementType: 'span'
|
|
63
62
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachment.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ProgressBar, getIntrinsicElementProps, mergeCallbacks, slot, useId } from '@fluentui/react-components';\nimport { Dismiss20Regular
|
|
1
|
+
{"version":3,"sources":["useAttachment.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ProgressBar, getIntrinsicElementProps, mergeCallbacks, slot, useId } from '@fluentui/react-components';\nimport { Dismiss20Regular } from '@fluentui/react-icons';\nimport { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';\nimport type { AttachmentProps, AttachmentState } from './Attachment.types';\n\n/**\n * Create the state required to render Attachment.\n *\n * The returned state can be modified with hooks such as useAttachmentStyles_unstable,\n * before being passed to renderAttachment_unstable.\n *\n * @param props - props from this instance of Attachment\n * @param ref - reference to root HTMLElement of Attachment\n */\nexport const useAttachment_unstable = (props: AttachmentProps, ref: React.Ref<HTMLDivElement>): AttachmentState => {\n const { children, imageOnly } = props;\n const { onAttachmentDismiss, shouldUseOverflow } = useAttachmentListContext_unstable(context => context);\n const attachmentId = useId('attachment-', props.id);\n const isLoading = !!props.progress;\n\n const root = slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n id: attachmentId,\n }),\n { elementType: 'div' },\n );\n\n const primaryAction = slot.always(props.primaryAction, {\n elementType: 'button',\n });\n\n const dismissButton = slot.always(props.dismissButton, {\n defaultProps: { 'aria-label': 'Dismiss' },\n elementType: 'button',\n });\n\n dismissButton.onClick = mergeCallbacks(\n dismissButton.onClick as React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>,\n (ev: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n onAttachmentDismiss?.(ev, { content: children, media, id: attachmentId });\n },\n );\n\n const media = slot.optional(props.media, { elementType: 'span' });\n\n const content = slot.always(props.content, {\n defaultProps: {\n children: props.children,\n },\n elementType: 'span',\n });\n\n const dismissIcon = slot.always(props.dismissIcon, {\n defaultProps: {\n children: <Dismiss20Regular />,\n },\n elementType: 'span',\n });\n\n const progress = slot.optional(props.progress, {\n defaultProps: {\n shape: 'square',\n thickness: 'large',\n 'aria-labelledby': props.id,\n },\n elementType: ProgressBar,\n });\n\n const state: AttachmentState = {\n id: attachmentId,\n components: {\n root: 'div',\n primaryAction: 'button',\n dismissButton: 'button',\n media: 'span',\n content: 'span',\n dismissIcon: 'span',\n progress: ProgressBar,\n },\n\n root,\n primaryAction,\n dismissButton,\n media,\n content,\n dismissIcon,\n progress,\n imageOnly,\n isLoading,\n shouldUseOverflow,\n };\n\n if (state.primaryAction.as === 'span') {\n state.components.primaryAction = 'span';\n }\n\n return state;\n};\n"],"names":["React","ProgressBar","getIntrinsicElementProps","mergeCallbacks","slot","useId","Dismiss20Regular","useAttachmentListContext_unstable","useAttachment_unstable","props","ref","children","imageOnly","onAttachmentDismiss","shouldUseOverflow","context","attachmentId","id","isLoading","progress","root","always","elementType","primaryAction","dismissButton","defaultProps","onClick","ev","content","media","optional","dismissIcon","shape","thickness","state","components","as"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,WAAW,EAAEC,wBAAwB,EAAEC,cAAc,EAAEC,IAAI,EAAEC,KAAK,QAAQ,6BAA6B;AAChH,SAASC,gBAAgB,QAAQ,wBAAwB;AACzD,SAASC,iCAAiC,QAAQ,uCAAuC;AAGzF;;;;;;;;CAQC,G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IACf;IAEA,MAAMiC,QAAyB;QAC7BjB,IAAID;QACJmB,YAAY;YACVf,MAAM;YACNG,eAAe;YACfC,eAAe;YACfK,OAAO;YACPD,SAAS;YACTG,aAAa;YACbZ,UAAUlB;QACZ;QAEAmB;QACAG;QACAC;QACAK;QACAD;QACAG;QACAZ;QACAP;QACAM;QACAJ;IACF;IAEA,IAAIoB,MAAMX,aAAa,CAACa,EAAE,KAAK,QAAQ;QACrCF,MAAMC,UAAU,CAACZ,aAAa,GAAG;IACnC;IAEA,OAAOW;AACT,EAAE"}
|
|
@@ -15,7 +15,6 @@ const _reacticons = require("@fluentui/react-icons");
|
|
|
15
15
|
const _attachmentListContext = require("../../contexts/attachmentListContext");
|
|
16
16
|
const useAttachment_unstable = (props, ref)=>{
|
|
17
17
|
const { children, imageOnly } = props;
|
|
18
|
-
const DismissIcon = (0, _reacticons.bundleIcon)(_reacticons.Dismiss20Filled, _reacticons.Dismiss20Regular);
|
|
19
18
|
const { onAttachmentDismiss, shouldUseOverflow } = (0, _attachmentListContext.useAttachmentListContext_unstable)((context)=>context);
|
|
20
19
|
const attachmentId = (0, _reactcomponents.useId)('attachment-', props.id);
|
|
21
20
|
const isLoading = !!props.progress;
|
|
@@ -53,7 +52,7 @@ const useAttachment_unstable = (props, ref)=>{
|
|
|
53
52
|
});
|
|
54
53
|
const dismissIcon = _reactcomponents.slot.always(props.dismissIcon, {
|
|
55
54
|
defaultProps: {
|
|
56
|
-
children: /*#__PURE__*/ _react.createElement(
|
|
55
|
+
children: /*#__PURE__*/ _react.createElement(_reacticons.Dismiss20Regular, null)
|
|
57
56
|
},
|
|
58
57
|
elementType: 'span'
|
|
59
58
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useAttachment.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ProgressBar, getIntrinsicElementProps, mergeCallbacks, slot, useId } from '@fluentui/react-components';\nimport { Dismiss20Regular
|
|
1
|
+
{"version":3,"sources":["useAttachment.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ProgressBar, getIntrinsicElementProps, mergeCallbacks, slot, useId } from '@fluentui/react-components';\nimport { Dismiss20Regular } from '@fluentui/react-icons';\nimport { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';\nimport type { AttachmentProps, AttachmentState } from './Attachment.types';\n\n/**\n * Create the state required to render Attachment.\n *\n * The returned state can be modified with hooks such as useAttachmentStyles_unstable,\n * before being passed to renderAttachment_unstable.\n *\n * @param props - props from this instance of Attachment\n * @param ref - reference to root HTMLElement of Attachment\n */\nexport const useAttachment_unstable = (props: AttachmentProps, ref: React.Ref<HTMLDivElement>): AttachmentState => {\n const { children, imageOnly } = props;\n const { onAttachmentDismiss, shouldUseOverflow } = useAttachmentListContext_unstable(context => context);\n const attachmentId = useId('attachment-', props.id);\n const isLoading = !!props.progress;\n\n const root = slot.always(\n getIntrinsicElementProps('div', {\n ref,\n ...props,\n id: attachmentId,\n }),\n { elementType: 'div' },\n );\n\n const primaryAction = slot.always(props.primaryAction, {\n elementType: 'button',\n });\n\n const dismissButton = slot.always(props.dismissButton, {\n defaultProps: { 'aria-label': 'Dismiss' },\n elementType: 'button',\n });\n\n dismissButton.onClick = mergeCallbacks(\n dismissButton.onClick as React.MouseEventHandler<HTMLAnchorElement | HTMLButtonElement>,\n (ev: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement>) => {\n onAttachmentDismiss?.(ev, { content: children, media, id: attachmentId });\n },\n );\n\n const media = slot.optional(props.media, { elementType: 'span' });\n\n const content = slot.always(props.content, {\n defaultProps: {\n children: props.children,\n },\n elementType: 'span',\n });\n\n const dismissIcon = slot.always(props.dismissIcon, {\n defaultProps: {\n children: <Dismiss20Regular />,\n },\n elementType: 'span',\n });\n\n const progress = slot.optional(props.progress, {\n defaultProps: {\n shape: 'square',\n thickness: 'large',\n 'aria-labelledby': props.id,\n },\n elementType: ProgressBar,\n });\n\n const state: AttachmentState = {\n id: attachmentId,\n components: {\n root: 'div',\n primaryAction: 'button',\n dismissButton: 'button',\n media: 'span',\n content: 'span',\n dismissIcon: 'span',\n progress: ProgressBar,\n },\n\n root,\n primaryAction,\n dismissButton,\n media,\n content,\n dismissIcon,\n progress,\n imageOnly,\n isLoading,\n shouldUseOverflow,\n };\n\n if (state.primaryAction.as === 'span') {\n state.components.primaryAction = 'span';\n }\n\n return state;\n};\n"],"names":["children","props","attachmentId","imageOnly","isLoading","ref","useAttachmentListContext_unstable","context","elementType","useId","id","progress","root","primaryAction","slot","always","onAttachmentDismiss","content","media","optional","onClick","ev","defaultProps","dismissIcon","shape","thickness","React","createElement","Dismiss20Regular","components","dismissButton"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgBUA;;;eAAAA;;;;iEAhBa;iCAC4D;4BAClD;uCACiB;AAahD,MAAQA,yBAAwBC,CAAAA,OAAAA;UAChC,EACAD,QAAME,EACNC,SAAMC,KAENH;UAEII,qBACQ,mBACJH,KACNI,IAAAA,wDACA,EAAAC,CAAAA,UAAAA;UAAEC,eAAaC,IAAAA,sBAAA,EAAA,eAAAR,MAAAS,EAAA;UAAMN,YAAA,CAAA,CAAAH,MAAAU,QAAA;UAGvBC,OAAMC,qBAAAA,CAAAA,MAAgBC,CAAAA,IAAAA,yCAAkBD,EAAAA,OAAe;;QAEvD,GAAAZ,KAAA;QAEAS,IAAAR;;qBACkB;;UAChBM,gBAAaM,qBAAA,CAAAC,MAAA,CAAAd,MAAAY,aAAA,EAAA;QACfL,aAAA;;UAKIQ,gBAAAA,qBAAAA,CAAAA,MAAAA,CAAAA,MAAAA,aAAAA,EAAAA;sBAA4BC;0BAAmBC;;qBAAwB;;kBAIrEA,OAAaC,GAAAA,IAAAA,+BAAeD,EAAAA,cAAOE,OAAA,EAAAC,CAAAA;gCAAe,QAAAL,wBAAA,KAAA,IAAA,KAAA,IAAAA,oBAAAK,IAAA;YAAOJ,SAAAjB;YAE/DkB;gBACEI;;;UAGAd,QAAAA,qBAAAA,CAAaW,QAAA,CAAAlB,MAAAiB,KAAA,EAAA;QACfV,aAAA;;UAGEc,UAAAA,qBAAc,CAAAP,MAAA,CAAAd,MAAAgB,OAAA,EAAA;sBACZjB;sBACFC,MAAAD,QAAA;;QAEFQ,aAAA;;UAGEc,cAAcR,qBAAA,CAAAC,MAAA,CAAAd,MAAAsB,WAAA,EAAA;sBACZC;sBACAC,WAAW,GAAAC,OAAAC,aAAA,CAAAC,4BAAA,EAAA;;qBAEb;;UAEFjB,WAAAG,qBAAA,CAAAK,QAAA,CAAAlB,MAAAU,QAAA,EAAA;QAEAW,cAA+B;mBACzBpB;uBACJ2B;+BACQ5B,MAAAS,EAAA;;qBAENoB,4BAAe;;kBAEfb;;oBAEAN;kBACF;2BAEAC;2BACAC;mBACAiB;qBACAZ;yBACAD;sBACAM,4BAAAA;;;;;QAKFL;QAEAD;;QAEAN;QAEAR;QACAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-copilot/react-attachments",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.7",
|
|
4
4
|
"description": "A set of components related to attaching files in Copilot experiences.",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@fluentui-copilot/react-provider": "^0.8.4",
|
|
16
|
-
"@fluentui-copilot/react-utilities": "^0.0.
|
|
16
|
+
"@fluentui-copilot/react-utilities": "^0.0.2",
|
|
17
17
|
"@fluentui-copilot/tokens": "^0.3.2",
|
|
18
18
|
"@swc/helpers": "^0.5.1"
|
|
19
19
|
},
|