ywana-core8 0.0.75 → 0.0.79

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.75",
3
+ "version": "0.0.79",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -29,6 +29,7 @@
29
29
  "deep-equal": "^2.0.5",
30
30
  "material-design-icons-iconfont": "^6.1.1",
31
31
  "react-datepicker": "^4.6.0",
32
+ "react-notifications": "^1.7.3",
32
33
  "resumablejs": "^1.1.0"
33
34
  }
34
35
  }
@@ -2,7 +2,7 @@ import React, { Fragment, useState } from 'react';
2
2
  import { Button, CheckBox, DataTable, DropDown, Icon, Stack, Tab, Tabs, Text, TextField, Tree, TreeNode, TreeItem, TokenField, Property } from '../html';
3
3
  import { Content, TYPES } from './ContentType';
4
4
  import './ContentEditor.css';
5
- import { FORMATS } from '.';
5
+ import { FORMATS } from './ContentType';
6
6
 
7
7
  /**
8
8
  * Content Editor
@@ -8,14 +8,11 @@ import { TextField, CheckBox, DropDown, Form } from '../html';
8
8
  export const ContentForm = ({ content, columns = 1, filter, rules, onChange }) => {
9
9
 
10
10
  const form = content.form()
11
- console.log(form)
12
11
 
13
12
  const fields = Object.keys(form)
14
13
  .map(key => form[key])
15
14
  .filter( field => filter ? filter(field) : true)
16
15
 
17
- console.log(fields)
18
-
19
16
  return (
20
17
  <Form className="content-form" columns={columns} outlined={true} onChange={onChange}>
21
18
  { fields.map(field => <ContentFormField key={field.id} {...field} />)}
@@ -41,7 +41,7 @@ export const TextField = (props) => {
41
41
  const labelTxt = <Text>{label}</Text>
42
42
  return (
43
43
  <div className={`${style}`} onClick={onClick}>
44
- <input id={id} type={type} placeholder={placeholder} value={value} required onChange={change} onKeyDown={onKeyPress} onFocus={focus} readOnly={readOnly}/>
44
+ <input id={id} type={type} placeholder={placeholder} value={value} required onChange={change} onKeyDown={onKeyPress} onFocus={focus} readOnly={readOnly} onfocus="(this.type='date')" onfocusout="(this.type='text')"/>
45
45
  <span className="bar"></span>
46
46
  { label ? <label>{labelTxt}</label> : null }
47
47
  </div>
package/src/site/site.js CHANGED
@@ -3,9 +3,10 @@ import { Icon } from '../html/icon'
3
3
  import { Tabs, Tab } from '../html/tab'
4
4
  import { Header } from '../html/header'
5
5
  import { Page } from './page'
6
- import './site.css'
7
6
  import { SiteContext } from './siteContext'
8
-
7
+ import { NotificationContainer, NotificationManager} from 'react-notifications'
8
+ import './site.css'
9
+ import 'react-notifications/lib/notifications.css';
9
10
 
10
11
 
11
12
  /**
@@ -64,8 +65,13 @@ export const SiteProvider = ({ children, siteLang, siteDictionary, showConsole }
64
65
 
65
66
  preview,
66
67
  openPreview: (preview) => { setPreview(preview) },
67
- closePreview: () => { setPreview(null) }
68
+ closePreview: () => { setPreview(null) },
68
69
 
70
+ confirm: (message) => window.confirm(message),
71
+
72
+ notify: ({title, body}) => {
73
+ NotificationManager.info(body, title)
74
+ }
69
75
  }
70
76
 
71
77
  return (
@@ -93,11 +99,18 @@ export const Site = ({ icon, logo, title, toolbar, children, init, min, lang, di
93
99
  <SiteConsole />
94
100
  <SiteDialog />
95
101
  <SitePreview />
102
+ <SiteNotifications />
96
103
  </div>
97
104
  </SiteProvider>
98
105
  )
99
106
  }
100
107
 
108
+ const SiteNotifications = () => {
109
+ return (
110
+ <NotificationContainer />
111
+ )
112
+ }
113
+
101
114
  /**
102
115
  * Site Header
103
116
  */