pankosmia-rcl 0.0.3 → 0.0.5
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/package.json +5 -3
- package/pankosmia-rcl-0.0.4.tgz +0 -0
- package/src/manifest.json +0 -15
- package/src/rcl/DrawerComponent.jsx +0 -128
- package/src/rcl/InternetSwitch.jsx +0 -63
- package/src/rcl/PanDialog.jsx +0 -31
- package/src/rcl/PanDialogActions.jsx +0 -11
- package/src/rcl/PanDialogButton.jsx +0 -20
- package/src/rcl/PanDialogContent.jsx +0 -13
- package/src/rcl/PanDialogDefault.jsx +0 -16
- package/src/rcl/index.js +0 -11
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pankosmia-rcl",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"homepage": "/clients/core-client-rcl",
|
|
6
|
-
"main": "
|
|
6
|
+
"main": "build/pankosmia-rcl.umd.js",
|
|
7
|
+
"module": "build/pankosmia-rcl.es.js",
|
|
7
8
|
"dependencies": {
|
|
8
9
|
"@emotion/react": "^11.13.3",
|
|
9
10
|
"@emotion/styled": "^11.13.0",
|
|
@@ -29,7 +30,8 @@
|
|
|
29
30
|
"build": "react-scripts build",
|
|
30
31
|
"build:vite": "vite build",
|
|
31
32
|
"build:package": "vite build",
|
|
32
|
-
"dev": "vite"
|
|
33
|
+
"dev": "vite",
|
|
34
|
+
"prepublishOnly": "rm -rf ./build && npm run build:vite"
|
|
33
35
|
},
|
|
34
36
|
"eslintConfig": {
|
|
35
37
|
"extends": [
|
|
Binary file
|
package/src/manifest.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"short_name": "React App",
|
|
3
|
-
"name": "Create React App Sample",
|
|
4
|
-
"icons": [
|
|
5
|
-
{
|
|
6
|
-
"src": "favicon.ico",
|
|
7
|
-
"sizes": "64x64 32x32 24x24 16x16",
|
|
8
|
-
"type": "image/x-icon"
|
|
9
|
-
}
|
|
10
|
-
],
|
|
11
|
-
"start_url": ".",
|
|
12
|
-
"display": "standalone",
|
|
13
|
-
"theme_color": "#000000",
|
|
14
|
-
"background_color": "#ffffff"
|
|
15
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import React, {useContext} from 'react';
|
|
2
|
-
import {
|
|
3
|
-
Box,
|
|
4
|
-
Drawer,
|
|
5
|
-
Stack,
|
|
6
|
-
IconButton,
|
|
7
|
-
List,
|
|
8
|
-
ListItem,
|
|
9
|
-
ListItemButton, ListItemText,
|
|
10
|
-
Switch,
|
|
11
|
-
Collapse
|
|
12
|
-
} from "@mui/material";
|
|
13
|
-
import MenuIcon from "@mui/icons-material/Menu";
|
|
14
|
-
import ExpandLess from '@mui/icons-material/ExpandLess';
|
|
15
|
-
import ExpandMore from '@mui/icons-material/ExpandMore';
|
|
16
|
-
|
|
17
|
-
import {i18nContext, netContext, debugContext, doI18n} from "pithekos-lib";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
export default function DrawerComponent({drawerIsOpen, setDrawerIsOpen, menuItems, toggleDebug, showAdvanced, setShowAdvanced, drawerWidth, measurementRef }) {
|
|
21
|
-
|
|
22
|
-
const {i18nRef} = useContext(i18nContext);
|
|
23
|
-
const {enabledRef} = useContext(netContext);
|
|
24
|
-
const {debugRef} = useContext(debugContext);
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<Box sx={{m: 0, mr: 2}}>
|
|
28
|
-
<IconButton onClick={e => setDrawerIsOpen(true)}>
|
|
29
|
-
<MenuIcon />
|
|
30
|
-
</IconButton>
|
|
31
|
-
<Drawer
|
|
32
|
-
open={drawerIsOpen}
|
|
33
|
-
onClose={() => setDrawerIsOpen(false)}
|
|
34
|
-
slotProps={{ paper: { sx: { width: drawerWidth, overflow: 'hidden' } } }}
|
|
35
|
-
>
|
|
36
|
-
<Box sx={{width: "100%", minHeight: '98vh', m: 0, p: 0}} role="presentation">
|
|
37
|
-
<List sx={{ height: '100%', width: '100%' }}>
|
|
38
|
-
<Stack
|
|
39
|
-
direction="column"
|
|
40
|
-
spacing={0}
|
|
41
|
-
sx={{
|
|
42
|
-
height: '100%',
|
|
43
|
-
width: '100%',
|
|
44
|
-
justifyContent: "space-between",
|
|
45
|
-
alignItems: "flex-start",
|
|
46
|
-
}}
|
|
47
|
-
>
|
|
48
|
-
<Box sx={{width: '100%'}}>
|
|
49
|
-
{
|
|
50
|
-
menuItems
|
|
51
|
-
.map(
|
|
52
|
-
(mi, n) => /* mi.id === currentId ?
|
|
53
|
-
<ListItem key={n} disablePadding onClick={() => setDrawerIsOpen(false)}>
|
|
54
|
-
<ListItemButton selected={true} >
|
|
55
|
-
<ListItemText
|
|
56
|
-
primary={doI18n(`pages:${mi.id}:title`, i18nRef.current)}/>
|
|
57
|
-
</ListItemButton>
|
|
58
|
-
</ListItem> : */
|
|
59
|
-
<ListItem key={n} disablePadding>
|
|
60
|
-
<ListItemButton
|
|
61
|
-
disabled={mi.requires.net && !enabledRef.current}
|
|
62
|
-
onClick={() => {
|
|
63
|
-
window.location.href = mi.url
|
|
64
|
-
}}
|
|
65
|
-
>
|
|
66
|
-
<ListItemText
|
|
67
|
-
primary={doI18n(`pages:${mi.id}:title`, i18nRef.current)}/>
|
|
68
|
-
</ListItemButton>
|
|
69
|
-
</ListItem>
|
|
70
|
-
)
|
|
71
|
-
}
|
|
72
|
-
</Box>
|
|
73
|
-
<Box>
|
|
74
|
-
<ListItem disablePadding >
|
|
75
|
-
<ListItemButton
|
|
76
|
-
/* selected={currentId.includes("settings")} */
|
|
77
|
-
onClick={ () => { window.location.href = "/clients/settings" }}
|
|
78
|
-
>
|
|
79
|
-
<ListItemText primary={doI18n("pages:core-settings:title", i18nRef.current)}/>
|
|
80
|
-
</ListItemButton>
|
|
81
|
-
</ListItem>
|
|
82
|
-
<ListItem sx={{width: drawerWidth}} disablePadding>
|
|
83
|
-
<ListItemButton onClick={() => setShowAdvanced(a => !a)}>
|
|
84
|
-
<ListItemText primary={doI18n(`components:header:advanced`, i18nRef.current)} />
|
|
85
|
-
{showAdvanced ? <ExpandLess /> : <ExpandMore />}
|
|
86
|
-
</ListItemButton>
|
|
87
|
-
</ListItem>
|
|
88
|
-
<Collapse in={showAdvanced} timeout="auto" unmountOnExit>
|
|
89
|
-
<List component="div" disablePadding>
|
|
90
|
-
<ListItemButton onClick={toggleDebug} sx={{ pl:4 }}>
|
|
91
|
-
<ListItemText primary={doI18n(`components:header:experimental_mode`, i18nRef.current)} />
|
|
92
|
-
<Switch
|
|
93
|
-
edge="end"
|
|
94
|
-
onChange={toggleDebug}
|
|
95
|
-
checked={debugRef.current}
|
|
96
|
-
/>
|
|
97
|
-
</ListItemButton>
|
|
98
|
-
</List>
|
|
99
|
-
</Collapse>
|
|
100
|
-
<Box
|
|
101
|
-
ref={measurementRef}
|
|
102
|
-
sx={{
|
|
103
|
-
visibility: 'hidden',
|
|
104
|
-
position: 'absolute',
|
|
105
|
-
whiteSpace: 'nowrap',
|
|
106
|
-
top: 0,
|
|
107
|
-
left: 0,
|
|
108
|
-
}}
|
|
109
|
-
>
|
|
110
|
-
<List component="div" disablePadding>
|
|
111
|
-
<ListItemButton onClick={toggleDebug} sx={{ pl:4 }}>
|
|
112
|
-
<ListItemText primary={doI18n(`components:header:experimental_mode`, i18nRef.current)} />
|
|
113
|
-
<Switch
|
|
114
|
-
edge="end"
|
|
115
|
-
onChange={toggleDebug}
|
|
116
|
-
checked={debugRef.current}
|
|
117
|
-
/>
|
|
118
|
-
</ListItemButton>
|
|
119
|
-
</List>
|
|
120
|
-
</Box>
|
|
121
|
-
</Box>
|
|
122
|
-
</Stack>
|
|
123
|
-
</List>
|
|
124
|
-
</Box>
|
|
125
|
-
</Drawer>
|
|
126
|
-
</Box>
|
|
127
|
-
)
|
|
128
|
-
}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import React, {useContext} from 'react';
|
|
2
|
-
import {
|
|
3
|
-
Box, Button,
|
|
4
|
-
Chip,
|
|
5
|
-
Dialog,
|
|
6
|
-
DialogActions,
|
|
7
|
-
DialogContent,
|
|
8
|
-
DialogContentText,
|
|
9
|
-
DialogTitle,
|
|
10
|
-
Typography
|
|
11
|
-
} from "@mui/material";
|
|
12
|
-
import AirplanemodeInactiveOutlinedIcon from '@mui/icons-material/AirplanemodeInactiveOutlined';
|
|
13
|
-
import AirplanemodeActiveOutlinedIcon from '@mui/icons-material/AirplanemodeActiveOutlined';
|
|
14
|
-
import {i18nContext, netContext, doI18n} from "pithekos-lib";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export default function InternetSwitch({enableInternet, handleInternetToggleClick, internetDialogOpen, setInternetDialogOpen}) {
|
|
18
|
-
|
|
19
|
-
const {i18nRef} = useContext(i18nContext);
|
|
20
|
-
const {enabledRef} = useContext(netContext);
|
|
21
|
-
|
|
22
|
-
const handleClose = () => {
|
|
23
|
-
setInternetDialogOpen(false);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<Box>
|
|
28
|
-
<Chip
|
|
29
|
-
icon={enabledRef.current ? <AirplanemodeInactiveOutlinedIcon /> : <AirplanemodeActiveOutlinedIcon />}
|
|
30
|
-
label={doI18n("components:header:offline_mode", i18nRef.current)}
|
|
31
|
-
onClick={handleInternetToggleClick}
|
|
32
|
-
color={enabledRef.current ? "appbar-chip-inactive" : "secondary"}
|
|
33
|
-
variant="Filled"
|
|
34
|
-
/>
|
|
35
|
-
<Dialog
|
|
36
|
-
open={internetDialogOpen}
|
|
37
|
-
onClose={handleClose}
|
|
38
|
-
slotProps={{
|
|
39
|
-
paper: {
|
|
40
|
-
component: 'form',
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
}}
|
|
44
|
-
>
|
|
45
|
-
<DialogTitle><b>{doI18n("components:header:internet_question_label", i18nRef.current)}</b></DialogTitle>
|
|
46
|
-
<DialogContent>
|
|
47
|
-
<DialogContentText>
|
|
48
|
-
<Typography>
|
|
49
|
-
{doI18n("components:header:internet_question", i18nRef.current)}tra la la
|
|
50
|
-
</Typography>
|
|
51
|
-
</DialogContentText>
|
|
52
|
-
</DialogContent>
|
|
53
|
-
<DialogActions>
|
|
54
|
-
<Button onClick={handleClose}>{doI18n("components:header:cancel", i18nRef.current)}</Button>
|
|
55
|
-
<Button onClick={() => {
|
|
56
|
-
enableInternet();
|
|
57
|
-
handleClose();
|
|
58
|
-
}}>{doI18n("components:header:accept", i18nRef.current)}</Button>
|
|
59
|
-
</DialogActions>
|
|
60
|
-
</Dialog>
|
|
61
|
-
</Box>
|
|
62
|
-
)
|
|
63
|
-
}
|
package/src/rcl/PanDialog.jsx
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { AppBar, Dialog, Toolbar, Typography } from "@mui/material";
|
|
2
|
-
import { i18nContext, doI18n } from "pithekos-lib";
|
|
3
|
-
import { useContext } from "react";
|
|
4
|
-
import PanDialogActions from "./PanDialogActions";
|
|
5
|
-
import PanDialogContent from "./PanDialogContent";
|
|
6
|
-
|
|
7
|
-
export default function PanDialog({ open, closeFn,children,createButtonDisabled=false }) {
|
|
8
|
-
const { i18nRef } = useContext(i18nContext);
|
|
9
|
-
return <Dialog
|
|
10
|
-
open={open}
|
|
11
|
-
onClose={closeFn}
|
|
12
|
-
slotProps={{
|
|
13
|
-
paper: {
|
|
14
|
-
component: 'form',
|
|
15
|
-
},
|
|
16
|
-
}}
|
|
17
|
-
>
|
|
18
|
-
<AppBar color='secondary' sx={{ position: 'relative', borderTopLeftRadius: 4, borderTopRightRadius: 4 }}>
|
|
19
|
-
<Toolbar>
|
|
20
|
-
<Typography variant="h6" component="div">
|
|
21
|
-
{doI18n("pages:content:restore_content", i18nRef.current)}
|
|
22
|
-
</Typography>
|
|
23
|
-
|
|
24
|
-
</Toolbar>
|
|
25
|
-
</AppBar>
|
|
26
|
-
<PanDialogContent>
|
|
27
|
-
{children}
|
|
28
|
-
</PanDialogContent>
|
|
29
|
-
<PanDialogActions closeFn={closeFn} createButtonDisabled={createButtonDisabled} />
|
|
30
|
-
</Dialog>;
|
|
31
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { DialogActions } from "@mui/material";
|
|
2
|
-
import PanDialogButton from "./PanDialogButton";
|
|
3
|
-
|
|
4
|
-
export default function PanDialogActions ({closeFn,createButtonDisabled}) {
|
|
5
|
-
return <>
|
|
6
|
-
<DialogActions>
|
|
7
|
-
<PanDialogButton closeFn={closeFn} createButtonDisabled={createButtonDisabled}/>
|
|
8
|
-
</DialogActions>
|
|
9
|
-
</>
|
|
10
|
-
|
|
11
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Button } from "@mui/material";
|
|
2
|
-
import { i18nContext, doI18n } from "pithekos-lib";
|
|
3
|
-
import { useContext } from "react";
|
|
4
|
-
|
|
5
|
-
export default function PanDialogButton ({closeFn,createButtonDisabled}) {
|
|
6
|
-
const { i18nRef } = useContext(i18nContext);
|
|
7
|
-
return <>
|
|
8
|
-
<Button onClick={closeFn}>
|
|
9
|
-
{doI18n("pages:content:cancel", i18nRef.current)}
|
|
10
|
-
</Button>
|
|
11
|
-
<Button
|
|
12
|
-
variant='contained'
|
|
13
|
-
color="primary"
|
|
14
|
-
onClick={() => {
|
|
15
|
-
closeFn();
|
|
16
|
-
}}
|
|
17
|
-
disabled={createButtonDisabled}
|
|
18
|
-
>{doI18n("pages:content:accept", i18nRef.current)}</Button>
|
|
19
|
-
</>
|
|
20
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { DialogContent, DialogContentText, Typography } from "@mui/material";
|
|
2
|
-
import { i18nContext, doI18n } from "pithekos-lib";
|
|
3
|
-
import { useContext } from "react";
|
|
4
|
-
export default function PanDialogContent({children}) {
|
|
5
|
-
const { i18nRef } = useContext(i18nContext);
|
|
6
|
-
return <>
|
|
7
|
-
<DialogContent>
|
|
8
|
-
<DialogContentText>
|
|
9
|
-
{children}
|
|
10
|
-
</DialogContentText>
|
|
11
|
-
</DialogContent>
|
|
12
|
-
</>
|
|
13
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { AppBar, Dialog, Toolbar, Typography } from "@mui/material";
|
|
2
|
-
import { i18nContext, doI18n } from "pithekos-lib";
|
|
3
|
-
import { useContext } from "react";
|
|
4
|
-
import PanDialogActions from "./PanDialogActions";
|
|
5
|
-
import PanDialogContent from "./PanDialogContent";
|
|
6
|
-
import PanDialog from "./PanDialog";
|
|
7
|
-
|
|
8
|
-
export default function PanDialogDefault({ open, closeFn,children,createButtonDisabled=false }) {
|
|
9
|
-
|
|
10
|
-
return <PanDialog>
|
|
11
|
-
<PanDialogContent>
|
|
12
|
-
{children}
|
|
13
|
-
</PanDialogContent>
|
|
14
|
-
<PanDialogActions closeFn={closeFn} createButtonDisabled={createButtonDisabled} />
|
|
15
|
-
</PanDialog>;
|
|
16
|
-
}
|
package/src/rcl/index.js
DELETED