ywana-core8 0.0.668 → 0.0.669

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.
@@ -5668,6 +5668,8 @@ var CollectionPage = function CollectionPage(props) {
5668
5668
  delay = _props$delay === void 0 ? 1000 : _props$delay,
5669
5669
  _props$patch = props.patch,
5670
5670
  patch = _props$patch === void 0 ? false : _props$patch,
5671
+ _props$versioning = props.versioning,
5672
+ versioning = _props$versioning === void 0 ? false : _props$versioning,
5671
5673
  groupBy = props.groupBy,
5672
5674
  levels = props.levels,
5673
5675
  sorter = props.sorter,
@@ -5675,12 +5677,12 @@ var CollectionPage = function CollectionPage(props) {
5675
5677
  editor = props.editor,
5676
5678
  footer = props.footer,
5677
5679
  children = props.children;
5680
+ var context = CollectionContext(url, field, host, page, fetching, versioning);
5678
5681
 
5679
5682
  var _useContext = useContext(PageContext),
5680
5683
  pageContext = _useContext[0],
5681
5684
  setPageContext = _useContext[1];
5682
5685
 
5683
- var context = CollectionContext(url, field, host, page, fetching);
5684
5686
  var all = pageContext.all;
5685
5687
  useEffect(function () {
5686
5688
  try {
@@ -6204,7 +6206,11 @@ var CollectionEditor = function CollectionEditor(props) {
6204
6206
  */
6205
6207
 
6206
6208
 
6207
- var CollectionContext = function CollectionContext(url, field, host, page, fetching) {
6209
+ var CollectionContext = function CollectionContext(url, field, host, page, fetching, versioning) {
6210
+ if (versioning === void 0) {
6211
+ versioning = false;
6212
+ }
6213
+
6208
6214
  var API = CollectionAPI(url, host);
6209
6215
  return {
6210
6216
  all: [],
@@ -6283,6 +6289,7 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
6283
6289
  var _this8 = this;
6284
6290
 
6285
6291
  var _temp10 = _catch$3(function () {
6292
+ if (versioning) form.version = 1;
6286
6293
  return Promise.resolve(API.create(form)).then(function () {
6287
6294
  return Promise.resolve(_this8.load()).then(function () {});
6288
6295
  });
@@ -6300,6 +6307,7 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
6300
6307
  var _this10 = this;
6301
6308
 
6302
6309
  var _temp12 = _catch$3(function () {
6310
+ if (versioning) form.version = form.version ? form.version + 1 : 1;
6303
6311
  return Promise.resolve(API.update(form)).then(function () {
6304
6312
  return Promise.resolve(_this10.load()).then(function () {});
6305
6313
  });
@@ -6317,6 +6325,7 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
6317
6325
  var _this12 = this;
6318
6326
 
6319
6327
  var _temp14 = _catch$3(function () {
6328
+ if (versioning) form.version = form.version ? form.version + 1 : 1;
6320
6329
  return Promise.resolve(API.patch(id, form)).then(function () {
6321
6330
  return Promise.resolve(_this12.load()).then(function () {});
6322
6331
  });