@atlaskit/media-avatar-picker 28.1.10 → 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.
- package/CHANGELOG.md +31 -0
- package/dist/cjs/avatar-list/index.js +4 -4
- package/dist/cjs/avatar-picker-dialog/SRLiveTitle.js +2 -2
- package/dist/cjs/avatar-picker-dialog/SubmitErrorDialog.js +3 -3
- package/dist/cjs/avatar-picker-dialog/custom-spinner.js +2 -2
- package/dist/cjs/avatar-picker-dialog/index.js +27 -20
- package/dist/cjs/avatar-picker-dialog/layout-const.js +2 -2
- package/dist/cjs/image-cropper/crop-to-data-uri.js +2 -2
- package/dist/cjs/image-cropper/index.js +12 -11
- package/dist/cjs/image-navigator/index.js +20 -14
- package/dist/cjs/image-navigator/slider.js +5 -5
- package/dist/cjs/image-placer/constraints.js +6 -5
- package/dist/cjs/image-placer/container.js +5 -5
- package/dist/cjs/image-placer/imageProcessor.js +6 -4
- package/dist/cjs/image-placer/imageWrapper.js +2 -2
- package/dist/cjs/image-placer/index.js +19 -14
- package/dist/cjs/predefined-avatar-list/index.js +2 -2
- package/dist/cjs/predefined-avatar-view/index.js +4 -4
- package/dist/cjs/viewport/viewport.js +20 -18
- package/dist/es2019/avatar-list/index.js +2 -2
- package/dist/es2019/avatar-picker-dialog/SRLiveTitle.js +1 -1
- package/dist/es2019/avatar-picker-dialog/SubmitErrorDialog.js +2 -2
- package/dist/es2019/avatar-picker-dialog/custom-spinner.js +1 -1
- package/dist/es2019/avatar-picker-dialog/index.js +11 -4
- package/dist/es2019/avatar-picker-dialog/layout-const.js +1 -1
- package/dist/es2019/image-cropper/crop-to-data-uri.js +1 -1
- package/dist/es2019/image-cropper/index.js +3 -2
- package/dist/es2019/image-navigator/index.js +8 -2
- package/dist/es2019/image-navigator/slider.js +2 -2
- package/dist/es2019/image-placer/constraints.js +2 -1
- package/dist/es2019/image-placer/container.js +1 -1
- package/dist/es2019/image-placer/imageProcessor.js +3 -1
- package/dist/es2019/image-placer/imageWrapper.js +1 -1
- package/dist/es2019/image-placer/index.js +6 -1
- package/dist/es2019/predefined-avatar-list/index.js +1 -1
- package/dist/es2019/predefined-avatar-view/index.js +1 -1
- package/dist/es2019/viewport/viewport.js +3 -1
- package/dist/esm/avatar-list/index.js +2 -2
- package/dist/esm/avatar-picker-dialog/SRLiveTitle.js +1 -1
- package/dist/esm/avatar-picker-dialog/SubmitErrorDialog.js +2 -2
- package/dist/esm/avatar-picker-dialog/custom-spinner.js +1 -1
- package/dist/esm/avatar-picker-dialog/index.js +11 -4
- package/dist/esm/avatar-picker-dialog/layout-const.js +1 -1
- package/dist/esm/image-cropper/crop-to-data-uri.js +1 -1
- package/dist/esm/image-cropper/index.js +3 -2
- package/dist/esm/image-navigator/index.js +8 -2
- package/dist/esm/image-navigator/slider.js +2 -2
- package/dist/esm/image-placer/constraints.js +2 -1
- package/dist/esm/image-placer/container.js +1 -1
- package/dist/esm/image-placer/imageProcessor.js +3 -1
- package/dist/esm/image-placer/imageWrapper.js +1 -1
- package/dist/esm/image-placer/index.js +6 -1
- package/dist/esm/predefined-avatar-list/index.js +1 -1
- package/dist/esm/predefined-avatar-view/index.js +1 -1
- package/dist/esm/viewport/viewport.js +3 -1
- package/dist/types/avatar-picker-dialog/layout-const.d.ts +1 -1
- package/dist/types/image-navigator/index.d.ts +1 -1
- package/dist/types/image-placer/constraints.d.ts +3 -1
- package/dist/types/image-placer/container.d.ts +1 -1
- package/dist/types/image-placer/imageProcessor.d.ts +3 -1
- package/dist/types/image-placer/index.d.ts +4 -1
- package/dist/types/viewport/viewport.d.ts +3 -1
- package/example-helpers/StatefulAvatarPickerDialog.tsx +1 -1
- package/example-helpers/viewport-debug.ts +1 -1
- package/package.json +21 -20
- package/media-avatar-picker.docs.tsx +0 -71
- package/report.api.md +0 -144
|
@@ -16,9 +16,10 @@ import React from 'react';
|
|
|
16
16
|
import { Component } from 'react';
|
|
17
17
|
import CrossIcon from '@atlaskit/icon/core/cross';
|
|
18
18
|
import { injectIntl } from 'react-intl';
|
|
19
|
-
import { messages
|
|
19
|
+
import { messages } from '@atlaskit/media-ui/messages';
|
|
20
|
+
import { MediaImage } from '@atlaskit/media-ui/mediaImage';
|
|
20
21
|
import { isImageRemote } from './isImageRemote';
|
|
21
|
-
import
|
|
22
|
+
import IconButton from '@atlaskit/button/icon/button';
|
|
22
23
|
import { Box } from '@atlaskit/primitives/compiled';
|
|
23
24
|
import { cx } from '@atlaskit/css';
|
|
24
25
|
import { ERROR } from '../avatar-picker-dialog';
|
|
@@ -17,8 +17,14 @@ import { Component } from 'react';
|
|
|
17
17
|
import { FormattedMessage, injectIntl } from 'react-intl';
|
|
18
18
|
import Button from '@atlaskit/button/standard-button';
|
|
19
19
|
import ImageCropper from '../image-cropper';
|
|
20
|
-
import Spinner from '@atlaskit/spinner';
|
|
21
|
-
import { fileToDataURI
|
|
20
|
+
import Spinner from '@atlaskit/spinner/spinner';
|
|
21
|
+
import { fileToDataURI } from '@atlaskit/media-ui/fileToDataURI';
|
|
22
|
+
import { dataURItoFile } from '@atlaskit/media-ui/dataURItoFile';
|
|
23
|
+
import { getOrientation } from '@atlaskit/media-ui/imageMetaData/getOrientation';
|
|
24
|
+
import { isRotated } from '@atlaskit/media-ui/imageMetaData/isRotated';
|
|
25
|
+
import { Ellipsify } from '@atlaskit/media-ui/ellipsify/ellipsify';
|
|
26
|
+
import { Vector2 } from '@atlaskit/media-ui/vector2';
|
|
27
|
+
import { messages } from '@atlaskit/media-ui/messages';
|
|
22
28
|
import * as exenv from 'exenv';
|
|
23
29
|
import { uploadPlaceholder, errorIcon } from './images';
|
|
24
30
|
import { fileSizeMb } from '../util';
|
|
@@ -11,8 +11,8 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
11
11
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
12
12
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
13
|
import { Component } from 'react';
|
|
14
|
-
import FieldRange from '@atlaskit/range';
|
|
15
|
-
import { messages } from '@atlaskit/media-ui';
|
|
14
|
+
import FieldRange from '@atlaskit/range/range';
|
|
15
|
+
import { messages } from '@atlaskit/media-ui/messages';
|
|
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';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Rectangle
|
|
1
|
+
import { Rectangle } from '@atlaskit/media-ui/rectangle';
|
|
2
|
+
import { Vector2 } from '@atlaskit/media-ui/vector2';
|
|
2
3
|
export function zoomToFit(imageWidth, imageHeight, visibleBounds) {
|
|
3
4
|
var itemRect = new Rectangle(imageWidth, imageHeight);
|
|
4
5
|
var scaleFactor = itemRect.scaleToFitSmallestSide(visibleBounds);
|
|
@@ -11,7 +11,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
11
11
|
* This way, you can still move the image without clicking directly on it.
|
|
12
12
|
*/
|
|
13
13
|
import React from 'react';
|
|
14
|
-
import { Vector2 } from '@atlaskit/media-ui';
|
|
14
|
+
import { Vector2 } from '@atlaskit/media-ui/vector2';
|
|
15
15
|
import { ContainerWrapper } from './containerWrapper';
|
|
16
16
|
export var ImagePlacerContainer = /*#__PURE__*/function (_React$Component) {
|
|
17
17
|
function ImagePlacerContainer() {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
-
import { Rectangle
|
|
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
|
|
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
|
|
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%"
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import React, { type ReactNode } from 'react';
|
|
7
7
|
import { jsx, css } from '@compiled/react';
|
|
8
8
|
import Button from '@atlaskit/button/standard-button';
|
|
9
|
-
import
|
|
9
|
+
import ModalTransition from '@atlaskit/modal-dialog/modal-transition';
|
|
10
10
|
import { type Avatar, AvatarPickerDialog } from '../src';
|
|
11
11
|
import { generateAvatars } from '../example-helpers';
|
|
12
12
|
import {
|
|
@@ -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.
|
|
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,23 +30,23 @@
|
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@atlaskit/button": "^25.
|
|
34
|
-
"@atlaskit/css": "^1.
|
|
35
|
-
"@atlaskit/flag": "^18.
|
|
36
|
-
"@atlaskit/form": "^17.
|
|
37
|
-
"@atlaskit/icon": "^37.
|
|
38
|
-
"@atlaskit/media-ui": "^30.
|
|
39
|
-
"@atlaskit/modal-dialog": "^16.
|
|
40
|
-
"@atlaskit/platform-feature-flags": "^2.
|
|
41
|
-
"@atlaskit/primitives": "^22.
|
|
42
|
-
"@atlaskit/range": "^12.
|
|
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.
|
|
45
|
-
"@atlaskit/textfield": "^10.
|
|
46
|
-
"@atlaskit/tokens": "^16.
|
|
47
|
-
"@atlaskit/visually-hidden": "^4.
|
|
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
|
-
"@compiled/react": "^1.0.
|
|
49
|
+
"@compiled/react": "^1.0.2",
|
|
50
50
|
"exenv": "^1.2.2",
|
|
51
51
|
"react-error-boundary": "^3.1.3"
|
|
52
52
|
},
|
|
@@ -56,10 +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.
|
|
60
|
-
"@atlaskit/media-test-helpers": "^42.
|
|
61
|
-
"@
|
|
62
|
-
"@atlassian/
|
|
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",
|
|
63
64
|
"@atlassian/testing-library": "^0.11.0",
|
|
64
65
|
"@testing-library/react": "^16.3.0",
|
|
65
66
|
"@testing-library/user-event": "^14.4.3",
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Structured MCP docs for `@atlaskit/media-avatar-picker`.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import path from 'path';
|
|
6
|
-
|
|
7
|
-
import type { StructuredContentSource } from '@atlassian/structured-docs-types/types';
|
|
8
|
-
|
|
9
|
-
import packageJson from './package.json';
|
|
10
|
-
|
|
11
|
-
const packagePath = path.resolve(__dirname);
|
|
12
|
-
|
|
13
|
-
const documentation: StructuredContentSource = {
|
|
14
|
-
package: {
|
|
15
|
-
package: '@atlaskit/media-avatar-picker',
|
|
16
|
-
packagePath,
|
|
17
|
-
packageJson,
|
|
18
|
-
overview:
|
|
19
|
-
'A component to select, drag and resize image avatars. It also provides a default list of predefined avatars.',
|
|
20
|
-
},
|
|
21
|
-
components: [
|
|
22
|
-
{
|
|
23
|
-
name: 'AvatarPickerDialog',
|
|
24
|
-
description: 'Main dialog component that orchestrates the avatar selection experience.',
|
|
25
|
-
status: 'general-availability',
|
|
26
|
-
import: {
|
|
27
|
-
name: 'AvatarPickerDialog',
|
|
28
|
-
package: '@atlaskit/media-avatar-picker',
|
|
29
|
-
type: 'named',
|
|
30
|
-
packagePath,
|
|
31
|
-
packageJson,
|
|
32
|
-
},
|
|
33
|
-
usageGuidelines: [
|
|
34
|
-
'Use `AvatarPickerDialog` when you need to allow users to upload or select an avatar.',
|
|
35
|
-
],
|
|
36
|
-
keywords: ['media', 'avatar', 'picker', 'upload'],
|
|
37
|
-
categories: ['media'],
|
|
38
|
-
examples: [
|
|
39
|
-
{
|
|
40
|
-
name: 'Avatar picker with source',
|
|
41
|
-
description: 'Basic usage of AvatarPickerDialog with an initial image source.',
|
|
42
|
-
source: path.resolve(packagePath, './examples/0-avatar-picker-with-source.tsx'),
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
name: 'ImageCropper',
|
|
48
|
-
description: 'Interactive component for cropping uploaded images.',
|
|
49
|
-
status: 'general-availability',
|
|
50
|
-
import: {
|
|
51
|
-
name: 'ImageCropper',
|
|
52
|
-
package: '@atlaskit/media-avatar-picker/image-cropper',
|
|
53
|
-
type: 'named',
|
|
54
|
-
packagePath,
|
|
55
|
-
packageJson,
|
|
56
|
-
},
|
|
57
|
-
usageGuidelines: ['Use `ImageCropper` for standalone image cropping functionality.'],
|
|
58
|
-
keywords: ['media', 'crop', 'image'],
|
|
59
|
-
categories: ['media'],
|
|
60
|
-
examples: [
|
|
61
|
-
{
|
|
62
|
-
name: 'Image cropper',
|
|
63
|
-
description: 'Basic usage of ImageCropper.',
|
|
64
|
-
source: path.resolve(packagePath, './examples/1-image-cropper.tsx'),
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
},
|
|
68
|
-
],
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export default documentation;
|
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-->
|