@edifice.io/react 2.1.1-develop-integration.20250218194811 → 2.1.1-develop-b2school.20250304103025
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/DropdownTrigger.js +5 -1
- package/dist/components/List/List.d.ts +9 -1
- package/dist/components/List/List.js +9 -9
- package/dist/components/SearchBar/SearchBar.d.ts +1 -1
- package/dist/components/SearchBar/SearchBar.js +3 -1
- package/dist/editor.js +24 -24
- package/dist/hooks/useCheckable/useCheckable.d.ts +5 -1
- package/dist/hooks/useCheckable/useCheckable.js +1 -1
- package/dist/hooks/useConversation/useConversation.d.ts +1 -1
- package/dist/hooks/useConversation/useConversation.js +13 -17
- package/dist/icons.js +196 -192
- package/dist/modules/comments/hooks/useAutosizeTextarea.d.ts +5 -1
- package/dist/modules/editor/components/Editor/Editor.d.ts +3 -1
- package/dist/modules/editor/components/Editor/Editor.js +7 -8
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.d.ts +1 -4
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.js +4 -19
- package/dist/modules/editor/components/NodeView/ConversationHistoryNodeView.d.ts +2 -0
- package/dist/modules/editor/components/NodeView/ConversationHistoryNodeView.js +10 -0
- package/dist/modules/editor/components/NodeView/index.d.ts +2 -1
- package/dist/modules/editor/components/Renderer/ConversationHistoryRenderer.d.ts +8 -0
- package/dist/modules/editor/components/Renderer/ConversationHistoryRenderer.js +28 -0
- package/dist/modules/editor/components/Renderer/index.d.ts +2 -1
- package/dist/modules/editor/hooks/index.d.ts +0 -2
- package/dist/modules/editor/hooks/useTipTapEditor.d.ts +6 -2
- package/dist/modules/editor/hooks/useTipTapEditor.js +2 -2
- package/dist/modules/icons/components/IconFolderAdd.d.ts +7 -0
- package/dist/modules/icons/components/IconFolderAdd.js +13 -0
- package/dist/modules/icons/components/IconGroupAvatar.d.ts +7 -0
- package/dist/modules/icons/components/IconGroupAvatar.js +12 -0
- package/dist/modules/icons/components/IconReadMail.d.ts +7 -0
- package/dist/modules/icons/components/IconReadMail.js +16 -0
- package/dist/modules/icons/components/IconUndoAll.d.ts +7 -0
- package/dist/modules/icons/components/IconUndoAll.js +14 -0
- package/dist/modules/icons/components/IconUnreadMail.d.ts +7 -0
- package/dist/modules/icons/components/IconUnreadMail.js +16 -0
- package/dist/modules/icons/components/index.d.ts +5 -3
- package/package.json +6 -6
- package/dist/modules/editor/components/Editor/CantooAdaptTextBoxView.d.ts +0 -2
- package/dist/modules/editor/components/Editor/CantooAdaptTextBoxView.js +0 -13
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Cantoo.d.ts +0 -9
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Cantoo.js +0 -55
- package/dist/modules/editor/hooks/useCantooAdaptTextBox.d.ts +0 -14
- package/dist/modules/editor/hooks/useCantooAdaptTextBox.js +0 -14
- package/dist/modules/editor/hooks/useCantooEditor.d.ts +0 -8
- package/dist/modules/editor/hooks/useCantooEditor.js +0 -48
- package/dist/modules/icons/components/IconCantoo.d.ts +0 -7
- package/dist/modules/icons/components/IconCantoo.js +0 -23
- package/dist/modules/icons/components/IconMicOff.d.ts +0 -7
- package/dist/modules/icons/components/IconMicOff.js +0 -12
- package/dist/modules/icons/components/IconTextToSpeechOff.d.ts +0 -7
- package/dist/modules/icons/components/IconTextToSpeechOff.js +0 -12
|
@@ -3,6 +3,7 @@ import { forwardRef } from "react";
|
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import SvgIconRafterUp from "../../modules/icons/components/IconRafterUp.js";
|
|
5
5
|
import { useDropdownContext } from "./DropdownContext.js";
|
|
6
|
+
import Badge from "../Badge/Badge.js";
|
|
6
7
|
const DropdownTrigger = /* @__PURE__ */ forwardRef(({
|
|
7
8
|
label,
|
|
8
9
|
icon,
|
|
@@ -26,7 +27,10 @@ const DropdownTrigger = /* @__PURE__ */ forwardRef(({
|
|
|
26
27
|
return /* @__PURE__ */ jsxs("button", { ref: forwardRef2, type: "button", disabled, ...mergedProps, children: [
|
|
27
28
|
icon,
|
|
28
29
|
label,
|
|
29
|
-
badgeContent ? /* @__PURE__ */ jsx(
|
|
30
|
+
badgeContent ? /* @__PURE__ */ jsx(Badge, { variant: {
|
|
31
|
+
level: "info",
|
|
32
|
+
type: "notification"
|
|
33
|
+
}, children: badgeContent }) : !hideCarret && /* @__PURE__ */ jsx(SvgIconRafterUp, { width: 16, height: 16, className: "dropdown-toggle-caret" })
|
|
30
34
|
] });
|
|
31
35
|
});
|
|
32
36
|
export {
|
|
@@ -5,6 +5,10 @@ export type ListProps<T> = {
|
|
|
5
5
|
* Toolbar data items
|
|
6
6
|
*/
|
|
7
7
|
items?: ToolbarItem[];
|
|
8
|
+
/**
|
|
9
|
+
* Checkable list
|
|
10
|
+
*/
|
|
11
|
+
isCheckable?: boolean;
|
|
8
12
|
/**
|
|
9
13
|
* Generic data
|
|
10
14
|
*/
|
|
@@ -17,7 +21,11 @@ export type ListProps<T> = {
|
|
|
17
21
|
* Callback to get selected ids
|
|
18
22
|
*/
|
|
19
23
|
onSelectedItems?: (selectedIds: string[]) => void;
|
|
24
|
+
/**
|
|
25
|
+
* Custom class name
|
|
26
|
+
*/
|
|
27
|
+
className?: string;
|
|
20
28
|
};
|
|
21
29
|
export declare const List: <T extends {
|
|
22
30
|
_id: string;
|
|
23
|
-
}>({ items, data, renderNode, onSelectedItems, }: ListProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
}>({ items, isCheckable, data, renderNode, onSelectedItems, className, }: ListProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,9 +7,11 @@ import Checkbox from "../Checkbox/Checkbox.js";
|
|
|
7
7
|
import { Toolbar } from "../Toolbar/Toolbar.js";
|
|
8
8
|
const List = ({
|
|
9
9
|
items,
|
|
10
|
+
isCheckable = !1,
|
|
10
11
|
data,
|
|
11
12
|
renderNode,
|
|
12
|
-
onSelectedItems
|
|
13
|
+
onSelectedItems,
|
|
14
|
+
className
|
|
13
15
|
}) => {
|
|
14
16
|
const {
|
|
15
17
|
selectedItems,
|
|
@@ -21,11 +23,9 @@ const List = ({
|
|
|
21
23
|
return useEffect(() => {
|
|
22
24
|
selectedItems && (onSelectedItems == null || onSelectedItems(selectedItems));
|
|
23
25
|
}, [onSelectedItems, selectedItems]), /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24
|
-
items && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25
|
-
/* @__PURE__ */ jsx("div", { className: clsx("d-flex align-items-center gap-8", {
|
|
26
|
-
"
|
|
27
|
-
}), children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
28
|
-
/* @__PURE__ */ jsxs("div", { className: "d-flex align-items-center gap-8", children: [
|
|
26
|
+
(items || isCheckable) && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
27
|
+
/* @__PURE__ */ jsx("div", { className: clsx("list-header d-flex align-items-center gap-8 px-12", className), children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
28
|
+
/* @__PURE__ */ jsxs("div", { className: "d-flex align-items-center gap-8 py-12", children: [
|
|
29
29
|
/* @__PURE__ */ jsx(Checkbox, { checked: allItemsSelected, indeterminate: isIndeterminate, onChange: () => handleOnSelectAllItems(allItemsSelected) }),
|
|
30
30
|
/* @__PURE__ */ jsxs("span", { children: [
|
|
31
31
|
"(",
|
|
@@ -33,15 +33,15 @@ const List = ({
|
|
|
33
33
|
")"
|
|
34
34
|
] })
|
|
35
35
|
] }),
|
|
36
|
-
/* @__PURE__ */ jsx(Toolbar, { items, isBlock: !0, align: "left", variant: "no-shadow", className: clsx("gap-4 py-4", {
|
|
36
|
+
items && /* @__PURE__ */ jsx(Toolbar, { items, isBlock: !0, align: "left", variant: "no-shadow", className: clsx("gap-4 py-4", {
|
|
37
37
|
"px-0 ms-auto": !isDesktopDevice
|
|
38
38
|
}) })
|
|
39
39
|
] }) }),
|
|
40
40
|
/* @__PURE__ */ jsx("div", { className: "border-top" })
|
|
41
41
|
] }),
|
|
42
42
|
/* @__PURE__ */ jsx("div", { className: "mt-8", children: data == null ? void 0 : data.map((node) => {
|
|
43
|
-
const
|
|
44
|
-
return /* @__PURE__ */ jsx(Fragment$1, { children: renderNode(node,
|
|
43
|
+
const checked = selectedItems.includes(node._id);
|
|
44
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: renderNode(node, /* @__PURE__ */ jsx(Checkbox, { checked, onChange: () => handleOnSelectItem(node._id), onClick: (event) => event.stopPropagation() }), checked) }, node._id);
|
|
45
45
|
}) })
|
|
46
46
|
] });
|
|
47
47
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChangeEvent } from 'react';
|
|
2
2
|
import { Size } from '../../types';
|
|
3
|
-
export interface BaseProps {
|
|
3
|
+
export interface BaseProps extends Omit<React.ComponentPropsWithoutRef<'input'>, 'size'> {
|
|
4
4
|
/**
|
|
5
5
|
* String or Template literal with React i18next namespace
|
|
6
6
|
*/
|
|
@@ -24,10 +24,12 @@ const SearchBar = ({
|
|
|
24
24
|
"ps-48": isVariant
|
|
25
25
|
}), handleClick = () => {
|
|
26
26
|
onClick == null || onClick();
|
|
27
|
+
}, handleKeyDown = (e) => {
|
|
28
|
+
e.key === "Enter" && (e.preventDefault(), handleClick());
|
|
27
29
|
};
|
|
28
30
|
return /* @__PURE__ */ jsxs(FormControl, { id: "search-bar", className: searchbar, children: [
|
|
29
31
|
isVariant && /* @__PURE__ */ jsx("div", { className: "position-absolute z-1 top-50 start-0 translate-middle-y border-0 ps-12 bg-transparent", children: /* @__PURE__ */ jsx(SvgIconSearch, {}) }),
|
|
30
|
-
/* @__PURE__ */ jsx(FormControl.Input, { type: "search", placeholder: t(placeholder), size, noValidationIcon: !0, className: input, onChange, disabled, ...restProps }),
|
|
32
|
+
/* @__PURE__ */ jsx(FormControl.Input, { type: "search", placeholder: t(placeholder), size, noValidationIcon: !0, className: input, onChange, disabled, onKeyDown: handleKeyDown, ...restProps }),
|
|
31
33
|
!isVariant && /* @__PURE__ */ jsx(SearchButton, { type: "submit", "aria-label": t("search"), icon: /* @__PURE__ */ jsx(SvgIconSearch, {}), className: "border-start-0", onClick: handleClick })
|
|
32
34
|
] });
|
|
33
35
|
};
|
package/dist/editor.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { EditorContent, useEditor } from "@tiptap/react";
|
|
2
2
|
import { default as default2 } from "./modules/editor/components/Editor/Editor.js";
|
|
3
3
|
import { default as default3 } from "./modules/editor/components/BubbleMenuEditImage/BubbleMenuEditImage.js";
|
|
4
|
-
import { default as default4 } from "./modules/editor/components/NodeView/
|
|
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/
|
|
4
|
+
import { default as default4 } from "./modules/editor/components/NodeView/AttachmentNodeView.js";
|
|
5
|
+
import { default as default5 } from "./modules/editor/components/NodeView/AudioNodeView.js";
|
|
6
|
+
import { default as default6 } from "./modules/editor/components/NodeView/ConversationHistoryNodeView.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
10
|
import { default as default10 } from "./modules/editor/components/Renderer/AttachmentRenderer.js";
|
|
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/
|
|
11
|
+
import { default as default11 } from "./modules/editor/components/Renderer/AudioRenderer.js";
|
|
12
|
+
import { default as default12 } from "./modules/editor/components/Renderer/ConversationHistoryRenderer.js";
|
|
13
|
+
import { default as default13 } from "./modules/editor/components/Renderer/LinkerRenderer.js";
|
|
14
|
+
import { default as default14 } from "./modules/editor/components/Renderer/MediaRenderer.js";
|
|
15
|
+
import { default as default15 } from "./modules/editor/components/Toolbar/TableToolbar.js";
|
|
16
|
+
import { default as default16 } from "./modules/editor/components/Toolbar/LinkToolbar.js";
|
|
15
17
|
import { EditorToolbar } from "./modules/editor/components/EditorToolbar/EditorToolbar.js";
|
|
16
18
|
import { useActionOptions } from "./modules/editor/hooks/useActionOptions.js";
|
|
17
19
|
import { useCommentEditor } from "./modules/editor/hooks/useCommentEditor.js";
|
|
@@ -25,28 +27,26 @@ import { useResizeMedia } from "./modules/editor/hooks/useResizeMedia.js";
|
|
|
25
27
|
import { useSpeechRecognition } from "./modules/editor/hooks/useSpeechRecognition.js";
|
|
26
28
|
import { useSpeechSynthetisis } from "./modules/editor/hooks/useSpeechSynthetisis.js";
|
|
27
29
|
import { useTipTapEditor } from "./modules/editor/hooks/useTipTapEditor.js";
|
|
28
|
-
import { useCantooEditor } from "./modules/editor/hooks/useCantooEditor.js";
|
|
29
|
-
import { useCantooAdaptTextBox } from "./modules/editor/hooks/useCantooAdaptTextBox.js";
|
|
30
30
|
export {
|
|
31
|
-
|
|
31
|
+
default4 as AttachmentNodeView,
|
|
32
32
|
default10 as AttachmentRenderer,
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
default5 as AudioNodeView,
|
|
34
|
+
default11 as AudioRenderer,
|
|
35
35
|
default3 as BubbleMenuEditImage,
|
|
36
|
+
default6 as ConversationHistoryNodeView,
|
|
37
|
+
default12 as ConversationHistoryRenderer,
|
|
36
38
|
default2 as Editor,
|
|
37
39
|
EditorContent,
|
|
38
40
|
EditorContext,
|
|
39
41
|
EditorToolbar,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
default7 as ImageNodeView,
|
|
43
|
+
default16 as LinkToolbar,
|
|
44
|
+
default8 as LinkerNodeView,
|
|
45
|
+
default13 as LinkerRenderer,
|
|
46
|
+
default14 as MediaRenderer,
|
|
47
|
+
default15 as TableToolbar,
|
|
48
|
+
default9 as VideoNodeView,
|
|
47
49
|
useActionOptions,
|
|
48
|
-
useCantooAdaptTextBox,
|
|
49
|
-
useCantooEditor,
|
|
50
50
|
useCommentEditor,
|
|
51
51
|
useEditor,
|
|
52
52
|
useEditorContext,
|
|
@@ -7,7 +7,7 @@ const useCheckable = (data) => {
|
|
|
7
7
|
});
|
|
8
8
|
}, handleOnSelectAllItems = (deselect) => {
|
|
9
9
|
setSelectedItems(() => deselect ? [] : (data == null ? void 0 : data.map((item) => item._id)) ?? []);
|
|
10
|
-
}, allItemsSelected = (selectedItems == null ? void 0 : selectedItems.length) === (data == null ? void 0 : data.length), isIndeterminate = data ? (selectedItems == null ? void 0 : selectedItems.length) > 0 && (selectedItems == null ? void 0 : selectedItems.length) < (data == null ? void 0 : data.length) : !1;
|
|
10
|
+
}, allItemsSelected = (selectedItems == null ? void 0 : selectedItems.length) === (data == null ? void 0 : data.length) && (data == null ? void 0 : data.length) > 0, isIndeterminate = data ? (selectedItems == null ? void 0 : selectedItems.length) > 0 && (selectedItems == null ? void 0 : selectedItems.length) < (data == null ? void 0 : data.length) : !1;
|
|
11
11
|
return {
|
|
12
12
|
selectedItems,
|
|
13
13
|
allItemsSelected,
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import { useState, useEffect } from "react";
|
|
2
2
|
import { odeServices } from "@edifice.io/client";
|
|
3
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
4
|
import useHasWorkflow from "../useHasWorkflow/useHasWorkflow.js";
|
|
4
5
|
const useConversation = () => {
|
|
5
|
-
const zimbraWorkflow = useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|view"), zimbraPreauth = useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|preauth"), [
|
|
6
|
+
const zimbraWorkflow = useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|view"), zimbraPreauth = useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|preauth"), [msgLink, setMsgLink] = useState(""), queryParams = {
|
|
6
7
|
unread: !0,
|
|
7
8
|
_: (/* @__PURE__ */ new Date()).getTime()
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
console.error(error), setMessages(0);
|
|
19
|
-
}
|
|
20
|
-
}, goToMessagerie = async () => {
|
|
9
|
+
}, {
|
|
10
|
+
data: messages
|
|
11
|
+
} = useQuery({
|
|
12
|
+
queryKey: ["conversation-navbar-count"],
|
|
13
|
+
queryFn: async () => await odeServices.http().get(zimbraWorkflow ? "/zimbra/count/INBOX" : "/conversation/count/INBOX", {
|
|
14
|
+
queryParams
|
|
15
|
+
}),
|
|
16
|
+
staleTime: 5 * 60 * 1e3
|
|
17
|
+
// 5 minutes
|
|
18
|
+
}), goToMessagerie = async () => {
|
|
21
19
|
const defaultLink = "/zimbra/zimbra";
|
|
22
20
|
try {
|
|
23
21
|
const {
|
|
@@ -29,11 +27,9 @@ const useConversation = () => {
|
|
|
29
27
|
}
|
|
30
28
|
};
|
|
31
29
|
return useEffect(() => {
|
|
32
|
-
refreshMails();
|
|
33
|
-
}, []), useEffect(() => {
|
|
34
30
|
goToMessagerie();
|
|
35
31
|
}, []), {
|
|
36
|
-
messages,
|
|
32
|
+
messages: messages ? messages.count : 0,
|
|
37
33
|
msgLink,
|
|
38
34
|
zimbraWorkflow
|
|
39
35
|
};
|