@webiny/app-headless-cms 5.18.3 → 5.19.0-beta.3
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/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/install.js +7 -0
- package/admin/plugins/permissionRenderer/components/StyledComponents.d.ts +1 -1
- package/admin/plugins/transformers/dateTransformer.js +114 -20
- package/admin/plugins/upgrades/5.19.0/UpgradeItemsInfo.d.ts +7 -0
- package/admin/plugins/upgrades/5.19.0/UpgradeItemsInfo.js +53 -0
- package/admin/plugins/upgrades/5.19.0/createCmsApolloClient.d.ts +7 -0
- package/admin/plugins/upgrades/5.19.0/createCmsApolloClient.js +49 -0
- package/admin/plugins/upgrades/5.19.0/createListEntriesQuery.d.ts +2 -0
- package/admin/plugins/upgrades/5.19.0/createListEntriesQuery.js +12 -0
- package/admin/plugins/upgrades/5.19.0/createListModelsQuery.d.ts +1 -0
- package/admin/plugins/upgrades/5.19.0/createListModelsQuery.js +8 -0
- package/admin/plugins/upgrades/5.19.0/createRepublishMutation.d.ts +1 -0
- package/admin/plugins/upgrades/5.19.0/createRepublishMutation.js +10 -0
- package/admin/plugins/upgrades/5.19.0/createUpgradeMutation.d.ts +1 -0
- package/admin/plugins/upgrades/5.19.0/createUpgradeMutation.js +8 -0
- package/admin/plugins/upgrades/5.19.0/fetchModelEntries.d.ts +7 -0
- package/admin/plugins/upgrades/5.19.0/fetchModelEntries.js +122 -0
- package/admin/plugins/upgrades/5.19.0/types.d.ts +47 -0
- package/admin/plugins/upgrades/5.19.0/types.js +1 -0
- package/admin/plugins/upgrades/v5.19.0.d.ts +5 -0
- package/admin/plugins/upgrades/v5.19.0.js +647 -0
- 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 +18 -16
- package/types.d.ts +2 -1
|
@@ -55,7 +55,7 @@ var listItemMinHeight = /*#__PURE__*/css({
|
|
|
55
55
|
var ContentEntriesList = function ContentEntriesList() {
|
|
56
56
|
var _useContentEntriesLis = useContentEntriesList(),
|
|
57
57
|
contentModel = _useContentEntriesLis.contentModel,
|
|
58
|
-
|
|
58
|
+
id = _useContentEntriesLis.id,
|
|
59
59
|
loading = _useContentEntriesLis.loading,
|
|
60
60
|
canCreate = _useContentEntriesLis.canCreate,
|
|
61
61
|
onCreate = _useContentEntriesLis.onCreate,
|
|
@@ -159,7 +159,7 @@ var ContentEntriesList = function ContentEntriesList() {
|
|
|
159
159
|
return /*#__PURE__*/React.createElement(UIList.ListItem, {
|
|
160
160
|
key: item.id,
|
|
161
161
|
className: listItemMinHeight,
|
|
162
|
-
selected: item.id ===
|
|
162
|
+
selected: item.id === id
|
|
163
163
|
}, /*#__PURE__*/React.createElement(UIList.ListItemText, {
|
|
164
164
|
onClick: editEntry(item)
|
|
165
165
|
}, item.meta.title || "Untitled", /*#__PURE__*/React.createElement(UIList.ListItemTextSecondary, null, t(_templateObject11 || (_templateObject11 = _taggedTemplateLiteral(["Last modified: {time}."])))({
|
|
@@ -7,6 +7,7 @@ import { useSnackbar } from "@webiny/app-admin/hooks/useSnackbar";
|
|
|
7
7
|
import * as GQL from "../../../graphql/contentEntries";
|
|
8
8
|
import { useQuery } from "../../../hooks";
|
|
9
9
|
import { useContentEntries } from "../hooks/useContentEntries";
|
|
10
|
+
import { parseIdentifier } from "@webiny/utils";
|
|
10
11
|
export var Context = /*#__PURE__*/React.createContext(null);
|
|
11
12
|
export var Provider = function Provider(_ref) {
|
|
12
13
|
var children = _ref.children;
|
|
@@ -37,7 +38,12 @@ export var Provider = function Provider(_ref) {
|
|
|
37
38
|
var query = new URLSearchParams(location.search);
|
|
38
39
|
var contentId = query.get("id");
|
|
39
40
|
var revisionId = contentId ? decodeURIComponent(contentId) : null;
|
|
40
|
-
var entryId =
|
|
41
|
+
var entryId = null;
|
|
42
|
+
|
|
43
|
+
if (revisionId) {
|
|
44
|
+
var result = parseIdentifier(revisionId);
|
|
45
|
+
entryId = result ? result.id : null;
|
|
46
|
+
}
|
|
41
47
|
|
|
42
48
|
var _useMemo = useMemo(function () {
|
|
43
49
|
return {
|
|
@@ -4,6 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
4
4
|
import dotProp from "dot-prop-immutable";
|
|
5
5
|
import orderBy from "lodash/orderBy";
|
|
6
6
|
import * as GQL from "../../../graphql/contentEntries";
|
|
7
|
+
import { parseIdentifier } from "@webiny/utils";
|
|
7
8
|
/*
|
|
8
9
|
* We need to preserve the order of entries with new entry addition
|
|
9
10
|
* because we're not re-fetching the list but updating it directly inside cache.
|
|
@@ -89,7 +90,9 @@ export var removeEntryFromListCache = function removeEntryFromListCache(model, c
|
|
|
89
90
|
return;
|
|
90
91
|
}
|
|
91
92
|
|
|
92
|
-
var
|
|
93
|
+
var _parseIdentifier = parseIdentifier(revision.id),
|
|
94
|
+
entryId = _parseIdentifier.id;
|
|
95
|
+
|
|
93
96
|
var index = content.data.findIndex(function (item) {
|
|
94
97
|
return item.id.startsWith(entryId);
|
|
95
98
|
});
|
|
@@ -35,7 +35,7 @@ export function useContentEntriesList() {
|
|
|
35
35
|
var baseUrl = "/cms/content-entries/".concat(contentModel.modelId); // Get entry ID and search query (if any)
|
|
36
36
|
|
|
37
37
|
var query = new URLSearchParams(location.search);
|
|
38
|
-
var
|
|
38
|
+
var id = query.get("id");
|
|
39
39
|
var searchQuery = query.get("search");
|
|
40
40
|
var updateSearch = useCallback(debounce(function (_ref) {
|
|
41
41
|
var filter = _ref.filter,
|
|
@@ -138,7 +138,7 @@ export function useContentEntriesList() {
|
|
|
138
138
|
listQueryVariables: listQueryVariables,
|
|
139
139
|
setListQueryVariables: setListQueryVariables,
|
|
140
140
|
sorters: sorters,
|
|
141
|
-
|
|
141
|
+
id: id,
|
|
142
142
|
loading: loading,
|
|
143
143
|
data: filterByStatus(get(data, "content.data", []), listQueryVariables.status),
|
|
144
144
|
loadMore: loadMore,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/app-headless-cms",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.19.0-beta.3",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -24,21 +24,23 @@
|
|
|
24
24
|
"@fortawesome/react-fontawesome": "0.1.16",
|
|
25
25
|
"@svgr/webpack": "4.3.3",
|
|
26
26
|
"@types/react": "16.14.2",
|
|
27
|
-
"@webiny/app": "5.
|
|
28
|
-
"@webiny/app-admin": "5.
|
|
29
|
-
"@webiny/app-graphql-playground": "5.
|
|
30
|
-
"@webiny/app-i18n": "5.
|
|
31
|
-
"@webiny/app-plugin-admin-welcome-screen": "5.
|
|
32
|
-
"@webiny/app-security": "5.
|
|
33
|
-
"@webiny/error": "5.
|
|
34
|
-
"@webiny/form": "5.
|
|
35
|
-
"@webiny/plugins": "5.
|
|
36
|
-
"@webiny/react-router": "5.
|
|
37
|
-
"@webiny/ui": "5.
|
|
38
|
-
"@webiny/
|
|
27
|
+
"@webiny/app": "5.19.0-beta.3",
|
|
28
|
+
"@webiny/app-admin": "5.19.0-beta.3",
|
|
29
|
+
"@webiny/app-graphql-playground": "5.19.0-beta.3",
|
|
30
|
+
"@webiny/app-i18n": "5.19.0-beta.3",
|
|
31
|
+
"@webiny/app-plugin-admin-welcome-screen": "5.19.0-beta.3",
|
|
32
|
+
"@webiny/app-security": "5.19.0-beta.3",
|
|
33
|
+
"@webiny/error": "5.19.0-beta.3",
|
|
34
|
+
"@webiny/form": "5.19.0-beta.3",
|
|
35
|
+
"@webiny/plugins": "5.19.0-beta.3",
|
|
36
|
+
"@webiny/react-router": "5.19.0-beta.3",
|
|
37
|
+
"@webiny/ui": "5.19.0-beta.3",
|
|
38
|
+
"@webiny/utils": "5.19.0-beta.3",
|
|
39
|
+
"@webiny/validation": "5.19.0-beta.3",
|
|
39
40
|
"apollo-cache": "1.3.5",
|
|
40
41
|
"apollo-client": "2.6.10",
|
|
41
42
|
"apollo-link": "1.2.14",
|
|
43
|
+
"apollo-link-batch-http": "1.2.14",
|
|
42
44
|
"apollo-utilities": "1.3.4",
|
|
43
45
|
"classnames": "2.3.1",
|
|
44
46
|
"dot-prop-immutable": "2.1.1",
|
|
@@ -66,8 +68,8 @@
|
|
|
66
68
|
"@babel/preset-env": "^7.5.5",
|
|
67
69
|
"@babel/preset-react": "^7.0.0",
|
|
68
70
|
"@babel/preset-typescript": "^7.8.3",
|
|
69
|
-
"@webiny/cli": "^5.
|
|
70
|
-
"@webiny/project-utils": "^5.
|
|
71
|
+
"@webiny/cli": "^5.19.0-beta.3",
|
|
72
|
+
"@webiny/project-utils": "^5.19.0-beta.3",
|
|
71
73
|
"babel-plugin-emotion": "^9.2.8",
|
|
72
74
|
"babel-plugin-lodash": "^3.3.4",
|
|
73
75
|
"babel-plugin-module-resolver": "^4.1.0",
|
|
@@ -105,5 +107,5 @@
|
|
|
105
107
|
]
|
|
106
108
|
}
|
|
107
109
|
},
|
|
108
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "a1cca819f83172183b907de16fd5746d07d13ad0"
|
|
109
111
|
}
|
package/types.d.ts
CHANGED
|
@@ -316,6 +316,7 @@ export interface CmsEditorFieldValidatorPlugin extends Plugin {
|
|
|
316
316
|
label: string;
|
|
317
317
|
description: string;
|
|
318
318
|
defaultMessage: string;
|
|
319
|
+
defaultSettings?: Record<string, any>;
|
|
319
320
|
renderSettings?: (props: {
|
|
320
321
|
field: CmsEditorField;
|
|
321
322
|
Bind: BindComponent;
|
|
@@ -356,7 +357,7 @@ export interface CmsModelFieldValidatorPlugin extends Plugin {
|
|
|
356
357
|
type: "cms-model-field-validator";
|
|
357
358
|
validator: {
|
|
358
359
|
name: string;
|
|
359
|
-
validate: (value: any, validator: CmsFieldValidator) => Promise<any>;
|
|
360
|
+
validate: (value: any, validator: CmsFieldValidator | any) => Promise<any>;
|
|
360
361
|
};
|
|
361
362
|
}
|
|
362
363
|
/**
|