ywana-core8 0.0.940 → 0.0.941

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.940",
3
+ "version": "0.0.941",
4
4
  "description": "ywana-core8",
5
5
  "homepage": "https://ywana.github.io/workspace",
6
6
  "author": "Ernesto Roldan Garcia",
@@ -84,7 +84,7 @@ export const CollectionPage = (props) => {
84
84
  {levels ? <CollectionTree schema={schema} icon={icon} levels={levels} onSelect={onSelect} sorter={sorter} searchBy={searchBy} namer={namer} /> : <CollectionList groupBy={groupBy} onSelect={onSelect} searchBy={searchBy} itemRenderer={listItemRenderer} sorter={sorter} />}
85
85
  </menu>
86
86
  <main key={id} className={`collection-page ${className}`}>
87
- <CollectionEditor icon={icon} schema={schema} layout={editor} grouped={grouped} autosave={autosave} delay={delay} canDelete={canDelete} onReload={reloadSelection} patch={patch} onChange={onChange} actions={editorActions} title={editorTitle} validator={editValidator} />
87
+ <CollectionEditor icon={icon} schema={schema} layout={editor} grouped={grouped} autosave={autosave} delay={delay} canDelete={canDelete} onReload={reloadSelection} patch={patch} onChange={onChange} onClose={() => onSelect(null)} actions={editorActions} title={editorTitle} validator={editValidator} />
88
88
  {children ? <article>{children}</article> : null}
89
89
  <footer>
90
90
  {footer}
@@ -356,7 +356,7 @@ const CollectionEditor = (props) => {
356
356
  const site = useContext(SiteContext)
357
357
  const [pageContext, setPageContext] = useContext(PageContext)
358
358
  const { selected } = pageContext
359
- const { icon, title, schema, layout, autosave = false, delay = 1000, canDelete, onReload, onChange, patch = false, actions, validator } = props
359
+ const { icon, title, schema, layout, autosave = false, delay = 1000, canDelete, onReload, onChange, onClose, patch = false, actions, validator } = props
360
360
  const timer = useRef(null)
361
361
  const [form, setForm] = useState(selected)
362
362
 
@@ -376,6 +376,7 @@ const CollectionEditor = (props) => {
376
376
  function clear() {
377
377
  pageContext.clear()
378
378
  setPageContext(Object.assign({}, pageContext))
379
+ if (onClose) onClose()
379
380
  }
380
381
 
381
382
  async function remove() {