@atlaskit/editor-plugin-card 1.6.2 → 1.7.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.
- package/CHANGELOG.md +19 -0
- package/dist/cjs/pm-plugins/mountHyperlink.js +21 -0
- package/dist/cjs/toolbar.js +23 -9
- package/dist/es2019/pm-plugins/mountHyperlink.js +21 -0
- package/dist/es2019/toolbar.js +22 -8
- package/dist/esm/pm-plugins/mountHyperlink.js +21 -0
- package/dist/esm/toolbar.js +22 -8
- package/dist/types/toolbar.d.ts +6 -2
- package/dist/types-ts4.5/toolbar.d.ts +6 -2
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 1.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#89386](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/89386) [`91d0fdc31828`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/91d0fdc31828) - Updates card plugin to leverage hyperlink plugins addToolbarItems action in order to inject link preferences button into the hyperlink floating toolbar. Also adds support to configure the link via card plugin options (smart links). Requires platform feature flag `platform.editor.card.inject-settings-button`.
|
|
8
|
+
|
|
9
|
+
Example usage:
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
<Editor
|
|
13
|
+
linking={{ smartLinks: { userPreferencesLink: 'https://example.com' } }}
|
|
14
|
+
{...restProps}
|
|
15
|
+
/>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 1.6.2
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -8,6 +8,8 @@ exports.mountHyperlinkPlugin = void 0;
|
|
|
8
8
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
|
+
var _toolbar = require("../toolbar");
|
|
11
13
|
var _HyperlinkToolbarAppearance = require("../ui/HyperlinkToolbarAppearance");
|
|
12
14
|
var _ToolbarViewedEvent = require("../ui/ToolbarViewedEvent");
|
|
13
15
|
var getToolbarViewedItem = function getToolbarViewedItem(link) {
|
|
@@ -56,6 +58,25 @@ var mountHyperlinkPlugin = exports.mountHyperlinkPlugin = function mountHyperlin
|
|
|
56
58
|
view: editorView,
|
|
57
59
|
skipAnalytics: true
|
|
58
60
|
});
|
|
61
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.card.inject-settings-button')) {
|
|
62
|
+
/**
|
|
63
|
+
* Require either provider to be supplied (controls link preferences)
|
|
64
|
+
* Or explicit user preferences config in order to enable button
|
|
65
|
+
*/
|
|
66
|
+
if (options.provider || options.userPreferencesLink) {
|
|
67
|
+
var _pluginInjectionApi$h2;
|
|
68
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$h2 = pluginInjectionApi.hyperlink) === null || _pluginInjectionApi$h2 === void 0 || _pluginInjectionApi$h2.actions.addToolbarItems({
|
|
69
|
+
items: function items(_, intl) {
|
|
70
|
+
var _pluginInjectionApi$a2;
|
|
71
|
+
return [{
|
|
72
|
+
type: 'separator'
|
|
73
|
+
}, (0, _toolbar.getHyperlinkToolbarSettingsButton)(intl, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions, options.userPreferencesLink)];
|
|
74
|
+
},
|
|
75
|
+
placement: 'end',
|
|
76
|
+
view: editorView
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
59
80
|
});
|
|
60
81
|
return {};
|
|
61
82
|
}
|
package/dist/cjs/toolbar.js
CHANGED
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.visitCardLink = exports.shouldRenderToolbarPulse = exports.removeCard = exports.openLinkSettings = exports.floatingToolbar = void 0;
|
|
8
|
+
exports.visitCardLink = exports.shouldRenderToolbarPulse = exports.removeCard = exports.openLinkSettings = exports.getSettingsButtonGroup = exports.getSettingsButton = exports.getHyperlinkToolbarSettingsButton = exports.floatingToolbar = void 0;
|
|
9
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -83,12 +83,12 @@ var visitCardLink = exports.visitCardLink = function visitCardLink(editorAnalyti
|
|
|
83
83
|
return true;
|
|
84
84
|
};
|
|
85
85
|
};
|
|
86
|
-
var openLinkSettings = exports.openLinkSettings = function openLinkSettings(editorAnalyticsApi) {
|
|
86
|
+
var openLinkSettings = exports.openLinkSettings = function openLinkSettings(editorAnalyticsApi, userPreferencesLink) {
|
|
87
87
|
return function (state, dispatch) {
|
|
88
88
|
if (!(state.selection instanceof _state.NodeSelection)) {
|
|
89
89
|
return false;
|
|
90
90
|
}
|
|
91
|
-
window.open((0, _link.getLinkPreferencesURLFromENV)());
|
|
91
|
+
window.open(userPreferencesLink || (0, _link.getLinkPreferencesURLFromENV)());
|
|
92
92
|
if (dispatch) {
|
|
93
93
|
var tr = state.tr,
|
|
94
94
|
type = state.selection.node.type;
|
|
@@ -255,7 +255,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
255
255
|
}, {
|
|
256
256
|
type: 'separator'
|
|
257
257
|
}]
|
|
258
|
-
}], (0, _toConsumableArray2.default)(getSettingsButtonGroup(intl, editorAnalyticsApi)), [{
|
|
258
|
+
}], (0, _toConsumableArray2.default)(getSettingsButtonGroup(intl, editorAnalyticsApi, cardOptions.userPreferencesLink)), [{
|
|
259
259
|
id: 'editor.link.delete',
|
|
260
260
|
focusEditoronEnter: true,
|
|
261
261
|
type: 'button',
|
|
@@ -355,14 +355,28 @@ var getUnlinkButtonGroup = function getUnlinkButtonGroup(state, intl, node, inli
|
|
|
355
355
|
type: 'separator'
|
|
356
356
|
}] : [];
|
|
357
357
|
};
|
|
358
|
-
var
|
|
359
|
-
return
|
|
358
|
+
var getHyperlinkToolbarSettingsButton = exports.getHyperlinkToolbarSettingsButton = function getHyperlinkToolbarSettingsButton(intl, editorAnalyticsApi, userPreferencesLink) {
|
|
359
|
+
return {
|
|
360
360
|
id: 'editor.link.settings',
|
|
361
361
|
type: 'button',
|
|
362
362
|
icon: _settings.default,
|
|
363
363
|
title: intl.formatMessage(_messages.linkToolbarMessages.settingsLink),
|
|
364
|
-
onClick: openLinkSettings(editorAnalyticsApi)
|
|
365
|
-
|
|
364
|
+
onClick: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.card.inject-settings-button') ? openLinkSettings(editorAnalyticsApi, userPreferencesLink) : openLinkSettings(editorAnalyticsApi, undefined),
|
|
365
|
+
href: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.card.inject-settings-button') ? userPreferencesLink || (0, _link.getLinkPreferencesURLFromENV)() : (0, _link.getLinkPreferencesURLFromENV)(),
|
|
366
|
+
target: '_blank'
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
var getSettingsButton = exports.getSettingsButton = function getSettingsButton(intl, editorAnalyticsApi, userPreferencesLink) {
|
|
370
|
+
return {
|
|
371
|
+
id: 'editor.link.settings',
|
|
372
|
+
type: 'button',
|
|
373
|
+
icon: _settings.default,
|
|
374
|
+
title: intl.formatMessage(_messages.linkToolbarMessages.settingsLink),
|
|
375
|
+
onClick: (0, _platformFeatureFlags.getBooleanFF)('platform.editor.card.inject-settings-button') ? openLinkSettings(editorAnalyticsApi, userPreferencesLink) : openLinkSettings(editorAnalyticsApi, undefined)
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
var getSettingsButtonGroup = exports.getSettingsButtonGroup = function getSettingsButtonGroup(intl, editorAnalyticsApi, userPreferencesLink) {
|
|
379
|
+
return [getSettingsButton(intl, editorAnalyticsApi, userPreferencesLink), {
|
|
366
380
|
type: 'separator'
|
|
367
381
|
}];
|
|
368
382
|
};
|
|
@@ -458,7 +472,7 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
|
|
|
458
472
|
}, {
|
|
459
473
|
type: 'separator'
|
|
460
474
|
}]
|
|
461
|
-
}].concat((0, _toConsumableArray2.default)(getSettingsButtonGroup(intl, editorAnalyticsApi)), [{
|
|
475
|
+
}].concat((0, _toConsumableArray2.default)(getSettingsButtonGroup(intl, editorAnalyticsApi, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.userPreferencesLink)), [{
|
|
462
476
|
id: 'editor.link.delete',
|
|
463
477
|
focusEditoronEnter: true,
|
|
464
478
|
type: 'button',
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
4
|
+
import { getHyperlinkToolbarSettingsButton } from '../toolbar';
|
|
3
5
|
import { HyperlinkToolbarAppearance } from '../ui/HyperlinkToolbarAppearance';
|
|
4
6
|
import { ToolbarViewedEvent } from '../ui/ToolbarViewedEvent';
|
|
5
7
|
const getToolbarViewedItem = link => {
|
|
@@ -44,6 +46,25 @@ export const mountHyperlinkPlugin = (pluginInjectionApi, options) => {
|
|
|
44
46
|
view: editorView,
|
|
45
47
|
skipAnalytics: true
|
|
46
48
|
});
|
|
49
|
+
if (getBooleanFF('platform.editor.card.inject-settings-button')) {
|
|
50
|
+
/**
|
|
51
|
+
* Require either provider to be supplied (controls link preferences)
|
|
52
|
+
* Or explicit user preferences config in order to enable button
|
|
53
|
+
*/
|
|
54
|
+
if (options.provider || options.userPreferencesLink) {
|
|
55
|
+
var _pluginInjectionApi$h3;
|
|
56
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$h3 = pluginInjectionApi.hyperlink) === null || _pluginInjectionApi$h3 === void 0 ? void 0 : _pluginInjectionApi$h3.actions.addToolbarItems({
|
|
57
|
+
items: (_, intl) => {
|
|
58
|
+
var _pluginInjectionApi$a2;
|
|
59
|
+
return [{
|
|
60
|
+
type: 'separator'
|
|
61
|
+
}, getHyperlinkToolbarSettingsButton(intl, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions, options.userPreferencesLink)];
|
|
62
|
+
},
|
|
63
|
+
placement: 'end',
|
|
64
|
+
view: editorView
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
}
|
|
47
68
|
});
|
|
48
69
|
return {};
|
|
49
70
|
}
|
package/dist/es2019/toolbar.js
CHANGED
|
@@ -72,11 +72,11 @@ export const visitCardLink = editorAnalyticsApi => (state, dispatch) => {
|
|
|
72
72
|
}
|
|
73
73
|
return true;
|
|
74
74
|
};
|
|
75
|
-
export const openLinkSettings = editorAnalyticsApi => (state, dispatch) => {
|
|
75
|
+
export const openLinkSettings = (editorAnalyticsApi, userPreferencesLink) => (state, dispatch) => {
|
|
76
76
|
if (!(state.selection instanceof NodeSelection)) {
|
|
77
77
|
return false;
|
|
78
78
|
}
|
|
79
|
-
window.open(getLinkPreferencesURLFromENV());
|
|
79
|
+
window.open(userPreferencesLink || getLinkPreferencesURLFromENV());
|
|
80
80
|
if (dispatch) {
|
|
81
81
|
const {
|
|
82
82
|
tr,
|
|
@@ -249,7 +249,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
249
249
|
}, {
|
|
250
250
|
type: 'separator'
|
|
251
251
|
}]
|
|
252
|
-
}, ...getSettingsButtonGroup(intl, editorAnalyticsApi), {
|
|
252
|
+
}, ...getSettingsButtonGroup(intl, editorAnalyticsApi, cardOptions.userPreferencesLink), {
|
|
253
253
|
id: 'editor.link.delete',
|
|
254
254
|
focusEditoronEnter: true,
|
|
255
255
|
type: 'button',
|
|
@@ -346,14 +346,28 @@ const getUnlinkButtonGroup = (state, intl, node, inlineCard, editorAnalyticsApi)
|
|
|
346
346
|
type: 'separator'
|
|
347
347
|
}] : [];
|
|
348
348
|
};
|
|
349
|
-
const
|
|
350
|
-
return
|
|
349
|
+
export const getHyperlinkToolbarSettingsButton = (intl, editorAnalyticsApi, userPreferencesLink) => {
|
|
350
|
+
return {
|
|
351
351
|
id: 'editor.link.settings',
|
|
352
352
|
type: 'button',
|
|
353
353
|
icon: CogIcon,
|
|
354
354
|
title: intl.formatMessage(linkToolbarMessages.settingsLink),
|
|
355
|
-
onClick: openLinkSettings(editorAnalyticsApi)
|
|
356
|
-
|
|
355
|
+
onClick: getBooleanFF('platform.editor.card.inject-settings-button') ? openLinkSettings(editorAnalyticsApi, userPreferencesLink) : openLinkSettings(editorAnalyticsApi, undefined),
|
|
356
|
+
href: getBooleanFF('platform.editor.card.inject-settings-button') ? userPreferencesLink || getLinkPreferencesURLFromENV() : getLinkPreferencesURLFromENV(),
|
|
357
|
+
target: '_blank'
|
|
358
|
+
};
|
|
359
|
+
};
|
|
360
|
+
export const getSettingsButton = (intl, editorAnalyticsApi, userPreferencesLink) => {
|
|
361
|
+
return {
|
|
362
|
+
id: 'editor.link.settings',
|
|
363
|
+
type: 'button',
|
|
364
|
+
icon: CogIcon,
|
|
365
|
+
title: intl.formatMessage(linkToolbarMessages.settingsLink),
|
|
366
|
+
onClick: getBooleanFF('platform.editor.card.inject-settings-button') ? openLinkSettings(editorAnalyticsApi, userPreferencesLink) : openLinkSettings(editorAnalyticsApi, undefined)
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
export const getSettingsButtonGroup = (intl, editorAnalyticsApi, userPreferencesLink) => {
|
|
370
|
+
return [getSettingsButton(intl, editorAnalyticsApi, userPreferencesLink), {
|
|
357
371
|
type: 'separator'
|
|
358
372
|
}];
|
|
359
373
|
};
|
|
@@ -451,7 +465,7 @@ const getDatasourceButtonGroup = (metadata, intl, editorAnalyticsApi, node, hove
|
|
|
451
465
|
}, {
|
|
452
466
|
type: 'separator'
|
|
453
467
|
}]
|
|
454
|
-
}, ...getSettingsButtonGroup(intl, editorAnalyticsApi), {
|
|
468
|
+
}, ...getSettingsButtonGroup(intl, editorAnalyticsApi, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.userPreferencesLink), {
|
|
455
469
|
id: 'editor.link.delete',
|
|
456
470
|
focusEditoronEnter: true,
|
|
457
471
|
type: 'button',
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
5
|
+
import { getHyperlinkToolbarSettingsButton } from '../toolbar';
|
|
4
6
|
import { HyperlinkToolbarAppearance } from '../ui/HyperlinkToolbarAppearance';
|
|
5
7
|
import { ToolbarViewedEvent } from '../ui/ToolbarViewedEvent';
|
|
6
8
|
var getToolbarViewedItem = function getToolbarViewedItem(link) {
|
|
@@ -49,6 +51,25 @@ export var mountHyperlinkPlugin = function mountHyperlinkPlugin(pluginInjectionA
|
|
|
49
51
|
view: editorView,
|
|
50
52
|
skipAnalytics: true
|
|
51
53
|
});
|
|
54
|
+
if (getBooleanFF('platform.editor.card.inject-settings-button')) {
|
|
55
|
+
/**
|
|
56
|
+
* Require either provider to be supplied (controls link preferences)
|
|
57
|
+
* Or explicit user preferences config in order to enable button
|
|
58
|
+
*/
|
|
59
|
+
if (options.provider || options.userPreferencesLink) {
|
|
60
|
+
var _pluginInjectionApi$h2;
|
|
61
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$h2 = pluginInjectionApi.hyperlink) === null || _pluginInjectionApi$h2 === void 0 || _pluginInjectionApi$h2.actions.addToolbarItems({
|
|
62
|
+
items: function items(_, intl) {
|
|
63
|
+
var _pluginInjectionApi$a2;
|
|
64
|
+
return [{
|
|
65
|
+
type: 'separator'
|
|
66
|
+
}, getHyperlinkToolbarSettingsButton(intl, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a2 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a2 === void 0 ? void 0 : _pluginInjectionApi$a2.actions, options.userPreferencesLink)];
|
|
67
|
+
},
|
|
68
|
+
placement: 'end',
|
|
69
|
+
view: editorView
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
52
73
|
});
|
|
53
74
|
return {};
|
|
54
75
|
}
|
package/dist/esm/toolbar.js
CHANGED
|
@@ -73,12 +73,12 @@ export var visitCardLink = function visitCardLink(editorAnalyticsApi) {
|
|
|
73
73
|
return true;
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
|
-
export var openLinkSettings = function openLinkSettings(editorAnalyticsApi) {
|
|
76
|
+
export var openLinkSettings = function openLinkSettings(editorAnalyticsApi, userPreferencesLink) {
|
|
77
77
|
return function (state, dispatch) {
|
|
78
78
|
if (!(state.selection instanceof NodeSelection)) {
|
|
79
79
|
return false;
|
|
80
80
|
}
|
|
81
|
-
window.open(getLinkPreferencesURLFromENV());
|
|
81
|
+
window.open(userPreferencesLink || getLinkPreferencesURLFromENV());
|
|
82
82
|
if (dispatch) {
|
|
83
83
|
var tr = state.tr,
|
|
84
84
|
type = state.selection.node.type;
|
|
@@ -245,7 +245,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
245
245
|
}, {
|
|
246
246
|
type: 'separator'
|
|
247
247
|
}]
|
|
248
|
-
}], _toConsumableArray(getSettingsButtonGroup(intl, editorAnalyticsApi)), [{
|
|
248
|
+
}], _toConsumableArray(getSettingsButtonGroup(intl, editorAnalyticsApi, cardOptions.userPreferencesLink)), [{
|
|
249
249
|
id: 'editor.link.delete',
|
|
250
250
|
focusEditoronEnter: true,
|
|
251
251
|
type: 'button',
|
|
@@ -345,14 +345,28 @@ var getUnlinkButtonGroup = function getUnlinkButtonGroup(state, intl, node, inli
|
|
|
345
345
|
type: 'separator'
|
|
346
346
|
}] : [];
|
|
347
347
|
};
|
|
348
|
-
var
|
|
349
|
-
return
|
|
348
|
+
export var getHyperlinkToolbarSettingsButton = function getHyperlinkToolbarSettingsButton(intl, editorAnalyticsApi, userPreferencesLink) {
|
|
349
|
+
return {
|
|
350
350
|
id: 'editor.link.settings',
|
|
351
351
|
type: 'button',
|
|
352
352
|
icon: CogIcon,
|
|
353
353
|
title: intl.formatMessage(linkToolbarMessages.settingsLink),
|
|
354
|
-
onClick: openLinkSettings(editorAnalyticsApi)
|
|
355
|
-
|
|
354
|
+
onClick: getBooleanFF('platform.editor.card.inject-settings-button') ? openLinkSettings(editorAnalyticsApi, userPreferencesLink) : openLinkSettings(editorAnalyticsApi, undefined),
|
|
355
|
+
href: getBooleanFF('platform.editor.card.inject-settings-button') ? userPreferencesLink || getLinkPreferencesURLFromENV() : getLinkPreferencesURLFromENV(),
|
|
356
|
+
target: '_blank'
|
|
357
|
+
};
|
|
358
|
+
};
|
|
359
|
+
export var getSettingsButton = function getSettingsButton(intl, editorAnalyticsApi, userPreferencesLink) {
|
|
360
|
+
return {
|
|
361
|
+
id: 'editor.link.settings',
|
|
362
|
+
type: 'button',
|
|
363
|
+
icon: CogIcon,
|
|
364
|
+
title: intl.formatMessage(linkToolbarMessages.settingsLink),
|
|
365
|
+
onClick: getBooleanFF('platform.editor.card.inject-settings-button') ? openLinkSettings(editorAnalyticsApi, userPreferencesLink) : openLinkSettings(editorAnalyticsApi, undefined)
|
|
366
|
+
};
|
|
367
|
+
};
|
|
368
|
+
export var getSettingsButtonGroup = function getSettingsButtonGroup(intl, editorAnalyticsApi, userPreferencesLink) {
|
|
369
|
+
return [getSettingsButton(intl, editorAnalyticsApi, userPreferencesLink), {
|
|
356
370
|
type: 'separator'
|
|
357
371
|
}];
|
|
358
372
|
};
|
|
@@ -448,7 +462,7 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
|
|
|
448
462
|
}, {
|
|
449
463
|
type: 'separator'
|
|
450
464
|
}]
|
|
451
|
-
}].concat(_toConsumableArray(getSettingsButtonGroup(intl, editorAnalyticsApi)), [{
|
|
465
|
+
}].concat(_toConsumableArray(getSettingsButtonGroup(intl, editorAnalyticsApi, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.userPreferencesLink)), [{
|
|
452
466
|
id: 'editor.link.delete',
|
|
453
467
|
focusEditoronEnter: true,
|
|
454
468
|
type: 'button',
|
package/dist/types/toolbar.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
1
2
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
3
|
import type { CardOptions } from '@atlaskit/editor-common/card';
|
|
3
|
-
import type { Command, ExtractInjectionAPI, FloatingToolbarHandler, LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { Command, ExtractInjectionAPI, FloatingToolbarHandler, FloatingToolbarItem, LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
4
5
|
import type { CardPlatform } from '@atlaskit/smart-card';
|
|
5
6
|
import type { cardPlugin } from './index';
|
|
6
7
|
export declare const removeCard: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
7
8
|
export declare const visitCardLink: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
8
|
-
export declare const openLinkSettings: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
9
|
+
export declare const openLinkSettings: (editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink: string | undefined) => Command;
|
|
9
10
|
export declare const floatingToolbar: (cardOptions: CardOptions, lpLinkPicker: boolean, platform?: CardPlatform, linkPickerOptions?: LinkPickerOptions, pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>, disableFloatingToolbar?: boolean) => FloatingToolbarHandler;
|
|
11
|
+
export declare const getHyperlinkToolbarSettingsButton: (intl: IntlShape, editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink?: string) => FloatingToolbarItem<Command>;
|
|
12
|
+
export declare const getSettingsButton: (intl: IntlShape, editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink: string | undefined) => FloatingToolbarItem<Command>;
|
|
13
|
+
export declare const getSettingsButtonGroup: (intl: IntlShape, editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink: string | undefined) => FloatingToolbarItem<Command>[];
|
|
10
14
|
export declare const shouldRenderToolbarPulse: (embedEnabled: boolean, appearance: string, status: string, isDiscoverabilityEnabled: boolean) => boolean;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
1
2
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
3
|
import type { CardOptions } from '@atlaskit/editor-common/card';
|
|
3
|
-
import type { Command, ExtractInjectionAPI, FloatingToolbarHandler, LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { Command, ExtractInjectionAPI, FloatingToolbarHandler, FloatingToolbarItem, LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
4
5
|
import type { CardPlatform } from '@atlaskit/smart-card';
|
|
5
6
|
import type { cardPlugin } from './index';
|
|
6
7
|
export declare const removeCard: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
7
8
|
export declare const visitCardLink: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
8
|
-
export declare const openLinkSettings: (editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
9
|
+
export declare const openLinkSettings: (editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink: string | undefined) => Command;
|
|
9
10
|
export declare const floatingToolbar: (cardOptions: CardOptions, lpLinkPicker: boolean, platform?: CardPlatform, linkPickerOptions?: LinkPickerOptions, pluginInjectionApi?: ExtractInjectionAPI<typeof cardPlugin>, disableFloatingToolbar?: boolean) => FloatingToolbarHandler;
|
|
11
|
+
export declare const getHyperlinkToolbarSettingsButton: (intl: IntlShape, editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink?: string) => FloatingToolbarItem<Command>;
|
|
12
|
+
export declare const getSettingsButton: (intl: IntlShape, editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink: string | undefined) => FloatingToolbarItem<Command>;
|
|
13
|
+
export declare const getSettingsButtonGroup: (intl: IntlShape, editorAnalyticsApi: EditorAnalyticsAPI | undefined, userPreferencesLink: string | undefined) => FloatingToolbarItem<Command>[];
|
|
10
14
|
export declare const shouldRenderToolbarPulse: (embedEnabled: boolean, appearance: string, status: string, isDiscoverabilityEnabled: boolean) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
"@atlaskit/adf-schema": "^35.8.0",
|
|
36
36
|
"@atlaskit/analytics-next": "^9.2.0",
|
|
37
37
|
"@atlaskit/custom-steps": "^0.0.17",
|
|
38
|
-
"@atlaskit/editor-common": "^78.
|
|
38
|
+
"@atlaskit/editor-common": "^78.27.0",
|
|
39
39
|
"@atlaskit/editor-plugin-analytics": "^1.0.0",
|
|
40
40
|
"@atlaskit/editor-plugin-decorations": "^1.0.0",
|
|
41
41
|
"@atlaskit/editor-plugin-feature-flags": "^1.0.0",
|
|
42
42
|
"@atlaskit/editor-plugin-floating-toolbar": "^1.2.0",
|
|
43
43
|
"@atlaskit/editor-plugin-grid": "^1.0.0",
|
|
44
|
-
"@atlaskit/editor-plugin-hyperlink": "^1.
|
|
44
|
+
"@atlaskit/editor-plugin-hyperlink": "^1.5.0",
|
|
45
45
|
"@atlaskit/editor-plugin-width": "^1.0.0",
|
|
46
46
|
"@atlaskit/editor-prosemirror": "3.0.0",
|
|
47
47
|
"@atlaskit/editor-shared-styles": "^2.9.0",
|
|
@@ -124,6 +124,9 @@
|
|
|
124
124
|
},
|
|
125
125
|
"platform.linking-platform.datasource-assets_objects_remove_beta": {
|
|
126
126
|
"type": "boolean"
|
|
127
|
+
},
|
|
128
|
+
"platform.editor.card.inject-settings-button": {
|
|
129
|
+
"type": "boolean"
|
|
127
130
|
}
|
|
128
131
|
},
|
|
129
132
|
"stricter": {
|