@atlaskit/editor-common 88.11.0 → 88.12.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 +26 -0
- package/afm-post-office/tsconfig.json +3 -0
- package/dist/cjs/analytics/types/enums.js +1 -0
- package/dist/cjs/insert/index.js +27 -1
- package/dist/cjs/media-single/CommentBadgeNext.js +61 -0
- package/dist/cjs/media-single/ExternalImageBadge.js +5 -48
- package/dist/cjs/media-single/MediaBadges.js +76 -0
- package/dist/cjs/media-single/index.js +15 -1
- package/dist/cjs/messages/insert-block.js +10 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/MediaSingle/styled.js +1 -1
- package/dist/es2019/analytics/types/enums.js +1 -0
- package/dist/es2019/insert/index.js +30 -1
- package/dist/es2019/media-single/CommentBadgeNext.js +51 -0
- package/dist/es2019/media-single/ExternalImageBadge.js +5 -40
- package/dist/es2019/media-single/MediaBadges.js +63 -0
- package/dist/es2019/media-single/index.js +3 -1
- package/dist/es2019/messages/insert-block.js +10 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/MediaSingle/styled.js +2 -1
- package/dist/esm/analytics/types/enums.js +1 -0
- package/dist/esm/insert/index.js +27 -1
- package/dist/esm/media-single/CommentBadgeNext.js +51 -0
- package/dist/esm/media-single/ExternalImageBadge.js +5 -45
- package/dist/esm/media-single/MediaBadges.js +66 -0
- package/dist/esm/media-single/index.js +3 -1
- package/dist/esm/messages/insert-block.js +10 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/MediaSingle/styled.js +1 -1
- package/dist/types/analytics/types/enums.d.ts +1 -0
- package/dist/types/card/types.d.ts +2 -2
- package/dist/types/media-single/CommentBadgeNext.d.ts +11 -0
- package/dist/types/media-single/ExternalImageBadge.d.ts +2 -5
- package/dist/types/media-single/MediaBadges.d.ts +12 -0
- package/dist/types/media-single/index.d.ts +2 -0
- package/dist/types/messages/insert-block.d.ts +10 -0
- package/dist/types-ts4.5/analytics/types/enums.d.ts +1 -0
- package/dist/types-ts4.5/card/types.d.ts +2 -2
- package/dist/types-ts4.5/media-single/CommentBadgeNext.d.ts +11 -0
- package/dist/types-ts4.5/media-single/ExternalImageBadge.d.ts +2 -5
- package/dist/types-ts4.5/media-single/MediaBadges.d.ts +12 -0
- package/dist/types-ts4.5/media-single/index.d.ts +2 -0
- package/dist/types-ts4.5/messages/insert-block.d.ts +10 -0
- package/package.json +2 -2
|
@@ -10,6 +10,11 @@ export const toolbarInsertBlockMessages = defineMessages({
|
|
|
10
10
|
defaultMessage: 'Create and assign action items',
|
|
11
11
|
description: ''
|
|
12
12
|
},
|
|
13
|
+
closeInsertRightRail: {
|
|
14
|
+
id: 'fabric.editor.insertRightRail.close',
|
|
15
|
+
defaultMessage: 'Close',
|
|
16
|
+
description: 'Close button label'
|
|
17
|
+
},
|
|
13
18
|
link: {
|
|
14
19
|
id: 'fabric.editor.link',
|
|
15
20
|
defaultMessage: 'Link',
|
|
@@ -30,6 +35,11 @@ export const toolbarInsertBlockMessages = defineMessages({
|
|
|
30
35
|
defaultMessage: 'Add image, video, or file',
|
|
31
36
|
description: 'Insert one or more files, videos or images'
|
|
32
37
|
},
|
|
38
|
+
insertRightRailTitle: {
|
|
39
|
+
id: 'fabric.editor.insertRightRail.title',
|
|
40
|
+
defaultMessage: 'Insert',
|
|
41
|
+
description: 'Insert a node into the document'
|
|
42
|
+
},
|
|
33
43
|
insertMediaFromUrl: {
|
|
34
44
|
id: 'fabric.editor.insertMediaFromUrl',
|
|
35
45
|
defaultMessage: 'Image from link',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isFedRamp } from './environment';
|
|
2
2
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
3
3
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
4
|
-
const packageVersion = "88.
|
|
4
|
+
const packageVersion = "88.12.1";
|
|
5
5
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
6
6
|
// Remove URL as it has UGC
|
|
7
7
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "88.
|
|
17
|
+
const packageVersion = "88.12.1";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
class DropList extends Component {
|
|
@@ -249,7 +249,8 @@ export const mediaWrapperStyle = props => css`
|
|
|
249
249
|
|
|
250
250
|
// Comments on media project adds comment badge as child of the media wrapper,
|
|
251
251
|
// thus we need to exclude it so that style is applied to intended div
|
|
252
|
-
|
|
252
|
+
// remove [data-comment-badge='true'] when ff platform_editor_insert_media_plugin_phase_one is cleaned up
|
|
253
|
+
& > div:not([data-comment-badge='true'], [data-media-badges='true']) {
|
|
253
254
|
position: ${props.hasFallbackContainer ? 'absolute' : 'relative'};
|
|
254
255
|
height: 100%;
|
|
255
256
|
width: 100%;
|
|
@@ -163,6 +163,7 @@ export var INPUT_METHOD = /*#__PURE__*/function (INPUT_METHOD) {
|
|
|
163
163
|
INPUT_METHOD["FLOATING_TB"] = "floatingToolbar";
|
|
164
164
|
INPUT_METHOD["FORMATTING"] = "autoformatting";
|
|
165
165
|
INPUT_METHOD["INSERT_MENU"] = "insertMenu";
|
|
166
|
+
INPUT_METHOD["INSERT_MENU_RIGHT_RAIL"] = "insertMenuRightRail";
|
|
166
167
|
INPUT_METHOD["KEYBOARD"] = "keyboard";
|
|
167
168
|
INPUT_METHOD["MEDIA_PICKER"] = "mediaPicker";
|
|
168
169
|
INPUT_METHOD["MACRO_BROWSER"] = "macroBrowser";
|
package/dist/esm/insert/index.js
CHANGED
|
@@ -237,6 +237,20 @@ export var insertSelectedItem = function insertSelectedItem(maybeNode) {
|
|
|
237
237
|
*/
|
|
238
238
|
} else if (node instanceof Node && node.isInline || isInputFragment) {
|
|
239
239
|
var fragment = isInputFragment ? node : Fragment.fromArray([node, state.schema.text(' ')]);
|
|
240
|
+
|
|
241
|
+
// For platform_editor_element_level_templates experiment only
|
|
242
|
+
// clean up ticket ED-24873
|
|
243
|
+
// @ts-ignore
|
|
244
|
+
if (opts.isTemplate) {
|
|
245
|
+
return insertTemplateFragment({
|
|
246
|
+
fragment: fragment,
|
|
247
|
+
tr: tr,
|
|
248
|
+
position: {
|
|
249
|
+
start: start,
|
|
250
|
+
end: start
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
}
|
|
240
254
|
tr = tr.replaceWith(start, start, fragment);
|
|
241
255
|
if (opts.selectInlineNode) {
|
|
242
256
|
// Select inserted node
|
|
@@ -282,4 +296,16 @@ export function contentAllowedInCodeBlock(state) {
|
|
|
282
296
|
return isAllowedChild = node.type === state.schema.nodes.listItem || node.type === state.schema.nodes.bulletList || node.type === state.schema.nodes.orderedList || node.type === state.schema.nodes.paragraph || node.isInline || node.type === state.schema.nodes.panel || node.isText;
|
|
283
297
|
});
|
|
284
298
|
return isAllowedChild;
|
|
285
|
-
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// For platform_editor_element_level_templates experiment only
|
|
302
|
+
// clean up ticket ED-24873
|
|
303
|
+
var insertTemplateFragment = function insertTemplateFragment(_ref3) {
|
|
304
|
+
var fragment = _ref3.fragment,
|
|
305
|
+
tr = _ref3.tr,
|
|
306
|
+
position = _ref3.position;
|
|
307
|
+
var start = position.start;
|
|
308
|
+
var trWithInsert = pmSafeInsert(fragment, start)(tr);
|
|
309
|
+
tr.setSelection(trWithInsert.selection);
|
|
310
|
+
return tr;
|
|
311
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl-next';
|
|
3
|
+
import CommentIcon from '@atlaskit/icon/glyph/comment';
|
|
4
|
+
import { Pressable, xcss } from '@atlaskit/primitives';
|
|
5
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
6
|
+
import { commentMessages as messages } from '../media';
|
|
7
|
+
var baseStyles = xcss({
|
|
8
|
+
borderRadius: 'border.radius'
|
|
9
|
+
});
|
|
10
|
+
var smallBadgeStyles = xcss({
|
|
11
|
+
height: 'space.200',
|
|
12
|
+
width: 'space.200'
|
|
13
|
+
});
|
|
14
|
+
var mediumBadgeStyles = xcss({
|
|
15
|
+
height: 'space.300',
|
|
16
|
+
width: 'space.300'
|
|
17
|
+
});
|
|
18
|
+
export var CommentBadgeNext = function CommentBadgeNext(_ref) {
|
|
19
|
+
var _ref$status = _ref.status,
|
|
20
|
+
status = _ref$status === void 0 ? 'default' : _ref$status,
|
|
21
|
+
onClick = _ref.onClick,
|
|
22
|
+
onMouseEnter = _ref.onMouseEnter,
|
|
23
|
+
onMouseLeave = _ref.onMouseLeave,
|
|
24
|
+
badgeSize = _ref.badgeSize;
|
|
25
|
+
var intl = useIntl();
|
|
26
|
+
var title = intl.formatMessage(messages.viewCommentsOnMedia);
|
|
27
|
+
var colourToken = useMemo(function () {
|
|
28
|
+
switch (status) {
|
|
29
|
+
case 'active':
|
|
30
|
+
return 'color.background.accent.yellow.subtlest.pressed';
|
|
31
|
+
case 'entered':
|
|
32
|
+
return 'color.background.accent.yellow.subtlest.hovered';
|
|
33
|
+
default:
|
|
34
|
+
return 'color.background.accent.yellow.subtlest';
|
|
35
|
+
}
|
|
36
|
+
}, [status]);
|
|
37
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
38
|
+
position: "top",
|
|
39
|
+
content: title
|
|
40
|
+
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
41
|
+
xcss: [baseStyles, badgeSize === 'medium' ? mediumBadgeStyles : smallBadgeStyles],
|
|
42
|
+
padding: "space.0",
|
|
43
|
+
onClick: onClick,
|
|
44
|
+
onMouseEnter: onMouseEnter,
|
|
45
|
+
onMouseLeave: onMouseLeave,
|
|
46
|
+
backgroundColor: colourToken
|
|
47
|
+
}, /*#__PURE__*/React.createElement(CommentIcon, {
|
|
48
|
+
label: title,
|
|
49
|
+
size: badgeSize
|
|
50
|
+
})));
|
|
51
|
+
};
|
|
@@ -1,66 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import React, { useEffect, useState } from 'react';
|
|
3
|
-
import debounce from 'lodash/debounce';
|
|
1
|
+
import React from 'react';
|
|
4
2
|
import { useIntl } from 'react-intl-next';
|
|
5
3
|
import InfoIcon from '@atlaskit/icon/glyph/info';
|
|
6
4
|
import { Box, xcss } from '@atlaskit/primitives';
|
|
7
5
|
import Tooltip from '@atlaskit/tooltip';
|
|
8
6
|
import { externalMediaMessages } from '../media';
|
|
9
|
-
import { getBadgeSize } from './CommentBadge';
|
|
10
7
|
var baseStyles = xcss({
|
|
11
|
-
position: 'absolute',
|
|
12
|
-
top: 'space.025',
|
|
13
8
|
borderRadius: 'border.radius',
|
|
14
9
|
backgroundColor: 'elevation.surface',
|
|
15
|
-
zIndex: 'tooltip',
|
|
16
10
|
lineHeight: "var(--ds-space-200, 16px)",
|
|
17
|
-
right: 'var(--right-offset)',
|
|
18
11
|
cursor: 'pointer'
|
|
19
12
|
});
|
|
20
13
|
export var ExternalImageBadge = function ExternalImageBadge(_ref) {
|
|
21
|
-
var
|
|
22
|
-
mediaHeight = _ref.mediaHeight,
|
|
23
|
-
_ref$commentBadgeRigh = _ref.commentBadgeRightOffset,
|
|
24
|
-
commentBadgeRightOffset = _ref$commentBadgeRigh === void 0 ? 0 : _ref$commentBadgeRigh,
|
|
25
|
-
mediaElement = _ref.mediaElement;
|
|
14
|
+
var badgeSize = _ref.badgeSize;
|
|
26
15
|
var intl = useIntl();
|
|
27
16
|
var message = intl.formatMessage(externalMediaMessages.externalMediaFile);
|
|
28
|
-
|
|
29
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
30
|
-
badgeSize = _useState2[0],
|
|
31
|
-
setBadgeSize = _useState2[1];
|
|
32
|
-
// detect resize of media element to adjust badge size
|
|
33
|
-
// will combine with the comment badge resize observer when refactoring in the future to avoid multiple resize observers
|
|
34
|
-
useEffect(function () {
|
|
35
|
-
var observer = new ResizeObserver(debounce(function (entries) {
|
|
36
|
-
var _entries = _slicedToArray(entries, 1),
|
|
37
|
-
entry = _entries[0];
|
|
38
|
-
var _entry$contentRect = entry.contentRect,
|
|
39
|
-
width = _entry$contentRect.width,
|
|
40
|
-
height = _entry$contentRect.height;
|
|
41
|
-
setBadgeSize(getBadgeSize(width, height));
|
|
42
|
-
}));
|
|
43
|
-
if (mediaElement) {
|
|
44
|
-
observer.observe(mediaElement);
|
|
45
|
-
}
|
|
46
|
-
return function () {
|
|
47
|
-
observer.disconnect();
|
|
48
|
-
};
|
|
49
|
-
}, [mediaElement]);
|
|
50
|
-
var baseRightOffset = badgeSize === 'medium' ? 4 : 2;
|
|
51
|
-
var rightOffset = baseRightOffset + commentBadgeRightOffset;
|
|
52
|
-
return /*#__PURE__*/React.createElement(Box
|
|
53
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
54
|
-
, {
|
|
55
|
-
style: {
|
|
56
|
-
'--right-offset': "".concat(rightOffset, "px")
|
|
57
|
-
},
|
|
17
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
58
18
|
padding: badgeSize === 'medium' ? 'space.050' : 'space.0',
|
|
59
|
-
"data-external-image-badge": "true",
|
|
60
19
|
xcss: baseStyles,
|
|
61
20
|
tabIndex: 0
|
|
62
21
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
63
|
-
content: message
|
|
22
|
+
content: message,
|
|
23
|
+
position: "top"
|
|
64
24
|
}, /*#__PURE__*/React.createElement(InfoIcon, {
|
|
65
25
|
size: "small",
|
|
66
26
|
label: message
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import React, { useEffect, useState } from 'react';
|
|
3
|
+
import debounce from 'lodash/debounce';
|
|
4
|
+
import { Box, xcss } from '@atlaskit/primitives';
|
|
5
|
+
var containerStyles = xcss({
|
|
6
|
+
display: 'flex',
|
|
7
|
+
position: 'absolute',
|
|
8
|
+
top: 'space.0',
|
|
9
|
+
right: 'space.0',
|
|
10
|
+
lineHeight: "var(--ds-space-200, 16px)",
|
|
11
|
+
gap: 'space.025',
|
|
12
|
+
zIndex: 'card',
|
|
13
|
+
height: 'fit-content',
|
|
14
|
+
width: 'fit-content',
|
|
15
|
+
margin: 'space.075'
|
|
16
|
+
});
|
|
17
|
+
var resizeOffsetStyles = xcss({
|
|
18
|
+
right: 'space.150'
|
|
19
|
+
});
|
|
20
|
+
var smallBadgeStyles = xcss({
|
|
21
|
+
margin: 'space.025'
|
|
22
|
+
});
|
|
23
|
+
var getBadgeSize = function getBadgeSize(width, height) {
|
|
24
|
+
// width is the original width of image, not resized or currently rendered to user. Defaulting to medium for now
|
|
25
|
+
return width && width < 70 || height && height < 70 ? 'small' : 'medium';
|
|
26
|
+
};
|
|
27
|
+
export var MediaBadges = function MediaBadges(_ref) {
|
|
28
|
+
var children = _ref.children,
|
|
29
|
+
mediaElement = _ref.mediaElement,
|
|
30
|
+
mediaWidth = _ref.mediaWidth,
|
|
31
|
+
mediaHeight = _ref.mediaHeight,
|
|
32
|
+
extendedResizeOffset = _ref.extendedResizeOffset;
|
|
33
|
+
var _useState = useState(getBadgeSize(mediaWidth, mediaHeight)),
|
|
34
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
35
|
+
badgeSize = _useState2[0],
|
|
36
|
+
setBadgeSize = _useState2[1];
|
|
37
|
+
useEffect(function () {
|
|
38
|
+
var observer = new ResizeObserver(debounce(function (entries) {
|
|
39
|
+
var _entries = _slicedToArray(entries, 1),
|
|
40
|
+
entry = _entries[0];
|
|
41
|
+
var _entry$contentRect = entry.contentRect,
|
|
42
|
+
width = _entry$contentRect.width,
|
|
43
|
+
height = _entry$contentRect.height;
|
|
44
|
+
setBadgeSize(getBadgeSize(width, height));
|
|
45
|
+
}));
|
|
46
|
+
if (mediaElement) {
|
|
47
|
+
observer.observe(mediaElement);
|
|
48
|
+
}
|
|
49
|
+
return function () {
|
|
50
|
+
observer.disconnect();
|
|
51
|
+
};
|
|
52
|
+
}, [mediaElement]);
|
|
53
|
+
if (typeof children === 'function') {
|
|
54
|
+
children = children({
|
|
55
|
+
badgeSize: badgeSize
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (!mediaElement || React.Children.count(children) === 0) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
62
|
+
testId: "media-badges",
|
|
63
|
+
"data-media-badges": "true",
|
|
64
|
+
xcss: [containerStyles, extendedResizeOffset && resizeOffsetStyles, badgeSize === 'small' && smallBadgeStyles]
|
|
65
|
+
}, children);
|
|
66
|
+
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH, MEDIA_SINGLE_VIDEO_MIN_PIXEL_WIDTH, MEDIA_SINGLE_SNAP_GAP, MEDIA_SINGLE_HIGHLIGHT_GAP, MEDIA_SINGLE_GUTTER_SIZE, MEDIA_SINGLE_RESIZE_THROTTLE_TIME, Layout as MediaSingleLayout, DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT, wrappedLayouts, CAPTION_PLACEHOLDER_ID } from './constants';
|
|
2
2
|
export { getMediaSinglePixelWidth, calcMediaSinglePixelWidth, calcMediaSingleMaxWidth, getMediaSingleInitialWidth, calculateOffsetLeft, roundToNearest, calcMinWidth, getMaxWidthForNestedNode, getMaxWidthForNestedNodeNext, currentMediaNodeWithPos } from './utils';
|
|
3
3
|
export { CommentBadge } from './CommentBadge';
|
|
4
|
-
export {
|
|
4
|
+
export { CommentBadgeNext } from './CommentBadgeNext';
|
|
5
|
+
export { ExternalImageBadge } from './ExternalImageBadge';
|
|
6
|
+
export { MediaBadges } from './MediaBadges';
|
|
@@ -10,6 +10,11 @@ export var toolbarInsertBlockMessages = defineMessages({
|
|
|
10
10
|
defaultMessage: 'Create and assign action items',
|
|
11
11
|
description: ''
|
|
12
12
|
},
|
|
13
|
+
closeInsertRightRail: {
|
|
14
|
+
id: 'fabric.editor.insertRightRail.close',
|
|
15
|
+
defaultMessage: 'Close',
|
|
16
|
+
description: 'Close button label'
|
|
17
|
+
},
|
|
13
18
|
link: {
|
|
14
19
|
id: 'fabric.editor.link',
|
|
15
20
|
defaultMessage: 'Link',
|
|
@@ -30,6 +35,11 @@ export var toolbarInsertBlockMessages = defineMessages({
|
|
|
30
35
|
defaultMessage: 'Add image, video, or file',
|
|
31
36
|
description: 'Insert one or more files, videos or images'
|
|
32
37
|
},
|
|
38
|
+
insertRightRailTitle: {
|
|
39
|
+
id: 'fabric.editor.insertRightRail.title',
|
|
40
|
+
defaultMessage: 'Insert',
|
|
41
|
+
description: 'Insert a node into the document'
|
|
42
|
+
},
|
|
33
43
|
insertMediaFromUrl: {
|
|
34
44
|
id: 'fabric.editor.insertMediaFromUrl',
|
|
35
45
|
defaultMessage: 'Image from link',
|
|
@@ -7,7 +7,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
7
7
|
import { isFedRamp } from './environment';
|
|
8
8
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
9
9
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
10
|
-
var packageVersion = "88.
|
|
10
|
+
var packageVersion = "88.12.1";
|
|
11
11
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
12
12
|
// Remove URL as it has UGC
|
|
13
13
|
// TODO: Sanitise the URL instead of just removing it
|
|
@@ -22,7 +22,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
22
22
|
import { N0, N50A, N60A, N900 } from '@atlaskit/theme/colors';
|
|
23
23
|
import Layer from '../Layer';
|
|
24
24
|
var packageName = "@atlaskit/editor-common";
|
|
25
|
-
var packageVersion = "88.
|
|
25
|
+
var packageVersion = "88.12.1";
|
|
26
26
|
var halfFocusRing = 1;
|
|
27
27
|
var dropOffset = '0, 8';
|
|
28
28
|
var DropList = /*#__PURE__*/function (_Component) {
|
|
@@ -201,7 +201,7 @@ var RenderFallbackContainer = function RenderFallbackContainer(_ref2) {
|
|
|
201
201
|
|
|
202
202
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Needs manual remediation
|
|
203
203
|
export var mediaWrapperStyle = function mediaWrapperStyle(props) {
|
|
204
|
-
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\tposition: relative;\n\n\t", "\n\n\t/* Editor */\n & > figure {\n\t\tposition: ", ";\n\t\theight: 100%;\n\t\twidth: 100%;\n\t}\n\n\t// Comments on media project adds comment badge as child of the media wrapper,\n\t// thus we need to exclude it so that style is applied to intended div\n\t& > div:not([data-comment-badge='true'], [data-
|
|
204
|
+
return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n\tposition: relative;\n\n\t", "\n\n\t/* Editor */\n & > figure {\n\t\tposition: ", ";\n\t\theight: 100%;\n\t\twidth: 100%;\n\t}\n\n\t// Comments on media project adds comment badge as child of the media wrapper,\n\t// thus we need to exclude it so that style is applied to intended div\n\t// remove [data-comment-badge='true'] when ff platform_editor_insert_media_plugin_phase_one is cleaned up\n\t& > div:not([data-comment-badge='true'], [data-media-badges='true']) {\n\t\tposition: ", ";\n\t\theight: 100%;\n\t\twidth: 100%;\n\t}\n\n\t& * [data-mark-annotation-type='inlineComment'] {\n\t\twidth: 100%;\n\t\theight: 100%;\n\t}\n\n\t&[data-node-type='embedCard'] > div {\n\t\twidth: 100%;\n\t}\n\n\t/* Renderer */\n\t[data-node-type='media'] {\n\t\tposition: static !important;\n\n\t\t> div {\n\t\t\tposition: absolute;\n\t\t\theight: 100%;\n\t\t}\n\t}\n"])), RenderFallbackContainer(props), props.hasFallbackContainer ? 'absolute' : 'relative', props.hasFallbackContainer ? 'absolute' : 'relative');
|
|
205
205
|
};
|
|
206
206
|
export var MediaWrapper = function MediaWrapper(_ref3) {
|
|
207
207
|
var children = _ref3.children,
|
|
@@ -169,6 +169,7 @@ export declare enum INPUT_METHOD {
|
|
|
169
169
|
FLOATING_TB = "floatingToolbar",
|
|
170
170
|
FORMATTING = "autoformatting",
|
|
171
171
|
INSERT_MENU = "insertMenu",
|
|
172
|
+
INSERT_MENU_RIGHT_RAIL = "insertMenuRightRail",
|
|
172
173
|
KEYBOARD = "keyboard",
|
|
173
174
|
MEDIA_PICKER = "mediaPicker",
|
|
174
175
|
MACRO_BROWSER = "macroBrowser",
|
|
@@ -3,7 +3,7 @@ import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
|
3
3
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import type { ACTION, EditorAnalyticsAPI, INPUT_METHOD } from '../analytics';
|
|
6
|
-
import { type CardAppearance, type CardProvider
|
|
6
|
+
import { type CardAppearance, type CardProvider } from '../provider-factory';
|
|
7
7
|
import type { Command, FloatingToolbarItem } from '../types';
|
|
8
8
|
export interface OptionConfig {
|
|
9
9
|
appearance?: CardAppearance;
|
|
@@ -20,7 +20,7 @@ export type QueueCardsFromTransactionAction = (state: EditorState, tr: Transacti
|
|
|
20
20
|
export type HideLinkToolbarAction = (tr: Transaction) => Transaction;
|
|
21
21
|
export type ChangeSelectedCardToLink = (text?: string, href?: string, sendAnalytics?: boolean, node?: Node, pos?: number, editorAnalyticsApi?: EditorAnalyticsAPI) => Command;
|
|
22
22
|
export type SetSelectedCardAppearance = (appearance: CardAppearance, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
23
|
-
export type GetStartingToolbarItems = (intl: IntlShape, link: string,
|
|
23
|
+
export type GetStartingToolbarItems = (intl: IntlShape, link: string, onEditLink: Command, metadata: {
|
|
24
24
|
url: string;
|
|
25
25
|
title: string;
|
|
26
26
|
}) => FloatingToolbarItem<Command>[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type CommentBadgeProps = {
|
|
3
|
+
status?: 'default' | 'entered' | 'active';
|
|
4
|
+
mediaSingleElement?: HTMLElement | null;
|
|
5
|
+
onClick: (e: React.MouseEvent) => void;
|
|
6
|
+
onMouseEnter?: (e: React.MouseEvent) => void;
|
|
7
|
+
onMouseLeave?: (e: React.MouseEvent) => void;
|
|
8
|
+
badgeSize: 'small' | 'medium';
|
|
9
|
+
};
|
|
10
|
+
export declare const CommentBadgeNext: ({ status, onClick, onMouseEnter, onMouseLeave, badgeSize, }: CommentBadgeProps) => JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
type ExternalImageBadgeProps = {
|
|
3
|
-
|
|
4
|
-
commentBadgeRightOffset?: number;
|
|
5
|
-
mediaHeight?: number;
|
|
6
|
-
mediaWidth?: number;
|
|
3
|
+
badgeSize: 'medium' | 'small';
|
|
7
4
|
};
|
|
8
|
-
export declare const ExternalImageBadge: ({
|
|
5
|
+
export declare const ExternalImageBadge: ({ badgeSize }: ExternalImageBadgeProps) => JSX.Element;
|
|
9
6
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
type ExternalImageBadgeProps = {
|
|
3
|
+
mediaElement?: HTMLElement | null;
|
|
4
|
+
mediaHeight?: number;
|
|
5
|
+
mediaWidth?: number;
|
|
6
|
+
extendedResizeOffset?: boolean;
|
|
7
|
+
children: ReactNode | ((props: {
|
|
8
|
+
badgeSize: 'medium' | 'small';
|
|
9
|
+
}) => ReactNode);
|
|
10
|
+
};
|
|
11
|
+
export declare const MediaBadges: ({ children, mediaElement, mediaWidth, mediaHeight, extendedResizeOffset, }: ExternalImageBadgeProps) => JSX.Element | null;
|
|
12
|
+
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH, MEDIA_SINGLE_VIDEO_MIN_PIXEL_WIDTH, MEDIA_SINGLE_SNAP_GAP, MEDIA_SINGLE_HIGHLIGHT_GAP, MEDIA_SINGLE_GUTTER_SIZE, MEDIA_SINGLE_RESIZE_THROTTLE_TIME, Layout as MediaSingleLayout, DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT, wrappedLayouts, CAPTION_PLACEHOLDER_ID, } from './constants';
|
|
2
2
|
export { getMediaSinglePixelWidth, calcMediaSinglePixelWidth, calcMediaSingleMaxWidth, getMediaSingleInitialWidth, calculateOffsetLeft, roundToNearest, calcMinWidth, getMaxWidthForNestedNode, getMaxWidthForNestedNodeNext, currentMediaNodeWithPos, } from './utils';
|
|
3
3
|
export { CommentBadge } from './CommentBadge';
|
|
4
|
+
export { CommentBadgeNext } from './CommentBadgeNext';
|
|
4
5
|
export { ExternalImageBadge } from './ExternalImageBadge';
|
|
6
|
+
export { MediaBadges } from './MediaBadges';
|
|
5
7
|
export type { CommentBadgeProps } from './CommentBadge';
|
|
@@ -9,6 +9,11 @@ export declare const toolbarInsertBlockMessages: {
|
|
|
9
9
|
defaultMessage: string;
|
|
10
10
|
description: string;
|
|
11
11
|
};
|
|
12
|
+
closeInsertRightRail: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
12
17
|
link: {
|
|
13
18
|
id: string;
|
|
14
19
|
defaultMessage: string;
|
|
@@ -29,6 +34,11 @@ export declare const toolbarInsertBlockMessages: {
|
|
|
29
34
|
defaultMessage: string;
|
|
30
35
|
description: string;
|
|
31
36
|
};
|
|
37
|
+
insertRightRailTitle: {
|
|
38
|
+
id: string;
|
|
39
|
+
defaultMessage: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
32
42
|
insertMediaFromUrl: {
|
|
33
43
|
id: string;
|
|
34
44
|
defaultMessage: string;
|
|
@@ -169,6 +169,7 @@ export declare enum INPUT_METHOD {
|
|
|
169
169
|
FLOATING_TB = "floatingToolbar",
|
|
170
170
|
FORMATTING = "autoformatting",
|
|
171
171
|
INSERT_MENU = "insertMenu",
|
|
172
|
+
INSERT_MENU_RIGHT_RAIL = "insertMenuRightRail",
|
|
172
173
|
KEYBOARD = "keyboard",
|
|
173
174
|
MEDIA_PICKER = "mediaPicker",
|
|
174
175
|
MACRO_BROWSER = "macroBrowser",
|
|
@@ -3,7 +3,7 @@ import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
|
3
3
|
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import type { ACTION, EditorAnalyticsAPI, INPUT_METHOD } from '../analytics';
|
|
6
|
-
import { type CardAppearance, type CardProvider
|
|
6
|
+
import { type CardAppearance, type CardProvider } from '../provider-factory';
|
|
7
7
|
import type { Command, FloatingToolbarItem } from '../types';
|
|
8
8
|
export interface OptionConfig {
|
|
9
9
|
appearance?: CardAppearance;
|
|
@@ -20,7 +20,7 @@ export type QueueCardsFromTransactionAction = (state: EditorState, tr: Transacti
|
|
|
20
20
|
export type HideLinkToolbarAction = (tr: Transaction) => Transaction;
|
|
21
21
|
export type ChangeSelectedCardToLink = (text?: string, href?: string, sendAnalytics?: boolean, node?: Node, pos?: number, editorAnalyticsApi?: EditorAnalyticsAPI) => Command;
|
|
22
22
|
export type SetSelectedCardAppearance = (appearance: CardAppearance, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
23
|
-
export type GetStartingToolbarItems = (intl: IntlShape, link: string,
|
|
23
|
+
export type GetStartingToolbarItems = (intl: IntlShape, link: string, onEditLink: Command, metadata: {
|
|
24
24
|
url: string;
|
|
25
25
|
title: string;
|
|
26
26
|
}) => FloatingToolbarItem<Command>[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type CommentBadgeProps = {
|
|
3
|
+
status?: 'default' | 'entered' | 'active';
|
|
4
|
+
mediaSingleElement?: HTMLElement | null;
|
|
5
|
+
onClick: (e: React.MouseEvent) => void;
|
|
6
|
+
onMouseEnter?: (e: React.MouseEvent) => void;
|
|
7
|
+
onMouseLeave?: (e: React.MouseEvent) => void;
|
|
8
|
+
badgeSize: 'small' | 'medium';
|
|
9
|
+
};
|
|
10
|
+
export declare const CommentBadgeNext: ({ status, onClick, onMouseEnter, onMouseLeave, badgeSize, }: CommentBadgeProps) => JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
type ExternalImageBadgeProps = {
|
|
3
|
-
|
|
4
|
-
commentBadgeRightOffset?: number;
|
|
5
|
-
mediaHeight?: number;
|
|
6
|
-
mediaWidth?: number;
|
|
3
|
+
badgeSize: 'medium' | 'small';
|
|
7
4
|
};
|
|
8
|
-
export declare const ExternalImageBadge: ({
|
|
5
|
+
export declare const ExternalImageBadge: ({ badgeSize }: ExternalImageBadgeProps) => JSX.Element;
|
|
9
6
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
type ExternalImageBadgeProps = {
|
|
3
|
+
mediaElement?: HTMLElement | null;
|
|
4
|
+
mediaHeight?: number;
|
|
5
|
+
mediaWidth?: number;
|
|
6
|
+
extendedResizeOffset?: boolean;
|
|
7
|
+
children: ReactNode | ((props: {
|
|
8
|
+
badgeSize: 'medium' | 'small';
|
|
9
|
+
}) => ReactNode);
|
|
10
|
+
};
|
|
11
|
+
export declare const MediaBadges: ({ children, mediaElement, mediaWidth, mediaHeight, extendedResizeOffset, }: ExternalImageBadgeProps) => JSX.Element | null;
|
|
12
|
+
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { MEDIA_SINGLE_DEFAULT_MIN_PIXEL_WIDTH, MEDIA_SINGLE_VIDEO_MIN_PIXEL_WIDTH, MEDIA_SINGLE_SNAP_GAP, MEDIA_SINGLE_HIGHLIGHT_GAP, MEDIA_SINGLE_GUTTER_SIZE, MEDIA_SINGLE_RESIZE_THROTTLE_TIME, Layout as MediaSingleLayout, DEFAULT_IMAGE_WIDTH, DEFAULT_IMAGE_HEIGHT, wrappedLayouts, CAPTION_PLACEHOLDER_ID, } from './constants';
|
|
2
2
|
export { getMediaSinglePixelWidth, calcMediaSinglePixelWidth, calcMediaSingleMaxWidth, getMediaSingleInitialWidth, calculateOffsetLeft, roundToNearest, calcMinWidth, getMaxWidthForNestedNode, getMaxWidthForNestedNodeNext, currentMediaNodeWithPos, } from './utils';
|
|
3
3
|
export { CommentBadge } from './CommentBadge';
|
|
4
|
+
export { CommentBadgeNext } from './CommentBadgeNext';
|
|
4
5
|
export { ExternalImageBadge } from './ExternalImageBadge';
|
|
6
|
+
export { MediaBadges } from './MediaBadges';
|
|
5
7
|
export type { CommentBadgeProps } from './CommentBadge';
|
|
@@ -9,6 +9,11 @@ export declare const toolbarInsertBlockMessages: {
|
|
|
9
9
|
defaultMessage: string;
|
|
10
10
|
description: string;
|
|
11
11
|
};
|
|
12
|
+
closeInsertRightRail: {
|
|
13
|
+
id: string;
|
|
14
|
+
defaultMessage: string;
|
|
15
|
+
description: string;
|
|
16
|
+
};
|
|
12
17
|
link: {
|
|
13
18
|
id: string;
|
|
14
19
|
defaultMessage: string;
|
|
@@ -29,6 +34,11 @@ export declare const toolbarInsertBlockMessages: {
|
|
|
29
34
|
defaultMessage: string;
|
|
30
35
|
description: string;
|
|
31
36
|
};
|
|
37
|
+
insertRightRailTitle: {
|
|
38
|
+
id: string;
|
|
39
|
+
defaultMessage: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
32
42
|
insertMediaFromUrl: {
|
|
33
43
|
id: string;
|
|
34
44
|
defaultMessage: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "88.
|
|
3
|
+
"version": "88.12.1",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
"@atlaskit/primitives": "^12.1.0",
|
|
141
141
|
"@atlaskit/profilecard": "^19.26.0",
|
|
142
142
|
"@atlaskit/section-message": "^6.6.0",
|
|
143
|
-
"@atlaskit/smart-card": "^
|
|
143
|
+
"@atlaskit/smart-card": "^28.0.0",
|
|
144
144
|
"@atlaskit/smart-user-picker": "^6.10.0",
|
|
145
145
|
"@atlaskit/spinner": "^16.3.0",
|
|
146
146
|
"@atlaskit/task-decision": "^17.10.0",
|