ywana-core8 0.0.81 → 0.0.85

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.81",
3
+ "version": "0.0.85",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -15,22 +15,26 @@ export const ContentEditor = ({ content, filter, onChange }) => {
15
15
  }
16
16
 
17
17
  const sections = content.sections()
18
+ console.log('ContentEditor:sections', sections)
19
+
18
20
  return (
19
21
  <div className='content-editor'>
20
- {sections.map((section) => {
21
- const { title, fields } = section
22
- return (
23
- <section key={title}>
24
- <header>{title}</header>
25
- <main>
26
- {fields
27
- .filter(field => field.id !== 'id')
28
- .filter(field => filter ? filter(field, content) : true)
29
- .map((field) => <FieldEditor key={field.id} field={field} onChange={change} outlined={true} />)}
30
- </main>
31
- </section>
32
- )
33
- })}
22
+ {sections
23
+ .filter(section => section.fields && section.fields.length > 0)
24
+ .map((section) => {
25
+ const { title, fields } = section
26
+ return (
27
+ <section key={title}>
28
+ <header>{title}</header>
29
+ <main>
30
+ {fields
31
+ .filter(field => field.id !== 'id')
32
+ .filter(field => filter ? filter(field, content) : true)
33
+ .map((field) => <FieldEditor key={field.id} field={field} onChange={change} outlined={true} />)}
34
+ </main>
35
+ </section>
36
+ )
37
+ })}
34
38
  </div>
35
39
  )
36
40
  }
@@ -15,5 +15,6 @@ export const Switch = (props) => {
15
15
  height={20}
16
16
  width={48}
17
17
  className="react-switch"
18
- />
18
+ />
19
+ )
19
20
  }
@@ -16,7 +16,7 @@ export const TextField = (props) => {
16
16
  function onKeyPress(event) {
17
17
  var key = event.charCode ? event.charCode : event.keyCode ? event.keyCode : 0;
18
18
  if (key == 13) {
19
- onEnter()
19
+ if (onEnter) onEnter()
20
20
  }
21
21
  }
22
22