@atlaskit/editor-core 187.30.7 → 187.30.8
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 +8 -0
- package/dist/cjs/plugins/media/toolbar/index.js +5 -15
- package/dist/cjs/plugins/media/toolbar/utils.js +10 -2
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +3 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/media/toolbar/index.js +7 -16
- package/dist/es2019/plugins/media/toolbar/utils.js +7 -0
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +1 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/media/toolbar/index.js +7 -17
- package/dist/esm/plugins/media/toolbar/utils.js +7 -0
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +3 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/media/toolbar/utils.d.ts +2 -0
- package/dist/types-ts4.5/plugins/media/toolbar/utils.d.ts +2 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 187.30.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`04a2b9f4cfe`](https://bitbucket.org/atlassian/atlassian-frontend/commits/04a2b9f4cfe) - fix convert pixels in nested table when media single node does not have width
|
|
8
|
+
- [`edeab2d50b2`](https://bitbucket.org/atlassian/atlassian-frontend/commits/edeab2d50b2) - Fix analytics event for image resizing and relative snaps
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 187.30.7
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -268,7 +268,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
268
268
|
type: 'custom',
|
|
269
269
|
fallback: [],
|
|
270
270
|
render: function render(editorView) {
|
|
271
|
-
var _widthPlugin$sharedSt2
|
|
271
|
+
var _widthPlugin$sharedSt2;
|
|
272
272
|
if (!editorView) {
|
|
273
273
|
return null;
|
|
274
274
|
}
|
|
@@ -279,15 +279,11 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
279
279
|
return null;
|
|
280
280
|
}
|
|
281
281
|
var contentWidth = (widthPlugin === null || widthPlugin === void 0 ? void 0 : (_widthPlugin$sharedSt2 = widthPlugin.sharedState.currentState()) === null || _widthPlugin$sharedSt2 === void 0 ? void 0 : _widthPlugin$sharedSt2.lineLength) || _editorSharedStyles.akEditorDefaultLayoutWidth;
|
|
282
|
-
var containerWidth = (widthPlugin === null || widthPlugin === void 0 ? void 0 : (_widthPlugin$sharedSt3 = widthPlugin.sharedState.currentState()) === null || _widthPlugin$sharedSt3 === void 0 ? void 0 : _widthPlugin$sharedSt3.width) || _editorSharedStyles.akEditorFullWidthLayoutWidth;
|
|
283
282
|
var selectedMediaNode = selectedMediaSingleNode.node.content.firstChild;
|
|
284
283
|
if (!selectedMediaNode) {
|
|
285
284
|
return null;
|
|
286
285
|
}
|
|
287
|
-
var
|
|
288
|
-
singleMediaWidth = _selectedMediaSingleN.width,
|
|
289
|
-
widthType = _selectedMediaSingleN.widthType,
|
|
290
|
-
layout = _selectedMediaSingleN.layout;
|
|
286
|
+
var widthType = selectedMediaSingleNode.node.attrs.widthType;
|
|
291
287
|
var _selectedMediaNode$at = selectedMediaNode.attrs,
|
|
292
288
|
mediaWidth = _selectedMediaNode$at.width,
|
|
293
289
|
mediaHeight = _selectedMediaNode$at.height;
|
|
@@ -296,15 +292,9 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
296
292
|
var isVideoFile = (0, _mediaSingle.isVideo)(selectedMediaNode.attrs.__fileMimeType);
|
|
297
293
|
var minWidth = (0, _mediaSingle2.calcMinWidth)(isVideoFile, maxWidthForNestedNode || contentWidth);
|
|
298
294
|
var isLegacy = widthType !== 'pixel';
|
|
299
|
-
var pixelWidth = (0,
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
origWidth: mediaWidth || _mediaSingle2.DEFAULT_IMAGE_WIDTH,
|
|
303
|
-
layout: layout,
|
|
304
|
-
contentWidth: (0, _mediaSingle2.getMaxWidthForNestedNode)(editorView, selectedMediaSingleNode.pos) || contentWidth,
|
|
305
|
-
containerWidth: containerWidth,
|
|
306
|
-
gutterOffset: _mediaSingle2.MEDIA_SINGLE_GUTTER_SIZE
|
|
307
|
-
});
|
|
295
|
+
var pixelWidth = (0, _utils2.getPixelWidthOfElement)(editorView, selectedMediaSingleNode.pos + 1,
|
|
296
|
+
// get pos of media node
|
|
297
|
+
mediaWidth || _mediaSingle2.DEFAULT_IMAGE_WIDTH);
|
|
308
298
|
return /*#__PURE__*/_react.default.createElement(_PixelEntry.PixelEntry, {
|
|
309
299
|
intl: intl,
|
|
310
300
|
width: pluginState.isResizing ? pluginState.resizingWidth : pixelWidth,
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.removeMediaGroupNode = exports.getSelectedMediaSingle = exports.getSelectedMediaContainerNodeAttrs = exports.downloadMedia = void 0;
|
|
7
|
+
exports.removeMediaGroupNode = exports.getSelectedMediaSingle = exports.getSelectedMediaContainerNodeAttrs = exports.getPixelWidthOfElement = exports.downloadMedia = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _mediaClient = require("@atlaskit/media-client");
|
|
@@ -73,4 +73,12 @@ var getSelectedMediaSingle = function getSelectedMediaSingle(state) {
|
|
|
73
73
|
var mediaSingle = state.schema.nodes.mediaSingle;
|
|
74
74
|
return (0, _utils.findSelectedNodeOfType)(mediaSingle)(state.selection) || (0, _utils.findParentNodeOfType)(mediaSingle)(state.selection);
|
|
75
75
|
};
|
|
76
|
-
exports.getSelectedMediaSingle = getSelectedMediaSingle;
|
|
76
|
+
exports.getSelectedMediaSingle = getSelectedMediaSingle;
|
|
77
|
+
var getPixelWidthOfElement = function getPixelWidthOfElement(editorView, pos, mediaWidth) {
|
|
78
|
+
var domNode = editorView.nodeDOM(pos);
|
|
79
|
+
if (domNode instanceof HTMLElement) {
|
|
80
|
+
return domNode.offsetWidth;
|
|
81
|
+
}
|
|
82
|
+
return mediaWidth;
|
|
83
|
+
};
|
|
84
|
+
exports.getPixelWidthOfElement = getPixelWidthOfElement;
|
|
@@ -185,8 +185,10 @@ var ResizableMediaSingleNext = /*#__PURE__*/function (_React$Component) {
|
|
|
185
185
|
var _findClosestSnap = (0, _guideline.findClosestSnap)(width, guidelineSnapsReference.snaps.x, guidelineSnapsReference.guidelineReference, _mediaSingle.MEDIA_SINGLE_SNAP_GAP),
|
|
186
186
|
gap = _findClosestSnap.gap,
|
|
187
187
|
activeGuidelineKeys = _findClosestSnap.keys;
|
|
188
|
-
_this.lastSnappedGuidelineKeys = activeGuidelineKeys;
|
|
189
188
|
var relativeGuidelines = activeGuidelineKeys.length ? [] : _this.getRelativeGuides();
|
|
189
|
+
_this.lastSnappedGuidelineKeys = activeGuidelineKeys.length ? activeGuidelineKeys : relativeGuidelines.map(function (rg) {
|
|
190
|
+
return rg.key;
|
|
191
|
+
});
|
|
190
192
|
_this.displayGuideline([].concat((0, _toConsumableArray2.default)((0, _guideline.getGuidelinesWithHighlights)(gap, _mediaSingle.MEDIA_SINGLE_SNAP_GAP, activeGuidelineKeys, guidelines)), (0, _toConsumableArray2.default)(relativeGuidelines)));
|
|
191
193
|
}
|
|
192
194
|
});
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "187.30.
|
|
9
|
+
var version = "187.30.8";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
var nextMajorVersion = function nextMajorVersion() {
|
|
12
12
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
@@ -18,7 +18,7 @@ import { messages } from '@atlaskit/media-ui';
|
|
|
18
18
|
import { cardMessages } from '@atlaskit/editor-common/messages';
|
|
19
19
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
20
20
|
import { FilePreviewItem } from './filePreviewItem';
|
|
21
|
-
import { downloadMedia, getSelectedMediaSingle, removeMediaGroupNode } from './utils';
|
|
21
|
+
import { downloadMedia, getSelectedMediaSingle, removeMediaGroupNode, getPixelWidthOfElement } from './utils';
|
|
22
22
|
import { isVideo } from '../utils/media-single';
|
|
23
23
|
import { changeInlineToMediaCard, changeMediaCardToInline, removeInlineCard, setBorderMark, toggleBorderMark } from './commands';
|
|
24
24
|
import { MediaInlineNodeSelector, MediaSingleNodeSelector } from '../nodeviews/styles';
|
|
@@ -26,7 +26,7 @@ import ImageBorderItem from '../ui/ImageBorder';
|
|
|
26
26
|
import { currentMediaNodeBorderMark } from '../utils/current-media-node';
|
|
27
27
|
import { shouldShowImageBorder } from './imageBorder';
|
|
28
28
|
import { PixelEntry } from '../ui/PixelEntry';
|
|
29
|
-
import { DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT,
|
|
29
|
+
import { DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT, calcMinWidth, getMaxWidthForNestedNodeNext } from '@atlaskit/editor-common/media-single';
|
|
30
30
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
31
31
|
const remove = (state, dispatch) => {
|
|
32
32
|
if (dispatch) {
|
|
@@ -270,7 +270,7 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
270
270
|
type: 'custom',
|
|
271
271
|
fallback: [],
|
|
272
272
|
render: editorView => {
|
|
273
|
-
var _widthPlugin$sharedSt2
|
|
273
|
+
var _widthPlugin$sharedSt2;
|
|
274
274
|
if (!editorView) {
|
|
275
275
|
return null;
|
|
276
276
|
}
|
|
@@ -283,15 +283,12 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
283
283
|
return null;
|
|
284
284
|
}
|
|
285
285
|
const contentWidth = (widthPlugin === null || widthPlugin === void 0 ? void 0 : (_widthPlugin$sharedSt2 = widthPlugin.sharedState.currentState()) === null || _widthPlugin$sharedSt2 === void 0 ? void 0 : _widthPlugin$sharedSt2.lineLength) || akEditorDefaultLayoutWidth;
|
|
286
|
-
const containerWidth = (widthPlugin === null || widthPlugin === void 0 ? void 0 : (_widthPlugin$sharedSt3 = widthPlugin.sharedState.currentState()) === null || _widthPlugin$sharedSt3 === void 0 ? void 0 : _widthPlugin$sharedSt3.width) || akEditorFullWidthLayoutWidth;
|
|
287
286
|
const selectedMediaNode = selectedMediaSingleNode.node.content.firstChild;
|
|
288
287
|
if (!selectedMediaNode) {
|
|
289
288
|
return null;
|
|
290
289
|
}
|
|
291
290
|
const {
|
|
292
|
-
|
|
293
|
-
widthType,
|
|
294
|
-
layout
|
|
291
|
+
widthType
|
|
295
292
|
} = selectedMediaSingleNode.node.attrs;
|
|
296
293
|
const {
|
|
297
294
|
width: mediaWidth,
|
|
@@ -302,15 +299,9 @@ const generateMediaSingleFloatingToolbar = (state, intl, options, pluginState, m
|
|
|
302
299
|
const isVideoFile = isVideo(selectedMediaNode.attrs.__fileMimeType);
|
|
303
300
|
const minWidth = calcMinWidth(isVideoFile, maxWidthForNestedNode || contentWidth);
|
|
304
301
|
const isLegacy = widthType !== 'pixel';
|
|
305
|
-
const pixelWidth =
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
origWidth: mediaWidth || DEFAULT_IMAGE_WIDTH,
|
|
309
|
-
layout,
|
|
310
|
-
contentWidth: getMaxWidthForNestedNode(editorView, selectedMediaSingleNode.pos) || contentWidth,
|
|
311
|
-
containerWidth,
|
|
312
|
-
gutterOffset: MEDIA_SINGLE_GUTTER_SIZE
|
|
313
|
-
});
|
|
302
|
+
const pixelWidth = getPixelWidthOfElement(editorView, selectedMediaSingleNode.pos + 1,
|
|
303
|
+
// get pos of media node
|
|
304
|
+
mediaWidth || DEFAULT_IMAGE_WIDTH);
|
|
314
305
|
return /*#__PURE__*/React.createElement(PixelEntry, {
|
|
315
306
|
intl: intl,
|
|
316
307
|
width: pluginState.isResizing ? pluginState.resizingWidth : pixelWidth,
|
|
@@ -46,4 +46,11 @@ export const getSelectedMediaSingle = state => {
|
|
|
46
46
|
mediaSingle
|
|
47
47
|
} = state.schema.nodes;
|
|
48
48
|
return findSelectedNodeOfType(mediaSingle)(state.selection) || findParentNodeOfType(mediaSingle)(state.selection);
|
|
49
|
+
};
|
|
50
|
+
export const getPixelWidthOfElement = (editorView, pos, mediaWidth) => {
|
|
51
|
+
const domNode = editorView.nodeDOM(pos);
|
|
52
|
+
if (domNode instanceof HTMLElement) {
|
|
53
|
+
return domNode.offsetWidth;
|
|
54
|
+
}
|
|
55
|
+
return mediaWidth;
|
|
49
56
|
};
|
|
@@ -167,8 +167,8 @@ class ResizableMediaSingleNext extends React.Component {
|
|
|
167
167
|
gap,
|
|
168
168
|
keys: activeGuidelineKeys
|
|
169
169
|
} = findClosestSnap(width, guidelineSnapsReference.snaps.x, guidelineSnapsReference.guidelineReference, MEDIA_SINGLE_SNAP_GAP);
|
|
170
|
-
this.lastSnappedGuidelineKeys = activeGuidelineKeys;
|
|
171
170
|
const relativeGuidelines = activeGuidelineKeys.length ? [] : this.getRelativeGuides();
|
|
171
|
+
this.lastSnappedGuidelineKeys = activeGuidelineKeys.length ? activeGuidelineKeys : relativeGuidelines.map(rg => rg.key);
|
|
172
172
|
this.displayGuideline([...getGuidelinesWithHighlights(gap, MEDIA_SINGLE_SNAP_GAP, activeGuidelineKeys, guidelines), ...relativeGuidelines]);
|
|
173
173
|
}
|
|
174
174
|
});
|
|
@@ -22,7 +22,7 @@ import { messages } from '@atlaskit/media-ui';
|
|
|
22
22
|
import { cardMessages } from '@atlaskit/editor-common/messages';
|
|
23
23
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
24
24
|
import { FilePreviewItem } from './filePreviewItem';
|
|
25
|
-
import { downloadMedia, getSelectedMediaSingle, removeMediaGroupNode } from './utils';
|
|
25
|
+
import { downloadMedia, getSelectedMediaSingle, removeMediaGroupNode, getPixelWidthOfElement } from './utils';
|
|
26
26
|
import { isVideo } from '../utils/media-single';
|
|
27
27
|
import { changeInlineToMediaCard, changeMediaCardToInline, removeInlineCard, setBorderMark, toggleBorderMark } from './commands';
|
|
28
28
|
import { MediaInlineNodeSelector, MediaSingleNodeSelector } from '../nodeviews/styles';
|
|
@@ -30,7 +30,7 @@ import ImageBorderItem from '../ui/ImageBorder';
|
|
|
30
30
|
import { currentMediaNodeBorderMark } from '../utils/current-media-node';
|
|
31
31
|
import { shouldShowImageBorder } from './imageBorder';
|
|
32
32
|
import { PixelEntry } from '../ui/PixelEntry';
|
|
33
|
-
import { DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT,
|
|
33
|
+
import { DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT, calcMinWidth, getMaxWidthForNestedNodeNext } from '@atlaskit/editor-common/media-single';
|
|
34
34
|
import { akEditorDefaultLayoutWidth, akEditorFullWidthLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
35
35
|
var remove = function remove(state, dispatch) {
|
|
36
36
|
if (dispatch) {
|
|
@@ -261,7 +261,7 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
261
261
|
type: 'custom',
|
|
262
262
|
fallback: [],
|
|
263
263
|
render: function render(editorView) {
|
|
264
|
-
var _widthPlugin$sharedSt2
|
|
264
|
+
var _widthPlugin$sharedSt2;
|
|
265
265
|
if (!editorView) {
|
|
266
266
|
return null;
|
|
267
267
|
}
|
|
@@ -272,15 +272,11 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
272
272
|
return null;
|
|
273
273
|
}
|
|
274
274
|
var contentWidth = (widthPlugin === null || widthPlugin === void 0 ? void 0 : (_widthPlugin$sharedSt2 = widthPlugin.sharedState.currentState()) === null || _widthPlugin$sharedSt2 === void 0 ? void 0 : _widthPlugin$sharedSt2.lineLength) || akEditorDefaultLayoutWidth;
|
|
275
|
-
var containerWidth = (widthPlugin === null || widthPlugin === void 0 ? void 0 : (_widthPlugin$sharedSt3 = widthPlugin.sharedState.currentState()) === null || _widthPlugin$sharedSt3 === void 0 ? void 0 : _widthPlugin$sharedSt3.width) || akEditorFullWidthLayoutWidth;
|
|
276
275
|
var selectedMediaNode = selectedMediaSingleNode.node.content.firstChild;
|
|
277
276
|
if (!selectedMediaNode) {
|
|
278
277
|
return null;
|
|
279
278
|
}
|
|
280
|
-
var
|
|
281
|
-
singleMediaWidth = _selectedMediaSingleN.width,
|
|
282
|
-
widthType = _selectedMediaSingleN.widthType,
|
|
283
|
-
layout = _selectedMediaSingleN.layout;
|
|
279
|
+
var widthType = selectedMediaSingleNode.node.attrs.widthType;
|
|
284
280
|
var _selectedMediaNode$at = selectedMediaNode.attrs,
|
|
285
281
|
mediaWidth = _selectedMediaNode$at.width,
|
|
286
282
|
mediaHeight = _selectedMediaNode$at.height;
|
|
@@ -289,15 +285,9 @@ var generateMediaSingleFloatingToolbar = function generateMediaSingleFloatingToo
|
|
|
289
285
|
var isVideoFile = isVideo(selectedMediaNode.attrs.__fileMimeType);
|
|
290
286
|
var minWidth = calcMinWidth(isVideoFile, maxWidthForNestedNode || contentWidth);
|
|
291
287
|
var isLegacy = widthType !== 'pixel';
|
|
292
|
-
var pixelWidth =
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
origWidth: mediaWidth || DEFAULT_IMAGE_WIDTH,
|
|
296
|
-
layout: layout,
|
|
297
|
-
contentWidth: getMaxWidthForNestedNode(editorView, selectedMediaSingleNode.pos) || contentWidth,
|
|
298
|
-
containerWidth: containerWidth,
|
|
299
|
-
gutterOffset: MEDIA_SINGLE_GUTTER_SIZE
|
|
300
|
-
});
|
|
288
|
+
var pixelWidth = getPixelWidthOfElement(editorView, selectedMediaSingleNode.pos + 1,
|
|
289
|
+
// get pos of media node
|
|
290
|
+
mediaWidth || DEFAULT_IMAGE_WIDTH);
|
|
301
291
|
return /*#__PURE__*/React.createElement(PixelEntry, {
|
|
302
292
|
intl: intl,
|
|
303
293
|
width: pluginState.isResizing ? pluginState.resizingWidth : pixelWidth,
|
|
@@ -62,4 +62,11 @@ export var removeMediaGroupNode = function removeMediaGroupNode(state) {
|
|
|
62
62
|
export var getSelectedMediaSingle = function getSelectedMediaSingle(state) {
|
|
63
63
|
var mediaSingle = state.schema.nodes.mediaSingle;
|
|
64
64
|
return findSelectedNodeOfType(mediaSingle)(state.selection) || findParentNodeOfType(mediaSingle)(state.selection);
|
|
65
|
+
};
|
|
66
|
+
export var getPixelWidthOfElement = function getPixelWidthOfElement(editorView, pos, mediaWidth) {
|
|
67
|
+
var domNode = editorView.nodeDOM(pos);
|
|
68
|
+
if (domNode instanceof HTMLElement) {
|
|
69
|
+
return domNode.offsetWidth;
|
|
70
|
+
}
|
|
71
|
+
return mediaWidth;
|
|
65
72
|
};
|
|
@@ -178,8 +178,10 @@ var ResizableMediaSingleNext = /*#__PURE__*/function (_React$Component) {
|
|
|
178
178
|
var _findClosestSnap = findClosestSnap(width, guidelineSnapsReference.snaps.x, guidelineSnapsReference.guidelineReference, MEDIA_SINGLE_SNAP_GAP),
|
|
179
179
|
gap = _findClosestSnap.gap,
|
|
180
180
|
activeGuidelineKeys = _findClosestSnap.keys;
|
|
181
|
-
_this.lastSnappedGuidelineKeys = activeGuidelineKeys;
|
|
182
181
|
var relativeGuidelines = activeGuidelineKeys.length ? [] : _this.getRelativeGuides();
|
|
182
|
+
_this.lastSnappedGuidelineKeys = activeGuidelineKeys.length ? activeGuidelineKeys : relativeGuidelines.map(function (rg) {
|
|
183
|
+
return rg.key;
|
|
184
|
+
});
|
|
183
185
|
_this.displayGuideline([].concat(_toConsumableArray(getGuidelinesWithHighlights(gap, MEDIA_SINGLE_SNAP_GAP, activeGuidelineKeys, guidelines)), _toConsumableArray(relativeGuidelines)));
|
|
184
186
|
}
|
|
185
187
|
});
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { MediaBaseAttributes } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { MediaPluginState } from '../pm-plugins/types';
|
|
4
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
5
|
export declare const getSelectedMediaContainerNodeAttrs: (mediaPluginState: MediaPluginState) => MediaBaseAttributes | null;
|
|
5
6
|
export declare const downloadMedia: (mediaPluginState: MediaPluginState) => Promise<boolean>;
|
|
6
7
|
export declare const removeMediaGroupNode: (state: EditorState) => import("prosemirror-state").Transaction;
|
|
7
8
|
export declare const getSelectedMediaSingle: (state: EditorState) => import("prosemirror-utils/dist/types").FindResult;
|
|
9
|
+
export declare const getPixelWidthOfElement: (editorView: EditorView, pos: number, mediaWidth: number) => number;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { MediaBaseAttributes } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
3
|
import type { MediaPluginState } from '../pm-plugins/types';
|
|
4
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
5
|
export declare const getSelectedMediaContainerNodeAttrs: (mediaPluginState: MediaPluginState) => MediaBaseAttributes | null;
|
|
5
6
|
export declare const downloadMedia: (mediaPluginState: MediaPluginState) => Promise<boolean>;
|
|
6
7
|
export declare const removeMediaGroupNode: (state: EditorState) => import("prosemirror-state").Transaction;
|
|
7
8
|
export declare const getSelectedMediaSingle: (state: EditorState) => import("prosemirror-utils/dist/types").FindResult;
|
|
9
|
+
export declare const getPixelWidthOfElement: (editorView: EditorView, pos: number, mediaWidth: number) => number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "187.30.
|
|
3
|
+
"version": "187.30.8",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"@atlaskit/radio": "^5.6.0",
|
|
105
105
|
"@atlaskit/section-message": "^6.4.0",
|
|
106
106
|
"@atlaskit/select": "^16.5.0",
|
|
107
|
-
"@atlaskit/smart-card": "^26.
|
|
107
|
+
"@atlaskit/smart-card": "^26.16.0",
|
|
108
108
|
"@atlaskit/smart-user-picker": "^6.3.0",
|
|
109
109
|
"@atlaskit/spinner": "^15.5.0",
|
|
110
110
|
"@atlaskit/status": "^1.3.0",
|