@activecollab/components 2.0.532 → 2.0.534
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/dist/cjs/components/ModalRoot/ModalRoot.js +48 -2
- package/dist/cjs/components/ModalRoot/ModalRoot.js.map +1 -1
- package/dist/cjs/components/ModalRoot/modalRootStack.js +46 -3
- package/dist/cjs/components/ModalRoot/modalRootStack.js.map +1 -1
- package/dist/cjs/components/ModalRoot/useSuspendModalRoots.js +20 -0
- package/dist/cjs/components/ModalRoot/useSuspendModalRoots.js.map +1 -0
- package/dist/cjs/components/index.js +136 -0
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/presentation/myWork/MyWorkListSettingsDialog.js +250 -0
- package/dist/cjs/presentation/myWork/MyWorkListSettingsDialog.js.map +1 -0
- package/dist/cjs/presentation/myWork/MyWorkTasks.js +1789 -0
- package/dist/cjs/presentation/myWork/MyWorkTasks.js.map +1 -0
- package/dist/cjs/presentation/shared/PanelResizer.js +104 -0
- package/dist/cjs/presentation/shared/PanelResizer.js.map +1 -0
- package/dist/cjs/presentation/shared/index.js +15 -0
- package/dist/cjs/presentation/shared/index.js.map +1 -1
- package/dist/cjs/presentation/shared/tokens.js +13 -1
- package/dist/cjs/presentation/shared/tokens.js.map +1 -1
- package/dist/esm/components/ModalRoot/ModalRoot.d.ts.map +1 -1
- package/dist/esm/components/ModalRoot/ModalRoot.js +49 -3
- package/dist/esm/components/ModalRoot/ModalRoot.js.map +1 -1
- package/dist/esm/components/ModalRoot/modalRootStack.d.ts +15 -1
- package/dist/esm/components/ModalRoot/modalRootStack.d.ts.map +1 -1
- package/dist/esm/components/ModalRoot/modalRootStack.js +43 -2
- package/dist/esm/components/ModalRoot/modalRootStack.js.map +1 -1
- package/dist/esm/components/ModalRoot/useSuspendModalRoots.d.ts +8 -0
- package/dist/esm/components/ModalRoot/useSuspendModalRoots.d.ts.map +1 -0
- package/dist/esm/components/ModalRoot/useSuspendModalRoots.js +13 -0
- package/dist/esm/components/ModalRoot/useSuspendModalRoots.js.map +1 -0
- package/dist/esm/components/index.d.ts +2 -0
- package/dist/esm/components/index.d.ts.map +1 -1
- package/dist/esm/components/index.js +2 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/presentation/myWork/MyWorkListSettingsDialog.d.ts +12 -0
- package/dist/esm/presentation/myWork/MyWorkListSettingsDialog.d.ts.map +1 -0
- package/dist/esm/presentation/myWork/MyWorkListSettingsDialog.js +209 -0
- package/dist/esm/presentation/myWork/MyWorkListSettingsDialog.js.map +1 -0
- package/dist/esm/presentation/myWork/MyWorkTasks.d.ts +89 -0
- package/dist/esm/presentation/myWork/MyWorkTasks.d.ts.map +1 -0
- package/dist/esm/presentation/myWork/MyWorkTasks.js +1639 -0
- package/dist/esm/presentation/myWork/MyWorkTasks.js.map +1 -0
- package/dist/esm/presentation/shared/PanelResizer.d.ts +29 -0
- package/dist/esm/presentation/shared/PanelResizer.d.ts.map +1 -0
- package/dist/esm/presentation/shared/PanelResizer.js +86 -0
- package/dist/esm/presentation/shared/PanelResizer.js.map +1 -0
- package/dist/esm/presentation/shared/index.d.ts +2 -0
- package/dist/esm/presentation/shared/index.d.ts.map +1 -1
- package/dist/esm/presentation/shared/index.js +1 -0
- package/dist/esm/presentation/shared/index.js.map +1 -1
- package/dist/esm/presentation/shared/tokens.d.ts +11 -0
- package/dist/esm/presentation/shared/tokens.d.ts.map +1 -1
- package/dist/esm/presentation/shared/tokens.js +12 -0
- package/dist/esm/presentation/shared/tokens.js.map +1 -1
- package/dist/index.js +106 -4
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","names":["BREAKPOINT","exports","SM","MD","LG","XL","TRANSITION","AVATAR_COLORS","yellow","purple","blue","orange","green","teal","SANS","MONO"],"sources":["../../../../src/presentation/shared/tokens.ts"],"sourcesContent":["/**\n * Shared constants for the Presentation mock-ups.\n *\n * Breakpoints mirror new-activecollab-front (Tailwind sm / md / lg / xl).\n */\nexport const BREAKPOINT = 640;\nexport const SM = \"640px\";\nexport const MD = \"768px\";\nexport const LG = \"1024px\";\nexport const XL = \"1280px\";\nexport const TRANSITION = \"200ms ease\";\n\n/** Mock avatar background colours (stand-ins for real user avatars). */\nexport const AVATAR_COLORS = {\n yellow: \"#F5B041\",\n purple: \"#A569BD\",\n blue: \"#5499C7\",\n orange: \"#E67E22\",\n green: \"#32B370\",\n teal: \"#48C9B0\",\n};\n\n/**\n * Font stacks for the mock-ups.\n *\n * `SANS` mirrors the DS `FontStyle` stack. Presentation containers set it so raw\n * text that is not wrapped in Typography does not fall back to serif (there is\n * no global CSS reset in Storybook); text itself still goes through Typography.\n *\n * `MONO` is the monospace face the app uses for SHAs and inline code.\n */\nexport const SANS =\n '-apple-system, BlinkMacSystemFont, \"Inter\", \"Roboto\", \"Helvetica Neue\", Arial, sans-serif';\nexport const MONO = \"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace\";\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACO,IAAMA,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,GAAG;AACtB,IAAME,EAAE,GAAAD,OAAA,CAAAC,EAAA,GAAG,OAAO;AAClB,IAAMC,EAAE,GAAAF,OAAA,CAAAE,EAAA,GAAG,OAAO;AAClB,IAAMC,EAAE,GAAAH,OAAA,CAAAG,EAAA,GAAG,QAAQ;AACnB,IAAMC,EAAE,GAAAJ,OAAA,CAAAI,EAAA,GAAG,QAAQ;AACnB,IAAMC,UAAU,GAAAL,OAAA,CAAAK,UAAA,GAAG,YAAY;;AAEtC;AACO,IAAMC,aAAa,GAAAN,OAAA,CAAAM,aAAA,GAAG;EAC3BC,MAAM,EAAE,SAAS;EACjBC,MAAM,EAAE,SAAS;EACjBC,IAAI,EAAE,SAAS;EACfC,MAAM,EAAE,SAAS;EACjBC,KAAK,EAAE,SAAS;EAChBC,IAAI,EAAE;AACR,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMC,IAAI,
|
|
1
|
+
{"version":3,"file":"tokens.js","names":["BREAKPOINT","exports","SM","MD","LG","XL","TRANSITION","DUE_BAR_TRACK","NON_WORKING_HATCH","AVATAR_COLORS","yellow","purple","blue","orange","green","teal","SANS","MONO"],"sources":["../../../../src/presentation/shared/tokens.ts"],"sourcesContent":["/**\n * Shared constants for the Presentation mock-ups.\n *\n * Breakpoints mirror new-activecollab-front (Tailwind sm / md / lg / xl).\n */\nexport const BREAKPOINT = 640;\nexport const SM = \"640px\";\nexport const MD = \"768px\";\nexport const LG = \"1024px\";\nexport const XL = \"1280px\";\nexport const TRANSITION = \"200ms ease\";\n\n/**\n * The hatch the app draws over weekends and global days off (calendar.less,\n * also on .project-calendar-week). Multiples of 1/sqrt(2) px keep every\n * stripe on the pixel grid.\n */\n/**\n * The track of the list's estimate bar (ListTimeDetails.jsx), which the\n * project calendar's WeekDueBar reuses under each day of the week.\n */\nexport const DUE_BAR_TRACK =\n \"light-dark(var(--color-theme-transparent-300), color-mix(in srgb, var(--color-theme-transparent-500) 37%, transparent))\";\n\nexport const NON_WORKING_HATCH = `repeating-linear-gradient(\n -45deg,\n transparent,\n transparent 4.95px,\n var(--border-primary) 4.95px,\n var(--border-primary) 5.657px\n )`;\n\n/** Mock avatar background colours (stand-ins for real user avatars). */\nexport const AVATAR_COLORS = {\n yellow: \"#F5B041\",\n purple: \"#A569BD\",\n blue: \"#5499C7\",\n orange: \"#E67E22\",\n green: \"#32B370\",\n teal: \"#48C9B0\",\n};\n\n/**\n * Font stacks for the mock-ups.\n *\n * `SANS` mirrors the DS `FontStyle` stack. Presentation containers set it so raw\n * text that is not wrapped in Typography does not fall back to serif (there is\n * no global CSS reset in Storybook); text itself still goes through Typography.\n *\n * `MONO` is the monospace face the app uses for SHAs and inline code.\n */\nexport const SANS =\n '-apple-system, BlinkMacSystemFont, \"Inter\", \"Roboto\", \"Helvetica Neue\", Arial, sans-serif';\nexport const MONO = \"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace\";\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACO,IAAMA,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,GAAG;AACtB,IAAME,EAAE,GAAAD,OAAA,CAAAC,EAAA,GAAG,OAAO;AAClB,IAAMC,EAAE,GAAAF,OAAA,CAAAE,EAAA,GAAG,OAAO;AAClB,IAAMC,EAAE,GAAAH,OAAA,CAAAG,EAAA,GAAG,QAAQ;AACnB,IAAMC,EAAE,GAAAJ,OAAA,CAAAI,EAAA,GAAG,QAAQ;AACnB,IAAMC,UAAU,GAAAL,OAAA,CAAAK,UAAA,GAAG,YAAY;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMC,aAAa,GAAAN,OAAA,CAAAM,aAAA,GACxB,yHAAyH;AAEpH,IAAMC,iBAAiB,GAAAP,OAAA,CAAAO,iBAAA,kKAM1B;;AAEJ;AACO,IAAMC,aAAa,GAAAR,OAAA,CAAAQ,aAAA,GAAG;EAC3BC,MAAM,EAAE,SAAS;EACjBC,MAAM,EAAE,SAAS;EACjBC,IAAI,EAAE,SAAS;EACfC,MAAM,EAAE,SAAS;EACjBC,KAAK,EAAE,SAAS;EAChBC,IAAI,EAAE;AACR,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMC,IAAI,GAAAf,OAAA,CAAAe,IAAA,GACf,2FAA2F;AACtF,IAAMC,IAAI,GAAAhB,OAAA,CAAAgB,IAAA,GAAG,0DAA0D","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalRoot.d.ts","sourceRoot":"","sources":["../../../../src/components/ModalRoot/ModalRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAEZ,cAAc,EAEd,UAAU,EAEV,SAAS,EAMV,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ModalRoot.d.ts","sourceRoot":"","sources":["../../../../src/components/ModalRoot/ModalRoot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAEZ,cAAc,EAEd,UAAU,EAEV,SAAS,EAMV,MAAM,OAAO,CAAC;AAiBf,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAE3D,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,OAAO,CAAC;IACZ,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,cACf,SAAQ,IAAI,CACV,cAAc,CAAC,iBAAiB,CAAC,EACjC,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,UAAU,CAC7C;IACD,IAAI,EAAE,OAAO,CAAC;IACd,qEAAqE;IACrE,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAC1D,6HAA6H;IAC7H,gBAAgB,CAAC,EAAE,CACjB,MAAM,EAAE,sBAAsB,EAC9B,KAAK,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,KAClC,IAAI,CAAC;IACV,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,iHAAiH;IACjH,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC,UAAU,EAAE,mBAAmB,KAAK,SAAS,CAAC,CAAC;CACxE;AAED,eAAO,MAAM,SAAS,0FAuVrB,CAAC"}
|
|
@@ -4,9 +4,10 @@ const _excluded = ["open", "onRequestClose", "onDismissBlocked", "onClose", "dis
|
|
|
4
4
|
import React, { forwardRef, useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
5
5
|
import { RemoveScroll } from "react-remove-scroll";
|
|
6
6
|
import classnames from "classnames";
|
|
7
|
-
import { isTopModalRoot, popModalRoot, pushModalRoot } from "./modalRootStack";
|
|
7
|
+
import { areModalRootsSuspended, isTopModalRoot, popModalRoot, pushModalRoot } from "./modalRootStack";
|
|
8
8
|
import { StyledModalRoot } from "./Styles";
|
|
9
9
|
import { Portal, PortalContainerProvider } from "../../helpers";
|
|
10
|
+
import { layers } from "../../utils/layers";
|
|
10
11
|
import useForkRef from "../../utils/useForkRef";
|
|
11
12
|
export const ModalRoot = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
12
13
|
let open = _ref.open,
|
|
@@ -50,8 +51,50 @@ export const ModalRoot = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
50
51
|
if (open && !mounted) {
|
|
51
52
|
setMounted(true);
|
|
52
53
|
}
|
|
54
|
+
|
|
55
|
+
// While suspended the dialog is open without being modal, in the page instead of the top layer, so it keeps a
|
|
56
|
+
// layer just under the overlay it was suspended for. A dismiss then would close it under that overlay.
|
|
57
|
+
// The stack calls suspend once for an entry and resume at most once, so the suspension is the stack's state.
|
|
58
|
+
const focusBeforeSuspendRef = useRef(null);
|
|
59
|
+
const suspensionRef = useRef({
|
|
60
|
+
suspend: () => {
|
|
61
|
+
const node = dialogRef.current;
|
|
62
|
+
if (!node) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
focusBeforeSuspendRef.current = node.contains(document.activeElement) ? document.activeElement : null;
|
|
66
|
+
node.style.zIndex = String(layers.cloud - 1);
|
|
67
|
+
if (node.open) {
|
|
68
|
+
node.close();
|
|
69
|
+
node.show();
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
resume: () => {
|
|
73
|
+
const node = dialogRef.current;
|
|
74
|
+
if (!node) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
node.style.zIndex = "";
|
|
78
|
+
if (node.open) {
|
|
79
|
+
node.close();
|
|
80
|
+
node.showModal();
|
|
81
|
+
}
|
|
82
|
+
const focus = focusBeforeSuspendRef.current;
|
|
83
|
+
focusBeforeSuspendRef.current = null;
|
|
84
|
+
if (focus instanceof HTMLElement && node.contains(focus)) {
|
|
85
|
+
focus.focus({
|
|
86
|
+
preventScroll: true
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
});
|
|
53
91
|
const finishClose = useCallback(() => {
|
|
54
92
|
var _dialogRef$current;
|
|
93
|
+
// A dialog that closes while suspended leaves the stack before the resume, so it drops its layer here.
|
|
94
|
+
if (dialogRef.current) {
|
|
95
|
+
dialogRef.current.style.zIndex = "";
|
|
96
|
+
}
|
|
97
|
+
|
|
55
98
|
// Content that sits in the overlay root moves out before the dialog hides it.
|
|
56
99
|
if (stackIdRef.current !== undefined) {
|
|
57
100
|
popModalRoot(stackIdRef.current);
|
|
@@ -73,7 +116,7 @@ export const ModalRoot = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
73
116
|
dialog.showModal();
|
|
74
117
|
}
|
|
75
118
|
if (stackIdRef.current === undefined) {
|
|
76
|
-
stackIdRef.current = pushModalRoot(overlayRootRef.current);
|
|
119
|
+
stackIdRef.current = pushModalRoot(overlayRootRef.current, suspensionRef.current);
|
|
77
120
|
}
|
|
78
121
|
}, [open, dialog]);
|
|
79
122
|
|
|
@@ -91,6 +134,9 @@ export const ModalRoot = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
91
134
|
}, [open, mounted, hasTransition, finishClose]);
|
|
92
135
|
const dismissRef = useRef();
|
|
93
136
|
dismissRef.current = (reason, event) => {
|
|
137
|
+
if (areModalRootsSuspended()) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
94
140
|
const blocked = reason === "escape" ? disableCloseOnEsc : disableBackgroundClick;
|
|
95
141
|
if (blocked) {
|
|
96
142
|
onDismissBlocked == null || onDismissBlocked(reason, event);
|
|
@@ -148,7 +194,7 @@ export const ModalRoot = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
148
194
|
}
|
|
149
195
|
};
|
|
150
196
|
const handleNativeClose = () => {
|
|
151
|
-
if (openRef.current && !dialog.open) {
|
|
197
|
+
if (openRef.current && !dialog.open && !areModalRootsSuspended()) {
|
|
152
198
|
dialog.showModal();
|
|
153
199
|
}
|
|
154
200
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModalRoot.js","names":["React","forwardRef","useCallback","useEffect","useLayoutEffect","useRef","useState","RemoveScroll","classnames","isTopModalRoot","popModalRoot","pushModalRoot","StyledModalRoot","Portal","PortalContainerProvider","useForkRef","ModalRoot","_ref","ref","open","onRequestClose","onDismissBlocked","onClose","_ref$disableCloseOnEs","disableCloseOnEsc","_ref$disableBackgroun","disableBackgroundClick","_ref$disableScrollLoc","disableScrollLock","children","className","onPointerDown","onClick","onKeyDown","rest","_objectWithoutPropertiesLoose","_excluded","_useState","mounted","setMounted","_useState2","dialog","setDialog","dialogRef","setDialogNode","node","current","handleRef","hasTransition","openRef","pressStartedOnBackdrop","stackIdRef","overlayRootRef","getOverlayRoot","finishClose","_dialogRef$current","undefined","close","showModal","dismissRef","reason","event","blocked","handleKeyDown","_overlayRootRef$curre","_overlayRootRef$curre2","stackId","defaultPrevented","key","target","document","body","querySelector","preventDefault","contains","addEventListener","removeEventListener","handleCancel","_overlayRootRef$curre3","activeElement","handleNativeClose","handlePointerDown","currentTarget","handleClick","stopPropagation","_overlayRootRef$curre4","handleExited","createElement","forwardProps","enabled","noIsolation","_extends","value","in","onExited","displayName"],"sources":["../../../../src/components/ModalRoot/ModalRoot.tsx"],"sourcesContent":["import React, {\n forwardRef,\n HTMLAttributes,\n KeyboardEvent as ReactKeyboardEvent,\n MouseEvent,\n PointerEvent,\n ReactNode,\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\";\nimport { RemoveScroll } from \"react-remove-scroll\";\n\nimport classnames from \"classnames\";\n\nimport { isTopModalRoot, popModalRoot, pushModalRoot } from \"./modalRootStack\";\nimport { StyledModalRoot } from \"./Styles\";\nimport { Portal, PortalContainerProvider } from \"../../helpers\";\nimport useForkRef from \"../../utils/useForkRef\";\n\nexport type ModalRootDismissReason = \"escape\" | \"backdrop\";\n\nexport interface ModalRootTransition {\n in: boolean;\n onExited: () => void;\n}\n\nexport interface ModalRootProps\n extends Omit<\n HTMLAttributes<HTMLDialogElement>,\n \"children\" | \"open\" | \"onClose\" | \"onCancel\"\n > {\n open: boolean;\n /** Escape or a backdrop click asks the owner to set open to false */\n onRequestClose?: (reason: ModalRootDismissReason) => void;\n /** Escape or a backdrop click that disableCloseOnEsc or disableBackgroundClick blocked; a backdrop click passes its event */\n onDismissBlocked?: (\n reason: ModalRootDismissReason,\n event?: MouseEvent<HTMLDialogElement>\n ) => void;\n /** The exit transition is done and the dialog is closed */\n onClose?: () => void;\n disableCloseOnEsc?: boolean;\n disableBackgroundClick?: boolean;\n disableScrollLock?: boolean;\n /** A function gets the transition state, and the dialog closes when it calls onExited. A node closes at once. */\n children: ReactNode | ((transition: ModalRootTransition) => ReactNode);\n}\n\nexport const ModalRoot = forwardRef<HTMLDialogElement, ModalRootProps>(\n (\n {\n open,\n onRequestClose,\n onDismissBlocked,\n onClose,\n disableCloseOnEsc = false,\n disableBackgroundClick = false,\n disableScrollLock = false,\n children,\n className,\n onPointerDown,\n onClick,\n onKeyDown,\n ...rest\n },\n ref\n ) => {\n const [mounted, setMounted] = useState(open);\n // Inside another root the dialog mounts a render after its first one, once the outer overlay root exists,\n // so opening, the stack and the listeners wait for the node instead of the first commit.\n const [dialog, setDialog] = useState<HTMLDialogElement | null>(null);\n const dialogRef = useRef<HTMLDialogElement | null>(null);\n const setDialogNode = useCallback((node: HTMLDialogElement | null) => {\n dialogRef.current = node;\n setDialog(node);\n }, []);\n const handleRef = useForkRef(setDialogNode, ref);\n const hasTransition = typeof children === \"function\";\n const openRef = useRef(open);\n const pressStartedOnBackdrop = useRef(false);\n const stackIdRef = useRef<number>();\n const overlayRootRef = useRef<HTMLDivElement>(null);\n // Menus and pickers opened inside portal here, into the top layer with the dialog, not under it.\n const getOverlayRoot = useCallback(\n () => overlayRootRef.current as HTMLElement,\n []\n );\n\n openRef.current = open;\n\n if (open && !mounted) {\n setMounted(true);\n }\n\n const finishClose = useCallback(() => {\n // Content that sits in the overlay root moves out before the dialog hides it.\n if (stackIdRef.current !== undefined) {\n popModalRoot(stackIdRef.current);\n stackIdRef.current = undefined;\n }\n dialogRef.current?.close();\n setMounted(false);\n onClose?.();\n }, [onClose]);\n\n // The entry joins the stack with every showModal, so an owner that opens the dialog again from onClose, on the\n // same node, gets it back. It joins after showModal, so content that moves into the overlay root lands where it\n // is rendered and can get its scroll positions back.\n useLayoutEffect(() => {\n if (!open || !dialog) {\n return;\n }\n\n if (!dialog.open) {\n dialog.showModal();\n }\n\n if (stackIdRef.current === undefined) {\n stackIdRef.current = pushModalRoot(overlayRootRef.current);\n }\n }, [open, dialog]);\n\n // A layout effect, so the entry leaves the stack before an unmount removes the dialog and its overlay root.\n useLayoutEffect(\n () => () => {\n if (stackIdRef.current !== undefined) {\n popModalRoot(stackIdRef.current);\n stackIdRef.current = undefined;\n }\n },\n [dialog]\n );\n\n useLayoutEffect(() => {\n if (!open && mounted && !hasTransition) {\n finishClose();\n }\n }, [open, mounted, hasTransition, finishClose]);\n\n const dismissRef =\n useRef<\n (\n reason: ModalRootDismissReason,\n event?: MouseEvent<HTMLDialogElement>\n ) => void\n >();\n\n dismissRef.current = (reason, event) => {\n const blocked =\n reason === \"escape\" ? disableCloseOnEsc : disableBackgroundClick;\n\n if (blocked) {\n onDismissBlocked?.(reason, event);\n } else {\n onRequestClose?.(reason);\n }\n };\n\n // A prevented Escape keydown starts no close request, and the browser stops honouring a prevented cancel\n // after a while, so Escape is caught here and the cancel event only covers the other close requests.\n useEffect(() => {\n if (!dialog) {\n return undefined;\n }\n\n const handleKeyDown = (event: KeyboardEvent) => {\n const stackId = stackIdRef.current;\n\n if (\n stackId === undefined ||\n !isTopModalRoot(stackId) ||\n event.defaultPrevented ||\n (event.key !== \"Escape\" && event.key !== \"Esc\")\n ) {\n return;\n }\n\n // A menu inside closes on an Escape that reaches the body, from a listener that runs after this one.\n if (\n event.target === document.body &&\n overlayRootRef.current?.querySelector(\".c-window\")\n ) {\n return;\n }\n\n event.preventDefault();\n\n // A sheet, a menu or the chat in the overlay root is a layer above the dialog. An Escape it did not take\n // still belongs to it, so the dialog only stops the browser from closing itself.\n if (overlayRootRef.current?.contains(event.target as Node)) {\n return;\n }\n\n if (openRef.current) {\n dismissRef.current?.(\"escape\");\n }\n };\n\n document.addEventListener(\"keydown\", handleKeyDown);\n\n return () => document.removeEventListener(\"keydown\", handleKeyDown);\n }, [dialog]);\n\n useEffect(() => {\n if (!dialog) {\n return undefined;\n }\n\n const handleCancel = (event: Event) => {\n event.preventDefault();\n\n // A layer in the overlay root may stop its Escape before the document sees it, so the cancel that follows\n // would close the dialog under the layer. While the focus is in that layer, the close request is its own.\n if (overlayRootRef.current?.contains(document.activeElement)) {\n return;\n }\n\n if (openRef.current) {\n dismissRef.current?.(\"escape\");\n }\n };\n\n const handleNativeClose = () => {\n if (openRef.current && !dialog.open) {\n dialog.showModal();\n }\n };\n\n dialog.addEventListener(\"cancel\", handleCancel);\n dialog.addEventListener(\"close\", handleNativeClose);\n\n return () => {\n dialog.removeEventListener(\"cancel\", handleCancel);\n dialog.removeEventListener(\"close\", handleNativeClose);\n };\n }, [dialog]);\n\n const handlePointerDown = useCallback(\n (event: PointerEvent<HTMLDialogElement>) => {\n pressStartedOnBackdrop.current = event.target === event.currentTarget;\n onPointerDown?.(event);\n },\n [onPointerDown]\n );\n\n // The dialog covers the viewport and its content sits inside it, so a click on the dialog itself is a\n // click on the backdrop. A press that started on the content and ended outside it is a text selection.\n // A click does not bubble on through the React tree, as from a legacy window: a confirmation rendered in a\n // clickable row would otherwise click the row as well. React listens at the portal's container, so a click\n // listener on document or window does not see a click inside the dialog either, as with the window.\n const handleClick = useCallback(\n (event: MouseEvent<HTMLDialogElement>) => {\n if (\n event.target === event.currentTarget &&\n pressStartedOnBackdrop.current &&\n openRef.current\n ) {\n dismissRef.current?.(\"backdrop\", event);\n }\n pressStartedOnBackdrop.current = false;\n onClick?.(event);\n event.stopPropagation();\n },\n [onClick]\n );\n\n // React events from a portal bubble through the React tree, so an Escape from the content would reach an\n // ancestor's handler, like an older Sheet's, before the document listener. The dialog takes it here first.\n const handleKeyDown = useCallback(\n (event: ReactKeyboardEvent<HTMLDialogElement>) => {\n onKeyDown?.(event);\n\n if (\n event.defaultPrevented ||\n (event.key !== \"Escape\" && event.key !== \"Esc\") ||\n stackIdRef.current === undefined ||\n !isTopModalRoot(stackIdRef.current)\n ) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n // An Escape a layer in the overlay root did not take stops here too, so it does not close the sheet that\n // opened this dialog, but it leaves the dialog open.\n if (overlayRootRef.current?.contains(event.target as Node)) {\n return;\n }\n\n if (openRef.current) {\n dismissRef.current?.(\"escape\");\n }\n },\n [onKeyDown]\n );\n\n const handleExited = useCallback(() => {\n if (!open) {\n finishClose();\n }\n }, [open, finishClose]);\n\n if (!mounted) {\n return null;\n }\n\n return (\n <Portal>\n <RemoveScroll\n forwardProps\n ref={handleRef}\n enabled={!disableScrollLock}\n noIsolation\n >\n <StyledModalRoot\n {...rest}\n className={classnames(\"c-modal-root\", className)}\n data-state={open ? \"open\" : \"closing\"}\n onPointerDown={handlePointerDown}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n >\n <PortalContainerProvider value={getOverlayRoot}>\n {typeof children === \"function\"\n ? children({ in: open, onExited: handleExited })\n : children}\n </PortalContainerProvider>\n <div ref={overlayRootRef} className=\"c-modal-root__overlays\" />\n </StyledModalRoot>\n </RemoveScroll>\n </Portal>\n );\n }\n);\n\nModalRoot.displayName = \"ModalRoot\";\n"],"mappings":";;;AAAA,OAAOA,KAAK,IACVC,UAAU,EAMVC,WAAW,EACXC,SAAS,EACTC,eAAe,EACfC,MAAM,EACNC,QAAQ,QAC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O,EAAE,CAAC7D,iBAAkB;IAC5B8D,WAAW;EAAA,gBAEX1F,KAAA,CAAAuF,aAAA,CAAC3E,eAAe,EAAA+E,QAAA,KACVzD,IAAI;IACRJ,SAAS,EAAEtB,UAAU,CAAC,cAAc,EAAEsB,SAAS,CAAE;IACjD,cAAYX,IAAI,GAAG,MAAM,GAAG,SAAU;IACtCY,aAAa,EAAEkD,iBAAkB;IACjCjD,OAAO,EAAEmD,WAAY;IACrBlD,SAAS,EAAE8B;EAAc,iBAEzB/D,KAAA,CAAAuF,aAAA,CAACzE,uBAAuB;IAAC8E,KAAK,EAAEvC;EAAe,GAC5C,OAAOxB,QAAQ,KAAK,UAAU,GAC3BA,QAAQ,CAAC;IAAEgE,EAAE,EAAE1E,IAAI;IAAE2E,QAAQ,EAAER;EAAa,CAAC,CAAC,GAC9CzD,QACmB,CAAC,eAC1B7B,KAAA,CAAAuF,aAAA;IAAKrE,GAAG,EAAEkC,cAAe;IAACtB,SAAS,EAAC;EAAwB,CAAE,CAC/C,CACL,CACR,CAAC;AAEb,CACF,CAAC;AAEDd,SAAS,CAAC+E,WAAW,GAAG,WAAW","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"ModalRoot.js","names":["React","forwardRef","useCallback","useEffect","useLayoutEffect","useRef","useState","RemoveScroll","classnames","areModalRootsSuspended","isTopModalRoot","popModalRoot","pushModalRoot","StyledModalRoot","Portal","PortalContainerProvider","layers","useForkRef","ModalRoot","_ref","ref","open","onRequestClose","onDismissBlocked","onClose","_ref$disableCloseOnEs","disableCloseOnEsc","_ref$disableBackgroun","disableBackgroundClick","_ref$disableScrollLoc","disableScrollLock","children","className","onPointerDown","onClick","onKeyDown","rest","_objectWithoutPropertiesLoose","_excluded","_useState","mounted","setMounted","_useState2","dialog","setDialog","dialogRef","setDialogNode","node","current","handleRef","hasTransition","openRef","pressStartedOnBackdrop","stackIdRef","overlayRootRef","getOverlayRoot","focusBeforeSuspendRef","suspensionRef","suspend","contains","document","activeElement","style","zIndex","String","cloud","close","show","resume","showModal","focus","HTMLElement","preventScroll","finishClose","_dialogRef$current","undefined","dismissRef","reason","event","blocked","handleKeyDown","_overlayRootRef$curre","_overlayRootRef$curre2","stackId","defaultPrevented","key","target","body","querySelector","preventDefault","addEventListener","removeEventListener","handleCancel","_overlayRootRef$curre3","handleNativeClose","handlePointerDown","currentTarget","handleClick","stopPropagation","_overlayRootRef$curre4","handleExited","createElement","forwardProps","enabled","noIsolation","_extends","value","in","onExited","displayName"],"sources":["../../../../src/components/ModalRoot/ModalRoot.tsx"],"sourcesContent":["import React, {\n forwardRef,\n HTMLAttributes,\n KeyboardEvent as ReactKeyboardEvent,\n MouseEvent,\n PointerEvent,\n ReactNode,\n useCallback,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n} from \"react\";\nimport { RemoveScroll } from \"react-remove-scroll\";\n\nimport classnames from \"classnames\";\n\nimport {\n areModalRootsSuspended,\n isTopModalRoot,\n ModalRootSuspension,\n popModalRoot,\n pushModalRoot,\n} from \"./modalRootStack\";\nimport { StyledModalRoot } from \"./Styles\";\nimport { Portal, PortalContainerProvider } from \"../../helpers\";\nimport { layers } from \"../../utils/layers\";\nimport useForkRef from \"../../utils/useForkRef\";\n\nexport type ModalRootDismissReason = \"escape\" | \"backdrop\";\n\nexport interface ModalRootTransition {\n in: boolean;\n onExited: () => void;\n}\n\nexport interface ModalRootProps\n extends Omit<\n HTMLAttributes<HTMLDialogElement>,\n \"children\" | \"open\" | \"onClose\" | \"onCancel\"\n > {\n open: boolean;\n /** Escape or a backdrop click asks the owner to set open to false */\n onRequestClose?: (reason: ModalRootDismissReason) => void;\n /** Escape or a backdrop click that disableCloseOnEsc or disableBackgroundClick blocked; a backdrop click passes its event */\n onDismissBlocked?: (\n reason: ModalRootDismissReason,\n event?: MouseEvent<HTMLDialogElement>\n ) => void;\n /** The exit transition is done and the dialog is closed */\n onClose?: () => void;\n disableCloseOnEsc?: boolean;\n disableBackgroundClick?: boolean;\n disableScrollLock?: boolean;\n /** A function gets the transition state, and the dialog closes when it calls onExited. A node closes at once. */\n children: ReactNode | ((transition: ModalRootTransition) => ReactNode);\n}\n\nexport const ModalRoot = forwardRef<HTMLDialogElement, ModalRootProps>(\n (\n {\n open,\n onRequestClose,\n onDismissBlocked,\n onClose,\n disableCloseOnEsc = false,\n disableBackgroundClick = false,\n disableScrollLock = false,\n children,\n className,\n onPointerDown,\n onClick,\n onKeyDown,\n ...rest\n },\n ref\n ) => {\n const [mounted, setMounted] = useState(open);\n // Inside another root the dialog mounts a render after its first one, once the outer overlay root exists,\n // so opening, the stack and the listeners wait for the node instead of the first commit.\n const [dialog, setDialog] = useState<HTMLDialogElement | null>(null);\n const dialogRef = useRef<HTMLDialogElement | null>(null);\n const setDialogNode = useCallback((node: HTMLDialogElement | null) => {\n dialogRef.current = node;\n setDialog(node);\n }, []);\n const handleRef = useForkRef(setDialogNode, ref);\n const hasTransition = typeof children === \"function\";\n const openRef = useRef(open);\n const pressStartedOnBackdrop = useRef(false);\n const stackIdRef = useRef<number>();\n const overlayRootRef = useRef<HTMLDivElement>(null);\n // Menus and pickers opened inside portal here, into the top layer with the dialog, not under it.\n const getOverlayRoot = useCallback(\n () => overlayRootRef.current as HTMLElement,\n []\n );\n\n openRef.current = open;\n\n if (open && !mounted) {\n setMounted(true);\n }\n\n // While suspended the dialog is open without being modal, in the page instead of the top layer, so it keeps a\n // layer just under the overlay it was suspended for. A dismiss then would close it under that overlay.\n // The stack calls suspend once for an entry and resume at most once, so the suspension is the stack's state.\n const focusBeforeSuspendRef = useRef<Element | null>(null);\n const suspensionRef = useRef<ModalRootSuspension>({\n suspend: () => {\n const node = dialogRef.current;\n\n if (!node) {\n return;\n }\n\n focusBeforeSuspendRef.current = node.contains(document.activeElement)\n ? document.activeElement\n : null;\n node.style.zIndex = String(layers.cloud - 1);\n\n if (node.open) {\n node.close();\n node.show();\n }\n },\n resume: () => {\n const node = dialogRef.current;\n\n if (!node) {\n return;\n }\n\n node.style.zIndex = \"\";\n\n if (node.open) {\n node.close();\n node.showModal();\n }\n\n const focus = focusBeforeSuspendRef.current;\n focusBeforeSuspendRef.current = null;\n\n if (focus instanceof HTMLElement && node.contains(focus)) {\n focus.focus({ preventScroll: true });\n }\n },\n });\n\n const finishClose = useCallback(() => {\n // A dialog that closes while suspended leaves the stack before the resume, so it drops its layer here.\n if (dialogRef.current) {\n dialogRef.current.style.zIndex = \"\";\n }\n\n // Content that sits in the overlay root moves out before the dialog hides it.\n if (stackIdRef.current !== undefined) {\n popModalRoot(stackIdRef.current);\n stackIdRef.current = undefined;\n }\n dialogRef.current?.close();\n setMounted(false);\n onClose?.();\n }, [onClose]);\n\n // The entry joins the stack with every showModal, so an owner that opens the dialog again from onClose, on the\n // same node, gets it back. It joins after showModal, so content that moves into the overlay root lands where it\n // is rendered and can get its scroll positions back.\n useLayoutEffect(() => {\n if (!open || !dialog) {\n return;\n }\n\n if (!dialog.open) {\n dialog.showModal();\n }\n\n if (stackIdRef.current === undefined) {\n stackIdRef.current = pushModalRoot(\n overlayRootRef.current,\n suspensionRef.current\n );\n }\n }, [open, dialog]);\n\n // A layout effect, so the entry leaves the stack before an unmount removes the dialog and its overlay root.\n useLayoutEffect(\n () => () => {\n if (stackIdRef.current !== undefined) {\n popModalRoot(stackIdRef.current);\n stackIdRef.current = undefined;\n }\n },\n [dialog]\n );\n\n useLayoutEffect(() => {\n if (!open && mounted && !hasTransition) {\n finishClose();\n }\n }, [open, mounted, hasTransition, finishClose]);\n\n const dismissRef =\n useRef<\n (\n reason: ModalRootDismissReason,\n event?: MouseEvent<HTMLDialogElement>\n ) => void\n >();\n\n dismissRef.current = (reason, event) => {\n if (areModalRootsSuspended()) {\n return;\n }\n\n const blocked =\n reason === \"escape\" ? disableCloseOnEsc : disableBackgroundClick;\n\n if (blocked) {\n onDismissBlocked?.(reason, event);\n } else {\n onRequestClose?.(reason);\n }\n };\n\n // A prevented Escape keydown starts no close request, and the browser stops honouring a prevented cancel\n // after a while, so Escape is caught here and the cancel event only covers the other close requests.\n useEffect(() => {\n if (!dialog) {\n return undefined;\n }\n\n const handleKeyDown = (event: KeyboardEvent) => {\n const stackId = stackIdRef.current;\n\n if (\n stackId === undefined ||\n !isTopModalRoot(stackId) ||\n event.defaultPrevented ||\n (event.key !== \"Escape\" && event.key !== \"Esc\")\n ) {\n return;\n }\n\n // A menu inside closes on an Escape that reaches the body, from a listener that runs after this one.\n if (\n event.target === document.body &&\n overlayRootRef.current?.querySelector(\".c-window\")\n ) {\n return;\n }\n\n event.preventDefault();\n\n // A sheet, a menu or the chat in the overlay root is a layer above the dialog. An Escape it did not take\n // still belongs to it, so the dialog only stops the browser from closing itself.\n if (overlayRootRef.current?.contains(event.target as Node)) {\n return;\n }\n\n if (openRef.current) {\n dismissRef.current?.(\"escape\");\n }\n };\n\n document.addEventListener(\"keydown\", handleKeyDown);\n\n return () => document.removeEventListener(\"keydown\", handleKeyDown);\n }, [dialog]);\n\n useEffect(() => {\n if (!dialog) {\n return undefined;\n }\n\n const handleCancel = (event: Event) => {\n event.preventDefault();\n\n // A layer in the overlay root may stop its Escape before the document sees it, so the cancel that follows\n // would close the dialog under the layer. While the focus is in that layer, the close request is its own.\n if (overlayRootRef.current?.contains(document.activeElement)) {\n return;\n }\n\n if (openRef.current) {\n dismissRef.current?.(\"escape\");\n }\n };\n\n const handleNativeClose = () => {\n if (openRef.current && !dialog.open && !areModalRootsSuspended()) {\n dialog.showModal();\n }\n };\n\n dialog.addEventListener(\"cancel\", handleCancel);\n dialog.addEventListener(\"close\", handleNativeClose);\n\n return () => {\n dialog.removeEventListener(\"cancel\", handleCancel);\n dialog.removeEventListener(\"close\", handleNativeClose);\n };\n }, [dialog]);\n\n const handlePointerDown = useCallback(\n (event: PointerEvent<HTMLDialogElement>) => {\n pressStartedOnBackdrop.current = event.target === event.currentTarget;\n onPointerDown?.(event);\n },\n [onPointerDown]\n );\n\n // The dialog covers the viewport and its content sits inside it, so a click on the dialog itself is a\n // click on the backdrop. A press that started on the content and ended outside it is a text selection.\n // A click does not bubble on through the React tree, as from a legacy window: a confirmation rendered in a\n // clickable row would otherwise click the row as well. React listens at the portal's container, so a click\n // listener on document or window does not see a click inside the dialog either, as with the window.\n const handleClick = useCallback(\n (event: MouseEvent<HTMLDialogElement>) => {\n if (\n event.target === event.currentTarget &&\n pressStartedOnBackdrop.current &&\n openRef.current\n ) {\n dismissRef.current?.(\"backdrop\", event);\n }\n pressStartedOnBackdrop.current = false;\n onClick?.(event);\n event.stopPropagation();\n },\n [onClick]\n );\n\n // React events from a portal bubble through the React tree, so an Escape from the content would reach an\n // ancestor's handler, like an older Sheet's, before the document listener. The dialog takes it here first.\n const handleKeyDown = useCallback(\n (event: ReactKeyboardEvent<HTMLDialogElement>) => {\n onKeyDown?.(event);\n\n if (\n event.defaultPrevented ||\n (event.key !== \"Escape\" && event.key !== \"Esc\") ||\n stackIdRef.current === undefined ||\n !isTopModalRoot(stackIdRef.current)\n ) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n // An Escape a layer in the overlay root did not take stops here too, so it does not close the sheet that\n // opened this dialog, but it leaves the dialog open.\n if (overlayRootRef.current?.contains(event.target as Node)) {\n return;\n }\n\n if (openRef.current) {\n dismissRef.current?.(\"escape\");\n }\n },\n [onKeyDown]\n );\n\n const handleExited = useCallback(() => {\n if (!open) {\n finishClose();\n }\n }, [open, finishClose]);\n\n if (!mounted) {\n return null;\n }\n\n return (\n <Portal>\n <RemoveScroll\n forwardProps\n ref={handleRef}\n enabled={!disableScrollLock}\n noIsolation\n >\n <StyledModalRoot\n {...rest}\n className={classnames(\"c-modal-root\", className)}\n data-state={open ? \"open\" : \"closing\"}\n onPointerDown={handlePointerDown}\n onClick={handleClick}\n onKeyDown={handleKeyDown}\n >\n <PortalContainerProvider value={getOverlayRoot}>\n {typeof children === \"function\"\n ? children({ in: open, onExited: handleExited })\n : children}\n </PortalContainerProvider>\n <div ref={overlayRootRef} className=\"c-modal-root__overlays\" />\n </StyledModalRoot>\n </Remo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end: () => void;
|
|
4
|
+
resume: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const pushModalRoot: (overlayRoot: HTMLElement | null, suspension?: ModalRootSuspension) => number;
|
|
3
7
|
export declare const popModalRoot: (id: number) => void;
|
|
4
8
|
export declare const isTopModalRoot: (id: number) => boolean;
|
|
5
9
|
/**
|
|
@@ -13,5 +17,15 @@ export declare const getTopModalRootId: () => number | undefined;
|
|
|
13
17
|
/** The overlay root of the top modal root among those opened no later than the given one, skipping as above. */
|
|
14
18
|
export declare const getModalOverlayRootUpTo: (id: number, outside?: Node) => HTMLElement | null;
|
|
15
19
|
export declare const subscribeToModalRoots: (listener: Listener) => (() => void);
|
|
20
|
+
/** True while suspendModalRoots holds the open modal roots non-modal. */
|
|
21
|
+
export declare const areModalRootsSuspended: () => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Turns every open modal root into a non-modal dialog until the returned release is called, so an overlay that a
|
|
24
|
+
* third party renders into document.body, such as the Google Drive picker, can be used above them. The dialogs keep
|
|
25
|
+
* their place, look, content and order, and do not close. Calls nest: the modal roots come back, from the bottom up,
|
|
26
|
+
* with the last release. A suspended dialog sits at layers.cloud - 1, so the overlay must be at layers.cloud or above;
|
|
27
|
+
* the frontend raises the Google Drive picker there in its own CSS.
|
|
28
|
+
*/
|
|
29
|
+
export declare const suspendModalRoots: () => (() => void);
|
|
16
30
|
export {};
|
|
17
31
|
//# sourceMappingURL=modalRootStack.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modalRootStack.d.ts","sourceRoot":"","sources":["../../../../src/components/ModalRoot/modalRootStack.ts"],"names":[],"mappings":"AAAA,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"modalRootStack.d.ts","sourceRoot":"","sources":["../../../../src/components/ModalRoot/modalRootStack.ts"],"names":[],"mappings":"AAAA,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAC;AAE3B,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAgBD,eAAO,MAAM,aAAa,GACxB,aAAa,WAAW,GAAG,IAAI,EAC/B,aAAa,mBAAmB,KAC/B,MAYF,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,IAAI,MAAM,KAAG,IAOzC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,IAAI,MAAM,KAAG,OACR,CAAC;AAKrC;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAI,UAAU,IAAI,KAAG,WAAW,GAAG,IACS,CAAC;AAEhF,yEAAyE;AACzE,eAAO,MAAM,iBAAiB,QAAO,MAAM,GAAG,SACjB,CAAC;AAE9B,gHAAgH;AAChH,eAAO,MAAM,uBAAuB,GAClC,IAAI,MAAM,EACV,UAAU,IAAI,KACb,WAAW,GAAG,IAEQ,CAAC;AAE1B,eAAO,MAAM,qBAAqB,GAAI,UAAU,QAAQ,KAAG,CAAC,MAAM,IAAI,CAMrE,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,sBAAsB,QAAO,OAA0B,CAAC;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,QAAO,CAAC,MAAM,IAAI,CAqB/C,CAAC"}
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
const listeners = new Set();
|
|
2
2
|
let stack = [];
|
|
3
3
|
let lastId = 0;
|
|
4
|
+
let suspensions = 0;
|
|
4
5
|
const notify = () => listeners.forEach(listener => listener());
|
|
5
|
-
export const pushModalRoot = overlayRoot => {
|
|
6
|
+
export const pushModalRoot = (overlayRoot, suspension) => {
|
|
6
7
|
lastId += 1;
|
|
7
8
|
stack = [...stack, {
|
|
8
9
|
id: lastId,
|
|
9
|
-
overlayRoot
|
|
10
|
+
overlayRoot,
|
|
11
|
+
suspension
|
|
10
12
|
}];
|
|
13
|
+
|
|
14
|
+
// A modal root that opens while the others are suspended joins them, or it would leave the overlay inert.
|
|
15
|
+
if (suspensions > 0) {
|
|
16
|
+
suspension == null || suspension.suspend();
|
|
17
|
+
}
|
|
11
18
|
notify();
|
|
12
19
|
return lastId;
|
|
13
20
|
};
|
|
@@ -51,4 +58,38 @@ export const subscribeToModalRoots = listener => {
|
|
|
51
58
|
listeners.delete(listener);
|
|
52
59
|
};
|
|
53
60
|
};
|
|
61
|
+
|
|
62
|
+
/** True while suspendModalRoots holds the open modal roots non-modal. */
|
|
63
|
+
export const areModalRootsSuspended = () => suspensions > 0;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Turns every open modal root into a non-modal dialog until the returned release is called, so an overlay that a
|
|
67
|
+
* third party renders into document.body, such as the Google Drive picker, can be used above them. The dialogs keep
|
|
68
|
+
* their place, look, content and order, and do not close. Calls nest: the modal roots come back, from the bottom up,
|
|
69
|
+
* with the last release. A suspended dialog sits at layers.cloud - 1, so the overlay must be at layers.cloud or above;
|
|
70
|
+
* the frontend raises the Google Drive picker there in its own CSS.
|
|
71
|
+
*/
|
|
72
|
+
export const suspendModalRoots = () => {
|
|
73
|
+
suspensions += 1;
|
|
74
|
+
if (suspensions === 1) {
|
|
75
|
+
[...stack].reverse().forEach(entry => {
|
|
76
|
+
var _entry$suspension;
|
|
77
|
+
return (_entry$suspension = entry.suspension) == null ? void 0 : _entry$suspension.suspend();
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
let released = false;
|
|
81
|
+
return () => {
|
|
82
|
+
if (released) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
released = true;
|
|
86
|
+
suspensions -= 1;
|
|
87
|
+
if (suspensions === 0) {
|
|
88
|
+
stack.forEach(entry => {
|
|
89
|
+
var _entry$suspension2;
|
|
90
|
+
return (_entry$suspension2 = entry.suspension) == null ? void 0 : _entry$suspension2.resume();
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
};
|
|
54
95
|
//# sourceMappingURL=modalRootStack.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modalRootStack.js","names":["listeners","Set","stack","lastId","notify","forEach","listener","pushModalRoot","overlayRoot","id","popModalRoot","some","entry","filter","isTopModalRoot","_stack","length","isInside","outside","contains","getTopModalOverlayRoot","_stack$filter$pop$ove","_stack$filter$pop","pop","getTopModalRootId","_stack2","getModalOverlayRootUpTo","_stack$filter$pop$ove2","_stack$filter$pop2","subscribeToModalRoots","add","delete"],"sources":["../../../../src/components/ModalRoot/modalRootStack.ts"],"sourcesContent":["type Listener = () => void;\n\ninterface Entry {\n id: number;\n overlayRoot: HTMLElement | null;\n}\n\nconst listeners = new Set<Listener>();\n\nlet stack: Entry[] = [];\nlet lastId = 0;\n\nconst notify = (): void => listeners.forEach((listener) => listener());\n\nexport const pushModalRoot = (overlayRoot: HTMLElement | null): number => {\n lastId += 1;\n stack = [...stack, { id: lastId, overlayRoot }];\n notify();\n\n return lastId;\n};\n\nexport const popModalRoot = (id: number): void => {\n if (!stack.some((entry) => entry.id === id)) {\n return;\n }\n\n stack = stack.filter((entry) => entry.id !== id);\n notify();\n};\n\nexport const isTopModalRoot = (id: number): boolean =>\n stack[stack.length - 1]?.id === id;\n\nconst isInside = (entry: Entry, outside?: Node) =>\n !!outside && !!entry.overlayRoot && outside.contains(entry.overlayRoot);\n\n/**\n * The overlay root of the top open modal root, where content that must stay above every modal goes. A modal root\n * whose overlay root sits inside outside, one opened from that content, is skipped, since content cannot move into\n * itself.\n */\nexport const getTopModalOverlayRoot = (outside?: Node): HTMLElement | null =>\n stack.filter((entry) => !isInside(entry, outside)).pop()?.overlayRoot ?? null;\n\n/** The id of the top open modal root, or undefined when none is open. */\nexport const getTopModalRootId = (): number | undefined =>\n stack[stack.length - 1]?.id;\n\n/** The overlay root of the top modal root among those opened no later than the given one, skipping as above. */\nexport const getModalOverlayRootUpTo = (\n id: number,\n outside?: Node\n): HTMLElement | null =>\n stack.filter((entry) => entry.id <= id && !isInside(entry, outside)).pop()\n ?.overlayRoot ?? null;\n\nexport const subscribeToModalRoots = (listener: Listener): (() => void) => {\n listeners.add(listener);\n\n return (): void => {\n listeners.delete(listener);\n };\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"modalRootStack.js","names":["listeners","Set","stack","lastId","suspensions","notify","forEach","listener","pushModalRoot","overlayRoot","suspension","id","suspend","popModalRoot","some","entry","filter","isTopModalRoot","_stack","length","isInside","outside","contains","getTopModalOverlayRoot","_stack$filter$pop$ove","_stack$filter$pop","pop","getTopModalRootId","_stack2","getModalOverlayRootUpTo","_stack$filter$pop$ove2","_stack$filter$pop2","subscribeToModalRoots","add","delete","areModalRootsSuspended","suspendModalRoots","reverse","_entry$suspension","released","_entry$suspension2","resume"],"sources":["../../../../src/components/ModalRoot/modalRootStack.ts"],"sourcesContent":["type Listener = () => void;\n\nexport interface ModalRootSuspension {\n suspend: () => void;\n resume: () => void;\n}\n\ninterface Entry {\n id: number;\n overlayRoot: HTMLElement | null;\n suspension?: ModalRootSuspension;\n}\n\nconst listeners = new Set<Listener>();\n\nlet stack: Entry[] = [];\nlet lastId = 0;\nlet suspensions = 0;\n\nconst notify = (): void => listeners.forEach((listener) => listener());\n\nexport const pushModalRoot = (\n overlayRoot: HTMLElement | null,\n suspension?: ModalRootSuspension\n): number => {\n lastId += 1;\n stack = [...stack, { id: lastId, overlayRoot, suspension }];\n\n // A modal root that opens while the others are suspended joins them, or it would leave the overlay inert.\n if (suspensions > 0) {\n suspension?.suspend();\n }\n\n notify();\n\n return lastId;\n};\n\nexport const popModalRoot = (id: number): void => {\n if (!stack.some((entry) => entry.id === id)) {\n return;\n }\n\n stack = stack.filter((entry) => entry.id !== id);\n notify();\n};\n\nexport const isTopModalRoot = (id: number): boolean =>\n stack[stack.length - 1]?.id === id;\n\nconst isInside = (entry: Entry, outside?: Node) =>\n !!outside && !!entry.overlayRoot && outside.contains(entry.overlayRoot);\n\n/**\n * The overlay root of the top open modal root, where content that must stay above every modal goes. A modal root\n * whose overlay root sits inside outside, one opened from that content, is skipped, since content cannot move into\n * itself.\n */\nexport const getTopModalOverlayRoot = (outside?: Node): HTMLElement | null =>\n stack.filter((entry) => !isInside(entry, outside)).pop()?.overlayRoot ?? null;\n\n/** The id of the top open modal root, or undefined when none is open. */\nexport const getTopModalRootId = (): number | undefined =>\n stack[stack.length - 1]?.id;\n\n/** The overlay root of the top modal root among those opened no later than the given one, skipping as above. */\nexport const getModalOverlayRootUpTo = (\n id: number,\n outside?: Node\n): HTMLElement | null =>\n stack.filter((entry) => entry.id <= id && !isInside(entry, outside)).pop()\n ?.overlayRoot ?? null;\n\nexport const subscribeToModalRoots = (listener: Listener): (() => void) => {\n listeners.add(listener);\n\n return (): void => {\n listeners.delete(listener);\n };\n};\n\n/** True while suspendModalRoots holds the open modal roots non-modal. */\nexport const areModalRootsSuspended = (): boolean => suspensions > 0;\n\n/**\n * Turns every open modal root into a non-modal dialog until the returned release is called, so an overlay that a\n * third party renders into document.body, such as the Google Drive picker, can be used above them. The dialogs keep\n * their place, look, content and order, and do not close. Calls nest: the modal roots come back, from the bottom up,\n * with the last release. A suspended dialog sits at layers.cloud - 1, so the overlay must be at layers.cloud or above;\n * the frontend raises the Google Drive picker there in its own CSS.\n */\nexport const suspendModalRoots = (): (() => void) => {\n suspensions += 1;\n\n if (suspensions === 1) {\n [...stack].reverse().forEach((entry) => entry.suspension?.suspend());\n }\n\n let released = false;\n\n return () => {\n if (released) {\n return;\n }\n\n released = true;\n suspensions -= 1;\n\n if (suspensions === 0) {\n stack.forEach((entry) => entry.suspension?.resume());\n }\n };\n};\n"],"mappings":"AAaA,MAAMA,SAAS,GAAG,IAAIC,GAAG,CAAW,CAAC;AAErC,IAAIC,KAAc,GAAG,EAAE;AACvB,IAAIC,MAAM,GAAG,CAAC;AACd,IAAIC,WAAW,GAAG,CAAC;AAEnB,MAAMC,MAAM,GAAGA,CAAA,KAAYL,SAAS,CAACM,OAAO,CAAEC,QAAQ,IAAKA,QAAQ,CAAC,CAAC,CAAC;AAEtE,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AAC,CAAC;IAAA,EAAC;EACtE;EAEA,IAAI2B,QAAQ,GAAG,KAAK;EAEpB,OAAO,MAAM;IACX,IAAIA,QAAQ,EAAE;MACZ;IACF;IAEAA,QAAQ,GAAG,IAAI;IACfnC,WAAW,IAAI,CAAC;IAEhB,IAAIA,WAAW,KAAK,CAAC,EAAE;MACrBF,KAAK,CAACI,OAAO,CAAES,KAAK;QAAA,IAAAyB,kBAAA;QAAA,QAAAA,kBAAA,GAAKzB,KAAK,CAACL,UAAU,qBAAhB8B,kBAAA,CAAkBC,MAAM,CAAC,CAAC;MAAA,EAAC;IACtD;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keeps the open native modals non-modal while active is true, so an overlay a third party renders into
|
|
3
|
+
* document.body, such as the Google Drive picker, can be used above them. They come back when active turns false
|
|
4
|
+
* or the component unmounts. A layout effect, so the overlay is never painted under a modal and the order against
|
|
5
|
+
* ModalRoot's own layout effects is fixed.
|
|
6
|
+
*/
|
|
7
|
+
export declare const useSuspendModalRoots: (active: boolean) => void;
|
|
8
|
+
//# sourceMappingURL=useSuspendModalRoots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSuspendModalRoots.d.ts","sourceRoot":"","sources":["../../../../src/components/ModalRoot/useSuspendModalRoots.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,GAAI,QAAQ,OAAO,KAAG,IAEtD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useLayoutEffect } from "react";
|
|
2
|
+
import { suspendModalRoots } from "./modalRootStack";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Keeps the open native modals non-modal while active is true, so an overlay a third party renders into
|
|
6
|
+
* document.body, such as the Google Drive picker, can be used above them. They come back when active turns false
|
|
7
|
+
* or the component unmounts. A layout effect, so the overlay is never painted under a modal and the order against
|
|
8
|
+
* ModalRoot's own layout effects is fixed.
|
|
9
|
+
*/
|
|
10
|
+
export const useSuspendModalRoots = active => {
|
|
11
|
+
useLayoutEffect(() => active ? suspendModalRoots() : undefined, [active]);
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=useSuspendModalRoots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSuspendModalRoots.js","names":["useLayoutEffect","suspendModalRoots","useSuspendModalRoots","active","undefined"],"sources":["../../../../src/components/ModalRoot/useSuspendModalRoots.ts"],"sourcesContent":["import { useLayoutEffect } from \"react\";\n\nimport { suspendModalRoots } from \"./modalRootStack\";\n\n/**\n * Keeps the open native modals non-modal while active is true, so an overlay a third party renders into\n * document.body, such as the Google Drive picker, can be used above them. They come back when active turns false\n * or the component unmounts. A layout effect, so the overlay is never painted under a modal and the order against\n * ModalRoot's own layout effects is fixed.\n */\nexport const useSuspendModalRoots = (active: boolean): void => {\n useLayoutEffect(() => (active ? suspendModalRoots() : undefined), [active]);\n};\n"],"mappings":"AAAA,SAASA,eAAe,QAAQ,OAAO;AAEvC,SAASC,iBAAiB,QAAQ,kBAAkB;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAoB,GAAIC,MAAe,IAAW;EAC7DH,eAAe,CAAC,MAAOG,MAAM,GAAGF,iBAAiB,CAAC,CAAC,GAAGG,SAAU,EAAE,CAACD,MAAM,CAAC,CAAC;AAC7E,CAAC","ignoreList":[]}
|
|
@@ -70,6 +70,8 @@ export * from "./ProgressPie";
|
|
|
70
70
|
export * from "./Reactions";
|
|
71
71
|
export * from "./Label";
|
|
72
72
|
export * from "./GlobalPortal";
|
|
73
|
+
export { suspendModalRoots } from "./ModalRoot/modalRootStack";
|
|
74
|
+
export { useSuspendModalRoots } from "./ModalRoot/useSuspendModalRoots";
|
|
73
75
|
export * from "./GlobalStyle";
|
|
74
76
|
export * from "./ProgressRing";
|
|
75
77
|
export * from "./EditableContent";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C/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
|
|
@@ -70,6 +70,8 @@ export * from "./ProgressPie";
|
|
|
70
70
|
export * from "./Reactions";
|
|
71
71
|
export * from "./Label";
|
|
72
72
|
export * from "./GlobalPortal";
|
|
73
|
+
export { suspendModalRoots } from "./ModalRoot/modalRootStack";
|
|
74
|
+
export { useSuspendModalRoots } from "./ModalRoot/useSuspendModalRoots";
|
|
73
75
|
export * from "./GlobalStyle";
|
|
74
76
|
export * from "./ProgressRing";
|
|
75
77
|
export * from "./EditableContent";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/index.ts"],"sourcesContent":["export * from \"./Button\";\nexport * from \"./CaretButton\";\nexport * from \"./ButtonGroup\";\nexport * from \"./Breadcrumbs\";\nexport * from \"./CounterButton\";\nexport * from \"./Steppers\";\nexport * from \"./Tables\";\nexport * from \"./CompleteCheckbox\";\nexport * from \"./Paper\";\nexport * from \"./ScaleBar\";\nexport * from \"./Card\";\nexport * from \"./EntityCard\";\nexport * from \"./EntitiesHeader\";\nexport * from \"./Signifier\";\nexport * from \"./Avatar\";\nexport * from \"./Tag\";\nexport * from \"./Loaders\";\nexport * from \"./Nav\";\nexport * from \"./SideNav\";\nexport * from \"./Bubble\";\nexport * from \"./Input\";\nexport * from \"./Display\";\nexport * from \"./DrilldownMenu\";\nexport * from \"./Menu\";\nexport * from \"./Expanders\";\nexport * from \"./DatePicker\";\nexport * from \"./List\";\nexport * from \"./MenuSelector\";\nexport * from \"./MultiAvatar\";\nexport * from \"./RadioButton\";\nexport * from \"./RadioCard\";\nexport * from \"./RadioGroup\";\nexport * from \"./ScrollShadow\";\nexport * from \"./Icons\";\nexport * from \"./Textarea\";\nexport * from \"./Modal\";\nexport * from \"./Sheet\";\nexport * from \"./Header\";\nexport * from \"./AutoResizeTextarea\";\nexport * from \"./Overlay\";\nexport * from \"./Accordion\";\nexport * from \"./Choose\";\nexport * from \"./ChooseV2\";\nexport * from \"./Links\";\nexport * from \"./SelectDate\";\nexport * from \"./Popper\";\nexport * from \"./ToastMessage\";\nexport * from \"./Tooltip\";\nexport * from \"./Transitions\";\nexport * from \"./Window\";\nexport * from \"./ValueButton\";\nexport * from \"./PillButton\";\nexport * from \"./PillGroup\";\nexport * from \"./ViewSwitcher\";\nexport * from \"./Select\";\nexport * from \"./SelectTrigger\";\nexport * from \"./SelectTime\";\nexport * from \"./Dialog\";\nexport * from \"./ObjectFormModal\";\nexport * from \"./ConfirmDialog\";\nexport * from \"./Checkbox\";\nexport * from \"./Toggle\";\nexport * from \"./Typography\";\nexport * from \"./Autocomplete\";\nexport * from \"./ComboBox\";\nexport * from \"./Button/AddToListButton\";\nexport * from \"./PortableText\";\nexport * from \"./ProgressBar\";\nexport * from \"./ProgressPie\";\nexport * from \"./Reactions\";\nexport * from \"./Label\";\nexport * from \"./GlobalPortal\";\nexport * from \"./GlobalStyle\";\nexport * from \"./ProgressRing\";\nexport * from \"./EditableContent\";\nexport * from \"./EditableText\";\nexport * from \"./EditableHours\";\nexport * from \"./EditableCurrency\";\nexport * from \"./Folder\";\nexport * from \"./Chip\";\nexport * from \"./Trigger\";\nexport * from \"./Dot\";\nexport * from \"./Entity\";\nexport * from \"./Filter\";\nexport * from \"./Wizard\";\nexport * from \"./ContentWizard\";\nexport * from \"./IconButton\";\nexport * from \"./Typography\";\nexport * from \"./Badge\";\nexport * from \"./AvatarGroup\";\nexport * from \"./CommandPalette\";\nexport * from \"./EmptySlate\";\nexport * from \"./NoResultsSlate\";\nexport * from \"./FilterInput\";\nexport * from \"./Toolbar\";\nexport * from \"./InfoBox\";\nexport * from \"./Sort\";\nexport * from \"./StepSequence\";\nexport * from \"./StackedCard\";\nexport * from \"./Stack\";\nexport * from \"./Row\";\nexport * from \"./Columns\";\nexport * from \"./Tiles\";\nexport * from \"./Media\";\nexport * from \"./TitledText\";\nexport * from \"./LayoutTokens\";\nexport * from \"./Section\";\nexport * from \"./Collapse\";\nexport * from \"./LabeledDivider\";\nexport * from \"./FloatingPill\";\nexport * from \"./ClampedContent\";\nexport * from \"./ResizeHandle\";\nexport * from \"./ObjectLayout\";\nexport * from \"./ListRow\";\nexport * from \"./FileTile\";\nexport * from \"./EditorFrame\";\nexport * from \"./PropertyList\";\nexport * from \"./MessageBubble\";\nexport * from \"./DockedCard\";\n"],"mappings":"AAAA,cAAc,UAAU;AACxB,cAAc,eAAe;AAC7B,cAAc,eAAe;AAC7B,cAAc,eAAe;AAC7B,cAAc,iBAAiB;AAC/B,cAAc,YAAY;AAC1B,cAAc,UAAU;AACxB,cAAc,oBAAoB;AAClC,cAAc,SAAS;AACvB,cAAc,YAAY;AAC1B,cAAc,QAAQ;AACtB,cAAc,cAAc;AAC5B,cAAc,kBAAkB;AAChC,cAAc,aAAa;AAC3B,cAAc,UAAU;AACxB,cAAc,OAAO;AACrB,cAAc,WAAW;AACzB,cAAc,OAAO;AACrB,cAAc,WAAW;AACzB,cAAc,UAAU;AACxB,cAAc,SAAS;AACvB,cAAc,WAAW;AACzB,cAAc,iBAAiB;AAC/B,cAAc,QAAQ;AACtB,cAAc,aAAa;AAC3B,cAAc,cAAc;AAC5B,cAAc,QAAQ;AACtB,cAAc,gBAAgB;AAC9B,cAAc,eAAe;AAC7B,cAAc,eAAe;AAC7B,cAAc,aAAa;AAC3B,cAAc,cAAc;AAC5B,cAAc,gBAAgB;AAC9B,cAAc,SAAS;AACvB,cAAc,YAAY;AAC1B,cAAc,SAAS;AACvB,cAAc,SAAS;AACvB,cAAc,UAAU;AACxB,cAAc,sBAAsB;AACpC,cAAc,WAAW;AACzB,cAAc,aAAa;AAC3B,cAAc,UAAU;AACxB,cAAc,YAAY;AAC1B,cAAc,SAAS;AACvB,cAAc,cAAc;AAC5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,kBAAkB;AAChC,cAAc,gBAAgB;AAC9B,cAAc,kBAAkB;AAChC,cAAc,gBAAgB;AAC9B,cAAc,gBAAgB;AAC9B,cAAc,WAAW;AACzB,cAAc,YAAY;AAC1B,cAAc,eAAe;AAC7B,cAAc,gBAAgB;AAC9B,cAAc,iBAAiB;AAC/B,cAAc,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["suspendModalRoots","useSuspendModalRoots"],"sources":["../../../src/components/index.ts"],"sourcesContent":["export * from \"./Button\";\nexport * from \"./CaretButton\";\nexport * from \"./ButtonGroup\";\nexport * from \"./Breadcrumbs\";\nexport * from \"./CounterButton\";\nexport * from \"./Steppers\";\nexport * from \"./Tables\";\nexport * from \"./CompleteCheckbox\";\nexport * from \"./Paper\";\nexport * from \"./ScaleBar\";\nexport * from \"./Card\";\nexport * from \"./EntityCard\";\nexport * from \"./EntitiesHeader\";\nexport * from \"./Signifier\";\nexport * from \"./Avatar\";\nexport * from \"./Tag\";\nexport * from \"./Loaders\";\nexport * from \"./Nav\";\nexport * from \"./SideNav\";\nexport * from \"./Bubble\";\nexport * from \"./Input\";\nexport * from \"./Display\";\nexport * from \"./DrilldownMenu\";\nexport * from \"./Menu\";\nexport * from \"./Expanders\";\nexport * from \"./DatePicker\";\nexport * from \"./List\";\nexport * from \"./MenuSelector\";\nexport * from \"./MultiAvatar\";\nexport * from \"./RadioButton\";\nexport * from \"./RadioCard\";\nexport * from \"./RadioGroup\";\nexport * from \"./ScrollShadow\";\nexport * from \"./Icons\";\nexport * from \"./Textarea\";\nexport * from \"./Modal\";\nexport * from \"./Sheet\";\nexport * from \"./Header\";\nexport * from \"./AutoResizeTextarea\";\nexport * from \"./Overlay\";\nexport * from \"./Accordion\";\nexport * from \"./Choose\";\nexport * from \"./ChooseV2\";\nexport * from \"./Links\";\nexport * from \"./SelectDate\";\nexport * from \"./Popper\";\nexport * from \"./ToastMessage\";\nexport * from \"./Tooltip\";\nexport * from \"./Transitions\";\nexport * from \"./Window\";\nexport * from \"./ValueButton\";\nexport * from \"./PillButton\";\nexport * from \"./PillGroup\";\nexport * from \"./ViewSwitcher\";\nexport * from \"./Select\";\nexport * from \"./SelectTrigger\";\nexport * from \"./SelectTime\";\nexport * from \"./Dialog\";\nexport * from \"./ObjectFormModal\";\nexport * from \"./ConfirmDialog\";\nexport * from \"./Checkbox\";\nexport * from \"./Toggle\";\nexport * from \"./Typography\";\nexport * from \"./Autocomplete\";\nexport * from \"./ComboBox\";\nexport * from \"./Button/AddToListButton\";\nexport * from \"./PortableText\";\nexport * from \"./ProgressBar\";\nexport * from \"./ProgressPie\";\nexport * from \"./Reactions\";\nexport * from \"./Label\";\nexport * from \"./GlobalPortal\";\nexport { suspendModalRoots } from \"./ModalRoot/modalRootStack\";\nexport { useSuspendModalRoots } from \"./ModalRoot/useSuspendModalRoots\";\nexport * from \"./GlobalStyle\";\nexport * from \"./ProgressRing\";\nexport * from \"./EditableContent\";\nexport * from \"./EditableText\";\nexport * from \"./EditableHours\";\nexport * from \"./EditableCurrency\";\nexport * from \"./Folder\";\nexport * from \"./Chip\";\nexport * from \"./Trigger\";\nexport * from \"./Dot\";\nexport * from \"./Entity\";\nexport * from \"./Filter\";\nexport * from \"./Wizard\";\nexport * from \"./ContentWizard\";\nexport * from \"./IconButton\";\nexport * from \"./Typography\";\nexport * from \"./Badge\";\nexport * from \"./AvatarGroup\";\nexport * from \"./CommandPalette\";\nexport * from \"./EmptySlate\";\nexport * from \"./NoResultsSlate\";\nexport * from \"./FilterInput\";\nexport * from \"./Toolbar\";\nexport * from \"./InfoBox\";\nexport * from \"./Sort\";\nexport * from \"./StepSequence\";\nexport * from \"./StackedCard\";\nexport * from \"./Stack\";\nexport * from \"./Row\";\nexport * from \"./Columns\";\nexport * from \"./Tiles\";\nexport * from \"./Media\";\nexport * from \"./TitledText\";\nexport * from \"./LayoutTokens\";\nexport * from \"./Section\";\nexport * from \"./Collapse\";\nexport * from \"./LabeledDivider\";\nexport * from \"./FloatingPill\";\nexport * from \"./ClampedContent\";\nexport * from \"./ResizeHandle\";\nexport * from \"./ObjectLayout\";\nexport * from \"./ListRow\";\nexport * from \"./FileTile\";\nexport * from \"./EditorFrame\";\nexport * from \"./PropertyList\";\nexport * from \"./MessageBubble\";\nexport * from \"./DockedCard\";\n"],"mappings":"AAAA,cAAc,UAAU;AACxB,cAAc,eAAe;AAC7B,cAAc,eAAe;AAC7B,cAAc,eAAe;AAC7B,cAAc,iBAAiB;AAC/B,cAAc,YAAY;AAC1B,cAAc,UAAU;AACxB,cAAc,oBAAoB;AAClC,cAAc,SAAS;AACvB,cAAc,YAAY;AAC1B,cAAc,QAAQ;AACtB,cAAc,cAAc;AAC5B,cAAc,kBAAkB;AAChC,cAAc,aAAa;AAC3B,cAAc,UAAU;AACxB,cAAc,OAAO;AACrB,cAAc,WAAW;AACzB,cAAc,OAAO;AACrB,cAAc,WAAW;AACzB,cAAc,UAAU;AACxB,cAAc,SAAS;AACvB,cAAc,WAAW;AACzB,cAAc,iBAAiB;AAC/B,cAAc,QAAQ;AACtB,cAAc,aAAa;AAC3B,cAAc,cAAc;AAC5B,cAAc,QAAQ;AACtB,cAAc,gBAAgB;AAC9B,cAAc,eAAe;AAC7B,cAAc,eAAe;AAC7B,cAAc,aAAa;AAC3B,cAAc,cAAc;AAC5B,cAAc,gBAAgB;AAC9B,cAAc,SAAS;AACvB,cAAc,YAAY;AAC1B,cAAc,SAAS;AACvB,cAAc,SAAS;AACvB,cAAc,UAAU;AACxB,cAAc,sBAAsB;AACpC,cAAc,WAAW;AACzB,cAAc,aAAa;AAC3B,cAAc,UAAU;AACxB,cAAc,YAAY;AAC1B,cAAc,SAAS;AACvB,cAAc,cAAc;AAC5B,cAAc,UAAU;AACxB,cAAc,gBAAgB;AAC9B,cAAc,WAAW;AACzB,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,eAAe;AAC7B,cAAc,cAAc;AAC5B,cAAc,aAAa;AAC3B,cAAc,gBAAgB;AA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B,cAAc,WAAW;AACzB,cAAc,YAAY;AAC1B,cAAc,eAAe;AAC7B,cAAc,gBAAgB;AAC9B,cAAc,iBAAiB;AAC/B,cAAc,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactElement } from "react";
|
|
2
|
+
import { MyWorkTasksState } from "./MyWorkTasks";
|
|
3
|
+
export interface MyWorkListSettingsDialogProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
state: MyWorkTasksState;
|
|
7
|
+
}
|
|
8
|
+
export declare const MyWorkListSettingsDialog: {
|
|
9
|
+
({ open, onClose, state, }: MyWorkListSettingsDialogProps): ReactElement;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=MyWorkListSettingsDialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MyWorkListSettingsDialog.d.ts","sourceRoot":"","sources":["../../../../src/presentation/myWork/MyWorkListSettingsDialog.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAe,YAAY,EAAa,MAAM,OAAO,CAAC;AAIpE,OAAO,EAIL,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAqLvB,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,gBAAgB,CAAC;CACzB;AAED,eAAO,MAAM,wBAAwB;gCAIlC,6BAA6B,GAAG,YAAY;;CA4H9C,CAAC"}
|