@edifice.io/react 2.5.5 → 2.5.6-develop.20260116103750

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.
Files changed (156) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +8 -0
  2. package/dist/_virtual/common.js +4 -0
  3. package/dist/_virtual/de_DE.js +4 -0
  4. package/dist/_virtual/de_DE2.js +4 -0
  5. package/dist/_virtual/de_DE3.js +4 -0
  6. package/dist/_virtual/de_DE4.js +4 -0
  7. package/dist/_virtual/de_DE5.js +4 -0
  8. package/dist/_virtual/de_DE6.js +4 -0
  9. package/dist/_virtual/defineProperty.js +4 -0
  10. package/dist/_virtual/es_ES.js +4 -0
  11. package/dist/_virtual/es_ES2.js +4 -0
  12. package/dist/_virtual/es_ES3.js +4 -0
  13. package/dist/_virtual/es_ES4.js +4 -0
  14. package/dist/_virtual/es_ES5.js +4 -0
  15. package/dist/_virtual/es_ES6.js +4 -0
  16. package/dist/_virtual/fr_FR.js +4 -0
  17. package/dist/_virtual/fr_FR2.js +4 -0
  18. package/dist/_virtual/fr_FR3.js +4 -0
  19. package/dist/_virtual/fr_FR4.js +4 -0
  20. package/dist/_virtual/fr_FR5.js +4 -0
  21. package/dist/_virtual/fr_FR6.js +4 -0
  22. package/dist/_virtual/interopRequireDefault.js +4 -0
  23. package/dist/_virtual/it_IT.js +4 -0
  24. package/dist/_virtual/it_IT2.js +4 -0
  25. package/dist/_virtual/it_IT3.js +4 -0
  26. package/dist/_virtual/it_IT4.js +4 -0
  27. package/dist/_virtual/it_IT5.js +4 -0
  28. package/dist/_virtual/it_IT6.js +4 -0
  29. package/dist/_virtual/localeData.js +4 -0
  30. package/dist/_virtual/objectSpread2.js +4 -0
  31. package/dist/_virtual/pt_PT.js +4 -0
  32. package/dist/_virtual/pt_PT2.js +4 -0
  33. package/dist/_virtual/pt_PT3.js +4 -0
  34. package/dist/_virtual/pt_PT4.js +4 -0
  35. package/dist/_virtual/pt_PT5.js +4 -0
  36. package/dist/_virtual/pt_PT6.js +4 -0
  37. package/dist/_virtual/toPrimitive.js +4 -0
  38. package/dist/_virtual/toPropertyKey.js +4 -0
  39. package/dist/_virtual/typeof.js +4 -0
  40. package/dist/_virtual/weekday.js +4 -0
  41. package/dist/components/AppIcon/index.d.ts +1 -0
  42. package/dist/components/Badge/Badge.d.ts +12 -1
  43. package/dist/components/Badge/Badge.js +15 -2
  44. package/dist/components/Combobox/Combobox.js +1 -1
  45. package/dist/components/Combobox/ComboboxTrigger.js +1 -1
  46. package/dist/components/DatePicker/DatePicker.js +35 -0
  47. package/dist/components/DatePicker/index.d.ts +2 -0
  48. package/dist/components/Divider/Divider.d.ts +38 -0
  49. package/dist/components/Divider/Divider.js +11 -0
  50. package/dist/components/Divider/index.d.ts +2 -0
  51. package/dist/components/Flex/Flex.js +1 -1
  52. package/dist/components/Layout/components/Header.js +6 -1
  53. package/dist/components/Menu/components/MenuButton.d.ts +2 -0
  54. package/dist/components/Menu/components/MenuButton.js +13 -4
  55. package/dist/components/SegmentedControl/SegmentedControl.d.ts +59 -0
  56. package/dist/components/SegmentedControl/SegmentedControl.js +24 -0
  57. package/dist/components/SegmentedControl/index.d.ts +2 -0
  58. package/dist/components/Select/Select.d.ts +6 -2
  59. package/dist/components/Select/Select.js +10 -4
  60. package/dist/components/index.d.ts +3 -0
  61. package/dist/editor.js +40 -36
  62. package/dist/hooks/index.d.ts +1 -0
  63. package/dist/hooks/useDropzone/useDropzone.d.ts +2 -2
  64. package/dist/hooks/useDropzone/useDropzone.js +20 -5
  65. package/dist/hooks/useInfiniteScroll/index.d.ts +1 -0
  66. package/dist/hooks/useInfiniteScroll/useInfiniteScroll.d.ts +33 -0
  67. package/dist/hooks/useInfiniteScroll/useInfiniteScroll.js +20 -0
  68. package/dist/icons.js +302 -298
  69. package/dist/index.js +188 -170
  70. package/dist/modals.js +8 -6
  71. package/dist/modules/comments/components/Comment.js +4 -2
  72. package/dist/modules/comments/components/CommentList.js +1 -1
  73. package/dist/modules/comments/components/DeleteModal.js +14 -8
  74. package/dist/modules/editor/components/Editor/Editor.js +1 -1
  75. package/dist/modules/editor/components/Editor/EditorPreview.d.ts +14 -0
  76. package/dist/modules/editor/components/Editor/EditorPreview.js +56 -0
  77. package/dist/modules/editor/components/Editor/EditorPreviewSkeleton.d.ts +8 -0
  78. package/dist/modules/editor/components/Editor/EditorPreviewSkeleton.js +24 -0
  79. package/dist/modules/editor/components/Editor/index.d.ts +2 -0
  80. package/dist/modules/editor/components/Renderer/AttachmentRenderer.js +2 -2
  81. package/dist/modules/editor/hooks/useMediaLibraryEditor.js +4 -3
  82. package/dist/modules/icons/components/IconClockAlert.d.ts +7 -0
  83. package/dist/modules/icons/components/IconClockAlert.js +17 -0
  84. package/dist/modules/icons/components/IconSubmitToValidate.d.ts +7 -0
  85. package/dist/modules/icons/components/IconSubmitToValidate.js +12 -0
  86. package/dist/modules/icons/components/index.d.ts +2 -0
  87. package/dist/modules/modals/ShareModal/ShareBookmark.d.ts +1 -1
  88. package/dist/modules/modals/ShareModal/ShareBookmark.js +6 -3
  89. package/dist/modules/modals/ShareModal/ShareBookmarkLine.js +4 -4
  90. package/dist/modules/modals/ShareModal/ShareModal.d.ts +1 -11
  91. package/dist/modules/modals/ShareModal/ShareModal.js +13 -105
  92. package/dist/modules/modals/ShareModal/ShareResources.d.ts +187 -0
  93. package/dist/modules/modals/ShareModal/ShareResources.js +145 -0
  94. package/dist/modules/modals/ShareModal/hooks/useSearch.d.ts +5 -3
  95. package/dist/modules/modals/ShareModal/hooks/useSearch.js +12 -16
  96. package/dist/modules/modals/ShareModal/hooks/useShare.d.ts +12 -5
  97. package/dist/modules/modals/ShareModal/hooks/useShare.js +20 -13
  98. package/dist/modules/modals/ShareModal/hooks/useShareBookmark.d.ts +1 -1
  99. package/dist/modules/modals/ShareModal/hooks/useShareBookmark.js +1 -1
  100. package/dist/modules/modals/ShareModal/index.d.ts +3 -1
  101. package/dist/modules/multimedia/MediaLibrary/index.d.ts +2 -0
  102. package/dist/modules/multimedia/MediaLibrary/innertabs/Upload.js +1 -1
  103. package/dist/modules/multimedia/index.d.ts +1 -0
  104. package/dist/multimedia.js +14 -8
  105. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/defineProperty.js +18 -0
  106. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/interopRequireDefault.js +13 -0
  107. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/objectSpread2.js +31 -0
  108. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/toPrimitive.js +20 -0
  109. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/toPropertyKey.js +15 -0
  110. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/typeof.js +16 -0
  111. 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
  112. 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
  113. 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
  114. 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
  115. 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
  116. 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
  117. 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
  118. 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
  119. 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
  120. 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
  121. 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
  122. 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
  123. 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
  124. 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
  125. 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
  126. 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
  127. 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
  128. 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
  129. 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
  130. 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
  131. 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
  132. 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
  133. 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
  134. 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
  135. 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
  136. package/dist/node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/localeData.js +82 -0
  137. package/dist/node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/weekday.js +19 -0
  138. 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
  139. 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
  140. 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
  141. 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
  142. 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
  143. 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
  144. 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
  145. 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
  146. 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
  147. 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
  148. 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
  149. package/dist/providers/AntThemeProvider/AntProvider.d.ts +2 -2
  150. package/dist/providers/AntThemeProvider/AntProvider.js +19 -2
  151. package/dist/style.css +1 -1
  152. package/dist/utilities/index.d.ts +1 -0
  153. package/dist/utilities/react-query/index.d.ts +1 -0
  154. package/dist/utilities/react-query/react-query-utils.d.ts +21 -0
  155. package/dist/utilities/react-query/react-query-utils.js +13 -0
  156. package/package.json +8 -7
@@ -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);
@@ -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,24 +1,26 @@
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/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";
4
+ import { default as default4 } from "./modules/editor/components/Editor/EditorPreview.js";
5
+ import { default as default5 } from "./modules/editor/components/Editor/EditorPreviewSkeleton.js";
6
+ import { default as default6 } from "./modules/editor/components/Editor/EditorSkeleton.js";
7
+ import { default as default7 } from "./modules/editor/components/BubbleMenuEditImage/BubbleMenuEditImage.js";
8
+ import { default as default8 } from "./modules/editor/components/NodeView/AttachmentNodeView.js";
9
+ import { default as default9 } from "./modules/editor/components/NodeView/AudioNodeView.js";
10
+ import { default as default10 } from "./modules/editor/components/NodeView/ConversationHistoryNodeView.js";
11
+ import { default as default11 } from "./modules/editor/components/NodeView/ImageNodeView.js";
12
+ import { default as default12 } from "./modules/editor/components/NodeView/LinkerNodeView.js";
13
+ import { default as default13 } from "./modules/editor/components/NodeView/VideoNodeView.js";
14
+ import { default as default14 } from "./modules/editor/components/NodeView/InformationPaneNodeView.js";
15
+ import { default as default15 } from "./modules/editor/components/NodeView/IframeNodeView.js";
16
+ import { default as default16 } from "./modules/editor/components/Renderer/AttachmentRenderer.js";
17
+ import { default as default17 } from "./modules/editor/components/Renderer/AudioRenderer.js";
18
+ import { default as default18 } from "./modules/editor/components/Renderer/ConversationHistoryRenderer.js";
19
+ import { default as default19 } from "./modules/editor/components/Renderer/LinkerRenderer.js";
20
+ import { default as default20 } from "./modules/editor/components/Renderer/MediaRenderer.js";
21
+ import { default as default21 } from "./modules/editor/components/Renderer/InformationPaneRenderer.js";
22
+ import { default as default22 } from "./modules/editor/components/Toolbar/TableToolbar.js";
23
+ import { default as default23 } from "./modules/editor/components/Toolbar/LinkToolbar.js";
22
24
  import { EditorToolbar } from "./modules/editor/components/EditorToolbar/EditorToolbar.js";
23
25
  import { useActionOptions } from "./modules/editor/hooks/useActionOptions.js";
24
26
  import { useCommentEditor } from "./modules/editor/hooks/useCommentEditor.js";
@@ -34,30 +36,32 @@ import { useSpeechSynthetisis } from "./modules/editor/hooks/useSpeechSynthetisi
34
36
  import { useTipTapEditor } from "./modules/editor/hooks/useTipTapEditor.js";
35
37
  import { useCantooEditor } from "./modules/editor/hooks/useCantooEditor.js";
36
38
  export {
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,
39
+ default8 as AttachmentNodeView,
40
+ default16 as AttachmentRenderer,
41
+ default9 as AudioNodeView,
42
+ default17 as AudioRenderer,
43
+ default7 as BubbleMenuEditImage,
44
+ default10 as ConversationHistoryNodeView,
45
+ default18 as ConversationHistoryRenderer,
44
46
  default3 as Editor,
45
47
  EditorContent,
46
48
  EditorContext,
47
49
  Editor as EditorInstance,
48
- default4 as EditorSkeleton,
50
+ default4 as EditorPreview,
51
+ default5 as EditorPreviewSkeleton,
52
+ default6 as EditorSkeleton,
49
53
  EditorToolbar,
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,
54
+ default15 as IframeNodeView,
55
+ default11 as ImageNodeView,
56
+ default14 as InformationPaneNodeView,
57
+ default21 as InformationPaneRenderer,
58
+ default23 as LinkToolbar,
59
+ default12 as LinkerNodeView,
60
+ default19 as LinkerRenderer,
61
+ default20 as MediaRenderer,
58
62
  default2 as StarterKit,
59
- default20 as TableToolbar,
60
- default11 as VideoNodeView,
63
+ default22 as TableToolbar,
64
+ default13 as VideoNodeView,
61
65
  useActionOptions,
62
66
  useCantooEditor,
63
67
  useCommentEditor,
@@ -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';
@@ -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 heic2any from "heic2any";
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,15 +24,29 @@ 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]);
34
- }, cleanFiles = () => {
35
+ }, convertHEICImages = async (files2) => Promise.all(files2.map(async (file) => {
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 = () => {
35
50
  setFiles([]);
36
51
  }, handleOnChange = (event) => {
37
52
  const files2 = event.target.files;
@@ -53,11 +68,11 @@ const useDropzone = (props) => {
53
68
  /** Callback to attach to your drop zone (any HTMLElement). */
54
69
  handleDragLeave,
55
70
  /** Callback to attach to your drop zone (any HTMLElement). */
56
- handleDrop: (event) => {
71
+ handleDrop: async (event) => {
57
72
  var _a;
58
73
  handleDragLeave(event);
59
74
  const files2 = (_a = event.dataTransfer) == null ? void 0 : _a.files;
60
- files2 && (addFiles([...files2]), inputRef != null && inputRef.current && (inputRef.current.files = files2));
75
+ files2 && (await addFiles([...files2]), inputRef != null && inputRef.current && (inputRef.current.files = files2));
61
76
  },
62
77
  /** Replace a file in the `files` list. */
63
78
  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
+ };