@edifice.io/react 2.1.1-develop-b2school.20250304180039 → 2.1.1-develop-b2school.20250305104555
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/index.js +16 -14
- package/dist/modals.js +16 -14
- package/dist/modules/modals/ConfirmModal/ConfirmModal.d.ts +42 -0
- package/dist/modules/modals/ConfirmModal/ConfirmModal.js +36 -0
- package/dist/modules/modals/ConfirmModal/index.d.ts +1 -0
- package/dist/modules/modals/index.d.ts +1 -0
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -71,13 +71,14 @@ import { default as default70 } from "./hooks/useWorkspaceFile/useWorkspaceFile.
|
|
|
71
71
|
import { default as default71 } from "./hooks/useWorkspaceSearch/useWorkspaceSearch.js";
|
|
72
72
|
import { default as default72 } from "./hooks/useXitiTrackPageLoad/useXitiTrackPageLoad.js";
|
|
73
73
|
import { default as default73 } from "./hooks/useZendeskGuide/useZendeskGuide.js";
|
|
74
|
-
import { default as default74 } from "./modules/modals/
|
|
75
|
-
import { default as default75 } from "./modules/modals/
|
|
76
|
-
import { default as default76 } from "./modules/modals/
|
|
77
|
-
import { default as default77 } from "./modules/modals/ResourceModal/
|
|
78
|
-
import { default as default78 } from "./modules/modals/
|
|
79
|
-
import { default as default79 } from "./modules/modals/ShareModal/
|
|
80
|
-
import { default as default80 } from "./modules/modals/ShareModal/
|
|
74
|
+
import { default as default74 } from "./modules/modals/ConfirmModal/ConfirmModal.js";
|
|
75
|
+
import { default as default75 } from "./modules/modals/OnboardingModal/OnboardingModal.js";
|
|
76
|
+
import { default as default76 } from "./modules/modals/PublishModal/PublishModal.js";
|
|
77
|
+
import { default as default77 } from "./modules/modals/ResourceModal/apps/BlogPublic.js";
|
|
78
|
+
import { default as default78 } from "./modules/modals/ResourceModal/hooks/useUpdateMutation.js";
|
|
79
|
+
import { default as default79 } from "./modules/modals/ShareModal/ShareModal.js";
|
|
80
|
+
import { default as default80 } from "./modules/modals/ShareModal/apps/ShareBlog.js";
|
|
81
|
+
import { default as default81 } from "./modules/modals/ShareModal/hooks/useShareMutation.js";
|
|
81
82
|
import { AccessiblePalette, DefaultPalette } from "./components/ColorPicker/ColorPalette.js";
|
|
82
83
|
import { DropzoneContext, useDropzoneContext } from "./components/Dropzone/DropzoneContext.js";
|
|
83
84
|
import { Column, Grid } from "./components/Grid/Grid.js";
|
|
@@ -113,7 +114,7 @@ export {
|
|
|
113
114
|
default6 as Attachment,
|
|
114
115
|
default7 as Avatar,
|
|
115
116
|
default8 as Badge,
|
|
116
|
-
|
|
117
|
+
default77 as BlogPublic,
|
|
117
118
|
default9 as Breadcrumb,
|
|
118
119
|
default10 as Button,
|
|
119
120
|
default13 as Card,
|
|
@@ -122,6 +123,7 @@ export {
|
|
|
122
123
|
default16 as ColorPickerItem,
|
|
123
124
|
Column,
|
|
124
125
|
default17 as Combobox,
|
|
126
|
+
default74 as ConfirmModal,
|
|
125
127
|
DefaultPalette,
|
|
126
128
|
DndTree,
|
|
127
129
|
default18 as Dropdown,
|
|
@@ -148,19 +150,19 @@ export {
|
|
|
148
150
|
Menu,
|
|
149
151
|
MockedProvider,
|
|
150
152
|
default30 as Modal,
|
|
151
|
-
|
|
153
|
+
default75 as OnboardingModal,
|
|
152
154
|
Popover,
|
|
153
155
|
PopoverBody,
|
|
154
156
|
PopoverFooter,
|
|
155
157
|
PopoverHeader,
|
|
156
|
-
|
|
158
|
+
default76 as PublishModal,
|
|
157
159
|
default31 as Radio,
|
|
158
160
|
ResourceModal,
|
|
159
161
|
default32 as SearchBar,
|
|
160
162
|
default12 as SearchButton,
|
|
161
163
|
default33 as Select,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
+
default80 as ShareBlog,
|
|
165
|
+
default79 as ShareModal,
|
|
164
166
|
default37 as SortableTree,
|
|
165
167
|
default34 as Table,
|
|
166
168
|
Tabs,
|
|
@@ -224,7 +226,7 @@ export {
|
|
|
224
226
|
default59 as useLibraryUrl,
|
|
225
227
|
default60 as useMediaLibrary,
|
|
226
228
|
default61 as useScrollToTop,
|
|
227
|
-
|
|
229
|
+
default81 as useShareMutation,
|
|
228
230
|
default62 as useTitle,
|
|
229
231
|
default63 as useToast,
|
|
230
232
|
default64 as useToggle,
|
|
@@ -232,7 +234,7 @@ export {
|
|
|
232
234
|
default66 as useTrashedResource,
|
|
233
235
|
useTreeSortable,
|
|
234
236
|
useTreeView,
|
|
235
|
-
|
|
237
|
+
default78 as useUpdateMutation,
|
|
236
238
|
default67 as useUpload,
|
|
237
239
|
default68 as useUploadFiles,
|
|
238
240
|
default69 as useUser,
|
package/dist/modals.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { default as default2 } from "./modules/modals/
|
|
2
|
-
import { default as default3 } from "./modules/modals/
|
|
3
|
-
import { default as default4 } from "./modules/modals/
|
|
4
|
-
import { default as default5 } from "./modules/modals/ResourceModal/
|
|
5
|
-
import { default as default6 } from "./modules/modals/
|
|
6
|
-
import { default as default7 } from "./modules/modals/ShareModal/
|
|
7
|
-
import { default as default8 } from "./modules/modals/ShareModal/
|
|
1
|
+
import { default as default2 } from "./modules/modals/ConfirmModal/ConfirmModal.js";
|
|
2
|
+
import { default as default3 } from "./modules/modals/OnboardingModal/OnboardingModal.js";
|
|
3
|
+
import { default as default4 } from "./modules/modals/PublishModal/PublishModal.js";
|
|
4
|
+
import { default as default5 } from "./modules/modals/ResourceModal/apps/BlogPublic.js";
|
|
5
|
+
import { default as default6 } from "./modules/modals/ResourceModal/hooks/useUpdateMutation.js";
|
|
6
|
+
import { default as default7 } from "./modules/modals/ShareModal/ShareModal.js";
|
|
7
|
+
import { default as default8 } from "./modules/modals/ShareModal/apps/ShareBlog.js";
|
|
8
|
+
import { default as default9 } from "./modules/modals/ShareModal/hooks/useShareMutation.js";
|
|
8
9
|
import { ResourceModal } from "./modules/modals/ResourceModal/ResourceModal.js";
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
-
default2 as
|
|
12
|
-
default3 as
|
|
11
|
+
default5 as BlogPublic,
|
|
12
|
+
default2 as ConfirmModal,
|
|
13
|
+
default3 as OnboardingModal,
|
|
14
|
+
default4 as PublishModal,
|
|
13
15
|
ResourceModal,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
default8 as ShareBlog,
|
|
17
|
+
default7 as ShareModal,
|
|
18
|
+
default9 as useShareMutation,
|
|
19
|
+
default6 as useUpdateMutation
|
|
18
20
|
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export type ConfirmModalVariant = 'yes/no' | 'ok/cancel';
|
|
3
|
+
interface ConfirmModalProps {
|
|
4
|
+
/**
|
|
5
|
+
* Variant of text buttons content
|
|
6
|
+
*/
|
|
7
|
+
variant?: ConfirmModalVariant;
|
|
8
|
+
/**
|
|
9
|
+
* Modal id (useful when multiple modal on the same page)
|
|
10
|
+
*/
|
|
11
|
+
id: string;
|
|
12
|
+
/**
|
|
13
|
+
* Is Modal Open
|
|
14
|
+
*/
|
|
15
|
+
isOpen: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Content of header modal's
|
|
18
|
+
*/
|
|
19
|
+
header?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Content of body modal's
|
|
22
|
+
*/
|
|
23
|
+
body?: ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* Key text translation of confirm button (useTranslation('common'))
|
|
26
|
+
*/
|
|
27
|
+
okText?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Key text translation of cancel button (useTranslation('common'))
|
|
30
|
+
*/
|
|
31
|
+
koText?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Function to call when success button proceed
|
|
34
|
+
*/
|
|
35
|
+
onSuccess?: () => void;
|
|
36
|
+
/**
|
|
37
|
+
* Function to call when closing modal
|
|
38
|
+
*/
|
|
39
|
+
onCancel?: () => void;
|
|
40
|
+
}
|
|
41
|
+
export default function ConfirmModal({ variant, id, isOpen, header, body, okText, koText, onSuccess, onCancel, }: ConfirmModalProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation } from "react-i18next";
|
|
3
|
+
import Modal from "../../../components/Modal/Modal.js";
|
|
4
|
+
import Button from "../../../components/Button/Button.js";
|
|
5
|
+
function ConfirmModal({
|
|
6
|
+
variant = "yes/no",
|
|
7
|
+
id,
|
|
8
|
+
isOpen,
|
|
9
|
+
header,
|
|
10
|
+
body,
|
|
11
|
+
okText,
|
|
12
|
+
koText,
|
|
13
|
+
onSuccess = () => ({}),
|
|
14
|
+
onCancel = () => ({})
|
|
15
|
+
}) {
|
|
16
|
+
const {
|
|
17
|
+
t
|
|
18
|
+
} = useTranslation("common"), ok = {
|
|
19
|
+
"yes/no": t("yes"),
|
|
20
|
+
"ok/cancel": t("ok")
|
|
21
|
+
}, ko = {
|
|
22
|
+
"yes/no": t("no"),
|
|
23
|
+
"ok/cancel": t("cancel")
|
|
24
|
+
};
|
|
25
|
+
return /* @__PURE__ */ jsxs(Modal, { isOpen, onModalClose: onCancel, id, children: [
|
|
26
|
+
/* @__PURE__ */ jsx(Modal.Header, { onModalClose: onCancel, children: header }),
|
|
27
|
+
/* @__PURE__ */ jsx(Modal.Body, { children: body }),
|
|
28
|
+
/* @__PURE__ */ jsxs(Modal.Footer, { children: [
|
|
29
|
+
/* @__PURE__ */ jsx(Button, { color: "tertiary", onClick: onCancel, type: "button", variant: "ghost", children: koText ? t(koText) : ko[variant] }),
|
|
30
|
+
/* @__PURE__ */ jsx(Button, { color: "danger", onClick: onSuccess, type: "button", variant: "filled", children: okText ? t(okText) : ok[variant] })
|
|
31
|
+
] })
|
|
32
|
+
] });
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
ConfirmModal as default
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ConfirmModal } from './ConfirmModal';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edifice.io/react",
|
|
3
|
-
"version": "2.1.1-develop-b2school.
|
|
3
|
+
"version": "2.1.1-develop-b2school.20250305104555",
|
|
4
4
|
"description": "Edifice React Library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -118,9 +118,9 @@
|
|
|
118
118
|
"react-slugify": "^3.0.3",
|
|
119
119
|
"swiper": "^10.1.0",
|
|
120
120
|
"ua-parser-js": "^1.0.36",
|
|
121
|
-
"@edifice.io/bootstrap": "2.1.1-develop-b2school.
|
|
122
|
-
"@edifice.io/tiptap-extensions": "2.1.1-develop-b2school.
|
|
123
|
-
"@edifice.io/utilities": "2.1.1-develop-b2school.
|
|
121
|
+
"@edifice.io/bootstrap": "2.1.1-develop-b2school.20250305104555",
|
|
122
|
+
"@edifice.io/tiptap-extensions": "2.1.1-develop-b2school.20250305104555",
|
|
123
|
+
"@edifice.io/utilities": "2.1.1-develop-b2school.20250305104555"
|
|
124
124
|
},
|
|
125
125
|
"devDependencies": {
|
|
126
126
|
"@babel/plugin-transform-react-pure-annotations": "^7.23.3",
|
|
@@ -151,8 +151,8 @@
|
|
|
151
151
|
"vite": "^5.4.11",
|
|
152
152
|
"vite-plugin-dts": "^4.1.0",
|
|
153
153
|
"vite-tsconfig-paths": "^5.0.1",
|
|
154
|
-
"@edifice.io/client": "2.1.1-develop-b2school.
|
|
155
|
-
"@edifice.io/config": "2.1.1-develop-b2school.
|
|
154
|
+
"@edifice.io/client": "2.1.1-develop-b2school.20250305104555",
|
|
155
|
+
"@edifice.io/config": "2.1.1-develop-b2school.20250305104555"
|
|
156
156
|
},
|
|
157
157
|
"peerDependencies": {
|
|
158
158
|
"@react-spring/web": "^9.7.5",
|