ywana-core8 0.0.353 → 0.0.354

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.0.353",
3
+ "version": "0.0.354",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -1,8 +1,10 @@
1
1
  import React, { useState } from 'react'
2
+ import { useEffect } from 'react/cjs/react.production.min'
2
3
  import { Text, TEXTFORMATS } from './text'
3
4
 
4
5
  const TextTest = (prop) => {
5
6
 
7
+
6
8
  return (
7
9
  <>
8
10
  <Text format={TEXTFORMATS.NUMERIC}>846964.4199142859</Text>
@@ -1,31 +1,39 @@
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';
1
+ import React, { useState, useEffect } from 'react'
2
+ import { TextField } from '../html'
3
+ import CryptoJS from 'crypto-js';
4
+ import { useEffect } from 'react/cjs/react.production.min';
6
5
 
7
- const TokenTest = (prop) => {
8
6
 
9
- const [text, setText] = useState()
10
- const [hash, setHash] = useState()
11
- const [decripted, setDecripted] = useState()
7
+ const Token = () => {
12
8
 
13
- function encryptData(data, iv, key) {
9
+ const [encrypted, setEncrypted] = useState("")
10
+ const [decrypted, setDecrypted] = useState("")
14
11
 
12
+
13
+ function decryptData(encrypted, secret) {
14
+ const bytes = CryptoJS.AES.decrypt(encrypted, secret);
15
+ const originalText = bytes.toString(CryptoJS.enc.Utf8);
16
+ return originalText;
15
17
  }
16
-
17
-
18
- function decryptData(encrypted, iv, key) {
19
-
18
+
19
+ function encryptData(message, secret) {
20
+ return CryptoJS.AES.encrypt(message, secret).toString();
21
+ }
22
+
23
+ function change(id, value) {
24
+ const secret = '12345678';
25
+ const e = encryptData(value, secret)
26
+ setEncrypted(e)
27
+ const d = decryptData(e, secret)
28
+ setDecrypted(d)
20
29
  }
21
30
 
22
31
  return (
23
32
  <>
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} />
33
+ <TextField label="Text" onChange={(id, value) => change(id, value)}></TextField>
34
+ <TextField label="Encrypted" value={encrypted}></TextField>
35
+ <TextField label="Decrypted" value={decrypted}></TextField>
29
36
  </>
30
37
  )
31
- }
38
+ }
39
+
package/src/site/site.css CHANGED
@@ -109,6 +109,10 @@
109
109
 
110
110
  .site6>footer {
111
111
  grid-area: footer;
112
+ }
113
+
114
+ .site6>.site-console {
115
+ grid-area: footer;
112
116
  min-height: 20rem;
113
117
  background-color: rgb(222, 222, 222);
114
118
  color: #FFF;
package/src/site/site.js CHANGED
@@ -104,7 +104,7 @@ export const SiteProvider = ({ children, siteLang, siteDictionary, showConsole }
104
104
  /**
105
105
  * Site
106
106
  */
107
- export const Site = ({ icon, logo, title, toolbar, children, init, min, lang, dictionary }) => {
107
+ export const Site = ({ icon, logo, title, toolbar, footer, children, init, min, lang, dictionary }) => {
108
108
  return (
109
109
  <SiteProvider siteLang={lang} siteDictionary={dictionary}>
110
110
  <div className="site6">
@@ -121,6 +121,7 @@ export const Site = ({ icon, logo, title, toolbar, children, init, min, lang, di
121
121
  <SitePromptDialog />
122
122
  <SitePreview />
123
123
  <SiteNotifications />
124
+ <SiteFooter>{footer}</SiteFooter>
124
125
  </div>
125
126
  </SiteProvider>
126
127
  )
@@ -141,6 +142,7 @@ const SiteHeader = (props) => {
141
142
  <Header icon={icon} title={title} />
142
143
  )
143
144
  }
145
+
144
146
  /**
145
147
  * Site ToolBar
146
148
  */
@@ -154,6 +156,19 @@ const SiteToolBar = ({ children }) => {
154
156
  )
155
157
  }
156
158
 
159
+ /**
160
+ * Site Footer
161
+ */
162
+ const SiteFooter = ({ children }) => {
163
+ const context = useContext(SiteContext)
164
+ const { breadcrumb } = context
165
+ return (
166
+ <footer>
167
+ {children}
168
+ </footer>
169
+ )
170
+ }
171
+
157
172
  /**
158
173
  * Site Aside
159
174
  */
@@ -9,8 +9,11 @@ import { Dialog } from './dialog'
9
9
  import { Button } from '../html'
10
10
 
11
11
  const SiteTest = (prop) => {
12
+
13
+ const footer = <div>FOOTER</div>
14
+
12
15
  return (
13
- <Site icon="star" title="Site Test" init={"PAGE2"}>
16
+ <Site icon="star" title="Site Test" init={"PAGE2"} footer={footer}>
14
17
  <Page id="PAGE1" section="SECTION1" icon="description" title="Page 1" layout="workspace">
15
18
  <Page1 />
16
19
  </Page>