@fluentui-copilot/react-prompt-listbox 0.0.0-nightly-20240722-0406-476bfcb7.1 → 0.0.0-nightly-20240724-0406-74b90794.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 +54 -15
- package/CHANGELOG.md +22 -9
- package/dist/index.d.ts +22 -3
- package/lib/components/PromptListbox/renderPromptListbox.js +10 -4
- package/lib/components/PromptListbox/renderPromptListbox.js.map +1 -1
- package/lib/components/PromptListbox/usePromptListbox.js +2 -1
- package/lib/components/PromptListbox/usePromptListbox.js.map +1 -1
- package/lib/components/PromptOption/PromptOption.types.js +1 -2
- package/lib/components/PromptOption/PromptOption.types.js.map +1 -1
- package/lib/components/PromptOption/renderPromptOption.js +0 -1
- package/lib/components/PromptOption/renderPromptOption.js.map +1 -1
- package/lib/components/PromptOption/usePromptOption.js +80 -8
- package/lib/components/PromptOption/usePromptOption.js.map +1 -1
- package/lib/components/PromptOption/usePromptOptionStyles.styles.js +71 -6
- package/lib/components/PromptOption/usePromptOptionStyles.styles.js.map +1 -1
- package/lib/components/utils/usePromptListboxFunctionality.js +2 -2
- package/lib/components/utils/usePromptListboxFunctionality.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/components/PromptListbox/renderPromptListbox.js +8 -4
- package/lib-commonjs/components/PromptListbox/renderPromptListbox.js.map +1 -1
- package/lib-commonjs/components/PromptListbox/usePromptListbox.js +2 -1
- package/lib-commonjs/components/PromptListbox/usePromptListbox.js.map +1 -1
- package/lib-commonjs/components/PromptOption/PromptOption.types.js +0 -2
- package/lib-commonjs/components/PromptOption/PromptOption.types.js.map +1 -1
- package/lib-commonjs/components/PromptOption/renderPromptOption.js +0 -1
- package/lib-commonjs/components/PromptOption/renderPromptOption.js.map +1 -1
- package/lib-commonjs/components/PromptOption/usePromptOption.js +83 -8
- package/lib-commonjs/components/PromptOption/usePromptOption.js.map +1 -1
- package/lib-commonjs/components/PromptOption/usePromptOptionStyles.styles.js +179 -5
- package/lib-commonjs/components/PromptOption/usePromptOptionStyles.styles.js.map +1 -1
- package/lib-commonjs/components/utils/usePromptListboxFunctionality.js +2 -2
- package/lib-commonjs/components/utils/usePromptListboxFunctionality.js.map +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +8 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["usePromptListboxFunctionality.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useActiveDescendant } from '@fluentui/react-aria';\nimport { optionClassNames } from '@fluentui/react-components';\nimport { mergeCallbacks, useControllableState, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { getDropdownActionFromKey } from './dropdownKeyActions';\nimport { TextCursorPositionPlugin } from '../../plugins/TextCursorPositionPlugin';\nimport { useOptionCollection } from './useOptionCollection';\nimport { useSelection } from './useSelection';\nimport { ArrowDown, ArrowLeft, ArrowRight, ArrowUp } from '@fluentui/keyboard-keys';\nimport { useComboboxPositioning } from './useComboboxPositioning';\nimport { useTriggerKeydown } from './useTriggerKeyDown';\nimport { PromptListbox } from '../PromptListbox';\nimport type { EditorInputProps } from '@fluentui-copilot/react-editor-input';\nimport type {\n UsePromptListboxFunctionalityParams,\n UsePromptListboxFunctionality,\n} from './PromptListboxFunctionality.types';\n\nexport function usePromptListboxFunctionality(\n params: UsePromptListboxFunctionalityParams,\n): UsePromptListboxFunctionality {\n const { positioning, onOpenChange, onSelectionModeChange, listboxProps } = params;\n const {\n listboxRef: activeDescendantListboxRef,\n activeParentRef,\n controller: activeDescendantController,\n } = useActiveDescendant<HTMLSpanElement, HTMLDivElement>({\n matchOption: el => el.classList.contains(optionClassNames.root),\n });\n // useMergedRefs to normalize the ref into a React.RefObject type\n const triggerRef = useMergedRefs(activeParentRef);\n const selectionState = useSelection(listboxProps ?? {});\n const { selectOption } = selectionState;\n const optionCollection = useOptionCollection();\n const { getOptionById } = optionCollection;\n const [isInLastPosition, setIsInLastPosition] = React.useState(true);\n const [isInSelectionMode, setIsInSelectionMode] = React.useState(false);\n const [open, setOpen] = useControllableState({\n state: params.open,\n defaultState: params.defaultOpen,\n initialState: false,\n });\n\n const onBlur = (event: React.FocusEvent<HTMLSpanElement>) => {\n setOpen(false);\n onOpenChange?.(event, { event, type: 'focus', open: false });\n };\n\n const onFocus = (event: React.FocusEvent<HTMLSpanElement>) => {\n if (event.target === event.currentTarget) {\n setOpen(true);\n onOpenChange?.(event, { event, type: 'focus', open: true });\n }\n };\n\n const cursorPositionPlugin = <TextCursorPositionPlugin setIsInLastPosition={setIsInLastPosition} />;\n\n const onListboxBlur = React.useCallback(() => {\n setIsInSelectionMode(false);\n onSelectionModeChange?.(false);\n }, [onSelectionModeChange]);\n\n // handle combobox keyboard interaction\n const onKeyDown = useTriggerKeydown({\n ...optionCollection,\n activeDescendantController,\n getOptionById,\n onBlur: onListboxBlur,\n selectOption,\n isInLastPosition,\n open,\n multiselect: false,\n });\n\n // NVDA and JAWS have bugs that suppress reading the input value text when aria-activedescendant is set\n // To prevent this, we clear the HTML attribute (but save the state) when a user presses left/right arrows\n // ref: https://github.com/microsoft/fluentui/issues/26359#issuecomment-1397759888\n const [hideActiveDescendant, setHideActiveDescendant] = React.useState(false);\n\n /**\n * Freeform combobox should not select\n */\n const onInputTriggerKeyDown: EditorInputProps['onKeyDown'] = useEventCallback(event => {\n // update typing state to true if the user is typing\n const action = getDropdownActionFromKey(event, { open, multiselect: false, isInLastPosition });\n if (\n event.key === ArrowLeft ||\n event.key === ArrowRight ||\n (!isInLastPosition && (event.key === ArrowDown || event.key === ArrowUp)) ||\n (action === 'Type' && isInLastPosition) ||\n action === 'Type'\n ) {\n activeDescendantController.blur();\n setHideActiveDescendant(true);\n setIsInSelectionMode(false);\n onSelectionModeChange?.(false);\n } else if (\n action === 'Next' ||\n action === 'Previous' ||\n action === 'First' ||\n action === 'Last' ||\n action === 'PageUp' ||\n action === 'PageDown'\n ) {\n setHideActiveDescendant(false);\n setIsInSelectionMode(true);\n onSelectionModeChange?.(true);\n }\n });\n\n React.useEffect(() => {\n if (hideActiveDescendant) {\n triggerRef.current?.removeAttribute('aria-activedescendant');\n }\n // We only want to run this when the hideActiveDescendant changes, if the triggerRef\n // is undefined, there's no need to remove theAttribute and we shouldn't be adding\n // refs as dependencies since it can blow up the number of runs.\n // eslint-disable-next-line react-compiler/react-compiler\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [hideActiveDescendant]);\n\n const [comboboxPopupRef, comboboxTargetRef] = useComboboxPositioning({ positioning });\n\n const listboxMergedRef = useMergedRefs(comboboxPopupRef, activeDescendantListboxRef, listboxProps?.ref);\n const listbox = React.useMemo(() => {\n return (\n <PromptListbox\n open={open}\n {...listboxProps}\n {...optionCollection}\n {...selectionState}\n ref={listboxMergedRef}\n activeDescendantController={activeDescendantController}\n />\n );\n }, [activeDescendantController, listboxMergedRef, listboxProps, open, optionCollection, selectionState]);\n\n return {\n promptListbox: listbox,\n triggerProps: {\n ref: triggerRef,\n onBlur,\n onFocus,\n onKeyDown: useEventCallback(mergeCallbacks(onKeyDown, onInputTriggerKeyDown)),\n isInSelectionMode,\n },\n containerRef: comboboxTargetRef,\n cursorPositionPlugin,\n };\n}\n"],"names":["React","useActiveDescendant","optionClassNames","mergeCallbacks","useControllableState","useEventCallback","useMergedRefs","getDropdownActionFromKey","TextCursorPositionPlugin","useOptionCollection","useSelection","ArrowDown","ArrowLeft","ArrowRight","ArrowUp","useComboboxPositioning","useTriggerKeydown","PromptListbox","usePromptListboxFunctionality","params","positioning","onOpenChange","onSelectionModeChange","listboxProps","listboxRef","activeDescendantListboxRef","activeParentRef","controller","activeDescendantController","matchOption","el","classList","contains","root","triggerRef","selectionState","selectOption","optionCollection","getOptionById","isInLastPosition","setIsInLastPosition","useState","isInSelectionMode","setIsInSelectionMode","open","setOpen","state","defaultState","defaultOpen","initialState","onBlur","event","type","onFocus","target","currentTarget","cursorPositionPlugin","onListboxBlur","useCallback","onKeyDown","multiselect","hideActiveDescendant","setHideActiveDescendant","onInputTriggerKeyDown","action","key","blur","useEffect","current","removeAttribute","comboboxPopupRef","comboboxTargetRef","listboxMergedRef","ref","listbox","useMemo","promptListbox","triggerProps","containerRef"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,mBAAmB,QAAQ,uBAAuB;AAC3D,SAASC,gBAAgB,QAAQ,6BAA6B;AAC9D,SAASC,cAAc,EAAEC,oBAAoB,EAAEC,gBAAgB,EAAEC,aAAa,QAAQ,4BAA4B;AAClH,SAASC,wBAAwB,QAAQ,uBAAuB;AAChE,SAASC,wBAAwB,QAAQ,yCAAyC;AAClF,SAASC,mBAAmB,QAAQ,wBAAwB;AAC5D,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,SAAS,EAAEC,SAAS,EAAEC,UAAU,EAAEC,OAAO,QAAQ,0BAA0B;AACpF,SAASC,sBAAsB,QAAQ,2BAA2B;AAClE,SAASC,iBAAiB,QAAQ,sBAAsB;AACxD,SAASC,aAAa,QAAQ,mBAAmB;AAOjD,OAAO,SAASC,8BACdC,MAA2C;IAE3C,MAAM,EAAEC,WAAW,EAAEC,YAAY,EAAEC,qBAAqB,EAAEC,YAAY,EAAE,GAAGJ;IAC3E,MAAM,EACJK,YAAYC,0BAA0B,EACtCC,eAAe,EACfC,YAAYC,0BAA0B,EACvC,GAAG3B,oBAAqD;QACvD4B,aAAaC,CAAAA,KAAMA,GAAGC,SAAS,CAACC,QAAQ,CAAC9B,iBAAiB+B,IAAI;IAChE;IACA,iEAAiE;IACjE,MAAMC,aAAa5B,cAAcoB;IACjC,MAAMS,iBAAiBzB,aAAaa,yBAAAA,0BAAAA,eAAgB,CAAC;IACrD,MAAM,EAAE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"version":3,"sources":["usePromptListboxFunctionality.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useActiveDescendant } from '@fluentui/react-aria';\nimport { mergeCallbacks, useControllableState, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { getDropdownActionFromKey } from './dropdownKeyActions';\nimport { TextCursorPositionPlugin } from '../../plugins/TextCursorPositionPlugin';\nimport { useOptionCollection } from './useOptionCollection';\nimport { useSelection } from './useSelection';\nimport { ArrowDown, ArrowLeft, ArrowRight, ArrowUp } from '@fluentui/keyboard-keys';\nimport { useComboboxPositioning } from './useComboboxPositioning';\nimport { useTriggerKeydown } from './useTriggerKeyDown';\nimport { PromptListbox } from '../PromptListbox';\nimport { promptOptionClassNames } from '../PromptOption';\nimport type { EditorInputProps } from '@fluentui-copilot/react-editor-input';\nimport type {\n UsePromptListboxFunctionalityParams,\n UsePromptListboxFunctionality,\n} from './PromptListboxFunctionality.types';\n\nexport function usePromptListboxFunctionality(\n params: UsePromptListboxFunctionalityParams,\n): UsePromptListboxFunctionality {\n const { positioning, onOpenChange, onSelectionModeChange, listboxProps } = params;\n const {\n listboxRef: activeDescendantListboxRef,\n activeParentRef,\n controller: activeDescendantController,\n } = useActiveDescendant<HTMLSpanElement, HTMLDivElement>({\n matchOption: el => el.classList.contains(promptOptionClassNames.root),\n });\n // useMergedRefs to normalize the ref into a React.RefObject type\n const triggerRef = useMergedRefs(activeParentRef);\n const selectionState = useSelection(listboxProps ?? {});\n const { selectOption } = selectionState;\n const optionCollection = useOptionCollection();\n const { getOptionById } = optionCollection;\n const [isInLastPosition, setIsInLastPosition] = React.useState(true);\n const [isInSelectionMode, setIsInSelectionMode] = React.useState(false);\n const [open, setOpen] = useControllableState({\n state: params.open,\n defaultState: params.defaultOpen,\n initialState: false,\n });\n\n const onBlur = (event: React.FocusEvent<HTMLSpanElement>) => {\n setOpen(false);\n onOpenChange?.(event, { event, type: 'focus', open: false });\n };\n\n const onFocus = (event: React.FocusEvent<HTMLSpanElement>) => {\n if (event.target === event.currentTarget) {\n setOpen(true);\n onOpenChange?.(event, { event, type: 'focus', open: true });\n }\n };\n\n const cursorPositionPlugin = <TextCursorPositionPlugin setIsInLastPosition={setIsInLastPosition} />;\n\n const onListboxBlur = React.useCallback(() => {\n setIsInSelectionMode(false);\n onSelectionModeChange?.(false);\n }, [onSelectionModeChange]);\n\n // handle combobox keyboard interaction\n const onKeyDown = useTriggerKeydown({\n ...optionCollection,\n activeDescendantController,\n getOptionById,\n onBlur: onListboxBlur,\n selectOption,\n isInLastPosition,\n open,\n multiselect: false,\n });\n\n // NVDA and JAWS have bugs that suppress reading the input value text when aria-activedescendant is set\n // To prevent this, we clear the HTML attribute (but save the state) when a user presses left/right arrows\n // ref: https://github.com/microsoft/fluentui/issues/26359#issuecomment-1397759888\n const [hideActiveDescendant, setHideActiveDescendant] = React.useState(false);\n\n /**\n * Freeform combobox should not select\n */\n const onInputTriggerKeyDown: EditorInputProps['onKeyDown'] = useEventCallback(event => {\n // update typing state to true if the user is typing\n const action = getDropdownActionFromKey(event, { open, multiselect: false, isInLastPosition });\n if (\n event.key === ArrowLeft ||\n event.key === ArrowRight ||\n (!isInLastPosition && (event.key === ArrowDown || event.key === ArrowUp)) ||\n (action === 'Type' && isInLastPosition) ||\n action === 'Type'\n ) {\n activeDescendantController.blur();\n setHideActiveDescendant(true);\n setIsInSelectionMode(false);\n onSelectionModeChange?.(false);\n } else if (\n action === 'Next' ||\n action === 'Previous' ||\n action === 'First' ||\n action === 'Last' ||\n action === 'PageUp' ||\n action === 'PageDown'\n ) {\n setHideActiveDescendant(false);\n setIsInSelectionMode(true);\n onSelectionModeChange?.(true);\n }\n });\n\n React.useEffect(() => {\n if (hideActiveDescendant) {\n triggerRef.current?.removeAttribute('aria-activedescendant');\n }\n // We only want to run this when the hideActiveDescendant changes, if the triggerRef\n // is undefined, there's no need to remove theAttribute and we shouldn't be adding\n // refs as dependencies since it can blow up the number of runs.\n // eslint-disable-next-line react-compiler/react-compiler\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [hideActiveDescendant]);\n\n const [comboboxPopupRef, comboboxTargetRef] = useComboboxPositioning({ positioning });\n\n const listboxMergedRef = useMergedRefs(comboboxPopupRef, activeDescendantListboxRef, listboxProps?.ref);\n const listbox = React.useMemo(() => {\n return (\n <PromptListbox\n open={open}\n {...listboxProps}\n {...optionCollection}\n {...selectionState}\n ref={listboxMergedRef}\n activeDescendantController={activeDescendantController}\n />\n );\n }, [activeDescendantController, listboxMergedRef, listboxProps, open, optionCollection, selectionState]);\n\n return {\n promptListbox: listbox,\n triggerProps: {\n ref: triggerRef,\n onBlur,\n onFocus,\n onKeyDown: useEventCallback(mergeCallbacks(onKeyDown, onInputTriggerKeyDown)),\n isInSelectionMode,\n },\n containerRef: comboboxTargetRef,\n cursorPositionPlugin,\n };\n}\n"],"names":["React","useActiveDescendant","mergeCallbacks","useControllableState","useEventCallback","useMergedRefs","getDropdownActionFromKey","TextCursorPositionPlugin","useOptionCollection","useSelection","ArrowDown","ArrowLeft","ArrowRight","ArrowUp","useComboboxPositioning","useTriggerKeydown","PromptListbox","promptOptionClassNames","usePromptListboxFunctionality","params","positioning","onOpenChange","onSelectionModeChange","listboxProps","listboxRef","activeDescendantListboxRef","activeParentRef","controller","activeDescendantController","matchOption","el","classList","contains","root","triggerRef","selectionState","selectOption","optionCollection","getOptionById","isInLastPosition","setIsInLastPosition","useState","isInSelectionMode","setIsInSelectionMode","open","setOpen","state","defaultState","defaultOpen","initialState","onBlur","event","type","onFocus","target","currentTarget","cursorPositionPlugin","onListboxBlur","useCallback","onKeyDown","multiselect","hideActiveDescendant","setHideActiveDescendant","onInputTriggerKeyDown","action","key","blur","useEffect","current","removeAttribute","comboboxPopupRef","comboboxTargetRef","listboxMergedRef","ref","listbox","useMemo","promptListbox","triggerProps","containerRef"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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qB;YACrBrB,kCAAAA,4CAAAA,sBAAwB;QAC1B,OAAO,IACL0C,WAAW,UACXA,WAAW,cACXA,WAAW,WACXA,WAAW,UACXA,WAAW,YACXA,WAAW,YACX;YACAF,wBAAwB;YACxBnB,qBAAqB;YACrBrB,kCAAAA,4CAAAA,sBAAwB;QAC1B;IACF;IAEAtB,MAAMmE,SAAS,CAAC;QACd,IAAIN,sBAAsB;gBACxB3B;aAAAA,sBAAAA,WAAWkC,OAAO,cAAlBlC,0CAAAA,oBAAoBmC,eAAe,CAAC;QACtC;IACA,oFAAoF;IACpF,kFAAkF;IAClF,gEAAgE;IAChE,yDAAyD;IACzD,uDAAuD;IACzD,GAAG;QAACR;KAAqB;IAEzB,MAAM,CAACS,kBAAkBC,kBAAkB,GAAGzD,uBAAuB;QAAEM;IAAY;IAEnF,MAAMoD,mBAAmBnE,cAAciE,kBAAkB7C,4BAA4BF,yBAAAA,mCAAAA,aAAckD,GAAG;IACtG,MAAMC,UAAU1E,MAAM2E,OAAO,CAAC;QAC5B,qBACE,oBAAC3D;YACC4B,MAAMA;YACL,GAAGrB,YAAY;YACf,GAAGc,gBAAgB;YACnB,GAAGF,cAAc;YAClBsC,KAAKD;YACL5C,4BAA4BA;;IAGlC,GAAG;QAACA;QAA4B4C;QAAkBjD;QAAcqB;QAAMP;QAAkBF;KAAe;IAEvG,OAAO;QACLyC,eAAeF;QACfG,cAAc;YACZJ,KAAKvC;YACLgB;YACAG;YACAM,WAAWvD,iBAAiBF,eAAeyD,WAAWI;YACtDrB;QACF;QACAoC,cAAcP;QACdf;IACF;AACF"}
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export type { PromptListboxProps, PromptListboxSlots, PromptListboxState } from './PromptListbox';\nexport {\n PromptListbox,\n promptListboxClassNames,\n renderPromptListbox_unstable,\n usePromptListboxStyles_unstable,\n usePromptListbox_unstable,\n} from './PromptListbox';\n\nexport { usePromptListboxFunctionality } from './components/utils/usePromptListboxFunctionality';\nexport type {\n OnOpenChangeData,\n ProcessedPromptListboxProps,\n UsePromptListboxFunctionality,\n UsePromptListboxFunctionalityParams,\n} from './components/utils/PromptListboxFunctionality.types';\n\nexport type { TextCursorPositionPluginProps } from './plugins/TextCursorPositionPlugin';\nexport { TextCursorPositionPlugin } from './plugins/TextCursorPositionPlugin';\n\nexport type { PromptOptionProps, PromptOptionSlots, PromptOptionState } from './PromptOption';\nexport {
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export type { PromptListboxProps, PromptListboxSlots, PromptListboxState } from './PromptListbox';\nexport {\n PromptListbox,\n promptListboxClassNames,\n renderPromptListbox_unstable,\n usePromptListboxStyles_unstable,\n usePromptListbox_unstable,\n} from './PromptListbox';\n\nexport { usePromptListboxFunctionality } from './components/utils/usePromptListboxFunctionality';\nexport type {\n OnOpenChangeData,\n ProcessedPromptListboxProps,\n UsePromptListboxFunctionality,\n UsePromptListboxFunctionalityParams,\n} from './components/utils/PromptListboxFunctionality.types';\n\nexport type { TextCursorPositionPluginProps } from './plugins/TextCursorPositionPlugin';\nexport { TextCursorPositionPlugin } from './plugins/TextCursorPositionPlugin';\n\nexport type { PromptOptionProps, PromptOptionSlots, PromptOptionState } from './PromptOption';\nexport {\n PromptOption,\n promptOptionClassNames,\n renderPromptOption_unstable,\n usePromptOptionStyles_unstable,\n usePromptOption_unstable,\n} from './PromptOption';\n"],"names":["PromptListbox","promptListboxClassNames","renderPromptListbox_unstable","usePromptListboxStyles_unstable","usePromptListbox_unstable","usePromptListboxFunctionality","TextCursorPositionPlugin","PromptOption","promptOptionClassNames","renderPromptOption_unstable","usePromptOptionStyles_unstable","usePromptOption_unstable"],"rangeMappings":";;;","mappings":"AACA,SACEA,aAAa,EACbC,uBAAuB,EACvBC,4BAA4B,EAC5BC,+BAA+B,EAC/BC,yBAAyB,QACpB,kBAAkB;AAEzB,SAASC,6BAA6B,QAAQ,mDAAmD;AASjG,SAASC,wBAAwB,QAAQ,qCAAqC;AAG9E,SACEC,YAAY,EACZC,sBAAsB,EACtBC,2BAA2B,EAC3BC,8BAA8B,EAC9BC,wBAAwB,QACnB,iBAAiB"}
|
|
@@ -13,14 +13,18 @@ const _reactcomponents = require("@fluentui/react-components");
|
|
|
13
13
|
const _reactaria = require("@fluentui/react-aria");
|
|
14
14
|
const renderPromptListbox_unstable = (state, contextValues)=>{
|
|
15
15
|
(0, _reactcomponents.assertSlots)(state);
|
|
16
|
+
const { open } = state;
|
|
16
17
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactcomponents.ListboxProvider, {
|
|
17
18
|
value: contextValues.listbox,
|
|
18
19
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactaria.ActiveDescendantContextProvider, {
|
|
19
20
|
value: contextValues.activeDescendant,
|
|
20
|
-
children:
|
|
21
|
-
|
|
22
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {})
|
|
23
|
-
|
|
21
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
22
|
+
"aria-owns": open ? state.root.id : undefined,
|
|
23
|
+
children: open && (state.inlinePopup ? /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactcomponents.Portal, {
|
|
24
|
+
mountNode: state.mountNode,
|
|
25
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {})
|
|
26
|
+
}))
|
|
27
|
+
})
|
|
24
28
|
})
|
|
25
29
|
});
|
|
26
30
|
}; //# sourceMappingURL=renderPromptListbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderPromptListbox.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots, ListboxProvider, Portal } from '@fluentui/react-components';\nimport { ActiveDescendantContextProvider } from '@fluentui/react-aria';\nimport type { PromptListboxState, PromptListboxSlots, PromptListboxContextValues } from './PromptListbox.types';\n\n/**\n * Render the final JSX of PromptListbox\n */\nexport const renderPromptListbox_unstable = (state: PromptListboxState, contextValues: PromptListboxContextValues) => {\n assertSlots<PromptListboxSlots>(state);\n\n return (\n <ListboxProvider value={contextValues.listbox}>\n <ActiveDescendantContextProvider value={contextValues.activeDescendant}>\n {state.open &&\n
|
|
1
|
+
{"version":3,"sources":["renderPromptListbox.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots, ListboxProvider, Portal } from '@fluentui/react-components';\nimport { ActiveDescendantContextProvider } from '@fluentui/react-aria';\nimport type { PromptListboxState, PromptListboxSlots, PromptListboxContextValues } from './PromptListbox.types';\n\n/**\n * Render the final JSX of PromptListbox\n */\nexport const renderPromptListbox_unstable = (state: PromptListboxState, contextValues: PromptListboxContextValues) => {\n assertSlots<PromptListboxSlots>(state);\n const { open } = state;\n\n return (\n <ListboxProvider value={contextValues.listbox}>\n <ActiveDescendantContextProvider value={contextValues.activeDescendant}>\n <span aria-owns={open ? state.root.id : undefined}>\n {open &&\n (state.inlinePopup ? (\n <state.root />\n ) : (\n <Portal mountNode={state.mountNode}>\n <state.root />\n </Portal>\n ))}\n </span>\n </ActiveDescendantContextProvider>\n </ListboxProvider>\n );\n};\n"],"names":["assertSlots","state","open","value","contextValues","activeDescendant","listbox","aria-owns","undefined","inlinePopup","mountNode","root","id","_jsx","Portal"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAWEA;;;eAAAA;;;4BAXwB;iCAG2B;2BACL;AAO9CA,MAAAA,+BAAgCC,CAAAA,OAAAA;oCACxBC,EAAAA;UAER,MACmBC;sBACyBC,GAAAA,IAAAA,eAAAA,EAAAA,gCAAcC,EAAAA;6BACpDC,OAAA;6BAAMC,GAAAA,IAAAA,eAAWL,EAAAA,0CAAuBM,EAAAA;iCACrCN,gBACQO;iCAGGC,GAAAA,IAAAA,eAAWT,EAAAA,QAAMS;0CACvBC,IAAA,CAAAC,EAAA,GAAAJ;0BAEJN,QAAAD,CAAAA,MAAAQ,WAAA,GAAA,WAAA,GAAAI,IAAAA,eAAA,EAAAZ,MAAAU,IAAA,EAAA,CAAA,KAAA,WAAA,GAAAE,IAAAA,eAAA,EAAAC,uBAAA,EAAA;;;;YAKV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["usePromptListbox.ts"],"sourcesContent":["import { Listbox, slot, useMergedRefs } from '@fluentui/react-components';\nimport { mergeCallbacks, useEventCallback, useId } from '@fluentui/react-utilities';\nimport type
|
|
1
|
+
{"version":3,"sources":["usePromptListbox.ts"],"sourcesContent":["import type * as React from 'react';\nimport { Listbox, slot, useMergedRefs } from '@fluentui/react-components';\nimport { mergeCallbacks, useEventCallback, useId } from '@fluentui/react-utilities';\nimport type { PromptListboxProps, PromptListboxState } from './PromptListbox.types';\nimport type { PromptListboxContextState } from './usePromptListboxContextValues';\nimport type { ActiveDescendantChangeEvent } from '@fluentui/react-aria';\n\n// If you add JSX to this file, be sure to change the file type to .tsx\n\n/**\n * Create the state required to render PromptListbox.\n *\n * The returned state can be modified with hooks such as usePromptListboxStyles_unstable,\n * before being passed to renderPromptListbox_unstable.\n *\n * @param props - props from this instance of PromptListbox\n * @param ref - reference to root HTMLElement of PromptListbox\n */\nexport const usePromptListbox_unstable = (\n props: PromptListboxProps,\n ref: React.Ref<HTMLDivElement>,\n): PromptListboxState => {\n const {\n id,\n onActiveOptionChange,\n inlinePopup = false,\n mountNode = undefined,\n open = true,\n activeDescendantController,\n getOptionById,\n getOptionsMatchingValue,\n selectedOptions,\n selectOption,\n registerOption,\n } = props;\n const listboxId = useId('prompt-listbox', id);\n\n const onActiveDescendantChange = useEventCallback((event: ActiveDescendantChangeEvent) => {\n const previousOption = event.detail.previousId ? getOptionById(event.detail.previousId) : null;\n const nextOption = getOptionById(event.detail.id);\n onActiveOptionChange?.(event, { event, type: 'change', previousOption, nextOption });\n });\n\n const state: PromptListboxState = {\n ...deprecatedPropsDefaults,\n open,\n getOptionById,\n getOptionsMatchingValue,\n selectedOptions,\n selectOption,\n registerOption,\n onActiveDescendantChange,\n activeDescendantController,\n inlinePopup,\n mountNode,\n\n components: {\n root: Listbox,\n },\n\n root: slot.always(\n { ...props, selectedOptions },\n {\n defaultProps: {\n disableAutoFocus: true,\n id: listboxId,\n tabIndex: undefined,\n role: 'menu',\n },\n elementType: Listbox,\n },\n ),\n };\n\n state.root.ref = useMergedRefs(ref, state.root.ref);\n state.root.onMouseDown = useEventCallback(\n mergeCallbacks((event: React.MouseEvent<HTMLDivElement>) => {\n event.preventDefault();\n }, state.root.onMouseDown),\n );\n\n state.root.onClick = useEventCallback(\n mergeCallbacks((event: React.MouseEvent<HTMLDivElement>) => {\n event.preventDefault();\n }, state.root.onClick),\n );\n\n return state;\n};\n\nconst noop = () => null;\n\nconst deprecatedPropsDefaults: Pick<\n PromptListboxContextState,\n 'activeOption' | 'focusVisible' | 'setActiveOption' | 'onOptionClick'\n> = {\n activeOption: undefined,\n focusVisible: false,\n setActiveOption: noop,\n onOptionClick: noop,\n};\n"],"names":["id","inlinePopup","previousOption","nextOption","onActiveOptionChange","event","selectOption","registerOption","open","getOptionById","getOptionsMatchingValue","selectedOptions","onActiveDescendantChange","root","elementType","Listbox","state","ref","useMergedRefs","onClick","preventDefault","tabIndex","role","noop","deprecatedPropsDefaults","activeOption","setActiveOption","onOptionClick"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAuBIA;;;eAAAA;;;iCAtByC;gCACW;AAoBtD,MACEA,4BAEAC,CAAAA,OAAAA;UAUF,EAEAD,EAAA,sBACQE,gBACAC,KAAAA,cACNC,SAAAA,aAAgCC,4BAAa,eAAUH,yBAAgBC,iBAAW,EACpFG,YAAA,EAEAC,cAAkC;UAEhCC,YAAAA,IAAAA,qBAAAA,EAAAA,kBAAAA;UACAC,2BAAAA,IAAAA,gCAAAA,EAAAA,CAAAA;cACAC,iBAAAA,MAAAA,MAAAA,CAAAA,UAAAA,GAAAA,cAAAA,MAAAA,MAAAA,CAAAA,UAAAA,IAAAA;cACAC,aAAAA,cAAAA,MAAAA,MAAAA,CAAAA,EAAAA;iCACAL,QAAAA,yBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,qBAAAA,OAAAA;;kBAEAM;;;;;kBAMEC;kCACF;;;;;;;;;;;oBAWIC;kBACFC,wBAAA;QAEJ;QAEAC,MAAMH,qBAAI,CAACI,MAAMC,CAAAA;YACjBF,GAAAA,KAAU;;QAGR,GAAGA;YAGLA,cAAWG;gBAEPd,kBAAMe;gBACLJ,IAAAA;gBAGLK,UAAOL;gBACPM,MAAA;YAEIC;YAEAC,aAAAA,wBAAAA;QAIJC;;UAEAC,IAAAA,CAAAA,GAAAA,GAAAA,IAAAA,8BAAiBH,EAAAA,KAAAA,MAAAA,IAAAA,CAAAA,GAAAA;UACjBI,IAAAA,CAAAA,WAAeJ,GAAAA,IAAAA,gCAAAA,EAAAA,IAAAA,8BAAAA,EAAAA,CAAAA;QACjBlB,MAAAe,cAAA"}
|
|
@@ -4,6 +4,4 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
// TODO: Remove semicolon from previous line, uncomment next line, and provide union of props to pick from PromptOptionProps.
|
|
8
|
-
// & Required<Pick<PromptOptionProps, 'propName'>>
|
|
9
7
|
//# sourceMappingURL=PromptOption.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["PromptOption.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-components';\n\nexport type PromptOptionSlots = {\n root: Slot<'div'
|
|
1
|
+
{"version":3,"sources":["PromptOption.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, OptionProps, OptionState, Slot } from '@fluentui/react-components';\n\nexport type PromptOptionSlots = {\n root: NonNullable<Slot<'div'>>;\n};\n\n/**\n * PromptOption Props\n */\nexport type PromptOptionProps = ComponentProps<PromptOptionSlots> &\n Pick<OptionProps, 'disabled' | 'value'> &\n (\n | {\n /**\n * An optional override the string value of the PromptOption's display text,\n * defaulting to the PromptOption's child content.\n * This is used as the PromptInput button's or PromptInput input's value when the option is selected,\n * and as the comparison for type-to-find keyboard functionality.\n */\n text?: string;\n children: string;\n }\n | {\n /**\n * The string value of the PromptOption's display text when the PromptOption's children are not a string.\n * This is used as the PromptInput button's or PromptInput input's value when the option is selected,\n * and as the comparison for type-to-find keyboard functionality.\n */\n text: string;\n children?: React.ReactNode;\n }\n );\n\n/**\n * State used in rendering PromptOption\n */\nexport type PromptOptionState = ComponentState<PromptOptionSlots> & Pick<OptionState, 'disabled' | 'selected'>;\n"],"names":[],"rangeMappings":";;","mappings":"AAiCA;;CAEC"}
|
|
@@ -12,6 +12,5 @@ const _jsxruntime = require("@fluentui/react-jsx-runtime/jsx-runtime");
|
|
|
12
12
|
const _reactcomponents = require("@fluentui/react-components");
|
|
13
13
|
const renderPromptOption_unstable = (state)=>{
|
|
14
14
|
(0, _reactcomponents.assertSlots)(state);
|
|
15
|
-
// TODO Add additional slots in the appropriate place
|
|
16
15
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(state.root, {});
|
|
17
16
|
}; //# sourceMappingURL=renderPromptOption.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["renderPromptOption.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type {
|
|
1
|
+
{"version":3,"sources":["renderPromptOption.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\n\nimport { assertSlots } from '@fluentui/react-components';\nimport type { PromptOptionSlots, PromptOptionState } from './PromptOption.types';\n\n/**\n * Render the final JSX of PromptOption\n */\nexport const renderPromptOption_unstable = (state: PromptOptionState) => {\n assertSlots<PromptOptionSlots>(state);\n\n return <state.root />;\n};\n"],"names":["assertSlots","state","_jsx","root"],"rangeMappings":";;;;;;;;;;;;;;","mappings":";;;;+BAUEA;;;eAAAA;;;4BAVwB;iCAGE;AAO1BA,MAAAA,8BAA+BC,CAAAA;oCAE/B,EAAAA;IACA,OAAA,WAAA,GAAAC,IAAAA,eAAA,EAAAD,MAAAE,IAAA,EAAA,CAAA"}
|
|
@@ -8,21 +8,96 @@ Object.defineProperty(exports, "usePromptOption_unstable", {
|
|
|
8
8
|
return usePromptOption_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"));
|
|
11
13
|
const _reactcomponents = require("@fluentui/react-components");
|
|
14
|
+
const _reactcombobox = require("@fluentui/react-combobox");
|
|
15
|
+
const _reactaria = require("@fluentui/react-aria");
|
|
12
16
|
const usePromptOption_unstable = (props, ref)=>{
|
|
17
|
+
const { children, disabled, text, value } = props;
|
|
18
|
+
const optionRef = _react.useRef(null);
|
|
19
|
+
const optionText = getTextString(text, children);
|
|
20
|
+
const optionValue = value !== null && value !== void 0 ? value : optionText;
|
|
21
|
+
// use the id if provided, otherwise use a generated id
|
|
22
|
+
const id = (0, _reactcomponents.useId)('fluent-option', props.id);
|
|
23
|
+
// data used for context registration & events
|
|
24
|
+
const optionData = _react.useMemo(()=>({
|
|
25
|
+
id,
|
|
26
|
+
disabled,
|
|
27
|
+
text: optionText,
|
|
28
|
+
value: optionValue
|
|
29
|
+
}), [
|
|
30
|
+
id,
|
|
31
|
+
disabled,
|
|
32
|
+
optionText,
|
|
33
|
+
optionValue
|
|
34
|
+
]);
|
|
35
|
+
// context values
|
|
36
|
+
const { controller: activeDescendantController } = (0, _reactaria.useActiveDescendantContext)();
|
|
37
|
+
const registerOption = (0, _reactcombobox.useListboxContext_unstable)((ctx)=>ctx.registerOption);
|
|
38
|
+
const selected = (0, _reactcombobox.useListboxContext_unstable)((ctx)=>{
|
|
39
|
+
const selectedOptions = ctx.selectedOptions;
|
|
40
|
+
return optionValue !== undefined && selectedOptions.find((o)=>o === optionValue) !== undefined;
|
|
41
|
+
});
|
|
42
|
+
const selectOption = (0, _reactcombobox.useListboxContext_unstable)((ctx)=>ctx.selectOption);
|
|
43
|
+
const onOptionClick = (0, _reactcombobox.useListboxContext_unstable)((ctx)=>ctx.onOptionClick);
|
|
44
|
+
const onClick = (event)=>{
|
|
45
|
+
var _props_onClick;
|
|
46
|
+
if (disabled) {
|
|
47
|
+
event.preventDefault();
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
activeDescendantController.focus(id);
|
|
51
|
+
// handle selection change
|
|
52
|
+
selectOption(event, optionData);
|
|
53
|
+
onOptionClick(event);
|
|
54
|
+
(_props_onClick = props.onClick) === null || _props_onClick === void 0 ? void 0 : _props_onClick.call(props, event);
|
|
55
|
+
};
|
|
56
|
+
// register option data with context
|
|
57
|
+
_react.useEffect(()=>{
|
|
58
|
+
if (id && optionRef.current) {
|
|
59
|
+
return registerOption(optionData, optionRef.current);
|
|
60
|
+
}
|
|
61
|
+
}, [
|
|
62
|
+
id,
|
|
63
|
+
optionData,
|
|
64
|
+
registerOption
|
|
65
|
+
]);
|
|
13
66
|
return {
|
|
14
|
-
// TODO add appropriate props/defaults
|
|
15
67
|
components: {
|
|
16
|
-
// TODO add each slot's element type or component
|
|
17
68
|
root: 'div'
|
|
18
69
|
},
|
|
19
|
-
// TODO add appropriate slots, for example:
|
|
20
|
-
// mySlot: slot.optional(props.mySlot),
|
|
21
70
|
root: _reactcomponents.slot.always((0, _reactcomponents.getIntrinsicElementProps)('div', {
|
|
22
|
-
ref,
|
|
23
|
-
|
|
71
|
+
ref: (0, _reactcomponents.useMergedRefs)(ref, optionRef),
|
|
72
|
+
'aria-disabled': disabled ? true : undefined,
|
|
73
|
+
id,
|
|
74
|
+
role: 'menuitem',
|
|
75
|
+
...props,
|
|
76
|
+
onClick
|
|
24
77
|
}), {
|
|
25
78
|
elementType: 'div'
|
|
26
|
-
})
|
|
79
|
+
}),
|
|
80
|
+
disabled,
|
|
81
|
+
selected
|
|
27
82
|
};
|
|
28
|
-
};
|
|
83
|
+
};
|
|
84
|
+
function getTextString(text, children) {
|
|
85
|
+
if (text !== undefined) {
|
|
86
|
+
return text;
|
|
87
|
+
}
|
|
88
|
+
let textString = '';
|
|
89
|
+
let hasNonStringChild = false;
|
|
90
|
+
_react.Children.forEach(children, (child)=>{
|
|
91
|
+
if (typeof child === 'string') {
|
|
92
|
+
textString += child;
|
|
93
|
+
} else {
|
|
94
|
+
hasNonStringChild = true;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
// warn if an Option has non-string children and no text prop
|
|
98
|
+
if (hasNonStringChild) {
|
|
99
|
+
// eslint-disable-next-line no-console
|
|
100
|
+
console.warn('Provide a `text` prop to Option components when they contain non-string children.');
|
|
101
|
+
}
|
|
102
|
+
return textString;
|
|
103
|
+
} //# sourceMappingURL=usePromptOption.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["usePromptOption.
|
|
1
|
+
{"version":3,"sources":["usePromptOption.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, slot, useId, useMergedRefs } from '@fluentui/react-components';\nimport { useListboxContext_unstable } from '@fluentui/react-combobox';\nimport { useActiveDescendantContext } from '@fluentui/react-aria';\nimport type { PromptOptionProps, PromptOptionState } from './PromptOption.types';\nimport type { OptionValue } from '../utils/OptionCollection.types';\n\n// If you add JSX to this file, be sure to change the file type to .tsx\n\n/**\n * Create the state required to render PromptOption.\n *\n * The returned state can be modified with hooks such as usePromptOptionStyles_unstable,\n * before being passed to renderPromptOption_unstable.\n *\n * @param props - props from this instance of PromptOption\n * @param ref - reference to root HTMLElement of PromptOption\n */\nexport const usePromptOption_unstable = (\n props: PromptOptionProps,\n ref: React.Ref<HTMLDivElement>,\n): PromptOptionState => {\n const { children, disabled, text, value } = props;\n const optionRef = React.useRef<HTMLDivElement>(null);\n const optionText = getTextString(text, children);\n const optionValue = value ?? optionText;\n\n // use the id if provided, otherwise use a generated id\n const id = useId('fluent-option', props.id);\n\n // data used for context registration & events\n const optionData = React.useMemo<OptionValue>(\n () => ({ id, disabled, text: optionText, value: optionValue }),\n [id, disabled, optionText, optionValue],\n );\n\n // context values\n const { controller: activeDescendantController } = useActiveDescendantContext();\n const registerOption = useListboxContext_unstable(ctx => ctx.registerOption);\n const selected = useListboxContext_unstable(ctx => {\n const selectedOptions = ctx.selectedOptions;\n\n return optionValue !== undefined && selectedOptions.find(o => o === optionValue) !== undefined;\n });\n const selectOption = useListboxContext_unstable(ctx => ctx.selectOption);\n const onOptionClick = useListboxContext_unstable(ctx => ctx.onOptionClick);\n\n const onClick = (event: React.MouseEvent<HTMLDivElement>) => {\n if (disabled) {\n event.preventDefault();\n return;\n }\n\n activeDescendantController.focus(id);\n\n // handle selection change\n selectOption(event, optionData);\n\n onOptionClick(event);\n props.onClick?.(event);\n };\n\n // register option data with context\n React.useEffect(() => {\n if (id && optionRef.current) {\n return registerOption(optionData, optionRef.current);\n }\n }, [id, optionData, registerOption]);\n\n return {\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n ref: useMergedRefs(ref, optionRef),\n 'aria-disabled': disabled ? true : undefined,\n id,\n role: 'menuitem',\n ...props,\n onClick,\n }),\n { elementType: 'div' },\n ),\n disabled,\n selected,\n };\n};\n\nfunction getTextString(text: string | undefined, children: React.ReactNode) {\n if (text !== undefined) {\n return text;\n }\n\n let textString = '';\n let hasNonStringChild = false;\n React.Children.forEach(children, child => {\n if (typeof child === 'string') {\n textString += child;\n } else {\n hasNonStringChild = true;\n }\n });\n\n // warn if an Option has non-string children and no text prop\n if (hasNonStringChild) {\n // eslint-disable-next-line no-console\n console.warn('Provide a `text` prop to Option components when they contain non-string children.');\n }\n\n return textString;\n}\n"],"names":["children","value","props","optionText","disabled","optionValue","text","optionRef","optionData","React","useMemo","id","controller","selected","useListboxContext_unstable","ctx","registerOption","selectedOptions","find","selectOption","onOptionClick","undefined","preventDefault","activeDescendantController","event","onClick","_props_onClick","call","useEffect","current","components","slot","always","getIntrinsicElementProps","root","ref","useMergedRefs","role","getTextString","textString","hasNonStringChild","child","Children","forEach","warn"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAsBUA;;;eAAAA;;;;iEAtBa;iCAC8C;+BAC1B;2BACA;AAmBzC,MAAQA,2BAA0BC,CAAAA,OAAUC;UAC5C,EACAF,QAAMG,EACNC,QAAMC,EAENC,IAAA,EACAL,KAAA,KAEAC;UACAK,YAAMC,OAAaC,MAAMC,CAAAA;uBACdC,cAAAA,MAAAA;wBAAIP,UAAAA,QAAAA,UAAAA,KAAAA,IAAAA,QAAAA;2DAAgBD;eAAYF,IAAAA,sBAAAA,EAAOI,iBAAAA,MAAAA,EAAAA;kDAChD;UAACM,aAAAA,OAAAA,OAAAA,CAAAA,IAAAA,CAAAA;;;kBAA0BN;mBAAYA;YAGzC;QAAAM;QAAAP;QAAiBD;QAAAE;KAAA;qBACTO;UACR,EACAA,YAAMC,0BAAWC,8CACSC;UAExBC,iBAAOX,IAAAA,yCAA6BY,EAAAA,CAAAA,MAAAA,IAAgBC,cAAgBb;UACtEQ,WAAAC,IAAAA,yCAAA,EAAAC,CAAAA;QACA,MAAMI,kBAAeL,IAAAA,eAAAA;QACrB,OAAMM,gBAAgBN,aAAAA,gBAA2BC,IAAOA,CAAAA,CAAAA,IAAIK,MAAAA,iBAAaC;;yBAcvEnB,IAAAA,yCAAAA,EAAAA,CAAAA,MAAAA,IAAAA,YAAAA;UAXAkB,gBAAcN,IAAAA,yCAAA,EAAAC,CAAAA,MAAAA,IAAAK,aAAA;oBACNE,CAAAA;;YAERlB,UAAA;kBAEAmB,cAAAA;;;mCAKcC,KAAAA,CAAAA;kCACdtB;QACFiB,aAAAK,OAAAhB;QAEAY,cAAAI;QACAf,CAAAA,iBAAgBP,MAAAuB,OAAA,MAAA,QAAAC,mBAAA,KAAA,IAAA,KAAA,IAAAA,eAAAC,IAAA,CAAAzB,OAAAsB;;wCAEUhB;WACxBoB,SAAA,CAAA;QACF,IAAGjB,MAAAJ,UAAAsB,OAAA,EAAA;mBAAClB,eAAAA,YAAAA,UAAAA,OAAAA;;;;QAAgBK;QAAAA;KAAAA;WAAe;QAEnCc,YAAO;kBACLA;;cAEAC,qBAAA,CAAAC,MAAA,CAAAC,IAAAA,yCAAA,EAAA,OAAA;iBACAC,IAAAA,8BAAWF,EAAMG,KACfF;6BACOG,WAAcD,OAAK5B;;kBAExBI;oBACA0B;;;yBAIF;;;;;;AAKN,SAAEC,cAAAhC,IAAA,EAAAN,QAAA;IAEF,IAAAM,SAASgC,WAAchC;QACrB,OAAIA;;QAEJiC,aAAA;QAEAC,oBAAiB;WACbA,QAAAA,CAAAA,OAAAA,CAAAA,UAAoBC,CAAAA;QACxBhC,IAAAA,OAAMiC,UAASC,UAAQ3C;0BACVyC;;gCAEJ;;;iEAGT;QAEAD,mBAAA;QACA,sCAAuB;gBACrBI,IAAA,CAAA;;WAEFL;EAGF,2CAAA"}
|
|
@@ -23,13 +23,187 @@ const promptOptionClassNames = {
|
|
|
23
23
|
/**
|
|
24
24
|
* Styles for the root slot
|
|
25
25
|
*/ const useStyles = (0, _reactcomponents.__styles)({
|
|
26
|
-
root: {
|
|
27
|
-
|
|
26
|
+
root: {
|
|
27
|
+
Bt984gj: "f122n59",
|
|
28
|
+
Bbmb7ep: [
|
|
29
|
+
"f1aa9q02",
|
|
30
|
+
"f16jpd5f"
|
|
31
|
+
],
|
|
32
|
+
Beyfa6y: [
|
|
33
|
+
"f16jpd5f",
|
|
34
|
+
"f1aa9q02"
|
|
35
|
+
],
|
|
36
|
+
B7oj6ja: [
|
|
37
|
+
"f1jar5jt",
|
|
38
|
+
"fyu767a"
|
|
39
|
+
],
|
|
40
|
+
Btl43ni: [
|
|
41
|
+
"fyu767a",
|
|
42
|
+
"f1jar5jt"
|
|
43
|
+
],
|
|
44
|
+
sj55zd: "f19n0e5",
|
|
45
|
+
i8kkvl: "f1ufnopg",
|
|
46
|
+
Bceei9c: "f1k6fduh",
|
|
47
|
+
mc9l5x: "f22iagw",
|
|
48
|
+
Bahqtrf: "fk6fouc",
|
|
49
|
+
Be2twd7: "fkhj508",
|
|
50
|
+
Bg96gwp: "f1i3iumi",
|
|
51
|
+
z8tnut: "fp2oml8",
|
|
52
|
+
z189sj: [
|
|
53
|
+
"f1vdfbxk",
|
|
54
|
+
"f1f5gg8d"
|
|
55
|
+
],
|
|
56
|
+
Byoj8tv: "f1tdddsa",
|
|
57
|
+
uwmqm3: [
|
|
58
|
+
"f1f5gg8d",
|
|
59
|
+
"f1vdfbxk"
|
|
60
|
+
],
|
|
61
|
+
qhf8xq: "f10pi13n",
|
|
62
|
+
Jwef8y: "f1knas48",
|
|
63
|
+
Bi91k9c: "feu1g3u",
|
|
64
|
+
ecr2s2: "fb40n2d",
|
|
65
|
+
lj723h: "f1g4hkjv"
|
|
66
|
+
},
|
|
67
|
+
active: {
|
|
68
|
+
Bowz1zl: "f11vrvdw",
|
|
69
|
+
oxogb1: "f17hxjb7",
|
|
70
|
+
Ix2sn8: "f1dha69c",
|
|
71
|
+
q7v32p: "f1lm7500",
|
|
72
|
+
Bqfxd14: "f1n5bo3l",
|
|
73
|
+
B53xpsf: [
|
|
74
|
+
"fp57yr3",
|
|
75
|
+
"f48q4c"
|
|
76
|
+
],
|
|
77
|
+
B1wzb3v: "fg547j0",
|
|
78
|
+
f0sref: [
|
|
79
|
+
"f48q4c",
|
|
80
|
+
"fp57yr3"
|
|
81
|
+
],
|
|
82
|
+
Btq9bd3: "fuyp35s",
|
|
83
|
+
Bertapg: [
|
|
84
|
+
"f1a9nstl",
|
|
85
|
+
"fhk0hgg"
|
|
86
|
+
],
|
|
87
|
+
b50fsz: "f1rdp6f1",
|
|
88
|
+
avt0cx: [
|
|
89
|
+
"fhk0hgg",
|
|
90
|
+
"f1a9nstl"
|
|
91
|
+
],
|
|
92
|
+
B39dzdd: "ffd7rjx",
|
|
93
|
+
Be3o27t: [
|
|
94
|
+
"fobu5kn",
|
|
95
|
+
"f1dbet5w"
|
|
96
|
+
],
|
|
97
|
+
Bewtojm: "f1ap9jj5",
|
|
98
|
+
B37u8z8: [
|
|
99
|
+
"f1dbet5w",
|
|
100
|
+
"fobu5kn"
|
|
101
|
+
],
|
|
102
|
+
Bttcd12: [
|
|
103
|
+
"ftb4b3e",
|
|
104
|
+
"f1scq65d"
|
|
105
|
+
],
|
|
106
|
+
Fffuxt: [
|
|
107
|
+
"f1scq65d",
|
|
108
|
+
"ftb4b3e"
|
|
109
|
+
],
|
|
110
|
+
Bqougee: [
|
|
111
|
+
"f2me9eq",
|
|
112
|
+
"fgk4qqi"
|
|
113
|
+
],
|
|
114
|
+
Beitzug: [
|
|
115
|
+
"fgk4qqi",
|
|
116
|
+
"f2me9eq"
|
|
117
|
+
],
|
|
118
|
+
Bhijsxg: "fwq15dy",
|
|
119
|
+
kktds4: "f1pb3wry",
|
|
120
|
+
Bmau3bo: [
|
|
121
|
+
"ftjv2f4",
|
|
122
|
+
"f1flhb1f"
|
|
123
|
+
],
|
|
124
|
+
npektv: [
|
|
125
|
+
"f1flhb1f",
|
|
126
|
+
"ftjv2f4"
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
disabled: {
|
|
130
|
+
sj55zd: "f1s2aq7o",
|
|
131
|
+
Jwef8y: "f9ql6rf",
|
|
132
|
+
Bi91k9c: "fvgxktp",
|
|
133
|
+
ecr2s2: "fgj9um3",
|
|
134
|
+
lj723h: "f19wldhg",
|
|
135
|
+
B7iucu3: "f1cyfu5x"
|
|
136
|
+
}
|
|
137
|
+
}, {
|
|
138
|
+
d: [
|
|
139
|
+
".f122n59{align-items:center;}",
|
|
140
|
+
".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}",
|
|
141
|
+
".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}",
|
|
142
|
+
".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}",
|
|
143
|
+
".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}",
|
|
144
|
+
".f19n0e5{color:var(--colorNeutralForeground1);}",
|
|
145
|
+
".f1ufnopg{column-gap:var(--spacingHorizontalXS);}",
|
|
146
|
+
".f1k6fduh{cursor:pointer;}",
|
|
147
|
+
".f22iagw{display:flex;}",
|
|
148
|
+
".fk6fouc{font-family:var(--fontFamilyBase);}",
|
|
149
|
+
".fkhj508{font-size:var(--fontSizeBase300);}",
|
|
150
|
+
".f1i3iumi{line-height:var(--lineHeightBase300);}",
|
|
151
|
+
".fp2oml8{padding-top:var(--spacingVerticalSNudge);}",
|
|
152
|
+
".f1vdfbxk{padding-right:var(--spacingHorizontalS);}",
|
|
153
|
+
".f1f5gg8d{padding-left:var(--spacingHorizontalS);}",
|
|
154
|
+
".f1tdddsa{padding-bottom:var(--spacingVerticalSNudge);}",
|
|
155
|
+
".f10pi13n{position:relative;}",
|
|
156
|
+
".f11vrvdw[data-activedescendant-focusvisible]::after{content:\"\";}",
|
|
157
|
+
".f17hxjb7[data-activedescendant-focusvisible]::after{position:absolute;}",
|
|
158
|
+
".f1dha69c[data-activedescendant-focusvisible]::after{pointer-events:none;}",
|
|
159
|
+
".f1lm7500[data-activedescendant-focusvisible]::after{z-index:1;}",
|
|
160
|
+
".f1n5bo3l[data-activedescendant-focusvisible]::after{border-top-width:var(--strokeWidthThick);}",
|
|
161
|
+
".fp57yr3[data-activedescendant-focusvisible]::after{border-right-width:var(--strokeWidthThick);}",
|
|
162
|
+
".f48q4c[data-activedescendant-focusvisible]::after{border-left-width:var(--strokeWidthThick);}",
|
|
163
|
+
".fg547j0[data-activedescendant-focusvisible]::after{border-bottom-width:var(--strokeWidthThick);}",
|
|
164
|
+
".fuyp35s[data-activedescendant-focusvisible]::after{border-top-style:solid;}",
|
|
165
|
+
".f1a9nstl[data-activedescendant-focusvisible]::after{border-right-style:solid;}",
|
|
166
|
+
".fhk0hgg[data-activedescendant-focusvisible]::after{border-left-style:solid;}",
|
|
167
|
+
".f1rdp6f1[data-activedescendant-focusvisible]::after{border-bottom-style:solid;}",
|
|
168
|
+
".ffd7rjx[data-activedescendant-focusvisible]::after{border-top-color:var(--colorStrokeFocus2);}",
|
|
169
|
+
".fobu5kn[data-activedescendant-focusvisible]::after{border-right-color:var(--colorStrokeFocus2);}",
|
|
170
|
+
".f1dbet5w[data-activedescendant-focusvisible]::after{border-left-color:var(--colorStrokeFocus2);}",
|
|
171
|
+
".f1ap9jj5[data-activedescendant-focusvisible]::after{border-bottom-color:var(--colorStrokeFocus2);}",
|
|
172
|
+
".ftb4b3e[data-activedescendant-focusvisible]::after{border-bottom-right-radius:var(--borderRadiusMedium);}",
|
|
173
|
+
".f1scq65d[data-activedescendant-focusvisible]::after{border-bottom-left-radius:var(--borderRadiusMedium);}",
|
|
174
|
+
".f2me9eq[data-activedescendant-focusvisible]::after{border-top-right-radius:var(--borderRadiusMedium);}",
|
|
175
|
+
".fgk4qqi[data-activedescendant-focusvisible]::after{border-top-left-radius:var(--borderRadiusMedium);}",
|
|
176
|
+
".fwq15dy[data-activedescendant-focusvisible]::after{top:-2px;}",
|
|
177
|
+
".f1pb3wry[data-activedescendant-focusvisible]::after{bottom:-2px;}",
|
|
178
|
+
".ftjv2f4[data-activedescendant-focusvisible]::after{left:-2px;}",
|
|
179
|
+
".f1flhb1f[data-activedescendant-focusvisible]::after{right:-2px;}",
|
|
180
|
+
".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}"
|
|
181
|
+
],
|
|
182
|
+
h: [
|
|
183
|
+
".f1knas48:hover{background-color:var(--colorNeutralBackground1Hover);}",
|
|
184
|
+
".feu1g3u:hover{color:var(--colorNeutralForeground1Hover);}",
|
|
185
|
+
".f9ql6rf:hover{background-color:var(--colorTransparentBackground);}",
|
|
186
|
+
".fvgxktp:hover{color:var(--colorNeutralForegroundDisabled);}"
|
|
187
|
+
],
|
|
188
|
+
a: [
|
|
189
|
+
".fb40n2d:active{background-color:var(--colorNeutralBackground1Pressed);}",
|
|
190
|
+
".f1g4hkjv:active{color:var(--colorNeutralForeground1Pressed);}",
|
|
191
|
+
".fgj9um3:active{background-color:var(--colorTransparentBackground);}",
|
|
192
|
+
".f19wldhg:active{color:var(--colorNeutralForegroundDisabled);}"
|
|
193
|
+
],
|
|
194
|
+
m: [
|
|
195
|
+
[
|
|
196
|
+
"@media (forced-colors: active){.f1cyfu5x{color:GrayText;}}",
|
|
197
|
+
{
|
|
198
|
+
m: "(forced-colors: active)"
|
|
199
|
+
}
|
|
200
|
+
]
|
|
201
|
+
]
|
|
202
|
+
});
|
|
28
203
|
const usePromptOptionStyles_unstable = (state)=>{
|
|
29
204
|
'use no memo';
|
|
205
|
+
const { disabled } = state;
|
|
30
206
|
const styles = useStyles();
|
|
31
|
-
state.root.className = (0, _reactcomponents.mergeClasses)(promptOptionClassNames.root, styles.root, state.root.className);
|
|
32
|
-
// TODO Add class names to slots, for example:
|
|
33
|
-
// state.mySlot.className = mergeClasses(styles.mySlot, state.mySlot.className);
|
|
207
|
+
state.root.className = (0, _reactcomponents.mergeClasses)(promptOptionClassNames.root, styles.root, styles.active, disabled && styles.disabled, state.root.className);
|
|
34
208
|
return state;
|
|
35
209
|
}; //# sourceMappingURL=usePromptOptionStyles.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["usePromptOptionStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@fluentui/react-components';\nimport type { PromptOptionSlots, PromptOptionState } from './PromptOption.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const promptOptionClassNames: SlotClassNames<PromptOptionSlots> = {\n root: 'fai-PromptOption',\n
|
|
1
|
+
{"version":3,"sources":["usePromptOptionStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands, tokens } from '@fluentui/react-components';\nimport { ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE } from '@fluentui/react-aria';\nimport type { PromptOptionSlots, PromptOptionState } from './PromptOption.types';\nimport type { SlotClassNames } from '@fluentui/react-components';\n\nexport const promptOptionClassNames: SlotClassNames<PromptOptionSlots> = {\n root: 'fai-PromptOption',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n alignItems: 'center',\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n color: tokens.colorNeutralForeground1,\n columnGap: tokens.spacingHorizontalXS,\n cursor: 'pointer',\n display: 'flex',\n fontFamily: tokens.fontFamilyBase,\n fontSize: tokens.fontSizeBase300,\n lineHeight: tokens.lineHeightBase300,\n ...shorthands.padding(tokens.spacingVerticalSNudge, tokens.spacingHorizontalS),\n position: 'relative',\n\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n color: tokens.colorNeutralForeground1Hover,\n },\n\n ':active': {\n backgroundColor: tokens.colorNeutralBackground1Pressed,\n color: tokens.colorNeutralForeground1Pressed,\n },\n },\n\n active: {\n [`[${ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE}]::after`]: {\n content: '\"\"',\n position: 'absolute',\n pointerEvents: 'none',\n zIndex: 1,\n\n ...shorthands.border(tokens.strokeWidthThick, `solid`, tokens.colorStrokeFocus2),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n\n top: '-2px',\n bottom: '-2px',\n left: '-2px',\n right: '-2px',\n },\n },\n\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n\n ':hover': {\n backgroundColor: tokens.colorTransparentBackground,\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n ':active': {\n backgroundColor: tokens.colorTransparentBackground,\n color: tokens.colorNeutralForegroundDisabled,\n },\n\n '@media (forced-colors: active)': {\n color: 'GrayText',\n },\n },\n});\n\n/**\n * Apply styling to the PromptOption slots based on the state\n */\nexport const usePromptOptionStyles_unstable = (state: PromptOptionState): PromptOptionState => {\n 'use no memo';\n\n const { disabled } = state;\n const styles = useStyles();\n state.root.className = mergeClasses(\n promptOptionClassNames.root,\n styles.root,\n styles.active,\n disabled && styles.disabled,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["promptOptionClassNames","root","__styles","alignItems","shorthands","color","colorNeutralForeground1","columnGap","spacingHorizontalXS","cursor","display","fontFamily","fontSize","lineHeight","position","backgroundColor","colorNeutralBackground1Pressed","Bi91k9c","active","pointerEvents","zIndex","top","bottom","left","right","Bertapg","disabled","colorNeutralForegroundDisabled","colorTransparentBackground","tokens","npektv","Jwef8y","ecr2s2","lj723h","styles","state"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAKaA,sBAAAA;eAAAA;;;;;;iCALwC;AAK9C,MAAMA,yBAA4D;UACvEC;AACF;AAEA;;CAEC,SAECA,YAAMC,IAAAA,yBAAA,EAAA;UACJC;iBACGC;iBACHC;YAAAA;YAAcC;SAAAA;iBACdC;YAAAA;YAAkBC;SAAAA;iBAClBC;YAAAA;YAAQ;SAAA;iBACRC;YAAAA;YAAS;SAAA;gBACTC;gBACAC;iBACAC;gBACGT;iBACHU;iBAEA;iBACEC;gBACAV;gBACF;YAAA;YAAA;SAAA;iBAEA;gBACEU;YAAAA;YAAAA;SAAwBC;gBACxBX;gBACF;QACFY,SAAA;QAEAC,QAAQ;gBACH;;;iBAGDC;gBACAC;gBAEA;gBACA;iBAEAC;iBACAC;YAAAA;YAAQ;SAAA;iBACRC;gBACAC;YAAAA;YAAO;SAAA;iBACT;QACFC,SAAA;YAAA;YAAA;SAAA;QAEAC,QAAAA;gBACErB;YAAAA;YAAcsB;SAAAA;iBAEd;iBACEZ;YAAAA;YAAAA;SAAwBa;iBACxBvB;iBACF;YAAA;YAAA;SAAA;iBAEA;YAAA;YAAW;SAAA;gBACTU;YAAAA;YAAAA;SAAiBc;iBACjBxB;YAAAA;YAAOwB;SAAOF;iBAChB;YAAA;YAAA;SAAA;iBAEA;gBACEtB;iBACF;YAAA;YAAA;SAAA;QACFyB,QAAA;YAAA;YAAA;SAAA;IACF;IAEAJ,UAAA;;QAGAK,QAAO;QACLd,SAAA;QAEAe,QAAQN;QACRO,QAAMC;QACNC,SAAMlC;;AASR,GAAE"}
|
|
@@ -11,7 +11,6 @@ Object.defineProperty(exports, "usePromptListboxFunctionality", {
|
|
|
11
11
|
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
12
12
|
const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
|
|
13
13
|
const _reactaria = require("@fluentui/react-aria");
|
|
14
|
-
const _reactcomponents = require("@fluentui/react-components");
|
|
15
14
|
const _reactutilities = require("@fluentui/react-utilities");
|
|
16
15
|
const _dropdownKeyActions = require("./dropdownKeyActions");
|
|
17
16
|
const _TextCursorPositionPlugin = require("../../plugins/TextCursorPositionPlugin");
|
|
@@ -21,10 +20,11 @@ const _keyboardkeys = require("@fluentui/keyboard-keys");
|
|
|
21
20
|
const _useComboboxPositioning = require("./useComboboxPositioning");
|
|
22
21
|
const _useTriggerKeyDown = require("./useTriggerKeyDown");
|
|
23
22
|
const _PromptListbox = require("../PromptListbox");
|
|
23
|
+
const _PromptOption = require("../PromptOption");
|
|
24
24
|
function usePromptListboxFunctionality(params) {
|
|
25
25
|
const { positioning, onOpenChange, onSelectionModeChange, listboxProps } = params;
|
|
26
26
|
const { listboxRef: activeDescendantListboxRef, activeParentRef, controller: activeDescendantController } = (0, _reactaria.useActiveDescendant)({
|
|
27
|
-
matchOption: (el)=>el.classList.contains(
|
|
27
|
+
matchOption: (el)=>el.classList.contains(_PromptOption.promptOptionClassNames.root)
|
|
28
28
|
});
|
|
29
29
|
// useMergedRefs to normalize the ref into a React.RefObject type
|
|
30
30
|
const triggerRef = (0, _reactutilities.useMergedRefs)(activeParentRef);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["usePromptListboxFunctionality.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useActiveDescendant } from '@fluentui/react-aria';\nimport {
|
|
1
|
+
{"version":3,"sources":["usePromptListboxFunctionality.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useActiveDescendant } from '@fluentui/react-aria';\nimport { mergeCallbacks, useControllableState, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { getDropdownActionFromKey } from './dropdownKeyActions';\nimport { TextCursorPositionPlugin } from '../../plugins/TextCursorPositionPlugin';\nimport { useOptionCollection } from './useOptionCollection';\nimport { useSelection } from './useSelection';\nimport { ArrowDown, ArrowLeft, ArrowRight, ArrowUp } from '@fluentui/keyboard-keys';\nimport { useComboboxPositioning } from './useComboboxPositioning';\nimport { useTriggerKeydown } from './useTriggerKeyDown';\nimport { PromptListbox } from '../PromptListbox';\nimport { promptOptionClassNames } from '../PromptOption';\nimport type { EditorInputProps } from '@fluentui-copilot/react-editor-input';\nimport type {\n UsePromptListboxFunctionalityParams,\n UsePromptListboxFunctionality,\n} from './PromptListboxFunctionality.types';\n\nexport function usePromptListboxFunctionality(\n params: UsePromptListboxFunctionalityParams,\n): UsePromptListboxFunctionality {\n const { positioning, onOpenChange, onSelectionModeChange, listboxProps } = params;\n const {\n listboxRef: activeDescendantListboxRef,\n activeParentRef,\n controller: activeDescendantController,\n } = useActiveDescendant<HTMLSpanElement, HTMLDivElement>({\n matchOption: el => el.classList.contains(promptOptionClassNames.root),\n });\n // useMergedRefs to normalize the ref into a React.RefObject type\n const triggerRef = useMergedRefs(activeParentRef);\n const selectionState = useSelection(listboxProps ?? {});\n const { selectOption } = selectionState;\n const optionCollection = useOptionCollection();\n const { getOptionById } = optionCollection;\n const [isInLastPosition, setIsInLastPosition] = React.useState(true);\n const [isInSelectionMode, setIsInSelectionMode] = React.useState(false);\n const [open, setOpen] = useControllableState({\n state: params.open,\n defaultState: params.defaultOpen,\n initialState: false,\n });\n\n const onBlur = (event: React.FocusEvent<HTMLSpanElement>) => {\n setOpen(false);\n onOpenChange?.(event, { event, type: 'focus', open: false });\n };\n\n const onFocus = (event: React.FocusEvent<HTMLSpanElement>) => {\n if (event.target === event.currentTarget) {\n setOpen(true);\n onOpenChange?.(event, { event, type: 'focus', open: true });\n }\n };\n\n const cursorPositionPlugin = <TextCursorPositionPlugin setIsInLastPosition={setIsInLastPosition} />;\n\n const onListboxBlur = React.useCallback(() => {\n setIsInSelectionMode(false);\n onSelectionModeChange?.(false);\n }, [onSelectionModeChange]);\n\n // handle combobox keyboard interaction\n const onKeyDown = useTriggerKeydown({\n ...optionCollection,\n activeDescendantController,\n getOptionById,\n onBlur: onListboxBlur,\n selectOption,\n isInLastPosition,\n open,\n multiselect: false,\n });\n\n // NVDA and JAWS have bugs that suppress reading the input value text when aria-activedescendant is set\n // To prevent this, we clear the HTML attribute (but save the state) when a user presses left/right arrows\n // ref: https://github.com/microsoft/fluentui/issues/26359#issuecomment-1397759888\n const [hideActiveDescendant, setHideActiveDescendant] = React.useState(false);\n\n /**\n * Freeform combobox should not select\n */\n const onInputTriggerKeyDown: EditorInputProps['onKeyDown'] = useEventCallback(event => {\n // update typing state to true if the user is typing\n const action = getDropdownActionFromKey(event, { open, multiselect: false, isInLastPosition });\n if (\n event.key === ArrowLeft ||\n event.key === ArrowRight ||\n (!isInLastPosition && (event.key === ArrowDown || event.key === ArrowUp)) ||\n (action === 'Type' && isInLastPosition) ||\n action === 'Type'\n ) {\n activeDescendantController.blur();\n setHideActiveDescendant(true);\n setIsInSelectionMode(false);\n onSelectionModeChange?.(false);\n } else if (\n action === 'Next' ||\n action === 'Previous' ||\n action === 'First' ||\n action === 'Last' ||\n action === 'PageUp' ||\n action === 'PageDown'\n ) {\n setHideActiveDescendant(false);\n setIsInSelectionMode(true);\n onSelectionModeChange?.(true);\n }\n });\n\n React.useEffect(() => {\n if (hideActiveDescendant) {\n triggerRef.current?.removeAttribute('aria-activedescendant');\n }\n // We only want to run this when the hideActiveDescendant changes, if the triggerRef\n // is undefined, there's no need to remove theAttribute and we shouldn't be adding\n // refs as dependencies since it can blow up the number of runs.\n // eslint-disable-next-line react-compiler/react-compiler\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [hideActiveDescendant]);\n\n const [comboboxPopupRef, comboboxTargetRef] = useComboboxPositioning({ positioning });\n\n const listboxMergedRef = useMergedRefs(comboboxPopupRef, activeDescendantListboxRef, listboxProps?.ref);\n const listbox = React.useMemo(() => {\n return (\n <PromptListbox\n open={open}\n {...listboxProps}\n {...optionCollection}\n {...selectionState}\n ref={listboxMergedRef}\n activeDescendantController={activeDescendantController}\n />\n );\n }, [activeDescendantController, listboxMergedRef, listboxProps, open, optionCollection, selectionState]);\n\n return {\n promptListbox: listbox,\n triggerProps: {\n ref: triggerRef,\n onBlur,\n onFocus,\n onKeyDown: useEventCallback(mergeCallbacks(onKeyDown, onInputTriggerKeyDown)),\n isInSelectionMode,\n },\n containerRef: comboboxTargetRef,\n cursorPositionPlugin,\n };\n}\n"],"names":["usePromptListboxFunctionality","params","positioning","listboxRef","matchOption","onSelectionModeChange","listboxProps","selectOption","selectionState","activeParentRef","optionCollection","controller","getOptionById","useActiveDescendant","isInLastPosition","isInSelectionMode","setIsInSelectionMode","useState","root","defaultState","defaultOpen","initialState","useSelection","onBlur","onOpenChange","type","setIsInLastPosition","React","open","onFocus","event","target","setOpen","cursorPositionPlugin","onListboxBlur","currentTarget","onKeyDown","useTriggerKeydown","activeDescendantController","onInputTriggerKeyDown","useEventCallback","action","hideActiveDescendant","key","ArrowRight","ArrowDown","ArrowUp","triggerRef","setHideActiveDescendant","useEffect","comboboxTargetRef","_triggerRef_current","current","removeAttribute","PromptListbox","listboxMergedRef","useMergedRefs","comboboxPopupRef","activeDescendantListboxRef","ref","containerRef"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAkBgBA;;;eAAAA;;;;iEAlBO;2BACa;gCACkD;oCAC7C;0CACA;qCACL;8BACP;8BAC6B;wCACnB;mCACL;+BACJ;8BACS;AAOhC,SAASA,8BACdC,MAA2C;UAE3C,EACAC,WACEC,cAIAC,EACFC,qBAAA,EACAC,YAAA,KACAL;UACA,EACAE,YAAQI,0BAAiBC,EACzBC,eAAMC,EACNC,YAAQC,0BAAkBF,KAC1BG,IAAAA,8BAAOC,EAAAA;QACPV,aAAOW,CAAAA,KAAAA,GAAAA,SAAmBC,CAAAA,QAAAA,CAAAA,oCAA8BC,CAAQC,IAAC;;qEAE7C;UAClBC,aAAAA,IAAAA,6BAAqBC,EAAAA;UACrBC,iBAAcC,IAAAA,0BAAA,EAAAhB,iBAAA,QAAAA,iBAAA,KAAA,IAAAA,eAAA,CAAA;UAChB,EAEAC,YAAMgB;UAEJC,mBAAAA,IAAAA,wCAAAA;yBAA+BC;UAA2B,CAAAX,kBAAAY,oBAAA,GAAAC,OAAAV,QAAA,CAAA;UAC5D,CAAAF,mBAAAC,qBAAA,GAAAW,OAAAV,QAAA,CAAA;UAEA,CAAAW,MAAMC,QAAWC,GAAAA,IAAAA,oCAAAA,EAAAA;eACf7B,OAAU8B,IAAAA;sBACRC,OAAQZ,WAAA;sBACRI;;mBAA+BC,CAAAA;;yBAA0B,QAAAD,iBAAA,KAAA,IAAA,KAAA,IAAAA,aAAAM,OAAA;;YAE7DL,MAAA;YAEAG,MAAMK;;;UAENJ,UAAMK,CAAAA;YACJlB,MAAA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,WAAAK,OAAA,MAAA,QAAAD,wBAAA,KAAA,IAAA,KAAA,IAAAA,oBAAAE,eAAA,CAAA;QAEnF;IACA,oFAA8B;sFAEzBC;oEACO1B;6DACU;2DACI;;;KAChBpB;6BACC+C,kBAAAA,GAAAA,IAAAA,8CAAAA,EAAAA;;;UAIRA,mBAAAC,IAAAA,6BAAA,EAAAC,kBAAAC,4BAAApD,iBAAA,QAAAA,iBAAA,KAAA,IAAA,KAAA,IAAAA,aAAAqD,GAAA;UAACrB,UAAAA,OAAAA,OAAAA,CAAAA;eAA4BiB,WAAAA,GAAAA,OAAAA,aAAAA,CAAAA,4BAAAA,EAAAA;kBAAkBjD;eAAcsB,YAAAA;eAAMlB,gBAAAA;eAAkBF,cAAAA;YAAemD,KAAAJ;YAEvGjB,4BAAOA;;;;QAESiB;QAAAjD;QAAAsB;QAAAlB;QAAAF;KAAA;;uBAEZe;sBACAM;;;;uBAIF+B,IAAAA,gCAAcV,EAAAA,IAAAA,8BAAAA,EAAAA,WAAAA;;QAEhB;QACFU,cAAAV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["index.ts"],"sourcesContent":["export type { PromptListboxProps, PromptListboxSlots, PromptListboxState } from './PromptListbox';\nexport {\n PromptListbox,\n promptListboxClassNames,\n renderPromptListbox_unstable,\n usePromptListboxStyles_unstable,\n usePromptListbox_unstable,\n} from './PromptListbox';\n\nexport { usePromptListboxFunctionality } from './components/utils/usePromptListboxFunctionality';\nexport type {\n OnOpenChangeData,\n ProcessedPromptListboxProps,\n UsePromptListboxFunctionality,\n UsePromptListboxFunctionalityParams,\n} from './components/utils/PromptListboxFunctionality.types';\n\nexport type { TextCursorPositionPluginProps } from './plugins/TextCursorPositionPlugin';\nexport { TextCursorPositionPlugin } from './plugins/TextCursorPositionPlugin';\n\nexport type { PromptOptionProps, PromptOptionSlots, PromptOptionState } from './PromptOption';\nexport {
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export type { PromptListboxProps, PromptListboxSlots, PromptListboxState } from './PromptListbox';\nexport {\n PromptListbox,\n promptListboxClassNames,\n renderPromptListbox_unstable,\n usePromptListboxStyles_unstable,\n usePromptListbox_unstable,\n} from './PromptListbox';\n\nexport { usePromptListboxFunctionality } from './components/utils/usePromptListboxFunctionality';\nexport type {\n OnOpenChangeData,\n ProcessedPromptListboxProps,\n UsePromptListboxFunctionality,\n UsePromptListboxFunctionalityParams,\n} from './components/utils/PromptListboxFunctionality.types';\n\nexport type { TextCursorPositionPluginProps } from './plugins/TextCursorPositionPlugin';\nexport { TextCursorPositionPlugin } from './plugins/TextCursorPositionPlugin';\n\nexport type { PromptOptionProps, PromptOptionSlots, PromptOptionState } from './PromptOption';\nexport {\n PromptOption,\n promptOptionClassNames,\n renderPromptOption_unstable,\n usePromptOptionStyles_unstable,\n usePromptOption_unstable,\n} from './PromptOption';\n"],"names":["PromptListbox","PromptOption","TextCursorPositionPlugin","promptListboxClassNames","promptOptionClassNames","renderPromptListbox_unstable","renderPromptOption_unstable","usePromptListboxFunctionality","usePromptListboxStyles_unstable","usePromptListbox_unstable","usePromptOptionStyles_unstable","usePromptOption_unstable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAEEA,aAAa;eAAbA,4BAAa;;IAoBbC,YAAY;eAAZA,0BAAY;;IAJLC,wBAAwB;eAAxBA,kDAAwB;;IAf/BC,uBAAuB;eAAvBA,sCAAuB;;IAoBvBC,sBAAsB;eAAtBA,oCAAsB;;IAnBtBC,4BAA4B;eAA5BA,2CAA4B;;IAoB5BC,2BAA2B;eAA3BA,yCAA2B;;IAfpBC,6BAA6B;eAA7BA,4DAA6B;;IAJpCC,+BAA+B;eAA/BA,8CAA+B;;IAC/BC,yBAAyB;eAAzBA,wCAAyB;;IAmBzBC,8BAA8B;eAA9BA,4CAA8B;;IAC9BC,wBAAwB;eAAxBA,sCAAwB;;;+BAnBnB;+CAEuC;0CASL;8BASlC"}
|