@edifice.io/react 2.6.12-develop.20261105102534 → 2.6.12-develop.20261105225136
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 +19 -14
- package/dist/components/Dropdown/DropdownContext.d.ts +8 -0
- package/dist/components/Dropdown/DropdownMenuGroup.js +24 -6
- package/dist/components/Dropdown/DropdownSearchInput.js +16 -8
- package/dist/components/Dropdown/DropdownTrigger.js +24 -8
- package/dist/components/Dropdown/useDropdownItemFilter.js +5 -7
- package/dist/components/Dropdown/useMatchRegistry.d.ts +5 -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/homepage.js +28 -24
- package/dist/hooks/useDropdown/useDropdown.d.ts +1 -0
- package/dist/hooks/useDropdown/useDropdown.js +25 -7
- package/dist/hooks/useNextcloudSearch/useNextcloudSearch.d.ts +1 -1
- package/dist/hooks/useNextcloudSearch/useNextcloudSearch.js +2 -2
- package/dist/icons-apps.js +256 -254
- package/dist/index.js +158 -156
- package/dist/modules/homepage/components/AlloRegion/AlloRegion.d.ts +11 -0
- package/dist/modules/homepage/components/AlloRegion/AlloRegion.js +32 -0
- package/dist/modules/homepage/components/AlloRegion/AlloRegionContainer.d.ts +4 -0
- package/dist/modules/homepage/components/AlloRegion/AlloRegionContainer.js +10 -0
- package/dist/modules/homepage/components/AlloRegion/index.d.ts +3 -0
- package/dist/modules/homepage/components/Favorites/Favorites.js +1 -4
- package/dist/modules/homepage/components/index.d.ts +1 -0
- package/dist/modules/icons/components/apps/IconAlloregion.d.ts +7 -0
- package/dist/modules/icons/components/apps/IconAlloregion.js +17 -0
- package/dist/modules/icons/components/apps/index.d.ts +1 -0
- 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 +52 -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
|
@@ -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 = async (path) => {
|
|
39
|
+
await 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,52 @@
|
|
|
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 || folderName === "." || folderName === ".." || !user)
|
|
34
|
+
return;
|
|
35
|
+
const path = `${parentPath.replace(/\/?$/, "/")}${folderName}/`;
|
|
36
|
+
createFolderMutation.mutate({
|
|
37
|
+
userId: user.userId,
|
|
38
|
+
path
|
|
39
|
+
}, {
|
|
40
|
+
onSuccess: () => {
|
|
41
|
+
onFolderCreated(path), onClose();
|
|
42
|
+
},
|
|
43
|
+
onError: () => toast.error(t("e400"))
|
|
44
|
+
});
|
|
45
|
+
}, children: /* @__PURE__ */ jsxs("div", { className: "d-flex gap-4 flex-row", children: [
|
|
46
|
+
/* @__PURE__ */ jsx(FormControl, { id: "modalNextcloudNewFolderForm", isRequired: !0, children: /* @__PURE__ */ jsx(FormControl.Input, { ref: refInputName, size: "md", type: "text", placeholder: t("workspace.folder.new.placeholder"), "aria-label": t("workspace.folder.new.placeholder") }) }),
|
|
47
|
+
/* @__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, {}) })
|
|
48
|
+
] }) });
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
NewFolderForm as default
|
|
52
|
+
};
|
|
@@ -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.12-develop.
|
|
3
|
+
"version": "2.6.12-develop.20261105225136",
|
|
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/tiptap-extensions": "2.6.12-develop.
|
|
145
|
-
"@edifice.io/utilities": "2.6.12-develop.
|
|
143
|
+
"@edifice.io/bootstrap": "2.6.12-develop.20261105225136",
|
|
144
|
+
"@edifice.io/tiptap-extensions": "2.6.12-develop.20261105225136",
|
|
145
|
+
"@edifice.io/utilities": "2.6.12-develop.20261105225136"
|
|
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/config": "2.6.12-develop.
|
|
178
|
-
"@edifice.io/client": "2.6.12-develop.
|
|
177
|
+
"@edifice.io/config": "2.6.12-develop.20261105225136",
|
|
178
|
+
"@edifice.io/client": "2.6.12-develop.20261105225136"
|
|
179
179
|
},
|
|
180
180
|
"peerDependencies": {
|
|
181
181
|
"@react-spring/web": "9.7.5",
|