@atlaskit/link-picker 1.2.1 → 1.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 +6 -0
- package/dist/cjs/ui/index.js +15 -4
- package/dist/cjs/ui/link-picker/index.js +4 -3
- package/dist/cjs/ui/link-picker/styled.js +6 -4
- package/dist/cjs/ui/loader-fallback/index.js +24 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/ui/index.js +8 -2
- package/dist/es2019/ui/link-picker/index.js +1 -1
- package/dist/es2019/ui/link-picker/styled.js +6 -0
- package/dist/es2019/ui/loader-fallback/index.js +11 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/ui/index.js +10 -2
- package/dist/esm/ui/link-picker/index.js +1 -1
- package/dist/esm/ui/link-picker/styled.js +4 -3
- package/dist/esm/ui/loader-fallback/index.js +11 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/ui/link-picker/index.d.ts +2 -2
- package/dist/types/ui/link-picker/styled.d.ts +1 -0
- package/dist/types/ui/loader-fallback/index.d.ts +3 -0
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/link-picker
|
|
2
2
|
|
|
3
|
+
## 1.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`0ddad39a369`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0ddad39a369) - [ux] Lazy load the link-picker instead. The lazily loaded picker is now the default that's exported
|
|
8
|
+
|
|
3
9
|
## 1.2.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/cjs/ui/index.js
CHANGED
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.ComposedLinkPicker = void 0;
|
|
9
9
|
|
|
10
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
11
|
+
|
|
10
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
11
13
|
|
|
12
14
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
13
15
|
|
|
16
|
+
var _reactLooselyLazy = require("react-loosely-lazy");
|
|
17
|
+
|
|
14
18
|
var _version = require("../version.json");
|
|
15
19
|
|
|
16
20
|
var _errorBoundaryFallback = require("./error-boundary-fallback");
|
|
17
21
|
|
|
18
|
-
var
|
|
22
|
+
var _loaderFallback = require("./loader-fallback");
|
|
19
23
|
|
|
20
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
25
|
|
|
22
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
26
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || (0, _typeof2.default)(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
27
|
|
|
24
28
|
var COMPONENT_NAME = 'LinkPicker';
|
|
25
29
|
var ANALYTICS_CHANNEL = 'media';
|
|
@@ -28,11 +32,18 @@ var PACKAGE_DATA = {
|
|
|
28
32
|
packageVersion: _version.version,
|
|
29
33
|
componentName: COMPONENT_NAME
|
|
30
34
|
};
|
|
35
|
+
var LazyLinkPicker = (0, _reactLooselyLazy.lazyForPaint)(function () {
|
|
36
|
+
return Promise.resolve().then(function () {
|
|
37
|
+
return _interopRequireWildcard(require('./link-picker'));
|
|
38
|
+
});
|
|
39
|
+
});
|
|
31
40
|
var ComposedLinkPicker = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
32
41
|
return /*#__PURE__*/_react.default.createElement(_analyticsNext.AnalyticsErrorBoundary, {
|
|
33
42
|
channel: ANALYTICS_CHANNEL,
|
|
34
43
|
data: PACKAGE_DATA,
|
|
35
44
|
ErrorComponent: _errorBoundaryFallback.ErrorBoundaryFallback
|
|
36
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
45
|
+
}, /*#__PURE__*/_react.default.createElement(_reactLooselyLazy.LazySuspense, {
|
|
46
|
+
fallback: _loaderFallback.LoaderFallback
|
|
47
|
+
}, /*#__PURE__*/_react.default.createElement(LazyLinkPicker, props)));
|
|
37
48
|
});
|
|
38
49
|
exports.ComposedLinkPicker = ComposedLinkPicker;
|
|
@@ -7,7 +7,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.
|
|
10
|
+
exports.default = exports.RECENT_SEARCH_LIST_SIZE = void 0;
|
|
11
11
|
|
|
12
12
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
13
|
|
|
@@ -602,5 +602,6 @@ function limit(items) {
|
|
|
602
602
|
return items.slice(0, RECENT_SEARCH_LIST_SIZE);
|
|
603
603
|
}
|
|
604
604
|
|
|
605
|
-
var
|
|
606
|
-
|
|
605
|
+
var _default = (0, _reactIntlNext.injectIntl)(LinkPicker);
|
|
606
|
+
|
|
607
|
+
exports.default = _default;
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.searchIconStyles = exports.rootContainerStyles = exports.listTitleStyles = void 0;
|
|
8
|
+
exports.searchIconStyles = exports.rootContainerStylesForLoader = exports.rootContainerStyles = exports.listTitleStyles = void 0;
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
@@ -19,13 +19,15 @@ var _theme = require("@atlaskit/theme");
|
|
|
19
19
|
|
|
20
20
|
var _constants = require("@atlaskit/theme/constants");
|
|
21
21
|
|
|
22
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
22
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
23
23
|
|
|
24
24
|
var LINK_PICKER_WIDTH_IN_PX = 342;
|
|
25
25
|
var LINK_PICKER_MIN_HEIGHT_IN_PX = 234;
|
|
26
26
|
var rootContainerStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: ", "px;\n padding: ", "px;\n box-sizing: border-box;\n line-height: initial;\n min-height: ", "px;\n"])), LINK_PICKER_WIDTH_IN_PX, (0, _constants.gridSize)() * 2, LINK_PICKER_MIN_HEIGHT_IN_PX);
|
|
27
27
|
exports.rootContainerStyles = rootContainerStyles;
|
|
28
|
-
var
|
|
28
|
+
var rootContainerStylesForLoader = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n display: flex;\n align-items: center;\n justify-content: center;\n"])), rootContainerStyles);
|
|
29
|
+
exports.rootContainerStylesForLoader = rootContainerStylesForLoader;
|
|
30
|
+
var searchIconStyles = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n margin-left: ", "px;\n color: ", ";\n cursor: default;\n"])), (0, _constants.gridSize)() / 2, (0, _tokens.token)('color.icon', _colors.N500));
|
|
29
31
|
exports.searchIconStyles = searchIconStyles;
|
|
30
|
-
var listTitleStyles = (0, _react.css)(
|
|
32
|
+
var listTitleStyles = (0, _react.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n text-transform: uppercase;\n margin-bottom: ", "px;\n"])), _theme.typography.h100(), (0, _constants.gridSize)() / 2);
|
|
31
33
|
exports.listTitleStyles = listTitleStyles;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.LoaderFallback = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = require("@emotion/react");
|
|
11
|
+
|
|
12
|
+
var _spinner = _interopRequireDefault(require("@atlaskit/spinner"));
|
|
13
|
+
|
|
14
|
+
var _styled = require("../link-picker/styled");
|
|
15
|
+
|
|
16
|
+
/** @jsx jsx */
|
|
17
|
+
var LoaderFallback = (0, _react.jsx)("div", {
|
|
18
|
+
css: _styled.rootContainerStylesForLoader,
|
|
19
|
+
"data-testid": "link-picker-root-loader-boundary-ui"
|
|
20
|
+
}, (0, _react.jsx)(_spinner.default, {
|
|
21
|
+
testId: "link-picker.component-loading-indicator",
|
|
22
|
+
size: "medium"
|
|
23
|
+
}));
|
|
24
|
+
exports.LoaderFallback = LoaderFallback;
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/ui/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { AnalyticsErrorBoundary } from '@atlaskit/analytics-next';
|
|
3
|
+
import { LazySuspense, lazyForPaint } from 'react-loosely-lazy';
|
|
3
4
|
import { name as packageName, version as packageVersion } from '../version.json';
|
|
4
5
|
import { ErrorBoundaryFallback } from './error-boundary-fallback';
|
|
5
|
-
import {
|
|
6
|
+
import { LoaderFallback } from './loader-fallback';
|
|
6
7
|
const COMPONENT_NAME = 'LinkPicker';
|
|
7
8
|
const ANALYTICS_CHANNEL = 'media';
|
|
8
9
|
const PACKAGE_DATA = {
|
|
@@ -10,8 +11,13 @@ const PACKAGE_DATA = {
|
|
|
10
11
|
packageVersion,
|
|
11
12
|
componentName: COMPONENT_NAME
|
|
12
13
|
};
|
|
14
|
+
const LazyLinkPicker = lazyForPaint(() => import(
|
|
15
|
+
/* webpackChunkName: "@atlaskit-internal_link-picker" */
|
|
16
|
+
'./link-picker'));
|
|
13
17
|
export const ComposedLinkPicker = /*#__PURE__*/memo(props => /*#__PURE__*/React.createElement(AnalyticsErrorBoundary, {
|
|
14
18
|
channel: ANALYTICS_CHANNEL,
|
|
15
19
|
data: PACKAGE_DATA,
|
|
16
20
|
ErrorComponent: ErrorBoundaryFallback
|
|
17
|
-
}, /*#__PURE__*/React.createElement(
|
|
21
|
+
}, /*#__PURE__*/React.createElement(LazySuspense, {
|
|
22
|
+
fallback: LoaderFallback
|
|
23
|
+
}, /*#__PURE__*/React.createElement(LazyLinkPicker, props))));
|
|
@@ -14,6 +14,12 @@ export const rootContainerStyles = css`
|
|
|
14
14
|
line-height: initial;
|
|
15
15
|
min-height: ${LINK_PICKER_MIN_HEIGHT_IN_PX}px;
|
|
16
16
|
`;
|
|
17
|
+
export const rootContainerStylesForLoader = css`
|
|
18
|
+
${rootContainerStyles}
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
`;
|
|
17
23
|
export const searchIconStyles = css`
|
|
18
24
|
margin-left: ${gridSize() / 2}px;
|
|
19
25
|
color: ${token('color.icon', N500)};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import Spinner from '@atlaskit/spinner';
|
|
4
|
+
import { rootContainerStylesForLoader } from '../link-picker/styled';
|
|
5
|
+
export const LoaderFallback = jsx("div", {
|
|
6
|
+
css: rootContainerStylesForLoader,
|
|
7
|
+
"data-testid": "link-picker-root-loader-boundary-ui"
|
|
8
|
+
}, jsx(Spinner, {
|
|
9
|
+
testId: "link-picker.component-loading-indicator",
|
|
10
|
+
size: "medium"
|
|
11
|
+
}));
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/ui/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import { AnalyticsErrorBoundary } from '@atlaskit/analytics-next';
|
|
3
|
+
import { LazySuspense, lazyForPaint } from 'react-loosely-lazy';
|
|
3
4
|
import { name as packageName, version as packageVersion } from '../version.json';
|
|
4
5
|
import { ErrorBoundaryFallback } from './error-boundary-fallback';
|
|
5
|
-
import {
|
|
6
|
+
import { LoaderFallback } from './loader-fallback';
|
|
6
7
|
var COMPONENT_NAME = 'LinkPicker';
|
|
7
8
|
var ANALYTICS_CHANNEL = 'media';
|
|
8
9
|
var PACKAGE_DATA = {
|
|
@@ -10,10 +11,17 @@ var PACKAGE_DATA = {
|
|
|
10
11
|
packageVersion: packageVersion,
|
|
11
12
|
componentName: COMPONENT_NAME
|
|
12
13
|
};
|
|
14
|
+
var LazyLinkPicker = lazyForPaint(function () {
|
|
15
|
+
return import(
|
|
16
|
+
/* webpackChunkName: "@atlaskit-internal_link-picker" */
|
|
17
|
+
'./link-picker');
|
|
18
|
+
});
|
|
13
19
|
export var ComposedLinkPicker = /*#__PURE__*/memo(function (props) {
|
|
14
20
|
return /*#__PURE__*/React.createElement(AnalyticsErrorBoundary, {
|
|
15
21
|
channel: ANALYTICS_CHANNEL,
|
|
16
22
|
data: PACKAGE_DATA,
|
|
17
23
|
ErrorComponent: ErrorBoundaryFallback
|
|
18
|
-
}, /*#__PURE__*/React.createElement(
|
|
24
|
+
}, /*#__PURE__*/React.createElement(LazySuspense, {
|
|
25
|
+
fallback: LoaderFallback
|
|
26
|
+
}, /*#__PURE__*/React.createElement(LazyLinkPicker, props)));
|
|
19
27
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
|
|
3
|
-
var _templateObject, _templateObject2, _templateObject3;
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
4
4
|
|
|
5
5
|
import { token } from '@atlaskit/tokens';
|
|
6
6
|
import { css } from '@emotion/react';
|
|
@@ -12,5 +12,6 @@ import { gridSize } from '@atlaskit/theme/constants';
|
|
|
12
12
|
var LINK_PICKER_WIDTH_IN_PX = 342;
|
|
13
13
|
var LINK_PICKER_MIN_HEIGHT_IN_PX = 234;
|
|
14
14
|
export var rootContainerStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: ", "px;\n padding: ", "px;\n box-sizing: border-box;\n line-height: initial;\n min-height: ", "px;\n"])), LINK_PICKER_WIDTH_IN_PX, gridSize() * 2, LINK_PICKER_MIN_HEIGHT_IN_PX);
|
|
15
|
-
export var
|
|
16
|
-
export var
|
|
15
|
+
export var rootContainerStylesForLoader = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n display: flex;\n align-items: center;\n justify-content: center;\n"])), rootContainerStyles);
|
|
16
|
+
export var searchIconStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-left: ", "px;\n color: ", ";\n cursor: default;\n"])), gridSize() / 2, token('color.icon', N500));
|
|
17
|
+
export var listTitleStyles = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n ", "\n text-transform: uppercase;\n margin-bottom: ", "px;\n"])), typography.h100(), gridSize() / 2);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import Spinner from '@atlaskit/spinner';
|
|
4
|
+
import { rootContainerStylesForLoader } from '../link-picker/styled';
|
|
5
|
+
export var LoaderFallback = jsx("div", {
|
|
6
|
+
css: rootContainerStylesForLoader,
|
|
7
|
+
"data-testid": "link-picker-root-loader-boundary-ui"
|
|
8
|
+
}, jsx(Spinner, {
|
|
9
|
+
testId: "link-picker.component-loading-indicator",
|
|
10
|
+
size: "medium"
|
|
11
|
+
}));
|
package/dist/esm/version.json
CHANGED
|
@@ -45,7 +45,7 @@ export interface State {
|
|
|
45
45
|
displayText: string;
|
|
46
46
|
invalidUrl: string | null;
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<WrappedComponentProps<"intl"> & LinkPickerProps>> & {
|
|
49
49
|
WrappedComponent: import("react").ComponentType<WrappedComponentProps<"intl"> & LinkPickerProps>;
|
|
50
50
|
};
|
|
51
|
-
export
|
|
51
|
+
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare const rootContainerStyles: import("@emotion/react").SerializedStyles;
|
|
2
|
+
export declare const rootContainerStylesForLoader: import("@emotion/react").SerializedStyles;
|
|
2
3
|
export declare const searchIconStyles: import("@emotion/react").SerializedStyles;
|
|
3
4
|
export declare const listTitleStyles: import("@emotion/react").SerializedStyles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-picker",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Standalone link picker",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"publishConfig": {
|
|
@@ -43,7 +43,8 @@
|
|
|
43
43
|
"@babel/runtime": "^7.0.0",
|
|
44
44
|
"@emotion/react": "^11.7.1",
|
|
45
45
|
"date-fns": "^2.17.0",
|
|
46
|
-
"linkify-it": "^2.0.3"
|
|
46
|
+
"linkify-it": "^2.0.3",
|
|
47
|
+
"react-loosely-lazy": "^0.5.0"
|
|
47
48
|
},
|
|
48
49
|
"peerDependencies": {
|
|
49
50
|
"react": "^16.8.0",
|
|
@@ -52,16 +53,18 @@
|
|
|
52
53
|
"devDependencies": {
|
|
53
54
|
"@atlaskit/activity-provider": "^2.3.2",
|
|
54
55
|
"@atlaskit/docs": "*",
|
|
55
|
-
"@atlaskit/link-test-helpers": "^1.
|
|
56
|
+
"@atlaskit/link-test-helpers": "^1.2.0",
|
|
56
57
|
"@atlaskit/popup": "^1.3.5",
|
|
57
58
|
"@atlaskit/ssr": "*",
|
|
58
59
|
"@atlaskit/visual-regression": "*",
|
|
59
60
|
"@atlaskit/webdriver-runner": "*",
|
|
60
61
|
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
61
|
-
"@atlassian/link-picker-atlassian-plugin": "^
|
|
62
|
+
"@atlassian/link-picker-atlassian-plugin": "^13.0.0",
|
|
62
63
|
"@atlassian/search-provider": "^2.3.0",
|
|
63
64
|
"@testing-library/dom": "^7.7.3",
|
|
65
|
+
"@testing-library/jest-dom": "^4.1.0",
|
|
64
66
|
"@testing-library/react": "^8.0.1",
|
|
67
|
+
"@testing-library/user-event": "10.4.0",
|
|
65
68
|
"enzyme": "^3.10.0",
|
|
66
69
|
"fetch-mock": "^8.0.0",
|
|
67
70
|
"mockdate": "^3.0.2",
|