@atlaskit/link-picker 1.30.0 → 1.30.2

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.
Files changed (100) hide show
  1. package/CHANGELOG.md +129 -117
  2. package/dist/cjs/common/analytics/context.js +3 -4
  3. package/dist/cjs/common/analytics/experiences.js +6 -11
  4. package/dist/cjs/common/analytics/input-field-tracking.js +6 -7
  5. package/dist/cjs/common/constants.js +5 -10
  6. package/dist/cjs/common/generic-error-svg/index.js +2 -3
  7. package/dist/cjs/common/generic-error-svg/styled.js +1 -2
  8. package/dist/cjs/common/ui/min-height-container/index.js +2 -3
  9. package/dist/cjs/common/ui/min-height-container/styled.js +1 -2
  10. package/dist/cjs/common/utils/analytics/analytics.codegen.js +1 -2
  11. package/dist/cjs/common/utils/dateUtils.js +2 -3
  12. package/dist/cjs/common/utils/errors.js +2 -3
  13. package/dist/cjs/common/utils/handleNavKeyDown.js +2 -3
  14. package/dist/cjs/controllers/session-provider/index.js +5 -9
  15. package/dist/cjs/controllers/use-fix-height/index.js +2 -3
  16. package/dist/cjs/i18n/cs.js +2 -3
  17. package/dist/cjs/i18n/da.js +2 -3
  18. package/dist/cjs/i18n/de.js +2 -3
  19. package/dist/cjs/i18n/en.js +2 -3
  20. package/dist/cjs/i18n/en_GB.js +2 -3
  21. package/dist/cjs/i18n/en_ZZ.js +2 -3
  22. package/dist/cjs/i18n/es.js +2 -3
  23. package/dist/cjs/i18n/fi.js +2 -3
  24. package/dist/cjs/i18n/fr.js +2 -3
  25. package/dist/cjs/i18n/hu.js +2 -3
  26. package/dist/cjs/i18n/it.js +2 -3
  27. package/dist/cjs/i18n/ja.js +2 -3
  28. package/dist/cjs/i18n/ko.js +2 -3
  29. package/dist/cjs/i18n/languages.js +2 -3
  30. package/dist/cjs/i18n/nb.js +2 -3
  31. package/dist/cjs/i18n/nl.js +2 -3
  32. package/dist/cjs/i18n/pl.js +2 -3
  33. package/dist/cjs/i18n/pt_BR.js +2 -3
  34. package/dist/cjs/i18n/ru.js +2 -3
  35. package/dist/cjs/i18n/sv.js +2 -3
  36. package/dist/cjs/i18n/th.js +2 -3
  37. package/dist/cjs/i18n/tr.js +2 -3
  38. package/dist/cjs/i18n/uk.js +2 -3
  39. package/dist/cjs/i18n/vi.js +2 -3
  40. package/dist/cjs/i18n/zh.js +2 -3
  41. package/dist/cjs/i18n/zh_TW.js +2 -3
  42. package/dist/cjs/services/use-plugins/reducer.js +7 -13
  43. package/dist/cjs/services/use-plugins/utils.js +4 -7
  44. package/dist/cjs/ui/error-boundary/error-boundary-base/index.js +2 -3
  45. package/dist/cjs/ui/error-boundary/error-boundary-fallback/index.js +2 -3
  46. package/dist/cjs/ui/error-boundary/error-boundary-fallback/styled.js +1 -2
  47. package/dist/cjs/ui/error-boundary/index.js +2 -2
  48. package/dist/cjs/ui/index.js +5 -8
  49. package/dist/cjs/ui/link-picker/announcer.js +2 -3
  50. package/dist/cjs/ui/link-picker/form-footer/feature-discovery/index.js +1 -2
  51. package/dist/cjs/ui/link-picker/form-footer/feature-discovery/styled.js +1 -2
  52. package/dist/cjs/ui/link-picker/form-footer/index.js +3 -5
  53. package/dist/cjs/ui/link-picker/form-footer/styled.js +2 -4
  54. package/dist/cjs/ui/link-picker/form-footer/utils.js +2 -3
  55. package/dist/cjs/ui/link-picker/index.js +6 -8
  56. package/dist/cjs/ui/link-picker/messages.js +6 -11
  57. package/dist/cjs/ui/link-picker/search-results/index.js +4 -6
  58. package/dist/cjs/ui/link-picker/search-results/link-search-error/index.js +5 -9
  59. package/dist/cjs/ui/link-picker/search-results/link-search-list/index.js +5 -8
  60. package/dist/cjs/ui/link-picker/search-results/link-search-list/link-search-no-results/index.js +4 -7
  61. package/dist/cjs/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.js +2 -3
  62. package/dist/cjs/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/styled.js +1 -2
  63. package/dist/cjs/ui/link-picker/search-results/link-search-list/link-search-no-results/styled.js +2 -4
  64. package/dist/cjs/ui/link-picker/search-results/link-search-list/list-item/index.js +3 -5
  65. package/dist/cjs/ui/link-picker/search-results/link-search-list/list-item/styled.js +9 -18
  66. package/dist/cjs/ui/link-picker/search-results/link-search-list/styled.js +4 -8
  67. package/dist/cjs/ui/link-picker/search-results/link-search-list/use-track-results-shown/index.js +2 -3
  68. package/dist/cjs/ui/link-picker/search-results/scrolling-tabs/index.js +2 -3
  69. package/dist/cjs/ui/link-picker/search-results/scrolling-tabs/scrolling-tabs.js +7 -15
  70. package/dist/cjs/ui/link-picker/search-results/scrolling-tabs/styles.js +6 -11
  71. package/dist/cjs/ui/link-picker/search-results/search-results-container/index.js +2 -3
  72. package/dist/cjs/ui/link-picker/search-results/search-results-container/styled.js +1 -2
  73. package/dist/cjs/ui/link-picker/search-results/styled.js +3 -6
  74. package/dist/cjs/ui/link-picker/styled.js +2 -4
  75. package/dist/cjs/ui/link-picker/text-input/conditional-spotlight-target-wrapper/index.js +2 -3
  76. package/dist/cjs/ui/link-picker/text-input/index.js +5 -7
  77. package/dist/cjs/ui/link-picker/text-input/styled.js +2 -4
  78. package/dist/cjs/ui/link-picker/text-input/utils.js +3 -5
  79. package/dist/cjs/ui/link-picker/transformTimeStamp.js +2 -3
  80. package/dist/cjs/ui/link-picker/utils.js +2 -3
  81. package/dist/cjs/ui/loader-fallback/index.js +2 -3
  82. package/dist/cjs/ui/loader-fallback/styled.js +1 -2
  83. package/dist/cjs/ui/messages-provider/index.js +2 -3
  84. package/dist/cjs/ui/messages-provider/lazy-messages-provider/index.js +2 -3
  85. package/dist/cjs/ui/messages-provider/lazy-messages-provider/utils/fetch-messages-for-locale.js +2 -3
  86. package/dist/cjs/ui/messages-provider/lazy-messages-provider/utils/use-messages.js +2 -3
  87. package/dist/cjs/ui/styled.js +1 -2
  88. package/dist/es2019/ui/index.js +2 -2
  89. package/dist/es2019/ui/link-picker/search-results/scrolling-tabs/scrolling-tabs.js +1 -1
  90. package/dist/esm/common/analytics/context.js +2 -2
  91. package/dist/esm/common/analytics/input-field-tracking.js +4 -4
  92. package/dist/esm/ui/error-boundary/index.js +2 -2
  93. package/dist/esm/ui/index.js +2 -2
  94. package/dist/esm/ui/link-picker/index.js +3 -3
  95. package/dist/esm/ui/link-picker/search-results/index.js +1 -1
  96. package/dist/esm/ui/link-picker/search-results/link-search-list/index.js +1 -1
  97. package/dist/esm/ui/link-picker/search-results/scrolling-tabs/scrolling-tabs.js +1 -2
  98. package/dist/esm/ui/link-picker/text-input/index.js +2 -2
  99. package/dist/esm/ui/link-picker/utils.js +1 -1
  100. package/package.json +8 -9
@@ -48,13 +48,13 @@ export var withInputFieldTracking = function withInputFieldTracking(WrappedCompo
48
48
  // trackAttribute(`${field}FieldContent`, contentTypeFn(event.currentTarget.value));
49
49
  // trackAttribute(`${field}FieldContentInputMethod`, methodTypeFn(event));
50
50
  trackAttributes(filterOnChangeEventAttrs(event, (_filterOnChangeEventA = {}, _defineProperty(_filterOnChangeEventA, "".concat(field, "FieldContent"), Boolean(event.currentTarget.value) ? 'text_string' : null), _defineProperty(_filterOnChangeEventA, "".concat(field, "FieldContentInputMethod"), getChangeEventInputMethodType(event)), _filterOnChangeEventA)));
51
- onChange === null || onChange === void 0 ? void 0 : onChange(event);
51
+ onChange === null || onChange === void 0 || onChange(event);
52
52
  }, [onChange, trackAttributes]);
53
53
 
54
54
  // Store the value of the field at the time the field is focused so we can know if it changes when the user's focus leaves
55
55
  var handleOnFocus = useCallback(function (event) {
56
56
  valueOnFocus.current = event.currentTarget.value;
57
- onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
57
+ onFocus === null || onFocus === void 0 || onFocus(event);
58
58
  }, [onFocus]);
59
59
 
60
60
  // Fire updated events only when the user's focus leaves the field
@@ -63,7 +63,7 @@ export var withInputFieldTracking = function withInputFieldTracking(WrappedCompo
63
63
  if (event.currentTarget.value !== valueOnFocus.current) {
64
64
  createAnalyticsEvent(createEventPayload("ui.textField.updated.".concat(field, "Field"), {})).fire(ANALYTICS_CHANNEL);
65
65
  }
66
- onBlur === null || onBlur === void 0 ? void 0 : onBlur(event);
66
+ onBlur === null || onBlur === void 0 || onBlur(event);
67
67
  }, [onBlur, createAnalyticsEvent]);
68
68
 
69
69
  // Track the values as null when the text field is cleared
@@ -73,7 +73,7 @@ export var withInputFieldTracking = function withInputFieldTracking(WrappedCompo
73
73
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
74
74
  args[_key] = arguments[_key];
75
75
  }
76
- onClear === null || onClear === void 0 ? void 0 : onClear.apply(void 0, args);
76
+ onClear === null || onClear === void 0 || onClear.apply(void 0, args);
77
77
  }, [onClear, trackAttribute]);
78
78
  return /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, props, {
79
79
  onBlur: handleOnBlur,
@@ -12,10 +12,10 @@ export function ErrorBoundary(_ref) {
12
12
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
13
13
  var linkPickerSessionId = useLinkPickerSessionId();
14
14
  var handleError = useCallback(function (error, info) {
15
- var _window, _window$navigator, _info$componentStack;
15
+ var _window, _info$componentStack;
16
16
  // Fire Analytics event
17
17
  createAnalyticsEvent(createEventPayload('ui.linkPicker.unhandledErrorCaught', {
18
- browserInfo: ((_window = window) === null || _window === void 0 ? void 0 : (_window$navigator = _window.navigator) === null || _window$navigator === void 0 ? void 0 : _window$navigator.userAgent) || 'unknown',
18
+ browserInfo: ((_window = window) === null || _window === void 0 || (_window = _window.navigator) === null || _window === void 0 ? void 0 : _window.userAgent) || 'unknown',
19
19
  error: error.toString(),
20
20
  componentStack: (_info$componentStack = info === null || info === void 0 ? void 0 : info.componentStack) !== null && _info$componentStack !== void 0 ? _info$componentStack : ''
21
21
  })).fire(ANALYTICS_CHANNEL);
@@ -16,8 +16,8 @@ export var testIds = {
16
16
  linkPickerRoot: 'link-picker-root'
17
17
  };
18
18
  export var PACKAGE_DATA = {
19
- packageName: "@atlaskit/link-picker",
20
- packageVersion: "1.30.0",
19
+ packageName: "@atlaskit/link-picker" || '',
20
+ packageVersion: "1.30.2" || '',
21
21
  componentName: COMPONENT_NAME,
22
22
  source: COMPONENT_NAME
23
23
  };
@@ -150,7 +150,7 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
150
150
  var consumerEvent = event.clone();
151
151
  // Cloned event doesnt have the attributes that are added by
152
152
  // the analytics listener in the LinkPickerAnalyticsContext, add them here
153
- consumerEvent === null || consumerEvent === void 0 ? void 0 : consumerEvent.update({
153
+ consumerEvent === null || consumerEvent === void 0 || consumerEvent.update({
154
154
  attributes: getAttributes()
155
155
  });
156
156
  // Dispatch the original event to our channel
@@ -184,7 +184,7 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
184
184
  }
185
185
  }, [handleInsert, trackAttribute, items, activePlugin]);
186
186
  var handleSubmit = useCallback(function (event) {
187
- event === null || event === void 0 ? void 0 : event.preventDefault();
187
+ event === null || event === void 0 || event.preventDefault();
188
188
  if (isSelectedItem && selectedItem) {
189
189
  return handleInsert(selectedItem.url, selectedItem.name, 'typeAhead');
190
190
  }
@@ -208,7 +208,7 @@ export var LinkPicker = withLinkPickerAnalyticsContext( /*#__PURE__*/memo(functi
208
208
  invalidUrl: false,
209
209
  activeTab: activeTab
210
210
  });
211
- trackAttribute('tab', (_plugins$activeTab$ta = plugins === null || plugins === void 0 ? void 0 : (_plugins$activeTab = plugins[activeTab]) === null || _plugins$activeTab === void 0 ? void 0 : _plugins$activeTab.tabKey) !== null && _plugins$activeTab$ta !== void 0 ? _plugins$activeTab$ta : null);
211
+ trackAttribute('tab', (_plugins$activeTab$ta = plugins === null || plugins === void 0 || (_plugins$activeTab = plugins[activeTab]) === null || _plugins$activeTab === void 0 ? void 0 : _plugins$activeTab.tabKey) !== null && _plugins$activeTab$ta !== void 0 ? _plugins$activeTab$ta : null);
212
212
  }, [dispatch, plugins, trackAttribute]);
213
213
  var handleSearchListOnChange = function handleSearchListOnChange(id) {
214
214
  var index = items === null || items === void 0 ? void 0 : items.findIndex(function (item) {
@@ -76,5 +76,5 @@ export var SearchResults = function SearchResults(_ref) {
76
76
  onKeyDown: handleKeyDown,
77
77
  hasSearchTerm: !!(queryState !== null && queryState !== void 0 && queryState.query.length),
78
78
  activePlugin: activePlugin
79
- }), error && ((_activePlugin$errorFa = activePlugin === null || activePlugin === void 0 ? void 0 : (_activePlugin$errorFa2 = activePlugin.errorFallback) === null || _activePlugin$errorFa2 === void 0 ? void 0 : _activePlugin$errorFa2.call(activePlugin, error, retry)) !== null && _activePlugin$errorFa !== void 0 ? _activePlugin$errorFa : jsx(LinkSearchError, null))));
79
+ }), error && ((_activePlugin$errorFa = activePlugin === null || activePlugin === void 0 || (_activePlugin$errorFa2 = activePlugin.errorFallback) === null || _activePlugin$errorFa2 === void 0 ? void 0 : _activePlugin$errorFa2.call(activePlugin, error, retry)) !== null && _activePlugin$errorFa !== void 0 ? _activePlugin$errorFa : jsx(LinkSearchError, null))));
80
80
  };
@@ -90,7 +90,7 @@ export var LinkSearchList = /*#__PURE__*/forwardRef(function (_ref, ref) {
90
90
  if (['ArrowDown', 'ArrowUp', 'Home', 'End'].includes(event.key) && item) {
91
91
  if (itemRefs.current) {
92
92
  var _itemRefs$current$ite;
93
- (_itemRefs$current$ite = itemRefs.current[item.objectId]) === null || _itemRefs$current$ite === void 0 ? void 0 : _itemRefs$current$ite.focus();
93
+ (_itemRefs$current$ite = itemRefs.current[item.objectId]) === null || _itemRefs$current$ite === void 0 || _itemRefs$current$ite.focus();
94
94
  }
95
95
  }
96
96
  }, [activeIndex, items, onKeyDown]);
@@ -1,4 +1,3 @@
1
- import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
1
  var BUTTON_SIZE = 24;
3
2
  var GUTTER = 48;
4
3
  var GHOST_WIDTH = 342 - GUTTER - 40;
@@ -33,7 +32,7 @@ var moveTabsScroll = function moveTabsScroll(ref, findFn) {
33
32
  var container = getContainer(ref);
34
33
  if (container) {
35
34
  var tablist = container.children[0];
36
- var _tabs = _toConsumableArray(tablist.children);
35
+ var _tabs = Array.from(tablist.children);
37
36
  if (_tabs.length > 0) {
38
37
  var target = findFn(container, _tabs);
39
38
  if (target) {
@@ -55,8 +55,8 @@ export var TextInput = function TextInput(_ref) {
55
55
  var _inputRef$current;
56
56
  e.preventDefault();
57
57
  e.stopPropagation();
58
- onClear === null || onClear === void 0 ? void 0 : onClear(name);
59
- (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
58
+ onClear === null || onClear === void 0 || onClear(name);
59
+ (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
60
60
  }, [name, onClear]);
61
61
  var clearText = restProps.value !== '' && jsx(Tooltip, {
62
62
  content: clearLabel
@@ -5,7 +5,7 @@ import { transformTimeStamp } from './transformTimeStamp';
5
5
  */
6
6
  export var getDataSource = function getDataSource(item, plugin) {
7
7
  var _ref, _item$meta$source, _item$meta, _plugin$meta;
8
- return (_ref = (_item$meta$source = (_item$meta = item.meta) === null || _item$meta === void 0 ? void 0 : _item$meta.source) !== null && _item$meta$source !== void 0 ? _item$meta$source : plugin === null || plugin === void 0 ? void 0 : (_plugin$meta = plugin.meta) === null || _plugin$meta === void 0 ? void 0 : _plugin$meta.source) !== null && _ref !== void 0 ? _ref : 'unknown';
8
+ return (_ref = (_item$meta$source = (_item$meta = item.meta) === null || _item$meta === void 0 ? void 0 : _item$meta.source) !== null && _item$meta$source !== void 0 ? _item$meta$source : plugin === null || plugin === void 0 || (_plugin$meta = plugin.meta) === null || _plugin$meta === void 0 ? void 0 : _plugin$meta.source) !== null && _ref !== void 0 ? _ref : 'unknown';
9
9
  };
10
10
  export function getScreenReaderText(items, selectedIndex, intl) {
11
11
  if (items.length && selectedIndex > -1) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "1.30.0",
3
+ "version": "1.30.2",
4
4
  "description": "Standalone link picker",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "publishConfig": {
@@ -53,19 +53,19 @@
53
53
  },
54
54
  "dependencies": {
55
55
  "@atlaskit/analytics-next": "^9.1.0",
56
- "@atlaskit/button": "^16.10.0",
56
+ "@atlaskit/button": "^16.13.0",
57
57
  "@atlaskit/empty-state": "^7.6.0",
58
- "@atlaskit/form": "^8.11.0",
58
+ "@atlaskit/form": "^9.0.0",
59
59
  "@atlaskit/frontend-utilities": "^2.7.0",
60
60
  "@atlaskit/icon": "^21.12.0",
61
- "@atlaskit/linking-common": "^4.10.0",
61
+ "@atlaskit/linking-common": "^4.16.0",
62
62
  "@atlaskit/onboarding": "^10.8.2",
63
63
  "@atlaskit/platform-feature-flags": "^0.2.1",
64
- "@atlaskit/spinner": "^15.5.0",
64
+ "@atlaskit/spinner": "^15.6.0",
65
65
  "@atlaskit/tabs": "^13.4.0",
66
66
  "@atlaskit/textfield": "^5.6.0",
67
67
  "@atlaskit/theme": "^12.6.0",
68
- "@atlaskit/tokens": "^1.25.0",
68
+ "@atlaskit/tokens": "^1.28.0",
69
69
  "@atlaskit/tooltip": "^17.8.0",
70
70
  "@atlaskit/ufo": "^0.2.0",
71
71
  "@atlaskit/visually-hidden": "^1.2.0",
@@ -84,10 +84,9 @@
84
84
  "devDependencies": {
85
85
  "@af/analytics-codegen": "^0.1.0",
86
86
  "@af/visual-regression": "*",
87
- "@atlaskit/dropdown-menu": "^11.14.0",
87
+ "@atlaskit/dropdown-menu": "^12.1.0",
88
88
  "@atlaskit/link-provider": "^1.6.0",
89
- "@atlaskit/link-test-helpers": "^6.1.0",
90
- "@atlaskit/linking-common": "^4.10.0",
89
+ "@atlaskit/link-test-helpers": "^6.2.0",
91
90
  "@atlaskit/visual-regression": "*",
92
91
  "@atlaskit/webdriver-runner": "*",
93
92
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",