@edifice.io/react 2.5.12-develop-b2school.20260305170037 → 2.5.13-develop.20260305174832
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/_virtual/common.js +4 -0
- package/dist/_virtual/de_DE.js +4 -0
- package/dist/_virtual/de_DE2.js +4 -0
- package/dist/_virtual/de_DE3.js +4 -0
- package/dist/_virtual/de_DE4.js +4 -0
- package/dist/_virtual/de_DE5.js +4 -0
- package/dist/_virtual/de_DE6.js +4 -0
- package/dist/_virtual/defineProperty.js +4 -0
- package/dist/_virtual/es_ES.js +4 -0
- package/dist/_virtual/es_ES2.js +4 -0
- package/dist/_virtual/es_ES3.js +4 -0
- package/dist/_virtual/es_ES4.js +4 -0
- package/dist/_virtual/es_ES5.js +4 -0
- package/dist/_virtual/es_ES6.js +4 -0
- package/dist/_virtual/fr_FR.js +4 -0
- package/dist/_virtual/fr_FR2.js +4 -0
- package/dist/_virtual/fr_FR3.js +4 -0
- package/dist/_virtual/fr_FR4.js +4 -0
- package/dist/_virtual/fr_FR5.js +4 -0
- package/dist/_virtual/fr_FR6.js +4 -0
- package/dist/_virtual/interopRequireDefault.js +4 -0
- package/dist/_virtual/it_IT.js +4 -0
- package/dist/_virtual/it_IT2.js +4 -0
- package/dist/_virtual/it_IT3.js +4 -0
- package/dist/_virtual/it_IT4.js +4 -0
- package/dist/_virtual/it_IT5.js +4 -0
- package/dist/_virtual/it_IT6.js +4 -0
- package/dist/_virtual/objectSpread2.js +4 -0
- package/dist/_virtual/pt_PT.js +4 -0
- package/dist/_virtual/pt_PT2.js +4 -0
- package/dist/_virtual/pt_PT3.js +4 -0
- package/dist/_virtual/pt_PT4.js +4 -0
- package/dist/_virtual/pt_PT5.js +4 -0
- package/dist/_virtual/pt_PT6.js +4 -0
- package/dist/_virtual/toPrimitive.js +4 -0
- package/dist/_virtual/toPropertyKey.js +4 -0
- package/dist/_virtual/typeof.js +4 -0
- package/dist/components/Badge/Badge.js +1 -0
- package/dist/components/Layout/components/WidgetApps.js +2 -2
- package/dist/components/MediaViewer/PdfViewer.js +4 -14
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +0 -8
- package/dist/components/SegmentedControl/SegmentedControl.js +6 -12
- package/dist/hooks/useBrowserInfo/useBrowserInfo.d.ts +3 -4
- package/dist/hooks/useBrowserInfo/useBrowserInfo.js +1 -1
- package/dist/hooks/usePreferences/usePreferences.d.ts +3 -3
- package/dist/hooks/useToast/useToast.js +5 -5
- package/dist/modules/modals/OnboardingModal/OnboardingModal.d.ts +2 -28
- package/dist/modules/modals/OnboardingModal/OnboardingModal.js +9 -13
- package/dist/modules/modals/OnboardingModal/useOnboardingModal.d.ts +1 -4
- package/dist/modules/modals/OnboardingModal/useOnboardingModal.js +19 -24
- package/dist/modules/modals/ShareModal/ShareResources.js +1 -1
- package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/defineProperty.js +18 -0
- package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/interopRequireDefault.js +13 -0
- package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/objectSpread2.js +31 -0
- package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/toPrimitive.js +20 -0
- package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/toPropertyKey.js +15 -0
- package/dist/node_modules/.pnpm/@babel_runtime@7.28.6/node_modules/@babel/runtime/helpers/typeof.js +16 -0
- 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
- 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
- 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/fr_FR.js +11 -0
- 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
- 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
- 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
- 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
- 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/fr_FR.js +27 -0
- 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
- 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
- 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
- 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
- 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/fr_FR.js +144 -0
- 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
- 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
- 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
- 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
- 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/fr_FR.js +10 -0
- 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
- 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
- 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
- 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
- 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/fr_FR.js +8 -0
- 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
- 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
- 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
- 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
- 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 +21 -0
- 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
- 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
- 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 +14 -0
- 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
- 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
- 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 +38 -0
- 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
- 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
- package/dist/providers/AntThemeProvider/AntProvider.js +5 -5
- package/package.json +6 -6
|
@@ -21,6 +21,7 @@ const Badge = /* @__PURE__ */ forwardRef(({
|
|
|
21
21
|
const colorAppClassName = getIconClass(variant.app), backgroundLightAppClassName = getBackgroundLightIconClass(variant.app), borderAppClassName = getBorderIconClass(variant.app);
|
|
22
22
|
badgeColorClassName = `${colorAppClassName} ${backgroundLightAppClassName} ${borderAppClassName}`;
|
|
23
23
|
}
|
|
24
|
+
console.log(badgeColorClassName);
|
|
24
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);
|
|
25
26
|
return /* @__PURE__ */ jsxs("span", { ref, className: classes, ...restProps, children: [
|
|
26
27
|
variant.type === "chip" && /* @__PURE__ */ jsx("div", { className: "d-flex fw-800 align-items-center", children }),
|
|
@@ -11,10 +11,10 @@ const WidgetAppsFooter = () => {
|
|
|
11
11
|
}) => {
|
|
12
12
|
const {
|
|
13
13
|
t
|
|
14
|
-
} = useTranslation()
|
|
14
|
+
} = useTranslation();
|
|
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,
|
|
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.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,27 +1,17 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useRef
|
|
2
|
+
import { useState, useRef } from "react";
|
|
3
|
+
import { Document, Page } from "react-pdf";
|
|
3
4
|
import LoadingScreen from "../LoadingScreen/LoadingScreen.js";
|
|
4
5
|
function PdfViewer({
|
|
5
6
|
mediaUrl,
|
|
6
7
|
scale
|
|
7
8
|
}) {
|
|
8
|
-
const [numPages, setNumPages] = useState(null),
|
|
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 = ({
|
|
9
|
+
const [numPages, setNumPages] = useState(null), pagesRef = useRef([]), onDocumentLoadSuccess = ({
|
|
20
10
|
numPages: numPages2
|
|
21
11
|
}) => {
|
|
22
12
|
setNumPages(numPages2);
|
|
23
13
|
};
|
|
24
|
-
return
|
|
14
|
+
return /* @__PURE__ */ jsx("div", { style: {
|
|
25
15
|
width: `calc(600px * ${scale})`,
|
|
26
16
|
height: "calc(100vh - 52px)",
|
|
27
17
|
overflowY: "auto",
|
|
@@ -27,14 +27,6 @@ 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';
|
|
38
30
|
/**
|
|
39
31
|
* Callback called when value changes
|
|
40
32
|
*/
|
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Segmented } from "antd";
|
|
3
|
-
import clsx from "clsx";
|
|
4
2
|
import { forwardRef } from "react";
|
|
3
|
+
import { Segmented } from "antd";
|
|
5
4
|
const SegmentedControl = /* @__PURE__ */ forwardRef(({
|
|
6
5
|
options,
|
|
7
6
|
value,
|
|
8
7
|
onChange,
|
|
9
|
-
variant = "default",
|
|
10
|
-
className,
|
|
11
8
|
...htmlProps
|
|
12
9
|
}, ref) => {
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}), antProps = {
|
|
19
|
-
options: transformedOptions,
|
|
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
|
+
})),
|
|
20
15
|
value,
|
|
21
16
|
onChange,
|
|
22
17
|
ref,
|
|
23
|
-
className: classNames,
|
|
24
18
|
...htmlProps
|
|
25
19
|
};
|
|
26
20
|
return /* @__PURE__ */ jsx(Segmented, { ...antProps });
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { default as UAParser } from 'ua-parser-js';
|
|
2
1
|
export default function useBrowserInfo(userAgent?: string): {
|
|
3
|
-
os:
|
|
4
|
-
device:
|
|
5
|
-
browser:
|
|
2
|
+
os: import('ua-parser-js').IOS;
|
|
3
|
+
device: import('ua-parser-js').IDevice;
|
|
4
|
+
browser: import('ua-parser-js').IBrowser;
|
|
6
5
|
isIphone: boolean;
|
|
7
6
|
isIpod: boolean;
|
|
8
7
|
isIpad: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import UAParser from "ua-parser-js";
|
|
1
|
+
import { UAParser } from "ua-parser-js";
|
|
2
2
|
function useBrowserInfo(userAgent) {
|
|
3
3
|
var _a, _b, _c;
|
|
4
4
|
const uaParser = new UAParser(userAgent), os = uaParser.getOS(), device = uaParser.getDevice(), browser = uaParser.getBrowser(), isIphone = ((_a = device.model) == null ? void 0 : _a.indexOf("iPhone")) != -1, isIpod = ((_b = device.model) == null ? void 0 : _b.indexOf("iPod")) != -1, isIpad = ((_c = device.model) == null ? void 0 : _c.indexOf("iPad")) != -1;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export default function usePreferences
|
|
2
|
-
getPreference: () => Promise<
|
|
3
|
-
savePreference: (value:
|
|
1
|
+
export default function usePreferences(name: string): {
|
|
2
|
+
getPreference: () => Promise<any>;
|
|
3
|
+
savePreference: (value: any) => Promise<void>;
|
|
4
4
|
};
|
|
@@ -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";
|
|
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:
|
|
9
|
+
duration: options == null ? void 0 : options.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:
|
|
14
|
+
duration: options == null ? void 0 : options.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:
|
|
19
|
+
duration: options == null ? void 0 : options.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:
|
|
24
|
+
duration: options == null ? void 0 : options.duration,
|
|
25
25
|
position: (options == null ? void 0 : options.position) ?? DEFAULT_POSITION
|
|
26
26
|
}),
|
|
27
27
|
loading: toast.loading,
|
|
@@ -38,37 +38,11 @@ export interface OnboardingModalRef {
|
|
|
38
38
|
setIsOpen: (isOpen: boolean) => void;
|
|
39
39
|
handleSavePreference: () => void;
|
|
40
40
|
}
|
|
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> {
|
|
41
|
+
interface OnboardingProps {
|
|
51
42
|
id: string;
|
|
52
43
|
items: ModalItemsProps[];
|
|
53
44
|
modalOptions?: ModalOptionsProps;
|
|
54
45
|
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>;
|
|
67
46
|
}
|
|
68
|
-
declare const
|
|
69
|
-
declare const OnboardingModal: (<T = boolean>(props: OnboardingProps<T> & {
|
|
70
|
-
ref?: React.Ref<OnboardingModalRef>;
|
|
71
|
-
}) => ReturnType<typeof OnboardingModalInner>) & {
|
|
72
|
-
displayName?: string;
|
|
73
|
-
};
|
|
47
|
+
declare const OnboardingModal: import('react').ForwardRefExoticComponent<OnboardingProps & import('react').RefAttributes<OnboardingModalRef>>;
|
|
74
48
|
export default OnboardingModal;
|
|
@@ -8,15 +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
|
|
11
|
+
const OnboardingModal = /* @__PURE__ */ forwardRef(({
|
|
12
12
|
id,
|
|
13
13
|
items,
|
|
14
14
|
modalOptions = {},
|
|
15
|
-
isOnboardingChange
|
|
16
|
-
onDisplayRuleCheck = (previousState) => ({
|
|
17
|
-
display: previousState === !0,
|
|
18
|
-
nextState: !1
|
|
19
|
-
})
|
|
15
|
+
isOnboardingChange
|
|
20
16
|
}, ref) => {
|
|
21
17
|
var _a;
|
|
22
18
|
const [swiperInstance, setSwiperInstance] = useState(), [swiperProgress, setSwiperprogress] = useState(0), {
|
|
@@ -24,12 +20,12 @@ const OnboardingModalInner = ({
|
|
|
24
20
|
isOnboarding,
|
|
25
21
|
setIsOpen,
|
|
26
22
|
handleSavePreference
|
|
27
|
-
} = useOnboardingModal(id
|
|
23
|
+
} = useOnboardingModal(id);
|
|
28
24
|
useImperativeHandle(ref, () => ({
|
|
29
25
|
setIsOpen,
|
|
30
26
|
handleSavePreference
|
|
31
27
|
})), useEffect(() => {
|
|
32
|
-
isOnboardingChange
|
|
28
|
+
isOnboardingChange && isOnboardingChange(isOnboarding);
|
|
33
29
|
}, [isOnboarding, isOnboardingChange]), useEffect(() => {
|
|
34
30
|
const link = document.createElement("link");
|
|
35
31
|
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), () => {
|
|
@@ -48,7 +44,7 @@ const OnboardingModalInner = ({
|
|
|
48
44
|
}, handleCloseWithoutPreference = () => {
|
|
49
45
|
setIsOpen(!1), setSwiperprogress(0);
|
|
50
46
|
};
|
|
51
|
-
return
|
|
47
|
+
return /* @__PURE__ */ createPortal(/* @__PURE__ */ jsxs(Modal, { id: "onboarding-modal", "data-testid": "modal-onboarding", size: "md", isOpen, focusId: "nextButtonId", onModalClose: handleCloseWithoutPreference, children: [
|
|
52
48
|
/* @__PURE__ */ jsx(Modal.Header, { onModalClose: handleCloseWithoutPreference, centered: !0, children: t(currentTitle || "explorer.modal.onboarding.trash.title") }),
|
|
53
49
|
/* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsx(Swiper, { modules: [Pagination], onSwiper: (swiper) => {
|
|
54
50
|
setSwiperInstance(swiper);
|
|
@@ -65,13 +61,13 @@ const OnboardingModalInner = ({
|
|
|
65
61
|
/* @__PURE__ */ jsxs(Modal.Footer, { children: [
|
|
66
62
|
/* @__PURE__ */ jsx(Button, { "data-testid": "modal-onboarding-later", type: "button", color: "tertiary", variant: "ghost", onClick: handleCloseWithoutPreference, children: t("explorer.modal.onboarding.trash.later") }),
|
|
67
63
|
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") }),
|
|
68
|
-
|
|
69
|
-
|
|
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: () => {
|
|
70
66
|
isOnboarding ? handleCloseWithPreference() : handleCloseWithoutPreference();
|
|
71
67
|
}, children: t(closeText || "explorer.modal.onboarding.trash.close") })
|
|
72
68
|
] })
|
|
73
|
-
] }), document.getElementById("portal") || document.body)
|
|
74
|
-
}
|
|
69
|
+
] }), document.getElementById("portal") || document.body);
|
|
70
|
+
});
|
|
75
71
|
export {
|
|
76
72
|
OnboardingModal as default
|
|
77
73
|
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
export declare const useOnboardingModal:
|
|
2
|
-
display: boolean;
|
|
3
|
-
nextState: T;
|
|
4
|
-
}) => {
|
|
1
|
+
export declare const useOnboardingModal: (id: string) => {
|
|
5
2
|
isOpen: boolean;
|
|
6
3
|
setIsOpen: import('react').Dispatch<import('react').SetStateAction<boolean>>;
|
|
7
4
|
isOnboarding: boolean;
|
|
@@ -1,33 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
useEffect(() => {
|
|
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(() => {
|
|
9
8
|
(async () => {
|
|
10
|
-
const response = await
|
|
11
|
-
if (response
|
|
9
|
+
const response = await getOnboardingTrash(id);
|
|
10
|
+
if (response) {
|
|
12
11
|
const {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
12
|
+
key
|
|
13
|
+
} = response;
|
|
14
|
+
key === !0 && setIsOpen(!0), setIsOnboarding(key);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
setIsOnboarding(!0), setIsOpen(!0);
|
|
19
18
|
})();
|
|
20
|
-
}, [])
|
|
21
|
-
const handleSavePreference = useCallback(async () => {
|
|
22
|
-
await savePreference({
|
|
23
|
-
key: state.current
|
|
24
|
-
}), setIsOpen(!1), setIsOnboarding(!1);
|
|
25
|
-
}, [savePreference, setIsOpen, setIsOnboarding]);
|
|
26
|
-
return {
|
|
19
|
+
}, [id]), {
|
|
27
20
|
isOpen,
|
|
28
21
|
setIsOpen,
|
|
29
22
|
isOnboarding,
|
|
30
|
-
handleSavePreference
|
|
23
|
+
handleSavePreference: async () => {
|
|
24
|
+
await saveOnboardingTrash(id), setIsOpen(!1), setIsOnboarding(!1);
|
|
25
|
+
}
|
|
31
26
|
};
|
|
32
27
|
};
|
|
33
28
|
export {
|
|
@@ -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
|
|
142
|
+
} }), type: "button", variant: "ghost", className: "fw-normal", onClick: () => toggleBookmarkInput(!showBookmarkInput), children: t("share.save.sharebookmark") }),
|
|
143
143
|
showBookmarkInput && /* @__PURE__ */ jsx(ShareBookmark, { refBookmark, bookmark, onBookmarkChange: handleBookmarkChange, onSave: handleOnSaveBookmark })
|
|
144
144
|
] })
|
|
145
145
|
] });
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { __module as defineProperty } from "../../../../../../../_virtual/defineProperty.js";
|
|
2
|
+
import { t as toPropertyKeyExports } from "./toPropertyKey.js";
|
|
3
|
+
(function(module) {
|
|
4
|
+
var toPropertyKey = toPropertyKeyExports;
|
|
5
|
+
function _defineProperty(e, r, t) {
|
|
6
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
7
|
+
value: t,
|
|
8
|
+
enumerable: !0,
|
|
9
|
+
configurable: !0,
|
|
10
|
+
writable: !0
|
|
11
|
+
}) : e[r] = t, e;
|
|
12
|
+
}
|
|
13
|
+
module.exports = _defineProperty, module.exports.__esModule = !0, module.exports.default = module.exports;
|
|
14
|
+
})(defineProperty);
|
|
15
|
+
var definePropertyExports = defineProperty.exports;
|
|
16
|
+
export {
|
|
17
|
+
definePropertyExports as d
|
|
18
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { __module as interopRequireDefault } from "../../../../../../../_virtual/interopRequireDefault.js";
|
|
2
|
+
(function(module) {
|
|
3
|
+
function _interopRequireDefault(e) {
|
|
4
|
+
return e && e.__esModule ? e : {
|
|
5
|
+
default: e
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
module.exports = _interopRequireDefault, module.exports.__esModule = !0, module.exports.default = module.exports;
|
|
9
|
+
})(interopRequireDefault);
|
|
10
|
+
var interopRequireDefaultExports = interopRequireDefault.exports;
|
|
11
|
+
export {
|
|
12
|
+
interopRequireDefaultExports as i
|
|
13
|
+
};
|