@edifice.io/react 2.6.12-develop-integration-crna.20261101211105 → 2.6.12-develop.20261103121017
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/Dropdown/Dropdown.js +14 -20
- package/dist/components/Dropdown/DropdownContext.d.ts +0 -5
- package/dist/components/Dropdown/DropdownMenuGroup.js +6 -23
- package/dist/components/Dropdown/DropdownSearchInput.js +8 -16
- package/dist/components/Dropdown/DropdownTrigger.js +8 -24
- package/dist/components/Dropdown/useDropdownItemFilter.js +2 -2
- package/dist/components/Select/Select.d.ts +1 -14
- package/dist/components/Select/Select.js +5 -11
- package/dist/hooks/useDropdown/useDropdown.d.ts +0 -5
- package/dist/hooks/useDropdown/useDropdown.js +6 -16
- package/dist/hooks/useNextcloudSearch/useNextcloudSearch.d.ts +1 -1
- package/dist/hooks/useNextcloudSearch/useNextcloudSearch.js +2 -2
- package/dist/index.js +156 -158
- package/dist/modules/homepage/components/Favorites/Favorites.js +4 -1
- package/dist/modules/multimedia/Nextcloud/Nextcloud.js +19 -7
- package/dist/modules/multimedia/index.d.ts +0 -1
- package/dist/multimedia.js +12 -14
- package/package.json +6 -6
- package/dist/components/Dropdown/useMatchRegistry.d.ts +0 -13
- package/dist/components/Dropdown/useMatchRegistry.js +0 -20
- package/dist/modules/multimedia/Nextcloud/NextcloudLogin.d.ts +0 -12
- package/dist/modules/multimedia/Nextcloud/NextcloudLogin.js +0 -33
- package/dist/modules/multimedia/NextcloudFolders/NextcloudFolders.d.ts +0 -12
- package/dist/modules/multimedia/NextcloudFolders/NextcloudFolders.js +0 -51
- package/dist/modules/multimedia/NextcloudFolders/components/NewFolderForm.d.ts +0 -16
- package/dist/modules/multimedia/NextcloudFolders/components/NewFolderForm.js +0 -51
- package/dist/modules/multimedia/NextcloudFolders/index.d.ts +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useState,
|
|
2
|
+
import { forwardRef, useState, useRef, useCallback, useImperativeHandle, useMemo, useEffect } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import useDropdown from "../../hooks/useDropdown/useDropdown.js";
|
|
5
5
|
import DropdownCheckboxItem from "./DropdownCheckboxItem.js";
|
|
@@ -11,7 +11,6 @@ import DropdownRadioItem from "./DropdownRadioItem.js";
|
|
|
11
11
|
import DropdownSearchInput from "./DropdownSearchInput.js";
|
|
12
12
|
import DropdownSeparator from "./DropdownSeparator.js";
|
|
13
13
|
import DropdownTrigger from "./DropdownTrigger.js";
|
|
14
|
-
import { useMatchRegistry } from "./useMatchRegistry.js";
|
|
15
14
|
import useClickOutside from "../../hooks/useClickOutside/useClickOutside.js";
|
|
16
15
|
const Root = /* @__PURE__ */ forwardRef(({
|
|
17
16
|
children,
|
|
@@ -26,11 +25,15 @@ const Root = /* @__PURE__ */ forwardRef(({
|
|
|
26
25
|
openOnSpace = !0,
|
|
27
26
|
focusOnMouseEnter = !0
|
|
28
27
|
}, refDropdown) => {
|
|
29
|
-
const [searchQuery, setSearchQuery] = useState(""), [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} =
|
|
28
|
+
const [searchQuery, setSearchQuery] = useState(""), [hasMatches, setHasMatches] = useState(!0), matchMapRef = useRef(/* @__PURE__ */ new Map()), reportMatch = useCallback((id, isMatch) => {
|
|
29
|
+
matchMapRef.current.set(id, isMatch);
|
|
30
|
+
const next = [...matchMapRef.current.values()].some(Boolean);
|
|
31
|
+
setHasMatches((prev) => prev !== next ? next : prev);
|
|
32
|
+
}, []), unregisterMatch = useCallback((id) => {
|
|
33
|
+
matchMapRef.current.delete(id);
|
|
34
|
+
const next = matchMapRef.current.size === 0 || [...matchMapRef.current.values()].some(Boolean);
|
|
35
|
+
setHasMatches((prev) => prev !== next ? next : prev);
|
|
36
|
+
}, []), {
|
|
34
37
|
visible,
|
|
35
38
|
isFocused,
|
|
36
39
|
triggerProps,
|
|
@@ -40,7 +43,6 @@ const Root = /* @__PURE__ */ forwardRef(({
|
|
|
40
43
|
setVisible,
|
|
41
44
|
menuRef,
|
|
42
45
|
triggerRef,
|
|
43
|
-
searchInputRef,
|
|
44
46
|
closeDropdown,
|
|
45
47
|
openDropdown
|
|
46
48
|
} = useDropdown(placement, extraTriggerKeyDownHandler, isTriggerHovered, focusOnVisible, openOnSpace, focusOnMouseEnter);
|
|
@@ -55,38 +57,30 @@ const Root = /* @__PURE__ */ forwardRef(({
|
|
|
55
57
|
}));
|
|
56
58
|
const ref = useClickOutside(() => {
|
|
57
59
|
setVisible(!1);
|
|
58
|
-
}),
|
|
59
|
-
ref.current = node, setRootElement(node);
|
|
60
|
-
}, [ref]), value = useMemo(() => ({
|
|
60
|
+
}), value = useMemo(() => ({
|
|
61
61
|
visible,
|
|
62
62
|
isFocused,
|
|
63
63
|
triggerProps,
|
|
64
64
|
menuProps,
|
|
65
65
|
itemProps,
|
|
66
66
|
itemRefs,
|
|
67
|
-
searchInputRef,
|
|
68
67
|
block,
|
|
69
68
|
setVisible,
|
|
70
69
|
openDropdown,
|
|
71
70
|
closeDropdown,
|
|
72
71
|
searchQuery,
|
|
73
72
|
setSearchQuery,
|
|
74
|
-
hasSearchInput,
|
|
75
|
-
setHasSearchInput,
|
|
76
|
-
rootElement,
|
|
77
73
|
hasMatches,
|
|
78
74
|
reportMatch,
|
|
79
75
|
unregisterMatch
|
|
80
|
-
}), [visible, isFocused, triggerProps, menuProps, itemProps, itemRefs,
|
|
76
|
+
}), [visible, isFocused, triggerProps, menuProps, itemProps, itemRefs, block, setVisible, openDropdown, closeDropdown, searchQuery, hasMatches, reportMatch, unregisterMatch]), dropdown = clsx("dropdown", {
|
|
81
77
|
"w-100": block,
|
|
82
78
|
"dropdown-nowrap": noWrap,
|
|
83
|
-
overflow
|
|
84
|
-
// The search input is positioned over the trigger, within the root box.
|
|
85
|
-
"dropdown-searching": hasSearchInput
|
|
79
|
+
overflow
|
|
86
80
|
});
|
|
87
81
|
return useEffect(() => {
|
|
88
82
|
onToggle == null || onToggle(visible), visible || setSearchQuery("");
|
|
89
|
-
}, [visible]), /* @__PURE__ */ jsx(DropdownContext.Provider, { value, children: /* @__PURE__ */ jsx("div", { ref
|
|
83
|
+
}, [visible]), /* @__PURE__ */ jsx(DropdownContext.Provider, { value, children: /* @__PURE__ */ jsx("div", { ref, className: dropdown, children: typeof children == "function" ? children(triggerProps, itemRefs, setVisible) : children }) });
|
|
90
84
|
}), Dropdown = Object.assign(Root, {
|
|
91
85
|
Trigger: DropdownTrigger,
|
|
92
86
|
Menu: DropdownMenu,
|
|
@@ -4,11 +4,6 @@ export interface DropdownContextProps extends OmittedProps {
|
|
|
4
4
|
block?: boolean;
|
|
5
5
|
searchQuery: string;
|
|
6
6
|
setSearchQuery: (query: string) => void;
|
|
7
|
-
/** True while a `Dropdown.SearchInput` is displayed in place of the trigger. */
|
|
8
|
-
hasSearchInput: boolean;
|
|
9
|
-
setHasSearchInput: (hasSearchInput: boolean) => void;
|
|
10
|
-
/** Dropdown root element, where the search input is displayed over the trigger. */
|
|
11
|
-
rootElement: HTMLDivElement | null;
|
|
12
7
|
hasMatches: boolean;
|
|
13
8
|
reportMatch: (id: string, isMatch: boolean) => void;
|
|
14
9
|
unregisterMatch: (id: string) => void;
|
|
@@ -1,29 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef
|
|
3
|
-
import { DropdownContext } from "./DropdownContext.js";
|
|
4
|
-
import { useMatchRegistry } from "./useMatchRegistry.js";
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
5
3
|
const DropdownMenuGroup = /* @__PURE__ */ forwardRef(({
|
|
6
4
|
label,
|
|
7
5
|
children
|
|
8
|
-
}, forwardRef2) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
unregisterMatch
|
|
13
|
-
} = useMatchRegistry(), parentReportMatch = context == null ? void 0 : context.reportMatch, parentUnregisterMatch = context == null ? void 0 : context.unregisterMatch, groupReportMatch = useCallback((id, isMatch) => {
|
|
14
|
-
reportMatch(id, isMatch), parentReportMatch == null || parentReportMatch(id, isMatch);
|
|
15
|
-
}, [reportMatch, parentReportMatch]), groupUnregisterMatch = useCallback((id) => {
|
|
16
|
-
unregisterMatch(id), parentUnregisterMatch == null || parentUnregisterMatch(id);
|
|
17
|
-
}, [unregisterMatch, parentUnregisterMatch]), groupContext = useMemo(() => context && {
|
|
18
|
-
...context,
|
|
19
|
-
reportMatch: groupReportMatch,
|
|
20
|
-
unregisterMatch: groupUnregisterMatch
|
|
21
|
-
}, [context, groupReportMatch, groupUnregisterMatch]);
|
|
22
|
-
return /* @__PURE__ */ jsx(DropdownContext.Provider, { value: groupContext, children: /* @__PURE__ */ jsxs("div", { ref: forwardRef2, role: "group", hidden: !hasMatches, children: [
|
|
23
|
-
/* @__PURE__ */ jsx("span", { className: "small px-4", children: /* @__PURE__ */ jsx("strong", { children: label }) }),
|
|
24
|
-
children
|
|
25
|
-
] }) });
|
|
26
|
-
});
|
|
6
|
+
}, forwardRef2) => /* @__PURE__ */ jsxs("div", { ref: forwardRef2, role: "group", children: [
|
|
7
|
+
/* @__PURE__ */ jsx("span", { className: "small px-4", children: /* @__PURE__ */ jsx("strong", { children: label }) }),
|
|
8
|
+
children
|
|
9
|
+
] }));
|
|
27
10
|
export {
|
|
28
11
|
DropdownMenuGroup as default
|
|
29
12
|
};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { jsxs,
|
|
2
|
-
import { useCallback } from "react";
|
|
3
|
-
import { createPortal } from "react-dom";
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
4
2
|
import { useDropdownContext } from "./DropdownContext.js";
|
|
5
3
|
import SearchBar from "../SearchBar/SearchBar.js";
|
|
6
4
|
const DropdownSearchInput = ({
|
|
@@ -11,21 +9,15 @@ const DropdownSearchInput = ({
|
|
|
11
9
|
const {
|
|
12
10
|
searchQuery,
|
|
13
11
|
setSearchQuery,
|
|
14
|
-
hasMatches
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
itemProps
|
|
19
|
-
} = useDropdownContext(), registerSearchInput = useCallback((node) => {
|
|
20
|
-
searchInputRef.current = (node == null ? void 0 : node.querySelector("input")) ?? null, setHasSearchInput(!!node);
|
|
21
|
-
}, [searchInputRef, setHasSearchInput]);
|
|
22
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
23
|
-
rootElement && /* @__PURE__ */ createPortal(/* @__PURE__ */ jsx("div", { ref: registerSearchInput, className: "dropdown-search position-absolute top-0 start-0 w-100 h-100 z-1", children: /* @__PURE__ */ jsx(SearchBar, { isVariant: !0, clearable: !0, size: "md", className: "h-100", placeholder, value: searchQuery, onChange: (e) => {
|
|
12
|
+
hasMatches
|
|
13
|
+
} = useDropdownContext();
|
|
14
|
+
return /* @__PURE__ */ jsxs("div", { className: "px-8 pb-8", children: [
|
|
15
|
+
/* @__PURE__ */ jsx(SearchBar, { isVariant: !0, clearable: !0, size: "md", placeholder, value: searchQuery, onChange: (e) => {
|
|
24
16
|
setSearchQuery(e.target.value), onSearch == null || onSearch(e.target.value);
|
|
25
17
|
}, onKeyDown: (e) => {
|
|
26
|
-
|
|
27
|
-
} })
|
|
28
|
-
searchQuery && !hasMatches && /* @__PURE__ */ jsx("p", { className: "body-2 text-gray-700 text-center
|
|
18
|
+
["ArrowUp", "ArrowDown", "Enter", " "].includes(e.key) && e.stopPropagation();
|
|
19
|
+
} }),
|
|
20
|
+
searchQuery && !hasMatches && /* @__PURE__ */ jsx("p", { className: "body-2 text-gray-700 text-center mt-8 mb-0", children: noResultsLabel })
|
|
29
21
|
] });
|
|
30
22
|
};
|
|
31
23
|
export {
|
|
@@ -23,30 +23,14 @@ const DropdownTrigger = /* @__PURE__ */ forwardRef(({
|
|
|
23
23
|
}, forwardRef2) => {
|
|
24
24
|
const {
|
|
25
25
|
triggerProps,
|
|
26
|
-
block
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"w-100": block
|
|
35
|
-
},
|
|
36
|
-
// The open menu covers the trigger with its search input: hide the trigger
|
|
37
|
-
// without removing it, so it keeps its place and can take the focus back.
|
|
38
|
-
{
|
|
39
|
-
"opacity-0": visible && hasSearchInput
|
|
40
|
-
},
|
|
41
|
-
triggerProps.className,
|
|
42
|
-
restProps.className,
|
|
43
|
-
{
|
|
44
|
-
"rounded-pill": pill
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"base-shade": baseShade
|
|
48
|
-
}
|
|
49
|
-
), style = {
|
|
26
|
+
block
|
|
27
|
+
} = useDropdownContext(), className = clsx("dropdown-toggle ", size, variant, {
|
|
28
|
+
"w-100": block
|
|
29
|
+
}, triggerProps.className, restProps.className, {
|
|
30
|
+
"rounded-pill": pill
|
|
31
|
+
}, {
|
|
32
|
+
"base-shade": baseShade
|
|
33
|
+
}), style = {
|
|
50
34
|
...outerBorderColor && {
|
|
51
35
|
outline: `${outerBorderWidth}px solid var(--edifice-${outerBorderColor})`,
|
|
52
36
|
outlineOffset: outerBorderOffset
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useId, useLayoutEffect } from "react";
|
|
2
2
|
import { useDropdownContext } from "./DropdownContext.js";
|
|
3
|
-
const
|
|
3
|
+
const useDropdownItemFilter = (searchValue) => {
|
|
4
4
|
const {
|
|
5
5
|
searchQuery,
|
|
6
6
|
reportMatch,
|
|
7
7
|
unregisterMatch
|
|
8
|
-
} = useDropdownContext(), id = useId(), isFiltered = searchValue !== void 0 && searchQuery !== "" && !
|
|
8
|
+
} = useDropdownContext(), id = useId(), isFiltered = searchValue !== void 0 && searchQuery !== "" && !searchValue.toLowerCase().includes(searchQuery.toLowerCase());
|
|
9
9
|
return useLayoutEffect(() => {
|
|
10
10
|
if (searchValue !== void 0)
|
|
11
11
|
return reportMatch(id, !isFiltered), () => unregisterMatch(id);
|
|
@@ -35,26 +35,13 @@ export interface SelectProps extends Omit<DropdownProps, 'children'>, Omit<Dropd
|
|
|
35
35
|
* Default value
|
|
36
36
|
*/
|
|
37
37
|
defaultValue?: string;
|
|
38
|
-
/**
|
|
39
|
-
* Filter the options with a search input:
|
|
40
|
-
* when the menu opens, the trigger turns into a search field.
|
|
41
|
-
*/
|
|
42
|
-
searchable?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Placeholder of the search input (with `searchable`)
|
|
45
|
-
*/
|
|
46
|
-
searchPlaceholder?: string;
|
|
47
|
-
/**
|
|
48
|
-
* Label shown when no option matches the search (with `searchable`)
|
|
49
|
-
*/
|
|
50
|
-
noResultsLabel?: string;
|
|
51
38
|
}
|
|
52
39
|
/**
|
|
53
40
|
*
|
|
54
41
|
* Select component is based on Dropdown Component. It extends `Dropdown` and `Dropdown.Trigger` props `block`, `overflow`, `icon`, `variant`, `size`, `disabled`
|
|
55
42
|
*/
|
|
56
43
|
declare const Select: {
|
|
57
|
-
({ selectedValue, icon, options, overflow, block, variant, size, disabled, placeholderOption, onValueChange, defaultValue,
|
|
44
|
+
({ selectedValue, icon, options, overflow, block, variant, size, disabled, placeholderOption, onValueChange, defaultValue, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
58
45
|
displayName: string;
|
|
59
46
|
};
|
|
60
47
|
export default Select;
|
|
@@ -14,10 +14,7 @@ const Select = ({
|
|
|
14
14
|
disabled,
|
|
15
15
|
placeholderOption,
|
|
16
16
|
onValueChange,
|
|
17
|
-
defaultValue
|
|
18
|
-
searchable,
|
|
19
|
-
searchPlaceholder,
|
|
20
|
-
noResultsLabel
|
|
17
|
+
defaultValue
|
|
21
18
|
}) => {
|
|
22
19
|
const [localValue, setLocalValue] = useState(), {
|
|
23
20
|
t
|
|
@@ -38,13 +35,10 @@ const Select = ({
|
|
|
38
35
|
const label = typeof localValue == "object" ? localValue.label : localValue, iconChange = typeof localValue == "object" ? localValue.icon : void 0;
|
|
39
36
|
return /* @__PURE__ */ jsxs(Dropdown, { overflow, block, children: [
|
|
40
37
|
/* @__PURE__ */ jsx(SelectTrigger, { icon: iconChange || icon, label: /* @__PURE__ */ jsx("span", { className: "text-truncate", children: t(label || placeholderOption) }), variant, size, disabled }),
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return /* @__PURE__ */ jsx(Dropdown.Item, { type: "action", onClick: () => setLocalValue(option), icon: icon2, searchValue: searchable ? label2 : void 0, children: label2 }, value);
|
|
46
|
-
})
|
|
47
|
-
] })
|
|
38
|
+
/* @__PURE__ */ jsx(Dropdown.Menu, { role: "listbox", children: options == null ? void 0 : options.map((option) => {
|
|
39
|
+
const value = typeof option == "object" ? option.value : option, label2 = typeof option == "object" ? option.label : option, icon2 = typeof option == "object" ? option.icon : void 0;
|
|
40
|
+
return /* @__PURE__ */ jsx(Dropdown.Item, { type: "action", onClick: () => setLocalValue(option), icon: icon2, children: label2 }, value);
|
|
41
|
+
}) })
|
|
48
42
|
] });
|
|
49
43
|
};
|
|
50
44
|
export {
|
|
@@ -23,11 +23,6 @@ export interface UseDropdownProps {
|
|
|
23
23
|
}>;
|
|
24
24
|
triggerRef: MutableRefObject<HTMLButtonElement | null>;
|
|
25
25
|
menuRef: MutableRefObject<HTMLUListElement | null>;
|
|
26
|
-
/**
|
|
27
|
-
* Search input displayed in place of the trigger while the menu is open, if any.
|
|
28
|
-
* When set, it gets the focus on open and is reachable from the items with the keyboard.
|
|
29
|
-
*/
|
|
30
|
-
searchInputRef: MutableRefObject<HTMLInputElement | null>;
|
|
31
26
|
triggerProps: Record<string, any>;
|
|
32
27
|
menuProps: Record<string, any>;
|
|
33
28
|
itemProps: Record<string, any>;
|
|
@@ -2,7 +2,7 @@ import { useId, useState, useRef, useEffect, useCallback } from "react";
|
|
|
2
2
|
import { useFloating, autoUpdate, offset, size, flip, useHover, safePolygon } from "@floating-ui/react";
|
|
3
3
|
import { mergeRefs } from "../../utilities/refs/ref.js";
|
|
4
4
|
const useDropdown = (placement, extraTriggerKeyDownHandler, isTriggerHovered = !1, focusOnVisible = !0, openOnSpace = !0, focusOnMouseEnter = !0) => {
|
|
5
|
-
const id = useId(), [visible, setVisible] = useState(!1), [activeIndex, setActiveIndex] = useState(-1), [isFocused, setIsFocused] = useState(null),
|
|
5
|
+
const id = useId(), [visible, setVisible] = useState(!1), [activeIndex, setActiveIndex] = useState(-1), [isFocused, setIsFocused] = useState(null), {
|
|
6
6
|
refs,
|
|
7
7
|
floatingStyles,
|
|
8
8
|
context
|
|
@@ -30,14 +30,9 @@ const useDropdown = (placement, extraTriggerKeyDownHandler, isTriggerHovered = !
|
|
|
30
30
|
},
|
|
31
31
|
handleClose: safePolygon()
|
|
32
32
|
});
|
|
33
|
-
const menuRef = useRef(null), triggerRef = useRef(null), itemRefs = useRef({})
|
|
34
|
-
var _a;
|
|
35
|
-
setActiveIndex(-1), setIsFocused(null), (_a = searchInputRef.current) == null || _a.focus({
|
|
36
|
-
preventScroll: !0
|
|
37
|
-
});
|
|
38
|
-
};
|
|
33
|
+
const menuRef = useRef(null), triggerRef = useRef(null), itemRefs = useRef({});
|
|
39
34
|
useEffect(() => {
|
|
40
|
-
visible &&
|
|
35
|
+
visible && menuRef.current && focusOnVisible ? (menuRef.current.focus(), setActiveIndex(0)) : (setActiveIndex(-1), itemRefs.current = {});
|
|
41
36
|
}, [visible]), useEffect(() => {
|
|
42
37
|
if (activeIndex !== -1) {
|
|
43
38
|
const filteredItems = Object.values(itemRefs.current).filter((item) => !!item);
|
|
@@ -54,14 +49,10 @@ const useDropdown = (placement, extraTriggerKeyDownHandler, isTriggerHovered = !
|
|
|
54
49
|
}, [activeIndex]);
|
|
55
50
|
const visibleItemCount = () => Object.values(itemRefs.current).filter(Boolean).length, nextItem = () => {
|
|
56
51
|
const count = visibleItemCount();
|
|
57
|
-
|
|
52
|
+
setActiveIndex((prevIndex) => (prevIndex + 1) % count);
|
|
58
53
|
}, previousItem = () => {
|
|
59
|
-
if (activeIndex === 0 && searchInputRef.current) {
|
|
60
|
-
focusSearchInput();
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
54
|
const count = visibleItemCount();
|
|
64
|
-
|
|
55
|
+
setActiveIndex((prevIndex) => (prevIndex - 1 + count) % count);
|
|
65
56
|
}, firstItem = () => {
|
|
66
57
|
setActiveIndex(0);
|
|
67
58
|
}, lastItem = () => {
|
|
@@ -114,7 +105,7 @@ const useDropdown = (placement, extraTriggerKeyDownHandler, isTriggerHovered = !
|
|
|
114
105
|
break;
|
|
115
106
|
case " ":
|
|
116
107
|
case "Enter":
|
|
117
|
-
activeIndex !== -1 && (Object.values(itemRefs.current)
|
|
108
|
+
activeIndex !== -1 && (Object.values(itemRefs.current)[activeIndex].getAttribute("role") === "menuitem" && triggerRef.current && (triggerRef.current.focus(), setVisible(!1)), onSuccess == null || onSuccess()), flag = !0;
|
|
118
109
|
break;
|
|
119
110
|
case "ArrowDown":
|
|
120
111
|
case "Down":
|
|
@@ -142,7 +133,6 @@ const useDropdown = (placement, extraTriggerKeyDownHandler, isTriggerHovered = !
|
|
|
142
133
|
itemRefs,
|
|
143
134
|
triggerRef,
|
|
144
135
|
menuRef,
|
|
145
|
-
searchInputRef,
|
|
146
136
|
/* TriggerProps to spread to any Trigger component */
|
|
147
137
|
triggerProps: {
|
|
148
138
|
ref: mergeRefs(triggerRef, refs.setReference),
|
|
@@ -9,6 +9,6 @@ export default function useNextcloudSearch(rootId: string, rootName: string, use
|
|
|
9
9
|
isCheckingAuth: boolean;
|
|
10
10
|
isAuthError: boolean;
|
|
11
11
|
refetchAuthStatus: () => void;
|
|
12
|
-
loadContent: (folderId?: ID
|
|
12
|
+
loadContent: (folderId?: ID) => void;
|
|
13
13
|
loadError: unknown;
|
|
14
14
|
};
|
|
@@ -33,14 +33,14 @@ function useNextcloudSearch(rootId, rootName, userId) {
|
|
|
33
33
|
queryKey: ["nextcloud", "oauth2-status", userId],
|
|
34
34
|
queryFn: () => odeServices.nextcloud().getOauth2Status(userId),
|
|
35
35
|
enabled: !!userId
|
|
36
|
-
}), needsAuth = !((_a = oauth2StatusQuery.data) != null && _a.connected), [loadError, setLoadError] = useState(null), loadContent = useCallback(async (folderId
|
|
36
|
+
}), needsAuth = !((_a = oauth2StatusQuery.data) != null && _a.connected), [loadError, setLoadError] = useState(null), loadContent = useCallback(async (folderId) => {
|
|
37
37
|
if (!userId) return;
|
|
38
38
|
const path = folderId === rootId ? void 0 : folderId;
|
|
39
39
|
try {
|
|
40
40
|
const payload = await queryClient.fetchQuery({
|
|
41
41
|
queryKey: ["nextcloud", "documents", userId, path ?? "/"],
|
|
42
42
|
queryFn: () => odeServices.nextcloud().listDocuments(userId, path),
|
|
43
|
-
staleTime:
|
|
43
|
+
staleTime: 6e4
|
|
44
44
|
}), subfolders = [], files = [], currentPath = path ?? "/";
|
|
45
45
|
payload.filter((doc) => doc.path !== currentPath).forEach((doc) => {
|
|
46
46
|
doc.isFolder ? subfolders.push(doc) : files.push(doc);
|
package/dist/index.js
CHANGED
|
@@ -48,83 +48,82 @@ import { default as default46 } from "./components/Modal/Modal.js";
|
|
|
48
48
|
import { default as default47 } from "./components/ModalBeta/ModalBeta.js";
|
|
49
49
|
import { default as default48 } from "./modules/multimedia/Nextcloud/Nextcloud.js";
|
|
50
50
|
import { default as default49 } from "./modules/multimedia/FileCard/NextcloudFileCard.js";
|
|
51
|
-
import { default as default50 } from "./modules/
|
|
52
|
-
import { default as default51 } from "./
|
|
53
|
-
import { default as default52 } from "./components/
|
|
54
|
-
import { default as default53 } from "./components/
|
|
55
|
-
import { default as default54
|
|
56
|
-
import { default as default55 } from "./
|
|
57
|
-
import { default as default56 } from "./components/
|
|
58
|
-
import { default as default57 } from "./components/
|
|
59
|
-
import { default as default58 } from "./components/
|
|
60
|
-
import { default as default59 } from "./components/
|
|
61
|
-
import { default as default60 } from "./components/
|
|
62
|
-
import { default as default61 } from "./components/
|
|
63
|
-
import { default as default62 } from "./
|
|
64
|
-
import { default as default63 } from "./modules/modals/ShareModal/
|
|
65
|
-
import { default as default64 } from "./modules/modals/ShareModal/
|
|
66
|
-
import { default as default65 } from "./
|
|
67
|
-
import { default as default66 } from "./components/
|
|
68
|
-
import { default as default67 } from "./components/
|
|
69
|
-
import { default as default68 } from "./components/
|
|
70
|
-
import { default as default69 } from "./components/
|
|
71
|
-
import { default as default70 } from "./components/
|
|
72
|
-
import { default as default71 } from "./components/
|
|
73
|
-
import { default as default72 } from "./components/
|
|
74
|
-
import { default as default73 } from "./components/
|
|
75
|
-
import { default as default74 } from "./components/
|
|
76
|
-
import { default as default75 } from "./
|
|
77
|
-
import { default as default76 } from "./modules/multimedia/
|
|
78
|
-
import { default as default77 } from "./modules/multimedia/
|
|
79
|
-
import { default as default78 } from "./modules/multimedia/
|
|
80
|
-
import { default as default79 } from "./
|
|
81
|
-
import { default as default80 } from "./
|
|
82
|
-
import { default as default81 } from "./modules/multimedia/
|
|
83
|
-
import { default as default82 } from "./
|
|
84
|
-
import { default as default83 } from "./hooks/
|
|
85
|
-
import { default as default84 } from "./hooks/
|
|
86
|
-
import { default as default85 } from "./hooks/
|
|
87
|
-
import { default as default86 } from "./hooks/
|
|
88
|
-
import { default as default87 } from "./hooks/
|
|
89
|
-
import { default as default88 } from "./hooks/
|
|
90
|
-
import { default as default89 } from "./hooks/
|
|
91
|
-
import { default as default90 } from "./hooks/
|
|
92
|
-
import { default as default91 } from "./hooks/
|
|
93
|
-
import { default as default92 } from "./hooks/
|
|
94
|
-
import { default as default93 } from "./hooks/
|
|
95
|
-
import { default as default94 } from "./hooks/
|
|
96
|
-
import { default as default95 } from "./hooks/
|
|
97
|
-
import { default as default96 } from "./hooks/
|
|
98
|
-
import { default as default97 } from "./hooks/
|
|
99
|
-
import { default as default98 } from "./hooks/
|
|
100
|
-
import { default as default99 } from "./hooks/
|
|
101
|
-
import { default as default100 } from "./hooks/
|
|
102
|
-
import { default as default101 } from "./hooks/
|
|
103
|
-
import { default as default102 } from "./hooks/
|
|
104
|
-
import { default as default103 } from "./hooks/
|
|
105
|
-
import { default as default104 } from "./hooks/
|
|
106
|
-
import { default as default105 } from "./hooks/
|
|
107
|
-
import { default as default106 } from "./hooks/
|
|
108
|
-
import { default as default107 } from "./hooks/
|
|
109
|
-
import { default as default108 } from "./hooks/
|
|
110
|
-
import { default as default109 } from "./hooks/
|
|
111
|
-
import { default as default110 } from "./
|
|
112
|
-
import { default as default111 } from "./hooks/
|
|
113
|
-
import { default as default112 } from "./hooks/
|
|
114
|
-
import { default as default113 } from "./hooks/
|
|
115
|
-
import { default as default114 } from "./hooks/
|
|
116
|
-
import { default as default115 } from "./hooks/
|
|
117
|
-
import { default as default116 } from "./hooks/
|
|
118
|
-
import { default as default117 } from "./
|
|
119
|
-
import { default as default118 } from "./hooks/
|
|
120
|
-
import { default as default119 } from "./hooks/
|
|
121
|
-
import { default as default120 } from "./hooks/
|
|
122
|
-
import { default as default121 } from "./hooks/
|
|
123
|
-
import { default as default122 } from "./hooks/useWorkspaceFolders/
|
|
124
|
-
import {
|
|
125
|
-
import { default as default124 } from "./hooks/
|
|
126
|
-
import { default as default125 } from "./hooks/
|
|
127
|
-
import { default as default126 } from "./hooks/useZendeskGuide/useZendeskGuide.js";
|
|
51
|
+
import { default as default50 } from "./modules/modals/OnboardingModal/OnboardingModal.js";
|
|
52
|
+
import { default as default51 } from "./components/PageLayout/PageLayout.js";
|
|
53
|
+
import { default as default52 } from "./components/PreventPropagation/PreventPropagation.js";
|
|
54
|
+
import { default as default53, Root } from "./components/PromotionCard/PromotionCard.js";
|
|
55
|
+
import { default as default54 } from "./modules/modals/PublishModal/PublishModal.js";
|
|
56
|
+
import { default as default55 } from "./components/Radio/Radio.js";
|
|
57
|
+
import { default as default56 } from "./components/RadioCard/RadioCard.js";
|
|
58
|
+
import { default as default57 } from "./components/RadioTile/RadioTile.js";
|
|
59
|
+
import { default as default58 } from "./components/SearchBar/SearchBar.js";
|
|
60
|
+
import { default as default59 } from "./components/Button/SearchButton.js";
|
|
61
|
+
import { default as default60 } from "./components/SegmentedControl/SegmentedControl.js";
|
|
62
|
+
import { default as default61 } from "./components/Select/Select.js";
|
|
63
|
+
import { default as default62 } from "./modules/modals/ShareModal/apps/ShareBlog.js";
|
|
64
|
+
import { default as default63 } from "./modules/modals/ShareModal/ShareModal.js";
|
|
65
|
+
import { default as default64 } from "./modules/modals/ShareModal/ShareResources.js";
|
|
66
|
+
import { default as default65 } from "./components/Tree/components/SortableTree.js";
|
|
67
|
+
import { default as default66 } from "./components/StackedGroup/StackedGroup.js";
|
|
68
|
+
import { default as default67 } from "./components/Stepper/Stepper.js";
|
|
69
|
+
import { default as default68 } from "./components/Switch/Switch.js";
|
|
70
|
+
import { default as default69 } from "./components/Table/components/Table.js";
|
|
71
|
+
import { default as default70 } from "./components/TextArea/TextArea.js";
|
|
72
|
+
import { default as default71 } from "./components/Skeleton/TextSkeleton.js";
|
|
73
|
+
import { default as default72 } from "./components/Tooltip/Tooltip.js";
|
|
74
|
+
import { default as default73 } from "./components/Tree/components/Tree.js";
|
|
75
|
+
import { default as default74 } from "./components/TreeView/TreeView.js";
|
|
76
|
+
import { default as default75 } from "./modules/multimedia/UploadCard/UploadCard.js";
|
|
77
|
+
import { default as default76 } from "./modules/multimedia/UploadFiles/UploadFiles.js";
|
|
78
|
+
import { default as default77 } from "./modules/multimedia/VideoEmbed/VideoEmbed.js";
|
|
79
|
+
import { default as default78 } from "./modules/multimedia/VideoRecorder/VideoRecorder.js";
|
|
80
|
+
import { default as default79 } from "./components/VisuallyHidden/VisuallyHidden.js";
|
|
81
|
+
import { default as default80 } from "./modules/multimedia/Workspace/Workspace.js";
|
|
82
|
+
import { default as default81 } from "./modules/multimedia/WorkspaceFolders/WorkspaceFolders.js";
|
|
83
|
+
import { default as default82 } from "./hooks/useBookmark/useBookmark.js";
|
|
84
|
+
import { default as default83 } from "./hooks/useBreakpoint/useBreakpoint.js";
|
|
85
|
+
import { default as default84 } from "./hooks/useBrowserInfo/useBrowserInfo.js";
|
|
86
|
+
import { default as default85 } from "./hooks/useCantoo/useCantoo.js";
|
|
87
|
+
import { default as default86 } from "./hooks/useCarbonioUnread/useCarbonioUnread.js";
|
|
88
|
+
import { default as default87 } from "./hooks/useClickOutside/useClickOutside.js";
|
|
89
|
+
import { default as default88 } from "./hooks/useConversation/useConversation.js";
|
|
90
|
+
import { default as default89 } from "./hooks/useDate/useDate.js";
|
|
91
|
+
import { default as default90 } from "./hooks/useDebounce/useDebounce.js";
|
|
92
|
+
import { default as default91 } from "./hooks/useDirectory/useDirectory.js";
|
|
93
|
+
import { default as default92 } from "./hooks/useDropdown/useDropdown.js";
|
|
94
|
+
import { default as default93 } from "./hooks/useDropzone/useDropzone.js";
|
|
95
|
+
import { default as default94 } from "./hooks/useEdificeIcons/useEdificeIcons.js";
|
|
96
|
+
import { default as default95 } from "./hooks/useHasWorkflow/useHasWorkflow.js";
|
|
97
|
+
import { default as default96 } from "./hooks/useHover/useHover.js";
|
|
98
|
+
import { default as default97 } from "./hooks/useHttpErrorToast/useHttpErrorToast.js";
|
|
99
|
+
import { default as default98 } from "./hooks/useImage/useImage.js";
|
|
100
|
+
import { default as default99 } from "./hooks/useInfiniteScroll/useInfiniteScroll.js";
|
|
101
|
+
import { default as default100 } from "./hooks/useIsAdmc/useIsAdmc.js";
|
|
102
|
+
import { default as default101 } from "./hooks/useIsAdml/useIsAdml.js";
|
|
103
|
+
import { default as default102 } from "./hooks/useIsAdmlcOrAdmc/useIsAdmlcOrAdmc.js";
|
|
104
|
+
import { default as default103 } from "./hooks/useKeyPress/useKeyPress.js";
|
|
105
|
+
import { default as default104 } from "./hooks/useLibraryUrl/useLibraryUrl.js";
|
|
106
|
+
import { default as default105 } from "./hooks/useMediaLibrary/useMediaLibrary.js";
|
|
107
|
+
import { default as default106 } from "./hooks/useNextcloudSearch/useNextcloudSearch.js";
|
|
108
|
+
import { default as default107 } from "./hooks/usePublicConf/usePublicConf.js";
|
|
109
|
+
import { default as default108 } from "./hooks/useScrollToTop/useScrollToTop.js";
|
|
110
|
+
import { default as default109 } from "./modules/modals/ShareModal/hooks/useShareMutation.js";
|
|
111
|
+
import { default as default110 } from "./hooks/useTitle/useTitle.js";
|
|
112
|
+
import { default as default111 } from "./hooks/useToast/useToast.js";
|
|
113
|
+
import { default as default112 } from "./hooks/useToggle/useToggle.js";
|
|
114
|
+
import { default as default113 } from "./hooks/useTrapFocus/useTrapFocus.js";
|
|
115
|
+
import { default as default114 } from "./hooks/useTrashedResource/useTrashedResource.js";
|
|
116
|
+
import { default as default115 } from "./hooks/useUiOverride/useUiOverride.js";
|
|
117
|
+
import { default as default116 } from "./modules/modals/ResourceModal/hooks/useUpdateMutation.js";
|
|
118
|
+
import { default as default117 } from "./hooks/useUpload/useUpload.js";
|
|
119
|
+
import { default as default118 } from "./hooks/useUploadFiles/useUploadFiles.js";
|
|
120
|
+
import { default as default119 } from "./hooks/useUser/useUser.js";
|
|
121
|
+
import { default as default120 } from "./hooks/useWorkspaceFile/useWorkspaceFile.js";
|
|
122
|
+
import { default as default121 } from "./hooks/useWorkspaceFolders/useWorkspaceFolders.js";
|
|
123
|
+
import { WORKSPACE_SHARED_FOLDER_ID, WORKSPACE_USER_FOLDER_ID, default as default122 } from "./hooks/useWorkspaceFolders/useWorkspaceFoldersTree.js";
|
|
124
|
+
import { default as default123 } from "./hooks/useWorkspaceSearch/useWorkspaceSearch.js";
|
|
125
|
+
import { default as default124 } from "./hooks/useXitiTrackPageLoad/useXitiTrackPageLoad.js";
|
|
126
|
+
import { default as default125 } from "./hooks/useZendeskGuide/useZendeskGuide.js";
|
|
128
127
|
import { AccessiblePalette, DefaultPalette } from "./components/ColorPicker/ColorPalette.js";
|
|
129
128
|
import { AntProvider } from "./providers/AntThemeProvider/AntProvider.js";
|
|
130
129
|
import { BetaSwitch } from "./components/BetaSwitch/BetaSwitch.js";
|
|
@@ -160,7 +159,7 @@ import { emptyScreenMapping } from "./utilities/emptyscreen-mapping/emptyscreen-
|
|
|
160
159
|
import { getRotateTransitionStyle } from "./utilities/rotate-transition-style/get-rotate-transition-style.js";
|
|
161
160
|
import { invalidateQueriesWithFirstPage } from "./utilities/react-query/react-query-utils.js";
|
|
162
161
|
import { mergeRefs, setRef } from "./utilities/refs/ref.js";
|
|
163
|
-
import { default as
|
|
162
|
+
import { default as default126 } from "./hooks/useBackground/useBackground.js";
|
|
164
163
|
import { useCheckable } from "./hooks/useCheckable/useCheckable.js";
|
|
165
164
|
import { useEdificeClient } from "./providers/EdificeClientProvider/EdificeClientProvider.hook.js";
|
|
166
165
|
import { useEdificeTheme } from "./providers/EdificeThemeProvider/EdificeThemeProvider.hook.js";
|
|
@@ -169,7 +168,7 @@ import { useOverlay } from "./components/PageLayout/hook/useOverlay.js";
|
|
|
169
168
|
import { useScreeb } from "./hooks/useScreeb/useScreeb.js";
|
|
170
169
|
import { useTreeSortable } from "./components/Tree/hooks/useTreeSortable.js";
|
|
171
170
|
import { useTreeView } from "./components/TreeView/hooks/useTreeView.js";
|
|
172
|
-
import { default as
|
|
171
|
+
import { default as default127 } from "./hooks/useUserPreferences/useUserPreferences.js";
|
|
173
172
|
export {
|
|
174
173
|
AccessiblePalette,
|
|
175
174
|
default2 as ActionBar,
|
|
@@ -239,57 +238,56 @@ export {
|
|
|
239
238
|
default47 as ModalBeta,
|
|
240
239
|
default48 as Nextcloud,
|
|
241
240
|
default49 as NextcloudFileCard,
|
|
242
|
-
default50 as
|
|
243
|
-
default51 as
|
|
244
|
-
default52 as PageLayout,
|
|
241
|
+
default50 as OnboardingModal,
|
|
242
|
+
default51 as PageLayout,
|
|
245
243
|
PageLayoutContext,
|
|
246
244
|
Pagination,
|
|
247
245
|
Popover,
|
|
248
246
|
PopoverBody,
|
|
249
247
|
PopoverFooter,
|
|
250
248
|
PopoverHeader,
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
249
|
+
default52 as PreventPropagation,
|
|
250
|
+
default53 as PromotionCard,
|
|
251
|
+
default54 as PublishModal,
|
|
252
|
+
default55 as Radio,
|
|
253
|
+
default56 as RadioCard,
|
|
254
|
+
default57 as RadioTile,
|
|
257
255
|
ResourceModal,
|
|
258
256
|
Root,
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
257
|
+
default58 as SearchBar,
|
|
258
|
+
default59 as SearchButton,
|
|
259
|
+
default60 as SegmentedControl,
|
|
260
|
+
default61 as Select,
|
|
261
|
+
default62 as ShareBlog,
|
|
262
|
+
default63 as ShareModal,
|
|
263
|
+
default64 as ShareResources,
|
|
264
|
+
default65 as SortableTree,
|
|
265
|
+
default66 as StackedGroup,
|
|
266
|
+
default67 as Stepper,
|
|
267
|
+
default68 as Switch,
|
|
268
|
+
default69 as Table,
|
|
271
269
|
Tabs,
|
|
272
|
-
|
|
273
|
-
|
|
270
|
+
default70 as TextArea,
|
|
271
|
+
default71 as TextSkeleton,
|
|
274
272
|
Toolbar,
|
|
275
|
-
|
|
276
|
-
|
|
273
|
+
default72 as Tooltip,
|
|
274
|
+
default73 as Tree,
|
|
277
275
|
TreeNode,
|
|
278
276
|
TreeNodeFolderWrapper,
|
|
279
|
-
|
|
277
|
+
default74 as TreeView,
|
|
280
278
|
Upload,
|
|
281
|
-
|
|
282
|
-
|
|
279
|
+
default75 as UploadCard,
|
|
280
|
+
default76 as UploadFiles,
|
|
283
281
|
UserRightsList,
|
|
284
282
|
UserSearch,
|
|
285
|
-
|
|
286
|
-
|
|
283
|
+
default77 as VideoEmbed,
|
|
284
|
+
default78 as VideoRecorder,
|
|
287
285
|
VisibleType,
|
|
288
|
-
|
|
286
|
+
default79 as VisuallyHidden,
|
|
289
287
|
WORKSPACE_SHARED_FOLDER_ID,
|
|
290
288
|
WORKSPACE_USER_FOLDER_ID,
|
|
291
|
-
|
|
292
|
-
|
|
289
|
+
default80 as Workspace,
|
|
290
|
+
default81 as WorkspaceFolders,
|
|
293
291
|
addNode,
|
|
294
292
|
arrayUnique,
|
|
295
293
|
buildTree,
|
|
@@ -320,61 +318,61 @@ export {
|
|
|
320
318
|
setRef,
|
|
321
319
|
updateNode,
|
|
322
320
|
updateParentIds,
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
321
|
+
default126 as useBackground,
|
|
322
|
+
default82 as useBookmark,
|
|
323
|
+
default83 as useBreakpoint,
|
|
324
|
+
default84 as useBrowserInfo,
|
|
325
|
+
default85 as useCantoo,
|
|
326
|
+
default86 as useCarbonioUnread,
|
|
329
327
|
useCheckable,
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
328
|
+
default87 as useClickOutside,
|
|
329
|
+
default88 as useConversation,
|
|
330
|
+
default89 as useDate,
|
|
331
|
+
default90 as useDebounce,
|
|
332
|
+
default91 as useDirectory,
|
|
333
|
+
default92 as useDropdown,
|
|
334
|
+
default93 as useDropzone,
|
|
337
335
|
useDropzoneContext,
|
|
338
336
|
useEdificeClient,
|
|
339
|
-
|
|
337
|
+
default94 as useEdificeIcons,
|
|
340
338
|
useEdificeTheme,
|
|
341
339
|
useFileToAttachment,
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
340
|
+
default95 as useHasWorkflow,
|
|
341
|
+
default96 as useHover,
|
|
342
|
+
default97 as useHttpErrorToast,
|
|
343
|
+
default98 as useImage,
|
|
344
|
+
default99 as useInfiniteScroll,
|
|
345
|
+
default100 as useIsAdmc,
|
|
346
|
+
default101 as useIsAdml,
|
|
347
|
+
default102 as useIsAdmlcOrAdmc,
|
|
348
|
+
default103 as useKeyPress,
|
|
349
|
+
default104 as useLibraryUrl,
|
|
350
|
+
default105 as useMediaLibrary,
|
|
351
|
+
default106 as useNextcloudSearch,
|
|
354
352
|
useOverlay,
|
|
355
353
|
usePageLayout,
|
|
356
|
-
|
|
354
|
+
default107 as usePublicConf,
|
|
357
355
|
useScreeb,
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
356
|
+
default108 as useScrollToTop,
|
|
357
|
+
default109 as useShareMutation,
|
|
358
|
+
default110 as useTitle,
|
|
359
|
+
default111 as useToast,
|
|
360
|
+
default112 as useToggle,
|
|
361
|
+
default113 as useTrapFocus,
|
|
362
|
+
default114 as useTrashedResource,
|
|
365
363
|
useTreeSortable,
|
|
366
364
|
useTreeView,
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
365
|
+
default115 as useUiOverride,
|
|
366
|
+
default116 as useUpdateMutation,
|
|
367
|
+
default117 as useUpload,
|
|
368
|
+
default118 as useUploadFiles,
|
|
369
|
+
default119 as useUser,
|
|
370
|
+
default127 as useUserPreferences,
|
|
371
|
+
default120 as useWorkspaceFile,
|
|
372
|
+
default121 as useWorkspaceFolders,
|
|
373
|
+
default122 as useWorkspaceFoldersTree,
|
|
374
|
+
default123 as useWorkspaceSearch,
|
|
375
|
+
default124 as useXitiTrackPageLoad,
|
|
376
|
+
default125 as useZendeskGuide,
|
|
379
377
|
wrapTreeNode
|
|
380
378
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
2
3
|
import { useTranslation } from "react-i18next";
|
|
3
4
|
import illuEmptyFavorite from "@edifice.io/bootstrap/dist/images/homepage/illu-empty-favorite.svg";
|
|
4
5
|
import SvgIconArrowRight from "../../../icons/components/IconArrowRight.js";
|
|
@@ -11,7 +12,9 @@ function Favorites({
|
|
|
11
12
|
}) {
|
|
12
13
|
const {
|
|
13
14
|
t
|
|
14
|
-
} = useTranslation(), getAppName = (app) => app.prefix && app.prefix.length > 1 ? t(app.prefix.substring(1)) : t(app.displayName) || "", visibleApps = apps.filter((app) => app.display !== !1)
|
|
15
|
+
} = useTranslation(), getAppName = (app) => app.prefix && app.prefix.length > 1 ? t(app.prefix.substring(1)) : t(app.displayName) || "", visibleApps = useMemo(() => apps.filter((app) => app.display !== !1).sort((a, b) => getAppName(a).localeCompare(getAppName(b), void 0, {
|
|
16
|
+
sensitivity: "base"
|
|
17
|
+
})), [apps, t]);
|
|
15
18
|
return /* @__PURE__ */ jsxs(HomeCard, { variant: "secondary", children: [
|
|
16
19
|
/* @__PURE__ */ jsx(HomeCard.Header, { title: t("homepage.favorites.title"), actionLabel: t("homepage.favorites.all"), onActionClick: onSeeAllClick, actionRightIcon: /* @__PURE__ */ jsx(SvgIconArrowRight, {}) }),
|
|
17
20
|
/* @__PURE__ */ jsx(HomeCard.Content, { children: /* @__PURE__ */ jsx("div", { className: "favorites-content", children: visibleApps.length === 0 ? /* @__PURE__ */ jsxs(Flex, { align: "center", gap: "12", children: [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useCallback, useEffect, useMemo } from "react";
|
|
2
|
+
import { useRef, useState, useCallback, useEffect, useMemo } from "react";
|
|
3
3
|
import { DocumentHelper } from "@edifice.io/client";
|
|
4
4
|
import clsx from "clsx";
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
|
@@ -7,10 +7,11 @@ import { findNodeById } from "../../../components/Tree/utilities/tree.js";
|
|
|
7
7
|
import SvgIconSortAscendingLetters from "../../icons/components/IconSortAscendingLetters.js";
|
|
8
8
|
import SvgIconSortDescendingLetters from "../../icons/components/IconSortDescendingLetters.js";
|
|
9
9
|
import SvgIconSortTime from "../../icons/components/IconSortTime.js";
|
|
10
|
-
import NextcloudLogin from "./NextcloudLogin.js";
|
|
11
10
|
import illuError from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-error.svg";
|
|
11
|
+
import illuConnectionLost from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-connection-lost.svg";
|
|
12
12
|
import illuTrash from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-trash.svg";
|
|
13
13
|
import useUser from "../../../hooks/useUser/useUser.js";
|
|
14
|
+
import useToast from "../../../hooks/useToast/useToast.js";
|
|
14
15
|
import useNextcloudSearch from "../../../hooks/useNextcloudSearch/useNextcloudSearch.js";
|
|
15
16
|
import LoadingScreen from "../../../components/LoadingScreen/LoadingScreen.js";
|
|
16
17
|
import Flex from "../../../components/Flex/Flex.js";
|
|
@@ -35,7 +36,7 @@ const Nextcloud = ({
|
|
|
35
36
|
t
|
|
36
37
|
} = useTranslation(), {
|
|
37
38
|
user
|
|
38
|
-
} = useUser(), {
|
|
39
|
+
} = useUser(), toast = useToast(), {
|
|
39
40
|
root,
|
|
40
41
|
needsAuth,
|
|
41
42
|
isCheckingAuth,
|
|
@@ -43,7 +44,7 @@ const Nextcloud = ({
|
|
|
43
44
|
refetchAuthStatus,
|
|
44
45
|
loadContent,
|
|
45
46
|
loadError
|
|
46
|
-
} = useNextcloudSearch(ROOT_ID, t("nextcloud"), user == null ? void 0 : user.userId), [currentNodeId, setCurrentNodeId] = useState(ROOT_ID), currentNode = findNodeById(root, currentNodeId) ?? root, [searchTerm, setSearchTerm] = useState(void 0), [sortOrder, setSortOrder] = useState(["modified", "desc"]), [selectedDocuments, setSelectedDocuments] = useState([]), handleTreeItemChange = useCallback((nodeId) => {
|
|
47
|
+
} = useNextcloudSearch(ROOT_ID, t("nextcloud"), user == null ? void 0 : user.userId), popupRef = useRef(null), [currentNodeId, setCurrentNodeId] = useState(ROOT_ID), currentNode = findNodeById(root, currentNodeId) ?? root, [searchTerm, setSearchTerm] = useState(void 0), [sortOrder, setSortOrder] = useState(["modified", "desc"]), [selectedDocuments, setSelectedDocuments] = useState([]), handleTreeItemChange = useCallback((nodeId) => {
|
|
47
48
|
setCurrentNodeId(nodeId), loadContent(nodeId);
|
|
48
49
|
}, [loadContent]);
|
|
49
50
|
useEffect(() => {
|
|
@@ -68,11 +69,22 @@ const Nextcloud = ({
|
|
|
68
69
|
let currentDocuments = [...selectedDocuments];
|
|
69
70
|
multiple ? currentDocuments.some((selectedDocument) => selectedDocument.path === doc.path) ? currentDocuments = currentDocuments.filter((selectedDocument) => selectedDocument.path !== doc.path) : currentDocuments = [...currentDocuments, doc] : currentDocuments = [doc], setSelectedDocuments(currentDocuments), onSelect(currentDocuments);
|
|
70
71
|
}
|
|
71
|
-
const nextcloud = clsx("workspace flex-grow-1 gap-0", className)
|
|
72
|
-
|
|
72
|
+
const nextcloud = clsx("workspace flex-grow-1 gap-0", className), openLoginPopup = () => {
|
|
73
|
+
popupRef.current = window.open(`${window.location.origin}/nextcloud/user/oauth2/init`, "", "popup, height=600, width=400"), popupRef.current || toast.error(t("nextcloud.auth.popupBlocked"));
|
|
74
|
+
};
|
|
75
|
+
return useEffect(() => {
|
|
76
|
+
function handleMessage(event) {
|
|
77
|
+
var _a;
|
|
78
|
+
event.origin !== window.location.origin || ((_a = event.data) == null ? void 0 : _a.type) !== "nextcloud-connected" || (popupRef.current && !popupRef.current.closed && popupRef.current.close(), refetchAuthStatus());
|
|
79
|
+
}
|
|
80
|
+
return window.addEventListener("message", handleMessage), () => window.removeEventListener("message", handleMessage);
|
|
81
|
+
}, [refetchAuthStatus]), isCheckingAuth ? /* @__PURE__ */ jsx(LoadingScreen, {}) : isAuthError ? /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "12", className: "h-full w-100", justify: "center", align: "center", children: [
|
|
73
82
|
/* @__PURE__ */ jsx(EmptyScreen, { imageSrc: illuError, title: t("nextcloud.error.title"), text: t("nextcloud.error.description") }),
|
|
74
83
|
/* @__PURE__ */ jsx(Button, { onClick: () => refetchAuthStatus(), children: t("retry") })
|
|
75
|
-
] }) : needsAuth ? /* @__PURE__ */
|
|
84
|
+
] }) : needsAuth ? /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "12", className: "h-full w-100", justify: "center", align: "center", children: [
|
|
85
|
+
/* @__PURE__ */ jsx(EmptyScreen, { imageSrc: illuConnectionLost, title: t("nextcloud.auth.title"), text: t("nextcloud.auth.description") }),
|
|
86
|
+
/* @__PURE__ */ jsx(Button, { onClick: openLoginPopup, children: t("nextcloud.auth.connect") })
|
|
87
|
+
] }) : /* @__PURE__ */ jsxs(Grid, { className: nextcloud, children: [
|
|
76
88
|
/* @__PURE__ */ jsx(Grid.Col, { sm: "12", md: "3", xl: "4", className: "workspace-folders p-12 pt-0 gap-12", children: /* @__PURE__ */ jsx("div", { style: {
|
|
77
89
|
position: "sticky",
|
|
78
90
|
top: 0,
|
package/dist/multimedia.js
CHANGED
|
@@ -6,13 +6,12 @@ import { default as default6 } from "./modules/multimedia/ImagePicker/ImagePicke
|
|
|
6
6
|
import { default as default7 } from "./modules/multimedia/MediaLibrary/MediaLibrary.js";
|
|
7
7
|
import { default as default8 } from "./modules/multimedia/Nextcloud/Nextcloud.js";
|
|
8
8
|
import { default as default9 } from "./modules/multimedia/FileCard/NextcloudFileCard.js";
|
|
9
|
-
import { default as default10 } from "./modules/multimedia/
|
|
10
|
-
import { default as default11 } from "./modules/multimedia/
|
|
11
|
-
import { default as default12 } from "./modules/multimedia/
|
|
12
|
-
import { default as default13 } from "./modules/multimedia/
|
|
13
|
-
import { default as default14 } from "./modules/multimedia/
|
|
14
|
-
import { default as default15 } from "./modules/multimedia/
|
|
15
|
-
import { default as default16 } from "./modules/multimedia/WorkspaceFolders/WorkspaceFolders.js";
|
|
9
|
+
import { default as default10 } from "./modules/multimedia/UploadCard/UploadCard.js";
|
|
10
|
+
import { default as default11 } from "./modules/multimedia/UploadFiles/UploadFiles.js";
|
|
11
|
+
import { default as default12 } from "./modules/multimedia/VideoEmbed/VideoEmbed.js";
|
|
12
|
+
import { default as default13 } from "./modules/multimedia/VideoRecorder/VideoRecorder.js";
|
|
13
|
+
import { default as default14 } from "./modules/multimedia/Workspace/Workspace.js";
|
|
14
|
+
import { default as default15 } from "./modules/multimedia/WorkspaceFolders/WorkspaceFolders.js";
|
|
16
15
|
import { ExternalLinker } from "./modules/multimedia/Linker/ExternalLinker/ExternalLinker.js";
|
|
17
16
|
import { InternalLinker } from "./modules/multimedia/Linker/InternalLinker/InternalLinker.js";
|
|
18
17
|
import { Upload } from "./modules/multimedia/MediaLibrary/innertabs/Upload.js";
|
|
@@ -27,12 +26,11 @@ export {
|
|
|
27
26
|
default7 as MediaLibrary,
|
|
28
27
|
default8 as Nextcloud,
|
|
29
28
|
default9 as NextcloudFileCard,
|
|
30
|
-
default10 as NextcloudFolders,
|
|
31
29
|
Upload,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
default10 as UploadCard,
|
|
31
|
+
default11 as UploadFiles,
|
|
32
|
+
default12 as VideoEmbed,
|
|
33
|
+
default13 as VideoRecorder,
|
|
34
|
+
default14 as Workspace,
|
|
35
|
+
default15 as WorkspaceFolders
|
|
38
36
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.6.12-develop
|
|
3
|
+
"version": "2.6.12-develop.20261103121017",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -140,9 +140,9 @@
|
|
|
140
140
|
"swiper": "10.1.0",
|
|
141
141
|
"ua-parser-js": "1.0.36",
|
|
142
142
|
"zustand": "4.5.7",
|
|
143
|
-
"@edifice.io/bootstrap": "2.6.12-develop
|
|
144
|
-
"@edifice.io/
|
|
145
|
-
"@edifice.io/
|
|
143
|
+
"@edifice.io/bootstrap": "2.6.12-develop.20261103121017",
|
|
144
|
+
"@edifice.io/utilities": "2.6.12-develop.20261103121017",
|
|
145
|
+
"@edifice.io/tiptap-extensions": "2.6.12-develop.20261103121017"
|
|
146
146
|
},
|
|
147
147
|
"devDependencies": {
|
|
148
148
|
"@babel/plugin-transform-react-pure-annotations": "7.27.1",
|
|
@@ -174,8 +174,8 @@
|
|
|
174
174
|
"vite": "5.4.14",
|
|
175
175
|
"vite-plugin-dts": "4.5.4",
|
|
176
176
|
"vite-tsconfig-paths": "5.1.4",
|
|
177
|
-
"@edifice.io/
|
|
178
|
-
"@edifice.io/
|
|
177
|
+
"@edifice.io/client": "2.6.12-develop.20261103121017",
|
|
178
|
+
"@edifice.io/config": "2.6.12-develop.20261103121017"
|
|
179
179
|
},
|
|
180
180
|
"peerDependencies": {
|
|
181
181
|
"@react-spring/web": "9.7.5",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tracks which searchable items match the current search query.
|
|
3
|
-
* Used by the Dropdown root (empty state) and by menu groups (hide empty groups).
|
|
4
|
-
*
|
|
5
|
-
* @returns `hasMatches` – true when at least one item matches, or when no item is searchable
|
|
6
|
-
* @returns `reportMatch` – registers or updates the match state of an item
|
|
7
|
-
* @returns `unregisterMatch` – removes an item from the registry
|
|
8
|
-
*/
|
|
9
|
-
export declare const useMatchRegistry: () => {
|
|
10
|
-
hasMatches: boolean;
|
|
11
|
-
reportMatch: (id: string, isMatch: boolean) => void;
|
|
12
|
-
unregisterMatch: (id: string) => void;
|
|
13
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { useState, useRef, useCallback } from "react";
|
|
2
|
-
const useMatchRegistry = () => {
|
|
3
|
-
const [hasMatches, setHasMatches] = useState(!0), matchMapRef = useRef(/* @__PURE__ */ new Map()), reportMatch = useCallback((id, isMatch) => {
|
|
4
|
-
matchMapRef.current.set(id, isMatch);
|
|
5
|
-
const next = [...matchMapRef.current.values()].some(Boolean);
|
|
6
|
-
setHasMatches((prev) => prev !== next ? next : prev);
|
|
7
|
-
}, []), unregisterMatch = useCallback((id) => {
|
|
8
|
-
matchMapRef.current.delete(id);
|
|
9
|
-
const next = matchMapRef.current.size === 0 || [...matchMapRef.current.values()].some(Boolean);
|
|
10
|
-
setHasMatches((prev) => prev !== next ? next : prev);
|
|
11
|
-
}, []);
|
|
12
|
-
return {
|
|
13
|
-
hasMatches,
|
|
14
|
-
reportMatch,
|
|
15
|
-
unregisterMatch
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
useMatchRegistry
|
|
20
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface NextcloudLoginProps {
|
|
2
|
-
/**
|
|
3
|
-
* Called once the user is connected through the OAuth2 popup.
|
|
4
|
-
*/
|
|
5
|
-
onConnected: () => void;
|
|
6
|
-
/**
|
|
7
|
-
* Replaces the default description, which is about inserting Nextcloud files.
|
|
8
|
-
*/
|
|
9
|
-
description?: string;
|
|
10
|
-
}
|
|
11
|
-
declare const NextcloudLogin: ({ onConnected, description }: NextcloudLoginProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export default NextcloudLogin;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useRef, useEffect } from "react";
|
|
3
|
-
import { useTranslation } from "react-i18next";
|
|
4
|
-
import illuConnectionLost from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-connection-lost.svg";
|
|
5
|
-
import useToast from "../../../hooks/useToast/useToast.js";
|
|
6
|
-
import Flex from "../../../components/Flex/Flex.js";
|
|
7
|
-
import EmptyScreen from "../../../components/EmptyScreen/EmptyScreen.js";
|
|
8
|
-
import Button from "../../../components/Button/Button.js";
|
|
9
|
-
const NextcloudLogin = ({
|
|
10
|
-
onConnected,
|
|
11
|
-
description
|
|
12
|
-
}) => {
|
|
13
|
-
const {
|
|
14
|
-
t
|
|
15
|
-
} = useTranslation(), toast = useToast(), popupRef = useRef(null);
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
function handleMessage(event) {
|
|
18
|
-
var _a;
|
|
19
|
-
event.origin !== window.location.origin || ((_a = event.data) == null ? void 0 : _a.type) !== "nextcloud-connected" || (popupRef.current && !popupRef.current.closed && popupRef.current.close(), onConnected());
|
|
20
|
-
}
|
|
21
|
-
return window.addEventListener("message", handleMessage), () => window.removeEventListener("message", handleMessage);
|
|
22
|
-
}, [onConnected]);
|
|
23
|
-
const openLoginPopup = () => {
|
|
24
|
-
popupRef.current = window.open(`${window.location.origin}/nextcloud/user/oauth2/init`, "", "popup, height=600, width=400"), popupRef.current || toast.error(t("nextcloud.auth.popupBlocked"));
|
|
25
|
-
};
|
|
26
|
-
return /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "12", className: "h-full w-100", justify: "center", align: "center", children: [
|
|
27
|
-
/* @__PURE__ */ jsx(EmptyScreen, { imageSrc: illuConnectionLost, title: t("nextcloud.auth.title"), text: description ?? t("nextcloud.auth.description") }),
|
|
28
|
-
/* @__PURE__ */ jsx(Button, { onClick: openLoginPopup, children: t("nextcloud.auth.connect") })
|
|
29
|
-
] });
|
|
30
|
-
};
|
|
31
|
-
export {
|
|
32
|
-
NextcloudLogin as default
|
|
33
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
interface NextcloudFoldersProps {
|
|
2
|
-
/**
|
|
3
|
-
* Function called with the path of the selected folder, relative to the user's Nextcloud root
|
|
4
|
-
*/
|
|
5
|
-
onFolderSelected: (path: string) => void;
|
|
6
|
-
/**
|
|
7
|
-
* Description of the login screen shown when the user is not connected to Nextcloud
|
|
8
|
-
*/
|
|
9
|
-
loginDescription?: string;
|
|
10
|
-
}
|
|
11
|
-
export default function NextcloudFolders({ onFolderSelected, loginDescription, }: NextcloudFoldersProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useEffect } from "react";
|
|
3
|
-
import { useTranslation } from "react-i18next";
|
|
4
|
-
import SvgIconFolderAdd from "../../icons/components/IconFolderAdd.js";
|
|
5
|
-
import NextcloudLogin from "../Nextcloud/NextcloudLogin.js";
|
|
6
|
-
import NewFolderForm from "./components/NewFolderForm.js";
|
|
7
|
-
import illuError from "@edifice.io/bootstrap/dist/images/emptyscreen/illu-error.svg";
|
|
8
|
-
import useUser from "../../../hooks/useUser/useUser.js";
|
|
9
|
-
import useNextcloudSearch from "../../../hooks/useNextcloudSearch/useNextcloudSearch.js";
|
|
10
|
-
import Loading from "../../../components/Loading/Loading.js";
|
|
11
|
-
import Flex from "../../../components/Flex/Flex.js";
|
|
12
|
-
import EmptyScreen from "../../../components/EmptyScreen/EmptyScreen.js";
|
|
13
|
-
import Button from "../../../components/Button/Button.js";
|
|
14
|
-
import Tree from "../../../components/Tree/components/Tree.js";
|
|
15
|
-
const ROOT_ID = "root", ROOT_PATH = "/";
|
|
16
|
-
function NextcloudFolders({
|
|
17
|
-
onFolderSelected,
|
|
18
|
-
loginDescription
|
|
19
|
-
}) {
|
|
20
|
-
const {
|
|
21
|
-
t
|
|
22
|
-
} = useTranslation(), {
|
|
23
|
-
user
|
|
24
|
-
} = useUser(), {
|
|
25
|
-
root,
|
|
26
|
-
needsAuth,
|
|
27
|
-
isCheckingAuth,
|
|
28
|
-
isAuthError,
|
|
29
|
-
refetchAuthStatus,
|
|
30
|
-
loadContent,
|
|
31
|
-
loadError
|
|
32
|
-
} = useNextcloudSearch(ROOT_ID, t("nextcloud"), user == null ? void 0 : user.userId), [selectedFolderId, setSelectedFolderId] = useState(), [showNewFolderForm, setShowNewFolderForm] = useState(!1), selectedPath = selectedFolderId === ROOT_ID ? ROOT_PATH : selectedFolderId;
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
needsAuth || loadContent(ROOT_ID);
|
|
35
|
-
}, [loadContent, needsAuth]);
|
|
36
|
-
const handleFolderSelected = (folderId) => {
|
|
37
|
-
setShowNewFolderForm(!1), setSelectedFolderId(folderId), loadContent(folderId), onFolderSelected(folderId === ROOT_ID ? ROOT_PATH : folderId);
|
|
38
|
-
}, handleFolderCreated = (path) => {
|
|
39
|
-
loadContent(selectedFolderId, !0), setSelectedFolderId(path), onFolderSelected(path);
|
|
40
|
-
}, handleRetry = () => isAuthError ? refetchAuthStatus() : loadContent(selectedFolderId ?? ROOT_ID, !0);
|
|
41
|
-
return isCheckingAuth ? /* @__PURE__ */ jsx(Loading, { isLoading: !0, className: "justify-content-center" }) : isAuthError || loadError ? /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "12", align: "center", children: [
|
|
42
|
-
/* @__PURE__ */ jsx(EmptyScreen, { imageSrc: illuError, title: t("nextcloud.error.title"), text: t("nextcloud.error.description") }),
|
|
43
|
-
/* @__PURE__ */ jsx(Button, { onClick: handleRetry, children: t("retry") })
|
|
44
|
-
] }) : needsAuth ? /* @__PURE__ */ jsx(NextcloudLogin, { onConnected: refetchAuthStatus, description: loginDescription }) : /* @__PURE__ */ jsxs("div", { className: "border border-gray-400 rounded", children: [
|
|
45
|
-
/* @__PURE__ */ jsx("div", { className: "p-12", children: /* @__PURE__ */ jsx(Tree, { nodes: root, selectedNodeId: selectedFolderId, showIcon: !0, onTreeItemClick: handleFolderSelected, onTreeItemUnfold: (nodeId) => loadContent(nodeId) }) }),
|
|
46
|
-
/* @__PURE__ */ jsx("div", { className: "d-flex justify-content-end border-top border-gray-400 px-8 py-4", children: showNewFolderForm && selectedPath ? /* @__PURE__ */ jsx(NewFolderForm, { parentPath: selectedPath, onClose: () => setShowNewFolderForm(!1), onFolderCreated: handleFolderCreated }) : /* @__PURE__ */ jsx(Button, { color: "primary", variant: "ghost", leftIcon: /* @__PURE__ */ jsx(SvgIconFolderAdd, {}), onClick: () => setShowNewFolderForm(!0), disabled: !selectedPath, children: t("workspace.folder.create") }) })
|
|
47
|
-
] });
|
|
48
|
-
}
|
|
49
|
-
export {
|
|
50
|
-
NextcloudFolders as default
|
|
51
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
type Props = {
|
|
2
|
-
/**
|
|
3
|
-
* Path of the folder in which the new folder is created
|
|
4
|
-
*/
|
|
5
|
-
parentPath: string;
|
|
6
|
-
/**
|
|
7
|
-
* Function called when the form is closed
|
|
8
|
-
*/
|
|
9
|
-
onClose: () => void;
|
|
10
|
-
/**
|
|
11
|
-
* Function called with the path of the created folder
|
|
12
|
-
*/
|
|
13
|
-
onFolderCreated: (path: string) => void;
|
|
14
|
-
};
|
|
15
|
-
export default function NewFolderForm({ parentPath, onClose, onFolderCreated, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export {};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useRef, useEffect } from "react";
|
|
3
|
-
import { odeServices } from "@edifice.io/client";
|
|
4
|
-
import { useMutation } from "@tanstack/react-query";
|
|
5
|
-
import { useTranslation } from "react-i18next";
|
|
6
|
-
import SvgIconSave from "../../../icons/components/IconSave.js";
|
|
7
|
-
import useUser from "../../../../hooks/useUser/useUser.js";
|
|
8
|
-
import useToast from "../../../../hooks/useToast/useToast.js";
|
|
9
|
-
import FormControl from "../../../../components/Form/FormControl.js";
|
|
10
|
-
import IconButton from "../../../../components/Button/IconButton.js";
|
|
11
|
-
function NewFolderForm({
|
|
12
|
-
parentPath,
|
|
13
|
-
onClose,
|
|
14
|
-
onFolderCreated
|
|
15
|
-
}) {
|
|
16
|
-
const {
|
|
17
|
-
t
|
|
18
|
-
} = useTranslation(), {
|
|
19
|
-
user
|
|
20
|
-
} = useUser(), toast = useToast(), refInputName = useRef(null), createFolderMutation = useMutation({
|
|
21
|
-
mutationFn: ({
|
|
22
|
-
userId,
|
|
23
|
-
path
|
|
24
|
-
}) => odeServices.nextcloud().createFolder(userId, path)
|
|
25
|
-
});
|
|
26
|
-
return useEffect(() => {
|
|
27
|
-
var _a;
|
|
28
|
-
(_a = refInputName.current) == null || _a.focus();
|
|
29
|
-
}, []), /* @__PURE__ */ jsx("form", { id: "modalNextcloudNewFolderForm", onSubmit: (event) => {
|
|
30
|
-
var _a;
|
|
31
|
-
event.preventDefault();
|
|
32
|
-
const folderName = (_a = refInputName.current) == null ? void 0 : _a.value.trim().replace(/\//g, "-");
|
|
33
|
-
if (!folderName || !user) return;
|
|
34
|
-
const path = `${parentPath.replace(/\/?$/, "/")}${folderName}/`;
|
|
35
|
-
createFolderMutation.mutate({
|
|
36
|
-
userId: user.userId,
|
|
37
|
-
path
|
|
38
|
-
}, {
|
|
39
|
-
onSuccess: () => {
|
|
40
|
-
onFolderCreated(path), onClose();
|
|
41
|
-
},
|
|
42
|
-
onError: () => toast.error(t("e400"))
|
|
43
|
-
});
|
|
44
|
-
}, children: /* @__PURE__ */ jsxs("div", { className: "d-flex gap-4 flex-row", children: [
|
|
45
|
-
/* @__PURE__ */ jsx(FormControl, { id: "modalNextcloudNewFolderForm", isRequired: !0, children: /* @__PURE__ */ jsx(FormControl.Input, { ref: refInputName, size: "md", type: "text", placeholder: t("workspace.folder.new.placeholder") }) }),
|
|
46
|
-
/* @__PURE__ */ jsx(IconButton, { type: "submit", color: "primary", variant: "ghost", title: t("workspace.folder.new.create"), disabled: createFolderMutation.isPending, isLoading: createFolderMutation.isPending, icon: /* @__PURE__ */ jsx(SvgIconSave, {}) })
|
|
47
|
-
] }) });
|
|
48
|
-
}
|
|
49
|
-
export {
|
|
50
|
-
NewFolderForm as default
|
|
51
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as NextcloudFolders } from './NextcloudFolders';
|