@uipath/apollo-react 6.42.0 → 6.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/canvas/components/CanvasTakeoverModal/CanvasTakeoverModal.cjs +21 -104
- package/dist/canvas/components/CanvasTakeoverModal/CanvasTakeoverModal.d.ts +1 -1
- package/dist/canvas/components/CanvasTakeoverModal/CanvasTakeoverModal.d.ts.map +1 -1
- package/dist/canvas/components/CanvasTakeoverModal/CanvasTakeoverModal.js +24 -97
- package/dist/canvas/styles/tailwind.canvas.css +1 -1
- package/dist/material/components/ap-chat/locales/de.cjs +1 -1
- package/dist/material/components/ap-chat/locales/de.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/de.js +1 -1
- package/dist/material/components/ap-chat/locales/es-MX.cjs +1 -1
- package/dist/material/components/ap-chat/locales/es-MX.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/es-MX.js +1 -1
- package/dist/material/components/ap-chat/locales/es.cjs +1 -1
- package/dist/material/components/ap-chat/locales/es.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/es.js +1 -1
- package/dist/material/components/ap-chat/locales/fr.cjs +1 -1
- package/dist/material/components/ap-chat/locales/fr.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/fr.js +1 -1
- package/dist/material/components/ap-chat/locales/ja.cjs +1 -1
- package/dist/material/components/ap-chat/locales/ja.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/ja.js +1 -1
- package/dist/material/components/ap-chat/locales/ko.cjs +1 -1
- package/dist/material/components/ap-chat/locales/ko.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/ko.js +1 -1
- package/dist/material/components/ap-chat/locales/pt-BR.cjs +1 -1
- package/dist/material/components/ap-chat/locales/pt-BR.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/pt-BR.js +1 -1
- package/dist/material/components/ap-chat/locales/pt.cjs +1 -1
- package/dist/material/components/ap-chat/locales/pt.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/pt.js +1 -1
- package/dist/material/components/ap-chat/locales/ro.cjs +1 -1
- package/dist/material/components/ap-chat/locales/ro.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/ro.js +1 -1
- package/dist/material/components/ap-chat/locales/tr.cjs +1 -1
- package/dist/material/components/ap-chat/locales/tr.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/tr.js +1 -1
- package/dist/material/components/ap-chat/locales/zh-CN.cjs +1 -1
- package/dist/material/components/ap-chat/locales/zh-CN.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/zh-CN.js +1 -1
- package/dist/material/components/ap-chat/locales/zh-TW.cjs +1 -1
- package/dist/material/components/ap-chat/locales/zh-TW.d.ts.map +1 -1
- package/dist/material/components/ap-chat/locales/zh-TW.js +1 -1
- package/package.json +3 -3
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
|
-
(()=>{
|
|
4
|
-
__webpack_require__.n = (module)=>{
|
|
5
|
-
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
-
__webpack_require__.d(getter, {
|
|
7
|
-
a: getter
|
|
8
|
-
});
|
|
9
|
-
return getter;
|
|
10
|
-
};
|
|
11
|
-
})();
|
|
12
3
|
(()=>{
|
|
13
4
|
__webpack_require__.d = (exports1, definition)=>{
|
|
14
5
|
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
@@ -37,113 +28,39 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
37
28
|
});
|
|
38
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
39
30
|
const apollo_wind_namespaceObject = require("@uipath/apollo-wind");
|
|
40
|
-
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
41
31
|
const external_react_namespaceObject = require("react");
|
|
42
|
-
|
|
43
|
-
var external_react_focus_lock_default = /*#__PURE__*/ __webpack_require__.n(external_react_focus_lock_namespaceObject);
|
|
44
|
-
function CanvasTakeoverModal({ open, onOpenChange, title, headerActions, sidebar, children, expanded: controlledExpanded, defaultExpanded = false, onExpandedChange, className, sidebarClassName, closeOnBackdropClick = true }) {
|
|
45
|
-
const titleId = (0, external_react_namespaceObject.useId)();
|
|
46
|
-
const expandButtonRef = (0, external_react_namespaceObject.useRef)(null);
|
|
32
|
+
function CanvasTakeoverModal({ open, onOpenChange, title, headerActions, sidebar, children, expanded, defaultExpanded, onExpandedChange, className, sidebarClassName, closeOnBackdropClick = true }) {
|
|
47
33
|
const previouslyFocusedElementRef = (0, external_react_namespaceObject.useRef)(null);
|
|
48
|
-
const [uncontrolledExpanded, setUncontrolledExpanded] = (0, external_react_namespaceObject.useState)(defaultExpanded);
|
|
49
|
-
const expanded = controlledExpanded ?? uncontrolledExpanded;
|
|
50
34
|
(0, external_react_namespaceObject.useEffect)(()=>{
|
|
51
35
|
if (!open) return;
|
|
52
36
|
previouslyFocusedElementRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
53
|
-
const animationFrame = requestAnimationFrame(()=>expandButtonRef.current?.focus());
|
|
54
|
-
const handleKeyDown = (event)=>{
|
|
55
|
-
if ('Escape' === event.key) onOpenChange?.(false);
|
|
56
|
-
};
|
|
57
|
-
document.addEventListener('keydown', handleKeyDown);
|
|
58
37
|
return ()=>{
|
|
59
|
-
cancelAnimationFrame(animationFrame);
|
|
60
|
-
document.removeEventListener('keydown', handleKeyDown);
|
|
61
38
|
previouslyFocusedElementRef.current?.focus();
|
|
62
39
|
previouslyFocusedElementRef.current = null;
|
|
63
40
|
};
|
|
64
41
|
}, [
|
|
65
|
-
onOpenChange,
|
|
66
42
|
open
|
|
67
43
|
]);
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
className: (0, apollo_wind_namespaceObject.cn)('flex min-h-0 flex-col overflow-hidden border border-border-subtle bg-surface-raised text-foreground shadow-xl transition-[width,height,border-radius] duration-200', expanded ? 'h-full w-full rounded-none' : 'h-[95%] w-[95%] rounded-2xl', className),
|
|
89
|
-
children: [
|
|
90
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("header", {
|
|
91
|
-
className: "flex h-12 shrink-0 items-center gap-3 border-b border-border-subtle px-4",
|
|
92
|
-
children: [
|
|
93
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("h2", {
|
|
94
|
-
id: titleId,
|
|
95
|
-
className: "min-w-0 flex-1 truncate text-sm font-semibold",
|
|
96
|
-
children: title
|
|
97
|
-
}),
|
|
98
|
-
headerActions,
|
|
99
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
100
|
-
className: "-mr-1 flex shrink-0 items-center gap-1",
|
|
101
|
-
children: [
|
|
102
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
103
|
-
ref: expandButtonRef,
|
|
104
|
-
type: "button",
|
|
105
|
-
onClick: ()=>setExpanded(!expanded),
|
|
106
|
-
className: "grid size-8 place-items-center rounded-md text-foreground-muted transition-colors hover:bg-surface-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
107
|
-
"aria-label": expanded ? 'Collapse modal' : 'Expand modal',
|
|
108
|
-
title: expanded ? 'Collapse modal' : 'Expand modal',
|
|
109
|
-
children: expanded ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Minimize2, {
|
|
110
|
-
size: 16,
|
|
111
|
-
strokeWidth: 1.75
|
|
112
|
-
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Maximize2, {
|
|
113
|
-
size: 16,
|
|
114
|
-
strokeWidth: 1.75
|
|
115
|
-
})
|
|
116
|
-
}),
|
|
117
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("button", {
|
|
118
|
-
type: "button",
|
|
119
|
-
onClick: ()=>onOpenChange?.(false),
|
|
120
|
-
className: "grid size-8 place-items-center rounded-md text-foreground-muted transition-colors hover:bg-surface-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
121
|
-
"aria-label": "Close modal",
|
|
122
|
-
title: "Close modal",
|
|
123
|
-
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.X, {
|
|
124
|
-
size: 16,
|
|
125
|
-
strokeWidth: 1.75
|
|
126
|
-
})
|
|
127
|
-
})
|
|
128
|
-
]
|
|
129
|
-
})
|
|
130
|
-
]
|
|
131
|
-
}),
|
|
132
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
|
|
133
|
-
className: "flex min-h-0 flex-1",
|
|
134
|
-
children: [
|
|
135
|
-
null != sidebar && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("aside", {
|
|
136
|
-
className: (0, apollo_wind_namespaceObject.cn)('w-64 shrink-0 overflow-auto border-r border-border-subtle', sidebarClassName),
|
|
137
|
-
children: sidebar
|
|
138
|
-
}),
|
|
139
|
-
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("main", {
|
|
140
|
-
className: "min-w-0 flex-1 overflow-auto",
|
|
141
|
-
children: children
|
|
142
|
-
})
|
|
143
|
-
]
|
|
144
|
-
})
|
|
145
|
-
]
|
|
146
|
-
})
|
|
44
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.Modal, {
|
|
45
|
+
open: open,
|
|
46
|
+
onOpenChange: onOpenChange,
|
|
47
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(apollo_wind_namespaceObject.ModalContent, {
|
|
48
|
+
variant: "takeover",
|
|
49
|
+
headerTitle: title,
|
|
50
|
+
headerActions: headerActions,
|
|
51
|
+
sidebar: sidebar,
|
|
52
|
+
expanded: expanded,
|
|
53
|
+
defaultExpanded: defaultExpanded,
|
|
54
|
+
onExpandedChange: onExpandedChange,
|
|
55
|
+
className: className,
|
|
56
|
+
sidebarClassName: sidebarClassName,
|
|
57
|
+
closeOnBackdropClick: closeOnBackdropClick,
|
|
58
|
+
overlayTestId: "canvas-takeover-backdrop",
|
|
59
|
+
onOpenAutoFocus: (event)=>{
|
|
60
|
+
event.preventDefault();
|
|
61
|
+
event.currentTarget.querySelector('[aria-label="Expand modal"], [aria-label="Collapse modal"]')?.focus();
|
|
62
|
+
},
|
|
63
|
+
children: children
|
|
147
64
|
})
|
|
148
65
|
});
|
|
149
66
|
}
|
|
@@ -13,5 +13,5 @@ export interface CanvasTakeoverModalProps {
|
|
|
13
13
|
sidebarClassName?: string;
|
|
14
14
|
closeOnBackdropClick?: boolean;
|
|
15
15
|
}
|
|
16
|
-
export declare function CanvasTakeoverModal({ open, onOpenChange, title, headerActions, sidebar, children, expanded
|
|
16
|
+
export declare function CanvasTakeoverModal({ open, onOpenChange, title, headerActions, sidebar, children, expanded, defaultExpanded, onExpandedChange, className, sidebarClassName, closeOnBackdropClick, }: CanvasTakeoverModalProps): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
//# sourceMappingURL=CanvasTakeoverModal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CanvasTakeoverModal.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/CanvasTakeoverModal/CanvasTakeoverModal.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CanvasTakeoverModal.d.ts","sourceRoot":"","sources":["../../../../src/canvas/components/CanvasTakeoverModal/CanvasTakeoverModal.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,OAAO,CAAC;AAE1D,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,KAAK,EAAE,SAAS,CAAC;IACjB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAGD,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,YAAY,EACZ,KAAK,EACL,aAAa,EACb,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,SAAS,EACT,gBAAgB,EAChB,oBAA2B,GAC5B,EAAE,wBAAwB,2CAwC1B"}
|
|
@@ -1,111 +1,38 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import react_focus_lock from "react-focus-lock";
|
|
6
|
-
function CanvasTakeoverModal({ open, onOpenChange, title, headerActions, sidebar, children, expanded: controlledExpanded, defaultExpanded = false, onExpandedChange, className, sidebarClassName, closeOnBackdropClick = true }) {
|
|
7
|
-
const titleId = useId();
|
|
8
|
-
const expandButtonRef = useRef(null);
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Modal, ModalContent } from "@uipath/apollo-wind";
|
|
3
|
+
import { useEffect, useRef } from "react";
|
|
4
|
+
function CanvasTakeoverModal({ open, onOpenChange, title, headerActions, sidebar, children, expanded, defaultExpanded, onExpandedChange, className, sidebarClassName, closeOnBackdropClick = true }) {
|
|
9
5
|
const previouslyFocusedElementRef = useRef(null);
|
|
10
|
-
const [uncontrolledExpanded, setUncontrolledExpanded] = useState(defaultExpanded);
|
|
11
|
-
const expanded = controlledExpanded ?? uncontrolledExpanded;
|
|
12
6
|
useEffect(()=>{
|
|
13
7
|
if (!open) return;
|
|
14
8
|
previouslyFocusedElementRef.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
15
|
-
const animationFrame = requestAnimationFrame(()=>expandButtonRef.current?.focus());
|
|
16
|
-
const handleKeyDown = (event)=>{
|
|
17
|
-
if ('Escape' === event.key) onOpenChange?.(false);
|
|
18
|
-
};
|
|
19
|
-
document.addEventListener('keydown', handleKeyDown);
|
|
20
9
|
return ()=>{
|
|
21
|
-
cancelAnimationFrame(animationFrame);
|
|
22
|
-
document.removeEventListener('keydown', handleKeyDown);
|
|
23
10
|
previouslyFocusedElementRef.current?.focus();
|
|
24
11
|
previouslyFocusedElementRef.current = null;
|
|
25
12
|
};
|
|
26
13
|
}, [
|
|
27
|
-
onOpenChange,
|
|
28
14
|
open
|
|
29
15
|
]);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
className: cn('flex min-h-0 flex-col overflow-hidden border border-border-subtle bg-surface-raised text-foreground shadow-xl transition-[width,height,border-radius] duration-200', expanded ? 'h-full w-full rounded-none' : 'h-[95%] w-[95%] rounded-2xl', className),
|
|
51
|
-
children: [
|
|
52
|
-
/*#__PURE__*/ jsxs("header", {
|
|
53
|
-
className: "flex h-12 shrink-0 items-center gap-3 border-b border-border-subtle px-4",
|
|
54
|
-
children: [
|
|
55
|
-
/*#__PURE__*/ jsx("h2", {
|
|
56
|
-
id: titleId,
|
|
57
|
-
className: "min-w-0 flex-1 truncate text-sm font-semibold",
|
|
58
|
-
children: title
|
|
59
|
-
}),
|
|
60
|
-
headerActions,
|
|
61
|
-
/*#__PURE__*/ jsxs("div", {
|
|
62
|
-
className: "-mr-1 flex shrink-0 items-center gap-1",
|
|
63
|
-
children: [
|
|
64
|
-
/*#__PURE__*/ jsx("button", {
|
|
65
|
-
ref: expandButtonRef,
|
|
66
|
-
type: "button",
|
|
67
|
-
onClick: ()=>setExpanded(!expanded),
|
|
68
|
-
className: "grid size-8 place-items-center rounded-md text-foreground-muted transition-colors hover:bg-surface-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
69
|
-
"aria-label": expanded ? 'Collapse modal' : 'Expand modal',
|
|
70
|
-
title: expanded ? 'Collapse modal' : 'Expand modal',
|
|
71
|
-
children: expanded ? /*#__PURE__*/ jsx(Minimize2, {
|
|
72
|
-
size: 16,
|
|
73
|
-
strokeWidth: 1.75
|
|
74
|
-
}) : /*#__PURE__*/ jsx(Maximize2, {
|
|
75
|
-
size: 16,
|
|
76
|
-
strokeWidth: 1.75
|
|
77
|
-
})
|
|
78
|
-
}),
|
|
79
|
-
/*#__PURE__*/ jsx("button", {
|
|
80
|
-
type: "button",
|
|
81
|
-
onClick: ()=>onOpenChange?.(false),
|
|
82
|
-
className: "grid size-8 place-items-center rounded-md text-foreground-muted transition-colors hover:bg-surface-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-focus",
|
|
83
|
-
"aria-label": "Close modal",
|
|
84
|
-
title: "Close modal",
|
|
85
|
-
children: /*#__PURE__*/ jsx(X, {
|
|
86
|
-
size: 16,
|
|
87
|
-
strokeWidth: 1.75
|
|
88
|
-
})
|
|
89
|
-
})
|
|
90
|
-
]
|
|
91
|
-
})
|
|
92
|
-
]
|
|
93
|
-
}),
|
|
94
|
-
/*#__PURE__*/ jsxs("div", {
|
|
95
|
-
className: "flex min-h-0 flex-1",
|
|
96
|
-
children: [
|
|
97
|
-
null != sidebar && /*#__PURE__*/ jsx("aside", {
|
|
98
|
-
className: cn('w-64 shrink-0 overflow-auto border-r border-border-subtle', sidebarClassName),
|
|
99
|
-
children: sidebar
|
|
100
|
-
}),
|
|
101
|
-
/*#__PURE__*/ jsx("main", {
|
|
102
|
-
className: "min-w-0 flex-1 overflow-auto",
|
|
103
|
-
children: children
|
|
104
|
-
})
|
|
105
|
-
]
|
|
106
|
-
})
|
|
107
|
-
]
|
|
108
|
-
})
|
|
16
|
+
return /*#__PURE__*/ jsx(Modal, {
|
|
17
|
+
open: open,
|
|
18
|
+
onOpenChange: onOpenChange,
|
|
19
|
+
children: /*#__PURE__*/ jsx(ModalContent, {
|
|
20
|
+
variant: "takeover",
|
|
21
|
+
headerTitle: title,
|
|
22
|
+
headerActions: headerActions,
|
|
23
|
+
sidebar: sidebar,
|
|
24
|
+
expanded: expanded,
|
|
25
|
+
defaultExpanded: defaultExpanded,
|
|
26
|
+
onExpandedChange: onExpandedChange,
|
|
27
|
+
className: className,
|
|
28
|
+
sidebarClassName: sidebarClassName,
|
|
29
|
+
closeOnBackdropClick: closeOnBackdropClick,
|
|
30
|
+
overlayTestId: "canvas-takeover-backdrop",
|
|
31
|
+
onOpenAutoFocus: (event)=>{
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
event.currentTarget.querySelector('[aria-label="Expand modal"], [aria-label="Collapse modal"]')?.focus();
|
|
34
|
+
},
|
|
35
|
+
children: children
|
|
109
36
|
})
|
|
110
37
|
});
|
|
111
38
|
}
|