@fluentui/react-utilities 9.21.1 → 9.23.0

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 (129) 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 +1 -1
  28. package/lib/hooks/useOnClickOutside.js.map +1 -1
  29. package/lib/hooks/useOnScrollOutside.js.map +1 -1
  30. package/lib/hooks/usePrevious.js.map +1 -1
  31. package/lib/hooks/useScrollbarWidth.js.map +1 -1
  32. package/lib/hooks/useTimeout.js.map +1 -1
  33. package/lib/index.js.map +1 -1
  34. package/lib/selection/index.js.map +1 -1
  35. package/lib/selection/types.js.map +1 -1
  36. package/lib/selection/useSelection.js.map +1 -1
  37. package/lib/ssr/SSRContext.js.map +1 -1
  38. package/lib/ssr/canUseDOM.js.map +1 -1
  39. package/lib/ssr/index.js.map +1 -1
  40. package/lib/trigger/applyTriggerPropsToChildren.js.map +1 -1
  41. package/lib/trigger/getTriggerChild.js.map +1 -1
  42. package/lib/trigger/index.js.map +1 -1
  43. package/lib/trigger/isFluentTrigger.js.map +1 -1
  44. package/lib/trigger/types.js.map +1 -1
  45. package/lib/utils/clamp.js.map +1 -1
  46. package/lib/utils/createSetFromIterable.js.map +1 -1
  47. package/lib/utils/generated-types.js +11 -0
  48. package/lib/utils/generated-types.js.map +1 -0
  49. package/lib/utils/getNativeElementProps.js.map +1 -1
  50. package/lib/utils/getRTLSafeKey.js.map +1 -1
  51. package/lib/utils/getReactCallbackName.js.map +1 -1
  52. package/lib/utils/index.js.map +1 -1
  53. package/lib/utils/isHTMLElement.js.map +1 -1
  54. package/lib/utils/isInteractiveHTMLElement.js.map +1 -1
  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.map +1 -1
  59. package/lib/utils/types.js.map +1 -1
  60. package/lib/virtualParent/elementContains.js.map +1 -1
  61. package/lib/virtualParent/getParent.js.map +1 -1
  62. package/lib/virtualParent/index.js.map +1 -1
  63. package/lib/virtualParent/isVirtualElement.js.map +1 -1
  64. package/lib/virtualParent/setVirtualParent.js.map +1 -1
  65. package/lib/virtualParent/types.js.map +1 -1
  66. package/lib-commonjs/compose/assertSlots.js.map +1 -1
  67. package/lib-commonjs/compose/constants.js.map +1 -1
  68. package/lib-commonjs/compose/deprecated/getSlots.js.map +1 -1
  69. package/lib-commonjs/compose/deprecated/getSlotsNext.js.map +1 -1
  70. package/lib-commonjs/compose/deprecated/resolveShorthand.js.map +1 -1
  71. package/lib-commonjs/compose/getIntrinsicElementProps.js.map +1 -1
  72. package/lib-commonjs/compose/getSlotClassNameProp.js.map +1 -1
  73. package/lib-commonjs/compose/index.js.map +1 -1
  74. package/lib-commonjs/compose/isResolvedShorthand.js.map +1 -1
  75. package/lib-commonjs/compose/isSlot.js.map +1 -1
  76. package/lib-commonjs/compose/slot.js.map +1 -1
  77. package/lib-commonjs/compose/types.js.map +1 -1
  78. package/lib-commonjs/events/index.js.map +1 -1
  79. package/lib-commonjs/events/mouseTouchHelpers.js.map +1 -1
  80. package/lib-commonjs/hooks/index.js.map +1 -1
  81. package/lib-commonjs/hooks/useAnimationFrame.js.map +1 -1
  82. package/lib-commonjs/hooks/useBrowserTimer.js.map +1 -1
  83. package/lib-commonjs/hooks/useControllableState.js.map +1 -1
  84. package/lib-commonjs/hooks/useEventCallback.js.map +1 -1
  85. package/lib-commonjs/hooks/useFirstMount.js.map +1 -1
  86. package/lib-commonjs/hooks/useForceUpdate.js.map +1 -1
  87. package/lib-commonjs/hooks/useId.js.map +1 -1
  88. package/lib-commonjs/hooks/useIsomorphicLayoutEffect.js.map +1 -1
  89. package/lib-commonjs/hooks/useMergedRefs.js.map +1 -1
  90. package/lib-commonjs/hooks/useOnClickOutside.js +1 -1
  91. package/lib-commonjs/hooks/useOnClickOutside.js.map +1 -1
  92. package/lib-commonjs/hooks/useOnScrollOutside.js.map +1 -1
  93. package/lib-commonjs/hooks/usePrevious.js.map +1 -1
  94. package/lib-commonjs/hooks/useScrollbarWidth.js.map +1 -1
  95. package/lib-commonjs/hooks/useTimeout.js.map +1 -1
  96. package/lib-commonjs/index.js.map +1 -1
  97. package/lib-commonjs/selection/index.js.map +1 -1
  98. package/lib-commonjs/selection/types.js.map +1 -1
  99. package/lib-commonjs/selection/useSelection.js.map +1 -1
  100. package/lib-commonjs/ssr/SSRContext.js.map +1 -1
  101. package/lib-commonjs/ssr/canUseDOM.js.map +1 -1
  102. package/lib-commonjs/ssr/index.js.map +1 -1
  103. package/lib-commonjs/trigger/applyTriggerPropsToChildren.js.map +1 -1
  104. package/lib-commonjs/trigger/getTriggerChild.js.map +1 -1
  105. package/lib-commonjs/trigger/index.js.map +1 -1
  106. package/lib-commonjs/trigger/isFluentTrigger.js.map +1 -1
  107. package/lib-commonjs/trigger/types.js.map +1 -1
  108. package/lib-commonjs/utils/clamp.js.map +1 -1
  109. package/lib-commonjs/utils/createSetFromIterable.js.map +1 -1
  110. package/lib-commonjs/utils/generated-types.js +12 -0
  111. package/lib-commonjs/utils/generated-types.js.map +1 -0
  112. package/lib-commonjs/utils/getNativeElementProps.js.map +1 -1
  113. package/lib-commonjs/utils/getRTLSafeKey.js.map +1 -1
  114. package/lib-commonjs/utils/getReactCallbackName.js.map +1 -1
  115. package/lib-commonjs/utils/index.js.map +1 -1
  116. package/lib-commonjs/utils/isHTMLElement.js.map +1 -1
  117. package/lib-commonjs/utils/isInteractiveHTMLElement.js.map +1 -1
  118. package/lib-commonjs/utils/mergeCallbacks.js.map +1 -1
  119. package/lib-commonjs/utils/omit.js.map +1 -1
  120. package/lib-commonjs/utils/priorityQueue.js.map +1 -1
  121. package/lib-commonjs/utils/properties.js.map +1 -1
  122. package/lib-commonjs/utils/types.js.map +1 -1
  123. package/lib-commonjs/virtualParent/elementContains.js.map +1 -1
  124. package/lib-commonjs/virtualParent/getParent.js.map +1 -1
  125. package/lib-commonjs/virtualParent/index.js.map +1 -1
  126. package/lib-commonjs/virtualParent/isVirtualElement.js.map +1 -1
  127. package/lib-commonjs/virtualParent/setVirtualParent.js.map +1 -1
  128. package/lib-commonjs/virtualParent/types.js.map +1 -1
  129. package/package.json +1 -1
@@ -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"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/mergeCallbacks.ts"],"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 */\nexport function mergeCallbacks<Args extends unknown[]>(\n callback1: ((...args: Args) => void) | undefined,\n callback2: ((...args: Args) => void) | undefined,\n) {\n return (...args: Args) => {\n callback1?.(...args);\n callback2?.(...args);\n };\n}\n"],"names":["mergeCallbacks","callback1","callback2","args"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;CAsBC;;;;+BACeA;;;eAAAA;;;AAAT,SAASA,eACdC,SAAgD,EAChDC,SAAgD;IAEhD,OAAO,CAAC,GAAGC;QACTF,sBAAAA,gCAAAA,aAAeE;QACfD,sBAAAA,gCAAAA,aAAeC;IACjB;AACF"}
1
+ {"version":3,"sources":["../src/utils/mergeCallbacks.ts"],"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 */\nexport function mergeCallbacks<Args extends unknown[]>(\n callback1: ((...args: Args) => void) | undefined,\n callback2: ((...args: Args) => void) | undefined,\n) {\n return (...args: Args) => {\n callback1?.(...args);\n callback2?.(...args);\n };\n}\n"],"names":["mergeCallbacks","callback1","callback2","args"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;CAsBC;;;;+BACeA;;;eAAAA;;;AAAT,SAASA,eACdC,SAAgD,EAChDC,SAAgD;IAEhD,OAAO,CAAC,GAAGC;QACTF,sBAAAA,gCAAAA,aAAeE;QACfD,sBAAAA,gCAAAA,aAAeC;IACjB;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/omit.ts"],"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 */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function omit<TObj extends Record<string, any>, Exclusions extends (keyof TObj)[]>(\n obj: TObj,\n exclusions: Exclusions,\n): Omit<TObj, Exclusions[number]> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result: Record<string, any> = {};\n\n for (const key in obj) {\n if (exclusions.indexOf(key) === -1 && obj.hasOwnProperty(key)) {\n result[key] = obj[key];\n }\n }\n\n return result as TObj;\n}\n"],"names":["omit","obj","exclusions","result","key","indexOf","hasOwnProperty"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;;;;;;;;;;;CAYC,GACD,8DAA8D;;;;;+BAC9CA;;;eAAAA;;;AAAT,SAASA,KACdC,GAAS,EACTC,UAAsB;IAEtB,8DAA8D;IAC9D,MAAMC,SAA8B,CAAC;IAErC,IAAK,MAAMC,OAAOH,IAAK;QACrB,IAAIC,WAAWG,OAAO,CAACD,SAAS,CAAC,KAAKH,IAAIK,cAAc,CAACF,MAAM;YAC7DD,MAAM,CAACC,IAAI,GAAGH,GAAG,CAACG,IAAI;QACxB;IACF;IAEA,OAAOD;AACT"}
1
+ {"version":3,"sources":["../src/utils/omit.ts"],"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 */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function omit<TObj extends Record<string, any>, Exclusions extends (keyof TObj)[]>(\n obj: TObj,\n exclusions: Exclusions,\n): Omit<TObj, Exclusions[number]> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result: Record<string, any> = {};\n\n for (const key in obj) {\n if (exclusions.indexOf(key) === -1 && obj.hasOwnProperty(key)) {\n result[key] = obj[key];\n }\n }\n\n return result as TObj;\n}\n"],"names":["omit","obj","exclusions","result","key","indexOf","hasOwnProperty"],"mappings":"AAAA;;;;;;;;;;;;CAYC,GACD,8DAA8D;;;;;+BAC9CA;;;eAAAA;;;AAAT,SAASA,KACdC,GAAS,EACTC,UAAsB;IAEtB,8DAA8D;IAC9D,MAAMC,SAA8B,CAAC;IAErC,IAAK,MAAMC,OAAOH,IAAK;QACrB,IAAIC,WAAWG,OAAO,CAACD,SAAS,CAAC,KAAKH,IAAIK,cAAc,CAACF,MAAM;YAC7DD,MAAM,CAACC,IAAI,GAAGH,GAAG,CAACG,IAAI;QACxB;IACF;IAEA,OAAOD;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/priorityQueue.ts"],"sourcesContent":["/**\n * @internal\n */\nexport type PriorityQueueCompareFn<T> = (a: T, b: T) => number;\n\n/**\n * @internal\n */\nexport interface PriorityQueue<T> {\n all: () => T[];\n clear: () => void;\n contains: (item: T) => boolean;\n dequeue: () => T;\n enqueue: (item: T) => void;\n peek: () => T | null;\n remove: (item: T) => void;\n size: () => number;\n}\n\n/**\n * @internal\n * @param compare - comparison function for items\n * @returns Priority queue implemented with a min heap\n */\nexport function createPriorityQueue<T>(compare: PriorityQueueCompareFn<T>): PriorityQueue<T> {\n const arr: T[] = [];\n let size = 0;\n\n const swap = (a: number, b: number) => {\n const tmp = arr[a];\n arr[a] = arr[b];\n arr[b] = tmp;\n };\n\n const heapify = (i: number) => {\n let smallest = i;\n const l = left(i);\n const r = right(i);\n\n if (l < size && compare(arr[l], arr[smallest]) < 0) {\n smallest = l;\n }\n\n if (r < size && compare(arr[r], arr[smallest]) < 0) {\n smallest = r;\n }\n\n if (smallest !== i) {\n swap(smallest, i);\n heapify(smallest);\n }\n };\n\n const dequeue = () => {\n if (size === 0) {\n throw new Error('Priority queue empty');\n }\n\n const res = arr[0];\n arr[0] = arr[--size];\n heapify(0);\n\n return res;\n };\n\n const peek = () => {\n if (size === 0) {\n return null;\n }\n\n return arr[0];\n };\n\n const enqueue = (item: T) => {\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\n const contains = (item: T) => {\n const index = arr.indexOf(item);\n return index >= 0 && index < size;\n };\n\n const remove = (item: T) => {\n const i = arr.indexOf(item);\n\n if (i === -1 || i >= size) {\n return;\n }\n\n arr[i] = arr[--size];\n heapify(i);\n };\n\n const clear = () => {\n size = 0;\n };\n\n const all = () => {\n return arr.slice(0, size);\n };\n\n return {\n all,\n clear,\n contains,\n dequeue,\n enqueue,\n peek,\n remove,\n size: () => size,\n };\n}\n\nconst left = (i: number) => {\n return 2 * i + 1;\n};\n\nconst right = (i: number) => {\n return 2 * i + 2;\n};\n\nconst parent = (i: number) => {\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"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;CAEC;;;;+BAsBeA;;;eAAAA;;;AAAT,SAASA,oBAAuBC,OAAkC;IACvE,MAAMC,MAAW,EAAE;IACnB,IAAIC,OAAO;IAEX,MAAMC,OAAO,CAACC,GAAWC;QACvB,MAAMC,MAAML,GAAG,CAACG,EAAE;QAClBH,GAAG,CAACG,EAAE,GAAGH,GAAG,CAACI,EAAE;QACfJ,GAAG,CAACI,EAAE,GAAGC;IACX;IAEA,MAAMC,UAAU,CAACC;QACf,IAAIC,WAAWD;QACf,MAAME,IAAIC,KAAKH;QACf,MAAMI,IAAIC,MAAML;QAEhB,IAAIE,IAAIR,QAAQF,QAAQC,GAAG,CAACS,EAAE,EAAET,GAAG,CAACQ,SAAS,IAAI,GAAG;YAClDA,WAAWC;QACb;QAEA,IAAIE,IAAIV,QAAQF,QAAQC,GAAG,CAACW,EAAE,EAAEX,GAAG,CAACQ,SAAS,IAAI,GAAG;YAClDA,WAAWG;QACb;QAEA,IAAIH,aAAaD,GAAG;YAClBL,KAAKM,UAAUD;YACfD,QAAQE;QACV;IACF;IAEA,MAAMK,UAAU;QACd,IAAIZ,SAAS,GAAG;YACd,MAAM,IAAIa,MAAM;QAClB;QAEA,MAAMC,MAAMf,GAAG,CAAC,EAAE;QAClBA,GAAG,CAAC,EAAE,GAAGA,GAAG,CAAC,EAAEC,KAAK;QACpBK,QAAQ;QAER,OAAOS;IACT;IAEA,MAAMC,OAAO;QACX,IAAIf,SAAS,GAAG;YACd,OAAO;QACT;QAEA,OAAOD,GAAG,CAAC,EAAE;IACf;IAEA,MAAMiB,UAAU,CAACC;QACflB,GAAG,CAACC,OAAO,GAAGiB;QACd,IAAIX,IAAIN,OAAO;QACf,IAAIkB,IAAIC,OAAOb;QACf,MAAOA,IAAI,KAAKR,QAAQC,GAAG,CAACmB,EAAE,EAAEnB,GAAG,CAACO,EAAE,IAAI,EAAG;YAC3CL,KAAKiB,GAAGZ;YACRA,IAAIY;YACJA,IAAIC,OAAOb;QACb;IACF;IAEA,MAAMc,WAAW,CAACH;QAChB,MAAMI,QAAQtB,IAAIuB,OAAO,CAACL;QAC1B,OAAOI,SAAS,KAAKA,QAAQrB;IAC/B;IAEA,MAAMuB,SAAS,CAACN;QACd,MAAMX,IAAIP,IAAIuB,OAAO,CAACL;QAEtB,IAAIX,MAAM,CAAC,KAAKA,KAAKN,MAAM;YACzB;QACF;QAEAD,GAAG,CAACO,EAAE,GAAGP,GAAG,CAAC,EAAEC,KAAK;QACpBK,QAAQC;IACV;IAEA,MAAMkB,QAAQ;QACZxB,OAAO;IACT;IAEA,MAAMyB,MAAM;QACV,OAAO1B,IAAI2B,KAAK,CAAC,GAAG1B;IACtB;IAEA,OAAO;QACLyB;QACAD;QACAJ;QACAR;QACAI;QACAD;QACAQ;QACAvB,MAAM,IAAMA;IACd;AACF;AAEA,MAAMS,OAAO,CAACH;IACZ,OAAO,IAAIA,IAAI;AACjB;AAEA,MAAMK,QAAQ,CAACL;IACb,OAAO,IAAIA,IAAI;AACjB;AAEA,MAAMa,SAAS,CAACb;IACd,OAAOqB,KAAKC,KAAK,CAAC,AAACtB,CAAAA,IAAI,CAAA,IAAK;AAC9B"}
1
+ {"version":3,"sources":["../src/utils/priorityQueue.ts"],"sourcesContent":["/**\n * @internal\n */\nexport type PriorityQueueCompareFn<T> = (a: T, b: T) => number;\n\n/**\n * @internal\n */\nexport interface PriorityQueue<T> {\n all: () => T[];\n clear: () => void;\n contains: (item: T) => boolean;\n dequeue: () => T;\n enqueue: (item: T) => void;\n peek: () => T | null;\n remove: (item: T) => void;\n size: () => number;\n}\n\n/**\n * @internal\n * @param compare - comparison function for items\n * @returns Priority queue implemented with a min heap\n */\nexport function createPriorityQueue<T>(compare: PriorityQueueCompareFn<T>): PriorityQueue<T> {\n const arr: T[] = [];\n let size = 0;\n\n const swap = (a: number, b: number) => {\n const tmp = arr[a];\n arr[a] = arr[b];\n arr[b] = tmp;\n };\n\n const heapify = (i: number) => {\n let smallest = i;\n const l = left(i);\n const r = right(i);\n\n if (l < size && compare(arr[l], arr[smallest]) < 0) {\n smallest = l;\n }\n\n if (r < size && compare(arr[r], arr[smallest]) < 0) {\n smallest = r;\n }\n\n if (smallest !== i) {\n swap(smallest, i);\n heapify(smallest);\n }\n };\n\n const dequeue = () => {\n if (size === 0) {\n throw new Error('Priority queue empty');\n }\n\n const res = arr[0];\n arr[0] = arr[--size];\n heapify(0);\n\n return res;\n };\n\n const peek = () => {\n if (size === 0) {\n return null;\n }\n\n return arr[0];\n };\n\n const enqueue = (item: T) => {\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\n const contains = (item: T) => {\n const index = arr.indexOf(item);\n return index >= 0 && index < size;\n };\n\n const remove = (item: T) => {\n const i = arr.indexOf(item);\n\n if (i === -1 || i >= size) {\n return;\n }\n\n arr[i] = arr[--size];\n heapify(i);\n };\n\n const clear = () => {\n size = 0;\n };\n\n const all = () => {\n return arr.slice(0, size);\n };\n\n return {\n all,\n clear,\n contains,\n dequeue,\n enqueue,\n peek,\n remove,\n size: () => size,\n };\n}\n\nconst left = (i: number) => {\n return 2 * i + 1;\n};\n\nconst right = (i: number) => {\n return 2 * i + 2;\n};\n\nconst parent = (i: number) => {\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;;;;+BAsBeA;;;eAAAA;;;AAAT,SAASA,oBAAuBC,OAAkC;IACvE,MAAMC,MAAW,EAAE;IACnB,IAAIC,OAAO;IAEX,MAAMC,OAAO,CAACC,GAAWC;QACvB,MAAMC,MAAML,GAAG,CAACG,EAAE;QAClBH,GAAG,CAACG,EAAE,GAAGH,GAAG,CAACI,EAAE;QACfJ,GAAG,CAACI,EAAE,GAAGC;IACX;IAEA,MAAMC,UAAU,CAACC;QACf,IAAIC,WAAWD;QACf,MAAME,IAAIC,KAAKH;QACf,MAAMI,IAAIC,MAAML;QAEhB,IAAIE,IAAIR,QAAQF,QAAQC,GAAG,CAACS,EAAE,EAAET,GAAG,CAACQ,SAAS,IAAI,GAAG;YAClDA,WAAWC;QACb;QAEA,IAAIE,IAAIV,QAAQF,QAAQC,GAAG,CAACW,EAAE,EAAEX,GAAG,CAACQ,SAAS,IAAI,GAAG;YAClDA,WAAWG;QACb;QAEA,IAAIH,aAAaD,GAAG;YAClBL,KAAKM,UAAUD;YACfD,QAAQE;QACV;IACF;IAEA,MAAMK,UAAU;QACd,IAAIZ,SAAS,GAAG;YACd,MAAM,IAAIa,MAAM;QAClB;QAEA,MAAMC,MAAMf,GAAG,CAAC,EAAE;QAClBA,GAAG,CAAC,EAAE,GAAGA,GAAG,CAAC,EAAEC,KAAK;QACpBK,QAAQ;QAER,OAAOS;IACT;IAEA,MAAMC,OAAO;QACX,IAAIf,SAAS,GAAG;YACd,OAAO;QACT;QAEA,OAAOD,GAAG,CAAC,EAAE;IACf;IAEA,MAAMiB,UAAU,CAACC;QACflB,GAAG,CAACC,OAAO,GAAGiB;QACd,IAAIX,IAAIN,OAAO;QACf,IAAIkB,IAAIC,OAAOb;QACf,MAAOA,IAAI,KAAKR,QAAQC,GAAG,CAACmB,EAAE,EAAEnB,GAAG,CAACO,EAAE,IAAI,EAAG;YAC3CL,KAAKiB,GAAGZ;YACRA,IAAIY;YACJA,IAAIC,OAAOb;QACb;IACF;IAEA,MAAMc,WAAW,CAACH;QAChB,MAAMI,QAAQtB,IAAIuB,OAAO,CAACL;QAC1B,OAAOI,SAAS,KAAKA,QAAQrB;IAC/B;IAEA,MAAMuB,SAAS,CAACN;QACd,MAAMX,IAAIP,IAAIuB,OAAO,CAACL;QAEtB,IAAIX,MAAM,CAAC,KAAKA,KAAKN,MAAM;YACzB;QACF;QAEAD,GAAG,CAACO,EAAE,GAAGP,GAAG,CAAC,EAAEC,KAAK;QACpBK,QAAQC;IACV;IAEA,MAAMkB,QAAQ;QACZxB,OAAO;IACT;IAEA,MAAMyB,MAAM;QACV,OAAO1B,IAAI2B,KAAK,CAAC,GAAG1B;IACtB;IAEA,OAAO;QACLyB;QACAD;QACAJ;QACAR;QACAI;QACAD;QACAQ;QACAvB,MAAM,IAAMA;IACd;AACF;AAEA,MAAMS,OAAO,CAACH;IACZ,OAAO,IAAIA,IAAI;AACjB;AAEA,MAAMK,QAAQ,CAACL;IACb,OAAO,IAAIA,IAAI;AACjB;AAEA,MAAMa,SAAS,CAACb;IACd,OAAOqB,KAAKC,KAAK,CAAC,AAACtB,CAAAA,IAAI,CAAA,IAAK;AAC9B"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/properties.ts"],"sourcesContent":["const toObjectMap = (...items: (string[] | Record<string, number>)[]) => {\n const result: Record<string, number> = {};\n\n for (const item of items) {\n const keys = Array.isArray(item) ? item : Object.keys(item);\n\n for (const key of keys) {\n result[key] = 1;\n }\n }\n\n return result;\n};\n\n/**\n * An array of events that are allowed on every html element type.\n *\n * @public\n */\nexport const baseElementEvents = toObjectMap([\n 'onAuxClick',\n 'onAnimationEnd',\n 'onAnimationStart',\n 'onCopy',\n 'onCut',\n 'onPaste',\n 'onCompositionEnd',\n 'onCompositionStart',\n 'onCompositionUpdate',\n 'onFocus',\n 'onFocusCapture',\n 'onBlur',\n 'onBlurCapture',\n 'onChange',\n 'onInput',\n 'onSubmit',\n 'onLoad',\n 'onError',\n 'onKeyDown',\n 'onKeyDownCapture',\n 'onKeyPress',\n 'onKeyUp',\n 'onAbort',\n 'onCanPlay',\n 'onCanPlayThrough',\n 'onDurationChange',\n 'onEmptied',\n 'onEncrypted',\n 'onEnded',\n 'onLoadedData',\n 'onLoadedMetadata',\n 'onLoadStart',\n 'onPause',\n 'onPlay',\n 'onPlaying',\n 'onProgress',\n 'onRateChange',\n 'onSeeked',\n 'onSeeking',\n 'onStalled',\n 'onSuspend',\n 'onTimeUpdate',\n 'onVolumeChange',\n 'onWaiting',\n 'onClick',\n 'onClickCapture',\n 'onContextMenu',\n 'onDoubleClick',\n 'onDrag',\n 'onDragEnd',\n 'onDragEnter',\n 'onDragExit',\n 'onDragLeave',\n 'onDragOver',\n 'onDragStart',\n 'onDrop',\n 'onMouseDown',\n 'onMouseDownCapture',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOut',\n 'onMouseOver',\n 'onMouseUp',\n 'onMouseUpCapture',\n 'onSelect',\n 'onTouchCancel',\n 'onTouchEnd',\n 'onTouchMove',\n 'onTouchStart',\n 'onScroll',\n 'onWheel',\n 'onPointerCancel',\n 'onPointerDown',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onPointerMove',\n 'onPointerOut',\n 'onPointerOver',\n 'onPointerUp',\n 'onGotPointerCapture',\n 'onLostPointerCapture',\n]);\n\n/**\n * An array of element attributes which are allowed on every html element type.\n *\n * @public\n */\nexport const baseElementProperties = toObjectMap([\n 'accessKey', // global\n 'children', // global\n 'className', // global\n 'contentEditable', // global\n 'dir', // global\n 'draggable', // global\n 'hidden', // global\n 'htmlFor', // global\n 'id', // global\n 'lang', // global\n 'ref', // global\n 'role', // global\n 'style', // global\n 'tabIndex', // global\n 'title', // global\n 'translate', // global\n 'spellCheck', // global\n 'name', // global\n]);\n\n/**\n * An array of microdata attributes that are allowed on every html element type.\n *\n * @public\n */\nexport const microdataProperties = toObjectMap([\n 'itemID', // global\n 'itemProp', // global\n 'itemRef', // global\n 'itemScope', // global\n 'itemType', // global\n]);\n\n/**\n * An array of HTML element properties and events.\n *\n * @public\n */\nexport const htmlElementProperties = toObjectMap(baseElementProperties, baseElementEvents, microdataProperties);\n\n/**\n * An array of LABEL tag properties and events.\n *\n * @public\n */\nexport const labelProperties = toObjectMap(htmlElementProperties, [\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n]);\n\n/**\n * An array of AUDIO tag properties and events.\n\n * @public\n */\nexport const audioProperties = toObjectMap(htmlElementProperties, [\n 'height', // canvas, embed, iframe, img, input, object, video\n 'loop', // audio, video\n 'muted', // audio, video\n 'preload', // audio, video\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'width', // canvas, embed, iframe, img, input, object, video\n]);\n\n/**\n * An array of VIDEO tag properties and events.\n *\n * @public\n */\nexport const videoProperties = toObjectMap(audioProperties, [\n 'poster', // video\n]);\n\n/**\n * An array of OL tag properties and events.\n *\n * @public\n */\nexport const olProperties = toObjectMap(htmlElementProperties, [\n 'start', // ol\n]);\n\n/**\n * An array of LI tag properties and events.\n *\n * @public\n */\nexport const liProperties = toObjectMap(htmlElementProperties, [\n 'value', // button, input, li, option, meter, progress, param\n]);\n\n/**\n * An array of A tag properties and events.\n *\n * @public\n */\nexport const anchorProperties = toObjectMap(htmlElementProperties, [\n 'download', // a, area\n 'href', // a, area, base, link\n 'hrefLang', // a, area, link\n 'media', // a, area, link, source, style\n 'rel', // a, area, link\n 'target', // a, area, base, form\n 'type', // a, button, input, link, menu, object, script, source, style\n]);\n\n/**\n * An array of TIME tag properties and events.\n *\n * @public\n */\nexport const timeProperties = toObjectMap(htmlElementProperties, [\n 'dateTime', // time\n]);\n\n/**\n * An array of BUTTON tag properties and events.\n *\n * @public\n */\nexport const buttonProperties = toObjectMap(htmlElementProperties, [\n 'autoFocus', // button, input, select, textarea\n 'disabled', // button, fieldset, input, optgroup, option, select, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'formAction', // input, button\n 'formEncType', // input, button\n 'formMethod', // input, button\n 'formNoValidate', // input, button\n 'formTarget', // input, button\n 'type', // a, button, input, link, menu, object, script, source, style\n 'value', // button, input, li, option, meter, progress, param,\n]);\n\n/**\n * An array of INPUT tag properties and events.\n *\n * @public\n */\nexport const inputProperties = toObjectMap(buttonProperties, [\n 'accept', // input\n 'alt', // area, img, input\n 'autoCorrect', // input, textarea\n 'autoCapitalize', // input, textarea\n 'autoComplete', // form, input\n 'checked', // input\n 'dirname', // input, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'height', // canvas, embed, iframe, img, input, object, video\n 'inputMode', // input\n 'list', // input\n 'max', // input, meter\n 'maxLength', // input, textarea\n 'min', // input, meter\n 'minLength', // input, textarea\n 'multiple', // input, select\n 'pattern', // input\n 'placeholder', // input, textarea\n 'readOnly', // input, textarea\n 'required', // input, select, textarea\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'step', // input\n 'size', // input\n 'type', // a, button, input, link, menu, object, script, source, style\n 'value', // button, input, li, option, meter, progress, param\n 'width', // canvas, embed, iframe, img, input, object, video\n]);\n\n/**\n * An array of TEXTAREA tag properties and events.\n *\n * @public\n */\nexport const textAreaProperties = toObjectMap(buttonProperties, [\n 'autoCapitalize', // input, textarea\n 'cols', // textarea\n 'dirname', // input, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'maxLength', // input, textarea\n 'placeholder', // input, textarea\n 'readOnly', // input, textarea\n 'required', // input, select, textarea\n 'rows', // textarea\n 'wrap', // textarea\n]);\n\n/**\n * An array of SELECT tag properties and events.\n *\n * @public\n */\nexport const selectProperties = toObjectMap(buttonProperties, [\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'multiple', // input, select\n 'required', // input, select, textarea\n]);\n\nexport const optionProperties = toObjectMap(htmlElementProperties, [\n 'selected', // option\n 'value', // button, input, li, option, meter, progress, param\n]);\n\n/**\n * An array of TABLE tag properties and events.\n *\n * @public\n */\nexport const tableProperties = toObjectMap(htmlElementProperties, [\n 'cellPadding', // table\n 'cellSpacing', // table\n]);\n\n/**\n * An array of TR tag properties and events.\n *\n * @public\n */\nexport const trProperties = htmlElementProperties;\n\n/**\n * An array of TH tag properties and events.\n *\n * @public\n */\nexport const thProperties = toObjectMap(htmlElementProperties, [\n 'colSpan', // td, th\n 'rowSpan', // td, th\n 'scope', // th\n]);\n\n/**\n * An array of TD tag properties and events.\n *\n * @public\n */\nexport const tdProperties = toObjectMap(htmlElementProperties, [\n 'colSpan', // td\n 'headers', // td\n 'rowSpan', // td, th\n 'scope', // th\n]);\n\nexport const colGroupProperties = toObjectMap(htmlElementProperties, [\n 'span', // col, colgroup\n]);\n\nexport const colProperties = toObjectMap(htmlElementProperties, [\n 'span', // col, colgroup\n]);\n\n/**\n * An array of FIELDSET tag properties and events.\n *\n * @public\n */\nexport const fieldsetProperties = toObjectMap(htmlElementProperties, [\n 'disabled', // button, fieldset, input, optgroup, option, select, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n]);\n\n/**\n * An array of FORM tag properties and events.\n *\n * @public\n */\nexport const formProperties = toObjectMap(htmlElementProperties, [\n 'acceptCharset', // form\n 'action', // form\n 'encType', // form\n 'encType', // form\n 'method', // form\n 'noValidate', // form\n 'target', // form\n]);\n\n/**\n * An array of IFRAME tag properties and events.\n *\n * @public\n */\nexport const iframeProperties = toObjectMap(htmlElementProperties, [\n 'allow', // iframe\n 'allowFullScreen', // iframe\n 'allowPaymentRequest', // iframe\n 'allowTransparency', // iframe\n 'csp', // iframe\n 'height', // canvas, embed, iframe, img, input, object, video\n 'importance', // iframe\n 'referrerPolicy', // iframe\n 'sandbox', // iframe\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'srcDoc', // iframe\n 'width', // canvas, embed, iframe, img, input, object, video,\n]);\n\n/**\n * An array of IMAGE tag properties and events.\n *\n * @public\n */\nexport const imgProperties = toObjectMap(htmlElementProperties, [\n 'alt', // area, img, input\n 'crossOrigin', // img\n 'height', // canvas, embed, iframe, img, input, object, video\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'srcSet', // img, source\n 'useMap', // img, object,\n 'width', // canvas, embed, iframe, img, input, object, video\n]);\n\n/**\n * An array of DIALOG tag properties and events.\n *\n * @public\n */\nexport const dialogProperties = toObjectMap(htmlElementProperties, ['open', 'onCancel', 'onClose']);\n\n/**\n * An array of DIV tag properties and events.\n *\n * @public\n */\nexport const divProperties = htmlElementProperties;\n\n/**\n * Gets native supported props for an html element provided the allowance set. Use one of the property\n * sets defined (divProperties, buttonPropertes, etc) to filter out supported properties from a given\n * props set. Note that all data- and aria- prefixed attributes will be allowed.\n * NOTE: getNativeProps should always be applied first when adding props to a react component. The\n * non-native props should be applied second. This will prevent getNativeProps from overriding your custom props.\n * For example, if props passed to getNativeProps has an onClick function and getNativeProps is added to\n * the component after an onClick function is added, then the getNativeProps onClick will override it.\n *\n * @public\n * @param props - The unfiltered input props\n * @param allowedPropNames - The array or record of allowed prop names.\n * @param excludedPropNames\n * @returns The filtered props\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getNativeProps<T extends Record<string, any>>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n props: Record<string, any>,\n allowedPropNames: string[] | Record<string, number>,\n excludedPropNames?: string[],\n): T {\n // It'd be great to properly type this while allowing 'aria-` and 'data-' attributes like TypeScript does for\n // JSX attributes, but that ability is hardcoded into the TS compiler with no analog in TypeScript typings.\n // Then we'd be able to enforce props extends native props (including aria- and data- attributes), and then\n // return native props.\n // We should be able to do this once this PR is merged: https://github.com/microsoft/TypeScript/pull/26797\n\n const isArray = Array.isArray(allowedPropNames);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result: Record<string, any> = {};\n const keys = Object.keys(props);\n\n for (const key of keys) {\n const isNativeProp =\n (!isArray && (allowedPropNames as Record<string, number>)[key]) ||\n (isArray && (allowedPropNames as string[]).indexOf(key) >= 0) ||\n key.indexOf('data-') === 0 ||\n key.indexOf('aria-') === 0;\n\n if (isNativeProp && (!excludedPropNames || excludedPropNames?.indexOf(key) === -1)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result[key] = props![key] as any;\n }\n }\n\n return result as T;\n}\n"],"names":["anchorProperties","audioProperties","baseElementEvents","baseElementProperties","buttonProperties","colGroupProperties","colProperties","dialogProperties","divProperties","fieldsetProperties","formProperties","getNativeProps","htmlElementProperties","iframeProperties","imgProperties","inputProperties","labelProperties","liProperties","microdataProperties","olProperties","optionProperties","selectProperties","tableProperties","tdProperties","textAreaProperties","thProperties","timeProperties","trProperties","videoProperties","toObjectMap","items","result","item","keys","Array","isArray","Object","key","props","allowedPropNames","excludedPropNames","isNativeProp","indexOf"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IA6MaA,gBAAgB;eAAhBA;;IAzCAC,eAAe;eAAfA;;IAjJAC,iBAAiB;eAAjBA;;IA0FAC,qBAAqB;eAArBA;;IAwHAC,gBAAgB;eAAhBA;;IAyHAC,kBAAkB;eAAlBA;;IAIAC,aAAa;eAAbA;;IAqEAC,gBAAgB;eAAhBA;;IAOAC,aAAa;eAAbA;;IAnEAC,kBAAkB;eAAlBA;;IAUAC,cAAc;eAAdA;;IA2EGC,cAAc;eAAdA;;IA5SHC,qBAAqB;eAArBA;;IAgPAC,gBAAgB;eAAhBA;;IAoBAC,aAAa;eAAbA;;IAjKAC,eAAe;eAAfA;;IA5FAC,eAAe;eAAfA;;IAyCAC,YAAY;eAAZA;;IA7DAC,mBAAmB;eAAnBA;;IAoDAC,YAAY;eAAZA;;IAsHAC,gBAAgB;eAAhBA;;IANAC,gBAAgB;eAAhBA;;IAgBAC,eAAe;eAAfA;;IA4BAC,YAAY;eAAZA;;IA9DAC,kBAAkB;eAAlBA;;IAmDAC,YAAY;eAAZA;;IAhHAC,cAAc;eAAdA;;IAyGAC,YAAY;eAAZA;;IAnJAC,eAAe;eAAfA;;;AAlLb,MAAMC,cAAc,CAAC,GAAGC;IACtB,MAAMC,SAAiC,CAAC;IAExC,KAAK,MAAMC,QAAQF,MAAO;QACxB,MAAMG,OAAOC,MAAMC,OAAO,CAACH,QAAQA,OAAOI,OAAOH,IAAI,CAACD;QAEtD,KAAK,MAAMK,OAAOJ,KAAM;YACtBF,MAAM,CAACM,IAAI,GAAG;QAChB;IACF;IAEA,OAAON;AACT;AAOO,MAAM7B,oBAAoB2B,YAAY;IAC3C;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAOM,MAAM1B,wBAAwB0B,YAAY;IAC/C;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAOM,MAAMX,sBAAsBW,YAAY;IAC7C;IACA;IACA;IACA;IACA;CACD;AAOM,MAAMjB,wBAAwBiB,YAAY1B,uBAAuBD,mBAAmBgB;AAOpF,MAAMF,kBAAkBa,YAAYjB,uBAAuB;IAChE;CACD;AAOM,MAAMX,kBAAkB4B,YAAYjB,uBAAuB;IAChE;IACA;IACA;IACA;IACA;IACA;CACD;AAOM,MAAMgB,kBAAkBC,YAAY5B,iBAAiB;IAC1D;CACD;AAOM,MAAMkB,eAAeU,YAAYjB,uBAAuB;IAC7D;CACD;AAOM,MAAMK,eAAeY,YAAYjB,uBAAuB;IAC7D;CACD;AAOM,MAAMZ,mBAAmB6B,YAAYjB,uBAAuB;IACjE;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAOM,MAAMc,iBAAiBG,YAAYjB,uBAAuB;IAC/D;CACD;AAOM,MAAMR,mBAAmByB,YAAYjB,uBAAuB;IACjE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAOM,MAAMG,kBAAkBc,YAAYzB,kBAAkB;IAC3D;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAOM,MAAMoB,qBAAqBK,YAAYzB,kBAAkB;IAC9D;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAOM,MAAMiB,mBAAmBQ,YAAYzB,kBAAkB;IAC5D;IACA;IACA;CACD;AAEM,MAAMgB,mBAAmBS,YAAYjB,uBAAuB;IACjE;IACA;CACD;AAOM,MAAMU,kBAAkBO,YAAYjB,uBAAuB;IAChE;IACA;CACD;AAOM,MAAMe,eAAef;AAOrB,MAAMa,eAAeI,YAAYjB,uBAAuB;IAC7D;IACA;IACA;CACD;AAOM,MAAMW,eAAeM,YAAYjB,uBAAuB;IAC7D;IACA;IACA;IACA;CACD;AAEM,MAAMP,qBAAqBwB,YAAYjB,uBAAuB;IACnE;CACD;AAEM,MAAMN,gBAAgBuB,YAAYjB,uBAAuB;IAC9D;CACD;AAOM,MAAMH,qBAAqBoB,YAAYjB,uBAAuB;IACnE;IACA;CACD;AAOM,MAAMF,iBAAiBmB,YAAYjB,uBAAuB;IAC/D;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAOM,MAAMC,mBAAmBgB,YAAYjB,uBAAuB;IACjE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAOM,MAAME,gBAAgBe,YAAYjB,uBAAuB;IAC9D;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAOM,MAAML,mBAAmBsB,YAAYjB,uBAAuB;IAAC;IAAQ;IAAY;CAAU;AAO3F,MAAMJ,gBAAgBI;AAkBtB,SAASD,eACd,8DAA8D;AAC9D2B,KAA0B,EAC1BC,gBAAmD,EACnDC,iBAA4B;IAE5B,6GAA6G;IAC7G,2GAA2G;IAC3G,2GAA2G;IAC3G,uBAAuB;IACvB,0GAA0G;IAE1G,MAAML,UAAUD,MAAMC,OAAO,CAACI;IAC9B,8DAA8D;IAC9D,MAAMR,SAA8B,CAAC;IACrC,MAAME,OAAOG,OAAOH,IAAI,CAACK;IAEzB,KAAK,MAAMD,OAAOJ,KAAM;QACtB,MAAMQ,eACJ,AAAC,CAACN,WAAW,AAACI,gBAA2C,CAACF,IAAI,IAC7DF,WAAW,AAACI,iBAA8BG,OAAO,CAACL,QAAQ,KAC3DA,IAAIK,OAAO,CAAC,aAAa,KACzBL,IAAIK,OAAO,CAAC,aAAa;QAE3B,IAAID,gBAAiB,CAAA,CAACD,qBAAqBA,CAAAA,8BAAAA,wCAAAA,kBAAmBE,OAAO,CAACL,UAAS,CAAC,CAAA,GAAI;YAClF,8DAA8D;YAC9DN,MAAM,CAACM,IAAI,GAAGC,KAAM,CAACD,IAAI;QAC3B;IACF;IAEA,OAAON;AACT"}
1
+ {"version":3,"sources":["../src/utils/properties.ts"],"sourcesContent":["const toObjectMap = (...items: (string[] | Record<string, number>)[]) => {\n const result: Record<string, number> = {};\n\n for (const item of items) {\n const keys = Array.isArray(item) ? item : Object.keys(item);\n\n for (const key of keys) {\n result[key] = 1;\n }\n }\n\n return result;\n};\n\n/**\n * An array of events that are allowed on every html element type.\n *\n * @public\n */\nexport const baseElementEvents = toObjectMap([\n 'onAuxClick',\n 'onAnimationEnd',\n 'onAnimationStart',\n 'onCopy',\n 'onCut',\n 'onPaste',\n 'onCompositionEnd',\n 'onCompositionStart',\n 'onCompositionUpdate',\n 'onFocus',\n 'onFocusCapture',\n 'onBlur',\n 'onBlurCapture',\n 'onChange',\n 'onInput',\n 'onSubmit',\n 'onLoad',\n 'onError',\n 'onKeyDown',\n 'onKeyDownCapture',\n 'onKeyPress',\n 'onKeyUp',\n 'onAbort',\n 'onCanPlay',\n 'onCanPlayThrough',\n 'onDurationChange',\n 'onEmptied',\n 'onEncrypted',\n 'onEnded',\n 'onLoadedData',\n 'onLoadedMetadata',\n 'onLoadStart',\n 'onPause',\n 'onPlay',\n 'onPlaying',\n 'onProgress',\n 'onRateChange',\n 'onSeeked',\n 'onSeeking',\n 'onStalled',\n 'onSuspend',\n 'onTimeUpdate',\n 'onVolumeChange',\n 'onWaiting',\n 'onClick',\n 'onClickCapture',\n 'onContextMenu',\n 'onDoubleClick',\n 'onDrag',\n 'onDragEnd',\n 'onDragEnter',\n 'onDragExit',\n 'onDragLeave',\n 'onDragOver',\n 'onDragStart',\n 'onDrop',\n 'onMouseDown',\n 'onMouseDownCapture',\n 'onMouseEnter',\n 'onMouseLeave',\n 'onMouseMove',\n 'onMouseOut',\n 'onMouseOver',\n 'onMouseUp',\n 'onMouseUpCapture',\n 'onSelect',\n 'onTouchCancel',\n 'onTouchEnd',\n 'onTouchMove',\n 'onTouchStart',\n 'onScroll',\n 'onWheel',\n 'onPointerCancel',\n 'onPointerDown',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onPointerMove',\n 'onPointerOut',\n 'onPointerOver',\n 'onPointerUp',\n 'onGotPointerCapture',\n 'onLostPointerCapture',\n]);\n\n/**\n * An array of element attributes which are allowed on every html element type.\n *\n * @public\n */\nexport const baseElementProperties = toObjectMap([\n 'accessKey', // global\n 'children', // global\n 'className', // global\n 'contentEditable', // global\n 'dir', // global\n 'draggable', // global\n 'hidden', // global\n 'htmlFor', // global\n 'id', // global\n 'lang', // global\n 'ref', // global\n 'role', // global\n 'style', // global\n 'tabIndex', // global\n 'title', // global\n 'translate', // global\n 'spellCheck', // global\n 'name', // global\n]);\n\n/**\n * An array of microdata attributes that are allowed on every html element type.\n *\n * @public\n */\nexport const microdataProperties = toObjectMap([\n 'itemID', // global\n 'itemProp', // global\n 'itemRef', // global\n 'itemScope', // global\n 'itemType', // global\n]);\n\n/**\n * An array of HTML element properties and events.\n *\n * @public\n */\nexport const htmlElementProperties = toObjectMap(baseElementProperties, baseElementEvents, microdataProperties);\n\n/**\n * An array of LABEL tag properties and events.\n *\n * @public\n */\nexport const labelProperties = toObjectMap(htmlElementProperties, [\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n]);\n\n/**\n * An array of AUDIO tag properties and events.\n\n * @public\n */\nexport const audioProperties = toObjectMap(htmlElementProperties, [\n 'height', // canvas, embed, iframe, img, input, object, video\n 'loop', // audio, video\n 'muted', // audio, video\n 'preload', // audio, video\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'width', // canvas, embed, iframe, img, input, object, video\n]);\n\n/**\n * An array of VIDEO tag properties and events.\n *\n * @public\n */\nexport const videoProperties = toObjectMap(audioProperties, [\n 'poster', // video\n]);\n\n/**\n * An array of OL tag properties and events.\n *\n * @public\n */\nexport const olProperties = toObjectMap(htmlElementProperties, [\n 'start', // ol\n]);\n\n/**\n * An array of LI tag properties and events.\n *\n * @public\n */\nexport const liProperties = toObjectMap(htmlElementProperties, [\n 'value', // button, input, li, option, meter, progress, param\n]);\n\n/**\n * An array of A tag properties and events.\n *\n * @public\n */\nexport const anchorProperties = toObjectMap(htmlElementProperties, [\n 'download', // a, area\n 'href', // a, area, base, link\n 'hrefLang', // a, area, link\n 'media', // a, area, link, source, style\n 'rel', // a, area, link\n 'target', // a, area, base, form\n 'type', // a, button, input, link, menu, object, script, source, style\n]);\n\n/**\n * An array of TIME tag properties and events.\n *\n * @public\n */\nexport const timeProperties = toObjectMap(htmlElementProperties, [\n 'dateTime', // time\n]);\n\n/**\n * An array of BUTTON tag properties and events.\n *\n * @public\n */\nexport const buttonProperties = toObjectMap(htmlElementProperties, [\n 'autoFocus', // button, input, select, textarea\n 'disabled', // button, fieldset, input, optgroup, option, select, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'formAction', // input, button\n 'formEncType', // input, button\n 'formMethod', // input, button\n 'formNoValidate', // input, button\n 'formTarget', // input, button\n 'type', // a, button, input, link, menu, object, script, source, style\n 'value', // button, input, li, option, meter, progress, param,\n]);\n\n/**\n * An array of INPUT tag properties and events.\n *\n * @public\n */\nexport const inputProperties = toObjectMap(buttonProperties, [\n 'accept', // input\n 'alt', // area, img, input\n 'autoCorrect', // input, textarea\n 'autoCapitalize', // input, textarea\n 'autoComplete', // form, input\n 'checked', // input\n 'dirname', // input, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'height', // canvas, embed, iframe, img, input, object, video\n 'inputMode', // input\n 'list', // input\n 'max', // input, meter\n 'maxLength', // input, textarea\n 'min', // input, meter\n 'minLength', // input, textarea\n 'multiple', // input, select\n 'pattern', // input\n 'placeholder', // input, textarea\n 'readOnly', // input, textarea\n 'required', // input, select, textarea\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'step', // input\n 'size', // input\n 'type', // a, button, input, link, menu, object, script, source, style\n 'value', // button, input, li, option, meter, progress, param\n 'width', // canvas, embed, iframe, img, input, object, video\n]);\n\n/**\n * An array of TEXTAREA tag properties and events.\n *\n * @public\n */\nexport const textAreaProperties = toObjectMap(buttonProperties, [\n 'autoCapitalize', // input, textarea\n 'cols', // textarea\n 'dirname', // input, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'maxLength', // input, textarea\n 'placeholder', // input, textarea\n 'readOnly', // input, textarea\n 'required', // input, select, textarea\n 'rows', // textarea\n 'wrap', // textarea\n]);\n\n/**\n * An array of SELECT tag properties and events.\n *\n * @public\n */\nexport const selectProperties = toObjectMap(buttonProperties, [\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n 'multiple', // input, select\n 'required', // input, select, textarea\n]);\n\nexport const optionProperties = toObjectMap(htmlElementProperties, [\n 'selected', // option\n 'value', // button, input, li, option, meter, progress, param\n]);\n\n/**\n * An array of TABLE tag properties and events.\n *\n * @public\n */\nexport const tableProperties = toObjectMap(htmlElementProperties, [\n 'cellPadding', // table\n 'cellSpacing', // table\n]);\n\n/**\n * An array of TR tag properties and events.\n *\n * @public\n */\nexport const trProperties = htmlElementProperties;\n\n/**\n * An array of TH tag properties and events.\n *\n * @public\n */\nexport const thProperties = toObjectMap(htmlElementProperties, [\n 'colSpan', // td, th\n 'rowSpan', // td, th\n 'scope', // th\n]);\n\n/**\n * An array of TD tag properties and events.\n *\n * @public\n */\nexport const tdProperties = toObjectMap(htmlElementProperties, [\n 'colSpan', // td\n 'headers', // td\n 'rowSpan', // td, th\n 'scope', // th\n]);\n\nexport const colGroupProperties = toObjectMap(htmlElementProperties, [\n 'span', // col, colgroup\n]);\n\nexport const colProperties = toObjectMap(htmlElementProperties, [\n 'span', // col, colgroup\n]);\n\n/**\n * An array of FIELDSET tag properties and events.\n *\n * @public\n */\nexport const fieldsetProperties = toObjectMap(htmlElementProperties, [\n 'disabled', // button, fieldset, input, optgroup, option, select, textarea\n 'form', // button, fieldset, input, label, meter, object, output, select, textarea\n]);\n\n/**\n * An array of FORM tag properties and events.\n *\n * @public\n */\nexport const formProperties = toObjectMap(htmlElementProperties, [\n 'acceptCharset', // form\n 'action', // form\n 'encType', // form\n 'encType', // form\n 'method', // form\n 'noValidate', // form\n 'target', // form\n]);\n\n/**\n * An array of IFRAME tag properties and events.\n *\n * @public\n */\nexport const iframeProperties = toObjectMap(htmlElementProperties, [\n 'allow', // iframe\n 'allowFullScreen', // iframe\n 'allowPaymentRequest', // iframe\n 'allowTransparency', // iframe\n 'csp', // iframe\n 'height', // canvas, embed, iframe, img, input, object, video\n 'importance', // iframe\n 'referrerPolicy', // iframe\n 'sandbox', // iframe\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'srcDoc', // iframe\n 'width', // canvas, embed, iframe, img, input, object, video,\n]);\n\n/**\n * An array of IMAGE tag properties and events.\n *\n * @public\n */\nexport const imgProperties = toObjectMap(htmlElementProperties, [\n 'alt', // area, img, input\n 'crossOrigin', // img\n 'height', // canvas, embed, iframe, img, input, object, video\n 'src', // audio, embed, iframe, img, input, script, source, track, video\n 'srcSet', // img, source\n 'useMap', // img, object,\n 'width', // canvas, embed, iframe, img, input, object, video\n]);\n\n/**\n * An array of DIALOG tag properties and events.\n *\n * @public\n */\nexport const dialogProperties = toObjectMap(htmlElementProperties, ['open', 'onCancel', 'onClose']);\n\n/**\n * An array of DIV tag properties and events.\n *\n * @public\n */\nexport const divProperties = htmlElementProperties;\n\n/**\n * Gets native supported props for an html element provided the allowance set. Use one of the property\n * sets defined (divProperties, buttonPropertes, etc) to filter out supported properties from a given\n * props set. Note that all data- and aria- prefixed attributes will be allowed.\n * NOTE: getNativeProps should always be applied first when adding props to a react component. The\n * non-native props should be applied second. This will prevent getNativeProps from overriding your custom props.\n * For example, if props passed to getNativeProps has an onClick function and getNativeProps is added to\n * the component after an onClick function is added, then the getNativeProps onClick will override it.\n *\n * @public\n * @param props - The unfiltered input props\n * @param allowedPropNames - The array or record of allowed prop names.\n * @param excludedPropNames\n * @returns The filtered props\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function getNativeProps<T extends Record<string, any>>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n props: Record<string, any>,\n allowedPropNames: string[] | Record<string, number>,\n excludedPropNames?: string[],\n): T {\n // It'd be great to properly type this while allowing 'aria-` and 'data-' attributes like TypeScript does for\n // JSX attributes, but that ability is hardcoded into the TS compiler with no analog in TypeScript typings.\n // Then we'd be able to enforce props extends native props (including aria- and data- attributes), and then\n // return native props.\n // We should be able to do this once this PR is merged: https://github.com/microsoft/TypeScript/pull/26797\n\n const isArray = Array.isArray(allowedPropNames);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const result: Record<string, any> = {};\n const keys = Object.keys(props);\n\n for (const key of keys) {\n const isNativeProp =\n (!isArray && (allowedPropNames as Record<string, number>)[key]) ||\n (isArray && (allowedPropNames as string[]).indexOf(key) >= 0) ||\n key.indexOf('data-') === 0 ||\n key.indexOf('aria-') === 0;\n\n if (isNativeProp && (!excludedPropNames || excludedPropNames?.indexOf(key) === -1)) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n result[key] = props![key] as any;\n }\n }\n\n return result as T;\n}\n"],"names":["anchorProperties","audioProperties","baseElementEvents","baseElementProperties","buttonProperties","colGroupProperties","colProperties","dialogProperties","divProperties","fieldsetProperties","formProperties","getNativeProps","htmlElementProperties","iframeProperties","imgProperties","inputProperties","labelProperties","liProperties","microdataProperties","olProperties","optionProperties","selectProperties","tableProperties","tdProperties","textAreaProperties","thProperties","timeProperties","trProperties","videoProperties","toObjectMap","items","result","item","keys","Array","isArray","Object","key","props","allowedPropNames","excludedPropNames","isNativeProp","indexOf"],"mappings":";;;;;;;;;;;IA6MaA,gBAAgB;eAAhBA;;IAzCAC,eAAe;eAAfA;;IAjJAC,iBAAiB;eAAjBA;;IA0FAC,qBAAqB;eAArBA;;IAwHAC,gBAAgB;eAAhBA;;IAyHAC,kBAAkB;eAAlBA;;IAIAC,aAAa;eAAbA;;IAqEAC,gBAAgB;eAAhBA;;IAOAC,aAAa;eAAbA;;IAnEAC,kBAAkB;eAAlBA;;IAUAC,cAAc;eAAdA;;IA2EGC,cAAc;eAAdA;;IA5SHC,qBAAqB;eAArBA;;IAgPAC,gBAAgB;eAAhBA;;IAoBAC,aAAa;eAAbA;;IAjKAC,eAAe;eAAfA;;IA5FAC,eAAe;eAAfA;;IAyCAC,YAAY;eAAZA;;IA7DAC,mBAAmB;eAAnBA;;IAoDAC,YAAY;eAAZA;;IAsHAC,gBAAgB;eAAhBA;;IANAC,gBAAgB;eAAhBA;;IAgBAC,eAAe;eAAfA;;IA4BAC,YAAY;eAAZA;;IA9DAC,kBAAkB;eAAlBA;;IAmDAC,YAAY;eAAZA;;IAhHAC,cAAc;eAAdA;;IAyGAC,YAAY;eAAZA;;IAnJAC,eAAe;eAAfA;;;AAlLb,MAAMC,cAAc,CAAC,GAAGC;IACtB,MAAMC,SAAiC,CAAC;IAExC,KAAK,MAAMC,QAAQF,MAAO;QACxB,MAAMG,OAAOC,MAAMC,OAAO,CAACH,QAAQA,OAAOI,OAAOH,IAAI,CAACD;QAEtD,KAAK,MAAMK,OAAOJ,KAAM;YACtBF,MAAM,CAACM,IAAI,GAAG;QAChB;IACF;IAEA,OAAON;AACT;AAOO,MAAM7B,oBAAoB2B,YAAY;IAC3C;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAOM,MAAM1B,wBAAwB0B,YAAY;IAC/C;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAOM,MAAMX,sBAAsBW,YAAY;IAC7C;IACA;IACA;IACA;IACA;CACD;AAOM,MAAMjB,wBAAwBiB,YAAY1B,uBAAuBD,mBAAmBgB;AAOpF,MAAMF,kBAAkBa,YAAYjB,uBAAuB;IAChE;CACD;AAOM,MAAMX,kBAAkB4B,YAAYjB,uBAAuB;IAChE;IACA;IACA;IACA;IACA;IACA;CACD;AAOM,MAAMgB,kBAAkBC,YAAY5B,iBAAiB;IAC1D;CACD;AAOM,MAAMkB,eAAeU,YAAYjB,uBAAuB;IAC7D;CACD;AAOM,MAAMK,eAAeY,YAAYjB,uBAAuB;IAC7D;CACD;AAOM,MAAMZ,mBAAmB6B,YAAYjB,uBAAuB;IACjE;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAOM,MAAMc,iBAAiBG,YAAYjB,uBAAuB;IAC/D;CACD;AAOM,MAAMR,mBAAmByB,YAAYjB,uBAAuB;IACjE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAOM,MAAMG,kBAAkBc,YAAYzB,kBAAkB;IAC3D;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAOM,MAAMoB,qBAAqBK,YAAYzB,kBAAkB;IAC9D;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAOM,MAAMiB,mBAAmBQ,YAAYzB,kBAAkB;IAC5D;IACA;IACA;CACD;AAEM,MAAMgB,mBAAmBS,YAAYjB,uBAAuB;IACjE;IACA;CACD;AAOM,MAAMU,kBAAkBO,YAAYjB,uBAAuB;IAChE;IACA;CACD;AAOM,MAAMe,eAAef;AAOrB,MAAMa,eAAeI,YAAYjB,uBAAuB;IAC7D;IACA;IACA;CACD;AAOM,MAAMW,eAAeM,YAAYjB,uBAAuB;IAC7D;IACA;IACA;IACA;CACD;AAEM,MAAMP,qBAAqBwB,YAAYjB,uBAAuB;IACnE;CACD;AAEM,MAAMN,gBAAgBuB,YAAYjB,uBAAuB;IAC9D;CACD;AAOM,MAAMH,qBAAqBoB,YAAYjB,uBAAuB;IACnE;IACA;CACD;AAOM,MAAMF,iBAAiBmB,YAAYjB,uBAAuB;IAC/D;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAOM,MAAMC,mBAAmBgB,YAAYjB,uBAAuB;IACjE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAOM,MAAME,gBAAgBe,YAAYjB,uBAAuB;IAC9D;IACA;IACA;IACA;IACA;IACA;IACA;CACD;AAOM,MAAML,mBAAmBsB,YAAYjB,uBAAuB;IAAC;IAAQ;IAAY;CAAU;AAO3F,MAAMJ,gBAAgBI;AAkBtB,SAASD,eACd,8DAA8D;AAC9D2B,KAA0B,EAC1BC,gBAAmD,EACnDC,iBAA4B;IAE5B,6GAA6G;IAC7G,2GAA2G;IAC3G,2GAA2G;IAC3G,uBAAuB;IACvB,0GAA0G;IAE1G,MAAML,UAAUD,MAAMC,OAAO,CAACI;IAC9B,8DAA8D;IAC9D,MAAMR,SAA8B,CAAC;IACrC,MAAME,OAAOG,OAAOH,IAAI,CAACK;IAEzB,KAAK,MAAMD,OAAOJ,KAAM;QACtB,MAAMQ,eACJ,AAAC,CAACN,WAAW,AAACI,gBAA2C,CAACF,IAAI,IAC7DF,WAAW,AAACI,iBAA8BG,OAAO,CAACL,QAAQ,KAC3DA,IAAIK,OAAO,CAAC,aAAa,KACzBL,IAAIK,OAAO,CAAC,aAAa;QAE3B,IAAID,gBAAiB,CAAA,CAACD,qBAAqBA,CAAAA,8BAAAA,wCAAAA,kBAAmBE,OAAO,CAACL,UAAS,CAAC,CAAA,GAAI;YAClF,8DAA8D;YAC9DN,MAAM,CAACM,IAAI,GAAGC,KAAM,CAACD,IAAI;QAC3B;IACF;IAEA,OAAON;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/utils/types.ts"],"sourcesContent":["import * as React from 'react';\n\n/**\n * Helper type that works similar to Omit,\n * but when modifying an union type it will distribute the omission to all the union members.\n *\n * See [distributive conditional types](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types) for more information\n */\n// Traditional Omit is basically equivalent to => Pick<T, Exclude<keyof T, K>>\n//\n// let's say we have Omit<{ a: string } | { b: string }, 'a'>\n// equivalent to: Pick<{ a: string } | { b: string }, Exclude<keyof ({ a: string } | { b: string }), 'a'>>\n// The expected result would be {} | { b: string }, the omission of 'a' from all the union members,\n// but keyof ({ a: string } | { b: string }) is never as they don't share common keys\n// so Exclude<never, 'a'> is never,\n// and Pick<{ a: string } | { b: string }, never> is {}.\n//\n// With DistributiveOmit on the other hand it becomes like this:\n// DistributiveOmit<{ a: string } | { b: string }, 'a'>\n// equivalent to: Omit<{ a: string }, 'a'> | Omit<{ b: string }, 'a'>\n// Since every single Omit clause in this case is being applied to a single union member there's no conflicts on keyof evaluation and in the second clause Omit<{ b: string }, 'a'> becomes { b: string },\n// so the result is {} | { b: string }, as expected.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Omit<T, K> : T;\n\n/**\n * @public\n *\n * Helper type that works similar to Pick,\n * but when modifying an union type it will distribute the picking to all the union members.\n *\n * See {@link https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types} for more information\n */\nexport type DistributivePick<T, K> = T extends unknown ? Pick<T, K & keyof T> : never;\n\n/**\n * Converts a union type (`A | B | C`) to an intersection type (`A & B & C`)\n */\nexport type UnionToIntersection<U> = (U extends unknown ? (x: U) => U : never) extends (x: infer I) => U ? I : never;\n\n/**\n * @internal\n * If type T includes `null`, remove it and add `undefined` instead.\n */\nexport type ReplaceNullWithUndefined<T> = T extends null ? Exclude<T, null> | undefined : T;\n\n/**\n * @internal\n * With react 18, our `children` type starts leaking everywhere and that causes conflicts on component declaration, specially in the `propTypes` property of\n * both `ComponentClass` and `FunctionComponent`.\n *\n * This type substitutes `React.ComponentType` only keeping the function signature, it omits `propTypes`, `displayName` and other properties that are not\n * required for the inference.\n */\nexport type ComponentType<P = {}> = ComponentClass<P> | FunctionComponent<P>;\n\n/**\n * @internal\n *\n * On types/react 18 there are two types being delivered,\n * they rely on the typescript version to decide which will be consumed {@link https://github.com/DefinitelyTyped/DefinitelyTyped/blob/b59dc3ac1e2770fbd6cdbb90ba52abe04c168196/types/react/package.json#L10}\n *\n * If TS is higher than 5.0 then the `FunctionComponent` will be returning ReactNode (which we don't support)\n * If TS is below or equal to 5.0 then the `FunctionComponent` will be returning ReactElement | null (which we support)\n *\n * Since it's not possible to have a single type that works for both cases\n * (as ReactNode is more specific, and this will break while evaluating functions),\n * we need to create our own `FunctionComponent` type\n * that will work for both cases.\n *\n * **THIS TYPE IS INTERNAL AND SHOULD NEVER BE EXPOSED**\n */\nexport interface FunctionComponent<P> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (props: P): any;\n displayName?: string;\n}\n\nexport type FC<P> = FunctionComponent<P>;\n\nexport interface ExoticComponent<P> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (props: P): any;\n $$typeof: symbol;\n}\n\nexport interface NamedExoticComponent<P> extends ExoticComponent<P> {\n displayName?: string;\n}\n\n/**\n * @internal\n * **THIS TYPE IS INTERNAL AND SHOULD NEVER BE EXPOSED**\n */\nexport interface ComponentClass<P = {}, S = React.ComponentState> extends React.StaticLifecycle<P, S> {\n new (props: P): React.Component<P, S>;\n}\n\n/**\n * @internal\n *\n * on types/react 18 ReactNode becomes a more strict type, which is not compatible with our current implementation. to avoid any issues we are creating our own ReactNode type which allows anything.\n *\n * This type should only be used for inference purposes, and should never be exposed.\n *\n * **THIS TYPE IS INTERNAL AND SHOULD NEVER BE EXPOSED**\n *\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ReactNode = any;\n\n/**\n * Removes the 'ref' prop from the given Props type, leaving unions intact (such as the discriminated union created by\n * IntrinsicSlotProps). This allows IntrinsicSlotProps to be used with React.forwardRef.\n */\nexport type PropsWithoutRef<P> = 'ref' extends keyof P ? DistributiveOmit<P, 'ref'> : P;\n\n/**\n * Removes the 'children' prop from the given Props type, leaving unions intact (such as the discriminated union created by\n * IntrinsicSlotProps). This allows IntrinsicSlotProps to be used with React.forwardRef.\n */\nexport type PropsWithoutChildren<P> = 'children' extends keyof P ? DistributiveOmit<P, 'children'> : P;\n\n/**\n * @internal\n *\n * This type is used to determine if the current version of React is 18+ or not.\n *\n * It checks if the `React.ReactNode` has `{}` it its type.\n * If it is, then it means that the current version of React is lower than 18.\n * If it is not, then it means that the current version of React is 18 or higher.\n * This is useful for ensuring compatibility with different versions of React.\n *\n * **THIS TYPE IS INTERNAL AND SHOULD NEVER BE EXPOSED**\n */\nexport type ReactVersionDependent<Modern, Legacy> = {} extends React.ReactNode ? Legacy : Modern;\n"],"names":[],"rangeMappings":";;;;;","mappings":";;;;;iEAAuB"}
1
+ {"version":3,"sources":["../src/utils/types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { JSXIntrinsicElementKeysCompat, JSXIntrinsicElementKeysLatest } from './generated-types';\n\n/**\n * Helper type that works similar to Omit,\n * but when modifying an union type it will distribute the omission to all the union members.\n *\n * See [distributive conditional types](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types) for more information\n */\n// Traditional Omit is basically equivalent to => Pick<T, Exclude<keyof T, K>>\n//\n// let's say we have Omit<{ a: string } | { b: string }, 'a'>\n// equivalent to: Pick<{ a: string } | { b: string }, Exclude<keyof ({ a: string } | { b: string }), 'a'>>\n// The expected result would be {} | { b: string }, the omission of 'a' from all the union members,\n// but keyof ({ a: string } | { b: string }) is never as they don't share common keys\n// so Exclude<never, 'a'> is never,\n// and Pick<{ a: string } | { b: string }, never> is {}.\n//\n// With DistributiveOmit on the other hand it becomes like this:\n// DistributiveOmit<{ a: string } | { b: string }, 'a'>\n// equivalent to: Omit<{ a: string }, 'a'> | Omit<{ b: string }, 'a'>\n// Since every single Omit clause in this case is being applied to a single union member there's no conflicts on keyof evaluation and in the second clause Omit<{ b: string }, 'a'> becomes { b: string },\n// so the result is {} | { b: string }, as expected.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type DistributiveOmit<T, K extends keyof any> = T extends unknown ? Omit<T, K> : T;\n\n/**\n * @public\n *\n * Helper type that works similar to Pick,\n * but when modifying an union type it will distribute the picking to all the union members.\n *\n * See {@link https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types} for more information\n */\nexport type DistributivePick<T, K> = T extends unknown ? Pick<T, K & keyof T> : never;\n\n/**\n * Converts a union type (`A | B | C`) to an intersection type (`A & B & C`)\n */\nexport type UnionToIntersection<U> = (U extends unknown ? (x: U) => U : never) extends (x: infer I) => U ? I : never;\n\n/**\n * @internal\n * If type T includes `null`, remove it and add `undefined` instead.\n */\nexport type ReplaceNullWithUndefined<T> = T extends null ? Exclude<T, null> | undefined : T;\n\n/**\n * @internal\n * With react 18, our `children` type starts leaking everywhere and that causes conflicts on component declaration, specially in the `propTypes` property of\n * both `ComponentClass` and `FunctionComponent`.\n *\n * This type substitutes `React.ComponentType` only keeping the function signature, it omits `propTypes`, `displayName` and other properties that are not\n * required for the inference.\n */\nexport type ComponentType<P = {}> = ComponentClass<P> | FunctionComponent<P>;\n\n/**\n * @internal\n *\n * On types/react 18 there are two types being delivered,\n * they rely on the typescript version to decide which will be consumed {@link https://github.com/DefinitelyTyped/DefinitelyTyped/blob/b59dc3ac1e2770fbd6cdbb90ba52abe04c168196/types/react/package.json#L10}\n *\n * If TS is higher than 5.0 then the `FunctionComponent` will be returning ReactNode (which we don't support)\n * If TS is below or equal to 5.0 then the `FunctionComponent` will be returning ReactElement | null (which we support)\n *\n * Since it's not possible to have a single type that works for both cases\n * (as ReactNode is more specific, and this will break while evaluating functions),\n * we need to create our own `FunctionComponent` type\n * that will work for both cases.\n *\n * **THIS TYPE IS INTERNAL AND SHOULD NEVER BE EXPOSED**\n */\nexport interface FunctionComponent<P> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (props: P): any;\n displayName?: string;\n}\n\nexport type FC<P> = FunctionComponent<P>;\n\nexport interface ExoticComponent<P> {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (props: P): any;\n $$typeof: symbol;\n}\n\nexport interface NamedExoticComponent<P> extends ExoticComponent<P> {\n displayName?: string;\n}\n\n/**\n * @internal\n * **THIS TYPE IS INTERNAL AND SHOULD NEVER BE EXPOSED**\n */\nexport interface ComponentClass<P = {}, S = React.ComponentState> extends React.StaticLifecycle<P, S> {\n new (props: P): React.Component<P, S>;\n}\n\n/**\n * @internal\n *\n * on types/react 18 ReactNode becomes a more strict type, which is not compatible with our current implementation. to avoid any issues we are creating our own ReactNode type which allows anything.\n *\n * This type should only be used for inference purposes, and should never be exposed.\n *\n * **THIS TYPE IS INTERNAL AND SHOULD NEVER BE EXPOSED**\n *\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ReactNode = any;\n\n/**\n * Removes the 'ref' prop from the given Props type, leaving unions intact (such as the discriminated union created by\n * IntrinsicSlotProps). This allows IntrinsicSlotProps to be used with React.forwardRef.\n */\nexport type PropsWithoutRef<P> = 'ref' extends keyof P ? DistributiveOmit<P, 'ref'> : P;\n\n/**\n * Removes the 'children' prop from the given Props type, leaving unions intact (such as the discriminated union created by\n * IntrinsicSlotProps). This allows IntrinsicSlotProps to be used with React.forwardRef.\n */\nexport type PropsWithoutChildren<P> = 'children' extends keyof P ? DistributiveOmit<P, 'children'> : P;\n\n/**\n * @internal\n *\n * This type is used to determine if the current version of React is 18+ or not.\n *\n * It checks if the `React.ReactNode` has `{}` it its type.\n * If it is, then it means that the current version of React is lower than 18.\n * If it is not, then it means that the current version of React is 18 or higher.\n * This is useful for ensuring compatibility with different versions of React.\n *\n * **THIS TYPE IS INTERNAL AND SHOULD NEVER BE EXPOSED**\n */\nexport type ReactVersionDependent<Modern, Legacy> = {} extends React.ReactNode ? Legacy : Modern;\n\n/**\n * Our own alias for `JSX.Element` type that is compatible with both React 17 and React 18+.\n * Use this type when annotating JSX markup in all our code in order to avoid issues between different React versions.\n *\n * Example usage:\n *\n * BAD:\n * ```tsx\n * const renderFoo = (state: FooState) = <div {...props}>Hello World</div>;\n * // infers\n * // R17: declare const renderFoo: (state: FooState) => JSX.Element;\n * // R18+: declare const renderFoo: (state: FooState) => React.JSX.Element;\n * ```\n *\n * GOOD:\n * ```tsx\n * import type { JSXElement } from '@fluentui/react-utilities';\n * const renderFoo = (state: FooState): JSXElement = <div {...props}>Hello World</div>;\n * ```\n */\nexport type JSXElement = React.ReactElement<\n /* eslint-disable @typescript-eslint/no-explicit-any */\n any,\n any\n /* eslint-enable @typescript-eslint/no-explicit-any */\n>;\n\n/**\n * Union of all intrinsic element keys in React.\n * Based on the React version, it will either be the latest set of intrinsic elements or the legacy set.\n */\nexport type JSXIntrinsicElementKeys = ReactVersionDependent<\n JSXIntrinsicElementKeysLatest,\n JSXIntrinsicElementKeysCompat\n>;\n\n/**\n * Our own alias for `JSX.IntrinsicElements` type that is compatible with both React 17 and React 18+.\n * Use this type to get the intrinsic elements from React types in order to avoid issues between different React versions.\n */\nexport type JSXIntrinsicElement<Element extends JSXIntrinsicElementKeys> = React.ComponentProps<Element>;\n"],"names":[],"mappings":";;;;;iEAAuB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/virtualParent/elementContains.ts"],"sourcesContent":["import { getParent } from './getParent';\n\n/**\n * Similar functionality to `element.contains` DOM API for use without of order DOM elements that\n * checks the virtual parent hierarchy. If a virtual parents exists, it is chosen over the actual parent\n *\n * @internal\n * @returns true if the child can find the parent in its virtual hierarchy\n */\nexport function elementContains(parent: Node | null, child: Node | null): boolean {\n if (!parent || !child) {\n return false;\n }\n\n if (parent === child) {\n return true;\n } else {\n // Tracks references of nodes that have been visited to prevent infinite loops\n const set = new WeakSet<Node>();\n\n while (child) {\n const nextParent: Node | null = getParent(child, {\n skipVirtual: set.has(child),\n });\n set.add(child);\n\n if (nextParent === parent) {\n return true;\n }\n\n child = nextParent;\n }\n }\n\n return false;\n}\n"],"names":["elementContains","parent","child","set","WeakSet","nextParent","getParent","skipVirtual","has","add"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASgBA;;;eAAAA;;;2BATU;AASnB,SAASA,gBAAgBC,MAAmB,EAAEC,KAAkB;IACrE,IAAI,CAACD,UAAU,CAACC,OAAO;QACrB,OAAO;IACT;IAEA,IAAID,WAAWC,OAAO;QACpB,OAAO;IACT,OAAO;QACL,8EAA8E;QAC9E,MAAMC,MAAM,IAAIC;QAEhB,MAAOF,MAAO;YACZ,MAAMG,aAA0BC,IAAAA,oBAAS,EAACJ,OAAO;gBAC/CK,aAAaJ,IAAIK,GAAG,CAACN;YACvB;YACAC,IAAIM,GAAG,CAACP;YAER,IAAIG,eAAeJ,QAAQ;gBACzB,OAAO;YACT;YAEAC,QAAQG;QACV;IACF;IAEA,OAAO;AACT"}
1
+ {"version":3,"sources":["../src/virtualParent/elementContains.ts"],"sourcesContent":["import { getParent } from './getParent';\n\n/**\n * Similar functionality to `element.contains` DOM API for use without of order DOM elements that\n * checks the virtual parent hierarchy. If a virtual parents exists, it is chosen over the actual parent\n *\n * @internal\n * @returns true if the child can find the parent in its virtual hierarchy\n */\nexport function elementContains(parent: Node | null, child: Node | null): boolean {\n if (!parent || !child) {\n return false;\n }\n\n if (parent === child) {\n return true;\n } else {\n // Tracks references of nodes that have been visited to prevent infinite loops\n const set = new WeakSet<Node>();\n\n while (child) {\n const nextParent: Node | null = getParent(child, {\n skipVirtual: set.has(child),\n });\n set.add(child);\n\n if (nextParent === parent) {\n return true;\n }\n\n child = nextParent;\n }\n }\n\n return false;\n}\n"],"names":["elementContains","parent","child","set","WeakSet","nextParent","getParent","skipVirtual","has","add"],"mappings":";;;;+BASgBA;;;eAAAA;;;2BATU;AASnB,SAASA,gBAAgBC,MAAmB,EAAEC,KAAkB;IACrE,IAAI,CAACD,UAAU,CAACC,OAAO;QACrB,OAAO;IACT;IAEA,IAAID,WAAWC,OAAO;QACpB,OAAO;IACT,OAAO;QACL,8EAA8E;QAC9E,MAAMC,MAAM,IAAIC;QAEhB,MAAOF,MAAO;YACZ,MAAMG,aAA0BC,IAAAA,oBAAS,EAACJ,OAAO;gBAC/CK,aAAaJ,IAAIK,GAAG,CAACN;YACvB;YACAC,IAAIM,GAAG,CAACP;YAER,IAAIG,eAAeJ,QAAQ;gBACzB,OAAO;YACT;YAEAC,QAAQG;QACV;IACF;IAEA,OAAO;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/virtualParent/getParent.ts"],"sourcesContent":["import { isVirtualElement } from './isVirtualElement';\n\ntype GetParentOptions = {\n /**\n * Indicates if getParent() should ignore a virtual parent.\n * @internal\n */\n skipVirtual?: boolean;\n};\n\n/**\n * Gets the virtual parent given the child element, if it exists.\n * @internal\n */\nfunction getVirtualParent(child: Node): Node | null {\n return isVirtualElement(child) ? child._virtual.parent || null : null;\n}\n\n/**\n * Gets the element which is the parent of a given element.\n * This method prefers the virtual parent over real DOM parent when present.\n * @internal\n */\nexport function getParent(child: Node | null, options: GetParentOptions = {}): Node | null {\n if (!child) {\n return null;\n }\n\n if (!options.skipVirtual) {\n const virtualParent = getVirtualParent(child);\n\n if (virtualParent) {\n return virtualParent;\n }\n }\n\n const parent = child.parentNode;\n\n if (parent && parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n return (parent as ShadowRoot).host;\n }\n\n return parent;\n}\n"],"names":["getParent","getVirtualParent","child","isVirtualElement","_virtual","parent","options","skipVirtual","virtualParent","parentNode","nodeType","Node","DOCUMENT_FRAGMENT_NODE","host"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;+BAuBgBA;;;eAAAA;;;kCAvBiB;AAUjC;;;CAGC,GACD,SAASC,iBAAiBC,KAAW;IACnC,OAAOC,IAAAA,kCAAgB,EAACD,SAASA,MAAME,QAAQ,CAACC,MAAM,IAAI,OAAO;AACnE;AAOO,SAASL,UAAUE,KAAkB,EAAEI,UAA4B,CAAC,CAAC;IAC1E,IAAI,CAACJ,OAAO;QACV,OAAO;IACT;IAEA,IAAI,CAACI,QAAQC,WAAW,EAAE;QACxB,MAAMC,gBAAgBP,iBAAiBC;QAEvC,IAAIM,eAAe;YACjB,OAAOA;QACT;IACF;IAEA,MAAMH,SAASH,MAAMO,UAAU;IAE/B,IAAIJ,UAAUA,OAAOK,QAAQ,KAAKC,KAAKC,sBAAsB,EAAE;QAC7D,OAAO,AAACP,OAAsBQ,IAAI;IACpC;IAEA,OAAOR;AACT"}
1
+ {"version":3,"sources":["../src/virtualParent/getParent.ts"],"sourcesContent":["import { isVirtualElement } from './isVirtualElement';\n\ntype GetParentOptions = {\n /**\n * Indicates if getParent() should ignore a virtual parent.\n * @internal\n */\n skipVirtual?: boolean;\n};\n\n/**\n * Gets the virtual parent given the child element, if it exists.\n * @internal\n */\nfunction getVirtualParent(child: Node): Node | null {\n return isVirtualElement(child) ? child._virtual.parent || null : null;\n}\n\n/**\n * Gets the element which is the parent of a given element.\n * This method prefers the virtual parent over real DOM parent when present.\n * @internal\n */\nexport function getParent(child: Node | null, options: GetParentOptions = {}): Node | null {\n if (!child) {\n return null;\n }\n\n if (!options.skipVirtual) {\n const virtualParent = getVirtualParent(child);\n\n if (virtualParent) {\n return virtualParent;\n }\n }\n\n const parent = child.parentNode;\n\n if (parent && parent.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n return (parent as ShadowRoot).host;\n }\n\n return parent;\n}\n"],"names":["getParent","getVirtualParent","child","isVirtualElement","_virtual","parent","options","skipVirtual","virtualParent","parentNode","nodeType","Node","DOCUMENT_FRAGMENT_NODE","host"],"mappings":";;;;+BAuBgBA;;;eAAAA;;;kCAvBiB;AAUjC;;;CAGC,GACD,SAASC,iBAAiBC,KAAW;IACnC,OAAOC,IAAAA,kCAAgB,EAACD,SAASA,MAAME,QAAQ,CAACC,MAAM,IAAI,OAAO;AACnE;AAOO,SAASL,UAAUE,KAAkB,EAAEI,UAA4B,CAAC,CAAC;IAC1E,IAAI,CAACJ,OAAO;QACV,OAAO;IACT;IAEA,IAAI,CAACI,QAAQC,WAAW,EAAE;QACxB,MAAMC,gBAAgBP,iBAAiBC;QAEvC,IAAIM,eAAe;YACjB,OAAOA;QACT;IACF;IAEA,MAAMH,SAASH,MAAMO,UAAU;IAE/B,IAAIJ,UAAUA,OAAOK,QAAQ,KAAKC,KAAKC,sBAAsB,EAAE;QAC7D,OAAO,AAACP,OAAsBQ,IAAI;IACpC;IAEA,OAAOR;AACT"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/virtualParent/index.ts"],"sourcesContent":["export { elementContains } from './elementContains';\nexport { setVirtualParent } from './setVirtualParent';\nexport { getParent } from './getParent';\n"],"names":["elementContains","getParent","setVirtualParent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAASA,eAAe;eAAfA,gCAAe;;IAEfC,SAAS;eAATA,oBAAS;;IADTC,gBAAgB;eAAhBA,kCAAgB;;;iCADO;kCACC;2BACP"}
1
+ {"version":3,"sources":["../src/virtualParent/index.ts"],"sourcesContent":["export { elementContains } from './elementContains';\nexport { setVirtualParent } from './setVirtualParent';\nexport { getParent } from './getParent';\n"],"names":["elementContains","getParent","setVirtualParent"],"mappings":";;;;;;;;;;;IAASA,eAAe;eAAfA,gCAAe;;IAEfC,SAAS;eAATA,oBAAS;;IADTC,gBAAgB;eAAhBA,kCAAgB;;;iCADO;kCACC;2BACP"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/virtualParent/isVirtualElement.ts"],"sourcesContent":["import type { VirtualElement } from './types';\n\n/**\n * Determines whether or not an element has the virtual hierarchy extension.\n * @internal\n */\nexport function isVirtualElement(element: Node | VirtualElement): element is VirtualElement {\n return element && !!(<VirtualElement>element)._virtual;\n}\n"],"names":["isVirtualElement","element","_virtual"],"rangeMappings":";;;;;;;;;;;;","mappings":";;;;+BAMgBA;;;eAAAA;;;AAAT,SAASA,iBAAiBC,OAA8B;IAC7D,OAAOA,WAAW,CAAC,CAAC,AAAiBA,QAASC,QAAQ;AACxD"}
1
+ {"version":3,"sources":["../src/virtualParent/isVirtualElement.ts"],"sourcesContent":["import type { VirtualElement } from './types';\n\n/**\n * Determines whether or not an element has the virtual hierarchy extension.\n * @internal\n */\nexport function isVirtualElement(element: Node | VirtualElement): element is VirtualElement {\n return element && !!(<VirtualElement>element)._virtual;\n}\n"],"names":["isVirtualElement","element","_virtual"],"mappings":";;;;+BAMgBA;;;eAAAA;;;AAAT,SAASA,iBAAiBC,OAA8B;IAC7D,OAAOA,WAAW,CAAC,CAAC,AAAiBA,QAASC,QAAQ;AACxD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/virtualParent/setVirtualParent.ts"],"sourcesContent":["import type { VirtualElement } from './types';\n\n/**\n * Sets the virtual parent of an element.\n *\n * @internal\n * @param child - Theme element to set the virtual parent\n * @param parent - The virtual parent, use `undefined` to remove a virtual parent relationship\n */\nexport function setVirtualParent(child: Node, parent?: Node): void {\n if (!child) {\n return;\n }\n\n const virtualChild = child as VirtualElement;\n\n if (!virtualChild._virtual) {\n virtualChild._virtual = {};\n }\n\n virtualChild._virtual.parent = parent;\n}\n"],"names":["setVirtualParent","child","parent","virtualChild","_virtual"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":";;;;+BASgBA;;;eAAAA;;;AAAT,SAASA,iBAAiBC,KAAW,EAAEC,MAAa;IACzD,IAAI,CAACD,OAAO;QACV;IACF;IAEA,MAAME,eAAeF;IAErB,IAAI,CAACE,aAAaC,QAAQ,EAAE;QAC1BD,aAAaC,QAAQ,GAAG,CAAC;IAC3B;IAEAD,aAAaC,QAAQ,CAACF,MAAM,GAAGA;AACjC"}
1
+ {"version":3,"sources":["../src/virtualParent/setVirtualParent.ts"],"sourcesContent":["import type { VirtualElement } from './types';\n\n/**\n * Sets the virtual parent of an element.\n *\n * @internal\n * @param child - Theme element to set the virtual parent\n * @param parent - The virtual parent, use `undefined` to remove a virtual parent relationship\n */\nexport function setVirtualParent(child: Node, parent?: Node): void {\n if (!child) {\n return;\n }\n\n const virtualChild = child as VirtualElement;\n\n if (!virtualChild._virtual) {\n virtualChild._virtual = {};\n }\n\n virtualChild._virtual.parent = parent;\n}\n"],"names":["setVirtualParent","child","parent","virtualChild","_virtual"],"mappings":";;;;+BASgBA;;;eAAAA;;;AAAT,SAASA,iBAAiBC,KAAW,EAAEC,MAAa;IACzD,IAAI,CAACD,OAAO;QACV;IACF;IAEA,MAAME,eAAeF;IAErB,IAAI,CAACE,aAAaC,QAAQ,EAAE;QAC1BD,aAAaC,QAAQ,GAAG,CAAC;IAC3B;IAEAD,aAAaC,QAAQ,CAACF,MAAM,GAAGA;AACjC"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"rangeMappings":"","mappings":""}
1
+ {"version":3,"sources":[],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-utilities",
3
- "version": "9.21.1",
3
+ "version": "9.23.0",
4
4
  "description": "A set of general React-specific utilities.",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",