@fluentui-copilot/react-reference 0.15.5-hotfix.1 → 0.15.5-hotfix.2
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 +4 -4
- package/CHANGELOG.md +5 -5
- package/lib/Citation.js +1 -0
- package/lib/Reference.js +1 -0
- package/lib/ReferenceGroupToggle.js +1 -0
- package/lib/ReferenceList.js +1 -0
- package/lib/ReferenceListV2.js +1 -0
- package/lib/ReferenceOverflowButton.js +1 -0
- package/lib/ReferenceV2.js +1 -0
- package/lib/components/Citation/Citation.js +6 -5
- package/lib/components/Citation/Citation.types.js +2 -1
- package/lib/components/Citation/index.js +1 -0
- package/lib/components/Citation/renderCitation.js +6 -4
- package/lib/components/Citation/useCitation.js +28 -22
- package/lib/components/Citation/useCitationStyles.styles.raw.js +59 -54
- package/lib/components/Reference/Reference.js +7 -5
- package/lib/components/Reference/Reference.types.js +2 -1
- package/lib/components/Reference/index.js +1 -0
- package/lib/components/Reference/renderReference.js +12 -27
- package/lib/components/Reference/useReference.js +172 -173
- package/lib/components/Reference/useReferenceStyles.styles.raw.js +181 -172
- package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.js +6 -4
- package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js +2 -1
- package/lib/components/ReferenceGroupToggle/index.js +1 -0
- package/lib/components/ReferenceGroupToggle/renderReferenceGroupToggle.js +8 -9
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggle.js +30 -26
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.styles.raw.js +36 -31
- package/lib/components/ReferenceList/ReferenceList.js +7 -5
- package/lib/components/ReferenceList/ReferenceList.types.js +2 -1
- package/lib/components/ReferenceList/index.js +1 -0
- package/lib/components/ReferenceList/renderReferenceList.js +6 -4
- package/lib/components/ReferenceList/useReferenceList.js +17 -15
- package/lib/components/ReferenceList/useReferenceListStyles.styles.raw.js +22 -16
- package/lib/components/reference-v2/Reference/Reference.js +5 -4
- package/lib/components/reference-v2/Reference/Reference.types.js +2 -1
- package/lib/components/reference-v2/Reference/index.js +1 -0
- package/lib/components/reference-v2/Reference/renderReference.js +17 -20
- package/lib/components/reference-v2/Reference/useReference.js +59 -53
- package/lib/components/reference-v2/Reference/useReferenceStyles.styles.raw.js +89 -84
- package/lib/components/reference-v2/ReferenceList/ReferenceList.js +6 -5
- package/lib/components/reference-v2/ReferenceList/ReferenceList.types.js +2 -1
- package/lib/components/reference-v2/ReferenceList/index.js +1 -0
- package/lib/components/reference-v2/ReferenceList/renderReferenceList.js +17 -17
- package/lib/components/reference-v2/ReferenceList/useReferenceList.js +80 -70
- package/lib/components/reference-v2/ReferenceList/useReferenceListContextValues.js +21 -13
- package/lib/components/reference-v2/ReferenceList/useReferenceListStyles.styles.raw.js +38 -31
- package/lib/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.js +5 -4
- package/lib/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.types.js +2 -1
- package/lib/components/reference-v2/ReferenceOverflowButton/index.js +1 -0
- package/lib/components/reference-v2/ReferenceOverflowButton/renderReferenceOverflowButton.js +14 -9
- package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js +77 -77
- package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.raw.js +39 -33
- package/lib/components/reference-v2/index.js +1 -0
- package/lib/contexts/ReferenceGroupContext.js +6 -5
- package/lib/contexts/reference-v2/index.js +1 -0
- package/lib/contexts/reference-v2/referenceListContext.js +12 -11
- package/lib/index.js +1 -0
- package/lib/utilities/index.js +1 -0
- package/lib/utilities/reference-v2/generateReferenceCitationPreview.js +86 -75
- package/lib/utilities/reference-v2/index.js +1 -0
- package/lib/utilities/reference-v2/useReferenceCitationPreview.js +5 -5
- package/lib/utilities/useReferenceCitationPreview.js +114 -123
- package/lib/utilities/useReferenceGroup.js +24 -26
- package/lib/utilities/useReferenceGroup.styles.raw.js +4 -3
- package/lib-commonjs/Citation.js +1 -0
- package/lib-commonjs/Reference.js +1 -0
- package/lib-commonjs/ReferenceGroupToggle.js +1 -0
- package/lib-commonjs/ReferenceList.js +1 -0
- package/lib-commonjs/ReferenceListV2.js +1 -0
- package/lib-commonjs/ReferenceOverflowButton.js +1 -0
- package/lib-commonjs/ReferenceV2.js +1 -0
- package/lib-commonjs/components/Citation/Citation.js +1 -1
- package/lib-commonjs/components/Citation/Citation.js.map +1 -1
- package/lib-commonjs/components/Citation/Citation.types.js +1 -0
- package/lib-commonjs/components/Citation/index.js +1 -0
- package/lib-commonjs/components/Citation/renderCitation.js +1 -1
- package/lib-commonjs/components/Citation/renderCitation.js.map +1 -1
- package/lib-commonjs/components/Citation/useCitation.js +1 -1
- package/lib-commonjs/components/Citation/useCitation.js.map +1 -1
- package/lib-commonjs/components/Citation/useCitationStyles.styles.raw.js +1 -1
- package/lib-commonjs/components/Citation/useCitationStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/Reference/Reference.js +1 -1
- package/lib-commonjs/components/Reference/Reference.js.map +1 -1
- package/lib-commonjs/components/Reference/Reference.types.js +1 -0
- package/lib-commonjs/components/Reference/index.js +1 -0
- package/lib-commonjs/components/Reference/renderReference.js +1 -1
- package/lib-commonjs/components/Reference/renderReference.js.map +1 -1
- package/lib-commonjs/components/Reference/useReference.js +1 -1
- package/lib-commonjs/components/Reference/useReference.js.map +1 -1
- package/lib-commonjs/components/Reference/useReferenceStyles.styles.raw.js +1 -1
- package/lib-commonjs/components/Reference/useReferenceStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.js +1 -1
- package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.js.map +1 -1
- package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js +1 -0
- package/lib-commonjs/components/ReferenceGroupToggle/index.js +1 -0
- package/lib-commonjs/components/ReferenceGroupToggle/renderReferenceGroupToggle.js +1 -1
- package/lib-commonjs/components/ReferenceGroupToggle/renderReferenceGroupToggle.js.map +1 -1
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggle.js +1 -1
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggle.js.map +1 -1
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.styles.raw.js +1 -1
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/ReferenceList/ReferenceList.js +1 -1
- package/lib-commonjs/components/ReferenceList/ReferenceList.js.map +1 -1
- package/lib-commonjs/components/ReferenceList/ReferenceList.types.js +1 -0
- package/lib-commonjs/components/ReferenceList/index.js +1 -0
- package/lib-commonjs/components/ReferenceList/renderReferenceList.js +1 -1
- package/lib-commonjs/components/ReferenceList/renderReferenceList.js.map +1 -1
- package/lib-commonjs/components/ReferenceList/useReferenceList.js +1 -1
- package/lib-commonjs/components/ReferenceList/useReferenceList.js.map +1 -1
- package/lib-commonjs/components/ReferenceList/useReferenceListStyles.styles.raw.js +1 -1
- package/lib-commonjs/components/ReferenceList/useReferenceListStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/reference-v2/Reference/Reference.js +1 -1
- package/lib-commonjs/components/reference-v2/Reference/Reference.js.map +1 -1
- package/lib-commonjs/components/reference-v2/Reference/Reference.types.js +1 -0
- package/lib-commonjs/components/reference-v2/Reference/index.js +1 -0
- package/lib-commonjs/components/reference-v2/Reference/renderReference.js +1 -1
- package/lib-commonjs/components/reference-v2/Reference/renderReference.js.map +1 -1
- package/lib-commonjs/components/reference-v2/Reference/useReference.js +1 -1
- package/lib-commonjs/components/reference-v2/Reference/useReference.js.map +1 -1
- package/lib-commonjs/components/reference-v2/Reference/useReferenceStyles.styles.raw.js +1 -1
- package/lib-commonjs/components/reference-v2/Reference/useReferenceStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.js +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.types.js +1 -0
- package/lib-commonjs/components/reference-v2/ReferenceList/index.js +1 -0
- package/lib-commonjs/components/reference-v2/ReferenceList/renderReferenceList.js +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceList/renderReferenceList.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceList.js +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceList.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListContextValues.js +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListContextValues.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListStyles.styles.raw.js +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.js +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.types.js +1 -0
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/index.js +1 -0
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/renderReferenceOverflowButton.js +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/renderReferenceOverflowButton.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.raw.js +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/components/reference-v2/index.js +1 -0
- package/lib-commonjs/contexts/ReferenceGroupContext.js +1 -1
- package/lib-commonjs/contexts/ReferenceGroupContext.js.map +1 -1
- package/lib-commonjs/contexts/reference-v2/index.js +1 -0
- package/lib-commonjs/contexts/reference-v2/referenceListContext.js +1 -1
- package/lib-commonjs/contexts/reference-v2/referenceListContext.js.map +1 -1
- package/lib-commonjs/index.js +1 -0
- package/lib-commonjs/utilities/index.js +1 -0
- package/lib-commonjs/utilities/reference-v2/generateReferenceCitationPreview.js +1 -1
- package/lib-commonjs/utilities/reference-v2/generateReferenceCitationPreview.js.map +1 -1
- package/lib-commonjs/utilities/reference-v2/index.js +1 -0
- package/lib-commonjs/utilities/reference-v2/useReferenceCitationPreview.js +1 -1
- package/lib-commonjs/utilities/reference-v2/useReferenceCitationPreview.js.map +1 -1
- package/lib-commonjs/utilities/useReferenceCitationPreview.js +1 -1
- package/lib-commonjs/utilities/useReferenceCitationPreview.js.map +1 -1
- package/lib-commonjs/utilities/useReferenceGroup.js +1 -1
- package/lib-commonjs/utilities/useReferenceGroup.js.map +1 -1
- package/lib-commonjs/utilities/useReferenceGroup.styles.raw.js +1 -1
- package/lib-commonjs/utilities/useReferenceGroup.styles.raw.js.map +1 -1
- package/package.json +6 -6
|
@@ -11,19 +11,21 @@ import { referenceListItemClassName } from './useReferenceListStyles.styles';
|
|
|
11
11
|
* @param ref - reference to root HTMLElement of ReferenceList
|
|
12
12
|
*
|
|
13
13
|
* deprecated Use ReferenceListV2 component, hooks and types instead.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
14
|
+
*/
|
|
15
|
+
export const useReferenceList_unstable = (props, ref) => {
|
|
16
|
+
return {
|
|
17
|
+
components: {
|
|
18
|
+
root: 'ol'
|
|
19
|
+
},
|
|
20
|
+
root: slot.always(getIntrinsicElementProps('ol', {
|
|
21
|
+
ref,
|
|
22
|
+
...props,
|
|
23
|
+
children: React.Children.map(props.children, child => /*#__PURE__*/React.createElement("li", {
|
|
24
|
+
className: referenceListItemClassName
|
|
25
|
+
}, child))
|
|
26
|
+
}), {
|
|
27
|
+
elementType: 'ol'
|
|
28
|
+
})
|
|
29
|
+
};
|
|
29
30
|
};
|
|
31
|
+
//# sourceMappingURL=useReferenceList.js.map
|
|
@@ -1,27 +1,33 @@
|
|
|
1
1
|
import { makeResetStyles, mergeClasses } from '@fluentui/react-components';
|
|
2
2
|
import { tokens } from '@fluentui-copilot/tokens';
|
|
3
|
-
/** deprecated Use ReferenceListV2 component, hooks and types instead. */
|
|
4
|
-
|
|
3
|
+
/** deprecated Use ReferenceListV2 component, hooks and types instead. */
|
|
4
|
+
export const referenceListClassNames = {
|
|
5
|
+
root: 'fai-ReferenceList'
|
|
5
6
|
};
|
|
6
|
-
/** deprecated Use ReferenceListV2 component, hooks and types instead. */
|
|
7
|
+
/** deprecated Use ReferenceListV2 component, hooks and types instead. */
|
|
8
|
+
export const referenceListItemClassName = 'fai-ReferenceList__item';
|
|
7
9
|
/**
|
|
8
10
|
* Styles for the root slot
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
*/
|
|
12
|
+
const useRootClassName = makeResetStyles({
|
|
13
|
+
padding: 0,
|
|
14
|
+
margin: 0,
|
|
15
|
+
display: 'flex',
|
|
16
|
+
flexDirection: 'column',
|
|
17
|
+
gap: tokens.spacingVerticalS,
|
|
18
|
+
[`> .${referenceListItemClassName}`]: {
|
|
19
|
+
listStyleType: 'none'
|
|
20
|
+
}
|
|
18
21
|
});
|
|
19
22
|
/**
|
|
20
23
|
* Apply styling to the ReferenceList slots based on the state
|
|
21
24
|
*
|
|
22
25
|
* deprecated Use ReferenceListV2 component, hooks and types instead.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
*/
|
|
27
|
+
export const useReferenceListStyles_unstable = state => {
|
|
28
|
+
'use no memo';
|
|
29
|
+
|
|
30
|
+
state.root.className = mergeClasses(referenceListClassNames.root, useRootClassName(), state.root.className);
|
|
31
|
+
return state;
|
|
27
32
|
};
|
|
33
|
+
//# sourceMappingURL=useReferenceListStyles.styles.raw.js.map
|
|
@@ -2,9 +2,10 @@ import * as React from 'react';
|
|
|
2
2
|
import { useReference_unstable } from './useReference';
|
|
3
3
|
import { renderReference_unstable } from './renderReference';
|
|
4
4
|
import { useReferenceStyles_unstable } from './useReferenceStyles.styles';
|
|
5
|
-
export const Reference = /*#__PURE__*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
export const Reference = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
6
|
+
const state = useReference_unstable(props, ref);
|
|
7
|
+
useReferenceStyles_unstable(state);
|
|
8
|
+
return renderReference_unstable(state);
|
|
9
9
|
});
|
|
10
10
|
Reference.displayName = 'Reference';
|
|
11
|
+
//# sourceMappingURL=Reference.js.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=Reference.types.js.map
|
|
@@ -2,3 +2,4 @@ export { Reference } from './Reference';
|
|
|
2
2
|
export { renderReference_unstable } from './renderReference';
|
|
3
3
|
export { useReference_unstable } from './useReference';
|
|
4
4
|
export { referenceClassNames, referenceExtraClassNames, useReferenceStyles_unstable } from './useReferenceStyles.styles';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { OverflowItem, assertSlots } from '@fluentui/react-components';
|
|
3
|
-
export const renderReference_unstable =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return shouldUseOverflow ? /*#__PURE__*/ _jsx(OverflowItem, {
|
|
19
|
-
id: id,
|
|
20
|
-
children: reference
|
|
21
|
-
}, id) : reference;
|
|
3
|
+
export const renderReference_unstable = state => {
|
|
4
|
+
assertSlots(state);
|
|
5
|
+
const {
|
|
6
|
+
id,
|
|
7
|
+
shouldUseOverflow
|
|
8
|
+
} = state;
|
|
9
|
+
const reference = /*#__PURE__*/_jsxs(state.root, {
|
|
10
|
+
children: [state.citation && /*#__PURE__*/_jsx(state.citation, {}), state.divider && /*#__PURE__*/_jsx(state.divider, {}), state.content && /*#__PURE__*/_jsxs(state.content, {
|
|
11
|
+
children: [state.graphic && /*#__PURE__*/_jsx(state.graphic, {}), state.root.children]
|
|
12
|
+
})]
|
|
13
|
+
});
|
|
14
|
+
return shouldUseOverflow ? /*#__PURE__*/_jsx(OverflowItem, {
|
|
15
|
+
id: id,
|
|
16
|
+
children: reference
|
|
17
|
+
}, id) : reference;
|
|
22
18
|
};
|
|
19
|
+
//# sourceMappingURL=renderReference.js.map
|
|
@@ -11,58 +11,64 @@ import { useDesignVersion } from '@fluentui-copilot/react-provider';
|
|
|
11
11
|
*
|
|
12
12
|
* @param props - props from this instance of Reference
|
|
13
13
|
* @param ref - reference to root HTMLElement of Reference
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
14
|
+
*/
|
|
15
|
+
export const useReference_unstable = (props, ref) => {
|
|
16
|
+
const {
|
|
17
|
+
as,
|
|
18
|
+
children,
|
|
19
|
+
id
|
|
20
|
+
} = props;
|
|
21
|
+
const designVersion = useDesignVersion(props.designVersion);
|
|
22
|
+
const shouldUseOverflow = useReferenceListContext_unstable(ctx => ctx.shouldUseOverflow);
|
|
23
|
+
const referenceId = useId('reference-', id);
|
|
24
|
+
const elementType = as || (props.href ? 'a' : 'button');
|
|
25
|
+
const propsWithAssignedAs = {
|
|
26
|
+
type: elementType === 'button' ? 'button' : undefined,
|
|
27
|
+
...props,
|
|
28
|
+
as: elementType,
|
|
29
|
+
id: referenceId
|
|
30
|
+
};
|
|
31
|
+
const citation = slot.optional(props.citation, {
|
|
32
|
+
elementType: 'span'
|
|
33
|
+
});
|
|
34
|
+
const graphic = slot.optional(props.graphic, {
|
|
35
|
+
elementType: 'span'
|
|
36
|
+
});
|
|
37
|
+
const content = slot.optional(props.content, {
|
|
38
|
+
elementType: 'span',
|
|
39
|
+
renderByDefault: graphic !== undefined || !!children
|
|
40
|
+
});
|
|
41
|
+
const divider = slot.optional(props.divider, {
|
|
42
|
+
elementType: 'span',
|
|
43
|
+
renderByDefault: citation !== undefined && content !== undefined
|
|
44
|
+
});
|
|
45
|
+
const state = {
|
|
46
|
+
designVersion,
|
|
47
|
+
id: referenceId,
|
|
48
|
+
shouldUseOverflow,
|
|
49
|
+
components: {
|
|
50
|
+
root: elementType,
|
|
51
|
+
citation: 'span',
|
|
52
|
+
divider: 'span',
|
|
53
|
+
graphic: 'span',
|
|
54
|
+
content: 'span'
|
|
55
|
+
},
|
|
56
|
+
root: slot.always(getIntrinsicElementProps(elementType, {
|
|
57
|
+
ref,
|
|
58
|
+
...propsWithAssignedAs
|
|
59
|
+
}), {
|
|
60
|
+
elementType
|
|
61
|
+
}),
|
|
62
|
+
citation,
|
|
63
|
+
divider,
|
|
64
|
+
content,
|
|
65
|
+
graphic
|
|
66
|
+
};
|
|
67
|
+
if (state.graphic && React.isValidElement(state.graphic.children)) {
|
|
68
|
+
state.graphic.children = React.cloneElement(state.graphic.children, {
|
|
69
|
+
className: mergeClasses(state.graphic.children.props.className, referenceExtraClassNames.graphicChild)
|
|
28
70
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
});
|
|
32
|
-
const content = slot.optional(props.content, {
|
|
33
|
-
elementType: 'span',
|
|
34
|
-
renderByDefault: graphic !== undefined || !!children
|
|
35
|
-
});
|
|
36
|
-
const divider = slot.optional(props.divider, {
|
|
37
|
-
elementType: 'span',
|
|
38
|
-
renderByDefault: citation !== undefined && content !== undefined
|
|
39
|
-
});
|
|
40
|
-
const state = {
|
|
41
|
-
designVersion,
|
|
42
|
-
id: referenceId,
|
|
43
|
-
shouldUseOverflow,
|
|
44
|
-
components: {
|
|
45
|
-
root: elementType,
|
|
46
|
-
citation: 'span',
|
|
47
|
-
divider: 'span',
|
|
48
|
-
graphic: 'span',
|
|
49
|
-
content: 'span'
|
|
50
|
-
},
|
|
51
|
-
root: slot.always(getIntrinsicElementProps(elementType, {
|
|
52
|
-
ref,
|
|
53
|
-
...propsWithAssignedAs
|
|
54
|
-
}), {
|
|
55
|
-
elementType
|
|
56
|
-
}),
|
|
57
|
-
citation,
|
|
58
|
-
divider,
|
|
59
|
-
content,
|
|
60
|
-
graphic
|
|
61
|
-
};
|
|
62
|
-
if (state.graphic && React.isValidElement(state.graphic.children)) {
|
|
63
|
-
state.graphic.children = React.cloneElement(state.graphic.children, {
|
|
64
|
-
className: mergeClasses(state.graphic.children.props.className, referenceExtraClassNames.graphicChild)
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
return state;
|
|
71
|
+
}
|
|
72
|
+
return state;
|
|
68
73
|
};
|
|
74
|
+
//# sourceMappingURL=useReference.js.map
|
|
@@ -1,110 +1,115 @@
|
|
|
1
1
|
import { makeResetStyles, makeStyles, mergeClasses, typographyStyles } from '@fluentui/react-components';
|
|
2
2
|
import { tokens } from '@fluentui-copilot/tokens';
|
|
3
3
|
export const referenceClassNames = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
root: 'fai-Reference',
|
|
5
|
+
citation: 'fai-Reference__citation',
|
|
6
|
+
divider: 'fai-Reference__divider',
|
|
7
|
+
graphic: 'fai-Reference__graphic',
|
|
8
|
+
content: 'fai-Reference__content'
|
|
9
9
|
};
|
|
10
10
|
export const referenceExtraClassNames = {
|
|
11
|
-
|
|
11
|
+
graphicChild: 'fai-Reference__graphicChild'
|
|
12
12
|
};
|
|
13
13
|
const GRAPHIC_SIZE = '16px';
|
|
14
14
|
const useRootBaseClassName = makeResetStyles({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
15
|
+
alignItems: 'center',
|
|
16
|
+
backgroundColor: tokens.colorNeutralBackground3,
|
|
17
|
+
border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke2}`,
|
|
18
|
+
borderRadius: tokens.borderRadiusMedium,
|
|
19
|
+
boxSizing: 'border-box',
|
|
20
|
+
color: tokens.colorNeutralForeground2,
|
|
21
|
+
columnGap: tokens.spacingHorizontalXXS,
|
|
22
|
+
display: 'inline-flex',
|
|
23
|
+
flexShrink: 0,
|
|
24
|
+
justifyContent: 'center',
|
|
25
|
+
maxWidth: '100%',
|
|
26
|
+
minHeight: '24px',
|
|
27
|
+
padding: `${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalS}`,
|
|
28
|
+
textDecoration: 'none',
|
|
29
|
+
':hover': {
|
|
30
|
+
backgroundColor: tokens.colorNeutralBackground3Hover,
|
|
31
|
+
borderColor: tokens.colorNeutralStroke1Hover,
|
|
32
|
+
color: tokens.colorNeutralForeground2Hover,
|
|
33
|
+
[`& .${referenceClassNames.divider}`]: {
|
|
34
|
+
backgroundColor: tokens.colorNeutralStroke1Hover
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
':hover:active': {
|
|
38
|
+
backgroundColor: tokens.colorNeutralBackground3Pressed,
|
|
39
|
+
borderColor: tokens.colorNeutralStroke1Pressed,
|
|
40
|
+
color: tokens.colorNeutralForeground2Pressed,
|
|
41
|
+
[`& .${referenceClassNames.divider}`]: {
|
|
42
|
+
backgroundColor: tokens.colorNeutralStroke1Pressed
|
|
44
43
|
}
|
|
44
|
+
}
|
|
45
45
|
});
|
|
46
46
|
export const useRootStyles = makeStyles({
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
overflow: {
|
|
48
|
+
maxWidth: '100%',
|
|
49
|
+
width: '100%'
|
|
50
|
+
}
|
|
51
51
|
});
|
|
52
52
|
const useRootNextStyles = makeStyles({
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
root: {
|
|
54
|
+
borderRadius: tokens.borderRadiusXLarge
|
|
55
|
+
}
|
|
56
56
|
});
|
|
57
57
|
const useCitationBaseClassName = makeResetStyles({
|
|
58
|
-
|
|
58
|
+
...typographyStyles.caption2Strong
|
|
59
59
|
});
|
|
60
60
|
const useDividerBaseClassName = makeResetStyles({
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
backgroundColor: tokens.colorNeutralStroke2,
|
|
62
|
+
height: '16px',
|
|
63
|
+
margin: `${tokens.spacingVerticalNone} ${tokens.spacingHorizontalXS}`,
|
|
64
|
+
width: '1px'
|
|
65
65
|
});
|
|
66
66
|
const useGraphicBaseClassName = makeResetStyles({
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
display: 'inline-flex',
|
|
68
|
+
fontSize: GRAPHIC_SIZE,
|
|
69
|
+
height: GRAPHIC_SIZE,
|
|
70
|
+
lineHeight: GRAPHIC_SIZE,
|
|
71
|
+
width: GRAPHIC_SIZE,
|
|
72
|
+
[`> .${referenceExtraClassNames.graphicChild}`]: {
|
|
69
73
|
height: GRAPHIC_SIZE,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
[`> .${referenceExtraClassNames.graphicChild}`]: {
|
|
73
|
-
height: GRAPHIC_SIZE,
|
|
74
|
-
width: GRAPHIC_SIZE
|
|
75
|
-
}
|
|
74
|
+
width: GRAPHIC_SIZE
|
|
75
|
+
}
|
|
76
76
|
});
|
|
77
77
|
const useContentBaseClassName = makeResetStyles({
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
alignItems: 'center',
|
|
79
|
+
columnGap: tokens.spacingHorizontalSNudge,
|
|
80
|
+
display: 'inline-flex',
|
|
81
|
+
textAlign: 'start',
|
|
82
|
+
wordBreak: 'break-word',
|
|
83
|
+
...typographyStyles.caption1
|
|
84
84
|
});
|
|
85
85
|
/**
|
|
86
86
|
* Apply styling to the Reference slots based on the state
|
|
87
|
-
*/
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
87
|
+
*/
|
|
88
|
+
export const useReferenceStyles_unstable = state => {
|
|
89
|
+
'use no memo';
|
|
90
|
+
|
|
91
|
+
const {
|
|
92
|
+
designVersion
|
|
93
|
+
} = state;
|
|
94
|
+
const rootBaseClassName = useRootBaseClassName();
|
|
95
|
+
const rootNextStyles = useRootNextStyles();
|
|
96
|
+
const citationBaseClassName = useCitationBaseClassName();
|
|
97
|
+
const dividerBaseClassName = useDividerBaseClassName();
|
|
98
|
+
const contentBaseClassName = useContentBaseClassName();
|
|
99
|
+
const graphicBaseClassName = useGraphicBaseClassName();
|
|
100
|
+
state.root.className = mergeClasses(referenceClassNames.root, rootBaseClassName, designVersion === 'next' && rootNextStyles.root, state.root.className);
|
|
101
|
+
if (state.citation) {
|
|
102
|
+
state.citation.className = mergeClasses(referenceClassNames.citation, citationBaseClassName, state.citation.className);
|
|
103
|
+
}
|
|
104
|
+
if (state.divider) {
|
|
105
|
+
state.divider.className = mergeClasses(referenceClassNames.divider, dividerBaseClassName, state.divider.className);
|
|
106
|
+
}
|
|
107
|
+
if (state.content) {
|
|
108
|
+
state.content.className = mergeClasses(referenceClassNames.content, contentBaseClassName, state.content.className);
|
|
109
|
+
}
|
|
110
|
+
if (state.graphic) {
|
|
111
|
+
state.graphic.className = mergeClasses(referenceClassNames.graphic, graphicBaseClassName, state.graphic.className);
|
|
112
|
+
}
|
|
113
|
+
return state;
|
|
110
114
|
};
|
|
115
|
+
//# sourceMappingURL=useReferenceStyles.styles.raw.js.map
|
|
@@ -3,10 +3,11 @@ import { renderReferenceList_unstable } from './renderReferenceList';
|
|
|
3
3
|
import { useReferenceList_unstable } from './useReferenceList';
|
|
4
4
|
import { useReferenceListStyles_unstable } from './useReferenceListStyles.styles';
|
|
5
5
|
import { useReferenceListContextValues_unstable } from './useReferenceListContextValues';
|
|
6
|
-
export const ReferenceList = /*#__PURE__*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
export const ReferenceList = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
7
|
+
const state = useReferenceList_unstable(props, ref);
|
|
8
|
+
const referenceListContextValues = useReferenceListContextValues_unstable(state);
|
|
9
|
+
useReferenceListStyles_unstable(state);
|
|
10
|
+
return renderReferenceList_unstable(state, referenceListContextValues);
|
|
11
11
|
});
|
|
12
12
|
ReferenceList.displayName = 'ReferenceList';
|
|
13
|
+
//# sourceMappingURL=ReferenceList.js.map
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=ReferenceList.types.js.map
|
|
@@ -2,3 +2,4 @@ export { ReferenceList } from './ReferenceList';
|
|
|
2
2
|
export { renderReferenceList_unstable } from './renderReferenceList';
|
|
3
3
|
export { useReferenceList_unstable } from './useReferenceList';
|
|
4
4
|
export { referenceListClassNames, useReferenceListStyles_unstable } from './useReferenceListStyles.styles';
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
2
|
import { Overflow, assertSlots } from '@fluentui/react-components';
|
|
3
3
|
import { ReferenceListContextProvider } from '../../../contexts/reference-v2/referenceListContext';
|
|
4
4
|
/**
|
|
5
5
|
* Render the final JSX of ReferenceList
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
});
|
|
6
|
+
*/
|
|
7
|
+
export const renderReferenceList_unstable = (state, contextValues) => {
|
|
8
|
+
assertSlots(state);
|
|
9
|
+
const {
|
|
10
|
+
minVisibleReferences
|
|
11
|
+
} = state;
|
|
12
|
+
return /*#__PURE__*/_jsx(ReferenceListContextProvider, {
|
|
13
|
+
value: contextValues.referenceList,
|
|
14
|
+
children: /*#__PURE__*/_jsx(Overflow, {
|
|
15
|
+
minimumVisible: minVisibleReferences,
|
|
16
|
+
children: /*#__PURE__*/_jsxs(state.root, {
|
|
17
|
+
children: [/*#__PURE__*/_jsx(state.arrowableRegion, {}), state.showMoreButton && /*#__PURE__*/_jsx(state.showMoreButton, {}), state.showLessButton && /*#__PURE__*/_jsx(state.showLessButton, {})]
|
|
18
|
+
})
|
|
19
|
+
})
|
|
20
|
+
});
|
|
22
21
|
};
|
|
22
|
+
//# sourceMappingURL=renderReferenceList.js.map
|