@edifice.io/react 2.5.6 → 2.5.8-develop-b2school.20260123114940
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/_virtual/_commonjsHelpers.js +8 -0
- package/dist/_virtual/common.js +4 -0
- package/dist/_virtual/de_DE.js +4 -0
- package/dist/_virtual/de_DE2.js +4 -0
- package/dist/_virtual/de_DE3.js +4 -0
- package/dist/_virtual/de_DE4.js +4 -0
- package/dist/_virtual/de_DE5.js +4 -0
- package/dist/_virtual/de_DE6.js +4 -0
- package/dist/_virtual/defineProperty.js +4 -0
- package/dist/_virtual/es_ES.js +4 -0
- package/dist/_virtual/es_ES2.js +4 -0
- package/dist/_virtual/es_ES3.js +4 -0
- package/dist/_virtual/es_ES4.js +4 -0
- package/dist/_virtual/es_ES5.js +4 -0
- package/dist/_virtual/es_ES6.js +4 -0
- package/dist/_virtual/fr_FR.js +4 -0
- package/dist/_virtual/fr_FR2.js +4 -0
- package/dist/_virtual/fr_FR3.js +4 -0
- package/dist/_virtual/fr_FR4.js +4 -0
- package/dist/_virtual/fr_FR5.js +4 -0
- package/dist/_virtual/fr_FR6.js +4 -0
- package/dist/_virtual/interopRequireDefault.js +4 -0
- package/dist/_virtual/it_IT.js +4 -0
- package/dist/_virtual/it_IT2.js +4 -0
- package/dist/_virtual/it_IT3.js +4 -0
- package/dist/_virtual/it_IT4.js +4 -0
- package/dist/_virtual/it_IT5.js +4 -0
- package/dist/_virtual/it_IT6.js +4 -0
- package/dist/_virtual/localeData.js +4 -0
- package/dist/_virtual/objectSpread2.js +4 -0
- package/dist/_virtual/pt_PT.js +4 -0
- package/dist/_virtual/pt_PT2.js +4 -0
- package/dist/_virtual/pt_PT3.js +4 -0
- package/dist/_virtual/pt_PT4.js +4 -0
- package/dist/_virtual/pt_PT5.js +4 -0
- package/dist/_virtual/pt_PT6.js +4 -0
- package/dist/_virtual/toPrimitive.js +4 -0
- package/dist/_virtual/toPropertyKey.js +4 -0
- package/dist/_virtual/typeof.js +4 -0
- package/dist/_virtual/weekday.js +4 -0
- package/dist/components/AppIcon/index.d.ts +1 -0
- package/dist/components/Badge/Badge.d.ts +12 -1
- package/dist/components/Badge/Badge.js +15 -2
- package/dist/components/Combobox/Combobox.js +1 -1
- package/dist/components/Combobox/ComboboxTrigger.js +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +57 -0
- package/dist/components/DatePicker/DatePicker.js +38 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/Divider/Divider.d.ts +38 -0
- package/dist/components/Divider/Divider.js +11 -0
- package/dist/components/Divider/index.d.ts +2 -0
- package/dist/components/Dropdown/DropdownContext.js +1 -1
- package/dist/components/Flex/Flex.js +1 -1
- package/dist/components/Form/FormContext.js +1 -1
- package/dist/components/Layout/Layout.js +1 -2
- package/dist/components/Menu/components/MenuButton.d.ts +2 -0
- package/dist/components/Menu/components/MenuButton.js +13 -4
- package/dist/components/Modal/Modal.d.ts +4 -0
- package/dist/components/Modal/Modal.js +13 -12
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +59 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +24 -0
- package/dist/components/SegmentedControl/index.d.ts +2 -0
- package/dist/components/Select/Select.d.ts +6 -2
- package/dist/components/Select/Select.js +10 -4
- package/dist/components/Toolbar/Toolbar.js +1 -1
- package/dist/components/index.d.ts +3 -0
- package/dist/editor.js +42 -38
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useConversation/useConversation.js +3 -1
- package/dist/hooks/useDropdown/useDropdown.js +1 -1
- package/dist/hooks/useDropzone/useDropzone.d.ts +2 -2
- package/dist/hooks/useDropzone/useDropzone.js +24 -4
- package/dist/hooks/useInfiniteScroll/index.d.ts +1 -0
- package/dist/hooks/useInfiniteScroll/useInfiniteScroll.d.ts +33 -0
- package/dist/hooks/useInfiniteScroll/useInfiniteScroll.js +20 -0
- package/dist/icons.js +318 -312
- package/dist/index.js +230 -212
- package/dist/modals.js +14 -12
- package/dist/modules/comments/components/Comment.js +8 -6
- package/dist/modules/comments/components/CommentDate.js +7 -10
- package/dist/modules/comments/components/CommentDeleted.js +1 -1
- package/dist/modules/comments/components/CommentForm.d.ts +1 -1
- package/dist/modules/comments/components/CommentForm.js +6 -6
- package/dist/modules/comments/components/CommentList.js +1 -1
- package/dist/modules/comments/components/CommentTitle.js +1 -1
- package/dist/modules/comments/components/DeleteModal.js +14 -8
- package/dist/modules/comments/provider/CommentProvider.js +4 -4
- package/dist/modules/comments/types.d.ts +3 -1
- package/dist/modules/editor/components/Editor/Editor.js +1 -1
- package/dist/modules/editor/components/Editor/EditorPreview.d.ts +14 -0
- package/dist/modules/editor/components/Editor/EditorPreview.js +56 -0
- package/dist/modules/editor/components/Editor/EditorPreviewSkeleton.d.ts +8 -0
- package/dist/modules/editor/components/Editor/EditorPreviewSkeleton.js +24 -0
- package/dist/modules/editor/components/Editor/index.d.ts +2 -0
- package/dist/modules/editor/components/Renderer/AttachmentRenderer.js +2 -2
- package/dist/modules/editor/hooks/useMediaLibraryEditor.js +4 -3
- package/dist/modules/editor/hooks/useTipTapEditor.js +4 -4
- package/dist/modules/icons/components/IconCalendarEdit.d.ts +7 -0
- package/dist/modules/icons/components/IconCalendarEdit.js +12 -0
- package/dist/modules/icons/components/IconClockAlert.d.ts +7 -0
- package/dist/modules/icons/components/IconClockAlert.js +17 -0
- package/dist/modules/icons/components/IconSubmitToValidate.d.ts +7 -0
- package/dist/modules/icons/components/IconSubmitToValidate.js +12 -0
- package/dist/modules/icons/components/index.d.ts +3 -0
- package/dist/modules/modals/OnboardingModal/OnboardingModal.js +5 -5
- package/dist/modules/modals/ResourceModal/ResourceModal.js +1 -2
- package/dist/modules/modals/ShareModal/ShareBookmark.d.ts +1 -1
- package/dist/modules/modals/ShareModal/ShareBookmark.js +6 -3
- package/dist/modules/modals/ShareModal/ShareBookmarkLine.js +4 -4
- package/dist/modules/modals/ShareModal/ShareModal.d.ts +1 -11
- package/dist/modules/modals/ShareModal/ShareModal.js +13 -105
- package/dist/modules/modals/ShareModal/ShareResources.d.ts +187 -0
- package/dist/modules/modals/ShareModal/ShareResources.js +148 -0
- package/dist/modules/modals/ShareModal/hooks/useSearch.d.ts +5 -3
- package/dist/modules/modals/ShareModal/hooks/useSearch.js +12 -16
- package/dist/modules/modals/ShareModal/hooks/useShare.d.ts +12 -5
- package/dist/modules/modals/ShareModal/hooks/useShare.js +20 -13
- 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 +3 -1
- package/dist/modules/multimedia/Linker/ExternalLinker/ExternalLinker.js +1 -2
- package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.js +1 -2
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +1 -1
- package/dist/modules/multimedia/MediaLibrary/index.d.ts +2 -0
- package/dist/modules/multimedia/MediaLibrary/innertabs/Upload.js +1 -1
- package/dist/modules/multimedia/index.d.ts +1 -0
- package/dist/multimedia.js +20 -14
- package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/defineProperty.js +18 -0
- package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/interopRequireDefault.js +13 -0
- package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/objectSpread2.js +31 -0
- package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/toPrimitive.js +20 -0
- package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/toPropertyKey.js +15 -0
- package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/typeof.js +16 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/calendar/locale/de_DE.js +11 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/calendar/locale/es_ES.js +11 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/calendar/locale/fr_FR.js +11 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/calendar/locale/it_IT.js +11 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/calendar/locale/pt_PT.js +11 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/date-picker/locale/de_DE.js +22 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/date-picker/locale/es_ES.js +22 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/date-picker/locale/fr_FR.js +27 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/date-picker/locale/it_IT.js +20 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/date-picker/locale/pt_PT.js +45 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/locale/de_DE.js +145 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/locale/es_ES.js +145 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/locale/fr_FR.js +144 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/locale/it_IT.js +156 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/locale/pt_PT.js +158 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/time-picker/locale/de_DE.js +10 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/time-picker/locale/es_ES.js +10 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/time-picker/locale/fr_FR.js +10 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/time-picker/locale/it_IT.js +10 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/time-picker/locale/pt_PT.js +10 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/locale/de_DE.js +8 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/locale/es_ES.js +8 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/locale/fr_FR.js +8 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/locale/it_IT.js +8 -0
- package/dist/node_modules/.pnpm/antd@5.29.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/locale/pt_PT.js +8 -0
- package/dist/node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/localeData.js +82 -0
- package/dist/node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/weekday.js +19 -0
- package/dist/node_modules/.pnpm/rc-pagination@5.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-pagination/lib/locale/de_DE.js +21 -0
- package/dist/node_modules/.pnpm/rc-pagination@5.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-pagination/lib/locale/es_ES.js +21 -0
- package/dist/node_modules/.pnpm/rc-pagination@5.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-pagination/lib/locale/fr_FR.js +21 -0
- package/dist/node_modules/.pnpm/rc-pagination@5.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-pagination/lib/locale/it_IT.js +21 -0
- package/dist/node_modules/.pnpm/rc-pagination@5.1.0_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-pagination/lib/locale/pt_PT.js +21 -0
- package/dist/node_modules/.pnpm/rc-picker@4.11.3_dayjs@1.11.19_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-picker/lib/locale/common.js +14 -0
- package/dist/node_modules/.pnpm/rc-picker@4.11.3_dayjs@1.11.19_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-picker/lib/locale/de_DE.js +37 -0
- package/dist/node_modules/.pnpm/rc-picker@4.11.3_dayjs@1.11.19_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-picker/lib/locale/es_ES.js +37 -0
- package/dist/node_modules/.pnpm/rc-picker@4.11.3_dayjs@1.11.19_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-picker/lib/locale/fr_FR.js +38 -0
- package/dist/node_modules/.pnpm/rc-picker@4.11.3_dayjs@1.11.19_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-picker/lib/locale/it_IT.js +37 -0
- package/dist/node_modules/.pnpm/rc-picker@4.11.3_dayjs@1.11.19_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/rc-picker/lib/locale/pt_PT.js +39 -0
- package/dist/providers/AntThemeProvider/AntProvider.d.ts +2 -2
- package/dist/providers/AntThemeProvider/AntProvider.js +19 -2
- package/dist/providers/AntThemeProvider/antThemeConfig.js +1 -2
- package/dist/style.css +1 -1
- package/dist/utilities/index.d.ts +1 -0
- package/dist/utilities/mime-types/index.d.ts +1 -0
- package/dist/utilities/mime-types/mime-types-utils.d.ts +1 -0
- package/dist/utilities/mime-types/mime-types-utils.js +4 -0
- package/dist/utilities/react-query/index.d.ts +1 -0
- package/dist/utilities/react-query/react-query-utils.d.ts +21 -0
- package/dist/utilities/react-query/react-query-utils.js +13 -0
- package/package.json +8 -7
- package/dist/modules/comments/components/CommentHeader.d.ts +0 -3
- package/dist/modules/comments/components/CommentHeader.js +0 -8
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple option for SegmentedControl
|
|
3
|
+
*/
|
|
4
|
+
export interface SegmentedOption {
|
|
5
|
+
/**
|
|
6
|
+
* Option label
|
|
7
|
+
*/
|
|
8
|
+
label: string;
|
|
9
|
+
/**
|
|
10
|
+
* Option value
|
|
11
|
+
*/
|
|
12
|
+
value: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* SegmentedControl component props
|
|
16
|
+
*
|
|
17
|
+
* Minimal interface that only exposes what is necessary.
|
|
18
|
+
* Ant Design implementation is hidden and no Ant Design-specific props are exposed.
|
|
19
|
+
* Standard HTML div attributes are supported (passed through to the underlying DOM element).
|
|
20
|
+
*/
|
|
21
|
+
export interface SegmentedControlProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
22
|
+
/**
|
|
23
|
+
* Segmented control options
|
|
24
|
+
*/
|
|
25
|
+
options: SegmentedOption[];
|
|
26
|
+
/**
|
|
27
|
+
* Selected value
|
|
28
|
+
*/
|
|
29
|
+
value?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Callback called when value changes
|
|
32
|
+
*/
|
|
33
|
+
onChange?: (value: string) => void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* SegmentedControl component
|
|
37
|
+
*
|
|
38
|
+
* Segmented control component for selecting between multiple options.
|
|
39
|
+
*
|
|
40
|
+
* **Note:** This component uses Ant Design's Segmented component internally.
|
|
41
|
+
* Only the props defined in SegmentedControlProps are allowed to prevent
|
|
42
|
+
* dependency on Ant Design-specific features. To replace the implementation,
|
|
43
|
+
* modify the component body below.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <SegmentedControl
|
|
48
|
+
* options={[
|
|
49
|
+
* { label: 'List', value: 'list' },
|
|
50
|
+
* { label: 'Kanban', value: 'kanban' },
|
|
51
|
+
* { label: 'Table', value: 'table' }
|
|
52
|
+
* ]}
|
|
53
|
+
* value={value}
|
|
54
|
+
* onChange={(val) => setValue(val)}
|
|
55
|
+
* />
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
declare const SegmentedControl: import('react').ForwardRefExoticComponent<SegmentedControlProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
59
|
+
export default SegmentedControl;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Segmented } from "antd";
|
|
4
|
+
const SegmentedControl = /* @__PURE__ */ forwardRef(({
|
|
5
|
+
options,
|
|
6
|
+
value,
|
|
7
|
+
onChange,
|
|
8
|
+
...htmlProps
|
|
9
|
+
}, ref) => {
|
|
10
|
+
const antProps = {
|
|
11
|
+
options: options.map((option) => ({
|
|
12
|
+
...option,
|
|
13
|
+
label: /* @__PURE__ */ jsx("span", { "data-testid": `segmented-option-${option.value}`, children: option.label })
|
|
14
|
+
})),
|
|
15
|
+
value,
|
|
16
|
+
onChange,
|
|
17
|
+
ref,
|
|
18
|
+
...htmlProps
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ jsx(Segmented, { ...antProps });
|
|
21
|
+
});
|
|
22
|
+
export {
|
|
23
|
+
SegmentedControl as default
|
|
24
|
+
};
|
|
@@ -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' | 'defaultValue'> {
|
|
18
18
|
/**
|
|
19
19
|
* Controlled value
|
|
20
20
|
*/
|
|
@@ -31,13 +31,17 @@ 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;
|
|
34
38
|
}
|
|
35
39
|
/**
|
|
36
40
|
*
|
|
37
41
|
* Select component is based on Dropdown Component. It extends `Dropdown` and `Dropdown.Trigger` props `block`, `overflow`, `icon`, `variant`, `size`, `disabled`
|
|
38
42
|
*/
|
|
39
43
|
declare const Select: {
|
|
40
|
-
({ selectedValue, icon, options, overflow, block, variant, size, disabled, placeholderOption, onValueChange, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
({ selectedValue, icon, options, overflow, block, variant, size, disabled, placeholderOption, onValueChange, defaultValue, }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
41
45
|
displayName: string;
|
|
42
46
|
};
|
|
43
47
|
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 SelectTrigger from "./SelectTrigger.js";
|
|
5
4
|
import Dropdown from "../Dropdown/Dropdown.js";
|
|
5
|
+
import SelectTrigger from "./SelectTrigger.js";
|
|
6
6
|
const Select = ({
|
|
7
7
|
selectedValue,
|
|
8
8
|
icon,
|
|
@@ -13,7 +13,8 @@ const Select = ({
|
|
|
13
13
|
size,
|
|
14
14
|
disabled,
|
|
15
15
|
placeholderOption,
|
|
16
|
-
onValueChange
|
|
16
|
+
onValueChange,
|
|
17
|
+
defaultValue
|
|
17
18
|
}) => {
|
|
18
19
|
const [localValue, setLocalValue] = useState(), {
|
|
19
20
|
t
|
|
@@ -25,10 +26,15 @@ const Select = ({
|
|
|
25
26
|
const value = typeof localValue == "object" ? localValue.value : localValue;
|
|
26
27
|
onValueChange == null || onValueChange(value);
|
|
27
28
|
}
|
|
28
|
-
}, [localValue])
|
|
29
|
+
}, [localValue]), useEffect(() => {
|
|
30
|
+
if (defaultValue) {
|
|
31
|
+
const foundOption = options.find((option) => (typeof option == "object" ? option.value : option) === defaultValue);
|
|
32
|
+
foundOption !== void 0 && setLocalValue(foundOption);
|
|
33
|
+
}
|
|
34
|
+
}, []);
|
|
29
35
|
const label = typeof localValue == "object" ? localValue.label : localValue, iconChange = typeof localValue == "object" ? localValue.icon : void 0;
|
|
30
36
|
return /* @__PURE__ */ jsxs(Dropdown, { overflow, block, children: [
|
|
31
|
-
/* @__PURE__ */ jsx(SelectTrigger, { icon: iconChange || icon, label: t(label || placeholderOption), variant, size, disabled }),
|
|
37
|
+
/* @__PURE__ */ jsx(SelectTrigger, { icon: iconChange || icon, label: /* @__PURE__ */ jsx("span", { className: "text-truncate", children: t(label || placeholderOption) }), variant, size, disabled }),
|
|
32
38
|
/* @__PURE__ */ jsx(Dropdown.Menu, { role: "listbox", children: options == null ? void 0 : options.map((option) => {
|
|
33
39
|
const value = typeof option == "object" ? option.value : option, label2 = typeof option == "object" ? option.label : option, icon2 = typeof option == "object" ? option.icon : void 0;
|
|
34
40
|
return /* @__PURE__ */ jsx(Dropdown.Item, { type: "action", onClick: () => setLocalValue(option), icon: icon2, children: label2 }, value);
|
|
@@ -2,11 +2,11 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef, useState, useRef, useEffect, createElement } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import useBreakpoint from "../../hooks/useBreakpoint/useBreakpoint.js";
|
|
5
|
-
import { mergeRefs } from "../../utilities/refs/ref.js";
|
|
6
5
|
import Tooltip from "../Tooltip/Tooltip.js";
|
|
7
6
|
import Button from "../Button/Button.js";
|
|
8
7
|
import Dropdown from "../Dropdown/Dropdown.js";
|
|
9
8
|
import IconButton from "../Button/IconButton.js";
|
|
9
|
+
import { mergeRefs } from "../../utilities/refs/ref.js";
|
|
10
10
|
const Toolbar = /* @__PURE__ */ forwardRef(({
|
|
11
11
|
items,
|
|
12
12
|
variant = "default",
|
|
@@ -12,6 +12,8 @@ export * from './Card';
|
|
|
12
12
|
export * from './Checkbox';
|
|
13
13
|
export * from './ColorPicker';
|
|
14
14
|
export * from './Combobox';
|
|
15
|
+
export * from './DatePicker';
|
|
16
|
+
export * from './Divider';
|
|
15
17
|
export * from './Dropdown';
|
|
16
18
|
export * from './Dropzone';
|
|
17
19
|
export * from './EmptyScreen';
|
|
@@ -34,6 +36,7 @@ export * from './PreventPropagation';
|
|
|
34
36
|
export * from './Radio';
|
|
35
37
|
export * from './RadioCard';
|
|
36
38
|
export * from './SearchBar';
|
|
39
|
+
export * from './SegmentedControl';
|
|
37
40
|
export * from './Select';
|
|
38
41
|
export * from './Skeleton';
|
|
39
42
|
export * from './StackedGroup';
|
package/dist/editor.js
CHANGED
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
import { EditorContent, Editor, useEditor } from "@tiptap/react";
|
|
2
2
|
import { default as default2 } from "@tiptap/starter-kit";
|
|
3
|
-
import { default as default3 } from "./modules/editor/components/
|
|
4
|
-
import { default as default4 } from "./modules/editor/components/
|
|
5
|
-
import { default as default5 } from "./modules/editor/components/
|
|
6
|
-
import { default as default6 } from "./modules/editor/components/
|
|
7
|
-
import { default as default7 } from "./modules/editor/components/
|
|
3
|
+
import { default as default3 } from "./modules/editor/components/NodeView/AttachmentNodeView.js";
|
|
4
|
+
import { default as default4 } from "./modules/editor/components/Renderer/AttachmentRenderer.js";
|
|
5
|
+
import { default as default5 } from "./modules/editor/components/NodeView/AudioNodeView.js";
|
|
6
|
+
import { default as default6 } from "./modules/editor/components/Renderer/AudioRenderer.js";
|
|
7
|
+
import { default as default7 } from "./modules/editor/components/BubbleMenuEditImage/BubbleMenuEditImage.js";
|
|
8
8
|
import { default as default8 } from "./modules/editor/components/NodeView/ConversationHistoryNodeView.js";
|
|
9
|
-
import { default as default9 } from "./modules/editor/components/
|
|
10
|
-
import { default as default10 } from "./modules/editor/components/
|
|
11
|
-
import { default as default11 } from "./modules/editor/components/
|
|
12
|
-
import { default as default12 } from "./modules/editor/components/
|
|
13
|
-
import { default as default13 } from "./modules/editor/components/
|
|
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/
|
|
17
|
-
import { default as default17 } from "./modules/editor/components/Renderer/
|
|
18
|
-
import { default as default18 } from "./modules/editor/components/
|
|
19
|
-
import { default as default19 } from "./modules/editor/components/
|
|
20
|
-
import { default as default20 } from "./modules/editor/components/
|
|
21
|
-
import { default as default21 } from "./modules/editor/components/
|
|
9
|
+
import { default as default9 } from "./modules/editor/components/Renderer/ConversationHistoryRenderer.js";
|
|
10
|
+
import { default as default10 } from "./modules/editor/components/Editor/Editor.js";
|
|
11
|
+
import { default as default11 } from "./modules/editor/components/Editor/EditorPreview.js";
|
|
12
|
+
import { default as default12 } from "./modules/editor/components/Editor/EditorPreviewSkeleton.js";
|
|
13
|
+
import { default as default13 } from "./modules/editor/components/Editor/EditorSkeleton.js";
|
|
14
|
+
import { default as default14 } from "./modules/editor/components/NodeView/IframeNodeView.js";
|
|
15
|
+
import { default as default15 } from "./modules/editor/components/NodeView/ImageNodeView.js";
|
|
16
|
+
import { default as default16 } from "./modules/editor/components/NodeView/InformationPaneNodeView.js";
|
|
17
|
+
import { default as default17 } from "./modules/editor/components/Renderer/InformationPaneRenderer.js";
|
|
18
|
+
import { default as default18 } from "./modules/editor/components/Toolbar/LinkToolbar.js";
|
|
19
|
+
import { default as default19 } from "./modules/editor/components/NodeView/LinkerNodeView.js";
|
|
20
|
+
import { default as default20 } from "./modules/editor/components/Renderer/LinkerRenderer.js";
|
|
21
|
+
import { default as default21 } from "./modules/editor/components/Renderer/MediaRenderer.js";
|
|
22
|
+
import { default as default22 } from "./modules/editor/components/Toolbar/TableToolbar.js";
|
|
23
|
+
import { default as default23 } from "./modules/editor/components/NodeView/VideoNodeView.js";
|
|
24
|
+
import { EditorContext, useEditorContext } from "./modules/editor/hooks/useEditorContext.js";
|
|
22
25
|
import { EditorToolbar } from "./modules/editor/components/EditorToolbar/EditorToolbar.js";
|
|
23
26
|
import { useActionOptions } from "./modules/editor/hooks/useActionOptions.js";
|
|
27
|
+
import { useCantooEditor } from "./modules/editor/hooks/useCantooEditor.js";
|
|
24
28
|
import { useCommentEditor } from "./modules/editor/hooks/useCommentEditor.js";
|
|
25
|
-
import { EditorContext, useEditorContext } from "./modules/editor/hooks/useEditorContext.js";
|
|
26
29
|
import { useImageModal } from "./modules/editor/hooks/useImageModal.js";
|
|
27
30
|
import { useImageSelection } from "./modules/editor/hooks/useImageSelection.js";
|
|
28
31
|
import { useLinkToolbar } from "./modules/editor/hooks/useLinkToolbar.js";
|
|
@@ -32,32 +35,33 @@ import { useResizeMedia } from "./modules/editor/hooks/useResizeMedia.js";
|
|
|
32
35
|
import { useSpeechRecognition } from "./modules/editor/hooks/useSpeechRecognition.js";
|
|
33
36
|
import { useSpeechSynthetisis } from "./modules/editor/hooks/useSpeechSynthetisis.js";
|
|
34
37
|
import { useTipTapEditor } from "./modules/editor/hooks/useTipTapEditor.js";
|
|
35
|
-
import { useCantooEditor } from "./modules/editor/hooks/useCantooEditor.js";
|
|
36
38
|
export {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
default3 as AttachmentNodeView,
|
|
40
|
+
default4 as AttachmentRenderer,
|
|
41
|
+
default5 as AudioNodeView,
|
|
42
|
+
default6 as AudioRenderer,
|
|
43
|
+
default7 as BubbleMenuEditImage,
|
|
42
44
|
default8 as ConversationHistoryNodeView,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
+
default9 as ConversationHistoryRenderer,
|
|
46
|
+
default10 as Editor,
|
|
45
47
|
EditorContent,
|
|
46
48
|
EditorContext,
|
|
47
49
|
Editor as EditorInstance,
|
|
48
|
-
|
|
50
|
+
default11 as EditorPreview,
|
|
51
|
+
default12 as EditorPreviewSkeleton,
|
|
52
|
+
default13 as EditorSkeleton,
|
|
49
53
|
EditorToolbar,
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
default14 as IframeNodeView,
|
|
55
|
+
default15 as ImageNodeView,
|
|
56
|
+
default16 as InformationPaneNodeView,
|
|
57
|
+
default17 as InformationPaneRenderer,
|
|
58
|
+
default18 as LinkToolbar,
|
|
59
|
+
default19 as LinkerNodeView,
|
|
60
|
+
default20 as LinkerRenderer,
|
|
61
|
+
default21 as MediaRenderer,
|
|
58
62
|
default2 as StarterKit,
|
|
59
|
-
|
|
60
|
-
|
|
63
|
+
default22 as TableToolbar,
|
|
64
|
+
default23 as VideoNodeView,
|
|
61
65
|
useActionOptions,
|
|
62
66
|
useCantooEditor,
|
|
63
67
|
useCommentEditor,
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ export * from './useHasWorkflow';
|
|
|
15
15
|
export * from './useHover';
|
|
16
16
|
export * from './useHttpErrorToast';
|
|
17
17
|
export * from './useImage';
|
|
18
|
+
export * from './useInfiniteScroll';
|
|
18
19
|
export * from './useIsAdml';
|
|
19
20
|
export * from './useIsAdmc';
|
|
20
21
|
export * from './useIsAdmlcOrAdmc';
|
|
@@ -6,7 +6,9 @@ const useConversation = () => {
|
|
|
6
6
|
const zimbraWorkflow = useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|view"), zimbraPreauth = useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|preauth"), [msgLink, setMsgLink] = useState(""), queryParams = {
|
|
7
7
|
unread: !0,
|
|
8
8
|
_: (/* @__PURE__ */ new Date()).getTime()
|
|
9
|
-
}
|
|
9
|
+
};
|
|
10
|
+
zimbraWorkflow || (queryParams.queryparam_token = (/* @__PURE__ */ new Date()).getTime());
|
|
11
|
+
const {
|
|
10
12
|
data: messages
|
|
11
13
|
} = useQuery({
|
|
12
14
|
queryKey: ["folder", "count", "inbox"],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useId, useState, useRef, useEffect, useCallback } from "react";
|
|
2
|
-
import { useFloating, offset, size, flip,
|
|
2
|
+
import { useFloating, autoUpdate, offset, size, flip, useHover, safePolygon } from "@floating-ui/react";
|
|
3
3
|
import { mergeRefs } from "../../utilities/refs/ref.js";
|
|
4
4
|
const useDropdown = (placement, extraTriggerKeyDownHandler, isTriggerHovered = !1, focusOnVisible = !0, openOnSpace = !0, focusOnMouseEnter = !0) => {
|
|
5
5
|
const id = useId(), [visible, setVisible] = useState(!1), [activeIndex, setActiveIndex] = useState(-1), [isFocused, setIsFocused] = useState(null), {
|
|
@@ -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>) => void
|
|
20
|
+
handleDrop: <T extends HTMLElement>(event: React.DragEvent<T>) => Promise<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[]) => void
|
|
28
|
+
addFiles: (files: File[]) => Promise<void>;
|
|
29
29
|
/** Empty the `files` list. */
|
|
30
30
|
cleanFiles: () => void;
|
|
31
31
|
/** Callback to attach to your `input[type=file]` HTMLElement. */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useState, useRef } from "react";
|
|
2
|
+
import { HEIC_MIME_TYPES } from "../../utilities/mime-types/mime-types-utils.js";
|
|
2
3
|
const useDropzone = (props) => {
|
|
3
4
|
const [dragging, setDragging] = useState(!1), [files, setFiles] = useState([]), inputRef = useRef(null), addFile = (file) => {
|
|
4
5
|
addFiles([file]);
|
|
@@ -23,14 +24,33 @@ const useDropzone = (props) => {
|
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
26
|
return filteredFiles;
|
|
26
|
-
}, addFiles = (files2) => {
|
|
27
|
-
let filesToAdd = files2.sort((a, b) => b.lastModified - a.lastModified).map((file) => (
|
|
27
|
+
}, addFiles = async (files2) => {
|
|
28
|
+
let filesToAdd = (await convertHEICImages(files2)).sort((a, b) => b.lastModified - a.lastModified).map((file) => (
|
|
28
29
|
// #WB-3377: Remove special characters from the file name. (it can cause issues with vertx which replace it or remove it)
|
|
29
30
|
new File([file], file.name.replace(/[!:,;="']/g, ""), {
|
|
30
31
|
type: file.type
|
|
31
32
|
})
|
|
32
33
|
));
|
|
33
34
|
filesToAdd.reverse(), props != null && props.forceFilters ? (filesToAdd = applyInputFiltersOn(filesToAdd), filesToAdd && filesToAdd.length && setFiles((prevFiles) => [...prevFiles, ...filesToAdd])) : setFiles((prevFiles) => [...prevFiles, ...files2]);
|
|
35
|
+
}, convertHEICImages = async (files2) => {
|
|
36
|
+
if (files2 === null || files2.length === 0)
|
|
37
|
+
return [];
|
|
38
|
+
let heic2any;
|
|
39
|
+
return files2.some((file) => HEIC_MIME_TYPES.includes(file.type)) && (heic2any = (await import("heic2any")).default), Promise.all(files2.map(async (file) => {
|
|
40
|
+
if (HEIC_MIME_TYPES.includes(file.type) && heic2any)
|
|
41
|
+
try {
|
|
42
|
+
const converted = await heic2any({
|
|
43
|
+
blob: file,
|
|
44
|
+
toType: "image/jpeg"
|
|
45
|
+
});
|
|
46
|
+
return new File([converted], file.name.replace(/\.(heic|heif)$/i, ".jpeg"), {
|
|
47
|
+
type: "image/jpeg"
|
|
48
|
+
});
|
|
49
|
+
} catch (error) {
|
|
50
|
+
return console.error(`Failed to convert HEIC image: ${file.name}`, error), file;
|
|
51
|
+
}
|
|
52
|
+
return file;
|
|
53
|
+
}));
|
|
34
54
|
}, cleanFiles = () => {
|
|
35
55
|
setFiles([]);
|
|
36
56
|
}, handleOnChange = (event) => {
|
|
@@ -53,11 +73,11 @@ const useDropzone = (props) => {
|
|
|
53
73
|
/** Callback to attach to your drop zone (any HTMLElement). */
|
|
54
74
|
handleDragLeave,
|
|
55
75
|
/** Callback to attach to your drop zone (any HTMLElement). */
|
|
56
|
-
handleDrop: (event) => {
|
|
76
|
+
handleDrop: async (event) => {
|
|
57
77
|
var _a;
|
|
58
78
|
handleDragLeave(event);
|
|
59
79
|
const files2 = (_a = event.dataTransfer) == null ? void 0 : _a.files;
|
|
60
|
-
files2 && (addFiles([...files2]), inputRef != null && inputRef.current && (inputRef.current.files = files2));
|
|
80
|
+
files2 && (await addFiles([...files2]), inputRef != null && inputRef.current && (inputRef.current.files = files2));
|
|
61
81
|
},
|
|
62
82
|
/** Replace a file in the `files` list. */
|
|
63
83
|
replaceFileAt,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as useInfiniteScroll } from './useInfiniteScroll';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A custom React hook that provides infinite scroll functionality using the Intersection Observer API.
|
|
3
|
+
*
|
|
4
|
+
* This hook returns a ref callback that can be attached to a DOM element (typically at the bottom
|
|
5
|
+
* of a scrollable list). When that element becomes visible in the viewport, the provided callback
|
|
6
|
+
* function is executed, allowing you to load more content.
|
|
7
|
+
*
|
|
8
|
+
* @param params - Configuration object for the infinite scroll hook
|
|
9
|
+
* @param params.callback - Function to execute when the observed element intersects with the viewport
|
|
10
|
+
* @param params.options - Optional Intersection Observer configuration options (defaults to { threshold: 0.1 })
|
|
11
|
+
*
|
|
12
|
+
* @returns A ref callback function that should be attached to the target DOM element
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const loadMoreRef = useInfiniteScroll({
|
|
17
|
+
* // Load more data when the element is visible
|
|
18
|
+
* callback: loadMoreItems,
|
|
19
|
+
* options: { threshold: 0.5 } // Trigger when 50% of element is visible
|
|
20
|
+
* });
|
|
21
|
+
*
|
|
22
|
+
* return (
|
|
23
|
+
* <div>
|
|
24
|
+
* {items.map(item => <Item key={item.id} {...item} />)}
|
|
25
|
+
* <div ref={loadMoreRef}>Loading...</div>
|
|
26
|
+
* </div>
|
|
27
|
+
* );
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export default function useInfiniteScroll({ callback, options, }: {
|
|
31
|
+
callback: () => void;
|
|
32
|
+
options?: IntersectionObserverInit;
|
|
33
|
+
}): (node: HTMLElement | null) => void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useRef, useCallback } from "react";
|
|
2
|
+
function useInfiniteScroll({
|
|
3
|
+
callback,
|
|
4
|
+
options = {
|
|
5
|
+
threshold: 0.1
|
|
6
|
+
}
|
|
7
|
+
}) {
|
|
8
|
+
const observerRef = useRef(null);
|
|
9
|
+
return useCallback((node) => {
|
|
10
|
+
if (observerRef.current && (observerRef.current.disconnect(), observerRef.current = null), !node) return;
|
|
11
|
+
const observer = new IntersectionObserver(async (entries) => {
|
|
12
|
+
for (const entry of entries)
|
|
13
|
+
entry.isIntersecting && await callback();
|
|
14
|
+
}, options);
|
|
15
|
+
observer.observe(node), observerRef.current = observer;
|
|
16
|
+
}, [callback, options]);
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
useInfiniteScroll as default
|
|
20
|
+
};
|