@atlaskit/editor-plugin-card 2.3.1 → 2.3.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 +17 -0
- package/dist/cjs/toolbar.js +14 -14
- package/dist/es2019/toolbar.js +15 -15
- package/dist/esm/toolbar.js +15 -15
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-card
|
|
2
2
|
|
|
3
|
+
## 2.3.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#116712](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116712)
|
|
8
|
+
[`1e3e81166600e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1e3e81166600e) -
|
|
9
|
+
[ux] Bump for the previous fix of the import statement
|
|
10
|
+
|
|
11
|
+
## 2.3.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#114548](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/114548)
|
|
16
|
+
[`8b2d47bffb50e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8b2d47bffb50e) -
|
|
17
|
+
bump adf-schema version
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 2.3.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/cjs/toolbar.js
CHANGED
|
@@ -24,7 +24,7 @@ var _settings = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/sett
|
|
|
24
24
|
var _unlink = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/unlink"));
|
|
25
25
|
var _shortcut = _interopRequireDefault(require("@atlaskit/icon/glyph/shortcut"));
|
|
26
26
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
27
|
-
var _doc = require("
|
|
27
|
+
var _doc = require("./pm-plugins/doc");
|
|
28
28
|
var _main = require("./pm-plugins/main");
|
|
29
29
|
var _DatasourceAppearanceButton = require("./ui/DatasourceAppearanceButton");
|
|
30
30
|
var _EditDatasourceButton = require("./ui/EditDatasourceButton");
|
|
@@ -208,7 +208,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
208
208
|
var currentAppearance = (0, _utils3.appearanceForNodeType)(node.type);
|
|
209
209
|
var _ref2 = (_pluginInjectionApi$d = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$d2 = pluginInjectionApi.decorations) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.actions) !== null && _pluginInjectionApi$d !== void 0 ? _pluginInjectionApi$d : {},
|
|
210
210
|
hoverDecoration = _ref2.hoverDecoration;
|
|
211
|
-
var isDatasource = (0, _platformFeatureFlags.
|
|
211
|
+
var isDatasource = (0, _platformFeatureFlags.fg)('platform.linking-platform.editor-datasource-typeguards') ? (0, _utils3.isDatasourceNode)(node) : currentAppearance === 'block' && (node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.datasource);
|
|
212
212
|
var shouldRenderDatasourceToolbar = isDatasource &&
|
|
213
213
|
// not showing toolbar in mobile for now since not sure what our plans are for it
|
|
214
214
|
platform !== 'mobile' && cardOptions.allowDatasource && (0, _utils.canRenderDatasource)(node === null || node === void 0 || (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 || (_node$attrs2 = _node$attrs2.datasource) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.id);
|
|
@@ -226,7 +226,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
226
226
|
return getDatasourceButtonGroup(metadata, intl, editorAnalyticsApi, node, hoverDecoration, node.attrs.datasource.id, state, cardOptions, currentAppearance, platform);
|
|
227
227
|
} else {
|
|
228
228
|
var inlineCard = state.schema.nodes.inlineCard;
|
|
229
|
-
var isEditDropdownEnabled = (0, _platformFeatureFlags.
|
|
229
|
+
var isEditDropdownEnabled = platform !== 'mobile' && cardOptions.allowDatasource && (0, _platformFeatureFlags.fg)('platform.linking-platform.enable-datasource-edit-dropdown-toolbar');
|
|
230
230
|
var editItems = isEditDropdownEnabled ? [{
|
|
231
231
|
type: 'custom',
|
|
232
232
|
fallback: [],
|
|
@@ -303,7 +303,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
303
303
|
// This code will be executed only for appearances such as "inline", "block" & "embed"
|
|
304
304
|
// For url appearance, please see HyperlinkToolbarAppearanceProps
|
|
305
305
|
if (currentAppearance) {
|
|
306
|
-
var showDatasourceAppearance = (0, _platformFeatureFlags.
|
|
306
|
+
var showDatasourceAppearance = allowDatasource && url && (0, _platformFeatureFlags.fg)('platform.linking-platform.enable-datasource-appearance-toolbar');
|
|
307
307
|
toolbarItems.unshift.apply(toolbarItems, (0, _toConsumableArray2.default)(getToolbarViewedItem(url, currentAppearance)).concat([{
|
|
308
308
|
type: 'custom',
|
|
309
309
|
fallback: [],
|
|
@@ -339,7 +339,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
339
339
|
type: 'separator'
|
|
340
340
|
}]));
|
|
341
341
|
}
|
|
342
|
-
var shouldShowDatasourceEditButton = platform !== 'mobile' && allowDatasource && !(0, _platformFeatureFlags.
|
|
342
|
+
var shouldShowDatasourceEditButton = platform !== 'mobile' && allowDatasource && !(0, _platformFeatureFlags.fg)('platform.linking-platform.enable-datasource-edit-dropdown-toolbar');
|
|
343
343
|
if (shouldShowDatasourceEditButton) {
|
|
344
344
|
toolbarItems.unshift({
|
|
345
345
|
type: 'custom',
|
|
@@ -377,8 +377,8 @@ var getHyperlinkToolbarSettingsButton = exports.getHyperlinkToolbarSettingsButto
|
|
|
377
377
|
type: 'button',
|
|
378
378
|
icon: _settings.default,
|
|
379
379
|
title: intl.formatMessage(_messages.linkToolbarMessages.settingsLink),
|
|
380
|
-
onClick: (0, _platformFeatureFlags.
|
|
381
|
-
href: (0, _platformFeatureFlags.
|
|
380
|
+
onClick: (0, _platformFeatureFlags.fg)('platform.editor.card.inject-settings-button') ? openLinkSettings(editorAnalyticsApi, userPreferencesLink) : openLinkSettings(editorAnalyticsApi, undefined),
|
|
381
|
+
href: (0, _platformFeatureFlags.fg)('platform.editor.card.inject-settings-button') ? userPreferencesLink || (0, _link.getLinkPreferencesURLFromENV)() : (0, _link.getLinkPreferencesURLFromENV)(),
|
|
382
382
|
target: '_blank'
|
|
383
383
|
};
|
|
384
384
|
};
|
|
@@ -388,7 +388,7 @@ var getSettingsButton = exports.getSettingsButton = function getSettingsButton(i
|
|
|
388
388
|
type: 'button',
|
|
389
389
|
icon: _settings.default,
|
|
390
390
|
title: intl.formatMessage(_messages.linkToolbarMessages.settingsLink),
|
|
391
|
-
onClick: (0, _platformFeatureFlags.
|
|
391
|
+
onClick: (0, _platformFeatureFlags.fg)('platform.editor.card.inject-settings-button') ? openLinkSettings(editorAnalyticsApi, userPreferencesLink) : openLinkSettings(editorAnalyticsApi, undefined)
|
|
392
392
|
};
|
|
393
393
|
};
|
|
394
394
|
var getSettingsButtonGroup = exports.getSettingsButtonGroup = function getSettingsButtonGroup(intl, editorAnalyticsApi, userPreferencesLink) {
|
|
@@ -399,7 +399,7 @@ var getSettingsButtonGroup = exports.getSettingsButtonGroup = function getSettin
|
|
|
399
399
|
var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl, editorAnalyticsApi, node, hoverDecoration, datasourceId, state, cardOptions, currentAppearance, platform) {
|
|
400
400
|
var _node$attrs3;
|
|
401
401
|
var toolbarItems = [];
|
|
402
|
-
if ((0, _utils3.isDatasourceConfigEditable)(datasourceId) && !(0, _platformFeatureFlags.
|
|
402
|
+
if ((0, _utils3.isDatasourceConfigEditable)(datasourceId) && !(0, _platformFeatureFlags.fg)('platform.linking-platform.enable-datasource-edit-dropdown-toolbar')) {
|
|
403
403
|
toolbarItems.push({
|
|
404
404
|
id: 'editor.edit.datasource',
|
|
405
405
|
type: 'button',
|
|
@@ -420,12 +420,12 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
|
|
|
420
420
|
}
|
|
421
421
|
if (
|
|
422
422
|
// FF that controls visibily of the additional toolbar buttons
|
|
423
|
-
!(0, _platformFeatureFlags.
|
|
423
|
+
!(0, _platformFeatureFlags.fg)('platform.linking-platform.enable-datasource-appearance-toolbar')) {
|
|
424
424
|
return false;
|
|
425
425
|
}
|
|
426
426
|
|
|
427
427
|
// FF to enable additional toolbar buttons based on if the datasource is configurable or not
|
|
428
|
-
return (0, _platformFeatureFlags.
|
|
428
|
+
return (0, _platformFeatureFlags.fg)('platform.linking-platform.datasource-enable-toolbar-buttons-for-all-datasources') ? true : !(0, _utils3.isDatasourceConfigEditable)(datasourceId);
|
|
429
429
|
};
|
|
430
430
|
if (canShowAppearanceSwitch()) {
|
|
431
431
|
var allowBlockCards = cardOptions.allowBlockCards,
|
|
@@ -469,7 +469,7 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
|
|
|
469
469
|
type: 'separator'
|
|
470
470
|
});
|
|
471
471
|
}
|
|
472
|
-
if ((0, _platformFeatureFlags.
|
|
472
|
+
if ((0, _platformFeatureFlags.fg)('platform.linking-platform.enable-datasource-edit-dropdown-toolbar')) {
|
|
473
473
|
toolbarItems.push({
|
|
474
474
|
type: 'custom',
|
|
475
475
|
fallback: [],
|
|
@@ -530,7 +530,7 @@ var shouldRenderToolbarPulse = exports.shouldRenderToolbarPulse = function shoul
|
|
|
530
530
|
};
|
|
531
531
|
var getStartingToolbarItems = exports.getStartingToolbarItems = function getStartingToolbarItems(options, api) {
|
|
532
532
|
return function (intl, link, providerFactory, onEditLink, metadata) {
|
|
533
|
-
var isEditDropdownEnabled = (0, _platformFeatureFlags.
|
|
533
|
+
var isEditDropdownEnabled = options.platform !== 'mobile' && options.allowDatasource && (0, _platformFeatureFlags.fg)('platform.linking-platform.enable-datasource-edit-dropdown-toolbar');
|
|
534
534
|
var editLinkItem = isEditDropdownEnabled ? [{
|
|
535
535
|
type: 'custom',
|
|
536
536
|
fallback: [],
|
|
@@ -596,7 +596,7 @@ var getStartingToolbarItems = exports.getStartingToolbarItems = function getStar
|
|
|
596
596
|
};
|
|
597
597
|
var getEndingToolbarItems = exports.getEndingToolbarItems = function getEndingToolbarItems(options, api) {
|
|
598
598
|
return function (intl, link) {
|
|
599
|
-
if ((0, _platformFeatureFlags.
|
|
599
|
+
if ((0, _platformFeatureFlags.fg)('platform.editor.card.inject-settings-button')) {
|
|
600
600
|
/**
|
|
601
601
|
* Require either provider to be supplied (controls link preferences)
|
|
602
602
|
* Or explicit user preferences config in order to enable button
|
package/dist/es2019/toolbar.js
CHANGED
|
@@ -13,8 +13,8 @@ import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
|
13
13
|
import CogIcon from '@atlaskit/icon/glyph/editor/settings';
|
|
14
14
|
import UnlinkIcon from '@atlaskit/icon/glyph/editor/unlink';
|
|
15
15
|
import OpenIcon from '@atlaskit/icon/glyph/shortcut';
|
|
16
|
-
import {
|
|
17
|
-
import { changeSelectedCardToText } from '
|
|
16
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
|
+
import { changeSelectedCardToText } from './pm-plugins/doc';
|
|
18
18
|
import { pluginKey } from './pm-plugins/main';
|
|
19
19
|
import { DatasourceAppearanceButton } from './ui/DatasourceAppearanceButton';
|
|
20
20
|
import { editDatasource, EditDatasourceButton } from './ui/EditDatasourceButton';
|
|
@@ -200,7 +200,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
200
200
|
const {
|
|
201
201
|
hoverDecoration
|
|
202
202
|
} = (_pluginInjectionApi$d = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d2 = pluginInjectionApi.decorations) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.actions) !== null && _pluginInjectionApi$d !== void 0 ? _pluginInjectionApi$d : {};
|
|
203
|
-
const isDatasource =
|
|
203
|
+
const isDatasource = fg('platform.linking-platform.editor-datasource-typeguards') ? isDatasourceNode(node) : currentAppearance === 'block' && (node === null || node === void 0 ? void 0 : (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.datasource);
|
|
204
204
|
const shouldRenderDatasourceToolbar = isDatasource &&
|
|
205
205
|
// not showing toolbar in mobile for now since not sure what our plans are for it
|
|
206
206
|
platform !== 'mobile' && cardOptions.allowDatasource && canRenderDatasource(node === null || node === void 0 ? void 0 : (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : (_node$attrs2$datasour = _node$attrs2.datasource) === null || _node$attrs2$datasour === void 0 ? void 0 : _node$attrs2$datasour.id);
|
|
@@ -220,7 +220,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
220
220
|
const {
|
|
221
221
|
inlineCard
|
|
222
222
|
} = state.schema.nodes;
|
|
223
|
-
const isEditDropdownEnabled =
|
|
223
|
+
const isEditDropdownEnabled = platform !== 'mobile' && cardOptions.allowDatasource && fg('platform.linking-platform.enable-datasource-edit-dropdown-toolbar');
|
|
224
224
|
const editItems = isEditDropdownEnabled ? [{
|
|
225
225
|
type: 'custom',
|
|
226
226
|
fallback: [],
|
|
@@ -297,7 +297,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
297
297
|
// This code will be executed only for appearances such as "inline", "block" & "embed"
|
|
298
298
|
// For url appearance, please see HyperlinkToolbarAppearanceProps
|
|
299
299
|
if (currentAppearance) {
|
|
300
|
-
const showDatasourceAppearance =
|
|
300
|
+
const showDatasourceAppearance = allowDatasource && url && fg('platform.linking-platform.enable-datasource-appearance-toolbar');
|
|
301
301
|
toolbarItems.unshift(...getToolbarViewedItem(url, currentAppearance), {
|
|
302
302
|
type: 'custom',
|
|
303
303
|
fallback: [],
|
|
@@ -329,7 +329,7 @@ const generateToolbarItems = (state, intl, providerFactory, cardOptions, lpLinkP
|
|
|
329
329
|
type: 'separator'
|
|
330
330
|
});
|
|
331
331
|
}
|
|
332
|
-
const shouldShowDatasourceEditButton = platform !== 'mobile' && allowDatasource && !
|
|
332
|
+
const shouldShowDatasourceEditButton = platform !== 'mobile' && allowDatasource && !fg('platform.linking-platform.enable-datasource-edit-dropdown-toolbar');
|
|
333
333
|
if (shouldShowDatasourceEditButton) {
|
|
334
334
|
toolbarItems.unshift({
|
|
335
335
|
type: 'custom',
|
|
@@ -364,8 +364,8 @@ export const getHyperlinkToolbarSettingsButton = (intl, editorAnalyticsApi, user
|
|
|
364
364
|
type: 'button',
|
|
365
365
|
icon: CogIcon,
|
|
366
366
|
title: intl.formatMessage(linkToolbarMessages.settingsLink),
|
|
367
|
-
onClick:
|
|
368
|
-
href:
|
|
367
|
+
onClick: fg('platform.editor.card.inject-settings-button') ? openLinkSettings(editorAnalyticsApi, userPreferencesLink) : openLinkSettings(editorAnalyticsApi, undefined),
|
|
368
|
+
href: fg('platform.editor.card.inject-settings-button') ? userPreferencesLink || getLinkPreferencesURLFromENV() : getLinkPreferencesURLFromENV(),
|
|
369
369
|
target: '_blank'
|
|
370
370
|
};
|
|
371
371
|
};
|
|
@@ -375,7 +375,7 @@ export const getSettingsButton = (intl, editorAnalyticsApi, userPreferencesLink)
|
|
|
375
375
|
type: 'button',
|
|
376
376
|
icon: CogIcon,
|
|
377
377
|
title: intl.formatMessage(linkToolbarMessages.settingsLink),
|
|
378
|
-
onClick:
|
|
378
|
+
onClick: fg('platform.editor.card.inject-settings-button') ? openLinkSettings(editorAnalyticsApi, userPreferencesLink) : openLinkSettings(editorAnalyticsApi, undefined)
|
|
379
379
|
};
|
|
380
380
|
};
|
|
381
381
|
export const getSettingsButtonGroup = (intl, editorAnalyticsApi, userPreferencesLink) => {
|
|
@@ -386,7 +386,7 @@ export const getSettingsButtonGroup = (intl, editorAnalyticsApi, userPreferences
|
|
|
386
386
|
const getDatasourceButtonGroup = (metadata, intl, editorAnalyticsApi, node, hoverDecoration, datasourceId, state, cardOptions, currentAppearance, platform) => {
|
|
387
387
|
var _node$attrs3;
|
|
388
388
|
const toolbarItems = [];
|
|
389
|
-
if (isDatasourceConfigEditable(datasourceId) && !
|
|
389
|
+
if (isDatasourceConfigEditable(datasourceId) && !fg('platform.linking-platform.enable-datasource-edit-dropdown-toolbar')) {
|
|
390
390
|
toolbarItems.push({
|
|
391
391
|
id: 'editor.edit.datasource',
|
|
392
392
|
type: 'button',
|
|
@@ -407,12 +407,12 @@ const getDatasourceButtonGroup = (metadata, intl, editorAnalyticsApi, node, hove
|
|
|
407
407
|
}
|
|
408
408
|
if (
|
|
409
409
|
// FF that controls visibily of the additional toolbar buttons
|
|
410
|
-
!
|
|
410
|
+
!fg('platform.linking-platform.enable-datasource-appearance-toolbar')) {
|
|
411
411
|
return false;
|
|
412
412
|
}
|
|
413
413
|
|
|
414
414
|
// FF to enable additional toolbar buttons based on if the datasource is configurable or not
|
|
415
|
-
return
|
|
415
|
+
return fg('platform.linking-platform.datasource-enable-toolbar-buttons-for-all-datasources') ? true : !isDatasourceConfigEditable(datasourceId);
|
|
416
416
|
};
|
|
417
417
|
if (canShowAppearanceSwitch()) {
|
|
418
418
|
const {
|
|
@@ -458,7 +458,7 @@ const getDatasourceButtonGroup = (metadata, intl, editorAnalyticsApi, node, hove
|
|
|
458
458
|
type: 'separator'
|
|
459
459
|
});
|
|
460
460
|
}
|
|
461
|
-
if (
|
|
461
|
+
if (fg('platform.linking-platform.enable-datasource-edit-dropdown-toolbar')) {
|
|
462
462
|
toolbarItems.push({
|
|
463
463
|
type: 'custom',
|
|
464
464
|
fallback: [],
|
|
@@ -517,7 +517,7 @@ export const shouldRenderToolbarPulse = (embedEnabled, appearance, status, isDis
|
|
|
517
517
|
};
|
|
518
518
|
export const getStartingToolbarItems = (options, api) => {
|
|
519
519
|
return (intl, link, providerFactory, onEditLink, metadata) => {
|
|
520
|
-
const isEditDropdownEnabled =
|
|
520
|
+
const isEditDropdownEnabled = options.platform !== 'mobile' && options.allowDatasource && fg('platform.linking-platform.enable-datasource-edit-dropdown-toolbar');
|
|
521
521
|
const editLinkItem = isEditDropdownEnabled ? [{
|
|
522
522
|
type: 'custom',
|
|
523
523
|
fallback: [],
|
|
@@ -580,7 +580,7 @@ export const getStartingToolbarItems = (options, api) => {
|
|
|
580
580
|
};
|
|
581
581
|
};
|
|
582
582
|
export const getEndingToolbarItems = (options, api) => (intl, link) => {
|
|
583
|
-
if (
|
|
583
|
+
if (fg('platform.editor.card.inject-settings-button')) {
|
|
584
584
|
/**
|
|
585
585
|
* Require either provider to be supplied (controls link preferences)
|
|
586
586
|
* Or explicit user preferences config in order to enable button
|
package/dist/esm/toolbar.js
CHANGED
|
@@ -17,8 +17,8 @@ import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
|
|
|
17
17
|
import CogIcon from '@atlaskit/icon/glyph/editor/settings';
|
|
18
18
|
import UnlinkIcon from '@atlaskit/icon/glyph/editor/unlink';
|
|
19
19
|
import OpenIcon from '@atlaskit/icon/glyph/shortcut';
|
|
20
|
-
import {
|
|
21
|
-
import { changeSelectedCardToText } from '
|
|
20
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
21
|
+
import { changeSelectedCardToText } from './pm-plugins/doc';
|
|
22
22
|
import { pluginKey } from './pm-plugins/main';
|
|
23
23
|
import { DatasourceAppearanceButton } from './ui/DatasourceAppearanceButton';
|
|
24
24
|
import { editDatasource, EditDatasourceButton } from './ui/EditDatasourceButton';
|
|
@@ -198,7 +198,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
198
198
|
var currentAppearance = appearanceForNodeType(node.type);
|
|
199
199
|
var _ref2 = (_pluginInjectionApi$d = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$d2 = pluginInjectionApi.decorations) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.actions) !== null && _pluginInjectionApi$d !== void 0 ? _pluginInjectionApi$d : {},
|
|
200
200
|
hoverDecoration = _ref2.hoverDecoration;
|
|
201
|
-
var isDatasource =
|
|
201
|
+
var isDatasource = fg('platform.linking-platform.editor-datasource-typeguards') ? isDatasourceNode(node) : currentAppearance === 'block' && (node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.datasource);
|
|
202
202
|
var shouldRenderDatasourceToolbar = isDatasource &&
|
|
203
203
|
// not showing toolbar in mobile for now since not sure what our plans are for it
|
|
204
204
|
platform !== 'mobile' && cardOptions.allowDatasource && canRenderDatasource(node === null || node === void 0 || (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 || (_node$attrs2 = _node$attrs2.datasource) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.id);
|
|
@@ -216,7 +216,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
216
216
|
return getDatasourceButtonGroup(metadata, intl, editorAnalyticsApi, node, hoverDecoration, node.attrs.datasource.id, state, cardOptions, currentAppearance, platform);
|
|
217
217
|
} else {
|
|
218
218
|
var inlineCard = state.schema.nodes.inlineCard;
|
|
219
|
-
var isEditDropdownEnabled =
|
|
219
|
+
var isEditDropdownEnabled = platform !== 'mobile' && cardOptions.allowDatasource && fg('platform.linking-platform.enable-datasource-edit-dropdown-toolbar');
|
|
220
220
|
var editItems = isEditDropdownEnabled ? [{
|
|
221
221
|
type: 'custom',
|
|
222
222
|
fallback: [],
|
|
@@ -293,7 +293,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
293
293
|
// This code will be executed only for appearances such as "inline", "block" & "embed"
|
|
294
294
|
// For url appearance, please see HyperlinkToolbarAppearanceProps
|
|
295
295
|
if (currentAppearance) {
|
|
296
|
-
var showDatasourceAppearance =
|
|
296
|
+
var showDatasourceAppearance = allowDatasource && url && fg('platform.linking-platform.enable-datasource-appearance-toolbar');
|
|
297
297
|
toolbarItems.unshift.apply(toolbarItems, _toConsumableArray(getToolbarViewedItem(url, currentAppearance)).concat([{
|
|
298
298
|
type: 'custom',
|
|
299
299
|
fallback: [],
|
|
@@ -329,7 +329,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
329
329
|
type: 'separator'
|
|
330
330
|
}]));
|
|
331
331
|
}
|
|
332
|
-
var shouldShowDatasourceEditButton = platform !== 'mobile' && allowDatasource && !
|
|
332
|
+
var shouldShowDatasourceEditButton = platform !== 'mobile' && allowDatasource && !fg('platform.linking-platform.enable-datasource-edit-dropdown-toolbar');
|
|
333
333
|
if (shouldShowDatasourceEditButton) {
|
|
334
334
|
toolbarItems.unshift({
|
|
335
335
|
type: 'custom',
|
|
@@ -367,8 +367,8 @@ export var getHyperlinkToolbarSettingsButton = function getHyperlinkToolbarSetti
|
|
|
367
367
|
type: 'button',
|
|
368
368
|
icon: CogIcon,
|
|
369
369
|
title: intl.formatMessage(linkToolbarMessages.settingsLink),
|
|
370
|
-
onClick:
|
|
371
|
-
href:
|
|
370
|
+
onClick: fg('platform.editor.card.inject-settings-button') ? openLinkSettings(editorAnalyticsApi, userPreferencesLink) : openLinkSettings(editorAnalyticsApi, undefined),
|
|
371
|
+
href: fg('platform.editor.card.inject-settings-button') ? userPreferencesLink || getLinkPreferencesURLFromENV() : getLinkPreferencesURLFromENV(),
|
|
372
372
|
target: '_blank'
|
|
373
373
|
};
|
|
374
374
|
};
|
|
@@ -378,7 +378,7 @@ export var getSettingsButton = function getSettingsButton(intl, editorAnalyticsA
|
|
|
378
378
|
type: 'button',
|
|
379
379
|
icon: CogIcon,
|
|
380
380
|
title: intl.formatMessage(linkToolbarMessages.settingsLink),
|
|
381
|
-
onClick:
|
|
381
|
+
onClick: fg('platform.editor.card.inject-settings-button') ? openLinkSettings(editorAnalyticsApi, userPreferencesLink) : openLinkSettings(editorAnalyticsApi, undefined)
|
|
382
382
|
};
|
|
383
383
|
};
|
|
384
384
|
export var getSettingsButtonGroup = function getSettingsButtonGroup(intl, editorAnalyticsApi, userPreferencesLink) {
|
|
@@ -389,7 +389,7 @@ export var getSettingsButtonGroup = function getSettingsButtonGroup(intl, editor
|
|
|
389
389
|
var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl, editorAnalyticsApi, node, hoverDecoration, datasourceId, state, cardOptions, currentAppearance, platform) {
|
|
390
390
|
var _node$attrs3;
|
|
391
391
|
var toolbarItems = [];
|
|
392
|
-
if (isDatasourceConfigEditable(datasourceId) && !
|
|
392
|
+
if (isDatasourceConfigEditable(datasourceId) && !fg('platform.linking-platform.enable-datasource-edit-dropdown-toolbar')) {
|
|
393
393
|
toolbarItems.push({
|
|
394
394
|
id: 'editor.edit.datasource',
|
|
395
395
|
type: 'button',
|
|
@@ -410,12 +410,12 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
|
|
|
410
410
|
}
|
|
411
411
|
if (
|
|
412
412
|
// FF that controls visibily of the additional toolbar buttons
|
|
413
|
-
!
|
|
413
|
+
!fg('platform.linking-platform.enable-datasource-appearance-toolbar')) {
|
|
414
414
|
return false;
|
|
415
415
|
}
|
|
416
416
|
|
|
417
417
|
// FF to enable additional toolbar buttons based on if the datasource is configurable or not
|
|
418
|
-
return
|
|
418
|
+
return fg('platform.linking-platform.datasource-enable-toolbar-buttons-for-all-datasources') ? true : !isDatasourceConfigEditable(datasourceId);
|
|
419
419
|
};
|
|
420
420
|
if (canShowAppearanceSwitch()) {
|
|
421
421
|
var allowBlockCards = cardOptions.allowBlockCards,
|
|
@@ -459,7 +459,7 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
|
|
|
459
459
|
type: 'separator'
|
|
460
460
|
});
|
|
461
461
|
}
|
|
462
|
-
if (
|
|
462
|
+
if (fg('platform.linking-platform.enable-datasource-edit-dropdown-toolbar')) {
|
|
463
463
|
toolbarItems.push({
|
|
464
464
|
type: 'custom',
|
|
465
465
|
fallback: [],
|
|
@@ -520,7 +520,7 @@ export var shouldRenderToolbarPulse = function shouldRenderToolbarPulse(embedEna
|
|
|
520
520
|
};
|
|
521
521
|
export var getStartingToolbarItems = function getStartingToolbarItems(options, api) {
|
|
522
522
|
return function (intl, link, providerFactory, onEditLink, metadata) {
|
|
523
|
-
var isEditDropdownEnabled =
|
|
523
|
+
var isEditDropdownEnabled = options.platform !== 'mobile' && options.allowDatasource && fg('platform.linking-platform.enable-datasource-edit-dropdown-toolbar');
|
|
524
524
|
var editLinkItem = isEditDropdownEnabled ? [{
|
|
525
525
|
type: 'custom',
|
|
526
526
|
fallback: [],
|
|
@@ -586,7 +586,7 @@ export var getStartingToolbarItems = function getStartingToolbarItems(options, a
|
|
|
586
586
|
};
|
|
587
587
|
export var getEndingToolbarItems = function getEndingToolbarItems(options, api) {
|
|
588
588
|
return function (intl, link) {
|
|
589
|
-
if (
|
|
589
|
+
if (fg('platform.editor.card.inject-settings-button')) {
|
|
590
590
|
/**
|
|
591
591
|
* Require either provider to be supplied (controls link preferences)
|
|
592
592
|
* Or explicit user preferences config in order to enable button
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-card",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.3",
|
|
4
4
|
"description": "Card plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,12 +32,12 @@
|
|
|
32
32
|
".": "./src/index.ts"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@atlaskit/adf-schema": "^
|
|
35
|
+
"@atlaskit/adf-schema": "^39.0.3",
|
|
36
36
|
"@atlaskit/analytics-next": "^9.3.0",
|
|
37
|
-
"@atlaskit/button": "^18.
|
|
37
|
+
"@atlaskit/button": "^18.1.0",
|
|
38
38
|
"@atlaskit/custom-steps": "^0.4.0",
|
|
39
39
|
"@atlaskit/dropdown-menu": "^12.13.0",
|
|
40
|
-
"@atlaskit/editor-common": "^83.
|
|
40
|
+
"@atlaskit/editor-common": "^83.6.0",
|
|
41
41
|
"@atlaskit/editor-plugin-analytics": "^1.4.0",
|
|
42
42
|
"@atlaskit/editor-plugin-decorations": "^1.1.0",
|
|
43
43
|
"@atlaskit/editor-plugin-editor-disabled": "^1.1.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@atlaskit/link-datasource": "^2.5.0",
|
|
56
56
|
"@atlaskit/linking-common": "^5.7.0",
|
|
57
57
|
"@atlaskit/linking-types": "^8.9.0",
|
|
58
|
-
"@atlaskit/menu": "2.6.
|
|
58
|
+
"@atlaskit/menu": "2.6.2",
|
|
59
59
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
60
60
|
"@atlaskit/primitives": "^10.0.0",
|
|
61
61
|
"@atlaskit/smart-card": "^27.8.0",
|