@edifice.io/react 2.4.2 → 2.5.0-develop-b2school.20251110143752
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/Input/Input.js +4 -10
- package/dist/components/RadioCard/RadioCard.js +32 -0
- package/dist/components/Select/Select.d.ts +6 -2
- package/dist/components/Select/Select.js +3 -0
- package/dist/components/TextArea/TextArea.d.ts +4 -0
- package/dist/components/TextArea/TextArea.js +13 -4
- package/dist/components/TextCounter/TextCounter.d.ts +15 -0
- package/dist/components/TextCounter/TextCounter.js +16 -0
- package/dist/components/TextCounter/index.d.ts +2 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.js +138 -136
- package/dist/modules/comments/components/Comment.js +3 -1
- package/dist/modules/modals/ResourceModal/ResourceModal.js +3 -5
- package/dist/modules/multimedia/MediaLibrary/innertabs/Upload.js +9 -2
- package/package.json +6 -6
- package/dist/components/TextArea/TextareaCounter.js +0 -8
|
@@ -2,13 +2,14 @@ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef, useState } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { useFormControl } from "../Form/FormContext.js";
|
|
5
|
+
import Textcounter from "../TextCounter/TextCounter.js";
|
|
5
6
|
const Input = /* @__PURE__ */ forwardRef(({
|
|
6
7
|
noValidationIcon,
|
|
7
8
|
placeholder,
|
|
8
9
|
size = "md",
|
|
9
10
|
type = "text",
|
|
10
11
|
className,
|
|
11
|
-
showCounter,
|
|
12
|
+
showCounter = !1,
|
|
12
13
|
autoComplete = "off",
|
|
13
14
|
...restProps
|
|
14
15
|
}, ref) => {
|
|
@@ -18,7 +19,7 @@ const Input = /* @__PURE__ */ forwardRef(({
|
|
|
18
19
|
isRequired,
|
|
19
20
|
isReadOnly,
|
|
20
21
|
status
|
|
21
|
-
} = useFormControl(), [currentLength, setCurrentLength] = useState(((_a = restProps.
|
|
22
|
+
} = useFormControl(), [currentLength, setCurrentLength] = useState(((_a = restProps.defaultValue) == null ? void 0 : _a.toString().length) || 0), classes = clsx({
|
|
22
23
|
"form-control": !isReadOnly,
|
|
23
24
|
"form-control-lg": size === "lg",
|
|
24
25
|
"form-control-sm": size === "sm",
|
|
@@ -33,14 +34,7 @@ const Input = /* @__PURE__ */ forwardRef(({
|
|
|
33
34
|
var _a2;
|
|
34
35
|
setCurrentLength(e.target.value.length), (_a2 = restProps.onChange) == null || _a2.call(restProps, e);
|
|
35
36
|
}, autoComplete }),
|
|
36
|
-
showCounter && !status && /* @__PURE__ */
|
|
37
|
-
"text-danger": currentLength === restProps.maxLength,
|
|
38
|
-
"text-gray-700": currentLength !== restProps.maxLength
|
|
39
|
-
}), children: [
|
|
40
|
-
currentLength,
|
|
41
|
-
" / ",
|
|
42
|
-
restProps.maxLength
|
|
43
|
-
] })
|
|
37
|
+
showCounter && !status && /* @__PURE__ */ jsx(Textcounter, { currentLength, maxLength: restProps.maxLength ?? 0 })
|
|
44
38
|
] });
|
|
45
39
|
});
|
|
46
40
|
export {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import Radio from "../Radio/Radio.js";
|
|
5
|
+
import Flex from "../Flex/Flex.js";
|
|
6
|
+
const RadioCard = /* @__PURE__ */ forwardRef(({
|
|
7
|
+
selectedValue,
|
|
8
|
+
value,
|
|
9
|
+
onChange,
|
|
10
|
+
description,
|
|
11
|
+
label,
|
|
12
|
+
model = "",
|
|
13
|
+
groupName = "group",
|
|
14
|
+
...restProps
|
|
15
|
+
}, ref) => {
|
|
16
|
+
const isSelected = selectedValue === value, handleKeyDown = (event) => {
|
|
17
|
+
if (event.key === "Enter") {
|
|
18
|
+
const inputElement = event.currentTarget.querySelector('input[type="radio"]');
|
|
19
|
+
inputElement && inputElement.click();
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
return /* @__PURE__ */ jsxs("label", { ref, role: "button", tabIndex: 0, className: clsx("border py-24 border-2 rounded-3", isSelected && "border-secondary", !isSelected && "border-light", restProps.className), onKeyDown: handleKeyDown, ...restProps, children: [
|
|
23
|
+
/* @__PURE__ */ jsxs(Flex, { justify: "between", className: "px-24", children: [
|
|
24
|
+
/* @__PURE__ */ jsx("h4", { className: "mb-8", id: `radio-card-label-${value}`, children: label }),
|
|
25
|
+
/* @__PURE__ */ jsx(Radio, { model, name: groupName, value, checked: isSelected, onChange, "aria-labelledby": `radio-card-label-${value}` })
|
|
26
|
+
] }),
|
|
27
|
+
description && /* @__PURE__ */ jsx("p", { id: `radio-card-description-${value}`, className: "px-24 text-gray-700 pe-32", children: description })
|
|
28
|
+
] });
|
|
29
|
+
});
|
|
30
|
+
export {
|
|
31
|
+
RadioCard as default
|
|
32
|
+
};
|
|
@@ -16,7 +16,11 @@ export interface OptionsType {
|
|
|
16
16
|
}
|
|
17
17
|
export interface SelectProps extends Omit<DropdownProps, 'children'>, Omit<DropdownTriggerProps, 'badgeContent'> {
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Controlled value
|
|
20
|
+
*/
|
|
21
|
+
selectedValue?: OptionsType | string;
|
|
22
|
+
/**
|
|
23
|
+
* Default select label if no selected value (uncontrolled)
|
|
20
24
|
*/
|
|
21
25
|
placeholderOption: string;
|
|
22
26
|
/**
|
|
@@ -33,7 +37,7 @@ export interface SelectProps extends Omit<DropdownProps, 'children'>, Omit<Dropd
|
|
|
33
37
|
* Select component is based on Dropdown Component. It extends `Dropdown` and `Dropdown.Trigger` props `block`, `overflow`, `icon`, `variant`, `size`, `disabled`
|
|
34
38
|
*/
|
|
35
39
|
declare const Select: {
|
|
36
|
-
({ icon, options, overflow, block, variant, size, disabled, placeholderOption, onValueChange, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
({ selectedValue, icon, options, overflow, block, variant, size, disabled, placeholderOption, onValueChange, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
37
41
|
displayName: string;
|
|
38
42
|
};
|
|
39
43
|
export default Select;
|
|
@@ -4,6 +4,7 @@ import { useTranslation } from "react-i18next";
|
|
|
4
4
|
import SelectTrigger from "./SelectTrigger.js";
|
|
5
5
|
import Dropdown from "../Dropdown/Dropdown.js";
|
|
6
6
|
const Select = ({
|
|
7
|
+
selectedValue,
|
|
7
8
|
icon,
|
|
8
9
|
options,
|
|
9
10
|
overflow,
|
|
@@ -18,6 +19,8 @@ const Select = ({
|
|
|
18
19
|
t
|
|
19
20
|
} = useTranslation();
|
|
20
21
|
useEffect(() => {
|
|
22
|
+
selectedValue !== void 0 && setLocalValue(selectedValue);
|
|
23
|
+
}, [selectedValue]), useEffect(() => {
|
|
21
24
|
if (localValue) {
|
|
22
25
|
const value = typeof localValue == "object" ? localValue.value : localValue;
|
|
23
26
|
onValueChange == null || onValueChange(value);
|
|
@@ -25,6 +25,10 @@ export interface TextAreaProps extends Omit<React.ComponentPropsWithRef<'textare
|
|
|
25
25
|
* Optional class for styling purpose
|
|
26
26
|
*/
|
|
27
27
|
className?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Show count of characters
|
|
30
|
+
*/
|
|
31
|
+
showCounter?: boolean;
|
|
28
32
|
}
|
|
29
33
|
/**
|
|
30
34
|
* TextArea Form Component
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef } from "react";
|
|
1
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useState } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { useFormControl } from "../Form/FormContext.js";
|
|
5
|
+
import Textcounter from "../TextCounter/TextCounter.js";
|
|
5
6
|
const TextArea = /* @__PURE__ */ forwardRef(({
|
|
6
7
|
noValidationIcon,
|
|
7
8
|
placeholder,
|
|
8
9
|
size = "md",
|
|
9
10
|
height = "md",
|
|
10
11
|
className,
|
|
12
|
+
showCounter = !1,
|
|
11
13
|
...restProps
|
|
12
14
|
}, ref) => {
|
|
15
|
+
var _a;
|
|
13
16
|
const {
|
|
14
17
|
id,
|
|
15
18
|
isRequired,
|
|
16
19
|
isReadOnly,
|
|
17
20
|
status
|
|
18
|
-
} = useFormControl(), classes = clsx({
|
|
21
|
+
} = useFormControl(), [currentLength, setCurrentLength] = useState(((_a = restProps.defaultValue) == null ? void 0 : _a.toString().length) || 0), classes = clsx({
|
|
19
22
|
"form-control": !isReadOnly,
|
|
20
23
|
"form-control-lg": size === "lg",
|
|
21
24
|
"form-control-sm": size === "sm",
|
|
@@ -27,7 +30,13 @@ const TextArea = /* @__PURE__ */ forwardRef(({
|
|
|
27
30
|
"form-control-plaintext": isReadOnly,
|
|
28
31
|
"no-validation-icon": noValidationIcon
|
|
29
32
|
}, className);
|
|
30
|
-
return /* @__PURE__ */
|
|
33
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
34
|
+
/* @__PURE__ */ jsx("textarea", { ref, id, className: classes, placeholder, required: isRequired, readOnly: isReadOnly, ...restProps, onChange: (e) => {
|
|
35
|
+
var _a2;
|
|
36
|
+
setCurrentLength(e.target.value.length), (_a2 = restProps.onChange) == null || _a2.call(restProps, e);
|
|
37
|
+
} }),
|
|
38
|
+
showCounter && !status && /* @__PURE__ */ jsx(Textcounter, { currentLength, maxLength: restProps.maxLength ?? 0 })
|
|
39
|
+
] });
|
|
31
40
|
});
|
|
32
41
|
export {
|
|
33
42
|
TextArea as default
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface TextcounterProps {
|
|
2
|
+
/**
|
|
3
|
+
* The current number of characters in the text input
|
|
4
|
+
*/
|
|
5
|
+
currentLength: number;
|
|
6
|
+
/**
|
|
7
|
+
* The maximum number of characters allowed in the text input
|
|
8
|
+
*/
|
|
9
|
+
maxLength: number;
|
|
10
|
+
}
|
|
11
|
+
declare const Textcounter: {
|
|
12
|
+
({ currentLength, maxLength }: TextcounterProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
15
|
+
export default Textcounter;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsxs } from "react/jsx-runtime";
|
|
2
|
+
import clsx from "clsx";
|
|
3
|
+
const Textcounter = ({
|
|
4
|
+
currentLength,
|
|
5
|
+
maxLength
|
|
6
|
+
}) => /* @__PURE__ */ jsxs("span", { className: clsx("caption text-end float-end mt-n32 py-2 px-12 ", {
|
|
7
|
+
"text-danger": currentLength === maxLength,
|
|
8
|
+
"text-gray-700": currentLength !== maxLength
|
|
9
|
+
}), children: [
|
|
10
|
+
currentLength,
|
|
11
|
+
" / ",
|
|
12
|
+
maxLength
|
|
13
|
+
] });
|
|
14
|
+
export {
|
|
15
|
+
Textcounter as default
|
|
16
|
+
};
|
package/dist/index.js
CHANGED
|
@@ -31,76 +31,77 @@ import { default as default31 } from "./components/Logo/Logo.js";
|
|
|
31
31
|
import { default as default32 } from "./components/Modal/Modal.js";
|
|
32
32
|
import { default as default33 } from "./components/PreventPropagation/PreventPropagation.js";
|
|
33
33
|
import { default as default34 } from "./components/Radio/Radio.js";
|
|
34
|
-
import { default as default35 } from "./components/
|
|
35
|
-
import { default as default36 } from "./components/
|
|
36
|
-
import { default as default37 } from "./components/
|
|
37
|
-
import { default as default38 } from "./components/Skeleton/
|
|
38
|
-
import { default as default39 } from "./components/
|
|
39
|
-
import { default as default40 } from "./components/
|
|
40
|
-
import { default as default41 } from "./components/
|
|
41
|
-
import { default as default42 } from "./components/
|
|
42
|
-
import { default as default43 } from "./components/
|
|
43
|
-
import { default as default44 } from "./components/
|
|
34
|
+
import { default as default35 } from "./components/RadioCard/RadioCard.js";
|
|
35
|
+
import { default as default36 } from "./components/SearchBar/SearchBar.js";
|
|
36
|
+
import { default as default37 } from "./components/Select/Select.js";
|
|
37
|
+
import { default as default38 } from "./components/Skeleton/ButtonSkeleton.js";
|
|
38
|
+
import { default as default39 } from "./components/Skeleton/TextSkeleton.js";
|
|
39
|
+
import { default as default40 } from "./components/StackedGroup/StackedGroup.js";
|
|
40
|
+
import { default as default41 } from "./components/Stepper/Stepper.js";
|
|
41
|
+
import { default as default42 } from "./components/Switch/Switch.js";
|
|
42
|
+
import { default as default43 } from "./components/Table/components/Table.js";
|
|
43
|
+
import { default as default44 } from "./components/TextArea/TextArea.js";
|
|
44
|
+
import { default as default45 } from "./components/Tooltip/Tooltip.js";
|
|
44
45
|
import { DndTree } from "./components/Tree/components/DndTree.js";
|
|
45
|
-
import { default as
|
|
46
|
-
import { default as
|
|
47
|
-
import { default as
|
|
48
|
-
import { default as
|
|
49
|
-
import { default as
|
|
50
|
-
import { default as
|
|
51
|
-
import { default as
|
|
52
|
-
import { default as
|
|
53
|
-
import { default as
|
|
54
|
-
import { default as
|
|
55
|
-
import { default as
|
|
56
|
-
import { default as
|
|
57
|
-
import { default as
|
|
58
|
-
import { default as
|
|
59
|
-
import { default as
|
|
60
|
-
import { default as
|
|
61
|
-
import { default as
|
|
62
|
-
import { default as
|
|
46
|
+
import { default as default46 } from "./components/Tree/components/SortableTree.js";
|
|
47
|
+
import { default as default47 } from "./components/Tree/components/Tree.js";
|
|
48
|
+
import { default as default48 } from "./components/TreeView/TreeView.js";
|
|
49
|
+
import { default as default49 } from "./components/VisuallyHidden/VisuallyHidden.js";
|
|
50
|
+
import { default as default50 } from "./hooks/useBookmark/useBookmark.js";
|
|
51
|
+
import { default as default51 } from "./hooks/useBreakpoint/useBreakpoint.js";
|
|
52
|
+
import { default as default52 } from "./hooks/useBrowserInfo/useBrowserInfo.js";
|
|
53
|
+
import { default as default53 } from "./hooks/useCantoo/useCantoo.js";
|
|
54
|
+
import { default as default54 } from "./hooks/useClickOutside/useClickOutside.js";
|
|
55
|
+
import { default as default55 } from "./hooks/useConversation/useConversation.js";
|
|
56
|
+
import { default as default56 } from "./hooks/useDate/useDate.js";
|
|
57
|
+
import { default as default57 } from "./hooks/useDebounce/useDebounce.js";
|
|
58
|
+
import { default as default58 } from "./hooks/useDirectory/useDirectory.js";
|
|
59
|
+
import { default as default59 } from "./hooks/useDropdown/useDropdown.js";
|
|
60
|
+
import { default as default60 } from "./hooks/useDropzone/useDropzone.js";
|
|
61
|
+
import { default as default61 } from "./hooks/useEdificeIcons/useEdificeIcons.js";
|
|
62
|
+
import { default as default62 } from "./hooks/useHasWorkflow/useHasWorkflow.js";
|
|
63
|
+
import { default as default63 } from "./hooks/useHover/useHover.js";
|
|
63
64
|
import { useHttpErrorToast } from "./hooks/useHttpErrorToast/useHttpErrorToast.js";
|
|
64
|
-
import { default as
|
|
65
|
-
import { default as
|
|
66
|
-
import { default as
|
|
67
|
-
import { default as
|
|
68
|
-
import { default as
|
|
69
|
-
import { default as
|
|
70
|
-
import { default as
|
|
71
|
-
import { default as
|
|
72
|
-
import { default as
|
|
73
|
-
import { default as
|
|
74
|
-
import { default as
|
|
75
|
-
import { default as
|
|
76
|
-
import { default as
|
|
77
|
-
import { default as
|
|
78
|
-
import { default as
|
|
79
|
-
import { default as
|
|
80
|
-
import { default as
|
|
81
|
-
import { default as
|
|
82
|
-
import { WORKSPACE_SHARED_FOLDER_ID, WORKSPACE_USER_FOLDER_ID, default as
|
|
83
|
-
import { default as
|
|
84
|
-
import { default as
|
|
85
|
-
import { default as
|
|
86
|
-
import { default as
|
|
87
|
-
import { default as
|
|
88
|
-
import { default as
|
|
89
|
-
import { default as
|
|
90
|
-
import { default as
|
|
91
|
-
import { default as
|
|
92
|
-
import { default as
|
|
93
|
-
import { default as
|
|
94
|
-
import { default as
|
|
95
|
-
import { default as
|
|
96
|
-
import { default as
|
|
97
|
-
import { default as
|
|
98
|
-
import { default as
|
|
99
|
-
import { default as
|
|
100
|
-
import { default as
|
|
101
|
-
import { default as
|
|
102
|
-
import { default as
|
|
103
|
-
import { default as
|
|
65
|
+
import { default as default64 } from "./hooks/useImage/useImage.js";
|
|
66
|
+
import { default as default65 } from "./hooks/useIsAdml/useIsAdml.js";
|
|
67
|
+
import { default as default66 } from "./hooks/useIsAdmc/useIsAdmc.js";
|
|
68
|
+
import { default as default67 } from "./hooks/useIsAdmlcOrAdmc/useIsAdmlcOrAdmc.js";
|
|
69
|
+
import { default as default68 } from "./hooks/useKeyPress/useKeyPress.js";
|
|
70
|
+
import { default as default69 } from "./hooks/useLibraryUrl/useLibraryUrl.js";
|
|
71
|
+
import { default as default70 } from "./hooks/useMediaLibrary/useMediaLibrary.js";
|
|
72
|
+
import { default as default71 } from "./hooks/useScrollToTop/useScrollToTop.js";
|
|
73
|
+
import { default as default72 } from "./hooks/useTitle/useTitle.js";
|
|
74
|
+
import { default as default73 } from "./hooks/useToast/useToast.js";
|
|
75
|
+
import { default as default74 } from "./hooks/useToggle/useToggle.js";
|
|
76
|
+
import { default as default75 } from "./hooks/useTrapFocus/useTrapFocus.js";
|
|
77
|
+
import { default as default76 } from "./hooks/useTrashedResource/useTrashedResource.js";
|
|
78
|
+
import { default as default77 } from "./hooks/useUpload/useUpload.js";
|
|
79
|
+
import { default as default78 } from "./hooks/useUploadFiles/useUploadFiles.js";
|
|
80
|
+
import { default as default79 } from "./hooks/useUser/useUser.js";
|
|
81
|
+
import { default as default80 } from "./hooks/useWorkspaceFile/useWorkspaceFile.js";
|
|
82
|
+
import { default as default81 } from "./hooks/useWorkspaceFolders/useWorkspaceFolders.js";
|
|
83
|
+
import { WORKSPACE_SHARED_FOLDER_ID, WORKSPACE_USER_FOLDER_ID, default as default82 } from "./hooks/useWorkspaceFolders/useWorkspaceFoldersTree.js";
|
|
84
|
+
import { default as default83 } from "./hooks/useWorkspaceSearch/useWorkspaceSearch.js";
|
|
85
|
+
import { default as default84 } from "./hooks/useXitiTrackPageLoad/useXitiTrackPageLoad.js";
|
|
86
|
+
import { default as default85 } from "./hooks/useZendeskGuide/useZendeskGuide.js";
|
|
87
|
+
import { default as default86 } from "./modules/modals/ConfirmModal/ConfirmModal.js";
|
|
88
|
+
import { default as default87 } from "./modules/modals/OnboardingModal/OnboardingModal.js";
|
|
89
|
+
import { default as default88 } from "./modules/modals/PublishModal/PublishModal.js";
|
|
90
|
+
import { default as default89 } from "./modules/modals/ResourceModal/apps/BlogPublic.js";
|
|
91
|
+
import { default as default90 } from "./modules/modals/ResourceModal/hooks/useUpdateMutation.js";
|
|
92
|
+
import { default as default91 } from "./modules/modals/ShareModal/ShareModal.js";
|
|
93
|
+
import { default as default92 } from "./modules/modals/ShareModal/apps/ShareBlog.js";
|
|
94
|
+
import { default as default93 } from "./modules/modals/ShareModal/hooks/useShareMutation.js";
|
|
95
|
+
import { default as default94 } from "./modules/multimedia/AudioRecorder/AudioRecorder.js";
|
|
96
|
+
import { default as default95 } from "./modules/multimedia/Embed/Embed.js";
|
|
97
|
+
import { default as default96 } from "./modules/multimedia/ImageEditor/components/ImageEditor.js";
|
|
98
|
+
import { default as default97 } from "./modules/multimedia/ImagePicker/ImagePicker.js";
|
|
99
|
+
import { default as default98 } from "./modules/multimedia/FileCard/FileCard.js";
|
|
100
|
+
import { default as default99 } from "./modules/multimedia/MediaLibrary/MediaLibrary.js";
|
|
101
|
+
import { default as default100 } from "./modules/multimedia/VideoEmbed/VideoEmbed.js";
|
|
102
|
+
import { default as default101 } from "./modules/multimedia/VideoRecorder/VideoRecorder.js";
|
|
103
|
+
import { default as default102 } from "./modules/multimedia/Workspace/Workspace.js";
|
|
104
|
+
import { default as default103 } from "./modules/multimedia/WorkspaceFolders/WorkspaceFolders.js";
|
|
104
105
|
import { AccessiblePalette, DefaultPalette } from "./components/ColorPicker/ColorPalette.js";
|
|
105
106
|
import { DropzoneContext, useDropzoneContext } from "./components/Dropzone/DropzoneContext.js";
|
|
106
107
|
import { Column, Grid } from "./components/Grid/Grid.js";
|
|
@@ -136,21 +137,21 @@ export {
|
|
|
136
137
|
default4 as AppHeader,
|
|
137
138
|
default5 as AppIcon,
|
|
138
139
|
default6 as Attachment,
|
|
139
|
-
|
|
140
|
+
default94 as AudioRecorder,
|
|
140
141
|
default7 as Avatar,
|
|
141
142
|
default8 as AvatarGroup,
|
|
142
143
|
default9 as Badge,
|
|
143
|
-
|
|
144
|
+
default89 as BlogPublic,
|
|
144
145
|
default10 as Breadcrumb,
|
|
145
146
|
default11 as Button,
|
|
146
|
-
|
|
147
|
+
default38 as ButtonSkeleton,
|
|
147
148
|
default14 as Card,
|
|
148
149
|
default15 as Checkbox,
|
|
149
150
|
default16 as ColorPicker,
|
|
150
151
|
default17 as ColorPickerItem,
|
|
151
152
|
Column,
|
|
152
153
|
default18 as Combobox,
|
|
153
|
-
|
|
154
|
+
default86 as ConfirmModal,
|
|
154
155
|
DefaultPalette,
|
|
155
156
|
DndTree,
|
|
156
157
|
default19 as Dropdown,
|
|
@@ -160,10 +161,10 @@ export {
|
|
|
160
161
|
EdificeClientProvider,
|
|
161
162
|
EdificeThemeContext,
|
|
162
163
|
EdificeThemeProvider,
|
|
163
|
-
|
|
164
|
+
default95 as Embed,
|
|
164
165
|
default21 as EmptyScreen,
|
|
165
166
|
ExternalLinker,
|
|
166
|
-
|
|
167
|
+
default98 as FileCard,
|
|
167
168
|
default22 as Flex,
|
|
168
169
|
default24 as FormControl,
|
|
169
170
|
default23 as FormText,
|
|
@@ -171,8 +172,8 @@ export {
|
|
|
171
172
|
default25 as Heading,
|
|
172
173
|
default12 as IconButton,
|
|
173
174
|
default26 as Image,
|
|
174
|
-
|
|
175
|
-
|
|
175
|
+
default96 as ImageEditor,
|
|
176
|
+
default97 as ImagePicker,
|
|
176
177
|
default27 as Input,
|
|
177
178
|
InternalLinker,
|
|
178
179
|
default28 as Label,
|
|
@@ -181,45 +182,46 @@ export {
|
|
|
181
182
|
default29 as Loading,
|
|
182
183
|
default30 as LoadingScreen,
|
|
183
184
|
default31 as Logo,
|
|
184
|
-
|
|
185
|
+
default99 as MediaLibrary,
|
|
185
186
|
Menu,
|
|
186
187
|
MockedProvider,
|
|
187
188
|
default32 as Modal,
|
|
188
|
-
|
|
189
|
+
default87 as OnboardingModal,
|
|
189
190
|
Popover,
|
|
190
191
|
PopoverBody,
|
|
191
192
|
PopoverFooter,
|
|
192
193
|
PopoverHeader,
|
|
193
194
|
default33 as PreventPropagation,
|
|
194
|
-
|
|
195
|
+
default88 as PublishModal,
|
|
195
196
|
default34 as Radio,
|
|
197
|
+
default35 as RadioCard,
|
|
196
198
|
ResourceModal,
|
|
197
|
-
|
|
199
|
+
default36 as SearchBar,
|
|
198
200
|
default13 as SearchButton,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
201
|
+
default37 as Select,
|
|
202
|
+
default92 as ShareBlog,
|
|
203
|
+
default91 as ShareModal,
|
|
204
|
+
default46 as SortableTree,
|
|
205
|
+
default40 as StackedGroup,
|
|
206
|
+
default41 as Stepper,
|
|
207
|
+
default42 as Switch,
|
|
208
|
+
default43 as Table,
|
|
207
209
|
Tabs,
|
|
208
|
-
|
|
209
|
-
|
|
210
|
+
default44 as TextArea,
|
|
211
|
+
default39 as TextSkeleton,
|
|
210
212
|
Toolbar,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
+
default45 as Tooltip,
|
|
214
|
+
default47 as Tree,
|
|
213
215
|
TreeNode,
|
|
214
216
|
TreeNodeFolderWrapper,
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
217
|
+
default48 as TreeView,
|
|
218
|
+
default100 as VideoEmbed,
|
|
219
|
+
default101 as VideoRecorder,
|
|
220
|
+
default49 as VisuallyHidden,
|
|
219
221
|
WORKSPACE_SHARED_FOLDER_ID,
|
|
220
222
|
WORKSPACE_USER_FOLDER_ID,
|
|
221
|
-
|
|
222
|
-
|
|
223
|
+
default102 as Workspace,
|
|
224
|
+
default103 as WorkspaceFolders,
|
|
223
225
|
addNode,
|
|
224
226
|
arrayUnique,
|
|
225
227
|
buildTree,
|
|
@@ -247,50 +249,50 @@ export {
|
|
|
247
249
|
setRef,
|
|
248
250
|
updateNode,
|
|
249
251
|
updateParentIds,
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
default50 as useBookmark,
|
|
253
|
+
default51 as useBreakpoint,
|
|
254
|
+
default52 as useBrowserInfo,
|
|
255
|
+
default53 as useCantoo,
|
|
254
256
|
useCheckable,
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
257
|
+
default54 as useClickOutside,
|
|
258
|
+
default55 as useConversation,
|
|
259
|
+
default56 as useDate,
|
|
260
|
+
default57 as useDebounce,
|
|
261
|
+
default58 as useDirectory,
|
|
262
|
+
default59 as useDropdown,
|
|
263
|
+
default60 as useDropzone,
|
|
262
264
|
useDropzoneContext,
|
|
263
265
|
useEdificeClient,
|
|
264
|
-
|
|
266
|
+
default61 as useEdificeIcons,
|
|
265
267
|
useEdificeTheme,
|
|
266
|
-
|
|
267
|
-
|
|
268
|
+
default62 as useHasWorkflow,
|
|
269
|
+
default63 as useHover,
|
|
268
270
|
useHttpErrorToast,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
271
|
+
default64 as useImage,
|
|
272
|
+
default66 as useIsAdmc,
|
|
273
|
+
default65 as useIsAdml,
|
|
274
|
+
default67 as useIsAdmlcOrAdmc,
|
|
275
|
+
default68 as useKeyPress,
|
|
276
|
+
default69 as useLibraryUrl,
|
|
277
|
+
default70 as useMediaLibrary,
|
|
278
|
+
default71 as useScrollToTop,
|
|
279
|
+
default93 as useShareMutation,
|
|
280
|
+
default72 as useTitle,
|
|
281
|
+
default73 as useToast,
|
|
282
|
+
default74 as useToggle,
|
|
283
|
+
default75 as useTrapFocus,
|
|
284
|
+
default76 as useTrashedResource,
|
|
283
285
|
useTreeSortable,
|
|
284
286
|
useTreeView,
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
287
|
+
default90 as useUpdateMutation,
|
|
288
|
+
default77 as useUpload,
|
|
289
|
+
default78 as useUploadFiles,
|
|
290
|
+
default79 as useUser,
|
|
291
|
+
default80 as useWorkspaceFile,
|
|
292
|
+
default81 as useWorkspaceFolders,
|
|
293
|
+
default82 as useWorkspaceFoldersTree,
|
|
294
|
+
default83 as useWorkspaceSearch,
|
|
295
|
+
default84 as useXitiTrackPageLoad,
|
|
296
|
+
default85 as useZendeskGuide,
|
|
295
297
|
wrapTreeNode
|
|
296
298
|
};
|
|
@@ -69,7 +69,9 @@ const DeleteModal = /* @__PURE__ */ lazy(() => import("./DeleteModal.js")), Comm
|
|
|
69
69
|
] })
|
|
70
70
|
] })
|
|
71
71
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
72
|
-
/* @__PURE__ */ jsx("div", { className: "mt-8 mb-4",
|
|
72
|
+
/* @__PURE__ */ jsx("div", { className: "mt-8 mb-4", style: {
|
|
73
|
+
whiteSpace: "pre-line"
|
|
74
|
+
}, children: content }),
|
|
73
75
|
type === "edit" && /* @__PURE__ */ jsxs("div", { className: "ms-n8", children: [
|
|
74
76
|
!replyTo && /* @__PURE__ */ jsx(Button, { variant: "ghost", color: "tertiary", size: "sm", onClick: () => handleReplyToComment(comment.id), children: t("comment.reply") }),
|
|
75
77
|
userId === authorId && /* @__PURE__ */ jsx(Button, { variant: "ghost", color: "tertiary", size: "sm", onClick: () => {
|
|
@@ -4,7 +4,6 @@ import { odeServices } from "@edifice.io/client";
|
|
|
4
4
|
import { createPortal } from "react-dom";
|
|
5
5
|
import { useForm } from "react-hook-form";
|
|
6
6
|
import { useTranslation } from "react-i18next";
|
|
7
|
-
import { TextareaCounter } from "../../../components/TextArea/TextareaCounter.js";
|
|
8
7
|
import ImagePicker from "../../multimedia/ImagePicker/ImagePicker.js";
|
|
9
8
|
import { useThumb } from "./hooks/useThumb.js";
|
|
10
9
|
import { useEdificeClient } from "../../../providers/EdificeClientProvider/EdificeClientProvider.hook.js";
|
|
@@ -67,7 +66,7 @@ const DEFAULT_INPUT_MAX_LENGTH = 60, DEFAULT_TEXTAREA_MAX_LENGTH = 400, Resource
|
|
|
67
66
|
} = useThumb({
|
|
68
67
|
isUpdating,
|
|
69
68
|
selectedResource: isUpdating ? resource : void 0
|
|
70
|
-
}),
|
|
69
|
+
}), onSubmit = async function(formData) {
|
|
71
70
|
var _a2, _b2;
|
|
72
71
|
try {
|
|
73
72
|
const data = {
|
|
@@ -132,15 +131,14 @@ const DEFAULT_INPUT_MAX_LENGTH = 60, DEFAULT_TEXTAREA_MAX_LENGTH = 400, Resource
|
|
|
132
131
|
value: /[^ ]/,
|
|
133
132
|
message: "invalid title"
|
|
134
133
|
}
|
|
135
|
-
}), placeholder: ((_e = customT.placeholder) == null ? void 0 : _e.title) ?? t("explorer.resource.editModal.title.placeholder"), size: "md", "aria-required": !0, maxLength: inputMaxLength })
|
|
134
|
+
}), placeholder: ((_e = customT.placeholder) == null ? void 0 : _e.title) ?? t("explorer.resource.editModal.title.placeholder"), size: "md", "aria-required": !0, maxLength: inputMaxLength, showCounter: !0 })
|
|
136
135
|
] }),
|
|
137
136
|
/* @__PURE__ */ jsxs(FormControl, { id: "description", isOptional: !0, children: [
|
|
138
137
|
/* @__PURE__ */ jsx(Label, { children: customT.description ?? t("description") }),
|
|
139
138
|
/* @__PURE__ */ jsx(TextArea, { defaultValue: (resource == null ? void 0 : resource.description) || "", ...register("description", {
|
|
140
139
|
required: !1,
|
|
141
140
|
maxLength: textareaMaxLength
|
|
142
|
-
}), placeholder: ((_f = customT.placeholder) == null ? void 0 : _f.description) ?? t("explorer.resource.editModal.description.placeholder"), size: "md", maxLength: textareaMaxLength })
|
|
143
|
-
watchedDescription && /* @__PURE__ */ jsx(TextareaCounter, { content: watchedDescription, maxLength: textareaMaxLength })
|
|
141
|
+
}), placeholder: ((_f = customT.placeholder) == null ? void 0 : _f.description) ?? t("explorer.resource.editModal.description.placeholder"), size: "md", maxLength: textareaMaxLength, showCounter: !0 })
|
|
144
142
|
] })
|
|
145
143
|
] })
|
|
146
144
|
] }),
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMediaLibraryContext } from "../MediaLibraryContext.js";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
4
|
+
import Alert from "../../../../components/Alert/Alert.js";
|
|
3
5
|
import Dropzone from "../../../../components/Dropzone/Dropzone.js";
|
|
4
6
|
import UploadFiles from "../../UploadFiles/UploadFiles.js";
|
|
5
7
|
const acceptedTypes = (type) => {
|
|
@@ -18,6 +20,8 @@ const acceptedTypes = (type) => {
|
|
|
18
20
|
return acceptedTypes2;
|
|
19
21
|
}, Upload = () => {
|
|
20
22
|
const {
|
|
23
|
+
t
|
|
24
|
+
} = useTranslation(), {
|
|
21
25
|
type,
|
|
22
26
|
visibility,
|
|
23
27
|
multiple,
|
|
@@ -27,7 +31,10 @@ const acceptedTypes = (type) => {
|
|
|
27
31
|
} = useMediaLibraryContext(), handleOnFilesChange = (uploadedFiles) => {
|
|
28
32
|
uploadedFiles.length ? (setCancellable(uploadedFiles), setResultCounter(uploadedFiles.length), setResult(uploadedFiles)) : (setCancellable([]), setResultCounter(void 0), setResult(void 0));
|
|
29
33
|
};
|
|
30
|
-
return /* @__PURE__ */
|
|
34
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex-grow-1", children: [
|
|
35
|
+
multiple && /* @__PURE__ */ jsx(Alert, { type: "info", className: "flex-shrink-0 mb-16", children: t("bbm.upload.alert") }),
|
|
36
|
+
/* @__PURE__ */ jsx(Dropzone, { multiple, accept: acceptedTypes(type ?? "embedder"), children: /* @__PURE__ */ jsx(UploadFiles, { onFilesChange: handleOnFilesChange, visibility }) })
|
|
37
|
+
] });
|
|
31
38
|
};
|
|
32
39
|
export {
|
|
33
40
|
Upload
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0-develop-b2school.20251110143752",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -131,9 +131,9 @@
|
|
|
131
131
|
"react-slugify": "^3.0.3",
|
|
132
132
|
"swiper": "^10.1.0",
|
|
133
133
|
"ua-parser-js": "^1.0.36",
|
|
134
|
-
"@edifice.io/bootstrap": "2.
|
|
135
|
-
"@edifice.io/tiptap-extensions": "2.
|
|
136
|
-
"@edifice.io/utilities": "2.
|
|
134
|
+
"@edifice.io/bootstrap": "2.5.0-develop-b2school.20251110143752",
|
|
135
|
+
"@edifice.io/tiptap-extensions": "2.5.0-develop-b2school.20251110143752",
|
|
136
|
+
"@edifice.io/utilities": "2.5.0-develop-b2school.20251110143752"
|
|
137
137
|
},
|
|
138
138
|
"devDependencies": {
|
|
139
139
|
"@babel/plugin-transform-react-pure-annotations": "^7.23.3",
|
|
@@ -164,8 +164,8 @@
|
|
|
164
164
|
"vite": "^5.4.11",
|
|
165
165
|
"vite-plugin-dts": "^4.1.0",
|
|
166
166
|
"vite-tsconfig-paths": "^5.0.1",
|
|
167
|
-
"@edifice.io/
|
|
168
|
-
"@edifice.io/
|
|
167
|
+
"@edifice.io/client": "2.5.0-develop-b2school.20251110143752",
|
|
168
|
+
"@edifice.io/config": "2.5.0-develop-b2school.20251110143752"
|
|
169
169
|
},
|
|
170
170
|
"peerDependencies": {
|
|
171
171
|
"@react-spring/web": "^9.7.5",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
const TextareaCounter = ({
|
|
3
|
-
content,
|
|
4
|
-
maxLength
|
|
5
|
-
}) => /* @__PURE__ */ jsx("p", { className: "small text-gray-700 p-2 text-end", children: content ? `${content.length} / ${maxLength}` : "" });
|
|
6
|
-
export {
|
|
7
|
-
TextareaCounter
|
|
8
|
-
};
|