@atlaskit/link-picker 3.4.1 → 3.5.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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # @atlaskit/link-picker
2
2
 
3
+ ## 3.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#158005](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/158005)
8
+ [`760f73c576c67`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/760f73c576c67) -
9
+ [ux] Allow the passing of an outside of form error to link picker through a new prop , set error
10
+ message link to open in new tab on click
11
+
3
12
  ## 3.4.1
4
13
 
5
14
  ### Patch Changes
package/compass.yml CHANGED
@@ -27,4 +27,8 @@ links:
27
27
  type: REPOSITORY
28
28
  url: 'https://bitbucket.org/atlassian/atlassian-frontend-monorepo/src/master/platform/packages/linking-platform/link-picker'
29
29
  customFields: []
30
- relationships: {}
30
+ relationships:
31
+ DEPENDS_ON:
32
+ - 'ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:component/c5751cc6-3513-4070-9deb-af31e86aed34/18157dad-b7fb-4cde-8b74-e905b5757611' # link-provider
33
+ - 'ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:component/c5751cc6-3513-4070-9deb-af31e86aed34/3d229125-4f9d-4091-a303-84ae4eb643fb' # linking-common
34
+ - 'ari:cloud:compass:a436116f-02ce-4520-8fbb-7301462a1674:component/c5751cc6-3513-4070-9deb-af31e86aed34/c9898540-33b1-4cd4-9399-16e575bcedae' # smart-card
@@ -118,7 +118,8 @@ var LinkPicker = exports.LinkPicker = (0, _analytics.withLinkPickerAnalyticsCont
118
118
  moveSubmitButton = _ref$moveSubmitButton === void 0 ? false : _ref$moveSubmitButton,
119
119
  inputRef = _ref.inputRef,
120
120
  _ref$previewableLinks = _ref.previewableLinksOnly,
121
- previewableLinksOnly = _ref$previewableLinks === void 0 ? false : _ref$previewableLinks;
121
+ previewableLinksOnly = _ref$previewableLinks === void 0 ? false : _ref$previewableLinks,
122
+ additionalError = _ref.additionalError;
122
123
  var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
123
124
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
124
125
  var _useReducer = (0, _react.useReducer)(reducer, _objectSpread(_objectSpread({}, initState), {}, {
@@ -407,10 +408,12 @@ var LinkPicker = exports.LinkPicker = (0, _analytics.withLinkPickerAnalyticsCont
407
408
  // for details: https://a11y-internal.atlassian.net/browse/AK-740
408
409
  var screenReaderText = (0, _userAgent.browser)().safari && (0, _utils.getScreenReaderText)(items !== null && items !== void 0 ? items : [], selectedIndex, intl);
409
410
  var customSubmitButtonLabel = customMessages !== null && customMessages !== void 0 && customMessages.submitButtonLabel ? customMessages.submitButtonLabel : undefined;
411
+ var additionalErrorMessage = (0, _platformFeatureFlags.fg)('platform-linking-link-picker-previewable-only') && additionalError;
410
412
  var errorMessage = invalidUrl ? previewableOnly && !hasPreview ? /*#__PURE__*/React.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.formMessages.noEmbedAvailable, {
411
413
  values: {
412
414
  a: function a(chunk) {
413
415
  return /*#__PURE__*/React.createElement(_linkUrl.default, {
416
+ target: "_blank",
414
417
  href: "https://support.atlassian.com/platform-experiences/docs/smart-links-from-jira-and-other-products/"
415
418
  }, chunk);
416
419
  }
@@ -437,7 +440,7 @@ var LinkPicker = exports.LinkPicker = (0, _analytics.withLinkPickerAnalyticsCont
437
440
  value: url,
438
441
  autoFocus: true,
439
442
  clearLabel: intl.formatMessage(_messages.formMessages.clearLink),
440
- error: errorMessage,
443
+ error: errorMessage || additionalErrorMessage,
441
444
  spotlightTargetName: "link-picker-search-field-spotlight-target",
442
445
  "aria-readonly": isSubmitting
443
446
  }, a11yList, {
@@ -27,7 +27,7 @@ var testIds = exports.testIds = {
27
27
  };
28
28
  var PACKAGE_DATA = exports.PACKAGE_DATA = {
29
29
  packageName: "@atlaskit/link-picker" || '',
30
- packageVersion: "3.4.1" || '',
30
+ packageVersion: "3.5.0" || '',
31
31
  componentName: _constants.COMPONENT_NAME,
32
32
  source: _constants.COMPONENT_NAME
33
33
  };
@@ -105,7 +105,8 @@ export const LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(({
105
105
  adaptiveHeight = false,
106
106
  moveSubmitButton = false,
107
107
  inputRef,
108
- previewableLinksOnly = false
108
+ previewableLinksOnly = false,
109
+ additionalError
109
110
  }) => {
110
111
  const {
111
112
  createAnalyticsEvent
@@ -363,9 +364,11 @@ export const LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(({
363
364
  // for details: https://a11y-internal.atlassian.net/browse/AK-740
364
365
  const screenReaderText = browser().safari && getScreenReaderText(items !== null && items !== void 0 ? items : [], selectedIndex, intl);
365
366
  const customSubmitButtonLabel = customMessages !== null && customMessages !== void 0 && customMessages.submitButtonLabel ? customMessages.submitButtonLabel : undefined;
367
+ const additionalErrorMessage = fg('platform-linking-link-picker-previewable-only') && additionalError;
366
368
  const errorMessage = invalidUrl ? previewableOnly && !hasPreview ? /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, formMessages.noEmbedAvailable, {
367
369
  values: {
368
370
  a: chunk => /*#__PURE__*/React.createElement(LinkUrl, {
371
+ target: "_blank",
369
372
  href: "https://support.atlassian.com/platform-experiences/docs/smart-links-from-jira-and-other-products/"
370
373
  }, chunk)
371
374
  }
@@ -391,7 +394,7 @@ export const LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(({
391
394
  value: url,
392
395
  autoFocus: true,
393
396
  clearLabel: intl.formatMessage(formMessages.clearLink),
394
- error: errorMessage,
397
+ error: errorMessage || additionalErrorMessage,
395
398
  spotlightTargetName: "link-picker-search-field-spotlight-target",
396
399
  "aria-readonly": isSubmitting
397
400
  }, a11yList, {
@@ -5,7 +5,7 @@ import { ax, ix } from "@compiled/react/runtime";
5
5
  import React, { memo } from 'react';
6
6
  import { LazySuspense } from 'react-loosely-lazy';
7
7
  import { AnalyticsContext } from '@atlaskit/analytics-next';
8
- import { fg } from "@atlaskit/platform-feature-flags";
8
+ import { fg } from '@atlaskit/platform-feature-flags';
9
9
  import { COMPONENT_NAME, LINK_PICKER_WIDTH_IN_PX } from '../common/constants';
10
10
  import { LinkPickerSessionProvider } from '../controllers/session-provider';
11
11
  import { ErrorBoundary } from './error-boundary';
@@ -16,7 +16,7 @@ export const testIds = {
16
16
  };
17
17
  export const PACKAGE_DATA = {
18
18
  packageName: "@atlaskit/link-picker" || '',
19
- packageVersion: "3.4.1" || '',
19
+ packageVersion: "3.5.0" || '',
20
20
  componentName: COMPONENT_NAME,
21
21
  source: COMPONENT_NAME
22
22
  };
@@ -108,7 +108,8 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
108
108
  moveSubmitButton = _ref$moveSubmitButton === void 0 ? false : _ref$moveSubmitButton,
109
109
  inputRef = _ref.inputRef,
110
110
  _ref$previewableLinks = _ref.previewableLinksOnly,
111
- previewableLinksOnly = _ref$previewableLinks === void 0 ? false : _ref$previewableLinks;
111
+ previewableLinksOnly = _ref$previewableLinks === void 0 ? false : _ref$previewableLinks,
112
+ additionalError = _ref.additionalError;
112
113
  var _useAnalyticsEvents = useAnalyticsEvents(),
113
114
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
114
115
  var _useReducer = useReducer(reducer, _objectSpread(_objectSpread({}, initState), {}, {
@@ -397,10 +398,12 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
397
398
  // for details: https://a11y-internal.atlassian.net/browse/AK-740
398
399
  var screenReaderText = browser().safari && getScreenReaderText(items !== null && items !== void 0 ? items : [], selectedIndex, intl);
399
400
  var customSubmitButtonLabel = customMessages !== null && customMessages !== void 0 && customMessages.submitButtonLabel ? customMessages.submitButtonLabel : undefined;
401
+ var additionalErrorMessage = fg('platform-linking-link-picker-previewable-only') && additionalError;
400
402
  var errorMessage = invalidUrl ? previewableOnly && !hasPreview ? /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, formMessages.noEmbedAvailable, {
401
403
  values: {
402
404
  a: function a(chunk) {
403
405
  return /*#__PURE__*/React.createElement(LinkUrl, {
406
+ target: "_blank",
404
407
  href: "https://support.atlassian.com/platform-experiences/docs/smart-links-from-jira-and-other-products/"
405
408
  }, chunk);
406
409
  }
@@ -427,7 +430,7 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
427
430
  value: url,
428
431
  autoFocus: true,
429
432
  clearLabel: intl.formatMessage(formMessages.clearLink),
430
- error: errorMessage,
433
+ error: errorMessage || additionalErrorMessage,
431
434
  spotlightTargetName: "link-picker-search-field-spotlight-target",
432
435
  "aria-readonly": isSubmitting
433
436
  }, a11yList, {
@@ -6,7 +6,7 @@ import { ax, ix } from "@compiled/react/runtime";
6
6
  import React, { memo } from 'react';
7
7
  import { LazySuspense } from 'react-loosely-lazy';
8
8
  import { AnalyticsContext } from '@atlaskit/analytics-next';
9
- import { fg } from "@atlaskit/platform-feature-flags";
9
+ import { fg } from '@atlaskit/platform-feature-flags';
10
10
  import { COMPONENT_NAME, LINK_PICKER_WIDTH_IN_PX } from '../common/constants';
11
11
  import { LinkPickerSessionProvider } from '../controllers/session-provider';
12
12
  import { ErrorBoundary } from './error-boundary';
@@ -17,7 +17,7 @@ export var testIds = {
17
17
  };
18
18
  export var PACKAGE_DATA = {
19
19
  packageName: "@atlaskit/link-picker" || '',
20
- packageVersion: "3.4.1" || '',
20
+ packageVersion: "3.5.0" || '',
21
21
  componentName: COMPONENT_NAME,
22
22
  source: COMPONENT_NAME
23
23
  };
@@ -158,6 +158,8 @@ export interface LinkPickerProps {
158
158
  inputRef?: Ref<HTMLInputElement>;
159
159
  /**Disables URLs that do not have an embeddable preview */
160
160
  previewableLinksOnly?: boolean;
161
+ /**This prop passes one additional error that is secondary to component errors */
162
+ additionalError?: React.ReactNode;
161
163
  }
162
164
  type CustomLinkPickerMessages = {
163
165
  /** Label for the link input field */
@@ -161,6 +161,8 @@ export interface LinkPickerProps {
161
161
  inputRef?: Ref<HTMLInputElement>;
162
162
  /**Disables URLs that do not have an embeddable preview */
163
163
  previewableLinksOnly?: boolean;
164
+ /**This prop passes one additional error that is secondary to component errors */
165
+ additionalError?: React.ReactNode;
164
166
  }
165
167
  type CustomLinkPickerMessages = {
166
168
  /** Label for the link input field */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "3.4.1",
3
+ "version": "3.5.0",
4
4
  "description": "Standalone link picker",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "publishConfig": {
@@ -82,21 +82,21 @@
82
82
  "@atlaskit/form": "^12.0.0",
83
83
  "@atlaskit/frontend-utilities": "^3.0.0",
84
84
  "@atlaskit/heading": "^5.2.0",
85
- "@atlaskit/icon": "^26.1.0",
85
+ "@atlaskit/icon": "^26.4.0",
86
86
  "@atlaskit/intl-messages-provider": "^2.0.0",
87
87
  "@atlaskit/link": "^3.2.0",
88
- "@atlaskit/link-provider": "^3.0.0",
88
+ "@atlaskit/link-provider": "^3.2.0",
89
89
  "@atlaskit/linking-common": "^9.0.0",
90
- "@atlaskit/onboarding": "^14.1.0",
90
+ "@atlaskit/onboarding": "^14.2.0",
91
91
  "@atlaskit/platform-feature-flags": "^1.1.0",
92
92
  "@atlaskit/primitives": "^14.8.0",
93
- "@atlaskit/smart-card": "^38.4.0",
93
+ "@atlaskit/smart-card": "^38.5.0",
94
94
  "@atlaskit/spinner": "^18.0.0",
95
95
  "@atlaskit/tabs": "^18.1.0",
96
96
  "@atlaskit/textfield": "^8.0.0",
97
97
  "@atlaskit/theme": "^18.0.0",
98
98
  "@atlaskit/tokens": "^4.9.0",
99
- "@atlaskit/tooltip": "^20.0.0",
99
+ "@atlaskit/tooltip": "^20.2.0",
100
100
  "@atlaskit/ufo": "^0.4.0",
101
101
  "@atlaskit/visually-hidden": "^3.0.0",
102
102
  "@babel/runtime": "^7.0.0",