@edifice.io/react 2.5.5-develop-b2school.20260121153342 → 2.5.5-develop-pedago.20260122115953

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 (69) hide show
  1. package/dist/components/Badge/Badge.d.ts +7 -4
  2. package/dist/components/Badge/Badge.js +14 -11
  3. package/dist/components/DatePicker/DatePicker.js +3 -6
  4. package/dist/components/Dropdown/DropdownContext.js +1 -1
  5. package/dist/components/Form/FormContext.js +1 -1
  6. package/dist/components/Layout/Layout.js +1 -2
  7. package/dist/components/MediaViewer/MediaViewer.d.ts +17 -0
  8. package/dist/components/MediaViewer/MediaViewer.js +36 -0
  9. package/dist/components/MediaViewer/MediaWrapper.d.ts +7 -0
  10. package/dist/components/MediaViewer/MediaWrapper.js +72 -0
  11. package/dist/components/MediaViewer/PdfViewer.d.ts +4 -0
  12. package/dist/components/MediaViewer/PdfViewer.js +26 -0
  13. package/dist/components/MediaViewer/ToolbarViewer.d.ts +7 -0
  14. package/dist/components/MediaViewer/ToolbarViewer.js +41 -0
  15. package/dist/components/MediaViewer/ToolbarZoom.d.ts +4 -0
  16. package/dist/components/MediaViewer/ToolbarZoom.js +19 -0
  17. package/dist/components/MediaViewer/index.d.ts +2 -0
  18. package/dist/components/Modal/Modal.d.ts +0 -4
  19. package/dist/components/Modal/Modal.js +12 -13
  20. package/dist/components/PromotionCard/PromotionCard.d.ts +74 -0
  21. package/dist/components/PromotionCard/PromotionCard.js +31 -0
  22. package/dist/components/PromotionCard/PromotionCardBody.d.ts +10 -0
  23. package/dist/components/PromotionCard/PromotionCardBody.js +15 -0
  24. package/dist/components/PromotionCard/PromotionCardDescription.d.ts +9 -0
  25. package/dist/components/PromotionCard/PromotionCardDescription.js +12 -0
  26. package/dist/components/PromotionCard/PromotionCardFooter.d.ts +9 -0
  27. package/dist/components/PromotionCard/PromotionCardFooter.js +12 -0
  28. package/dist/components/PromotionCard/PromotionCardHeader.d.ts +11 -0
  29. package/dist/components/PromotionCard/PromotionCardHeader.js +17 -0
  30. package/dist/components/PromotionCard/PromotionCardIcon.d.ts +10 -0
  31. package/dist/components/PromotionCard/PromotionCardIcon.js +15 -0
  32. package/dist/components/PromotionCard/PromotionCardTitle.d.ts +9 -0
  33. package/dist/components/PromotionCard/PromotionCardTitle.js +12 -0
  34. package/dist/components/PromotionCard/index.d.ts +2 -0
  35. package/dist/components/SmartEllipsis/SmartEllipsis.d.ts +5 -0
  36. package/dist/components/SmartEllipsis/SmartEllipsis.js +21 -0
  37. package/dist/components/SmartEllipsis/index.d.ts +2 -0
  38. package/dist/components/Toolbar/Toolbar.js +1 -1
  39. package/dist/components/index.d.ts +2 -0
  40. package/dist/editor.js +40 -40
  41. package/dist/hooks/useConversation/useConversation.js +1 -3
  42. package/dist/hooks/useDropdown/useDropdown.js +1 -1
  43. package/dist/hooks/useEdificeIcons/useEdificeIcons.d.ts +1 -0
  44. package/dist/hooks/useEdificeIcons/useEdificeIcons.js +5 -0
  45. package/dist/hooks/useZoom/index.d.ts +1 -0
  46. package/dist/hooks/useZoom/useZoom.d.ts +7 -0
  47. package/dist/hooks/useZoom/useZoom.js +14 -0
  48. package/dist/index.js +231 -226
  49. package/dist/modals.js +18 -18
  50. package/dist/modules/comments/components/Comment.js +4 -4
  51. package/dist/modules/comments/components/CommentDate.js +10 -7
  52. package/dist/modules/comments/components/CommentDeleted.js +1 -1
  53. package/dist/modules/comments/components/CommentForm.d.ts +1 -1
  54. package/dist/modules/comments/components/CommentForm.js +6 -6
  55. package/dist/modules/comments/components/CommentHeader.d.ts +3 -0
  56. package/dist/modules/comments/components/CommentHeader.js +8 -0
  57. package/dist/modules/comments/components/CommentTitle.js +1 -1
  58. package/dist/modules/comments/provider/CommentProvider.js +4 -4
  59. package/dist/modules/editor/hooks/useTipTapEditor.js +4 -4
  60. package/dist/modules/modals/OnboardingModal/OnboardingModal.js +5 -5
  61. package/dist/modules/modals/ResourceModal/ResourceModal.js +1 -2
  62. package/dist/modules/multimedia/FileCard/FileCard.js +1 -1
  63. package/dist/modules/multimedia/Linker/ExternalLinker/ExternalLinker.js +1 -2
  64. package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.js +1 -2
  65. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +1 -1
  66. package/dist/multimedia.js +10 -10
  67. package/dist/providers/AntThemeProvider/antThemeConfig.js +1 -2
  68. package/package.json +7 -6
  69. package/dist/components/DatePicker/DatePicker.d.ts +0 -57
@@ -0,0 +1,10 @@
1
+ export interface PromotionCardIconProps {
2
+ backgroundColor: string;
3
+ icon: React.ReactNode;
4
+ className?: string;
5
+ }
6
+ declare const PromotionCardIcon: {
7
+ ({ backgroundColor, icon, className, }: PromotionCardIconProps): import("react/jsx-runtime").JSX.Element;
8
+ displayName: string;
9
+ };
10
+ export default PromotionCardIcon;
@@ -0,0 +1,15 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { clsx } from "clsx";
3
+ const PromotionCardIcon = ({
4
+ backgroundColor,
5
+ icon,
6
+ className
7
+ }) => {
8
+ const classNames = clsx("promotion-card-icon", className);
9
+ return /* @__PURE__ */ jsx("div", { className: classNames, style: {
10
+ backgroundColor
11
+ }, children: icon });
12
+ };
13
+ export {
14
+ PromotionCardIcon as default
15
+ };
@@ -0,0 +1,9 @@
1
+ export interface PromotionCardTitleProps {
2
+ children: React.ReactNode;
3
+ className?: string;
4
+ }
5
+ declare const PromotionCardTitle: {
6
+ ({ children, className, }: PromotionCardTitleProps): import("react/jsx-runtime").JSX.Element;
7
+ displayName: string;
8
+ };
9
+ export default PromotionCardTitle;
@@ -0,0 +1,12 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import clsx from "clsx";
3
+ const PromotionCardTitle = ({
4
+ children,
5
+ className
6
+ }) => {
7
+ const classNames = clsx("promotion-card-title", className);
8
+ return /* @__PURE__ */ jsx("h3", { className: classNames, children });
9
+ };
10
+ export {
11
+ PromotionCardTitle as default
12
+ };
@@ -0,0 +1,2 @@
1
+ export { default as PromotionCard } from './PromotionCard';
2
+ export * from './PromotionCard';
@@ -0,0 +1,5 @@
1
+ interface SmartEllipsisProps {
2
+ text: string;
3
+ }
4
+ export default function SmartEllipsis({ text }: SmartEllipsisProps): import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,21 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useRef, useState, useEffect } from "react";
3
+ function SmartEllipsis({
4
+ text
5
+ }) {
6
+ const ref = useRef(null), [displayText, setDisplayText] = useState(text), updateText = () => {
7
+ const el = ref.current;
8
+ if (el)
9
+ if (el.textContent = text, el.scrollWidth > el.clientWidth) {
10
+ let startText = text.slice(0, Math.ceil(text.length / 2)), endText = text.slice(Math.ceil(text.length / 2));
11
+ for (; startText.length > 1 && endText.length > 1 && el.scrollWidth > el.clientWidth; )
12
+ startText = startText.slice(0, -1), endText = endText.slice(1), el.textContent = `${startText}…${endText}`;
13
+ setDisplayText(el.textContent);
14
+ } else
15
+ setDisplayText(text);
16
+ };
17
+ return useEffect(() => (updateText(), window.addEventListener("resize", updateText), () => window.removeEventListener("resize", updateText)), [text]), /* @__PURE__ */ jsx("span", { ref, className: "smart-ellipsis", children: displayText });
18
+ }
19
+ export {
20
+ SmartEllipsis as default
21
+ };
@@ -0,0 +1,2 @@
1
+ export * from './SmartEllipsis';
2
+ export { default as SmartEllipsis } from './SmartEllipsis';
@@ -2,11 +2,11 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { forwardRef, useState, useRef, useEffect, createElement } from "react";
3
3
  import clsx from "clsx";
4
4
  import useBreakpoint from "../../hooks/useBreakpoint/useBreakpoint.js";
5
- import { mergeRefs } from "../../utilities/refs/ref.js";
6
5
  import Tooltip from "../Tooltip/Tooltip.js";
7
6
  import Button from "../Button/Button.js";
8
7
  import Dropdown from "../Dropdown/Dropdown.js";
9
8
  import IconButton from "../Button/IconButton.js";
9
+ import { mergeRefs } from "../../utilities/refs/ref.js";
10
10
  const Toolbar = /* @__PURE__ */ forwardRef(({
11
11
  items,
12
12
  variant = "default",
@@ -29,10 +29,12 @@ export * from './List';
29
29
  export * from './Loading';
30
30
  export * from './LoadingScreen';
31
31
  export * from './Logo';
32
+ export * from './MediaViewer';
32
33
  export * from './Menu';
33
34
  export * from './Modal';
34
35
  export * from './Popover';
35
36
  export * from './PreventPropagation';
37
+ export * from './PromotionCard';
36
38
  export * from './Radio';
37
39
  export * from './RadioCard';
38
40
  export * from './SearchBar';
package/dist/editor.js CHANGED
@@ -1,30 +1,31 @@
1
1
  import { EditorContent, Editor, useEditor } from "@tiptap/react";
2
2
  import { default as default2 } from "@tiptap/starter-kit";
3
- import { default as default3 } from "./modules/editor/components/Editor/Editor.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";
3
+ import { default as default3 } from "./modules/editor/components/NodeView/AttachmentNodeView.js";
4
+ import { default as default4 } from "./modules/editor/components/Renderer/AttachmentRenderer.js";
5
+ import { default as default5 } from "./modules/editor/components/NodeView/AudioNodeView.js";
6
+ import { default as default6 } from "./modules/editor/components/Renderer/AudioRenderer.js";
7
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";
8
+ import { default as default8 } from "./modules/editor/components/NodeView/ConversationHistoryNodeView.js";
9
+ import { default as default9 } from "./modules/editor/components/Renderer/ConversationHistoryRenderer.js";
10
+ import { default as default10 } from "./modules/editor/components/Editor/Editor.js";
11
+ import { default as default11 } from "./modules/editor/components/Editor/EditorPreview.js";
12
+ import { default as default12 } from "./modules/editor/components/Editor/EditorPreviewSkeleton.js";
13
+ import { default as default13 } from "./modules/editor/components/Editor/EditorSkeleton.js";
14
+ import { default as default14 } from "./modules/editor/components/NodeView/IframeNodeView.js";
15
+ import { default as default15 } from "./modules/editor/components/NodeView/ImageNodeView.js";
16
+ import { default as default16 } from "./modules/editor/components/NodeView/InformationPaneNodeView.js";
17
+ import { default as default17 } from "./modules/editor/components/Renderer/InformationPaneRenderer.js";
18
+ import { default as default18 } from "./modules/editor/components/Toolbar/LinkToolbar.js";
19
+ import { default as default19 } from "./modules/editor/components/NodeView/LinkerNodeView.js";
20
+ import { default as default20 } from "./modules/editor/components/Renderer/LinkerRenderer.js";
21
+ import { default as default21 } from "./modules/editor/components/Renderer/MediaRenderer.js";
22
22
  import { default as default22 } from "./modules/editor/components/Toolbar/TableToolbar.js";
23
- import { default as default23 } from "./modules/editor/components/Toolbar/LinkToolbar.js";
23
+ import { default as default23 } from "./modules/editor/components/NodeView/VideoNodeView.js";
24
+ import { EditorContext, useEditorContext } from "./modules/editor/hooks/useEditorContext.js";
24
25
  import { EditorToolbar } from "./modules/editor/components/EditorToolbar/EditorToolbar.js";
25
26
  import { useActionOptions } from "./modules/editor/hooks/useActionOptions.js";
27
+ import { useCantooEditor } from "./modules/editor/hooks/useCantooEditor.js";
26
28
  import { useCommentEditor } from "./modules/editor/hooks/useCommentEditor.js";
27
- import { EditorContext, useEditorContext } from "./modules/editor/hooks/useEditorContext.js";
28
29
  import { useImageModal } from "./modules/editor/hooks/useImageModal.js";
29
30
  import { useImageSelection } from "./modules/editor/hooks/useImageSelection.js";
30
31
  import { useLinkToolbar } from "./modules/editor/hooks/useLinkToolbar.js";
@@ -34,34 +35,33 @@ import { useResizeMedia } from "./modules/editor/hooks/useResizeMedia.js";
34
35
  import { useSpeechRecognition } from "./modules/editor/hooks/useSpeechRecognition.js";
35
36
  import { useSpeechSynthetisis } from "./modules/editor/hooks/useSpeechSynthetisis.js";
36
37
  import { useTipTapEditor } from "./modules/editor/hooks/useTipTapEditor.js";
37
- import { useCantooEditor } from "./modules/editor/hooks/useCantooEditor.js";
38
38
  export {
39
- default8 as AttachmentNodeView,
40
- default16 as AttachmentRenderer,
41
- default9 as AudioNodeView,
42
- default17 as AudioRenderer,
39
+ default3 as AttachmentNodeView,
40
+ default4 as AttachmentRenderer,
41
+ default5 as AudioNodeView,
42
+ default6 as AudioRenderer,
43
43
  default7 as BubbleMenuEditImage,
44
- default10 as ConversationHistoryNodeView,
45
- default18 as ConversationHistoryRenderer,
46
- default3 as Editor,
44
+ default8 as ConversationHistoryNodeView,
45
+ default9 as ConversationHistoryRenderer,
46
+ default10 as Editor,
47
47
  EditorContent,
48
48
  EditorContext,
49
49
  Editor as EditorInstance,
50
- default4 as EditorPreview,
51
- default5 as EditorPreviewSkeleton,
52
- default6 as EditorSkeleton,
50
+ default11 as EditorPreview,
51
+ default12 as EditorPreviewSkeleton,
52
+ default13 as EditorSkeleton,
53
53
  EditorToolbar,
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,
54
+ default14 as IframeNodeView,
55
+ default15 as ImageNodeView,
56
+ default16 as InformationPaneNodeView,
57
+ default17 as InformationPaneRenderer,
58
+ default18 as LinkToolbar,
59
+ default19 as LinkerNodeView,
60
+ default20 as LinkerRenderer,
61
+ default21 as MediaRenderer,
62
62
  default2 as StarterKit,
63
63
  default22 as TableToolbar,
64
- default13 as VideoNodeView,
64
+ default23 as VideoNodeView,
65
65
  useActionOptions,
66
66
  useCantooEditor,
67
67
  useCommentEditor,
@@ -6,9 +6,7 @@ const useConversation = () => {
6
6
  const zimbraWorkflow = useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|view"), zimbraPreauth = useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|preauth"), [msgLink, setMsgLink] = useState(""), queryParams = {
7
7
  unread: !0,
8
8
  _: (/* @__PURE__ */ new Date()).getTime()
9
- };
10
- zimbraWorkflow || (queryParams.queryparam_token = (/* @__PURE__ */ new Date()).getTime());
11
- const {
9
+ }, {
12
10
  data: messages
13
11
  } = useQuery({
14
12
  queryKey: ["folder", "count", "inbox"],
@@ -1,5 +1,5 @@
1
1
  import { useId, useState, useRef, useEffect, useCallback } from "react";
2
- import { useFloating, offset, size, flip, autoUpdate, useHover, safePolygon } from "@floating-ui/react";
2
+ import { useFloating, autoUpdate, offset, size, flip, useHover, safePolygon } from "@floating-ui/react";
3
3
  import { mergeRefs } from "../../utilities/refs/ref.js";
4
4
  const useDropdown = (placement, extraTriggerKeyDownHandler, isTriggerHovered = !1, focusOnVisible = !0, openOnSpace = !0, focusOnMouseEnter = !0) => {
5
5
  const id = useId(), [visible, setVisible] = useState(!1), [activeIndex, setActiveIndex] = useState(-1), [isFocused, setIsFocused] = useState(null), {
@@ -3,6 +3,7 @@ export default function useEdificeIcons(): {
3
3
  getIconClass: (app: IWebApp | string) => string;
4
4
  getBackgroundIconClass: (app: IWebApp | string) => string;
5
5
  getBackgroundLightIconClass: (app: IWebApp | string) => string;
6
+ getBorderIconClass: (app: IWebApp | string) => string;
6
7
  getIconCode: (app: IWebApp | string | undefined) => string;
7
8
  getWidgetIconClass: (widget: IWidget) => string;
8
9
  isIconUrl: (icon: string) => string | boolean;
@@ -78,6 +78,10 @@ function useEdificeIcons() {
78
78
  const appCode = getIconCode(app);
79
79
  return appCode ? `bg-light-${appCode}` : "bg-light-placeholder";
80
80
  }
81
+ function getBorderIconClass(app) {
82
+ const appCode = getIconCode(app);
83
+ return appCode ? `border-app-${appCode}` : "border-app-placeholder";
84
+ }
81
85
  function getWidgetIconClass(widget) {
82
86
  return iconOfWidget[widget.platformConf.name];
83
87
  }
@@ -85,6 +89,7 @@ function useEdificeIcons() {
85
89
  getIconClass,
86
90
  getBackgroundIconClass,
87
91
  getBackgroundLightIconClass,
92
+ getBorderIconClass,
88
93
  getIconCode,
89
94
  getWidgetIconClass,
90
95
  isIconUrl
@@ -0,0 +1 @@
1
+ export { default as useZoom } from './useZoom';
@@ -0,0 +1,7 @@
1
+ export default function useZoom(initialScale?: number, maxScale?: number, minScale?: number, step?: number): {
2
+ scale: number;
3
+ zoomIn: () => void;
4
+ zoomOut: () => void;
5
+ resetZoom: () => void;
6
+ setScale: import('react').Dispatch<import('react').SetStateAction<number>>;
7
+ };
@@ -0,0 +1,14 @@
1
+ import { useState } from "react";
2
+ function useZoom(initialScale = 1, maxScale = 2, minScale = 0.5, step = 0.5) {
3
+ const [scale, setScale] = useState(initialScale);
4
+ return {
5
+ scale,
6
+ zoomIn: () => setScale((prev) => Math.min(prev + step, maxScale)),
7
+ zoomOut: () => setScale((prev) => Math.max(prev - step, minScale)),
8
+ resetZoom: () => setScale(initialScale),
9
+ setScale
10
+ };
11
+ }
12
+ export {
13
+ useZoom as default
14
+ };