@atlaskit/media-avatar-picker 28.2.0 → 28.3.0

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.
Files changed (65) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/cjs/avatar-list/index.js +3 -3
  3. package/dist/cjs/avatar-picker-dialog/SRLiveTitle.js +2 -2
  4. package/dist/cjs/avatar-picker-dialog/SubmitErrorDialog.js +2 -2
  5. package/dist/cjs/avatar-picker-dialog/custom-spinner.js +2 -2
  6. package/dist/cjs/avatar-picker-dialog/index.js +14 -12
  7. package/dist/cjs/avatar-picker-dialog/layout-const.js +2 -2
  8. package/dist/cjs/image-cropper/crop-to-data-uri.js +2 -2
  9. package/dist/cjs/image-cropper/index.js +10 -9
  10. package/dist/cjs/image-navigator/index.js +19 -13
  11. package/dist/cjs/image-navigator/slider.js +4 -4
  12. package/dist/cjs/image-placer/constraints.js +6 -5
  13. package/dist/cjs/image-placer/container.js +5 -5
  14. package/dist/cjs/image-placer/imageProcessor.js +6 -4
  15. package/dist/cjs/image-placer/imageWrapper.js +2 -2
  16. package/dist/cjs/image-placer/index.js +19 -14
  17. package/dist/cjs/predefined-avatar-list/index.js +2 -2
  18. package/dist/cjs/predefined-avatar-view/index.js +4 -4
  19. package/dist/cjs/viewport/viewport.js +20 -18
  20. package/dist/es2019/avatar-list/index.js +1 -1
  21. package/dist/es2019/avatar-picker-dialog/SRLiveTitle.js +1 -1
  22. package/dist/es2019/avatar-picker-dialog/SubmitErrorDialog.js +1 -1
  23. package/dist/es2019/avatar-picker-dialog/custom-spinner.js +1 -1
  24. package/dist/es2019/avatar-picker-dialog/index.js +3 -1
  25. package/dist/es2019/avatar-picker-dialog/layout-const.js +1 -1
  26. package/dist/es2019/image-cropper/crop-to-data-uri.js +1 -1
  27. package/dist/es2019/image-cropper/index.js +2 -1
  28. package/dist/es2019/image-navigator/index.js +7 -1
  29. package/dist/es2019/image-navigator/slider.js +1 -1
  30. package/dist/es2019/image-placer/constraints.js +2 -1
  31. package/dist/es2019/image-placer/container.js +1 -1
  32. package/dist/es2019/image-placer/imageProcessor.js +3 -1
  33. package/dist/es2019/image-placer/imageWrapper.js +1 -1
  34. package/dist/es2019/image-placer/index.js +6 -1
  35. package/dist/es2019/predefined-avatar-list/index.js +1 -1
  36. package/dist/es2019/predefined-avatar-view/index.js +1 -1
  37. package/dist/es2019/viewport/viewport.js +3 -1
  38. package/dist/esm/avatar-list/index.js +1 -1
  39. package/dist/esm/avatar-picker-dialog/SRLiveTitle.js +1 -1
  40. package/dist/esm/avatar-picker-dialog/SubmitErrorDialog.js +1 -1
  41. package/dist/esm/avatar-picker-dialog/custom-spinner.js +1 -1
  42. package/dist/esm/avatar-picker-dialog/index.js +3 -1
  43. package/dist/esm/avatar-picker-dialog/layout-const.js +1 -1
  44. package/dist/esm/image-cropper/crop-to-data-uri.js +1 -1
  45. package/dist/esm/image-cropper/index.js +2 -1
  46. package/dist/esm/image-navigator/index.js +7 -1
  47. package/dist/esm/image-navigator/slider.js +1 -1
  48. package/dist/esm/image-placer/constraints.js +2 -1
  49. package/dist/esm/image-placer/container.js +1 -1
  50. package/dist/esm/image-placer/imageProcessor.js +3 -1
  51. package/dist/esm/image-placer/imageWrapper.js +1 -1
  52. package/dist/esm/image-placer/index.js +6 -1
  53. package/dist/esm/predefined-avatar-list/index.js +1 -1
  54. package/dist/esm/predefined-avatar-view/index.js +1 -1
  55. package/dist/esm/viewport/viewport.js +3 -1
  56. package/dist/types/avatar-picker-dialog/layout-const.d.ts +1 -1
  57. package/dist/types/image-navigator/index.d.ts +1 -1
  58. package/dist/types/image-placer/constraints.d.ts +3 -1
  59. package/dist/types/image-placer/container.d.ts +1 -1
  60. package/dist/types/image-placer/imageProcessor.d.ts +3 -1
  61. package/dist/types/image-placer/index.d.ts +4 -1
  62. package/dist/types/viewport/viewport.d.ts +3 -1
  63. package/example-helpers/viewport-debug.ts +1 -1
  64. package/package.json +20 -20
  65. package/report.api.md +0 -144
@@ -1,6 +1,8 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
- import { Rectangle, loadImage, getOrientation } from '@atlaskit/media-ui';
3
+ import { Rectangle } from '@atlaskit/media-ui/rectangle';
4
+ import { loadImage } from '@atlaskit/media-ui/loadImage';
5
+ import { getOrientation } from '@atlaskit/media-ui/imageMetaData/getOrientation';
4
6
  import { getCanvas } from '../util';
5
7
  export function radians(deg) {
6
8
  return deg * (Math.PI / 180);
@@ -6,7 +6,7 @@ import "./imageWrapper.compiled.css";
6
6
  import * as React from 'react';
7
7
  import { ax, ix } from "@compiled/react/runtime";
8
8
  import { useIntl } from 'react-intl';
9
- import { messages } from '@atlaskit/media-ui';
9
+ import { messages } from '@atlaskit/media-ui/messages';
10
10
  var imageWrapperStyles = null;
11
11
  export var ImageWrapper = function ImageWrapper(_ref) {
12
12
  var x = _ref.x,
@@ -12,7 +12,12 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
12
12
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
13
13
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
14
14
  import React from 'react';
15
- import { Rectangle, Vector2, Bounds, dataURItoFile, getFileInfo, getFileInfoFromSrc } from '@atlaskit/media-ui';
15
+ import { Rectangle } from '@atlaskit/media-ui/rectangle';
16
+ import { Vector2 } from '@atlaskit/media-ui/vector2';
17
+ import { Bounds } from '@atlaskit/media-ui/bounds';
18
+ import { dataURItoFile } from '@atlaskit/media-ui/dataURItoFile';
19
+ import { getFileInfo } from '@atlaskit/media-ui/getFileInfo';
20
+ import { getFileInfoFromSrc } from '@atlaskit/media-ui/getFileInfoFromSrc';
16
21
  import { ImagePlacerContainer } from './container';
17
22
  import { ImagePlacerImage } from './image';
18
23
  import { Margin } from './margin';
@@ -6,7 +6,7 @@ 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
8
  import { useIntl } from 'react-intl';
9
- import { messages } from '@atlaskit/media-ui';
9
+ import { messages } from '@atlaskit/media-ui/messages';
10
10
  import { forwardRef } from 'react';
11
11
  var predefinedAvatarsWrapperStyles = null;
12
12
  var showMoreButtonStyles = null;
@@ -7,7 +7,7 @@ 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
9
  import { FormattedMessage, useIntl } from 'react-intl';
10
- import { messages } from '@atlaskit/media-ui';
10
+ import { messages } from '@atlaskit/media-ui/messages';
11
11
  import ArrowLeftIcon from '@atlaskit/icon/core/arrow-left';
12
12
  import Button from '@atlaskit/button/standard-button';
13
13
  import { forwardRef, useState } from 'react';
@@ -1,7 +1,9 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- import { Rectangle, Bounds, Vector2 } from '@atlaskit/media-ui';
4
+ import { Rectangle } from '@atlaskit/media-ui/rectangle';
5
+ import { Bounds } from '@atlaskit/media-ui/bounds';
6
+ import { Vector2 } from '@atlaskit/media-ui/vector2';
5
7
 
6
8
  /**
7
9
  * maximum amount to allow scaling up from "100%"
@@ -1,4 +1,4 @@
1
- import { Rectangle } from '@atlaskit/media-ui';
1
+ import { Rectangle } from '@atlaskit/media-ui/rectangle';
2
2
  export declare const DEFAULT_VISIBLE_PREDEFINED_AVATARS = 5;
3
3
  export declare const AVATAR_DIALOG_WIDTH = 375;
4
4
  export declare const AVATAR_DIALOG_HEIGHT = 470;
@@ -5,7 +5,7 @@
5
5
  import React from 'react';
6
6
  import { Component } from 'react';
7
7
  import { type WrappedComponentProps } from 'react-intl';
8
- import { Vector2 } from '@atlaskit/media-ui';
8
+ import { Vector2 } from '@atlaskit/media-ui/vector2';
9
9
  import { Viewport } from '../viewport';
10
10
  export declare const AVATAR_DIALOG_WIDTH = 375;
11
11
  export interface LoadParameters {
@@ -1,4 +1,6 @@
1
- import { Rectangle, type Bounds, Vector2 } from '@atlaskit/media-ui';
1
+ import { Rectangle } from '@atlaskit/media-ui/rectangle';
2
+ import type { Bounds } from '@atlaskit/media-ui/bounds';
3
+ import { Vector2 } from '@atlaskit/media-ui/vector2';
2
4
  export declare function zoomToFit(imageWidth: number, imageHeight: number, visibleBounds: Bounds): Rectangle;
3
5
  export declare function applyConstraints(useConstraints: boolean, imageBounds: Bounds, visibleBounds: Bounds): Vector2;
4
6
  export declare function applyFullConstraints(imageBounds: Bounds, visibleBounds: Bounds): Vector2;
@@ -3,7 +3,7 @@
3
3
  * This way, you can still move the image without clicking directly on it.
4
4
  */
5
5
  import React from 'react';
6
- import { Vector2 } from '@atlaskit/media-ui';
6
+ import { Vector2 } from '@atlaskit/media-ui/vector2';
7
7
  export interface ImagePlacerContainerProps {
8
8
  children?: React.ReactNode;
9
9
  width: number;
@@ -1,4 +1,6 @@
1
- import { Rectangle, type Bounds, type FileInfo } from '@atlaskit/media-ui';
1
+ import { Rectangle } from '@atlaskit/media-ui/rectangle';
2
+ import type { Bounds } from '@atlaskit/media-ui/bounds';
3
+ import type { FileInfo } from '@atlaskit/media-ui/imageMetaData/types';
2
4
  export declare function radians(deg: number): number;
3
5
  export interface ViewInfo {
4
6
  containerRect: Rectangle;
@@ -1,5 +1,8 @@
1
1
  import React from 'react';
2
- import { Rectangle, Vector2, Bounds, type FileInfo } from '@atlaskit/media-ui';
2
+ import { Rectangle } from '@atlaskit/media-ui/rectangle';
3
+ import { Vector2 } from '@atlaskit/media-ui/vector2';
4
+ import { Bounds } from '@atlaskit/media-ui/bounds';
5
+ import type { FileInfo } from '@atlaskit/media-ui/imageMetaData/types';
3
6
  export interface ImageActions {
4
7
  toCanvas: () => HTMLCanvasElement;
5
8
  toDataURL: () => string;
@@ -1,4 +1,6 @@
1
- import { Rectangle, Bounds, Vector2 } from '@atlaskit/media-ui';
1
+ import { Rectangle } from '@atlaskit/media-ui/rectangle';
2
+ import { Bounds } from '@atlaskit/media-ui/bounds';
3
+ import { Vector2 } from '@atlaskit/media-ui/vector2';
2
4
  /**
3
5
  * maximum amount to allow scaling up from "100%"
4
6
  * - when the image is smaller than the view size, "100%" is the view size
@@ -1,4 +1,4 @@
1
- import { Bounds } from '@atlaskit/media-ui';
1
+ import { Bounds } from '@atlaskit/media-ui/bounds';
2
2
  import { type Viewport } from '../src/viewport/viewport';
3
3
  import { renderViewport } from '../src/viewport/viewport-render';
4
4
  import { viewport as instance } from '../src/image-navigator';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-avatar-picker",
3
- "version": "28.2.0",
3
+ "version": "28.3.0",
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/"
@@ -30,21 +30,21 @@
30
30
  }
31
31
  },
32
32
  "dependencies": {
33
- "@atlaskit/button": "^25.2.0",
34
- "@atlaskit/css": "^1.0.0",
35
- "@atlaskit/flag": "^18.4.0",
36
- "@atlaskit/form": "^17.1.0",
37
- "@atlaskit/icon": "^37.5.0",
38
- "@atlaskit/media-ui": "^30.12.0",
39
- "@atlaskit/modal-dialog": "^16.5.0",
40
- "@atlaskit/platform-feature-flags": "^2.1.0",
41
- "@atlaskit/primitives": "^22.4.0",
42
- "@atlaskit/range": "^12.1.0",
33
+ "@atlaskit/button": "^25.3.0",
34
+ "@atlaskit/css": "^1.1.0",
35
+ "@atlaskit/flag": "^18.5.0",
36
+ "@atlaskit/form": "^17.2.0",
37
+ "@atlaskit/icon": "^37.6.0",
38
+ "@atlaskit/media-ui": "^30.15.0",
39
+ "@atlaskit/modal-dialog": "^16.6.0",
40
+ "@atlaskit/platform-feature-flags": "^2.2.0",
41
+ "@atlaskit/primitives": "^22.5.0",
42
+ "@atlaskit/range": "^12.2.0",
43
43
  "@atlaskit/react-compiler-gating": "^0.2.0",
44
- "@atlaskit/spinner": "^20.3.0",
45
- "@atlaskit/textfield": "^10.1.0",
46
- "@atlaskit/tokens": "^16.8.0",
47
- "@atlaskit/visually-hidden": "^4.3.0",
44
+ "@atlaskit/spinner": "^20.4.0",
45
+ "@atlaskit/textfield": "^10.2.0",
46
+ "@atlaskit/tokens": "^16.10.0",
47
+ "@atlaskit/visually-hidden": "^4.4.0",
48
48
  "@babel/runtime": "^7.0.0",
49
49
  "@compiled/react": "^1.0.2",
50
50
  "exenv": "^1.2.2",
@@ -56,11 +56,11 @@
56
56
  "react-intl": "^5.25.1 || ^6.0.0 || ^7.0.0"
57
57
  },
58
58
  "devDependencies": {
59
- "@atlaskit/media-core": "^38.0.0",
60
- "@atlaskit/media-test-helpers": "^42.3.0",
61
- "@atlaskit/page": "^15.2.0",
62
- "@atlassian/a11y-jest-testing": "^0.16.0",
63
- "@atlassian/feature-flags-test-utils": "^1.2.0",
59
+ "@atlaskit/media-core": "^38.2.0",
60
+ "@atlaskit/media-test-helpers": "^42.4.0",
61
+ "@atlaskit/page": "^15.3.0",
62
+ "@atlassian/a11y-jest-testing": "^0.17.0",
63
+ "@atlassian/feature-flags-test-utils": "^1.3.0",
64
64
  "@atlassian/testing-library": "^0.11.0",
65
65
  "@testing-library/react": "^16.3.0",
66
66
  "@testing-library/user-event": "^14.4.3",
package/report.api.md DELETED
@@ -1,144 +0,0 @@
1
- <!-- API Report Version: 2.3 -->
2
-
3
- ## API Report File for "@atlaskit/media-avatar-picker"
4
-
5
- > Do not edit this file. This report is auto-generated using
6
- > [API Extractor](https://api-extractor.com/).
7
- > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
8
-
9
- ### Table of contents
10
-
11
- - [Main Entry Types](#main-entry-types)
12
- - [Peer Dependencies](#peer-dependencies)
13
-
14
- ### Main Entry Types
15
-
16
- <!--SECTION START: Main Entry Types-->
17
-
18
- ```ts
19
- import { default as React_2 } from 'react';
20
- import { ReactNode } from 'react';
21
-
22
- // @public (undocumented)
23
- export type AsyncAvatarPickerDialogProps = AvatarPickerDialogProps & {
24
- placeholder?: ReactNode;
25
- };
26
-
27
- // @public (undocumented)
28
- interface AsyncAvatarPickerDialogState {
29
- // (undocumented)
30
- AvatarPickerDialog?: typeof _default;
31
- }
32
-
33
- // @public (undocumented)
34
- export interface Avatar {
35
- // (undocumented)
36
- dataURI: string;
37
- // (undocumented)
38
- name?: string;
39
- }
40
-
41
- // @public (undocumented)
42
- export class AvatarPickerDialog extends React_2.PureComponent<
43
- AsyncAvatarPickerDialogProps,
44
- AsyncAvatarPickerDialogState
45
- > {
46
- // (undocumented)
47
- static AvatarPickerDialog?: typeof _default;
48
- // (undocumented)
49
- static displayName: string;
50
- // (undocumented)
51
- render(): {};
52
- // (undocumented)
53
- state: {
54
- AvatarPickerDialog: React_2.FC<AvatarPickerDialogProps> | undefined;
55
- };
56
- // (undocumented)
57
- UNSAFE_componentWillMount(): Promise<void>;
58
- }
59
-
60
- // @public (undocumented)
61
- interface AvatarPickerDialogProps {
62
- avatars: Array<Avatar>;
63
- defaultSelectedAvatar?: Avatar;
64
- errorMessage?: string;
65
- imageSource?: string;
66
- isLoading?: boolean;
67
- maxImageSize?: number;
68
- onAvatarPicked: (avatar: Avatar) => void;
69
- onCancel: () => void;
70
- onImagePicked?: (file: File, crop: CropProperties) => void;
71
- onImagePickedDataURI?: (dataUri: string) => void;
72
- outputSize?: number;
73
- predefinedAvatarsText?: string;
74
- primaryButtonText?: string;
75
- title?: string;
76
- }
77
-
78
- // @public (undocumented)
79
- interface CropProperties {
80
- // (undocumented)
81
- size: number;
82
- // (undocumented)
83
- x: number;
84
- // (undocumented)
85
- y: number;
86
- }
87
-
88
- // @public (undocumented)
89
- const _default: React_2.FC<AvatarPickerDialogProps>;
90
-
91
- // @public (undocumented)
92
- export const ImageNavigator: React_2.FC<ImageNavigatorProps>;
93
-
94
- // @public (undocumented)
95
- export interface ImageNavigatorProps {
96
- // (undocumented)
97
- errorMessage?: string;
98
- // (undocumented)
99
- imageSource?: string;
100
- // (undocumented)
101
- isLoading?: boolean;
102
- // (undocumented)
103
- maxImageSize?: number;
104
- // (undocumented)
105
- onCropChanged?: (x: number, y: number, size: number) => void;
106
- // (undocumented)
107
- onImageError: (errorMessage: string) => void;
108
- // (undocumented)
109
- onImageLoaded: (file: File) => void;
110
- // (undocumented)
111
- onImageUploaded: (file: File) => void;
112
- // (undocumented)
113
- onLoad?: OnLoadHandler;
114
- // (undocumented)
115
- onRemoveImage: () => void;
116
- }
117
-
118
- // @public (undocumented)
119
- export interface LoadParameters {
120
- // (undocumented)
121
- export: (outputSize?: number) => string;
122
- }
123
-
124
- // @public (undocumented)
125
- export type OnLoadHandler = (params: LoadParameters) => void;
126
-
127
- // (No @packageDocumentation comment for this package)
128
- ```
129
-
130
- <!--SECTION END: Main Entry Types-->
131
-
132
- ### Peer Dependencies
133
-
134
- <!--SECTION START: Peer Dependencies-->
135
-
136
- ```json
137
- {
138
- "@emotion/react": "^11.7.1",
139
- "react": "^16.8.0",
140
- "react-intl": "npm:react-intl@^5.18.1"
141
- }
142
- ```
143
-
144
- <!--SECTION END: Peer Dependencies-->