@atlaskit/editor-plugin-card 7.4.2 → 7.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/nodeviews/toDOM-fixes/blockCard.js +7 -3
- package/dist/cjs/nodeviews/toDOM-fixes/embedCard.js +7 -3
- package/dist/cjs/nodeviews/toDOM-fixes/inlineCard.js +7 -3
- package/dist/es2019/nodeviews/toDOM-fixes/blockCard.js +8 -3
- package/dist/es2019/nodeviews/toDOM-fixes/embedCard.js +8 -3
- package/dist/es2019/nodeviews/toDOM-fixes/inlineCard.js +8 -3
- package/dist/esm/nodeviews/toDOM-fixes/blockCard.js +8 -4
- package/dist/esm/nodeviews/toDOM-fixes/embedCard.js +8 -4
- package/dist/esm/nodeviews/toDOM-fixes/inlineCard.js +8 -4
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -8,12 +8,14 @@ exports.blockCardSpecWithFixedToDOM = void 0;
|
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
10
10
|
var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _colors = require("@atlaskit/theme/colors");
|
|
12
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
15
|
// @nodeSpecException:toDOM patch
|
|
15
16
|
var blockCardSpecWithFixedToDOM = exports.blockCardSpecWithFixedToDOM = function blockCardSpecWithFixedToDOM() {
|
|
16
|
-
|
|
17
|
+
var blockCardNode = (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? _adfSchema.blockCardWithLocalId : _adfSchema.blockCard;
|
|
18
|
+
return _objectSpread(_objectSpread({}, blockCardNode), {}, {
|
|
17
19
|
toDOM: function toDOM(node) {
|
|
18
20
|
var _node$attrs;
|
|
19
21
|
var _ref = node.attrs,
|
|
@@ -24,7 +26,7 @@ var blockCardSpecWithFixedToDOM = exports.blockCardSpecWithFixedToDOM = function
|
|
|
24
26
|
layout = _ref3.layout,
|
|
25
27
|
width = _ref3.width,
|
|
26
28
|
datasource = _ref3.datasource;
|
|
27
|
-
var attrs = {
|
|
29
|
+
var attrs = _objectSpread({
|
|
28
30
|
'data-block-card': '',
|
|
29
31
|
'data-card-url': url || '',
|
|
30
32
|
'data-card-data': data ? JSON.stringify(data) : '',
|
|
@@ -32,7 +34,9 @@ var blockCardSpecWithFixedToDOM = exports.blockCardSpecWithFixedToDOM = function
|
|
|
32
34
|
'data-layout': layout,
|
|
33
35
|
'data-width': "".concat(width),
|
|
34
36
|
class: 'blockCardView-content-wrap'
|
|
35
|
-
}
|
|
37
|
+
}, (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? {
|
|
38
|
+
'data-local-id': node.attrs.localId
|
|
39
|
+
} : {});
|
|
36
40
|
return ['div', attrs, ['a', {
|
|
37
41
|
// To match `packages/linking-platform/smart-card/src/view/CardWithUrl/component-lazy/LoadingCardLink.tsx`
|
|
38
42
|
// Which uses frame styling `packages/linking-platform/smart-card/src/view/InlineCard/Frame/styled.ts`
|
|
@@ -9,6 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
10
10
|
var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
|
|
11
11
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
13
|
var _colors = require("@atlaskit/theme/colors");
|
|
13
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
15
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /**
|
|
@@ -61,7 +62,8 @@ var LINE_LENGTH = 760;
|
|
|
61
62
|
|
|
62
63
|
// @nodeSpecException:toDOM patch
|
|
63
64
|
var embedCardSpecWithFixedToDOM = exports.embedCardSpecWithFixedToDOM = function embedCardSpecWithFixedToDOM() {
|
|
64
|
-
|
|
65
|
+
var embedCardNode = (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? _adfSchema.embedCardWithLocalId : _adfSchema.embedCard;
|
|
66
|
+
return _objectSpread(_objectSpread({}, embedCardNode), {}, {
|
|
65
67
|
toDOM: function toDOM(node) {
|
|
66
68
|
var _node$attrs = node.attrs,
|
|
67
69
|
url = _node$attrs.url,
|
|
@@ -70,7 +72,7 @@ var embedCardSpecWithFixedToDOM = exports.embedCardSpecWithFixedToDOM = function
|
|
|
70
72
|
originalWidth = _node$attrs.originalWidth,
|
|
71
73
|
originalHeight = _node$attrs.originalHeight;
|
|
72
74
|
var aspectRatio = originalWidth && originalHeight ? originalWidth / originalHeight : _editorSharedStyles.DEFAULT_EMBED_CARD_WIDTH / _editorSharedStyles.DEFAULT_EMBED_CARD_HEIGHT;
|
|
73
|
-
var attrs = {
|
|
75
|
+
var attrs = _objectSpread({
|
|
74
76
|
'data-embed-card': '',
|
|
75
77
|
'data-card-url': url,
|
|
76
78
|
'data-layout': layout,
|
|
@@ -86,7 +88,9 @@ var embedCardSpecWithFixedToDOM = exports.embedCardSpecWithFixedToDOM = function
|
|
|
86
88
|
marginLeft: layout === 'align-start' ? '0' : '',
|
|
87
89
|
float: float(layout)
|
|
88
90
|
})
|
|
89
|
-
}
|
|
91
|
+
}, (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? {
|
|
92
|
+
'data-local-id': node.attrs.localId
|
|
93
|
+
} : {});
|
|
90
94
|
return ['div', attrs,
|
|
91
95
|
// This is the only modification to the embed card `toDOM`
|
|
92
96
|
// This is to match the behaviour of Card which lazy loads
|
|
@@ -8,12 +8,14 @@ exports.inlineCardSpecWithFixedToDOM = void 0;
|
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
10
10
|
var _lazyNodeView = require("@atlaskit/editor-common/lazy-node-view");
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _colors = require("@atlaskit/theme/colors");
|
|
12
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
13
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
14
15
|
// @nodeSpecException:toDOM patch
|
|
15
16
|
var inlineCardSpecWithFixedToDOM = exports.inlineCardSpecWithFixedToDOM = function inlineCardSpecWithFixedToDOM() {
|
|
16
|
-
|
|
17
|
+
var inlineCardNode = (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? _adfSchema.inlineCardWithLocalId : _adfSchema.inlineCard;
|
|
18
|
+
return _objectSpread(_objectSpread({}, inlineCardNode), {}, {
|
|
17
19
|
toDOM: function toDOM(node) {
|
|
18
20
|
var wrapperAttrs = {
|
|
19
21
|
class: 'inlineCardView-content-wrap inlineNodeView'
|
|
@@ -22,7 +24,7 @@ var inlineCardSpecWithFixedToDOM = exports.inlineCardSpecWithFixedToDOM = functi
|
|
|
22
24
|
'aria-busy': 'true',
|
|
23
25
|
class: 'card'
|
|
24
26
|
};
|
|
25
|
-
var attrs = {
|
|
27
|
+
var attrs = _objectSpread({
|
|
26
28
|
'data-inline-card': '',
|
|
27
29
|
href: node.attrs.url || '',
|
|
28
30
|
'data-card-data': node.attrs.data ? JSON.stringify(node.attrs.data) : '',
|
|
@@ -45,7 +47,9 @@ var inlineCardSpecWithFixedToDOM = exports.inlineCardSpecWithFixedToDOM = functi
|
|
|
45
47
|
msUserSelect: 'text',
|
|
46
48
|
MozUserSelect: 'none' // -moz-user-select
|
|
47
49
|
})
|
|
48
|
-
}
|
|
50
|
+
}, (0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid') ? {
|
|
51
|
+
'data-local-id': node.attrs.localId
|
|
52
|
+
} : {});
|
|
49
53
|
if (node.attrs.url) {
|
|
50
54
|
return ['span', wrapperAttrs, ['span', cardAttrs, ['a', attrs, node.attrs.url]]];
|
|
51
55
|
} else {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { blockCard } from '@atlaskit/adf-schema';
|
|
1
|
+
import { blockCard, blockCardWithLocalId } from '@atlaskit/adf-schema';
|
|
2
2
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import { B400 } from '@atlaskit/theme/colors';
|
|
4
5
|
// @nodeSpecException:toDOM patch
|
|
5
6
|
export const blockCardSpecWithFixedToDOM = () => {
|
|
7
|
+
const blockCardNode = fg('platform_editor_adf_with_localid') ? blockCardWithLocalId : blockCard;
|
|
6
8
|
return {
|
|
7
|
-
...
|
|
9
|
+
...blockCardNode,
|
|
8
10
|
toDOM: node => {
|
|
9
11
|
var _node$attrs;
|
|
10
12
|
const {
|
|
@@ -25,7 +27,10 @@ export const blockCardSpecWithFixedToDOM = () => {
|
|
|
25
27
|
'data-datasource': datasource ? JSON.stringify(datasource) : '',
|
|
26
28
|
'data-layout': layout,
|
|
27
29
|
'data-width': `${width}`,
|
|
28
|
-
class: 'blockCardView-content-wrap'
|
|
30
|
+
class: 'blockCardView-content-wrap',
|
|
31
|
+
...(fg('platform_editor_adf_with_localid') ? {
|
|
32
|
+
'data-local-id': node.attrs.localId
|
|
33
|
+
} : {})
|
|
29
34
|
};
|
|
30
35
|
return ['div', attrs, ['a', {
|
|
31
36
|
// To match `packages/linking-platform/smart-card/src/view/CardWithUrl/component-lazy/LoadingCardLink.tsx`
|
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
* In the long term likely `toDOM` will move back out of `adf-schema` in which
|
|
9
9
|
* case we can consolidate them.
|
|
10
10
|
*/
|
|
11
|
-
import { embedCard } from '@atlaskit/adf-schema';
|
|
11
|
+
import { embedCard, embedCardWithLocalId } from '@atlaskit/adf-schema';
|
|
12
12
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
13
13
|
import { DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
|
|
14
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
15
|
import { B400 } from '@atlaskit/theme/colors';
|
|
15
16
|
// From `packages/editor/editor-common/src/ui/MediaSingle/styled.tsx`
|
|
16
17
|
function calcMargin(layout) {
|
|
@@ -52,8 +53,9 @@ const LINE_LENGTH = 760;
|
|
|
52
53
|
|
|
53
54
|
// @nodeSpecException:toDOM patch
|
|
54
55
|
export const embedCardSpecWithFixedToDOM = () => {
|
|
56
|
+
const embedCardNode = fg('platform_editor_adf_with_localid') ? embedCardWithLocalId : embedCard;
|
|
55
57
|
return {
|
|
56
|
-
...
|
|
58
|
+
...embedCardNode,
|
|
57
59
|
toDOM: node => {
|
|
58
60
|
const {
|
|
59
61
|
url,
|
|
@@ -78,7 +80,10 @@ export const embedCardSpecWithFixedToDOM = () => {
|
|
|
78
80
|
marginRight: layout === 'align-end' ? '0' : '',
|
|
79
81
|
marginLeft: layout === 'align-start' ? '0' : '',
|
|
80
82
|
float: float(layout)
|
|
81
|
-
})
|
|
83
|
+
}),
|
|
84
|
+
...(fg('platform_editor_adf_with_localid') ? {
|
|
85
|
+
'data-local-id': node.attrs.localId
|
|
86
|
+
} : {})
|
|
82
87
|
};
|
|
83
88
|
return ['div', attrs,
|
|
84
89
|
// This is the only modification to the embed card `toDOM`
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { inlineCard } from '@atlaskit/adf-schema';
|
|
1
|
+
import { inlineCard, inlineCardWithLocalId } from '@atlaskit/adf-schema';
|
|
2
2
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import { B400 } from '@atlaskit/theme/colors';
|
|
4
5
|
// @nodeSpecException:toDOM patch
|
|
5
6
|
export const inlineCardSpecWithFixedToDOM = () => {
|
|
7
|
+
const inlineCardNode = fg('platform_editor_adf_with_localid') ? inlineCardWithLocalId : inlineCard;
|
|
6
8
|
return {
|
|
7
|
-
...
|
|
9
|
+
...inlineCardNode,
|
|
8
10
|
toDOM: node => {
|
|
9
11
|
const wrapperAttrs = {
|
|
10
12
|
class: 'inlineCardView-content-wrap inlineNodeView'
|
|
@@ -35,7 +37,10 @@ export const inlineCardSpecWithFixedToDOM = () => {
|
|
|
35
37
|
WebkitUserSelect: 'text',
|
|
36
38
|
msUserSelect: 'text',
|
|
37
39
|
MozUserSelect: 'none' // -moz-user-select
|
|
38
|
-
})
|
|
40
|
+
}),
|
|
41
|
+
...(fg('platform_editor_adf_with_localid') ? {
|
|
42
|
+
'data-local-id': node.attrs.localId
|
|
43
|
+
} : {})
|
|
39
44
|
};
|
|
40
45
|
if (node.attrs.url) {
|
|
41
46
|
return ['span', wrapperAttrs, ['span', cardAttrs, ['a', attrs, node.attrs.url]]];
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
import { blockCard } from '@atlaskit/adf-schema';
|
|
4
|
+
import { blockCard, blockCardWithLocalId } from '@atlaskit/adf-schema';
|
|
5
5
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { B400 } from '@atlaskit/theme/colors';
|
|
7
8
|
// @nodeSpecException:toDOM patch
|
|
8
9
|
export var blockCardSpecWithFixedToDOM = function blockCardSpecWithFixedToDOM() {
|
|
9
|
-
|
|
10
|
+
var blockCardNode = fg('platform_editor_adf_with_localid') ? blockCardWithLocalId : blockCard;
|
|
11
|
+
return _objectSpread(_objectSpread({}, blockCardNode), {}, {
|
|
10
12
|
toDOM: function toDOM(node) {
|
|
11
13
|
var _node$attrs;
|
|
12
14
|
var _ref = node.attrs,
|
|
@@ -17,7 +19,7 @@ export var blockCardSpecWithFixedToDOM = function blockCardSpecWithFixedToDOM()
|
|
|
17
19
|
layout = _ref3.layout,
|
|
18
20
|
width = _ref3.width,
|
|
19
21
|
datasource = _ref3.datasource;
|
|
20
|
-
var attrs = {
|
|
22
|
+
var attrs = _objectSpread({
|
|
21
23
|
'data-block-card': '',
|
|
22
24
|
'data-card-url': url || '',
|
|
23
25
|
'data-card-data': data ? JSON.stringify(data) : '',
|
|
@@ -25,7 +27,9 @@ export var blockCardSpecWithFixedToDOM = function blockCardSpecWithFixedToDOM()
|
|
|
25
27
|
'data-layout': layout,
|
|
26
28
|
'data-width': "".concat(width),
|
|
27
29
|
class: 'blockCardView-content-wrap'
|
|
28
|
-
}
|
|
30
|
+
}, fg('platform_editor_adf_with_localid') ? {
|
|
31
|
+
'data-local-id': node.attrs.localId
|
|
32
|
+
} : {});
|
|
29
33
|
return ['div', attrs, ['a', {
|
|
30
34
|
// To match `packages/linking-platform/smart-card/src/view/CardWithUrl/component-lazy/LoadingCardLink.tsx`
|
|
31
35
|
// Which uses frame styling `packages/linking-platform/smart-card/src/view/InlineCard/Frame/styled.ts`
|
|
@@ -11,9 +11,10 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
11
11
|
* In the long term likely `toDOM` will move back out of `adf-schema` in which
|
|
12
12
|
* case we can consolidate them.
|
|
13
13
|
*/
|
|
14
|
-
import { embedCard } from '@atlaskit/adf-schema';
|
|
14
|
+
import { embedCard, embedCardWithLocalId } from '@atlaskit/adf-schema';
|
|
15
15
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
16
16
|
import { DEFAULT_EMBED_CARD_HEIGHT, DEFAULT_EMBED_CARD_WIDTH } from '@atlaskit/editor-shared-styles';
|
|
17
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
18
|
import { B400 } from '@atlaskit/theme/colors';
|
|
18
19
|
// From `packages/editor/editor-common/src/ui/MediaSingle/styled.tsx`
|
|
19
20
|
function calcMargin(layout) {
|
|
@@ -55,7 +56,8 @@ var LINE_LENGTH = 760;
|
|
|
55
56
|
|
|
56
57
|
// @nodeSpecException:toDOM patch
|
|
57
58
|
export var embedCardSpecWithFixedToDOM = function embedCardSpecWithFixedToDOM() {
|
|
58
|
-
|
|
59
|
+
var embedCardNode = fg('platform_editor_adf_with_localid') ? embedCardWithLocalId : embedCard;
|
|
60
|
+
return _objectSpread(_objectSpread({}, embedCardNode), {}, {
|
|
59
61
|
toDOM: function toDOM(node) {
|
|
60
62
|
var _node$attrs = node.attrs,
|
|
61
63
|
url = _node$attrs.url,
|
|
@@ -64,7 +66,7 @@ export var embedCardSpecWithFixedToDOM = function embedCardSpecWithFixedToDOM()
|
|
|
64
66
|
originalWidth = _node$attrs.originalWidth,
|
|
65
67
|
originalHeight = _node$attrs.originalHeight;
|
|
66
68
|
var aspectRatio = originalWidth && originalHeight ? originalWidth / originalHeight : DEFAULT_EMBED_CARD_WIDTH / DEFAULT_EMBED_CARD_HEIGHT;
|
|
67
|
-
var attrs = {
|
|
69
|
+
var attrs = _objectSpread({
|
|
68
70
|
'data-embed-card': '',
|
|
69
71
|
'data-card-url': url,
|
|
70
72
|
'data-layout': layout,
|
|
@@ -80,7 +82,9 @@ export var embedCardSpecWithFixedToDOM = function embedCardSpecWithFixedToDOM()
|
|
|
80
82
|
marginLeft: layout === 'align-start' ? '0' : '',
|
|
81
83
|
float: float(layout)
|
|
82
84
|
})
|
|
83
|
-
}
|
|
85
|
+
}, fg('platform_editor_adf_with_localid') ? {
|
|
86
|
+
'data-local-id': node.attrs.localId
|
|
87
|
+
} : {});
|
|
84
88
|
return ['div', attrs,
|
|
85
89
|
// This is the only modification to the embed card `toDOM`
|
|
86
90
|
// This is to match the behaviour of Card which lazy loads
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
import { inlineCard } from '@atlaskit/adf-schema';
|
|
4
|
+
import { inlineCard, inlineCardWithLocalId } from '@atlaskit/adf-schema';
|
|
5
5
|
import { convertToInlineCss } from '@atlaskit/editor-common/lazy-node-view';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { B400 } from '@atlaskit/theme/colors';
|
|
7
8
|
// @nodeSpecException:toDOM patch
|
|
8
9
|
export var inlineCardSpecWithFixedToDOM = function inlineCardSpecWithFixedToDOM() {
|
|
9
|
-
|
|
10
|
+
var inlineCardNode = fg('platform_editor_adf_with_localid') ? inlineCardWithLocalId : inlineCard;
|
|
11
|
+
return _objectSpread(_objectSpread({}, inlineCardNode), {}, {
|
|
10
12
|
toDOM: function toDOM(node) {
|
|
11
13
|
var wrapperAttrs = {
|
|
12
14
|
class: 'inlineCardView-content-wrap inlineNodeView'
|
|
@@ -15,7 +17,7 @@ export var inlineCardSpecWithFixedToDOM = function inlineCardSpecWithFixedToDOM(
|
|
|
15
17
|
'aria-busy': 'true',
|
|
16
18
|
class: 'card'
|
|
17
19
|
};
|
|
18
|
-
var attrs = {
|
|
20
|
+
var attrs = _objectSpread({
|
|
19
21
|
'data-inline-card': '',
|
|
20
22
|
href: node.attrs.url || '',
|
|
21
23
|
'data-card-data': node.attrs.data ? JSON.stringify(node.attrs.data) : '',
|
|
@@ -38,7 +40,9 @@ export var inlineCardSpecWithFixedToDOM = function inlineCardSpecWithFixedToDOM(
|
|
|
38
40
|
msUserSelect: 'text',
|
|
39
41
|
MozUserSelect: 'none' // -moz-user-select
|
|
40
42
|
})
|
|
41
|
-
}
|
|
43
|
+
}, fg('platform_editor_adf_with_localid') ? {
|
|
44
|
+
'data-local-id': node.attrs.localId
|
|
45
|
+
} : {});
|
|
42
46
|
if (node.attrs.url) {
|
|
43
47
|
return ['span', wrapperAttrs, ['span', cardAttrs, ['a', attrs, node.attrs.url]]];
|
|
44
48
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "7.4.
|
|
3
|
+
"version": "7.4.3",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@atlaskit/link-analytics": "^10.0.0",
|
|
55
55
|
"@atlaskit/link-client-extension": "^5.0.0",
|
|
56
56
|
"@atlaskit/link-datasource": "^4.19.0",
|
|
57
|
-
"@atlaskit/linking-common": "^9.
|
|
57
|
+
"@atlaskit/linking-common": "^9.4.0",
|
|
58
58
|
"@atlaskit/linking-types": "^14.0.0",
|
|
59
59
|
"@atlaskit/menu": "^8.3.0",
|
|
60
60
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@atlaskit/primitives": "^14.11.0",
|
|
63
63
|
"@atlaskit/smart-card": "^40.10.0",
|
|
64
64
|
"@atlaskit/theme": "^19.0.0",
|
|
65
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
65
|
+
"@atlaskit/tmp-editor-statsig": "^11.0.0",
|
|
66
66
|
"@atlaskit/tokens": "^6.0.0",
|
|
67
67
|
"@babel/runtime": "^7.0.0",
|
|
68
68
|
"@emotion/react": "^11.7.1",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"@atlaskit/editor-common": "^107.25.0",
|
|
76
|
-
"@atlaskit/link-provider": "^3.
|
|
76
|
+
"@atlaskit/link-provider": "^3.6.0",
|
|
77
77
|
"react": "^18.2.0",
|
|
78
78
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
79
79
|
},
|
|
@@ -131,6 +131,9 @@
|
|
|
131
131
|
},
|
|
132
132
|
"platform_editor_controls_patch_15": {
|
|
133
133
|
"type": "boolean"
|
|
134
|
+
},
|
|
135
|
+
"platform_editor_adf_with_localid": {
|
|
136
|
+
"type": "boolean"
|
|
134
137
|
}
|
|
135
138
|
},
|
|
136
139
|
"stricter": {
|