@atlaskit/editor-common 111.7.1 → 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 +8 -0
- 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/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/Messages/index.js +0 -3
- package/dist/cjs/ui/UnsupportedBlock/index.js +1 -2
- package/dist/cjs/ui/UnsupportedInline/index.js +1 -2
- package/dist/cjs/utils/imageLoader.js +4 -131
- 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/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/Messages/index.js +0 -3
- package/dist/es2019/ui/UnsupportedBlock/index.js +1 -2
- package/dist/es2019/ui/UnsupportedInline/index.js +1 -2
- package/dist/es2019/utils/imageLoader.js +1 -111
- 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/ui/DropList/index.js +1 -1
- package/dist/esm/ui/Messages/index.js +0 -3
- package/dist/esm/ui/UnsupportedBlock/index.js +1 -2
- package/dist/esm/ui/UnsupportedInline/index.js +1 -2
- 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 +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 111.7.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`819348f0857f5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/819348f0857f5) -
|
|
8
|
+
[ux] [EDITOR-3769] added shortcut to track changes button
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 111.7.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -103,7 +103,7 @@ exports.makeKeyMapArrayWithCommon = makeKeyMapArrayWithCommon;
|
|
|
103
103
|
exports.makeKeyMapWithCommon = makeKeyMapWithCommon;
|
|
104
104
|
exports.makeKeymap = makeKeymap;
|
|
105
105
|
exports.shiftBackspace = exports.shiftArrowUp = exports.setNormalText = exports.selectTable = exports.selectRow = exports.selectColumn = exports.redoAlt = exports.redo = exports.previousCell = exports.pastePlainText = exports.paste = exports.outdentList = exports.outdent = exports.openHelp = exports.nextCell = exports.navToFloatingToolbar = exports.navToEditorToolbar = exports.moveUp = exports.moveRowUp = exports.moveRowDown = exports.moveRight = exports.moveLeft = exports.moveDown = exports.moveColumnRight = exports.moveColumnLeft = void 0;
|
|
106
|
-
exports.toggleUnderline = exports.toggleTaskList = exports.toggleTaskItemCheckbox = exports.toggleTable = exports.toggleSuperscript = exports.toggleSubscript = exports.toggleStrikethrough = exports.toggleOrderedList = exports.toggleItalic = exports.toggleHighlightPalette = exports.toggleHeading6 = exports.toggleHeading5 = exports.toggleHeading4 = exports.toggleHeading3 = exports.toggleHeading2 = exports.toggleHeading1 = exports.toggleCodeBlock = exports.toggleCode = exports.toggleBulletList = exports.toggleBold = exports.toggleBlockQuote = exports.tab = exports.submit = exports.startColumnResizing = exports.splitListItem = exports.splitCodeBlock = exports.space = exports.showElementDragHandle = exports.shiftTab = exports.shiftEnter = void 0;
|
|
106
|
+
exports.toggleViewChanges = exports.toggleUnderline = exports.toggleTaskList = exports.toggleTaskItemCheckbox = exports.toggleTable = exports.toggleSuperscript = exports.toggleSubscript = exports.toggleStrikethrough = exports.toggleOrderedList = exports.toggleItalic = exports.toggleHighlightPalette = exports.toggleHeading6 = exports.toggleHeading5 = exports.toggleHeading4 = exports.toggleHeading3 = exports.toggleHeading2 = exports.toggleHeading1 = exports.toggleCodeBlock = exports.toggleCode = exports.toggleBulletList = exports.toggleBold = exports.toggleBlockQuote = exports.tab = exports.submit = exports.startColumnResizing = exports.splitListItem = exports.splitCodeBlock = exports.space = exports.showElementDragHandle = exports.shiftTab = exports.shiftEnter = void 0;
|
|
107
107
|
exports.tooltip = tooltip;
|
|
108
108
|
exports.undo = void 0;
|
|
109
109
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
@@ -124,6 +124,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
124
124
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
125
125
|
|
|
126
126
|
var addAltText = exports.addAltText = makeKeyMapWithCommon('Add Alt Text', 'Mod-Alt-y');
|
|
127
|
+
var toggleViewChanges = exports.toggleViewChanges = makeKeyMapWithCommon('View changes', 'Mod-Alt-z');
|
|
127
128
|
var navToEditorToolbar = exports.navToEditorToolbar = makeKeyMapWithCommon('Navigate to editor toolbar', 'Alt-F9');
|
|
128
129
|
var navToFloatingToolbar = exports.navToFloatingToolbar = makeKeyMapWithCommon('Navigate to floating toolbar', 'Alt-F10');
|
|
129
130
|
var askAIQuickInsert = exports.askAIQuickInsert = makeKeyMapWithCommon('Ask AI', "Mod-'");
|
|
@@ -82,7 +82,6 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
82
82
|
}, props, {
|
|
83
83
|
iconBefore: (0, _react2.jsx)(_chevronDown.default, {
|
|
84
84
|
label: configureLinkLabel,
|
|
85
|
-
LEGACY_size: "small",
|
|
86
85
|
size: "small"
|
|
87
86
|
}),
|
|
88
87
|
onClick: function onClick(e) {
|
|
@@ -95,15 +94,13 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
95
94
|
onOpenChange: onOpenChange
|
|
96
95
|
}, (0, _react2.jsx)(_dropdownMenu.DropdownItemGroup, null, (0, _react2.jsx)(_dropdownMenu.DropdownItem, {
|
|
97
96
|
elemBefore: (0, _react2.jsx)(_linkExternal.default, {
|
|
98
|
-
label: goToLinkLabel
|
|
99
|
-
LEGACY_size: "medium"
|
|
97
|
+
label: goToLinkLabel
|
|
100
98
|
}),
|
|
101
99
|
testId: "".concat(testId, "-dropdown-item-open-link"),
|
|
102
100
|
onClick: onGoToLinkClick
|
|
103
101
|
}, goToLinkLabel), (0, _react2.jsx)(_dropdownMenu.DropdownItem, {
|
|
104
102
|
elemBefore: (0, _react2.jsx)(_customize.default, {
|
|
105
|
-
label: configureLinkLabel
|
|
106
|
-
LEGACY_size: "medium"
|
|
103
|
+
label: configureLinkLabel
|
|
107
104
|
}),
|
|
108
105
|
onClick: onConfigureClick,
|
|
109
106
|
testId: "".concat(testId, "-dropdown-item-configure")
|
|
@@ -108,7 +108,6 @@ var OverlayButton = exports.OverlayButton = (0, _withAnalyticsContext.default)()
|
|
|
108
108
|
onClick: handleConfigureClickWithAnalytics,
|
|
109
109
|
iconBefore: (0, _react2.jsx)(_customize.default, {
|
|
110
110
|
label: configureLinkLabel,
|
|
111
|
-
LEGACY_size: "small",
|
|
112
111
|
testId: "".concat(testId, "-configure-icon")
|
|
113
112
|
})
|
|
114
113
|
})));
|
|
@@ -8,7 +8,6 @@ exports.InlineImageCardErrorView = void 0;
|
|
|
8
8
|
var _react = require("@emotion/react");
|
|
9
9
|
var _statusWarning = _interopRequireDefault(require("@atlaskit/icon/core/status-warning"));
|
|
10
10
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
11
|
-
var _constants = require("./constants");
|
|
12
11
|
var _frame = require("./frame");
|
|
13
12
|
var _iconWrapper = require("./icon-wrapper");
|
|
14
13
|
/**
|
|
@@ -22,9 +21,7 @@ var InlineImageCardErrorView = exports.InlineImageCardErrorView = function Inlin
|
|
|
22
21
|
var _ref$testId = _ref.testId,
|
|
23
22
|
testId = _ref$testId === void 0 ? 'media-inline-image-card-error-view' : _ref$testId,
|
|
24
23
|
message = _ref.message,
|
|
25
|
-
icon = _ref.icon
|
|
26
|
-
_ref$height = _ref.height,
|
|
27
|
-
height = _ref$height === void 0 ? _constants.ICON_SIZE_THRESOLD : _ref$height;
|
|
24
|
+
icon = _ref.icon;
|
|
28
25
|
return (0, _react.jsx)(_frame.Frame, {
|
|
29
26
|
testId: testId
|
|
30
27
|
}, (0, _react.jsx)(_tooltip.default, {
|
|
@@ -34,7 +31,6 @@ var InlineImageCardErrorView = exports.InlineImageCardErrorView = function Inlin
|
|
|
34
31
|
hideTooltipOnClick: true
|
|
35
32
|
}, (0, _react.jsx)(_iconWrapper.IconWrapper, null, icon || (0, _react.jsx)(_statusWarning.default, {
|
|
36
33
|
label: "error",
|
|
37
|
-
LEGACY_size: height > _constants.ICON_SIZE_THRESOLD ? 'medium' : 'small',
|
|
38
34
|
color: "var(--ds-icon-danger, #C9372C)"
|
|
39
35
|
}))));
|
|
40
36
|
};
|
|
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
19
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
20
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
21
21
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
22
|
-
var packageVersion = "111.7.
|
|
22
|
+
var packageVersion = "111.7.1";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
24
24
|
* @jsx jsx
|
|
25
25
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "111.7.
|
|
27
|
+
var packageVersion = "111.7.1";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -63,7 +63,6 @@ var ErrorMessage = exports.ErrorMessage = function ErrorMessage(_ref2) {
|
|
|
63
63
|
}, (0, _react.jsx)("span", {
|
|
64
64
|
css: iconWrapperStyle
|
|
65
65
|
}, (0, _react.jsx)(_statusError.default, {
|
|
66
|
-
LEGACY_size: "small",
|
|
67
66
|
label: (0, _platformFeatureFlags.fg)('platform_editor_dec_a11y_fixes') ? intl.formatMessage(_messages.default.error) : "error",
|
|
68
67
|
"aria-label": (0, _platformFeatureFlags.fg)('platform_editor_dec_a11y_fixes') ? undefined : "error"
|
|
69
68
|
})), children);
|
|
@@ -78,10 +77,8 @@ var ValidMessage = exports.ValidMessage = function ValidMessage(_ref3) {
|
|
|
78
77
|
}, (0, _react.jsx)("span", {
|
|
79
78
|
css: iconWrapperStyle
|
|
80
79
|
}, (0, _platformFeatureFlags.fg)('platform_editor_dec_a11y_fixes') ? (0, _react.jsx)(_statusSuccess.default, {
|
|
81
|
-
LEGACY_size: "small",
|
|
82
80
|
label: intl.formatMessage(_messages.default.success)
|
|
83
81
|
}) : (0, _react.jsx)(_statusSuccess.default, {
|
|
84
|
-
LEGACY_size: "small",
|
|
85
82
|
label: "success"
|
|
86
83
|
})), children);
|
|
87
84
|
};
|
|
@@ -66,8 +66,7 @@ var UnsupportedInlineNode = function UnsupportedInlineNode(_ref) {
|
|
|
66
66
|
}, (0, _react2.jsx)("span", {
|
|
67
67
|
style: style
|
|
68
68
|
}, (0, _react2.jsx)(_questionCircle.default, {
|
|
69
|
-
label: "?"
|
|
70
|
-
LEGACY_size: "small"
|
|
69
|
+
label: "?"
|
|
71
70
|
}))));
|
|
72
71
|
};
|
|
73
72
|
var _default = exports.default = (0, _reactIntlNext.injectIntl)(UnsupportedInlineNode);
|
|
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.withImageLoader = void 0;
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
@@ -17,7 +17,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
17
17
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
18
18
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
19
19
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
20
|
-
var
|
|
20
|
+
var withImageLoader = exports.withImageLoader = function withImageLoader(Wrapped) {
|
|
21
21
|
return /*#__PURE__*/function (_Component) {
|
|
22
22
|
function WithImageLoader() {
|
|
23
23
|
var _this;
|
|
@@ -49,130 +49,6 @@ var withImageLoaderOld = exports.withImageLoaderOld = function withImageLoaderOl
|
|
|
49
49
|
return _this;
|
|
50
50
|
}
|
|
51
51
|
(0, _inherits2.default)(WithImageLoader, _Component);
|
|
52
|
-
return (0, _createClass2.default)(WithImageLoader, [{
|
|
53
|
-
key: "componentDidMount",
|
|
54
|
-
value:
|
|
55
|
-
/**
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
*/
|
|
59
|
-
function componentDidMount() {
|
|
60
|
-
this.fetchImage(this.props);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
*
|
|
65
|
-
* @param nextProps
|
|
66
|
-
* @example
|
|
67
|
-
*/
|
|
68
|
-
// Ignored via go/ees005
|
|
69
|
-
// eslint-disable-next-line react/no-unsafe
|
|
70
|
-
}, {
|
|
71
|
-
key: "UNSAFE_componentWillReceiveProps",
|
|
72
|
-
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
73
|
-
if (nextProps.url !== this.props.url) {
|
|
74
|
-
this.setState({
|
|
75
|
-
imageStatus: 'loading'
|
|
76
|
-
});
|
|
77
|
-
this.fetchImage(nextProps);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
*
|
|
83
|
-
* @example
|
|
84
|
-
*/
|
|
85
|
-
}, {
|
|
86
|
-
key: "componentWillUnmount",
|
|
87
|
-
value: function componentWillUnmount() {
|
|
88
|
-
if (this.img) {
|
|
89
|
-
if (!process.env.REACT_SSR) {
|
|
90
|
-
// Ignored via go/ees005
|
|
91
|
-
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
92
|
-
this.img.removeEventListener('load', this.onLoad);
|
|
93
|
-
// Ignored via go/ees005
|
|
94
|
-
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
95
|
-
this.img.removeEventListener('error', this.onError);
|
|
96
|
-
this.img = null;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
*
|
|
103
|
-
* @param root0
|
|
104
|
-
* @param root0.url
|
|
105
|
-
* @example
|
|
106
|
-
*/
|
|
107
|
-
}, {
|
|
108
|
-
key: "fetchImage",
|
|
109
|
-
value: function fetchImage(_ref) {
|
|
110
|
-
var url = _ref.url;
|
|
111
|
-
if (url) {
|
|
112
|
-
if (!this.img) {
|
|
113
|
-
this.img = new Image();
|
|
114
|
-
if (!process.env.REACT_SSR) {
|
|
115
|
-
// Ignored via go/ees005
|
|
116
|
-
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
117
|
-
this.img.addEventListener('load', this.onLoad);
|
|
118
|
-
// Ignored via go/ees005
|
|
119
|
-
// eslint-disable-next-line @repo/internal/dom-events/no-unsafe-event-listeners
|
|
120
|
-
this.img.addEventListener('error', this.onError);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
this.img.src = url;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}, {
|
|
127
|
-
key: "render",
|
|
128
|
-
value:
|
|
129
|
-
/**
|
|
130
|
-
*
|
|
131
|
-
* @example
|
|
132
|
-
*/
|
|
133
|
-
function render() {
|
|
134
|
-
var imageStatus = this.state.imageStatus;
|
|
135
|
-
// Ignored via go/ees005
|
|
136
|
-
// eslint-disable-next-line react/jsx-props-no-spreading
|
|
137
|
-
return /*#__PURE__*/_react.default.createElement(Wrapped, (0, _extends2.default)({}, this.props, {
|
|
138
|
-
imageStatus: imageStatus
|
|
139
|
-
}));
|
|
140
|
-
}
|
|
141
|
-
}]);
|
|
142
|
-
}(_react.Component);
|
|
143
|
-
};
|
|
144
|
-
var withImageLoaderNew = function withImageLoaderNew(Wrapped) {
|
|
145
|
-
return /*#__PURE__*/function (_Component2) {
|
|
146
|
-
function WithImageLoader() {
|
|
147
|
-
var _this2;
|
|
148
|
-
(0, _classCallCheck2.default)(this, WithImageLoader);
|
|
149
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
150
|
-
args[_key2] = arguments[_key2];
|
|
151
|
-
}
|
|
152
|
-
_this2 = _callSuper(this, WithImageLoader, [].concat(args));
|
|
153
|
-
(0, _defineProperty2.default)(_this2, "state", {
|
|
154
|
-
imageStatus: 'loading'
|
|
155
|
-
});
|
|
156
|
-
(0, _defineProperty2.default)(_this2, "onLoad", function () {
|
|
157
|
-
_this2.setState({
|
|
158
|
-
imageStatus: 'complete'
|
|
159
|
-
});
|
|
160
|
-
var onExternalImageLoaded = _this2.props.onExternalImageLoaded;
|
|
161
|
-
if (onExternalImageLoaded && _this2.img) {
|
|
162
|
-
onExternalImageLoaded({
|
|
163
|
-
width: _this2.img.naturalWidth,
|
|
164
|
-
height: _this2.img.naturalHeight
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
(0, _defineProperty2.default)(_this2, "onError", function () {
|
|
169
|
-
_this2.setState({
|
|
170
|
-
imageStatus: 'error'
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
return _this2;
|
|
174
|
-
}
|
|
175
|
-
(0, _inherits2.default)(WithImageLoader, _Component2);
|
|
176
52
|
return (0, _createClass2.default)(WithImageLoader, [{
|
|
177
53
|
key: "componentDidMount",
|
|
178
54
|
value: function componentDidMount() {
|
|
@@ -205,8 +81,8 @@ var withImageLoaderNew = function withImageLoaderNew(Wrapped) {
|
|
|
205
81
|
}
|
|
206
82
|
}, {
|
|
207
83
|
key: "fetchImage",
|
|
208
|
-
value: function fetchImage(
|
|
209
|
-
var url =
|
|
84
|
+
value: function fetchImage(_ref) {
|
|
85
|
+
var url = _ref.url;
|
|
210
86
|
if (url) {
|
|
211
87
|
if (!this.img) {
|
|
212
88
|
this.img = new Image();
|
|
@@ -234,7 +110,4 @@ var withImageLoaderNew = function withImageLoaderNew(Wrapped) {
|
|
|
234
110
|
}
|
|
235
111
|
}]);
|
|
236
112
|
}(_react.Component);
|
|
237
|
-
};
|
|
238
|
-
var withImageLoader = exports.withImageLoader = function withImageLoader(Wrapped) {
|
|
239
|
-
return withImageLoaderNew(Wrapped);
|
|
240
113
|
};
|
|
@@ -11,6 +11,7 @@ import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
|
11
11
|
import { editorCommandToPMCommand } from '../preset/editor-commands';
|
|
12
12
|
import { browser as browserLegacy, getBrowserInfo } from '../utils/browser';
|
|
13
13
|
export const addAltText = makeKeyMapWithCommon('Add Alt Text', 'Mod-Alt-y');
|
|
14
|
+
export const toggleViewChanges = makeKeyMapWithCommon('View changes', 'Mod-Alt-z');
|
|
14
15
|
export const navToEditorToolbar = makeKeyMapWithCommon('Navigate to editor toolbar', 'Alt-F9');
|
|
15
16
|
export const navToFloatingToolbar = makeKeyMapWithCommon('Navigate to floating toolbar', 'Alt-F10');
|
|
16
17
|
export const askAIQuickInsert = makeKeyMapWithCommon('Ask AI', "Mod-'");
|
|
@@ -74,7 +74,6 @@ const Dropdown = ({
|
|
|
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: e => {
|
|
@@ -86,15 +85,13 @@ const Dropdown = ({
|
|
|
86
85
|
onOpenChange: onOpenChange
|
|
87
86
|
}, jsx(DropdownItemGroup, null, jsx(DropdownItem, {
|
|
88
87
|
elemBefore: jsx(LinkExternalIcon, {
|
|
89
|
-
label: goToLinkLabel
|
|
90
|
-
LEGACY_size: "medium"
|
|
88
|
+
label: goToLinkLabel
|
|
91
89
|
}),
|
|
92
90
|
testId: `${testId}-dropdown-item-open-link`,
|
|
93
91
|
onClick: onGoToLinkClick
|
|
94
92
|
}, goToLinkLabel), jsx(DropdownItem, {
|
|
95
93
|
elemBefore: jsx(PreferencesIcon, {
|
|
96
|
-
label: configureLinkLabel
|
|
97
|
-
LEGACY_size: "medium"
|
|
94
|
+
label: configureLinkLabel
|
|
98
95
|
}),
|
|
99
96
|
onClick: onConfigureClick,
|
|
100
97
|
testId: `${testId}-dropdown-item-configure`
|
|
@@ -7,14 +7,12 @@
|
|
|
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 const InlineImageCardErrorView = ({
|
|
14
13
|
testId = 'media-inline-image-card-error-view',
|
|
15
14
|
message,
|
|
16
|
-
icon
|
|
17
|
-
height = ICON_SIZE_THRESOLD
|
|
15
|
+
icon
|
|
18
16
|
}) => {
|
|
19
17
|
return jsx(Frame, {
|
|
20
18
|
testId: testId
|
|
@@ -25,7 +23,6 @@ export const InlineImageCardErrorView = ({
|
|
|
25
23
|
hideTooltipOnClick: true
|
|
26
24
|
}, jsx(IconWrapper, null, icon || jsx(WarningIcon, {
|
|
27
25
|
label: "error",
|
|
28
|
-
LEGACY_size: height > ICON_SIZE_THRESOLD ? 'medium' : 'small',
|
|
29
26
|
color: "var(--ds-icon-danger, #C9372C)"
|
|
30
27
|
}))));
|
|
31
28
|
};
|
|
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
|
|
|
4
4
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
5
5
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
6
6
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
7
|
-
const packageVersion = "111.7.
|
|
7
|
+
const packageVersion = "111.7.1";
|
|
8
8
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
9
9
|
// Remove URL as it has UGC
|
|
10
10
|
// Ignored via go/ees007
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "111.7.
|
|
17
|
+
const packageVersion = "111.7.1";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -52,7 +52,6 @@ export const ErrorMessage = ({
|
|
|
52
52
|
}, jsx("span", {
|
|
53
53
|
css: iconWrapperStyle
|
|
54
54
|
}, jsx(ErrorIcon, {
|
|
55
|
-
LEGACY_size: "small",
|
|
56
55
|
label: fg('platform_editor_dec_a11y_fixes') ? intl.formatMessage(commonMessages.error) : "error",
|
|
57
56
|
"aria-label": fg('platform_editor_dec_a11y_fixes') ? undefined : "error"
|
|
58
57
|
})), children);
|
|
@@ -68,10 +67,8 @@ export const ValidMessage = ({
|
|
|
68
67
|
}, jsx("span", {
|
|
69
68
|
css: iconWrapperStyle
|
|
70
69
|
}, fg('platform_editor_dec_a11y_fixes') ? jsx(SuccessIcon, {
|
|
71
|
-
LEGACY_size: "small",
|
|
72
70
|
label: intl.formatMessage(commonMessages.success)
|
|
73
71
|
}) : jsx(SuccessIcon, {
|
|
74
|
-
LEGACY_size: "small",
|
|
75
72
|
label: "success"
|
|
76
73
|
})), children);
|
|
77
74
|
};
|
|
@@ -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
|
};
|
|
@@ -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.7.
|
|
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
|
|
@@ -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.7.
|
|
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
|
};
|
|
@@ -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.7.
|
|
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/"
|
|
@@ -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
76
|
"@atlaskit/section-message": "^8.12.0",
|
|
77
77
|
"@atlaskit/smart-card": "^43.20.0",
|
|
78
|
-
"@atlaskit/smart-user-picker": "^8.
|
|
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",
|