@edifice.io/react 2.5.8 → 2.5.9-develop-pedago.20260203115913

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 (109) hide show
  1. package/README.md +5 -0
  2. package/dist/_virtual/isSameOrAfter.js +4 -0
  3. package/dist/_virtual/isToday.js +4 -0
  4. package/dist/components/Badge/Badge.d.ts +7 -1
  5. package/dist/components/Badge/Badge.js +13 -1
  6. package/dist/components/DatePicker/DatePicker.d.ts +57 -0
  7. package/dist/components/DatePicker/DatePicker.js +6 -3
  8. package/dist/components/Dropdown/DropdownContext.js +1 -1
  9. package/dist/components/Form/FormContext.js +1 -1
  10. package/dist/components/Layout/Layout.js +1 -2
  11. package/dist/components/Layout/components/Header.js +5 -2
  12. package/dist/components/Layout/components/WidgetApps.js +2 -2
  13. package/dist/components/MediaViewer/MediaViewer.d.ts +17 -0
  14. package/dist/components/MediaViewer/MediaViewer.js +36 -0
  15. package/dist/components/MediaViewer/MediaWrapper.d.ts +7 -0
  16. package/dist/components/MediaViewer/MediaWrapper.js +72 -0
  17. package/dist/components/MediaViewer/PdfViewer.d.ts +4 -0
  18. package/dist/components/MediaViewer/PdfViewer.js +26 -0
  19. package/dist/components/MediaViewer/ToolbarViewer.d.ts +7 -0
  20. package/dist/components/MediaViewer/ToolbarViewer.js +41 -0
  21. package/dist/components/MediaViewer/ToolbarZoom.d.ts +4 -0
  22. package/dist/components/MediaViewer/ToolbarZoom.js +19 -0
  23. package/dist/components/MediaViewer/index.d.ts +2 -0
  24. package/dist/components/Modal/Modal.d.ts +4 -0
  25. package/dist/components/Modal/Modal.js +13 -12
  26. package/dist/components/PromotionCard/PromotionCard.d.ts +74 -0
  27. package/dist/components/PromotionCard/PromotionCard.js +31 -0
  28. package/dist/components/PromotionCard/PromotionCardBody.d.ts +10 -0
  29. package/dist/components/PromotionCard/PromotionCardBody.js +15 -0
  30. package/dist/components/PromotionCard/PromotionCardDescription.d.ts +9 -0
  31. package/dist/components/PromotionCard/PromotionCardDescription.js +12 -0
  32. package/dist/components/PromotionCard/PromotionCardFooter.d.ts +9 -0
  33. package/dist/components/PromotionCard/PromotionCardFooter.js +12 -0
  34. package/dist/components/PromotionCard/PromotionCardHeader.d.ts +11 -0
  35. package/dist/components/PromotionCard/PromotionCardHeader.js +17 -0
  36. package/dist/components/PromotionCard/PromotionCardIcon.d.ts +10 -0
  37. package/dist/components/PromotionCard/PromotionCardIcon.js +15 -0
  38. package/dist/components/PromotionCard/PromotionCardTitle.d.ts +9 -0
  39. package/dist/components/PromotionCard/PromotionCardTitle.js +12 -0
  40. package/dist/components/PromotionCard/index.d.ts +2 -0
  41. package/dist/components/SmartEllipsis/SmartEllipsis.d.ts +5 -0
  42. package/dist/components/SmartEllipsis/SmartEllipsis.js +21 -0
  43. package/dist/components/SmartEllipsis/index.d.ts +2 -0
  44. package/dist/components/Toolbar/Toolbar.js +1 -1
  45. package/dist/components/index.d.ts +2 -0
  46. package/dist/editor.js +40 -40
  47. package/dist/hooks/useConversation/useConversation.js +3 -1
  48. package/dist/hooks/useDate/useDate.d.ts +5 -1
  49. package/dist/hooks/useDate/useDate.js +18 -2
  50. package/dist/hooks/useDropdown/useDropdown.js +1 -1
  51. package/dist/hooks/useDropzone/useDropzone.js +21 -16
  52. package/dist/hooks/useEdificeIcons/useEdificeIcons.d.ts +1 -0
  53. package/dist/hooks/useEdificeIcons/useEdificeIcons.js +5 -0
  54. package/dist/hooks/useZoom/index.d.ts +1 -0
  55. package/dist/hooks/useZoom/useZoom.d.ts +7 -0
  56. package/dist/hooks/useZoom/useZoom.js +14 -0
  57. package/dist/icons-apps.js +234 -232
  58. package/dist/icons.js +366 -350
  59. package/dist/index.js +231 -226
  60. package/dist/modals.js +18 -18
  61. package/dist/modules/audience/ViewsCounter.d.ts +3 -17
  62. package/dist/modules/audience/ViewsCounter.js +9 -7
  63. package/dist/modules/comments/components/Comment.js +4 -4
  64. package/dist/modules/comments/components/CommentDate.js +7 -10
  65. package/dist/modules/comments/components/CommentDeleted.js +1 -1
  66. package/dist/modules/comments/components/CommentForm.d.ts +1 -1
  67. package/dist/modules/comments/components/CommentForm.js +6 -6
  68. package/dist/modules/comments/components/CommentTitle.js +1 -1
  69. package/dist/modules/comments/provider/CommentProvider.js +4 -4
  70. package/dist/modules/comments/types.d.ts +3 -1
  71. package/dist/modules/editor/hooks/useTipTapEditor.js +4 -4
  72. package/dist/modules/icons/components/IconAdjustSettings.d.ts +7 -0
  73. package/dist/modules/icons/components/IconAdjustSettings.js +12 -0
  74. package/dist/modules/icons/components/IconAiFill.d.ts +7 -0
  75. package/dist/modules/icons/components/IconAiFill.js +12 -0
  76. package/dist/modules/icons/components/IconCalendarEdit.d.ts +7 -0
  77. package/dist/modules/icons/components/IconCalendarEdit.js +12 -0
  78. package/dist/modules/icons/components/IconCollect.d.ts +7 -0
  79. package/dist/modules/icons/components/IconCollect.js +12 -0
  80. package/dist/modules/icons/components/IconExercizerAi.d.ts +7 -0
  81. package/dist/modules/icons/components/IconExercizerAi.js +14 -0
  82. package/dist/modules/icons/components/IconLabel.d.ts +7 -0
  83. package/dist/modules/icons/components/IconLabel.js +12 -0
  84. package/dist/modules/icons/components/IconRender.d.ts +7 -0
  85. package/dist/modules/icons/components/IconRender.js +12 -0
  86. package/dist/modules/icons/components/IconTeacher.d.ts +7 -0
  87. package/dist/modules/icons/components/IconTeacher.js +12 -0
  88. package/dist/modules/icons/components/apps/IconAssistancetic.d.ts +7 -0
  89. package/dist/modules/icons/components/apps/IconAssistancetic.js +14 -0
  90. package/dist/modules/icons/components/apps/index.d.ts +1 -0
  91. package/dist/modules/icons/components/index.d.ts +8 -0
  92. package/dist/modules/modals/OnboardingModal/OnboardingModal.js +5 -5
  93. package/dist/modules/modals/ResourceModal/ResourceModal.js +1 -2
  94. package/dist/modules/modals/ShareModal/ShareResources.d.ts +3 -0
  95. package/dist/modules/modals/ShareModal/ShareResources.js +9 -5
  96. package/dist/modules/multimedia/FileCard/FileCard.js +1 -1
  97. package/dist/modules/multimedia/Linker/ExternalLinker/ExternalLinker.js +1 -2
  98. package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.js +1 -2
  99. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +1 -1
  100. package/dist/multimedia.js +10 -10
  101. package/dist/node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/isSameOrAfter.js +18 -0
  102. package/dist/node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/isToday.js +19 -0
  103. package/dist/providers/AntThemeProvider/antThemeConfig.js +1 -2
  104. package/dist/utilities/mime-types/index.d.ts +1 -0
  105. package/dist/utilities/mime-types/mime-types-utils.d.ts +1 -0
  106. package/dist/utilities/mime-types/mime-types-utils.js +4 -0
  107. package/package.json +7 -6
  108. package/dist/modules/comments/components/CommentHeader.d.ts +0 -3
  109. package/dist/modules/comments/components/CommentHeader.js +0 -8
@@ -0,0 +1,10 @@
1
+ export interface PromotionCardBodyProps {
2
+ children: React.ReactNode;
3
+ textColor?: string;
4
+ className?: string;
5
+ }
6
+ declare const PromotionCardBody: {
7
+ ({ children, textColor, className, }: PromotionCardBodyProps): import("react/jsx-runtime").JSX.Element;
8
+ displayName: string;
9
+ };
10
+ export default PromotionCardBody;
@@ -0,0 +1,15 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import clsx from "clsx";
3
+ const PromotionCardBody = ({
4
+ children,
5
+ textColor,
6
+ className
7
+ }) => {
8
+ const classNames = clsx("promotion-card-body", className);
9
+ return /* @__PURE__ */ jsx("div", { className: classNames, style: {
10
+ color: textColor
11
+ }, children });
12
+ };
13
+ export {
14
+ PromotionCardBody as default
15
+ };
@@ -0,0 +1,9 @@
1
+ export interface PromotionCardDescriptionProps {
2
+ children: React.ReactNode;
3
+ className?: string;
4
+ }
5
+ declare const PromotionCardDescription: {
6
+ ({ children, className, }: PromotionCardDescriptionProps): import("react/jsx-runtime").JSX.Element;
7
+ displayName: string;
8
+ };
9
+ export default PromotionCardDescription;
@@ -0,0 +1,12 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { clsx } from "clsx";
3
+ const PromotionCardDescription = ({
4
+ children,
5
+ className
6
+ }) => {
7
+ const classNames = clsx("promotion-card-description", className);
8
+ return /* @__PURE__ */ jsx("div", { className: classNames, children });
9
+ };
10
+ export {
11
+ PromotionCardDescription as default
12
+ };
@@ -0,0 +1,9 @@
1
+ export interface PromotionCardFooterProps {
2
+ children: React.ReactNode;
3
+ className?: string;
4
+ }
5
+ declare const PromotionCardFooter: {
6
+ ({ children, className, }: PromotionCardFooterProps): import("react/jsx-runtime").JSX.Element;
7
+ displayName: string;
8
+ };
9
+ export default PromotionCardFooter;
@@ -0,0 +1,12 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { clsx } from "clsx";
3
+ const PromotionCardFooter = ({
4
+ children,
5
+ className
6
+ }) => {
7
+ const classNames = clsx("promotion-card-footer", className);
8
+ return /* @__PURE__ */ jsx("div", { className: classNames, children });
9
+ };
10
+ export {
11
+ PromotionCardFooter as default
12
+ };
@@ -0,0 +1,11 @@
1
+ export interface PromotionCardHeaderProps {
2
+ children: React.ReactNode;
3
+ backgroundColor?: string;
4
+ textColor?: string;
5
+ className?: string;
6
+ }
7
+ declare const PromotionCardHeader: {
8
+ ({ backgroundColor, textColor, children, className, }: PromotionCardHeaderProps): import("react/jsx-runtime").JSX.Element;
9
+ displayName: string;
10
+ };
11
+ export default PromotionCardHeader;
@@ -0,0 +1,17 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { clsx } from "clsx";
3
+ const PromotionCardHeader = ({
4
+ backgroundColor,
5
+ textColor,
6
+ children,
7
+ className
8
+ }) => {
9
+ const classNames = clsx("promotion-card-header", className);
10
+ return /* @__PURE__ */ jsx("div", { className: classNames, style: {
11
+ backgroundColor,
12
+ color: textColor
13
+ }, children });
14
+ };
15
+ export {
16
+ PromotionCardHeader as default
17
+ };
@@ -0,0 +1,10 @@
1
+ export interface PromotionCardIconProps {
2
+ icon: React.ReactNode;
3
+ backgroundColor?: string;
4
+ className?: string;
5
+ }
6
+ declare const PromotionCardIcon: {
7
+ ({ icon, backgroundColor, 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
+ icon,
5
+ backgroundColor,
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,7 +6,9 @@ const useConversation = () => {
6
6
  const zimbraWorkflow = useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|view"), zimbraPreauth = useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|preauth"), [msgLink, setMsgLink] = useState(""), queryParams = {
7
7
  unread: !0,
8
8
  _: (/* @__PURE__ */ new Date()).getTime()
9
- }, {
9
+ };
10
+ zimbraWorkflow || (queryParams.queryparam_token = (/* @__PURE__ */ new Date()).getTime());
11
+ const {
10
12
  data: messages
11
13
  } = useQuery({
12
14
  queryKey: ["folder", "count", "inbox"],
@@ -1,10 +1,11 @@
1
+ import { OpUnitType } from 'dayjs';
1
2
  export type MongoDate = {
2
3
  $date: number | string;
3
4
  };
4
5
  export type IsoDate = string;
5
6
  export type NumberDate = number;
6
7
  /** Date formats we are going to deal with. */
7
- export type CoreDate = IsoDate | MongoDate | NumberDate;
8
+ export type CoreDate = IsoDate | MongoDate | NumberDate | Date;
8
9
  /**
9
10
  * Custom React hook for date parsing, formatting, and localization.
10
11
  *
@@ -25,4 +26,7 @@ export default function useDate(): {
25
26
  fromNow: (date: CoreDate) => string;
26
27
  formatDate: (date: CoreDate, format?: string) => string;
27
28
  formatTimeAgo: (date: CoreDate) => string;
29
+ dateIsSame: (date: CoreDate, date2: CoreDate, unit?: OpUnitType) => boolean;
30
+ dateIsSameOrAfter: (date: CoreDate, date2: CoreDate, unit?: OpUnitType) => boolean;
31
+ dateIsToday: (date: CoreDate) => boolean;
28
32
  };
@@ -1,5 +1,7 @@
1
1
  import { useCallback } from "react";
2
2
  import dayjs from "dayjs";
3
+ import isSameOrAfter from "../../node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/isSameOrAfter.js";
4
+ import isToday from "../../node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/plugin/isToday.js";
3
5
  import customParseFormat from "dayjs/plugin/customParseFormat.js";
4
6
  import localizedFormat from "dayjs/plugin/localizedFormat.js";
5
7
  import relativeTime from "dayjs/plugin/relativeTime.js";
@@ -13,6 +15,8 @@ import { useEdificeClient } from "../../providers/EdificeClientProvider/EdificeC
13
15
  dayjs.extend(relativeTime);
14
16
  dayjs.extend(customParseFormat);
15
17
  dayjs.extend(localizedFormat);
18
+ dayjs.extend(isSameOrAfter);
19
+ dayjs.extend(isToday);
16
20
  function useDate() {
17
21
  const {
18
22
  currentLanguage
@@ -29,7 +33,7 @@ function useDate() {
29
33
  }, [currentLanguage]), toComputedDate = useCallback((date) => {
30
34
  let computedDate = dayjs();
31
35
  try {
32
- return typeof date > "u" ? void 0 : (typeof date == "string" ? computedDate = parseDate(date) : typeof date == "number" ? computedDate = dayjs(date).locale(currentLanguage) : typeof date.$date == "number" ? computedDate = dayjs(new Date(date.$date)).locale(currentLanguage) : typeof date.$date == "string" && (computedDate = parseDate(date.$date)), computedDate);
36
+ return typeof date > "u" ? void 0 : (typeof date == "string" ? computedDate = parseDate(date) : date instanceof Date ? computedDate = dayjs(date).locale(currentLanguage) : typeof date == "number" ? computedDate = dayjs(date).locale(currentLanguage) : typeof date.$date == "number" ? computedDate = dayjs(new Date(date.$date)).locale(currentLanguage) : typeof date.$date == "string" && (computedDate = parseDate(date.$date)), computedDate);
33
37
  } catch (error) {
34
38
  console.error(error);
35
39
  }
@@ -59,11 +63,23 @@ function useDate() {
59
63
  dayjsFormat = format;
60
64
  }
61
65
  return computedDate != null && computedDate.isValid() ? computedDate.locale(currentLanguage).format(dayjsFormat) : "";
66
+ }, [currentLanguage, parseDate]), dateIsSame = useCallback((date, date2, unit = "day") => {
67
+ const computedDate = toComputedDate(date), computedDate2 = toComputedDate(date2);
68
+ return (computedDate == null ? void 0 : computedDate.isSame(computedDate2, unit)) ?? !1;
69
+ }, [currentLanguage, parseDate]), dateIsSameOrAfter = useCallback((date, date2, unit = "day") => {
70
+ const computedDate = toComputedDate(date), computedDate2 = toComputedDate(date2);
71
+ return (computedDate == null ? void 0 : computedDate.isSameOrAfter(computedDate2, unit)) ?? !1;
72
+ }, [currentLanguage, parseDate]), dateIsToday = useCallback((date) => {
73
+ const computedDate = toComputedDate(date);
74
+ return (computedDate == null ? void 0 : computedDate.isToday()) ?? !1;
62
75
  }, [currentLanguage, parseDate]);
63
76
  return {
64
77
  fromNow,
65
78
  formatDate,
66
- formatTimeAgo
79
+ formatTimeAgo,
80
+ dateIsSame,
81
+ dateIsSameOrAfter,
82
+ dateIsToday
67
83
  };
68
84
  }
69
85
  export {
@@ -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), {
@@ -1,5 +1,5 @@
1
1
  import { useState, useRef } from "react";
2
- import heic2any from "heic2any";
2
+ import { HEIC_MIME_TYPES } from "../../utilities/mime-types/mime-types-utils.js";
3
3
  const useDropzone = (props) => {
4
4
  const [dragging, setDragging] = useState(!1), [files, setFiles] = useState([]), inputRef = useRef(null), addFile = (file) => {
5
5
  addFiles([file]);
@@ -32,21 +32,26 @@ const useDropzone = (props) => {
32
32
  })
33
33
  ));
34
34
  filesToAdd.reverse(), props != null && props.forceFilters ? (filesToAdd = applyInputFiltersOn(filesToAdd), filesToAdd && filesToAdd.length && setFiles((prevFiles) => [...prevFiles, ...filesToAdd])) : setFiles((prevFiles) => [...prevFiles, ...files2]);
35
- }, convertHEICImages = async (files2) => 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
+ }, convertHEICImages = async (files2) => {
36
+ if (files2 === null || files2.length === 0)
37
+ return [];
38
+ let heic2any;
39
+ return files2.some((file) => HEIC_MIME_TYPES.includes(file.type)) && (heic2any = (await import("heic2any")).default), Promise.all(files2.map(async (file) => {
40
+ if (HEIC_MIME_TYPES.includes(file.type) && heic2any)
41
+ try {
42
+ const converted = await heic2any({
43
+ blob: file,
44
+ toType: "image/jpeg"
45
+ });
46
+ return new File([converted], file.name.replace(/\.(heic|heif)$/i, ".jpeg"), {
47
+ type: "image/jpeg"
48
+ });
49
+ } catch (error) {
50
+ return console.error(`Failed to convert HEIC image: ${file.name}`, error), file;
51
+ }
52
+ return file;
53
+ }));
54
+ }, cleanFiles = () => {
50
55
  setFiles([]);
51
56
  }, handleOnChange = (event) => {
52
57
  const files2 = event.target.files;
@@ -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
+ };