@edifice.io/react 2.5.5-develop.20260112150307 → 2.5.6
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/AppIcon/index.d.ts +0 -1
- package/dist/components/Badge/Badge.d.ts +1 -12
- package/dist/components/Badge/Badge.js +2 -15
- package/dist/components/Flex/Flex.js +1 -1
- package/dist/components/Layout/components/Header.js +6 -1
- package/dist/components/Menu/components/MenuButton.d.ts +0 -2
- package/dist/components/Menu/components/MenuButton.js +4 -13
- package/dist/components/Select/Select.d.ts +2 -6
- package/dist/components/Select/Select.js +4 -10
- package/dist/components/index.d.ts +0 -2
- package/dist/editor.js +36 -40
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/useDropzone/useDropzone.d.ts +2 -2
- package/dist/hooks/useDropzone/useDropzone.js +5 -20
- package/dist/icons.js +298 -300
- package/dist/index.js +170 -186
- package/dist/modals.js +6 -8
- package/dist/modules/comments/components/Comment.js +2 -4
- package/dist/modules/comments/components/CommentList.js +1 -1
- package/dist/modules/comments/components/DeleteModal.js +8 -14
- package/dist/modules/editor/components/Editor/index.d.ts +0 -2
- package/dist/modules/editor/components/Renderer/AttachmentRenderer.js +1 -1
- package/dist/modules/editor/hooks/useMediaLibraryEditor.js +3 -4
- package/dist/modules/icons/components/index.d.ts +0 -1
- package/dist/modules/modals/ShareModal/ShareBookmark.d.ts +1 -1
- package/dist/modules/modals/ShareModal/ShareBookmark.js +2 -5
- package/dist/modules/modals/ShareModal/ShareModal.d.ts +11 -1
- package/dist/modules/modals/ShareModal/ShareModal.js +105 -13
- package/dist/modules/modals/ShareModal/hooks/useSearch.d.ts +1 -2
- package/dist/modules/modals/ShareModal/hooks/useSearch.js +2 -3
- package/dist/modules/modals/ShareModal/hooks/useShare.d.ts +5 -12
- package/dist/modules/modals/ShareModal/hooks/useShare.js +13 -20
- package/dist/modules/modals/ShareModal/hooks/useShareBookmark.d.ts +1 -1
- package/dist/modules/modals/ShareModal/hooks/useShareBookmark.js +1 -1
- package/dist/modules/modals/ShareModal/index.d.ts +1 -3
- package/dist/modules/multimedia/MediaLibrary/index.d.ts +0 -2
- package/dist/modules/multimedia/MediaLibrary/innertabs/Upload.js +1 -1
- package/dist/modules/multimedia/index.d.ts +0 -1
- package/dist/multimedia.js +8 -14
- package/dist/style.css +1 -1
- package/dist/utilities/index.d.ts +0 -1
- package/package.json +6 -7
- package/dist/components/Divider/Divider.d.ts +0 -38
- package/dist/components/Divider/Divider.js +0 -11
- package/dist/components/Divider/index.d.ts +0 -2
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +0 -59
- package/dist/components/SegmentedControl/SegmentedControl.js +0 -21
- package/dist/components/SegmentedControl/index.d.ts +0 -2
- package/dist/hooks/useInfiniteScroll/index.d.ts +0 -1
- package/dist/hooks/useInfiniteScroll/useInfiniteScroll.d.ts +0 -33
- package/dist/hooks/useInfiniteScroll/useInfiniteScroll.js +0 -20
- package/dist/modules/editor/components/Editor/EditorPreview.d.ts +0 -14
- package/dist/modules/editor/components/Editor/EditorPreview.js +0 -56
- package/dist/modules/editor/components/Editor/EditorPreviewSkeleton.d.ts +0 -8
- package/dist/modules/editor/components/Editor/EditorPreviewSkeleton.js +0 -24
- package/dist/modules/icons/components/IconClockAlert.d.ts +0 -7
- package/dist/modules/icons/components/IconClockAlert.js +0 -17
- package/dist/modules/modals/ShareModal/ShareResources.d.ts +0 -174
- package/dist/modules/modals/ShareModal/ShareResources.js +0 -137
- package/dist/utilities/react-query/index.d.ts +0 -1
- package/dist/utilities/react-query/react-query-utils.d.ts +0 -21
- package/dist/utilities/react-query/react-query-utils.js +0 -13
|
@@ -26,17 +26,7 @@ export type ChipBadgeVariant = {
|
|
|
26
26
|
export type LinkBadgeVariant = {
|
|
27
27
|
type: 'link';
|
|
28
28
|
};
|
|
29
|
-
|
|
30
|
-
* Badge variant : beta.
|
|
31
|
-
* Beta Badge is used to indicate that a feature is in beta phase.
|
|
32
|
-
* The color prop allows to customize the badge color to match the app color.
|
|
33
|
-
* Defaults to black if not provided.
|
|
34
|
-
*/
|
|
35
|
-
export type BetaBadgeVariant = {
|
|
36
|
-
type: 'beta';
|
|
37
|
-
color?: string;
|
|
38
|
-
};
|
|
39
|
-
export type BadgeVariants = NotificationBadgeVariant | ContentBadgeVariant | ProfileBadgeVariant | ChipBadgeVariant | LinkBadgeVariant | BetaBadgeVariant;
|
|
29
|
+
export type BadgeVariants = NotificationBadgeVariant | ContentBadgeVariant | ProfileBadgeVariant | ChipBadgeVariant | LinkBadgeVariant;
|
|
40
30
|
export interface BadgeProps extends React.ComponentPropsWithRef<'span'> {
|
|
41
31
|
/**
|
|
42
32
|
* Badge variant : notification, link or profile (Teacher|Student|Relative|Personnel)
|
|
@@ -45,7 +35,6 @@ export interface BadgeProps extends React.ComponentPropsWithRef<'span'> {
|
|
|
45
35
|
variant?: BadgeVariants;
|
|
46
36
|
/**
|
|
47
37
|
* Text or icon (or whatever) to render as children elements.
|
|
48
|
-
* Defaults to 'BÊTA' for beta variant.
|
|
49
38
|
*/
|
|
50
39
|
children?: ReactNode;
|
|
51
40
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
const Badge = /* @__PURE__ */ forwardRef(({
|
|
@@ -11,20 +11,7 @@ const Badge = /* @__PURE__ */ forwardRef(({
|
|
|
11
11
|
...restProps
|
|
12
12
|
}, ref) => {
|
|
13
13
|
const classes = clsx("badge rounded-pill", (variant.type === "content" || variant.type === "user") && "background" in variant ? "bg-gray-200" : (variant.type === "content" || variant.type === "user") && !("background" in variant) ? "border border-0" : "", variant.type === "content" && `text-${variant.level}`, variant.type === "notification" && `badge-notification bg-${variant.level} text-light border border-0`, variant.type === "user" && `badge-profile-${variant.profile.toLowerCase()}`, variant.type === "link" && "badge-link border border-0", variant.type === "chip" && "bg-gray-200", className);
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
if (variant.type !== "beta") return;
|
|
16
|
-
const color = variant.color ?? "#000000";
|
|
17
|
-
return {
|
|
18
|
-
borderColor: color,
|
|
19
|
-
color,
|
|
20
|
-
backgroundColor: `${color}10`
|
|
21
|
-
// the 2 last hexadecimal numbers are for opacity
|
|
22
|
-
};
|
|
23
|
-
})(), ...restProps, children: [
|
|
24
|
-
variant.type === "chip" && /* @__PURE__ */ jsx("div", { className: "d-flex fw-800 align-items-center", children }),
|
|
25
|
-
variant.type === "beta" && (children ?? "BÊTA"),
|
|
26
|
-
variant.type !== "chip" && variant.type !== "beta" && children
|
|
27
|
-
] });
|
|
14
|
+
return /* @__PURE__ */ jsx("span", { ref, className: classes, ...restProps, children: variant.type === "chip" ? /* @__PURE__ */ jsx("div", { className: "d-flex fw-800 align-items-center", children }) : children });
|
|
28
15
|
});
|
|
29
16
|
export {
|
|
30
17
|
Badge as default
|
|
@@ -13,7 +13,7 @@ const Flex = /* @__PURE__ */ forwardRef(({
|
|
|
13
13
|
children,
|
|
14
14
|
...restProps
|
|
15
15
|
}, ref) => {
|
|
16
|
-
const classes = clsx("d-flex", direction && `flex-${direction}`, fill && "flex-fill", align && `align-items-${align}`, justify && `justify-content-${justify}`, gap && `gap-${gap}`, wrap && `flex-${wrap
|
|
16
|
+
const classes = clsx("d-flex", direction && `flex-${direction}`, fill && "flex-fill", align && `align-items-${align}`, justify && `justify-content-${justify}`, gap && `gap-${gap}`, wrap && `flex-${wrap}`, className);
|
|
17
17
|
return /* @__PURE__ */ jsx(Component, { ref, className: classes, ...restProps, children });
|
|
18
18
|
});
|
|
19
19
|
export {
|
|
@@ -48,7 +48,7 @@ const Header = ({
|
|
|
48
48
|
} = useUser(), {
|
|
49
49
|
currentLanguage,
|
|
50
50
|
currentApp
|
|
51
|
-
} = useEdificeClient(), hasOldHelpEnableWorkflow = useHasWorkflow("org.entcore.portal.controllers.PortalController|oldHelpEnable") || !1, {
|
|
51
|
+
} = useEdificeClient(), hasOldHelpEnableWorkflow = useHasWorkflow("org.entcore.portal.controllers.PortalController|oldHelpEnable") || !1, hasCarbonioPreauthWorkflow = useHasWorkflow("org.entcore.auth.controllers.CarbonioPreauthController|preauth") || !1, {
|
|
52
52
|
isModalOpen: isHelpOpen,
|
|
53
53
|
setIsModalOpen: setIsHelpOpen,
|
|
54
54
|
parsedContent,
|
|
@@ -93,6 +93,10 @@ const Header = ({
|
|
|
93
93
|
}, className: "position-absolute", children: messages }),
|
|
94
94
|
/* @__PURE__ */ jsx(VisuallyHidden, { children: t("navbar.messages") })
|
|
95
95
|
] }) }),
|
|
96
|
+
hasCarbonioPreauthWorkflow && /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsxs("a", { href: "/auth/carbonio/preauth", className: "nav-link", children: [
|
|
97
|
+
/* @__PURE__ */ jsx(SvgIconOneMessaging, { className: "icon notification" }),
|
|
98
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { children: t("navbar.messages") })
|
|
99
|
+
] }) }),
|
|
96
100
|
/* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsx(NavLink, { link: "/userbook/mon-compte", className: "dropdown-item", translate: t("navbar.myaccount"), children: /* @__PURE__ */ jsx(SvgIconOneProfile, { className: "icon user" }) }) }),
|
|
97
101
|
currentLanguage === "fr" && hasOldHelpEnableWorkflow ? /* @__PURE__ */ jsxs(NavItem, { children: [
|
|
98
102
|
/* @__PURE__ */ jsxs("button", { className: "nav-link", onClick: () => {
|
|
@@ -153,6 +157,7 @@ const Header = ({
|
|
|
153
157
|
level: "warning"
|
|
154
158
|
}, className: "position-absolute", children: messages })
|
|
155
159
|
] }) }),
|
|
160
|
+
hasCarbonioPreauthWorkflow && /* @__PURE__ */ jsx(NavItem, { children: /* @__PURE__ */ jsx(NavLink, { className: "position-relative", link: "/auth/carbonio/preauth", translate: t("conversation"), children: /* @__PURE__ */ jsx(SvgIconNeoMessaging, { color: "#fff" }) }) }),
|
|
156
161
|
currentLanguage === "fr" && hasOldHelpEnableWorkflow ? /* @__PURE__ */ jsxs(NavItem, { children: [
|
|
157
162
|
/* @__PURE__ */ jsxs("button", { className: "nav-link btn btn-naked", onClick: () => {
|
|
158
163
|
setIsHelpOpen(!0);
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { ButtonProps } from '../../Button';
|
|
2
2
|
export type MenuButtonProps = Pick<ButtonProps, 'children' | 'leftIcon' | 'rightIcon' | 'onClick'> & {
|
|
3
3
|
selected: boolean;
|
|
4
|
-
className?: string;
|
|
5
|
-
size?: 'md' | 'lg';
|
|
6
4
|
};
|
|
7
5
|
export declare const MenuButton: (props: Partial<MenuButtonProps>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -8,22 +8,13 @@ const MenuButton = (props) => {
|
|
|
8
8
|
leftIcon,
|
|
9
9
|
rightIcon,
|
|
10
10
|
onClick,
|
|
11
|
-
children
|
|
12
|
-
className,
|
|
13
|
-
size
|
|
11
|
+
children
|
|
14
12
|
} = props, {
|
|
15
13
|
childProps
|
|
16
14
|
} = useMenuContext();
|
|
17
|
-
return /* @__PURE__ */ jsx(Button, { variant: "ghost", color: "tertiary", className: clsx("stack w-100
|
|
18
|
-
selected
|
|
19
|
-
|
|
20
|
-
}, className), leftIcon, rightIcon, onClick, ...childProps, style: size === "lg" ? {
|
|
21
|
-
height: "auto"
|
|
22
|
-
} : void 0, children: /* @__PURE__ */ jsx("div", { className: clsx("text-truncate w-100 text-start", {
|
|
23
|
-
"text-truncate-2 text-start ms-0": size === "lg"
|
|
24
|
-
}), style: {
|
|
25
|
-
overflowWrap: "break-word"
|
|
26
|
-
}, children }) });
|
|
15
|
+
return /* @__PURE__ */ jsx(Button, { variant: "ghost", color: "tertiary", className: clsx("stack w-100", {
|
|
16
|
+
selected
|
|
17
|
+
}), leftIcon, rightIcon, onClick, ...childProps, children });
|
|
27
18
|
};
|
|
28
19
|
export {
|
|
29
20
|
MenuButton
|
|
@@ -14,7 +14,7 @@ export interface OptionsType {
|
|
|
14
14
|
*/
|
|
15
15
|
icon?: JSX.Element;
|
|
16
16
|
}
|
|
17
|
-
export interface SelectProps extends Omit<DropdownProps, 'children'>, Omit<DropdownTriggerProps, 'badgeContent'
|
|
17
|
+
export interface SelectProps extends Omit<DropdownProps, 'children'>, Omit<DropdownTriggerProps, 'badgeContent'> {
|
|
18
18
|
/**
|
|
19
19
|
* Controlled value
|
|
20
20
|
*/
|
|
@@ -31,17 +31,13 @@ export interface SelectProps extends Omit<DropdownProps, 'children'>, Omit<Dropd
|
|
|
31
31
|
* Callback to get value
|
|
32
32
|
*/
|
|
33
33
|
onValueChange?: (option: OptionsType | string) => void;
|
|
34
|
-
/**
|
|
35
|
-
* Default value
|
|
36
|
-
*/
|
|
37
|
-
defaultValue?: string;
|
|
38
34
|
}
|
|
39
35
|
/**
|
|
40
36
|
*
|
|
41
37
|
* Select component is based on Dropdown Component. It extends `Dropdown` and `Dropdown.Trigger` props `block`, `overflow`, `icon`, `variant`, `size`, `disabled`
|
|
42
38
|
*/
|
|
43
39
|
declare const Select: {
|
|
44
|
-
({ selectedValue, icon, options, overflow, block, variant, size, disabled, placeholderOption, onValueChange,
|
|
40
|
+
({ selectedValue, icon, options, overflow, block, variant, size, disabled, placeholderOption, onValueChange, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
45
41
|
displayName: string;
|
|
46
42
|
};
|
|
47
43
|
export default Select;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
3
|
import { useTranslation } from "react-i18next";
|
|
4
|
-
import Dropdown from "../Dropdown/Dropdown.js";
|
|
5
4
|
import SelectTrigger from "./SelectTrigger.js";
|
|
5
|
+
import Dropdown from "../Dropdown/Dropdown.js";
|
|
6
6
|
const Select = ({
|
|
7
7
|
selectedValue,
|
|
8
8
|
icon,
|
|
@@ -13,8 +13,7 @@ const Select = ({
|
|
|
13
13
|
size,
|
|
14
14
|
disabled,
|
|
15
15
|
placeholderOption,
|
|
16
|
-
onValueChange
|
|
17
|
-
defaultValue
|
|
16
|
+
onValueChange
|
|
18
17
|
}) => {
|
|
19
18
|
const [localValue, setLocalValue] = useState(), {
|
|
20
19
|
t
|
|
@@ -26,15 +25,10 @@ const Select = ({
|
|
|
26
25
|
const value = typeof localValue == "object" ? localValue.value : localValue;
|
|
27
26
|
onValueChange == null || onValueChange(value);
|
|
28
27
|
}
|
|
29
|
-
}, [localValue])
|
|
30
|
-
if (defaultValue) {
|
|
31
|
-
const foundOption = options.find((option) => (typeof option == "object" ? option.value : option) === defaultValue);
|
|
32
|
-
foundOption !== void 0 && setLocalValue(foundOption);
|
|
33
|
-
}
|
|
34
|
-
}, []);
|
|
28
|
+
}, [localValue]);
|
|
35
29
|
const label = typeof localValue == "object" ? localValue.label : localValue, iconChange = typeof localValue == "object" ? localValue.icon : void 0;
|
|
36
30
|
return /* @__PURE__ */ jsxs(Dropdown, { overflow, block, children: [
|
|
37
|
-
/* @__PURE__ */ jsx(SelectTrigger, { icon: iconChange || icon, label:
|
|
31
|
+
/* @__PURE__ */ jsx(SelectTrigger, { icon: iconChange || icon, label: t(label || placeholderOption), variant, size, disabled }),
|
|
38
32
|
/* @__PURE__ */ jsx(Dropdown.Menu, { role: "listbox", children: options == null ? void 0 : options.map((option) => {
|
|
39
33
|
const value = typeof option == "object" ? option.value : option, label2 = typeof option == "object" ? option.label : option, icon2 = typeof option == "object" ? option.icon : void 0;
|
|
40
34
|
return /* @__PURE__ */ jsx(Dropdown.Item, { type: "action", onClick: () => setLocalValue(option), icon: icon2, children: label2 }, value);
|
|
@@ -12,7 +12,6 @@ export * from './Card';
|
|
|
12
12
|
export * from './Checkbox';
|
|
13
13
|
export * from './ColorPicker';
|
|
14
14
|
export * from './Combobox';
|
|
15
|
-
export * from './Divider';
|
|
16
15
|
export * from './Dropdown';
|
|
17
16
|
export * from './Dropzone';
|
|
18
17
|
export * from './EmptyScreen';
|
|
@@ -35,7 +34,6 @@ export * from './PreventPropagation';
|
|
|
35
34
|
export * from './Radio';
|
|
36
35
|
export * from './RadioCard';
|
|
37
36
|
export * from './SearchBar';
|
|
38
|
-
export * from './SegmentedControl';
|
|
39
37
|
export * from './Select';
|
|
40
38
|
export * from './Skeleton';
|
|
41
39
|
export * from './StackedGroup';
|
package/dist/editor.js
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
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
|
-
import { default as default4 } from "./modules/editor/components/Editor/
|
|
5
|
-
import { default as default5 } from "./modules/editor/components/
|
|
6
|
-
import { default as default6 } from "./modules/editor/components/
|
|
7
|
-
import { default as default7 } from "./modules/editor/components/
|
|
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/NodeView/
|
|
12
|
-
import { default as default12 } from "./modules/editor/components/NodeView/
|
|
13
|
-
import { default as default13 } from "./modules/editor/components/NodeView/
|
|
14
|
-
import { default as default14 } from "./modules/editor/components/
|
|
15
|
-
import { default as default15 } from "./modules/editor/components/
|
|
16
|
-
import { default as default16 } from "./modules/editor/components/Renderer/
|
|
17
|
-
import { default as default17 } from "./modules/editor/components/Renderer/
|
|
18
|
-
import { default as default18 } from "./modules/editor/components/Renderer/
|
|
19
|
-
import { default as default19 } from "./modules/editor/components/Renderer/
|
|
20
|
-
import { default as default20 } from "./modules/editor/components/
|
|
21
|
-
import { default as default21 } from "./modules/editor/components/
|
|
22
|
-
import { default as default22 } from "./modules/editor/components/Toolbar/TableToolbar.js";
|
|
23
|
-
import { default as default23 } from "./modules/editor/components/Toolbar/LinkToolbar.js";
|
|
4
|
+
import { default as default4 } from "./modules/editor/components/Editor/EditorSkeleton.js";
|
|
5
|
+
import { default as default5 } from "./modules/editor/components/BubbleMenuEditImage/BubbleMenuEditImage.js";
|
|
6
|
+
import { default as default6 } from "./modules/editor/components/NodeView/AttachmentNodeView.js";
|
|
7
|
+
import { default as default7 } from "./modules/editor/components/NodeView/AudioNodeView.js";
|
|
8
|
+
import { default as default8 } from "./modules/editor/components/NodeView/ConversationHistoryNodeView.js";
|
|
9
|
+
import { default as default9 } from "./modules/editor/components/NodeView/ImageNodeView.js";
|
|
10
|
+
import { default as default10 } from "./modules/editor/components/NodeView/LinkerNodeView.js";
|
|
11
|
+
import { default as default11 } from "./modules/editor/components/NodeView/VideoNodeView.js";
|
|
12
|
+
import { default as default12 } from "./modules/editor/components/NodeView/InformationPaneNodeView.js";
|
|
13
|
+
import { default as default13 } from "./modules/editor/components/NodeView/IframeNodeView.js";
|
|
14
|
+
import { default as default14 } from "./modules/editor/components/Renderer/AttachmentRenderer.js";
|
|
15
|
+
import { default as default15 } from "./modules/editor/components/Renderer/AudioRenderer.js";
|
|
16
|
+
import { default as default16 } from "./modules/editor/components/Renderer/ConversationHistoryRenderer.js";
|
|
17
|
+
import { default as default17 } from "./modules/editor/components/Renderer/LinkerRenderer.js";
|
|
18
|
+
import { default as default18 } from "./modules/editor/components/Renderer/MediaRenderer.js";
|
|
19
|
+
import { default as default19 } from "./modules/editor/components/Renderer/InformationPaneRenderer.js";
|
|
20
|
+
import { default as default20 } from "./modules/editor/components/Toolbar/TableToolbar.js";
|
|
21
|
+
import { default as default21 } from "./modules/editor/components/Toolbar/LinkToolbar.js";
|
|
24
22
|
import { EditorToolbar } from "./modules/editor/components/EditorToolbar/EditorToolbar.js";
|
|
25
23
|
import { useActionOptions } from "./modules/editor/hooks/useActionOptions.js";
|
|
26
24
|
import { useCommentEditor } from "./modules/editor/hooks/useCommentEditor.js";
|
|
@@ -36,32 +34,30 @@ import { useSpeechSynthetisis } from "./modules/editor/hooks/useSpeechSynthetisi
|
|
|
36
34
|
import { useTipTapEditor } from "./modules/editor/hooks/useTipTapEditor.js";
|
|
37
35
|
import { useCantooEditor } from "./modules/editor/hooks/useCantooEditor.js";
|
|
38
36
|
export {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
default6 as AttachmentNodeView,
|
|
38
|
+
default14 as AttachmentRenderer,
|
|
39
|
+
default7 as AudioNodeView,
|
|
40
|
+
default15 as AudioRenderer,
|
|
41
|
+
default5 as BubbleMenuEditImage,
|
|
42
|
+
default8 as ConversationHistoryNodeView,
|
|
43
|
+
default16 as ConversationHistoryRenderer,
|
|
46
44
|
default3 as Editor,
|
|
47
45
|
EditorContent,
|
|
48
46
|
EditorContext,
|
|
49
47
|
Editor as EditorInstance,
|
|
50
|
-
default4 as
|
|
51
|
-
default5 as EditorPreviewSkeleton,
|
|
52
|
-
default6 as EditorSkeleton,
|
|
48
|
+
default4 as EditorSkeleton,
|
|
53
49
|
EditorToolbar,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
50
|
+
default13 as IframeNodeView,
|
|
51
|
+
default9 as ImageNodeView,
|
|
52
|
+
default12 as InformationPaneNodeView,
|
|
53
|
+
default19 as InformationPaneRenderer,
|
|
54
|
+
default21 as LinkToolbar,
|
|
55
|
+
default10 as LinkerNodeView,
|
|
56
|
+
default17 as LinkerRenderer,
|
|
57
|
+
default18 as MediaRenderer,
|
|
62
58
|
default2 as StarterKit,
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
default20 as TableToolbar,
|
|
60
|
+
default11 as VideoNodeView,
|
|
65
61
|
useActionOptions,
|
|
66
62
|
useCantooEditor,
|
|
67
63
|
useCommentEditor,
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -15,7 +15,6 @@ export * from './useHasWorkflow';
|
|
|
15
15
|
export * from './useHover';
|
|
16
16
|
export * from './useHttpErrorToast';
|
|
17
17
|
export * from './useImage';
|
|
18
|
-
export * from './useInfiniteScroll';
|
|
19
18
|
export * from './useIsAdml';
|
|
20
19
|
export * from './useIsAdmc';
|
|
21
20
|
export * from './useIsAdmlcOrAdmc';
|
|
@@ -17,7 +17,7 @@ declare const useDropzone: (props?: {
|
|
|
17
17
|
/** Callback to attach to your drop zone (any HTMLElement). */
|
|
18
18
|
handleDragLeave: <T extends HTMLElement>(event: React.DragEvent<T>) => void;
|
|
19
19
|
/** Callback to attach to your drop zone (any HTMLElement). */
|
|
20
|
-
handleDrop: <T extends HTMLElement>(event: React.DragEvent<T>) =>
|
|
20
|
+
handleDrop: <T extends HTMLElement>(event: React.DragEvent<T>) => void;
|
|
21
21
|
/** Replace a file in the `files` list. */
|
|
22
22
|
replaceFileAt: (index: number, file: File) => void;
|
|
23
23
|
/** Remove a file from the `files` list. */
|
|
@@ -25,7 +25,7 @@ declare const useDropzone: (props?: {
|
|
|
25
25
|
/** Add a file to the `files` list. */
|
|
26
26
|
addFile: (file: File) => void;
|
|
27
27
|
/** Add many files to the `files` list. */
|
|
28
|
-
addFiles: (files: File[]) =>
|
|
28
|
+
addFiles: (files: File[]) => void;
|
|
29
29
|
/** Empty the `files` list. */
|
|
30
30
|
cleanFiles: () => void;
|
|
31
31
|
/** Callback to attach to your `input[type=file]` HTMLElement. */
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { useState, useRef } from "react";
|
|
2
|
-
import heic2any from "heic2any";
|
|
3
2
|
const useDropzone = (props) => {
|
|
4
3
|
const [dragging, setDragging] = useState(!1), [files, setFiles] = useState([]), inputRef = useRef(null), addFile = (file) => {
|
|
5
4
|
addFiles([file]);
|
|
@@ -24,29 +23,15 @@ const useDropzone = (props) => {
|
|
|
24
23
|
});
|
|
25
24
|
}
|
|
26
25
|
return filteredFiles;
|
|
27
|
-
}, addFiles =
|
|
28
|
-
let filesToAdd =
|
|
26
|
+
}, addFiles = (files2) => {
|
|
27
|
+
let filesToAdd = files2.sort((a, b) => b.lastModified - a.lastModified).map((file) => (
|
|
29
28
|
// #WB-3377: Remove special characters from the file name. (it can cause issues with vertx which replace it or remove it)
|
|
30
29
|
new File([file], file.name.replace(/[!:,;="']/g, ""), {
|
|
31
30
|
type: file.type
|
|
32
31
|
})
|
|
33
32
|
));
|
|
34
33
|
filesToAdd.reverse(), props != null && props.forceFilters ? (filesToAdd = applyInputFiltersOn(filesToAdd), filesToAdd && filesToAdd.length && setFiles((prevFiles) => [...prevFiles, ...filesToAdd])) : setFiles((prevFiles) => [...prevFiles, ...files2]);
|
|
35
|
-
},
|
|
36
|
-
if (file.type === "image/heic" || file.type === "image/heif")
|
|
37
|
-
try {
|
|
38
|
-
const converted = await heic2any({
|
|
39
|
-
blob: file,
|
|
40
|
-
toType: "image/jpeg"
|
|
41
|
-
});
|
|
42
|
-
return new File([converted], file.name.replace(/\.(heic|heif)$/i, ".jpeg"), {
|
|
43
|
-
type: "image/jpeg"
|
|
44
|
-
});
|
|
45
|
-
} catch (error) {
|
|
46
|
-
return console.error(`Failed to convert HEIC image: ${file.name}`, error), file;
|
|
47
|
-
}
|
|
48
|
-
return file;
|
|
49
|
-
})), cleanFiles = () => {
|
|
34
|
+
}, cleanFiles = () => {
|
|
50
35
|
setFiles([]);
|
|
51
36
|
}, handleOnChange = (event) => {
|
|
52
37
|
const files2 = event.target.files;
|
|
@@ -68,11 +53,11 @@ const useDropzone = (props) => {
|
|
|
68
53
|
/** Callback to attach to your drop zone (any HTMLElement). */
|
|
69
54
|
handleDragLeave,
|
|
70
55
|
/** Callback to attach to your drop zone (any HTMLElement). */
|
|
71
|
-
handleDrop:
|
|
56
|
+
handleDrop: (event) => {
|
|
72
57
|
var _a;
|
|
73
58
|
handleDragLeave(event);
|
|
74
59
|
const files2 = (_a = event.dataTransfer) == null ? void 0 : _a.files;
|
|
75
|
-
files2 && (
|
|
60
|
+
files2 && (addFiles([...files2]), inputRef != null && inputRef.current && (inputRef.current.files = files2));
|
|
76
61
|
},
|
|
77
62
|
/** Replace a file in the `files` list. */
|
|
78
63
|
replaceFileAt,
|