@webiny/app-headless-cms 5.18.2 → 5.19.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/components/ContentModelEditor/Editor.d.ts +1 -1
- package/admin/components/FieldEditor/Styled.d.ts +2 -2
- package/admin/contexts/Cms/index.js +5 -2
- package/admin/plugins/apiInformation/index.js +7 -3
- package/admin/plugins/definitions/CmsEditorFieldValidatorFileTypePlugin.d.ts +21 -0
- package/admin/plugins/definitions/CmsEditorFieldValidatorFileTypePlugin.js +61 -0
- package/admin/plugins/definitions/CmsFieldValidatorFileTypePlugin.d.ts +10 -0
- package/admin/plugins/definitions/CmsFieldValidatorFileTypePlugin.js +36 -0
- package/admin/plugins/editor/defaultBar/Divider.d.ts +1 -1
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsStyled.d.ts +2 -2
- package/admin/plugins/editor/defaultBar/Name/NameStyled.d.ts +3 -3
- package/admin/plugins/fieldRenderers/file/File.d.ts +12 -11
- package/admin/plugins/fieldRenderers/file/File.js +19 -15
- package/admin/plugins/fieldRenderers/file/fileField.js +17 -12
- package/admin/plugins/fieldRenderers/file/fileFields.js +16 -20
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesAutocomplete.js +17 -7
- package/admin/plugins/fieldRenderers/ref/components/createEntryUrl.d.ts +5 -0
- package/admin/plugins/fieldRenderers/ref/components/createEntryUrl.js +5 -0
- package/admin/plugins/fieldRenderers/ref/components/renderItem.d.ts +7 -1
- package/admin/plugins/fieldRenderers/ref/components/renderItem.js +6 -2
- package/admin/plugins/fieldRenderers/ref/components/useReference.js +2 -2
- package/admin/plugins/fieldRenderers/ref/components/useReferences.js +1 -1
- package/admin/plugins/fieldValidators/patternPlugins/lowerCaseSpace.d.ts +3 -0
- package/admin/plugins/fieldValidators/patternPlugins/lowerCaseSpace.js +9 -0
- package/admin/plugins/fieldValidators/patternPlugins/upperCaseSpace.d.ts +3 -0
- package/admin/plugins/fieldValidators/patternPlugins/upperCaseSpace.js +9 -0
- package/admin/plugins/fields/file.js +15 -1
- package/admin/plugins/fields/ref.js +3 -2
- package/admin/plugins/index.d.ts +2 -2
- package/admin/plugins/permissionRenderer/components/StyledComponents.d.ts +1 -1
- package/admin/plugins/transformers/dateTransformer.js +114 -20
- package/admin/plugins/validators/patternPlugins/lowerCaseSpace.d.ts +10 -0
- package/admin/plugins/validators/patternPlugins/lowerCaseSpace.js +9 -0
- package/admin/plugins/validators/patternPlugins/upperCaseSpace.d.ts +10 -0
- package/admin/plugins/validators/patternPlugins/upperCaseSpace.js +9 -0
- package/admin/views/contentEntries/ContentEntriesList.js +2 -2
- package/admin/views/contentEntries/ContentEntry/ContentEntryContext.js +7 -1
- package/admin/views/contentEntries/ContentEntry/cache.js +4 -1
- package/admin/views/contentEntries/hooks/useContentEntriesList.d.ts +1 -1
- package/admin/views/contentEntries/hooks/useContentEntriesList.js +2 -2
- package/package.json +17 -16
- package/types.d.ts +2 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const NameInputWrapper: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "
|
|
3
|
-
export declare const NameWrapper: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "
|
|
4
|
-
export declare const FormName: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "
|
|
2
|
+
export declare const NameInputWrapper: 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 NameWrapper: 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>;
|
|
4
|
+
export declare const FormName: 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>;
|
|
5
5
|
export declare const formNameWrapper: string;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface Props {
|
|
3
|
+
url: string;
|
|
4
|
+
onRemove: Function;
|
|
5
|
+
placeholder: string;
|
|
6
|
+
styles?: Record<string, any>;
|
|
7
|
+
showFileManager?: Function;
|
|
8
|
+
validation?: {
|
|
9
|
+
isValid?: boolean;
|
|
10
|
+
message?: string;
|
|
12
11
|
};
|
|
12
|
+
description?: string;
|
|
13
13
|
}
|
|
14
|
+
declare const File: React.FunctionComponent<Props>;
|
|
14
15
|
export default File;
|
|
@@ -3,6 +3,7 @@ import { Image } from "@webiny/app/components";
|
|
|
3
3
|
import * as Ui from "@webiny/ui/ImageUpload";
|
|
4
4
|
import { createRenderImagePreview, imageExtensions } from "./utils";
|
|
5
5
|
import fileIcon from "../../fields/icons/round_insert_drive_file-24px.svg";
|
|
6
|
+
import { FormElementMessage } from "@webiny/ui/FormElementMessage";
|
|
6
7
|
var imagePreviewProps = {
|
|
7
8
|
transform: {
|
|
8
9
|
width: 300
|
|
@@ -13,13 +14,23 @@ var imagePreviewProps = {
|
|
|
13
14
|
objectFit: "cover"
|
|
14
15
|
}
|
|
15
16
|
};
|
|
17
|
+
var defaultStyles = {
|
|
18
|
+
width: "100%",
|
|
19
|
+
height: "auto"
|
|
20
|
+
};
|
|
21
|
+
var defaultValidation = {
|
|
22
|
+
isValid: null,
|
|
23
|
+
message: null
|
|
24
|
+
};
|
|
16
25
|
|
|
17
|
-
function File(props) {
|
|
26
|
+
var File = function File(props) {
|
|
18
27
|
var url = props.url,
|
|
19
28
|
onRemove = props.onRemove,
|
|
20
29
|
placeholder = props.placeholder,
|
|
21
|
-
|
|
22
|
-
|
|
30
|
+
showFileManager = props.showFileManager,
|
|
31
|
+
description = props.description;
|
|
32
|
+
var styles = props.styles || defaultStyles;
|
|
33
|
+
var validation = props.validation || defaultValidation;
|
|
23
34
|
var isImage = useCallback(function (url) {
|
|
24
35
|
return imageExtensions.some(function (extension) {
|
|
25
36
|
return url.includes(extension);
|
|
@@ -48,7 +59,7 @@ function File(props) {
|
|
|
48
59
|
return defaultRenderImagePreview;
|
|
49
60
|
};
|
|
50
61
|
|
|
51
|
-
return /*#__PURE__*/React.createElement(Ui.Image, {
|
|
62
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Ui.Image, {
|
|
52
63
|
renderImagePreview: renderImagePreview(url),
|
|
53
64
|
style: styles,
|
|
54
65
|
value: url ? {
|
|
@@ -60,16 +71,9 @@ function File(props) {
|
|
|
60
71
|
containerStyle: {
|
|
61
72
|
height: "auto"
|
|
62
73
|
}
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
File.defaultProps = {
|
|
67
|
-
validation: {
|
|
68
|
-
isValid: null
|
|
69
|
-
},
|
|
70
|
-
styles: {
|
|
71
|
-
width: "100%",
|
|
72
|
-
height: "auto"
|
|
73
|
-
}
|
|
74
|
+
}), validation.isValid === false && /*#__PURE__*/React.createElement(FormElementMessage, {
|
|
75
|
+
error: true
|
|
76
|
+
}, validation.message || "Invalid value."), validation.isValid !== false && description && /*#__PURE__*/React.createElement(FormElementMessage, null, description));
|
|
74
77
|
};
|
|
78
|
+
|
|
75
79
|
export default File;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
|
|
3
|
-
var _templateObject, _templateObject2
|
|
3
|
+
var _templateObject, _templateObject2;
|
|
4
4
|
|
|
5
5
|
import React from "react";
|
|
6
6
|
import { i18n } from "@webiny/app/i18n";
|
|
@@ -25,32 +25,37 @@ var plugin = {
|
|
|
25
25
|
getBind = _ref2.getBind,
|
|
26
26
|
Label = _ref2.Label;
|
|
27
27
|
var Bind = getBind();
|
|
28
|
+
var imagesOnly = field.settings && field.settings.imagesOnly;
|
|
28
29
|
return /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
|
|
29
30
|
span: 12
|
|
30
|
-
}, /*#__PURE__*/React.createElement(Label, null, field.label), /*#__PURE__*/React.createElement(Bind, null, function (
|
|
31
|
-
var value =
|
|
32
|
-
onChange =
|
|
31
|
+
}, /*#__PURE__*/React.createElement(Label, null, field.label), /*#__PURE__*/React.createElement(Bind, null, function (bind) {
|
|
32
|
+
var value = bind.value,
|
|
33
|
+
onChange = bind.onChange;
|
|
33
34
|
return /*#__PURE__*/React.createElement(FileManager, {
|
|
34
|
-
multiple: false
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
multiple: false,
|
|
36
|
+
images: imagesOnly
|
|
37
|
+
}, function (_ref3) {
|
|
38
|
+
var showFileManager = _ref3.showFileManager;
|
|
37
39
|
|
|
38
40
|
var selectFile = function selectFile() {
|
|
39
41
|
showFileManager(function (newFile) {
|
|
40
|
-
if (newFile
|
|
41
|
-
|
|
42
|
+
if (newFile === null) {
|
|
43
|
+
return;
|
|
42
44
|
}
|
|
45
|
+
|
|
46
|
+
onChange(newFile.src);
|
|
43
47
|
});
|
|
44
48
|
};
|
|
45
49
|
|
|
46
|
-
return /*#__PURE__*/React.createElement(File, {
|
|
50
|
+
return /*#__PURE__*/React.createElement(File, Object.assign({}, bind, {
|
|
47
51
|
url: value,
|
|
48
52
|
onRemove: function onRemove() {
|
|
49
53
|
return onChange(null);
|
|
50
54
|
},
|
|
51
55
|
showFileManager: selectFile,
|
|
52
|
-
placeholder:
|
|
53
|
-
|
|
56
|
+
placeholder: field.placeholderText,
|
|
57
|
+
description: field.helpText
|
|
58
|
+
}));
|
|
54
59
|
});
|
|
55
60
|
}), field.helpText && /*#__PURE__*/React.createElement(FormElementMessage, null, field.helpText)));
|
|
56
61
|
}
|
|
@@ -11,7 +11,6 @@ import { imageWrapperStyles } from "./utils";
|
|
|
11
11
|
import { FileManager } from "@webiny/app-admin/components";
|
|
12
12
|
import styled from "@emotion/styled";
|
|
13
13
|
import File from "./File";
|
|
14
|
-
import { FormElementMessage } from "@webiny/ui/FormElementMessage";
|
|
15
14
|
var t = i18n.ns("app-headless-cms/admin/fields/file");
|
|
16
15
|
var FileUploadWrapper = /*#__PURE__*/styled("div", {
|
|
17
16
|
target: "eq80mh0",
|
|
@@ -32,16 +31,17 @@ function FieldRenderer(_ref) {
|
|
|
32
31
|
Label = _ref.Label,
|
|
33
32
|
field = _ref.field;
|
|
34
33
|
var Bind = getBind();
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
var imagesOnly = field.settings && field.settings.imagesOnly;
|
|
35
|
+
return /*#__PURE__*/React.createElement(Bind, null, function (bind) {
|
|
36
|
+
var value = bind.value,
|
|
37
|
+
onChange = bind.onChange;
|
|
39
38
|
return /*#__PURE__*/React.createElement(FileUploadWrapper, {
|
|
40
39
|
className: imageWrapperStyles
|
|
41
40
|
}, /*#__PURE__*/React.createElement(FileManager, {
|
|
42
|
-
multiple: true
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
multiple: true,
|
|
42
|
+
images: imagesOnly
|
|
43
|
+
}, function (_ref2) {
|
|
44
|
+
var showFileManager = _ref2.showFileManager;
|
|
45
45
|
|
|
46
46
|
var selectFiles = function selectFiles() {
|
|
47
47
|
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
|
|
@@ -80,16 +80,12 @@ function FieldRenderer(_ref) {
|
|
|
80
80
|
}));
|
|
81
81
|
}), /*#__PURE__*/React.createElement(Cell, {
|
|
82
82
|
span: 3
|
|
83
|
-
}, /*#__PURE__*/React.createElement(File, {
|
|
83
|
+
}, /*#__PURE__*/React.createElement(File, Object.assign({}, bind, {
|
|
84
84
|
showFileManager: function showFileManager() {
|
|
85
85
|
return selectFiles();
|
|
86
86
|
},
|
|
87
87
|
placeholder: t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["Select a file\""])))
|
|
88
|
-
}))
|
|
89
|
-
span: 12
|
|
90
|
-
}, /*#__PURE__*/React.createElement(FormElementMessage, {
|
|
91
|
-
error: true
|
|
92
|
-
}, validation.message)));
|
|
88
|
+
}))));
|
|
93
89
|
}));
|
|
94
90
|
});
|
|
95
91
|
}
|
|
@@ -110,14 +106,14 @@ var plugin = {
|
|
|
110
106
|
rendererName: "file-inputs",
|
|
111
107
|
name: t(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["File Inputs"]))),
|
|
112
108
|
description: t(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["Enables selecting multiple files via File Manager."]))),
|
|
113
|
-
canUse: function canUse(
|
|
114
|
-
var field =
|
|
109
|
+
canUse: function canUse(_ref3) {
|
|
110
|
+
var field = _ref3.field;
|
|
115
111
|
return field.type === "file" && field.multipleValues;
|
|
116
112
|
},
|
|
117
|
-
render: function render(
|
|
118
|
-
var field =
|
|
119
|
-
getBind =
|
|
120
|
-
Label =
|
|
113
|
+
render: function render(_ref4) {
|
|
114
|
+
var field = _ref4.field,
|
|
115
|
+
getBind = _ref4.getBind,
|
|
116
|
+
Label = _ref4.Label;
|
|
121
117
|
return /*#__PURE__*/React.createElement(FieldRenderer, {
|
|
122
118
|
field: field,
|
|
123
119
|
getBind: getBind,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
|
|
3
|
-
var _templateObject, _templateObject2;
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
4
4
|
|
|
5
5
|
import React from "react";
|
|
6
6
|
import debounce from "lodash/debounce";
|
|
@@ -9,8 +9,10 @@ import { i18n } from "@webiny/app/i18n";
|
|
|
9
9
|
import { Link } from "@webiny/react-router";
|
|
10
10
|
import { useReference } from "./useReference";
|
|
11
11
|
import { renderItem } from "./renderItem";
|
|
12
|
+
import { createEntryUrl } from "./createEntryUrl";
|
|
12
13
|
var t = i18n.ns("app-headless-cms/admin/fields/ref");
|
|
13
|
-
var
|
|
14
|
+
var unpublishedLabel = t(_templateObject || (_templateObject = _taggedTemplateLiteral(["Selected content entry is not published. Make sure to {publishItLink} before publishing the main content entry."])));
|
|
15
|
+
var publishedLabel = t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["Selected content entry is published. You can view it {here}."])));
|
|
14
16
|
|
|
15
17
|
function ContentEntriesAutocomplete(_ref) {
|
|
16
18
|
var bind = _ref.bind,
|
|
@@ -26,14 +28,22 @@ function ContentEntriesAutocomplete(_ref) {
|
|
|
26
28
|
loading = _useReference.loading,
|
|
27
29
|
onChange = _useReference.onChange;
|
|
28
30
|
|
|
29
|
-
var
|
|
31
|
+
var entryInfo = null;
|
|
30
32
|
|
|
31
33
|
if (value && !value.published) {
|
|
32
|
-
var link =
|
|
33
|
-
|
|
34
|
+
var link = createEntryUrl(value);
|
|
35
|
+
entryInfo = unpublishedLabel({
|
|
34
36
|
publishItLink: /*#__PURE__*/React.createElement(Link, {
|
|
35
37
|
to: link
|
|
36
|
-
}, t(
|
|
38
|
+
}, t(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["publish it"]))))
|
|
39
|
+
});
|
|
40
|
+
} else if (value) {
|
|
41
|
+
var _link = createEntryUrl(value);
|
|
42
|
+
|
|
43
|
+
entryInfo = publishedLabel({
|
|
44
|
+
here: /*#__PURE__*/React.createElement(Link, {
|
|
45
|
+
to: _link
|
|
46
|
+
}, t(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["here"]))))
|
|
37
47
|
});
|
|
38
48
|
}
|
|
39
49
|
|
|
@@ -44,7 +54,7 @@ function ContentEntriesAutocomplete(_ref) {
|
|
|
44
54
|
value: value ? value.id : null,
|
|
45
55
|
options: options,
|
|
46
56
|
label: field.label,
|
|
47
|
-
description: /*#__PURE__*/React.createElement(React.Fragment, null, field.helpText,
|
|
57
|
+
description: /*#__PURE__*/React.createElement(React.Fragment, null, field.helpText, entryInfo),
|
|
48
58
|
onInput: debounce(function (search) {
|
|
49
59
|
return setSearch(search);
|
|
50
60
|
}, 250)
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import styled from "@emotion/styled";
|
|
3
3
|
import { Typography } from "@webiny/ui/Typography";
|
|
4
|
+
import { createEntryUrl } from "./createEntryUrl";
|
|
5
|
+
import { Link } from "@webiny/react-router";
|
|
4
6
|
var ModelId = /*#__PURE__*/styled("span", {
|
|
5
7
|
target: "ejkg0kv0",
|
|
6
8
|
label: "ModelId"
|
|
7
9
|
})({
|
|
8
10
|
color: "var(--mdc-theme-text-secondary-on-background) !important"
|
|
9
11
|
});
|
|
10
|
-
export var renderItem = function renderItem(
|
|
12
|
+
export var renderItem = function renderItem(props) {
|
|
11
13
|
return /*#__PURE__*/React.createElement(Typography, {
|
|
12
14
|
use: "body2"
|
|
13
|
-
},
|
|
15
|
+
}, /*#__PURE__*/React.createElement(Link, {
|
|
16
|
+
to: createEntryUrl(props)
|
|
17
|
+
}, props.name), /*#__PURE__*/React.createElement("br", null), /*#__PURE__*/React.createElement(ModelId, null, "Model: ", props.modelName));
|
|
14
18
|
};
|
|
@@ -176,7 +176,7 @@ export var useReference = function useReference(_ref) {
|
|
|
176
176
|
variables: {
|
|
177
177
|
entry: {
|
|
178
178
|
modelId: value.modelId,
|
|
179
|
-
|
|
179
|
+
id: value.id
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
}).then(function (res) {
|
|
@@ -205,7 +205,7 @@ export var useReference = function useReference(_ref) {
|
|
|
205
205
|
});
|
|
206
206
|
return bind.onChange({
|
|
207
207
|
modelId: entry.modelId,
|
|
208
|
-
|
|
208
|
+
id: entry.id
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
211
|
|
|
@@ -156,7 +156,7 @@ export var useReferences = function useReferences(_ref) {
|
|
|
156
156
|
bind.onChange(values.map(function (item) {
|
|
157
157
|
return {
|
|
158
158
|
modelId: item.modelId,
|
|
159
|
-
|
|
159
|
+
id: item.id
|
|
160
160
|
};
|
|
161
161
|
}));
|
|
162
162
|
}, []); // Format options for the Autocomplete component.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
type: "cms-editor-field-validator-pattern",
|
|
3
|
+
name: "cms-editor-field-validator-pattern-lower-case-space",
|
|
4
|
+
pattern: {
|
|
5
|
+
message: "Only lower case characters and space are allowed.",
|
|
6
|
+
name: "lowerCaseSpace",
|
|
7
|
+
label: "Lower case + space"
|
|
8
|
+
}
|
|
9
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
type: "cms-editor-field-validator-pattern",
|
|
3
|
+
name: "cms-editor-field-validator-pattern-upper-case-space",
|
|
4
|
+
pattern: {
|
|
5
|
+
message: "Only upper case characters and space are allowed.",
|
|
6
|
+
name: "upperCaseSpace",
|
|
7
|
+
label: "Upper case + space"
|
|
8
|
+
}
|
|
9
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
|
|
3
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
4
4
|
|
|
5
5
|
import React from "react";
|
|
6
6
|
import { ReactComponent as FileIcon } from "@svgr/webpack!./icons/round_insert_drive_file-24px.svg";
|
|
7
7
|
import { i18n } from "@webiny/app/i18n";
|
|
8
|
+
import { Cell, Grid } from "@webiny/ui/Grid";
|
|
9
|
+
import { Radio } from "@webiny/ui/Radio";
|
|
8
10
|
var t = i18n.ns("app-headless-cms/admin/fields");
|
|
9
11
|
var plugin = {
|
|
10
12
|
type: "cms-editor-field-type",
|
|
@@ -15,6 +17,7 @@ var plugin = {
|
|
|
15
17
|
description: t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["Images, videos and other files."]))),
|
|
16
18
|
icon: /*#__PURE__*/React.createElement(FileIcon, null),
|
|
17
19
|
validators: ["required"],
|
|
20
|
+
listValidators: ["minLength", "maxLength"],
|
|
18
21
|
allowMultipleValues: true,
|
|
19
22
|
allowPredefinedValues: false,
|
|
20
23
|
multipleValuesLabel: t(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["Use as a list of files or an image gallery"]))),
|
|
@@ -26,6 +29,17 @@ var plugin = {
|
|
|
26
29
|
name: ""
|
|
27
30
|
}
|
|
28
31
|
};
|
|
32
|
+
},
|
|
33
|
+
renderSettings: function renderSettings(_ref) {
|
|
34
|
+
var Bind = _ref.form.Bind;
|
|
35
|
+
return /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Cell, {
|
|
36
|
+
span: 12
|
|
37
|
+
}, /*#__PURE__*/React.createElement(Bind, {
|
|
38
|
+
name: "settings.imagesOnly"
|
|
39
|
+
}, /*#__PURE__*/React.createElement(Radio, {
|
|
40
|
+
label: t(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["Images only"]))),
|
|
41
|
+
description: t(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["Allow only images to be selected"])))
|
|
42
|
+
}))));
|
|
29
43
|
}
|
|
30
44
|
}
|
|
31
45
|
};
|
|
@@ -21,7 +21,8 @@ var plugin = {
|
|
|
21
21
|
name: "cms-editor-field-type-ref",
|
|
22
22
|
field: {
|
|
23
23
|
type: "ref",
|
|
24
|
-
validators: [],
|
|
24
|
+
validators: ["required"],
|
|
25
|
+
listValidators: ["minLength", "maxLength"],
|
|
25
26
|
label: t(_templateObject || (_templateObject = _taggedTemplateLiteral(["Reference"]))),
|
|
26
27
|
description: t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["Reference existing content entries. For example, a book can reference one or more authors."]))),
|
|
27
28
|
icon: /*#__PURE__*/React.createElement(RefIcon, null),
|
|
@@ -136,7 +137,7 @@ var plugin = {
|
|
|
136
137
|
graphql: {
|
|
137
138
|
queryField:
|
|
138
139
|
/* GraphQL */
|
|
139
|
-
"\n {\n modelId\n
|
|
140
|
+
"\n {\n modelId\n id\n }\n "
|
|
140
141
|
}
|
|
141
142
|
}
|
|
142
143
|
};
|
package/admin/plugins/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
declare const _default: () => (import("../../types").CmsEditorFormSettingsPlugin | import("../../types").CmsIconsPlugin | import("../../types").CmsFieldValueTransformer[] | import("@webiny/app/types").CacheGetObjectIdPlugin | import("@webiny/app/types").RoutePlugin[] | import("@webiny/
|
|
2
|
+
declare const _default: () => (import("../../types").CmsEditorFormSettingsPlugin | import("../../types").CmsIconsPlugin | import("../../types").CmsFieldValueTransformer[] | import("@webiny/app/types").CacheGetObjectIdPlugin | import("@webiny/app/types").RoutePlugin[] | import("@webiny/ui-composer/UIView").UIViewPlugin<import("@webiny/app-admin/ui/views/NavigationView").NavigationView>[] | import("@webiny/app-admin/types").AdminInstallationPlugin | import("@webiny/plugins/types").Plugin<{
|
|
3
3
|
type: "graphql-playground-tab";
|
|
4
4
|
tab(params: {
|
|
5
5
|
locale: string;
|
|
6
6
|
identity: import("@webiny/app-security/types").SecurityIdentity;
|
|
7
7
|
}): import("@webiny/app-graphql-playground/types").GraphQLPlaygroundTab;
|
|
8
|
-
}>[] | import("../../types").CmsContentDetailsPlugin[] | {
|
|
8
|
+
}>[] | import("@webiny/app-admin/types").AdminAppPermissionRendererPlugin | import("../../types").CmsContentDetailsPlugin[] | {
|
|
9
9
|
name: string;
|
|
10
10
|
type: string;
|
|
11
11
|
render(): JSX.Element;
|