@fluentui/react-utilities 9.22.0 → 9.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/CHANGELOG.md +20 -2
  2. package/dist/index.d.ts +59 -8
  3. package/lib/compose/assertSlots.js.map +1 -1
  4. package/lib/compose/constants.js.map +1 -1
  5. package/lib/compose/deprecated/getSlots.js.map +1 -1
  6. package/lib/compose/deprecated/getSlotsNext.js.map +1 -1
  7. package/lib/compose/deprecated/resolveShorthand.js.map +1 -1
  8. package/lib/compose/getIntrinsicElementProps.js.map +1 -1
  9. package/lib/compose/getSlotClassNameProp.js.map +1 -1
  10. package/lib/compose/index.js.map +1 -1
  11. package/lib/compose/isResolvedShorthand.js.map +1 -1
  12. package/lib/compose/isSlot.js.map +1 -1
  13. package/lib/compose/slot.js.map +1 -1
  14. package/lib/compose/types.js.map +1 -1
  15. package/lib/events/index.js.map +1 -1
  16. package/lib/events/mouseTouchHelpers.js.map +1 -1
  17. package/lib/hooks/index.js.map +1 -1
  18. package/lib/hooks/useAnimationFrame.js.map +1 -1
  19. package/lib/hooks/useBrowserTimer.js.map +1 -1
  20. package/lib/hooks/useControllableState.js.map +1 -1
  21. package/lib/hooks/useEventCallback.js.map +1 -1
  22. package/lib/hooks/useFirstMount.js.map +1 -1
  23. package/lib/hooks/useForceUpdate.js.map +1 -1
  24. package/lib/hooks/useId.js.map +1 -1
  25. package/lib/hooks/useIsomorphicLayoutEffect.js.map +1 -1
  26. package/lib/hooks/useMergedRefs.js.map +1 -1
  27. package/lib/hooks/useOnClickOutside.js.map +1 -1
  28. package/lib/hooks/useOnScrollOutside.js.map +1 -1
  29. package/lib/hooks/usePrevious.js.map +1 -1
  30. package/lib/hooks/useScrollbarWidth.js.map +1 -1
  31. package/lib/hooks/useTimeout.js.map +1 -1
  32. package/lib/index.js.map +1 -1
  33. package/lib/selection/index.js.map +1 -1
  34. package/lib/selection/types.js.map +1 -1
  35. package/lib/selection/useSelection.js.map +1 -1
  36. package/lib/ssr/SSRContext.js.map +1 -1
  37. package/lib/ssr/canUseDOM.js.map +1 -1
  38. package/lib/ssr/index.js.map +1 -1
  39. package/lib/trigger/applyTriggerPropsToChildren.js.map +1 -1
  40. package/lib/trigger/getTriggerChild.js.map +1 -1
  41. package/lib/trigger/index.js.map +1 -1
  42. package/lib/trigger/isFluentTrigger.js.map +1 -1
  43. package/lib/trigger/types.js.map +1 -1
  44. package/lib/utils/clamp.js.map +1 -1
  45. package/lib/utils/createSetFromIterable.js.map +1 -1
  46. package/lib/utils/generated-types.js +11 -0
  47. package/lib/utils/generated-types.js.map +1 -0
  48. package/lib/utils/getNativeElementProps.js.map +1 -1
  49. package/lib/utils/getRTLSafeKey.js.map +1 -1
  50. package/lib/utils/getReactCallbackName.js.map +1 -1
  51. package/lib/utils/index.js.map +1 -1
  52. package/lib/utils/isHTMLElement.js.map +1 -1
  53. package/lib/utils/isInteractiveHTMLElement.js.map +1 -1
  54. package/lib/utils/mergeCallbacks.js.map +1 -1
  55. package/lib/utils/omit.js.map +1 -1
  56. package/lib/utils/priorityQueue.js.map +1 -1
  57. package/lib/utils/properties.js.map +1 -1
  58. package/lib/utils/types.js.map +1 -1
  59. package/lib/virtualParent/elementContains.js.map +1 -1
  60. package/lib/virtualParent/getParent.js.map +1 -1
  61. package/lib/virtualParent/index.js.map +1 -1
  62. package/lib/virtualParent/isVirtualElement.js.map +1 -1
  63. package/lib/virtualParent/setVirtualParent.js.map +1 -1
  64. package/lib/virtualParent/types.js.map +1 -1
  65. package/lib-commonjs/compose/assertSlots.js.map +1 -1
  66. package/lib-commonjs/compose/constants.js.map +1 -1
  67. package/lib-commonjs/compose/deprecated/getSlots.js.map +1 -1
  68. package/lib-commonjs/compose/deprecated/getSlotsNext.js.map +1 -1
  69. package/lib-commonjs/compose/deprecated/resolveShorthand.js.map +1 -1
  70. package/lib-commonjs/compose/getIntrinsicElementProps.js.map +1 -1
  71. package/lib-commonjs/compose/getSlotClassNameProp.js.map +1 -1
  72. package/lib-commonjs/compose/index.js.map +1 -1
  73. package/lib-commonjs/compose/isResolvedShorthand.js.map +1 -1
  74. package/lib-commonjs/compose/isSlot.js.map +1 -1
  75. package/lib-commonjs/compose/slot.js.map +1 -1
  76. package/lib-commonjs/compose/types.js.map +1 -1
  77. package/lib-commonjs/events/index.js.map +1 -1
  78. package/lib-commonjs/events/mouseTouchHelpers.js.map +1 -1
  79. package/lib-commonjs/hooks/index.js.map +1 -1
  80. package/lib-commonjs/hooks/useAnimationFrame.js.map +1 -1
  81. package/lib-commonjs/hooks/useBrowserTimer.js.map +1 -1
  82. package/lib-commonjs/hooks/useControllableState.js.map +1 -1
  83. package/lib-commonjs/hooks/useEventCallback.js.map +1 -1
  84. package/lib-commonjs/hooks/useFirstMount.js.map +1 -1
  85. package/lib-commonjs/hooks/useForceUpdate.js.map +1 -1
  86. package/lib-commonjs/hooks/useId.js.map +1 -1
  87. package/lib-commonjs/hooks/useIsomorphicLayoutEffect.js.map +1 -1
  88. package/lib-commonjs/hooks/useMergedRefs.js.map +1 -1
  89. package/lib-commonjs/hooks/useOnClickOutside.js.map +1 -1
  90. package/lib-commonjs/hooks/useOnScrollOutside.js.map +1 -1
  91. package/lib-commonjs/hooks/usePrevious.js.map +1 -1
  92. package/lib-commonjs/hooks/useScrollbarWidth.js.map +1 -1
  93. package/lib-commonjs/hooks/useTimeout.js.map +1 -1
  94. package/lib-commonjs/index.js.map +1 -1
  95. package/lib-commonjs/selection/index.js.map +1 -1
  96. package/lib-commonjs/selection/types.js.map +1 -1
  97. package/lib-commonjs/selection/useSelection.js.map +1 -1
  98. package/lib-commonjs/ssr/SSRContext.js.map +1 -1
  99. package/lib-commonjs/ssr/canUseDOM.js.map +1 -1
  100. package/lib-commonjs/ssr/index.js.map +1 -1
  101. package/lib-commonjs/trigger/applyTriggerPropsToChildren.js.map +1 -1
  102. package/lib-commonjs/trigger/getTriggerChild.js.map +1 -1
  103. package/lib-commonjs/trigger/index.js.map +1 -1
  104. package/lib-commonjs/trigger/isFluentTrigger.js.map +1 -1
  105. package/lib-commonjs/trigger/types.js.map +1 -1
  106. package/lib-commonjs/utils/clamp.js.map +1 -1
  107. package/lib-commonjs/utils/createSetFromIterable.js.map +1 -1
  108. package/lib-commonjs/utils/generated-types.js +12 -0
  109. package/lib-commonjs/utils/generated-types.js.map +1 -0
  110. package/lib-commonjs/utils/getNativeElementProps.js.map +1 -1
  111. package/lib-commonjs/utils/getRTLSafeKey.js.map +1 -1
  112. package/lib-commonjs/utils/getReactCallbackName.js.map +1 -1
  113. package/lib-commonjs/utils/index.js.map +1 -1
  114. package/lib-commonjs/utils/isHTMLElement.js.map +1 -1
  115. package/lib-commonjs/utils/isInteractiveHTMLElement.js.map +1 -1
  116. package/lib-commonjs/utils/mergeCallbacks.js.map +1 -1
  117. package/lib-commonjs/utils/omit.js.map +1 -1
  118. package/lib-commonjs/utils/priorityQueue.js.map +1 -1
  119. package/lib-commonjs/utils/properties.js.map +1 -1
  120. package/lib-commonjs/utils/types.js.map +1 -1
  121. package/lib-commonjs/virtualParent/elementContains.js.map +1 -1
  122. package/lib-commonjs/virtualParent/getParent.js.map +1 -1
  123. package/lib-commonjs/virtualParent/index.js.map +1 -1
  124. package/lib-commonjs/virtualParent/isVirtualElement.js.map +1 -1
  125. package/lib-commonjs/virtualParent/setVirtualParent.js.map +1 -1
  126. package/lib-commonjs/virtualParent/types.js.map +1 -1
  127. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/useControllableState.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * @internal\n */\nexport type UseControllableStateOptions<State> = {\n /**\n * User-provided default state or initializer, for uncontrolled usage.\n */\n defaultState?: State | (() => State);\n /**\n * User-provided controlled state. `undefined` means internal state will be used.\n */\n state: State | undefined;\n /**\n * Used as the initial state if `state` and `defaultState` are both `undefined`.\n * If `undefined` is the correct initial state, pass that here.\n */\n initialState: State;\n};\n\nfunction isFactoryDispatch<State>(newState: React.SetStateAction<State>): newState is (prevState: State) => State {\n return typeof newState === 'function';\n}\n\n/**\n * @internal\n *\n * A [`useState`](https://reactjs.org/docs/hooks-reference.html#usestate)-like hook\n * to manage a value that could be either `controlled` or `uncontrolled`,\n * such as a checked state or text input string.\n *\n * @see https://react.dev/learn/sharing-state-between-components#controlled-and-uncontrolled-components for more details on `controlled`/`uncontrolled`\n *\n * @returns an array of the current value and an updater (dispatcher) function.\n * The updater function is referentially stable (won't change during the component's lifecycle).\n * It can take either a new value, or a function which is passed the previous value and returns the new value.\n *\n * ❗️❗️ Calls to the dispatcher will only modify the state if the state is `uncontrolled`.\n * Meaning that if a state is `controlled`, calls to the dispatcher do not modify the state.\n *\n */\nexport const useControllableState = <State>(\n options: UseControllableStateOptions<State>,\n): [State, React.Dispatch<React.SetStateAction<State>>] => {\n 'use no memo';\n\n if (process.env.NODE_ENV !== 'production') {\n if (options.state !== undefined && options.defaultState !== undefined) {\n // eslint-disable-next-line no-console\n console.error(/** #__DE-INDENT__ */ `\n @fluentui/react-utilities [useControllableState]:\n A component must be either controlled or uncontrolled (specify either the state or the defaultState, but not both).\n Decide between using a controlled or uncontrolled component and remove one of this props.\n More info: https://reactjs.org/link/controlled-components\n ${new Error().stack}\n `);\n }\n }\n const [internalState, setInternalState] = React.useState<State>(() => {\n if (options.defaultState === undefined) {\n return options.initialState;\n }\n return isInitializer(options.defaultState) ? options.defaultState() : options.defaultState;\n });\n\n // Heads up!\n // This part is specific for controlled mode and mocks behavior of React dispatcher function.\n\n const stateValueRef = React.useRef<State | undefined>(options.state);\n\n React.useEffect(() => {\n stateValueRef.current = options.state;\n }, [options.state]);\n\n const setControlledState = React.useCallback((newState: React.SetStateAction<State>) => {\n if (isFactoryDispatch(newState)) {\n newState(stateValueRef.current as State);\n }\n }, []);\n\n return useIsControlled(options.state) ? [options.state, setControlledState] : [internalState, setInternalState];\n};\n\nfunction isInitializer<State>(value: State | (() => State)): value is () => State {\n return typeof value === 'function';\n}\n\n/**\n * Helper hook to handle previous comparison of controlled/uncontrolled\n * Prints an error when isControlled value switches between subsequent renders\n * @returns - whether the value is controlled\n */\nconst useIsControlled = <V>(controlledValue: V | undefined): controlledValue is V => {\n 'use no memo';\n\n const [isControlled] = React.useState<boolean>(() => controlledValue !== undefined);\n\n if (process.env.NODE_ENV !== 'production') {\n // We don't want these warnings in production even though it is against native behaviour\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (isControlled !== (controlledValue !== undefined)) {\n const error = new Error();\n\n const controlWarning = isControlled\n ? 'a controlled value to be uncontrolled'\n : 'an uncontrolled value to be controlled';\n\n const undefinedWarning = isControlled ? 'defined to an undefined' : 'undefined to a defined';\n\n // eslint-disable-next-line no-console\n console.error(/** #__DE-INDENT__ */ `\n @fluentui/react-utilities [useControllableState]:\n A component is changing ${controlWarning}. This is likely caused by the value changing from ${undefinedWarning} value, which should not happen.\n Decide between using a controlled or uncontrolled input element for the lifetime of the component.\n More info: https://reactjs.org/link/controlled-components\n ${error.stack}\n `);\n }\n }, [isControlled, controlledValue]);\n }\n\n return isControlled;\n};\n"],"names":["useControllableState","isFactoryDispatch","newState","options","process","env","NODE_ENV","state","undefined","defaultState","console","error","Error","stack","internalState","setInternalState","React","useState","initialState","isInitializer","stateValueRef","useRef","useEffect","current","setControlledState","useCallback","useIsControlled","value","controlledValue","isControlled","controlWarning","undefinedWarning"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA0CaA;;;eAAAA;;;;iEA1CU;AAqBvB,SAASC,kBAAyBC,QAAqC;IACrE,OAAO,OAAOA,aAAa;AAC7B;AAmBO,MAAMF,uBAAuB,CAClCG;IAEA;IAEA,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAIH,QAAQI,KAAK,KAAKC,aAAaL,QAAQM,YAAY,KAAKD,WAAW;YACrE,sCAAsC;YACtCE,QAAQC,KAAK,CAAuB,CAAC;;;;AAKrC,EAAE,IAAIC,QAAQC,KAAK,CAAC,AACtB,CAAC;QACD;IACF;IACA,MAAM,CAACC,eAAeC,iBAAiB,GAAGC,OAAMC,QAAQ,CAAQ;QAC9D,IAAId,QAAQM,YAAY,KAAKD,WAAW;YACtC,OAAOL,QAAQe,YAAY;QAC7B;QACA,OAAOC,cAAchB,QAAQM,YAAY,IAAIN,QAAQM,YAAY,KAAKN,QAAQM,YAAY;IAC5F;IAEA,YAAY;IACZ,6FAA6F;IAE7F,MAAMW,gBAAgBJ,OAAMK,MAAM,CAAoBlB,QAAQI,KAAK;IAEnES,OAAMM,SAAS,CAAC;QACdF,cAAcG,OAAO,GAAGpB,QAAQI,KAAK;IACvC,GAAG;QAACJ,QAAQI,KAAK;KAAC;IAElB,MAAMiB,qBAAqBR,OAAMS,WAAW,CAAC,CAACvB;QAC5C,IAAID,kBAAkBC,WAAW;YAC/BA,SAASkB,cAAcG,OAAO;QAChC;IACF,GAAG,EAAE;IAEL,OAAOG,gBAAgBvB,QAAQI,KAAK,IAAI;QAACJ,QAAQI,KAAK;QAAEiB;KAAmB,GAAG;QAACV;QAAeC;KAAiB;AACjH;AAEA,SAASI,cAAqBQ,KAA4B;IACxD,OAAO,OAAOA,UAAU;AAC1B;AAEA;;;;CAIC,GACD,MAAMD,kBAAkB,CAAIE;IAC1B;IAEA,MAAM,CAACC,aAAa,GAAGb,OAAMC,QAAQ,CAAU,IAAMW,oBAAoBpB;IAEzE,IAAIJ,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,wFAAwF;QACxF,sDAAsD;QACtDU,OAAMM,SAAS,CAAC;YACd,IAAIO,iBAAkBD,CAAAA,oBAAoBpB,SAAQ,GAAI;gBACpD,MAAMG,QAAQ,IAAIC;gBAElB,MAAMkB,iBAAiBD,eACnB,0CACA;gBAEJ,MAAME,mBAAmBF,eAAe,4BAA4B;gBAEpE,sCAAsC;gBACtCnB,QAAQC,KAAK,CAAuB,CAAC;wBAEX,EAAEmB,eAAe,mDAAmD,EAAEC,iBAAiB;;;AAG/G,EAAEpB,MAAME,KAAK,CAAC,AAChB,CAAC;YACH;QACF,GAAG;YAACgB;YAAcD;SAAgB;IACpC;IAEA,OAAOC;AACT"}
1
+ {"version":3,"sources":["../src/hooks/useControllableState.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * @internal\n */\nexport type UseControllableStateOptions<State> = {\n /**\n * User-provided default state or initializer, for uncontrolled usage.\n */\n defaultState?: State | (() => State);\n /**\n * User-provided controlled state. `undefined` means internal state will be used.\n */\n state: State | undefined;\n /**\n * Used as the initial state if `state` and `defaultState` are both `undefined`.\n * If `undefined` is the correct initial state, pass that here.\n */\n initialState: State;\n};\n\nfunction isFactoryDispatch<State>(newState: React.SetStateAction<State>): newState is (prevState: State) => State {\n return typeof newState === 'function';\n}\n\n/**\n * @internal\n *\n * A [`useState`](https://reactjs.org/docs/hooks-reference.html#usestate)-like hook\n * to manage a value that could be either `controlled` or `uncontrolled`,\n * such as a checked state or text input string.\n *\n * @see https://react.dev/learn/sharing-state-between-components#controlled-and-uncontrolled-components for more details on `controlled`/`uncontrolled`\n *\n * @returns an array of the current value and an updater (dispatcher) function.\n * The updater function is referentially stable (won't change during the component's lifecycle).\n * It can take either a new value, or a function which is passed the previous value and returns the new value.\n *\n * ❗️❗️ Calls to the dispatcher will only modify the state if the state is `uncontrolled`.\n * Meaning that if a state is `controlled`, calls to the dispatcher do not modify the state.\n *\n */\nexport const useControllableState = <State>(\n options: UseControllableStateOptions<State>,\n): [State, React.Dispatch<React.SetStateAction<State>>] => {\n 'use no memo';\n\n if (process.env.NODE_ENV !== 'production') {\n if (options.state !== undefined && options.defaultState !== undefined) {\n // eslint-disable-next-line no-console\n console.error(/** #__DE-INDENT__ */ `\n @fluentui/react-utilities [useControllableState]:\n A component must be either controlled or uncontrolled (specify either the state or the defaultState, but not both).\n Decide between using a controlled or uncontrolled component and remove one of this props.\n More info: https://reactjs.org/link/controlled-components\n ${new Error().stack}\n `);\n }\n }\n const [internalState, setInternalState] = React.useState<State>(() => {\n if (options.defaultState === undefined) {\n return options.initialState;\n }\n return isInitializer(options.defaultState) ? options.defaultState() : options.defaultState;\n });\n\n // Heads up!\n // This part is specific for controlled mode and mocks behavior of React dispatcher function.\n\n const stateValueRef = React.useRef<State | undefined>(options.state);\n\n React.useEffect(() => {\n stateValueRef.current = options.state;\n }, [options.state]);\n\n const setControlledState = React.useCallback((newState: React.SetStateAction<State>) => {\n if (isFactoryDispatch(newState)) {\n newState(stateValueRef.current as State);\n }\n }, []);\n\n return useIsControlled(options.state) ? [options.state, setControlledState] : [internalState, setInternalState];\n};\n\nfunction isInitializer<State>(value: State | (() => State)): value is () => State {\n return typeof value === 'function';\n}\n\n/**\n * Helper hook to handle previous comparison of controlled/uncontrolled\n * Prints an error when isControlled value switches between subsequent renders\n * @returns - whether the value is controlled\n */\nconst useIsControlled = <V>(controlledValue: V | undefined): controlledValue is V => {\n 'use no memo';\n\n const [isControlled] = React.useState<boolean>(() => controlledValue !== undefined);\n\n if (process.env.NODE_ENV !== 'production') {\n // We don't want these warnings in production even though it is against native behaviour\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (isControlled !== (controlledValue !== undefined)) {\n const error = new Error();\n\n const controlWarning = isControlled\n ? 'a controlled value to be uncontrolled'\n : 'an uncontrolled value to be controlled';\n\n const undefinedWarning = isControlled ? 'defined to an undefined' : 'undefined to a defined';\n\n // eslint-disable-next-line no-console\n console.error(/** #__DE-INDENT__ */ `\n @fluentui/react-utilities [useControllableState]:\n A component is changing ${controlWarning}. This is likely caused by the value changing from ${undefinedWarning} value, which should not happen.\n Decide between using a controlled or uncontrolled input element for the lifetime of the component.\n More info: https://reactjs.org/link/controlled-components\n ${error.stack}\n `);\n }\n }, [isControlled, controlledValue]);\n }\n\n return isControlled;\n};\n"],"names":["useControllableState","isFactoryDispatch","newState","options","process","env","NODE_ENV","state","undefined","defaultState","console","error","Error","stack","internalState","setInternalState","React","useState","initialState","isInitializer","stateValueRef","useRef","useEffect","current","setControlledState","useCallback","useIsControlled","value","controlledValue","isControlled","controlWarning","undefinedWarning"],"mappings":";;;;+BA0CaA;;;eAAAA;;;;iEA1CU;AAqBvB,SAASC,kBAAyBC,QAAqC;IACrE,OAAO,OAAOA,aAAa;AAC7B;AAmBO,MAAMF,uBAAuB,CAClCG;IAEA;IAEA,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAIH,QAAQI,KAAK,KAAKC,aAAaL,QAAQM,YAAY,KAAKD,WAAW;YACrE,sCAAsC;YACtCE,QAAQC,KAAK,CAAuB,CAAC;;;;AAKrC,EAAE,IAAIC,QAAQC,KAAK,EACpB;QACD;IACF;IACA,MAAM,CAACC,eAAeC,iBAAiB,GAAGC,OAAMC,QAAQ,CAAQ;QAC9D,IAAId,QAAQM,YAAY,KAAKD,WAAW;YACtC,OAAOL,QAAQe,YAAY;QAC7B;QACA,OAAOC,cAAchB,QAAQM,YAAY,IAAIN,QAAQM,YAAY,KAAKN,QAAQM,YAAY;IAC5F;IAEA,YAAY;IACZ,6FAA6F;IAE7F,MAAMW,gBAAgBJ,OAAMK,MAAM,CAAoBlB,QAAQI,KAAK;IAEnES,OAAMM,SAAS,CAAC;QACdF,cAAcG,OAAO,GAAGpB,QAAQI,KAAK;IACvC,GAAG;QAACJ,QAAQI,KAAK;KAAC;IAElB,MAAMiB,qBAAqBR,OAAMS,WAAW,CAAC,CAACvB;QAC5C,IAAID,kBAAkBC,WAAW;YAC/BA,SAASkB,cAAcG,OAAO;QAChC;IACF,GAAG,EAAE;IAEL,OAAOG,gBAAgBvB,QAAQI,KAAK,IAAI;QAACJ,QAAQI,KAAK;QAAEiB;KAAmB,GAAG;QAACV;QAAeC;KAAiB;AACjH;AAEA,SAASI,cAAqBQ,KAA4B;IACxD,OAAO,OAAOA,UAAU;AAC1B;AAEA;;;;CAIC,GACD,MAAMD,kBAAkB,CAAIE;IAC1B;IAEA,MAAM,CAACC,aAAa,GAAGb,OAAMC,QAAQ,CAAU,IAAMW,oBAAoBpB;IAEzE,IAAIJ,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,wFAAwF;QACxF,sDAAsD;QACtDU,OAAMM,SAAS,CAAC;YACd,IAAIO,iBAAkBD,CAAAA,oBAAoBpB,SAAQ,GAAI;gBACpD,MAAMG,QAAQ,IAAIC;gBAElB,MAAMkB,iBAAiBD,eACnB,0CACA;gBAEJ,MAAME,mBAAmBF,eAAe,4BAA4B;gBAEpE,sCAAsC;gBACtCnB,QAAQC,KAAK,CAAuB,CAAC;wBAEX,EAAEmB,eAAe,mDAAmD,EAAEC,iBAAiB;;;AAG/G,EAAEpB,MAAME,KAAK,EACd;YACH;QACF,GAAG;YAACgB;YAAcD;SAAgB;IACpC;IAEA,OAAOC;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/useEventCallback.ts"],"sourcesContent":["import * as React from 'react';\nimport { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect';\n\n/**\n * @internal\n * https://reactjs.org/docs/hooks-faq.html#how-to-read-an-often-changing-value-from-usecallback\n *\n * Modified `useCallback` that can be used when dependencies change too frequently. Can occur when\n * e.g. user props are dependencies which could change on every render\n * e.g. volatile values (i.e. useState/useDispatch) are dependencies which could change frequently\n *\n * This should not be used often, but can be a useful re-render optimization since the callback is a ref and\n * will not be invalidated between re-renders\n *\n * @param fn - The callback function that will be used\n */\nexport const useEventCallback = <Args extends unknown[], Return>(fn: (...args: Args) => Return) => {\n const callbackRef = React.useRef<typeof fn>(() => {\n throw new Error('Cannot call an event handler while rendering');\n });\n\n useIsomorphicLayoutEffect(() => {\n callbackRef.current = fn;\n }, [fn]);\n\n return React.useCallback(\n (...args: Args) => {\n const callback = callbackRef.current;\n return callback(...args);\n },\n [callbackRef],\n );\n};\n"],"names":["useEventCallback","fn","callbackRef","React","useRef","Error","useIsomorphicLayoutEffect","current","useCallback","args","callback"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAgBaA;;;eAAAA;;;;iEAhBU;2CACmB;AAenC,MAAMA,mBAAmB,CAAiCC;IAC/D,MAAMC,cAAcC,OAAMC,MAAM,CAAY;QAC1C,MAAM,IAAIC,MAAM;IAClB;IAEAC,IAAAA,oDAAyB,EAAC;QACxBJ,YAAYK,OAAO,GAAGN;IACxB,GAAG;QAACA;KAAG;IAEP,OAAOE,OAAMK,WAAW,CACtB,CAAC,GAAGC;QACF,MAAMC,WAAWR,YAAYK,OAAO;QACpC,OAAOG,YAAYD;IACrB,GACA;QAACP;KAAY;AAEjB"}
1
+ {"version":3,"sources":["../src/hooks/useEventCallback.ts"],"sourcesContent":["import * as React from 'react';\nimport { useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect';\n\n/**\n * @internal\n * https://reactjs.org/docs/hooks-faq.html#how-to-read-an-often-changing-value-from-usecallback\n *\n * Modified `useCallback` that can be used when dependencies change too frequently. Can occur when\n * e.g. user props are dependencies which could change on every render\n * e.g. volatile values (i.e. useState/useDispatch) are dependencies which could change frequently\n *\n * This should not be used often, but can be a useful re-render optimization since the callback is a ref and\n * will not be invalidated between re-renders\n *\n * @param fn - The callback function that will be used\n */\nexport const useEventCallback = <Args extends unknown[], Return>(fn: (...args: Args) => Return) => {\n const callbackRef = React.useRef<typeof fn>(() => {\n throw new Error('Cannot call an event handler while rendering');\n });\n\n useIsomorphicLayoutEffect(() => {\n callbackRef.current = fn;\n }, [fn]);\n\n return React.useCallback(\n (...args: Args) => {\n const callback = callbackRef.current;\n return callback(...args);\n },\n [callbackRef],\n );\n};\n"],"names":["useEventCallback","fn","callbackRef","React","useRef","Error","useIsomorphicLayoutEffect","current","useCallback","args","callback"],"mappings":";;;;+BAgBaA;;;eAAAA;;;;iEAhBU;2CACmB;AAenC,MAAMA,mBAAmB,CAAiCC;IAC/D,MAAMC,cAAcC,OAAMC,MAAM,CAAY;QAC1C,MAAM,IAAIC,MAAM;IAClB;IAEAC,IAAAA,oDAAyB,EAAC;QACxBJ,YAAYK,OAAO,GAAGN;IACxB,GAAG;QAACA;KAAG;IAEP,OAAOE,OAAMK,WAAW,CACtB,CAAC,GAAGC;QACF,MAAMC,WAAWR,YAAYK,OAAO;QACpC,OAAOG,YAAYD;IACrB,GACA;QAACP;KAAY;AAEjB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/useFirstMount.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * @internal\n * Checks if components was mounted the first time.\n * Since concurrent mode will be released in the future this needs to be verified\n * Currently (React 17) will always render the initial mount once\n * https://codesandbox.io/s/heuristic-brook-s4w0q?file=/src/App.jsx\n * https://codesandbox.io/s/holy-grass-8nieu?file=/src/App.jsx\n *\n * @example\n * const isFirstMount = useFirstMount();\n */\nexport function useFirstMount(): boolean {\n const isFirst = React.useRef(true);\n\n if (isFirst.current) {\n isFirst.current = false;\n return true;\n }\n\n return isFirst.current;\n}\n"],"names":["useFirstMount","isFirst","React","useRef","current"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAagBA;;;eAAAA;;;;iEAbO;AAahB,SAASA;IACd,MAAMC,UAAUC,OAAMC,MAAM,CAAC;IAE7B,IAAIF,QAAQG,OAAO,EAAE;QACnBH,QAAQG,OAAO,GAAG;QAClB,OAAO;IACT;IAEA,OAAOH,QAAQG,OAAO;AACxB"}
1
+ {"version":3,"sources":["../src/hooks/useFirstMount.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * @internal\n * Checks if components was mounted the first time.\n * Since concurrent mode will be released in the future this needs to be verified\n * Currently (React 17) will always render the initial mount once\n * https://codesandbox.io/s/heuristic-brook-s4w0q?file=/src/App.jsx\n * https://codesandbox.io/s/holy-grass-8nieu?file=/src/App.jsx\n *\n * @example\n * const isFirstMount = useFirstMount();\n */\nexport function useFirstMount(): boolean {\n const isFirst = React.useRef(true);\n\n if (isFirst.current) {\n isFirst.current = false;\n return true;\n }\n\n return isFirst.current;\n}\n"],"names":["useFirstMount","isFirst","React","useRef","current"],"mappings":";;;;+BAagBA;;;eAAAA;;;;iEAbO;AAahB,SAASA;IACd,MAAMC,UAAUC,OAAMC,MAAM,CAAC;IAE7B,IAAIF,QAAQG,OAAO,EAAE;QACnBH,QAAQG,OAAO,GAAG;QAClB,OAAO;IACT;IAEA,OAAOH,QAAQG,OAAO;AACxB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/useForceUpdate.ts"],"sourcesContent":["import * as React from 'react';\n/**\n * @internal\n * Forces a re-render, similar to `forceUpdate` in class components.\n */\nexport function useForceUpdate() {\n return React.useReducer(x => x + 1, 0)[1];\n}\n"],"names":["useForceUpdate","React","useReducer","x"],"rangeMappings":";;;;;;;;;;;;;;","mappings":";;;;+BAKgBA;;;eAAAA;;;;iEALO;AAKhB,SAASA;IACd,OAAOC,OAAMC,UAAU,CAACC,CAAAA,IAAKA,IAAI,GAAG,EAAE,CAAC,EAAE;AAC3C"}
1
+ {"version":3,"sources":["../src/hooks/useForceUpdate.ts"],"sourcesContent":["import * as React from 'react';\n/**\n * @internal\n * Forces a re-render, similar to `forceUpdate` in class components.\n */\nexport function useForceUpdate() {\n return React.useReducer(x => x + 1, 0)[1];\n}\n"],"names":["useForceUpdate","React","useReducer","x"],"mappings":";;;;+BAKgBA;;;eAAAA;;;;iEALO;AAKhB,SAASA;IACd,OAAOC,OAAMC,UAAU,CAACC,CAAAA,IAAKA,IAAI,GAAG,EAAE,CAAC,EAAE;AAC3C"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/useId.ts"],"sourcesContent":["import * as React from 'react';\nimport { defaultSSRContextValue, useSSRContext } from '../ssr/index';\n\nconst IdPrefixContext = React.createContext<string | undefined>(undefined);\n\n/**\n * Allows to define a prefix that will be used for all IDs generated by useId() hook. It's useful to avoid collisions\n * between different bundles.\n */\nexport const IdPrefixProvider = IdPrefixContext.Provider;\n\nfunction useIdPrefix(): string {\n return React.useContext(IdPrefixContext) || '';\n}\n\n/**\n * Resets generated IDs, should be used only in tests.\n */\nexport function resetIdsForTests(): void {\n defaultSSRContextValue.current = 0;\n}\n\n/**\n * Hook to generate a unique ID.\n *\n * @param prefix - Optional prefix for the ID. Defaults to 'fui-'.\n * @param providedId - Optional id provided by a parent component. Defaults to the provided value if present,\n * without conditioning the hook call\n * @returns The ID\n */\nexport function useId(prefix: string = 'fui-', providedId?: string): string {\n 'use no memo';\n\n const contextValue = useSSRContext();\n const idPrefix = useIdPrefix();\n\n // Checking if useId is available on React, if it is, we use it to generate the id. String concatenation is used to\n // prevent bundlers from complaining with older versions of React.\n const _useId = (React as never)['use' + 'Id'] as (() => string) | undefined;\n\n if (_useId) {\n const generatedId = _useId();\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const escapedId = React.useMemo(() => generatedId.replace(/:/g, ''), [generatedId]);\n\n return providedId || `${idPrefix}${prefix}${escapedId}`;\n }\n\n // Hooks appear to be running conditionally, but they will always run in the same order since it's based on\n // the version of React being used. This is safe to ignore.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return React.useMemo(() => {\n if (providedId) {\n return providedId;\n }\n\n return `${idPrefix}${prefix}${++contextValue.current}`;\n }, [idPrefix, prefix, providedId, contextValue]);\n}\n"],"names":["IdPrefixProvider","resetIdsForTests","useId","IdPrefixContext","React","createContext","undefined","Provider","useIdPrefix","useContext","defaultSSRContextValue","current","prefix","providedId","contextValue","useSSRContext","idPrefix","_useId","generatedId","escapedId","useMemo","replace"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IASaA,gBAAgB;eAAhBA;;IASGC,gBAAgB;eAAhBA;;IAYAC,KAAK;eAALA;;;;iEA9BO;uBAC+B;AAEtD,MAAMC,kBAAkBC,OAAMC,aAAa,CAAqBC;AAMzD,MAAMN,mBAAmBG,gBAAgBI,QAAQ;AAExD,SAASC;IACP,OAAOJ,OAAMK,UAAU,CAACN,oBAAoB;AAC9C;AAKO,SAASF;IACdS,6BAAsB,CAACC,OAAO,GAAG;AACnC;AAUO,SAAST,MAAMU,SAAiB,MAAM,EAAEC,UAAmB;IAChE;IAEA,MAAMC,eAAeC,IAAAA,oBAAa;IAClC,MAAMC,WAAWR;IAEjB,mHAAmH;IACnH,kEAAkE;IAClE,MAAMS,SAAS,AAACb,MAAe,CAAC,QAAQ,KAAK;IAE7C,IAAIa,QAAQ;QACV,MAAMC,cAAcD;QAEpB,sDAAsD;QACtD,MAAME,YAAYf,OAAMgB,OAAO,CAAC,IAAMF,YAAYG,OAAO,CAAC,MAAM,KAAK;YAACH;SAAY;QAElF,OAAOL,cAAc,CAAC,EAAEG,SAAS,EAAEJ,OAAO,EAAEO,UAAU,CAAC;IACzD;IAEA,2GAA2G;IAC3G,2DAA2D;IAC3D,sDAAsD;IACtD,OAAOf,OAAMgB,OAAO,CAAC;QACnB,IAAIP,YAAY;YACd,OAAOA;QACT;QAEA,OAAO,CAAC,EAAEG,SAAS,EAAEJ,OAAO,EAAE,EAAEE,aAAaH,OAAO,CAAC,CAAC;IACxD,GAAG;QAACK;QAAUJ;QAAQC;QAAYC;KAAa;AACjD"}
1
+ {"version":3,"sources":["../src/hooks/useId.ts"],"sourcesContent":["import * as React from 'react';\nimport { defaultSSRContextValue, useSSRContext } from '../ssr/index';\n\nconst IdPrefixContext = React.createContext<string | undefined>(undefined);\n\n/**\n * Allows to define a prefix that will be used for all IDs generated by useId() hook. It's useful to avoid collisions\n * between different bundles.\n */\nexport const IdPrefixProvider = IdPrefixContext.Provider;\n\nfunction useIdPrefix(): string {\n return React.useContext(IdPrefixContext) || '';\n}\n\n/**\n * Resets generated IDs, should be used only in tests.\n */\nexport function resetIdsForTests(): void {\n defaultSSRContextValue.current = 0;\n}\n\n/**\n * Hook to generate a unique ID.\n *\n * @param prefix - Optional prefix for the ID. Defaults to 'fui-'.\n * @param providedId - Optional id provided by a parent component. Defaults to the provided value if present,\n * without conditioning the hook call\n * @returns The ID\n */\nexport function useId(prefix: string = 'fui-', providedId?: string): string {\n 'use no memo';\n\n const contextValue = useSSRContext();\n const idPrefix = useIdPrefix();\n\n // Checking if useId is available on React, if it is, we use it to generate the id. String concatenation is used to\n // prevent bundlers from complaining with older versions of React.\n const _useId = (React as never)['use' + 'Id'] as (() => string) | undefined;\n\n if (_useId) {\n const generatedId = _useId();\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const escapedId = React.useMemo(() => generatedId.replace(/:/g, ''), [generatedId]);\n\n return providedId || `${idPrefix}${prefix}${escapedId}`;\n }\n\n // Hooks appear to be running conditionally, but they will always run in the same order since it's based on\n // the version of React being used. This is safe to ignore.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return React.useMemo(() => {\n if (providedId) {\n return providedId;\n }\n\n return `${idPrefix}${prefix}${++contextValue.current}`;\n }, [idPrefix, prefix, providedId, contextValue]);\n}\n"],"names":["IdPrefixProvider","resetIdsForTests","useId","IdPrefixContext","React","createContext","undefined","Provider","useIdPrefix","useContext","defaultSSRContextValue","current","prefix","providedId","contextValue","useSSRContext","idPrefix","_useId","generatedId","escapedId","useMemo","replace"],"mappings":";;;;;;;;;;;IASaA,gBAAgB;eAAhBA;;IASGC,gBAAgB;eAAhBA;;IAYAC,KAAK;eAALA;;;;iEA9BO;uBAC+B;AAEtD,MAAMC,kBAAkBC,OAAMC,aAAa,CAAqBC;AAMzD,MAAMN,mBAAmBG,gBAAgBI,QAAQ;AAExD,SAASC;IACP,OAAOJ,OAAMK,UAAU,CAACN,oBAAoB;AAC9C;AAKO,SAASF;IACdS,6BAAsB,CAACC,OAAO,GAAG;AACnC;AAUO,SAAST,MAAMU,SAAiB,MAAM,EAAEC,UAAmB;IAChE;IAEA,MAAMC,eAAeC,IAAAA,oBAAa;IAClC,MAAMC,WAAWR;IAEjB,mHAAmH;IACnH,kEAAkE;IAClE,MAAMS,SAAS,AAACb,MAAe,CAAC,QAAQ,KAAK;IAE7C,IAAIa,QAAQ;QACV,MAAMC,cAAcD;QAEpB,sDAAsD;QACtD,MAAME,YAAYf,OAAMgB,OAAO,CAAC,IAAMF,YAAYG,OAAO,CAAC,MAAM,KAAK;YAACH;SAAY;QAElF,OAAOL,cAAc,GAAGG,WAAWJ,SAASO,WAAW;IACzD;IAEA,2GAA2G;IAC3G,2DAA2D;IAC3D,sDAAsD;IACtD,OAAOf,OAAMgB,OAAO,CAAC;QACnB,IAAIP,YAAY;YACd,OAAOA;QACT;QAEA,OAAO,GAAGG,WAAWJ,SAAS,EAAEE,aAAaH,OAAO,EAAE;IACxD,GAAG;QAACK;QAAUJ;QAAQC;QAAYC;KAAa;AACjD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/useIsomorphicLayoutEffect.ts"],"sourcesContent":["import * as React from 'react';\nimport { canUseDOM } from '../ssr/index';\n\n/**\n * React currently throws a warning when using useLayoutEffect on the server. To get around it, we can conditionally\n * useEffect on the server (no-op) and useLayoutEffect in the browser. We occasionally need useLayoutEffect to\n * ensure we don't get a render flash for certain operations, but we may also need affected components to render on\n * the server.\n *\n * https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85\n * https://github.com/reduxjs/react-redux/blob/master/src/utils/useIsomorphicLayoutEffect.js\n */\n// eslint-disable-next-line no-restricted-properties\nexport const useIsomorphicLayoutEffect: typeof React.useEffect = canUseDOM() ? React.useLayoutEffect : React.useEffect;\n"],"names":["useIsomorphicLayoutEffect","canUseDOM","React","useLayoutEffect","useEffect"],"rangeMappings":";;;;;;;;;;;;;","mappings":";;;;+BAaaA;;;eAAAA;;;;iEAbU;uBACG;AAYnB,MAAMA,4BAAoDC,IAAAA,gBAAS,MAAKC,OAAMC,eAAe,GAAGD,OAAME,SAAS"}
1
+ {"version":3,"sources":["../src/hooks/useIsomorphicLayoutEffect.ts"],"sourcesContent":["import * as React from 'react';\nimport { canUseDOM } from '../ssr/index';\n\n/**\n * React currently throws a warning when using useLayoutEffect on the server. To get around it, we can conditionally\n * useEffect on the server (no-op) and useLayoutEffect in the browser. We occasionally need useLayoutEffect to\n * ensure we don't get a render flash for certain operations, but we may also need affected components to render on\n * the server.\n *\n * https://gist.github.com/gaearon/e7d97cdf38a2907924ea12e4ebdf3c85\n * https://github.com/reduxjs/react-redux/blob/master/src/utils/useIsomorphicLayoutEffect.js\n */\n// eslint-disable-next-line no-restricted-properties\nexport const useIsomorphicLayoutEffect: typeof React.useEffect = canUseDOM() ? React.useLayoutEffect : React.useEffect;\n"],"names":["useIsomorphicLayoutEffect","canUseDOM","React","useLayoutEffect","useEffect"],"mappings":";;;;+BAaaA;;;eAAAA;;;;iEAbU;uBACG;AAYnB,MAAMA,4BAAoDC,IAAAA,gBAAS,MAAKC,OAAMC,eAAe,GAAGD,OAAME,SAAS"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/useMergedRefs.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * A Ref function which can be treated like a ref object in that it has an attached\n * current property, which will be updated as the ref is evaluated.\n */\nexport type RefObjectFunction<T> = React.RefObject<T> & ((value: T | null) => void);\n\n/** @internal */\ntype MutableRefObjectFunction<T> = React.MutableRefObject<T | null> & ((value: T | null) => void);\n\n/**\n * React hook to merge multiple React refs (either MutableRefObjects or ref callbacks) into a single ref callback that\n * updates all provided refs\n * @param refs - Refs to collectively update with one ref value.\n * @returns A function with an attached \"current\" prop, so that it can be treated like a RefObject.\n */\n// LegacyRef is actually not supported, but in React v18 types this is leaking directly from forwardRef component declaration\nexport function useMergedRefs<T>(...refs: (React.Ref<T> | undefined)[]): RefObjectFunction<T> {\n 'use no memo';\n\n const mergedCallback = React.useCallback(\n (value: T | null) => {\n // Update the \"current\" prop hanging on the function.\n mergedCallback.current = value;\n\n for (const ref of refs) {\n if (typeof ref === 'string' && process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error(/** #__DE-INDENT__ */ `\n @fluentui/react-utilities [useMergedRefs]:\n This hook does not support the usage of string refs. Please use React.useRef instead.\n\n For more info on 'React.useRef', see https://react.dev/reference/react/useRef.\n For more info on string refs, see https://react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-string-refs.\n `);\n }\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n // work around the immutability of the React.Ref type\n (ref as React.MutableRefObject<T | null>).current = value;\n }\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps -- already exhaustive\n [...refs],\n ) as MutableRefObjectFunction<T>;\n\n return mergedCallback;\n}\n"],"names":["useMergedRefs","refs","mergedCallback","React","useCallback","value","current","ref","process","env","NODE_ENV","console","error"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAkBgBA;;;eAAAA;;;;iEAlBO;AAkBhB,SAASA,cAAiB,GAAGC,IAAkC;IACpE;IAEA,MAAMC,iBAAiBC,OAAMC,WAAW,CACtC,CAACC;QACC,qDAAqD;QACrDH,eAAeI,OAAO,GAAGD;QAEzB,KAAK,MAAME,OAAON,KAAM;YACtB,IAAI,OAAOM,QAAQ,YAAYC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;gBACpE,sCAAsC;gBACtCC,QAAQC,KAAK,CAAuB,CAAC;;;;+GAMrC,CAAC;YACH;YACA,IAAI,OAAOL,QAAQ,YAAY;gBAC7BA,IAAIF;YACN,OAAO,IAAIE,KAAK;gBACd,qDAAqD;gBACpDA,IAAyCD,OAAO,GAAGD;YACtD;QACF;IACF,GACA,6EAA6E;IAC7E;WAAIJ;KAAK;IAGX,OAAOC;AACT"}
1
+ {"version":3,"sources":["../src/hooks/useMergedRefs.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * A Ref function which can be treated like a ref object in that it has an attached\n * current property, which will be updated as the ref is evaluated.\n */\nexport type RefObjectFunction<T> = React.RefObject<T> & ((value: T | null) => void);\n\n/** @internal */\ntype MutableRefObjectFunction<T> = React.MutableRefObject<T | null> & ((value: T | null) => void);\n\n/**\n * React hook to merge multiple React refs (either MutableRefObjects or ref callbacks) into a single ref callback that\n * updates all provided refs\n * @param refs - Refs to collectively update with one ref value.\n * @returns A function with an attached \"current\" prop, so that it can be treated like a RefObject.\n */\n// LegacyRef is actually not supported, but in React v18 types this is leaking directly from forwardRef component declaration\nexport function useMergedRefs<T>(...refs: (React.Ref<T> | undefined)[]): RefObjectFunction<T> {\n 'use no memo';\n\n const mergedCallback = React.useCallback(\n (value: T | null) => {\n // Update the \"current\" prop hanging on the function.\n mergedCallback.current = value;\n\n for (const ref of refs) {\n if (typeof ref === 'string' && process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error(/** #__DE-INDENT__ */ `\n @fluentui/react-utilities [useMergedRefs]:\n This hook does not support the usage of string refs. Please use React.useRef instead.\n\n For more info on 'React.useRef', see https://react.dev/reference/react/useRef.\n For more info on string refs, see https://react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-string-refs.\n `);\n }\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref) {\n // work around the immutability of the React.Ref type\n (ref as React.MutableRefObject<T | null>).current = value;\n }\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps -- already exhaustive\n [...refs],\n ) as MutableRefObjectFunction<T>;\n\n return mergedCallback;\n}\n"],"names":["useMergedRefs","refs","mergedCallback","React","useCallback","value","current","ref","process","env","NODE_ENV","console","error"],"mappings":";;;;+BAkBgBA;;;eAAAA;;;;iEAlBO;AAkBhB,SAASA,cAAiB,GAAGC,IAAkC;IACpE;IAEA,MAAMC,iBAAiBC,OAAMC,WAAW,CACtC,CAACC;QACC,qDAAqD;QACrDH,eAAeI,OAAO,GAAGD;QAEzB,KAAK,MAAME,OAAON,KAAM;YACtB,IAAI,OAAOM,QAAQ,YAAYC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;gBACpE,sCAAsC;gBACtCC,QAAQC,KAAK,CAAuB,CAAC;;;;+GAMrC,CAAC;YACH;YACA,IAAI,OAAOL,QAAQ,YAAY;gBAC7BA,IAAIF;YACN,OAAO,IAAIE,KAAK;gBACd,qDAAqD;gBACpDA,IAAyCD,OAAO,GAAGD;YACtD;QACF;IACF,GACA,6EAA6E;IAC7E;WAAIJ;KAAK;IAGX,OAAOC;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/useOnClickOutside.ts"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from './useEventCallback';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\n\n/**\n * @internal\n */\nexport type UseOnClickOrScrollOutsideOptions = {\n /**\n * The element to listen for the click event\n */\n element: Document | undefined;\n /**\n * Refs to elements that check if the click is outside\n */\n refs: React.MutableRefObject<HTMLElement | undefined | null>[];\n\n /**\n * By default uses element.contains, but custom contain function can be provided\n *\n * @param parent - provided parent element\n * @param child - event target element\n */\n contains?(parent: HTMLElement | null, child: HTMLElement): boolean;\n\n /**\n * Disables event listeners\n */\n disabled?: boolean;\n\n /**\n * Disables custom focus event listeners for iframes\n */\n disabledFocusOnIframe?: boolean;\n\n /**\n * Called if the click is outside the element refs\n */\n callback: (ev: MouseEvent | TouchEvent) => void;\n};\n\nconst DEFAULT_CONTAINS: UseOnClickOrScrollOutsideOptions['contains'] = (parent, child) => !!parent?.contains(child);\n\n/**\n * @internal\n * Utility to perform checks where a click/touch event was made outside a component\n */\nexport const useOnClickOutside = (options: UseOnClickOrScrollOutsideOptions) => {\n const { targetDocument } = useFluent();\n const win = targetDocument?.defaultView;\n const { refs, callback, element, disabled, disabledFocusOnIframe, contains = DEFAULT_CONTAINS } = options;\n const timeoutId = React.useRef<number | undefined>(undefined);\n\n useIFrameFocus({ element, disabled: disabledFocusOnIframe || disabled, callback, refs, contains });\n\n const isMouseDownInsideRef = React.useRef(false);\n const listener = useEventCallback((ev: MouseEvent | TouchEvent) => {\n if (isMouseDownInsideRef.current) {\n isMouseDownInsideRef.current = false;\n return;\n }\n\n const target = ev.composedPath()[0] as HTMLElement;\n const isOutside = refs.every(ref => !contains(ref.current || null, target));\n\n if (isOutside && !disabled) {\n callback(ev);\n }\n });\n\n const handleMouseDown = useEventCallback((ev: MouseEvent) => {\n // Selecting text from inside to outside will rigger click event.\n // In this case click event target is outside but mouse down event target is inside.\n // And this click event should be considered as inside click.\n isMouseDownInsideRef.current = refs.some(ref => contains(ref.current || null, ev.target as HTMLElement));\n });\n\n React.useEffect(() => {\n if (disabled) {\n return;\n }\n\n // Store the current event to avoid triggering handlers immediately\n // Note this depends on a deprecated but extremely well supported quirk of the web platform\n // https://github.com/facebook/react/issues/20074\n let currentEvent = getWindowEvent(win);\n\n const conditionalHandler = (event: MouseEvent | TouchEvent) => {\n // Skip if this event is the same as the one running when we added the handlers\n if (event === currentEvent) {\n currentEvent = undefined;\n return;\n }\n\n listener(event);\n };\n\n // use capture phase because React can update DOM before the event bubbles to the document\n element?.addEventListener('click', conditionalHandler, true);\n element?.addEventListener('touchstart', conditionalHandler, true);\n element?.addEventListener('contextmenu', conditionalHandler, true);\n element?.addEventListener('mousedown', handleMouseDown, true);\n\n // Garbage collect this event after it's no longer useful to avoid memory leaks\n timeoutId.current = win?.setTimeout(() => {\n currentEvent = undefined;\n }, 1);\n\n return () => {\n element?.removeEventListener('click', conditionalHandler, true);\n element?.removeEventListener('touchstart', conditionalHandler, true);\n element?.removeEventListener('contextmenu', conditionalHandler, true);\n element?.removeEventListener('mousedown', handleMouseDown, true);\n\n win?.clearTimeout(timeoutId.current);\n currentEvent = undefined;\n };\n }, [listener, element, disabled, handleMouseDown, win]);\n};\n\nconst getWindowEvent = (target: Node | Window | null | undefined): Event | undefined => {\n if (target) {\n if (typeof (target as Window).window === 'object' && (target as Window).window === target) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return target.event;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return (target as Node).ownerDocument?.defaultView?.event ?? undefined;\n }\n\n return undefined;\n};\n\nconst FUI_FRAME_EVENT = 'fuiframefocus';\n\ninterface UseIFrameFocusOptions\n extends Pick<UseOnClickOrScrollOutsideOptions, 'disabled' | 'element' | 'callback' | 'contains' | 'refs'> {\n /**\n * Millisecond duration to poll\n */\n pollDuration?: number;\n}\n\n/**\n * Since click events do not propagate past iframes, we use focus to detect if a\n * click has happened inside an iframe, since the only ways of focusing inside an\n * iframe are:\n * - clicking inside\n * - tabbing inside\n *\n * Polls the value of `document.activeElement`. If it is an iframe, then dispatch\n * a custom DOM event. When the custom event is received call the provided callback\n */\nconst useIFrameFocus = (options: UseIFrameFocusOptions) => {\n const {\n disabled,\n element: targetDocument,\n callback,\n contains = DEFAULT_CONTAINS,\n pollDuration = 100,\n refs,\n } = options;\n const timeoutRef = React.useRef<number>();\n\n const listener = useEventCallback((e: Event) => {\n const isOutside = refs.every(ref => !contains(ref.current || null, e.target as HTMLElement));\n\n if (isOutside && !disabled) {\n callback(e as MouseEvent);\n }\n });\n\n // Adds listener to the custom iframe focus event\n React.useEffect(() => {\n if (disabled) {\n return;\n }\n\n targetDocument?.addEventListener(FUI_FRAME_EVENT, listener, true);\n\n return () => {\n targetDocument?.removeEventListener(FUI_FRAME_EVENT, listener, true);\n };\n }, [targetDocument, disabled, listener]);\n\n // Starts polling for the active element\n React.useEffect(() => {\n if (disabled) {\n return;\n }\n\n timeoutRef.current = targetDocument?.defaultView?.setInterval(() => {\n const activeElement = targetDocument?.activeElement;\n\n if (activeElement?.tagName === 'IFRAME' || activeElement?.tagName === 'WEBVIEW') {\n const event = new CustomEvent(FUI_FRAME_EVENT, { bubbles: true });\n activeElement.dispatchEvent(event);\n }\n }, pollDuration);\n\n return () => {\n targetDocument?.defaultView?.clearTimeout(timeoutRef.current);\n };\n }, [targetDocument, disabled, pollDuration]);\n};\n"],"names":["useOnClickOutside","DEFAULT_CONTAINS","parent","child","contains","options","targetDocument","useFluent","win","defaultView","refs","callback","element","disabled","disabledFocusOnIframe","timeoutId","React","useRef","undefined","useIFrameFocus","isMouseDownInsideRef","listener","useEventCallback","ev","current","target","composedPath","isOutside","every","ref","handleMouseDown","some","useEffect","currentEvent","getWindowEvent","conditionalHandler","event","addEventListener","setTimeout","removeEventListener","clearTimeout","window","ownerDocument","FUI_FRAME_EVENT","pollDuration","timeoutRef","e","setInterval","activeElement","tagName","CustomEvent","bubbles","dispatchEvent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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"}
1
+ {"version":3,"sources":["../src/hooks/useOnClickOutside.ts"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from './useEventCallback';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\n\n/**\n * @internal\n */\nexport type UseOnClickOrScrollOutsideOptions = {\n /**\n * The element to listen for the click event\n */\n element: Document | undefined;\n /**\n * Refs to elements that check if the click is outside\n */\n refs: React.MutableRefObject<HTMLElement | undefined | null>[];\n\n /**\n * By default uses element.contains, but custom contain function can be provided\n *\n * @param parent - provided parent element\n * @param child - event target element\n */\n contains?(parent: HTMLElement | null, child: HTMLElement): boolean;\n\n /**\n * Disables event listeners\n */\n disabled?: boolean;\n\n /**\n * Disables custom focus event listeners for iframes\n */\n disabledFocusOnIframe?: boolean;\n\n /**\n * Called if the click is outside the element refs\n */\n callback: (ev: MouseEvent | TouchEvent) => void;\n};\n\nconst DEFAULT_CONTAINS: UseOnClickOrScrollOutsideOptions['contains'] = (parent, child) => !!parent?.contains(child);\n\n/**\n * @internal\n * Utility to perform checks where a click/touch event was made outside a component\n */\nexport const useOnClickOutside = (options: UseOnClickOrScrollOutsideOptions) => {\n const { targetDocument } = useFluent();\n const win = targetDocument?.defaultView;\n const { refs, callback, element, disabled, disabledFocusOnIframe, contains = DEFAULT_CONTAINS } = options;\n const timeoutId = React.useRef<number | undefined>(undefined);\n\n useIFrameFocus({ element, disabled: disabledFocusOnIframe || disabled, callback, refs, contains });\n\n const isMouseDownInsideRef = React.useRef(false);\n const listener = useEventCallback((ev: MouseEvent | TouchEvent) => {\n if (isMouseDownInsideRef.current) {\n isMouseDownInsideRef.current = false;\n return;\n }\n\n const target = ev.composedPath()[0] as HTMLElement;\n const isOutside = refs.every(ref => !contains(ref.current || null, target));\n\n if (isOutside && !disabled) {\n callback(ev);\n }\n });\n\n const handleMouseDown = useEventCallback((ev: MouseEvent) => {\n // Selecting text from inside to outside will rigger click event.\n // In this case click event target is outside but mouse down event target is inside.\n // And this click event should be considered as inside click.\n isMouseDownInsideRef.current = refs.some(ref => contains(ref.current || null, ev.target as HTMLElement));\n });\n\n React.useEffect(() => {\n if (disabled) {\n return;\n }\n\n // Store the current event to avoid triggering handlers immediately\n // Note this depends on a deprecated but extremely well supported quirk of the web platform\n // https://github.com/facebook/react/issues/20074\n let currentEvent = getWindowEvent(win);\n\n const conditionalHandler = (event: MouseEvent | TouchEvent) => {\n // Skip if this event is the same as the one running when we added the handlers\n if (event === currentEvent) {\n currentEvent = undefined;\n return;\n }\n\n listener(event);\n };\n\n // use capture phase because React can update DOM before the event bubbles to the document\n element?.addEventListener('click', conditionalHandler, true);\n element?.addEventListener('touchstart', conditionalHandler, true);\n element?.addEventListener('contextmenu', conditionalHandler, true);\n element?.addEventListener('mousedown', handleMouseDown, true);\n\n // Garbage collect this event after it's no longer useful to avoid memory leaks\n timeoutId.current = win?.setTimeout(() => {\n currentEvent = undefined;\n }, 1);\n\n return () => {\n element?.removeEventListener('click', conditionalHandler, true);\n element?.removeEventListener('touchstart', conditionalHandler, true);\n element?.removeEventListener('contextmenu', conditionalHandler, true);\n element?.removeEventListener('mousedown', handleMouseDown, true);\n\n win?.clearTimeout(timeoutId.current);\n currentEvent = undefined;\n };\n }, [listener, element, disabled, handleMouseDown, win]);\n};\n\nconst getWindowEvent = (target: Node | Window | null | undefined): Event | undefined => {\n if (target) {\n if (typeof (target as Window).window === 'object' && (target as Window).window === target) {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return target.event;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n return (target as Node).ownerDocument?.defaultView?.event ?? undefined;\n }\n\n return undefined;\n};\n\nconst FUI_FRAME_EVENT = 'fuiframefocus';\n\ninterface UseIFrameFocusOptions\n extends Pick<UseOnClickOrScrollOutsideOptions, 'disabled' | 'element' | 'callback' | 'contains' | 'refs'> {\n /**\n * Millisecond duration to poll\n */\n pollDuration?: number;\n}\n\n/**\n * Since click events do not propagate past iframes, we use focus to detect if a\n * click has happened inside an iframe, since the only ways of focusing inside an\n * iframe are:\n * - clicking inside\n * - tabbing inside\n *\n * Polls the value of `document.activeElement`. If it is an iframe, then dispatch\n * a custom DOM event. When the custom event is received call the provided callback\n */\nconst useIFrameFocus = (options: UseIFrameFocusOptions) => {\n const {\n disabled,\n element: targetDocument,\n callback,\n contains = DEFAULT_CONTAINS,\n pollDuration = 100,\n refs,\n } = options;\n const timeoutRef = React.useRef<number>();\n\n const listener = useEventCallback((e: Event) => {\n const isOutside = refs.every(ref => !contains(ref.current || null, e.target as HTMLElement));\n\n if (isOutside && !disabled) {\n callback(e as MouseEvent);\n }\n });\n\n // Adds listener to the custom iframe focus event\n React.useEffect(() => {\n if (disabled) {\n return;\n }\n\n targetDocument?.addEventListener(FUI_FRAME_EVENT, listener, true);\n\n return () => {\n targetDocument?.removeEventListener(FUI_FRAME_EVENT, listener, true);\n };\n }, [targetDocument, disabled, listener]);\n\n // Starts polling for the active element\n React.useEffect(() => {\n if (disabled) {\n return;\n }\n\n timeoutRef.current = targetDocument?.defaultView?.setInterval(() => {\n const activeElement = targetDocument?.activeElement;\n\n if (activeElement?.tagName === 'IFRAME' || activeElement?.tagName === 'WEBVIEW') {\n const event = new CustomEvent(FUI_FRAME_EVENT, { bubbles: true });\n activeElement.dispatchEvent(event);\n }\n }, pollDuration);\n\n return () => {\n targetDocument?.defaultView?.clearTimeout(timeoutRef.current);\n };\n }, [targetDocument, disabled, pollDuration]);\n};\n"],"names":["useOnClickOutside","DEFAULT_CONTAINS","parent","child","contains","options","targetDocument","useFluent","win","defaultView","refs","callback","element","disabled","disabledFocusOnIframe","timeoutId","React","useRef","undefined","useIFrameFocus","isMouseDownInsideRef","listener","useEventCallback","ev","current","target","composedPath","isOutside","every","ref","handleMouseDown","some","useEffect","currentEvent","getWindowEvent","conditionalHandler","event","addEventListener","setTimeout","removeEventListener","clearTimeout","window","ownerDocument","FUI_FRAME_EVENT","pollDuration","timeoutRef","e","setInterval","activeElement","tagName","CustomEvent","bubbles","dispatchEvent"],"mappings":";;;;+BA+CaA;;;eAAAA;;;;iEA/CU;kCACU;qCACe;AAuChD,MAAMC,mBAAiE,CAACC,QAAQC,QAAU,CAAC,EAACD,mBAAAA,6BAAAA,OAAQE,QAAQ,CAACD;AAMtG,MAAMH,oBAAoB,CAACK;IAChC,MAAM,EAAEC,cAAc,EAAE,GAAGC,IAAAA,uCAAS;IACpC,MAAMC,MAAMF,2BAAAA,qCAAAA,eAAgBG,WAAW;IACvC,MAAM,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,qBAAqB,EAAEV,WAAWH,gBAAgB,EAAE,GAAGI;IAClG,MAAMU,YAAYC,OAAMC,MAAM,CAAqBC;IAEnDC,eAAe;QAAEP;QAASC,UAAUC,yBAAyBD;QAAUF;QAAUD;QAAMN;IAAS;IAEhG,MAAMgB,uBAAuBJ,OAAMC,MAAM,CAAC;IAC1C,MAAMI,WAAWC,IAAAA,kCAAgB,EAAC,CAACC;QACjC,IAAIH,qBAAqBI,OAAO,EAAE;YAChCJ,qBAAqBI,OAAO,GAAG;YAC/B;QACF;QAEA,MAAMC,SAASF,GAAGG,YAAY,EAAE,CAAC,EAAE;QACnC,MAAMC,YAAYjB,KAAKkB,KAAK,CAACC,CAAAA,MAAO,CAACzB,SAASyB,IAAIL,OAAO,IAAI,MAAMC;QAEnE,IAAIE,aAAa,CAACd,UAAU;YAC1BF,SAASY;QACX;IACF;IAEA,MAAMO,kBAAkBR,IAAAA,kCAAgB,EAAC,CAACC;QACxC,iEAAiE;QACjE,oFAAoF;QACpF,6DAA6D;QAC7DH,qBAAqBI,OAAO,GAAGd,KAAKqB,IAAI,CAACF,CAAAA,MAAOzB,SAASyB,IAAIL,OAAO,IAAI,MAAMD,GAAGE,MAAM;IACzF;IAEAT,OAAMgB,SAAS,CAAC;QACd,IAAInB,UAAU;YACZ;QACF;QAEA,mEAAmE;QACnE,2FAA2F;QAC3F,iDAAiD;QACjD,IAAIoB,eAAeC,eAAe1B;QAElC,MAAM2B,qBAAqB,CAACC;YAC1B,+EAA+E;YAC/E,IAAIA,UAAUH,cAAc;gBAC1BA,eAAef;gBACf;YACF;YAEAG,SAASe;QACX;QAEA,0FAA0F;QAC1FxB,oBAAAA,8BAAAA,QAASyB,gBAAgB,CAAC,SAASF,oBAAoB;QACvDvB,oBAAAA,8BAAAA,QAASyB,gBAAgB,CAAC,cAAcF,oBAAoB;QAC5DvB,oBAAAA,8BAAAA,QAASyB,gBAAgB,CAAC,eAAeF,oBAAoB;QAC7DvB,oBAAAA,8BAAAA,QAASyB,gBAAgB,CAAC,aAAaP,iBAAiB;QAExD,+EAA+E;QAC/Ef,UAAUS,OAAO,GAAGhB,gBAAAA,0BAAAA,IAAK8B,UAAU,CAAC;YAClCL,eAAef;QACjB,GAAG;QAEH,OAAO;YACLN,oBAAAA,8BAAAA,QAAS2B,mBAAmB,CAAC,SAASJ,oBAAoB;YAC1DvB,oBAAAA,8BAAAA,QAAS2B,mBAAmB,CAAC,cAAcJ,oBAAoB;YAC/DvB,oBAAAA,8BAAAA,QAAS2B,mBAAmB,CAAC,eAAeJ,oBAAoB;YAChEvB,oBAAAA,8BAAAA,QAAS2B,mBAAmB,CAAC,aAAaT,iBAAiB;YAE3DtB,gBAAAA,0BAAAA,IAAKgC,YAAY,CAACzB,UAAUS,OAAO;YACnCS,eAAef;QACjB;IACF,GAAG;QAACG;QAAUT;QAASC;QAAUiB;QAAiBtB;KAAI;AACxD;AAEA,MAAM0B,iBAAiB,CAACT;IACtB,IAAIA,QAAQ;YAOH,mCAAA;QANP,IAAI,OAAO,AAACA,OAAkBgB,MAAM,KAAK,YAAY,AAAChB,OAAkBgB,MAAM,KAAKhB,QAAQ;YACzF,4DAA4D;YAC5D,OAAOA,OAAOW,KAAK;QACrB;YAGO;QADP,4DAA4D;QAC5D,OAAO,CAAA,2CAAA,wBAAA,AAACX,OAAgBiB,aAAa,cAA9B,6CAAA,oCAAA,sBAAgCjC,WAAW,cAA3C,wDAAA,kCAA6C2B,KAAK,cAAlD,qDAAA,0CAAsDlB;IAC/D;IAEA,OAAOA;AACT;AAEA,MAAMyB,kBAAkB;AAUxB;;;;;;;;;CASC,GACD,MAAMxB,iBAAiB,CAACd;IACtB,MAAM,EACJQ,QAAQ,EACRD,SAASN,cAAc,EACvBK,QAAQ,EACRP,WAAWH,gBAAgB,EAC3B2C,eAAe,GAAG,EAClBlC,IAAI,EACL,GAAGL;IACJ,MAAMwC,aAAa7B,OAAMC,MAAM;IAE/B,MAAMI,WAAWC,IAAAA,kCAAgB,EAAC,CAACwB;QACjC,MAAMnB,YAAYjB,KAAKkB,KAAK,CAACC,CAAAA,MAAO,CAACzB,SAASyB,IAAIL,OAAO,IAAI,MAAMsB,EAAErB,MAAM;QAE3E,IAAIE,aAAa,CAACd,UAAU;YAC1BF,SAASmC;QACX;IACF;IAEA,iDAAiD;IACjD9B,OAAMgB,SAAS,CAAC;QACd,IAAInB,UAAU;YACZ;QACF;QAEAP,2BAAAA,qCAAAA,eAAgB+B,gBAAgB,CAACM,iBAAiBtB,UAAU;QAE5D,OAAO;YACLf,2BAAAA,qCAAAA,eAAgBiC,mBAAmB,CAACI,iBAAiBtB,UAAU;QACjE;IACF,GAAG;QAACf;QAAgBO;QAAUQ;KAAS;IAEvC,wCAAwC;IACxCL,OAAMgB,SAAS,CAAC;YAKO1B;QAJrB,IAAIO,UAAU;YACZ;QACF;QAEAgC,WAAWrB,OAAO,GAAGlB,2BAAAA,sCAAAA,8BAAAA,eAAgBG,WAAW,cAA3BH,kDAAAA,4BAA6ByC,WAAW,CAAC;YAC5D,MAAMC,gBAAgB1C,2BAAAA,qCAAAA,eAAgB0C,aAAa;YAEnD,IAAIA,CAAAA,0BAAAA,oCAAAA,cAAeC,OAAO,MAAK,YAAYD,CAAAA,0BAAAA,oCAAAA,cAAeC,OAAO,MAAK,WAAW;gBAC/E,MAAMb,QAAQ,IAAIc,YAAYP,iBAAiB;oBAAEQ,SAAS;gBAAK;gBAC/DH,cAAcI,aAAa,CAAChB;YAC9B;QACF,GAAGQ;QAEH,OAAO;gBACLtC;YAAAA,2BAAAA,sCAAAA,8BAAAA,eAAgBG,WAAW,cAA3BH,kDAAAA,4BAA6BkC,YAAY,CAACK,WAAWrB,OAAO;QAC9D;IACF,GAAG;QAAClB;QAAgBO;QAAU+B;KAAa;AAC7C"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/useOnScrollOutside.ts"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from './useEventCallback';\nimport type { UseOnClickOrScrollOutsideOptions } from './useOnClickOutside';\n\n/**\n * @internal\n * Utility to perform checks where a click/touch event was made outside a component\n */\nexport const useOnScrollOutside = (options: UseOnClickOrScrollOutsideOptions) => {\n const { refs, callback, element, disabled, contains: containsProp } = options;\n\n const listener = useEventCallback((ev: MouseEvent | TouchEvent) => {\n const contains: UseOnClickOrScrollOutsideOptions['contains'] =\n containsProp || ((parent, child) => !!parent?.contains(child));\n\n const target = ev.composedPath()[0] as HTMLElement;\n const isOutside = refs.every(ref => !contains(ref.current || null, target));\n\n if (isOutside && !disabled) {\n callback(ev);\n }\n });\n\n React.useEffect(() => {\n if (disabled) {\n return;\n }\n\n element?.addEventListener('wheel', listener);\n element?.addEventListener('touchmove', listener);\n\n return () => {\n element?.removeEventListener('wheel', listener);\n element?.removeEventListener('touchmove', listener);\n };\n }, [listener, element, disabled]);\n};\n"],"names":["useOnScrollOutside","options","refs","callback","element","disabled","contains","containsProp","listener","useEventCallback","ev","parent","child","target","composedPath","isOutside","every","ref","current","React","useEffect","addEventListener","removeEventListener"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;kCACU;AAO1B,MAAMA,qBAAqB,CAACC;IACjC,MAAM,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,UAAUC,YAAY,EAAE,GAAGN;IAEtE,MAAMO,WAAWC,IAAAA,kCAAgB,EAAC,CAACC;QACjC,MAAMJ,WACJC,gBAAiB,CAAA,CAACI,QAAQC,QAAU,CAAC,EAACD,mBAAAA,6BAAAA,OAAQL,QAAQ,CAACM,OAAK;QAE9D,MAAMC,SAASH,GAAGI,YAAY,EAAE,CAAC,EAAE;QACnC,MAAMC,YAAYb,KAAKc,KAAK,CAACC,CAAAA,MAAO,CAACX,SAASW,IAAIC,OAAO,IAAI,MAAML;QAEnE,IAAIE,aAAa,CAACV,UAAU;YAC1BF,SAASO;QACX;IACF;IAEAS,OAAMC,SAAS,CAAC;QACd,IAAIf,UAAU;YACZ;QACF;QAEAD,oBAAAA,8BAAAA,QAASiB,gBAAgB,CAAC,SAASb;QACnCJ,oBAAAA,8BAAAA,QAASiB,gBAAgB,CAAC,aAAab;QAEvC,OAAO;YACLJ,oBAAAA,8BAAAA,QAASkB,mBAAmB,CAAC,SAASd;YACtCJ,oBAAAA,8BAAAA,QAASkB,mBAAmB,CAAC,aAAad;QAC5C;IACF,GAAG;QAACA;QAAUJ;QAASC;KAAS;AAClC"}
1
+ {"version":3,"sources":["../src/hooks/useOnScrollOutside.ts"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback } from './useEventCallback';\nimport type { UseOnClickOrScrollOutsideOptions } from './useOnClickOutside';\n\n/**\n * @internal\n * Utility to perform checks where a click/touch event was made outside a component\n */\nexport const useOnScrollOutside = (options: UseOnClickOrScrollOutsideOptions) => {\n const { refs, callback, element, disabled, contains: containsProp } = options;\n\n const listener = useEventCallback((ev: MouseEvent | TouchEvent) => {\n const contains: UseOnClickOrScrollOutsideOptions['contains'] =\n containsProp || ((parent, child) => !!parent?.contains(child));\n\n const target = ev.composedPath()[0] as HTMLElement;\n const isOutside = refs.every(ref => !contains(ref.current || null, target));\n\n if (isOutside && !disabled) {\n callback(ev);\n }\n });\n\n React.useEffect(() => {\n if (disabled) {\n return;\n }\n\n element?.addEventListener('wheel', listener);\n element?.addEventListener('touchmove', listener);\n\n return () => {\n element?.removeEventListener('wheel', listener);\n element?.removeEventListener('touchmove', listener);\n };\n }, [listener, element, disabled]);\n};\n"],"names":["useOnScrollOutside","options","refs","callback","element","disabled","contains","containsProp","listener","useEventCallback","ev","parent","child","target","composedPath","isOutside","every","ref","current","React","useEffect","addEventListener","removeEventListener"],"mappings":";;;;+BAQaA;;;eAAAA;;;;iEARU;kCACU;AAO1B,MAAMA,qBAAqB,CAACC;IACjC,MAAM,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,UAAUC,YAAY,EAAE,GAAGN;IAEtE,MAAMO,WAAWC,IAAAA,kCAAgB,EAAC,CAACC;QACjC,MAAMJ,WACJC,gBAAiB,CAAA,CAACI,QAAQC,QAAU,CAAC,EAACD,mBAAAA,6BAAAA,OAAQL,QAAQ,CAACM,OAAK;QAE9D,MAAMC,SAASH,GAAGI,YAAY,EAAE,CAAC,EAAE;QACnC,MAAMC,YAAYb,KAAKc,KAAK,CAACC,CAAAA,MAAO,CAACX,SAASW,IAAIC,OAAO,IAAI,MAAML;QAEnE,IAAIE,aAAa,CAACV,UAAU;YAC1BF,SAASO;QACX;IACF;IAEAS,OAAMC,SAAS,CAAC;QACd,IAAIf,UAAU;YACZ;QACF;QAEAD,oBAAAA,8BAAAA,QAASiB,gBAAgB,CAAC,SAASb;QACnCJ,oBAAAA,8BAAAA,QAASiB,gBAAgB,CAAC,aAAab;QAEvC,OAAO;YACLJ,oBAAAA,8BAAAA,QAASkB,mBAAmB,CAAC,SAASd;YACtCJ,oBAAAA,8BAAAA,QAASkB,mBAAmB,CAAC,aAAad;QAC5C;IACF,GAAG;QAACA;QAAUJ;QAASC;KAAS;AAClC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/usePrevious.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * @internal\n */\nexport const usePrevious = <ValueType = unknown>(value: ValueType) => {\n const ref = React.useRef<ValueType | null>(null);\n React.useEffect(() => {\n ref.current = value;\n }, [value]);\n return ref.current;\n};\n"],"names":["usePrevious","value","ref","React","useRef","useEffect","current"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAKaA;;;eAAAA;;;;iEALU;AAKhB,MAAMA,cAAc,CAAsBC;IAC/C,MAAMC,MAAMC,OAAMC,MAAM,CAAmB;IAC3CD,OAAME,SAAS,CAAC;QACdH,IAAII,OAAO,GAAGL;IAChB,GAAG;QAACA;KAAM;IACV,OAAOC,IAAII,OAAO;AACpB"}
1
+ {"version":3,"sources":["../src/hooks/usePrevious.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * @internal\n */\nexport const usePrevious = <ValueType = unknown>(value: ValueType) => {\n const ref = React.useRef<ValueType | null>(null);\n React.useEffect(() => {\n ref.current = value;\n }, [value]);\n return ref.current;\n};\n"],"names":["usePrevious","value","ref","React","useRef","useEffect","current"],"mappings":";;;;+BAKaA;;;eAAAA;;;;iEALU;AAKhB,MAAMA,cAAc,CAAsBC;IAC/C,MAAMC,MAAMC,OAAMC,MAAM,CAAmB;IAC3CD,OAAME,SAAS,CAAC;QACdH,IAAII,OAAO,GAAGL;IAChB,GAAG;QAACA;KAAM;IACV,OAAOC,IAAII,OAAO;AACpB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/useScrollbarWidth.ts"],"sourcesContent":["import * as React from 'react';\n\nconst cache = new WeakMap<Document, number>();\n\ninterface UseScrollbarWidthOptions {\n /**\n * Reference document to measure the scrollbar width\n */\n targetDocument: Document | null | undefined;\n\n /**\n * Does not use the cache and recalculates the scrollbar width\n */\n force?: boolean;\n}\n\n/**\n * @returns The width in pixels of the scrollbar in the user agent\n */\nexport function useScrollbarWidth(options: UseScrollbarWidthOptions) {\n const { targetDocument, force } = options;\n return React.useMemo(() => {\n if (!targetDocument) {\n return 0;\n }\n\n if (!force && cache.has(targetDocument)) {\n return cache.get(targetDocument);\n }\n\n const outer = targetDocument.createElement('div');\n outer.style.visibility = 'hidden';\n outer.style.overflow = 'scroll';\n\n const inner = targetDocument.createElement('div');\n outer.appendChild(inner);\n\n targetDocument.body.appendChild(outer);\n const scrollbarWidth = outer.offsetWidth - inner.offsetWidth;\n outer.remove();\n cache.set(targetDocument, scrollbarWidth);\n return scrollbarWidth;\n }, [targetDocument, force]);\n}\n"],"names":["useScrollbarWidth","cache","WeakMap","options","targetDocument","force","React","useMemo","has","get","outer","createElement","style","visibility","overflow","inner","appendChild","body","scrollbarWidth","offsetWidth","remove","set"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAmBgBA;;;eAAAA;;;;iEAnBO;AAEvB,MAAMC,QAAQ,IAAIC;AAiBX,SAASF,kBAAkBG,OAAiC;IACjE,MAAM,EAAEC,cAAc,EAAEC,KAAK,EAAE,GAAGF;IAClC,OAAOG,OAAMC,OAAO,CAAC;QACnB,IAAI,CAACH,gBAAgB;YACnB,OAAO;QACT;QAEA,IAAI,CAACC,SAASJ,MAAMO,GAAG,CAACJ,iBAAiB;YACvC,OAAOH,MAAMQ,GAAG,CAACL;QACnB;QAEA,MAAMM,QAAQN,eAAeO,aAAa,CAAC;QAC3CD,MAAME,KAAK,CAACC,UAAU,GAAG;QACzBH,MAAME,KAAK,CAACE,QAAQ,GAAG;QAEvB,MAAMC,QAAQX,eAAeO,aAAa,CAAC;QAC3CD,MAAMM,WAAW,CAACD;QAElBX,eAAea,IAAI,CAACD,WAAW,CAACN;QAChC,MAAMQ,iBAAiBR,MAAMS,WAAW,GAAGJ,MAAMI,WAAW;QAC5DT,MAAMU,MAAM;QACZnB,MAAMoB,GAAG,CAACjB,gBAAgBc;QAC1B,OAAOA;IACT,GAAG;QAACd;QAAgBC;KAAM;AAC5B"}
1
+ {"version":3,"sources":["../src/hooks/useScrollbarWidth.ts"],"sourcesContent":["import * as React from 'react';\n\nconst cache = new WeakMap<Document, number>();\n\ninterface UseScrollbarWidthOptions {\n /**\n * Reference document to measure the scrollbar width\n */\n targetDocument: Document | null | undefined;\n\n /**\n * Does not use the cache and recalculates the scrollbar width\n */\n force?: boolean;\n}\n\n/**\n * @returns The width in pixels of the scrollbar in the user agent\n */\nexport function useScrollbarWidth(options: UseScrollbarWidthOptions) {\n const { targetDocument, force } = options;\n return React.useMemo(() => {\n if (!targetDocument) {\n return 0;\n }\n\n if (!force && cache.has(targetDocument)) {\n return cache.get(targetDocument);\n }\n\n const outer = targetDocument.createElement('div');\n outer.style.visibility = 'hidden';\n outer.style.overflow = 'scroll';\n\n const inner = targetDocument.createElement('div');\n outer.appendChild(inner);\n\n targetDocument.body.appendChild(outer);\n const scrollbarWidth = outer.offsetWidth - inner.offsetWidth;\n outer.remove();\n cache.set(targetDocument, scrollbarWidth);\n return scrollbarWidth;\n }, [targetDocument, force]);\n}\n"],"names":["useScrollbarWidth","cache","WeakMap","options","targetDocument","force","React","useMemo","has","get","outer","createElement","style","visibility","overflow","inner","appendChild","body","scrollbarWidth","offsetWidth","remove","set"],"mappings":";;;;+BAmBgBA;;;eAAAA;;;;iEAnBO;AAEvB,MAAMC,QAAQ,IAAIC;AAiBX,SAASF,kBAAkBG,OAAiC;IACjE,MAAM,EAAEC,cAAc,EAAEC,KAAK,EAAE,GAAGF;IAClC,OAAOG,OAAMC,OAAO,CAAC;QACnB,IAAI,CAACH,gBAAgB;YACnB,OAAO;QACT;QAEA,IAAI,CAACC,SAASJ,MAAMO,GAAG,CAACJ,iBAAiB;YACvC,OAAOH,MAAMQ,GAAG,CAACL;QACnB;QAEA,MAAMM,QAAQN,eAAeO,aAAa,CAAC;QAC3CD,MAAME,KAAK,CAACC,UAAU,GAAG;QACzBH,MAAME,KAAK,CAACE,QAAQ,GAAG;QAEvB,MAAMC,QAAQX,eAAeO,aAAa,CAAC;QAC3CD,MAAMM,WAAW,CAACD;QAElBX,eAAea,IAAI,CAACD,WAAW,CAACN;QAChC,MAAMQ,iBAAiBR,MAAMS,WAAW,GAAGJ,MAAMI,WAAW;QAC5DT,MAAMU,MAAM;QACZnB,MAAMoB,GAAG,CAACjB,gBAAgBc;QAC1B,OAAOA;IACT,GAAG;QAACd;QAAgBC;KAAM;AAC5B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/hooks/useTimeout.ts"],"sourcesContent":["import { useBrowserTimer } from './useBrowserTimer';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\n\nconst setTimeoutNoop = (_callback: Function) => -1;\nconst clearTimeoutNoop = (_handle: number) => undefined;\n\n/**\n * @internal\n * Helper to manage a browser timeout.\n * Ensures that the timeout isn't set multiple times at once and is cleaned up\n * when the component is unloaded.\n *\n * @returns A pair of [setTimeout, clearTimeout] that are stable between renders.\n */\nexport function useTimeout() {\n const { targetDocument } = useFluent();\n const win = targetDocument?.defaultView;\n\n const setTimerFn = win ? win.setTimeout : setTimeoutNoop;\n const clearTimerFn = win ? win.clearTimeout : clearTimeoutNoop;\n\n return useBrowserTimer(setTimerFn, clearTimerFn);\n}\n"],"names":["useTimeout","setTimeoutNoop","_callback","clearTimeoutNoop","_handle","undefined","targetDocument","useFluent","win","defaultView","setTimerFn","setTimeout","clearTimerFn","clearTimeout","useBrowserTimer"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAcgBA;;;eAAAA;;;iCAdgB;qCACgB;AAEhD,MAAMC,iBAAiB,CAACC,YAAwB,CAAC;AACjD,MAAMC,mBAAmB,CAACC,UAAoBC;AAUvC,SAASL;IACd,MAAM,EAAEM,cAAc,EAAE,GAAGC,IAAAA,uCAAS;IACpC,MAAMC,MAAMF,2BAAAA,qCAAAA,eAAgBG,WAAW;IAEvC,MAAMC,aAAaF,MAAMA,IAAIG,UAAU,GAAGV;IAC1C,MAAMW,eAAeJ,MAAMA,IAAIK,YAAY,GAAGV;IAE9C,OAAOW,IAAAA,gCAAe,EAACJ,YAAYE;AACrC"}
1
+ {"version":3,"sources":["../src/hooks/useTimeout.ts"],"sourcesContent":["import { useBrowserTimer } from './useBrowserTimer';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\n\nconst setTimeoutNoop = (_callback: Function) => -1;\nconst clearTimeoutNoop = (_handle: number) => undefined;\n\n/**\n * @internal\n * Helper to manage a browser timeout.\n * Ensures that the timeout isn't set multiple times at once and is cleaned up\n * when the component is unloaded.\n *\n * @returns A pair of [setTimeout, clearTimeout] that are stable between renders.\n */\nexport function useTimeout() {\n const { targetDocument } = useFluent();\n const win = targetDocument?.defaultView;\n\n const setTimerFn = win ? win.setTimeout : setTimeoutNoop;\n const clearTimerFn = win ? win.clearTimeout : clearTimeoutNoop;\n\n return useBrowserTimer(setTimerFn, clearTimerFn);\n}\n"],"names":["useTimeout","setTimeoutNoop","_callback","clearTimeoutNoop","_handle","undefined","targetDocument","useFluent","win","defaultView","setTimerFn","setTimeout","clearTimerFn","clearTimeout","useBrowserTimer"],"mappings":";;;;+BAcgBA;;;eAAAA;;;iCAdgB;qCACgB;AAEhD,MAAMC,iBAAiB,CAACC,YAAwB,CAAC;AACjD,MAAMC,mBAAmB,CAACC,UAAoBC;AAUvC,SAASL;IACd,MAAM,EAAEM,cAAc,EAAE,GAAGC,IAAAA,uCAAS;IACpC,MAAMC,MAAMF,2BAAAA,qCAAAA,eAAgBG,WAAW;IAEvC,MAAMC,aAAaF,MAAMA,IAAIG,UAAU,GAAGV;IAC1C,MAAMW,eAAeJ,MAAMA,IAAIK,YAAY,GAAGV;IAE9C,OAAOW,IAAAA,gCAAe,EAACJ,YAAYE;AACrC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n slot,\n isSlot,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n getSlots,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n getSlotsNext,\n assertSlots,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n resolveShorthand,\n isResolvedShorthand,\n getIntrinsicElementProps,\n getSlotClassNameProp_unstable,\n SLOT_CLASS_NAME_PROP_SYMBOL,\n SLOT_ELEMENT_TYPE_SYMBOL,\n SLOT_RENDER_FUNCTION_SYMBOL,\n} from './compose/index';\nexport type {\n ExtractSlotProps,\n ComponentProps,\n ComponentState,\n ForwardRefComponent,\n RefAttributes,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ResolveShorthandFunction,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ResolveShorthandOptions,\n Slot,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n Slots,\n SlotClassNames,\n SlotPropsRecord,\n SlotRenderFunction,\n SlotShorthandValue,\n UnknownSlotProps,\n SlotComponentType,\n SlotOptions,\n InferredElementRefType,\n EventData,\n EventHandler,\n} from './compose/index';\n\nexport {\n IdPrefixProvider,\n resetIdsForTests,\n useAnimationFrame,\n useControllableState,\n useEventCallback,\n useFirstMount,\n useForceUpdate,\n useId,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n useOnClickOutside,\n useOnScrollOutside,\n usePrevious,\n useScrollbarWidth,\n useTimeout,\n} from './hooks/index';\nexport type { RefObjectFunction, UseControllableStateOptions, UseOnClickOrScrollOutsideOptions } from './hooks/index';\n\nexport { canUseDOM, useIsSSR, SSRProvider } from './ssr/index';\n\nexport {\n clamp,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n getNativeElementProps,\n getPartitionedNativeProps,\n getRTLSafeKey,\n mergeCallbacks,\n isHTMLElement,\n isInteractiveHTMLElement,\n omit,\n createPriorityQueue,\n} from './utils/index';\n\nexport type { DistributiveOmit, UnionToIntersection } from './utils/types';\n\nexport type { PriorityQueue } from './utils/priorityQueue';\n\nexport { applyTriggerPropsToChildren, getTriggerChild, isFluentTrigger } from './trigger/index';\n\nexport type { FluentTriggerComponent, TriggerProps } from './trigger/index';\n\n/**\n * Event utils\n */\nexport type { NativeTouchOrMouseEvent, ReactTouchOrMouseEvent, TouchOrMouseEvent } from './events/index';\nexport { isTouchEvent, isMouseEvent, getEventClientCoords } from './events/index';\n\nexport type {\n SelectionMode,\n OnSelectionChangeCallback,\n OnSelectionChangeData,\n SelectionItemId,\n SelectionHookParams,\n SelectionMethods,\n} from './selection/index';\nexport { useSelection } from './selection/index';\n\nexport { elementContains, setVirtualParent, getParent } from './virtualParent/index';\n"],"names":["IdPrefixProvider","SLOT_CLASS_NAME_PROP_SYMBOL","SLOT_ELEMENT_TYPE_SYMBOL","SLOT_RENDER_FUNCTION_SYMBOL","SSRProvider","applyTriggerPropsToChildren","assertSlots","canUseDOM","clamp","createPriorityQueue","elementContains","getEventClientCoords","getIntrinsicElementProps","getNativeElementProps","getParent","getPartitionedNativeProps","getRTLSafeKey","getSlotClassNameProp_unstable","getSlots","getSlotsNext","getTriggerChild","isFluentTrigger","isHTMLElement","isInteractiveHTMLElement","isMouseEvent","isResolvedShorthand","isSlot","isTouchEvent","mergeCallbacks","omit","resetIdsForTests","resolveShorthand","setVirtualParent","slot","useAnimationFrame","useControllableState","useEventCallback","useFirstMount","useForceUpdate","useId","useIsSSR","useIsomorphicLayoutEffect","useMergedRefs","useOnClickOutside","useOnScrollOutside","usePrevious","useScrollbarWidth","useSelection","useTimeout"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IA2CEA,gBAAgB;eAAhBA,wBAAgB;;IA9BhBC,2BAA2B;eAA3BA,kCAA2B;;IAC3BC,wBAAwB;eAAxBA,+BAAwB;;IACxBC,2BAA2B;eAA3BA,kCAA2B;;IA8CCC,WAAW;eAAXA,mBAAW;;IAmBhCC,2BAA2B;eAA3BA,mCAA2B;;IAzElCC,WAAW;eAAXA,kBAAW;;IAsDJC,SAAS;eAATA,iBAAS;;IAGhBC,KAAK;eAALA,aAAK;;IASLC,mBAAmB;eAAnBA,2BAAmB;;IA2BZC,eAAe;eAAfA,uBAAe;;IAZaC,oBAAoB;eAApBA,4BAAoB;;IA7EvDC,wBAAwB;eAAxBA,+BAAwB;;IAsDxB,4DAA4D;IAC5DC,qBAAqB;eAArBA,6BAAqB;;IAkCqBC,SAAS;eAATA,iBAAS;;IAjCnDC,yBAAyB;eAAzBA,iCAAyB;;IACzBC,aAAa;eAAbA,qBAAa;;IAxDbC,6BAA6B;eAA7BA,oCAA6B;;IAT7B,4DAA4D;IAC5DC,QAAQ;eAARA,eAAQ;;IACR,4DAA4D;IAC5DC,YAAY;eAAZA,mBAAY;;IA0EwBC,eAAe;eAAfA,uBAAe;;IAAEC,eAAe;eAAfA,uBAAe;;IAVpEC,aAAa;eAAbA,qBAAa;;IACbC,wBAAwB;eAAxBA,gCAAwB;;IAiBHC,YAAY;eAAZA,oBAAY;;IA9EjCC,mBAAmB;eAAnBA,0BAAmB;;IARnBC,MAAM;eAANA,aAAM;;IAsFCC,YAAY;eAAZA,oBAAY;;IAnBnBC,cAAc;eAAdA,sBAAc;;IAGdC,IAAI;eAAJA,YAAI;;IA5BJC,gBAAgB;eAAhBA,wBAAgB;;IApChB,4DAA4D;IAC5DC,gBAAgB;eAAhBA,uBAAgB;;IA2FQC,gBAAgB;eAAhBA,wBAAgB;;IAnGxCC,IAAI;eAAJA,WAAI;;IA4CJC,iBAAiB;eAAjBA,yBAAiB;;IACjBC,oBAAoB;eAApBA,4BAAoB;;IACpBC,gBAAgB;eAAhBA,wBAAgB;;IAChBC,aAAa;eAAbA,qBAAa;;IACbC,cAAc;eAAdA,sBAAc;;IACdC,KAAK;eAALA,aAAK;;IAWaC,QAAQ;eAARA,gBAAQ;;IAV1BC,yBAAyB;eAAzBA,iCAAyB;;IACzBC,aAAa;eAAbA,qBAAa;;IACbC,iBAAiB;eAAjBA,yBAAiB;;IACjBC,kBAAkB;eAAlBA,0BAAkB;;IAClBC,WAAW;eAAXA,mBAAW;;IACXC,iBAAiB;eAAjBA,yBAAiB;;IA0CVC,YAAY;eAAZA,oBAAY;;IAzCnBC,UAAU;eAAVA,kBAAU;;;uBAzCL;wBA0CA;wBAG0C;wBAa1C;wBAMuE;wBAQb;wBAUpC;wBAEgC"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export {\n slot,\n isSlot,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n getSlots,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n getSlotsNext,\n assertSlots,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n resolveShorthand,\n isResolvedShorthand,\n getIntrinsicElementProps,\n getSlotClassNameProp_unstable,\n SLOT_CLASS_NAME_PROP_SYMBOL,\n SLOT_ELEMENT_TYPE_SYMBOL,\n SLOT_RENDER_FUNCTION_SYMBOL,\n} from './compose/index';\nexport type {\n ExtractSlotProps,\n ComponentProps,\n ComponentState,\n ForwardRefComponent,\n RefAttributes,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ResolveShorthandFunction,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n ResolveShorthandOptions,\n Slot,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n Slots,\n SlotClassNames,\n SlotPropsRecord,\n SlotRenderFunction,\n SlotShorthandValue,\n UnknownSlotProps,\n SlotComponentType,\n SlotOptions,\n InferredElementRefType,\n EventData,\n EventHandler,\n} from './compose/index';\n\nexport {\n IdPrefixProvider,\n resetIdsForTests,\n useAnimationFrame,\n useControllableState,\n useEventCallback,\n useFirstMount,\n useForceUpdate,\n useId,\n useIsomorphicLayoutEffect,\n useMergedRefs,\n useOnClickOutside,\n useOnScrollOutside,\n usePrevious,\n useScrollbarWidth,\n useTimeout,\n} from './hooks/index';\nexport type { RefObjectFunction, UseControllableStateOptions, UseOnClickOrScrollOutsideOptions } from './hooks/index';\n\nexport { canUseDOM, useIsSSR, SSRProvider } from './ssr/index';\n\nexport {\n clamp,\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n getNativeElementProps,\n getPartitionedNativeProps,\n getRTLSafeKey,\n mergeCallbacks,\n isHTMLElement,\n isInteractiveHTMLElement,\n omit,\n createPriorityQueue,\n} from './utils/index';\n\nexport type {\n DistributiveOmit,\n UnionToIntersection,\n JSXElement,\n JSXIntrinsicElement,\n JSXIntrinsicElementKeys,\n} from './utils/types';\n\nexport type { PriorityQueue } from './utils/priorityQueue';\n\nexport { applyTriggerPropsToChildren, getTriggerChild, isFluentTrigger } from './trigger/index';\n\nexport type { FluentTriggerComponent, TriggerProps } from './trigger/index';\n\n/**\n * Event utils\n */\nexport type { NativeTouchOrMouseEvent, ReactTouchOrMouseEvent, TouchOrMouseEvent } from './events/index';\nexport { isTouchEvent, isMouseEvent, getEventClientCoords } from './events/index';\n\nexport type {\n SelectionMode,\n OnSelectionChangeCallback,\n OnSelectionChangeData,\n SelectionItemId,\n SelectionHookParams,\n SelectionMethods,\n} from './selection/index';\nexport { useSelection } from './selection/index';\n\nexport { elementContains, setVirtualParent, getParent } from './virtualParent/index';\n"],"names":["IdPrefixProvider","SLOT_CLASS_NAME_PROP_SYMBOL","SLOT_ELEMENT_TYPE_SYMBOL","SLOT_RENDER_FUNCTION_SYMBOL","SSRProvider","applyTriggerPropsToChildren","assertSlots","canUseDOM","clamp","createPriorityQueue","elementContains","getEventClientCoords","getIntrinsicElementProps","getNativeElementProps","getParent","getPartitionedNativeProps","getRTLSafeKey","getSlotClassNameProp_unstable","getSlots","getSlotsNext","getTriggerChild","isFluentTrigger","isHTMLElement","isInteractiveHTMLElement","isMouseEvent","isResolvedShorthand","isSlot","isTouchEvent","mergeCallbacks","omit","resetIdsForTests","resolveShorthand","setVirtualParent","slot","useAnimationFrame","useControllableState","useEventCallback","useFirstMount","useForceUpdate","useId","useIsSSR","useIsomorphicLayoutEffect","useMergedRefs","useOnClickOutside","useOnScrollOutside","usePrevious","useScrollbarWidth","useSelection","useTimeout"],"mappings":";;;;;;;;;;;IA2CEA,gBAAgB;eAAhBA,wBAAgB;;IA9BhBC,2BAA2B;eAA3BA,kCAA2B;;IAC3BC,wBAAwB;eAAxBA,+BAAwB;;IACxBC,2BAA2B;eAA3BA,kCAA2B;;IA8CCC,WAAW;eAAXA,mBAAW;;IAyBhCC,2BAA2B;eAA3BA,mCAA2B;;IA/ElCC,WAAW;eAAXA,kBAAW;;IAsDJC,SAAS;eAATA,iBAAS;;IAGhBC,KAAK;eAALA,aAAK;;IASLC,mBAAmB;eAAnBA,2BAAmB;;IAiCZC,eAAe;eAAfA,uBAAe;;IAZaC,oBAAoB;eAApBA,4BAAoB;;IAnFvDC,wBAAwB;eAAxBA,+BAAwB;;IAsDxB,4DAA4D;IAC5DC,qBAAqB;eAArBA,6BAAqB;;IAwCqBC,SAAS;eAATA,iBAAS;;IAvCnDC,yBAAyB;eAAzBA,iCAAyB;;IACzBC,aAAa;eAAbA,qBAAa;;IAxDbC,6BAA6B;eAA7BA,oCAA6B;;IAT7B,4DAA4D;IAC5DC,QAAQ;eAARA,eAAQ;;IACR,4DAA4D;IAC5DC,YAAY;eAAZA,mBAAY;;IAgFwBC,eAAe;eAAfA,uBAAe;;IAAEC,eAAe;eAAfA,uBAAe;;IAhBpEC,aAAa;eAAbA,qBAAa;;IACbC,wBAAwB;eAAxBA,gCAAwB;;IAuBHC,YAAY;eAAZA,oBAAY;;IApFjCC,mBAAmB;eAAnBA,0BAAmB;;IARnBC,MAAM;eAANA,aAAM;;IA4FCC,YAAY;eAAZA,oBAAY;;IAzBnBC,cAAc;eAAdA,sBAAc;;IAGdC,IAAI;eAAJA,YAAI;;IA5BJC,gBAAgB;eAAhBA,wBAAgB;;IApChB,4DAA4D;IAC5DC,gBAAgB;eAAhBA,uBAAgB;;IAiGQC,gBAAgB;eAAhBA,wBAAgB;;IAzGxCC,IAAI;eAAJA,WAAI;;IA4CJC,iBAAiB;eAAjBA,yBAAiB;;IACjBC,oBAAoB;eAApBA,4BAAoB;;IACpBC,gBAAgB;eAAhBA,wBAAgB;;IAChBC,aAAa;eAAbA,qBAAa;;IACbC,cAAc;eAAdA,sBAAc;;IACdC,KAAK;eAALA,aAAK;;IAWaC,QAAQ;eAARA,gBAAQ;;IAV1BC,yBAAyB;eAAzBA,iCAAyB;;IACzBC,aAAa;eAAbA,qBAAa;;IACbC,iBAAiB;eAAjBA,yBAAiB;;IACjBC,kBAAkB;eAAlBA,0BAAkB;;IAClBC,WAAW;eAAXA,mBAAW;;IACXC,iBAAiB;eAAjBA,yBAAiB;;IAgDVC,YAAY;eAAZA,oBAAY;;IA/CnBC,UAAU;eAAVA,kBAAU;;;uBAzCL;wBA0CA;wBAG0C;wBAa1C;wBAYuE;wBAQb;wBAUpC;wBAEgC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/selection/index.ts"],"sourcesContent":["export type {\n OnSelectionChangeCallback,\n OnSelectionChangeData,\n SelectionHookParams,\n SelectionItemId,\n SelectionMethods,\n SelectionMode,\n} from './types';\nexport { useSelection } from './useSelection';\n"],"names":["useSelection"],"rangeMappings":";;;;;;;;;;","mappings":";;;;+BAQSA;;;eAAAA,0BAAY;;;8BAAQ"}
1
+ {"version":3,"sources":["../src/selection/index.ts"],"sourcesContent":["export type {\n OnSelectionChangeCallback,\n OnSelectionChangeData,\n SelectionHookParams,\n SelectionItemId,\n SelectionMethods,\n SelectionMode,\n} from './types';\nexport { useSelection } from './useSelection';\n"],"names":["useSelection"],"mappings":";;;;+BAQSA;;;eAAAA,0BAAY;;;8BAAQ"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/selection/types.ts"],"sourcesContent":["import * as React from 'react';\n\nexport type SelectionMode = 'single' | 'multiselect';\n\nexport interface SelectionMethods {\n toggleItem(event: React.SyntheticEvent, id: SelectionItemId): void;\n selectItem(event: React.SyntheticEvent, id: SelectionItemId): void;\n deselectItem(event: React.SyntheticEvent, id: SelectionItemId): void;\n clearItems(event: React.SyntheticEvent): void;\n isSelected(id: SelectionItemId): boolean;\n toggleAllItems(event: React.SyntheticEvent, itemIds: SelectionItemId[]): void;\n}\n\nexport type SelectionItemId = string | number;\n\nexport type OnSelectionChangeCallback = (event: React.SyntheticEvent, selectedItems: Set<SelectionItemId>) => void;\n\nexport type OnSelectionChangeData = {\n selectedItems: Set<SelectionItemId>;\n};\n\nexport type SelectionHookParams = {\n selectionMode: SelectionMode;\n /**\n * Used in uncontrolled mode to set initial selected items on mount\n */\n defaultSelectedItems?: Iterable<SelectionItemId>;\n /**\n * Used to control selected items\n */\n selectedItems?: Iterable<SelectionItemId>;\n /**\n * Called when selection changes\n */\n onSelectionChange?(event: React.SyntheticEvent, data: OnSelectionChangeData): void;\n};\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
1
+ {"version":3,"sources":["../src/selection/types.ts"],"sourcesContent":["import * as React from 'react';\n\nexport type SelectionMode = 'single' | 'multiselect';\n\nexport interface SelectionMethods {\n toggleItem(event: React.SyntheticEvent, id: SelectionItemId): void;\n selectItem(event: React.SyntheticEvent, id: SelectionItemId): void;\n deselectItem(event: React.SyntheticEvent, id: SelectionItemId): void;\n clearItems(event: React.SyntheticEvent): void;\n isSelected(id: SelectionItemId): boolean;\n toggleAllItems(event: React.SyntheticEvent, itemIds: SelectionItemId[]): void;\n}\n\nexport type SelectionItemId = string | number;\n\nexport type OnSelectionChangeCallback = (event: React.SyntheticEvent, selectedItems: Set<SelectionItemId>) => void;\n\nexport type OnSelectionChangeData = {\n selectedItems: Set<SelectionItemId>;\n};\n\nexport type SelectionHookParams = {\n selectionMode: SelectionMode;\n /**\n * Used in uncontrolled mode to set initial selected items on mount\n */\n defaultSelectedItems?: Iterable<SelectionItemId>;\n /**\n * Used to control selected items\n */\n selectedItems?: Iterable<SelectionItemId>;\n /**\n * Called when selection changes\n */\n onSelectionChange?(event: React.SyntheticEvent, data: OnSelectionChangeData): void;\n};\n"],"names":[],"mappings":";;;;;iEAAuB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/selection/useSelection.ts"],"sourcesContent":["import * as React from 'react';\nimport { SelectionHookParams, SelectionItemId, SelectionMethods } from './types';\nimport { useControllableState } from '../hooks/useControllableState';\nimport { createSetFromIterable } from '../utils/createSetFromIterable';\n\nfunction useSelectionState(params: Omit<SelectionHookParams, 'selectionMode'>) {\n const [selected, setSelected] = useControllableState<Set<SelectionItemId>>({\n initialState: new Set(),\n defaultState: React.useMemo(\n () => params.defaultSelectedItems && createSetFromIterable(params.defaultSelectedItems),\n [params.defaultSelectedItems],\n ),\n state: React.useMemo(\n () => params.selectedItems && createSetFromIterable(params.selectedItems),\n [params.selectedItems],\n ),\n });\n const changeSelection = (event: React.SyntheticEvent, nextSelectedItems: Set<SelectionItemId>) => {\n params.onSelectionChange?.(event, { selectedItems: nextSelectedItems });\n setSelected(nextSelectedItems);\n };\n return [selected, changeSelection] as const;\n}\n\nfunction useSingleSelection(params: Omit<SelectionHookParams, 'selectionMode'>) {\n const [selected, changeSelection] = useSelectionState(params);\n const methods: SelectionMethods = {\n deselectItem: event => changeSelection(event, new Set()),\n selectItem: (event, itemId) => changeSelection(event, new Set([itemId])),\n toggleAllItems: () => {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('[react-utilities]: `toggleAllItems` should not be used in single selection mode');\n }\n },\n toggleItem: (event, itemId) => changeSelection(event, new Set([itemId])),\n clearItems: event => changeSelection(event, new Set()),\n isSelected: itemId => selected.has(itemId) ?? false,\n };\n return [selected, methods] as const;\n}\n\nfunction useMultipleSelection(params: Omit<SelectionHookParams, 'selectionMode'>) {\n const [selected, changeSelection] = useSelectionState(params);\n const methods: SelectionMethods = {\n toggleItem: (event, itemId) => {\n const nextSelectedItems = new Set(selected);\n if (selected.has(itemId)) {\n nextSelectedItems.delete(itemId);\n } else {\n nextSelectedItems.add(itemId);\n }\n changeSelection(event, nextSelectedItems);\n },\n selectItem: (event, itemId) => {\n const nextSelectedItems = new Set(selected);\n nextSelectedItems.add(itemId);\n changeSelection(event, nextSelectedItems);\n },\n deselectItem: (event, itemId) => {\n const nextSelectedItems = new Set(selected);\n nextSelectedItems.delete(itemId);\n changeSelection(event, nextSelectedItems);\n },\n clearItems: event => {\n changeSelection(event, new Set());\n },\n isSelected: itemId => selected.has(itemId),\n toggleAllItems: (event, itemIds) => {\n const allItemsSelected = itemIds.every(itemId => selected.has(itemId));\n const nextSelectedItems = new Set(selected);\n if (allItemsSelected) {\n nextSelectedItems.clear();\n } else {\n itemIds.forEach(itemId => nextSelectedItems.add(itemId));\n }\n changeSelection(event, nextSelectedItems);\n },\n };\n return [selected, methods] as const;\n}\n\nexport function useSelection(params: SelectionHookParams) {\n 'use no memo';\n\n if (params.selectionMode === 'multiselect') {\n // selectionMode is a static value, so we can safely ignore rules-of-hooks\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useMultipleSelection(params);\n }\n // selectionMode is a static value, so we can safely ignore rules-of-hooks\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useSingleSelection(params);\n}\n"],"names":["useSelection","useSelectionState","params","selected","setSelected","useControllableState","initialState","Set","defaultState","React","useMemo","defaultSelectedItems","createSetFromIterable","state","selectedItems","changeSelection","event","nextSelectedItems","onSelectionChange","useSingleSelection","methods","deselectItem","selectItem","itemId","toggleAllItems","process","env","NODE_ENV","Error","toggleItem","clearItems","isSelected","has","useMultipleSelection","delete","add","itemIds","allItemsSelected","every","clear","forEach","selectionMode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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"}
1
+ {"version":3,"sources":["../src/selection/useSelection.ts"],"sourcesContent":["import * as React from 'react';\nimport { SelectionHookParams, SelectionItemId, SelectionMethods } from './types';\nimport { useControllableState } from '../hooks/useControllableState';\nimport { createSetFromIterable } from '../utils/createSetFromIterable';\n\nfunction useSelectionState(params: Omit<SelectionHookParams, 'selectionMode'>) {\n const [selected, setSelected] = useControllableState<Set<SelectionItemId>>({\n initialState: new Set(),\n defaultState: React.useMemo(\n () => params.defaultSelectedItems && createSetFromIterable(params.defaultSelectedItems),\n [params.defaultSelectedItems],\n ),\n state: React.useMemo(\n () => params.selectedItems && createSetFromIterable(params.selectedItems),\n [params.selectedItems],\n ),\n });\n const changeSelection = (event: React.SyntheticEvent, nextSelectedItems: Set<SelectionItemId>) => {\n params.onSelectionChange?.(event, { selectedItems: nextSelectedItems });\n setSelected(nextSelectedItems);\n };\n return [selected, changeSelection] as const;\n}\n\nfunction useSingleSelection(params: Omit<SelectionHookParams, 'selectionMode'>) {\n const [selected, changeSelection] = useSelectionState(params);\n const methods: SelectionMethods = {\n deselectItem: event => changeSelection(event, new Set()),\n selectItem: (event, itemId) => changeSelection(event, new Set([itemId])),\n toggleAllItems: () => {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('[react-utilities]: `toggleAllItems` should not be used in single selection mode');\n }\n },\n toggleItem: (event, itemId) => changeSelection(event, new Set([itemId])),\n clearItems: event => changeSelection(event, new Set()),\n isSelected: itemId => selected.has(itemId) ?? false,\n };\n return [selected, methods] as const;\n}\n\nfunction useMultipleSelection(params: Omit<SelectionHookParams, 'selectionMode'>) {\n const [selected, changeSelection] = useSelectionState(params);\n const methods: SelectionMethods = {\n toggleItem: (event, itemId) => {\n const nextSelectedItems = new Set(selected);\n if (selected.has(itemId)) {\n nextSelectedItems.delete(itemId);\n } else {\n nextSelectedItems.add(itemId);\n }\n changeSelection(event, nextSelectedItems);\n },\n selectItem: (event, itemId) => {\n const nextSelectedItems = new Set(selected);\n nextSelectedItems.add(itemId);\n changeSelection(event, nextSelectedItems);\n },\n deselectItem: (event, itemId) => {\n const nextSelectedItems = new Set(selected);\n nextSelectedItems.delete(itemId);\n changeSelection(event, nextSelectedItems);\n },\n clearItems: event => {\n changeSelection(event, new Set());\n },\n isSelected: itemId => selected.has(itemId),\n toggleAllItems: (event, itemIds) => {\n const allItemsSelected = itemIds.every(itemId => selected.has(itemId));\n const nextSelectedItems = new Set(selected);\n if (allItemsSelected) {\n nextSelectedItems.clear();\n } else {\n itemIds.forEach(itemId => nextSelectedItems.add(itemId));\n }\n changeSelection(event, nextSelectedItems);\n },\n };\n return [selected, methods] as const;\n}\n\nexport function useSelection(params: SelectionHookParams) {\n 'use no memo';\n\n if (params.selectionMode === 'multiselect') {\n // selectionMode is a static value, so we can safely ignore rules-of-hooks\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useMultipleSelection(params);\n }\n // selectionMode is a static value, so we can safely ignore rules-of-hooks\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useSingleSelection(params);\n}\n"],"names":["useSelection","useSelectionState","params","selected","setSelected","useControllableState","initialState","Set","defaultState","React","useMemo","defaultSelectedItems","createSetFromIterable","state","selectedItems","changeSelection","event","nextSelectedItems","onSelectionChange","useSingleSelection","methods","deselectItem","selectItem","itemId","toggleAllItems","process","env","NODE_ENV","Error","toggleItem","clearItems","isSelected","has","useMultipleSelection","delete","add","itemIds","allItemsSelected","every","clear","forEach","selectionMode"],"mappings":";;;;+BAiFgBA;;;eAAAA;;;;iEAjFO;sCAEc;uCACC;AAEtC,SAASC,kBAAkBC,MAAkD;IAC3E,MAAM,CAACC,UAAUC,YAAY,GAAGC,IAAAA,0CAAoB,EAAuB;QACzEC,cAAc,IAAIC;QAClBC,cAAcC,OAAMC,OAAO,CACzB,IAAMR,OAAOS,oBAAoB,IAAIC,IAAAA,4CAAqB,EAACV,OAAOS,oBAAoB,GACtF;YAACT,OAAOS,oBAAoB;SAAC;QAE/BE,OAAOJ,OAAMC,OAAO,CAClB,IAAMR,OAAOY,aAAa,IAAIF,IAAAA,4CAAqB,EAACV,OAAOY,aAAa,GACxE;YAACZ,OAAOY,aAAa;SAAC;IAE1B;IACA,MAAMC,kBAAkB,CAACC,OAA6BC;YACpDf;SAAAA,4BAAAA,OAAOgB,iBAAiB,cAAxBhB,gDAAAA,+BAAAA,QAA2Bc,OAAO;YAAEF,eAAeG;QAAkB;QACrEb,YAAYa;IACd;IACA,OAAO;QAACd;QAAUY;KAAgB;AACpC;AAEA,SAASI,mBAAmBjB,MAAkD;IAC5E,MAAM,CAACC,UAAUY,gBAAgB,GAAGd,kBAAkBC;IACtD,MAAMkB,UAA4B;QAChCC,cAAcL,CAAAA,QAASD,gBAAgBC,OAAO,IAAIT;QAClDe,YAAY,CAACN,OAAOO,SAAWR,gBAAgBC,OAAO,IAAIT,IAAI;gBAACgB;aAAO;QACtEC,gBAAgB;YACd,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;gBACzC,MAAM,IAAIC,MAAM;YAClB;QACF;QACAC,YAAY,CAACb,OAAOO,SAAWR,gBAAgBC,OAAO,IAAIT,IAAI;gBAACgB;aAAO;QACtEO,YAAYd,CAAAA,QAASD,gBAAgBC,OAAO,IAAIT;QAChDwB,YAAYR,CAAAA;gBAAUpB;mBAAAA,CAAAA,gBAAAA,SAAS6B,GAAG,CAACT,qBAAbpB,2BAAAA,gBAAwB;;IAChD;IACA,OAAO;QAACA;QAAUiB;KAAQ;AAC5B;AAEA,SAASa,qBAAqB/B,MAAkD;IAC9E,MAAM,CAACC,UAAUY,gBAAgB,GAAGd,kBAAkBC;IACtD,MAAMkB,UAA4B;QAChCS,YAAY,CAACb,OAAOO;YAClB,MAAMN,oBAAoB,IAAIV,IAAIJ;YAClC,IAAIA,SAAS6B,GAAG,CAACT,SAAS;gBACxBN,kBAAkBiB,MAAM,CAACX;YAC3B,OAAO;gBACLN,kBAAkBkB,GAAG,CAACZ;YACxB;YACAR,gBAAgBC,OAAOC;QACzB;QACAK,YAAY,CAACN,OAAOO;YAClB,MAAMN,oBAAoB,IAAIV,IAAIJ;YAClCc,kBAAkBkB,GAAG,CAACZ;YACtBR,gBAAgBC,OAAOC;QACzB;QACAI,cAAc,CAACL,OAAOO;YACpB,MAAMN,oBAAoB,IAAIV,IAAIJ;YAClCc,kBAAkBiB,MAAM,CAACX;YACzBR,gBAAgBC,OAAOC;QACzB;QACAa,YAAYd,CAAAA;YACVD,gBAAgBC,OAAO,IAAIT;QAC7B;QACAwB,YAAYR,CAAAA,SAAUpB,SAAS6B,GAAG,CAACT;QACnCC,gBAAgB,CAACR,OAAOoB;YACtB,MAAMC,mBAAmBD,QAAQE,KAAK,CAACf,CAAAA,SAAUpB,SAAS6B,GAAG,CAACT;YAC9D,MAAMN,oBAAoB,IAAIV,IAAIJ;YAClC,IAAIkC,kBAAkB;gBACpBpB,kBAAkBsB,KAAK;YACzB,OAAO;gBACLH,QAAQI,OAAO,CAACjB,CAAAA,SAAUN,kBAAkBkB,GAAG,CAACZ;YAClD;YACAR,gBAAgBC,OAAOC;QACzB;IACF;IACA,OAAO;QAACd;QAAUiB;KAAQ;AAC5B;AAEO,SAASpB,aAAaE,MAA2B;IACtD;IAEA,IAAIA,OAAOuC,aAAa,KAAK,eAAe;QAC1C,0EAA0E;QAC1E,sDAAsD;QACtD,OAAOR,qBAAqB/B;IAC9B;IACA,0EAA0E;IAC1E,sDAAsD;IACtD,OAAOiB,mBAAmBjB;AAC5B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ssr/SSRContext.tsx"],"sourcesContent":["import * as React from 'react';\nimport { canUseDOM } from './canUseDOM';\n\n/**\n * To support SSR, the auto incrementing id counter is stored in a context. This allows it to be reset on every request\n * to ensure the client and server are consistent.\n *\n * @internal\n */\nexport type SSRContextValue = {\n current: number;\n};\n\n/**\n * Default context value to use in case there is no SSRProvider. This is fine for client-only apps.\n *\n * @internal\n */\nexport const defaultSSRContextValue: SSRContextValue = {\n current: 0,\n};\n\nexport const SSRContext = React.createContext<SSRContextValue | undefined>(undefined) as React.Context<SSRContextValue>;\n\n/**\n * @internal\n */\nexport function useSSRContext(): SSRContextValue {\n return React.useContext(SSRContext) ?? defaultSSRContextValue;\n}\n\n/**\n * When using SSR with Fluent UI, applications must be wrapped in an SSRProvider. This ensures that auto generated ids\n * are consistent between the client and server.\n *\n * @public\n */\nexport const SSRProvider: React.FC<{ children: React.ReactNode }> = props => {\n const [value] = React.useState<SSRContextValue>(() => ({ current: 0 }));\n\n return <SSRContext.Provider value={value}>{props.children}</SSRContext.Provider>;\n};\n\n/**\n * Returns whether the component is currently being server side rendered or hydrated on the client. Can be used to delay\n * browser-specific rendering until after hydration. May cause re-renders on a client when is used within SSRProvider.\n */\nexport function useIsSSR(): boolean {\n const isInSSRContext = useSSRContext() !== defaultSSRContextValue;\n const [isSSR, setIsSSR] = React.useState(isInSSRContext);\n\n // If we are rendering in a non-DOM environment, and there's no SSRProvider, provide a warning to hint to the\n // developer to add one.\n if (process.env.NODE_ENV !== 'production') {\n if (!isInSSRContext && !canUseDOM()) {\n // eslint-disable-next-line no-console\n console.error(/** #__DE-INDENT__ */ `\n @fluentui/react-components [${useIsSSR.name}]:\n When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.\n\n\n Check documentation at https://aka.ms/fluentui-ssr.\n `);\n }\n }\n\n // If on the client, and the component was initially server rendered, then schedule a layout effect to update the\n // component after hydration.\n if (canUseDOM() && isInSSRContext) {\n // This if statement technically breaks the rules of hooks, but is safe because the condition never changes after\n // mounting.\n // eslint-disable-next-line\n React.useLayoutEffect(() => {\n setIsSSR(false);\n }, []);\n }\n\n return isSSR;\n}\n"],"names":["SSRContext","SSRProvider","defaultSSRContextValue","useIsSSR","useSSRContext","current","React","createContext","undefined","useContext","props","value","useState","Provider","children","isInSSRContext","isSSR","setIsSSR","process","env","NODE_ENV","canUseDOM","console","error","name","useLayoutEffect"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAsBaA,UAAU;eAAVA;;IAeAC,WAAW;eAAXA;;IAnBAC,sBAAsB;eAAtBA;;IA6BGC,QAAQ;eAARA;;IApBAC,aAAa;eAAbA;;;;iEA3BO;2BACG;AAiBnB,MAAMF,yBAA0C;IACrDG,SAAS;AACX;AAEO,MAAML,2BAAaM,OAAMC,aAAa,CAA8BC;AAKpE,SAASJ;QACPE;IAAP,OAAOA,CAAAA,oBAAAA,OAAMG,UAAU,CAACT,yBAAjBM,+BAAAA,oBAAgCJ;AACzC;AAQO,MAAMD,cAAuDS,CAAAA;IAClE,MAAM,CAACC,MAAM,GAAGL,OAAMM,QAAQ,CAAkB,IAAO,CAAA;YAAEP,SAAS;QAAE,CAAA;IAEpE,qBAAO,qBAACL,WAAWa,QAAQ;QAACF,OAAOA;OAAQD,MAAMI,QAAQ;AAC3D;AAMO,SAASX;IACd,MAAMY,iBAAiBX,oBAAoBF;IAC3C,MAAM,CAACc,OAAOC,SAAS,GAAGX,OAAMM,QAAQ,CAACG;IAEzC,6GAA6G;IAC7G,wBAAwB;IACxB,IAAIG,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAI,CAACL,kBAAkB,CAACM,IAAAA,oBAAS,KAAI;YACnC,sCAAsC;YACtCC,QAAQC,KAAK,CAAuB,CAAC,4BACP,EAAEpB,SAASqB,IAAI,CAAC;;;;mDAK9C,CAAC;QACH;IACF;IAEA,iHAAiH;IACjH,6BAA6B;IAC7B,IAAIH,IAAAA,oBAAS,OAAMN,gBAAgB;QACjC,iHAAiH;QACjH,YAAY;QACZ,2BAA2B;QAC3BT,OAAMmB,eAAe,CAAC;YACpBR,SAAS;QACX,GAAG,EAAE;IACP;IAEA,OAAOD;AACT"}
1
+ {"version":3,"sources":["../src/ssr/SSRContext.tsx"],"sourcesContent":["import * as React from 'react';\nimport { canUseDOM } from './canUseDOM';\n\n/**\n * To support SSR, the auto incrementing id counter is stored in a context. This allows it to be reset on every request\n * to ensure the client and server are consistent.\n *\n * @internal\n */\nexport type SSRContextValue = {\n current: number;\n};\n\n/**\n * Default context value to use in case there is no SSRProvider. This is fine for client-only apps.\n *\n * @internal\n */\nexport const defaultSSRContextValue: SSRContextValue = {\n current: 0,\n};\n\nexport const SSRContext = React.createContext<SSRContextValue | undefined>(undefined) as React.Context<SSRContextValue>;\n\n/**\n * @internal\n */\nexport function useSSRContext(): SSRContextValue {\n return React.useContext(SSRContext) ?? defaultSSRContextValue;\n}\n\n/**\n * When using SSR with Fluent UI, applications must be wrapped in an SSRProvider. This ensures that auto generated ids\n * are consistent between the client and server.\n *\n * @public\n */\nexport const SSRProvider: React.FC<{ children: React.ReactNode }> = props => {\n const [value] = React.useState<SSRContextValue>(() => ({ current: 0 }));\n\n return <SSRContext.Provider value={value}>{props.children}</SSRContext.Provider>;\n};\n\n/**\n * Returns whether the component is currently being server side rendered or hydrated on the client. Can be used to delay\n * browser-specific rendering until after hydration. May cause re-renders on a client when is used within SSRProvider.\n */\nexport function useIsSSR(): boolean {\n const isInSSRContext = useSSRContext() !== defaultSSRContextValue;\n const [isSSR, setIsSSR] = React.useState(isInSSRContext);\n\n // If we are rendering in a non-DOM environment, and there's no SSRProvider, provide a warning to hint to the\n // developer to add one.\n if (process.env.NODE_ENV !== 'production') {\n if (!isInSSRContext && !canUseDOM()) {\n // eslint-disable-next-line no-console\n console.error(/** #__DE-INDENT__ */ `\n @fluentui/react-components [${useIsSSR.name}]:\n When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.\n\n\n Check documentation at https://aka.ms/fluentui-ssr.\n `);\n }\n }\n\n // If on the client, and the component was initially server rendered, then schedule a layout effect to update the\n // component after hydration.\n if (canUseDOM() && isInSSRContext) {\n // This if statement technically breaks the rules of hooks, but is safe because the condition never changes after\n // mounting.\n // eslint-disable-next-line\n React.useLayoutEffect(() => {\n setIsSSR(false);\n }, []);\n }\n\n return isSSR;\n}\n"],"names":["SSRContext","SSRProvider","defaultSSRContextValue","useIsSSR","useSSRContext","current","React","createContext","undefined","useContext","props","value","useState","Provider","children","isInSSRContext","isSSR","setIsSSR","process","env","NODE_ENV","canUseDOM","console","error","name","useLayoutEffect"],"mappings":";;;;;;;;;;;IAsBaA,UAAU;eAAVA;;IAeAC,WAAW;eAAXA;;IAnBAC,sBAAsB;eAAtBA;;IA6BGC,QAAQ;eAARA;;IApBAC,aAAa;eAAbA;;;;iEA3BO;2BACG;AAiBnB,MAAMF,yBAA0C;IACrDG,SAAS;AACX;AAEO,MAAML,2BAAaM,OAAMC,aAAa,CAA8BC;AAKpE,SAASJ;QACPE;IAAP,OAAOA,CAAAA,oBAAAA,OAAMG,UAAU,CAACT,yBAAjBM,+BAAAA,oBAAgCJ;AACzC;AAQO,MAAMD,cAAuDS,CAAAA;IAClE,MAAM,CAACC,MAAM,GAAGL,OAAMM,QAAQ,CAAkB,IAAO,CAAA;YAAEP,SAAS;QAAE,CAAA;IAEpE,qBAAO,qBAACL,WAAWa,QAAQ;QAACF,OAAOA;OAAQD,MAAMI,QAAQ;AAC3D;AAMO,SAASX;IACd,MAAMY,iBAAiBX,oBAAoBF;IAC3C,MAAM,CAACc,OAAOC,SAAS,GAAGX,OAAMM,QAAQ,CAACG;IAEzC,6GAA6G;IAC7G,wBAAwB;IACxB,IAAIG,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAI,CAACL,kBAAkB,CAACM,IAAAA,oBAAS,KAAI;YACnC,sCAAsC;YACtCC,QAAQC,KAAK,CAAuB,CAAC,4BACP,EAAEpB,SAASqB,IAAI,CAAC;;;;mDAK9C,CAAC;QACH;IACF;IAEA,iHAAiH;IACjH,6BAA6B;IAC7B,IAAIH,IAAAA,oBAAS,OAAMN,gBAAgB;QACjC,iHAAiH;QACjH,YAAY;QACZ,2BAA2B;QAC3BT,OAAMmB,eAAe,CAAC;YACpBR,SAAS;QACX,GAAG,EAAE;IACP;IAEA,OAAOD;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ssr/canUseDOM.ts"],"sourcesContent":["/**\n * Verifies if an application can use DOM.\n */\nexport function canUseDOM(): boolean {\n return (\n /* eslint-disable @nx/workspace-no-restricted-globals -- expected ignore ( SSR friendly acquisition of globals )*/\n typeof window !== 'undefined' &&\n !!(\n window.document &&\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n window.document.createElement\n )\n /* eslint-enable @nx/workspace-no-restricted-globals */\n );\n}\n"],"names":["canUseDOM","window","document","createElement"],"rangeMappings":";;;;;;;;;;;;;;;","mappings":"AAAA;;CAEC;;;;+BACeA;;;eAAAA;;;AAAT,SAASA;IACd,OACE,gHAAgH,GAChH,OAAOC,WAAW,eAClB,CAAC,CACCA,CAAAA,OAAOC,QAAQ,IACf,4DAA4D;IAC5DD,OAAOC,QAAQ,CAACC,aAAa,AAAD;AAIlC"}
1
+ {"version":3,"sources":["../src/ssr/canUseDOM.ts"],"sourcesContent":["/**\n * Verifies if an application can use DOM.\n */\nexport function canUseDOM(): boolean {\n return (\n /* eslint-disable @nx/workspace-no-restricted-globals -- expected ignore ( SSR friendly acquisition of globals )*/\n typeof window !== 'undefined' &&\n !!(\n window.document &&\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n window.document.createElement\n )\n /* eslint-enable @nx/workspace-no-restricted-globals */\n );\n}\n"],"names":["canUseDOM","window","document","createElement"],"mappings":"AAAA;;CAEC;;;;+BACeA;;;eAAAA;;;AAAT,SAASA;IACd,OACE,gHAAgH,GAChH,OAAOC,WAAW,eAClB,CAAC,CACCA,CAAAA,OAAOC,QAAQ,IACf,4DAA4D;IAC5DD,OAAOC,QAAQ,CAACC,aAAa,AAAD;AAIlC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/ssr/index.ts"],"sourcesContent":["export { canUseDOM } from './canUseDOM';\nexport type { SSRContextValue } from './SSRContext';\nexport { SSRContext, SSRProvider, defaultSSRContextValue, useIsSSR, useSSRContext } from './SSRContext';\n"],"names":["SSRContext","SSRProvider","canUseDOM","defaultSSRContextValue","useIsSSR","useSSRContext"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAESA,UAAU;eAAVA,sBAAU;;IAAEC,WAAW;eAAXA,uBAAW;;IAFvBC,SAAS;eAATA,oBAAS;;IAEgBC,sBAAsB;eAAtBA,kCAAsB;;IAAEC,QAAQ;eAARA,oBAAQ;;IAAEC,aAAa;eAAbA,yBAAa;;;2BAFvD;4BAE+D"}
1
+ {"version":3,"sources":["../src/ssr/index.ts"],"sourcesContent":["export { canUseDOM } from './canUseDOM';\nexport type { SSRContextValue } from './SSRContext';\nexport { SSRContext, SSRProvider, defaultSSRContextValue, useIsSSR, useSSRContext } from './SSRContext';\n"],"names":["SSRContext","SSRProvider","canUseDOM","defaultSSRContextValue","useIsSSR","useSSRContext"],"mappings":";;;;;;;;;;;IAESA,UAAU;eAAVA,sBAAU;;IAAEC,WAAW;eAAXA,uBAAW;;IAFvBC,SAAS;eAATA,oBAAS;;IAEgBC,sBAAsB;eAAtBA,kCAAsB;;IAAEC,QAAQ;eAARA,oBAAQ;;IAAEC,aAAa;eAAbA,yBAAa;;;2BAFvD;4BAE+D"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/trigger/applyTriggerPropsToChildren.ts"],"sourcesContent":["import * as React from 'react';\nimport { isFluentTrigger } from './isFluentTrigger';\nimport type { TriggerProps } from './types';\n\n/**\n * @internal\n * resolve the trigger props to the children, either by calling the render function, or cloning with the new props.\n */\nexport function applyTriggerPropsToChildren<TriggerChildProps>(\n children: TriggerProps<TriggerChildProps>['children'],\n triggerChildProps: TriggerChildProps,\n): React.ReactElement | null {\n if (typeof children === 'function') {\n return children(triggerChildProps);\n } else if (children) {\n return cloneTriggerTree(children, triggerChildProps);\n }\n\n // Components in React should return either JSX elements or \"null\", otherwise React will throw:\n // Nothing was returned from render.\n // This usually means a return statement is missing. Or, to render nothing, return null.\n return children || null;\n}\n\n/**\n * Clones a React element tree, and applies the given props to the first grandchild that is not\n * a FluentTriggerComponent or React Fragment (the same element returned by {@link getTriggerChild}).\n */\nfunction cloneTriggerTree<TriggerChildProps>(\n child: TriggerProps['children'],\n triggerProps: TriggerChildProps,\n): React.ReactElement {\n if (!React.isValidElement(child) || child.type === React.Fragment) {\n throw new Error(\n 'A trigger element must be a single element for this component. ' +\n \"Please ensure that you're not using React Fragments.\",\n );\n }\n\n if (isFluentTrigger(child)) {\n const grandchild = cloneTriggerTree(child.props.children, triggerProps);\n return React.cloneElement(child, undefined, grandchild);\n } else {\n return React.cloneElement(child, triggerProps as TriggerChildProps & React.Attributes);\n }\n}\n"],"names":["applyTriggerPropsToChildren","children","triggerChildProps","cloneTriggerTree","child","triggerProps","React","isValidElement","type","Fragment","Error","isFluentTrigger","grandchild","props","cloneElement","undefined"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAQgBA;;;eAAAA;;;;iEARO;iCACS;AAOzB,SAASA,4BACdC,QAAqD,EACrDC,iBAAoC;IAEpC,IAAI,OAAOD,aAAa,YAAY;QAClC,OAAOA,SAASC;IAClB,OAAO,IAAID,UAAU;QACnB,OAAOE,iBAAiBF,UAAUC;IACpC;IAEA,+FAA+F;IAC/F,sCAAsC;IACtC,0FAA0F;IAC1F,OAAOD,YAAY;AACrB;AAEA;;;CAGC,GACD,SAASE,iBACPC,KAA+B,EAC/BC,YAA+B;IAE/B,IAAI,CAACC,OAAMC,cAAc,CAACH,UAAUA,MAAMI,IAAI,KAAKF,OAAMG,QAAQ,EAAE;QACjE,MAAM,IAAIC,MACR,oEACE;IAEN;IAEA,IAAIC,IAAAA,gCAAe,EAACP,QAAQ;QAC1B,MAAMQ,aAAaT,iBAAiBC,MAAMS,KAAK,CAACZ,QAAQ,EAAEI;QAC1D,OAAOC,OAAMQ,YAAY,CAACV,OAAOW,WAAWH;IAC9C,OAAO;QACL,OAAON,OAAMQ,YAAY,CAACV,OAAOC;IACnC;AACF"}
1
+ {"version":3,"sources":["../src/trigger/applyTriggerPropsToChildren.ts"],"sourcesContent":["import * as React from 'react';\nimport { isFluentTrigger } from './isFluentTrigger';\nimport type { TriggerProps } from './types';\n\n/**\n * @internal\n * resolve the trigger props to the children, either by calling the render function, or cloning with the new props.\n */\nexport function applyTriggerPropsToChildren<TriggerChildProps>(\n children: TriggerProps<TriggerChildProps>['children'],\n triggerChildProps: TriggerChildProps,\n): React.ReactElement | null {\n if (typeof children === 'function') {\n return children(triggerChildProps);\n } else if (children) {\n return cloneTriggerTree(children, triggerChildProps);\n }\n\n // Components in React should return either JSX elements or \"null\", otherwise React will throw:\n // Nothing was returned from render.\n // This usually means a return statement is missing. Or, to render nothing, return null.\n return children || null;\n}\n\n/**\n * Clones a React element tree, and applies the given props to the first grandchild that is not\n * a FluentTriggerComponent or React Fragment (the same element returned by {@link getTriggerChild}).\n */\nfunction cloneTriggerTree<TriggerChildProps>(\n child: TriggerProps['children'],\n triggerProps: TriggerChildProps,\n): React.ReactElement {\n if (!React.isValidElement(child) || child.type === React.Fragment) {\n throw new Error(\n 'A trigger element must be a single element for this component. ' +\n \"Please ensure that you're not using React Fragments.\",\n );\n }\n\n if (isFluentTrigger(child)) {\n const grandchild = cloneTriggerTree(child.props.children, triggerProps);\n return React.cloneElement(child, undefined, grandchild);\n } else {\n return React.cloneElement(child, triggerProps as TriggerChildProps & React.Attributes);\n }\n}\n"],"names":["applyTriggerPropsToChildren","children","triggerChildProps","cloneTriggerTree","child","triggerProps","React","isValidElement","type","Fragment","Error","isFluentTrigger","grandchild","props","cloneElement","undefined"],"mappings":";;;;+BAQgBA;;;eAAAA;;;;iEARO;iCACS;AAOzB,SAASA,4BACdC,QAAqD,EACrDC,iBAAoC;IAEpC,IAAI,OAAOD,aAAa,YAAY;QAClC,OAAOA,SAASC;IAClB,OAAO,IAAID,UAAU;QACnB,OAAOE,iBAAiBF,UAAUC;IACpC;IAEA,+FAA+F;IAC/F,sCAAsC;IACtC,0FAA0F;IAC1F,OAAOD,YAAY;AACrB;AAEA;;;CAGC,GACD,SAASE,iBACPC,KAA+B,EAC/BC,YAA+B;IAE/B,IAAI,CAACC,OAAMC,cAAc,CAACH,UAAUA,MAAMI,IAAI,KAAKF,OAAMG,QAAQ,EAAE;QACjE,MAAM,IAAIC,MACR,oEACE;IAEN;IAEA,IAAIC,IAAAA,gCAAe,EAACP,QAAQ;QAC1B,MAAMQ,aAAaT,iBAAiBC,MAAMS,KAAK,CAACZ,QAAQ,EAAEI;QAC1D,OAAOC,OAAMQ,YAAY,CAACV,OAAOW,WAAWH;IAC9C,OAAO;QACL,OAAON,OAAMQ,YAAY,CAACV,OAAOC;IACnC;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/trigger/getTriggerChild.ts"],"sourcesContent":["import * as React from 'react';\nimport { isFluentTrigger } from './isFluentTrigger';\nimport type { TriggerProps } from './types';\n\n/**\n * @internal\n * Gets the trigger element of a FluentTriggerComponent (such as Tooltip or MenuTrigger).\n *\n * In the case where the immediate child is itself a FluentTriggerComponent and/or React Fragment,\n * it returns the first descendant that is _not_ a FluentTriggerComponent or Fragment.\n * This allows multiple triggers to be stacked, and still apply their props to the actual trigger element.\n *\n * For example, the following returns `<div id=\"child\" />`:\n * ```jsx\n * getTriggerChild(\n * <Tooltip>\n * <MenuTrigger>\n * <div id=\"child\" />\n * </MenuTrigger>\n * </Tooltip>\n * );\n * ```\n *\n * In the case where the immediate child is not a valid element,\n * null is returned\n */\nexport function getTriggerChild<TriggerChildProps>(\n children: TriggerProps<TriggerChildProps>['children'],\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): (React.ReactElement<Partial<TriggerChildProps>> & { ref?: React.Ref<any> }) | null {\n if (!React.isValidElement<TriggerChildProps>(children)) {\n return null;\n }\n return isFluentTrigger(children)\n ? getTriggerChild(\n // FIXME: This casting should be unnecessary as isFluentTrigger is a guard type method,\n // but for some reason it's failing on build\n (children.props as TriggerProps).children,\n )\n : children;\n}\n"],"names":["getTriggerChild","children","React","isValidElement","isFluentTrigger","props"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA0BgBA;;;eAAAA;;;;iEA1BO;iCACS;AAyBzB,SAASA,gBACdC,QAAqD;IAGrD,IAAI,CAACC,OAAMC,cAAc,CAAoBF,WAAW;QACtD,OAAO;IACT;IACA,OAAOG,IAAAA,gCAAe,EAACH,YACnBD,gBAGE,AAFA,uFAAuF;IACvF,4CAA4C;IAC3CC,SAASI,KAAK,CAAkBJ,QAAQ,IAE3CA;AACN"}
1
+ {"version":3,"sources":["../src/trigger/getTriggerChild.ts"],"sourcesContent":["import * as React from 'react';\nimport { isFluentTrigger } from './isFluentTrigger';\nimport type { TriggerProps } from './types';\n\n/**\n * @internal\n * Gets the trigger element of a FluentTriggerComponent (such as Tooltip or MenuTrigger).\n *\n * In the case where the immediate child is itself a FluentTriggerComponent and/or React Fragment,\n * it returns the first descendant that is _not_ a FluentTriggerComponent or Fragment.\n * This allows multiple triggers to be stacked, and still apply their props to the actual trigger element.\n *\n * For example, the following returns `<div id=\"child\" />`:\n * ```jsx\n * getTriggerChild(\n * <Tooltip>\n * <MenuTrigger>\n * <div id=\"child\" />\n * </MenuTrigger>\n * </Tooltip>\n * );\n * ```\n *\n * In the case where the immediate child is not a valid element,\n * null is returned\n */\nexport function getTriggerChild<TriggerChildProps>(\n children: TriggerProps<TriggerChildProps>['children'],\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): (React.ReactElement<Partial<TriggerChildProps>> & { ref?: React.Ref<any> }) | null {\n if (!React.isValidElement<TriggerChildProps>(children)) {\n return null;\n }\n return isFluentTrigger(children)\n ? getTriggerChild(\n // FIXME: This casting should be unnecessary as isFluentTrigger is a guard type method,\n // but for some reason it's failing on build\n (children.props as TriggerProps).children,\n )\n : children;\n}\n"],"names":["getTriggerChild","children","React","isValidElement","isFluentTrigger","props"],"mappings":";;;;+BA0BgBA;;;eAAAA;;;;iEA1BO;iCACS;AAyBzB,SAASA,gBACdC,QAAqD;IAGrD,IAAI,CAACC,OAAMC,cAAc,CAAoBF,WAAW;QACtD,OAAO;IACT;IACA,OAAOG,IAAAA,gCAAe,EAACH,YACnBD,gBAGE,AAFA,uFAAuF;IACvF,4CAA4C;IAC3CC,SAASI,KAAK,CAAkBJ,QAAQ,IAE3CA;AACN"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/trigger/index.ts"],"sourcesContent":["export { applyTriggerPropsToChildren } from './applyTriggerPropsToChildren';\nexport { getTriggerChild } from './getTriggerChild';\nexport { isFluentTrigger } from './isFluentTrigger';\nexport type { FluentTriggerComponent, TriggerProps } from './types';\n"],"names":["applyTriggerPropsToChildren","getTriggerChild","isFluentTrigger"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,2BAA2B;eAA3BA,wDAA2B;;IAC3BC,eAAe;eAAfA,gCAAe;;IACfC,eAAe;eAAfA,gCAAe;;;6CAFoB;iCACZ;iCACA"}
1
+ {"version":3,"sources":["../src/trigger/index.ts"],"sourcesContent":["export { applyTriggerPropsToChildren } from './applyTriggerPropsToChildren';\nexport { getTriggerChild } from './getTriggerChild';\nexport { isFluentTrigger } from './isFluentTrigger';\nexport type { FluentTriggerComponent, TriggerProps } from './types';\n"],"names":["applyTriggerPropsToChildren","getTriggerChild","isFluentTrigger"],"mappings":";;;;;;;;;;;IAASA,2BAA2B;eAA3BA,wDAA2B;;IAC3BC,eAAe;eAAfA,gCAAe;;IACfC,eAAe;eAAfA,gCAAe;;;6CAFoB;iCACZ;iCACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/trigger/isFluentTrigger.ts"],"sourcesContent":["import * as React from 'react';\nimport type { FluentTriggerComponent, TriggerProps } from './types';\n\n/**\n * @internal\n * Checks if a given element is a FluentUI trigger (e.g. `MenuTrigger` or `Tooltip`).\n * See the {@link FluentTriggerComponent} type for more info.\n */\nexport function isFluentTrigger(element: React.ReactElement): element is React.ReactElement<TriggerProps> {\n return Boolean((element.type as FluentTriggerComponent).isFluentTriggerComponent);\n}\n"],"names":["isFluentTrigger","element","Boolean","type","isFluentTriggerComponent"],"rangeMappings":";;;;;;;;;;;;;;","mappings":";;;;+BAQgBA;;;eAAAA;;;;iEARO;AAQhB,SAASA,gBAAgBC,OAA2B;IACzD,OAAOC,QAAQ,AAACD,QAAQE,IAAI,CAA4BC,wBAAwB;AAClF"}
1
+ {"version":3,"sources":["../src/trigger/isFluentTrigger.ts"],"sourcesContent":["import * as React from 'react';\nimport type { FluentTriggerComponent, TriggerProps } from './types';\n\n/**\n * @internal\n * Checks if a given element is a FluentUI trigger (e.g. `MenuTrigger` or `Tooltip`).\n * See the {@link FluentTriggerComponent} type for more info.\n */\nexport function isFluentTrigger(element: React.ReactElement): element is React.ReactElement<TriggerProps> {\n return Boolean((element.type as FluentTriggerComponent).isFluentTriggerComponent);\n}\n"],"names":["isFluentTrigger","element","Boolean","type","isFluentTriggerComponent"],"mappings":";;;;+BAQgBA;;;eAAAA;;;;iEARO;AAQhB,SAASA,gBAAgBC,OAA2B;IACzD,OAAOC,QAAQ,AAACD,QAAQE,IAAI,CAA4BC,wBAAwB;AAClF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/trigger/types.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * @internal\n * Allows a component to be tagged as a FluentUI trigger component.\n *\n * Triggers are special-case components: they attach event listeners and other props on their child,\n * and use them to trigger another component to show. Examples include `MenuTrigger` and `Tooltip`.\n *\n * A component can be tagged as a trigger as follows:\n * ```ts\n * const MyComponent: React.FC<MyComponentProps> & FluentTriggerComponent = ...;\n *\n * MyComponent.isFluentTriggerComponent = true; // MUST also set this to true\n * ```\n */\nexport type FluentTriggerComponent = {\n isFluentTriggerComponent?: boolean;\n};\n\n/**\n * A trigger may have a children that could be either:\n * 1. A single element\n * 2. A render function that will receive properties and must return a valid element or null\n * 3. null or undefined\n */\nexport type TriggerProps<TriggerChildProps = unknown> = {\n children?: React.ReactElement | ((props: TriggerChildProps) => React.ReactElement | null) | null;\n};\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
1
+ {"version":3,"sources":["../src/trigger/types.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * @internal\n * Allows a component to be tagged as a FluentUI trigger component.\n *\n * Triggers are special-case components: they attach event listeners and other props on their child,\n * and use them to trigger another component to show. Examples include `MenuTrigger` and `Tooltip`.\n *\n * A component can be tagged as a trigger as follows:\n * ```ts\n * const MyComponent: React.FC<MyComponentProps> & FluentTriggerComponent = ...;\n *\n * MyComponent.isFluentTriggerComponent = true; // MUST also set this to true\n * ```\n */\nexport type FluentTriggerComponent = {\n isFluentTriggerComponent?: boolean;\n};\n\n/**\n * A trigger may have a children that could be either:\n * 1. A single element\n * 2. A render function that will receive properties and must return a valid element or null\n * 3. null or undefined\n */\nexport type TriggerProps<TriggerChildProps = unknown> = {\n children?: React.ReactElement | ((props: TriggerChildProps) => React.ReactElement | null) | null;\n};\n"],"names":[],"mappings":";;;;;iEAAuB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/clamp.ts"],"sourcesContent":["/**\n * @internal\n * Clamps `value` to a number between the min and max.\n *\n * @param value - the value to be clamped\n * @param min - the lowest valid value\n * @param max - the highest valid value\n */\nexport const clamp = (value: number, min: number, max: number): number => Math.max(min, Math.min(max, value || 0));\n"],"names":["clamp","value","min","max","Math"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":"AAAA;;;;;;;CAOC;;;;+BACYA;;;eAAAA;;;AAAN,MAAMA,QAAQ,CAACC,OAAeC,KAAaC,MAAwBC,KAAKD,GAAG,CAACD,KAAKE,KAAKF,GAAG,CAACC,KAAKF,SAAS"}
1
+ {"version":3,"sources":["../src/utils/clamp.ts"],"sourcesContent":["/**\n * @internal\n * Clamps `value` to a number between the min and max.\n *\n * @param value - the value to be clamped\n * @param min - the lowest valid value\n * @param max - the highest valid value\n */\nexport const clamp = (value: number, min: number, max: number): number => Math.max(min, Math.min(max, value || 0));\n"],"names":["clamp","value","min","max","Math"],"mappings":"AAAA;;;;;;;CAOC;;;;+BACYA;;;eAAAA;;;AAAN,MAAMA,QAAQ,CAACC,OAAeC,KAAaC,MAAwBC,KAAKD,GAAG,CAACD,KAAKE,KAAKF,GAAG,CAACC,KAAKF,SAAS"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/createSetFromIterable.ts"],"sourcesContent":["/**\n * Creates a set from a given iterable, in case the iterable is a set itself, returns the given set instead.\n */\nexport function createSetFromIterable<V>(iterable: Iterable<V>): Set<V> {\n return iterable instanceof Set ? iterable : new Set(iterable);\n}\n"],"names":["createSetFromIterable","iterable","Set"],"rangeMappings":";;;;;;;;;;;;;;","mappings":"AAAA;;CAEC;;;;+BACeA;;;eAAAA;;;AAAT,SAASA,sBAAyBC,QAAqB;IAC5D,OAAOA,oBAAoBC,MAAMD,WAAW,IAAIC,IAAID;AACtD"}
1
+ {"version":3,"sources":["../src/utils/createSetFromIterable.ts"],"sourcesContent":["/**\n * Creates a set from a given iterable, in case the iterable is a set itself, returns the given set instead.\n */\nexport function createSetFromIterable<V>(iterable: Iterable<V>): Set<V> {\n return iterable instanceof Set ? iterable : new Set(iterable);\n}\n"],"names":["createSetFromIterable","iterable","Set"],"mappings":"AAAA;;CAEC;;;;+BACeA;;;eAAAA;;;AAAT,SAASA,sBAAyBC,QAAqB;IAC5D,OAAOA,oBAAoBC,MAAMD,WAAW,IAAIC,IAAID;AACtD"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * ============================================
3
+ * 💡 DO NOT EDIT THIS FILE.
4
+ * - This file is automatically generated and should not be edited manually.
5
+ * - To regenerate run `yarn nx run react-utilities:build`.
6
+ * ============================================
7
+ */ /**
8
+ * Unwrapped type for 'keyof JSX.IntrinsicElement'. (Backwards compatible with older versions of '\@types/react')
9
+ */ "use strict";
10
+ Object.defineProperty(exports, "__esModule", {
11
+ value: true
12
+ });
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/utils/generated-types.ts"],"sourcesContent":["/**\n * ============================================\n * 💡 DO NOT EDIT THIS FILE.\n * - This file is automatically generated and should not be edited manually.\n * - To regenerate run `yarn nx run react-utilities:build`.\n * ============================================\n */\n\n/**\n * Unwrapped type for 'keyof JSX.IntrinsicElement'. (Backwards compatible with older versions of '\\@types/react')\n */\nexport type JSXIntrinsicElementKeysCompat =\n | 'a'\n | 'abbr'\n | 'address'\n | 'animate'\n | 'animateMotion'\n | 'animateTransform'\n | 'area'\n | 'article'\n | 'aside'\n | 'audio'\n | 'b'\n | 'base'\n | 'bdi'\n | 'bdo'\n | 'big'\n | 'blockquote'\n | 'body'\n | 'br'\n | 'button'\n | 'canvas'\n | 'caption'\n | 'circle'\n | 'cite'\n | 'clipPath'\n | 'code'\n | 'col'\n | 'colgroup'\n | 'data'\n | 'datalist'\n | 'dd'\n | 'defs'\n | 'del'\n | 'desc'\n | 'details'\n | 'dfn'\n | 'dialog'\n | 'div'\n | 'dl'\n | 'dt'\n | 'ellipse'\n | 'em'\n | 'embed'\n | 'feBlend'\n | 'feColorMatrix'\n | 'feComponentTransfer'\n | 'feComposite'\n | 'feConvolveMatrix'\n | 'feDiffuseLighting'\n | 'feDisplacementMap'\n | 'feDistantLight'\n | 'feDropShadow'\n | 'feFlood'\n | 'feFuncA'\n | 'feFuncB'\n | 'feFuncG'\n | 'feFuncR'\n | 'feGaussianBlur'\n | 'feImage'\n | 'feMerge'\n | 'feMergeNode'\n | 'feMorphology'\n | 'feOffset'\n | 'fePointLight'\n | 'feSpecularLighting'\n | 'feSpotLight'\n | 'feTile'\n | 'feTurbulence'\n | 'fieldset'\n | 'figcaption'\n | 'figure'\n | 'filter'\n | 'footer'\n | 'foreignObject'\n | 'form'\n | 'g'\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'head'\n | 'header'\n | 'hgroup'\n | 'hr'\n | 'html'\n | 'i'\n | 'iframe'\n | 'image'\n | 'img'\n | 'input'\n | 'ins'\n | 'kbd'\n | 'keygen'\n | 'label'\n | 'legend'\n | 'li'\n | 'line'\n | 'linearGradient'\n | 'link'\n | 'main'\n | 'map'\n | 'mark'\n | 'marker'\n | 'mask'\n | 'menu'\n | 'menuitem'\n | 'meta'\n | 'metadata'\n | 'meter'\n | 'nav'\n | 'noindex'\n | 'noscript'\n | 'object'\n | 'ol'\n | 'optgroup'\n | 'option'\n | 'output'\n | 'p'\n | 'param'\n | 'path'\n | 'pattern'\n | 'picture'\n | 'polygon'\n | 'polyline'\n | 'pre'\n | 'progress'\n | 'q'\n | 'radialGradient'\n | 'rect'\n | 'rp'\n | 'rt'\n | 'ruby'\n | 's'\n | 'samp'\n | 'script'\n | 'section'\n | 'select'\n | 'slot'\n | 'small'\n | 'source'\n | 'span'\n | 'stop'\n | 'strong'\n | 'style'\n | 'sub'\n | 'summary'\n | 'sup'\n | 'svg'\n | 'switch'\n | 'symbol'\n | 'table'\n | 'tbody'\n | 'td'\n | 'template'\n | 'text'\n | 'textPath'\n | 'textarea'\n | 'tfoot'\n | 'th'\n | 'thead'\n | 'time'\n | 'title'\n | 'tr'\n | 'track'\n | 'tspan'\n | 'u'\n | 'ul'\n | 'use'\n | 'var'\n | 'video'\n | 'view'\n | 'wbr'\n | 'webview';\n/**\n * Unwrapped type for 'keyof JSX.IntrinsicElement'\n */\nexport type JSXIntrinsicElementKeysLatest = 'set' | 'mpath' | 'center' | 'search' | JSXIntrinsicElementKeysCompat;\n"],"names":[],"mappings":"AAAA;;;;;;CAMC,GAED;;CAEC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/getNativeElementProps.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n labelProperties,\n audioProperties,\n videoProperties,\n olProperties,\n liProperties,\n anchorProperties,\n buttonProperties,\n inputProperties,\n textAreaProperties,\n selectProperties,\n optionProperties,\n tableProperties,\n trProperties,\n thProperties,\n tdProperties,\n colGroupProperties,\n colProperties,\n fieldsetProperties,\n formProperties,\n iframeProperties,\n imgProperties,\n htmlElementProperties,\n getNativeProps,\n timeProperties,\n dialogProperties,\n} from './properties';\n\nconst nativeElementMap: Record<string, Record<string, number>> = {\n label: labelProperties,\n audio: audioProperties,\n video: videoProperties,\n ol: olProperties,\n li: liProperties,\n a: anchorProperties,\n button: buttonProperties,\n input: inputProperties,\n textarea: textAreaProperties,\n select: selectProperties,\n option: optionProperties,\n table: tableProperties,\n tr: trProperties,\n th: thProperties,\n td: tdProperties,\n colGroup: colGroupProperties,\n col: colProperties,\n fieldset: fieldsetProperties,\n form: formProperties,\n iframe: iframeProperties,\n img: imgProperties,\n time: timeProperties,\n dialog: dialogProperties,\n};\n\n/**\n * Given an element tagname and user props, filters the props to only allowed props for the given\n * element type.\n * @param tagName - Tag name (e.g. \"div\")\n * @param props - Props object\n * @param excludedPropNames - List of props to disallow\n *\n * @deprecated use getIntrinsicElementProps instead, it is a type-safe version of this method\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getNativeElementProps<TAttributes extends React.HTMLAttributes<any>>(\n tagName: string,\n props: {},\n excludedPropNames?: string[],\n): TAttributes {\n const allowedPropNames = (tagName && nativeElementMap[tagName]) || htmlElementProperties;\n allowedPropNames.as = 1;\n\n return getNativeProps(props, allowedPropNames, excludedPropNames);\n}\n\n/**\n * Splits the native props into ones that go to the `root` slot, and ones that go to the primary slot.\n *\n * This function is only for use with components that have a primary slot other than `root`.\n * Most components should use {@link getNativeElementProps} for their root slot if it is the primary slot.\n *\n * @returns An object containing the native props for the `root` and primary slots.\n */\nexport const getPartitionedNativeProps = <\n Props extends Pick<React.HTMLAttributes<HTMLElement>, 'style' | 'className'>,\n ExcludedPropKeys extends Extract<keyof Props, string> = never,\n>({\n primarySlotTagName,\n props,\n excludedPropNames,\n}: {\n /** The primary slot's element type (e.g. 'div') */\n primarySlotTagName: keyof JSX.IntrinsicElements;\n\n /** The component's props object */\n props: Props;\n\n /** List of native props to exclude from the returned value */\n excludedPropNames?: ExcludedPropKeys[];\n}) => {\n return {\n root: { style: props.style, className: props.className },\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n primary: getNativeElementProps<Omit<Props, ExcludedPropKeys>>(primarySlotTagName, props, [\n ...(excludedPropNames || []),\n 'style',\n 'className',\n ]),\n };\n};\n"],"names":["getNativeElementProps","getPartitionedNativeProps","nativeElementMap","label","labelProperties","audio","audioProperties","video","videoProperties","ol","olProperties","li","liProperties","a","anchorProperties","button","buttonProperties","input","inputProperties","textarea","textAreaProperties","select","selectProperties","option","optionProperties","table","tableProperties","tr","trProperties","th","thProperties","td","tdProperties","colGroup","colGroupProperties","col","colProperties","fieldset","fieldsetProperties","form","formProperties","iframe","iframeProperties","img","imgProperties","time","timeProperties","dialog","dialogProperties","tagName","props","excludedPropNames","allowedPropNames","htmlElementProperties","as","getNativeProps","primarySlotTagName","root","style","className","primary"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAiEgBA,qBAAqB;eAArBA;;IAmBHC,yBAAyB;eAAzBA;;;;iEApFU;4BA2BhB;AAEP,MAAMC,mBAA2D;IAC/DC,OAAOC,2BAAe;IACtBC,OAAOC,2BAAe;IACtBC,OAAOC,2BAAe;IACtBC,IAAIC,wBAAY;IAChBC,IAAIC,wBAAY;IAChBC,GAAGC,4BAAgB;IACnBC,QAAQC,4BAAgB;IACxBC,OAAOC,2BAAe;IACtBC,UAAUC,8BAAkB;IAC5BC,QAAQC,4BAAgB;IACxBC,QAAQC,4BAAgB;IACxBC,OAAOC,2BAAe;IACtBC,IAAIC,wBAAY;IAChBC,IAAIC,wBAAY;IAChBC,IAAIC,wBAAY;IAChBC,UAAUC,8BAAkB;IAC5BC,KAAKC,yBAAa;IAClBC,UAAUC,8BAAkB;IAC5BC,MAAMC,0BAAc;IACpBC,QAAQC,4BAAgB;IACxBC,KAAKC,yBAAa;IAClBC,MAAMC,0BAAc;IACpBC,QAAQC,4BAAgB;AAC1B;AAYO,SAAShD,sBACdiD,OAAe,EACfC,KAAS,EACTC,iBAA4B;IAE5B,MAAMC,mBAAmB,AAACH,WAAW/C,gBAAgB,CAAC+C,QAAQ,IAAKI,iCAAqB;IACxFD,iBAAiBE,EAAE,GAAG;IAEtB,OAAOC,IAAAA,0BAAc,EAACL,OAAOE,kBAAkBD;AACjD;AAUO,MAAMlD,4BAA4B,CAGvC,EACAuD,kBAAkB,EAClBN,KAAK,EACLC,iBAAiB,EAUlB;IACC,OAAO;QACLM,MAAM;YAAEC,OAAOR,MAAMQ,KAAK;YAAEC,WAAWT,MAAMS,SAAS;QAAC;QACvD,4DAA4D;QAC5DC,SAAS5D,sBAAqDwD,oBAAoBN,OAAO;eACnFC,qBAAqB,EAAE;YAC3B;YACA;SACD;IACH;AACF"}
1
+ {"version":3,"sources":["../src/utils/getNativeElementProps.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n labelProperties,\n audioProperties,\n videoProperties,\n olProperties,\n liProperties,\n anchorProperties,\n buttonProperties,\n inputProperties,\n textAreaProperties,\n selectProperties,\n optionProperties,\n tableProperties,\n trProperties,\n thProperties,\n tdProperties,\n colGroupProperties,\n colProperties,\n fieldsetProperties,\n formProperties,\n iframeProperties,\n imgProperties,\n htmlElementProperties,\n getNativeProps,\n timeProperties,\n dialogProperties,\n} from './properties';\nimport type { JSXIntrinsicElementKeys } from './types';\n\nconst nativeElementMap: Record<string, Record<string, number>> = {\n label: labelProperties,\n audio: audioProperties,\n video: videoProperties,\n ol: olProperties,\n li: liProperties,\n a: anchorProperties,\n button: buttonProperties,\n input: inputProperties,\n textarea: textAreaProperties,\n select: selectProperties,\n option: optionProperties,\n table: tableProperties,\n tr: trProperties,\n th: thProperties,\n td: tdProperties,\n colGroup: colGroupProperties,\n col: colProperties,\n fieldset: fieldsetProperties,\n form: formProperties,\n iframe: iframeProperties,\n img: imgProperties,\n time: timeProperties,\n dialog: dialogProperties,\n};\n\n/**\n * Given an element tagname and user props, filters the props to only allowed props for the given\n * element type.\n * @param tagName - Tag name (e.g. \"div\")\n * @param props - Props object\n * @param excludedPropNames - List of props to disallow\n *\n * @deprecated use getIntrinsicElementProps instead, it is a type-safe version of this method\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getNativeElementProps<TAttributes extends React.HTMLAttributes<any>>(\n tagName: string,\n props: {},\n excludedPropNames?: string[],\n): TAttributes {\n const allowedPropNames = (tagName && nativeElementMap[tagName]) || htmlElementProperties;\n allowedPropNames.as = 1;\n\n return getNativeProps(props, allowedPropNames, excludedPropNames);\n}\n\n/**\n * Splits the native props into ones that go to the `root` slot, and ones that go to the primary slot.\n *\n * This function is only for use with components that have a primary slot other than `root`.\n * Most components should use {@link getNativeElementProps} for their root slot if it is the primary slot.\n *\n * @returns An object containing the native props for the `root` and primary slots.\n */\nexport const getPartitionedNativeProps = <\n Props extends Pick<React.HTMLAttributes<HTMLElement>, 'style' | 'className'>,\n ExcludedPropKeys extends Extract<keyof Props, string> = never,\n>({\n primarySlotTagName,\n props,\n excludedPropNames,\n}: {\n /** The primary slot's element type (e.g. 'div') */\n primarySlotTagName: JSXIntrinsicElementKeys;\n\n /** The component's props object */\n props: Props;\n\n /** List of native props to exclude from the returned value */\n excludedPropNames?: ExcludedPropKeys[];\n}) => {\n return {\n root: { style: props.style, className: props.className },\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n primary: getNativeElementProps<Omit<Props, ExcludedPropKeys>>(primarySlotTagName, props, [\n ...(excludedPropNames || []),\n 'style',\n 'className',\n ]),\n };\n};\n"],"names":["getNativeElementProps","getPartitionedNativeProps","nativeElementMap","label","labelProperties","audio","audioProperties","video","videoProperties","ol","olProperties","li","liProperties","a","anchorProperties","button","buttonProperties","input","inputProperties","textarea","textAreaProperties","select","selectProperties","option","optionProperties","table","tableProperties","tr","trProperties","th","thProperties","td","tdProperties","colGroup","colGroupProperties","col","colProperties","fieldset","fieldsetProperties","form","formProperties","iframe","iframeProperties","img","imgProperties","time","timeProperties","dialog","dialogProperties","tagName","props","excludedPropNames","allowedPropNames","htmlElementProperties","as","getNativeProps","primarySlotTagName","root","style","className","primary"],"mappings":";;;;;;;;;;;IAkEgBA,qBAAqB;eAArBA;;IAmBHC,yBAAyB;eAAzBA;;;;iEArFU;4BA2BhB;AAGP,MAAMC,mBAA2D;IAC/DC,OAAOC,2BAAe;IACtBC,OAAOC,2BAAe;IACtBC,OAAOC,2BAAe;IACtBC,IAAIC,wBAAY;IAChBC,IAAIC,wBAAY;IAChBC,GAAGC,4BAAgB;IACnBC,QAAQC,4BAAgB;IACxBC,OAAOC,2BAAe;IACtBC,UAAUC,8BAAkB;IAC5BC,QAAQC,4BAAgB;IACxBC,QAAQC,4BAAgB;IACxBC,OAAOC,2BAAe;IACtBC,IAAIC,wBAAY;IAChBC,IAAIC,wBAAY;IAChBC,IAAIC,wBAAY;IAChBC,UAAUC,8BAAkB;IAC5BC,KAAKC,yBAAa;IAClBC,UAAUC,8BAAkB;IAC5BC,MAAMC,0BAAc;IACpBC,QAAQC,4BAAgB;IACxBC,KAAKC,yBAAa;IAClBC,MAAMC,0BAAc;IACpBC,QAAQC,4BAAgB;AAC1B;AAYO,SAAShD,sBACdiD,OAAe,EACfC,KAAS,EACTC,iBAA4B;IAE5B,MAAMC,mBAAmB,AAACH,WAAW/C,gBAAgB,CAAC+C,QAAQ,IAAKI,iCAAqB;IACxFD,iBAAiBE,EAAE,GAAG;IAEtB,OAAOC,IAAAA,0BAAc,EAACL,OAAOE,kBAAkBD;AACjD;AAUO,MAAMlD,4BAA4B,CAGvC,EACAuD,kBAAkB,EAClBN,KAAK,EACLC,iBAAiB,EAUlB;IACC,OAAO;QACLM,MAAM;YAAEC,OAAOR,MAAMQ,KAAK;YAAEC,WAAWT,MAAMS,SAAS;QAAC;QACvD,4DAA4D;QAC5DC,SAAS5D,sBAAqDwD,oBAAoBN,OAAO;eACnFC,qBAAqB,EAAE;YAC3B;YACA;SACD;IACH;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/getRTLSafeKey.ts"],"sourcesContent":["/**\n * @internal\n * Finds and swaps a provided key for it's right to left format.\n */\nexport const getRTLSafeKey = (key: string, dir: 'ltr' | 'rtl') => {\n if (dir === 'rtl') {\n switch (key) {\n case 'ArrowLeft': {\n return 'ArrowRight';\n }\n\n case 'ArrowRight': {\n return 'ArrowLeft';\n }\n }\n }\n\n return key;\n};\n"],"names":["getRTLSafeKey","key","dir"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;;CAGC;;;;+BACYA;;;eAAAA;;;AAAN,MAAMA,gBAAgB,CAACC,KAAaC;IACzC,IAAIA,QAAQ,OAAO;QACjB,OAAQD;YACN,KAAK;gBAAa;oBAChB,OAAO;gBACT;YAEA,KAAK;gBAAc;oBACjB,OAAO;gBACT;QACF;IACF;IAEA,OAAOA;AACT"}
1
+ {"version":3,"sources":["../src/utils/getRTLSafeKey.ts"],"sourcesContent":["/**\n * @internal\n * Finds and swaps a provided key for it's right to left format.\n */\nexport const getRTLSafeKey = (key: string, dir: 'ltr' | 'rtl') => {\n if (dir === 'rtl') {\n switch (key) {\n case 'ArrowLeft': {\n return 'ArrowRight';\n }\n\n case 'ArrowRight': {\n return 'ArrowLeft';\n }\n }\n }\n\n return key;\n};\n"],"names":["getRTLSafeKey","key","dir"],"mappings":"AAAA;;;CAGC;;;;+BACYA;;;eAAAA;;;AAAN,MAAMA,gBAAgB,CAACC,KAAaC;IACzC,IAAIA,QAAQ,OAAO;QACjB,OAAQD;YACN,KAAK;gBAAa;oBAChB,OAAO;gBACT;YAEA,KAAK;gBAAc;oBACjB,OAAO;gBACT;QACF;IACF;IAEA,OAAOA;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/getReactCallbackName.ts"],"sourcesContent":["import * as React from 'react';\n\ninterface ReactSyntheticEvent extends React.SyntheticEvent<unknown> {\n // React 17/18\n // See https://github.com/facebook/react/pull/19236\n _reactName?: string;\n\n // React 16\n dispatchConfig?: {\n registrationName: string;\n phasedRegistrationNames: {\n bubbled: string;\n captured: string;\n };\n };\n}\n\ntype NonUndefined<A> = A extends undefined ? never : A;\ntype FunctionKeys<T extends object> = {\n [K in keyof T]-?: NonUndefined<T[K]> extends Function ? K : never;\n}[keyof T];\n\nexport type ReactCallbackName = FunctionKeys<React.DOMAttributes<unknown>>;\n\n/**\n * React.SyntheticEvent contains name of a callback that should be fired, this function returns it.\n *\n * Ideally, it should also distinguish regular and \"capture\" callbacks, but it's possible only with React 17 as\n * \".eventPhase\" there has proper value, see https://github.com/facebook/react/pull/19244. In React 16 all events\n * are handled in bubble phase.\n */\nexport function getReactCallbackName(event: ReactSyntheticEvent): ReactCallbackName | undefined {\n if (event._reactName) {\n return event._reactName as ReactCallbackName;\n }\n\n if (event.dispatchConfig) {\n if (event.dispatchConfig.registrationName) {\n return event.dispatchConfig.registrationName as ReactCallbackName;\n }\n\n return event.dispatchConfig.phasedRegistrationNames.bubbled as ReactCallbackName;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error(/** #__DE-INDENT__ */ `\n @fluentui/react-utilities [${getReactCallbackName.name}]:\n Passed React.SyntheticEvent does not contain \".dispatchConfig\" or \"._reactName\". This should not happen, please report it to https://github.com/microsoft/fluentui.\n `);\n }\n}\n"],"names":["getReactCallbackName","event","_reactName","dispatchConfig","registrationName","phasedRegistrationNames","bubbled","process","env","NODE_ENV","console","error","name"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BA+BgBA;;;eAAAA;;;;iEA/BO;AA+BhB,SAASA,qBAAqBC,KAA0B;IAC7D,IAAIA,MAAMC,UAAU,EAAE;QACpB,OAAOD,MAAMC,UAAU;IACzB;IAEA,IAAID,MAAME,cAAc,EAAE;QACxB,IAAIF,MAAME,cAAc,CAACC,gBAAgB,EAAE;YACzC,OAAOH,MAAME,cAAc,CAACC,gBAAgB;QAC9C;QAEA,OAAOH,MAAME,cAAc,CAACE,uBAAuB,CAACC,OAAO;IAC7D;IAEA,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,sCAAsC;QACtCC,QAAQC,KAAK,CAAuB,CAAC,2BACR,EAAEX,qBAAqBY,IAAI,CAAC;mKAEzD,CAAC;IACH;AACF"}
1
+ {"version":3,"sources":["../src/utils/getReactCallbackName.ts"],"sourcesContent":["import * as React from 'react';\n\ninterface ReactSyntheticEvent extends React.SyntheticEvent<unknown> {\n // React 17/18\n // See https://github.com/facebook/react/pull/19236\n _reactName?: string;\n\n // React 16\n dispatchConfig?: {\n registrationName: string;\n phasedRegistrationNames: {\n bubbled: string;\n captured: string;\n };\n };\n}\n\ntype NonUndefined<A> = A extends undefined ? never : A;\ntype FunctionKeys<T extends object> = {\n [K in keyof T]-?: NonUndefined<T[K]> extends Function ? K : never;\n}[keyof T];\n\nexport type ReactCallbackName = FunctionKeys<React.DOMAttributes<unknown>>;\n\n/**\n * React.SyntheticEvent contains name of a callback that should be fired, this function returns it.\n *\n * Ideally, it should also distinguish regular and \"capture\" callbacks, but it's possible only with React 17 as\n * \".eventPhase\" there has proper value, see https://github.com/facebook/react/pull/19244. In React 16 all events\n * are handled in bubble phase.\n */\nexport function getReactCallbackName(event: ReactSyntheticEvent): ReactCallbackName | undefined {\n if (event._reactName) {\n return event._reactName as ReactCallbackName;\n }\n\n if (event.dispatchConfig) {\n if (event.dispatchConfig.registrationName) {\n return event.dispatchConfig.registrationName as ReactCallbackName;\n }\n\n return event.dispatchConfig.phasedRegistrationNames.bubbled as ReactCallbackName;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error(/** #__DE-INDENT__ */ `\n @fluentui/react-utilities [${getReactCallbackName.name}]:\n Passed React.SyntheticEvent does not contain \".dispatchConfig\" or \"._reactName\". This should not happen, please report it to https://github.com/microsoft/fluentui.\n `);\n }\n}\n"],"names":["getReactCallbackName","event","_reactName","dispatchConfig","registrationName","phasedRegistrationNames","bubbled","process","env","NODE_ENV","console","error","name"],"mappings":";;;;+BA+BgBA;;;eAAAA;;;;iEA/BO;AA+BhB,SAASA,qBAAqBC,KAA0B;IAC7D,IAAIA,MAAMC,UAAU,EAAE;QACpB,OAAOD,MAAMC,UAAU;IACzB;IAEA,IAAID,MAAME,cAAc,EAAE;QACxB,IAAIF,MAAME,cAAc,CAACC,gBAAgB,EAAE;YACzC,OAAOH,MAAME,cAAc,CAACC,gBAAgB;QAC9C;QAEA,OAAOH,MAAME,cAAc,CAACE,uBAAuB,CAACC,OAAO;IAC7D;IAEA,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,sCAAsC;QACtCC,QAAQC,KAAK,CAAuB,CAAC,2BACR,EAAEX,qBAAqBY,IAAI,CAAC;mKAEzD,CAAC;IACH;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/index.ts"],"sourcesContent":["export { clamp } from './clamp';\nexport {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n getNativeElementProps,\n getPartitionedNativeProps,\n} from './getNativeElementProps';\nexport { getRTLSafeKey } from './getRTLSafeKey';\nexport { mergeCallbacks } from './mergeCallbacks';\nexport { omit } from './omit';\nexport {\n anchorProperties,\n audioProperties,\n baseElementEvents,\n baseElementProperties,\n buttonProperties,\n colGroupProperties,\n colProperties,\n dialogProperties,\n divProperties,\n fieldsetProperties,\n formProperties,\n getNativeProps,\n htmlElementProperties,\n iframeProperties,\n imgProperties,\n inputProperties,\n labelProperties,\n liProperties,\n microdataProperties,\n olProperties,\n optionProperties,\n selectProperties,\n tableProperties,\n tdProperties,\n textAreaProperties,\n thProperties,\n timeProperties,\n trProperties,\n videoProperties,\n} from './properties';\nexport { isHTMLElement } from './isHTMLElement';\nexport { isInteractiveHTMLElement } from './isInteractiveHTMLElement';\nexport type { PriorityQueue, PriorityQueueCompareFn } from './priorityQueue';\nexport { createPriorityQueue } from './priorityQueue';\n"],"names":["anchorProperties","audioProperties","baseElementEvents","baseElementProperties","buttonProperties","clamp","colGroupProperties","colProperties","createPriorityQueue","dialogProperties","divProperties","fieldsetProperties","formProperties","getNativeElementProps","getNativeProps","getPartitionedNativeProps","getRTLSafeKey","htmlElementProperties","iframeProperties","imgProperties","inputProperties","isHTMLElement","isInteractiveHTMLElement","labelProperties","liProperties","mergeCallbacks","microdataProperties","olProperties","omit","optionProperties","selectProperties","tableProperties","tdProperties","textAreaProperties","thProperties","timeProperties","trProperties","videoProperties"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAUEA,gBAAgB;eAAhBA,4BAAgB;;IAChBC,eAAe;eAAfA,2BAAe;;IACfC,iBAAiB;eAAjBA,6BAAiB;;IACjBC,qBAAqB;eAArBA,iCAAqB;;IACrBC,gBAAgB;eAAhBA,4BAAgB;;IAdTC,KAAK;eAALA,YAAK;;IAeZC,kBAAkB;eAAlBA,8BAAkB;;IAClBC,aAAa;eAAbA,yBAAa;;IA2BNC,mBAAmB;eAAnBA,kCAAmB;;IA1B1BC,gBAAgB;eAAhBA,4BAAgB;;IAChBC,aAAa;eAAbA,yBAAa;;IACbC,kBAAkB;eAAlBA,8BAAkB;;IAClBC,cAAc;eAAdA,0BAAc;;IAlBd,4DAA4D;IAC5DC,qBAAqB;eAArBA,4CAAqB;;IAkBrBC,cAAc;eAAdA,0BAAc;;IAjBdC,yBAAyB;eAAzBA,gDAAyB;;IAElBC,aAAa;eAAbA,4BAAa;;IAgBpBC,qBAAqB;eAArBA,iCAAqB;;IACrBC,gBAAgB;eAAhBA,4BAAgB;;IAChBC,aAAa;eAAbA,yBAAa;;IACbC,eAAe;eAAfA,2BAAe;;IAeRC,aAAa;eAAbA,4BAAa;;IACbC,wBAAwB;eAAxBA,kDAAwB;;IAf/BC,eAAe;eAAfA,2BAAe;;IACfC,YAAY;eAAZA,wBAAY;;IApBLC,cAAc;eAAdA,8BAAc;;IAqBrBC,mBAAmB;eAAnBA,+BAAmB;;IACnBC,YAAY;eAAZA,wBAAY;;IArBLC,IAAI;eAAJA,UAAI;;IAsBXC,gBAAgB;eAAhBA,4BAAgB;;IAChBC,gBAAgB;eAAhBA,4BAAgB;;IAChBC,eAAe;eAAfA,2BAAe;;IACfC,YAAY;eAAZA,wBAAY;;IACZC,kBAAkB;eAAlBA,8BAAkB;;IAClBC,YAAY;eAAZA,wBAAY;;IACZC,cAAc;eAAdA,0BAAc;;IACdC,YAAY;eAAZA,wBAAY;;IACZC,eAAe;eAAfA,2BAAe;;;uBAtCK;uCAKf;+BACuB;gCACC;sBACV;4BA+Bd;+BACuB;0CACW;+BAEL"}
1
+ {"version":3,"sources":["../src/utils/index.ts"],"sourcesContent":["export { clamp } from './clamp';\nexport {\n // eslint-disable-next-line @typescript-eslint/no-deprecated\n getNativeElementProps,\n getPartitionedNativeProps,\n} from './getNativeElementProps';\nexport { getRTLSafeKey } from './getRTLSafeKey';\nexport { mergeCallbacks } from './mergeCallbacks';\nexport { omit } from './omit';\nexport {\n anchorProperties,\n audioProperties,\n baseElementEvents,\n baseElementProperties,\n buttonProperties,\n colGroupProperties,\n colProperties,\n dialogProperties,\n divProperties,\n fieldsetProperties,\n formProperties,\n getNativeProps,\n htmlElementProperties,\n iframeProperties,\n imgProperties,\n inputProperties,\n labelProperties,\n liProperties,\n microdataProperties,\n olProperties,\n optionProperties,\n selectProperties,\n tableProperties,\n tdProperties,\n textAreaProperties,\n thProperties,\n timeProperties,\n trProperties,\n videoProperties,\n} from './properties';\nexport { isHTMLElement } from './isHTMLElement';\nexport { isInteractiveHTMLElement } from './isInteractiveHTMLElement';\nexport type { PriorityQueue, PriorityQueueCompareFn } from './priorityQueue';\nexport { createPriorityQueue } from './priorityQueue';\n"],"names":["anchorProperties","audioProperties","baseElementEvents","baseElementProperties","buttonProperties","clamp","colGroupProperties","colProperties","createPriorityQueue","dialogProperties","divProperties","fieldsetProperties","formProperties","getNativeElementProps","getNativeProps","getPartitionedNativeProps","getRTLSafeKey","htmlElementProperties","iframeProperties","imgProperties","inputProperties","isHTMLElement","isInteractiveHTMLElement","labelProperties","liProperties","mergeCallbacks","microdataProperties","olProperties","omit","optionProperties","selectProperties","tableProperties","tdProperties","textAreaProperties","thProperties","timeProperties","trProperties","videoProperties"],"mappings":";;;;;;;;;;;IAUEA,gBAAgB;eAAhBA,4BAAgB;;IAChBC,eAAe;eAAfA,2BAAe;;IACfC,iBAAiB;eAAjBA,6BAAiB;;IACjBC,qBAAqB;eAArBA,iCAAqB;;IACrBC,gBAAgB;eAAhBA,4BAAgB;;IAdTC,KAAK;eAALA,YAAK;;IAeZC,kBAAkB;eAAlBA,8BAAkB;;IAClBC,aAAa;eAAbA,yBAAa;;IA2BNC,mBAAmB;eAAnBA,kCAAmB;;IA1B1BC,gBAAgB;eAAhBA,4BAAgB;;IAChBC,aAAa;eAAbA,yBAAa;;IACbC,kBAAkB;eAAlBA,8BAAkB;;IAClBC,cAAc;eAAdA,0BAAc;;IAlBd,4DAA4D;IAC5DC,qBAAqB;eAArBA,4CAAqB;;IAkBrBC,cAAc;eAAdA,0BAAc;;IAjBdC,yBAAyB;eAAzBA,gDAAyB;;IAElBC,aAAa;eAAbA,4BAAa;;IAgBpBC,qBAAqB;eAArBA,iCAAqB;;IACrBC,gBAAgB;eAAhBA,4BAAgB;;IAChBC,aAAa;eAAbA,yBAAa;;IACbC,eAAe;eAAfA,2BAAe;;IAeRC,aAAa;eAAbA,4BAAa;;IACbC,wBAAwB;eAAxBA,kDAAwB;;IAf/BC,eAAe;eAAfA,2BAAe;;IACfC,YAAY;eAAZA,wBAAY;;IApBLC,cAAc;eAAdA,8BAAc;;IAqBrBC,mBAAmB;eAAnBA,+BAAmB;;IACnBC,YAAY;eAAZA,wBAAY;;IArBLC,IAAI;eAAJA,UAAI;;IAsBXC,gBAAgB;eAAhBA,4BAAgB;;IAChBC,gBAAgB;eAAhBA,4BAAgB;;IAChBC,eAAe;eAAfA,2BAAe;;IACfC,YAAY;eAAZA,wBAAY;;IACZC,kBAAkB;eAAlBA,8BAAkB;;IAClBC,YAAY;eAAZA,wBAAY;;IACZC,cAAc;eAAdA,0BAAc;;IACdC,YAAY;eAAZA,wBAAY;;IACZC,eAAe;eAAfA,2BAAe;;;uBAtCK;uCAKf;+BACuB;gCACC;sBACV;4BA+Bd;+BACuB;0CACW;+BAEL"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/isHTMLElement.ts"],"sourcesContent":["/**\n * Verifies if a given node is an HTMLElement,\n * this method works seamlessly with frames and elements from different documents\n *\n * This is preferred over simply using `instanceof`.\n * Since `instanceof` might be problematic while operating with [multiple realms](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof#instanceof_and_multiple_realms)\n *\n * @example\n * ```ts\n * isHTMLElement(event.target) && event.target.focus()\n * isHTMLElement(event.target, {constructorName: 'HTMLInputElement'}) && event.target.value // some value\n * ```\n *\n */\nexport function isHTMLElement<ConstructorName extends HTMLElementConstructorName = 'HTMLElement'>(\n element?: unknown,\n options?: {\n /**\n * Can be used to provide a custom constructor instead of `HTMLElement`,\n * Like `HTMLInputElement` for example.\n */\n constructorName?: ConstructorName;\n },\n): element is InstanceType<(typeof globalThis)[ConstructorName]> {\n const typedElement = element as Node | null | undefined;\n return Boolean(\n typedElement?.ownerDocument?.defaultView &&\n typedElement instanceof typedElement.ownerDocument.defaultView[options?.constructorName ?? 'HTMLElement'],\n );\n}\n\ntype HTMLElementConstructorName =\n | 'HTMLElement'\n | 'HTMLAnchorElement'\n | 'HTMLAreaElement'\n | 'HTMLAudioElement'\n | 'HTMLBaseElement'\n | 'HTMLBodyElement'\n | 'HTMLBRElement'\n | 'HTMLButtonElement'\n | 'HTMLCanvasElement'\n | 'HTMLDataElement'\n | 'HTMLDataListElement'\n | 'HTMLDetailsElement'\n // NOTE: dialog is not supported in safari 14, also it was removed from lib-dom starting typescript 4.4\n // | 'HTMLDialogElement'\n | 'HTMLDivElement'\n | 'HTMLDListElement'\n | 'HTMLEmbedElement'\n | 'HTMLFieldSetElement'\n | 'HTMLFormElement'\n | 'HTMLHeadingElement'\n | 'HTMLHeadElement'\n | 'HTMLHRElement'\n | 'HTMLHtmlElement'\n | 'HTMLIFrameElement'\n | 'HTMLImageElement'\n | 'HTMLInputElement'\n | 'HTMLModElement'\n | 'HTMLLabelElement'\n | 'HTMLLegendElement'\n | 'HTMLLIElement'\n | 'HTMLLinkElement'\n | 'HTMLMapElement'\n | 'HTMLMetaElement'\n | 'HTMLMeterElement'\n | 'HTMLObjectElement'\n | 'HTMLOListElement'\n | 'HTMLOptGroupElement'\n | 'HTMLOptionElement'\n | 'HTMLOutputElement'\n | 'HTMLParagraphElement'\n | 'HTMLParamElement'\n | 'HTMLPreElement'\n | 'HTMLProgressElement'\n | 'HTMLQuoteElement'\n | 'HTMLSlotElement'\n | 'HTMLScriptElement'\n | 'HTMLSelectElement'\n | 'HTMLSourceElement'\n | 'HTMLSpanElement'\n | 'HTMLStyleElement'\n | 'HTMLTableElement'\n | 'HTMLTableColElement'\n | 'HTMLTableRowElement'\n | 'HTMLTableSectionElement'\n | 'HTMLTemplateElement'\n | 'HTMLTextAreaElement'\n | 'HTMLTimeElement'\n | 'HTMLTitleElement'\n | 'HTMLTrackElement'\n | 'HTMLUListElement'\n | 'HTMLVideoElement';\n"],"names":["isHTMLElement","element","options","typedElement","Boolean","ownerDocument","defaultView","constructorName"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;;;;;;;;;;;;CAaC;;;;+BACeA;;;eAAAA;;;AAAT,SAASA,cACdC,OAAiB,EACjBC,OAMC;QAICC;IAFF,MAAMA,eAAeF;QAG8CC;IAFnE,OAAOE,QACLD,CAAAA,yBAAAA,oCAAAA,8BAAAA,aAAcE,aAAa,cAA3BF,kDAAAA,4BAA6BG,WAAW,KACtCH,wBAAwBA,aAAaE,aAAa,CAACC,WAAW,CAACJ,CAAAA,2BAAAA,oBAAAA,8BAAAA,QAASK,eAAe,cAAxBL,sCAAAA,2BAA4B,cAAc;AAE/G"}
1
+ {"version":3,"sources":["../src/utils/isHTMLElement.ts"],"sourcesContent":["/**\n * Verifies if a given node is an HTMLElement,\n * this method works seamlessly with frames and elements from different documents\n *\n * This is preferred over simply using `instanceof`.\n * Since `instanceof` might be problematic while operating with [multiple realms](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof#instanceof_and_multiple_realms)\n *\n * @example\n * ```ts\n * isHTMLElement(event.target) && event.target.focus()\n * isHTMLElement(event.target, {constructorName: 'HTMLInputElement'}) && event.target.value // some value\n * ```\n *\n */\nexport function isHTMLElement<ConstructorName extends HTMLElementConstructorName = 'HTMLElement'>(\n element?: unknown,\n options?: {\n /**\n * Can be used to provide a custom constructor instead of `HTMLElement`,\n * Like `HTMLInputElement` for example.\n */\n constructorName?: ConstructorName;\n },\n): element is InstanceType<(typeof globalThis)[ConstructorName]> {\n const typedElement = element as Node | null | undefined;\n return Boolean(\n typedElement?.ownerDocument?.defaultView &&\n typedElement instanceof typedElement.ownerDocument.defaultView[options?.constructorName ?? 'HTMLElement'],\n );\n}\n\ntype HTMLElementConstructorName =\n | 'HTMLElement'\n | 'HTMLAnchorElement'\n | 'HTMLAreaElement'\n | 'HTMLAudioElement'\n | 'HTMLBaseElement'\n | 'HTMLBodyElement'\n | 'HTMLBRElement'\n | 'HTMLButtonElement'\n | 'HTMLCanvasElement'\n | 'HTMLDataElement'\n | 'HTMLDataListElement'\n | 'HTMLDetailsElement'\n // NOTE: dialog is not supported in safari 14, also it was removed from lib-dom starting typescript 4.4\n // | 'HTMLDialogElement'\n | 'HTMLDivElement'\n | 'HTMLDListElement'\n | 'HTMLEmbedElement'\n | 'HTMLFieldSetElement'\n | 'HTMLFormElement'\n | 'HTMLHeadingElement'\n | 'HTMLHeadElement'\n | 'HTMLHRElement'\n | 'HTMLHtmlElement'\n | 'HTMLIFrameElement'\n | 'HTMLImageElement'\n | 'HTMLInputElement'\n | 'HTMLModElement'\n | 'HTMLLabelElement'\n | 'HTMLLegendElement'\n | 'HTMLLIElement'\n | 'HTMLLinkElement'\n | 'HTMLMapElement'\n | 'HTMLMetaElement'\n | 'HTMLMeterElement'\n | 'HTMLObjectElement'\n | 'HTMLOListElement'\n | 'HTMLOptGroupElement'\n | 'HTMLOptionElement'\n | 'HTMLOutputElement'\n | 'HTMLParagraphElement'\n | 'HTMLParamElement'\n | 'HTMLPreElement'\n | 'HTMLProgressElement'\n | 'HTMLQuoteElement'\n | 'HTMLSlotElement'\n | 'HTMLScriptElement'\n | 'HTMLSelectElement'\n | 'HTMLSourceElement'\n | 'HTMLSpanElement'\n | 'HTMLStyleElement'\n | 'HTMLTableElement'\n | 'HTMLTableColElement'\n | 'HTMLTableRowElement'\n | 'HTMLTableSectionElement'\n | 'HTMLTemplateElement'\n | 'HTMLTextAreaElement'\n | 'HTMLTimeElement'\n | 'HTMLTitleElement'\n | 'HTMLTrackElement'\n | 'HTMLUListElement'\n | 'HTMLVideoElement';\n"],"names":["isHTMLElement","element","options","typedElement","Boolean","ownerDocument","defaultView","constructorName"],"mappings":"AAAA;;;;;;;;;;;;;CAaC;;;;+BACeA;;;eAAAA;;;AAAT,SAASA,cACdC,OAAiB,EACjBC,OAMC;QAICC;IAFF,MAAMA,eAAeF;QAG8CC;IAFnE,OAAOE,QACLD,CAAAA,yBAAAA,oCAAAA,8BAAAA,aAAcE,aAAa,cAA3BF,kDAAAA,4BAA6BG,WAAW,KACtCH,wBAAwBA,aAAaE,aAAa,CAACC,WAAW,CAACJ,CAAAA,2BAAAA,oBAAAA,8BAAAA,QAASK,eAAe,cAAxBL,sCAAAA,2BAA4B,cAAc;AAE/G"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/isInteractiveHTMLElement.ts"],"sourcesContent":["import { isHTMLElement } from './isHTMLElement';\n\n/**\n * @internal\n * Checks that the element has default behaviour from user input on click or 'Enter'/'Space' keys\n */\nexport function isInteractiveHTMLElement(element: unknown) {\n if (!isHTMLElement(element)) {\n return false;\n }\n\n const { tagName } = element;\n switch (tagName) {\n case 'BUTTON':\n case 'A':\n case 'INPUT':\n case 'TEXTAREA':\n return true;\n }\n\n return element.isContentEditable;\n}\n"],"names":["isInteractiveHTMLElement","element","isHTMLElement","tagName","isContentEditable"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAMgBA;;;eAAAA;;;+BANc;AAMvB,SAASA,yBAAyBC,OAAgB;IACvD,IAAI,CAACC,IAAAA,4BAAa,EAACD,UAAU;QAC3B,OAAO;IACT;IAEA,MAAM,EAAEE,OAAO,EAAE,GAAGF;IACpB,OAAQE;QACN,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;YACH,OAAO;IACX;IAEA,OAAOF,QAAQG,iBAAiB;AAClC"}
1
+ {"version":3,"sources":["../src/utils/isInteractiveHTMLElement.ts"],"sourcesContent":["import { isHTMLElement } from './isHTMLElement';\n\n/**\n * @internal\n * Checks that the element has default behaviour from user input on click or 'Enter'/'Space' keys\n */\nexport function isInteractiveHTMLElement(element: unknown) {\n if (!isHTMLElement(element)) {\n return false;\n }\n\n const { tagName } = element;\n switch (tagName) {\n case 'BUTTON':\n case 'A':\n case 'INPUT':\n case 'TEXTAREA':\n return true;\n }\n\n return element.isContentEditable;\n}\n"],"names":["isInteractiveHTMLElement","element","isHTMLElement","tagName","isContentEditable"],"mappings":";;;;+BAMgBA;;;eAAAA;;;+BANc;AAMvB,SAASA,yBAAyBC,OAAgB;IACvD,IAAI,CAACC,IAAAA,4BAAa,EAACD,UAAU;QAC3B,OAAO;IACT;IAEA,MAAM,EAAEE,OAAO,EAAE,GAAGF;IACpB,OAAQE;QACN,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;YACH,OAAO;IACX;IAEA,OAAOF,QAAQG,iBAAiB;AAClC"}