@atlaskit/editor-plugin-card 6.6.10 → 6.6.11
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 +9 -0
- package/dist/cjs/ui/toolbar.js +11 -27
- package/dist/es2019/ui/toolbar.js +6 -26
- package/dist/esm/ui/toolbar.js +11 -27
- package/package.json +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 6.6.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#174579](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/174579)
|
|
8
|
+
[`523619ae64bbd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/523619ae64bbd) -
|
|
9
|
+
[ux] Clean up feature gate smart_link_editor_update_toolbar_open_link
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 6.6.10
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -81,19 +81,6 @@ var visitCardLink = exports.visitCardLink = function visitCardLink(editorAnalyti
|
|
|
81
81
|
return false;
|
|
82
82
|
}
|
|
83
83
|
var type = state.selection.node.type;
|
|
84
|
-
|
|
85
|
-
// EDM-12466:
|
|
86
|
-
// During smart_link_editor_update_toolbar_open_link clean up
|
|
87
|
-
// Consider updating the code to use visitCardLink or visitCardLinkAnalyticsOnly for all input methods:
|
|
88
|
-
// INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TOOLBAR | INPUT_METHOD.BUTTON | INPUT_METHOD.DOUBLE_CLICK || INPUT_METHOD.META_CLICK
|
|
89
|
-
if (!(0, _platformFeatureFlags.fg)('smart_link_editor_update_toolbar_open_link')) {
|
|
90
|
-
var _titleUrlPairFromNode = (0, _utils3.titleUrlPairFromNode)(state.selection.node),
|
|
91
|
-
url = _titleUrlPairFromNode.url;
|
|
92
|
-
|
|
93
|
-
// All card links should open in the same tab per https://product-fabric.atlassian.net/browse/MS-1583.
|
|
94
|
-
// We are in edit mode here, open the smart card URL in a new window.
|
|
95
|
-
window.open(url);
|
|
96
|
-
}
|
|
97
84
|
if (dispatch) {
|
|
98
85
|
var tr = state.tr;
|
|
99
86
|
editorAnalyticsApi === null || editorAnalyticsApi === void 0 || editorAnalyticsApi.attachAnalyticsEvent((0, _analytics.buildVisitedNonHyperLinkPayload)(type.name, inputMethod))(tr);
|
|
@@ -226,8 +213,8 @@ var getToolbarViewedItem = function getToolbarViewedItem(url, display) {
|
|
|
226
213
|
var generateToolbarItems = function generateToolbarItems(state, intl, providerFactory, cardOptions, lpLinkPicker, linkPicker, pluginInjectionApi) {
|
|
227
214
|
return function (node) {
|
|
228
215
|
var _pluginInjectionApi$a, _pluginInjectionApi$d, _pluginInjectionApi$d2, _pluginInjectionApi$a2, _node$attrs;
|
|
229
|
-
var
|
|
230
|
-
url =
|
|
216
|
+
var _titleUrlPairFromNode = (0, _utils3.titleUrlPairFromNode)(node),
|
|
217
|
+
url = _titleUrlPairFromNode.url;
|
|
231
218
|
var _ref = (_pluginInjectionApi$a = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.analytics) !== null && _pluginInjectionApi$a !== void 0 ? _pluginInjectionApi$a : {},
|
|
232
219
|
editorAnalyticsApi = _ref.actions;
|
|
233
220
|
var metadata = {};
|
|
@@ -349,7 +336,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
349
336
|
testId: 'link-toolbar-edit-link-button',
|
|
350
337
|
onClick: (0, _EditLinkToolbar.getEditLinkCallback)(editorAnalyticsApi, true)
|
|
351
338
|
}];
|
|
352
|
-
var toolbarItems = (0, _experiments.editorExperiment)('platform_editor_controls', 'control') ? [].concat(editItems, commentItems, [
|
|
339
|
+
var toolbarItems = (0, _experiments.editorExperiment)('platform_editor_controls', 'control') ? [].concat(editItems, commentItems, [{
|
|
353
340
|
id: 'editor.link.openLink',
|
|
354
341
|
type: 'button',
|
|
355
342
|
icon: _linkExternal.default,
|
|
@@ -357,11 +344,10 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
357
344
|
metadata: metadata,
|
|
358
345
|
className: 'hyperlink-open-link',
|
|
359
346
|
title: intl.formatMessage(_messages.linkMessages.openLink),
|
|
360
|
-
onClick: visitCardLink(editorAnalyticsApi, openLinkInputMethod)
|
|
361
|
-
}, (0, _platformFeatureFlags.fg)('smart_link_editor_update_toolbar_open_link') && {
|
|
347
|
+
onClick: visitCardLink(editorAnalyticsApi, openLinkInputMethod),
|
|
362
348
|
href: url,
|
|
363
349
|
target: '_blank'
|
|
364
|
-
}
|
|
350
|
+
}, {
|
|
365
351
|
type: 'separator'
|
|
366
352
|
}], (0, _toConsumableArray2.default)(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
367
353
|
type: 'copy-button',
|
|
@@ -387,7 +373,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
387
373
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, false),
|
|
388
374
|
title: intl.formatMessage(_messages.default.remove),
|
|
389
375
|
onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
|
|
390
|
-
}]) : [].concat(editButtonItems, (0, _toConsumableArray2.default)(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [
|
|
376
|
+
}]) : [].concat(editButtonItems, (0, _toConsumableArray2.default)(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
391
377
|
id: 'editor.link.openLink',
|
|
392
378
|
type: 'button',
|
|
393
379
|
icon: _linkExternal.default,
|
|
@@ -395,11 +381,10 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
395
381
|
metadata: metadata,
|
|
396
382
|
className: 'hyperlink-open-link',
|
|
397
383
|
title: intl.formatMessage(_messages.linkMessages.openLink),
|
|
398
|
-
onClick: visitCardLink(editorAnalyticsApi, openLinkInputMethod)
|
|
399
|
-
}, (0, _platformFeatureFlags.fg)('smart_link_editor_update_toolbar_open_link') && {
|
|
384
|
+
onClick: visitCardLink(editorAnalyticsApi, openLinkInputMethod),
|
|
400
385
|
href: url,
|
|
401
386
|
target: '_blank'
|
|
402
|
-
}
|
|
387
|
+
}], (0, _toConsumableArray2.default)(commentItems.length > 1 ? [{
|
|
403
388
|
type: 'separator',
|
|
404
389
|
fullHeight: true
|
|
405
390
|
}, commentItems[0]] : commentItems));
|
|
@@ -623,7 +608,7 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
|
|
|
623
608
|
}
|
|
624
609
|
});
|
|
625
610
|
if (node !== null && node !== void 0 && (_node$attrs2 = node.attrs) !== null && _node$attrs2 !== void 0 && _node$attrs2.url) {
|
|
626
|
-
toolbarItems.push(
|
|
611
|
+
toolbarItems.push({
|
|
627
612
|
id: 'editor.link.openLink',
|
|
628
613
|
type: 'button',
|
|
629
614
|
icon: _linkExternal.default,
|
|
@@ -631,11 +616,10 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
|
|
|
631
616
|
metadata: metadata,
|
|
632
617
|
className: 'hyperlink-open-link',
|
|
633
618
|
title: intl.formatMessage(_messages.linkMessages.openLink),
|
|
634
|
-
onClick: visitCardLink(editorAnalyticsApi, openLinkInputMethod)
|
|
635
|
-
}, (0, _platformFeatureFlags.fg)('smart_link_editor_update_toolbar_open_link') && {
|
|
619
|
+
onClick: visitCardLink(editorAnalyticsApi, openLinkInputMethod),
|
|
636
620
|
href: node.attrs.url,
|
|
637
621
|
target: '_blank'
|
|
638
|
-
})
|
|
622
|
+
});
|
|
639
623
|
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'control')) {
|
|
640
624
|
toolbarItems.push({
|
|
641
625
|
type: 'separator'
|
|
@@ -69,20 +69,6 @@ export const visitCardLink = (editorAnalyticsApi, inputMethod) => (state, dispat
|
|
|
69
69
|
const {
|
|
70
70
|
type
|
|
71
71
|
} = state.selection.node;
|
|
72
|
-
|
|
73
|
-
// EDM-12466:
|
|
74
|
-
// During smart_link_editor_update_toolbar_open_link clean up
|
|
75
|
-
// Consider updating the code to use visitCardLink or visitCardLinkAnalyticsOnly for all input methods:
|
|
76
|
-
// INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TOOLBAR | INPUT_METHOD.BUTTON | INPUT_METHOD.DOUBLE_CLICK || INPUT_METHOD.META_CLICK
|
|
77
|
-
if (!fg('smart_link_editor_update_toolbar_open_link')) {
|
|
78
|
-
const {
|
|
79
|
-
url
|
|
80
|
-
} = titleUrlPairFromNode(state.selection.node);
|
|
81
|
-
|
|
82
|
-
// All card links should open in the same tab per https://product-fabric.atlassian.net/browse/MS-1583.
|
|
83
|
-
// We are in edit mode here, open the smart card URL in a new window.
|
|
84
|
-
window.open(url);
|
|
85
|
-
}
|
|
86
72
|
if (dispatch) {
|
|
87
73
|
const {
|
|
88
74
|
tr
|
|
@@ -351,10 +337,8 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
351
337
|
className: 'hyperlink-open-link',
|
|
352
338
|
title: intl.formatMessage(linkMessages.openLink),
|
|
353
339
|
onClick: visitCardLink(editorAnalyticsApi, openLinkInputMethod),
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
target: '_blank'
|
|
357
|
-
})
|
|
340
|
+
href: url,
|
|
341
|
+
target: '_blank'
|
|
358
342
|
}, {
|
|
359
343
|
type: 'separator'
|
|
360
344
|
}, ...getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi), {
|
|
@@ -390,10 +374,8 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
390
374
|
className: 'hyperlink-open-link',
|
|
391
375
|
title: intl.formatMessage(linkMessages.openLink),
|
|
392
376
|
onClick: visitCardLink(editorAnalyticsApi, openLinkInputMethod),
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
target: '_blank'
|
|
396
|
-
})
|
|
377
|
+
href: url,
|
|
378
|
+
target: '_blank'
|
|
397
379
|
}, ...(commentItems.length > 1 ? [{
|
|
398
380
|
type: 'separator',
|
|
399
381
|
fullHeight: true
|
|
@@ -624,10 +606,8 @@ const getDatasourceButtonGroup = (metadata, intl, editorAnalyticsApi, node, hove
|
|
|
624
606
|
className: 'hyperlink-open-link',
|
|
625
607
|
title: intl.formatMessage(linkMessages.openLink),
|
|
626
608
|
onClick: visitCardLink(editorAnalyticsApi, openLinkInputMethod),
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
target: '_blank'
|
|
630
|
-
})
|
|
609
|
+
href: node.attrs.url,
|
|
610
|
+
target: '_blank'
|
|
631
611
|
});
|
|
632
612
|
if (editorExperiment('platform_editor_controls', 'control')) {
|
|
633
613
|
toolbarItems.push({
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -72,19 +72,6 @@ export var visitCardLink = function visitCardLink(editorAnalyticsApi, inputMetho
|
|
|
72
72
|
return false;
|
|
73
73
|
}
|
|
74
74
|
var type = state.selection.node.type;
|
|
75
|
-
|
|
76
|
-
// EDM-12466:
|
|
77
|
-
// During smart_link_editor_update_toolbar_open_link clean up
|
|
78
|
-
// Consider updating the code to use visitCardLink or visitCardLinkAnalyticsOnly for all input methods:
|
|
79
|
-
// INPUT_METHOD.FLOATING_TB | INPUT_METHOD.TOOLBAR | INPUT_METHOD.BUTTON | INPUT_METHOD.DOUBLE_CLICK || INPUT_METHOD.META_CLICK
|
|
80
|
-
if (!fg('smart_link_editor_update_toolbar_open_link')) {
|
|
81
|
-
var _titleUrlPairFromNode = titleUrlPairFromNode(state.selection.node),
|
|
82
|
-
url = _titleUrlPairFromNode.url;
|
|
83
|
-
|
|
84
|
-
// All card links should open in the same tab per https://product-fabric.atlassian.net/browse/MS-1583.
|
|
85
|
-
// We are in edit mode here, open the smart card URL in a new window.
|
|
86
|
-
window.open(url);
|
|
87
|
-
}
|
|
88
75
|
if (dispatch) {
|
|
89
76
|
var tr = state.tr;
|
|
90
77
|
editorAnalyticsApi === null || editorAnalyticsApi === void 0 || editorAnalyticsApi.attachAnalyticsEvent(buildVisitedNonHyperLinkPayload(type.name, inputMethod))(tr);
|
|
@@ -217,8 +204,8 @@ var getToolbarViewedItem = function getToolbarViewedItem(url, display) {
|
|
|
217
204
|
var generateToolbarItems = function generateToolbarItems(state, intl, providerFactory, cardOptions, lpLinkPicker, linkPicker, pluginInjectionApi) {
|
|
218
205
|
return function (node) {
|
|
219
206
|
var _pluginInjectionApi$a, _pluginInjectionApi$d, _pluginInjectionApi$d2, _pluginInjectionApi$a2, _node$attrs;
|
|
220
|
-
var
|
|
221
|
-
url =
|
|
207
|
+
var _titleUrlPairFromNode = titleUrlPairFromNode(node),
|
|
208
|
+
url = _titleUrlPairFromNode.url;
|
|
222
209
|
var _ref = (_pluginInjectionApi$a = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.analytics) !== null && _pluginInjectionApi$a !== void 0 ? _pluginInjectionApi$a : {},
|
|
223
210
|
editorAnalyticsApi = _ref.actions;
|
|
224
211
|
var metadata = {};
|
|
@@ -340,7 +327,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
340
327
|
testId: 'link-toolbar-edit-link-button',
|
|
341
328
|
onClick: getEditLinkCallback(editorAnalyticsApi, true)
|
|
342
329
|
}];
|
|
343
|
-
var toolbarItems = editorExperiment('platform_editor_controls', 'control') ? [].concat(editItems, commentItems, [
|
|
330
|
+
var toolbarItems = editorExperiment('platform_editor_controls', 'control') ? [].concat(editItems, commentItems, [{
|
|
344
331
|
id: 'editor.link.openLink',
|
|
345
332
|
type: 'button',
|
|
346
333
|
icon: LinkExternalIcon,
|
|
@@ -348,11 +335,10 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
348
335
|
metadata: metadata,
|
|
349
336
|
className: 'hyperlink-open-link',
|
|
350
337
|
title: intl.formatMessage(linkMessages.openLink),
|
|
351
|
-
onClick: visitCardLink(editorAnalyticsApi, openLinkInputMethod)
|
|
352
|
-
}, fg('smart_link_editor_update_toolbar_open_link') && {
|
|
338
|
+
onClick: visitCardLink(editorAnalyticsApi, openLinkInputMethod),
|
|
353
339
|
href: url,
|
|
354
340
|
target: '_blank'
|
|
355
|
-
}
|
|
341
|
+
}, {
|
|
356
342
|
type: 'separator'
|
|
357
343
|
}], _toConsumableArray(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
358
344
|
type: 'copy-button',
|
|
@@ -378,7 +364,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
378
364
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, false),
|
|
379
365
|
title: intl.formatMessage(commonMessages.remove),
|
|
380
366
|
onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
|
|
381
|
-
}]) : [].concat(editButtonItems, _toConsumableArray(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [
|
|
367
|
+
}]) : [].concat(editButtonItems, _toConsumableArray(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
382
368
|
id: 'editor.link.openLink',
|
|
383
369
|
type: 'button',
|
|
384
370
|
icon: LinkExternalIcon,
|
|
@@ -386,11 +372,10 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
386
372
|
metadata: metadata,
|
|
387
373
|
className: 'hyperlink-open-link',
|
|
388
374
|
title: intl.formatMessage(linkMessages.openLink),
|
|
389
|
-
onClick: visitCardLink(editorAnalyticsApi, openLinkInputMethod)
|
|
390
|
-
}, fg('smart_link_editor_update_toolbar_open_link') && {
|
|
375
|
+
onClick: visitCardLink(editorAnalyticsApi, openLinkInputMethod),
|
|
391
376
|
href: url,
|
|
392
377
|
target: '_blank'
|
|
393
|
-
}
|
|
378
|
+
}], _toConsumableArray(commentItems.length > 1 ? [{
|
|
394
379
|
type: 'separator',
|
|
395
380
|
fullHeight: true
|
|
396
381
|
}, commentItems[0]] : commentItems));
|
|
@@ -614,7 +599,7 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
|
|
|
614
599
|
}
|
|
615
600
|
});
|
|
616
601
|
if (node !== null && node !== void 0 && (_node$attrs2 = node.attrs) !== null && _node$attrs2 !== void 0 && _node$attrs2.url) {
|
|
617
|
-
toolbarItems.push(
|
|
602
|
+
toolbarItems.push({
|
|
618
603
|
id: 'editor.link.openLink',
|
|
619
604
|
type: 'button',
|
|
620
605
|
icon: LinkExternalIcon,
|
|
@@ -622,11 +607,10 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
|
|
|
622
607
|
metadata: metadata,
|
|
623
608
|
className: 'hyperlink-open-link',
|
|
624
609
|
title: intl.formatMessage(linkMessages.openLink),
|
|
625
|
-
onClick: visitCardLink(editorAnalyticsApi, openLinkInputMethod)
|
|
626
|
-
}, fg('smart_link_editor_update_toolbar_open_link') && {
|
|
610
|
+
onClick: visitCardLink(editorAnalyticsApi, openLinkInputMethod),
|
|
627
611
|
href: node.attrs.url,
|
|
628
612
|
target: '_blank'
|
|
629
|
-
})
|
|
613
|
+
});
|
|
630
614
|
if (editorExperiment('platform_editor_controls', 'control')) {
|
|
631
615
|
toolbarItems.push({
|
|
632
616
|
type: 'separator'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "6.6.
|
|
3
|
+
"version": "6.6.11",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@atlaskit/smart-card": "^38.13.0",
|
|
65
65
|
"@atlaskit/theme": "^18.0.0",
|
|
66
66
|
"@atlaskit/tmp-editor-statsig": "^8.0.0",
|
|
67
|
-
"@atlaskit/tokens": "^5.
|
|
67
|
+
"@atlaskit/tokens": "^5.4.0",
|
|
68
68
|
"@babel/runtime": "^7.0.0",
|
|
69
69
|
"@emotion/react": "^11.7.1",
|
|
70
70
|
"lodash": "^4.17.21",
|
|
@@ -132,9 +132,6 @@
|
|
|
132
132
|
"platform_editor_controls_patch_12": {
|
|
133
133
|
"type": "boolean"
|
|
134
134
|
},
|
|
135
|
-
"smart_link_editor_update_toolbar_open_link": {
|
|
136
|
-
"type": "boolean"
|
|
137
|
-
},
|
|
138
135
|
"platform_editor_fix_advanced_code_crash": {
|
|
139
136
|
"type": "boolean"
|
|
140
137
|
},
|