@edifice.io/react 2.5.10-develop-b2school.20260218115154 → 2.5.10-develop-pedago.20260218134950

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 (120) hide show
  1. package/dist/_virtual/common.js +4 -0
  2. package/dist/_virtual/de_DE.js +4 -0
  3. package/dist/_virtual/de_DE2.js +4 -0
  4. package/dist/_virtual/de_DE3.js +4 -0
  5. package/dist/_virtual/de_DE4.js +4 -0
  6. package/dist/_virtual/de_DE5.js +4 -0
  7. package/dist/_virtual/de_DE6.js +4 -0
  8. package/dist/_virtual/defineProperty.js +4 -0
  9. package/dist/_virtual/es_ES.js +4 -0
  10. package/dist/_virtual/es_ES2.js +4 -0
  11. package/dist/_virtual/es_ES3.js +4 -0
  12. package/dist/_virtual/es_ES4.js +4 -0
  13. package/dist/_virtual/es_ES5.js +4 -0
  14. package/dist/_virtual/es_ES6.js +4 -0
  15. package/dist/_virtual/fr_FR.js +4 -0
  16. package/dist/_virtual/fr_FR2.js +4 -0
  17. package/dist/_virtual/fr_FR3.js +4 -0
  18. package/dist/_virtual/fr_FR4.js +4 -0
  19. package/dist/_virtual/fr_FR5.js +4 -0
  20. package/dist/_virtual/fr_FR6.js +4 -0
  21. package/dist/_virtual/interopRequireDefault.js +4 -0
  22. package/dist/_virtual/it_IT.js +4 -0
  23. package/dist/_virtual/it_IT2.js +4 -0
  24. package/dist/_virtual/it_IT3.js +4 -0
  25. package/dist/_virtual/it_IT4.js +4 -0
  26. package/dist/_virtual/it_IT5.js +4 -0
  27. package/dist/_virtual/it_IT6.js +4 -0
  28. package/dist/_virtual/objectSpread2.js +4 -0
  29. package/dist/_virtual/pt_PT.js +4 -0
  30. package/dist/_virtual/pt_PT2.js +4 -0
  31. package/dist/_virtual/pt_PT3.js +4 -0
  32. package/dist/_virtual/pt_PT4.js +4 -0
  33. package/dist/_virtual/pt_PT5.js +4 -0
  34. package/dist/_virtual/pt_PT6.js +4 -0
  35. package/dist/_virtual/toPrimitive.js +4 -0
  36. package/dist/_virtual/toPropertyKey.js +4 -0
  37. package/dist/_virtual/typeof.js +4 -0
  38. package/dist/components/AddAttachments/AddAttachments.d.ts +21 -0
  39. package/dist/components/AddAttachments/AddAttachments.js +75 -0
  40. package/dist/components/AddAttachments/components/AddAttachmentToWorkspaceModal.d.ts +9 -0
  41. package/dist/components/AddAttachments/components/AddAttachmentToWorkspaceModal.js +41 -0
  42. package/dist/components/AddAttachments/components/SingleAttachment.d.ts +13 -0
  43. package/dist/components/AddAttachments/components/SingleAttachment.js +27 -0
  44. package/dist/components/AddAttachments/hooks/useFileToAttachment.d.ts +3 -0
  45. package/dist/components/AddAttachments/hooks/useFileToAttachment.js +16 -0
  46. package/dist/components/AddAttachments/index.d.ts +2 -0
  47. package/dist/components/AddAttachments/models/attachment.d.ts +10 -0
  48. package/dist/components/Badge/Badge.js +1 -10
  49. package/dist/components/Layout/components/WidgetApps.js +2 -2
  50. package/dist/components/MediaViewer/PdfViewer.js +4 -14
  51. package/dist/components/index.d.ts +1 -0
  52. package/dist/hooks/useBrowserInfo/useBrowserInfo.d.ts +3 -4
  53. package/dist/hooks/useBrowserInfo/useBrowserInfo.js +1 -1
  54. package/dist/hooks/useConf/useConf.d.ts +1 -1
  55. package/dist/hooks/usePreferences/usePreferences.d.ts +3 -3
  56. package/dist/hooks/useSession/useSession.d.ts +1 -1
  57. package/dist/hooks/useToast/useToast.js +5 -5
  58. package/dist/icons.js +302 -298
  59. package/dist/index.js +4 -0
  60. package/dist/modules/icons/components/IconCollect.d.ts +7 -0
  61. package/dist/modules/icons/components/IconCollect.js +12 -0
  62. package/dist/modules/icons/components/IconSubmission.d.ts +7 -0
  63. package/dist/modules/icons/components/IconSubmission.js +12 -0
  64. package/dist/modules/icons/components/index.d.ts +2 -0
  65. package/dist/modules/modals/OnboardingModal/OnboardingModal.d.ts +2 -28
  66. package/dist/modules/modals/OnboardingModal/OnboardingModal.js +7 -11
  67. package/dist/modules/modals/OnboardingModal/useOnboardingModal.d.ts +1 -4
  68. package/dist/modules/modals/OnboardingModal/useOnboardingModal.js +17 -24
  69. package/dist/modules/modals/ResourceModal/ResourceModal.d.ts +1 -1
  70. package/dist/modules/modals/ResourceModal/hooks/useUpdateMutation.d.ts +1 -1
  71. package/dist/modules/modals/ShareModal/ShareResources.d.ts +1 -1
  72. package/dist/modules/modals/ShareModal/apps/ShareBlog.d.ts +1 -1
  73. package/dist/modules/modals/ShareModal/hooks/useShareMutation.d.ts +1 -1
  74. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/defineProperty.js +18 -0
  75. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/interopRequireDefault.js +13 -0
  76. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/objectSpread2.js +31 -0
  77. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/toPrimitive.js +20 -0
  78. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/toPropertyKey.js +15 -0
  79. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/typeof.js +16 -0
  80. 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
  81. 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
  82. 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
  83. 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
  84. 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
  85. 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
  86. 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
  87. 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
  88. 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
  89. 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
  90. 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
  91. 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
  92. 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
  93. 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
  94. 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
  95. 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
  96. 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
  97. 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
  98. 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
  99. 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
  100. 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
  101. 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
  102. 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
  103. 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
  104. 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
  105. 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
  106. 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
  107. 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
  108. 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
  109. 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
  110. 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
  111. 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
  112. 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
  113. 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
  114. 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
  115. 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
  116. package/dist/providers/AntThemeProvider/AntProvider.js +5 -5
  117. package/dist/providers/EdificeClientProvider/EdificeClientProvider.context.d.ts +1 -1
  118. package/dist/types/color.d.ts +3 -0
  119. package/dist/utilities/react-query/react-query-utils.d.ts +1 -1
  120. package/package.json +6 -6
@@ -0,0 +1,4 @@
1
+ var common = {};
2
+ export {
3
+ common as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var de_DE = {};
2
+ export {
3
+ de_DE as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var de_DE = {};
2
+ export {
3
+ de_DE as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var de_DE = {};
2
+ export {
3
+ de_DE as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var de_DE = {};
2
+ export {
3
+ de_DE as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var de_DE = {};
2
+ export {
3
+ de_DE as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var de_DE = {};
2
+ export {
3
+ de_DE as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var defineProperty = { exports: {} };
2
+ export {
3
+ defineProperty as __module
4
+ };
@@ -0,0 +1,4 @@
1
+ var es_ES = {};
2
+ export {
3
+ es_ES as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var es_ES = {};
2
+ export {
3
+ es_ES as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var es_ES = {};
2
+ export {
3
+ es_ES as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var es_ES = {};
2
+ export {
3
+ es_ES as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var es_ES = {};
2
+ export {
3
+ es_ES as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var es_ES = {};
2
+ export {
3
+ es_ES as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var fr_FR = {};
2
+ export {
3
+ fr_FR as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var fr_FR = {};
2
+ export {
3
+ fr_FR as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var fr_FR = {};
2
+ export {
3
+ fr_FR as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var fr_FR = {};
2
+ export {
3
+ fr_FR as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var fr_FR = {};
2
+ export {
3
+ fr_FR as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var fr_FR = {};
2
+ export {
3
+ fr_FR as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var interopRequireDefault = { exports: {} };
2
+ export {
3
+ interopRequireDefault as __module
4
+ };
@@ -0,0 +1,4 @@
1
+ var it_IT = {};
2
+ export {
3
+ it_IT as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var it_IT = {};
2
+ export {
3
+ it_IT as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var it_IT = {};
2
+ export {
3
+ it_IT as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var it_IT = {};
2
+ export {
3
+ it_IT as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var it_IT = {};
2
+ export {
3
+ it_IT as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var it_IT = {};
2
+ export {
3
+ it_IT as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var objectSpread2 = { exports: {} };
2
+ export {
3
+ objectSpread2 as __module
4
+ };
@@ -0,0 +1,4 @@
1
+ var pt_PT = {};
2
+ export {
3
+ pt_PT as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var pt_PT = {};
2
+ export {
3
+ pt_PT as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var pt_PT = {};
2
+ export {
3
+ pt_PT as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var pt_PT = {};
2
+ export {
3
+ pt_PT as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var pt_PT = {};
2
+ export {
3
+ pt_PT as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var pt_PT = {};
2
+ export {
3
+ pt_PT as __exports
4
+ };
@@ -0,0 +1,4 @@
1
+ var toPrimitive = { exports: {} };
2
+ export {
3
+ toPrimitive as __module
4
+ };
@@ -0,0 +1,4 @@
1
+ var toPropertyKey = { exports: {} };
2
+ export {
3
+ toPropertyKey as __module
4
+ };
@@ -0,0 +1,4 @@
1
+ var _typeof = { exports: {} };
2
+ export {
3
+ _typeof as __module
4
+ };
@@ -0,0 +1,21 @@
1
+ import { Attachment } from './models/attachment';
2
+ export type SingleAttachmentType = Attachment;
3
+ export { useFileToAttachment } from './hooks/useFileToAttachment';
4
+ export interface AddAttachmentsProps {
5
+ attachments: Attachment[];
6
+ onChange?: (attachments: Attachment[]) => void;
7
+ onFilesSelected?: (files: File[]) => void;
8
+ onRemoveAttachment?: (attachmentId: string) => void;
9
+ editMode?: boolean;
10
+ isMutating?: boolean;
11
+ onCopyToWorkspace?: (attachments: Attachment[], folderId: string) => Promise<boolean>;
12
+ /** Si fourni, chaque pièce jointe affiche un bouton télécharger avec l'URL retournée. */
13
+ getDownloadUrl?: (attachmentId: string) => string;
14
+ /** Si fourni et qu'il y a plusieurs pièces jointes, affiche un bouton « télécharger tout ». */
15
+ downloadAllUrl?: string;
16
+ }
17
+ export declare const AddAttachments: {
18
+ ({ attachments, onChange, onFilesSelected, onRemoveAttachment, editMode, isMutating, onCopyToWorkspace, getDownloadUrl, downloadAllUrl, }: AddAttachmentsProps): import("react/jsx-runtime").JSX.Element | null;
19
+ displayName: string;
20
+ };
21
+ export default AddAttachments;
@@ -0,0 +1,75 @@
1
+ import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
+ import clsx from "clsx";
3
+ import { useRef, useState } from "react";
4
+ import { useTranslation } from "react-i18next";
5
+ import SvgIconDelete from "../../modules/icons/components/IconDelete.js";
6
+ import SvgIconDownload from "../../modules/icons/components/IconDownload.js";
7
+ import SvgIconFolderAdd from "../../modules/icons/components/IconFolderAdd.js";
8
+ import SvgIconPlus from "../../modules/icons/components/IconPlus.js";
9
+ import { AddAttachmentToWorkspaceModal } from "./components/AddAttachmentToWorkspaceModal.js";
10
+ import { SingleAttachment } from "./components/SingleAttachment.js";
11
+ import { useFileToAttachment } from "./hooks/useFileToAttachment.js";
12
+ import Flex from "../Flex/Flex.js";
13
+ import IconButton from "../Button/IconButton.js";
14
+ import Button from "../Button/Button.js";
15
+ const AddAttachments = ({
16
+ attachments,
17
+ onChange,
18
+ onFilesSelected,
19
+ onRemoveAttachment,
20
+ editMode = !1,
21
+ isMutating = !1,
22
+ onCopyToWorkspace,
23
+ getDownloadUrl,
24
+ downloadAllUrl
25
+ }) => {
26
+ const {
27
+ t
28
+ } = useTranslation(), inputRef = useRef(null), fileToAttachment = useFileToAttachment(), [attachmentsToAddToWorkspace, setAttachmentsToAddToWorkspace] = useState(void 0);
29
+ if (!editMode && !attachments.length) return null;
30
+ const resetInputValue = () => {
31
+ inputRef.current && (inputRef.current.value = "");
32
+ }, handleAttachClick = () => {
33
+ var _a;
34
+ return (_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.click();
35
+ }, handleFileChange = (event) => {
36
+ const files = Array.from(event.target.files ?? []);
37
+ if (files.length > 0) {
38
+ const newAttachments = files.map(fileToAttachment);
39
+ onChange == null || onChange([...attachments, ...newAttachments]), onFilesSelected == null || onFilesSelected(files);
40
+ }
41
+ resetInputValue();
42
+ }, handleDetachAllClick = () => {
43
+ onChange == null || onChange([]), attachments.forEach((a) => onRemoveAttachment == null ? void 0 : onRemoveAttachment(a.id)), resetInputValue();
44
+ }, handleDetachClick = (attachmentId) => {
45
+ const next = attachments.filter((a) => a.id !== attachmentId);
46
+ onChange == null || onChange(next), onRemoveAttachment == null || onRemoveAttachment(attachmentId), resetInputValue();
47
+ }, handleCopyToWorkspace = (attachments2) => {
48
+ setAttachmentsToAddToWorkspace(attachments2);
49
+ }, className = clsx("bg-gray-200 rounded px-12 py-8 message-attachments align-self-start gap-8 d-flex flex-column mw-100", {
50
+ "border add-attachments-edit mx-16": editMode
51
+ });
52
+ return /* @__PURE__ */ jsxs("div", { className, "data-drag-handle": !0, children: [
53
+ !!attachments.length && /* @__PURE__ */ jsxs(Fragment, { children: [
54
+ /* @__PURE__ */ jsxs(Flex, { direction: "row", align: "center", justify: "between", className: "border-bottom", children: [
55
+ /* @__PURE__ */ jsx("span", { className: "caption fw-bold my-8", children: t("attachments") }),
56
+ attachments.length > 1 && /* @__PURE__ */ jsxs("div", { children: [
57
+ onCopyToWorkspace && /* @__PURE__ */ jsx(IconButton, { title: t("conversation.copy.all.toworkspace"), color: "tertiary", type: "button", icon: /* @__PURE__ */ jsx(SvgIconFolderAdd, {}), onClick: () => handleCopyToWorkspace(attachments), variant: "ghost" }),
58
+ downloadAllUrl && /* @__PURE__ */ jsx("a", { href: downloadAllUrl, download: !0, children: /* @__PURE__ */ jsx(IconButton, { title: t("download.all.attachment"), color: "tertiary", type: "button", icon: /* @__PURE__ */ jsx(SvgIconDownload, {}), variant: "ghost" }) }),
59
+ editMode && /* @__PURE__ */ jsx(IconButton, { title: t("remove.all.attachment"), color: "danger", type: "button", icon: /* @__PURE__ */ jsx(SvgIconDelete, {}), variant: "ghost", onClick: handleDetachAllClick, disabled: isMutating })
60
+ ] })
61
+ ] }),
62
+ /* @__PURE__ */ jsx("ul", { className: "d-flex gap-8 flex-column list-unstyled m-0", children: attachments.map((attachment) => /* @__PURE__ */ jsx("li", { className: "mw-100", children: /* @__PURE__ */ jsx(SingleAttachment, { attachment, editMode, onDelete: handleDetachClick, onCopyToWorkspace: onCopyToWorkspace ? (attachment2) => handleCopyToWorkspace([attachment2]) : void 0, getDownloadUrl, disabled: isMutating }) }, `${attachment.id}-${attachment.name}`)) })
63
+ ] }),
64
+ editMode && /* @__PURE__ */ jsxs(Fragment, { children: [
65
+ /* @__PURE__ */ jsx(Button, { color: "secondary", variant: "ghost", isLoading: isMutating, onClick: handleAttachClick, disabled: isMutating, className: "align-self-start", leftIcon: /* @__PURE__ */ jsx(SvgIconPlus, {}), "data-testid": "common-add-attachments-button-add-attachment", children: t("add.attachment") }),
66
+ /* @__PURE__ */ jsx("input", { ref: inputRef, multiple: !0, type: "file", name: "attachment-input", id: "attachment-input", onChange: handleFileChange, hidden: !0 })
67
+ ] }),
68
+ onCopyToWorkspace && !!attachmentsToAddToWorkspace && /* @__PURE__ */ jsx(AddAttachmentToWorkspaceModal, { isOpen: !0, onModalClose: () => setAttachmentsToAddToWorkspace(void 0), attachments: attachmentsToAddToWorkspace, onCopyToWorkspace })
69
+ ] });
70
+ };
71
+ export {
72
+ AddAttachments,
73
+ AddAttachments as default,
74
+ useFileToAttachment
75
+ };
@@ -0,0 +1,9 @@
1
+ import { Attachment } from '../models/attachment';
2
+ interface AddAttachmentToWorkspaceModalProps {
3
+ attachments: Attachment[];
4
+ onModalClose: () => void;
5
+ isOpen?: boolean;
6
+ onCopyToWorkspace: (attachments: Attachment[], folderId: string) => Promise<boolean>;
7
+ }
8
+ export declare function AddAttachmentToWorkspaceModal({ attachments, isOpen, onModalClose, onCopyToWorkspace, }: AddAttachmentToWorkspaceModalProps): import('react').ReactPortal;
9
+ export {};
@@ -0,0 +1,41 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useState, useEffect } from "react";
3
+ import { createPortal } from "react-dom";
4
+ import { toast } from "react-hot-toast";
5
+ import { useTranslation } from "react-i18next";
6
+ import Modal from "../../Modal/Modal.js";
7
+ import WorkspaceFolders from "../../../modules/multimedia/WorkspaceFolders/WorkspaceFolders.js";
8
+ import Button from "../../Button/Button.js";
9
+ function AddAttachmentToWorkspaceModal({
10
+ attachments,
11
+ isOpen = !1,
12
+ onModalClose,
13
+ onCopyToWorkspace
14
+ }) {
15
+ const {
16
+ t
17
+ } = useTranslation(), [selectedFolderIdToCopyFile, setSelectedFolderIdToCopyFile] = useState(void 0), [isLoading, setIsLoading] = useState(!1), [disabled, setDisabled] = useState(!1), handleFolderSelected = (folderId, canCopyFileInto) => {
18
+ setSelectedFolderIdToCopyFile(canCopyFileInto ? folderId : void 0);
19
+ }, handleAddAttachmentToWorkspace = async () => {
20
+ if (selectedFolderIdToCopyFile === void 0) return;
21
+ setIsLoading(!0), await onCopyToWorkspace(attachments, selectedFolderIdToCopyFile) ? onModalClose() : toast.error(t("attachments.add.to.folder.modal.error")), setIsLoading(!1);
22
+ };
23
+ return useEffect(() => {
24
+ setDisabled(selectedFolderIdToCopyFile === void 0);
25
+ }, [selectedFolderIdToCopyFile]), /* @__PURE__ */ createPortal(/* @__PURE__ */ jsxs(Modal, { isOpen, onModalClose, id: "add-attachment-to-workspace-modal", size: "md", children: [
26
+ /* @__PURE__ */ jsx(Modal.Header, { onModalClose, children: t("attachments.add.to.folder.modal.title") }),
27
+ /* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsxs("div", { className: "d-flex flex-column gap-12", children: [
28
+ /* @__PURE__ */ jsx("p", { children: t("attachments.add.to.folder.modal.description", {
29
+ count: attachments.length
30
+ }) }),
31
+ /* @__PURE__ */ jsx(WorkspaceFolders, { onFolderSelected: handleFolderSelected })
32
+ ] }) }),
33
+ /* @__PURE__ */ jsxs(Modal.Footer, { children: [
34
+ /* @__PURE__ */ jsx(Button, { type: "button", color: "tertiary", variant: "ghost", onClick: onModalClose, children: t("attachments.add.to.folder.modal.cancel") }),
35
+ /* @__PURE__ */ jsx(Button, { color: "primary", variant: "filled", onClick: handleAddAttachmentToWorkspace, disabled: isLoading || disabled, isLoading, children: t("attachments.add.to.folder.modal.add") })
36
+ ] })
37
+ ] }), document.getElementById("portal"));
38
+ }
39
+ export {
40
+ AddAttachmentToWorkspaceModal
41
+ };
@@ -0,0 +1,13 @@
1
+ import { Attachment } from '../models/attachment';
2
+ export interface SingleAttachmentProps {
3
+ attachment: Attachment;
4
+ onDelete: (attachmentId: string) => void;
5
+ editMode?: boolean;
6
+ /** Si fourni, affiche le bouton « copier vers l'espace » et appelle ce callback au clic. */
7
+ onCopyToWorkspace?: (attachment: Attachment) => void;
8
+ /** Si fourni, affiche le bouton télécharger avec l'URL retournée. */
9
+ getDownloadUrl?: (attachmentId: string) => string;
10
+ /** Désactive les boutons d'action (ex. pendant une suppression). */
11
+ disabled?: boolean;
12
+ }
13
+ export declare function SingleAttachment({ attachment, onDelete, editMode, onCopyToWorkspace, getDownloadUrl, disabled, }: SingleAttachmentProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,27 @@
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import SvgIconDelete from "../../../modules/icons/components/IconDelete.js";
3
+ import SvgIconDownload from "../../../modules/icons/components/IconDownload.js";
4
+ import SvgIconFolderAdd from "../../../modules/icons/components/IconFolderAdd.js";
5
+ import { useTranslation } from "react-i18next";
6
+ import Attachment from "../../Attachment/Attachment.js";
7
+ import IconButton from "../../Button/IconButton.js";
8
+ function SingleAttachment({
9
+ attachment,
10
+ onDelete,
11
+ editMode = !1,
12
+ onCopyToWorkspace,
13
+ getDownloadUrl,
14
+ disabled = !1
15
+ }) {
16
+ const {
17
+ t
18
+ } = useTranslation(), downloadUrl = getDownloadUrl == null ? void 0 : getDownloadUrl(attachment.id);
19
+ return /* @__PURE__ */ jsx(Attachment, { name: attachment.filename, options: /* @__PURE__ */ jsxs(Fragment, { children: [
20
+ onCopyToWorkspace && /* @__PURE__ */ jsx(IconButton, { title: t("conversation.copy.toworkspace"), color: "tertiary", type: "button", icon: /* @__PURE__ */ jsx(SvgIconFolderAdd, {}), variant: "ghost", onClick: () => onCopyToWorkspace(attachment), disabled }),
21
+ downloadUrl !== void 0 && /* @__PURE__ */ jsx("a", { href: downloadUrl, download: !0, children: /* @__PURE__ */ jsx(IconButton, { title: t("download.attachment"), color: "tertiary", type: "button", icon: /* @__PURE__ */ jsx(SvgIconDownload, {}), variant: "ghost", disabled }) }),
22
+ editMode && /* @__PURE__ */ jsx(IconButton, { title: t("remove.attachment"), color: "danger", type: "button", icon: /* @__PURE__ */ jsx(SvgIconDelete, {}), variant: "ghost", onClick: () => onDelete(attachment.id), disabled })
23
+ ] }) });
24
+ }
25
+ export {
26
+ SingleAttachment
27
+ };
@@ -0,0 +1,3 @@
1
+ import { Attachment } from '../models/attachment';
2
+ /** Convertit un File en Attachment (id unique généré). Exposé pour les apps qui utilisent AddAttachments. */
3
+ export declare function useFileToAttachment(): (file: File) => Attachment;
@@ -0,0 +1,16 @@
1
+ import { useCallback } from "react";
2
+ function useFileToAttachment() {
3
+ return useCallback((file) => ({
4
+ id: `${file.name}-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`,
5
+ charset: "UTF-8",
6
+ contentTransferEncoding: "binary",
7
+ contentType: file.type || "application/octet-stream",
8
+ filename: file.name,
9
+ name: file.name,
10
+ size: file.size,
11
+ file
12
+ }), []);
13
+ }
14
+ export {
15
+ useFileToAttachment
16
+ };
@@ -0,0 +1,2 @@
1
+ export { default as AddAttachments } from './AddAttachments';
2
+ export * from './AddAttachments';
@@ -0,0 +1,10 @@
1
+ export type Attachment = {
2
+ id: string;
3
+ charset: string;
4
+ contentTransferEncoding: string;
5
+ contentType: string;
6
+ filename: string;
7
+ name: string;
8
+ size: number;
9
+ file: File;
10
+ };
@@ -23,16 +23,7 @@ const Badge = /* @__PURE__ */ forwardRef(({
23
23
  }
24
24
  console.log(badgeColorClassName);
25
25
  const classes = clsx("badge rounded-pill", (variant.type === "content" || variant.type === "user") && "background" in variant ? "bg-gray-200" : (variant.type === "content" || variant.type === "user") && !("background" in variant) ? "border border-0" : "", variant.type === "content" && `text-${variant.level}`, variant.type === "notification" && `badge-notification bg-${variant.level} text-light border border-0`, variant.type === "user" && `badge-profile-${variant.profile.toLowerCase()}`, variant.type === "link" && "badge-link border border-0", variant.type === "chip" && "bg-gray-200", variant.type === "beta" && badgeColorClassName, className);
26
- return /* @__PURE__ */ jsxs("span", { ref, className: classes, style: (() => {
27
- if (variant.type !== "beta") return;
28
- const color = variant.color ?? "#000000";
29
- return {
30
- borderColor: color,
31
- color,
32
- backgroundColor: `${color}10`
33
- // the 2 last hexadecimal numbers are for opacity
34
- };
35
- })(), ...restProps, children: [
26
+ return /* @__PURE__ */ jsxs("span", { ref, className: classes, ...restProps, children: [
36
27
  variant.type === "chip" && /* @__PURE__ */ jsx("div", { className: "d-flex fw-800 align-items-center", children }),
37
28
  variant.type === "beta" && (children ?? "BÊTA"),
38
29
  variant.type !== "chip" && variant.type !== "beta" && children
@@ -11,10 +11,10 @@ const WidgetAppsFooter = () => {
11
11
  }) => {
12
12
  const {
13
13
  t
14
- } = useTranslation(), getAppName = (data) => data.prefix && data.prefix.length > 1 ? t(data.prefix.substring(1)) : t(data.displayName) || "";
14
+ } = useTranslation();
15
15
  return /* @__PURE__ */ jsxs("div", { className: "widget-body d-flex flex-wrap", children: [
16
16
  !bookmarkedApps.length && /* @__PURE__ */ jsx("div", { className: "text-dark", children: t("navbar.myapps.more") }),
17
- bookmarkedApps.slice(0, 6).map((app, index) => /* @__PURE__ */ jsx("a", { href: app.address, title: getAppName(app), className: "bookmarked-app", target: appToOpenOnBlank.includes(app.name) || app.isExternal || app.category === "connector" ? "_blank" : void 0, rel: appToOpenOnBlank.includes(app.name) || app.isExternal || app.category === "connector" ? "noopener noreferrer" : void 0, children: /* @__PURE__ */ jsx(AppIcon, { app, size: "32" }) }, index))
17
+ bookmarkedApps.slice(0, 6).map((app, index) => /* @__PURE__ */ jsx("a", { href: app.address, className: "bookmarked-app", target: appToOpenOnBlank.includes(app.name) || app.isExternal || app.category === "connector" ? "_blank" : void 0, rel: appToOpenOnBlank.includes(app.name) || app.isExternal || app.category === "connector" ? "noopener noreferrer" : void 0, children: /* @__PURE__ */ jsx(AppIcon, { app, size: "32" }) }, index))
18
18
  ] });
19
19
  };
20
20
  export {
@@ -1,27 +1,17 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { useState, useRef, useEffect } from "react";
2
+ import { useState, useRef } from "react";
3
+ import { Document, Page } from "react-pdf";
3
4
  import LoadingScreen from "../LoadingScreen/LoadingScreen.js";
4
5
  function PdfViewer({
5
6
  mediaUrl,
6
7
  scale
7
8
  }) {
8
- const [numPages, setNumPages] = useState(null), [Document, setDocument] = useState(null), [Page, setPage] = useState(null), [isLoading, setIsLoading] = useState(!0), pagesRef = useRef([]);
9
- useEffect(() => {
10
- (async () => {
11
- try {
12
- const reactPdf = await import("react-pdf");
13
- setDocument(() => reactPdf.Document), setPage(() => reactPdf.Page), setIsLoading(!1);
14
- } catch (error) {
15
- console.error("Failed to load react-pdf:", error);
16
- }
17
- })();
18
- }, []);
19
- const onDocumentLoadSuccess = ({
9
+ const [numPages, setNumPages] = useState(null), pagesRef = useRef([]), onDocumentLoadSuccess = ({
20
10
  numPages: numPages2
21
11
  }) => {
22
12
  setNumPages(numPages2);
23
13
  };
24
- return isLoading || !Document || !Page ? /* @__PURE__ */ jsx(LoadingScreen, {}) : /* @__PURE__ */ jsx("div", { style: {
14
+ return /* @__PURE__ */ jsx("div", { style: {
25
15
  width: `calc(600px * ${scale})`,
26
16
  height: "calc(100vh - 52px)",
27
17
  overflowY: "auto",
@@ -1,4 +1,5 @@
1
1
  export * from './ActionBar';
2
+ export * from './AddAttachments';
2
3
  export * from './Alert';
3
4
  export * from './AppHeader';
4
5
  export * from './AppIcon';
@@ -1,8 +1,7 @@
1
- import { default as UAParser } from 'ua-parser-js';
2
1
  export default function useBrowserInfo(userAgent?: string): {
3
- os: UAParser.IOS;
4
- device: UAParser.IDevice;
5
- browser: UAParser.IBrowser;
2
+ os: import('ua-parser-js').IOS;
3
+ device: import('ua-parser-js').IDevice;
4
+ browser: import('ua-parser-js').IBrowser;
6
5
  isIphone: boolean;
7
6
  isIpod: boolean;
8
7
  isIpad: boolean;
@@ -1,4 +1,4 @@
1
- import UAParser from "ua-parser-js";
1
+ import { UAParser } from "ua-parser-js";
2
2
  function useBrowserInfo(userAgent) {
3
3
  var _a, _b, _c;
4
4
  const uaParser = new UAParser(userAgent), os = uaParser.getOS(), device = uaParser.getDevice(), browser = uaParser.getBrowser(), isIphone = ((_a = device.model) == null ? void 0 : _a.indexOf("iPhone")) != -1, isIpod = ((_b = device.model) == null ? void 0 : _b.indexOf("iPod")) != -1, isIpad = ((_c = device.model) == null ? void 0 : _c.indexOf("iPad")) != -1;
@@ -1,4 +1,4 @@
1
1
  import { App, IGetConf } from '@edifice.io/client';
2
2
  export default function useConf({ appCode }: {
3
3
  appCode: App;
4
- }): import('../../node_modules/@tanstack/react-query').UseQueryResult<IGetConf, Error>;
4
+ }): import('../../../node_modules/@tanstack/react-query').UseQueryResult<IGetConf, Error>;
@@ -1,4 +1,4 @@
1
- export default function usePreferences<T = any>(name: string): {
2
- getPreference: () => Promise<T>;
3
- savePreference: (value: T) => Promise<void>;
1
+ export default function usePreferences(name: string): {
2
+ getPreference: () => Promise<any>;
3
+ savePreference: (value: any) => Promise<void>;
4
4
  };
@@ -1,2 +1,2 @@
1
1
  import { IGetSession } from '@edifice.io/client';
2
- export default function useSession(): import('../../node_modules/@tanstack/react-query').UseQueryResult<IGetSession, Error>;
2
+ export default function useSession(): import('../../../node_modules/@tanstack/react-query').UseQueryResult<IGetSession, Error>;
@@ -1,27 +1,27 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import toast from "react-hot-toast";
3
3
  import Alert from "../../components/Alert/Alert.js";
4
- const DEFAULT_POSITION = "top-right", DEFAULT_DURATION = 5e3;
4
+ const DEFAULT_POSITION = "top-right";
5
5
  function useToast() {
6
6
  return {
7
7
  success: (message, options) => toast.custom(/* @__PURE__ */ jsx(Alert, { type: "success", isToast: !0, isDismissible: options == null ? void 0 : options.isDismissible, className: "mb-12", children: message }), {
8
8
  id: options == null ? void 0 : options.id,
9
- duration: (options == null ? void 0 : options.duration) ?? DEFAULT_DURATION,
9
+ duration: options == null ? void 0 : options.duration,
10
10
  position: (options == null ? void 0 : options.position) ?? DEFAULT_POSITION
11
11
  }),
12
12
  error: (message, options) => toast.custom(/* @__PURE__ */ jsx(Alert, { type: "danger", isToast: !0, isDismissible: options == null ? void 0 : options.isDismissible, className: "mb-12", children: message }), {
13
13
  id: options == null ? void 0 : options.id,
14
- duration: (options == null ? void 0 : options.duration) ?? DEFAULT_DURATION,
14
+ duration: options == null ? void 0 : options.duration,
15
15
  position: (options == null ? void 0 : options.position) ?? DEFAULT_POSITION
16
16
  }),
17
17
  info: (message, options) => toast.custom(/* @__PURE__ */ jsx(Alert, { type: "info", isToast: !0, isDismissible: options == null ? void 0 : options.isDismissible, className: "mb-12", children: message }), {
18
18
  id: options == null ? void 0 : options.id,
19
- duration: (options == null ? void 0 : options.duration) ?? DEFAULT_DURATION,
19
+ duration: options == null ? void 0 : options.duration,
20
20
  position: (options == null ? void 0 : options.position) ?? DEFAULT_POSITION
21
21
  }),
22
22
  warning: (message, options) => toast.custom(/* @__PURE__ */ jsx(Alert, { type: "warning", isToast: !0, isDismissible: options == null ? void 0 : options.isDismissible, className: "mb-12", children: message }), {
23
23
  id: options == null ? void 0 : options.id,
24
- duration: (options == null ? void 0 : options.duration) ?? DEFAULT_DURATION,
24
+ duration: options == null ? void 0 : options.duration,
25
25
  position: (options == null ? void 0 : options.position) ?? DEFAULT_POSITION
26
26
  }),
27
27
  loading: toast.loading,