@contentful/field-editor-markdown 1.13.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -18,6 +18,7 @@ _export(exports, {
|
|
|
18
18
|
});
|
|
19
19
|
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
20
20
|
const _f36components = require("@contentful/f36-components");
|
|
21
|
+
const _fieldeditorshared = require("@contentful/field-editor-shared");
|
|
21
22
|
const _types = require("../types");
|
|
22
23
|
function _getRequireWildcardCache(nodeInterop) {
|
|
23
24
|
if (typeof WeakMap !== "function") return null;
|
|
@@ -60,17 +61,25 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
60
61
|
}
|
|
61
62
|
return newObj;
|
|
62
63
|
}
|
|
64
|
+
const THUMBNAIL_SIZE = 46;
|
|
63
65
|
const ConfirmInsertAssetModalDialog = ({ onClose, assets, locale })=>{
|
|
64
66
|
const localesNumber = assets.length;
|
|
65
67
|
return /*#__PURE__*/ _react.createElement(_react.Fragment, null, /*#__PURE__*/ _react.createElement(_f36components.ModalContent, {
|
|
66
68
|
testId: "confirm-insert-asset"
|
|
67
|
-
}, /*#__PURE__*/ _react.createElement(_f36components.Paragraph, null, localesNumber === 1 ? `Link asset with missing file for locale ${locale}` : `Link assets with missing files for locale ${locale}`), /*#__PURE__*/ _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?'), /*#__PURE__*/ _react.createElement(_f36components.EntityList, null, assets.map(({ title, description, thumbnailUrl, thumbnailAltText })
|
|
69
|
+
}, /*#__PURE__*/ _react.createElement(_f36components.Paragraph, null, localesNumber === 1 ? `Link asset with missing file for locale ${locale}` : `Link assets with missing files for locale ${locale}`), /*#__PURE__*/ _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?'), /*#__PURE__*/ _react.createElement(_f36components.EntityList, null, assets.map(({ title, description, thumbnailUrl, thumbnailAltText })=>{
|
|
70
|
+
const resolvedThumbnailUrl = _fieldeditorshared.entityHelpers.getResolvedImageUrl(thumbnailUrl, {
|
|
71
|
+
w: THUMBNAIL_SIZE,
|
|
72
|
+
h: THUMBNAIL_SIZE,
|
|
73
|
+
fit: 'thumb'
|
|
74
|
+
});
|
|
75
|
+
return /*#__PURE__*/ _react.createElement(_f36components.EntityList.Item, {
|
|
68
76
|
key: thumbnailUrl,
|
|
69
77
|
title: title,
|
|
70
|
-
thumbnailUrl:
|
|
78
|
+
thumbnailUrl: resolvedThumbnailUrl,
|
|
71
79
|
thumbnailAltText: thumbnailAltText,
|
|
72
80
|
description: description
|
|
73
|
-
})
|
|
81
|
+
});
|
|
82
|
+
}))), /*#__PURE__*/ _react.createElement(_f36components.ModalControls, null, /*#__PURE__*/ _react.createElement(_f36components.Button, {
|
|
74
83
|
onClick: ()=>onClose(false),
|
|
75
84
|
variant: "secondary",
|
|
76
85
|
size: "small"
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Button, EntityList, ModalContent, ModalControls, Paragraph } from '@contentful/f36-components';
|
|
3
|
+
import { entityHelpers } from '@contentful/field-editor-shared';
|
|
3
4
|
import { MarkdownDialogType } from '../types';
|
|
5
|
+
const THUMBNAIL_SIZE = 46;
|
|
4
6
|
export const ConfirmInsertAssetModalDialog = ({ onClose, assets, locale })=>{
|
|
5
7
|
const localesNumber = assets.length;
|
|
6
8
|
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(ModalContent, {
|
|
7
9
|
testId: "confirm-insert-asset"
|
|
8
|
-
}, /*#__PURE__*/ React.createElement(Paragraph, null, localesNumber === 1 ? `Link asset with missing file for locale ${locale}` : `Link assets with missing files for locale ${locale}`), /*#__PURE__*/ 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?'), /*#__PURE__*/ React.createElement(EntityList, null, assets.map(({ title, description, thumbnailUrl, thumbnailAltText })
|
|
10
|
+
}, /*#__PURE__*/ React.createElement(Paragraph, null, localesNumber === 1 ? `Link asset with missing file for locale ${locale}` : `Link assets with missing files for locale ${locale}`), /*#__PURE__*/ 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?'), /*#__PURE__*/ React.createElement(EntityList, null, assets.map(({ title, description, thumbnailUrl, thumbnailAltText })=>{
|
|
11
|
+
const resolvedThumbnailUrl = entityHelpers.getResolvedImageUrl(thumbnailUrl, {
|
|
12
|
+
w: THUMBNAIL_SIZE,
|
|
13
|
+
h: THUMBNAIL_SIZE,
|
|
14
|
+
fit: 'thumb'
|
|
15
|
+
});
|
|
16
|
+
return /*#__PURE__*/ React.createElement(EntityList.Item, {
|
|
9
17
|
key: thumbnailUrl,
|
|
10
18
|
title: title,
|
|
11
|
-
thumbnailUrl:
|
|
19
|
+
thumbnailUrl: resolvedThumbnailUrl,
|
|
12
20
|
thumbnailAltText: thumbnailAltText,
|
|
13
21
|
description: description
|
|
14
|
-
})
|
|
22
|
+
});
|
|
23
|
+
}))), /*#__PURE__*/ React.createElement(ModalControls, null, /*#__PURE__*/ React.createElement(Button, {
|
|
15
24
|
onClick: ()=>onClose(false),
|
|
16
25
|
variant: "secondary",
|
|
17
26
|
size: "small"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-markdown",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@contentful/f36-components": "^5.4.1",
|
|
40
40
|
"@contentful/f36-icons": "^5.4.1",
|
|
41
41
|
"@contentful/f36-tokens": "^5.1.0",
|
|
42
|
-
"@contentful/field-editor-shared": "^2.
|
|
42
|
+
"@contentful/field-editor-shared": "^2.17.0",
|
|
43
43
|
"@types/codemirror": "0.0.109",
|
|
44
44
|
"codemirror": "^5.65.11",
|
|
45
45
|
"emotion": "^10.0.17",
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"publishConfig": {
|
|
64
64
|
"registry": "https://npm.pkg.github.com/"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "c85b1e8cd6772eb796ed2b22ebb778c717f4a7f4"
|
|
67
67
|
}
|