@fluentui/react-utilities 9.12.0 → 9.13.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 (162) hide show
  1. package/CHANGELOG.json +63 -1
  2. package/CHANGELOG.md +28 -2
  3. package/dist/index.d.ts +4 -0
  4. package/lib/compose/assertSlots.js +8 -3
  5. package/lib/compose/assertSlots.js.map +1 -1
  6. package/lib/compose/getSlots.js +1 -1
  7. package/lib/compose/getSlots.js.map +1 -1
  8. package/lib/compose/getSlotsNext.js +1 -1
  9. package/lib/compose/getSlotsNext.js.map +1 -1
  10. package/lib/compose/isResolvedShorthand.js.map +1 -1
  11. package/lib/compose/isSlot.js +2 -1
  12. package/lib/compose/isSlot.js.map +1 -1
  13. package/lib/compose/resolveShorthand.js +2 -1
  14. package/lib/compose/resolveShorthand.js.map +1 -1
  15. package/lib/compose/slot.js +7 -7
  16. package/lib/compose/slot.js.map +1 -1
  17. package/lib/events/mouseTouchHelpers.js.map +1 -1
  18. package/lib/hooks/useAnimationFrame.js +10 -1
  19. package/lib/hooks/useAnimationFrame.js.map +1 -1
  20. package/lib/hooks/useBrowserTimer.js.map +1 -1
  21. package/lib/hooks/useControllableState.js +5 -8
  22. package/lib/hooks/useControllableState.js.map +1 -1
  23. package/lib/hooks/useEventCallback.js.map +1 -1
  24. package/lib/hooks/useFirstMount.js.map +1 -1
  25. package/lib/hooks/useForceUpdate.js.map +1 -1
  26. package/lib/hooks/useId.js.map +1 -1
  27. package/lib/hooks/useMergedRefs.js.map +1 -1
  28. package/lib/hooks/useOnClickOutside.js +34 -29
  29. package/lib/hooks/useOnClickOutside.js.map +1 -1
  30. package/lib/hooks/useOnScrollOutside.js +9 -6
  31. package/lib/hooks/useOnScrollOutside.js.map +1 -1
  32. package/lib/hooks/usePrevious.js.map +1 -1
  33. package/lib/hooks/useScrollbarWidth.js +1 -1
  34. package/lib/hooks/useScrollbarWidth.js.map +1 -1
  35. package/lib/hooks/useTimeout.js.map +1 -1
  36. package/lib/selection/useSelection.js +2 -2
  37. package/lib/selection/useSelection.js.map +1 -1
  38. package/lib/ssr/SSRContext.js +5 -7
  39. package/lib/ssr/SSRContext.js.map +1 -1
  40. package/lib/ssr/canUseDOM.js.map +1 -1
  41. package/lib/trigger/applyTriggerPropsToChildren.js.map +1 -1
  42. package/lib/trigger/getTriggerChild.js.map +1 -1
  43. package/lib/trigger/isFluentTrigger.js.map +1 -1
  44. package/lib/utils/createSetFromIterable.js.map +1 -1
  45. package/lib/utils/getNativeElementProps.js +1 -1
  46. package/lib/utils/getNativeElementProps.js.map +1 -1
  47. package/lib/utils/getRTLSafeKey.js.map +1 -1
  48. package/lib/utils/getReactCallbackName.js +2 -4
  49. package/lib/utils/getReactCallbackName.js.map +1 -1
  50. package/lib/utils/isHTMLElement.js +2 -2
  51. package/lib/utils/isHTMLElement.js.map +1 -1
  52. package/lib/utils/isInteractiveHTMLElement.js +1 -1
  53. package/lib/utils/isInteractiveHTMLElement.js.map +1 -1
  54. package/lib/utils/mergeCallbacks.js +3 -2
  55. package/lib/utils/mergeCallbacks.js.map +1 -1
  56. package/lib/utils/omit.js.map +1 -1
  57. package/lib/utils/priorityQueue.js.map +1 -1
  58. package/lib/utils/properties.js +2 -1
  59. package/lib/utils/properties.js.map +1 -1
  60. package/lib-commonjs/compose/assertSlots.js +13 -6
  61. package/lib-commonjs/compose/assertSlots.js.map +1 -1
  62. package/lib-commonjs/compose/constants.js +6 -2
  63. package/lib-commonjs/compose/constants.js.map +1 -1
  64. package/lib-commonjs/compose/getSlots.js +6 -4
  65. package/lib-commonjs/compose/getSlots.js.map +1 -1
  66. package/lib-commonjs/compose/getSlotsNext.js +6 -4
  67. package/lib-commonjs/compose/getSlotsNext.js.map +1 -1
  68. package/lib-commonjs/compose/index.js +14 -12
  69. package/lib-commonjs/compose/index.js.map +1 -1
  70. package/lib-commonjs/compose/isResolvedShorthand.js +3 -1
  71. package/lib-commonjs/compose/isResolvedShorthand.js.map +1 -1
  72. package/lib-commonjs/compose/isSlot.js +5 -2
  73. package/lib-commonjs/compose/isSlot.js.map +1 -1
  74. package/lib-commonjs/compose/resolveShorthand.js +7 -4
  75. package/lib-commonjs/compose/resolveShorthand.js.map +1 -1
  76. package/lib-commonjs/compose/slot.js +18 -12
  77. package/lib-commonjs/compose/slot.js.map +1 -1
  78. package/lib-commonjs/compose/types.js +2 -2
  79. package/lib-commonjs/compose/types.js.map +1 -1
  80. package/lib-commonjs/events/index.js +2 -2
  81. package/lib-commonjs/events/index.js.map +1 -1
  82. package/lib-commonjs/events/mouseTouchHelpers.js +11 -5
  83. package/lib-commonjs/events/mouseTouchHelpers.js.map +1 -1
  84. package/lib-commonjs/hooks/index.js +14 -14
  85. package/lib-commonjs/hooks/index.js.map +1 -1
  86. package/lib-commonjs/hooks/useAnimationFrame.js +13 -2
  87. package/lib-commonjs/hooks/useAnimationFrame.js.map +1 -1
  88. package/lib-commonjs/hooks/useBrowserTimer.js +5 -3
  89. package/lib-commonjs/hooks/useBrowserTimer.js.map +1 -1
  90. package/lib-commonjs/hooks/useControllableState.js +10 -11
  91. package/lib-commonjs/hooks/useControllableState.js.map +1 -1
  92. package/lib-commonjs/hooks/useEventCallback.js +5 -3
  93. package/lib-commonjs/hooks/useEventCallback.js.map +1 -1
  94. package/lib-commonjs/hooks/useFirstMount.js +5 -3
  95. package/lib-commonjs/hooks/useFirstMount.js.map +1 -1
  96. package/lib-commonjs/hooks/useForceUpdate.js +3 -1
  97. package/lib-commonjs/hooks/useForceUpdate.js.map +1 -1
  98. package/lib-commonjs/hooks/useId.js +11 -5
  99. package/lib-commonjs/hooks/useId.js.map +1 -1
  100. package/lib-commonjs/hooks/useIsomorphicLayoutEffect.js +5 -3
  101. package/lib-commonjs/hooks/useIsomorphicLayoutEffect.js.map +1 -1
  102. package/lib-commonjs/hooks/useMergedRefs.js +5 -3
  103. package/lib-commonjs/hooks/useMergedRefs.js.map +1 -1
  104. package/lib-commonjs/hooks/useOnClickOutside.js +38 -32
  105. package/lib-commonjs/hooks/useOnClickOutside.js.map +1 -1
  106. package/lib-commonjs/hooks/useOnScrollOutside.js +14 -9
  107. package/lib-commonjs/hooks/useOnScrollOutside.js.map +1 -1
  108. package/lib-commonjs/hooks/usePrevious.js +5 -3
  109. package/lib-commonjs/hooks/usePrevious.js.map +1 -1
  110. package/lib-commonjs/hooks/useScrollbarWidth.js +6 -4
  111. package/lib-commonjs/hooks/useScrollbarWidth.js.map +1 -1
  112. package/lib-commonjs/hooks/useTimeout.js +3 -1
  113. package/lib-commonjs/hooks/useTimeout.js.map +1 -1
  114. package/lib-commonjs/index.js +129 -43
  115. package/lib-commonjs/index.js.map +1 -1
  116. package/lib-commonjs/selection/index.js +3 -3
  117. package/lib-commonjs/selection/index.js.map +1 -1
  118. package/lib-commonjs/selection/types.js +2 -2
  119. package/lib-commonjs/selection/types.js.map +1 -1
  120. package/lib-commonjs/selection/useSelection.js +7 -5
  121. package/lib-commonjs/selection/useSelection.js.map +1 -1
  122. package/lib-commonjs/ssr/SSRContext.js +22 -14
  123. package/lib-commonjs/ssr/SSRContext.js.map +1 -1
  124. package/lib-commonjs/ssr/canUseDOM.js +3 -1
  125. package/lib-commonjs/ssr/canUseDOM.js.map +1 -1
  126. package/lib-commonjs/ssr/index.js +3 -3
  127. package/lib-commonjs/ssr/index.js.map +1 -1
  128. package/lib-commonjs/trigger/applyTriggerPropsToChildren.js +5 -3
  129. package/lib-commonjs/trigger/applyTriggerPropsToChildren.js.map +1 -1
  130. package/lib-commonjs/trigger/getTriggerChild.js +5 -3
  131. package/lib-commonjs/trigger/getTriggerChild.js.map +1 -1
  132. package/lib-commonjs/trigger/index.js +5 -5
  133. package/lib-commonjs/trigger/index.js.map +1 -1
  134. package/lib-commonjs/trigger/isFluentTrigger.js +5 -3
  135. package/lib-commonjs/trigger/isFluentTrigger.js.map +1 -1
  136. package/lib-commonjs/trigger/types.js +2 -2
  137. package/lib-commonjs/trigger/types.js.map +1 -1
  138. package/lib-commonjs/utils/clamp.js +3 -1
  139. package/lib-commonjs/utils/clamp.js.map +1 -1
  140. package/lib-commonjs/utils/createSetFromIterable.js +3 -1
  141. package/lib-commonjs/utils/createSetFromIterable.js.map +1 -1
  142. package/lib-commonjs/utils/getNativeElementProps.js +9 -5
  143. package/lib-commonjs/utils/getNativeElementProps.js.map +1 -1
  144. package/lib-commonjs/utils/getRTLSafeKey.js +3 -1
  145. package/lib-commonjs/utils/getRTLSafeKey.js.map +1 -1
  146. package/lib-commonjs/utils/getReactCallbackName.js +7 -7
  147. package/lib-commonjs/utils/getReactCallbackName.js.map +1 -1
  148. package/lib-commonjs/utils/index.js +10 -10
  149. package/lib-commonjs/utils/index.js.map +1 -1
  150. package/lib-commonjs/utils/isHTMLElement.js +5 -3
  151. package/lib-commonjs/utils/isHTMLElement.js.map +1 -1
  152. package/lib-commonjs/utils/isInteractiveHTMLElement.js +4 -2
  153. package/lib-commonjs/utils/isInteractiveHTMLElement.js.map +1 -1
  154. package/lib-commonjs/utils/mergeCallbacks.js +6 -3
  155. package/lib-commonjs/utils/mergeCallbacks.js.map +1 -1
  156. package/lib-commonjs/utils/omit.js +3 -1
  157. package/lib-commonjs/utils/omit.js.map +1 -1
  158. package/lib-commonjs/utils/priorityQueue.js +3 -1
  159. package/lib-commonjs/utils/priorityQueue.js.map +1 -1
  160. package/lib-commonjs/utils/properties.js +89 -30
  161. package/lib-commonjs/utils/properties.js.map +1 -1
  162. package/package.json +5 -5
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
- _exportStar(require("./canUseDOM"), exports);
7
- _exportStar(require("./SSRContext"), exports);
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./canUseDOM"), exports);
7
+ _export_star._(require("./SSRContext"), exports);
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './canUseDOM';\nexport * from './SSRContext';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA"}
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export * from './canUseDOM';\nexport * from './SSRContext';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA"}
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "applyTriggerPropsToChildren", {
6
6
  enumerable: true,
7
- get: ()=>applyTriggerPropsToChildren
7
+ get: function() {
8
+ return applyTriggerPropsToChildren;
9
+ }
8
10
  });
9
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
11
13
  const _isFluentTrigger = require("./isFluentTrigger");
12
14
  function applyTriggerPropsToChildren(children, triggerChildProps) {
13
15
  if (typeof children === 'function') {
@@ -1 +1 @@
1
- {"version":3,"sources":["applyTriggerPropsToChildren.js"],"sourcesContent":["import * as React from 'react';\nimport { isFluentTrigger } from './isFluentTrigger';\n/**\n * @internal\n * resolve the trigger props to the children, either by calling the render function, or cloning with the new props.\n */ export function applyTriggerPropsToChildren(children, triggerChildProps) {\n if (typeof children === 'function') {\n return children(triggerChildProps);\n } else if (children) {\n return cloneTriggerTree(children, triggerChildProps);\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 * 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 */ function cloneTriggerTree(child, triggerProps) {\n if (!React.isValidElement(child) || child.type === React.Fragment) {\n throw new Error('A trigger element must be a single element for this component. ' + \"Please ensure that you're not using React Fragments.\");\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);\n }\n}\n"],"names":["applyTriggerPropsToChildren","children","triggerChildProps","cloneTriggerTree","child","triggerProps","React","isValidElement","type","Fragment","Error","isFluentTrigger","grandchild","props","cloneElement","undefined"],"mappings":";;;;+BAKoBA;;aAAAA;;;6DALG;iCACS;AAIrB,SAASA,4BAA4BC,QAAQ,EAAEC,iBAAiB,EAAE;IACzE,IAAI,OAAOD,aAAa,YAAY;QAChC,OAAOA,SAASC;IACpB,OAAO,IAAID,UAAU;QACjB,OAAOE,iBAAiBF,UAAUC;IACtC,CAAC;IACD,+FAA+F;IAC/F,sCAAsC;IACtC,0FAA0F;IAC1F,OAAOD,YAAY,IAAI;AAC3B;AACA;;;CAGC,GAAG,SAASE,iBAAiBC,KAAK,EAAEC,YAAY,EAAE;IAC/C,IAAI,eAACC,OAAMC,cAAc,CAACH,UAAUA,MAAMI,IAAI,KAAKF,OAAMG,QAAQ,EAAE;QAC/D,MAAM,IAAIC,MAAM,oEAAoE,wDAAwD;IAChJ,CAAC;IACD,IAAIC,IAAAA,gCAAe,EAACP,QAAQ;QACxB,MAAMQ,aAAaT,iBAAiBC,MAAMS,KAAK,CAACZ,QAAQ,EAAEI;QAC1D,qBAAOC,OAAMQ,YAAY,CAACV,OAAOW,WAAWH;IAChD,OAAO;QACH,qBAAON,OAAMQ,YAAY,CAACV,OAAOC;IACrC,CAAC;AACL"}
1
+ {"version":3,"sources":["applyTriggerPropsToChildren.js"],"sourcesContent":["import * as React from 'react';\nimport { isFluentTrigger } from './isFluentTrigger';\n/**\n * @internal\n * resolve the trigger props to the children, either by calling the render function, or cloning with the new props.\n */ export function applyTriggerPropsToChildren(children, triggerChildProps) {\n if (typeof children === 'function') {\n return children(triggerChildProps);\n } else if (children) {\n return cloneTriggerTree(children, triggerChildProps);\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 * 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 */ function cloneTriggerTree(child, triggerProps) {\n if (!React.isValidElement(child) || child.type === React.Fragment) {\n throw new Error('A trigger element must be a single element for this component. ' + \"Please ensure that you're not using React Fragments.\");\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);\n }\n}\n"],"names":["applyTriggerPropsToChildren","children","triggerChildProps","cloneTriggerTree","child","triggerProps","React","isValidElement","type","Fragment","Error","isFluentTrigger","grandchild","props","cloneElement","undefined"],"mappings":";;;;+BAKoBA;;;eAAAA;;;;iEALG;iCACS;AAIrB,SAASA,4BAA4BC,QAAQ,EAAEC,iBAAiB;IACvE,IAAI,OAAOD,aAAa,YAAY;QAChC,OAAOA,SAASC;IACpB,OAAO,IAAID,UAAU;QACjB,OAAOE,iBAAiBF,UAAUC;IACtC;IACA,+FAA+F;IAC/F,sCAAsC;IACtC,0FAA0F;IAC1F,OAAOD,YAAY;AACvB;AACA;;;CAGC,GAAG,SAASE,iBAAiBC,KAAK,EAAEC,YAAY;IAC7C,IAAI,eAACC,OAAMC,cAAc,CAACH,UAAUA,MAAMI,IAAI,KAAKF,OAAMG,QAAQ,EAAE;QAC/D,MAAM,IAAIC,MAAM,oEAAoE;IACxF;IACA,IAAIC,IAAAA,gCAAe,EAACP,QAAQ;QACxB,MAAMQ,aAAaT,iBAAiBC,MAAMS,KAAK,CAACZ,QAAQ,EAAEI;QAC1D,qBAAOC,OAAMQ,YAAY,CAACV,OAAOW,WAAWH;IAChD,OAAO;QACH,qBAAON,OAAMQ,YAAY,CAACV,OAAOC;IACrC;AACJ"}
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "getTriggerChild", {
6
6
  enumerable: true,
7
- get: ()=>getTriggerChild
7
+ get: function() {
8
+ return getTriggerChild;
9
+ }
8
10
  });
9
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
11
13
  const _isFluentTrigger = require("./isFluentTrigger");
12
14
  function getTriggerChild(children) {
13
15
  if (!/*#__PURE__*/ _react.isValidElement(children)) {
@@ -1 +1 @@
1
- {"version":3,"sources":["getTriggerChild.js"],"sourcesContent":["import * as React from 'react';\nimport { isFluentTrigger } from './isFluentTrigger';\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 */ export function getTriggerChild(children) {\n if (!React.isValidElement(children)) {\n return null;\n }\n return isFluentTrigger(children) ? getTriggerChild(// 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.children) : children;\n}\n"],"names":["getTriggerChild","children","React","isValidElement","isFluentTrigger","props"],"mappings":";;;;+BAuBoBA;;aAAAA;;;6DAvBG;iCACS;AAsBrB,SAASA,gBAAgBC,QAAQ,EAAE;IAC1C,IAAI,eAACC,OAAMC,cAAc,CAACF,WAAW;QACjC,OAAO,IAAI;IACf,CAAC;IACD,OAAOG,IAAAA,gCAAe,EAACH,YAAYD,gBACnC,4CAA4C;IAC5CC,SAASI,KAAK,CAACJ,QAAQ,IAAIA,QAAQ;AACvC"}
1
+ {"version":3,"sources":["getTriggerChild.js"],"sourcesContent":["import * as React from 'react';\nimport { isFluentTrigger } from './isFluentTrigger';\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 */ export function getTriggerChild(children) {\n if (!React.isValidElement(children)) {\n return null;\n }\n return isFluentTrigger(children) ? getTriggerChild(// 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.children) : children;\n}\n"],"names":["getTriggerChild","children","React","isValidElement","isFluentTrigger","props"],"mappings":";;;;+BAuBoBA;;;eAAAA;;;;iEAvBG;iCACS;AAsBrB,SAASA,gBAAgBC,QAAQ;IACxC,IAAI,eAACC,OAAMC,cAAc,CAACF,WAAW;QACjC,OAAO;IACX;IACA,OAAOG,IAAAA,gCAAe,EAACH,YAAYD,gBACnC,4CAA4C;IAC5CC,SAASI,KAAK,CAACJ,QAAQ,IAAIA;AAC/B"}
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
- _exportStar(require("./applyTriggerPropsToChildren"), exports);
7
- _exportStar(require("./getTriggerChild"), exports);
8
- _exportStar(require("./isFluentTrigger"), exports);
9
- _exportStar(require("./types"), exports);
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./applyTriggerPropsToChildren"), exports);
7
+ _export_star._(require("./getTriggerChild"), exports);
8
+ _export_star._(require("./isFluentTrigger"), exports);
9
+ _export_star._(require("./types"), exports);
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './applyTriggerPropsToChildren';\nexport * from './getTriggerChild';\nexport * from './isFluentTrigger';\nexport * from './types';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA"}
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export * from './applyTriggerPropsToChildren';\nexport * from './getTriggerChild';\nexport * from './isFluentTrigger';\nexport * from './types';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA"}
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "isFluentTrigger", {
6
6
  enumerable: true,
7
- get: ()=>isFluentTrigger
7
+ get: function() {
8
+ return isFluentTrigger;
9
+ }
8
10
  });
9
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
11
13
  function isFluentTrigger(element) {
12
14
  return Boolean(element.type.isFluentTriggerComponent);
13
15
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["isFluentTrigger.js"],"sourcesContent":["import * as React from 'react';\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 */ export function isFluentTrigger(element) {\n return Boolean(element.type.isFluentTriggerComponent);\n}\n"],"names":["isFluentTrigger","element","Boolean","type","isFluentTriggerComponent"],"mappings":";;;;+BAKoBA;;aAAAA;;;6DALG;AAKZ,SAASA,gBAAgBC,OAAO,EAAE;IACzC,OAAOC,QAAQD,QAAQE,IAAI,CAACC,wBAAwB;AACxD"}
1
+ {"version":3,"sources":["isFluentTrigger.js"],"sourcesContent":["import * as React from 'react';\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 */ export function isFluentTrigger(element) {\n return Boolean(element.type.isFluentTriggerComponent);\n}\n"],"names":["isFluentTrigger","element","Boolean","type","isFluentTriggerComponent"],"mappings":";;;;+BAKoBA;;;eAAAA;;;;iEALG;AAKZ,SAASA,gBAAgBC,OAAO;IACvC,OAAOC,QAAQD,QAAQE,IAAI,CAACC,wBAAwB;AACxD"}
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
6
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
5
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
6
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
@@ -1 +1 @@
1
- {"version":3,"sources":["types.js"],"sourcesContent":["import * as React from 'react';\n"],"names":[],"mappings":";;;;;6DAAuB"}
1
+ {"version":3,"sources":["types.js"],"sourcesContent":["import * as React from 'react';\n"],"names":[],"mappings":";;;;;iEAAuB"}
@@ -11,6 +11,8 @@ Object.defineProperty(exports, "__esModule", {
11
11
  });
12
12
  Object.defineProperty(exports, "clamp", {
13
13
  enumerable: true,
14
- get: ()=>clamp
14
+ get: function() {
15
+ return clamp;
16
+ }
15
17
  });
16
18
  const clamp = (value, min, max)=>Math.max(min, Math.min(max, value || 0));
@@ -1 +1 @@
1
- {"version":3,"sources":["clamp.js"],"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 */ export const clamp = (value, min, max)=>Math.max(min, Math.min(max, value || 0));\n"],"names":["clamp","value","min","max","Math"],"mappings":"AAAA;;;;;;;CAOC;;;;+BAAgBA;;aAAAA;;AAAN,MAAMA,QAAQ,CAACC,OAAOC,KAAKC,MAAMC,KAAKD,GAAG,CAACD,KAAKE,KAAKF,GAAG,CAACC,KAAKF,SAAS"}
1
+ {"version":3,"sources":["clamp.js"],"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 */ export const clamp = (value, min, max)=>Math.max(min, Math.min(max, value || 0));\n"],"names":["clamp","value","min","max","Math"],"mappings":"AAAA;;;;;;;CAOC;;;;+BAAgBA;;;eAAAA;;;AAAN,MAAMA,QAAQ,CAACC,OAAOC,KAAKC,MAAMC,KAAKD,GAAG,CAACD,KAAKE,KAAKF,GAAG,CAACC,KAAKF,SAAS"}
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  Object.defineProperty(exports, "createSetFromIterable", {
8
8
  enumerable: true,
9
- get: ()=>createSetFromIterable
9
+ get: function() {
10
+ return createSetFromIterable;
11
+ }
10
12
  });
11
13
  function createSetFromIterable(iterable) {
12
14
  return iterable instanceof Set ? iterable : new Set(iterable);
@@ -1 +1 @@
1
- {"version":3,"sources":["createSetFromIterable.js"],"sourcesContent":["/**\n * Creates a set from a given iterable, in case the iterable is a set itself, returns the given set instead.\n */ export function createSetFromIterable(iterable) {\n return iterable instanceof Set ? iterable : new Set(iterable);\n}\n"],"names":["createSetFromIterable","iterable","Set"],"mappings":"AAAA;;CAEC;;;;+BAAmBA;;aAAAA;;AAAT,SAASA,sBAAsBC,QAAQ,EAAE;IAChD,OAAOA,oBAAoBC,MAAMD,WAAW,IAAIC,IAAID,SAAS;AACjE"}
1
+ {"version":3,"sources":["createSetFromIterable.js"],"sourcesContent":["/**\n * Creates a set from a given iterable, in case the iterable is a set itself, returns the given set instead.\n */ export function createSetFromIterable(iterable) {\n return iterable instanceof Set ? iterable : new Set(iterable);\n}\n"],"names":["createSetFromIterable","iterable","Set"],"mappings":"AAAA;;CAEC;;;;+BAAmBA;;;eAAAA;;;AAAT,SAASA,sBAAsBC,QAAQ;IAC9C,OAAOA,oBAAoBC,MAAMD,WAAW,IAAIC,IAAID;AACxD"}
@@ -9,11 +9,15 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- getNativeElementProps: ()=>getNativeElementProps,
13
- getPartitionedNativeProps: ()=>getPartitionedNativeProps
12
+ getNativeElementProps: function() {
13
+ return getNativeElementProps;
14
+ },
15
+ getPartitionedNativeProps: function() {
16
+ return getPartitionedNativeProps;
17
+ }
14
18
  });
15
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
16
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
19
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
20
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
17
21
  const _properties = require("./properties");
18
22
  const nativeElementMap = {
19
23
  label: _properties.labelProperties,
@@ -45,7 +49,7 @@ function getNativeElementProps(tagName, props, excludedPropNames) {
45
49
  allowedPropNames.as = 1;
46
50
  return (0, _properties.getNativeProps)(props, allowedPropNames, excludedPropNames);
47
51
  }
48
- const getPartitionedNativeProps = ({ primarySlotTagName , props , excludedPropNames })=>{
52
+ const getPartitionedNativeProps = ({ primarySlotTagName, props, excludedPropNames })=>{
49
53
  return {
50
54
  root: {
51
55
  style: props.style,
@@ -1 +1 @@
1
- {"version":3,"sources":["getNativeElementProps.js"],"sourcesContent":["import * as React from 'react';\nimport { labelProperties, audioProperties, videoProperties, olProperties, liProperties, anchorProperties, buttonProperties, inputProperties, textAreaProperties, selectProperties, optionProperties, tableProperties, trProperties, thProperties, tdProperties, colGroupProperties, colProperties, fieldsetProperties, formProperties, iframeProperties, imgProperties, htmlElementProperties, getNativeProps, timeProperties, dialogProperties } from './properties';\nconst nativeElementMap = {\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 * 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 */ // eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getNativeElementProps(tagName, props, excludedPropNames) {\n const allowedPropNames = tagName && nativeElementMap[tagName] || htmlElementProperties;\n allowedPropNames.as = 1;\n return getNativeProps(props, allowedPropNames, excludedPropNames);\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 */ export const getPartitionedNativeProps = ({ primarySlotTagName , props , excludedPropNames })=>{\n return {\n root: {\n style: props.style,\n className: props.className\n },\n primary: getNativeElementProps(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":";;;;;;;;;;;IAkCgBA,qBAAqB,MAArBA;IAYCC,yBAAyB,MAAzBA;;;6DA9CM;4BACga;AACvb,MAAMC,mBAAmB;IACrBC,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;AAC5B;AAQO,SAAShD,sBAAsBiD,OAAO,EAAEC,KAAK,EAAEC,iBAAiB,EAAE;IACrE,MAAMC,mBAAmBH,WAAW/C,gBAAgB,CAAC+C,QAAQ,IAAII,iCAAqB;IACtFD,iBAAiBE,EAAE,GAAG;IACtB,OAAOC,IAAAA,0BAAc,EAACL,OAAOE,kBAAkBD;AACnD;AAQW,MAAMlD,4BAA4B,CAAC,EAAEuD,mBAAkB,EAAGN,MAAK,EAAGC,kBAAiB,EAAG,GAAG;IAChG,OAAO;QACHM,MAAM;YACFC,OAAOR,MAAMQ,KAAK;YAClBC,WAAWT,MAAMS,SAAS;QAC9B;QACAC,SAAS5D,sBAAsBwD,oBAAoBN,OAAO;eACnDC,qBAAqB,EAAE;YAC1B;YACA;SACH;IACL;AACJ"}
1
+ {"version":3,"sources":["getNativeElementProps.js"],"sourcesContent":["import * as React from 'react';\nimport { labelProperties, audioProperties, videoProperties, olProperties, liProperties, anchorProperties, buttonProperties, inputProperties, textAreaProperties, selectProperties, optionProperties, tableProperties, trProperties, thProperties, tdProperties, colGroupProperties, colProperties, fieldsetProperties, formProperties, iframeProperties, imgProperties, htmlElementProperties, getNativeProps, timeProperties, dialogProperties } from './properties';\nconst nativeElementMap = {\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 * 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 */ // eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getNativeElementProps(tagName, props, excludedPropNames) {\n const allowedPropNames = tagName && nativeElementMap[tagName] || htmlElementProperties;\n allowedPropNames.as = 1;\n return getNativeProps(props, allowedPropNames, excludedPropNames);\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 */ export const getPartitionedNativeProps = ({ primarySlotTagName, props, excludedPropNames })=>{\n return {\n root: {\n style: props.style,\n className: props.className\n },\n primary: getNativeElementProps(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":";;;;;;;;;;;IAkCgBA,qBAAqB;eAArBA;;IAYCC,yBAAyB;eAAzBA;;;;iEA9CM;4BACga;AACvb,MAAMC,mBAAmB;IACrBC,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;AAC5B;AAQO,SAAShD,sBAAsBiD,OAAO,EAAEC,KAAK,EAAEC,iBAAiB;IACnE,MAAMC,mBAAmBH,WAAW/C,gBAAgB,CAAC+C,QAAQ,IAAII,iCAAqB;IACtFD,iBAAiBE,EAAE,GAAG;IACtB,OAAOC,IAAAA,0BAAc,EAACL,OAAOE,kBAAkBD;AACnD;AAQW,MAAMlD,4BAA4B,CAAC,EAAEuD,kBAAkB,EAAEN,KAAK,EAAEC,iBAAiB,EAAE;IAC1F,OAAO;QACHM,MAAM;YACFC,OAAOR,MAAMQ,KAAK;YAClBC,WAAWT,MAAMS,SAAS;QAC9B;QACAC,SAAS5D,sBAAsBwD,oBAAoBN,OAAO;eACnDC,qBAAqB,EAAE;YAC1B;YACA;SACH;IACL;AACJ"}
@@ -7,7 +7,9 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  Object.defineProperty(exports, "getRTLSafeKey", {
9
9
  enumerable: true,
10
- get: ()=>getRTLSafeKey
10
+ get: function() {
11
+ return getRTLSafeKey;
12
+ }
11
13
  });
12
14
  const getRTLSafeKey = (key, dir)=>{
13
15
  if (dir === 'rtl') {
@@ -1 +1 @@
1
- {"version":3,"sources":["getRTLSafeKey.js"],"sourcesContent":["/**\n * @internal\n * Finds and swaps a provided key for it's right to left format.\n */ export const getRTLSafeKey = (key, dir)=>{\n if (dir === 'rtl') {\n switch(key){\n case 'ArrowLeft':\n {\n return 'ArrowRight';\n }\n case 'ArrowRight':\n {\n return 'ArrowLeft';\n }\n }\n }\n return key;\n};\n"],"names":["getRTLSafeKey","key","dir"],"mappings":"AAAA;;;CAGC;;;;+BAAgBA;;aAAAA;;AAAN,MAAMA,gBAAgB,CAACC,KAAKC,MAAM;IACzC,IAAIA,QAAQ,OAAO;QACf,OAAOD;YACH,KAAK;gBACD;oBACI,OAAO;gBACX;YACJ,KAAK;gBACD;oBACI,OAAO;gBACX;QACR;IACJ,CAAC;IACD,OAAOA;AACX"}
1
+ {"version":3,"sources":["getRTLSafeKey.js"],"sourcesContent":["/**\n * @internal\n * Finds and swaps a provided key for it's right to left format.\n */ export const getRTLSafeKey = (key, dir)=>{\n if (dir === 'rtl') {\n switch(key){\n case 'ArrowLeft':\n {\n return 'ArrowRight';\n }\n case 'ArrowRight':\n {\n return 'ArrowLeft';\n }\n }\n }\n return key;\n};\n"],"names":["getRTLSafeKey","key","dir"],"mappings":"AAAA;;;CAGC;;;;+BAAgBA;;;eAAAA;;;AAAN,MAAMA,gBAAgB,CAACC,KAAKC;IACnC,IAAIA,QAAQ,OAAO;QACf,OAAOD;YACH,KAAK;gBACD;oBACI,OAAO;gBACX;YACJ,KAAK;gBACD;oBACI,OAAO;gBACX;QACR;IACJ;IACA,OAAOA;AACX"}
@@ -4,10 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "getReactCallbackName", {
6
6
  enumerable: true,
7
- get: ()=>getReactCallbackName
7
+ get: function() {
8
+ return getReactCallbackName;
9
+ }
8
10
  });
9
- const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
10
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
11
+ const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
12
+ const _react = /*#__PURE__*/ _interop_require_wildcard._(require("react"));
11
13
  function getReactCallbackName(event) {
12
14
  if (event._reactName) {
13
15
  return event._reactName;
@@ -20,9 +22,7 @@ function getReactCallbackName(event) {
20
22
  }
21
23
  if (process.env.NODE_ENV !== 'production') {
22
24
  // eslint-disable-next-line no-console
23
- console.error([
24
- 'Passed React.SyntheticEvent does not contain ".dispatchConfig" or "._reactName".',
25
- 'This should not happen, please report it to https://github.com/microsoft/fluentui'
26
- ]);
25
+ console.error(`@fluentui/react-utilities [${getReactCallbackName.name}]:
26
+ Passed React.SyntheticEvent does not contain ".dispatchConfig" or "._reactName". This should not happen, please report it to https://github.com/microsoft/fluentui.`);
27
27
  }
28
28
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["getReactCallbackName.js"],"sourcesContent":["import * as React from 'react';\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 */ export function getReactCallbackName(event) {\n if (event._reactName) {\n return event._reactName;\n }\n if (event.dispatchConfig) {\n if (event.dispatchConfig.registrationName) {\n return event.dispatchConfig.registrationName;\n }\n return event.dispatchConfig.phasedRegistrationNames.bubbled;\n }\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error([\n 'Passed React.SyntheticEvent does not contain \".dispatchConfig\" or \"._reactName\".',\n '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"],"mappings":";;;;+BAOoBA;;aAAAA;;;6DAPG;AAOZ,SAASA,qBAAqBC,KAAK,EAAE;IAC5C,IAAIA,MAAMC,UAAU,EAAE;QAClB,OAAOD,MAAMC,UAAU;IAC3B,CAAC;IACD,IAAID,MAAME,cAAc,EAAE;QACtB,IAAIF,MAAME,cAAc,CAACC,gBAAgB,EAAE;YACvC,OAAOH,MAAME,cAAc,CAACC,gBAAgB;QAChD,CAAC;QACD,OAAOH,MAAME,cAAc,CAACE,uBAAuB,CAACC,OAAO;IAC/D,CAAC;IACD,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACvC,sCAAsC;QACtCC,QAAQC,KAAK,CAAC;YACV;YACA;SACH;IACL,CAAC;AACL"}
1
+ {"version":3,"sources":["getReactCallbackName.js"],"sourcesContent":["import * as React from 'react';\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 */ export function getReactCallbackName(event) {\n if (event._reactName) {\n return event._reactName;\n }\n if (event.dispatchConfig) {\n if (event.dispatchConfig.registrationName) {\n return event.dispatchConfig.registrationName;\n }\n return event.dispatchConfig.phasedRegistrationNames.bubbled;\n }\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.error(`@fluentui/react-utilities [${getReactCallbackName.name}]:\nPassed React.SyntheticEvent does not contain \".dispatchConfig\" or \"._reactName\". This should not happen, please report it to https://github.com/microsoft/fluentui.`);\n }\n}\n"],"names":["getReactCallbackName","event","_reactName","dispatchConfig","registrationName","phasedRegistrationNames","bubbled","process","env","NODE_ENV","console","error","name"],"mappings":";;;;+BAOoBA;;;eAAAA;;;;iEAPG;AAOZ,SAASA,qBAAqBC,KAAK;IAC1C,IAAIA,MAAMC,UAAU,EAAE;QAClB,OAAOD,MAAMC,UAAU;IAC3B;IACA,IAAID,MAAME,cAAc,EAAE;QACtB,IAAIF,MAAME,cAAc,CAACC,gBAAgB,EAAE;YACvC,OAAOH,MAAME,cAAc,CAACC,gBAAgB;QAChD;QACA,OAAOH,MAAME,cAAc,CAACE,uBAAuB,CAACC,OAAO;IAC/D;IACA,IAAIC,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACvC,sCAAsC;QACtCC,QAAQC,KAAK,CAAC,CAAC,2BAA2B,EAAEX,qBAAqBY,IAAI,CAAC;mKACqF,CAAC;IAChK;AACJ"}
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
- _exportStar(require("./clamp"), exports);
7
- _exportStar(require("./getNativeElementProps"), exports);
8
- _exportStar(require("./getRTLSafeKey"), exports);
9
- _exportStar(require("./mergeCallbacks"), exports);
10
- _exportStar(require("./omit"), exports);
11
- _exportStar(require("./properties"), exports);
12
- _exportStar(require("./isHTMLElement"), exports);
13
- _exportStar(require("./isInteractiveHTMLElement"), exports);
14
- _exportStar(require("./priorityQueue"), exports);
5
+ const _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./clamp"), exports);
7
+ _export_star._(require("./getNativeElementProps"), exports);
8
+ _export_star._(require("./getRTLSafeKey"), exports);
9
+ _export_star._(require("./mergeCallbacks"), exports);
10
+ _export_star._(require("./omit"), exports);
11
+ _export_star._(require("./properties"), exports);
12
+ _export_star._(require("./isHTMLElement"), exports);
13
+ _export_star._(require("./isInteractiveHTMLElement"), exports);
14
+ _export_star._(require("./priorityQueue"), exports);
@@ -1 +1 @@
1
- {"version":3,"sources":["index.js"],"sourcesContent":["export * from './clamp';\nexport * from './getNativeElementProps';\nexport * from './getRTLSafeKey';\nexport * from './mergeCallbacks';\nexport * from './omit';\nexport * from './properties';\nexport * from './isHTMLElement';\nexport * from './isInteractiveHTMLElement';\nexport * from './priorityQueue';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA;oBACA"}
1
+ {"version":3,"sources":["index.js"],"sourcesContent":["export * from './clamp';\nexport * from './getNativeElementProps';\nexport * from './getRTLSafeKey';\nexport * from './mergeCallbacks';\nexport * from './omit';\nexport * from './properties';\nexport * from './isHTMLElement';\nexport * from './isInteractiveHTMLElement';\nexport * from './priorityQueue';\n"],"names":[],"mappings":";;;;;uBAAc;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA;uBACA"}
@@ -17,11 +17,13 @@ Object.defineProperty(exports, "__esModule", {
17
17
  });
18
18
  Object.defineProperty(exports, "isHTMLElement", {
19
19
  enumerable: true,
20
- get: ()=>isHTMLElement
20
+ get: function() {
21
+ return isHTMLElement;
22
+ }
21
23
  });
22
24
  function isHTMLElement(element, options) {
23
- var _typedElement_ownerDocument;
25
+ var _typedElement_ownerDocument, _typedElement, _options;
24
26
  const typedElement = element;
25
27
  var _options_constructorName;
26
- return Boolean((typedElement === null || typedElement === void 0 ? void 0 : (_typedElement_ownerDocument = typedElement.ownerDocument) === null || _typedElement_ownerDocument === void 0 ? void 0 : _typedElement_ownerDocument.defaultView) && typedElement instanceof typedElement.ownerDocument.defaultView[(_options_constructorName = options === null || options === void 0 ? void 0 : options.constructorName) !== null && _options_constructorName !== void 0 ? _options_constructorName : 'HTMLElement']);
28
+ return Boolean(((_typedElement = typedElement) === null || _typedElement === void 0 ? void 0 : (_typedElement_ownerDocument = _typedElement.ownerDocument) === null || _typedElement_ownerDocument === void 0 ? void 0 : _typedElement_ownerDocument.defaultView) && typedElement instanceof typedElement.ownerDocument.defaultView[(_options_constructorName = (_options = options) === null || _options === void 0 ? void 0 : _options.constructorName) !== null && _options_constructorName !== void 0 ? _options_constructorName : 'HTMLElement']);
27
29
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["isHTMLElement.js"],"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 */ export function isHTMLElement(element, options) {\n var _typedElement_ownerDocument;\n const typedElement = element;\n var _options_constructorName;\n return Boolean((typedElement === null || typedElement === void 0 ? void 0 : (_typedElement_ownerDocument = typedElement.ownerDocument) === null || _typedElement_ownerDocument === void 0 ? void 0 : _typedElement_ownerDocument.defaultView) && typedElement instanceof typedElement.ownerDocument.defaultView[(_options_constructorName = options === null || options === void 0 ? void 0 : options.constructorName) !== null && _options_constructorName !== void 0 ? _options_constructorName : 'HTMLElement']);\n}\n"],"names":["isHTMLElement","element","options","_typedElement_ownerDocument","typedElement","_options_constructorName","Boolean","ownerDocument","defaultView","constructorName"],"mappings":"AAAA;;;;;;;;;;;;;CAaC;;;;+BAAmBA;;aAAAA;;AAAT,SAASA,cAAcC,OAAO,EAAEC,OAAO,EAAE;IAChD,IAAIC;IACJ,MAAMC,eAAeH;IACrB,IAAII;IACJ,OAAOC,QAAQ,AAACF,CAAAA,iBAAiB,IAAI,IAAIA,iBAAiB,KAAK,IAAI,KAAK,IAAI,AAACD,CAAAA,8BAA8BC,aAAaG,aAAa,AAAD,MAAO,IAAI,IAAIJ,gCAAgC,KAAK,IAAI,KAAK,IAAIA,4BAA4BK,WAAW,AAAD,KAAMJ,wBAAwBA,aAAaG,aAAa,CAACC,WAAW,CAAC,AAACH,CAAAA,2BAA2BH,YAAY,IAAI,IAAIA,YAAY,KAAK,IAAI,KAAK,IAAIA,QAAQO,eAAe,AAAD,MAAO,IAAI,IAAIJ,6BAA6B,KAAK,IAAIA,2BAA2B,aAAa,CAAC;AACtf"}
1
+ {"version":3,"sources":["isHTMLElement.js"],"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 */ export function isHTMLElement(element, options) {\n var _typedElement_ownerDocument, _typedElement, _options;\n const typedElement = element;\n var _options_constructorName;\n return Boolean(((_typedElement = typedElement) === null || _typedElement === void 0 ? void 0 : (_typedElement_ownerDocument = _typedElement.ownerDocument) === null || _typedElement_ownerDocument === void 0 ? void 0 : _typedElement_ownerDocument.defaultView) && typedElement instanceof typedElement.ownerDocument.defaultView[(_options_constructorName = (_options = options) === null || _options === void 0 ? void 0 : _options.constructorName) !== null && _options_constructorName !== void 0 ? _options_constructorName : 'HTMLElement']);\n}\n"],"names":["isHTMLElement","element","options","_typedElement_ownerDocument","_typedElement","_options","typedElement","_options_constructorName","Boolean","ownerDocument","defaultView","constructorName"],"mappings":"AAAA;;;;;;;;;;;;;CAaC;;;;+BAAmBA;;;eAAAA;;;AAAT,SAASA,cAAcC,OAAO,EAAEC,OAAO;IAC9C,IAAIC,6BAA6BC,eAAeC;IAChD,MAAMC,eAAeL;IACrB,IAAIM;IACJ,OAAOC,QAAQ,AAAC,CAAA,AAACJ,CAAAA,gBAAgBE,YAAW,MAAO,QAAQF,kBAAkB,KAAK,IAAI,KAAK,IAAI,AAACD,CAAAA,8BAA8BC,cAAcK,aAAa,AAAD,MAAO,QAAQN,gCAAgC,KAAK,IAAI,KAAK,IAAIA,4BAA4BO,WAAW,AAAD,KAAMJ,wBAAwBA,aAAaG,aAAa,CAACC,WAAW,CAAC,AAACH,CAAAA,2BAA2B,AAACF,CAAAA,WAAWH,OAAM,MAAO,QAAQG,aAAa,KAAK,IAAI,KAAK,IAAIA,SAASM,eAAe,AAAD,MAAO,QAAQJ,6BAA6B,KAAK,IAAIA,2BAA2B,cAAc;AACzhB"}
@@ -4,14 +4,16 @@ Object.defineProperty(exports, "__esModule", {
4
4
  });
5
5
  Object.defineProperty(exports, "isInteractiveHTMLElement", {
6
6
  enumerable: true,
7
- get: ()=>isInteractiveHTMLElement
7
+ get: function() {
8
+ return isInteractiveHTMLElement;
9
+ }
8
10
  });
9
11
  const _isHTMLElement = require("./isHTMLElement");
10
12
  function isInteractiveHTMLElement(element) {
11
13
  if (!(0, _isHTMLElement.isHTMLElement)(element)) {
12
14
  return false;
13
15
  }
14
- const { tagName } = element;
16
+ const { tagName } = element;
15
17
  switch(tagName){
16
18
  case 'BUTTON':
17
19
  case 'A':
@@ -1 +1 @@
1
- {"version":3,"sources":["isInteractiveHTMLElement.js"],"sourcesContent":["import { isHTMLElement } from './isHTMLElement';\n/**\n * @internal\n * Checks that the element has default behaviour from user input on click or 'Enter'/'Space' keys\n */ export function isInteractiveHTMLElement(element) {\n if (!isHTMLElement(element)) {\n return false;\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 return element.isContentEditable;\n}\n"],"names":["isInteractiveHTMLElement","element","isHTMLElement","tagName","isContentEditable"],"mappings":";;;;+BAIoBA;;aAAAA;;+BAJU;AAInB,SAASA,yBAAyBC,OAAO,EAAE;IAClD,IAAI,CAACC,IAAAA,4BAAa,EAACD,UAAU;QACzB,OAAO,KAAK;IAChB,CAAC;IACD,MAAM,EAAEE,QAAO,EAAG,GAAGF;IACrB,OAAOE;QACH,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;YACD,OAAO,IAAI;IACnB;IACA,OAAOF,QAAQG,iBAAiB;AACpC"}
1
+ {"version":3,"sources":["isInteractiveHTMLElement.js"],"sourcesContent":["import { isHTMLElement } from './isHTMLElement';\n/**\n * @internal\n * Checks that the element has default behaviour from user input on click or 'Enter'/'Space' keys\n */ export function isInteractiveHTMLElement(element) {\n if (!isHTMLElement(element)) {\n return false;\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 return element.isContentEditable;\n}\n"],"names":["isInteractiveHTMLElement","element","isHTMLElement","tagName","isContentEditable"],"mappings":";;;;+BAIoBA;;;eAAAA;;;+BAJU;AAInB,SAASA,yBAAyBC,OAAO;IAChD,IAAI,CAACC,IAAAA,4BAAa,EAACD,UAAU;QACzB,OAAO;IACX;IACA,MAAM,EAAEE,OAAO,EAAE,GAAGF;IACpB,OAAOE;QACH,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;YACD,OAAO;IACf;IACA,OAAOF,QAAQG,iBAAiB;AACpC"}
@@ -26,11 +26,14 @@ Object.defineProperty(exports, "__esModule", {
26
26
  });
27
27
  Object.defineProperty(exports, "mergeCallbacks", {
28
28
  enumerable: true,
29
- get: ()=>mergeCallbacks
29
+ get: function() {
30
+ return mergeCallbacks;
31
+ }
30
32
  });
31
33
  function mergeCallbacks(callback1, callback2) {
32
34
  return (...args)=>{
33
- callback1 === null || callback1 === void 0 ? void 0 : callback1(...args);
34
- callback2 === null || callback2 === void 0 ? void 0 : callback2(...args);
35
+ var _callback1, _callback2;
36
+ (_callback1 = callback1) === null || _callback1 === void 0 ? void 0 : _callback1(...args);
37
+ (_callback2 = callback2) === null || _callback2 === void 0 ? void 0 : _callback2(...args);
35
38
  };
36
39
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["mergeCallbacks.js"],"sourcesContent":["/**\n * @internal\n * Combine two event callbacks into a single callback function that calls each one in order.\n *\n * Usage example:\n * ```ts\n * state.slot.onChange = mergeCallbacks(state.slot.onChange, ev => {\n * // Handle onChange\n * });\n * ```\n *\n * The primary use is to avoid the need to capture an existing callback (`state.slot.onChange` in the example) to a\n * local variable before replacing with a new listener that calls the existing one. This helps avoid bugs like:\n * * Infinite recursion by calling the re-assigned state.slot.onChange if it's not captured to a local variable.\n * * Missing a call to the original onChange due to an early return or other conditional.\n *\n * If you need a callback that is stable between renders, wrap the result in {@link useEventCallback}.\n *\n * @param callback1 - The first callback to be called, or undefined\n * @param callback2 - The second callback to be called, or undefined\n *\n * @returns A function that that calls the provided functions in order\n */ export function mergeCallbacks(callback1, callback2) {\n return (...args)=>{\n callback1 === null || callback1 === void 0 ? void 0 : callback1(...args);\n callback2 === null || callback2 === void 0 ? void 0 : callback2(...args);\n };\n}\n"],"names":["mergeCallbacks","callback1","callback2","args"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;CAsBC;;;;+BAAmBA;;aAAAA;;AAAT,SAASA,eAAeC,SAAS,EAAEC,SAAS,EAAE;IACrD,OAAO,CAAC,GAAGC,OAAO;QACdF,cAAc,IAAI,IAAIA,cAAc,KAAK,IAAI,KAAK,IAAIA,aAAaE,KAAK;QACxED,cAAc,IAAI,IAAIA,cAAc,KAAK,IAAI,KAAK,IAAIA,aAAaC,KAAK;IAC5E;AACJ"}
1
+ {"version":3,"sources":["mergeCallbacks.js"],"sourcesContent":["/**\n * @internal\n * Combine two event callbacks into a single callback function that calls each one in order.\n *\n * Usage example:\n * ```ts\n * state.slot.onChange = mergeCallbacks(state.slot.onChange, ev => {\n * // Handle onChange\n * });\n * ```\n *\n * The primary use is to avoid the need to capture an existing callback (`state.slot.onChange` in the example) to a\n * local variable before replacing with a new listener that calls the existing one. This helps avoid bugs like:\n * * Infinite recursion by calling the re-assigned state.slot.onChange if it's not captured to a local variable.\n * * Missing a call to the original onChange due to an early return or other conditional.\n *\n * If you need a callback that is stable between renders, wrap the result in {@link useEventCallback}.\n *\n * @param callback1 - The first callback to be called, or undefined\n * @param callback2 - The second callback to be called, or undefined\n *\n * @returns A function that that calls the provided functions in order\n */ export function mergeCallbacks(callback1, callback2) {\n return (...args)=>{\n var _callback1, _callback2;\n (_callback1 = callback1) === null || _callback1 === void 0 ? void 0 : _callback1(...args);\n (_callback2 = callback2) === null || _callback2 === void 0 ? void 0 : _callback2(...args);\n };\n}\n"],"names":["mergeCallbacks","callback1","callback2","args","_callback1","_callback2"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;CAsBC;;;;+BAAmBA;;;eAAAA;;;AAAT,SAASA,eAAeC,SAAS,EAAEC,SAAS;IACnD,OAAO,CAAC,GAAGC;QACP,IAAIC,YAAYC;QACfD,CAAAA,aAAaH,SAAQ,MAAO,QAAQG,eAAe,KAAK,IAAI,KAAK,IAAIA,cAAcD;QACnFE,CAAAA,aAAaH,SAAQ,MAAO,QAAQG,eAAe,KAAK,IAAI,KAAK,IAAIA,cAAcF;IACxF;AACJ"}
@@ -17,7 +17,9 @@ Object.defineProperty(exports, "__esModule", {
17
17
  });
18
18
  Object.defineProperty(exports, "omit", {
19
19
  enumerable: true,
20
- get: ()=>omit
20
+ get: function() {
21
+ return omit;
22
+ }
21
23
  });
22
24
  function omit(obj, exclusions) {
23
25
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1 +1 @@
1
- {"version":3,"sources":["omit.js"],"sourcesContent":["/**\n * Tiny helper to do the minimal amount of work in duplicating an object but omitting some\n * props. This ends up faster than using object ...rest or reduce to filter.\n *\n * This behaves very much like filteredAssign, but does not merge many objects together,\n * uses an exclusion object map, and avoids spreads all for optimal performance.\n *\n * See perf test for background:\n * https://jsperf.com/omit-vs-rest-vs-reduce/1\n *\n * @param obj - The object to clone\n * @param exclusions - The array of keys to exclude\n */ // eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function omit(obj, exclusions) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result = {};\n for(const key in obj){\n if (exclusions.indexOf(key) === -1 && obj.hasOwnProperty(key)) {\n result[key] = obj[key];\n }\n }\n return result;\n}\n"],"names":["omit","obj","exclusions","result","key","indexOf","hasOwnProperty"],"mappings":"AAAA;;;;;;;;;;;;CAYC,GAAG,8DAA8D;;;;;+BAClDA;;aAAAA;;AAAT,SAASA,KAAKC,GAAG,EAAEC,UAAU,EAAE;IAClC,8DAA8D;IAC9D,MAAMC,SAAS,CAAC;IAChB,IAAI,MAAMC,OAAOH,IAAI;QACjB,IAAIC,WAAWG,OAAO,CAACD,SAAS,CAAC,KAAKH,IAAIK,cAAc,CAACF,MAAM;YAC3DD,MAAM,CAACC,IAAI,GAAGH,GAAG,CAACG,IAAI;QAC1B,CAAC;IACL;IACA,OAAOD;AACX"}
1
+ {"version":3,"sources":["omit.js"],"sourcesContent":["/**\n * Tiny helper to do the minimal amount of work in duplicating an object but omitting some\n * props. This ends up faster than using object ...rest or reduce to filter.\n *\n * This behaves very much like filteredAssign, but does not merge many objects together,\n * uses an exclusion object map, and avoids spreads all for optimal performance.\n *\n * See perf test for background:\n * https://jsperf.com/omit-vs-rest-vs-reduce/1\n *\n * @param obj - The object to clone\n * @param exclusions - The array of keys to exclude\n */ // eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function omit(obj, exclusions) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result = {};\n for(const key in obj){\n if (exclusions.indexOf(key) === -1 && obj.hasOwnProperty(key)) {\n result[key] = obj[key];\n }\n }\n return result;\n}\n"],"names":["omit","obj","exclusions","result","key","indexOf","hasOwnProperty"],"mappings":"AAAA;;;;;;;;;;;;CAYC,GAAG,8DAA8D;;;;;+BAClDA;;;eAAAA;;;AAAT,SAASA,KAAKC,GAAG,EAAEC,UAAU;IAChC,8DAA8D;IAC9D,MAAMC,SAAS,CAAC;IAChB,IAAI,MAAMC,OAAOH,IAAI;QACjB,IAAIC,WAAWG,OAAO,CAACD,SAAS,CAAC,KAAKH,IAAIK,cAAc,CAACF,MAAM;YAC3DD,MAAM,CAACC,IAAI,GAAGH,GAAG,CAACG,IAAI;QAC1B;IACJ;IACA,OAAOD;AACX"}
@@ -10,7 +10,9 @@ Object.defineProperty(exports, "__esModule", {
10
10
  });
11
11
  Object.defineProperty(exports, "createPriorityQueue", {
12
12
  enumerable: true,
13
- get: ()=>createPriorityQueue
13
+ get: function() {
14
+ return createPriorityQueue;
15
+ }
14
16
  });
15
17
  function createPriorityQueue(compare) {
16
18
  const arr = [];
@@ -1 +1 @@
1
- {"version":3,"sources":["priorityQueue.js"],"sourcesContent":["/**\n * @internal\n */ /**\n * @internal\n * @param compare - comparison function for items\n * @returns Priority queue implemented with a min heap\n */ export function createPriorityQueue(compare) {\n const arr = [];\n let size = 0;\n const swap = (a, b)=>{\n const tmp = arr[a];\n arr[a] = arr[b];\n arr[b] = tmp;\n };\n const heapify = (i)=>{\n let smallest = i;\n const l = left(i);\n const r = right(i);\n if (l < size && compare(arr[l], arr[smallest]) < 0) {\n smallest = l;\n }\n if (r < size && compare(arr[r], arr[smallest]) < 0) {\n smallest = r;\n }\n if (smallest !== i) {\n swap(smallest, i);\n heapify(smallest);\n }\n };\n const dequeue = ()=>{\n if (size === 0) {\n throw new Error('Priority queue empty');\n }\n const res = arr[0];\n arr[0] = arr[--size];\n heapify(0);\n return res;\n };\n const peek = ()=>{\n if (size === 0) {\n return null;\n }\n return arr[0];\n };\n const enqueue = (item)=>{\n arr[size++] = item;\n let i = size - 1;\n let p = parent(i);\n while(i > 0 && compare(arr[p], arr[i]) > 0){\n swap(p, i);\n i = p;\n p = parent(i);\n }\n };\n const contains = (item)=>{\n const index = arr.indexOf(item);\n return index >= 0 && index < size;\n };\n const remove = (item)=>{\n const i = arr.indexOf(item);\n if (i === -1 || i >= size) {\n return;\n }\n arr[i] = arr[--size];\n heapify(i);\n };\n const clear = ()=>{\n size = 0;\n };\n const all = ()=>{\n return arr.slice(0, size);\n };\n return {\n all,\n clear,\n contains,\n dequeue,\n enqueue,\n peek,\n remove,\n size: ()=>size\n };\n}\nconst left = (i)=>{\n return 2 * i + 1;\n};\nconst right = (i)=>{\n return 2 * i + 2;\n};\nconst parent = (i)=>{\n return Math.floor((i - 1) / 2);\n};\n"],"names":["createPriorityQueue","compare","arr","size","swap","a","b","tmp","heapify","i","smallest","l","left","r","right","dequeue","Error","res","peek","enqueue","item","p","parent","contains","index","indexOf","remove","clear","all","slice","Math","floor"],"mappings":"AAAA;;CAEC,GAAG;;;;CAIH;;;;+BAAmBA;;aAAAA;;AAAT,SAASA,oBAAoBC,OAAO,EAAE;IAC7C,MAAMC,MAAM,EAAE;IACd,IAAIC,OAAO;IACX,MAAMC,OAAO,CAACC,GAAGC,IAAI;QACjB,MAAMC,MAAML,GAAG,CAACG,EAAE;QAClBH,GAAG,CAACG,EAAE,GAAGH,GAAG,CAACI,EAAE;QACfJ,GAAG,CAACI,EAAE,GAAGC;IACb;IACA,MAAMC,UAAU,CAACC,IAAI;QACjB,IAAIC,WAAWD;QACf,MAAME,IAAIC,KAAKH;QACf,MAAMI,IAAIC,MAAML;QAChB,IAAIE,IAAIR,QAAQF,QAAQC,GAAG,CAACS,EAAE,EAAET,GAAG,CAACQ,SAAS,IAAI,GAAG;YAChDA,WAAWC;QACf,CAAC;QACD,IAAIE,IAAIV,QAAQF,QAAQC,GAAG,CAACW,EAAE,EAAEX,GAAG,CAACQ,SAAS,IAAI,GAAG;YAChDA,WAAWG;QACf,CAAC;QACD,IAAIH,aAAaD,GAAG;YAChBL,KAAKM,UAAUD;YACfD,QAAQE;QACZ,CAAC;IACL;IACA,MAAMK,UAAU,IAAI;QAChB,IAAIZ,SAAS,GAAG;YACZ,MAAM,IAAIa,MAAM,wBAAwB;QAC5C,CAAC;QACD,MAAMC,MAAMf,GAAG,CAAC,EAAE;QAClBA,GAAG,CAAC,EAAE,GAAGA,GAAG,CAAC,EAAEC,KAAK;QACpBK,QAAQ;QACR,OAAOS;IACX;IACA,MAAMC,OAAO,IAAI;QACb,IAAIf,SAAS,GAAG;YACZ,OAAO,IAAI;QACf,CAAC;QACD,OAAOD,GAAG,CAAC,EAAE;IACjB;IACA,MAAMiB,UAAU,CAACC,OAAO;QACpBlB,GAAG,CAACC,OAAO,GAAGiB;QACd,IAAIX,IAAIN,OAAO;QACf,IAAIkB,IAAIC,OAAOb;QACf,MAAMA,IAAI,KAAKR,QAAQC,GAAG,CAACmB,EAAE,EAAEnB,GAAG,CAACO,EAAE,IAAI,EAAE;YACvCL,KAAKiB,GAAGZ;YACRA,IAAIY;YACJA,IAAIC,OAAOb;QACf;IACJ;IACA,MAAMc,WAAW,CAACH,OAAO;QACrB,MAAMI,QAAQtB,IAAIuB,OAAO,CAACL;QAC1B,OAAOI,SAAS,KAAKA,QAAQrB;IACjC;IACA,MAAMuB,SAAS,CAACN,OAAO;QACnB,MAAMX,IAAIP,IAAIuB,OAAO,CAACL;QACtB,IAAIX,MAAM,CAAC,KAAKA,KAAKN,MAAM;YACvB;QACJ,CAAC;QACDD,GAAG,CAACO,EAAE,GAAGP,GAAG,CAAC,EAAEC,KAAK;QACpBK,QAAQC;IACZ;IACA,MAAMkB,QAAQ,IAAI;QACdxB,OAAO;IACX;IACA,MAAMyB,MAAM,IAAI;QACZ,OAAO1B,IAAI2B,KAAK,CAAC,GAAG1B;IACxB;IACA,OAAO;QACHyB;QACAD;QACAJ;QACAR;QACAI;QACAD;QACAQ;QACAvB,MAAM,IAAIA;IACd;AACJ;AACA,MAAMS,OAAO,CAACH,IAAI;IACd,OAAO,IAAIA,IAAI;AACnB;AACA,MAAMK,QAAQ,CAACL,IAAI;IACf,OAAO,IAAIA,IAAI;AACnB;AACA,MAAMa,SAAS,CAACb,IAAI;IAChB,OAAOqB,KAAKC,KAAK,CAAC,AAACtB,CAAAA,IAAI,CAAA,IAAK;AAChC"}
1
+ {"version":3,"sources":["priorityQueue.js"],"sourcesContent":["/**\n * @internal\n */ /**\n * @internal\n * @param compare - comparison function for items\n * @returns Priority queue implemented with a min heap\n */ export function createPriorityQueue(compare) {\n const arr = [];\n let size = 0;\n const swap = (a, b)=>{\n const tmp = arr[a];\n arr[a] = arr[b];\n arr[b] = tmp;\n };\n const heapify = (i)=>{\n let smallest = i;\n const l = left(i);\n const r = right(i);\n if (l < size && compare(arr[l], arr[smallest]) < 0) {\n smallest = l;\n }\n if (r < size && compare(arr[r], arr[smallest]) < 0) {\n smallest = r;\n }\n if (smallest !== i) {\n swap(smallest, i);\n heapify(smallest);\n }\n };\n const dequeue = ()=>{\n if (size === 0) {\n throw new Error('Priority queue empty');\n }\n const res = arr[0];\n arr[0] = arr[--size];\n heapify(0);\n return res;\n };\n const peek = ()=>{\n if (size === 0) {\n return null;\n }\n return arr[0];\n };\n const enqueue = (item)=>{\n arr[size++] = item;\n let i = size - 1;\n let p = parent(i);\n while(i > 0 && compare(arr[p], arr[i]) > 0){\n swap(p, i);\n i = p;\n p = parent(i);\n }\n };\n const contains = (item)=>{\n const index = arr.indexOf(item);\n return index >= 0 && index < size;\n };\n const remove = (item)=>{\n const i = arr.indexOf(item);\n if (i === -1 || i >= size) {\n return;\n }\n arr[i] = arr[--size];\n heapify(i);\n };\n const clear = ()=>{\n size = 0;\n };\n const all = ()=>{\n return arr.slice(0, size);\n };\n return {\n all,\n clear,\n contains,\n dequeue,\n enqueue,\n peek,\n remove,\n size: ()=>size\n };\n}\nconst left = (i)=>{\n return 2 * i + 1;\n};\nconst right = (i)=>{\n return 2 * i + 2;\n};\nconst parent = (i)=>{\n return Math.floor((i - 1) / 2);\n};\n"],"names":["createPriorityQueue","compare","arr","size","swap","a","b","tmp","heapify","i","smallest","l","left","r","right","dequeue","Error","res","peek","enqueue","item","p","parent","contains","index","indexOf","remove","clear","all","slice","Math","floor"],"mappings":"AAAA;;CAEC,GAAG;;;;CAIH;;;;+BAAmBA;;;eAAAA;;;AAAT,SAASA,oBAAoBC,OAAO;IAC3C,MAAMC,MAAM,EAAE;IACd,IAAIC,OAAO;IACX,MAAMC,OAAO,CAACC,GAAGC;QACb,MAAMC,MAAML,GAAG,CAACG,EAAE;QAClBH,GAAG,CAACG,EAAE,GAAGH,GAAG,CAACI,EAAE;QACfJ,GAAG,CAACI,EAAE,GAAGC;IACb;IACA,MAAMC,UAAU,CAACC;QACb,IAAIC,WAAWD;QACf,MAAME,IAAIC,KAAKH;QACf,MAAMI,IAAIC,MAAML;QAChB,IAAIE,IAAIR,QAAQF,QAAQC,GAAG,CAACS,EAAE,EAAET,GAAG,CAACQ,SAAS,IAAI,GAAG;YAChDA,WAAWC;QACf;QACA,IAAIE,IAAIV,QAAQF,QAAQC,GAAG,CAACW,EAAE,EAAEX,GAAG,CAACQ,SAAS,IAAI,GAAG;YAChDA,WAAWG;QACf;QACA,IAAIH,aAAaD,GAAG;YAChBL,KAAKM,UAAUD;YACfD,QAAQE;QACZ;IACJ;IACA,MAAMK,UAAU;QACZ,IAAIZ,SAAS,GAAG;YACZ,MAAM,IAAIa,MAAM;QACpB;QACA,MAAMC,MAAMf,GAAG,CAAC,EAAE;QAClBA,GAAG,CAAC,EAAE,GAAGA,GAAG,CAAC,EAAEC,KAAK;QACpBK,QAAQ;QACR,OAAOS;IACX;IACA,MAAMC,OAAO;QACT,IAAIf,SAAS,GAAG;YACZ,OAAO;QACX;QACA,OAAOD,GAAG,CAAC,EAAE;IACjB;IACA,MAAMiB,UAAU,CAACC;QACblB,GAAG,CAACC,OAAO,GAAGiB;QACd,IAAIX,IAAIN,OAAO;QACf,IAAIkB,IAAIC,OAAOb;QACf,MAAMA,IAAI,KAAKR,QAAQC,GAAG,CAACmB,EAAE,EAAEnB,GAAG,CAACO,EAAE,IAAI,EAAE;YACvCL,KAAKiB,GAAGZ;YACRA,IAAIY;YACJA,IAAIC,OAAOb;QACf;IACJ;IACA,MAAMc,WAAW,CAACH;QACd,MAAMI,QAAQtB,IAAIuB,OAAO,CAACL;QAC1B,OAAOI,SAAS,KAAKA,QAAQrB;IACjC;IACA,MAAMuB,SAAS,CAACN;QACZ,MAAMX,IAAIP,IAAIuB,OAAO,CAACL;QACtB,IAAIX,MAAM,CAAC,KAAKA,KAAKN,MAAM;YACvB;QACJ;QACAD,GAAG,CAACO,EAAE,GAAGP,GAAG,CAAC,EAAEC,KAAK;QACpBK,QAAQC;IACZ;IACA,MAAMkB,QAAQ;QACVxB,OAAO;IACX;IACA,MAAMyB,MAAM;QACR,OAAO1B,IAAI2B,KAAK,CAAC,GAAG1B;IACxB;IACA,OAAO;QACHyB;QACAD;QACAJ;QACAR;QACAI;QACAD;QACAQ;QACAvB,MAAM,IAAIA;IACd;AACJ;AACA,MAAMS,OAAO,CAACH;IACV,OAAO,IAAIA,IAAI;AACnB;AACA,MAAMK,QAAQ,CAACL;IACX,OAAO,IAAIA,IAAI;AACnB;AACA,MAAMa,SAAS,CAACb;IACZ,OAAOqB,KAAKC,KAAK,CAAC,AAACtB,CAAAA,IAAI,CAAA,IAAK;AAChC"}