payload 1.2.3 → 1.2.4
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/CHANGELOG.md +7 -0
- package/dist/admin/components/forms/field-types/RichText/elements/link/Modal/baseFields.js +19 -8
- package/dist/admin/components/forms/field-types/RichText/elements/link/Modal/index.js +4 -2
- package/dist/config/types.d.ts +0 -2
- package/dist/translations/en.json +11 -2
- package/dist/translations/index.d.ts +11 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## [1.2.4](https://github.com/payloadcms/payload/compare/v1.2.3...v1.2.4) (2022-12-03)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* missing translation richText link modal ([#1573](https://github.com/payloadcms/payload/issues/1573)) ([2dcada1](https://github.com/payloadcms/payload/commit/2dcada199c21bee97eca88aa6bc8ba1bc2b45e7c))
|
|
9
|
+
|
|
3
10
|
## [1.2.3](https://github.com/payloadcms/payload/compare/v1.2.2...v1.2.3) (2022-12-02)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -1,33 +1,44 @@
|
|
|
1
|
+
import { extractTranslations } from '../../../../../../../../translations/extractTranslations';
|
|
2
|
+
const translations = extractTranslations([
|
|
3
|
+
'fields:textToDisplay',
|
|
4
|
+
'fields:linkType',
|
|
5
|
+
'fields:chooseBetweenCustomTextOrDocument',
|
|
6
|
+
'fields:customURL',
|
|
7
|
+
'fields:internalLink',
|
|
8
|
+
'fields:enterURL',
|
|
9
|
+
'fields:chooseDocumentToLink',
|
|
10
|
+
'fields:openInNewTab',
|
|
11
|
+
]);
|
|
1
12
|
export const getBaseFields = (config) => [
|
|
2
13
|
{
|
|
3
14
|
name: 'text',
|
|
4
|
-
label: '
|
|
15
|
+
label: translations['fields:textToDisplay'],
|
|
5
16
|
type: 'text',
|
|
6
17
|
required: true,
|
|
7
18
|
},
|
|
8
19
|
{
|
|
9
20
|
name: 'linkType',
|
|
10
|
-
label: '
|
|
21
|
+
label: translations['fields:linkType'],
|
|
11
22
|
type: 'radio',
|
|
12
23
|
required: true,
|
|
13
24
|
admin: {
|
|
14
|
-
description: '
|
|
25
|
+
description: translations['fields:chooseBetweenCustomTextOrDocument'],
|
|
15
26
|
},
|
|
16
27
|
defaultValue: 'custom',
|
|
17
28
|
options: [
|
|
18
29
|
{
|
|
19
|
-
label: '
|
|
30
|
+
label: translations['fields:customURL'],
|
|
20
31
|
value: 'custom',
|
|
21
32
|
},
|
|
22
33
|
{
|
|
23
|
-
label: '
|
|
34
|
+
label: translations['fields:internalLink'],
|
|
24
35
|
value: 'internal',
|
|
25
36
|
},
|
|
26
37
|
],
|
|
27
38
|
},
|
|
28
39
|
{
|
|
29
40
|
name: 'url',
|
|
30
|
-
label: '
|
|
41
|
+
label: translations['fields:enterURL'],
|
|
31
42
|
type: 'text',
|
|
32
43
|
required: true,
|
|
33
44
|
admin: {
|
|
@@ -38,7 +49,7 @@ export const getBaseFields = (config) => [
|
|
|
38
49
|
},
|
|
39
50
|
{
|
|
40
51
|
name: 'doc',
|
|
41
|
-
label: '
|
|
52
|
+
label: translations['fields:chooseDocumentToLink'],
|
|
42
53
|
type: 'relationship',
|
|
43
54
|
required: true,
|
|
44
55
|
relationTo: config.collections.map(({ slug }) => slug),
|
|
@@ -50,7 +61,7 @@ export const getBaseFields = (config) => [
|
|
|
50
61
|
},
|
|
51
62
|
{
|
|
52
63
|
name: 'newTab',
|
|
53
|
-
label: '
|
|
64
|
+
label: translations['fields:openInNewTab'],
|
|
54
65
|
type: 'checkbox',
|
|
55
66
|
},
|
|
56
67
|
];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Modal } from '@faceless-ui/modal';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
3
4
|
import { MinimalTemplate } from '../../../../../..';
|
|
4
5
|
import Button from '../../../../../../elements/Button';
|
|
5
6
|
import X from '../../../../../../icons/X';
|
|
@@ -10,13 +11,14 @@ import RenderFields from '../../../../../RenderFields';
|
|
|
10
11
|
import './index.scss';
|
|
11
12
|
const baseClass = 'rich-text-link-edit-modal';
|
|
12
13
|
export const EditModal = ({ close, handleModalSubmit, initialState, fieldSchema, modalSlug, }) => {
|
|
14
|
+
const { t } = useTranslation('fields');
|
|
13
15
|
return (React.createElement(Modal, { slug: modalSlug, className: baseClass },
|
|
14
16
|
React.createElement(MinimalTemplate, { className: `${baseClass}__template` },
|
|
15
17
|
React.createElement("header", { className: `${baseClass}__header` },
|
|
16
|
-
React.createElement("h3", null,
|
|
18
|
+
React.createElement("h3", null, t('editLink')),
|
|
17
19
|
React.createElement(Button, { buttonStyle: "none", onClick: close },
|
|
18
20
|
React.createElement(X, null))),
|
|
19
21
|
React.createElement(Form, { onSubmit: handleModalSubmit, initialState: initialState },
|
|
20
22
|
React.createElement(RenderFields, { fieldTypes: fieldTypes, readOnly: false, fieldSchema: fieldSchema, forceRender: true }),
|
|
21
|
-
React.createElement(FormSubmit, null,
|
|
23
|
+
React.createElement(FormSubmit, null, t('general:submit'))))));
|
|
22
24
|
};
|
package/dist/config/types.d.ts
CHANGED
|
@@ -267,14 +267,12 @@ export declare type Config = {
|
|
|
267
267
|
Icon?: React.ComponentType<any>;
|
|
268
268
|
/** Replace the logo on the login page */
|
|
269
269
|
Logo?: React.ComponentType<any>;
|
|
270
|
-
v: any;
|
|
271
270
|
};
|
|
272
271
|
views?: {
|
|
273
272
|
/** Replace the account screen */
|
|
274
273
|
Account?: React.ComponentType<any>;
|
|
275
274
|
/** Replace the admin homepage */
|
|
276
275
|
Dashboard?: React.ComponentType<any>;
|
|
277
|
-
v: any;
|
|
278
276
|
};
|
|
279
277
|
};
|
|
280
278
|
/**
|
|
@@ -90,23 +90,31 @@
|
|
|
90
90
|
"verificationTokenInvalid": "Verification token is invalid."
|
|
91
91
|
},
|
|
92
92
|
"fields": {
|
|
93
|
-
"block": "block",
|
|
94
|
-
"blocks": "blocks",
|
|
95
93
|
"addLabel": "Add {{label}}",
|
|
96
94
|
"addNew": "Add new",
|
|
97
95
|
"addNewLabel": "Add new {{label}}",
|
|
98
96
|
"addRelationship": "Add relationship",
|
|
97
|
+
"block": "block",
|
|
99
98
|
"blockType": "Block Type",
|
|
99
|
+
"blocks": "blocks",
|
|
100
|
+
"chooseBetweenCustomTextOrDocument": "Choose between entering a custom text URL or linking to another document.",
|
|
101
|
+
"chooseDocumentToLink": "Choose a document to link to",
|
|
100
102
|
"chooseFromExisting": "Choose from existing",
|
|
101
103
|
"chooseLabel": "Choose {{label}}",
|
|
102
104
|
"collapseAll": "Collapse All",
|
|
105
|
+
"customURL": "Custom URL",
|
|
103
106
|
"editLabelData": "Edit {{label}} data",
|
|
107
|
+
"editLink": "Edit Link",
|
|
108
|
+
"enterURL": "Enter a URL",
|
|
109
|
+
"internalLink": "Internal Link",
|
|
104
110
|
"itemsAndMore": "{{items}} and {{count}} more",
|
|
105
111
|
"labelRelationship": "{{label}} Relationship",
|
|
106
112
|
"latitude": "Latitude",
|
|
113
|
+
"linkType": "Link Type",
|
|
107
114
|
"linkedTo": "Linked to <0>{{label}}</0>",
|
|
108
115
|
"longitude": "Longitude",
|
|
109
116
|
"newLabel": "New {{label}}",
|
|
117
|
+
"openInNewTab": "Open in new tab",
|
|
110
118
|
"passwordsDoNotMatch": "Passwords do not match.",
|
|
111
119
|
"relatedDocument": "Related Document",
|
|
112
120
|
"relationTo": "Relation To",
|
|
@@ -116,6 +124,7 @@
|
|
|
116
124
|
"selectExistingLabel": "Select existing {{label}}",
|
|
117
125
|
"showAll": "Show All",
|
|
118
126
|
"swapUpload": "Swap Upload",
|
|
127
|
+
"textToDisplay": "Text to display",
|
|
119
128
|
"toggleBlock": "Toggle block",
|
|
120
129
|
"uploadNewLabel": "Upload new {{label}}"
|
|
121
130
|
},
|
|
@@ -381,23 +381,31 @@ declare const _default: {
|
|
|
381
381
|
verificationTokenInvalid: string;
|
|
382
382
|
};
|
|
383
383
|
fields: {
|
|
384
|
-
block: string;
|
|
385
|
-
blocks: string;
|
|
386
384
|
addLabel: string;
|
|
387
385
|
addNew: string;
|
|
388
386
|
addNewLabel: string;
|
|
389
387
|
addRelationship: string;
|
|
388
|
+
block: string;
|
|
390
389
|
blockType: string;
|
|
390
|
+
blocks: string;
|
|
391
|
+
chooseBetweenCustomTextOrDocument: string;
|
|
392
|
+
chooseDocumentToLink: string;
|
|
391
393
|
chooseFromExisting: string;
|
|
392
394
|
chooseLabel: string;
|
|
393
395
|
collapseAll: string;
|
|
396
|
+
customURL: string;
|
|
394
397
|
editLabelData: string;
|
|
398
|
+
editLink: string;
|
|
399
|
+
enterURL: string;
|
|
400
|
+
internalLink: string;
|
|
395
401
|
itemsAndMore: string;
|
|
396
402
|
labelRelationship: string;
|
|
397
403
|
latitude: string;
|
|
404
|
+
linkType: string;
|
|
398
405
|
linkedTo: string;
|
|
399
406
|
longitude: string;
|
|
400
407
|
newLabel: string;
|
|
408
|
+
openInNewTab: string;
|
|
401
409
|
passwordsDoNotMatch: string;
|
|
402
410
|
relatedDocument: string;
|
|
403
411
|
relationTo: string;
|
|
@@ -407,6 +415,7 @@ declare const _default: {
|
|
|
407
415
|
selectExistingLabel: string;
|
|
408
416
|
showAll: string;
|
|
409
417
|
swapUpload: string;
|
|
418
|
+
textToDisplay: string;
|
|
410
419
|
toggleBlock: string;
|
|
411
420
|
uploadNewLabel: string;
|
|
412
421
|
};
|