@webiny/app-headless-cms 5.20.0 → 5.22.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 (107) hide show
  1. package/HeadlessCMS.d.ts +12 -0
  2. package/HeadlessCMS.js +27 -0
  3. package/admin/components/ContentEntryForm/useContentEntryForm.js +101 -12
  4. package/admin/components/ContentModelEditor/Context.js +3 -1
  5. package/admin/components/ContentModelEditor/Editor.d.ts +1 -1
  6. package/admin/components/ContentModelEditor/Editor.js +1 -1
  7. package/admin/components/Draggable.d.ts +3 -2
  8. package/admin/components/Draggable.js +5 -3
  9. package/admin/components/Droppable.d.ts +3 -2
  10. package/admin/components/Droppable.js +5 -3
  11. package/admin/components/FieldEditor/EditFieldDialog/PredefinedValues.d.ts +10 -5
  12. package/admin/components/FieldEditor/EditFieldDialog/PredefinedValues.js +9 -5
  13. package/admin/components/FieldEditor/Field.js +4 -4
  14. package/admin/components/FieldEditor/FieldEditor.js +1 -1
  15. package/admin/components/FieldEditor/Styled.d.ts +2 -2
  16. package/admin/contexts/Cms/index.d.ts +1 -2
  17. package/admin/elements/ContentGroupMenuElement.js +2 -1
  18. package/admin/elements/ContentModelMenuElement.js +2 -1
  19. package/admin/elements/NothingToShowElement.js +1 -1
  20. package/admin/graphql/contentModels.d.ts +1 -1
  21. package/admin/graphql/contentModels.js +1 -1
  22. package/admin/hooks/usePermission.d.ts +2 -2
  23. package/admin/menus/CmsMenuLoader.d.ts +2 -0
  24. package/admin/menus/CmsMenuLoader.js +39 -0
  25. package/admin/menus/ContentGroupsMenuItems.d.ts +1 -0
  26. package/admin/menus/ContentGroupsMenuItems.js +88 -0
  27. package/admin/{plugins/menus → menus}/GlobalSearchPlugins.d.ts +0 -0
  28. package/admin/{plugins/menus → menus}/GlobalSearchPlugins.js +2 -2
  29. package/admin/menus/NothingToShowElement.d.ts +2 -0
  30. package/admin/menus/NothingToShowElement.js +42 -0
  31. package/admin/plugins/editor/defaultBar/BackButton.js +1 -1
  32. package/admin/plugins/editor/defaultBar/CreateContentButton.js +1 -1
  33. package/admin/plugins/editor/defaultBar/Divider.d.ts +1 -1
  34. package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsButton.js +1 -1
  35. package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsStyled.d.ts +2 -2
  36. package/admin/plugins/editor/defaultBar/Name/NameStyled.d.ts +3 -3
  37. package/admin/plugins/editor/formSettings/index.js +1 -1
  38. package/admin/plugins/fieldRenderers/DynamicSection.js +1 -1
  39. package/admin/plugins/fieldRenderers/checkboxes.js +18 -15
  40. package/admin/plugins/fieldRenderers/dateTime/DateOnly.d.ts +9 -0
  41. package/admin/plugins/fieldRenderers/dateTime/DateOnly.js +39 -0
  42. package/admin/plugins/fieldRenderers/dateTime/DateTimeWithTimezone.d.ts +2 -3
  43. package/admin/plugins/fieldRenderers/dateTime/DateTimeWithTimezone.js +61 -59
  44. package/admin/plugins/fieldRenderers/dateTime/DateTimeWithoutTimezone.d.ts +4 -4
  45. package/admin/plugins/fieldRenderers/dateTime/DateTimeWithoutTimezone.js +52 -51
  46. package/admin/plugins/fieldRenderers/dateTime/Input.d.ts +6 -7
  47. package/admin/plugins/fieldRenderers/dateTime/Input.js +2 -5
  48. package/admin/plugins/fieldRenderers/dateTime/Select.d.ts +10 -3
  49. package/admin/plugins/fieldRenderers/dateTime/Select.js +2 -5
  50. package/admin/plugins/fieldRenderers/dateTime/Time.d.ts +3 -3
  51. package/admin/plugins/fieldRenderers/dateTime/Time.js +33 -9
  52. package/admin/plugins/fieldRenderers/dateTime/dateTimeField.js +8 -13
  53. package/admin/plugins/fieldRenderers/dateTime/dateTimeFields.js +9 -13
  54. package/admin/plugins/fieldRenderers/dateTime/utils.d.ts +7 -6
  55. package/admin/plugins/fieldRenderers/dateTime/utils.js +51 -9
  56. package/admin/plugins/fieldRenderers/file/File.js +2 -2
  57. package/admin/plugins/fieldRenderers/file/utils.d.ts +1 -1
  58. package/admin/plugins/fieldRenderers/file/utils.js +2 -2
  59. package/admin/plugins/fieldRenderers/longText/longTexts.js +1 -1
  60. package/admin/plugins/fieldRenderers/number/numberInputs.js +1 -1
  61. package/admin/plugins/fieldRenderers/object/multipleObjects.js +1 -1
  62. package/admin/plugins/fieldRenderers/radioButtons.js +4 -3
  63. package/admin/plugins/fieldRenderers/richText/richTextInputs.js +1 -1
  64. package/admin/plugins/fieldRenderers/text/textInputs.js +1 -1
  65. package/admin/plugins/fieldValidators/date/createDateInputField.js +8 -13
  66. package/admin/plugins/fieldValidators/unique.d.ts +3 -0
  67. package/admin/plugins/fieldValidators/unique.js +12 -0
  68. package/admin/plugins/fields/PredefinedValuesDynamicFieldset.d.ts +7 -4
  69. package/admin/plugins/fields/PredefinedValuesDynamicFieldset.js +88 -53
  70. package/admin/plugins/fields/boolean.js +19 -2
  71. package/admin/plugins/fields/dateTime.js +17 -6
  72. package/admin/plugins/fields/file.js +1 -1
  73. package/admin/plugins/fields/longText.js +1 -1
  74. package/admin/plugins/fields/number.js +1 -1
  75. package/admin/plugins/fields/object.js +1 -1
  76. package/admin/plugins/fields/ref.js +1 -1
  77. package/admin/plugins/fields/richText.js +1 -1
  78. package/admin/plugins/fields/text.js +2 -2
  79. package/admin/plugins/index.d.ts +1 -7
  80. package/admin/plugins/index.js +1 -3
  81. package/admin/plugins/install.js +1 -1
  82. package/admin/plugins/permissionRenderer/components/StyledComponents.d.ts +1 -1
  83. package/admin/plugins/permissionRenderer/index.js +1 -1
  84. package/admin/plugins/transformers/dateTransformer.js +5 -7
  85. package/admin/plugins/validators/unique.d.ts +7 -0
  86. package/admin/plugins/validators/unique.js +38 -0
  87. package/admin/views/contentEntries/ContentEntriesList.js +2 -2
  88. package/admin/views/contentEntries/ContentEntry/RevisionListItem.js +9 -9
  89. package/admin/views/contentEntries/ContentEntry/header/contentFormOptionsMenu/ContentFormOptionsMenu.js +2 -2
  90. package/admin/views/contentEntries/ContentEntry/header/requestChanges/RequestChanges.js +1 -1
  91. package/admin/views/contentEntries/ContentEntry/header/requestReview/RequestReview.js +1 -1
  92. package/admin/views/contentEntries/ContentEntry/header/revisionSelector/RevisionSelector.js +1 -1
  93. package/admin/views/contentEntries/ContentEntry.js +1 -1
  94. package/admin/views/contentModelGroups/ContentModelGroupsDataList.js +2 -2
  95. package/admin/views/contentModelGroups/ContentModelGroupsForm.js +1 -1
  96. package/admin/views/contentModels/ContentModelEditor.js +2 -8
  97. package/admin/views/contentModels/ContentModelsDataList.js +4 -4
  98. package/index.d.ts +1 -0
  99. package/index.js +1 -0
  100. package/package.json +31 -37
  101. package/types.d.ts +4 -1
  102. package/admin/plugins/menus/CmsMenuLoader.d.ts +0 -7
  103. package/admin/plugins/menus/CmsMenuLoader.js +0 -76
  104. package/admin/plugins/menus/ContentGroupsMenuItems.d.ts +0 -6
  105. package/admin/plugins/menus/ContentGroupsMenuItems.js +0 -154
  106. package/admin/plugins/menus.d.ts +0 -4
  107. package/admin/plugins/menus.js +0 -19
@@ -66,7 +66,7 @@ var plugin = {
66
66
  name: "admin-installation-cms",
67
67
  type: "admin-installation",
68
68
  title: t(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["Headless CMS"]))),
69
- dependencies: ["admin-installation-security", "admin-installation-i18n"],
69
+ dependencies: ["admin-installation-security", "admin-installation-i18n", "admin-installation-fm"],
70
70
  secure: true,
71
71
  getInstalledVersion: function getInstalledVersion(_ref3) {
72
72
  return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
@@ -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>, "children" | "style" | "slot" | "title" | "onError" | "color" | "translate" | "hidden" | "className" | "id" | "lang" | "role" | "tabIndex" | "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" | "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" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "placeholder" | "spellCheck" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is">, object>;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { AccordionItem } from "@webiny/ui/Accordion";
3
- import { ReactComponent as HeadlessCMSIcon } from "@svgr/webpack!../../icons/devices_other-black-24px.svg";
3
+ import { ReactComponent as HeadlessCMSIcon } from "../../icons/devices_other-black-24px.svg";
4
4
  import { CMSPermissions } from "./CmsPermissions";
5
5
  export default {
6
6
  type: "admin-app-permissions-renderer",
@@ -14,7 +14,7 @@ var throwTransformError = function throwTransformError(params) {
14
14
 
15
15
  var dateOnly = function dateOnly(value) {
16
16
  if (!value) {
17
- return new Date().toISOString().substr(0, 10);
17
+ return null; // return new Date().toISOString().substr(0, 10);
18
18
  }
19
19
 
20
20
  try {
@@ -51,7 +51,7 @@ var extractTimeZone = function extractTimeZone(value) {
51
51
 
52
52
  var extractTime = function extractTime(value) {
53
53
  if (!value) {
54
- return "00:00:00";
54
+ return null;
55
55
  } else if (value.includes(":") === false) {
56
56
  throw new WebinyError("Time value is missing : separators.", "TIME_ERROR", {
57
57
  value: value
@@ -69,9 +69,7 @@ var extractTime = function extractTime(value) {
69
69
 
70
70
  var dateTimeWithTimezone = function dateTimeWithTimezone(value) {
71
71
  if (!value) {
72
- var _date = new Date().toISOString();
73
-
74
- return _date.replace(/\.([0-9]+)Z/, "+00:00");
72
+ return null;
75
73
  } else if (value.includes("T") === false) {
76
74
  return value;
77
75
  }
@@ -104,7 +102,7 @@ var dateTimeWithTimezone = function dateTimeWithTimezone(value) {
104
102
 
105
103
  var dateTimeWithoutTimezone = function dateTimeWithoutTimezone(value) {
106
104
  if (!value) {
107
- return new Date().toISOString();
105
+ return null;
108
106
  } else if (value.includes(" ") === false) {
109
107
  return value;
110
108
  }
@@ -122,7 +120,7 @@ var dateTimeWithoutTimezone = function dateTimeWithoutTimezone(value) {
122
120
 
123
121
  var time = function time(value) {
124
122
  if (!value) {
125
- return "00:00:00";
123
+ return null;
126
124
  }
127
125
 
128
126
  return extractTime(value);
@@ -0,0 +1,7 @@
1
+ import { CmsModelFieldValidatorPlugin } from "../../../types";
2
+ declare const _default: () => CmsModelFieldValidatorPlugin;
3
+ /**
4
+ * In the UI we will pretend that field is unique.
5
+ * When saving the entry, API call will check for the uniqueness.
6
+ */
7
+ export default _default;
@@ -0,0 +1,38 @@
1
+ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
+ import _regeneratorRuntime from "@babel/runtime/regenerator";
3
+
4
+ /**
5
+ * In the UI we will pretend that field is unique.
6
+ * When saving the entry, API call will check for the uniqueness.
7
+ */
8
+ export default (function () {
9
+ return {
10
+ type: "cms-model-field-validator",
11
+ name: "cms-model-field-validator-unique",
12
+ validator: {
13
+ name: "unique",
14
+ validate: function () {
15
+ var _validate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
16
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
17
+ while (1) {
18
+ switch (_context.prev = _context.next) {
19
+ case 0:
20
+ return _context.abrupt("return", true);
21
+
22
+ case 1:
23
+ case "end":
24
+ return _context.stop();
25
+ }
26
+ }
27
+ }, _callee);
28
+ }));
29
+
30
+ function validate() {
31
+ return _validate.apply(this, arguments);
32
+ }
33
+
34
+ return validate;
35
+ }()
36
+ }
37
+ };
38
+ });
@@ -17,8 +17,8 @@ import { ButtonIcon, ButtonSecondary } from "@webiny/ui/Button";
17
17
  import { Cell, Grid } from "@webiny/ui/Grid";
18
18
  import { Select } from "@webiny/ui/Select";
19
19
  import { Scrollbar } from "@webiny/ui/Scrollbar";
20
- import { ReactComponent as AddIcon } from "@svgr/webpack!@webiny/app-admin/assets/icons/add-18px.svg";
21
- import { ReactComponent as FilterIcon } from "@svgr/webpack!@webiny/app-admin/assets/icons/filter-24px.svg";
20
+ import { ReactComponent as AddIcon } from "@webiny/app-admin/assets/icons/add-18px.svg";
21
+ import { ReactComponent as FilterIcon } from "@webiny/app-admin/assets/icons/filter-24px.svg";
22
22
  import SearchUI from "@webiny/app-admin/components/SearchUI";
23
23
  import statusLabels from "../../constants/statusLabels";
24
24
  import { useCallback } from "react";
@@ -11,15 +11,15 @@ import { Icon } from "@webiny/ui/Icon";
11
11
  import { MenuItem, Menu, MenuDivider } from "@webiny/ui/Menu";
12
12
  import { ConfirmationDialog } from "@webiny/ui/ConfirmationDialog";
13
13
  import { Tooltip } from "@webiny/ui/Tooltip";
14
- import { ReactComponent as MoreVerticalIcon } from "@svgr/webpack!../../../icons/more_vert.svg";
15
- import { ReactComponent as LockIcon } from "@svgr/webpack!../../../icons/lock.svg";
16
- import { ReactComponent as BeenHereIcon } from "@svgr/webpack!../../../icons/beenhere.svg";
17
- import { ReactComponent as GestureIcon } from "@svgr/webpack!../../../icons/gesture.svg";
18
- import { ReactComponent as AddIcon } from "@svgr/webpack!../../../icons/add.svg";
19
- import { ReactComponent as EditIcon } from "@svgr/webpack!../../../icons/edit.svg";
20
- import { ReactComponent as PublishIcon } from "@svgr/webpack!../../../icons/publish.svg";
21
- import { ReactComponent as UnpublishIcon } from "@svgr/webpack!../../../icons/unpublish.svg";
22
- import { ReactComponent as DeleteIcon } from "@svgr/webpack!../../../icons/delete.svg";
14
+ import { ReactComponent as MoreVerticalIcon } from "../../../icons/more_vert.svg";
15
+ import { ReactComponent as LockIcon } from "../../../icons/lock.svg";
16
+ import { ReactComponent as BeenHereIcon } from "../../../icons/beenhere.svg";
17
+ import { ReactComponent as GestureIcon } from "../../../icons/gesture.svg";
18
+ import { ReactComponent as AddIcon } from "../../../icons/add.svg";
19
+ import { ReactComponent as EditIcon } from "../../../icons/edit.svg";
20
+ import { ReactComponent as PublishIcon } from "../../../icons/publish.svg";
21
+ import { ReactComponent as UnpublishIcon } from "../../../icons/unpublish.svg";
22
+ import { ReactComponent as DeleteIcon } from "../../../icons/delete.svg";
23
23
  import { i18n } from "@webiny/app/i18n";
24
24
  import { useRevision } from "./useRevision";
25
25
  import usePermission from "../../../hooks/usePermission";
@@ -19,8 +19,8 @@ import { useConfirmationDialog } from "@webiny/app-admin/hooks/useConfirmationDi
19
19
  import { i18n } from "@webiny/app/i18n";
20
20
  import { createDeleteMutation } from "../../../../../graphql/contentEntries";
21
21
  import usePermission from "../../../../../hooks/usePermission";
22
- import { ReactComponent as MoreVerticalIcon } from "@svgr/webpack!../../../../../icons/more_vert.svg";
23
- import { ReactComponent as DeleteIcon } from "@svgr/webpack!../../../../../icons/delete.svg";
22
+ import { ReactComponent as MoreVerticalIcon } from "../../../../../icons/more_vert.svg";
23
+ import { ReactComponent as DeleteIcon } from "../../../../../icons/delete.svg";
24
24
  import { removeEntryFromListCache } from "../../cache";
25
25
  import { useMutation } from "../../../../../hooks";
26
26
  import { useContentEntry } from "../../../hooks/useContentEntry";
@@ -9,7 +9,7 @@ import { IconButton } from "@webiny/ui/Button";
9
9
  import { Tooltip } from "@webiny/ui/Tooltip";
10
10
  import { useConfirmationDialog } from "@webiny/app-admin/hooks/useConfirmationDialog";
11
11
  import { i18n } from "@webiny/app/i18n";
12
- import { ReactComponent as RequestChangesIcon } from "@svgr/webpack!./rule-24px.svg";
12
+ import { ReactComponent as RequestChangesIcon } from "./rule-24px.svg";
13
13
  import usePermission from "../../../../../hooks/usePermission";
14
14
  import { useRevision } from "../../useRevision";
15
15
  import { useContentEntry } from "../../../hooks/useContentEntry";
@@ -9,7 +9,7 @@ import { IconButton } from "@webiny/ui/Button";
9
9
  import { Tooltip } from "@webiny/ui/Tooltip";
10
10
  import { useConfirmationDialog } from "@webiny/app-admin/hooks/useConfirmationDialog";
11
11
  import { i18n } from "@webiny/app/i18n";
12
- import { ReactComponent as RequestReviewIcon } from "@svgr/webpack!./emoji_people-24px.svg";
12
+ import { ReactComponent as RequestReviewIcon } from "./emoji_people-24px.svg";
13
13
  import { useRevision } from "../../useRevision";
14
14
  import usePermission from "../../../../../hooks/usePermission";
15
15
  import { useContentEntry } from "../../../hooks/useContentEntry";
@@ -6,7 +6,7 @@ import { ButtonDefault } from "@webiny/ui/Button";
6
6
  import { Icon } from "@webiny/ui/Icon";
7
7
  import { Typography } from "@webiny/ui/Typography";
8
8
  import { Menu, MenuItem } from "@webiny/ui/Menu";
9
- import { ReactComponent as DownButton } from "@svgr/webpack!../../../../../icons/round-arrow_drop_down-24px.svg";
9
+ import { ReactComponent as DownButton } from "../../../../../icons/round-arrow_drop_down-24px.svg";
10
10
  import { useContentEntry } from "../../../hooks/useContentEntry";
11
11
  import statusLabels from "../../../../../constants/statusLabels";
12
12
  var buttonStyle = /*#__PURE__*/css({
@@ -7,7 +7,7 @@ import { css } from "emotion";
7
7
  import styled from "@emotion/styled";
8
8
  import EmptyView from "@webiny/app-admin/components/EmptyView";
9
9
  import { ButtonDefault, ButtonIcon } from "@webiny/ui/Button";
10
- import { ReactComponent as AddIcon } from "@svgr/webpack!@webiny/app-admin/assets/icons/add-18px.svg";
10
+ import { ReactComponent as AddIcon } from "@webiny/app-admin/assets/icons/add-18px.svg";
11
11
  import { i18n } from "@webiny/app/i18n";
12
12
  import { Tab, Tabs } from "@webiny/ui/Tabs";
13
13
  import { Elevation } from "@webiny/ui/Elevation";
@@ -22,8 +22,8 @@ import { ButtonIcon, ButtonSecondary } from "@webiny/ui/Button";
22
22
  import { Cell, Grid } from "@webiny/ui/Grid";
23
23
  import { Select } from "@webiny/ui/Select";
24
24
  import SearchUI from "@webiny/app-admin/components/SearchUI";
25
- import { ReactComponent as AddIcon } from "@svgr/webpack!@webiny/app-admin/assets/icons/add-18px.svg";
26
- import { ReactComponent as FilterIcon } from "@svgr/webpack!@webiny/app-admin/assets/icons/filter-24px.svg";
25
+ import { ReactComponent as AddIcon } from "@webiny/app-admin/assets/icons/add-18px.svg";
26
+ import { ReactComponent as FilterIcon } from "@webiny/app-admin/assets/icons/filter-24px.svg";
27
27
  import { serializeSorters, deserializeSorters } from "../utils";
28
28
  import usePermission from "../../hooks/usePermission";
29
29
  import { Tooltip } from "@webiny/ui/Tooltip";
@@ -26,7 +26,7 @@ import IconPicker from "./IconPicker";
26
26
  import { useRouter } from "@webiny/react-router";
27
27
  import { useSnackbar } from "@webiny/app-admin/hooks/useSnackbar";
28
28
  import EmptyView from "@webiny/app-admin/components/EmptyView";
29
- import { ReactComponent as AddIcon } from "@svgr/webpack!@webiny/app-admin/assets/icons/add-18px.svg";
29
+ import { ReactComponent as AddIcon } from "@webiny/app-admin/assets/icons/add-18px.svg";
30
30
  import { useMutation, useQuery } from "../../hooks";
31
31
  import * as GQL from "./graphql";
32
32
  import usePermission from "../../hooks/usePermission";
@@ -1,11 +1,10 @@
1
1
  import React from "react";
2
- import HTML5Backend from "react-dnd-html5-backend";
2
+ import { HTML5Backend } from "react-dnd-html5-backend";
3
3
  import { DndProvider } from "react-dnd";
4
4
  import { Editor } from "../../components/ContentModelEditor/Editor";
5
5
  import { useRouter } from "@webiny/react-router";
6
6
  import { useCms } from "../../hooks";
7
7
  import { ContentModelEditorProvider } from "../../components/ContentModelEditor/Context";
8
- import Snackbar from "@webiny/app-admin/ui/views/AdminView/components/Snackbar";
9
8
  export default function ContentModelEditorView() {
10
9
  var _useRouter = useRouter(),
11
10
  match = _useRouter.match;
@@ -26,10 +25,5 @@ export default function ContentModelEditorView() {
26
25
  modelId: modelId
27
26
  }, /*#__PURE__*/React.createElement(DndProvider, {
28
27
  backend: HTML5Backend
29
- }, /*#__PURE__*/React.createElement(Editor, null), /*#__PURE__*/React.createElement("div", {
30
- style: {
31
- zIndex: 10,
32
- position: "absolute"
33
- }
34
- }, /*#__PURE__*/React.createElement(Snackbar, null))));
28
+ }, /*#__PURE__*/React.createElement(Editor, null)));
35
29
  }
@@ -11,8 +11,8 @@ import { css } from "emotion";
11
11
  import get from "lodash/get";
12
12
  import { useRouter } from "@webiny/react-router";
13
13
  import { DeleteIcon, EditIcon } from "@webiny/ui/List/DataList/icons";
14
- import { ReactComponent as ViewListIcon } from "@svgr/webpack!../../icons/view_list.svg";
15
- import { ReactComponent as CloneIcon } from "@svgr/webpack!../../icons/clone.svg";
14
+ import { ReactComponent as ViewListIcon } from "../../icons/view_list.svg";
15
+ import { ReactComponent as CloneIcon } from "../../icons/clone.svg";
16
16
  import { useApolloClient, useQuery } from "../../hooks";
17
17
  import { useSnackbar } from "@webiny/app-admin/hooks/useSnackbar";
18
18
  import * as UIL from "@webiny/ui/List";
@@ -22,13 +22,13 @@ import { i18n } from "@webiny/app/i18n";
22
22
  import { useConfirmationDialog } from "@webiny/app-admin/hooks/useConfirmationDialog";
23
23
  import { removeModelFromGroupCache, removeModelFromListCache } from "./cache";
24
24
  import * as GQL from "../../viewsGraphql";
25
- import { ReactComponent as AddIcon } from "@svgr/webpack!@webiny/app-admin/assets/icons/add-18px.svg";
25
+ import { ReactComponent as AddIcon } from "@webiny/app-admin/assets/icons/add-18px.svg";
26
26
  import SearchUI from "@webiny/app-admin/components/SearchUI";
27
27
  import { deserializeSorters, serializeSorters } from "../utils";
28
28
  import orderBy from "lodash/orderBy";
29
29
  import { Cell, Grid } from "@webiny/ui/Grid";
30
30
  import { Select } from "@webiny/ui/Select";
31
- import { ReactComponent as FilterIcon } from "@svgr/webpack!@webiny/app-admin/assets/icons/filter-24px.svg";
31
+ import { ReactComponent as FilterIcon } from "@webiny/app-admin/assets/icons/filter-24px.svg";
32
32
  import usePermission from "../../hooks/usePermission";
33
33
  var t = i18n.namespace("FormsApp.ContentModelsDataList");
34
34
  var SORTERS = [{
package/index.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from "./HeadlessCMS";
package/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from "./HeadlessCMS";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-headless-cms",
3
- "version": "5.20.0",
3
+ "version": "5.22.0-beta.1",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -14,29 +14,29 @@
14
14
  "license": "MIT",
15
15
  "dependencies": {
16
16
  "@apollo/react-hooks": "3.1.5",
17
- "@babel/runtime": "7.16.3",
18
- "@emotion/core": "10.1.1",
19
- "@emotion/styled": "10.0.27",
17
+ "@babel/runtime": "7.16.7",
18
+ "@emotion/core": "10.3.1",
19
+ "@emotion/styled": "10.3.0",
20
20
  "@fortawesome/fontawesome-svg-core": "1.2.36",
21
21
  "@fortawesome/free-brands-svg-icons": "5.15.4",
22
22
  "@fortawesome/free-regular-svg-icons": "5.15.4",
23
23
  "@fortawesome/free-solid-svg-icons": "5.15.4",
24
24
  "@fortawesome/react-fontawesome": "0.1.16",
25
- "@svgr/webpack": "4.3.3",
25
+ "@svgr/webpack": "6.2.0",
26
26
  "@types/react": "16.14.2",
27
- "@webiny/app": "5.20.0",
28
- "@webiny/app-admin": "5.20.0",
29
- "@webiny/app-graphql-playground": "5.20.0",
30
- "@webiny/app-i18n": "5.20.0",
31
- "@webiny/app-plugin-admin-welcome-screen": "5.20.0",
32
- "@webiny/app-security": "5.20.0",
33
- "@webiny/error": "5.20.0",
34
- "@webiny/form": "5.20.0",
35
- "@webiny/plugins": "5.20.0",
36
- "@webiny/react-router": "5.20.0",
37
- "@webiny/ui": "5.20.0",
38
- "@webiny/utils": "5.20.0",
39
- "@webiny/validation": "5.20.0",
27
+ "@webiny/app": "5.22.0-beta.1",
28
+ "@webiny/app-admin": "5.22.0-beta.1",
29
+ "@webiny/app-graphql-playground": "5.22.0-beta.1",
30
+ "@webiny/app-i18n": "5.22.0-beta.1",
31
+ "@webiny/app-plugin-admin-welcome-screen": "5.22.0-beta.1",
32
+ "@webiny/app-security": "5.22.0-beta.1",
33
+ "@webiny/error": "5.22.0-beta.1",
34
+ "@webiny/form": "5.22.0-beta.1",
35
+ "@webiny/plugins": "5.22.0-beta.1",
36
+ "@webiny/react-router": "5.22.0-beta.1",
37
+ "@webiny/ui": "5.22.0-beta.1",
38
+ "@webiny/utils": "5.22.0-beta.1",
39
+ "@webiny/validation": "5.22.0-beta.1",
40
40
  "apollo-cache": "1.3.5",
41
41
  "apollo-client": "2.6.10",
42
42
  "apollo-link": "1.2.14",
@@ -45,17 +45,17 @@
45
45
  "classnames": "2.3.1",
46
46
  "dot-prop-immutable": "2.1.1",
47
47
  "emotion": "10.0.27",
48
- "graphql": "14.7.0",
48
+ "graphql": "15.8.0",
49
49
  "graphql-tag": "2.12.6",
50
50
  "lodash": "4.17.21",
51
51
  "pluralize": "8.0.0",
52
- "prop-types": "15.7.2",
52
+ "prop-types": "15.8.1",
53
53
  "raw.macro": "0.4.2",
54
54
  "react": "16.14.0",
55
- "react-dnd": "9.5.1",
56
- "react-dnd-html5-backend": "9.5.1",
55
+ "react-dnd": "11.1.3",
56
+ "react-dnd-html5-backend": "11.1.3",
57
57
  "react-dom": "16.14.0",
58
- "react-helmet": "5.2.1",
58
+ "react-helmet": "6.1.0",
59
59
  "react-hotkeyz": "1.0.4",
60
60
  "react-virtualized": "9.22.3",
61
61
  "shortid": "2.2.16",
@@ -63,17 +63,16 @@
63
63
  "use-deep-compare-effect": "1.8.1"
64
64
  },
65
65
  "devDependencies": {
66
- "@babel/cli": "^7.5.5",
67
- "@babel/core": "^7.5.5",
68
- "@babel/preset-env": "^7.5.5",
69
- "@babel/preset-react": "^7.0.0",
70
- "@babel/preset-typescript": "^7.8.3",
71
- "@webiny/cli": "^5.20.0",
72
- "@webiny/project-utils": "^5.20.0",
66
+ "@babel/cli": "^7.16.0",
67
+ "@babel/core": "^7.16.0",
68
+ "@babel/preset-env": "^7.16.4",
69
+ "@babel/preset-react": "^7.16.0",
70
+ "@babel/preset-typescript": "^7.16.0",
71
+ "@webiny/cli": "^5.22.0-beta.1",
72
+ "@webiny/project-utils": "^5.22.0-beta.1",
73
73
  "babel-plugin-emotion": "^9.2.8",
74
74
  "babel-plugin-lodash": "^3.3.4",
75
75
  "babel-plugin-module-resolver": "^4.1.0",
76
- "babel-plugin-named-asset-import": "^1.0.0-next.3e165448",
77
76
  "execa": "^5.0.0",
78
77
  "rimraf": "^3.0.2",
79
78
  "ttypescript": "^1.5.12",
@@ -87,11 +86,6 @@
87
86
  "build": "yarn webiny run build",
88
87
  "watch": "yarn webiny run watch"
89
88
  },
90
- "svgo": {
91
- "plugins": {
92
- "removeViewBox": false
93
- }
94
- },
95
89
  "adio": {
96
90
  "ignore": {
97
91
  "src": [
@@ -107,5 +101,5 @@
107
101
  ]
108
102
  }
109
103
  },
110
- "gitHead": "816632961750d4ae7f3af0d32d4e8a46c3f287a6"
104
+ "gitHead": "b651010b23f28b3ce1c27130713322ce65b32dcd"
111
105
  }
package/types.d.ts CHANGED
@@ -134,8 +134,9 @@ export interface CmsEditorFieldTypePlugin extends Plugin {
134
134
  */
135
135
  renderPredefinedValues?: (params: {
136
136
  form: FormRenderPropParams;
137
+ field: CmsEditorField;
137
138
  getBind: (index?: number) => any;
138
- }) => React.ReactNode;
139
+ }) => React.ReactElement;
139
140
  /**
140
141
  * Object wrapper for GraphQL stuff
141
142
  */
@@ -237,6 +238,7 @@ export interface CmsEditorFieldRendererPlugin extends Plugin {
237
238
  export interface CmsEditorFieldPredefinedValuesEntry {
238
239
  label: string;
239
240
  value: string;
241
+ selected?: boolean;
240
242
  }
241
243
  export interface CmsEditorFieldPredefinedValues {
242
244
  enabled: boolean;
@@ -254,6 +256,7 @@ export declare type CmsEditorField<T = unknown> = T & {
254
256
  multipleValues?: boolean;
255
257
  predefinedValues?: CmsEditorFieldPredefinedValues;
256
258
  settings?: {
259
+ defaultValue?: string | null | undefined;
257
260
  [key: string]: any;
258
261
  };
259
262
  renderer: {
@@ -1,7 +0,0 @@
1
- import React from "react";
2
- import { NavigationView } from "@webiny/app-admin/ui/views/NavigationView";
3
- interface Props {
4
- view: NavigationView;
5
- }
6
- export declare const CmsMenuLoader: React.MemoExoticComponent<({ view }: Props) => JSX.Element>;
7
- export {};
@@ -1,76 +0,0 @@
1
- import React, { useEffect } from "react";
2
- import { NavigationMenuElement } from "@webiny/app-admin/ui/elements/NavigationMenuElement";
3
- import { ReactComponent as HeadlessCmsIcon } from "@svgr/webpack!../../icons/devices_other-black-24px.svg";
4
- import GlobalSearchPlugins from "./GlobalSearchPlugins";
5
- import usePermission from "../../hooks/usePermission";
6
- import { ContentGroupsMenuItems } from "./ContentGroupsMenuItems";
7
- import { ContentGroupMenuElement } from "../../elements/ContentGroupMenuElement";
8
- export var CmsMenuLoader = /*#__PURE__*/React.memo(function (_ref) {
9
- var view = _ref.view;
10
-
11
- var _usePermission = usePermission(),
12
- canAccessManageEndpoint = _usePermission.canAccessManageEndpoint,
13
- canReadContentModels = _usePermission.canReadContentModels,
14
- canReadContentModelGroups = _usePermission.canReadContentModelGroups,
15
- canCreateContentModels = _usePermission.canCreateContentModels,
16
- canCreateContentModelGroups = _usePermission.canCreateContentModelGroups;
17
-
18
- var hasAccess = canAccessManageEndpoint && (canReadContentModels || canReadContentModelGroups);
19
- useEffect(function () {
20
- if (!hasAccess) {
21
- return;
22
- }
23
- /**
24
- * Create the main "Headless CMS" menu group.
25
- */
26
-
27
-
28
- var mainMenu = view.addAppMenuElement(new NavigationMenuElement("headlessCms.mainMenu", {
29
- label: "Headless CMS",
30
- icon: /*#__PURE__*/React.createElement(HeadlessCmsIcon, null)
31
- }));
32
- mainMenu.addSorter(function (a, b) {
33
- if (a instanceof ContentGroupMenuElement && b instanceof NavigationMenuElement) {
34
- return 1;
35
- }
36
-
37
- if (a instanceof NavigationMenuElement && b instanceof ContentGroupMenuElement) {
38
- return -1;
39
- }
40
-
41
- return 0;
42
- });
43
- /**
44
- * Add "Content Models" section if the user can create either models or groups.
45
- */
46
-
47
- if (canCreateContentModels || canCreateContentModelGroups) {
48
- var contentModelsMenu = mainMenu.addElement(new NavigationMenuElement("headlessCms.contentModels", {
49
- label: "Content Models"
50
- }));
51
-
52
- if (canCreateContentModels) {
53
- contentModelsMenu.addElement(new NavigationMenuElement("headlessCms.contentModels.models", {
54
- label: "Models",
55
- path: "/cms/content-models"
56
- }));
57
- }
58
-
59
- if (canCreateContentModelGroups) {
60
- contentModelsMenu.addElement(new NavigationMenuElement("headlessCms.contentModels.groups", {
61
- label: "Groups",
62
- path: "/cms/content-model-groups"
63
- }));
64
- }
65
- }
66
- }, []);
67
-
68
- if (!hasAccess) {
69
- return null;
70
- }
71
-
72
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(GlobalSearchPlugins, null), /*#__PURE__*/React.createElement(ContentGroupsMenuItems, {
73
- view: view
74
- }));
75
- });
76
- CmsMenuLoader.displayName = "CmsMenuLoader";
@@ -1,6 +0,0 @@
1
- import { NavigationView } from "@webiny/app-admin/ui/views/NavigationView";
2
- interface Props {
3
- view: NavigationView;
4
- }
5
- export declare const ContentGroupsMenuItems: ({ view }: Props) => any;
6
- export {};