ywana-core8 0.0.492 → 0.0.495

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.492",
3
+ "version": "0.0.495",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -2,7 +2,7 @@
2
2
  border: solid 0px var(--divider-color);
3
3
  background-color: var(--paper-color);
4
4
  overflow: auto;
5
- height: 100%;
5
+ max-height: 100%;
6
6
  width: 100%;
7
7
  }
8
8
 
@@ -0,0 +1,16 @@
1
+ export class Console {
2
+
3
+ constructor() {
4
+ this.lines = []
5
+ }
6
+
7
+ log(line) {
8
+ console.log(line)
9
+ this.lines.push(line)
10
+ }
11
+
12
+ clear() {
13
+ this.lines = []
14
+ }
15
+
16
+ }
package/src/site/site.css CHANGED
@@ -115,7 +115,17 @@
115
115
  grid-area: footer;
116
116
  min-height: 20rem;
117
117
  background-color: rgb(222, 222, 222);
118
- color: #FFF;
118
+ color: #000;
119
+ }
120
+
121
+ .site6>.site-console>main {
122
+ border: solid 5px red;
123
+ overflow: scroll;
124
+ max-height: 40vh;
125
+ }
126
+
127
+ .site6>.site-console>main>div {
128
+ padding: 1rem;
119
129
  }
120
130
 
121
131
  .site6>.site-preview {
package/src/site/site.js CHANGED
@@ -9,20 +9,22 @@ import './site.css'
9
9
 
10
10
  import { ReactNotifications, Store } from 'react-notifications-component'
11
11
  import 'react-notifications-component/dist/theme.css'
12
+ import { Console } from './console'
12
13
 
13
14
 
14
15
 
15
16
  /**
16
17
  * Site Provider
17
18
  */
18
- export const SiteProvider = ({ children, siteLang, siteDictionary, showConsole }) => {
19
+ export const SiteProvider = ({ children, siteLang, siteDictionary }) => {
19
20
 
20
21
  const [lang, setLang] = useState(siteLang)
21
22
  const [dictionary, setDictionary] = useState(siteDictionary)
22
23
  const [sideNav, setSideNav] = useState('max')
23
24
  const [showNav, setShowNav] = useState(false)
24
25
  const [info, setInfo] = useState(null)
25
- const [console, setConsole] = useState(false)
26
+ const [showConsole, setShowConsole] = useState(false)
27
+ const [console] = useState(new Console())
26
28
  const [page, setPage] = useState()
27
29
  const [dialog, setDialog] = useState()
28
30
  const [promptDialog, setPromptDialog] = useState()
@@ -58,8 +60,10 @@ export const SiteProvider = ({ children, siteLang, siteDictionary, showConsole }
58
60
  openInfo: (info) => { setInfo(info) },
59
61
  closeInfo: () => { setInfo(null) },
60
62
 
63
+ showConsole,
61
64
  console,
62
- toggleConsole: () => { setConsole(!console) },
65
+ toggleConsole: () => { setShowConsole(!showConsole) },
66
+
63
67
 
64
68
  breadcrumb,
65
69
  setBreadcrumb,
@@ -303,7 +307,7 @@ const SitePreview = () => {
303
307
  */
304
308
  const SiteConsole = () => {
305
309
  const context = useContext(SiteContext)
306
- return context.console ? (
310
+ return context.showConsole ? (
307
311
  <footer className="site-console" >
308
312
  <Header>
309
313
  <Tabs>
@@ -311,7 +315,7 @@ const SiteConsole = () => {
311
315
  </Tabs>
312
316
  </Header>
313
317
  <main>
314
-
318
+ {context.console.lines.map(line => <div>{line}</div>)}
315
319
  </main>
316
320
  </footer>
317
321
  ) : ''
@@ -97,6 +97,9 @@ const Page2 = (props) => {
97
97
  <Button label="CLOSE" action={() => site.closeDialog()} />
98
98
  </Fragment>
99
99
  )
100
+
101
+ site.console.log("open dialog")
102
+
100
103
  site.openDialog(
101
104
  <Dialog actions={actions}>
102
105
  <main>
package/src/site/view.css CHANGED
@@ -10,7 +10,7 @@
10
10
  display: flex;
11
11
  align-items: center;
12
12
  background-color: rgb(200,200,200);
13
- height: 2rem;
13
+ min-height: 2rem;
14
14
  padding-left: 1rem;
15
15
  }
16
16
 
@@ -19,6 +19,7 @@
19
19
  }
20
20
 
21
21
  .view>nav {
22
+ min-height: 2rem;
22
23
  display: flex;
23
24
  flex-direction: ;
24
25
  align-items: center;