@fluentui-copilot/react-reference 0.12.1 → 0.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +31 -1
- package/CHANGELOG.md +20 -2
- package/lib/components/Citation/useCitationStyles.styles.js +1 -1
- package/lib/components/Citation/useCitationStyles.styles.js.map +1 -1
- package/lib/components/reference-v2/Reference/useReferenceStyles.styles.js +3 -3
- package/lib/components/reference-v2/Reference/useReferenceStyles.styles.js.map +1 -1
- package/lib/utilities/reference-v2/generateReferenceCitationPreview.js +2 -2
- package/lib/utilities/reference-v2/generateReferenceCitationPreview.js.map +1 -1
- package/lib/utilities/useReferenceCitationPreview.js +1 -1
- package/lib/utilities/useReferenceCitationPreview.js.map +1 -1
- package/lib-commonjs/components/Citation/useCitationStyles.styles.js +7 -7
- package/lib-commonjs/components/Citation/useCitationStyles.styles.js.map +1 -1
- package/lib-commonjs/components/reference-v2/Reference/useReferenceStyles.styles.js +11 -11
- package/lib-commonjs/components/reference-v2/Reference/useReferenceStyles.styles.js.map +1 -1
- package/lib-commonjs/utilities/reference-v2/generateReferenceCitationPreview.js +2 -2
- package/lib-commonjs/utilities/reference-v2/generateReferenceCitationPreview.js.map +1 -1
- package/lib-commonjs/utilities/useReferenceCitationPreview.js +1 -1
- package/lib-commonjs/utilities/useReferenceCitationPreview.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.json
CHANGED
|
@@ -2,7 +2,37 @@
|
|
|
2
2
|
"name": "@fluentui-copilot/react-reference",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
5
|
+
"date": "Mon, 05 Aug 2024 19:36:07 GMT",
|
|
6
|
+
"tag": "@fluentui-copilot/react-reference_v0.12.3",
|
|
7
|
+
"version": "0.12.3",
|
|
8
|
+
"comments": {
|
|
9
|
+
"patch": [
|
|
10
|
+
{
|
|
11
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
|
12
|
+
"package": "@fluentui-copilot/react-reference",
|
|
13
|
+
"commit": "96847379446855195efbdc46d4f3f63d13aca764",
|
|
14
|
+
"comment": "fix: Miscellaneous fit and finish fixes for Citation and Reference."
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"date": "Thu, 01 Aug 2024 22:28:24 GMT",
|
|
21
|
+
"tag": "@fluentui-copilot/react-reference_v0.12.2",
|
|
22
|
+
"version": "0.12.2",
|
|
23
|
+
"comments": {
|
|
24
|
+
"patch": [
|
|
25
|
+
{
|
|
26
|
+
"author": "makotom@microsoft.com",
|
|
27
|
+
"package": "@fluentui-copilot/react-reference",
|
|
28
|
+
"commit": "2a10f8d01030838bb7a0c7e1661f0bd10cfe8310",
|
|
29
|
+
"comment": "fix: Correctly wrapping Reference v2 contents and fixing alignment styles."
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"date": "Tue, 23 Jul 2024 00:56:25 GMT",
|
|
6
36
|
"tag": "@fluentui-copilot/react-reference_v0.12.1",
|
|
7
37
|
"version": "0.12.1",
|
|
8
38
|
"comments": {
|
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
# Change Log - @fluentui-copilot/react-reference
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Mon, 05 Aug 2024 19:36:07 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [0.12.3](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-reference_v0.12.3)
|
|
8
|
+
|
|
9
|
+
Mon, 05 Aug 2024 19:36:07 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-reference_v0.12.2..@fluentui-copilot/react-reference_v0.12.3)
|
|
11
|
+
|
|
12
|
+
### Patches
|
|
13
|
+
|
|
14
|
+
- fix: Miscellaneous fit and finish fixes for Citation and Reference. ([PR #1980](https://github.com/microsoft/fluentai/pull/1980) by Humberto.Morimoto@microsoft.com)
|
|
15
|
+
|
|
16
|
+
## [0.12.2](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-reference_v0.12.2)
|
|
17
|
+
|
|
18
|
+
Thu, 01 Aug 2024 22:28:24 GMT
|
|
19
|
+
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-reference_v0.12.1..@fluentui-copilot/react-reference_v0.12.2)
|
|
20
|
+
|
|
21
|
+
### Patches
|
|
22
|
+
|
|
23
|
+
- fix: Correctly wrapping Reference v2 contents and fixing alignment styles. ([PR #1940](https://github.com/microsoft/fluentai/pull/1940) by makotom@microsoft.com)
|
|
24
|
+
|
|
7
25
|
## [0.12.1](https://github.com/microsoft/fluentai/tree/@fluentui-copilot/react-reference_v0.12.1)
|
|
8
26
|
|
|
9
|
-
Tue, 23 Jul 2024 00:
|
|
27
|
+
Tue, 23 Jul 2024 00:56:25 GMT
|
|
10
28
|
[Compare changes](https://github.com/microsoft/fluentai/compare/@fluentui-copilot/react-reference_v0.12.0..@fluentui-copilot/react-reference_v0.12.1)
|
|
11
29
|
|
|
12
30
|
### Patches
|
|
@@ -2,7 +2,7 @@ import { __resetStyles, __styles, mergeClasses, shorthands, tokens, typographySt
|
|
|
2
2
|
export const citationClassNames = {
|
|
3
3
|
root: 'fai-Citation'
|
|
4
4
|
};
|
|
5
|
-
const useCitationBaseClassName = __resetStyles("
|
|
5
|
+
const useCitationBaseClassName = __resetStyles("r9zkot", "r196ztr4", [".r9zkot{display:inline-flex;justify-content:center;box-sizing:border-box;align-items:center;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase100);font-weight:var(--fontWeightSemibold);line-height:var(--lineHeightBase100);background-color:var(--colorNeutralBackground3);border:var(--strokeWidthThin) solid var(--colorNeutralStroke2);color:var(--colorNeutralForeground2);min-width:14px;height:14px;vertical-align:calc((var(--lineHeightBase100) - var(--fontSizeBase100)) / 2);border-radius:var(--borderRadiusMedium);text-decoration:none;margin-left:var(--spacingHorizontalXXS);margin-right:var(--spacingHorizontalXXS);}", ".r9zkot:hover{cursor:pointer;color:var(--colorBrandForeground2Hover);border-color:var(--colorBrandStroke2Hover);background-color:var(--colorBrandBackground2Hover);}", ".r9zkot:hover:active{cursor:pointer;color:var(--colorBrandForeground2Pressed);border-color:var(--colorBrandStroke2Pressed);background-color:var(--colorBrandBackground2Pressed);}", ".r196ztr4{display:inline-flex;justify-content:center;box-sizing:border-box;align-items:center;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase100);font-weight:var(--fontWeightSemibold);line-height:var(--lineHeightBase100);background-color:var(--colorNeutralBackground3);border:var(--strokeWidthThin) solid var(--colorNeutralStroke2);color:var(--colorNeutralForeground2);min-width:14px;height:14px;vertical-align:calc((var(--lineHeightBase100) - var(--fontSizeBase100)) / 2);border-radius:var(--borderRadiusMedium);text-decoration:none;margin-right:var(--spacingHorizontalXXS);margin-left:var(--spacingHorizontalXXS);}", ".r196ztr4:hover{cursor:pointer;color:var(--colorBrandForeground2Hover);border-color:var(--colorBrandStroke2Hover);background-color:var(--colorBrandBackground2Hover);}", ".r196ztr4:hover:active{cursor:pointer;color:var(--colorBrandForeground2Pressed);border-color:var(--colorBrandStroke2Pressed);background-color:var(--colorBrandBackground2Pressed);}"]);
|
|
6
6
|
const useCitationRootStyles = __styles({
|
|
7
7
|
isBlock: {
|
|
8
8
|
mc9l5x: "f22iagw",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useCitationStyles.styles.ts"],"sourcesContent":["import {\n makeResetStyles,\n makeStyles,\n mergeClasses,\n shorthands,\n tokens,\n typographyStyles,\n} from '@fluentui/react-components';\nimport type { CitationSlots, CitationState } from './Citation.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const citationClassNames: SlotClassNames<CitationSlots> = {\n root: 'fai-Citation',\n};\n\nconst useCitationBaseClassName = makeResetStyles({\n display: 'inline-flex',\n justifyContent: 'center',\n boxSizing: 'border-box',\n alignItems: 'center',\n ...typographyStyles.caption2Strong,\n\n
|
|
1
|
+
{"version":3,"sources":["useCitationStyles.styles.ts"],"sourcesContent":["import {\n makeResetStyles,\n makeStyles,\n mergeClasses,\n shorthands,\n tokens,\n typographyStyles,\n} from '@fluentui/react-components';\nimport type { CitationSlots, CitationState } from './Citation.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const citationClassNames: SlotClassNames<CitationSlots> = {\n root: 'fai-Citation',\n};\n\nconst useCitationBaseClassName = makeResetStyles({\n display: 'inline-flex',\n justifyContent: 'center',\n boxSizing: 'border-box',\n alignItems: 'center',\n ...typographyStyles.caption2Strong,\n\n backgroundColor: tokens.colorNeutralBackground3,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke2}`,\n color: tokens.colorNeutralForeground2,\n\n minWidth: '14px',\n height: '14px',\n verticalAlign: `calc((${typographyStyles.caption2Strong.lineHeight} - ${typographyStyles.caption2Strong.fontSize}) / 2)`,\n\n borderRadius: tokens.borderRadiusMedium,\n\n textDecoration: 'none',\n\n marginLeft: tokens.spacingHorizontalXXS,\n marginRight: tokens.spacingHorizontalXXS,\n\n ':hover': {\n cursor: 'pointer',\n color: tokens.colorBrandForeground2Hover,\n borderColor: tokens.colorBrandStroke2Hover,\n backgroundColor: tokens.colorBrandBackground2Hover,\n },\n\n ':hover:active': {\n cursor: 'pointer',\n color: tokens.colorBrandForeground2Pressed,\n borderColor: tokens.colorBrandStroke2Pressed,\n backgroundColor: tokens.colorBrandBackground2Pressed,\n },\n});\n\nconst useCitationRootStyles = makeStyles({\n isBlock: {\n display: 'flex',\n marginLeft: 0,\n marginRight: 0,\n },\n isPopoverLocked: {\n color: tokens.colorBrandForeground2Pressed,\n ...shorthands.borderColor(tokens.colorBrandStroke2Pressed),\n backgroundColor: tokens.colorBrandBackground2,\n ':hover': {\n color: tokens.colorBrandForeground2Pressed,\n ...shorthands.borderColor(tokens.colorBrandStroke2Pressed),\n backgroundColor: tokens.colorBrandBackground2,\n },\n },\n});\n\n/**\n * Apply styling to the Citation slots based on the state\n */\nexport const useCitationStyles_unstable = (state: CitationState): CitationState => {\n 'use no memo';\n\n const rootBaseClassName = useCitationBaseClassName();\n const rootStyles = useCitationRootStyles();\n\n state.root.className = mergeClasses(\n citationClassNames.root,\n state.isPopoverLocked && rootStyles.isPopoverLocked,\n state.block && rootStyles.isBlock,\n rootBaseClassName,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","shorthands","tokens","typographyStyles","citationClassNames","root","useCitationBaseClassName","display","justifyContent","boxSizing","alignItems","caption2Strong","backgroundColor","colorNeutralBackground3","border","strokeWidthThin","colorNeutralStroke2","color","colorNeutralForeground2","minWidth","height","verticalAlign","lineHeight","fontSize","borderRadius","borderRadiusMedium","textDecoration","marginLeft","spacingHorizontalXXS","marginRight","cursor","colorBrandForeground2Hover","borderColor","colorBrandStroke2Hover","colorBrandBackground2Hover","colorBrandForeground2Pressed","colorBrandStroke2Pressed","colorBrandBackground2Pressed","useCitationRootStyles","isBlock","isPopoverLocked","colorBrandBackground2","useCitationStyles_unstable","state","rootBaseClassName","rootStyles","className","block"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SACEA,eAAe,EACfC,UAAU,EACVC,YAAY,EACZC,UAAU,EACVC,MAAM,EACNC,gBAAgB,QACX,6BAA6B;AAIpC,OAAO,MAAMC,qBAAoD;IAC/DC,MAAM;AACR,EAAE;AAEF,MAAMC,2BAA2BR,gBAAgB;IAC/CS,SAAS;IACTC,gBAAgB;IAChBC,WAAW;IACXC,YAAY;IACZ,GAAGP,iBAAiBQ,cAAc;IAElCC,iBAAiBV,OAAOW,uBAAuB;IAC/CC,QAAQ,CAAC,EAAEZ,OAAOa,eAAe,CAAC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IF,WAAWN,OAAO,EACjCK,mBACAD,MAAMtC,IAAI,CAACyC,SAAS;IAGtB,OAAOH;AACT,EAAE"}
|
|
@@ -10,7 +10,7 @@ export const referenceExtraClassNames = {
|
|
|
10
10
|
graphicChild: 'fai-Reference__graphicChild'
|
|
11
11
|
};
|
|
12
12
|
const GRAPHIC_SIZE = '16px';
|
|
13
|
-
const useRootBaseClassName = __resetStyles("
|
|
13
|
+
const useRootBaseClassName = __resetStyles("r19i5hos", null, [".r19i5hos{align-items:center;background-color:var(--colorNeutralBackground3);border:var(--strokeWidthThin) solid var(--colorNeutralStroke2);border-radius:var(--borderRadiusMedium);box-sizing:border-box;color:var(--colorNeutralForeground2);column-gap:var(--spacingHorizontalXXS);display:flex;flex-shrink:0;justify-content:center;max-width:100%;min-height:24px;padding:var(--spacingVerticalXXS) var(--spacingHorizontalS);text-decoration:none;}", ".r19i5hos:hover{background-color:var(--colorNeutralBackground3Hover);border-color:var(--colorNeutralStroke1Hover);color:var(--colorNeutralForeground2Hover);}", ".r19i5hos:hover .fai-Reference__divider{background-color:var(--colorNeutralStroke1Hover);}", ".r19i5hos:hover:active{background-color:var(--colorNeutralBackground3Pressed);border-color:var(--colorNeutralStroke1Pressed);color:var(--colorNeutralForeground2Pressed);}", ".r19i5hos:hover:active .fai-Reference__divider{background-color:var(--colorNeutralStroke1Pressed);}"]);
|
|
14
14
|
export const useRootStyles = __styles({
|
|
15
15
|
overflow: {
|
|
16
16
|
B2u0y6b: "f6dzj5z",
|
|
@@ -21,8 +21,8 @@ export const useRootStyles = __styles({
|
|
|
21
21
|
});
|
|
22
22
|
const useCitationBaseClassName = __resetStyles("rzdip90", null, [".rzdip90{font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase100);font-weight:var(--fontWeightSemibold);line-height:var(--lineHeightBase100);}"]);
|
|
23
23
|
const useDividerBaseClassName = __resetStyles("r1eyqaw5", null, [".r1eyqaw5{background-color:var(--colorNeutralStroke2);height:16px;margin:var(--spacingVerticalNone) var(--spacingHorizontalXS);width:1px;}"]);
|
|
24
|
-
const useGraphicBaseClassName = __resetStyles("
|
|
25
|
-
const useContentBaseClassName = __resetStyles("
|
|
24
|
+
const useGraphicBaseClassName = __resetStyles("rpyrgl4", null, [".rpyrgl4{display:inline-flex;font-size:16px;height:16px;line-height:16px;width:16px;}", ".rpyrgl4>.fai-Reference__graphicChild{height:16px;width:16px;}"]);
|
|
25
|
+
const useContentBaseClassName = __resetStyles("r1ycou3l", null, [".r1ycou3l{align-items:center;column-gap:var(--spacingHorizontalSNudge);display:inline-flex;text-align:start;word-break:break-word;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase200);}"]);
|
|
26
26
|
/**
|
|
27
27
|
* Apply styling to the Reference slots based on the state
|
|
28
28
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useReferenceStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses, tokens, typographyStyles } from '@fluentui/react-components';\nimport type { ReferenceSlots, ReferenceState } from './Reference.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const referenceClassNames: SlotClassNames<ReferenceSlots> = {\n root: 'fai-Reference',\n citation: 'fai-Reference__citation',\n divider: 'fai-Reference__divider',\n graphic: 'fai-Reference__graphic',\n content: 'fai-Reference__content',\n};\n\nexport const referenceExtraClassNames = {\n graphicChild: 'fai-Reference__graphicChild',\n};\n\nconst GRAPHIC_SIZE = '16px';\n\nconst useRootBaseClassName = makeResetStyles({\n alignItems: 'center',\n backgroundColor: tokens.colorNeutralBackground3,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke2}`,\n borderRadius: tokens.borderRadiusMedium,\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground2,\n columnGap: tokens.spacingHorizontalXXS,\n display: 'flex',\n flexShrink: 0,\n justifyContent: 'center',\n maxWidth: '
|
|
1
|
+
{"version":3,"sources":["useReferenceStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses, tokens, typographyStyles } from '@fluentui/react-components';\nimport type { ReferenceSlots, ReferenceState } from './Reference.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const referenceClassNames: SlotClassNames<ReferenceSlots> = {\n root: 'fai-Reference',\n citation: 'fai-Reference__citation',\n divider: 'fai-Reference__divider',\n graphic: 'fai-Reference__graphic',\n content: 'fai-Reference__content',\n};\n\nexport const referenceExtraClassNames = {\n graphicChild: 'fai-Reference__graphicChild',\n};\n\nconst GRAPHIC_SIZE = '16px';\n\nconst useRootBaseClassName = makeResetStyles({\n alignItems: 'center',\n backgroundColor: tokens.colorNeutralBackground3,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke2}`,\n borderRadius: tokens.borderRadiusMedium,\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground2,\n columnGap: tokens.spacingHorizontalXXS,\n display: 'flex',\n flexShrink: 0,\n justifyContent: 'center',\n maxWidth: '100%',\n minHeight: '24px',\n padding: `${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalS}`,\n textDecoration: 'none',\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground3Hover,\n borderColor: tokens.colorNeutralStroke1Hover,\n color: tokens.colorNeutralForeground2Hover,\n\n [`& .${referenceClassNames.divider}`]: {\n backgroundColor: tokens.colorNeutralStroke1Hover,\n },\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorNeutralBackground3Pressed,\n borderColor: tokens.colorNeutralStroke1Pressed,\n color: tokens.colorNeutralForeground2Pressed,\n\n [`& .${referenceClassNames.divider}`]: {\n backgroundColor: tokens.colorNeutralStroke1Pressed,\n },\n },\n});\n\nexport const useRootStyles = makeStyles({\n overflow: {\n maxWidth: '100%',\n width: '100%',\n },\n});\n\nconst useCitationBaseClassName = makeResetStyles({\n ...typographyStyles.caption2Strong,\n});\n\nconst useDividerBaseClassName = makeResetStyles({\n backgroundColor: tokens.colorNeutralStroke2,\n height: '16px',\n margin: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalXS}`,\n width: '1px',\n});\n\nconst useGraphicBaseClassName = makeResetStyles({\n display: 'inline-flex',\n fontSize: GRAPHIC_SIZE,\n height: GRAPHIC_SIZE,\n lineHeight: GRAPHIC_SIZE,\n width: GRAPHIC_SIZE,\n\n [`> .${referenceExtraClassNames.graphicChild}`]: {\n height: GRAPHIC_SIZE,\n width: GRAPHIC_SIZE,\n },\n});\n\nconst useContentBaseClassName = makeResetStyles({\n alignItems: 'center',\n columnGap: tokens.spacingHorizontalSNudge,\n display: 'inline-flex',\n textAlign: 'start',\n wordBreak: 'break-word',\n ...typographyStyles.caption1,\n});\n\n/**\n * Apply styling to the Reference slots based on the state\n */\nexport const useReferenceStyles_unstable = (state: ReferenceState): ReferenceState => {\n 'use no memo';\n\n const rootBaseClassName = useRootBaseClassName();\n const citationBaseClassName = useCitationBaseClassName();\n const dividerBaseClassName = useDividerBaseClassName();\n const contentBaseClassName = useContentBaseClassName();\n const graphicBaseClassName = useGraphicBaseClassName();\n\n state.root.className = mergeClasses(referenceClassNames.root, rootBaseClassName, state.root.className);\n\n if (state.citation) {\n state.citation.className = mergeClasses(\n referenceClassNames.citation,\n citationBaseClassName,\n state.citation.className,\n );\n }\n\n if (state.divider) {\n state.divider.className = mergeClasses(referenceClassNames.divider, dividerBaseClassName, state.divider.className);\n }\n\n if (state.content) {\n state.content.className = mergeClasses(referenceClassNames.content, contentBaseClassName, state.content.className);\n }\n\n if (state.graphic) {\n state.graphic.className = mergeClasses(referenceClassNames.graphic, graphicBaseClassName, state.graphic.className);\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","tokens","typographyStyles","referenceClassNames","root","citation","divider","graphic","content","referenceExtraClassNames","graphicChild","GRAPHIC_SIZE","useRootBaseClassName","alignItems","backgroundColor","colorNeutralBackground3","border","strokeWidthThin","colorNeutralStroke2","borderRadius","borderRadiusMedium","boxSizing","color","colorNeutralForeground2","columnGap","spacingHorizontalXXS","display","flexShrink","justifyContent","maxWidth","minHeight","padding","spacingVerticalXXS","spacingHorizontalS","textDecoration","colorNeutralBackground3Hover","borderColor","colorNeutralStroke1Hover","colorNeutralForeground2Hover","colorNeutralBackground3Pressed","colorNeutralStroke1Pressed","colorNeutralForeground2Pressed","useRootStyles","overflow","width","useCitationBaseClassName","caption2Strong","useDividerBaseClassName","height","margin","spacingVerticalNone","spacingHorizontalXS","useGraphicBaseClassName","fontSize","lineHeight","useContentBaseClassName","spacingHorizontalSNudge","textAlign","wordBreak","caption1","useReferenceStyles_unstable","state","rootBaseClassName","citationBaseClassName","dividerBaseClassName","contentBaseClassName","graphicBaseClassName","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,EAAEC,MAAM,EAAEC,gBAAgB,QAAQ,6BAA6B;AAIjH,OAAO,MAAMC,sBAAsD;IACjEC,MAAM;IACNC,UAAU;IACVC,SAAS;IACTC,SAAS;IACTC,SAAS;AACX,EAAE;AAEF,OAAO,MAAMC,2BAA2B;IACtCC,cAAc;AAChB,EAAE;AAEF,MAAMC,eAAe;AAErB,MAAMC,uBAAuBd,gBAAgB;IAC3Ce,YAAY;IACZC,iBAAiBb,OAAOc,uBAAuB;IAC/CC,QAAQ,CAAC,EAAEf,OAAOgB,eAAe,CAAC,OAAO,EAAEhB,OAAOiB,mBAAmB,CAAC,CAAC;IACvEC,cAAclB,OAAOmB,kBAAkB;IACvCC,WAAW;IACXC,OAAOrB,OAAOsB,uBAAuB;IACrCC,WAAWvB,OAAOwB,oBAAoB;IACtCC,SAAS;IACTC,YAAY;IACZC,gBAAgB;IAChBC,UAAU;IACVC,WAAW;IACXC,SAAS,CAAC,EAAE9B,OAAO+B,kBAAkB,CAAC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;IACX,GAAGxD,iBAAiByD,QAAQ;AAC9B;AAEA;;CAEC,GACD,OAAO,MAAMC,8BAA8B,CAACC;IAC1C;IAEA,MAAMC,oBAAoBlD;IAC1B,MAAMmD,wBAAwBlB;IAC9B,MAAMmB,uBAAuBjB;IAC7B,MAAMkB,uBAAuBV;IAC7B,MAAMW,uBAAuBd;IAE7BS,MAAMzD,IAAI,CAAC+D,SAAS,GAAGnE,aAAaG,oBAAoBC,IAAI,EAAE0D,mBAAmBD,MAAMzD,IAAI,CAAC+D,SAAS;IAErG,IAAIN,MAAMxD,QAAQ,EAAE;QAClBwD,MAAMxD,QAAQ,CAAC8D,SAAS,GAAGnE,aACzBG,oBAAoBE,QAAQ,EAC5B0D,uBACAF,MAAMxD,QAAQ,CAAC8D,SAAS;IAE5B;IAEA,IAAIN,MAAMvD,OAAO,EAAE;QACjBuD,MAAMvD,OAAO,CAAC6D,SAAS,GAAGnE,aAAaG,oBAAoBG,OAAO,EAAE0D,sBAAsBH,MAAMvD,OAAO,CAAC6D,SAAS;IACnH;IAEA,IAAIN,MAAMrD,OAAO,EAAE;QACjBqD,MAAMrD,OAAO,CAAC2D,SAAS,GAAGnE,aAAaG,oBAAoBK,OAAO,EAAEyD,sBAAsBJ,MAAMrD,OAAO,CAAC2D,SAAS;IACnH;IAEA,IAAIN,MAAMtD,OAAO,EAAE;QACjBsD,MAAMtD,OAAO,CAAC4D,SAAS,GAAGnE,aAAaG,oBAAoBI,OAAO,EAAE2D,sBAAsBL,MAAMtD,OAAO,CAAC4D,SAAS;IACnH;IAEA,OAAON;AACT,EAAE"}
|
|
@@ -47,7 +47,7 @@ export const generateReferenceCitationPreview = props => {
|
|
|
47
47
|
var _previewContentProps_content;
|
|
48
48
|
return /*#__PURE__*/React.createElement(Preview, {
|
|
49
49
|
closeOnScroll: true,
|
|
50
|
-
positioning: "
|
|
50
|
+
positioning: "above",
|
|
51
51
|
size: "small",
|
|
52
52
|
trapFocus: true,
|
|
53
53
|
withArrow: true,
|
|
@@ -78,7 +78,7 @@ export const generateReferenceCitationPreview = props => {
|
|
|
78
78
|
var _previewHeaderProps_children, _previewContentProps_content;
|
|
79
79
|
return /*#__PURE__*/React.createElement(Preview, {
|
|
80
80
|
closeOnScroll: true,
|
|
81
|
-
positioning: "
|
|
81
|
+
positioning: "above",
|
|
82
82
|
size: "small",
|
|
83
83
|
trapFocus: true,
|
|
84
84
|
withArrow: true,
|
|
@@ -1 +1 @@
|
|
|
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?: PreviewProps;\n citationPreviewSurfaceProps?: PreviewSurfaceProps;\n citationProps?: CitationProps;\n index: number;\n previewContentProps?: PackagedPreviewContentProps;\n previewHeaderProps?: PreviewHeaderProps;\n referencePreviewProps?: PreviewProps;\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=\"below\" 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={`Reference ${index}, close`} 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=\"below\" 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={`Reference ${index}, close`} 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":["React","mergeCallbacks","usePopoverContext_unstable","Preview","PreviewContent","PreviewHeader","PreviewMetadata","PreviewSurface","PreviewTrigger","SensitivityLabel","Citation","Reference","CitationCloseButton","citationCloseButtonProps","setPopoverOpen","context","setOpen","onPopoverCloseClick","useCallback","ev","preventDefault","onCitationCloseButtonClick","onClick","generateReferenceCitationPreview","props","citationPreviewProps","citationPreviewSurfaceProps","citationProps","index","previewContentProps","previewHeaderProps","referencePreviewProps","referencePreviewSurfaceProps","referenceProps","sensitivityLabelProps","CitationWithPreview","closeOnScroll","positioning","size","trapFocus","withArrow","citation","aria-label","referenceHref","tabIndex","media","graphic","children","icon","primaryText","secondaryText","tertiaryText","content","ReferenceWithPreview","mergedReferenceProps","components"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,cAAc,EAAEC,0BAA0B,QAAQ,6BAA6B;AAExF,SACEC,OAAO,EACPC,cAAc,EACdC,aAAa,EACbC,eAAe,EACfC,cAAc,EACdC,cAAc,QACT,kCAAkC;AACzC,SAASC,gBAAgB,QAAQ,4CAA4C;AAS7E,SAASC,QAAQ,QAAQ,iBAAiB;AAC1C,SAASC,SAAS,QAAQ,oBAAoB;AAiC9C,6IAA6I;AAC7I,MAAMC,sBAAsB,CAACC;IAC3B,MAAMC,iBAAiBZ,2BAA2Ba,CAAAA,UAAWA,QAAQC,OAAO;IAE5E,MAAMC,sBAAsBjB,MAAMkB,WAAW,CAC3CC,CAAAA;QACEL,eAAeK,IAAI;QAEnB,iBAAiB;QACjBA,GAAGC,cAAc;IACnB,GACA;QAACN;KAAe;IAGlB,MAAMO,6BAA6BpB,eAAegB,qBAAqBJ,yBAAyBS,OAAO;IAEvG,qBAAO,oBAACZ;QAAU,GAAGG,wBAAwB;QAAES,SAASD;;AAC1D;AAEA;;;;;;;;;;;CAWC,GACD,OAAO,MAAME,mCAAsEC,CAAAA;IACjF,MAAM,EACJC,oBAAoB,EACpBC,2BAA2B,EAC3BC,aAAa,EACbC,KAAK,EACLC,mBAAmB,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GT,qBAAqB;yBACnG,oBAACvB,oCACC,oBAACG,WAAc2C,sCAEjB,oBAAC/C,gBAAmByB,4CAClB,oBAAC5B,oCACC,oBAACC;YACCoC,wBACE,oBAAC7B;gBAAoB8B,cAAY,CAAC,UAAU,EAAEd,MAAM,OAAO,CAAC;gBAAEe,eAAc;gBAAIC,UAAU,CAAC;eACxFhB;YAGLiB,KAAK,EAAEZ,2BAAAA,qCAAAA,eAAgBa,OAAO;YAC7B,GAAGhB,kBAAkB;WAErBA,CAAAA,+BAAAA,+BAAAA,yCAAAA,mBAAoBiB,QAAQ,cAA5BjB,0CAAAA,+BAAgCG,2BAAAA,qCAAAA,eAAgBc,QAAQ,iBAE3D,oBAACzC;YACC0C,IAAI,EAAEnB,gCAAAA,0CAAAA,oBAAqBmB,IAAI;YAC/BC,WAAW,EAAEpB,gCAAAA,0CAAAA,oBAAqBoB,WAAW;YAC7CC,aAAa,EAAErB,gCAAAA,0CAAAA,oBAAqBqB,aAAa;YACjDC,YAAY,EAAEtB,gCAAAA,0CAAAA,oBAAqBsB,YAAY;YAEhDjB,uCAAyB,oBAACzB,kBAAqByB,wBAC/CL,CAAAA,+BAAAA,gCAAAA,0CAAAA,oBAAqBuB,OAAO,cAA5BvB,0CAAAA,+BAAgCE,kCAAAA,4CAAAA,sBAAuBgB,QAAQ;IAK1E;IAEA,MAAMQ,aAAa;QACjB7C,UAAUyB;QACVxB,WAAW0C;IACb;IAEA,OAAOE;AACT,EAAE"}
|
|
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?: PreviewProps;\n citationPreviewSurfaceProps?: PreviewSurfaceProps;\n citationProps?: CitationProps;\n index: number;\n previewContentProps?: PackagedPreviewContentProps;\n previewHeaderProps?: PreviewHeaderProps;\n referencePreviewProps?: PreviewProps;\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={`Reference ${index}, close`} 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={`Reference ${index}, close`} 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":["React","mergeCallbacks","usePopoverContext_unstable","Preview","PreviewContent","PreviewHeader","PreviewMetadata","PreviewSurface","PreviewTrigger","SensitivityLabel","Citation","Reference","CitationCloseButton","citationCloseButtonProps","setPopoverOpen","context","setOpen","onPopoverCloseClick","useCallback","ev","preventDefault","onCitationCloseButtonClick","onClick","generateReferenceCitationPreview","props","citationPreviewProps","citationPreviewSurfaceProps","citationProps","index","previewContentProps","previewHeaderProps","referencePreviewProps","referencePreviewSurfaceProps","referenceProps","sensitivityLabelProps","CitationWithPreview","closeOnScroll","positioning","size","trapFocus","withArrow","citation","aria-label","referenceHref","tabIndex","media","graphic","children","icon","primaryText","secondaryText","tertiaryText","content","ReferenceWithPreview","mergedReferenceProps","components"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,cAAc,EAAEC,0BAA0B,QAAQ,6BAA6B;AAExF,SACEC,OAAO,EACPC,cAAc,EACdC,aAAa,EACbC,eAAe,EACfC,cAAc,EACdC,cA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,aAAa;YACjDC,YAAY,EAAEtB,gCAAAA,0CAAAA,oBAAqBsB,YAAY;YAEhDjB,uCAAyB,oBAACzB,kBAAqByB,wBAC/CL,CAAAA,+BAAAA,gCAAAA,0CAAAA,oBAAqBuB,OAAO,cAA5BvB,0CAAAA,+BAAgCE,kCAAAA,4CAAAA,sBAAuBgB,QAAQ;IAK1E;IAEA,MAAMQ,aAAa;QACjB7C,UAAUyB;QACVxB,WAAW0C;IACb;IAEA,OAAOE;AACT,EAAE"}
|
|
@@ -81,7 +81,7 @@ export const useReferenceCitationPreview = ({
|
|
|
81
81
|
var _previewHeaderProps_children, _sensitivityLabelProps_description, _previewSurfaceProps_children;
|
|
82
82
|
return /*#__PURE__*/_jsxs(Preview, {
|
|
83
83
|
closeOnScroll: true,
|
|
84
|
-
positioning: "
|
|
84
|
+
positioning: "above",
|
|
85
85
|
size: "small",
|
|
86
86
|
trapFocus: true,
|
|
87
87
|
withArrow: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useReferenceCitationPreview.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport * as React from 'react';\nimport {\n Caption1,\n assertSlots,\n mergeCallbacks,\n slot,\n useId,\n usePopoverContext_unstable,\n} from '@fluentui/react-components';\nimport type { Slot } 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 { PreviewHeaderProps, PreviewProps, PreviewSurfaceProps } from '@fluentui-copilot/react-preview';\nimport type { SensitivityLabelProps } from '@fluentui-copilot/react-sensitivity-label';\n\nimport { Citation } from '../Citation';\nimport { Reference } from '../Reference';\nimport type { CitationProps } from '../Citation';\nimport type { ReferenceProps } from '../Reference';\n\n/**\n * Props for a \"packaged Citation\". A packaged Citation is a `Citation` that is\n * pre-packaged with props set by the `useReferenceCitation` hook.\n */\nexport type PackagedCitationProps = Omit<CitationProps, 'referenceHref'> &\n Partial<Pick<CitationProps, 'referenceHref'>>;\n\n/**\n * A \"packaged Citation\". A packaged Citation is a `Citation` that is\n * pre-packaged with props set by the `useReferenceCitation` hook.\n */\nexport type PackagedCitation = React.FC<PackagedCitationProps>;\n\ntype PartialReferenceProps = 'citationHref' | 'index' | 'referenceId';\n\n/**\n * Props for a \"packaged Reference\". A packaged Reference is a `Reference` that is\n * pre-packaged with props set by the `useReferenceCitation` hook.\n */\nexport type PackagedReferenceProps = Omit<ReferenceProps, PartialReferenceProps> &\n Partial<Pick<ReferenceProps, PartialReferenceProps>>;\n\n/**\n * A \"packaged Reference\". A packaged Reference is a `Reference` that is\n * pre-packaged with props set by the `useReferenceCitation` hook.\n */\nexport type PackagedReference = React.FC<PackagedReferenceProps>;\n\n/**\n * Data used to package a `Citation` and `Reference` together with\n * the `useReferenceCitation` hook.\n */\nexport type ReferenceCitationData = {\n index: number;\n referenceId?: string;\n citationId?: string;\n citationProps?: PackagedCitationProps;\n referenceProps?: PackagedReferenceProps;\n previewHeaderProps?: PreviewHeaderProps;\n previewProps?: PreviewProps;\n previewSurfaceProps?: PreviewSurfaceProps;\n sensitivityLabelProps?: SensitivityLabelProps;\n};\n\nexport type UseReferenceCitationPreview = (data: ReferenceCitationData) => {\n Citation: PackagedCitation;\n Reference: PackagedReference;\n};\n\ntype PreviewExtraSlots = {\n content: Slot<'div'>;\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 * Hook to package a `Citation` and `Reference` together in an\n * accessibly by default manner.\n *\n * When using citations and references, prefer using them via this\n * hook to ensure props are wired up correctly.\n */\nexport const useReferenceCitationPreview: UseReferenceCitationPreview = ({\n index,\n referenceId: propsRefId,\n citationId: propsCiteId,\n citationProps,\n referenceProps,\n previewHeaderProps,\n previewProps,\n previewSurfaceProps,\n sensitivityLabelProps,\n}) => {\n const refId = useId();\n const citeId = useId();\n\n const referenceId = propsRefId ?? refId;\n const citationId = propsCiteId ?? citeId;\n\n const components = React.useMemo(() => {\n const citationHref = `#${citationId}`;\n\n const PackagedReference: PackagedReference = props => {\n const referenceIndex = props.index ?? referenceProps?.index ?? index;\n\n return (\n <Reference\n {...referenceProps}\n index={referenceIndex}\n referenceId={referenceId}\n citationHref={citationHref}\n {...props}\n />\n );\n };\n\n const CitationWithPreview: PackagedCitation = props => {\n // We assert content as a slot to use it with its resolved props object and the correct defaults below.\n const content = slot.always(referenceProps ? referenceProps.content : undefined, {\n defaultProps: {\n children: referenceProps?.excerpt && <Caption1>{referenceProps.excerpt}</Caption1>,\n },\n elementType: 'div',\n });\n const citationWithPreviewState = {\n components: {\n content: 'div',\n },\n content,\n };\n assertSlots<PreviewExtraSlots>(citationWithPreviewState);\n\n // We resolve the slots' objects for sensitivity and title here so that we can use the information from their children below.\n const sensitivity = slot.optional(referenceProps?.sensitivity, { elementType: 'span' });\n const title = slot.optional(referenceProps?.label, { elementType: 'div' });\n\n return (\n <Preview closeOnScroll positioning=\"below\" size=\"small\" trapFocus withArrow {...previewProps}>\n <PreviewTrigger>\n <Citation {...citationProps} id={citationId} {...props}>\n {index}\n </Citation>\n </PreviewTrigger>\n <PreviewSurface {...previewSurfaceProps}>\n <PreviewContent>\n <PreviewHeader\n citation={\n <CitationCloseButton aria-label={`Reference ${index}, close`} referenceHref=\"#\" tabIndex={-1}>\n {index}\n </CitationCloseButton>\n }\n media={referenceProps?.media}\n {...previewHeaderProps}\n >\n {previewHeaderProps?.children ?? title?.children}\n </PreviewHeader>\n <PreviewMetadata\n icon={referenceProps?.icon}\n primaryText={referenceProps?.primaryText}\n secondaryText={referenceProps?.secondaryText}\n tertiaryText={referenceProps?.tertiaryText}\n />\n {sensitivity && (\n <SensitivityLabel description={sensitivityLabelProps?.description ?? ''}>\n {sensitivity.children}\n </SensitivityLabel>\n )}\n <citationWithPreviewState.content />\n {previewSurfaceProps?.children ?? previewProps?.children}\n </PreviewContent>\n </PreviewSurface>\n </Preview>\n );\n };\n\n return {\n Citation: CitationWithPreview,\n Reference: PackagedReference,\n };\n }, [\n index,\n referenceId,\n citationId,\n referenceProps,\n citationProps,\n previewHeaderProps,\n previewProps,\n previewSurfaceProps,\n sensitivityLabelProps,\n ]);\n\n return components;\n};\n"],"names":["React","Caption1","assertSlots","mergeCallbacks","slot","useId","usePopoverContext_unstable","Preview","PreviewContent","PreviewHeader","PreviewMetadata","PreviewSurface","PreviewTrigger","SensitivityLabel","Citation","Reference","CitationCloseButton","citationCloseButtonProps","setPopoverOpen","context","setOpen","onPopoverCloseClick","useCallback","ev","preventDefault","onCitationCloseButtonClick","onClick","useReferenceCitationPreview","index","referenceId","propsRefId","citationId","propsCiteId","citationProps","referenceProps","previewHeaderProps","previewProps","previewSurfaceProps","sensitivityLabelProps","refId","citeId","components","useMemo","citationHref","PackagedReference","props","referenceIndex","CitationWithPreview","content","always","undefined","defaultProps","children","excerpt","elementType","citationWithPreviewState","sensitivity","optional","title","label","closeOnScroll","positioning","size","trapFocus","withArrow","id","citation","aria-label","referenceHref","tabIndex","media","icon","primaryText","secondaryText","tertiaryText","description"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","m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GL0C,KAAK,EAAEpC,2BAAAA,qCAAAA,eAAgBoC,KAAK;oCAC3B,GAAGnC,kBAAkB;8CAErBA,CAAAA,+BAAAA,+BAAAA,yCAAAA,mBAAoBiB,QAAQ,cAA5BjB,0CAAAA,+BAAgCuB,kBAAAA,4BAAAA,MAAON,QAAQ;;8CAElD,KAAC1C;oCACC6D,IAAI,EAAErC,2BAAAA,qCAAAA,eAAgBqC,IAAI;oCAC1BC,WAAW,EAAEtC,2BAAAA,qCAAAA,eAAgBsC,WAAW;oCACxCC,aAAa,EAAEvC,2BAAAA,qCAAAA,eAAgBuC,aAAa;oCAC5CC,YAAY,EAAExC,2BAAAA,qCAAAA,eAAgBwC,YAAY;;gCAE3ClB,6BACC,KAAC3C;oCAAiB8D,aAAarC,CAAAA,qCAAAA,kCAAAA,4CAAAA,sBAAuBqC,WAAW,cAAlCrC,gDAAAA,qCAAsC;8CAClEkB,YAAYJ,QAAQ;;8CAGzB,KAACG,yBAAyBP,OAAO;gCAChCX,CAAAA,gCAAAA,gCAAAA,0CAAAA,oBAAqBe,QAAQ,cAA7Bf,2CAAAA,gCAAiCD,yBAAAA,mCAAAA,aAAcgB,QAAQ;;;;;;QAKlE;QAEA,OAAO;YACLtC,UAAUiC;YACVhC,WAAW6B;QACb;IACF,GAAG;QACDhB;QACAC;QACAE;QACAG;QACAD;QACAE;QACAC;QACAC;QACAC;KACD;IAED,OAAOG;AACT,EAAE"}
|
|
1
|
+
{"version":3,"sources":["useReferenceCitationPreview.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport * as React from 'react';\nimport {\n Caption1,\n assertSlots,\n mergeCallbacks,\n slot,\n useId,\n usePopoverContext_unstable,\n} from '@fluentui/react-components';\nimport type { Slot } 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 { PreviewHeaderProps, PreviewProps, PreviewSurfaceProps } from '@fluentui-copilot/react-preview';\nimport type { SensitivityLabelProps } from '@fluentui-copilot/react-sensitivity-label';\n\nimport { Citation } from '../Citation';\nimport { Reference } from '../Reference';\nimport type { CitationProps } from '../Citation';\nimport type { ReferenceProps } from '../Reference';\n\n/**\n * Props for a \"packaged Citation\". A packaged Citation is a `Citation` that is\n * pre-packaged with props set by the `useReferenceCitation` hook.\n */\nexport type PackagedCitationProps = Omit<CitationProps, 'referenceHref'> &\n Partial<Pick<CitationProps, 'referenceHref'>>;\n\n/**\n * A \"packaged Citation\". A packaged Citation is a `Citation` that is\n * pre-packaged with props set by the `useReferenceCitation` hook.\n */\nexport type PackagedCitation = React.FC<PackagedCitationProps>;\n\ntype PartialReferenceProps = 'citationHref' | 'index' | 'referenceId';\n\n/**\n * Props for a \"packaged Reference\". A packaged Reference is a `Reference` that is\n * pre-packaged with props set by the `useReferenceCitation` hook.\n */\nexport type PackagedReferenceProps = Omit<ReferenceProps, PartialReferenceProps> &\n Partial<Pick<ReferenceProps, PartialReferenceProps>>;\n\n/**\n * A \"packaged Reference\". A packaged Reference is a `Reference` that is\n * pre-packaged with props set by the `useReferenceCitation` hook.\n */\nexport type PackagedReference = React.FC<PackagedReferenceProps>;\n\n/**\n * Data used to package a `Citation` and `Reference` together with\n * the `useReferenceCitation` hook.\n */\nexport type ReferenceCitationData = {\n index: number;\n referenceId?: string;\n citationId?: string;\n citationProps?: PackagedCitationProps;\n referenceProps?: PackagedReferenceProps;\n previewHeaderProps?: PreviewHeaderProps;\n previewProps?: PreviewProps;\n previewSurfaceProps?: PreviewSurfaceProps;\n sensitivityLabelProps?: SensitivityLabelProps;\n};\n\nexport type UseReferenceCitationPreview = (data: ReferenceCitationData) => {\n Citation: PackagedCitation;\n Reference: PackagedReference;\n};\n\ntype PreviewExtraSlots = {\n content: Slot<'div'>;\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 * Hook to package a `Citation` and `Reference` together in an\n * accessibly by default manner.\n *\n * When using citations and references, prefer using them via this\n * hook to ensure props are wired up correctly.\n */\nexport const useReferenceCitationPreview: UseReferenceCitationPreview = ({\n index,\n referenceId: propsRefId,\n citationId: propsCiteId,\n citationProps,\n referenceProps,\n previewHeaderProps,\n previewProps,\n previewSurfaceProps,\n sensitivityLabelProps,\n}) => {\n const refId = useId();\n const citeId = useId();\n\n const referenceId = propsRefId ?? refId;\n const citationId = propsCiteId ?? citeId;\n\n const components = React.useMemo(() => {\n const citationHref = `#${citationId}`;\n\n const PackagedReference: PackagedReference = props => {\n const referenceIndex = props.index ?? referenceProps?.index ?? index;\n\n return (\n <Reference\n {...referenceProps}\n index={referenceIndex}\n referenceId={referenceId}\n citationHref={citationHref}\n {...props}\n />\n );\n };\n\n const CitationWithPreview: PackagedCitation = props => {\n // We assert content as a slot to use it with its resolved props object and the correct defaults below.\n const content = slot.always(referenceProps ? referenceProps.content : undefined, {\n defaultProps: {\n children: referenceProps?.excerpt && <Caption1>{referenceProps.excerpt}</Caption1>,\n },\n elementType: 'div',\n });\n const citationWithPreviewState = {\n components: {\n content: 'div',\n },\n content,\n };\n assertSlots<PreviewExtraSlots>(citationWithPreviewState);\n\n // We resolve the slots' objects for sensitivity and title here so that we can use the information from their children below.\n const sensitivity = slot.optional(referenceProps?.sensitivity, { elementType: 'span' });\n const title = slot.optional(referenceProps?.label, { elementType: 'div' });\n\n return (\n <Preview closeOnScroll positioning=\"above\" size=\"small\" trapFocus withArrow {...previewProps}>\n <PreviewTrigger>\n <Citation {...citationProps} id={citationId} {...props}>\n {index}\n </Citation>\n </PreviewTrigger>\n <PreviewSurface {...previewSurfaceProps}>\n <PreviewContent>\n <PreviewHeader\n citation={\n <CitationCloseButton aria-label={`Reference ${index}, close`} referenceHref=\"#\" tabIndex={-1}>\n {index}\n </CitationCloseButton>\n }\n media={referenceProps?.media}\n {...previewHeaderProps}\n >\n {previewHeaderProps?.children ?? title?.children}\n </PreviewHeader>\n <PreviewMetadata\n icon={referenceProps?.icon}\n primaryText={referenceProps?.primaryText}\n secondaryText={referenceProps?.secondaryText}\n tertiaryText={referenceProps?.tertiaryText}\n />\n {sensitivity && (\n <SensitivityLabel description={sensitivityLabelProps?.description ?? ''}>\n {sensitivity.children}\n </SensitivityLabel>\n )}\n <citationWithPreviewState.content />\n {previewSurfaceProps?.children ?? previewProps?.children}\n </PreviewContent>\n </PreviewSurface>\n </Preview>\n );\n };\n\n return {\n Citation: CitationWithPreview,\n Reference: PackagedReference,\n };\n }, [\n index,\n referenceId,\n citationId,\n referenceProps,\n citationProps,\n previewHeaderProps,\n previewProps,\n previewSurfaceProps,\n sensitivityLabelProps,\n ]);\n\n return components;\n};\n"],"names":["React","Caption1","assertSlots","mergeCallbacks","slot","useId","usePopoverContext_unstable","Preview","PreviewContent","PreviewHeader","PreviewMetadata","PreviewSurface","PreviewTrigger","SensitivityLabel","Citation","Reference","CitationCloseButton","citationCloseButtonProps","setPopoverOpen","context","setOpen","onPopoverCloseClick","useCallback","ev","preventDefault","onCitationCloseButtonClick","onClick","useReferenceCitationPreview","index","referenceId","propsRefId","citationId","propsCiteId","citationProps","referenceProps","previewHeaderProps","previewProps","previewSurfaceProps","sensitivityLabelProps","refId","citeId","components","useMemo","citationHref","PackagedReference","props","referenceIndex","CitationWithPreview","content","always","undefined","defaultProps","children","excerpt","elementType","citationWithPreviewState","sensitivity","optional","title","label","closeOnScroll","positioning","size","trapFocus","withArrow","id","citation","aria-label","referenceHref","tabIndex","media","icon","primaryText","secondaryText","tertiaryText","description"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,0BAA0B,GAC1B,iDAAiD;AAEjD,YAAYA,WAAW,QAAQ;AAC/B,SACEC,QAAQ,EACRC,WAAW,EACXC,cAAc,EACdC,IAAI,EACJC,KAAK,EACLC,0BAA0B,QACrB,6BAA6B;AAGpC,SACEC,OAAO,EACPC,cAAc,EACdC,aAAa,EACbC,eAAe,EACfC,cAAc,EACdC,cAAc,QACT,kCAAkC;AACzC,SAASC,gBAAgB,QAAQ,4CAA4C;AAI7E,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,SAAS,QAAQ,eAAe;AAyDzC,6IAA6I;AAC7I,MAAMC,sBAAsB,CAACC;IAC3B,MAAMC,iBAAiBZ,2BAA2Ba,CAAAA,UAAWA,QAAQC,OAAO;IAE5E,MAAMC,sBAAsBrB,MAAMsB,WAAW,CAC3CC,CAAAA;QACEL,eAAeK,IAAI;QAEnB,iBAAiB;QACjBA,GAAGC,cAAc;IACnB,GACA;QAACN;KAAe;IAGlB,MAAMO,6BAA6BtB,eAAekB,qBAAqBJ,yBAAyBS,OAAO;IAEvG,qBAAO,KAACZ;QAAU,GAAGG,wBAAwB;QAAES,SAASD;;AAC1D;AAEA;;;;;;CAMC,GACD,OAAO,MAAME,8BAA2D,CAAC,EACvEC,KAAK,EACLC,aAAaC,UAAU,EACvBC,YAAYC,WAAW,EACvBC,aAAa,EACbC,cAAc,EACdC,kBAAkB,EAClBC,YAAY,EACZC,mBAAmB,EACnBC,qBAAqB,EACtB;IACC,MAAMC,QAAQlC;IACd,MAAMmC,SAASnC;IAEf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assNames = {
|
|
21
21
|
root: 'fai-Citation'
|
|
22
22
|
};
|
|
23
|
-
const useCitationBaseClassName = (0, _reactcomponents.__resetStyles)("
|
|
24
|
-
".
|
|
25
|
-
".
|
|
26
|
-
".
|
|
27
|
-
".
|
|
28
|
-
".
|
|
29
|
-
".
|
|
23
|
+
const useCitationBaseClassName = (0, _reactcomponents.__resetStyles)("r9zkot", "r196ztr4", [
|
|
24
|
+
".r9zkot{display:inline-flex;justify-content:center;box-sizing:border-box;align-items:center;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase100);font-weight:var(--fontWeightSemibold);line-height:var(--lineHeightBase100);background-color:var(--colorNeutralBackground3);border:var(--strokeWidthThin) solid var(--colorNeutralStroke2);color:var(--colorNeutralForeground2);min-width:14px;height:14px;vertical-align:calc((var(--lineHeightBase100) - var(--fontSizeBase100)) / 2);border-radius:var(--borderRadiusMedium);text-decoration:none;margin-left:var(--spacingHorizontalXXS);margin-right:var(--spacingHorizontalXXS);}",
|
|
25
|
+
".r9zkot:hover{cursor:pointer;color:var(--colorBrandForeground2Hover);border-color:var(--colorBrandStroke2Hover);background-color:var(--colorBrandBackground2Hover);}",
|
|
26
|
+
".r9zkot:hover:active{cursor:pointer;color:var(--colorBrandForeground2Pressed);border-color:var(--colorBrandStroke2Pressed);background-color:var(--colorBrandBackground2Pressed);}",
|
|
27
|
+
".r196ztr4{display:inline-flex;justify-content:center;box-sizing:border-box;align-items:center;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase100);font-weight:var(--fontWeightSemibold);line-height:var(--lineHeightBase100);background-color:var(--colorNeutralBackground3);border:var(--strokeWidthThin) solid var(--colorNeutralStroke2);color:var(--colorNeutralForeground2);min-width:14px;height:14px;vertical-align:calc((var(--lineHeightBase100) - var(--fontSizeBase100)) / 2);border-radius:var(--borderRadiusMedium);text-decoration:none;margin-right:var(--spacingHorizontalXXS);margin-left:var(--spacingHorizontalXXS);}",
|
|
28
|
+
".r196ztr4:hover{cursor:pointer;color:var(--colorBrandForeground2Hover);border-color:var(--colorBrandStroke2Hover);background-color:var(--colorBrandBackground2Hover);}",
|
|
29
|
+
".r196ztr4:hover:active{cursor:pointer;color:var(--colorBrandForeground2Pressed);border-color:var(--colorBrandStroke2Pressed);background-color:var(--colorBrandBackground2Pressed);}"
|
|
30
30
|
]);
|
|
31
31
|
const useCitationRootStyles = (0, _reactcomponents.__styles)({
|
|
32
32
|
isBlock: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useCitationStyles.styles.ts"],"sourcesContent":["import {\n makeResetStyles,\n makeStyles,\n mergeClasses,\n shorthands,\n tokens,\n typographyStyles,\n} from '@fluentui/react-components';\nimport type { CitationSlots, CitationState } from './Citation.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const citationClassNames: SlotClassNames<CitationSlots> = {\n root: 'fai-Citation',\n};\n\nconst useCitationBaseClassName = makeResetStyles({\n display: 'inline-flex',\n justifyContent: 'center',\n boxSizing: 'border-box',\n alignItems: 'center',\n ...typographyStyles.caption2Strong,\n\n
|
|
1
|
+
{"version":3,"sources":["useCitationStyles.styles.ts"],"sourcesContent":["import {\n makeResetStyles,\n makeStyles,\n mergeClasses,\n shorthands,\n tokens,\n typographyStyles,\n} from '@fluentui/react-components';\nimport type { CitationSlots, CitationState } from './Citation.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const citationClassNames: SlotClassNames<CitationSlots> = {\n root: 'fai-Citation',\n};\n\nconst useCitationBaseClassName = makeResetStyles({\n display: 'inline-flex',\n justifyContent: 'center',\n boxSizing: 'border-box',\n alignItems: 'center',\n ...typographyStyles.caption2Strong,\n\n backgroundColor: tokens.colorNeutralBackground3,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke2}`,\n color: tokens.colorNeutralForeground2,\n\n minWidth: '14px',\n height: '14px',\n verticalAlign: `calc((${typographyStyles.caption2Strong.lineHeight} - ${typographyStyles.caption2Strong.fontSize}) / 2)`,\n\n borderRadius: tokens.borderRadiusMedium,\n\n textDecoration: 'none',\n\n marginLeft: tokens.spacingHorizontalXXS,\n marginRight: tokens.spacingHorizontalXXS,\n\n ':hover': {\n cursor: 'pointer',\n color: tokens.colorBrandForeground2Hover,\n borderColor: tokens.colorBrandStroke2Hover,\n backgroundColor: tokens.colorBrandBackground2Hover,\n },\n\n ':hover:active': {\n cursor: 'pointer',\n color: tokens.colorBrandForeground2Pressed,\n borderColor: tokens.colorBrandStroke2Pressed,\n backgroundColor: tokens.colorBrandBackground2Pressed,\n },\n});\n\nconst useCitationRootStyles = makeStyles({\n isBlock: {\n display: 'flex',\n marginLeft: 0,\n marginRight: 0,\n },\n isPopoverLocked: {\n color: tokens.colorBrandForeground2Pressed,\n ...shorthands.borderColor(tokens.colorBrandStroke2Pressed),\n backgroundColor: tokens.colorBrandBackground2,\n ':hover': {\n color: tokens.colorBrandForeground2Pressed,\n ...shorthands.borderColor(tokens.colorBrandStroke2Pressed),\n backgroundColor: tokens.colorBrandBackground2,\n },\n },\n});\n\n/**\n * Apply styling to the Citation slots based on the state\n */\nexport const useCitationStyles_unstable = (state: CitationState): CitationState => {\n 'use no memo';\n\n const rootBaseClassName = useCitationBaseClassName();\n const rootStyles = useCitationRootStyles();\n\n state.root.className = mergeClasses(\n citationClassNames.root,\n state.isPopoverLocked && rootStyles.isPopoverLocked,\n state.block && rootStyles.isBlock,\n rootBaseClassName,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["citationClassNames","useCitationStyles_unstable","root","useCitationBaseClassName","makeResetStyles","display","__styles","justifyContent","boxSizing","alignItems","t21cq0","typographyStyles","caption2Strong","tokens","color","minWidth","height","verticalAlign","borderRadius","borderRadiusMedium","textDecoration","marginLeft","marginRight","Bwzppfd","cursor","colorBrandForeground2Hover","borderColor","state","useCitationRootStyles","mergeClasses","isPopoverLocked","rootStyles","block","isBlock","rootBaseClassName","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAWaA,kBAAAA;eAAAA;;IAuCbC,0BAAA;eAAAA;;;iCA5CkB;AAKX,MAAMD,qBAAoD;UAC/DE;AACF;AAEA,MAAMC,2BAA2BC,IAAAA,8BAAAA,EAAAA,UAAgB,YAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;CAAA;MAC/CC,wBAASC,IAAAA,yBAAA,EAAA;aACTC;QACAC,QAAAA;QACAC,QAAAA;YAAAA;YAAY;SAAA;QACZC,QAAGC;YAAAA;YAAiBC;SAAAA;;qBAGTC;QACXC,QAAOD;QAEPE,QAAAA;QACAC,QAAQ;YAAA;YAAA;SAAA;QACRC,SAAAA;QAEAC,QAAAA;YAAAA;YAAcL;SAAOM;QAErBC,QAAAA;QAEAC,SAAAA;QACAC,SAAAA;QAEAC,SAAA;YAAU;YAAA;SAAA;gBACRC;gBACAV;YAAAA;YAAcW;SAAAA;gBACdC;;;OAIF;QAAA;QAAiB;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;KAAA;;;QACP;QAAA;QAAA;QAAA;QAAA;KAAA;;AAKZ,MAAAzB,6BAAA0B,CAAAA;IAEA;UAEItB,oBAASF;UACTkB,aAAYO;UACZN,IAAAA,CAAAA,SAAa,GAAAO,IAAAA,6BAAA,EAAA7B,mBAAAE,IAAA,EAAAyB,MAAAG,eAAA,IAAAC,WAAAD,eAAA,EAAAH,MAAAK,KAAA,IAAAD,WAAAE,OAAA,EAAAC,mBAAAP,MAAAzB,IAAA,CAAAiC,SAAA;WACfR;uDAE4C"}
|
|
@@ -34,12 +34,12 @@ const referenceExtraClassNames = {
|
|
|
34
34
|
graphicChild: 'fai-Reference__graphicChild'
|
|
35
35
|
};
|
|
36
36
|
const GRAPHIC_SIZE = '16px';
|
|
37
|
-
const useRootBaseClassName = (0, _reactcomponents.__resetStyles)("
|
|
38
|
-
".
|
|
39
|
-
".
|
|
40
|
-
".
|
|
41
|
-
".
|
|
42
|
-
".
|
|
37
|
+
const useRootBaseClassName = (0, _reactcomponents.__resetStyles)("r19i5hos", null, [
|
|
38
|
+
".r19i5hos{align-items:center;background-color:var(--colorNeutralBackground3);border:var(--strokeWidthThin) solid var(--colorNeutralStroke2);border-radius:var(--borderRadiusMedium);box-sizing:border-box;color:var(--colorNeutralForeground2);column-gap:var(--spacingHorizontalXXS);display:flex;flex-shrink:0;justify-content:center;max-width:100%;min-height:24px;padding:var(--spacingVerticalXXS) var(--spacingHorizontalS);text-decoration:none;}",
|
|
39
|
+
".r19i5hos:hover{background-color:var(--colorNeutralBackground3Hover);border-color:var(--colorNeutralStroke1Hover);color:var(--colorNeutralForeground2Hover);}",
|
|
40
|
+
".r19i5hos:hover .fai-Reference__divider{background-color:var(--colorNeutralStroke1Hover);}",
|
|
41
|
+
".r19i5hos:hover:active{background-color:var(--colorNeutralBackground3Pressed);border-color:var(--colorNeutralStroke1Pressed);color:var(--colorNeutralForeground2Pressed);}",
|
|
42
|
+
".r19i5hos:hover:active .fai-Reference__divider{background-color:var(--colorNeutralStroke1Pressed);}"
|
|
43
43
|
]);
|
|
44
44
|
const useRootStyles = (0, _reactcomponents.__styles)({
|
|
45
45
|
overflow: {
|
|
@@ -58,12 +58,12 @@ const useCitationBaseClassName = (0, _reactcomponents.__resetStyles)("rzdip90",
|
|
|
58
58
|
const useDividerBaseClassName = (0, _reactcomponents.__resetStyles)("r1eyqaw5", null, [
|
|
59
59
|
".r1eyqaw5{background-color:var(--colorNeutralStroke2);height:16px;margin:var(--spacingVerticalNone) var(--spacingHorizontalXS);width:1px;}"
|
|
60
60
|
]);
|
|
61
|
-
const useGraphicBaseClassName = (0, _reactcomponents.__resetStyles)("
|
|
62
|
-
".
|
|
63
|
-
".
|
|
61
|
+
const useGraphicBaseClassName = (0, _reactcomponents.__resetStyles)("rpyrgl4", null, [
|
|
62
|
+
".rpyrgl4{display:inline-flex;font-size:16px;height:16px;line-height:16px;width:16px;}",
|
|
63
|
+
".rpyrgl4>.fai-Reference__graphicChild{height:16px;width:16px;}"
|
|
64
64
|
]);
|
|
65
|
-
const useContentBaseClassName = (0, _reactcomponents.__resetStyles)("
|
|
66
|
-
".
|
|
65
|
+
const useContentBaseClassName = (0, _reactcomponents.__resetStyles)("r1ycou3l", null, [
|
|
66
|
+
".r1ycou3l{align-items:center;column-gap:var(--spacingHorizontalSNudge);display:inline-flex;text-align:start;word-break:break-word;font-family:var(--fontFamilyBase);font-size:var(--fontSizeBase200);font-weight:var(--fontWeightRegular);line-height:var(--lineHeightBase200);}"
|
|
67
67
|
]);
|
|
68
68
|
const useReferenceStyles_unstable = (state)=>{
|
|
69
69
|
'use no memo';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useReferenceStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses, tokens, typographyStyles } from '@fluentui/react-components';\nimport type { ReferenceSlots, ReferenceState } from './Reference.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const referenceClassNames: SlotClassNames<ReferenceSlots> = {\n root: 'fai-Reference',\n citation: 'fai-Reference__citation',\n divider: 'fai-Reference__divider',\n graphic: 'fai-Reference__graphic',\n content: 'fai-Reference__content',\n};\n\nexport const referenceExtraClassNames = {\n graphicChild: 'fai-Reference__graphicChild',\n};\n\nconst GRAPHIC_SIZE = '16px';\n\nconst useRootBaseClassName = makeResetStyles({\n alignItems: 'center',\n backgroundColor: tokens.colorNeutralBackground3,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke2}`,\n borderRadius: tokens.borderRadiusMedium,\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground2,\n columnGap: tokens.spacingHorizontalXXS,\n display: 'flex',\n flexShrink: 0,\n justifyContent: 'center',\n maxWidth: '
|
|
1
|
+
{"version":3,"sources":["useReferenceStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses, tokens, typographyStyles } from '@fluentui/react-components';\nimport type { ReferenceSlots, ReferenceState } from './Reference.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const referenceClassNames: SlotClassNames<ReferenceSlots> = {\n root: 'fai-Reference',\n citation: 'fai-Reference__citation',\n divider: 'fai-Reference__divider',\n graphic: 'fai-Reference__graphic',\n content: 'fai-Reference__content',\n};\n\nexport const referenceExtraClassNames = {\n graphicChild: 'fai-Reference__graphicChild',\n};\n\nconst GRAPHIC_SIZE = '16px';\n\nconst useRootBaseClassName = makeResetStyles({\n alignItems: 'center',\n backgroundColor: tokens.colorNeutralBackground3,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke2}`,\n borderRadius: tokens.borderRadiusMedium,\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground2,\n columnGap: tokens.spacingHorizontalXXS,\n display: 'flex',\n flexShrink: 0,\n justifyContent: 'center',\n maxWidth: '100%',\n minHeight: '24px',\n padding: `${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalS}`,\n textDecoration: 'none',\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground3Hover,\n borderColor: tokens.colorNeutralStroke1Hover,\n color: tokens.colorNeutralForeground2Hover,\n\n [`& .${referenceClassNames.divider}`]: {\n backgroundColor: tokens.colorNeutralStroke1Hover,\n },\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorNeutralBackground3Pressed,\n borderColor: tokens.colorNeutralStroke1Pressed,\n color: tokens.colorNeutralForeground2Pressed,\n\n [`& .${referenceClassNames.divider}`]: {\n backgroundColor: tokens.colorNeutralStroke1Pressed,\n },\n },\n});\n\nexport const useRootStyles = makeStyles({\n overflow: {\n maxWidth: '100%',\n width: '100%',\n },\n});\n\nconst useCitationBaseClassName = makeResetStyles({\n ...typographyStyles.caption2Strong,\n});\n\nconst useDividerBaseClassName = makeResetStyles({\n backgroundColor: tokens.colorNeutralStroke2,\n height: '16px',\n margin: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalXS}`,\n width: '1px',\n});\n\nconst useGraphicBaseClassName = makeResetStyles({\n display: 'inline-flex',\n fontSize: GRAPHIC_SIZE,\n height: GRAPHIC_SIZE,\n lineHeight: GRAPHIC_SIZE,\n width: GRAPHIC_SIZE,\n\n [`> .${referenceExtraClassNames.graphicChild}`]: {\n height: GRAPHIC_SIZE,\n width: GRAPHIC_SIZE,\n },\n});\n\nconst useContentBaseClassName = makeResetStyles({\n alignItems: 'center',\n columnGap: tokens.spacingHorizontalSNudge,\n display: 'inline-flex',\n textAlign: 'start',\n wordBreak: 'break-word',\n ...typographyStyles.caption1,\n});\n\n/**\n * Apply styling to the Reference slots based on the state\n */\nexport const useReferenceStyles_unstable = (state: ReferenceState): ReferenceState => {\n 'use no memo';\n\n const rootBaseClassName = useRootBaseClassName();\n const citationBaseClassName = useCitationBaseClassName();\n const dividerBaseClassName = useDividerBaseClassName();\n const contentBaseClassName = useContentBaseClassName();\n const graphicBaseClassName = useGraphicBaseClassName();\n\n state.root.className = mergeClasses(referenceClassNames.root, rootBaseClassName, state.root.className);\n\n if (state.citation) {\n state.citation.className = mergeClasses(\n referenceClassNames.citation,\n citationBaseClassName,\n state.citation.className,\n );\n }\n\n if (state.divider) {\n state.divider.className = mergeClasses(referenceClassNames.divider, dividerBaseClassName, state.divider.className);\n }\n\n if (state.content) {\n state.content.className = mergeClasses(referenceClassNames.content, contentBaseClassName, state.content.className);\n }\n\n if (state.graphic) {\n state.graphic.className = mergeClasses(referenceClassNames.graphic, graphicBaseClassName, state.graphic.className);\n }\n\n return state;\n};\n"],"names":["referenceClassNames","referenceExtraClassNames","backgroundColor","colorNeutralBackground3Hover","alignItems","root","citation","divider","graphic","content","graphicChild","GRAPHIC_SIZE","useRootBaseClassName","makeResetStyles","__styles","border","borderRadius","columnGap","spacingHorizontalXXS","flexShrink","__resetStyles","justifyContent","maxWidth","minHeight","rootBaseClassName","tokens","dividerBaseClassName","useDividerBaseClassName","contentBaseClassName","useContentBaseClassName","graphicBaseClassName","useGraphicBaseClassName","colorNeutralBackground3Pressed","state","className","borderColor","color","colorNeutralForeground2Pressed","citationBaseClassName","mergeClasses","useRootStyles","makeStyles","width"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAIaA,mBAAAA;eAAAA;;IAQAC,wBAAAA;eAAAA;;IAuBTC,2BAAwBC;eAAxBD;;IAhBFE,aAAY;eAAZA;;;iCAnB0E;AAIrE,MAAMJ,sBAAsD;UACjEK;cACAC;aACAC;aACAC;aACAC;AACF;AAEO,MAAMR,2BAA2B;kBACtCS;AACF;AAEA,MAAMC,eAAe;AAErB,MAAMC,uBAAuBC,IAAAA,8BAAAA,EAAAA,YAAgB,MAAA;IAAA;IAAA;IAAA;IAAA;IAAA;CAAA;AAC3CT,MAAAA,gBAAYU,IAAAA,yBAAA,EAAA;cACZZ;QACAa,SAAS;QACTC,QAAAA;;;OAGAC;QAAAA;QAAkBC;KAAoB;;MAEtCC,2BAAYC,IAAAA,8BAAA,EAAA,WAAA,MAAA;IAAA;CAAA;MACZC,0BAAgBD,IAAAA,8BAAA,EAAA,YAAA,MAAA;IAAA;CAAA;MAChBE,0BAAUF,IAAAA,8BAAA,EAAA,WAAA,MAAA;IAAA;IAAA;CAAA;MACVG,0BAAWH,IAAAA,8BAAA,EAAA,YAAA,MAAA;IAAA;CAAA;MAKTlB,8BAAwBC,CAAAA;;UAIxBqB,oBAAOxB;kCACYyB;UACnBC,uBAAAC;UACFC,uBAAAC;UAEAC,uBAAiBC;UACf7B,IAAAA,CAAAA,SAAAA,GAAiBuB,IAAAA,6BAAOO,EAAAA,oBAAAA,IAA8B,EAAAR,mBAAAS,MAAA5B,IAAA,CAAA6B,SAAA;cACtDC,QAAAA,EAAaV;cACbW,QAAOX,CAAAA,SAAOY,GAAAA,IAAAA,6BAAAA,EAAAA,oBAA8B/B,QAAA,EAAAgC,uBAAAL,MAAA3B,QAAA,CAAA4B,SAAA;;cAG1ChC,OAAAA,EAAAA;cACFK,OAAA,CAAA2B,SAAA,GAAAK,IAAAA,6BAAA,EAAAvC,oBAAAO,OAAA,EAAAmB,sBAAAO,MAAA1B,OAAA,CAAA2B,SAAA;;IAEJ,IAAAD,MAAAxB,OAAA,EAAA;QAEAwB,MAAOxB,OAAM+B,CAAAA,SAAAA,GAAgBC,IAAAA,6BAAW,EAAAzC,oBAAAS,OAAA,EAAAmB,sBAAAK,MAAAxB,OAAA,CAAAyB,SAAA;;cAEpCZ,OAAU,EAAA;cACVoB,OAAO,CAAAR,SAAA,GAAAK,IAAAA,6BAAA,EAAAvC,oBAAAQ,OAAA,EAAAsB,sBAAAG,MAAAzB,OAAA,CAAA0B,SAAA;;IAEX,OAAGD;AAEH,wDACoC"}
|
|
@@ -37,7 +37,7 @@ const generateReferenceCitationPreview = (props)=>{
|
|
|
37
37
|
var _previewContentProps_content;
|
|
38
38
|
return /*#__PURE__*/ _react.createElement(_reactpreview.Preview, {
|
|
39
39
|
closeOnScroll: true,
|
|
40
|
-
positioning: "
|
|
40
|
+
positioning: "above",
|
|
41
41
|
size: "small",
|
|
42
42
|
trapFocus: true,
|
|
43
43
|
withArrow: true,
|
|
@@ -68,7 +68,7 @@ const generateReferenceCitationPreview = (props)=>{
|
|
|
68
68
|
var _previewHeaderProps_children, _previewContentProps_content;
|
|
69
69
|
return /*#__PURE__*/ _react.createElement(_reactpreview.Preview, {
|
|
70
70
|
closeOnScroll: true,
|
|
71
|
-
positioning: "
|
|
71
|
+
positioning: "above",
|
|
72
72
|
size: "small",
|
|
73
73
|
trapFocus: true,
|
|
74
74
|
withArrow: true,
|
|
@@ -1 +1 @@
|
|
|
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?: PreviewProps;\n citationPreviewSurfaceProps?: PreviewSurfaceProps;\n citationProps?: CitationProps;\n index: number;\n previewContentProps?: PackagedPreviewContentProps;\n previewHeaderProps?: PreviewHeaderProps;\n referencePreviewProps?: PreviewProps;\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=\"below\" 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={`Reference ${index}, close`} 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=\"below\" 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={`Reference ${index}, close`} 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;0BAS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AAAA;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
|
+
{"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?: PreviewProps;\n citationPreviewSurfaceProps?: PreviewSurfaceProps;\n citationProps?: CitationProps;\n index: number;\n previewContentProps?: PackagedPreviewContentProps;\n previewHeaderProps?: PreviewHeaderProps;\n referencePreviewProps?: PreviewProps;\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={`Reference ${index}, close`} 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={`Reference ${index}, close`} 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;;uBAA2DC;uBAC7EJ;mCAGEK;sBAENA,GAAAA,OAAAA,aAAAA,CAA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4BN,GAAAA,OAAAA,aAAc,CAAAX,qBAAA,EAAA;2BAAIG;yBAC7EJ;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,UAAchB,EAAAA,MAAAA,OAAAA,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"}
|
|
@@ -77,7 +77,7 @@ const useReferenceCitationPreview = ({ index, referenceId: propsRefId, citationI
|
|
|
77
77
|
var _previewHeaderProps_children, _sensitivityLabelProps_description, _previewSurfaceProps_children;
|
|
78
78
|
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_reactpreview.Preview, {
|
|
79
79
|
closeOnScroll: true,
|
|
80
|
-
positioning: "
|
|
80
|
+
positioning: "above",
|
|
81
81
|
size: "small",
|
|
82
82
|
trapFocus: true,
|
|
83
83
|
withArrow: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useReferenceCitationPreview.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport * as React from 'react';\nimport {\n Caption1,\n assertSlots,\n mergeCallbacks,\n slot,\n useId,\n usePopoverContext_unstable,\n} from '@fluentui/react-components';\nimport type { Slot } 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 { PreviewHeaderProps, PreviewProps, PreviewSurfaceProps } from '@fluentui-copilot/react-preview';\nimport type { SensitivityLabelProps } from '@fluentui-copilot/react-sensitivity-label';\n\nimport { Citation } from '../Citation';\nimport { Reference } from '../Reference';\nimport type { CitationProps } from '../Citation';\nimport type { ReferenceProps } from '../Reference';\n\n/**\n * Props for a \"packaged Citation\". A packaged Citation is a `Citation` that is\n * pre-packaged with props set by the `useReferenceCitation` hook.\n */\nexport type PackagedCitationProps = Omit<CitationProps, 'referenceHref'> &\n Partial<Pick<CitationProps, 'referenceHref'>>;\n\n/**\n * A \"packaged Citation\". A packaged Citation is a `Citation` that is\n * pre-packaged with props set by the `useReferenceCitation` hook.\n */\nexport type PackagedCitation = React.FC<PackagedCitationProps>;\n\ntype PartialReferenceProps = 'citationHref' | 'index' | 'referenceId';\n\n/**\n * Props for a \"packaged Reference\". A packaged Reference is a `Reference` that is\n * pre-packaged with props set by the `useReferenceCitation` hook.\n */\nexport type PackagedReferenceProps = Omit<ReferenceProps, PartialReferenceProps> &\n Partial<Pick<ReferenceProps, PartialReferenceProps>>;\n\n/**\n * A \"packaged Reference\". A packaged Reference is a `Reference` that is\n * pre-packaged with props set by the `useReferenceCitation` hook.\n */\nexport type PackagedReference = React.FC<PackagedReferenceProps>;\n\n/**\n * Data used to package a `Citation` and `Reference` together with\n * the `useReferenceCitation` hook.\n */\nexport type ReferenceCitationData = {\n index: number;\n referenceId?: string;\n citationId?: string;\n citationProps?: PackagedCitationProps;\n referenceProps?: PackagedReferenceProps;\n previewHeaderProps?: PreviewHeaderProps;\n previewProps?: PreviewProps;\n previewSurfaceProps?: PreviewSurfaceProps;\n sensitivityLabelProps?: SensitivityLabelProps;\n};\n\nexport type UseReferenceCitationPreview = (data: ReferenceCitationData) => {\n Citation: PackagedCitation;\n Reference: PackagedReference;\n};\n\ntype PreviewExtraSlots = {\n content: Slot<'div'>;\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 * Hook to package a `Citation` and `Reference` together in an\n * accessibly by default manner.\n *\n * When using citations and references, prefer using them via this\n * hook to ensure props are wired up correctly.\n */\nexport const useReferenceCitationPreview: UseReferenceCitationPreview = ({\n index,\n referenceId: propsRefId,\n citationId: propsCiteId,\n citationProps,\n referenceProps,\n previewHeaderProps,\n previewProps,\n previewSurfaceProps,\n sensitivityLabelProps,\n}) => {\n const refId = useId();\n const citeId = useId();\n\n const referenceId = propsRefId ?? refId;\n const citationId = propsCiteId ?? citeId;\n\n const components = React.useMemo(() => {\n const citationHref = `#${citationId}`;\n\n const PackagedReference: PackagedReference = props => {\n const referenceIndex = props.index ?? referenceProps?.index ?? index;\n\n return (\n <Reference\n {...referenceProps}\n index={referenceIndex}\n referenceId={referenceId}\n citationHref={citationHref}\n {...props}\n />\n );\n };\n\n const CitationWithPreview: PackagedCitation = props => {\n // We assert content as a slot to use it with its resolved props object and the correct defaults below.\n const content = slot.always(referenceProps ? referenceProps.content : undefined, {\n defaultProps: {\n children: referenceProps?.excerpt && <Caption1>{referenceProps.excerpt}</Caption1>,\n },\n elementType: 'div',\n });\n const citationWithPreviewState = {\n components: {\n content: 'div',\n },\n content,\n };\n assertSlots<PreviewExtraSlots>(citationWithPreviewState);\n\n // We resolve the slots' objects for sensitivity and title here so that we can use the information from their children below.\n const sensitivity = slot.optional(referenceProps?.sensitivity, { elementType: 'span' });\n const title = slot.optional(referenceProps?.label, { elementType: 'div' });\n\n return (\n <Preview closeOnScroll positioning=\"below\" size=\"small\" trapFocus withArrow {...previewProps}>\n <PreviewTrigger>\n <Citation {...citationProps} id={citationId} {...props}>\n {index}\n </Citation>\n </PreviewTrigger>\n <PreviewSurface {...previewSurfaceProps}>\n <PreviewContent>\n <PreviewHeader\n citation={\n <CitationCloseButton aria-label={`Reference ${index}, close`} referenceHref=\"#\" tabIndex={-1}>\n {index}\n </CitationCloseButton>\n }\n media={referenceProps?.media}\n {...previewHeaderProps}\n >\n {previewHeaderProps?.children ?? title?.children}\n </PreviewHeader>\n <PreviewMetadata\n icon={referenceProps?.icon}\n primaryText={referenceProps?.primaryText}\n secondaryText={referenceProps?.secondaryText}\n tertiaryText={referenceProps?.tertiaryText}\n />\n {sensitivity && (\n <SensitivityLabel description={sensitivityLabelProps?.description ?? ''}>\n {sensitivity.children}\n </SensitivityLabel>\n )}\n <citationWithPreviewState.content />\n {previewSurfaceProps?.children ?? previewProps?.children}\n </PreviewContent>\n </PreviewSurface>\n </Preview>\n );\n };\n\n return {\n Citation: CitationWithPreview,\n Reference: PackagedReference,\n };\n }, [\n index,\n referenceId,\n citationId,\n referenceProps,\n citationProps,\n previewHeaderProps,\n previewProps,\n previewSurfaceProps,\n sensitivityLabelProps,\n ]);\n\n return components;\n};\n"],"names":["CitationCloseButton","citationCloseButtonProps","setPopoverOpen","usePopoverContext_unstable","context","setOpen","onPopoverCloseClick","React","useCallback","ev","preventDefault","_jsx","Citation","onCitationCloseButtonClick","onClick","index","refId","useId","citeId","referenceId","citationId","components","citationHref","PackagedReference","props","referenceProps","referenceIndex","_props_index","_ref","CitationWithPreview","Reference","content","children","undefined","excerpt","Caption1","title","citationWithPreviewState","positioning","optional","sensitivity","size","withArrow","label","previewProps","PreviewTrigger","PreviewSurface","previewSurfaceProps","referenceHref","media","previewHeaderProps","primaryText","_previewHeaderProps_children","SensitivityLabel","description","sensitivityLabelProps","secondaryText","citationProps"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;4BACA;iEAEuB;iCAQhB;8BAUA;uCAC0B;0BAIR;2BACC;AAyD1B,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,GAAAS,IAAAA,eAAA,EAAAC,kBAAA,EAAA;QAGlB,GAAAX,wBAAMY;QAENC,SAAAD;;;uCASDE,KACD,eAWQC,UAAQC,cACRC,WAASD,eAETE,gBACAC,oBAEAC,cACEC,qBAEAC,uBACmBC;kBAEvBP,IAAAA,sBAAA;mBAEKA,IAAAA,sBAAGQ;wBACJV,eAAOW,Q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AAA,MAAAA,OAAAA,CAAkB;;;;;8DAMtBC,QAAW1B,mBAAEA,KAAAA,IAAAA,KAAAA,IAAAA,eAAAA,KAAAA;;8EAECA,uBAAAA,QAAAA,uBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,mBAA4BO,QAAA,MAAA,QAAAoB,iCAAA,KAAA,IAAAA,+BAAAhB,UAAA,QAAAA,UAAA,KAAA,IAAA,KAAA,IAAAA,MAAAJ,QAAA;;;6DAE3CQ,QAAAA,mBACEa,KAAAA,IAAAA,KAAAA,IAAAA,eAAAA,IAAAA;oEAAiBC,QAAaC,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAAA,WAAAA;sEAC5Bf,QAAAA,mBAAoB,KAAA,IAAA,KAAA,IAAAf,eAAA+B,aAAA;;;gFAGzB,EAAAH,uCAAChB,EAAAA;uFACAU,0BAAAA,QAAAA,0BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,sBAAqBf,WAAQ,MAA7Be,QAAAA,uCAAAA,KAAAA,IAAAA,qCAAiCH;;;;;;;;;;;eAO5C;sBACEhC;uBACAkB;;OAEJ;QAAAf;QAAGI;QAAAC;QAAAK;QAAAgC;QAAAP;QAAAN;QAAAG;QAAAQ;KAAA;WACDxC;0DAEAK"}
|
|
1
|
+
{"version":3,"sources":["useReferenceCitationPreview.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport * as React from 'react';\nimport {\n Caption1,\n assertSlots,\n mergeCallbacks,\n slot,\n useId,\n usePopoverContext_unstable,\n} from '@fluentui/react-components';\nimport type { Slot } 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 { PreviewHeaderProps, PreviewProps, PreviewSurfaceProps } from '@fluentui-copilot/react-preview';\nimport type { SensitivityLabelProps } from '@fluentui-copilot/react-sensitivity-label';\n\nimport { Citation } from '../Citation';\nimport { Reference } from '../Reference';\nimport type { CitationProps } from '../Citation';\nimport type { ReferenceProps } from '../Reference';\n\n/**\n * Props for a \"packaged Citation\". A packaged Citation is a `Citation` that is\n * pre-packaged with props set by the `useReferenceCitation` hook.\n */\nexport type PackagedCitationProps = Omit<CitationProps, 'referenceHref'> &\n Partial<Pick<CitationProps, 'referenceHref'>>;\n\n/**\n * A \"packaged Citation\". A packaged Citation is a `Citation` that is\n * pre-packaged with props set by the `useReferenceCitation` hook.\n */\nexport type PackagedCitation = React.FC<PackagedCitationProps>;\n\ntype PartialReferenceProps = 'citationHref' | 'index' | 'referenceId';\n\n/**\n * Props for a \"packaged Reference\". A packaged Reference is a `Reference` that is\n * pre-packaged with props set by the `useReferenceCitation` hook.\n */\nexport type PackagedReferenceProps = Omit<ReferenceProps, PartialReferenceProps> &\n Partial<Pick<ReferenceProps, PartialReferenceProps>>;\n\n/**\n * A \"packaged Reference\". A packaged Reference is a `Reference` that is\n * pre-packaged with props set by the `useReferenceCitation` hook.\n */\nexport type PackagedReference = React.FC<PackagedReferenceProps>;\n\n/**\n * Data used to package a `Citation` and `Reference` together with\n * the `useReferenceCitation` hook.\n */\nexport type ReferenceCitationData = {\n index: number;\n referenceId?: string;\n citationId?: string;\n citationProps?: PackagedCitationProps;\n referenceProps?: PackagedReferenceProps;\n previewHeaderProps?: PreviewHeaderProps;\n previewProps?: PreviewProps;\n previewSurfaceProps?: PreviewSurfaceProps;\n sensitivityLabelProps?: SensitivityLabelProps;\n};\n\nexport type UseReferenceCitationPreview = (data: ReferenceCitationData) => {\n Citation: PackagedCitation;\n Reference: PackagedReference;\n};\n\ntype PreviewExtraSlots = {\n content: Slot<'div'>;\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 * Hook to package a `Citation` and `Reference` together in an\n * accessibly by default manner.\n *\n * When using citations and references, prefer using them via this\n * hook to ensure props are wired up correctly.\n */\nexport const useReferenceCitationPreview: UseReferenceCitationPreview = ({\n index,\n referenceId: propsRefId,\n citationId: propsCiteId,\n citationProps,\n referenceProps,\n previewHeaderProps,\n previewProps,\n previewSurfaceProps,\n sensitivityLabelProps,\n}) => {\n const refId = useId();\n const citeId = useId();\n\n const referenceId = propsRefId ?? refId;\n const citationId = propsCiteId ?? citeId;\n\n const components = React.useMemo(() => {\n const citationHref = `#${citationId}`;\n\n const PackagedReference: PackagedReference = props => {\n const referenceIndex = props.index ?? referenceProps?.index ?? index;\n\n return (\n <Reference\n {...referenceProps}\n index={referenceIndex}\n referenceId={referenceId}\n citationHref={citationHref}\n {...props}\n />\n );\n };\n\n const CitationWithPreview: PackagedCitation = props => {\n // We assert content as a slot to use it with its resolved props object and the correct defaults below.\n const content = slot.always(referenceProps ? referenceProps.content : undefined, {\n defaultProps: {\n children: referenceProps?.excerpt && <Caption1>{referenceProps.excerpt}</Caption1>,\n },\n elementType: 'div',\n });\n const citationWithPreviewState = {\n components: {\n content: 'div',\n },\n content,\n };\n assertSlots<PreviewExtraSlots>(citationWithPreviewState);\n\n // We resolve the slots' objects for sensitivity and title here so that we can use the information from their children below.\n const sensitivity = slot.optional(referenceProps?.sensitivity, { elementType: 'span' });\n const title = slot.optional(referenceProps?.label, { elementType: 'div' });\n\n return (\n <Preview closeOnScroll positioning=\"above\" size=\"small\" trapFocus withArrow {...previewProps}>\n <PreviewTrigger>\n <Citation {...citationProps} id={citationId} {...props}>\n {index}\n </Citation>\n </PreviewTrigger>\n <PreviewSurface {...previewSurfaceProps}>\n <PreviewContent>\n <PreviewHeader\n citation={\n <CitationCloseButton aria-label={`Reference ${index}, close`} referenceHref=\"#\" tabIndex={-1}>\n {index}\n </CitationCloseButton>\n }\n media={referenceProps?.media}\n {...previewHeaderProps}\n >\n {previewHeaderProps?.children ?? title?.children}\n </PreviewHeader>\n <PreviewMetadata\n icon={referenceProps?.icon}\n primaryText={referenceProps?.primaryText}\n secondaryText={referenceProps?.secondaryText}\n tertiaryText={referenceProps?.tertiaryText}\n />\n {sensitivity && (\n <SensitivityLabel description={sensitivityLabelProps?.description ?? ''}>\n {sensitivity.children}\n </SensitivityLabel>\n )}\n <citationWithPreviewState.content />\n {previewSurfaceProps?.children ?? previewProps?.children}\n </PreviewContent>\n </PreviewSurface>\n </Preview>\n );\n };\n\n return {\n Citation: CitationWithPreview,\n Reference: PackagedReference,\n };\n }, [\n index,\n referenceId,\n citationId,\n referenceProps,\n citationProps,\n previewHeaderProps,\n previewProps,\n previewSurfaceProps,\n sensitivityLabelProps,\n ]);\n\n return components;\n};\n"],"names":["CitationCloseButton","citationCloseButtonProps","setPopoverOpen","usePopoverContext_unstable","context","setOpen","onPopoverCloseClick","React","useCallback","ev","preventDefault","_jsx","Citation","onCitationCloseButtonClick","onClick","index","refId","useId","citeId","referenceId","citationId","components","citationHref","PackagedReference","props","referenceProps","referenceIndex","_props_index","_ref","CitationWithPreview","Reference","content","children","undefined","excerpt","Caption1","title","citationWithPreviewState","positioning","optional","sensitivity","size","withArrow","label","previewProps","PreviewTrigger","PreviewSurface","previewSurfaceProps","referenceHref","media","previewHeaderProps","primaryText","_previewHeaderProps_children","SensitivityLabel","description","sensitivityLabelProps","secondaryText","citationProps"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,MAA7Be,QAAAA,uCAAAA,KAAAA,IAAAA,qCAAiCH;;;;;;;;;;;eAO5C;sBACEhC;uBACAkB;;OAEJ;QAAAf;QAAGI;QAAAC;QAAAK;QAAAgC;QAAAP;QAAAN;QAAAG;QAAAQ;KAAA;WACDxC;0DAEAK"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-copilot/react-reference",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.3",
|
|
4
4
|
"description": "Fluent AI controls for citations and references",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"@fluentui-copilot/react-preview": "^0.5.1",
|
|
16
16
|
"@fluentui-copilot/react-provider": "^0.8.4",
|
|
17
17
|
"@fluentui-copilot/react-sensitivity-label": "^0.5.1",
|
|
18
|
-
"@fluentui-copilot/react-utilities": "^0.0.
|
|
18
|
+
"@fluentui-copilot/react-utilities": "^0.0.2",
|
|
19
19
|
"@swc/helpers": "^0.5.1"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|