@webiny/app-headless-cms 5.20.0-beta.2 → 5.22.0-beta.0

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
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import { ApolloClient } from "apollo-client";
3
+ interface CreateApolloClient {
4
+ (params: {
5
+ uri: string;
6
+ }): ApolloClient<any>;
7
+ }
8
+ export interface HeadlessCMSProps {
9
+ createApolloClient: CreateApolloClient;
10
+ }
11
+ export declare const HeadlessCMS: React.MemoExoticComponent<({ createApolloClient }: HeadlessCMSProps) => JSX.Element>;
12
+ export {};
package/HeadlessCMS.js ADDED
@@ -0,0 +1,27 @@
1
+ import React, { Fragment, memo } from "react";
2
+ import { plugins } from "@webiny/plugins";
3
+ import { Plugins, Provider } from "@webiny/app-admin";
4
+ import { CmsProvider } from "./admin/contexts/Cms";
5
+ import { CmsMenuLoader } from "./admin/menus/CmsMenuLoader";
6
+ import apiInformation from "./admin/plugins/apiInformation";
7
+
8
+ var createHeadlessCMSProvider = function createHeadlessCMSProvider(createApolloClient) {
9
+ return function (Component) {
10
+ return function HeadlessCMSProvider(_ref) {
11
+ var children = _ref.children;
12
+ return /*#__PURE__*/React.createElement(CmsProvider, {
13
+ createApolloClient: createApolloClient
14
+ }, /*#__PURE__*/React.createElement(Component, null, children));
15
+ };
16
+ };
17
+ };
18
+
19
+ var HeadlessCMSExtension = function HeadlessCMSExtension(_ref2) {
20
+ var createApolloClient = _ref2.createApolloClient;
21
+ plugins.register(apiInformation);
22
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Provider, {
23
+ hoc: createHeadlessCMSProvider(createApolloClient)
24
+ }), /*#__PURE__*/React.createElement(Plugins, null, /*#__PURE__*/React.createElement(CmsMenuLoader, null)));
25
+ };
26
+
27
+ export var HeadlessCMS = /*#__PURE__*/memo(HeadlessCMSExtension);
@@ -1,4 +1,5 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
+ import _createForOfIteratorHelper from "@babel/runtime/helpers/createForOfIteratorHelper";
2
3
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
4
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
5
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
@@ -13,6 +14,23 @@ import * as GQLCache from "../../views/contentEntries/ContentEntry/cache";
13
14
  import { prepareFormData } from "../../views/contentEntries/ContentEntry/prepareFormData";
14
15
  import { useContentEntry } from "../../views/contentEntries/hooks/useContentEntry";
15
16
  import { plugins } from "@webiny/plugins";
17
+ /**
18
+ * Used for some fields to convert their values.
19
+ */
20
+
21
+ var convertDefaultValue = function convertDefaultValue(field, value) {
22
+ switch (field.type) {
23
+ case "boolean":
24
+ return Boolean(value);
25
+
26
+ case "number":
27
+ return Number(value);
28
+
29
+ default:
30
+ return value;
31
+ }
32
+ };
33
+
16
34
  export function useContentEntryForm(params) {
17
35
  var _useContentEntry = useContentEntry(),
18
36
  listQueryVariables = _useContentEntry.listQueryVariables;
@@ -310,24 +328,95 @@ export function useContentEntryForm(params) {
310
328
 
311
329
  var getDefaultValues = function getDefaultValues() {
312
330
  var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
313
- var values = {}; // TODO: finish default values.
314
-
315
- /*fields.forEach(field => {
316
- const fieldId = field.fieldId;
317
- if (
318
- fieldId &&
319
- "defaultValue" in field.settings &&
320
- typeof field.settings.defaultValue !== "undefined"
321
- ) {
322
- values[fieldId] = field.settings.defaultValue;
331
+ var values = {};
332
+ /**
333
+ * Assign the default values:
334
+ * * check the settings.defaultValue
335
+ * * check the predefinedValues for selected value
336
+ */
337
+
338
+ var _iterator = _createForOfIteratorHelper(contentModel.fields),
339
+ _step;
340
+
341
+ try {
342
+ var _loop = function _loop() {
343
+ var field = _step.value;
344
+
345
+ /**
346
+ * When checking if defaultValue is set in settings, we do the undefined check because it can be null, 0, empty string, false, etc...
347
+ */
348
+ var settings = field.settings,
349
+ _field$multipleValues = field.multipleValues,
350
+ multipleValues = _field$multipleValues === void 0 ? false : _field$multipleValues;
351
+
352
+ if (settings && settings.defaultValue !== undefined) {
353
+ /**
354
+ * Special type of field is the boolean one.
355
+ * We MUST set true/false for default value.
356
+ */
357
+ values[field.fieldId] = convertDefaultValue(field, settings.defaultValue);
358
+ return "continue";
359
+ }
360
+ /**
361
+ * No point in going further if predefined values are not enabled.
362
+ */
363
+
364
+
365
+ var predefinedValues = field.predefinedValues;
366
+
367
+ if (!predefinedValues || !predefinedValues.enabled || Array.isArray(predefinedValues.values) === false) {
368
+ return "continue";
369
+ }
370
+ /**
371
+ * When field is not a multiple values one, we find the first possible default selected value and set it as field value.
372
+ */
373
+
374
+
375
+ if (!multipleValues) {
376
+ var selectedValue = predefinedValues.values.find(function (_ref8) {
377
+ var selected = _ref8.selected;
378
+ return !!selected;
379
+ });
380
+
381
+ if (selectedValue) {
382
+ values[field.fieldId] = convertDefaultValue(field, selectedValue.value);
383
+ }
384
+
385
+ return "continue";
323
386
  }
324
- });*/
387
+ /**
388
+ *
389
+ */
390
+
391
+
392
+ values[field.fieldId] = predefinedValues.values.filter(function (_ref9) {
393
+ var selected = _ref9.selected;
394
+ return !!selected;
395
+ }).map(function (_ref10) {
396
+ var value = _ref10.value;
397
+ return convertDefaultValue(field, value);
398
+ });
399
+ };
400
+
401
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
402
+ var _ret = _loop();
403
+
404
+ if (_ret === "continue") continue;
405
+ }
406
+ } catch (err) {
407
+ _iterator.e(err);
408
+ } finally {
409
+ _iterator.f();
410
+ }
325
411
 
326
412
  return _objectSpread(_objectSpread({}, values), overrides);
327
413
  };
328
414
 
329
415
  return {
330
- data: entry ? entry : getDefaultValues(),
416
+ /**
417
+ * If entry is not set or entry.id does not exist, it means that form is for the new entry, so fetch default values.
418
+ */
419
+ data: entry && entry.id ? entry : getDefaultValues(),
331
420
  loading: loading,
332
421
  setLoading: setLoading,
333
422
  onChange: params.onChange,
@@ -43,9 +43,11 @@ var cleanupModelDataFields = function cleanupModelDataFields(fields) {
43
43
  enabled: enabled,
44
44
  values: values.map(function (_ref3) {
45
45
  var label = _ref3.label,
46
- value = _ref3.value;
46
+ value = _ref3.value,
47
+ selected = _ref3.selected;
47
48
  return {
48
49
  label: label,
50
+ selected: selected || false,
49
51
  value: String(value)
50
52
  };
51
53
  })
@@ -1,3 +1,3 @@
1
1
  import React from "react";
2
- export declare const EditContainer: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<React.DetailedHTMLProps<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>;
2
+ export declare const EditContainer: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<React.DetailedHTMLProps<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>;
3
3
  export declare const Editor: () => JSX.Element;
@@ -14,7 +14,7 @@ import { LeftPanel, RightPanel, SplitView } from "@webiny/app-admin/components/S
14
14
  import { Icon } from "@webiny/ui/Icon";
15
15
  import { Typography } from "@webiny/ui/Typography";
16
16
  import { Tab, Tabs } from "@webiny/ui/Tabs";
17
- import { ReactComponent as FormIcon } from "@svgr/webpack!./icons/round-assignment-24px.svg";
17
+ import { ReactComponent as FormIcon } from "./icons/round-assignment-24px.svg";
18
18
  import { FieldsSidebar } from "./FieldsSidebar";
19
19
  import { FieldEditor } from "../FieldEditor";
20
20
  import { PreviewTab } from "./PreviewTab";
@@ -10,5 +10,6 @@ export declare type DraggableProps = {
10
10
  endDrag?: any;
11
11
  target?: string[];
12
12
  };
13
- declare const Draggable: React.MemoExoticComponent<(props: DraggableProps) => JSX.Element>;
14
- export default Draggable;
13
+ declare function Draggable(props: DraggableProps): JSX.Element;
14
+ declare const _default: React.MemoExoticComponent<typeof Draggable>;
15
+ export default _default;
@@ -2,7 +2,8 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import React from "react";
3
3
  import { useDrag, DragPreviewImage } from "react-dnd";
4
4
  var emptyImage = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
5
- var Draggable = /*#__PURE__*/React.memo(function (props) {
5
+
6
+ function Draggable(props) {
6
7
  var children = props.children,
7
8
  beginDrag = props.beginDrag,
8
9
  endDrag = props.endDrag,
@@ -45,5 +46,6 @@ var Draggable = /*#__PURE__*/React.memo(function (props) {
45
46
  isDragging: isDragging,
46
47
  drag: drag
47
48
  }));
48
- });
49
- export default Draggable;
49
+ }
50
+
51
+ export default /*#__PURE__*/React.memo(Draggable);
@@ -19,5 +19,6 @@ export declare type DroppableProps = {
19
19
  }) => boolean;
20
20
  onDrop?: (item: DragSource) => void;
21
21
  };
22
- declare const Droppable: React.MemoExoticComponent<(props: DroppableProps) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>>;
23
- export default Droppable;
22
+ declare function Droppable(props: DroppableProps): React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>;
23
+ declare const _default: React.MemoExoticComponent<typeof Droppable>;
24
+ export default _default;
@@ -1,7 +1,8 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import * as React from "react";
3
3
  import { useDrop } from "react-dnd";
4
- var Droppable = /*#__PURE__*/React.memo(function (props) {
4
+
5
+ function Droppable(props) {
5
6
  var children = props.children,
6
7
  onDrop = props.onDrop,
7
8
  _props$isVisible = props.isVisible,
@@ -41,5 +42,6 @@ var Droppable = /*#__PURE__*/React.memo(function (props) {
41
42
  item: item,
42
43
  drop: drop
43
44
  });
44
- });
45
- export default Droppable;
45
+ }
46
+
47
+ export default /*#__PURE__*/React.memo(Droppable);
@@ -1,5 +1,10 @@
1
- export default function PredefinedValues({ field, fieldPlugin, form }: {
2
- field: any;
3
- fieldPlugin: any;
4
- form: any;
5
- }): any;
1
+ import React from "react";
2
+ import { CmsEditorField, CmsEditorFieldTypePlugin } from "../../../../types";
3
+ import { FormRenderPropParams } from "@webiny/form";
4
+ export interface Props {
5
+ field: CmsEditorField;
6
+ fieldPlugin: CmsEditorFieldTypePlugin;
7
+ form: FormRenderPropParams;
8
+ }
9
+ declare const PredefinedValues: React.FC<Props>;
10
+ export default PredefinedValues;
@@ -2,7 +2,8 @@ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
2
  import React, { useCallback, useRef, cloneElement } from "react";
3
3
  import getValue from "./functions/getValue";
4
4
  import setValue from "./functions/setValue";
5
- export default function PredefinedValues(_ref) {
5
+
6
+ var PredefinedValues = function PredefinedValues(_ref) {
6
7
  var field = _ref.field,
7
8
  fieldPlugin = _ref.fieldPlugin,
8
9
  form = _ref.form;
@@ -48,8 +49,11 @@ export default function PredefinedValues(_ref) {
48
49
 
49
50
  return memoizedBindComponents.current[memoKey];
50
51
  }, []);
51
- return fieldPlugin.field.renderPredefinedValues({
52
+ return /*#__PURE__*/React.createElement(React.Fragment, null, fieldPlugin.field.renderPredefinedValues({
52
53
  field: field,
53
- getBind: getBind
54
- });
55
- }
54
+ getBind: getBind,
55
+ form: form
56
+ }));
57
+ };
58
+
59
+ export default PredefinedValues;
@@ -10,10 +10,10 @@ import { css } from "emotion";
10
10
  import styled from "@emotion/styled";
11
11
  import { IconButton } from "@webiny/ui/Button";
12
12
  import { Typography } from "@webiny/ui/Typography";
13
- import { ReactComponent as EditIcon } from "@svgr/webpack!../../icons/edit.svg";
14
- import { ReactComponent as DeleteIcon } from "@svgr/webpack!../../icons/delete.svg";
15
- import { ReactComponent as TitleIcon } from "@svgr/webpack!../../icons/title-24px.svg";
16
- import { ReactComponent as MoreVerticalIcon } from "@svgr/webpack!../../icons/more_vert.svg";
13
+ import { ReactComponent as EditIcon } from "../../icons/edit.svg";
14
+ import { ReactComponent as DeleteIcon } from "../../icons/delete.svg";
15
+ import { ReactComponent as TitleIcon } from "../../icons/title-24px.svg";
16
+ import { ReactComponent as MoreVerticalIcon } from "../../icons/more_vert.svg";
17
17
  import { Menu, MenuItem } from "@webiny/ui/Menu";
18
18
  import { plugins } from "@webiny/plugins";
19
19
  import { ListItemGraphic } from "@webiny/ui/List";
@@ -6,7 +6,7 @@ import React, { Fragment } from "react";
6
6
  import get from "lodash/get";
7
7
  import { Icon } from "@webiny/ui/Icon";
8
8
  import { i18n } from "@webiny/app/i18n";
9
- import { ReactComponent as HandleIcon } from "@svgr/webpack!../../icons/round-drag_indicator-24px.svg";
9
+ import { ReactComponent as HandleIcon } from "../../icons/round-drag_indicator-24px.svg";
10
10
  import { Center, Vertical, Horizontal } from "../DropZone";
11
11
  import Draggable from "../Draggable";
12
12
  import EditFieldDialog from "./EditFieldDialog";
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- export declare const RowContainer: 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>;
3
- export declare const Row: 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>;
2
+ export declare const RowContainer: 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>;
3
+ export declare const Row: 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>;
4
4
  export declare const fieldContainer: string;
5
5
  export declare const rowHandle: string;
6
6
  export declare const fieldHandle: string;
@@ -6,11 +6,10 @@ export interface CmsContextValue {
6
6
  apolloClient: ApolloClient<any>;
7
7
  }
8
8
  export declare const CmsContext: React.Context<CmsContextValue>;
9
- declare type CmsProviderProps = {
9
+ export declare type CmsProviderProps = {
10
10
  createApolloClient: (params: {
11
11
  uri: string;
12
12
  }) => ApolloClient<any>;
13
13
  children: React.ReactNode;
14
14
  };
15
15
  export declare function CmsProvider(props: CmsProviderProps): JSX.Element;
16
- export {};
@@ -1,3 +1,4 @@
1
+ import _createClass from "@babel/runtime/helpers/createClass";
1
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
3
  import _inherits from "@babel/runtime/helpers/inherits";
3
4
  import _createSuper from "@babel/runtime/helpers/createSuper";
@@ -13,5 +14,5 @@ export var ContentGroupMenuElement = /*#__PURE__*/function (_NavigationMenuEleme
13
14
  return _super.apply(this, arguments);
14
15
  }
15
16
 
16
- return ContentGroupMenuElement;
17
+ return _createClass(ContentGroupMenuElement);
17
18
  }(NavigationMenuElement);
@@ -1,3 +1,4 @@
1
+ import _createClass from "@babel/runtime/helpers/createClass";
1
2
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
3
  import _inherits from "@babel/runtime/helpers/inherits";
3
4
  import _createSuper from "@babel/runtime/helpers/createSuper";
@@ -13,5 +14,5 @@ export var ContentModelMenuElement = /*#__PURE__*/function (_NavigationMenuEleme
13
14
  return _super.apply(this, arguments);
14
15
  }
15
16
 
16
- return ContentModelMenuElement;
17
+ return _createClass(ContentModelMenuElement);
17
18
  }(NavigationMenuElement);
@@ -47,7 +47,7 @@ export var NothingToShowElement = /*#__PURE__*/function (_NavigationMenuElemen)
47
47
  return _this;
48
48
  }
49
49
 
50
- return NothingToShowElement;
50
+ return _createClass(NothingToShowElement);
51
51
  }(NavigationMenuElement);
52
52
  export var NothingToShowRenderer = /*#__PURE__*/function (_UIRenderer) {
53
53
  _inherits(NothingToShowRenderer, _UIRenderer);
@@ -1,4 +1,4 @@
1
- export declare const FIELDS_FIELDS = "\n id\n fieldId\n type\n label\n placeholderText\n helpText \n predefinedValues {\n enabled\n values {\n label\n value\n }\n }\n multipleValues \n renderer {\n name\n }\n validation {\n name\n settings\n message\n }\n listValidation {\n name\n settings\n message\n }\n settings\n";
1
+ export declare const FIELDS_FIELDS = "\n id\n fieldId\n type\n label\n placeholderText\n helpText \n predefinedValues {\n enabled\n values {\n label\n value\n selected\n }\n }\n multipleValues \n renderer {\n name\n }\n validation {\n name\n settings\n message\n }\n listValidation {\n name\n settings\n message\n }\n settings\n";
2
2
  export declare const MODEL_FIELDS: string;
3
3
  export declare const GET_CONTENT_MODEL: import("graphql").DocumentNode;
4
4
  export declare const UPDATE_CONTENT_MODEL: import("graphql").DocumentNode;
@@ -3,7 +3,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
3
3
  var _templateObject, _templateObject2;
4
4
 
5
5
  import gql from "graphql-tag";
6
- export var FIELDS_FIELDS = "\n id\n fieldId\n type\n label\n placeholderText\n helpText \n predefinedValues {\n enabled\n values {\n label\n value\n }\n }\n multipleValues \n renderer {\n name\n }\n validation {\n name\n settings\n message\n }\n listValidation {\n name\n settings\n message\n }\n settings\n";
6
+ export var FIELDS_FIELDS = "\n id\n fieldId\n type\n label\n placeholderText\n helpText \n predefinedValues {\n enabled\n values {\n label\n value\n selected\n }\n }\n multipleValues \n renderer {\n name\n }\n validation {\n name\n settings\n message\n }\n listValidation {\n name\n settings\n message\n }\n settings\n";
7
7
  export var MODEL_FIELDS = "\n name\n group {\n id\n name\n }\n description\n modelId\n savedOn\n titleFieldId\n lockedFields\n layout\n fields {\n ".concat(FIELDS_FIELDS, "\n }\n");
8
8
  export var GET_CONTENT_MODEL = gql(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n query CmsGetContentModel($modelId: ID!) {\n getContentModel(modelId: $modelId) {\n data {\n ", "\n }\n error {\n code\n message\n data\n }\n }\n }\n"])), MODEL_FIELDS);
9
9
  export var UPDATE_CONTENT_MODEL = gql(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n mutation CmsUpdateContentModel($modelId: ID!, $data: CmsContentModelUpdateInput!) {\n updateContentModel(modelId: $modelId, data: $data) {\n data {\n ", "\n }\n error {\n code\n message\n data\n }\n }\n }\n"])), MODEL_FIELDS);
@@ -1,8 +1,8 @@
1
- declare type ContentModelGroup = {
1
+ export declare type ContentModelGroup = {
2
2
  id: string;
3
3
  [key: string]: any;
4
4
  };
5
- declare type ContentModel = {
5
+ export declare type ContentModel = {
6
6
  modelId: string;
7
7
  [key: string]: any;
8
8
  };
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare const CmsMenuLoader: React.MemoExoticComponent<() => JSX.Element>;
@@ -0,0 +1,39 @@
1
+ import React, { Fragment } from "react";
2
+ import { AddMenu as Menu } from "@webiny/app-admin";
3
+ import { ReactComponent as HeadlessCmsIcon } from "../icons/devices_other-black-24px.svg";
4
+ import GlobalSearchPlugins from "./GlobalSearchPlugins";
5
+ import usePermission from "../hooks/usePermission";
6
+ import { ContentGroupsMenuItems } from "./ContentGroupsMenuItems";
7
+ export var CmsMenuLoader = /*#__PURE__*/React.memo(function () {
8
+ var _usePermission = usePermission(),
9
+ canAccessManageEndpoint = _usePermission.canAccessManageEndpoint,
10
+ canReadContentModels = _usePermission.canReadContentModels,
11
+ canReadContentModelGroups = _usePermission.canReadContentModelGroups,
12
+ canCreateContentModels = _usePermission.canCreateContentModels,
13
+ canCreateContentModelGroups = _usePermission.canCreateContentModelGroups;
14
+
15
+ var hasAccess = canAccessManageEndpoint && (canReadContentModels || canReadContentModelGroups);
16
+
17
+ if (!hasAccess) {
18
+ return null;
19
+ }
20
+
21
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Menu, {
22
+ name: "headlessCMS",
23
+ label: "Headless CMS",
24
+ icon: /*#__PURE__*/React.createElement(HeadlessCmsIcon, null)
25
+ }, (canCreateContentModels || canCreateContentModelGroups) && /*#__PURE__*/React.createElement(Menu, {
26
+ name: "headlessCMS.contentModels",
27
+ label: "Content Models",
28
+ pin: "first"
29
+ }, canCreateContentModels && /*#__PURE__*/React.createElement(Menu, {
30
+ name: "headlessCMS.contentModels.models",
31
+ label: "Models",
32
+ path: "/cms/content-models"
33
+ }), canCreateContentModelGroups && /*#__PURE__*/React.createElement(Menu, {
34
+ name: "headlessCMS.contentModels.groups",
35
+ label: "Groups",
36
+ path: "/cms/content-model-groups"
37
+ })), /*#__PURE__*/React.createElement(ContentGroupsMenuItems, null)), /*#__PURE__*/React.createElement(GlobalSearchPlugins, null));
38
+ });
39
+ CmsMenuLoader.displayName = "CmsMenuLoader";
@@ -0,0 +1 @@
1
+ export declare const ContentGroupsMenuItems: () => any;