@edifice.io/react 2.2.11-develop-enabling.20250710092201 → 2.2.11-develop-pedago.20250710120949
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.
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Dropdown/Dropdown.d.ts +10 -4
- package/dist/components/Dropdown/Dropdown.js +24 -8
- package/dist/components/Flex/Flex.d.ts +1 -0
- package/dist/components/Flex/Flex.js +2 -1
- package/dist/components/Layout/Layout.d.ts +5 -1
- package/dist/components/Layout/Layout.js +5 -2
- package/dist/components/SearchBar/SearchBar.d.ts +9 -33
- package/dist/components/SearchBar/SearchBar.js +4 -30
- package/dist/components/Tabs/components/Tabs.d.ts +23 -3
- package/dist/components/Tabs/components/Tabs.js +8 -3
- package/dist/components/Tabs/components/TabsList.d.ts +15 -1
- package/dist/components/Tabs/components/TabsList.js +13 -3
- package/dist/components/Tabs/components/TabsPanel.d.ts +5 -1
- package/dist/components/Tabs/components/TabsPanel.js +7 -3
- package/dist/hooks/useDropdown/useDropdown.d.ts +2 -0
- package/dist/hooks/useDropdown/useDropdown.js +2 -0
- package/dist/hooks/useEdificeIcons/useEdificeIcons.js +4 -1
- package/dist/hooks/useLibraryUrl/useLibraryUrl.d.ts +1 -1
- package/dist/hooks/useLibraryUrl/useLibraryUrl.js +2 -2
- package/dist/icons-apps.js +164 -174
- package/dist/icons.js +86 -90
- package/dist/index.js +12 -10
- package/dist/modules/editor/components/Toolbar/TableToolbar.AddMenu.js +1 -1
- package/dist/modules/editor/components/Toolbar/TableToolbar.DelMenu.js +1 -1
- package/dist/modules/icons/components/{apps/IconMinibadge.d.ts → IconMegaphone.d.ts} +2 -2
- package/dist/modules/icons/components/IconMegaphone.js +12 -0
- package/dist/modules/icons/components/IconNotes.d.ts +7 -0
- package/dist/modules/icons/components/IconNotes.js +13 -0
- package/dist/modules/icons/components/apps/IconAccount.js +2 -2
- package/dist/modules/icons/components/apps/IconActualites.js +2 -2
- package/dist/modules/icons/components/apps/IconAdmin.js +2 -2
- package/dist/modules/icons/components/apps/IconAgenda.js +2 -3
- package/dist/modules/icons/components/apps/IconAppointments.js +2 -2
- package/dist/modules/icons/components/apps/IconArchive.js +2 -2
- package/dist/modules/icons/components/apps/IconBlog.js +2 -2
- package/dist/modules/icons/components/apps/IconCahierDeTexte.js +2 -2
- package/dist/modules/icons/components/apps/IconCalendar.js +2 -3
- package/dist/modules/icons/components/apps/IconCollaborativeWall.js +2 -2
- package/dist/modules/icons/components/apps/IconCommunity.js +2 -2
- package/dist/modules/icons/components/apps/IconConversation.js +2 -2
- package/dist/modules/icons/components/apps/IconDirectory.js +2 -2
- package/dist/modules/icons/components/apps/IconExercizer.js +2 -2
- package/dist/modules/icons/components/apps/IconForms.js +6 -2
- package/dist/modules/icons/components/apps/IconForum.js +2 -2
- package/dist/modules/icons/components/apps/IconLibrary.js +2 -2
- package/dist/modules/icons/components/apps/IconMediacentre.js +2 -2
- package/dist/modules/icons/components/apps/IconMindmap.js +2 -2
- package/dist/modules/icons/components/apps/IconMoodle.js +2 -2
- package/dist/modules/icons/components/apps/IconNabook.js +4 -2
- package/dist/modules/icons/components/apps/IconNotebook.js +2 -2
- package/dist/modules/icons/components/apps/IconPad.js +2 -2
- package/dist/modules/icons/components/apps/IconPages.js +2 -2
- package/dist/modules/icons/components/apps/IconParametrage.js +2 -2
- package/dist/modules/icons/components/apps/IconParametrages.js +2 -2
- package/dist/modules/icons/components/apps/IconPoll.js +2 -2
- package/dist/modules/icons/components/apps/IconPresences.js +6 -2
- package/dist/modules/icons/components/apps/IconRack.js +2 -2
- package/dist/modules/icons/components/apps/IconRbs.js +2 -2
- package/dist/modules/icons/components/apps/IconSchoolbook.js +2 -2
- package/dist/modules/icons/components/apps/IconScrapbook.js +2 -2
- package/dist/modules/icons/components/apps/IconSettingsClass.js +2 -2
- package/dist/modules/icons/components/apps/IconSharebigfiles.js +2 -2
- package/dist/modules/icons/components/apps/IconStatistics.js +2 -2
- package/dist/modules/icons/components/apps/IconSupport.js +2 -2
- package/dist/modules/icons/components/apps/IconTimeline.js +2 -2
- package/dist/modules/icons/components/apps/IconTimelinegenerator.js +2 -2
- package/dist/modules/icons/components/apps/IconUserbook.js +2 -2
- package/dist/modules/icons/components/apps/IconVisioconf.js +2 -2
- package/dist/modules/icons/components/apps/IconWebsite.js +2 -2
- package/dist/modules/icons/components/apps/IconWiki.js +3 -3
- package/dist/modules/icons/components/apps/IconWorkspace.js +2 -2
- package/dist/modules/icons/components/apps/index.d.ts +0 -5
- package/dist/modules/icons/components/index.d.ts +2 -4
- package/dist/modules/modals/OnboardingModal/OnboardingModal.d.ts +4 -6
- package/dist/modules/modals/OnboardingModal/OnboardingModal.js +13 -27
- package/dist/modules/modals/OnboardingModal/index.d.ts +0 -1
- package/dist/modules/modals/OnboardingModal/useOnboardingModal.js +4 -4
- package/dist/modules/modals/ResourceModal/ResourceModal.d.ts +57 -2
- package/dist/modules/modals/ResourceModal/ResourceModal.js +20 -16
- package/dist/modules/multimedia/FileCard/FileCard.d.ts +13 -2
- package/dist/modules/multimedia/FileCard/FileCard.js +15 -5
- package/dist/modules/multimedia/FileCard/FileIcon.d.ts +5 -1
- package/dist/modules/multimedia/FileCard/FileIcon.js +2 -2
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +3 -1
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +7 -2
- package/dist/modules/multimedia/index.d.ts +1 -0
- package/dist/multimedia.js +12 -10
- package/package.json +6 -6
- package/dist/modules/icons/components/IconLibrary.d.ts +0 -7
- package/dist/modules/icons/components/IconLibrary.js +0 -12
- package/dist/modules/icons/components/IconNotification.d.ts +0 -7
- package/dist/modules/icons/components/IconNotification.js +0 -12
- package/dist/modules/icons/components/IconStar.d.ts +0 -7
- package/dist/modules/icons/components/IconStar.js +0 -13
- package/dist/modules/icons/components/IconStarFavorite.d.ts +0 -7
- package/dist/modules/icons/components/IconStarFull.d.ts +0 -7
- package/dist/modules/icons/components/IconStarFull.js +0 -13
- package/dist/modules/icons/components/apps/IconEdt.d.ts +0 -7
- package/dist/modules/icons/components/apps/IconEdt.js +0 -12
- package/dist/modules/icons/components/apps/IconGeogebra.d.ts +0 -7
- package/dist/modules/icons/components/apps/IconGeogebra.js +0 -12
- package/dist/modules/icons/components/apps/IconMagneto.d.ts +0 -7
- package/dist/modules/icons/components/apps/IconMagneto.js +0 -13
- package/dist/modules/icons/components/apps/IconMinetest.d.ts +0 -7
- package/dist/modules/icons/components/apps/IconMinetest.js +0 -12
- package/dist/modules/icons/components/apps/IconMinibadge.js +0 -12
|
@@ -3,9 +3,9 @@ const SvgIconUserbook = ({
|
|
|
3
3
|
title,
|
|
4
4
|
titleId,
|
|
5
5
|
...props
|
|
6
|
-
}) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
}) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "24", height: "24", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
|
|
7
7
|
title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
|
|
8
|
-
/* @__PURE__ */ jsx("path", { fill: "currentColor", d: "
|
|
8
|
+
/* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M0 24.58V.53h24.05v4.28h-2.62V7.1h2.62v4.28h-2.62v2.35h2.62V18h-2.62v2.3h2.62v4.29H0zm4.64-6.85h12.12V14l-4.5-2.67q.9-.46 1.4-1.3t.53-1.85q0-1.4-1.01-2.43T10.7 4.72 8.25 5.75 7.24 8.18q0 1.03.53 1.85t1.4 1.3L4.63 14v3.73z" })
|
|
9
9
|
] });
|
|
10
10
|
export {
|
|
11
11
|
SvgIconUserbook as default
|
|
@@ -3,9 +3,9 @@ const SvgIconVisioconf = ({
|
|
|
3
3
|
title,
|
|
4
4
|
titleId,
|
|
5
5
|
...props
|
|
6
|
-
}) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
}) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "24", height: "24", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
|
|
7
7
|
title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
|
|
8
|
-
/* @__PURE__ */ jsx("path", { fill: "currentColor", d: "
|
|
8
|
+
/* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M7.85 4.15c.08 0 .14.15.14.34v15.5c0 .18-.06.34-.14.34s-.14-.16-.14-.34V4.49c0-.19.06-.34.14-.34m.09 5.59v.01a.14.14 0 0 1-.14.14H1.54a.14.14 0 0 1-.14-.14v-.01c0-.08.07-.14.14-.14H7.8c.08 0 .14.06.14.14m-.13 5.18v.01a.14.14 0 0 1-.13.14H1.4a.14.14 0 0 1-.13-.14v-.01c0-.08.06-.14.13-.14h6.27c.07 0 .13.06.13.14zM2.6 19.65l.03-.24a2.1 2.1 0 0 1 .89-1.36c.33.31.72.48 1.17.48s.84-.17 1.17-.48l.2.16c.4.35.64.8.7 1.33l.02.11v.13H2.6zm2.19-4.05.24.05a1.25 1.25 0 1 1-1.57 1.43 1.25 1.25 0 0 1 .97-1.45l.16-.03zm4.97 3.46.08-.63a5.52 5.52 0 0 1 2.34-3.6c.87.82 1.9 1.26 3.1 1.26s2.22-.43 3.1-1.27c.18.14.36.27.53.42a5.46 5.46 0 0 1 1.86 3.54l.04.28v.35H9.74v-.35zm5.78-10.7c.22.04.44.07.66.13a3.32 3.32 0 0 1 2.38 2.84 3.31 3.31 0 0 1-6.56.93 3.31 3.31 0 0 1 2.57-3.83l.43-.08h.52zM2.58 14.64l.04-.24a2.1 2.1 0 0 1 .88-1.36c.33.3.72.47 1.17.47q.675 0 1.17-.48l.2.16c.4.36.64.8.7 1.34l.02.1v.14H2.58zm2.19-4.05.25.05a1.25 1.25 0 1 1-1.58 1.42 1.25 1.25 0 0 1 .97-1.44c.05-.02.1-.02.16-.03zM2.59 9.48l.03-.24a2.1 2.1 0 0 1 .89-1.36c.33.31.72.48 1.17.48s.84-.17 1.17-.48l.2.16c.4.35.64.8.7 1.33l.02.11v.13H2.6v-.13zm2.19-4.05.25.05a1.25 1.25 0 1 1-1.58 1.43 1.25 1.25 0 0 1 .97-1.45l.16-.03zm19.24-.07v13.62a2.01 2.01 0 0 1-2 2h-6.8c0 1.07.8 1.97.8 2.4a.8.8 0 0 1-.8.8H8.8a.8.8 0 0 1-.8-.8c0-.46.8-1.31.8-2.4H2a2 2 0 0 1-2-2V5.36c0-1.1.9-2 2-2h20.02a2 2 0 0 1 2 2m-1.6 13.41V5.47c0-.27-.19-.5-.4-.5H2c-.22 0-.4.23-.4.5v13.3c0 .27.18.51.4.51h20.02c.21 0 .4-.24.4-.51M12.01 2.95a1.1 1.1 0 1 0 0-2.2 1.1 1.1 0 0 0 0 2.2m0-1.94c.05 0 .09.04.09.08s-.04.09-.09.09c-.04 0-.08-.04-.08-.09s.04-.08.08-.08m0 .34a.5.5 0 1 1 0 1.01.5.5 0 0 1 0-1.01m0 .76c.14 0 .25-.12.25-.26a.25.25 0 1 0-.25.26m.73.78a1.26 1.26 0 0 1-1.46 0l-.2.3a.17.17 0 0 0 .14.27h1.58a.17.17 0 0 0 .14-.26z" })
|
|
9
9
|
] });
|
|
10
10
|
export {
|
|
11
11
|
SvgIconVisioconf as default
|
|
@@ -3,9 +3,9 @@ const SvgIconWebsite = ({
|
|
|
3
3
|
title,
|
|
4
4
|
titleId,
|
|
5
5
|
...props
|
|
6
|
-
}) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
}) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: "24", height: "24", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
|
|
7
7
|
title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
|
|
8
|
-
/* @__PURE__ */ jsx("path", { fill: "currentColor", d: "
|
|
8
|
+
/* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M17.55 14.61c0 1.01.28 1.41 1.03 1.41 1.68 0 2.74-2.13 2.74-5.67 0-5.43-3.94-8.02-8.88-8.02-5.07 0-9.68 3.4-9.68 9.83 0 6.14 4.03 9.49 10.23 9.49 2.1 0 3.52-.23 5.68-.95l.46 1.93c-2.13.69-4.41.89-6.17.89C4.83 23.52.48 19.05.48 12.16.48 5.21 5.52.5 12.48.5c7.23 0 11.06 4.32 11.06 9.62 0 4.5-1.41 7.93-5.85 7.93-2.02 0-3.34-.8-3.52-2.6-.51 2-1.9 2.6-3.77 2.6-2.51 0-4.62-1.93-4.62-5.82 0-3.92 1.85-6.34 5.17-6.34 1.75 0 2.85.69 3.34 1.78l.83-1.52h2.43v8.47zM14 10.81a2.12 2.12 0 0 0-2.16-2.25c-1.07 0-2.25.86-2.25 3.4 0 2.02.9 3.14 2.25 3.14.95 0 2.16-.6 2.16-2.27V10.8z" })
|
|
9
9
|
] });
|
|
10
10
|
export {
|
|
11
11
|
SvgIconWebsite as default
|
|
@@ -3,10 +3,10 @@ const SvgIconWiki = ({
|
|
|
3
3
|
title,
|
|
4
4
|
titleId,
|
|
5
5
|
...props
|
|
6
|
-
}) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", viewBox: "0 0
|
|
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
7
|
title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
|
|
8
|
-
/* @__PURE__ */ jsx("path", { fill: "currentColor", d: "
|
|
9
|
-
/* @__PURE__ */ jsx("path", { fill: "currentColor",
|
|
8
|
+
/* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M7.64 14.568c-.82 0-1.533.09-2.114.202a.583.583 0 1 1-.22-1.145 12.3 12.3 0 0 1 2.334-.224c.922 0 1.726.1 2.377.223a.583.583 0 0 1-.216 1.146 11.6 11.6 0 0 0-2.161-.202m-2.114-4.454c.58-.112 1.294-.202 2.114-.202.837 0 1.568.09 2.16.203a.583.583 0 0 0 .217-1.146 13 13 0 0 0-2.377-.223c-.906 0-1.694.1-2.334.223a.583.583 0 1 0 .22 1.145" }),
|
|
9
|
+
/* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M16.595 3.72a18.4 18.4 0 0 1 4.841.62.6.6 0 0 1 .446.58v1.437h.324c.314 0 .569.254.569.568V20.64a.57.57 0 0 1-.71.551 19.8 19.8 0 0 0-5.08-.604h-.001a20 20 0 0 0-4.734.604.6.6 0 0 1-.237.01 29 29 0 0 0-4.742-.43 29.5 29.5 0 0 0-5.254.43.57.57 0 0 1-.666-.561V6.925c0-.314.255-.568.569-.568h.392V4.92a.6.6 0 0 1 .458-.583 20 20 0 0 1 4.539-.566c1.93-.022 3.562.243 4.778.53a18.5 18.5 0 0 1 4.508-.58Zm-5.101 1.677a18.6 18.6 0 0 0-4.172-.426h-.001a18.8 18.8 0 0 0-3.81.426V18.84c1.073-.203 2.35-.36 3.796-.379a20 20 0 0 1 4.187.376zm1.2 13.402a18.6 18.6 0 0 1 3.938-.468c1.61-.014 2.988.206 4.05.463V5.387c-.455-.108-.97-.21-1.54-.293v5.45c0 .32-.33.527-.617.387l-1.26-.61a.41.41 0 0 0-.387.005l-1.059.566a.432.432 0 0 1-.633-.381V4.986c-.956.083-1.795.235-2.492.4V18.8Z" })
|
|
10
10
|
] });
|
|
11
11
|
export {
|
|
12
12
|
SvgIconWiki as default
|
|
@@ -3,9 +3,9 @@ const SvgIconWorkspace = ({
|
|
|
3
3
|
title,
|
|
4
4
|
titleId,
|
|
5
5
|
...props
|
|
6
|
-
}) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg",
|
|
6
|
+
}) => /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 23 24", width: "24", height: "24", "aria-hidden": "true", "aria-labelledby": titleId, ...props, children: [
|
|
7
7
|
title ? /* @__PURE__ */ jsx("title", { id: titleId, children: title }) : null,
|
|
8
|
-
/* @__PURE__ */ jsx("path", { fill: "currentColor", d: "
|
|
8
|
+
/* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M22.34 8.68v9.45q0 1.23-.89 2.12t-2.12.89H3.01q-1.23 0-2.12-.89T0 18.13V5.25q0-1.23.9-2.12t2.12-.9h4.3q1.23 0 2.12.9t.89 2.12v.43h9.01q1.23 0 2.12.89t.89 2.11z" })
|
|
9
9
|
] });
|
|
10
10
|
export {
|
|
11
11
|
SvgIconWorkspace as default
|
|
@@ -33,7 +33,6 @@ export { default as IconConnecteurGenerique1 } from './IconConnecteurGenerique1'
|
|
|
33
33
|
export { default as IconConnecteurGenerique2 } from './IconConnecteurGenerique2';
|
|
34
34
|
export { default as IconConversation } from './IconConversation';
|
|
35
35
|
export { default as IconDirectory } from './IconDirectory';
|
|
36
|
-
export { default as IconEdt } from './IconEdt';
|
|
37
36
|
export { default as IconEducagri } from './IconEducagri';
|
|
38
37
|
export { default as IconEdumedia } from './IconEdumedia';
|
|
39
38
|
export { default as IconEdumoov } from './IconEdumoov';
|
|
@@ -45,7 +44,6 @@ export { default as IconEuropress } from './IconEuropress';
|
|
|
45
44
|
export { default as IconExercizer } from './IconExercizer';
|
|
46
45
|
export { default as IconForms } from './IconForms';
|
|
47
46
|
export { default as IconForum } from './IconForum';
|
|
48
|
-
export { default as IconGeogebra } from './IconGeogebra';
|
|
49
47
|
export { default as IconGepi } from './IconGepi';
|
|
50
48
|
export { default as IconGlpi } from './IconGlpi';
|
|
51
49
|
export { default as IconHiboutheque } from './IconHiboutheque';
|
|
@@ -57,13 +55,10 @@ export { default as IconLesechos } from './IconLesechos';
|
|
|
57
55
|
export { default as IconLibrary } from './IconLibrary';
|
|
58
56
|
export { default as IconLsu } from './IconLsu';
|
|
59
57
|
export { default as IconMadmagz } from './IconMadmagz';
|
|
60
|
-
export { default as IconMagneto } from './IconMagneto';
|
|
61
58
|
export { default as IconMatholycee } from './IconMatholycee';
|
|
62
59
|
export { default as IconMaxicours } from './IconMaxicours';
|
|
63
60
|
export { default as IconMediacentre } from './IconMediacentre';
|
|
64
61
|
export { default as IconMindmap } from './IconMindmap';
|
|
65
|
-
export { default as IconMinetest } from './IconMinetest';
|
|
66
|
-
export { default as IconMinibadge } from './IconMinibadge';
|
|
67
62
|
export { default as IconMonorientationenligne } from './IconMonorientationenligne';
|
|
68
63
|
export { default as IconMonstageenligne } from './IconMonstageenligne';
|
|
69
64
|
export { default as IconMoodle } from './IconMoodle';
|
|
@@ -68,13 +68,13 @@ export { default as IconInbox } from './IconInbox';
|
|
|
68
68
|
export { default as IconInfoCircle } from './IconInfoCircle';
|
|
69
69
|
export { default as IconInfoRectangle } from './IconInfoRectangle';
|
|
70
70
|
export { default as IconLandscape } from './IconLandscape';
|
|
71
|
-
export { default as IconLibrary } from './IconLibrary';
|
|
72
71
|
export { default as IconLink } from './IconLink';
|
|
73
72
|
export { default as IconListOrder } from './IconListOrder';
|
|
74
73
|
export { default as IconLoader } from './IconLoader';
|
|
75
74
|
export { default as IconLock } from './IconLock';
|
|
76
75
|
export { default as IconMailRecall } from './IconMailRecall';
|
|
77
76
|
export { default as IconMail } from './IconMail';
|
|
77
|
+
export { default as IconMegaphone } from './IconMegaphone';
|
|
78
78
|
export { default as IconMergeCells } from './IconMergeCells';
|
|
79
79
|
export { default as IconMessageInfo } from './IconMessageInfo';
|
|
80
80
|
export { default as IconMicOff } from './IconMicOff';
|
|
@@ -82,7 +82,7 @@ export { default as IconMic } from './IconMic';
|
|
|
82
82
|
export { default as IconMinus } from './IconMinus';
|
|
83
83
|
export { default as IconMove } from './IconMove';
|
|
84
84
|
export { default as IconNoColors } from './IconNoColors';
|
|
85
|
-
export { default as
|
|
85
|
+
export { default as IconNotes } from './IconNotes';
|
|
86
86
|
export { default as IconOptions } from './IconOptions';
|
|
87
87
|
export { default as IconOrderedList } from './IconOrderedList';
|
|
88
88
|
export { default as IconPaperclip } from './IconPaperclip';
|
|
@@ -130,8 +130,6 @@ export { default as IconSortTime } from './IconSortTime';
|
|
|
130
130
|
export { default as IconSpeechToText } from './IconSpeechToText';
|
|
131
131
|
export { default as IconSplitCells } from './IconSplitCells';
|
|
132
132
|
export { default as IconSquareRoot } from './IconSquareRoot';
|
|
133
|
-
export { default as IconStarFull } from './IconStarFull';
|
|
134
|
-
export { default as IconStar } from './IconStar';
|
|
135
133
|
export { default as IconSubscript } from './IconSubscript';
|
|
136
134
|
export { default as IconSuccessFill } from './IconSuccessFill';
|
|
137
135
|
export { default as IconSuccessOutline } from './IconSuccessOutline';
|
|
@@ -34,15 +34,13 @@ interface ModalOptionsProps {
|
|
|
34
34
|
*/
|
|
35
35
|
closeText?: string;
|
|
36
36
|
}
|
|
37
|
-
export interface OnboardingModalRef {
|
|
38
|
-
setIsOpen: (isOpen: boolean) => void;
|
|
39
|
-
handleSavePreference: () => void;
|
|
40
|
-
}
|
|
41
37
|
interface OnboardingProps {
|
|
42
38
|
id: string;
|
|
43
39
|
items: ModalItemsProps[];
|
|
44
40
|
modalOptions?: ModalOptionsProps;
|
|
45
|
-
isOnboardingChange?: (isOnboarding: boolean) => void;
|
|
46
41
|
}
|
|
47
|
-
declare const OnboardingModal:
|
|
42
|
+
declare const OnboardingModal: {
|
|
43
|
+
({ id, items, modalOptions }: OnboardingProps): import('react').ReactPortal | null;
|
|
44
|
+
displayName: string;
|
|
45
|
+
};
|
|
48
46
|
export default OnboardingModal;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
3
|
import { createPortal } from "react-dom";
|
|
4
4
|
import { useTranslation } from "react-i18next";
|
|
5
5
|
import { Pagination } from "swiper/modules";
|
|
@@ -8,12 +8,11 @@ import { useOnboardingModal } from "./useOnboardingModal.js";
|
|
|
8
8
|
import Modal from "../../../components/Modal/Modal.js";
|
|
9
9
|
import Image from "../../../components/Image/Image.js";
|
|
10
10
|
import Button from "../../../components/Button/Button.js";
|
|
11
|
-
const OnboardingModal =
|
|
11
|
+
const OnboardingModal = ({
|
|
12
12
|
id,
|
|
13
13
|
items,
|
|
14
|
-
modalOptions = {}
|
|
15
|
-
|
|
16
|
-
}, ref) => {
|
|
14
|
+
modalOptions = {}
|
|
15
|
+
}) => {
|
|
17
16
|
var _a;
|
|
18
17
|
const [swiperInstance, setSwiperInstance] = useState(), [swiperProgress, setSwiperprogress] = useState(0), {
|
|
19
18
|
isOpen,
|
|
@@ -21,12 +20,7 @@ const OnboardingModal = /* @__PURE__ */ forwardRef(({
|
|
|
21
20
|
setIsOpen,
|
|
22
21
|
handleSavePreference
|
|
23
22
|
} = useOnboardingModal(id);
|
|
24
|
-
|
|
25
|
-
setIsOpen,
|
|
26
|
-
handleSavePreference
|
|
27
|
-
})), useEffect(() => {
|
|
28
|
-
isOnboardingChange && isOnboardingChange(isOnboarding);
|
|
29
|
-
}, [isOnboarding, isOnboardingChange]), useEffect(() => {
|
|
23
|
+
useEffect(() => {
|
|
30
24
|
const link = document.createElement("link");
|
|
31
25
|
return link.href = "https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css", link.rel = "stylesheet", link.type = "text/css", document.head.appendChild(link), () => {
|
|
32
26
|
document.head.removeChild(link);
|
|
@@ -39,13 +33,9 @@ const OnboardingModal = /* @__PURE__ */ forwardRef(({
|
|
|
39
33
|
prevText,
|
|
40
34
|
closeText,
|
|
41
35
|
nextText
|
|
42
|
-
} = modalOptions, currentTitle = (swiperInstance == null ? void 0 : swiperInstance.activeIndex) != null && ((_a = items[swiperInstance == null ? void 0 : swiperInstance.activeIndex]) != null && _a.title) ? items[swiperInstance.activeIndex].title : title
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
setIsOpen(!1), setSwiperprogress(0);
|
|
46
|
-
};
|
|
47
|
-
return /* @__PURE__ */ createPortal(/* @__PURE__ */ jsxs(Modal, { id: "onboarding-modal", size: "md", isOpen, focusId: "nextButtonId", onModalClose: handleCloseWithoutPreference, children: [
|
|
48
|
-
/* @__PURE__ */ jsx(Modal.Header, { onModalClose: handleCloseWithoutPreference, children: t(currentTitle || "explorer.modal.onboarding.trash.title") }),
|
|
36
|
+
} = modalOptions, currentTitle = (swiperInstance == null ? void 0 : swiperInstance.activeIndex) != null && ((_a = items[swiperInstance == null ? void 0 : swiperInstance.activeIndex]) != null && _a.title) ? items[swiperInstance.activeIndex].title : title;
|
|
37
|
+
return isOnboarding ? /* @__PURE__ */ createPortal(/* @__PURE__ */ jsxs(Modal, { id: "onboarding-modal", size: "md", isOpen, focusId: "nextButtonId", onModalClose: () => setIsOpen(!1), children: [
|
|
38
|
+
/* @__PURE__ */ jsx(Modal.Header, { onModalClose: () => setIsOpen(!1), children: t(currentTitle || "explorer.modal.onboarding.trash.title") }),
|
|
49
39
|
/* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsx(Swiper, { modules: [Pagination], onSwiper: (swiper) => {
|
|
50
40
|
setSwiperInstance(swiper);
|
|
51
41
|
}, onSlideChange: (swiper) => {
|
|
@@ -54,20 +44,16 @@ const OnboardingModal = /* @__PURE__ */ forwardRef(({
|
|
|
54
44
|
clickable: !0
|
|
55
45
|
}, children: items.map((item, index) => /* @__PURE__ */ jsxs(SwiperSlide, { children: [
|
|
56
46
|
/* @__PURE__ */ jsx(Image, { width: "270", height: "140", className: "mx-auto my-12", loading: "lazy", src: item.src, alt: t(item.alt) }),
|
|
57
|
-
/* @__PURE__ */ jsx("p", { className: "text-center",
|
|
58
|
-
__html: t(item.text)
|
|
59
|
-
} })
|
|
47
|
+
/* @__PURE__ */ jsx("p", { className: "text-center", children: t(item.text) })
|
|
60
48
|
] }, index)) }) }),
|
|
61
49
|
/* @__PURE__ */ jsxs(Modal.Footer, { children: [
|
|
62
|
-
/* @__PURE__ */ jsx(Button, { type: "button", color: "tertiary", variant: "ghost", onClick:
|
|
50
|
+
/* @__PURE__ */ jsx(Button, { type: "button", color: "tertiary", variant: "ghost", onClick: () => setIsOpen(!1), children: t("explorer.modal.onboarding.trash.later") }),
|
|
63
51
|
swiperProgress > 0 && /* @__PURE__ */ jsx(Button, { type: "button", color: "primary", variant: "outline", onClick: () => swiperInstance.slidePrev(), children: t(prevText || "explorer.modal.onboarding.trash.prev") }),
|
|
64
52
|
swiperProgress < 1 && /* @__PURE__ */ jsx(Button, { id: "nextButtonId", type: "button", color: "primary", variant: "filled", onClick: () => swiperInstance.slideNext(), children: t(nextText || "explorer.modal.onboarding.trash.next") }),
|
|
65
|
-
swiperProgress === 1 && /* @__PURE__ */ jsx(Button, { type: "button", color: "primary", variant: "filled", onClick: ()
|
|
66
|
-
isOnboarding ? handleCloseWithPreference() : handleCloseWithoutPreference();
|
|
67
|
-
}, children: t(closeText || "explorer.modal.onboarding.trash.close") })
|
|
53
|
+
swiperProgress === 1 && /* @__PURE__ */ jsx(Button, { type: "button", color: "primary", variant: "filled", onClick: handleSavePreference, children: t(closeText || "explorer.modal.onboarding.trash.close") })
|
|
68
54
|
] })
|
|
69
|
-
] }), document.getElementById("portal"));
|
|
70
|
-
}
|
|
55
|
+
] }), document.getElementById("portal")) : null;
|
|
56
|
+
};
|
|
71
57
|
export {
|
|
72
58
|
OnboardingModal as default
|
|
73
59
|
};
|
|
@@ -3,7 +3,7 @@ import { odeServices } from "@edifice.io/client";
|
|
|
3
3
|
const getOnboardingTrash = async (key) => await odeServices.conf().getPreference(key), saveOnboardingTrash = async (key) => await odeServices.conf().savePreference(key, JSON.stringify({
|
|
4
4
|
key: !1
|
|
5
5
|
})), useOnboardingModal = (id) => {
|
|
6
|
-
const [isOpen, setIsOpen] = useState(!
|
|
6
|
+
const [isOpen, setIsOpen] = useState(!0), [isOnboarding, setIsOnboarding] = useState(!1);
|
|
7
7
|
return useEffect(() => {
|
|
8
8
|
(async () => {
|
|
9
9
|
const response = await getOnboardingTrash(id);
|
|
@@ -11,17 +11,17 @@ const getOnboardingTrash = async (key) => await odeServices.conf().getPreference
|
|
|
11
11
|
const {
|
|
12
12
|
key
|
|
13
13
|
} = response;
|
|
14
|
-
|
|
14
|
+
setIsOnboarding(key);
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
|
-
setIsOnboarding(!0)
|
|
17
|
+
setIsOnboarding(!0);
|
|
18
18
|
})();
|
|
19
19
|
}, [id]), {
|
|
20
20
|
isOpen,
|
|
21
21
|
setIsOpen,
|
|
22
22
|
isOnboarding,
|
|
23
23
|
handleSavePreference: async () => {
|
|
24
|
-
await saveOnboardingTrash(id), setIsOpen(!1)
|
|
24
|
+
await saveOnboardingTrash(id), setIsOpen(!1);
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
};
|
|
@@ -7,13 +7,53 @@ export interface FormInputs {
|
|
|
7
7
|
enablePublic: boolean;
|
|
8
8
|
formSlug: string;
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* Custom translations interface for overriding default translations
|
|
12
|
+
*/
|
|
13
|
+
export interface ResourceModalTranslations {
|
|
14
|
+
title?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
cancel?: string;
|
|
17
|
+
create?: string;
|
|
18
|
+
save?: string;
|
|
19
|
+
header?: {
|
|
20
|
+
create?: string;
|
|
21
|
+
edit?: string;
|
|
22
|
+
};
|
|
23
|
+
heading?: {
|
|
24
|
+
general?: string;
|
|
25
|
+
access?: string;
|
|
26
|
+
};
|
|
27
|
+
placeholder?: {
|
|
28
|
+
title?: string;
|
|
29
|
+
description?: string;
|
|
30
|
+
};
|
|
31
|
+
imagepicker?: {
|
|
32
|
+
add?: string;
|
|
33
|
+
delete?: string;
|
|
34
|
+
};
|
|
35
|
+
success?: {
|
|
36
|
+
created?: string;
|
|
37
|
+
updated?: string;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
10
40
|
interface BaseProps {
|
|
41
|
+
/** Controls modal visibility */
|
|
11
42
|
isOpen: boolean;
|
|
43
|
+
/** Custom content to be displayed after the form fields */
|
|
12
44
|
children?: ReactNode | ((...props: any) => ReactNode);
|
|
45
|
+
/** Maximum length for the title input */
|
|
13
46
|
inputMaxLength?: number;
|
|
47
|
+
/** Maximum length for the description textarea */
|
|
14
48
|
textareaMaxLength?: number;
|
|
15
|
-
|
|
49
|
+
/** Callback when operation succeeds, with operation result as parameter */
|
|
50
|
+
onSuccess: (result: CreateResult | UpdateResult) => void;
|
|
51
|
+
/** Callback when operation is cancelled */
|
|
16
52
|
onCancel: () => void;
|
|
53
|
+
/** Override application code (uses EdificeClient context by default) */
|
|
54
|
+
appCode?: string;
|
|
55
|
+
/** Custom translations for the modal */
|
|
56
|
+
translations?: ResourceModalTranslations;
|
|
17
57
|
}
|
|
18
58
|
interface CreateProps extends BaseProps {
|
|
19
59
|
mode: 'create';
|
|
@@ -26,5 +66,20 @@ interface UpdateProps extends BaseProps {
|
|
|
26
66
|
resourceId: ID;
|
|
27
67
|
}
|
|
28
68
|
type Props = CreateProps | UpdateProps;
|
|
29
|
-
|
|
69
|
+
/**
|
|
70
|
+
* ResourceModal component for creating or updating resources
|
|
71
|
+
*
|
|
72
|
+
* @component
|
|
73
|
+
* @example
|
|
74
|
+
* ```tsx
|
|
75
|
+
* <ResourceModal
|
|
76
|
+
* mode="create"
|
|
77
|
+
* isOpen={true}
|
|
78
|
+
* onCancel={() => setOpen(false)}
|
|
79
|
+
* onSuccess={(result) => console.log('Resource created:', result)}
|
|
80
|
+
* currentFolder={{ id: 'default' }}
|
|
81
|
+
* />
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
export declare const ResourceModal: ({ isOpen, onCancel, onSuccess, children, appCode: customAppCode, translations: customT, inputMaxLength, textareaMaxLength, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
30
85
|
export default ResourceModal;
|
|
@@ -25,14 +25,17 @@ const DEFAULT_INPUT_MAX_LENGTH = 60, DEFAULT_TEXTAREA_MAX_LENGTH = 400, Resource
|
|
|
25
25
|
onCancel,
|
|
26
26
|
onSuccess,
|
|
27
27
|
children,
|
|
28
|
+
appCode: customAppCode,
|
|
29
|
+
translations: customT = {},
|
|
28
30
|
inputMaxLength = DEFAULT_INPUT_MAX_LENGTH,
|
|
29
31
|
textareaMaxLength = DEFAULT_TEXTAREA_MAX_LENGTH,
|
|
30
32
|
...props
|
|
31
33
|
}) => {
|
|
34
|
+
var _a, _b, _c, _d, _e, _f;
|
|
32
35
|
const {
|
|
33
|
-
appCode:
|
|
36
|
+
appCode: contextAppCode,
|
|
34
37
|
currentApp
|
|
35
|
-
} = useEdificeClient(), {
|
|
38
|
+
} = useEdificeClient(), application = customAppCode || contextAppCode, {
|
|
36
39
|
t
|
|
37
40
|
} = useTranslation(), {
|
|
38
41
|
mode
|
|
@@ -65,7 +68,7 @@ const DEFAULT_INPUT_MAX_LENGTH = 60, DEFAULT_TEXTAREA_MAX_LENGTH = 400, Resource
|
|
|
65
68
|
isUpdating,
|
|
66
69
|
selectedResource: isUpdating ? resource : void 0
|
|
67
70
|
}), watchedDescription = watch("description"), onSubmit = async function(formData) {
|
|
68
|
-
var
|
|
71
|
+
var _a2, _b2;
|
|
69
72
|
try {
|
|
70
73
|
const data = {
|
|
71
74
|
description: formData.description || "",
|
|
@@ -74,21 +77,22 @@ const DEFAULT_INPUT_MAX_LENGTH = 60, DEFAULT_TEXTAREA_MAX_LENGTH = 400, Resource
|
|
|
74
77
|
slug: formData.enablePublic && formData.formSlug || "",
|
|
75
78
|
thumbnail
|
|
76
79
|
};
|
|
80
|
+
let result;
|
|
77
81
|
if (isCreating) {
|
|
78
82
|
const createParams = {
|
|
79
83
|
...data,
|
|
80
84
|
folder: props.currentFolder === void 0 || // Fix #WB2-1296: when searching, currentFolder is undefined
|
|
81
|
-
((
|
|
85
|
+
((_a2 = props.currentFolder) == null ? void 0 : _a2.id) === "default" ? void 0 : parseInt(((_b2 = props.currentFolder) == null ? void 0 : _b2.id) || ""),
|
|
82
86
|
application
|
|
83
87
|
};
|
|
84
|
-
props.createResource ? await props.createResource.mutateAsync(createParams) : await odeServices.resource(application).create(createParams);
|
|
88
|
+
props.createResource ? result = await props.createResource.mutateAsync(createParams) : result = await odeServices.resource(application).create(createParams);
|
|
85
89
|
} else {
|
|
86
90
|
const updateParams = {
|
|
87
91
|
...data,
|
|
88
92
|
entId: resource.assetId,
|
|
89
93
|
trashed: resource.trashed
|
|
90
94
|
};
|
|
91
|
-
props.updateResource ? await props.updateResource.mutateAsync(updateParams) : await odeServices.resource(application).update(updateParams);
|
|
95
|
+
props.updateResource ? result = await props.updateResource.mutateAsync(updateParams) : result = await odeServices.resource(application).update(updateParams);
|
|
92
96
|
}
|
|
93
97
|
toast.success(/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
94
98
|
/* @__PURE__ */ jsx("strong", { children: t(isCreating ? "explorer.resource.created" : "explorer.resource.updated") }),
|
|
@@ -106,21 +110,21 @@ const DEFAULT_INPUT_MAX_LENGTH = 60, DEFAULT_TEXTAREA_MAX_LENGTH = 400, Resource
|
|
|
106
110
|
"Public:",
|
|
107
111
|
formData.enablePublic ? t("explorer.enable.public.yes") : t("explorer.enable.public.no")
|
|
108
112
|
] })
|
|
109
|
-
] })), onSuccess();
|
|
113
|
+
] })), onSuccess(result);
|
|
110
114
|
} catch (e) {
|
|
111
115
|
console.error(e);
|
|
112
116
|
}
|
|
113
117
|
};
|
|
114
118
|
return isUpdating && !resource ? /* @__PURE__ */ jsx(LoadingScreen, {}) : /* @__PURE__ */ createPortal(/* @__PURE__ */ jsxs(Modal, { id: `${mode}-resource`, size: "lg", isOpen, onModalClose: onCancel, children: [
|
|
115
|
-
/* @__PURE__ */ jsx(Modal.Header, { onModalClose: onCancel, children: t(`explorer.resource.editModal.header.${isCreating ? "create" : "edit"}`) }),
|
|
119
|
+
/* @__PURE__ */ jsx(Modal.Header, { onModalClose: onCancel, children: ((_a = customT.header) == null ? void 0 : _a[isCreating ? "create" : "edit"]) ?? t(`explorer.resource.editModal.header.${isCreating ? "create" : "edit"}`) }),
|
|
116
120
|
/* @__PURE__ */ jsxs(Modal.Body, { children: [
|
|
117
|
-
/* @__PURE__ */ jsx(Heading, { headingStyle: "h4", level: "h3", className: "mb-16", children: t("explorer.resource.editModal.heading.general") }),
|
|
121
|
+
/* @__PURE__ */ jsx(Heading, { headingStyle: "h4", level: "h3", className: "mb-16", children: ((_b = customT.heading) == null ? void 0 : _b.general) ?? t("explorer.resource.editModal.heading.general") }),
|
|
118
122
|
/* @__PURE__ */ jsxs("form", { id: formId, onSubmit: handleSubmit(onSubmit), children: [
|
|
119
123
|
/* @__PURE__ */ jsxs("div", { className: "d-block d-md-flex gap-16 mb-24", children: [
|
|
120
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(ImagePicker, { app: currentApp, src: isUpdating && (resource == null ? void 0 : resource.thumbnail) || "", addButtonLabel: t("explorer.imagepicker.button.add"), deleteButtonLabel: t("explorer.imagepicker.button.delete"), onUploadImage: handleUploadImage, onDeleteImage: handleDeleteImage, className: "align-self-center mt-8", libraryMedia, mediaLibraryRef }) }),
|
|
124
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(ImagePicker, { app: currentApp, src: isUpdating && (resource == null ? void 0 : resource.thumbnail) || "", addButtonLabel: ((_c = customT.imagepicker) == null ? void 0 : _c.add) ?? t("explorer.imagepicker.button.add"), deleteButtonLabel: ((_d = customT.imagepicker) == null ? void 0 : _d.delete) ?? t("explorer.imagepicker.button.delete"), onUploadImage: handleUploadImage, onDeleteImage: handleDeleteImage, className: "align-self-center mt-8", libraryMedia, mediaLibraryRef }) }),
|
|
121
125
|
/* @__PURE__ */ jsxs("div", { className: "col", children: [
|
|
122
126
|
/* @__PURE__ */ jsxs(FormControl, { id: "title", className: "mb-16", isRequired: !0, children: [
|
|
123
|
-
/* @__PURE__ */ jsx(Label, { children: t("title") }),
|
|
127
|
+
/* @__PURE__ */ jsx(Label, { children: customT.title ?? t("title") }),
|
|
124
128
|
/* @__PURE__ */ jsx(Input, { type: "text", defaultValue: isUpdating ? resource == null ? void 0 : resource.name : "", ...register("title", {
|
|
125
129
|
required: !0,
|
|
126
130
|
maxLength: inputMaxLength,
|
|
@@ -128,14 +132,14 @@ const DEFAULT_INPUT_MAX_LENGTH = 60, DEFAULT_TEXTAREA_MAX_LENGTH = 400, Resource
|
|
|
128
132
|
value: /[^ ]/,
|
|
129
133
|
message: "invalid title"
|
|
130
134
|
}
|
|
131
|
-
}), placeholder: t("explorer.resource.editModal.title.placeholder"), size: "md", "aria-required": !0, maxLength: inputMaxLength })
|
|
135
|
+
}), placeholder: ((_e = customT.placeholder) == null ? void 0 : _e.title) ?? t("explorer.resource.editModal.title.placeholder"), size: "md", "aria-required": !0, maxLength: inputMaxLength })
|
|
132
136
|
] }),
|
|
133
137
|
/* @__PURE__ */ jsxs(FormControl, { id: "description", isOptional: !0, children: [
|
|
134
|
-
/* @__PURE__ */ jsx(Label, { children: t("description") }),
|
|
138
|
+
/* @__PURE__ */ jsx(Label, { children: customT.description ?? t("description") }),
|
|
135
139
|
/* @__PURE__ */ jsx(TextArea, { defaultValue: (resource == null ? void 0 : resource.description) || "", ...register("description", {
|
|
136
140
|
required: !1,
|
|
137
141
|
maxLength: textareaMaxLength
|
|
138
|
-
}), placeholder: t("explorer.resource.editModal.description.placeholder"), size: "md", maxLength: textareaMaxLength }),
|
|
142
|
+
}), placeholder: ((_f = customT.placeholder) == null ? void 0 : _f.description) ?? t("explorer.resource.editModal.description.placeholder"), size: "md", maxLength: textareaMaxLength }),
|
|
139
143
|
watchedDescription && /* @__PURE__ */ jsx(TextareaCounter, { content: watchedDescription, maxLength: textareaMaxLength })
|
|
140
144
|
] })
|
|
141
145
|
] })
|
|
@@ -144,8 +148,8 @@ const DEFAULT_INPUT_MAX_LENGTH = 60, DEFAULT_TEXTAREA_MAX_LENGTH = 400, Resource
|
|
|
144
148
|
] })
|
|
145
149
|
] }),
|
|
146
150
|
/* @__PURE__ */ jsxs(Modal.Footer, { children: [
|
|
147
|
-
/* @__PURE__ */ jsx(Button, { color: "tertiary", onClick: onCancel, type: "button", variant: "ghost", children: t("explorer.cancel") }),
|
|
148
|
-
/* @__PURE__ */ jsx(Button, { form: formId, type: "submit", color: "primary", isLoading: isSubmitting, variant: "filled", disabled: !isValid || isSubmitting, children:
|
|
151
|
+
/* @__PURE__ */ jsx(Button, { color: "tertiary", onClick: onCancel, type: "button", variant: "ghost", children: customT.cancel ?? t("explorer.cancel") }),
|
|
152
|
+
/* @__PURE__ */ jsx(Button, { form: formId, type: "submit", color: "primary", isLoading: isSubmitting, variant: "filled", disabled: !isValid || isSubmitting, children: isCreating ? customT.create ?? t("explorer.create") : customT.save ?? t("save") })
|
|
149
153
|
] }),
|
|
150
154
|
/* @__PURE__ */ jsx(MediaLibrary, { appCode: application, ref: mediaLibraryRef, multiple: !1, visibility: "protected", ...mediaLibraryHandlers })
|
|
151
155
|
] }), document.getElementById("portal"));
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { WorkspaceElement } from '@edifice.io/client';
|
|
2
3
|
import { CardProps } from '../../../components';
|
|
3
4
|
export interface FileCardProps extends CardProps {
|
|
4
5
|
/**
|
|
5
6
|
* WorkspaceElement
|
|
6
|
-
|
|
7
|
+
*/
|
|
7
8
|
doc: WorkspaceElement;
|
|
9
|
+
/**
|
|
10
|
+
* Custom icon to override the default based on file type
|
|
11
|
+
* Can be a string or a React node
|
|
12
|
+
*/
|
|
13
|
+
customIcon?: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Custom color class to override the default based on file type
|
|
16
|
+
* Example: "bg-purple-300" or any valid CSS class
|
|
17
|
+
*/
|
|
18
|
+
customColor?: string;
|
|
8
19
|
}
|
|
9
20
|
declare const FileCard: {
|
|
10
|
-
({ doc, isClickable, isSelectable, isSelected, onClick, className, }: FileCardProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
({ doc, isClickable, isSelectable, isSelected, onClick, className, onSelect, isFocused, app, customIcon, customColor, }: FileCardProps): import("react/jsx-runtime").JSX.Element;
|
|
11
22
|
displayName: string;
|
|
12
23
|
};
|
|
13
24
|
export default FileCard;
|
|
@@ -15,11 +15,21 @@ const FileCard = ({
|
|
|
15
15
|
isSelectable = !1,
|
|
16
16
|
isSelected = !1,
|
|
17
17
|
onClick,
|
|
18
|
-
className
|
|
18
|
+
className,
|
|
19
|
+
onSelect,
|
|
20
|
+
isFocused,
|
|
21
|
+
app,
|
|
22
|
+
customIcon,
|
|
23
|
+
customColor
|
|
19
24
|
}) => {
|
|
20
|
-
var _a;
|
|
21
25
|
const ref = useRef(null), type = DocumentHelper.getRole(doc);
|
|
22
26
|
function getRoleMap(type2) {
|
|
27
|
+
if (customIcon !== void 0 || customColor !== void 0)
|
|
28
|
+
return {
|
|
29
|
+
icon: customIcon || /* @__PURE__ */ jsx(SvgIconTextPage, { width: 22, height: 22 }),
|
|
30
|
+
color: customColor || "bg-gray-300",
|
|
31
|
+
hasShadow: !1
|
|
32
|
+
};
|
|
23
33
|
const roleMappings = {
|
|
24
34
|
csv: {
|
|
25
35
|
icon: ".CSV",
|
|
@@ -72,17 +82,17 @@ const FileCard = ({
|
|
|
72
82
|
};
|
|
73
83
|
return roleMappings[type2] || roleMappings.unknown;
|
|
74
84
|
}
|
|
75
|
-
const file = clsx("file position-relative rounded", (
|
|
85
|
+
const roleMap = getRoleMap(type ?? "unknown"), file = clsx("file position-relative rounded", (roleMap == null ? void 0 : roleMap.color) ?? "bg-yellow-200"), mediaSrc = type === "img" || type === "video" ? odeServices.workspace().getThumbnailUrl(doc) : null, hasThumbnail = useThumbnail(mediaSrc, {
|
|
76
86
|
ref
|
|
77
87
|
}), imageStyles = hasThumbnail && {
|
|
78
88
|
backgroundImage: `url(${mediaSrc})`,
|
|
79
89
|
backgroundSize: "cover"
|
|
80
90
|
};
|
|
81
|
-
return /* @__PURE__ */ jsx(Card, { className: clsx("card-file", className), isClickable, isSelectable, isSelected, onClick, children: /* @__PURE__ */ jsxs(Card.Body, { space: "8", children: [
|
|
91
|
+
return /* @__PURE__ */ jsx(Card, { className: clsx("card-file", className), isClickable, isSelectable, isSelected, onClick, app, isFocused, onSelect, children: /* @__PURE__ */ jsxs(Card.Body, { space: "8", children: [
|
|
82
92
|
/* @__PURE__ */ jsx("div", { ref, className: file, style: {
|
|
83
93
|
aspectRatio: "16/10",
|
|
84
94
|
...imageStyles
|
|
85
|
-
}, children: type !== "img" || type === "img" && !hasThumbnail ? /* @__PURE__ */ jsx(FileIcon, { type, roleMap
|
|
95
|
+
}, children: type !== "img" || type === "img" && !hasThumbnail ? /* @__PURE__ */ jsx(FileIcon, { type, roleMap }) : null }),
|
|
86
96
|
/* @__PURE__ */ jsxs("div", { className: "mt-4", children: [
|
|
87
97
|
/* @__PURE__ */ jsx(Card.Text, { children: doc.name }),
|
|
88
98
|
/* @__PURE__ */ jsx(Card.Text, { className: "text-black-50", children: doc == null ? void 0 : doc.ownerName })
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { Role } from '@edifice.io/client';
|
|
2
2
|
declare const FileIcon: ({ type, roleMap, }: {
|
|
3
3
|
type: Role | "unknown";
|
|
4
|
-
roleMap?:
|
|
4
|
+
roleMap?: {
|
|
5
|
+
icon: React.ReactNode | string;
|
|
6
|
+
color: string;
|
|
7
|
+
hasShadow?: boolean;
|
|
8
|
+
};
|
|
5
9
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
10
|
export default FileIcon;
|
|
@@ -5,8 +5,8 @@ const FileIcon = ({
|
|
|
5
5
|
type,
|
|
6
6
|
roleMap
|
|
7
7
|
}) => {
|
|
8
|
-
const
|
|
9
|
-
"p-12 rounded-circle shadow":
|
|
8
|
+
const hasShadow = typeof (roleMap == null ? void 0 : roleMap.icon) != "string" && type !== "unknown" && (roleMap == null ? void 0 : roleMap.hasShadow) !== !1, fileicon = clsx("position-absolute top-50 start-50 translate-middle", {
|
|
9
|
+
"p-12 rounded-circle shadow": hasShadow
|
|
10
10
|
}, roleMap == null ? void 0 : roleMap.color);
|
|
11
11
|
return /* @__PURE__ */ jsx("div", { className: fileicon, children: (roleMap == null ? void 0 : roleMap.icon) ?? /* @__PURE__ */ jsx(SvgIconPaperclip, {}) });
|
|
12
12
|
};
|