@fluentui/react-popover 9.5.12 → 9.5.14

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.json CHANGED
@@ -2,7 +2,75 @@
2
2
  "name": "@fluentui/react-popover",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 18 May 2023 00:35:41 GMT",
5
+ "date": "Wed, 24 May 2023 20:42:42 GMT",
6
+ "tag": "@fluentui/react-popover_v9.5.14",
7
+ "version": "9.5.14",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "esteban.230@hotmail.com",
12
+ "package": "@fluentui/react-popover",
13
+ "commit": "ec0d97e409cb5fd5af6c92c6e271d8fa20816aff",
14
+ "comment": "fix: preventDefault when closing the popover surface to avoid closing parent dialogs."
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-popover",
19
+ "comment": "Bump @fluentui/react-portal to v9.2.10",
20
+ "commit": "3f088b7b09988e7c05af1c953021acc94c273026"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-popover",
25
+ "comment": "Bump @fluentui/react-positioning to v9.5.13",
26
+ "commit": "3f088b7b09988e7c05af1c953021acc94c273026"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-popover",
31
+ "comment": "Bump @fluentui/react-shared-contexts to v9.5.0",
32
+ "commit": "3f088b7b09988e7c05af1c953021acc94c273026"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-popover",
37
+ "comment": "Bump @fluentui/react-tabster to v9.7.3",
38
+ "commit": "3f088b7b09988e7c05af1c953021acc94c273026"
39
+ }
40
+ ],
41
+ "none": [
42
+ {
43
+ "author": "olfedias@microsoft.com",
44
+ "package": "@fluentui/react-popover",
45
+ "commit": "69e0617a93cb44ef42f3bd19284b7dc5fe27fed3",
46
+ "comment": "chore: update test-ssr script"
47
+ }
48
+ ]
49
+ }
50
+ },
51
+ {
52
+ "date": "Thu, 18 May 2023 13:11:08 GMT",
53
+ "tag": "@fluentui/react-popover_v9.5.13",
54
+ "version": "9.5.13",
55
+ "comments": {
56
+ "patch": [
57
+ {
58
+ "author": "beachball",
59
+ "package": "@fluentui/react-popover",
60
+ "comment": "Bump @fluentui/react-portal to v9.2.9",
61
+ "commit": "1e6f5c8eec4b67c051fb3aa429e303115570ae4d"
62
+ },
63
+ {
64
+ "author": "beachball",
65
+ "package": "@fluentui/react-popover",
66
+ "comment": "Bump @fluentui/react-tabster to v9.7.2",
67
+ "commit": "1e6f5c8eec4b67c051fb3aa429e303115570ae4d"
68
+ }
69
+ ]
70
+ }
71
+ },
72
+ {
73
+ "date": "Thu, 18 May 2023 00:39:10 GMT",
6
74
  "tag": "@fluentui/react-popover_v9.5.12",
7
75
  "version": "9.5.12",
8
76
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,35 @@
1
1
  # Change Log - @fluentui/react-popover
2
2
 
3
- This log was last generated on Thu, 18 May 2023 00:35:41 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 24 May 2023 20:42:42 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.5.14](https://github.com/microsoft/fluentui/tree/@fluentui/react-popover_v9.5.14)
8
+
9
+ Wed, 24 May 2023 20:42:42 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-popover_v9.5.13..@fluentui/react-popover_v9.5.14)
11
+
12
+ ### Patches
13
+
14
+ - fix: preventDefault when closing the popover surface to avoid closing parent dialogs. ([PR #27832](https://github.com/microsoft/fluentui/pull/27832) by esteban.230@hotmail.com)
15
+ - Bump @fluentui/react-portal to v9.2.10 ([PR #27989](https://github.com/microsoft/fluentui/pull/27989) by beachball)
16
+ - Bump @fluentui/react-positioning to v9.5.13 ([PR #27989](https://github.com/microsoft/fluentui/pull/27989) by beachball)
17
+ - Bump @fluentui/react-shared-contexts to v9.5.0 ([PR #27989](https://github.com/microsoft/fluentui/pull/27989) by beachball)
18
+ - Bump @fluentui/react-tabster to v9.7.3 ([PR #27989](https://github.com/microsoft/fluentui/pull/27989) by beachball)
19
+
20
+ ## [9.5.13](https://github.com/microsoft/fluentui/tree/@fluentui/react-popover_v9.5.13)
21
+
22
+ Thu, 18 May 2023 13:11:08 GMT
23
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-popover_v9.5.12..@fluentui/react-popover_v9.5.13)
24
+
25
+ ### Patches
26
+
27
+ - Bump @fluentui/react-portal to v9.2.9 ([PR #27540](https://github.com/microsoft/fluentui/pull/27540) by beachball)
28
+ - Bump @fluentui/react-tabster to v9.7.2 ([PR #27540](https://github.com/microsoft/fluentui/pull/27540) by beachball)
29
+
7
30
  ## [9.5.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-popover_v9.5.12)
8
31
 
9
- Thu, 18 May 2023 00:35:41 GMT
32
+ Thu, 18 May 2023 00:39:10 GMT
10
33
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-popover_v9.5.11..@fluentui/react-popover_v9.5.12)
11
34
 
12
35
  ### Patches
@@ -70,6 +70,7 @@ export const usePopoverSurface_unstable = (props, ref) => {
70
70
  // only close if the event happened inside the current popover
71
71
  // If using a stack of inline popovers, the user should call `stopPropagation` to avoid dismissing the entire stack
72
72
  if (e.key === 'Escape' && ((_contentRef_current = contentRef.current) === null || _contentRef_current === void 0 ? void 0 : _contentRef_current.contains(e.target))) {
73
+ e.preventDefault();
73
74
  setOpen(e, false);
74
75
  }
75
76
  onKeyDownOriginal === null || onKeyDownOriginal === void 0 ? void 0 : onKeyDownOriginal(e);
@@ -1 +1 @@
1
- {"version":3,"names":["React","getNativeElementProps","useMergedRefs","useModalAttributes","usePopoverContext_unstable","usePopoverSurface_unstable","props","ref","contentRef","context","openOnHover","setOpen","mountNode","arrowRef","size","withArrow","appearance","trapFocus","inertTrapFocus","inline","modalAttributes","legacyTrapFocus","alwaysFocusable","state","components","root","role","undefined","onMouseEnter","onMouseEnterOriginal","onMouseLeave","onMouseLeaveOriginal","onKeyDown","onKeyDownOriginal","e","_contentRef_current","key","current","contains","target"],"sources":["../../../src/components/PopoverSurface/usePopoverSurface.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopoverContext_unstable } from '../../popoverContext';\nimport type { PopoverSurfaceProps, PopoverSurfaceState } from './PopoverSurface.types';\n\n/**\n * Create the state required to render PopoverSurface.\n *\n * The returned state can be modified with hooks such as usePopoverSurfaceStyles_unstable,\n * before being passed to renderPopoverSurface_unstable.\n *\n * @param props - props from this instance of PopoverSurface\n * @param ref - reference to root HTMLDivElement of PopoverSurface\n */\nexport const usePopoverSurface_unstable = (\n props: PopoverSurfaceProps,\n ref: React.Ref<HTMLDivElement>,\n): PopoverSurfaceState => {\n const contentRef = usePopoverContext_unstable(context => context.contentRef);\n const openOnHover = usePopoverContext_unstable(context => context.openOnHover);\n const setOpen = usePopoverContext_unstable(context => context.setOpen);\n const mountNode = usePopoverContext_unstable(context => context.mountNode);\n const arrowRef = usePopoverContext_unstable(context => context.arrowRef);\n const size = usePopoverContext_unstable(context => context.size);\n const withArrow = usePopoverContext_unstable(context => context.withArrow);\n const appearance = usePopoverContext_unstable(context => context.appearance);\n const trapFocus = usePopoverContext_unstable(context => context.trapFocus);\n const inertTrapFocus = usePopoverContext_unstable(context => context.inertTrapFocus);\n const inline = usePopoverContext_unstable(context => context.inline);\n const { modalAttributes } = useModalAttributes({\n trapFocus,\n legacyTrapFocus: !inertTrapFocus,\n alwaysFocusable: !trapFocus,\n });\n\n const state: PopoverSurfaceState = {\n inline,\n appearance,\n withArrow,\n size,\n arrowRef,\n mountNode,\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref: useMergedRefs(ref, contentRef),\n role: trapFocus ? 'dialog' : 'group',\n 'aria-modal': trapFocus ? true : undefined,\n ...modalAttributes,\n ...props,\n }),\n };\n\n const {\n onMouseEnter: onMouseEnterOriginal,\n onMouseLeave: onMouseLeaveOriginal,\n onKeyDown: onKeyDownOriginal,\n } = state.root;\n state.root.onMouseEnter = (e: React.MouseEvent<HTMLDivElement>) => {\n if (openOnHover) {\n setOpen(e, true);\n }\n\n onMouseEnterOriginal?.(e);\n };\n\n state.root.onMouseLeave = (e: React.MouseEvent<HTMLDivElement>) => {\n if (openOnHover) {\n setOpen(e, false);\n }\n\n onMouseLeaveOriginal?.(e);\n };\n\n state.root.onKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n // only close if the event happened inside the current popover\n // If using a stack of inline popovers, the user should call `stopPropagation` to avoid dismissing the entire stack\n if (e.key === 'Escape' && contentRef.current?.contains(e.target as HTMLDivElement)) {\n setOpen(e, false);\n }\n\n onKeyDownOriginal?.(e);\n };\n\n return state;\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,qBAAqB,EAAEC,aAAa,QAAQ;AACrD,SAASC,kBAAkB,QAAQ;AACnC,SAASC,0BAA0B,QAAQ;AAG3C;;;;;;;;;AASA,OAAO,MAAMC,0BAAA,GAA6BA,CACxCC,KAAA,EACAC,GAAA,KACwB;EACxB,MAAMC,UAAA,GAAaJ,0BAAA,CAA2BK,OAAA,IAAWA,OAAA,CAAQD,UAAU;EAC3E,MAAME,WAAA,GAAcN,0BAAA,CAA2BK,OAAA,IAAWA,OAAA,CAAQC,WAAW;EAC7E,MAAMC,OAAA,GAAUP,0BAAA,CAA2BK,OAAA,IAAWA,OAAA,CAAQE,OAAO;EACrE,MAAMC,SAAA,GAAYR,0BAAA,CAA2BK,OAAA,IAAWA,OAAA,CAAQG,SAAS;EACzE,MAAMC,QAAA,GAAWT,0BAAA,CAA2BK,OAAA,IAAWA,OAAA,CAAQI,QAAQ;EACvE,MAAMC,IAAA,GAAOV,0BAAA,CAA2BK,OAAA,IAAWA,OAAA,CAAQK,IAAI;EAC/D,MAAMC,SAAA,GAAYX,0BAAA,CAA2BK,OAAA,IAAWA,OAAA,CAAQM,SAAS;E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AAG,KAAK;IAClB;IAEAH,oBAAA,aAAAA,oBAAA,uBAAAA,oBAAA,CAAuBG,CAAA;EACzB;EAEAX,KAAA,CAAME,IAAI,CAACO,SAAS,GAAIE,CAAA,IAA2C;QAGvCC,mBAAA;IAF1B;IACA;IACA,IAAID,CAAA,CAAEE,GAAG,KAAK,aAAY,CAAAD,mBAAA,GAAA3B,UAAA,CAAW6B,OAAO,cAAlBF,mBAAA,uBAAAA,mBAAA,CAAoBG,QAAA,CAASJ,CAAA,CAAEK,MAAM,IAAqB;MAClF5B,OAAA,CAAQuB,CAAA,EAAG,KAAK;IAClB;IAEAD,iBAAA,aAAAA,iBAAA,uBAAAA,iBAAA,CAAoBC,CAAA;EACtB;EAEA,OAAOX,KAAA;AACT"}
1
+ {"version":3,"names":["React","getNativeElementProps","useMergedRefs","useModalAttributes","usePopoverContext_unstable","usePopoverSurface_unstable","props","ref","contentRef","context","openOnHover","setOpen","mountNode","arrowRef","size","withArrow","appearance","trapFocus","inertTrapFocus","inline","modalAttributes","legacyTrapFocus","alwaysFocusable","state","components","root","role","undefined","onMouseEnter","onMouseEnterOriginal","onMouseLeave","onMouseLeaveOriginal","onKeyDown","onKeyDownOriginal","e","_contentRef_current","key","current","contains","target","preventDefault"],"sources":["../../../src/components/PopoverSurface/usePopoverSurface.ts"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopoverContext_unstable } from '../../popoverContext';\nimport type { PopoverSurfaceProps, PopoverSurfaceState } from './PopoverSurface.types';\n\n/**\n * Create the state required to render PopoverSurface.\n *\n * The returned state can be modified with hooks such as usePopoverSurfaceStyles_unstable,\n * before being passed to renderPopoverSurface_unstable.\n *\n * @param props - props from this instance of PopoverSurface\n * @param ref - reference to root HTMLDivElement of PopoverSurface\n */\nexport const usePopoverSurface_unstable = (\n props: PopoverSurfaceProps,\n ref: React.Ref<HTMLDivElement>,\n): PopoverSurfaceState => {\n const contentRef = usePopoverContext_unstable(context => context.contentRef);\n const openOnHover = usePopoverContext_unstable(context => context.openOnHover);\n const setOpen = usePopoverContext_unstable(context => context.setOpen);\n const mountNode = usePopoverContext_unstable(context => context.mountNode);\n const arrowRef = usePopoverContext_unstable(context => context.arrowRef);\n const size = usePopoverContext_unstable(context => context.size);\n const withArrow = usePopoverContext_unstable(context => context.withArrow);\n const appearance = usePopoverContext_unstable(context => context.appearance);\n const trapFocus = usePopoverContext_unstable(context => context.trapFocus);\n const inertTrapFocus = usePopoverContext_unstable(context => context.inertTrapFocus);\n const inline = usePopoverContext_unstable(context => context.inline);\n const { modalAttributes } = useModalAttributes({\n trapFocus,\n legacyTrapFocus: !inertTrapFocus,\n alwaysFocusable: !trapFocus,\n });\n\n const state: PopoverSurfaceState = {\n inline,\n appearance,\n withArrow,\n size,\n arrowRef,\n mountNode,\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref: useMergedRefs(ref, contentRef),\n role: trapFocus ? 'dialog' : 'group',\n 'aria-modal': trapFocus ? true : undefined,\n ...modalAttributes,\n ...props,\n }),\n };\n\n const {\n onMouseEnter: onMouseEnterOriginal,\n onMouseLeave: onMouseLeaveOriginal,\n onKeyDown: onKeyDownOriginal,\n } = state.root;\n state.root.onMouseEnter = (e: React.MouseEvent<HTMLDivElement>) => {\n if (openOnHover) {\n setOpen(e, true);\n }\n\n onMouseEnterOriginal?.(e);\n };\n\n state.root.onMouseLeave = (e: React.MouseEvent<HTMLDivElement>) => {\n if (openOnHover) {\n setOpen(e, false);\n }\n\n onMouseLeaveOriginal?.(e);\n };\n\n state.root.onKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n // only close if the event happened inside the current popover\n // If using a stack of inline popovers, the user should call `stopPropagation` to avoid dismissing the entire stack\n if (e.key === 'Escape' && contentRef.current?.contains(e.target as HTMLDivElement)) {\n e.preventDefault();\n setOpen(e, false);\n }\n\n onKeyDownOriginal?.(e);\n };\n\n return state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KAAA;AACT"}
@@ -64,6 +64,7 @@ const usePopoverSurface_unstable = (props, ref)=>{
64
64
  // only close if the event happened inside the current popover
65
65
  // If using a stack of inline popovers, the user should call `stopPropagation` to avoid dismissing the entire stack
66
66
  if (e.key === 'Escape' && ((_contentRef_current = contentRef.current) === null || _contentRef_current === void 0 ? void 0 : _contentRef_current.contains(e.target))) {
67
+ e.preventDefault();
67
68
  setOpen(e, false);
68
69
  }
69
70
  onKeyDownOriginal === null || onKeyDownOriginal === void 0 ? void 0 : onKeyDownOriginal(e);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../lib/components/PopoverSurface/usePopoverSurface.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopoverContext_unstable } from '../../popoverContext';\n/**\n * Create the state required to render PopoverSurface.\n *\n * The returned state can be modified with hooks such as usePopoverSurfaceStyles_unstable,\n * before being passed to renderPopoverSurface_unstable.\n *\n * @param props - props from this instance of PopoverSurface\n * @param ref - reference to root HTMLDivElement of PopoverSurface\n */\nexport const usePopoverSurface_unstable = (props, ref) => {\n const contentRef = usePopoverContext_unstable(context => context.contentRef);\n const openOnHover = usePopoverContext_unstable(context => context.openOnHover);\n const setOpen = usePopoverContext_unstable(context => context.setOpen);\n const mountNode = usePopoverContext_unstable(context => context.mountNode);\n const arrowRef = usePopoverContext_unstable(context => context.arrowRef);\n const size = usePopoverContext_unstable(context => context.size);\n const withArrow = usePopoverContext_unstable(context => context.withArrow);\n const appearance = usePopoverContext_unstable(context => context.appearance);\n const trapFocus = usePopoverContext_unstable(context => context.trapFocus);\n const inertTrapFocus = usePopoverContext_unstable(context => context.inertTrapFocus);\n const inline = usePopoverContext_unstable(context => context.inline);\n const {\n modalAttributes\n } = useModalAttributes({\n trapFocus,\n legacyTrapFocus: !inertTrapFocus,\n alwaysFocusable: !trapFocus\n });\n const state = {\n inline,\n appearance,\n withArrow,\n size,\n arrowRef,\n mountNode,\n components: {\n root: 'div'\n },\n root: getNativeElementProps('div', {\n ref: useMergedRefs(ref, contentRef),\n role: trapFocus ? 'dialog' : 'group',\n 'aria-modal': trapFocus ? true : undefined,\n ...modalAttributes,\n ...props\n })\n };\n const {\n onMouseEnter: onMouseEnterOriginal,\n onMouseLeave: onMouseLeaveOriginal,\n onKeyDown: onKeyDownOriginal\n } = state.root;\n state.root.onMouseEnter = e => {\n if (openOnHover) {\n setOpen(e, true);\n }\n onMouseEnterOriginal === null || onMouseEnterOriginal === void 0 ? void 0 : onMouseEnterOriginal(e);\n };\n state.root.onMouseLeave = e => {\n if (openOnHover) {\n setOpen(e, false);\n }\n onMouseLeaveOriginal === null || onMouseLeaveOriginal === void 0 ? void 0 : onMouseLeaveOriginal(e);\n };\n state.root.onKeyDown = e => {\n var _contentRef_current;\n // only close if the event happened inside the current popover\n // If using a stack of inline popovers, the user should call `stopPropagation` to avoid dismissing the entire stack\n if (e.key === 'Escape' && ((_contentRef_current = contentRef.current) === null || _contentRef_current === void 0 ? void 0 : _contentRef_current.contains(e.target))) {\n setOpen(e, false);\n }\n onKeyDownOriginal === null || onKeyDownOriginal === void 0 ? void 0 : onKeyDownOriginal(e);\n };\n return state;\n};\n//# sourceMappingURL=usePopoverSurface.js.map"],"names":["usePopoverSurface_unstable","props","ref","contentRef","usePopoverContext_unstable","context","openOnHover","setOpen","mountNode","arrowRef","size","withArrow","appearance","trapFocus","inertTrapFocus","inline","modalAttributes","useModalAttributes","legacyTrapFocus","alwaysFocusable","state","components","root","getNativeElementProps","useMergedRefs","role","undefined","onMouseEnter","onMouseEnterOriginal","onMouseLeave","onMouseLeaveOriginal","onKeyDown","onKeyDownOriginal","e","_contentRef_current","key","current","contains","target"],"mappings":";;;;+BAaaA;;aAAAA;;;6DAbU;gCAC8B;8BAClB;gCACQ;AAUpC,MAAMA,6BAA6B,CAACC,OAAOC,MAAQ;IACxD,MAAMC,aAAaC,IAAAA,0CAA0B,EAACC,C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GAAGZ,MAAME,IAAI;IACdF,MAAME,IAAI,CAACK,YAAY,GAAGM,CAAAA,IAAK;QAC7B,IAAI3B,aAAa;YACfC,QAAQ0B,GAAG,IAAI;QACjB,CAAC;QACDL,yBAAyB,IAAI,IAAIA,yBAAyB,KAAK,IAAI,KAAK,IAAIA,qBAAqBK,EAAE;IACrG;IACAb,MAAME,IAAI,CAACO,YAAY,GAAGI,CAAAA,IAAK;QAC7B,IAAI3B,aAAa;YACfC,QAAQ0B,GAAG,KAAK;QAClB,CAAC;QACDH,yBAAyB,IAAI,IAAIA,yBAAyB,KAAK,IAAI,KAAK,IAAIA,qBAAqBG,EAAE;IACrG;IACAb,MAAME,IAAI,CAACS,SAAS,GAAGE,CAAAA,IAAK;QAC1B,IAAIC;QACJ,8DAA8D;QAC9D,mHAAmH;QACnH,IAAID,EAAEE,GAAG,KAAK,YAAa,CAAA,AAACD,CAAAA,sBAAsB/B,WAAWiC,OAAO,AAAD,MAAO,IAAI,IAAIF,wBAAwB,KAAK,IAAI,KAAK,IAAIA,oBAAoBG,QAAQ,CAACJ,EAAEK,MAAM,CAAC,AAAD,GAAI;YACnK/B,QAAQ0B,GAAG,KAAK;QAClB,CAAC;QACDD,sBAAsB,IAAI,IAAIA,sBAAsB,KAAK,IAAI,KAAK,IAAIA,kBAAkBC,EAAE;IAC5F;IACA,OAAOb;AACT,GACA,6CAA6C"}
1
+ {"version":3,"sources":["../../../lib/components/PopoverSurface/usePopoverSurface.js"],"sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useMergedRefs } from '@fluentui/react-utilities';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopoverContext_unstable } from '../../popoverContext';\n/**\n * Create the state required to render PopoverSurface.\n *\n * The returned state can be modified with hooks such as usePopoverSurfaceStyles_unstable,\n * before being passed to renderPopoverSurface_unstable.\n *\n * @param props - props from this instance of PopoverSurface\n * @param ref - reference to root HTMLDivElement of PopoverSurface\n */\nexport const usePopoverSurface_unstable = (props, ref) => {\n const contentRef = usePopoverContext_unstable(context => context.contentRef);\n const openOnHover = usePopoverContext_unstable(context => context.openOnHover);\n const setOpen = usePopoverContext_unstable(context => context.setOpen);\n const mountNode = usePopoverContext_unstable(context => context.mountNode);\n const arrowRef = usePopoverContext_unstable(context => context.arrowRef);\n const size = usePopoverContext_unstable(context => context.size);\n const withArrow = usePopoverContext_unstable(context => context.withArrow);\n const appearance = usePopoverContext_unstable(context => context.appearance);\n const trapFocus = usePopoverContext_unstable(context => context.trapFocus);\n const inertTrapFocus = usePopoverContext_unstable(context => context.inertTrapFocus);\n const inline = usePopoverContext_unstable(context => context.inline);\n const {\n modalAttributes\n } = useModalAttributes({\n trapFocus,\n legacyTrapFocus: !inertTrapFocus,\n alwaysFocusable: !trapFocus\n });\n const state = {\n inline,\n appearance,\n withArrow,\n size,\n arrowRef,\n mountNode,\n components: {\n root: 'div'\n },\n root: getNativeElementProps('div', {\n ref: useMergedRefs(ref, contentRef),\n role: trapFocus ? 'dialog' : 'group',\n 'aria-modal': trapFocus ? true : undefined,\n ...modalAttributes,\n ...props\n })\n };\n const {\n onMouseEnter: onMouseEnterOriginal,\n onMouseLeave: onMouseLeaveOriginal,\n onKeyDown: onKeyDownOriginal\n } = state.root;\n state.root.onMouseEnter = e => {\n if (openOnHover) {\n setOpen(e, true);\n }\n onMouseEnterOriginal === null || onMouseEnterOriginal === void 0 ? void 0 : onMouseEnterOriginal(e);\n };\n state.root.onMouseLeave = e => {\n if (openOnHover) {\n setOpen(e, false);\n }\n onMouseLeaveOriginal === null || onMouseLeaveOriginal === void 0 ? void 0 : onMouseLeaveOriginal(e);\n };\n state.root.onKeyDown = e => {\n var _contentRef_current;\n // only close if the event happened inside the current popover\n // If using a stack of inline popovers, the user should call `stopPropagation` to avoid dismissing the entire stack\n if (e.key === 'Escape' && ((_contentRef_current = contentRef.current) === null || _contentRef_current === void 0 ? void 0 : _contentRef_current.contains(e.target))) {\n e.preventDefault();\n setOpen(e, false);\n }\n onKeyDownOriginal === null || onKeyDownOriginal === void 0 ? void 0 : onKeyDownOriginal(e);\n };\n return state;\n};\n//# sourceMappingURL=usePopoverSurface.js.map"],"names":["usePopoverSurface_unstable","props","ref","contentRef","usePopoverContext_unstable","context","openOnHover","setOpen","mountNode","arrowRef","size","withArrow","appearance","trapFocus","inertTrapFocus","inline","modalAttributes","useModalAttributes","legacyTrapFocus","alwaysFocusable","state","components","root","getNativeElementProps","useMergedRefs","role","undefined","onMouseEnter","onMouseEnterOriginal","onMouseLeave","onMouseLeaveOriginal","onKeyDown","onKeyDownOriginal","e","_contentRef_current","key","current","contains","target","preventDefault"],"mappings":";;;;+BAaaA;;aAAAA;;;6DAbU;gCAC8B;8BAClB;gCACQ;AAUpC,MAAMA,6BAA6B,CAACC,OAAOC,MAAQ;IACxD,MAAMC,aAAaC,IAAAA,0CAA0B,EAACC,CAAAA,UAAWA,QAAQF,UAAU;IAC3E,MAAMG,cAAcF,IAAAA,0CAA0B,EAACC,CAAAA,UAAWA,QAAQC,WAAW;IAC7E,MAAMC,UAAUH,IAAAA,0CAA0B,EAACC,CAAAA,UAAWA,QAAQE,OAAO;IACrE,MAAMC,YAAYJ,IAAAA,0CAA0B,EAACC,CAAAA,UAAWA,QAAQG,SAAS;IACzE,MAAMC,WAAWL,IAAAA,0CAA0B,EAACC,CAAAA,UAAWA,QAAQI,QAAQ;IACvE,MAAMC,OAAON,IAAAA,0CAA0B,EAACC,CAAAA,UAAWA,QAAQK,IAAI;IAC/D,MAAMC,YAAYP,IAAAA,0CAA0B,EAACC,CAAAA,UAAWA,QAAQM,SAAS;IACzE,MAAMC,aAAaR,IAAAA,0CAA0B,EAACC,CAAAA,UAAWA,QAAQO,UAAU;IAC3E,MAAMC,YAAYT,IAAAA,0CAA0B,EAACC,CAAAA,UAAWA,QAAQQ,SAAS;IACzE,MAAMC,iBAAiBV,IAAAA,0CAA0B,EAACC,CAAAA,UAAWA,QAAQS,cAAc;IACnF,MAAMC,SAASX,IAAAA,0CAA0B,EA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YACnKL,EAAEM,cAAc;YAChBhC,QAAQ0B,GAAG,KAAK;QAClB,CAAC;QACDD,sBAAsB,IAAI,IAAIA,sBAAsB,KAAK,IAAI,KAAK,IAAIA,kBAAkBC,EAAE;IAC5F;IACA,OAAOb;AACT,GACA,6CAA6C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-popover",
3
- "version": "9.5.12",
3
+ "version": "9.5.14",
4
4
  "description": "Popover component for Fluent UI",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -25,7 +25,7 @@
25
25
  "test": "jest --passWithNoTests",
26
26
  "type-check": "tsc -b tsconfig.json",
27
27
  "generate-api": "just-scripts generate-api",
28
- "test-ssr": "test-ssr ./stories/**/*.stories.tsx"
28
+ "test-ssr": "test-ssr \"./stories/**/*.stories.tsx\""
29
29
  },
30
30
  "devDependencies": {
31
31
  "@fluentui/eslint-plugin": "*",
@@ -39,10 +39,10 @@
39
39
  "@fluentui/keyboard-keys": "^9.0.3",
40
40
  "@fluentui/react-aria": "^9.3.20",
41
41
  "@fluentui/react-context-selector": "^9.1.20",
42
- "@fluentui/react-portal": "^9.2.8",
43
- "@fluentui/react-positioning": "^9.5.12",
44
- "@fluentui/react-shared-contexts": "^9.4.0",
45
- "@fluentui/react-tabster": "^9.7.1",
42
+ "@fluentui/react-portal": "^9.2.10",
43
+ "@fluentui/react-positioning": "^9.5.13",
44
+ "@fluentui/react-shared-contexts": "^9.5.0",
45
+ "@fluentui/react-tabster": "^9.7.3",
46
46
  "@fluentui/react-theme": "^9.1.8",
47
47
  "@fluentui/react-utilities": "^9.9.0",
48
48
  "@fluentui/react-jsx-runtime": "9.0.0-alpha.4",