@edifice.io/react 2.5.15-develop-pedago.20260324175543 → 2.5.15-develop-enabling.20260326100838

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 (72) hide show
  1. package/dist/components/AddAttachments/AddAttachments.d.ts +3 -6
  2. package/dist/components/AddAttachments/AddAttachments.js +29 -17
  3. package/dist/components/AddAttachments/models/attachment.d.ts +0 -1
  4. package/dist/components/Card/Card.js +1 -1
  5. package/dist/components/Combobox/Combobox.js +1 -1
  6. package/dist/components/Dropdown/Dropdown.js +1 -1
  7. package/dist/components/Form/FormControl.js +1 -1
  8. package/dist/components/Layout/components/WidgetApps.js +1 -1
  9. package/dist/components/Modal/Modal.js +1 -1
  10. package/dist/components/PreventPropagation/PreventPropagation.js +1 -1
  11. package/dist/components/PromotionCard/PromotionCard.js +1 -1
  12. package/dist/components/SearchBar/SearchBar.d.ts +2 -2
  13. package/dist/components/Table/components/Table.js +1 -1
  14. package/dist/components/index.d.ts +0 -1
  15. package/dist/hooks/useConf/useConf.d.ts +1 -1
  16. package/dist/hooks/useDropdown/useDropdown.js +2 -0
  17. package/dist/hooks/useDropzone/useDropzone.js +4 -4
  18. package/dist/hooks/useSession/useSession.d.ts +1 -1
  19. package/dist/hooks/useThumbnail/useThumbnail.d.ts +1 -1
  20. package/dist/hooks/useThumbnail/useThumbnail.js +5 -1
  21. package/dist/hooks/useUpload/useUpload.js +2 -5
  22. package/dist/hooks/useWorkspaceFolders/useWorkspaceFolders.d.ts +12 -0
  23. package/dist/hooks/useWorkspaceFolders/useWorkspaceFolders.js +1 -1
  24. package/dist/icons.js +176 -180
  25. package/dist/index.js +0 -6
  26. package/dist/modules/editor/components/Editor/EditorPreview.js +1 -1
  27. package/dist/modules/icons/components/index.d.ts +0 -2
  28. package/dist/modules/modals/ResourceModal/ResourceModal.d.ts +1 -1
  29. package/dist/modules/modals/ResourceModal/ResourceModal.js +1 -1
  30. package/dist/modules/modals/ResourceModal/hooks/useUpdateMutation.d.ts +1 -1
  31. package/dist/modules/modals/ShareModal/ShareResources.d.ts +4 -53
  32. package/dist/modules/modals/ShareModal/apps/ShareBlog.d.ts +1 -1
  33. package/dist/modules/modals/ShareModal/hooks/useShareBookmark.js +2 -1
  34. package/dist/modules/modals/ShareModal/hooks/useShareMutation.d.ts +1 -1
  35. package/dist/modules/multimedia/ImageEditor/components/ImageEditor.js +24 -10
  36. package/dist/modules/multimedia/ImageEditor/effects/blur.d.ts +7 -5
  37. package/dist/modules/multimedia/ImageEditor/effects/blur.js +26 -18
  38. package/dist/modules/multimedia/ImageEditor/effects/constants.d.ts +2 -0
  39. package/dist/modules/multimedia/ImageEditor/effects/constants.js +4 -0
  40. package/dist/modules/multimedia/ImageEditor/effects/crop.d.ts +4 -5
  41. package/dist/modules/multimedia/ImageEditor/effects/crop.js +42 -26
  42. package/dist/modules/multimedia/ImageEditor/effects/misc.d.ts +10 -16
  43. package/dist/modules/multimedia/ImageEditor/effects/misc.js +27 -12
  44. package/dist/modules/multimedia/ImageEditor/effects/resize.d.ts +3 -7
  45. package/dist/modules/multimedia/ImageEditor/effects/resize.js +31 -22
  46. package/dist/modules/multimedia/ImageEditor/effects/rotate.js +2 -3
  47. package/dist/modules/multimedia/ImageEditor/hooks/useHistoryTool.js +40 -41
  48. package/dist/modules/multimedia/ImageEditor/hooks/useImageEditor.d.ts +1 -1
  49. package/dist/modules/multimedia/ImageEditor/hooks/useImageEditor.js +9 -3
  50. package/dist/modules/multimedia/ImageEditor/hooks/useImageEffects.js +4 -1
  51. package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.d.ts +1 -3
  52. package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.js +1 -2
  53. package/dist/modules/multimedia/LinkerCard/LinkerCard._.d.ts +1 -1
  54. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +1 -0
  55. package/dist/modules/multimedia/UploadCard/UploadCard._.d.ts +1 -1
  56. package/dist/modules/multimedia/UploadFiles/UploadFiles.js +4 -4
  57. package/dist/providers/EdificeClientProvider/EdificeClientProvider.context.d.ts +1 -1
  58. package/dist/utilities/react-query/react-query-utils.d.ts +1 -1
  59. package/package.json +53 -54
  60. package/dist/components/AddAttachments/hooks/useFileToAttachment.d.ts +0 -3
  61. package/dist/components/AddAttachments/hooks/useFileToAttachment.js +0 -16
  62. package/dist/components/UserSearch/UserSearch.d.ts +0 -7
  63. package/dist/components/UserSearch/UserSearch.js +0 -82
  64. package/dist/components/UserSearch/index.d.ts +0 -3
  65. package/dist/components/UserSearch/types/types.d.ts +0 -29
  66. package/dist/components/UserSearch/types/visible.d.ts +0 -24
  67. package/dist/components/UserSearch/types/visible.js +0 -4
  68. package/dist/modules/icons/components/IconParcoursCitoyen.d.ts +0 -7
  69. package/dist/modules/icons/components/IconParcoursCitoyen.js +0 -14
  70. package/dist/modules/icons/components/IconParcoursSecours.d.ts +0 -7
  71. package/dist/modules/icons/components/IconParcoursSecours.js +0 -14
  72. package/dist/modules/multimedia/FileCard/FileCard._.d.ts +0 -17
@@ -11,49 +11,48 @@ const DEFAULT_MAX_HISTORY = 20, useHistoryTool = ({
11
11
  setHistory([]);
12
12
  }, [application]);
13
13
  const restore = async () => {
14
- const imgData = history.pop();
15
- imgData && (onRestore(await imgData.backup, imgData), setHistory(history.filter((current) => current !== imgData)));
16
- }, listSize = (arr) => (arr.length > maxSize && arr.splice(0, arr.length - maxSize), arr), historize = async (callback) => {
17
- {
18
- if (!application)
19
- return;
20
- const sprite = application.stage.getChildByName(spriteName, !0);
21
- if (sprite == null)
22
- return;
23
- const promise = toBlob(application), state = {
24
- backup: promise,
25
- sprite: {
26
- rotation: sprite.rotation,
27
- size: {
28
- width: sprite.width,
29
- height: sprite.height
30
- },
31
- position: {
32
- x: sprite.position.x,
33
- y: sprite.position.y
34
- },
35
- scale: {
36
- x: sprite.scale.x,
37
- y: sprite.scale.y
38
- },
39
- anchor: {
40
- x: sprite.anchor.x,
41
- y: sprite.anchor.y
42
- }
14
+ if (history.length === 0) return;
15
+ const imgData = history[history.length - 1];
16
+ onRestore(await imgData.backup, imgData), setHistory(history.slice(0, -1));
17
+ }, trimHistory = (arr) => arr.length > maxSize ? arr.slice(arr.length - maxSize) : arr, historize = async (callback) => {
18
+ if (!application)
19
+ return;
20
+ const sprite = application.stage.getChildByLabel(spriteName, !0);
21
+ if (!sprite)
22
+ return;
23
+ const promise = toBlob(application), state = {
24
+ backup: promise,
25
+ sprite: {
26
+ rotation: sprite.rotation,
27
+ size: {
28
+ width: sprite.width,
29
+ height: sprite.height
43
30
  },
44
- stage: {
45
- size: {
46
- width: application.stage.width,
47
- height: application.stage.height
48
- },
49
- scale: {
50
- x: application.stage.scale.x,
51
- y: application.stage.scale.y
52
- }
31
+ position: {
32
+ x: sprite.position.x,
33
+ y: sprite.position.y
34
+ },
35
+ scale: {
36
+ x: sprite.scale.x,
37
+ y: sprite.scale.y
38
+ },
39
+ anchor: {
40
+ x: sprite.anchor.x,
41
+ y: sprite.anchor.y
42
+ }
43
+ },
44
+ stage: {
45
+ size: {
46
+ width: application.stage.width,
47
+ height: application.stage.height
48
+ },
49
+ scale: {
50
+ x: application.stage.scale.x,
51
+ y: application.stage.scale.y
53
52
  }
54
- };
55
- return setHistory([...listSize(history), state]), await promise, callback.call(callback);
56
- }
53
+ }
54
+ };
55
+ return setHistory(trimHistory([...history, state])), await promise, callback.call(callback);
57
56
  };
58
57
  return {
59
58
  historyCount: history.length,
@@ -14,7 +14,7 @@ export default function useImageEditor({ imageSrc, spriteName, }: {
14
14
  spriteName?: string;
15
15
  }): {
16
16
  historyCount: number;
17
- setApplication: import('react').Dispatch<import('react').SetStateAction<PIXI.Application<PIXI.ICanvas> | undefined>>;
17
+ setApplication: import('react').Dispatch<import('react').SetStateAction<PIXI.Application<PIXI.Renderer> | undefined>>;
18
18
  restore: () => Promise<void>;
19
19
  stopCrop: (save: boolean) => void;
20
20
  stopBlur: () => void;
@@ -1,8 +1,7 @@
1
1
  import { useState, useEffect } from "react";
2
- import "@pixi/mixin-get-child-by-name";
3
2
  import useHistoryTool from "./useHistoryTool.js";
4
3
  import useImageEffects from "./useImageEffects.js";
5
- import { updateImage, DEFAULT_SPRITE_NAME, saveAsBlob, saveAsDataURL, updateImageFromBlob } from "../effects/misc.js";
4
+ import { updateImage, DEFAULT_SPRITE_NAME, saveAsBlob, saveAsDataURL, autoResize, updateImageFromBlob } from "../effects/misc.js";
6
5
  function useImageEditor({
7
6
  imageSrc,
8
7
  spriteName = DEFAULT_SPRITE_NAME
@@ -47,7 +46,14 @@ function useImageEditor({
47
46
  spriteName,
48
47
  imgDatasource: imageSrc
49
48
  }).finally(() => setLoading(!1)));
50
- }, [application, imageSrc, spriteName]), {
49
+ }, [application, imageSrc, spriteName]), useEffect(() => {
50
+ if (!application) return;
51
+ const handleResize = () => {
52
+ const sprite = application.stage.getChildByLabel(spriteName, !0);
53
+ sprite && autoResize(application, sprite);
54
+ };
55
+ return window.addEventListener("resize", handleResize), () => window.removeEventListener("resize", handleResize);
56
+ }, [application, spriteName]), {
51
57
  historyCount,
52
58
  setApplication,
53
59
  restore,
@@ -20,7 +20,10 @@ function useImageEffects({
20
20
  if (application) {
21
21
  if (save$12) {
22
22
  const result = save(application);
23
- result && onSave(result);
23
+ if (result) {
24
+ onSave(result);
25
+ return;
26
+ }
24
27
  }
25
28
  stop(application);
26
29
  }
@@ -32,10 +32,8 @@ export interface InternalLinkerProps {
32
32
  applicationList?: ApplicationOption[];
33
33
  /** Whether to show the application selector */
34
34
  showApplicationSelector?: boolean;
35
- /** Disable application selecetor */
36
- disableApplicationSelector?: boolean;
37
35
  /** Optional callback to filter resources after loading. Applied in addition to search filters. */
38
36
  resourceFilter?: (resource: ILinkedResource) => boolean;
39
37
  }
40
- export declare const InternalLinker: ({ appCode, defaultAppCode, defaultResourceId, onChange, onSelect, multiple, resourceList, applicationList, showApplicationSelector, disableApplicationSelector, resourceFilter, }: InternalLinkerProps) => import("react/jsx-runtime").JSX.Element;
38
+ export declare const InternalLinker: ({ appCode, defaultAppCode, defaultResourceId, onChange, onSelect, multiple, resourceList, applicationList, showApplicationSelector, resourceFilter, }: InternalLinkerProps) => import("react/jsx-runtime").JSX.Element;
41
39
  export default InternalLinker;
@@ -22,7 +22,6 @@ const InternalLinker = ({
22
22
  resourceList,
23
23
  applicationList,
24
24
  showApplicationSelector = !0,
25
- disableApplicationSelector = !1,
26
25
  resourceFilter
27
26
  }) => {
28
27
  const {
@@ -115,7 +114,7 @@ const InternalLinker = ({
115
114
  /* @__PURE__ */ jsx(Dropdown.Trigger, { icon: /* @__PURE__ */ jsx("div", { className: "pe-8", children: (selectedApplication == null ? void 0 : selectedApplication.icon) || /* @__PURE__ */ jsx(SvgIconApplications, {}) }), label: /* @__PURE__ */ jsxs("span", { className: "d-md-inline d-sm-none", children: [
116
115
  " ",
117
116
  t((selectedApplication == null ? void 0 : selectedApplication.displayName) || "bbm.linker.int.choose")
118
- ] }), variant: "ghost", size: "md", disabled: disableApplicationSelector }),
117
+ ] }), variant: "ghost", size: "md" }),
119
118
  /* @__PURE__ */ jsx(Dropdown.Menu, { children: options == null ? void 0 : options.map((option) => /* @__PURE__ */ jsx(Dropdown.Item, { icon: option.icon, onClick: () => handleOptionClick(option), children: option.displayName }, option.application)) })
120
119
  ] }) }),
121
120
  /* @__PURE__ */ jsx("div", { className: "flex-grow-1 align-self-center", children: /* @__PURE__ */ jsx("form", { className: "gap-16 d-flex w-100 align-items-center px-16 py-8", onSubmit: handleSubmit, children: /* @__PURE__ */ jsx(SearchBar, { isVariant: !0, placeholder: t("search"), size: "lg", className: "w-100", disabled: !selectedApplication, onChange: handleSearchChange }) }) })
@@ -1,4 +1,4 @@
1
- import { Meta, StoryObj } from '@storybook/react';
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import { default as LinkerCard } from './LinkerCard';
3
3
  declare const meta: Meta<typeof LinkerCard>;
4
4
  export default meta;
@@ -220,6 +220,7 @@ const orderedTabs = [
220
220
  ] })
221
221
  ] }) });
222
222
  });
223
+ Object.assign(MediaLibrary, InnerTabs);
223
224
  export {
224
225
  MediaLibrary as default
225
226
  };
@@ -1,4 +1,4 @@
1
- import { Meta, StoryObj } from '@storybook/react';
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import { default as UploadCard } from './UploadCard';
3
3
  declare const meta: Meta<typeof UploadCard>;
4
4
  export default meta;
@@ -1,10 +1,10 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
2
  import { customSize } from "@edifice.io/utilities";
3
- import { useRef, useEffect } from "react";
3
+ import { useRef, useEffect, Suspense, lazy } from "react";
4
4
  import useUploadFiles from "../../../hooks/useUploadFiles/useUploadFiles.js";
5
5
  import UploadCard from "../UploadCard/UploadCard.js";
6
- import ImageEditor from "../ImageEditor/components/ImageEditor.js";
7
- const UploadFiles = ({
6
+ import LoadingScreen from "../../../components/LoadingScreen/LoadingScreen.js";
7
+ const ImageEditor = /* @__PURE__ */ lazy(async () => await import("../ImageEditor/components/ImageEditor.js")), UploadFiles = ({
8
8
  onFilesChange,
9
9
  visibility = "protected"
10
10
  }) => {
@@ -48,7 +48,7 @@ const UploadFiles = ({
48
48
  const resource = uploadedFiles.find((uploadedFile) => uploadedFile.name === file.name);
49
49
  return /* @__PURE__ */ jsx(UploadCard, { status: getUploadStatus(file), item: renderItem(file), onEdit: () => setEditingImage(resource), onRetry: () => uploadFile(file), onDelete: () => handleRemoveFile(file) }, file.name);
50
50
  }),
51
- editingImage && /* @__PURE__ */ jsx(ImageEditor, { altText: editingImage.alt, legend: editingImage.title, image: getUrl(editingImage, !0), isOpen: !!editingImage, onCancel: () => setEditingImage(void 0), onSave: updateImage, onError: console.error })
51
+ editingImage && /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(LoadingScreen, { position: !1 }), children: /* @__PURE__ */ jsx(ImageEditor, { altText: editingImage.alt, legend: editingImage.title, image: getUrl(editingImage, !0), isOpen: !!editingImage, onCancel: () => setEditingImage(void 0), onSave: updateImage, onError: console.error }) })
52
52
  ] });
53
53
  };
54
54
  export {
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { App, IGetConf, IGetSession, IUserDescription, IUserInfo, IWebApp, UserProfile } from '@edifice.io/client';
3
- import { UseQueryResult } from '../../../node_modules/@tanstack/react-query';
3
+ import { UseQueryResult } from '@tanstack/react-query';
4
4
  export interface EdificeClientParams {
5
5
  alternativeApp?: boolean;
6
6
  app: App;
@@ -1,4 +1,4 @@
1
- import { InvalidateQueryFilters, QueryClient } from '../../../node_modules/@tanstack/react-query';
1
+ import { InvalidateQueryFilters, QueryClient } from '@tanstack/react-query';
2
2
  /**
3
3
  * Invalidates queries and resets infinite query data to only contain the first page.
4
4
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/react",
3
- "version": "2.5.15-develop-pedago.20260324175543",
3
+ "version": "2.5.15-develop-enabling.20260326100838",
4
4
  "description": "Edifice React Library",
5
5
  "keywords": [
6
6
  "react",
@@ -73,13 +73,11 @@
73
73
  "dist"
74
74
  ],
75
75
  "dependencies": {
76
- "@ant-design/icons": "^5.4.0",
77
- "@dnd-kit/core": "^6.1.0",
78
- "@dnd-kit/sortable": "^8.0.0",
79
- "@dnd-kit/utilities": "^3.2.2",
76
+ "@ant-design/icons": "5.4.0",
77
+ "@dnd-kit/core": "6.3.1",
78
+ "@dnd-kit/sortable": "8.0.0",
79
+ "@dnd-kit/utilities": "3.2.2",
80
80
  "@floating-ui/react": "0.26.0",
81
- "@pixi/mixin-get-child-by-name": "7.4.2",
82
- "@pixi/react": "7.1.2",
83
81
  "@popperjs/core": "2.11.8",
84
82
  "@tiptap/core": "2.11.0",
85
83
  "@tiptap/extension-blockquote": "2.11.0",
@@ -118,66 +116,66 @@
118
116
  "@tiptap/pm": "2.11.0",
119
117
  "@tiptap/react": "2.11.0",
120
118
  "@tiptap/starter-kit": "2.11.0",
121
- "@uidotdev/usehooks": "^2.4.1",
122
- "antd": "^5.29.1",
123
- "clsx": "^2.1.1",
119
+ "@uidotdev/usehooks": "2.4.1",
120
+ "antd": "5.29.1",
121
+ "clsx": "2.1.1",
124
122
  "dayjs": "1.11.19",
125
- "emoji-picker-react": "4.5.2",
126
- "heic-to": "1.4.2",
123
+ "emoji-picker-react": "4.17.4",
124
+ "heic2any": "0.0.4",
127
125
  "html-react-parser": "4.2.1",
128
126
  "ohash": "1.1.3",
129
127
  "pako": "2.1.0",
130
- "pixi.js": "7.4.2",
131
- "react-hot-toast": "^2.4.1",
128
+ "pixi.js": "8.15.0",
129
+ "react-hot-toast": "2.6.0",
132
130
  "react-intersection-observer": "9.5.3",
133
- "react-popper": "^2.3.0",
134
- "react-slugify": "^3.0.3",
135
- "swiper": "^10.1.0",
136
- "ua-parser-js": "^1.0.36",
137
- "react-pdf": "10.2.0",
138
- "@edifice.io/bootstrap": "2.5.15-develop-pedago.20260324175543",
139
- "@edifice.io/tiptap-extensions": "2.5.15-develop-pedago.20260324175543",
140
- "@edifice.io/utilities": "2.5.15-develop-pedago.20260324175543"
131
+ "react-pdf": "10.3.0",
132
+ "react-popper": "2.3.0",
133
+ "react-slugify": "3.0.3",
134
+ "swiper": "10.1.0",
135
+ "ua-parser-js": "1.0.36",
136
+ "@edifice.io/tiptap-extensions": "2.5.15-develop-enabling.20260326100838",
137
+ "@edifice.io/utilities": "2.5.15-develop-enabling.20260326100838",
138
+ "@edifice.io/bootstrap": "2.5.15-develop-enabling.20260326100838"
141
139
  },
142
140
  "devDependencies": {
143
- "@babel/plugin-transform-react-pure-annotations": "^7.23.3",
144
- "@eslint/js": "^9.12.0",
145
- "@react-spring/web": "^9.7.5",
146
- "@svgr/cli": "^8.1.0",
147
- "@tanstack/query-core": "5.62.7",
141
+ "@babel/plugin-transform-react-pure-annotations": "7.27.1",
142
+ "@eslint/js": "9.39.2",
143
+ "@react-spring/web": "9.7.5",
144
+ "@svgr/cli": "8.1.0",
145
+ "@tanstack/query-core": "5.90.20",
148
146
  "@tanstack/react-query": "5.62.7",
149
- "@testing-library/jest-dom": "^6.5.0",
150
- "@testing-library/react": "^16.0.1",
151
- "@testing-library/user-event": "^14.5.2",
152
- "@types/node": "^22.9.1",
153
- "@types/pako": "^2.0.3",
154
- "@types/react": "^18.2.33",
155
- "@types/react-dom": "^18.2.14",
156
- "@types/ua-parser-js": "^0.7.37",
157
- "@vitejs/plugin-react": "^4.3.2",
158
- "eslint": "^9.12.0",
147
+ "@testing-library/jest-dom": "6.5.0",
148
+ "@testing-library/react": "16.0.1",
149
+ "@testing-library/user-event": "14.5.2",
150
+ "@types/node": "22.19.8",
151
+ "@types/pako": "2.0.4",
152
+ "@types/react": "18.3.27",
153
+ "@types/react-dom": "18.3.7",
154
+ "@types/ua-parser-js": "0.7.37",
155
+ "@vitejs/plugin-react": "4.7.0",
156
+ "eslint": "9.39.2",
159
157
  "eslint-plugin-react-hooks": "5.1.0-rc.0",
160
- "eslint-plugin-react-refresh": "^0.4.12",
161
- "react": "^18.3.1",
162
- "react-dom": "^18.3.1",
163
- "react-hook-form": "^7.53.0",
164
- "react-i18next": "^14.1.0",
165
- "rollup-plugin-pure": "^0.2.1",
158
+ "eslint-plugin-react-refresh": "0.4.26",
159
+ "react": "18.3.1",
160
+ "react-dom": "18.3.1",
161
+ "react-hook-form": "7.71.1",
162
+ "react-i18next": "14.1.3",
163
+ "rollup-plugin-pure": "0.4.0",
166
164
  "rollup-plugin-visualizer": "5.12.0",
167
- "typescript-eslint": "^8.8.1",
168
- "vite": "^5.4.11",
169
- "vite-plugin-dts": "^4.1.0",
170
- "vite-tsconfig-paths": "^5.0.1",
171
- "@edifice.io/client": "2.5.15-develop-pedago.20260324175543",
172
- "@edifice.io/config": "2.5.15-develop-pedago.20260324175543"
165
+ "typescript-eslint": "8.54.0",
166
+ "vite": "5.4.14",
167
+ "vite-plugin-dts": "4.5.4",
168
+ "vite-tsconfig-paths": "5.1.4",
169
+ "@edifice.io/config": "2.5.15-develop-enabling.20260326100838",
170
+ "@edifice.io/client": "2.5.15-develop-enabling.20260326100838"
173
171
  },
174
172
  "peerDependencies": {
175
- "@react-spring/web": "^9.7.5",
173
+ "@react-spring/web": "9.7.5",
176
174
  "@tanstack/react-query": "5.62.7",
177
- "react": "^18.3.1",
178
- "react-dom": "^18.3.1",
179
- "react-hook-form": "^7.53.0",
180
- "react-i18next": "^14.1.0"
175
+ "react": "18.3.1",
176
+ "react-dom": "18.3.1",
177
+ "react-hook-form": "7.71.1",
178
+ "react-i18next": "14.1.3"
181
179
  },
182
180
  "publishConfig": {
183
181
  "access": "public"
@@ -186,6 +184,7 @@
186
184
  "scripts": {
187
185
  "build": "pnpm build:icons && vite build",
188
186
  "build:icons": "svgr src/modules/icons/assets --config-file ./svgr.config.cjs",
187
+ "build:analyze": "vite build --mode analyze",
189
188
  "fix": "eslint --fix --report-unused-disable-directives --max-warnings 0",
190
189
  "format": "pnpm run format:write && pnpm run format:check",
191
190
  "format:check": "npx prettier --check \"src/**/*.{ts,tsx}\"",
@@ -1,3 +0,0 @@
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;
@@ -1,16 +0,0 @@
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
- };
@@ -1,7 +0,0 @@
1
- import { UserSearchProps, UserSearchRef } from './types/types';
2
- /**
3
- * User search component with combobox UI. Supports users, groups and bookmarks,
4
- * debounced search, and optional sharing/selection tracking.
5
- * Loading state is managed internally during getSearchResults calls.
6
- */
7
- export declare const UserSearch: import('react').ForwardRefExoticComponent<UserSearchProps & import('react').RefAttributes<UserSearchRef>>;
@@ -1,82 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { forwardRef, useState, useEffect, useCallback, useImperativeHandle } from "react";
3
- import SvgIconBookmark from "../../modules/icons/components/IconBookmark.js";
4
- import SvgIconGroupAvatar from "../../modules/icons/components/IconGroupAvatar.js";
5
- import SvgIconUser from "../../modules/icons/components/IconUser.js";
6
- import { VisibleType } from "./types/visible.js";
7
- import useDebounce from "../../hooks/useDebounce/useDebounce.js";
8
- import Combobox from "../Combobox/Combobox.js";
9
- function buildSharedItemsCacheFromInitialSharings(initialSharings) {
10
- return new Map(initialSharings.map((item) => [item.recipientId, {
11
- id: item.recipientId,
12
- displayName: item.displayName,
13
- type: item.recipientType === "user" ? VisibleType.User : item.recipientType === "group" ? VisibleType.Group : VisibleType.ShareBookmark
14
- }]));
15
- }
16
- const UserSearch = /* @__PURE__ */ forwardRef(({
17
- placeholder = "Rechercher un utilisateur",
18
- isAdmlcOrAdmc = !1,
19
- bookmarks = [],
20
- initialSharings = [],
21
- getSearchResults,
22
- onSearchResultsChange
23
- }, ref) => {
24
- const [searchResults, setSearchResults] = useState(bookmarks), [searchInputValue, setSearchInputValue] = useState(""), debouncedSearchInputValue = useDebounce(searchInputValue, 500), [sharingsIds, setSharingsIds] = useState(new Set(initialSharings.map((item) => item.recipientId))), [sharedItemsCache, setSharedItemsCache] = useState(() => buildSharedItemsCacheFromInitialSharings(initialSharings)), [isLoading, setIsLoading] = useState(!1), searchMinLength = isAdmlcOrAdmc ? 3 : 1, getIcon = (type) => {
25
- switch (type) {
26
- case VisibleType.User:
27
- return /* @__PURE__ */ jsx(SvgIconUser, {});
28
- case VisibleType.Group:
29
- case VisibleType.BroadcastGroup:
30
- return /* @__PURE__ */ jsx(SvgIconGroupAvatar, {});
31
- case VisibleType.ShareBookmark:
32
- return /* @__PURE__ */ jsx(SvgIconBookmark, {});
33
- default:
34
- return null;
35
- }
36
- }, searchResultsToOptions = (searchResults2) => searchResults2.map((result) => ({
37
- value: result.id,
38
- label: result.displayName,
39
- icon: getIcon(result.type)
40
- })), filterResults = (results) => results.filter((result) => !sharingsIds.has(result.id));
41
- useEffect(() => {
42
- let cancelled = !1;
43
- async function getResults() {
44
- setIsLoading(!0);
45
- try {
46
- const response = await getSearchResults(debouncedSearchInputValue);
47
- if (!cancelled) {
48
- const rawResults = [...bookmarks, ...response.results];
49
- setSearchResults(filterResults(rawResults));
50
- }
51
- } catch {
52
- cancelled || setSearchResults(filterResults(bookmarks));
53
- } finally {
54
- cancelled || setIsLoading(!1);
55
- }
56
- }
57
- return debouncedSearchInputValue.length >= searchMinLength ? getResults() : setSearchResults(filterResults(bookmarks)), () => {
58
- cancelled = !0, setIsLoading(!1);
59
- };
60
- }, [debouncedSearchInputValue]);
61
- const handleSearchInputChange = (event) => {
62
- setSearchInputValue(event.target.value);
63
- }, handleRemoveSharing = useCallback((recipientId) => {
64
- setSharingsIds((prev) => {
65
- const next = new Set(prev);
66
- return next.delete(recipientId), next;
67
- });
68
- const cached = sharedItemsCache.get(recipientId);
69
- cached && setSearchResults((prev) => prev.some((r) => r.id === recipientId) ? prev : [...prev, cached]);
70
- }, [sharedItemsCache]);
71
- useImperativeHandle(ref, () => ({
72
- removeSharing: handleRemoveSharing
73
- }), [handleRemoveSharing]);
74
- const handleSearchResultsChange = (model) => {
75
- const searchResultId = model[0], searchResult = searchResults.find((result) => result.id === searchResultId);
76
- searchResult && (setSharingsIds((prev) => /* @__PURE__ */ new Set([...prev, searchResult.id])), setSharedItemsCache((prev) => new Map(prev).set(searchResult.id, searchResult)), setSearchResults((prev) => prev.filter((result) => result.id !== searchResult.id)), onSearchResultsChange == null || onSearchResultsChange(searchResult));
77
- };
78
- return /* @__PURE__ */ jsx(Combobox, { "data-testid": "common-user-search-input-search", value: searchInputValue, placeholder, isLoading, noResult: searchResults.length === 0, options: searchResultsToOptions(searchResults), searchMinLength, onSearchInputChange: handleSearchInputChange, onSearchResultsChange: handleSearchResultsChange });
79
- });
80
- export {
81
- UserSearch
82
- };
@@ -1,3 +0,0 @@
1
- export * from './UserSearch';
2
- export * from './types/types';
3
- export * from './types/visible';
@@ -1,29 +0,0 @@
1
- import { ReactNode } from 'react';
2
- import { Visible } from './visible';
3
- export interface UserSearchProps {
4
- placeholder?: string;
5
- isAdmlcOrAdmc?: boolean;
6
- bookmarks?: Visible[];
7
- initialSharings?: SharingItem[];
8
- getSearchResults: (searchInputValue: string) => Promise<SearchResponse>;
9
- onSearchResultsChange?: (searchResult: Visible) => void;
10
- }
11
- export interface UserSearchRef {
12
- removeSharing: (recipientId: string) => void;
13
- }
14
- export interface SearchResponse {
15
- results: Visible[];
16
- }
17
- export type SearchResultType = 'user' | 'group' | 'bookmark';
18
- export interface SearchResultBase {
19
- id: string;
20
- displayName: string;
21
- icon: ReactNode;
22
- type: SearchResultType;
23
- }
24
- export interface SharingItem {
25
- recipientId: string;
26
- recipientType: SearchResultType;
27
- permission: string[];
28
- displayName: string;
29
- }
@@ -1,24 +0,0 @@
1
- export declare enum VisibleType {
2
- User = "User",
3
- Group = "Group",
4
- ShareBookmark = "ShareBookmark",
5
- BroadcastGroup = "BroadcastGroup"
6
- }
7
- export type Visible = {
8
- id: string;
9
- displayName: string;
10
- type: VisibleType;
11
- children?: {
12
- id: string;
13
- displayName: string;
14
- }[];
15
- groupType?: string;
16
- nbUsers?: number;
17
- profile?: string;
18
- relatives?: {
19
- id: string;
20
- displayName: string;
21
- }[];
22
- structureName?: string;
23
- usedIn?: ('TO' | 'CC' | 'CCI')[];
24
- };
@@ -1,4 +0,0 @@
1
- var VisibleType = /* @__PURE__ */ ((VisibleType2) => (VisibleType2.User = "User", VisibleType2.Group = "Group", VisibleType2.ShareBookmark = "ShareBookmark", VisibleType2.BroadcastGroup = "BroadcastGroup", VisibleType2))(VisibleType || {});
2
- export {
3
- VisibleType
4
- };
@@ -1,7 +0,0 @@
1
- import { SVGProps } from 'react';
2
- interface SVGRProps {
3
- title?: string;
4
- titleId?: string;
5
- }
6
- declare const SvgIconParcoursCitoyen: ({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps) => import("react/jsx-runtime").JSX.Element;
7
- export default SvgIconParcoursCitoyen;
@@ -1,14 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- const SvgIconParcoursCitoyen = ({
3
- title,
4
- titleId,
5
- ...props
6
- }) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 24 24", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
7
- title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
8
- /* @__PURE__ */ jsx("path", { fill: "#383838", d: "M10.681 20.838a6.15 6.15 0 0 1 6.149-6.148q.058 0 .114.007a6.15 6.15 0 0 1 6.035 6.145v.248a2.473 2.473 0 0 1-2.47 2.47H11.68a1 1 0 0 1-1-1zm2 .722h7.827c.258 0 .47-.212.471-.47v-.248a4.15 4.15 0 0 0-4.15-4.148l-.051-.003a4.15 4.15 0 0 0-4.097 4.147zM18.81 9.627a2.124 2.124 0 1 0-4.247-.001 2.124 2.124 0 0 0 4.248 0m2 0a4.123 4.123 0 1 1-8.245 0 4.123 4.123 0 0 1 8.246 0" }),
9
- /* @__PURE__ */ jsx("path", { fill: "#383838", d: "M2.127 21.132a5.276 5.276 0 0 1 7.034-4.975 1 1 0 0 1-.666 1.886 3.276 3.276 0 0 0-4.367 3.089c0 .235.193.428.428.428h7.125a1 1 0 0 1 0 2H4.556a2.43 2.43 0 0 1-2.429-2.428M8.62 11.445a1.408 1.408 0 1 0-2.817.001 1.408 1.408 0 0 0 2.816-.001m2 0a3.409 3.409 0 1 1-6.818-.001 3.409 3.409 0 0 1 6.817 0M12.53 17.006V5.831a1 1 0 1 1 2 0v11.175l-.005.103a1 1 0 0 1-1.99 0z" }),
10
- /* @__PURE__ */ jsx("path", { fill: "#383838", d: "M13.533.2a1 1 0 0 1 1 1v4.294a1 1 0 0 1-1 1H7.121a1 1 0 0 1-1-1V3.21C6.121 1.53 7.501.2 9.17.2zM8.121 4.494h4.412V2.2H9.17c-.597 0-1.048.469-1.048 1.01z" })
11
- ] });
12
- export {
13
- SvgIconParcoursCitoyen as default
14
- };
@@ -1,7 +0,0 @@
1
- import { SVGProps } from 'react';
2
- interface SVGRProps {
3
- title?: string;
4
- titleId?: string;
5
- }
6
- declare const SvgIconParcoursSecours: ({ title, titleId, ...props }: SVGProps<SVGSVGElement> & SVGRProps) => import("react/jsx-runtime").JSX.Element;
7
- export default SvgIconParcoursSecours;
@@ -1,14 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- const SvgIconParcoursSecours = ({
3
- title,
4
- titleId,
5
- ...props
6
- }) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0 24 24", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
7
- title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
8
- /* @__PURE__ */ jsx("path", { fill: "#383838", d: "M21.132 7.766a.616.616 0 0 0-.616-.616H3.859a.616.616 0 0 0-.616.616v13.237c0 .34.275.617.616.617h16.657c.34 0 .616-.276.616-.617zm2 13.237a2.616 2.616 0 0 1-2.616 2.617H3.859a2.616 2.616 0 0 1-2.616-2.617V7.766A2.616 2.616 0 0 1 3.859 5.15h16.657a2.616 2.616 0 0 1 2.616 2.616z" }),
9
- /* @__PURE__ */ jsx("path", { fill: "#383838", d: "M12.746.548c2.883.047 5.465 1.936 6.39 4.716a1 1 0 0 1-1.897.632c-.659-1.98-2.497-3.314-4.526-3.348h-.197c-2.021.05-3.827 1.387-4.48 3.348a1 1 0 0 1-1.898-.632C7.053 2.514 9.591.62 12.466.549zM11.184 18.026V10.74a1 1 0 1 1 2 0v7.286a1 1 0 1 1-2 0" }),
10
- /* @__PURE__ */ jsx("path", { fill: "#383838", d: "m15.829 13.381.102.005a1 1 0 0 1 0 1.99l-.102.005H8.542a1 1 0 1 1 0-2z" })
11
- ] });
12
- export {
13
- SvgIconParcoursSecours as default
14
- };
@@ -1,17 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { default as FileCard } from './FileCard';
3
- declare const meta: Meta<typeof FileCard>;
4
- export default meta;
5
- type Story = StoryObj<typeof FileCard>;
6
- export declare const Base: Story;
7
- export declare const AudioFile: Story;
8
- export declare const ImageFile: Story;
9
- export declare const VideoFile: Story;
10
- export declare const TextFile: Story;
11
- export declare const DocFile: Story;
12
- export declare const PptFile: Story;
13
- export declare const PdfFile: Story;
14
- export declare const ZipFile: Story;
15
- export declare const CsvFile: Story;
16
- export declare const XlsFile: Story;
17
- export declare const MdFile: Story;