@edifice.io/react 2.5.12-develop-enabling.20260227103812 → 2.5.12-develop-b2school.20260305152150

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 (119) hide show
  1. package/dist/components/Card/Card.js +1 -1
  2. package/dist/components/Combobox/Combobox.js +1 -1
  3. package/dist/components/Dropdown/Dropdown.js +1 -1
  4. package/dist/components/Form/FormControl.js +1 -1
  5. package/dist/components/Layout/components/WidgetApps.js +2 -2
  6. package/dist/components/MediaViewer/PdfViewer.js +14 -4
  7. package/dist/components/Modal/Modal.js +1 -1
  8. package/dist/components/PreventPropagation/PreventPropagation.js +1 -1
  9. package/dist/components/PromotionCard/PromotionCard.js +1 -1
  10. package/dist/components/SearchBar/SearchBar.d.ts +2 -2
  11. package/dist/components/SegmentedControl/SegmentedControl.d.ts +8 -0
  12. package/dist/components/SegmentedControl/SegmentedControl.js +12 -6
  13. package/dist/components/Table/components/Table.js +1 -1
  14. package/dist/hooks/useConf/useConf.d.ts +1 -1
  15. package/dist/hooks/useDropdown/useDropdown.js +0 -2
  16. package/dist/hooks/usePreferences/usePreferences.d.ts +3 -3
  17. package/dist/hooks/useSession/useSession.d.ts +1 -1
  18. package/dist/hooks/useThumbnail/useThumbnail.d.ts +1 -1
  19. package/dist/hooks/useThumbnail/useThumbnail.js +1 -5
  20. package/dist/hooks/useToast/useToast.js +5 -5
  21. package/dist/hooks/useUpload/useUpload.js +5 -2
  22. package/dist/hooks/useWorkspaceFolders/useWorkspaceFolders.js +1 -1
  23. package/dist/modules/editor/components/Editor/EditorPreview.js +1 -1
  24. package/dist/modules/modals/OnboardingModal/OnboardingModal.d.ts +28 -2
  25. package/dist/modules/modals/OnboardingModal/OnboardingModal.js +13 -9
  26. package/dist/modules/modals/OnboardingModal/useOnboardingModal.d.ts +4 -1
  27. package/dist/modules/modals/OnboardingModal/useOnboardingModal.js +24 -17
  28. package/dist/modules/modals/ResourceModal/ResourceModal.d.ts +1 -1
  29. package/dist/modules/modals/ResourceModal/hooks/useUpdateMutation.d.ts +1 -1
  30. package/dist/modules/modals/ShareModal/ShareResources.d.ts +53 -4
  31. package/dist/modules/modals/ShareModal/ShareResources.js +1 -1
  32. package/dist/modules/modals/ShareModal/apps/ShareBlog.d.ts +1 -1
  33. package/dist/modules/modals/ShareModal/hooks/useShareBookmark.js +1 -2
  34. package/dist/modules/modals/ShareModal/hooks/useShareMutation.d.ts +1 -1
  35. package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +0 -1
  36. package/dist/providers/AntThemeProvider/AntProvider.js +5 -5
  37. package/dist/providers/EdificeClientProvider/EdificeClientProvider.context.d.ts +1 -1
  38. package/dist/utilities/react-query/react-query-utils.d.ts +1 -1
  39. package/package.json +50 -51
  40. package/dist/_virtual/common.js +0 -4
  41. package/dist/_virtual/de_DE.js +0 -4
  42. package/dist/_virtual/de_DE2.js +0 -4
  43. package/dist/_virtual/de_DE3.js +0 -4
  44. package/dist/_virtual/de_DE4.js +0 -4
  45. package/dist/_virtual/de_DE5.js +0 -4
  46. package/dist/_virtual/de_DE6.js +0 -4
  47. package/dist/_virtual/defineProperty.js +0 -4
  48. package/dist/_virtual/es_ES.js +0 -4
  49. package/dist/_virtual/es_ES2.js +0 -4
  50. package/dist/_virtual/es_ES3.js +0 -4
  51. package/dist/_virtual/es_ES4.js +0 -4
  52. package/dist/_virtual/es_ES5.js +0 -4
  53. package/dist/_virtual/es_ES6.js +0 -4
  54. package/dist/_virtual/fr_FR.js +0 -4
  55. package/dist/_virtual/fr_FR2.js +0 -4
  56. package/dist/_virtual/fr_FR3.js +0 -4
  57. package/dist/_virtual/fr_FR4.js +0 -4
  58. package/dist/_virtual/fr_FR5.js +0 -4
  59. package/dist/_virtual/fr_FR6.js +0 -4
  60. package/dist/_virtual/interopRequireDefault.js +0 -4
  61. package/dist/_virtual/it_IT.js +0 -4
  62. package/dist/_virtual/it_IT2.js +0 -4
  63. package/dist/_virtual/it_IT3.js +0 -4
  64. package/dist/_virtual/it_IT4.js +0 -4
  65. package/dist/_virtual/it_IT5.js +0 -4
  66. package/dist/_virtual/it_IT6.js +0 -4
  67. package/dist/_virtual/objectSpread2.js +0 -4
  68. package/dist/_virtual/pt_PT.js +0 -4
  69. package/dist/_virtual/pt_PT2.js +0 -4
  70. package/dist/_virtual/pt_PT3.js +0 -4
  71. package/dist/_virtual/pt_PT4.js +0 -4
  72. package/dist/_virtual/pt_PT5.js +0 -4
  73. package/dist/_virtual/pt_PT6.js +0 -4
  74. package/dist/_virtual/toPrimitive.js +0 -4
  75. package/dist/_virtual/toPropertyKey.js +0 -4
  76. package/dist/_virtual/typeof.js +0 -4
  77. package/dist/hooks/useWorkspaceFolders/useWorkspaceFolders.d.ts +0 -12
  78. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/defineProperty.js +0 -18
  79. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/interopRequireDefault.js +0 -13
  80. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/objectSpread2.js +0 -31
  81. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/toPrimitive.js +0 -20
  82. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/toPropertyKey.js +0 -15
  83. package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/typeof.js +0 -16
  84. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/calendar/locale/de_DE.js +0 -11
  85. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/calendar/locale/es_ES.js +0 -11
  86. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/calendar/locale/fr_FR.js +0 -11
  87. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/calendar/locale/it_IT.js +0 -11
  88. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/calendar/locale/pt_PT.js +0 -11
  89. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/date-picker/locale/de_DE.js +0 -22
  90. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/date-picker/locale/es_ES.js +0 -22
  91. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/date-picker/locale/fr_FR.js +0 -27
  92. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/date-picker/locale/it_IT.js +0 -20
  93. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/date-picker/locale/pt_PT.js +0 -45
  94. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/locale/de_DE.js +0 -145
  95. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/locale/es_ES.js +0 -145
  96. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/locale/fr_FR.js +0 -144
  97. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/locale/it_IT.js +0 -156
  98. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/locale/pt_PT.js +0 -158
  99. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/time-picker/locale/de_DE.js +0 -10
  100. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/time-picker/locale/es_ES.js +0 -10
  101. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/time-picker/locale/fr_FR.js +0 -10
  102. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/time-picker/locale/it_IT.js +0 -10
  103. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/lib/time-picker/locale/pt_PT.js +0 -10
  104. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/locale/de_DE.js +0 -8
  105. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/locale/es_ES.js +0 -8
  106. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/locale/fr_FR.js +0 -8
  107. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/locale/it_IT.js +0 -8
  108. package/dist/node_modules/.pnpm/antd@5.29.1_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/antd/locale/pt_PT.js +0 -8
  109. 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 +0 -21
  110. 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 +0 -21
  111. 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/fr_FR.js +0 -21
  112. 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 +0 -21
  113. 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 +0 -21
  114. 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/common.js +0 -14
  115. 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 +0 -37
  116. 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 +0 -37
  117. 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/fr_FR.js +0 -38
  118. 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 +0 -37
  119. 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 +0 -39
@@ -39,7 +39,7 @@ const Root = /* @__PURE__ */ forwardRef(({
39
39
  /* @__PURE__ */ jsx(Card.Header, {}),
40
40
  typeof children == "function" ? children(appCode) : children
41
41
  ] }) });
42
- }), Card = Object.assign(Root, {
42
+ }), Card = /* @__PURE__ */ Object.assign(Root, {
43
43
  Title: CardTitle,
44
44
  Text: CardText,
45
45
  Image: CardImage,
@@ -53,7 +53,7 @@ const ComboboxComponent = /* @__PURE__ */ forwardRef(({
53
53
  }, value, variant, renderInputGroup, renderSelectedItems, hasDefault: !!options.length, onFocus, onBlur, inputRef }),
54
54
  /* @__PURE__ */ jsx(Dropdown.Menu, { "data-testid": "combobox-search-menu", children: renderContent() })
55
55
  ] });
56
- }), Combobox = Object.assign(ComboboxComponent, {
56
+ }), Combobox = /* @__PURE__ */ Object.assign(ComboboxComponent, {
57
57
  Trigger: ComboboxTrigger
58
58
  });
59
59
  export {
@@ -67,7 +67,7 @@ const Root = /* @__PURE__ */ forwardRef(({
67
67
  return useEffect(() => {
68
68
  onToggle == null || onToggle(visible);
69
69
  }, [visible]), /* @__PURE__ */ jsx(DropdownContext.Provider, { value, children: /* @__PURE__ */ jsx("div", { ref, className: dropdown, children: typeof children == "function" ? children(triggerProps, itemRefs, setVisible) : children }) });
70
- }), Dropdown = Object.assign(Root, {
70
+ }), Dropdown = /* @__PURE__ */ Object.assign(Root, {
71
71
  Trigger: DropdownTrigger,
72
72
  Menu: DropdownMenu,
73
73
  Item: DropdownItem,
@@ -22,7 +22,7 @@ const Root = /* @__PURE__ */ forwardRef(({
22
22
  status
23
23
  }), [id, isOptional, isReadOnly, isRequired, status]);
24
24
  return /* @__PURE__ */ jsx(Context.Provider, { value: values, children: /* @__PURE__ */ jsx("div", { ref, className, ...restProps, children }) });
25
- }), FormControl = Object.assign(Root, {
25
+ }), FormControl = /* @__PURE__ */ Object.assign(Root, {
26
26
  Label,
27
27
  Input,
28
28
  Text: FormText
@@ -11,10 +11,10 @@ const WidgetAppsFooter = () => {
11
11
  }) => {
12
12
  const {
13
13
  t
14
- } = useTranslation();
14
+ } = useTranslation(), getAppName = (data) => data.prefix && data.prefix.length > 1 ? t(data.prefix.substring(1)) : t(data.displayName) || "";
15
15
  return /* @__PURE__ */ jsxs("div", { className: "widget-body d-flex flex-wrap", children: [
16
16
  !bookmarkedApps.length && /* @__PURE__ */ jsx("div", { className: "text-dark", children: t("navbar.myapps.more") }),
17
- bookmarkedApps.slice(0, 6).map((app, index) => /* @__PURE__ */ jsx("a", { href: app.address, className: "bookmarked-app", target: appToOpenOnBlank.includes(app.name) || app.isExternal || app.target === "_blank" ? "_blank" : void 0, rel: appToOpenOnBlank.includes(app.name) || app.isExternal || app.target === "_blank" ? "noopener noreferrer" : void 0, children: /* @__PURE__ */ jsx(AppIcon, { app, size: "32" }) }, index))
17
+ bookmarkedApps.slice(0, 6).map((app, index) => /* @__PURE__ */ jsx("a", { href: app.address, title: getAppName(app), className: "bookmarked-app", target: appToOpenOnBlank.includes(app.name) || app.isExternal || app.category === "connector" ? "_blank" : void 0, rel: appToOpenOnBlank.includes(app.name) || app.isExternal || app.category === "connector" ? "noopener noreferrer" : void 0, children: /* @__PURE__ */ jsx(AppIcon, { app, size: "32" }) }, index))
18
18
  ] });
19
19
  };
20
20
  export {
@@ -1,17 +1,27 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { useState, useRef } from "react";
3
- import { Document, Page } from "react-pdf";
2
+ import { useState, useRef, useEffect } from "react";
4
3
  import LoadingScreen from "../LoadingScreen/LoadingScreen.js";
5
4
  function PdfViewer({
6
5
  mediaUrl,
7
6
  scale
8
7
  }) {
9
- const [numPages, setNumPages] = useState(null), pagesRef = useRef([]), onDocumentLoadSuccess = ({
8
+ const [numPages, setNumPages] = useState(null), [Document, setDocument] = useState(null), [Page, setPage] = useState(null), [isLoading, setIsLoading] = useState(!0), pagesRef = useRef([]);
9
+ useEffect(() => {
10
+ (async () => {
11
+ try {
12
+ const reactPdf = await import("react-pdf");
13
+ setDocument(() => reactPdf.Document), setPage(() => reactPdf.Page), setIsLoading(!1);
14
+ } catch (error) {
15
+ console.error("Failed to load react-pdf:", error);
16
+ }
17
+ })();
18
+ }, []);
19
+ const onDocumentLoadSuccess = ({
10
20
  numPages: numPages2
11
21
  }) => {
12
22
  setNumPages(numPages2);
13
23
  };
14
- return /* @__PURE__ */ jsx("div", { style: {
24
+ return isLoading || !Document || !Page ? /* @__PURE__ */ jsx(LoadingScreen, {}) : /* @__PURE__ */ jsx("div", { style: {
15
25
  width: `calc(600px * ${scale})`,
16
26
  height: "calc(100vh - 52px)",
17
27
  overflowY: "auto",
@@ -62,7 +62,7 @@ const Root = /* @__PURE__ */ forwardRef(({
62
62
  opacity: 0.65
63
63
  } })
64
64
  ] })) });
65
- }), Modal = Object.assign(Root, {
65
+ }), Modal = /* @__PURE__ */ Object.assign(Root, {
66
66
  Header: ModalHeader,
67
67
  Subtitle: ModalSubtitle,
68
68
  Body: ModalBody,
@@ -3,7 +3,7 @@ const Root = ({
3
3
  children
4
4
  }) => /* @__PURE__ */ jsx("div", { onClick: (e) => {
5
5
  e.stopPropagation();
6
- }, children }), PreventPropagation = Object.assign(Root, {});
6
+ }, children }), PreventPropagation = /* @__PURE__ */ Object.assign(Root, {});
7
7
  export {
8
8
  PreventPropagation as default
9
9
  };
@@ -17,7 +17,7 @@ const Root = ({
17
17
  borderColor,
18
18
  backgroundColor
19
19
  }, children });
20
- }, PromotionCard = Object.assign(Root, {
20
+ }, PromotionCard = /* @__PURE__ */ Object.assign(Root, {
21
21
  Header: PromotionCardHeader,
22
22
  Body: PromotionCardBody,
23
23
  Icon: PromotionCardIcon,
@@ -3,7 +3,7 @@ import { Size } from '../../types';
3
3
  /**
4
4
  * Base props shared by both SearchBar variants
5
5
  */
6
- interface BaseProps extends Omit<React.ComponentPropsWithoutRef<'input'>, 'size'> {
6
+ export interface BaseProps extends Omit<React.ComponentPropsWithoutRef<'input'>, 'size'> {
7
7
  /**
8
8
  * String or template literal key for i18next translation
9
9
  */
@@ -67,7 +67,7 @@ type DynamicSearchBar = {
67
67
  /**
68
68
  * Props for the SearchBar component
69
69
  */
70
- type Props = DefaultSearchBar | DynamicSearchBar;
70
+ export type Props = DefaultSearchBar | DynamicSearchBar;
71
71
  export type SearchBarProps = BaseProps & Props;
72
72
  /**
73
73
  * SearchBar component to handle dynamic or static search input
@@ -27,6 +27,14 @@ export interface SegmentedControlProps extends Omit<React.HTMLAttributes<HTMLDiv
27
27
  * Selected value
28
28
  */
29
29
  value?: string;
30
+ /**
31
+ * Variant of the segmented control, affecting its styling.
32
+ * - 'default': standard segmented control with borders.
33
+ * - 'ghost': borderless segmented control, relying on background and text color for distinction.
34
+ *
35
+ * @default 'default'
36
+ */
37
+ variant?: 'default' | 'ghost';
30
38
  /**
31
39
  * Callback called when value changes
32
40
  */
@@ -1,20 +1,26 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
2
  import { Segmented } from "antd";
3
+ import clsx from "clsx";
4
+ import { forwardRef } from "react";
4
5
  const SegmentedControl = /* @__PURE__ */ forwardRef(({
5
6
  options,
6
7
  value,
7
8
  onChange,
9
+ variant = "default",
10
+ className,
8
11
  ...htmlProps
9
12
  }, ref) => {
10
- const antProps = {
11
- options: options.map((option) => ({
12
- ...option,
13
- label: /* @__PURE__ */ jsx("span", { "data-testid": `segmented-option-${option.value}`, children: option.label })
14
- })),
13
+ const transformedOptions = options.map((option) => ({
14
+ ...option,
15
+ label: /* @__PURE__ */ jsx("span", { "data-testid": `segmented-option-${option.value}`, children: option.label })
16
+ })), classNames = clsx(className, {
17
+ ghost: variant === "ghost"
18
+ }), antProps = {
19
+ options: transformedOptions,
15
20
  value,
16
21
  onChange,
17
22
  ref,
23
+ className: classNames,
18
24
  ...htmlProps
19
25
  };
20
26
  return /* @__PURE__ */ jsx(Segmented, { ...antProps });
@@ -13,7 +13,7 @@ const Root = /* @__PURE__ */ forwardRef(({
13
13
  overflowY: "auto"
14
14
  } : {}, children: /* @__PURE__ */ jsx("table", { ref, className: "table align-middle mb-0", style: {
15
15
  overflow: maxHeight ? "visible" : "hidden"
16
- }, children }) })), Table = Object.assign(Root, {
16
+ }, children }) })), Table = /* @__PURE__ */ Object.assign(Root, {
17
17
  Thead: TableThead,
18
18
  Th: TableTh,
19
19
  Tbody: TableTbody,
@@ -1,4 +1,4 @@
1
1
  import { App, IGetConf } from '@edifice.io/client';
2
2
  export default function useConf({ appCode }: {
3
3
  appCode: App;
4
- }): import('@tanstack/react-query').UseQueryResult<IGetConf, Error>;
4
+ }): import('../../../node_modules/@tanstack/react-query').UseQueryResult<IGetConf, Error>;
@@ -73,8 +73,6 @@ const useDropdown = (placement, extraTriggerKeyDownHandler, isTriggerHovered = !
73
73
  case "Space":
74
74
  if (!openOnSpace)
75
75
  break;
76
- openDropdown(), flag = !0;
77
- break;
78
76
  case "Enter":
79
77
  case "ArrowDown":
80
78
  case "Down":
@@ -1,4 +1,4 @@
1
- export default function usePreferences(name: string): {
2
- getPreference: () => Promise<any>;
3
- savePreference: (value: any) => Promise<void>;
1
+ export default function usePreferences<T = any>(name: string): {
2
+ getPreference: () => Promise<T>;
3
+ savePreference: (value: T) => Promise<void>;
4
4
  };
@@ -1,2 +1,2 @@
1
1
  import { IGetSession } from '@edifice.io/client';
2
- export default function useSession(): import('@tanstack/react-query').UseQueryResult<IGetSession, Error>;
2
+ export default function useSession(): import('../../../node_modules/@tanstack/react-query').UseQueryResult<IGetSession, Error>;
@@ -10,5 +10,5 @@ type LazyLoadOptions = {
10
10
  * with respect to the [`intersectionOptions`](https://github.com/thebuilder/react-intersection-observer/tree/dceba7f52aebea4d62d539bc55a1db129226bb6c?tab=readme-ov-file#options)
11
11
  * @return `true` if `src` is available, or false otherwise, or `null` while not tested.
12
12
  */
13
- export default function useThumbnail(src: string | null | undefined, options?: LazyLoadOptions): boolean | null;
13
+ export default function useThumbnail(src: string, options?: LazyLoadOptions): boolean | null;
14
14
  export {};
@@ -13,10 +13,6 @@ function useThumbnail(src, options) {
13
13
  (_a = options == null ? void 0 : options.ref) != null && _a.current && (inViewRef == null || inViewRef(options.ref.current));
14
14
  }, [options == null ? void 0 : options.ref, inViewRef]), useEffect(() => {
15
15
  if ((options == null ? void 0 : options.ref) === void 0 || inView) {
16
- if (!src) {
17
- setStatus(!1);
18
- return;
19
- }
20
16
  const img = new Image();
21
17
  return img.src = src, img.onload = () => {
22
18
  setStatus(!0);
@@ -26,7 +22,7 @@ function useThumbnail(src, options) {
26
22
  img.onload = null, img.onerror = null, setStatus(null);
27
23
  };
28
24
  }
29
- }, [inView, src]), status;
25
+ }, [inView]), status;
30
26
  }
31
27
  export {
32
28
  useThumbnail as default
@@ -1,27 +1,27 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import toast from "react-hot-toast";
3
3
  import Alert from "../../components/Alert/Alert.js";
4
- const DEFAULT_POSITION = "top-right";
4
+ const DEFAULT_POSITION = "top-right", DEFAULT_DURATION = 5e3;
5
5
  function useToast() {
6
6
  return {
7
7
  success: (message, options) => toast.custom(/* @__PURE__ */ jsx(Alert, { type: "success", isToast: !0, isDismissible: options == null ? void 0 : options.isDismissible, className: "mb-12", children: message }), {
8
8
  id: options == null ? void 0 : options.id,
9
- duration: options == null ? void 0 : options.duration,
9
+ duration: (options == null ? void 0 : options.duration) ?? DEFAULT_DURATION,
10
10
  position: (options == null ? void 0 : options.position) ?? DEFAULT_POSITION
11
11
  }),
12
12
  error: (message, options) => toast.custom(/* @__PURE__ */ jsx(Alert, { type: "danger", isToast: !0, isDismissible: options == null ? void 0 : options.isDismissible, className: "mb-12", children: message }), {
13
13
  id: options == null ? void 0 : options.id,
14
- duration: options == null ? void 0 : options.duration,
14
+ duration: (options == null ? void 0 : options.duration) ?? DEFAULT_DURATION,
15
15
  position: (options == null ? void 0 : options.position) ?? DEFAULT_POSITION
16
16
  }),
17
17
  info: (message, options) => toast.custom(/* @__PURE__ */ jsx(Alert, { type: "info", isToast: !0, isDismissible: options == null ? void 0 : options.isDismissible, className: "mb-12", children: message }), {
18
18
  id: options == null ? void 0 : options.id,
19
- duration: options == null ? void 0 : options.duration,
19
+ duration: (options == null ? void 0 : options.duration) ?? DEFAULT_DURATION,
20
20
  position: (options == null ? void 0 : options.position) ?? DEFAULT_POSITION
21
21
  }),
22
22
  warning: (message, options) => toast.custom(/* @__PURE__ */ jsx(Alert, { type: "warning", isToast: !0, isDismissible: options == null ? void 0 : options.isDismissible, className: "mb-12", children: message }), {
23
23
  id: options == null ? void 0 : options.id,
24
- duration: options == null ? void 0 : options.duration,
24
+ duration: (options == null ? void 0 : options.duration) ?? DEFAULT_DURATION,
25
25
  position: (options == null ? void 0 : options.position) ?? DEFAULT_POSITION
26
26
  }),
27
27
  loading: toast.loading,
@@ -87,8 +87,11 @@ const useUpload = (visibility, application = "media-library") => {
87
87
  children: [],
88
88
  created: /* @__PURE__ */ new Date(),
89
89
  _shared: [],
90
- isShared: !1,
91
- owner: ""
90
+ _isShared: !1,
91
+ owner: {
92
+ userId: "",
93
+ displayName: ""
94
+ }
92
95
  };
93
96
  throw uploadResponse.state === "error" ? new Error(uploadResponse.code || "Error while uploading video") : new Error("Video encoding is still running");
94
97
  };
@@ -1,8 +1,8 @@
1
1
  import { odeServices } from "@edifice.io/client";
2
2
  import { useQueryClient, useQuery, useMutation } from "@tanstack/react-query";
3
3
  import { useMemo, useCallback } from "react";
4
- import { useTranslation } from "react-i18next";
5
4
  import { useEdificeClient } from "../../providers/EdificeClientProvider/EdificeClientProvider.hook.js";
5
+ import { useTranslation } from "react-i18next";
6
6
  import useToast from "../useToast/useToast.js";
7
7
  function useWorkspaceFolders() {
8
8
  const queryClient = useQueryClient(), {
@@ -48,7 +48,7 @@ const EditorPreview = ({
48
48
  }), children: t("editor.preview.moreMedia", {
49
49
  mediaCount: medias.length - (index + 1)
50
50
  }) })
51
- ] }, `${index}-${media.url}`)) })
51
+ ] }, media.url)) })
52
52
  ] });
53
53
  };
54
54
  export {
@@ -38,11 +38,37 @@ export interface OnboardingModalRef {
38
38
  setIsOpen: (isOpen: boolean) => void;
39
39
  handleSavePreference: () => void;
40
40
  }
41
- interface OnboardingProps {
41
+ /**
42
+ * Result of a custom display check. Must contain the following data :
43
+ * - display: a boolean indicating whether the modal should be shown when truthy or hidden if falsy;
44
+ * - nextState: the next state to persist when onboarding is done.
45
+ */
46
+ export interface DisplayRuleCheckResult<T> {
47
+ display: boolean;
48
+ nextState: T;
49
+ }
50
+ export interface OnboardingProps<T = boolean> {
42
51
  id: string;
43
52
  items: ModalItemsProps[];
44
53
  modalOptions?: ModalOptionsProps;
45
54
  isOnboardingChange?: (isOnboarding: boolean) => void;
55
+ /**
56
+ * Allow the parent component to control the rule for showing/hiding the modal.
57
+ *
58
+ * If undefined, the component will manage a visible/hidden state on its own.
59
+ *
60
+ * If defined, this function is called with the previously known state (if any).
61
+ * It can then compute the next state and return a DisplayRuleCheckResult.
62
+ *
63
+ * Note that the user may close the modal without finishing their onboarding.
64
+ * In this case, the next state is not persisted.
65
+ */
66
+ onDisplayRuleCheck?: (previousState?: T) => DisplayRuleCheckResult<T>;
46
67
  }
47
- declare const OnboardingModal: import('react').ForwardRefExoticComponent<OnboardingProps & import('react').RefAttributes<OnboardingModalRef>>;
68
+ declare const OnboardingModalInner: <T = boolean>({ id, items, modalOptions, isOnboardingChange, onDisplayRuleCheck, }: OnboardingProps<T>, ref: React.Ref<OnboardingModalRef>) => import('react').ReactPortal | null;
69
+ declare const OnboardingModal: (<T = boolean>(props: OnboardingProps<T> & {
70
+ ref?: React.Ref<OnboardingModalRef>;
71
+ }) => ReturnType<typeof OnboardingModalInner>) & {
72
+ displayName?: string;
73
+ };
48
74
  export default OnboardingModal;
@@ -8,11 +8,15 @@ 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 = /* @__PURE__ */ forwardRef(({
11
+ const OnboardingModalInner = ({
12
12
  id,
13
13
  items,
14
14
  modalOptions = {},
15
- isOnboardingChange
15
+ isOnboardingChange,
16
+ onDisplayRuleCheck = (previousState) => ({
17
+ display: previousState === !0,
18
+ nextState: !1
19
+ })
16
20
  }, ref) => {
17
21
  var _a;
18
22
  const [swiperInstance, setSwiperInstance] = useState(), [swiperProgress, setSwiperprogress] = useState(0), {
@@ -20,12 +24,12 @@ const OnboardingModal = /* @__PURE__ */ forwardRef(({
20
24
  isOnboarding,
21
25
  setIsOpen,
22
26
  handleSavePreference
23
- } = useOnboardingModal(id);
27
+ } = useOnboardingModal(id, onDisplayRuleCheck);
24
28
  useImperativeHandle(ref, () => ({
25
29
  setIsOpen,
26
30
  handleSavePreference
27
31
  })), useEffect(() => {
28
- isOnboardingChange && isOnboardingChange(isOnboarding);
32
+ isOnboardingChange == null || isOnboardingChange(isOnboarding);
29
33
  }, [isOnboarding, isOnboardingChange]), useEffect(() => {
30
34
  const link = document.createElement("link");
31
35
  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), () => {
@@ -44,7 +48,7 @@ const OnboardingModal = /* @__PURE__ */ forwardRef(({
44
48
  }, handleCloseWithoutPreference = () => {
45
49
  setIsOpen(!1), setSwiperprogress(0);
46
50
  };
47
- return /* @__PURE__ */ createPortal(/* @__PURE__ */ jsxs(Modal, { id: "onboarding-modal", "data-testid": "modal-onboarding", size: "md", isOpen, focusId: "nextButtonId", onModalClose: handleCloseWithoutPreference, children: [
51
+ return isOpen ? /* @__PURE__ */ createPortal(/* @__PURE__ */ jsxs(Modal, { id: "onboarding-modal", "data-testid": "modal-onboarding", size: "md", isOpen, focusId: "nextButtonId", onModalClose: handleCloseWithoutPreference, children: [
48
52
  /* @__PURE__ */ jsx(Modal.Header, { onModalClose: handleCloseWithoutPreference, centered: !0, children: t(currentTitle || "explorer.modal.onboarding.trash.title") }),
49
53
  /* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsx(Swiper, { modules: [Pagination], onSwiper: (swiper) => {
50
54
  setSwiperInstance(swiper);
@@ -61,13 +65,13 @@ const OnboardingModal = /* @__PURE__ */ forwardRef(({
61
65
  /* @__PURE__ */ jsxs(Modal.Footer, { children: [
62
66
  /* @__PURE__ */ jsx(Button, { "data-testid": "modal-onboarding-later", type: "button", color: "tertiary", variant: "ghost", onClick: handleCloseWithoutPreference, children: t("explorer.modal.onboarding.trash.later") }),
63
67
  swiperProgress > 0 && /* @__PURE__ */ jsx(Button, { "data-testid": "modal-onboarding-previous", type: "button", color: "primary", variant: "outline", onClick: () => swiperInstance.slidePrev(), children: t(prevText || "explorer.modal.onboarding.trash.prev") }),
64
- swiperProgress < 1 && /* @__PURE__ */ jsx(Button, { id: "nextButtonId", "data-testid": "modal-onboarding-next", type: "button", color: "primary", variant: "filled", onClick: () => swiperInstance.slideNext(), children: t(nextText || "explorer.modal.onboarding.trash.next") }),
65
- swiperProgress === 1 && /* @__PURE__ */ jsx(Button, { "data-testid": "modal-onboarding-close", type: "button", color: "primary", variant: "filled", onClick: () => {
68
+ items.length > 1 && swiperProgress < 1 && /* @__PURE__ */ jsx(Button, { id: "nextButtonId", "data-testid": "modal-onboarding-next", type: "button", color: "primary", variant: "filled", onClick: () => swiperInstance.slideNext(), children: t(nextText || "explorer.modal.onboarding.trash.next") }),
69
+ (items.length === 1 || swiperProgress === 1) && /* @__PURE__ */ jsx(Button, { "data-testid": "modal-onboarding-close", type: "button", color: "primary", variant: "filled", onClick: () => {
66
70
  isOnboarding ? handleCloseWithPreference() : handleCloseWithoutPreference();
67
71
  }, children: t(closeText || "explorer.modal.onboarding.trash.close") })
68
72
  ] })
69
- ] }), document.getElementById("portal") || document.body);
70
- });
73
+ ] }), document.getElementById("portal") || document.body) : null;
74
+ }, OnboardingModal = /* @__PURE__ */ forwardRef(OnboardingModalInner);
71
75
  export {
72
76
  OnboardingModal as default
73
77
  };
@@ -1,4 +1,7 @@
1
- export declare const useOnboardingModal: (id: string) => {
1
+ export declare const useOnboardingModal: <T>(id: string, applyDisplayRule: (previousState?: T) => {
2
+ display: boolean;
3
+ nextState: T;
4
+ }) => {
2
5
  isOpen: boolean;
3
6
  setIsOpen: import('react').Dispatch<import('react').SetStateAction<boolean>>;
4
7
  isOnboarding: boolean;
@@ -1,28 +1,35 @@
1
- import { useState, useEffect } from "react";
2
- import { odeServices } from "@edifice.io/client";
3
- const getOnboardingTrash = async (key) => await odeServices.conf().getPreference(key), saveOnboardingTrash = async (key) => await odeServices.conf().savePreference(key, JSON.stringify({
4
- key: !1
5
- })), useOnboardingModal = (id) => {
6
- const [isOpen, setIsOpen] = useState(!1), [isOnboarding, setIsOnboarding] = useState(!1);
7
- return useEffect(() => {
1
+ import { useRef, useState, useEffect, useCallback } from "react";
2
+ import usePreferences from "../../../hooks/usePreferences/usePreferences.js";
3
+ const useOnboardingModal = (id, applyDisplayRule) => {
4
+ const state = useRef(), [isOpen, setIsOpen] = useState(!1), [isOnboarding, setIsOnboarding] = useState(!1), {
5
+ getPreference,
6
+ savePreference
7
+ } = usePreferences(id);
8
+ useEffect(() => {
8
9
  (async () => {
9
- const response = await getOnboardingTrash(id);
10
+ const response = await getPreference();
10
11
  if (response) {
11
12
  const {
12
13
  key
13
- } = response;
14
- key === !0 && setIsOpen(!0), setIsOnboarding(key);
15
- return;
16
- }
17
- setIsOnboarding(!0), setIsOpen(!0);
14
+ } = response, {
15
+ display,
16
+ nextState
17
+ } = applyDisplayRule(key);
18
+ setIsOpen(display), setIsOnboarding(display), state.current = nextState;
19
+ } else
20
+ setIsOnboarding(!0), setIsOpen(!0), state.current = void 0;
18
21
  })();
19
- }, [id]), {
22
+ }, []);
23
+ const handleSavePreference = useCallback(async () => {
24
+ await savePreference({
25
+ key: state.current
26
+ }), setIsOpen(!1), setIsOnboarding(!1);
27
+ }, [savePreference, setIsOpen, setIsOnboarding]);
28
+ return {
20
29
  isOpen,
21
30
  setIsOpen,
22
31
  isOnboarding,
23
- handleSavePreference: async () => {
24
- await saveOnboardingTrash(id), setIsOpen(!1), setIsOnboarding(!1);
25
- }
32
+ handleSavePreference
26
33
  };
27
34
  };
28
35
  export {
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { CreateParameters, CreateResult, ID, IFolder, UpdateParameters, UpdateResult } from '@edifice.io/client';
3
- import { UseMutationResult } from '@tanstack/react-query';
3
+ import { UseMutationResult } from '../../../../node_modules/@tanstack/react-query';
4
4
  export interface FormInputs {
5
5
  title: string;
6
6
  description: string;
@@ -1,5 +1,5 @@
1
1
  import { UpdateParameters, UpdateResult } from '@edifice.io/client';
2
- import { UseMutationOptions, UseMutationResult } from '@tanstack/react-query';
2
+ import { UseMutationOptions, UseMutationResult } from '../../../../../node_modules/@tanstack/react-query';
3
3
  declare const useUpdateMutation: ({ application, options, }: {
4
4
  application: string;
5
5
  options?: UseMutationOptions<UpdateResult, Error, UpdateParameters>;
@@ -1,5 +1,5 @@
1
1
  import { ID, PutShareResponse, RightStringified, ShareRight, ShareRightAction, ShareRightActionDisplayName, ShareUrls } from '@edifice.io/client';
2
- import { UseMutationResult } from '@tanstack/react-query';
2
+ import { UseMutationResult } from '../../../../node_modules/@tanstack/react-query';
3
3
  /**
4
4
  * Configuration options for sharing a resource
5
5
  *
@@ -118,11 +118,21 @@ interface ShareResourceProps {
118
118
  classNameSearchInput?: string;
119
119
  }
120
120
  /**
121
- * Ref interface exposed by ShareResources component.
122
- * Use useRef with this type and call ref.current?.handleShare() to trigger share programmatically.
121
+ * Ref interface exposed by ShareResources component
123
122
  *
124
123
  * @interface ShareResourcesRef
125
124
  * @property {() => void} handleShare - Method to trigger the share operation
125
+ *
126
+ * @example
127
+ * ```tsx
128
+ * const ref = useRef<ShareResourcesRef>(null);
129
+ *
130
+ * // Trigger share programmatically
131
+ * ref.current?.handleShare();
132
+ *
133
+ * // Check sharing status
134
+ * const sharing = ref.current?.isSharing();
135
+ * ```
126
136
  */
127
137
  export interface ShareResourcesRef {
128
138
  handleShare: (notify?: boolean) => void;
@@ -132,7 +142,46 @@ export interface ShareResourcesRef {
132
142
  *
133
143
  * A component for managing resource sharing permissions with users and groups.
134
144
  * Provides search functionality, bookmark management, and granular rights control.
135
- * Use forwardRef to get a ref with handleShare(). See ShareResourcesRef interface.
145
+ *
146
+ * @example
147
+ * ```tsx
148
+ * import { useRef } from 'react';
149
+ * import ShareResources, { ShareResourcesRef, ShareOptions } from './ShareResources';
150
+ *
151
+ * function MyComponent() {
152
+ * const shareRef = useRef<ShareResourcesRef>(null);
153
+ *
154
+ * const shareOptions: ShareOptions = {
155
+ * resourceId: '123',
156
+ * resourceRights: [],
157
+ * resourceCreatorId: 'user-456',
158
+ * filteredActions: ['read', 'contrib'],
159
+ * urls: {
160
+ * getResourceRights: '/api/share/rights',
161
+ * putResourceRights: '/api/share/update'
162
+ * }
163
+ * };
164
+ *
165
+ * const handleSave = () => {
166
+ * if (shareRef.current) {
167
+ * shareRef.current.handleShare();
168
+ * }
169
+ * };
170
+ *
171
+ * return (
172
+ * <>
173
+ * <ShareResources
174
+ * ref={shareRef}
175
+ * shareOptions={shareOptions}
176
+ * onSuccess={() => console.log('Shared successfully')}
177
+ * onChange={(rights, isDirty) => console.log('Rights changed:', isDirty)}
178
+ * onSubmit={(isSubmitting) => console.log('Submitting share...', isSubmitting)}
179
+ * />
180
+ * <button onClick={handleSave}>Save Changes</button>
181
+ * </>
182
+ * );
183
+ * }
184
+ * ```
136
185
  *
137
186
  * @component
138
187
  * @forwardRef
@@ -139,7 +139,7 @@ const ShareResources = /* @__PURE__ */ forwardRef(({
139
139
  /* @__PURE__ */ jsx(Button, { "data-testid": "share-bookmark-show-button", color: "tertiary", leftIcon: /* @__PURE__ */ jsx(SvgIconBookmark, {}), rightIcon: /* @__PURE__ */ jsx(SvgIconRafterDown, { title: t("show"), className: "w-16 min-w-0", style: {
140
140
  transition: "rotate 0.2s ease-out",
141
141
  rotate: showBookmarkInput ? "-180deg" : "0deg"
142
- } }), type: "button", variant: "ghost", className: "fw-normal", onClick: () => toggleBookmarkInput(!showBookmarkInput), children: t("share.save.sharebookmark") }),
142
+ } }), type: "button", variant: "ghost", className: "fw-normal text-start", onClick: () => toggleBookmarkInput(!showBookmarkInput), children: t("share.save.sharebookmark") }),
143
143
  showBookmarkInput && /* @__PURE__ */ jsx(ShareBookmark, { refBookmark, bookmark, onBookmarkChange: handleBookmarkChange, onSave: handleOnSaveBookmark })
144
144
  ] })
145
145
  ] });
@@ -1,5 +1,5 @@
1
1
  import { ID, UpdateParameters, UpdateResult } from '@edifice.io/client';
2
- import { UseMutationResult } from '@tanstack/react-query';
2
+ import { UseMutationResult } from '../../../../../node_modules/@tanstack/react-query';
3
3
  export type PublicationType = 'RESTRAINT' | 'IMMEDIATE' | undefined;
4
4
  export interface ShareBlogProps {
5
5
  resourceId: ID;
@@ -35,8 +35,7 @@ const useShareBookmark = ({
35
35
  ...shareRights,
36
36
  visibleBookmarks: [...shareRights.visibleBookmarks, {
37
37
  displayName: name,
38
- id: res.id,
39
- notVisibleCount: 0
38
+ id: res.id
40
39
  }]
41
40
  }
42
41
  }), setBookmark((prev) => ({
@@ -1,5 +1,5 @@
1
1
  import { PutShareResponse, ShareRight } from '@edifice.io/client';
2
- import { UseMutationOptions, UseMutationResult } from '@tanstack/react-query';
2
+ import { UseMutationOptions, UseMutationResult } from '../../../../../node_modules/@tanstack/react-query';
3
3
  declare const useShareMutation: ({ application, options, }: {
4
4
  application: string;
5
5
  options?: UseMutationOptions<PutShareResponse, Error, {