@webiny/app-headless-cms 5.23.1 → 5.24.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.
- package/admin/components/ContentEntryForm/ContentEntryForm.d.ts +2 -2
- package/admin/components/ContentEntryForm/ContentEntryFormPreview.d.ts +2 -2
- package/admin/components/ContentEntryForm/Fields.d.ts +3 -3
- package/admin/components/ContentEntryForm/Label.d.ts +2 -4
- package/admin/components/ContentEntryForm/RenderFieldElement.d.ts +4 -2
- package/admin/components/ContentEntryForm/functions/createValidators.d.ts +2 -1
- package/admin/components/ContentEntryForm/functions/getValue.d.ts +7 -4
- package/admin/components/ContentEntryForm/functions/getValue.js +5 -4
- package/admin/components/ContentEntryForm/functions/setValue.d.ts +8 -5
- package/admin/components/ContentEntryForm/functions/setValue.js +6 -5
- package/admin/components/ContentEntryForm/useBind.d.ts +8 -4
- package/admin/components/ContentEntryForm/useBind.js +17 -10
- package/admin/components/ContentEntryForm/useContentEntryForm.js +9 -5
- package/admin/components/ContentModelEditor/Context.d.ts +18 -9
- package/admin/components/ContentModelEditor/Context.js +40 -33
- package/admin/components/ContentModelEditor/Editor.d.ts +2 -2
- package/admin/components/ContentModelEditor/FieldsSidebar.d.ts +6 -4
- package/admin/components/ContentModelEditor/FieldsSidebar.js +11 -11
- package/admin/components/ContentModelEditor/Header.d.ts +3 -2
- package/admin/components/ContentModelEditor/Header.js +5 -2
- package/admin/components/DragPreview.d.ts +3 -2
- package/admin/components/DragPreview.js +6 -4
- package/admin/components/Draggable.d.ts +9 -7
- package/admin/components/Draggable.js +4 -3
- package/admin/components/DropZone/Center.d.ts +6 -6
- package/admin/components/DropZone/Center.js +7 -4
- package/admin/components/DropZone/Horizontal.d.ts +7 -5
- package/admin/components/DropZone/Horizontal.js +1 -1
- package/admin/components/DropZone/Vertical.d.ts +4 -4
- package/admin/components/DropZone/Vertical.js +1 -1
- package/admin/components/Droppable.d.ts +22 -13
- package/admin/components/Droppable.js +3 -3
- package/admin/components/FieldEditor/EditFieldDialog/AppearanceTab.d.ts +8 -2
- package/admin/components/FieldEditor/EditFieldDialog/AppearanceTab.js +7 -6
- package/admin/components/FieldEditor/EditFieldDialog/GeneralTab.d.ts +4 -4
- package/admin/components/FieldEditor/EditFieldDialog/PredefinedValues.d.ts +2 -2
- package/admin/components/FieldEditor/EditFieldDialog/PredefinedValues.js +3 -1
- package/admin/components/FieldEditor/EditFieldDialog/ValidatorsTab.js +26 -25
- package/admin/components/FieldEditor/EditFieldDialog/functions/getValue.d.ts +5 -4
- package/admin/components/FieldEditor/EditFieldDialog/functions/getValue.js +4 -4
- package/admin/components/FieldEditor/EditFieldDialog/functions/setValue.d.ts +6 -5
- package/admin/components/FieldEditor/EditFieldDialog/functions/setValue.js +6 -5
- package/admin/components/FieldEditor/EditFieldDialog.d.ts +6 -6
- package/admin/components/FieldEditor/EditFieldDialog.js +10 -10
- package/admin/components/FieldEditor/Field.d.ts +4 -4
- package/admin/components/FieldEditor/FieldEditor.d.ts +2 -2
- package/admin/components/FieldEditor/FieldEditor.js +9 -6
- package/admin/components/FieldEditor/FieldEditorContext.d.ts +65 -20
- package/admin/components/FieldEditor/FieldEditorContext.js +27 -27
- package/admin/components/FieldEditor/Styled.d.ts +2 -2
- package/admin/components/FieldEditor/utils/deleteField.d.ts +5 -7
- package/admin/components/FieldEditor/utils/deleteField.js +6 -6
- package/admin/components/FieldEditor/utils/getFieldPosition.d.ts +6 -5
- package/admin/components/FieldEditor/utils/getFieldPosition.js +3 -3
- package/admin/components/FieldEditor/utils/moveField.d.ts +4 -3
- package/admin/components/FieldEditor/utils/moveField.js +14 -10
- package/admin/components/FieldEditor/utils/moveRow.d.ts +5 -6
- package/admin/constants/statusLabels.d.ts +2 -8
- package/admin/constants/statusLabels.js +3 -2
- package/admin/contexts/Cms/index.d.ts +3 -3
- package/admin/contexts/Cms/index.js +2 -2
- package/admin/elements/ContentGroupMenuElement.js +1 -0
- package/admin/elements/ContentModelMenuElement.js +1 -0
- package/admin/elements/NothingToShowElement.d.ts +1 -1
- package/admin/graphql/contentEntries.d.ts +172 -11
- package/admin/graphql/contentEntries.js +55 -0
- package/admin/graphql/contentModels.d.ts +28 -0
- package/admin/graphql/contentModels.js +13 -2
- package/admin/hooks/useApolloClient.d.ts +2 -1
- package/admin/hooks/useLazyQuery.d.ts +3 -1
- package/admin/hooks/useMutation.d.ts +3 -1
- package/admin/hooks/useMutation.js +1 -1
- package/admin/hooks/usePermission.d.ts +21 -20
- package/admin/hooks/usePermission.js +5 -2
- package/admin/hooks/useQuery.d.ts +4 -1
- package/admin/hooks/useQueryLocale.d.ts +3 -1
- package/admin/menus/CmsMenuLoader.d.ts +1 -1
- package/admin/menus/CmsMenuLoader.js +5 -2
- package/admin/menus/ContentGroupsMenuItems.d.ts +2 -1
- package/admin/menus/ContentGroupsMenuItems.js +4 -6
- package/admin/menus/GlobalSearchPlugins.d.ts +2 -1
- package/admin/menus/GlobalSearchPlugins.js +1 -1
- package/admin/menus/NothingToShowElement.d.ts +2 -2
- package/admin/plugins/editor/defaultBar/BackButton.d.ts +1 -1
- package/admin/plugins/editor/defaultBar/CreateContentButton.d.ts +2 -2
- package/admin/plugins/editor/defaultBar/Divider.d.ts +1 -1
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettings.d.ts +4 -4
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsButton.d.ts +2 -2
- package/admin/plugins/editor/defaultBar/FormSettings/FormSettingsStyled.d.ts +2 -2
- package/admin/plugins/editor/defaultBar/Name/Name.d.ts +2 -2
- package/admin/plugins/editor/defaultBar/Name/Name.js +9 -4
- package/admin/plugins/editor/defaultBar/Name/NameStyled.d.ts +3 -3
- package/admin/plugins/editor/defaultBar/SaveContentModelButton.d.ts +2 -2
- package/admin/plugins/fieldRenderers/Accordion.d.ts +4 -5
- package/admin/plugins/fieldRenderers/Accordion.js +2 -1
- package/admin/plugins/fieldRenderers/DynamicSection.d.ts +5 -4
- package/admin/plugins/fieldRenderers/boolean/booleanSwitch.js +1 -0
- package/admin/plugins/fieldRenderers/checkboxes.js +1 -0
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithTimezone.d.ts +2 -1
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithTimezone.js +3 -3
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithoutTimezone.d.ts +2 -1
- package/admin/plugins/fieldRenderers/dateTime/DateTimeWithoutTimezone.js +2 -2
- package/admin/plugins/fieldRenderers/dateTime/Input.d.ts +2 -2
- package/admin/plugins/fieldRenderers/dateTime/Select.d.ts +3 -3
- package/admin/plugins/fieldRenderers/dateTime/Time.d.ts +2 -2
- package/admin/plugins/fieldRenderers/dateTime/dateTimeField.js +1 -0
- package/admin/plugins/fieldRenderers/dateTime/utils.d.ts +5 -3
- package/admin/plugins/fieldRenderers/file/File.d.ts +2 -2
- package/admin/plugins/fieldRenderers/file/File.js +1 -1
- package/admin/plugins/fieldRenderers/file/fileField.js +1 -0
- package/admin/plugins/fieldRenderers/file/fileFields.js +8 -2
- package/admin/plugins/fieldRenderers/file/utils.d.ts +8 -3
- package/admin/plugins/fieldRenderers/longText/longText.js +1 -0
- package/admin/plugins/fieldRenderers/number/numberInput.js +1 -0
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesAutocomplete.d.ts +6 -4
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesAutocomplete.js +5 -3
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesMultiAutoComplete.d.ts +6 -4
- package/admin/plugins/fieldRenderers/ref/components/ContentEntriesMultiAutoComplete.js +15 -9
- package/admin/plugins/fieldRenderers/ref/components/NewRefEntryFormDialog.d.ts +2 -1
- package/admin/plugins/fieldRenderers/ref/components/NewRefEntryFormDialog.js +3 -2
- package/admin/plugins/fieldRenderers/ref/components/createEntryUrl.d.ts +2 -2
- package/admin/plugins/fieldRenderers/ref/components/getOptions.d.ts +15 -1
- package/admin/plugins/fieldRenderers/ref/components/graphql.d.ts +60 -0
- package/admin/plugins/fieldRenderers/ref/components/graphql.js +16 -1
- package/admin/plugins/fieldRenderers/ref/components/renderItem.d.ts +2 -2
- package/admin/plugins/fieldRenderers/ref/components/useReference.d.ts +4 -4
- package/admin/plugins/fieldRenderers/ref/components/useReferences.d.ts +16 -8
- package/admin/plugins/fieldRenderers/ref/components/useReferences.js +1 -0
- package/admin/plugins/fieldRenderers/ref/hooks/useNewRefEntryDialog.d.ts +2 -4
- package/admin/plugins/fieldRenderers/ref/refInput.js +1 -0
- package/admin/plugins/fieldRenderers/ref/refInputs.js +1 -0
- package/admin/plugins/fieldRenderers/richText/richTextInput.js +1 -0
- package/admin/plugins/fieldRenderers/richText/richTextInputs.js +1 -0
- package/admin/plugins/fieldRenderers/text/textInput.js +1 -0
- package/admin/plugins/fieldValidators/date/createDateInputField.d.ts +2 -1
- package/admin/plugins/fieldValidators/gte.d.ts +2 -2
- package/admin/plugins/fieldValidators/gte.js +3 -2
- package/admin/plugins/fieldValidators/in.d.ts +2 -2
- package/admin/plugins/fieldValidators/in.js +3 -2
- package/admin/plugins/fieldValidators/lte.d.ts +2 -2
- package/admin/plugins/fieldValidators/lte.js +3 -2
- package/admin/plugins/fieldValidators/maxLength.d.ts +2 -2
- package/admin/plugins/fieldValidators/maxLength.js +3 -2
- package/admin/plugins/fieldValidators/minLength.d.ts +2 -2
- package/admin/plugins/fieldValidators/minLength.js +3 -2
- package/admin/plugins/fieldValidators/pattern.d.ts +2 -2
- package/admin/plugins/fieldValidators/pattern.js +3 -2
- package/admin/plugins/fieldValidators/patternPlugins/email.d.ts +2 -2
- package/admin/plugins/fieldValidators/patternPlugins/email.js +3 -2
- package/admin/plugins/fieldValidators/patternPlugins/lowerCase.d.ts +2 -2
- package/admin/plugins/fieldValidators/patternPlugins/lowerCase.js +3 -2
- package/admin/plugins/fieldValidators/patternPlugins/lowerCaseSpace.d.ts +2 -2
- package/admin/plugins/fieldValidators/patternPlugins/lowerCaseSpace.js +3 -2
- package/admin/plugins/fieldValidators/patternPlugins/upperCase.d.ts +2 -2
- package/admin/plugins/fieldValidators/patternPlugins/upperCase.js +3 -2
- package/admin/plugins/fieldValidators/patternPlugins/upperCaseSpace.d.ts +2 -2
- package/admin/plugins/fieldValidators/patternPlugins/upperCaseSpace.js +3 -2
- package/admin/plugins/fieldValidators/patternPlugins/url.d.ts +2 -2
- package/admin/plugins/fieldValidators/patternPlugins/url.js +3 -2
- package/admin/plugins/fieldValidators/required.d.ts +2 -2
- package/admin/plugins/fieldValidators/required.js +3 -2
- package/admin/plugins/fields/PredefinedValuesDynamicFieldset.d.ts +3 -2
- package/admin/plugins/fields/object/ObjectFields.d.ts +7 -4
- package/admin/plugins/fields/ref.js +2 -1
- package/admin/plugins/icons.js +1 -1
- package/admin/plugins/index.d.ts +1 -1
- package/admin/plugins/install.d.ts +22 -0
- package/admin/plugins/install.js +36 -30
- package/admin/plugins/permissionRenderer/CmsPermissions.d.ts +11 -5
- package/admin/plugins/permissionRenderer/CmsPermissions.js +5 -1
- package/admin/plugins/permissionRenderer/components/ContentEntryPermission.d.ts +12 -8
- package/admin/plugins/permissionRenderer/components/ContentModelGroupPermission.d.ts +11 -8
- package/admin/plugins/permissionRenderer/components/ContentModelList.d.ts +8 -6
- package/admin/plugins/permissionRenderer/components/ContentModelList.js +3 -3
- package/admin/plugins/permissionRenderer/components/ContentModelPermission.d.ts +14 -10
- package/admin/plugins/permissionRenderer/components/ContentModelPermission.js +3 -2
- package/admin/plugins/permissionRenderer/components/PermissionRendererWrapper.d.ts +10 -5
- package/admin/plugins/permissionRenderer/components/PermissionRendererWrapper.js +4 -0
- package/admin/plugins/permissionRenderer/components/PermissionSelector.d.ts +11 -26
- package/admin/plugins/permissionRenderer/components/StyledComponents.d.ts +1 -1
- package/admin/plugins/permissionRenderer/components/types.d.ts +16 -0
- package/admin/plugins/permissionRenderer/components/types.js +1 -0
- package/admin/plugins/permissionRenderer/components/useCmsData.d.ts +17 -1
- package/admin/plugins/permissionRenderer/components/useCmsData.js +39 -25
- package/admin/plugins/permissionRenderer/index.d.ts +2 -2
- package/admin/plugins/permissionRenderer/index.js +3 -2
- package/admin/plugins/upgrades/5.19.0/createRepublishMutation.d.ts +2 -1
- package/admin/plugins/upgrades/5.19.0/fetchModelEntries.js +1 -0
- package/admin/plugins/upgrades/v5.0.0.js +1 -0
- package/admin/plugins/upgrades/v5.19.0.js +1 -0
- package/admin/plugins/upgrades/v5.5.0.js +1 -0
- package/admin/plugins/upgrades/v5.8.0.js +1 -0
- package/admin/plugins/validators/gte.d.ts +2 -2
- package/admin/plugins/validators/gte.js +3 -2
- package/admin/plugins/validators/in.d.ts +2 -2
- package/admin/plugins/validators/in.js +3 -2
- package/admin/plugins/validators/lte.d.ts +2 -2
- package/admin/plugins/validators/lte.js +3 -2
- package/admin/plugins/validators/maxLength.d.ts +2 -2
- package/admin/plugins/validators/maxLength.js +3 -2
- package/admin/plugins/validators/minLength.d.ts +2 -2
- package/admin/plugins/validators/minLength.js +3 -2
- package/admin/plugins/validators/pattern.d.ts +3 -9
- package/admin/plugins/validators/pattern.js +3 -2
- package/admin/plugins/validators/patternPlugins/email.d.ts +3 -10
- package/admin/plugins/validators/patternPlugins/email.js +3 -2
- package/admin/plugins/validators/patternPlugins/lowerCase.d.ts +3 -10
- package/admin/plugins/validators/patternPlugins/lowerCase.js +3 -2
- package/admin/plugins/validators/patternPlugins/lowerCaseSpace.d.ts +3 -10
- package/admin/plugins/validators/patternPlugins/lowerCaseSpace.js +3 -2
- package/admin/plugins/validators/patternPlugins/upperCase.d.ts +3 -10
- package/admin/plugins/validators/patternPlugins/upperCase.js +3 -2
- package/admin/plugins/validators/patternPlugins/upperCaseSpace.d.ts +3 -10
- package/admin/plugins/validators/patternPlugins/upperCaseSpace.js +3 -2
- package/admin/plugins/validators/patternPlugins/url.d.ts +3 -10
- package/admin/plugins/validators/patternPlugins/url.js +3 -2
- package/admin/plugins/validators/required.d.ts +2 -2
- package/admin/plugins/validators/required.js +3 -2
- package/admin/views/contentEntries/ContentEntries.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntries.js +2 -2
- package/admin/views/contentEntries/ContentEntriesContext.d.ts +9 -5
- package/admin/views/contentEntries/ContentEntriesContext.js +1 -1
- package/admin/views/contentEntries/ContentEntriesList.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntriesList.js +11 -1
- package/admin/views/contentEntries/ContentEntry/ContentEntryContext.d.ts +1 -4
- package/admin/views/contentEntries/ContentEntry/ContentEntryContext.js +8 -6
- package/admin/views/contentEntries/ContentEntry/RevisionListItem.d.ts +4 -4
- package/admin/views/contentEntries/ContentEntry/RevisionListItem.js +11 -2
- package/admin/views/contentEntries/ContentEntry/RevisionsList.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntry/cache.d.ts +9 -7
- package/admin/views/contentEntries/ContentEntry/cache.js +22 -16
- package/admin/views/contentEntries/ContentEntry/header/Header.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntry/header/contentFormOptionsMenu/ContentFormOptionsMenu.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntry/header/requestReview/RequestReview.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntry/header/revisionSelector/RevisionSelector.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntry/header/saveAndPublishContent/SaveAndPublishContent.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntry/header/saveContent/SaveContent.d.ts +2 -2
- package/admin/views/contentEntries/ContentEntry/useRevision.d.ts +31 -9
- package/admin/views/contentEntries/ContentEntry/useRevision.js +135 -113
- package/admin/views/contentEntries/ContentEntry.d.ts +1 -2
- package/admin/views/contentEntries/ContentEntry.js +2 -5
- package/admin/views/contentEntries/hooks/useContentEntriesList.d.ts +2 -5
- package/admin/views/contentModelGroups/ContentModelGroups.d.ts +2 -2
- package/admin/views/contentModelGroups/ContentModelGroups.js +2 -2
- package/admin/views/contentModelGroups/ContentModelGroupsDataList.d.ts +4 -4
- package/admin/views/contentModelGroups/ContentModelGroupsDataList.js +13 -21
- package/admin/views/contentModelGroups/ContentModelGroupsForm.d.ts +4 -4
- package/admin/views/contentModelGroups/ContentModelGroupsForm.js +49 -32
- package/admin/views/contentModelGroups/DelayedOnChange.d.ts +29 -12
- package/admin/views/contentModelGroups/DelayedOnChange.js +13 -13
- package/admin/views/contentModelGroups/IconPicker.d.ts +3 -2
- package/admin/views/contentModelGroups/IconPicker.js +1 -1
- package/admin/views/contentModelGroups/graphql.d.ts +68 -0
- package/admin/views/contentModelGroups/graphql.js +26 -5
- package/admin/views/contentModels/CloneContentModelDialog.js +6 -5
- package/admin/views/contentModels/ContentModelEditor.d.ts +3 -2
- package/admin/views/contentModels/ContentModelEditor.js +6 -3
- package/admin/views/contentModels/ContentModels.d.ts +2 -2
- package/admin/views/contentModels/ContentModels.js +5 -5
- package/admin/views/contentModels/ContentModelsDataList.d.ts +4 -4
- package/admin/views/contentModels/ContentModelsDataList.js +17 -21
- package/admin/views/contentModels/NewContentModelDialog.d.ts +2 -2
- package/admin/views/contentModels/NewContentModelDialog.js +151 -76
- package/admin/views/contentModels/cache.d.ts +5 -4
- package/admin/views/contentModels/cache.js +9 -9
- package/admin/views/contentModels/types.d.ts +4 -0
- package/admin/views/contentModels/types.js +1 -0
- package/admin/views/utils.d.ts +3 -2
- package/admin/views/utils.js +5 -18
- package/admin/viewsGraphql.d.ts +62 -0
- package/admin/viewsGraphql.js +30 -5
- package/package.json +20 -17
- package/types.d.ts +88 -23
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { FormAPI } from "@webiny/form/types";
|
|
3
3
|
import { UseContentEntryFormParams } from "./useContentEntryForm";
|
|
4
4
|
interface ContentEntryFormProps extends UseContentEntryFormParams {
|
|
5
5
|
onForm?: (form: FormAPI) => void;
|
|
6
6
|
}
|
|
7
|
-
export declare const ContentEntryForm:
|
|
7
|
+
export declare const ContentEntryForm: React.FC<ContentEntryFormProps>;
|
|
8
8
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { CmsEditorContentModel } from "../../../types";
|
|
3
3
|
interface Props {
|
|
4
4
|
contentModel: CmsEditorContentModel;
|
|
5
5
|
}
|
|
6
|
-
export declare const ContentEntryFormPreview:
|
|
6
|
+
export declare const ContentEntryFormPreview: React.FC<Props>;
|
|
7
7
|
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
import { BindComponent } from "@webiny/form";
|
|
3
3
|
import { CmsEditorContentModel, CmsEditorField, CmsEditorFieldsLayout } from "../../../types";
|
|
4
|
-
interface
|
|
4
|
+
interface FieldsProps {
|
|
5
5
|
Bind: BindComponent;
|
|
6
6
|
contentModel: CmsEditorContentModel;
|
|
7
7
|
fields: CmsEditorField[];
|
|
8
8
|
layout: CmsEditorFieldsLayout;
|
|
9
9
|
gridClassName?: string;
|
|
10
10
|
}
|
|
11
|
-
export declare const Fields:
|
|
11
|
+
export declare const Fields: React.FC<FieldsProps>;
|
|
12
12
|
export {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { CmsEditorField, CmsEditorContentModel } from "../../../types";
|
|
2
3
|
import { BindComponent } from "@webiny/form";
|
|
3
|
-
|
|
4
|
+
interface RenderFieldElementProps {
|
|
4
5
|
field: CmsEditorField;
|
|
5
6
|
Bind: BindComponent;
|
|
6
7
|
contentModel: CmsEditorContentModel;
|
|
7
|
-
}
|
|
8
|
+
}
|
|
9
|
+
declare const RenderFieldElement: React.FC<RenderFieldElementProps>;
|
|
8
10
|
export default RenderFieldElement;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { CmsEditorFieldValidator } from "../../../../types";
|
|
2
|
+
export declare const createValidators: (validation: CmsEditorFieldValidator[]) => ((value: string | string[]) => Promise<void>)[];
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { CmsEditorField } from "../../../../types";
|
|
2
|
+
interface Params {
|
|
2
3
|
bind: any;
|
|
3
|
-
field:
|
|
4
|
-
index:
|
|
5
|
-
}
|
|
4
|
+
field: Pick<CmsEditorField, "multipleValues">;
|
|
5
|
+
index: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const getValue: (params: Params) => string;
|
|
8
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
// TODO @ts-refactor figure out correct bind types and remove any
|
|
2
|
+
export var getValue = function getValue(params) {
|
|
3
|
+
var bind = params.bind,
|
|
4
|
+
field = params.field,
|
|
5
|
+
index = params.index;
|
|
5
6
|
var value = bind.value || null;
|
|
6
7
|
|
|
7
8
|
if (field.multipleValues) {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { CmsEditorField } from "../../../../types";
|
|
2
|
+
interface Params {
|
|
3
|
+
value: string[];
|
|
3
4
|
bind: any;
|
|
4
|
-
field:
|
|
5
|
-
index:
|
|
6
|
-
}
|
|
5
|
+
field: Pick<CmsEditorField, "multipleValues">;
|
|
6
|
+
index: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const setValue: (params: Params) => void;
|
|
9
|
+
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
// TODO @ts-refactor figure out correct bind types and remove any
|
|
3
|
+
export var setValue = function setValue(params) {
|
|
4
|
+
var value = params.value,
|
|
5
|
+
bind = params.bind,
|
|
6
|
+
field = params.field,
|
|
7
|
+
index = params.index;
|
|
7
8
|
var newValue = field.multipleValues ? _toConsumableArray(bind.value || []) : bind.value;
|
|
8
9
|
|
|
9
10
|
if (field.multipleValues) {
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { BindComponent } from "@webiny/form";
|
|
1
|
+
import { BindComponent as BaseBindComponent } from "@webiny/form";
|
|
2
2
|
import { CmsEditorField } from "../../../types";
|
|
3
|
+
interface BindComponent extends BaseBindComponent {
|
|
4
|
+
parentName?: string;
|
|
5
|
+
}
|
|
3
6
|
interface UseBindProps {
|
|
4
7
|
field: CmsEditorField;
|
|
5
|
-
Bind: BindComponent
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
Bind: BindComponent;
|
|
9
|
+
}
|
|
10
|
+
export interface GetBindCallable {
|
|
11
|
+
(index?: number): any;
|
|
8
12
|
}
|
|
9
13
|
export declare function useBind({ Bind: ParentBind, field }: UseBindProps): (index?: any) => any;
|
|
10
14
|
export {};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Figure out correct types for this and packages/app-headless-cms/src/admin/plugins/fieldRenderers/DynamicSection.tsx files
|
|
6
|
+
* TODO @ts-refactor
|
|
7
|
+
*/
|
|
3
8
|
import React, { useRef, useCallback, cloneElement } from "react";
|
|
4
9
|
import { createValidators } from "./functions/createValidators";
|
|
5
10
|
export function useBind(_ref) {
|
|
@@ -25,10 +30,10 @@ export function useBind(_ref) {
|
|
|
25
30
|
var isMultipleValues = index === -1 && field.multipleValues;
|
|
26
31
|
var inputValidators = isMultipleValues ? listValidators : validators;
|
|
27
32
|
|
|
28
|
-
memoizedBindComponents.current[name] = function UseBind(
|
|
29
|
-
var childName =
|
|
30
|
-
childValidators =
|
|
31
|
-
children =
|
|
33
|
+
memoizedBindComponents.current[name] = function UseBind(params) {
|
|
34
|
+
var childName = params.name,
|
|
35
|
+
childValidators = params.validators,
|
|
36
|
+
children = params.children;
|
|
32
37
|
return /*#__PURE__*/React.createElement(ParentBind, {
|
|
33
38
|
name: childName || name,
|
|
34
39
|
validators: childValidators || inputValidators,
|
|
@@ -51,13 +56,15 @@ export function useBind(_ref) {
|
|
|
51
56
|
};
|
|
52
57
|
|
|
53
58
|
props.removeValue = function (index) {
|
|
54
|
-
if (index
|
|
55
|
-
|
|
56
|
-
_value = [].concat(_toConsumableArray(_value.slice(0, index)), _toConsumableArray(_value.slice(index + 1)));
|
|
57
|
-
bind.onChange(_value); // To make sure the field is still valid, we must trigger validation.
|
|
58
|
-
|
|
59
|
-
bind.form.validateInput(field.fieldId);
|
|
59
|
+
if (index < 0) {
|
|
60
|
+
return;
|
|
60
61
|
}
|
|
62
|
+
|
|
63
|
+
var value = bind.value;
|
|
64
|
+
value = [].concat(_toConsumableArray(value.slice(0, index)), _toConsumableArray(value.slice(index + 1)));
|
|
65
|
+
bind.onChange(value); // To make sure the field is still valid, we must trigger validation.
|
|
66
|
+
|
|
67
|
+
bind.form.validateInput(field.fieldId);
|
|
61
68
|
};
|
|
62
69
|
}
|
|
63
70
|
|
|
@@ -8,7 +8,7 @@ import { useCallback, useMemo, useState } from "react";
|
|
|
8
8
|
import pick from "lodash/pick";
|
|
9
9
|
import { useRouter } from "@webiny/react-router";
|
|
10
10
|
import { useSnackbar } from "@webiny/app-admin/hooks/useSnackbar";
|
|
11
|
-
import
|
|
11
|
+
import { createCreateFromMutation, createCreateMutation, createUpdateMutation } from "../../graphql/contentEntries";
|
|
12
12
|
import { useMutation } from "../../hooks";
|
|
13
13
|
import * as GQLCache from "../../views/contentEntries/ContentEntry/cache";
|
|
14
14
|
import { prepareFormData } from "../../views/contentEntries/ContentEntry/prepareFormData";
|
|
@@ -63,10 +63,10 @@ export function useContentEntryForm(params) {
|
|
|
63
63
|
|
|
64
64
|
var _useMemo = useMemo(function () {
|
|
65
65
|
return {
|
|
66
|
-
LIST_CONTENT:
|
|
67
|
-
CREATE_CONTENT:
|
|
68
|
-
UPDATE_CONTENT:
|
|
69
|
-
CREATE_CONTENT_FROM:
|
|
66
|
+
// LIST_CONTENT: createListQuery(contentModel),
|
|
67
|
+
CREATE_CONTENT: createCreateMutation(contentModel),
|
|
68
|
+
UPDATE_CONTENT: createUpdateMutation(contentModel),
|
|
69
|
+
CREATE_CONTENT_FROM: createCreateFromMutation(contentModel)
|
|
70
70
|
};
|
|
71
71
|
}, [contentModel.modelId]),
|
|
72
72
|
CREATE_CONTENT = _useMemo.CREATE_CONTENT,
|
|
@@ -84,6 +84,10 @@ export function useContentEntryForm(params) {
|
|
|
84
84
|
var _useMutation5 = useMutation(CREATE_CONTENT_FROM),
|
|
85
85
|
_useMutation6 = _slicedToArray(_useMutation5, 1),
|
|
86
86
|
createFromMutation = _useMutation6[0];
|
|
87
|
+
/**
|
|
88
|
+
* Note that when passing error.data variable we cast as InvalidFieldError[] because we know it is so.
|
|
89
|
+
*/
|
|
90
|
+
|
|
87
91
|
|
|
88
92
|
var setInvalidFieldValues = function setInvalidFieldValues(errors) {
|
|
89
93
|
var values = (errors || []).reduce(function (acc, er) {
|
|
@@ -1,23 +1,32 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ApolloClient } from "apollo-client";
|
|
3
|
-
import { CmsEditorContentModel } from "../../../types";
|
|
3
|
+
import { CmsEditorContentModel, CmsModel } from "../../../types";
|
|
4
4
|
export interface Context {
|
|
5
5
|
apolloClient: ApolloClient<any>;
|
|
6
|
-
data: CmsEditorContentModel;
|
|
6
|
+
data: CmsEditorContentModel | null;
|
|
7
7
|
isPristine: boolean;
|
|
8
8
|
getContentModel: (modelId: string) => Promise<any>;
|
|
9
9
|
saveContentModel: (data?: Record<string, any>) => Promise<any>;
|
|
10
|
-
setData: (setter:
|
|
10
|
+
setData: (setter: (model: CmsModel) => void, saveContentModel?: boolean) => Promise<any>;
|
|
11
11
|
}
|
|
12
12
|
export declare const contentModelEditorContext: React.Context<Context>;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
interface State {
|
|
14
|
+
modelId: string | null;
|
|
15
|
+
isPristine: boolean;
|
|
16
|
+
data: CmsModel | null;
|
|
17
|
+
}
|
|
18
|
+
interface Action {
|
|
19
|
+
data: Partial<State> | Partial<CmsModel>;
|
|
20
|
+
type: "state" | "data";
|
|
21
|
+
}
|
|
22
|
+
interface Reducer {
|
|
23
|
+
(prev: State, action: Action): State;
|
|
24
|
+
}
|
|
25
|
+
export declare const contentModelEditorReducer: Reducer;
|
|
26
|
+
interface ContentModelEditorProviderProps {
|
|
18
27
|
apolloClient: ApolloClient<any>;
|
|
19
28
|
modelId: string;
|
|
20
29
|
children: React.ReactElement;
|
|
21
30
|
}
|
|
22
|
-
export declare
|
|
31
|
+
export declare const ContentModelEditorProvider: React.FC<ContentModelEditorProviderProps>;
|
|
23
32
|
export {};
|
|
@@ -2,6 +2,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
4
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
|
+
// TODO @ts-refactor verify that types are correct
|
|
5
6
|
import React, { useEffect, useMemo, useReducer } from "react";
|
|
6
7
|
import get from "lodash/get";
|
|
7
8
|
import pick from "lodash/pick";
|
|
@@ -10,9 +11,9 @@ import { useSnackbar } from "@webiny/app-admin/hooks/useSnackbar";
|
|
|
10
11
|
import { GET_CONTENT_MODEL, UPDATE_CONTENT_MODEL } from "../../graphql/contentModels";
|
|
11
12
|
import { LIST_MENU_CONTENT_GROUPS_MODELS } from "../../viewsGraphql";
|
|
12
13
|
export var contentModelEditorContext = /*#__PURE__*/React.createContext(null);
|
|
13
|
-
export function contentModelEditorReducer(prev,
|
|
14
|
-
var data =
|
|
15
|
-
type =
|
|
14
|
+
export var contentModelEditorReducer = function contentModelEditorReducer(prev, action) {
|
|
15
|
+
var data = action.data,
|
|
16
|
+
type = action.type;
|
|
16
17
|
|
|
17
18
|
switch (type) {
|
|
18
19
|
case "state":
|
|
@@ -23,28 +24,30 @@ export function contentModelEditorReducer(prev, _ref) {
|
|
|
23
24
|
data: data
|
|
24
25
|
});
|
|
25
26
|
}
|
|
26
|
-
}
|
|
27
27
|
|
|
28
|
+
return prev;
|
|
29
|
+
};
|
|
28
30
|
/**
|
|
29
31
|
* Cleanup is required because backend always expects string value in predefined values entries
|
|
30
32
|
*/
|
|
33
|
+
|
|
31
34
|
var cleanupModelDataFields = function cleanupModelDataFields(fields) {
|
|
32
35
|
return fields.map(function (field) {
|
|
33
36
|
var predefinedValues = field.predefinedValues;
|
|
34
37
|
|
|
35
|
-
var
|
|
36
|
-
|
|
37
|
-
enabled =
|
|
38
|
-
|
|
39
|
-
values =
|
|
38
|
+
var _ref = predefinedValues || {},
|
|
39
|
+
_ref$enabled = _ref.enabled,
|
|
40
|
+
enabled = _ref$enabled === void 0 ? false : _ref$enabled,
|
|
41
|
+
_ref$values = _ref.values,
|
|
42
|
+
values = _ref$values === void 0 ? [] : _ref$values;
|
|
40
43
|
|
|
41
44
|
return _objectSpread(_objectSpread({}, field), {}, {
|
|
42
45
|
predefinedValues: {
|
|
43
46
|
enabled: enabled,
|
|
44
|
-
values: values.map(function (
|
|
45
|
-
var label =
|
|
46
|
-
value =
|
|
47
|
-
selected =
|
|
47
|
+
values: values.map(function (_ref2) {
|
|
48
|
+
var label = _ref2.label,
|
|
49
|
+
value = _ref2.value,
|
|
50
|
+
selected = _ref2.selected;
|
|
48
51
|
return {
|
|
49
52
|
label: label,
|
|
50
53
|
selected: selected || false,
|
|
@@ -62,14 +65,15 @@ var cleanupModelData = function cleanupModelData(data) {
|
|
|
62
65
|
});
|
|
63
66
|
};
|
|
64
67
|
|
|
65
|
-
export function ContentModelEditorProvider(
|
|
66
|
-
var children =
|
|
67
|
-
apolloClient =
|
|
68
|
-
modelId =
|
|
68
|
+
export var ContentModelEditorProvider = function ContentModelEditorProvider(_ref3) {
|
|
69
|
+
var children = _ref3.children,
|
|
70
|
+
apolloClient = _ref3.apolloClient,
|
|
71
|
+
modelId = _ref3.modelId;
|
|
69
72
|
|
|
70
73
|
var _useReducer = useReducer(contentModelEditorReducer, {
|
|
71
74
|
modelId: modelId,
|
|
72
|
-
isPristine: true
|
|
75
|
+
isPristine: true,
|
|
76
|
+
data: null
|
|
73
77
|
}),
|
|
74
78
|
_useReducer2 = _slicedToArray(_useReducer, 2),
|
|
75
79
|
state = _useReducer2[0],
|
|
@@ -91,16 +95,16 @@ export function ContentModelEditorProvider(_ref4) {
|
|
|
91
95
|
};
|
|
92
96
|
|
|
93
97
|
var saveContentModel = /*#__PURE__*/function () {
|
|
94
|
-
var
|
|
95
|
-
var
|
|
96
|
-
modelData,
|
|
97
|
-
response,
|
|
98
|
-
_args = arguments;
|
|
98
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(data) {
|
|
99
|
+
var modelData, response;
|
|
99
100
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
100
101
|
while (1) {
|
|
101
102
|
switch (_context.prev = _context.next) {
|
|
102
103
|
case 0:
|
|
103
|
-
data
|
|
104
|
+
if (!data) {
|
|
105
|
+
data = state.data;
|
|
106
|
+
}
|
|
107
|
+
|
|
104
108
|
modelData = pick(data, ["group", "layout", "fields", "name", "settings", "description", "titleFieldId"]);
|
|
105
109
|
_context.next = 4;
|
|
106
110
|
return apolloClient.mutate({
|
|
@@ -127,8 +131,8 @@ export function ContentModelEditorProvider(_ref4) {
|
|
|
127
131
|
}, _callee);
|
|
128
132
|
}));
|
|
129
133
|
|
|
130
|
-
return function saveContentModel() {
|
|
131
|
-
return
|
|
134
|
+
return function saveContentModel(_x) {
|
|
135
|
+
return _ref4.apply(this, arguments);
|
|
132
136
|
};
|
|
133
137
|
}();
|
|
134
138
|
/**
|
|
@@ -149,7 +153,7 @@ export function ContentModelEditorProvider(_ref4) {
|
|
|
149
153
|
};
|
|
150
154
|
|
|
151
155
|
var getContentModel = /*#__PURE__*/function () {
|
|
152
|
-
var
|
|
156
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(modelId) {
|
|
153
157
|
var response, _get, data, error;
|
|
154
158
|
|
|
155
159
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
@@ -176,13 +180,16 @@ export function ContentModelEditorProvider(_ref4) {
|
|
|
176
180
|
throw new Error(error);
|
|
177
181
|
|
|
178
182
|
case 6:
|
|
179
|
-
|
|
180
|
-
|
|
183
|
+
_context2.next = 8;
|
|
184
|
+
return setData(function () {
|
|
181
185
|
return data;
|
|
182
186
|
}, false);
|
|
183
|
-
return _context2.abrupt("return", response);
|
|
184
187
|
|
|
185
188
|
case 8:
|
|
189
|
+
setPristine(true);
|
|
190
|
+
return _context2.abrupt("return", response);
|
|
191
|
+
|
|
192
|
+
case 10:
|
|
186
193
|
case "end":
|
|
187
194
|
return _context2.stop();
|
|
188
195
|
}
|
|
@@ -190,8 +197,8 @@ export function ContentModelEditorProvider(_ref4) {
|
|
|
190
197
|
}, _callee2);
|
|
191
198
|
}));
|
|
192
199
|
|
|
193
|
-
return function getContentModel(
|
|
194
|
-
return
|
|
200
|
+
return function getContentModel(_x2) {
|
|
201
|
+
return _ref5.apply(this, arguments);
|
|
195
202
|
};
|
|
196
203
|
}();
|
|
197
204
|
|
|
@@ -217,4 +224,4 @@ export function ContentModelEditorProvider(_ref4) {
|
|
|
217
224
|
return /*#__PURE__*/React.createElement(Provider, {
|
|
218
225
|
value: value
|
|
219
226
|
}, children);
|
|
220
|
-
}
|
|
227
|
+
};
|
|
@@ -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>, "
|
|
3
|
-
export declare const Editor:
|
|
2
|
+
export declare const EditContainer: import("@emotion/styled-base").StyledComponent<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "slot" | "style" | "title" | "children" | "onError" | "color" | "translate" | "id" | "hidden" | "className" | "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 Editor: React.FC;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
onFieldDragStart:
|
|
4
|
-
}
|
|
1
|
+
import React, { DragEventHandler } from "react";
|
|
2
|
+
interface FieldsSidebarProps {
|
|
3
|
+
onFieldDragStart: DragEventHandler;
|
|
4
|
+
}
|
|
5
|
+
export declare const FieldsSidebar: React.FC<FieldsSidebarProps>;
|
|
6
|
+
export {};
|
|
@@ -51,20 +51,20 @@ var FieldHandle = /*#__PURE__*/styled("div", {
|
|
|
51
51
|
color: "var(--mdc-theme-on-surface)"
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
var Field = function Field(
|
|
55
|
-
var onFieldDragStart =
|
|
56
|
-
|
|
57
|
-
type =
|
|
58
|
-
label =
|
|
59
|
-
icon =
|
|
60
|
-
description =
|
|
54
|
+
var Field = function Field(props) {
|
|
55
|
+
var onFieldDragStart = props.onFieldDragStart,
|
|
56
|
+
_props$fieldType = props.fieldType,
|
|
57
|
+
type = _props$fieldType.type,
|
|
58
|
+
label = _props$fieldType.label,
|
|
59
|
+
icon = _props$fieldType.icon,
|
|
60
|
+
description = _props$fieldType.description;
|
|
61
61
|
return /*#__PURE__*/React.createElement(Draggable, {
|
|
62
62
|
beginDrag: {
|
|
63
63
|
type: "newField",
|
|
64
64
|
fieldType: type
|
|
65
65
|
}
|
|
66
|
-
}, function (
|
|
67
|
-
var drag =
|
|
66
|
+
}, function (_ref) {
|
|
67
|
+
var drag = _ref.drag;
|
|
68
68
|
return /*#__PURE__*/React.createElement("div", {
|
|
69
69
|
ref: drag,
|
|
70
70
|
style: {
|
|
@@ -78,8 +78,8 @@ var Field = function Field(_ref) {
|
|
|
78
78
|
});
|
|
79
79
|
};
|
|
80
80
|
|
|
81
|
-
export var FieldsSidebar = function FieldsSidebar(
|
|
82
|
-
var onFieldDragStart =
|
|
81
|
+
export var FieldsSidebar = function FieldsSidebar(_ref2) {
|
|
82
|
+
var onFieldDragStart = _ref2.onFieldDragStart;
|
|
83
83
|
var fieldTypePlugin = plugins.byType("cms-editor-field-type");
|
|
84
84
|
return /*#__PURE__*/React.createElement(React.Fragment, null, fieldTypePlugin.map(function (fieldPlugin) {
|
|
85
85
|
return /*#__PURE__*/React.createElement(Field, {
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const EditorBar: React.FC;
|
|
3
|
+
export default EditorBar;
|
|
@@ -5,7 +5,8 @@ import { css } from "emotion";
|
|
|
5
5
|
var topBar = /*#__PURE__*/css({
|
|
6
6
|
boxShadow: "1px 0px 5px 0px rgba(128,128,128,1)"
|
|
7
7
|
}, "label:topBar;");
|
|
8
|
-
|
|
8
|
+
|
|
9
|
+
var EditorBar = function EditorBar() {
|
|
9
10
|
return /*#__PURE__*/React.createElement(TopAppBar, {
|
|
10
11
|
className: topBar,
|
|
11
12
|
fixed: true,
|
|
@@ -21,4 +22,6 @@ export default function EditorBar() {
|
|
|
21
22
|
},
|
|
22
23
|
alignEnd: true
|
|
23
24
|
}, renderPlugins("content-model-editor-default-bar-right")));
|
|
24
|
-
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default EditorBar;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
declare const DragPreview: React.FC;
|
|
3
|
+
export default DragPreview;
|
|
@@ -17,12 +17,13 @@ var onOffsetChange = function onOffsetChange(monitor) {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
var transform = "translate(".concat(offset.x - 15, "px, ").concat(offset.y - 15, "px)");
|
|
20
|
-
dragPreviewRef.style["transform"] = transform;
|
|
20
|
+
dragPreviewRef.style["transform"] = transform; // TODO @ts-refactor figure out better type
|
|
21
|
+
|
|
21
22
|
dragPreviewRef.style["-webkit-transform"] = transform;
|
|
22
23
|
};
|
|
23
24
|
};
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
var DragPreview = function DragPreview() {
|
|
26
27
|
var _useState = useState(0),
|
|
27
28
|
_useState2 = _slicedToArray(_useState, 2),
|
|
28
29
|
dragHelperOpacity = _useState2[0],
|
|
@@ -30,7 +31,6 @@ export default function DragPreview() {
|
|
|
30
31
|
|
|
31
32
|
var _useDragLayer = useDragLayer(function (monitor) {
|
|
32
33
|
if (!subscribedToOffsetChange) {
|
|
33
|
-
// @ts-ignore
|
|
34
34
|
monitor.subscribeToOffsetChange(onOffsetChange(monitor));
|
|
35
35
|
subscribedToOffsetChange = true;
|
|
36
36
|
}
|
|
@@ -95,4 +95,6 @@ export default function DragPreview() {
|
|
|
95
95
|
borderRadius: "50%"
|
|
96
96
|
}
|
|
97
97
|
})));
|
|
98
|
-
}
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export default DragPreview;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import React, { ReactElement } from "react";
|
|
2
2
|
import { ConnectDragSource } from "react-dnd";
|
|
3
|
-
|
|
3
|
+
interface DraggableChildrenFunctionParams {
|
|
4
4
|
isDragging: boolean;
|
|
5
5
|
drag: ConnectDragSource;
|
|
6
|
-
}
|
|
7
|
-
export
|
|
6
|
+
}
|
|
7
|
+
export interface DraggableChildrenFunction {
|
|
8
|
+
(params: DraggableChildrenFunctionParams): ReactElement;
|
|
9
|
+
}
|
|
10
|
+
export interface DraggableProps {
|
|
8
11
|
children: DraggableChildrenFunction;
|
|
9
12
|
beginDrag?: any;
|
|
10
13
|
endDrag?: any;
|
|
11
14
|
target?: string[];
|
|
12
|
-
}
|
|
13
|
-
declare
|
|
14
|
-
|
|
15
|
-
export default _default;
|
|
15
|
+
}
|
|
16
|
+
declare const MemoizedDraggable: React.FC<DraggableProps>;
|
|
17
|
+
export default MemoizedDraggable;
|
|
@@ -3,7 +3,7 @@ import React from "react";
|
|
|
3
3
|
import { useDrag, DragPreviewImage } from "react-dnd";
|
|
4
4
|
var emptyImage = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
|
|
5
5
|
|
|
6
|
-
function Draggable(props) {
|
|
6
|
+
var Draggable = function Draggable(props) {
|
|
7
7
|
var children = props.children,
|
|
8
8
|
beginDrag = props.beginDrag,
|
|
9
9
|
endDrag = props.endDrag,
|
|
@@ -46,6 +46,7 @@ function Draggable(props) {
|
|
|
46
46
|
isDragging: isDragging,
|
|
47
47
|
drag: drag
|
|
48
48
|
}));
|
|
49
|
-
}
|
|
49
|
+
};
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
var MemoizedDraggable = /*#__PURE__*/React.memo(Draggable);
|
|
52
|
+
export default MemoizedDraggable;
|