@atlaskit/link-picker 1.25.3 → 1.25.4

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 (145) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/common/analytics/context.js +1 -1
  3. package/dist/cjs/common/analytics/input-field-tracking.js +3 -3
  4. package/dist/cjs/common/constants.js +4 -2
  5. package/dist/cjs/common/utils/handleNavKeyDown.js +29 -0
  6. package/dist/cjs/services/use-plugins/index.js +7 -8
  7. package/dist/cjs/ui/error-boundary/error-boundary-fallback/index.js +3 -1
  8. package/dist/cjs/ui/error-boundary/index.js +3 -3
  9. package/dist/cjs/ui/index.js +2 -2
  10. package/dist/cjs/ui/link-picker/form-footer/index.js +10 -10
  11. package/dist/cjs/ui/link-picker/index.js +29 -40
  12. package/dist/cjs/ui/link-picker/link-search-list/index.js +11 -11
  13. package/dist/cjs/ui/link-picker/link-search-list/link-search-no-results/index.js +1 -1
  14. package/dist/cjs/ui/link-picker/{list-item → link-search-list/list-item}/index.js +3 -1
  15. package/dist/cjs/ui/link-picker/{list-item → link-search-list/list-item}/styled.js +5 -3
  16. package/dist/cjs/ui/{scrolling-tabs → link-picker/scrolling-tabs}/index.js +3 -0
  17. package/dist/cjs/ui/link-picker/styled.js +5 -23
  18. package/dist/cjs/ui/link-picker/text-input/index.js +4 -4
  19. package/dist/cjs/ui/link-picker/text-input/utils.js +28 -0
  20. package/dist/cjs/ui/link-picker/track-mount/index.js +1 -1
  21. package/dist/cjs/ui/link-picker/track-tab-viewed/index.js +1 -1
  22. package/dist/cjs/ui/link-picker/transformTimeStamp.js +2 -2
  23. package/dist/cjs/ui/link-picker/utils.js +1 -48
  24. package/dist/cjs/ui/loader-fallback/index.js +1 -1
  25. package/dist/cjs/ui/loader-fallback/styled.js +21 -0
  26. package/dist/cjs/version.json +1 -1
  27. package/dist/es2019/common/analytics/context.js +1 -1
  28. package/dist/es2019/common/analytics/input-field-tracking.js +2 -2
  29. package/dist/es2019/common/constants.js +2 -1
  30. package/dist/es2019/common/utils/handleNavKeyDown.js +22 -0
  31. package/dist/es2019/services/use-plugins/index.js +5 -6
  32. package/dist/es2019/ui/error-boundary/error-boundary-fallback/index.js +2 -1
  33. package/dist/es2019/ui/error-boundary/index.js +3 -3
  34. package/dist/es2019/ui/index.js +3 -3
  35. package/dist/es2019/ui/link-picker/announcer.js +1 -1
  36. package/dist/es2019/ui/link-picker/form-footer/index.js +4 -4
  37. package/dist/es2019/ui/link-picker/index.js +18 -28
  38. package/dist/es2019/ui/link-picker/link-search-error/index.js +1 -1
  39. package/dist/es2019/ui/link-picker/link-search-list/index.js +5 -5
  40. package/dist/es2019/ui/link-picker/link-search-list/link-search-no-results/index.js +1 -1
  41. package/dist/es2019/ui/link-picker/{list-item → link-search-list/list-item}/index.js +3 -2
  42. package/dist/es2019/ui/link-picker/{list-item → link-search-list/list-item}/styled.js +2 -2
  43. package/dist/es2019/ui/link-picker/link-search-list/styled.js +1 -0
  44. package/dist/es2019/ui/{scrolling-tabs → link-picker/scrolling-tabs}/index.js +6 -3
  45. package/dist/es2019/ui/link-picker/styled.js +0 -30
  46. package/dist/es2019/ui/link-picker/text-input/index.js +5 -5
  47. package/dist/es2019/ui/link-picker/text-input/utils.js +22 -0
  48. package/dist/es2019/ui/link-picker/track-mount/index.js +1 -1
  49. package/dist/es2019/ui/link-picker/track-tab-viewed/index.js +1 -1
  50. package/dist/es2019/ui/link-picker/transformTimeStamp.js +2 -2
  51. package/dist/es2019/ui/link-picker/utils.js +1 -45
  52. package/dist/es2019/ui/loader-fallback/index.js +1 -1
  53. package/dist/es2019/ui/loader-fallback/styled.js +25 -0
  54. package/dist/es2019/version.json +1 -1
  55. package/dist/esm/common/analytics/context.js +1 -1
  56. package/dist/esm/common/analytics/input-field-tracking.js +2 -2
  57. package/dist/esm/common/constants.js +2 -1
  58. package/dist/esm/common/utils/handleNavKeyDown.js +22 -0
  59. package/dist/esm/services/use-plugins/index.js +5 -6
  60. package/dist/esm/ui/error-boundary/error-boundary-fallback/index.js +2 -1
  61. package/dist/esm/ui/error-boundary/index.js +3 -3
  62. package/dist/esm/ui/index.js +3 -3
  63. package/dist/esm/ui/link-picker/announcer.js +1 -1
  64. package/dist/esm/ui/link-picker/form-footer/index.js +4 -4
  65. package/dist/esm/ui/link-picker/index.js +19 -29
  66. package/dist/esm/ui/link-picker/link-search-error/index.js +1 -1
  67. package/dist/esm/ui/link-picker/link-search-list/index.js +5 -5
  68. package/dist/esm/ui/link-picker/link-search-list/link-search-no-results/index.js +1 -1
  69. package/dist/esm/ui/link-picker/{list-item → link-search-list/list-item}/index.js +3 -2
  70. package/dist/esm/ui/link-picker/{list-item → link-search-list/list-item}/styled.js +2 -2
  71. package/dist/esm/ui/link-picker/link-search-list/styled.js +1 -0
  72. package/dist/esm/ui/{scrolling-tabs → link-picker/scrolling-tabs}/index.js +6 -3
  73. package/dist/esm/ui/link-picker/styled.js +4 -19
  74. package/dist/esm/ui/link-picker/text-input/index.js +5 -5
  75. package/dist/esm/ui/link-picker/text-input/utils.js +20 -0
  76. package/dist/esm/ui/link-picker/track-mount/index.js +1 -1
  77. package/dist/esm/ui/link-picker/track-tab-viewed/index.js +1 -1
  78. package/dist/esm/ui/link-picker/transformTimeStamp.js +2 -2
  79. package/dist/esm/ui/link-picker/utils.js +1 -43
  80. package/dist/esm/ui/loader-fallback/index.js +1 -1
  81. package/dist/esm/ui/loader-fallback/styled.js +16 -0
  82. package/dist/esm/version.json +1 -1
  83. package/dist/types/common/analytics/context.d.ts +1 -1
  84. package/dist/types/common/constants.d.ts +1 -0
  85. package/dist/types/{ui → common}/types.d.ts +10 -0
  86. package/dist/types/common/utils/handleNavKeyDown.d.ts +2 -0
  87. package/dist/types/index.d.ts +1 -1
  88. package/dist/types/services/use-plugins/index.d.ts +1 -1
  89. package/dist/types/services/use-plugins/reducer.d.ts +1 -1
  90. package/dist/types/services/use-plugins/utils.d.ts +1 -1
  91. package/dist/types/services/use-search-query/index.d.ts +1 -2
  92. package/dist/types/ui/link-picker/form-footer/index.d.ts +1 -2
  93. package/dist/types/ui/link-picker/form-footer/utils.d.ts +1 -1
  94. package/dist/types/ui/link-picker/index.d.ts +1 -13
  95. package/dist/types/ui/link-picker/link-search-list/index.d.ts +1 -1
  96. package/dist/types/ui/link-picker/{list-item → link-search-list/list-item}/index.d.ts +1 -1
  97. package/dist/types/ui/link-picker/link-search-list/use-track-results-shown/index.d.ts +1 -1
  98. package/dist/types/ui/link-picker/styled.d.ts +0 -5
  99. package/dist/types/ui/link-picker/{conditional-spotlight-target-wrapper → text-input/conditional-spotlight-target-wrapper}/index.d.ts +1 -2
  100. package/dist/types/ui/link-picker/text-input/index.d.ts +1 -1
  101. package/dist/types/ui/link-picker/text-input/utils.d.ts +3 -0
  102. package/dist/types/ui/link-picker/utils.d.ts +1 -5
  103. package/dist/types/ui/loader-fallback/styled.d.ts +3 -0
  104. package/dist/types-ts4.5/common/analytics/context.d.ts +1 -1
  105. package/dist/types-ts4.5/common/constants.d.ts +1 -0
  106. package/dist/types-ts4.5/{ui → common}/types.d.ts +10 -0
  107. package/dist/types-ts4.5/common/utils/handleNavKeyDown.d.ts +2 -0
  108. package/dist/types-ts4.5/index.d.ts +1 -1
  109. package/dist/types-ts4.5/services/use-plugins/index.d.ts +1 -1
  110. package/dist/types-ts4.5/services/use-plugins/reducer.d.ts +1 -1
  111. package/dist/types-ts4.5/services/use-plugins/utils.d.ts +1 -1
  112. package/dist/types-ts4.5/services/use-search-query/index.d.ts +1 -2
  113. package/dist/types-ts4.5/ui/link-picker/form-footer/index.d.ts +1 -2
  114. package/dist/types-ts4.5/ui/link-picker/form-footer/utils.d.ts +1 -1
  115. package/dist/types-ts4.5/ui/link-picker/index.d.ts +1 -13
  116. package/dist/types-ts4.5/ui/link-picker/link-search-list/index.d.ts +1 -1
  117. package/dist/types-ts4.5/ui/link-picker/{list-item → link-search-list/list-item}/index.d.ts +1 -1
  118. package/dist/types-ts4.5/ui/link-picker/link-search-list/use-track-results-shown/index.d.ts +1 -1
  119. package/dist/types-ts4.5/ui/link-picker/styled.d.ts +0 -5
  120. package/dist/types-ts4.5/ui/link-picker/{conditional-spotlight-target-wrapper → text-input/conditional-spotlight-target-wrapper}/index.d.ts +1 -2
  121. package/dist/types-ts4.5/ui/link-picker/text-input/index.d.ts +1 -1
  122. package/dist/types-ts4.5/ui/link-picker/text-input/utils.d.ts +3 -0
  123. package/dist/types-ts4.5/ui/link-picker/utils.d.ts +1 -5
  124. package/dist/types-ts4.5/ui/loader-fallback/styled.d.ts +3 -0
  125. package/package.json +25 -5
  126. /package/dist/cjs/{ui → common}/types.js +0 -0
  127. /package/dist/cjs/ui/{scrolling-tabs → link-picker/scrolling-tabs}/scrolling-tabs.js +0 -0
  128. /package/dist/cjs/ui/{scrolling-tabs → link-picker/scrolling-tabs}/styles.js +0 -0
  129. /package/dist/cjs/ui/link-picker/{conditional-spotlight-target-wrapper → text-input/conditional-spotlight-target-wrapper}/index.js +0 -0
  130. /package/dist/es2019/{ui → common}/types.js +0 -0
  131. /package/dist/es2019/ui/{scrolling-tabs → link-picker/scrolling-tabs}/scrolling-tabs.js +0 -0
  132. /package/dist/es2019/ui/{scrolling-tabs → link-picker/scrolling-tabs}/styles.js +0 -0
  133. /package/dist/es2019/ui/link-picker/{conditional-spotlight-target-wrapper → text-input/conditional-spotlight-target-wrapper}/index.js +0 -0
  134. /package/dist/esm/{ui → common}/types.js +0 -0
  135. /package/dist/esm/ui/{scrolling-tabs → link-picker/scrolling-tabs}/scrolling-tabs.js +0 -0
  136. /package/dist/esm/ui/{scrolling-tabs → link-picker/scrolling-tabs}/styles.js +0 -0
  137. /package/dist/esm/ui/link-picker/{conditional-spotlight-target-wrapper → text-input/conditional-spotlight-target-wrapper}/index.js +0 -0
  138. /package/dist/types/ui/link-picker/{list-item → link-search-list/list-item}/styled.d.ts +0 -0
  139. /package/dist/types/ui/{scrolling-tabs → link-picker/scrolling-tabs}/index.d.ts +0 -0
  140. /package/dist/types/ui/{scrolling-tabs → link-picker/scrolling-tabs}/scrolling-tabs.d.ts +0 -0
  141. /package/dist/types/ui/{scrolling-tabs → link-picker/scrolling-tabs}/styles.d.ts +0 -0
  142. /package/dist/types-ts4.5/ui/link-picker/{list-item → link-search-list/list-item}/styled.d.ts +0 -0
  143. /package/dist/types-ts4.5/ui/{scrolling-tabs → link-picker/scrolling-tabs}/index.d.ts +0 -0
  144. /package/dist/types-ts4.5/ui/{scrolling-tabs → link-picker/scrolling-tabs}/scrolling-tabs.d.ts +0 -0
  145. /package/dist/types-ts4.5/ui/{scrolling-tabs → link-picker/scrolling-tabs}/styles.d.ts +0 -0
@@ -1,24 +1,4 @@
1
- import { browser } from '@atlaskit/linking-common/user-agent';
2
1
  import { transformTimeStamp } from './transformTimeStamp';
3
- var KeyZCode = 90;
4
- var KeyYCode = 89;
5
- export var isUndoEvent = function isUndoEvent(e) {
6
- var _browser = browser(),
7
- mac = _browser.mac;
8
- return e.keyCode === KeyZCode && (
9
- // cmd + z for mac
10
- mac && e.metaKey && !e.shiftKey ||
11
- // ctrl + z for non-mac
12
- !mac && e.ctrlKey);
13
- };
14
- export var isRedoEvent = function isRedoEvent(e) {
15
- var _browser2 = browser(),
16
- mac = _browser2.mac;
17
- return (
18
- // ctrl + y for non-mac
19
- !mac && e.ctrlKey && e.keyCode === KeyYCode || mac && e.metaKey && e.shiftKey && e.keyCode === KeyZCode || e.ctrlKey && e.shiftKey && e.keyCode === KeyZCode
20
- );
21
- };
22
2
 
23
3
  /**
24
4
  * Retrieve the data source for a link given the item and the plugin that resolved it
@@ -37,26 +17,4 @@ export function getScreenReaderText(items, selectedIndex, intl) {
37
17
  var date = transformTimeStamp(intl, lastViewedDate, lastUpdatedDate);
38
18
  return [name, container, date].filter(Boolean).join(', ');
39
19
  }
40
- }
41
- export var handleNavKeyDown = function handleNavKeyDown(event, itemsLength, activeIndex) {
42
- var updatedIndex = activeIndex;
43
- switch (event.key) {
44
- case 'ArrowDown':
45
- event.preventDefault();
46
- updatedIndex = (activeIndex + 1) % itemsLength;
47
- break;
48
- case 'ArrowUp':
49
- event.preventDefault();
50
- updatedIndex = activeIndex > 0 ? activeIndex - 1 : itemsLength - 1;
51
- break;
52
- case 'Home':
53
- event.preventDefault();
54
- updatedIndex = 0;
55
- break;
56
- case 'End':
57
- event.preventDefault();
58
- updatedIndex = itemsLength - 1;
59
- break;
60
- }
61
- return updatedIndex;
62
- };
20
+ }
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
3
  import Spinner from '@atlaskit/spinner';
4
- import { rootContainerStylesForLoaderWithDisplaytext, rootContainerStylesForLoaderWithoutDisplaytext } from '../link-picker/styled';
4
+ import { rootContainerStylesForLoaderWithDisplaytext, rootContainerStylesForLoaderWithoutDisplaytext } from './styled';
5
5
 
6
6
  /**
7
7
  * Loader / skeleton for the Link Picker. Takes displayText prop - when no displayText is given the height of the skeleton
@@ -0,0 +1,16 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+ var _templateObject, _templateObject2, _templateObject3;
3
+ import { css } from '@emotion/react';
4
+
5
+ // eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports
6
+ import { rootContainerStyles } from '../link-picker/styled';
7
+
8
+ /** Link Picker loader / skeleton will be taller in height when displayText field is shown */
9
+ // See lazy-load-height example to verify these
10
+ var LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_DISPLAYTEXT = 142;
11
+ var LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_DISPLAYTEXT = 220;
12
+ var rootContainerStylesForLoader = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", "\n display: flex;\n align-items: center;\n justify-content: center;\n"])), rootContainerStyles);
13
+ export var rootContainerStylesForLoaderWithDisplaytext = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n min-height: ", "px;\n"])), rootContainerStylesForLoader, LINK_PICKER_MIN_HEIGHT_IN_PX_WITH_DISPLAYTEXT);
14
+
15
+ /** Link Picker loader / skeleton will be shorter in height when displayText field isn't shown */
16
+ export var rootContainerStylesForLoaderWithoutDisplaytext = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n ", "\n min-height: ", "px;\n"])), rootContainerStylesForLoader, LINK_PICKER_MIN_HEIGHT_IN_PX_WITHOUT_DISPLAYTEXT);
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "1.25.3",
3
+ "version": "1.25.4",
4
4
  "sideEffects": false
5
5
  }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
+ import { LinkPickerProps } from '../../index';
2
3
  import { LinkPickerAnalyticsContextType } from '../utils/analytics/analytics.codegen';
3
- import { LinkPickerProps } from '../../';
4
4
  type AnalyticsContextAttributesType = LinkPickerAnalyticsContextType;
5
5
  export type TrackAttribute = <K extends keyof LinkPickerAnalyticsContextType>(attribute: K, value: AnalyticsContextAttributesType[K]) => void;
6
6
  interface AnalyticsContextType {
@@ -1,2 +1,3 @@
1
1
  export declare const ANALYTICS_CHANNEL = "media";
2
2
  export declare const COMPONENT_NAME = "linkPicker";
3
+ export declare const RECENT_SEARCH_LIST_SIZE = 5;
@@ -61,3 +61,13 @@ export interface LinkPickerPluginAction {
61
61
  }
62
62
  export type LinkPickerPluginErrorFallback = (error: unknown, retry: () => void) => ReactNode;
63
63
  export type LinkPickerPluginEmptyStateNoResults = () => ReactNode;
64
+ export interface PickerState {
65
+ selectedIndex: number;
66
+ activeIndex: number;
67
+ url: string;
68
+ displayText: string;
69
+ invalidUrl: boolean;
70
+ activeTab: number;
71
+ /** When true, even if the selected index is -1, don't hide the recents. */
72
+ preventHidingRecents: boolean;
73
+ }
@@ -0,0 +1,2 @@
1
+ import { KeyboardEvent } from 'react';
2
+ export declare const handleNavKeyDown: (event: KeyboardEvent<HTMLElement>, itemsLength: number, activeIndex: number) => number;
@@ -1,4 +1,4 @@
1
1
  export { ComposedLinkPicker as LinkPicker } from './ui';
2
2
  export type { LinkPickerProps } from './ui/link-picker';
3
- export type { LinkInputType, LinkPickerPluginAction, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, LinkPickerPluginEmptyStateNoResults, } from './ui/types';
3
+ export type { LinkInputType, LinkPickerPluginAction, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, LinkPickerPluginEmptyStateNoResults, } from './common/types';
4
4
  export { UnauthenticatedError } from './common/utils/errors';
@@ -1,4 +1,4 @@
1
- import { LinkPickerPlugin, LinkPickerPluginAction, LinkPickerPluginErrorFallback, LinkPickerState, LinkSearchListItemData } from '../../ui/types';
1
+ import { LinkPickerPlugin, LinkPickerPluginAction, LinkPickerPluginErrorFallback, LinkPickerState, LinkSearchListItemData } from '../../common/types';
2
2
  export interface LinkPickerPluginsService {
3
3
  items: LinkSearchListItemData[] | null;
4
4
  isLoading: boolean;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { LinkSearchListItemData } from '../../ui/types';
2
+ import { LinkSearchListItemData } from '../../common/types';
3
3
  export interface PluginState {
4
4
  items: LinkSearchListItemData[] | null;
5
5
  error: unknown | null;
@@ -1,4 +1,4 @@
1
- import { LinkPickerPlugin, LinkPickerState, ResolveResult } from '../../ui/types';
1
+ import { LinkPickerPlugin, LinkPickerState, ResolveResult } from '../../common/types';
2
2
  export declare class CancellationError extends Error {
3
3
  }
4
4
  export declare const cancellable: <T extends unknown>(promise: Promise<T>) => {
@@ -1,3 +1,2 @@
1
- import { LinkPickerState } from '../../ui/types';
2
- import { PickerState } from '../../ui/link-picker';
1
+ import { LinkPickerState, PickerState } from '../../common/types';
3
2
  export declare function useSearchQuery(state: PickerState): LinkPickerState | null;
@@ -1,7 +1,6 @@
1
1
  /// <reference types="react" />
2
- /** @jsx jsx */
3
2
  import { jsx } from '@emotion/react';
4
- import { LinkPickerPluginAction, LinkPickerState, LinkSearchListItemData } from '../../types';
3
+ import { LinkPickerPluginAction, LinkPickerState, LinkSearchListItemData } from '../../../common/types';
5
4
  export declare const testIds: {
6
5
  readonly insertButton: "link-picker-insert-button";
7
6
  readonly cancelButton: "link-picker-cancel-button";
@@ -1,2 +1,2 @@
1
- import { LinkPickerState, LinkSearchListItemData } from '../../types';
1
+ import { LinkPickerState, LinkSearchListItemData } from '../../../common/types';
2
2
  export declare const checkSubmitDisabled: (isLoading: boolean, error: unknown | null, url: string, queryState: LinkPickerState | null, items: LinkSearchListItemData[] | null) => boolean;
@@ -1,7 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
- import { LinkInputType, LinkPickerPlugin } from '../types';
4
- export declare const RECENT_SEARCH_LIST_SIZE = 5;
3
+ import { LinkInputType, LinkPickerPlugin } from '../../common/types';
5
4
  export declare const testIds: {
6
5
  readonly tabList: "link-picker-tabs";
7
6
  readonly tabItem: "link-picker-tab";
@@ -22,7 +21,6 @@ export declare const testIds: {
22
21
  readonly linkPicker: "link-picker";
23
22
  readonly urlInputField: "link-url";
24
23
  readonly textInputField: "link-text";
25
- readonly searchIcon: "link-picker-search-icon";
26
24
  };
27
25
  interface Meta {
28
26
  /** Indicates how the link was picked. */
@@ -70,15 +68,5 @@ export interface LinkPickerProps {
70
68
  hideDisplayText?: boolean;
71
69
  featureFlags?: Record<string, unknown>;
72
70
  }
73
- export interface PickerState {
74
- selectedIndex: number;
75
- activeIndex: number;
76
- url: string;
77
- displayText: string;
78
- invalidUrl: boolean;
79
- activeTab: number;
80
- /** When true, even if the selected index is -1, don't hide the recents. */
81
- preventHidingRecents: boolean;
82
- }
83
71
  export declare const LinkPicker: import("react").ComponentType<LinkPickerProps>;
84
72
  export {};
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { KeyboardEvent } from 'react';
3
- import { LinkPickerPlugin, LinkSearchListItemData } from '../../types';
3
+ import { LinkPickerPlugin, LinkSearchListItemData } from '../../../common/types';
4
4
  export declare const messages: {
5
5
  titleRecentlyViewed: {
6
6
  id: string;
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { KeyboardEvent } from 'react';
3
- import { LinkSearchListItemData } from '../../types';
3
+ import { LinkSearchListItemData } from '../../../../common/types';
4
4
  export declare const testIds: {
5
5
  searchResultItem: string;
6
6
  searchResultIcon: string;
@@ -1,2 +1,2 @@
1
- import { LinkSearchListItemData } from '../../../types';
1
+ import { LinkSearchListItemData } from '../../../../common/types';
2
2
  export declare const useTrackResultsShown: (isLoading: boolean, items?: LinkSearchListItemData[] | null | undefined, hasSearchTerm?: boolean) => void;
@@ -2,11 +2,6 @@
2
2
  * Half padding on the top as the form field has a `gridSize()` margin top that cannot be overridden
3
3
  */
4
4
  export declare const rootContainerStyles: import("@emotion/react").SerializedStyles;
5
- /** Link Picker loader / skeleton will be taller in height when displayText field is shown */
6
- export declare const rootContainerStylesForLoaderWithDisplaytext: import("@emotion/react").SerializedStyles;
7
- /** Link Picker loader / skeleton will be shorter in height when displayText field isn't shown */
8
- export declare const rootContainerStylesForLoaderWithoutDisplaytext: import("@emotion/react").SerializedStyles;
9
- export declare const searchIconStyles: import("@emotion/react").SerializedStyles;
10
5
  export declare const tabsWrapperStyles: import("@emotion/react").SerializedStyles;
11
6
  export declare const flexColumnStyles: import("@emotion/react").SerializedStyles;
12
7
  export declare const formFooterMargin: import("@emotion/react").SerializedStyles;
@@ -1,5 +1,4 @@
1
- import React from 'react';
2
- import type { FunctionComponent } from 'react';
1
+ import React, { FunctionComponent } from 'react';
3
2
  export interface ConditionalSpotlightTargetWrapperProps {
4
3
  spotlightTargetName?: string;
5
4
  children: React.ReactElement;
@@ -1,6 +1,6 @@
1
1
  import { jsx } from '@emotion/react';
2
2
  import { TextFieldProps } from '@atlaskit/textfield';
3
- import { ConditionalSpotlightTargetWrapperProps } from '../conditional-spotlight-target-wrapper';
3
+ import { ConditionalSpotlightTargetWrapperProps } from './conditional-spotlight-target-wrapper';
4
4
  export type TextInputProps = Omit<TextFieldProps, 'name' | 'value'> & Pick<ConditionalSpotlightTargetWrapperProps, 'spotlightTargetName'> & {
5
5
  name: string;
6
6
  value: string;
@@ -0,0 +1,3 @@
1
+ import { KeyboardEvent } from 'react';
2
+ export declare const isUndoEvent: (e: KeyboardEvent<HTMLInputElement>) => boolean;
3
+ export declare const isRedoEvent: (e: KeyboardEvent<HTMLInputElement>) => boolean;
@@ -1,11 +1,7 @@
1
- import { KeyboardEvent } from 'react';
2
1
  import { IntlShape } from 'react-intl-next';
3
- import { LinkPickerPlugin, LinkSearchListItemData } from '../types';
4
- export declare const isUndoEvent: (e: KeyboardEvent<HTMLInputElement>) => boolean;
5
- export declare const isRedoEvent: (e: KeyboardEvent<HTMLInputElement>) => boolean;
2
+ import { LinkPickerPlugin, LinkSearchListItemData } from '../../common/types';
6
3
  /**
7
4
  * Retrieve the data source for a link given the item and the plugin that resolved it
8
5
  */
9
6
  export declare const getDataSource: (item: LinkSearchListItemData, plugin?: LinkPickerPlugin) => string;
10
7
  export declare function getScreenReaderText(items: LinkSearchListItemData[], selectedIndex: number, intl: IntlShape): string | undefined;
11
- export declare const handleNavKeyDown: (event: KeyboardEvent<HTMLElement>, itemsLength: number, activeIndex: number) => number;
@@ -0,0 +1,3 @@
1
+ export declare const rootContainerStylesForLoaderWithDisplaytext: import("@emotion/react").SerializedStyles;
2
+ /** Link Picker loader / skeleton will be shorter in height when displayText field isn't shown */
3
+ export declare const rootContainerStylesForLoaderWithoutDisplaytext: import("@emotion/react").SerializedStyles;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
+ import { LinkPickerProps } from '../../index';
2
3
  import { LinkPickerAnalyticsContextType } from '../utils/analytics/analytics.codegen';
3
- import { LinkPickerProps } from '../../';
4
4
  type AnalyticsContextAttributesType = LinkPickerAnalyticsContextType;
5
5
  export type TrackAttribute = <K extends keyof LinkPickerAnalyticsContextType>(attribute: K, value: AnalyticsContextAttributesType[K]) => void;
6
6
  interface AnalyticsContextType {
@@ -1,2 +1,3 @@
1
1
  export declare const ANALYTICS_CHANNEL = "media";
2
2
  export declare const COMPONENT_NAME = "linkPicker";
3
+ export declare const RECENT_SEARCH_LIST_SIZE = 5;
@@ -61,3 +61,13 @@ export interface LinkPickerPluginAction {
61
61
  }
62
62
  export type LinkPickerPluginErrorFallback = (error: unknown, retry: () => void) => ReactNode;
63
63
  export type LinkPickerPluginEmptyStateNoResults = () => ReactNode;
64
+ export interface PickerState {
65
+ selectedIndex: number;
66
+ activeIndex: number;
67
+ url: string;
68
+ displayText: string;
69
+ invalidUrl: boolean;
70
+ activeTab: number;
71
+ /** When true, even if the selected index is -1, don't hide the recents. */
72
+ preventHidingRecents: boolean;
73
+ }
@@ -0,0 +1,2 @@
1
+ import { KeyboardEvent } from 'react';
2
+ export declare const handleNavKeyDown: (event: KeyboardEvent<HTMLElement>, itemsLength: number, activeIndex: number) => number;
@@ -1,4 +1,4 @@
1
1
  export { ComposedLinkPicker as LinkPicker } from './ui';
2
2
  export type { LinkPickerProps } from './ui/link-picker';
3
- export type { LinkInputType, LinkPickerPluginAction, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, LinkPickerPluginEmptyStateNoResults, } from './ui/types';
3
+ export type { LinkInputType, LinkPickerPluginAction, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, LinkPickerPluginEmptyStateNoResults, } from './common/types';
4
4
  export { UnauthenticatedError } from './common/utils/errors';
@@ -1,4 +1,4 @@
1
- import { LinkPickerPlugin, LinkPickerPluginAction, LinkPickerPluginErrorFallback, LinkPickerState, LinkSearchListItemData } from '../../ui/types';
1
+ import { LinkPickerPlugin, LinkPickerPluginAction, LinkPickerPluginErrorFallback, LinkPickerState, LinkSearchListItemData } from '../../common/types';
2
2
  export interface LinkPickerPluginsService {
3
3
  items: LinkSearchListItemData[] | null;
4
4
  isLoading: boolean;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { LinkSearchListItemData } from '../../ui/types';
2
+ import { LinkSearchListItemData } from '../../common/types';
3
3
  export interface PluginState {
4
4
  items: LinkSearchListItemData[] | null;
5
5
  error: unknown | null;
@@ -1,4 +1,4 @@
1
- import { LinkPickerPlugin, LinkPickerState, ResolveResult } from '../../ui/types';
1
+ import { LinkPickerPlugin, LinkPickerState, ResolveResult } from '../../common/types';
2
2
  export declare class CancellationError extends Error {
3
3
  }
4
4
  export declare const cancellable: <T extends unknown>(promise: Promise<T>) => {
@@ -1,3 +1,2 @@
1
- import { LinkPickerState } from '../../ui/types';
2
- import { PickerState } from '../../ui/link-picker';
1
+ import { LinkPickerState, PickerState } from '../../common/types';
3
2
  export declare function useSearchQuery(state: PickerState): LinkPickerState | null;
@@ -1,7 +1,6 @@
1
1
  /// <reference types="react" />
2
- /** @jsx jsx */
3
2
  import { jsx } from '@emotion/react';
4
- import { LinkPickerPluginAction, LinkPickerState, LinkSearchListItemData } from '../../types';
3
+ import { LinkPickerPluginAction, LinkPickerState, LinkSearchListItemData } from '../../../common/types';
5
4
  export declare const testIds: {
6
5
  readonly insertButton: "link-picker-insert-button";
7
6
  readonly cancelButton: "link-picker-cancel-button";
@@ -1,2 +1,2 @@
1
- import { LinkPickerState, LinkSearchListItemData } from '../../types';
1
+ import { LinkPickerState, LinkSearchListItemData } from '../../../common/types';
2
2
  export declare const checkSubmitDisabled: (isLoading: boolean, error: unknown | null, url: string, queryState: LinkPickerState | null, items: LinkSearchListItemData[] | null) => boolean;
@@ -1,7 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
- import { LinkInputType, LinkPickerPlugin } from '../types';
4
- export declare const RECENT_SEARCH_LIST_SIZE = 5;
3
+ import { LinkInputType, LinkPickerPlugin } from '../../common/types';
5
4
  export declare const testIds: {
6
5
  readonly tabList: "link-picker-tabs";
7
6
  readonly tabItem: "link-picker-tab";
@@ -22,7 +21,6 @@ export declare const testIds: {
22
21
  readonly linkPicker: "link-picker";
23
22
  readonly urlInputField: "link-url";
24
23
  readonly textInputField: "link-text";
25
- readonly searchIcon: "link-picker-search-icon";
26
24
  };
27
25
  interface Meta {
28
26
  /** Indicates how the link was picked. */
@@ -70,15 +68,5 @@ export interface LinkPickerProps {
70
68
  hideDisplayText?: boolean;
71
69
  featureFlags?: Record<string, unknown>;
72
70
  }
73
- export interface PickerState {
74
- selectedIndex: number;
75
- activeIndex: number;
76
- url: string;
77
- displayText: string;
78
- invalidUrl: boolean;
79
- activeTab: number;
80
- /** When true, even if the selected index is -1, don't hide the recents. */
81
- preventHidingRecents: boolean;
82
- }
83
71
  export declare const LinkPicker: import("react").ComponentType<LinkPickerProps>;
84
72
  export {};
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { KeyboardEvent } from 'react';
3
- import { LinkPickerPlugin, LinkSearchListItemData } from '../../types';
3
+ import { LinkPickerPlugin, LinkSearchListItemData } from '../../../common/types';
4
4
  export declare const messages: {
5
5
  titleRecentlyViewed: {
6
6
  id: string;
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { KeyboardEvent } from 'react';
3
- import { LinkSearchListItemData } from '../../types';
3
+ import { LinkSearchListItemData } from '../../../../common/types';
4
4
  export declare const testIds: {
5
5
  searchResultItem: string;
6
6
  searchResultIcon: string;
@@ -1,2 +1,2 @@
1
- import { LinkSearchListItemData } from '../../../types';
1
+ import { LinkSearchListItemData } from '../../../../common/types';
2
2
  export declare const useTrackResultsShown: (isLoading: boolean, items?: LinkSearchListItemData[] | null | undefined, hasSearchTerm?: boolean) => void;
@@ -2,11 +2,6 @@
2
2
  * Half padding on the top as the form field has a `gridSize()` margin top that cannot be overridden
3
3
  */
4
4
  export declare const rootContainerStyles: import("@emotion/react").SerializedStyles;
5
- /** Link Picker loader / skeleton will be taller in height when displayText field is shown */
6
- export declare const rootContainerStylesForLoaderWithDisplaytext: import("@emotion/react").SerializedStyles;
7
- /** Link Picker loader / skeleton will be shorter in height when displayText field isn't shown */
8
- export declare const rootContainerStylesForLoaderWithoutDisplaytext: import("@emotion/react").SerializedStyles;
9
- export declare const searchIconStyles: import("@emotion/react").SerializedStyles;
10
5
  export declare const tabsWrapperStyles: import("@emotion/react").SerializedStyles;
11
6
  export declare const flexColumnStyles: import("@emotion/react").SerializedStyles;
12
7
  export declare const formFooterMargin: import("@emotion/react").SerializedStyles;
@@ -1,5 +1,4 @@
1
- import React from 'react';
2
- import type { FunctionComponent } from 'react';
1
+ import React, { FunctionComponent } from 'react';
3
2
  export interface ConditionalSpotlightTargetWrapperProps {
4
3
  spotlightTargetName?: string;
5
4
  children: React.ReactElement;
@@ -1,6 +1,6 @@
1
1
  import { jsx } from '@emotion/react';
2
2
  import { TextFieldProps } from '@atlaskit/textfield';
3
- import { ConditionalSpotlightTargetWrapperProps } from '../conditional-spotlight-target-wrapper';
3
+ import { ConditionalSpotlightTargetWrapperProps } from './conditional-spotlight-target-wrapper';
4
4
  export type TextInputProps = Omit<TextFieldProps, 'name' | 'value'> & Pick<ConditionalSpotlightTargetWrapperProps, 'spotlightTargetName'> & {
5
5
  name: string;
6
6
  value: string;
@@ -0,0 +1,3 @@
1
+ import { KeyboardEvent } from 'react';
2
+ export declare const isUndoEvent: (e: KeyboardEvent<HTMLInputElement>) => boolean;
3
+ export declare const isRedoEvent: (e: KeyboardEvent<HTMLInputElement>) => boolean;
@@ -1,11 +1,7 @@
1
- import { KeyboardEvent } from 'react';
2
1
  import { IntlShape } from 'react-intl-next';
3
- import { LinkPickerPlugin, LinkSearchListItemData } from '../types';
4
- export declare const isUndoEvent: (e: KeyboardEvent<HTMLInputElement>) => boolean;
5
- export declare const isRedoEvent: (e: KeyboardEvent<HTMLInputElement>) => boolean;
2
+ import { LinkPickerPlugin, LinkSearchListItemData } from '../../common/types';
6
3
  /**
7
4
  * Retrieve the data source for a link given the item and the plugin that resolved it
8
5
  */
9
6
  export declare const getDataSource: (item: LinkSearchListItemData, plugin?: LinkPickerPlugin) => string;
10
7
  export declare function getScreenReaderText(items: LinkSearchListItemData[], selectedIndex: number, intl: IntlShape): string | undefined;
11
- export declare const handleNavKeyDown: (event: KeyboardEvent<HTMLElement>, itemsLength: number, activeIndex: number) => number;
@@ -0,0 +1,3 @@
1
+ export declare const rootContainerStylesForLoaderWithDisplaytext: import("@emotion/react").SerializedStyles;
2
+ /** Link Picker loader / skeleton will be shorter in height when displayText field isn't shown */
3
+ export declare const rootContainerStylesForLoaderWithoutDisplaytext: import("@emotion/react").SerializedStyles;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "1.25.3",
3
+ "version": "1.25.4",
4
4
  "description": "Standalone link picker",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "publishConfig": {
@@ -52,14 +52,14 @@
52
52
  "@atlaskit/form": "^8.11.0",
53
53
  "@atlaskit/frontend-utilities": "^2.7.0",
54
54
  "@atlaskit/icon": "^21.12.0",
55
- "@atlaskit/linking-common": "^3.0.0",
55
+ "@atlaskit/linking-common": "^3.1.0",
56
56
  "@atlaskit/onboarding": "^10.8.2",
57
57
  "@atlaskit/platform-feature-flags": "^0.2.1",
58
58
  "@atlaskit/spinner": "^15.5.0",
59
59
  "@atlaskit/tabs": "^13.4.0",
60
60
  "@atlaskit/textfield": "^5.5.0",
61
61
  "@atlaskit/theme": "^12.5.0",
62
- "@atlaskit/tokens": "^1.9.0",
62
+ "@atlaskit/tokens": "^1.10.0",
63
63
  "@atlaskit/tooltip": "^17.8.0",
64
64
  "@atlaskit/ufo": "^0.2.0",
65
65
  "@atlaskit/visually-hidden": "^1.2.0",
@@ -82,14 +82,14 @@
82
82
  "@atlaskit/link-analytics": "^8.0.0",
83
83
  "@atlaskit/link-provider": "^1.6.0",
84
84
  "@atlaskit/link-test-helpers": "^4.1.0",
85
- "@atlaskit/linking-common": "^3.0.0",
85
+ "@atlaskit/linking-common": "^3.1.0",
86
86
  "@atlaskit/popup": "^1.8.0",
87
87
  "@atlaskit/toggle": "^12.6.0",
88
88
  "@atlaskit/visual-regression": "*",
89
89
  "@atlaskit/webdriver-runner": "*",
90
90
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
91
91
  "@atlassian/feature-flags-test-utils": "*",
92
- "@atlassian/link-picker-atlassian-plugin": "^34.0.0",
92
+ "@atlassian/link-picker-atlassian-plugin": "^34.1.0",
93
93
  "@atlassian/link-picker-plugins": "^23.0.0",
94
94
  "@atlassian/recent-work-client": "^1.8.0",
95
95
  "@testing-library/dom": "^8.17.1",
@@ -108,12 +108,32 @@
108
108
  "typescript": "~4.9.5"
109
109
  },
110
110
  "techstack": {
111
+ "@atlassian/frontend": {
112
+ "code-structure": [
113
+ "tangerine-next"
114
+ ],
115
+ "import-structure": [
116
+ "atlassian-conventions"
117
+ ],
118
+ "circular-dependencies": [
119
+ "file-and-folder-level"
120
+ ]
121
+ },
111
122
  "@repo/internal": {
123
+ "dom-events": "use-bind-event-listener",
124
+ "analytics": [
125
+ "analytics-next"
126
+ ],
112
127
  "design-tokens": [
113
128
  "color",
114
129
  "spacing"
115
130
  ]
116
131
  }
117
132
  },
133
+ "techstackIgnore": {
134
+ "stricter": [
135
+ "@atlassian/tangerine/project-structure"
136
+ ]
137
+ },
118
138
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
119
139
  }
File without changes
File without changes
File without changes