@webiny/app-admin-ui 0.0.0-unstable.e622468070 → 0.0.0-unstable.e6f0dc8ca7
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.
|
@@ -57,6 +57,7 @@ export const DialogContainer = () => {
|
|
|
57
57
|
style: style,
|
|
58
58
|
showCloseButton: showCloseButton,
|
|
59
59
|
title: title,
|
|
60
|
+
loading: isLoading ? loading : false,
|
|
60
61
|
actions: !actions.cancel && !actions.accept ? null : /*#__PURE__*/React.createElement(React.Fragment, null, actions.cancel && /*#__PURE__*/React.createElement(Dialog.CancelAction, {
|
|
61
62
|
onClick: actions.cancel.onClick,
|
|
62
63
|
text: actions.cancel.label
|
|
@@ -65,7 +66,7 @@ export const DialogContainer = () => {
|
|
|
65
66
|
text: actions.accept.label,
|
|
66
67
|
"data-testid": "confirmationdialog-confirm-action"
|
|
67
68
|
}))
|
|
68
|
-
},
|
|
69
|
+
}, message);
|
|
69
70
|
};
|
|
70
71
|
|
|
71
72
|
//# sourceMappingURL=DialogContainer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useEffect","useState","useUi","Dialog","DialogContainer","ui","isLoading","setIsLoading","message","dialog","dataTestId","title","loading","actions","cancel","accept","label","style","onClose","showCloseButton","options","hideDialog","setState","handleConfirm","onClick","console","info","createElement","open","Fragment","CancelAction","text","ConfirmAction"],"sources":["DialogContainer.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from \"react\";\nimport { useUi } from \"@webiny/app/hooks/useUi.js\";\nimport { Dialog } from \"@webiny/admin-ui\";\n\nexport const DialogContainer = () => {\n const ui = useUi();\n const [isLoading, setIsLoading] = useState(false);\n const message: React.ReactNode = ui.dialog?.message;\n\n const {\n dataTestId,\n title,\n loading,\n actions = { cancel: null, accept: { label: \"OK\" } },\n style,\n onClose,\n showCloseButton\n } = ui.dialog?.options || {};\n\n const hideDialog = useCallback(() => {\n ui.setState(ui => ({ ...ui, dialog: null }));\n if (typeof onClose === \"function\") {\n onClose();\n }\n }, [ui]);\n\n /**\n * We need this part because message can change while the dialog is opened and in loading state.\n */\n useEffect(() => {\n setIsLoading(false);\n }, [ui.dialog?.message]);\n\n const handleConfirm = async () => {\n if (!actions.accept.onClick) {\n /**\n * Should not happen as users should define \"accept.onClick\" function, but just in case lets show the information.\n * Possible to happen in development process.\n */\n console.info(\"There is no actions.accept.onClick callback defined.\");\n hideDialog();\n return;\n }\n setIsLoading(true);\n await actions.accept.onClick();\n setIsLoading(false);\n hideDialog();\n };\n\n return (\n <Dialog\n open={!!message}\n onClose={hideDialog}\n data-testid={dataTestId}\n style={style}\n showCloseButton={showCloseButton}\n title={title}\n actions={\n !actions.cancel && !actions.accept ? null : (\n <>\n {actions.cancel && (\n <Dialog.CancelAction\n onClick={actions.cancel.onClick}\n text={actions.cancel.label}\n />\n )}\n {actions.accept && (\n <Dialog.ConfirmAction\n onClick={handleConfirm}\n text={actions.accept.label}\n data-testid={\"confirmationdialog-confirm-action\"}\n />\n )}\n </>\n )\n }\n >\n {
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useState","useUi","Dialog","DialogContainer","ui","isLoading","setIsLoading","message","dialog","dataTestId","title","loading","actions","cancel","accept","label","style","onClose","showCloseButton","options","hideDialog","setState","handleConfirm","onClick","console","info","createElement","open","Fragment","CancelAction","text","ConfirmAction"],"sources":["DialogContainer.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from \"react\";\nimport { useUi } from \"@webiny/app/hooks/useUi.js\";\nimport { Dialog } from \"@webiny/admin-ui\";\n\nexport const DialogContainer = () => {\n const ui = useUi();\n const [isLoading, setIsLoading] = useState(false);\n const message: React.ReactNode = ui.dialog?.message;\n\n const {\n dataTestId,\n title,\n loading,\n actions = { cancel: null, accept: { label: \"OK\" } },\n style,\n onClose,\n showCloseButton\n } = ui.dialog?.options || {};\n\n const hideDialog = useCallback(() => {\n ui.setState(ui => ({ ...ui, dialog: null }));\n if (typeof onClose === \"function\") {\n onClose();\n }\n }, [ui]);\n\n /**\n * We need this part because message can change while the dialog is opened and in loading state.\n */\n useEffect(() => {\n setIsLoading(false);\n }, [ui.dialog?.message]);\n\n const handleConfirm = async () => {\n if (!actions.accept.onClick) {\n /**\n * Should not happen as users should define \"accept.onClick\" function, but just in case lets show the information.\n * Possible to happen in development process.\n */\n console.info(\"There is no actions.accept.onClick callback defined.\");\n hideDialog();\n return;\n }\n setIsLoading(true);\n await actions.accept.onClick();\n setIsLoading(false);\n hideDialog();\n };\n\n return (\n <Dialog\n open={!!message}\n onClose={hideDialog}\n data-testid={dataTestId}\n style={style}\n showCloseButton={showCloseButton}\n title={title}\n loading={isLoading ? loading : false}\n actions={\n !actions.cancel && !actions.accept ? null : (\n <>\n {actions.cancel && (\n <Dialog.CancelAction\n onClick={actions.cancel.onClick}\n text={actions.cancel.label}\n />\n )}\n {actions.accept && (\n <Dialog.ConfirmAction\n onClick={handleConfirm}\n text={actions.accept.label}\n data-testid={\"confirmationdialog-confirm-action\"}\n />\n )}\n </>\n )\n }\n >\n {message}\n </Dialog>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC/D,SAASC,KAAK,QAAQ,4BAA4B;AAClD,SAASC,MAAM,QAAQ,kBAAkB;AAEzC,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAAM;EACjC,MAAMC,EAAE,GAAGH,KAAK,CAAC,CAAC;EAClB,MAAM,CAACI,SAAS,EAAEC,YAAY,CAAC,GAAGN,QAAQ,CAAC,KAAK,CAAC;EACjD,MAAMO,OAAwB,GAAGH,EAAE,CAACI,MAAM,EAAED,OAAO;EAEnD,MAAM;IACFE,UAAU;IACVC,KAAK;IACLC,OAAO;IACPC,OAAO,GAAG;MAAEC,MAAM,EAAE,IAAI;MAAEC,MAAM,EAAE;QAAEC,KAAK,EAAE;MAAK;IAAE,CAAC;IACnDC,KAAK;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A,CAAA7B,KAAA,CAAA+B,QAAA,QACKhB,OAAO,CAACC,MAAM,iBACXhB,KAAA,CAAA6B,aAAA,CAACxB,MAAM,CAAC2B,YAAY;MAChBN,OAAO,EAAEX,OAAO,CAACC,MAAM,CAACU,OAAQ;MAChCO,IAAI,EAAElB,OAAO,CAACC,MAAM,CAACE;IAAM,CAC9B,CACJ,EACAH,OAAO,CAACE,MAAM,iBACXjB,KAAA,CAAA6B,aAAA,CAACxB,MAAM,CAAC6B,aAAa;MACjBR,OAAO,EAAED,aAAc;MACvBQ,IAAI,EAAElB,OAAO,CAACE,MAAM,CAACC,KAAM;MAC3B,eAAa;IAAoC,CACpD,CAEP;EAET,GAEAR,OACG,CAAC;AAEjB,CAAC","ignoreList":[]}
|
package/Navigation/Navigation.js
CHANGED
|
@@ -19,15 +19,16 @@ export const Navigation = NavigationRenderer.createDecorator(() => {
|
|
|
19
19
|
element: logo.squareLogo,
|
|
20
20
|
label: "Webiny"
|
|
21
21
|
}));
|
|
22
|
+
const hasFooterMenus = menus.some(m => (m.tags || []).includes("footer"));
|
|
22
23
|
return /*#__PURE__*/React.createElement(Sidebar, {
|
|
23
24
|
title: titleElement,
|
|
24
25
|
icon: icon,
|
|
25
|
-
footer: /*#__PURE__*/React.createElement(SidebarMenuItems, {
|
|
26
|
+
footer: hasFooterMenus ? /*#__PURE__*/React.createElement(SidebarMenuItems, {
|
|
26
27
|
menus: menus,
|
|
27
28
|
where: {
|
|
28
29
|
tags: ["footer"]
|
|
29
30
|
}
|
|
30
|
-
})
|
|
31
|
+
}) : undefined
|
|
31
32
|
}, /*#__PURE__*/React.createElement(SidebarMenuItems, {
|
|
32
33
|
menus: menus
|
|
33
34
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","NavigationRenderer","useAdminConfig","Sidebar","SidebarMenuItems","SimpleLink","Navigation","createDecorator","menus","title","logo","titleElement","createElement","to","icon","Icon","element","squareLogo","label","footer","where","
|
|
1
|
+
{"version":3,"names":["React","NavigationRenderer","useAdminConfig","Sidebar","SidebarMenuItems","SimpleLink","Navigation","createDecorator","menus","title","logo","titleElement","createElement","to","icon","Icon","element","squareLogo","label","hasFooterMenus","some","m","tags","includes","footer","where","undefined"],"sources":["Navigation.tsx"],"sourcesContent":["import React from \"react\";\nimport { NavigationRenderer, useAdminConfig } from \"@webiny/app-admin\";\nimport { Sidebar } from \"@webiny/admin-ui\";\nimport { SidebarMenuItems } from \"./SidebarMenuItems.js\";\nimport { SimpleLink } from \"@webiny/app-admin\";\n\nexport const Navigation = NavigationRenderer.createDecorator(() => {\n return function Navigation() {\n const { menus, title, logo } = useAdminConfig();\n\n const titleElement = <SimpleLink to={\"/\"}>{title}</SimpleLink>;\n const icon = (\n <SimpleLink to={\"/\"}>\n <Sidebar.Icon element={logo.squareLogo} label={\"Webiny\"} />\n </SimpleLink>\n );\n\n const hasFooterMenus = menus.some(m => (m.tags || []).includes(\"footer\"));\n\n return (\n <Sidebar\n title={titleElement}\n icon={icon}\n footer={\n hasFooterMenus ? (\n <SidebarMenuItems menus={menus} where={{ tags: [\"footer\"] }} />\n ) : undefined\n }\n >\n <SidebarMenuItems menus={menus} />\n </Sidebar>\n );\n };\n});\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,kBAAkB,EAAEC,cAAc,QAAQ,mBAAmB;AACtE,SAASC,OAAO,QAAQ,kBAAkB;AAC1C,SAASC,gBAAgB;AACzB,SAASC,UAAU,QAAQ,mBAAmB;AAE9C,OAAO,MAAMC,UAAU,GAAGL,kBAAkB,CAACM,eAAe,CAAC,MAAM;EAC/D,OAAO,SAASD,UAAUA,CAAA,EAAG;IACzB,MAAM;MAAEE,KAAK;MAAEC,KAAK;MAAEC;IAAK,CAAC,GAAGR,cAAc,CAAC,CAAC;IAE/C,MAAMS,YAAY,gBAAGX,KAAA,CAAAY,aAAA,CAACP,UAAU;MAACQ,EAAE,EAAE;IAAI,GAAEJ,KAAkB,CAAC;IAC9D,MAAMK,IAAI,gBACNd,KAAA,CAAAY,aAAA,CAACP,UAAU;MAACQ,EAAE,EAAE;IAAI,gBAChBb,KAAA,CAAAY,aAAA,CAACT,OAAO,CAACY,IAAI;MAACC,OAAO,EAAEN,IAAI,CAACO,UAAW;MAACC,KAAK,EAAE;IAAS,CAAE,CAClD,CACf;IAED,MAAMC,cAAc,GAAGX,KAAK,CAACY,IAAI,CAACC,CAAC,IAAI,CAACA,CAAC,CAACC,IAAI,IAAI,EAAE,EAAEC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAEzE,oBACIvB,KAAA,CAAAY,aAAA,CAACT,OAAO;MACJM,KAAK,EAAEE,YAAa;MACpBG,IAAI,EAAEA,IAAK;MACXU,MAAM,EACFL,cAAc,gBACVnB,KAAA,CAAAY,aAAA,CAACR,gBAAgB;QAACI,KAAK,EAAEA,KAAM;QAACiB,KAAK,EAAE;UAAEH,IAAI,EAAE,CAAC,QAAQ;QAAE;MAAE,CAAE,CAAC,GAC/DI;IACP,gBAED1B,KAAA,CAAAY,aAAA,CAACR,gBAAgB;MAACI,KAAK,EAAEA;IAAM,CAAE,CAC5B,CAAC;EAElB,CAAC;AACL,CAAC,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-admin-ui",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.e6f0dc8ca7",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./index.js",
|
|
7
|
+
"./*": "./*"
|
|
8
|
+
},
|
|
6
9
|
"repository": {
|
|
7
10
|
"type": "git",
|
|
8
11
|
"url": "https://github.com/webiny/webiny-js.git"
|
|
@@ -10,22 +13,21 @@
|
|
|
10
13
|
"author": "Webiny Ltd.",
|
|
11
14
|
"license": "MIT",
|
|
12
15
|
"dependencies": {
|
|
13
|
-
"@types/react": "18.
|
|
14
|
-
"@webiny/admin-ui": "0.0.0-unstable.
|
|
15
|
-
"@webiny/app": "0.0.0-unstable.
|
|
16
|
-
"@webiny/app-admin": "0.0.0-unstable.
|
|
17
|
-
"@webiny/icons": "0.0.0-unstable.
|
|
18
|
-
"react": "18.
|
|
19
|
-
"react-dom": "18.
|
|
16
|
+
"@types/react": "18.3.28",
|
|
17
|
+
"@webiny/admin-ui": "0.0.0-unstable.e6f0dc8ca7",
|
|
18
|
+
"@webiny/app": "0.0.0-unstable.e6f0dc8ca7",
|
|
19
|
+
"@webiny/app-admin": "0.0.0-unstable.e6f0dc8ca7",
|
|
20
|
+
"@webiny/icons": "0.0.0-unstable.e6f0dc8ca7",
|
|
21
|
+
"react": "18.3.1",
|
|
22
|
+
"react-dom": "18.3.1",
|
|
20
23
|
"react-helmet": "6.1.0"
|
|
21
24
|
},
|
|
22
25
|
"devDependencies": {
|
|
23
26
|
"@emotion/babel-plugin": "11.13.5",
|
|
24
27
|
"@types/react-helmet": "6.1.11",
|
|
25
|
-
"@webiny/build-tools": "0.0.0-unstable.
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"typescript": "5.9.3"
|
|
28
|
+
"@webiny/build-tools": "0.0.0-unstable.e6f0dc8ca7",
|
|
29
|
+
"rimraf": "6.1.3",
|
|
30
|
+
"typescript": "6.0.3"
|
|
29
31
|
},
|
|
30
32
|
"publishConfig": {
|
|
31
33
|
"access": "public",
|
|
@@ -36,5 +38,5 @@
|
|
|
36
38
|
"removeViewBox": false
|
|
37
39
|
}
|
|
38
40
|
},
|
|
39
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "e6f0dc8ca741c1fcc3fec9a5b9e86fdd49544641"
|
|
40
42
|
}
|