@contentful/field-editor-reference 4.3.11 → 4.4.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/CHANGELOG.md +6 -0
- package/dist/components/SpaceName/SpaceName.d.ts +6 -0
- package/dist/entries/WrappedEntryCard/WrappedEntryCard.d.ts +1 -0
- package/dist/field-editor-reference.cjs.development.js +47 -13
- package/dist/field-editor-reference.cjs.development.js.map +1 -1
- package/dist/field-editor-reference.cjs.production.min.js +1 -1
- package/dist/field-editor-reference.cjs.production.min.js.map +1 -1
- package/dist/field-editor-reference.esm.js +49 -15
- package/dist/field-editor-reference.esm.js.map +1 -1
- package/package.json +2 -2
|
@@ -2,8 +2,8 @@ import React__default, { useState, useRef, useEffect, createElement, Fragment, u
|
|
|
2
2
|
import { css } from 'emotion';
|
|
3
3
|
import tokens from '@contentful/f36-tokens';
|
|
4
4
|
import get from 'lodash-es/get';
|
|
5
|
-
import { Menu, TextInput, Button, Paragraph, Card, SectionHeading, IconButton, Tooltip, EntryCard, MenuItem, MenuDivider,
|
|
6
|
-
import { SearchIcon, PlusIcon, ChevronDownIcon, LinkIcon, CloseIcon, ClockIcon } from '@contentful/f36-icons';
|
|
5
|
+
import { Menu, TextInput, Button, Paragraph, Card, SectionHeading, IconButton, Tooltip, Flex, Text, EntryCard, MenuItem, MenuDivider, AssetCard } from '@contentful/f36-components';
|
|
6
|
+
import { SearchIcon, PlusIcon, ChevronDownIcon, LinkIcon, CloseIcon, FolderOpenTrimmedIcon, ClockIcon } from '@contentful/f36-icons';
|
|
7
7
|
import moment from 'moment';
|
|
8
8
|
import deepEqual from 'deep-equal';
|
|
9
9
|
import { FieldConnector, isValidImage, entityHelpers, shortenStorageUnit } from '@contentful/field-editor-shared';
|
|
@@ -2447,11 +2447,40 @@ SingleReferenceEditor.defaultProps = {
|
|
|
2447
2447
|
hasCardRemoveActions: true
|
|
2448
2448
|
};
|
|
2449
2449
|
|
|
2450
|
+
var styles$1 = {
|
|
2451
|
+
spaceIcon: /*#__PURE__*/css({
|
|
2452
|
+
flexShrink: 0,
|
|
2453
|
+
fill: tokens.purple600
|
|
2454
|
+
}),
|
|
2455
|
+
spaceName: /*#__PURE__*/css({
|
|
2456
|
+
color: tokens.gray700,
|
|
2457
|
+
fontSize: tokens.fontSizeS,
|
|
2458
|
+
fontWeight: tokens.fontWeightDemiBold
|
|
2459
|
+
})
|
|
2460
|
+
};
|
|
2461
|
+
function SpaceName(props) {
|
|
2462
|
+
return createElement(Tooltip, {
|
|
2463
|
+
placement: "top",
|
|
2464
|
+
as: "div",
|
|
2465
|
+
content: "Space"
|
|
2466
|
+
}, createElement(Flex, {
|
|
2467
|
+
alignItems: "center",
|
|
2468
|
+
gap: "spacingXs",
|
|
2469
|
+
marginRight: "spacingS"
|
|
2470
|
+
}, createElement(FolderOpenTrimmedIcon, {
|
|
2471
|
+
className: styles$1.spaceIcon,
|
|
2472
|
+
size: "tiny",
|
|
2473
|
+
"aria-label": "Source space"
|
|
2474
|
+
}), createElement(Text, {
|
|
2475
|
+
className: styles$1.spaceName
|
|
2476
|
+
}, props.spaceName)));
|
|
2477
|
+
}
|
|
2478
|
+
|
|
2450
2479
|
var getEntryTitle = entityHelpers.getEntryTitle,
|
|
2451
2480
|
getEntityDescription = entityHelpers.getEntityDescription,
|
|
2452
2481
|
getEntryStatus = entityHelpers.getEntryStatus,
|
|
2453
2482
|
getEntryImage = entityHelpers.getEntryImage;
|
|
2454
|
-
var styles$
|
|
2483
|
+
var styles$2 = {
|
|
2455
2484
|
scheduleIcon: /*#__PURE__*/css({
|
|
2456
2485
|
marginRight: tokens.spacing2Xs
|
|
2457
2486
|
})
|
|
@@ -2516,12 +2545,17 @@ function WrappedEntryCard(props) {
|
|
|
2516
2545
|
size: props.size,
|
|
2517
2546
|
isSelected: props.isSelected,
|
|
2518
2547
|
status: status,
|
|
2519
|
-
|
|
2548
|
+
style: props.spaceName ? {
|
|
2549
|
+
backgroundColor: tokens.gray100
|
|
2550
|
+
} : undefined,
|
|
2551
|
+
icon: props.spaceName ? createElement(SpaceName, {
|
|
2552
|
+
spaceName: props.spaceName
|
|
2553
|
+
}) : createElement(ScheduledIconWithTooltip, {
|
|
2520
2554
|
getEntityScheduledActions: props.getEntityScheduledActions,
|
|
2521
2555
|
entityType: "Entry",
|
|
2522
2556
|
entityId: props.entry.sys.id
|
|
2523
2557
|
}, createElement(ClockIcon, {
|
|
2524
|
-
className: styles$
|
|
2558
|
+
className: styles$2.scheduleIcon,
|
|
2525
2559
|
size: "small",
|
|
2526
2560
|
variant: "muted",
|
|
2527
2561
|
testId: "schedule-icon"
|
|
@@ -2896,7 +2930,7 @@ MultipleReferenceEditor.defaultProps = {
|
|
|
2896
2930
|
hasCardEditActions: true
|
|
2897
2931
|
};
|
|
2898
2932
|
|
|
2899
|
-
var styles$
|
|
2933
|
+
var styles$3 = {
|
|
2900
2934
|
containter: /*#__PURE__*/css({
|
|
2901
2935
|
position: 'relative'
|
|
2902
2936
|
}),
|
|
@@ -2914,13 +2948,13 @@ var DragHandle = function DragHandle(props) {
|
|
|
2914
2948
|
|
|
2915
2949
|
var SortableLink = /*#__PURE__*/SortableElement(function (props) {
|
|
2916
2950
|
return React__default.createElement("div", {
|
|
2917
|
-
className: styles$
|
|
2951
|
+
className: styles$3.item
|
|
2918
2952
|
}, props.children);
|
|
2919
2953
|
});
|
|
2920
2954
|
var SortableLinkList = /*#__PURE__*/SortableContainer(function (props) {
|
|
2921
2955
|
var lastIndex = props.items.length - 1;
|
|
2922
2956
|
return React__default.createElement("div", {
|
|
2923
|
-
className: styles$
|
|
2957
|
+
className: styles$3.containter
|
|
2924
2958
|
}, props.items.map(function (item, index) {
|
|
2925
2959
|
return React__default.createElement(SortableLink, {
|
|
2926
2960
|
disabled: props.isDisabled,
|
|
@@ -3029,7 +3063,7 @@ var groupToIconMap = {
|
|
|
3029
3063
|
code: 'code',
|
|
3030
3064
|
markup: 'markup'
|
|
3031
3065
|
};
|
|
3032
|
-
var styles$
|
|
3066
|
+
var styles$4 = {
|
|
3033
3067
|
scheduleIcon: /*#__PURE__*/css({
|
|
3034
3068
|
marginRight: tokens.spacing2Xs
|
|
3035
3069
|
})
|
|
@@ -3091,7 +3125,7 @@ var WrappedAssetCard = function WrappedAssetCard(props) {
|
|
|
3091
3125
|
entityType: "Asset",
|
|
3092
3126
|
entityId: props.asset.sys.id
|
|
3093
3127
|
}, React__default.createElement(ClockIcon, {
|
|
3094
|
-
className: styles$
|
|
3128
|
+
className: styles$4.scheduleIcon,
|
|
3095
3129
|
size: "small",
|
|
3096
3130
|
variant: "muted",
|
|
3097
3131
|
testId: "schedule-icon"
|
|
@@ -3122,7 +3156,7 @@ var WrappedAssetCard = function WrappedAssetCard(props) {
|
|
|
3122
3156
|
};
|
|
3123
3157
|
WrappedAssetCard.defaultProps = defaultProps$1;
|
|
3124
3158
|
|
|
3125
|
-
var styles$
|
|
3159
|
+
var styles$5 = {
|
|
3126
3160
|
scheduleIcon: /*#__PURE__*/css({
|
|
3127
3161
|
marginRight: tokens.spacing2Xs
|
|
3128
3162
|
})
|
|
@@ -3166,7 +3200,7 @@ var WrappedAssetLink = function WrappedAssetLink(props) {
|
|
|
3166
3200
|
entityType: "Asset",
|
|
3167
3201
|
entityId: props.asset.sys.id
|
|
3168
3202
|
}, React__default.createElement(ClockIcon, {
|
|
3169
|
-
className: styles$
|
|
3203
|
+
className: styles$5.scheduleIcon,
|
|
3170
3204
|
size: "small",
|
|
3171
3205
|
variant: "muted",
|
|
3172
3206
|
testId: "schedule-icon"
|
|
@@ -3365,7 +3399,7 @@ SingleMediaEditor.defaultProps = {
|
|
|
3365
3399
|
isInitiallyDisabled: true
|
|
3366
3400
|
};
|
|
3367
3401
|
|
|
3368
|
-
var styles$
|
|
3402
|
+
var styles$6 = {
|
|
3369
3403
|
gridContainter: /*#__PURE__*/css({
|
|
3370
3404
|
position: 'relative',
|
|
3371
3405
|
display: 'flex',
|
|
@@ -3389,12 +3423,12 @@ var DragHandle$1 = function DragHandle(props) {
|
|
|
3389
3423
|
|
|
3390
3424
|
var SortableLink$1 = /*#__PURE__*/SortableElement(function (props) {
|
|
3391
3425
|
return React__default.createElement("div", {
|
|
3392
|
-
className: styles$
|
|
3426
|
+
className: styles$6.item
|
|
3393
3427
|
}, props.children);
|
|
3394
3428
|
});
|
|
3395
3429
|
var SortableLinkList$1 = /*#__PURE__*/SortableContainer(function (props) {
|
|
3396
3430
|
return React__default.createElement("div", {
|
|
3397
|
-
className: props.viewType === 'card' ? styles$
|
|
3431
|
+
className: props.viewType === 'card' ? styles$6.gridContainter : styles$6.container
|
|
3398
3432
|
}, props.items.map(function (item, index) {
|
|
3399
3433
|
return React__default.createElement(SortableLink$1, {
|
|
3400
3434
|
disabled: props.isDisabled,
|