@edifice.io/react 2.0.0-develop-pedago.20250123120301 → 2.0.0-develop-enabling.20250612155511
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/README.md +3 -3
- package/dist/components/AppIcon/AppIcon.js +1 -1
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Form/FormContext.js +1 -1
- package/dist/components/Form/FormControl.js +1 -1
- package/dist/components/Layout/components/Header.js +5 -4
- package/dist/components/Layout/components/WidgetApps.js +1 -1
- package/dist/{hooks/useHeader → components/Layout/hooks}/useHeader.js +6 -6
- package/dist/components/Layout/hooks/useHelp.js +9 -9
- package/dist/components/Tree/components/SortableTree.js +3 -2
- package/dist/components/Tree/types/index.d.ts +1 -0
- package/dist/components/Tree/utilities/tree.d.ts +2 -1
- package/dist/editor.js +30 -27
- package/dist/hooks/index.d.ts +0 -5
- package/dist/hooks/useCheckable/useCheckable.d.ts +5 -1
- package/dist/hooks/useConf/useConf.d.ts +2 -2
- package/dist/hooks/useDropdown/useDropdown.js +1 -1
- package/dist/hooks/useHasWorkflow/useHasWorkflow.js +3 -11
- package/dist/hooks/useLibraryUrl/useLibraryUrl.d.ts +1 -1
- package/dist/hooks/useLibraryUrl/useLibraryUrl.js +2 -2
- package/dist/hooks/useSession/useSession.d.ts +2 -1
- package/dist/hooks/useUpload/useUpload.js +8 -2
- package/dist/hooks/useUploadFiles/useUploadFiles.js +1 -1
- package/dist/hooks/useWorkspaceSearch/useWorkspaceSearch.js +3 -11
- package/dist/icons-apps.js +220 -218
- package/dist/icons.js +200 -196
- package/dist/index.js +158 -166
- package/dist/modules/audience/ReactionChoice.d.ts +13 -0
- package/dist/modules/audience/ReactionModal.Card.js +4 -4
- package/dist/modules/audience/ReactionModal.d.ts +24 -6
- package/dist/modules/audience/ReactionModal.js +12 -9
- package/dist/modules/audience/ReactionSummary.d.ts +9 -0
- package/dist/modules/audience/ViewsCounter.d.ts +10 -0
- package/dist/modules/audience/ViewsModal.d.ts +13 -1
- package/dist/modules/audience/ViewsModal.js +22 -19
- package/dist/modules/comments/components/CommentAvatar.js +1 -1
- package/dist/modules/comments/hooks/useAutosizeTextarea.d.ts +5 -1
- package/dist/modules/comments/hooks/useComments.d.ts +4 -1
- package/dist/modules/comments/hooks/useProfileQueries.d.ts +4 -1
- package/dist/modules/comments/provider/CommentProvider.js +1 -1
- package/dist/modules/editor/components/Editor/Editor.js +3 -2
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.js +1 -0
- package/dist/modules/editor/components/{Editor → MathsModal}/MathsModal.d.ts +1 -1
- package/dist/modules/editor/components/{Editor → MathsModal}/MathsModal.js +2 -3
- package/dist/modules/editor/components/MathsModal/index.d.ts +1 -0
- package/dist/modules/editor/components/Renderer/AttachmentRenderer.js +1 -0
- package/dist/modules/editor/components/Renderer/AudioRenderer.js +24 -3
- package/dist/modules/editor/components/Renderer/LinkerRenderer.js +1 -1
- package/dist/modules/editor/hooks/useTipTapEditor.js +4 -4
- package/dist/modules/editor/index.d.ts +3 -1
- package/dist/modules/icons/components/IconHandMove.d.ts +7 -0
- package/dist/modules/icons/components/IconHandMove.js +12 -0
- package/dist/modules/icons/components/IconToolCenter.d.ts +7 -0
- package/dist/modules/icons/components/IconToolCenter.js +12 -0
- package/dist/modules/icons/components/apps/IconAppointments.d.ts +7 -0
- package/dist/modules/icons/components/apps/IconAppointments.js +12 -0
- package/dist/modules/icons/components/apps/index.d.ts +1 -0
- package/dist/modules/icons/components/index.d.ts +2 -0
- package/dist/modules/modals/PublishModal/hooks/usePublishModal.d.ts +2 -2
- package/dist/modules/multimedia/AudioRecorder/AudioRecorder.js +5 -1
- package/dist/modules/multimedia/UploadCard/UploadCard.js +2 -2
- package/dist/modules/multimedia/index.d.ts +2 -0
- package/dist/multimedia.js +10 -6
- package/dist/providers/MockedProvider/MockedProvider.d.ts +4 -0
- package/dist/providers/MockedProvider/MockedProvider.js +20 -0
- package/dist/providers/index.d.ts +1 -0
- package/package.json +17 -11
- package/dist/hooks/useAvatar/index.d.ts +0 -1
- package/dist/hooks/useAvatar/useAvatar.d.ts +0 -6
- package/dist/hooks/useAvatar/useAvatar.js +0 -30
- package/dist/hooks/useHeader/index.d.ts +0 -1
- package/dist/hooks/useHeader/useHeader.d.ts +0 -5
- package/dist/providers/MockedDataProvider/MockedDataProvider.d.ts +0 -28
- package/dist/providers/MockedDataProvider/MockedDataProvider.js +0 -9
- package/dist/providers/MockedDataProvider/index.d.ts +0 -1
package/README.md
CHANGED
|
@@ -52,8 +52,8 @@ src
|
|
|
52
52
|
- Export everything if Component has types & interfaces
|
|
53
53
|
|
|
54
54
|
```jsx
|
|
55
|
-
export { default as Component } from
|
|
56
|
-
export * from
|
|
55
|
+
export { default as Component } from './Component';
|
|
56
|
+
export * from './Component';
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
### Component Guideline
|
|
@@ -102,7 +102,7 @@ export interface ButtonProps {
|
|
|
102
102
|
- Import your component inside `index.ts` file.
|
|
103
103
|
|
|
104
104
|
```jsx
|
|
105
|
-
export * from
|
|
105
|
+
export * from './Button';
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
## Dev
|
|
@@ -2,9 +2,9 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import * as iconsApps from "../../icons-apps.js";
|
|
5
|
+
import useEdificeIcons from "../../hooks/useEdificeIcons/useEdificeIcons.js";
|
|
5
6
|
import SvgIconPlaceholder from "../../modules/icons/components/apps/IconPlaceholder.js";
|
|
6
7
|
import Image from "../Image/Image.js";
|
|
7
|
-
import useEdificeIcons from "../../hooks/useEdificeIcons/useEdificeIcons.js";
|
|
8
8
|
const AppIcon = /* @__PURE__ */ forwardRef(({
|
|
9
9
|
app,
|
|
10
10
|
size = "24",
|
|
@@ -24,7 +24,7 @@ const Button = /* @__PURE__ */ forwardRef(({
|
|
|
24
24
|
"btn-lg": size === "lg",
|
|
25
25
|
"btn-sm": size === "sm"
|
|
26
26
|
}, className);
|
|
27
|
-
return /* @__PURE__ */ jsx("button", { ref, className: classes, type, ...restProps, children: isLoading ? /* @__PURE__ */ jsx(Loading, { isLoading: !0, loadingIcon, loadingPosition, children }) : /* @__PURE__ */ jsxs("span", { children: [
|
|
27
|
+
return /* @__PURE__ */ jsx("button", { ref, "data-testid": "button", className: classes, type, ...restProps, children: isLoading ? /* @__PURE__ */ jsx(Loading, { isLoading: !0, loadingIcon, loadingPosition, children }) : /* @__PURE__ */ jsxs("span", { children: [
|
|
28
28
|
leftIcon,
|
|
29
29
|
children,
|
|
30
30
|
rightIcon
|
|
@@ -2,8 +2,8 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef, useMemo } from "react";
|
|
3
3
|
import { Context } from "./FormContext.js";
|
|
4
4
|
import FormText from "./FormText.js";
|
|
5
|
-
import Label from "../Label/Label.js";
|
|
6
5
|
import Input from "../Input/Input.js";
|
|
6
|
+
import Label from "../Label/Label.js";
|
|
7
7
|
const Root = /* @__PURE__ */ forwardRef(({
|
|
8
8
|
children,
|
|
9
9
|
className,
|
|
@@ -4,16 +4,18 @@ import { useTranslation } from "react-i18next";
|
|
|
4
4
|
import { useEdificeClient } from "../../../providers/EdificeClientProvider/EdificeClientProvider.hook.js";
|
|
5
5
|
import { useEdificeTheme } from "../../../providers/EdificeThemeProvider/EdificeThemeProvider.hook.js";
|
|
6
6
|
import SvgIconRafterDown from "../../../modules/icons/components/IconRafterDown.js";
|
|
7
|
-
import SvgIconAssistance from "../../../modules/icons/components/apps/IconAssistance.js";
|
|
8
7
|
import SvgIconCommunity from "../../../modules/icons/components/nav/IconCommunity.js";
|
|
9
8
|
import SvgIconDisconnect from "../../../modules/icons/components/nav/IconDisconnect.js";
|
|
10
9
|
import SvgIconHome from "../../../modules/icons/components/nav/IconHome.js";
|
|
11
10
|
import SvgIconMyApps from "../../../modules/icons/components/nav/IconMyApps.js";
|
|
11
|
+
import SvgIconNeoAssistance from "../../../modules/icons/components/nav/IconNeoAssistance.js";
|
|
12
12
|
import SvgIconNeoMessaging from "../../../modules/icons/components/nav/IconNeoMessaging.js";
|
|
13
13
|
import SvgIconNewRelease from "../../../modules/icons/components/nav/IconNewRelease.js";
|
|
14
|
+
import SvgIconOneAssistance from "../../../modules/icons/components/nav/IconOneAssistance.js";
|
|
14
15
|
import SvgIconOneMessaging from "../../../modules/icons/components/nav/IconOneMessaging.js";
|
|
15
16
|
import SvgIconOneProfile from "../../../modules/icons/components/nav/IconOneProfile.js";
|
|
16
17
|
import SvgIconUserbook from "../../../modules/icons/components/nav/IconUserbook.js";
|
|
18
|
+
import useHeader from "../hooks/useHeader.js";
|
|
17
19
|
import Help from "./Help.js";
|
|
18
20
|
import { Navbar } from "./Navbar.js";
|
|
19
21
|
import { NavBarNav } from "./NavbarNav.js";
|
|
@@ -25,7 +27,6 @@ import useConversation from "../../../hooks/useConversation/useConversation.js";
|
|
|
25
27
|
import useUser from "../../../hooks/useUser/useUser.js";
|
|
26
28
|
import useHasWorkflow from "../../../hooks/useHasWorkflow/useHasWorkflow.js";
|
|
27
29
|
import { useHelp } from "../hooks/useHelp.js";
|
|
28
|
-
import useHeader from "../../../hooks/useHeader/useHeader.js";
|
|
29
30
|
import Avatar from "../../Avatar/Avatar.js";
|
|
30
31
|
import Badge from "../../Badge/Badge.js";
|
|
31
32
|
import VisuallyHidden from "../../VisuallyHidden/VisuallyHidden.js";
|
|
@@ -98,7 +99,7 @@ const Header = ({
|
|
|
98
99
|
/* @__PURE__ */ jsxs("button", { className: "nav-link", onClick: () => {
|
|
99
100
|
setIsHelpOpen(!0);
|
|
100
101
|
}, children: [
|
|
101
|
-
/* @__PURE__ */ jsx(
|
|
102
|
+
/* @__PURE__ */ jsx(SvgIconOneAssistance, { className: "icon help" }),
|
|
102
103
|
/* @__PURE__ */ jsx(VisuallyHidden, { children: t("navbar.help") })
|
|
103
104
|
] }),
|
|
104
105
|
/* @__PURE__ */ jsx(Help, { isHelpOpen, setIsHelpOpen, parsedContent, parsedHeadline, error })
|
|
@@ -157,7 +158,7 @@ const Header = ({
|
|
|
157
158
|
/* @__PURE__ */ jsxs("button", { className: "nav-link btn btn-naked", onClick: () => {
|
|
158
159
|
setIsHelpOpen(!0);
|
|
159
160
|
}, children: [
|
|
160
|
-
/* @__PURE__ */ jsx(
|
|
161
|
+
/* @__PURE__ */ jsx(SvgIconNeoAssistance, { color: "#fff" }),
|
|
161
162
|
/* @__PURE__ */ jsx(VisuallyHidden, { children: t("support") })
|
|
162
163
|
] }),
|
|
163
164
|
/* @__PURE__ */ jsx(Help, { isHelpOpen, setIsHelpOpen, parsedContent, parsedHeadline, error })
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useState, useId, useCallback, useMemo } from "react";
|
|
2
2
|
import { odeServices } from "@edifice.io/client";
|
|
3
|
+
import { useHover } from "@uidotdev/usehooks";
|
|
3
4
|
import { useTranslation } from "react-i18next";
|
|
4
|
-
import { useEdificeClient } from "
|
|
5
|
-
import { useEdificeTheme } from "
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import useHasWorkflow from "../useHasWorkflow/useHasWorkflow.js";
|
|
5
|
+
import { useEdificeClient } from "../../../providers/EdificeClientProvider/EdificeClientProvider.hook.js";
|
|
6
|
+
import { useEdificeTheme } from "../../../providers/EdificeThemeProvider/EdificeThemeProvider.hook.js";
|
|
7
|
+
import useBookmark from "../../../hooks/useBookmark/useBookmark.js";
|
|
8
|
+
import useHasWorkflow from "../../../hooks/useHasWorkflow/useHasWorkflow.js";
|
|
9
9
|
function useHeader({
|
|
10
10
|
user,
|
|
11
11
|
avatar
|
|
@@ -39,7 +39,7 @@ function useHeader({
|
|
|
39
39
|
isCollapsed,
|
|
40
40
|
toggleCollapsedNav,
|
|
41
41
|
handleLogout
|
|
42
|
-
}), [appsRef, bookmarkedApps, communityWorkflow, conversationWorflow, isAppsHovered, isCollapsed, popoverAppsId, popoverSearchId, searchWorkflow, title, toggleCollapsedNav, userAvatar, userName, welcomeUser]);
|
|
42
|
+
}), [appsRef, bookmarkedApps, communityWorkflow, conversationWorflow, handleLogout, isAppsHovered, isCollapsed, popoverAppsId, popoverSearchId, searchWorkflow, title, toggleCollapsedNav, userAvatar, userName, welcomeUser]);
|
|
43
43
|
}
|
|
44
44
|
export {
|
|
45
45
|
useHeader as default
|
|
@@ -11,7 +11,7 @@ function useHelp() {
|
|
|
11
11
|
appCode
|
|
12
12
|
} = useEdificeClient(), {
|
|
13
13
|
theme
|
|
14
|
-
} = useEdificeTheme(), [html, setHtml] = useState(""), [visibility, setVisibility] = useState(!0), [isModalOpen, setIsModalOpen] = useState(!1), [error, setError] = useState(!1), helpPath = theme != null && theme.is1d ? "/help-1d" : "/help-2d";
|
|
14
|
+
} = useEdificeTheme(), [html, setHtml] = useState(""), [visibility, setVisibility] = useState(!0), [activeSection, setActiveSection] = useState("présentation"), [isModalOpen, setIsModalOpen] = useState(!1), [error, setError] = useState(!1), helpPath = theme != null && theme.is1d ? "/help-1d" : "/help-2d";
|
|
15
15
|
useEffect(() => {
|
|
16
16
|
(async () => {
|
|
17
17
|
let helpURL = "";
|
|
@@ -30,7 +30,7 @@ function useHelp() {
|
|
|
30
30
|
}, [appCode, helpPath]);
|
|
31
31
|
const parsedHTML = parse(html, {
|
|
32
32
|
replace: (domNode) => {
|
|
33
|
-
const typedDomNode = domNode;
|
|
33
|
+
const typedDomNode = domNode, isActive = typedDomNode.attribs.id === activeSection;
|
|
34
34
|
if (typedDomNode.attribs && typedDomNode.attribs.id === "TOC")
|
|
35
35
|
return /* @__PURE__ */ jsxs("nav", { id: "TOC", children: [
|
|
36
36
|
/* @__PURE__ */ jsx(Button, { onClick: () => {
|
|
@@ -45,10 +45,12 @@ function useHelp() {
|
|
|
45
45
|
}, children: domToReact(typedDomNode2.children, {
|
|
46
46
|
replace: (domNode3) => {
|
|
47
47
|
const typedDomNode3 = domNode3;
|
|
48
|
-
if (typedDomNode3.attribs && typedDomNode3.name === "a")
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
if (typedDomNode3.attribs && typedDomNode3.name === "a") {
|
|
49
|
+
const sectionId = typedDomNode3.attribs.href.replace("#", "");
|
|
50
|
+
return /* @__PURE__ */ jsx("span", { onClick: (e) => {
|
|
51
|
+
e.preventDefault(), setActiveSection(sectionId), setVisibility(!1);
|
|
52
|
+
}, children: domToReact(typedDomNode3.children) });
|
|
53
|
+
}
|
|
52
54
|
}
|
|
53
55
|
}) });
|
|
54
56
|
}
|
|
@@ -56,9 +58,7 @@ function useHelp() {
|
|
|
56
58
|
] });
|
|
57
59
|
if (typedDomNode.attribs && typedDomNode.attribs.class === "section level2") {
|
|
58
60
|
const props = attributesToProps(domNode.attribs);
|
|
59
|
-
return /* @__PURE__ */ jsx("div", { ...props, className: "section level2",
|
|
60
|
-
display: typedDomNode.attribs.id !== "présentation" ? "none" : "block"
|
|
61
|
-
}, children: domToReact(typedDomNode.children, {
|
|
61
|
+
return /* @__PURE__ */ jsx("div", { ...props, className: "section level2", hidden: !isActive, children: domToReact(typedDomNode.children, {
|
|
62
62
|
replace: (domNode2) => {
|
|
63
63
|
const typedDomNode2 = domNode2;
|
|
64
64
|
if (typedDomNode2.attribs && typedDomNode2.name === "img") {
|
|
@@ -11,6 +11,7 @@ import SvgIconRafterRight from "../../../modules/icons/components/IconRafterRigh
|
|
|
11
11
|
import { useTree } from "../hooks/useTree.js";
|
|
12
12
|
import { useTreeSortable } from "../hooks/useTreeSortable.js";
|
|
13
13
|
import { flattenNodes } from "../utilities/tree-sortable.js";
|
|
14
|
+
import { mergeRefs } from "../../../utilities/refs/ref.js";
|
|
14
15
|
const SortableTree = ({
|
|
15
16
|
nodes,
|
|
16
17
|
selectedNodeId: externalSelectedNodeId,
|
|
@@ -73,7 +74,7 @@ const SortableTree = ({
|
|
|
73
74
|
renderNode,
|
|
74
75
|
onTreeItemClick,
|
|
75
76
|
onToggleNode
|
|
76
|
-
}) => {
|
|
77
|
+
}, ref) => {
|
|
77
78
|
const {
|
|
78
79
|
t
|
|
79
80
|
} = useTranslation(), selected = selectedNodeId === node.id, expanded = expandedNodes.has(node.id), animateLayoutChanges = ({
|
|
@@ -108,7 +109,7 @@ const SortableTree = ({
|
|
|
108
109
|
}, handleItemToggleKeyDown = (event) => {
|
|
109
110
|
(event.code === "Enter" || event.code === "Space") && (event.preventDefault(), event.stopPropagation(), onToggleNode == null || onToggleNode(node.id));
|
|
110
111
|
}, spaceGestion = () => isDragging ? isChild ? depth === 1 ? `${indentationWidth * depth}px` : "0px" : `${indentationWidth * depth}px` : isChild ? "20px" : null;
|
|
111
|
-
return /* @__PURE__ */ jsx("li", { ref: setNodeRef, id: `treeitem-${node.id}`, role: "treeitem", "aria-selected": selected, "aria-expanded": expanded, style: {
|
|
112
|
+
return /* @__PURE__ */ jsx("li", { ref: mergeRefs(setNodeRef, ref), id: `treeitem-${node.id}`, role: "treeitem", "aria-selected": selected, "aria-expanded": expanded, style: {
|
|
112
113
|
...style,
|
|
113
114
|
marginLeft: spaceGestion()
|
|
114
115
|
}, ...listeners, children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("div", { className: treeItemClasses.action, children: [
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IFolder } from '@edifice.io/client';
|
|
2
2
|
import { TreeItem } from '../types';
|
|
3
3
|
export declare function findNodeById(data: TreeItem | TreeItem[], id: string): TreeItem | undefined;
|
|
4
|
+
export declare function getChildrenIds(data: TreeItem[], folderId: string): string[];
|
|
4
5
|
export declare function addNode(node: TreeItem, { parentId, newFolder }: {
|
|
5
6
|
parentId: string;
|
|
6
7
|
newFolder: IFolder;
|
|
@@ -10,7 +11,7 @@ export declare function deleteNode(node: TreeItem, { folders }: {
|
|
|
10
11
|
folders: string[];
|
|
11
12
|
}): TreeItem;
|
|
12
13
|
export declare const findParentNode: (parentNode: TreeItem, childId: string) => TreeItem | undefined;
|
|
13
|
-
export declare function getAncestors(data: TreeItem, folderId: string): string[];
|
|
14
|
+
export declare function getAncestors(data: TreeItem[], folderId: string): string[];
|
|
14
15
|
export declare function hasChildren(folderId: string, data: TreeItem): boolean;
|
|
15
16
|
export declare function modifyNode(data: TreeItem, callback: (node: TreeItem, parent?: TreeItem) => TreeItem | undefined): TreeItem;
|
|
16
17
|
export declare function moveNode(node: TreeItem, { destinationId, folders }: {
|
package/dist/editor.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { EditorContent, useEditor } from "@tiptap/react";
|
|
2
|
-
import { default as default2 } from "
|
|
3
|
-
import { default as default3 } from "./modules/editor/components/
|
|
4
|
-
import { default as default4 } from "./modules/editor/components/
|
|
5
|
-
import { default as default5 } from "./modules/editor/components/NodeView/
|
|
6
|
-
import { default as default6 } from "./modules/editor/components/NodeView/
|
|
7
|
-
import { default as default7 } from "./modules/editor/components/NodeView/
|
|
8
|
-
import { default as default8 } from "./modules/editor/components/NodeView/
|
|
9
|
-
import { default as default9 } from "./modules/editor/components/
|
|
10
|
-
import { default as default10 } from "./modules/editor/components/Renderer/
|
|
11
|
-
import { default as default11 } from "./modules/editor/components/Renderer/
|
|
12
|
-
import { default as default12 } from "./modules/editor/components/Renderer/
|
|
13
|
-
import { default as default13 } from "./modules/editor/components/
|
|
14
|
-
import { default as default14 } from "./modules/editor/components/Toolbar/
|
|
1
|
+
import { EditorContent, Editor, useEditor } from "@tiptap/react";
|
|
2
|
+
import { default as default2 } from "@tiptap/starter-kit";
|
|
3
|
+
import { default as default3 } from "./modules/editor/components/Editor/Editor.js";
|
|
4
|
+
import { default as default4 } from "./modules/editor/components/BubbleMenuEditImage/BubbleMenuEditImage.js";
|
|
5
|
+
import { default as default5 } from "./modules/editor/components/NodeView/AudioNodeView.js";
|
|
6
|
+
import { default as default6 } from "./modules/editor/components/NodeView/AttachmentNodeView.js";
|
|
7
|
+
import { default as default7 } from "./modules/editor/components/NodeView/ImageNodeView.js";
|
|
8
|
+
import { default as default8 } from "./modules/editor/components/NodeView/LinkerNodeView.js";
|
|
9
|
+
import { default as default9 } from "./modules/editor/components/NodeView/VideoNodeView.js";
|
|
10
|
+
import { default as default10 } from "./modules/editor/components/Renderer/AudioRenderer.js";
|
|
11
|
+
import { default as default11 } from "./modules/editor/components/Renderer/AttachmentRenderer.js";
|
|
12
|
+
import { default as default12 } from "./modules/editor/components/Renderer/LinkerRenderer.js";
|
|
13
|
+
import { default as default13 } from "./modules/editor/components/Renderer/MediaRenderer.js";
|
|
14
|
+
import { default as default14 } from "./modules/editor/components/Toolbar/TableToolbar.js";
|
|
15
|
+
import { default as default15 } from "./modules/editor/components/Toolbar/LinkToolbar.js";
|
|
15
16
|
import { EditorToolbar } from "./modules/editor/components/EditorToolbar/EditorToolbar.js";
|
|
16
17
|
import { useActionOptions } from "./modules/editor/hooks/useActionOptions.js";
|
|
17
18
|
import { useCommentEditor } from "./modules/editor/hooks/useCommentEditor.js";
|
|
@@ -26,22 +27,24 @@ import { useSpeechRecognition } from "./modules/editor/hooks/useSpeechRecognitio
|
|
|
26
27
|
import { useSpeechSynthetisis } from "./modules/editor/hooks/useSpeechSynthetisis.js";
|
|
27
28
|
import { useTipTapEditor } from "./modules/editor/hooks/useTipTapEditor.js";
|
|
28
29
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
default6 as AttachmentNodeView,
|
|
31
|
+
default11 as AttachmentRenderer,
|
|
32
|
+
default5 as AudioNodeView,
|
|
33
|
+
default10 as AudioRenderer,
|
|
34
|
+
default4 as BubbleMenuEditImage,
|
|
35
|
+
default3 as Editor,
|
|
35
36
|
EditorContent,
|
|
36
37
|
EditorContext,
|
|
38
|
+
Editor as EditorInstance,
|
|
37
39
|
EditorToolbar,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
default7 as ImageNodeView,
|
|
41
|
+
default15 as LinkToolbar,
|
|
42
|
+
default8 as LinkerNodeView,
|
|
43
|
+
default12 as LinkerRenderer,
|
|
44
|
+
default13 as MediaRenderer,
|
|
45
|
+
default2 as StarterKit,
|
|
46
|
+
default14 as TableToolbar,
|
|
47
|
+
default9 as VideoNodeView,
|
|
45
48
|
useActionOptions,
|
|
46
49
|
useCommentEditor,
|
|
47
50
|
useEditor,
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
export * from './useAvatar';
|
|
2
1
|
export * from './useBookmark';
|
|
3
2
|
export * from './useBreakpoint';
|
|
4
3
|
export * from './useBrowserInfo';
|
|
5
4
|
export * from './useCantoo';
|
|
6
5
|
export * from './useCheckable';
|
|
7
6
|
export * from './useClickOutside';
|
|
8
|
-
export * from './useConf';
|
|
9
7
|
export * from './useConversation';
|
|
10
8
|
export * from './useDate';
|
|
11
9
|
export * from './useDebounce';
|
|
@@ -14,7 +12,6 @@ export * from './useDropdown';
|
|
|
14
12
|
export * from './useDropzone';
|
|
15
13
|
export * from './useEdificeIcons';
|
|
16
14
|
export * from './useHasWorkflow';
|
|
17
|
-
export * from './useHeader';
|
|
18
15
|
export * from './useHover';
|
|
19
16
|
export * from './useHttpErrorToast';
|
|
20
17
|
export * from './useImage';
|
|
@@ -22,9 +19,7 @@ export * from './useIsAdml';
|
|
|
22
19
|
export * from './useKeyPress';
|
|
23
20
|
export * from './useLibraryUrl';
|
|
24
21
|
export * from './useMediaLibrary';
|
|
25
|
-
export * from './useResourceSearch';
|
|
26
22
|
export * from './useScrollToTop';
|
|
27
|
-
export * from './useSession';
|
|
28
23
|
export * from './useTitle';
|
|
29
24
|
export * from './useToast';
|
|
30
25
|
export * from './useToggle';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { App } from '@edifice.io/client';
|
|
1
|
+
import { App, IGetConf } from '@edifice.io/client';
|
|
2
2
|
export default function useConf({ appCode }: {
|
|
3
3
|
appCode: App;
|
|
4
|
-
}):
|
|
4
|
+
}): import('../../../node_modules/@tanstack/react-query').UseQueryResult<IGetConf, Error>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useId, useState, useRef, useEffect, useCallback } from "react";
|
|
2
|
-
import { useFloating,
|
|
2
|
+
import { useFloating, offset, size, flip, autoUpdate, useHover, safePolygon } from "@floating-ui/react";
|
|
3
3
|
import { mergeRefs } from "../../utilities/refs/ref.js";
|
|
4
4
|
const useDropdown = (placement, extraTriggerKeyDownHandler, isTriggerHovered = !1) => {
|
|
5
5
|
const id = useId(), [visible, setVisible] = useState(!1), [activeIndex, setActiveIndex] = useState(-1), [isFocused, setIsFocused] = useState(null), {
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
import { useState, useEffect } from "react";
|
|
2
2
|
import { odeServices } from "@edifice.io/client";
|
|
3
|
-
import { useMockedData } from "../../providers/MockedDataProvider/MockedDataProvider.js";
|
|
4
3
|
function useHasWorkflow(workflow) {
|
|
5
|
-
const
|
|
4
|
+
const [state, setState] = useState();
|
|
6
5
|
return useEffect(() => {
|
|
7
6
|
(async () => {
|
|
8
7
|
let response;
|
|
9
|
-
|
|
10
|
-
if (typeof workflow == "string")
|
|
11
|
-
response = await mock.hasWorkflow(workflow);
|
|
12
|
-
else
|
|
13
|
-
throw "not.implemented.yet)";
|
|
14
|
-
else
|
|
15
|
-
typeof workflow == "string" ? response = await odeServices.rights().sessionHasWorkflowRight(workflow) : response = await odeServices.rights().sessionHasWorkflowRights(workflow);
|
|
16
|
-
setState(response);
|
|
8
|
+
typeof workflow == "string" ? response = await odeServices.rights().sessionHasWorkflowRight(workflow) : response = await odeServices.rights().sessionHasWorkflowRights(workflow), setState(response);
|
|
17
9
|
})();
|
|
18
|
-
}, [workflow
|
|
10
|
+
}, [workflow]), state;
|
|
19
11
|
}
|
|
20
12
|
export {
|
|
21
13
|
useHasWorkflow as default
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { libraryMaps } from "@edifice.io/utilities";
|
|
2
2
|
import { useEdificeClient } from "../../providers/EdificeClientProvider/EdificeClientProvider.hook.js";
|
|
3
|
-
const useLibraryUrl = () => {
|
|
3
|
+
const useLibraryUrl = (appCodeName) => {
|
|
4
4
|
var _a;
|
|
5
5
|
const {
|
|
6
6
|
user,
|
|
7
7
|
appCode
|
|
8
|
-
} = useEdificeClient(), appName = libraryMaps[appCode], libraryApp = user == null ? void 0 : user.apps.find((app) => app.isExternal && app.address.includes("library"));
|
|
8
|
+
} = useEdificeClient(), appName = libraryMaps[appCodeName ?? appCode], libraryApp = user == null ? void 0 : user.apps.find((app) => app.isExternal && app.address.includes("library"));
|
|
9
9
|
if (!libraryApp)
|
|
10
10
|
return null;
|
|
11
11
|
const libraryUrlSplit = (_a = libraryApp.address) == null ? void 0 : _a.split("?");
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { IGetSession } from '@edifice.io/client';
|
|
2
|
+
export default function useSession(): import('../../../node_modules/@tanstack/react-query').UseQueryResult<IGetSession, Error>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useState, useCallback } from "react";
|
|
2
2
|
import { ERROR_CODE, odeServices } from "@edifice.io/client";
|
|
3
3
|
import { getOrGenerateBlobId } from "@edifice.io/utilities";
|
|
4
|
+
import { useTranslation } from "react-i18next";
|
|
4
5
|
import useBrowserInfo from "../useBrowserInfo/useBrowserInfo.js";
|
|
5
6
|
import useWorkspaceFile from "../useWorkspaceFile/useWorkspaceFile.js";
|
|
6
7
|
const useUpload = (visibility, application = "media-library") => {
|
|
@@ -9,7 +10,9 @@ const useUpload = (visibility, application = "media-library") => {
|
|
|
9
10
|
device
|
|
10
11
|
} = useBrowserInfo(navigator.userAgent), {
|
|
11
12
|
create
|
|
12
|
-
} = useWorkspaceFile(),
|
|
13
|
+
} = useWorkspaceFile(), {
|
|
14
|
+
t
|
|
15
|
+
} = useTranslation(), getUploadStatus = useCallback((upload) => status[getOrGenerateBlobId(upload)], [status]), setUploadStatus = (blob, status2) => {
|
|
13
16
|
setStatus((prevStatus) => {
|
|
14
17
|
const key = getOrGenerateBlobId(blob);
|
|
15
18
|
return {
|
|
@@ -25,6 +28,9 @@ const useUpload = (visibility, application = "media-library") => {
|
|
|
25
28
|
} = prevStatus;
|
|
26
29
|
return rest;
|
|
27
30
|
});
|
|
31
|
+
}, getDefaultDate = () => {
|
|
32
|
+
const d = /* @__PURE__ */ new Date();
|
|
33
|
+
return `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")} ${String(d.getHours()).padStart(2, "0")}h${String(d.getMinutes()).padStart(2, "0")} ` + t("bbm.video.recorder.defaultName");
|
|
28
34
|
};
|
|
29
35
|
async function uploadFile(file, metadata) {
|
|
30
36
|
setUploadStatus(file, "loading");
|
|
@@ -64,7 +70,7 @@ const useUpload = (visibility, application = "media-library") => {
|
|
|
64
70
|
},
|
|
65
71
|
url: window.location.hostname,
|
|
66
72
|
file: blob,
|
|
67
|
-
filename: (
|
|
73
|
+
filename: getDefaultDate() ?? "filename",
|
|
68
74
|
weight: blob.size
|
|
69
75
|
},
|
|
70
76
|
appCode: application,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useState, useCallback, useEffect } from "react";
|
|
2
2
|
import { ImageResizer, addTimestampToImageUrl } from "@edifice.io/utilities";
|
|
3
3
|
import { useDropzoneContext } from "../../components/Dropzone/DropzoneContext.js";
|
|
4
|
-
import useUpload from "../useUpload/useUpload.js";
|
|
5
4
|
import useWorkspaceFile from "../useWorkspaceFile/useWorkspaceFile.js";
|
|
5
|
+
import useUpload from "../useUpload/useUpload.js";
|
|
6
6
|
const useUploadFiles = ({
|
|
7
7
|
handleOnChange,
|
|
8
8
|
visibility,
|
|
@@ -2,9 +2,8 @@ import { useReducer, useCallback } from "react";
|
|
|
2
2
|
import { odeServices, DocumentHelper } from "@edifice.io/client";
|
|
3
3
|
import { findNodeById } from "../../components/TreeView/utilities/treeview.js";
|
|
4
4
|
import useHasWorkflow from "../useHasWorkflow/useHasWorkflow.js";
|
|
5
|
-
import { useMockedData } from "../../providers/MockedDataProvider/MockedDataProvider.js";
|
|
6
5
|
function useWorkspaceSearch(rootId, rootName, filter, format) {
|
|
7
|
-
const
|
|
6
|
+
const canListDocs = useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|listDocuments"), canListFolders = useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|listFolders");
|
|
8
7
|
function treeReducer(state, action) {
|
|
9
8
|
switch (action.type) {
|
|
10
9
|
case "update": {
|
|
@@ -25,15 +24,8 @@ function useWorkspaceSearch(rootId, rootName, filter, format) {
|
|
|
25
24
|
name: rootName,
|
|
26
25
|
section: !0
|
|
27
26
|
}), loadContent = useCallback(async (folderId) => {
|
|
28
|
-
var _a;
|
|
29
27
|
if (canListDocs && canListFolders) {
|
|
30
|
-
const realWorkspaceId = folderId === rootId ? "" : folderId, payload =
|
|
31
|
-
const ret = {
|
|
32
|
-
...result,
|
|
33
|
-
_id: "" + Math.round(Math.random() * 9999)
|
|
34
|
-
};
|
|
35
|
-
return ret.name = result.eType == "folder" ? "folder id=" + ret._id : "file id=" + ret._id, ret;
|
|
36
|
-
}))) : await odeServices.workspace().listDocuments(filter, realWorkspaceId), subfolders = [], files = [];
|
|
28
|
+
const realWorkspaceId = folderId === rootId ? "" : folderId, payload = await odeServices.workspace().listDocuments(filter, realWorkspaceId), subfolders = [], files = [];
|
|
37
29
|
payload.filter((f) => {
|
|
38
30
|
if (!format || f.eType === "folder") return !0;
|
|
39
31
|
const role = DocumentHelper.getRole(f);
|
|
@@ -47,7 +39,7 @@ function useWorkspaceSearch(rootId, rootName, filter, format) {
|
|
|
47
39
|
type: "update"
|
|
48
40
|
});
|
|
49
41
|
}
|
|
50
|
-
}, [canListDocs, canListFolders, rootId,
|
|
42
|
+
}, [canListDocs, canListFolders, rootId, filter, format]);
|
|
51
43
|
return {
|
|
52
44
|
root,
|
|
53
45
|
loadContent
|