@edifice.io/react 2.6.11-develop.20261029135123 → 2.6.12-develop-integration-crna.20261101211105
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 +20 -14
- package/dist/components/Dropdown/DropdownContext.d.ts +5 -0
- package/dist/components/Dropdown/DropdownMenuGroup.js +23 -6
- package/dist/components/Dropdown/DropdownSearchInput.js +16 -8
- package/dist/components/Dropdown/DropdownTrigger.js +24 -8
- package/dist/components/Dropdown/useDropdownItemFilter.js +2 -2
- package/dist/components/Dropdown/useMatchRegistry.d.ts +13 -0
- package/dist/components/Dropdown/useMatchRegistry.js +20 -0
- package/dist/components/Select/Select.d.ts +14 -1
- package/dist/components/Select/Select.js +11 -5
- package/dist/hooks/useDropdown/useDropdown.d.ts +5 -0
- package/dist/hooks/useDropdown/useDropdown.js +16 -6
- package/dist/hooks/useNextcloudSearch/useNextcloudSearch.d.ts +1 -1
- package/dist/hooks/useNextcloudSearch/useNextcloudSearch.js +2 -2
- package/dist/index.js +158 -156
- package/dist/modules/homepage/components/Favorites/Favorites.js +1 -4
- package/dist/modules/multimedia/Nextcloud/Nextcloud.js +7 -19
- package/dist/modules/multimedia/Nextcloud/NextcloudLogin.d.ts +12 -0
- package/dist/modules/multimedia/Nextcloud/NextcloudLogin.js +33 -0
- package/dist/modules/multimedia/NextcloudFolders/NextcloudFolders.d.ts +12 -0
- package/dist/modules/multimedia/NextcloudFolders/NextcloudFolders.js +51 -0
- package/dist/modules/multimedia/NextcloudFolders/components/NewFolderForm.d.ts +16 -0
- package/dist/modules/multimedia/NextcloudFolders/components/NewFolderForm.js +51 -0
- package/dist/modules/multimedia/NextcloudFolders/index.d.ts +1 -0
- package/dist/modules/multimedia/index.d.ts +1 -0
- package/dist/multimedia.js +14 -12
- package/package.json +6 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useState,
|
|
2
|
+
import { forwardRef, useState, useImperativeHandle, useCallback, 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,6 +11,7 @@ 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";
|
|
14
15
|
import useClickOutside from "../../hooks/useClickOutside/useClickOutside.js";
|
|
15
16
|
const Root = /* @__PURE__ */ forwardRef(({
|
|
16
17
|
children,
|
|
@@ -25,15 +26,11 @@ const Root = /* @__PURE__ */ forwardRef(({
|
|
|
25
26
|
openOnSpace = !0,
|
|
26
27
|
focusOnMouseEnter = !0
|
|
27
28
|
}, refDropdown) => {
|
|
28
|
-
const [searchQuery, setSearchQuery] = useState(""), [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
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
|
-
}, []), {
|
|
29
|
+
const [searchQuery, setSearchQuery] = useState(""), [hasSearchInput, setHasSearchInput] = useState(!1), {
|
|
30
|
+
hasMatches,
|
|
31
|
+
reportMatch,
|
|
32
|
+
unregisterMatch
|
|
33
|
+
} = useMatchRegistry(), {
|
|
37
34
|
visible,
|
|
38
35
|
isFocused,
|
|
39
36
|
triggerProps,
|
|
@@ -43,6 +40,7 @@ const Root = /* @__PURE__ */ forwardRef(({
|
|
|
43
40
|
setVisible,
|
|
44
41
|
menuRef,
|
|
45
42
|
triggerRef,
|
|
43
|
+
searchInputRef,
|
|
46
44
|
closeDropdown,
|
|
47
45
|
openDropdown
|
|
48
46
|
} = useDropdown(placement, extraTriggerKeyDownHandler, isTriggerHovered, focusOnVisible, openOnSpace, focusOnMouseEnter);
|
|
@@ -57,30 +55,38 @@ const Root = /* @__PURE__ */ forwardRef(({
|
|
|
57
55
|
}));
|
|
58
56
|
const ref = useClickOutside(() => {
|
|
59
57
|
setVisible(!1);
|
|
60
|
-
}),
|
|
58
|
+
}), [rootElement, setRootElement] = useState(null), rootRef = useCallback((node) => {
|
|
59
|
+
ref.current = node, setRootElement(node);
|
|
60
|
+
}, [ref]), value = useMemo(() => ({
|
|
61
61
|
visible,
|
|
62
62
|
isFocused,
|
|
63
63
|
triggerProps,
|
|
64
64
|
menuProps,
|
|
65
65
|
itemProps,
|
|
66
66
|
itemRefs,
|
|
67
|
+
searchInputRef,
|
|
67
68
|
block,
|
|
68
69
|
setVisible,
|
|
69
70
|
openDropdown,
|
|
70
71
|
closeDropdown,
|
|
71
72
|
searchQuery,
|
|
72
73
|
setSearchQuery,
|
|
74
|
+
hasSearchInput,
|
|
75
|
+
setHasSearchInput,
|
|
76
|
+
rootElement,
|
|
73
77
|
hasMatches,
|
|
74
78
|
reportMatch,
|
|
75
79
|
unregisterMatch
|
|
76
|
-
}), [visible, isFocused, triggerProps, menuProps, itemProps, itemRefs, block, setVisible, openDropdown, closeDropdown, searchQuery, hasMatches, reportMatch, unregisterMatch]), dropdown = clsx("dropdown", {
|
|
80
|
+
}), [visible, isFocused, triggerProps, menuProps, itemProps, itemRefs, searchInputRef, block, setVisible, openDropdown, closeDropdown, searchQuery, hasSearchInput, rootElement, hasMatches, reportMatch, unregisterMatch]), dropdown = clsx("dropdown", {
|
|
77
81
|
"w-100": block,
|
|
78
82
|
"dropdown-nowrap": noWrap,
|
|
79
|
-
overflow
|
|
83
|
+
overflow,
|
|
84
|
+
// The search input is positioned over the trigger, within the root box.
|
|
85
|
+
"dropdown-searching": hasSearchInput
|
|
80
86
|
});
|
|
81
87
|
return useEffect(() => {
|
|
82
88
|
onToggle == null || onToggle(visible), visible || setSearchQuery("");
|
|
83
|
-
}, [visible]), /* @__PURE__ */ jsx(DropdownContext.Provider, { value, children: /* @__PURE__ */ jsx("div", { ref, className: dropdown, children: typeof children == "function" ? children(triggerProps, itemRefs, setVisible) : children }) });
|
|
89
|
+
}, [visible]), /* @__PURE__ */ jsx(DropdownContext.Provider, { value, children: /* @__PURE__ */ jsx("div", { ref: rootRef, className: dropdown, children: typeof children == "function" ? children(triggerProps, itemRefs, setVisible) : children }) });
|
|
84
90
|
}), Dropdown = Object.assign(Root, {
|
|
85
91
|
Trigger: DropdownTrigger,
|
|
86
92
|
Menu: DropdownMenu,
|
|
@@ -4,6 +4,11 @@ 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;
|
|
7
12
|
hasMatches: boolean;
|
|
8
13
|
reportMatch: (id: string, isMatch: boolean) => void;
|
|
9
14
|
unregisterMatch: (id: string) => void;
|
|
@@ -1,12 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef } from "react";
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useContext, useCallback, useMemo } from "react";
|
|
3
|
+
import { DropdownContext } from "./DropdownContext.js";
|
|
4
|
+
import { useMatchRegistry } from "./useMatchRegistry.js";
|
|
3
5
|
const DropdownMenuGroup = /* @__PURE__ */ forwardRef(({
|
|
4
6
|
label,
|
|
5
7
|
children
|
|
6
|
-
}, forwardRef2) =>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
}, forwardRef2) => {
|
|
9
|
+
const context = useContext(DropdownContext), {
|
|
10
|
+
hasMatches,
|
|
11
|
+
reportMatch,
|
|
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
|
+
});
|
|
10
27
|
export {
|
|
11
28
|
DropdownMenuGroup as default
|
|
12
29
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { createPortal } from "react-dom";
|
|
2
4
|
import { useDropdownContext } from "./DropdownContext.js";
|
|
3
5
|
import SearchBar from "../SearchBar/SearchBar.js";
|
|
4
6
|
const DropdownSearchInput = ({
|
|
@@ -9,15 +11,21 @@ const DropdownSearchInput = ({
|
|
|
9
11
|
const {
|
|
10
12
|
searchQuery,
|
|
11
13
|
setSearchQuery,
|
|
12
|
-
hasMatches
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
hasMatches,
|
|
15
|
+
searchInputRef,
|
|
16
|
+
setHasSearchInput,
|
|
17
|
+
rootElement,
|
|
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) => {
|
|
16
24
|
setSearchQuery(e.target.value), onSearch == null || onSearch(e.target.value);
|
|
17
25
|
}, onKeyDown: (e) => {
|
|
18
|
-
["ArrowUp", "ArrowDown", "Enter", " "].includes(e.key) && e.stopPropagation();
|
|
19
|
-
} }),
|
|
20
|
-
searchQuery && !hasMatches && /* @__PURE__ */ jsx("p", { className: "body-2 text-gray-700 text-center
|
|
26
|
+
(e.key === "ArrowDown" || e.key === "Escape" || e.key === "Tab" && e.shiftKey) && itemProps.onMenuItemKeyDown(e), ["ArrowUp", "ArrowDown", "Enter", " "].includes(e.key) && e.stopPropagation();
|
|
27
|
+
} }) }), rootElement),
|
|
28
|
+
searchQuery && !hasMatches && /* @__PURE__ */ jsx("p", { className: "body-2 text-gray-700 text-center my-8", children: noResultsLabel })
|
|
21
29
|
] });
|
|
22
30
|
};
|
|
23
31
|
export {
|
|
@@ -23,14 +23,30 @@ const DropdownTrigger = /* @__PURE__ */ forwardRef(({
|
|
|
23
23
|
}, forwardRef2) => {
|
|
24
24
|
const {
|
|
25
25
|
triggerProps,
|
|
26
|
-
block
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
block,
|
|
27
|
+
visible,
|
|
28
|
+
hasSearchInput
|
|
29
|
+
} = useDropdownContext(), className = clsx(
|
|
30
|
+
"dropdown-toggle ",
|
|
31
|
+
size,
|
|
32
|
+
variant,
|
|
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 = {
|
|
34
50
|
...outerBorderColor && {
|
|
35
51
|
outline: `${outerBorderWidth}px solid var(--edifice-${outerBorderColor})`,
|
|
36
52
|
outlineOffset: outerBorderOffset
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useId, useLayoutEffect } from "react";
|
|
2
2
|
import { useDropdownContext } from "./DropdownContext.js";
|
|
3
|
-
const useDropdownItemFilter = (searchValue) => {
|
|
3
|
+
const normalize = (value) => value.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase(), useDropdownItemFilter = (searchValue) => {
|
|
4
4
|
const {
|
|
5
5
|
searchQuery,
|
|
6
6
|
reportMatch,
|
|
7
7
|
unregisterMatch
|
|
8
|
-
} = useDropdownContext(), id = useId(), isFiltered = searchValue !== void 0 && searchQuery !== "" && !searchValue
|
|
8
|
+
} = useDropdownContext(), id = useId(), isFiltered = searchValue !== void 0 && searchQuery !== "" && !normalize(searchValue).includes(normalize(searchQuery));
|
|
9
9
|
return useLayoutEffect(() => {
|
|
10
10
|
if (searchValue !== void 0)
|
|
11
11
|
return reportMatch(id, !isFiltered), () => unregisterMatch(id);
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
};
|
|
@@ -35,13 +35,26 @@ 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;
|
|
38
51
|
}
|
|
39
52
|
/**
|
|
40
53
|
*
|
|
41
54
|
* Select component is based on Dropdown Component. It extends `Dropdown` and `Dropdown.Trigger` props `block`, `overflow`, `icon`, `variant`, `size`, `disabled`
|
|
42
55
|
*/
|
|
43
56
|
declare const Select: {
|
|
44
|
-
({ selectedValue, icon, options, overflow, block, variant, size, disabled, placeholderOption, onValueChange, defaultValue, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
57
|
+
({ selectedValue, icon, options, overflow, block, variant, size, disabled, placeholderOption, onValueChange, defaultValue, searchable, searchPlaceholder, noResultsLabel, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
45
58
|
displayName: string;
|
|
46
59
|
};
|
|
47
60
|
export default Select;
|
|
@@ -14,7 +14,10 @@ const Select = ({
|
|
|
14
14
|
disabled,
|
|
15
15
|
placeholderOption,
|
|
16
16
|
onValueChange,
|
|
17
|
-
defaultValue
|
|
17
|
+
defaultValue,
|
|
18
|
+
searchable,
|
|
19
|
+
searchPlaceholder,
|
|
20
|
+
noResultsLabel
|
|
18
21
|
}) => {
|
|
19
22
|
const [localValue, setLocalValue] = useState(), {
|
|
20
23
|
t
|
|
@@ -35,10 +38,13 @@ const Select = ({
|
|
|
35
38
|
const label = typeof localValue == "object" ? localValue.label : localValue, iconChange = typeof localValue == "object" ? localValue.icon : void 0;
|
|
36
39
|
return /* @__PURE__ */ jsxs(Dropdown, { overflow, block, children: [
|
|
37
40
|
/* @__PURE__ */ jsx(SelectTrigger, { icon: iconChange || icon, label: /* @__PURE__ */ jsx("span", { className: "text-truncate", children: t(label || placeholderOption) }), variant, size, disabled }),
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
/* @__PURE__ */ jsxs(Dropdown.Menu, { role: "listbox", children: [
|
|
42
|
+
searchable && /* @__PURE__ */ jsx(Dropdown.SearchInput, { placeholder: searchPlaceholder, noResultsLabel }),
|
|
43
|
+
options == null ? void 0 : options.map((option) => {
|
|
44
|
+
const value = typeof option == "object" ? option.value : option, label2 = typeof option == "object" ? option.label : option, icon2 = typeof option == "object" ? option.icon : void 0;
|
|
45
|
+
return /* @__PURE__ */ jsx(Dropdown.Item, { type: "action", onClick: () => setLocalValue(option), icon: icon2, searchValue: searchable ? label2 : void 0, children: label2 }, value);
|
|
46
|
+
})
|
|
47
|
+
] })
|
|
42
48
|
] });
|
|
43
49
|
};
|
|
44
50
|
export {
|
|
@@ -23,6 +23,11 @@ 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>;
|
|
26
31
|
triggerProps: Record<string, any>;
|
|
27
32
|
menuProps: Record<string, any>;
|
|
28
33
|
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), searchInputRef = useRef(null), {
|
|
6
6
|
refs,
|
|
7
7
|
floatingStyles,
|
|
8
8
|
context
|
|
@@ -30,9 +30,14 @@ const useDropdown = (placement, extraTriggerKeyDownHandler, isTriggerHovered = !
|
|
|
30
30
|
},
|
|
31
31
|
handleClose: safePolygon()
|
|
32
32
|
});
|
|
33
|
-
const menuRef = useRef(null), triggerRef = useRef(null), itemRefs = useRef({})
|
|
33
|
+
const menuRef = useRef(null), triggerRef = useRef(null), itemRefs = useRef({}), focusSearchInput = () => {
|
|
34
|
+
var _a;
|
|
35
|
+
setActiveIndex(-1), setIsFocused(null), (_a = searchInputRef.current) == null || _a.focus({
|
|
36
|
+
preventScroll: !0
|
|
37
|
+
});
|
|
38
|
+
};
|
|
34
39
|
useEffect(() => {
|
|
35
|
-
visible && menuRef.current && focusOnVisible ? (menuRef.current.focus(), setActiveIndex(0)) : (setActiveIndex(-1), itemRefs.current = {});
|
|
40
|
+
visible && searchInputRef.current && focusOnVisible ? focusSearchInput() : visible && menuRef.current && focusOnVisible ? (menuRef.current.focus(), setActiveIndex(0)) : (setActiveIndex(-1), itemRefs.current = {});
|
|
36
41
|
}, [visible]), useEffect(() => {
|
|
37
42
|
if (activeIndex !== -1) {
|
|
38
43
|
const filteredItems = Object.values(itemRefs.current).filter((item) => !!item);
|
|
@@ -49,10 +54,14 @@ const useDropdown = (placement, extraTriggerKeyDownHandler, isTriggerHovered = !
|
|
|
49
54
|
}, [activeIndex]);
|
|
50
55
|
const visibleItemCount = () => Object.values(itemRefs.current).filter(Boolean).length, nextItem = () => {
|
|
51
56
|
const count = visibleItemCount();
|
|
52
|
-
setActiveIndex((prevIndex) => (prevIndex + 1) % count);
|
|
57
|
+
count !== 0 && setActiveIndex((prevIndex) => (prevIndex + 1) % count);
|
|
53
58
|
}, previousItem = () => {
|
|
59
|
+
if (activeIndex === 0 && searchInputRef.current) {
|
|
60
|
+
focusSearchInput();
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
54
63
|
const count = visibleItemCount();
|
|
55
|
-
setActiveIndex((prevIndex) => (prevIndex - 1 + count) % count);
|
|
64
|
+
count !== 0 && setActiveIndex((prevIndex) => (prevIndex - 1 + count) % count);
|
|
56
65
|
}, firstItem = () => {
|
|
57
66
|
setActiveIndex(0);
|
|
58
67
|
}, lastItem = () => {
|
|
@@ -105,7 +114,7 @@ const useDropdown = (placement, extraTriggerKeyDownHandler, isTriggerHovered = !
|
|
|
105
114
|
break;
|
|
106
115
|
case " ":
|
|
107
116
|
case "Enter":
|
|
108
|
-
activeIndex !== -1 && (Object.values(itemRefs.current)[activeIndex].getAttribute("role") === "menuitem" && triggerRef.current && (triggerRef.current.focus(), setVisible(!1)), onSuccess == null || onSuccess()), flag = !0;
|
|
117
|
+
activeIndex !== -1 && (Object.values(itemRefs.current).filter(Boolean)[activeIndex].getAttribute("role") === "menuitem" && triggerRef.current && (triggerRef.current.focus(), setVisible(!1)), onSuccess == null || onSuccess()), flag = !0;
|
|
109
118
|
break;
|
|
110
119
|
case "ArrowDown":
|
|
111
120
|
case "Down":
|
|
@@ -133,6 +142,7 @@ const useDropdown = (placement, extraTriggerKeyDownHandler, isTriggerHovered = !
|
|
|
133
142
|
itemRefs,
|
|
134
143
|
triggerRef,
|
|
135
144
|
menuRef,
|
|
145
|
+
searchInputRef,
|
|
136
146
|
/* TriggerProps to spread to any Trigger component */
|
|
137
147
|
triggerProps: {
|
|
138
148
|
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) => void;
|
|
12
|
+
loadContent: (folderId?: ID, force?: boolean) => 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, force = !1) => {
|
|
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: 6e4
|
|
43
|
+
staleTime: force ? 0 : 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,82 +48,83 @@ 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
|
|
55
|
-
import { default as default54 } from "./
|
|
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 "./
|
|
111
|
-
import { default as default110 } from "./hooks/
|
|
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 "./
|
|
118
|
-
import { default as default117 } from "./hooks/
|
|
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 {
|
|
124
|
-
import { default as default123 } from "./hooks/
|
|
125
|
-
import { default as default124 } from "./hooks/
|
|
126
|
-
import { default as default125 } from "./hooks/
|
|
51
|
+
import { default as default50 } from "./modules/multimedia/NextcloudFolders/NextcloudFolders.js";
|
|
52
|
+
import { default as default51 } from "./modules/modals/OnboardingModal/OnboardingModal.js";
|
|
53
|
+
import { default as default52 } from "./components/PageLayout/PageLayout.js";
|
|
54
|
+
import { default as default53 } from "./components/PreventPropagation/PreventPropagation.js";
|
|
55
|
+
import { default as default54, Root } from "./components/PromotionCard/PromotionCard.js";
|
|
56
|
+
import { default as default55 } from "./modules/modals/PublishModal/PublishModal.js";
|
|
57
|
+
import { default as default56 } from "./components/Radio/Radio.js";
|
|
58
|
+
import { default as default57 } from "./components/RadioCard/RadioCard.js";
|
|
59
|
+
import { default as default58 } from "./components/RadioTile/RadioTile.js";
|
|
60
|
+
import { default as default59 } from "./components/SearchBar/SearchBar.js";
|
|
61
|
+
import { default as default60 } from "./components/Button/SearchButton.js";
|
|
62
|
+
import { default as default61 } from "./components/SegmentedControl/SegmentedControl.js";
|
|
63
|
+
import { default as default62 } from "./components/Select/Select.js";
|
|
64
|
+
import { default as default63 } from "./modules/modals/ShareModal/apps/ShareBlog.js";
|
|
65
|
+
import { default as default64 } from "./modules/modals/ShareModal/ShareModal.js";
|
|
66
|
+
import { default as default65 } from "./modules/modals/ShareModal/ShareResources.js";
|
|
67
|
+
import { default as default66 } from "./components/Tree/components/SortableTree.js";
|
|
68
|
+
import { default as default67 } from "./components/StackedGroup/StackedGroup.js";
|
|
69
|
+
import { default as default68 } from "./components/Stepper/Stepper.js";
|
|
70
|
+
import { default as default69 } from "./components/Switch/Switch.js";
|
|
71
|
+
import { default as default70 } from "./components/Table/components/Table.js";
|
|
72
|
+
import { default as default71 } from "./components/TextArea/TextArea.js";
|
|
73
|
+
import { default as default72 } from "./components/Skeleton/TextSkeleton.js";
|
|
74
|
+
import { default as default73 } from "./components/Tooltip/Tooltip.js";
|
|
75
|
+
import { default as default74 } from "./components/Tree/components/Tree.js";
|
|
76
|
+
import { default as default75 } from "./components/TreeView/TreeView.js";
|
|
77
|
+
import { default as default76 } from "./modules/multimedia/UploadCard/UploadCard.js";
|
|
78
|
+
import { default as default77 } from "./modules/multimedia/UploadFiles/UploadFiles.js";
|
|
79
|
+
import { default as default78 } from "./modules/multimedia/VideoEmbed/VideoEmbed.js";
|
|
80
|
+
import { default as default79 } from "./modules/multimedia/VideoRecorder/VideoRecorder.js";
|
|
81
|
+
import { default as default80 } from "./components/VisuallyHidden/VisuallyHidden.js";
|
|
82
|
+
import { default as default81 } from "./modules/multimedia/Workspace/Workspace.js";
|
|
83
|
+
import { default as default82 } from "./modules/multimedia/WorkspaceFolders/WorkspaceFolders.js";
|
|
84
|
+
import { default as default83 } from "./hooks/useBookmark/useBookmark.js";
|
|
85
|
+
import { default as default84 } from "./hooks/useBreakpoint/useBreakpoint.js";
|
|
86
|
+
import { default as default85 } from "./hooks/useBrowserInfo/useBrowserInfo.js";
|
|
87
|
+
import { default as default86 } from "./hooks/useCantoo/useCantoo.js";
|
|
88
|
+
import { default as default87 } from "./hooks/useCarbonioUnread/useCarbonioUnread.js";
|
|
89
|
+
import { default as default88 } from "./hooks/useClickOutside/useClickOutside.js";
|
|
90
|
+
import { default as default89 } from "./hooks/useConversation/useConversation.js";
|
|
91
|
+
import { default as default90 } from "./hooks/useDate/useDate.js";
|
|
92
|
+
import { default as default91 } from "./hooks/useDebounce/useDebounce.js";
|
|
93
|
+
import { default as default92 } from "./hooks/useDirectory/useDirectory.js";
|
|
94
|
+
import { default as default93 } from "./hooks/useDropdown/useDropdown.js";
|
|
95
|
+
import { default as default94 } from "./hooks/useDropzone/useDropzone.js";
|
|
96
|
+
import { default as default95 } from "./hooks/useEdificeIcons/useEdificeIcons.js";
|
|
97
|
+
import { default as default96 } from "./hooks/useHasWorkflow/useHasWorkflow.js";
|
|
98
|
+
import { default as default97 } from "./hooks/useHover/useHover.js";
|
|
99
|
+
import { default as default98 } from "./hooks/useHttpErrorToast/useHttpErrorToast.js";
|
|
100
|
+
import { default as default99 } from "./hooks/useImage/useImage.js";
|
|
101
|
+
import { default as default100 } from "./hooks/useInfiniteScroll/useInfiniteScroll.js";
|
|
102
|
+
import { default as default101 } from "./hooks/useIsAdmc/useIsAdmc.js";
|
|
103
|
+
import { default as default102 } from "./hooks/useIsAdml/useIsAdml.js";
|
|
104
|
+
import { default as default103 } from "./hooks/useIsAdmlcOrAdmc/useIsAdmlcOrAdmc.js";
|
|
105
|
+
import { default as default104 } from "./hooks/useKeyPress/useKeyPress.js";
|
|
106
|
+
import { default as default105 } from "./hooks/useLibraryUrl/useLibraryUrl.js";
|
|
107
|
+
import { default as default106 } from "./hooks/useMediaLibrary/useMediaLibrary.js";
|
|
108
|
+
import { default as default107 } from "./hooks/useNextcloudSearch/useNextcloudSearch.js";
|
|
109
|
+
import { default as default108 } from "./hooks/usePublicConf/usePublicConf.js";
|
|
110
|
+
import { default as default109 } from "./hooks/useScrollToTop/useScrollToTop.js";
|
|
111
|
+
import { default as default110 } from "./modules/modals/ShareModal/hooks/useShareMutation.js";
|
|
112
|
+
import { default as default111 } from "./hooks/useTitle/useTitle.js";
|
|
113
|
+
import { default as default112 } from "./hooks/useToast/useToast.js";
|
|
114
|
+
import { default as default113 } from "./hooks/useToggle/useToggle.js";
|
|
115
|
+
import { default as default114 } from "./hooks/useTrapFocus/useTrapFocus.js";
|
|
116
|
+
import { default as default115 } from "./hooks/useTrashedResource/useTrashedResource.js";
|
|
117
|
+
import { default as default116 } from "./hooks/useUiOverride/useUiOverride.js";
|
|
118
|
+
import { default as default117 } from "./modules/modals/ResourceModal/hooks/useUpdateMutation.js";
|
|
119
|
+
import { default as default118 } from "./hooks/useUpload/useUpload.js";
|
|
120
|
+
import { default as default119 } from "./hooks/useUploadFiles/useUploadFiles.js";
|
|
121
|
+
import { default as default120 } from "./hooks/useUser/useUser.js";
|
|
122
|
+
import { default as default121 } from "./hooks/useWorkspaceFile/useWorkspaceFile.js";
|
|
123
|
+
import { default as default122 } from "./hooks/useWorkspaceFolders/useWorkspaceFolders.js";
|
|
124
|
+
import { WORKSPACE_SHARED_FOLDER_ID, WORKSPACE_USER_FOLDER_ID, default as default123 } from "./hooks/useWorkspaceFolders/useWorkspaceFoldersTree.js";
|
|
125
|
+
import { default as default124 } from "./hooks/useWorkspaceSearch/useWorkspaceSearch.js";
|
|
126
|
+
import { default as default125 } from "./hooks/useXitiTrackPageLoad/useXitiTrackPageLoad.js";
|
|
127
|
+
import { default as default126 } from "./hooks/useZendeskGuide/useZendeskGuide.js";
|
|
127
128
|
import { AccessiblePalette, DefaultPalette } from "./components/ColorPicker/ColorPalette.js";
|
|
128
129
|
import { AntProvider } from "./providers/AntThemeProvider/AntProvider.js";
|
|
129
130
|
import { BetaSwitch } from "./components/BetaSwitch/BetaSwitch.js";
|
|
@@ -159,7 +160,7 @@ import { emptyScreenMapping } from "./utilities/emptyscreen-mapping/emptyscreen-
|
|
|
159
160
|
import { getRotateTransitionStyle } from "./utilities/rotate-transition-style/get-rotate-transition-style.js";
|
|
160
161
|
import { invalidateQueriesWithFirstPage } from "./utilities/react-query/react-query-utils.js";
|
|
161
162
|
import { mergeRefs, setRef } from "./utilities/refs/ref.js";
|
|
162
|
-
import { default as
|
|
163
|
+
import { default as default127 } from "./hooks/useBackground/useBackground.js";
|
|
163
164
|
import { useCheckable } from "./hooks/useCheckable/useCheckable.js";
|
|
164
165
|
import { useEdificeClient } from "./providers/EdificeClientProvider/EdificeClientProvider.hook.js";
|
|
165
166
|
import { useEdificeTheme } from "./providers/EdificeThemeProvider/EdificeThemeProvider.hook.js";
|
|
@@ -168,7 +169,7 @@ import { useOverlay } from "./components/PageLayout/hook/useOverlay.js";
|
|
|
168
169
|
import { useScreeb } from "./hooks/useScreeb/useScreeb.js";
|
|
169
170
|
import { useTreeSortable } from "./components/Tree/hooks/useTreeSortable.js";
|
|
170
171
|
import { useTreeView } from "./components/TreeView/hooks/useTreeView.js";
|
|
171
|
-
import { default as
|
|
172
|
+
import { default as default128 } from "./hooks/useUserPreferences/useUserPreferences.js";
|
|
172
173
|
export {
|
|
173
174
|
AccessiblePalette,
|
|
174
175
|
default2 as ActionBar,
|
|
@@ -238,56 +239,57 @@ export {
|
|
|
238
239
|
default47 as ModalBeta,
|
|
239
240
|
default48 as Nextcloud,
|
|
240
241
|
default49 as NextcloudFileCard,
|
|
241
|
-
default50 as
|
|
242
|
-
default51 as
|
|
242
|
+
default50 as NextcloudFolders,
|
|
243
|
+
default51 as OnboardingModal,
|
|
244
|
+
default52 as PageLayout,
|
|
243
245
|
PageLayoutContext,
|
|
244
246
|
Pagination,
|
|
245
247
|
Popover,
|
|
246
248
|
PopoverBody,
|
|
247
249
|
PopoverFooter,
|
|
248
250
|
PopoverHeader,
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
251
|
+
default53 as PreventPropagation,
|
|
252
|
+
default54 as PromotionCard,
|
|
253
|
+
default55 as PublishModal,
|
|
254
|
+
default56 as Radio,
|
|
255
|
+
default57 as RadioCard,
|
|
256
|
+
default58 as RadioTile,
|
|
255
257
|
ResourceModal,
|
|
256
258
|
Root,
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
259
|
+
default59 as SearchBar,
|
|
260
|
+
default60 as SearchButton,
|
|
261
|
+
default61 as SegmentedControl,
|
|
262
|
+
default62 as Select,
|
|
263
|
+
default63 as ShareBlog,
|
|
264
|
+
default64 as ShareModal,
|
|
265
|
+
default65 as ShareResources,
|
|
266
|
+
default66 as SortableTree,
|
|
267
|
+
default67 as StackedGroup,
|
|
268
|
+
default68 as Stepper,
|
|
269
|
+
default69 as Switch,
|
|
270
|
+
default70 as Table,
|
|
269
271
|
Tabs,
|
|
270
|
-
|
|
271
|
-
|
|
272
|
+
default71 as TextArea,
|
|
273
|
+
default72 as TextSkeleton,
|
|
272
274
|
Toolbar,
|
|
273
|
-
|
|
274
|
-
|
|
275
|
+
default73 as Tooltip,
|
|
276
|
+
default74 as Tree,
|
|
275
277
|
TreeNode,
|
|
276
278
|
TreeNodeFolderWrapper,
|
|
277
|
-
|
|
279
|
+
default75 as TreeView,
|
|
278
280
|
Upload,
|
|
279
|
-
|
|
280
|
-
|
|
281
|
+
default76 as UploadCard,
|
|
282
|
+
default77 as UploadFiles,
|
|
281
283
|
UserRightsList,
|
|
282
284
|
UserSearch,
|
|
283
|
-
|
|
284
|
-
|
|
285
|
+
default78 as VideoEmbed,
|
|
286
|
+
default79 as VideoRecorder,
|
|
285
287
|
VisibleType,
|
|
286
|
-
|
|
288
|
+
default80 as VisuallyHidden,
|
|
287
289
|
WORKSPACE_SHARED_FOLDER_ID,
|
|
288
290
|
WORKSPACE_USER_FOLDER_ID,
|
|
289
|
-
|
|
290
|
-
|
|
291
|
+
default81 as Workspace,
|
|
292
|
+
default82 as WorkspaceFolders,
|
|
291
293
|
addNode,
|
|
292
294
|
arrayUnique,
|
|
293
295
|
buildTree,
|
|
@@ -318,61 +320,61 @@ export {
|
|
|
318
320
|
setRef,
|
|
319
321
|
updateNode,
|
|
320
322
|
updateParentIds,
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
323
|
+
default127 as useBackground,
|
|
324
|
+
default83 as useBookmark,
|
|
325
|
+
default84 as useBreakpoint,
|
|
326
|
+
default85 as useBrowserInfo,
|
|
327
|
+
default86 as useCantoo,
|
|
328
|
+
default87 as useCarbonioUnread,
|
|
327
329
|
useCheckable,
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
330
|
+
default88 as useClickOutside,
|
|
331
|
+
default89 as useConversation,
|
|
332
|
+
default90 as useDate,
|
|
333
|
+
default91 as useDebounce,
|
|
334
|
+
default92 as useDirectory,
|
|
335
|
+
default93 as useDropdown,
|
|
336
|
+
default94 as useDropzone,
|
|
335
337
|
useDropzoneContext,
|
|
336
338
|
useEdificeClient,
|
|
337
|
-
|
|
339
|
+
default95 as useEdificeIcons,
|
|
338
340
|
useEdificeTheme,
|
|
339
341
|
useFileToAttachment,
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
342
|
+
default96 as useHasWorkflow,
|
|
343
|
+
default97 as useHover,
|
|
344
|
+
default98 as useHttpErrorToast,
|
|
345
|
+
default99 as useImage,
|
|
346
|
+
default100 as useInfiniteScroll,
|
|
347
|
+
default101 as useIsAdmc,
|
|
348
|
+
default102 as useIsAdml,
|
|
349
|
+
default103 as useIsAdmlcOrAdmc,
|
|
350
|
+
default104 as useKeyPress,
|
|
351
|
+
default105 as useLibraryUrl,
|
|
352
|
+
default106 as useMediaLibrary,
|
|
353
|
+
default107 as useNextcloudSearch,
|
|
352
354
|
useOverlay,
|
|
353
355
|
usePageLayout,
|
|
354
|
-
|
|
356
|
+
default108 as usePublicConf,
|
|
355
357
|
useScreeb,
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
358
|
+
default109 as useScrollToTop,
|
|
359
|
+
default110 as useShareMutation,
|
|
360
|
+
default111 as useTitle,
|
|
361
|
+
default112 as useToast,
|
|
362
|
+
default113 as useToggle,
|
|
363
|
+
default114 as useTrapFocus,
|
|
364
|
+
default115 as useTrashedResource,
|
|
363
365
|
useTreeSortable,
|
|
364
366
|
useTreeView,
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
367
|
+
default116 as useUiOverride,
|
|
368
|
+
default117 as useUpdateMutation,
|
|
369
|
+
default118 as useUpload,
|
|
370
|
+
default119 as useUploadFiles,
|
|
371
|
+
default120 as useUser,
|
|
372
|
+
default128 as useUserPreferences,
|
|
373
|
+
default121 as useWorkspaceFile,
|
|
374
|
+
default122 as useWorkspaceFolders,
|
|
375
|
+
default123 as useWorkspaceFoldersTree,
|
|
376
|
+
default124 as useWorkspaceSearch,
|
|
377
|
+
default125 as useXitiTrackPageLoad,
|
|
378
|
+
default126 as useZendeskGuide,
|
|
377
379
|
wrapTreeNode
|
|
378
380
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useMemo } from "react";
|
|
3
2
|
import { useTranslation } from "react-i18next";
|
|
4
3
|
import illuEmptyFavorite from "@edifice.io/bootstrap/dist/images/homepage/illu-empty-favorite.svg";
|
|
5
4
|
import SvgIconArrowRight from "../../../icons/components/IconArrowRight.js";
|
|
@@ -12,9 +11,7 @@ function Favorites({
|
|
|
12
11
|
}) {
|
|
13
12
|
const {
|
|
14
13
|
t
|
|
15
|
-
} = useTranslation(), getAppName = (app) => app.prefix && app.prefix.length > 1 ? t(app.prefix.substring(1)) : t(app.displayName) || "", visibleApps =
|
|
16
|
-
sensitivity: "base"
|
|
17
|
-
})), [apps, 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);
|
|
18
15
|
return /* @__PURE__ */ jsxs(HomeCard, { variant: "secondary", children: [
|
|
19
16
|
/* @__PURE__ */ jsx(HomeCard.Header, { title: t("homepage.favorites.title"), actionLabel: t("homepage.favorites.all"), onActionClick: onSeeAllClick, actionRightIcon: /* @__PURE__ */ jsx(SvgIconArrowRight, {}) }),
|
|
20
17
|
/* @__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 {
|
|
2
|
+
import { 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,11 +7,10 @@ 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";
|
|
10
11
|
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";
|
|
15
14
|
import useNextcloudSearch from "../../../hooks/useNextcloudSearch/useNextcloudSearch.js";
|
|
16
15
|
import LoadingScreen from "../../../components/LoadingScreen/LoadingScreen.js";
|
|
17
16
|
import Flex from "../../../components/Flex/Flex.js";
|
|
@@ -36,7 +35,7 @@ const Nextcloud = ({
|
|
|
36
35
|
t
|
|
37
36
|
} = useTranslation(), {
|
|
38
37
|
user
|
|
39
|
-
} = useUser(),
|
|
38
|
+
} = useUser(), {
|
|
40
39
|
root,
|
|
41
40
|
needsAuth,
|
|
42
41
|
isCheckingAuth,
|
|
@@ -44,7 +43,7 @@ const Nextcloud = ({
|
|
|
44
43
|
refetchAuthStatus,
|
|
45
44
|
loadContent,
|
|
46
45
|
loadError
|
|
47
|
-
} = useNextcloudSearch(ROOT_ID, t("nextcloud"), user == null ? void 0 : user.userId),
|
|
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) => {
|
|
48
47
|
setCurrentNodeId(nodeId), loadContent(nodeId);
|
|
49
48
|
}, [loadContent]);
|
|
50
49
|
useEffect(() => {
|
|
@@ -69,22 +68,11 @@ const Nextcloud = ({
|
|
|
69
68
|
let currentDocuments = [...selectedDocuments];
|
|
70
69
|
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);
|
|
71
70
|
}
|
|
72
|
-
const nextcloud = clsx("workspace flex-grow-1 gap-0", className)
|
|
73
|
-
|
|
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: [
|
|
71
|
+
const nextcloud = clsx("workspace flex-grow-1 gap-0", className);
|
|
72
|
+
return isCheckingAuth ? /* @__PURE__ */ jsx(LoadingScreen, {}) : isAuthError ? /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "12", className: "h-full w-100", justify: "center", align: "center", children: [
|
|
82
73
|
/* @__PURE__ */ jsx(EmptyScreen, { imageSrc: illuError, title: t("nextcloud.error.title"), text: t("nextcloud.error.description") }),
|
|
83
74
|
/* @__PURE__ */ jsx(Button, { onClick: () => refetchAuthStatus(), children: t("retry") })
|
|
84
|
-
] }) : needsAuth ? /* @__PURE__ */
|
|
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: [
|
|
75
|
+
] }) : needsAuth ? /* @__PURE__ */ jsx(NextcloudLogin, { onConnected: refetchAuthStatus }) : /* @__PURE__ */ jsxs(Grid, { className: nextcloud, children: [
|
|
88
76
|
/* @__PURE__ */ jsx(Grid.Col, { sm: "12", md: "3", xl: "4", className: "workspace-folders p-12 pt-0 gap-12", children: /* @__PURE__ */ jsx("div", { style: {
|
|
89
77
|
position: "sticky",
|
|
90
78
|
top: 0,
|
|
@@ -0,0 +1,12 @@
|
|
|
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;
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as NextcloudFolders } from './NextcloudFolders';
|
package/dist/multimedia.js
CHANGED
|
@@ -6,12 +6,13 @@ 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/
|
|
9
|
+
import { default as default10 } from "./modules/multimedia/NextcloudFolders/NextcloudFolders.js";
|
|
10
|
+
import { default as default11 } from "./modules/multimedia/UploadCard/UploadCard.js";
|
|
11
|
+
import { default as default12 } from "./modules/multimedia/UploadFiles/UploadFiles.js";
|
|
12
|
+
import { default as default13 } from "./modules/multimedia/VideoEmbed/VideoEmbed.js";
|
|
13
|
+
import { default as default14 } from "./modules/multimedia/VideoRecorder/VideoRecorder.js";
|
|
14
|
+
import { default as default15 } from "./modules/multimedia/Workspace/Workspace.js";
|
|
15
|
+
import { default as default16 } from "./modules/multimedia/WorkspaceFolders/WorkspaceFolders.js";
|
|
15
16
|
import { ExternalLinker } from "./modules/multimedia/Linker/ExternalLinker/ExternalLinker.js";
|
|
16
17
|
import { InternalLinker } from "./modules/multimedia/Linker/InternalLinker/InternalLinker.js";
|
|
17
18
|
import { Upload } from "./modules/multimedia/MediaLibrary/innertabs/Upload.js";
|
|
@@ -26,11 +27,12 @@ export {
|
|
|
26
27
|
default7 as MediaLibrary,
|
|
27
28
|
default8 as Nextcloud,
|
|
28
29
|
default9 as NextcloudFileCard,
|
|
30
|
+
default10 as NextcloudFolders,
|
|
29
31
|
Upload,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
default11 as UploadCard,
|
|
33
|
+
default12 as UploadFiles,
|
|
34
|
+
default13 as VideoEmbed,
|
|
35
|
+
default14 as VideoRecorder,
|
|
36
|
+
default15 as Workspace,
|
|
37
|
+
default16 as WorkspaceFolders
|
|
36
38
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.12-develop-integration-crna.20261101211105",
|
|
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.
|
|
144
|
-
"@edifice.io/
|
|
145
|
-
"@edifice.io/
|
|
143
|
+
"@edifice.io/bootstrap": "2.6.12-develop-integration-crna.20261101211105",
|
|
144
|
+
"@edifice.io/tiptap-extensions": "2.6.12-develop-integration-crna.20261101211105",
|
|
145
|
+
"@edifice.io/utilities": "2.6.12-develop-integration-crna.20261101211105"
|
|
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/config": "2.6.12-develop-integration-crna.20261101211105",
|
|
178
|
+
"@edifice.io/client": "2.6.12-develop-integration-crna.20261101211105"
|
|
179
179
|
},
|
|
180
180
|
"peerDependencies": {
|
|
181
181
|
"@react-spring/web": "9.7.5",
|