ywana-core8 0.0.437 → 0.0.440

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 CHANGED
@@ -1417,6 +1417,30 @@ var Content = /*#__PURE__*/function () {
1417
1417
  return Content;
1418
1418
  }();
1419
1419
 
1420
+ var ColorField = function ColorField(props) {
1421
+ var id = props.id,
1422
+ _props$label = props.label,
1423
+ label = _props$label === void 0 ? "Color" : _props$label,
1424
+ value = props.value,
1425
+ onChange = props.onChange;
1426
+
1427
+ function change(event) {
1428
+ var color = event.target.value;
1429
+ if (onChange) onChange(id, color);
1430
+ }
1431
+
1432
+ return /*#__PURE__*/React__default["default"].createElement("div", {
1433
+ className: "color-field"
1434
+ }, /*#__PURE__*/React__default["default"].createElement("label", {
1435
+ htmlFor: id
1436
+ }, label), /*#__PURE__*/React__default["default"].createElement("input", {
1437
+ id: id,
1438
+ type: "color",
1439
+ onChange: change,
1440
+ value: value
1441
+ }));
1442
+ };
1443
+
1420
1444
  var isFunction$1 = function isFunction(value) {
1421
1445
  return value && (Object.prototype.toString.call(value) === "[object Function]" || "function" === typeof value || value instanceof Function);
1422
1446
  };
@@ -1816,6 +1840,13 @@ var StringCellViewer = function StringCellViewer(_ref7) {
1816
1840
  var locale = window.navigator.userLanguage || window.navigator.language;
1817
1841
 
1818
1842
  switch (format) {
1843
+ case FORMATS.COLOR:
1844
+ text = /*#__PURE__*/React__default["default"].createElement("input", {
1845
+ type: "color",
1846
+ value: text,
1847
+ disabled: true
1848
+ });
1849
+
1819
1850
  case FORMATS.URL:
1820
1851
  text = /*#__PURE__*/React__default["default"].createElement("a", {
1821
1852
  href: text,
@@ -3746,30 +3777,6 @@ var NumberField = function NumberField(_ref3) {
3746
3777
  });
3747
3778
  };
3748
3779
 
3749
- var ColorField = function ColorField(props) {
3750
- var id = props.id,
3751
- _props$label = props.label,
3752
- label = _props$label === void 0 ? "Color" : _props$label,
3753
- value = props.value,
3754
- onChange = props.onChange;
3755
-
3756
- function change(event) {
3757
- var color = event.target.value;
3758
- if (onChange) onChange(id, color);
3759
- }
3760
-
3761
- return /*#__PURE__*/React__default["default"].createElement("div", {
3762
- className: "color-field"
3763
- }, /*#__PURE__*/React__default["default"].createElement("label", {
3764
- htmlFor: id
3765
- }, label), /*#__PURE__*/React__default["default"].createElement("input", {
3766
- id: id,
3767
- type: "color",
3768
- onChange: change,
3769
- value: value
3770
- }));
3771
- };
3772
-
3773
3780
  /**
3774
3781
  * Content Editor
3775
3782
  */
@@ -4682,6 +4689,7 @@ var CollectionPage = function CollectionPage(props) {
4682
4689
  name = _props$name === void 0 ? "Collection 1" : _props$name,
4683
4690
  schema = props.schema,
4684
4691
  url = props.url,
4692
+ page = props.page,
4685
4693
  host = props.host,
4686
4694
  groupBy = props.groupBy,
4687
4695
  editor = props.editor,
@@ -4699,7 +4707,7 @@ var CollectionPage = function CollectionPage(props) {
4699
4707
  pageContext = _useContext[0],
4700
4708
  setPageContext = _useContext[1];
4701
4709
 
4702
- var context = CollectionContext(url, field, host);
4710
+ var context = CollectionContext(url, field, host, page);
4703
4711
  React.useEffect(function () {
4704
4712
  try {
4705
4713
  return Promise.resolve(context.load()).then(function () {
@@ -5021,7 +5029,7 @@ var CollectionEditor = function CollectionEditor(props) {
5021
5029
  */
5022
5030
 
5023
5031
 
5024
- var CollectionContext = function CollectionContext(url, field, host) {
5032
+ var CollectionContext = function CollectionContext(url, field, host, page) {
5025
5033
  var API = CollectionAPI(url, host);
5026
5034
  return {
5027
5035
  all: [],
@@ -5031,7 +5039,7 @@ var CollectionContext = function CollectionContext(url, field, host) {
5031
5039
  var _this2 = this;
5032
5040
 
5033
5041
  var _temp2 = _catch$1(function () {
5034
- return Promise.resolve(API.all()).then(function (data) {
5042
+ return Promise.resolve(API.all(null, page)).then(function (data) {
5035
5043
  _this2.all = field ? data[field] : data;
5036
5044
  });
5037
5045
  }, function (error) {
@@ -5146,8 +5154,8 @@ var CollectionContext = function CollectionContext(url, field, host) {
5146
5154
  var CollectionAPI = function CollectionAPI(url, host) {
5147
5155
  var http = HTTPClient(host || window.API || process.env.REACT_APP_API, Session);
5148
5156
  return {
5149
- all: function all(filters) {
5150
- var queryParams = "?";
5157
+ all: function all(filters, page) {
5158
+ var queryParams = page ? "?page=" + page + "&" : "?";
5151
5159
 
5152
5160
  if (filters) {
5153
5161
  var filterQuery = Object.keys(filters).reduce(function (query, key) {
@@ -5168,7 +5176,7 @@ var CollectionAPI = function CollectionAPI(url, host) {
5168
5176
  queryParams = queryParams.concat(filterQuery);
5169
5177
  }
5170
5178
 
5171
- return http.GET(url);
5179
+ return http.GET(url + queryParams);
5172
5180
  },
5173
5181
  find: function find(id) {
5174
5182
  return http.GET(url + "/" + id);