@fluentui-copilot/react-reference 0.0.0-nightly-20240313-0404-8abc883d.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +943 -0
- package/CHANGELOG.md +281 -0
- package/LICENSE +23 -0
- package/README.md +5 -0
- package/dist/index.d.ts +539 -0
- package/lib/Citation.js +2 -0
- package/lib/Citation.js.map +1 -0
- package/lib/Reference.js +2 -0
- package/lib/Reference.js.map +1 -0
- package/lib/ReferenceGroup.js +2 -0
- package/lib/ReferenceGroup.js.map +1 -0
- package/lib/ReferenceGroupToggle.js +2 -0
- package/lib/ReferenceGroupToggle.js.map +1 -0
- package/lib/ReferenceList.js +2 -0
- package/lib/ReferenceList.js.map +1 -0
- package/lib/components/Citation/Citation.js +14 -0
- package/lib/components/Citation/Citation.js.map +1 -0
- package/lib/components/Citation/Citation.types.js +2 -0
- package/lib/components/Citation/Citation.types.js.map +1 -0
- package/lib/components/Citation/index.js +6 -0
- package/lib/components/Citation/index.js.map +1 -0
- package/lib/components/Citation/renderCitation.js +29 -0
- package/lib/components/Citation/renderCitation.js.map +1 -0
- package/lib/components/Citation/useCitation.js +191 -0
- package/lib/components/Citation/useCitation.js.map +1 -0
- package/lib/components/Citation/useCitationStyles.js +44 -0
- package/lib/components/Citation/useCitationStyles.js.map +1 -0
- package/lib/components/Reference/Reference.js +14 -0
- package/lib/components/Reference/Reference.js.map +1 -0
- package/lib/components/Reference/Reference.types.js +2 -0
- package/lib/components/Reference/Reference.types.js.map +1 -0
- package/lib/components/Reference/index.js +6 -0
- package/lib/components/Reference/index.js.map +1 -0
- package/lib/components/Reference/renderReference.js +16 -0
- package/lib/components/Reference/renderReference.js.map +1 -0
- package/lib/components/Reference/useReference.js +197 -0
- package/lib/components/Reference/useReference.js.map +1 -0
- package/lib/components/Reference/useReferenceStyles.js +253 -0
- package/lib/components/Reference/useReferenceStyles.js.map +1 -0
- package/lib/components/ReferenceGroup/ReferenceGroup.js +19 -0
- package/lib/components/ReferenceGroup/ReferenceGroup.js.map +1 -0
- package/lib/components/ReferenceGroup/ReferenceGroup.types.js +2 -0
- package/lib/components/ReferenceGroup/ReferenceGroup.types.js.map +1 -0
- package/lib/components/ReferenceGroup/index.js +6 -0
- package/lib/components/ReferenceGroup/index.js.map +1 -0
- package/lib/components/ReferenceGroup/renderReferenceGroup.js +21 -0
- package/lib/components/ReferenceGroup/renderReferenceGroup.js.map +1 -0
- package/lib/components/ReferenceGroup/useReferenceGroup.js +104 -0
- package/lib/components/ReferenceGroup/useReferenceGroup.js.map +1 -0
- package/lib/components/ReferenceGroup/useReferenceGroupContextValues.js +10 -0
- package/lib/components/ReferenceGroup/useReferenceGroupContextValues.js.map +1 -0
- package/lib/components/ReferenceGroup/useReferenceGroupStyles.js +50 -0
- package/lib/components/ReferenceGroup/useReferenceGroupStyles.js.map +1 -0
- package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.js +12 -0
- package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.js.map +1 -0
- package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js +2 -0
- package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js.map +1 -0
- package/lib/components/ReferenceGroupToggle/index.js +6 -0
- package/lib/components/ReferenceGroupToggle/index.js.map +1 -0
- package/lib/components/ReferenceGroupToggle/renderReferenceGroupToggle.js +12 -0
- package/lib/components/ReferenceGroupToggle/renderReferenceGroupToggle.js.map +1 -0
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggle.js +40 -0
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggle.js.map +1 -0
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.js +20 -0
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.js.map +1 -0
- package/lib/components/ReferenceList/ReferenceList.js +14 -0
- package/lib/components/ReferenceList/ReferenceList.js.map +1 -0
- package/lib/components/ReferenceList/ReferenceList.types.js +2 -0
- package/lib/components/ReferenceList/ReferenceList.types.js.map +1 -0
- package/lib/components/ReferenceList/index.js +6 -0
- package/lib/components/ReferenceList/index.js.map +1 -0
- package/lib/components/ReferenceList/renderReferenceList.js +10 -0
- package/lib/components/ReferenceList/renderReferenceList.js.map +1 -0
- package/lib/components/ReferenceList/useReferenceList.js +30 -0
- package/lib/components/ReferenceList/useReferenceList.js.map +1 -0
- package/lib/components/ReferenceList/useReferenceListStyles.js +17 -0
- package/lib/components/ReferenceList/useReferenceListStyles.js.map +1 -0
- package/lib/context/ReferenceGroupContext.js +11 -0
- package/lib/context/ReferenceGroupContext.js.map +1 -0
- package/lib/hooks/index.js +4 -0
- package/lib/hooks/index.js.map +1 -0
- package/lib/hooks/useReferenceCitation.js +77 -0
- package/lib/hooks/useReferenceCitation.js.map +1 -0
- package/lib/hooks/useReferenceCitationPreview.js +128 -0
- package/lib/hooks/useReferenceCitationPreview.js.map +1 -0
- package/lib/hooks/useReferenceGroup.js +40 -0
- package/lib/hooks/useReferenceGroup.js.map +1 -0
- package/lib/index.js +7 -0
- package/lib/index.js.map +1 -0
- package/lib-commonjs/Citation.js +7 -0
- package/lib-commonjs/Citation.js.map +1 -0
- package/lib-commonjs/Reference.js +7 -0
- package/lib-commonjs/Reference.js.map +1 -0
- package/lib-commonjs/ReferenceGroup.js +7 -0
- package/lib-commonjs/ReferenceGroup.js.map +1 -0
- package/lib-commonjs/ReferenceGroupToggle.js +7 -0
- package/lib-commonjs/ReferenceGroupToggle.js.map +1 -0
- package/lib-commonjs/ReferenceList.js +7 -0
- package/lib-commonjs/ReferenceList.js.map +1 -0
- package/lib-commonjs/components/Citation/Citation.js +23 -0
- package/lib-commonjs/components/Citation/Citation.js.map +1 -0
- package/lib-commonjs/components/Citation/Citation.types.js +5 -0
- package/lib-commonjs/components/Citation/Citation.types.js.map +1 -0
- package/lib-commonjs/components/Citation/index.js +11 -0
- package/lib-commonjs/components/Citation/index.js.map +1 -0
- package/lib-commonjs/components/Citation/renderCitation.js +38 -0
- package/lib-commonjs/components/Citation/renderCitation.js.map +1 -0
- package/lib-commonjs/components/Citation/useCitation.js +185 -0
- package/lib-commonjs/components/Citation/useCitation.js.map +1 -0
- package/lib-commonjs/components/Citation/useCitationStyles.js +100 -0
- package/lib-commonjs/components/Citation/useCitationStyles.js.map +1 -0
- package/lib-commonjs/components/Reference/Reference.js +23 -0
- package/lib-commonjs/components/Reference/Reference.js.map +1 -0
- package/lib-commonjs/components/Reference/Reference.types.js +5 -0
- package/lib-commonjs/components/Reference/Reference.types.js.map +1 -0
- package/lib-commonjs/components/Reference/index.js +11 -0
- package/lib-commonjs/components/Reference/index.js.map +1 -0
- package/lib-commonjs/components/Reference/renderReference.js +40 -0
- package/lib-commonjs/components/Reference/renderReference.js.map +1 -0
- package/lib-commonjs/components/Reference/useReference.js +201 -0
- package/lib-commonjs/components/Reference/useReference.js.map +1 -0
- package/lib-commonjs/components/Reference/useReferenceStyles.js +454 -0
- package/lib-commonjs/components/Reference/useReferenceStyles.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroup/ReferenceGroup.js +25 -0
- package/lib-commonjs/components/ReferenceGroup/ReferenceGroup.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroup/ReferenceGroup.types.js +5 -0
- package/lib-commonjs/components/ReferenceGroup/ReferenceGroup.types.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroup/index.js +11 -0
- package/lib-commonjs/components/ReferenceGroup/index.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroup/renderReferenceGroup.js +33 -0
- package/lib-commonjs/components/ReferenceGroup/renderReferenceGroup.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroup.js +103 -0
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroup.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroupContextValues.js +23 -0
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroupContextValues.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroupStyles.js +75 -0
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroupStyles.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.js +21 -0
- package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js +5 -0
- package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroupToggle/index.js +11 -0
- package/lib-commonjs/components/ReferenceGroupToggle/index.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroupToggle/renderReferenceGroupToggle.js +21 -0
- package/lib-commonjs/components/ReferenceGroupToggle/renderReferenceGroupToggle.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggle.js +39 -0
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggle.js.map +1 -0
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.js +39 -0
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/ReferenceList.js +23 -0
- package/lib-commonjs/components/ReferenceList/ReferenceList.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/ReferenceList.types.js +5 -0
- package/lib-commonjs/components/ReferenceList/ReferenceList.types.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/index.js +11 -0
- package/lib-commonjs/components/ReferenceList/index.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/renderReferenceList.js +16 -0
- package/lib-commonjs/components/ReferenceList/renderReferenceList.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/useReferenceList.js +30 -0
- package/lib-commonjs/components/ReferenceList/useReferenceList.js.map +1 -0
- package/lib-commonjs/components/ReferenceList/useReferenceListStyles.js +36 -0
- package/lib-commonjs/components/ReferenceList/useReferenceListStyles.js.map +1 -0
- package/lib-commonjs/context/ReferenceGroupContext.js +29 -0
- package/lib-commonjs/context/ReferenceGroupContext.js.map +1 -0
- package/lib-commonjs/hooks/index.js +15 -0
- package/lib-commonjs/hooks/index.js.map +1 -0
- package/lib-commonjs/hooks/useReferenceCitation.js +78 -0
- package/lib-commonjs/hooks/useReferenceCitation.js.map +1 -0
- package/lib-commonjs/hooks/useReferenceCitationPreview.js +141 -0
- package/lib-commonjs/hooks/useReferenceCitationPreview.js.map +1 -0
- package/lib-commonjs/hooks/useReferenceGroup.js +49 -0
- package/lib-commonjs/hooks/useReferenceGroup.js.map +1 -0
- package/lib-commonjs/index.js +103 -0
- package/lib-commonjs/index.js.map +1 -0
- package/package.json +43 -0
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "useReference_unstable", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return useReference_unstable;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
14
|
+
const _reacticons = require("@fluentui/react-icons");
|
|
15
|
+
const _useReferenceStyles = require("./useReferenceStyles");
|
|
16
|
+
const _Citation = require("../Citation");
|
|
17
|
+
const _ReferenceGroupContext = require("../../context/ReferenceGroupContext");
|
|
18
|
+
const _reactprovider = require("@fluentui-copilot/react-provider");
|
|
19
|
+
const useReference_unstable = (props, ref)=>{
|
|
20
|
+
const { index, referenceId, citationHref, excerpt, layout = 'inline' } = props;
|
|
21
|
+
const mode = (0, _reactprovider.useCopilotMode)(props.mode);
|
|
22
|
+
const labelId = (0, _reactcomponents.useId)();
|
|
23
|
+
const mediaId = (0, _reactcomponents.useId)();
|
|
24
|
+
const [isExpanded, setIsExpanded] = _react.useState(layout === 'popover' ? true : false);
|
|
25
|
+
const setPopoverOpen = (0, _reactcomponents.usePopoverContext_unstable)((context)=>context.setOpen);
|
|
26
|
+
const onExpandClick = (_e)=>{
|
|
27
|
+
setIsExpanded(!isExpanded);
|
|
28
|
+
};
|
|
29
|
+
const label = _reactcomponents.slot.always(props.label, {
|
|
30
|
+
defaultProps: {
|
|
31
|
+
id: labelId
|
|
32
|
+
},
|
|
33
|
+
elementType: 'div'
|
|
34
|
+
});
|
|
35
|
+
const media = _reactcomponents.slot.optional(props.media, {
|
|
36
|
+
defaultProps: {
|
|
37
|
+
id: mediaId
|
|
38
|
+
},
|
|
39
|
+
elementType: 'div'
|
|
40
|
+
});
|
|
41
|
+
if (media && /*#__PURE__*/ _react.isValidElement(media.children)) {
|
|
42
|
+
media.children = /*#__PURE__*/ _react.cloneElement(media.children, {
|
|
43
|
+
className: (0, _reactcomponents.mergeClasses)(media.children.props.className, _useReferenceStyles.referenceExtraClassNames.mediaChild)
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
if (media === null || media === void 0 ? void 0 : media.id) {
|
|
47
|
+
var _label_ariadescribedby;
|
|
48
|
+
var _label_ariadescribedby_concat;
|
|
49
|
+
label['aria-describedby'] = (_label_ariadescribedby_concat = (_label_ariadescribedby = label['aria-describedby']) === null || _label_ariadescribedby === void 0 ? void 0 : _label_ariadescribedby.concat(media.id)) !== null && _label_ariadescribedby_concat !== void 0 ? _label_ariadescribedby_concat : media.id;
|
|
50
|
+
}
|
|
51
|
+
const ariaLabelledByProp = props['aria-labelledby'];
|
|
52
|
+
const groupSemantics = _react.useMemo(()=>{
|
|
53
|
+
return layout === 'inline' ? {
|
|
54
|
+
role: 'group',
|
|
55
|
+
'aria-labelledby': `${ariaLabelledByProp !== null && ariaLabelledByProp !== void 0 ? ariaLabelledByProp : ''} ${label.id}`,
|
|
56
|
+
tabIndex: -1
|
|
57
|
+
} : {};
|
|
58
|
+
}, [
|
|
59
|
+
layout,
|
|
60
|
+
ariaLabelledByProp,
|
|
61
|
+
label.id
|
|
62
|
+
]);
|
|
63
|
+
// Within a popup, a citation should function as a close button
|
|
64
|
+
const citationProps = _react.useMemo(()=>{
|
|
65
|
+
const onPopoverCloseClick = (e)=>{
|
|
66
|
+
setPopoverOpen(e, false);
|
|
67
|
+
// don't navigate
|
|
68
|
+
e.preventDefault();
|
|
69
|
+
};
|
|
70
|
+
return layout === 'popover' ? {
|
|
71
|
+
referenceHref: '#',
|
|
72
|
+
tabIndex: -1,
|
|
73
|
+
'aria-label': `Reference ${index}, close`,
|
|
74
|
+
onClick: onPopoverCloseClick
|
|
75
|
+
} : {
|
|
76
|
+
referenceHref: citationHref
|
|
77
|
+
};
|
|
78
|
+
}, [
|
|
79
|
+
layout,
|
|
80
|
+
citationHref,
|
|
81
|
+
index,
|
|
82
|
+
setPopoverOpen
|
|
83
|
+
]);
|
|
84
|
+
const state = {
|
|
85
|
+
isExpanded,
|
|
86
|
+
mode: layout === 'popover' ? 'sidecar' : mode,
|
|
87
|
+
layout,
|
|
88
|
+
index,
|
|
89
|
+
components: {
|
|
90
|
+
root: 'div',
|
|
91
|
+
citation: 'div',
|
|
92
|
+
media: 'div',
|
|
93
|
+
actions: 'div',
|
|
94
|
+
label: 'div',
|
|
95
|
+
sensitivity: 'span',
|
|
96
|
+
sensitivityLabel: 'span',
|
|
97
|
+
metadata: 'div',
|
|
98
|
+
content: 'div',
|
|
99
|
+
primaryText: 'span',
|
|
100
|
+
secondaryText: 'span',
|
|
101
|
+
tertiaryText: 'span',
|
|
102
|
+
icon: 'span',
|
|
103
|
+
detailsButton: _reactcomponents.Button
|
|
104
|
+
},
|
|
105
|
+
root: _reactcomponents.slot.always((0, _reactcomponents.getNativeElementProps)('div', {
|
|
106
|
+
ref,
|
|
107
|
+
id: referenceId,
|
|
108
|
+
...groupSemantics,
|
|
109
|
+
...props
|
|
110
|
+
}), {
|
|
111
|
+
elementType: 'div'
|
|
112
|
+
}),
|
|
113
|
+
citation: _reactcomponents.slot.optional(props.citation, {
|
|
114
|
+
defaultProps: {
|
|
115
|
+
children: /*#__PURE__*/ _react.createElement(_Citation.Citation, {
|
|
116
|
+
block: true,
|
|
117
|
+
referenceId: referenceId,
|
|
118
|
+
...citationProps
|
|
119
|
+
}, index)
|
|
120
|
+
},
|
|
121
|
+
renderByDefault: true,
|
|
122
|
+
elementType: 'div'
|
|
123
|
+
}),
|
|
124
|
+
media,
|
|
125
|
+
actions: _reactcomponents.slot.optional(layout === 'inline' ? props.actions : null, {
|
|
126
|
+
renderByDefault: true,
|
|
127
|
+
elementType: 'div'
|
|
128
|
+
}),
|
|
129
|
+
label,
|
|
130
|
+
sensitivity: _reactcomponents.slot.optional(props.sensitivity, {
|
|
131
|
+
elementType: 'span'
|
|
132
|
+
}),
|
|
133
|
+
sensitivityLabel: _reactcomponents.slot.optional(props.sensitivityLabel, {
|
|
134
|
+
elementType: 'span'
|
|
135
|
+
}),
|
|
136
|
+
metadata: _reactcomponents.slot.always(props.metadata, {
|
|
137
|
+
elementType: 'div'
|
|
138
|
+
}),
|
|
139
|
+
primaryText: _reactcomponents.slot.optional(props.primaryText, {
|
|
140
|
+
defaultProps: {
|
|
141
|
+
hidden: !isExpanded
|
|
142
|
+
},
|
|
143
|
+
elementType: 'span'
|
|
144
|
+
}),
|
|
145
|
+
secondaryText: _reactcomponents.slot.optional(props.secondaryText, {
|
|
146
|
+
defaultProps: {
|
|
147
|
+
hidden: !isExpanded
|
|
148
|
+
},
|
|
149
|
+
elementType: 'span'
|
|
150
|
+
}),
|
|
151
|
+
tertiaryText: _reactcomponents.slot.optional(props.tertiaryText, {
|
|
152
|
+
defaultProps: {
|
|
153
|
+
hidden: !isExpanded
|
|
154
|
+
},
|
|
155
|
+
elementType: 'span'
|
|
156
|
+
}),
|
|
157
|
+
icon: _reactcomponents.slot.optional(props.icon, {
|
|
158
|
+
elementType: 'span'
|
|
159
|
+
}),
|
|
160
|
+
content: _reactcomponents.slot.always(props.content, {
|
|
161
|
+
defaultProps: {
|
|
162
|
+
children: excerpt && /*#__PURE__*/ _react.createElement(_reactcomponents.Caption1, null, excerpt)
|
|
163
|
+
},
|
|
164
|
+
elementType: 'div'
|
|
165
|
+
}),
|
|
166
|
+
detailsButton: _reactcomponents.slot.optional(layout === 'inline' ? props.detailsButton : null, {
|
|
167
|
+
defaultProps: {
|
|
168
|
+
appearance: 'transparent',
|
|
169
|
+
'aria-expanded': isExpanded,
|
|
170
|
+
'aria-label': 'show details',
|
|
171
|
+
size: mode === 'sidecar' ? 'small' : 'medium',
|
|
172
|
+
icon: {
|
|
173
|
+
children: getIcon(isExpanded, mode)
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
renderByDefault: true,
|
|
177
|
+
elementType: _reactcomponents.Button
|
|
178
|
+
})
|
|
179
|
+
};
|
|
180
|
+
if (state.detailsButton) {
|
|
181
|
+
const onClick = state.detailsButton.onClick;
|
|
182
|
+
state.detailsButton.onClick = (0, _reactcomponents.mergeCallbacks)(onClick, onExpandClick);
|
|
183
|
+
}
|
|
184
|
+
const referenceGroupSetOpen = (0, _ReferenceGroupContext.useReferenceGroupSetOpen)();
|
|
185
|
+
const onTargettedByCitation = (e)=>{
|
|
186
|
+
var _e_relatedTarget;
|
|
187
|
+
const relatedTargetHash = (_e_relatedTarget = e.relatedTarget) === null || _e_relatedTarget === void 0 ? void 0 : _e_relatedTarget.hash;
|
|
188
|
+
if (relatedTargetHash && relatedTargetHash.substring(1) === referenceId) {
|
|
189
|
+
referenceGroupSetOpen();
|
|
190
|
+
setIsExpanded(true);
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
state.root.onFocus = (0, _reactcomponents.mergeCallbacks)(state.root.onFocus, onTargettedByCitation);
|
|
194
|
+
return state;
|
|
195
|
+
};
|
|
196
|
+
const getIcon = (isExpanded, mode)=>{
|
|
197
|
+
if (mode === 'sidecar') {
|
|
198
|
+
return !isExpanded ? /*#__PURE__*/ _react.createElement(_reacticons.ChevronDown16Regular, null) : /*#__PURE__*/ _react.createElement(_reacticons.ChevronUp16Regular, null);
|
|
199
|
+
}
|
|
200
|
+
return !isExpanded ? /*#__PURE__*/ _react.createElement(_reacticons.ChevronDown24Regular, null) : /*#__PURE__*/ _react.createElement(_reacticons.ChevronUp24Regular, null);
|
|
201
|
+
}; //# sourceMappingURL=useReference.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["useReference.js"],"sourcesContent":["import * as React from 'react';\nimport { Button, Caption1, getNativeElementProps, mergeCallbacks, mergeClasses, slot, useId, usePopoverContext_unstable as usePopoverContext } from '@fluentui/react-components';\nimport { ChevronDown24Regular, ChevronUp24Regular, ChevronDown16Regular, ChevronUp16Regular } from '@fluentui/react-icons';\nimport { referenceExtraClassNames } from './useReferenceStyles';\nimport { Citation } from '../Citation';\nimport { useReferenceGroupSetOpen } from '../../context/ReferenceGroupContext';\nimport { useCopilotMode } from '@fluentui-copilot/react-provider';\n/**\n * Create the state required to render Reference.\n *\n * The returned state can be modified with hooks such as useReferenceStyles_unstable,\n * before being passed to renderReference_unstable.\n *\n * @param props - props from this instance of Reference\n * @param ref - reference to root HTMLElement of Reference\n */\nexport const useReference_unstable = (props, ref) => {\n const {\n index,\n referenceId,\n citationHref,\n excerpt,\n layout = 'inline'\n } = props;\n const mode = useCopilotMode(props.mode);\n const labelId = useId();\n const mediaId = useId();\n const [isExpanded, setIsExpanded] = React.useState(layout === 'popover' ? true : false);\n const setPopoverOpen = usePopoverContext(context => context.setOpen);\n const onExpandClick = _e => {\n setIsExpanded(!isExpanded);\n };\n const label = slot.always(props.label, {\n defaultProps: {\n id: labelId\n },\n elementType: 'div'\n });\n const media = slot.optional(props.media, {\n defaultProps: {\n id: mediaId\n },\n elementType: 'div'\n });\n if (media && /*#__PURE__*/React.isValidElement(media.children)) {\n media.children = /*#__PURE__*/React.cloneElement(media.children, {\n className: mergeClasses(media.children.props.className, referenceExtraClassNames.mediaChild)\n });\n }\n if (media === null || media === void 0 ? void 0 : media.id) {\n var _label_ariadescribedby;\n var _label_ariadescribedby_concat;\n label['aria-describedby'] = (_label_ariadescribedby_concat = (_label_ariadescribedby = label['aria-describedby']) === null || _label_ariadescribedby === void 0 ? void 0 : _label_ariadescribedby.concat(media.id)) !== null && _label_ariadescribedby_concat !== void 0 ? _label_ariadescribedby_concat : media.id;\n }\n const ariaLabelledByProp = props['aria-labelledby'];\n const groupSemantics = React.useMemo(() => {\n return layout === 'inline' ? {\n role: 'group',\n 'aria-labelledby': `${ariaLabelledByProp !== null && ariaLabelledByProp !== void 0 ? ariaLabelledByProp : ''} ${label.id}`,\n tabIndex: -1\n } : {};\n }, [layout, ariaLabelledByProp, label.id]);\n // Within a popup, a citation should function as a close button\n const citationProps = React.useMemo(() => {\n const onPopoverCloseClick = e => {\n setPopoverOpen(e, false);\n // don't navigate\n e.preventDefault();\n };\n return layout === 'popover' ? {\n referenceHref: '#',\n tabIndex: -1,\n 'aria-label': `Reference ${index}, close`,\n onClick: onPopoverCloseClick\n } : {\n referenceHref: citationHref\n };\n }, [layout, citationHref, index, setPopoverOpen]);\n const state = {\n isExpanded,\n mode: layout === 'popover' ? 'sidecar' : mode,\n layout,\n index,\n components: {\n root: 'div',\n citation: 'div',\n media: 'div',\n actions: 'div',\n label: 'div',\n sensitivity: 'span',\n sensitivityLabel: 'span',\n metadata: 'div',\n content: 'div',\n primaryText: 'span',\n secondaryText: 'span',\n tertiaryText: 'span',\n icon: 'span',\n detailsButton: Button\n },\n root: slot.always(getNativeElementProps('div', {\n ref,\n id: referenceId,\n ...groupSemantics,\n ...props\n }), {\n elementType: 'div'\n }),\n citation: slot.optional(props.citation, {\n defaultProps: {\n children: /*#__PURE__*/React.createElement(Citation, {\n block: true,\n referenceId: referenceId,\n ...citationProps\n }, index)\n },\n renderByDefault: true,\n elementType: 'div'\n }),\n media,\n actions: slot.optional(layout === 'inline' ? props.actions : null, {\n renderByDefault: true,\n elementType: 'div'\n }),\n label,\n sensitivity: slot.optional(props.sensitivity, {\n elementType: 'span'\n }),\n sensitivityLabel: slot.optional(props.sensitivityLabel, {\n elementType: 'span'\n }),\n metadata: slot.always(props.metadata, {\n elementType: 'div'\n }),\n primaryText: slot.optional(props.primaryText, {\n defaultProps: {\n hidden: !isExpanded\n },\n elementType: 'span'\n }),\n secondaryText: slot.optional(props.secondaryText, {\n defaultProps: {\n hidden: !isExpanded\n },\n elementType: 'span'\n }),\n tertiaryText: slot.optional(props.tertiaryText, {\n defaultProps: {\n hidden: !isExpanded\n },\n elementType: 'span'\n }),\n icon: slot.optional(props.icon, {\n elementType: 'span'\n }),\n content: slot.always(props.content, {\n defaultProps: {\n children: excerpt && /*#__PURE__*/React.createElement(Caption1, null, excerpt)\n },\n elementType: 'div'\n }),\n detailsButton: slot.optional(layout === 'inline' ? props.detailsButton : null, {\n defaultProps: {\n appearance: 'transparent',\n 'aria-expanded': isExpanded,\n 'aria-label': 'show details',\n size: mode === 'sidecar' ? 'small' : 'medium',\n icon: {\n children: getIcon(isExpanded, mode)\n }\n },\n renderByDefault: true,\n elementType: Button\n })\n };\n if (state.detailsButton) {\n const onClick = state.detailsButton.onClick;\n state.detailsButton.onClick = mergeCallbacks(onClick, onExpandClick);\n }\n const referenceGroupSetOpen = useReferenceGroupSetOpen();\n const onTargettedByCitation = e => {\n var _e_relatedTarget;\n const relatedTargetHash = (_e_relatedTarget = e.relatedTarget) === null || _e_relatedTarget === void 0 ? void 0 : _e_relatedTarget.hash;\n if (relatedTargetHash && relatedTargetHash.substring(1) === referenceId) {\n referenceGroupSetOpen();\n setIsExpanded(true);\n }\n };\n state.root.onFocus = mergeCallbacks(state.root.onFocus, onTargettedByCitation);\n return state;\n};\nconst getIcon = (isExpanded, mode) => {\n if (mode === 'sidecar') {\n return !isExpanded ? /*#__PURE__*/React.createElement(ChevronDown16Regular, null) : /*#__PURE__*/React.createElement(ChevronUp16Regular, null);\n }\n return !isExpanded ? /*#__PURE__*/React.createElement(ChevronDown24Regular, null) : /*#__PURE__*/React.createElement(ChevronUp24Regular, null);\n};\n//# sourceMappingURL=useReference.js.map"],"names":["useReference_unstable","props","ref","index","referenceId","citationHref","excerpt","layout","mode","useCopilotMode","labelId","useId","mediaId","isExpanded","setIsExpanded","React","useState","setPopoverOpen","usePopoverContext","context","setOpen","onExpandClick","_e","label","slot","always","defaultProps","id","elementType","media","optional","isValidElement","children","cloneElement","className","mergeClasses","referenceExtraClassNames","mediaChild","_label_ariadescribedby","_label_ariadescribedby_concat","concat","ariaLabelledByProp","groupSemantics","useMemo","role","tabIndex","citationProps","onPopoverCloseClick","e","preventDefault","referenceHref","onClick","state","components","root","citation","actions","sensitivity","sensitivityLabel","metadata","content","primaryText","secondaryText","tertiaryText","icon","detailsButton","Button","getNativeElementProps","createElement","Citation","block","renderByDefault","hidden","Caption1","appearance","size","getIcon","mergeCallbacks","referenceGroupSetOpen","useReferenceGroupSetOpen","onTargettedByCitation","_e_relatedTarget","relatedTargetHash","relatedTarget","hash","substring","onFocus","ChevronDown16Regular","ChevronUp16Regular","ChevronDown24Regular","ChevronUp24Regular"],"mappings":";;;;+BAgBaA;;;eAAAA;;;;iEAhBU;iCAC6H;4BACjD;oCAC1D;0BAChB;uCACgB;+BACV;AAUxB,MAAMA,wBAAwB,CAACC,OAAOC;IAC3C,MAAM,EACJC,KAAK,EACLC,WAAW,EACXC,YAAY,EACZC,OAAO,EACPC,SAAS,QAAQ,EAClB,GAAGN;IACJ,MAAMO,OAAOC,IAAAA,6BAAc,EAACR,MAAMO,IAAI;IACtC,MAAME,UAAUC,IAAAA,sBAAK;IACrB,MAAMC,UAAUD,IAAAA,sBAAK;IACrB,MAAM,CAACE,YAAYC,cAAc,GAAGC,OAAMC,QAAQ,CAACT,WAAW,YAAY,OAAO;IACjF,MAAMU,iBAAiBC,IAAAA,2CAAiB,EAACC,CAAAA,UAAWA,QAAQC,OAAO;IACnE,MAAMC,gBAAgBC,CAAAA;QACpBR,cAAc,CAACD;IACjB;IACA,MAAMU,QAA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AAC1B,SAAS9B;IACxD;IACA,MAAMyD,wBAAwBC,IAAAA,+CAAwB;IACtD,MAAMC,wBAAwBhC,CAAAA;QAC5B,IAAIiC;QACJ,MAAMC,oBAAoB,AAACD,CAAAA,mBAAmBjC,EAAEmC,aAAa,AAAD,MAAO,QAAQF,qBAAqB,KAAK,IAAI,KAAK,IAAIA,iBAAiBG,IAAI;QACvI,IAAIF,qBAAqBA,kBAAkBG,SAAS,CAAC,OAAOjF,aAAa;YACvE0E;YACAhE,cAAc;QAChB;IACF;IACAsC,MAAME,IAAI,CAACgC,OAAO,GAAGT,IAAAA,+BAAc,EAACzB,MAAME,IAAI,CAACgC,OAAO,EAAEN;IACxD,OAAO5B;AACT;AACA,MAAMwB,UAAU,CAAC/D,YAAYL;IAC3B,IAAIA,SAAS,WAAW;QACtB,OAAO,CAACK,aAAa,WAAW,GAAEE,OAAMqD,aAAa,CAACmB,gCAAoB,EAAE,QAAQ,WAAW,GAAExE,OAAMqD,aAAa,CAACoB,8BAAkB,EAAE;IAC3I;IACA,OAAO,CAAC3E,aAAa,WAAW,GAAEE,OAAMqD,aAAa,CAACqB,gCAAoB,EAAE,QAAQ,WAAW,GAAE1E,OAAMqD,aAAa,CAACsB,8BAAkB,EAAE;AAC3I,GACA,wCAAwC"}
|
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
referenceClassNames: function() {
|
|
13
|
+
return referenceClassNames;
|
|
14
|
+
},
|
|
15
|
+
referenceExtraClassNames: function() {
|
|
16
|
+
return referenceExtraClassNames;
|
|
17
|
+
},
|
|
18
|
+
useReferenceStyles_unstable: function() {
|
|
19
|
+
return useReferenceStyles_unstable;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const _reactcomponents = require("@fluentui/react-components");
|
|
23
|
+
const referenceClassNames = {
|
|
24
|
+
root: 'fai-Reference',
|
|
25
|
+
citation: 'fai-Reference__citation',
|
|
26
|
+
media: 'fai-Reference__media',
|
|
27
|
+
actions: 'fai-Reference__actions',
|
|
28
|
+
sensitivity: 'fai-Reference__sensitivity',
|
|
29
|
+
sensitivityLabel: 'fai-Reference__sensitivityLabel',
|
|
30
|
+
metadata: 'fai-Reference__metadata',
|
|
31
|
+
primaryText: 'fai-Reference__primaryText',
|
|
32
|
+
secondaryText: 'fai-Reference__secondaryText',
|
|
33
|
+
tertiaryText: 'fai-Reference__tertiaryText',
|
|
34
|
+
icon: 'fai-Reference__icon',
|
|
35
|
+
label: 'fai-Reference__label',
|
|
36
|
+
content: 'fai-Reference__content',
|
|
37
|
+
detailsButton: 'fai-Reference__detailsButton'
|
|
38
|
+
};
|
|
39
|
+
const referenceExtraClassNames = {
|
|
40
|
+
text: 'fai-Reference__text',
|
|
41
|
+
mediaChild: 'fai-Reference__mediaChild'
|
|
42
|
+
};
|
|
43
|
+
const labelFontSize = _reactcomponents.typographyStyles.caption1Strong.fontSize;
|
|
44
|
+
const labelLineHeight = _reactcomponents.typographyStyles.caption1Strong.lineHeight;
|
|
45
|
+
const maxPopoverWidth = '256px';
|
|
46
|
+
const useReferenceClassName = (0, _reactcomponents.__resetStyles)("r8mog99", null, [
|
|
47
|
+
".r8mog99{box-sizing:border-box;width:100%;display:grid;grid-template-areas:\"citation media title actions\" \". . title .\" \"sensitivityLabel sensitivityLabel sensitivityLabel sensitivityLabel\" \"metadata metadata metadata metadata\" \"content content content content\";grid-template-columns:min-content min-content 1fr min-content;grid-template-rows:32px auto auto auto auto;border:var(--strokeWidthThin) solid var(--colorNeutralStroke1);border-radius:var(--borderRadiusMedium);padding:var(--spacingVerticalS) var(--spacingHorizontalS);box-shadow:none;column-gap:var(--spacingHorizontalXS);align-items:center;}"
|
|
48
|
+
]);
|
|
49
|
+
const useStyles = (0, _reactcomponents.__styles)({
|
|
50
|
+
canvas: {},
|
|
51
|
+
sidecar: {
|
|
52
|
+
wkccdc: "f2e0fxj",
|
|
53
|
+
z8tnut: "f1ywm7hm",
|
|
54
|
+
z189sj: [
|
|
55
|
+
"f1vdfbxk",
|
|
56
|
+
"f1f5gg8d"
|
|
57
|
+
],
|
|
58
|
+
Byoj8tv: "f14wxoun",
|
|
59
|
+
uwmqm3: [
|
|
60
|
+
"f1f5gg8d",
|
|
61
|
+
"f1vdfbxk"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
inline: {},
|
|
65
|
+
popover: {
|
|
66
|
+
B4j52fo: "f1pit55b",
|
|
67
|
+
Bekrc4i: [
|
|
68
|
+
"f1orqat1",
|
|
69
|
+
"ffbvwxd"
|
|
70
|
+
],
|
|
71
|
+
Bn0qgzm: "f136mcbi",
|
|
72
|
+
ibv6hh: [
|
|
73
|
+
"ffbvwxd",
|
|
74
|
+
"f1orqat1"
|
|
75
|
+
],
|
|
76
|
+
a9b677: "f1uniyfe",
|
|
77
|
+
z8tnut: "f1nbblvp",
|
|
78
|
+
z189sj: [
|
|
79
|
+
"fifp7yv",
|
|
80
|
+
"f1asdtw4"
|
|
81
|
+
],
|
|
82
|
+
Byoj8tv: "f1ov4xf1",
|
|
83
|
+
uwmqm3: [
|
|
84
|
+
"f1asdtw4",
|
|
85
|
+
"fifp7yv"
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
closed: {
|
|
89
|
+
Belr9w4: "f1sff6ri"
|
|
90
|
+
},
|
|
91
|
+
citation: {
|
|
92
|
+
Ijaq50: "fwllpr6",
|
|
93
|
+
Br312pm: "fx0qcsv",
|
|
94
|
+
nk6f5a: "f1ldxewp",
|
|
95
|
+
Bw0ie65: "ftmncab"
|
|
96
|
+
},
|
|
97
|
+
media: {
|
|
98
|
+
Ijaq50: "f11uok23",
|
|
99
|
+
Br312pm: "f1qdfnnj",
|
|
100
|
+
nk6f5a: "f1s27gz",
|
|
101
|
+
Bw0ie65: "f86d0yl",
|
|
102
|
+
mc9l5x: "f22iagw",
|
|
103
|
+
Bt984gj: "f122n59",
|
|
104
|
+
Brf1p80: "f4d9j23"
|
|
105
|
+
},
|
|
106
|
+
mediaPopover: {
|
|
107
|
+
a9b677: "fjw5fx7",
|
|
108
|
+
Bqenvij: "fd461yt",
|
|
109
|
+
psn4ub: "fe9dio4",
|
|
110
|
+
vf399t: "f1ojxjpn"
|
|
111
|
+
},
|
|
112
|
+
actions: {
|
|
113
|
+
Ijaq50: "f16hsg94",
|
|
114
|
+
Br312pm: "f35n22n",
|
|
115
|
+
nk6f5a: "fh3uimt",
|
|
116
|
+
Bw0ie65: "fnh4yke",
|
|
117
|
+
Bdqf98w: "f1a7i8kp",
|
|
118
|
+
mc9l5x: "f22iagw"
|
|
119
|
+
},
|
|
120
|
+
detailsButton: {
|
|
121
|
+
D5xksd: "fzmnlw3"
|
|
122
|
+
},
|
|
123
|
+
sensitivity: {
|
|
124
|
+
Ijaq50: "fpymh5q",
|
|
125
|
+
Br312pm: "fjieyc3",
|
|
126
|
+
nk6f5a: "f18utan",
|
|
127
|
+
Bw0ie65: "f15c84mf",
|
|
128
|
+
Bdqf98w: "fsxvdwy"
|
|
129
|
+
},
|
|
130
|
+
sensitivityLabel: {
|
|
131
|
+
B6of3ja: "fww94b8",
|
|
132
|
+
De3pzq: "f3vzo32",
|
|
133
|
+
B4j52fo: "f192inf7",
|
|
134
|
+
Bekrc4i: [
|
|
135
|
+
"f5tn483",
|
|
136
|
+
"f1ojsxk5"
|
|
137
|
+
],
|
|
138
|
+
Bn0qgzm: "f1vxd6vx",
|
|
139
|
+
ibv6hh: [
|
|
140
|
+
"f1ojsxk5",
|
|
141
|
+
"f5tn483"
|
|
142
|
+
],
|
|
143
|
+
icvyot: "fzkkow9",
|
|
144
|
+
vrafjx: [
|
|
145
|
+
"fcdblym",
|
|
146
|
+
"fjik90z"
|
|
147
|
+
],
|
|
148
|
+
oivjwe: "fg706s2",
|
|
149
|
+
wvpqe5: [
|
|
150
|
+
"fjik90z",
|
|
151
|
+
"fcdblym"
|
|
152
|
+
],
|
|
153
|
+
g2u3we: "fghlq4f",
|
|
154
|
+
h3c5rm: [
|
|
155
|
+
"f1gn591s",
|
|
156
|
+
"fjscplz"
|
|
157
|
+
],
|
|
158
|
+
B9xav0g: "fb073pr",
|
|
159
|
+
zhjwy3: [
|
|
160
|
+
"fjscplz",
|
|
161
|
+
"f1gn591s"
|
|
162
|
+
],
|
|
163
|
+
Bbmb7ep: [
|
|
164
|
+
"f1aa9q02",
|
|
165
|
+
"f16jpd5f"
|
|
166
|
+
],
|
|
167
|
+
Beyfa6y: [
|
|
168
|
+
"f16jpd5f",
|
|
169
|
+
"f1aa9q02"
|
|
170
|
+
],
|
|
171
|
+
B7oj6ja: [
|
|
172
|
+
"f1jar5jt",
|
|
173
|
+
"fyu767a"
|
|
174
|
+
],
|
|
175
|
+
Btl43ni: [
|
|
176
|
+
"fyu767a",
|
|
177
|
+
"f1jar5jt"
|
|
178
|
+
],
|
|
179
|
+
Ijaq50: "fpymh5q",
|
|
180
|
+
Br312pm: "fjieyc3",
|
|
181
|
+
nk6f5a: "f18utan",
|
|
182
|
+
Bw0ie65: "f15c84mf",
|
|
183
|
+
Bdqf98w: "fsxvdwy",
|
|
184
|
+
z8tnut: "f1g0x7ka",
|
|
185
|
+
z189sj: [
|
|
186
|
+
"fdw0yi8",
|
|
187
|
+
"fk8j09s"
|
|
188
|
+
],
|
|
189
|
+
Byoj8tv: "f1qch9an",
|
|
190
|
+
uwmqm3: [
|
|
191
|
+
"fk8j09s",
|
|
192
|
+
"fdw0yi8"
|
|
193
|
+
],
|
|
194
|
+
Bahqtrf: "fk6fouc",
|
|
195
|
+
Be2twd7: "f13mqy1h",
|
|
196
|
+
Bhrd7zp: "figsok6",
|
|
197
|
+
Bg96gwp: "fcpl73t"
|
|
198
|
+
},
|
|
199
|
+
metadata: {
|
|
200
|
+
B6of3ja: "fww94b8",
|
|
201
|
+
Ijaq50: "f1md2vp3",
|
|
202
|
+
Br312pm: "f1y0qc5c",
|
|
203
|
+
nk6f5a: "f179ty8e",
|
|
204
|
+
Bw0ie65: "f83o9dc",
|
|
205
|
+
Bahqtrf: "fk6fouc",
|
|
206
|
+
Be2twd7: "f13mqy1h",
|
|
207
|
+
Bhrd7zp: "figsok6",
|
|
208
|
+
Bg96gwp: "fcpl73t"
|
|
209
|
+
},
|
|
210
|
+
metadataSubsequentText: {
|
|
211
|
+
qhf8xq: "f10pi13n",
|
|
212
|
+
Frg6f3: [
|
|
213
|
+
"foyynoy",
|
|
214
|
+
"f1vcna3q"
|
|
215
|
+
],
|
|
216
|
+
Ftih45: "f1wl9k8s",
|
|
217
|
+
Br0sdwz: "f1aocrix",
|
|
218
|
+
Brfgrao: "f1j7ml58",
|
|
219
|
+
Fbdkly: [
|
|
220
|
+
"f1s1fjay",
|
|
221
|
+
"f15a459s"
|
|
222
|
+
],
|
|
223
|
+
Bciustq: "f1wl9tmt",
|
|
224
|
+
Baz25je: "f8pn7wt",
|
|
225
|
+
uvfttm: [
|
|
226
|
+
"f1x8pvcy",
|
|
227
|
+
"f9sc749"
|
|
228
|
+
],
|
|
229
|
+
Bbv0w2i: [
|
|
230
|
+
"f1jpmc5p",
|
|
231
|
+
"f1yq6w5o"
|
|
232
|
+
],
|
|
233
|
+
Bm6vgfq: [
|
|
234
|
+
"fjml6kk",
|
|
235
|
+
"f1geml7w"
|
|
236
|
+
]
|
|
237
|
+
},
|
|
238
|
+
icon: {
|
|
239
|
+
Bahqtrf: "fk6fouc",
|
|
240
|
+
Be2twd7: "f13mqy1h",
|
|
241
|
+
Bhrd7zp: "figsok6",
|
|
242
|
+
Bg96gwp: "fcpl73t",
|
|
243
|
+
ha4doy: "fmrv4ls"
|
|
244
|
+
},
|
|
245
|
+
content: {
|
|
246
|
+
B6of3ja: "fww94b8",
|
|
247
|
+
Ijaq50: "fxwmwwq",
|
|
248
|
+
Br312pm: "f1e0gndy",
|
|
249
|
+
nk6f5a: "f4zz6gv",
|
|
250
|
+
Bw0ie65: "f7idnck",
|
|
251
|
+
mc9l5x: "f22iagw",
|
|
252
|
+
Beiy3e4: "f1vx9l62",
|
|
253
|
+
Belr9w4: "f1wn3y0l",
|
|
254
|
+
sj55zd: "f11d4kpn",
|
|
255
|
+
Biipf1f: "f9ijwd5"
|
|
256
|
+
},
|
|
257
|
+
hidden: {
|
|
258
|
+
mc9l5x: "fjseox"
|
|
259
|
+
}
|
|
260
|
+
}, {
|
|
261
|
+
d: [
|
|
262
|
+
".f2e0fxj{grid-template-rows:24px auto auto auto;}",
|
|
263
|
+
".f1ywm7hm{padding-top:var(--spacingVerticalXS);}",
|
|
264
|
+
".f1vdfbxk{padding-right:var(--spacingHorizontalS);}",
|
|
265
|
+
".f1f5gg8d{padding-left:var(--spacingHorizontalS);}",
|
|
266
|
+
".f14wxoun{padding-bottom:var(--spacingVerticalXS);}",
|
|
267
|
+
".f1pit55b{border-top-width:0px;}",
|
|
268
|
+
".f1orqat1{border-right-width:0px;}",
|
|
269
|
+
".ffbvwxd{border-left-width:0px;}",
|
|
270
|
+
".f136mcbi{border-bottom-width:0px;}",
|
|
271
|
+
".f1uniyfe{width:calc(256px - (var(--spacingHorizontalM) * 2));}",
|
|
272
|
+
".f1nbblvp{padding-top:0px;}",
|
|
273
|
+
".fifp7yv{padding-right:0px;}",
|
|
274
|
+
".f1asdtw4{padding-left:0px;}",
|
|
275
|
+
".f1ov4xf1{padding-bottom:0px;}",
|
|
276
|
+
".f1sff6ri{row-gap:0;}",
|
|
277
|
+
".fwllpr6{grid-row-start:citation;}",
|
|
278
|
+
".fx0qcsv{grid-column-start:citation;}",
|
|
279
|
+
".f1ldxewp{grid-row-end:citation;}",
|
|
280
|
+
".ftmncab{grid-column-end:citation;}",
|
|
281
|
+
".f11uok23{grid-row-start:media;}",
|
|
282
|
+
".f1qdfnnj{grid-column-start:media;}",
|
|
283
|
+
".f1s27gz{grid-row-end:media;}",
|
|
284
|
+
".f86d0yl{grid-column-end:media;}",
|
|
285
|
+
".f22iagw{display:flex;}",
|
|
286
|
+
".f122n59{align-items:center;}",
|
|
287
|
+
".f4d9j23{justify-content:center;}",
|
|
288
|
+
".fjw5fx7{width:16px;}",
|
|
289
|
+
".fd461yt{height:16px;}",
|
|
290
|
+
".fe9dio4>.fai-Reference__mediaChild{width:16px;}",
|
|
291
|
+
".f1ojxjpn>.fai-Reference__mediaChild{height:16px;}",
|
|
292
|
+
".f16hsg94{grid-row-start:1;}",
|
|
293
|
+
".f35n22n{grid-column-start:actions;}",
|
|
294
|
+
".fh3uimt{grid-row-end:actions;}",
|
|
295
|
+
".fnh4yke{grid-column-end:actions;}",
|
|
296
|
+
".f1a7i8kp{justify-self:end;}",
|
|
297
|
+
".fzmnlw3>fui-Button__icon{color:var(--colorNeutralForeground3);}",
|
|
298
|
+
".fpymh5q{grid-row-start:sensitivityLabel;}",
|
|
299
|
+
".fjieyc3{grid-column-start:sensitivityLabel;}",
|
|
300
|
+
".f18utan{grid-row-end:sensitivityLabel;}",
|
|
301
|
+
".f15c84mf{grid-column-end:sensitivityLabel;}",
|
|
302
|
+
".fsxvdwy{justify-self:start;}",
|
|
303
|
+
".fww94b8{margin-top:var(--spacingVerticalXS);}",
|
|
304
|
+
".f3vzo32{background-color:var(--colorNeutralBackground5);}",
|
|
305
|
+
".f192inf7{border-top-width:var(--strokeWidthThin);}",
|
|
306
|
+
".f5tn483{border-right-width:var(--strokeWidthThin);}",
|
|
307
|
+
".f1ojsxk5{border-left-width:var(--strokeWidthThin);}",
|
|
308
|
+
".f1vxd6vx{border-bottom-width:var(--strokeWidthThin);}",
|
|
309
|
+
".fzkkow9{border-top-style:solid;}",
|
|
310
|
+
".fcdblym{border-right-style:solid;}",
|
|
311
|
+
".fjik90z{border-left-style:solid;}",
|
|
312
|
+
".fg706s2{border-bottom-style:solid;}",
|
|
313
|
+
".fghlq4f{border-top-color:var(--colorTransparentStroke);}",
|
|
314
|
+
".f1gn591s{border-right-color:var(--colorTransparentStroke);}",
|
|
315
|
+
".fjscplz{border-left-color:var(--colorTransparentStroke);}",
|
|
316
|
+
".fb073pr{border-bottom-color:var(--colorTransparentStroke);}",
|
|
317
|
+
".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}",
|
|
318
|
+
".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}",
|
|
319
|
+
".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}",
|
|
320
|
+
".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}",
|
|
321
|
+
".f1g0x7ka{padding-top:0;}",
|
|
322
|
+
".fdw0yi8{padding-right:var(--spacingHorizontalSNudge);}",
|
|
323
|
+
".fk8j09s{padding-left:var(--spacingHorizontalSNudge);}",
|
|
324
|
+
".f1qch9an{padding-bottom:0;}",
|
|
325
|
+
".fk6fouc{font-family:var(--fontFamilyBase);}",
|
|
326
|
+
".f13mqy1h{font-size:var(--fontSizeBase100);}",
|
|
327
|
+
".figsok6{font-weight:var(--fontWeightRegular);}",
|
|
328
|
+
".fcpl73t{line-height:var(--lineHeightBase100);}",
|
|
329
|
+
".f1md2vp3{grid-row-start:metadata;}",
|
|
330
|
+
".f1y0qc5c{grid-column-start:metadata;}",
|
|
331
|
+
".f179ty8e{grid-row-end:metadata;}",
|
|
332
|
+
".f83o9dc{grid-column-end:metadata;}",
|
|
333
|
+
".f10pi13n{position:relative;}",
|
|
334
|
+
".foyynoy{margin-left:var(--spacingHorizontalS);}",
|
|
335
|
+
".f1vcna3q{margin-right:var(--spacingHorizontalS);}",
|
|
336
|
+
".f1wl9k8s::before{content:\"\";}",
|
|
337
|
+
".f1aocrix::before{display:block;}",
|
|
338
|
+
".f1j7ml58::before{position:absolute;}",
|
|
339
|
+
".f1s1fjay::before{left:calc(var(--spacingHorizontalS) / -2);}",
|
|
340
|
+
".f15a459s::before{right:calc(var(--spacingHorizontalS) / -2);}",
|
|
341
|
+
".f1wl9tmt::before{top:calc((var(--lineHeightBase100) - var(--fontSizeBase100)) / 2);}",
|
|
342
|
+
".f8pn7wt::before{height:var(--fontSizeBase100);}",
|
|
343
|
+
".f1x8pvcy::before{border-left-width:var(--strokeWidthThin);}",
|
|
344
|
+
".f9sc749::before{border-right-width:var(--strokeWidthThin);}",
|
|
345
|
+
".f1jpmc5p::before{border-left-style:solid;}",
|
|
346
|
+
".f1yq6w5o::before{border-right-style:solid;}",
|
|
347
|
+
".fjml6kk::before{border-left-color:var(--colorNeutralStroke2);}",
|
|
348
|
+
".f1geml7w::before{border-right-color:var(--colorNeutralStroke2);}",
|
|
349
|
+
".fmrv4ls{vertical-align:middle;}",
|
|
350
|
+
".fxwmwwq{grid-row-start:content;}",
|
|
351
|
+
".f1e0gndy{grid-column-start:content;}",
|
|
352
|
+
".f4zz6gv{grid-row-end:content;}",
|
|
353
|
+
".f7idnck{grid-column-end:content;}",
|
|
354
|
+
".f1vx9l62{flex-direction:column;}",
|
|
355
|
+
".f1wn3y0l{row-gap:var(--spacingVerticalS);}",
|
|
356
|
+
".f11d4kpn{color:var(--colorNeutralForeground3);}",
|
|
357
|
+
".f9ijwd5{word-break:break-word;}",
|
|
358
|
+
".fjseox{display:none;}"
|
|
359
|
+
]
|
|
360
|
+
});
|
|
361
|
+
const useLabelStyles = (0, _reactcomponents.__styles)({
|
|
362
|
+
root: {
|
|
363
|
+
Ijaq50: "faq1aip",
|
|
364
|
+
Br312pm: "f1m489tg",
|
|
365
|
+
nk6f5a: "fv2srd9",
|
|
366
|
+
Bw0ie65: "f1tz6hh8",
|
|
367
|
+
qb2dma: "f9h729m",
|
|
368
|
+
Bahqtrf: "fk6fouc",
|
|
369
|
+
Be2twd7: "fy9rknc",
|
|
370
|
+
Bhrd7zp: "fl43uef",
|
|
371
|
+
Bg96gwp: "fwrc4pm",
|
|
372
|
+
Biipf1f: "f9ijwd5",
|
|
373
|
+
Fd1uvx: "fpfc2by",
|
|
374
|
+
Bh9c35c: "f1lvsx7g",
|
|
375
|
+
mc9l5x: "f1rvi9lw",
|
|
376
|
+
Bmxbyg5: "f1sil6mw"
|
|
377
|
+
},
|
|
378
|
+
canvas: {
|
|
379
|
+
z8tnut: "f1vd4pcd"
|
|
380
|
+
},
|
|
381
|
+
sidecar: {
|
|
382
|
+
z8tnut: "f1u9e4k4"
|
|
383
|
+
},
|
|
384
|
+
closed: {
|
|
385
|
+
B2u0y6b: "f6dzj5z",
|
|
386
|
+
Bh9c35c: "fvvof4m"
|
|
387
|
+
}
|
|
388
|
+
}, {
|
|
389
|
+
d: [
|
|
390
|
+
".faq1aip{grid-row-start:title;}",
|
|
391
|
+
".f1m489tg{grid-column-start:title;}",
|
|
392
|
+
".fv2srd9{grid-row-end:title;}",
|
|
393
|
+
".f1tz6hh8{grid-column-end:title;}",
|
|
394
|
+
".f9h729m{align-self:start;}",
|
|
395
|
+
".fk6fouc{font-family:var(--fontFamilyBase);}",
|
|
396
|
+
".fy9rknc{font-size:var(--fontSizeBase200);}",
|
|
397
|
+
".fl43uef{font-weight:var(--fontWeightSemibold);}",
|
|
398
|
+
".fwrc4pm{line-height:var(--lineHeightBase200);}",
|
|
399
|
+
".f9ijwd5{word-break:break-word;}",
|
|
400
|
+
".fpfc2by{-webkit-box-orient:vertical;}",
|
|
401
|
+
".f1lvsx7g{-webkit-line-clamp:2;}",
|
|
402
|
+
".f1rvi9lw{display:-webkit-box;}",
|
|
403
|
+
".f1sil6mw{overflow-y:hidden;}",
|
|
404
|
+
".f1vd4pcd{padding-top:calc((24px / 2 ) - (var(--lineHeightBase200) - var(--fontSizeBase200)));}",
|
|
405
|
+
".f1u9e4k4{padding-top:calc((16px / 2 ) - (var(--lineHeightBase200) - var(--fontSizeBase200)));}",
|
|
406
|
+
".f6dzj5z{max-width:100%;}",
|
|
407
|
+
".fvvof4m{-webkit-line-clamp:1;}"
|
|
408
|
+
]
|
|
409
|
+
});
|
|
410
|
+
const useReferenceStyles_unstable = (state)=>{
|
|
411
|
+
const { isExpanded, mode, layout } = state;
|
|
412
|
+
const rootClassName = useReferenceClassName();
|
|
413
|
+
const styles = useStyles();
|
|
414
|
+
const labelStyles = useLabelStyles();
|
|
415
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.root, rootClassName, styles[mode], styles[layout], !isExpanded && styles.closed, state.root.className);
|
|
416
|
+
if (state.citation) {
|
|
417
|
+
state.citation.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.citation, styles.citation, state.citation.className);
|
|
418
|
+
}
|
|
419
|
+
if (state.media) {
|
|
420
|
+
state.media.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.media, styles.media, layout === 'popover' && styles.mediaPopover, state.media.className);
|
|
421
|
+
}
|
|
422
|
+
if (state.actions) {
|
|
423
|
+
state.actions.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.actions, styles.actions, state.actions.className);
|
|
424
|
+
}
|
|
425
|
+
state.label.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.label, labelStyles.root, labelStyles[mode], !isExpanded && labelStyles.closed, state.label.className);
|
|
426
|
+
if (state.sensitivity) {
|
|
427
|
+
state.sensitivity.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.sensitivity, styles.sensitivity, !isExpanded && styles.hidden, state.sensitivity.className);
|
|
428
|
+
}
|
|
429
|
+
if (state.sensitivityLabel) {
|
|
430
|
+
state.sensitivityLabel.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.sensitivityLabel, styles.sensitivityLabel, !isExpanded && styles.hidden, state.sensitivityLabel.className);
|
|
431
|
+
}
|
|
432
|
+
state.metadata.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.metadata, styles.metadata, !isExpanded && styles.hidden, state.metadata.className);
|
|
433
|
+
let isSubsequentText = false;
|
|
434
|
+
if (state.primaryText) {
|
|
435
|
+
state.primaryText.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.primaryText, referenceExtraClassNames.text, isSubsequentText && styles.metadataSubsequentText, state.primaryText.className);
|
|
436
|
+
isSubsequentText = true;
|
|
437
|
+
}
|
|
438
|
+
if (state.secondaryText) {
|
|
439
|
+
state.secondaryText.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.secondaryText, referenceExtraClassNames.text, isSubsequentText && styles.metadataSubsequentText, state.secondaryText.className);
|
|
440
|
+
isSubsequentText = true;
|
|
441
|
+
}
|
|
442
|
+
if (state.tertiaryText) {
|
|
443
|
+
state.tertiaryText.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.tertiaryText, referenceExtraClassNames.text, isSubsequentText && styles.metadataSubsequentText, state.tertiaryText.className);
|
|
444
|
+
isSubsequentText = true;
|
|
445
|
+
}
|
|
446
|
+
if (state.icon) {
|
|
447
|
+
state.icon.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.icon, styles.icon, state.icon.className);
|
|
448
|
+
}
|
|
449
|
+
state.content.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.content, styles.content, !isExpanded && styles.hidden, state.content.className);
|
|
450
|
+
if (state.detailsButton) {
|
|
451
|
+
state.detailsButton.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.detailsButton, styles.detailsButton, state.detailsButton.className);
|
|
452
|
+
}
|
|
453
|
+
return state;
|
|
454
|
+
}; //# sourceMappingURL=useReferenceStyles.js.map
|