@edifice.io/react 2.2.3-develop-b2school.20250416174212 → 2.2.3-develop-integration.20250417103951
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/Combobox/Combobox.d.ts +5 -56
- package/dist/components/Combobox/Combobox.js +7 -16
- package/dist/components/Combobox/ComboboxTrigger.d.ts +2 -31
- package/dist/components/Combobox/ComboboxTrigger.js +8 -31
- package/dist/components/Dropdown/Dropdown.d.ts +2 -10
- package/dist/components/Dropdown/Dropdown.js +3 -5
- package/dist/components/Dropdown/DropdownItem.d.ts +1 -5
- package/dist/components/Dropdown/DropdownItem.js +1 -4
- package/dist/components/Dropdown/DropdownTrigger.js +1 -5
- package/dist/components/List/List.d.ts +1 -9
- package/dist/components/List/List.js +9 -9
- package/dist/components/SearchBar/SearchBar.d.ts +1 -1
- package/dist/components/SearchBar/SearchBar.js +1 -3
- package/dist/editor.js +28 -28
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/useCheckable/useCheckable.js +3 -10
- package/dist/hooks/useConversation/useConversation.d.ts +1 -1
- package/dist/hooks/useConversation/useConversation.js +17 -13
- package/dist/hooks/useDropdown/useDropdown.d.ts +1 -2
- package/dist/hooks/useDropdown/useDropdown.js +3 -5
- package/dist/icons.js +266 -280
- package/dist/index.d.ts +0 -1
- package/dist/index.js +20 -48
- package/dist/modals.js +14 -16
- package/dist/modules/editor/components/Editor/CantooAdaptTextBoxView.d.ts +7 -0
- package/dist/modules/editor/components/Editor/CantooAdaptTextBoxView.js +32 -0
- package/dist/modules/editor/components/Editor/Editor.d.ts +1 -3
- package/dist/modules/editor/components/Editor/Editor.js +18 -9
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Cantoo.d.ts +12 -0
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Cantoo.js +97 -0
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.d.ts +4 -1
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.js +19 -4
- package/dist/modules/editor/components/NodeView/index.d.ts +1 -2
- package/dist/modules/editor/components/Renderer/index.d.ts +1 -2
- package/dist/modules/editor/hooks/index.d.ts +2 -0
- package/dist/modules/editor/hooks/useCantooAdaptTextBox.d.ts +15 -0
- package/dist/modules/editor/hooks/useCantooAdaptTextBox.js +29 -0
- package/dist/modules/editor/hooks/useCantooEditor.d.ts +9 -0
- package/dist/modules/editor/hooks/useCantooEditor.js +55 -0
- package/dist/modules/editor/hooks/useTipTapEditor.d.ts +2 -6
- package/dist/modules/editor/hooks/useTipTapEditor.js +2 -2
- package/dist/modules/icons/components/{IconGlobe2.d.ts → IconCantoo.d.ts} +2 -2
- package/dist/modules/icons/components/IconCantoo.js +23 -0
- package/dist/modules/icons/components/IconMicOff.d.ts +7 -0
- package/dist/modules/icons/components/IconMicOff.js +12 -0
- package/dist/modules/icons/components/IconTextToSpeechOff.d.ts +7 -0
- package/dist/modules/icons/components/IconTextToSpeechOff.js +12 -0
- package/dist/modules/icons/components/index.d.ts +3 -10
- package/dist/modules/modals/index.d.ts +0 -1
- package/dist/modules/multimedia/index.d.ts +0 -1
- package/dist/multimedia.js +1 -3
- package/package.json +6 -6
- package/dist/hooks/useWorkspaceFolders/index.d.ts +0 -2
- package/dist/hooks/useWorkspaceFolders/useWorkspaceFolders.d.ts +0 -28
- package/dist/hooks/useWorkspaceFolders/useWorkspaceFolders.js +0 -74
- package/dist/modules/editor/components/NodeView/ConversationHistoryNodeView.d.ts +0 -2
- package/dist/modules/editor/components/NodeView/ConversationHistoryNodeView.js +0 -10
- package/dist/modules/editor/components/Renderer/ConversationHistoryRenderer.d.ts +0 -8
- package/dist/modules/editor/components/Renderer/ConversationHistoryRenderer.js +0 -28
- package/dist/modules/icons/components/IconFolderAdd.d.ts +0 -7
- package/dist/modules/icons/components/IconFolderAdd.js +0 -13
- package/dist/modules/icons/components/IconFolderDelete.d.ts +0 -7
- package/dist/modules/icons/components/IconFolderDelete.js +0 -12
- package/dist/modules/icons/components/IconGlobe2.js +0 -16
- package/dist/modules/icons/components/IconGroupAvatar.d.ts +0 -7
- package/dist/modules/icons/components/IconGroupAvatar.js +0 -12
- package/dist/modules/icons/components/IconMailRecall.d.ts +0 -7
- package/dist/modules/icons/components/IconMailRecall.js +0 -13
- package/dist/modules/icons/components/IconQuestionMark.d.ts +0 -7
- package/dist/modules/icons/components/IconQuestionMark.js +0 -13
- package/dist/modules/icons/components/IconReadMail.d.ts +0 -7
- package/dist/modules/icons/components/IconReadMail.js +0 -16
- package/dist/modules/icons/components/IconSignature.d.ts +0 -7
- package/dist/modules/icons/components/IconSignature.js +0 -13
- package/dist/modules/icons/components/IconUndoAll.d.ts +0 -7
- package/dist/modules/icons/components/IconUndoAll.js +0 -14
- package/dist/modules/icons/components/IconUnreadMail.d.ts +0 -7
- package/dist/modules/icons/components/IconUnreadMail.js +0 -16
- package/dist/modules/modals/ConfirmModal/ConfirmModal.d.ts +0 -47
- package/dist/modules/modals/ConfirmModal/ConfirmModal.js +0 -37
- package/dist/modules/modals/ConfirmModal/index.d.ts +0 -1
- package/dist/modules/multimedia/WorkspaceFolders/WorkspaceFolders.d.ts +0 -8
- package/dist/modules/multimedia/WorkspaceFolders/WorkspaceFolders.js +0 -31
- package/dist/modules/multimedia/WorkspaceFolders/index.d.ts +0 -1
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
import { ChangeEvent
|
|
1
|
+
import { ChangeEvent } from 'react';
|
|
2
2
|
export interface ComboboxProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
onSearchResultsChange: (model: (string | number)[]) => void;
|
|
3
4
|
onSearchInputChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
4
5
|
options: OptionListItemType[];
|
|
5
6
|
value: string;
|
|
6
7
|
isLoading: boolean;
|
|
7
8
|
noResult: boolean;
|
|
8
|
-
onSearchResultsChange?: (model: (string | number)[]) => void;
|
|
9
|
-
onSearchInputKeyUp?: (event: KeyboardEvent<HTMLInputElement>) => void;
|
|
10
9
|
searchMinLength?: number;
|
|
11
10
|
placeholder?: string;
|
|
12
|
-
variant?: 'outline' | 'ghost';
|
|
13
|
-
renderInputGroup?: ReactNode;
|
|
14
|
-
renderList?: (items: OptionListItemType[]) => ReactNode;
|
|
15
|
-
renderListItem?: (item: OptionListItemType) => ReactNode;
|
|
16
|
-
renderSelectedItems?: ReactNode;
|
|
17
|
-
renderNoResult?: ReactNode;
|
|
18
|
-
hasDefault?: boolean;
|
|
19
11
|
}
|
|
20
12
|
export interface OptionListItemType {
|
|
21
13
|
/**
|
|
@@ -25,58 +17,15 @@ export interface OptionListItemType {
|
|
|
25
17
|
/**
|
|
26
18
|
* Label
|
|
27
19
|
*/
|
|
28
|
-
label
|
|
20
|
+
label: string;
|
|
29
21
|
/**
|
|
30
22
|
* Add an icon
|
|
31
23
|
*/
|
|
32
24
|
icon?: any;
|
|
33
|
-
/**
|
|
34
|
-
* Display Separator or not
|
|
35
|
-
*/
|
|
36
|
-
withSeparator?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Disable option
|
|
39
|
-
*/
|
|
40
|
-
disabled?: boolean;
|
|
41
25
|
}
|
|
42
|
-
/**
|
|
43
|
-
* A component that combines an input field with a dropdown list of selectable options.
|
|
44
|
-
*
|
|
45
|
-
* @component
|
|
46
|
-
* @example
|
|
47
|
-
* ```tsx
|
|
48
|
-
* <Combobox
|
|
49
|
-
* onSearchResultsChange={(values) => console.log(values)}
|
|
50
|
-
* onSearchInputChange={(e) => console.log(e.target.value)}
|
|
51
|
-
* options={[{ value: '1', label: 'Option 1' }]}
|
|
52
|
-
* value=""
|
|
53
|
-
* isLoading={false}
|
|
54
|
-
* noResult={false}
|
|
55
|
-
* />
|
|
56
|
-
* ```
|
|
57
|
-
*
|
|
58
|
-
* @param props - The component props
|
|
59
|
-
* @param props.onSearchResultsChange - Callback fired when the selected values change
|
|
60
|
-
* @param props.onSearchInputChange - Callback fired when the search input value changes
|
|
61
|
-
* @param props.options - Array of options to display in the dropdown
|
|
62
|
-
* @param props.value - Current value of the search input
|
|
63
|
-
* @param props.isLoading - Whether the component is in a loading state
|
|
64
|
-
* @param props.noResult - Whether to show a "no results" message
|
|
65
|
-
* @param props.searchMinLength - Minimum number of characters required to trigger search
|
|
66
|
-
* @param props.placeholder - Placeholder text for the input field
|
|
67
|
-
* @param props.variant - Visual variant of the input ('outline' or 'ghost')
|
|
68
|
-
* @param props.renderInputGroup - Custom render function for the input group
|
|
69
|
-
* @param props.renderList - Custom render function for the dropdown list
|
|
70
|
-
* @param props.renderListItem - Custom render function for each option item
|
|
71
|
-
* @param props.renderSelectedItems - Custom render function for selected items
|
|
72
|
-
* @param props.renderNoResult - Custom render function for no results message
|
|
73
|
-
* @param props.hasDefault - Whether to show default options
|
|
74
|
-
*
|
|
75
|
-
* @extends {React.InputHTMLAttributes<HTMLInputElement>}
|
|
76
|
-
*/
|
|
77
26
|
declare const Combobox: {
|
|
78
|
-
({ onSearchResultsChange, onSearchInputChange,
|
|
79
|
-
Trigger: ({ placeholder, value, searchMinLength, handleSearchInputChange,
|
|
27
|
+
({ onSearchResultsChange, onSearchInputChange, options, value, isLoading, noResult, searchMinLength, placeholder, }: ComboboxProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
Trigger: ({ placeholder, value, searchMinLength, handleSearchInputChange, }: import('./ComboboxTrigger').ComboboxTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
80
29
|
displayName: string;
|
|
81
30
|
};
|
|
82
31
|
export default Combobox;
|
|
@@ -7,39 +7,30 @@ import Loading from "../Loading/Loading.js";
|
|
|
7
7
|
const Combobox = ({
|
|
8
8
|
onSearchResultsChange,
|
|
9
9
|
onSearchInputChange,
|
|
10
|
-
onSearchInputKeyUp,
|
|
11
10
|
options,
|
|
12
11
|
value,
|
|
13
12
|
isLoading,
|
|
14
13
|
noResult,
|
|
15
14
|
searchMinLength,
|
|
16
|
-
placeholder
|
|
17
|
-
variant = "outline",
|
|
18
|
-
renderInputGroup,
|
|
19
|
-
renderList,
|
|
20
|
-
renderListItem,
|
|
21
|
-
renderSelectedItems,
|
|
22
|
-
renderNoResult
|
|
15
|
+
placeholder
|
|
23
16
|
}) => {
|
|
24
17
|
const {
|
|
25
18
|
t
|
|
26
19
|
} = useTranslation(), [localValue, setLocalValue] = useState([]);
|
|
27
20
|
useEffect(() => {
|
|
28
|
-
onSearchResultsChange
|
|
21
|
+
onSearchResultsChange(localValue);
|
|
29
22
|
}, [localValue]);
|
|
30
23
|
const handleOptionClick = (value2) => {
|
|
31
24
|
setLocalValue([value2]);
|
|
32
25
|
}, renderContent = () => isLoading ? /* @__PURE__ */ jsxs("div", { className: "d-flex align-items-center p-4", children: [
|
|
33
26
|
/* @__PURE__ */ jsx(Loading, { isLoading }),
|
|
34
27
|
/* @__PURE__ */ jsx("span", { className: "ps-4", children: t("explorer.search.pending") })
|
|
35
|
-
] }) : noResult ?
|
|
36
|
-
/* @__PURE__ */ jsx(Dropdown.Item, { type: "select", icon: option.icon, onClick: () => handleOptionClick(option.value),
|
|
37
|
-
|
|
28
|
+
] }) : noResult ? /* @__PURE__ */ jsx("div", { className: "p-4", children: t("portal.no.result") }) : options.map((option, index) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
29
|
+
/* @__PURE__ */ jsx(Dropdown.Item, { type: "select", icon: option.icon, onClick: () => handleOptionClick(option.value), children: option.label }),
|
|
30
|
+
index < options.length - 1 && /* @__PURE__ */ jsx(Dropdown.Separator, {})
|
|
38
31
|
] }, index));
|
|
39
|
-
return /* @__PURE__ */ jsxs(Dropdown, { block: !0,
|
|
40
|
-
/* @__PURE__ */ jsx(Combobox.Trigger, { placeholder, searchMinLength, handleSearchInputChange: onSearchInputChange,
|
|
41
|
-
onSearchInputKeyUp == null || onSearchInputKeyUp(event);
|
|
42
|
-
}, value, variant, renderInputGroup, renderSelectedItems, hasDefault: !!options.length }),
|
|
32
|
+
return /* @__PURE__ */ jsxs(Dropdown, { block: !0, children: [
|
|
33
|
+
/* @__PURE__ */ jsx(Combobox.Trigger, { placeholder, searchMinLength, handleSearchInputChange: onSearchInputChange, value }),
|
|
43
34
|
/* @__PURE__ */ jsx(Dropdown.Menu, { children: renderContent() })
|
|
44
35
|
] });
|
|
45
36
|
};
|
|
@@ -1,38 +1,9 @@
|
|
|
1
|
-
import { ChangeEvent
|
|
1
|
+
import { ChangeEvent } from 'react';
|
|
2
2
|
export interface ComboboxTriggerProps extends React.ComponentPropsWithRef<'button'> {
|
|
3
3
|
handleSearchInputChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
4
|
-
handleSearchInputKeyUp: (event: KeyboardEvent<HTMLInputElement>) => void;
|
|
5
4
|
value: string;
|
|
6
5
|
searchMinLength?: number;
|
|
7
6
|
placeholder?: string;
|
|
8
|
-
renderInputGroup?: React.ReactNode;
|
|
9
|
-
variant?: 'outline' | 'ghost';
|
|
10
|
-
renderSelectedItems?: ReactNode;
|
|
11
|
-
hasDefault: boolean;
|
|
12
7
|
}
|
|
13
|
-
|
|
14
|
-
* A trigger component for the Combobox that handles user input and displays selected items.
|
|
15
|
-
*
|
|
16
|
-
* @component
|
|
17
|
-
* @example
|
|
18
|
-
* ```tsx
|
|
19
|
-
* <ComboboxTrigger
|
|
20
|
-
* value={searchValue}
|
|
21
|
-
* handleSearchInputChange={(e) => setSearchValue(e.target.value)}
|
|
22
|
-
* placeholder="Search..."
|
|
23
|
-
* />
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* @param {object} props - Component props
|
|
27
|
-
* @param {string} [props.placeholder] - Placeholder text for the search input
|
|
28
|
-
* @param {string} [props.value=''] - Current value of the search input
|
|
29
|
-
* @param {number} [props.searchMinLength=3] - Minimum number of characters required before showing dropdown
|
|
30
|
-
* @param {(event: ChangeEvent<HTMLInputElement>) => void} props.handleSearchInputChange - Handler for input change events
|
|
31
|
-
* @param {ReactNode} [props.renderInputGroup] - Optional content to render in the input group (e.g., icons)
|
|
32
|
-
* @param {'outline' | 'ghost'} [props.variant='outline'] - Visual variant of the input
|
|
33
|
-
* @param {ReactNode} [props.renderSelectedItems] - Optional content to render selected items
|
|
34
|
-
*
|
|
35
|
-
* @returns {JSX.Element} A form control containing an input field with optional input group and selected items
|
|
36
|
-
*/
|
|
37
|
-
declare const ComboboxTrigger: ({ placeholder, value, searchMinLength, handleSearchInputChange, handleSearchInputKeyUp, renderInputGroup, variant, renderSelectedItems, hasDefault, }: ComboboxTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare const ComboboxTrigger: ({ placeholder, value, searchMinLength, handleSearchInputChange, }: ComboboxTriggerProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
9
|
export default ComboboxTrigger;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect } from "react";
|
|
3
|
-
import clsx from "clsx";
|
|
4
3
|
import { useDropdownContext } from "../Dropdown/DropdownContext.js";
|
|
5
4
|
import Input from "../Input/Input.js";
|
|
6
5
|
import FormControl from "../Form/FormControl.js";
|
|
@@ -8,45 +7,23 @@ const ComboboxTrigger = ({
|
|
|
8
7
|
placeholder,
|
|
9
8
|
value = "",
|
|
10
9
|
searchMinLength = 3,
|
|
11
|
-
handleSearchInputChange
|
|
12
|
-
handleSearchInputKeyUp,
|
|
13
|
-
renderInputGroup,
|
|
14
|
-
variant = "outline",
|
|
15
|
-
renderSelectedItems,
|
|
16
|
-
hasDefault
|
|
10
|
+
handleSearchInputChange
|
|
17
11
|
}) => {
|
|
18
12
|
const {
|
|
19
13
|
triggerProps,
|
|
20
14
|
itemProps,
|
|
21
15
|
setVisible
|
|
22
|
-
} = useDropdownContext(),
|
|
16
|
+
} = useDropdownContext(), inputProps = {
|
|
23
17
|
...triggerProps,
|
|
24
|
-
className: clsx("d-flex combobox-trigger", renderInputGroup ? "input-group flex-nowrap align-items-start" : "flex-wrap align-items-center", triggerProps.className),
|
|
25
|
-
onClick: (event) => {
|
|
26
|
-
event.stopPropagation();
|
|
27
|
-
}
|
|
28
|
-
}, inputProps = {
|
|
29
18
|
role: "combobox",
|
|
30
|
-
|
|
31
|
-
|
|
19
|
+
onClick: () => {
|
|
20
|
+
value.length >= searchMinLength && setVisible(!0);
|
|
32
21
|
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
setVisible(input.value.length >= searchMinLength || hasDefault), input.focus();
|
|
36
|
-
},
|
|
37
|
-
onKeyUp: (event) => {
|
|
38
|
-
handleSearchInputKeyUp == null || handleSearchInputKeyUp(event);
|
|
39
|
-
}
|
|
40
|
-
}, classNameVariant = variant === "ghost" ? " border-0" : "", classNameInput = clsx(classNameVariant, renderSelectedItems ? "flex-fill w-auto " : "");
|
|
22
|
+
onChange: handleSearchInputChange
|
|
23
|
+
};
|
|
41
24
|
return useEffect(() => {
|
|
42
25
|
setVisible(value.length >= searchMinLength);
|
|
43
|
-
}, [value, searchMinLength]), /* @__PURE__ */
|
|
44
|
-
!!renderInputGroup && /* @__PURE__ */ jsx("label", { className: "input-group-text pe-0" + classNameVariant, htmlFor: triggerProps.id, children: renderInputGroup }),
|
|
45
|
-
/* @__PURE__ */ jsxs("div", { className: "d-flex align-items-center flex-wrap flex-fill", children: [
|
|
46
|
-
renderSelectedItems,
|
|
47
|
-
/* @__PURE__ */ jsx(Input, { ...inputProps, className: classNameInput, noValidationIcon: !0, placeholder, size: "md", type: "search", onKeyDown: itemProps.onMenuItemKeyDown })
|
|
48
|
-
] })
|
|
49
|
-
] });
|
|
26
|
+
}, [setVisible, value, searchMinLength]), /* @__PURE__ */ jsx(FormControl, { className: "d-flex align-items-center", id: "search", children: /* @__PURE__ */ jsx(Input, { ...inputProps, className: "max-w-512", noValidationIcon: !0, placeholder, size: "md", type: "search", onKeyDown: itemProps.onMenuItemKeyDown }) });
|
|
50
27
|
};
|
|
51
28
|
export {
|
|
52
29
|
ComboboxTrigger as default
|
|
@@ -32,14 +32,6 @@ export interface DropdownProps {
|
|
|
32
32
|
* Whether the trigger is hovered or not.
|
|
33
33
|
*/
|
|
34
34
|
isTriggerHovered?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Whether to focus the first element when the dropdown is opened.
|
|
37
|
-
*/
|
|
38
|
-
focusOnVisible?: boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Whether to open the dropdown on space key press.
|
|
41
|
-
*/
|
|
42
|
-
openOnSpace?: boolean;
|
|
43
35
|
}
|
|
44
36
|
export type DropdownMenuOptions = {
|
|
45
37
|
/**
|
|
@@ -65,13 +57,13 @@ export type DropdownMenuOptions = {
|
|
|
65
57
|
type: 'divider';
|
|
66
58
|
};
|
|
67
59
|
declare const Dropdown: {
|
|
68
|
-
({ children, block, overflow, noWrap, placement, extraTriggerKeyDownHandler, onToggle, isTriggerHovered,
|
|
60
|
+
({ children, block, overflow, noWrap, placement, extraTriggerKeyDownHandler, onToggle, isTriggerHovered, }: DropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
69
61
|
displayName: string;
|
|
70
62
|
} & {
|
|
71
63
|
Trigger: import('react').ForwardRefExoticComponent<Omit<import('./DropdownTrigger').DropdownTriggerProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
|
|
72
64
|
Menu: import('react').ForwardRefExoticComponent<Omit<import('./DropdownMenu').DropdownMenuProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
73
65
|
Item: {
|
|
74
|
-
({ type, icon, onClick, children, className, minWidth,
|
|
66
|
+
({ type, icon, onClick, children, className, minWidth, ...restProps }: import('./DropdownItem').DropdownItemProps): import("react/jsx-runtime").JSX.Element;
|
|
75
67
|
displayName: string;
|
|
76
68
|
};
|
|
77
69
|
Separator: {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, useEffect } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
-
import useDropdown from "../../hooks/useDropdown/useDropdown.js";
|
|
5
4
|
import DropdownCheckboxItem from "./DropdownCheckboxItem.js";
|
|
6
5
|
import { DropdownContext } from "./DropdownContext.js";
|
|
7
6
|
import DropdownItem from "./DropdownItem.js";
|
|
@@ -10,6 +9,7 @@ import DropdownMenuGroup from "./DropdownMenuGroup.js";
|
|
|
10
9
|
import DropdownRadioItem from "./DropdownRadioItem.js";
|
|
11
10
|
import DropdownSeparator from "./DropdownSeparator.js";
|
|
12
11
|
import DropdownTrigger from "./DropdownTrigger.js";
|
|
12
|
+
import useDropdown from "../../hooks/useDropdown/useDropdown.js";
|
|
13
13
|
import useClickOutside from "../../hooks/useClickOutside/useClickOutside.js";
|
|
14
14
|
const Root = ({
|
|
15
15
|
children,
|
|
@@ -19,9 +19,7 @@ const Root = ({
|
|
|
19
19
|
placement = "bottom-start",
|
|
20
20
|
extraTriggerKeyDownHandler,
|
|
21
21
|
onToggle,
|
|
22
|
-
isTriggerHovered = !1
|
|
23
|
-
focusOnVisible = !0,
|
|
24
|
-
openOnSpace = !0
|
|
22
|
+
isTriggerHovered = !1
|
|
25
23
|
}) => {
|
|
26
24
|
const {
|
|
27
25
|
visible,
|
|
@@ -31,7 +29,7 @@ const Root = ({
|
|
|
31
29
|
itemProps,
|
|
32
30
|
itemRefs,
|
|
33
31
|
setVisible
|
|
34
|
-
} = useDropdown(placement, extraTriggerKeyDownHandler, isTriggerHovered
|
|
32
|
+
} = useDropdown(placement, extraTriggerKeyDownHandler, isTriggerHovered), ref = useClickOutside(() => {
|
|
35
33
|
setVisible(!1);
|
|
36
34
|
}), value = useMemo(() => ({
|
|
37
35
|
visible,
|
|
@@ -25,13 +25,9 @@ export interface DropdownItemProps {
|
|
|
25
25
|
* Set minimum width in pixels
|
|
26
26
|
*/
|
|
27
27
|
minWidth?: number;
|
|
28
|
-
/**
|
|
29
|
-
* Disabled status
|
|
30
|
-
*/
|
|
31
|
-
disabled?: boolean;
|
|
32
28
|
}
|
|
33
29
|
declare const DropdownItem: {
|
|
34
|
-
({ type, icon, onClick, children, className, minWidth,
|
|
30
|
+
({ type, icon, onClick, children, className, minWidth, ...restProps }: DropdownItemProps): import("react/jsx-runtime").JSX.Element;
|
|
35
31
|
displayName: string;
|
|
36
32
|
};
|
|
37
33
|
export default DropdownItem;
|
|
@@ -9,7 +9,6 @@ const DropdownItem = ({
|
|
|
9
9
|
children,
|
|
10
10
|
className,
|
|
11
11
|
minWidth,
|
|
12
|
-
disabled,
|
|
13
12
|
...restProps
|
|
14
13
|
}) => {
|
|
15
14
|
const {
|
|
@@ -21,11 +20,9 @@ const DropdownItem = ({
|
|
|
21
20
|
onMenuItemMouseEnter,
|
|
22
21
|
onMenuItemClick
|
|
23
22
|
} = itemProps, handleOnClick = (event) => {
|
|
24
|
-
|
|
23
|
+
onClick == null || onClick(event), type === "action" && (onMenuItemClick(), event.stopPropagation());
|
|
25
24
|
}, id = useId(), dropdownItem = clsx("dropdown-item", {
|
|
26
25
|
focus: isFocused === id
|
|
27
|
-
}, {
|
|
28
|
-
"text-gray-600": disabled
|
|
29
26
|
}, className), style = {
|
|
30
27
|
...minWidth && {
|
|
31
28
|
minWidth: `${minWidth}px`
|
|
@@ -3,7 +3,6 @@ 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";
|
|
7
6
|
const DropdownTrigger = /* @__PURE__ */ forwardRef(({
|
|
8
7
|
label,
|
|
9
8
|
icon,
|
|
@@ -47,10 +46,7 @@ const DropdownTrigger = /* @__PURE__ */ forwardRef(({
|
|
|
47
46
|
return /* @__PURE__ */ jsxs("button", { ref: forwardRef2, type: "button", disabled, ...mergedProps, children: [
|
|
48
47
|
icon,
|
|
49
48
|
label,
|
|
50
|
-
badgeContent ? /* @__PURE__ */ jsx(
|
|
51
|
-
level: "info",
|
|
52
|
-
type: "notification"
|
|
53
|
-
}, children: badgeContent }) : !hideCarret && /* @__PURE__ */ jsx(SvgIconRafterUp, { width: 16, height: 16, className: "dropdown-toggle-caret" })
|
|
49
|
+
badgeContent ? /* @__PURE__ */ jsx("span", { className: "badge text-bg-secondary rounded-pill", children: badgeContent }) : !hideCarret && /* @__PURE__ */ jsx(SvgIconRafterUp, { width: 16, height: 16, className: "dropdown-toggle-caret" })
|
|
54
50
|
] });
|
|
55
51
|
});
|
|
56
52
|
export {
|
|
@@ -5,10 +5,6 @@ export type ListProps<T> = {
|
|
|
5
5
|
* Toolbar data items
|
|
6
6
|
*/
|
|
7
7
|
items?: ToolbarItem[];
|
|
8
|
-
/**
|
|
9
|
-
* Checkable list
|
|
10
|
-
*/
|
|
11
|
-
isCheckable?: boolean;
|
|
12
8
|
/**
|
|
13
9
|
* Generic data
|
|
14
10
|
*/
|
|
@@ -21,11 +17,7 @@ export type ListProps<T> = {
|
|
|
21
17
|
* Callback to get selected ids
|
|
22
18
|
*/
|
|
23
19
|
onSelectedItems?: (selectedIds: string[]) => void;
|
|
24
|
-
/**
|
|
25
|
-
* Custom class name
|
|
26
|
-
*/
|
|
27
|
-
className?: string;
|
|
28
20
|
};
|
|
29
21
|
export declare const List: <T extends {
|
|
30
22
|
_id: string;
|
|
31
|
-
}>({ items,
|
|
23
|
+
}>({ items, data, renderNode, onSelectedItems, }: ListProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,11 +7,9 @@ import Checkbox from "../Checkbox/Checkbox.js";
|
|
|
7
7
|
import { Toolbar } from "../Toolbar/Toolbar.js";
|
|
8
8
|
const List = ({
|
|
9
9
|
items,
|
|
10
|
-
isCheckable = !1,
|
|
11
10
|
data,
|
|
12
11
|
renderNode,
|
|
13
|
-
onSelectedItems
|
|
14
|
-
className
|
|
12
|
+
onSelectedItems
|
|
15
13
|
}) => {
|
|
16
14
|
const {
|
|
17
15
|
selectedItems,
|
|
@@ -23,9 +21,11 @@ const List = ({
|
|
|
23
21
|
return useEffect(() => {
|
|
24
22
|
selectedItems && (onSelectedItems == null || onSelectedItems(selectedItems));
|
|
25
23
|
}, [onSelectedItems, selectedItems]), /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
26
|
-
|
|
27
|
-
/* @__PURE__ */ jsx("div", { className: clsx("
|
|
28
|
-
|
|
24
|
+
items && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
25
|
+
/* @__PURE__ */ jsx("div", { className: clsx("d-flex align-items-center gap-8", {
|
|
26
|
+
"px-12": items
|
|
27
|
+
}), children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
28
|
+
/* @__PURE__ */ jsxs("div", { className: "d-flex align-items-center gap-8", 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
|
-
|
|
36
|
+
/* @__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 checked = selectedItems.includes(node._id);
|
|
44
|
-
return /* @__PURE__ */ jsx(Fragment$1, { children: renderNode(node,
|
|
43
|
+
const checkbox = /* @__PURE__ */ jsx(Checkbox, { checked: selectedItems.includes(node._id), onChange: () => handleOnSelectItem(node._id) }), checked = selectedItems.includes(node._id);
|
|
44
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: renderNode(node, checkbox, 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 {
|
|
4
4
|
/**
|
|
5
5
|
* String or Template literal with React i18next namespace
|
|
6
6
|
*/
|
|
@@ -24,12 +24,10 @@ 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());
|
|
29
27
|
};
|
|
30
28
|
return /* @__PURE__ */ jsxs(FormControl, { id: "search-bar", className: searchbar, children: [
|
|
31
29
|
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, {}) }),
|
|
32
|
-
/* @__PURE__ */ jsx(FormControl.Input, { type: "search", placeholder: t(placeholder), size, noValidationIcon: !0, className: input, onChange, disabled,
|
|
30
|
+
/* @__PURE__ */ jsx(FormControl.Input, { type: "search", placeholder: t(placeholder), size, noValidationIcon: !0, className: input, onChange, disabled, ...restProps }),
|
|
33
31
|
!isVariant && /* @__PURE__ */ jsx(SearchButton, { type: "submit", "aria-label": t("search"), icon: /* @__PURE__ */ jsx(SvgIconSearch, {}), className: "border-start-0", onClick: handleClick })
|
|
34
32
|
] });
|
|
35
33
|
};
|
package/dist/editor.js
CHANGED
|
@@ -2,21 +2,19 @@ import { EditorContent, Editor, useEditor } from "@tiptap/react";
|
|
|
2
2
|
import { default as default2 } from "@tiptap/starter-kit";
|
|
3
3
|
import { default as default3 } from "./modules/editor/components/Editor/Editor.js";
|
|
4
4
|
import { default as default4 } from "./modules/editor/components/BubbleMenuEditImage/BubbleMenuEditImage.js";
|
|
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/NodeView/
|
|
10
|
-
import { default as default10 } from "./modules/editor/components/NodeView/
|
|
11
|
-
import { default as default11 } from "./modules/editor/components/
|
|
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/NodeView/InformationPaneNodeView.js";
|
|
11
|
+
import { default as default11 } from "./modules/editor/components/Renderer/AudioRenderer.js";
|
|
12
12
|
import { default as default12 } from "./modules/editor/components/Renderer/AttachmentRenderer.js";
|
|
13
|
-
import { default as default13 } from "./modules/editor/components/Renderer/
|
|
14
|
-
import { default as default14 } from "./modules/editor/components/Renderer/
|
|
15
|
-
import { default as default15 } from "./modules/editor/components/Renderer/
|
|
16
|
-
import { default as default16 } from "./modules/editor/components/
|
|
17
|
-
import { default as default17 } from "./modules/editor/components/
|
|
18
|
-
import { default as default18 } from "./modules/editor/components/Toolbar/TableToolbar.js";
|
|
19
|
-
import { default as default19 } from "./modules/editor/components/Toolbar/LinkToolbar.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/Renderer/InformationPaneRenderer.js";
|
|
16
|
+
import { default as default16 } from "./modules/editor/components/Toolbar/TableToolbar.js";
|
|
17
|
+
import { default as default17 } from "./modules/editor/components/Toolbar/LinkToolbar.js";
|
|
20
18
|
import { EditorToolbar } from "./modules/editor/components/EditorToolbar/EditorToolbar.js";
|
|
21
19
|
import { useActionOptions } from "./modules/editor/hooks/useActionOptions.js";
|
|
22
20
|
import { useCommentEditor } from "./modules/editor/hooks/useCommentEditor.js";
|
|
@@ -30,30 +28,32 @@ import { useResizeMedia } from "./modules/editor/hooks/useResizeMedia.js";
|
|
|
30
28
|
import { useSpeechRecognition } from "./modules/editor/hooks/useSpeechRecognition.js";
|
|
31
29
|
import { useSpeechSynthetisis } from "./modules/editor/hooks/useSpeechSynthetisis.js";
|
|
32
30
|
import { useTipTapEditor } from "./modules/editor/hooks/useTipTapEditor.js";
|
|
31
|
+
import { useCantooEditor } from "./modules/editor/hooks/useCantooEditor.js";
|
|
32
|
+
import { useCantooAdaptTextBox } from "./modules/editor/hooks/useCantooAdaptTextBox.js";
|
|
33
33
|
export {
|
|
34
|
-
|
|
34
|
+
default6 as AttachmentNodeView,
|
|
35
35
|
default12 as AttachmentRenderer,
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
default5 as AudioNodeView,
|
|
37
|
+
default11 as AudioRenderer,
|
|
38
38
|
default4 as BubbleMenuEditImage,
|
|
39
|
-
default7 as ConversationHistoryNodeView,
|
|
40
|
-
default14 as ConversationHistoryRenderer,
|
|
41
39
|
default3 as Editor,
|
|
42
40
|
EditorContent,
|
|
43
41
|
EditorContext,
|
|
44
42
|
Editor as EditorInstance,
|
|
45
43
|
EditorToolbar,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
default7 as ImageNodeView,
|
|
45
|
+
default10 as InformationPaneNodeView,
|
|
46
|
+
default15 as InformationPaneRenderer,
|
|
47
|
+
default17 as LinkToolbar,
|
|
48
|
+
default8 as LinkerNodeView,
|
|
49
|
+
default13 as LinkerRenderer,
|
|
50
|
+
default14 as MediaRenderer,
|
|
53
51
|
default2 as StarterKit,
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
default16 as TableToolbar,
|
|
53
|
+
default9 as VideoNodeView,
|
|
56
54
|
useActionOptions,
|
|
55
|
+
useCantooAdaptTextBox,
|
|
56
|
+
useCantooEditor,
|
|
57
57
|
useCommentEditor,
|
|
58
58
|
useEditor,
|
|
59
59
|
useEditorContext,
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -29,7 +29,6 @@ export * from './useUpload';
|
|
|
29
29
|
export * from './useUploadFiles';
|
|
30
30
|
export * from './useUser';
|
|
31
31
|
export * from './useWorkspaceFile';
|
|
32
|
-
export * from './useWorkspaceFolders';
|
|
33
32
|
export * from './useWorkspaceSearch';
|
|
34
33
|
export * from './useXitiTrackPageLoad';
|
|
35
34
|
export * from './useZendeskGuide';
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
import { useState
|
|
1
|
+
import { useState } from "react";
|
|
2
2
|
const useCheckable = (data) => {
|
|
3
|
-
const [selectedItems, setSelectedItems] = useState([])
|
|
4
|
-
useEffect(() => {
|
|
5
|
-
if (data) {
|
|
6
|
-
const validSelectedItems = selectedItems.filter((id) => data.some((item) => item._id === id));
|
|
7
|
-
validSelectedItems.length !== selectedItems.length && setSelectedItems(validSelectedItems);
|
|
8
|
-
}
|
|
9
|
-
}, [data]);
|
|
10
|
-
const handleOnSelectItem = (itemId) => {
|
|
3
|
+
const [selectedItems, setSelectedItems] = useState([]), handleOnSelectItem = (itemId) => {
|
|
11
4
|
setSelectedItems((currentSelection) => {
|
|
12
5
|
const newSelection = [...currentSelection];
|
|
13
6
|
return newSelection.includes(itemId) ? newSelection.splice(newSelection.indexOf(itemId), 1) : newSelection.push(itemId), newSelection;
|
|
14
7
|
});
|
|
15
8
|
}, handleOnSelectAllItems = (deselect) => {
|
|
16
9
|
setSelectedItems(() => deselect ? [] : (data == null ? void 0 : data.map((item) => item._id)) ?? []);
|
|
17
|
-
}, allItemsSelected = (selectedItems == null ? void 0 : selectedItems.length) === (data == null ? void 0 : data.length)
|
|
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;
|
|
18
11
|
return {
|
|
19
12
|
selectedItems,
|
|
20
13
|
allItemsSelected,
|
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
import { useState, useEffect } from "react";
|
|
2
2
|
import { odeServices } from "@edifice.io/client";
|
|
3
|
-
import { useQuery } from "@tanstack/react-query";
|
|
4
3
|
import useHasWorkflow from "../useHasWorkflow/useHasWorkflow.js";
|
|
5
4
|
const useConversation = () => {
|
|
6
|
-
const zimbraWorkflow = useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|view"), zimbraPreauth = useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|preauth"), [msgLink, setMsgLink] = useState(""), queryParams = {
|
|
5
|
+
const zimbraWorkflow = useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|view"), zimbraPreauth = useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|preauth"), [messages, setMessages] = useState(0), [msgLink, setMsgLink] = useState(""), queryParams = {
|
|
7
6
|
unread: !0,
|
|
8
7
|
_: (/* @__PURE__ */ new Date()).getTime()
|
|
9
|
-
}, {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
}, refreshMails = async () => {
|
|
9
|
+
const url = zimbraWorkflow ? "/zimbra/count/INBOX" : "/conversation/count/INBOX";
|
|
10
|
+
try {
|
|
11
|
+
const {
|
|
12
|
+
count
|
|
13
|
+
} = await odeServices.http().get(url, {
|
|
14
|
+
queryParams
|
|
15
|
+
});
|
|
16
|
+
setMessages(count ?? 0);
|
|
17
|
+
} catch (error) {
|
|
18
|
+
console.error(error), setMessages(0);
|
|
19
|
+
}
|
|
20
|
+
}, goToMessagerie = async () => {
|
|
19
21
|
const defaultLink = "/zimbra/zimbra";
|
|
20
22
|
try {
|
|
21
23
|
const {
|
|
@@ -27,9 +29,11 @@ const useConversation = () => {
|
|
|
27
29
|
}
|
|
28
30
|
};
|
|
29
31
|
return useEffect(() => {
|
|
32
|
+
refreshMails();
|
|
33
|
+
}, []), useEffect(() => {
|
|
30
34
|
goToMessagerie();
|
|
31
35
|
}, []), {
|
|
32
|
-
messages
|
|
36
|
+
messages,
|
|
33
37
|
msgLink,
|
|
34
38
|
zimbraWorkflow
|
|
35
39
|
};
|