ywana-core8 0.0.561 → 0.0.564

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.
@@ -5256,6 +5256,16 @@ function _catch$2(body, recover) {
5256
5256
 
5257
5257
 
5258
5258
  var CollectionPage = function CollectionPage(props) {
5259
+ var reloadSelection = function reloadSelection() {
5260
+ try {
5261
+ return Promise.resolve(pageContext.reloadSelection()).then(function () {
5262
+ setPageContext(Object.assign({}, pageContext));
5263
+ });
5264
+ } catch (e) {
5265
+ return Promise.reject(e);
5266
+ }
5267
+ };
5268
+
5259
5269
  var reload = function reload() {
5260
5270
  try {
5261
5271
  return Promise.resolve(pageContext.load()).then(function () {
@@ -5387,7 +5397,7 @@ var CollectionPage = function CollectionPage(props) {
5387
5397
  delay: delay,
5388
5398
  canDelete: canDelete,
5389
5399
  canEdit: canEdit,
5390
- onReload: reload
5400
+ onReload: reloadSelection
5391
5401
  }), children ? /*#__PURE__*/React.createElement("article", null, children) : null));
5392
5402
  };
5393
5403
  var CollectionFilters = function CollectionFilters(props) {
@@ -5687,7 +5697,8 @@ var CollectionEditor = function CollectionEditor(props) {
5687
5697
  autosave = _props$autosave2 === void 0 ? false : _props$autosave2,
5688
5698
  _props$delay2 = props.delay,
5689
5699
  delay = _props$delay2 === void 0 ? 1000 : _props$delay2,
5690
- canDelete = props.canDelete;
5700
+ canDelete = props.canDelete,
5701
+ onReload = props.onReload;
5691
5702
  var timer = useRef(null);
5692
5703
 
5693
5704
  var _useState4 = useState(selected),
@@ -5728,21 +5739,21 @@ var CollectionEditor = function CollectionEditor(props) {
5728
5739
  return /*#__PURE__*/React.createElement(TabbedContentEditor, _extends({}, props, {
5729
5740
  content: content,
5730
5741
  onChange: change,
5731
- onReload: reload
5742
+ onReload: onReload
5732
5743
  }));
5733
5744
 
5734
5745
  case 'TREEDED':
5735
5746
  return /*#__PURE__*/React.createElement(TreededContentEditor, _extends({}, props, {
5736
5747
  content: content,
5737
5748
  onChange: change,
5738
- onReload: reload
5749
+ onReload: onReload
5739
5750
  }));
5740
5751
 
5741
5752
  default:
5742
5753
  return /*#__PURE__*/React.createElement(ContentEditor, _extends({}, props, {
5743
5754
  content: content,
5744
5755
  onChange: change,
5745
- onReload: reload
5756
+ onReload: onReload
5746
5757
  }));
5747
5758
  }
5748
5759
  }
@@ -5817,6 +5828,17 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
5817
5828
  return Promise.reject(e);
5818
5829
  }
5819
5830
  },
5831
+ reloadSelection: function reloadSelection() {
5832
+ try {
5833
+ var _this6 = this;
5834
+
5835
+ return Promise.resolve(_this6.fetch(_this6.selected.id)).then(function (result) {
5836
+ _this6.selected = result;
5837
+ });
5838
+ } catch (e) {
5839
+ return Promise.reject(e);
5840
+ }
5841
+ },
5820
5842
  fetch: function fetch(id) {
5821
5843
  try {
5822
5844
  return Promise.resolve(_catch$2(function () {
@@ -5833,11 +5855,11 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
5833
5855
  },
5834
5856
  create: function create(form) {
5835
5857
  try {
5836
- var _this6 = this;
5858
+ var _this8 = this;
5837
5859
 
5838
5860
  var _temp6 = _catch$2(function () {
5839
5861
  return Promise.resolve(API.create(form)).then(function () {
5840
- return Promise.resolve(_this6.load()).then(function () {});
5862
+ return Promise.resolve(_this8.load()).then(function () {});
5841
5863
  });
5842
5864
  }, function (error) {
5843
5865
  console.log(error);
@@ -5850,11 +5872,11 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
5850
5872
  },
5851
5873
  update: function update(form) {
5852
5874
  try {
5853
- var _this8 = this;
5875
+ var _this10 = this;
5854
5876
 
5855
5877
  var _temp8 = _catch$2(function () {
5856
5878
  return Promise.resolve(API.update(form)).then(function () {
5857
- return Promise.resolve(_this8.load()).then(function () {});
5879
+ return Promise.resolve(_this10.load()).then(function () {});
5858
5880
  });
5859
5881
  }, function (error) {
5860
5882
  console.log(error);
@@ -5867,11 +5889,11 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
5867
5889
  },
5868
5890
  patch: function patch(id, form) {
5869
5891
  try {
5870
- var _this10 = this;
5892
+ var _this12 = this;
5871
5893
 
5872
5894
  var _temp10 = _catch$2(function () {
5873
5895
  return Promise.resolve(API.patch(id, form)).then(function () {
5874
- return Promise.resolve(_this10.load()).then(function () {});
5896
+ return Promise.resolve(_this12.load()).then(function () {});
5875
5897
  });
5876
5898
  }, function (error) {
5877
5899
  console.log(error);
@@ -5884,11 +5906,11 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
5884
5906
  },
5885
5907
  updateProperty: function updateProperty(id, propertyName, form) {
5886
5908
  try {
5887
- var _this12 = this;
5909
+ var _this14 = this;
5888
5910
 
5889
5911
  var _temp12 = _catch$2(function () {
5890
5912
  return Promise.resolve(API.updateProperty(id, propertyName, form)).then(function () {
5891
- return Promise.resolve(_this12.load()).then(function () {});
5913
+ return Promise.resolve(_this14.load()).then(function () {});
5892
5914
  });
5893
5915
  }, function (error) {
5894
5916
  console.log(error);
@@ -5901,11 +5923,11 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
5901
5923
  },
5902
5924
  remove: function remove(id) {
5903
5925
  try {
5904
- var _this14 = this;
5926
+ var _this16 = this;
5905
5927
 
5906
5928
  var _temp14 = _catch$2(function () {
5907
5929
  return Promise.resolve(API.remove(id)).then(function () {
5908
- return Promise.resolve(_this14.load()).then(function () {});
5930
+ return Promise.resolve(_this16.load()).then(function () {});
5909
5931
  });
5910
5932
  }, function (error) {
5911
5933
  console.log(error);