@atlaskit/editor-plugin-media 2.7.3 → 3.0.1
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 +21 -0
- package/dist/cjs/pm-plugins/pixel-resizing/ui/styles.js +1 -1
- package/dist/cjs/ui/toolbar/commands.js +12 -1
- package/dist/cjs/ui/toolbar/index.js +48 -10
- package/dist/cjs/ui/toolbar/linking.js +2 -1
- package/dist/cjs/ui/toolbar/mediaInline.js +4 -4
- package/dist/es2019/pm-plugins/pixel-resizing/ui/styles.js +1 -1
- package/dist/es2019/ui/toolbar/commands.js +12 -1
- package/dist/es2019/ui/toolbar/index.js +49 -11
- package/dist/es2019/ui/toolbar/linking.js +2 -1
- package/dist/es2019/ui/toolbar/mediaInline.js +5 -5
- package/dist/esm/pm-plugins/pixel-resizing/ui/styles.js +1 -1
- package/dist/esm/ui/toolbar/commands.js +12 -1
- package/dist/esm/ui/toolbar/index.js +49 -11
- package/dist/esm/ui/toolbar/linking.js +2 -1
- package/dist/esm/ui/toolbar/mediaInline.js +5 -5
- package/dist/types/ui/toolbar/commands.d.ts +1 -0
- package/dist/types-ts4.5/ui/toolbar/commands.d.ts +1 -0
- package/package.json +12 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-media
|
|
2
2
|
|
|
3
|
+
## 3.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#150219](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/150219)
|
|
8
|
+
[`8f6e3a7613db0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8f6e3a7613db0) -
|
|
9
|
+
Fixes invalid css comments in template literal styles
|
|
10
|
+
- [#150731](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/150731)
|
|
11
|
+
[`e21eb5fc3b241`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e21eb5fc3b241) -
|
|
12
|
+
ED-27860 Fix media deleted events and update inputMethod to floatingToolbar for expands
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 3.0.0
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- [#149482](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/149482)
|
|
20
|
+
[`1f1f73876c3c8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1f1f73876c3c8) -
|
|
21
|
+
ED-27860 Add analytics for copy and delete button in floating toolbars
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 2.7.3
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -11,7 +11,7 @@ var _templateObject; // eslint-disable-next-line @atlaskit/ui-styling-standard/u
|
|
|
11
11
|
var PIXEL_SIZING_WRAPPER_MINIMUM_WIDTH = 120;
|
|
12
12
|
|
|
13
13
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
14
|
-
var pixelSizingWrapper = exports.pixelSizingWrapper = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\tdisplay: grid;\n\tgrid-template-columns: 1fr 1em 1fr 0;\n\tgrid-template-rows: auto;\n\tgrid-template-areas: 'widthinput label heightinput submit';\n\twidth: ", "px;\n\ttext-align: center;\n\theight: ", ";\n\n\t
|
|
14
|
+
var pixelSizingWrapper = exports.pixelSizingWrapper = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\tdisplay: grid;\n\tgrid-template-columns: 1fr 1em 1fr 0;\n\tgrid-template-rows: auto;\n\tgrid-template-areas: 'widthinput label heightinput submit';\n\twidth: ", "px;\n\ttext-align: center;\n\theight: ", ";\n\n\t/* Atlaskit fieldset does not allow style override */\n\t& > * {\n\t\tmargin-top: 0 !important;\n\t}\n"])), PIXEL_SIZING_WRAPPER_MINIMUM_WIDTH, "var(--ds-space-300, 24px)");
|
|
15
15
|
|
|
16
16
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
17
17
|
var pixelEntryForm = exports.pixelEntryForm = (0, _react.css)({
|
|
@@ -4,9 +4,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.updateMediaSingleWidthTr = exports.updateMediaSingleWidth = exports.toggleBorderMark = exports.setBorderMark = exports.removeInlineCard = exports.getNodeType = exports.changeMediaSingleToMediaInline = exports.changeMediaInlineToMediaSingle = exports.changeMediaCardToInline = exports.changeInlineToMediaCard = exports.DEFAULT_BORDER_SIZE = exports.DEFAULT_BORDER_COLOR = void 0;
|
|
7
|
+
exports.updateMediaSingleWidthTr = exports.updateMediaSingleWidth = exports.toggleBorderMark = exports.setBorderMark = exports.removeInlineCardWithAnalytics = exports.removeInlineCard = exports.getNodeType = exports.changeMediaSingleToMediaInline = exports.changeMediaInlineToMediaSingle = exports.changeMediaCardToInline = exports.changeInlineToMediaCard = exports.DEFAULT_BORDER_SIZE = exports.DEFAULT_BORDER_COLOR = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
10
|
+
var _editorAnalytics = require("@atlaskit/editor-common/editor-analytics");
|
|
10
11
|
var _mediaSingle = require("@atlaskit/editor-common/media-single");
|
|
11
12
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
12
13
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
@@ -143,6 +144,16 @@ var changeMediaInlineToMediaSingle = exports.changeMediaInlineToMediaSingle = fu
|
|
|
143
144
|
return true;
|
|
144
145
|
};
|
|
145
146
|
};
|
|
147
|
+
var removeInlineCardWithAnalytics = exports.removeInlineCardWithAnalytics = function removeInlineCardWithAnalytics(editorAnalyticsAPI) {
|
|
148
|
+
return (0, _editorAnalytics.withAnalytics)(editorAnalyticsAPI, {
|
|
149
|
+
action: _analytics.ACTION.DELETED,
|
|
150
|
+
actionSubject: _analytics.ACTION_SUBJECT.MEDIA_INLINE,
|
|
151
|
+
attributes: {
|
|
152
|
+
inputMethod: _analytics.INPUT_METHOD.FLOATING_TB
|
|
153
|
+
},
|
|
154
|
+
eventType: _analytics.EVENT_TYPE.TRACK
|
|
155
|
+
})(removeInlineCard);
|
|
156
|
+
};
|
|
146
157
|
var removeInlineCard = exports.removeInlineCard = function removeInlineCard(state, dispatch) {
|
|
147
158
|
if ((0, _utils.isNodeSelection)(state.selection)) {
|
|
148
159
|
if (dispatch) {
|
|
@@ -12,6 +12,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
12
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
13
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
14
14
|
var _card = require("@atlaskit/editor-common/card");
|
|
15
|
+
var _editorAnalytics = require("@atlaskit/editor-common/editor-analytics");
|
|
15
16
|
var _mediaInline = require("@atlaskit/editor-common/media-inline");
|
|
16
17
|
var _messages = _interopRequireWildcard(require("@atlaskit/editor-common/messages"));
|
|
17
18
|
var _state2 = require("@atlaskit/editor-prosemirror/state");
|
|
@@ -62,12 +63,48 @@ var mediaTypeMessages = {
|
|
|
62
63
|
archive: _mediaUi.messages.file_archive_is_selected,
|
|
63
64
|
unknown: _mediaUi.messages.file_unknown_is_selected
|
|
64
65
|
};
|
|
66
|
+
var getMediaActionSubject = function getMediaActionSubject(nodeType) {
|
|
67
|
+
switch (nodeType.name) {
|
|
68
|
+
case 'mediaSingle':
|
|
69
|
+
return _analytics.ACTION_SUBJECT.MEDIA_SINGLE;
|
|
70
|
+
case 'mediaInline':
|
|
71
|
+
return _analytics.ACTION_SUBJECT.MEDIA_INLINE;
|
|
72
|
+
case 'mediaGroup':
|
|
73
|
+
return _analytics.ACTION_SUBJECT.MEDIA_GROUP;
|
|
74
|
+
default:
|
|
75
|
+
return _analytics.ACTION_SUBJECT.MEDIA;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
var removeWithAnalytics = function removeWithAnalytics(editorAnalyticsApi, nodeType) {
|
|
79
|
+
if (!nodeType) {
|
|
80
|
+
return remove;
|
|
81
|
+
}
|
|
82
|
+
var mediaType = getMediaActionSubject(nodeType);
|
|
83
|
+
return (0, _editorAnalytics.withAnalytics)(editorAnalyticsApi, {
|
|
84
|
+
action: _analytics.ACTION.DELETED,
|
|
85
|
+
actionSubject: mediaType,
|
|
86
|
+
attributes: {
|
|
87
|
+
inputMethod: _analytics.INPUT_METHOD.FLOATING_TB
|
|
88
|
+
},
|
|
89
|
+
eventType: _analytics.EVENT_TYPE.TRACK
|
|
90
|
+
})(remove);
|
|
91
|
+
};
|
|
65
92
|
var remove = function remove(state, dispatch) {
|
|
66
93
|
if (dispatch) {
|
|
67
94
|
dispatch((0, _utils.removeSelectedNode)(state.tr));
|
|
68
95
|
}
|
|
69
96
|
return true;
|
|
70
97
|
};
|
|
98
|
+
var handleRemoveMediaGroupWithAnalytics = function handleRemoveMediaGroupWithAnalytics(editorAnalyticsApi) {
|
|
99
|
+
return (0, _editorAnalytics.withAnalytics)(editorAnalyticsApi, {
|
|
100
|
+
action: _analytics.ACTION.DELETED,
|
|
101
|
+
actionSubject: _analytics.ACTION_SUBJECT.MEDIA_GROUP,
|
|
102
|
+
attributes: {
|
|
103
|
+
inputMethod: _analytics.INPUT_METHOD.FLOATING_TB
|
|
104
|
+
},
|
|
105
|
+
eventType: _analytics.EVENT_TYPE.TRACK
|
|
106
|
+
})(handleRemoveMediaGroup);
|
|
107
|
+
};
|
|
71
108
|
var handleRemoveMediaGroup = function handleRemoveMediaGroup(state, dispatch) {
|
|
72
109
|
var tr = (0, _utils2.removeMediaGroupNode)(state);
|
|
73
110
|
if (dispatch) {
|
|
@@ -179,7 +216,7 @@ var generateMediaCardFloatingToolbar = function generateMediaCardFloatingToolbar
|
|
|
179
216
|
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaGroup, true),
|
|
180
217
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaGroup, false),
|
|
181
218
|
title: intl.formatMessage(_messages.default.remove),
|
|
182
|
-
onClick: handleRemoveMediaGroup,
|
|
219
|
+
onClick: (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_analytics_2') ? handleRemoveMediaGroupWithAnalytics(editorAnalyticsAPI) : handleRemoveMediaGroup,
|
|
183
220
|
testId: 'media-toolbar-remove-button'
|
|
184
221
|
});
|
|
185
222
|
} else {
|
|
@@ -407,7 +444,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
407
444
|
icon: /*#__PURE__*/_react.default.createElement(_imageInline.default, {
|
|
408
445
|
color: "currentColor",
|
|
409
446
|
spacing: "spacious",
|
|
410
|
-
label: inlineTitle,
|
|
447
|
+
label: (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_7') ? '' : inlineTitle,
|
|
411
448
|
LEGACY_size: "medium",
|
|
412
449
|
LEGACY_fallbackIcon: _card.IconInline
|
|
413
450
|
}),
|
|
@@ -426,7 +463,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
426
463
|
}) : /*#__PURE__*/_react.default.createElement(_imageFullscreen.default, {
|
|
427
464
|
color: "currentColor",
|
|
428
465
|
spacing: "spacious",
|
|
429
|
-
label: floatingSwitcherTitle,
|
|
466
|
+
label: (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_7') ? '' : floatingSwitcherTitle,
|
|
430
467
|
LEGACY_size: "medium",
|
|
431
468
|
LEGACY_fallbackIcon: _card.IconEmbed
|
|
432
469
|
})
|
|
@@ -609,6 +646,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
609
646
|
});
|
|
610
647
|
}
|
|
611
648
|
if (!isEditorControlsEnabled) {
|
|
649
|
+
var _pluginInjectionApi$a9;
|
|
612
650
|
if (allowAltTextOnImages) {
|
|
613
651
|
var _pluginInjectionApi$a8;
|
|
614
652
|
toolbarButtons.push((0, _altText2.altTextButton)(intl, state, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a8 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a8 === void 0 ? void 0 : _pluginInjectionApi$a8.actions), {
|
|
@@ -627,7 +665,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
627
665
|
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaSingle, true),
|
|
628
666
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaSingle, false),
|
|
629
667
|
title: intl.formatMessage(_messages.default.remove),
|
|
630
|
-
onClick: remove,
|
|
668
|
+
onClick: (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_analytics_2') ? removeWithAnalytics(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a9 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a9 === void 0 ? void 0 : _pluginInjectionApi$a9.actions) : remove,
|
|
631
669
|
testId: 'media-toolbar-remove-button',
|
|
632
670
|
supportsViewMode: false
|
|
633
671
|
};
|
|
@@ -785,7 +823,7 @@ var floatingToolbar = exports.floatingToolbar = function floatingToolbar(state,
|
|
|
785
823
|
selectedNodeType = state.selection.node.type;
|
|
786
824
|
}
|
|
787
825
|
if (allowMediaInline && (parentMediaGroupNode === null || parentMediaGroupNode === void 0 ? void 0 : parentMediaGroupNode.node.type) === mediaGroup) {
|
|
788
|
-
var _pluginInjectionApi$
|
|
826
|
+
var _pluginInjectionApi$a10, _pluginInjectionApi$f2;
|
|
789
827
|
var mediaOffset = state.selection.$from.parentOffset + 1;
|
|
790
828
|
baseToolbar.getDomRef = function () {
|
|
791
829
|
var _mediaPluginState$ele2;
|
|
@@ -794,7 +832,7 @@ var floatingToolbar = exports.floatingToolbar = function floatingToolbar(state,
|
|
|
794
832
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
795
833
|
return (_mediaPluginState$ele2 = mediaPluginState.element) === null || _mediaPluginState$ele2 === void 0 ? void 0 : _mediaPluginState$ele2.querySelector(selector);
|
|
796
834
|
};
|
|
797
|
-
items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$
|
|
835
|
+
items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a10 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a10 === void 0 ? void 0 : _pluginInjectionApi$a10.actions, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f2 = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f2 === void 0 || (_pluginInjectionApi$f2 = _pluginInjectionApi$f2.actions) === null || _pluginInjectionApi$f2 === void 0 ? void 0 : _pluginInjectionApi$f2.forceFocusSelector, isViewOnly);
|
|
798
836
|
} else if (allowMediaInline && selectedNodeType && selectedNodeType === mediaInline) {
|
|
799
837
|
items = (0, _mediaInline2.generateMediaInlineFloatingToolbar)(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, options);
|
|
800
838
|
} else {
|
|
@@ -808,9 +846,9 @@ var floatingToolbar = exports.floatingToolbar = function floatingToolbar(state,
|
|
|
808
846
|
items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, pluginInjectionApi);
|
|
809
847
|
}
|
|
810
848
|
if (!mediaPluginState.isResizing && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
811
|
-
var _pluginInjectionApi$
|
|
849
|
+
var _pluginInjectionApi$a11, _pluginInjectionApi$a12;
|
|
812
850
|
(0, _utils2.updateToFullHeightSeparator)(items);
|
|
813
|
-
var customOptions = [].concat((0, _toConsumableArray2.default)((0, _linking3.getLinkingDropdownOptions)(state, intl, mediaLinkingState, allowMediaInline && selectedNodeType && selectedNodeType === mediaInline, allowLinking, isViewOnly)), (0, _toConsumableArray2.default)((0, _altText2.getAltTextDropdownOption)(state, intl.formatMessage, allowAltTextOnImages, selectedNodeType, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$
|
|
851
|
+
var customOptions = [].concat((0, _toConsumableArray2.default)((0, _linking3.getLinkingDropdownOptions)(state, intl, mediaLinkingState, allowMediaInline && selectedNodeType && selectedNodeType === mediaInline, allowLinking, isViewOnly)), (0, _toConsumableArray2.default)((0, _altText2.getAltTextDropdownOption)(state, intl.formatMessage, allowAltTextOnImages, selectedNodeType, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a11 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a11 === void 0 ? void 0 : _pluginInjectionApi$a11.actions)), (0, _toConsumableArray2.default)((0, _pixelResizing2.getResizeDropdownOption)(options, state, intl.formatMessage, selectedNodeType)));
|
|
814
852
|
if (customOptions.length) {
|
|
815
853
|
customOptions.push({
|
|
816
854
|
type: 'separator'
|
|
@@ -832,7 +870,7 @@ var floatingToolbar = exports.floatingToolbar = function floatingToolbar(state,
|
|
|
832
870
|
onClick: function onClick() {
|
|
833
871
|
var _pluginInjectionApi$c4, _pluginInjectionApi$f3;
|
|
834
872
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c4 = pluginInjectionApi.core) === null || _pluginInjectionApi$c4 === void 0 || _pluginInjectionApi$c4.actions.execute( // @ts-ignore
|
|
835
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f3 = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f3 === void 0 ? void 0 : _pluginInjectionApi$f3.commands.copyNode(nodeType));
|
|
873
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f3 = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f3 === void 0 ? void 0 : _pluginInjectionApi$f3.commands.copyNode(nodeType, _analytics.INPUT_METHOD.FLOATING_TB));
|
|
836
874
|
return true;
|
|
837
875
|
},
|
|
838
876
|
icon: /*#__PURE__*/_react.default.createElement(_copy.default, {
|
|
@@ -840,7 +878,7 @@ var floatingToolbar = exports.floatingToolbar = function floatingToolbar(state,
|
|
|
840
878
|
})
|
|
841
879
|
}, hoverDecorationProps(nodeType, _editorSharedStyles.akEditorSelectedNodeClassName)), _objectSpread({
|
|
842
880
|
title: intl === null || intl === void 0 ? void 0 : intl.formatMessage(_messages.default.delete),
|
|
843
|
-
onClick: remove,
|
|
881
|
+
onClick: (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_analytics_2') ? removeWithAnalytics(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a12 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a12 === void 0 ? void 0 : _pluginInjectionApi$a12.actions, selectedNodeType) : remove,
|
|
844
882
|
icon: /*#__PURE__*/_react.default.createElement(_delete.default, {
|
|
845
883
|
label: ""
|
|
846
884
|
})
|
|
@@ -14,6 +14,7 @@ var _messages = require("@atlaskit/editor-common/messages");
|
|
|
14
14
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
15
15
|
var _link = _interopRequireDefault(require("@atlaskit/icon/core/link"));
|
|
16
16
|
var _linkExternal = _interopRequireDefault(require("@atlaskit/icon/core/link-external"));
|
|
17
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
18
|
var _linking = require("../../pm-plugins/commands/linking");
|
|
18
19
|
var _linking2 = require("../../pm-plugins/linking");
|
|
19
20
|
var _currentMediaNode = require("../../pm-plugins/utils/current-media-node");
|
|
@@ -136,7 +137,7 @@ var getLinkingDropdownOptions = exports.getLinkingDropdownOptions = function get
|
|
|
136
137
|
return true;
|
|
137
138
|
},
|
|
138
139
|
icon: /*#__PURE__*/_react.default.createElement(_link.default, {
|
|
139
|
-
label: title
|
|
140
|
+
label: (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_7') ? '' : title
|
|
140
141
|
})
|
|
141
142
|
}];
|
|
142
143
|
} else {
|
|
@@ -137,7 +137,7 @@ var generateMediaInlineFloatingToolbar = exports.generateMediaInlineFloatingTool
|
|
|
137
137
|
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaInline, true),
|
|
138
138
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaInline, false),
|
|
139
139
|
title: intl.formatMessage(_messages.default.remove),
|
|
140
|
-
onClick: _commands.removeInlineCard,
|
|
140
|
+
onClick: (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_analytics_2') ? (0, _commands.removeInlineCardWithAnalytics)(editorAnalyticsAPI) : _commands.removeInlineCard,
|
|
141
141
|
testId: 'media-toolbar-remove-button'
|
|
142
142
|
});
|
|
143
143
|
} else {
|
|
@@ -333,7 +333,7 @@ var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(state, intl
|
|
|
333
333
|
icon: /*#__PURE__*/_react.default.createElement(_imageInline.default, {
|
|
334
334
|
color: "currentColor",
|
|
335
335
|
spacing: "spacious",
|
|
336
|
-
label: mediaInlineImageTitle,
|
|
336
|
+
label: (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_7') ? '' : mediaInlineImageTitle,
|
|
337
337
|
LEGACY_size: "medium",
|
|
338
338
|
LEGACY_fallbackIcon: _card.IconInline
|
|
339
339
|
})
|
|
@@ -348,7 +348,7 @@ var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(state, intl
|
|
|
348
348
|
}) : /*#__PURE__*/_react.default.createElement(_imageFullscreen.default, {
|
|
349
349
|
color: "currentColor",
|
|
350
350
|
spacing: "spacious",
|
|
351
|
-
label: mediaSingleTitle,
|
|
351
|
+
label: (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_7') ? '' : mediaSingleTitle,
|
|
352
352
|
LEGACY_size: "medium",
|
|
353
353
|
LEGACY_fallbackIcon: _card.IconEmbed
|
|
354
354
|
})
|
|
@@ -450,7 +450,7 @@ var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(state, intl
|
|
|
450
450
|
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaInline, true),
|
|
451
451
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaInline, false),
|
|
452
452
|
title: intl.formatMessage(_messages.default.remove),
|
|
453
|
-
onClick: _commands.removeInlineCard,
|
|
453
|
+
onClick: (0, _platformFeatureFlags.fg)('platform_editor_controls_patch_analytics_2') ? (0, _commands.removeInlineCardWithAnalytics)(editorAnalyticsAPI) : _commands.removeInlineCard,
|
|
454
454
|
testId: 'media-toolbar-remove-button'
|
|
455
455
|
});
|
|
456
456
|
}
|
|
@@ -12,7 +12,7 @@ export const pixelSizingWrapper = css`
|
|
|
12
12
|
text-align: center;
|
|
13
13
|
height: ${"var(--ds-space-300, 24px)"};
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
/* Atlaskit fieldset does not allow style override */
|
|
16
16
|
& > * {
|
|
17
17
|
margin-top: 0 !important;
|
|
18
18
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
1
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
|
2
3
|
import { currentMediaNodeWithPos } from '@atlaskit/editor-common/media-single';
|
|
3
4
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
4
5
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -133,6 +134,16 @@ export const changeMediaInlineToMediaSingle = (editorAnalyticsAPI, widthPluginSt
|
|
|
133
134
|
}
|
|
134
135
|
return true;
|
|
135
136
|
};
|
|
137
|
+
export const removeInlineCardWithAnalytics = editorAnalyticsAPI => {
|
|
138
|
+
return withAnalytics(editorAnalyticsAPI, {
|
|
139
|
+
action: ACTION.DELETED,
|
|
140
|
+
actionSubject: ACTION_SUBJECT.MEDIA_INLINE,
|
|
141
|
+
attributes: {
|
|
142
|
+
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
143
|
+
},
|
|
144
|
+
eventType: EVENT_TYPE.TRACK
|
|
145
|
+
})(removeInlineCard);
|
|
146
|
+
};
|
|
136
147
|
export const removeInlineCard = (state, dispatch) => {
|
|
137
148
|
if (isNodeSelection(state.selection)) {
|
|
138
149
|
if (dispatch) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
4
|
import { alignmentIcons, buildLayoutButtons, buildLayoutDropdown, IconCard, IconEmbed, IconInline, layoutToMessages, wrappingIcons } from '@atlaskit/editor-common/card';
|
|
5
|
+
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
|
5
6
|
import { mediaInlineImagesEnabled } from '@atlaskit/editor-common/media-inline';
|
|
6
7
|
import commonMessages, { cardMessages, mediaAndEmbedToolbarMessages } from '@atlaskit/editor-common/messages';
|
|
7
8
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -48,12 +49,48 @@ const mediaTypeMessages = {
|
|
|
48
49
|
archive: messages.file_archive_is_selected,
|
|
49
50
|
unknown: messages.file_unknown_is_selected
|
|
50
51
|
};
|
|
52
|
+
const getMediaActionSubject = nodeType => {
|
|
53
|
+
switch (nodeType.name) {
|
|
54
|
+
case 'mediaSingle':
|
|
55
|
+
return ACTION_SUBJECT.MEDIA_SINGLE;
|
|
56
|
+
case 'mediaInline':
|
|
57
|
+
return ACTION_SUBJECT.MEDIA_INLINE;
|
|
58
|
+
case 'mediaGroup':
|
|
59
|
+
return ACTION_SUBJECT.MEDIA_GROUP;
|
|
60
|
+
default:
|
|
61
|
+
return ACTION_SUBJECT.MEDIA;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const removeWithAnalytics = (editorAnalyticsApi, nodeType) => {
|
|
65
|
+
if (!nodeType) {
|
|
66
|
+
return remove;
|
|
67
|
+
}
|
|
68
|
+
const mediaType = getMediaActionSubject(nodeType);
|
|
69
|
+
return withAnalytics(editorAnalyticsApi, {
|
|
70
|
+
action: ACTION.DELETED,
|
|
71
|
+
actionSubject: mediaType,
|
|
72
|
+
attributes: {
|
|
73
|
+
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
74
|
+
},
|
|
75
|
+
eventType: EVENT_TYPE.TRACK
|
|
76
|
+
})(remove);
|
|
77
|
+
};
|
|
51
78
|
const remove = (state, dispatch) => {
|
|
52
79
|
if (dispatch) {
|
|
53
80
|
dispatch(removeSelectedNode(state.tr));
|
|
54
81
|
}
|
|
55
82
|
return true;
|
|
56
83
|
};
|
|
84
|
+
const handleRemoveMediaGroupWithAnalytics = editorAnalyticsApi => {
|
|
85
|
+
return withAnalytics(editorAnalyticsApi, {
|
|
86
|
+
action: ACTION.DELETED,
|
|
87
|
+
actionSubject: ACTION_SUBJECT.MEDIA_GROUP,
|
|
88
|
+
attributes: {
|
|
89
|
+
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
90
|
+
},
|
|
91
|
+
eventType: EVENT_TYPE.TRACK
|
|
92
|
+
})(handleRemoveMediaGroup);
|
|
93
|
+
};
|
|
57
94
|
const handleRemoveMediaGroup = (state, dispatch) => {
|
|
58
95
|
const tr = removeMediaGroupNode(state);
|
|
59
96
|
if (dispatch) {
|
|
@@ -167,7 +204,7 @@ const generateMediaCardFloatingToolbar = (state, intl, mediaPluginState, hoverDe
|
|
|
167
204
|
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaGroup, true),
|
|
168
205
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaGroup, false),
|
|
169
206
|
title: intl.formatMessage(commonMessages.remove),
|
|
170
|
-
onClick: handleRemoveMediaGroup,
|
|
207
|
+
onClick: fg('platform_editor_controls_patch_analytics_2') ? handleRemoveMediaGroupWithAnalytics(editorAnalyticsAPI) : handleRemoveMediaGroup,
|
|
171
208
|
testId: 'media-toolbar-remove-button'
|
|
172
209
|
});
|
|
173
210
|
} else {
|
|
@@ -394,7 +431,7 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
394
431
|
icon: /*#__PURE__*/React.createElement(ImageInlineIcon, {
|
|
395
432
|
color: "currentColor",
|
|
396
433
|
spacing: "spacious",
|
|
397
|
-
label: inlineTitle,
|
|
434
|
+
label: fg('platform_editor_controls_patch_7') ? '' : inlineTitle,
|
|
398
435
|
LEGACY_size: "medium",
|
|
399
436
|
LEGACY_fallbackIcon: IconInline
|
|
400
437
|
}),
|
|
@@ -413,7 +450,7 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
413
450
|
}) : /*#__PURE__*/React.createElement(ImageFullscreenIcon, {
|
|
414
451
|
color: "currentColor",
|
|
415
452
|
spacing: "spacious",
|
|
416
|
-
label: floatingSwitcherTitle,
|
|
453
|
+
label: fg('platform_editor_controls_patch_7') ? '' : floatingSwitcherTitle,
|
|
417
454
|
LEGACY_size: "medium",
|
|
418
455
|
LEGACY_fallbackIcon: IconEmbed
|
|
419
456
|
})
|
|
@@ -604,6 +641,7 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
604
641
|
});
|
|
605
642
|
}
|
|
606
643
|
if (!isEditorControlsEnabled) {
|
|
644
|
+
var _pluginInjectionApi$a9;
|
|
607
645
|
if (allowAltTextOnImages) {
|
|
608
646
|
var _pluginInjectionApi$a8;
|
|
609
647
|
toolbarButtons.push(altTextButton(intl, state, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a8 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a8 === void 0 ? void 0 : _pluginInjectionApi$a8.actions), {
|
|
@@ -622,7 +660,7 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
622
660
|
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaSingle, true),
|
|
623
661
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaSingle, false),
|
|
624
662
|
title: intl.formatMessage(commonMessages.remove),
|
|
625
|
-
onClick: remove,
|
|
663
|
+
onClick: fg('platform_editor_controls_patch_analytics_2') ? removeWithAnalytics(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a9 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a9 === void 0 ? void 0 : _pluginInjectionApi$a9.actions) : remove,
|
|
626
664
|
testId: 'media-toolbar-remove-button',
|
|
627
665
|
supportsViewMode: false
|
|
628
666
|
};
|
|
@@ -784,7 +822,7 @@ export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi) =
|
|
|
784
822
|
selectedNodeType = state.selection.node.type;
|
|
785
823
|
}
|
|
786
824
|
if (allowMediaInline && (parentMediaGroupNode === null || parentMediaGroupNode === void 0 ? void 0 : parentMediaGroupNode.node.type) === mediaGroup) {
|
|
787
|
-
var _pluginInjectionApi$
|
|
825
|
+
var _pluginInjectionApi$a10, _pluginInjectionApi$f3, _pluginInjectionApi$f4;
|
|
788
826
|
const mediaOffset = state.selection.$from.parentOffset + 1;
|
|
789
827
|
baseToolbar.getDomRef = () => {
|
|
790
828
|
var _mediaPluginState$ele2;
|
|
@@ -793,7 +831,7 @@ export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi) =
|
|
|
793
831
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
794
832
|
return (_mediaPluginState$ele2 = mediaPluginState.element) === null || _mediaPluginState$ele2 === void 0 ? void 0 : _mediaPluginState$ele2.querySelector(selector);
|
|
795
833
|
};
|
|
796
|
-
items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
834
|
+
items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a10 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a10 === void 0 ? void 0 : _pluginInjectionApi$a10.actions, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$f3 = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f3 === void 0 ? void 0 : (_pluginInjectionApi$f4 = _pluginInjectionApi$f3.actions) === null || _pluginInjectionApi$f4 === void 0 ? void 0 : _pluginInjectionApi$f4.forceFocusSelector, isViewOnly);
|
|
797
835
|
} else if (allowMediaInline && selectedNodeType && selectedNodeType === mediaInline) {
|
|
798
836
|
items = generateMediaInlineFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, options);
|
|
799
837
|
} else {
|
|
@@ -807,9 +845,9 @@ export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi) =
|
|
|
807
845
|
items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, pluginInjectionApi);
|
|
808
846
|
}
|
|
809
847
|
if (!mediaPluginState.isResizing && editorExperiment('platform_editor_controls', 'variant1')) {
|
|
810
|
-
var _pluginInjectionApi$
|
|
848
|
+
var _pluginInjectionApi$a11, _pluginInjectionApi$a12;
|
|
811
849
|
updateToFullHeightSeparator(items);
|
|
812
|
-
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$
|
|
850
|
+
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$a11 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a11 === void 0 ? void 0 : _pluginInjectionApi$a11.actions), ...getResizeDropdownOption(options, state, intl.formatMessage, selectedNodeType)];
|
|
813
851
|
if (customOptions.length) {
|
|
814
852
|
customOptions.push({
|
|
815
853
|
type: 'separator'
|
|
@@ -829,7 +867,7 @@ export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi) =
|
|
|
829
867
|
onClick: () => {
|
|
830
868
|
var _pluginInjectionApi$c10, _pluginInjectionApi$f5;
|
|
831
869
|
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$c10 = pluginInjectionApi.core) === null || _pluginInjectionApi$c10 === void 0 ? void 0 : _pluginInjectionApi$c10.actions.execute( // @ts-ignore
|
|
832
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$f5 = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f5 === void 0 ? void 0 : _pluginInjectionApi$f5.commands.copyNode(nodeType));
|
|
870
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$f5 = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f5 === void 0 ? void 0 : _pluginInjectionApi$f5.commands.copyNode(nodeType, INPUT_METHOD.FLOATING_TB));
|
|
833
871
|
return true;
|
|
834
872
|
},
|
|
835
873
|
icon: /*#__PURE__*/React.createElement(CopyIcon, {
|
|
@@ -838,7 +876,7 @@ export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi) =
|
|
|
838
876
|
...hoverDecorationProps(nodeType, akEditorSelectedNodeClassName)
|
|
839
877
|
}, {
|
|
840
878
|
title: intl === null || intl === void 0 ? void 0 : intl.formatMessage(commonMessages.delete),
|
|
841
|
-
onClick: remove,
|
|
879
|
+
onClick: fg('platform_editor_controls_patch_analytics_2') ? removeWithAnalytics(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a12 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a12 === void 0 ? void 0 : _pluginInjectionApi$a12.actions, selectedNodeType) : remove,
|
|
842
880
|
icon: /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
843
881
|
label: ""
|
|
844
882
|
}),
|
|
@@ -5,6 +5,7 @@ import { linkMessages, linkToolbarMessages } from '@atlaskit/editor-common/messa
|
|
|
5
5
|
import { RECENT_SEARCH_HEIGHT_IN_PX, RECENT_SEARCH_WIDTH_IN_PX } from '@atlaskit/editor-common/ui';
|
|
6
6
|
import LinkIcon from '@atlaskit/icon/core/link';
|
|
7
7
|
import LinkExternalIcon from '@atlaskit/icon/core/link-external';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { hideLinkingToolbar, setUrlToMedia, showLinkingToolbar, unlink } from '../../pm-plugins/commands/linking';
|
|
9
10
|
import { getMediaLinkingState } from '../../pm-plugins/linking';
|
|
10
11
|
import { currentMediaInlineNode, currentMediaNode } from '../../pm-plugins/utils/current-media-node';
|
|
@@ -137,7 +138,7 @@ export const getLinkingDropdownOptions = (editorState, intl, mediaLinkingState,
|
|
|
137
138
|
return true;
|
|
138
139
|
},
|
|
139
140
|
icon: /*#__PURE__*/React.createElement(LinkIcon, {
|
|
140
|
-
label: title
|
|
141
|
+
label: fg('platform_editor_controls_patch_7') ? '' : title
|
|
141
142
|
})
|
|
142
143
|
}];
|
|
143
144
|
} else {
|
|
@@ -20,7 +20,7 @@ import { currentMediaOrInlineNodeBorderMark } from '../../pm-plugins/utils/curre
|
|
|
20
20
|
import { isImage } from '../../pm-plugins/utils/is-type';
|
|
21
21
|
import ImageBorderItem from '../../ui/ImageBorder';
|
|
22
22
|
import { altTextButton } from './alt-text';
|
|
23
|
-
import { changeInlineToMediaCard, changeMediaInlineToMediaSingle, removeInlineCard, setBorderMark, toggleBorderMark } from './commands';
|
|
23
|
+
import { changeInlineToMediaCard, changeMediaInlineToMediaSingle, removeInlineCard, removeInlineCardWithAnalytics, setBorderMark, toggleBorderMark } from './commands';
|
|
24
24
|
import { shouldShowImageBorder } from './imageBorder';
|
|
25
25
|
import { getOpenLinkToolbarButtonOption, shouldShowMediaLinkToolbar } from './linking';
|
|
26
26
|
import { LinkToolbarAppearance } from './linking-toolbar-appearance';
|
|
@@ -125,7 +125,7 @@ export const generateMediaInlineFloatingToolbar = (state, intl, mediaPluginState
|
|
|
125
125
|
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaInline, true),
|
|
126
126
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaInline, false),
|
|
127
127
|
title: intl.formatMessage(commonMessages.remove),
|
|
128
|
-
onClick: removeInlineCard,
|
|
128
|
+
onClick: fg('platform_editor_controls_patch_analytics_2') ? removeInlineCardWithAnalytics(editorAnalyticsAPI) : removeInlineCard,
|
|
129
129
|
testId: 'media-toolbar-remove-button'
|
|
130
130
|
});
|
|
131
131
|
} else {
|
|
@@ -324,7 +324,7 @@ const getMediaInlineImageToolbar = (state, intl, mediaPluginState, hoverDecorati
|
|
|
324
324
|
icon: /*#__PURE__*/React.createElement(ImageInlineIcon, {
|
|
325
325
|
color: "currentColor",
|
|
326
326
|
spacing: "spacious",
|
|
327
|
-
label: mediaInlineImageTitle,
|
|
327
|
+
label: fg('platform_editor_controls_patch_7') ? '' : mediaInlineImageTitle,
|
|
328
328
|
LEGACY_size: "medium",
|
|
329
329
|
LEGACY_fallbackIcon: IconInline
|
|
330
330
|
})
|
|
@@ -339,7 +339,7 @@ const getMediaInlineImageToolbar = (state, intl, mediaPluginState, hoverDecorati
|
|
|
339
339
|
}) : /*#__PURE__*/React.createElement(ImageFullscreenIcon, {
|
|
340
340
|
color: "currentColor",
|
|
341
341
|
spacing: "spacious",
|
|
342
|
-
label: mediaSingleTitle,
|
|
342
|
+
label: fg('platform_editor_controls_patch_7') ? '' : mediaSingleTitle,
|
|
343
343
|
LEGACY_size: "medium",
|
|
344
344
|
LEGACY_fallbackIcon: IconEmbed
|
|
345
345
|
})
|
|
@@ -439,7 +439,7 @@ const getMediaInlineImageToolbar = (state, intl, mediaPluginState, hoverDecorati
|
|
|
439
439
|
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaInline, true),
|
|
440
440
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaInline, false),
|
|
441
441
|
title: intl.formatMessage(commonMessages.remove),
|
|
442
|
-
onClick: removeInlineCard,
|
|
442
|
+
onClick: fg('platform_editor_controls_patch_analytics_2') ? removeInlineCardWithAnalytics(editorAnalyticsAPI) : removeInlineCard,
|
|
443
443
|
testId: 'media-toolbar-remove-button'
|
|
444
444
|
});
|
|
445
445
|
}
|
|
@@ -5,7 +5,7 @@ import { css } from '@emotion/react';
|
|
|
5
5
|
var PIXEL_SIZING_WRAPPER_MINIMUM_WIDTH = 120;
|
|
6
6
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
8
|
-
export var pixelSizingWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tdisplay: grid;\n\tgrid-template-columns: 1fr 1em 1fr 0;\n\tgrid-template-rows: auto;\n\tgrid-template-areas: 'widthinput label heightinput submit';\n\twidth: ", "px;\n\ttext-align: center;\n\theight: ", ";\n\n\t
|
|
8
|
+
export var pixelSizingWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\tdisplay: grid;\n\tgrid-template-columns: 1fr 1em 1fr 0;\n\tgrid-template-rows: auto;\n\tgrid-template-areas: 'widthinput label heightinput submit';\n\twidth: ", "px;\n\ttext-align: center;\n\theight: ", ";\n\n\t/* Atlaskit fieldset does not allow style override */\n\t& > * {\n\t\tmargin-top: 0 !important;\n\t}\n"])), PIXEL_SIZING_WRAPPER_MINIMUM_WIDTH, "var(--ds-space-300, 24px)");
|
|
9
9
|
|
|
10
10
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
11
11
|
export var pixelEntryForm = css({
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
|
5
6
|
import { currentMediaNodeWithPos } from '@atlaskit/editor-common/media-single';
|
|
6
7
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
7
8
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -136,6 +137,16 @@ export var changeMediaInlineToMediaSingle = function changeMediaInlineToMediaSin
|
|
|
136
137
|
return true;
|
|
137
138
|
};
|
|
138
139
|
};
|
|
140
|
+
export var removeInlineCardWithAnalytics = function removeInlineCardWithAnalytics(editorAnalyticsAPI) {
|
|
141
|
+
return withAnalytics(editorAnalyticsAPI, {
|
|
142
|
+
action: ACTION.DELETED,
|
|
143
|
+
actionSubject: ACTION_SUBJECT.MEDIA_INLINE,
|
|
144
|
+
attributes: {
|
|
145
|
+
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
146
|
+
},
|
|
147
|
+
eventType: EVENT_TYPE.TRACK
|
|
148
|
+
})(removeInlineCard);
|
|
149
|
+
};
|
|
139
150
|
export var removeInlineCard = function removeInlineCard(state, dispatch) {
|
|
140
151
|
if (isNodeSelection(state.selection)) {
|
|
141
152
|
if (dispatch) {
|
|
@@ -4,8 +4,9 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
4
4
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
6
|
import React from 'react';
|
|
7
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
7
|
+
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
8
8
|
import { alignmentIcons, buildLayoutButtons, buildLayoutDropdown, IconCard, IconEmbed, IconInline, layoutToMessages, wrappingIcons } from '@atlaskit/editor-common/card';
|
|
9
|
+
import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
|
|
9
10
|
import { mediaInlineImagesEnabled } from '@atlaskit/editor-common/media-inline';
|
|
10
11
|
import commonMessages, { cardMessages, mediaAndEmbedToolbarMessages } from '@atlaskit/editor-common/messages';
|
|
11
12
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -52,12 +53,48 @@ var mediaTypeMessages = {
|
|
|
52
53
|
archive: messages.file_archive_is_selected,
|
|
53
54
|
unknown: messages.file_unknown_is_selected
|
|
54
55
|
};
|
|
56
|
+
var getMediaActionSubject = function getMediaActionSubject(nodeType) {
|
|
57
|
+
switch (nodeType.name) {
|
|
58
|
+
case 'mediaSingle':
|
|
59
|
+
return ACTION_SUBJECT.MEDIA_SINGLE;
|
|
60
|
+
case 'mediaInline':
|
|
61
|
+
return ACTION_SUBJECT.MEDIA_INLINE;
|
|
62
|
+
case 'mediaGroup':
|
|
63
|
+
return ACTION_SUBJECT.MEDIA_GROUP;
|
|
64
|
+
default:
|
|
65
|
+
return ACTION_SUBJECT.MEDIA;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
var removeWithAnalytics = function removeWithAnalytics(editorAnalyticsApi, nodeType) {
|
|
69
|
+
if (!nodeType) {
|
|
70
|
+
return remove;
|
|
71
|
+
}
|
|
72
|
+
var mediaType = getMediaActionSubject(nodeType);
|
|
73
|
+
return withAnalytics(editorAnalyticsApi, {
|
|
74
|
+
action: ACTION.DELETED,
|
|
75
|
+
actionSubject: mediaType,
|
|
76
|
+
attributes: {
|
|
77
|
+
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
78
|
+
},
|
|
79
|
+
eventType: EVENT_TYPE.TRACK
|
|
80
|
+
})(remove);
|
|
81
|
+
};
|
|
55
82
|
var remove = function remove(state, dispatch) {
|
|
56
83
|
if (dispatch) {
|
|
57
84
|
dispatch(removeSelectedNode(state.tr));
|
|
58
85
|
}
|
|
59
86
|
return true;
|
|
60
87
|
};
|
|
88
|
+
var handleRemoveMediaGroupWithAnalytics = function handleRemoveMediaGroupWithAnalytics(editorAnalyticsApi) {
|
|
89
|
+
return withAnalytics(editorAnalyticsApi, {
|
|
90
|
+
action: ACTION.DELETED,
|
|
91
|
+
actionSubject: ACTION_SUBJECT.MEDIA_GROUP,
|
|
92
|
+
attributes: {
|
|
93
|
+
inputMethod: INPUT_METHOD.FLOATING_TB
|
|
94
|
+
},
|
|
95
|
+
eventType: EVENT_TYPE.TRACK
|
|
96
|
+
})(handleRemoveMediaGroup);
|
|
97
|
+
};
|
|
61
98
|
var handleRemoveMediaGroup = function handleRemoveMediaGroup(state, dispatch) {
|
|
62
99
|
var tr = removeMediaGroupNode(state);
|
|
63
100
|
if (dispatch) {
|
|
@@ -169,7 +206,7 @@ var generateMediaCardFloatingToolbar = function generateMediaCardFloatingToolbar
|
|
|
169
206
|
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaGroup, true),
|
|
170
207
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaGroup, false),
|
|
171
208
|
title: intl.formatMessage(commonMessages.remove),
|
|
172
|
-
onClick: handleRemoveMediaGroup,
|
|
209
|
+
onClick: fg('platform_editor_controls_patch_analytics_2') ? handleRemoveMediaGroupWithAnalytics(editorAnalyticsAPI) : handleRemoveMediaGroup,
|
|
173
210
|
testId: 'media-toolbar-remove-button'
|
|
174
211
|
});
|
|
175
212
|
} else {
|
|
@@ -397,7 +434,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
397
434
|
icon: /*#__PURE__*/React.createElement(ImageInlineIcon, {
|
|
398
435
|
color: "currentColor",
|
|
399
436
|
spacing: "spacious",
|
|
400
|
-
label: inlineTitle,
|
|
437
|
+
label: fg('platform_editor_controls_patch_7') ? '' : inlineTitle,
|
|
401
438
|
LEGACY_size: "medium",
|
|
402
439
|
LEGACY_fallbackIcon: IconInline
|
|
403
440
|
}),
|
|
@@ -416,7 +453,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
416
453
|
}) : /*#__PURE__*/React.createElement(ImageFullscreenIcon, {
|
|
417
454
|
color: "currentColor",
|
|
418
455
|
spacing: "spacious",
|
|
419
|
-
label: floatingSwitcherTitle,
|
|
456
|
+
label: fg('platform_editor_controls_patch_7') ? '' : floatingSwitcherTitle,
|
|
420
457
|
LEGACY_size: "medium",
|
|
421
458
|
LEGACY_fallbackIcon: IconEmbed
|
|
422
459
|
})
|
|
@@ -599,6 +636,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
599
636
|
});
|
|
600
637
|
}
|
|
601
638
|
if (!isEditorControlsEnabled) {
|
|
639
|
+
var _pluginInjectionApi$a9;
|
|
602
640
|
if (allowAltTextOnImages) {
|
|
603
641
|
var _pluginInjectionApi$a8;
|
|
604
642
|
toolbarButtons.push(altTextButton(intl, state, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a8 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a8 === void 0 ? void 0 : _pluginInjectionApi$a8.actions), {
|
|
@@ -617,7 +655,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
617
655
|
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaSingle, true),
|
|
618
656
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaSingle, false),
|
|
619
657
|
title: intl.formatMessage(commonMessages.remove),
|
|
620
|
-
onClick: remove,
|
|
658
|
+
onClick: fg('platform_editor_controls_patch_analytics_2') ? removeWithAnalytics(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a9 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a9 === void 0 ? void 0 : _pluginInjectionApi$a9.actions) : remove,
|
|
621
659
|
testId: 'media-toolbar-remove-button',
|
|
622
660
|
supportsViewMode: false
|
|
623
661
|
};
|
|
@@ -775,7 +813,7 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
775
813
|
selectedNodeType = state.selection.node.type;
|
|
776
814
|
}
|
|
777
815
|
if (allowMediaInline && (parentMediaGroupNode === null || parentMediaGroupNode === void 0 ? void 0 : parentMediaGroupNode.node.type) === mediaGroup) {
|
|
778
|
-
var _pluginInjectionApi$
|
|
816
|
+
var _pluginInjectionApi$a10, _pluginInjectionApi$f2;
|
|
779
817
|
var mediaOffset = state.selection.$from.parentOffset + 1;
|
|
780
818
|
baseToolbar.getDomRef = function () {
|
|
781
819
|
var _mediaPluginState$ele2;
|
|
@@ -784,7 +822,7 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
784
822
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
785
823
|
return (_mediaPluginState$ele2 = mediaPluginState.element) === null || _mediaPluginState$ele2 === void 0 ? void 0 : _mediaPluginState$ele2.querySelector(selector);
|
|
786
824
|
};
|
|
787
|
-
items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$
|
|
825
|
+
items = generateMediaCardFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a10 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a10 === void 0 ? void 0 : _pluginInjectionApi$a10.actions, pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f2 = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f2 === void 0 || (_pluginInjectionApi$f2 = _pluginInjectionApi$f2.actions) === null || _pluginInjectionApi$f2 === void 0 ? void 0 : _pluginInjectionApi$f2.forceFocusSelector, isViewOnly);
|
|
788
826
|
} else if (allowMediaInline && selectedNodeType && selectedNodeType === mediaInline) {
|
|
789
827
|
items = generateMediaInlineFloatingToolbar(state, intl, mediaPluginState, hoverDecoration, pluginInjectionApi, options);
|
|
790
828
|
} else {
|
|
@@ -798,9 +836,9 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
798
836
|
items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, pluginInjectionApi);
|
|
799
837
|
}
|
|
800
838
|
if (!mediaPluginState.isResizing && editorExperiment('platform_editor_controls', 'variant1')) {
|
|
801
|
-
var _pluginInjectionApi$
|
|
839
|
+
var _pluginInjectionApi$a11, _pluginInjectionApi$a12;
|
|
802
840
|
updateToFullHeightSeparator(items);
|
|
803
|
-
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$
|
|
841
|
+
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$a11 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a11 === void 0 ? void 0 : _pluginInjectionApi$a11.actions)), _toConsumableArray(getResizeDropdownOption(options, state, intl.formatMessage, selectedNodeType)));
|
|
804
842
|
if (customOptions.length) {
|
|
805
843
|
customOptions.push({
|
|
806
844
|
type: 'separator'
|
|
@@ -822,7 +860,7 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
822
860
|
onClick: function onClick() {
|
|
823
861
|
var _pluginInjectionApi$c4, _pluginInjectionApi$f3;
|
|
824
862
|
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$c4 = pluginInjectionApi.core) === null || _pluginInjectionApi$c4 === void 0 || _pluginInjectionApi$c4.actions.execute( // @ts-ignore
|
|
825
|
-
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f3 = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f3 === void 0 ? void 0 : _pluginInjectionApi$f3.commands.copyNode(nodeType));
|
|
863
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$f3 = pluginInjectionApi.floatingToolbar) === null || _pluginInjectionApi$f3 === void 0 ? void 0 : _pluginInjectionApi$f3.commands.copyNode(nodeType, INPUT_METHOD.FLOATING_TB));
|
|
826
864
|
return true;
|
|
827
865
|
},
|
|
828
866
|
icon: /*#__PURE__*/React.createElement(CopyIcon, {
|
|
@@ -830,7 +868,7 @@ export var floatingToolbar = function floatingToolbar(state, intl) {
|
|
|
830
868
|
})
|
|
831
869
|
}, hoverDecorationProps(nodeType, akEditorSelectedNodeClassName)), _objectSpread({
|
|
832
870
|
title: intl === null || intl === void 0 ? void 0 : intl.formatMessage(commonMessages.delete),
|
|
833
|
-
onClick: remove,
|
|
871
|
+
onClick: fg('platform_editor_controls_patch_analytics_2') ? removeWithAnalytics(pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a12 = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a12 === void 0 ? void 0 : _pluginInjectionApi$a12.actions, selectedNodeType) : remove,
|
|
834
872
|
icon: /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
835
873
|
label: ""
|
|
836
874
|
})
|
|
@@ -8,6 +8,7 @@ import { linkMessages, linkToolbarMessages } from '@atlaskit/editor-common/messa
|
|
|
8
8
|
import { RECENT_SEARCH_HEIGHT_IN_PX, RECENT_SEARCH_WIDTH_IN_PX } from '@atlaskit/editor-common/ui';
|
|
9
9
|
import LinkIcon from '@atlaskit/icon/core/link';
|
|
10
10
|
import LinkExternalIcon from '@atlaskit/icon/core/link-external';
|
|
11
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
12
|
import { hideLinkingToolbar, setUrlToMedia, showLinkingToolbar, unlink } from '../../pm-plugins/commands/linking';
|
|
12
13
|
import { getMediaLinkingState } from '../../pm-plugins/linking';
|
|
13
14
|
import { currentMediaInlineNode, currentMediaNode } from '../../pm-plugins/utils/current-media-node';
|
|
@@ -128,7 +129,7 @@ export var getLinkingDropdownOptions = function getLinkingDropdownOptions(editor
|
|
|
128
129
|
return true;
|
|
129
130
|
},
|
|
130
131
|
icon: /*#__PURE__*/React.createElement(LinkIcon, {
|
|
131
|
-
label: title
|
|
132
|
+
label: fg('platform_editor_controls_patch_7') ? '' : title
|
|
132
133
|
})
|
|
133
134
|
}];
|
|
134
135
|
} else {
|
|
@@ -23,7 +23,7 @@ import { currentMediaOrInlineNodeBorderMark } from '../../pm-plugins/utils/curre
|
|
|
23
23
|
import { isImage } from '../../pm-plugins/utils/is-type';
|
|
24
24
|
import ImageBorderItem from '../../ui/ImageBorder';
|
|
25
25
|
import { altTextButton } from './alt-text';
|
|
26
|
-
import { changeInlineToMediaCard, changeMediaInlineToMediaSingle, removeInlineCard, setBorderMark, toggleBorderMark } from './commands';
|
|
26
|
+
import { changeInlineToMediaCard, changeMediaInlineToMediaSingle, removeInlineCard, removeInlineCardWithAnalytics, setBorderMark, toggleBorderMark } from './commands';
|
|
27
27
|
import { shouldShowImageBorder } from './imageBorder';
|
|
28
28
|
import { getOpenLinkToolbarButtonOption, shouldShowMediaLinkToolbar } from './linking';
|
|
29
29
|
import { LinkToolbarAppearance } from './linking-toolbar-appearance';
|
|
@@ -127,7 +127,7 @@ export var generateMediaInlineFloatingToolbar = function generateMediaInlineFloa
|
|
|
127
127
|
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaInline, true),
|
|
128
128
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaInline, false),
|
|
129
129
|
title: intl.formatMessage(commonMessages.remove),
|
|
130
|
-
onClick: removeInlineCard,
|
|
130
|
+
onClick: fg('platform_editor_controls_patch_analytics_2') ? removeInlineCardWithAnalytics(editorAnalyticsAPI) : removeInlineCard,
|
|
131
131
|
testId: 'media-toolbar-remove-button'
|
|
132
132
|
});
|
|
133
133
|
} else {
|
|
@@ -323,7 +323,7 @@ var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(state, intl
|
|
|
323
323
|
icon: /*#__PURE__*/React.createElement(ImageInlineIcon, {
|
|
324
324
|
color: "currentColor",
|
|
325
325
|
spacing: "spacious",
|
|
326
|
-
label: mediaInlineImageTitle,
|
|
326
|
+
label: fg('platform_editor_controls_patch_7') ? '' : mediaInlineImageTitle,
|
|
327
327
|
LEGACY_size: "medium",
|
|
328
328
|
LEGACY_fallbackIcon: IconInline
|
|
329
329
|
})
|
|
@@ -338,7 +338,7 @@ var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(state, intl
|
|
|
338
338
|
}) : /*#__PURE__*/React.createElement(ImageFullscreenIcon, {
|
|
339
339
|
color: "currentColor",
|
|
340
340
|
spacing: "spacious",
|
|
341
|
-
label: mediaSingleTitle,
|
|
341
|
+
label: fg('platform_editor_controls_patch_7') ? '' : mediaSingleTitle,
|
|
342
342
|
LEGACY_size: "medium",
|
|
343
343
|
LEGACY_fallbackIcon: IconEmbed
|
|
344
344
|
})
|
|
@@ -440,7 +440,7 @@ var getMediaInlineImageToolbar = function getMediaInlineImageToolbar(state, intl
|
|
|
440
440
|
onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaInline, true),
|
|
441
441
|
onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(mediaInline, false),
|
|
442
442
|
title: intl.formatMessage(commonMessages.remove),
|
|
443
|
-
onClick: removeInlineCard,
|
|
443
|
+
onClick: fg('platform_editor_controls_patch_analytics_2') ? removeInlineCardWithAnalytics(editorAnalyticsAPI) : removeInlineCard,
|
|
444
444
|
testId: 'media-toolbar-remove-button'
|
|
445
445
|
});
|
|
446
446
|
}
|
|
@@ -11,6 +11,7 @@ export declare const getNodeType: (state: EditorState) => "mediaSingle" | "media
|
|
|
11
11
|
export declare const changeInlineToMediaCard: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, forceFocusSelector: ForceFocusSelector | undefined) => Command;
|
|
12
12
|
export declare const changeMediaCardToInline: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, forceFocusSelector: ForceFocusSelector | undefined) => Command;
|
|
13
13
|
export declare const changeMediaInlineToMediaSingle: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, widthPluginState: WidthPluginState | undefined, allowPixelResizing?: boolean) => Command;
|
|
14
|
+
export declare const removeInlineCardWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
14
15
|
export declare const removeInlineCard: Command;
|
|
15
16
|
export declare const toggleBorderMark: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
16
17
|
export declare const setBorderMark: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (attrs: Partial<BorderMarkAttributes>) => Command;
|
|
@@ -11,6 +11,7 @@ export declare const getNodeType: (state: EditorState) => "mediaSingle" | "media
|
|
|
11
11
|
export declare const changeInlineToMediaCard: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, forceFocusSelector: ForceFocusSelector | undefined) => Command;
|
|
12
12
|
export declare const changeMediaCardToInline: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, forceFocusSelector: ForceFocusSelector | undefined) => Command;
|
|
13
13
|
export declare const changeMediaInlineToMediaSingle: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined, widthPluginState: WidthPluginState | undefined, allowPixelResizing?: boolean) => Command;
|
|
14
|
+
export declare const removeInlineCardWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
14
15
|
export declare const removeInlineCard: Command;
|
|
15
16
|
export declare const toggleBorderMark: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
|
|
16
17
|
export declare const setBorderMark: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (attrs: Partial<BorderMarkAttributes>) => Command;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-media",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "Media plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@atlaskit/analytics-namespaced-context": "^7.0.0",
|
|
39
39
|
"@atlaskit/analytics-next": "^11.0.0",
|
|
40
40
|
"@atlaskit/button": "^23.0.0",
|
|
41
|
-
"@atlaskit/editor-common": "^
|
|
41
|
+
"@atlaskit/editor-common": "^104.1.0",
|
|
42
42
|
"@atlaskit/editor-palette": "^2.1.0",
|
|
43
43
|
"@atlaskit/editor-plugin-analytics": "^2.2.0",
|
|
44
44
|
"@atlaskit/editor-plugin-annotation": "^2.7.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/editor-plugin-decorations": "^2.0.0",
|
|
47
47
|
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
48
48
|
"@atlaskit/editor-plugin-editor-viewmode": "^3.1.0",
|
|
49
|
-
"@atlaskit/editor-plugin-floating-toolbar": "^4.
|
|
49
|
+
"@atlaskit/editor-plugin-floating-toolbar": "^4.1.0",
|
|
50
50
|
"@atlaskit/editor-plugin-focus": "^1.5.0",
|
|
51
51
|
"@atlaskit/editor-plugin-grid": "^2.0.0",
|
|
52
52
|
"@atlaskit/editor-plugin-guideline": "^2.0.0",
|
|
@@ -57,20 +57,20 @@
|
|
|
57
57
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
58
58
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
59
59
|
"@atlaskit/form": "^12.0.0",
|
|
60
|
-
"@atlaskit/icon": "^25.
|
|
60
|
+
"@atlaskit/icon": "^25.7.0",
|
|
61
61
|
"@atlaskit/media-card": "^79.2.0",
|
|
62
|
-
"@atlaskit/media-client": "^
|
|
62
|
+
"@atlaskit/media-client": "^33.0.0",
|
|
63
63
|
"@atlaskit/media-client-react": "^4.0.0",
|
|
64
64
|
"@atlaskit/media-common": "^12.0.0",
|
|
65
|
-
"@atlaskit/media-filmstrip": "^
|
|
66
|
-
"@atlaskit/media-picker": "^
|
|
65
|
+
"@atlaskit/media-filmstrip": "^50.0.0",
|
|
66
|
+
"@atlaskit/media-picker": "^69.0.0",
|
|
67
67
|
"@atlaskit/media-ui": "^28.1.0",
|
|
68
68
|
"@atlaskit/media-viewer": "^52.0.0",
|
|
69
69
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
70
70
|
"@atlaskit/primitives": "^14.7.0",
|
|
71
71
|
"@atlaskit/textfield": "^8.0.0",
|
|
72
72
|
"@atlaskit/theme": "^18.0.0",
|
|
73
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
73
|
+
"@atlaskit/tmp-editor-statsig": "^4.17.0",
|
|
74
74
|
"@atlaskit/tokens": "^4.8.0",
|
|
75
75
|
"@atlaskit/tooltip": "^20.0.0",
|
|
76
76
|
"@babel/runtime": "^7.0.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"typescript": "~5.4.2"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
|
-
"@atlaskit/media-core": "^
|
|
88
|
+
"@atlaskit/media-core": "^36.0.0",
|
|
89
89
|
"react": "^18.2.0",
|
|
90
90
|
"react-dom": "^18.2.0",
|
|
91
91
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -192,6 +192,9 @@
|
|
|
192
192
|
},
|
|
193
193
|
"platform_editor_track_media_fail_to_insert": {
|
|
194
194
|
"type": "boolean"
|
|
195
|
+
},
|
|
196
|
+
"platform_editor_controls_patch_analytics_2": {
|
|
197
|
+
"type": "boolean"
|
|
195
198
|
}
|
|
196
199
|
},
|
|
197
200
|
"stricter": {
|