@fluentui-copilot/react-prompt-listbox 0.8.1-hotfix.1 → 0.8.1-hotfix.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/CHANGELOG.json +4 -4
  2. package/CHANGELOG.md +5 -5
  3. package/lib/PromptListbox.js +1 -0
  4. package/lib/PromptOption.js +1 -0
  5. package/lib/components/PromptListbox/PromptListbox.js +7 -5
  6. package/lib/components/PromptListbox/PromptListbox.types.js +2 -1
  7. package/lib/components/PromptListbox/index.js +1 -0
  8. package/lib/components/PromptListbox/renderPromptListbox.js +21 -17
  9. package/lib/components/PromptListbox/usePromptListbox.js +67 -53
  10. package/lib/components/PromptListbox/usePromptListboxContextValues.js +30 -22
  11. package/lib/components/PromptListbox/usePromptListboxStyles.styles.raw.js +25 -21
  12. package/lib/components/PromptOption/PromptOption.js +6 -4
  13. package/lib/components/PromptOption/PromptOption.types.js +2 -1
  14. package/lib/components/PromptOption/index.js +1 -0
  15. package/lib/components/PromptOption/renderPromptOption.js +6 -4
  16. package/lib/components/PromptOption/usePromptOption.js +84 -84
  17. package/lib/components/PromptOption/usePromptOptionStyles.styles.raw.js +60 -54
  18. package/lib/components/motion/PromptListboxMotion.js +50 -52
  19. package/lib/components/utils/OptionCollection.types.js +2 -1
  20. package/lib/components/utils/PromptListboxFunctionality.types.js +2 -1
  21. package/lib/components/utils/Selection.types.js +2 -1
  22. package/lib/components/utils/dropdownKeyActions.js +60 -49
  23. package/lib/components/utils/useListboxPositioning.js +24 -22
  24. package/lib/components/utils/useOptionCollection.js +32 -30
  25. package/lib/components/utils/usePromptListboxFunctionality.js +123 -121
  26. package/lib/components/utils/usePromptListboxFunctionalityV2.js +124 -109
  27. package/lib/components/utils/useSelection.js +49 -57
  28. package/lib/components/utils/useTriggerKeyDown.js +133 -124
  29. package/lib/index.js +1 -0
  30. package/lib/plugins/CursorPositionPlugin.js +39 -39
  31. package/lib-commonjs/PromptListbox.js +1 -0
  32. package/lib-commonjs/PromptOption.js +1 -0
  33. package/lib-commonjs/components/PromptListbox/PromptListbox.js +1 -1
  34. package/lib-commonjs/components/PromptListbox/PromptListbox.js.map +1 -1
  35. package/lib-commonjs/components/PromptListbox/PromptListbox.types.js +1 -0
  36. package/lib-commonjs/components/PromptListbox/index.js +1 -0
  37. package/lib-commonjs/components/PromptListbox/renderPromptListbox.js +1 -1
  38. package/lib-commonjs/components/PromptListbox/renderPromptListbox.js.map +1 -1
  39. package/lib-commonjs/components/PromptListbox/usePromptListbox.js +1 -1
  40. package/lib-commonjs/components/PromptListbox/usePromptListbox.js.map +1 -1
  41. package/lib-commonjs/components/PromptListbox/usePromptListboxContextValues.js +1 -1
  42. package/lib-commonjs/components/PromptListbox/usePromptListboxContextValues.js.map +1 -1
  43. package/lib-commonjs/components/PromptListbox/usePromptListboxStyles.styles.raw.js +1 -1
  44. package/lib-commonjs/components/PromptListbox/usePromptListboxStyles.styles.raw.js.map +1 -1
  45. package/lib-commonjs/components/PromptOption/PromptOption.js +1 -1
  46. package/lib-commonjs/components/PromptOption/PromptOption.js.map +1 -1
  47. package/lib-commonjs/components/PromptOption/PromptOption.types.js +1 -0
  48. package/lib-commonjs/components/PromptOption/index.js +1 -0
  49. package/lib-commonjs/components/PromptOption/renderPromptOption.js +1 -1
  50. package/lib-commonjs/components/PromptOption/renderPromptOption.js.map +1 -1
  51. package/lib-commonjs/components/PromptOption/usePromptOption.js +1 -1
  52. package/lib-commonjs/components/PromptOption/usePromptOption.js.map +1 -1
  53. package/lib-commonjs/components/PromptOption/usePromptOptionStyles.styles.raw.js +1 -1
  54. package/lib-commonjs/components/PromptOption/usePromptOptionStyles.styles.raw.js.map +1 -1
  55. package/lib-commonjs/components/motion/PromptListboxMotion.js +1 -1
  56. package/lib-commonjs/components/motion/PromptListboxMotion.js.map +1 -1
  57. package/lib-commonjs/components/utils/OptionCollection.types.js +1 -0
  58. package/lib-commonjs/components/utils/PromptListboxFunctionality.types.js +1 -0
  59. package/lib-commonjs/components/utils/Selection.types.js +1 -0
  60. package/lib-commonjs/components/utils/dropdownKeyActions.js +1 -1
  61. package/lib-commonjs/components/utils/dropdownKeyActions.js.map +1 -1
  62. package/lib-commonjs/components/utils/useListboxPositioning.js +1 -1
  63. package/lib-commonjs/components/utils/useListboxPositioning.js.map +1 -1
  64. package/lib-commonjs/components/utils/useOptionCollection.js +1 -1
  65. package/lib-commonjs/components/utils/useOptionCollection.js.map +1 -1
  66. package/lib-commonjs/components/utils/usePromptListboxFunctionality.js +1 -1
  67. package/lib-commonjs/components/utils/usePromptListboxFunctionality.js.map +1 -1
  68. package/lib-commonjs/components/utils/usePromptListboxFunctionalityV2.js +1 -1
  69. package/lib-commonjs/components/utils/usePromptListboxFunctionalityV2.js.map +1 -1
  70. package/lib-commonjs/components/utils/useSelection.js +1 -1
  71. package/lib-commonjs/components/utils/useSelection.js.map +1 -1
  72. package/lib-commonjs/components/utils/useTriggerKeyDown.js +1 -1
  73. package/lib-commonjs/components/utils/useTriggerKeyDown.js.map +1 -1
  74. package/lib-commonjs/index.js +1 -0
  75. package/lib-commonjs/plugins/CursorPositionPlugin.js +1 -1
  76. package/lib-commonjs/plugins/CursorPositionPlugin.js.map +1 -1
  77. package/package.json +10 -10
@@ -81,4 +81,4 @@ const usePromptOptionStyles_unstable = (state)=>{
81
81
  const styles = useStyles();
82
82
  state.root.className = (0, _reactcomponents.mergeClasses)(promptOptionClassNames.root, styles.root, styles.active, disabled && styles.disabled, state.root.className);
83
83
  return state;
84
- };
84
+ }; //# sourceMappingURL=usePromptOptionStyles.styles.raw.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["usePromptOptionStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\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 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 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 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","usePromptOptionStyles_unstable","root","useStyles","makeStyles","alignItems","borderRadius","tokens","borderRadiusMedium","color","colorNeutralForeground1","columnGap","spacingHorizontalXS","cursor","display","fontFamily","fontFamilyBase","fontSize","fontSizeBase300","lineHeight","lineHeightBase300","padding","spacingVerticalSNudge","spacingHorizontalS","position","backgroundColor","colorNeutralBackground1Hover","colorNeutralForeground1Hover","colorNeutralBackground1Pressed","colorNeutralForeground1Pressed","active","ACTIVEDESCENDANT_FOCUSVISIBLE_ATTRIBUTE","content","pointerEvents","zIndex","shorthands","border","strokeWidthThick","colorStrokeFocus2","top","bottom","left","right","disabled","colorNeutralForegroundDisabled","colorTransparentBackground","state","styles","className","mergeClasses"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAMaA,sBAAAA;eAAAA;;IAuEAC,8BAAAA;eAAAA;;;iCA7EwC;wBAC9B;2BACiC;AAIjD,MAAMD,yBAA4D;IACvEE,MAAM;AACR;AAEA;;CAEC,GACD,MAAMC,YAAYC,IAAAA,2BAAAA,EAAW;IAC3BF,MAAM;QACJG,YAAY;QACZC,cAAcC,cAAAA,CAAOC,kBAAkB;QACvCC,OAAOF,cAAAA,CAAOG,uBAAuB;QACrCC,WAAWJ,cAAAA,CAAOK,mBAAmB;QACrCC,QAAQ;QACRC,SAAS;QACTC,YAAYR,cAAAA,CAAOS,cAAc;QACjCC,UAAUV,cAAAA,CAAOW,eAAe;QAChCC,YAAYZ,cAAAA,CAAOa,iBAAiB;QACpCC,SAAS,CAAC,EAAEd,cAAAA,CAAOe,qBAAqB,CAAC,CAAC,EAAEf,cAAAA,CAAOgB,kBAAkB,CAAC,CAAC;QACvEC,UAAU;QAEV,UAAU;YACRC,iBAAiBlB,cAAAA,CAAOmB,4BAA4B;YACpDjB,OAAOF,cAAAA,CAAOoB,4BAA4B;QAC5C;QAEA,WAAW;YACTF,iBAAiBlB,cAAAA,CAAOqB,8BAA8B;YACtDnB,OAAOF,cAAAA,CAAOsB,8BAA8B;QAC9C;IACF;IAEAC,QAAQ;QACN,CAAC,CAAC,CAAC,EAAEC,kDAAAA,CAAwC,QAAQ,CAAC,CAAC,EAAE;YACvDC,SAAS;YACTR,UAAU;YACVS,eAAe;YACfC,QAAQ;YAER,GAAGC,2BAAAA,CAAWC,MAAM,CAAC7B,cAAAA,CAAO8B,gBAAgB,EAAE,CAAC,KAAK,CAAC,EAAE9B,cAAAA,CAAO+B,iBAAiB,CAAC;YAChFhC,cAAcC,cAAAA,CAAOC,kBAAkB;YAEvC+B,KAAK;YACLC,QAAQ;YACRC,MAAM;YACNC,OAAO;QACT;IACF;IAEAC,UAAU;QACRlC,OAAOF,cAAAA,CAAOqC,8BAA8B;QAE5C,UAAU;YACRnB,iBAAiBlB,cAAAA,CAAOsC,0BAA0B;YAClDpC,OAAOF,cAAAA,CAAOqC,8BAA8B;QAC9C;QAEA,WAAW;YACTnB,iBAAiBlB,cAAAA,CAAOsC,0BAA0B;YAClDpC,OAAOF,cAAAA,CAAOqC,8BAA8B;QAC9C;QAEA,kCAAkC;YAChCnC,OAAO;QACT;IACF;AACF;AAKO,MAAMR,iCAAiC,CAAC6C;IAC7C;IAEA,MAAM,EAAEH,QAAQ,EAAE,GAAGG;IACrB,MAAMC,SAAS5C;IACf2C,MAAM5C,IAAI,CAAC8C,SAAS,GAAGC,IAAAA,6BAAAA,EACrBjD,uBAAuBE,IAAI,EAC3B6C,OAAO7C,IAAI,EACX6C,OAAOjB,MAAM,EACba,YAAYI,OAAOJ,QAAQ,EAC3BG,MAAM5C,IAAI,CAAC8C,SAAS;IAGtB,OAAOF;AACT"}
1
+ {"version":3,"sources":["usePromptOptionStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@fluentui/react-components';\nimport { tokens } from '@fluentui-copilot/tokens';\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 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 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 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","disabled","state","root","makeStyles","alignItems","borderRadius","tokens","colorNeutralForeground1","columnGap","spacingHorizontalXS","cursor","display","fontFamily","fontSize","fontSizeBase300","lineHeight","lineHeightBase300","padding","spacingVerticalSNudge","position","spacingHorizontalS","backgroundColor","colorNeutralForeground1Hover","colorNeutralForeground1Pressed","pointerEvents","borderRadiusMedium","colorStrokeFocus2","left","right","color","colorNeutralForegroundDisabled"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAMaA,sBAAAA;eAAAA;;IA0EHC,8BAAaC;eAAbD;;;iCAhF2C;wBAC9B;2BACiC;AAIjD,MAAMD,yBAA4D;UACvEG;AACF;AAEA;;CAEC,SAECA,YAAMC,IAAAA,2BAAA,EAAA;UACJC;oBACAC;sBACOC,cAAOC,CAAAA,kBAAAA;eACdC,cAAAA,CAAAA,uBAAkBC;mBAClBC,cAAQ,CAAAD,mBAAA;gBACRE;iBACAC;oBACAC,cAAUP,CAAAA,cAAOQ;kBACjBC,cAAYT,CAAAA,eAAOU;oBACnBC,cAAYX,CAAAA,iBAAOY;iBACnBC,CAAAA,EAAAA,cAAU,CAAAD,qBAAA,CAAA,CAAA,EAAAZ,cAAA,CAAAc,kBAAA,CAAA,CAAA;kBAEV;kBACEC;6BACOf,cAAOgB,CAAAA,4BAA4B;mBAC5ChB,cAAA,CAAAgB,4BAAA;;mBAGED;6BACOf,cAAOiB,CAAAA,8BAA8B;mBAC9CjB,cAAA,CAAAiB,8BAAA;QACF;;YAGI;+DACS,CAAA,QAAA,CAAA,CAAA,EAAA;qBACTJ;sBACAK;2BACQ;oBAER;0CACAnB,CAAAA,MAAcC,CAAAA,cAAOmB,CAAAA,gBAAAA,EAAkB,CAAA,KAAA,CAAA,EAAAnB,cAAA,CAAAoB,iBAAA,CAAA;0BAElCpB,cAAA,CAAAmB,kBAAA;;oBAELE;kBACAC;mBACF;QACF;;cAGEC;eAEAvB,cAAA,CAAUwB,8BAAA;kBACRT;6BACOf,cAAOwB,CAAAA,0BAA8B;mBAC9CxB,cAAA,CAAAwB,8BAAA;;mBAGET;6BACOf,cAAOwB,CAAAA,0BAA8B;mBAC9CxB,cAAA,CAAAwB,8BAAA;;0CAGS;mBACT;QACF;IACF;AAEA;AAME,MAAQ9B,iCAAaC,CAAAA;;UAUrB,EACAD,QAAA"}
@@ -62,4 +62,4 @@ const collapseMotion = ({ element })=>{
62
62
  }
63
63
  };
64
64
  };
65
- const PromptListboxMotion = (0, _reactcomponents.createPresenceComponent)(collapseMotion);
65
+ const PromptListboxMotion = (0, _reactcomponents.createPresenceComponent)(collapseMotion); //# sourceMappingURL=PromptListboxMotion.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["PromptListboxMotion.ts"],"sourcesContent":["import { createPresenceComponent, motionTokens } from '@fluentui/react-components';\nimport type { PresenceMotionFn } from '@fluentui/react-components';\n\nconst collapseMotion: PresenceMotionFn = ({ element }) => {\n const fromOpacity = 0;\n const toOpacity = 1;\n const fromHeight = '0';\n const toHeight = `${element.scrollHeight}px`;\n const overflow = 'hidden';\n\n const duration = motionTokens.durationNormal;\n const easing = motionTokens.curveEasyEaseMax;\n\n const enterKeyframes = [\n { opacity: fromOpacity, maxHeight: fromHeight, overflow },\n // Transition to the height of the content, at 99.99% of the duration.\n { opacity: toOpacity, maxHeight: toHeight, offset: 0.9999, overflow },\n // On completion, remove the maxHeight because the content might need to expand later.\n { opacity: toOpacity, maxHeight: 'unset', overflow },\n ];\n\n const exitKeyframes = [\n { opacity: toOpacity, maxHeight: toHeight, overflow },\n { opacity: fromOpacity, maxHeight: fromHeight, overflow },\n ];\n\n return {\n enter: { duration, easing, keyframes: enterKeyframes },\n exit: { duration, easing, keyframes: exitKeyframes },\n };\n};\n\nexport const PromptListboxMotion = createPresenceComponent(collapseMotion);\n"],"names":["PromptListboxMotion","collapseMotion","element","fromOpacity","toOpacity","fromHeight","toHeight","scrollHeight","overflow","duration","motionTokens","durationNormal","easing","curveEasyEaseMax","enterKeyframes","opacity","maxHeight","offset","exitKeyframes","enter","keyframes","exit","createPresenceComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgCaA;;;eAAAA;;;iCAhCyC;AAGtD,MAAMC,iBAAmC,CAAC,EAAEC,OAAO,EAAE;IACnD,MAAMC,cAAc;IACpB,MAAMC,YAAY;IAClB,MAAMC,aAAa;IACnB,MAAMC,WAAW,CAAC,EAAEJ,QAAQK,YAAY,CAAC,EAAE,CAAC;IAC5C,MAAMC,WAAW;IAEjB,MAAMC,WAAWC,6BAAAA,CAAaC,cAAc;IAC5C,MAAMC,SAASF,6BAAAA,CAAaG,gBAAgB;IAE5C,MAAMC,iBAAiB;QACrB;YAAEC,SAASZ;YAAaa,WAAWX;YAAYG;QAAS;QACxD,sEAAsE;QACtE;YAAEO,SAASX;YAAWY,WAAWV;YAAUW,QAAQ;YAAQT;QAAS;QACpE,sFAAsF;QACtF;YAAEO,SAASX;YAAWY,WAAW;YAASR;QAAS;KACpD;IAED,MAAMU,gBAAgB;QACpB;YAAEH,SAASX;YAAWY,WAAWV;YAAUE;QAAS;QACpD;YAAEO,SAASZ;YAAaa,WAAWX;YAAYG;QAAS;KACzD;IAED,OAAO;QACLW,OAAO;YAAEV;YAAUG;YAAQQ,WAAWN;QAAe;QACrDO,MAAM;YAAEZ;YAAUG;YAAQQ,WAAWF;QAAc;IACrD;AACF;AAEO,MAAMlB,sBAAsBsB,IAAAA,wCAAAA,EAAwBrB"}
1
+ {"version":3,"sources":["PromptListboxMotion.ts"],"sourcesContent":["import { createPresenceComponent, motionTokens } from '@fluentui/react-components';\nimport type { PresenceMotionFn } from '@fluentui/react-components';\n\nconst collapseMotion: PresenceMotionFn = ({ element }) => {\n const fromOpacity = 0;\n const toOpacity = 1;\n const fromHeight = '0';\n const toHeight = `${element.scrollHeight}px`;\n const overflow = 'hidden';\n\n const duration = motionTokens.durationNormal;\n const easing = motionTokens.curveEasyEaseMax;\n\n const enterKeyframes = [\n { opacity: fromOpacity, maxHeight: fromHeight, overflow },\n // Transition to the height of the content, at 99.99% of the duration.\n { opacity: toOpacity, maxHeight: toHeight, offset: 0.9999, overflow },\n // On completion, remove the maxHeight because the content might need to expand later.\n { opacity: toOpacity, maxHeight: 'unset', overflow },\n ];\n\n const exitKeyframes = [\n { opacity: toOpacity, maxHeight: toHeight, overflow },\n { opacity: fromOpacity, maxHeight: fromHeight, overflow },\n ];\n\n return {\n enter: { duration, easing, keyframes: enterKeyframes },\n exit: { duration, easing, keyframes: exitKeyframes },\n };\n};\n\nexport const PromptListboxMotion = createPresenceComponent(collapseMotion);\n"],"names":["PromptListboxMotion","collapseMotion","fromOpacity","fromHeight","toOpacity","toHeight","duration","motionTokens","durationNormal","overflow","enterKeyframes","easing","curveEasyEaseMax","maxHeight","offset","exitKeyframes","opacity","createPresenceComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA4BuDA;;;eAAAA;;;iCA5BD;AAGtD,MAAMC,iBAAmC,CAAC,SACxC;UAEAC,cAAMC;UACNC,YAAMC;UACNF,aAAiB;UAEjBE,WAAMC,CAAAA,EAAWC,QAAAA,YAAaC,CAAAA,EAAAA,CAAAA;UAC9BC,WAAeF;UAEfD,WAAMI,6BAAiB,CAAAF,cAAA;UACrBG,SAAAJ,6BAAA,CAAAK,gBAAA;2BAAWV;QAAAA;qBAAaW;uBAAuBJ;;;8EAE/C;;qBAAsBI;uBAAqBC;oBAAgBL;;;8FAE3D;;qBAAsBI;uBAAoBJ;;;;UAG5CM,gBAAMA;QAAAA;qBACJX;uBAAEY;;;;qBAAkDd;uBACpDC;;;;;eAAwD;YACzDG;YAEDK;uBACSD;;;;;uBACDK;;;;MAA6Cf,sBAAAiB,IAAAA,wCAAA,EAAAhB,gEACrD"}
@@ -3,3 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ //# sourceMappingURL=OptionCollection.types.js.map
@@ -2,3 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
+ //# sourceMappingURL=PromptListboxFunctionality.types.js.map
@@ -3,3 +3,4 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ //# sourceMappingURL=Selection.types.js.map
@@ -63,4 +63,4 @@ function getDropdownActionFromKey(e, options) {
63
63
  }
64
64
  // if nothing matched, return none
65
65
  return 'None';
66
- }
66
+ } //# sourceMappingURL=dropdownKeyActions.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["dropdownKeyActions.ts"],"sourcesContent":["/**\n * Note, this is mainly brought from Fluent UI, only removed the closing and\n * opening logic since that's not needed for this use case.\n */\n\nimport * as keys from '@fluentui/keyboard-keys';\nimport type * as React from 'react';\nimport type { CursorPosition } from '../../plugins/CursorPositionPlugin';\n\n/**\n * enum of actions available in any type of managed dropdown control\n * e.g. combobox, select, datepicker, menu\n */\nexport type DropdownActions =\n | 'CloseSelect'\n | 'First'\n | 'Last'\n | 'Next'\n | 'None'\n | 'PageDown'\n | 'PageUp'\n | 'Previous'\n | 'Select'\n | 'Tab'\n | 'Type';\n\nexport interface DropdownActionOptions {\n open?: boolean;\n multiselect?: boolean;\n cursorPosition: CursorPosition;\n allowArrowUpNavigation: boolean;\n isInSelectionMode: boolean;\n}\n\n/**\n * Converts a keyboard interaction into a defined action\n */\nexport function getDropdownActionFromKey(\n e: KeyboardEvent | React.KeyboardEvent,\n options: DropdownActionOptions,\n): DropdownActions {\n const { cursorPosition, allowArrowUpNavigation, isInSelectionMode } = options;\n const code = e.key;\n const { altKey, ctrlKey, key, metaKey } = e;\n\n // typing action occurs whether open or closed\n if (key.length === 1 && code !== keys.Space && !altKey && !ctrlKey && !metaKey) {\n return 'Type';\n }\n\n // select or close actions\n if ((code === keys.ArrowUp && altKey) || code === keys.Enter) {\n return 'CloseSelect';\n }\n\n // navigation interactions\n const atStart = allowArrowUpNavigation && (cursorPosition === 'start' || cursorPosition === 'start-end');\n const atEnd = cursorPosition === 'end' || cursorPosition === 'start-end';\n if (code === keys.ArrowDown) {\n if (atEnd) {\n return 'Next';\n } else if (atStart && isInSelectionMode) {\n return 'Next';\n }\n return 'Type';\n }\n if (code === keys.ArrowUp) {\n if (atEnd && isInSelectionMode) {\n return 'Previous';\n } else if (atStart && !isInSelectionMode) {\n return 'Next';\n } else if (atStart && isInSelectionMode) {\n return 'Previous';\n }\n return 'Type';\n }\n if (code === keys.Home) {\n return atEnd || atStart ? 'First' : 'Type';\n }\n if (code === keys.End) {\n return atEnd || atStart ? 'Last' : 'Type';\n }\n if (code === keys.PageUp) {\n return 'PageUp';\n }\n if (code === keys.PageDown) {\n return 'PageDown';\n }\n if (code === keys.Tab) {\n return 'Tab';\n }\n\n // if nothing matched, return none\n return 'None';\n}\n"],"names":["getDropdownActionFromKey","e","options","cursorPosition","allowArrowUpNavigation","isInSelectionMode","code","key","altKey","ctrlKey","metaKey","length","keys","Space","ArrowUp","Enter","atStart","atEnd","ArrowDown","Home","End","PageUp","PageDown","Tab"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;;CAGC;;;;+BAkCeA;;;eAAAA;;;;wEAhCM;AAgCf,SAASA,yBACdC,CAAsC,EACtCC,OAA8B;IAE9B,MAAM,EAAEC,cAAc,EAAEC,sBAAsB,EAAEC,iBAAiB,EAAE,GAAGH;IACtE,MAAMI,OAAOL,EAAEM,GAAG;IAClB,MAAM,EAAEC,MAAM,EAAEC,OAAO,EAAEF,GAAG,EAAEG,OAAO,EAAE,GAAGT;IAE1C,8CAA8C;IAC9C,IAAIM,IAAII,MAAM,KAAK,KAAKL,SAASM,cAAKC,KAAK,IAAI,CAACL,UAAU,CAACC,WAAW,CAACC,SAAS;QAC9E,OAAO;IACT;IAEA,0BAA0B;IAC1B,IAAIJ,SAAUM,cAAKE,OAAO,IAAIN,UAAWF,SAASM,cAAKG,KAAK,EAAE;QAC5D,OAAO;IACT;IAEA,0BAA0B;IAC1B,MAAMC,UAAUZ,0BAA2BD,CAAAA,mBAAmB,WAAWA,mBAAmB,WAAA;IAC5F,MAAMc,QAAQd,mBAAmB,SAASA,mBAAmB;IAC7D,IAAIG,SAASM,cAAKM,SAAS,EAAE;QAC3B,IAAID,OAAO;YACT,OAAO;QACT,OAAO,IAAID,WAAWX,mBAAmB;YACvC,OAAO;QACT;QACA,OAAO;IACT;IACA,IAAIC,SAASM,cAAKE,OAAO,EAAE;QACzB,IAAIG,SAASZ,mBAAmB;YAC9B,OAAO;QACT,OAAO,IAAIW,WAAW,CAACX,mBAAmB;YACxC,OAAO;QACT,OAAO,IAAIW,WAAWX,mBAAmB;YACvC,OAAO;QACT;QACA,OAAO;IACT;IACA,IAAIC,SAASM,cAAKO,IAAI,EAAE;QACtB,OAAOF,SAASD,UAAU,UAAU;IACtC;IACA,IAAIV,SAASM,cAAKQ,GAAG,EAAE;QACrB,OAAOH,SAASD,UAAU,SAAS;IACrC;IACA,IAAIV,SAASM,cAAKS,MAAM,EAAE;QACxB,OAAO;IACT;IACA,IAAIf,SAASM,cAAKU,QAAQ,EAAE;QAC1B,OAAO;IACT;IACA,IAAIhB,SAASM,cAAKW,GAAG,EAAE;QACrB,OAAO;IACT;IAEA,kCAAkC;IAClC,OAAO;AACT"}
1
+ {"version":3,"sources":["dropdownKeyActions.ts"],"sourcesContent":["/**\n * Note, this is mainly brought from Fluent UI, only removed the closing and\n * opening logic since that's not needed for this use case.\n */\n\nimport * as keys from '@fluentui/keyboard-keys';\nimport type * as React from 'react';\nimport type { CursorPosition } from '../../plugins/CursorPositionPlugin';\n\n/**\n * enum of actions available in any type of managed dropdown control\n * e.g. combobox, select, datepicker, menu\n */\nexport type DropdownActions =\n | 'CloseSelect'\n | 'First'\n | 'Last'\n | 'Next'\n | 'None'\n | 'PageDown'\n | 'PageUp'\n | 'Previous'\n | 'Select'\n | 'Tab'\n | 'Type';\n\nexport interface DropdownActionOptions {\n open?: boolean;\n multiselect?: boolean;\n cursorPosition: CursorPosition;\n allowArrowUpNavigation: boolean;\n isInSelectionMode: boolean;\n}\n\n/**\n * Converts a keyboard interaction into a defined action\n */\nexport function getDropdownActionFromKey(\n e: KeyboardEvent | React.KeyboardEvent,\n options: DropdownActionOptions,\n): DropdownActions {\n const { cursorPosition, allowArrowUpNavigation, isInSelectionMode } = options;\n const code = e.key;\n const { altKey, ctrlKey, key, metaKey } = e;\n\n // typing action occurs whether open or closed\n if (key.length === 1 && code !== keys.Space && !altKey && !ctrlKey && !metaKey) {\n return 'Type';\n }\n\n // select or close actions\n if ((code === keys.ArrowUp && altKey) || code === keys.Enter) {\n return 'CloseSelect';\n }\n\n // navigation interactions\n const atStart = allowArrowUpNavigation && (cursorPosition === 'start' || cursorPosition === 'start-end');\n const atEnd = cursorPosition === 'end' || cursorPosition === 'start-end';\n if (code === keys.ArrowDown) {\n if (atEnd) {\n return 'Next';\n } else if (atStart && isInSelectionMode) {\n return 'Next';\n }\n return 'Type';\n }\n if (code === keys.ArrowUp) {\n if (atEnd && isInSelectionMode) {\n return 'Previous';\n } else if (atStart && !isInSelectionMode) {\n return 'Next';\n } else if (atStart && isInSelectionMode) {\n return 'Previous';\n }\n return 'Type';\n }\n if (code === keys.Home) {\n return atEnd || atStart ? 'First' : 'Type';\n }\n if (code === keys.End) {\n return atEnd || atStart ? 'Last' : 'Type';\n }\n if (code === keys.PageUp) {\n return 'PageUp';\n }\n if (code === keys.PageDown) {\n return 'PageDown';\n }\n if (code === keys.Tab) {\n return 'Tab';\n }\n\n // if nothing matched, return none\n return 'None';\n}\n"],"names":["cursorPosition","keys","allowArrowUpNavigation","isInSelectionMode","code","e","key","altKey","metaKey","ArrowDown","Space","ctrlKey","atStart","ArrowUp","Enter","atEnd","Home","End","PageUp"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;;CAGC;;;;+BAsCSA;;;eAAAA;;;;wEApCEC;AAoCV,SAAQD,yBAAgBE,CAAAA,EAAAA,OAAsB;UAC9C,EACAF,cAAc,EAEdE,sBAAA,EACAC,iBAAc;UAEdC,OAAAC,EAAAC,GAAA;UAEA,EACAC,MAAKH,SACH,EACFE,GAAA,EAEAE,OAAA,KACAH;kDAC0CL;QAC1CM,IAAIF,MAAAA,KAASH,KAAKQ,SAAWR,cAAAS,KAAA,IAAA,CAAAH,UAAA,CAAAI,WAAA,CAAAH,SAAA;eAC3B;;8BAEWI;iBACTX,cAAOY,OAAA,IAAAN,UAAAH,SAAAH,cAAAa,KAAA,EAAA;eACT;;8BAEF;UACIV,UAASH,0BAAcD,CAAAA,mBAAA,WAAAA,mBAAA,WAAA;UACzBe,QAAIA,mBAASZ,SAAmBH,mBAAA;iBAC9BC,cAAOQ,SAAA,EAAA;YACTM,OAAO;mBACL;eACF,IAAOH,WAAIA,mBAAWT;mBACpB;;eAEF;;QAEFC,SAAIA,cAASH,OAAS,EAAE;YACtBc,SAAOA,mBAAmB;YAC5B,OAAA;QACA,OAAIX,IAAAA,WAAiB,CAAED,mBAAA;mBACrB;QACF,OAAA,IAAAS,WAAAT,mBAAA;YACA,OAAIC;;QAEJ,OAAA;;iBAESH,cAAAe,IAAA,EAAA;QACT,OAAAD,SAAAH,UAAA,UAAA;;iBAESX,cAAAgB,GAAA,EAAA;QACT,OAAAF,SAAAH,UAAA,SAAA;;QAGAR,SAAOH,cAAAiB,MAAA,EAAA;QACT,OAAA"}
@@ -33,4 +33,4 @@ function useListboxPositioning(props) {
33
33
  listboxRef,
34
34
  anchorRef
35
35
  ];
36
- }
36
+ } //# sourceMappingURL=useListboxPositioning.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["useListboxPositioning.ts"],"sourcesContent":["// Brought from Fluent UI\n\nimport { resolvePositioningShorthand, usePositioning } from '@fluentui/react-positioning';\nimport type * as React from 'react';\nimport type { UsePromptListboxFunctionalityParams } from './PromptListboxFunctionality.types';\nimport type { PositioningShorthandValue } from '@fluentui/react-positioning';\n\nexport function useListboxPositioning<AnchorElementType extends HTMLElement = HTMLSpanElement>(\n props: Pick<UsePromptListboxFunctionalityParams, 'fluid' | 'positioning'>,\n): [listboxRef: React.RefObject<HTMLSpanElement>, anchorRef: React.RefObject<AnchorElementType>] {\n const { positioning, fluid } = props;\n\n const fallbackPositions: PositioningShorthandValue[] = ['below'];\n\n // popper options\n const popperOptions = {\n position: 'below' as const,\n align: 'start' as const,\n offset: { crossAxis: 0, mainAxis: 2 },\n fallbackPositions: fallbackPositions,\n matchTargetSize: fluid ? ('width' as const) : undefined,\n autoSize: true,\n ...resolvePositioningShorthand(positioning),\n };\n\n const { containerRef: listboxRef, targetRef: anchorRef } = usePositioning(popperOptions);\n\n return [listboxRef, anchorRef];\n}\n"],"names":["useListboxPositioning","props","positioning","fluid","fallbackPositions","popperOptions","position","align","offset","crossAxis","mainAxis","matchTargetSize","undefined","autoSize","resolvePositioningShorthand","containerRef","listboxRef","targetRef","anchorRef","usePositioning"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,yBAAyB;;;;;+BAOTA;;;eAAAA;;;kCAL4C;AAKrD,SAASA,sBACdC,KAAyE;IAEzE,MAAM,EAAEC,WAAW,EAAEC,KAAK,EAAE,GAAGF;IAE/B,MAAMG,oBAAiD;QAAC;KAAQ;IAEhE,iBAAiB;IACjB,MAAMC,gBAAgB;QACpBC,UAAU;QACVC,OAAO;QACPC,QAAQ;YAAEC,WAAW;YAAGC,UAAU;QAAE;QACpCN,mBAAmBA;QACnBO,iBAAiBR,QAAS,UAAoBS;QAC9CC,UAAU;QACV,GAAGC,IAAAA,6CAAAA,EAA4BZ,YAAY;IAC7C;IAEA,MAAM,EAAEa,cAAcC,UAAU,EAAEC,WAAWC,SAAS,EAAE,GAAGC,IAAAA,gCAAAA,EAAed;IAE1E,OAAO;QAACW;QAAYE;KAAU;AAChC"}
1
+ {"version":3,"sources":["useListboxPositioning.ts"],"sourcesContent":["// Brought from Fluent UI\n\nimport { resolvePositioningShorthand, usePositioning } from '@fluentui/react-positioning';\nimport type * as React from 'react';\nimport type { UsePromptListboxFunctionalityParams } from './PromptListboxFunctionality.types';\nimport type { PositioningShorthandValue } from '@fluentui/react-positioning';\n\nexport function useListboxPositioning<AnchorElementType extends HTMLElement = HTMLSpanElement>(\n props: Pick<UsePromptListboxFunctionalityParams, 'fluid' | 'positioning'>,\n): [listboxRef: React.RefObject<HTMLSpanElement>, anchorRef: React.RefObject<AnchorElementType>] {\n const { positioning, fluid } = props;\n\n const fallbackPositions: PositioningShorthandValue[] = ['below'];\n\n // popper options\n const popperOptions = {\n position: 'below' as const,\n align: 'start' as const,\n offset: { crossAxis: 0, mainAxis: 2 },\n fallbackPositions: fallbackPositions,\n matchTargetSize: fluid ? ('width' as const) : undefined,\n autoSize: true,\n ...resolvePositioningShorthand(positioning),\n };\n\n const { containerRef: listboxRef, targetRef: anchorRef } = usePositioning(popperOptions);\n\n return [listboxRef, anchorRef];\n}\n"],"names":["useListboxPositioning","props","positioning","fallbackPositions","popperOptions","position","align","offset","crossAxis","mainAxis","matchTargetSize","fluid","undefined","resolvePositioningShorthand","listboxRef","anchorRef","usePositioning"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,yBAAyB;;;;;+BAOTA;;;eAAAA;;;kCAL4C;AAKrD,SAASA,sBACdC,KAAyE;UAEzE,EAEAC,WAAMC,OAAkD,KAAQF;UAEhEE,oBAAiB;QAAA;KAAA;qBACXC;UACJC,gBAAU;kBACVC;eACAC;gBAAUC;uBAAcC;sBAAY;;2BAEpCC;yBACUC,QAAA,UAAAC;kBACPC;QACL,GAAAA,IAAAA,6CAAA,EAAAX,YAAA;;UAIA,gBAAQY,UAAAA,aAAYC,SAAAA,KAAUC,IAAAA,gCAAA,EAAAZ;IAChC,OAAA;QAAAU;QAAAC;KAAA"}
@@ -43,4 +43,4 @@ const useOptionCollection = ()=>{
43
43
  options: Array.from(optionsById.current.values()),
44
44
  registerOption
45
45
  };
46
- };
46
+ }; //# sourceMappingURL=useOptionCollection.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["useOptionCollection.ts"],"sourcesContent":["// Brought from Fluent UI\n\nimport * as React from 'react';\nimport type { OptionCollectionState, OptionValue } from './OptionCollection.types';\n\n/**\n * A hook for managing a collection of child Options\n */\nexport const useOptionCollection = (): OptionCollectionState => {\n const optionsById = React.useRef(new Map<string, OptionValue>());\n\n const collectionAPI = React.useMemo(() => {\n const getCount = () => optionsById.current.size;\n\n // index searches are no longer used\n\n const getOptionById = (id: string) => {\n return optionsById.current.get(id);\n };\n\n const getOptionsMatchingValue = (matcher: (value: string) => boolean) => {\n const matches: OptionValue[] = [];\n for (const option of optionsById.current.values()) {\n if (matcher(option.value)) {\n matches.push(option);\n }\n }\n\n return matches;\n };\n\n return {\n getCount,\n getOptionById,\n getOptionsMatchingValue,\n };\n }, []);\n\n const registerOption = React.useCallback((option: OptionValue) => {\n optionsById.current.set(option.id, option);\n\n return () => optionsById.current.delete(option.id);\n }, []);\n\n return {\n ...collectionAPI,\n options: Array.from(optionsById.current.values()),\n registerOption,\n };\n};\n"],"names":["useOptionCollection","optionsById","React","useRef","Map","collectionAPI","useMemo","getCount","current","size","getOptionById","id","get","getOptionsMatchingValue","matcher","matches","option","values","value","push","registerOption","useCallback","set","delete","options","Array","from"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,yBAAyB;;;;;+BAQZA;;;eAAAA;;;;iEANU;AAMhB,MAAMA,sBAAsB;IACjC,MAAMC,cAAcC,OAAMC,MAAM,CAAC,IAAIC;IAErC,MAAMC,gBAAgBH,OAAMI,OAAO,CAAC;QAClC,MAAMC,WAAW,IAAMN,YAAYO,OAAO,CAACC,IAAI;QAE/C,oCAAoC;QAEpC,MAAMC,gBAAgB,CAACC;YACrB,OAAOV,YAAYO,OAAO,CAACI,GAAG,CAACD;QACjC;QAEA,MAAME,0BAA0B,CAACC;YAC/B,MAAMC,UAAyB,EAAE;YACjC,KAAK,MAAMC,UAAUf,YAAYO,OAAO,CAACS,MAAM,GAAI;gBACjD,IAAIH,QAAQE,OAAOE,KAAK,GAAG;oBACzBH,QAAQI,IAAI,CAACH;gBACf;YACF;YAEA,OAAOD;QACT;QAEA,OAAO;YACLR;YACAG;YACAG;QACF;IACF,GAAG,EAAE;IAEL,MAAMO,iBAAiBlB,OAAMmB,WAAW,CAAC,CAACL;QACxCf,YAAYO,OAAO,CAACc,GAAG,CAACN,OAAOL,EAAE,EAAEK;QAEnC,OAAO,IAAMf,YAAYO,OAAO,CAACe,MAAM,CAACP,OAAOL,EAAE;IACnD,GAAG,EAAE;IAEL,OAAO;QACL,GAAGN,aAAa;QAChBmB,SAASC,MAAMC,IAAI,CAACzB,YAAYO,OAAO,CAACS,MAAM;QAC9CG;IACF;AACF"}
1
+ {"version":3,"sources":["useOptionCollection.ts"],"sourcesContent":["// Brought from Fluent UI\n\nimport * as React from 'react';\nimport type { OptionCollectionState, OptionValue } from './OptionCollection.types';\n\n/**\n * A hook for managing a collection of child Options\n */\nexport const useOptionCollection = (): OptionCollectionState => {\n const optionsById = React.useRef(new Map<string, OptionValue>());\n\n const collectionAPI = React.useMemo(() => {\n const getCount = () => optionsById.current.size;\n\n // index searches are no longer used\n\n const getOptionById = (id: string) => {\n return optionsById.current.get(id);\n };\n\n const getOptionsMatchingValue = (matcher: (value: string) => boolean) => {\n const matches: OptionValue[] = [];\n for (const option of optionsById.current.values()) {\n if (matcher(option.value)) {\n matches.push(option);\n }\n }\n\n return matches;\n };\n\n return {\n getCount,\n getOptionById,\n getOptionsMatchingValue,\n };\n }, []);\n\n const registerOption = React.useCallback((option: OptionValue) => {\n optionsById.current.set(option.id, option);\n\n return () => optionsById.current.delete(option.id);\n }, []);\n\n return {\n ...collectionAPI,\n options: Array.from(optionsById.current.values()),\n registerOption,\n };\n};\n"],"names":["optionsById","useRef","collectionAPI","React","useMemo","Map","getCount","current","size","id","get","matcher","matches","option","value","values","push","useCallback","delete","Array","registerOption"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,yBAAyB;;;;;+BASjBA;;;eAAAA;;;;iEAPe;AAOrB,MAAMA,sBAAoBC;UAE1BD,cAAME,OAAgBC,MAAMC,CAAAA,IAAOC;UACjCH,gBAAMI,OAAiBN,OAAAA,CAAAA;cAEvBM,WAAA,IAAAN,YAAAO,OAAoC,CAAAC,IAAA;4CAEbC;8BACdT,CAAAA;mBACTA,YAAAO,OAAA,CAAAG,GAAA,CAAAD;;wCAGmCE,CAAAA;kBACjCC,UAAK,EAAMC;uBACTA,UAAIF,YAAeG,OAAQ,CAAAC,MAAA,GAAA;4BACzBH,OAAAA,KAAY,GAACC;4BACfG,IAAA,CAAAH;;;mBAIJD;;;;;;QAOF;OAEA,EAAA;UACEZ,iBAAYO,OAAWU,WAAU,CAAEJ,CAAAA;oBAE5BN,OAAMP,CAAAA,GAAAA,CAAAA,OAAYO,EAAAA,EAAQW;QACnC,OAAK,IAAAlB,YAAAO,OAAA,CAAAW,MAAA,CAAAL,OAAAJ,EAAA;OAEL,EAAA;WACE;wBACSU;iBACTC,MAAAA,IAAAA,CAAAA,YAAAA,OAAAA,CAAAA,MAAAA;QACFA;IACA"}
@@ -147,4 +147,4 @@ function usePromptListboxFunctionality(params) {
147
147
  containerRef: comboboxTargetRef,
148
148
  cursorPositionPlugin
149
149
  };
150
- }
150
+ } //# sourceMappingURL=usePromptListboxFunctionality.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["usePromptListboxFunctionality.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useActiveDescendant } from '@fluentui/react-aria';\nimport { useControllableState, useMergedRefs } from '@fluentui/react-utilities';\nimport { CursorPositionPlugin } from '../../plugins/CursorPositionPlugin';\nimport { useOptionCollection } from './useOptionCollection';\nimport { useSelection } from './useSelection';\nimport { useListboxPositioning } from './useListboxPositioning';\nimport { useTriggerKeydown } from './useTriggerKeyDown';\nimport { PromptListbox } from '../PromptListbox';\nimport { promptOptionClassNames } from '../PromptOption';\nimport { PromptListboxMotion } from '../motion/PromptListboxMotion';\nimport type { CursorPosition } from '../../plugins/CursorPositionPlugin';\nimport type {\n UsePromptListboxFunctionalityParams,\n UsePromptListboxFunctionality,\n} from './PromptListboxFunctionality.types';\n\n/**\n * @deprecated -- use usePromptListboxFunctionality from usePromptListboxFunctionalityV2.tsx instead\n */\nexport function usePromptListboxFunctionality(\n params: UsePromptListboxFunctionalityParams,\n): UsePromptListboxFunctionality {\n const {\n positioning,\n onOpenChange,\n onSelectionModeChange,\n listboxProps,\n fluid = false,\n allowArrowUpNavigation = false,\n } = 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 [cursorPosition, setCursorPosition] = React.useState<CursorPosition>('end');\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 setSelectionMode = React.useCallback(\n (selectionMode: boolean) => {\n if (selectionMode === false) {\n activeDescendantController.blur();\n setHideActiveDescendant(true);\n } else {\n setHideActiveDescendant(false);\n }\n\n setIsInSelectionMode(selectionMode);\n onSelectionModeChange?.(selectionMode);\n },\n [activeDescendantController, onSelectionModeChange],\n );\n\n const onBlur = (event: React.FocusEvent<HTMLSpanElement>) => {\n setOpen(false);\n onOpenChange?.(event, { event, type: 'focus', open: false });\n setSelectionMode(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 = <CursorPositionPlugin setCursorPosition={setCursorPosition} />;\n\n const onListboxBlur = React.useCallback(() => {\n setSelectionMode(false);\n onSelectionModeChange?.(false);\n }, [onSelectionModeChange, setSelectionMode]);\n\n // handle combobox keyboard interaction\n const onKeyDown = useTriggerKeydown({\n ...optionCollection,\n allowArrowUpNavigation,\n activeDescendantController,\n getOptionById,\n onBlur: onListboxBlur,\n selectOption,\n cursorPosition,\n open,\n multiselect: false,\n isInSelectionMode,\n setSelectionMode,\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 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] = useListboxPositioning({ positioning, fluid });\n\n const listboxMergedRef = useMergedRefs(comboboxPopupRef, activeDescendantListboxRef, listboxProps?.ref);\n const listbox = React.useMemo(() => {\n return (\n <PromptListboxMotion visible={open}>\n <PromptListbox\n open={open}\n {...listboxProps}\n {...optionCollection}\n {...selectionState}\n ref={listboxMergedRef}\n activeDescendantController={activeDescendantController}\n />\n </PromptListboxMotion>\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,\n isInSelectionMode,\n },\n containerRef: comboboxTargetRef,\n cursorPositionPlugin,\n };\n}\n"],"names":["usePromptListboxFunctionality","params","positioning","onOpenChange","onSelectionModeChange","listboxProps","fluid","allowArrowUpNavigation","listboxRef","activeDescendantListboxRef","activeParentRef","controller","activeDescendantController","useActiveDescendant","matchOption","el","classList","contains","promptOptionClassNames","root","triggerRef","useMergedRefs","selectionState","useSelection","selectOption","optionCollection","useOptionCollection","getOptionById","cursorPosition","setCursorPosition","React","useState","isInSelectionMode","setIsInSelectionMode","open","setOpen","useControllableState","state","defaultState","defaultOpen","initialState","setSelectionMode","useCallback","selectionMode","blur","setHideActiveDescendant","onBlur","event","type","onFocus","target","currentTarget","cursorPositionPlugin","createElement","CursorPositionPlugin","onListboxBlur","onKeyDown","useTriggerKeydown","multiselect","hideActiveDescendant","useEffect","current","removeAttribute","comboboxPopupRef","comboboxTargetRef","useListboxPositioning","listboxMergedRef","ref","listbox","useMemo","PromptListboxMotion","visible","PromptListbox","promptListbox","triggerProps","containerRef"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAoBgBA;;;eAAAA;;;;iEApBO;2BACa;gCACgB;sCACf;qCACD;8BACP;uCACS;mCACJ;+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AAsB;QAAE/D;QAAaI;IAAM;IAEzF,MAAM4D,mBAAmB7C,IAAAA,6BAAAA,EAAc0C,kBAAkBtD,4BAA4BJ,iBAAAA,QAAAA,iBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,aAAc8D,GAAG;IACtG,MAAMC,UAAUtC,OAAMuC,OAAO,CAAC;QAC5B,OAAA,WAAA,GACEvC,OAAAuB,aAAA,CAACiB,wCAAAA,EAAAA;YAAoBC,SAASrC;yBAC5BJ,OAAAuB,aAAA,CAACmB,4BAAAA,EAAAA;YACCtC,MAAMA;YACL,GAAG7B,YAAY;YACf,GAAGoB,gBAAgB;YACnB,GAAGH,cAAc;YAClB6C,KAAKD;YACLtD,4BAA4BA;;IAIpC,GAAG;QAACA;QAA4BsD;QAAkB7D;QAAc6B;QAAMT;QAAkBH;KAAe;IAEvG,OAAO;QACLmD,eAAeL;QACfM,cAAc;YACZP,KAAK/C;YACL0B;YACAG;YACAO;YACAxB;QACF;QACA2C,cAAcX;QACdZ;IACF;AACF"}
1
+ {"version":3,"sources":["usePromptListboxFunctionality.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useActiveDescendant } from '@fluentui/react-aria';\nimport { useControllableState, useMergedRefs } from '@fluentui/react-utilities';\nimport { CursorPositionPlugin } from '../../plugins/CursorPositionPlugin';\nimport { useOptionCollection } from './useOptionCollection';\nimport { useSelection } from './useSelection';\nimport { useListboxPositioning } from './useListboxPositioning';\nimport { useTriggerKeydown } from './useTriggerKeyDown';\nimport { PromptListbox } from '../PromptListbox';\nimport { promptOptionClassNames } from '../PromptOption';\nimport { PromptListboxMotion } from '../motion/PromptListboxMotion';\nimport type { CursorPosition } from '../../plugins/CursorPositionPlugin';\nimport type {\n UsePromptListboxFunctionalityParams,\n UsePromptListboxFunctionality,\n} from './PromptListboxFunctionality.types';\n\n/**\n * @deprecated -- use usePromptListboxFunctionality from usePromptListboxFunctionalityV2.tsx instead\n */\nexport function usePromptListboxFunctionality(\n params: UsePromptListboxFunctionalityParams,\n): UsePromptListboxFunctionality {\n const {\n positioning,\n onOpenChange,\n onSelectionModeChange,\n listboxProps,\n fluid = false,\n allowArrowUpNavigation = false,\n } = 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 [cursorPosition, setCursorPosition] = React.useState<CursorPosition>('end');\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 setSelectionMode = React.useCallback(\n (selectionMode: boolean) => {\n if (selectionMode === false) {\n activeDescendantController.blur();\n setHideActiveDescendant(true);\n } else {\n setHideActiveDescendant(false);\n }\n\n setIsInSelectionMode(selectionMode);\n onSelectionModeChange?.(selectionMode);\n },\n [activeDescendantController, onSelectionModeChange],\n );\n\n const onBlur = (event: React.FocusEvent<HTMLSpanElement>) => {\n setOpen(false);\n onOpenChange?.(event, { event, type: 'focus', open: false });\n setSelectionMode(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 = <CursorPositionPlugin setCursorPosition={setCursorPosition} />;\n\n const onListboxBlur = React.useCallback(() => {\n setSelectionMode(false);\n onSelectionModeChange?.(false);\n }, [onSelectionModeChange, setSelectionMode]);\n\n // handle combobox keyboard interaction\n const onKeyDown = useTriggerKeydown({\n ...optionCollection,\n allowArrowUpNavigation,\n activeDescendantController,\n getOptionById,\n onBlur: onListboxBlur,\n selectOption,\n cursorPosition,\n open,\n multiselect: false,\n isInSelectionMode,\n setSelectionMode,\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 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] = useListboxPositioning({ positioning, fluid });\n\n const listboxMergedRef = useMergedRefs(comboboxPopupRef, activeDescendantListboxRef, listboxProps?.ref);\n const listbox = React.useMemo(() => {\n return (\n <PromptListboxMotion visible={open}>\n <PromptListbox\n open={open}\n {...listboxProps}\n {...optionCollection}\n {...selectionState}\n ref={listboxMergedRef}\n activeDescendantController={activeDescendantController}\n />\n </PromptListboxMotion>\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,\n isInSelectionMode,\n },\n containerRef: comboboxTargetRef,\n cursorPositionPlugin,\n };\n}\n"],"names":["positioning","onSelectionModeChange","matchOption","onOpenChange","listboxProps","triggerRef","fluid","selectionState","allowArrowUpNavigation","params","listboxRef","cursorPosition","setCursorPosition","activeParentRef","isInSelectionMode","controller","open","useControllableState","defaultState","defaultOpen","promptOptionClassNames","root","setSelectionMode","React","useCallback","selectionMode","setHideActiveDescendant","setIsInSelectionMode","useState","activeDescendantController","onBlur","event","blur","onFocus","onListboxBlur","currentTarget","selectOption","getOptionById","hideActiveDescendant","useEffect","_triggerRef_current","comboboxTargetRef","useListboxPositioning","removeAttribute","activeDescendantListboxRef","PromptListboxMotion","PromptListbox","comboboxPopupRef","ref","listboxMergedRef","createElement","optionCollection","promptListbox","triggerProps","cursorPositionPlugin"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAwBIA;;;eAAAA;;;;iEAxBmB;2BACa;gCACgB;sCACf;qCACD;8BACP;uCACS;mCACJ;+BACJ;8BACS;qCACH;AAalC,SACEA,8BAEAC,MAAAA;UAKF,aAKEC,EACFC,YAAA,EACAF,qBAAA,EACAG,YAAMC,EACNC,QAAMC,KAAAA,EACNC,yBAAyBD,KAAAA,KACzBE;UACA,EACAC,YAAOC,0BAAgBC,EACvBC,eAAOC,EACPC,YAAOC,0BAAiBC,uCACRD,EAAI;qBAClBE,CAAAA,KAAcT,GAAAA,SAAOU,CAAAA,QAAW,CAAAC,oCAAA,CAAAC,IAAA;;qEAElC;UAEAhB,aAAMiB,IAAAA,6BAAmBC,EAAMC;UAE3BjB,iBAAIkB,IAAAA,0BAAyB,EAAArB,iBAAA,QAAAA,iBAAA,KAAA,IAAAA,eAAA,CAAA;wBAE3BsB;6BAEAA,IAAAA,wCAAwB;UAC1B,eAEAC;UAGF,CAAAhB,gBAAAC,kBAAA,GAAAW,OAAAK,QAAA,CAAA;UAACC,CAAAA,mBAAAA,qBAAAA,GAAAA,OAAAA,QAAAA,CAAAA;UAA4B5B,CAAAA,MAAAA,QAAAA,GAAAA,IAAAA,oCAAAA,EAAAA;eAAsBQ,OAAAO,IAAA;QAGrDE,cAAMY,OAAUC,WAAAA;sBACN;;6BACgBA,OAAAA,WAAAA,CAAAA,CAAAA;8BAAa,OAAA;uCAAeC,IAAA;oCAAM;eAC1DV;YACF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AAAA,OAAAA,CAAAA;0BACLpB,GAAAA,OAAAA,aAA4BA,CAAAA,wCAAAA,EAAAA;;QAIpC,GAAG,WAAA,GAAAN,OAAA2B,aAAA,CAAAJ,4BAAA,EAAA;kBAACjB;eAA4BoB,YAAAA;eAAkB7C,gBAAAA;eAAcY,cAAAA;iBAAMmC;wCAAkB5C;;OAExF;QAAAsB;QAAOoB;QAAA7C;QAAAY;QAAAmC;QAAA5C;KAAA;WACL6C;uBACAC;sBACOhD;;;;;;;sBAOPiD;QACFA;IACF"}
@@ -132,4 +132,4 @@ function usePromptListboxFunctionality(params) {
132
132
  },
133
133
  containerRef: anchorRef
134
134
  };
135
- }
135
+ } //# sourceMappingURL=usePromptListboxFunctionalityV2.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["usePromptListboxFunctionalityV2.tsx"],"sourcesContent":["import * as React from 'react';\nimport { InputListbox, useInputListboxFunctionality } from '@fluentui-copilot/react-input-listbox';\nimport { PromptListboxMotion } from '../motion/PromptListboxMotion';\nimport {\n mergeCallbacks,\n useControllableState,\n useEventCallback,\n useId,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport { CursorPositionPlugin } from '../../plugins/CursorPositionPlugin';\nimport { useListboxPositioning } from './useListboxPositioning';\nimport { Portal } from '@fluentui/react-components';\nimport type { EventData, EventHandler } from '@fluentui/react-utilities';\nimport type {\n InputListboxAction,\n InputListboxProps,\n UseInputListboxFunctionalityParams,\n OverrideActionHandler,\n} from '@fluentui-copilot/react-input-listbox';\nimport type { PortalProps } from '@fluentui/react-components';\nimport type { CursorPosition } from '../../plugins/CursorPositionPlugin';\nimport type { EditorInputProps } from '@fluentui-copilot/react-editor-input';\nimport type { PositioningShorthand } from '@fluentui/react-positioning';\n\nexport type OnOpenChangeData = (\n | EventData<'click', React.MouseEvent<HTMLSpanElement>>\n | EventData<'focus', React.FocusEvent<HTMLSpanElement>>\n | EventData<'keyboard', React.KeyboardEvent<HTMLSpanElement>>\n) & {\n open: boolean;\n};\n\nexport type UsePromptListboxFunctionalityParams = UseInputListboxFunctionalityParams & {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: EventHandler<OnOpenChangeData>;\n positioning?: PositioningShorthand;\n\n /**\n * Whether the listbox's width should take all the available space or only\n * the required space.\n *\n * @default false\n */\n fluid?: boolean;\n\n /**\n * Props to be passed to the InputListbox component\n */\n listboxProps?: Partial<InputListboxProps> & {\n ref?: React.RefObject<HTMLDivElement>;\n };\n\n /**\n * Whether to allow reaching the listbox options by arrowing up at the start of the input.\n * Note, this prop is meant to be used with the following positioning props:\n * ```ts\n * usePromptListboxFunctionality({\n * positioning: {\n * position: 'above',\n * fallbackPositions: ['above']\n * }\n * });\n * ```\n * This is useful when using PromptListbox with other components such as ChatInput since\n * the input will always stay at the bottom therefore the listbox would always get cut.\n *\n * @default false\n */\n allowArrowUpNavigation?: boolean;\n\n /**\n * Whether to render the listbox inline or use a portal.\n */\n inline?: boolean;\n} & Pick<PortalProps, 'mountNode'>;\n\nexport type UsePromptListboxFunctionality<ContainerElementType extends HTMLElement> = {\n /**\n * Component to be rendered in the Input component. This should be passed to the listbox prop.\n */\n promptListbox: JSX.Element;\n /**\n * Props to be spread in the PromptInput, these props are needed for the keyboard behavior to\n * work correctly.\n */\n triggerProps: {\n ref: React.RefObject<HTMLSpanElement>;\n /**\n * Whether the listbox is being used to go through options or the user is currently typing.\n */\n isInSelectionMode: boolean;\n } & Required<Pick<EditorInputProps, 'onBlur' | 'onFocus' | 'onKeyDown'>>;\n\n /**\n * Ref used to point which element the listbox should be anchored to. Most use cases\n * will provide this prop to the PromptInput's EditorInput (since this is the root slot,\n * this is provided directly to the component and not the slot).\n *\n * Note: If the containerRef is the same as the trigger, the ref provided in triggerProps needs\n * to be merged with this one using `useMergedRefs(containerRef, triggerProps.ref);`\n */\n containerRef: React.RefObject<ContainerElementType>;\n /**\n * Plugin used to tell where the cursor is in the EditorInput, this is important for the\n * keyboard behavior. This should be passed as children in the PromptInput.\n */\n cursorPositionPlugin: JSX.Element;\n};\n\nexport function usePromptListboxFunctionality<\n TriggerElementType extends HTMLElement = HTMLSpanElement,\n ContainerElementType extends HTMLElement = HTMLDivElement,\n>(params: UsePromptListboxFunctionalityParams): UsePromptListboxFunctionality<ContainerElementType> {\n const { fluid = false, allowArrowUpNavigation = false, onSelectionModeChange } = params;\n const [open, setOpen] = useControllableState({\n state: params.open,\n defaultState: params.defaultOpen,\n initialState: false,\n });\n const [cursorPosition, setCursorPosition] = React.useState<CursorPosition>('end');\n\n const overrideActionHandler: OverrideActionHandler = (\n e,\n { activeOption, action, activeDescendantController, isInSelectionMode },\n ) => {\n const atStart = allowArrowUpNavigation && (cursorPosition === 'start' || cursorPosition === 'start-end');\n const atEnd = cursorPosition === 'end' || cursorPosition === 'start-end';\n let newAction: InputListboxAction | undefined = undefined;\n let newIsInSelection: boolean | undefined = undefined;\n const firstOption = activeDescendantController.first({ passive: true });\n\n switch (action) {\n case 'Next':\n if (!isInSelectionMode && !atEnd) {\n newAction = 'Type';\n newIsInSelection = false;\n }\n break;\n case 'Previous':\n if (!isInSelectionMode && !atStart) {\n newAction = 'Type';\n newIsInSelection = false;\n } else if (\n isInSelectionMode &&\n !allowArrowUpNavigation &&\n atEnd &&\n activeOption !== undefined &&\n activeOption.id === firstOption\n ) {\n newAction = 'Type';\n newIsInSelection = false;\n e.preventDefault();\n }\n break;\n case 'First':\n case 'Last':\n case 'PageDown':\n case 'PageUp':\n if (!isInSelectionMode) {\n newAction = 'Type';\n newIsInSelection = false;\n }\n break;\n }\n\n const userOverrides = params.overrideActionHandler?.(e, {\n activeOption,\n action,\n activeDescendantController,\n isInSelectionMode,\n });\n\n return { action: newAction, isInSelectionMode: newIsInSelection, ...userOverrides };\n };\n\n const baseListboxFunctionality = useInputListboxFunctionality<TriggerElementType>({\n ...params,\n onSelectionModeChange,\n overrideActionHandler,\n });\n const {\n onBlur: baseOnBlur,\n onKeyDown: baseOnKeyDown,\n ref: triggerRef,\n isInSelectionMode,\n } = baseListboxFunctionality.triggerProps;\n\n const onFocus = (event: React.FocusEvent<HTMLSpanElement>) => {\n if (event.target === event.currentTarget) {\n setOpen(true);\n params.onOpenChange?.(event, { event, type: 'focus', open: true });\n }\n };\n\n const onBlur = useEventCallback(\n mergeCallbacks(baseOnBlur, (e: React.FocusEvent<TriggerElementType>) => {\n setOpen(false);\n params.onOpenChange?.(e, { event: e, type: 'focus', open: false });\n }),\n );\n\n const [listboxRef, anchorRef] = useListboxPositioning<ContainerElementType>({\n fluid,\n positioning: params.positioning,\n });\n\n const listboxId = useId('prompt-listbox', params.listboxProps?.id);\n const cursorPositionPlugin = <CursorPositionPlugin setCursorPosition={setCursorPosition} />;\n const innerListbox = (\n <InputListbox\n {...params.listboxProps}\n {...baseListboxFunctionality.inputListboxProps}\n id={listboxId}\n ref={useMergedRefs(baseListboxFunctionality.inputListboxProps.ref, listboxRef, params.listboxProps?.ref)}\n />\n );\n const listbox = (\n <PromptListboxMotion visible={open}>\n <span aria-owns={open ? listboxId : undefined}>\n {open && (params.inline ? innerListbox : <Portal mountNode={params.mountNode}>{innerListbox}</Portal>)}\n </span>\n </PromptListboxMotion>\n );\n\n return {\n promptListbox: listbox,\n cursorPositionPlugin,\n triggerProps: {\n ref: triggerRef,\n isInSelectionMode,\n onFocus,\n onKeyDown: baseOnKeyDown,\n onBlur,\n },\n containerRef: anchorRef,\n };\n}\n"],"names":["usePromptListboxFunctionality","params","fluid","allowArrowUpNavigation","onSelectionModeChange","open","setOpen","useControllableState","state","defaultState","defaultOpen","initialState","cursorPosition","setCursorPosition","React","useState","overrideActionHandler","e","activeOption","action","activeDescendantController","isInSelectionMode","atStart","atEnd","newAction","undefined","newIsInSelection","firstOption","first","passive","id","preventDefault","userOverrides","baseListboxFunctionality","useInputListboxFunctionality","onBlur","baseOnBlur","onKeyDown","baseOnKeyDown","ref","triggerRef","triggerProps","onFocus","event","target","currentTarget","onOpenChange","type","useEventCallback","mergeCallbacks","listboxRef","anchorRef","useListboxPositioning","positioning","listboxId","useId","listboxProps","cursorPositionPlugin","createElement","CursorPositionPlugin","innerListbox","InputListbox","inputListboxProps","useMergedRefs","listbox","PromptListboxMotion","visible","span","aria-owns","inline","Portal","mountNode","promptListbox","containerRef"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA+GgBA;;;eAAAA;;;;iEA/GO;mCACoC;qCACvB;gCAO7B;sCAC8B;uCACC;iCACf;AAmGhB,SAASA,8BAGdC,MAA2C;QA8FDA,sBAOyCA;IApGnF,MAAM,EAAEC,QAAQ,KAAK,EAAEC,yBAAyB,KAAK,EAAEC,qBAAqB,EAAE,GAAGH;IACjF,MAAM,CAACI,MAAMC,QAAQ,GAAGC,IAAAA,oCAAAA,EAAqB;QAC3CC,OAAOP,OAAOI,IAAI;QAClBI,cAAcR,OAAOS,WAAW;QAChCC,cAAc;IAChB;IACA,MAAM,CAACC,gBAAgBC,kBAAkB,GAAGC,OAAMC,QAAQ,CAAiB;IAE3E,MAAMC,wBAA+C,CACnDC,GACA,EAAEC,YAAY,EAAEC,MAAM,EAAEC,0BAA0B,EAAEC,iBAAiB,EAAE;YA0CjDpB;QAxCtB,MAAMqB,UAAUnB,0BAA2BS,CAAAA,mBAAmB,WAAWA,mBAAmB,WAAA;QAC5F,MAAMW,QAAQX,mBAAmB,SAASA,mBAAmB;QAC7D,IAAIY,YAA4CC;QAChD,IAAIC,mBAAwCD;QAC5C,MAAME,cAAcP,2BAA2BQ,KAAK,CAAC;YAAEC,SAAS;QAAK;QAErE,OAAQV;YACN,KAAK;gBACH,IAAI,CAACE,qBAAqB,CAACE,OAAO;oBAChCC,YAAY;oBACZE,mBAAmB;gBACrB;gBACA;YACF,KAAK;gBACH,IAAI,CAACL,qBAAqB,CAACC,SAAS;oBAClC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AAWC;YACXH;QACF;QACAsC,cAActB;IAChB;AACF"}
1
+ {"version":3,"sources":["usePromptListboxFunctionalityV2.tsx"],"sourcesContent":["import * as React from 'react';\nimport { InputListbox, useInputListboxFunctionality } from '@fluentui-copilot/react-input-listbox';\nimport { PromptListboxMotion } from '../motion/PromptListboxMotion';\nimport {\n mergeCallbacks,\n useControllableState,\n useEventCallback,\n useId,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport { CursorPositionPlugin } from '../../plugins/CursorPositionPlugin';\nimport { useListboxPositioning } from './useListboxPositioning';\nimport { Portal } from '@fluentui/react-components';\nimport type { EventData, EventHandler } from '@fluentui/react-utilities';\nimport type {\n InputListboxAction,\n InputListboxProps,\n UseInputListboxFunctionalityParams,\n OverrideActionHandler,\n} from '@fluentui-copilot/react-input-listbox';\nimport type { PortalProps } from '@fluentui/react-components';\nimport type { CursorPosition } from '../../plugins/CursorPositionPlugin';\nimport type { EditorInputProps } from '@fluentui-copilot/react-editor-input';\nimport type { PositioningShorthand } from '@fluentui/react-positioning';\n\nexport type OnOpenChangeData = (\n | EventData<'click', React.MouseEvent<HTMLSpanElement>>\n | EventData<'focus', React.FocusEvent<HTMLSpanElement>>\n | EventData<'keyboard', React.KeyboardEvent<HTMLSpanElement>>\n) & {\n open: boolean;\n};\n\nexport type UsePromptListboxFunctionalityParams = UseInputListboxFunctionalityParams & {\n open?: boolean;\n defaultOpen?: boolean;\n onOpenChange?: EventHandler<OnOpenChangeData>;\n positioning?: PositioningShorthand;\n\n /**\n * Whether the listbox's width should take all the available space or only\n * the required space.\n *\n * @default false\n */\n fluid?: boolean;\n\n /**\n * Props to be passed to the InputListbox component\n */\n listboxProps?: Partial<InputListboxProps> & {\n ref?: React.RefObject<HTMLDivElement>;\n };\n\n /**\n * Whether to allow reaching the listbox options by arrowing up at the start of the input.\n * Note, this prop is meant to be used with the following positioning props:\n * ```ts\n * usePromptListboxFunctionality({\n * positioning: {\n * position: 'above',\n * fallbackPositions: ['above']\n * }\n * });\n * ```\n * This is useful when using PromptListbox with other components such as ChatInput since\n * the input will always stay at the bottom therefore the listbox would always get cut.\n *\n * @default false\n */\n allowArrowUpNavigation?: boolean;\n\n /**\n * Whether to render the listbox inline or use a portal.\n */\n inline?: boolean;\n} & Pick<PortalProps, 'mountNode'>;\n\nexport type UsePromptListboxFunctionality<ContainerElementType extends HTMLElement> = {\n /**\n * Component to be rendered in the Input component. This should be passed to the listbox prop.\n */\n promptListbox: JSX.Element;\n /**\n * Props to be spread in the PromptInput, these props are needed for the keyboard behavior to\n * work correctly.\n */\n triggerProps: {\n ref: React.RefObject<HTMLSpanElement>;\n /**\n * Whether the listbox is being used to go through options or the user is currently typing.\n */\n isInSelectionMode: boolean;\n } & Required<Pick<EditorInputProps, 'onBlur' | 'onFocus' | 'onKeyDown'>>;\n\n /**\n * Ref used to point which element the listbox should be anchored to. Most use cases\n * will provide this prop to the PromptInput's EditorInput (since this is the root slot,\n * this is provided directly to the component and not the slot).\n *\n * Note: If the containerRef is the same as the trigger, the ref provided in triggerProps needs\n * to be merged with this one using `useMergedRefs(containerRef, triggerProps.ref);`\n */\n containerRef: React.RefObject<ContainerElementType>;\n /**\n * Plugin used to tell where the cursor is in the EditorInput, this is important for the\n * keyboard behavior. This should be passed as children in the PromptInput.\n */\n cursorPositionPlugin: JSX.Element;\n};\n\nexport function usePromptListboxFunctionality<\n TriggerElementType extends HTMLElement = HTMLSpanElement,\n ContainerElementType extends HTMLElement = HTMLDivElement,\n>(params: UsePromptListboxFunctionalityParams): UsePromptListboxFunctionality<ContainerElementType> {\n const { fluid = false, allowArrowUpNavigation = false, onSelectionModeChange } = params;\n const [open, setOpen] = useControllableState({\n state: params.open,\n defaultState: params.defaultOpen,\n initialState: false,\n });\n const [cursorPosition, setCursorPosition] = React.useState<CursorPosition>('end');\n\n const overrideActionHandler: OverrideActionHandler = (\n e,\n { activeOption, action, activeDescendantController, isInSelectionMode },\n ) => {\n const atStart = allowArrowUpNavigation && (cursorPosition === 'start' || cursorPosition === 'start-end');\n const atEnd = cursorPosition === 'end' || cursorPosition === 'start-end';\n let newAction: InputListboxAction | undefined = undefined;\n let newIsInSelection: boolean | undefined = undefined;\n const firstOption = activeDescendantController.first({ passive: true });\n\n switch (action) {\n case 'Next':\n if (!isInSelectionMode && !atEnd) {\n newAction = 'Type';\n newIsInSelection = false;\n }\n break;\n case 'Previous':\n if (!isInSelectionMode && !atStart) {\n newAction = 'Type';\n newIsInSelection = false;\n } else if (\n isInSelectionMode &&\n !allowArrowUpNavigation &&\n atEnd &&\n activeOption !== undefined &&\n activeOption.id === firstOption\n ) {\n newAction = 'Type';\n newIsInSelection = false;\n e.preventDefault();\n }\n break;\n case 'First':\n case 'Last':\n case 'PageDown':\n case 'PageUp':\n if (!isInSelectionMode) {\n newAction = 'Type';\n newIsInSelection = false;\n }\n break;\n }\n\n const userOverrides = params.overrideActionHandler?.(e, {\n activeOption,\n action,\n activeDescendantController,\n isInSelectionMode,\n });\n\n return { action: newAction, isInSelectionMode: newIsInSelection, ...userOverrides };\n };\n\n const baseListboxFunctionality = useInputListboxFunctionality<TriggerElementType>({\n ...params,\n onSelectionModeChange,\n overrideActionHandler,\n });\n const {\n onBlur: baseOnBlur,\n onKeyDown: baseOnKeyDown,\n ref: triggerRef,\n isInSelectionMode,\n } = baseListboxFunctionality.triggerProps;\n\n const onFocus = (event: React.FocusEvent<HTMLSpanElement>) => {\n if (event.target === event.currentTarget) {\n setOpen(true);\n params.onOpenChange?.(event, { event, type: 'focus', open: true });\n }\n };\n\n const onBlur = useEventCallback(\n mergeCallbacks(baseOnBlur, (e: React.FocusEvent<TriggerElementType>) => {\n setOpen(false);\n params.onOpenChange?.(e, { event: e, type: 'focus', open: false });\n }),\n );\n\n const [listboxRef, anchorRef] = useListboxPositioning<ContainerElementType>({\n fluid,\n positioning: params.positioning,\n });\n\n const listboxId = useId('prompt-listbox', params.listboxProps?.id);\n const cursorPositionPlugin = <CursorPositionPlugin setCursorPosition={setCursorPosition} />;\n const innerListbox = (\n <InputListbox\n {...params.listboxProps}\n {...baseListboxFunctionality.inputListboxProps}\n id={listboxId}\n ref={useMergedRefs(baseListboxFunctionality.inputListboxProps.ref, listboxRef, params.listboxProps?.ref)}\n />\n );\n const listbox = (\n <PromptListboxMotion visible={open}>\n <span aria-owns={open ? listboxId : undefined}>\n {open && (params.inline ? innerListbox : <Portal mountNode={params.mountNode}>{innerListbox}</Portal>)}\n </span>\n </PromptListboxMotion>\n );\n\n return {\n promptListbox: listbox,\n cursorPositionPlugin,\n triggerProps: {\n ref: triggerRef,\n isInSelectionMode,\n onFocus,\n onKeyDown: baseOnKeyDown,\n onBlur,\n },\n containerRef: anchorRef,\n };\n}\n"],"names":["usePromptListboxFunctionality","params","fluid","open","setOpen","useControllableState","state","cursorPosition","defaultState","overrideActionHandler","e","React","undefined","newIsInSelection","allowArrowUpNavigation","atEnd","activeDescendantController","first","isInSelectionMode","newAction","atStart","activeOption","id","firstOption","userOverrides","_params_overrideActionHandler","call","action","baseOnBlur","event","useInputListboxFunctionality","onKeyDown","baseOnKeyDown","ref","triggerRef","useEventCallback","triggerProps","onOpenChange","_params_onOpenChange","type","listboxRef","onBlur","cursorPositionPlugin","setCursorPosition","innerListbox","InputListbox","baseListboxFunctionality","listboxId","listbox","useListboxPositioning","PromptListboxMotion","positioning","inline","listboxProps","Portal","mountNode","createElement","CursorPositionPlugin","promptListbox","inputListboxProps","containerRef","anchorRef"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA+GgBA;;;eAAAA;;;;iEA/GO;mCACoC;qCACvB;gCAO7B;sCAC8B;uCACC;iCACf;AAmGhB,SAASA,8BAGdC,MAA2C;8BA8FDA;UA7F1C,EACAC,QAAOC,KAAMC,2BACO,KAAA,uBACJH;UAEhB,CAAAE,MAAA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uB,EAAAd,YAAAlB,CAAAA;YAAsBiC;;QACnDL,CAAAA,uBAAMM,OAAAA,YACJ,MAAA,QAACC,yBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,qBAAAA,IAAAA,CAAAA,QAAAA,GAAAA;mBACK5C;kBACA6C;kBACAC;;;UAIR,CAAAP,YAAMQ,UAAAA,GACJC,IAAAA,4CAACC,EAAAA;;4BACCC,WAAA;;UACGhD,YAASF,IAAAA,qBAAOmD,EAAAA,kBAASR,CAAAA,uBAAe3C,OAAAoD,YAACC,MAAAA,QAAAA,yBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,qBAAAA,EAAAA;UAAOC,uBAAkBA,WAAS,GAAA5C,OAAA6C,aAAA,CAAAC,0CAAA,EAAA;2BAAwBd;;UAMxGe,eAAeV,WAAAA,GAAAA,OAAAA,aAAAA,CAAAA,+BAAAA,EAAAA;kBACfN,YAAAA;oCACciB,iBAAA;;8CAEZzC,EAAAA,yBAAAA,iBAAAA,CAAAA,GAAAA,EAAAA,YAAAA,CAAAA,wBAAAA,OAAAA,YAAAA,MAAAA,QAAAA,0BAAAA,KAAAA,IAAAA,KAAAA,IAAAA,sBAAAA,GAAAA;;oBAEAa,WAAWC,GAAAA,OAAAA,aAAAA,CAAAA,wCAAAA,EAAAA;iBACXS;kBACF,GAAA9B,OAAA6C,aAAA,CAAA,QAAA;qBACAI,OAAcC,YAAAA;OAChB1D,QAAAF,CAAAA,OAAAmD,MAAA,GAAAR,eAAA,WAAA,GAAAjC,OAAA6C,aAAA,CAAAF,uBAAA,EAAA;QACFC,WAAAtD,OAAAsD,SAAA"}
@@ -69,4 +69,4 @@ const useSelection = (props)=>{
69
69
  selectOption,
70
70
  selectedOptions
71
71
  };
72
- };
72
+ }; //# sourceMappingURL=useSelection.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["useSelection.ts"],"sourcesContent":["// Brought from Fluent UI\n\nimport { useCallback } from 'react';\nimport { useControllableState } from '@fluentui/react-utilities';\nimport type { OptionValue } from './OptionCollection.types';\nimport type { SelectionEvents, SelectionProps, SelectionState } from './Selection.types';\n\nexport const useSelection = (props: SelectionProps): SelectionState => {\n const { defaultSelectedOptions, multiselect, onOptionSelect } = props;\n\n const [selectedOptions, setSelectedOptions] = useControllableState({\n state: props.selectedOptions,\n defaultState: defaultSelectedOptions,\n initialState: [],\n });\n\n const selectOption = useCallback(\n (event: SelectionEvents, option: OptionValue) => {\n // if the option is disabled, do nothing\n if (option.disabled) {\n return;\n }\n\n // for single-select, always return the selected option\n let newSelection = [option.value];\n\n // toggle selected state of the option for multiselect\n if (multiselect) {\n const selectedIndex = selectedOptions.findIndex(o => o === option.value);\n if (selectedIndex > -1) {\n // deselect option\n newSelection = [...selectedOptions.slice(0, selectedIndex), ...selectedOptions.slice(selectedIndex + 1)];\n } else {\n // select option\n newSelection = [...selectedOptions, option.value];\n }\n }\n\n setSelectedOptions(newSelection);\n onOptionSelect?.(event, { optionValue: option.value, optionText: option.text, selectedOptions: newSelection });\n },\n [onOptionSelect, multiselect, selectedOptions, setSelectedOptions],\n );\n\n const clearSelection = (event: SelectionEvents) => {\n setSelectedOptions([]);\n onOptionSelect?.(event, { optionValue: undefined, optionText: undefined, selectedOptions: [] });\n };\n\n return { clearSelection, selectOption, selectedOptions };\n};\n"],"names":["useSelection","props","defaultSelectedOptions","multiselect","onOptionSelect","selectedOptions","setSelectedOptions","useControllableState","state","defaultState","initialState","selectOption","useCallback","event","option","disabled","newSelection","value","selectedIndex","findIndex","o","slice","optionValue","optionText","text","clearSelection","undefined"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,yBAAyB;;;;;+BAOZA;;;eAAAA;;;uBALe;gCACS;AAI9B,MAAMA,eAAe,CAACC;IAC3B,MAAM,EAAEC,sBAAsB,EAAEC,WAAW,EAAEC,cAAc,EAAE,GAAGH;IAEhE,MAAM,CAACI,iBAAiBC,mBAAmB,GAAGC,IAAAA,oCAAAA,EAAqB;QACjEC,OAAOP,MAAMI,eAAe;QAC5BI,cAAcP;QACdQ,cAAc,EAAE;IAClB;IAEA,MAAMC,eAAeC,IAAAA,kBAAAA,EACnB,CAACC,OAAwBC;QACvB,wCAAwC;QACxC,IAAIA,OAAOC,QAAQ,EAAE;YACnB;QACF;QAEA,uDAAuD;QACvD,IAAIC,eAAe;YAACF,OAAOG,KAAK;SAAC;QAEjC,sDAAsD;QACtD,IAAId,aAAa;YACf,MAAMe,gBAAgBb,gBAAgBc,SAAS,CAACC,CAAAA,IAAKA,MAAMN,OAAOG,KAAK;YACvE,IAAIC,gBAAgB,CAAC,GAAG;gBACtB,kBAAkB;gBAClBF,eAAe;uBAAIX,gBAAgBgB,KAAK,CAAC,GAAGH;uBAAmBb,gBAAgBgB,KAAK,CAACH,gBAAgB;iBAAG;YAC1G,OAAO;gBACL,gBAAgB;gBAChBF,eAAe;uBAAIX;oBAAiBS,OAAOG,KAAK;iBAAC;YACnD;QACF;QAEAX,mBAAmBU;QACnBZ,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAiBS,OAAO;YAAES,aAAaR,OAAOG,KAAK;YAAEM,YAAYT,OAAOU,IAAI;YAAEnB,iBAAiBW;QAAa;IAC9G,GACA;QAACZ;QAAgBD;QAAaE;QAAiBC;KAAmB;IAGpE,MAAMmB,iBAAiB,CAACZ;QACtBP,mBAAmB,EAAE;QACrBF,mBAAAA,QAAAA,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAiBS,OAAO;YAAES,aAAaI;YAAWH,YAAYG;YAAWrB,iBAAiB,EAAE;QAAC;IAC/F;IAEA,OAAO;QAAEoB;QAAgBd;QAAcN;IAAgB;AACzD"}
1
+ {"version":3,"sources":["useSelection.ts"],"sourcesContent":["// Brought from Fluent UI\n\nimport { useCallback } from 'react';\nimport { useControllableState } from '@fluentui/react-utilities';\nimport type { OptionValue } from './OptionCollection.types';\nimport type { SelectionEvents, SelectionProps, SelectionState } from './Selection.types';\n\nexport const useSelection = (props: SelectionProps): SelectionState => {\n const { defaultSelectedOptions, multiselect, onOptionSelect } = props;\n\n const [selectedOptions, setSelectedOptions] = useControllableState({\n state: props.selectedOptions,\n defaultState: defaultSelectedOptions,\n initialState: [],\n });\n\n const selectOption = useCallback(\n (event: SelectionEvents, option: OptionValue) => {\n // if the option is disabled, do nothing\n if (option.disabled) {\n return;\n }\n\n // for single-select, always return the selected option\n let newSelection = [option.value];\n\n // toggle selected state of the option for multiselect\n if (multiselect) {\n const selectedIndex = selectedOptions.findIndex(o => o === option.value);\n if (selectedIndex > -1) {\n // deselect option\n newSelection = [...selectedOptions.slice(0, selectedIndex), ...selectedOptions.slice(selectedIndex + 1)];\n } else {\n // select option\n newSelection = [...selectedOptions, option.value];\n }\n }\n\n setSelectedOptions(newSelection);\n onOptionSelect?.(event, { optionValue: option.value, optionText: option.text, selectedOptions: newSelection });\n },\n [onOptionSelect, multiselect, selectedOptions, setSelectedOptions],\n );\n\n const clearSelection = (event: SelectionEvents) => {\n setSelectedOptions([]);\n onOptionSelect?.(event, { optionValue: undefined, optionText: undefined, selectedOptions: [] });\n };\n\n return { clearSelection, selectOption, selectedOptions };\n};\n"],"names":["useSelection","props","defaultSelectedOptions","selectedOptions","defaultState","setSelectedOptions","useControllableState","state","selectOption","useCallback","option","disabled","event","newSelection","multiselect","value","findIndex","selectedIndex","o","slice","onOptionSelect","text","optionValue","undefined","clearSelection"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,yBAAyB;;;;;+BAOZA;;;eAAAA;;;uBALe;gCACS;AAI9B,MAAMA,eAAeC,CAAAA;UAC1B,EAEAC,sBAAOC,aACEF,gBACPG;UAEF,CAAAD,iBAAAE,mBAAA,GAAAC,IAAAA,oCAAA,EAAA;QAEAC,OAAMC,MAAAA,eAAeC;sBAEjBP;sBACIQ,EAAOC;;UAEXH,eAAAC,IAAAA,kBAAA,EAAA,CAAAG,OAAAF;gDAEA;YACAA,OAAIG,QAAAA,EAAAA;;;+DAEJ;YACAA,eAAIC;YAAAA,OAAaC,KAAA;SAAA;8DACuBC;yBAClCC;kCACFd,gBAAkBa,SAAA,CAAAE,CAAAA,IAAAA,MAAAR,OAAAK,KAAA;gCAClBF,CAAAA,GAAAA;kCAAmBV;+BAA4CA;uBAAAA,gBAAgBgB,KAAMF,CAAAA,GAAAA;uBAAgBd,gBAAAgB,KAAA,CAAAF,gBAAA;iBAAA;;gCAChG;+BACL;uBAAAd;oBAAgBO,OAAAK,KAAA;iBAAA;;;2BACoBL;2BAAa,QAAAU,mBAAA,KAAA,IAAA,KAAA,IAAAA,eAAAR,OAAA;yBACnDF,OAAAK,KAAA;wBACFL,OAAAW,IAAA;6BAEAhB;;;;QAC0BiB;QAAoBP;QAAKV;KAAA;2BAAcK,CAAAA;2BAAaP,EAAAA;2BAA8B,QAAAiB,mBAAA,KAAA,IAAA,KAAA,IAAAA,eAAAR,OAAA;YAC9GU,aACAC;wBAACH;6BAAgBN,EAAAA;;;WAAiD;QAGpEU;;;;2CAE8F"}
@@ -148,4 +148,4 @@ function useTriggerKeydown(options) {
148
148
  break;
149
149
  }
150
150
  });
151
- }
151
+ } //# sourceMappingURL=useTriggerKeyDown.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["useTriggerKeyDown.ts"],"sourcesContent":["/**\n * Note, this is mainly brought from Fluent UI, only removed the closing and\n * opening logic since that's not needed for this use case and added the bluring\n * functionality.\n */\n\nimport * as React from 'react';\nimport { useSetKeyboardNavigation } from '@fluentui/react-tabster';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport { getDropdownActionFromKey } from './dropdownKeyActions';\nimport { ArrowLeft, ArrowRight } from '@fluentui/keyboard-keys';\nimport type { ActiveDescendantImperativeRef } from '@fluentui/react-aria';\nimport type { OptionCollectionState, OptionValue } from './OptionCollection.types';\nimport type { SelectionProps, SelectionState } from './Selection.types';\nimport type { CursorPosition } from '../../plugins/CursorPositionPlugin';\n\nexport function useTriggerKeydown(\n options: {\n activeDescendantController: ActiveDescendantImperativeRef;\n cursorPosition: CursorPosition;\n open: boolean;\n onBlur: () => void;\n allowArrowUpNavigation: boolean;\n isInSelectionMode: boolean;\n setSelectionMode: (selectionMode: boolean) => void;\n } & OptionCollectionState &\n Pick<SelectionProps, 'multiselect'> &\n Pick<SelectionState, 'selectOption'>,\n) {\n const {\n activeDescendantController,\n getOptionById,\n selectOption,\n multiselect,\n open,\n cursorPosition,\n onBlur,\n allowArrowUpNavigation,\n isInSelectionMode,\n setSelectionMode,\n } = options;\n\n const getActiveOption = React.useCallback(() => {\n const activeOptionId = activeDescendantController.active();\n return activeOptionId ? getOptionById(activeOptionId) : undefined;\n }, [activeDescendantController, getOptionById]);\n\n const first = () => {\n activeDescendantController.first();\n };\n\n const last = () => {\n activeDescendantController.last();\n };\n\n const blur = () => {\n activeDescendantController.blur();\n onBlur();\n };\n\n const next = (activeOption: OptionValue | undefined) => {\n if (activeOption) {\n activeDescendantController.next();\n } else {\n activeDescendantController.first();\n }\n };\n\n const previous = (activeOption: OptionValue | undefined) => {\n if (activeOption) {\n activeDescendantController.prev();\n } else {\n activeDescendantController.first();\n }\n };\n\n const pageUp = () => {\n for (let i = 0; i < 10; i++) {\n activeDescendantController.prev();\n }\n };\n\n const pageDown = () => {\n for (let i = 0; i < 10; i++) {\n activeDescendantController.next();\n }\n };\n\n const setKeyboardNavigation = useSetKeyboardNavigation();\n return useEventCallback((e: React.KeyboardEvent<HTMLSpanElement>) => {\n const action = getDropdownActionFromKey(e, {\n open,\n multiselect,\n cursorPosition,\n allowArrowUpNavigation,\n isInSelectionMode,\n });\n const activeOption = getActiveOption();\n const firstOption = activeDescendantController.first({ passive: true });\n\n if (e.key === ArrowLeft || e.key === ArrowRight || action === 'Type') {\n setSelectionMode(false);\n } else if (\n action === 'Next' ||\n action === 'Previous' ||\n action === 'First' ||\n action === 'Last' ||\n action === 'PageUp' ||\n action === 'PageDown'\n ) {\n setSelectionMode(true);\n }\n\n switch (action) {\n case 'Last':\n case 'First':\n case 'PageDown':\n case 'PageUp':\n case 'CloseSelect':\n case 'Select':\n e.preventDefault();\n break;\n case 'Previous':\n e.preventDefault();\n break;\n case 'Next':\n e.preventDefault();\n break;\n }\n\n setKeyboardNavigation(true);\n\n switch (action) {\n case 'First':\n first();\n if (!isInSelectionMode) {\n setSelectionMode(true);\n }\n break;\n case 'Last':\n last();\n if (!isInSelectionMode) {\n setSelectionMode(true);\n }\n break;\n case 'Next':\n next(activeOption);\n if (!isInSelectionMode) {\n setSelectionMode(true);\n }\n break;\n case 'Previous':\n // when active option is the first option and the action was \"Previous\",\n // this means we were in the first option and we are \"leaving\" the listbox\n if (activeOption && activeOption.id !== firstOption) {\n previous(activeOption);\n if (!isInSelectionMode) {\n setSelectionMode(true);\n }\n } else {\n blur();\n setSelectionMode(false);\n }\n break;\n case 'PageDown':\n pageDown();\n break;\n case 'PageUp':\n pageUp();\n break;\n case 'CloseSelect':\n if (!multiselect && !activeOption?.disabled) {\n blur();\n setSelectionMode(false);\n }\n // fallthrough\n case 'Select':\n activeOption && selectOption(e, activeOption);\n break;\n case 'Tab':\n !multiselect && activeOption && selectOption(e, activeOption);\n break;\n }\n });\n}\n"],"names":["useTriggerKeydown","options","activeDescendantController","getOptionById","selectOption","multiselect","open","cursorPosition","onBlur","allowArrowUpNavigation","isInSelectionMode","setSelectionMode","getActiveOption","React","useCallback","activeOptionId","active","undefined","first","last","blur","next","activeOption","previous","prev","pageUp","i","pageDown","setKeyboardNavigation","useSetKeyboardNavigation","useEventCallback","e","action","getDropdownActionFromKey","firstOption","passive","key","ArrowLeft","ArrowRight","preventDefault","id","disabled"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,cAAc;YACd,KAAK;gBACHW,gBAAgBlB,aAAa2B,GAAGT;gBAChC;YACF,KAAK;gBACH,CAACjB,eAAeiB,gBAAgBlB,aAAa2B,GAAGT;gBAChD;QACJ;IACF;AACF"}
1
+ {"version":3,"sources":["useTriggerKeyDown.ts"],"sourcesContent":["/**\n * Note, this is mainly brought from Fluent UI, only removed the closing and\n * opening logic since that's not needed for this use case and added the bluring\n * functionality.\n */\n\nimport * as React from 'react';\nimport { useSetKeyboardNavigation } from '@fluentui/react-tabster';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport { getDropdownActionFromKey } from './dropdownKeyActions';\nimport { ArrowLeft, ArrowRight } from '@fluentui/keyboard-keys';\nimport type { ActiveDescendantImperativeRef } from '@fluentui/react-aria';\nimport type { OptionCollectionState, OptionValue } from './OptionCollection.types';\nimport type { SelectionProps, SelectionState } from './Selection.types';\nimport type { CursorPosition } from '../../plugins/CursorPositionPlugin';\n\nexport function useTriggerKeydown(\n options: {\n activeDescendantController: ActiveDescendantImperativeRef;\n cursorPosition: CursorPosition;\n open: boolean;\n onBlur: () => void;\n allowArrowUpNavigation: boolean;\n isInSelectionMode: boolean;\n setSelectionMode: (selectionMode: boolean) => void;\n } & OptionCollectionState &\n Pick<SelectionProps, 'multiselect'> &\n Pick<SelectionState, 'selectOption'>,\n) {\n const {\n activeDescendantController,\n getOptionById,\n selectOption,\n multiselect,\n open,\n cursorPosition,\n onBlur,\n allowArrowUpNavigation,\n isInSelectionMode,\n setSelectionMode,\n } = options;\n\n const getActiveOption = React.useCallback(() => {\n const activeOptionId = activeDescendantController.active();\n return activeOptionId ? getOptionById(activeOptionId) : undefined;\n }, [activeDescendantController, getOptionById]);\n\n const first = () => {\n activeDescendantController.first();\n };\n\n const last = () => {\n activeDescendantController.last();\n };\n\n const blur = () => {\n activeDescendantController.blur();\n onBlur();\n };\n\n const next = (activeOption: OptionValue | undefined) => {\n if (activeOption) {\n activeDescendantController.next();\n } else {\n activeDescendantController.first();\n }\n };\n\n const previous = (activeOption: OptionValue | undefined) => {\n if (activeOption) {\n activeDescendantController.prev();\n } else {\n activeDescendantController.first();\n }\n };\n\n const pageUp = () => {\n for (let i = 0; i < 10; i++) {\n activeDescendantController.prev();\n }\n };\n\n const pageDown = () => {\n for (let i = 0; i < 10; i++) {\n activeDescendantController.next();\n }\n };\n\n const setKeyboardNavigation = useSetKeyboardNavigation();\n return useEventCallback((e: React.KeyboardEvent<HTMLSpanElement>) => {\n const action = getDropdownActionFromKey(e, {\n open,\n multiselect,\n cursorPosition,\n allowArrowUpNavigation,\n isInSelectionMode,\n });\n const activeOption = getActiveOption();\n const firstOption = activeDescendantController.first({ passive: true });\n\n if (e.key === ArrowLeft || e.key === ArrowRight || action === 'Type') {\n setSelectionMode(false);\n } else if (\n action === 'Next' ||\n action === 'Previous' ||\n action === 'First' ||\n action === 'Last' ||\n action === 'PageUp' ||\n action === 'PageDown'\n ) {\n setSelectionMode(true);\n }\n\n switch (action) {\n case 'Last':\n case 'First':\n case 'PageDown':\n case 'PageUp':\n case 'CloseSelect':\n case 'Select':\n e.preventDefault();\n break;\n case 'Previous':\n e.preventDefault();\n break;\n case 'Next':\n e.preventDefault();\n break;\n }\n\n setKeyboardNavigation(true);\n\n switch (action) {\n case 'First':\n first();\n if (!isInSelectionMode) {\n setSelectionMode(true);\n }\n break;\n case 'Last':\n last();\n if (!isInSelectionMode) {\n setSelectionMode(true);\n }\n break;\n case 'Next':\n next(activeOption);\n if (!isInSelectionMode) {\n setSelectionMode(true);\n }\n break;\n case 'Previous':\n // when active option is the first option and the action was \"Previous\",\n // this means we were in the first option and we are \"leaving\" the listbox\n if (activeOption && activeOption.id !== firstOption) {\n previous(activeOption);\n if (!isInSelectionMode) {\n setSelectionMode(true);\n }\n } else {\n blur();\n setSelectionMode(false);\n }\n break;\n case 'PageDown':\n pageDown();\n break;\n case 'PageUp':\n pageUp();\n break;\n case 'CloseSelect':\n if (!multiselect && !activeOption?.disabled) {\n blur();\n setSelectionMode(false);\n }\n // fallthrough\n case 'Select':\n activeOption && selectOption(e, activeOption);\n break;\n case 'Tab':\n !multiselect && activeOption && selectOption(e, activeOption);\n break;\n }\n });\n}\n"],"names":["useTriggerKeydown","React","options","activeDescendantController","activeOptionId","multiselect","getOptionById","allowArrowUpNavigation","setSelectionMode","active","blur","undefined","onBlur","first","last","activeOption","next","previous","i","prev","pageUp","setKeyboardNavigation","useSetKeyboardNavigation","open","cursorPosition","useEventCallback","action","firstOption","getActiveOption","ArrowLeft","e","key","ArrowRight","preventDefault","isInSelectionMode","id","pageDown","disabled"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;;;CAIC;;;;+BAYeA;;;eAAAA;;;;iEAVJC;8BAC6B;gCACR;oCACQ;8BACH;AAM/B,SAASD,kBACdE,OAUsC;UAEtC,EAaAC,0BAAwBF,eAChBG,cACCA,EACTC,WAAG,MAACF,gBAA4BG,QAAc,EAE9CC,sBAAc,mBACZJ,EACFK,gBAAA,KAEAN;UACEC,kBAAAA,OAAAA,WAA+B,CAAA;QACjC,MAAAC,iBAAAD,2BAAAM,MAAA;QAEA,OAAMC,iBAAOJ,cAAAF,kBAAAO;;;QACXR;KAA+B;UAC/BS,QAAAA;QACFT,2BAAAU,KAAA;;UAGEC,OAAIC;mCACFZ,IAAAA;;iBAEAA;mCACFO,IAAA;QACFE;;UAGEI,OAAID,CAAAA;0BACFZ;uCACKa,IAAA;;uCAEPH,KAAA;QACF;;UAGEI,WAASC,CAAAA;0BACPf;uCACFgB,IAAA;QACF,OAAA;YAEAhB,2BAAiBU,KAAA;;;UAGfO,SAAA;QACF,IAAA,IAAAF,IAAA,GAAAA,IAAA,IAAAA,IAAA;YAEAf,2BAAMkB,IAAwBC;QAC9B;;qBAEIC;gBACAlB,IAAAA,GAAAA,IAAAA,IAAAA,IAAAA;uCACAmB,IAAAA;;;UAGFH,wBAAAC,IAAAA,sCAAA;WACAG,IAAAA,gCAAMV,EAAAA,CAAAA;cACNW,SAAMC,IAAAA,4CAAcxB,EAAAA,GAAAA;;;;;;;cAapBY,eAAAa;cAEAD,cAAQD,2BAAAA,KAAAA,CAAAA;qBACN;;iBAEA,KAAKG,uBAAA,IAAAC,EAAAC,GAAA,KAAAC,wBAAA,IAAAN,WAAA,QAAA;6BACA;mBACLA,WAAK,UAAAA,WAAA,cAAAA,WAAA,WAAAA,WAAA,UAAAA,WAAA,YAAAA,WAAA,YAAA;6BACA;;;;;;;;;gBASPI,EAAAG,cAAA;gBAEAZ;iBAEA;gCACO;;;gCAGDb;;;8BAGC;;;;wCAIH;qCACA;;;;;wCAKA;qCACA;;;;;wCAKWO;qCACJmB;;;;wFAILxB;0FACiB;oCACnBK,aAAAoB,EAAA,KAAAR,aAAA;6BACAZ;wBACF,CAAAmB,mBAAK;yCACHE;;uBAEF;;qCAEE;;;;;;;;;;oBAUF,CAAA/B,eAAK,CAAAU,CAAAA,iBAAA,QAAAA,iBAAA,KAAA,IAAA,KAAA,IAAAA,aAAAsB,QAAA,GAAA;;qCAEH;gBACJ;YACF,cAAA;YACF,KAAA"}
@@ -66,3 +66,4 @@ const _usePromptListboxFunctionalityV2 = require("./components/utils/usePromptLi
66
66
  const _usePromptListboxFunctionality = require("./components/utils/usePromptListboxFunctionality");
67
67
  const _PromptOption = require("./PromptOption");
68
68
  const _reactinputlistbox = require("@fluentui-copilot/react-input-listbox");
69
+ //# sourceMappingURL=index.js.map
@@ -51,4 +51,4 @@ const CursorPositionPlugin = ({ setCursorPosition })=>{
51
51
  setCursorPosition
52
52
  ]);
53
53
  return null;
54
- };
54
+ }; //# sourceMappingURL=CursorPositionPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["CursorPositionPlugin.ts"],"sourcesContent":["import { $isSentinelNode } from '@fluentui-copilot/chat-input-plugins';\nimport {\n SELECTION_CHANGE_COMMAND,\n $getSelection,\n useLexicalComposerContext,\n $isRangeSelection,\n $isElementNode,\n COMMAND_PRIORITY_HIGH,\n} from '@fluentui-copilot/react-text-editor';\nimport * as React from 'react';\n\n/**\n * Position the cursor is in based on it's content. The goal\n * is to track whether the cursor is at the end of the input\n * or between text.\n */\nexport type CursorPosition = 'start' | 'between-text' | 'end' | 'start-end';\n\nexport type CursorPositionPluginProps = {\n setCursorPosition: (position: CursorPosition) => void;\n};\n\nexport const CursorPositionPlugin: React.FunctionComponent<CursorPositionPluginProps> = ({ setCursorPosition }) => {\n const [editor] = useLexicalComposerContext();\n\n React.useEffect(() => {\n const $selectionChangeHandler = () => {\n const selection = $getSelection();\n // If selection is null, the cursor is not active in the editor and we should just noop\n if (selection === null || !$isRangeSelection(selection) || !selection.isCollapsed()) {\n setCursorPosition('between-text');\n return false;\n }\n\n // Should only be one node in the selection because the selection is collapsed\n const selectedNode = selection.getNodes().at(0);\n // If there's no selected node, focus isn't in the editor\n if (!selectedNode) {\n return false;\n }\n\n // If there are no leaf nodes, the paragraph node will be selected\n if ($isElementNode(selectedNode)) {\n setCursorPosition('start-end');\n return false;\n }\n\n // if the selection node is a sentinel and it matches the sentinel at the end\n else if ($isSentinelNode(selectedNode) && !selectedNode.getNextSibling()) {\n setCursorPosition('end');\n return false;\n }\n\n // else if the selection node is not a sentinel, check that the next sibling node is a sentinel\n // and check if the focus offset is in the last position of the node.\n else if (\n $isSentinelNode(selectedNode.getNextSibling()) &&\n selection.focus.offset === selectedNode.getTextContentSize()\n ) {\n setCursorPosition('end');\n return false;\n }\n\n // else if the selection node is not at the end and is not a sentinel, check if there's a previous\n // sibling and that we are at the start. If that's the case we are at the start.\n else if (selectedNode.getPreviousSibling() === null && selection.focus.offset === 0) {\n setCursorPosition('start');\n return false;\n }\n\n setCursorPosition('between-text');\n return false;\n };\n\n return editor.registerCommand(SELECTION_CHANGE_COMMAND, $selectionChangeHandler, COMMAND_PRIORITY_HIGH);\n }, [editor, setCursorPosition]);\n\n return null;\n};\n"],"names":["CursorPositionPlugin","setCursorPosition","editor","useLexicalComposerContext","React","useEffect","$selectionChangeHandler","selection","$getSelection","$isRangeSelection","isCollapsed","selectedNode","getNodes","at","$isElementNode","$isSentinelNode","getNextSibling","focus","offset","getTextContentSize","getPreviousSibling","registerCommand","SELECTION_CHANGE_COMMAND","COMMAND_PRIORITY_HIGH"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAsBaA;;;eAAAA;;;;kCAtBmB;iCAQzB;iEACgB;AAahB,MAAMA,uBAA2E,CAAC,EAAEC,iBAAiB,EAAE;IAC5G,MAAM,CAACC,OAAO,GAAGC,IAAAA,0CAAAA;IAEjBC,OAAMC,SAAS,CAAC;QACd,MAAMC,0BAA0B;YAC9B,MAAMC,YAAYC,IAAAA,8BAAAA;YAClB,uFAAuF;YACvF,IAAID,cAAc,QAAQ,CAACE,IAAAA,kCAAAA,EAAkBF,cAAc,CAACA,UAAUG,WAAW,IAAI;gBACnFT,kBAAkB;gBAClB,OAAO;YACT;YAEA,8EAA8E;YAC9E,MAAMU,eAAeJ,UAAUK,QAAQ,GAAGC,EAAE,CAAC;YAC7C,yDAAyD;YACzD,IAAI,CAACF,cAAc;gBACjB,OAAO;YACT;YAEA,kEAAkE;YAClE,IAAIG,IAAAA,+BAAAA,EAAeH,eAAe;gBAChCV,kBAAkB;gBAClB,OAAO;YACT,OAGK,IAAIc,IAAAA,iCAAAA,EAAgBJ,iBAAiB,CAACA,aAAaK,cAAc,IAAI;gBACxEf,kBAAkB;gBAClB,OAAO;YACT,OAIK,IACHc,IAAAA,iCAAAA,EAAgBJ,aAAaK,cAAc,OAC3CT,UAAUU,KAAK,CAACC,MAAM,KAAKP,aAAaQ,kBAAkB,IAC1D;gBACAlB,kBAAkB;gBAClB,OAAO;YACT,OAIK,IAAIU,aAAaS,kBAAkB,OAAO,QAAQb,UAAUU,KAAK,CAACC,MAAM,KAAK,GAAG;gBACnFjB,kBAAkB;gBAClB,OAAO;YACT;YAEAA,kBAAkB;YAClB,OAAO;QACT;QAEA,OAAOC,OAAOmB,eAAe,CAACC,yCAAAA,EAA0BhB,yBAAyBiB,sCAAAA;IACnF,GAAG;QAACrB;QAAQD;KAAkB;IAE9B,OAAO;AACT"}
1
+ {"version":3,"sources":["CursorPositionPlugin.ts"],"sourcesContent":["import { $isSentinelNode } from '@fluentui-copilot/chat-input-plugins';\nimport {\n SELECTION_CHANGE_COMMAND,\n $getSelection,\n useLexicalComposerContext,\n $isRangeSelection,\n $isElementNode,\n COMMAND_PRIORITY_HIGH,\n} from '@fluentui-copilot/react-text-editor';\nimport * as React from 'react';\n\n/**\n * Position the cursor is in based on it's content. The goal\n * is to track whether the cursor is at the end of the input\n * or between text.\n */\nexport type CursorPosition = 'start' | 'between-text' | 'end' | 'start-end';\n\nexport type CursorPositionPluginProps = {\n setCursorPosition: (position: CursorPosition) => void;\n};\n\nexport const CursorPositionPlugin: React.FunctionComponent<CursorPositionPluginProps> = ({ setCursorPosition }) => {\n const [editor] = useLexicalComposerContext();\n\n React.useEffect(() => {\n const $selectionChangeHandler = () => {\n const selection = $getSelection();\n // If selection is null, the cursor is not active in the editor and we should just noop\n if (selection === null || !$isRangeSelection(selection) || !selection.isCollapsed()) {\n setCursorPosition('between-text');\n return false;\n }\n\n // Should only be one node in the selection because the selection is collapsed\n const selectedNode = selection.getNodes().at(0);\n // If there's no selected node, focus isn't in the editor\n if (!selectedNode) {\n return false;\n }\n\n // If there are no leaf nodes, the paragraph node will be selected\n if ($isElementNode(selectedNode)) {\n setCursorPosition('start-end');\n return false;\n }\n\n // if the selection node is a sentinel and it matches the sentinel at the end\n else if ($isSentinelNode(selectedNode) && !selectedNode.getNextSibling()) {\n setCursorPosition('end');\n return false;\n }\n\n // else if the selection node is not a sentinel, check that the next sibling node is a sentinel\n // and check if the focus offset is in the last position of the node.\n else if (\n $isSentinelNode(selectedNode.getNextSibling()) &&\n selection.focus.offset === selectedNode.getTextContentSize()\n ) {\n setCursorPosition('end');\n return false;\n }\n\n // else if the selection node is not at the end and is not a sentinel, check if there's a previous\n // sibling and that we are at the start. If that's the case we are at the start.\n else if (selectedNode.getPreviousSibling() === null && selection.focus.offset === 0) {\n setCursorPosition('start');\n return false;\n }\n\n setCursorPosition('between-text');\n return false;\n };\n\n return editor.registerCommand(SELECTION_CHANGE_COMMAND, $selectionChangeHandler, COMMAND_PRIORITY_HIGH);\n }, [editor, setCursorPosition]);\n\n return null;\n};\n"],"names":["CursorPositionPlugin","editor","$selectionChangeHandler","selection","$isRangeSelection","isCollapsed","selectedNode","getNodes","at","$isSentinelNode","getNextSibling","focus","offset","getTextContentSize","getPreviousSibling","setCursorPosition"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAsBaA;;;eAAAA;;;;kCAtBmB;iCAQzB;iEACgB;AAahB,MAAMA,uBAA2E,CAAC,mBACzE;UAGZ,CAAAC,OAAMC,GAAAA,IAAAA,0CAA0B;oBAC9B,CAAMC;wCACN;kBACAA,YAAIA,IAAAA,8BAAc;mGACE;8BACX,QAAA,CAAAC,IAAAA,kCAAA,EAAAD,cAAA,CAAAA,UAAAE,WAAA,IAAA;kCACT;uBAEA;;0FAEyD;kBACzDC,eAAKA,UAAcC,QAAA,GAAAC,EAAA,CAAA;qEACV;+BACT;uBAEA;;8EAEoB;mDACX,EAAAF,eAAA;kCAIAG;;uBAEPA,IAAAA,iCAAO,EAAAH,iBAAA,CAAAA,aAAAI,cAAA,IAAA;kCAMPD;;uBAIAA,IAAAA,iCAAO,EAAAH,aAAAI,cAAA,OAAAP,UAAAQ,KAAA,CAAAC,MAAA,KAAAN,aAAAO,kBAAA,IAAA;kCAKAP;;uBAEPA,aAAOQ,kBAAA,OAAA,QAAAX,UAAAQ,KAAA,CAAAC,MAAA,KAAA,GAAA;kCACT;uBAEAG;;8BAEF;mBAEA;QACF;eAAId,OAAAA,eAAAA,CAAAA,yCAAAA,EAAAA,yBAAAA,sCAAAA;;;QAAQc;KAAAA;WAAkB;GAGhC,gDAAE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui-copilot/react-prompt-listbox",
3
- "version": "0.8.1-hotfix.1",
3
+ "version": "0.8.1-hotfix.2",
4
4
  "description": "PromptListbox for input components using EditorInput.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -12,15 +12,15 @@
12
12
  },
13
13
  "license": "MIT",
14
14
  "dependencies": {
15
- "@fluentui-copilot/chat-input-plugins": "0.4.2-hotfix.2",
16
- "@fluentui-copilot/react-chat-input-plugins": "0.4.10-hotfix.1",
17
- "@fluentui-copilot/react-editor-input": "0.4.11-hotfix.1",
18
- "@fluentui-copilot/react-input-listbox": "0.3.3-hotfix.1",
19
- "@fluentui-copilot/react-prompt-input": "0.8.1-hotfix.1",
20
- "@fluentui-copilot/react-provider": "0.11.3-hotfix.1",
21
- "@fluentui-copilot/react-text-editor": "0.4.1-hotfix.2",
22
- "@fluentui-copilot/text-editor": "0.3.1-hotfix.2",
23
- "@fluentui-copilot/tokens": "0.3.11-hotfix.1",
15
+ "@fluentui-copilot/chat-input-plugins": "0.4.2-hotfix.3",
16
+ "@fluentui-copilot/react-chat-input-plugins": "0.4.10-hotfix.2",
17
+ "@fluentui-copilot/react-editor-input": "0.4.11-hotfix.2",
18
+ "@fluentui-copilot/react-input-listbox": "0.3.3-hotfix.2",
19
+ "@fluentui-copilot/react-prompt-input": "0.8.1-hotfix.2",
20
+ "@fluentui-copilot/react-provider": "0.11.3-hotfix.2",
21
+ "@fluentui-copilot/react-text-editor": "0.4.1-hotfix.3",
22
+ "@fluentui-copilot/text-editor": "0.3.1-hotfix.3",
23
+ "@fluentui-copilot/tokens": "0.3.11-hotfix.2",
24
24
  "@swc/helpers": "^0.5.1"
25
25
  },
26
26
  "peerDependencies": {