@contentful/field-editor-shared 4.6.3-canary.26 → 4.6.3-canary.30
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/dist/cjs/CharCounter.js +1 -1
- package/dist/cjs/CharValidation.js +3 -3
- package/dist/cjs/FieldConnector.test.js +6 -6
- package/dist/cjs/LocalePublishingEntityStatusBadge/Banner.js +3 -3
- package/dist/cjs/LocalePublishingEntityStatusBadge/LocalePublishingPopover.js +12 -12
- package/dist/cjs/LocalePublishingEntityStatusBadge/LocalePublishingStatus.js +4 -4
- package/dist/cjs/LocalePublishingEntityStatusBadge/LocalePublishingStatusList.js +5 -5
- package/dist/cjs/LocalePublishingEntityStatusBadge/ScheduledBanner.js +4 -4
- package/dist/cjs/ModalDialogLauncher.js +8 -8
- package/dist/cjs/PredefinedValuesError.js +1 -1
- package/dist/cjs/ReleaseEntityStatusBadge/Banner.js +3 -3
- package/dist/cjs/ReleaseEntityStatusBadge/ReleaseEntityStatusBadge.js +1 -1
- package/dist/cjs/ReleaseEntityStatusBadge/ReleaseEntityStatusLocale.js +4 -4
- package/dist/cjs/ReleaseEntityStatusBadge/ReleaseEntityStatusLocalesList.js +7 -7
- package/dist/cjs/ReleaseEntityStatusBadge/ReleaseEntityStatusPopover.js +10 -10
- package/dist/cjs/hooks/useContentTypes.js +4 -4
- package/dist/cjs/hooks/useLocalePublishStatus.spec.js +1 -1
- package/dist/cjs/index.js +29 -29
- package/dist/cjs/queryClient.js +8 -8
- package/dist/cjs/queryKeys.js +7 -7
- package/dist/cjs/react-query.js +5 -5
- package/dist/cjs/typesEntity.js +7 -7
- package/dist/cjs/utils/constraints.js +3 -3
- package/dist/cjs/utils/determineReleaseAction.js +3 -3
- package/dist/cjs/utils/entityHelpers.js +12 -12
- package/dist/cjs/utils/shortenStorageUnit.js +3 -3
- package/dist/esm/CharCounter.js +1 -1
- package/dist/esm/CharValidation.js +3 -3
- package/dist/esm/FieldConnector.test.js +6 -6
- package/dist/esm/LocalePublishingEntityStatusBadge/Banner.js +3 -3
- package/dist/esm/LocalePublishingEntityStatusBadge/LocalePublishingPopover.js +12 -12
- package/dist/esm/LocalePublishingEntityStatusBadge/LocalePublishingStatus.js +4 -4
- package/dist/esm/LocalePublishingEntityStatusBadge/LocalePublishingStatusList.js +5 -5
- package/dist/esm/LocalePublishingEntityStatusBadge/ScheduledBanner.js +4 -4
- package/dist/esm/ModalDialogLauncher.js +4 -4
- package/dist/esm/PredefinedValuesError.js +1 -1
- package/dist/esm/ReleaseEntityStatusBadge/Banner.js +3 -3
- package/dist/esm/ReleaseEntityStatusBadge/ReleaseEntityStatusBadge.js +1 -1
- package/dist/esm/ReleaseEntityStatusBadge/ReleaseEntityStatusLocale.js +4 -4
- package/dist/esm/ReleaseEntityStatusBadge/ReleaseEntityStatusLocalesList.js +7 -7
- package/dist/esm/ReleaseEntityStatusBadge/ReleaseEntityStatusPopover.js +10 -10
- package/dist/esm/hooks/useLocalePublishStatus.spec.js +1 -1
- package/dist/esm/queryClient.js +4 -4
- package/package.json +4 -4
package/dist/cjs/queryClient.js
CHANGED
|
@@ -5,17 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
SharedQueryClientProvider
|
|
12
|
+
get SharedQueryClientProvider () {
|
|
13
13
|
return SharedQueryClientProvider;
|
|
14
14
|
},
|
|
15
|
-
useQuery
|
|
15
|
+
get useQuery () {
|
|
16
16
|
return useQuery;
|
|
17
17
|
},
|
|
18
|
-
useQueryClient
|
|
18
|
+
get useQueryClient () {
|
|
19
19
|
return useQueryClient;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
@@ -63,7 +63,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
63
63
|
return newObj;
|
|
64
64
|
}
|
|
65
65
|
const IS_V5 = typeof _reactquery.QueryClient.prototype.setLogger !== 'function';
|
|
66
|
-
const clientContext =
|
|
66
|
+
const clientContext = _react.createContext(undefined);
|
|
67
67
|
let sharedQueryClientInstance;
|
|
68
68
|
function createDefaultQueryClient() {
|
|
69
69
|
return new _reactquery.QueryClient({
|
|
@@ -130,13 +130,13 @@ function SharedQueryClientProvider({ children, client: providedClient }) {
|
|
|
130
130
|
internalClient
|
|
131
131
|
]);
|
|
132
132
|
if (IS_V5) {
|
|
133
|
-
return
|
|
133
|
+
return _react.createElement(_reactquery.QueryClientProvider, {
|
|
134
134
|
client: client
|
|
135
|
-
},
|
|
135
|
+
}, _react.createElement(clientContext.Provider, {
|
|
136
136
|
value: client
|
|
137
137
|
}, children));
|
|
138
138
|
}
|
|
139
|
-
return
|
|
139
|
+
return _react.createElement(clientContext.Provider, {
|
|
140
140
|
value: client
|
|
141
141
|
}, children);
|
|
142
142
|
}
|
package/dist/cjs/queryKeys.js
CHANGED
|
@@ -5,26 +5,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
createGetAssetKey
|
|
12
|
+
get createGetAssetKey () {
|
|
13
13
|
return createGetAssetKey;
|
|
14
14
|
},
|
|
15
|
-
createGetContentTypeKey
|
|
15
|
+
get createGetContentTypeKey () {
|
|
16
16
|
return createGetContentTypeKey;
|
|
17
17
|
},
|
|
18
|
-
createGetEntryKey
|
|
18
|
+
get createGetEntryKey () {
|
|
19
19
|
return createGetEntryKey;
|
|
20
20
|
},
|
|
21
|
-
createGetManyContentTypesKey
|
|
21
|
+
get createGetManyContentTypesKey () {
|
|
22
22
|
return createGetManyContentTypesKey;
|
|
23
23
|
},
|
|
24
|
-
createGetManyLocalesKey
|
|
24
|
+
get createGetManyLocalesKey () {
|
|
25
25
|
return createGetManyLocalesKey;
|
|
26
26
|
},
|
|
27
|
-
createGetSpaceKey
|
|
27
|
+
get createGetSpaceKey () {
|
|
28
28
|
return createGetSpaceKey;
|
|
29
29
|
}
|
|
30
30
|
});
|
package/dist/cjs/react-query.js
CHANGED
|
@@ -5,20 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
SharedQueryClientProvider
|
|
12
|
+
get SharedQueryClientProvider () {
|
|
13
13
|
return _queryClient.SharedQueryClientProvider;
|
|
14
14
|
},
|
|
15
|
-
isLoadingStatus
|
|
15
|
+
get isLoadingStatus () {
|
|
16
16
|
return _isLoadingStatus.isLoadingStatus;
|
|
17
17
|
},
|
|
18
|
-
useQuery
|
|
18
|
+
get useQuery () {
|
|
19
19
|
return _queryClient.useQuery;
|
|
20
20
|
},
|
|
21
|
-
useQueryClient
|
|
21
|
+
get useQueryClient () {
|
|
22
22
|
return _queryClient.useQueryClient;
|
|
23
23
|
}
|
|
24
24
|
});
|
package/dist/cjs/typesEntity.js
CHANGED
|
@@ -5,26 +5,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
Asset
|
|
12
|
+
get Asset () {
|
|
13
13
|
return _appsdk.Asset;
|
|
14
14
|
},
|
|
15
|
-
BaseAppSDK
|
|
15
|
+
get BaseAppSDK () {
|
|
16
16
|
return _appsdk.BaseAppSDK;
|
|
17
17
|
},
|
|
18
|
-
ContentType
|
|
18
|
+
get ContentType () {
|
|
19
19
|
return _appsdk.ContentType;
|
|
20
20
|
},
|
|
21
|
-
ContentTypeField
|
|
21
|
+
get ContentTypeField () {
|
|
22
22
|
return _appsdk.ContentTypeField;
|
|
23
23
|
},
|
|
24
|
-
Entry
|
|
24
|
+
get Entry () {
|
|
25
25
|
return _appsdk.Entry;
|
|
26
26
|
},
|
|
27
|
-
Link
|
|
27
|
+
get Link () {
|
|
28
28
|
return _appsdk.Link;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
fromFieldValidations
|
|
12
|
+
get fromFieldValidations () {
|
|
13
13
|
return fromFieldValidations;
|
|
14
14
|
},
|
|
15
|
-
makeChecker
|
|
15
|
+
get makeChecker () {
|
|
16
16
|
return makeChecker;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
determineReleaseAction
|
|
12
|
+
get determineReleaseAction () {
|
|
13
13
|
return determineReleaseAction;
|
|
14
14
|
},
|
|
15
|
-
normalizeReleaseLocaleFields
|
|
15
|
+
get normalizeReleaseLocaleFields () {
|
|
16
16
|
return normalizeReleaseLocaleFields;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
@@ -5,41 +5,41 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
getAssetTitle
|
|
12
|
+
get getAssetTitle () {
|
|
13
13
|
return getAssetTitle;
|
|
14
14
|
},
|
|
15
|
-
getEntityDescription
|
|
15
|
+
get getEntityDescription () {
|
|
16
16
|
return getEntityDescription;
|
|
17
17
|
},
|
|
18
|
-
getEntityStatus
|
|
18
|
+
get getEntityStatus () {
|
|
19
19
|
return getEntityStatus;
|
|
20
20
|
},
|
|
21
|
-
getEntryImage
|
|
21
|
+
get getEntryImage () {
|
|
22
22
|
return getEntryImage;
|
|
23
23
|
},
|
|
24
|
-
getEntryStatus
|
|
24
|
+
get getEntryStatus () {
|
|
25
25
|
return getEntryStatus;
|
|
26
26
|
},
|
|
27
|
-
getEntryTitle
|
|
27
|
+
get getEntryTitle () {
|
|
28
28
|
return getEntryTitle;
|
|
29
29
|
},
|
|
30
|
-
getFieldValue
|
|
30
|
+
get getFieldValue () {
|
|
31
31
|
return getFieldValue;
|
|
32
32
|
},
|
|
33
|
-
getResolvedImageUrl
|
|
33
|
+
get getResolvedImageUrl () {
|
|
34
34
|
return getResolvedImageUrl;
|
|
35
35
|
},
|
|
36
|
-
isAssetField
|
|
36
|
+
get isAssetField () {
|
|
37
37
|
return isAssetField;
|
|
38
38
|
},
|
|
39
|
-
isDescriptionField
|
|
39
|
+
get isDescriptionField () {
|
|
40
40
|
return isDescriptionField;
|
|
41
41
|
},
|
|
42
|
-
isDisplayField
|
|
42
|
+
get isDisplayField () {
|
|
43
43
|
return isDisplayField;
|
|
44
44
|
}
|
|
45
45
|
});
|
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
shortenStorageUnit
|
|
12
|
+
get shortenStorageUnit () {
|
|
13
13
|
return shortenStorageUnit;
|
|
14
14
|
},
|
|
15
|
-
toLocaleString
|
|
15
|
+
get toLocaleString () {
|
|
16
16
|
return toLocaleString;
|
|
17
17
|
}
|
|
18
18
|
});
|
package/dist/esm/CharCounter.js
CHANGED
|
@@ -13,7 +13,7 @@ export function CharCounter(props) {
|
|
|
13
13
|
count = props.value.length;
|
|
14
14
|
}
|
|
15
15
|
const valid = count === 0 || props.checkConstraint(count);
|
|
16
|
-
return
|
|
16
|
+
return React.createElement("span", {
|
|
17
17
|
"data-status-code": valid ? null : 'invalid-size',
|
|
18
18
|
className: cx({
|
|
19
19
|
[styles.invalid]: !valid
|
|
@@ -4,7 +4,7 @@ export function CharValidation(props) {
|
|
|
4
4
|
const { constraints } = props;
|
|
5
5
|
if (constraints.type === 'max') {
|
|
6
6
|
const { max } = constraints;
|
|
7
|
-
return
|
|
7
|
+
return React.createElement("span", null, $_i18n._({
|
|
8
8
|
id: "FieldEditors.Shared.CharValidation.MaximumConstraint",
|
|
9
9
|
message: "Maximum {max} characters",
|
|
10
10
|
values: {
|
|
@@ -13,7 +13,7 @@ export function CharValidation(props) {
|
|
|
13
13
|
}));
|
|
14
14
|
} else if (constraints.type === 'min') {
|
|
15
15
|
const { min } = constraints;
|
|
16
|
-
return
|
|
16
|
+
return React.createElement("span", null, $_i18n._({
|
|
17
17
|
id: "FieldEditors.Shared.CharValidation.MinimumConstraint",
|
|
18
18
|
message: "Requires at least {min} characters",
|
|
19
19
|
values: {
|
|
@@ -22,7 +22,7 @@ export function CharValidation(props) {
|
|
|
22
22
|
}));
|
|
23
23
|
} else {
|
|
24
24
|
const { max, min } = constraints;
|
|
25
|
-
return
|
|
25
|
+
return React.createElement("span", null, $_i18n._({
|
|
26
26
|
id: "FieldEditors.Shared.CharValidation.MinMaxConstraint",
|
|
27
27
|
message: "Requires between {min} and {max} characters",
|
|
28
28
|
values: {
|
|
@@ -22,7 +22,7 @@ it('does not rerender with outdated value after calling setValue', async ()=>{
|
|
|
22
22
|
field,
|
|
23
23
|
debounce: 0
|
|
24
24
|
};
|
|
25
|
-
render(
|
|
25
|
+
render(React.createElement(FieldConnector, props));
|
|
26
26
|
let child = getChild(props.children);
|
|
27
27
|
expect(child.value).toBe('initial value');
|
|
28
28
|
const initialRenderCount = props.children.mock.calls.length;
|
|
@@ -47,7 +47,7 @@ it('takes initial disable state from sdk.field', ()=>{
|
|
|
47
47
|
field,
|
|
48
48
|
debounce: 0
|
|
49
49
|
};
|
|
50
|
-
render(
|
|
50
|
+
render(React.createElement(FieldConnector, props));
|
|
51
51
|
const child = getChild(props.children);
|
|
52
52
|
expect(child.value).toBe('initial value');
|
|
53
53
|
expect(field.getIsDisabled).toHaveBeenCalled();
|
|
@@ -56,14 +56,14 @@ it('takes initial disable state from sdk.field', ()=>{
|
|
|
56
56
|
disabled: true
|
|
57
57
|
}));
|
|
58
58
|
});
|
|
59
|
-
it(
|
|
59
|
+
it("handles subscriptions that do not return unsubscribe callbacks", ()=>{
|
|
60
60
|
const [field] = createFakeFieldAPI((field)=>({
|
|
61
61
|
...field,
|
|
62
62
|
onSchemaErrorsChanged: vi.fn(),
|
|
63
63
|
onIsDisabledChanged: vi.fn(),
|
|
64
64
|
onValueChanged: vi.fn()
|
|
65
65
|
}));
|
|
66
|
-
const { unmount } = render(
|
|
66
|
+
const { unmount } = render(React.createElement(FieldConnector, {
|
|
67
67
|
field: field,
|
|
68
68
|
isInitiallyDisabled: false,
|
|
69
69
|
debounce: 0
|
|
@@ -79,7 +79,7 @@ it('keeps pending debounced value updates after unmounting', async ()=>{
|
|
|
79
79
|
}));
|
|
80
80
|
const children = vi.fn().mockReturnValue(null);
|
|
81
81
|
try {
|
|
82
|
-
const { unmount } = render(
|
|
82
|
+
const { unmount } = render(React.createElement(FieldConnector, {
|
|
83
83
|
field: field,
|
|
84
84
|
isInitiallyDisabled: false,
|
|
85
85
|
debounce: 300
|
|
@@ -103,7 +103,7 @@ it('uses the deprecated throttle value as the debounce duration', async ()=>{
|
|
|
103
103
|
}));
|
|
104
104
|
const children = vi.fn().mockReturnValue(null);
|
|
105
105
|
try {
|
|
106
|
-
render(
|
|
106
|
+
render(React.createElement(FieldConnector, {
|
|
107
107
|
field: field,
|
|
108
108
|
isInitiallyDisabled: false,
|
|
109
109
|
throttle: 100
|
|
@@ -14,13 +14,13 @@ const styles = {
|
|
|
14
14
|
})
|
|
15
15
|
};
|
|
16
16
|
export function Banner({ content, highlight }) {
|
|
17
|
-
return
|
|
17
|
+
return React.createElement("div", {
|
|
18
18
|
className: styles.banner
|
|
19
|
-
},
|
|
19
|
+
}, React.createElement(Text, {
|
|
20
20
|
fontSize: "fontSizeS",
|
|
21
21
|
fontColor: "gray700",
|
|
22
22
|
className: styles.content
|
|
23
|
-
}, content), highlight &&
|
|
23
|
+
}, content), highlight && React.createElement(Text, {
|
|
24
24
|
fontSize: "fontSizeS",
|
|
25
25
|
fontColor: "gray700",
|
|
26
26
|
as: "strong",
|
|
@@ -181,7 +181,7 @@ export function LocalePublishingPopover({ entity, jobs, isScheduled, localesStat
|
|
|
181
181
|
'archived',
|
|
182
182
|
'deleted'
|
|
183
183
|
].includes(entityStatus)) {
|
|
184
|
-
return
|
|
184
|
+
return React.createElement(EntityStatusBadge, {
|
|
185
185
|
className: styles.badge,
|
|
186
186
|
testId: "entity-state",
|
|
187
187
|
entityStatus: entityStatus,
|
|
@@ -192,23 +192,23 @@ export function LocalePublishingPopover({ entity, jobs, isScheduled, localesStat
|
|
|
192
192
|
const status = determineBadgeStatus(localesStatusMap, activeLocales);
|
|
193
193
|
const ariaLabel = status && status.secondary ? 'Multiple statuses' : status?.primary;
|
|
194
194
|
const wrapperClass = generateDynamicStyles(status);
|
|
195
|
-
return
|
|
195
|
+
return React.createElement(Popover, {
|
|
196
196
|
isOpen: localesStatusMap && isOpen,
|
|
197
197
|
onClose: ()=>setIsOpen(false),
|
|
198
198
|
autoFocus: false,
|
|
199
199
|
placement: "bottom-end"
|
|
200
|
-
},
|
|
200
|
+
}, React.createElement(Popover.Trigger, null, React.createElement(Flex, {
|
|
201
201
|
"aria-label": ariaLabel,
|
|
202
202
|
alignItems: "center",
|
|
203
203
|
className: cx(styles.wrapper, wrapperClass)
|
|
204
|
-
},
|
|
204
|
+
}, React.createElement(EntityStatusBadge, {
|
|
205
205
|
className: styles.badge,
|
|
206
206
|
testId: "entity-state",
|
|
207
207
|
entityStatus: entityStatus,
|
|
208
208
|
tabIndex: 0,
|
|
209
209
|
onFocus: ()=>setIsOpen(true),
|
|
210
210
|
onBlur: ()=>setIsOpen(false),
|
|
211
|
-
endIcon:
|
|
211
|
+
endIcon: React.createElement(CaretDownIcon, {
|
|
212
212
|
size: "tiny",
|
|
213
213
|
color: getIconColor(entityStatus)
|
|
214
214
|
}),
|
|
@@ -216,34 +216,34 @@ export function LocalePublishingPopover({ entity, jobs, isScheduled, localesStat
|
|
|
216
216
|
isScheduled: isScheduled,
|
|
217
217
|
onMouseEnter: onMouseEnter,
|
|
218
218
|
onMouseLeave: onMouseLeave
|
|
219
|
-
}), status?.secondary &&
|
|
219
|
+
}), status?.secondary && React.createElement("svg", {
|
|
220
220
|
"data-status": "secondary",
|
|
221
221
|
"aria-hidden": "true",
|
|
222
222
|
width: "4",
|
|
223
223
|
height: "18",
|
|
224
224
|
viewBox: "0 0 4 18"
|
|
225
|
-
},
|
|
225
|
+
}, React.createElement("path", {
|
|
226
226
|
fillRule: "evenodd",
|
|
227
227
|
clipRule: "evenodd",
|
|
228
228
|
d: "M1.45942e-06 18H0.00296171C2.2121 18 4.00296 16.2091 4.00296 14V4C4.00296 1.79086 2.2121 0 0.00295914 0H0C0.830421 0.732944 1.35418 1.80531 1.35418 3V15C1.35418 16.1947 0.830422 17.2671 1.45942e-06 18Z"
|
|
229
|
-
})), status?.tertiary &&
|
|
229
|
+
})), status?.tertiary && React.createElement("svg", {
|
|
230
230
|
"data-status": "tertiary",
|
|
231
231
|
"aria-hidden": "true",
|
|
232
232
|
width: "5",
|
|
233
233
|
height: "16",
|
|
234
234
|
viewBox: "0 0 5 16"
|
|
235
|
-
},
|
|
235
|
+
}, React.createElement("path", {
|
|
236
236
|
fillRule: "evenodd",
|
|
237
237
|
clipRule: "evenodd",
|
|
238
238
|
d: "M0.673828 16.0055H0.675391C2.88453 16.0055 4.67539 14.2146 4.67539 12.0055V3.9955C4.67539 1.88216 3.03648 0.151608 0.960312 0.00549316C1.78382 0.738158 2.30257 1.80597 2.30257 2.99493V12.7838C2.30257 14.1053 1.66172 15.2771 0.673828 16.0055Z"
|
|
239
|
-
})))),
|
|
239
|
+
})))), React.createElement(Popover.Content, {
|
|
240
240
|
className: styles.popoverContent,
|
|
241
241
|
onMouseEnter: onMouseEnter,
|
|
242
242
|
onMouseLeave: onMouseLeave
|
|
243
|
-
}, !!localesStatusMap &&
|
|
243
|
+
}, !!localesStatusMap && React.createElement(React.Fragment, null, React.createElement(ScheduledBanner, {
|
|
244
244
|
entityId: entity.sys.id,
|
|
245
245
|
jobs: jobs
|
|
246
|
-
}),
|
|
246
|
+
}), React.createElement(LocalePublishingStatusList, {
|
|
247
247
|
isScheduled: isScheduled,
|
|
248
248
|
statusMap: localesStatusMap,
|
|
249
249
|
activeLocales: activeLocales
|
|
@@ -19,15 +19,15 @@ const styles = {
|
|
|
19
19
|
})
|
|
20
20
|
};
|
|
21
21
|
export function LocalePublishingStatus({ locale, status, isScheduled }) {
|
|
22
|
-
return
|
|
22
|
+
return React.createElement("div", {
|
|
23
23
|
className: styles.localePublishStatus,
|
|
24
24
|
"data-test-id": "locale-publishing-status"
|
|
25
|
-
},
|
|
25
|
+
}, React.createElement(Text, {
|
|
26
26
|
className: styles.locale,
|
|
27
27
|
fontColor: "gray700"
|
|
28
|
-
}, locale.name, ' ',
|
|
28
|
+
}, locale.name, ' ', React.createElement(Text, {
|
|
29
29
|
fontColor: "gray500"
|
|
30
|
-
}, "(", locale.code, ")", locale.default && ', Default')),
|
|
30
|
+
}, "(", locale.code, ")", locale.default && ', Default')), React.createElement(EntityStatusBadge, {
|
|
31
31
|
entityStatus: status,
|
|
32
32
|
isScheduled: isScheduled,
|
|
33
33
|
className: styles.status
|
|
@@ -49,19 +49,19 @@ export function LocalePublishingStatusList({ isScheduled, statusMap, activeLocal
|
|
|
49
49
|
draft: 0
|
|
50
50
|
});
|
|
51
51
|
const { selected, nonSelected } = groupAndSortLocales(entries, activeLocales);
|
|
52
|
-
return
|
|
52
|
+
return React.createElement(React.Fragment, null, React.createElement(Banner, {
|
|
53
53
|
content: "The statuses of the locales for this content:",
|
|
54
54
|
highlight: `${counters.changed} changed, ${counters.published} published, ${counters.draft} draft`
|
|
55
|
-
}),
|
|
55
|
+
}), React.createElement("div", {
|
|
56
56
|
"data-test-id": "locale-publishing-selected"
|
|
57
|
-
},
|
|
57
|
+
}, React.createElement(MenuSectionTitle, null, "Locales in the entry editor:"), selected.map(({ locale, status })=>React.createElement(LocalePublishingStatus, {
|
|
58
58
|
key: `selected-${locale.code}`,
|
|
59
59
|
status: status,
|
|
60
60
|
locale: locale,
|
|
61
61
|
isScheduled: isScheduled
|
|
62
|
-
}))), nonSelected.length > 0 &&
|
|
62
|
+
}))), nonSelected.length > 0 && React.createElement("div", {
|
|
63
63
|
"data-test-id": "locale-publishing-others"
|
|
64
|
-
},
|
|
64
|
+
}, React.createElement(MenuSectionTitle, null, "Other locales:"), nonSelected.map(({ locale, status })=>React.createElement(LocalePublishingStatus, {
|
|
65
65
|
key: `others-${locale.code}`,
|
|
66
66
|
status: status,
|
|
67
67
|
locale: locale,
|
|
@@ -2,12 +2,12 @@ import React from 'react';
|
|
|
2
2
|
import { formatDateAndTime } from '@contentful/f36-components';
|
|
3
3
|
import orderBy from 'lodash/orderBy';
|
|
4
4
|
import { Banner } from './Banner';
|
|
5
|
-
var ScheduledActionTypes
|
|
6
|
-
(function(ScheduledActionTypes) {
|
|
5
|
+
var ScheduledActionTypes = /*#__PURE__*/ function(ScheduledActionTypes) {
|
|
7
6
|
ScheduledActionTypes["publish"] = "publish";
|
|
8
7
|
ScheduledActionTypes["unpublish"] = "unpublish";
|
|
9
8
|
ScheduledActionTypes["patch+publish"] = "patch+publish";
|
|
10
|
-
|
|
9
|
+
return ScheduledActionTypes;
|
|
10
|
+
}(ScheduledActionTypes || {});
|
|
11
11
|
export function ScheduledBanner({ entityId, jobs }) {
|
|
12
12
|
const scheduledJobs = jobs.filter((job)=>job.entity.sys.id === entityId);
|
|
13
13
|
const sortedScheduledJobs = orderBy(scheduledJobs, [
|
|
@@ -22,7 +22,7 @@ export function ScheduledBanner({ entityId, jobs }) {
|
|
|
22
22
|
const pendingJobsCount = scheduledJobs.length - 1;
|
|
23
23
|
const lowerCaseAction = scheduledAction.action.toLowerCase();
|
|
24
24
|
const action = lowerCaseAction === "patch+publish" ? `${lowerCaseAction} (via Schedule Series)` : lowerCaseAction;
|
|
25
|
-
return
|
|
25
|
+
return React.createElement(Banner, {
|
|
26
26
|
content: `All locales are scheduled to ${action} on:`,
|
|
27
27
|
highlight: `${formatDateAndTime(scheduledAction.scheduledFor.datetime)}${pendingJobsCount > 0 ? ` [and +${pendingJobsCount} more]` : ''}`
|
|
28
28
|
});
|
|
@@ -48,7 +48,7 @@ export function openDialog(options, Component) {
|
|
|
48
48
|
const size = isNumber(options.width) ? `${options.width}px` : options.width;
|
|
49
49
|
return open(({ isShown, onClose })=>{
|
|
50
50
|
const onCloseHandler = ()=>onClose();
|
|
51
|
-
return
|
|
51
|
+
return React.createElement(Modal, {
|
|
52
52
|
key: key,
|
|
53
53
|
shouldCloseOnOverlayClick: options.shouldCloseOnOverlayClick || false,
|
|
54
54
|
shouldCloseOnEscapePress: options.shouldCloseOnEscapePress || false,
|
|
@@ -57,15 +57,15 @@ export function openDialog(options, Component) {
|
|
|
57
57
|
isShown: isShown,
|
|
58
58
|
onClose: onCloseHandler,
|
|
59
59
|
size: size || '700px'
|
|
60
|
-
}, ()
|
|
60
|
+
}, ()=>React.createElement(React.Fragment, null, options.title && React.createElement(ModalHeader, {
|
|
61
61
|
testId: "dialog-title",
|
|
62
62
|
title: options.title,
|
|
63
63
|
onClose: onCloseHandler
|
|
64
|
-
}),
|
|
64
|
+
}), React.createElement("div", {
|
|
65
65
|
style: {
|
|
66
66
|
minHeight: options.minHeight || 'auto'
|
|
67
67
|
}
|
|
68
|
-
},
|
|
68
|
+
}, React.createElement(Component, {
|
|
69
69
|
onClose: onClose
|
|
70
70
|
}))));
|
|
71
71
|
});
|
|
@@ -2,7 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { Note } from '@contentful/f36-note';
|
|
3
3
|
import { i18n as $_i18n } from "@lingui/core";
|
|
4
4
|
export function PredefinedValuesError() {
|
|
5
|
-
return
|
|
5
|
+
return React.createElement(Note, {
|
|
6
6
|
variant: "warning",
|
|
7
7
|
testId: "predefined-values-warning"
|
|
8
8
|
}, $_i18n._({
|
|
@@ -14,13 +14,13 @@ const styles = {
|
|
|
14
14
|
})
|
|
15
15
|
};
|
|
16
16
|
export function Banner({ content, highlight }) {
|
|
17
|
-
return
|
|
17
|
+
return React.createElement("div", {
|
|
18
18
|
className: styles.banner
|
|
19
|
-
},
|
|
19
|
+
}, React.createElement(Text, {
|
|
20
20
|
fontSize: "fontSizeS",
|
|
21
21
|
fontColor: "gray700",
|
|
22
22
|
className: styles.content
|
|
23
|
-
}, content), highlight &&
|
|
23
|
+
}, content), highlight && React.createElement(Text, {
|
|
24
24
|
fontSize: "fontSizeS",
|
|
25
25
|
fontColor: "gray700",
|
|
26
26
|
as: "strong",
|
|
@@ -3,7 +3,7 @@ import { Badge } from '@contentful/f36-components';
|
|
|
3
3
|
import { getReleaseStatusBadgeConfig } from '../utils/getReleaseStatusBadgeConfig';
|
|
4
4
|
export function ReleaseEntityStatusBadge({ className, status }) {
|
|
5
5
|
const { label, variant } = getReleaseStatusBadgeConfig(status);
|
|
6
|
-
return
|
|
6
|
+
return React.createElement(Badge, {
|
|
7
7
|
testId: "release-entity-action-status",
|
|
8
8
|
className: className,
|
|
9
9
|
variant: variant
|
|
@@ -22,13 +22,13 @@ const styles = {
|
|
|
22
22
|
export function ReleaseEntityStatusLocale({ locale, label, variant }) {
|
|
23
23
|
const localeCode = locale.code;
|
|
24
24
|
const isDefaultLocale = `${locale.default ? ', Default' : ''}`;
|
|
25
|
-
return
|
|
25
|
+
return React.createElement("div", {
|
|
26
26
|
className: styles.localePublishStatus,
|
|
27
27
|
"data-test-id": "locale-publishing-status"
|
|
28
|
-
},
|
|
28
|
+
}, React.createElement(Text, {
|
|
29
29
|
className: styles.locale,
|
|
30
30
|
fontColor: "gray700"
|
|
31
|
-
}, locale.name, ' ',
|
|
31
|
+
}, locale.name, ' ', React.createElement(Text, {
|
|
32
32
|
fontColor: "gray500"
|
|
33
33
|
}, $_i18n._({
|
|
34
34
|
id: "FieldEditors.Shared.ReleaseEntityStatusLocale.LocaleCode",
|
|
@@ -37,7 +37,7 @@ export function ReleaseEntityStatusLocale({ locale, label, variant }) {
|
|
|
37
37
|
localeCode: localeCode,
|
|
38
38
|
isDefaultLocale: isDefaultLocale
|
|
39
39
|
}
|
|
40
|
-
}))),
|
|
40
|
+
}))), React.createElement(Badge, {
|
|
41
41
|
className: styles.status,
|
|
42
42
|
variant: variant
|
|
43
43
|
}, label));
|
|
@@ -50,7 +50,7 @@ export function ReleaseEntityStatusLocalesList({ statusMap, activeLocales }) {
|
|
|
50
50
|
remainsDraft: 0
|
|
51
51
|
});
|
|
52
52
|
const { selected, nonSelected } = groupAndSortLocales(entries, activeLocales);
|
|
53
|
-
return
|
|
53
|
+
return React.createElement(React.Fragment, null, React.createElement(Banner, {
|
|
54
54
|
content: $_i18n._({
|
|
55
55
|
id: "FieldEditors.Shared.ReleaseEntityStatusLocalesList.BannerContent",
|
|
56
56
|
message: "The statuses of the locales for this content:"
|
|
@@ -64,22 +64,22 @@ export function ReleaseEntityStatusLocalesList({ statusMap, activeLocales }) {
|
|
|
64
64
|
remainsDraft: remainsDraft
|
|
65
65
|
}
|
|
66
66
|
})
|
|
67
|
-
}),
|
|
67
|
+
}), React.createElement("div", {
|
|
68
68
|
"data-test-id": "locale-publishing-selected"
|
|
69
|
-
},
|
|
69
|
+
}, React.createElement(MenuSectionTitle, null, $_i18n._({
|
|
70
70
|
id: "FieldEditors.Shared.ReleaseEntityStatusLocalesList.SelectedLocalesTitle",
|
|
71
71
|
message: "Locales in the entry editor:"
|
|
72
|
-
})), selected.map(({ locale, label, variant })
|
|
72
|
+
})), selected.map(({ locale, label, variant })=>React.createElement(ReleaseEntityStatusLocale, {
|
|
73
73
|
key: `selected-${locale.code}`,
|
|
74
74
|
label: label,
|
|
75
75
|
variant: variant,
|
|
76
76
|
locale: locale
|
|
77
|
-
}))), nonSelected.length > 0 &&
|
|
77
|
+
}))), nonSelected.length > 0 && React.createElement("div", {
|
|
78
78
|
"data-test-id": "locale-publishing-others"
|
|
79
|
-
},
|
|
79
|
+
}, React.createElement(MenuSectionTitle, null, $_i18n._({
|
|
80
80
|
id: "FieldEditors.Shared.ReleaseEntityStatusLocalesList.OtherLocalesTitle",
|
|
81
81
|
message: "Other locales:"
|
|
82
|
-
})), nonSelected.map(({ locale, label, variant })
|
|
82
|
+
})), nonSelected.map(({ locale, label, variant })=>React.createElement(ReleaseEntityStatusLocale, {
|
|
83
83
|
key: `others-${locale.code}`,
|
|
84
84
|
label: label,
|
|
85
85
|
variant: variant,
|