@fluentui-copilot/react-attachments 0.0.0-nightly-20251010-0406-7df7c6d1.1 → 0.0.0-nightly-20251014-0405-d8d3e89c.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.
Files changed (220) hide show
  1. package/CHANGELOG.json +42 -3
  2. package/CHANGELOG.md +17 -4
  3. package/dist/index.d.ts +379 -0
  4. package/lib/AgentTag.js +1 -0
  5. package/lib/AgentTag.js.map +1 -0
  6. package/lib/Attachment.js +1 -0
  7. package/lib/Attachment.js.map +1 -0
  8. package/lib/AttachmentList.js +1 -0
  9. package/lib/AttachmentList.js.map +1 -0
  10. package/lib/AttachmentOverflowMenu.js +1 -0
  11. package/lib/AttachmentOverflowMenu.js.map +1 -0
  12. package/lib/AttachmentOverflowMenuButton.js +1 -0
  13. package/lib/AttachmentOverflowMenuButton.js.map +1 -0
  14. package/lib/AttachmentOverflowMenuItem.js +1 -0
  15. package/lib/AttachmentOverflowMenuItem.js.map +1 -0
  16. package/lib/components/AgentTag/AgentTag.js +11 -0
  17. package/lib/components/AgentTag/AgentTag.js.map +1 -0
  18. package/lib/components/AgentTag/AgentTag.types.js +3 -0
  19. package/lib/components/AgentTag/AgentTag.types.js.map +1 -0
  20. package/lib/components/AgentTag/index.js +4 -0
  21. package/lib/components/AgentTag/index.js.map +1 -0
  22. package/lib/components/AgentTag/renderAgentTag.js +6 -0
  23. package/lib/components/AgentTag/renderAgentTag.js.map +1 -0
  24. package/lib/components/AgentTag/useAgentTag.js +18 -0
  25. package/lib/components/AgentTag/useAgentTag.js.map +1 -0
  26. package/lib/components/AgentTag/useAgentTagStyles.styles.js +95 -0
  27. package/lib/components/AgentTag/useAgentTagStyles.styles.js.map +1 -0
  28. package/lib/components/AgentTag/useAgentTagStyles.styles.raw.js +66 -0
  29. package/lib/components/AgentTag/useAgentTagStyles.styles.raw.js.map +1 -0
  30. package/lib/components/Attachment/Attachment.js +13 -0
  31. package/lib/components/Attachment/Attachment.js.map +1 -0
  32. package/lib/components/Attachment/Attachment.types.js +3 -0
  33. package/lib/components/Attachment/Attachment.types.js.map +1 -0
  34. package/lib/components/Attachment/index.js +4 -0
  35. package/lib/components/Attachment/index.js.map +1 -0
  36. package/lib/components/Attachment/renderAttachment.js +42 -0
  37. package/lib/components/Attachment/renderAttachment.js.map +1 -0
  38. package/lib/components/Attachment/useAttachment.js +103 -0
  39. package/lib/components/Attachment/useAttachment.js.map +1 -0
  40. package/lib/components/Attachment/useAttachmentStyles.styles.js +348 -0
  41. package/lib/components/Attachment/useAttachmentStyles.styles.js.map +1 -0
  42. package/lib/components/Attachment/useAttachmentStyles.styles.raw.js +328 -0
  43. package/lib/components/Attachment/useAttachmentStyles.styles.raw.js.map +1 -0
  44. package/lib/components/AttachmentList/AttachmentList.js +14 -0
  45. package/lib/components/AttachmentList/AttachmentList.js.map +1 -0
  46. package/lib/components/AttachmentList/AttachmentList.types.js +1 -0
  47. package/lib/components/AttachmentList/AttachmentList.types.js.map +1 -0
  48. package/lib/components/AttachmentList/index.js +4 -0
  49. package/lib/components/AttachmentList/index.js.map +1 -0
  50. package/lib/components/AttachmentList/renderAttachmentList.js +31 -0
  51. package/lib/components/AttachmentList/renderAttachmentList.js.map +1 -0
  52. package/lib/components/AttachmentList/useAttachmentList.js +134 -0
  53. package/lib/components/AttachmentList/useAttachmentList.js.map +1 -0
  54. package/lib/components/AttachmentList/useAttachmentListContextValues.js +12 -0
  55. package/lib/components/AttachmentList/useAttachmentListContextValues.js.map +1 -0
  56. package/lib/components/AttachmentList/useAttachmentListStyles.styles.js +48 -0
  57. package/lib/components/AttachmentList/useAttachmentListStyles.styles.js.map +1 -0
  58. package/lib/components/AttachmentList/useAttachmentListStyles.styles.raw.js +44 -0
  59. package/lib/components/AttachmentList/useAttachmentListStyles.styles.raw.js.map +1 -0
  60. package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js +14 -0
  61. package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js.map +1 -0
  62. package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js +1 -0
  63. package/lib/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js.map +1 -0
  64. package/lib/components/AttachmentOverflowMenu/index.js +4 -0
  65. package/lib/components/AttachmentOverflowMenu/index.js.map +1 -0
  66. package/lib/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js +13 -0
  67. package/lib/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js.map +1 -0
  68. package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js +18 -0
  69. package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js.map +1 -0
  70. package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js +12 -0
  71. package/lib/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js.map +1 -0
  72. package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js +12 -0
  73. package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js.map +1 -0
  74. package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js +3 -0
  75. package/lib/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js.map +1 -0
  76. package/lib/components/AttachmentOverflowMenuButton/index.js +4 -0
  77. package/lib/components/AttachmentOverflowMenuButton/index.js.map +1 -0
  78. package/lib/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js +15 -0
  79. package/lib/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js.map +1 -0
  80. package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +69 -0
  81. package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js.map +1 -0
  82. package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js +116 -0
  83. package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js.map +1 -0
  84. package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.raw.js +102 -0
  85. package/lib/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.raw.js.map +1 -0
  86. package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js +10 -0
  87. package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js.map +1 -0
  88. package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js +3 -0
  89. package/lib/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js.map +1 -0
  90. package/lib/components/AttachmentOverflowMenuItem/index.js +4 -0
  91. package/lib/components/AttachmentOverflowMenuItem/index.js.map +1 -0
  92. package/lib/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js +13 -0
  93. package/lib/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js.map +1 -0
  94. package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +56 -0
  95. package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js.map +1 -0
  96. package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.js +84 -0
  97. package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.js.map +1 -0
  98. package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js +59 -0
  99. package/lib/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js.map +1 -0
  100. package/lib/components/index.js +5 -0
  101. package/lib/components/index.js.map +1 -0
  102. package/lib/components/utils/useProgressBarStyles.styles.js +54 -0
  103. package/lib/components/utils/useProgressBarStyles.styles.js.map +1 -0
  104. package/lib/components/utils/useProgressBarStyles.styles.raw.js +42 -0
  105. package/lib/components/utils/useProgressBarStyles.styles.raw.js.map +1 -0
  106. package/lib/contexts/attachmentListContext.js +9 -0
  107. package/lib/contexts/attachmentListContext.js.map +1 -0
  108. package/lib/contexts/attachmentOverflowMenuContext.js +9 -0
  109. package/lib/contexts/attachmentOverflowMenuContext.js.map +1 -0
  110. package/lib/index.js +8 -0
  111. package/lib/index.js.map +1 -0
  112. package/lib-commonjs/AgentTag.js +28 -0
  113. package/lib-commonjs/AgentTag.js.map +1 -0
  114. package/lib-commonjs/Attachment.js +31 -0
  115. package/lib-commonjs/Attachment.js.map +1 -0
  116. package/lib-commonjs/AttachmentList.js +28 -0
  117. package/lib-commonjs/AttachmentList.js.map +1 -0
  118. package/lib-commonjs/AttachmentOverflowMenu.js +25 -0
  119. package/lib-commonjs/AttachmentOverflowMenu.js.map +1 -0
  120. package/lib-commonjs/AttachmentOverflowMenuButton.js +28 -0
  121. package/lib-commonjs/AttachmentOverflowMenuButton.js.map +1 -0
  122. package/lib-commonjs/AttachmentOverflowMenuItem.js +28 -0
  123. package/lib-commonjs/AttachmentOverflowMenuItem.js.map +1 -0
  124. package/lib-commonjs/components/AgentTag/AgentTag.js +21 -0
  125. package/lib-commonjs/components/AgentTag/AgentTag.js.map +1 -0
  126. package/lib-commonjs/components/AgentTag/AgentTag.types.js +6 -0
  127. package/lib-commonjs/components/AgentTag/AgentTag.types.js.map +1 -0
  128. package/lib-commonjs/components/AgentTag/index.js +31 -0
  129. package/lib-commonjs/components/AgentTag/index.js.map +1 -0
  130. package/lib-commonjs/components/AgentTag/renderAgentTag.js +14 -0
  131. package/lib-commonjs/components/AgentTag/renderAgentTag.js.map +1 -0
  132. package/lib-commonjs/components/AgentTag/useAgentTag.js +19 -0
  133. package/lib-commonjs/components/AgentTag/useAgentTag.js.map +1 -0
  134. package/lib-commonjs/components/AgentTag/useAgentTagStyles.styles.js +145 -0
  135. package/lib-commonjs/components/AgentTag/useAgentTagStyles.styles.js.map +1 -0
  136. package/lib-commonjs/components/AgentTag/useAgentTagStyles.styles.raw.js +82 -0
  137. package/lib-commonjs/components/AgentTag/useAgentTagStyles.styles.raw.js.map +1 -0
  138. package/lib-commonjs/components/Attachment/Attachment.js +23 -0
  139. package/lib-commonjs/components/Attachment/Attachment.js.map +1 -0
  140. package/lib-commonjs/components/Attachment/Attachment.types.js +6 -0
  141. package/lib-commonjs/components/Attachment/Attachment.types.js.map +1 -0
  142. package/lib-commonjs/components/Attachment/index.js +34 -0
  143. package/lib-commonjs/components/Attachment/index.js.map +1 -0
  144. package/lib-commonjs/components/Attachment/renderAttachment.js +50 -0
  145. package/lib-commonjs/components/Attachment/renderAttachment.js.map +1 -0
  146. package/lib-commonjs/components/Attachment/useAttachment.js +105 -0
  147. package/lib-commonjs/components/Attachment/useAttachment.js.map +1 -0
  148. package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.js +550 -0
  149. package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.js.map +1 -0
  150. package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.raw.js +347 -0
  151. package/lib-commonjs/components/Attachment/useAttachmentStyles.styles.raw.js.map +1 -0
  152. package/lib-commonjs/components/AttachmentList/AttachmentList.js +25 -0
  153. package/lib-commonjs/components/AttachmentList/AttachmentList.js.map +1 -0
  154. package/lib-commonjs/components/AttachmentList/AttachmentList.types.js +4 -0
  155. package/lib-commonjs/components/AttachmentList/AttachmentList.types.js.map +1 -0
  156. package/lib-commonjs/components/AttachmentList/index.js +31 -0
  157. package/lib-commonjs/components/AttachmentList/index.js.map +1 -0
  158. package/lib-commonjs/components/AttachmentList/renderAttachmentList.js +39 -0
  159. package/lib-commonjs/components/AttachmentList/renderAttachmentList.js.map +1 -0
  160. package/lib-commonjs/components/AttachmentList/useAttachmentList.js +137 -0
  161. package/lib-commonjs/components/AttachmentList/useAttachmentList.js.map +1 -0
  162. package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js +22 -0
  163. package/lib-commonjs/components/AttachmentList/useAttachmentListContextValues.js.map +1 -0
  164. package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.styles.js +67 -0
  165. package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.styles.js.map +1 -0
  166. package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.styles.raw.js +60 -0
  167. package/lib-commonjs/components/AttachmentList/useAttachmentListStyles.styles.raw.js.map +1 -0
  168. package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js +24 -0
  169. package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.js.map +1 -0
  170. package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js +4 -0
  171. package/lib-commonjs/components/AttachmentOverflowMenu/AttachmentOverflowMenu.types.js.map +1 -0
  172. package/lib-commonjs/components/AttachmentOverflowMenu/index.js +28 -0
  173. package/lib-commonjs/components/AttachmentOverflowMenu/index.js.map +1 -0
  174. package/lib-commonjs/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js +21 -0
  175. package/lib-commonjs/components/AttachmentOverflowMenu/renderAttachmentOverflowMenu.js.map +1 -0
  176. package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js +21 -0
  177. package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenu.js.map +1 -0
  178. package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js +22 -0
  179. package/lib-commonjs/components/AttachmentOverflowMenu/useAttachmentOverflowMenuContextValues.js.map +1 -0
  180. package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js +23 -0
  181. package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.js.map +1 -0
  182. package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js +6 -0
  183. package/lib-commonjs/components/AttachmentOverflowMenuButton/AttachmentOverflowMenuButton.types.js.map +1 -0
  184. package/lib-commonjs/components/AttachmentOverflowMenuButton/index.js +31 -0
  185. package/lib-commonjs/components/AttachmentOverflowMenuButton/index.js.map +1 -0
  186. package/lib-commonjs/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js +23 -0
  187. package/lib-commonjs/components/AttachmentOverflowMenuButton/renderAttachmentOverflowMenuButton.js.map +1 -0
  188. package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js +72 -0
  189. package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButton.js.map +1 -0
  190. package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js +178 -0
  191. package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.js.map +1 -0
  192. package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.raw.js +118 -0
  193. package/lib-commonjs/components/AttachmentOverflowMenuButton/useAttachmentOverflowMenuButtonStyles.styles.raw.js.map +1 -0
  194. package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js +21 -0
  195. package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.js.map +1 -0
  196. package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js +6 -0
  197. package/lib-commonjs/components/AttachmentOverflowMenuItem/AttachmentOverflowMenuItem.types.js.map +1 -0
  198. package/lib-commonjs/components/AttachmentOverflowMenuItem/index.js +31 -0
  199. package/lib-commonjs/components/AttachmentOverflowMenuItem/index.js.map +1 -0
  200. package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js +21 -0
  201. package/lib-commonjs/components/AttachmentOverflowMenuItem/renderAttachmentOverflowMenuItem.js.map +1 -0
  202. package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js +59 -0
  203. package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItem.js.map +1 -0
  204. package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.js +109 -0
  205. package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.js.map +1 -0
  206. package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js +75 -0
  207. package/lib-commonjs/components/AttachmentOverflowMenuItem/useAttachmentOverflowMenuItemStyles.styles.raw.js.map +1 -0
  208. package/lib-commonjs/components/index.js +92 -0
  209. package/lib-commonjs/components/index.js.map +1 -0
  210. package/lib-commonjs/components/utils/useProgressBarStyles.styles.js +103 -0
  211. package/lib-commonjs/components/utils/useProgressBarStyles.styles.js.map +1 -0
  212. package/lib-commonjs/components/utils/useProgressBarStyles.styles.raw.js +50 -0
  213. package/lib-commonjs/components/utils/useProgressBarStyles.styles.raw.js.map +1 -0
  214. package/lib-commonjs/contexts/attachmentListContext.js +30 -0
  215. package/lib-commonjs/contexts/attachmentListContext.js.map +1 -0
  216. package/lib-commonjs/contexts/attachmentOverflowMenuContext.js +30 -0
  217. package/lib-commonjs/contexts/attachmentOverflowMenuContext.js.map +1 -0
  218. package/lib-commonjs/index.js +122 -0
  219. package/lib-commonjs/index.js.map +1 -0
  220. package/package.json +4 -4
@@ -0,0 +1,34 @@
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
+ Attachment: function() {
13
+ return _Attachment.Attachment;
14
+ },
15
+ attachmentClassNames: function() {
16
+ return _useAttachmentStylesstyles.attachmentClassNames;
17
+ },
18
+ renderAttachment_unstable: function() {
19
+ return _renderAttachment.renderAttachment_unstable;
20
+ },
21
+ useAttachmentStyles_unstable: function() {
22
+ return _useAttachmentStylesstyles.useAttachmentStyles_unstable;
23
+ },
24
+ useAttachment_unstable: function() {
25
+ return _useAttachment.useAttachment_unstable;
26
+ },
27
+ useOverflowStyles: function() {
28
+ return _useAttachmentStylesstyles.useOverflowStyles;
29
+ }
30
+ });
31
+ const _Attachment = require("./Attachment");
32
+ const _renderAttachment = require("./renderAttachment");
33
+ const _useAttachment = require("./useAttachment");
34
+ const _useAttachmentStylesstyles = require("./useAttachmentStyles.styles");
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["index.ts"],"sourcesContent":["export { Attachment } from './Attachment';\nexport type { AttachmentProps, AttachmentSlots, AttachmentState } from './Attachment.types';\nexport { renderAttachment_unstable } from './renderAttachment';\nexport { useAttachment_unstable } from './useAttachment';\nexport { attachmentClassNames, useAttachmentStyles_unstable, useOverflowStyles } from './useAttachmentStyles.styles';\n"],"names":["Attachment","attachmentClassNames","renderAttachment_unstable","useAttachmentStyles_unstable","useAttachment_unstable","useOverflowStyles"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,UAAU;eAAVA,sBAAU;;IAIVC,oBAAoB;eAApBA,+CAAoB;;IAFpBC,yBAAyB;eAAzBA,2CAAyB;;IAEHC,4BAA4B;eAA5BA,uDAA4B;;IADlDC,sBAAsB;eAAtBA,qCAAsB;;IAC8BC,iBAAiB;eAAjBA,4CAAiB;;;4BAJnD;kCAEe;+BACH;2CAC+C"}
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "renderAttachment_unstable", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return renderAttachment_unstable;
9
+ }
10
+ });
11
+ const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
12
+ const _reactcomponents = require("@fluentui/react-components");
13
+ const renderAttachment_unstable = (state)=>{
14
+ const { id, shouldUseOverflow, designVersion, dismissOnly } = state;
15
+ const attachment = designVersion === 'next' && dismissOnly ? renderDismissOnly(state) : renderAttachment(state);
16
+ return shouldUseOverflow ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactcomponents.OverflowItem, {
17
+ id: id,
18
+ children: attachment
19
+ }, id) : attachment;
20
+ };
21
+ const renderAttachment = (state)=>{
22
+ (0, _reactcomponents.assertSlots)(state);
23
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
24
+ children: [
25
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.primaryAction, {
26
+ children: [
27
+ state.media && !state.imageOnly && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.media, {}),
28
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(state.content, {}),
29
+ state.progress && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.progress, {})
30
+ ]
31
+ }),
32
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(state.dismissButton, {
33
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.dismissIcon, {})
34
+ })
35
+ ]
36
+ });
37
+ };
38
+ const renderDismissOnly = (state)=>{
39
+ (0, _reactcomponents.assertSlots)(state);
40
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {
41
+ children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.dismissButton, {
42
+ children: [
43
+ state.media && !state.imageOnly && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.media, {}),
44
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(state.content, {}),
45
+ state.progress && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.progress, {}),
46
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(state.dismissIcon, {})
47
+ ]
48
+ })
49
+ });
50
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["renderAttachment.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { OverflowItem, assertSlots } from '@fluentui/react-components';\nimport type { JSXElement } from '@fluentui/react-components';\nimport type { AttachmentState, AttachmentSlots } from './Attachment.types';\n\n/**\n * Render the final JSX of Attachment\n */\nexport const renderAttachment_unstable = (state: AttachmentState): JSXElement => {\n const { id, shouldUseOverflow, designVersion, dismissOnly } = state;\n\n const attachment = designVersion === 'next' && dismissOnly ? renderDismissOnly(state) : renderAttachment(state);\n\n return shouldUseOverflow ? (\n <OverflowItem id={id} key={id}>\n {attachment}\n </OverflowItem>\n ) : (\n attachment\n );\n};\n\nconst renderAttachment = (state: AttachmentState): JSXElement => {\n assertSlots<AttachmentSlots>(state);\n\n return (\n <state.root>\n <state.primaryAction>\n {state.media && !state.imageOnly && <state.media />}\n <state.content />\n {state.progress && <state.progress />}\n </state.primaryAction>\n <state.dismissButton>\n <state.dismissIcon />\n </state.dismissButton>\n </state.root>\n );\n};\n\nconst renderDismissOnly = (state: AttachmentState): JSXElement => {\n assertSlots<AttachmentSlots>(state);\n\n return (\n <state.root>\n <state.dismissButton>\n {state.media && !state.imageOnly && <state.media />}\n <state.content />\n {state.progress && <state.progress />}\n <state.dismissIcon />\n </state.dismissButton>\n </state.root>\n );\n};\n"],"names":["renderAttachment_unstable","state","id","shouldUseOverflow","designVersion","dismissOnly","attachment","renderDismissOnly","renderAttachment","_jsx","OverflowItem","assertSlots","_jsxs","root","primaryAction","media","imageOnly","content","progress","dismissButton","dismissIcon"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAUaA;;;eAAAA;;;4BATb;iCAE0C;AAOnC,MAAMA,4BAA4B,CAACC;IACxC,MAAM,EAAEC,EAAE,EAAEC,iBAAiB,EAAEC,aAAa,EAAEC,WAAW,EAAE,GAAGJ;IAE9D,MAAMK,aAAaF,kBAAkB,UAAUC,cAAcE,kBAAkBN,SAASO,iBAAiBP;IAEzG,OAAOE,oBAAAA,WAAAA,GACLM,IAAAA,eAAA,EAACC,6BAAAA,EAAAA;QAAaR,IAAIA;kBACfI;OADwBJ,MAI3BI;AAEJ;AAEA,MAAME,mBAAmB,CAACP;IACxBU,IAAAA,4BAAAA,EAA6BV;IAE7B,OAAA,WAAA,GACEW,IAAAA,gBAAA,EAACX,MAAMY,IAAI,EAAA;;0BACTD,IAAAA,gBAAA,EAACX,MAAMa,aAAa,EAAA;;oBACjBb,MAAMc,KAAK,IAAI,CAACd,MAAMe,SAAS,IAAA,WAAA,GAAIP,IAAAA,eAAA,EAACR,MAAMc,KAAK,EAAA,CAAA;kCAChDN,IAAAA,eAAA,EAACR,MAAMgB,OAAO,EAAA,CAAA;oBACbhB,MAAMiB,QAAQ,IAAA,WAAA,GAAIT,IAAAA,eAAA,EAACR,MAAMiB,QAAQ,EAAA,CAAA;;;0BAEpCT,IAAAA,eAAA,EAACR,MAAMkB,aAAa,EAAA;0BAClB,WAAA,GAAAV,IAAAA,eAAA,EAACR,MAAMmB,WAAW,EAAA,CAAA;;;;AAI1B;AAEA,MAAMb,oBAAoB,CAACN;IACzBU,IAAAA,4BAAAA,EAA6BV;IAE7B,OAAA,WAAA,GACEQ,IAAAA,eAAA,EAACR,MAAMY,IAAI,EAAA;kBACT,WAAA,GAAAD,IAAAA,gBAAA,EAACX,MAAMkB,aAAa,EAAA;;gBACjBlB,MAAMc,KAAK,IAAI,CAACd,MAAMe,SAAS,IAAA,WAAA,GAAIP,IAAAA,eAAA,EAACR,MAAMc,KAAK,EAAA,CAAA;8BAChDN,IAAAA,eAAA,EAACR,MAAMgB,OAAO,EAAA,CAAA;gBACbhB,MAAMiB,QAAQ,IAAA,WAAA,GAAIT,IAAAA,eAAA,EAACR,MAAMiB,QAAQ,EAAA,CAAA;8BAClCT,IAAAA,eAAA,EAACR,MAAMmB,WAAW,EAAA,CAAA;;;;AAI1B"}
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "useAttachment_unstable", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return useAttachment_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 _reacticons = require("@fluentui/react-icons");
15
+ const _attachmentListContext = require("../../contexts/attachmentListContext");
16
+ const _reactprovider = require("@fluentui-copilot/react-provider");
17
+ const useAttachment_unstable = (props, ref)=>{
18
+ const { children, imageOnly, size = 'medium', dismissOnly = false } = props;
19
+ const { onAttachmentDismiss, shouldUseOverflow } = (0, _attachmentListContext.useAttachmentListContext_unstable)((context)=>context);
20
+ const attachmentId = (0, _reactcomponents.useId)('attachment-', props.id);
21
+ const isLoading = !!props.progress;
22
+ const mode = (0, _reactprovider.useCopilotMode)(props.mode);
23
+ const designVersion = (0, _reactprovider.useDesignVersion)(props.designVersion);
24
+ const root = _reactcomponents.slot.always((0, _reactcomponents.getIntrinsicElementProps)('div', {
25
+ ref,
26
+ ...props,
27
+ id: attachmentId
28
+ }, [
29
+ 'content'
30
+ ]), {
31
+ elementType: 'div'
32
+ });
33
+ const primaryAction = _reactcomponents.slot.always(props.primaryAction, {
34
+ defaultProps: {
35
+ as: dismissOnly ? 'span' : undefined
36
+ },
37
+ elementType: 'button'
38
+ });
39
+ const dismissButton = _reactcomponents.slot.always(props.dismissButton, {
40
+ defaultProps: {
41
+ 'aria-label': 'Remove attachment'
42
+ },
43
+ elementType: 'button'
44
+ });
45
+ dismissButton.onClick = (0, _reactcomponents.mergeCallbacks)(dismissButton.onClick, (ev)=>{
46
+ onAttachmentDismiss === null || onAttachmentDismiss === void 0 ? void 0 : onAttachmentDismiss(ev, {
47
+ content: children,
48
+ media,
49
+ id: attachmentId
50
+ });
51
+ });
52
+ const media = _reactcomponents.slot.optional(props.media, {
53
+ elementType: 'span'
54
+ });
55
+ const content = _reactcomponents.slot.always(props.content, {
56
+ defaultProps: {
57
+ children: props.children
58
+ },
59
+ elementType: 'span'
60
+ });
61
+ const dismissIcon = _reactcomponents.slot.always(props.dismissIcon, {
62
+ defaultProps: {
63
+ children: size === 'small' ? /*#__PURE__*/ _react.createElement(_reacticons.Dismiss12Regular, null) : /*#__PURE__*/ _react.createElement(_reacticons.Dismiss20Regular, null)
64
+ },
65
+ elementType: 'span'
66
+ });
67
+ const progress = _reactcomponents.slot.optional(props.progress, {
68
+ defaultProps: {
69
+ shape: 'square',
70
+ thickness: 'large',
71
+ 'aria-labelledby': props.id
72
+ },
73
+ elementType: _reactcomponents.ProgressBar
74
+ });
75
+ const state = {
76
+ id: attachmentId,
77
+ size,
78
+ components: {
79
+ root: 'div',
80
+ primaryAction: 'button',
81
+ dismissButton: 'button',
82
+ media: 'span',
83
+ content: 'span',
84
+ dismissIcon: 'span',
85
+ progress: _reactcomponents.ProgressBar
86
+ },
87
+ root,
88
+ primaryAction,
89
+ dismissButton,
90
+ media,
91
+ content,
92
+ dismissIcon,
93
+ progress,
94
+ imageOnly,
95
+ isLoading,
96
+ shouldUseOverflow,
97
+ mode,
98
+ designVersion,
99
+ dismissOnly
100
+ };
101
+ if (state.primaryAction.as === 'span') {
102
+ state.components.primaryAction = 'span';
103
+ }
104
+ return state;
105
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["useAttachment.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ProgressBar, getIntrinsicElementProps, mergeCallbacks, slot, useId } from '@fluentui/react-components';\nimport { Dismiss12Regular, Dismiss20Regular } from '@fluentui/react-icons';\nimport { useAttachmentListContext_unstable } from '../../contexts/attachmentListContext';\nimport type { AttachmentProps, AttachmentState } from './Attachment.types';\nimport { useCopilotMode, useDesignVersion } from '@fluentui-copilot/react-provider';\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, size = 'medium', dismissOnly = false } = props;\n const { onAttachmentDismiss, shouldUseOverflow } = useAttachmentListContext_unstable(context => context);\n const attachmentId = useId('attachment-', props.id);\n const isLoading = !!props.progress;\n\n const mode = useCopilotMode(props.mode);\n const designVersion = useDesignVersion(props.designVersion);\n\n const root = slot.always(\n getIntrinsicElementProps(\n 'div',\n {\n ref,\n ...props,\n id: attachmentId,\n },\n // `content` is a slot and it's type clashes with the HTMLElement `content` attribute\n ['content'],\n ),\n { elementType: 'div' },\n );\n\n const primaryAction = slot.always(props.primaryAction, {\n defaultProps: { as: dismissOnly ? 'span' : undefined },\n elementType: 'button',\n });\n\n const dismissButton = slot.always(props.dismissButton, {\n defaultProps: { 'aria-label': 'Remove attachment' },\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: size === 'small' ? <Dismiss12Regular /> : <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 size,\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 mode,\n designVersion,\n dismissOnly,\n };\n\n if (state.primaryAction.as === 'span') {\n state.components.primaryAction = 'span';\n }\n\n return state;\n};\n"],"names":["useAttachment_unstable","props","ref","children","imageOnly","size","dismissOnly","onAttachmentDismiss","shouldUseOverflow","useAttachmentListContext_unstable","context","attachmentId","useId","id","isLoading","progress","mode","useCopilotMode","designVersion","useDesignVersion","root","slot","always","getIntrinsicElementProps","elementType","primaryAction","defaultProps","as","undefined","dismissButton","onClick","mergeCallbacks","ev","content","media","optional","dismissIcon","React","createElement","Dismiss12Regular","Dismiss20Regular","shape","thickness","ProgressBar","state","components"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgBaA;;;eAAAA;;;;iEAhBU;iCAC4D;4BAChC;uCACD;+BAED;AAW1C,MAAMA,yBAAyB,CAACC,OAAwBC;IAC7D,MAAM,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,OAAO,QAAQ,EAAEC,cAAc,KAAK,EAAE,GAAGL;IACtE,MAAM,EAAEM,mBAAmB,EAAEC,iBAAiB,EAAE,GAAGC,IAAAA,wDAAAA,EAAkCC,CAAAA,UAAWA;IAChG,MAAMC,eAAeC,IAAAA,sBAAAA,EAAM,eAAeX,MAAMY,EAAE;IAClD,MAAMC,YAAY,CAAC,CAACb,MAAMc,QAAQ;IAElC,MAAMC,OAAOC,IAAAA,6BAAAA,EAAehB,MAAMe,IAAI;IACtC,MAAME,gBAAgBC,IAAAA,+BAAAA,EAAiBlB,MAAMiB,aAAa;IAE1D,MAAME,OAAOC,qBAAAA,CAAKC,MAAM,CACtBC,IAAAA,yCAAAA,EACE,OACA;QACErB;QACA,GAAGD,KAAK;QACRY,IAAIF;IACN,GAEA;QAAC;KAAU,GAEb;QAAEa,aAAa;IAAM;IAGvB,MAAMC,gBAAgBJ,qBAAAA,CAAKC,MAAM,CAACrB,MAAMwB,aAAa,EAAE;QACrDC,cAAc;YAAEC,IAAIrB,cAAc,SAASsB;QAAU;QACrDJ,aAAa;IACf;IAEA,MAAMK,gBAAgBR,qBAAAA,CAAKC,MAAM,CAACrB,MAAM4B,aAAa,EAAE;QACrDH,cAAc;YAAE,cAAc;QAAoB;QAClDF,aAAa;IACf;IAEAK,cAAcC,OAAO,GAAGC,IAAAA,+BAAAA,EACtBF,cAAcC,OAAO,EACrB,CAACE;QACCzB,wBAAAA,QAAAA,wBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,oBAAsByB,IAAI;YAAEC,SAAS9B;YAAU+B;YAAOrB,IAAIF;QAAa;IACzE;IAGF,MAAMuB,QAAQb,qBAAAA,CAAKc,QAAQ,CAAClC,MAAMiC,KAAK,EAAE;QAAEV,aAAa;IAAO;IAE/D,MAAMS,UAAUZ,qBAAAA,CAAKC,MAAM,CAACrB,MAAMgC,OAAO,EAAE;QACzCP,cAAc;YACZvB,UAAUF,MAAME,QAAQ;QAC1B;QACAqB,aAAa;IACf;IAEA,MAAMY,cAAcf,qBAAAA,CAAKC,MAAM,CAACrB,MAAMmC,WAAW,EAAE;QACjDV,cAAc;YACZvB,UAAUE,SAAS,UAAA,WAAA,GAAUgC,OAAAC,aAAA,CAACC,4BAAAA,EAAAA,QAAAA,WAAAA,GAAsBF,OAAAC,aAAA,CAACE,4BAAAA,EAAAA;QACvD;QACAhB,aAAa;IACf;IAEA,MAAMT,WAAWM,qBAAAA,CAAKc,QAAQ,CAAClC,MAAMc,QAAQ,EAAE;QAC7CW,cAAc;YACZe,OAAO;YACPC,WAAW;YACX,mBAAmBzC,MAAMY,EAAE;QAC7B;QACAW,aAAamB,4BAAAA;IACf;IAEA,MAAMC,QAAyB;QAC7B/B,IAAIF;QACJN;QACAwC,YAAY;YACVzB,MAAM;YACNK,eAAe;YACfI,eAAe;YACfK,OAAO;YACPD,SAAS;YACTG,aAAa;YACbrB,UAAU4B,4BAAAA;QACZ;QAEAvB;QACAK;QACAI;QACAK;QACAD;QACAG;QACArB;QACAX;QACAU;QACAN;QACAQ;QACAE;QACAZ;IACF;IAEA,IAAIsC,MAAMnB,aAAa,CAACE,EAAE,KAAK,QAAQ;QACrCiB,MAAMC,UAAU,CAACpB,aAAa,GAAG;IACnC;IAEA,OAAOmB;AACT"}