@atlaskit/link-picker 5.3.3 → 5.3.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 (100) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/types/common/types.d.ts +8 -0
  3. package/errors/package.json +1 -8
  4. package/lazy/package.json +1 -8
  5. package/link-picker/package.json +1 -8
  6. package/loader-fallback/package.json +1 -8
  7. package/package.json +3 -3
  8. package/types/package.json +1 -8
  9. package/dist/types-ts4.5/common/analytics/context.d.ts +0 -31
  10. package/dist/types-ts4.5/common/analytics/experiences.d.ts +0 -11
  11. package/dist/types-ts4.5/common/analytics/index.d.ts +0 -2
  12. package/dist/types-ts4.5/common/analytics/input-field-tracking.d.ts +0 -17
  13. package/dist/types-ts4.5/common/constants.d.ts +0 -5
  14. package/dist/types-ts4.5/common/generic-error-svg/index.d.ts +0 -1
  15. package/dist/types-ts4.5/common/types.d.ts +0 -199
  16. package/dist/types-ts4.5/common/ui/empty-state/index.d.ts +0 -10
  17. package/dist/types-ts4.5/common/ui/min-height-container/index.d.ts +0 -8
  18. package/dist/types-ts4.5/common/utils/analytics/analytics.codegen.d.ts +0 -65
  19. package/dist/types-ts4.5/common/utils/date.d.ts +0 -1
  20. package/dist/types-ts4.5/common/utils/dateUtils.d.ts +0 -8
  21. package/dist/types-ts4.5/common/utils/errors.d.ts +0 -6
  22. package/dist/types-ts4.5/common/utils/handleNavKeyDown.d.ts +0 -2
  23. package/dist/types-ts4.5/controllers/session-provider/index.d.ts +0 -10
  24. package/dist/types-ts4.5/entry-points/errors.d.ts +0 -1
  25. package/dist/types-ts4.5/entry-points/lazy-link-picker.d.ts +0 -1
  26. package/dist/types-ts4.5/entry-points/link-picker.d.ts +0 -1
  27. package/dist/types-ts4.5/entry-points/loader-fallback.d.ts +0 -1
  28. package/dist/types-ts4.5/entry-points/types.d.ts +0 -1
  29. package/dist/types-ts4.5/i18n/cs.d.ts +0 -41
  30. package/dist/types-ts4.5/i18n/da.d.ts +0 -41
  31. package/dist/types-ts4.5/i18n/de.d.ts +0 -41
  32. package/dist/types-ts4.5/i18n/en.d.ts +0 -42
  33. package/dist/types-ts4.5/i18n/en_GB.d.ts +0 -42
  34. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +0 -42
  35. package/dist/types-ts4.5/i18n/es.d.ts +0 -41
  36. package/dist/types-ts4.5/i18n/fi.d.ts +0 -41
  37. package/dist/types-ts4.5/i18n/fr.d.ts +0 -41
  38. package/dist/types-ts4.5/i18n/hr.d.ts +0 -41
  39. package/dist/types-ts4.5/i18n/hu.d.ts +0 -41
  40. package/dist/types-ts4.5/i18n/index.d.ts +0 -1
  41. package/dist/types-ts4.5/i18n/it.d.ts +0 -41
  42. package/dist/types-ts4.5/i18n/ja.d.ts +0 -41
  43. package/dist/types-ts4.5/i18n/ko.d.ts +0 -41
  44. package/dist/types-ts4.5/i18n/languages.d.ts +0 -32
  45. package/dist/types-ts4.5/i18n/nb.d.ts +0 -41
  46. package/dist/types-ts4.5/i18n/nl.d.ts +0 -41
  47. package/dist/types-ts4.5/i18n/pl.d.ts +0 -41
  48. package/dist/types-ts4.5/i18n/pt_BR.d.ts +0 -41
  49. package/dist/types-ts4.5/i18n/ru.d.ts +0 -41
  50. package/dist/types-ts4.5/i18n/sk.d.ts +0 -39
  51. package/dist/types-ts4.5/i18n/sl.d.ts +0 -41
  52. package/dist/types-ts4.5/i18n/sr_RS.d.ts +0 -41
  53. package/dist/types-ts4.5/i18n/sr_YR.d.ts +0 -41
  54. package/dist/types-ts4.5/i18n/sv.d.ts +0 -41
  55. package/dist/types-ts4.5/i18n/th.d.ts +0 -41
  56. package/dist/types-ts4.5/i18n/tr.d.ts +0 -41
  57. package/dist/types-ts4.5/i18n/uk.d.ts +0 -41
  58. package/dist/types-ts4.5/i18n/vi.d.ts +0 -41
  59. package/dist/types-ts4.5/i18n/zh.d.ts +0 -41
  60. package/dist/types-ts4.5/i18n/zh_TW.d.ts +0 -41
  61. package/dist/types-ts4.5/index.d.ts +0 -12
  62. package/dist/types-ts4.5/lazy.d.ts +0 -1
  63. package/dist/types-ts4.5/services/use-plugins/index.d.ts +0 -15
  64. package/dist/types-ts4.5/services/use-plugins/reducer.d.ts +0 -33
  65. package/dist/types-ts4.5/services/use-plugins/utils.d.ts +0 -18
  66. package/dist/types-ts4.5/services/use-search-query/index.d.ts +0 -2
  67. package/dist/types-ts4.5/ui/error-boundary/error-boundary-base/index.d.ts +0 -18
  68. package/dist/types-ts4.5/ui/error-boundary/error-boundary-fallback/index.d.ts +0 -1
  69. package/dist/types-ts4.5/ui/error-boundary/index.d.ts +0 -6
  70. package/dist/types-ts4.5/ui/index.d.ts +0 -16
  71. package/dist/types-ts4.5/ui/lazy.d.ts +0 -4
  72. package/dist/types-ts4.5/ui/link-picker/announcer.d.ts +0 -22
  73. package/dist/types-ts4.5/ui/link-picker/autoSubmitOnChange.d.ts +0 -9
  74. package/dist/types-ts4.5/ui/link-picker/form-footer/index.d.ts +0 -43
  75. package/dist/types-ts4.5/ui/link-picker/form-footer/link-picker-submit-button/index.d.ts +0 -29
  76. package/dist/types-ts4.5/ui/link-picker/form-footer/link-picker-submit-button/utils.d.ts +0 -2
  77. package/dist/types-ts4.5/ui/link-picker/index.d.ts +0 -30
  78. package/dist/types-ts4.5/ui/link-picker/messages.d.ts +0 -95
  79. package/dist/types-ts4.5/ui/link-picker/search-results/index.d.ts +0 -45
  80. package/dist/types-ts4.5/ui/link-picker/search-results/link-search-error/index.d.ts +0 -29
  81. package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/index.d.ts +0 -55
  82. package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/link-search-no-results/index.d.ts +0 -19
  83. package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/link-search-no-results/no-results-svg/index.d.ts +0 -1
  84. package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/list-item/index.d.ts +0 -23
  85. package/dist/types-ts4.5/ui/link-picker/search-results/link-search-list/use-track-results-shown/index.d.ts +0 -2
  86. package/dist/types-ts4.5/ui/link-picker/search-results/scrolling-tabs/index.d.ts +0 -5
  87. package/dist/types-ts4.5/ui/link-picker/search-results/scrolling-tabs/scrolling-tabs.d.ts +0 -11
  88. package/dist/types-ts4.5/ui/link-picker/search-results/search-results-container/index.d.ts +0 -8
  89. package/dist/types-ts4.5/ui/link-picker/search-results/track-tab-viewed/index.d.ts +0 -4
  90. package/dist/types-ts4.5/ui/link-picker/text-input/conditional-spotlight-target-wrapper/index.d.ts +0 -6
  91. package/dist/types-ts4.5/ui/link-picker/text-input/index.d.ts +0 -27
  92. package/dist/types-ts4.5/ui/link-picker/text-input/utils.d.ts +0 -3
  93. package/dist/types-ts4.5/ui/link-picker/track-mount/index.d.ts +0 -4
  94. package/dist/types-ts4.5/ui/link-picker/transformTimeStamp.d.ts +0 -2
  95. package/dist/types-ts4.5/ui/link-picker/utils.d.ts +0 -7
  96. package/dist/types-ts4.5/ui/loader-fallback/index.d.ts +0 -12
  97. package/dist/types-ts4.5/ui/main.d.ts +0 -12
  98. package/dist/types-ts4.5/ui/messages-provider/index.d.ts +0 -5
  99. package/dist/types-ts4.5/ui/messages-provider/lazy-messages-provider/index.d.ts +0 -6
  100. package/dist/types-ts4.5/ui/messages-provider/lazy-messages-provider/utils/fetch-messages-for-locale.d.ts +0 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/link-picker
2
2
 
3
+ ## 5.3.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`027beb2f61316`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/027beb2f61316) -
8
+ Update smart link appearance, if and only if smart link is created from confluence editor quick
9
+ insert menu
10
+
3
11
  ## 5.3.3
4
12
 
5
13
  ### Patch Changes
@@ -1,6 +1,7 @@
1
1
  import type { ReactNode, Ref } from 'react';
2
2
  import type { MessageDescriptor } from 'react-intl';
3
3
  import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
4
+ import type { CardAppearance } from '@atlaskit/linking-common';
4
5
  export type LinkInputType = 'manual' | 'typeAhead';
5
6
  export interface LinkSearchListItemData {
6
7
  /** Unique identifiable attribute for the item */
@@ -95,6 +96,13 @@ export interface PickerState {
95
96
  interface Meta {
96
97
  /** Indicates how the link was picked. */
97
98
  inputMethod: LinkInputType;
99
+ /**
100
+ * Optional hint requesting a specific card appearance for the inserted link.
101
+ * The link picker itself never sets this; consumers (e.g. an editor adapter)
102
+ * may populate it when calling `onSubmit` to request, for example, an embed
103
+ * appearance for a link inserted from a dedicated embed entry point.
104
+ */
105
+ appearance?: CardAppearance;
98
106
  }
99
107
  interface OnSubmitParameter {
100
108
  /** The `url` of the linked resource. */
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "**/*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/errors.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/errors.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/errors.d.ts"
17
10
  }
package/lazy/package.json CHANGED
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "**/*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/lazy-link-picker.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/lazy-link-picker.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/lazy-link-picker.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "**/*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/link-picker.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/link-picker.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/link-picker.d.ts"
17
10
  }
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "**/*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/loader-fallback.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/loader-fallback.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/loader-fallback.d.ts"
17
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-picker",
3
- "version": "5.3.3",
3
+ "version": "5.3.4",
4
4
  "description": "Standalone link picker",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "publishConfig": {
@@ -68,12 +68,12 @@
68
68
  "@atlaskit/linking-common": "^9.13.0",
69
69
  "@atlaskit/platform-feature-flags": "^1.1.0",
70
70
  "@atlaskit/primitives": "^19.0.0",
71
- "@atlaskit/smart-card": "^44.28.0",
71
+ "@atlaskit/smart-card": "^44.29.0",
72
72
  "@atlaskit/spinner": "^19.1.0",
73
73
  "@atlaskit/spotlight": "^0.15.0",
74
74
  "@atlaskit/tabs": "^19.1.0",
75
75
  "@atlaskit/textfield": "^8.3.0",
76
- "@atlaskit/tokens": "^13.3.0",
76
+ "@atlaskit/tokens": "^13.4.0",
77
77
  "@atlaskit/tooltip": "^22.6.0",
78
78
  "@atlaskit/ufo": "^0.5.0",
79
79
  "@atlaskit/visually-hidden": "^3.1.0",
@@ -6,12 +6,5 @@
6
6
  "sideEffects": [
7
7
  "**/*.compiled.css"
8
8
  ],
9
- "types": "../dist/types/entry-points/types.d.ts",
10
- "typesVersions": {
11
- ">=4.5 <5.9": {
12
- "*": [
13
- "../dist/types-ts4.5/entry-points/types.d.ts"
14
- ]
15
- }
16
- }
9
+ "types": "../dist/types/entry-points/types.d.ts"
17
10
  }
@@ -1,31 +0,0 @@
1
- import React from 'react';
2
- import type { LinkPickerProps } from '../types';
3
- import type { LinkPickerAnalyticsContextType } from '../utils/analytics/analytics.codegen';
4
- type AnalyticsContextAttributesType = LinkPickerAnalyticsContextType;
5
- export type TrackAttribute = <K extends keyof LinkPickerAnalyticsContextType>(attribute: K, value: AnalyticsContextAttributesType[K]) => void;
6
- interface AnalyticsContextType {
7
- /**
8
- * Update a single attribute in the analytics context
9
- */
10
- trackAttribute: TrackAttribute;
11
- /**
12
- * Update a set of attributes in the analytics context
13
- */
14
- trackAttributes: (attributes: Partial<LinkPickerAnalyticsContextType>) => void;
15
- /**
16
- * Retrieve the current set of attributes
17
- * Can be used by components to derive/compute new attributes for specific events
18
- */
19
- getAttributes: () => LinkPickerAnalyticsContextType;
20
- }
21
- type LinkPickerAnalyticsProps = Pick<LinkPickerProps, 'url' | 'displayText' | 'plugins'>;
22
- /**
23
- * Hook that exposes the context-level attribute getters and setters.
24
- */
25
- export declare const useLinkPickerAnalytics: () => AnalyticsContextType;
26
- /**
27
- * Wraps a component with the analytics context + listener to update events with contextual-level attributes.
28
- * Should be implemented once at the root of the link picker.
29
- */
30
- export declare function withLinkPickerAnalyticsContext<P extends LinkPickerAnalyticsProps>(WrappedComponent: React.ComponentType<P>): React.ComponentType<P>;
31
- export {};
@@ -1,11 +0,0 @@
1
- import { type CustomData } from '@atlaskit/ufo';
2
- export declare const ufoExperience: {
3
- readonly mounted: "component-mounted";
4
- };
5
- type ExperienceType = keyof typeof ufoExperience;
6
- type ExperienceName = (typeof ufoExperience)[ExperienceType];
7
- export declare const startUfoExperience: (experienceName: ExperienceName, id: string, metadata?: CustomData) => void;
8
- export declare const succeedUfoExperience: (experienceName: ExperienceName, id: string, metadata?: CustomData) => void;
9
- export declare const failUfoExperience: (experienceName: ExperienceName, id: string, metadata?: CustomData) => void;
10
- export declare const abortUfoExperience: (experienceName: ExperienceName, id: string, metadata?: CustomData) => void;
11
- export {};
@@ -1,2 +0,0 @@
1
- export { useLinkPickerAnalytics, withLinkPickerAnalyticsContext } from './context';
2
- export { withInputFieldTracking } from './input-field-tracking';
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import { type LinkPickerAnalyticsContextType } from '../../common/utils/analytics/analytics.codegen';
3
- type InputFields = 'link' | 'displayText';
4
- /**
5
- * Wraps an input field and connects it to the link picker analytics context to provide a baseline of analytics tracking
6
- * @param WrappedComponent The input field to be tracked
7
- * @param field The name of the field (ie matching actionSubjectId)
8
- * @param filterOnChangeEventAttrs Function to hook into and filter/customise the default attribute tracking logic
9
- * @returns HOC Input field with tracking
10
- */
11
- export declare const withInputFieldTracking: <P extends {
12
- onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
13
- onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
14
- onClear?: Function;
15
- onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
16
- }, Field extends InputFields>(WrappedComponent: React.ComponentType<P>, field: Field, filterOnChangeEventAttrs?: <OnChangeAttributes extends Partial<LinkPickerAnalyticsContextType>>(event: React.ChangeEvent<HTMLInputElement>, attributes: OnChangeAttributes) => OnChangeAttributes) => React.ComponentType<P>;
17
- export {};
@@ -1,5 +0,0 @@
1
- export declare const ANALYTICS_CHANNEL = "media";
2
- export declare const COMPONENT_NAME = "linkPicker";
3
- export declare const RECENT_SEARCH_LIST_SIZE = 5;
4
- export declare const LINK_PICKER_WIDTH_IN_PX = 342;
5
- export declare const LINK_PICKER_MIN_HEIGHT_IN_PX_FALLBACK = "290px";
@@ -1 +0,0 @@
1
- export declare const GenericErrorSVG: (props: React.SVGProps<SVGSVGElement>) => JSX.Element;
@@ -1,199 +0,0 @@
1
- import type { ReactNode, Ref } from 'react';
2
- import type { MessageDescriptor } from 'react-intl';
3
- import type { UIAnalyticsEvent } from '@atlaskit/analytics-next';
4
- export type LinkInputType = 'manual' | 'typeAhead';
5
- export interface LinkSearchListItemData {
6
- /** Unique identifiable attribute for the item */
7
- objectId: string;
8
- /** Name / title / display text of the link */
9
- name: string;
10
- /** URL of the resource being linked to */
11
- url: string;
12
- /** Icon to display in link result */
13
- icon: string | React.ComponentType<{
14
- alt: string;
15
- }>;
16
- /** Alt text describing the icon */
17
- iconAlt: string | MessageDescriptor;
18
- /** Context to display in link result */
19
- container?: string;
20
- /** Optional last view date to display in link result */
21
- lastViewedDate?: Date;
22
- /** Optional last updated date to display in link result */
23
- lastUpdatedDate?: Date;
24
- /** Whether the result is pre-fetched from activity provider */
25
- prefetch?: boolean;
26
- /** Metadata about the result */
27
- meta?: {
28
- /** The data source that provided the result */
29
- source?: string;
30
- };
31
- /**
32
- * Optionally override the strings shown in the link result's subtitle
33
- * (by default, the subtitle is the container and date). Provide translated strings.
34
- */
35
- subtitleItems?: Readonly<[
36
- string,
37
- string?
38
- ]>;
39
- }
40
- export interface LinkPickerState {
41
- /** Current query string / URL input field value */
42
- query: string;
43
- }
44
- export interface ResolveResult {
45
- data: LinkSearchListItemData[];
46
- }
47
- export interface LinkPickerUiOptions {
48
- /** Maximum number of lines to display for the item name */
49
- listItemNameMaxLines?: number;
50
- /** Showing dynamic list size based on window height */
51
- recentSearchListSize?: number;
52
- /** Adaptive height */
53
- adaptiveHeight?: boolean;
54
- /** Hide display text */
55
- hideDisplayText?: boolean;
56
- /** Controls showing the image in the no results state */
57
- shouldRenderNoResultsImage?: boolean;
58
- }
59
- export interface LinkPickerPlugin {
60
- resolve: (state: LinkPickerState) => Promise<ResolveResult> | AsyncGenerator<ResolveResult, ResolveResult>;
61
- /** Uniquely identify the tab */
62
- tabKey?: string;
63
- /** Human-readable label for the plugin */
64
- tabTitle?: string;
65
- /** Render function to customise the UI that is displayed when an error occurs resolving results */
66
- errorFallback?: LinkPickerPluginErrorFallback;
67
- /** Render function to customise the UI that is displayed when there are no results, but an empty form (no search term) */
68
- emptyStateNoResults?: LinkPickerPluginEmptyStateNoResults;
69
- /** Metadata about the plugin */
70
- meta?: {
71
- /** The data source that provides all results provided by the plugin */
72
- source?: string;
73
- };
74
- /** Callback for plugin activation */
75
- UNSAFE_onActivation?: () => void;
76
- /** Register Plugin Actions */
77
- action?: LinkPickerPluginAction;
78
- /** Options to override certain configurable styles in the link picker */
79
- uiOptions?: LinkPickerUiOptions;
80
- }
81
- export interface LinkPickerPluginAction {
82
- label: MessageDescriptor | string;
83
- callback: () => void;
84
- }
85
- export type LinkPickerPluginErrorFallback = (error: unknown, retry: () => void) => ReactNode;
86
- export type LinkPickerPluginEmptyStateNoResults = () => ReactNode;
87
- export interface PickerState {
88
- selectedIndex: number;
89
- activeIndex: number;
90
- url: string;
91
- displayText: string;
92
- invalidUrl: boolean;
93
- activeTab: number;
94
- /** When true, even if the selected index is -1, don't hide the recents. */
95
- preventHidingRecents: boolean;
96
- hasPreview: boolean;
97
- }
98
- interface Meta {
99
- /** Indicates how the link was picked. */
100
- inputMethod: LinkInputType;
101
- }
102
- interface OnSubmitParameter {
103
- /** The `url` of the linked resource. */
104
- url: string;
105
- /** The desired text to be displayed alternatively to the title of the linked resource. */
106
- displayText: string | null;
107
- /** The resolved `title` of the resource at the time of link picking (if applicable, null if not known). */
108
- title: string | null;
109
- /** Meta data about the link picking submission. */
110
- meta: Meta;
111
- /**
112
- * The input value of the `url` field at time of submission if inserted "manually".
113
- * This can useful if the `url` was manually inserted with a value that is different from the normalised value returned as `url`.
114
- * @example
115
- * { url: 'https://google.com', rawUrl: 'google.com' }
116
- */
117
- rawUrl?: string;
118
- /** Raw object from the selected resource */
119
- data?: Record<string, unknown>;
120
- }
121
- export interface LinkPickerProps {
122
- /**
123
- * Callback to fire on form submission.
124
- */
125
- onSubmit: (arg: OnSubmitParameter, analytic?: UIAnalyticsEvent | null) => void;
126
- /**
127
- * Callback to fire when the cancel button is clicked.
128
- * If not provided, cancel button is not displayed.
129
- */
130
- onCancel?: () => void;
131
- /** Callback to fire when content is changed inside the link picker e.g. items, when loading, tabs */
132
- onContentResize?: () => void;
133
- /** The url of the linked resource for editing. */
134
- url?: string;
135
- /** The desired text to be displayed alternatively to the title of the linked resource for editing. */
136
- displayText?: string | null;
137
- /** The desired text to be displayed below the display text input field. Only displayed when `platform-linking-visual-refresh-link-picker` gate is enabled. */
138
- displayHelperText?: string | null;
139
- /** Plugins that provide link suggestions / search capabilities. */
140
- plugins?: LinkPickerPlugin[];
141
- /** If set true, Link picker will show the loading spinner where the tabs and results will show. */
142
- isLoadingPlugins?: boolean;
143
- /** Hides the link picker display text field if set to true. */
144
- hideDisplayText?: boolean;
145
- /** Disables the default width containing the link picker. */
146
- disableWidth?: boolean;
147
- /** Override the default left padding. */
148
- paddingLeft?: string;
149
- /** Override the default right padding. */
150
- paddingRight?: string;
151
- /** Override the default top padding. */
152
- paddingTop?: string;
153
- /** Override the default bottom padding. */
154
- paddingBottom?: string;
155
- /** Customise the link picker root component */
156
- component?: React.ComponentType<Partial<LinkPickerProps> & {
157
- children: React.ReactElement;
158
- }>;
159
- /** Allows for customisation of text in the link picker. */
160
- customMessages?: CustomLinkPickerMessages;
161
- /** Allows height of search results to adapt to the number of results being displayed. */
162
- adaptiveHeight?: boolean;
163
- featureFlags?: Record<string, unknown>;
164
- /** Controls showing a "submission in-progres" UX */
165
- isSubmitting?: boolean;
166
- /** This prop controls where the submit button appears. When true the submit button will move below the input field and be full width */
167
- moveSubmitButton?: boolean;
168
- /** Ref to the link picker search input. */
169
- inputRef?: Ref<HTMLInputElement>;
170
- /**Disables URLs that do not have an embeddable preview */
171
- previewableLinksOnly?: boolean;
172
- /**This prop passes one additional error that is secondary to component errors */
173
- additionalError?: React.ReactNode;
174
- /**This prop disables submit button and handles submit on input change */
175
- submitOnInputChange?: boolean;
176
- /** Showing dynamic list size based on window height */
177
- recentSearchListSize?: number;
178
- /** Controls showing the image in the no results state */
179
- shouldRenderNoResultsImage?: boolean;
180
- /** When true, tabs are displayed even if there is only one plugin. */
181
- alwaysShowTabs?: boolean;
182
- }
183
- type CustomLinkPickerMessages = {
184
- /** Label for the link input field */
185
- linkLabel?: MessageDescriptor;
186
- /** Aria label for the link input field */
187
- linkAriaLabel?: MessageDescriptor;
188
- /** Placeholder for the link input field */
189
- linkPlaceholder?: MessageDescriptor;
190
- /** Label for the link display text field */
191
- linkTextLabel?: MessageDescriptor;
192
- /** Placeholder for the link display text field */
193
- linkTextPlaceholder?: MessageDescriptor;
194
- /** Helper text for the link display text field */
195
- linkHelperTextLabel?: MessageDescriptor;
196
- /** Label for the submit button */
197
- submitButtonLabel?: MessageDescriptor;
198
- };
199
- export {};
@@ -1,10 +0,0 @@
1
- type EmptyStateProps = {
2
- header: string;
3
- testId?: string;
4
- description?: React.ReactNode;
5
- renderImage?: () => React.ReactNode;
6
- /** Only rendered if fg `platform-linking-visual-refresh-link-picker` is enabled */
7
- action?: React.ReactNode;
8
- };
9
- export declare const EmptyState: ({ testId, header, description, action, renderImage, }: EmptyStateProps) => JSX.Element;
10
- export {};
@@ -1,8 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import React from 'react';
6
- export declare const MinHeightContainer: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
7
- minHeight: string;
8
- } & React.RefAttributes<HTMLDivElement>>;
@@ -1,65 +0,0 @@
1
- /**
2
- * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
- *
4
- * Generates Typescript types for analytics events from analytics.spec.yaml
5
- *
6
- * @codegen <<SignedSource::590b9da528f0d0b88cea1feaa1815283>>
7
- * @codegenCommand yarn workspace @atlaskit/link-picker run codegen-analytics
8
- */
9
- export type PackageMetaDataType = {
10
- packageName: string;
11
- packageVersion: string;
12
- source: 'linkPicker';
13
- componentName: 'linkPicker';
14
- };
15
- export type LinkPickerAnalyticsContextType = {
16
- linkState: 'editLink' | 'newLink';
17
- linkFieldContent?: 'url' | 'text_string' | null;
18
- linkFieldContentInputMethod?: 'manual' | 'paste' | 'searchResult' | null;
19
- linkFieldContentInputSource?: string | null;
20
- displayTextFieldContent?: 'text_string' | null;
21
- displayTextFieldContentInputMethod?: 'manual' | 'paste' | null;
22
- tab?: string | null;
23
- };
24
- export type FormSubmittedLinkPickerAttributesType = {};
25
- export type InlineDialogViewedLinkPickerAttributesType = {};
26
- export type InlineDialogClosedLinkPickerAttributesType = {};
27
- export type TextFieldUpdatedLinkFieldAttributesType = {};
28
- export type TextFieldUpdatedDisplayTextFieldAttributesType = {};
29
- export type TabViewedAttributesType = {};
30
- export type LinkPickerUnhandledErrorCaughtAttributesType = {
31
- browserInfo: string;
32
- error: string;
33
- componentStack?: string | null;
34
- };
35
- export type SearchResultsShownPreQuerySearchResultsAttributesType = {
36
- resultCount: number;
37
- };
38
- export type SearchResultsShownPostQuerySearchResultsAttributesType = {
39
- resultCount: number;
40
- };
41
- export type ResultsResolveFailedAttributesType = {
42
- error: string;
43
- };
44
- export type AnalyticsEventAttributes = {
45
- 'ui.form.submitted.linkPicker': FormSubmittedLinkPickerAttributesType;
46
- 'ui.inlineDialog.viewed.linkPicker': InlineDialogViewedLinkPickerAttributesType;
47
- 'ui.inlineDialog.closed.linkPicker': InlineDialogClosedLinkPickerAttributesType;
48
- 'ui.textField.updated.linkField': TextFieldUpdatedLinkFieldAttributesType;
49
- 'ui.textField.updated.displayTextField': TextFieldUpdatedDisplayTextFieldAttributesType;
50
- 'ui.tab.viewed': TabViewedAttributesType;
51
- 'ui.linkPicker.unhandledErrorCaught': LinkPickerUnhandledErrorCaughtAttributesType;
52
- 'ui.searchResults.shown.preQuerySearchResults': SearchResultsShownPreQuerySearchResultsAttributesType;
53
- 'ui.searchResults.shown.postQuerySearchResults': SearchResultsShownPostQuerySearchResultsAttributesType;
54
- 'operational.resultsResolve.failed': ResultsResolveFailedAttributesType;
55
- };
56
- type CreateEventPayloadResult<K extends keyof AnalyticsEventAttributes> = {
57
- eventType: string;
58
- action: string;
59
- attributes: AnalyticsEventAttributes[K];
60
- name?: string;
61
- actionSubject?: string;
62
- actionSubjectId?: string;
63
- };
64
- declare function createEventPayload<K extends keyof AnalyticsEventAttributes>(eventKey: K, attributes: AnalyticsEventAttributes[K]): CreateEventPayloadResult<K>;
65
- export default createEventPayload;
@@ -1 +0,0 @@
1
- export declare function isMoreThanOneWeekAgo(date: string | Date): boolean;
@@ -1,8 +0,0 @@
1
- export type Unit = 'second' | 'minute' | 'hour' | 'day' | 'week';
2
- export declare function selectUnit(from: Date | number, to?: Date | number, thresholds?: Partial<Thresholds>): {
3
- value: number;
4
- unit: Unit;
5
- };
6
- type Thresholds = Record<'second' | 'minute' | 'hour' | 'day', number>;
7
- export declare const DEFAULT_THRESHOLDS: Thresholds;
8
- export {};
@@ -1,6 +0,0 @@
1
- export declare class UnauthenticatedError extends Error {
2
- iconUrl: string;
3
- authUrl: string;
4
- description: string;
5
- constructor(iconUrl: string, authUrl: string, description: string);
6
- }
@@ -1,2 +0,0 @@
1
- import { type KeyboardEvent } from 'react';
2
- export declare const handleNavKeyDown: (event: KeyboardEvent<HTMLElement>, itemsLength: number, activeIndex: number) => number;
@@ -1,10 +0,0 @@
1
- import React, { type ReactNode } from 'react';
2
- export type LinkPickerSessionId = string;
3
- export declare const INIT_CONTEXT = "SESSION_UNINITIALIZED";
4
- export declare const SessionContext: React.Context<string>;
5
- interface SessionProviderProps {
6
- children: ReactNode;
7
- }
8
- export declare const LinkPickerSessionProvider: ({ children, }: SessionProviderProps) => React.JSX.Element;
9
- export declare const useLinkPickerSessionId: () => string;
10
- export {};
@@ -1 +0,0 @@
1
- export { UnauthenticatedError } from '../common/utils/errors';
@@ -1 +0,0 @@
1
- export { default as LazyLinkPicker } from '../ui/lazy';
@@ -1 +0,0 @@
1
- export { default } from '../ui';
@@ -1 +0,0 @@
1
- export { LoaderFallback } from '../ui/loader-fallback';
@@ -1 +0,0 @@
1
- export type { LinkPickerProps, LinkInputType, LinkPickerPluginAction, LinkPickerPlugin, LinkPickerState, LinkSearchListItemData, LinkPickerPluginErrorFallback, LinkPickerPluginEmptyStateNoResults, LinkPickerUiOptions, } from '../common/types';
@@ -1,41 +0,0 @@
1
- /**
2
- * NOTE:
3
- *
4
- * This file is automatically generated by Traduki 2.0.
5
- * DO NOT CHANGE IT BY HAND or your changes will be lost.
6
- */
7
- declare const _default: {
8
- 'fabric.linkPicker.button.cancel': string;
9
- 'fabric.linkPicker.button.insert': string;
10
- 'fabric.linkPicker.button.save': string;
11
- 'fabric.linkPicker.clearLink': string;
12
- 'fabric.linkPicker.clearLinkText': string;
13
- 'fabric.linkPicker.hyperlink.searchLinkResults': string;
14
- 'fabric.linkPicker.linkAriaLabel': string;
15
- 'fabric.linkPicker.linkHelperTextAriaLabel': string;
16
- 'fabric.linkPicker.linkHelperTextLabel': string;
17
- 'fabric.linkPicker.linkInvalid': string;
18
- 'fabric.linkPicker.linkLabel': string;
19
- 'fabric.linkPicker.linkPlaceholder': string;
20
- 'fabric.linkPicker.linkTextAriaLabel': string;
21
- 'fabric.linkPicker.linkTextLabel': string;
22
- 'fabric.linkPicker.linkTextPlaceholder': string;
23
- 'fabric.linkPicker.listTitle.recentlyViewed': string;
24
- 'fabric.linkPicker.listTitle.recentlyViewedFormatted': string;
25
- 'fabric.linkPicker.listTitle.results': string;
26
- 'fabric.linkPicker.noEmbed': string;
27
- 'fabric.linkPicker.search.error.description': string;
28
- 'fabric.linkPicker.search.error.heading': string;
29
- 'fabric.linkPicker.search.error.retry': string;
30
- 'fabric.linkPicker.search.linkAriaLabel': string;
31
- 'fabric.linkPicker.search.linkLabel': string;
32
- 'fabric.linkPicker.search.linkPlaceholder': string;
33
- 'fabric.linkPicker.search.noResults.description': string;
34
- 'fabric.linkPicker.search.noResults.heading': string;
35
- 'fabric.linkPicker.status.submitting': string;
36
- 'fabric.linkPicker.time.message.updated': string;
37
- 'fabric.linkPicker.time.message.viewed': string;
38
- 'fabric.linkPicker.unhandledError.description': string;
39
- 'fabric.linkPicker.unhandledError.heading': string;
40
- };
41
- export default _default;
@@ -1,41 +0,0 @@
1
- /**
2
- * NOTE:
3
- *
4
- * This file is automatically generated by Traduki 2.0.
5
- * DO NOT CHANGE IT BY HAND or your changes will be lost.
6
- */
7
- declare const _default: {
8
- 'fabric.linkPicker.button.cancel': string;
9
- 'fabric.linkPicker.button.insert': string;
10
- 'fabric.linkPicker.button.save': string;
11
- 'fabric.linkPicker.clearLink': string;
12
- 'fabric.linkPicker.clearLinkText': string;
13
- 'fabric.linkPicker.hyperlink.searchLinkResults': string;
14
- 'fabric.linkPicker.linkAriaLabel': string;
15
- 'fabric.linkPicker.linkHelperTextAriaLabel': string;
16
- 'fabric.linkPicker.linkHelperTextLabel': string;
17
- 'fabric.linkPicker.linkInvalid': string;
18
- 'fabric.linkPicker.linkLabel': string;
19
- 'fabric.linkPicker.linkPlaceholder': string;
20
- 'fabric.linkPicker.linkTextAriaLabel': string;
21
- 'fabric.linkPicker.linkTextLabel': string;
22
- 'fabric.linkPicker.linkTextPlaceholder': string;
23
- 'fabric.linkPicker.listTitle.recentlyViewed': string;
24
- 'fabric.linkPicker.listTitle.recentlyViewedFormatted': string;
25
- 'fabric.linkPicker.listTitle.results': string;
26
- 'fabric.linkPicker.noEmbed': string;
27
- 'fabric.linkPicker.search.error.description': string;
28
- 'fabric.linkPicker.search.error.heading': string;
29
- 'fabric.linkPicker.search.error.retry': string;
30
- 'fabric.linkPicker.search.linkAriaLabel': string;
31
- 'fabric.linkPicker.search.linkLabel': string;
32
- 'fabric.linkPicker.search.linkPlaceholder': string;
33
- 'fabric.linkPicker.search.noResults.description': string;
34
- 'fabric.linkPicker.search.noResults.heading': string;
35
- 'fabric.linkPicker.status.submitting': string;
36
- 'fabric.linkPicker.time.message.updated': string;
37
- 'fabric.linkPicker.time.message.viewed': string;
38
- 'fabric.linkPicker.unhandledError.description': string;
39
- 'fabric.linkPicker.unhandledError.heading': string;
40
- };
41
- export default _default;