@webiny/app-headless-cms 5.18.2 → 5.19.0-beta.1

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.
Files changed (42) hide show
  1. package/admin/components/ContentModelEditor/Editor.d.ts +1 -1
  2. package/admin/components/FieldEditor/Styled.d.ts +2 -2
  3. package/admin/contexts/Cms/index.js +5 -2
  4. package/admin/plugins/apiInformation/index.js +7 -3
  5. package/admin/plugins/definitions/CmsEditorFieldValidatorFileTypePlugin.d.ts +21 -0
  6. package/admin/plugins/definitions/CmsEditorFieldValidatorFileTypePlugin.js +61 -0
  7. package/admin/plugins/definitions/CmsFieldValidatorFileTypePlugin.d.ts +10 -0
  8. package/admin/plugins/definitions/CmsFieldValidatorFileTypePlugin.js +36 -0
  9. package/admin/plugins/editor/defaultBar/Divider.d.ts +1 -1
  10. package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsStyled.d.ts +2 -2
  11. package/admin/plugins/editor/defaultBar/Name/NameStyled.d.ts +3 -3
  12. package/admin/plugins/fieldRenderers/file/File.d.ts +12 -11
  13. package/admin/plugins/fieldRenderers/file/File.js +19 -15
  14. package/admin/plugins/fieldRenderers/file/fileField.js +17 -12
  15. package/admin/plugins/fieldRenderers/file/fileFields.js +16 -20
  16. package/admin/plugins/fieldRenderers/ref/components/ContentEntriesAutocomplete.js +17 -7
  17. package/admin/plugins/fieldRenderers/ref/components/createEntryUrl.d.ts +5 -0
  18. package/admin/plugins/fieldRenderers/ref/components/createEntryUrl.js +5 -0
  19. package/admin/plugins/fieldRenderers/ref/components/renderItem.d.ts +7 -1
  20. package/admin/plugins/fieldRenderers/ref/components/renderItem.js +6 -2
  21. package/admin/plugins/fieldRenderers/ref/components/useReference.js +2 -2
  22. package/admin/plugins/fieldRenderers/ref/components/useReferences.js +1 -1
  23. package/admin/plugins/fieldValidators/patternPlugins/lowerCaseSpace.d.ts +3 -0
  24. package/admin/plugins/fieldValidators/patternPlugins/lowerCaseSpace.js +9 -0
  25. package/admin/plugins/fieldValidators/patternPlugins/upperCaseSpace.d.ts +3 -0
  26. package/admin/plugins/fieldValidators/patternPlugins/upperCaseSpace.js +9 -0
  27. package/admin/plugins/fields/file.js +15 -1
  28. package/admin/plugins/fields/ref.js +3 -2
  29. package/admin/plugins/index.d.ts +2 -2
  30. package/admin/plugins/permissionRenderer/components/StyledComponents.d.ts +1 -1
  31. package/admin/plugins/transformers/dateTransformer.js +114 -20
  32. package/admin/plugins/validators/patternPlugins/lowerCaseSpace.d.ts +10 -0
  33. package/admin/plugins/validators/patternPlugins/lowerCaseSpace.js +9 -0
  34. package/admin/plugins/validators/patternPlugins/upperCaseSpace.d.ts +10 -0
  35. package/admin/plugins/validators/patternPlugins/upperCaseSpace.js +9 -0
  36. package/admin/views/contentEntries/ContentEntriesList.js +2 -2
  37. package/admin/views/contentEntries/ContentEntry/ContentEntryContext.js +7 -1
  38. package/admin/views/contentEntries/ContentEntry/cache.js +4 -1
  39. package/admin/views/contentEntries/hooks/useContentEntriesList.d.ts +1 -1
  40. package/admin/views/contentEntries/hooks/useContentEntriesList.js +2 -2
  41. package/package.json +17 -16
  42. package/types.d.ts +2 -1
@@ -1,2 +1,2 @@
1
1
  /// <reference types="react" />
2
- export declare const Note: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "hidden" | "dir" | "slot" | "style" | "title" | "color" | "translate" | "children" | "defaultValue" | "id" | "onError" | "className" | "onBlur" | "onClick" | "onContextMenu" | "onCopy" | "onCut" | "onAuxClick" | "onDoubleClick" | "onDragEnd" | "onDragStart" | "onDrop" | "onFocus" | "onInput" | "onInvalid" | "onKeyDown" | "onKeyPress" | "onKeyUp" | "onMouseDown" | "onMouseUp" | "onPaste" | "onPause" | "onPlay" | "onPointerCancel" | "onPointerDown" | "onPointerUp" | "onRateChange" | "onReset" | "onSeeked" | "onSubmit" | "onTouchCancel" | "onTouchEnd" | "onTouchStart" | "onVolumeChange" | "onAbort" | "onAnimationEnd" | "onAnimationIteration" | "onAnimationStart" | "onCanPlay" | "onCanPlayThrough" | "onDrag" | "onDragEnter" | "onDragExit" | "onDragLeave" | "onDragOver" | "onDurationChange" | "onEmptied" | "onEncrypted" | "onEnded" | "onGotPointerCapture" | "onLoad" | "onLoadedData" | "onLoadedMetadata" | "onLoadStart" | "onLostPointerCapture" | "onMouseMove" | "onMouseOut" | "onMouseOver" | "onPlaying" | "onPointerMove" | "onPointerOut" | "onPointerOver" | "onProgress" | "onScroll" | "onSeeking" | "onStalled" | "onSuspend" | "onTimeUpdate" | "onTouchMove" | "onTransitionEnd" | "onWaiting" | "onWheel" | "onMouseEnter" | "onMouseLeave" | "onPointerEnter" | "onPointerLeave" | "onChange" | "onSelect" | "onBeforeInput" | "onCompositionEnd" | "onCompositionStart" | "onCompositionUpdate" | "placeholder" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "spellCheck" | "tabIndex" | "inputMode" | "is" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopyCapture" | "onCutCapture" | "onPasteCapture" | "onCompositionEndCapture" | "onCompositionStartCapture" | "onCompositionUpdateCapture" | "onFocusCapture" | "onBlurCapture" | "onChangeCapture" | "onBeforeInputCapture" | "onInputCapture" | "onResetCapture" | "onSubmitCapture" | "onInvalidCapture" | "onLoadCapture" | "onErrorCapture" | "onKeyDownCapture" | "onKeyPressCapture" | "onKeyUpCapture" | "onAbortCapture" | "onCanPlayCapture" | "onCanPlayThroughCapture" | "onDurationChangeCapture" | "onEmptiedCapture" | "onEncryptedCapture" | "onEndedCapture" | "onLoadedDataCapture" | "onLoadedMetadataCapture" | "onLoadStartCapture" | "onPauseCapture" | "onPlayCapture" | "onPlayingCapture" | "onProgressCapture" | "onRateChangeCapture" | "onSeekedCapture" | "onSeekingCapture" | "onStalledCapture" | "onSuspendCapture" | "onTimeUpdateCapture" | "onVolumeChangeCapture" | "onWaitingCapture" | "onAuxClickCapture" | "onClickCapture" | "onContextMenuCapture" | "onDoubleClickCapture" | "onDragCapture" | "onDragEndCapture" | "onDragEnterCapture" | "onDragExitCapture" | "onDragLeaveCapture" | "onDragOverCapture" | "onDragStartCapture" | "onDropCapture" | "onMouseDownCapture" | "onMouseMoveCapture" | "onMouseOutCapture" | "onMouseOverCapture" | "onMouseUpCapture" | "onSelectCapture" | "onTouchCancelCapture" | "onTouchEndCapture" | "onTouchMoveCapture" | "onTouchStartCapture" | "onPointerDownCapture" | "onPointerMoveCapture" | "onPointerUpCapture" | "onPointerCancelCapture" | "onPointerEnterCapture" | "onPointerLeaveCapture" | "onPointerOverCapture" | "onPointerOutCapture" | "onGotPointerCaptureCapture" | "onLostPointerCaptureCapture" | "onScrollCapture" | "onWheelCapture" | "onAnimationStartCapture" | "onAnimationEndCapture" | "onAnimationIterationCapture" | "onTransitionEndCapture">, object>;
2
+ export declare const Note: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "color" | "translate" | "children" | "slot" | "style" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture">, object>;
@@ -1,14 +1,117 @@
1
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
1
2
  import WebinyError from "@webiny/error";
2
3
 
3
- var transformDate = function transformDate(value, type) {
4
- if (type === "date") {
5
- return value.substr(0, 10);
4
+ var throwTransformError = function throwTransformError(params) {
5
+ var type = params.type,
6
+ value = params.value,
7
+ error = params.ex;
8
+ throw new WebinyError("Could not transform value to a date.", "TRANSFORM_ERROR", {
9
+ error: error,
10
+ type: type,
11
+ value: value
12
+ });
13
+ };
14
+
15
+ var dateOnly = function dateOnly(value) {
16
+ try {
17
+ var date = new Date(value).toISOString();
18
+ return date.substr(0, 10);
19
+ } catch (ex) {
20
+ throwTransformError({
21
+ ex: ex,
22
+ value: value,
23
+ type: "date"
24
+ });
6
25
  }
26
+ };
7
27
 
8
- return value;
28
+ var extractTimeZone = function extractTimeZone(value) {
29
+ var result;
30
+
31
+ if (value.includes("+")) {
32
+ result = value.split("+");
33
+ } else {
34
+ result = value.split("-");
35
+ }
36
+
37
+ if (!result || result.length !== 2) {
38
+ throw new WebinyError("Could not determine time and timezone out of given value.", "TIME_ZONE_ERROR", {
39
+ value: value
40
+ });
41
+ }
42
+
43
+ return result;
9
44
  };
10
45
 
11
- var excludeTypesTransformation = ["time", "dateTimeWithTimezone"];
46
+ var extractTime = function extractTime(value) {
47
+ if (value.includes(":") === false) {
48
+ throw new WebinyError("Time value is missing : separators.", "TIME_ERROR", {
49
+ value: value
50
+ });
51
+ }
52
+
53
+ var result = value.split(":");
54
+
55
+ if (result.length === 3) {
56
+ return value;
57
+ } else if (result.length === 2) {
58
+ return "".concat(value, ":00");
59
+ }
60
+ };
61
+
62
+ var dateTimeWithTimezone = function dateTimeWithTimezone(value) {
63
+ if (value.includes("T") === false) {
64
+ return value;
65
+ }
66
+
67
+ var _value$split = value.split("T"),
68
+ _value$split2 = _slicedToArray(_value$split, 2),
69
+ initialDate = _value$split2[0],
70
+ initialTimeZone = _value$split2[1];
71
+
72
+ var date;
73
+
74
+ try {
75
+ var dateObj = new Date(initialDate);
76
+ date = dateObj.toISOString().substr(0, 10);
77
+ } catch (ex) {
78
+ throw new WebinyError("Could not transform received date into Date object.", "DATE_TRANSFORM_ERROR", {
79
+ value: value,
80
+ date: initialDate,
81
+ time: initialTimeZone
82
+ });
83
+ }
84
+
85
+ var _extractTimeZone = extractTimeZone(initialTimeZone),
86
+ _extractTimeZone2 = _slicedToArray(_extractTimeZone, 1),
87
+ initialTime = _extractTimeZone2[0];
88
+
89
+ var time = extractTime(initialTime);
90
+ return value.replace(initialDate, date).replace(initialTime, time);
91
+ };
92
+
93
+ var dateTimeWithoutTimezone = function dateTimeWithoutTimezone(value) {
94
+ if (value.includes(" ") === false) {
95
+ return value;
96
+ }
97
+
98
+ try {
99
+ return new Date("".concat(value.replace(" ", "T"), ".000Z")).toISOString();
100
+ } catch (ex) {
101
+ throwTransformError({
102
+ ex: ex,
103
+ value: value,
104
+ type: "dateTimeWithoutTimezone"
105
+ });
106
+ }
107
+ };
108
+
109
+ var transformers = {
110
+ time: null,
111
+ date: dateOnly,
112
+ dateTimeWithoutTimezone: dateTimeWithoutTimezone,
113
+ dateTimeWithTimezone: dateTimeWithTimezone
114
+ };
12
115
  export default (function () {
13
116
  return {
14
117
  type: "cms-field-value-transformer",
@@ -21,24 +124,15 @@ export default (function () {
21
124
  if (!value) {
22
125
  console.log("Field \"".concat(field.fieldId, "\" has no value."));
23
126
  return null;
24
- } else if (excludeTypesTransformation.includes(type) === true) {
25
- return value;
26
- } else if (type === "dateTimeWithoutTimezone" && value.includes(" ")) {
27
- /**
28
- * Need to replace space and add .000Z to datetime value because it can look like: 2021-02-02 16:34:56
29
- */
30
- value = "".concat(value.replace(" ", "T"), ".000Z");
31
127
  }
32
128
 
33
- try {
34
- var result = new Date(value).toISOString();
35
- return transformDate(result, type);
36
- } catch (ex) {
37
- throw new WebinyError("Could not transform \"".concat(value, "\" to a date."), "TRANSFORM_ERROR", {
38
- message: ex.message,
39
- code: ex.code
40
- });
129
+ var transform = transformers[type];
130
+
131
+ if (!transform) {
132
+ return value;
41
133
  }
134
+
135
+ return transform(value);
42
136
  }
43
137
  };
44
138
  });
@@ -0,0 +1,10 @@
1
+ declare const _default: {
2
+ type: string;
3
+ name: string;
4
+ pattern: {
5
+ name: string;
6
+ regex: string;
7
+ flags: string;
8
+ };
9
+ };
10
+ export default _default;
@@ -0,0 +1,9 @@
1
+ export default {
2
+ type: "cms-model-field-validator-pattern",
3
+ name: "cms-model-field-validator-pattern-lower-case-space",
4
+ pattern: {
5
+ name: "lowerCaseSpace",
6
+ regex: "^([a-z\\s]+)$",
7
+ flags: ""
8
+ }
9
+ };
@@ -0,0 +1,10 @@
1
+ declare const _default: {
2
+ type: string;
3
+ name: string;
4
+ pattern: {
5
+ name: string;
6
+ regex: string;
7
+ flags: string;
8
+ };
9
+ };
10
+ export default _default;
@@ -0,0 +1,9 @@
1
+ export default {
2
+ type: "cms-model-field-validator-pattern",
3
+ name: "cms-model-field-validator-pattern-upper-case-space",
4
+ pattern: {
5
+ name: "upperCaseSpace",
6
+ regex: "^([A-Z\\s]+)$",
7
+ flags: ""
8
+ }
9
+ };
@@ -55,7 +55,7 @@ var listItemMinHeight = /*#__PURE__*/css({
55
55
  var ContentEntriesList = function ContentEntriesList() {
56
56
  var _useContentEntriesLis = useContentEntriesList(),
57
57
  contentModel = _useContentEntriesLis.contentModel,
58
- entryId = _useContentEntriesLis.entryId,
58
+ id = _useContentEntriesLis.id,
59
59
  loading = _useContentEntriesLis.loading,
60
60
  canCreate = _useContentEntriesLis.canCreate,
61
61
  onCreate = _useContentEntriesLis.onCreate,
@@ -159,7 +159,7 @@ var ContentEntriesList = function ContentEntriesList() {
159
159
  return /*#__PURE__*/React.createElement(UIList.ListItem, {
160
160
  key: item.id,
161
161
  className: listItemMinHeight,
162
- selected: item.id === entryId
162
+ selected: item.id === id
163
163
  }, /*#__PURE__*/React.createElement(UIList.ListItemText, {
164
164
  onClick: editEntry(item)
165
165
  }, item.meta.title || "Untitled", /*#__PURE__*/React.createElement(UIList.ListItemTextSecondary, null, t(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["Last modified: {time}."])))({
@@ -7,6 +7,7 @@ import { useSnackbar } from "@webiny/app-admin/hooks/useSnackbar";
7
7
  import * as GQL from "../../../graphql/contentEntries";
8
8
  import { useQuery } from "../../../hooks";
9
9
  import { useContentEntries } from "../hooks/useContentEntries";
10
+ import { parseIdentifier } from "@webiny/utils";
10
11
  export var Context = /*#__PURE__*/React.createContext(null);
11
12
  export var Provider = function Provider(_ref) {
12
13
  var children = _ref.children;
@@ -37,7 +38,12 @@ export var Provider = function Provider(_ref) {
37
38
  var query = new URLSearchParams(location.search);
38
39
  var contentId = query.get("id");
39
40
  var revisionId = contentId ? decodeURIComponent(contentId) : null;
40
- var entryId = revisionId ? revisionId.split("#")[0] : null;
41
+ var entryId = null;
42
+
43
+ if (revisionId) {
44
+ var result = parseIdentifier(revisionId);
45
+ entryId = result ? result.id : null;
46
+ }
41
47
 
42
48
  var _useMemo = useMemo(function () {
43
49
  return {
@@ -4,6 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import dotProp from "dot-prop-immutable";
5
5
  import orderBy from "lodash/orderBy";
6
6
  import * as GQL from "../../../graphql/contentEntries";
7
+ import { parseIdentifier } from "@webiny/utils";
7
8
  /*
8
9
  * We need to preserve the order of entries with new entry addition
9
10
  * because we're not re-fetching the list but updating it directly inside cache.
@@ -89,7 +90,9 @@ export var removeEntryFromListCache = function removeEntryFromListCache(model, c
89
90
  return;
90
91
  }
91
92
 
92
- var entryId = revision.id.split("#")[0];
93
+ var _parseIdentifier = parseIdentifier(revision.id),
94
+ entryId = _parseIdentifier.id;
95
+
93
96
  var index = content.data.findIndex(function (item) {
94
97
  return item.id.startsWith(entryId);
95
98
  });
@@ -8,7 +8,7 @@ export declare function useContentEntriesList(): {
8
8
  label: string;
9
9
  value: string;
10
10
  }[];
11
- entryId: string;
11
+ id: string;
12
12
  loading: boolean;
13
13
  data: any;
14
14
  loadMore: () => void;
@@ -35,7 +35,7 @@ export function useContentEntriesList() {
35
35
  var baseUrl = "/cms/content-entries/".concat(contentModel.modelId); // Get entry ID and search query (if any)
36
36
 
37
37
  var query = new URLSearchParams(location.search);
38
- var entryId = query.get("id");
38
+ var id = query.get("id");
39
39
  var searchQuery = query.get("search");
40
40
  var updateSearch = useCallback(debounce(function (_ref) {
41
41
  var filter = _ref.filter,
@@ -138,7 +138,7 @@ export function useContentEntriesList() {
138
138
  listQueryVariables: listQueryVariables,
139
139
  setListQueryVariables: setListQueryVariables,
140
140
  sorters: sorters,
141
- entryId: entryId,
141
+ id: id,
142
142
  loading: loading,
143
143
  data: filterByStatus(get(data, "content.data", []), listQueryVariables.status),
144
144
  loadMore: loadMore,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-headless-cms",
3
- "version": "5.18.2",
3
+ "version": "5.19.0-beta.1",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,18 +24,19 @@
24
24
  "@fortawesome/react-fontawesome": "0.1.16",
25
25
  "@svgr/webpack": "4.3.3",
26
26
  "@types/react": "16.14.2",
27
- "@webiny/app": "5.18.2",
28
- "@webiny/app-admin": "5.18.2",
29
- "@webiny/app-graphql-playground": "5.18.2",
30
- "@webiny/app-i18n": "5.18.2",
31
- "@webiny/app-plugin-admin-welcome-screen": "5.18.2",
32
- "@webiny/app-security": "5.18.2",
33
- "@webiny/error": "5.18.2",
34
- "@webiny/form": "5.18.2",
35
- "@webiny/plugins": "5.18.2",
36
- "@webiny/react-router": "5.18.2",
37
- "@webiny/ui": "5.18.2",
38
- "@webiny/validation": "5.18.2",
27
+ "@webiny/app": "5.19.0-beta.1",
28
+ "@webiny/app-admin": "5.19.0-beta.1",
29
+ "@webiny/app-graphql-playground": "5.19.0-beta.1",
30
+ "@webiny/app-i18n": "5.19.0-beta.1",
31
+ "@webiny/app-plugin-admin-welcome-screen": "5.19.0-beta.1",
32
+ "@webiny/app-security": "5.19.0-beta.1",
33
+ "@webiny/error": "5.19.0-beta.1",
34
+ "@webiny/form": "5.19.0-beta.1",
35
+ "@webiny/plugins": "5.19.0-beta.1",
36
+ "@webiny/react-router": "5.19.0-beta.1",
37
+ "@webiny/ui": "5.19.0-beta.1",
38
+ "@webiny/utils": "5.19.0-beta.1",
39
+ "@webiny/validation": "5.19.0-beta.1",
39
40
  "apollo-cache": "1.3.5",
40
41
  "apollo-client": "2.6.10",
41
42
  "apollo-link": "1.2.14",
@@ -66,8 +67,8 @@
66
67
  "@babel/preset-env": "^7.5.5",
67
68
  "@babel/preset-react": "^7.0.0",
68
69
  "@babel/preset-typescript": "^7.8.3",
69
- "@webiny/cli": "^5.18.2",
70
- "@webiny/project-utils": "^5.18.2",
70
+ "@webiny/cli": "^5.19.0-beta.1",
71
+ "@webiny/project-utils": "^5.19.0-beta.1",
71
72
  "babel-plugin-emotion": "^9.2.8",
72
73
  "babel-plugin-lodash": "^3.3.4",
73
74
  "babel-plugin-module-resolver": "^4.1.0",
@@ -105,5 +106,5 @@
105
106
  ]
106
107
  }
107
108
  },
108
- "gitHead": "9b14763c1769d89fd0fae96da00e6221d527595f"
109
+ "gitHead": "dd406fbad0620ecce47063e9afbff40c502c3844"
109
110
  }
package/types.d.ts CHANGED
@@ -316,6 +316,7 @@ export interface CmsEditorFieldValidatorPlugin extends Plugin {
316
316
  label: string;
317
317
  description: string;
318
318
  defaultMessage: string;
319
+ defaultSettings?: Record<string, any>;
319
320
  renderSettings?: (props: {
320
321
  field: CmsEditorField;
321
322
  Bind: BindComponent;
@@ -356,7 +357,7 @@ export interface CmsModelFieldValidatorPlugin extends Plugin {
356
357
  type: "cms-model-field-validator";
357
358
  validator: {
358
359
  name: string;
359
- validate: (value: any, validator: CmsFieldValidator) => Promise<any>;
360
+ validate: (value: any, validator: CmsFieldValidator | any) => Promise<any>;
360
361
  };
361
362
  }
362
363
  /**