@fluentui-copilot/react-reference 0.9.1 → 0.10.0
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 +21 -0
- package/CHANGELOG.md +11 -1
- package/dist/index.d.ts +40 -191
- package/lib/components/Citation/Citation.types.js.map +1 -1
- package/lib/components/Citation/renderCitation.js +3 -22
- package/lib/components/Citation/renderCitation.js.map +1 -1
- package/lib/components/Citation/useCitation.js +3 -157
- package/lib/components/Citation/useCitation.js.map +1 -1
- package/lib/components/Citation/useCitationStyles.js +1 -6
- package/lib/components/Citation/useCitationStyles.js.map +1 -1
- package/lib/components/Reference/Reference.types.js.map +1 -1
- package/lib/components/Reference/renderReference.js +1 -1
- package/lib/components/Reference/renderReference.js.map +1 -1
- package/lib/components/Reference/useReference.js +0 -5
- package/lib/components/Reference/useReference.js.map +1 -1
- package/lib/components/Reference/useReferenceStyles.js +1 -38
- package/lib/components/Reference/useReferenceStyles.js.map +1 -1
- package/lib/hooks/index.js +1 -2
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useReferenceCitationPreview.js +11 -12
- package/lib/hooks/useReferenceCitationPreview.js.map +1 -1
- package/lib/index.js +1 -2
- package/lib/index.js.map +1 -1
- package/lib-commonjs/components/Citation/renderCitation.js +1 -23
- package/lib-commonjs/components/Citation/renderCitation.js.map +1 -1
- package/lib-commonjs/components/Citation/useCitation.js +3 -155
- package/lib-commonjs/components/Citation/useCitation.js.map +1 -1
- package/lib-commonjs/components/Citation/useCitationStyles.js +1 -6
- package/lib-commonjs/components/Citation/useCitationStyles.js.map +1 -1
- package/lib-commonjs/components/Reference/renderReference.js +0 -1
- package/lib-commonjs/components/Reference/renderReference.js.map +1 -1
- package/lib-commonjs/components/Reference/useReference.js +0 -5
- package/lib-commonjs/components/Reference/useReference.js.map +1 -1
- package/lib-commonjs/components/Reference/useReferenceStyles.js +4 -98
- package/lib-commonjs/components/Reference/useReferenceStyles.js.map +1 -1
- package/lib-commonjs/hooks/index.js +1 -8
- package/lib-commonjs/hooks/index.js.map +1 -1
- package/lib-commonjs/hooks/useReferenceCitationPreview.js +10 -10
- package/lib-commonjs/hooks/useReferenceCitationPreview.js.map +1 -1
- package/lib-commonjs/index.js +0 -19
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +1 -1
- package/lib/ReferenceGroup.js +0 -2
- package/lib/ReferenceGroup.js.map +0 -1
- package/lib/components/ReferenceGroup/ReferenceGroup.js +0 -19
- package/lib/components/ReferenceGroup/ReferenceGroup.js.map +0 -1
- package/lib/components/ReferenceGroup/ReferenceGroup.types.js +0 -2
- package/lib/components/ReferenceGroup/ReferenceGroup.types.js.map +0 -1
- package/lib/components/ReferenceGroup/index.js +0 -6
- package/lib/components/ReferenceGroup/index.js.map +0 -1
- package/lib/components/ReferenceGroup/renderReferenceGroup.js +0 -21
- package/lib/components/ReferenceGroup/renderReferenceGroup.js.map +0 -1
- package/lib/components/ReferenceGroup/useReferenceGroup.js +0 -104
- package/lib/components/ReferenceGroup/useReferenceGroup.js.map +0 -1
- package/lib/components/ReferenceGroup/useReferenceGroupContextValues.js +0 -10
- package/lib/components/ReferenceGroup/useReferenceGroupContextValues.js.map +0 -1
- package/lib/components/ReferenceGroup/useReferenceGroupStyles.js +0 -50
- package/lib/components/ReferenceGroup/useReferenceGroupStyles.js.map +0 -1
- package/lib/hooks/useReferenceCitation.js +0 -77
- package/lib/hooks/useReferenceCitation.js.map +0 -1
- package/lib-commonjs/ReferenceGroup.js +0 -7
- package/lib-commonjs/ReferenceGroup.js.map +0 -1
- package/lib-commonjs/components/ReferenceGroup/ReferenceGroup.js +0 -25
- package/lib-commonjs/components/ReferenceGroup/ReferenceGroup.js.map +0 -1
- package/lib-commonjs/components/ReferenceGroup/ReferenceGroup.types.js +0 -5
- package/lib-commonjs/components/ReferenceGroup/ReferenceGroup.types.js.map +0 -1
- package/lib-commonjs/components/ReferenceGroup/index.js +0 -11
- package/lib-commonjs/components/ReferenceGroup/index.js.map +0 -1
- package/lib-commonjs/components/ReferenceGroup/renderReferenceGroup.js +0 -33
- package/lib-commonjs/components/ReferenceGroup/renderReferenceGroup.js.map +0 -1
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroup.js +0 -103
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroup.js.map +0 -1
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroupContextValues.js +0 -23
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroupContextValues.js.map +0 -1
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroupStyles.js +0 -75
- package/lib-commonjs/components/ReferenceGroup/useReferenceGroupStyles.js.map +0 -1
- package/lib-commonjs/hooks/useReferenceCitation.js +0 -78
- package/lib-commonjs/hooks/useReferenceCitation.js.map +0 -1
|
@@ -10,29 +10,7 @@ Object.defineProperty(exports, "renderCitation_unstable", {
|
|
|
10
10
|
});
|
|
11
11
|
const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
|
12
12
|
const _reactcomponents = require("@fluentui/react-components");
|
|
13
|
-
const popoverPositioning = {
|
|
14
|
-
overflowBoundaryPadding: 4,
|
|
15
|
-
position: 'below'
|
|
16
|
-
};
|
|
17
13
|
const renderCitation_unstable = (state)=>{
|
|
18
14
|
(0, _reactcomponents.assertSlots)(state);
|
|
19
|
-
return
|
|
20
|
-
closeOnScroll: true,
|
|
21
|
-
onOpenChange: state.onPopoverOpenChange,
|
|
22
|
-
open: state.isPopoverOpen,
|
|
23
|
-
positioning: popoverPositioning,
|
|
24
|
-
size: "small",
|
|
25
|
-
trapFocus: true,
|
|
26
|
-
unstable_disableAutoFocus: state.disableAutoFocus,
|
|
27
|
-
withArrow: true,
|
|
28
|
-
children: [
|
|
29
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_reactcomponents.PopoverTrigger, {
|
|
30
|
-
disableButtonEnhancement: true,
|
|
31
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {})
|
|
32
|
-
}),
|
|
33
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(state.popoverSurface, {
|
|
34
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.popover, {})
|
|
35
|
-
})
|
|
36
|
-
]
|
|
37
|
-
}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {});
|
|
15
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {});
|
|
38
16
|
}; //# sourceMappingURL=renderCitation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderCitation.js"],"sourcesContent":["import { jsx as _jsx
|
|
1
|
+
{"version":3,"sources":["renderCitation.js"],"sourcesContent":["import { jsx as _jsx } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-components';\n/**\n * Render the final JSX of Citation\n */\nexport const renderCitation_unstable = state => {\n assertSlots(state);\n return /*#__PURE__*/_jsx(state.root, {});\n};\n//# sourceMappingURL=renderCitation.js.map"],"names":["renderCitation_unstable","state","assertSlots","_jsx","root"],"mappings":";;;;+BAKaA;;;eAAAA;;;4BALe;iCACA;AAIrB,MAAMA,0BAA0BC,CAAAA;IACrCC,IAAAA,4BAAW,EAACD;IACZ,OAAO,WAAW,GAAEE,IAAAA,eAAI,EAACF,MAAMG,IAAI,EAAE,CAAC;AACxC,GACA,0CAA0C"}
|
|
@@ -8,146 +8,16 @@ Object.defineProperty(exports, "useCitation_unstable", {
|
|
|
8
8
|
return useCitation_unstable;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
|
-
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
11
|
const _reactcomponents = require("@fluentui/react-components");
|
|
14
|
-
const _keyboardkeys = require("@fluentui/keyboard-keys");
|
|
15
|
-
const _reactutilities = require("@fluentui/react-utilities");
|
|
16
12
|
const _reactpreview = require("@fluentui-copilot/react-preview");
|
|
17
|
-
const POPOVER_MOUSE_HIDE_DELAY = 500;
|
|
18
|
-
const POPOVER_KEYBOARD_HIDE_DELAY = 0;
|
|
19
|
-
const getDelay = (type)=>{
|
|
20
|
-
if (type === 'focus' || type === 'blur') {
|
|
21
|
-
return POPOVER_KEYBOARD_HIDE_DELAY;
|
|
22
|
-
}
|
|
23
|
-
return POPOVER_MOUSE_HIDE_DELAY;
|
|
24
|
-
};
|
|
25
13
|
const useCitation_unstable = (props, ref)=>{
|
|
26
|
-
const {
|
|
27
|
-
const
|
|
28
|
-
const [setTimeout, clearTimeout] = (0, _reactutilities.useTimeout)();
|
|
29
|
-
const popoverId = (0, _reactcomponents.useId)('citation-popover-');
|
|
30
|
-
const [disableAutoFocus, setDisableAutoFocus] = _react.useState(true);
|
|
31
|
-
const { current: citationInternalState } = _react.useRef({
|
|
32
|
-
openByClick: false,
|
|
33
|
-
openByHoverOverCitation: false,
|
|
34
|
-
openByHoverOverPopover: false,
|
|
35
|
-
openByKeyboard: false
|
|
36
|
-
});
|
|
37
|
-
const isOpen = ()=>{
|
|
38
|
-
return citationInternalState.openByClick || citationInternalState.openByHoverOverCitation || citationInternalState.openByHoverOverPopover || citationInternalState.openByKeyboard;
|
|
39
|
-
};
|
|
40
|
-
const [isPopoverOpen, setIsPopoverOpen] = _react.useState(false);
|
|
41
|
-
const preventDefaultClose = _react.useRef(false);
|
|
42
|
-
const handleCitationTargetEnter = (e)=>{
|
|
43
|
-
citationInternalState.openByHoverOverCitation = true;
|
|
44
|
-
// We want to disable auto focus only if the popover is being opened by hovering over the citation
|
|
45
|
-
if (!citationInternalState.openByClick && !citationInternalState.openByKeyboard) {
|
|
46
|
-
setDisableAutoFocus(true);
|
|
47
|
-
}
|
|
48
|
-
setIsPopoverOpen(isOpen());
|
|
49
|
-
};
|
|
50
|
-
const handleCitationTargetLeave = (e)=>{
|
|
51
|
-
citationInternalState.openByHoverOverCitation = false;
|
|
52
|
-
setTimeout(()=>{
|
|
53
|
-
setIsPopoverOpen(isOpen());
|
|
54
|
-
}, getDelay(e.type));
|
|
55
|
-
};
|
|
56
|
-
const handleCitationClick = (e)=>{
|
|
57
|
-
// Setting preventDefaultClose so that onPopoverOpenChange does not apply its logic when click is on the citation as we want to control that behavior.
|
|
58
|
-
preventDefaultClose.current = true;
|
|
59
|
-
// We set disableAutoFocus to false so that interactive elements within popover can be focused when it opens via click.
|
|
60
|
-
setDisableAutoFocus(false);
|
|
61
|
-
// If openByKeyboard is true, then the popover was already opened via keyboard and we always want to close it.
|
|
62
|
-
citationInternalState.openByClick = citationInternalState.openByKeyboard ? false : !citationInternalState.openByClick;
|
|
63
|
-
citationInternalState.openByHoverOverCitation = false;
|
|
64
|
-
citationInternalState.openByHoverOverPopover = false;
|
|
65
|
-
citationInternalState.openByKeyboard = false;
|
|
66
|
-
setIsPopoverOpen(isOpen());
|
|
67
|
-
};
|
|
68
|
-
const handleCitationKeyDown = (e)=>{
|
|
69
|
-
if (e.key === _keyboardkeys.Enter) {
|
|
70
|
-
clearTimeout();
|
|
71
|
-
// Setting default prevented so the enter key does not trigger a click event or onPopoverOpenChange.
|
|
72
|
-
e.preventDefault();
|
|
73
|
-
// We set disableAutoFocus to false so that interactive elements within popover can be focused when it opens via keyboard.
|
|
74
|
-
setDisableAutoFocus(false);
|
|
75
|
-
// If openByClick is true, then the popover was already opened via click and we always want to close it.
|
|
76
|
-
citationInternalState.openByKeyboard = citationInternalState.openByClick ? false : !citationInternalState.openByKeyboard;
|
|
77
|
-
citationInternalState.openByClick = false;
|
|
78
|
-
citationInternalState.openByHoverOverCitation = false;
|
|
79
|
-
citationInternalState.openByHoverOverPopover = false;
|
|
80
|
-
setIsPopoverOpen(isOpen());
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
const handlePopoverTargetEnter = (e)=>{
|
|
84
|
-
citationInternalState.openByHoverOverPopover = true;
|
|
85
|
-
setIsPopoverOpen(isOpen());
|
|
86
|
-
};
|
|
87
|
-
const handlePopoverTargetLeave = (e)=>{
|
|
88
|
-
citationInternalState.openByHoverOverPopover = false;
|
|
89
|
-
setTimeout(()=>{
|
|
90
|
-
setIsPopoverOpen(isOpen());
|
|
91
|
-
}, getDelay(e.type));
|
|
92
|
-
};
|
|
93
|
-
const onPopoverOpenChange = (e, data)=>{
|
|
94
|
-
if (!data.open) {
|
|
95
|
-
// We set all open state to false if preventDefaultClose was not set to true
|
|
96
|
-
if (!preventDefaultClose.current) {
|
|
97
|
-
clearTimeout();
|
|
98
|
-
citationInternalState.openByClick = false;
|
|
99
|
-
citationInternalState.openByHoverOverCitation = false;
|
|
100
|
-
citationInternalState.openByHoverOverPopover = false;
|
|
101
|
-
citationInternalState.openByKeyboard = false;
|
|
102
|
-
// use isOpen if managing owned popover, otherwise use data.open
|
|
103
|
-
const open = popover ? isOpen() : data.open;
|
|
104
|
-
setIsPopoverOpen(open);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
preventDefaultClose.current = false;
|
|
108
|
-
};
|
|
109
|
-
// hitting escape should close the popover if it was opened by hover
|
|
110
|
-
// this is necessary to attach to the document because focus is likely not within the citation or popover
|
|
111
|
-
(0, _reactcomponents.useIsomorphicLayoutEffect)(()=>{
|
|
112
|
-
if (isPopoverOpen) {
|
|
113
|
-
const onDocumentKeyDown = (e)=>{
|
|
114
|
-
const openedByHover = !citationInternalState.openByClick && !citationInternalState.openByKeyboard;
|
|
115
|
-
if (openedByHover && e.key === _keyboardkeys.Escape) {
|
|
116
|
-
clearTimeout();
|
|
117
|
-
// We set state back to its default if the Escape key has been pressed
|
|
118
|
-
setDisableAutoFocus(true);
|
|
119
|
-
citationInternalState.openByClick = false;
|
|
120
|
-
citationInternalState.openByHoverOverCitation = false;
|
|
121
|
-
citationInternalState.openByHoverOverPopover = false;
|
|
122
|
-
citationInternalState.openByKeyboard = false;
|
|
123
|
-
setIsPopoverOpen(isOpen());
|
|
124
|
-
e.stopPropagation();
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.addEventListener('keydown', onDocumentKeyDown, {
|
|
128
|
-
capture: true
|
|
129
|
-
});
|
|
130
|
-
return ()=>{
|
|
131
|
-
targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.removeEventListener('keydown', onDocumentKeyDown, {
|
|
132
|
-
capture: true
|
|
133
|
-
});
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
}, [
|
|
137
|
-
targetDocument,
|
|
138
|
-
isPopoverOpen
|
|
139
|
-
]);
|
|
140
|
-
const isPopoverLocked = (0, _reactpreview.usePreviewContext_unstable)((ctx)=>ctx.isPreviewLocked) && props['aria-expanded'] || citationInternalState.openByClick || citationInternalState.openByKeyboard;
|
|
14
|
+
const { referenceHref, block = false, ...otherProps } = props;
|
|
15
|
+
const isPopoverLocked = (0, _reactpreview.usePreviewContext_unstable)((ctx)=>ctx.isPreviewLocked) && props['aria-expanded'];
|
|
141
16
|
const state = {
|
|
142
17
|
block,
|
|
143
|
-
disableAutoFocus,
|
|
144
|
-
isPopoverOpen,
|
|
145
18
|
isPopoverLocked,
|
|
146
|
-
onPopoverOpenChange,
|
|
147
19
|
components: {
|
|
148
|
-
root: 'a'
|
|
149
|
-
popover: 'div',
|
|
150
|
-
popoverSurface: _reactcomponents.PopoverSurface
|
|
20
|
+
root: 'a'
|
|
151
21
|
},
|
|
152
22
|
root: _reactcomponents.slot.always((0, _reactcomponents.getNativeElementProps)('a', {
|
|
153
23
|
ref,
|
|
@@ -157,29 +27,7 @@ const useCitation_unstable = (props, ref)=>{
|
|
|
157
27
|
...otherProps
|
|
158
28
|
}), {
|
|
159
29
|
elementType: 'a'
|
|
160
|
-
}),
|
|
161
|
-
popover: _reactcomponents.slot.optional(popover, {
|
|
162
|
-
elementType: 'div'
|
|
163
|
-
}),
|
|
164
|
-
popoverSurface: _reactcomponents.slot.optional(popoverSurface, {
|
|
165
|
-
defaultProps: {
|
|
166
|
-
id: popoverId,
|
|
167
|
-
'aria-labelledby': popoverId
|
|
168
|
-
},
|
|
169
|
-
elementType: _reactcomponents.PopoverSurface,
|
|
170
|
-
renderByDefault: true
|
|
171
30
|
})
|
|
172
31
|
};
|
|
173
|
-
// attach popover handling events only if a popover is present
|
|
174
|
-
if (state.popover) {
|
|
175
|
-
state.root.onMouseEnter = (0, _reactcomponents.mergeCallbacks)(state.root.onMouseEnter, handleCitationTargetEnter);
|
|
176
|
-
state.root.onMouseLeave = (0, _reactcomponents.mergeCallbacks)(state.root.onMouseLeave, handleCitationTargetLeave);
|
|
177
|
-
state.root.onBlur = (0, _reactcomponents.mergeCallbacks)(state.root.onBlur, handleCitationTargetLeave);
|
|
178
|
-
state.root.onClick = (0, _reactcomponents.mergeCallbacks)(state.root.onClick, handleCitationClick);
|
|
179
|
-
state.root.onKeyDown = (0, _reactcomponents.mergeCallbacks)(state.root.onKeyDown, handleCitationKeyDown);
|
|
180
|
-
state.popover.onMouseEnter = (0, _reactcomponents.mergeCallbacks)(state.popover.onMouseEnter, handlePopoverTargetEnter);
|
|
181
|
-
state.popover.onMouseLeave = (0, _reactcomponents.mergeCallbacks)(state.popover.onMouseLeave, handlePopoverTargetLeave);
|
|
182
|
-
state.popover.onFocus = (0, _reactcomponents.mergeCallbacks)(state.popover.onFocus, handlePopoverTargetEnter);
|
|
183
|
-
}
|
|
184
32
|
return state;
|
|
185
33
|
}; //# sourceMappingURL=useCitation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useCitation.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, PopoverSurface, mergeCallbacks, slot, useFluent, useId, useIsomorphicLayoutEffect } from '@fluentui/react-components';\nimport { Enter, Escape } from '@fluentui/keyboard-keys';\nimport { useTimeout } from '@fluentui/react-utilities';\nimport { usePreviewContext_unstable } from '@fluentui-copilot/react-preview';\nconst POPOVER_MOUSE_HIDE_DELAY = 500;\nconst POPOVER_KEYBOARD_HIDE_DELAY = 0;\nconst getDelay = type => {\n if (type === 'focus' || type === 'blur') {\n return POPOVER_KEYBOARD_HIDE_DELAY;\n }\n return POPOVER_MOUSE_HIDE_DELAY;\n};\n/**\n * Create the state required to render Citation.\n *\n * The returned state can be modified with hooks such as useCitationStyles_unstable,\n * before being passed to renderCitation_unstable.\n *\n * @param props - props from this instance of Citation\n * @param ref - reference to root HTMLElement of Citation\n */\nexport const useCitation_unstable = (props, ref) => {\n const {\n popover,\n popoverSurface,\n referenceHref,\n block = false,\n ...otherProps\n } = props;\n const {\n targetDocument\n } = useFluent();\n const [setTimeout, clearTimeout] = useTimeout();\n const popoverId = useId('citation-popover-');\n const [disableAutoFocus, setDisableAutoFocus] = React.useState(true);\n const {\n current: citationInternalState\n } = React.useRef({\n openByClick: false,\n openByHoverOverCitation: false,\n openByHoverOverPopover: false,\n openByKeyboard: false\n });\n const isOpen = () => {\n return citationInternalState.openByClick || citationInternalState.openByHoverOverCitation || citationInternalState.openByHoverOverPopover || citationInternalState.openByKeyboard;\n };\n const [isPopoverOpen, setIsPopoverOpen] = React.useState(false);\n const preventDefaultClose = React.useRef(false);\n const handleCitationTargetEnter = e => {\n citationInternalState.openByHoverOverCitation = true;\n // We want to disable auto focus only if the popover is being opened by hovering over the citation\n if (!citationInternalState.openByClick && !citationInternalState.openByKeyboard) {\n setDisableAutoFocus(true);\n }\n setIsPopoverOpen(isOpen());\n };\n const handleCitationTargetLeave = e => {\n citationInternalState.openByHoverOverCitation = false;\n setTimeout(() => {\n setIsPopoverOpen(isOpen());\n }, getDelay(e.type));\n };\n const handleCitationClick = e => {\n // Setting preventDefaultClose so that onPopoverOpenChange does not apply its logic when click is on the citation as we want to control that behavior.\n preventDefaultClose.current = true;\n // We set disableAutoFocus to false so that interactive elements within popover can be focused when it opens via click.\n setDisableAutoFocus(false);\n // If openByKeyboard is true, then the popover was already opened via keyboard and we always want to close it.\n citationInternalState.openByClick = citationInternalState.openByKeyboard ? false : !citationInternalState.openByClick;\n citationInternalState.openByHoverOverCitation = false;\n citationInternalState.openByHoverOverPopover = false;\n citationInternalState.openByKeyboard = false;\n setIsPopoverOpen(isOpen());\n };\n const handleCitationKeyDown = e => {\n if (e.key === Enter) {\n clearTimeout();\n // Setting default prevented so the enter key does not trigger a click event or onPopoverOpenChange.\n e.preventDefault();\n // We set disableAutoFocus to false so that interactive elements within popover can be focused when it opens via keyboard.\n setDisableAutoFocus(false);\n // If openByClick is true, then the popover was already opened via click and we always want to close it.\n citationInternalState.openByKeyboard = citationInternalState.openByClick ? false : !citationInternalState.openByKeyboard;\n citationInternalState.openByClick = false;\n citationInternalState.openByHoverOverCitation = false;\n citationInternalState.openByHoverOverPopover = false;\n setIsPopoverOpen(isOpen());\n }\n };\n const handlePopoverTargetEnter = e => {\n citationInternalState.openByHoverOverPopover = true;\n setIsPopoverOpen(isOpen());\n };\n const handlePopoverTargetLeave = e => {\n citationInternalState.openByHoverOverPopover = false;\n setTimeout(() => {\n setIsPopoverOpen(isOpen());\n }, getDelay(e.type));\n };\n const onPopoverOpenChange = (e, data) => {\n if (!data.open) {\n // We set all open state to false if preventDefaultClose was not set to true\n if (!preventDefaultClose.current) {\n clearTimeout();\n citationInternalState.openByClick = false;\n citationInternalState.openByHoverOverCitation = false;\n citationInternalState.openByHoverOverPopover = false;\n citationInternalState.openByKeyboard = false;\n // use isOpen if managing owned popover, otherwise use data.open\n const open = popover ? isOpen() : data.open;\n setIsPopoverOpen(open);\n }\n }\n preventDefaultClose.current = false;\n };\n // hitting escape should close the popover if it was opened by hover\n // this is necessary to attach to the document because focus is likely not within the citation or popover\n useIsomorphicLayoutEffect(() => {\n if (isPopoverOpen) {\n const onDocumentKeyDown = e => {\n const openedByHover = !citationInternalState.openByClick && !citationInternalState.openByKeyboard;\n if (openedByHover && e.key === Escape) {\n clearTimeout();\n // We set state back to its default if the Escape key has been pressed\n setDisableAutoFocus(true);\n citationInternalState.openByClick = false;\n citationInternalState.openByHoverOverCitation = false;\n citationInternalState.openByHoverOverPopover = false;\n citationInternalState.openByKeyboard = false;\n setIsPopoverOpen(isOpen());\n e.stopPropagation();\n }\n };\n targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.addEventListener('keydown', onDocumentKeyDown, {\n capture: true\n });\n return () => {\n targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.removeEventListener('keydown', onDocumentKeyDown, {\n capture: true\n });\n };\n }\n }, [targetDocument, isPopoverOpen]);\n const isPopoverLocked = usePreviewContext_unstable(ctx => ctx.isPreviewLocked) && props['aria-expanded'] || citationInternalState.openByClick || citationInternalState.openByKeyboard;\n const state = {\n block,\n disableAutoFocus,\n isPopoverOpen,\n isPopoverLocked,\n onPopoverOpenChange,\n components: {\n root: 'a',\n popover: 'div',\n popoverSurface: PopoverSurface\n },\n root: slot.always(getNativeElementProps('a', {\n ref,\n href: referenceHref,\n role: null,\n 'aria-expanded': null,\n ...otherProps\n }), {\n elementType: 'a'\n }),\n popover: slot.optional(popover, {\n elementType: 'div'\n }),\n popoverSurface: slot.optional(popoverSurface, {\n defaultProps: {\n id: popoverId,\n 'aria-labelledby': popoverId\n },\n elementType: PopoverSurface,\n renderByDefault: true\n })\n };\n // attach popover handling events only if a popover is present\n if (state.popover) {\n state.root.onMouseEnter = mergeCallbacks(state.root.onMouseEnter, handleCitationTargetEnter);\n state.root.onMouseLeave = mergeCallbacks(state.root.onMouseLeave, handleCitationTargetLeave);\n state.root.onBlur = mergeCallbacks(state.root.onBlur, handleCitationTargetLeave);\n state.root.onClick = mergeCallbacks(state.root.onClick, handleCitationClick);\n state.root.onKeyDown = mergeCallbacks(state.root.onKeyDown, handleCitationKeyDown);\n state.popover.onMouseEnter = mergeCallbacks(state.popover.onMouseEnter, handlePopoverTargetEnter);\n state.popover.onMouseLeave = mergeCallbacks(state.popover.onMouseLeave, handlePopoverTargetLeave);\n state.popover.onFocus = mergeCallbacks(state.popover.onFocus, handlePopoverTargetEnter);\n }\n return state;\n};\n//# sourceMappingURL=useCitation.js.map"],"names":["useCitation_unstable","POPOVER_MOUSE_HIDE_DELAY","POPOVER_KEYBOARD_HIDE_DELAY","getDelay","type","props","ref","popover","popoverSurface","referenceHref","block","otherProps","targetDocument","useFluent","setTimeout","clearTimeout","useTimeout","popoverId","useId","disableAutoFocus","setDisableAutoFocus","React","useState","current","citationInternalState","useRef","openByClick","openByHoverOverCitation","openByHoverOverPopover","openByKeyboard","isOpen","isPopoverOpen","setIsPopoverOpen","preventDefaultClose","handleCitationTargetEnter","e","handleCitationTargetLeave","handleCitationClick","handleCitationKeyDown","key","Enter","preventDefault","handlePopoverTargetEnter","handlePopoverTargetLeave","onPopoverOpenChange","data","open","useIsomorphicLayoutEffect","onDocumentKeyDown","openedByHover","Escape","stopPropagation","addEventListener","capture","removeEventListener","isPopoverLocked","usePreviewContext_unstable","ctx","isPreviewLocked","state","components","root","PopoverSurface","slot","always","getNativeElementProps","href","role","elementType","optional","defaultProps","id","renderByDefault","onMouseEnter","mergeCallbacks","onMouseLeave","onBlur","onClick","onKeyDown","onFocus"],"mappings":";;;;+BAsBaA;;;eAAAA;;;;iEAtBU;iCACkG;8BAC3F;gCACH;8BACgB;AAC3C,MAAMC,2BAA2B;AACjC,MAAMC,8BAA8B;AACpC,MAAMC,WAAWC,CAAAA;IACf,IAAIA,SAAS,WAAWA,SAAS,QAAQ;QACvC,OAAOF;IACT;IACA,OAAOD;AACT;AAUO,MAAMD,uBAAuB,CAACK,OAAOC;IAC1C,MAAM,EACJC,OAAO,EACPC,cAAc,EACdC,aAAa,EACbC,QAAQ,KAAK,EACb,GAAGC,YACJ,GAAGN;IACJ,MAAM,EACJO,cAAc,EACf,GAAGC,IAAAA,0BAAS;IACb,MAAM,CAACC,YAAYC,aAAa,GAAGC,IAAAA,0BAAU;IAC7C,MAAMC,YAAYC,IAAAA,sBAAK,EAAC;IACxB,MAAM,CAACC,kBAAkBC,oBAAoB,GAAGC,OAAMC,QAAQ,CAAC;IAC/D,MAAM,EACJC,SAASC,qBAAqB,EAC/B,GAAGH,OAAMI,MAAM,CAAC;QACfC,aA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A,+BAAc,EAACf,MAAME,IAAI,CAACgB,OAAO,EAAExC;QACxDsB,MAAME,IAAI,CAACiB,SAAS,GAAGJ,IAAAA,+BAAc,EAACf,MAAME,IAAI,CAACiB,SAAS,EAAExC;QAC5DqB,MAAMpD,OAAO,CAACkE,YAAY,GAAGC,IAAAA,+BAAc,EAACf,MAAMpD,OAAO,CAACkE,YAAY,EAAE/B;QACxEiB,MAAMpD,OAAO,CAACoE,YAAY,GAAGD,IAAAA,+BAAc,EAACf,MAAMpD,OAAO,CAACoE,YAAY,EAAEhC;QACxEgB,MAAMpD,OAAO,CAACwE,OAAO,GAAGL,IAAAA,+BAAc,EAACf,MAAMpD,OAAO,CAACwE,OAAO,EAAErC;IAChE;IACA,OAAOiB;AACT,GACA,uCAAuC"}
|
|
1
|
+
{"version":3,"sources":["useCitation.js"],"sourcesContent":["import { getNativeElementProps, slot } from '@fluentui/react-components';\nimport { usePreviewContext_unstable } from '@fluentui-copilot/react-preview';\n/**\n * Create the state required to render Citation.\n *\n * The returned state can be modified with hooks such as useCitationStyles_unstable,\n * before being passed to renderCitation_unstable.\n *\n * @param props - props from this instance of Citation\n * @param ref - reference to root HTMLElement of Citation\n */\nexport const useCitation_unstable = (props, ref) => {\n const {\n referenceHref,\n block = false,\n ...otherProps\n } = props;\n const isPopoverLocked = usePreviewContext_unstable(ctx => ctx.isPreviewLocked) && props['aria-expanded'];\n const state = {\n block,\n isPopoverLocked,\n components: {\n root: 'a'\n },\n root: slot.always(getNativeElementProps('a', {\n ref,\n href: referenceHref,\n role: null,\n 'aria-expanded': null,\n ...otherProps\n }), {\n elementType: 'a'\n })\n };\n return state;\n};\n//# sourceMappingURL=useCitation.js.map"],"names":["useCitation_unstable","props","ref","referenceHref","block","otherProps","isPopoverLocked","usePreviewContext_unstable","ctx","isPreviewLocked","state","components","root","slot","always","getNativeElementProps","href","role","elementType"],"mappings":";;;;+BAWaA;;;eAAAA;;;iCAX+B;8BACD;AAUpC,MAAMA,uBAAuB,CAACC,OAAOC;IAC1C,MAAM,EACJC,aAAa,EACbC,QAAQ,KAAK,EACb,GAAGC,YACJ,GAAGJ;IACJ,MAAMK,kBAAkBC,IAAAA,wCAA0B,EAACC,CAAAA,MAAOA,IAAIC,eAAe,KAAKR,KAAK,CAAC,gBAAgB;IACxG,MAAMS,QAAQ;QACZN;QACAE;QACAK,YAAY;YACVC,MAAM;QACR;QACAA,MAAMC,qBAAI,CAACC,MAAM,CAACC,IAAAA,sCAAqB,EAAC,KAAK;YAC3Cb;YACAc,MAAMb;YACNc,MAAM;YACN,iBAAiB;YACjB,GAAGZ,UAAU;QACf,IAAI;YACFa,aAAa;QACf;IACF;IACA,OAAOR;AACT,GACA,uCAAuC"}
|
|
@@ -18,9 +18,7 @@ _export(exports, {
|
|
|
18
18
|
});
|
|
19
19
|
const _reactcomponents = require("@fluentui/react-components");
|
|
20
20
|
const citationClassNames = {
|
|
21
|
-
root: 'fai-Citation'
|
|
22
|
-
popover: 'fai-Citation__popover',
|
|
23
|
-
popoverSurface: 'fai-Citation__popoverSurface'
|
|
21
|
+
root: 'fai-Citation'
|
|
24
22
|
};
|
|
25
23
|
const useCitationBaseClassName = (0, _reactcomponents.__resetStyles)("rad2akz", "r1hx2d32", [
|
|
26
24
|
".rad2akz{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);color:var(--colorNeutralForeground2);border:var(--strokeWidthThin) solid var(--colorNeutralStroke2);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);}",
|
|
@@ -93,8 +91,5 @@ const useCitationStyles_unstable = (state)=>{
|
|
|
93
91
|
const rootBaseClassName = useCitationBaseClassName();
|
|
94
92
|
const rootStyles = useCitationRootStyles();
|
|
95
93
|
state.root.className = (0, _reactcomponents.mergeClasses)(citationClassNames.root, state.isPopoverLocked && rootStyles.isPopoverLocked, state.block && rootStyles.isBlock, rootBaseClassName, state.root.className);
|
|
96
|
-
if (state.popover) {
|
|
97
|
-
state.popover.className = (0, _reactcomponents.mergeClasses)(citationClassNames.popover, state.popover.className);
|
|
98
|
-
}
|
|
99
94
|
return state;
|
|
100
95
|
}; //# sourceMappingURL=useCitationStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useCitationStyles.js"],"sourcesContent":["import { __resetStyles, __styles, mergeClasses, shorthands, tokens, typographyStyles } from '@fluentui/react-components';\nexport const citationClassNames = {\n root: 'fai-Citation'
|
|
1
|
+
{"version":3,"sources":["useCitationStyles.js"],"sourcesContent":["import { __resetStyles, __styles, mergeClasses, shorthands, tokens, typographyStyles } from '@fluentui/react-components';\nexport const citationClassNames = {\n root: 'fai-Citation'\n};\nconst useCitationBaseClassName = __resetStyles(\"rad2akz\", \"r1hx2d32\", [\".rad2akz{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);color:var(--colorNeutralForeground2);border:var(--strokeWidthThin) solid var(--colorNeutralStroke2);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);}\", \".rad2akz:hover{cursor:pointer;color:var(--colorBrandForeground2Hover);border-color:var(--colorBrandStroke2Hover);background-color:var(--colorBrandBackground2Hover);}\", \".rad2akz:hover:active{cursor:pointer;color:var(--colorBrandForeground2Pressed);border-color:var(--colorBrandStroke2Pressed);background-color:var(--colorBrandBackground2Pressed);}\", \".r1hx2d32{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);color:var(--colorNeutralForeground2);border:var(--strokeWidthThin) solid var(--colorNeutralStroke2);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);}\", \".r1hx2d32:hover{cursor:pointer;color:var(--colorBrandForeground2Hover);border-color:var(--colorBrandStroke2Hover);background-color:var(--colorBrandBackground2Hover);}\", \".r1hx2d32:hover:active{cursor:pointer;color:var(--colorBrandForeground2Pressed);border-color:var(--colorBrandStroke2Pressed);background-color:var(--colorBrandBackground2Pressed);}\"]);\nconst useCitationRootStyles = __styles({\n isBlock: {\n mc9l5x: \"f22iagw\",\n Frg6f3: [\"f1tyq0we\", \"f11qmguv\"],\n t21cq0: [\"f11qmguv\", \"f1tyq0we\"]\n },\n isPopoverLocked: {\n sj55zd: \"fkjhhq2\",\n g2u3we: \"f1nbqb3e\",\n h3c5rm: [\"fah3j9v\", \"f56crja\"],\n B9xav0g: \"fef4ti1\",\n zhjwy3: [\"f56crja\", \"fah3j9v\"],\n De3pzq: \"f16xkysk\",\n Bi91k9c: \"fbszb7v\",\n Bgoe8wy: \"ftxwbyd\",\n Bwzppfd: [\"f1p7dilp\", \"f15x2k42\"],\n oetu4i: \"fegdlwn\",\n gg5e9n: [\"f15x2k42\", \"f1p7dilp\"],\n Jwef8y: \"f121v1wq\"\n }\n}, {\n d: [\".f22iagw{display:flex;}\", \".f1tyq0we{margin-left:0;}\", \".f11qmguv{margin-right:0;}\", \".fkjhhq2{color:var(--colorBrandForeground2Pressed);}\", \".f1nbqb3e{border-top-color:var(--colorBrandStroke2Pressed);}\", \".fah3j9v{border-right-color:var(--colorBrandStroke2Pressed);}\", \".f56crja{border-left-color:var(--colorBrandStroke2Pressed);}\", \".fef4ti1{border-bottom-color:var(--colorBrandStroke2Pressed);}\", \".f16xkysk{background-color:var(--colorBrandBackground2);}\"],\n h: [\".fbszb7v:hover{color:var(--colorBrandForeground2Pressed);}\", \".ftxwbyd:hover{border-top-color:var(--colorBrandStroke2Pressed);}\", \".f1p7dilp:hover{border-right-color:var(--colorBrandStroke2Pressed);}\", \".f15x2k42:hover{border-left-color:var(--colorBrandStroke2Pressed);}\", \".fegdlwn:hover{border-bottom-color:var(--colorBrandStroke2Pressed);}\", \".f121v1wq:hover{background-color:var(--colorBrandBackground2);}\"]\n});\n/**\n * Apply styling to the Citation slots based on the state\n */\nexport const useCitationStyles_unstable = state => {\n const rootBaseClassName = useCitationBaseClassName();\n const rootStyles = useCitationRootStyles();\n state.root.className = mergeClasses(citationClassNames.root, state.isPopoverLocked && rootStyles.isPopoverLocked, state.block && rootStyles.isBlock, rootBaseClassName, state.root.className);\n return state;\n};\n//# sourceMappingURL=useCitationStyles.js.map"],"names":["citationClassNames","useCitationStyles_unstable","root","useCitationBaseClassName","__resetStyles","useCitationRootStyles","__styles","isBlock","mc9l5x","Frg6f3","t21cq0","isPopoverLocked","sj55zd","g2u3we","h3c5rm","B9xav0g","zhjwy3","De3pzq","Bi91k9c","Bgoe8wy","Bwzppfd","oetu4i","gg5e9n","Jwef8y","d","h","state","rootBaseClassName","rootStyles","className","mergeClasses","block"],"mappings":";;;;;;;;;;;IACaA,kBAAkB;eAAlBA;;IA+BAC,0BAA0B;eAA1BA;;;iCAhC+E;AACrF,MAAMD,qBAAqB;IAChCE,MAAM;AACR;AACA,MAAMC,2BAA2BC,IAAAA,8BAAa,EAAC,WAAW,YAAY;IAAC;IAA0kB;IAAyK;IAAsL;IAA2kB;IAA0K;CAAsL;AAC35D,MAAMC,wBAAwBC,IAAAA,yBAAQ,EAAC;IACrCC,SAAS;QACPC,QAAQ;QACRC,QAAQ;YAAC;YAAY;SAAW;QAChCC,QAAQ;YAAC;YAAY;SAAW;IAClC;IACAC,iBAAiB;QACfC,QAAQ;QACRC,QAAQ;QACRC,QAAQ;YAAC;YAAW;SAAU;QAC9BC,SAAS;QACTC,QAAQ;YAAC;YAAW;SAAU;QAC9BC,QAAQ;QACRC,SAAS;QACTC,SAAS;QACTC,SAAS;YAAC;YAAY;SAAW;QACjCC,QAAQ;QACRC,QAAQ;YAAC;YAAY;SAAW;QAChCC,QAAQ;IACV;AACF,GAAG;IACDC,GAAG;QAAC;QAA2B;QAA6B;QAA8B;QAAwD;QAAgE;QAAiE;QAAgE;QAAkE;KAA4D;IACjdC,GAAG;QAAC;QAA8D;QAAqE;QAAwE;QAAuE;QAAwE;KAAkE;AACla;AAIO,MAAMxB,6BAA6ByB,CAAAA;IACxC,MAAMC,oBAAoBxB;IAC1B,MAAMyB,aAAavB;IACnBqB,MAAMxB,IAAI,CAAC2B,SAAS,GAAGC,IAAAA,6BAAY,EAAC9B,mBAAmBE,IAAI,EAAEwB,MAAMf,eAAe,IAAIiB,WAAWjB,eAAe,EAAEe,MAAMK,KAAK,IAAIH,WAAWrB,OAAO,EAAEoB,mBAAmBD,MAAMxB,IAAI,CAAC2B,SAAS;IAC5L,OAAOH;AACT,GACA,6CAA6C"}
|
|
@@ -23,7 +23,6 @@ const renderReference_unstable = (state)=>{
|
|
|
23
23
|
state.detailsButton && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.detailsButton, {})
|
|
24
24
|
]
|
|
25
25
|
}),
|
|
26
|
-
state.sensitivityLabel && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.sensitivityLabel, {}),
|
|
27
26
|
state.sensitivity && /*#__PURE__*/ (0, _jsxruntime.jsx)(state.sensitivity, {}),
|
|
28
27
|
/*#__PURE__*/ (0, _jsxruntime.jsxs)(state.metadata, {
|
|
29
28
|
children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderReference.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-components';\n/**\n * Render the final JSX of Reference\n */\nexport const renderReference_unstable = state => {\n assertSlots(state);\n return /*#__PURE__*/_jsxs(state.root, {\n children: [state.citation && /*#__PURE__*/_jsx(state.citation, {}), state.media && /*#__PURE__*/_jsx(state.media, {}), /*#__PURE__*/_jsx(state.label, {}), state.actions && /*#__PURE__*/_jsxs(state.actions, {\n children: [state.actions.children, state.detailsButton && /*#__PURE__*/_jsx(state.detailsButton, {})]\n }), state.
|
|
1
|
+
{"version":3,"sources":["renderReference.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"@fluentui/react-jsx-runtime/jsx-runtime\";\nimport { assertSlots } from '@fluentui/react-components';\n/**\n * Render the final JSX of Reference\n */\nexport const renderReference_unstable = state => {\n assertSlots(state);\n return /*#__PURE__*/_jsxs(state.root, {\n children: [state.citation && /*#__PURE__*/_jsx(state.citation, {}), state.media && /*#__PURE__*/_jsx(state.media, {}), /*#__PURE__*/_jsx(state.label, {}), state.actions && /*#__PURE__*/_jsxs(state.actions, {\n children: [state.actions.children, state.detailsButton && /*#__PURE__*/_jsx(state.detailsButton, {})]\n }), state.sensitivity && /*#__PURE__*/_jsx(state.sensitivity, {}), /*#__PURE__*/_jsxs(state.metadata, {\n children: [state.primaryText && /*#__PURE__*/_jsx(state.primaryText, {}), state.secondaryText && /*#__PURE__*/_jsx(state.secondaryText, {}), state.tertiaryText && /*#__PURE__*/_jsx(state.tertiaryText, {}), state.icon && /*#__PURE__*/_jsx(state.icon, {}), state.metadata.children]\n }), /*#__PURE__*/_jsx(state.content, {})]\n });\n};\n//# sourceMappingURL=renderReference.js.map"],"names":["renderReference_unstable","state","assertSlots","_jsxs","root","children","citation","_jsx","media","label","actions","detailsButton","sensitivity","metadata","primaryText","secondaryText","tertiaryText","icon","content"],"mappings":";;;;+BAKaA;;;eAAAA;;;4BAL8B;iCACf;AAIrB,MAAMA,2BAA2BC,CAAAA;IACtCC,IAAAA,4BAAW,EAACD;IACZ,OAAO,WAAW,GAAEE,IAAAA,gBAAK,EAACF,MAAMG,IAAI,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|
sensitivity: 'span',
|
|
96
|
-
sensitivityLabel: 'span',
|
|
97
96
|
metadata: 'div',
|
|
98
97
|
content: 'div',
|
|
99
98
|
primaryText: 'span',
|
|
@@ -114,7 +113,6 @@ const useReference_unstable = (props, ref)=>{
|
|
|
114
113
|
defaultProps: {
|
|
115
114
|
children: /*#__PURE__*/ _react.createElement(_Citation.Citation, {
|
|
116
115
|
block: true,
|
|
117
|
-
referenceId: referenceId,
|
|
118
116
|
...citationProps
|
|
119
117
|
}, index)
|
|
120
118
|
},
|
|
@@ -130,9 +128,6 @@ const useReference_unstable = (props, ref)=>{
|
|
|
130
128
|
sensitivity: _reactcomponents.slot.optional(props.sensitivity, {
|
|
131
129
|
elementType: 'span'
|
|
132
130
|
}),
|
|
133
|
-
sensitivityLabel: _reactcomponents.slot.optional(props.sensitivityLabel, {
|
|
134
|
-
elementType: 'span'
|
|
135
|
-
}),
|
|
136
131
|
metadata: _reactcomponents.slot.always(props.metadata, {
|
|
137
132
|
elementType: 'div'
|
|
138
133
|
}),
|
|
@@ -1 +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,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],"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 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 ...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 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","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,QAAQC,qBAAI,CAACC,MAAM,CAACxB,MAAMsB,KAAK,EAAE;QACrCG,cAAc;YACZC,IAAIjB;QACN;QACAkB,aAAa;IACf;IACA,MAAMC,QAAQL,qBAAI,CAACM,QAAQ,CAAC7B,MAAM4B,KAAK,EAAE;QACvCH,cAAc;YACZC,IAAIf;QACN;QACAgB,aAAa;IACf;IACA,IAAIC,SAAS,WAAW,GAAEd,OAAMgB,cAAc,CAACF,MAAMG,QAAQ,GAAG;QAC9DH,MAAMG,QAAQ,GAAG,WAAW,GAAEjB,OAAMkB,YAAY,CAACJ,MAAMG,QAAQ,EAAE;YAC/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W;QACtB,OAAO,CAACK,aAAa,WAAW,GAAEE,OAAMoD,aAAa,CAACmB,gCAAoB,EAAE,QAAQ,WAAW,GAAEvE,OAAMoD,aAAa,CAACoB,8BAAkB,EAAE;IAC3I;IACA,OAAO,CAAC1E,aAAa,WAAW,GAAEE,OAAMoD,aAAa,CAACqB,gCAAoB,EAAE,QAAQ,WAAW,GAAEzE,OAAMoD,aAAa,CAACsB,8BAAkB,EAAE;AAC3I,GACA,wCAAwC"}
|
|
@@ -26,7 +26,6 @@ const referenceClassNames = {
|
|
|
26
26
|
media: 'fai-Reference__media',
|
|
27
27
|
actions: 'fai-Reference__actions',
|
|
28
28
|
sensitivity: 'fai-Reference__sensitivity',
|
|
29
|
-
sensitivityLabel: 'fai-Reference__sensitivityLabel',
|
|
30
29
|
metadata: 'fai-Reference__metadata',
|
|
31
30
|
primaryText: 'fai-Reference__primaryText',
|
|
32
31
|
secondaryText: 'fai-Reference__secondaryText',
|
|
@@ -127,75 +126,6 @@ const useStyles = (0, _reactcomponents.__styles)({
|
|
|
127
126
|
Bw0ie65: "f15c84mf",
|
|
128
127
|
Bdqf98w: "fsxvdwy"
|
|
129
128
|
},
|
|
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
129
|
metadata: {
|
|
200
130
|
B6of3ja: "fww94b8",
|
|
201
131
|
Ijaq50: "f1md2vp3",
|
|
@@ -301,35 +231,14 @@ const useStyles = (0, _reactcomponents.__styles)({
|
|
|
301
231
|
".f15c84mf{grid-column-end:sensitivityLabel;}",
|
|
302
232
|
".fsxvdwy{justify-self:start;}",
|
|
303
233
|
".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
234
|
".f1md2vp3{grid-row-start:metadata;}",
|
|
330
235
|
".f1y0qc5c{grid-column-start:metadata;}",
|
|
331
236
|
".f179ty8e{grid-row-end:metadata;}",
|
|
332
237
|
".f83o9dc{grid-column-end:metadata;}",
|
|
238
|
+
".fk6fouc{font-family:var(--fontFamilyBase);}",
|
|
239
|
+
".f13mqy1h{font-size:var(--fontSizeBase100);}",
|
|
240
|
+
".figsok6{font-weight:var(--fontWeightRegular);}",
|
|
241
|
+
".fcpl73t{line-height:var(--lineHeightBase100);}",
|
|
333
242
|
".f10pi13n{position:relative;}",
|
|
334
243
|
".foyynoy{margin-left:var(--spacingHorizontalS);}",
|
|
335
244
|
".f1vcna3q{margin-right:var(--spacingHorizontalS);}",
|
|
@@ -426,9 +335,6 @@ const useReferenceStyles_unstable = (state)=>{
|
|
|
426
335
|
if (state.sensitivity) {
|
|
427
336
|
state.sensitivity.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.sensitivity, styles.sensitivity, !isExpanded && styles.hidden, state.sensitivity.className);
|
|
428
337
|
}
|
|
429
|
-
if (state.sensitivityLabel) {
|
|
430
|
-
state.sensitivityLabel.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.sensitivityLabel, styles.sensitivityLabel, !isExpanded && styles.hidden, state.sensitivityLabel.className);
|
|
431
|
-
}
|
|
432
338
|
state.metadata.className = (0, _reactcomponents.mergeClasses)(referenceClassNames.metadata, styles.metadata, !isExpanded && styles.hidden, state.metadata.className);
|
|
433
339
|
let isSubsequentText = false;
|
|
434
340
|
if (state.primaryText) {
|