ywana-core8 0.0.350 → 0.0.353
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.cjs +13 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +65 -56
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +13 -4
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +13 -4
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -1
- package/src/html/menu.css +65 -57
- package/src/html/menu.js +8 -4
- package/src/http/token.test.js +31 -0
- package/src/site/dialog.js +5 -1
- package/src/site/site.test.js +8 -9
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ywana-core8",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.353",
|
4
4
|
"description": "ywana-core8",
|
5
5
|
"author": "Ernesto Roldan Garcia",
|
6
6
|
"license": "MIT",
|
@@ -29,6 +29,7 @@
|
|
29
29
|
"react-dom": "^17.0.2"
|
30
30
|
},
|
31
31
|
"dependencies": {
|
32
|
+
"crypto-js": "^4.1.1",
|
32
33
|
"deep-equal": "^2.0.5",
|
33
34
|
"material-design-icons-iconfont": "^6.1.1",
|
34
35
|
"moment": "^2.29.1",
|
package/src/html/menu.css
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
.menu-icon {
|
2
|
-
|
3
|
-
|
2
|
+
position: relative;
|
3
|
+
width: 3rem;
|
4
4
|
}
|
5
5
|
|
6
|
-
.menu-icon
|
6
|
+
.menu-icon > .overlay {
|
7
7
|
position: fixed;
|
8
8
|
top: 0px;
|
9
9
|
left: 0px;
|
@@ -13,70 +13,78 @@
|
|
13
13
|
background-color: transparent;
|
14
14
|
}
|
15
15
|
|
16
|
-
.menu-icon>menu {
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
16
|
+
.menu-icon > menu {
|
17
|
+
z-index: 6;
|
18
|
+
position: absolute;
|
19
|
+
top: 3rem;
|
20
|
+
left: 0px;
|
21
|
+
margin: 0;
|
22
|
+
border: solid 1px var(--divider-color);
|
23
|
+
background-color: var(--paper-color);
|
24
|
+
padding: 0;
|
25
|
+
min-width: 7rem;
|
26
|
+
max-width: 14rem;
|
27
|
+
max-height: 50vh;
|
28
|
+
overflow: auto;
|
29
|
+
box-shadow: var(--shadow1);
|
30
30
|
}
|
31
31
|
|
32
|
-
.menu-icon>menu.alignRight {
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
.menu-icon > menu.alignRight {
|
33
|
+
left: unset;
|
34
|
+
right: 0px;
|
35
|
+
}
|
36
36
|
|
37
|
-
.menu-icon>menu ul {
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
.menu-icon>menu li {
|
45
|
-
min-height: 3rem;
|
46
|
-
padding: 0 .5rem;
|
47
|
-
|
48
|
-
display: flex;
|
49
|
-
align-items: center;
|
50
|
-
}
|
51
|
-
|
52
|
-
.menu-icon>menu li:hover {
|
53
|
-
background-color: var(--primary-color-lighter);
|
54
|
-
}
|
37
|
+
.menu-icon > menu ul {
|
38
|
+
list-style: none;
|
39
|
+
margin: 0;
|
40
|
+
padding: 0.5rem 0;
|
41
|
+
cursor: pointer;
|
42
|
+
}
|
55
43
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
44
|
+
.menu-icon > menu li {
|
45
|
+
min-height: 3rem;
|
46
|
+
padding: 0 0.5rem;
|
47
|
+
display: flex;
|
48
|
+
align-items: center;
|
49
|
+
}
|
61
50
|
|
62
|
-
|
63
|
-
|
64
|
-
|
51
|
+
.menu-icon > menu li:hover {
|
52
|
+
background-color: var(--primary-color-lighter);
|
53
|
+
}
|
65
54
|
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
}
|
55
|
+
.menu-item {
|
56
|
+
flex: 1;
|
57
|
+
display: flex;
|
58
|
+
align-items: center;
|
59
|
+
cursor: pointer;
|
60
|
+
}
|
73
61
|
|
74
|
-
|
75
|
-
|
62
|
+
.menu-item > .icon {
|
63
|
+
color: var(--text-color-light);
|
64
|
+
cursor: pointer;
|
65
|
+
}
|
66
|
+
|
67
|
+
.menu-item > label {
|
68
|
+
flex: 1;
|
69
|
+
white-space: nowrap;
|
70
|
+
padding: 0 0.5rem 0 0;
|
71
|
+
color: var(--text-color);
|
72
|
+
font-size: 0.9rem;
|
73
|
+
cursor: pointer;
|
74
|
+
}
|
75
|
+
|
76
|
+
.menu-item.disabled > label,
|
77
|
+
.menu-item.disabled > .icon {
|
78
|
+
color: var(--text-color-lighter);
|
79
|
+
cursor: initial;
|
80
|
+
}
|
81
|
+
|
82
|
+
.menu-item > .meta {
|
83
|
+
color: var(--text-color-lighter);
|
76
84
|
}
|
77
85
|
|
78
86
|
.menu-separator {
|
79
87
|
min-height: 0px !important;
|
80
88
|
height: 1px;
|
81
89
|
border-top: solid 1px var(--divider-color);
|
82
|
-
}
|
90
|
+
}
|
package/src/html/menu.js
CHANGED
@@ -52,15 +52,19 @@ export const MenuIcon = (props) => {
|
|
52
52
|
*/
|
53
53
|
export const MenuItem = (props) => {
|
54
54
|
|
55
|
-
const { id, icon, label, meta, onSelect } = props
|
55
|
+
const { id, icon, label, meta, disabled=false, onSelect } = props
|
56
56
|
const [open, setOpen] = useContext(MenuContext)
|
57
57
|
|
58
58
|
function select() {
|
59
|
-
if (
|
60
|
-
|
59
|
+
if (!disabled) {
|
60
|
+
if (onSelect) onSelect()
|
61
|
+
setOpen(false)
|
62
|
+
}
|
61
63
|
}
|
64
|
+
|
65
|
+
const style = disabled ? "disabled" : ""
|
62
66
|
return (
|
63
|
-
<li className=
|
67
|
+
<li className={`menu-item ${style}`} onClick={select}>
|
64
68
|
{icon ? <Icon icon={icon} /> : null}
|
65
69
|
<label>{label}</label>
|
66
70
|
{meta ? <div className="meta">{meta}</div> : null}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import React, { useState } from 'react'
|
2
|
+
import { Button, TextField } from '../html'
|
3
|
+
import sha256 from 'crypto-js/sha256';
|
4
|
+
import hmacSHA512 from 'crypto-js/hmac-sha512';
|
5
|
+
import Base64 from 'crypto-js/enc-base64';
|
6
|
+
|
7
|
+
const TokenTest = (prop) => {
|
8
|
+
|
9
|
+
const [text, setText] = useState()
|
10
|
+
const [hash, setHash] = useState()
|
11
|
+
const [decripted, setDecripted] = useState()
|
12
|
+
|
13
|
+
function encryptData(data, iv, key) {
|
14
|
+
|
15
|
+
}
|
16
|
+
|
17
|
+
|
18
|
+
function decryptData(encrypted, iv, key) {
|
19
|
+
|
20
|
+
}
|
21
|
+
|
22
|
+
return (
|
23
|
+
<>
|
24
|
+
<TextField label="Text" onChange={(id, value) => setText(value)}></TextField>
|
25
|
+
<Button label="ENCRYPT" action={encryptData}></Button>
|
26
|
+
<TextField label="Encrypted" value={encripted}></TextField>
|
27
|
+
<Button label="DECRYPT" action={decryptData}></Button>
|
28
|
+
<TextField label="Decrypted" value={decripted} />
|
29
|
+
</>
|
30
|
+
)
|
31
|
+
}
|
package/src/site/dialog.js
CHANGED
@@ -14,7 +14,11 @@ export const Dialog = (props) => {
|
|
14
14
|
const { icon, title = "Dialog", children, onAction, actions, className, eventPropagation = false } = props
|
15
15
|
|
16
16
|
function close() {
|
17
|
-
|
17
|
+
if (className === "prompt") {
|
18
|
+
site.closePromptDialog()
|
19
|
+
} else {
|
20
|
+
site.closeDialog()
|
21
|
+
}
|
18
22
|
}
|
19
23
|
|
20
24
|
function prevent(e) {
|
package/src/site/site.test.js
CHANGED
@@ -25,7 +25,7 @@ const Page1 = (props) => {
|
|
25
25
|
|
26
26
|
const site = useContext(SiteContext)
|
27
27
|
useEffect(() => {
|
28
|
-
site.notify({ title: "Notification 1", body: "Lorem ipsum dolor sit amet"})
|
28
|
+
site.notify({ title: "Notification 1", body: "Lorem ipsum dolor sit amet" })
|
29
29
|
}, [])
|
30
30
|
|
31
31
|
return (
|
@@ -41,7 +41,7 @@ const Page1 = (props) => {
|
|
41
41
|
const Page2 = (props) => {
|
42
42
|
|
43
43
|
const site = useContext(SiteContext)
|
44
|
-
|
44
|
+
|
45
45
|
function prompt() {
|
46
46
|
const actions = (
|
47
47
|
<Fragment>
|
@@ -50,14 +50,13 @@ const Page2 = (props) => {
|
|
50
50
|
)
|
51
51
|
site.openPromptDialog(<Dialog className="prompt" actions={actions} >PROMPT</Dialog>)
|
52
52
|
}
|
53
|
-
|
53
|
+
|
54
54
|
function openDialog() {
|
55
|
-
|
56
|
-
|
57
|
-
<
|
58
|
-
|
59
|
-
|
60
|
-
)
|
55
|
+
const actions = (
|
56
|
+
<Fragment>
|
57
|
+
<Button label="CLOSE" action={() => site.closeDialog()} />
|
58
|
+
</Fragment>
|
59
|
+
)
|
61
60
|
site.openDialog(
|
62
61
|
<Dialog actions={actions}>
|
63
62
|
<main>
|