@atlaskit/editor-plugin-media 0.4.10 → 0.5.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 +17 -0
- package/dist/cjs/nodeviews/mediaInline.js +17 -1
- package/dist/cjs/nodeviews/mediaSingle.js +11 -10
- package/dist/cjs/nodeviews/styles.js +5 -4
- package/dist/cjs/pm-plugins/alt-text/ui/AltTextEdit.js +15 -14
- package/dist/cjs/toolbar/index.js +28 -1
- package/dist/cjs/toolbar/layout-group.js +7 -5
- package/dist/cjs/toolbar/linking-toolbar-appearance.js +12 -11
- package/dist/cjs/ui/CaptionPlaceholder/index.js +3 -2
- package/dist/cjs/ui/ImageBorder/index.js +23 -20
- package/dist/cjs/ui/Media/DropPlaceholder.js +5 -4
- package/dist/cjs/ui/MediaLinkingToolbar.js +15 -13
- package/dist/cjs/ui/PixelEntry/index.js +18 -15
- package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.js +4 -1
- package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +5 -4
- package/dist/cjs/ui/ResizableMediaSingle/index.js +5 -4
- package/dist/cjs/utils/media-files.js +24 -3
- package/dist/cjs/utils/media-single.js +6 -3
- package/dist/es2019/nodeviews/mediaInline.js +17 -1
- package/dist/es2019/nodeviews/mediaSingle.js +12 -9
- package/dist/es2019/nodeviews/styles.js +6 -5
- package/dist/es2019/pm-plugins/alt-text/ui/AltTextEdit.js +17 -15
- package/dist/es2019/toolbar/index.js +26 -1
- package/dist/es2019/toolbar/layout-group.js +7 -6
- package/dist/es2019/toolbar/linking-toolbar-appearance.js +13 -12
- package/dist/es2019/ui/CaptionPlaceholder/index.js +4 -3
- package/dist/es2019/ui/ImageBorder/index.js +22 -20
- package/dist/es2019/ui/Media/DropPlaceholder.js +6 -5
- package/dist/es2019/ui/MediaLinkingToolbar.js +14 -13
- package/dist/es2019/ui/PixelEntry/index.js +17 -15
- package/dist/es2019/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.js +3 -1
- package/dist/es2019/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +5 -3
- package/dist/es2019/ui/ResizableMediaSingle/index.js +5 -3
- package/dist/es2019/utils/media-files.js +24 -3
- package/dist/es2019/utils/media-single.js +6 -2
- package/dist/esm/nodeviews/mediaInline.js +17 -1
- package/dist/esm/nodeviews/mediaSingle.js +12 -9
- package/dist/esm/nodeviews/styles.js +6 -5
- package/dist/esm/pm-plugins/alt-text/ui/AltTextEdit.js +17 -15
- package/dist/esm/toolbar/index.js +28 -1
- package/dist/esm/toolbar/layout-group.js +7 -6
- package/dist/esm/toolbar/linking-toolbar-appearance.js +13 -12
- package/dist/esm/ui/CaptionPlaceholder/index.js +4 -3
- package/dist/esm/ui/ImageBorder/index.js +22 -20
- package/dist/esm/ui/Media/DropPlaceholder.js +6 -5
- package/dist/esm/ui/MediaLinkingToolbar.js +14 -13
- package/dist/esm/ui/PixelEntry/index.js +17 -15
- package/dist/esm/ui/ResizableMediaSingle/ResizableMediaMigrationNotification.js +3 -1
- package/dist/esm/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +5 -3
- package/dist/esm/ui/ResizableMediaSingle/index.js +5 -3
- package/dist/esm/utils/media-files.js +24 -3
- package/dist/esm/utils/media-single.js +6 -3
- package/package.json +4 -1
|
@@ -25,7 +25,9 @@ var _chevronLeftLarge = _interopRequireDefault(require("@atlaskit/icon/glyph/che
|
|
|
25
25
|
var _unlink = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/unlink"));
|
|
26
26
|
var _colors = require("@atlaskit/theme/colors");
|
|
27
27
|
var _mediaLinkingToolbarMessages = require("./media-linking-toolbar-messages");
|
|
28
|
-
var _templateObject, _templateObject2;
|
|
28
|
+
var _templateObject, _templateObject2;
|
|
29
|
+
/** @jsx jsx */
|
|
30
|
+
// Common Translations will live here
|
|
29
31
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
30
32
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
33
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
@@ -97,21 +99,21 @@ var LinkAddToolbar = exports.LinkAddToolbar = /*#__PURE__*/function (_React$Pure
|
|
|
97
99
|
var formatLinkAddressText = formatMessage(_mediaLinkingToolbarMessages.mediaLinkToolbarMessages.backLink);
|
|
98
100
|
var formatUnlinkText = formatMessage(_messages.linkToolbarMessages.unlink);
|
|
99
101
|
var errorsList = _this.state.validationErrors.map(function (error, index) {
|
|
100
|
-
return
|
|
102
|
+
return (0, _react2.jsx)(_ui.ErrorMessage, {
|
|
101
103
|
key: index
|
|
102
104
|
}, error);
|
|
103
105
|
});
|
|
104
|
-
return
|
|
106
|
+
return (0, _react2.jsx)("div", {
|
|
105
107
|
className: "recent-list"
|
|
106
|
-
},
|
|
108
|
+
}, (0, _react2.jsx)("div", {
|
|
107
109
|
css: [_link.container, !!activityProvider && _link.containerWithProvider]
|
|
108
|
-
},
|
|
110
|
+
}, (0, _react2.jsx)("div", {
|
|
109
111
|
css: _link.inputWrapper
|
|
110
|
-
},
|
|
112
|
+
}, (0, _react2.jsx)("span", {
|
|
111
113
|
css: buttonWrapper
|
|
112
|
-
},
|
|
114
|
+
}, (0, _react2.jsx)(_ui.FloatingToolbarButton, {
|
|
113
115
|
title: formatLinkAddressText,
|
|
114
|
-
icon:
|
|
116
|
+
icon: (0, _react2.jsx)(_chevronLeftLarge.default, {
|
|
115
117
|
label: formatLinkAddressText
|
|
116
118
|
}),
|
|
117
119
|
onClick: function onClick() {
|
|
@@ -120,7 +122,7 @@ var LinkAddToolbar = exports.LinkAddToolbar = /*#__PURE__*/function (_React$Pure
|
|
|
120
122
|
inputMethod: currentInputMethod
|
|
121
123
|
});
|
|
122
124
|
}
|
|
123
|
-
})),
|
|
125
|
+
})), (0, _react2.jsx)(_ui.PanelTextInput, {
|
|
124
126
|
testId: "media-link-input",
|
|
125
127
|
placeholder: getPlaceholder(!!activityProvider),
|
|
126
128
|
autoFocus: true,
|
|
@@ -142,13 +144,13 @@ var LinkAddToolbar = exports.LinkAddToolbar = /*#__PURE__*/function (_React$Pure
|
|
|
142
144
|
_onChange(value);
|
|
143
145
|
},
|
|
144
146
|
onKeyDown: onKeyDown
|
|
145
|
-
}), (0, _utils.normalizeUrl)(displayUrl) &&
|
|
147
|
+
}), (0, _utils.normalizeUrl)(displayUrl) && (0, _react2.jsx)(_react.Fragment, null, (0, _react2.jsx)(_ui.FloatingToolbarSeparator, null), (0, _react2.jsx)(_ui.FloatingToolbarButton, {
|
|
146
148
|
title: formatUnlinkText,
|
|
147
|
-
icon:
|
|
149
|
+
icon: (0, _react2.jsx)(_unlink.default, {
|
|
148
150
|
label: formatUnlinkText
|
|
149
151
|
}),
|
|
150
152
|
onClick: _this.handleUnlink
|
|
151
|
-
}))), !!errorsList.length &&
|
|
153
|
+
}))), !!errorsList.length && (0, _react2.jsx)("section", {
|
|
152
154
|
css: validationWrapper
|
|
153
155
|
}, errorsList), renderRecentList()));
|
|
154
156
|
});
|
|
@@ -180,7 +182,7 @@ var LinkAddToolbar = exports.LinkAddToolbar = /*#__PURE__*/function (_React$Pure
|
|
|
180
182
|
var _this$props2 = this.props,
|
|
181
183
|
providerFactory = _this$props2.providerFactory,
|
|
182
184
|
displayUrl = _this$props2.displayUrl;
|
|
183
|
-
return
|
|
185
|
+
return (0, _react2.jsx)(_link.RecentSearch, {
|
|
184
186
|
defaultUrl: (0, _utils.normalizeUrl)(displayUrl),
|
|
185
187
|
providerFactory: providerFactory,
|
|
186
188
|
onSubmit: this.handleSubmit,
|
|
@@ -9,6 +9,7 @@ exports.PixelEntry = exports.FullWidthDisplay = void 0;
|
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
11
|
var _react = require("react");
|
|
12
|
+
var _react2 = require("@emotion/react");
|
|
12
13
|
var _button = _interopRequireDefault(require("@atlaskit/button"));
|
|
13
14
|
var _form = _interopRequireWildcard(require("@atlaskit/form"));
|
|
14
15
|
var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
|
|
@@ -18,6 +19,8 @@ var _messages = require("./messages");
|
|
|
18
19
|
var _styles = require("./styles");
|
|
19
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
|
+
/** @jsx jsx */
|
|
23
|
+
|
|
21
24
|
var PixelEntry = exports.PixelEntry = function PixelEntry(_ref) {
|
|
22
25
|
var width = _ref.width,
|
|
23
26
|
mediaWidth = _ref.mediaWidth,
|
|
@@ -109,36 +112,36 @@ var PixelEntry = exports.PixelEntry = function PixelEntry(_ref) {
|
|
|
109
112
|
};
|
|
110
113
|
}, [minWidth, maxWidth, onChange, ratioWidth, ratioHeight]);
|
|
111
114
|
if (showMigration) {
|
|
112
|
-
return
|
|
115
|
+
return (0, _react2.jsx)(_tooltip.default, {
|
|
113
116
|
content: formatMessage(_messages.messages.migrationButtonTooltip)
|
|
114
|
-
},
|
|
117
|
+
}, (0, _react2.jsx)(_button.default, {
|
|
115
118
|
appearance: "warning",
|
|
116
119
|
spacing: "compact",
|
|
117
120
|
onClick: onMigrate,
|
|
118
121
|
testId: _constants.PIXELENTRY_MIGRATION_BUTTON_TESTID
|
|
119
122
|
}, formatMessage(_messages.messages.migrationButtonText)));
|
|
120
123
|
}
|
|
121
|
-
return
|
|
124
|
+
return (0, _react2.jsx)("div", {
|
|
122
125
|
css: _styles.pixelEntryForm
|
|
123
|
-
},
|
|
126
|
+
}, (0, _react2.jsx)(_form.default, {
|
|
124
127
|
onSubmit: handleOnSubmit
|
|
125
128
|
}, function (_ref2) {
|
|
126
129
|
var formProps = _ref2.formProps;
|
|
127
|
-
return
|
|
130
|
+
return (0, _react2.jsx)("form", formProps, (0, _react2.jsx)("div", {
|
|
128
131
|
css: _styles.pixelSizingWrapper
|
|
129
|
-
},
|
|
132
|
+
}, (0, _react2.jsx)(_form.Field, {
|
|
130
133
|
key: "inputWidth",
|
|
131
134
|
name: "inputWidth",
|
|
132
135
|
defaultValue: computedWidth
|
|
133
136
|
}, function (_ref3) {
|
|
134
137
|
var fieldProps = _ref3.fieldProps;
|
|
135
|
-
return
|
|
138
|
+
return (0, _react2.jsx)(_tooltip.default, {
|
|
136
139
|
hideTooltipOnMouseDown: true,
|
|
137
140
|
content: formatMessage(_messages.messages.inputWidthTooltip, {
|
|
138
141
|
maxWidth: maxWidth
|
|
139
142
|
}),
|
|
140
143
|
position: "top"
|
|
141
|
-
},
|
|
144
|
+
}, (0, _react2.jsx)(_textfield.default, (0, _extends2.default)({}, fieldProps, {
|
|
142
145
|
css: [_styles.pixelSizingWidthInput, _styles.pixelSizingInput],
|
|
143
146
|
appearance: "none",
|
|
144
147
|
isCompact: true,
|
|
@@ -148,19 +151,19 @@ var PixelEntry = exports.PixelEntry = function PixelEntry(_ref) {
|
|
|
148
151
|
maxWidth: maxWidth
|
|
149
152
|
})
|
|
150
153
|
})));
|
|
151
|
-
}),
|
|
154
|
+
}), (0, _react2.jsx)("span", {
|
|
152
155
|
css: _styles.pixelSizingLabel
|
|
153
|
-
}, "x"),
|
|
156
|
+
}, "x"), (0, _react2.jsx)(_form.Field, {
|
|
154
157
|
key: "inputHeight",
|
|
155
158
|
name: "inputHeight",
|
|
156
159
|
defaultValue: computedHeight
|
|
157
160
|
}, function (_ref4) {
|
|
158
161
|
var fieldProps = _ref4.fieldProps;
|
|
159
|
-
return
|
|
162
|
+
return (0, _react2.jsx)(_tooltip.default, {
|
|
160
163
|
hideTooltipOnMouseDown: true,
|
|
161
164
|
content: formatMessage(_messages.messages.inputHeightTooltip),
|
|
162
165
|
position: "top"
|
|
163
|
-
},
|
|
166
|
+
}, (0, _react2.jsx)(_textfield.default, (0, _extends2.default)({}, fieldProps, {
|
|
164
167
|
css: [_styles.pixelSizingHeightInput, _styles.pixelSizingInput],
|
|
165
168
|
appearance: "none",
|
|
166
169
|
isCompact: true,
|
|
@@ -168,7 +171,7 @@ var PixelEntry = exports.PixelEntry = function PixelEntry(_ref) {
|
|
|
168
171
|
pattern: "\\d*",
|
|
169
172
|
"aria-label": formatMessage(_messages.messages.inputHeightAriaLabel)
|
|
170
173
|
})));
|
|
171
|
-
}),
|
|
174
|
+
}), (0, _react2.jsx)(_button.default, {
|
|
172
175
|
css: _styles.pixelEntryHiddenSubmit,
|
|
173
176
|
type: "submit"
|
|
174
177
|
}, formatMessage(_messages.messages.submitButtonText))));
|
|
@@ -176,7 +179,7 @@ var PixelEntry = exports.PixelEntry = function PixelEntry(_ref) {
|
|
|
176
179
|
};
|
|
177
180
|
var FullWidthDisplay = exports.FullWidthDisplay = function FullWidthDisplay(_ref5) {
|
|
178
181
|
var formatMessage = _ref5.intl.formatMessage;
|
|
179
|
-
return
|
|
182
|
+
return (0, _react2.jsx)("div", {
|
|
180
183
|
css: _styles.pixelSizingFullWidthLabelStyles
|
|
181
|
-
},
|
|
184
|
+
}, (0, _react2.jsx)("span", null, formatMessage(_messages.messages.fullWidthLabel)));
|
|
182
185
|
};
|
|
@@ -4,9 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ResizableMediaMigrationNotification = void 0;
|
|
7
|
+
var _react = require("@emotion/react");
|
|
7
8
|
var _styles = require("./styles");
|
|
9
|
+
/** @jsx jsx */
|
|
10
|
+
|
|
8
11
|
var ResizableMediaMigrationNotification = exports.ResizableMediaMigrationNotification = function ResizableMediaMigrationNotification() {
|
|
9
|
-
return
|
|
12
|
+
return (0, _react.jsx)("div", {
|
|
10
13
|
"data-testid": "resizable-media-migration-notification",
|
|
11
14
|
css: [_styles.resizableMediaMigrationNotificationStyle]
|
|
12
15
|
});
|
|
@@ -16,6 +16,7 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
16
16
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
17
17
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
18
|
var _react = _interopRequireDefault(require("react"));
|
|
19
|
+
var _react2 = require("@emotion/react");
|
|
19
20
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
20
21
|
var _throttle = _interopRequireDefault(require("lodash/throttle"));
|
|
21
22
|
var _memoizeOne = _interopRequireDefault(require("memoize-one"));
|
|
@@ -33,7 +34,7 @@ var _checkMediaType = require("../../utils/check-media-type");
|
|
|
33
34
|
var _ResizableMediaMigrationNotification = require("./ResizableMediaMigrationNotification");
|
|
34
35
|
var _styled = require("./styled");
|
|
35
36
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
36
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
37
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
37
38
|
var resizerNextTestId = exports.resizerNextTestId = 'mediaSingle.resizerNext.testid';
|
|
38
39
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
39
40
|
var ResizableMediaSingleNext = /*#__PURE__*/function (_React$Component) {
|
|
@@ -506,7 +507,7 @@ var ResizableMediaSingleNext = /*#__PURE__*/function (_React$Component) {
|
|
|
506
507
|
|
|
507
508
|
// while is not resizing, we take 100% as min-width if the container width is less than the min-width
|
|
508
509
|
var minViewWidth = isResizing ? minWidth : "min(".concat(minWidth, "px, 100%)");
|
|
509
|
-
return
|
|
510
|
+
return (0, _react2.jsx)("div", {
|
|
510
511
|
css: (0, _styled.wrapperStyle)({
|
|
511
512
|
layout: layout,
|
|
512
513
|
containerWidth: containerWidth || origWidth,
|
|
@@ -515,7 +516,7 @@ var ResizableMediaSingleNext = /*#__PURE__*/function (_React$Component) {
|
|
|
515
516
|
isNestedNode: isNestedNode,
|
|
516
517
|
isExtendedResizeExperienceOn: true
|
|
517
518
|
})
|
|
518
|
-
},
|
|
519
|
+
}, (0, _react2.jsx)(_resizer.ResizerNext, {
|
|
519
520
|
minWidth: minViewWidth,
|
|
520
521
|
maxWidth: maxWidth,
|
|
521
522
|
className: resizerNextClassName,
|
|
@@ -531,7 +532,7 @@ var ResizableMediaSingleNext = /*#__PURE__*/function (_React$Component) {
|
|
|
531
532
|
isHandleVisible: selected,
|
|
532
533
|
handlePositioning: isNestedNode ? 'adjacent' : undefined,
|
|
533
534
|
handleHighlight: "full-height"
|
|
534
|
-
}, children, showLegacyNotification &&
|
|
535
|
+
}, children, showLegacyNotification && (0, _react2.jsx)(_ResizableMediaMigrationNotification.ResizableMediaMigrationNotification, null)));
|
|
535
536
|
}
|
|
536
537
|
}]);
|
|
537
538
|
return ResizableMediaSingleNext;
|
|
@@ -16,6 +16,7 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
16
16
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
17
17
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
18
|
var _react = _interopRequireDefault(require("react"));
|
|
19
|
+
var _react2 = require("@emotion/react");
|
|
19
20
|
var _mediaSingle = require("@atlaskit/editor-common/media-single");
|
|
20
21
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
21
22
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
@@ -24,7 +25,7 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
|
24
25
|
var _checkMediaType = require("../../utils/check-media-type");
|
|
25
26
|
var _styled = require("./styled");
|
|
26
27
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
27
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
28
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
|
|
28
29
|
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
29
30
|
var ResizableMediaSingle = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
30
31
|
(0, _inherits2.default)(ResizableMediaSingle, _React$Component);
|
|
@@ -384,7 +385,7 @@ var ResizableMediaSingle = exports.default = /*#__PURE__*/function (_React$Compo
|
|
|
384
385
|
}
|
|
385
386
|
};
|
|
386
387
|
};
|
|
387
|
-
return
|
|
388
|
+
return (0, _react2.jsx)("div", {
|
|
388
389
|
ref: this.saveWrapper,
|
|
389
390
|
css: (0, _styled.wrapperStyle)({
|
|
390
391
|
layout: layout,
|
|
@@ -392,7 +393,7 @@ var ResizableMediaSingle = exports.default = /*#__PURE__*/function (_React$Compo
|
|
|
392
393
|
containerWidth: containerWidth || origWidth,
|
|
393
394
|
fullWidthMode: fullWidthMode
|
|
394
395
|
})
|
|
395
|
-
},
|
|
396
|
+
}, (0, _react2.jsx)(_ui.Resizer, (0, _extends2.default)({}, this.props, {
|
|
396
397
|
displayGrid: this.displayGrid,
|
|
397
398
|
ratio: ratio,
|
|
398
399
|
width: initialWidth,
|
|
@@ -409,7 +410,7 @@ var ResizableMediaSingle = exports.default = /*#__PURE__*/function (_React$Compo
|
|
|
409
410
|
// This workaround adds an empty div inside the resize handler to prevent the issue.
|
|
410
411
|
,
|
|
411
412
|
handleComponentFunc: function handleComponentFunc() {
|
|
412
|
-
return
|
|
413
|
+
return (0, _react2.jsx)("div", {
|
|
413
414
|
contentEditable: false
|
|
414
415
|
});
|
|
415
416
|
},
|
|
@@ -5,10 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.insertMediaInlineNode = exports.insertMediaGroupNode = exports.getPosInList = exports.canInsertMediaInline = void 0;
|
|
7
7
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
8
|
+
var _mediaInline = require("@atlaskit/editor-common/media-inline");
|
|
8
9
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
9
10
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
10
11
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
11
12
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
13
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
|
+
var _isType = require("./is-type");
|
|
12
15
|
var _mediaCommon = require("./media-common");
|
|
13
16
|
var canInsertMediaInline = exports.canInsertMediaInline = function canInsertMediaInline(state) {
|
|
14
17
|
var node = state.schema.nodes.mediaInline.create({});
|
|
@@ -88,11 +91,29 @@ var insertMediaInlineNode = exports.insertMediaInlineNode = function insertMedia
|
|
|
88
91
|
if (!mediaInline || !mediaState || collection === undefined) {
|
|
89
92
|
return false;
|
|
90
93
|
}
|
|
91
|
-
var id = mediaState.id
|
|
92
|
-
|
|
94
|
+
var id = mediaState.id,
|
|
95
|
+
dimensions = mediaState.dimensions,
|
|
96
|
+
_mediaState$scaleFact = mediaState.scaleFactor,
|
|
97
|
+
scaleFactor = _mediaState$scaleFact === void 0 ? 1 : _mediaState$scaleFact;
|
|
98
|
+
var mediaInlineAttrs = {
|
|
93
99
|
id: id,
|
|
94
100
|
collection: collection
|
|
95
|
-
}
|
|
101
|
+
};
|
|
102
|
+
if (
|
|
103
|
+
// TODO: replace it with new shouldShowInlineImage
|
|
104
|
+
(0, _platformFeatureFlags.getBooleanFF)('platform.editor.media.inline-image.base-support') && (0, _isType.isImage)(mediaState.fileMimeType)) {
|
|
105
|
+
var _ref = dimensions || {
|
|
106
|
+
width: undefined,
|
|
107
|
+
height: undefined
|
|
108
|
+
},
|
|
109
|
+
width = _ref.width,
|
|
110
|
+
height = _ref.height;
|
|
111
|
+
var scaledWidth = width ? Math.round(width / scaleFactor) : _mediaInline.DEFAULT_IMAGE_WIDTH;
|
|
112
|
+
var scaledHeight = height ? Math.round(height / scaleFactor) : _mediaInline.DEFAULT_IMAGE_HEIGHT;
|
|
113
|
+
mediaInlineAttrs.width = scaledWidth;
|
|
114
|
+
mediaInlineAttrs.height = scaledHeight;
|
|
115
|
+
}
|
|
116
|
+
var mediaInlineNode = mediaInline.create(mediaInlineAttrs);
|
|
96
117
|
var space = state.schema.text(' ');
|
|
97
118
|
var pos = state.selection.$to.pos;
|
|
98
119
|
|
|
@@ -138,7 +138,8 @@ var createMediaSingleNode = exports.createMediaSingleNode = function createMedia
|
|
|
138
138
|
dimensions = mediaState.dimensions,
|
|
139
139
|
contextId = mediaState.contextId,
|
|
140
140
|
_mediaState$scaleFact = mediaState.scaleFactor,
|
|
141
|
-
scaleFactor = _mediaState$scaleFact === void 0 ? 1 : _mediaState$scaleFact
|
|
141
|
+
scaleFactor = _mediaState$scaleFact === void 0 ? 1 : _mediaState$scaleFact,
|
|
142
|
+
fileName = mediaState.fileName;
|
|
142
143
|
var _ref = dimensions || {
|
|
143
144
|
height: undefined,
|
|
144
145
|
width: undefined
|
|
@@ -149,14 +150,16 @@ var createMediaSingleNode = exports.createMediaSingleNode = function createMedia
|
|
|
149
150
|
media = _schema$nodes.media,
|
|
150
151
|
mediaSingle = _schema$nodes.mediaSingle;
|
|
151
152
|
var scaledWidth = width && Math.round(width / scaleFactor);
|
|
152
|
-
var mediaNode = media.create({
|
|
153
|
+
var mediaNode = media.create(_objectSpread({
|
|
153
154
|
id: id,
|
|
154
155
|
type: 'file',
|
|
155
156
|
collection: collection,
|
|
156
157
|
contextId: contextId,
|
|
157
158
|
width: scaledWidth,
|
|
158
159
|
height: height && Math.round(height / scaleFactor)
|
|
159
|
-
})
|
|
160
|
+
}, (0, _platformFeatureFlags.getBooleanFF)('platform.editor.a11y-media_er96o') && fileName && {
|
|
161
|
+
alt: fileName
|
|
162
|
+
}));
|
|
160
163
|
var mediaSingleAttrs = alignLeftOnInsert ? {
|
|
161
164
|
layout: 'align-start'
|
|
162
165
|
} : {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
3
|
+
import { MediaInlineImageCard, shouldShowInlineImage } from '@atlaskit/editor-common/media-inline';
|
|
3
4
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
4
5
|
import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
|
|
5
6
|
import { MediaInlineCard } from '@atlaskit/media-card';
|
|
7
|
+
import { getMediaClient } from '@atlaskit/media-client-react';
|
|
6
8
|
import { MediaInlineCardLoadingView } from '@atlaskit/media-ui';
|
|
7
9
|
import { MediaNodeUpdater } from './mediaNodeUpdater';
|
|
8
10
|
import { MediaInlineNodeSelector } from './styles';
|
|
@@ -83,7 +85,11 @@ export const MediaInline = props => {
|
|
|
83
85
|
};
|
|
84
86
|
const {
|
|
85
87
|
id,
|
|
86
|
-
collection
|
|
88
|
+
collection,
|
|
89
|
+
type,
|
|
90
|
+
alt,
|
|
91
|
+
width,
|
|
92
|
+
height
|
|
87
93
|
} = props.node.attrs;
|
|
88
94
|
const identifier = {
|
|
89
95
|
id,
|
|
@@ -104,6 +110,16 @@ export const MediaInline = props => {
|
|
|
104
110
|
isSelected: false
|
|
105
111
|
});
|
|
106
112
|
}
|
|
113
|
+
if (shouldShowInlineImage(type)) {
|
|
114
|
+
return /*#__PURE__*/React.createElement(MediaInlineImageCard, {
|
|
115
|
+
mediaClient: getMediaClient(viewMediaClientConfig),
|
|
116
|
+
identifier: identifier,
|
|
117
|
+
isSelected: props.isSelected,
|
|
118
|
+
alt: alt,
|
|
119
|
+
width: width,
|
|
120
|
+
height: height
|
|
121
|
+
});
|
|
122
|
+
}
|
|
107
123
|
return /*#__PURE__*/React.createElement(MediaInlineCard, {
|
|
108
124
|
isSelected: props.isSelected,
|
|
109
125
|
identifier: identifier,
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
/** @jsx jsx */
|
|
4
|
+
|
|
3
5
|
import React, { Component } from 'react';
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
4
7
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
5
8
|
import { calcMediaSinglePixelWidth, DEFAULT_IMAGE_HEIGHT, DEFAULT_IMAGE_WIDTH, getMaxWidthForNestedNode, MEDIA_SINGLE_GUTTER_SIZE } from '@atlaskit/editor-common/media-single';
|
|
6
9
|
import { WithProviders } from '@atlaskit/editor-common/provider-factory';
|
|
@@ -329,23 +332,23 @@ export default class MediaSingleNode extends Component {
|
|
|
329
332
|
}
|
|
330
333
|
}
|
|
331
334
|
const shouldShowPlaceholder = mediaOptions.allowCaptions && node.childCount !== 2 && isSelected && state.selection instanceof NodeSelection;
|
|
332
|
-
const MediaChildren =
|
|
335
|
+
const MediaChildren = jsx("figure", {
|
|
333
336
|
ref: this.mediaSingleWrapperRef,
|
|
334
337
|
css: [figureWrapper],
|
|
335
338
|
className: MediaSingleNodeSelector,
|
|
336
339
|
onClick: this.onMediaSingleClicked
|
|
337
|
-
},
|
|
340
|
+
}, jsx("div", {
|
|
338
341
|
ref: this.props.forwardRef
|
|
339
|
-
}), shouldShowPlaceholder &&
|
|
342
|
+
}), shouldShowPlaceholder && jsx(CaptionPlaceholder, {
|
|
340
343
|
ref: this.captionPlaceHolderRef,
|
|
341
344
|
onClick: this.clickPlaceholder
|
|
342
345
|
}));
|
|
343
|
-
return canResize ? getBooleanFF('platform.editor.media.extended-resize-experience') ?
|
|
346
|
+
return canResize ? getBooleanFF('platform.editor.media.extended-resize-experience') ? jsx(ResizableMediaSingleNext, _extends({}, resizableMediaSingleProps, {
|
|
344
347
|
showLegacyNotification: widthType !== 'pixel'
|
|
345
|
-
}), MediaChildren) :
|
|
348
|
+
}), MediaChildren) : jsx(ResizableMediaSingle, _extends({}, resizableMediaSingleProps, {
|
|
346
349
|
lineLength: contentWidthForLegacyExperience,
|
|
347
350
|
pctWidth: mediaSingleWidthAttribute
|
|
348
|
-
}), MediaChildren) :
|
|
351
|
+
}), MediaChildren) : jsx(MediaSingle, _extends({}, mediaSingleProps, {
|
|
349
352
|
pctWidth: mediaSingleWidthAttribute
|
|
350
353
|
}), MediaChildren);
|
|
351
354
|
}
|
|
@@ -372,7 +375,7 @@ const MediaSingleNodeWrapper = ({
|
|
|
372
375
|
widthState,
|
|
373
376
|
mediaState
|
|
374
377
|
} = useSharedPluginState(pluginInjectionApi, ['width', 'media']);
|
|
375
|
-
return
|
|
378
|
+
return jsx(MediaSingleNode, {
|
|
376
379
|
width: widthState.width,
|
|
377
380
|
lineLength: widthState.lineLength,
|
|
378
381
|
node: node,
|
|
@@ -481,14 +484,14 @@ class MediaSingleNodeView extends ReactNodeView {
|
|
|
481
484
|
|
|
482
485
|
// getPos is a boolean for marks, since this is a node we know it must be a function
|
|
483
486
|
const getPos = this.getPos;
|
|
484
|
-
return
|
|
487
|
+
return jsx(WithProviders, {
|
|
485
488
|
providers: ['mediaProvider', 'contextIdentifierProvider'],
|
|
486
489
|
providerFactory: providerFactory,
|
|
487
490
|
renderNode: ({
|
|
488
491
|
mediaProvider,
|
|
489
492
|
contextIdentifierProvider
|
|
490
493
|
}) => {
|
|
491
|
-
return
|
|
494
|
+
return jsx(MediaSingleNodeWrapper, {
|
|
492
495
|
pluginInjectionApi: pluginInjectionApi,
|
|
493
496
|
mediaProvider: mediaProvider,
|
|
494
497
|
contextIdentifierProvider: contextIdentifierProvider,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
1
2
|
import React from 'react';
|
|
2
|
-
import { css } from '@emotion/react';
|
|
3
|
+
import { css, jsx } from '@emotion/react';
|
|
3
4
|
import { MediaBorderGapFiller } from '@atlaskit/editor-common/ui';
|
|
4
5
|
export const MediaInlineNodeSelector = 'media-inline-node';
|
|
5
6
|
export const MediaSingleNodeSelector = 'media-single-node';
|
|
@@ -23,7 +24,7 @@ export const MediaCardWrapper = ({
|
|
|
23
24
|
onContextMenu
|
|
24
25
|
}) => {
|
|
25
26
|
const calculatedBorderWidth = selected && borderWidth > 0 ? borderWidth + 1 : borderWidth;
|
|
26
|
-
return
|
|
27
|
+
return jsx("div", {
|
|
27
28
|
"data-testid": "media-card-wrapper",
|
|
28
29
|
style: {
|
|
29
30
|
borderColor: `var(--custom-palette-color)`,
|
|
@@ -31,15 +32,15 @@ export const MediaCardWrapper = ({
|
|
|
31
32
|
borderStyle: 'solid',
|
|
32
33
|
borderRadius: `${calculatedBorderWidth * 2}px`
|
|
33
34
|
}
|
|
34
|
-
},
|
|
35
|
+
}, jsx("div", {
|
|
35
36
|
css: forcedDimensions,
|
|
36
37
|
style: {
|
|
37
38
|
paddingBottom: `${dimensions.height / dimensions.width * 100}%`
|
|
38
39
|
},
|
|
39
40
|
onContextMenuCapture: onContextMenu
|
|
40
|
-
}, borderWidth > 0 &&
|
|
41
|
+
}, borderWidth > 0 && jsx(MediaBorderGapFiller, {
|
|
41
42
|
borderColor: `var(--custom-palette-color)`
|
|
42
|
-
}),
|
|
43
|
+
}), jsx("div", {
|
|
43
44
|
css: absoluteDiv
|
|
44
45
|
}, children)));
|
|
45
46
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
|
|
2
4
|
import React from 'react';
|
|
3
|
-
import { css } from '@emotion/react';
|
|
5
|
+
import { css, jsx } from '@emotion/react';
|
|
4
6
|
import { injectIntl } from 'react-intl-next';
|
|
5
7
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
8
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
@@ -165,31 +167,31 @@ export class AltTextEditComponent extends React.Component {
|
|
|
165
167
|
showClearTextButton
|
|
166
168
|
} = this.state;
|
|
167
169
|
const backButtonMessage = formatMessage(messages.back);
|
|
168
|
-
const backButtonMessageComponent =
|
|
170
|
+
const backButtonMessageComponent = jsx(ToolTipContent, {
|
|
169
171
|
description: backButtonMessage,
|
|
170
172
|
keymap: escape,
|
|
171
173
|
shortcutOverride: "Esc"
|
|
172
174
|
});
|
|
173
175
|
const errorsList = (this.state.validationErrors || []).map(function (error, index) {
|
|
174
|
-
return
|
|
176
|
+
return jsx(ErrorMessage, {
|
|
175
177
|
key: index
|
|
176
178
|
}, error);
|
|
177
179
|
});
|
|
178
180
|
const hasErrors = !!errorsList.length;
|
|
179
|
-
return
|
|
181
|
+
return jsx("div", {
|
|
180
182
|
css: container
|
|
181
|
-
},
|
|
183
|
+
}, jsx("section", {
|
|
182
184
|
css: inputWrapper
|
|
183
|
-
},
|
|
185
|
+
}, jsx("div", {
|
|
184
186
|
css: buttonWrapper
|
|
185
|
-
},
|
|
187
|
+
}, jsx(Button, {
|
|
186
188
|
title: formatMessage(messages.back),
|
|
187
|
-
icon:
|
|
189
|
+
icon: jsx(ChevronLeftLargeIcon, {
|
|
188
190
|
label: formatMessage(messages.back)
|
|
189
191
|
}),
|
|
190
192
|
tooltipContent: backButtonMessageComponent,
|
|
191
193
|
onClick: this.closeMediaAltTextMenu
|
|
192
|
-
})),
|
|
194
|
+
})), jsx(PanelTextInput, {
|
|
193
195
|
testId: "alt-text-input",
|
|
194
196
|
ariaLabel: formatMessage(messages.placeholder),
|
|
195
197
|
describedById: `${hasErrors ? 'errors-list' : ''} support-text`,
|
|
@@ -203,24 +205,24 @@ export class AltTextEditComponent extends React.Component {
|
|
|
203
205
|
ariaRequired: true,
|
|
204
206
|
ariaInvalid: hasErrors,
|
|
205
207
|
autoFocus: true
|
|
206
|
-
}), showClearTextButton &&
|
|
208
|
+
}), showClearTextButton && jsx("div", {
|
|
207
209
|
css: buttonWrapper
|
|
208
|
-
},
|
|
210
|
+
}, jsx(Button, {
|
|
209
211
|
testId: "alt-text-clear-button",
|
|
210
212
|
title: formatMessage(messages.clear),
|
|
211
|
-
icon:
|
|
213
|
+
icon: jsx("span", {
|
|
212
214
|
css: clearText
|
|
213
|
-
},
|
|
215
|
+
}, jsx(CrossCircleIcon, {
|
|
214
216
|
label: formatMessage(messages.clear)
|
|
215
217
|
})),
|
|
216
218
|
tooltipContent: formatMessage(messages.clear),
|
|
217
219
|
onClick: this.handleClearText
|
|
218
|
-
}))), hasErrors &&
|
|
220
|
+
}))), hasErrors && jsx("section", {
|
|
219
221
|
id: "errors-list",
|
|
220
222
|
ref: this.errorsListRef,
|
|
221
223
|
"aria-live": "assertive",
|
|
222
224
|
css: validationWrapper
|
|
223
|
-
}, errorsList),
|
|
225
|
+
}, errorsList), jsx("p", {
|
|
224
226
|
css: supportText,
|
|
225
227
|
id: "support-text"
|
|
226
228
|
}, formatMessage(messages.supportText)));
|
|
@@ -30,6 +30,14 @@ import { getLinkingToolbar, shouldShowMediaLinkToolbar } from './linking';
|
|
|
30
30
|
import { LinkToolbarAppearance } from './linking-toolbar-appearance';
|
|
31
31
|
import { generateMediaInlineFloatingToolbar } from './mediaInline';
|
|
32
32
|
import { calcNewLayout, downloadMedia, getMaxToolbarWidth, getPixelWidthOfElement, getSelectedLayoutIcon, getSelectedMediaSingle, removeMediaGroupNode } from './utils';
|
|
33
|
+
const mediaTypeMessages = {
|
|
34
|
+
image: messages.file_image_is_selected,
|
|
35
|
+
video: messages.file_video_is_selected,
|
|
36
|
+
audio: messages.file_audio_is_selected,
|
|
37
|
+
doc: messages.file_doc_is_selected,
|
|
38
|
+
archive: messages.file_archive_is_selected,
|
|
39
|
+
unknown: messages.file_unknown_is_selected
|
|
40
|
+
};
|
|
33
41
|
const remove = (state, dispatch) => {
|
|
34
42
|
if (dispatch) {
|
|
35
43
|
dispatch(removeSelectedNode(state.tr));
|
|
@@ -402,6 +410,10 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
402
410
|
}, removeButton];
|
|
403
411
|
return items;
|
|
404
412
|
};
|
|
413
|
+
const getMediaTypeMessage = selectedNodeTypeSingle => {
|
|
414
|
+
const mediaType = Object.keys(mediaTypeMessages).find(key => selectedNodeTypeSingle === null || selectedNodeTypeSingle === void 0 ? void 0 : selectedNodeTypeSingle.includes(key));
|
|
415
|
+
return mediaType ? mediaTypeMessages[mediaType] : messages.file_unknown_is_selected;
|
|
416
|
+
};
|
|
405
417
|
export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi) => {
|
|
406
418
|
var _pluginInjectionApi$d2;
|
|
407
419
|
const {
|
|
@@ -480,10 +492,23 @@ export const floatingToolbar = (state, intl, options = {}, pluginInjectionApi) =
|
|
|
480
492
|
};
|
|
481
493
|
items = generateMediaSingleFloatingToolbar(state, intl, options, mediaPluginState, mediaLinkingState, pluginInjectionApi, getEditorFeatureFlags);
|
|
482
494
|
}
|
|
495
|
+
var assistiveMessage = '';
|
|
496
|
+
if (getBooleanFF('platform.editor.a11y-media_er96o')) {
|
|
497
|
+
const selectedMediaSingleNode = getSelectedMediaSingle(state);
|
|
498
|
+
if (selectedMediaSingleNode) {
|
|
499
|
+
const selectedMediaNode = selectedMediaSingleNode === null || selectedMediaSingleNode === void 0 ? void 0 : selectedMediaSingleNode.node.content.firstChild;
|
|
500
|
+
const selectedNodeTypeSingle = selectedMediaNode === null || selectedMediaNode === void 0 ? void 0 : selectedMediaNode.attrs.__fileMimeType;
|
|
501
|
+
const selectedMediaAlt = selectedMediaNode === null || selectedMediaNode === void 0 ? void 0 : selectedMediaNode.attrs.alt;
|
|
502
|
+
assistiveMessage = intl === null || intl === void 0 ? void 0 : intl.formatMessage(getMediaTypeMessage(selectedNodeTypeSingle), {
|
|
503
|
+
name: selectedMediaAlt
|
|
504
|
+
});
|
|
505
|
+
}
|
|
506
|
+
}
|
|
483
507
|
const toolbarConfig = {
|
|
484
508
|
...baseToolbar,
|
|
485
509
|
items,
|
|
486
|
-
scrollable: true
|
|
510
|
+
scrollable: true,
|
|
511
|
+
mediaAssistiveMessage: assistiveMessage
|
|
487
512
|
};
|
|
488
513
|
if (getBooleanFF('platform.editor.media.extended-resize-experience') && allowResizing) {
|
|
489
514
|
return {
|