@uipath/apollo-wind 2.87.0 → 2.89.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/components/ui/connection-picker/components/connection-actions-menu.cjs +129 -0
- package/dist/components/ui/connection-picker/components/connection-actions-menu.d.ts +21 -0
- package/dist/components/ui/connection-picker/components/connection-actions-menu.js +95 -0
- package/dist/components/ui/connection-picker/components/connection-status.cjs +81 -0
- package/dist/components/ui/connection-picker/components/connection-status.d.ts +22 -0
- package/dist/components/ui/connection-picker/components/connection-status.js +41 -0
- package/dist/components/ui/connection-picker/connection-picker.cjs +411 -0
- package/dist/components/ui/connection-picker/connection-picker.d.ts +12 -0
- package/dist/components/ui/connection-picker/connection-picker.js +374 -0
- package/dist/components/ui/connection-picker/index.cjs +39 -0
- package/dist/components/ui/connection-picker/index.d.ts +2 -0
- package/dist/components/ui/connection-picker/index.js +2 -0
- package/dist/components/ui/connection-picker/types.cjs +18 -0
- package/dist/components/ui/connection-picker/types.d.ts +124 -0
- package/dist/components/ui/connection-picker/types.js +0 -0
- package/dist/components/ui/field-actions/ai-assist-action.cjs +32 -8
- package/dist/components/ui/field-actions/ai-assist-action.d.ts +25 -2
- package/dist/components/ui/field-actions/ai-assist-action.js +33 -9
- package/dist/components/ui/field-actions/collapse.cjs +7 -3
- package/dist/components/ui/field-actions/collapse.d.ts +2 -0
- package/dist/components/ui/field-actions/collapse.js +3 -2
- package/dist/components/ui/field-actions/insert-variable-action.d.ts +4 -1
- package/dist/components/ui/folder-picker/folder-picker.cjs +4 -3
- package/dist/components/ui/folder-picker/folder-picker.js +4 -3
- package/dist/components/ui/index.cjs +254 -228
- package/dist/components/ui/index.d.ts +3 -1
- package/dist/components/ui/index.js +2 -0
- package/dist/components/ui/input-group.cjs +57 -5
- package/dist/components/ui/input-group.d.ts +2 -0
- package/dist/components/ui/input-group.js +58 -6
- package/dist/components/ui/{folder-picker/components/folder-picker-empty-state.cjs → picker-empty-state.cjs} +11 -11
- package/dist/components/ui/picker-empty-state.d.ts +33 -0
- package/dist/components/ui/{folder-picker/components/folder-picker-empty-state.js → picker-empty-state.js} +9 -9
- package/dist/components/ui/prompt-editor/components/TokenPill.cjs +1 -1
- package/dist/components/ui/prompt-editor/components/TokenPill.js +1 -1
- package/dist/components/ui/prompt-editor/types.d.ts +6 -0
- package/dist/components/ui/reference-chip-colors.cjs +6 -0
- package/dist/components/ui/reference-chip-colors.d.ts +14 -0
- package/dist/components/ui/reference-chip-colors.js +6 -0
- package/dist/components/ui/reference-chip.cjs +6 -7
- package/dist/components/ui/reference-chip.d.ts +3 -0
- package/dist/components/ui/reference-chip.js +6 -7
- package/dist/components/ui/resource-picker/command-value.cjs +48 -0
- package/dist/components/ui/resource-picker/command-value.d.ts +11 -0
- package/dist/components/ui/resource-picker/command-value.js +11 -0
- package/dist/components/ui/resource-picker/components/resource-group-header.cjs +102 -0
- package/dist/components/ui/resource-picker/components/resource-group-header.d.ts +44 -0
- package/dist/components/ui/resource-picker/components/resource-group-header.js +65 -0
- package/dist/components/ui/resource-picker/components/resource-picker-footer.cjs +55 -0
- package/dist/components/ui/resource-picker/components/resource-picker-footer.d.ts +14 -0
- package/dist/components/ui/resource-picker/components/resource-picker-footer.js +21 -0
- package/dist/components/ui/resource-picker/components/resource-row-actions-menu.cjs +136 -0
- package/dist/components/ui/resource-picker/components/resource-row-actions-menu.d.ts +30 -0
- package/dist/components/ui/resource-picker/components/resource-row-actions-menu.js +102 -0
- package/dist/components/ui/resource-picker/components/resource-row.cjs +115 -0
- package/dist/components/ui/resource-picker/components/resource-row.d.ts +16 -0
- package/dist/components/ui/resource-picker/components/resource-row.js +81 -0
- package/dist/components/ui/resource-picker/focus.cjs +66 -0
- package/dist/components/ui/resource-picker/focus.d.ts +1 -0
- package/dist/components/ui/resource-picker/focus.js +32 -0
- package/dist/components/ui/resource-picker/index.cjs +42 -0
- package/dist/components/ui/resource-picker/index.d.ts +2 -0
- package/dist/components/ui/resource-picker/index.js +2 -0
- package/dist/components/ui/resource-picker/resource-picker.cjs +606 -0
- package/dist/components/ui/resource-picker/resource-picker.d.ts +40 -0
- package/dist/components/ui/resource-picker/resource-picker.js +566 -0
- package/dist/components/ui/resource-picker/types.cjs +50 -0
- package/dist/components/ui/resource-picker/types.d.ts +209 -0
- package/dist/components/ui/resource-picker/types.js +16 -0
- package/dist/components/ui/variable-picker/variable-picker.cjs +1 -1
- package/dist/components/ui/variable-picker/variable-picker.d.ts +2 -1
- package/dist/components/ui/variable-picker/variable-picker.js +1 -1
- package/dist/components/ui/variable-value-control.d.ts +5 -2
- package/dist/index.cjs +24 -7
- package/dist/index.d.ts +5 -1
- package/dist/index.js +3 -1
- package/dist/styles.css +179 -39
- package/package.json +1 -1
- package/dist/components/ui/folder-picker/components/folder-picker-empty-state.d.ts +0 -26
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
ResourceRow: ()=>ResourceRow
|
|
28
|
+
});
|
|
29
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
+
const external_lucide_react_namespaceObject = require("lucide-react");
|
|
31
|
+
const external_command_cjs_namespaceObject = require("../../command.cjs");
|
|
32
|
+
const index_cjs_namespaceObject = require("../../../../lib/index.cjs");
|
|
33
|
+
const external_command_value_cjs_namespaceObject = require("../command-value.cjs");
|
|
34
|
+
function ResourceRow({ item, chosen, onSelect, actions }) {
|
|
35
|
+
const hasActions = Boolean(actions && actions.length > 0);
|
|
36
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_command_cjs_namespaceObject.CommandItem, {
|
|
37
|
+
value: (0, external_command_value_cjs_namespaceObject.toCommandValue)(item.id),
|
|
38
|
+
"aria-label": [
|
|
39
|
+
item.label,
|
|
40
|
+
item.description,
|
|
41
|
+
item.subtitleText
|
|
42
|
+
].filter(Boolean).join(', '),
|
|
43
|
+
"aria-current": chosen ? 'true' : void 0,
|
|
44
|
+
"aria-keyshortcuts": hasActions ? 'Shift+Enter' : void 0,
|
|
45
|
+
disabled: item.disabled,
|
|
46
|
+
onSelect: onSelect,
|
|
47
|
+
className: (0, index_cjs_namespaceObject.cn)('group/row flex cursor-pointer items-center gap-2 rounded-none py-1.5 pl-3 pr-3 text-sm', chosen ? 'bg-brand-subtle font-medium data-[selected=true]:bg-brand-subtle' : 'data-[selected=true]:bg-surface-overlay data-[selected=true]:text-foreground'),
|
|
48
|
+
children: [
|
|
49
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
50
|
+
className: "grid size-4 shrink-0 place-items-center",
|
|
51
|
+
children: chosen && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.Check, {
|
|
52
|
+
className: "size-4 text-foreground-accent",
|
|
53
|
+
strokeWidth: 3
|
|
54
|
+
})
|
|
55
|
+
}),
|
|
56
|
+
item.icon && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
57
|
+
className: "grid size-4 shrink-0 place-items-center text-foreground-muted",
|
|
58
|
+
children: item.icon
|
|
59
|
+
}),
|
|
60
|
+
item.subtitle ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("span", {
|
|
61
|
+
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
62
|
+
children: [
|
|
63
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(RowLabel, {
|
|
64
|
+
label: item.label,
|
|
65
|
+
chosen: chosen
|
|
66
|
+
}),
|
|
67
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
68
|
+
className: "min-w-0 truncate text-xs font-normal",
|
|
69
|
+
children: item.subtitle
|
|
70
|
+
})
|
|
71
|
+
]
|
|
72
|
+
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(RowLabel, {
|
|
73
|
+
label: item.label,
|
|
74
|
+
chosen: chosen
|
|
75
|
+
}),
|
|
76
|
+
item.description && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
77
|
+
className: "min-w-0 max-w-[45%] truncate text-xs text-foreground-subtle",
|
|
78
|
+
children: item.description
|
|
79
|
+
}),
|
|
80
|
+
hasActions && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
81
|
+
"aria-hidden": true,
|
|
82
|
+
"data-slot": "resource-row-actions",
|
|
83
|
+
className: "flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover/row:opacity-100 group-data-[selected=true]/row:opacity-100",
|
|
84
|
+
children: actions?.map((action)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
85
|
+
"data-slot": "resource-row-action",
|
|
86
|
+
title: action.label,
|
|
87
|
+
className: (0, index_cjs_namespaceObject.cn)('cursor-pointer rounded transition-colors hover:bg-surface-hover', action.icon ? 'grid size-6 place-items-center text-foreground-muted hover:text-foreground' : 'px-1.5 py-0.5 text-xs font-medium', 'danger' === action.tone && 'text-error hover:text-error'),
|
|
88
|
+
onClick: (event)=>{
|
|
89
|
+
event.stopPropagation();
|
|
90
|
+
action.onSelect();
|
|
91
|
+
},
|
|
92
|
+
onPointerDown: (event)=>{
|
|
93
|
+
event.stopPropagation();
|
|
94
|
+
event.preventDefault();
|
|
95
|
+
},
|
|
96
|
+
onMouseDown: (event)=>event.preventDefault(),
|
|
97
|
+
children: action.icon ?? action.text ?? action.label
|
|
98
|
+
}, action.id))
|
|
99
|
+
})
|
|
100
|
+
]
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
function RowLabel({ label, chosen }) {
|
|
104
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
105
|
+
className: (0, index_cjs_namespaceObject.cn)('min-w-0 flex-1 truncate', chosen ? 'text-foreground-accent' : 'text-foreground'),
|
|
106
|
+
children: label
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
exports.ResourceRow = __webpack_exports__.ResourceRow;
|
|
110
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
111
|
+
"ResourceRow"
|
|
112
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
113
|
+
Object.defineProperty(exports, '__esModule', {
|
|
114
|
+
value: true
|
|
115
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ResourceItem, ResourceItemAction } from '../types';
|
|
2
|
+
export interface ResourceRowProps {
|
|
3
|
+
item: ResourceItem;
|
|
4
|
+
chosen: boolean;
|
|
5
|
+
onSelect: () => void;
|
|
6
|
+
/** Pointer shortcuts at the trailing edge, revealed on the row under the cursor. */
|
|
7
|
+
actions?: ResourceItemAction[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* One selectable resource.
|
|
11
|
+
*
|
|
12
|
+
* The tick has a reserved column of its own rather than trailing the label,
|
|
13
|
+
* so it stays in one place as the rows above and below it change, and the
|
|
14
|
+
* chosen row carries the rest of the emphasis in its background.
|
|
15
|
+
*/
|
|
16
|
+
export declare function ResourceRow({ item, chosen, onSelect, actions }: ResourceRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Check } from "lucide-react";
|
|
3
|
+
import { CommandItem } from "../../command.js";
|
|
4
|
+
import { cn } from "../../../../lib/index.js";
|
|
5
|
+
import { toCommandValue } from "../command-value.js";
|
|
6
|
+
function ResourceRow({ item, chosen, onSelect, actions }) {
|
|
7
|
+
const hasActions = Boolean(actions && actions.length > 0);
|
|
8
|
+
return /*#__PURE__*/ jsxs(CommandItem, {
|
|
9
|
+
value: toCommandValue(item.id),
|
|
10
|
+
"aria-label": [
|
|
11
|
+
item.label,
|
|
12
|
+
item.description,
|
|
13
|
+
item.subtitleText
|
|
14
|
+
].filter(Boolean).join(', '),
|
|
15
|
+
"aria-current": chosen ? 'true' : void 0,
|
|
16
|
+
"aria-keyshortcuts": hasActions ? 'Shift+Enter' : void 0,
|
|
17
|
+
disabled: item.disabled,
|
|
18
|
+
onSelect: onSelect,
|
|
19
|
+
className: cn('group/row flex cursor-pointer items-center gap-2 rounded-none py-1.5 pl-3 pr-3 text-sm', chosen ? 'bg-brand-subtle font-medium data-[selected=true]:bg-brand-subtle' : 'data-[selected=true]:bg-surface-overlay data-[selected=true]:text-foreground'),
|
|
20
|
+
children: [
|
|
21
|
+
/*#__PURE__*/ jsx("span", {
|
|
22
|
+
className: "grid size-4 shrink-0 place-items-center",
|
|
23
|
+
children: chosen && /*#__PURE__*/ jsx(Check, {
|
|
24
|
+
className: "size-4 text-foreground-accent",
|
|
25
|
+
strokeWidth: 3
|
|
26
|
+
})
|
|
27
|
+
}),
|
|
28
|
+
item.icon && /*#__PURE__*/ jsx("span", {
|
|
29
|
+
className: "grid size-4 shrink-0 place-items-center text-foreground-muted",
|
|
30
|
+
children: item.icon
|
|
31
|
+
}),
|
|
32
|
+
item.subtitle ? /*#__PURE__*/ jsxs("span", {
|
|
33
|
+
className: "flex min-w-0 flex-1 flex-col gap-0.5",
|
|
34
|
+
children: [
|
|
35
|
+
/*#__PURE__*/ jsx(RowLabel, {
|
|
36
|
+
label: item.label,
|
|
37
|
+
chosen: chosen
|
|
38
|
+
}),
|
|
39
|
+
/*#__PURE__*/ jsx("span", {
|
|
40
|
+
className: "min-w-0 truncate text-xs font-normal",
|
|
41
|
+
children: item.subtitle
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
}) : /*#__PURE__*/ jsx(RowLabel, {
|
|
45
|
+
label: item.label,
|
|
46
|
+
chosen: chosen
|
|
47
|
+
}),
|
|
48
|
+
item.description && /*#__PURE__*/ jsx("span", {
|
|
49
|
+
className: "min-w-0 max-w-[45%] truncate text-xs text-foreground-subtle",
|
|
50
|
+
children: item.description
|
|
51
|
+
}),
|
|
52
|
+
hasActions && /*#__PURE__*/ jsx("span", {
|
|
53
|
+
"aria-hidden": true,
|
|
54
|
+
"data-slot": "resource-row-actions",
|
|
55
|
+
className: "flex shrink-0 items-center gap-0.5 opacity-0 transition-opacity group-hover/row:opacity-100 group-data-[selected=true]/row:opacity-100",
|
|
56
|
+
children: actions?.map((action)=>/*#__PURE__*/ jsx("span", {
|
|
57
|
+
"data-slot": "resource-row-action",
|
|
58
|
+
title: action.label,
|
|
59
|
+
className: cn('cursor-pointer rounded transition-colors hover:bg-surface-hover', action.icon ? 'grid size-6 place-items-center text-foreground-muted hover:text-foreground' : 'px-1.5 py-0.5 text-xs font-medium', 'danger' === action.tone && 'text-error hover:text-error'),
|
|
60
|
+
onClick: (event)=>{
|
|
61
|
+
event.stopPropagation();
|
|
62
|
+
action.onSelect();
|
|
63
|
+
},
|
|
64
|
+
onPointerDown: (event)=>{
|
|
65
|
+
event.stopPropagation();
|
|
66
|
+
event.preventDefault();
|
|
67
|
+
},
|
|
68
|
+
onMouseDown: (event)=>event.preventDefault(),
|
|
69
|
+
children: action.icon ?? action.text ?? action.label
|
|
70
|
+
}, action.id))
|
|
71
|
+
})
|
|
72
|
+
]
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
function RowLabel({ label, chosen }) {
|
|
76
|
+
return /*#__PURE__*/ jsx("span", {
|
|
77
|
+
className: cn('min-w-0 flex-1 truncate', chosen ? 'text-foreground-accent' : 'text-foreground'),
|
|
78
|
+
children: label
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
export { ResourceRow };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
focusBeside: ()=>focusBeside
|
|
28
|
+
});
|
|
29
|
+
const TABBABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), details > summary:first-of-type, [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])';
|
|
30
|
+
const isTabStop = (element)=>{
|
|
31
|
+
if (element.hasAttribute('tabindex')) return element.tabIndex >= 0;
|
|
32
|
+
if (element.isContentEditable) return !element.parentElement?.isContentEditable;
|
|
33
|
+
return element.tabIndex >= 0;
|
|
34
|
+
};
|
|
35
|
+
function isShown(element) {
|
|
36
|
+
if (element.closest('[hidden], [inert]')) return false;
|
|
37
|
+
if ('function' == typeof element.checkVisibility) return element.checkVisibility({
|
|
38
|
+
checkOpacity: false,
|
|
39
|
+
checkVisibilityCSS: true
|
|
40
|
+
});
|
|
41
|
+
for(let node = element; node; node = node.parentElement){
|
|
42
|
+
const style = node.ownerDocument.defaultView?.getComputedStyle(node);
|
|
43
|
+
if (style?.display === 'none') return false;
|
|
44
|
+
if (node === element && style?.visibility === 'hidden') return false;
|
|
45
|
+
}
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
function focusBeside(from, backwards, scope) {
|
|
49
|
+
const root = scope ?? from.getRootNode();
|
|
50
|
+
const candidates = Array.from(root.querySelectorAll(TABBABLE)).filter((element)=>isTabStop(element) && !element.hasAttribute('data-radix-focus-guard') && !from.contains(element) && isShown(element));
|
|
51
|
+
const isAfter = (element)=>Boolean(from.compareDocumentPosition(element) & Node.DOCUMENT_POSITION_FOLLOWING);
|
|
52
|
+
const ordered = backwards ? candidates.filter((element)=>!isAfter(element)).reverse() : candidates.filter(isAfter);
|
|
53
|
+
for (const target of ordered){
|
|
54
|
+
target.focus();
|
|
55
|
+
const active = target.getRootNode().activeElement;
|
|
56
|
+
if (active === target) return true;
|
|
57
|
+
}
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
exports.focusBeside = __webpack_exports__.focusBeside;
|
|
61
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
62
|
+
"focusBeside"
|
|
63
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
64
|
+
Object.defineProperty(exports, '__esModule', {
|
|
65
|
+
value: true
|
|
66
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function focusBeside(from: Element, backwards: boolean, scope?: ParentNode): boolean;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const TABBABLE = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), details > summary:first-of-type, [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])';
|
|
2
|
+
const isTabStop = (element)=>{
|
|
3
|
+
if (element.hasAttribute('tabindex')) return element.tabIndex >= 0;
|
|
4
|
+
if (element.isContentEditable) return !element.parentElement?.isContentEditable;
|
|
5
|
+
return element.tabIndex >= 0;
|
|
6
|
+
};
|
|
7
|
+
function isShown(element) {
|
|
8
|
+
if (element.closest('[hidden], [inert]')) return false;
|
|
9
|
+
if ('function' == typeof element.checkVisibility) return element.checkVisibility({
|
|
10
|
+
checkOpacity: false,
|
|
11
|
+
checkVisibilityCSS: true
|
|
12
|
+
});
|
|
13
|
+
for(let node = element; node; node = node.parentElement){
|
|
14
|
+
const style = node.ownerDocument.defaultView?.getComputedStyle(node);
|
|
15
|
+
if (style?.display === 'none') return false;
|
|
16
|
+
if (node === element && style?.visibility === 'hidden') return false;
|
|
17
|
+
}
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
function focusBeside(from, backwards, scope) {
|
|
21
|
+
const root = scope ?? from.getRootNode();
|
|
22
|
+
const candidates = Array.from(root.querySelectorAll(TABBABLE)).filter((element)=>isTabStop(element) && !element.hasAttribute('data-radix-focus-guard') && !from.contains(element) && isShown(element));
|
|
23
|
+
const isAfter = (element)=>Boolean(from.compareDocumentPosition(element) & Node.DOCUMENT_POSITION_FOLLOWING);
|
|
24
|
+
const ordered = backwards ? candidates.filter((element)=>!isAfter(element)).reverse() : candidates.filter(isAfter);
|
|
25
|
+
for (const target of ordered){
|
|
26
|
+
target.focus();
|
|
27
|
+
const active = target.getRootNode().activeElement;
|
|
28
|
+
if (active === target) return true;
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
export { focusBeside };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
5
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: definition[key]
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
})();
|
|
11
|
+
(()=>{
|
|
12
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
13
|
+
})();
|
|
14
|
+
(()=>{
|
|
15
|
+
__webpack_require__.r = (exports1)=>{
|
|
16
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
17
|
+
value: 'Module'
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
var __webpack_exports__ = {};
|
|
25
|
+
__webpack_require__.r(__webpack_exports__);
|
|
26
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
+
keepResourceSearchOnEscape: ()=>external_resource_picker_cjs_namespaceObject.keepResourceSearchOnEscape,
|
|
28
|
+
ResourcePicker: ()=>external_resource_picker_cjs_namespaceObject.ResourcePicker,
|
|
29
|
+
ResourcePickerContent: ()=>external_resource_picker_cjs_namespaceObject.ResourcePickerContent
|
|
30
|
+
});
|
|
31
|
+
const external_resource_picker_cjs_namespaceObject = require("./resource-picker.cjs");
|
|
32
|
+
exports.ResourcePicker = __webpack_exports__.ResourcePicker;
|
|
33
|
+
exports.ResourcePickerContent = __webpack_exports__.ResourcePickerContent;
|
|
34
|
+
exports.keepResourceSearchOnEscape = __webpack_exports__.keepResourceSearchOnEscape;
|
|
35
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
36
|
+
"ResourcePicker",
|
|
37
|
+
"ResourcePickerContent",
|
|
38
|
+
"keepResourceSearchOnEscape"
|
|
39
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
40
|
+
Object.defineProperty(exports, '__esModule', {
|
|
41
|
+
value: true
|
|
42
|
+
});
|