@atlaskit/editor-plugin-media 4.0.0 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/cjs/nodeviews/mediaGroup.js +16 -323
- package/dist/cjs/nodeviews/mediaSingle.js +47 -593
- package/dist/cjs/pm-plugins/alt-text/ui/AltTextEdit.js +2 -3
- package/dist/cjs/pm-plugins/pixel-resizing/ui/pixel-entry.js +1 -1
- package/dist/cjs/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +67 -649
- package/dist/cjs/ui/toolbar/alt-text.js +1 -2
- package/dist/cjs/ui/toolbar/index.js +4 -12
- package/dist/cjs/ui/toolbar/linking.js +3 -4
- package/dist/cjs/ui/toolbar/mediaInline.js +2 -6
- package/dist/cjs/ui/toolbar/pixel-resizing.js +1 -5
- package/dist/es2019/nodeviews/mediaGroup.js +1 -272
- package/dist/es2019/nodeviews/mediaSingle.js +6 -477
- package/dist/es2019/pm-plugins/alt-text/ui/AltTextEdit.js +2 -3
- package/dist/es2019/pm-plugins/pixel-resizing/ui/pixel-entry.js +1 -1
- package/dist/es2019/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +2 -510
- package/dist/es2019/ui/toolbar/alt-text.js +1 -2
- package/dist/es2019/ui/toolbar/index.js +4 -12
- package/dist/es2019/ui/toolbar/linking.js +3 -4
- package/dist/es2019/ui/toolbar/mediaInline.js +2 -6
- package/dist/es2019/ui/toolbar/pixel-resizing.js +1 -5
- package/dist/esm/nodeviews/mediaGroup.js +15 -322
- package/dist/esm/nodeviews/mediaSingle.js +47 -593
- package/dist/esm/pm-plugins/alt-text/ui/AltTextEdit.js +2 -3
- package/dist/esm/pm-plugins/pixel-resizing/ui/pixel-entry.js +1 -1
- package/dist/esm/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +64 -650
- package/dist/esm/ui/toolbar/alt-text.js +1 -2
- package/dist/esm/ui/toolbar/index.js +4 -12
- package/dist/esm/ui/toolbar/linking.js +3 -4
- package/dist/esm/ui/toolbar/mediaInline.js +2 -6
- package/dist/esm/ui/toolbar/pixel-resizing.js +1 -5
- package/dist/types/nodeviews/__mocks__/mediaNodeUpdater.d.ts +1 -0
- package/dist/types/nodeviews/mediaGroup.d.ts +2 -23
- package/dist/types/nodeviews/mediaSingle.d.ts +2 -38
- package/dist/types/nodeviews/mediaSingleNext.d.ts +1 -2
- package/dist/types-ts4.5/nodeviews/__mocks__/mediaNodeUpdater.d.ts +1 -0
- package/dist/types-ts4.5/nodeviews/mediaGroup.d.ts +2 -23
- package/dist/types-ts4.5/nodeviews/mediaSingle.d.ts +2 -38
- package/dist/types-ts4.5/nodeviews/mediaSingleNext.d.ts +1 -2
- package/package.json +4 -16
|
@@ -1,15 +1,5 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
4
|
-
import
|
|
5
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
6
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
9
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
11
|
-
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
12
|
-
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
13
3
|
/**
|
|
14
4
|
* @jsxRuntime classic
|
|
15
5
|
* @jsx jsx
|
|
@@ -20,14 +10,12 @@ import React, { useCallback, useEffect, useLayoutEffect, useMemo, useRef, useSta
|
|
|
20
10
|
import { jsx } from '@emotion/react';
|
|
21
11
|
import classnames from 'classnames';
|
|
22
12
|
import throttle from 'lodash/throttle';
|
|
23
|
-
import memoizeOne from 'memoize-one';
|
|
24
|
-
import { isSSR } from '@atlaskit/editor-common/core-utils';
|
|
25
13
|
import { findClosestSnap, generateDefaultGuidelines, generateDynamicGuidelines, getGuidelineSnaps, getGuidelinesWithHighlights, getGuidelineTypeFromKey, getRelativeGuidelines, getRelativeGuideSnaps } from '@atlaskit/editor-common/guideline';
|
|
26
14
|
import { calcMediaSingleMaxWidth, DEFAULT_IMAGE_WIDTH, MEDIA_SINGLE_ADJACENT_HANDLE_MARGIN, MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH, MEDIA_SINGLE_RESIZE_THROTTLE_TIME, MEDIA_SINGLE_SNAP_GAP, MEDIA_SINGLE_VIDEO_MIN_PIXEL_WIDTH } from '@atlaskit/editor-common/media-single';
|
|
27
15
|
import { ResizerNext } from '@atlaskit/editor-common/resizer';
|
|
28
16
|
import { resizerStyles, richMediaClassName } from '@atlaskit/editor-common/styles';
|
|
29
17
|
import { calcPctFromPx, handleSides, imageAlignmentMap, wrappedLayouts } from '@atlaskit/editor-common/ui';
|
|
30
|
-
import { nonWrappedLayouts
|
|
18
|
+
import { nonWrappedLayouts } from '@atlaskit/editor-common/utils';
|
|
31
19
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
32
20
|
import { findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
33
21
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth, akEditorGutterPaddingDynamic } from '@atlaskit/editor-shared-styles';
|
|
@@ -38,562 +26,26 @@ import { checkMediaType } from '../../pm-plugins/utils/check-media-type';
|
|
|
38
26
|
import { ResizableMediaMigrationNotification } from './ResizableMediaMigrationNotification';
|
|
39
27
|
import { wrapperStyle } from './styled';
|
|
40
28
|
export var resizerNextTestId = 'mediaSingle.resizerNext.testid';
|
|
41
|
-
// eslint-disable-next-line @repo/internal/react/no-class-components
|
|
42
|
-
var ResizableMediaSingleNext = /*#__PURE__*/function (_React$Component) {
|
|
43
|
-
function ResizableMediaSingleNext(props) {
|
|
44
|
-
var _this;
|
|
45
|
-
_classCallCheck(this, ResizableMediaSingleNext);
|
|
46
|
-
_this = _callSuper(this, ResizableMediaSingleNext, [props]);
|
|
47
|
-
_defineProperty(_this, "lastSnappedGuidelineKeys", []);
|
|
48
|
-
_defineProperty(_this, "updateGuidelines", function () {
|
|
49
|
-
var _this$props = _this.props,
|
|
50
|
-
view = _this$props.view,
|
|
51
|
-
lineLength = _this$props.lineLength;
|
|
52
|
-
var defaultGuidelines = _this.getDefaultGuidelines();
|
|
53
|
-
var _generateDynamicGuide = generateDynamicGuidelines(view.state, lineLength, {
|
|
54
|
-
styles: {
|
|
55
|
-
lineStyle: 'dashed'
|
|
56
|
-
},
|
|
57
|
-
show: false
|
|
58
|
-
}),
|
|
59
|
-
relativeGuides = _generateDynamicGuide.relativeGuides,
|
|
60
|
-
dynamicGuides = _generateDynamicGuide.dynamicGuides;
|
|
61
|
-
|
|
62
|
-
// disable guidelines for nested media single node
|
|
63
|
-
var dynamicGuidelines = _this.isAdjacentMode() ? [] : dynamicGuides;
|
|
64
|
-
_this.setState({
|
|
65
|
-
relativeGuides: relativeGuides,
|
|
66
|
-
guidelines: [].concat(_toConsumableArray(defaultGuidelines), _toConsumableArray(dynamicGuidelines))
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
_defineProperty(_this, "calcNewLayout", function (newWidth, stop) {
|
|
70
|
-
var _this$props2 = _this.props,
|
|
71
|
-
layout = _this$props2.layout,
|
|
72
|
-
containerWidth = _this$props2.containerWidth,
|
|
73
|
-
lineLength = _this$props2.lineLength,
|
|
74
|
-
fullWidthMode = _this$props2.fullWidthMode;
|
|
75
|
-
var newPct = calcPctFromPx(newWidth, lineLength) * 100;
|
|
76
|
-
if (newPct <= 100 && _this.wrappedLayout) {
|
|
77
|
-
if (!stop || newPct !== 100) {
|
|
78
|
-
return layout;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return _this.calcUnwrappedLayout(newWidth, containerWidth || 0, lineLength, fullWidthMode, _this.isAdjacentMode());
|
|
82
|
-
});
|
|
83
|
-
_defineProperty(_this, "calcUnwrappedLayout", function (width, containerWidth, contentWidth, fullWidthMode, isNestedNode) {
|
|
84
|
-
if (isNestedNode) {
|
|
85
|
-
return 'center';
|
|
86
|
-
}
|
|
87
|
-
if (fullWidthMode) {
|
|
88
|
-
if (width < contentWidth) {
|
|
89
|
-
return 'center';
|
|
90
|
-
}
|
|
91
|
-
return 'full-width';
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// handle top-level node in fixed-width editor
|
|
95
|
-
if (width <= contentWidth) {
|
|
96
|
-
return 'center';
|
|
97
|
-
}
|
|
98
|
-
if (width < Math.min(containerWidth - akEditorGutterPaddingDynamic() * 2, akEditorFullWidthLayoutWidth)) {
|
|
99
|
-
return 'wide';
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// set full width to be containerWidth - akEditorGutterPaddingDynamic() * 2
|
|
103
|
-
// instead of containerWidth - akEditorBreakoutPadding,
|
|
104
|
-
// so that we have image aligned with text
|
|
105
|
-
return 'full-width';
|
|
106
|
-
});
|
|
107
|
-
_defineProperty(_this, "calcPxHeight", function (newWidth) {
|
|
108
|
-
var _this$props3 = _this.props,
|
|
109
|
-
_this$props3$width = _this$props3.width,
|
|
110
|
-
width = _this$props3$width === void 0 ? newWidth : _this$props3$width,
|
|
111
|
-
height = _this$props3.height;
|
|
112
|
-
return Math.round(height / width * newWidth);
|
|
113
|
-
});
|
|
114
|
-
_defineProperty(_this, "displayGuideline", function (guidelines) {
|
|
115
|
-
var _this$props$pluginInj;
|
|
116
|
-
return (_this$props$pluginInj = _this.props.pluginInjectionApi) === null || _this$props$pluginInj === void 0 || (_this$props$pluginInj = _this$props$pluginInj.guideline) === null || _this$props$pluginInj === void 0 || (_this$props$pluginInj = _this$props$pluginInj.actions) === null || _this$props$pluginInj === void 0 ? void 0 : _this$props$pluginInj.displayGuideline(_this.props.view)({
|
|
117
|
-
guidelines: guidelines
|
|
118
|
-
});
|
|
119
|
-
});
|
|
120
|
-
_defineProperty(_this, "setIsResizing", function (isResizing) {
|
|
121
|
-
var _this$props$view = _this.props.view,
|
|
122
|
-
state = _this$props$view.state,
|
|
123
|
-
dispatch = _this$props$view.dispatch;
|
|
124
|
-
var tr = state.tr;
|
|
125
|
-
tr.setMeta(MEDIA_PLUGIN_IS_RESIZING_KEY, isResizing);
|
|
126
|
-
tr.setMeta('is-resizer-resizing', isResizing);
|
|
127
|
-
return dispatch(tr);
|
|
128
|
-
});
|
|
129
|
-
_defineProperty(_this, "updateSizeInPluginState", throttle(function (width) {
|
|
130
|
-
var _this$props$view2 = _this.props.view,
|
|
131
|
-
state = _this$props$view2.state,
|
|
132
|
-
dispatch = _this$props$view2.dispatch;
|
|
133
|
-
var tr = state.tr;
|
|
134
|
-
tr.setMeta(MEDIA_PLUGIN_RESIZING_WIDTH_KEY, width);
|
|
135
|
-
return dispatch(tr);
|
|
136
|
-
}, MEDIA_SINGLE_RESIZE_THROTTLE_TIME));
|
|
137
|
-
_defineProperty(_this, "calcMaxWidth", memoizeOne(function (contentWidth, containerWidth, fullWidthMode) {
|
|
138
|
-
if (_this.isAdjacentMode() || fullWidthMode) {
|
|
139
|
-
return contentWidth;
|
|
140
|
-
}
|
|
141
|
-
return calcMediaSingleMaxWidth(containerWidth, _this.props.editorAppearance);
|
|
142
|
-
}));
|
|
143
|
-
_defineProperty(_this, "calcMinWidth", memoizeOne(function (isVideoFile, contentWidth) {
|
|
144
|
-
return Math.min(contentWidth || akEditorDefaultLayoutWidth, isVideoFile ? MEDIA_SINGLE_VIDEO_MIN_PIXEL_WIDTH : MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH);
|
|
145
|
-
}));
|
|
146
|
-
_defineProperty(_this, "getRelativeGuides", function () {
|
|
147
|
-
var _this$props$pluginInj2;
|
|
148
|
-
var guidelinePluginState = (_this$props$pluginInj2 = _this.props.pluginInjectionApi) === null || _this$props$pluginInj2 === void 0 || (_this$props$pluginInj2 = _this$props$pluginInj2.guideline) === null || _this$props$pluginInj2 === void 0 || (_this$props$pluginInj2 = _this$props$pluginInj2.sharedState) === null || _this$props$pluginInj2 === void 0 ? void 0 : _this$props$pluginInj2.currentState();
|
|
149
|
-
var _ref = (guidelinePluginState === null || guidelinePluginState === void 0 ? void 0 : guidelinePluginState.rect) || {
|
|
150
|
-
top: 0,
|
|
151
|
-
left: 0
|
|
152
|
-
},
|
|
153
|
-
topOffset = _ref.top;
|
|
154
|
-
var $pos = _this.$pos;
|
|
155
|
-
var relativeGuides = $pos && $pos.nodeAfter && _this.state.size.width ? getRelativeGuidelines(_this.state.relativeGuides, {
|
|
156
|
-
node: $pos.nodeAfter,
|
|
157
|
-
pos: $pos.pos
|
|
158
|
-
}, _this.props.view, _this.props.lineLength, topOffset, _this.state.size) : [];
|
|
159
|
-
return relativeGuides;
|
|
160
|
-
});
|
|
161
|
-
_defineProperty(_this, "updateActiveGuidelines", function () {
|
|
162
|
-
var width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
163
|
-
var guidelines = arguments.length > 1 ? arguments[1] : undefined;
|
|
164
|
-
var guidelineSnapsReference = arguments.length > 2 ? arguments[2] : undefined;
|
|
165
|
-
if (guidelineSnapsReference.snaps.x) {
|
|
166
|
-
var _findClosestSnap = findClosestSnap(width, guidelineSnapsReference.snaps.x, guidelineSnapsReference.guidelineReference, MEDIA_SINGLE_SNAP_GAP),
|
|
167
|
-
gap = _findClosestSnap.gap,
|
|
168
|
-
activeGuidelineKeys = _findClosestSnap.keys;
|
|
169
|
-
var relativeGuidelines = activeGuidelineKeys.length ? [] : _this.getRelativeGuides();
|
|
170
|
-
_this.lastSnappedGuidelineKeys = activeGuidelineKeys.length ? activeGuidelineKeys : relativeGuidelines.map(function (rg) {
|
|
171
|
-
return rg.key;
|
|
172
|
-
});
|
|
173
|
-
_this.displayGuideline([].concat(_toConsumableArray(getGuidelinesWithHighlights(gap, MEDIA_SINGLE_SNAP_GAP, activeGuidelineKeys, guidelines)), _toConsumableArray(relativeGuidelines)));
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
_defineProperty(_this, "calculateSizeState", function (size, delta) {
|
|
177
|
-
var onResizeStop = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
178
|
-
var calculatedWidth = Math.round(size.width + delta.width);
|
|
179
|
-
var calculatedWidthWithLayout = _this.calcNewLayout(calculatedWidth, onResizeStop);
|
|
180
|
-
return {
|
|
181
|
-
width: calculatedWidth,
|
|
182
|
-
height: calculatedWidth / _this.aspectRatio,
|
|
183
|
-
layout: calculatedWidthWithLayout
|
|
184
|
-
};
|
|
185
|
-
});
|
|
186
|
-
_defineProperty(_this, "selectCurrentMediaNode", function () {
|
|
187
|
-
// TODO: ED-26962 - if adding !this.props.selected, it doesn't work if media single node is at top postion
|
|
188
|
-
if (_this.pos === null) {
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
setNodeSelection(_this.props.view, _this.pos);
|
|
192
|
-
});
|
|
193
|
-
_defineProperty(_this, "handleResizeStart", function () {
|
|
194
|
-
_this.setState({
|
|
195
|
-
isResizing: true
|
|
196
|
-
});
|
|
197
|
-
_this.selectCurrentMediaNode();
|
|
198
|
-
_this.setIsResizing(true);
|
|
199
|
-
_this.updateSizeInPluginState(_this.state.size.width);
|
|
200
|
-
// re-calculate guidelines
|
|
201
|
-
if (_this.isGuidelineEnabled) {
|
|
202
|
-
_this.updateGuidelines();
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
_defineProperty(_this, "handleResize", function (size, delta) {
|
|
206
|
-
var _this$props4 = _this.props,
|
|
207
|
-
layout = _this$props4.layout,
|
|
208
|
-
updateSize = _this$props4.updateSize,
|
|
209
|
-
lineLength = _this$props4.lineLength;
|
|
210
|
-
var _this$calculateSizeSt = _this.calculateSizeState(size, delta),
|
|
211
|
-
width = _this$calculateSizeSt.width,
|
|
212
|
-
height = _this$calculateSizeSt.height,
|
|
213
|
-
newLayout = _this$calculateSizeSt.layout;
|
|
214
|
-
if (_this.isGuidelineEnabled) {
|
|
215
|
-
var guidelineSnaps = getGuidelineSnaps(_this.state.guidelines, lineLength, layout);
|
|
216
|
-
_this.updateActiveGuidelines(width, _this.state.guidelines, guidelineSnaps);
|
|
217
|
-
var relativeSnaps = getRelativeGuideSnaps(_this.state.relativeGuides, _this.aspectRatio);
|
|
218
|
-
_this.setState({
|
|
219
|
-
size: {
|
|
220
|
-
width: width,
|
|
221
|
-
height: height
|
|
222
|
-
},
|
|
223
|
-
snaps: {
|
|
224
|
-
x: [].concat(_toConsumableArray(guidelineSnaps.snaps.x || []), _toConsumableArray(relativeSnaps))
|
|
225
|
-
}
|
|
226
|
-
});
|
|
227
|
-
} else {
|
|
228
|
-
_this.setState({
|
|
229
|
-
size: {
|
|
230
|
-
width: width,
|
|
231
|
-
height: height
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
_this.updateSizeInPluginState(width);
|
|
236
|
-
if (newLayout !== layout) {
|
|
237
|
-
updateSize(width, newLayout);
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
_defineProperty(_this, "handleResizeStop", function (size, delta) {
|
|
241
|
-
var _this$props5 = _this.props,
|
|
242
|
-
updateSize = _this$props5.updateSize,
|
|
243
|
-
dispatchAnalyticsEvent = _this$props5.dispatchAnalyticsEvent,
|
|
244
|
-
nodeType = _this$props5.nodeType;
|
|
245
|
-
var _this$calculateSizeSt2 = _this.calculateSizeState(size, delta, true),
|
|
246
|
-
width = _this$calculateSizeSt2.width,
|
|
247
|
-
height = _this$calculateSizeSt2.height,
|
|
248
|
-
newLayout = _this$calculateSizeSt2.layout;
|
|
249
|
-
if (dispatchAnalyticsEvent) {
|
|
250
|
-
var $pos = _this.$pos;
|
|
251
|
-
var event = getMediaResizeAnalyticsEvent(nodeType || 'mediaSingle', {
|
|
252
|
-
width: width,
|
|
253
|
-
layout: newLayout,
|
|
254
|
-
widthType: 'pixel',
|
|
255
|
-
snapType: getGuidelineTypeFromKey(_this.lastSnappedGuidelineKeys, _this.state.guidelines),
|
|
256
|
-
parentNode: $pos ? $pos.parent.type.name : undefined,
|
|
257
|
-
inputMethod: 'mouse'
|
|
258
|
-
});
|
|
259
|
-
if (event) {
|
|
260
|
-
dispatchAnalyticsEvent(event);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
_this.setIsResizing(false);
|
|
264
|
-
_this.displayGuideline([]);
|
|
265
|
-
var newWidth = width;
|
|
266
|
-
if (newLayout === 'full-width') {
|
|
267
|
-
// When a node reaches full width in current viewport,
|
|
268
|
-
// update its width with 1800 to align with pixel entry
|
|
269
|
-
newWidth = akEditorFullWidthLayoutWidth;
|
|
270
|
-
}
|
|
271
|
-
_this.setState({
|
|
272
|
-
isResizing: false,
|
|
273
|
-
size: {
|
|
274
|
-
width: newWidth,
|
|
275
|
-
height: height
|
|
276
|
-
}
|
|
277
|
-
}, function () {
|
|
278
|
-
updateSize(newWidth, newLayout);
|
|
279
|
-
});
|
|
280
|
-
});
|
|
281
|
-
_defineProperty(_this, "getMaxWidth", function () {
|
|
282
|
-
var _this$props6 = _this.props,
|
|
283
|
-
lineLength = _this$props6.lineLength,
|
|
284
|
-
containerWidth = _this$props6.containerWidth,
|
|
285
|
-
fullWidthMode = _this$props6.fullWidthMode,
|
|
286
|
-
editorAppearance = _this$props6.editorAppearance,
|
|
287
|
-
forceHandlePositioning = _this$props6.forceHandlePositioning;
|
|
288
|
-
var isResizing = _this.state.isResizing;
|
|
289
|
-
if (editorAppearance === 'chromeless' && forceHandlePositioning === 'adjacent' && fg('platform_editor_inline_resize_media_to_edge')) {
|
|
290
|
-
return containerWidth - MEDIA_SINGLE_ADJACENT_HANDLE_MARGIN * 2;
|
|
291
|
-
}
|
|
292
|
-
return !isResizing && _this.isAdjacentMode() ?
|
|
293
|
-
// set undefined to fall back to 100%
|
|
294
|
-
undefined : _this.calcMaxWidth(lineLength, containerWidth, fullWidthMode);
|
|
295
|
-
});
|
|
296
|
-
var initialWidth = props.mediaSingleWidth || DEFAULT_IMAGE_WIDTH;
|
|
297
|
-
_this.state = {
|
|
298
|
-
isVideoFile: true,
|
|
299
|
-
isResizing: false,
|
|
300
|
-
size: {
|
|
301
|
-
width: initialWidth,
|
|
302
|
-
height: _this.calcPxHeight(initialWidth)
|
|
303
|
-
},
|
|
304
|
-
snaps: {},
|
|
305
|
-
relativeGuides: {},
|
|
306
|
-
guidelines: []
|
|
307
|
-
};
|
|
308
|
-
return _this;
|
|
309
|
-
}
|
|
310
|
-
_inherits(ResizableMediaSingleNext, _React$Component);
|
|
311
|
-
return _createClass(ResizableMediaSingleNext, [{
|
|
312
|
-
key: "componentDidUpdate",
|
|
313
|
-
value: function componentDidUpdate(prevProps) {
|
|
314
|
-
if (prevProps.mediaSingleWidth !== this.props.mediaSingleWidth && this.props.mediaSingleWidth) {
|
|
315
|
-
// update size when lineLength becomes defined later
|
|
316
|
-
// ensures extended experience renders legacy image with the same size as the legacy experience
|
|
317
|
-
var initialWidth = this.props.mediaSingleWidth;
|
|
318
|
-
this.setState({
|
|
319
|
-
size: {
|
|
320
|
-
width: initialWidth,
|
|
321
|
-
height: this.calcPxHeight(initialWidth)
|
|
322
|
-
}
|
|
323
|
-
});
|
|
324
|
-
}
|
|
325
|
-
return true;
|
|
326
|
-
}
|
|
327
|
-
}, {
|
|
328
|
-
key: "componentDidMount",
|
|
329
|
-
value: function () {
|
|
330
|
-
var _componentDidMount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
331
|
-
var viewMediaClientConfig;
|
|
332
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
333
|
-
while (1) switch (_context.prev = _context.next) {
|
|
334
|
-
case 0:
|
|
335
|
-
viewMediaClientConfig = this.props.viewMediaClientConfig;
|
|
336
|
-
if (!viewMediaClientConfig) {
|
|
337
|
-
_context.next = 4;
|
|
338
|
-
break;
|
|
339
|
-
}
|
|
340
|
-
_context.next = 4;
|
|
341
|
-
return this.checkVideoFile(viewMediaClientConfig);
|
|
342
|
-
case 4:
|
|
343
|
-
case "end":
|
|
344
|
-
return _context.stop();
|
|
345
|
-
}
|
|
346
|
-
}, _callee, this);
|
|
347
|
-
}));
|
|
348
|
-
function componentDidMount() {
|
|
349
|
-
return _componentDidMount.apply(this, arguments);
|
|
350
|
-
}
|
|
351
|
-
return componentDidMount;
|
|
352
|
-
}()
|
|
353
|
-
}, {
|
|
354
|
-
key: "UNSAFE_componentWillReceiveProps",
|
|
355
|
-
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
356
|
-
if (this.props.viewMediaClientConfig !== nextProps.viewMediaClientConfig) {
|
|
357
|
-
this.checkVideoFile(nextProps.viewMediaClientConfig);
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
}, {
|
|
361
|
-
key: "wrappedLayout",
|
|
362
|
-
get: function get() {
|
|
363
|
-
return wrappedLayouts.indexOf(this.props.layout) > -1;
|
|
364
|
-
}
|
|
365
|
-
}, {
|
|
366
|
-
key: "pos",
|
|
367
|
-
get: function get() {
|
|
368
|
-
if (typeof this.props.getPos !== 'function') {
|
|
369
|
-
return null;
|
|
370
|
-
}
|
|
371
|
-
var pos = this.props.getPos();
|
|
372
|
-
if (Number.isNaN(pos) || typeof pos !== 'number') {
|
|
373
|
-
return null;
|
|
374
|
-
}
|
|
375
|
-
return pos;
|
|
376
|
-
}
|
|
377
|
-
}, {
|
|
378
|
-
key: "$pos",
|
|
379
|
-
get: function get() {
|
|
380
|
-
var pos = this.pos;
|
|
381
|
-
// need to pass view because we may not get updated props in time
|
|
382
|
-
return pos === null ? pos : this.props.view.state.doc.resolve(pos);
|
|
383
|
-
}
|
|
384
|
-
}, {
|
|
385
|
-
key: "aspectRatio",
|
|
386
|
-
get: function get() {
|
|
387
|
-
var _this$props7 = this.props,
|
|
388
|
-
width = _this$props7.width,
|
|
389
|
-
height = _this$props7.height;
|
|
390
|
-
if (width) {
|
|
391
|
-
return width / height;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
// TODO: ED-26962 - handle this case
|
|
395
|
-
return 1;
|
|
396
|
-
}
|
|
397
|
-
}, {
|
|
398
|
-
key: "insideInlineLike",
|
|
399
|
-
get: function get() {
|
|
400
|
-
var $pos = this.$pos;
|
|
401
|
-
if (!$pos) {
|
|
402
|
-
return false;
|
|
403
|
-
}
|
|
404
|
-
var listItem = this.props.view.state.schema.nodes.listItem;
|
|
405
|
-
return !!findParentNodeOfTypeClosestToPos($pos, [listItem]);
|
|
406
|
-
}
|
|
407
|
-
}, {
|
|
408
|
-
key: "insideLayout",
|
|
409
|
-
get: function get() {
|
|
410
|
-
var $pos = this.$pos;
|
|
411
|
-
if (!$pos) {
|
|
412
|
-
return false;
|
|
413
|
-
}
|
|
414
|
-
var layoutColumn = this.props.view.state.schema.nodes.layoutColumn;
|
|
415
|
-
return !!findParentNodeOfTypeClosestToPos($pos, [layoutColumn]);
|
|
416
|
-
}
|
|
417
|
-
}, {
|
|
418
|
-
key: "isGuidelineEnabled",
|
|
419
|
-
get: function get() {
|
|
420
|
-
var _this$props$pluginInj3;
|
|
421
|
-
return !!((_this$props$pluginInj3 = this.props.pluginInjectionApi) !== null && _this$props$pluginInj3 !== void 0 && _this$props$pluginInj3.guideline);
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
// check if is inside of layout, table, expand, nestedExpand and list item
|
|
425
|
-
}, {
|
|
426
|
-
key: "isNestedNode",
|
|
427
|
-
value: function isNestedNode() {
|
|
428
|
-
var $pos = this.$pos;
|
|
429
|
-
return !!($pos && $pos.depth !== 0);
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
// Check if adjacement mode should be activated;
|
|
433
|
-
}, {
|
|
434
|
-
key: "isAdjacentMode",
|
|
435
|
-
value: function isAdjacentMode() {
|
|
436
|
-
var _this$isNestedNode;
|
|
437
|
-
if (fg('platform_editor_inline_resize_media_to_edge')) {
|
|
438
|
-
if (this.props.forceHandlePositioning === 'adjacent') {
|
|
439
|
-
return true;
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
return (_this$isNestedNode = this.isNestedNode()) !== null && _this$isNestedNode !== void 0 ? _this$isNestedNode : false;
|
|
443
|
-
}
|
|
444
|
-
}, {
|
|
445
|
-
key: "getHandlePositioning",
|
|
446
|
-
value: function getHandlePositioning() {
|
|
447
|
-
return this.isAdjacentMode() ? 'adjacent' : undefined;
|
|
448
|
-
}
|
|
449
|
-
}, {
|
|
450
|
-
key: "getDefaultGuidelines",
|
|
451
|
-
value: function getDefaultGuidelines() {
|
|
452
|
-
var _this$props8 = this.props,
|
|
453
|
-
lineLength = _this$props8.lineLength,
|
|
454
|
-
containerWidth = _this$props8.containerWidth,
|
|
455
|
-
fullWidthMode = _this$props8.fullWidthMode;
|
|
456
|
-
|
|
457
|
-
// disable guidelines for nested media single node
|
|
458
|
-
return this.isAdjacentMode() ? [] : generateDefaultGuidelines(lineLength, containerWidth || 0, fullWidthMode);
|
|
459
|
-
}
|
|
460
|
-
}, {
|
|
461
|
-
key: "checkVideoFile",
|
|
462
|
-
value: function () {
|
|
463
|
-
var _checkVideoFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(viewMediaClientConfig) {
|
|
464
|
-
var mediaNode, mediaType, isVideoFile;
|
|
465
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
466
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
467
|
-
case 0:
|
|
468
|
-
if (!(this.pos === null || !viewMediaClientConfig)) {
|
|
469
|
-
_context2.next = 2;
|
|
470
|
-
break;
|
|
471
|
-
}
|
|
472
|
-
return _context2.abrupt("return");
|
|
473
|
-
case 2:
|
|
474
|
-
mediaNode = this.props.view.state.doc.nodeAt(this.pos + 1);
|
|
475
|
-
if (!mediaNode) {
|
|
476
|
-
_context2.next = 9;
|
|
477
|
-
break;
|
|
478
|
-
}
|
|
479
|
-
_context2.next = 6;
|
|
480
|
-
return checkMediaType(mediaNode, viewMediaClientConfig);
|
|
481
|
-
case 6:
|
|
482
|
-
_context2.t0 = _context2.sent;
|
|
483
|
-
_context2.next = 10;
|
|
484
|
-
break;
|
|
485
|
-
case 9:
|
|
486
|
-
_context2.t0 = undefined;
|
|
487
|
-
case 10:
|
|
488
|
-
mediaType = _context2.t0;
|
|
489
|
-
isVideoFile = mediaType !== 'external' && mediaType !== 'image';
|
|
490
|
-
if (this.state.isVideoFile !== isVideoFile) {
|
|
491
|
-
this.setState({
|
|
492
|
-
isVideoFile: isVideoFile
|
|
493
|
-
});
|
|
494
|
-
}
|
|
495
|
-
case 13:
|
|
496
|
-
case "end":
|
|
497
|
-
return _context2.stop();
|
|
498
|
-
}
|
|
499
|
-
}, _callee2, this);
|
|
500
|
-
}));
|
|
501
|
-
function checkVideoFile(_x) {
|
|
502
|
-
return _checkVideoFile.apply(this, arguments);
|
|
503
|
-
}
|
|
504
|
-
return checkVideoFile;
|
|
505
|
-
}()
|
|
506
|
-
}, {
|
|
507
|
-
key: "render",
|
|
508
|
-
value: function render() {
|
|
509
|
-
var _this2 = this;
|
|
510
|
-
var _this$props9 = this.props,
|
|
511
|
-
origWidth = _this$props9.width,
|
|
512
|
-
layout = _this$props9.layout,
|
|
513
|
-
containerWidth = _this$props9.containerWidth,
|
|
514
|
-
fullWidthMode = _this$props9.fullWidthMode,
|
|
515
|
-
selected = _this$props9.selected,
|
|
516
|
-
children = _this$props9.children,
|
|
517
|
-
lineLength = _this$props9.lineLength,
|
|
518
|
-
showLegacyNotification = _this$props9.showLegacyNotification;
|
|
519
|
-
var _this$state = this.state,
|
|
520
|
-
isResizing = _this$state.isResizing,
|
|
521
|
-
size = _this$state.size,
|
|
522
|
-
isVideoFile = _this$state.isVideoFile;
|
|
523
|
-
var enable = {};
|
|
524
|
-
handleSides.forEach(function (side) {
|
|
525
|
-
var oppositeSide = side === 'left' ? 'right' : 'left';
|
|
526
|
-
enable[side] = nonWrappedLayouts.concat("wrap-".concat(oppositeSide)).concat("align-".concat(imageAlignmentMap[oppositeSide])).indexOf(layout) > -1;
|
|
527
|
-
if (side === 'left' && _this2.insideInlineLike) {
|
|
528
|
-
enable[side] = false;
|
|
529
|
-
}
|
|
530
|
-
});
|
|
531
|
-
|
|
532
|
-
// TODO: ED-26962 - Clean up where this lives and how it gets generated
|
|
533
|
-
var className = classnames(richMediaClassName, "image-".concat(layout), isResizing ? 'is-resizing' : 'not-resizing', this.props.className, {
|
|
534
|
-
'richMedia-selected': selected,
|
|
535
|
-
'rich-media-wrapped': layout === 'wrap-left' || layout === 'wrap-right'
|
|
536
|
-
});
|
|
537
|
-
var resizerNextClassName = classnames(className, resizerStyles);
|
|
538
|
-
var isNestedNode = this.isAdjacentMode();
|
|
539
|
-
var handlePositioning = this.getHandlePositioning();
|
|
540
|
-
var maxWidth = isSSR() && size.width && fg('platform_editor_fix_image_size_diff_during_ssr') ? undefined : this.getMaxWidth();
|
|
541
|
-
var minWidth = this.calcMinWidth(isVideoFile, lineLength);
|
|
542
|
-
|
|
543
|
-
// while is not resizing, we take 100% as min-width if the container width is less than the min-width
|
|
544
|
-
var minViewWidth = isResizing ? minWidth : "min(".concat(minWidth, "px, 100%)");
|
|
545
|
-
return jsx("div", {
|
|
546
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766
|
|
547
|
-
css: wrapperStyle({
|
|
548
|
-
layout: layout,
|
|
549
|
-
containerWidth: containerWidth || origWidth,
|
|
550
|
-
fullWidthMode: fullWidthMode,
|
|
551
|
-
mediaSingleWidth: this.state.size.width,
|
|
552
|
-
isNestedNode: isNestedNode,
|
|
553
|
-
isExtendedResizeExperienceOn: true
|
|
554
|
-
})
|
|
555
|
-
}, jsx(ResizerNext, {
|
|
556
|
-
minWidth: minViewWidth,
|
|
557
|
-
maxWidth: maxWidth
|
|
558
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
559
|
-
,
|
|
560
|
-
className: resizerNextClassName,
|
|
561
|
-
snapGap: MEDIA_SINGLE_SNAP_GAP,
|
|
562
|
-
enable: enable,
|
|
563
|
-
width: size.width,
|
|
564
|
-
handleResizeStart: this.handleResizeStart,
|
|
565
|
-
handleResize: this.handleResize,
|
|
566
|
-
handleResizeStop: this.handleResizeStop,
|
|
567
|
-
snap: this.state.snaps,
|
|
568
|
-
resizeRatio: nonWrappedLayouts.includes(layout) ? 2 : 1,
|
|
569
|
-
"data-testid": resizerNextTestId,
|
|
570
|
-
isHandleVisible: selected,
|
|
571
|
-
handlePositioning: handlePositioning,
|
|
572
|
-
handleHighlight: "full-height"
|
|
573
|
-
}, children, showLegacyNotification && jsx(ResizableMediaMigrationNotification, null)));
|
|
574
|
-
}
|
|
575
|
-
}]);
|
|
576
|
-
}(React.Component);
|
|
577
29
|
var calcPxHeight = function calcPxHeight(props) {
|
|
578
30
|
var newWidth = props.newWidth,
|
|
579
31
|
previousWidth = props.previousWidth,
|
|
580
32
|
previousHeight = props.previousHeight;
|
|
581
33
|
return Math.round(previousHeight / previousWidth * newWidth);
|
|
582
34
|
};
|
|
583
|
-
var calcMinWidth = function calcMinWidth(
|
|
584
|
-
var isVideoFile =
|
|
585
|
-
contentWidth =
|
|
35
|
+
var calcMinWidth = function calcMinWidth(_ref) {
|
|
36
|
+
var isVideoFile = _ref.isVideoFile,
|
|
37
|
+
contentWidth = _ref.contentWidth;
|
|
586
38
|
return Math.min(contentWidth || akEditorDefaultLayoutWidth, isVideoFile ? MEDIA_SINGLE_VIDEO_MIN_PIXEL_WIDTH : MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH);
|
|
587
39
|
};
|
|
588
|
-
var calcMaxWidth = function calcMaxWidth(
|
|
589
|
-
var containerWidth =
|
|
590
|
-
editorAppearance =
|
|
40
|
+
var calcMaxWidth = function calcMaxWidth(_ref2) {
|
|
41
|
+
var containerWidth = _ref2.containerWidth,
|
|
42
|
+
editorAppearance = _ref2.editorAppearance;
|
|
591
43
|
return calcMediaSingleMaxWidth(containerWidth, editorAppearance);
|
|
592
44
|
};
|
|
593
|
-
var setIsResizingPluginState = function setIsResizingPluginState(
|
|
594
|
-
var isResizing =
|
|
595
|
-
nodePosition =
|
|
596
|
-
initialWidth =
|
|
45
|
+
var setIsResizingPluginState = function setIsResizingPluginState(_ref3) {
|
|
46
|
+
var isResizing = _ref3.isResizing,
|
|
47
|
+
nodePosition = _ref3.nodePosition,
|
|
48
|
+
initialWidth = _ref3.initialWidth;
|
|
597
49
|
return function (state, dispatch) {
|
|
598
50
|
var tr = state.tr;
|
|
599
51
|
tr.setMeta(MEDIA_PLUGIN_IS_RESIZING_KEY, isResizing);
|
|
@@ -634,12 +86,12 @@ var calcUnwrappedLayout = function calcUnwrappedLayout(width, containerWidth, co
|
|
|
634
86
|
// so that we have image aligned with text
|
|
635
87
|
return 'full-width';
|
|
636
88
|
};
|
|
637
|
-
var calcNewLayout = function calcNewLayout(
|
|
638
|
-
var layout =
|
|
639
|
-
containerWidth =
|
|
640
|
-
lineLength =
|
|
641
|
-
fullWidthMode =
|
|
642
|
-
isNestedNode =
|
|
89
|
+
var calcNewLayout = function calcNewLayout(_ref4) {
|
|
90
|
+
var layout = _ref4.layout,
|
|
91
|
+
containerWidth = _ref4.containerWidth,
|
|
92
|
+
lineLength = _ref4.lineLength,
|
|
93
|
+
fullWidthMode = _ref4.fullWidthMode,
|
|
94
|
+
isNestedNode = _ref4.isNestedNode;
|
|
643
95
|
return function (newWidth, stop) {
|
|
644
96
|
var newPct = calcPctFromPx(newWidth, lineLength) * 100;
|
|
645
97
|
var wrappedLayout = wrappedLayouts.indexOf(layout) > -1;
|
|
@@ -664,9 +116,9 @@ var calculateSizeState = function calculateSizeState(props) {
|
|
|
664
116
|
};
|
|
665
117
|
};
|
|
666
118
|
};
|
|
667
|
-
var getAspectRatio = function getAspectRatio(
|
|
668
|
-
var width =
|
|
669
|
-
height =
|
|
119
|
+
var getAspectRatio = function getAspectRatio(_ref5) {
|
|
120
|
+
var width = _ref5.width,
|
|
121
|
+
height = _ref5.height;
|
|
670
122
|
if (width && height > 0) {
|
|
671
123
|
return width / height;
|
|
672
124
|
}
|
|
@@ -674,9 +126,9 @@ var getAspectRatio = function getAspectRatio(_ref6) {
|
|
|
674
126
|
// TODO: ED-26962 - handle this case
|
|
675
127
|
return 1;
|
|
676
128
|
};
|
|
677
|
-
var updateSizeInPluginState = throttle(function (
|
|
678
|
-
var width =
|
|
679
|
-
view =
|
|
129
|
+
var updateSizeInPluginState = throttle(function (_ref6) {
|
|
130
|
+
var width = _ref6.width,
|
|
131
|
+
view = _ref6.view;
|
|
680
132
|
var state = view.state,
|
|
681
133
|
dispatch = view.dispatch;
|
|
682
134
|
var tr = state.tr;
|
|
@@ -825,14 +277,14 @@ export var ResizableMediaSingleNextFunctional = function ResizableMediaSingleNex
|
|
|
825
277
|
var relativeGuidesRef = useRef({});
|
|
826
278
|
var guidelinesRef = useRef([]);
|
|
827
279
|
var updateGuidelines = useCallback(function () {
|
|
828
|
-
var
|
|
280
|
+
var _generateDynamicGuide = generateDynamicGuidelines(view.state, lineLength, {
|
|
829
281
|
styles: {
|
|
830
282
|
lineStyle: 'dashed'
|
|
831
283
|
},
|
|
832
284
|
show: false
|
|
833
285
|
}),
|
|
834
|
-
relativeGuides =
|
|
835
|
-
dynamicGuides =
|
|
286
|
+
relativeGuides = _generateDynamicGuide.relativeGuides,
|
|
287
|
+
dynamicGuides = _generateDynamicGuide.dynamicGuides;
|
|
836
288
|
|
|
837
289
|
// disable guidelines for nested media single node
|
|
838
290
|
var dynamicGuidelines = isAdjacentMode ? [] : dynamicGuides;
|
|
@@ -859,11 +311,11 @@ export var ResizableMediaSingleNextFunctional = function ResizableMediaSingleNex
|
|
|
859
311
|
return [];
|
|
860
312
|
}
|
|
861
313
|
var guidelinePluginState = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$g = pluginInjectionApi.guideline) === null || _pluginInjectionApi$g === void 0 || (_pluginInjectionApi$g = _pluginInjectionApi$g.sharedState) === null || _pluginInjectionApi$g === void 0 ? void 0 : _pluginInjectionApi$g.currentState();
|
|
862
|
-
var
|
|
314
|
+
var _ref7 = (guidelinePluginState === null || guidelinePluginState === void 0 ? void 0 : guidelinePluginState.rect) || {
|
|
863
315
|
top: 0,
|
|
864
316
|
left: 0
|
|
865
317
|
},
|
|
866
|
-
topOffset =
|
|
318
|
+
topOffset = _ref7.top;
|
|
867
319
|
var $pos = view.state.doc.resolve(nodePosition);
|
|
868
320
|
var relativeGuides = $pos && $pos.nodeAfter && dimensionsRef.current.width ? getRelativeGuidelines(relativeGuidesRef.current, {
|
|
869
321
|
node: $pos.nodeAfter,
|
|
@@ -879,9 +331,9 @@ export var ResizableMediaSingleNextFunctional = function ResizableMediaSingleNex
|
|
|
879
331
|
if (!guidelineSnapsReference.snaps.x) {
|
|
880
332
|
return;
|
|
881
333
|
}
|
|
882
|
-
var
|
|
883
|
-
gap =
|
|
884
|
-
activeGuidelineKeys =
|
|
334
|
+
var _findClosestSnap = findClosestSnap(width, guidelineSnapsReference.snaps.x, guidelineSnapsReference.guidelineReference, MEDIA_SINGLE_SNAP_GAP),
|
|
335
|
+
gap = _findClosestSnap.gap,
|
|
336
|
+
activeGuidelineKeys = _findClosestSnap.keys;
|
|
885
337
|
var relativeGuidelines = activeGuidelineKeys.length ? [] : getRelativeGuides();
|
|
886
338
|
lastSnappedGuidelineKeysRef.current = activeGuidelineKeys.length ? activeGuidelineKeys : relativeGuidelines.map(function (rg) {
|
|
887
339
|
return rg.key;
|
|
@@ -1038,76 +490,38 @@ export var ResizableMediaSingleNextFunctional = function ResizableMediaSingleNex
|
|
|
1038
490
|
handleHighlight: "full-height"
|
|
1039
491
|
}, children, showLegacyNotification && jsx(ResizableMediaMigrationNotification, null)));
|
|
1040
492
|
};
|
|
1041
|
-
var ResizableMediaSingleToggle = function ResizableMediaSingleToggle(
|
|
1042
|
-
var allowBreakoutSnapPoints =
|
|
1043
|
-
children =
|
|
1044
|
-
className =
|
|
1045
|
-
containerWidth =
|
|
1046
|
-
dataAttributes =
|
|
1047
|
-
disableHandles =
|
|
1048
|
-
dispatchAnalyticsEvent =
|
|
1049
|
-
editorAppearance =
|
|
1050
|
-
fullWidthMode =
|
|
1051
|
-
getPos =
|
|
1052
|
-
gridSize =
|
|
1053
|
-
handleMediaSingleRef =
|
|
1054
|
-
hasFallbackContainer =
|
|
1055
|
-
height =
|
|
1056
|
-
isInsideOfInlineExtension =
|
|
1057
|
-
isLoading =
|
|
1058
|
-
layout =
|
|
1059
|
-
lineLength =
|
|
1060
|
-
mediaSingleWidth =
|
|
1061
|
-
nodeType =
|
|
1062
|
-
pctWidth =
|
|
1063
|
-
pluginInjectionApi =
|
|
1064
|
-
selected =
|
|
1065
|
-
showLegacyNotification =
|
|
1066
|
-
size =
|
|
1067
|
-
updateSize =
|
|
1068
|
-
view =
|
|
1069
|
-
viewMediaClientConfig =
|
|
1070
|
-
width =
|
|
1071
|
-
forceHandlePositioning =
|
|
1072
|
-
|
|
1073
|
-
return jsx(ResizableMediaSingleNextFunctional, {
|
|
1074
|
-
allowBreakoutSnapPoints: allowBreakoutSnapPoints
|
|
1075
|
-
// eslint-disable-next-line react/no-children-prop
|
|
1076
|
-
,
|
|
1077
|
-
children: children
|
|
1078
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
1079
|
-
,
|
|
1080
|
-
className: className,
|
|
1081
|
-
containerWidth: containerWidth,
|
|
1082
|
-
dataAttributes: dataAttributes,
|
|
1083
|
-
disableHandles: disableHandles,
|
|
1084
|
-
dispatchAnalyticsEvent: dispatchAnalyticsEvent,
|
|
1085
|
-
editorAppearance: editorAppearance,
|
|
1086
|
-
fullWidthMode: fullWidthMode,
|
|
1087
|
-
getPos: getPos,
|
|
1088
|
-
gridSize: gridSize,
|
|
1089
|
-
handleMediaSingleRef: handleMediaSingleRef,
|
|
1090
|
-
hasFallbackContainer: hasFallbackContainer,
|
|
1091
|
-
height: height,
|
|
1092
|
-
isInsideOfInlineExtension: isInsideOfInlineExtension,
|
|
1093
|
-
isLoading: isLoading,
|
|
1094
|
-
layout: layout,
|
|
1095
|
-
lineLength: lineLength,
|
|
1096
|
-
mediaSingleWidth: mediaSingleWidth,
|
|
1097
|
-
nodeType: nodeType,
|
|
1098
|
-
pctWidth: pctWidth,
|
|
1099
|
-
pluginInjectionApi: pluginInjectionApi,
|
|
1100
|
-
selected: selected,
|
|
1101
|
-
showLegacyNotification: showLegacyNotification,
|
|
1102
|
-
size: size,
|
|
1103
|
-
updateSize: updateSize,
|
|
1104
|
-
view: view,
|
|
1105
|
-
viewMediaClientConfig: viewMediaClientConfig,
|
|
1106
|
-
width: width,
|
|
1107
|
-
forceHandlePositioning: forceHandlePositioning
|
|
1108
|
-
});
|
|
1109
|
-
}
|
|
1110
|
-
return jsx(ResizableMediaSingleNext, {
|
|
493
|
+
var ResizableMediaSingleToggle = function ResizableMediaSingleToggle(_ref8) {
|
|
494
|
+
var allowBreakoutSnapPoints = _ref8.allowBreakoutSnapPoints,
|
|
495
|
+
children = _ref8.children,
|
|
496
|
+
className = _ref8.className,
|
|
497
|
+
containerWidth = _ref8.containerWidth,
|
|
498
|
+
dataAttributes = _ref8.dataAttributes,
|
|
499
|
+
disableHandles = _ref8.disableHandles,
|
|
500
|
+
dispatchAnalyticsEvent = _ref8.dispatchAnalyticsEvent,
|
|
501
|
+
editorAppearance = _ref8.editorAppearance,
|
|
502
|
+
fullWidthMode = _ref8.fullWidthMode,
|
|
503
|
+
getPos = _ref8.getPos,
|
|
504
|
+
gridSize = _ref8.gridSize,
|
|
505
|
+
handleMediaSingleRef = _ref8.handleMediaSingleRef,
|
|
506
|
+
hasFallbackContainer = _ref8.hasFallbackContainer,
|
|
507
|
+
height = _ref8.height,
|
|
508
|
+
isInsideOfInlineExtension = _ref8.isInsideOfInlineExtension,
|
|
509
|
+
isLoading = _ref8.isLoading,
|
|
510
|
+
layout = _ref8.layout,
|
|
511
|
+
lineLength = _ref8.lineLength,
|
|
512
|
+
mediaSingleWidth = _ref8.mediaSingleWidth,
|
|
513
|
+
nodeType = _ref8.nodeType,
|
|
514
|
+
pctWidth = _ref8.pctWidth,
|
|
515
|
+
pluginInjectionApi = _ref8.pluginInjectionApi,
|
|
516
|
+
selected = _ref8.selected,
|
|
517
|
+
showLegacyNotification = _ref8.showLegacyNotification,
|
|
518
|
+
size = _ref8.size,
|
|
519
|
+
updateSize = _ref8.updateSize,
|
|
520
|
+
view = _ref8.view,
|
|
521
|
+
viewMediaClientConfig = _ref8.viewMediaClientConfig,
|
|
522
|
+
width = _ref8.width,
|
|
523
|
+
forceHandlePositioning = _ref8.forceHandlePositioning;
|
|
524
|
+
return jsx(ResizableMediaSingleNextFunctional, {
|
|
1111
525
|
allowBreakoutSnapPoints: allowBreakoutSnapPoints
|
|
1112
526
|
// eslint-disable-next-line react/no-children-prop
|
|
1113
527
|
,
|