@atlaskit/link-picker 1.11.1 → 1.12.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.
Files changed (55) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/analytics.codegen.js +1 -1
  3. package/dist/cjs/common/analytics/context.js +8 -2
  4. package/dist/cjs/ui/link-picker/index.js +32 -38
  5. package/dist/cjs/ui/link-picker/list-item/index.js +1 -1
  6. package/dist/cjs/ui/link-picker/text-input/index.js +8 -5
  7. package/dist/cjs/ui/link-picker/track-mount/index.js +47 -0
  8. package/dist/cjs/ui/link-picker/track-tab-viewed/index.js +32 -0
  9. package/dist/cjs/ui/scrolling-tabs/index.js +192 -0
  10. package/dist/cjs/ui/scrolling-tabs/scrolling-tabs.js +123 -0
  11. package/dist/cjs/ui/scrolling-tabs/styles.js +64 -0
  12. package/dist/cjs/version.json +1 -1
  13. package/dist/es2019/analytics.codegen.js +1 -1
  14. package/dist/es2019/common/analytics/context.js +8 -2
  15. package/dist/es2019/ui/link-picker/index.js +29 -33
  16. package/dist/es2019/ui/link-picker/list-item/index.js +1 -1
  17. package/dist/es2019/ui/link-picker/text-input/index.js +4 -1
  18. package/dist/es2019/ui/link-picker/track-mount/index.js +31 -0
  19. package/dist/es2019/ui/link-picker/track-tab-viewed/index.js +19 -0
  20. package/dist/es2019/ui/scrolling-tabs/index.js +127 -0
  21. package/dist/es2019/ui/scrolling-tabs/scrolling-tabs.js +90 -0
  22. package/dist/es2019/ui/scrolling-tabs/styles.js +49 -0
  23. package/dist/es2019/version.json +1 -1
  24. package/dist/esm/analytics.codegen.js +1 -1
  25. package/dist/esm/common/analytics/context.js +8 -2
  26. package/dist/esm/ui/link-picker/index.js +32 -39
  27. package/dist/esm/ui/link-picker/list-item/index.js +1 -1
  28. package/dist/esm/ui/link-picker/text-input/index.js +4 -1
  29. package/dist/esm/ui/link-picker/track-mount/index.js +31 -0
  30. package/dist/esm/ui/link-picker/track-tab-viewed/index.js +19 -0
  31. package/dist/esm/ui/scrolling-tabs/index.js +165 -0
  32. package/dist/esm/ui/scrolling-tabs/scrolling-tabs.js +96 -0
  33. package/dist/esm/ui/scrolling-tabs/styles.js +49 -0
  34. package/dist/esm/version.json +1 -1
  35. package/dist/types/analytics.codegen.d.ts +4 -1
  36. package/dist/types/ui/link-picker/index.d.ts +3 -2
  37. package/dist/types/ui/link-picker/link-search-list/index.d.ts +0 -1
  38. package/dist/types/ui/link-picker/text-input/index.d.ts +4 -0
  39. package/dist/types/ui/link-picker/track-mount/index.d.ts +5 -0
  40. package/dist/types/ui/link-picker/track-tab-viewed/index.d.ts +4 -0
  41. package/dist/types/ui/scrolling-tabs/index.d.ts +7 -0
  42. package/dist/types/ui/scrolling-tabs/scrolling-tabs.d.ts +11 -0
  43. package/dist/types/ui/scrolling-tabs/styles.d.ts +6 -0
  44. package/dist/types-ts4.0/analytics.codegen.d.ts +4 -1
  45. package/dist/types-ts4.0/ui/link-picker/index.d.ts +3 -2
  46. package/dist/types-ts4.0/ui/link-picker/link-search-list/index.d.ts +0 -1
  47. package/dist/types-ts4.0/ui/link-picker/text-input/index.d.ts +4 -0
  48. package/dist/types-ts4.0/ui/link-picker/track-mount/index.d.ts +5 -0
  49. package/dist/types-ts4.0/ui/link-picker/track-tab-viewed/index.d.ts +4 -0
  50. package/dist/types-ts4.0/ui/scrolling-tabs/index.d.ts +7 -0
  51. package/dist/types-ts4.0/ui/scrolling-tabs/scrolling-tabs.d.ts +11 -0
  52. package/dist/types-ts4.0/ui/scrolling-tabs/styles.d.ts +6 -0
  53. package/package.json +20 -15
  54. package/report.api.md +21 -12
  55. package/tmp/api-report-tmp.d.ts +95 -0
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Generates analytics utilities from the package analytics spec yaml
5
5
  *
6
- * @codegen <<SignedSource::05d8b1c9e46066efd0d11fa9d19c32a9>>
6
+ * @codegen <<SignedSource::c0fb3bb39f50f3a7c35ebd90e8903280>>
7
7
  * @codegenCommand yarn workspace @atlaskit/link-picker run codegen-analytics
8
8
  */
9
9
  export declare type PackageMetaDataType = {
@@ -19,12 +19,14 @@ export declare type LinkPickerAnalyticsContextType = {
19
19
  linkFieldContentInputSource: string | null;
20
20
  displayTextFieldContent: 'text_string' | null;
21
21
  displayTextFieldContentInputMethod: 'manual' | 'paste' | null;
22
+ tab: string | null;
22
23
  };
23
24
  export declare type FormSubmittedLinkPickerAttributesType = {};
24
25
  export declare type InlineDialogViewedLinkPickerAttributesType = {};
25
26
  export declare type InlineDialogClosedLinkPickerAttributesType = {};
26
27
  export declare type TextFieldUpdatedLinkFieldAttributesType = {};
27
28
  export declare type TextFieldUpdatedDisplayTextFieldAttributesType = {};
29
+ export declare type TabViewedAttributesType = {};
28
30
  export declare type LinkPickerUnhandledErrorCaughtAttributesType = {
29
31
  browserInfo: string;
30
32
  error: string;
@@ -39,6 +41,7 @@ declare type AnalyticsEventAttributes = {
39
41
  'ui.inlineDialog.closed.linkPicker': InlineDialogClosedLinkPickerAttributesType;
40
42
  'ui.textField.updated.linkField': TextFieldUpdatedLinkFieldAttributesType;
41
43
  'ui.textField.updated.displayTextField': TextFieldUpdatedDisplayTextFieldAttributesType;
44
+ 'ui.tab.viewed': TabViewedAttributesType;
42
45
  'ui.linkPicker.unhandledErrorCaught': LinkPickerUnhandledErrorCaughtAttributesType;
43
46
  'operational.resultsResolve.failed': ResultsResolveFailedAttributesType;
44
47
  };
@@ -3,10 +3,10 @@ import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
3
  import { LinkInputType, LinkPickerPlugin } from '../types';
4
4
  export declare const RECENT_SEARCH_LIST_SIZE = 5;
5
5
  export declare const testIds: {
6
- readonly clearUrlButton: "clear-text";
7
- readonly urlError: "link-error";
8
6
  readonly tabList: "link-picker-tabs";
9
7
  readonly tabItem: "link-picker-tab";
8
+ readonly urlError: string;
9
+ readonly clearUrlButton: string;
10
10
  readonly resultListTitle: string;
11
11
  readonly searchResultItem: string;
12
12
  readonly searchResultList: string;
@@ -61,6 +61,7 @@ export interface LinkPickerProps {
61
61
  component?: React.ComponentType<Partial<LinkPickerProps> & {
62
62
  children: React.ReactElement;
63
63
  }>;
64
+ featureFlags?: Record<string, unknown>;
64
65
  }
65
66
  export interface PickerState {
66
67
  selectedIndex: number;
@@ -36,7 +36,6 @@ export interface LinkSearchListProps extends Omit<React.HTMLAttributes<HTMLDivEl
36
36
  ariaLabelledBy?: string;
37
37
  role?: string;
38
38
  id?: string;
39
- error?: unknown;
40
39
  hasSearchTerm?: boolean;
41
40
  }
42
41
  declare const LinkSearchList: import("react").ForwardRefExoticComponent<LinkSearchListProps & import("react").RefAttributes<HTMLDivElement>>;
@@ -10,5 +10,9 @@ export declare type TextInputProps = Omit<TextFieldProps, 'name' | 'value'> & {
10
10
  clearLabel?: string;
11
11
  error?: string | null;
12
12
  };
13
+ export declare const testIds: {
14
+ urlError: string;
15
+ clearUrlButton: string;
16
+ };
13
17
  declare const TextInput: ({ name, label, autoFocus, onRedo, onUndo, onKeyDown, onClear, clearLabel, error, ...restProps }: TextInputProps) => jsx.JSX.Element;
14
18
  export default TextInput;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * UFO + Analytics tracking for component mount (and unmount)
3
+ */
4
+ declare function TrackMount(): null;
5
+ export default TrackMount;
@@ -0,0 +1,4 @@
1
+ declare function TrackTabViewed({ activeTab }: {
2
+ activeTab: number | null;
3
+ }): null;
4
+ export default TrackTabViewed;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { jsx } from '@emotion/react';
3
+ interface ScrollingTabListProps {
4
+ children: JSX.Element;
5
+ }
6
+ export declare const ScrollingTabList: (props: ScrollingTabListProps) => jsx.JSX.Element;
7
+ export default ScrollingTabList;
@@ -0,0 +1,11 @@
1
+ import { RefObject } from 'react';
2
+ export interface ConditionalButtons {
3
+ back: boolean;
4
+ forward: boolean;
5
+ }
6
+ export declare const scrollBack: (ref: RefObject<HTMLDivElement>) => void;
7
+ export declare const scrollForward: (ref: RefObject<HTMLDivElement>) => void;
8
+ export declare const calculateConditionalButtons: (container: HTMLElement | null | undefined, hideButtons: boolean) => ConditionalButtons;
9
+ export declare const createGhost: () => HTMLDivElement;
10
+ export declare const getTabList: (ref: RefObject<HTMLDivElement>) => Element | null | undefined;
11
+ export declare const getContainer: (ref: RefObject<HTMLDivElement>) => HTMLElement | null | undefined;
@@ -0,0 +1,6 @@
1
+ import { SerializedStyles } from '@emotion/react';
2
+ export declare const scrollingContainerStyles: SerializedStyles;
3
+ export declare const containerStyles: SerializedStyles;
4
+ export declare const buttonContainerStyles: SerializedStyles;
5
+ export declare const backButtonStyles: SerializedStyles;
6
+ export declare const nextButtonStyles: SerializedStyles;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "1.11.1",
3
+ "version": "1.12.0",
4
4
  "description": "Standalone link picker",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "publishConfig": {
@@ -23,7 +23,8 @@
23
23
  "typesVersions": {
24
24
  ">=4.0 <4.5": {
25
25
  "*": [
26
- "dist/types-ts4.0/*"
26
+ "dist/types-ts4.0/*",
27
+ "dist/types-ts4.0/index.d.ts"
27
28
  ]
28
29
  }
29
30
  },
@@ -34,21 +35,22 @@
34
35
  },
35
36
  "scripts": {
36
37
  "ak-postbuild": "ls -d dist/* | grep -v dist/types | xargs -n 1 copyfiles -u 1 -V src/**/*.svg",
37
- "codegen-analytics": "ts-node --project ../../../tsconfig.node.json ./scripts/build/codegen-analytics"
38
+ "codegen-analytics": "ts-node --project ../../../tsconfig.node.json ./scripts/build/codegen-analytics",
39
+ "docs-analytics": "ts-node --project ../../../tsconfig.node.json ./scripts/build/docs-analytics"
38
40
  },
39
41
  "dependencies": {
40
42
  "@atlaskit/analytics-next": "^8.3.1",
41
- "@atlaskit/button": "^16.2.0",
43
+ "@atlaskit/button": "^16.4.0",
42
44
  "@atlaskit/empty-state": "^7.4.0",
43
- "@atlaskit/form": "^8.5.1",
45
+ "@atlaskit/form": "^8.7.0",
44
46
  "@atlaskit/frontend-utilities": "^2.0.0",
45
- "@atlaskit/icon": "^21.10.0",
46
- "@atlaskit/spinner": "^15.1.0",
47
+ "@atlaskit/icon": "^21.11.0",
48
+ "@atlaskit/spinner": "^15.2.0",
47
49
  "@atlaskit/tabs": "^13.3.0",
48
50
  "@atlaskit/textfield": "^5.3.0",
49
51
  "@atlaskit/theme": "^12.2.0",
50
52
  "@atlaskit/tokens": "^0.10.0",
51
- "@atlaskit/tooltip": "^17.5.0",
53
+ "@atlaskit/tooltip": "^17.6.0",
52
54
  "@atlaskit/ufo": "^0.1.0",
53
55
  "@atlaskit/visually-hidden": "^1.1.0",
54
56
  "@babel/runtime": "^7.0.0",
@@ -66,18 +68,20 @@
66
68
  "devDependencies": {
67
69
  "@af/codegen": "*",
68
70
  "@atlaskit/activity-provider": "^2.3.2",
71
+ "@atlaskit/adf-schema": "^24.0.0",
72
+ "@atlaskit/adf-utils": "^17.1.4",
69
73
  "@atlaskit/docs": "*",
70
- "@atlaskit/link-analytics": "^1.1.0",
71
- "@atlaskit/link-provider": "^1.2.9",
72
- "@atlaskit/link-test-helpers": "^1.5.0",
73
- "@atlaskit/popup": "^1.4.0",
74
+ "@atlaskit/link-analytics": "^2.0.0",
75
+ "@atlaskit/link-provider": "^1.3.0",
76
+ "@atlaskit/link-test-helpers": "^2.0.0",
77
+ "@atlaskit/popup": "^1.5.0",
74
78
  "@atlaskit/ssr": "*",
75
79
  "@atlaskit/toggle": "^12.5.0",
76
80
  "@atlaskit/visual-regression": "*",
77
81
  "@atlaskit/webdriver-runner": "*",
78
82
  "@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
79
- "@atlassian/link-picker-atlassian-plugin": "^21.0.0",
80
- "@atlassian/link-picker-plugins": "^8.0.0",
83
+ "@atlassian/link-picker-atlassian-plugin": "^22.0.0",
84
+ "@atlassian/link-picker-plugins": "^10.0.0",
81
85
  "@atlassian/recent-work-client": "^1.6.0",
82
86
  "@atlassian/search-provider": "^2.3.0",
83
87
  "@testing-library/dom": "^8.17.1",
@@ -86,12 +90,13 @@
86
90
  "@testing-library/react-hooks": "^8.0.1",
87
91
  "@testing-library/user-event": "^14.4.3",
88
92
  "@types/js-yaml": "^3.12.5",
89
- "enzyme": "^3.10.0",
93
+ "enquirer": "^2.3.4",
90
94
  "fetch-mock": "^8.0.0",
91
95
  "jest-extended": "^0.11.2",
92
96
  "js-yaml": "^3.13.1",
93
97
  "lodash": "^4.17.21",
94
98
  "mockdate": "^3.0.2",
99
+ "node-fetch": "^2.6.7",
95
100
  "prettier": "^2.1.1",
96
101
  "react-dom": "^16.8.0",
97
102
  "sinon": "^2.2.0",
package/report.api.md CHANGED
@@ -1,12 +1,17 @@
1
+ <!-- API Report Version: 2.3 -->
2
+
1
3
  ## API Report File for "@atlaskit/link-picker"
2
4
 
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
5
+ > Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
6
+ > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
7
+
8
+ ### Table of contents
9
+
10
+ - [Main Entry Types](#main-entry-types)
4
11
 
5
- <!--
6
- Generated API Report version: 2.0
7
- -->
12
+ ### Main Entry Types
8
13
 
9
- [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
14
+ <!--SECTION START: Main Entry Types-->
10
15
 
11
16
  ```ts
12
17
  /// <reference types="react" />
@@ -33,7 +38,7 @@ export interface LinkPickerPlugin {
33
38
  // (undocumented)
34
39
  resolve: (
35
40
  state: LinkPickerState,
36
- ) => Promise<ResolveResult> | AsyncGenerator<ResolveResult, ResolveResult>;
41
+ ) => AsyncGenerator<ResolveResult, ResolveResult> | Promise<ResolveResult>;
37
42
  tabKey?: string;
38
43
  tabTitle?: string;
39
44
  }
@@ -51,7 +56,9 @@ export interface LinkPickerProps {
51
56
  children: React.ReactElement;
52
57
  }
53
58
  >;
54
- displayText?: string | null;
59
+ displayText?: null | string;
60
+ // (undocumented)
61
+ featureFlags?: Record<string, unknown>;
55
62
  onCancel: () => void;
56
63
  onContentResize?: () => void;
57
64
  onSubmit: (
@@ -71,11 +78,11 @@ export interface LinkPickerState {
71
78
  export interface LinkSearchListItemData {
72
79
  container?: string;
73
80
  icon:
74
- | string
75
81
  | React.ComponentType<{
76
82
  alt: string;
77
- }>;
78
- iconAlt: string | MessageDescriptor;
83
+ }>
84
+ | string;
85
+ iconAlt: MessageDescriptor | string;
79
86
  lastUpdatedDate?: Date;
80
87
  lastViewedDate?: Date;
81
88
  meta?: {
@@ -94,10 +101,10 @@ interface Meta {
94
101
 
95
102
  // @public (undocumented)
96
103
  interface OnSubmitParameter {
97
- displayText: string | null;
104
+ displayText: null | string;
98
105
  meta: Meta;
99
106
  rawUrl?: string;
100
- title: string | null;
107
+ title: null | string;
101
108
  url: string;
102
109
  }
103
110
 
@@ -109,3 +116,5 @@ interface ResolveResult {
109
116
 
110
117
  // (No @packageDocumentation comment for this package)
111
118
  ```
119
+
120
+ <!--SECTION END: Main Entry Types-->
@@ -0,0 +1,95 @@
1
+ ## API Report File for "@atlaskit/link-picker"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ /// <reference types="react" />
8
+
9
+ import { MessageDescriptor } from 'react-intl-next';
10
+ import { default as React_2 } from 'react';
11
+ import { ReactNode } from 'react';
12
+ import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
13
+
14
+ // @public (undocumented)
15
+ export type LinkInputType = 'manual' | 'typeAhead';
16
+
17
+ // @public (undocumented)
18
+ export const LinkPicker: React_2.MemoExoticComponent<(props: LinkPickerProps) => JSX.Element>;
19
+
20
+ // @public (undocumented)
21
+ export interface LinkPickerPlugin {
22
+ errorFallback?: LinkPickerPluginErrorFallback;
23
+ meta?: {
24
+ source?: string;
25
+ };
26
+ // (undocumented)
27
+ resolve: (state: LinkPickerState) => AsyncGenerator<ResolveResult, ResolveResult> | Promise<ResolveResult>;
28
+ tabKey?: string;
29
+ tabTitle?: string;
30
+ }
31
+
32
+ // @public (undocumented)
33
+ export type LinkPickerPluginErrorFallback = (error: unknown, retry: () => void) => ReactNode;
34
+
35
+ // @public (undocumented)
36
+ export interface LinkPickerProps {
37
+ component?: React.ComponentType<Partial<LinkPickerProps> & {
38
+ children: React.ReactElement;
39
+ }>;
40
+ displayText?: null | string;
41
+ // (undocumented)
42
+ featureFlags?: Record<string, unknown>;
43
+ onCancel: () => void;
44
+ onContentResize?: () => void;
45
+ onSubmit: (arg: OnSubmitParameter, analytic?: UIAnalyticsEvent | null) => void;
46
+ plugins?: LinkPickerPlugin[];
47
+ url?: string;
48
+ }
49
+
50
+ // @public (undocumented)
51
+ export interface LinkPickerState {
52
+ query: string;
53
+ }
54
+
55
+ // @public (undocumented)
56
+ export interface LinkSearchListItemData {
57
+ container?: string;
58
+ icon: React.ComponentType<{
59
+ alt: string;
60
+ }> | string;
61
+ iconAlt: MessageDescriptor | string;
62
+ lastUpdatedDate?: Date;
63
+ lastViewedDate?: Date;
64
+ meta?: {
65
+ source?: string;
66
+ };
67
+ name: string;
68
+ objectId: string;
69
+ prefetch?: boolean;
70
+ url: string;
71
+ }
72
+
73
+ // @public (undocumented)
74
+ interface Meta {
75
+ inputMethod: LinkInputType;
76
+ }
77
+
78
+ // @public (undocumented)
79
+ interface OnSubmitParameter {
80
+ displayText: null | string;
81
+ meta: Meta;
82
+ rawUrl?: string;
83
+ title: null | string;
84
+ url: string;
85
+ }
86
+
87
+ // @public (undocumented)
88
+ interface ResolveResult {
89
+ // (undocumented)
90
+ data: LinkSearchListItemData[];
91
+ }
92
+
93
+ // (No @packageDocumentation comment for this package)
94
+
95
+ ```