@contentful/field-editor-markdown 1.5.5 → 1.5.6
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/MarkdownActions.js +6 -4
- package/dist/cjs/MarkdownEditor.js +4 -2
- package/dist/cjs/__fixtures__/FakeSdk.js +3 -3
- package/dist/cjs/__fixtures__/asset/index.js +5 -5
- package/dist/cjs/__fixtures__/entry/index.js +3 -3
- package/dist/cjs/__fixtures__/fixtures.js +3 -1
- package/dist/cjs/components/HeadingSelector.js +3 -1
- package/dist/cjs/components/InsertLinkSelector.js +3 -1
- package/dist/cjs/components/MarkdownBottomBar.js +7 -5
- package/dist/cjs/components/MarkdownConstraints.js +3 -1
- package/dist/cjs/components/MarkdownPreview.js +4 -2
- package/dist/cjs/components/MarkdownTabs.js +3 -1
- package/dist/cjs/components/MarkdownTextarea/CodeMirrorWrapper.js +4 -2
- package/dist/cjs/components/MarkdownTextarea/MarkdownTextarea.js +3 -1
- package/dist/cjs/components/MarkdownTextarea/createMarkdownEditor.js +3 -1
- package/dist/cjs/components/MarkdownToolbar.js +7 -5
- package/dist/cjs/components/icons.js +28 -26
- package/dist/cjs/dialogs/CheatsheetModalDialog.js +3 -1
- package/dist/cjs/dialogs/ConfirmInsertAssetModalDialog.js +5 -3
- package/dist/cjs/dialogs/EmdebExternalContentDialog.js +7 -5
- package/dist/cjs/dialogs/InsertLinkModalDialog.js +4 -2
- package/dist/cjs/dialogs/InsertTableModalDialog.js +4 -2
- package/dist/cjs/dialogs/SpecialCharacterModalDialog.js +4 -2
- package/dist/cjs/dialogs/ZenModeModalDialog.js +3 -1
- package/dist/cjs/dialogs/openMarkdownDialog.js +9 -7
- package/dist/cjs/dialogs/renderMarkdownDialog.js +3 -1
- package/dist/cjs/types.js +7 -7
- package/dist/cjs/utils/insertAssetLinks.js +5 -5
- package/dist/cjs/utils/isValidUrl.js +3 -3
- package/dist/cjs/utils/linkOrganizer.js +8 -8
- package/dist/cjs/utils/linkOrganizer.spec.js +3 -1
- package/dist/esm/MarkdownActions.js +3 -3
- package/dist/esm/MarkdownEditor.js +1 -1
- package/dist/esm/__fixtures__/FakeSdk.js +3 -3
- package/dist/esm/components/MarkdownBottomBar.js +1 -1
- package/dist/esm/components/MarkdownPreview.js +1 -1
- package/dist/esm/components/MarkdownTextarea/CodeMirrorWrapper.js +1 -1
- package/dist/esm/components/MarkdownToolbar.js +1 -1
- package/dist/esm/components/icons.js +10 -10
- package/dist/esm/dialogs/ConfirmInsertAssetModalDialog.js +2 -2
- package/dist/esm/dialogs/EmdebExternalContentDialog.js +4 -4
- package/dist/esm/dialogs/InsertLinkModalDialog.js +1 -1
- package/dist/esm/dialogs/InsertTableModalDialog.js +1 -1
- package/dist/esm/dialogs/SpecialCharacterModalDialog.js +1 -1
- package/dist/esm/dialogs/openMarkdownDialog.js +6 -6
- package/dist/esm/types.js +7 -7
- package/dist/esm/utils/insertAssetLinks.js +2 -2
- package/package.json +4 -4
|
@@ -37,7 +37,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
37
37
|
if (cache && cache.has(obj)) {
|
|
38
38
|
return cache.get(obj);
|
|
39
39
|
}
|
|
40
|
-
var newObj = {
|
|
40
|
+
var newObj = {
|
|
41
|
+
__proto__: null
|
|
42
|
+
};
|
|
41
43
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
42
44
|
for(var key in obj){
|
|
43
45
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -56,10 +58,10 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
56
58
|
return newObj;
|
|
57
59
|
}
|
|
58
60
|
function createMarkdownActions(props) {
|
|
59
|
-
const { sdk
|
|
61
|
+
const { sdk, editor, locale } = props;
|
|
60
62
|
const insertAssetsWithConfirmation = async (assets)=>{
|
|
61
63
|
if (assets) {
|
|
62
|
-
const { links
|
|
64
|
+
const { links, fallbacks } = await (0, _insertAssetLinks.insertAssetLinks)(assets, {
|
|
63
65
|
localeCode: locale,
|
|
64
66
|
defaultLocaleCode: sdk.locales.default,
|
|
65
67
|
fallbackCode: sdk.locales.fallbacks[locale]
|
|
@@ -189,7 +191,7 @@ function createMarkdownActions(props) {
|
|
|
189
191
|
return;
|
|
190
192
|
}
|
|
191
193
|
try {
|
|
192
|
-
const { entity: asset
|
|
194
|
+
const { entity: asset } = await sdk.navigator.openNewAsset({
|
|
193
195
|
slideIn: {
|
|
194
196
|
waitForClose: true
|
|
195
197
|
}
|
|
@@ -54,7 +54,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
54
54
|
if (cache && cache.has(obj)) {
|
|
55
55
|
return cache.get(obj);
|
|
56
56
|
}
|
|
57
|
-
var newObj = {
|
|
57
|
+
var newObj = {
|
|
58
|
+
__proto__: null
|
|
59
|
+
};
|
|
58
60
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
59
61
|
for(var key in obj){
|
|
60
62
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -183,7 +185,7 @@ function MarkdownEditorConnected(props) {
|
|
|
183
185
|
debounce: 300,
|
|
184
186
|
field: props.sdk.field,
|
|
185
187
|
isInitiallyDisabled: props.isInitiallyDisabled
|
|
186
|
-
}, ({ value
|
|
188
|
+
}, ({ value, disabled, setValue, externalReset })=>_react.createElement(MarkdownEditor, {
|
|
187
189
|
...props,
|
|
188
190
|
value: value,
|
|
189
191
|
disabled: disabled,
|
|
@@ -59,7 +59,7 @@ function newReferenceEditorFakeSdk(props) {
|
|
|
59
59
|
locales,
|
|
60
60
|
cmaAdapter: (0, _fieldeditortestutils.createFakeCMAAdapter)({
|
|
61
61
|
Entry: {
|
|
62
|
-
get: async ({ entryId
|
|
62
|
+
get: async ({ entryId })=>{
|
|
63
63
|
if (props?.fetchDelay) {
|
|
64
64
|
await delay(props.fetchDelay);
|
|
65
65
|
}
|
|
@@ -76,7 +76,7 @@ function newReferenceEditorFakeSdk(props) {
|
|
|
76
76
|
}
|
|
77
77
|
},
|
|
78
78
|
Asset: {
|
|
79
|
-
get: async ({ assetId
|
|
79
|
+
get: async ({ assetId })=>{
|
|
80
80
|
if (props?.fetchDelay) {
|
|
81
81
|
await delay(props.fetchDelay);
|
|
82
82
|
}
|
|
@@ -101,7 +101,7 @@ function newReferenceEditorFakeSdk(props) {
|
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
103
|
ContentType: {
|
|
104
|
-
get: async ({ contentTypeId
|
|
104
|
+
get: async ({ contentTypeId })=>{
|
|
105
105
|
if (contentTypeId === _fixtures.contentTypes.published.sys.id) {
|
|
106
106
|
return _fixtures.contentTypes.published;
|
|
107
107
|
}
|
|
@@ -12,17 +12,17 @@ _export(exports, {
|
|
|
12
12
|
changed: function() {
|
|
13
13
|
return _changed_assetjson.default;
|
|
14
14
|
},
|
|
15
|
+
created: function() {
|
|
16
|
+
return _created_assetjson.default;
|
|
17
|
+
},
|
|
15
18
|
empty: function() {
|
|
16
19
|
return _empty_assetjson.default;
|
|
17
20
|
},
|
|
18
|
-
published: function() {
|
|
19
|
-
return _published_assetjson.default;
|
|
20
|
-
},
|
|
21
21
|
invalid: function() {
|
|
22
22
|
return _invalid_assetjson.default;
|
|
23
23
|
},
|
|
24
|
-
|
|
25
|
-
return
|
|
24
|
+
published: function() {
|
|
25
|
+
return _published_assetjson.default;
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
const _changed_assetjson = _interop_require_default(require("./changed_asset.json"));
|
|
@@ -15,11 +15,11 @@ _export(exports, {
|
|
|
15
15
|
empty: function() {
|
|
16
16
|
return _empty_entryjson.default;
|
|
17
17
|
},
|
|
18
|
-
published: function() {
|
|
19
|
-
return _published_entryjson.default;
|
|
20
|
-
},
|
|
21
18
|
invalid: function() {
|
|
22
19
|
return _invalid_entryjson.default;
|
|
20
|
+
},
|
|
21
|
+
published: function() {
|
|
22
|
+
return _published_entryjson.default;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
const _changed_entryjson = _interop_require_default(require("./changed_entry.json"));
|
|
@@ -51,7 +51,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
51
51
|
if (cache && cache.has(obj)) {
|
|
52
52
|
return cache.get(obj);
|
|
53
53
|
}
|
|
54
|
-
var newObj = {
|
|
54
|
+
var newObj = {
|
|
55
|
+
__proto__: null
|
|
56
|
+
};
|
|
55
57
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
56
58
|
for(var key in obj){
|
|
57
59
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -31,7 +31,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
31
31
|
if (cache && cache.has(obj)) {
|
|
32
32
|
return cache.get(obj);
|
|
33
33
|
}
|
|
34
|
-
var newObj = {
|
|
34
|
+
var newObj = {
|
|
35
|
+
__proto__: null
|
|
36
|
+
};
|
|
35
37
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
36
38
|
for(var key in obj){
|
|
37
39
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -32,7 +32,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
32
32
|
if (cache && cache.has(obj)) {
|
|
33
33
|
return cache.get(obj);
|
|
34
34
|
}
|
|
35
|
-
var newObj = {
|
|
35
|
+
var newObj = {
|
|
36
|
+
__proto__: null
|
|
37
|
+
};
|
|
36
38
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
37
39
|
for(var key in obj){
|
|
38
40
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -9,14 +9,14 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
+
MarkdownBottomBar: function() {
|
|
13
|
+
return MarkdownBottomBar;
|
|
14
|
+
},
|
|
12
15
|
MarkdownCounter: function() {
|
|
13
16
|
return MarkdownCounter;
|
|
14
17
|
},
|
|
15
18
|
MarkdownHelp: function() {
|
|
16
19
|
return MarkdownHelp;
|
|
17
|
-
},
|
|
18
|
-
MarkdownBottomBar: function() {
|
|
19
|
-
return MarkdownBottomBar;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
const _react = _interop_require_wildcard(require("react"));
|
|
@@ -49,7 +49,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
49
49
|
if (cache && cache.has(obj)) {
|
|
50
50
|
return cache.get(obj);
|
|
51
51
|
}
|
|
52
|
-
var newObj = {
|
|
52
|
+
var newObj = {
|
|
53
|
+
__proto__: null
|
|
54
|
+
};
|
|
53
55
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
54
56
|
for(var key in obj){
|
|
55
57
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -101,7 +103,7 @@ function SanitizeMessage() {
|
|
|
101
103
|
href: SANITIZE_LINK
|
|
102
104
|
}, "Learn more."));
|
|
103
105
|
}
|
|
104
|
-
function CheatSheetMessage({ onClick
|
|
106
|
+
function CheatSheetMessage({ onClick }) {
|
|
105
107
|
return _react.createElement("span", null, "Format your text like a pro with the", ' ', _react.createElement(_f36components.TextLink, {
|
|
106
108
|
as: "button",
|
|
107
109
|
testId: "open-markdown-cheatsheet-button",
|
|
@@ -38,7 +38,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
38
38
|
if (cache && cache.has(obj)) {
|
|
39
39
|
return cache.get(obj);
|
|
40
40
|
}
|
|
41
|
-
var newObj = {
|
|
41
|
+
var newObj = {
|
|
42
|
+
__proto__: null
|
|
43
|
+
};
|
|
42
44
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
43
45
|
for(var key in obj){
|
|
44
46
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -42,7 +42,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
42
42
|
if (cache && cache.has(obj)) {
|
|
43
43
|
return cache.get(obj);
|
|
44
44
|
}
|
|
45
|
-
var newObj = {
|
|
45
|
+
var newObj = {
|
|
46
|
+
__proto__: null
|
|
47
|
+
};
|
|
46
48
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
47
49
|
for(var key in obj){
|
|
48
50
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -211,7 +213,7 @@ const styles = {
|
|
|
211
213
|
})
|
|
212
214
|
};
|
|
213
215
|
function MarkdownLink(props) {
|
|
214
|
-
const { Embedly
|
|
216
|
+
const { Embedly, children, ...rest } = props;
|
|
215
217
|
if (props.className === 'embedly-card' && Embedly) {
|
|
216
218
|
return _react.createElement(Embedly, {
|
|
217
219
|
url: props.href ?? ''
|
|
@@ -37,7 +37,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
37
37
|
if (cache && cache.has(obj)) {
|
|
38
38
|
return cache.get(obj);
|
|
39
39
|
}
|
|
40
|
-
var newObj = {
|
|
40
|
+
var newObj = {
|
|
41
|
+
__proto__: null
|
|
42
|
+
};
|
|
41
43
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
42
44
|
for(var key in obj){
|
|
43
45
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -39,7 +39,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
39
39
|
if (cache && cache.has(obj)) {
|
|
40
40
|
return cache.get(obj);
|
|
41
41
|
}
|
|
42
|
-
var newObj = {
|
|
42
|
+
var newObj = {
|
|
43
|
+
__proto__: null
|
|
44
|
+
};
|
|
43
45
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
44
46
|
for(var key in obj){
|
|
45
47
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -67,7 +69,7 @@ function stripUnit(value) {
|
|
|
67
69
|
return parseFloat(value);
|
|
68
70
|
}
|
|
69
71
|
function create(host, options) {
|
|
70
|
-
const { direction
|
|
72
|
+
const { direction, fixedHeight, height, readOnly } = options || {};
|
|
71
73
|
let initializedWithValue = false;
|
|
72
74
|
const LF = '\n';
|
|
73
75
|
const EDITOR_SIZE = {
|
|
@@ -38,7 +38,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
38
38
|
if (cache && cache.has(obj)) {
|
|
39
39
|
return cache.get(obj);
|
|
40
40
|
}
|
|
41
|
-
var newObj = {
|
|
41
|
+
var newObj = {
|
|
42
|
+
__proto__: null
|
|
43
|
+
};
|
|
42
44
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
43
45
|
for(var key in obj){
|
|
44
46
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -31,7 +31,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
31
31
|
if (cache && cache.has(obj)) {
|
|
32
32
|
return cache.get(obj);
|
|
33
33
|
}
|
|
34
|
-
var newObj = {
|
|
34
|
+
var newObj = {
|
|
35
|
+
__proto__: null
|
|
36
|
+
};
|
|
35
37
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
36
38
|
for(var key in obj){
|
|
37
39
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -12,11 +12,11 @@ _export(exports, {
|
|
|
12
12
|
DefaultMarkdownToolbar: function() {
|
|
13
13
|
return DefaultMarkdownToolbar;
|
|
14
14
|
},
|
|
15
|
-
ZenMarkdownToolbar: function() {
|
|
16
|
-
return ZenMarkdownToolbar;
|
|
17
|
-
},
|
|
18
15
|
MarkdownToolbar: function() {
|
|
19
16
|
return MarkdownToolbar;
|
|
17
|
+
},
|
|
18
|
+
ZenMarkdownToolbar: function() {
|
|
19
|
+
return ZenMarkdownToolbar;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
const _react = _interop_require_wildcard(require("react"));
|
|
@@ -53,7 +53,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
53
53
|
if (cache && cache.has(obj)) {
|
|
54
54
|
return cache.get(obj);
|
|
55
55
|
}
|
|
56
|
-
var newObj = {
|
|
56
|
+
var newObj = {
|
|
57
|
+
__proto__: null
|
|
58
|
+
};
|
|
57
59
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
58
60
|
for(var key in obj){
|
|
59
61
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -102,7 +104,7 @@ const styles = {
|
|
|
102
104
|
})
|
|
103
105
|
};
|
|
104
106
|
const ToolbarButton = _react.forwardRef((props, ref)=>{
|
|
105
|
-
const { tooltip
|
|
107
|
+
const { tooltip, onClick, children, className, variant = 'transparent', tooltipPlace = 'top', isDisabled = false, ...otherProps } = props;
|
|
106
108
|
return _react.createElement(_f36components.Tooltip, {
|
|
107
109
|
className: styles.tooltip,
|
|
108
110
|
usePortal: true,
|
|
@@ -9,35 +9,35 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
|
|
13
|
-
return
|
|
12
|
+
Cubes: function() {
|
|
13
|
+
return Cubes;
|
|
14
14
|
},
|
|
15
|
-
|
|
16
|
-
return
|
|
15
|
+
Dedent: function() {
|
|
16
|
+
return Dedent;
|
|
17
17
|
},
|
|
18
18
|
Indent: function() {
|
|
19
19
|
return Indent;
|
|
20
20
|
},
|
|
21
|
-
|
|
22
|
-
return
|
|
23
|
-
},
|
|
24
|
-
Cubes: function() {
|
|
25
|
-
return Cubes;
|
|
21
|
+
OrgLinks: function() {
|
|
22
|
+
return OrgLinks;
|
|
26
23
|
},
|
|
27
|
-
|
|
28
|
-
return
|
|
24
|
+
Redo: function() {
|
|
25
|
+
return Redo;
|
|
29
26
|
},
|
|
30
27
|
SpecialChar: function() {
|
|
31
28
|
return SpecialChar;
|
|
32
29
|
},
|
|
33
|
-
|
|
34
|
-
return
|
|
30
|
+
Strikethrough: function() {
|
|
31
|
+
return Strikethrough;
|
|
32
|
+
},
|
|
33
|
+
Table: function() {
|
|
34
|
+
return Table;
|
|
35
35
|
},
|
|
36
36
|
Undo: function() {
|
|
37
37
|
return Undo;
|
|
38
38
|
},
|
|
39
|
-
|
|
40
|
-
return
|
|
39
|
+
Zen: function() {
|
|
40
|
+
return Zen;
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
const _react = _interop_require_wildcard(require("react"));
|
|
@@ -63,7 +63,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
63
63
|
if (cache && cache.has(obj)) {
|
|
64
64
|
return cache.get(obj);
|
|
65
65
|
}
|
|
66
|
-
var newObj = {
|
|
66
|
+
var newObj = {
|
|
67
|
+
__proto__: null
|
|
68
|
+
};
|
|
67
69
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
68
70
|
for(var key in obj){
|
|
69
71
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -91,7 +93,7 @@ const srOnly = (0, _emotion.css)({
|
|
|
91
93
|
clip: 'rect(0, 0, 0, 0)',
|
|
92
94
|
border: '0'
|
|
93
95
|
});
|
|
94
|
-
const Zen = ({ label
|
|
96
|
+
const Zen = ({ label, ...rest })=>_react.createElement("svg", {
|
|
95
97
|
width: 14,
|
|
96
98
|
height: 14,
|
|
97
99
|
viewBox: "0 0 1792 1792",
|
|
@@ -101,7 +103,7 @@ const Zen = ({ label , ...rest })=>_react.createElement("svg", {
|
|
|
101
103
|
}), _react.createElement("span", {
|
|
102
104
|
className: srOnly
|
|
103
105
|
}, label));
|
|
104
|
-
const Strikethrough = ({ label
|
|
106
|
+
const Strikethrough = ({ label, ...rest })=>_react.createElement("svg", {
|
|
105
107
|
width: 14,
|
|
106
108
|
height: 14,
|
|
107
109
|
viewBox: "0 0 1792 1792",
|
|
@@ -111,7 +113,7 @@ const Strikethrough = ({ label , ...rest })=>_react.createElement("svg", {
|
|
|
111
113
|
}), _react.createElement("span", {
|
|
112
114
|
className: srOnly
|
|
113
115
|
}, label));
|
|
114
|
-
const Indent = ({ label
|
|
116
|
+
const Indent = ({ label, ...rest })=>_react.createElement("svg", {
|
|
115
117
|
width: 14,
|
|
116
118
|
height: 14,
|
|
117
119
|
viewBox: "0 0 1792 1792",
|
|
@@ -121,7 +123,7 @@ const Indent = ({ label , ...rest })=>_react.createElement("svg", {
|
|
|
121
123
|
}), _react.createElement("span", {
|
|
122
124
|
className: srOnly
|
|
123
125
|
}, label));
|
|
124
|
-
const Dedent = ({ label
|
|
126
|
+
const Dedent = ({ label, ...rest })=>_react.createElement("svg", {
|
|
125
127
|
width: 14,
|
|
126
128
|
height: 14,
|
|
127
129
|
viewBox: "0 0 1792 1792",
|
|
@@ -131,7 +133,7 @@ const Dedent = ({ label , ...rest })=>_react.createElement("svg", {
|
|
|
131
133
|
}), _react.createElement("span", {
|
|
132
134
|
className: srOnly
|
|
133
135
|
}, label));
|
|
134
|
-
const Cubes = ({ label
|
|
136
|
+
const Cubes = ({ label, ...rest })=>_react.createElement("svg", {
|
|
135
137
|
width: 18,
|
|
136
138
|
height: 14,
|
|
137
139
|
viewBox: "0 0 2304 1792",
|
|
@@ -141,7 +143,7 @@ const Cubes = ({ label , ...rest })=>_react.createElement("svg", {
|
|
|
141
143
|
}), _react.createElement("span", {
|
|
142
144
|
className: srOnly
|
|
143
145
|
}, label));
|
|
144
|
-
const Table = ({ label
|
|
146
|
+
const Table = ({ label, ...rest })=>_react.createElement("svg", {
|
|
145
147
|
width: 14,
|
|
146
148
|
height: 14,
|
|
147
149
|
viewBox: "0 0 1792 1792",
|
|
@@ -151,7 +153,7 @@ const Table = ({ label , ...rest })=>_react.createElement("svg", {
|
|
|
151
153
|
}), _react.createElement("span", {
|
|
152
154
|
className: srOnly
|
|
153
155
|
}, label));
|
|
154
|
-
const SpecialChar = ({ label
|
|
156
|
+
const SpecialChar = ({ label, ...rest })=>_react.createElement("svg", {
|
|
155
157
|
width: 14,
|
|
156
158
|
height: 14,
|
|
157
159
|
viewBox: "0 0 1792 1792",
|
|
@@ -161,7 +163,7 @@ const SpecialChar = ({ label , ...rest })=>_react.createElement("svg", {
|
|
|
161
163
|
}), _react.createElement("span", {
|
|
162
164
|
className: srOnly
|
|
163
165
|
}, label));
|
|
164
|
-
const OrgLinks = ({ label
|
|
166
|
+
const OrgLinks = ({ label, ...rest })=>_react.createElement("svg", {
|
|
165
167
|
width: 14,
|
|
166
168
|
height: 14,
|
|
167
169
|
viewBox: "0 0 1792 1792",
|
|
@@ -171,7 +173,7 @@ const OrgLinks = ({ label , ...rest })=>_react.createElement("svg", {
|
|
|
171
173
|
}), _react.createElement("span", {
|
|
172
174
|
className: srOnly
|
|
173
175
|
}, label));
|
|
174
|
-
const Undo = ({ label
|
|
176
|
+
const Undo = ({ label, ...rest })=>_react.createElement("svg", {
|
|
175
177
|
width: 14,
|
|
176
178
|
height: 14,
|
|
177
179
|
viewBox: "0 0 1792 1792",
|
|
@@ -181,7 +183,7 @@ const Undo = ({ label , ...rest })=>_react.createElement("svg", {
|
|
|
181
183
|
}), _react.createElement("span", {
|
|
182
184
|
className: srOnly
|
|
183
185
|
}, label));
|
|
184
|
-
const Redo = ({ label
|
|
186
|
+
const Redo = ({ label, ...rest })=>_react.createElement("svg", {
|
|
185
187
|
width: 14,
|
|
186
188
|
height: 14,
|
|
187
189
|
viewBox: "0 0 1792 1792",
|
|
@@ -47,7 +47,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
47
47
|
if (cache && cache.has(obj)) {
|
|
48
48
|
return cache.get(obj);
|
|
49
49
|
}
|
|
50
|
-
var newObj = {
|
|
50
|
+
var newObj = {
|
|
51
|
+
__proto__: null
|
|
52
|
+
};
|
|
51
53
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
52
54
|
for(var key in obj){
|
|
53
55
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -40,7 +40,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
40
40
|
if (cache && cache.has(obj)) {
|
|
41
41
|
return cache.get(obj);
|
|
42
42
|
}
|
|
43
|
-
var newObj = {
|
|
43
|
+
var newObj = {
|
|
44
|
+
__proto__: null
|
|
45
|
+
};
|
|
44
46
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
45
47
|
for(var key in obj){
|
|
46
48
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -58,11 +60,11 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
58
60
|
}
|
|
59
61
|
return newObj;
|
|
60
62
|
}
|
|
61
|
-
const ConfirmInsertAssetModalDialog = ({ onClose
|
|
63
|
+
const ConfirmInsertAssetModalDialog = ({ onClose, assets, locale })=>{
|
|
62
64
|
const localesNumber = assets.length;
|
|
63
65
|
return _react.createElement(_react.Fragment, null, _react.createElement(_f36components.ModalContent, {
|
|
64
66
|
testId: "confirm-insert-asset"
|
|
65
|
-
}, _react.createElement(_f36components.Paragraph, null, localesNumber === 1 ? `Link asset with missing file for locale ${locale}` : `Link assets with missing files for locale ${locale}`), _react.createElement(_f36components.Paragraph, null, localesNumber === 1 ? 'Do you want to link to the file in its fallback locale?' : 'Do you want to link to the files in their fallback locales?'), _react.createElement(_f36components.EntityList, null, assets.map(({ title
|
|
67
|
+
}, _react.createElement(_f36components.Paragraph, null, localesNumber === 1 ? `Link asset with missing file for locale ${locale}` : `Link assets with missing files for locale ${locale}`), _react.createElement(_f36components.Paragraph, null, localesNumber === 1 ? 'Do you want to link to the file in its fallback locale?' : 'Do you want to link to the files in their fallback locales?'), _react.createElement(_f36components.EntityList, null, assets.map(({ title, description, thumbnailUrl, thumbnailAltText })=>_react.createElement(_f36components.EntityList.Item, {
|
|
66
68
|
key: thumbnailUrl,
|
|
67
69
|
title: title,
|
|
68
70
|
thumbnailUrl: `${thumbnailUrl}?w=46&h=46&fit=thumb`,
|
|
@@ -48,7 +48,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
48
48
|
if (cache && cache.has(obj)) {
|
|
49
49
|
return cache.get(obj);
|
|
50
50
|
}
|
|
51
|
-
var newObj = {
|
|
51
|
+
var newObj = {
|
|
52
|
+
__proto__: null
|
|
53
|
+
};
|
|
52
54
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
53
55
|
for(var key in obj){
|
|
54
56
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -81,7 +83,7 @@ const styles = {
|
|
|
81
83
|
marginLeft: _f36tokens.default.spacingM
|
|
82
84
|
})
|
|
83
85
|
};
|
|
84
|
-
const makeEmbedlyLink = ({ url
|
|
86
|
+
const makeEmbedlyLink = ({ url, width, selectedUnit, attachSocial })=>{
|
|
85
87
|
const s = {
|
|
86
88
|
percent: '%',
|
|
87
89
|
px: 'px'
|
|
@@ -94,7 +96,7 @@ const makeEmbedlyLink = ({ url , width , selectedUnit , attachSocial })=>{
|
|
|
94
96
|
].join('');
|
|
95
97
|
};
|
|
96
98
|
const isWidthValid = (width, unit)=>unit === 'percent' ? width <= 100 : true;
|
|
97
|
-
const EmbedExternalContentModal = ({ onClose
|
|
99
|
+
const EmbedExternalContentModal = ({ onClose })=>{
|
|
98
100
|
const mainInputRef = (0, _react.useRef)(null);
|
|
99
101
|
const [url, setUrl] = (0, _react.useState)('https://');
|
|
100
102
|
const [selectedUnit, setUnit] = (0, _react.useState)('percent');
|
|
@@ -167,11 +169,11 @@ const EmbedExternalContentModal = ({ onClose })=>{
|
|
|
167
169
|
as: "p",
|
|
168
170
|
fontColor: "gray500",
|
|
169
171
|
marginTop: "spacingXs"
|
|
170
|
-
}, "To enable this embedded content in your application make sure to add the
|
|
172
|
+
}, "To enable this embedded content in your application make sure to add the ", _react.default.createElement(_f36components.TextLink, {
|
|
171
173
|
href: "http://embed.ly/docs/products/cards",
|
|
172
174
|
target: "_blank",
|
|
173
175
|
rel: "noopener noreferrer"
|
|
174
|
-
}, "Embedly's platform.js"), "
|
|
176
|
+
}, "Embedly's platform.js"), " on your development environment"))), _react.default.createElement(_f36components.ModalControls, null, _react.default.createElement(_f36components.Button, {
|
|
175
177
|
testId: "emded-external-cancel",
|
|
176
178
|
onClick: ()=>onClose(false),
|
|
177
179
|
variant: "secondary",
|
|
@@ -41,7 +41,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
41
41
|
if (cache && cache.has(obj)) {
|
|
42
42
|
return cache.get(obj);
|
|
43
43
|
}
|
|
44
|
-
var newObj = {
|
|
44
|
+
var newObj = {
|
|
45
|
+
__proto__: null
|
|
46
|
+
};
|
|
45
47
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
46
48
|
for(var key in obj){
|
|
47
49
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -59,7 +61,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
59
61
|
}
|
|
60
62
|
return newObj;
|
|
61
63
|
}
|
|
62
|
-
const InsertLinkModal = ({ selectedText
|
|
64
|
+
const InsertLinkModal = ({ selectedText, onClose })=>{
|
|
63
65
|
const mainInputRef = (0, _react.useRef)(null);
|
|
64
66
|
const [text, setText] = (0, _react.useState)(selectedText || '');
|
|
65
67
|
const [url, setUrl] = (0, _react.useState)('');
|
|
@@ -46,7 +46,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
46
46
|
if (cache && cache.has(obj)) {
|
|
47
47
|
return cache.get(obj);
|
|
48
48
|
}
|
|
49
|
-
var newObj = {
|
|
49
|
+
var newObj = {
|
|
50
|
+
__proto__: null
|
|
51
|
+
};
|
|
50
52
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
51
53
|
for(var key in obj){
|
|
52
54
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -64,7 +66,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
64
66
|
}
|
|
65
67
|
return newObj;
|
|
66
68
|
}
|
|
67
|
-
const InsertTableModal = ({ onClose
|
|
69
|
+
const InsertTableModal = ({ onClose })=>{
|
|
68
70
|
const mainInputRef = (0, _react.useRef)(null);
|
|
69
71
|
const [rows, setRows] = (0, _react.useState)(2);
|
|
70
72
|
const [cols, setColumns] = (0, _react.useState)(1);
|
|
@@ -48,7 +48,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
48
48
|
if (cache && cache.has(obj)) {
|
|
49
49
|
return cache.get(obj);
|
|
50
50
|
}
|
|
51
|
-
var newObj = {
|
|
51
|
+
var newObj = {
|
|
52
|
+
__proto__: null
|
|
53
|
+
};
|
|
52
54
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
53
55
|
for(var key in obj){
|
|
54
56
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -90,7 +92,7 @@ const styles = {
|
|
|
90
92
|
marginRight: _f36tokens.default.spacingS
|
|
91
93
|
})
|
|
92
94
|
};
|
|
93
|
-
const SpecialCharacterModalDialog = ({ onClose
|
|
95
|
+
const SpecialCharacterModalDialog = ({ onClose })=>{
|
|
94
96
|
const [selectedCharacter, setSelectedCharacter] = (0, _react.useState)(_specialCharacters.specialCharacters[0]);
|
|
95
97
|
return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_f36components.ModalContent, {
|
|
96
98
|
testId: "insert-special-character-modal"
|
|
@@ -54,7 +54,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
54
54
|
if (cache && cache.has(obj)) {
|
|
55
55
|
return cache.get(obj);
|
|
56
56
|
}
|
|
57
|
-
var newObj = {
|
|
57
|
+
var newObj = {
|
|
58
|
+
__proto__: null
|
|
59
|
+
};
|
|
58
60
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
59
61
|
for(var key in obj){
|
|
60
62
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -39,7 +39,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
39
39
|
if (cache && cache.has(obj)) {
|
|
40
40
|
return cache.get(obj);
|
|
41
41
|
}
|
|
42
|
-
var newObj = {
|
|
42
|
+
var newObj = {
|
|
43
|
+
__proto__: null
|
|
44
|
+
};
|
|
43
45
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
44
46
|
for(var key in obj){
|
|
45
47
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -64,26 +66,26 @@ const openMarkdownDialog = (sdk, previewComponents)=>(options)=>{
|
|
|
64
66
|
});
|
|
65
67
|
} else if (options.parameters?.type === _types.MarkdownDialogType.insertLink) {
|
|
66
68
|
const selectedText = options.parameters.selectedText;
|
|
67
|
-
return _fieldeditorshared.ModalDialogLauncher.openDialog(options, ({ onClose
|
|
69
|
+
return _fieldeditorshared.ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
68
70
|
return _react.createElement(_InsertLinkModalDialog.InsertLinkModal, {
|
|
69
71
|
selectedText: selectedText,
|
|
70
72
|
onClose: onClose
|
|
71
73
|
});
|
|
72
74
|
});
|
|
73
75
|
} else if (options.parameters?.type === _types.MarkdownDialogType.insertSpecialCharacter) {
|
|
74
|
-
return _fieldeditorshared.ModalDialogLauncher.openDialog(options, ({ onClose
|
|
76
|
+
return _fieldeditorshared.ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
75
77
|
return _react.createElement(_SpecialCharacterModalDialog.SpecialCharacterModalDialog, {
|
|
76
78
|
onClose: onClose
|
|
77
79
|
});
|
|
78
80
|
});
|
|
79
81
|
} else if (options.parameters?.type === _types.MarkdownDialogType.insertTable) {
|
|
80
|
-
return _fieldeditorshared.ModalDialogLauncher.openDialog(options, ({ onClose
|
|
82
|
+
return _fieldeditorshared.ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
81
83
|
return _react.createElement(_InsertTableModalDialog.InsertTableModal, {
|
|
82
84
|
onClose: onClose
|
|
83
85
|
});
|
|
84
86
|
});
|
|
85
87
|
} else if (options.parameters?.type === _types.MarkdownDialogType.embedExternalContent) {
|
|
86
|
-
return _fieldeditorshared.ModalDialogLauncher.openDialog(options, ({ onClose
|
|
88
|
+
return _fieldeditorshared.ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
87
89
|
return _react.createElement(_EmdebExternalContentDialog.EmbedExternalContentModal, {
|
|
88
90
|
onClose: onClose
|
|
89
91
|
});
|
|
@@ -91,7 +93,7 @@ const openMarkdownDialog = (sdk, previewComponents)=>(options)=>{
|
|
|
91
93
|
} else if (options.parameters?.type === _types.MarkdownDialogType.confirmInsertAsset) {
|
|
92
94
|
const locale = options.parameters.locale;
|
|
93
95
|
const assets = options.parameters.assets;
|
|
94
|
-
return _fieldeditorshared.ModalDialogLauncher.openDialog(options, ({ onClose
|
|
96
|
+
return _fieldeditorshared.ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
95
97
|
return _react.createElement(_ConfirmInsertAssetModalDialog.ConfirmInsertAssetModalDialog, {
|
|
96
98
|
onClose: onClose,
|
|
97
99
|
locale: locale,
|
|
@@ -101,7 +103,7 @@ const openMarkdownDialog = (sdk, previewComponents)=>(options)=>{
|
|
|
101
103
|
} else if (options.parameters?.type === _types.MarkdownDialogType.zenMode) {
|
|
102
104
|
const initialValue = options.parameters.initialValue;
|
|
103
105
|
const locale = options.parameters.locale;
|
|
104
|
-
return _fieldeditorshared.ModalDialogLauncher.openDialog(options, ({ onClose
|
|
106
|
+
return _fieldeditorshared.ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
105
107
|
return _react.createElement(_ZenModeModalDialog.ZenModeModalDialog, {
|
|
106
108
|
saveValueToSDK: (value)=>{
|
|
107
109
|
if (value) {
|
|
@@ -38,7 +38,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
38
38
|
if (cache && cache.has(obj)) {
|
|
39
39
|
return cache.get(obj);
|
|
40
40
|
}
|
|
41
|
-
var newObj = {
|
|
41
|
+
var newObj = {
|
|
42
|
+
__proto__: null
|
|
43
|
+
};
|
|
42
44
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
43
45
|
for(var key in obj){
|
|
44
46
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
package/dist/cjs/types.js
CHANGED
|
@@ -10,11 +10,11 @@ Object.defineProperty(exports, "MarkdownDialogType", {
|
|
|
10
10
|
});
|
|
11
11
|
var MarkdownDialogType;
|
|
12
12
|
(function(MarkdownDialogType) {
|
|
13
|
-
MarkdownDialogType["cheatsheet"] =
|
|
14
|
-
MarkdownDialogType["insertLink"] =
|
|
15
|
-
MarkdownDialogType["insertSpecialCharacter"] =
|
|
16
|
-
MarkdownDialogType["insertTable"] =
|
|
17
|
-
MarkdownDialogType["embedExternalContent"] =
|
|
18
|
-
MarkdownDialogType["confirmInsertAsset"] =
|
|
19
|
-
MarkdownDialogType["zenMode"] =
|
|
13
|
+
MarkdownDialogType["cheatsheet"] = "markdown-cheatsheet";
|
|
14
|
+
MarkdownDialogType["insertLink"] = "markdown-insertLink";
|
|
15
|
+
MarkdownDialogType["insertSpecialCharacter"] = "markdown-insertSpecialCharacter";
|
|
16
|
+
MarkdownDialogType["insertTable"] = "markdown-insertTable";
|
|
17
|
+
MarkdownDialogType["embedExternalContent"] = "markdown-embedExternalContent";
|
|
18
|
+
MarkdownDialogType["confirmInsertAsset"] = "markdown-confirmInsertAsset";
|
|
19
|
+
MarkdownDialogType["zenMode"] = "markdown-zenMode";
|
|
20
20
|
})(MarkdownDialogType || (MarkdownDialogType = {}));
|
|
@@ -9,11 +9,11 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
replaceAssetDomain: function() {
|
|
13
|
-
return replaceAssetDomain;
|
|
14
|
-
},
|
|
15
12
|
insertAssetLinks: function() {
|
|
16
13
|
return insertAssetLinks;
|
|
14
|
+
},
|
|
15
|
+
replaceAssetDomain: function() {
|
|
16
|
+
return replaceAssetDomain;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
const _get = _interop_require_default(require("lodash/get"));
|
|
@@ -47,7 +47,7 @@ function replaceAssetDomain(fileUrl) {
|
|
|
47
47
|
return assetDomainMap[p1];
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
function makeAssetLink(asset, { localeCode
|
|
50
|
+
function makeAssetLink(asset, { localeCode, fallbackCode, defaultLocaleCode }) {
|
|
51
51
|
const localizedFile = (0, _get.default)(asset, [
|
|
52
52
|
'fields',
|
|
53
53
|
'file',
|
|
@@ -101,7 +101,7 @@ async function insertAssetLinks(assets, locales) {
|
|
|
101
101
|
});
|
|
102
102
|
const linksWithMeta = assets.map((asset)=>makeAssetLink(asset, locales)).filter((asset)=>asset !== null);
|
|
103
103
|
if (otherLocales.length > 0) {
|
|
104
|
-
const fallbackAssets = linksWithMeta.filter(({ isLocalized
|
|
104
|
+
const fallbackAssets = linksWithMeta.filter(({ isLocalized })=>!isLocalized).map(({ title, isFallback, asset })=>{
|
|
105
105
|
const code = isFallback ? locales.fallbackCode : locales.defaultLocaleCode;
|
|
106
106
|
return {
|
|
107
107
|
title,
|
|
@@ -9,11 +9,11 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
urlRegex: function() {
|
|
13
|
-
return urlRegex;
|
|
14
|
-
},
|
|
15
12
|
isValidUrl: function() {
|
|
16
13
|
return isValidUrl;
|
|
14
|
+
},
|
|
15
|
+
urlRegex: function() {
|
|
16
|
+
return urlRegex;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
const urlRegex = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-/]))?$/;
|
|
@@ -9,23 +9,23 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
+
convertInlineToRef: function() {
|
|
13
|
+
return convertInlineToRef;
|
|
14
|
+
},
|
|
12
15
|
findInline: function() {
|
|
13
16
|
return findInline;
|
|
14
17
|
},
|
|
15
|
-
findRefs: function() {
|
|
16
|
-
return findRefs;
|
|
17
|
-
},
|
|
18
18
|
findLabels: function() {
|
|
19
19
|
return findLabels;
|
|
20
20
|
},
|
|
21
|
-
|
|
22
|
-
return
|
|
21
|
+
findMaxLabelId: function() {
|
|
22
|
+
return findMaxLabelId;
|
|
23
|
+
},
|
|
24
|
+
findRefs: function() {
|
|
25
|
+
return findRefs;
|
|
23
26
|
},
|
|
24
27
|
rewriteRefs: function() {
|
|
25
28
|
return rewriteRefs;
|
|
26
|
-
},
|
|
27
|
-
findMaxLabelId: function() {
|
|
28
|
-
return findMaxLabelId;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
const _extend = _interop_require_default(require("lodash/extend"));
|
|
@@ -24,7 +24,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
24
24
|
if (cache && cache.has(obj)) {
|
|
25
25
|
return cache.get(obj);
|
|
26
26
|
}
|
|
27
|
-
var newObj = {
|
|
27
|
+
var newObj = {
|
|
28
|
+
__proto__: null
|
|
29
|
+
};
|
|
28
30
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
29
31
|
for(var key in obj){
|
|
30
32
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -7,10 +7,10 @@ import { openZenMode } from './dialogs/ZenModeModalDialog';
|
|
|
7
7
|
import { insertAssetLinks } from './utils/insertAssetLinks';
|
|
8
8
|
import * as LinkOrganizer from './utils/linkOrganizer';
|
|
9
9
|
export function createMarkdownActions(props) {
|
|
10
|
-
const { sdk
|
|
10
|
+
const { sdk, editor, locale } = props;
|
|
11
11
|
const insertAssetsWithConfirmation = async (assets)=>{
|
|
12
12
|
if (assets) {
|
|
13
|
-
const { links
|
|
13
|
+
const { links, fallbacks } = await insertAssetLinks(assets, {
|
|
14
14
|
localeCode: locale,
|
|
15
15
|
defaultLocaleCode: sdk.locales.default,
|
|
16
16
|
fallbackCode: sdk.locales.fallbacks[locale]
|
|
@@ -140,7 +140,7 @@ export function createMarkdownActions(props) {
|
|
|
140
140
|
return;
|
|
141
141
|
}
|
|
142
142
|
try {
|
|
143
|
-
const { entity: asset
|
|
143
|
+
const { entity: asset } = await sdk.navigator.openNewAsset({
|
|
144
144
|
slideIn: {
|
|
145
145
|
waitForClose: true
|
|
146
146
|
}
|
|
@@ -121,7 +121,7 @@ export function MarkdownEditorConnected(props) {
|
|
|
121
121
|
debounce: 300,
|
|
122
122
|
field: props.sdk.field,
|
|
123
123
|
isInitiallyDisabled: props.isInitiallyDisabled
|
|
124
|
-
}, ({ value
|
|
124
|
+
}, ({ value, disabled, setValue, externalReset })=>React.createElement(MarkdownEditor, {
|
|
125
125
|
...props,
|
|
126
126
|
value: value,
|
|
127
127
|
disabled: disabled,
|
|
@@ -49,7 +49,7 @@ export function newReferenceEditorFakeSdk(props) {
|
|
|
49
49
|
locales,
|
|
50
50
|
cmaAdapter: createFakeCMAAdapter({
|
|
51
51
|
Entry: {
|
|
52
|
-
get: async ({ entryId
|
|
52
|
+
get: async ({ entryId })=>{
|
|
53
53
|
if (props?.fetchDelay) {
|
|
54
54
|
await delay(props.fetchDelay);
|
|
55
55
|
}
|
|
@@ -66,7 +66,7 @@ export function newReferenceEditorFakeSdk(props) {
|
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
Asset: {
|
|
69
|
-
get: async ({ assetId
|
|
69
|
+
get: async ({ assetId })=>{
|
|
70
70
|
if (props?.fetchDelay) {
|
|
71
71
|
await delay(props.fetchDelay);
|
|
72
72
|
}
|
|
@@ -91,7 +91,7 @@ export function newReferenceEditorFakeSdk(props) {
|
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
93
|
ContentType: {
|
|
94
|
-
get: async ({ contentTypeId
|
|
94
|
+
get: async ({ contentTypeId })=>{
|
|
95
95
|
if (contentTypeId === contentTypes.published.sys.id) {
|
|
96
96
|
return contentTypes.published;
|
|
97
97
|
}
|
|
@@ -36,7 +36,7 @@ function SanitizeMessage() {
|
|
|
36
36
|
href: SANITIZE_LINK
|
|
37
37
|
}, "Learn more."));
|
|
38
38
|
}
|
|
39
|
-
function CheatSheetMessage({ onClick
|
|
39
|
+
function CheatSheetMessage({ onClick }) {
|
|
40
40
|
return React.createElement("span", null, "Format your text like a pro with the", ' ', React.createElement(TextLink, {
|
|
41
41
|
as: "button",
|
|
42
42
|
testId: "open-markdown-cheatsheet-button",
|
|
@@ -157,7 +157,7 @@ const styles = {
|
|
|
157
157
|
})
|
|
158
158
|
};
|
|
159
159
|
function MarkdownLink(props) {
|
|
160
|
-
const { Embedly
|
|
160
|
+
const { Embedly, children, ...rest } = props;
|
|
161
161
|
if (props.className === 'embedly-card' && Embedly) {
|
|
162
162
|
return React.createElement(Embedly, {
|
|
163
163
|
url: props.href ?? ''
|
|
@@ -13,7 +13,7 @@ function stripUnit(value) {
|
|
|
13
13
|
return parseFloat(value);
|
|
14
14
|
}
|
|
15
15
|
export function create(host, options) {
|
|
16
|
-
const { direction
|
|
16
|
+
const { direction, fixedHeight, height, readOnly } = options || {};
|
|
17
17
|
let initializedWithValue = false;
|
|
18
18
|
const LF = '\n';
|
|
19
19
|
const EDITOR_SIZE = {
|
|
@@ -37,7 +37,7 @@ const styles = {
|
|
|
37
37
|
})
|
|
38
38
|
};
|
|
39
39
|
const ToolbarButton = React.forwardRef((props, ref)=>{
|
|
40
|
-
const { tooltip
|
|
40
|
+
const { tooltip, onClick, children, className, variant = 'transparent', tooltipPlace = 'top', isDisabled = false, ...otherProps } = props;
|
|
41
41
|
return React.createElement(Tooltip, {
|
|
42
42
|
className: styles.tooltip,
|
|
43
43
|
usePortal: true,
|
|
@@ -10,7 +10,7 @@ const srOnly = css({
|
|
|
10
10
|
clip: 'rect(0, 0, 0, 0)',
|
|
11
11
|
border: '0'
|
|
12
12
|
});
|
|
13
|
-
export const Zen = ({ label
|
|
13
|
+
export const Zen = ({ label, ...rest })=>React.createElement("svg", {
|
|
14
14
|
width: 14,
|
|
15
15
|
height: 14,
|
|
16
16
|
viewBox: "0 0 1792 1792",
|
|
@@ -20,7 +20,7 @@ export const Zen = ({ label , ...rest })=>React.createElement("svg", {
|
|
|
20
20
|
}), React.createElement("span", {
|
|
21
21
|
className: srOnly
|
|
22
22
|
}, label));
|
|
23
|
-
export const Strikethrough = ({ label
|
|
23
|
+
export const Strikethrough = ({ label, ...rest })=>React.createElement("svg", {
|
|
24
24
|
width: 14,
|
|
25
25
|
height: 14,
|
|
26
26
|
viewBox: "0 0 1792 1792",
|
|
@@ -30,7 +30,7 @@ export const Strikethrough = ({ label , ...rest })=>React.createElement("svg", {
|
|
|
30
30
|
}), React.createElement("span", {
|
|
31
31
|
className: srOnly
|
|
32
32
|
}, label));
|
|
33
|
-
export const Indent = ({ label
|
|
33
|
+
export const Indent = ({ label, ...rest })=>React.createElement("svg", {
|
|
34
34
|
width: 14,
|
|
35
35
|
height: 14,
|
|
36
36
|
viewBox: "0 0 1792 1792",
|
|
@@ -40,7 +40,7 @@ export const Indent = ({ label , ...rest })=>React.createElement("svg", {
|
|
|
40
40
|
}), React.createElement("span", {
|
|
41
41
|
className: srOnly
|
|
42
42
|
}, label));
|
|
43
|
-
export const Dedent = ({ label
|
|
43
|
+
export const Dedent = ({ label, ...rest })=>React.createElement("svg", {
|
|
44
44
|
width: 14,
|
|
45
45
|
height: 14,
|
|
46
46
|
viewBox: "0 0 1792 1792",
|
|
@@ -50,7 +50,7 @@ export const Dedent = ({ label , ...rest })=>React.createElement("svg", {
|
|
|
50
50
|
}), React.createElement("span", {
|
|
51
51
|
className: srOnly
|
|
52
52
|
}, label));
|
|
53
|
-
export const Cubes = ({ label
|
|
53
|
+
export const Cubes = ({ label, ...rest })=>React.createElement("svg", {
|
|
54
54
|
width: 18,
|
|
55
55
|
height: 14,
|
|
56
56
|
viewBox: "0 0 2304 1792",
|
|
@@ -60,7 +60,7 @@ export const Cubes = ({ label , ...rest })=>React.createElement("svg", {
|
|
|
60
60
|
}), React.createElement("span", {
|
|
61
61
|
className: srOnly
|
|
62
62
|
}, label));
|
|
63
|
-
export const Table = ({ label
|
|
63
|
+
export const Table = ({ label, ...rest })=>React.createElement("svg", {
|
|
64
64
|
width: 14,
|
|
65
65
|
height: 14,
|
|
66
66
|
viewBox: "0 0 1792 1792",
|
|
@@ -70,7 +70,7 @@ export const Table = ({ label , ...rest })=>React.createElement("svg", {
|
|
|
70
70
|
}), React.createElement("span", {
|
|
71
71
|
className: srOnly
|
|
72
72
|
}, label));
|
|
73
|
-
export const SpecialChar = ({ label
|
|
73
|
+
export const SpecialChar = ({ label, ...rest })=>React.createElement("svg", {
|
|
74
74
|
width: 14,
|
|
75
75
|
height: 14,
|
|
76
76
|
viewBox: "0 0 1792 1792",
|
|
@@ -80,7 +80,7 @@ export const SpecialChar = ({ label , ...rest })=>React.createElement("svg", {
|
|
|
80
80
|
}), React.createElement("span", {
|
|
81
81
|
className: srOnly
|
|
82
82
|
}, label));
|
|
83
|
-
export const OrgLinks = ({ label
|
|
83
|
+
export const OrgLinks = ({ label, ...rest })=>React.createElement("svg", {
|
|
84
84
|
width: 14,
|
|
85
85
|
height: 14,
|
|
86
86
|
viewBox: "0 0 1792 1792",
|
|
@@ -90,7 +90,7 @@ export const OrgLinks = ({ label , ...rest })=>React.createElement("svg", {
|
|
|
90
90
|
}), React.createElement("span", {
|
|
91
91
|
className: srOnly
|
|
92
92
|
}, label));
|
|
93
|
-
export const Undo = ({ label
|
|
93
|
+
export const Undo = ({ label, ...rest })=>React.createElement("svg", {
|
|
94
94
|
width: 14,
|
|
95
95
|
height: 14,
|
|
96
96
|
viewBox: "0 0 1792 1792",
|
|
@@ -100,7 +100,7 @@ export const Undo = ({ label , ...rest })=>React.createElement("svg", {
|
|
|
100
100
|
}), React.createElement("span", {
|
|
101
101
|
className: srOnly
|
|
102
102
|
}, label));
|
|
103
|
-
export const Redo = ({ label
|
|
103
|
+
export const Redo = ({ label, ...rest })=>React.createElement("svg", {
|
|
104
104
|
width: 14,
|
|
105
105
|
height: 14,
|
|
106
106
|
viewBox: "0 0 1792 1792",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Button, EntityList, ModalContent, ModalControls, Paragraph } from '@contentful/f36-components';
|
|
3
3
|
import { MarkdownDialogType } from '../types';
|
|
4
|
-
export const ConfirmInsertAssetModalDialog = ({ onClose
|
|
4
|
+
export const ConfirmInsertAssetModalDialog = ({ onClose, assets, locale })=>{
|
|
5
5
|
const localesNumber = assets.length;
|
|
6
6
|
return React.createElement(React.Fragment, null, React.createElement(ModalContent, {
|
|
7
7
|
testId: "confirm-insert-asset"
|
|
8
|
-
}, React.createElement(Paragraph, null, localesNumber === 1 ? `Link asset with missing file for locale ${locale}` : `Link assets with missing files for locale ${locale}`), React.createElement(Paragraph, null, localesNumber === 1 ? 'Do you want to link to the file in its fallback locale?' : 'Do you want to link to the files in their fallback locales?'), React.createElement(EntityList, null, assets.map(({ title
|
|
8
|
+
}, React.createElement(Paragraph, null, localesNumber === 1 ? `Link asset with missing file for locale ${locale}` : `Link assets with missing files for locale ${locale}`), React.createElement(Paragraph, null, localesNumber === 1 ? 'Do you want to link to the file in its fallback locale?' : 'Do you want to link to the files in their fallback locales?'), React.createElement(EntityList, null, assets.map(({ title, description, thumbnailUrl, thumbnailAltText })=>React.createElement(EntityList.Item, {
|
|
9
9
|
key: thumbnailUrl,
|
|
10
10
|
title: title,
|
|
11
11
|
thumbnailUrl: `${thumbnailUrl}?w=46&h=46&fit=thumb`,
|
|
@@ -19,7 +19,7 @@ const styles = {
|
|
|
19
19
|
marginLeft: tokens.spacingM
|
|
20
20
|
})
|
|
21
21
|
};
|
|
22
|
-
const makeEmbedlyLink = ({ url
|
|
22
|
+
const makeEmbedlyLink = ({ url, width, selectedUnit, attachSocial })=>{
|
|
23
23
|
const s = {
|
|
24
24
|
percent: '%',
|
|
25
25
|
px: 'px'
|
|
@@ -32,7 +32,7 @@ const makeEmbedlyLink = ({ url , width , selectedUnit , attachSocial })=>{
|
|
|
32
32
|
].join('');
|
|
33
33
|
};
|
|
34
34
|
const isWidthValid = (width, unit)=>unit === 'percent' ? width <= 100 : true;
|
|
35
|
-
export const EmbedExternalContentModal = ({ onClose
|
|
35
|
+
export const EmbedExternalContentModal = ({ onClose })=>{
|
|
36
36
|
const mainInputRef = useRef(null);
|
|
37
37
|
const [url, setUrl] = useState('https://');
|
|
38
38
|
const [selectedUnit, setUnit] = useState('percent');
|
|
@@ -105,11 +105,11 @@ export const EmbedExternalContentModal = ({ onClose })=>{
|
|
|
105
105
|
as: "p",
|
|
106
106
|
fontColor: "gray500",
|
|
107
107
|
marginTop: "spacingXs"
|
|
108
|
-
}, "To enable this embedded content in your application make sure to add the
|
|
108
|
+
}, "To enable this embedded content in your application make sure to add the ", React.createElement(TextLink, {
|
|
109
109
|
href: "http://embed.ly/docs/products/cards",
|
|
110
110
|
target: "_blank",
|
|
111
111
|
rel: "noopener noreferrer"
|
|
112
|
-
}, "Embedly's platform.js"), "
|
|
112
|
+
}, "Embedly's platform.js"), " on your development environment"))), React.createElement(ModalControls, null, React.createElement(Button, {
|
|
113
113
|
testId: "emded-external-cancel",
|
|
114
114
|
onClick: ()=>onClose(false),
|
|
115
115
|
variant: "secondary",
|
|
@@ -2,7 +2,7 @@ import React, { useState, useRef, useEffect } from 'react';
|
|
|
2
2
|
import { ModalContent, ModalControls, Button, Form, FormControl, TextInput } from '@contentful/f36-components';
|
|
3
3
|
import { MarkdownDialogType } from '../types';
|
|
4
4
|
import { isValidUrl } from '../utils/isValidUrl';
|
|
5
|
-
export const InsertLinkModal = ({ selectedText
|
|
5
|
+
export const InsertLinkModal = ({ selectedText, onClose })=>{
|
|
6
6
|
const mainInputRef = useRef(null);
|
|
7
7
|
const [text, setText] = useState(selectedText || '');
|
|
8
8
|
const [url, setUrl] = useState('');
|
|
@@ -2,7 +2,7 @@ import React, { useState, useRef, useEffect } from 'react';
|
|
|
2
2
|
import { ModalContent, ModalControls, Button, Form, FormControl, TextInput } from '@contentful/f36-components';
|
|
3
3
|
import inRange from 'lodash/inRange';
|
|
4
4
|
import { MarkdownDialogType } from '../types';
|
|
5
|
-
export const InsertTableModal = ({ onClose
|
|
5
|
+
export const InsertTableModal = ({ onClose })=>{
|
|
6
6
|
const mainInputRef = useRef(null);
|
|
7
7
|
const [rows, setRows] = useState(2);
|
|
8
8
|
const [cols, setColumns] = useState(1);
|
|
@@ -28,7 +28,7 @@ const styles = {
|
|
|
28
28
|
marginRight: tokens.spacingS
|
|
29
29
|
})
|
|
30
30
|
};
|
|
31
|
-
export const SpecialCharacterModalDialog = ({ onClose
|
|
31
|
+
export const SpecialCharacterModalDialog = ({ onClose })=>{
|
|
32
32
|
const [selectedCharacter, setSelectedCharacter] = useState(specialCharacters[0]);
|
|
33
33
|
return React.createElement(React.Fragment, null, React.createElement(ModalContent, {
|
|
34
34
|
testId: "insert-special-character-modal"
|
|
@@ -15,26 +15,26 @@ export const openMarkdownDialog = (sdk, previewComponents)=>(options)=>{
|
|
|
15
15
|
});
|
|
16
16
|
} else if (options.parameters?.type === MarkdownDialogType.insertLink) {
|
|
17
17
|
const selectedText = options.parameters.selectedText;
|
|
18
|
-
return ModalDialogLauncher.openDialog(options, ({ onClose
|
|
18
|
+
return ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
19
19
|
return React.createElement(InsertLinkModal, {
|
|
20
20
|
selectedText: selectedText,
|
|
21
21
|
onClose: onClose
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
24
|
} else if (options.parameters?.type === MarkdownDialogType.insertSpecialCharacter) {
|
|
25
|
-
return ModalDialogLauncher.openDialog(options, ({ onClose
|
|
25
|
+
return ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
26
26
|
return React.createElement(SpecialCharacterModalDialog, {
|
|
27
27
|
onClose: onClose
|
|
28
28
|
});
|
|
29
29
|
});
|
|
30
30
|
} else if (options.parameters?.type === MarkdownDialogType.insertTable) {
|
|
31
|
-
return ModalDialogLauncher.openDialog(options, ({ onClose
|
|
31
|
+
return ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
32
32
|
return React.createElement(InsertTableModal, {
|
|
33
33
|
onClose: onClose
|
|
34
34
|
});
|
|
35
35
|
});
|
|
36
36
|
} else if (options.parameters?.type === MarkdownDialogType.embedExternalContent) {
|
|
37
|
-
return ModalDialogLauncher.openDialog(options, ({ onClose
|
|
37
|
+
return ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
38
38
|
return React.createElement(EmbedExternalContentModal, {
|
|
39
39
|
onClose: onClose
|
|
40
40
|
});
|
|
@@ -42,7 +42,7 @@ export const openMarkdownDialog = (sdk, previewComponents)=>(options)=>{
|
|
|
42
42
|
} else if (options.parameters?.type === MarkdownDialogType.confirmInsertAsset) {
|
|
43
43
|
const locale = options.parameters.locale;
|
|
44
44
|
const assets = options.parameters.assets;
|
|
45
|
-
return ModalDialogLauncher.openDialog(options, ({ onClose
|
|
45
|
+
return ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
46
46
|
return React.createElement(ConfirmInsertAssetModalDialog, {
|
|
47
47
|
onClose: onClose,
|
|
48
48
|
locale: locale,
|
|
@@ -52,7 +52,7 @@ export const openMarkdownDialog = (sdk, previewComponents)=>(options)=>{
|
|
|
52
52
|
} else if (options.parameters?.type === MarkdownDialogType.zenMode) {
|
|
53
53
|
const initialValue = options.parameters.initialValue;
|
|
54
54
|
const locale = options.parameters.locale;
|
|
55
|
-
return ModalDialogLauncher.openDialog(options, ({ onClose
|
|
55
|
+
return ModalDialogLauncher.openDialog(options, ({ onClose })=>{
|
|
56
56
|
return React.createElement(ZenModeModalDialog, {
|
|
57
57
|
saveValueToSDK: (value)=>{
|
|
58
58
|
if (value) {
|
package/dist/esm/types.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export var MarkdownDialogType;
|
|
2
2
|
(function(MarkdownDialogType) {
|
|
3
|
-
MarkdownDialogType["cheatsheet"] =
|
|
4
|
-
MarkdownDialogType["insertLink"] =
|
|
5
|
-
MarkdownDialogType["insertSpecialCharacter"] =
|
|
6
|
-
MarkdownDialogType["insertTable"] =
|
|
7
|
-
MarkdownDialogType["embedExternalContent"] =
|
|
8
|
-
MarkdownDialogType["confirmInsertAsset"] =
|
|
9
|
-
MarkdownDialogType["zenMode"] =
|
|
3
|
+
MarkdownDialogType["cheatsheet"] = "markdown-cheatsheet";
|
|
4
|
+
MarkdownDialogType["insertLink"] = "markdown-insertLink";
|
|
5
|
+
MarkdownDialogType["insertSpecialCharacter"] = "markdown-insertSpecialCharacter";
|
|
6
|
+
MarkdownDialogType["insertTable"] = "markdown-insertTable";
|
|
7
|
+
MarkdownDialogType["embedExternalContent"] = "markdown-embedExternalContent";
|
|
8
|
+
MarkdownDialogType["confirmInsertAsset"] = "markdown-confirmInsertAsset";
|
|
9
|
+
MarkdownDialogType["zenMode"] = "markdown-zenMode";
|
|
10
10
|
})(MarkdownDialogType || (MarkdownDialogType = {}));
|
|
@@ -24,7 +24,7 @@ export function replaceAssetDomain(fileUrl) {
|
|
|
24
24
|
return assetDomainMap[p1];
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
function makeAssetLink(asset, { localeCode
|
|
27
|
+
function makeAssetLink(asset, { localeCode, fallbackCode, defaultLocaleCode }) {
|
|
28
28
|
const localizedFile = get(asset, [
|
|
29
29
|
'fields',
|
|
30
30
|
'file',
|
|
@@ -78,7 +78,7 @@ export async function insertAssetLinks(assets, locales) {
|
|
|
78
78
|
});
|
|
79
79
|
const linksWithMeta = assets.map((asset)=>makeAssetLink(asset, locales)).filter((asset)=>asset !== null);
|
|
80
80
|
if (otherLocales.length > 0) {
|
|
81
|
-
const fallbackAssets = linksWithMeta.filter(({ isLocalized
|
|
81
|
+
const fallbackAssets = linksWithMeta.filter(({ isLocalized })=>!isLocalized).map(({ title, isFallback, asset })=>{
|
|
82
82
|
const code = isFallback ? locales.fallbackCode : locales.defaultLocaleCode;
|
|
83
83
|
return {
|
|
84
84
|
title,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-markdown",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.6",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@contentful/f36-components": "^4.0.27",
|
|
39
39
|
"@contentful/f36-icons": "^4.1.0",
|
|
40
40
|
"@contentful/f36-tokens": "^4.0.0",
|
|
41
|
-
"@contentful/field-editor-shared": "^1.4.
|
|
41
|
+
"@contentful/field-editor-shared": "^1.4.5",
|
|
42
42
|
"@types/codemirror": "0.0.109",
|
|
43
43
|
"codemirror": "^5.65.11",
|
|
44
44
|
"constate": "^3.2.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@babel/core": "^7.5.5",
|
|
54
54
|
"@contentful/app-sdk": "^4.17.1",
|
|
55
|
-
"@contentful/field-editor-test-utils": "^1.4.
|
|
55
|
+
"@contentful/field-editor-test-utils": "^1.4.6"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
58
|
"@contentful/app-sdk": "^4.17.1",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"publishConfig": {
|
|
62
62
|
"registry": "https://npm.pkg.github.com/"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "142d2039f023bf4ced956aae1dd08b27c35fdbaa"
|
|
65
65
|
}
|