@atlaskit/editor-common 111.6.3 → 111.7.2
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 +27 -0
- package/dist/cjs/floating-toolbar/DropdownMenuItem.js +0 -2
- package/dist/cjs/keymaps/index.js +2 -1
- package/dist/cjs/link/ConfigureLinkOverlay/Dropdown.js +2 -5
- package/dist/cjs/link/ConfigureLinkOverlay/index.js +0 -1
- package/dist/cjs/media-inline/views/error-view.js +1 -5
- package/dist/cjs/media-single/ExternalImageBadge.js +0 -1
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/styles/shared/resizer.js +1 -4
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Messages/index.js +0 -3
- package/dist/cjs/ui/Toolbar/ExpandIcon.js +0 -1
- package/dist/cjs/ui/UnsupportedBlock/index.js +1 -2
- package/dist/cjs/ui/UnsupportedInline/index.js +1 -2
- package/dist/cjs/ui-color/ColorPalette/Color/index.js +0 -3
- package/dist/cjs/utils/imageLoader.js +4 -131
- package/dist/es2019/floating-toolbar/DropdownMenuItem.js +0 -2
- package/dist/es2019/keymaps/index.js +1 -0
- package/dist/es2019/link/ConfigureLinkOverlay/Dropdown.js +2 -5
- package/dist/es2019/link/ConfigureLinkOverlay/index.js +0 -1
- package/dist/es2019/media-inline/views/error-view.js +1 -4
- package/dist/es2019/media-single/ExternalImageBadge.js +0 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/styles/shared/resizer.js +1 -4
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Messages/index.js +0 -3
- package/dist/es2019/ui/Toolbar/ExpandIcon.js +0 -1
- package/dist/es2019/ui/UnsupportedBlock/index.js +1 -2
- package/dist/es2019/ui/UnsupportedInline/index.js +1 -2
- package/dist/es2019/ui-color/ColorPalette/Color/index.js +0 -2
- package/dist/es2019/utils/imageLoader.js +1 -111
- package/dist/esm/floating-toolbar/DropdownMenuItem.js +0 -2
- package/dist/esm/keymaps/index.js +1 -0
- package/dist/esm/link/ConfigureLinkOverlay/Dropdown.js +2 -5
- package/dist/esm/link/ConfigureLinkOverlay/index.js +0 -1
- package/dist/esm/media-inline/views/error-view.js +1 -5
- package/dist/esm/media-single/ExternalImageBadge.js +0 -1
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/styles/shared/resizer.js +1 -4
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Messages/index.js +0 -3
- package/dist/esm/ui/Toolbar/ExpandIcon.js +0 -1
- package/dist/esm/ui/UnsupportedBlock/index.js +1 -2
- package/dist/esm/ui/UnsupportedInline/index.js +1 -2
- package/dist/esm/ui-color/ColorPalette/Color/index.js +0 -3
- package/dist/esm/utils/imageLoader.js +3 -130
- package/dist/types/keymaps/index.d.ts +1 -0
- package/dist/types/media-inline/views/error-view.d.ts +1 -3
- package/dist/types/utils/imageLoader.d.ts +0 -1
- package/dist/types-ts4.5/keymaps/index.d.ts +1 -0
- package/dist/types-ts4.5/media-inline/views/error-view.d.ts +1 -3
- package/dist/types-ts4.5/utils/imageLoader.d.ts +0 -1
- package/package.json +11 -11
|
@@ -1,114 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
import React, { Component } from 'react';
|
|
4
|
-
export const
|
|
5
|
-
constructor(...args) {
|
|
6
|
-
super(...args);
|
|
7
|
-
_defineProperty(this, "state", {
|
|
8
|
-
imageStatus: 'loading'
|
|
9
|
-
});
|
|
10
|
-
_defineProperty(this, "onLoad", () => {
|
|
11
|
-
this.setState({
|
|
12
|
-
imageStatus: 'complete'
|
|
13
|
-
});
|
|
14
|
-
const {
|
|
15
|
-
onExternalImageLoaded
|
|
16
|
-
} = this.props;
|
|
17
|
-
if (onExternalImageLoaded && this.img) {
|
|
18
|
-
onExternalImageLoaded({
|
|
19
|
-
width: this.img.naturalWidth,
|
|
20
|
-
height: this.img.naturalHeight
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
_defineProperty(this, "onError", () => {
|
|
25
|
-
this.setState({
|
|
26
|
-
imageStatus: 'error'
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
*/
|
|
34
|
-
componentDidMount() {
|
|
35
|
-
this.fetchImage(this.props);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
*
|
|
40
|
-
* @param nextProps
|
|
41
|
-
* @example
|
|
42
|
-
*/
|
|
43
|
-
// Ignored via go/ees005
|
|
44
|
-
// eslint-disable-next-line react/no-unsafe
|
|
45
|
-
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
46
|
-
if (nextProps.url !== this.props.url) {
|
|
47
|
-
this.setState({
|
|
48
|
-
imageStatus: 'loading'
|
|
49
|
-
});
|
|
50
|
-
this.fetchImage(nextProps);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
*/
|
|
58
|
-
componentWillUnmount() {
|
|
59
|
-
if (this.img) {
|
|
60
|
-
if (!process.env.REACT_SSR) {
|
|
61
|
-
// Ignored via go/ees005
|
|
62
|
-
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
63
|
-
this.img.removeEventListener('load', this.onLoad);
|
|
64
|
-
// Ignored via go/ees005
|
|
65
|
-
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
66
|
-
this.img.removeEventListener('error', this.onError);
|
|
67
|
-
this.img = null;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
*
|
|
74
|
-
* @param root0
|
|
75
|
-
* @param root0.url
|
|
76
|
-
* @example
|
|
77
|
-
*/
|
|
78
|
-
fetchImage({
|
|
79
|
-
url
|
|
80
|
-
}) {
|
|
81
|
-
if (url) {
|
|
82
|
-
if (!this.img) {
|
|
83
|
-
this.img = new Image();
|
|
84
|
-
if (!process.env.REACT_SSR) {
|
|
85
|
-
// Ignored via go/ees005
|
|
86
|
-
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
87
|
-
this.img.addEventListener('load', this.onLoad);
|
|
88
|
-
// Ignored via go/ees005
|
|
89
|
-
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
90
|
-
this.img.addEventListener('error', this.onError);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
this.img.src = url;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
*
|
|
98
|
-
* @example
|
|
99
|
-
*/
|
|
100
|
-
render() {
|
|
101
|
-
const {
|
|
102
|
-
imageStatus
|
|
103
|
-
} = this.state;
|
|
104
|
-
// Ignored via go/ees005
|
|
105
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
106
|
-
return /*#__PURE__*/React.createElement(Wrapped, _extends({}, this.props, {
|
|
107
|
-
imageStatus: imageStatus
|
|
108
|
-
}));
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
const withImageLoaderNew = Wrapped => class WithImageLoader extends Component {
|
|
4
|
+
export const withImageLoader = Wrapped => class WithImageLoader extends Component {
|
|
112
5
|
constructor(...args) {
|
|
113
6
|
super(...args);
|
|
114
7
|
_defineProperty(this, "state", {
|
|
@@ -186,7 +79,4 @@ const withImageLoaderNew = Wrapped => class WithImageLoader extends Component {
|
|
|
186
79
|
imageStatus: imageStatus
|
|
187
80
|
}));
|
|
188
81
|
}
|
|
189
|
-
};
|
|
190
|
-
export const withImageLoader = Wrapped => {
|
|
191
|
-
return withImageLoaderNew(Wrapped);
|
|
192
82
|
};
|
|
@@ -38,8 +38,6 @@ var SelectedIconBefore = function SelectedIconBefore(_ref) {
|
|
|
38
38
|
return jsx("span", {
|
|
39
39
|
"aria-hidden": "true"
|
|
40
40
|
}, jsx(EditorDoneIcon, {
|
|
41
|
-
LEGACY_primaryColor: "var(--ds-icon-selected, #1868DB)",
|
|
42
|
-
LEGACY_size: "small",
|
|
43
41
|
label: intl.formatMessage(messages.confirmModalOK),
|
|
44
42
|
spacing: "none"
|
|
45
43
|
}));
|
|
@@ -12,6 +12,7 @@ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
|
12
12
|
import { editorCommandToPMCommand } from '../preset/editor-commands';
|
|
13
13
|
import { browser as browserLegacy, getBrowserInfo } from '../utils/browser';
|
|
14
14
|
export var addAltText = makeKeyMapWithCommon('Add Alt Text', 'Mod-Alt-y');
|
|
15
|
+
export var toggleViewChanges = makeKeyMapWithCommon('View changes', 'Mod-Alt-z');
|
|
15
16
|
export var navToEditorToolbar = makeKeyMapWithCommon('Navigate to editor toolbar', 'Alt-F9');
|
|
16
17
|
export var navToFloatingToolbar = makeKeyMapWithCommon('Navigate to floating toolbar', 'Alt-F10');
|
|
17
18
|
export var askAIQuickInsert = makeKeyMapWithCommon('Ask AI', "Mod-'");
|
|
@@ -74,7 +74,6 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
74
74
|
}, props, {
|
|
75
75
|
iconBefore: jsx(ChevronDownIcon, {
|
|
76
76
|
label: configureLinkLabel,
|
|
77
|
-
LEGACY_size: "small",
|
|
78
77
|
size: "small"
|
|
79
78
|
}),
|
|
80
79
|
onClick: function onClick(e) {
|
|
@@ -87,15 +86,13 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
87
86
|
onOpenChange: onOpenChange
|
|
88
87
|
}, jsx(DropdownItemGroup, null, jsx(DropdownItem, {
|
|
89
88
|
elemBefore: jsx(LinkExternalIcon, {
|
|
90
|
-
label: goToLinkLabel
|
|
91
|
-
LEGACY_size: "medium"
|
|
89
|
+
label: goToLinkLabel
|
|
92
90
|
}),
|
|
93
91
|
testId: "".concat(testId, "-dropdown-item-open-link"),
|
|
94
92
|
onClick: onGoToLinkClick
|
|
95
93
|
}, goToLinkLabel), jsx(DropdownItem, {
|
|
96
94
|
elemBefore: jsx(PreferencesIcon, {
|
|
97
|
-
label: configureLinkLabel
|
|
98
|
-
LEGACY_size: "medium"
|
|
95
|
+
label: configureLinkLabel
|
|
99
96
|
}),
|
|
100
97
|
onClick: onConfigureClick,
|
|
101
98
|
testId: "".concat(testId, "-dropdown-item-configure")
|
|
@@ -100,7 +100,6 @@ export var OverlayButton = withAnalyticsContext()(function (_ref) {
|
|
|
100
100
|
onClick: handleConfigureClickWithAnalytics,
|
|
101
101
|
iconBefore: jsx(PreferencesIcon, {
|
|
102
102
|
label: configureLinkLabel,
|
|
103
|
-
LEGACY_size: "small",
|
|
104
103
|
testId: "".concat(testId, "-configure-icon")
|
|
105
104
|
})
|
|
106
105
|
})));
|
|
@@ -7,16 +7,13 @@
|
|
|
7
7
|
import { jsx } from '@emotion/react';
|
|
8
8
|
import WarningIcon from '@atlaskit/icon/core/status-warning';
|
|
9
9
|
import Tooltip from '@atlaskit/tooltip';
|
|
10
|
-
import { ICON_SIZE_THRESOLD } from './constants';
|
|
11
10
|
import { Frame } from './frame';
|
|
12
11
|
import { IconWrapper } from './icon-wrapper';
|
|
13
12
|
export var InlineImageCardErrorView = function InlineImageCardErrorView(_ref) {
|
|
14
13
|
var _ref$testId = _ref.testId,
|
|
15
14
|
testId = _ref$testId === void 0 ? 'media-inline-image-card-error-view' : _ref$testId,
|
|
16
15
|
message = _ref.message,
|
|
17
|
-
icon = _ref.icon
|
|
18
|
-
_ref$height = _ref.height,
|
|
19
|
-
height = _ref$height === void 0 ? ICON_SIZE_THRESOLD : _ref$height;
|
|
16
|
+
icon = _ref.icon;
|
|
20
17
|
return jsx(Frame, {
|
|
21
18
|
testId: testId
|
|
22
19
|
}, jsx(Tooltip, {
|
|
@@ -26,7 +23,6 @@ export var InlineImageCardErrorView = function InlineImageCardErrorView(_ref) {
|
|
|
26
23
|
hideTooltipOnClick: true
|
|
27
24
|
}, jsx(IconWrapper, null, icon || jsx(WarningIcon, {
|
|
28
25
|
label: "error",
|
|
29
|
-
LEGACY_size: height > ICON_SIZE_THRESOLD ? 'medium' : 'small',
|
|
30
26
|
color: "var(--ds-icon-danger, #C9372C)"
|
|
31
27
|
}))));
|
|
32
28
|
};
|
|
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
|
|
|
10
10
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
11
11
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
12
12
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
13
|
-
var packageVersion = "111.
|
|
13
|
+
var packageVersion = "111.7.1";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// Ignored via go/ees007
|
|
@@ -2,7 +2,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
var _templateObject;
|
|
3
3
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
4
|
import { css } from '@emotion/react';
|
|
5
|
-
import { akEditorDeleteIconColor } from '@atlaskit/editor-shared-styles';
|
|
5
|
+
import { akEditorDeleteIconColor, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
6
6
|
/*
|
|
7
7
|
Styles in this file are based on
|
|
8
8
|
packages/editor/editor-core/src/plugins/media/styles.ts
|
|
@@ -14,9 +14,6 @@ export var resizerHandleClassName = 'resizer-handle';
|
|
|
14
14
|
export var resizerHandleTrackClassName = "".concat(resizerHandleClassName, "-track");
|
|
15
15
|
export var resizerHandleThumbClassName = "".concat(resizerHandleClassName, "-thumb");
|
|
16
16
|
export var resizerDangerClassName = "".concat(resizerHandleClassName, "-danger");
|
|
17
|
-
|
|
18
|
-
// akEditorSelectedNodeClassName from '@atlaskit/editor-shared-styles';
|
|
19
|
-
var akEditorSelectedNodeClassName = 'ak-editor-selected-node';
|
|
20
17
|
export var handleWrapperClass = 'resizer-handle-wrapper';
|
|
21
18
|
export var resizerHandleThumbWidth = 3;
|
|
22
19
|
export var resizerHandleZIndex = 1;
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "111.
|
|
24
|
+
var packageVersion = "111.7.1";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -55,7 +55,6 @@ export var ErrorMessage = function ErrorMessage(_ref2) {
|
|
|
55
55
|
}, jsx("span", {
|
|
56
56
|
css: iconWrapperStyle
|
|
57
57
|
}, jsx(ErrorIcon, {
|
|
58
|
-
LEGACY_size: "small",
|
|
59
58
|
label: fg('platform_editor_dec_a11y_fixes') ? intl.formatMessage(commonMessages.error) : "error",
|
|
60
59
|
"aria-label": fg('platform_editor_dec_a11y_fixes') ? undefined : "error"
|
|
61
60
|
})), children);
|
|
@@ -70,10 +69,8 @@ export var ValidMessage = function ValidMessage(_ref3) {
|
|
|
70
69
|
}, jsx("span", {
|
|
71
70
|
css: iconWrapperStyle
|
|
72
71
|
}, fg('platform_editor_dec_a11y_fixes') ? jsx(SuccessIcon, {
|
|
73
|
-
LEGACY_size: "small",
|
|
74
72
|
label: intl.formatMessage(commonMessages.success)
|
|
75
73
|
}) : jsx(SuccessIcon, {
|
|
76
|
-
LEGACY_size: "small",
|
|
77
74
|
label: "success"
|
|
78
75
|
})), children);
|
|
79
76
|
};
|
|
@@ -16,8 +16,6 @@ var Color = function Color(props) {
|
|
|
16
16
|
label = props.label,
|
|
17
17
|
isSelected = props.isSelected,
|
|
18
18
|
borderColor = props.borderColor,
|
|
19
|
-
_props$checkMarkColor = props.checkMarkColor,
|
|
20
|
-
checkMarkColor = _props$checkMarkColor === void 0 ? '#FFFFFF' : _props$checkMarkColor,
|
|
21
19
|
hexToPaletteColor = props.hexToPaletteColor,
|
|
22
20
|
decorator = props.decorator;
|
|
23
21
|
var colorStyle = hexToPaletteColor ? hexToPaletteColor(value) : value;
|
|
@@ -66,7 +64,6 @@ var Color = function Color(props) {
|
|
|
66
64
|
},
|
|
67
65
|
autoFocus: autoFocus
|
|
68
66
|
}, !decorator && isSelected && jsx(EditorDoneIcon, {
|
|
69
|
-
LEGACY_primaryColor: checkMarkColor,
|
|
70
67
|
label: ""
|
|
71
68
|
}), decorator)));
|
|
72
69
|
};
|
|
@@ -8,7 +8,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
8
8
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9
9
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
10
|
import React, { Component } from 'react';
|
|
11
|
-
export var
|
|
11
|
+
export var withImageLoader = function withImageLoader(Wrapped) {
|
|
12
12
|
return /*#__PURE__*/function (_Component) {
|
|
13
13
|
function WithImageLoader() {
|
|
14
14
|
var _this;
|
|
@@ -40,130 +40,6 @@ export var withImageLoaderOld = function withImageLoaderOld(Wrapped) {
|
|
|
40
40
|
return _this;
|
|
41
41
|
}
|
|
42
42
|
_inherits(WithImageLoader, _Component);
|
|
43
|
-
return _createClass(WithImageLoader, [{
|
|
44
|
-
key: "componentDidMount",
|
|
45
|
-
value:
|
|
46
|
-
/**
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
*/
|
|
50
|
-
function componentDidMount() {
|
|
51
|
-
this.fetchImage(this.props);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
*
|
|
56
|
-
* @param nextProps
|
|
57
|
-
* @example
|
|
58
|
-
*/
|
|
59
|
-
// Ignored via go/ees005
|
|
60
|
-
// eslint-disable-next-line react/no-unsafe
|
|
61
|
-
}, {
|
|
62
|
-
key: "UNSAFE_componentWillReceiveProps",
|
|
63
|
-
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
64
|
-
if (nextProps.url !== this.props.url) {
|
|
65
|
-
this.setState({
|
|
66
|
-
imageStatus: 'loading'
|
|
67
|
-
});
|
|
68
|
-
this.fetchImage(nextProps);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
*/
|
|
76
|
-
}, {
|
|
77
|
-
key: "componentWillUnmount",
|
|
78
|
-
value: function componentWillUnmount() {
|
|
79
|
-
if (this.img) {
|
|
80
|
-
if (!process.env.REACT_SSR) {
|
|
81
|
-
// Ignored via go/ees005
|
|
82
|
-
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
83
|
-
this.img.removeEventListener('load', this.onLoad);
|
|
84
|
-
// Ignored via go/ees005
|
|
85
|
-
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
86
|
-
this.img.removeEventListener('error', this.onError);
|
|
87
|
-
this.img = null;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
*
|
|
94
|
-
* @param root0
|
|
95
|
-
* @param root0.url
|
|
96
|
-
* @example
|
|
97
|
-
*/
|
|
98
|
-
}, {
|
|
99
|
-
key: "fetchImage",
|
|
100
|
-
value: function fetchImage(_ref) {
|
|
101
|
-
var url = _ref.url;
|
|
102
|
-
if (url) {
|
|
103
|
-
if (!this.img) {
|
|
104
|
-
this.img = new Image();
|
|
105
|
-
if (!process.env.REACT_SSR) {
|
|
106
|
-
// Ignored via go/ees005
|
|
107
|
-
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
108
|
-
this.img.addEventListener('load', this.onLoad);
|
|
109
|
-
// Ignored via go/ees005
|
|
110
|
-
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
111
|
-
this.img.addEventListener('error', this.onError);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
this.img.src = url;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}, {
|
|
118
|
-
key: "render",
|
|
119
|
-
value:
|
|
120
|
-
/**
|
|
121
|
-
*
|
|
122
|
-
* @example
|
|
123
|
-
*/
|
|
124
|
-
function render() {
|
|
125
|
-
var imageStatus = this.state.imageStatus;
|
|
126
|
-
// Ignored via go/ees005
|
|
127
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
128
|
-
return /*#__PURE__*/React.createElement(Wrapped, _extends({}, this.props, {
|
|
129
|
-
imageStatus: imageStatus
|
|
130
|
-
}));
|
|
131
|
-
}
|
|
132
|
-
}]);
|
|
133
|
-
}(Component);
|
|
134
|
-
};
|
|
135
|
-
var withImageLoaderNew = function withImageLoaderNew(Wrapped) {
|
|
136
|
-
return /*#__PURE__*/function (_Component2) {
|
|
137
|
-
function WithImageLoader() {
|
|
138
|
-
var _this2;
|
|
139
|
-
_classCallCheck(this, WithImageLoader);
|
|
140
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
141
|
-
args[_key2] = arguments[_key2];
|
|
142
|
-
}
|
|
143
|
-
_this2 = _callSuper(this, WithImageLoader, [].concat(args));
|
|
144
|
-
_defineProperty(_this2, "state", {
|
|
145
|
-
imageStatus: 'loading'
|
|
146
|
-
});
|
|
147
|
-
_defineProperty(_this2, "onLoad", function () {
|
|
148
|
-
_this2.setState({
|
|
149
|
-
imageStatus: 'complete'
|
|
150
|
-
});
|
|
151
|
-
var onExternalImageLoaded = _this2.props.onExternalImageLoaded;
|
|
152
|
-
if (onExternalImageLoaded && _this2.img) {
|
|
153
|
-
onExternalImageLoaded({
|
|
154
|
-
width: _this2.img.naturalWidth,
|
|
155
|
-
height: _this2.img.naturalHeight
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
_defineProperty(_this2, "onError", function () {
|
|
160
|
-
_this2.setState({
|
|
161
|
-
imageStatus: 'error'
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
return _this2;
|
|
165
|
-
}
|
|
166
|
-
_inherits(WithImageLoader, _Component2);
|
|
167
43
|
return _createClass(WithImageLoader, [{
|
|
168
44
|
key: "componentDidMount",
|
|
169
45
|
value: function componentDidMount() {
|
|
@@ -196,8 +72,8 @@ var withImageLoaderNew = function withImageLoaderNew(Wrapped) {
|
|
|
196
72
|
}
|
|
197
73
|
}, {
|
|
198
74
|
key: "fetchImage",
|
|
199
|
-
value: function fetchImage(
|
|
200
|
-
var url =
|
|
75
|
+
value: function fetchImage(_ref) {
|
|
76
|
+
var url = _ref.url;
|
|
201
77
|
if (url) {
|
|
202
78
|
if (!this.img) {
|
|
203
79
|
this.img = new Image();
|
|
@@ -225,7 +101,4 @@ var withImageLoaderNew = function withImageLoaderNew(Wrapped) {
|
|
|
225
101
|
}
|
|
226
102
|
}]);
|
|
227
103
|
}(Component);
|
|
228
|
-
};
|
|
229
|
-
export var withImageLoader = function withImageLoader(Wrapped) {
|
|
230
|
-
return withImageLoaderNew(Wrapped);
|
|
231
104
|
};
|
|
@@ -7,6 +7,7 @@ import { jsx } from '@emotion/react';
|
|
|
7
7
|
import type { Command } from '../types/command';
|
|
8
8
|
import type { EditorCommand } from '../types/editor-command';
|
|
9
9
|
export declare const addAltText: Keymap;
|
|
10
|
+
export declare const toggleViewChanges: Keymap;
|
|
10
11
|
export declare const navToEditorToolbar: Keymap;
|
|
11
12
|
export declare const navToFloatingToolbar: Keymap;
|
|
12
13
|
export declare const askAIQuickInsert: Keymap;
|
|
@@ -4,12 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { jsx } from '@emotion/react';
|
|
6
6
|
type Props = {
|
|
7
|
-
/** Container height */
|
|
8
|
-
height?: number;
|
|
9
7
|
/** Error icon. Default to document icon. */
|
|
10
8
|
icon?: React.ReactNode;
|
|
11
9
|
message: string;
|
|
12
10
|
testId?: string;
|
|
13
11
|
};
|
|
14
|
-
export declare const InlineImageCardErrorView: ({ testId, message, icon,
|
|
12
|
+
export declare const InlineImageCardErrorView: ({ testId, message, icon, }: Props) => jsx.JSX.Element;
|
|
15
13
|
export {};
|
|
@@ -12,5 +12,4 @@ export interface ImageLoaderState {
|
|
|
12
12
|
imageStatus: ImageStatus;
|
|
13
13
|
}
|
|
14
14
|
export type ImageStatus = 'complete' | 'loading' | 'error';
|
|
15
|
-
export declare const withImageLoaderOld: <P extends Object>(Wrapped: ComponentType<React.PropsWithChildren<P & ImageLoaderProps>>) => React.ComponentClass<P & ImageLoaderProps>;
|
|
16
15
|
export declare const withImageLoader: <P extends Object>(Wrapped: ComponentType<React.PropsWithChildren<P & ImageLoaderProps>>) => React.ComponentClass<P & ImageLoaderProps>;
|
|
@@ -7,6 +7,7 @@ import { jsx } from '@emotion/react';
|
|
|
7
7
|
import type { Command } from '../types/command';
|
|
8
8
|
import type { EditorCommand } from '../types/editor-command';
|
|
9
9
|
export declare const addAltText: Keymap;
|
|
10
|
+
export declare const toggleViewChanges: Keymap;
|
|
10
11
|
export declare const navToEditorToolbar: Keymap;
|
|
11
12
|
export declare const navToFloatingToolbar: Keymap;
|
|
12
13
|
export declare const askAIQuickInsert: Keymap;
|
|
@@ -4,12 +4,10 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { jsx } from '@emotion/react';
|
|
6
6
|
type Props = {
|
|
7
|
-
/** Container height */
|
|
8
|
-
height?: number;
|
|
9
7
|
/** Error icon. Default to document icon. */
|
|
10
8
|
icon?: React.ReactNode;
|
|
11
9
|
message: string;
|
|
12
10
|
testId?: string;
|
|
13
11
|
};
|
|
14
|
-
export declare const InlineImageCardErrorView: ({ testId, message, icon,
|
|
12
|
+
export declare const InlineImageCardErrorView: ({ testId, message, icon, }: Props) => jsx.JSX.Element;
|
|
15
13
|
export {};
|
|
@@ -12,5 +12,4 @@ export interface ImageLoaderState {
|
|
|
12
12
|
imageStatus: ImageStatus;
|
|
13
13
|
}
|
|
14
14
|
export type ImageStatus = 'complete' | 'loading' | 'error';
|
|
15
|
-
export declare const withImageLoaderOld: <P extends Object>(Wrapped: ComponentType<React.PropsWithChildren<P & ImageLoaderProps>>) => React.ComponentClass<P & ImageLoaderProps>;
|
|
16
15
|
export declare const withImageLoader: <P extends Object>(Wrapped: ComponentType<React.PropsWithChildren<P & ImageLoaderProps>>) => React.ComponentClass<P & ImageLoaderProps>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "111.
|
|
3
|
+
"version": "111.7.2",
|
|
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/"
|
|
@@ -47,22 +47,22 @@
|
|
|
47
47
|
"@atlaskit/editor-prosemirror": "^7.2.0",
|
|
48
48
|
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
49
49
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
50
|
-
"@atlaskit/editor-toolbar": "^0.
|
|
50
|
+
"@atlaskit/editor-toolbar": "^0.19.0",
|
|
51
51
|
"@atlaskit/editor-toolbar-model": "^0.2.0",
|
|
52
|
-
"@atlaskit/emoji": "^69.
|
|
52
|
+
"@atlaskit/emoji": "^69.10.0",
|
|
53
53
|
"@atlaskit/icon": "^29.4.0",
|
|
54
54
|
"@atlaskit/icon-object": "^7.4.0",
|
|
55
55
|
"@atlaskit/link": "^3.3.0",
|
|
56
|
-
"@atlaskit/link-datasource": "^4.
|
|
56
|
+
"@atlaskit/link-datasource": "^4.32.0",
|
|
57
57
|
"@atlaskit/link-picker": "^4.2.0",
|
|
58
|
-
"@atlaskit/media-card": "^79.
|
|
58
|
+
"@atlaskit/media-card": "^79.13.0",
|
|
59
59
|
"@atlaskit/media-client": "^35.7.0",
|
|
60
60
|
"@atlaskit/media-client-react": "^4.1.0",
|
|
61
61
|
"@atlaskit/media-common": "^12.3.0",
|
|
62
62
|
"@atlaskit/media-file-preview": "^0.15.0",
|
|
63
63
|
"@atlaskit/media-picker": "^70.1.0",
|
|
64
64
|
"@atlaskit/media-ui": "^28.7.0",
|
|
65
|
-
"@atlaskit/media-viewer": "^52.
|
|
65
|
+
"@atlaskit/media-viewer": "^52.6.0",
|
|
66
66
|
"@atlaskit/mention": "^24.4.0",
|
|
67
67
|
"@atlaskit/menu": "^8.4.0",
|
|
68
68
|
"@atlaskit/onboarding": "^14.5.0",
|
|
@@ -70,18 +70,18 @@
|
|
|
70
70
|
"@atlaskit/platform-feature-flags-react": "^0.4.0",
|
|
71
71
|
"@atlaskit/popper": "^7.1.0",
|
|
72
72
|
"@atlaskit/primitives": "^17.0.0",
|
|
73
|
-
"@atlaskit/profilecard": "^24.
|
|
73
|
+
"@atlaskit/profilecard": "^24.28.0",
|
|
74
74
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
75
75
|
"@atlaskit/react-ufo": "^4.16.0",
|
|
76
|
-
"@atlaskit/section-message": "^8.
|
|
77
|
-
"@atlaskit/smart-card": "^43.
|
|
78
|
-
"@atlaskit/smart-user-picker": "^8.
|
|
76
|
+
"@atlaskit/section-message": "^8.12.0",
|
|
77
|
+
"@atlaskit/smart-card": "^43.20.0",
|
|
78
|
+
"@atlaskit/smart-user-picker": "^8.9.0",
|
|
79
79
|
"@atlaskit/spinner": "^19.0.0",
|
|
80
80
|
"@atlaskit/status": "^3.0.0",
|
|
81
81
|
"@atlaskit/task-decision": "^19.2.0",
|
|
82
82
|
"@atlaskit/textfield": "^8.2.0",
|
|
83
83
|
"@atlaskit/theme": "^21.0.0",
|
|
84
|
-
"@atlaskit/tmp-editor-statsig": "^16.
|
|
84
|
+
"@atlaskit/tmp-editor-statsig": "^16.12.0",
|
|
85
85
|
"@atlaskit/tokens": "^9.1.0",
|
|
86
86
|
"@atlaskit/tooltip": "^20.12.0",
|
|
87
87
|
"@atlaskit/width-detector": "^5.0.0",
|