@atlaskit/link-picker 5.2.0 → 5.2.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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/link-picker
2
2
 
3
+ ## 5.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c7fb2b6201353`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c7fb2b6201353) -
8
+ Wrap ErrorMessage/HelperMessage with MessageWrapper in linking-platform packages to improve
9
+ assistive technology support. Production code changes (link-datasource, link-picker, smart-card
10
+ source files) are gated behind feature flag `platform_navx_3298_message_wrapper`. The example file
11
+ `load-link-form.tsx` applies MessageWrapper unconditionally, as example files do not ship to
12
+ production and are not subject to feature-gating requirements.
13
+ - Updated dependencies
14
+
3
15
  ## 5.2.0
4
16
 
5
17
  ### Minor Changes
@@ -15,6 +15,7 @@ var _react = _interopRequireWildcard(require("react"));
15
15
  var _useCallbackRef = require("use-callback-ref");
16
16
  var _form = require("@atlaskit/form");
17
17
  var _crossCircle = _interopRequireDefault(require("@atlaskit/icon/core/cross-circle"));
18
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
19
  var _compiled = require("@atlaskit/primitives/compiled");
19
20
  var _textfield = _interopRequireDefault(require("@atlaskit/textfield"));
20
21
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
@@ -123,10 +124,14 @@ var TextInput = exports.TextInput = function TextInput(_ref) {
123
124
  elemAfterInput: clearText,
124
125
  isInvalid: !!error,
125
126
  "aria-describedby": "".concat(restProps['aria-describedby'], " ").concat(fieldProps.id, "-error ").concat(fieldProps.id, "-helper")
126
- })), helperMessage && /*#__PURE__*/_react.default.createElement(_form.HelperMessage, {
127
+ })), (0, _platformFeatureFlags.fg)('platform_navx_3298_message_wrapper') ? /*#__PURE__*/_react.default.createElement(_form.MessageWrapper, null, helperMessage && /*#__PURE__*/_react.default.createElement(_form.HelperMessage, {
127
128
  testId: testIds.linkHelperText
128
129
  }, helperMessage), error && /*#__PURE__*/_react.default.createElement(_form.ErrorMessage, {
129
130
  testId: testIds.urlError
130
- }, error)));
131
+ }, error)) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, helperMessage && /*#__PURE__*/_react.default.createElement(_form.HelperMessage, {
132
+ testId: testIds.linkHelperText
133
+ }, helperMessage), error && /*#__PURE__*/_react.default.createElement(_form.ErrorMessage, {
134
+ testId: testIds.urlError
135
+ }, error))));
131
136
  }));
132
137
  };
@@ -26,7 +26,7 @@ var testIds = exports.testIds = {
26
26
  };
27
27
  var PACKAGE_DATA = exports.PACKAGE_DATA = {
28
28
  packageName: "@atlaskit/link-picker" || '',
29
- packageVersion: "5.1.7" || '',
29
+ packageVersion: "5.2.0" || '',
30
30
  componentName: _constants.COMPONENT_NAME,
31
31
  source: _constants.COMPONENT_NAME
32
32
  };
@@ -4,8 +4,9 @@ import "./index.compiled.css";
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import React, { Fragment, useCallback, useMemo, useRef } from 'react';
6
6
  import { useMergeRefs } from 'use-callback-ref';
7
- import { ErrorMessage, Field, HelperMessage } from '@atlaskit/form';
8
- import Selectclear from '@atlaskit/icon/core/cross-circle';
7
+ import { ErrorMessage, Field, HelperMessage, MessageWrapper } from '@atlaskit/form';
8
+ import CrossCircleIcon from '@atlaskit/icon/core/cross-circle';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
9
10
  import { Box, Pressable } from '@atlaskit/primitives/compiled';
10
11
  import Textfield from '@atlaskit/textfield';
11
12
  import Tooltip from '@atlaskit/tooltip';
@@ -89,7 +90,7 @@ export const TextInput = ({
89
90
  xcss: styles.clearTextButton,
90
91
  onClick: handleClear,
91
92
  testId: testIds.clearUrlButton
92
- }, /*#__PURE__*/React.createElement(Selectclear, {
93
+ }, /*#__PURE__*/React.createElement(CrossCircleIcon, {
93
94
  label: clearLabel || '',
94
95
  color: "var(--ds-icon-subtle, #505258)",
95
96
  spacing: "spacious"
@@ -111,10 +112,14 @@ export const TextInput = ({
111
112
  elemAfterInput: clearText,
112
113
  isInvalid: !!error,
113
114
  "aria-describedby": `${restProps['aria-describedby']} ${fieldProps.id}-error ${fieldProps.id}-helper`
114
- })), helperMessage && /*#__PURE__*/React.createElement(HelperMessage, {
115
+ })), fg('platform_navx_3298_message_wrapper') ? /*#__PURE__*/React.createElement(MessageWrapper, null, helperMessage && /*#__PURE__*/React.createElement(HelperMessage, {
115
116
  testId: testIds.linkHelperText
116
117
  }, helperMessage), error && /*#__PURE__*/React.createElement(ErrorMessage, {
117
118
  testId: testIds.urlError
118
- }, error)));
119
+ }, error)) : /*#__PURE__*/React.createElement(React.Fragment, null, helperMessage && /*#__PURE__*/React.createElement(HelperMessage, {
120
+ testId: testIds.linkHelperText
121
+ }, helperMessage), error && /*#__PURE__*/React.createElement(ErrorMessage, {
122
+ testId: testIds.urlError
123
+ }, error))));
119
124
  }));
120
125
  };
@@ -16,7 +16,7 @@ export const testIds = {
16
16
  };
17
17
  export const PACKAGE_DATA = {
18
18
  packageName: "@atlaskit/link-picker" || '',
19
- packageVersion: "5.1.7" || '',
19
+ packageVersion: "5.2.0" || '',
20
20
  componentName: COMPONENT_NAME,
21
21
  source: COMPONENT_NAME
22
22
  };
@@ -6,8 +6,9 @@ import "./index.compiled.css";
6
6
  import { ax, ix } from "@compiled/react/runtime";
7
7
  import React, { Fragment, useCallback, useMemo, useRef } from 'react';
8
8
  import { useMergeRefs } from 'use-callback-ref';
9
- import { ErrorMessage, Field, HelperMessage } from '@atlaskit/form';
10
- import Selectclear from '@atlaskit/icon/core/cross-circle';
9
+ import { ErrorMessage, Field, HelperMessage, MessageWrapper } from '@atlaskit/form';
10
+ import CrossCircleIcon from '@atlaskit/icon/core/cross-circle';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
11
12
  import { Box, Pressable } from '@atlaskit/primitives/compiled';
12
13
  import Textfield from '@atlaskit/textfield';
13
14
  import Tooltip from '@atlaskit/tooltip';
@@ -93,7 +94,7 @@ export var TextInput = function TextInput(_ref) {
93
94
  xcss: styles.clearTextButton,
94
95
  onClick: handleClear,
95
96
  testId: testIds.clearUrlButton
96
- }, /*#__PURE__*/React.createElement(Selectclear, {
97
+ }, /*#__PURE__*/React.createElement(CrossCircleIcon, {
97
98
  label: clearLabel || '',
98
99
  color: "var(--ds-icon-subtle, #505258)",
99
100
  spacing: "spacious"
@@ -114,10 +115,14 @@ export var TextInput = function TextInput(_ref) {
114
115
  elemAfterInput: clearText,
115
116
  isInvalid: !!error,
116
117
  "aria-describedby": "".concat(restProps['aria-describedby'], " ").concat(fieldProps.id, "-error ").concat(fieldProps.id, "-helper")
117
- })), helperMessage && /*#__PURE__*/React.createElement(HelperMessage, {
118
+ })), fg('platform_navx_3298_message_wrapper') ? /*#__PURE__*/React.createElement(MessageWrapper, null, helperMessage && /*#__PURE__*/React.createElement(HelperMessage, {
118
119
  testId: testIds.linkHelperText
119
120
  }, helperMessage), error && /*#__PURE__*/React.createElement(ErrorMessage, {
120
121
  testId: testIds.urlError
121
- }, error)));
122
+ }, error)) : /*#__PURE__*/React.createElement(React.Fragment, null, helperMessage && /*#__PURE__*/React.createElement(HelperMessage, {
123
+ testId: testIds.linkHelperText
124
+ }, helperMessage), error && /*#__PURE__*/React.createElement(ErrorMessage, {
125
+ testId: testIds.urlError
126
+ }, error))));
122
127
  }));
123
128
  };
@@ -17,7 +17,7 @@ export var testIds = {
17
17
  };
18
18
  export var PACKAGE_DATA = {
19
19
  packageName: "@atlaskit/link-picker" || '',
20
- packageVersion: "5.1.7" || '',
20
+ packageVersion: "5.2.0" || '',
21
21
  componentName: COMPONENT_NAME,
22
22
  source: COMPONENT_NAME
23
23
  };
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
+ * @jsxFrag React.Fragment
4
5
  */
5
6
  import React, { type Ref } from 'react';
6
7
  import { type TextFieldProps } from '@atlaskit/textfield';
@@ -9,8 +10,8 @@ export type TextInputProps = Omit<TextFieldProps, 'name' | 'value'> & Pick<Condi
9
10
  name: string;
10
11
  value: string;
11
12
  label?: string;
12
- onUndo?: Function;
13
- onRedo?: Function;
13
+ onUndo?: () => void;
14
+ onRedo?: () => void;
14
15
  onClear?: (name: string) => void;
15
16
  clearLabel?: string;
16
17
  error?: React.ReactNode;
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
+ * @jsxFrag React.Fragment
4
5
  */
5
6
  import React, { type Ref } from 'react';
6
7
  import { type TextFieldProps } from '@atlaskit/textfield';
@@ -9,8 +10,8 @@ export type TextInputProps = Omit<TextFieldProps, 'name' | 'value'> & Pick<Condi
9
10
  name: string;
10
11
  value: string;
11
12
  label?: string;
12
- onUndo?: Function;
13
- onRedo?: Function;
13
+ onUndo?: () => void;
14
+ onRedo?: () => void;
14
15
  onClear?: (name: string) => void;
15
16
  clearLabel?: string;
16
17
  error?: React.ReactNode;
@@ -5,71 +5,73 @@
5
5
 
6
6
  import path from 'path';
7
7
 
8
- import type { ComponentStructuredContentSource } from '@atlassian/structured-docs-types';
8
+ import type { StructuredContentSource } from '@atlassian/structured-docs-types/types';
9
9
 
10
10
  import packageJson from './package.json';
11
11
 
12
12
  const packagePath = path.resolve(__dirname);
13
13
 
14
- const documentation: ComponentStructuredContentSource[] = [
15
- {
16
- name: 'LinkPicker',
17
- description:
18
- 'Standalone link picker UI that lets users search and select links to insert. Supports plugins for different data sources (recents, search, Jira, Confluence, etc.) and can be used in modals, popups, or inline.',
19
- status: 'general-availability',
20
- import: {
14
+ const documentation: StructuredContentSource = {
15
+ components: [
16
+ {
21
17
  name: 'LinkPicker',
22
- package: '@atlaskit/link-picker',
23
- type: 'named',
24
- packagePath,
25
- packageJson,
26
- },
27
- usageGuidelines: [
28
- 'Use when the user needs to choose a link to insert (e.g. in an editor, form, or toolbar). Add plugins to define tabs and data sources; use SmartCardProvider above the picker so selected links resolve correctly.',
29
- ],
30
- contentGuidelines: [],
31
- accessibilityGuidelines: [
32
- 'Ensure the picker is focusable and has an accessible name (e.g. "Insert link"). Provide a keyboard-accessible way to open and close; ensure search and results are announced to screen readers.',
33
- ],
34
- keywords: ['link-picker', 'link', 'picker', 'search', 'insert link', 'plugins'],
35
- categories: ['linking', 'interaction', 'forms'],
36
- examples: [
37
- {
38
- name: 'Link Picker (basic)',
39
- description:
40
- 'Basic LinkPicker with URL input and submit. Requires plugins for search results.',
41
- source: path.resolve(packagePath, './examples/00-basic.tsx'),
42
- },
43
- {
44
- name: 'Link Picker (without plugins)',
45
- description: 'LinkPicker without plugins — manual URL entry only.',
46
- source: path.resolve(packagePath, './examples/20-without-plugins.tsx'),
18
+ description:
19
+ 'Standalone link picker UI that lets users search and select links to insert. Supports plugins for different data sources (recents, search, Jira, Confluence, etc.) and can be used in modals, popups, or inline.',
20
+ status: 'general-availability',
21
+ import: {
22
+ name: 'LinkPicker',
23
+ package: '@atlaskit/link-picker',
24
+ type: 'named',
25
+ packagePath,
26
+ packageJson,
47
27
  },
48
- ],
49
- },
50
- // Needs examples
51
- // {
52
- // name: 'LoaderFallback',
53
- // description: 'Fallback UI shown while the LinkPicker (or its lazy-loaded parts) are loading.',
54
- // status: 'general-availability',
55
- // import: {
56
- // name: 'LoaderFallback',
57
- // package: '@atlaskit/link-picker',
58
- // type: 'named',
59
- // packagePath,
60
- // packageJson,
61
- // },
62
- // usageGuidelines: [
63
- // 'Use when rendering LinkPicker lazily (e.g. via react-loosely-lazy) to show a consistent loading state until the picker is ready.',
64
- // ],
65
- // contentGuidelines: [],
66
- // accessibilityGuidelines: [
67
- // 'Ensure the fallback is announced as loading (e.g. aria-busy or live region) so screen reader users know content is pending.',
68
- // ],
69
- // keywords: ['link-picker', 'loader', 'fallback', 'lazy'],
70
- // categories: ['linking', 'interaction'],
71
- // examples: [],
72
- // },
73
- ];
28
+ usageGuidelines: [
29
+ 'Use when the user needs to choose a link to insert (e.g. in an editor, form, or toolbar). Add plugins to define tabs and data sources; use SmartCardProvider above the picker so selected links resolve correctly.',
30
+ ],
31
+ contentGuidelines: [],
32
+ accessibilityGuidelines: [
33
+ 'Ensure the picker is focusable and has an accessible name (e.g. "Insert link"). Provide a keyboard-accessible way to open and close; ensure search and results are announced to screen readers.',
34
+ ],
35
+ keywords: ['link-picker', 'link', 'picker', 'search', 'insert link', 'plugins'],
36
+ categories: ['linking', 'interaction', 'forms'],
37
+ examples: [
38
+ {
39
+ name: 'Link Picker (basic)',
40
+ description:
41
+ 'Basic LinkPicker with URL input and submit. Requires plugins for search results.',
42
+ source: path.resolve(packagePath, './examples/00-basic.tsx'),
43
+ },
44
+ {
45
+ name: 'Link Picker (without plugins)',
46
+ description: 'LinkPicker without plugins — manual URL entry only.',
47
+ source: path.resolve(packagePath, './examples/20-without-plugins.tsx'),
48
+ },
49
+ ],
50
+ },
51
+ // Needs examples
52
+ // {
53
+ // name: 'LoaderFallback',
54
+ // description: 'Fallback UI shown while the LinkPicker (or its lazy-loaded parts) are loading.',
55
+ // status: 'general-availability',
56
+ // import: {
57
+ // name: 'LoaderFallback',
58
+ // package: '@atlaskit/link-picker',
59
+ // type: 'named',
60
+ // packagePath,
61
+ // packageJson,
62
+ // },
63
+ // usageGuidelines: [
64
+ // 'Use when rendering LinkPicker lazily (e.g. via react-loosely-lazy) to show a consistent loading state until the picker is ready.',
65
+ // ],
66
+ // contentGuidelines: [],
67
+ // accessibilityGuidelines: [
68
+ // 'Ensure the fallback is announced as loading (e.g. aria-busy or live region) so screen reader users know content is pending.',
69
+ // ],
70
+ // keywords: ['link-picker', 'loader', 'fallback', 'lazy'],
71
+ // categories: ['linking', 'interaction'],
72
+ // examples: [],
73
+ // },
74
+ ],
75
+ };
74
76
 
75
77
  export default documentation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "5.2.0",
3
+ "version": "5.2.1",
4
4
  "description": "Standalone link picker",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "publishConfig": {
@@ -39,6 +39,9 @@
39
39
  ],
40
40
  "atlaskit:src": "src/index.ts",
41
41
  "platform-feature-flags": {
42
+ "platform_navx_3298_message_wrapper": {
43
+ "type": "boolean"
44
+ },
42
45
  "aifc_create_enabled": {
43
46
  "type": "boolean"
44
47
  }
@@ -55,20 +58,20 @@
55
58
  "@atlaskit/form": "^15.5.0",
56
59
  "@atlaskit/frontend-utilities": "^3.3.0",
57
60
  "@atlaskit/heading": "^5.4.0",
58
- "@atlaskit/icon": "^35.0.0",
61
+ "@atlaskit/icon": "^35.1.0",
59
62
  "@atlaskit/intl-messages-provider": "^3.3.0",
60
63
  "@atlaskit/link": "^3.4.0",
61
64
  "@atlaskit/link-provider": "^4.4.0",
62
65
  "@atlaskit/linking-common": "^9.11.0",
63
66
  "@atlaskit/platform-feature-flags": "^1.1.0",
64
67
  "@atlaskit/primitives": "^19.0.0",
65
- "@atlaskit/smart-card": "^44.13.0",
68
+ "@atlaskit/smart-card": "^44.16.0",
66
69
  "@atlaskit/spinner": "^19.1.0",
67
70
  "@atlaskit/spotlight": "^0.14.0",
68
71
  "@atlaskit/tabs": "^19.1.0",
69
72
  "@atlaskit/textfield": "^8.3.0",
70
73
  "@atlaskit/tokens": "^13.0.0",
71
- "@atlaskit/tooltip": "^22.2.0",
74
+ "@atlaskit/tooltip": "^22.3.0",
72
75
  "@atlaskit/ufo": "^0.5.0",
73
76
  "@atlaskit/visually-hidden": "^3.1.0",
74
77
  "@babel/runtime": "^7.0.0",
@@ -89,7 +92,7 @@
89
92
  "@af/integration-testing": "workspace:^",
90
93
  "@af/visual-regression": "workspace:^",
91
94
  "@atlaskit/dropdown-menu": "^16.9.0",
92
- "@atlaskit/link-test-helpers": "^10.2.0",
95
+ "@atlaskit/link-test-helpers": "^10.3.0",
93
96
  "@atlassian/a11y-jest-testing": "^0.11.0",
94
97
  "@atlassian/a11y-playwright-testing": "^0.10.0",
95
98
  "@atlassian/feature-flags-test-utils": "^1.1.0",
@@ -105,6 +108,7 @@
105
108
  "mockdate": "^3.0.5",
106
109
  "node-fetch": "^2.6.7",
107
110
  "prettier": "^3.2.5",
111
+ "react": "^18.2.0",
108
112
  "react-dom": "^18.2.0",
109
113
  "react-intl": "^6.6.2",
110
114
  "sinon": "^2.2.0"