@atlaskit/link-picker 1.10.4 → 1.11.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 +16 -0
- package/dist/cjs/ui/link-picker/index.js +20 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/ui/link-picker/index.js +18 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/ui/link-picker/index.js +19 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/ui/link-picker/index.d.ts +5 -0
- package/dist/types-ts4.0/ui/link-picker/index.d.ts +5 -0
- package/package.json +7 -5
- package/report.api.md +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/link-picker
|
|
2
2
|
|
|
3
|
+
## 1.11.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`af6e73a1e17`](https://bitbucket.org/atlassian/atlassian-frontend/commits/af6e73a1e17) - Bumping dependencies via Renovate:
|
|
8
|
+
|
|
9
|
+
- react-loosely-lazy
|
|
10
|
+
|
|
11
|
+
## 1.11.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [`2cbf4131640`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2cbf4131640) - Make LinkPicker to accept a custom root component
|
|
16
|
+
And now we offer a new useLinkPickerEditorProps hook
|
|
17
|
+
useForgeSearchProviders hook will now get client from SmartCardContext
|
|
18
|
+
|
|
3
19
|
## 1.10.4
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -9,6 +9,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports.testIds = exports.default = exports.RECENT_SEARCH_LIST_SIZE = void 0;
|
|
11
11
|
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
+
|
|
12
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
15
|
|
|
14
16
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -65,6 +67,8 @@ var _experiences = require("../../common/analytics/experiences");
|
|
|
65
67
|
|
|
66
68
|
var _sessionProvider = require("../../controllers/session-provider");
|
|
67
69
|
|
|
70
|
+
var _excluded = ["component"];
|
|
71
|
+
|
|
68
72
|
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); }
|
|
69
73
|
|
|
70
74
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(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; }
|
|
@@ -77,6 +81,7 @@ var RECENT_SEARCH_LIST_SIZE = 5;
|
|
|
77
81
|
exports.RECENT_SEARCH_LIST_SIZE = RECENT_SEARCH_LIST_SIZE;
|
|
78
82
|
|
|
79
83
|
var testIds = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
84
|
+
linkPickerRoot: 'link-picker-root',
|
|
80
85
|
linkPicker: 'link-picker',
|
|
81
86
|
urlInputField: 'link-url',
|
|
82
87
|
textInputField: 'link-text',
|
|
@@ -432,6 +437,20 @@ function LinkPicker(_ref) {
|
|
|
432
437
|
}));
|
|
433
438
|
}
|
|
434
439
|
|
|
435
|
-
var
|
|
440
|
+
var DefaultRootComponent = function DefaultRootComponent(_ref2) {
|
|
441
|
+
var children = _ref2.children;
|
|
442
|
+
return (0, _react2.jsx)("div", {
|
|
443
|
+
"data-testid": testIds.linkPickerRoot
|
|
444
|
+
}, children);
|
|
445
|
+
};
|
|
446
|
+
|
|
447
|
+
var _default = (0, _analytics2.withLinkPickerAnalyticsContext)( /*#__PURE__*/(0, _react.memo)(function (_ref3) {
|
|
448
|
+
var component = _ref3.component,
|
|
449
|
+
props = (0, _objectWithoutProperties2.default)(_ref3, _excluded);
|
|
450
|
+
var RootComponent = component !== null && component !== void 0 ? component : DefaultRootComponent;
|
|
451
|
+
return (0, _react2.jsx)(RootComponent, (0, _extends2.default)({}, props, {
|
|
452
|
+
"data-testid": testIds.linkPickerRoot
|
|
453
|
+
}), (0, _react2.jsx)(LinkPicker, props));
|
|
454
|
+
}));
|
|
436
455
|
|
|
437
456
|
exports.default = _default;
|
package/dist/cjs/version.json
CHANGED
|
@@ -28,6 +28,7 @@ import { succeedUfoExperience, ufoExperience } from '../../common/analytics/expe
|
|
|
28
28
|
import { useLinkPickerSessionId } from '../../controllers/session-provider';
|
|
29
29
|
export const RECENT_SEARCH_LIST_SIZE = 5;
|
|
30
30
|
export const testIds = {
|
|
31
|
+
linkPickerRoot: 'link-picker-root',
|
|
31
32
|
linkPicker: 'link-picker',
|
|
32
33
|
urlInputField: 'link-url',
|
|
33
34
|
textInputField: 'link-text',
|
|
@@ -377,4 +378,20 @@ function LinkPicker({
|
|
|
377
378
|
}));
|
|
378
379
|
}
|
|
379
380
|
|
|
380
|
-
|
|
381
|
+
const DefaultRootComponent = ({
|
|
382
|
+
children
|
|
383
|
+
}) => {
|
|
384
|
+
return jsx("div", {
|
|
385
|
+
"data-testid": testIds.linkPickerRoot
|
|
386
|
+
}, children);
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
export default withLinkPickerAnalyticsContext( /*#__PURE__*/memo(({
|
|
390
|
+
component,
|
|
391
|
+
...props
|
|
392
|
+
}) => {
|
|
393
|
+
const RootComponent = component !== null && component !== void 0 ? component : DefaultRootComponent;
|
|
394
|
+
return jsx(RootComponent, _extends({}, props, {
|
|
395
|
+
"data-testid": testIds.linkPickerRoot
|
|
396
|
+
}), jsx(LinkPicker, props));
|
|
397
|
+
}));
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
+
var _excluded = ["component"];
|
|
4
6
|
|
|
5
7
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
8
|
|
|
@@ -34,6 +36,7 @@ import { succeedUfoExperience, ufoExperience } from '../../common/analytics/expe
|
|
|
34
36
|
import { useLinkPickerSessionId } from '../../controllers/session-provider';
|
|
35
37
|
export var RECENT_SEARCH_LIST_SIZE = 5;
|
|
36
38
|
export var testIds = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
39
|
+
linkPickerRoot: 'link-picker-root',
|
|
37
40
|
linkPicker: 'link-picker',
|
|
38
41
|
urlInputField: 'link-url',
|
|
39
42
|
textInputField: 'link-text',
|
|
@@ -387,4 +390,19 @@ function LinkPicker(_ref) {
|
|
|
387
390
|
}));
|
|
388
391
|
}
|
|
389
392
|
|
|
390
|
-
|
|
393
|
+
var DefaultRootComponent = function DefaultRootComponent(_ref2) {
|
|
394
|
+
var children = _ref2.children;
|
|
395
|
+
return jsx("div", {
|
|
396
|
+
"data-testid": testIds.linkPickerRoot
|
|
397
|
+
}, children);
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
export default withLinkPickerAnalyticsContext( /*#__PURE__*/memo(function (_ref3) {
|
|
401
|
+
var component = _ref3.component,
|
|
402
|
+
props = _objectWithoutProperties(_ref3, _excluded);
|
|
403
|
+
|
|
404
|
+
var RootComponent = component !== null && component !== void 0 ? component : DefaultRootComponent;
|
|
405
|
+
return jsx(RootComponent, _extends({}, props, {
|
|
406
|
+
"data-testid": testIds.linkPickerRoot
|
|
407
|
+
}), jsx(LinkPicker, props));
|
|
408
|
+
}));
|
package/dist/esm/version.json
CHANGED
|
@@ -15,6 +15,7 @@ export declare const testIds: {
|
|
|
15
15
|
readonly searchError: string;
|
|
16
16
|
readonly insertButton: "link-picker-insert-button";
|
|
17
17
|
readonly cancelButton: "link-picker-cancel-button";
|
|
18
|
+
readonly linkPickerRoot: "link-picker-root";
|
|
18
19
|
readonly linkPicker: "link-picker";
|
|
19
20
|
readonly urlInputField: "link-url";
|
|
20
21
|
readonly textInputField: "link-text";
|
|
@@ -56,6 +57,10 @@ export interface LinkPickerProps {
|
|
|
56
57
|
displayText?: string | null;
|
|
57
58
|
/** Plugins that provide link suggestions / search capabilities. */
|
|
58
59
|
plugins?: LinkPickerPlugin[];
|
|
60
|
+
/** Customise the link picker root component */
|
|
61
|
+
component?: React.ComponentType<Partial<LinkPickerProps> & {
|
|
62
|
+
children: React.ReactElement;
|
|
63
|
+
}>;
|
|
59
64
|
}
|
|
60
65
|
export interface PickerState {
|
|
61
66
|
selectedIndex: number;
|
|
@@ -15,6 +15,7 @@ export declare const testIds: {
|
|
|
15
15
|
readonly searchError: string;
|
|
16
16
|
readonly insertButton: "link-picker-insert-button";
|
|
17
17
|
readonly cancelButton: "link-picker-cancel-button";
|
|
18
|
+
readonly linkPickerRoot: "link-picker-root";
|
|
18
19
|
readonly linkPicker: "link-picker";
|
|
19
20
|
readonly urlInputField: "link-url";
|
|
20
21
|
readonly textInputField: "link-text";
|
|
@@ -56,6 +57,10 @@ export interface LinkPickerProps {
|
|
|
56
57
|
displayText?: string | null;
|
|
57
58
|
/** Plugins that provide link suggestions / search capabilities. */
|
|
58
59
|
plugins?: LinkPickerPlugin[];
|
|
60
|
+
/** Customise the link picker root component */
|
|
61
|
+
component?: React.ComponentType<Partial<LinkPickerProps> & {
|
|
62
|
+
children: React.ReactElement;
|
|
63
|
+
}>;
|
|
59
64
|
}
|
|
60
65
|
export interface PickerState {
|
|
61
66
|
selectedIndex: number;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/link-picker",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.1",
|
|
4
4
|
"description": "Standalone link picker",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"publishConfig": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"@atlaskit/icon": "^21.10.0",
|
|
46
46
|
"@atlaskit/spinner": "^15.1.0",
|
|
47
47
|
"@atlaskit/tabs": "^13.3.0",
|
|
48
|
-
"@atlaskit/textfield": "^5.
|
|
48
|
+
"@atlaskit/textfield": "^5.3.0",
|
|
49
49
|
"@atlaskit/theme": "^12.2.0",
|
|
50
50
|
"@atlaskit/tokens": "^0.10.0",
|
|
51
51
|
"@atlaskit/tooltip": "^17.5.0",
|
|
@@ -53,9 +53,10 @@
|
|
|
53
53
|
"@atlaskit/visually-hidden": "^1.1.0",
|
|
54
54
|
"@babel/runtime": "^7.0.0",
|
|
55
55
|
"@emotion/react": "^11.7.1",
|
|
56
|
+
"@react-loosely-lazy/manifest": "^1.0.0",
|
|
56
57
|
"date-fns": "^2.17.0",
|
|
57
58
|
"linkify-it": "^2.0.3",
|
|
58
|
-
"react-loosely-lazy": "^0.
|
|
59
|
+
"react-loosely-lazy": "^1.0.0",
|
|
59
60
|
"uuid": "^3.1.0"
|
|
60
61
|
},
|
|
61
62
|
"peerDependencies": {
|
|
@@ -67,6 +68,7 @@
|
|
|
67
68
|
"@atlaskit/activity-provider": "^2.3.2",
|
|
68
69
|
"@atlaskit/docs": "*",
|
|
69
70
|
"@atlaskit/link-analytics": "^1.1.0",
|
|
71
|
+
"@atlaskit/link-provider": "^1.2.9",
|
|
70
72
|
"@atlaskit/link-test-helpers": "^1.5.0",
|
|
71
73
|
"@atlaskit/popup": "^1.4.0",
|
|
72
74
|
"@atlaskit/ssr": "*",
|
|
@@ -74,8 +76,8 @@
|
|
|
74
76
|
"@atlaskit/visual-regression": "*",
|
|
75
77
|
"@atlaskit/webdriver-runner": "*",
|
|
76
78
|
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
77
|
-
"@atlassian/link-picker-atlassian-plugin": "^
|
|
78
|
-
"@atlassian/link-picker-plugins": "^
|
|
79
|
+
"@atlassian/link-picker-atlassian-plugin": "^21.0.0",
|
|
80
|
+
"@atlassian/link-picker-plugins": "^8.0.0",
|
|
79
81
|
"@atlassian/recent-work-client": "^1.6.0",
|
|
80
82
|
"@atlassian/search-provider": "^2.3.0",
|
|
81
83
|
"@testing-library/dom": "^8.17.1",
|
package/report.api.md
CHANGED
|
@@ -46,6 +46,11 @@ export type LinkPickerPluginErrorFallback = (
|
|
|
46
46
|
|
|
47
47
|
// @public (undocumented)
|
|
48
48
|
export interface LinkPickerProps {
|
|
49
|
+
component?: React.ComponentType<
|
|
50
|
+
Partial<LinkPickerProps> & {
|
|
51
|
+
children: React.ReactElement;
|
|
52
|
+
}
|
|
53
|
+
>;
|
|
49
54
|
displayText?: string | null;
|
|
50
55
|
onCancel: () => void;
|
|
51
56
|
onContentResize?: () => void;
|