@fluentui-copilot/react-reference 0.0.0-nightly-20240527-0406-162a35f3.1 → 0.0.0-nightly-20240531-0407-49d6b52e.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 +9 -9
- package/CHANGELOG.md +7 -7
- package/dist/index.d.ts +9 -24
- package/lib/components/Citation/useCitationStyles.styles.js +2 -0
- package/lib/components/Citation/useCitationStyles.styles.js.map +1 -1
- package/lib/components/Reference/useReferenceStyles.styles.js +2 -0
- package/lib/components/Reference/useReferenceStyles.styles.js.map +1 -1
- package/lib/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js.map +1 -1
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggle.js +3 -0
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggle.js.map +1 -1
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.styles.js +24 -2
- package/lib/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.styles.js.map +1 -1
- package/lib/components/ReferenceList/useReferenceListStyles.styles.js +2 -0
- package/lib/components/ReferenceList/useReferenceListStyles.styles.js.map +1 -1
- package/lib/components/reference-v2/Reference/Reference.types.js.map +1 -1
- package/lib/components/reference-v2/Reference/useReference.js +1 -9
- package/lib/components/reference-v2/Reference/useReference.js.map +1 -1
- package/lib/components/reference-v2/Reference/useReferenceStyles.styles.js +6 -26
- package/lib/components/reference-v2/Reference/useReferenceStyles.styles.js.map +1 -1
- package/lib/components/reference-v2/ReferenceList/ReferenceList.types.js.map +1 -1
- package/lib/components/reference-v2/ReferenceList/useReferenceList.js +9 -9
- package/lib/components/reference-v2/ReferenceList/useReferenceList.js.map +1 -1
- package/lib/components/reference-v2/ReferenceList/useReferenceListContextValues.js +8 -6
- package/lib/components/reference-v2/ReferenceList/useReferenceListContextValues.js.map +1 -1
- package/lib/components/reference-v2/ReferenceList/useReferenceListStyles.styles.js +2 -0
- package/lib/components/reference-v2/ReferenceList/useReferenceListStyles.styles.js.map +1 -1
- package/lib/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.types.js.map +1 -1
- package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js +23 -19
- package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js.map +1 -1
- package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.js +4 -20
- package/lib/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.js.map +1 -1
- package/lib/contexts/reference-v2/referenceListContext.js +5 -4
- package/lib/contexts/reference-v2/referenceListContext.js.map +1 -1
- package/lib-commonjs/components/Citation/useCitationStyles.styles.js +1 -0
- package/lib-commonjs/components/Citation/useCitationStyles.styles.js.map +1 -1
- package/lib-commonjs/components/Reference/useReferenceStyles.styles.js +1 -0
- package/lib-commonjs/components/Reference/useReferenceStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ReferenceGroupToggle/ReferenceGroupToggle.types.js.map +1 -1
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggle.js +3 -0
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggle.js.map +1 -1
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.styles.js +27 -1
- package/lib-commonjs/components/ReferenceGroupToggle/useReferenceGroupToggleStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ReferenceList/useReferenceListStyles.styles.js +1 -0
- package/lib-commonjs/components/ReferenceList/useReferenceListStyles.styles.js.map +1 -1
- package/lib-commonjs/components/reference-v2/Reference/Reference.types.js.map +1 -1
- package/lib-commonjs/components/reference-v2/Reference/useReference.js +1 -6
- package/lib-commonjs/components/reference-v2/Reference/useReference.js.map +1 -1
- package/lib-commonjs/components/reference-v2/Reference/useReferenceStyles.styles.js +3 -38
- package/lib-commonjs/components/reference-v2/Reference/useReferenceStyles.styles.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceList/ReferenceList.types.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceList.js +9 -7
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceList.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListContextValues.js +5 -4
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListContextValues.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListStyles.styles.js +1 -0
- package/lib-commonjs/components/reference-v2/ReferenceList/useReferenceListStyles.styles.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/ReferenceOverflowButton.types.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js +26 -17
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js.map +1 -1
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.js +2 -32
- package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButtonStyles.styles.js.map +1 -1
- package/lib-commonjs/contexts/reference-v2/referenceListContext.js +5 -4
- package/lib-commonjs/contexts/reference-v2/referenceListContext.js.map +1 -1
- package/package.json +4 -4
package/lib-commonjs/components/reference-v2/ReferenceOverflowButton/useReferenceOverflowButton.js
CHANGED
|
@@ -15,19 +15,20 @@ const _reactcomponents = require("@fluentui/react-components");
|
|
|
15
15
|
const _reactutilities = require("@fluentui/react-utilities");
|
|
16
16
|
const _referenceListContext = require("../../../contexts/reference-v2/referenceListContext");
|
|
17
17
|
const useReferenceOverflowButton_unstable = (props, ref)=>{
|
|
18
|
+
'use no memo';
|
|
18
19
|
const { children, text } = props;
|
|
19
20
|
const rootRef = _react.useRef(null);
|
|
20
21
|
const [setTimeout] = (0, _reactutilities.useTimeout)();
|
|
21
|
-
const { areReferencesExpanded,
|
|
22
|
-
ctxAppearance: ctx.appearance,
|
|
22
|
+
const { areReferencesExpanded, maxVisibleReferences, referenceListRef, totalReferencesCount, triggeredViaKeyboard } = (0, _referenceListContext.useReferenceListContext_unstable)((ctx)=>({
|
|
23
23
|
areReferencesExpanded: ctx.areReferencesExpanded,
|
|
24
|
-
|
|
24
|
+
maxVisibleReferences: ctx.maxVisibleReferences,
|
|
25
|
+
referenceListRef: ctx.referenceListRef,
|
|
26
|
+
totalReferencesCount: ctx.totalReferencesCount,
|
|
25
27
|
triggeredViaKeyboard: ctx.overflowButtonTriggeredViaKeyboard
|
|
26
28
|
}));
|
|
27
|
-
const appearance = props.appearance || ctxAppearance;
|
|
28
29
|
const { isOverflowing, overflowCount } = (0, _reactcomponents.useOverflowMenu)();
|
|
29
30
|
const processedText = children !== null && children !== void 0 ? children : typeof text === 'function' ? text(overflowCount) : text;
|
|
30
|
-
const {
|
|
31
|
+
const { findFirstFocusable, findNextFocusable } = (0, _reactcomponents.useFocusFinders)();
|
|
31
32
|
const onKeyDown = _react.useCallback((ev)=>{
|
|
32
33
|
if (ev.key === _keyboardkeys.Enter || ev.key === _keyboardkeys.Space) {
|
|
33
34
|
triggeredViaKeyboard.current = true;
|
|
@@ -35,17 +36,22 @@ const useReferenceOverflowButton_unstable = (props, ref)=>{
|
|
|
35
36
|
}, [
|
|
36
37
|
triggeredViaKeyboard
|
|
37
38
|
]);
|
|
38
|
-
//
|
|
39
|
+
// We keep track of the previous overflow count to help determine the element to move focus to when expanding the references via keyboard.
|
|
40
|
+
const previousOverflow = _react.useRef(0);
|
|
41
|
+
// When the references are expanded or collapsed via keyboard, we need to move focus to the appropriate element.
|
|
39
42
|
_react.useEffect(()=>{
|
|
40
|
-
if
|
|
43
|
+
// We only try to move focus if maxVisibleReferences is set and the overflow button was triggered via keyboard.
|
|
44
|
+
if (maxVisibleReferences !== undefined && triggeredViaKeyboard.current) {
|
|
41
45
|
let elementToFocus;
|
|
42
|
-
// If the references are
|
|
46
|
+
// If the references are collapsed, we move focus to the overflow button.
|
|
43
47
|
if (!areReferencesExpanded) {
|
|
44
48
|
elementToFocus = rootRef.current;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
previousOverflow.current = overflowCount;
|
|
50
|
+
} else if (rootRef.current && referenceListRef.current) {
|
|
51
|
+
const positionToFocus = maxVisibleReferences < totalReferencesCount - previousOverflow.current ? maxVisibleReferences : totalReferencesCount - previousOverflow.current;
|
|
52
|
+
let currentElement = findFirstFocusable(referenceListRef.current);
|
|
53
|
+
for(let i = 0; i < positionToFocus && currentElement; i++){
|
|
54
|
+
currentElement = findNextFocusable(currentElement);
|
|
49
55
|
}
|
|
50
56
|
elementToFocus = currentElement;
|
|
51
57
|
}
|
|
@@ -55,16 +61,19 @@ const useReferenceOverflowButton_unstable = (props, ref)=>{
|
|
|
55
61
|
triggeredViaKeyboard.current = false;
|
|
56
62
|
}, 0);
|
|
57
63
|
}
|
|
58
|
-
|
|
59
|
-
previousOverflowCount.current = areReferencesExpanded ? 0 : overflowCount;
|
|
60
|
-
}, // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
61
|
-
[
|
|
64
|
+
}, [
|
|
62
65
|
areReferencesExpanded,
|
|
66
|
+
findFirstFocusable,
|
|
67
|
+
findNextFocusable,
|
|
63
68
|
isOverflowing,
|
|
69
|
+
maxVisibleReferences,
|
|
70
|
+
overflowCount,
|
|
71
|
+
referenceListRef,
|
|
72
|
+
setTimeout,
|
|
73
|
+
totalReferencesCount,
|
|
64
74
|
triggeredViaKeyboard
|
|
65
75
|
]);
|
|
66
76
|
const state = {
|
|
67
|
-
appearance,
|
|
68
77
|
shouldRenderOverflowButton: isOverflowing || areReferencesExpanded,
|
|
69
78
|
components: {
|
|
70
79
|
root: 'button'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useReferenceOverflowButton.ts"],"sourcesContent":["import * as React from 'react';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\nimport {\n getIntrinsicElementProps,\n mergeCallbacks,\n slot,\n useFocusFinders,\n useMergedRefs,\n useOverflowMenu,\n} from '@fluentui/react-components';\nimport { useTimeout } from '@fluentui/react-utilities';\nimport { useReferenceListContext_unstable } from '../../../contexts/reference-v2/referenceListContext';\nimport type { ReferenceOverflowButtonProps, ReferenceOverflowButtonState } from './ReferenceOverflowButton.types';\n\n/**\n * Create the state required to render ReferenceOverflowButton.\n *\n * The returned state can be modified with hooks such as useReferenceOverflowButtonStyles_unstable,\n * before being passed to renderReferenceOverflowButton_unstable.\n *\n * @param props - props from this instance of ReferenceOverflowButton\n * @param ref - reference to root HTMLElement of ReferenceOverflowButton\n */\nexport const useReferenceOverflowButton_unstable = (\n props: ReferenceOverflowButtonProps,\n ref: React.Ref<HTMLButtonElement>,\n): ReferenceOverflowButtonState => {\n const { children, text } = props;\n\n const rootRef = React.useRef<HTMLButtonElement>(null);\n\n const [setTimeout] = useTimeout();\n\n const { areReferencesExpanded,
|
|
1
|
+
{"version":3,"sources":["useReferenceOverflowButton.ts"],"sourcesContent":["import * as React from 'react';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\nimport {\n getIntrinsicElementProps,\n mergeCallbacks,\n slot,\n useFocusFinders,\n useMergedRefs,\n useOverflowMenu,\n} from '@fluentui/react-components';\nimport { useTimeout } from '@fluentui/react-utilities';\nimport { useReferenceListContext_unstable } from '../../../contexts/reference-v2/referenceListContext';\nimport type { ReferenceOverflowButtonProps, ReferenceOverflowButtonState } from './ReferenceOverflowButton.types';\n\n/**\n * Create the state required to render ReferenceOverflowButton.\n *\n * The returned state can be modified with hooks such as useReferenceOverflowButtonStyles_unstable,\n * before being passed to renderReferenceOverflowButton_unstable.\n *\n * @param props - props from this instance of ReferenceOverflowButton\n * @param ref - reference to root HTMLElement of ReferenceOverflowButton\n */\nexport const useReferenceOverflowButton_unstable = (\n props: ReferenceOverflowButtonProps,\n ref: React.Ref<HTMLButtonElement>,\n): ReferenceOverflowButtonState => {\n 'use no memo';\n\n const { children, text } = props;\n\n const rootRef = React.useRef<HTMLButtonElement>(null);\n\n const [setTimeout] = useTimeout();\n\n const { areReferencesExpanded, maxVisibleReferences, referenceListRef, totalReferencesCount, triggeredViaKeyboard } =\n useReferenceListContext_unstable(ctx => ({\n areReferencesExpanded: ctx.areReferencesExpanded,\n maxVisibleReferences: ctx.maxVisibleReferences,\n referenceListRef: ctx.referenceListRef,\n totalReferencesCount: ctx.totalReferencesCount,\n triggeredViaKeyboard: ctx.overflowButtonTriggeredViaKeyboard,\n }));\n\n const { isOverflowing, overflowCount } = useOverflowMenu();\n\n const processedText = children ?? (typeof text === 'function' ? text(overflowCount) : text);\n\n const { findFirstFocusable, findNextFocusable } = useFocusFinders();\n const onKeyDown = React.useCallback<React.KeyboardEventHandler<HTMLButtonElement>>(\n ev => {\n if (ev.key === Enter || ev.key === Space) {\n triggeredViaKeyboard.current = true;\n }\n },\n [triggeredViaKeyboard],\n );\n\n // We keep track of the previous overflow count to help determine the element to move focus to when expanding the references via keyboard.\n const previousOverflow = React.useRef(0);\n\n // When the references are expanded or collapsed via keyboard, we need to move focus to the appropriate element.\n React.useEffect(() => {\n // We only try to move focus if maxVisibleReferences is set and the overflow button was triggered via keyboard.\n if (maxVisibleReferences !== undefined && triggeredViaKeyboard.current) {\n let elementToFocus: HTMLElement | null | undefined;\n\n // If the references are collapsed, we move focus to the overflow button.\n if (!areReferencesExpanded) {\n elementToFocus = rootRef.current;\n previousOverflow.current = overflowCount;\n }\n // If the references are expanded, we move focus to the first reference that was hidden when they were collapsed.\n // We do this by moving focus according to the following heuristics:\n // - If maxVisibleReferences is what determines what overflows, focus is moved to the element that is in the maxVisibleReferences position of the ReferenceList's children.\n // - If the space available is what is determines what overflows, focus is moved to the element that is in the (totalReferencesCount - overflowCount) position of the ReferenceList's children.\n else if (rootRef.current && referenceListRef.current) {\n const positionToFocus =\n maxVisibleReferences < totalReferencesCount - previousOverflow.current\n ? maxVisibleReferences\n : totalReferencesCount - previousOverflow.current;\n\n let currentElement: HTMLElement | null | undefined = findFirstFocusable(referenceListRef.current);\n for (let i = 0; i < positionToFocus && currentElement; i++) {\n currentElement = findNextFocusable(currentElement);\n }\n\n elementToFocus = currentElement;\n }\n\n // We focus on the element and reset the triggeredViaKeyboard flag after a timeout to ensure that this is pushed at the end of the event queue.\n setTimeout(() => {\n elementToFocus?.focus();\n triggeredViaKeyboard.current = false;\n }, 0);\n }\n }, [\n areReferencesExpanded,\n findFirstFocusable,\n findNextFocusable,\n isOverflowing,\n maxVisibleReferences,\n overflowCount,\n referenceListRef,\n setTimeout,\n totalReferencesCount,\n triggeredViaKeyboard,\n ]);\n\n const state: ReferenceOverflowButtonState = {\n shouldRenderOverflowButton: isOverflowing || areReferencesExpanded,\n\n components: {\n root: 'button',\n },\n\n root: slot.always(\n getIntrinsicElementProps('button', {\n ref: useMergedRefs(rootRef, ref),\n ...props,\n }),\n {\n defaultProps: {\n children: processedText,\n },\n elementType: 'button',\n },\n ),\n };\n\n state.root.onKeyDown = mergeCallbacks(onKeyDown, props.onKeyDown);\n\n return state;\n};\n"],"names":["useReferenceOverflowButton_unstable","props","ref","children","areReferencesExpanded","referenceListRef","ctx","totalReferencesCount","maxVisibleReferences","isOverflowing","processedText","findFirstFocusable","triggeredViaKeyboard","React","Space","overflowButtonTriggeredViaKeyboard","useEffect","undefined","text","overflowCount","elementToFocus","previousOverflow","current","Enter","rootRef","positionToFocus","i","currentElement","useRef","findNextFocusable","focus","shouldRenderOverflowButton","setTimeout","state","getIntrinsicElementProps","defaultProps","elementType"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA2BEA;;;eAAAA;;;;iEA3BqB;8BACM;iCAQtB;gCACoB;sCACsB;AAgB/C,MAAAA,sCAAA,CAAAC,OAAAC;;UAMA,EAEAC,QAAQC;oBAIJC,OAAAA,MAAkBC,CAAAA;sBAClBC,GAAAA,IAAAA,0BAAAA;iCAEF,EAEFC,oBAAQC,EAERJ,gBAAMK,EAENH,oBAAQI,EACRC,oBAAkBC,+DAEgB,EAAAP,CAAAA,MAAKQ,CAAAA;mCACjCF,IAAAA,qBAA+B;kCACjCN,IAAAE,oBAAA;YACFH,kBACAC,IAAAD,gBAAA;kCAACO,IAAAA,oBAAAA;kCAAqBN,IAAAS,kCAAA;;UAIxB,EAEAN,aAAA,EACAI,aAAMG,yCACJ;UACAN,gBAAIF,aAAyBS,QAAAA,aAAaL,KAAAA,IAAAA,WAA4B,OAAEM,SAAA,aAAAA,KAAAC,iBAAAD;8BAGtE,mBACKd,yCACHgB;sBACAC,OAAAA,WAAiBC,CAAAA,CAAAA;kBACnB,KAKKC,mBAAIC,IAAAA,GAAQF,GAAAA,KAAOR,mBAAIT,EAAAA;iCACpBoB,OAAAA,GAAAA;;;;KAMGC;8IAC4BC;6BACrCd,OAAAe,MAAA,CAAA;oHAEiBD;oBACnB,CAAA;uHAEA;qCACWV,aAAAL,qBAAAU,OAAA,EAAA;;qFAEsB;wCAC9B;gBACLF,iBAAAI,QAAAF,OAAA;gBACCD,iBAAAC,OAAA,GAAAH;mBACDf,IAAAA,QAAAA,OAAAA,IAAAA,iBAAAA,OAAAA,EAAAA;gBACAO,MAAAA,kBAAAA,uBAAAA,uBAAAA,iBAAAA,OAAAA,GAAAA,uBAAAA,uBAAAA,iBAAAA,OAAAA;gBACAkB,IAAAA,iBAAAA,mBAAAA,iBAAAA,OAAAA;gBACApB,IAAAA,IAAAA,IAAAA,GAAAA,IAAAA,mBAAAA,gBAAAA,IAAAA;oBACAD,iBAAAA,kBAAAA;gBACAW;gBACAd,iBAAAA;;2JAEAE;uBACAK;gBACDQ,mBAAA,QAAAA,mBAAA,KAAA,IAAA,KAAA,IAAAA,eAAAU,KAAA;gBAEDlB,qBAA4CU,OAAA,GAAA;eAC1CS;;;;QAGQpB;QAAAkB;QAAApB;QAAAD;QAAAW;QAAAd;QAAA2B;QAAAzB;QAAAK;KAAA;UACRqB,QAAA;oCAGEC,iBAAAA;oBACEhC;kBACA;;mCAGAiC,CAAAA,MAAAA,CAAAA,IAAAA,yCAAc,EAAA,UAAA;mDACZhC,EAAAA,SAAUO;oBACZ;;0BAEF;gBAEJP,UAAAO;YAEAuB;YAEAG,aAAOH;QACP"}
|
|
@@ -27,39 +27,9 @@ const referenceOverflowButtonClassNames = {
|
|
|
27
27
|
".rbsq19a:hover{background-color:var(--colorNeutralBackground3Hover);border-color:var(--colorNeutralStroke1Hover);color:var(--colorNeutralForeground2Hover);}",
|
|
28
28
|
".rbsq19a:hover:active{background-color:var(--colorNeutralBackground3Pressed);border-color:var(--colorNeutralStroke1Pressed);color:var(--colorNeutralForeground2Pressed);}"
|
|
29
29
|
]);
|
|
30
|
-
const useRootStyles = (0, _reactcomponents.__styles)({
|
|
31
|
-
darker: {
|
|
32
|
-
De3pzq: "f3vzo32",
|
|
33
|
-
g2u3we: "fj3muxo",
|
|
34
|
-
h3c5rm: [
|
|
35
|
-
"f1akhkt",
|
|
36
|
-
"f1lxtadh"
|
|
37
|
-
],
|
|
38
|
-
B9xav0g: "f1aperda",
|
|
39
|
-
zhjwy3: [
|
|
40
|
-
"f1lxtadh",
|
|
41
|
-
"f1akhkt"
|
|
42
|
-
],
|
|
43
|
-
Jwef8y: "f14vf7cg",
|
|
44
|
-
iro3zm: "fho4vwd"
|
|
45
|
-
}
|
|
46
|
-
}, {
|
|
47
|
-
d: [
|
|
48
|
-
".f3vzo32{background-color:var(--colorNeutralBackground5);}",
|
|
49
|
-
".fj3muxo{border-top-color:var(--colorNeutralStroke1);}",
|
|
50
|
-
".f1akhkt{border-right-color:var(--colorNeutralStroke1);}",
|
|
51
|
-
".f1lxtadh{border-left-color:var(--colorNeutralStroke1);}",
|
|
52
|
-
".f1aperda{border-bottom-color:var(--colorNeutralStroke1);}"
|
|
53
|
-
],
|
|
54
|
-
h: [
|
|
55
|
-
".f14vf7cg:hover{background-color:var(--colorNeutralBackground5Hover);}",
|
|
56
|
-
".fho4vwd:hover:active{background-color:var(--colorNeutralBackground5Pressed);}"
|
|
57
|
-
]
|
|
58
|
-
});
|
|
59
30
|
const useReferenceOverflowButtonStyles_unstable = (state)=>{
|
|
60
|
-
|
|
31
|
+
'use no memo';
|
|
61
32
|
const rootBaseClassName = useRootBaseClassName();
|
|
62
|
-
|
|
63
|
-
state.root.className = (0, _reactcomponents.mergeClasses)(referenceOverflowButtonClassNames.root, rootBaseClassName, appearance === 'darker' && rootStyles.darker, state.root.className);
|
|
33
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(referenceOverflowButtonClassNames.root, rootBaseClassName, state.root.className);
|
|
64
34
|
return state;
|
|
65
35
|
}; //# sourceMappingURL=useReferenceOverflowButtonStyles.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useReferenceOverflowButtonStyles.styles.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["useReferenceOverflowButtonStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, mergeClasses, tokens, typographyStyles } from '@fluentui/react-components';\nimport type { ReferenceOverflowButtonSlots, ReferenceOverflowButtonState } from './ReferenceOverflowButton.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const referenceOverflowButtonClassNames: SlotClassNames<ReferenceOverflowButtonSlots> = {\n root: 'fai-ReferenceOverflowButton',\n};\n\n/**\n * Styles for the root slot\n */\nconst useRootBaseClassName = makeResetStyles({\n backgroundColor: tokens.colorNeutralBackground3,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke2}`,\n borderRadius: tokens.borderRadiusMedium,\n color: tokens.colorNeutralForeground2,\n display: 'inline-flex',\n padding: `${tokens.spacingVerticalXXS} ${tokens.spacingHorizontalS}`,\n ...typographyStyles.caption1,\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground3Hover,\n borderColor: tokens.colorNeutralStroke1Hover,\n color: tokens.colorNeutralForeground2Hover,\n },\n\n ':hover:active': {\n backgroundColor: tokens.colorNeutralBackground3Pressed,\n borderColor: tokens.colorNeutralStroke1Pressed,\n color: tokens.colorNeutralForeground2Pressed,\n },\n});\n\n/**\n * Apply styling to the ReferenceOverflowButton slots based on the state\n */\nexport const useReferenceOverflowButtonStyles_unstable = (\n state: ReferenceOverflowButtonState,\n): ReferenceOverflowButtonState => {\n 'use no memo';\n\n const rootBaseClassName = useRootBaseClassName();\n\n state.root.className = mergeClasses(referenceOverflowButtonClassNames.root, rootBaseClassName, state.root.className);\n\n return state;\n};\n"],"names":["referenceOverflowButtonClassNames","useReferenceOverflowButtonStyles_unstable","root","backgroundColor","colorNeutralBackground3","display","state","rootBaseClassName","useRootBaseClassName","tokens","colorNeutralBackground3Hover","className","borderColor"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAIaA,iCAAAA;eAAAA;;IAYFC,yCAAA;eAAAA;;;iCAhBqD;AAIzD,MAAMD,oCAAkF;UAC7FE;AACF;AAEA;;CAEC,SAECC,uBAAwBC,IAAAA,8BAAAA,EAAAA,WAAuB,MAAA;IAAA;IAAA;IAAA;CAAA;AAI/CC,MAASJ,4CAAAK,CAAAA;;UAITC,oBAAUC;UACRL,IAAAA,CAAAA,SAAAA,GAAiBM,IAAAA,6BAAOC,EAAAA,kCAA4BR,IAAA,EAAAK,mBAAAD,MAAAJ,IAAA,CAAAS,SAAA;WACpDC;sEAEF"}
|
|
@@ -22,15 +22,16 @@ _export(exports, {
|
|
|
22
22
|
const _reactcontextselector = require("@fluentui/react-context-selector");
|
|
23
23
|
const ReferenceListContext = (0, _reactcontextselector.createContext)(undefined);
|
|
24
24
|
const referenceListContextDefaultValue = {
|
|
25
|
-
appearance: 'lighter',
|
|
26
25
|
areReferencesExpanded: false,
|
|
26
|
+
maxVisibleReferences: undefined,
|
|
27
27
|
overflowButtonTriggeredViaKeyboard: {
|
|
28
28
|
current: false
|
|
29
29
|
},
|
|
30
|
-
|
|
31
|
-
current:
|
|
30
|
+
referenceListRef: {
|
|
31
|
+
current: null
|
|
32
32
|
},
|
|
33
|
-
shouldUseOverflow: false
|
|
33
|
+
shouldUseOverflow: false,
|
|
34
|
+
totalReferencesCount: 0
|
|
34
35
|
};
|
|
35
36
|
const ReferenceListContextProvider = ReferenceListContext.Provider;
|
|
36
37
|
const useReferenceListContext_unstable = (selector)=>(0, _reactcontextselector.useContextSelector)(ReferenceListContext, (ctx = referenceListContextDefaultValue)=>selector(ctx)); //# sourceMappingURL=referenceListContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["referenceListContext.ts"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { Context, ContextSelector } from '@fluentui/react-context-selector';\nimport type { ReferenceListState } from '../../ReferenceListV2';\n\n/**\n * Context shared between ReferenceList and its children components\n */\nexport type ReferenceListContextValue = Pick<\n ReferenceListState,\n | '
|
|
1
|
+
{"version":3,"sources":["referenceListContext.ts"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { Context, ContextSelector } from '@fluentui/react-context-selector';\nimport type { ReferenceListState } from '../../ReferenceListV2';\n\n/**\n * Context shared between ReferenceList and its children components\n */\nexport type ReferenceListContextValue = Pick<\n ReferenceListState,\n | 'areReferencesExpanded'\n | 'maxVisibleReferences'\n | 'overflowButtonTriggeredViaKeyboard'\n | 'referenceListRef'\n | 'shouldUseOverflow'\n | 'totalReferencesCount'\n>;\n\nexport const ReferenceListContext: Context<ReferenceListContextValue> = createContext<\n ReferenceListContextValue | undefined\n>(undefined) as Context<ReferenceListContextValue>;\n\nconst referenceListContextDefaultValue: ReferenceListContextValue = {\n areReferencesExpanded: false,\n maxVisibleReferences: undefined,\n overflowButtonTriggeredViaKeyboard: { current: false },\n referenceListRef: { current: null },\n shouldUseOverflow: false,\n totalReferencesCount: 0,\n};\n\nexport const ReferenceListContextProvider = ReferenceListContext.Provider;\n\nexport const useReferenceListContext_unstable = <T>(selector: ContextSelector<ReferenceListContextValue, T>) =>\n useContextSelector(ReferenceListContext, (ctx = referenceListContextDefaultValue) => selector(ctx));\n"],"names":["ReferenceListContext","ReferenceListContextProvider","useReferenceListContext_unstable","createContext","undefined","referenceListContextDefaultValue","areReferencesExpanded","maxVisibleReferences","overflowButtonTriggeredViaKeyboard","current","referenceListRef","shouldUseOverflow","totalReferencesCount","Provider","selector","useContextSelector","ctx"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAiBaA,oBAAAA;eAAAA;;IAaAC,4BAAAA;eAAAA;;IAEAC,gCAAAA;eAAAA;;;sCAhCqC;AAiB3C,MAAMF,uBAA2DG,IAAAA,mCAAAA,EAEtEC;AAEF,MAAMC,mCAA8D;2BAClEC;0BACAC;wCACAC;iBAAsCC;;sBACtCC;iBAAoBD;;uBACpBE;0BACAC;AACF;AAEO,MAAMX,+BAA+BD,qBAAqBa,QAAQ;AAElE,MAAMX,mCAAmCY,CAAAA,WAC9CC,IAAAA,wCAAAA,EAAmBf,sBAAsB,CAACgB,MAAMX,gCAAgC,GAAKS,SAASE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui-copilot/react-reference",
|
|
3
|
-
"version": "0.0.0-nightly-
|
|
3
|
+
"version": "0.0.0-nightly-20240531-0407-49d6b52e.1",
|
|
4
4
|
"description": "Fluent AI controls for citations and references",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@fluentui-copilot/react-preview": "0.0.0-nightly-
|
|
16
|
-
"@fluentui-copilot/react-provider": "0.0.0-nightly-
|
|
17
|
-
"@fluentui-copilot/react-sensitivity-label": "0.0.0-nightly-
|
|
15
|
+
"@fluentui-copilot/react-preview": "0.0.0-nightly-20240531-0407-49d6b52e.1",
|
|
16
|
+
"@fluentui-copilot/react-provider": "0.0.0-nightly-20240531-0407-49d6b52e.1",
|
|
17
|
+
"@fluentui-copilot/react-sensitivity-label": "0.0.0-nightly-20240531-0407-49d6b52e.1",
|
|
18
18
|
"@swc/helpers": "^0.5.1"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|