ywana-core8 0.0.668 → 0.0.670
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/dist/index.cjs +18 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +18 -5
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +18 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +6 -4
- package/src/site/site.js +4 -3
package/dist/index.modern.js
CHANGED
@@ -3637,7 +3637,10 @@ var SiteProvider = function SiteProvider(_ref) {
|
|
3637
3637
|
var title = _ref2.title,
|
3638
3638
|
body = _ref2.body,
|
3639
3639
|
_ref2$type = _ref2.type,
|
3640
|
-
type = _ref2$type === void 0 ? "success" : _ref2$type
|
3640
|
+
type = _ref2$type === void 0 ? "success" : _ref2$type,
|
3641
|
+
_ref2$duration = _ref2.duration,
|
3642
|
+
duration = _ref2$duration === void 0 ? 3000 : _ref2$duration,
|
3643
|
+
onRemoval = _ref2.onRemoval;
|
3641
3644
|
Store.addNotification({
|
3642
3645
|
title: title,
|
3643
3646
|
message: body,
|
@@ -3647,9 +3650,10 @@ var SiteProvider = function SiteProvider(_ref) {
|
|
3647
3650
|
animationIn: ["animate__animated", "animate__fadeIn"],
|
3648
3651
|
animationOut: ["animate__animated", "animate__fadeOut"],
|
3649
3652
|
dismiss: {
|
3650
|
-
duration:
|
3653
|
+
duration: duration,
|
3651
3654
|
onScreen: true
|
3652
|
-
}
|
3655
|
+
},
|
3656
|
+
onRemoval: onRemoval
|
3653
3657
|
});
|
3654
3658
|
}
|
3655
3659
|
};
|
@@ -5668,6 +5672,8 @@ var CollectionPage = function CollectionPage(props) {
|
|
5668
5672
|
delay = _props$delay === void 0 ? 1000 : _props$delay,
|
5669
5673
|
_props$patch = props.patch,
|
5670
5674
|
patch = _props$patch === void 0 ? false : _props$patch,
|
5675
|
+
_props$versioning = props.versioning,
|
5676
|
+
versioning = _props$versioning === void 0 ? false : _props$versioning,
|
5671
5677
|
groupBy = props.groupBy,
|
5672
5678
|
levels = props.levels,
|
5673
5679
|
sorter = props.sorter,
|
@@ -5675,12 +5681,12 @@ var CollectionPage = function CollectionPage(props) {
|
|
5675
5681
|
editor = props.editor,
|
5676
5682
|
footer = props.footer,
|
5677
5683
|
children = props.children;
|
5684
|
+
var context = CollectionContext(url, field, host, page, fetching, versioning);
|
5678
5685
|
|
5679
5686
|
var _useContext = useContext(PageContext),
|
5680
5687
|
pageContext = _useContext[0],
|
5681
5688
|
setPageContext = _useContext[1];
|
5682
5689
|
|
5683
|
-
var context = CollectionContext(url, field, host, page, fetching);
|
5684
5690
|
var all = pageContext.all;
|
5685
5691
|
useEffect(function () {
|
5686
5692
|
try {
|
@@ -6204,7 +6210,11 @@ var CollectionEditor = function CollectionEditor(props) {
|
|
6204
6210
|
*/
|
6205
6211
|
|
6206
6212
|
|
6207
|
-
var CollectionContext = function CollectionContext(url, field, host, page, fetching) {
|
6213
|
+
var CollectionContext = function CollectionContext(url, field, host, page, fetching, versioning) {
|
6214
|
+
if (versioning === void 0) {
|
6215
|
+
versioning = false;
|
6216
|
+
}
|
6217
|
+
|
6208
6218
|
var API = CollectionAPI(url, host);
|
6209
6219
|
return {
|
6210
6220
|
all: [],
|
@@ -6283,6 +6293,7 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
|
|
6283
6293
|
var _this8 = this;
|
6284
6294
|
|
6285
6295
|
var _temp10 = _catch$3(function () {
|
6296
|
+
if (versioning) form.version = 1;
|
6286
6297
|
return Promise.resolve(API.create(form)).then(function () {
|
6287
6298
|
return Promise.resolve(_this8.load()).then(function () {});
|
6288
6299
|
});
|
@@ -6300,6 +6311,7 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
|
|
6300
6311
|
var _this10 = this;
|
6301
6312
|
|
6302
6313
|
var _temp12 = _catch$3(function () {
|
6314
|
+
if (versioning) form.version = form.version ? form.version + 1 : 1;
|
6303
6315
|
return Promise.resolve(API.update(form)).then(function () {
|
6304
6316
|
return Promise.resolve(_this10.load()).then(function () {});
|
6305
6317
|
});
|
@@ -6317,6 +6329,7 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
|
|
6317
6329
|
var _this12 = this;
|
6318
6330
|
|
6319
6331
|
var _temp14 = _catch$3(function () {
|
6332
|
+
if (versioning) form.version = form.version ? form.version + 1 : 1;
|
6320
6333
|
return Promise.resolve(API.patch(id, form)).then(function () {
|
6321
6334
|
return Promise.resolve(_this12.load()).then(function () {});
|
6322
6335
|
});
|