@atlaskit/media-avatar-picker 26.4.13 → 27.0.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 +27 -0
- package/dist/cjs/avatar-list/index.js +2 -2
- package/dist/cjs/avatar-picker-dialog/SRLiveTitle.js +2 -2
- package/dist/cjs/avatar-picker-dialog/SubmitErrorDialog.js +2 -2
- package/dist/cjs/avatar-picker-dialog/index.js +8 -8
- package/dist/cjs/image-cropper/index.js +2 -2
- package/dist/cjs/image-navigator/index.js +4 -4
- package/dist/cjs/image-navigator/slider.js +2 -2
- package/dist/cjs/image-placer/imageWrapper.js +2 -2
- package/dist/cjs/image-placer/index.js +110 -20
- package/dist/cjs/predefined-avatar-list/index.js +2 -2
- package/dist/cjs/predefined-avatar-view/index.js +3 -3
- package/dist/es2019/avatar-list/index.js +1 -1
- package/dist/es2019/avatar-picker-dialog/SRLiveTitle.js +1 -1
- package/dist/es2019/avatar-picker-dialog/SubmitErrorDialog.js +1 -1
- package/dist/es2019/avatar-picker-dialog/index.js +1 -1
- package/dist/es2019/image-cropper/index.js +1 -1
- package/dist/es2019/image-navigator/index.js +1 -1
- package/dist/es2019/image-navigator/slider.js +1 -1
- package/dist/es2019/image-placer/imageWrapper.js +1 -1
- package/dist/es2019/image-placer/index.js +69 -0
- package/dist/es2019/predefined-avatar-list/index.js +1 -1
- package/dist/es2019/predefined-avatar-view/index.js +1 -1
- package/dist/esm/avatar-list/index.js +1 -1
- package/dist/esm/avatar-picker-dialog/SRLiveTitle.js +1 -1
- package/dist/esm/avatar-picker-dialog/SubmitErrorDialog.js +1 -1
- package/dist/esm/avatar-picker-dialog/index.js +1 -1
- package/dist/esm/image-cropper/index.js +1 -1
- package/dist/esm/image-navigator/index.js +1 -1
- package/dist/esm/image-navigator/slider.js +1 -1
- package/dist/esm/image-placer/imageWrapper.js +1 -1
- package/dist/esm/image-placer/index.js +110 -20
- package/dist/esm/predefined-avatar-list/index.js +1 -1
- package/dist/esm/predefined-avatar-view/index.js +1 -1
- package/dist/types/avatar-picker-dialog/index.d.ts +1 -1
- package/dist/types/image-cropper/index.d.ts +1 -1
- package/dist/types/image-navigator/index.d.ts +1 -1
- package/dist/types/image-navigator/slider.d.ts +1 -1
- package/dist/types/image-placer/index.d.ts +1 -0
- package/dist/types-ts4.5/avatar-picker-dialog/index.d.ts +1 -1
- package/dist/types-ts4.5/image-cropper/index.d.ts +1 -1
- package/dist/types-ts4.5/image-navigator/index.d.ts +1 -1
- package/dist/types-ts4.5/image-navigator/slider.d.ts +1 -1
- package/dist/types-ts4.5/image-placer/index.d.ts +1 -0
- package/package.json +13 -7
- package/report.api.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @atlaskit/media-avatar-picker
|
|
2
2
|
|
|
3
|
+
## 27.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`e3d1ec1074c7e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e3d1ec1074c7e) -
|
|
8
|
+
Removing UNSAFE_componentWillReceiveProps from media-picker, media-avatar-picker and media-viewer
|
|
9
|
+
package to support React19 migration
|
|
10
|
+
|
|
11
|
+
## 27.0.0
|
|
12
|
+
|
|
13
|
+
### Major Changes
|
|
14
|
+
|
|
15
|
+
- [`770f036c93884`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/770f036c93884) -
|
|
16
|
+
Removed `react-intl-next` alias and replaced all usages with `react-intl` directly.
|
|
17
|
+
|
|
18
|
+
What changed: The `react-intl-next` npm alias (which resolved to `react-intl@^5`) has been
|
|
19
|
+
removed. All imports now reference `react-intl` directly, and `peerDependencies` have been updated
|
|
20
|
+
to `"^5.25.1 || ^6.0.0 || ^7.0.0"`.
|
|
21
|
+
|
|
22
|
+
How consumer should update their code: Ensure `react-intl` is installed at a version satisfying
|
|
23
|
+
`^5.25.1 || ^6.0.0 || ^7.0.0`. If your application was using `react-intl-next` as an npm alias, it
|
|
24
|
+
can be safely removed. Replace any remaining `react-intl-next` imports with `react-intl`.
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- Updated dependencies
|
|
29
|
+
|
|
3
30
|
## 26.4.13
|
|
4
31
|
|
|
5
32
|
### Patch Changes
|
|
@@ -13,7 +13,7 @@ var React = _react;
|
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
|
-
var
|
|
16
|
+
var _reactIntl = require("react-intl");
|
|
17
17
|
var _mediaUi = require("@atlaskit/media-ui");
|
|
18
18
|
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); }
|
|
19
19
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -30,7 +30,7 @@ var AvatarList = exports.AvatarList = function AvatarList(_ref) {
|
|
|
30
30
|
selectedAvatar = _ref.selectedAvatar,
|
|
31
31
|
onItemClick = _ref.onItemClick,
|
|
32
32
|
selectAvatarLabel = _ref.selectAvatarLabel;
|
|
33
|
-
var intl = (0,
|
|
33
|
+
var intl = (0, _reactIntl.useIntl)();
|
|
34
34
|
var _useState = (0, _react.useState)(Object.fromEntries(avatars.map(function (avatar) {
|
|
35
35
|
return [avatar.dataURI, false];
|
|
36
36
|
}))),
|
|
@@ -6,13 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.SRLiveTitle = void 0;
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
var
|
|
9
|
+
var _reactIntl = require("react-intl");
|
|
10
10
|
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
|
|
11
11
|
var _types = require("./types");
|
|
12
12
|
var _mediaUi = require("@atlaskit/media-ui");
|
|
13
13
|
var SRLiveTitle = exports.SRLiveTitle = function SRLiveTitle(_ref) {
|
|
14
14
|
var mode = _ref.mode;
|
|
15
|
-
var intl = (0,
|
|
15
|
+
var intl = (0, _reactIntl.useIntl)();
|
|
16
16
|
return /*#__PURE__*/_react.default.createElement(_visuallyHidden.default, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
17
17
|
"aria-live": "polite"
|
|
18
18
|
}, mode === _types.Mode.Cropping && intl.formatMessage(_mediaUi.messages.or_select_default_avatars), mode === _types.Mode.PredefinedAvatars && intl.formatMessage(_mediaUi.messages.select_an_avatar_from_all_defaults)));
|
|
@@ -14,11 +14,11 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
14
14
|
var _statusError = _interopRequireDefault(require("@atlaskit/icon/core/status-error"));
|
|
15
15
|
var _flag = _interopRequireDefault(require("@atlaskit/flag"));
|
|
16
16
|
var _mediaUi = require("@atlaskit/media-ui");
|
|
17
|
-
var
|
|
17
|
+
var _reactIntl = require("react-intl");
|
|
18
18
|
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); }
|
|
19
19
|
var avatarPickerErrorStyles = null;
|
|
20
20
|
var SubmitErrorDialog = exports.SubmitErrorDialog = function SubmitErrorDialog() {
|
|
21
|
-
var intl = (0,
|
|
21
|
+
var intl = (0, _reactIntl.useIntl)();
|
|
22
22
|
var flagContainerRef = (0, _react.useRef)(null);
|
|
23
23
|
(0, _react.useEffect)(function () {
|
|
24
24
|
if (flagContainerRef.current) {
|
|
@@ -21,7 +21,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
21
21
|
var _react = _interopRequireWildcard(require("react"));
|
|
22
22
|
var _modalDialog = _interopRequireWildcard(require("@atlaskit/modal-dialog"));
|
|
23
23
|
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
24
|
-
var
|
|
24
|
+
var _reactIntl = require("react-intl");
|
|
25
25
|
var _form = require("@atlaskit/form");
|
|
26
26
|
var _mediaUi = require("@atlaskit/media-ui");
|
|
27
27
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
@@ -238,11 +238,11 @@ var AvatarPickerDialog = exports.AvatarPickerDialog = /*#__PURE__*/function (_Pu
|
|
|
238
238
|
}, /*#__PURE__*/_react.default.createElement(_buttonGroup.default, null, /*#__PURE__*/_react.default.createElement(_standardButton.default, {
|
|
239
239
|
appearance: "default",
|
|
240
240
|
onClick: onCancel
|
|
241
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
241
|
+
}, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _mediaUi.messages.cancel)), /*#__PURE__*/_react.default.createElement(_loadingButton.default, {
|
|
242
242
|
appearance: "primary",
|
|
243
243
|
isLoading: isLoading,
|
|
244
244
|
type: "submit"
|
|
245
|
-
}, primaryButtonText || /*#__PURE__*/_react.default.createElement(
|
|
245
|
+
}, primaryButtonText || /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _mediaUi.messages.save))));
|
|
246
246
|
});
|
|
247
247
|
return _this;
|
|
248
248
|
}
|
|
@@ -260,14 +260,14 @@ var AvatarPickerDialog = exports.AvatarPickerDialog = /*#__PURE__*/function (_Pu
|
|
|
260
260
|
}), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalHeader, {
|
|
261
261
|
testId: "modal-header",
|
|
262
262
|
hasCloseButton: true
|
|
263
|
-
}, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTitle, null, this.props.title || /*#__PURE__*/_react.default.createElement(
|
|
263
|
+
}, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTitle, null, this.props.title || /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _mediaUi.messages.upload_an_avatar))), this.state.isSubmitted && /*#__PURE__*/_react.default.createElement(_SubmitErrorDialog.SubmitErrorDialog, null), /*#__PURE__*/_react.default.createElement("form", {
|
|
264
264
|
"aria-label": "form",
|
|
265
265
|
onSubmit: this.onSave,
|
|
266
266
|
className: (0, _runtime.ax)(["_19pkidpf _2hwxidpf _otyridpf _18u0idpf"])
|
|
267
267
|
}, /*#__PURE__*/_react.default.createElement(_modalDialog.ModalBody, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
268
268
|
className: (0, _runtime.ax)(["_1e0c1txw _1bah1h6o _4cvr1y6m _y3gn1h6o _1tkeqbeb"])
|
|
269
269
|
}, this.renderBody())), this.footerContent()));
|
|
270
|
-
return this.props.intl ? content : /*#__PURE__*/_react.default.createElement(
|
|
270
|
+
return this.props.intl ? content : /*#__PURE__*/_react.default.createElement(_reactIntl.IntlProvider, {
|
|
271
271
|
locale: "en"
|
|
272
272
|
}, content);
|
|
273
273
|
}
|
|
@@ -363,7 +363,7 @@ var AvatarPickerDialog = exports.AvatarPickerDialog = /*#__PURE__*/function (_Pu
|
|
|
363
363
|
}, /*#__PURE__*/_react.default.createElement(_form.Field, {
|
|
364
364
|
name: "altText",
|
|
365
365
|
isRequired: true,
|
|
366
|
-
label: /*#__PURE__*/_react.default.createElement(
|
|
366
|
+
label: /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _mediaUi.messages.alt_text)
|
|
367
367
|
}, function (_ref2) {
|
|
368
368
|
var fieldProps = _ref2.fieldProps;
|
|
369
369
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_textfield.default, (0, _extends2.default)({}, fieldProps, {
|
|
@@ -371,7 +371,7 @@ var AvatarPickerDialog = exports.AvatarPickerDialog = /*#__PURE__*/function (_Pu
|
|
|
371
371
|
return _this2.updateAltText(event.currentTarget.value);
|
|
372
372
|
},
|
|
373
373
|
value: altText || ''
|
|
374
|
-
})), /*#__PURE__*/_react.default.createElement(_form.HelperMessage, null, /*#__PURE__*/_react.default.createElement(
|
|
374
|
+
})), /*#__PURE__*/_react.default.createElement(_form.HelperMessage, null, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _mediaUi.messages.alt_text_description)));
|
|
375
375
|
}));
|
|
376
376
|
}
|
|
377
377
|
}, {
|
|
@@ -419,6 +419,6 @@ var AvatarPickerDialog = exports.AvatarPickerDialog = /*#__PURE__*/function (_Pu
|
|
|
419
419
|
(0, _defineProperty2.default)(AvatarPickerDialog, "defaultProps", {
|
|
420
420
|
avatars: []
|
|
421
421
|
});
|
|
422
|
-
var _default = exports.default = (0,
|
|
422
|
+
var _default = exports.default = (0, _reactIntl.injectIntl)(AvatarPickerDialog, {
|
|
423
423
|
enforceContext: false
|
|
424
424
|
});
|
|
@@ -18,7 +18,7 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
|
|
|
18
18
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
19
19
|
var _react = _interopRequireWildcard(require("react"));
|
|
20
20
|
var _cross = _interopRequireDefault(require("@atlaskit/icon/core/cross"));
|
|
21
|
-
var
|
|
21
|
+
var _reactIntl = require("react-intl");
|
|
22
22
|
var _mediaUi = require("@atlaskit/media-ui");
|
|
23
23
|
var _isImageRemote = require("./isImageRemote");
|
|
24
24
|
var _new = require("@atlaskit/button/new");
|
|
@@ -245,4 +245,4 @@ var ImageCropper = exports.ImageCropper = /*#__PURE__*/function (_Component) {
|
|
|
245
245
|
onDragStarted: function onDragStarted() {},
|
|
246
246
|
onImageSize: function onImageSize() {}
|
|
247
247
|
});
|
|
248
|
-
var _default = exports.default = (0,
|
|
248
|
+
var _default = exports.default = (0, _reactIntl.injectIntl)(ImageCropper);
|
|
@@ -19,7 +19,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
19
19
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
20
20
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
21
21
|
var _react = _interopRequireWildcard(require("react"));
|
|
22
|
-
var
|
|
22
|
+
var _reactIntl = require("react-intl");
|
|
23
23
|
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
24
24
|
var _imageCropper = _interopRequireDefault(require("../image-cropper"));
|
|
25
25
|
var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
@@ -359,11 +359,11 @@ var ImageNavigator = exports.ImageNavigator = /*#__PURE__*/function (_Component)
|
|
|
359
359
|
}, this.renderDragZone(), isLoading ? null : /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("p", {
|
|
360
360
|
id: "padded-break",
|
|
361
361
|
className: (0, _runtime.ax)(["_19pk1a66 _otyru2gc _y3gn1h6o"])
|
|
362
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
362
|
+
}, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, errorMessage ? _mediaUi.messages.try_again : _mediaUi.messages.or)), /*#__PURE__*/_react.default.createElement(_standardButton.default, {
|
|
363
363
|
onClick: this.onUploadButtonClick,
|
|
364
364
|
isDisabled: isLoading,
|
|
365
365
|
testId: "upload-button"
|
|
366
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
366
|
+
}, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _mediaUi.messages.upload_photo), /*#__PURE__*/_react.default.createElement("input", {
|
|
367
367
|
"data-testid": "image-navigator-input-file",
|
|
368
368
|
type: "file",
|
|
369
369
|
id: "image-input",
|
|
@@ -438,4 +438,4 @@ var ImageNavigator = exports.ImageNavigator = /*#__PURE__*/function (_Component)
|
|
|
438
438
|
}
|
|
439
439
|
}]);
|
|
440
440
|
}(_react.Component);
|
|
441
|
-
var _default = exports.default = (0,
|
|
441
|
+
var _default = exports.default = (0, _reactIntl.injectIntl)(ImageNavigator);
|
|
@@ -21,7 +21,7 @@ var _range = _interopRequireDefault(require("@atlaskit/range"));
|
|
|
21
21
|
var _mediaUi = require("@atlaskit/media-ui");
|
|
22
22
|
var _image = _interopRequireDefault(require("@atlaskit/icon/core/image"));
|
|
23
23
|
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
24
|
-
var
|
|
24
|
+
var _reactIntl = require("react-intl");
|
|
25
25
|
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); }
|
|
26
26
|
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)); }
|
|
27
27
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
@@ -79,5 +79,5 @@ var Slider = exports.Slider = /*#__PURE__*/function (_Component) {
|
|
|
79
79
|
}]);
|
|
80
80
|
}(_react.Component);
|
|
81
81
|
(0, _defineProperty2.default)(Slider, "defaultProps", defaultProps);
|
|
82
|
-
var _default_1 = (0,
|
|
82
|
+
var _default_1 = (0, _reactIntl.injectIntl)(Slider);
|
|
83
83
|
var _default = exports.default = _default_1;
|
|
@@ -12,7 +12,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var _runtime = require("@compiled/react/runtime");
|
|
13
13
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
14
14
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
15
|
-
var
|
|
15
|
+
var _reactIntl = require("react-intl");
|
|
16
16
|
var _mediaUi = require("@atlaskit/media-ui");
|
|
17
17
|
var _excluded = ["x", "y", "width", "height", "transform"];
|
|
18
18
|
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); }
|
|
@@ -24,7 +24,7 @@ var ImageWrapper = exports.ImageWrapper = function ImageWrapper(_ref) {
|
|
|
24
24
|
height = _ref.height,
|
|
25
25
|
transform = _ref.transform,
|
|
26
26
|
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
27
|
-
var intl = (0,
|
|
27
|
+
var intl = (0, _reactIntl.useIntl)();
|
|
28
28
|
return /*#__PURE__*/React.createElement("img", (0, _extends2.default)({
|
|
29
29
|
style: {
|
|
30
30
|
left: "".concat(x, "px"),
|
|
@@ -24,6 +24,7 @@ var _image = require("./image");
|
|
|
24
24
|
var _margin = require("./margin");
|
|
25
25
|
var _imageProcessor = require("./imageProcessor");
|
|
26
26
|
var _constraints = require("./constraints");
|
|
27
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
27
28
|
var _imagePlacerErrorWrapper = require("./imagePlacerErrorWrapper");
|
|
28
29
|
var _util = require("../util");
|
|
29
30
|
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)); }
|
|
@@ -266,6 +267,12 @@ var ImagePlacer = exports.ImagePlacer = /*#__PURE__*/function (_React$Component)
|
|
|
266
267
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
267
268
|
while (1) switch (_context.prev = _context.next) {
|
|
268
269
|
case 0:
|
|
270
|
+
if (!(0, _platformFeatureFlags.fg)('platform_media_package_react19_lifecycle_fix')) {
|
|
271
|
+
_context.next = 2;
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
return _context.abrupt("return");
|
|
275
|
+
case 2:
|
|
269
276
|
imageSourceRect = this.imageSourceRect, state = this.state, props = this.props;
|
|
270
277
|
zoom = state.zoom;
|
|
271
278
|
currentUseConstraints = props.useConstraints, currentContainerWidth = props.containerWidth, currentContainerHeight = props.containerHeight, currentMargin = props.margin, currentSrc = props.src;
|
|
@@ -294,34 +301,34 @@ var ImagePlacer = exports.ImagePlacer = /*#__PURE__*/function (_React$Component)
|
|
|
294
301
|
this.updateZoomProp();
|
|
295
302
|
}
|
|
296
303
|
if (!(nextSrc instanceof File && nextSrc !== currentSrc)) {
|
|
297
|
-
_context.next =
|
|
304
|
+
_context.next = 20;
|
|
298
305
|
break;
|
|
299
306
|
}
|
|
300
|
-
_context.next =
|
|
307
|
+
_context.next = 19;
|
|
301
308
|
return (0, _mediaUi.getFileInfo)(nextSrc);
|
|
302
|
-
case
|
|
309
|
+
case 19:
|
|
303
310
|
fileInfo = _context.sent;
|
|
304
|
-
case
|
|
311
|
+
case 20:
|
|
305
312
|
if (!(typeof nextSrc === 'string' && nextSrc !== currentSrc)) {
|
|
306
|
-
_context.next =
|
|
313
|
+
_context.next = 24;
|
|
307
314
|
break;
|
|
308
315
|
}
|
|
309
|
-
_context.next =
|
|
316
|
+
_context.next = 23;
|
|
310
317
|
return (0, _mediaUi.getFileInfoFromSrc)(nextSrc);
|
|
311
|
-
case
|
|
318
|
+
case 23:
|
|
312
319
|
fileInfo = _context.sent;
|
|
313
|
-
case
|
|
320
|
+
case 24:
|
|
314
321
|
if (!fileInfo) {
|
|
315
|
-
_context.next =
|
|
322
|
+
_context.next = 27;
|
|
316
323
|
break;
|
|
317
324
|
}
|
|
318
|
-
_context.next =
|
|
325
|
+
_context.next = 27;
|
|
319
326
|
return this.preprocessFile(fileInfo);
|
|
320
|
-
case
|
|
327
|
+
case 27:
|
|
321
328
|
if (isImageAction) {
|
|
322
329
|
this.provideImageActions();
|
|
323
330
|
}
|
|
324
|
-
case
|
|
331
|
+
case 28:
|
|
325
332
|
case "end":
|
|
326
333
|
return _context.stop();
|
|
327
334
|
}
|
|
@@ -333,18 +340,101 @@ var ImagePlacer = exports.ImagePlacer = /*#__PURE__*/function (_React$Component)
|
|
|
333
340
|
return UNSAFE_componentWillReceiveProps;
|
|
334
341
|
}())
|
|
335
342
|
}, {
|
|
336
|
-
key: "
|
|
343
|
+
key: "componentDidUpdate",
|
|
337
344
|
value: function () {
|
|
338
|
-
var
|
|
339
|
-
var
|
|
345
|
+
var _componentDidUpdate = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(prevProps) {
|
|
346
|
+
var imageSourceRect, props, nextZoom, nextUseConstraints, nextContainerWidth, nextContainerHeight, nextMargin, nextSrc, nextOnImageActions, prevZoom, prevUseConstraints, prevContainerWidth, prevContainerHeight, prevMargin, prevSrc, prevOnImageActions, isZoomChange, isUseConstraintsChange, isContainerWidthChange, isContainerHeightChange, isMarginChange, isImageActionChange, zoomReset, fileInfo;
|
|
340
347
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
341
348
|
while (1) switch (_context2.prev = _context2.next) {
|
|
349
|
+
case 0:
|
|
350
|
+
if ((0, _platformFeatureFlags.fg)('platform_media_package_react19_lifecycle_fix')) {
|
|
351
|
+
_context2.next = 2;
|
|
352
|
+
break;
|
|
353
|
+
}
|
|
354
|
+
return _context2.abrupt("return");
|
|
355
|
+
case 2:
|
|
356
|
+
imageSourceRect = this.imageSourceRect, props = this.props;
|
|
357
|
+
nextZoom = props.zoom, nextUseConstraints = props.useConstraints, nextContainerWidth = props.containerWidth, nextContainerHeight = props.containerHeight, nextMargin = props.margin, nextSrc = props.src, nextOnImageActions = props.onImageActions;
|
|
358
|
+
prevZoom = prevProps.zoom, prevUseConstraints = prevProps.useConstraints, prevContainerWidth = prevProps.containerWidth, prevContainerHeight = prevProps.containerHeight, prevMargin = prevProps.margin, prevSrc = prevProps.src, prevOnImageActions = prevProps.onImageActions;
|
|
359
|
+
isZoomChange = nextZoom !== prevZoom;
|
|
360
|
+
isUseConstraintsChange = nextUseConstraints !== undefined && nextUseConstraints !== prevUseConstraints;
|
|
361
|
+
isContainerWidthChange = nextContainerWidth !== undefined && nextContainerWidth !== prevContainerWidth;
|
|
362
|
+
isContainerHeightChange = nextContainerHeight !== undefined && nextContainerHeight !== prevContainerHeight;
|
|
363
|
+
isMarginChange = nextMargin !== undefined && nextMargin !== prevMargin;
|
|
364
|
+
isImageActionChange = nextOnImageActions !== prevOnImageActions;
|
|
365
|
+
zoomReset = {
|
|
366
|
+
zoom: 0
|
|
367
|
+
};
|
|
368
|
+
if (isZoomChange) {
|
|
369
|
+
this.setZoom(nextZoom);
|
|
370
|
+
}
|
|
371
|
+
if (isUseConstraintsChange) {
|
|
372
|
+
this.setState({
|
|
373
|
+
zoom: 0,
|
|
374
|
+
imageWidth: imageSourceRect.width,
|
|
375
|
+
imageHeight: imageSourceRect.height
|
|
376
|
+
}, this.update);
|
|
377
|
+
}
|
|
378
|
+
if (isContainerWidthChange || isContainerHeightChange || isMarginChange) {
|
|
379
|
+
this.setState(zoomReset, this.update);
|
|
380
|
+
this.updateZoomProp();
|
|
381
|
+
}
|
|
382
|
+
if (!(nextSrc !== prevSrc)) {
|
|
383
|
+
_context2.next = 27;
|
|
384
|
+
break;
|
|
385
|
+
}
|
|
386
|
+
if (!(nextSrc instanceof File)) {
|
|
387
|
+
_context2.next = 20;
|
|
388
|
+
break;
|
|
389
|
+
}
|
|
390
|
+
_context2.next = 19;
|
|
391
|
+
return (0, _mediaUi.getFileInfo)(nextSrc);
|
|
392
|
+
case 19:
|
|
393
|
+
fileInfo = _context2.sent;
|
|
394
|
+
case 20:
|
|
395
|
+
if (!(typeof nextSrc === 'string')) {
|
|
396
|
+
_context2.next = 24;
|
|
397
|
+
break;
|
|
398
|
+
}
|
|
399
|
+
_context2.next = 23;
|
|
400
|
+
return (0, _mediaUi.getFileInfoFromSrc)(nextSrc);
|
|
401
|
+
case 23:
|
|
402
|
+
fileInfo = _context2.sent;
|
|
403
|
+
case 24:
|
|
404
|
+
if (!fileInfo) {
|
|
405
|
+
_context2.next = 27;
|
|
406
|
+
break;
|
|
407
|
+
}
|
|
408
|
+
_context2.next = 27;
|
|
409
|
+
return this.preprocessFile(fileInfo);
|
|
410
|
+
case 27:
|
|
411
|
+
if (isImageActionChange) {
|
|
412
|
+
this.provideImageActions();
|
|
413
|
+
}
|
|
414
|
+
case 28:
|
|
415
|
+
case "end":
|
|
416
|
+
return _context2.stop();
|
|
417
|
+
}
|
|
418
|
+
}, _callee2, this);
|
|
419
|
+
}));
|
|
420
|
+
function componentDidUpdate(_x2) {
|
|
421
|
+
return _componentDidUpdate.apply(this, arguments);
|
|
422
|
+
}
|
|
423
|
+
return componentDidUpdate;
|
|
424
|
+
}()
|
|
425
|
+
}, {
|
|
426
|
+
key: "preprocessFile",
|
|
427
|
+
value: function () {
|
|
428
|
+
var _preprocessFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(fileInfo) {
|
|
429
|
+
var maxZoom, previewInfo, width, height;
|
|
430
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
431
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
342
432
|
case 0:
|
|
343
433
|
maxZoom = this.props.maxZoom;
|
|
344
|
-
|
|
434
|
+
_context3.next = 3;
|
|
345
435
|
return (0, _imageProcessor.initialiseImagePreview)(fileInfo, this.containerRect, maxZoom);
|
|
346
436
|
case 3:
|
|
347
|
-
previewInfo =
|
|
437
|
+
previewInfo = _context3.sent;
|
|
348
438
|
if (previewInfo) {
|
|
349
439
|
width = previewInfo.width, height = previewInfo.height;
|
|
350
440
|
this.imageSourceRect = new _mediaUi.Rectangle(width, height);
|
|
@@ -357,11 +447,11 @@ var ImagePlacer = exports.ImagePlacer = /*#__PURE__*/function (_React$Component)
|
|
|
357
447
|
}
|
|
358
448
|
case 5:
|
|
359
449
|
case "end":
|
|
360
|
-
return
|
|
450
|
+
return _context3.stop();
|
|
361
451
|
}
|
|
362
|
-
},
|
|
452
|
+
}, _callee3, this);
|
|
363
453
|
}));
|
|
364
|
-
function preprocessFile(
|
|
454
|
+
function preprocessFile(_x3) {
|
|
365
455
|
return _preprocessFile.apply(this, arguments);
|
|
366
456
|
}
|
|
367
457
|
return preprocessFile;
|
|
@@ -14,7 +14,7 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
14
14
|
var _avatarList = require("../avatar-list");
|
|
15
15
|
var _showMoreHorizontal = _interopRequireDefault(require("@atlaskit/icon/core/show-more-horizontal"));
|
|
16
16
|
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
17
|
-
var
|
|
17
|
+
var _reactIntl = require("react-intl");
|
|
18
18
|
var _mediaUi = require("@atlaskit/media-ui");
|
|
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 predefinedAvatarsWrapperStyles = null;
|
|
@@ -27,7 +27,7 @@ var PredefinedAvatarList = exports.PredefinedAvatarList = /*#__PURE__*/(0, _reac
|
|
|
27
27
|
onAvatarSelected = _ref.onAvatarSelected,
|
|
28
28
|
selectAvatarLabel = _ref.selectAvatarLabel,
|
|
29
29
|
showMoreAvatarsButtonLabel = _ref.showMoreAvatarsButtonLabel;
|
|
30
|
-
var intl = (0,
|
|
30
|
+
var intl = (0, _reactIntl.useIntl)();
|
|
31
31
|
return /*#__PURE__*/React.createElement("div", {
|
|
32
32
|
id: "predefined-avatar-wrapper",
|
|
33
33
|
className: (0, _runtime.ax)(["_1e0c1txw _4cvr1h6o"])
|
|
@@ -13,7 +13,7 @@ var React = _react;
|
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
|
-
var
|
|
16
|
+
var _reactIntl = require("react-intl");
|
|
17
17
|
var _mediaUi = require("@atlaskit/media-ui");
|
|
18
18
|
var _arrowLeft = _interopRequireDefault(require("@atlaskit/icon/core/arrow-left"));
|
|
19
19
|
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
@@ -37,7 +37,7 @@ var PredefinedAvatarView = exports.PredefinedAvatarView = /*#__PURE__*/(0, _reac
|
|
|
37
37
|
onGoBack = _ref.onGoBack,
|
|
38
38
|
predefinedAvatarsText = _ref.predefinedAvatarsText,
|
|
39
39
|
selectAvatarLabel = _ref.selectAvatarLabel;
|
|
40
|
-
var intl = (0,
|
|
40
|
+
var intl = (0, _reactIntl.useIntl)();
|
|
41
41
|
var _useState = (0, _react.useState)(Object.fromEntries(avatars.map(function (avatar) {
|
|
42
42
|
return [avatar.dataURI, false];
|
|
43
43
|
}))),
|
|
@@ -91,7 +91,7 @@ var PredefinedAvatarView = exports.PredefinedAvatarView = /*#__PURE__*/(0, _reac
|
|
|
91
91
|
className: (0, _runtime.ax)(["_2rko1i7s _19pkidpf _2hwxidpf _otyridpf _18u0idpf _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _1bsbzwfg _4t3izwfg _4cvr1h6o _1bah1h6o"])
|
|
92
92
|
}), /*#__PURE__*/React.createElement("h2", {
|
|
93
93
|
className: (0, _runtime.ax)(["_19pkidpf _2hwxidpf _otyridpf _18u0idpf _11c8fhey _19bvu2gc"])
|
|
94
|
-
}, predefinedAvatarsText || /*#__PURE__*/React.createElement(
|
|
94
|
+
}, predefinedAvatarsText || /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, _mediaUi.messages.default_avatars))), /*#__PURE__*/React.createElement("div", {
|
|
95
95
|
role: "radiogroup",
|
|
96
96
|
"aria-label": selectAvatarLabel || intl.formatMessage(_mediaUi.messages.select_an_avatar),
|
|
97
97
|
className: (0, _runtime.ax)(["_2lx2vrvc _1n261g80 _19pkidpf _2hwxidpf _otyridpf _18u0idpf _1e0c1txw _1bsb1665 _c71lgrxc _18m91wug _ca0qu2gc _u5f3idpf _n3tdidpf _19bvidpf"])
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import "./index.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
-
import { useIntl } from 'react-intl
|
|
5
|
+
import { useIntl } from 'react-intl';
|
|
6
6
|
import { messages } from '@atlaskit/media-ui';
|
|
7
7
|
import { useState } from 'react';
|
|
8
8
|
const smallAvatarImageStyles = null;
|
|
@@ -6,7 +6,7 @@ import { useRef, useEffect } from 'react';
|
|
|
6
6
|
import ErrorIcon from '@atlaskit/icon/core/status-error';
|
|
7
7
|
import Flag from '@atlaskit/flag';
|
|
8
8
|
import { messages } from '@atlaskit/media-ui';
|
|
9
|
-
import { useIntl } from 'react-intl
|
|
9
|
+
import { useIntl } from 'react-intl';
|
|
10
10
|
const avatarPickerErrorStyles = null;
|
|
11
11
|
export const SubmitErrorDialog = () => {
|
|
12
12
|
const intl = useIntl();
|
|
@@ -7,7 +7,7 @@ import React, { Fragment, createRef } from 'react';
|
|
|
7
7
|
import { PureComponent } from 'react';
|
|
8
8
|
import ModalDialog, { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
|
|
9
9
|
import Button from '@atlaskit/button/standard-button';
|
|
10
|
-
import { FormattedMessage, IntlProvider, injectIntl } from 'react-intl
|
|
10
|
+
import { FormattedMessage, IntlProvider, injectIntl } from 'react-intl';
|
|
11
11
|
import { Field, HelperMessage } from '@atlaskit/form';
|
|
12
12
|
import { fileToDataURI, dataURItoFile, messages } from '@atlaskit/media-ui';
|
|
13
13
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
@@ -6,7 +6,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { Component } from 'react';
|
|
8
8
|
import CrossIcon from '@atlaskit/icon/core/cross';
|
|
9
|
-
import { injectIntl } from 'react-intl
|
|
9
|
+
import { injectIntl } from 'react-intl';
|
|
10
10
|
import { messages, MediaImage } from '@atlaskit/media-ui';
|
|
11
11
|
import { isImageRemote } from './isImageRemote';
|
|
12
12
|
import { IconButton } from '@atlaskit/button/new';
|
|
@@ -4,7 +4,7 @@ import "./index.compiled.css";
|
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { Component } from 'react';
|
|
7
|
-
import { FormattedMessage, injectIntl } from 'react-intl
|
|
7
|
+
import { FormattedMessage, injectIntl } from 'react-intl';
|
|
8
8
|
import Button from '@atlaskit/button/standard-button';
|
|
9
9
|
import ImageCropper from '../image-cropper';
|
|
10
10
|
import Spinner from '@atlaskit/spinner';
|
|
@@ -9,7 +9,7 @@ import { messages } from '@atlaskit/media-ui';
|
|
|
9
9
|
import ScaleLargeIcon from '@atlaskit/icon/core/image';
|
|
10
10
|
import ScaleSmallIcon from '@atlaskit/icon/core/image';
|
|
11
11
|
import Button from '@atlaskit/button/standard-button';
|
|
12
|
-
import { injectIntl } from 'react-intl
|
|
12
|
+
import { injectIntl } from 'react-intl';
|
|
13
13
|
export const defaultProps = {
|
|
14
14
|
value: 0
|
|
15
15
|
};
|
|
@@ -3,7 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
import "./imageWrapper.compiled.css";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
-
import { useIntl } from 'react-intl
|
|
6
|
+
import { useIntl } from 'react-intl';
|
|
7
7
|
import { messages } from '@atlaskit/media-ui';
|
|
8
8
|
const imageWrapperStyles = null;
|
|
9
9
|
export const ImageWrapper = ({
|
|
@@ -9,6 +9,7 @@ import { ImagePlacerImage } from './image';
|
|
|
9
9
|
import { Margin } from './margin';
|
|
10
10
|
import { initialiseImagePreview, renderImageAtCurrentView } from './imageProcessor';
|
|
11
11
|
import { zoomToFit, applyConstraints, transformVisibleBoundsToImageCoords } from './constraints';
|
|
12
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
12
13
|
import { ImagePlacerErrorWrapper } from './imagePlacerErrorWrapper';
|
|
13
14
|
import { isSSR } from '../util';
|
|
14
15
|
|
|
@@ -247,6 +248,9 @@ export class ImagePlacer extends React.Component {
|
|
|
247
248
|
|
|
248
249
|
/* respond to prop changes */
|
|
249
250
|
async UNSAFE_componentWillReceiveProps(nextProps) {
|
|
251
|
+
if (fg('platform_media_package_react19_lifecycle_fix')) {
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
250
254
|
const {
|
|
251
255
|
imageSourceRect,
|
|
252
256
|
state,
|
|
@@ -308,6 +312,71 @@ export class ImagePlacer extends React.Component {
|
|
|
308
312
|
this.provideImageActions();
|
|
309
313
|
}
|
|
310
314
|
}
|
|
315
|
+
async componentDidUpdate(prevProps) {
|
|
316
|
+
if (!fg('platform_media_package_react19_lifecycle_fix')) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
const {
|
|
320
|
+
imageSourceRect,
|
|
321
|
+
props
|
|
322
|
+
} = this;
|
|
323
|
+
const {
|
|
324
|
+
zoom: nextZoom,
|
|
325
|
+
useConstraints: nextUseConstraints,
|
|
326
|
+
containerWidth: nextContainerWidth,
|
|
327
|
+
containerHeight: nextContainerHeight,
|
|
328
|
+
margin: nextMargin,
|
|
329
|
+
src: nextSrc,
|
|
330
|
+
onImageActions: nextOnImageActions
|
|
331
|
+
} = props;
|
|
332
|
+
const {
|
|
333
|
+
zoom: prevZoom,
|
|
334
|
+
useConstraints: prevUseConstraints,
|
|
335
|
+
containerWidth: prevContainerWidth,
|
|
336
|
+
containerHeight: prevContainerHeight,
|
|
337
|
+
margin: prevMargin,
|
|
338
|
+
src: prevSrc,
|
|
339
|
+
onImageActions: prevOnImageActions
|
|
340
|
+
} = prevProps;
|
|
341
|
+
const isZoomChange = nextZoom !== prevZoom;
|
|
342
|
+
const isUseConstraintsChange = nextUseConstraints !== undefined && nextUseConstraints !== prevUseConstraints;
|
|
343
|
+
const isContainerWidthChange = nextContainerWidth !== undefined && nextContainerWidth !== prevContainerWidth;
|
|
344
|
+
const isContainerHeightChange = nextContainerHeight !== undefined && nextContainerHeight !== prevContainerHeight;
|
|
345
|
+
const isMarginChange = nextMargin !== undefined && nextMargin !== prevMargin;
|
|
346
|
+
const isImageActionChange = nextOnImageActions !== prevOnImageActions;
|
|
347
|
+
const zoomReset = {
|
|
348
|
+
zoom: 0
|
|
349
|
+
};
|
|
350
|
+
if (isZoomChange) {
|
|
351
|
+
this.setZoom(nextZoom);
|
|
352
|
+
}
|
|
353
|
+
if (isUseConstraintsChange) {
|
|
354
|
+
this.setState({
|
|
355
|
+
zoom: 0,
|
|
356
|
+
imageWidth: imageSourceRect.width,
|
|
357
|
+
imageHeight: imageSourceRect.height
|
|
358
|
+
}, this.update);
|
|
359
|
+
}
|
|
360
|
+
if (isContainerWidthChange || isContainerHeightChange || isMarginChange) {
|
|
361
|
+
this.setState(zoomReset, this.update);
|
|
362
|
+
this.updateZoomProp();
|
|
363
|
+
}
|
|
364
|
+
if (nextSrc !== prevSrc) {
|
|
365
|
+
let fileInfo;
|
|
366
|
+
if (nextSrc instanceof File) {
|
|
367
|
+
fileInfo = await getFileInfo(nextSrc);
|
|
368
|
+
}
|
|
369
|
+
if (typeof nextSrc === 'string') {
|
|
370
|
+
fileInfo = await getFileInfoFromSrc(nextSrc);
|
|
371
|
+
}
|
|
372
|
+
if (fileInfo) {
|
|
373
|
+
await this.preprocessFile(fileInfo);
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
if (isImageActionChange) {
|
|
377
|
+
this.provideImageActions();
|
|
378
|
+
}
|
|
379
|
+
}
|
|
311
380
|
async preprocessFile(fileInfo) {
|
|
312
381
|
const {
|
|
313
382
|
maxZoom
|
|
@@ -5,7 +5,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
5
5
|
import { AvatarList } from '../avatar-list';
|
|
6
6
|
import EditorMoreIcon from '@atlaskit/icon/core/show-more-horizontal';
|
|
7
7
|
import Button from '@atlaskit/button/standard-button';
|
|
8
|
-
import { useIntl } from 'react-intl
|
|
8
|
+
import { useIntl } from 'react-intl';
|
|
9
9
|
import { messages } from '@atlaskit/media-ui';
|
|
10
10
|
import { forwardRef } from 'react';
|
|
11
11
|
const predefinedAvatarsWrapperStyles = null;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import "./index.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
-
import { FormattedMessage, useIntl } from 'react-intl
|
|
5
|
+
import { FormattedMessage, useIntl } from 'react-intl';
|
|
6
6
|
import { messages } from '@atlaskit/media-ui';
|
|
7
7
|
import ArrowLeftIcon from '@atlaskit/icon/core/arrow-left';
|
|
8
8
|
import Button from '@atlaskit/button/standard-button';
|
|
@@ -6,7 +6,7 @@ import * as React from 'react';
|
|
|
6
6
|
import { ax, ix } from "@compiled/react/runtime";
|
|
7
7
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
8
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
|
-
import { useIntl } from 'react-intl
|
|
9
|
+
import { useIntl } from 'react-intl';
|
|
10
10
|
import { messages } from '@atlaskit/media-ui';
|
|
11
11
|
import { useState } from 'react';
|
|
12
12
|
var smallAvatarImageStyles = null;
|
|
@@ -6,7 +6,7 @@ import { useRef, useEffect } from 'react';
|
|
|
6
6
|
import ErrorIcon from '@atlaskit/icon/core/status-error';
|
|
7
7
|
import Flag from '@atlaskit/flag';
|
|
8
8
|
import { messages } from '@atlaskit/media-ui';
|
|
9
|
-
import { useIntl } from 'react-intl
|
|
9
|
+
import { useIntl } from 'react-intl';
|
|
10
10
|
var avatarPickerErrorStyles = null;
|
|
11
11
|
export var SubmitErrorDialog = function SubmitErrorDialog() {
|
|
12
12
|
var intl = useIntl();
|
|
@@ -16,7 +16,7 @@ import React, { Fragment, createRef } from 'react';
|
|
|
16
16
|
import { PureComponent } from 'react';
|
|
17
17
|
import ModalDialog, { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';
|
|
18
18
|
import Button from '@atlaskit/button/standard-button';
|
|
19
|
-
import { FormattedMessage, IntlProvider, injectIntl } from 'react-intl
|
|
19
|
+
import { FormattedMessage, IntlProvider, injectIntl } from 'react-intl';
|
|
20
20
|
import { Field, HelperMessage } from '@atlaskit/form';
|
|
21
21
|
import { fileToDataURI, dataURItoFile, messages } from '@atlaskit/media-ui';
|
|
22
22
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
@@ -15,7 +15,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
15
15
|
import React from 'react';
|
|
16
16
|
import { Component } from 'react';
|
|
17
17
|
import CrossIcon from '@atlaskit/icon/core/cross';
|
|
18
|
-
import { injectIntl } from 'react-intl
|
|
18
|
+
import { injectIntl } from 'react-intl';
|
|
19
19
|
import { messages, MediaImage } from '@atlaskit/media-ui';
|
|
20
20
|
import { isImageRemote } from './isImageRemote';
|
|
21
21
|
import { IconButton } from '@atlaskit/button/new';
|
|
@@ -14,7 +14,7 @@ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstruct
|
|
|
14
14
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
15
15
|
import React from 'react';
|
|
16
16
|
import { Component } from 'react';
|
|
17
|
-
import { FormattedMessage, injectIntl } from 'react-intl
|
|
17
|
+
import { FormattedMessage, injectIntl } from 'react-intl';
|
|
18
18
|
import Button from '@atlaskit/button/standard-button';
|
|
19
19
|
import ImageCropper from '../image-cropper';
|
|
20
20
|
import Spinner from '@atlaskit/spinner';
|
|
@@ -16,7 +16,7 @@ import { messages } from '@atlaskit/media-ui';
|
|
|
16
16
|
import ScaleLargeIcon from '@atlaskit/icon/core/image';
|
|
17
17
|
import ScaleSmallIcon from '@atlaskit/icon/core/image';
|
|
18
18
|
import Button from '@atlaskit/button/standard-button';
|
|
19
|
-
import { injectIntl } from 'react-intl
|
|
19
|
+
import { injectIntl } from 'react-intl';
|
|
20
20
|
export var defaultProps = {
|
|
21
21
|
value: 0
|
|
22
22
|
};
|
|
@@ -5,7 +5,7 @@ var _excluded = ["x", "y", "width", "height", "transform"];
|
|
|
5
5
|
import "./imageWrapper.compiled.css";
|
|
6
6
|
import * as React from 'react';
|
|
7
7
|
import { ax, ix } from "@compiled/react/runtime";
|
|
8
|
-
import { useIntl } from 'react-intl
|
|
8
|
+
import { useIntl } from 'react-intl';
|
|
9
9
|
import { messages } from '@atlaskit/media-ui';
|
|
10
10
|
var imageWrapperStyles = null;
|
|
11
11
|
export var ImageWrapper = function ImageWrapper(_ref) {
|
|
@@ -19,6 +19,7 @@ import { ImagePlacerImage } from './image';
|
|
|
19
19
|
import { Margin } from './margin';
|
|
20
20
|
import { initialiseImagePreview, renderImageAtCurrentView } from './imageProcessor';
|
|
21
21
|
import { zoomToFit as _zoomToFit, applyConstraints as _applyConstraints, transformVisibleBoundsToImageCoords as _transformVisibleBoundsToImageCoords } from './constraints';
|
|
22
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
23
|
import { ImagePlacerErrorWrapper } from './imagePlacerErrorWrapper';
|
|
23
24
|
import { isSSR } from '../util';
|
|
24
25
|
|
|
@@ -260,6 +261,12 @@ export var ImagePlacer = /*#__PURE__*/function (_React$Component) {
|
|
|
260
261
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
261
262
|
while (1) switch (_context.prev = _context.next) {
|
|
262
263
|
case 0:
|
|
264
|
+
if (!fg('platform_media_package_react19_lifecycle_fix')) {
|
|
265
|
+
_context.next = 2;
|
|
266
|
+
break;
|
|
267
|
+
}
|
|
268
|
+
return _context.abrupt("return");
|
|
269
|
+
case 2:
|
|
263
270
|
imageSourceRect = this.imageSourceRect, state = this.state, props = this.props;
|
|
264
271
|
zoom = state.zoom;
|
|
265
272
|
currentUseConstraints = props.useConstraints, currentContainerWidth = props.containerWidth, currentContainerHeight = props.containerHeight, currentMargin = props.margin, currentSrc = props.src;
|
|
@@ -288,34 +295,34 @@ export var ImagePlacer = /*#__PURE__*/function (_React$Component) {
|
|
|
288
295
|
this.updateZoomProp();
|
|
289
296
|
}
|
|
290
297
|
if (!(nextSrc instanceof File && nextSrc !== currentSrc)) {
|
|
291
|
-
_context.next =
|
|
298
|
+
_context.next = 20;
|
|
292
299
|
break;
|
|
293
300
|
}
|
|
294
|
-
_context.next =
|
|
301
|
+
_context.next = 19;
|
|
295
302
|
return getFileInfo(nextSrc);
|
|
296
|
-
case
|
|
303
|
+
case 19:
|
|
297
304
|
fileInfo = _context.sent;
|
|
298
|
-
case
|
|
305
|
+
case 20:
|
|
299
306
|
if (!(typeof nextSrc === 'string' && nextSrc !== currentSrc)) {
|
|
300
|
-
_context.next =
|
|
307
|
+
_context.next = 24;
|
|
301
308
|
break;
|
|
302
309
|
}
|
|
303
|
-
_context.next =
|
|
310
|
+
_context.next = 23;
|
|
304
311
|
return getFileInfoFromSrc(nextSrc);
|
|
305
|
-
case
|
|
312
|
+
case 23:
|
|
306
313
|
fileInfo = _context.sent;
|
|
307
|
-
case
|
|
314
|
+
case 24:
|
|
308
315
|
if (!fileInfo) {
|
|
309
|
-
_context.next =
|
|
316
|
+
_context.next = 27;
|
|
310
317
|
break;
|
|
311
318
|
}
|
|
312
|
-
_context.next =
|
|
319
|
+
_context.next = 27;
|
|
313
320
|
return this.preprocessFile(fileInfo);
|
|
314
|
-
case
|
|
321
|
+
case 27:
|
|
315
322
|
if (isImageAction) {
|
|
316
323
|
this.provideImageActions();
|
|
317
324
|
}
|
|
318
|
-
case
|
|
325
|
+
case 28:
|
|
319
326
|
case "end":
|
|
320
327
|
return _context.stop();
|
|
321
328
|
}
|
|
@@ -327,18 +334,101 @@ export var ImagePlacer = /*#__PURE__*/function (_React$Component) {
|
|
|
327
334
|
return UNSAFE_componentWillReceiveProps;
|
|
328
335
|
}())
|
|
329
336
|
}, {
|
|
330
|
-
key: "
|
|
337
|
+
key: "componentDidUpdate",
|
|
331
338
|
value: function () {
|
|
332
|
-
var
|
|
333
|
-
var
|
|
339
|
+
var _componentDidUpdate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(prevProps) {
|
|
340
|
+
var imageSourceRect, props, nextZoom, nextUseConstraints, nextContainerWidth, nextContainerHeight, nextMargin, nextSrc, nextOnImageActions, prevZoom, prevUseConstraints, prevContainerWidth, prevContainerHeight, prevMargin, prevSrc, prevOnImageActions, isZoomChange, isUseConstraintsChange, isContainerWidthChange, isContainerHeightChange, isMarginChange, isImageActionChange, zoomReset, fileInfo;
|
|
334
341
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
335
342
|
while (1) switch (_context2.prev = _context2.next) {
|
|
343
|
+
case 0:
|
|
344
|
+
if (fg('platform_media_package_react19_lifecycle_fix')) {
|
|
345
|
+
_context2.next = 2;
|
|
346
|
+
break;
|
|
347
|
+
}
|
|
348
|
+
return _context2.abrupt("return");
|
|
349
|
+
case 2:
|
|
350
|
+
imageSourceRect = this.imageSourceRect, props = this.props;
|
|
351
|
+
nextZoom = props.zoom, nextUseConstraints = props.useConstraints, nextContainerWidth = props.containerWidth, nextContainerHeight = props.containerHeight, nextMargin = props.margin, nextSrc = props.src, nextOnImageActions = props.onImageActions;
|
|
352
|
+
prevZoom = prevProps.zoom, prevUseConstraints = prevProps.useConstraints, prevContainerWidth = prevProps.containerWidth, prevContainerHeight = prevProps.containerHeight, prevMargin = prevProps.margin, prevSrc = prevProps.src, prevOnImageActions = prevProps.onImageActions;
|
|
353
|
+
isZoomChange = nextZoom !== prevZoom;
|
|
354
|
+
isUseConstraintsChange = nextUseConstraints !== undefined && nextUseConstraints !== prevUseConstraints;
|
|
355
|
+
isContainerWidthChange = nextContainerWidth !== undefined && nextContainerWidth !== prevContainerWidth;
|
|
356
|
+
isContainerHeightChange = nextContainerHeight !== undefined && nextContainerHeight !== prevContainerHeight;
|
|
357
|
+
isMarginChange = nextMargin !== undefined && nextMargin !== prevMargin;
|
|
358
|
+
isImageActionChange = nextOnImageActions !== prevOnImageActions;
|
|
359
|
+
zoomReset = {
|
|
360
|
+
zoom: 0
|
|
361
|
+
};
|
|
362
|
+
if (isZoomChange) {
|
|
363
|
+
this.setZoom(nextZoom);
|
|
364
|
+
}
|
|
365
|
+
if (isUseConstraintsChange) {
|
|
366
|
+
this.setState({
|
|
367
|
+
zoom: 0,
|
|
368
|
+
imageWidth: imageSourceRect.width,
|
|
369
|
+
imageHeight: imageSourceRect.height
|
|
370
|
+
}, this.update);
|
|
371
|
+
}
|
|
372
|
+
if (isContainerWidthChange || isContainerHeightChange || isMarginChange) {
|
|
373
|
+
this.setState(zoomReset, this.update);
|
|
374
|
+
this.updateZoomProp();
|
|
375
|
+
}
|
|
376
|
+
if (!(nextSrc !== prevSrc)) {
|
|
377
|
+
_context2.next = 27;
|
|
378
|
+
break;
|
|
379
|
+
}
|
|
380
|
+
if (!(nextSrc instanceof File)) {
|
|
381
|
+
_context2.next = 20;
|
|
382
|
+
break;
|
|
383
|
+
}
|
|
384
|
+
_context2.next = 19;
|
|
385
|
+
return getFileInfo(nextSrc);
|
|
386
|
+
case 19:
|
|
387
|
+
fileInfo = _context2.sent;
|
|
388
|
+
case 20:
|
|
389
|
+
if (!(typeof nextSrc === 'string')) {
|
|
390
|
+
_context2.next = 24;
|
|
391
|
+
break;
|
|
392
|
+
}
|
|
393
|
+
_context2.next = 23;
|
|
394
|
+
return getFileInfoFromSrc(nextSrc);
|
|
395
|
+
case 23:
|
|
396
|
+
fileInfo = _context2.sent;
|
|
397
|
+
case 24:
|
|
398
|
+
if (!fileInfo) {
|
|
399
|
+
_context2.next = 27;
|
|
400
|
+
break;
|
|
401
|
+
}
|
|
402
|
+
_context2.next = 27;
|
|
403
|
+
return this.preprocessFile(fileInfo);
|
|
404
|
+
case 27:
|
|
405
|
+
if (isImageActionChange) {
|
|
406
|
+
this.provideImageActions();
|
|
407
|
+
}
|
|
408
|
+
case 28:
|
|
409
|
+
case "end":
|
|
410
|
+
return _context2.stop();
|
|
411
|
+
}
|
|
412
|
+
}, _callee2, this);
|
|
413
|
+
}));
|
|
414
|
+
function componentDidUpdate(_x2) {
|
|
415
|
+
return _componentDidUpdate.apply(this, arguments);
|
|
416
|
+
}
|
|
417
|
+
return componentDidUpdate;
|
|
418
|
+
}()
|
|
419
|
+
}, {
|
|
420
|
+
key: "preprocessFile",
|
|
421
|
+
value: function () {
|
|
422
|
+
var _preprocessFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(fileInfo) {
|
|
423
|
+
var maxZoom, previewInfo, width, height;
|
|
424
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
425
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
336
426
|
case 0:
|
|
337
427
|
maxZoom = this.props.maxZoom;
|
|
338
|
-
|
|
428
|
+
_context3.next = 3;
|
|
339
429
|
return initialiseImagePreview(fileInfo, this.containerRect, maxZoom);
|
|
340
430
|
case 3:
|
|
341
|
-
previewInfo =
|
|
431
|
+
previewInfo = _context3.sent;
|
|
342
432
|
if (previewInfo) {
|
|
343
433
|
width = previewInfo.width, height = previewInfo.height;
|
|
344
434
|
this.imageSourceRect = new Rectangle(width, height);
|
|
@@ -351,11 +441,11 @@ export var ImagePlacer = /*#__PURE__*/function (_React$Component) {
|
|
|
351
441
|
}
|
|
352
442
|
case 5:
|
|
353
443
|
case "end":
|
|
354
|
-
return
|
|
444
|
+
return _context3.stop();
|
|
355
445
|
}
|
|
356
|
-
},
|
|
446
|
+
}, _callee3, this);
|
|
357
447
|
}));
|
|
358
|
-
function preprocessFile(
|
|
448
|
+
function preprocessFile(_x3) {
|
|
359
449
|
return _preprocessFile.apply(this, arguments);
|
|
360
450
|
}
|
|
361
451
|
return preprocessFile;
|
|
@@ -5,7 +5,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
5
5
|
import { AvatarList } from '../avatar-list';
|
|
6
6
|
import EditorMoreIcon from '@atlaskit/icon/core/show-more-horizontal';
|
|
7
7
|
import Button from '@atlaskit/button/standard-button';
|
|
8
|
-
import { useIntl } from 'react-intl
|
|
8
|
+
import { useIntl } from 'react-intl';
|
|
9
9
|
import { messages } from '@atlaskit/media-ui';
|
|
10
10
|
import { forwardRef } from 'react';
|
|
11
11
|
var predefinedAvatarsWrapperStyles = null;
|
|
@@ -6,7 +6,7 @@ import * as React from 'react';
|
|
|
6
6
|
import { ax, ix } from "@compiled/react/runtime";
|
|
7
7
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
8
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
|
-
import { FormattedMessage, useIntl } from 'react-intl
|
|
9
|
+
import { FormattedMessage, useIntl } from 'react-intl';
|
|
10
10
|
import { messages } from '@atlaskit/media-ui';
|
|
11
11
|
import ArrowLeftIcon from '@atlaskit/icon/core/arrow-left';
|
|
12
12
|
import Button from '@atlaskit/button/standard-button';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { PureComponent } from 'react';
|
|
7
|
-
import { type MessageDescriptor, type WrappedComponentProps } from 'react-intl
|
|
7
|
+
import { type MessageDescriptor, type WrappedComponentProps } from 'react-intl';
|
|
8
8
|
import { type Avatar } from '../avatar-list';
|
|
9
9
|
import { type CropProperties } from '../image-navigator';
|
|
10
10
|
import { type LoadParameters } from '../image-navigator/index';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Component } from 'react';
|
|
3
|
-
import { type WrappedComponentProps } from 'react-intl
|
|
3
|
+
import { type WrappedComponentProps } from 'react-intl';
|
|
4
4
|
export interface ImageCropperProp {
|
|
5
5
|
imageSource: string;
|
|
6
6
|
containerSize?: number;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { Component } from 'react';
|
|
7
|
-
import { type WrappedComponentProps } from 'react-intl
|
|
7
|
+
import { type WrappedComponentProps } from 'react-intl';
|
|
8
8
|
import { Vector2 } from '@atlaskit/media-ui';
|
|
9
9
|
import { Viewport } from '../viewport';
|
|
10
10
|
export declare const AVATAR_DIALOG_WIDTH = 375;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, type ComponentType, type FC } from 'react';
|
|
2
|
-
import type { WithIntlProps, WrappedComponentProps } from 'react-intl
|
|
2
|
+
import type { WithIntlProps, WrappedComponentProps } from 'react-intl';
|
|
3
3
|
export interface SliderProps {
|
|
4
4
|
value: number;
|
|
5
5
|
onChange: (value: number) => void;
|
|
@@ -82,6 +82,7 @@ export declare class ImagePlacer extends React.Component<ImagePlacerProps, Image
|
|
|
82
82
|
constructor(props: ImagePlacerProps);
|
|
83
83
|
private provideImageActions;
|
|
84
84
|
UNSAFE_componentWillReceiveProps(nextProps: ImagePlacerProps): Promise<void>;
|
|
85
|
+
componentDidUpdate(prevProps: ImagePlacerProps): Promise<void>;
|
|
85
86
|
preprocessFile(fileInfo: FileInfo): Promise<void>;
|
|
86
87
|
setSrc(fileInfo: FileInfo): void;
|
|
87
88
|
private updateZoomProp;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { PureComponent } from 'react';
|
|
7
|
-
import { type MessageDescriptor, type WrappedComponentProps } from 'react-intl
|
|
7
|
+
import { type MessageDescriptor, type WrappedComponentProps } from 'react-intl';
|
|
8
8
|
import { type Avatar } from '../avatar-list';
|
|
9
9
|
import { type CropProperties } from '../image-navigator';
|
|
10
10
|
import { type LoadParameters } from '../image-navigator/index';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Component } from 'react';
|
|
3
|
-
import { type WrappedComponentProps } from 'react-intl
|
|
3
|
+
import { type WrappedComponentProps } from 'react-intl';
|
|
4
4
|
export interface ImageCropperProp {
|
|
5
5
|
imageSource: string;
|
|
6
6
|
containerSize?: number;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { Component } from 'react';
|
|
7
|
-
import { type WrappedComponentProps } from 'react-intl
|
|
7
|
+
import { type WrappedComponentProps } from 'react-intl';
|
|
8
8
|
import { Vector2 } from '@atlaskit/media-ui';
|
|
9
9
|
import { Viewport } from '../viewport';
|
|
10
10
|
export declare const AVATAR_DIALOG_WIDTH = 375;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Component, type ComponentType, type FC } from 'react';
|
|
2
|
-
import type { WithIntlProps, WrappedComponentProps } from 'react-intl
|
|
2
|
+
import type { WithIntlProps, WrappedComponentProps } from 'react-intl';
|
|
3
3
|
export interface SliderProps {
|
|
4
4
|
value: number;
|
|
5
5
|
onChange: (value: number) => void;
|
|
@@ -82,6 +82,7 @@ export declare class ImagePlacer extends React.Component<ImagePlacerProps, Image
|
|
|
82
82
|
constructor(props: ImagePlacerProps);
|
|
83
83
|
private provideImageActions;
|
|
84
84
|
UNSAFE_componentWillReceiveProps(nextProps: ImagePlacerProps): Promise<void>;
|
|
85
|
+
componentDidUpdate(prevProps: ImagePlacerProps): Promise<void>;
|
|
85
86
|
preprocessFile(fileInfo: FileInfo): Promise<void>;
|
|
86
87
|
setSrc(fileInfo: FileInfo): void;
|
|
87
88
|
private updateZoomProp;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-avatar-picker",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "27.0.1",
|
|
4
4
|
"description": "A component to select, drag and resize image avatars. It also provides a default list of predefined avatars.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -35,9 +35,10 @@
|
|
|
35
35
|
"@atlaskit/css": "^0.19.0",
|
|
36
36
|
"@atlaskit/flag": "^17.9.0",
|
|
37
37
|
"@atlaskit/form": "^15.5.0",
|
|
38
|
-
"@atlaskit/icon": "^34.
|
|
39
|
-
"@atlaskit/media-ui": "^
|
|
40
|
-
"@atlaskit/modal-dialog": "^14.
|
|
38
|
+
"@atlaskit/icon": "^34.2.0",
|
|
39
|
+
"@atlaskit/media-ui": "^29.0.0",
|
|
40
|
+
"@atlaskit/modal-dialog": "^14.16.0",
|
|
41
|
+
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
41
42
|
"@atlaskit/primitives": "^19.0.0",
|
|
42
43
|
"@atlaskit/range": "^10.0.0",
|
|
43
44
|
"@atlaskit/spinner": "^19.1.0",
|
|
@@ -52,11 +53,11 @@
|
|
|
52
53
|
"peerDependencies": {
|
|
53
54
|
"@emotion/react": "^11.7.1",
|
|
54
55
|
"react": "^18.2.0",
|
|
55
|
-
"react-intl
|
|
56
|
+
"react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
58
59
|
"@atlaskit/media-core": "^37.0.0",
|
|
59
|
-
"@atlaskit/media-test-helpers": "^
|
|
60
|
+
"@atlaskit/media-test-helpers": "^41.0.0",
|
|
60
61
|
"@atlassian/a11y-jest-testing": "^0.11.0",
|
|
61
62
|
"@testing-library/react": "^16.3.0",
|
|
62
63
|
"@testing-library/user-event": "^14.4.3",
|
|
@@ -65,7 +66,12 @@
|
|
|
65
66
|
"enzyme": "^3.10.0",
|
|
66
67
|
"react": "^18.2.0",
|
|
67
68
|
"react-dom": "^18.2.0",
|
|
68
|
-
"react-intl
|
|
69
|
+
"react-intl": "^6.6.2"
|
|
70
|
+
},
|
|
71
|
+
"platform-feature-flags": {
|
|
72
|
+
"platform_media_package_react19_lifecycle_fix": {
|
|
73
|
+
"type": "boolean"
|
|
74
|
+
}
|
|
69
75
|
},
|
|
70
76
|
"techstack": {
|
|
71
77
|
"@repo/internal": {
|
package/report.api.md
CHANGED