@edifice.io/react 2.5.8-develop-b2school.20260129151629 → 2.5.8-develop-pedago.20260129172409

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 (103) hide show
  1. package/dist/_virtual/de_DE.js +4 -0
  2. package/dist/_virtual/de_DE2.js +4 -0
  3. package/dist/_virtual/de_DE3.js +4 -0
  4. package/dist/_virtual/de_DE4.js +4 -0
  5. package/dist/_virtual/de_DE5.js +4 -0
  6. package/dist/_virtual/de_DE6.js +4 -0
  7. package/dist/_virtual/es_ES.js +4 -0
  8. package/dist/_virtual/es_ES2.js +4 -0
  9. package/dist/_virtual/es_ES3.js +4 -0
  10. package/dist/_virtual/es_ES4.js +4 -0
  11. package/dist/_virtual/es_ES5.js +4 -0
  12. package/dist/_virtual/es_ES6.js +4 -0
  13. package/dist/_virtual/it_IT.js +4 -0
  14. package/dist/_virtual/it_IT2.js +4 -0
  15. package/dist/_virtual/it_IT3.js +4 -0
  16. package/dist/_virtual/it_IT4.js +4 -0
  17. package/dist/_virtual/it_IT5.js +4 -0
  18. package/dist/_virtual/it_IT6.js +4 -0
  19. package/dist/_virtual/pt_PT.js +4 -0
  20. package/dist/_virtual/pt_PT2.js +4 -0
  21. package/dist/_virtual/pt_PT3.js +4 -0
  22. package/dist/_virtual/pt_PT4.js +4 -0
  23. package/dist/_virtual/pt_PT5.js +4 -0
  24. package/dist/_virtual/pt_PT6.js +4 -0
  25. package/dist/components/Badge/Badge.d.ts +7 -1
  26. package/dist/components/Badge/Badge.js +13 -1
  27. package/dist/components/MediaViewer/MediaViewer.d.ts +17 -0
  28. package/dist/components/MediaViewer/MediaViewer.js +36 -0
  29. package/dist/components/MediaViewer/MediaWrapper.d.ts +7 -0
  30. package/dist/components/MediaViewer/MediaWrapper.js +72 -0
  31. package/dist/components/MediaViewer/PdfViewer.d.ts +4 -0
  32. package/dist/components/MediaViewer/PdfViewer.js +26 -0
  33. package/dist/components/MediaViewer/ToolbarViewer.d.ts +7 -0
  34. package/dist/components/MediaViewer/ToolbarViewer.js +41 -0
  35. package/dist/components/MediaViewer/ToolbarZoom.d.ts +4 -0
  36. package/dist/components/MediaViewer/ToolbarZoom.js +19 -0
  37. package/dist/components/MediaViewer/index.d.ts +2 -0
  38. package/dist/components/PromotionCard/PromotionCard.d.ts +74 -0
  39. package/dist/components/PromotionCard/PromotionCard.js +31 -0
  40. package/dist/components/PromotionCard/PromotionCardBody.d.ts +10 -0
  41. package/dist/components/PromotionCard/PromotionCardBody.js +15 -0
  42. package/dist/components/PromotionCard/PromotionCardDescription.d.ts +9 -0
  43. package/dist/components/PromotionCard/PromotionCardDescription.js +12 -0
  44. package/dist/components/PromotionCard/PromotionCardFooter.d.ts +9 -0
  45. package/dist/components/PromotionCard/PromotionCardFooter.js +12 -0
  46. package/dist/components/PromotionCard/PromotionCardHeader.d.ts +11 -0
  47. package/dist/components/PromotionCard/PromotionCardHeader.js +17 -0
  48. package/dist/components/PromotionCard/PromotionCardIcon.d.ts +10 -0
  49. package/dist/components/PromotionCard/PromotionCardIcon.js +15 -0
  50. package/dist/components/PromotionCard/PromotionCardTitle.d.ts +9 -0
  51. package/dist/components/PromotionCard/PromotionCardTitle.js +12 -0
  52. package/dist/components/PromotionCard/index.d.ts +2 -0
  53. package/dist/components/SmartEllipsis/SmartEllipsis.d.ts +5 -0
  54. package/dist/components/SmartEllipsis/SmartEllipsis.js +21 -0
  55. package/dist/components/SmartEllipsis/index.d.ts +2 -0
  56. package/dist/components/index.d.ts +2 -0
  57. package/dist/hooks/useEdificeIcons/useEdificeIcons.d.ts +1 -0
  58. package/dist/hooks/useEdificeIcons/useEdificeIcons.js +5 -0
  59. package/dist/hooks/useZoom/index.d.ts +1 -0
  60. package/dist/hooks/useZoom/useZoom.d.ts +7 -0
  61. package/dist/hooks/useZoom/useZoom.js +14 -0
  62. package/dist/icons.js +358 -352
  63. package/dist/index.js +145 -140
  64. package/dist/modules/icons/components/IconAiFill.d.ts +7 -0
  65. package/dist/modules/icons/components/IconAiFill.js +12 -0
  66. package/dist/modules/icons/components/IconExercizerAi.d.ts +7 -0
  67. package/dist/modules/icons/components/IconExercizerAi.js +14 -0
  68. package/dist/modules/icons/components/IconTeacher.d.ts +7 -0
  69. package/dist/modules/icons/components/IconTeacher.js +12 -0
  70. package/dist/modules/icons/components/index.d.ts +3 -0
  71. package/dist/modules/multimedia/FileCard/FileCard.js +1 -1
  72. 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
  73. 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
  74. 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
  75. 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
  76. 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
  77. 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
  78. 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
  79. 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
  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/locale/de_DE.js +145 -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/locale/es_ES.js +145 -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/locale/it_IT.js +156 -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/locale/pt_PT.js +158 -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/time-picker/locale/de_DE.js +10 -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/time-picker/locale/es_ES.js +10 -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/time-picker/locale/it_IT.js +10 -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/time-picker/locale/pt_PT.js +10 -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/locale/de_DE.js +8 -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/locale/es_ES.js +8 -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/locale/it_IT.js +8 -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/locale/pt_PT.js +8 -0
  92. 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
  93. 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
  94. 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
  95. 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
  96. 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
  97. 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
  98. 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
  99. 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
  100. package/dist/providers/AntThemeProvider/AntProvider.js +13 -6
  101. package/package.json +7 -6
  102. package/dist/_virtual/fr.js +0 -4
  103. package/dist/node_modules/.pnpm/dayjs@1.11.19/node_modules/dayjs/locale/fr.js +0 -16
@@ -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 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 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 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
+ };
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { UserProfile } from '@edifice.io/client';
2
+ import { IWebApp, UserProfile } from '@edifice.io/client';
3
3
  export type BadgeRef = HTMLSpanElement;
4
4
  /** Badge variant : notification */
5
5
  export type NotificationBadgeVariant = {
@@ -31,10 +31,16 @@ export type LinkBadgeVariant = {
31
31
  * Beta Badge is used to indicate that a feature is in beta phase.
32
32
  * The color prop allows to customize the badge color to match the app color.
33
33
  * Defaults to black if not provided.
34
+ * Beta Badge has a fixed text 'BÊTA' unless children is provided.
35
+ * If app is provided, the color of the Beta Badge is derived from the application colors.
36
+ * Example:
37
+ * <Badge variant={{ type: 'beta', color: '#823AA1', app: myApp }} />
38
+ * where myApp is of type IWebApp.
34
39
  */
35
40
  export type BetaBadgeVariant = {
36
41
  type: 'beta';
37
42
  color?: string;
43
+ app?: IWebApp;
38
44
  };
39
45
  export type BadgeVariants = NotificationBadgeVariant | ContentBadgeVariant | ProfileBadgeVariant | ChipBadgeVariant | LinkBadgeVariant | BetaBadgeVariant;
40
46
  export interface BadgeProps extends React.ComponentPropsWithRef<'span'> {
@@ -1,6 +1,7 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { forwardRef } from "react";
3
3
  import clsx from "clsx";
4
+ import useEdificeIcons from "../../hooks/useEdificeIcons/useEdificeIcons.js";
4
5
  const Badge = /* @__PURE__ */ forwardRef(({
5
6
  className,
6
7
  variant = {
@@ -10,7 +11,18 @@ const Badge = /* @__PURE__ */ forwardRef(({
10
11
  children,
11
12
  ...restProps
12
13
  }, ref) => {
13
- 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", className);
14
+ const {
15
+ getIconClass,
16
+ getBackgroundLightIconClass,
17
+ getBorderIconClass
18
+ } = useEdificeIcons();
19
+ let badgeColorClassName = "";
20
+ if (variant.type === "beta" && variant.app) {
21
+ const colorAppClassName = getIconClass(variant.app), backgroundLightAppClassName = getBackgroundLightIconClass(variant.app), borderAppClassName = getBorderIconClass(variant.app);
22
+ badgeColorClassName = `${colorAppClassName} ${backgroundLightAppClassName} ${borderAppClassName}`;
23
+ }
24
+ console.log(badgeColorClassName);
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);
14
26
  return /* @__PURE__ */ jsxs("span", { ref, className: classes, style: (() => {
15
27
  if (variant.type !== "beta") return;
16
28
  const color = variant.color ?? "#000000";
@@ -0,0 +1,17 @@
1
+ import { MediaLibraryType } from 'src/modules/multimedia';
2
+ export interface MediaProps {
3
+ name: string;
4
+ url: string;
5
+ type: MediaLibraryType;
6
+ mimeType?: string;
7
+ }
8
+ interface MediaViewerProps {
9
+ onClose: () => void;
10
+ media: MediaProps[];
11
+ indexMedia?: number;
12
+ }
13
+ declare const MediaViewer: {
14
+ ({ onClose, media, indexMedia }: MediaViewerProps): import("react/jsx-runtime").JSX.Element;
15
+ displayName: string;
16
+ };
17
+ export default MediaViewer;
@@ -0,0 +1,36 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { Carousel } from "antd";
3
+ import ToolbarZoom from "./ToolbarZoom.js";
4
+ import useZoom from "../../hooks/useZoom/useZoom.js";
5
+ import ToolbarViewer from "./ToolbarViewer.js";
6
+ import { useState, useEffect } from "react";
7
+ import { MediaWrapper } from "./MediaWrapper.js";
8
+ import Flex from "../Flex/Flex.js";
9
+ const MediaViewer = ({
10
+ onClose,
11
+ media,
12
+ indexMedia = 0
13
+ }) => {
14
+ const {
15
+ zoomIn,
16
+ zoomOut,
17
+ setScale,
18
+ scale
19
+ } = useZoom(1), [currentIndex, setCurrentIndex] = useState(indexMedia);
20
+ return useEffect(() => {
21
+ setCurrentIndex(indexMedia);
22
+ }, [indexMedia]), /* @__PURE__ */ jsxs("div", { className: "media-viewer", children: [
23
+ /* @__PURE__ */ jsx(ToolbarViewer, { onClose, mediaUrl: media[currentIndex].url, mediaName: media[currentIndex].name, nbMedia: media.length, currentIndex }),
24
+ /* @__PURE__ */ jsx(Flex, { className: "media-viewer-inner-overlay", onClick: onClose, children: /* @__PURE__ */ jsxs("div", { className: "media-viewer-inner", onClick: (e) => e.stopPropagation(), children: [
25
+ /* @__PURE__ */ jsx(Carousel, { initialSlide: indexMedia, dots: !1, arrows: !0, draggable: !0, infinite: !1, afterChange: (current) => {
26
+ setCurrentIndex(current);
27
+ }, beforeChange: () => {
28
+ setScale(1);
29
+ }, children: media.map((item, index) => /* @__PURE__ */ jsx("div", { className: "viewer-slide", children: /* @__PURE__ */ jsx(MediaWrapper, { mediaUrl: item.url, mediaType: item.type, mimeType: item.mimeType, scale: index === currentIndex ? scale : 1 }) }, index)) }),
30
+ /* @__PURE__ */ jsx(ToolbarZoom, { zoomIn, zoomOut })
31
+ ] }) })
32
+ ] });
33
+ };
34
+ export {
35
+ MediaViewer as default
36
+ };
@@ -0,0 +1,7 @@
1
+ import { MediaLibraryType } from 'src/modules/multimedia';
2
+ export declare const MediaWrapper: ({ mediaUrl, mediaType, mimeType, scale, }: {
3
+ mediaUrl: string;
4
+ mediaType: MediaLibraryType;
5
+ mimeType?: string;
6
+ scale?: number;
7
+ }) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,72 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import SvgIconTextPage from "../../modules/icons/components/IconTextPage.js";
3
+ import SvgIconLink from "../../modules/icons/components/IconLink.js";
4
+ import SvgIconHeadphone from "../../modules/icons/components/IconHeadphone.js";
5
+ import SvgIconDownload from "../../modules/icons/components/IconDownload.js";
6
+ import SvgIconExternalLink from "../../modules/icons/components/IconExternalLink.js";
7
+ import { useTranslation } from "react-i18next";
8
+ import PdfViewer from "./PdfViewer.js";
9
+ import Flex from "../Flex/Flex.js";
10
+ import Button from "../Button/Button.js";
11
+ import Image from "../Image/Image.js";
12
+ const MediaWrapper = ({
13
+ mediaUrl,
14
+ mediaType,
15
+ mimeType,
16
+ scale
17
+ }) => {
18
+ const {
19
+ t
20
+ } = useTranslation(), imageMediaStyle = {
21
+ flex: "none",
22
+ height: "100%",
23
+ transform: `scale(${scale})`,
24
+ maxHeight: "70vh"
25
+ }, audioStyle = {
26
+ width: "100%",
27
+ maxWidth: "500px"
28
+ }, videoMediaStyle = {
29
+ height: "100%",
30
+ objectFit: "cover",
31
+ transform: `scale(${scale})`
32
+ }, iframeMediaStyle = {
33
+ width: "100%",
34
+ height: "600px",
35
+ maxWidth: "900px",
36
+ transform: `scale(${scale})`
37
+ };
38
+ switch (mediaType) {
39
+ case "image":
40
+ return /* @__PURE__ */ jsx(Image, { className: "rounded-2", src: mediaUrl, alt: mediaType, width: "100%", objectFit: "contain", style: imageMediaStyle });
41
+ case "audio":
42
+ return /* @__PURE__ */ jsxs(Flex, { direction: "column", align: "center", style: {
43
+ height: "200px"
44
+ }, children: [
45
+ /* @__PURE__ */ jsx(Flex, { justify: "center", align: "center", className: "bg-gray-300 h-100 w-100 rounded-2 mb-8", style: {
46
+ maxWidth: "500px"
47
+ }, children: /* @__PURE__ */ jsx(SvgIconHeadphone, { width: 40, height: 40, color: "#B0B0B0" }) }),
48
+ /* @__PURE__ */ jsx("audio", { src: mediaUrl, className: "media-audio", controls: !0, style: audioStyle })
49
+ ] });
50
+ case "video":
51
+ return /* @__PURE__ */ jsx(Flex, { justify: "center", align: "center", children: /* @__PURE__ */ jsx("video", { src: mediaUrl, controls: !0, className: "media-video", style: videoMediaStyle }) });
52
+ case "embedder":
53
+ return /* @__PURE__ */ jsx(Flex, { justify: "center", align: "center", children: /* @__PURE__ */ jsx("iframe", { title: "Embedded media content", src: mediaUrl, className: "media-video", style: iframeMediaStyle }) });
54
+ case "hyperlink":
55
+ case "attachment":
56
+ return mimeType && mimeType === "application/pdf" ? /* @__PURE__ */ jsx(PdfViewer, { mediaUrl, scale }) : /* @__PURE__ */ jsxs(Flex, { direction: "column", align: "center", children: [
57
+ /* @__PURE__ */ jsx(Flex, { justify: "center", align: "center", className: "bg-gray-300 w-100 rounded-2 mb-8", style: {
58
+ maxWidth: "500px",
59
+ height: "200px"
60
+ }, children: mediaType === "hyperlink" ? /* @__PURE__ */ jsx(SvgIconLink, { width: 40, height: 40, color: "#B0B0B0" }) : /* @__PURE__ */ jsx(SvgIconTextPage, { width: 40, height: 40, color: "#B0B0B0" }) }),
61
+ /* @__PURE__ */ jsx("a", { className: "w-100 d-flex justify-content-center", href: mediaUrl, download: mediaType !== "hyperlink", target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsx(Button, { className: "w-100", style: {
62
+ height: "40px",
63
+ maxWidth: "500px"
64
+ }, leftIcon: mediaType === "hyperlink" ? /* @__PURE__ */ jsx(SvgIconExternalLink, {}) : /* @__PURE__ */ jsx(SvgIconDownload, {}), color: "tertiary", children: t(mediaType === "hyperlink" ? "mediaWrapper.attachment.open" : "mediaWrapper.attachment.download") }) })
65
+ ] });
66
+ default:
67
+ return null;
68
+ }
69
+ };
70
+ export {
71
+ MediaWrapper
72
+ };
@@ -0,0 +1,4 @@
1
+ export default function PdfViewer({ mediaUrl, scale, }: {
2
+ mediaUrl: string;
3
+ scale?: number;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useState, useRef } from "react";
3
+ import { Document, Page } from "react-pdf";
4
+ import LoadingScreen from "../LoadingScreen/LoadingScreen.js";
5
+ function PdfViewer({
6
+ mediaUrl,
7
+ scale
8
+ }) {
9
+ const [numPages, setNumPages] = useState(null), pagesRef = useRef([]), onDocumentLoadSuccess = ({
10
+ numPages: numPages2
11
+ }) => {
12
+ setNumPages(numPages2);
13
+ };
14
+ return /* @__PURE__ */ jsx("div", { style: {
15
+ width: `calc(600px * ${scale})`,
16
+ height: "calc(100vh - 52px)",
17
+ overflowY: "auto",
18
+ marginTop: "20px"
19
+ }, children: /* @__PURE__ */ jsx(Document, { file: mediaUrl, onLoadSuccess: onDocumentLoadSuccess, loading: /* @__PURE__ */ jsx(LoadingScreen, {}), children: Array.from(new Array(numPages), (_, index) => /* @__PURE__ */ jsx("div", { ref: (el) => pagesRef.current[index] = el, style: {
20
+ marginBottom: 32,
21
+ transformOrigin: "top center"
22
+ }, children: /* @__PURE__ */ jsx(Page, { className: "pdf-page", pageNumber: index + 1, renderTextLayer: !1, renderAnnotationLayer: !1, width: 600 * (scale ?? 1), loading: /* @__PURE__ */ jsx(LoadingScreen, {}) }) }, index)) }) });
23
+ }
24
+ export {
25
+ PdfViewer as default
26
+ };
@@ -0,0 +1,7 @@
1
+ export default function ToolbarViewer({ onClose, mediaName, mediaUrl, nbMedia, currentIndex, }: {
2
+ onClose: () => void;
3
+ mediaName: string;
4
+ nbMedia?: number;
5
+ mediaUrl?: string;
6
+ currentIndex: number;
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,41 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { useEffect } from "react";
3
+ import SvgIconClose from "../../modules/icons/components/IconClose.js";
4
+ import SvgIconDownload from "../../modules/icons/components/IconDownload.js";
5
+ import SvgIconExternalLink from "../../modules/icons/components/IconExternalLink.js";
6
+ import Flex from "../Flex/Flex.js";
7
+ import IconButton from "../Button/IconButton.js";
8
+ import SmartEllipsis from "../SmartEllipsis/SmartEllipsis.js";
9
+ function ToolbarViewer({
10
+ onClose,
11
+ mediaName,
12
+ mediaUrl,
13
+ nbMedia,
14
+ currentIndex
15
+ }) {
16
+ return useEffect(() => {
17
+ const handleKeyDown = (e) => {
18
+ e.key === "Escape" && onClose();
19
+ };
20
+ return window.addEventListener("keydown", handleKeyDown), () => {
21
+ window.removeEventListener("keydown", handleKeyDown);
22
+ };
23
+ }, [onClose]), /* @__PURE__ */ jsxs(Flex, { className: "media-viewer-toolbar p-8", align: "center", children: [
24
+ /* @__PURE__ */ jsxs(Flex, { gap: "8", align: "center", style: {
25
+ minWidth: "50%"
26
+ }, children: [
27
+ /* @__PURE__ */ jsx(IconButton, { icon: /* @__PURE__ */ jsx(SvgIconClose, { color: "#fff" }), onClick: onClose, variant: "ghost" }),
28
+ /* @__PURE__ */ jsx(SmartEllipsis, { text: mediaName })
29
+ ] }),
30
+ /* @__PURE__ */ jsxs(Flex, { gap: "8", align: "center", justify: "between", className: "w-100", children: [
31
+ nbMedia ? /* @__PURE__ */ jsx("p", { children: `${currentIndex + 1}/${nbMedia} ` }) : /* @__PURE__ */ jsx("p", { children: `${currentIndex + 1}` }),
32
+ mediaUrl && /* @__PURE__ */ jsxs(Flex, { className: "ms-8", gap: "8", align: "center", children: [
33
+ /* @__PURE__ */ jsx("a", { href: mediaUrl, download: !0, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsx(IconButton, { icon: /* @__PURE__ */ jsx(SvgIconDownload, { color: "#fff" }), variant: "ghost" }) }),
34
+ /* @__PURE__ */ jsx("a", { href: mediaUrl, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ jsx(IconButton, { icon: /* @__PURE__ */ jsx(SvgIconExternalLink, { color: "#fff" }), variant: "ghost" }) })
35
+ ] })
36
+ ] })
37
+ ] });
38
+ }
39
+ export {
40
+ ToolbarViewer as default
41
+ };
@@ -0,0 +1,4 @@
1
+ export default function ToolbarZoom({ zoomIn, zoomOut, }: {
2
+ zoomIn: () => void;
3
+ zoomOut: () => void;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import SvgIconMinus from "../../modules/icons/components/IconMinus.js";
3
+ import SvgIconPlus from "../../modules/icons/components/IconPlus.js";
4
+ import SvgIconZoomIn from "../../modules/icons/components/IconZoomIn.js";
5
+ import Flex from "../Flex/Flex.js";
6
+ import IconButton from "../Button/IconButton.js";
7
+ function ToolbarZoom({
8
+ zoomIn,
9
+ zoomOut
10
+ }) {
11
+ return /* @__PURE__ */ jsx(Flex, { justify: "center", className: "media-viewer-toolbar-zoom-container", children: /* @__PURE__ */ jsxs(Flex, { gap: "4", className: "p-12 media-viewer-toolbar-zoom", align: "center", children: [
12
+ /* @__PURE__ */ jsx(IconButton, { variant: "ghost", icon: /* @__PURE__ */ jsx(SvgIconMinus, { color: "#fff" }), onClick: zoomOut }),
13
+ /* @__PURE__ */ jsx(SvgIconZoomIn, { color: "#fff", className: "m-4" }),
14
+ /* @__PURE__ */ jsx(IconButton, { variant: "ghost", icon: /* @__PURE__ */ jsx(SvgIconPlus, { color: "#fff" }), onClick: zoomIn })
15
+ ] }) });
16
+ }
17
+ export {
18
+ ToolbarZoom as default
19
+ };
@@ -0,0 +1,2 @@
1
+ export * from './MediaViewer';
2
+ export { default as MediaViewer } from './MediaViewer';
@@ -0,0 +1,74 @@
1
+ export interface PromotionCardProps {
2
+ children: React.ReactNode;
3
+ borderColor?: string;
4
+ backgroundColor?: string;
5
+ className?: string;
6
+ }
7
+ /**
8
+ * Promotion Card component to display promotional features in a card format.
9
+ *
10
+ * The component PromotionCard is a Compound Component composed of:
11
+ * - PromotionCardHeader: information on the top right corner
12
+ * - PromotionCardIcon: Icon on the left side (background color and Icon)
13
+ * - PromotionCardBody:
14
+ * - PromotionCardTitle: Card Title
15
+ * - PromotionCardDescription: Card Description
16
+ * - PromotionCardAction: Card Action (mainly a button with a onClick action)
17
+ *
18
+ * @example
19
+ * <PromotionCard>
20
+ * <PromotionCard.Header backgroundColor="#faea9c">
21
+ * header content
22
+ * </PromotionCard.Header>
23
+ * <PromotionCard.Icon
24
+ * backgroundColor="#FFEFE3"
25
+ * icon={<IconEdit color="#FF8D2E" />}
26
+ * />
27
+ * <PromotionCard.Body>
28
+ * <PromotionCard.Title>Création Libre</PromotionCard.Title>
29
+ * <PromotionCard.Description>
30
+ * Vous n'avez pas peur de la "page blanche" ? Lancez-vous pour créer
31
+ * votre cours ou votre document !
32
+ * </PromotionCard.Description>
33
+ * <PromotionCard.Actions>
34
+ * <Button
35
+ * color="tertiary"
36
+ * variant="ghost"
37
+ * size="sm"
38
+ * onClick={() => {}}
39
+ * leftIcon={<IconPlus />}
40
+ * >
41
+ * Nouvelle page
42
+ * </Button>
43
+ * </PromotionCard.Actions>
44
+ * </PromotionCard.Body>
45
+ * </PromotionCard>
46
+ */
47
+ export declare const Root: ({ children, borderColor, backgroundColor, className, }: PromotionCardProps) => import("react/jsx-runtime").JSX.Element;
48
+ declare const PromotionCard: (({ children, borderColor, backgroundColor, className, }: PromotionCardProps) => import("react/jsx-runtime").JSX.Element) & {
49
+ Header: {
50
+ ({ backgroundColor, textColor, children, className, }: import('./PromotionCardHeader').PromotionCardHeaderProps): import("react/jsx-runtime").JSX.Element;
51
+ displayName: string;
52
+ };
53
+ Body: {
54
+ ({ children, textColor, className, }: import('./PromotionCardBody').PromotionCardBodyProps): import("react/jsx-runtime").JSX.Element;
55
+ displayName: string;
56
+ };
57
+ Icon: {
58
+ ({ icon, backgroundColor, className, }: import('./PromotionCardIcon').PromotionCardIconProps): import("react/jsx-runtime").JSX.Element;
59
+ displayName: string;
60
+ };
61
+ Title: {
62
+ ({ children, className, }: import('./PromotionCardTitle').PromotionCardTitleProps): import("react/jsx-runtime").JSX.Element;
63
+ displayName: string;
64
+ };
65
+ Description: {
66
+ ({ children, className, }: import('./PromotionCardDescription').PromotionCardDescriptionProps): import("react/jsx-runtime").JSX.Element;
67
+ displayName: string;
68
+ };
69
+ Footer: {
70
+ ({ children, className, }: import('./PromotionCardFooter').PromotionCardFooterProps): import("react/jsx-runtime").JSX.Element;
71
+ displayName: string;
72
+ };
73
+ };
74
+ export default PromotionCard;
@@ -0,0 +1,31 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import PromotionCardBody from "./PromotionCardBody.js";
3
+ import PromotionCardDescription from "./PromotionCardDescription.js";
4
+ import PromotionCardFooter from "./PromotionCardFooter.js";
5
+ import PromotionCardHeader from "./PromotionCardHeader.js";
6
+ import PromotionCardIcon from "./PromotionCardIcon.js";
7
+ import PromotionCardTitle from "./PromotionCardTitle.js";
8
+ import clsx from "clsx";
9
+ const Root = ({
10
+ children,
11
+ borderColor,
12
+ backgroundColor,
13
+ className
14
+ }) => {
15
+ const classNames = clsx("promotion-card", className);
16
+ return /* @__PURE__ */ jsx("div", { className: classNames, style: {
17
+ borderColor,
18
+ backgroundColor
19
+ }, children });
20
+ }, PromotionCard = /* @__PURE__ */ Object.assign(Root, {
21
+ Header: PromotionCardHeader,
22
+ Body: PromotionCardBody,
23
+ Icon: PromotionCardIcon,
24
+ Title: PromotionCardTitle,
25
+ Description: PromotionCardDescription,
26
+ Footer: PromotionCardFooter
27
+ });
28
+ export {
29
+ Root,
30
+ PromotionCard as default
31
+ };
@@ -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
+ };