@atlaskit/editor-plugin-media 6.0.3 → 6.2.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 +24 -0
- package/dist/cjs/mediaPlugin.js +1 -1
- package/dist/cjs/pm-plugins/alt-text/ui/AltTextEdit.js +6 -2
- package/dist/cjs/ui/MediaLinkingToolbar.js +7 -3
- package/dist/cjs/ui/toolbar/alt-text.js +2 -1
- package/dist/cjs/ui/toolbar/index.js +23 -19
- package/dist/cjs/ui/toolbar/layout-group.js +8 -4
- package/dist/cjs/ui/toolbar/linking-toolbar-appearance.js +14 -6
- package/dist/cjs/ui/toolbar/linking.js +3 -1
- package/dist/cjs/ui/toolbar/mediaInline.js +7 -6
- package/dist/es2019/mediaPlugin.js +1 -1
- package/dist/es2019/pm-plugins/alt-text/ui/AltTextEdit.js +6 -2
- package/dist/es2019/ui/MediaLinkingToolbar.js +7 -3
- package/dist/es2019/ui/toolbar/alt-text.js +2 -1
- package/dist/es2019/ui/toolbar/index.js +23 -19
- package/dist/es2019/ui/toolbar/layout-group.js +8 -4
- package/dist/es2019/ui/toolbar/linking-toolbar-appearance.js +14 -6
- package/dist/es2019/ui/toolbar/linking.js +3 -1
- package/dist/es2019/ui/toolbar/mediaInline.js +7 -6
- package/dist/esm/mediaPlugin.js +1 -1
- package/dist/esm/pm-plugins/alt-text/ui/AltTextEdit.js +6 -2
- package/dist/esm/ui/MediaLinkingToolbar.js +7 -3
- package/dist/esm/ui/toolbar/alt-text.js +2 -1
- package/dist/esm/ui/toolbar/index.js +23 -19
- package/dist/esm/ui/toolbar/layout-group.js +8 -4
- package/dist/esm/ui/toolbar/linking-toolbar-appearance.js +14 -6
- package/dist/esm/ui/toolbar/linking.js +3 -1
- package/dist/esm/ui/toolbar/mediaInline.js +7 -6
- package/dist/types/mediaPluginType.d.ts +3 -1
- package/dist/types/pm-plugins/alt-text/ui/AltTextEdit.d.ts +1 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/ui/MediaLinkingToolbar.d.ts +1 -0
- package/dist/types/ui/toolbar/alt-text.d.ts +1 -0
- package/dist/types/ui/toolbar/layout-group.d.ts +2 -1
- package/dist/types/ui/toolbar/linking-toolbar-appearance.d.ts +2 -1
- package/dist/types-ts4.5/mediaPluginType.d.ts +3 -1
- package/dist/types-ts4.5/pm-plugins/alt-text/ui/AltTextEdit.d.ts +1 -0
- package/dist/types-ts4.5/types/index.d.ts +1 -0
- package/dist/types-ts4.5/ui/MediaLinkingToolbar.d.ts +1 -0
- package/dist/types-ts4.5/ui/toolbar/alt-text.d.ts +1 -0
- package/dist/types-ts4.5/ui/toolbar/layout-group.d.ts +2 -1
- package/dist/types-ts4.5/ui/toolbar/linking-toolbar-appearance.d.ts +2 -1
- package/package.json +8 -7
|
@@ -111,12 +111,12 @@ export const handleShowMediaViewer = ({
|
|
|
111
111
|
const generateMediaCardFloatingToolbar = (state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, editorAnalyticsAPI, forceFocusSelector, isViewOnly) => {
|
|
112
112
|
var _pluginInjectionApi$c, _pluginInjectionApi$c2, _pluginInjectionApi$c3;
|
|
113
113
|
const disableDownloadButton = getIsDownloadDisabledByDataSecurityPolicy(mediaPluginState);
|
|
114
|
-
const
|
|
114
|
+
const areAnyNewToolbarFlagsEnabled = areToolbarFlagsEnabled(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar));
|
|
115
115
|
const preview = {
|
|
116
116
|
id: 'editor.media.viewer',
|
|
117
117
|
testId: 'file-preview-toolbar-button',
|
|
118
118
|
type: 'button',
|
|
119
|
-
icon:
|
|
119
|
+
icon: areAnyNewToolbarFlagsEnabled ? GrowDiagonalIcon : MaximizeIcon,
|
|
120
120
|
title: intl.formatMessage(messages.preview),
|
|
121
121
|
onClick: () => {
|
|
122
122
|
var _handleShowMediaViewe;
|
|
@@ -138,18 +138,18 @@ const generateMediaCardFloatingToolbar = (state, intl, mediaPluginState, hoverDe
|
|
|
138
138
|
},
|
|
139
139
|
title: intl.formatMessage(messages.download),
|
|
140
140
|
disabled: disableDownloadButton,
|
|
141
|
-
...(
|
|
141
|
+
...(areAnyNewToolbarFlagsEnabled && {
|
|
142
142
|
supportsViewMode: true
|
|
143
143
|
})
|
|
144
144
|
};
|
|
145
|
-
if (isViewOnly && !
|
|
145
|
+
if (isViewOnly && !areAnyNewToolbarFlagsEnabled) {
|
|
146
146
|
return [];
|
|
147
147
|
}
|
|
148
148
|
const {
|
|
149
149
|
mediaGroup
|
|
150
150
|
} = state.schema.nodes;
|
|
151
151
|
const items = [];
|
|
152
|
-
if (!
|
|
152
|
+
if (!areAnyNewToolbarFlagsEnabled) {
|
|
153
153
|
items.push({
|
|
154
154
|
id: 'editor.media.view.switcher.inline',
|
|
155
155
|
type: 'button',
|
|
@@ -268,7 +268,7 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
268
268
|
const {
|
|
269
269
|
hoverDecoration
|
|
270
270
|
} = (_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 : {};
|
|
271
|
-
const
|
|
271
|
+
const areAnyNewToolbarFlagsEnabled = areToolbarFlagsEnabled(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar));
|
|
272
272
|
const disableDownloadButton = getIsDownloadDisabledByDataSecurityPolicy(pluginState);
|
|
273
273
|
if (shouldShowImageBorder(state)) {
|
|
274
274
|
toolbarButtons.push({
|
|
@@ -297,7 +297,7 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
297
297
|
});
|
|
298
298
|
}
|
|
299
299
|
});
|
|
300
|
-
if (!
|
|
300
|
+
if (!areAnyNewToolbarFlagsEnabled) {
|
|
301
301
|
toolbarButtons.push({
|
|
302
302
|
type: 'separator'
|
|
303
303
|
});
|
|
@@ -318,7 +318,7 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
318
318
|
}
|
|
319
319
|
const layoutButtons = buildLayoutButtons(state, intl, state.schema.nodes.mediaSingle, widthPlugin, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions, allowResizing, allowResizingInTables, true, true, isChangingLayoutDisabled, allowPixelResizing);
|
|
320
320
|
const addLayoutDropdownToToolbar = () => {
|
|
321
|
-
if (
|
|
321
|
+
if (areAnyNewToolbarFlagsEnabled) {
|
|
322
322
|
var _pluginInjectionApi$a4;
|
|
323
323
|
const layoutDropdown = buildLayoutDropdown(state, intl, state.schema.nodes.mediaSingle, widthPlugin, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions, allowResizing, allowResizingInTables, true, true, isChangingLayoutDisabled, allowPixelResizing);
|
|
324
324
|
toolbarButtons = [...toolbarButtons, ...layoutDropdown];
|
|
@@ -333,7 +333,9 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
333
333
|
layoutButtons: layoutButtons
|
|
334
334
|
// Ignored via go/ees005
|
|
335
335
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
336
|
-
}, props
|
|
336
|
+
}, props, {
|
|
337
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
338
|
+
}));
|
|
337
339
|
},
|
|
338
340
|
width: 188,
|
|
339
341
|
height: 32
|
|
@@ -346,7 +348,7 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
346
348
|
title: intl.formatMessage(layoutToMessages[selectedLayoutIcon.value]),
|
|
347
349
|
icon: selectedLayoutIcon.icon
|
|
348
350
|
};
|
|
349
|
-
toolbarButtons = [...toolbarButtons, trigger, ...(
|
|
351
|
+
toolbarButtons = [...toolbarButtons, trigger, ...(areAnyNewToolbarFlagsEnabled ? [] : [{
|
|
350
352
|
type: 'separator'
|
|
351
353
|
}])];
|
|
352
354
|
}
|
|
@@ -368,7 +370,7 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
368
370
|
addLayoutDropdownToToolbar();
|
|
369
371
|
} else {
|
|
370
372
|
toolbarButtons = [...toolbarButtons, ...layoutButtons];
|
|
371
|
-
if (layoutButtons.length && !
|
|
373
|
+
if (layoutButtons.length && !areAnyNewToolbarFlagsEnabled) {
|
|
372
374
|
toolbarButtons.push({
|
|
373
375
|
type: 'separator'
|
|
374
376
|
});
|
|
@@ -384,7 +386,7 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
384
386
|
const hasCaption = contains(selectedNode.node, state.schema.nodes.caption);
|
|
385
387
|
const inlineSwitcherTitle = intl.formatMessage(hasCaption ? mediaAndEmbedToolbarMessages.changeToMediaInlineImageCaptionWarning : mediaAndEmbedToolbarMessages.changeToMediaInlineImage);
|
|
386
388
|
const floatingSwitcherTitle = intl.formatMessage(mediaAndEmbedToolbarMessages.changeToMediaSingle);
|
|
387
|
-
if (!
|
|
389
|
+
if (!areAnyNewToolbarFlagsEnabled) {
|
|
388
390
|
var _pluginInjectionApi$a5;
|
|
389
391
|
toolbarButtons.push({
|
|
390
392
|
type: 'button',
|
|
@@ -425,7 +427,7 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
425
427
|
}
|
|
426
428
|
|
|
427
429
|
// A separator is needed regardless switcher is enabled or not
|
|
428
|
-
if (editorExperiment('platform_editor_toolbar_aifc', true)) {
|
|
430
|
+
if (Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar) && editorExperiment('platform_editor_toolbar_aifc', true)) {
|
|
429
431
|
toolbarButtons.push({
|
|
430
432
|
type: 'separator',
|
|
431
433
|
fullHeight: true
|
|
@@ -480,14 +482,14 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
480
482
|
}
|
|
481
483
|
return [sizeInput];
|
|
482
484
|
}
|
|
483
|
-
if (!
|
|
485
|
+
if (!areAnyNewToolbarFlagsEnabled) {
|
|
484
486
|
toolbarButtons.push(sizeInput);
|
|
485
487
|
toolbarButtons.push({
|
|
486
488
|
type: 'separator'
|
|
487
489
|
});
|
|
488
490
|
}
|
|
489
491
|
}
|
|
490
|
-
if (!
|
|
492
|
+
if (!areAnyNewToolbarFlagsEnabled) {
|
|
491
493
|
if (allowCommentsOnMedia) {
|
|
492
494
|
toolbarButtons.push(commentButton(intl, state, pluginInjectionApi, onCommentButtonMount), {
|
|
493
495
|
type: 'separator',
|
|
@@ -536,7 +538,8 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
536
538
|
onAddLink: editLink,
|
|
537
539
|
onEditLink: editLink,
|
|
538
540
|
onOpenLink: openLink,
|
|
539
|
-
isViewOnly: isViewOnly
|
|
541
|
+
isViewOnly: isViewOnly,
|
|
542
|
+
areAnyNewToolbarFlagsEnabled: false
|
|
540
543
|
});
|
|
541
544
|
}
|
|
542
545
|
return null;
|
|
@@ -591,7 +594,7 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
591
594
|
supportsViewMode: true
|
|
592
595
|
});
|
|
593
596
|
}
|
|
594
|
-
if (!
|
|
597
|
+
if (!areAnyNewToolbarFlagsEnabled) {
|
|
595
598
|
var _pluginInjectionApi$a8;
|
|
596
599
|
if (allowAltTextOnImages) {
|
|
597
600
|
var _pluginInjectionApi$a7;
|
|
@@ -759,7 +762,8 @@ export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi) =
|
|
|
759
762
|
return getAltTextToolbar(baseToolbar, {
|
|
760
763
|
altTextValidator,
|
|
761
764
|
forceFocusSelector: pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$f = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f === void 0 ? void 0 : (_pluginInjectionApi$f2 = _pluginInjectionApi$f.actions) === null || _pluginInjectionApi$f2 === void 0 ? void 0 : _pluginInjectionApi$f2.forceFocusSelector,
|
|
762
|
-
triggerButtonSelector: overflowButtonSelector
|
|
765
|
+
triggerButtonSelector: overflowButtonSelector,
|
|
766
|
+
areAnyNewToolbarFlagsEnabled: areToolbarFlagsEnabled(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar))
|
|
763
767
|
});
|
|
764
768
|
}
|
|
765
769
|
}
|
|
@@ -809,7 +813,7 @@ export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi) =
|
|
|
809
813
|
};
|
|
810
814
|
items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, pluginInjectionApi);
|
|
811
815
|
}
|
|
812
|
-
if (!mediaPluginState.isResizing && areToolbarFlagsEnabled()) {
|
|
816
|
+
if (!mediaPluginState.isResizing && areToolbarFlagsEnabled(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar))) {
|
|
813
817
|
var _pluginInjectionApi$a0, _pluginInjectionApi$a1;
|
|
814
818
|
updateToFullHeightSeparator(items);
|
|
815
819
|
const customOptions = [...getLinkingDropdownOptions(state, intl, mediaLinkingState, allowMediaInline && selectedNodeType && selectedNodeType === mediaInline, allowLinking, isViewOnly), ...getAltTextDropdownOption(state, intl.formatMessage, allowAltTextOnImages, selectedNodeType, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a0 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a0 === void 0 ? void 0 : _pluginInjectionApi$a0.actions), ...getResizeDropdownOption(options, state, intl.formatMessage, selectedNodeType)];
|
|
@@ -14,17 +14,20 @@ const containerStyles = xcss({
|
|
|
14
14
|
export const LayoutGroup = ({
|
|
15
15
|
layoutButtons,
|
|
16
16
|
dispatchCommand,
|
|
17
|
-
hide
|
|
17
|
+
hide,
|
|
18
|
+
areAnyNewToolbarFlagsEnabled
|
|
18
19
|
}) => {
|
|
19
20
|
return jsx(Box, {
|
|
20
21
|
xcss: containerStyles
|
|
21
22
|
}, jsx(ButtonGroup, null, layoutButtons.map((item, idx) => {
|
|
22
23
|
switch (item.type) {
|
|
23
24
|
case 'separator':
|
|
25
|
+
return jsx(FloatingToolbarSeparator
|
|
24
26
|
// Ignored via go/ees005
|
|
25
27
|
// eslint-disable-next-line react/no-array-index-key
|
|
26
|
-
|
|
27
|
-
key: idx
|
|
28
|
+
, {
|
|
29
|
+
key: idx,
|
|
30
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
28
31
|
});
|
|
29
32
|
case 'button':
|
|
30
33
|
// Ignored via go/ees005
|
|
@@ -44,7 +47,8 @@ export const LayoutGroup = ({
|
|
|
44
47
|
onClick: () => {
|
|
45
48
|
dispatchCommand(item.onClick);
|
|
46
49
|
hide();
|
|
47
|
-
}
|
|
50
|
+
},
|
|
51
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
48
52
|
});
|
|
49
53
|
}
|
|
50
54
|
})));
|
|
@@ -27,7 +27,8 @@ export const LinkToolbarAppearance = ({
|
|
|
27
27
|
onEditLink,
|
|
28
28
|
onOpenLink,
|
|
29
29
|
isInlineNode,
|
|
30
|
-
isViewOnly
|
|
30
|
+
isViewOnly,
|
|
31
|
+
areAnyNewToolbarFlagsEnabled
|
|
31
32
|
}) => {
|
|
32
33
|
const [showLinkingControls, setShowLinkingControls] = useState(true);
|
|
33
34
|
useEffect(() => {
|
|
@@ -62,7 +63,8 @@ export const LinkToolbarAppearance = ({
|
|
|
62
63
|
description: title,
|
|
63
64
|
keymap: addLink
|
|
64
65
|
}),
|
|
65
|
-
testId: "edit-link-button"
|
|
66
|
+
testId: "edit-link-button",
|
|
67
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
66
68
|
}, title)), jsx(ToolbarButton, {
|
|
67
69
|
target: "_blank",
|
|
68
70
|
href: isValidUrl ? mediaLinkingState.link : undefined,
|
|
@@ -76,8 +78,11 @@ export const LinkToolbarAppearance = ({
|
|
|
76
78
|
})
|
|
77
79
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
78
80
|
,
|
|
79
|
-
className: "hyperlink-open-link"
|
|
80
|
-
|
|
81
|
+
className: "hyperlink-open-link",
|
|
82
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
83
|
+
}), jsx(Separator, {
|
|
84
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
85
|
+
}));
|
|
81
86
|
} else {
|
|
82
87
|
const title = intl.formatMessage(linkToolbarMessages.addLink);
|
|
83
88
|
return !isViewOnly ? jsx(Fragment, null, jsx(ToolbarButton, {
|
|
@@ -92,7 +97,10 @@ export const LinkToolbarAppearance = ({
|
|
|
92
97
|
color: "currentColor",
|
|
93
98
|
label: title,
|
|
94
99
|
spacing: "spacious"
|
|
95
|
-
})
|
|
96
|
-
|
|
100
|
+
}),
|
|
101
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
102
|
+
}), jsx(Separator, {
|
|
103
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
104
|
+
})) : null;
|
|
97
105
|
}
|
|
98
106
|
};
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { isSafeUrl } from '@atlaskit/adf-schema';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { linkMessages, linkToolbarMessages } from '@atlaskit/editor-common/messages';
|
|
5
|
+
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
5
6
|
import { RECENT_SEARCH_HEIGHT_IN_PX, RECENT_SEARCH_WIDTH_IN_PX } from '@atlaskit/editor-common/ui';
|
|
6
7
|
import LinkIcon from '@atlaskit/icon/core/link';
|
|
7
8
|
import LinkExternalIcon from '@atlaskit/icon/core/link-external';
|
|
@@ -114,7 +115,8 @@ export const getLinkingToolbar = (toolbarBaseConfig, mediaLinkingState, state, i
|
|
|
114
115
|
},
|
|
115
116
|
onBlur: () => {
|
|
116
117
|
hideLinkingToolbar(view.state, view.dispatch, view);
|
|
117
|
-
}
|
|
118
|
+
},
|
|
119
|
+
areAnyNewToolbarFlagsEnabled: areToolbarFlagsEnabled(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar))
|
|
118
120
|
});
|
|
119
121
|
}
|
|
120
122
|
}]
|
|
@@ -37,12 +37,12 @@ export const generateMediaInlineFloatingToolbar = (state, intl, mediaPluginState
|
|
|
37
37
|
return getMediaInlineImageToolbar(state, intl, mediaPluginState, hoverDecoration, editorAnalyticsAPI, pluginInjectionApi, mediaLinkingState, options);
|
|
38
38
|
}
|
|
39
39
|
const items = [];
|
|
40
|
-
const
|
|
40
|
+
const areAnyNewToolbarFlagsEnabled = areToolbarFlagsEnabled(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar));
|
|
41
41
|
const preview = {
|
|
42
42
|
id: 'editor.media.viewer',
|
|
43
43
|
testId: 'file-preview-toolbar-button',
|
|
44
44
|
type: 'button',
|
|
45
|
-
icon:
|
|
45
|
+
icon: areAnyNewToolbarFlagsEnabled ? GrowDiagonalIcon : MaximizeIcon,
|
|
46
46
|
title: intl.formatMessage(messages.preview),
|
|
47
47
|
onClick: () => {
|
|
48
48
|
var _handleShowMediaViewe;
|
|
@@ -51,7 +51,7 @@ export const generateMediaInlineFloatingToolbar = (state, intl, mediaPluginState
|
|
|
51
51
|
api: pluginInjectionApi
|
|
52
52
|
})) !== null && _handleShowMediaViewe !== void 0 ? _handleShowMediaViewe : false;
|
|
53
53
|
},
|
|
54
|
-
...(
|
|
54
|
+
...(areAnyNewToolbarFlagsEnabled && {
|
|
55
55
|
supportsViewMode: true
|
|
56
56
|
})
|
|
57
57
|
};
|
|
@@ -66,11 +66,11 @@ export const generateMediaInlineFloatingToolbar = (state, intl, mediaPluginState
|
|
|
66
66
|
},
|
|
67
67
|
disabled: disableDownloadButton,
|
|
68
68
|
title: intl.formatMessage(messages.download),
|
|
69
|
-
...(
|
|
69
|
+
...(areAnyNewToolbarFlagsEnabled && {
|
|
70
70
|
supportsViewMode: true
|
|
71
71
|
})
|
|
72
72
|
};
|
|
73
|
-
if (!
|
|
73
|
+
if (!areAnyNewToolbarFlagsEnabled) {
|
|
74
74
|
items.push({
|
|
75
75
|
id: 'editor.media.view.switcher.inline',
|
|
76
76
|
type: 'button',
|
|
@@ -296,7 +296,8 @@ const getMediaInlineImageToolbar = (state, intl, mediaPluginState, hoverDecorati
|
|
|
296
296
|
onEditLink: editLink,
|
|
297
297
|
onOpenLink: openLink,
|
|
298
298
|
isInlineNode: true,
|
|
299
|
-
isViewOnly: options.isViewOnly
|
|
299
|
+
isViewOnly: options.isViewOnly,
|
|
300
|
+
areAnyNewToolbarFlagsEnabled: areToolbarFlagsEnabled(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar))
|
|
300
301
|
});
|
|
301
302
|
}
|
|
302
303
|
return null;
|
package/dist/esm/mediaPlugin.js
CHANGED
|
@@ -314,7 +314,7 @@ export var mediaPlugin = function mediaPlugin(_ref3) {
|
|
|
314
314
|
pluginsOptions: {
|
|
315
315
|
quickInsert: function quickInsert(_ref12) {
|
|
316
316
|
var formatMessage = _ref12.formatMessage;
|
|
317
|
-
return fg('platform_editor_add_media_from_url_rollout') ? [] : [{
|
|
317
|
+
return fg('platform_editor_add_media_from_url_rollout') || options !== null && options !== void 0 && options.disableQuickInsert ? [] : [{
|
|
318
318
|
id: 'media',
|
|
319
319
|
title: formatMessage(messages.mediaFiles),
|
|
320
320
|
description: formatMessage(messages.mediaFilesDescription),
|
|
@@ -20,6 +20,7 @@ import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
|
20
20
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
21
21
|
import { escape, ToolTipContent } from '@atlaskit/editor-common/keymaps';
|
|
22
22
|
import { altTextMessages as messages } from '@atlaskit/editor-common/media';
|
|
23
|
+
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
23
24
|
import { RECENT_SEARCH_WIDTH_IN_PX as CONTAINER_WIDTH_IN_PX, FloatingToolbarButton as Button, ErrorMessage, PanelTextInput } from '@atlaskit/editor-common/ui';
|
|
24
25
|
import { relativeFontSizeToBase16 } from '@atlaskit/editor-shared-styles';
|
|
25
26
|
import ChevronLeftLargeIcon from '@atlaskit/icon/core/migration/chevron-left--chevron-left-large';
|
|
@@ -178,6 +179,7 @@ export var AltTextEditComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
178
179
|
}, {
|
|
179
180
|
key: "render",
|
|
180
181
|
value: function render() {
|
|
182
|
+
var _this$props$areAnyNew, _this$props$areAnyNew2;
|
|
181
183
|
var formatMessage = this.props.intl.formatMessage;
|
|
182
184
|
var showClearTextButton = this.state.showClearTextButton;
|
|
183
185
|
var backButtonMessage = formatMessage(messages.back);
|
|
@@ -208,7 +210,8 @@ export var AltTextEditComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
208
210
|
size: "small"
|
|
209
211
|
}),
|
|
210
212
|
tooltipContent: backButtonMessageComponent,
|
|
211
|
-
onClick: this.closeMediaAltTextMenu
|
|
213
|
+
onClick: this.closeMediaAltTextMenu,
|
|
214
|
+
areAnyNewToolbarFlagsEnabled: (_this$props$areAnyNew = this.props.areAnyNewToolbarFlagsEnabled) !== null && _this$props$areAnyNew !== void 0 ? _this$props$areAnyNew : areToolbarFlagsEnabled()
|
|
212
215
|
})), jsx(PanelTextInput, {
|
|
213
216
|
testId: "alt-text-input",
|
|
214
217
|
ariaLabel: formatMessage(messages.placeholder),
|
|
@@ -234,7 +237,8 @@ export var AltTextEditComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
234
237
|
label: formatMessage(messages.clear)
|
|
235
238
|
})),
|
|
236
239
|
tooltipContent: formatMessage(messages.clear),
|
|
237
|
-
onClick: this.handleClearText
|
|
240
|
+
onClick: this.handleClearText,
|
|
241
|
+
areAnyNewToolbarFlagsEnabled: (_this$props$areAnyNew2 = this.props.areAnyNewToolbarFlagsEnabled) !== null && _this$props$areAnyNew2 !== void 0 ? _this$props$areAnyNew2 : areToolbarFlagsEnabled()
|
|
238
242
|
}))), hasErrors && jsx("section", {
|
|
239
243
|
id: "errors-list",
|
|
240
244
|
ref: this.errorsListRef,
|
|
@@ -137,7 +137,8 @@ var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
137
137
|
inputMethod: currentInputMethod
|
|
138
138
|
}, true);
|
|
139
139
|
}
|
|
140
|
-
}
|
|
140
|
+
},
|
|
141
|
+
areAnyNewToolbarFlagsEnabled: _this.props.areAnyNewToolbarFlagsEnabled
|
|
141
142
|
})), jsx(PanelTextInput, {
|
|
142
143
|
inputId: "media-link-search-input",
|
|
143
144
|
testId: "media-link-input",
|
|
@@ -164,7 +165,9 @@ var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
164
165
|
}), jsx("label", {
|
|
165
166
|
className: "assistive",
|
|
166
167
|
htmlFor: "media-link-search-input"
|
|
167
|
-
}, formatMessage(linkToolbarMessages.searchInput)), normalizeUrl(displayUrl) && jsx(Fragment, null, jsx(Separator,
|
|
168
|
+
}, formatMessage(linkToolbarMessages.searchInput)), normalizeUrl(displayUrl) && jsx(Fragment, null, jsx(Separator, {
|
|
169
|
+
areAnyNewToolbarFlagsEnabled: _this.props.areAnyNewToolbarFlagsEnabled
|
|
170
|
+
}), jsx(Button, {
|
|
168
171
|
title: formatUnlinkText,
|
|
169
172
|
icon: jsx(EditorUnlinkIcon, {
|
|
170
173
|
label: formatUnlinkText
|
|
@@ -177,7 +180,8 @@ var LinkAddToolbar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
177
180
|
event.preventDefault();
|
|
178
181
|
_this.handleUnlink(true);
|
|
179
182
|
}
|
|
180
|
-
}
|
|
183
|
+
},
|
|
184
|
+
areAnyNewToolbarFlagsEnabled: _this.props.areAnyNewToolbarFlagsEnabled
|
|
181
185
|
}))), !!errorsList.length && jsx("section", {
|
|
182
186
|
css: validationWrapper
|
|
183
187
|
}, errorsList), renderRecentList()))
|
|
@@ -70,7 +70,8 @@ var altTextEditComponent = function altTextEditComponent(options) {
|
|
|
70
70
|
value: mediaNode.attrs.alt,
|
|
71
71
|
altTextValidator: options && options.altTextValidator,
|
|
72
72
|
onEscape: setFocus,
|
|
73
|
-
onEnter: setFocus
|
|
73
|
+
onEnter: setFocus,
|
|
74
|
+
areAnyNewToolbarFlagsEnabled: options === null || options === void 0 ? void 0 : options.areAnyNewToolbarFlagsEnabled
|
|
74
75
|
});
|
|
75
76
|
}
|
|
76
77
|
};
|
|
@@ -114,12 +114,12 @@ export var handleShowMediaViewer = function handleShowMediaViewer(_ref) {
|
|
|
114
114
|
var generateMediaCardFloatingToolbar = function generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, editorAnalyticsAPI, forceFocusSelector, isViewOnly) {
|
|
115
115
|
var _pluginInjectionApi$c;
|
|
116
116
|
var disableDownloadButton = getIsDownloadDisabledByDataSecurityPolicy(mediaPluginState);
|
|
117
|
-
var
|
|
117
|
+
var areAnyNewToolbarFlagsEnabled = areToolbarFlagsEnabled(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar));
|
|
118
118
|
var preview = {
|
|
119
119
|
id: 'editor.media.viewer',
|
|
120
120
|
testId: 'file-preview-toolbar-button',
|
|
121
121
|
type: 'button',
|
|
122
|
-
icon:
|
|
122
|
+
icon: areAnyNewToolbarFlagsEnabled ? GrowDiagonalIcon : MaximizeIcon,
|
|
123
123
|
title: intl.formatMessage(messages.preview),
|
|
124
124
|
onClick: function onClick() {
|
|
125
125
|
var _handleShowMediaViewe;
|
|
@@ -141,15 +141,15 @@ var generateMediaCardFloatingToolbar = function generateMediaCardFloatingToolbar
|
|
|
141
141
|
},
|
|
142
142
|
title: intl.formatMessage(messages.download),
|
|
143
143
|
disabled: disableDownloadButton
|
|
144
|
-
},
|
|
144
|
+
}, areAnyNewToolbarFlagsEnabled && {
|
|
145
145
|
supportsViewMode: true
|
|
146
146
|
});
|
|
147
|
-
if (isViewOnly && !
|
|
147
|
+
if (isViewOnly && !areAnyNewToolbarFlagsEnabled) {
|
|
148
148
|
return [];
|
|
149
149
|
}
|
|
150
150
|
var mediaGroup = state.schema.nodes.mediaGroup;
|
|
151
151
|
var items = [];
|
|
152
|
-
if (!
|
|
152
|
+
if (!areAnyNewToolbarFlagsEnabled) {
|
|
153
153
|
items.push({
|
|
154
154
|
id: 'editor.media.view.switcher.inline',
|
|
155
155
|
type: 'button',
|
|
@@ -269,7 +269,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
269
269
|
var toolbarButtons = [];
|
|
270
270
|
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 : {},
|
|
271
271
|
hoverDecoration = _ref2.hoverDecoration;
|
|
272
|
-
var
|
|
272
|
+
var areAnyNewToolbarFlagsEnabled = areToolbarFlagsEnabled(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar));
|
|
273
273
|
var disableDownloadButton = getIsDownloadDisabledByDataSecurityPolicy(pluginState);
|
|
274
274
|
if (shouldShowImageBorder(state)) {
|
|
275
275
|
toolbarButtons.push({
|
|
@@ -296,7 +296,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
296
296
|
});
|
|
297
297
|
}
|
|
298
298
|
});
|
|
299
|
-
if (!
|
|
299
|
+
if (!areAnyNewToolbarFlagsEnabled) {
|
|
300
300
|
toolbarButtons.push({
|
|
301
301
|
type: 'separator'
|
|
302
302
|
});
|
|
@@ -317,7 +317,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
317
317
|
}
|
|
318
318
|
var layoutButtons = buildLayoutButtons(state, intl, state.schema.nodes.mediaSingle, widthPlugin, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a3 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a3 === void 0 ? void 0 : _pluginInjectionApi$a3.actions, allowResizing, allowResizingInTables, true, true, isChangingLayoutDisabled, allowPixelResizing);
|
|
319
319
|
var addLayoutDropdownToToolbar = function addLayoutDropdownToToolbar() {
|
|
320
|
-
if (
|
|
320
|
+
if (areAnyNewToolbarFlagsEnabled) {
|
|
321
321
|
var _pluginInjectionApi$a4;
|
|
322
322
|
var layoutDropdown = buildLayoutDropdown(state, intl, state.schema.nodes.mediaSingle, widthPlugin, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a4 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions, allowResizing, allowResizingInTables, true, true, isChangingLayoutDisabled, allowPixelResizing);
|
|
323
323
|
toolbarButtons = [].concat(_toConsumableArray(toolbarButtons), _toConsumableArray(layoutDropdown));
|
|
@@ -332,7 +332,9 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
332
332
|
layoutButtons: layoutButtons
|
|
333
333
|
// Ignored via go/ees005
|
|
334
334
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
335
|
-
}, props
|
|
335
|
+
}, props, {
|
|
336
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
337
|
+
}));
|
|
336
338
|
},
|
|
337
339
|
width: 188,
|
|
338
340
|
height: 32
|
|
@@ -345,7 +347,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
345
347
|
title: intl.formatMessage(layoutToMessages[selectedLayoutIcon.value]),
|
|
346
348
|
icon: selectedLayoutIcon.icon
|
|
347
349
|
};
|
|
348
|
-
toolbarButtons = [].concat(_toConsumableArray(toolbarButtons), [trigger], _toConsumableArray(
|
|
350
|
+
toolbarButtons = [].concat(_toConsumableArray(toolbarButtons), [trigger], _toConsumableArray(areAnyNewToolbarFlagsEnabled ? [] : [{
|
|
349
351
|
type: 'separator'
|
|
350
352
|
}]));
|
|
351
353
|
}
|
|
@@ -367,7 +369,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
367
369
|
addLayoutDropdownToToolbar();
|
|
368
370
|
} else {
|
|
369
371
|
toolbarButtons = [].concat(_toConsumableArray(toolbarButtons), _toConsumableArray(layoutButtons));
|
|
370
|
-
if (layoutButtons.length && !
|
|
372
|
+
if (layoutButtons.length && !areAnyNewToolbarFlagsEnabled) {
|
|
371
373
|
toolbarButtons.push({
|
|
372
374
|
type: 'separator'
|
|
373
375
|
});
|
|
@@ -383,7 +385,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
383
385
|
var hasCaption = contains(selectedNode.node, state.schema.nodes.caption);
|
|
384
386
|
var inlineSwitcherTitle = intl.formatMessage(hasCaption ? mediaAndEmbedToolbarMessages.changeToMediaInlineImageCaptionWarning : mediaAndEmbedToolbarMessages.changeToMediaInlineImage);
|
|
385
387
|
var floatingSwitcherTitle = intl.formatMessage(mediaAndEmbedToolbarMessages.changeToMediaSingle);
|
|
386
|
-
if (!
|
|
388
|
+
if (!areAnyNewToolbarFlagsEnabled) {
|
|
387
389
|
var _pluginInjectionApi$a5;
|
|
388
390
|
toolbarButtons.push({
|
|
389
391
|
type: 'button',
|
|
@@ -428,7 +430,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
428
430
|
}
|
|
429
431
|
|
|
430
432
|
// A separator is needed regardless switcher is enabled or not
|
|
431
|
-
if (editorExperiment('platform_editor_toolbar_aifc', true)) {
|
|
433
|
+
if (Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar) && editorExperiment('platform_editor_toolbar_aifc', true)) {
|
|
432
434
|
toolbarButtons.push({
|
|
433
435
|
type: 'separator',
|
|
434
436
|
fullHeight: true
|
|
@@ -479,14 +481,14 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
479
481
|
}
|
|
480
482
|
return [sizeInput];
|
|
481
483
|
}
|
|
482
|
-
if (!
|
|
484
|
+
if (!areAnyNewToolbarFlagsEnabled) {
|
|
483
485
|
toolbarButtons.push(sizeInput);
|
|
484
486
|
toolbarButtons.push({
|
|
485
487
|
type: 'separator'
|
|
486
488
|
});
|
|
487
489
|
}
|
|
488
490
|
}
|
|
489
|
-
if (!
|
|
491
|
+
if (!areAnyNewToolbarFlagsEnabled) {
|
|
490
492
|
if (allowCommentsOnMedia) {
|
|
491
493
|
toolbarButtons.push(commentButton(intl, state, pluginInjectionApi, onCommentButtonMount), {
|
|
492
494
|
type: 'separator',
|
|
@@ -529,7 +531,8 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
529
531
|
onAddLink: editLink,
|
|
530
532
|
onEditLink: editLink,
|
|
531
533
|
onOpenLink: openLink,
|
|
532
|
-
isViewOnly: isViewOnly
|
|
534
|
+
isViewOnly: isViewOnly,
|
|
535
|
+
areAnyNewToolbarFlagsEnabled: false
|
|
533
536
|
});
|
|
534
537
|
}
|
|
535
538
|
return null;
|
|
@@ -584,7 +587,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
584
587
|
supportsViewMode: true
|
|
585
588
|
});
|
|
586
589
|
}
|
|
587
|
-
if (!
|
|
590
|
+
if (!areAnyNewToolbarFlagsEnabled) {
|
|
588
591
|
var _pluginInjectionApi$a8;
|
|
589
592
|
if (allowAltTextOnImages) {
|
|
590
593
|
var _pluginInjectionApi$a7;
|
|
@@ -750,7 +753,8 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
750
753
|
return getAltTextToolbar(baseToolbar, {
|
|
751
754
|
altTextValidator: altTextValidator,
|
|
752
755
|
forceFocusSelector: pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f === void 0 || (_pluginInjectionApi$f = _pluginInjectionApi$f.actions) === null || _pluginInjectionApi$f === void 0 ? void 0 : _pluginInjectionApi$f.forceFocusSelector,
|
|
753
|
-
triggerButtonSelector: overflowButtonSelector
|
|
756
|
+
triggerButtonSelector: overflowButtonSelector,
|
|
757
|
+
areAnyNewToolbarFlagsEnabled: areToolbarFlagsEnabled(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar))
|
|
754
758
|
});
|
|
755
759
|
}
|
|
756
760
|
}
|
|
@@ -798,7 +802,7 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
798
802
|
};
|
|
799
803
|
items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, pluginInjectionApi);
|
|
800
804
|
}
|
|
801
|
-
if (!mediaPluginState.isResizing && areToolbarFlagsEnabled()) {
|
|
805
|
+
if (!mediaPluginState.isResizing && areToolbarFlagsEnabled(Boolean(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.toolbar))) {
|
|
802
806
|
var _pluginInjectionApi$a0, _pluginInjectionApi$a1;
|
|
803
807
|
updateToFullHeightSeparator(items);
|
|
804
808
|
var customOptions = [].concat(_toConsumableArray(getLinkingDropdownOptions(state, intl, mediaLinkingState, allowMediaInline && selectedNodeType && selectedNodeType === mediaInline, allowLinking, isViewOnly)), _toConsumableArray(getAltTextDropdownOption(state, intl.formatMessage, allowAltTextOnImages, selectedNodeType, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a0 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a0 === void 0 ? void 0 : _pluginInjectionApi$a0.actions)), _toConsumableArray(getResizeDropdownOption(options, state, intl.formatMessage, selectedNodeType)));
|
|
@@ -14,16 +14,19 @@ var containerStyles = xcss({
|
|
|
14
14
|
export var LayoutGroup = function LayoutGroup(_ref) {
|
|
15
15
|
var layoutButtons = _ref.layoutButtons,
|
|
16
16
|
dispatchCommand = _ref.dispatchCommand,
|
|
17
|
-
hide = _ref.hide
|
|
17
|
+
hide = _ref.hide,
|
|
18
|
+
areAnyNewToolbarFlagsEnabled = _ref.areAnyNewToolbarFlagsEnabled;
|
|
18
19
|
return jsx(Box, {
|
|
19
20
|
xcss: containerStyles
|
|
20
21
|
}, jsx(ButtonGroup, null, layoutButtons.map(function (item, idx) {
|
|
21
22
|
switch (item.type) {
|
|
22
23
|
case 'separator':
|
|
24
|
+
return jsx(FloatingToolbarSeparator
|
|
23
25
|
// Ignored via go/ees005
|
|
24
26
|
// eslint-disable-next-line react/no-array-index-key
|
|
25
|
-
|
|
26
|
-
key: idx
|
|
27
|
+
, {
|
|
28
|
+
key: idx,
|
|
29
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
27
30
|
});
|
|
28
31
|
case 'button':
|
|
29
32
|
// Ignored via go/ees005
|
|
@@ -43,7 +46,8 @@ export var LayoutGroup = function LayoutGroup(_ref) {
|
|
|
43
46
|
onClick: function onClick() {
|
|
44
47
|
dispatchCommand(item.onClick);
|
|
45
48
|
hide();
|
|
46
|
-
}
|
|
49
|
+
},
|
|
50
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
47
51
|
});
|
|
48
52
|
}
|
|
49
53
|
})));
|
|
@@ -28,7 +28,8 @@ export var LinkToolbarAppearance = function LinkToolbarAppearance(_ref) {
|
|
|
28
28
|
onEditLink = _ref.onEditLink,
|
|
29
29
|
onOpenLink = _ref.onOpenLink,
|
|
30
30
|
isInlineNode = _ref.isInlineNode,
|
|
31
|
-
isViewOnly = _ref.isViewOnly
|
|
31
|
+
isViewOnly = _ref.isViewOnly,
|
|
32
|
+
areAnyNewToolbarFlagsEnabled = _ref.areAnyNewToolbarFlagsEnabled;
|
|
32
33
|
var _useState = useState(true),
|
|
33
34
|
_useState2 = _slicedToArray(_useState, 2),
|
|
34
35
|
showLinkingControls = _useState2[0],
|
|
@@ -65,7 +66,8 @@ export var LinkToolbarAppearance = function LinkToolbarAppearance(_ref) {
|
|
|
65
66
|
description: title,
|
|
66
67
|
keymap: addLink
|
|
67
68
|
}),
|
|
68
|
-
testId: "edit-link-button"
|
|
69
|
+
testId: "edit-link-button",
|
|
70
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
69
71
|
}, title)), jsx(ToolbarButton, {
|
|
70
72
|
target: "_blank",
|
|
71
73
|
href: isValidUrl ? mediaLinkingState.link : undefined,
|
|
@@ -79,8 +81,11 @@ export var LinkToolbarAppearance = function LinkToolbarAppearance(_ref) {
|
|
|
79
81
|
})
|
|
80
82
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
81
83
|
,
|
|
82
|
-
className: "hyperlink-open-link"
|
|
83
|
-
|
|
84
|
+
className: "hyperlink-open-link",
|
|
85
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
86
|
+
}), jsx(Separator, {
|
|
87
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
88
|
+
}));
|
|
84
89
|
} else {
|
|
85
90
|
var _title = intl.formatMessage(linkToolbarMessages.addLink);
|
|
86
91
|
return !isViewOnly ? jsx(Fragment, null, jsx(ToolbarButton, {
|
|
@@ -95,7 +100,10 @@ export var LinkToolbarAppearance = function LinkToolbarAppearance(_ref) {
|
|
|
95
100
|
color: "currentColor",
|
|
96
101
|
label: _title,
|
|
97
102
|
spacing: "spacious"
|
|
98
|
-
})
|
|
99
|
-
|
|
103
|
+
}),
|
|
104
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
105
|
+
}), jsx(Separator, {
|
|
106
|
+
areAnyNewToolbarFlagsEnabled: areAnyNewToolbarFlagsEnabled
|
|
107
|
+
})) : null;
|
|
100
108
|
}
|
|
101
109
|
};
|