@fluentui-copilot/react-reference 0.15.5 → 0.16.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 (226) hide show
  1. package/CHANGELOG.json +30 -1
  2. package/CHANGELOG.md +16 -2
  3. package/dist/index.d.ts +88 -290
  4. package/lib/Reference.js.map +1 -1
  5. package/lib/ReferenceList.js +1 -1
  6. package/lib/ReferenceList.js.map +1 -1
  7. package/lib/ReferenceOverflowButton.js +1 -1
  8. package/lib/ReferenceOverflowButton.js.map +1 -1
  9. package/lib/components/Citation/useCitationStyles.styles.js +3 -3
  10. package/lib/components/Citation/useCitationStyles.styles.js.map +1 -1
  11. package/lib/components/Reference/Reference.js +0 -3
  12. package/lib/components/Reference/Reference.js.map +1 -1
  13. package/lib/components/Reference/Reference.types.js +1 -1
  14. package/lib/components/Reference/Reference.types.js.map +1 -1
  15. package/lib/components/Reference/index.js.map +1 -1
  16. package/lib/components/Reference/renderReference.js +13 -8
  17. package/lib/components/Reference/renderReference.js.map +1 -1
  18. package/lib/components/Reference/useReference.js +46 -166
  19. package/lib/components/Reference/useReference.js.map +1 -1
  20. package/lib/components/Reference/useReferenceStyles.styles.js +40 -220
  21. package/lib/components/Reference/useReferenceStyles.styles.js.map +1 -1
  22. package/lib/components/ReferenceList/ReferenceList.js +4 -5
  23. package/lib/components/ReferenceList/ReferenceList.js.map +1 -1
  24. package/lib/components/ReferenceList/ReferenceList.types.js +1 -1
  25. package/lib/components/ReferenceList/ReferenceList.types.js.map +1 -1
  26. package/lib/components/ReferenceList/index.js +1 -1
  27. package/lib/components/ReferenceList/index.js.map +1 -1
  28. package/lib/components/ReferenceList/renderReferenceList.js +19 -5
  29. package/lib/components/ReferenceList/renderReferenceList.js.map +1 -1
  30. package/lib/components/ReferenceList/useReferenceList.js +76 -14
  31. package/lib/components/ReferenceList/useReferenceList.js.map +1 -1
  32. package/lib/components/ReferenceList/useReferenceListStyles.styles.js +31 -9
  33. package/lib/components/ReferenceList/useReferenceListStyles.styles.js.map +1 -1
  34. package/lib/components/{reference-v2/ReferenceOverflowButton → ReferenceOverflowButton}/useReferenceOverflowButton.js +1 -1
  35. package/lib/components/ReferenceOverflowButton/useReferenceOverflowButton.js.map +1 -0
  36. package/lib/components/{reference-v2/ReferenceOverflowButton → ReferenceOverflowButton}/useReferenceOverflowButtonStyles.styles.js +2 -2
  37. package/lib/components/{reference-v2/ReferenceOverflowButton → ReferenceOverflowButton}/useReferenceOverflowButtonStyles.styles.js.map +1 -1
  38. package/lib/contexts/referenceListContext.js.map +1 -0
  39. package/lib/index.js +31 -8
  40. package/lib/index.js.map +1 -1
  41. package/lib/utilities/{reference-v2/generateReferenceCitationPreview.js → generateReferenceCitationPreview.js} +2 -2
  42. package/lib/utilities/generateReferenceCitationPreview.js.map +1 -0
  43. package/lib/utilities/index.js +1 -1
  44. package/lib/utilities/index.js.map +1 -1
  45. package/lib/utilities/useReferenceCitationPreview.js +12 -123
  46. package/lib/utilities/useReferenceCitationPreview.js.map +1 -1
  47. package/lib-commonjs/Reference.js.map +1 -1
  48. package/lib-commonjs/ReferenceList.js +0 -3
  49. package/lib-commonjs/ReferenceList.js.map +1 -1
  50. package/lib-commonjs/ReferenceOverflowButton.js +1 -1
  51. package/lib-commonjs/ReferenceOverflowButton.js.map +1 -1
  52. package/lib-commonjs/components/Citation/useCitationStyles.styles.js +7 -7
  53. package/lib-commonjs/components/Citation/useCitationStyles.styles.js.map +1 -1
  54. package/lib-commonjs/components/Reference/Reference.js +0 -2
  55. package/lib-commonjs/components/Reference/Reference.js.map +1 -1
  56. package/lib-commonjs/components/Reference/Reference.types.js +1 -1
  57. package/lib-commonjs/components/Reference/Reference.types.js.map +1 -1
  58. package/lib-commonjs/components/Reference/index.js.map +1 -1
  59. package/lib-commonjs/components/Reference/renderReference.js +11 -18
  60. package/lib-commonjs/components/Reference/renderReference.js.map +1 -1
  61. package/lib-commonjs/components/Reference/useReference.js +42 -167
  62. package/lib-commonjs/components/Reference/useReference.js.map +1 -1
  63. package/lib-commonjs/components/Reference/useReferenceStyles.styles.js +56 -324
  64. package/lib-commonjs/components/Reference/useReferenceStyles.styles.js.map +1 -1
  65. package/lib-commonjs/components/ReferenceList/ReferenceList.js +4 -4
  66. package/lib-commonjs/components/ReferenceList/ReferenceList.js.map +1 -1
  67. package/lib-commonjs/components/ReferenceList/ReferenceList.types.js +1 -1
  68. package/lib-commonjs/components/ReferenceList/ReferenceList.types.js.map +1 -1
  69. package/lib-commonjs/components/ReferenceList/index.js +0 -3
  70. package/lib-commonjs/components/ReferenceList/index.js.map +1 -1
  71. package/lib-commonjs/components/ReferenceList/renderReferenceList.js +16 -2
  72. package/lib-commonjs/components/ReferenceList/renderReferenceList.js.map +1 -1
  73. package/lib-commonjs/components/ReferenceList/useReferenceList.js +67 -11
  74. package/lib-commonjs/components/ReferenceList/useReferenceList.js.map +1 -1
  75. package/lib-commonjs/components/ReferenceList/useReferenceListStyles.styles.js +34 -9
  76. package/lib-commonjs/components/ReferenceList/useReferenceListStyles.styles.js.map +1 -1
  77. package/lib-commonjs/components/{reference-v2/ReferenceOverflowButton → ReferenceOverflowButton}/useReferenceOverflowButton.js +1 -1
  78. package/lib-commonjs/components/ReferenceOverflowButton/useReferenceOverflowButton.js.map +1 -0
  79. package/lib-commonjs/components/{reference-v2/ReferenceOverflowButton → ReferenceOverflowButton}/useReferenceOverflowButtonStyles.styles.js.map +1 -1
  80. package/lib-commonjs/contexts/referenceListContext.js.map +1 -0
  81. package/lib-commonjs/index.js +33 -40
  82. package/lib-commonjs/index.js.map +1 -1
  83. package/lib-commonjs/utilities/{reference-v2/generateReferenceCitationPreview.js → generateReferenceCitationPreview.js} +3 -3
  84. package/lib-commonjs/utilities/generateReferenceCitationPreview.js.map +1 -0
  85. package/lib-commonjs/utilities/index.js +4 -4
  86. package/lib-commonjs/utilities/index.js.map +1 -1
  87. package/lib-commonjs/utilities/useReferenceCitationPreview.js +4 -129
  88. package/lib-commonjs/utilities/useReferenceCitationPreview.js.map +1 -1
  89. package/package.json +4 -4
  90. package/lib/ReferenceGroupToggle.js +0 -2
  91. package/lib/ReferenceGroupToggle.js.map +0 -1
  92. package/lib/ReferenceListV2.js +0 -2
  93. package/lib/ReferenceListV2.js.map +0 -1
  94. package/lib/ReferenceV2.js +0 -2
  95. package/lib/ReferenceV2.js.map +0 -1
  96. package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.js +0 -12
  97. package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.js.map +0 -1
  98. package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js +0 -4
  99. package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js.map +0 -1
  100. package/lib/components/ReferenceGroupToggle/index.js +0 -5
  101. package/lib/components/ReferenceGroupToggle/index.js.map +0 -1
  102. package/lib/components/ReferenceGroupToggle/renderReferenceGroupToggle.js +0 -12
  103. package/lib/components/ReferenceGroupToggle/renderReferenceGroupToggle.js.map +0 -1
  104. package/lib/components/ReferenceGroupToggle/useReferenceGroupToggle.js +0 -43
  105. package/lib/components/ReferenceGroupToggle/useReferenceGroupToggle.js.map +0 -1
  106. package/lib/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.styles.js +0 -43
  107. package/lib/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.styles.js.map +0 -1
  108. package/lib/components/reference-v2/Reference/Reference.js +0 -11
  109. package/lib/components/reference-v2/Reference/Reference.js.map +0 -1
  110. package/lib/components/reference-v2/Reference/Reference.types.js +0 -2
  111. package/lib/components/reference-v2/Reference/Reference.types.js.map +0 -1
  112. package/lib/components/reference-v2/Reference/index.js +0 -5
  113. package/lib/components/reference-v2/Reference/index.js.map +0 -1
  114. package/lib/components/reference-v2/Reference/renderReference.js +0 -19
  115. package/lib/components/reference-v2/Reference/renderReference.js.map +0 -1
  116. package/lib/components/reference-v2/Reference/useReference.js +0 -74
  117. package/lib/components/reference-v2/Reference/useReference.js.map +0 -1
  118. package/lib/components/reference-v2/Reference/useReferenceStyles.styles.js +0 -70
  119. package/lib/components/reference-v2/Reference/useReferenceStyles.styles.js.map +0 -1
  120. package/lib/components/reference-v2/ReferenceList/ReferenceList.js +0 -13
  121. package/lib/components/reference-v2/ReferenceList/ReferenceList.js.map +0 -1
  122. package/lib/components/reference-v2/ReferenceList/ReferenceList.types.js +0 -2
  123. package/lib/components/reference-v2/ReferenceList/ReferenceList.types.js.map +0 -1
  124. package/lib/components/reference-v2/ReferenceList/index.js +0 -5
  125. package/lib/components/reference-v2/ReferenceList/index.js.map +0 -1
  126. package/lib/components/reference-v2/ReferenceList/renderReferenceList.js +0 -22
  127. package/lib/components/reference-v2/ReferenceList/renderReferenceList.js.map +0 -1
  128. package/lib/components/reference-v2/ReferenceList/useReferenceList.js +0 -93
  129. package/lib/components/reference-v2/ReferenceList/useReferenceList.js.map +0 -1
  130. package/lib/components/reference-v2/ReferenceList/useReferenceListStyles.styles.js +0 -46
  131. package/lib/components/reference-v2/ReferenceList/useReferenceListStyles.styles.js.map +0 -1
  132. package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js.map +0 -1
  133. package/lib/components/reference-v2/index.js +0 -4
  134. package/lib/components/reference-v2/index.js.map +0 -1
  135. package/lib/contexts/ReferenceGroupContext.js +0 -11
  136. package/lib/contexts/ReferenceGroupContext.js.map +0 -1
  137. package/lib/contexts/reference-v2/referenceListContext.js.map +0 -1
  138. package/lib/utilities/reference-v2/generateReferenceCitationPreview.js.map +0 -1
  139. package/lib/utilities/reference-v2/index.js +0 -3
  140. package/lib/utilities/reference-v2/index.js.map +0 -1
  141. package/lib/utilities/reference-v2/useReferenceCitationPreview.js +0 -18
  142. package/lib/utilities/reference-v2/useReferenceCitationPreview.js.map +0 -1
  143. package/lib/utilities/useReferenceGroup.js +0 -40
  144. package/lib/utilities/useReferenceGroup.js.map +0 -1
  145. package/lib-commonjs/ReferenceGroupToggle.js +0 -29
  146. package/lib-commonjs/ReferenceGroupToggle.js.map +0 -1
  147. package/lib-commonjs/ReferenceListV2.js +0 -29
  148. package/lib-commonjs/ReferenceListV2.js.map +0 -1
  149. package/lib-commonjs/ReferenceV2.js +0 -32
  150. package/lib-commonjs/ReferenceV2.js.map +0 -1
  151. package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.js +0 -21
  152. package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.js.map +0 -1
  153. package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js +0 -7
  154. package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js.map +0 -1
  155. package/lib-commonjs/components/ReferenceGroupToggle/index.js +0 -32
  156. package/lib-commonjs/components/ReferenceGroupToggle/index.js.map +0 -1
  157. package/lib-commonjs/components/ReferenceGroupToggle/renderReferenceGroupToggle.js +0 -21
  158. package/lib-commonjs/components/ReferenceGroupToggle/renderReferenceGroupToggle.js.map +0 -1
  159. package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggle.js +0 -42
  160. package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggle.js.map +0 -1
  161. package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.styles.js +0 -64
  162. package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.styles.js.map +0 -1
  163. package/lib-commonjs/components/reference-v2/Reference/Reference.js +0 -21
  164. package/lib-commonjs/components/reference-v2/Reference/Reference.js.map +0 -1
  165. package/lib-commonjs/components/reference-v2/Reference/Reference.types.js +0 -5
  166. package/lib-commonjs/components/reference-v2/Reference/Reference.types.js.map +0 -1
  167. package/lib-commonjs/components/reference-v2/Reference/index.js +0 -35
  168. package/lib-commonjs/components/reference-v2/Reference/index.js.map +0 -1
  169. package/lib-commonjs/components/reference-v2/Reference/renderReference.js +0 -32
  170. package/lib-commonjs/components/reference-v2/Reference/renderReference.js.map +0 -1
  171. package/lib-commonjs/components/reference-v2/Reference/useReference.js +0 -71
  172. package/lib-commonjs/components/reference-v2/Reference/useReference.js.map +0 -1
  173. package/lib-commonjs/components/reference-v2/Reference/useReferenceStyles.styles.js +0 -109
  174. package/lib-commonjs/components/reference-v2/Reference/useReferenceStyles.styles.js.map +0 -1
  175. package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.js +0 -23
  176. package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.js.map +0 -1
  177. package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.types.js +0 -5
  178. package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.types.js.map +0 -1
  179. package/lib-commonjs/components/reference-v2/ReferenceList/index.js +0 -32
  180. package/lib-commonjs/components/reference-v2/ReferenceList/index.js.map +0 -1
  181. package/lib-commonjs/components/reference-v2/ReferenceList/renderReferenceList.js +0 -30
  182. package/lib-commonjs/components/reference-v2/ReferenceList/renderReferenceList.js.map +0 -1
  183. package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceList.js +0 -86
  184. package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceList.js.map +0 -1
  185. package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListStyles.styles.js +0 -62
  186. package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListStyles.styles.js.map +0 -1
  187. package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js.map +0 -1
  188. package/lib-commonjs/components/reference-v2/index.js +0 -64
  189. package/lib-commonjs/components/reference-v2/index.js.map +0 -1
  190. package/lib-commonjs/contexts/ReferenceGroupContext.js +0 -29
  191. package/lib-commonjs/contexts/ReferenceGroupContext.js.map +0 -1
  192. package/lib-commonjs/contexts/reference-v2/referenceListContext.js.map +0 -1
  193. package/lib-commonjs/utilities/reference-v2/generateReferenceCitationPreview.js.map +0 -1
  194. package/lib-commonjs/utilities/reference-v2/index.js +0 -21
  195. package/lib-commonjs/utilities/reference-v2/index.js.map +0 -1
  196. package/lib-commonjs/utilities/reference-v2/useReferenceCitationPreview.js +0 -18
  197. package/lib-commonjs/utilities/reference-v2/useReferenceCitationPreview.js.map +0 -1
  198. package/lib-commonjs/utilities/useReferenceGroup.js +0 -49
  199. package/lib-commonjs/utilities/useReferenceGroup.js.map +0 -1
  200. /package/lib/components/{reference-v2/ReferenceList → ReferenceList}/useReferenceListContextValues.js +0 -0
  201. /package/lib/components/{reference-v2/ReferenceList → ReferenceList}/useReferenceListContextValues.js.map +0 -0
  202. /package/lib/components/{reference-v2/ReferenceOverflowButton → ReferenceOverflowButton}/ReferenceOverflowButton.js +0 -0
  203. /package/lib/components/{reference-v2/ReferenceOverflowButton → ReferenceOverflowButton}/ReferenceOverflowButton.js.map +0 -0
  204. /package/lib/components/{reference-v2/ReferenceOverflowButton → ReferenceOverflowButton}/ReferenceOverflowButton.types.js +0 -0
  205. /package/lib/components/{reference-v2/ReferenceOverflowButton → ReferenceOverflowButton}/ReferenceOverflowButton.types.js.map +0 -0
  206. /package/lib/components/{reference-v2/ReferenceOverflowButton → ReferenceOverflowButton}/index.js +0 -0
  207. /package/lib/components/{reference-v2/ReferenceOverflowButton → ReferenceOverflowButton}/index.js.map +0 -0
  208. /package/lib/components/{reference-v2/ReferenceOverflowButton → ReferenceOverflowButton}/renderReferenceOverflowButton.js +0 -0
  209. /package/lib/components/{reference-v2/ReferenceOverflowButton → ReferenceOverflowButton}/renderReferenceOverflowButton.js.map +0 -0
  210. /package/lib/contexts/{reference-v2/index.js → index.js} +0 -0
  211. /package/lib/contexts/{reference-v2/index.js.map → index.js.map} +0 -0
  212. /package/lib/contexts/{reference-v2/referenceListContext.js → referenceListContext.js} +0 -0
  213. /package/lib-commonjs/components/{reference-v2/ReferenceList → ReferenceList}/useReferenceListContextValues.js +0 -0
  214. /package/lib-commonjs/components/{reference-v2/ReferenceList → ReferenceList}/useReferenceListContextValues.js.map +0 -0
  215. /package/lib-commonjs/components/{reference-v2/ReferenceOverflowButton → ReferenceOverflowButton}/ReferenceOverflowButton.js +0 -0
  216. /package/lib-commonjs/components/{reference-v2/ReferenceOverflowButton → ReferenceOverflowButton}/ReferenceOverflowButton.js.map +0 -0
  217. /package/lib-commonjs/components/{reference-v2/ReferenceOverflowButton → ReferenceOverflowButton}/ReferenceOverflowButton.types.js +0 -0
  218. /package/lib-commonjs/components/{reference-v2/ReferenceOverflowButton → ReferenceOverflowButton}/ReferenceOverflowButton.types.js.map +0 -0
  219. /package/lib-commonjs/components/{reference-v2/ReferenceOverflowButton → ReferenceOverflowButton}/index.js +0 -0
  220. /package/lib-commonjs/components/{reference-v2/ReferenceOverflowButton → ReferenceOverflowButton}/index.js.map +0 -0
  221. /package/lib-commonjs/components/{reference-v2/ReferenceOverflowButton → ReferenceOverflowButton}/renderReferenceOverflowButton.js +0 -0
  222. /package/lib-commonjs/components/{reference-v2/ReferenceOverflowButton → ReferenceOverflowButton}/renderReferenceOverflowButton.js.map +0 -0
  223. /package/lib-commonjs/components/{reference-v2/ReferenceOverflowButton → ReferenceOverflowButton}/useReferenceOverflowButtonStyles.styles.js +0 -0
  224. /package/lib-commonjs/contexts/{reference-v2/index.js → index.js} +0 -0
  225. /package/lib-commonjs/contexts/{reference-v2/index.js.map → index.js.map} +0 -0
  226. /package/lib-commonjs/contexts/{reference-v2/referenceListContext.js → referenceListContext.js} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["ReferenceList.tsx"],"sourcesContent":["import * as React from 'react';\nimport type { ForwardRefComponent } from '@fluentui/react-components';\nimport { renderReferenceList_unstable } from './renderReferenceList';\nimport { useReferenceList_unstable } from './useReferenceList';\nimport { useReferenceListStyles_unstable } from './useReferenceListStyles.styles';\nimport { useReferenceListContextValues_unstable } from './useReferenceListContextValues';\nimport type { ReferenceListProps } from './ReferenceList.types';\n\nexport const ReferenceList: ForwardRefComponent<ReferenceListProps> = React.forwardRef((props, ref) => {\n const state = useReferenceList_unstable(props, ref);\n const referenceListContextValues = useReferenceListContextValues_unstable(state);\n\n useReferenceListStyles_unstable(state);\n\n return renderReferenceList_unstable(state, referenceListContextValues);\n});\n\nReferenceList.displayName = 'ReferenceList';\n"],"names":["ReferenceList","React","forwardRef","props","state","useReferenceList_unstable","referenceListContextValues","useReferenceListContextValues_unstable","useReferenceListStyles_unstable","renderReferenceList_unstable","displayName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;qCAEsB;kCACH;8CACM;+CACO;AAGhD,MAAMA,gBAAAA,WAAAA,GAAAA,OAAyDC,UAAMC,CAAU,CAACC,OAACA;UACtFC,QAAMA,IAAAA,2CAAQC,EAAAA,OAA0BF;UACxCG,6BAAMA,IAAAA,qEAA6BC,EAAAA;qEAEnCC,EAAAA;WAEAC,IAAAA,iDAAOA,EAAAA,OAA6BL;AACtC;AAEAJ,cAAcU,WAAW,GAAG"}
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- //# sourceMappingURL=ReferenceList.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["ReferenceList.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\nimport type { ReferenceListContextValue } from '../../../contexts/reference-v2/referenceListContext';\n\nexport type ReferenceListSlots = {\n /** The root of the component that contains the list of references. */\n root: NonNullable<Slot<'div'>>;\n\n /** The region that contains the references and is used for arrow navigation. */\n arrowableRegion: NonNullable<Slot<'div'>>;\n\n /** A space containing a button that expands the list of references. This slot is only rendered when the list of references is collapsed. */\n showMoreButton?: Slot<'span'>;\n\n /** A space containing a button that collapses the list of references. This slot is only rendered when the list of references is expanded. */\n showLessButton?: Slot<'span'>;\n};\n\nexport type ReferenceListProps = ComponentProps<Partial<ReferenceListSlots>> & {\n /**\n * The maximum number of references to display before the overflow button is shown even if there is\n * enough space available to show more.\n * If not set, the overflow functionality will be disabled.\n * If this value is less than `minVisibleReferences`, then `minVisibleReferences` will take precedence.\n * @default undefined\n */\n maxVisibleReferences?: number;\n\n /**\n * The minimum number of references to always show before overflowing.\n * If this value exceeds the number of references, the overflow functionality will be disabled.\n * If this value is greater than `maxVisibleReferences`, then this will take precedence.\n * @default undefined\n */\n minVisibleReferences?: number;\n};\n\nexport type ReferenceListState = ComponentState<ReferenceListSlots> &\n Pick<ReferenceListProps, 'maxVisibleReferences' | 'minVisibleReferences'> & {\n areReferencesExpanded: boolean;\n overflowButtonTriggeredViaKeyboard: React.MutableRefObject<boolean>;\n referenceListRef: React.RefObject<HTMLDivElement>;\n shouldUseOverflow: boolean;\n totalReferencesCount: number;\n };\n\nexport type ReferenceListContextValues = {\n referenceList: ReferenceListContextValue;\n};\n"],"names":[],"rangeMappings":"","mappings":""}
@@ -1,32 +0,0 @@
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
- ReferenceList: function() {
13
- return _ReferenceList.ReferenceList;
14
- },
15
- referenceListClassNames: function() {
16
- return _useReferenceListStylesstyles.referenceListClassNames;
17
- },
18
- renderReferenceList_unstable: function() {
19
- return _renderReferenceList.renderReferenceList_unstable;
20
- },
21
- useReferenceListStyles_unstable: function() {
22
- return _useReferenceListStylesstyles.useReferenceListStyles_unstable;
23
- },
24
- useReferenceList_unstable: function() {
25
- return _useReferenceList.useReferenceList_unstable;
26
- }
27
- });
28
- const _ReferenceList = require("./ReferenceList");
29
- const _renderReferenceList = require("./renderReferenceList");
30
- const _useReferenceList = require("./useReferenceList");
31
- const _useReferenceListStylesstyles = require("./useReferenceListStyles.styles");
32
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export { ReferenceList } from './ReferenceList';\nexport type { ReferenceListContextValues, ReferenceListProps, ReferenceListSlots, ReferenceListState } from './ReferenceList.types';\nexport { renderReferenceList_unstable } from './renderReferenceList';\nexport { useReferenceList_unstable } from './useReferenceList';\nexport { referenceListClassNames, useReferenceListStyles_unstable } from './useReferenceListStyles.styles';\n"],"names":["ReferenceList","referenceListClassNames","renderReferenceList_unstable","useReferenceListStyles_unstable","useReferenceList_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,aAAa;eAAbA,4BAAa;;IAIbC,uBAAuB;eAAvBA,qDAAuB;;IAFvBC,4BAA4B;eAA5BA,iDAA4B;;IAEHC,+BAA+B;eAA/BA,6DAA+B;;IADxDC,yBAAyB;eAAzBA,2CAAyB;;;+BAHJ;qCAEe;kCACH;8CAC+B"}
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "renderReferenceList_unstable", {
6
- enumerable: true,
7
- get: function() {
8
- return renderReferenceList_unstable;
9
- }
10
- });
11
- const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
12
- const _reactcomponents = require("@fluentui/react-components");
13
- const _referenceListContext = require("../../../contexts/reference-v2/referenceListContext");
14
- const renderReferenceList_unstable = (state, contextValues)=>{
15
- (0, _reactcomponents.assertSlots)(state);
16
- const { minVisibleReferences } = state;
17
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_referenceListContext.ReferenceListContextProvider, {
18
- value: contextValues.referenceList,
19
- children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactcomponents.Overflow, {
20
- minimumVisible: minVisibleReferences,
21
- children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(state.root, {
22
- children: [
23
- /*#__PURE__*/ (0, _jsxruntime.jsx)(state.arrowableRegion, {}),
24
- state.showMoreButton && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.showMoreButton, {}),
25
- state.showLessButton && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.showLessButton, {})
26
- ]
27
- })
28
- })
29
- });
30
- }; //# sourceMappingURL=renderReferenceList.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["renderReferenceList.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { Overflow, assertSlots } from '@fluentui/react-components';\nimport type { ReferenceListState, ReferenceListSlots, ReferenceListContextValues } from './ReferenceList.types';\nimport { ReferenceListContextProvider } from '../../../contexts/reference-v2/referenceListContext';\n\n/**\n * Render the final JSX of ReferenceList\n */\nexport const renderReferenceList_unstable = (state: ReferenceListState, contextValues: ReferenceListContextValues) => {\n assertSlots<ReferenceListSlots>(state);\n\n const { minVisibleReferences } = state;\n\n return (\n <ReferenceListContextProvider value={contextValues.referenceList}>\n <Overflow minimumVisible={minVisibleReferences}>\n <state.root>\n <state.arrowableRegion />\n {state.showMoreButton && <state.showMoreButton />}\n {state.showLessButton && <state.showLessButton />}\n </state.root>\n </Overflow>\n </ReferenceListContextProvider>\n );\n};\n"],"names":["assertSlots","state","minVisibleReferences","contextValues","minimumVisible","referenceList","showMoreButton","root","showLessButton","arrowableRegion","_jsx"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWEA;;;eAAAA;;;4BAVF;iCAEsC;sCAEO;AAM3CA,MAAAA,+BAAgCC,CAAAA,OAAAA;oCAExBC,EAAAA;UAER,sBACuCC;sBACzBC,GAAAA,IAAAA,eAAAA,EAAAA,kDAAgBF,EAAAA;6BACxBG,aAAA;;;iCAESC,GAAAA,IAAAA,gBAAAA,EAAAA,MAAcC,IAAA,EAAA;;+BACdC,GAAAA,IAAAA,eAAAA,EAAAA,MAAcC,eAAI,EAAA,CAAA;oBAACR,MAAMO,cAAc,IAAA,WAAA,GAAAE,IAAAA,eAAA,EAAAT,MAAAK,cAAA,EAAA,CAAA;oBAAAL,MAAAO,cAAA,IAAA,WAAA,GAAAE,IAAAA,eAAA,EAAAT,MAAAO,cAAA,EAAA,CAAA;iBAAA;;;;GAKxD,+CAAE"}
@@ -1,86 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "useReferenceList_unstable", {
6
- enumerable: true,
7
- get: function() {
8
- return useReferenceList_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 _reactutilities = require("@fluentui-copilot/react-utilities");
15
- const _useReferenceStylesstyles = require("../Reference/useReferenceStyles.styles");
16
- const useReferenceList_unstable = (props, ref)=>{
17
- const { arrowableRegion, children, maxVisibleReferences, minVisibleReferences, showLessButton, showMoreButton, ...rest } = props;
18
- const [areReferencesExpanded, setAreReferencesExpanded] = _react.useState(false);
19
- const referenceListRef = _react.useRef(null);
20
- const totalReferencesCount = _react.Children.count(children);
21
- const styles = (0, _useReferenceStylesstyles.useRootStyles)();
22
- const resolvedChildren = (0, _reactutilities.useOverflowMaxVisibleItems)({
23
- additionalCondition: !areReferencesExpanded,
24
- children,
25
- maxVisibleItems: maxVisibleReferences,
26
- minVisibleItems: minVisibleReferences,
27
- overflowClassName: styles.overflow
28
- });
29
- // We keep track of whether we are interacting with the overflow button via keyboard or not.
30
- const overflowButtonTriggeredViaKeyboard = _react.useRef(false);
31
- const focusAttributes = (0, _reactcomponents.useArrowNavigationGroup)({
32
- axis: 'both',
33
- circular: true,
34
- memorizeCurrent: true
35
- });
36
- const onShowMoreButtonClick = _react.useCallback(()=>{
37
- setAreReferencesExpanded(true);
38
- }, []);
39
- const onShowLessButtonClick = _react.useCallback(()=>{
40
- setAreReferencesExpanded(false);
41
- }, []);
42
- const shouldUseOverflow = (minVisibleReferences === undefined || minVisibleReferences < totalReferencesCount) && maxVisibleReferences !== undefined && !areReferencesExpanded;
43
- // Since the overflow button is an OverflowItem that's always visible, we need to account for it.
44
- const minVisibleOverflowItems = minVisibleReferences ? minVisibleReferences + 1 : 1;
45
- const state = {
46
- areReferencesExpanded,
47
- overflowButtonTriggeredViaKeyboard,
48
- maxVisibleReferences,
49
- minVisibleReferences: minVisibleOverflowItems,
50
- referenceListRef,
51
- shouldUseOverflow,
52
- totalReferencesCount,
53
- components: {
54
- root: 'div',
55
- arrowableRegion: 'div',
56
- showMoreButton: 'span',
57
- showLessButton: 'span'
58
- },
59
- root: _reactcomponents.slot.always((0, _reactcomponents.getIntrinsicElementProps)('div', {
60
- ref: (0, _reactcomponents.useMergedRefs)(ref, referenceListRef),
61
- ...rest
62
- }), {
63
- elementType: 'div'
64
- }),
65
- arrowableRegion: _reactcomponents.slot.always(arrowableRegion, {
66
- defaultProps: {
67
- ...focusAttributes,
68
- children: resolvedChildren
69
- },
70
- elementType: 'div'
71
- }),
72
- showMoreButton: shouldUseOverflow ? _reactcomponents.slot.optional(showMoreButton, {
73
- elementType: 'span'
74
- }) : undefined,
75
- showLessButton: areReferencesExpanded ? _reactcomponents.slot.optional(showLessButton, {
76
- elementType: 'span'
77
- }) : undefined
78
- };
79
- if (state.showMoreButton) {
80
- state.showMoreButton.onClick = (0, _reactcomponents.mergeCallbacks)(onShowMoreButtonClick, state.showMoreButton.onClick);
81
- }
82
- if (state.showLessButton) {
83
- state.showLessButton.onClick = (0, _reactcomponents.mergeCallbacks)(onShowLessButtonClick, state.showLessButton.onClick);
84
- }
85
- return state;
86
- }; //# sourceMappingURL=useReferenceList.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["useReferenceList.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n getIntrinsicElementProps,\n mergeCallbacks,\n slot,\n useArrowNavigationGroup,\n useMergedRefs,\n} from '@fluentui/react-components';\nimport { useOverflowMaxVisibleItems } from '@fluentui-copilot/react-utilities';\nimport { useRootStyles } from '../Reference/useReferenceStyles.styles';\nimport type { ReferenceListProps, ReferenceListState } from './ReferenceList.types';\n\n/**\n * Create the state required to render ReferenceList.\n *\n * The returned state can be modified with hooks such as useReferenceListStyles_unstable,\n * before being passed to renderReferenceList_unstable.\n *\n * @param props - props from this instance of ReferenceList\n * @param ref - reference to root HTMLElement of ReferenceList\n */\nexport const useReferenceList_unstable = (\n props: ReferenceListProps,\n ref: React.Ref<HTMLDivElement>,\n): ReferenceListState => {\n const {\n arrowableRegion,\n children,\n maxVisibleReferences,\n minVisibleReferences,\n showLessButton,\n showMoreButton,\n ...rest\n } = props;\n\n const [areReferencesExpanded, setAreReferencesExpanded] = React.useState(false);\n const referenceListRef = React.useRef<HTMLDivElement>(null);\n\n const totalReferencesCount = React.Children.count(children);\n const styles = useRootStyles();\n const resolvedChildren = useOverflowMaxVisibleItems({\n additionalCondition: !areReferencesExpanded,\n children,\n maxVisibleItems: maxVisibleReferences,\n minVisibleItems: minVisibleReferences,\n overflowClassName: styles.overflow,\n });\n\n // We keep track of whether we are interacting with the overflow button via keyboard or not.\n const overflowButtonTriggeredViaKeyboard = React.useRef(false);\n\n const focusAttributes = useArrowNavigationGroup({\n axis: 'both',\n circular: true,\n memorizeCurrent: true,\n });\n\n const onShowMoreButtonClick = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>(() => {\n setAreReferencesExpanded(true);\n }, []);\n\n const onShowLessButtonClick = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>(() => {\n setAreReferencesExpanded(false);\n }, []);\n\n const shouldUseOverflow =\n (minVisibleReferences === undefined || minVisibleReferences < totalReferencesCount) &&\n maxVisibleReferences !== undefined &&\n !areReferencesExpanded;\n\n // Since the overflow button is an OverflowItem that's always visible, we need to account for it.\n const minVisibleOverflowItems = minVisibleReferences ? minVisibleReferences + 1 : 1;\n\n const state: ReferenceListState = {\n areReferencesExpanded,\n overflowButtonTriggeredViaKeyboard,\n maxVisibleReferences,\n minVisibleReferences: minVisibleOverflowItems,\n referenceListRef,\n shouldUseOverflow,\n totalReferencesCount,\n\n components: {\n root: 'div',\n arrowableRegion: 'div',\n showMoreButton: 'span',\n showLessButton: 'span',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref: useMergedRefs(ref, referenceListRef),\n ...rest,\n }),\n { elementType: 'div' },\n ),\n arrowableRegion: slot.always(arrowableRegion, {\n defaultProps: { ...focusAttributes, children: resolvedChildren },\n elementType: 'div',\n }),\n showMoreButton: shouldUseOverflow ? slot.optional(showMoreButton, { elementType: 'span' }) : undefined,\n showLessButton: areReferencesExpanded ? slot.optional(showLessButton, { elementType: 'span' }) : undefined,\n };\n\n if (state.showMoreButton) {\n state.showMoreButton.onClick = mergeCallbacks(onShowMoreButtonClick, state.showMoreButton.onClick);\n }\n\n if (state.showLessButton) {\n state.showLessButton.onClick = mergeCallbacks(onShowLessButtonClick, state.showLessButton.onClick);\n }\n\n return state;\n};\n"],"names":["arrowableRegion","maxVisibleReferences","referenceListRef","children","totalReferencesCount","useRootStyles","minVisibleReferences","resolvedChildren","additionalCondition","overflowClassName","styles","React","useState","useRef","Children","count","overflowButtonTriggeredViaKeyboard","focusAttributes","areReferencesExpanded","memorizeCurrent","minVisibleItems","onShowMoreButtonClick","useCallback","setAreReferencesExpanded","axis","circular","shouldUseOverflow","components","root","minVisibleOverflowItems","elementType","defaultProps","ref","showMoreButton","undefined","showLessButton","slot","optional","state"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA0BIA;;;eAAAA;;;;iEA1BmB;iCAOhB;gCACoC;0CACb;AAgB5B,MACEA,4BAEAC,CAAAA,OAAAA;UAOF,EACAD,eAAME,EAENC,QAAMC,EACNH,oBAAeI,EACfC,oBAAMC,gBACJC,gBACAL;UAGAM,CAAAA,uBAAmBC,yBAAe,GAAAC,OAAAC,QAAA,CAAA;UACpCV,mBAAAS,OAAAE,MAAA,CAAA;UAEAT,uBAAAO,OAAAG,QAAA,CAAAC,KAAA,CAAAZ;UACAO,SAAMM,IAAAA,uCAAAA;UAENT,mBAAMU,IAAAA,0CAA0C,EAAA;6BACxC,CAAAC;;yBAENC;QACFC,iBAAAd;QAEAG,mBAAMY,OAAAA,QAAwBV;;gGAEzB;UAELK,qCAAoCM,OAAWT,MAA6C,CAAA;UAC1FU,kBAAAA,IAAAA,wCAAyB,EAAA;QAC3BC,MAAK;QAELC,UAAMC;QAKNP,iBAAA;;UAGAE,wBAAkCV,OAAAW,WAAA,CAAA;iCAChCJ;;UAEAjB,wBAAAA,OAAAA,WAAAA,CAAAA;iCACAK;;UAEAoB,oBAAAA,CAAAA,yBAAAA,aAAAA,uBAAAA,oBAAAA,KAAAA,yBAAAA,aAAAA,CAAAA;qGACAtB;UAEAuB,0BAAYrB,uBAAAA,uBAAA,IAAA;kBACVsB;;;;8BAIFC;;;;oBAME;kBAAEC;6BAAmB;4BAEvB9B;4BACE+B;;0CAAoC5B,CAAAA,IAAAA,yCAAUI,EAAAA,OAAAA;mDAAiB,EAAAyB,KAAA9B;mBAC/D4B;YACF;yBACAG;;yBAA6FC,qBAAAA,CAAAA,MAAAA,CAAAA,iBAAAA;0BAC7FC;kCAAqF;gBAAOhC,UAAK+B;YACnG;YAEAJ,aAAUG;;QAEVA,gBAAAP,oBAAAU,qBAAA,CAAAC,QAAA,CAAAJ,gBAAA;YAEAH,aAAUK;aACRG;QACFH,gBAAAjB,wBAAAkB,qBAAA,CAAAC,QAAA,CAAAF,gBAAA;YAEAL,aAAOQ;QACP,KAAAJ"}
@@ -1,62 +0,0 @@
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
- referenceListClassNames: function() {
13
- return referenceListClassNames;
14
- },
15
- useReferenceListStyles_unstable: function() {
16
- return useReferenceListStyles_unstable;
17
- }
18
- });
19
- const _reactcomponents = require("@fluentui/react-components");
20
- const referenceListClassNames = {
21
- root: 'fai-ReferenceList',
22
- arrowableRegion: 'fai-ReferenceList__arrowableRegion',
23
- showMoreButton: 'fai-ReferenceList__showMoreButton',
24
- showLessButton: 'fai-ReferenceList__showLessButton'
25
- };
26
- /**
27
- * Styles for the root slot
28
- */ const useRootBaseClassName = (0, _reactcomponents.__resetStyles)("rylvie1", null, [
29
- ".rylvie1{display:flex;flex-direction:row;gap:var(--spacingVerticalXS) var(--spacingHorizontalXS);}"
30
- ]);
31
- const useRootStyles = (0, _reactcomponents.__styles)({
32
- referencesExpanded: {
33
- Eh141a: "fni485r"
34
- }
35
- }, {
36
- d: [
37
- ".fni485r{flex-wrap:wrap;}"
38
- ]
39
- });
40
- const useArrowableRegionBaseClassName = (0, _reactcomponents.__resetStyles)("rhs5m2c", null, [
41
- ".rhs5m2c{display:contents;max-width:100%;}"
42
- ]);
43
- const useOverflowButtonBaseClassName = (0, _reactcomponents.__resetStyles)("rulvm7g", null, [
44
- ".rulvm7g{display:inline-flex;flex-shrink:0;}"
45
- ]);
46
- const useReferenceListStyles_unstable = (state)=>{
47
- 'use no memo';
48
- const { areReferencesExpanded, shouldUseOverflow } = state;
49
- const rootBaseClassName = useRootBaseClassName();
50
- const arrowableRegionBaseClassName = useArrowableRegionBaseClassName();
51
- const overflowButtonBaseClassName = useOverflowButtonBaseClassName();
52
- const rootStyles = useRootStyles();
53
- state.root.className = (0, _reactcomponents.mergeClasses)(referenceListClassNames.root, rootBaseClassName, (areReferencesExpanded || !shouldUseOverflow) && rootStyles.referencesExpanded, state.root.className);
54
- state.arrowableRegion.className = (0, _reactcomponents.mergeClasses)(referenceListClassNames.arrowableRegion, arrowableRegionBaseClassName, state.arrowableRegion.className);
55
- if (state.showMoreButton) {
56
- state.showMoreButton.className = (0, _reactcomponents.mergeClasses)(referenceListClassNames.showMoreButton, overflowButtonBaseClassName, state.showMoreButton.className);
57
- }
58
- if (state.showLessButton) {
59
- state.showLessButton.className = (0, _reactcomponents.mergeClasses)(referenceListClassNames.showLessButton, overflowButtonBaseClassName, state.showLessButton.className);
60
- }
61
- return state;
62
- }; //# sourceMappingURL=useReferenceListStyles.styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["useReferenceListStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\nimport type { ReferenceListSlots, ReferenceListState } from './ReferenceList.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const referenceListClassNames: SlotClassNames<ReferenceListSlots> = {\n root: 'fai-ReferenceList',\n arrowableRegion: 'fai-ReferenceList__arrowableRegion',\n showMoreButton: 'fai-ReferenceList__showMoreButton',\n showLessButton: 'fai-ReferenceList__showLessButton',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootBaseClassName = makeResetStyles({\n display: 'flex',\n flexDirection: 'row',\n gap: `${tokens.spacingVerticalXS} ${tokens.spacingHorizontalXS}`,\n});\n\nconst useRootStyles = makeStyles({\n referencesExpanded: {\n flexWrap: 'wrap',\n },\n});\n\nconst useArrowableRegionBaseClassName = makeResetStyles({\n display: 'contents',\n maxWidth: '100%',\n});\n\nconst useOverflowButtonBaseClassName = makeResetStyles({\n display: 'inline-flex',\n flexShrink: 0,\n});\n\n/**\n * Apply styling to the ReferenceList slots based on the state\n */\nexport const useReferenceListStyles_unstable = (state: ReferenceListState): ReferenceListState => {\n 'use no memo';\n\n const { areReferencesExpanded, shouldUseOverflow } = state;\n\n const rootBaseClassName = useRootBaseClassName();\n const arrowableRegionBaseClassName = useArrowableRegionBaseClassName();\n const overflowButtonBaseClassName = useOverflowButtonBaseClassName();\n const rootStyles = useRootStyles();\n\n state.root.className = mergeClasses(\n referenceListClassNames.root,\n rootBaseClassName,\n (areReferencesExpanded || !shouldUseOverflow) && rootStyles.referencesExpanded,\n state.root.className,\n );\n\n state.arrowableRegion.className = mergeClasses(\n referenceListClassNames.arrowableRegion,\n arrowableRegionBaseClassName,\n state.arrowableRegion.className,\n );\n\n if (state.showMoreButton) {\n state.showMoreButton.className = mergeClasses(\n referenceListClassNames.showMoreButton,\n overflowButtonBaseClassName,\n state.showMoreButton.className,\n );\n }\n\n if (state.showLessButton) {\n state.showLessButton.className = mergeClasses(\n referenceListClassNames.showLessButton,\n overflowButtonBaseClassName,\n state.showLessButton.className,\n );\n }\n\n return state;\n};\n"],"names":["referenceListClassNames","useOverflowButtonBaseClassName","makeResetStyles","root","arrowableRegion","showMoreButton","showLessButton","display","__resetStyles","flexDirection","__styles","spacingVerticalXS","Eh141a","useArrowableRegionBaseClassName","areReferencesExpanded","state","rootBaseClassName","useRootBaseClassName","arrowableRegionBaseClassName","shouldUseOverflow","overflowButtonBaseClassName","rootStyles","useRootStyles","mergeClasses","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,uBAAAA;eAAAA;;IA2BPC,+BAAiCC;eAAjCD;;;iCAhC4C;AAK3C,MAAMD,0BAA8D;UACzEG;qBACAC;oBACAC;oBACAC;AACF;AAEA;;CAEC,SAECC,uBAASC,IAAAA,8BAAA,EAAA,WAAA,MAAA;IAAA;CAAA;MACTC,gBAAeC,IAAAA,yBAAA,EAAA;wBACAC;QACjBC,QAAA;IAEA;;;;KAEc;;AAEd,MAAAC,kCAAAL,IAAAA,8BAAA,EAAA,WAAA,MAAA;IAAA;CAAA;AAEA,MAAMK,iCAAAA,IAAAA,8BAAkCX,EAAAA,WAAgB,MAAA;IAAA;CAAA;AAKlDD,MAAAA,kCAAiCC,CAAAA;;IAGvC,MAAA,EAEAY,qBAAA,qBAEC,GACDC;UACEC,oBAAAC;UAEAC,+BAA+BC;UAE/BC,8BAA0BH;UAC1BI,aAAMH;UACNf,IAAMiB,CAAAA,SAAAA,GAAAA,IAAAA,6BAAAA,EAAAA,wBAA8BnB,IAAAA,EAAAA,mBAAAA,CAAAA,yBAAAA,CAAAA,iBAAAA,KAAAA,WAAAA,kBAAAA,EAAAA,MAAAA,IAAAA,CAAAA,SAAAA;UACpCG,eAAmBkB,CAAAA,SAAAA,GAAAA,IAAAA,6BAAAA,EAAAA,wBAAAA,eAAAA,EAAAA,8BAAAA,MAAAA,eAAAA,CAAAA,SAAAA;QAEnBP,MAAMZ,cAAc,EAAGoB;QAOvBR,MAAMX,cAAAA,CAAeoB,SAACA,GAASD,IAAAA,6BAAGA,EAAAA,wBAChCvB,cAAwBI,EAAegB,6BACvCF,MACAH,cAAMX,CAAAA,SAAgBoB;;cAItBT,cAAMV,EAAc;QAKtBU,MAAAT,cAAA,CAAAkB,SAAA,GAAAD,IAAAA,6BAAA,EAAAvB,wBAAAM,cAAA,EAAAc,6BAAAL,MAAAT,cAAA,CAAAkB,SAAA;;WAGET;4DAOKA"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["useReferenceOverflowButton.ts"],"sourcesContent":["import * as React from 'react';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\nimport {\n getIntrinsicElementProps,\n mergeCallbacks,\n slot,\n useFocusFinders,\n useId,\n useMergedRefs,\n useOverflowMenu,\n} from '@fluentui/react-components';\nimport { useTimeout } from '@fluentui/react-utilities';\nimport { useReferenceListContext_unstable } from '../../../contexts/reference-v2/referenceListContext';\nimport type { ReferenceOverflowButtonProps, ReferenceOverflowButtonState } from './ReferenceOverflowButton.types';\nimport { useDesignVersion } from '@fluentui-copilot/react-provider';\n\n/**\n * Create the state required to render ReferenceOverflowButton.\n *\n * The returned state can be modified with hooks such as useReferenceOverflowButtonStyles_unstable,\n * before being passed to renderReferenceOverflowButton_unstable.\n *\n * @param props - props from this instance of ReferenceOverflowButton\n * @param ref - reference to root HTMLElement of ReferenceOverflowButton\n */\nexport const useReferenceOverflowButton_unstable = (\n props: ReferenceOverflowButtonProps,\n ref: React.Ref<HTMLButtonElement>,\n): ReferenceOverflowButtonState => {\n 'use no memo';\n\n const { children, id, text } = props;\n const designVersion = useDesignVersion(props.designVersion);\n\n const rootRef = React.useRef<HTMLButtonElement>(null);\n\n const [setTimeout] = useTimeout();\n\n const referenceOverflowButtonId = useId('reference-overflow-button-', id);\n\n const areReferencesExpanded = useReferenceListContext_unstable(ctx => ctx.areReferencesExpanded);\n const maxVisibleReferences = useReferenceListContext_unstable(ctx => ctx.maxVisibleReferences);\n const referenceListRef = useReferenceListContext_unstable(ctx => ctx.referenceListRef);\n const totalReferencesCount = useReferenceListContext_unstable(ctx => ctx.totalReferencesCount);\n const triggeredViaKeyboard = useReferenceListContext_unstable(ctx => ctx.overflowButtonTriggeredViaKeyboard);\n\n const { isOverflowing, overflowCount } = useOverflowMenu();\n\n const processedText = children ?? (typeof text === 'function' ? text(overflowCount) : text);\n\n const { findFirstFocusable, findNextFocusable } = useFocusFinders();\n const onKeyDown = React.useCallback<React.KeyboardEventHandler<HTMLButtonElement>>(\n ev => {\n if (ev.key === Enter || ev.key === Space) {\n triggeredViaKeyboard.current = true;\n }\n },\n [triggeredViaKeyboard],\n );\n\n // We keep track of the previous overflow count to help determine the element to move focus to when expanding the references via keyboard.\n const previousOverflow = React.useRef(0);\n\n // When the references are expanded or collapsed via keyboard, we need to move focus to the appropriate element.\n React.useEffect(() => {\n // We only try to move focus if maxVisibleReferences is set and the overflow button was triggered via keyboard.\n if (maxVisibleReferences !== undefined && triggeredViaKeyboard.current) {\n let elementToFocus: HTMLElement | null | undefined;\n\n // If the references are collapsed, we move focus to the overflow button.\n if (!areReferencesExpanded) {\n elementToFocus = rootRef.current;\n previousOverflow.current = overflowCount;\n }\n // If the references are expanded, we move focus to the first reference that was hidden when they were collapsed.\n // We do this by moving focus according to the following heuristics:\n // - If maxVisibleReferences is what determines what overflows, focus is moved to the element that is in the maxVisibleReferences position of the ReferenceList's children.\n // - If the space available is what is determines what overflows, focus is moved to the element that is in the (totalReferencesCount - overflowCount) position of the ReferenceList's children.\n else if (rootRef.current && referenceListRef.current) {\n const positionToFocus =\n maxVisibleReferences < totalReferencesCount - previousOverflow.current\n ? maxVisibleReferences\n : totalReferencesCount - previousOverflow.current;\n\n let currentElement: HTMLElement | null | undefined = findFirstFocusable(referenceListRef.current);\n for (let i = 0; i < positionToFocus && currentElement; i++) {\n currentElement = findNextFocusable(currentElement);\n }\n\n elementToFocus = currentElement;\n }\n\n // We focus on the element and reset the triggeredViaKeyboard flag after a timeout to ensure that this is pushed at the end of the event queue.\n setTimeout(() => {\n elementToFocus?.focus();\n triggeredViaKeyboard.current = false;\n }, 0);\n }\n }, [\n areReferencesExpanded,\n findFirstFocusable,\n findNextFocusable,\n isOverflowing,\n maxVisibleReferences,\n overflowCount,\n referenceListRef,\n setTimeout,\n totalReferencesCount,\n triggeredViaKeyboard,\n ]);\n\n const state: ReferenceOverflowButtonState = {\n designVersion,\n id: referenceOverflowButtonId,\n shouldRenderOverflowButton: isOverflowing || areReferencesExpanded,\n\n components: {\n root: 'button',\n },\n\n root: slot.always(\n getIntrinsicElementProps('button', {\n ref: useMergedRefs(rootRef, ref),\n ...props,\n }),\n {\n defaultProps: {\n children: processedText,\n },\n elementType: 'button',\n },\n ),\n };\n\n state.root.onKeyDown = mergeCallbacks(onKeyDown, props.onKeyDown);\n\n return state;\n};\n"],"names":["useReferenceOverflowButton_unstable","props","ref","children","setTimeout","id","text","designVersion","referenceListRef","useReferenceListContext_unstable","rootRef","totalReferencesCount","triggeredViaKeyboard","referenceOverflowButtonId","overflowCount","useOverflowMenu","areReferencesExpanded","maxVisibleReferences","useFocusFinders","React","ev","Enter","ctx","overflowButtonTriggeredViaKeyboard","isOverflowing","processedText","findFirstFocusable","onKeyDown","undefined","elementToFocus","current","currentElement","findNextFocusable","previousOverflow","i","positionToFocus","state","shouldRenderOverflowButton","components","slot","always","getIntrinsicElementProps","root","defaultProps","mergeCallbacks"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA6BEA;;;eAAAA;;;;iEA7BqB;8BACM;iCAStB;gCACoB;sCACsB;+BAEhB;AAe/B,MAAAA,sCAAA,CAAAC,OAAAC;;UAKA,EAEAC,QAAOC,EAEPC,EAAA,EAEAC,IAAA,KACAL;UACAM,gBAAMC,IAAAA,+BAAmBC,EAAAA,MAAAA,aAAAA;UACzBC,UAAMC,OAAAA,MAAAA,CAAAA;UACN,CAAAP,WAAMQ,GAAAA,IAAAA,0BAAuBH;UAE7BI,4BAAuBC,IAAAA,sBAAa,EAAE,8BAAGC;UAEzCC,wBAAsBb,IAAAA,sDAAAA,EAAAA,CAAAA,MAAAA,IAAAA,qBAA6B;UAEnDc,uBAA0BR,IAAAA,sDAAwBS,EAAAA,CAAAA,MAAAA,IAAAA,oBAAAA;UAClDV,mBAAkBW,IAAAA,sDAChBC,EAAAA,CAAAA,MAAAA,IAAAA,gBAAAA;UACET,uBAAeU,IAAAA,sDAA2B,EAAAC,CAAAA,MAAAA,IAAAX,oBAAA;iCACxCC,IAAAA,sDAA+B,EAAAU,CAAAA,MAAAA,IAAAC,kCAAA;UACjC,EACFC,aACA,eAACZ,KAAqBG,IAAAA,gCAAA;UAGxBU,gBAAAtB,aAAA,QAAAA,aAAA,KAAA,IAAAA,WAAA,OAAAG,SAAA,aAAAA,KAAAQ,iBAAAR;UACA,EAEAoB,kBAAA,EACAP,iBAAgB,yCACd;UACAQ,YAAIV,OAAAA,WAAyBW,CAAAA,CAAAA;kBAC3B,KAAIC,mBAAAA,IAAAA,GAAAA,GAAAA,KAAAA,mBAAAA,EAAAA;iCAEJC,OAAA,GAAA;;;;KAEED;8IAC2Bf;6BAMpBJ,OAAQoB,MAAO,CAAA;oHAGhBb;oBAGN,CAAA;uHAC4D;qCAC1Dc,aAAiBC,qBAAkBD,OAAAA,EAAAA;;qFAGpBA;wCACnB;iCAEArB,QAAAoB,OAAA;iCACWA,OAAA,GAAAhB;uBACTe,QAAAA,OAAAA,IAAAA,iBAAAA,OAAAA,EAAAA;wCACAjB,uBAA+BD,uBAAAsB,iBAAAH,OAAA,GAAAb,uBAAAN,uBAAAsB,iBAAAH,OAAA;oBACjCC,iBAAGL,mBAAAlB,iBAAAsB,OAAA;gBACL,IAAA,IAAAI,IAAA,GAAAA,IAAAC,mBAAAJ,gBAAAG,IAAA;oBACCH,iBAAAC,kBAAAD;gBACDf;gBACAU,iBAAAA;;2JAEAF;uBACAP;gBACAH,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAAA,KAAAA;gBACAN,qBAAAA,OAAAA,GAAAA;eACAJ;;;;QAEAQ;QAAAA;QAAAA;QAAAA;QAAAA;QAAAA;QAAAA;QAAAA;QAAAA;KAAAA;UACDwB,QAAA;QAED7B;YACEA;oCACIM,iBAAAA;oBACJwB;kBAEAC;;cAEAC,qBAAA,CAAAC,MAAA,CAAAC,IAAAA,yCAAA,EAAA,UAAA;iBAEAC,IAAAA,8BAAWF,EAAM9B,SACf+B;oBACEvC;;0BAGF;0BACEyC;;yBAEA;;;UAIND,IAAA,CAAAf,SAAA,GAAAiB,IAAAA,+BAAA,EAAAjB,WAAA1B,MAAA0B,SAAA;WAEAS;GAGF,sDAAE"}
@@ -1,64 +0,0 @@
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
- Reference: function() {
13
- return _Reference.Reference;
14
- },
15
- ReferenceList: function() {
16
- return _ReferenceList.ReferenceList;
17
- },
18
- ReferenceOverflowButton: function() {
19
- return _ReferenceOverflowButton.ReferenceOverflowButton;
20
- },
21
- referenceClassNames: function() {
22
- return _Reference.referenceClassNames;
23
- },
24
- referenceExtraClassNames: function() {
25
- return _Reference.referenceExtraClassNames;
26
- },
27
- referenceListClassNames: function() {
28
- return _ReferenceList.referenceListClassNames;
29
- },
30
- referenceOverflowButtonClassNames: function() {
31
- return _ReferenceOverflowButton.referenceOverflowButtonClassNames;
32
- },
33
- renderReferenceList_unstable: function() {
34
- return _ReferenceList.renderReferenceList_unstable;
35
- },
36
- renderReferenceOverflowButton_unstable: function() {
37
- return _ReferenceOverflowButton.renderReferenceOverflowButton_unstable;
38
- },
39
- renderReference_unstable: function() {
40
- return _Reference.renderReference_unstable;
41
- },
42
- useReferenceListStyles_unstable: function() {
43
- return _ReferenceList.useReferenceListStyles_unstable;
44
- },
45
- useReferenceList_unstable: function() {
46
- return _ReferenceList.useReferenceList_unstable;
47
- },
48
- useReferenceOverflowButtonStyles_unstable: function() {
49
- return _ReferenceOverflowButton.useReferenceOverflowButtonStyles_unstable;
50
- },
51
- useReferenceOverflowButton_unstable: function() {
52
- return _ReferenceOverflowButton.useReferenceOverflowButton_unstable;
53
- },
54
- useReferenceStyles_unstable: function() {
55
- return _Reference.useReferenceStyles_unstable;
56
- },
57
- useReference_unstable: function() {
58
- return _Reference.useReference_unstable;
59
- }
60
- });
61
- const _Reference = require("./Reference");
62
- const _ReferenceList = require("./ReferenceList");
63
- const _ReferenceOverflowButton = require("./ReferenceOverflowButton");
64
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export type { ReferenceProps, ReferenceSlots, ReferenceState } from './Reference';\nexport { Reference, referenceClassNames, referenceExtraClassNames, renderReference_unstable, useReferenceStyles_unstable, useReference_unstable } from './Reference';\nexport type { ReferenceListContextValues, ReferenceListProps, ReferenceListSlots, ReferenceListState } from './ReferenceList';\nexport { ReferenceList, referenceListClassNames, renderReferenceList_unstable, useReferenceListStyles_unstable, useReferenceList_unstable } from './ReferenceList';\nexport type { ReferenceOverflowButtonProps, ReferenceOverflowButtonSlots, ReferenceOverflowButtonState } from './ReferenceOverflowButton';\nexport { ReferenceOverflowButton, referenceOverflowButtonClassNames, renderReferenceOverflowButton_unstable, useReferenceOverflowButtonStyles_unstable, useReferenceOverflowButton_unstable } from './ReferenceOverflowButton';\n"],"names":["Reference","ReferenceList","ReferenceOverflowButton","referenceClassNames","referenceExtraClassNames","referenceListClassNames","referenceOverflowButtonClassNames","renderReferenceList_unstable","renderReferenceOverflowButton_unstable","renderReference_unstable","useReferenceListStyles_unstable","useReferenceList_unstable","useReferenceOverflowButtonStyles_unstable","useReferenceOverflowButton_unstable","useReferenceStyles_unstable","useReference_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACSA,SAAS;eAATA,oBAAS;;IAETC,aAAa;eAAbA,4BAAa;;IAEbC,uBAAuB;eAAvBA,gDAAuB;;IAJZC,mBAAmB;eAAnBA,8BAAmB;;IAAEC,wBAAwB;eAAxBA,mCAAwB;;IAEzCC,uBAAuB;eAAvBA,sCAAuB;;IAEbC,iCAAiC;eAAjCA,0DAAiC;;IAFlBC,4BAA4B;eAA5BA,2CAA4B;;IAERC,sCAAsC;eAAtCA,+DAAsC;;IAJxCC,wBAAwB;eAAxBA,mCAAwB;;IAEZC,+BAA+B;eAA/BA,8CAA+B;;IAAEC,yBAAyB;eAAzBA,wCAAyB;;IAE5BC,yCAAyC;eAAzCA,kEAAyC;;IAAEC,mCAAmC;eAAnCA,4DAAmC;;IAJ9FC,2BAA2B;eAA3BA,sCAA2B;;IAAEC,qBAAqB;eAArBA,gCAAqB;;;2BAAQ;+BAEN;yCAEkD"}
@@ -1,29 +0,0 @@
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
- ReferenceGroupProvider: function() {
13
- return ReferenceGroupProvider;
14
- },
15
- useReferenceGroupSetOpen: function() {
16
- return useReferenceGroupSetOpen;
17
- }
18
- });
19
- const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
20
- const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
21
- // eslint-disable-next-line @typescript-eslint/no-empty-function
22
- const noop = ()=>{};
23
- const ReferenceGroupContext = /*#__PURE__*/ _react.createContext(undefined);
24
- const ReferenceGroupProvider = ReferenceGroupContext.Provider;
25
- const useReferenceGroupSetOpen = ()=>{
26
- const context = _react.useContext(ReferenceGroupContext);
27
- var _context_setOpen;
28
- return (_context_setOpen = context === null || context === void 0 ? void 0 : context.setOpen) !== null && _context_setOpen !== void 0 ? _context_setOpen : noop;
29
- }; //# sourceMappingURL=ReferenceGroupContext.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["ReferenceGroupContext.ts"],"sourcesContent":["import * as React from 'react';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = () => {};\n\nexport type ReferenceGroupContext = {\n open?: boolean;\n setOpen: () => void;\n};\n\nconst ReferenceGroupContext = React.createContext<ReferenceGroupContext | undefined>(undefined);\n\nexport const ReferenceGroupProvider = ReferenceGroupContext.Provider;\n\nexport const useReferenceGroupSetOpen = (): (() => void) => {\n const context = React.useContext(ReferenceGroupContext);\n return context?.setOpen ?? noop;\n};\n"],"names":["ReferenceGroupProvider","useReferenceGroupSetOpen","noop","ReferenceGroupContext","React","createContext","undefined","Provider","context","useContext","_context_setOpen","setOpen"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAYaA,sBAAAA;eAAAA;;IAEAC,wBAAAA;eAAAA;;;;iEAdU;AAEvB,gEAAgE;AAChE,MAAMC,OAAO,KAAO;AAOpB,MAAMC,sCAAwBC,OAAMC,aAAa,CAAoCC;AAE9E,MAAMN,yBAAyBG,sBAAsBI,QAAQ;AAE7D,MAAMN,2BAA2B;UACtCO,UAAMA,OAAUJ,UAAMK,CAAAA;;WACtB,AAAAC,CAAAA,mBAAOF,YAAAA,QAAAA,YAAAA,KAAAA,IAAAA,KAAAA,IAAAA,QAAAA,OAASG,MAAO,QAAAD,qBAAhBF,KAAAA,IAAAA,mBAAAA;AACT"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["referenceListContext.ts"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { Context, ContextSelector } from '@fluentui/react-context-selector';\nimport type { ReferenceListState } from '../../ReferenceListV2';\n\n/**\n * Context shared between ReferenceList and its children components\n */\nexport type ReferenceListContextValue = Pick<\n ReferenceListState,\n | 'areReferencesExpanded'\n | 'maxVisibleReferences'\n | 'overflowButtonTriggeredViaKeyboard'\n | 'referenceListRef'\n | 'shouldUseOverflow'\n | 'totalReferencesCount'\n>;\n\nexport const ReferenceListContext: Context<ReferenceListContextValue> = createContext<\n ReferenceListContextValue | undefined\n>(undefined) as Context<ReferenceListContextValue>;\n\nconst referenceListContextDefaultValue: ReferenceListContextValue = {\n areReferencesExpanded: false,\n maxVisibleReferences: undefined,\n overflowButtonTriggeredViaKeyboard: { current: false },\n referenceListRef: { current: null },\n shouldUseOverflow: false,\n totalReferencesCount: 0,\n};\n\nexport const ReferenceListContextProvider = ReferenceListContext.Provider;\n\nexport const useReferenceListContext_unstable = <T>(selector: ContextSelector<ReferenceListContextValue, T>) =>\n useContextSelector(ReferenceListContext, (ctx = referenceListContextDefaultValue) => selector(ctx));\n"],"names":["ReferenceListContext","ReferenceListContextProvider","useReferenceListContext_unstable","createContext","undefined","referenceListContextDefaultValue","areReferencesExpanded","maxVisibleReferences","overflowButtonTriggeredViaKeyboard","current","referenceListRef","shouldUseOverflow","totalReferencesCount","Provider","selector","useContextSelector","ctx"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAiBaA,oBAAAA;eAAAA;;IAaAC,4BAAAA;eAAAA;;IAEAC,gCAAAA;eAAAA;;;sCAhCqC;AAiB3C,MAAMF,uBAA2DG,IAAAA,mCAAAA,EAEtEC;AAEF,MAAMC,mCAA8D;2BAClEC;0BACAC;wCACAC;iBAAsCC;;sBACtCC;iBAAoBD;;uBACpBE;0BACAC;AACF;AAEO,MAAMX,+BAA+BD,qBAAqBa,QAAQ;AAElE,MAAMX,mCAAmCY,CAAAA,WAC9CC,IAAAA,wCAAAA,EAAmBf,sBAAsB,CAACgB,MAAMX,gCAAgC,GAAKS,SAASE"}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["generateReferenceCitationPreview.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { mergeCallbacks, usePopoverContext_unstable } from '@fluentui/react-components';\n\nimport {\n Preview,\n PreviewContent,\n PreviewHeader,\n PreviewMetadata,\n PreviewSurface,\n PreviewTrigger,\n} from '@fluentui-copilot/react-preview';\nimport { SensitivityLabel } from '@fluentui-copilot/react-sensitivity-label';\nimport type {\n PreviewHeaderProps,\n PreviewMetadataProps,\n PreviewProps,\n PreviewSurfaceProps,\n} from '@fluentui-copilot/react-preview';\nimport type { SensitivityLabelProps } from '@fluentui-copilot/react-sensitivity-label';\n\nimport { Citation } from '../../Citation';\nimport { Reference } from '../../ReferenceV2';\nimport type { CitationProps } from '../../Citation';\nimport type { ReferenceProps } from '../../ReferenceV2';\n\nexport type PackagedCitation = React.FC<CitationProps>;\n\nexport type PackagedReference = React.FC<ReferenceProps>;\n\nexport type PackagedPreviewContentProps = Pick<\n PreviewMetadataProps,\n 'icon' | 'primaryText' | 'secondaryText' | 'tertiaryText'\n> & {\n content?: React.ReactNode;\n};\n\nexport type ReferenceCitationPreviewGeneratorProps = {\n citationPreviewProps?: Omit<PreviewProps, 'children'> & Partial<Pick<PreviewProps, 'children'>>;\n citationPreviewSurfaceProps?: PreviewSurfaceProps;\n citationProps?: CitationProps;\n index: number;\n previewContentProps?: PackagedPreviewContentProps;\n previewHeaderProps?: PreviewHeaderProps;\n referencePreviewProps?: Omit<PreviewProps, 'children'> & Partial<Pick<PreviewProps, 'children'>>;\n referencePreviewSurfaceProps?: PreviewSurfaceProps;\n referenceProps?: ReferenceProps;\n sensitivityLabelProps?: SensitivityLabelProps;\n};\n\nexport type ReferenceCitationPreviewGenerator = (props: ReferenceCitationPreviewGeneratorProps) => {\n Citation: PackagedCitation;\n Reference: PackagedReference;\n};\n\n// Abstract the citation that serves as the close button of the Preview into its own component so that we have access to the popover context.\nconst CitationCloseButton = (citationCloseButtonProps: CitationProps) => {\n const setPopoverOpen = usePopoverContext_unstable(context => context.setOpen);\n\n const onPopoverCloseClick = React.useCallback<NonNullable<CitationProps['onClick']>>(\n ev => {\n setPopoverOpen(ev, false);\n\n // Don't navigate\n ev.preventDefault();\n },\n [setPopoverOpen],\n );\n\n const onCitationCloseButtonClick = mergeCallbacks(onPopoverCloseClick, citationCloseButtonProps.onClick);\n\n return <Citation {...citationCloseButtonProps} onClick={onCitationCloseButtonClick} />;\n};\n\n/**\n * Function to generate a Citation - Reference pair with correctly wired props.\n * Both the Citation and the Reference act as trigger components to Previews that are also correctly wired by the function.\n * Props can either be passed in to the function or applied directly to the generated components in JSX.\n *\n * A `useReferenceCitationPreview` hook exists that calls this function and memoizes its return value based on the props.\n * You should use the hook when the props used to generate the Citation - Reference pair can change dynamically.\n * If they are static, or in case you wanted to generate multiple pairs within a cycle, you should call\n * `generateReferenceCitationPreview` directly.\n *\n * @returns A Citation - Reference pair with correctly wired props.\n */\nexport const generateReferenceCitationPreview: ReferenceCitationPreviewGenerator = props => {\n const {\n citationPreviewProps,\n citationPreviewSurfaceProps,\n citationProps,\n index,\n previewContentProps,\n previewHeaderProps,\n referencePreviewProps,\n referencePreviewSurfaceProps,\n referenceProps,\n sensitivityLabelProps,\n } = props;\n\n const CitationWithPreview: PackagedCitation = props => {\n return (\n <Preview closeOnScroll positioning=\"above\" size=\"small\" trapFocus withArrow {...citationPreviewProps}>\n <PreviewTrigger>\n <Citation {...citationProps} {...props}>\n {index}\n </Citation>\n </PreviewTrigger>\n <PreviewSurface {...citationPreviewSurfaceProps}>\n <PreviewContent>\n <PreviewHeader\n citation={\n <CitationCloseButton aria-label={`Close Reference ${index}`} referenceHref=\"#\" tabIndex={-1}>\n {index}\n </CitationCloseButton>\n }\n media={referenceProps?.graphic as PreviewHeaderProps['media']}\n >\n {referenceProps?.children}\n </PreviewHeader>\n <PreviewMetadata\n icon={previewContentProps?.icon}\n primaryText={previewContentProps?.primaryText}\n secondaryText={previewContentProps?.secondaryText}\n tertiaryText={previewContentProps?.tertiaryText}\n />\n {sensitivityLabelProps && <SensitivityLabel {...sensitivityLabelProps} />}\n {previewContentProps?.content ?? citationPreviewProps?.children}\n </PreviewContent>\n </PreviewSurface>\n </Preview>\n );\n };\n\n const ReferenceWithPreview: PackagedReference = props => {\n const mergedReferenceProps = {\n citation: index,\n ...referenceProps,\n ...props,\n } as ReferenceProps;\n\n return (\n <Preview closeOnScroll positioning=\"above\" size=\"small\" trapFocus withArrow {...referencePreviewProps}>\n <PreviewTrigger>\n <Reference {...mergedReferenceProps} />\n </PreviewTrigger>\n <PreviewSurface {...referencePreviewSurfaceProps}>\n <PreviewContent>\n <PreviewHeader\n citation={\n <CitationCloseButton aria-label={`Close Reference ${index}`} referenceHref=\"#\" tabIndex={-1}>\n {index}\n </CitationCloseButton>\n }\n media={referenceProps?.graphic as PreviewHeaderProps['media']}\n {...previewHeaderProps}\n >\n {previewHeaderProps?.children ?? referenceProps?.children}\n </PreviewHeader>\n <PreviewMetadata\n icon={previewContentProps?.icon}\n primaryText={previewContentProps?.primaryText}\n secondaryText={previewContentProps?.secondaryText}\n tertiaryText={previewContentProps?.tertiaryText}\n />\n {sensitivityLabelProps && <SensitivityLabel {...sensitivityLabelProps} />}\n {previewContentProps?.content ?? referencePreviewProps?.children}\n </PreviewContent>\n </PreviewSurface>\n </Preview>\n );\n };\n\n const components = {\n Citation: CitationWithPreview,\n Reference: ReferenceWithPreview,\n };\n\n return components;\n};\n"],"names":["CitationCloseButton","citationCloseButtonProps","setPopoverOpen","usePopoverContext_unstable","context","setOpen","onPopoverCloseClick","React","useCallback","ev","preventDefault","createElement","Citation","onCitationCloseButtonClick","onClick","citationPreviewProps","citationPreviewSurfaceProps","CitationWithPreview","previewContentProps","closeOnScroll","positioning","trapFocus","withArrow","props","index","Preview","citation","aria-label","tabIndex","referenceProps","children","primaryText","secondaryText","PreviewHeader","tertiaryText","sensitivityLabelProps","referenceHref","ReferenceWithPreview","PreviewMetadata","icon","previewHeaderProps","referencePreviewProps","_previewContentProps_content","media","PreviewSurface","referencePreviewSurfaceProps","PreviewContent","Reference","_previewHeaderProps_children","components"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;iEAAuB;iCAEoC;8BASpD;uCAC0B;0BASR;6BACC;AAiC1B,6IAA6I;AAC7I,MAAMA,sBAAsBC,CAAAA;UAC1BC,iBAAMA,IAAAA,2CAAiBC,EAAAA,CAAAA,UAA2BC,QAAWA,OAAQC;UAErEC,sBAAMA,OAAsBC,WAAMC,CAAAA,CAAAA;uBAE9BN,IAAeO;yBAEf;yBACGC;OACL;QAAAR;KACA;UAACA,6BAAAA,IAAAA,+BAAAA,EAAAA,qBAAAA,yBAAAA,OAAAA;WAAe,WAAA,GAAAK,OAAAI,aAAA,CAAAC,kBAAA,EAAA;QAGlB,GAAAX,wBAAMY;QAENC,SAAAD;;;;IAcD,MACD,EACEE,oBACEA,EAYFC,2BAAMC,eA2BKC,OA1BT,qBACWC,oBAAcC,uBAAyB,8BAAQC,gBAAUC,uBAAcP;gCAEjDQ,CAAAA;;eACxBC,WAAAA,GAAAA,OAAAA,aAGL,CAAAC,qBAAA,EAAA;2BAGMC;yBACuBC;;uBAA0DC;uBAC5EJ;mCAGEK;sBAENA,GAAAA,OAAAA,aAAAA,CAAAA,4BAAAA,EAAAA,MAAAA,WAAAA,GAAAA,OAAAA,aAAgBC,CAAAA,kBAAQ,EAAA;4BAGnBZ;oBACNa;oBACAC,WAAed,GAAAA,OAAAA,aAAAA,CAAAA,4BAAAA,EAAAA,6BAAAA,WAAAA,GAAAA,OAAAA,aAAqBc,CAAAA,4BAAa,EAAA,MAAA,WAAA,GAAAzB,OAAAI,aAAA,CAAAsB,2BAAA,EAAA;sBACjDC,WAAchB,GAAAA,OAAAA,aAAAA,CAAAA,qBAAAA;8BAEfiB,CAAAA,gBAAAA,EAAAA,MAAAA,CAAAA;gBAMXC,eAAA;gBAEAR,UAAMS,CAAAA;eACJb;mBACEE,mBAAUF,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAAA,OAAAA;8BACPK,QAAcA,mBAAA,KAAA,IAAA,KAAA,IAAAA,eAAAC,QAAA,GAAA,WAAA,GAAAvB,OAAAI,aAAA,CAAA2B,6BAAA,EAAA;kBACjBpB,wBAAQ,QAAAA,wBAAA,KAAA,IAAA,KAAA,IAAAA,oBAAAqB,IAAA;yBACVrB,wBAAA,QAAAA,wBAAA,KAAA,IAAA,KAAA,IAAAA,oBAAAa,WAAA;2BAkBWS,wBASFtB,QAAAA,wBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,oBAAAA,aAAAA;0BAzBTA,wBACE,QAACO,wBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,oBAAAA,YAAAA;qCAAQN,WAAAA,GAAAA,OAAAA,aAAAA,CAAAA,uCAAAA,EAAAA,wBAAAA,CAAAA,+BAAAA,wBAAAA,QAAAA,wBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,oBAAAA,OAAAA,MAAAA,QAAAA,iCAAAA,KAAAA,IAAAA,+BAAAA,yBAAAA,QAAAA,yBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,qBAAAA,QAAAA;;iCAAuCI,CAAAA;qCAAQF;sBAAUC;6BAAcmB;;;0CAQpCC;0BAA2BN,GAAAA,OAAAA,aAAc,CAAAX,qBAAA,EAAA;2BAAIG;yBAC5EJ;kBAGLmB;uBACIH;uBAEHA;oCAGKtB;sBACNa,GAAAA,OAAab,aAAAA,CAAAA,4BAAAA,EAAAA,MAAAA,WAAAA,GAAAA,OAAAA,aAAAA,CAAAA,sBAAAA,EAAAA,wBAAgC,WAAA,GAAAX,OAAAI,aAAA,CAAAiC,4BAAA,EAAAC,8BAAA,WAAA,GAAAtC,OAAAI,aAAA,CAAAmC,4BAAA,EAAA,MAAA,WAAA,GAAAvC,OAAAI,aAAA,CAAAsB,2BAAA,EAAA;sBAC7CD,WAAed,GAAAA,OAAAA,aAAAA,CAAAA,qBAAAA;8BACfgB,CAAAA,gBAAchB,EAAAA,MAAAA,CAAAA;+BAEfiB;gBAMXP,UAAA,CAAA;YAEA,GAAAJ;mBACEZ,mBAAUK,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAAA,OAAAA;eACV8B,kBAAWV;QACb,GAAA,AAAAW,CAAAA,+BAAAR,uBAAA,QAAAA,uBAAA,KAAA,IAAA,KAAA,IAAAA,mBAAAV,QAAA,MAAA,QAAAkB,iCAAA,KAAA,IAAAA,+BAAAnB,mBAAA,QAAAA,mBAAA,KAAA,IAAA,KAAA,IAAAA,eAAAC,QAAA,GAAA,WAAA,GAAAvB,OAAAI,aAAA,CAAA2B,6BAAA,EAAA;YAEAC,MAAOU,wBAAAA,QAAAA,wBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,oBAAAA,IAAAA;YACPlB,aAAAb,wBAAA,QAAAA,wBAAA,KAAA,IAAA,KAAA,IAAAA,oBAAAa,WAAA"}
@@ -1,21 +0,0 @@
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
- generateReferenceCitationPreview: function() {
13
- return _generateReferenceCitationPreview.generateReferenceCitationPreview;
14
- },
15
- useReferenceCitationPreview: function() {
16
- return _useReferenceCitationPreview.useReferenceCitationPreview;
17
- }
18
- });
19
- const _generateReferenceCitationPreview = require("./generateReferenceCitationPreview");
20
- const _useReferenceCitationPreview = require("./useReferenceCitationPreview");
21
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["index.ts"],"sourcesContent":["export type { PackagedCitation, PackagedPreviewContentProps, PackagedReference, ReferenceCitationPreviewGenerator, ReferenceCitationPreviewGeneratorProps } from './generateReferenceCitationPreview';\nexport { generateReferenceCitationPreview } from './generateReferenceCitationPreview';\nexport type { UseReferenceCitationPreview, UseReferenceCitationPreviewProps } from './useReferenceCitationPreview';\nexport { useReferenceCitationPreview } from './useReferenceCitationPreview';\n"],"names":["generateReferenceCitationPreview","useReferenceCitationPreview"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IACSA,gCAAgC;eAAhCA,kEAAgC;;IAEhCC,2BAA2B;eAA3BA,wDAA2B;;;kDAFa;6CAEL"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "useReferenceCitationPreview", {
6
- enumerable: true,
7
- get: function() {
8
- return useReferenceCitationPreview;
9
- }
10
- });
11
- const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
- const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
13
- const _generateReferenceCitationPreview = require("./generateReferenceCitationPreview");
14
- const useReferenceCitationPreview = (props)=>{
15
- return _react.useMemo(()=>(0, _generateReferenceCitationPreview.generateReferenceCitationPreview)(props), [
16
- props
17
- ]);
18
- }; //# sourceMappingURL=useReferenceCitationPreview.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["useReferenceCitationPreview.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport * as React from 'react';\n\nimport {\n generateReferenceCitationPreview,\n type ReferenceCitationPreviewGenerator,\n type ReferenceCitationPreviewGeneratorProps,\n} from './generateReferenceCitationPreview';\n\nexport type UseReferenceCitationPreviewProps = ReferenceCitationPreviewGeneratorProps;\n\nexport type UseReferenceCitationPreview = ReferenceCitationPreviewGenerator;\n\n/**\n * Hook to generate a Citation - Reference pair with correctly wired props.\n * Both the Citation and the Reference act as trigger components to Previews that are also correctly wired by the hook.\n * Props can either be passed in to the hook or applied directly to the generated components in JSX.\n *\n * This hook internally calls the `generateReferenceCitationPreview` function and memoizes its return value based on the props.\n * You should only use this hook when the props used to generate the Citation - Reference pair can change dynamically.\n * If they are static, or in case you wanted to generate multiple pairs within a cycle, you should call\n * `generateReferenceCitationPreview` directly.\n *\n * @returns A Citation - Reference pair with correctly wired props.\n */\nexport const useReferenceCitationPreview: UseReferenceCitationPreview = props => {\n return React.useMemo(() => generateReferenceCitationPreview(props), [props]);\n};\n"],"names":["React","generateReferenceCitationPreview","props"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":";;;;+BA4BSA;;;eAAAA;;;;iEA5BT;kDASO;AAmBL,MAAOA,8BAAoBC,CAAAA;WAA0CC,OAAAA,OAAAA,CAAAA,IAAAA,IAAAA,kEAAAA,EAAAA,QAAAA;QAAAA;KAAAA;GACvE,uDAAE"}
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "useReferenceGroup", {
6
- enumerable: true,
7
- get: function() {
8
- return useReferenceGroup;
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 useStyles = (0, _reactcomponents.__styles)({
15
- hidden: {
16
- mc9l5x: "fjseox"
17
- }
18
- }, {
19
- d: [
20
- ".fjseox{display:none;}"
21
- ]
22
- });
23
- const useReferenceGroup = (props)=>{
24
- const [isOpen, setIsOpen] = _react.useState(false);
25
- const styles = useStyles();
26
- const referenceListId = (0, _reactcomponents.useId)('reference-list', props.referenceListId);
27
- return _react.useMemo(()=>{
28
- const handleClick = ()=>{
29
- setIsOpen((isOpen)=>!isOpen);
30
- };
31
- const referenceGroupToggleProps = {
32
- 'aria-controls': referenceListId,
33
- isOpen,
34
- onClick: handleClick
35
- };
36
- const referenceListProps = {
37
- className: isOpen ? undefined : styles.hidden,
38
- id: referenceListId
39
- };
40
- return {
41
- referenceGroupToggleProps,
42
- referenceListProps
43
- };
44
- }, [
45
- isOpen,
46
- referenceListId,
47
- styles.hidden
48
- ]);
49
- }; //# sourceMappingURL=useReferenceGroup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["useReferenceGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport { makeStyles, useId } from '@fluentui/react-components';\nimport type { ReferenceListProps } from '../ReferenceList';\nimport type { ReferenceGroupToggleProps } from '../ReferenceGroupToggle';\n\nexport type UseReferenceGroupProps = { referenceListId?: string };\nexport type UseReferenceGroup = (props: UseReferenceGroupProps) => {\n referenceGroupToggleProps: ReferenceGroupToggleProps;\n referenceListProps: ReferenceListProps;\n};\n\nconst useStyles = makeStyles({\n hidden: {\n display: 'none',\n },\n});\n\n/**\n * Hook to package a `ReferenceGroupToggle` and `ReferenceList` together and\n * maintain their `isOpen` state.\n *\n * When rendering a group of references, prefer to use this hook\n * hook to ensure state is maintained correctly\n */\nexport const useReferenceGroup: UseReferenceGroup = props => {\n const [isOpen, setIsOpen] = React.useState(false);\n const styles = useStyles();\n const referenceListId = useId('reference-list', props.referenceListId);\n\n return React.useMemo(() => {\n const handleClick = () => {\n setIsOpen(isOpen => !isOpen);\n };\n\n const referenceGroupToggleProps = {\n 'aria-controls': referenceListId,\n isOpen,\n onClick: handleClick,\n };\n\n const referenceListProps = {\n className: isOpen ? undefined : styles.hidden,\n id: referenceListId,\n };\n\n return { referenceGroupToggleProps, referenceListProps };\n }, [isOpen, referenceListId, styles.hidden]);\n};\n"],"names":["referenceListId","useStyles","makeStyles","hidden","display","d","useId","isOpen","useMemo","React","useState","styles","handleClick","referenceGroupToggleProps","className","referenceListProps","undefined"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA2BQA;;;eAAAA;;;;iEA3Be;iCACG;AAU1B,MAAMC,YAAYC,IAAAA,yBAAAA,EAAAA;YAChBC;gBACEC;;AAEJ,GAAA;IAEAC,GAAA;QAAA;KAAA;;AAUE,MAAML,oBAAkBM,CAAAA;UAExB,CAAAC,QAAaC,UAAQ,GAAAC,OAAAC,QAAA,CAAA;UACnBC,SAAMC;4BACML,IAAAA,sBAAAA,EAAU,kBAACA,MAAAA,eAAAA;WACvBE,OAAAD,OAAA,CAAA;cAEAI,cAAMC;sBACJN,CAAAA,SAAA,CAAAA;;0CAESK;6BACXZ;;qBAGEc;;cAEFC,qBAAA;uBAEOR,SAAAS,YAAAL,OAAAR,MAAA;;;eAAgD;YACzDU;;;;;QAA6BF;QAAaA,OAAAR,MAAA;KAAA;GAC5C,6CAAE"}