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.cjs
CHANGED
@@ -3645,7 +3645,10 @@ var SiteProvider = function SiteProvider(_ref) {
|
|
3645
3645
|
var title = _ref2.title,
|
3646
3646
|
body = _ref2.body,
|
3647
3647
|
_ref2$type = _ref2.type,
|
3648
|
-
type = _ref2$type === void 0 ? "success" : _ref2$type
|
3648
|
+
type = _ref2$type === void 0 ? "success" : _ref2$type,
|
3649
|
+
_ref2$duration = _ref2.duration,
|
3650
|
+
duration = _ref2$duration === void 0 ? 3000 : _ref2$duration,
|
3651
|
+
onRemoval = _ref2.onRemoval;
|
3649
3652
|
reactNotificationsComponent.Store.addNotification({
|
3650
3653
|
title: title,
|
3651
3654
|
message: body,
|
@@ -3655,9 +3658,10 @@ var SiteProvider = function SiteProvider(_ref) {
|
|
3655
3658
|
animationIn: ["animate__animated", "animate__fadeIn"],
|
3656
3659
|
animationOut: ["animate__animated", "animate__fadeOut"],
|
3657
3660
|
dismiss: {
|
3658
|
-
duration:
|
3661
|
+
duration: duration,
|
3659
3662
|
onScreen: true
|
3660
|
-
}
|
3663
|
+
},
|
3664
|
+
onRemoval: onRemoval
|
3661
3665
|
});
|
3662
3666
|
}
|
3663
3667
|
};
|
@@ -5676,6 +5680,8 @@ var CollectionPage = function CollectionPage(props) {
|
|
5676
5680
|
delay = _props$delay === void 0 ? 1000 : _props$delay,
|
5677
5681
|
_props$patch = props.patch,
|
5678
5682
|
patch = _props$patch === void 0 ? false : _props$patch,
|
5683
|
+
_props$versioning = props.versioning,
|
5684
|
+
versioning = _props$versioning === void 0 ? false : _props$versioning,
|
5679
5685
|
groupBy = props.groupBy,
|
5680
5686
|
levels = props.levels,
|
5681
5687
|
sorter = props.sorter,
|
@@ -5683,12 +5689,12 @@ var CollectionPage = function CollectionPage(props) {
|
|
5683
5689
|
editor = props.editor,
|
5684
5690
|
footer = props.footer,
|
5685
5691
|
children = props.children;
|
5692
|
+
var context = CollectionContext(url, field, host, page, fetching, versioning);
|
5686
5693
|
|
5687
5694
|
var _useContext = React.useContext(PageContext),
|
5688
5695
|
pageContext = _useContext[0],
|
5689
5696
|
setPageContext = _useContext[1];
|
5690
5697
|
|
5691
|
-
var context = CollectionContext(url, field, host, page, fetching);
|
5692
5698
|
var all = pageContext.all;
|
5693
5699
|
React.useEffect(function () {
|
5694
5700
|
try {
|
@@ -6212,7 +6218,11 @@ var CollectionEditor = function CollectionEditor(props) {
|
|
6212
6218
|
*/
|
6213
6219
|
|
6214
6220
|
|
6215
|
-
var CollectionContext = function CollectionContext(url, field, host, page, fetching) {
|
6221
|
+
var CollectionContext = function CollectionContext(url, field, host, page, fetching, versioning) {
|
6222
|
+
if (versioning === void 0) {
|
6223
|
+
versioning = false;
|
6224
|
+
}
|
6225
|
+
|
6216
6226
|
var API = CollectionAPI(url, host);
|
6217
6227
|
return {
|
6218
6228
|
all: [],
|
@@ -6291,6 +6301,7 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
|
|
6291
6301
|
var _this8 = this;
|
6292
6302
|
|
6293
6303
|
var _temp10 = _catch$3(function () {
|
6304
|
+
if (versioning) form.version = 1;
|
6294
6305
|
return Promise.resolve(API.create(form)).then(function () {
|
6295
6306
|
return Promise.resolve(_this8.load()).then(function () {});
|
6296
6307
|
});
|
@@ -6308,6 +6319,7 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
|
|
6308
6319
|
var _this10 = this;
|
6309
6320
|
|
6310
6321
|
var _temp12 = _catch$3(function () {
|
6322
|
+
if (versioning) form.version = form.version ? form.version + 1 : 1;
|
6311
6323
|
return Promise.resolve(API.update(form)).then(function () {
|
6312
6324
|
return Promise.resolve(_this10.load()).then(function () {});
|
6313
6325
|
});
|
@@ -6325,6 +6337,7 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
|
|
6325
6337
|
var _this12 = this;
|
6326
6338
|
|
6327
6339
|
var _temp14 = _catch$3(function () {
|
6340
|
+
if (versioning) form.version = form.version ? form.version + 1 : 1;
|
6328
6341
|
return Promise.resolve(API.patch(id, form)).then(function () {
|
6329
6342
|
return Promise.resolve(_this12.load()).then(function () {});
|
6330
6343
|
});
|