@contentful/field-editor-rich-text 2.0.0-next.38 → 2.0.0-next.40
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/field-editor-rich-text.cjs.development.js +131 -436
- package/dist/field-editor-rich-text.cjs.development.js.map +1 -1
- package/dist/field-editor-rich-text.cjs.production.min.js +1 -1
- package/dist/field-editor-rich-text.cjs.production.min.js.map +1 -1
- package/dist/field-editor-rich-text.esm.js +136 -441
- package/dist/field-editor-rich-text.esm.js.map +1 -1
- package/dist/plugins/EmbeddedEntityBlock/ToolbarIcon.d.ts +1 -2
- package/dist/plugins/EmbeddedEntityInline/index.d.ts +0 -1
- package/dist/plugins/Hyperlink/HyperlinkModal.d.ts +1 -0
- package/dist/plugins/shared/FetchingWrappedAssetCard.d.ts +0 -10
- package/package.json +2 -2
- package/dist/plugins/shared/EntityStatusIcon.d.ts +0 -7
|
@@ -21,12 +21,11 @@ var slate = require('slate');
|
|
|
21
21
|
var Slate = require('slate-react');
|
|
22
22
|
var constate = _interopDefault(require('constate'));
|
|
23
23
|
var f36Components = require('@contentful/f36-components');
|
|
24
|
-
var
|
|
24
|
+
var find = _interopDefault(require('lodash/find'));
|
|
25
|
+
var flow = _interopDefault(require('lodash/flow'));
|
|
25
26
|
var get = _interopDefault(require('lodash/get'));
|
|
26
27
|
var f36Icons = require('@contentful/f36-icons');
|
|
27
28
|
var tokens = _interopDefault(require('@contentful/f36-tokens'));
|
|
28
|
-
var find = _interopDefault(require('lodash/find'));
|
|
29
|
-
var flow = _interopDefault(require('lodash/flow'));
|
|
30
29
|
var plateList = require('@udecode/plate-list');
|
|
31
30
|
var castArray = _interopDefault(require('lodash/castArray'));
|
|
32
31
|
var plateBasicMarks = require('@udecode/plate-basic-marks');
|
|
@@ -639,180 +638,24 @@ var _constate = /*#__PURE__*/constate(useSdk),
|
|
|
639
638
|
SdkProvider = _constate[0],
|
|
640
639
|
useSdkContext = _constate[1];
|
|
641
640
|
|
|
642
|
-
var styles = {
|
|
643
|
-
scheduleIcon: /*#__PURE__*/emotion.css({
|
|
644
|
-
marginRight: tokens.spacing2Xs
|
|
645
|
-
})
|
|
646
|
-
};
|
|
647
|
-
function EntityStatusIcon(_ref) {
|
|
648
|
-
var entity = _ref.entity,
|
|
649
|
-
entityType = _ref.entityType;
|
|
650
|
-
|
|
651
|
-
var _useEntities = fieldEditorReference.useEntities(),
|
|
652
|
-
loadEntityScheduledActions = _useEntities.loadEntityScheduledActions;
|
|
653
|
-
|
|
654
|
-
return /*#__PURE__*/React.createElement(fieldEditorReference.ScheduledIconWithTooltip, {
|
|
655
|
-
getEntityScheduledActions: loadEntityScheduledActions,
|
|
656
|
-
entityType: entityType,
|
|
657
|
-
entityId: entity.sys.id
|
|
658
|
-
}, /*#__PURE__*/React.createElement(f36Icons.ClockIcon, {
|
|
659
|
-
className: styles.scheduleIcon,
|
|
660
|
-
size: "small",
|
|
661
|
-
color: "muted",
|
|
662
|
-
testId: "schedule-icon"
|
|
663
|
-
}));
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
var styles$1 = {
|
|
667
|
-
assetCard: /*#__PURE__*/emotion.css({
|
|
668
|
-
cursor: 'pointer'
|
|
669
|
-
}),
|
|
670
|
-
cardDropdown: /*#__PURE__*/emotion.css({
|
|
671
|
-
width: '300px'
|
|
672
|
-
}),
|
|
673
|
-
truncated: /*#__PURE__*/emotion.css({
|
|
674
|
-
overflow: 'hidden',
|
|
675
|
-
whiteSpace: 'nowrap',
|
|
676
|
-
textOverflow: 'ellipsis'
|
|
677
|
-
})
|
|
678
|
-
};
|
|
679
|
-
|
|
680
|
-
function downloadAsset(url, fileName) {
|
|
681
|
-
// This method won't work if we have CORS disabled(asset not on the contentful server)
|
|
682
|
-
fetch(url, {
|
|
683
|
-
method: 'GET',
|
|
684
|
-
headers: {}
|
|
685
|
-
}).then(function (response) {
|
|
686
|
-
response.arrayBuffer().then(function (buffer) {
|
|
687
|
-
var url = window.URL.createObjectURL(new Blob([buffer]));
|
|
688
|
-
var link = document.createElement('a');
|
|
689
|
-
link.href = url;
|
|
690
|
-
link.setAttribute('download', fileName); //or any other extension
|
|
691
|
-
|
|
692
|
-
document.body.appendChild(link);
|
|
693
|
-
link.click();
|
|
694
|
-
document.body.removeChild(link);
|
|
695
|
-
});
|
|
696
|
-
})["catch"](function (err) {
|
|
697
|
-
f36Components.Notification.error('Failed to download asset');
|
|
698
|
-
console.log(err);
|
|
699
|
-
});
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
function renderAssetInfo(props) {
|
|
703
|
-
var entityFile = props.entityFile;
|
|
704
|
-
var fileName = get(entityFile, 'fileName');
|
|
705
|
-
var mimeType = get(entityFile, 'contentType');
|
|
706
|
-
var fileSize = get(entityFile, 'details.size');
|
|
707
|
-
var image = get(entityFile, 'details.image');
|
|
708
|
-
return [/*#__PURE__*/React.createElement(f36Components.Menu.SectionTitle, {
|
|
709
|
-
key: "file-section"
|
|
710
|
-
}, "File info"), fileName && /*#__PURE__*/React.createElement(f36Components.Menu.Item, {
|
|
711
|
-
key: "file-name"
|
|
712
|
-
}, /*#__PURE__*/React.createElement(f36Components.Text, {
|
|
713
|
-
isTruncated: true
|
|
714
|
-
}, fileName)), mimeType && /*#__PURE__*/React.createElement(f36Components.Menu.Item, {
|
|
715
|
-
key: "file-type"
|
|
716
|
-
}, /*#__PURE__*/React.createElement(f36Components.Text, {
|
|
717
|
-
isTruncated: true
|
|
718
|
-
}, mimeType)), fileSize && /*#__PURE__*/React.createElement(f36Components.Menu.Item, {
|
|
719
|
-
key: "file-size"
|
|
720
|
-
}, fieldEditorShared.shortenStorageUnit(fileSize, 'B')), image && /*#__PURE__*/React.createElement(f36Components.Menu.Item, {
|
|
721
|
-
key: "file-dimentions"
|
|
722
|
-
}, image.width + " \xD7 " + image.height)].filter(function (item) {
|
|
723
|
-
return item;
|
|
724
|
-
});
|
|
725
|
-
}
|
|
726
|
-
function renderActions(props) {
|
|
727
|
-
var entityFile = props.entityFile,
|
|
728
|
-
isDisabled = props.isDisabled,
|
|
729
|
-
onEdit = props.onEdit,
|
|
730
|
-
onRemove = props.onRemove;
|
|
731
|
-
return [/*#__PURE__*/React.createElement(f36Components.Menu.SectionTitle, {
|
|
732
|
-
key: "section-title"
|
|
733
|
-
}, "Actions"), onEdit ? /*#__PURE__*/React.createElement(f36Components.Menu.Item, {
|
|
734
|
-
key: "edit",
|
|
735
|
-
disabled: isDisabled,
|
|
736
|
-
onClick: onEdit,
|
|
737
|
-
testId: "card-action-edit"
|
|
738
|
-
}, "Edit") : null, entityFile ? /*#__PURE__*/React.createElement(f36Components.Menu.Item, {
|
|
739
|
-
key: "download",
|
|
740
|
-
onClick: function onClick() {
|
|
741
|
-
if (typeof entityFile.url === 'string') {
|
|
742
|
-
downloadAsset(entityFile.url, get(entityFile, 'fileName'));
|
|
743
|
-
}
|
|
744
|
-
},
|
|
745
|
-
testId: "card-action-download"
|
|
746
|
-
}, "Download") : null, onRemove ? /*#__PURE__*/React.createElement(f36Components.Menu.Item, {
|
|
747
|
-
key: "remove",
|
|
748
|
-
disabled: isDisabled,
|
|
749
|
-
onClick: onRemove,
|
|
750
|
-
testId: "card-action-remove"
|
|
751
|
-
}, "Remove") : null].filter(function (item) {
|
|
752
|
-
return item;
|
|
753
|
-
});
|
|
754
|
-
}
|
|
755
641
|
function FetchingWrappedAssetCard(props) {
|
|
756
|
-
var
|
|
642
|
+
var onEntityFetchComplete = props.onEntityFetchComplete,
|
|
643
|
+
assetId = props.assetId;
|
|
757
644
|
|
|
758
645
|
var _useEntities = fieldEditorReference.useEntities(),
|
|
759
646
|
getOrLoadAsset = _useEntities.getOrLoadAsset,
|
|
647
|
+
loadEntityScheduledActions = _useEntities.loadEntityScheduledActions,
|
|
760
648
|
assets = _useEntities.assets;
|
|
761
649
|
|
|
762
|
-
var asset = assets[props.assetId];
|
|
763
|
-
var defaultLocaleCode = props.sdk.locales["default"];
|
|
764
|
-
var entityFile = asset != null && (_asset$fields = asset.fields) != null && _asset$fields.file ? asset.fields.file[props.locale] || asset.fields.file[defaultLocaleCode] : undefined;
|
|
765
|
-
var onEntityFetchComplete = props.onEntityFetchComplete;
|
|
766
650
|
React.useEffect(function () {
|
|
767
|
-
getOrLoadAsset(
|
|
768
|
-
}, [
|
|
769
|
-
|
|
651
|
+
getOrLoadAsset(assetId);
|
|
652
|
+
}, [getOrLoadAsset, assetId]);
|
|
653
|
+
var asset = assets[assetId];
|
|
770
654
|
React.useEffect(function () {
|
|
771
|
-
if (
|
|
772
|
-
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
onEntityFetchComplete == null ? void 0 : onEntityFetchComplete();
|
|
776
|
-
}, [asset, onEntityFetchComplete]);
|
|
777
|
-
|
|
778
|
-
function getAssetSrc() {
|
|
779
|
-
if (!(entityFile != null && entityFile.url)) return '';
|
|
780
|
-
return entityFile.url + "?h=300";
|
|
781
|
-
}
|
|
782
|
-
|
|
783
|
-
function getFileType() {
|
|
784
|
-
var groupToIconMap = {
|
|
785
|
-
image: 'image',
|
|
786
|
-
video: 'video',
|
|
787
|
-
audio: 'audio',
|
|
788
|
-
richtext: 'richtext',
|
|
789
|
-
presentation: 'presentation',
|
|
790
|
-
spreadsheet: 'spreadsheet',
|
|
791
|
-
pdfdocument: 'pdf',
|
|
792
|
-
archive: 'archive',
|
|
793
|
-
plaintext: 'plaintext',
|
|
794
|
-
code: 'code',
|
|
795
|
-
markup: 'markup'
|
|
796
|
-
};
|
|
797
|
-
var archive = groupToIconMap['archive'];
|
|
798
|
-
|
|
799
|
-
if (!entityFile) {
|
|
800
|
-
return archive;
|
|
655
|
+
if (asset) {
|
|
656
|
+
onEntityFetchComplete == null ? void 0 : onEntityFetchComplete();
|
|
801
657
|
}
|
|
802
|
-
|
|
803
|
-
var groupName = mimetype.getGroupLabel({
|
|
804
|
-
type: entityFile.contentType,
|
|
805
|
-
fallbackFileName: entityFile.fileName
|
|
806
|
-
});
|
|
807
|
-
return groupToIconMap[groupName] || archive;
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
if (asset === undefined) {
|
|
811
|
-
return /*#__PURE__*/React.createElement(f36Components.AssetCard, {
|
|
812
|
-
size: "small",
|
|
813
|
-
isLoading: true
|
|
814
|
-
});
|
|
815
|
-
}
|
|
658
|
+
}, [onEntityFetchComplete, asset]);
|
|
816
659
|
|
|
817
660
|
if (asset === 'failed') {
|
|
818
661
|
return /*#__PURE__*/React.createElement(fieldEditorReference.MissingEntityCard, {
|
|
@@ -822,139 +665,48 @@ function FetchingWrappedAssetCard(props) {
|
|
|
822
665
|
});
|
|
823
666
|
}
|
|
824
667
|
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
entityType: "Asset",
|
|
830
|
-
asSquare: true,
|
|
831
|
-
isDisabled: props.isDisabled,
|
|
832
|
-
onRemove: props.onRemove
|
|
668
|
+
if (asset === undefined) {
|
|
669
|
+
return /*#__PURE__*/React.createElement(f36Components.AssetCard, {
|
|
670
|
+
size: "default",
|
|
671
|
+
isLoading: true
|
|
833
672
|
});
|
|
834
673
|
}
|
|
835
674
|
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
localeCode: props.locale,
|
|
839
|
-
defaultLocaleCode: defaultLocaleCode,
|
|
840
|
-
defaultTitle: 'Untitled'
|
|
841
|
-
});
|
|
842
|
-
return /*#__PURE__*/React.createElement(f36Components.AssetCard, {
|
|
843
|
-
title: entityTitle,
|
|
844
|
-
isSelected: props.isSelected,
|
|
675
|
+
return /*#__PURE__*/React.createElement(fieldEditorReference.WrappedAssetCard, {
|
|
676
|
+
getEntityScheduledActions: loadEntityScheduledActions,
|
|
845
677
|
size: "small",
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
actions: [renderActions({
|
|
855
|
-
entityFile: entityFile,
|
|
856
|
-
isDisabled: props.isDisabled,
|
|
857
|
-
onEdit: props.onEdit,
|
|
858
|
-
onRemove: props.onRemove
|
|
859
|
-
}), entityFile ? renderAssetInfo({
|
|
860
|
-
entityFile: entityFile
|
|
861
|
-
}) : null].filter(function (item) {
|
|
862
|
-
return item;
|
|
863
|
-
})
|
|
864
|
-
});
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
var styles$2 = {
|
|
868
|
-
entryCard: /*#__PURE__*/emotion.css({
|
|
869
|
-
cursor: 'pointer'
|
|
870
|
-
})
|
|
871
|
-
};
|
|
872
|
-
|
|
873
|
-
function EntryThumbnail(_ref) {
|
|
874
|
-
var file = _ref.file;
|
|
875
|
-
if (!fieldEditorShared.isValidImage(file)) return null;
|
|
876
|
-
return /*#__PURE__*/React.createElement(fieldEditorReference.AssetThumbnail, {
|
|
877
|
-
file: file
|
|
678
|
+
isSelected: props.isSelected,
|
|
679
|
+
isDisabled: props.isDisabled,
|
|
680
|
+
localeCode: props.locale,
|
|
681
|
+
defaultLocaleCode: props.sdk.locales["default"],
|
|
682
|
+
asset: asset,
|
|
683
|
+
onEdit: props.onEdit,
|
|
684
|
+
onRemove: props.isDisabled ? undefined : props.onRemove,
|
|
685
|
+
isClickable: false
|
|
878
686
|
});
|
|
879
687
|
}
|
|
880
688
|
|
|
881
689
|
function FetchingWrappedEntryCard(props) {
|
|
690
|
+
var entryId = props.entryId,
|
|
691
|
+
onEntityFetchComplete = props.onEntityFetchComplete;
|
|
692
|
+
|
|
882
693
|
var _useEntities = fieldEditorReference.useEntities(),
|
|
883
694
|
getOrLoadEntry = _useEntities.getOrLoadEntry,
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
var _React$useState = React.useState(null),
|
|
888
|
-
file = _React$useState[0],
|
|
889
|
-
setFile = _React$useState[1];
|
|
890
|
-
|
|
891
|
-
var entry = entries[props.entryId];
|
|
892
|
-
var contentType = React.useMemo(function () {
|
|
893
|
-
if (!entry || entry === 'failed') {
|
|
894
|
-
return undefined;
|
|
895
|
-
}
|
|
695
|
+
loadEntityScheduledActions = _useEntities.loadEntityScheduledActions,
|
|
696
|
+
entries = _useEntities.entries;
|
|
896
697
|
|
|
897
|
-
return props.sdk.space.getCachedContentTypes().find(function (contentType) {
|
|
898
|
-
return contentType.sys.id === entry.sys.contentType.sys.id;
|
|
899
|
-
});
|
|
900
|
-
}, [props.sdk, entry]);
|
|
901
|
-
var defaultLocaleCode = props.sdk.locales["default"];
|
|
902
|
-
var onEntityFetchComplete = props.onEntityFetchComplete;
|
|
903
698
|
React.useEffect(function () {
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
entry: entry,
|
|
908
|
-
contentType: contentType,
|
|
909
|
-
localeCode: props.locale,
|
|
910
|
-
defaultLocaleCode: defaultLocaleCode
|
|
911
|
-
}, getOrLoadAsset)["catch"](function () {
|
|
912
|
-
return null;
|
|
913
|
-
}).then(function (file) {
|
|
914
|
-
if (subscribed) {
|
|
915
|
-
setFile(file);
|
|
916
|
-
}
|
|
917
|
-
});
|
|
918
|
-
return function () {
|
|
919
|
-
subscribed = false;
|
|
920
|
-
};
|
|
921
|
-
}, [entry, contentType, props.locale, defaultLocaleCode, props.sdk, file, getOrLoadAsset]);
|
|
699
|
+
getOrLoadEntry(entryId);
|
|
700
|
+
}, [getOrLoadEntry, entryId]);
|
|
701
|
+
var entry = entries[entryId];
|
|
922
702
|
React.useEffect(function () {
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
React.useEffect(function () {
|
|
927
|
-
if (!entry) {
|
|
928
|
-
return;
|
|
703
|
+
if (entry) {
|
|
704
|
+
onEntityFetchComplete == null ? void 0 : onEntityFetchComplete();
|
|
929
705
|
}
|
|
930
|
-
|
|
931
|
-
onEntityFetchComplete == null ? void 0 : onEntityFetchComplete();
|
|
932
|
-
}, [entry, onEntityFetchComplete]);
|
|
933
|
-
|
|
934
|
-
function renderDropdown() {
|
|
935
|
-
if (!props.onEdit || !props.onRemove) return undefined;
|
|
936
|
-
return [props.onEdit ? /*#__PURE__*/React.createElement(f36Components.MenuItem, {
|
|
937
|
-
key: "edit",
|
|
938
|
-
disabled: props.isDisabled,
|
|
939
|
-
testId: "card-action-edit",
|
|
940
|
-
onClick: function onClick() {
|
|
941
|
-
props.onEdit && props.onEdit();
|
|
942
|
-
}
|
|
943
|
-
}, "Edit") : null, props.onRemove ? /*#__PURE__*/React.createElement(f36Components.MenuItem, {
|
|
944
|
-
key: "delete",
|
|
945
|
-
disabled: props.isDisabled,
|
|
946
|
-
testId: "card-action-remove",
|
|
947
|
-
onClick: function onClick() {
|
|
948
|
-
props.onRemove && props.onRemove();
|
|
949
|
-
}
|
|
950
|
-
}, "Remove") : null].filter(function (item) {
|
|
951
|
-
return item;
|
|
952
|
-
});
|
|
953
|
-
}
|
|
706
|
+
}, [onEntityFetchComplete, entry]);
|
|
954
707
|
|
|
955
708
|
if (entry === undefined) {
|
|
956
709
|
return /*#__PURE__*/React.createElement(f36Components.EntryCard, {
|
|
957
|
-
size: "default",
|
|
958
710
|
isLoading: true
|
|
959
711
|
});
|
|
960
712
|
}
|
|
@@ -967,50 +719,26 @@ function FetchingWrappedEntryCard(props) {
|
|
|
967
719
|
});
|
|
968
720
|
}
|
|
969
721
|
|
|
970
|
-
var
|
|
971
|
-
|
|
972
|
-
if (entryStatus === 'deleted') {
|
|
973
|
-
return /*#__PURE__*/React.createElement(fieldEditorReference.MissingEntityCard, {
|
|
974
|
-
entityType: "Entry",
|
|
975
|
-
isDisabled: props.isDisabled,
|
|
976
|
-
onRemove: props.onRemove
|
|
977
|
-
});
|
|
978
|
-
}
|
|
979
|
-
|
|
980
|
-
var title = fieldEditorShared.entityHelpers.getEntryTitle({
|
|
981
|
-
entry: entry,
|
|
982
|
-
contentType: contentType,
|
|
983
|
-
localeCode: props.locale,
|
|
984
|
-
defaultLocaleCode: defaultLocaleCode,
|
|
985
|
-
defaultTitle: 'Untitled'
|
|
986
|
-
});
|
|
987
|
-
var description = fieldEditorShared.entityHelpers.getEntityDescription({
|
|
988
|
-
entity: entry,
|
|
989
|
-
contentType: contentType,
|
|
990
|
-
localeCode: props.locale,
|
|
991
|
-
defaultLocaleCode: defaultLocaleCode
|
|
722
|
+
var contentType = props.sdk.space.getCachedContentTypes().find(function (contentType) {
|
|
723
|
+
return contentType.sys.id === entry.sys.contentType.sys.id;
|
|
992
724
|
});
|
|
993
|
-
return /*#__PURE__*/React.createElement(
|
|
994
|
-
contentType: contentType == null ? void 0 : contentType.name,
|
|
995
|
-
title: title,
|
|
996
|
-
description: description,
|
|
725
|
+
return /*#__PURE__*/React.createElement(fieldEditorReference.WrappedEntryCard, {
|
|
997
726
|
size: "default",
|
|
727
|
+
getAsset: props.sdk.space.getAsset,
|
|
728
|
+
getEntityScheduledActions: loadEntityScheduledActions,
|
|
998
729
|
isSelected: props.isSelected,
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
}),
|
|
1008
|
-
withDragHandle: false,
|
|
1009
|
-
actions: renderDropdown()
|
|
730
|
+
isDisabled: props.isDisabled,
|
|
731
|
+
localeCode: props.locale,
|
|
732
|
+
defaultLocaleCode: props.sdk.locales["default"],
|
|
733
|
+
contentType: contentType,
|
|
734
|
+
entry: entry,
|
|
735
|
+
onEdit: props.onEdit,
|
|
736
|
+
onRemove: props.isDisabled ? undefined : props.onRemove,
|
|
737
|
+
isClickable: false
|
|
1010
738
|
});
|
|
1011
739
|
}
|
|
1012
740
|
|
|
1013
|
-
var styles
|
|
741
|
+
var styles = {
|
|
1014
742
|
root: /*#__PURE__*/emotion.css({
|
|
1015
743
|
marginBottom: '1.25rem !important',
|
|
1016
744
|
display: 'block'
|
|
@@ -1019,7 +747,8 @@ var styles$3 = {
|
|
|
1019
747
|
// The next 2 properties ensure Entity card won't be aligned above
|
|
1020
748
|
// a list item marker (i.e. bullet)
|
|
1021
749
|
display: 'inline-block',
|
|
1022
|
-
verticalAlign: 'text-top'
|
|
750
|
+
verticalAlign: 'text-top',
|
|
751
|
+
width: '100%'
|
|
1023
752
|
})
|
|
1024
753
|
};
|
|
1025
754
|
function LinkedEntityBlock(props) {
|
|
@@ -1051,7 +780,7 @@ function LinkedEntityBlock(props) {
|
|
|
1051
780
|
};
|
|
1052
781
|
|
|
1053
782
|
return /*#__PURE__*/React__default.createElement("div", Object.assign({}, attributes, {
|
|
1054
|
-
className: styles
|
|
783
|
+
className: styles.root,
|
|
1055
784
|
"data-entity-type": entityType,
|
|
1056
785
|
"data-entity-id": entityId,
|
|
1057
786
|
// COMPAT: This makes copy & paste work for Firefox
|
|
@@ -1061,7 +790,7 @@ function LinkedEntityBlock(props) {
|
|
|
1061
790
|
// COMPAT: This makes copy & paste work for Chromium/Blink browsers and Safari
|
|
1062
791
|
contentEditable: HAS_BEFORE_INPUT_SUPPORT ? false : undefined,
|
|
1063
792
|
draggable: HAS_BEFORE_INPUT_SUPPORT ? true : undefined,
|
|
1064
|
-
className: styles
|
|
793
|
+
className: styles.container
|
|
1065
794
|
}, entityType === 'Entry' && /*#__PURE__*/React__default.createElement(FetchingWrappedEntryCard, {
|
|
1066
795
|
sdk: sdk,
|
|
1067
796
|
entryId: entityId,
|
|
@@ -2009,14 +1738,13 @@ function insertBlock(editor, nodeType, entity) {
|
|
|
2009
1738
|
focus(editor);
|
|
2010
1739
|
}
|
|
2011
1740
|
|
|
2012
|
-
var styles$
|
|
1741
|
+
var styles$1 = {
|
|
2013
1742
|
icon: /*#__PURE__*/emotion.css({
|
|
2014
1743
|
marginRight: '10px'
|
|
2015
1744
|
})
|
|
2016
1745
|
};
|
|
2017
1746
|
function EmbeddedEntityBlockToolbarIcon(_ref) {
|
|
2018
|
-
var
|
|
2019
|
-
isDisabled = _ref.isDisabled,
|
|
1747
|
+
var isDisabled = _ref.isDisabled,
|
|
2020
1748
|
nodeType = _ref.nodeType,
|
|
2021
1749
|
onClose = _ref.onClose;
|
|
2022
1750
|
var editor = useContentfulEditor();
|
|
@@ -2048,15 +1776,7 @@ function EmbeddedEntityBlockToolbarIcon(_ref) {
|
|
|
2048
1776
|
|
|
2049
1777
|
var type = getEntityTypeFromNodeType(nodeType);
|
|
2050
1778
|
var baseClass = "rich-text__" + nodeType;
|
|
2051
|
-
return
|
|
2052
|
-
isDisabled: isDisabled,
|
|
2053
|
-
className: baseClass + "-button",
|
|
2054
|
-
size: "small",
|
|
2055
|
-
onClick: handleClick,
|
|
2056
|
-
startIcon: type === 'Asset' ? /*#__PURE__*/React__default.createElement(f36Icons.AssetIcon, null) : /*#__PURE__*/React__default.createElement(f36Icons.EmbeddedEntryBlockIcon, null),
|
|
2057
|
-
variant: "secondary",
|
|
2058
|
-
testId: "toolbar-toggle-" + nodeType
|
|
2059
|
-
}, "Embed " + type.toLowerCase()) : /*#__PURE__*/React__default.createElement(f36Components.Menu.Item, {
|
|
1779
|
+
return /*#__PURE__*/React__default.createElement(f36Components.Menu.Item, {
|
|
2060
1780
|
disabled: isDisabled,
|
|
2061
1781
|
className: baseClass + "-list-item",
|
|
2062
1782
|
onClick: handleClick,
|
|
@@ -2066,7 +1786,7 @@ function EmbeddedEntityBlockToolbarIcon(_ref) {
|
|
|
2066
1786
|
flexDirection: "row"
|
|
2067
1787
|
}, /*#__PURE__*/React__default.createElement(f36Components.Icon, {
|
|
2068
1788
|
as: type === 'Asset' ? f36Icons.AssetIcon : f36Icons.EmbeddedEntryBlockIcon,
|
|
2069
|
-
className: "rich-text__embedded-entry-list-icon " + styles$
|
|
1789
|
+
className: "rich-text__embedded-entry-list-icon " + styles$1.icon,
|
|
2070
1790
|
variant: "secondary"
|
|
2071
1791
|
}), /*#__PURE__*/React__default.createElement("span", null, type)));
|
|
2072
1792
|
}
|
|
@@ -2165,7 +1885,7 @@ var createEmbeddedAssetBlockPlugin = /*#__PURE__*/createEmbeddedEntityPlugin(Con
|
|
|
2165
1885
|
|
|
2166
1886
|
var getEntryTitle = fieldEditorShared.entityHelpers.getEntryTitle,
|
|
2167
1887
|
getEntryStatus = fieldEditorShared.entityHelpers.getEntryStatus;
|
|
2168
|
-
var styles$
|
|
1888
|
+
var styles$2 = {
|
|
2169
1889
|
scheduledIcon: /*#__PURE__*/emotion.css({
|
|
2170
1890
|
verticalAlign: 'text-bottom',
|
|
2171
1891
|
marginRight: tokens.spacing2Xs
|
|
@@ -2236,7 +1956,7 @@ function FetchingWrappedInlineEntryCard(props) {
|
|
|
2236
1956
|
actions: [/*#__PURE__*/React__default.createElement(f36Components.MenuItem, {
|
|
2237
1957
|
key: "remove",
|
|
2238
1958
|
onClick: props.onRemove,
|
|
2239
|
-
testId: "
|
|
1959
|
+
testId: "delete"
|
|
2240
1960
|
}, "Remove")]
|
|
2241
1961
|
});
|
|
2242
1962
|
}
|
|
@@ -2248,20 +1968,19 @@ function FetchingWrappedInlineEntryCard(props) {
|
|
|
2248
1968
|
status: status,
|
|
2249
1969
|
actions: [/*#__PURE__*/React__default.createElement(f36Components.MenuItem, {
|
|
2250
1970
|
key: "edit",
|
|
2251
|
-
onClick: props.onEdit
|
|
2252
|
-
disabled: props.isDisabled
|
|
1971
|
+
onClick: props.onEdit
|
|
2253
1972
|
}, "Edit"), /*#__PURE__*/React__default.createElement(f36Components.MenuItem, {
|
|
2254
1973
|
key: "remove",
|
|
2255
1974
|
onClick: props.onRemove,
|
|
2256
1975
|
disabled: props.isDisabled,
|
|
2257
|
-
testId: "
|
|
1976
|
+
testId: "delete"
|
|
2258
1977
|
}, "Remove")]
|
|
2259
1978
|
}, /*#__PURE__*/React__default.createElement(fieldEditorReference.ScheduledIconWithTooltip, {
|
|
2260
1979
|
getEntityScheduledActions: loadEntityScheduledActions,
|
|
2261
1980
|
entityType: "Entry",
|
|
2262
1981
|
entityId: entry.sys.id
|
|
2263
1982
|
}, /*#__PURE__*/React__default.createElement(f36Icons.ClockIcon, {
|
|
2264
|
-
className: styles$
|
|
1983
|
+
className: styles$2.scheduledIcon,
|
|
2265
1984
|
variant: "muted",
|
|
2266
1985
|
testId: "scheduled-icon"
|
|
2267
1986
|
})), /*#__PURE__*/React__default.createElement(f36Components.Text, null, title));
|
|
@@ -2285,7 +2004,7 @@ function createInlineEntryNode(id) {
|
|
|
2285
2004
|
};
|
|
2286
2005
|
}
|
|
2287
2006
|
|
|
2288
|
-
var styles$
|
|
2007
|
+
var styles$3 = {
|
|
2289
2008
|
icon: /*#__PURE__*/emotion.css({
|
|
2290
2009
|
marginRight: '10px'
|
|
2291
2010
|
}),
|
|
@@ -2321,7 +2040,7 @@ function EmbeddedEntityInline(props) {
|
|
|
2321
2040
|
}
|
|
2322
2041
|
|
|
2323
2042
|
return /*#__PURE__*/React.createElement("span", Object.assign({}, props.attributes, {
|
|
2324
|
-
className: styles$
|
|
2043
|
+
className: styles$3.root,
|
|
2325
2044
|
"data-embedded-entity-inline-id": entryId,
|
|
2326
2045
|
// COMPAT: This makes copy & paste work for Firefox
|
|
2327
2046
|
contentEditable: !HAS_BEFORE_INPUT_SUPPORT ? false : undefined,
|
|
@@ -2441,15 +2160,7 @@ function ToolbarEmbeddedEntityInlineButton(props) {
|
|
|
2441
2160
|
return _handleClick.apply(this, arguments);
|
|
2442
2161
|
}
|
|
2443
2162
|
|
|
2444
|
-
return
|
|
2445
|
-
isDisabled: props.isDisabled,
|
|
2446
|
-
className: Contentful.INLINES.EMBEDDED_ENTRY + "-button",
|
|
2447
|
-
size: "small",
|
|
2448
|
-
onClick: handleClick,
|
|
2449
|
-
startIcon: /*#__PURE__*/React.createElement(f36Icons.EmbeddedEntryInlineIcon, null),
|
|
2450
|
-
variant: "secondary",
|
|
2451
|
-
testId: "toolbar-toggle-" + Contentful.INLINES.EMBEDDED_ENTRY
|
|
2452
|
-
}, "Embed inline entry") : /*#__PURE__*/React.createElement(f36Components.Menu.Item, {
|
|
2163
|
+
return /*#__PURE__*/React.createElement(f36Components.Menu.Item, {
|
|
2453
2164
|
disabled: props.isDisabled,
|
|
2454
2165
|
className: "rich-text__entry-link-block-button",
|
|
2455
2166
|
testId: "toolbar-toggle-" + Contentful.INLINES.EMBEDDED_ENTRY,
|
|
@@ -2459,7 +2170,7 @@ function ToolbarEmbeddedEntityInlineButton(props) {
|
|
|
2459
2170
|
flexDirection: "row"
|
|
2460
2171
|
}, /*#__PURE__*/React.createElement(f36Icons.EmbeddedEntryInlineIcon, {
|
|
2461
2172
|
variant: "secondary",
|
|
2462
|
-
className: "rich-text__embedded-entry-list-icon " + styles$
|
|
2173
|
+
className: "rich-text__embedded-entry-list-icon " + styles$3.icon
|
|
2463
2174
|
}), /*#__PURE__*/React.createElement("span", null, "Inline entry")));
|
|
2464
2175
|
}
|
|
2465
2176
|
function createEmbeddedEntityInlinePlugin(sdk) {
|
|
@@ -2535,7 +2246,7 @@ var isMarkEnabled = function isMarkEnabled(field, mark) {
|
|
|
2535
2246
|
};
|
|
2536
2247
|
|
|
2537
2248
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _dropdown, _LABELS;
|
|
2538
|
-
var styles$
|
|
2249
|
+
var styles$4 = {
|
|
2539
2250
|
dropdown: (_dropdown = {
|
|
2540
2251
|
root: /*#__PURE__*/emotion.css(_templateObject || (_templateObject = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-weight: ", ";\n "])), tokens.fontWeightDemiBold)
|
|
2541
2252
|
}, _dropdown[Contentful.BLOCKS.PARAGRAPH] = /*#__PURE__*/emotion.css(_templateObject2 || (_templateObject2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: ", ";\n "])), tokens.fontSizeL), _dropdown[Contentful.BLOCKS.HEADING_1] = /*#__PURE__*/emotion.css(_templateObject3 || (_templateObject3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 1.625rem;\n "]))), _dropdown[Contentful.BLOCKS.HEADING_2] = /*#__PURE__*/emotion.css(_templateObject4 || (_templateObject4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 1.4375rem;\n "]))), _dropdown[Contentful.BLOCKS.HEADING_3] = /*#__PURE__*/emotion.css(_templateObject5 || (_templateObject5 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 1.25rem;\n "]))), _dropdown[Contentful.BLOCKS.HEADING_4] = /*#__PURE__*/emotion.css(_templateObject6 || (_templateObject6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 1.125rem;\n "]))), _dropdown[Contentful.BLOCKS.HEADING_5] = /*#__PURE__*/emotion.css(_templateObject7 || (_templateObject7 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 1rem;\n "]))), _dropdown[Contentful.BLOCKS.HEADING_6] = /*#__PURE__*/emotion.css(_templateObject8 || (_templateObject8 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 0.875rem;\n "]))), _dropdown)
|
|
@@ -2630,7 +2341,7 @@ function ToolbarHeadingButton(props) {
|
|
|
2630
2341
|
testId: "dropdown-option-" + nodeType,
|
|
2631
2342
|
disabled: props.isDisabled
|
|
2632
2343
|
}, /*#__PURE__*/React.createElement("span", {
|
|
2633
|
-
className: emotion.cx(styles$
|
|
2344
|
+
className: emotion.cx(styles$4.dropdown.root, styles$4.dropdown[nodeType])
|
|
2634
2345
|
}, LABELS[nodeType]));
|
|
2635
2346
|
}).filter(Boolean)));
|
|
2636
2347
|
}
|
|
@@ -2700,7 +2411,7 @@ var transformLift = function transformLift(editor, _ref4) {
|
|
|
2700
2411
|
};
|
|
2701
2412
|
|
|
2702
2413
|
var _templateObject$1, _templateObject2$1, _templateObject3$1, _templateObject4$1, _templateObject5$1, _templateObject6$1, _templateObject7$1, _templateObject8$1, _dropdown$1, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _headings, _HeadingComponents;
|
|
2703
|
-
var styles$
|
|
2414
|
+
var styles$5 = {
|
|
2704
2415
|
dropdown: (_dropdown$1 = {
|
|
2705
2416
|
root: /*#__PURE__*/emotion.css(_templateObject$1 || (_templateObject$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-weight: ", ";\n "])), tokens.fontWeightDemiBold)
|
|
2706
2417
|
}, _dropdown$1[Contentful.BLOCKS.PARAGRAPH] = /*#__PURE__*/emotion.css(_templateObject2$1 || (_templateObject2$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: ", ";\n "])), tokens.fontSizeL), _dropdown$1[Contentful.BLOCKS.HEADING_1] = /*#__PURE__*/emotion.css(_templateObject3$1 || (_templateObject3$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 1.625rem;\n "]))), _dropdown$1[Contentful.BLOCKS.HEADING_2] = /*#__PURE__*/emotion.css(_templateObject4$1 || (_templateObject4$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 1.4375rem;\n "]))), _dropdown$1[Contentful.BLOCKS.HEADING_3] = /*#__PURE__*/emotion.css(_templateObject5$1 || (_templateObject5$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 1.25rem;\n "]))), _dropdown$1[Contentful.BLOCKS.HEADING_4] = /*#__PURE__*/emotion.css(_templateObject6$1 || (_templateObject6$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 1.125rem;\n "]))), _dropdown$1[Contentful.BLOCKS.HEADING_5] = /*#__PURE__*/emotion.css(_templateObject7$1 || (_templateObject7$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 1rem;\n "]))), _dropdown$1[Contentful.BLOCKS.HEADING_6] = /*#__PURE__*/emotion.css(_templateObject8$1 || (_templateObject8$1 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n font-size: 0.875rem;\n "]))), _dropdown$1),
|
|
@@ -2712,7 +2423,7 @@ var styles$8 = {
|
|
|
2712
2423
|
function createHeading(Tag, block) {
|
|
2713
2424
|
return function Heading(props) {
|
|
2714
2425
|
return /*#__PURE__*/React.createElement(Tag, Object.assign({}, props.attributes, {
|
|
2715
|
-
className: emotion.cx(styles$
|
|
2426
|
+
className: emotion.cx(styles$5.headings.root, styles$5.headings[block])
|
|
2716
2427
|
}), props.children);
|
|
2717
2428
|
};
|
|
2718
2429
|
}
|
|
@@ -2808,7 +2519,7 @@ var createHeadingPlugin = function createHeadingPlugin() {
|
|
|
2808
2519
|
};
|
|
2809
2520
|
};
|
|
2810
2521
|
|
|
2811
|
-
var styles$
|
|
2522
|
+
var styles$6 = {
|
|
2812
2523
|
button: /*#__PURE__*/emotion.css({
|
|
2813
2524
|
height: '30px',
|
|
2814
2525
|
width: '30px',
|
|
@@ -2834,7 +2545,7 @@ function ToolbarButton(props) {
|
|
|
2834
2545
|
};
|
|
2835
2546
|
|
|
2836
2547
|
var button = /*#__PURE__*/React__default.createElement(f36Components.Button, {
|
|
2837
|
-
className: emotion.cx(styles$
|
|
2548
|
+
className: emotion.cx(styles$6.button, className),
|
|
2838
2549
|
isDisabled: isDisabled,
|
|
2839
2550
|
startIcon: children,
|
|
2840
2551
|
onClick: handleClick,
|
|
@@ -2845,7 +2556,7 @@ function ToolbarButton(props) {
|
|
|
2845
2556
|
|
|
2846
2557
|
if (title) {
|
|
2847
2558
|
return /*#__PURE__*/React__default.createElement(f36Components.Tooltip, {
|
|
2848
|
-
className: styles$
|
|
2559
|
+
className: styles$6.tooltip,
|
|
2849
2560
|
placement: "bottom",
|
|
2850
2561
|
content: title
|
|
2851
2562
|
}, button);
|
|
@@ -2855,7 +2566,7 @@ function ToolbarButton(props) {
|
|
|
2855
2566
|
}
|
|
2856
2567
|
|
|
2857
2568
|
var _templateObject$2, _templateObject2$2, _templateObject3$2;
|
|
2858
|
-
var styles$
|
|
2569
|
+
var styles$7 = {
|
|
2859
2570
|
container: /*#__PURE__*/emotion.css(_templateObject$2 || (_templateObject$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin: 0 0 ", ";\n "])), tokens.spacingL),
|
|
2860
2571
|
hr: /*#__PURE__*/emotion.css(_templateObject2$2 || (_templateObject2$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin: 0;\n height: ", ";\n background: transparent;\n position: relative;\n border: 0;\n user-select: none;\n &:hover {\n cursor: pointer;\n }\n &::after {\n content: '';\n position: absolute;\n width: 100%;\n height: 1px;\n background: ", ";\n top: 50%;\n }\n "])), tokens.spacingM, tokens.gray300),
|
|
2861
2572
|
hrSelected: /*#__PURE__*/emotion.css(_templateObject3$2 || (_templateObject3$2 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n &::after {\n background: ", ";\n -webkit-box-shadow: 0px 0px 5px ", ";\n box-shadow: 0px 0px 5px ", ";\n }\n "])), tokens.colorPrimary, tokens.colorPrimary, tokens.colorPrimary)
|
|
@@ -2913,14 +2624,14 @@ function Hr(props) {
|
|
|
2913
2624
|
var isSelected = Slate.useSelected();
|
|
2914
2625
|
var isFocused = Slate.useFocused();
|
|
2915
2626
|
return /*#__PURE__*/React.createElement("div", Object.assign({}, props.attributes, {
|
|
2916
|
-
className: styles$
|
|
2627
|
+
className: styles$7.container,
|
|
2917
2628
|
"data-void-element": Contentful.BLOCKS.HR
|
|
2918
2629
|
}), /*#__PURE__*/React.createElement("div", {
|
|
2919
2630
|
draggable: true,
|
|
2920
2631
|
// Moving `contentEditable` to this div makes it to be selectable when being the first void element, e.g pressing ctrl + a to select everything
|
|
2921
2632
|
contentEditable: false
|
|
2922
2633
|
}, /*#__PURE__*/React.createElement("hr", {
|
|
2923
|
-
className: emotion.cx(styles$
|
|
2634
|
+
className: emotion.cx(styles$7.hr, isSelected && isFocused ? styles$7.hrSelected : undefined)
|
|
2924
2635
|
})), props.children);
|
|
2925
2636
|
}
|
|
2926
2637
|
var createHrPlugin = function createHrPlugin() {
|
|
@@ -2947,7 +2658,7 @@ var createHrPlugin = function createHrPlugin() {
|
|
|
2947
2658
|
};
|
|
2948
2659
|
|
|
2949
2660
|
var _templateObject$3, _SYS_LINK_TYPES, _LINK_TYPE_SELECTION_;
|
|
2950
|
-
var styles$
|
|
2661
|
+
var styles$8 = {
|
|
2951
2662
|
removeSelectionLabel: /*#__PURE__*/emotion.css(_templateObject$3 || (_templateObject$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n margin-left: ", ";\n "])), tokens.spacingS)
|
|
2952
2663
|
};
|
|
2953
2664
|
var SYS_LINK_TYPES = (_SYS_LINK_TYPES = {}, _SYS_LINK_TYPES[Contentful.INLINES.ENTRY_HYPERLINK] = 'Entry', _SYS_LINK_TYPES[Contentful.INLINES.ASSET_HYPERLINK] = 'Asset', _SYS_LINK_TYPES);
|
|
@@ -3105,7 +2816,8 @@ function HyperlinkModal(props) {
|
|
|
3105
2816
|
onChange: function onChange(event) {
|
|
3106
2817
|
return setLinkType(event.target.value);
|
|
3107
2818
|
},
|
|
3108
|
-
testId: "link-type-input"
|
|
2819
|
+
testId: "link-type-input",
|
|
2820
|
+
isDisabled: props.readonly
|
|
3109
2821
|
}, enabledLinkTypes.map(function (nodeType) {
|
|
3110
2822
|
return /*#__PURE__*/React.createElement(f36Components.Select.Option, {
|
|
3111
2823
|
key: nodeType,
|
|
@@ -3121,14 +2833,15 @@ function HyperlinkModal(props) {
|
|
|
3121
2833
|
setLinkEntity(null);
|
|
3122
2834
|
setLinkTarget(event.target.value);
|
|
3123
2835
|
},
|
|
3124
|
-
testId: "link-target-input"
|
|
2836
|
+
testId: "link-target-input",
|
|
2837
|
+
isDisabled: props.readonly
|
|
3125
2838
|
}), /*#__PURE__*/React.createElement(f36Components.FormControl.HelpText, null, "A protocol may be required, e.g. https://")), linkType !== Contentful.INLINES.HYPERLINK && /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(f36Components.FormLabel, {
|
|
3126
2839
|
isRequired: true,
|
|
3127
2840
|
htmlFor: ""
|
|
3128
|
-
}, "Link target", ' '), linkEntity && linkEntity.sys.linkType === SYS_LINK_TYPES[linkType] ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(f36Components.TextLink, {
|
|
2841
|
+
}, "Link target", ' '), linkEntity && linkEntity.sys.linkType === SYS_LINK_TYPES[linkType] ? /*#__PURE__*/React.createElement(React.Fragment, null, !props.readonly && /*#__PURE__*/React.createElement(f36Components.TextLink, {
|
|
3129
2842
|
testId: "entity-selection-link",
|
|
3130
2843
|
onClick: resetLinkEntity,
|
|
3131
|
-
className: styles$
|
|
2844
|
+
className: styles$8.removeSelectionLabel
|
|
3132
2845
|
}, "Remove selection"), /*#__PURE__*/React.createElement("div", null, linkType === Contentful.INLINES.ENTRY_HYPERLINK && /*#__PURE__*/React.createElement(FetchingWrappedEntryCard, {
|
|
3133
2846
|
sdk: props.sdk,
|
|
3134
2847
|
locale: props.sdk.field.locale,
|
|
@@ -3159,7 +2872,7 @@ function HyperlinkModal(props) {
|
|
|
3159
2872
|
type: "submit",
|
|
3160
2873
|
variant: "positive",
|
|
3161
2874
|
size: "small",
|
|
3162
|
-
isDisabled: !isLinkComplete(),
|
|
2875
|
+
isDisabled: props.readonly || !isLinkComplete(),
|
|
3163
2876
|
onClick: handleOnSubmit,
|
|
3164
2877
|
testId: "confirm-cta"
|
|
3165
2878
|
}, props.linkType ? 'Update' : 'Insert'))));
|
|
@@ -3172,22 +2885,23 @@ function _addOrEditLink() {
|
|
|
3172
2885
|
_addOrEditLink = _asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee3(editor, sdk, logAction, targetPath) {
|
|
3173
2886
|
var _target$sys$linkType;
|
|
3174
2887
|
|
|
3175
|
-
var selectionBeforeBlur, linkType, linkText, linkTarget, linkEntity, _getNodeEntryFromSele, node, path, selectionAfterFocus, currentLinkText, isEditing, data, text, url, type, target;
|
|
2888
|
+
var isReadOnly, selectionBeforeBlur, linkType, linkText, linkTarget, linkEntity, _getNodeEntryFromSele, node, path, selectionAfterFocus, currentLinkText, isEditing, data, text, url, type, target;
|
|
3176
2889
|
|
|
3177
2890
|
return runtime_1.wrap(function _callee3$(_context3) {
|
|
3178
2891
|
while (1) {
|
|
3179
2892
|
switch (_context3.prev = _context3.next) {
|
|
3180
2893
|
case 0:
|
|
2894
|
+
isReadOnly = Slate.ReactEditor.isReadOnly(editor);
|
|
3181
2895
|
selectionBeforeBlur = editor.selection ? _extends({}, editor.selection) : undefined;
|
|
3182
2896
|
|
|
3183
2897
|
if (!(!targetPath && !selectionBeforeBlur)) {
|
|
3184
|
-
_context3.next =
|
|
2898
|
+
_context3.next = 4;
|
|
3185
2899
|
break;
|
|
3186
2900
|
}
|
|
3187
2901
|
|
|
3188
2902
|
return _context3.abrupt("return");
|
|
3189
2903
|
|
|
3190
|
-
case
|
|
2904
|
+
case 4:
|
|
3191
2905
|
_getNodeEntryFromSele = getNodeEntryFromSelection(editor, LINK_TYPES, targetPath), node = _getNodeEntryFromSele[0], path = _getNodeEntryFromSele[1];
|
|
3192
2906
|
|
|
3193
2907
|
if (node && path) {
|
|
@@ -3201,7 +2915,7 @@ function _addOrEditLink() {
|
|
|
3201
2915
|
currentLinkText = linkText || (editor.selection ? slate.Editor.string(editor, editor.selection) : '');
|
|
3202
2916
|
isEditing = Boolean(node && path);
|
|
3203
2917
|
logAction(isEditing ? 'openEditHyperlinkDialog' : 'openCreateHyperlinkDialog');
|
|
3204
|
-
_context3.next =
|
|
2918
|
+
_context3.next = 12;
|
|
3205
2919
|
return fieldEditorShared.ModalDialogLauncher.openDialog({
|
|
3206
2920
|
title: isEditing ? 'Edit hyperlink' : 'Insert hyperlink',
|
|
3207
2921
|
width: 'large',
|
|
@@ -3216,16 +2930,17 @@ function _addOrEditLink() {
|
|
|
3216
2930
|
linkType: linkType,
|
|
3217
2931
|
linkEntity: linkEntity,
|
|
3218
2932
|
onClose: onClose,
|
|
3219
|
-
sdk: sdk
|
|
2933
|
+
sdk: sdk,
|
|
2934
|
+
readonly: isReadOnly
|
|
3220
2935
|
});
|
|
3221
2936
|
});
|
|
3222
2937
|
|
|
3223
|
-
case
|
|
2938
|
+
case 12:
|
|
3224
2939
|
data = _context3.sent;
|
|
3225
2940
|
slate.Transforms.select(editor, selectionAfterFocus);
|
|
3226
2941
|
|
|
3227
2942
|
if (data) {
|
|
3228
|
-
_context3.next =
|
|
2943
|
+
_context3.next = 18;
|
|
3229
2944
|
break;
|
|
3230
2945
|
}
|
|
3231
2946
|
|
|
@@ -3233,7 +2948,7 @@ function _addOrEditLink() {
|
|
|
3233
2948
|
logAction(isEditing ? 'cancelEditHyperlinkDialog' : 'cancelCreateHyperlinkDialog');
|
|
3234
2949
|
return _context3.abrupt("return");
|
|
3235
2950
|
|
|
3236
|
-
case
|
|
2951
|
+
case 18:
|
|
3237
2952
|
text = data.linkText, url = data.linkTarget, type = data.linkType, target = data.linkEntity;
|
|
3238
2953
|
slate.Editor.withoutNormalizing(editor, function () {
|
|
3239
2954
|
insertLink(editor, {
|
|
@@ -3250,7 +2965,7 @@ function _addOrEditLink() {
|
|
|
3250
2965
|
});
|
|
3251
2966
|
focus(editor);
|
|
3252
2967
|
|
|
3253
|
-
case
|
|
2968
|
+
case 22:
|
|
3254
2969
|
case "end":
|
|
3255
2970
|
return _context3.stop();
|
|
3256
2971
|
}
|
|
@@ -3467,7 +3182,7 @@ function useEntityInfo(props) {
|
|
|
3467
3182
|
return getEntityInfo(status.data);
|
|
3468
3183
|
}
|
|
3469
3184
|
|
|
3470
|
-
var styles$
|
|
3185
|
+
var styles$9 = {
|
|
3471
3186
|
hyperlinkWrapper: /*#__PURE__*/emotion.css({
|
|
3472
3187
|
display: 'inline',
|
|
3473
3188
|
position: 'static',
|
|
@@ -3489,7 +3204,6 @@ var styles$c = {
|
|
|
3489
3204
|
|
|
3490
3205
|
function EntityHyperlink(props) {
|
|
3491
3206
|
var editor = useContentfulEditor();
|
|
3492
|
-
var isReadOnly = Slate.useReadOnly();
|
|
3493
3207
|
var sdk = useSdkContext();
|
|
3494
3208
|
var target = props.element.data.target;
|
|
3495
3209
|
var onEntityFetchComplete = props.onEntityFetchComplete;
|
|
@@ -3513,14 +3227,13 @@ function EntityHyperlink(props) {
|
|
|
3513
3227
|
|
|
3514
3228
|
return /*#__PURE__*/React.createElement(f36Components.Tooltip, {
|
|
3515
3229
|
content: tooltipContent,
|
|
3516
|
-
targetWrapperClassName: styles$
|
|
3230
|
+
targetWrapperClassName: styles$9.hyperlinkWrapper,
|
|
3517
3231
|
placement: "bottom",
|
|
3518
3232
|
maxWidth: "auto"
|
|
3519
3233
|
}, /*#__PURE__*/React.createElement(f36Components.TextLink, {
|
|
3520
3234
|
as: "a",
|
|
3521
3235
|
onClick: handleClick,
|
|
3522
|
-
|
|
3523
|
-
className: styles$c.hyperlink,
|
|
3236
|
+
className: styles$9.hyperlink,
|
|
3524
3237
|
"data-link-type": target.sys.linkType,
|
|
3525
3238
|
"data-link-id": target.sys.id
|
|
3526
3239
|
}, props.children));
|
|
@@ -3528,7 +3241,6 @@ function EntityHyperlink(props) {
|
|
|
3528
3241
|
|
|
3529
3242
|
function UrlHyperlink(props) {
|
|
3530
3243
|
var editor = useContentfulEditor();
|
|
3531
|
-
var isReadOnly = Slate.useReadOnly();
|
|
3532
3244
|
var sdk = useSdkContext();
|
|
3533
3245
|
var uri = props.element.data.uri;
|
|
3534
3246
|
|
|
@@ -3545,7 +3257,7 @@ function UrlHyperlink(props) {
|
|
|
3545
3257
|
|
|
3546
3258
|
return /*#__PURE__*/React.createElement(f36Components.Tooltip, {
|
|
3547
3259
|
content: uri,
|
|
3548
|
-
targetWrapperClassName: styles$
|
|
3260
|
+
targetWrapperClassName: styles$9.hyperlinkWrapper,
|
|
3549
3261
|
placement: "bottom",
|
|
3550
3262
|
maxWidth: "auto"
|
|
3551
3263
|
}, /*#__PURE__*/React.createElement(f36Components.TextLink, {
|
|
@@ -3553,8 +3265,7 @@ function UrlHyperlink(props) {
|
|
|
3553
3265
|
href: uri,
|
|
3554
3266
|
rel: "noopener noreferrer",
|
|
3555
3267
|
onClick: handleClick,
|
|
3556
|
-
|
|
3557
|
-
className: styles$c.hyperlink
|
|
3268
|
+
className: styles$9.hyperlink
|
|
3558
3269
|
}, props.children));
|
|
3559
3270
|
}
|
|
3560
3271
|
|
|
@@ -3680,12 +3391,12 @@ var createHyperlinkPlugin = function createHyperlinkPlugin(sdk) {
|
|
|
3680
3391
|
|
|
3681
3392
|
var _templateObject$4, _templateObject2$3, _templateObject3$3, _styles;
|
|
3682
3393
|
var baseStyle = /*#__PURE__*/emotion.css(_templateObject$4 || (_templateObject$4 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n padding: 0;\n margin: 0 0 1.25rem 1.25rem;\n\n div:first-child {\n margin: 0;\n line-height: ", ";\n }\n"])), tokens.lineHeightDefault);
|
|
3683
|
-
var styles$
|
|
3394
|
+
var styles$a = (_styles = {}, _styles[Contentful.BLOCKS.UL_LIST] = /*#__PURE__*/emotion.css(_templateObject2$3 || (_templateObject2$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n list-style-type: disc;\n ul {\n list-style-type: circle;\n ul {\n list-style-type: square;\n }\n }\n "]))), _styles[Contentful.BLOCKS.OL_LIST] = /*#__PURE__*/emotion.css(_templateObject3$3 || (_templateObject3$3 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n list-style-type: decimal;\n ol {\n list-style-type: upper-alpha;\n ol {\n list-style-type: lower-roman;\n ol {\n list-style-type: lower-alpha;\n }\n }\n }\n "]))), _styles);
|
|
3684
3395
|
|
|
3685
3396
|
function createList(Tag, block) {
|
|
3686
3397
|
return function List(props) {
|
|
3687
3398
|
return /*#__PURE__*/React.createElement(Tag, Object.assign({}, props.attributes, {
|
|
3688
|
-
className: emotion.cx(baseStyle, styles$
|
|
3399
|
+
className: emotion.cx(baseStyle, styles$a[block])
|
|
3689
3400
|
}), props.children);
|
|
3690
3401
|
};
|
|
3691
3402
|
}
|
|
@@ -4666,14 +4377,14 @@ var ToolbarBoldButton = /*#__PURE__*/createMarkToolbarButton({
|
|
|
4666
4377
|
mark: Contentful.MARKS.BOLD,
|
|
4667
4378
|
icon: /*#__PURE__*/React.createElement(f36Icons.FormatBoldIcon, null)
|
|
4668
4379
|
});
|
|
4669
|
-
var styles$
|
|
4380
|
+
var styles$b = {
|
|
4670
4381
|
bold: /*#__PURE__*/emotion.css({
|
|
4671
4382
|
fontWeight: 600
|
|
4672
4383
|
})
|
|
4673
4384
|
};
|
|
4674
4385
|
function Bold(props) {
|
|
4675
4386
|
return /*#__PURE__*/React.createElement("strong", Object.assign({}, props.attributes, {
|
|
4676
|
-
className: styles$
|
|
4387
|
+
className: styles$b.bold
|
|
4677
4388
|
}), props.children);
|
|
4678
4389
|
}
|
|
4679
4390
|
|
|
@@ -4713,7 +4424,7 @@ var ToolbarCodeButton = /*#__PURE__*/createMarkToolbarButton({
|
|
|
4713
4424
|
mark: Contentful.MARKS.CODE,
|
|
4714
4425
|
icon: /*#__PURE__*/React.createElement(f36Icons.CodeIcon, null)
|
|
4715
4426
|
});
|
|
4716
|
-
var styles$
|
|
4427
|
+
var styles$c = {
|
|
4717
4428
|
code: /*#__PURE__*/emotion.css({
|
|
4718
4429
|
fontFamily: 'monospace',
|
|
4719
4430
|
fontSize: '.9em'
|
|
@@ -4721,7 +4432,7 @@ var styles$f = {
|
|
|
4721
4432
|
};
|
|
4722
4433
|
function Code(props) {
|
|
4723
4434
|
return /*#__PURE__*/React.createElement("code", Object.assign({}, props.attributes, {
|
|
4724
|
-
className: styles$
|
|
4435
|
+
className: styles$c.code
|
|
4725
4436
|
}), props.children);
|
|
4726
4437
|
}
|
|
4727
4438
|
var createCodePlugin = function createCodePlugin() {
|
|
@@ -4751,14 +4462,14 @@ var ToolbarItalicButton = /*#__PURE__*/createMarkToolbarButton({
|
|
|
4751
4462
|
mark: Contentful.MARKS.ITALIC,
|
|
4752
4463
|
icon: /*#__PURE__*/React.createElement(f36Icons.FormatItalicIcon, null)
|
|
4753
4464
|
});
|
|
4754
|
-
var styles$
|
|
4465
|
+
var styles$d = {
|
|
4755
4466
|
italic: /*#__PURE__*/emotion.css({
|
|
4756
4467
|
fontStyle: 'italic'
|
|
4757
4468
|
})
|
|
4758
4469
|
};
|
|
4759
4470
|
function Italic(props) {
|
|
4760
4471
|
return /*#__PURE__*/React.createElement("em", Object.assign({}, props.attributes, {
|
|
4761
|
-
className: styles$
|
|
4472
|
+
className: styles$d.italic
|
|
4762
4473
|
}), props.children);
|
|
4763
4474
|
}
|
|
4764
4475
|
var createItalicPlugin = function createItalicPlugin() {
|
|
@@ -5034,10 +4745,10 @@ var createNormalizerPlugin = function createNormalizerPlugin() {
|
|
|
5034
4745
|
};
|
|
5035
4746
|
|
|
5036
4747
|
var _templateObject$6, _styles$1;
|
|
5037
|
-
var styles$
|
|
4748
|
+
var styles$e = (_styles$1 = {}, _styles$1[Contentful.BLOCKS.PARAGRAPH] = /*#__PURE__*/emotion.css(_templateObject$6 || (_templateObject$6 = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n line-height: ", ";\n margin-bottom: 1.5em;\n "])), tokens.lineHeightDefault), _styles$1);
|
|
5038
4749
|
function Paragraph(props) {
|
|
5039
4750
|
return /*#__PURE__*/React.createElement("div", Object.assign({}, props.attributes, {
|
|
5040
|
-
className: styles$
|
|
4751
|
+
className: styles$e[Contentful.BLOCKS.PARAGRAPH]
|
|
5041
4752
|
}), props.children);
|
|
5042
4753
|
}
|
|
5043
4754
|
|
|
@@ -5858,7 +5569,7 @@ var isTable = function isTable(node) {
|
|
|
5858
5569
|
return slate.Element.isElement(node) && node.type === Contentful.BLOCKS.TABLE;
|
|
5859
5570
|
};
|
|
5860
5571
|
|
|
5861
|
-
var styles$
|
|
5572
|
+
var styles$f = {
|
|
5862
5573
|
topRight: /*#__PURE__*/emotion.css({
|
|
5863
5574
|
position: 'absolute',
|
|
5864
5575
|
top: '6px',
|
|
@@ -5947,7 +5658,7 @@ var TableActions = function TableActions() {
|
|
|
5947
5658
|
size: "small",
|
|
5948
5659
|
variant: "transparent",
|
|
5949
5660
|
tabIndex: -1,
|
|
5950
|
-
className: styles$
|
|
5661
|
+
className: styles$f.topRight,
|
|
5951
5662
|
icon: /*#__PURE__*/React__default.createElement(f36Icons.ChevronDownIcon, null),
|
|
5952
5663
|
"aria-label": "Open table menu",
|
|
5953
5664
|
testId: "cf-table-actions-button"
|
|
@@ -6844,7 +6555,7 @@ var normalizeEditorValue = function normalizeEditorValue(value, options) {
|
|
|
6844
6555
|
};
|
|
6845
6556
|
|
|
6846
6557
|
var STYLE_EDITOR_BORDER = "1px solid " + tokens.gray400;
|
|
6847
|
-
var styles$
|
|
6558
|
+
var styles$g = {
|
|
6848
6559
|
root: /*#__PURE__*/emotion.css({
|
|
6849
6560
|
position: 'relative'
|
|
6850
6561
|
}),
|
|
@@ -6889,7 +6600,8 @@ var styles$j = {
|
|
|
6889
6600
|
}
|
|
6890
6601
|
}),
|
|
6891
6602
|
disabled: /*#__PURE__*/emotion.css({
|
|
6892
|
-
background: tokens.gray100
|
|
6603
|
+
background: tokens.gray100,
|
|
6604
|
+
cursor: 'not-allowed'
|
|
6893
6605
|
})
|
|
6894
6606
|
};
|
|
6895
6607
|
|
|
@@ -6939,35 +6651,18 @@ var EmbedEntityWidget = function EmbedEntityWidget(_ref) {
|
|
|
6939
6651
|
// TODO: refine permissions check in order to account for tags in rules and then readd access.can('read', 'Asset')
|
|
6940
6652
|
|
|
6941
6653
|
var blockAssetEmbedEnabled = isNodeTypeEnabled(sdk.field, Contentful.BLOCKS.EMBEDDED_ASSET) && canInsertBlocks;
|
|
6942
|
-
var numEnabledEmbeds = [inlineEntryEmbedEnabled, blockEntryEmbedEnabled, blockAssetEmbedEnabled].filter(Boolean).length;
|
|
6943
|
-
var shouldDisplayDropdown = numEnabledEmbeds > 1 || isDisabled; // Avoids UI glitching when switching back and forth between
|
|
6944
|
-
// different layouts
|
|
6945
|
-
|
|
6946
|
-
React__default.useEffect(function () {
|
|
6947
|
-
if (!shouldDisplayDropdown) {
|
|
6948
|
-
setEmbedDropdownOpen(false);
|
|
6949
|
-
}
|
|
6950
|
-
}, [shouldDisplayDropdown]);
|
|
6951
6654
|
var actions = /*#__PURE__*/React__default.createElement(React__default.Fragment, null, blockEntryEmbedEnabled && /*#__PURE__*/React__default.createElement(EmbeddedEntityBlockToolbarIcon, {
|
|
6952
6655
|
isDisabled: !!isDisabled,
|
|
6953
6656
|
nodeType: Contentful.BLOCKS.EMBEDDED_ENTRY,
|
|
6954
|
-
onClose: onCloseEntityDropdown
|
|
6955
|
-
isButton: !shouldDisplayDropdown
|
|
6657
|
+
onClose: onCloseEntityDropdown
|
|
6956
6658
|
}), inlineEntryEmbedEnabled && /*#__PURE__*/React__default.createElement(ToolbarEmbeddedEntityInlineButton, {
|
|
6957
6659
|
isDisabled: !!isDisabled || isLinkActive(editor),
|
|
6958
|
-
onClose: onCloseEntityDropdown
|
|
6959
|
-
isButton: !shouldDisplayDropdown
|
|
6660
|
+
onClose: onCloseEntityDropdown
|
|
6960
6661
|
}), blockAssetEmbedEnabled && /*#__PURE__*/React__default.createElement(EmbeddedEntityBlockToolbarIcon, {
|
|
6961
6662
|
isDisabled: !!isDisabled,
|
|
6962
6663
|
nodeType: Contentful.BLOCKS.EMBEDDED_ASSET,
|
|
6963
|
-
onClose: onCloseEntityDropdown
|
|
6964
|
-
isButton: !shouldDisplayDropdown
|
|
6664
|
+
onClose: onCloseEntityDropdown
|
|
6965
6665
|
}));
|
|
6966
|
-
|
|
6967
|
-
if (!shouldDisplayDropdown) {
|
|
6968
|
-
return actions;
|
|
6969
|
-
}
|
|
6970
|
-
|
|
6971
6666
|
return /*#__PURE__*/React__default.createElement(EmbeddedEntityDropdownButton, {
|
|
6972
6667
|
isDisabled: isDisabled,
|
|
6973
6668
|
onClose: onCloseEntityDropdown,
|
|
@@ -6976,7 +6671,7 @@ var EmbedEntityWidget = function EmbedEntityWidget(_ref) {
|
|
|
6976
6671
|
}, actions);
|
|
6977
6672
|
};
|
|
6978
6673
|
|
|
6979
|
-
var styles$
|
|
6674
|
+
var styles$h = {
|
|
6980
6675
|
toolbar: /*#__PURE__*/emotion.css({
|
|
6981
6676
|
border: "1px solid " + tokens.gray400,
|
|
6982
6677
|
backgroundColor: tokens.gray100,
|
|
@@ -7021,14 +6716,14 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
7021
6716
|
var shouldDisableTables = isDisabled || !canInsertBlocks || isListSelected || isBlockquoteSelected;
|
|
7022
6717
|
return /*#__PURE__*/React__default.createElement(f36Components.Flex, {
|
|
7023
6718
|
testId: "toolbar",
|
|
7024
|
-
className: styles$
|
|
6719
|
+
className: styles$h.toolbar,
|
|
7025
6720
|
alignItems: "center"
|
|
7026
6721
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
7027
|
-
className: styles$
|
|
6722
|
+
className: styles$h.formattingOptionsWrapper
|
|
7028
6723
|
}, /*#__PURE__*/React__default.createElement(ToolbarHeadingButton, {
|
|
7029
6724
|
isDisabled: isDisabled || !canInsertBlocks
|
|
7030
6725
|
}), validationInfo.isAnyMarkEnabled && /*#__PURE__*/React__default.createElement("span", {
|
|
7031
|
-
className: styles$
|
|
6726
|
+
className: styles$h.divider
|
|
7032
6727
|
}), isMarkEnabled(sdk.field, Contentful.MARKS.BOLD) && /*#__PURE__*/React__default.createElement(ToolbarBoldButton, {
|
|
7033
6728
|
isDisabled: isDisabled
|
|
7034
6729
|
}), isMarkEnabled(sdk.field, Contentful.MARKS.ITALIC) && /*#__PURE__*/React__default.createElement(ToolbarItalicButton, {
|
|
@@ -7038,11 +6733,11 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
7038
6733
|
}), isMarkEnabled(sdk.field, Contentful.MARKS.CODE) && /*#__PURE__*/React__default.createElement(ToolbarCodeButton, {
|
|
7039
6734
|
isDisabled: isDisabled
|
|
7040
6735
|
}), validationInfo.isAnyHyperlinkEnabled && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("span", {
|
|
7041
|
-
className: styles$
|
|
6736
|
+
className: styles$h.divider
|
|
7042
6737
|
}), /*#__PURE__*/React__default.createElement(ToolbarHyperlinkButton, {
|
|
7043
6738
|
isDisabled: isDisabled
|
|
7044
6739
|
})), validationInfo.isAnyBlockFormattingEnabled && /*#__PURE__*/React__default.createElement("span", {
|
|
7045
|
-
className: styles$
|
|
6740
|
+
className: styles$h.divider
|
|
7046
6741
|
}), /*#__PURE__*/React__default.createElement(ToolbarListButton, {
|
|
7047
6742
|
isDisabled: isDisabled || !canInsertBlocks
|
|
7048
6743
|
}), isNodeTypeEnabled(sdk.field, Contentful.BLOCKS.QUOTE) && /*#__PURE__*/React__default.createElement(ToolbarQuoteButton, {
|
|
@@ -7052,7 +6747,7 @@ var Toolbar = function Toolbar(_ref) {
|
|
|
7052
6747
|
}), isNodeTypeEnabled(sdk.field, Contentful.BLOCKS.TABLE) && /*#__PURE__*/React__default.createElement(ToolbarTableButton, {
|
|
7053
6748
|
isDisabled: shouldDisableTables
|
|
7054
6749
|
})), /*#__PURE__*/React__default.createElement("div", {
|
|
7055
|
-
className: styles$
|
|
6750
|
+
className: styles$h.embedActionsWrapper
|
|
7056
6751
|
}, /*#__PURE__*/React__default.createElement(EmbedEntityWidget, {
|
|
7057
6752
|
isDisabled: isDisabled,
|
|
7058
6753
|
canInsertBlocks: canInsertBlocks
|
|
@@ -7077,7 +6772,7 @@ function getValidationInfo(field) {
|
|
|
7077
6772
|
}
|
|
7078
6773
|
|
|
7079
6774
|
var _templateObject$b;
|
|
7080
|
-
var styles$
|
|
6775
|
+
var styles$i = {
|
|
7081
6776
|
nativeSticky: /*#__PURE__*/emotion.css(_templateObject$b || (_templateObject$b = /*#__PURE__*/_taggedTemplateLiteralLoose(["\n position: -webkit-sticky;\n position: sticky;\n top: -1px;\n z-index: 2;\n "])))
|
|
7082
6777
|
};
|
|
7083
6778
|
|
|
@@ -7085,7 +6780,7 @@ var StickyToolbarWrapper = function StickyToolbarWrapper(_ref) {
|
|
|
7085
6780
|
var isDisabled = _ref.isDisabled,
|
|
7086
6781
|
children = _ref.children;
|
|
7087
6782
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
7088
|
-
className: isDisabled ? '' : styles$
|
|
6783
|
+
className: isDisabled ? '' : styles$i.nativeSticky
|
|
7089
6784
|
}, children);
|
|
7090
6785
|
};
|
|
7091
6786
|
|
|
@@ -7180,9 +6875,9 @@ var ConnectedRichTextEditor = function ConnectedRichTextEditor(props) {
|
|
|
7180
6875
|
setPendingExternalUpdate(true);
|
|
7181
6876
|
setEditorContent(editor, documentToEditorValue(props.value));
|
|
7182
6877
|
}, [props.value, id]);
|
|
7183
|
-
var classNames = emotion.cx(styles$
|
|
6878
|
+
var classNames = emotion.cx(styles$g.editor, props.minHeight !== undefined ? emotion.css({
|
|
7184
6879
|
minHeight: props.minHeight
|
|
7185
|
-
}) : undefined, props.isDisabled ? styles$
|
|
6880
|
+
}) : undefined, props.isDisabled ? styles$g.disabled : styles$g.enabled, props.isToolbarHidden && styles$g.hiddenToolbar);
|
|
7186
6881
|
React.useEffect(function () {
|
|
7187
6882
|
if (!isFirstRender) {
|
|
7188
6883
|
return;
|
|
@@ -7198,7 +6893,7 @@ var ConnectedRichTextEditor = function ConnectedRichTextEditor(props) {
|
|
|
7198
6893
|
}, /*#__PURE__*/React__default.createElement(ContentfulEditorIdProvider, {
|
|
7199
6894
|
value: id
|
|
7200
6895
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
7201
|
-
className: styles$
|
|
6896
|
+
className: styles$g.root,
|
|
7202
6897
|
"data-test-id": "rich-text-editor"
|
|
7203
6898
|
}, /*#__PURE__*/React__default.createElement(plateCore.Plate, {
|
|
7204
6899
|
id: id,
|