@fluentui/react-dialog 9.7.7 → 9.7.8

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.
package/CHANGELOG.json CHANGED
@@ -2,7 +2,58 @@
2
2
  "name": "@fluentui/react-dialog",
3
3
  "entries": [
4
4
  {
5
- "date": "Mon, 09 Oct 2023 20:41:55 GMT",
5
+ "date": "Wed, 11 Oct 2023 13:50:03 GMT",
6
+ "tag": "@fluentui/react-dialog_v9.7.8",
7
+ "version": "9.7.8",
8
+ "comments": {
9
+ "patch": [
10
+ {
11
+ "author": "bernardo.sunderhus@gmail.com",
12
+ "package": "@fluentui/react-dialog",
13
+ "commit": "b4466a0b9d3568e8e1ee1d814db5c8449dfd65b8",
14
+ "comment": "chore: use default prevention instead of stop propagation for Escape handling"
15
+ },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-dialog",
19
+ "comment": "Bump @fluentui/react-utilities to v9.15.0",
20
+ "commit": "b4466a0b9d3568e8e1ee1d814db5c8449dfd65b8"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-dialog",
25
+ "comment": "Bump @fluentui/react-jsx-runtime to v9.0.16",
26
+ "commit": "b4466a0b9d3568e8e1ee1d814db5c8449dfd65b8"
27
+ },
28
+ {
29
+ "author": "beachball",
30
+ "package": "@fluentui/react-dialog",
31
+ "comment": "Bump @fluentui/react-context-selector to v9.1.40",
32
+ "commit": "b4466a0b9d3568e8e1ee1d814db5c8449dfd65b8"
33
+ },
34
+ {
35
+ "author": "beachball",
36
+ "package": "@fluentui/react-dialog",
37
+ "comment": "Bump @fluentui/react-aria to v9.3.42",
38
+ "commit": "b4466a0b9d3568e8e1ee1d814db5c8449dfd65b8"
39
+ },
40
+ {
41
+ "author": "beachball",
42
+ "package": "@fluentui/react-dialog",
43
+ "comment": "Bump @fluentui/react-tabster to v9.13.6",
44
+ "commit": "b4466a0b9d3568e8e1ee1d814db5c8449dfd65b8"
45
+ },
46
+ {
47
+ "author": "beachball",
48
+ "package": "@fluentui/react-dialog",
49
+ "comment": "Bump @fluentui/react-portal to v9.3.23",
50
+ "commit": "b4466a0b9d3568e8e1ee1d814db5c8449dfd65b8"
51
+ }
52
+ ]
53
+ }
54
+ },
55
+ {
56
+ "date": "Mon, 09 Oct 2023 20:45:41 GMT",
6
57
  "tag": "@fluentui/react-dialog_v9.7.7",
7
58
  "version": "9.7.7",
8
59
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,27 @@
1
1
  # Change Log - @fluentui/react-dialog
2
2
 
3
- This log was last generated on Mon, 09 Oct 2023 20:41:55 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 11 Oct 2023 13:50:03 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.7.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.7.8)
8
+
9
+ Wed, 11 Oct 2023 13:50:03 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.7.7..@fluentui/react-dialog_v9.7.8)
11
+
12
+ ### Patches
13
+
14
+ - chore: use default prevention instead of stop propagation for Escape handling ([PR #29262](https://github.com/microsoft/fluentui/pull/29262) by bernardo.sunderhus@gmail.com)
15
+ - Bump @fluentui/react-utilities to v9.15.0 ([PR #29262](https://github.com/microsoft/fluentui/pull/29262) by beachball)
16
+ - Bump @fluentui/react-jsx-runtime to v9.0.16 ([PR #29262](https://github.com/microsoft/fluentui/pull/29262) by beachball)
17
+ - Bump @fluentui/react-context-selector to v9.1.40 ([PR #29262](https://github.com/microsoft/fluentui/pull/29262) by beachball)
18
+ - Bump @fluentui/react-aria to v9.3.42 ([PR #29262](https://github.com/microsoft/fluentui/pull/29262) by beachball)
19
+ - Bump @fluentui/react-tabster to v9.13.6 ([PR #29262](https://github.com/microsoft/fluentui/pull/29262) by beachball)
20
+ - Bump @fluentui/react-portal to v9.3.23 ([PR #29262](https://github.com/microsoft/fluentui/pull/29262) by beachball)
21
+
7
22
  ## [9.7.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-dialog_v9.7.7)
8
23
 
9
- Mon, 09 Oct 2023 20:41:55 GMT
24
+ Mon, 09 Oct 2023 20:45:41 GMT
10
25
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-dialog_v9.7.6..@fluentui/react-dialog_v9.7.7)
11
26
 
12
27
  ### Patches
@@ -42,7 +42,7 @@ import { Escape } from '@fluentui/keyboard-keys';
42
42
  });
43
43
  // stop propagation to avoid conflicting with other elements that listen for `Escape`
44
44
  // e,g: nested Dialog, Popover, Menu and Tooltip
45
- event.stopPropagation();
45
+ event.preventDefault();
46
46
  }
47
47
  });
48
48
  const backdrop = slot.optional(props.backdrop, {
@@ -1 +1 @@
1
- {"version":3,"sources":["useDialogSurface.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n useEventCallback,\n useMergedRefs,\n isResolvedShorthand,\n slot,\n getIntrinsicElementProps,\n} from '@fluentui/react-utilities';\nimport type { DialogSurfaceElement, DialogSurfaceProps, DialogSurfaceState } from './DialogSurface.types';\nimport { useDialogContext_unstable } from '../../contexts';\nimport { Escape } from '@fluentui/keyboard-keys';\n\n/**\n * Create the state required to render DialogSurface.\n *\n * The returned state can be modified with hooks such as useDialogSurfaceStyles_unstable,\n * before being passed to renderDialogSurface_unstable.\n *\n * @param props - props from this instance of DialogSurface\n * @param ref - reference to root HTMLElement of DialogSurface\n */\nexport const useDialogSurface_unstable = (\n props: DialogSurfaceProps,\n ref: React.Ref<DialogSurfaceElement>,\n): DialogSurfaceState => {\n const modalType = useDialogContext_unstable(ctx => ctx.modalType);\n const isNestedDialog = useDialogContext_unstable(ctx => ctx.isNestedDialog);\n const modalAttributes = useDialogContext_unstable(ctx => ctx.modalAttributes);\n const dialogRef = useDialogContext_unstable(ctx => ctx.dialogRef);\n const open = useDialogContext_unstable(ctx => ctx.open);\n const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);\n const dialogTitleID = useDialogContext_unstable(ctx => ctx.dialogTitleId);\n\n const handledBackdropClick = useEventCallback((event: React.MouseEvent<HTMLDivElement>) => {\n if (isResolvedShorthand(props.backdrop)) {\n props.backdrop.onClick?.(event);\n }\n if (modalType === 'modal' && !event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n open: false,\n type: 'backdropClick',\n });\n }\n });\n\n const handleKeyDown = useEventCallback((event: React.KeyboardEvent<HTMLDivElement>) => {\n props.onKeyDown?.(event);\n\n if (event.key === Escape && !event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n open: false,\n type: 'escapeKeyDown',\n });\n // stop propagation to avoid conflicting with other elements that listen for `Escape`\n // e,g: nested Dialog, Popover, Menu and Tooltip\n event.stopPropagation();\n }\n });\n\n const backdrop = slot.optional(props.backdrop, {\n renderByDefault: open && modalType !== 'non-modal',\n defaultProps: {\n 'aria-hidden': 'true',\n },\n elementType: 'div',\n });\n if (backdrop) {\n backdrop.onClick = handledBackdropClick;\n }\n return {\n components: { backdrop: 'div', root: 'div' },\n backdrop,\n isNestedDialog,\n mountNode: props.mountNode,\n root: slot.always(\n getIntrinsicElementProps('div', {\n tabIndex: -1, // https://github.com/microsoft/fluentui/issues/25150\n 'aria-modal': modalType !== 'non-modal',\n role: modalType === 'alert' ? 'alertdialog' : 'dialog',\n 'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID,\n ...props,\n ...modalAttributes,\n onKeyDown: handleKeyDown,\n // FIXME:\n // `DialogSurfaceElement` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: useMergedRefs(ref, dialogRef) as React.Ref<HTMLDivElement>,\n }),\n { elementType: 'div' },\n ),\n };\n};\n"],"names":["React","useEventCallback","useMergedRefs","isResolvedShorthand","slot","getIntrinsicElementProps","useDialogContext_unstable","Escape","useDialogSurface_unstable","props","ref","modalType","ctx","isNestedDialog","modalAttributes","dialogRef","open","requestOpenChange","dialogTitleID","dialogTitleId","handledBackdropClick","event","backdrop","onClick","isDefaultPrevented","type","handleKeyDown","onKeyDown","key","stopPropagation","optional","renderByDefault","defaultProps","elementType","components","root","mountNode","always","tabIndex","role","undefined"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,gBAAgB,EAChBC,aAAa,EACbC,mBAAmB,EACnBC,IAAI,EACJC,wBAAwB,QACnB,4BAA4B;AAEnC,SAASC,yBAAyB,QAAQ,iBAAiB;AAC3D,SAASC,MAAM,QAAQ,0BAA0B;AAEjD;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;IAEA,MAAMC,YAAYL,0BAA0BM,CAAAA,MAAOA,IAAID,SAAS;IAChE,MAAME,iBAAiBP,0BAA0BM,CAAAA,MAAOA,IAAIC,cAAc;IAC1E,MAAMC,kBAAkBR,0BAA0BM,CAAAA,MAAOA,IAAIE,eAAe;IAC5E,MAAMC,YAAYT,0BAA0BM,CAAAA,MAAOA,IAAIG,SAAS;IAChE,MAAMC,OAAOV,0BAA0BM,CAAAA,MAAOA,IAAII,IAAI;IACtD,MAAMC,oBAAoBX,0BAA0BM,CAAAA,MAAOA,IAAIK,iBAAiB;IAChF,MAAMC,gBAAgBZ,0BAA0BM,CAAAA,MAAOA,IAAIO,aAAa;IAExE,MAAMC,uBAAuBnB,iBAAiB,CAACoB;QAC7C,IAAIlB,oBAAoBM,MAAMa,QAAQ,GAAG;gBACvCb,yBAAAA;aAAAA,0BAAAA,CAAAA,kBAAAA,MAAMa,QAAQ,EAACC,OAAO,cAAtBd,8CAAAA,6BAAAA,iBAAyBY;QAC3B;QACA,IAAIV,cAAc,WAAW,CAACU,MAAMG,kBAAkB,IAAI;YACxDP,kBAAkB;gBAChBI;gBACAL,MAAM;gBACNS,MAAM;YACR;QACF;IACF;IAEA,MAAMC,gBAAgBzB,iBAAiB,CAACoB;YACtCZ;SAAAA,mBAAAA,MAAMkB,SAAS,cAAflB,uCAAAA,sBAAAA,OAAkBY;QAElB,IAAIA,MAAMO,GAAG,KAAKrB,UAAU,CAACc,MAAMG,kBAAkB,IAAI;YACvDP,kBAAkB;gBAChBI;gBACAL,MAAM;gBACNS,MAAM;YACR;YACA,qFAAqF;YACrF,gDAAgD;YAChDJ,MAAMQ,eAAe;QACvB;IACF;IAEA,MAAMP,WAAWlB,KAAK0B,QAAQ,CAACrB,MAAMa,QAAQ,EAAE;QAC7CS,iBAAiBf,QAAQL,cAAc;QACvCqB,cAAc;YACZ,eAAe;QACjB;QACAC,aAAa;IACf;IACA,IAAIX,UAAU;QACZA,SAASC,OAAO,GAAGH;IACrB;IACA,OAAO;QACLc,YAAY;YAAEZ,UAAU;YAAOa,MAAM;QAAM;QAC3Cb;QACAT;QACAuB,WAAW3B,MAAM2B,SAAS;QAC1BD,MAAM/B,KAAKiC,MAAM,CACfhC,yBAAyB,OAAO;YAC9BiC,UAAU,CAAC;YACX,cAAc3B,cAAc;YAC5B4B,MAAM5B,cAAc,UAAU,gBAAgB;YAC9C,mBAAmBF,KAAK,CAAC,aAAa,GAAG+B,YAAYtB;YACrD,GAAGT,KAAK;YACR,GAAGK,eAAe;YAClBa,WAAWD;YACX,SAAS;YACT,6FAA6F;YAC7F,4FAA4F;YAC5FhB,KAAKR,cAAcQ,KAAKK;QAC1B,IACA;YAAEkB,aAAa;QAAM;IAEzB;AACF,EAAE"}
1
+ {"version":3,"sources":["useDialogSurface.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n useEventCallback,\n useMergedRefs,\n isResolvedShorthand,\n slot,\n getIntrinsicElementProps,\n} from '@fluentui/react-utilities';\nimport type { DialogSurfaceElement, DialogSurfaceProps, DialogSurfaceState } from './DialogSurface.types';\nimport { useDialogContext_unstable } from '../../contexts';\nimport { Escape } from '@fluentui/keyboard-keys';\n\n/**\n * Create the state required to render DialogSurface.\n *\n * The returned state can be modified with hooks such as useDialogSurfaceStyles_unstable,\n * before being passed to renderDialogSurface_unstable.\n *\n * @param props - props from this instance of DialogSurface\n * @param ref - reference to root HTMLElement of DialogSurface\n */\nexport const useDialogSurface_unstable = (\n props: DialogSurfaceProps,\n ref: React.Ref<DialogSurfaceElement>,\n): DialogSurfaceState => {\n const modalType = useDialogContext_unstable(ctx => ctx.modalType);\n const isNestedDialog = useDialogContext_unstable(ctx => ctx.isNestedDialog);\n const modalAttributes = useDialogContext_unstable(ctx => ctx.modalAttributes);\n const dialogRef = useDialogContext_unstable(ctx => ctx.dialogRef);\n const open = useDialogContext_unstable(ctx => ctx.open);\n const requestOpenChange = useDialogContext_unstable(ctx => ctx.requestOpenChange);\n const dialogTitleID = useDialogContext_unstable(ctx => ctx.dialogTitleId);\n\n const handledBackdropClick = useEventCallback((event: React.MouseEvent<HTMLDivElement>) => {\n if (isResolvedShorthand(props.backdrop)) {\n props.backdrop.onClick?.(event);\n }\n if (modalType === 'modal' && !event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n open: false,\n type: 'backdropClick',\n });\n }\n });\n\n const handleKeyDown = useEventCallback((event: React.KeyboardEvent<HTMLDivElement>) => {\n props.onKeyDown?.(event);\n\n if (event.key === Escape && !event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n open: false,\n type: 'escapeKeyDown',\n });\n // stop propagation to avoid conflicting with other elements that listen for `Escape`\n // e,g: nested Dialog, Popover, Menu and Tooltip\n event.preventDefault();\n }\n });\n\n const backdrop = slot.optional(props.backdrop, {\n renderByDefault: open && modalType !== 'non-modal',\n defaultProps: {\n 'aria-hidden': 'true',\n },\n elementType: 'div',\n });\n if (backdrop) {\n backdrop.onClick = handledBackdropClick;\n }\n return {\n components: { backdrop: 'div', root: 'div' },\n backdrop,\n isNestedDialog,\n mountNode: props.mountNode,\n root: slot.always(\n getIntrinsicElementProps('div', {\n tabIndex: -1, // https://github.com/microsoft/fluentui/issues/25150\n 'aria-modal': modalType !== 'non-modal',\n role: modalType === 'alert' ? 'alertdialog' : 'dialog',\n 'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID,\n ...props,\n ...modalAttributes,\n onKeyDown: handleKeyDown,\n // FIXME:\n // `DialogSurfaceElement` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: useMergedRefs(ref, dialogRef) as React.Ref<HTMLDivElement>,\n }),\n { elementType: 'div' },\n ),\n };\n};\n"],"names":["React","useEventCallback","useMergedRefs","isResolvedShorthand","slot","getIntrinsicElementProps","useDialogContext_unstable","Escape","useDialogSurface_unstable","props","ref","modalType","ctx","isNestedDialog","modalAttributes","dialogRef","open","requestOpenChange","dialogTitleID","dialogTitleId","handledBackdropClick","event","backdrop","onClick","isDefaultPrevented","type","handleKeyDown","onKeyDown","key","preventDefault","optional","renderByDefault","defaultProps","elementType","components","root","mountNode","always","tabIndex","role","undefined"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SACEC,gBAAgB,EAChBC,aAAa,EACbC,mBAAmB,EACnBC,IAAI,EACJC,wBAAwB,QACnB,4BAA4B;AAEnC,SAASC,yBAAyB,QAAQ,iBAAiB;AAC3D,SAASC,MAAM,QAAQ,0BAA0B;AAEjD;;;;;;;;CAQC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;IAEA,MAAMC,YAAYL,0BAA0BM,CAAAA,MAAOA,IAAID,SAAS;IAChE,MAAME,iBAAiBP,0BAA0BM,CAAAA,MAAOA,IAAIC,cAAc;IAC1E,MAAMC,kBAAkBR,0BAA0BM,CAAAA,MAAOA,IAAIE,eAAe;IAC5E,MAAMC,YAAYT,0BAA0BM,CAAAA,MAAOA,IAAIG,SAAS;IAChE,MAAMC,OAAOV,0BAA0BM,CAAAA,MAAOA,IAAII,IAAI;IACtD,MAAMC,oBAAoBX,0BAA0BM,CAAAA,MAAOA,IAAIK,iBAAiB;IAChF,MAAMC,gBAAgBZ,0BAA0BM,CAAAA,MAAOA,IAAIO,aAAa;IAExE,MAAMC,uBAAuBnB,iBAAiB,CAACoB;QAC7C,IAAIlB,oB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@ const useDialogSurface_unstable = (props, ref)=>{
45
45
  });
46
46
  // stop propagation to avoid conflicting with other elements that listen for `Escape`
47
47
  // e,g: nested Dialog, Popover, Menu and Tooltip
48
- event.stopPropagation();
48
+ event.preventDefault();
49
49
  }
50
50
  });
51
51
  const backdrop = _reactutilities.slot.optional(props.backdrop, {
@@ -1 +1 @@
1
- {"version":3,"sources":["useDialogSurface.js"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback, useMergedRefs, isResolvedShorthand, slot, getIntrinsicElementProps } from '@fluentui/react-utilities';\nimport { useDialogContext_unstable } from '../../contexts';\nimport { Escape } from '@fluentui/keyboard-keys';\n/**\n * Create the state required to render DialogSurface.\n *\n * The returned state can be modified with hooks such as useDialogSurfaceStyles_unstable,\n * before being passed to renderDialogSurface_unstable.\n *\n * @param props - props from this instance of DialogSurface\n * @param ref - reference to root HTMLElement of DialogSurface\n */ export const useDialogSurface_unstable = (props, ref)=>{\n const modalType = useDialogContext_unstable((ctx)=>ctx.modalType);\n const isNestedDialog = useDialogContext_unstable((ctx)=>ctx.isNestedDialog);\n const modalAttributes = useDialogContext_unstable((ctx)=>ctx.modalAttributes);\n const dialogRef = useDialogContext_unstable((ctx)=>ctx.dialogRef);\n const open = useDialogContext_unstable((ctx)=>ctx.open);\n const requestOpenChange = useDialogContext_unstable((ctx)=>ctx.requestOpenChange);\n const dialogTitleID = useDialogContext_unstable((ctx)=>ctx.dialogTitleId);\n const handledBackdropClick = useEventCallback((event)=>{\n if (isResolvedShorthand(props.backdrop)) {\n var _props_backdrop_onClick, _props_backdrop;\n (_props_backdrop_onClick = (_props_backdrop = props.backdrop).onClick) === null || _props_backdrop_onClick === void 0 ? void 0 : _props_backdrop_onClick.call(_props_backdrop, event);\n }\n if (modalType === 'modal' && !event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n open: false,\n type: 'backdropClick'\n });\n }\n });\n const handleKeyDown = useEventCallback((event)=>{\n var _props_onKeyDown;\n (_props_onKeyDown = props.onKeyDown) === null || _props_onKeyDown === void 0 ? void 0 : _props_onKeyDown.call(props, event);\n if (event.key === Escape && !event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n open: false,\n type: 'escapeKeyDown'\n });\n // stop propagation to avoid conflicting with other elements that listen for `Escape`\n // e,g: nested Dialog, Popover, Menu and Tooltip\n event.stopPropagation();\n }\n });\n const backdrop = slot.optional(props.backdrop, {\n renderByDefault: open && modalType !== 'non-modal',\n defaultProps: {\n 'aria-hidden': 'true'\n },\n elementType: 'div'\n });\n if (backdrop) {\n backdrop.onClick = handledBackdropClick;\n }\n return {\n components: {\n backdrop: 'div',\n root: 'div'\n },\n backdrop,\n isNestedDialog,\n mountNode: props.mountNode,\n root: slot.always(getIntrinsicElementProps('div', {\n tabIndex: -1,\n 'aria-modal': modalType !== 'non-modal',\n role: modalType === 'alert' ? 'alertdialog' : 'dialog',\n 'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID,\n ...props,\n ...modalAttributes,\n onKeyDown: handleKeyDown,\n // FIXME:\n // `DialogSurfaceElement` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: useMergedRefs(ref, dialogRef)\n }), {\n elementType: 'div'\n })\n };\n};\n"],"names":["useDialogSurface_unstable","props","ref","modalType","useDialogContext_unstable","ctx","isNestedDialog","modalAttributes","dialogRef","open","requestOpenChange","dialogTitleID","dialogTitleId","handledBackdropClick","useEventCallback","event","isResolvedShorthand","backdrop","_props_backdrop_onClick","_props_backdrop","onClick","call","isDefaultPrevented","type","handleKeyDown","_props_onKeyDown","onKeyDown","key","Escape","stopPropagation","slot","optional","renderByDefault","defaultProps","elementType","components","root","mountNode","always","getIntrinsicElementProps","tabIndex","role","undefined","useMergedRefs"],"mappings":";;;;+BAYiBA;;;eAAAA;;;;iEAZM;gCAC8E;0BAC3D;8BACnB;AASZ,MAAMA,4BAA4B,CAACC,OAAOC;IACjD,MAAMC,YAAYC,IAAAA,mCAAyB,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R,MAAMc,eAAe;QACzB;IACJ;IACA,MAAMZ,WAAWa,oBAAI,CAACC,QAAQ,CAAC9B,MAAMgB,QAAQ,EAAE;QAC3Ce,iBAAiBvB,QAAQN,cAAc;QACvC8B,cAAc;YACV,eAAe;QACnB;QACAC,aAAa;IACjB;IACA,IAAIjB,UAAU;QACVA,SAASG,OAAO,GAAGP;IACvB;IACA,OAAO;QACHsB,YAAY;YACRlB,UAAU;YACVmB,MAAM;QACV;QACAnB;QACAX;QACA+B,WAAWpC,MAAMoC,SAAS;QAC1BD,MAAMN,oBAAI,CAACQ,MAAM,CAACC,IAAAA,wCAAwB,EAAC,OAAO;YAC9CC,UAAU,CAAC;YACX,cAAcrC,cAAc;YAC5BsC,MAAMtC,cAAc,UAAU,gBAAgB;YAC9C,mBAAmBF,KAAK,CAAC,aAAa,GAAGyC,YAAY/B;YACrD,GAAGV,KAAK;YACR,GAAGM,eAAe;YAClBmB,WAAWF;YACX,SAAS;YACT,6FAA6F;YAC7F,4FAA4F;YAC5FtB,KAAKyC,IAAAA,6BAAa,EAACzC,KAAKM;QAC5B,IAAI;YACA0B,aAAa;QACjB;IACJ;AACJ"}
1
+ {"version":3,"sources":["useDialogSurface.js"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback, useMergedRefs, isResolvedShorthand, slot, getIntrinsicElementProps } from '@fluentui/react-utilities';\nimport { useDialogContext_unstable } from '../../contexts';\nimport { Escape } from '@fluentui/keyboard-keys';\n/**\n * Create the state required to render DialogSurface.\n *\n * The returned state can be modified with hooks such as useDialogSurfaceStyles_unstable,\n * before being passed to renderDialogSurface_unstable.\n *\n * @param props - props from this instance of DialogSurface\n * @param ref - reference to root HTMLElement of DialogSurface\n */ export const useDialogSurface_unstable = (props, ref)=>{\n const modalType = useDialogContext_unstable((ctx)=>ctx.modalType);\n const isNestedDialog = useDialogContext_unstable((ctx)=>ctx.isNestedDialog);\n const modalAttributes = useDialogContext_unstable((ctx)=>ctx.modalAttributes);\n const dialogRef = useDialogContext_unstable((ctx)=>ctx.dialogRef);\n const open = useDialogContext_unstable((ctx)=>ctx.open);\n const requestOpenChange = useDialogContext_unstable((ctx)=>ctx.requestOpenChange);\n const dialogTitleID = useDialogContext_unstable((ctx)=>ctx.dialogTitleId);\n const handledBackdropClick = useEventCallback((event)=>{\n if (isResolvedShorthand(props.backdrop)) {\n var _props_backdrop_onClick, _props_backdrop;\n (_props_backdrop_onClick = (_props_backdrop = props.backdrop).onClick) === null || _props_backdrop_onClick === void 0 ? void 0 : _props_backdrop_onClick.call(_props_backdrop, event);\n }\n if (modalType === 'modal' && !event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n open: false,\n type: 'backdropClick'\n });\n }\n });\n const handleKeyDown = useEventCallback((event)=>{\n var _props_onKeyDown;\n (_props_onKeyDown = props.onKeyDown) === null || _props_onKeyDown === void 0 ? void 0 : _props_onKeyDown.call(props, event);\n if (event.key === Escape && !event.isDefaultPrevented()) {\n requestOpenChange({\n event,\n open: false,\n type: 'escapeKeyDown'\n });\n // stop propagation to avoid conflicting with other elements that listen for `Escape`\n // e,g: nested Dialog, Popover, Menu and Tooltip\n event.preventDefault();\n }\n });\n const backdrop = slot.optional(props.backdrop, {\n renderByDefault: open && modalType !== 'non-modal',\n defaultProps: {\n 'aria-hidden': 'true'\n },\n elementType: 'div'\n });\n if (backdrop) {\n backdrop.onClick = handledBackdropClick;\n }\n return {\n components: {\n backdrop: 'div',\n root: 'div'\n },\n backdrop,\n isNestedDialog,\n mountNode: props.mountNode,\n root: slot.always(getIntrinsicElementProps('div', {\n tabIndex: -1,\n 'aria-modal': modalType !== 'non-modal',\n role: modalType === 'alert' ? 'alertdialog' : 'dialog',\n 'aria-labelledby': props['aria-label'] ? undefined : dialogTitleID,\n ...props,\n ...modalAttributes,\n onKeyDown: handleKeyDown,\n // FIXME:\n // `DialogSurfaceElement` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: useMergedRefs(ref, dialogRef)\n }), {\n elementType: 'div'\n })\n };\n};\n"],"names":["useDialogSurface_unstable","props","ref","modalType","useDialogContext_unstable","ctx","isNestedDialog","modalAttributes","dialogRef","open","requestOpenChange","dialogTitleID","dialogTitleId","handledBackdropClick","useEventCallback","event","isResolvedShorthand","backdrop","_props_backdrop_onClick","_props_backdrop","onClick","call","isDefaultPrevented","type","handleKeyDown","_props_onKeyDown","onKeyDown","key","Escape","preventDefault","slot","optional","renderByDefault","defaultProps","elementType","components","root","mountNode","always","getIntrinsicElementProps","tabIndex","role","undefined","useMergedRefs"],"mappings":";;;;+BAYiBA;;;eAAAA;;;;iEAZM;gCAC8E;0BAC3D;8BACnB;AASZ,MAAMA,4BAA4B,CAACC,OAAOC;IACjD,MAAMC,YAAYC,IAAAA,mCAAyB,EAAC,CAACC,MAAMA,IAAIF,SAAS;IAChE,MAAMG,iBAAiBF,IAAAA,mCAAyB,EAAC,CAACC,MAAMA,IAAIC,cAAc;IAC1E,MAAMC,kBAAkBH,IAAAA,mCAAyB,EAAC,CAACC,MAAMA,IAAIE,eAAe;IAC5E,MAAMC,YAAYJ,IAAAA,mCAAyB,EAAC,CAACC,MAAMA,IAAIG,SAAS;IAChE,MAAMC,OAAOL,IAAAA,mCAAyB,EAAC,CAACC,MAAMA,IAAII,IAAI;IACtD,MAAMC,oBAAoBN,IAAAA,mCAAyB,EAAC,CAACC,MAAMA,IAAIK,iBAAiB;IAChF,MAAMC,gBAAgBP,IAAAA,mCAAyB,EAAC,CAACC,MAAMA,IAAIO,aAAa;IACxE,MAAMC,uBAAuBC,IAAAA,gCAAgB,EAAC,CAACC;QAC3C,IAAIC,IAAAA,mCAAmB,EAACf,MAAMgB,QAAQ,GAAG;YACrC,IAAIC,yBAAyBC;YAC5BD,CAAAA,0BAA0B,AAACC,CAAAA,kBAAkBlB,MAAMgB,QAAQ,AAAD,EAAGG,OAAO,AAAD,MAAO,QAAQF,4BAA4B,KAAK,IAAI,KAAK,IAAIA,wBAAwBG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-1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-dialog",
3
- "version": "9.7.7",
3
+ "version": "9.7.8",
4
4
  "description": "Dialog component for Fluent UI React",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -36,16 +36,16 @@
36
36
  "@fluentui/scripts-tasks": "*"
37
37
  },
38
38
  "dependencies": {
39
- "@fluentui/react-utilities": "^9.14.2",
40
- "@fluentui/react-jsx-runtime": "^9.0.15",
39
+ "@fluentui/react-utilities": "^9.15.0",
40
+ "@fluentui/react-jsx-runtime": "^9.0.16",
41
41
  "@fluentui/keyboard-keys": "^9.0.6",
42
- "@fluentui/react-context-selector": "^9.1.39",
42
+ "@fluentui/react-context-selector": "^9.1.40",
43
43
  "@fluentui/react-shared-contexts": "^9.10.0",
44
- "@fluentui/react-aria": "^9.3.41",
44
+ "@fluentui/react-aria": "^9.3.42",
45
45
  "@fluentui/react-icons": "^2.0.217",
46
- "@fluentui/react-tabster": "^9.13.5",
46
+ "@fluentui/react-tabster": "^9.13.6",
47
47
  "@fluentui/react-theme": "^9.1.14",
48
- "@fluentui/react-portal": "^9.3.22",
48
+ "@fluentui/react-portal": "^9.3.23",
49
49
  "@griffel/react": "^1.5.14",
50
50
  "@swc/helpers": "^0.5.1"
51
51
  },