ywana-core8 0.0.691 → 0.0.693

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.
@@ -5796,6 +5796,7 @@ var CollectionPage = function CollectionPage(props) {
5796
5796
  sorter = props.sorter,
5797
5797
  namer = props.namer,
5798
5798
  editor = props.editor,
5799
+ editorTitle = props.editorTitle,
5799
5800
  editorActions = props.editorActions,
5800
5801
  footer = props.footer,
5801
5802
  children = props.children;
@@ -5894,7 +5895,8 @@ var CollectionPage = function CollectionPage(props) {
5894
5895
  onReload: reloadSelection,
5895
5896
  patch: patch,
5896
5897
  onChange: onChange,
5897
- actions: editorActions
5898
+ actions: editorActions,
5899
+ title: editorTitle
5898
5900
  }), children ? /*#__PURE__*/React.createElement("article", null, children) : null, /*#__PURE__*/React.createElement("footer", null, footer)));
5899
5901
  };
5900
5902
  var CollectionFilters = function CollectionFilters(props) {
@@ -6262,6 +6264,7 @@ var CollectionEditor = function CollectionEditor(props) {
6262
6264
 
6263
6265
  var selected = pageContext.selected;
6264
6266
  var icon = props.icon,
6267
+ title = props.title,
6265
6268
  schema = props.schema,
6266
6269
  layout = props.layout,
6267
6270
  _props$autosave2 = props.autosave,
@@ -6307,6 +6310,26 @@ var CollectionEditor = function CollectionEditor(props) {
6307
6310
  return can;
6308
6311
  }
6309
6312
 
6313
+ function renderTitle() {
6314
+ if (title) {
6315
+ return typeof title === 'function' ? title(form) : title;
6316
+ } else {
6317
+ return selected ? selected.name : "New";
6318
+ }
6319
+ }
6320
+
6321
+ function renderActions() {
6322
+ if (actions) {
6323
+ return actions.map(function (action) {
6324
+ // clone React action
6325
+ var action2 = React.cloneElement(action, {
6326
+ form: form
6327
+ });
6328
+ return action2;
6329
+ });
6330
+ }
6331
+ }
6332
+
6310
6333
  function renderEditor() {
6311
6334
  var content = new Content(schema, form);
6312
6335
 
@@ -6336,7 +6359,7 @@ var CollectionEditor = function CollectionEditor(props) {
6336
6359
 
6337
6360
  return selected && form ? /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Header, {
6338
6361
  icon: icon,
6339
- title: /*#__PURE__*/React.createElement(Text, null, selected.name)
6362
+ title: renderTitle()
6340
6363
  }, /*#__PURE__*/React.createElement(Icon, {
6341
6364
  icon: "close",
6342
6365
  clickable: true,
@@ -6352,7 +6375,7 @@ var CollectionEditor = function CollectionEditor(props) {
6352
6375
  raised: true,
6353
6376
  disabled: !canSave(),
6354
6377
  action: save
6355
- }), actions ? actions : null), renderEditor()) : null;
6378
+ }), renderActions()), renderEditor()) : null;
6356
6379
  };
6357
6380
  /**
6358
6381
  * Collection Context