@atlaskit/editor-plugin-card 8.0.1 → 8.1.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 +13 -0
- package/dist/cjs/ui/DatasourceAppearanceButton.js +8 -4
- package/dist/cjs/ui/EditToolbarButton/EditToolbarButtonPresentation.js +20 -12
- package/dist/cjs/ui/EditToolbarButton/index.js +33 -15
- package/dist/cjs/ui/HyperlinkToolbarAppearance.js +10 -4
- package/dist/cjs/ui/HyperlinkToolbarAppearanceDropdown.js +11 -6
- package/dist/cjs/ui/LinkToolbarAppearance.js +3 -2
- package/dist/cjs/ui/LinkToolbarAppearanceDropdown.js +4 -2
- package/dist/cjs/ui/OpenPreviewButton/index.js +6 -5
- package/dist/cjs/ui/toolbar.js +44 -32
- package/dist/es2019/ui/DatasourceAppearanceButton.js +8 -4
- package/dist/es2019/ui/EditToolbarButton/EditToolbarButtonPresentation.js +20 -12
- package/dist/es2019/ui/EditToolbarButton/index.js +33 -15
- package/dist/es2019/ui/HyperlinkToolbarAppearance.js +10 -4
- package/dist/es2019/ui/HyperlinkToolbarAppearanceDropdown.js +11 -6
- package/dist/es2019/ui/LinkToolbarAppearance.js +3 -2
- package/dist/es2019/ui/LinkToolbarAppearanceDropdown.js +4 -2
- package/dist/es2019/ui/OpenPreviewButton/index.js +6 -5
- package/dist/es2019/ui/toolbar.js +44 -32
- package/dist/esm/ui/DatasourceAppearanceButton.js +8 -4
- package/dist/esm/ui/EditToolbarButton/EditToolbarButtonPresentation.js +20 -12
- package/dist/esm/ui/EditToolbarButton/index.js +33 -15
- package/dist/esm/ui/HyperlinkToolbarAppearance.js +10 -4
- package/dist/esm/ui/HyperlinkToolbarAppearanceDropdown.js +11 -6
- package/dist/esm/ui/LinkToolbarAppearance.js +3 -2
- package/dist/esm/ui/LinkToolbarAppearanceDropdown.js +4 -2
- package/dist/esm/ui/OpenPreviewButton/index.js +6 -5
- package/dist/esm/ui/toolbar.js +44 -32
- package/dist/types/cardPluginType.d.ts +3 -1
- package/dist/types/ui/DatasourceAppearanceButton.d.ts +2 -1
- package/dist/types/ui/EditToolbarButton/EditToolbarButtonPresentation.d.ts +1 -1
- package/dist/types/ui/EditToolbarButton/types.d.ts +1 -0
- package/dist/types/ui/LinkToolbarAppearance.d.ts +1 -0
- package/dist/types/ui/LinkToolbarAppearanceDropdown.d.ts +1 -1
- package/dist/types/ui/OpenPreviewButton/index.d.ts +2 -1
- package/dist/types-ts4.5/cardPluginType.d.ts +3 -1
- package/dist/types-ts4.5/ui/DatasourceAppearanceButton.d.ts +2 -1
- package/dist/types-ts4.5/ui/EditToolbarButton/EditToolbarButtonPresentation.d.ts +1 -1
- package/dist/types-ts4.5/ui/EditToolbarButton/types.d.ts +1 -0
- package/dist/types-ts4.5/ui/LinkToolbarAppearance.d.ts +1 -0
- package/dist/types-ts4.5/ui/LinkToolbarAppearanceDropdown.d.ts +1 -1
- package/dist/types-ts4.5/ui/OpenPreviewButton/index.d.ts +2 -1
- package/package.json +9 -8
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -176,8 +176,8 @@ var unlinkCard = function unlinkCard(node, state, editorAnalyticsApi) {
|
|
|
176
176
|
return false;
|
|
177
177
|
};
|
|
178
178
|
};
|
|
179
|
-
var buildAlignmentOptions = function buildAlignmentOptions(state, intl, widthPluginDependencyApi, analyticsApi, cardOptions) {
|
|
180
|
-
if (
|
|
179
|
+
var buildAlignmentOptions = function buildAlignmentOptions(state, intl, widthPluginDependencyApi, analyticsApi, cardOptions, areAnyNewToolbarFlagsEnabled) {
|
|
180
|
+
if (areAnyNewToolbarFlagsEnabled) {
|
|
181
181
|
return (0, _card.buildLayoutDropdown)(state, intl, state.schema.nodes.embedCard, widthPluginDependencyApi, analyticsApi, true, true, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowWrapping, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowAlignment);
|
|
182
182
|
}
|
|
183
183
|
return (0, _card.buildLayoutButtons)(state, intl, state.schema.nodes.embedCard, widthPluginDependencyApi, analyticsApi, true, true, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowWrapping, cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowAlignment);
|
|
@@ -222,7 +222,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
222
222
|
title: title
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
|
-
var
|
|
225
|
+
var areAllNewToolbarFlagsDisabled = !(0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar));
|
|
226
226
|
var currentAppearance = (0, _utils3.appearanceForNodeType)(node.type);
|
|
227
227
|
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 : {},
|
|
228
228
|
hoverDecoration = _ref2.hoverDecoration;
|
|
@@ -278,7 +278,8 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
278
278
|
editorAnalyticsApi: editorAnalyticsApi,
|
|
279
279
|
editorView: editorView,
|
|
280
280
|
onLinkEditClick: (0, _EditLinkToolbar.getEditLinkCallback)(editorAnalyticsApi, true),
|
|
281
|
-
currentAppearance: currentAppearance
|
|
281
|
+
currentAppearance: currentAppearance,
|
|
282
|
+
areAnyNewToolbarFlagsEnabled: !areAllNewToolbarFlagsDisabled
|
|
282
283
|
});
|
|
283
284
|
}
|
|
284
285
|
}] : [{
|
|
@@ -318,7 +319,8 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
318
319
|
editorAnalyticsApi: editorAnalyticsApi,
|
|
319
320
|
editorView: editorView,
|
|
320
321
|
onLinkEditClick: (0, _EditLinkToolbar.getEditLinkCallback)(editorAnalyticsApi, true),
|
|
321
|
-
currentAppearance: currentAppearance
|
|
322
|
+
currentAppearance: currentAppearance,
|
|
323
|
+
areAnyNewToolbarFlagsEnabled: !areAllNewToolbarFlagsDisabled
|
|
322
324
|
});
|
|
323
325
|
}
|
|
324
326
|
}] : [{
|
|
@@ -340,11 +342,12 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
340
342
|
return /*#__PURE__*/_react.default.createElement(_OpenPreviewButton.OpenPreviewPanelToolbarButton, {
|
|
341
343
|
node: node,
|
|
342
344
|
intl: intl,
|
|
343
|
-
editorAnalyticsApi: editorAnalyticsApi
|
|
345
|
+
editorAnalyticsApi: editorAnalyticsApi,
|
|
346
|
+
areAnyNewToolbarFlagsEnabled: !areAllNewToolbarFlagsDisabled
|
|
344
347
|
});
|
|
345
348
|
}
|
|
346
349
|
}] : [];
|
|
347
|
-
var toolbarItems =
|
|
350
|
+
var toolbarItems = areAllNewToolbarFlagsDisabled ? [].concat(editItems, commentItems, openPreviewPanelItems, [{
|
|
348
351
|
id: 'editor.link.openLink',
|
|
349
352
|
type: 'button',
|
|
350
353
|
icon: _linkExternal.default,
|
|
@@ -357,7 +360,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
357
360
|
target: '_blank'
|
|
358
361
|
}, {
|
|
359
362
|
type: 'separator'
|
|
360
|
-
}], (0, _toConsumableArray2.default)(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
363
|
+
}], (0, _toConsumableArray2.default)(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi, !areAllNewToolbarFlagsDisabled)), [{
|
|
361
364
|
type: 'copy-button',
|
|
362
365
|
items: [{
|
|
363
366
|
state: state,
|
|
@@ -381,10 +384,10 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
381
384
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(node.type, false),
|
|
382
385
|
title: intl.formatMessage(_messages.default.remove),
|
|
383
386
|
onClick: withToolbarMetadata(removeCard(editorAnalyticsApi))
|
|
384
|
-
}]) : [].concat(openPreviewPanelItems, editButtonItems, (0, _toConsumableArray2.default)((0, _platformFeatureFlags.fg)('platform_editor_controls_patch_15') ? [].concat((0, _toConsumableArray2.default)(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
387
|
+
}]) : [].concat(openPreviewPanelItems, editButtonItems, (0, _toConsumableArray2.default)((0, _platformFeatureFlags.fg)('platform_editor_controls_patch_15') ? [].concat((0, _toConsumableArray2.default)(getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi, !areAllNewToolbarFlagsDisabled)), [{
|
|
385
388
|
type: 'separator',
|
|
386
389
|
fullHeight: true
|
|
387
|
-
}]) : getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi)), [{
|
|
390
|
+
}]) : getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi, !areAllNewToolbarFlagsDisabled)), [{
|
|
388
391
|
id: 'editor.link.openLink',
|
|
389
392
|
type: 'button',
|
|
390
393
|
icon: _linkExternal.default,
|
|
@@ -401,8 +404,8 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
401
404
|
}, commentItems[0]] : commentItems));
|
|
402
405
|
if (currentAppearance === 'embed') {
|
|
403
406
|
var _pluginInjectionApi$a4;
|
|
404
|
-
var alignmentOptions = buildAlignmentOptions(state, intl, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.width, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions, cardOptions);
|
|
405
|
-
if (alignmentOptions.length &&
|
|
407
|
+
var alignmentOptions = buildAlignmentOptions(state, intl, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.width, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions, cardOptions, !areAllNewToolbarFlagsDisabled);
|
|
408
|
+
if (alignmentOptions.length && areAllNewToolbarFlagsDisabled) {
|
|
406
409
|
alignmentOptions.push({
|
|
407
410
|
type: 'separator'
|
|
408
411
|
});
|
|
@@ -417,7 +420,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
417
420
|
// For url appearance, please see HyperlinkToolbarAppearanceProps
|
|
418
421
|
if (currentAppearance) {
|
|
419
422
|
var showDatasourceAppearance = allowDatasource && url;
|
|
420
|
-
toolbarItems.unshift.apply(toolbarItems, (0, _toConsumableArray2.default)(getToolbarViewedItem(url, currentAppearance)).concat([
|
|
423
|
+
toolbarItems.unshift.apply(toolbarItems, (0, _toConsumableArray2.default)(getToolbarViewedItem(url, currentAppearance)).concat([areAllNewToolbarFlagsDisabled ? {
|
|
421
424
|
type: 'custom',
|
|
422
425
|
fallback: [],
|
|
423
426
|
render: function render(editorView) {
|
|
@@ -431,7 +434,8 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
431
434
|
allowEmbeds: allowEmbeds,
|
|
432
435
|
allowBlockCards: allowBlockCards,
|
|
433
436
|
editorAnalyticsApi: editorAnalyticsApi,
|
|
434
|
-
showUpgradeDiscoverability: showUpgradeDiscoverability
|
|
437
|
+
showUpgradeDiscoverability: showUpgradeDiscoverability,
|
|
438
|
+
areAnyNewToolbarFlagsEnabled: false
|
|
435
439
|
});
|
|
436
440
|
}
|
|
437
441
|
} : (0, _LinkToolbarAppearanceDropdown.getLinkAppearanceDropdown)({
|
|
@@ -445,8 +449,9 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
445
449
|
allowDatasource: cardOptions.allowDatasource,
|
|
446
450
|
showUpgradeDiscoverability: showUpgradeDiscoverability,
|
|
447
451
|
settingsConfig: getSettingsButton(intl, editorAnalyticsApi, cardOptions.userPreferencesLink),
|
|
448
|
-
isDatasourceView: isDatasource
|
|
449
|
-
|
|
452
|
+
isDatasourceView: isDatasource,
|
|
453
|
+
areAnyNewToolbarFlagsEnabled: !areAllNewToolbarFlagsDisabled
|
|
454
|
+
})], (0, _toConsumableArray2.default)(showDatasourceAppearance && areAllNewToolbarFlagsDisabled ? [{
|
|
450
455
|
type: 'custom',
|
|
451
456
|
fallback: [],
|
|
452
457
|
render: function render(editorView) {
|
|
@@ -456,14 +461,15 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
456
461
|
url: url,
|
|
457
462
|
editorView: editorView,
|
|
458
463
|
editorState: state,
|
|
459
|
-
inputMethod: _analytics.INPUT_METHOD.FLOATING_TB
|
|
464
|
+
inputMethod: _analytics.INPUT_METHOD.FLOATING_TB,
|
|
465
|
+
areAnyNewToolbarFlagsEnabled: !areAllNewToolbarFlagsDisabled
|
|
460
466
|
});
|
|
461
467
|
}
|
|
462
|
-
}] : []), (0, _toConsumableArray2.default)(!
|
|
468
|
+
}] : []), (0, _toConsumableArray2.default)(!areAllNewToolbarFlagsDisabled ? [] : [{
|
|
463
469
|
type: 'separator'
|
|
464
470
|
}])));
|
|
465
471
|
}
|
|
466
|
-
if (!
|
|
472
|
+
if (!areAllNewToolbarFlagsDisabled) {
|
|
467
473
|
var hoverDecorationProps = function hoverDecorationProps(nodeType, className) {
|
|
468
474
|
return {
|
|
469
475
|
onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true, className),
|
|
@@ -506,7 +512,7 @@ var generateToolbarItems = function generateToolbarItems(state, intl, providerFa
|
|
|
506
512
|
}
|
|
507
513
|
};
|
|
508
514
|
};
|
|
509
|
-
var getUnlinkButtonGroup = function getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi) {
|
|
515
|
+
var getUnlinkButtonGroup = function getUnlinkButtonGroup(state, intl, node, inlineCard, editorAnalyticsApi, areAnyNewToolbarFlagsEnabled) {
|
|
510
516
|
return node.type === inlineCard ? [{
|
|
511
517
|
id: 'editor.link.unlink',
|
|
512
518
|
focusEditoronEnter: true,
|
|
@@ -515,7 +521,7 @@ var getUnlinkButtonGroup = function getUnlinkButtonGroup(state, intl, node, inli
|
|
|
515
521
|
icon: _linkBroken.default,
|
|
516
522
|
iconFallback: _linkBrokenEditorUnlink.default,
|
|
517
523
|
onClick: withToolbarMetadata(unlinkCard(node, state, editorAnalyticsApi))
|
|
518
|
-
}].concat((0, _toConsumableArray2.default)(
|
|
524
|
+
}].concat((0, _toConsumableArray2.default)(areAnyNewToolbarFlagsEnabled ? [] : [{
|
|
519
525
|
type: 'separator'
|
|
520
526
|
}])) : [];
|
|
521
527
|
};
|
|
@@ -534,7 +540,7 @@ var getSettingsButton = exports.getSettingsButton = function getSettingsButton(i
|
|
|
534
540
|
var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl, editorAnalyticsApi, node, hoverDecoration, datasourceId, state, cardOptions, currentAppearance, pluginInjectionApi) {
|
|
535
541
|
var _node$attrs2;
|
|
536
542
|
var toolbarItems = [];
|
|
537
|
-
var
|
|
543
|
+
var areAllNewToolbarFlagsDisabled = !(0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar));
|
|
538
544
|
var canShowAppearanceSwitch = function canShowAppearanceSwitch() {
|
|
539
545
|
// we do not show smart-link or the datasource icons when the node does not have a url to resolve
|
|
540
546
|
if (!metadata.url) {
|
|
@@ -547,7 +553,7 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
|
|
|
547
553
|
allowEmbeds = cardOptions.allowEmbeds,
|
|
548
554
|
showUpgradeDiscoverability = cardOptions.showUpgradeDiscoverability;
|
|
549
555
|
var url = metadata.url;
|
|
550
|
-
if (
|
|
556
|
+
if (areAllNewToolbarFlagsDisabled) {
|
|
551
557
|
toolbarItems.push({
|
|
552
558
|
type: 'custom',
|
|
553
559
|
fallback: [],
|
|
@@ -563,7 +569,8 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
|
|
|
563
569
|
allowBlockCards: allowBlockCards,
|
|
564
570
|
editorAnalyticsApi: editorAnalyticsApi,
|
|
565
571
|
showUpgradeDiscoverability: showUpgradeDiscoverability,
|
|
566
|
-
isDatasourceView: true
|
|
572
|
+
isDatasourceView: true,
|
|
573
|
+
areAnyNewToolbarFlagsEnabled: false
|
|
567
574
|
});
|
|
568
575
|
}
|
|
569
576
|
}, {
|
|
@@ -577,7 +584,8 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
|
|
|
577
584
|
editorView: editorView,
|
|
578
585
|
editorState: state,
|
|
579
586
|
selected: true,
|
|
580
|
-
inputMethod: _analytics.INPUT_METHOD.FLOATING_TB
|
|
587
|
+
inputMethod: _analytics.INPUT_METHOD.FLOATING_TB,
|
|
588
|
+
areAnyNewToolbarFlagsEnabled: !areAllNewToolbarFlagsDisabled
|
|
581
589
|
});
|
|
582
590
|
}
|
|
583
591
|
}, {
|
|
@@ -595,7 +603,8 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
|
|
|
595
603
|
allowDatasource: cardOptions.allowDatasource,
|
|
596
604
|
showUpgradeDiscoverability: showUpgradeDiscoverability,
|
|
597
605
|
settingsConfig: getSettingsButton(intl, editorAnalyticsApi, cardOptions.userPreferencesLink),
|
|
598
|
-
isDatasourceView: true
|
|
606
|
+
isDatasourceView: true,
|
|
607
|
+
areAnyNewToolbarFlagsEnabled: !areAllNewToolbarFlagsDisabled
|
|
599
608
|
}), {
|
|
600
609
|
type: 'separator'
|
|
601
610
|
});
|
|
@@ -615,7 +624,8 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
|
|
|
615
624
|
editorAnalyticsApi: editorAnalyticsApi,
|
|
616
625
|
editorView: editorView,
|
|
617
626
|
onLinkEditClick: (0, _EditLinkToolbar.getEditLinkCallback)(editorAnalyticsApi, false),
|
|
618
|
-
currentAppearance: "datasource"
|
|
627
|
+
currentAppearance: "datasource",
|
|
628
|
+
areAnyNewToolbarFlagsEnabled: !areAllNewToolbarFlagsDisabled
|
|
619
629
|
});
|
|
620
630
|
}
|
|
621
631
|
});
|
|
@@ -632,13 +642,13 @@ var getDatasourceButtonGroup = function getDatasourceButtonGroup(metadata, intl,
|
|
|
632
642
|
href: node.attrs.url,
|
|
633
643
|
target: '_blank'
|
|
634
644
|
});
|
|
635
|
-
if (
|
|
645
|
+
if (areAllNewToolbarFlagsDisabled) {
|
|
636
646
|
toolbarItems.push({
|
|
637
647
|
type: 'separator'
|
|
638
648
|
});
|
|
639
649
|
}
|
|
640
650
|
}
|
|
641
|
-
if (
|
|
651
|
+
if (areAllNewToolbarFlagsDisabled) {
|
|
642
652
|
toolbarItems.push({
|
|
643
653
|
type: 'copy-button',
|
|
644
654
|
supportsViewMode: true,
|
|
@@ -726,6 +736,7 @@ var shouldRenderToolbarPulse = exports.shouldRenderToolbarPulse = function shoul
|
|
|
726
736
|
};
|
|
727
737
|
var getStartingToolbarItems = exports.getStartingToolbarItems = function getStartingToolbarItems(options, api) {
|
|
728
738
|
return function (intl, link, onEditLink, metadata, state) {
|
|
739
|
+
var areAllNewToolbarFlagsDisabled = !(0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
|
|
729
740
|
var editLinkItem = options.allowDatasource ? [{
|
|
730
741
|
type: 'custom',
|
|
731
742
|
fallback: [],
|
|
@@ -741,7 +752,8 @@ var getStartingToolbarItems = exports.getStartingToolbarItems = function getStar
|
|
|
741
752
|
url: link,
|
|
742
753
|
editorView: editorView,
|
|
743
754
|
onLinkEditClick: onEditLink,
|
|
744
|
-
currentAppearance: "url"
|
|
755
|
+
currentAppearance: "url",
|
|
756
|
+
areAnyNewToolbarFlagsEnabled: !areAllNewToolbarFlagsDisabled
|
|
745
757
|
});
|
|
746
758
|
}
|
|
747
759
|
}] : [{
|
|
@@ -756,7 +768,7 @@ var getStartingToolbarItems = exports.getStartingToolbarItems = function getStar
|
|
|
756
768
|
}, {
|
|
757
769
|
type: 'separator'
|
|
758
770
|
}];
|
|
759
|
-
if (
|
|
771
|
+
if (!areAllNewToolbarFlagsDisabled) {
|
|
760
772
|
var _api$analytics2, _api$analytics3;
|
|
761
773
|
var hyperlinkAppearance = [(0, _HyperlinkToolbarAppearanceDropdown.getCustomHyperlinkAppearanceDropdown)({
|
|
762
774
|
url: link,
|
|
@@ -820,7 +832,7 @@ var getEndingToolbarItems = exports.getEndingToolbarItems = function getEndingTo
|
|
|
820
832
|
* Require either provider to be supplied (controls link preferences)
|
|
821
833
|
* Or explicit user preferences config in order to enable button
|
|
822
834
|
*/
|
|
823
|
-
if ((options.provider || options.userPreferencesLink) && !(0, _toolbarFlagCheck.areToolbarFlagsEnabled)()) {
|
|
835
|
+
if ((options.provider || options.userPreferencesLink) && !(0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean(api === null || api === void 0 ? void 0 : api.toolbar))) {
|
|
824
836
|
var _api$analytics5;
|
|
825
837
|
return [{
|
|
826
838
|
type: 'separator'
|
|
@@ -27,7 +27,8 @@ const DatasourceAppearanceButtonWithCardContext = ({
|
|
|
27
27
|
editorView,
|
|
28
28
|
editorState,
|
|
29
29
|
selected,
|
|
30
|
-
inputMethod
|
|
30
|
+
inputMethod,
|
|
31
|
+
areAnyNewToolbarFlagsEnabled
|
|
31
32
|
}) => {
|
|
32
33
|
const {
|
|
33
34
|
datasourceId,
|
|
@@ -96,7 +97,8 @@ const DatasourceAppearanceButtonWithCardContext = ({
|
|
|
96
97
|
}),
|
|
97
98
|
selected: selected,
|
|
98
99
|
onClick: onChangeAppearance,
|
|
99
|
-
testId: 'card-datasource-appearance-button'
|
|
100
|
+
testId: 'card-datasource-appearance-button',
|
|
101
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
100
102
|
}));
|
|
101
103
|
};
|
|
102
104
|
export const DatasourceAppearanceButton = ({
|
|
@@ -106,7 +108,8 @@ export const DatasourceAppearanceButton = ({
|
|
|
106
108
|
editorView,
|
|
107
109
|
editorState,
|
|
108
110
|
selected,
|
|
109
|
-
inputMethod
|
|
111
|
+
inputMethod,
|
|
112
|
+
areAnyNewToolbarFlagsEnabled
|
|
110
113
|
}) => {
|
|
111
114
|
const cardContext = useSmartLinkContext();
|
|
112
115
|
return jsx(DatasourceAppearanceButtonWithCardContext, {
|
|
@@ -117,6 +120,7 @@ export const DatasourceAppearanceButton = ({
|
|
|
117
120
|
editorState: editorState,
|
|
118
121
|
cardContext: cardContext,
|
|
119
122
|
selected: selected,
|
|
120
|
-
inputMethod: inputMethod
|
|
123
|
+
inputMethod: inputMethod,
|
|
124
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
121
125
|
});
|
|
122
126
|
};
|
|
@@ -8,7 +8,6 @@ import { useCallback, useRef, useState } from 'react';
|
|
|
8
8
|
import { css, jsx } from '@emotion/react';
|
|
9
9
|
import { FormattedMessage } from 'react-intl-next';
|
|
10
10
|
import { linkToolbarMessages, cardMessages as messages } from '@atlaskit/editor-common/messages';
|
|
11
|
-
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
12
11
|
import { FloatingToolbarButton as Button, FloatingToolbarSeparator as Separator } from '@atlaskit/editor-common/ui';
|
|
13
12
|
import { ArrowKeyNavigationType, DropdownContainer as UiDropdown } from '@atlaskit/editor-common/ui-menu';
|
|
14
13
|
import EditIcon from '@atlaskit/icon/core/edit';
|
|
@@ -28,7 +27,8 @@ const EditToolbarButtonPresentation = ({
|
|
|
28
27
|
editorView,
|
|
29
28
|
extensionKey,
|
|
30
29
|
onLinkEditClick,
|
|
31
|
-
intl
|
|
30
|
+
intl,
|
|
31
|
+
areAnyNewToolbarFlagsEnabled
|
|
32
32
|
}) => {
|
|
33
33
|
const [isOpen, setIsOpen] = useState(false);
|
|
34
34
|
const containerRef = useRef();
|
|
@@ -46,11 +46,10 @@ const EditToolbarButtonPresentation = ({
|
|
|
46
46
|
focusEditorView(editorView);
|
|
47
47
|
}
|
|
48
48
|
}, [currentAppearance, datasourceId, editorAnalyticsApi, editorView, extensionKey]);
|
|
49
|
-
const
|
|
50
|
-
const icon = isNewEditorToolbarEnabled ? jsx(EditIcon, {
|
|
49
|
+
const icon = areAnyNewToolbarFlagsEnabled ? jsx(EditIcon, {
|
|
51
50
|
label: ""
|
|
52
51
|
}) : undefined;
|
|
53
|
-
const tooltipContent =
|
|
52
|
+
const tooltipContent = areAnyNewToolbarFlagsEnabled ? intl.formatMessage(linkToolbarMessages.editLink) : undefined;
|
|
54
53
|
switch (editVariant) {
|
|
55
54
|
case 'edit-link':
|
|
56
55
|
{
|
|
@@ -60,11 +59,14 @@ const EditToolbarButtonPresentation = ({
|
|
|
60
59
|
testId: "edit-link",
|
|
61
60
|
onClick: onEditLink,
|
|
62
61
|
icon: icon,
|
|
63
|
-
tooltipContent: tooltipContent
|
|
64
|
-
|
|
62
|
+
tooltipContent: tooltipContent,
|
|
63
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
64
|
+
}, !areAnyNewToolbarFlagsEnabled && jsx(FormattedMessage
|
|
65
65
|
// Ignored via go/ees005
|
|
66
66
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
67
|
-
, linkToolbarMessages.editLink)), !
|
|
67
|
+
, linkToolbarMessages.editLink)), !areAnyNewToolbarFlagsEnabled && jsx(Separator, {
|
|
68
|
+
areAnyNewToolbarFlagsEnabled: false
|
|
69
|
+
}));
|
|
68
70
|
}
|
|
69
71
|
case 'edit-datasource':
|
|
70
72
|
{
|
|
@@ -73,11 +75,14 @@ const EditToolbarButtonPresentation = ({
|
|
|
73
75
|
}, jsx(Button, {
|
|
74
76
|
testId: "edit-datasource",
|
|
75
77
|
tooltipContent: intl.formatMessage(linkToolbarMessages.editDatasourceStandaloneTooltip),
|
|
76
|
-
onClick: onEditDatasource
|
|
78
|
+
onClick: onEditDatasource,
|
|
79
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
77
80
|
}, jsx(FormattedMessage
|
|
78
81
|
// Ignored via go/ees005
|
|
79
82
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
80
|
-
, linkToolbarMessages.editDatasourceStandalone)), !
|
|
83
|
+
, linkToolbarMessages.editDatasourceStandalone)), !areAnyNewToolbarFlagsEnabled && jsx(Separator, {
|
|
84
|
+
areAnyNewToolbarFlagsEnabled: false
|
|
85
|
+
}));
|
|
81
86
|
}
|
|
82
87
|
case 'edit-dropdown':
|
|
83
88
|
{
|
|
@@ -94,11 +99,14 @@ const EditToolbarButtonPresentation = ({
|
|
|
94
99
|
onClick: toggleOpen,
|
|
95
100
|
selected: isOpen,
|
|
96
101
|
disabled: false,
|
|
97
|
-
ariaHasPopup: true
|
|
102
|
+
ariaHasPopup: true,
|
|
103
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
98
104
|
}, jsx(FormattedMessage
|
|
99
105
|
// Ignored via go/ees005
|
|
100
106
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
101
|
-
, messages.editDropdownTriggerTitle)), !
|
|
107
|
+
, messages.editDropdownTriggerTitle)), !areAnyNewToolbarFlagsEnabled && jsx(Separator, {
|
|
108
|
+
areAnyNewToolbarFlagsEnabled: false
|
|
109
|
+
}));
|
|
102
110
|
return jsx(Flex, {
|
|
103
111
|
ref: containerRef
|
|
104
112
|
}, jsx(UiDropdown, {
|
|
@@ -32,7 +32,8 @@ const EditToolbarButtonWithCardContext = props => {
|
|
|
32
32
|
editorView,
|
|
33
33
|
intl,
|
|
34
34
|
onLinkEditClick,
|
|
35
|
-
url
|
|
35
|
+
url,
|
|
36
|
+
areAnyNewToolbarFlagsEnabled
|
|
36
37
|
} = props;
|
|
37
38
|
const {
|
|
38
39
|
extensionKey,
|
|
@@ -85,11 +86,14 @@ const EditToolbarButtonWithCardContext = props => {
|
|
|
85
86
|
gap: "space.050"
|
|
86
87
|
}, jsx(Button, {
|
|
87
88
|
testId: "edit-link",
|
|
88
|
-
onClick: onEditLink
|
|
89
|
+
onClick: onEditLink,
|
|
90
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
89
91
|
}, jsx(FormattedMessage
|
|
90
92
|
// Ignored via go/ees005
|
|
91
93
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
92
|
-
, linkToolbarMessages.editLink)), !editorExperiment('platform_editor_controls', 'variant1') && jsx(Separator,
|
|
94
|
+
, linkToolbarMessages.editLink)), !editorExperiment('platform_editor_controls', 'variant1') && jsx(Separator, {
|
|
95
|
+
areAnyNewToolbarFlagsEnabled: false
|
|
96
|
+
}));
|
|
93
97
|
}
|
|
94
98
|
case 'edit-datasource':
|
|
95
99
|
{
|
|
@@ -98,11 +102,14 @@ const EditToolbarButtonWithCardContext = props => {
|
|
|
98
102
|
}, jsx(Button, {
|
|
99
103
|
testId: "edit-datasource",
|
|
100
104
|
tooltipContent: intl.formatMessage(linkToolbarMessages.editDatasourceStandaloneTooltip),
|
|
101
|
-
onClick: onEditDatasource
|
|
105
|
+
onClick: onEditDatasource,
|
|
106
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
102
107
|
}, jsx(FormattedMessage
|
|
103
108
|
// Ignored via go/ees005
|
|
104
109
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
105
|
-
, linkToolbarMessages.editDatasourceStandalone)), !editorExperiment('platform_editor_controls', 'variant1') && jsx(Separator,
|
|
110
|
+
, linkToolbarMessages.editDatasourceStandalone)), !editorExperiment('platform_editor_controls', 'variant1') && jsx(Separator, {
|
|
111
|
+
areAnyNewToolbarFlagsEnabled: false
|
|
112
|
+
}));
|
|
106
113
|
}
|
|
107
114
|
case 'edit-dropdown':
|
|
108
115
|
{
|
|
@@ -119,11 +126,14 @@ const EditToolbarButtonWithCardContext = props => {
|
|
|
119
126
|
onClick: toggleOpen,
|
|
120
127
|
selected: isOpen,
|
|
121
128
|
disabled: false,
|
|
122
|
-
ariaHasPopup: true
|
|
129
|
+
ariaHasPopup: true,
|
|
130
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
123
131
|
}, jsx(FormattedMessage
|
|
124
132
|
// Ignored via go/ees005
|
|
125
133
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
126
|
-
, messages.editDropdownTriggerTitle)), !editorExperiment('platform_editor_controls', 'variant1') && jsx(Separator,
|
|
134
|
+
, messages.editDropdownTriggerTitle)), !editorExperiment('platform_editor_controls', 'variant1') && jsx(Separator, {
|
|
135
|
+
areAnyNewToolbarFlagsEnabled: false
|
|
136
|
+
}));
|
|
127
137
|
return jsx(Flex, {
|
|
128
138
|
ref: containerRef
|
|
129
139
|
}, jsx(UiDropdown, {
|
|
@@ -166,7 +176,8 @@ const EditToolbarButtonWithUrl = props => {
|
|
|
166
176
|
editorView,
|
|
167
177
|
intl,
|
|
168
178
|
onLinkEditClick,
|
|
169
|
-
url
|
|
179
|
+
url,
|
|
180
|
+
areAnyNewToolbarFlagsEnabled
|
|
170
181
|
} = props;
|
|
171
182
|
const {
|
|
172
183
|
extensionKey,
|
|
@@ -196,7 +207,8 @@ const EditToolbarButtonWithUrl = props => {
|
|
|
196
207
|
editorView: editorView,
|
|
197
208
|
extensionKey: extensionKey,
|
|
198
209
|
onLinkEditClick: onLinkEditClick,
|
|
199
|
-
intl: intl
|
|
210
|
+
intl: intl,
|
|
211
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
200
212
|
});
|
|
201
213
|
};
|
|
202
214
|
const EditToolbarButtonWithDatasourceId = props => {
|
|
@@ -207,7 +219,8 @@ const EditToolbarButtonWithDatasourceId = props => {
|
|
|
207
219
|
intl,
|
|
208
220
|
onLinkEditClick,
|
|
209
221
|
datasourceId,
|
|
210
|
-
node
|
|
222
|
+
node,
|
|
223
|
+
areAnyNewToolbarFlagsEnabled
|
|
211
224
|
} = props;
|
|
212
225
|
const fetchData = useMemo(() => {
|
|
213
226
|
try {
|
|
@@ -245,7 +258,8 @@ const EditToolbarButtonWithDatasourceId = props => {
|
|
|
245
258
|
editorView: editorView,
|
|
246
259
|
extensionKey: extensionKey,
|
|
247
260
|
onLinkEditClick: onLinkEditClick,
|
|
248
|
-
intl: intl
|
|
261
|
+
intl: intl,
|
|
262
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
249
263
|
});
|
|
250
264
|
};
|
|
251
265
|
export const EditToolbarButton = props => {
|
|
@@ -256,7 +270,8 @@ export const EditToolbarButton = props => {
|
|
|
256
270
|
editorView,
|
|
257
271
|
intl,
|
|
258
272
|
onLinkEditClick,
|
|
259
|
-
url
|
|
273
|
+
url,
|
|
274
|
+
areAnyNewToolbarFlagsEnabled
|
|
260
275
|
} = props;
|
|
261
276
|
const cardContext = useSmartLinkContext();
|
|
262
277
|
if (props.url) {
|
|
@@ -268,7 +283,8 @@ export const EditToolbarButton = props => {
|
|
|
268
283
|
editorView: editorView,
|
|
269
284
|
cardContext: cardContext,
|
|
270
285
|
onLinkEditClick: onLinkEditClick,
|
|
271
|
-
currentAppearance: currentAppearance
|
|
286
|
+
currentAppearance: currentAppearance,
|
|
287
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
272
288
|
});
|
|
273
289
|
}
|
|
274
290
|
if (props.datasourceId && props.node) {
|
|
@@ -279,7 +295,8 @@ export const EditToolbarButton = props => {
|
|
|
279
295
|
editorAnalyticsApi: editorAnalyticsApi,
|
|
280
296
|
editorView: editorView,
|
|
281
297
|
onLinkEditClick: onLinkEditClick,
|
|
282
|
-
currentAppearance: currentAppearance
|
|
298
|
+
currentAppearance: currentAppearance,
|
|
299
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
283
300
|
});
|
|
284
301
|
}
|
|
285
302
|
return jsx(EditToolbarButtonWithCardContext, {
|
|
@@ -290,6 +307,7 @@ export const EditToolbarButton = props => {
|
|
|
290
307
|
editorView: editorView,
|
|
291
308
|
cardContext: cardContext,
|
|
292
309
|
onLinkEditClick: onLinkEditClick,
|
|
293
|
-
currentAppearance: currentAppearance
|
|
310
|
+
currentAppearance: currentAppearance,
|
|
311
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
294
312
|
});
|
|
295
313
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
3
4
|
import { FloatingToolbarSeparator as Separator } from '@atlaskit/editor-common/ui';
|
|
4
5
|
import { Flex } from '@atlaskit/primitives/compiled';
|
|
5
6
|
import { DatasourceAppearanceButton } from './DatasourceAppearanceButton';
|
|
6
7
|
import { LinkToolbarAppearance } from './LinkToolbarAppearance';
|
|
7
8
|
export function HyperlinkToolbarAppearance(props) {
|
|
8
|
-
var _props$cardOptions3;
|
|
9
|
+
var _props$cardOptions3, _props$editorPluginAp5;
|
|
9
10
|
const [supportedUrlsMap, setSupportedUrlsMap] = useState(new Map());
|
|
10
11
|
const cardProvider = useRef(undefined);
|
|
11
12
|
const {
|
|
@@ -60,6 +61,7 @@ export function HyperlinkToolbarAppearance(props) {
|
|
|
60
61
|
if (!supportedUrlsMap.get(url)) {
|
|
61
62
|
return null;
|
|
62
63
|
}
|
|
64
|
+
const areAnyNewToolbarFlagsEnabled = areToolbarFlagsEnabled(Boolean((_props$editorPluginAp5 = props.editorPluginApi) === null || _props$editorPluginAp5 === void 0 ? void 0 : _props$editorPluginAp5.toolbar));
|
|
63
65
|
return /*#__PURE__*/React.createElement(Flex, null, /*#__PURE__*/React.createElement(LinkToolbarAppearance, {
|
|
64
66
|
key: "link-appearance",
|
|
65
67
|
url: url,
|
|
@@ -68,13 +70,17 @@ export function HyperlinkToolbarAppearance(props) {
|
|
|
68
70
|
editorState: editorState,
|
|
69
71
|
allowEmbeds: cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowEmbeds,
|
|
70
72
|
allowBlockCards: cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowBlockCards,
|
|
71
|
-
editorAnalyticsApi: editorAnalyticsApi
|
|
73
|
+
editorAnalyticsApi: editorAnalyticsApi,
|
|
74
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
72
75
|
}), (cardOptions === null || cardOptions === void 0 ? void 0 : cardOptions.allowDatasource) && /*#__PURE__*/React.createElement(DatasourceAppearanceButton, {
|
|
73
76
|
intl: intl,
|
|
74
77
|
url: url,
|
|
75
78
|
editorState: editorState,
|
|
76
79
|
editorView: editorView,
|
|
77
80
|
editorAnalyticsApi: editorAnalyticsApi,
|
|
78
|
-
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
79
|
-
|
|
81
|
+
inputMethod: INPUT_METHOD.FLOATING_TB,
|
|
82
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
83
|
+
}), /*#__PURE__*/React.createElement(Separator, {
|
|
84
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
85
|
+
}));
|
|
80
86
|
}
|
|
@@ -8,11 +8,12 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
8
8
|
import { Flex } from '@atlaskit/primitives/compiled';
|
|
9
9
|
import { LinkAppearanceMenu } from './LinkToolbarAppearanceDropdown';
|
|
10
10
|
const CustomHyperlinkDropdown = props => {
|
|
11
|
-
var _props$cardOptions3;
|
|
11
|
+
var _props$editorPluginAp, _props$cardOptions3, _props$editorPluginAp6, _props$editorPluginAp7;
|
|
12
12
|
const [supportedUrlsMap, setSupportedUrlsMap] = useState(new Map());
|
|
13
13
|
const [isOpen, setIsOpen] = useState(false);
|
|
14
14
|
const cardProvider = useRef(undefined);
|
|
15
15
|
const containerRef = useRef(undefined);
|
|
16
|
+
const areAnyNewToolbarFlagsEnabled = areToolbarFlagsEnabled(Boolean((_props$editorPluginAp = props.editorPluginApi) === null || _props$editorPluginAp === void 0 ? void 0 : _props$editorPluginAp.toolbar));
|
|
16
17
|
const {
|
|
17
18
|
url,
|
|
18
19
|
intl,
|
|
@@ -35,8 +36,8 @@ const CustomHyperlinkDropdown = props => {
|
|
|
35
36
|
return cardProvider.current;
|
|
36
37
|
}
|
|
37
38
|
return new Promise(resolve => {
|
|
38
|
-
var _props$
|
|
39
|
-
const cardProvider = (_props$
|
|
39
|
+
var _props$editorPluginAp2, _props$editorPluginAp3, _props$editorPluginAp4, _props$editorPluginAp5;
|
|
40
|
+
const cardProvider = (_props$editorPluginAp2 = props.editorPluginApi) === null || _props$editorPluginAp2 === void 0 ? void 0 : (_props$editorPluginAp3 = _props$editorPluginAp2.card) === null || _props$editorPluginAp3 === void 0 ? void 0 : (_props$editorPluginAp4 = _props$editorPluginAp3.sharedState) === null || _props$editorPluginAp4 === void 0 ? void 0 : (_props$editorPluginAp5 = _props$editorPluginAp4.currentState()) === null || _props$editorPluginAp5 === void 0 ? void 0 : _props$editorPluginAp5.provider;
|
|
40
41
|
if (cardProvider) {
|
|
41
42
|
resolve(cardProvider);
|
|
42
43
|
}
|
|
@@ -94,7 +95,8 @@ const CustomHyperlinkDropdown = props => {
|
|
|
94
95
|
label: "",
|
|
95
96
|
spacing: "compact",
|
|
96
97
|
size: "small"
|
|
97
|
-
})
|
|
98
|
+
}),
|
|
99
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
98
100
|
}, title);
|
|
99
101
|
return /*#__PURE__*/React.createElement(Flex, {
|
|
100
102
|
ref: containerRef,
|
|
@@ -122,8 +124,11 @@ const CustomHyperlinkDropdown = props => {
|
|
|
122
124
|
isDatasourceView: isDatasourceView,
|
|
123
125
|
allowDatasource: allowDatasource,
|
|
124
126
|
dispatchCommand: dispatchCommand,
|
|
125
|
-
settingsConfig: settingsConfig
|
|
126
|
-
|
|
127
|
+
settingsConfig: settingsConfig,
|
|
128
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
129
|
+
})), !(areToolbarFlagsEnabled(Boolean((_props$editorPluginAp6 = props.editorPluginApi) === null || _props$editorPluginAp6 === void 0 ? void 0 : _props$editorPluginAp6.toolbar)) && fg('platform_editor_controls_patch_15')) && /*#__PURE__*/React.createElement(Separator, {
|
|
130
|
+
areAnyNewToolbarFlagsEnabled: areToolbarFlagsEnabled(Boolean((_props$editorPluginAp7 = props.editorPluginApi) === null || _props$editorPluginAp7 === void 0 ? void 0 : _props$editorPluginAp7.toolbar))
|
|
131
|
+
}));
|
|
127
132
|
};
|
|
128
133
|
export const getCustomHyperlinkAppearanceDropdown = ({
|
|
129
134
|
url,
|
|
@@ -27,7 +27,8 @@ export class LinkToolbarAppearance extends React.Component {
|
|
|
27
27
|
allowBlockCards = true,
|
|
28
28
|
editorAnalyticsApi,
|
|
29
29
|
showUpgradeDiscoverability = true,
|
|
30
|
-
isDatasourceView
|
|
30
|
+
isDatasourceView,
|
|
31
|
+
areAnyNewToolbarFlagsEnabled
|
|
31
32
|
} = this.props;
|
|
32
33
|
const preview = allowEmbeds && cardContext && url && cardContext.extractors.getPreview(url, 'web');
|
|
33
34
|
const defaultCommand = () => false;
|
|
@@ -88,7 +89,7 @@ export class LinkToolbarAppearance extends React.Component {
|
|
|
88
89
|
}
|
|
89
90
|
const LinkToolbarButtons = /*#__PURE__*/React.createElement(LinkToolbarButtonGroup, {
|
|
90
91
|
key: "link-toolbar-button-group",
|
|
91
|
-
options: options.map(option => getButtonGroupOption(intl, dispatchCommand, {
|
|
92
|
+
options: options.map(option => getButtonGroupOption(intl, areAnyNewToolbarFlagsEnabled, dispatchCommand, {
|
|
92
93
|
...option,
|
|
93
94
|
onClick: commandWithMetadata(option.onClick, {
|
|
94
95
|
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
@@ -126,7 +126,8 @@ export const getLinkAppearanceDropdown = ({
|
|
|
126
126
|
editorAnalyticsApi,
|
|
127
127
|
showUpgradeDiscoverability = true,
|
|
128
128
|
isDatasourceView,
|
|
129
|
-
settingsConfig
|
|
129
|
+
settingsConfig,
|
|
130
|
+
areAnyNewToolbarFlagsEnabled
|
|
130
131
|
}) => {
|
|
131
132
|
const alignmentItemOptions = {
|
|
132
133
|
render: props => {
|
|
@@ -142,7 +143,8 @@ export const getLinkAppearanceDropdown = ({
|
|
|
142
143
|
isDatasourceView: isDatasourceView,
|
|
143
144
|
allowDatasource: allowDatasource,
|
|
144
145
|
dispatchCommand: props.dispatchCommand,
|
|
145
|
-
settingsConfig: settingsConfig
|
|
146
|
+
settingsConfig: settingsConfig,
|
|
147
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
146
148
|
});
|
|
147
149
|
},
|
|
148
150
|
width: 200,
|