@atlaskit/link-create 5.3.3 → 6.0.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 (126) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/async-select/package.json +1 -8
  3. package/callback-context/package.json +1 -8
  4. package/create-field/package.json +1 -8
  5. package/create-form/package.json +1 -8
  6. package/dist/cjs/common/constants.js +1 -1
  7. package/dist/es2019/common/constants.js +1 -1
  8. package/dist/esm/common/constants.js +1 -1
  9. package/dist/types/entry-points/callback-context.d.ts +1 -1
  10. package/dist/types/index.d.ts +1 -1
  11. package/exit-warning-modal/package.json +1 -8
  12. package/final-form/package.json +1 -8
  13. package/form-loader/package.json +1 -8
  14. package/form-spy/package.json +1 -8
  15. package/icons/package.json +1 -8
  16. package/inline-create/package.json +1 -8
  17. package/modal-create/package.json +1 -8
  18. package/package.json +25 -33
  19. package/select/package.json +1 -8
  20. package/text-field/package.json +1 -8
  21. package/types/package.json +1 -8
  22. package/user-picker/package.json +1 -8
  23. package/dist/types-ts4.5/common/constants.d.ts +0 -12
  24. package/dist/types-ts4.5/common/messages.d.ts +0 -7
  25. package/dist/types-ts4.5/common/types.d.ts +0 -152
  26. package/dist/types-ts4.5/common/ui/Button/index.d.ts +0 -10
  27. package/dist/types-ts4.5/common/ui/ModalDialog/index.d.ts +0 -13
  28. package/dist/types-ts4.5/common/ui/confirm-dismiss-dialog/main.d.ts +0 -7
  29. package/dist/types-ts4.5/common/ui/confirm-dismiss-dialog/messages.d.ts +0 -7
  30. package/dist/types-ts4.5/common/ui/edit-modal/index.d.ts +0 -11
  31. package/dist/types-ts4.5/common/ui/error-boundary/error-boundary-base/index.d.ts +0 -18
  32. package/dist/types-ts4.5/common/ui/error-boundary/index.d.ts +0 -6
  33. package/dist/types-ts4.5/common/ui/error-boundary-modal/index.d.ts +0 -10
  34. package/dist/types-ts4.5/common/ui/error-boundary-ui/error-svg/index.d.ts +0 -2
  35. package/dist/types-ts4.5/common/ui/error-boundary-ui/index.d.ts +0 -4
  36. package/dist/types-ts4.5/common/ui/error-boundary-ui/messages.d.ts +0 -7
  37. package/dist/types-ts4.5/common/ui/experience-tracker/index.d.ts +0 -22
  38. package/dist/types-ts4.5/common/ui/icon/index.d.ts +0 -13
  39. package/dist/types-ts4.5/common/ui/icon/messages.d.ts +0 -12
  40. package/dist/types-ts4.5/common/ui/link-create-content/index.d.ts +0 -8
  41. package/dist/types-ts4.5/common/ui/message/index.d.ts +0 -14
  42. package/dist/types-ts4.5/common/ui/modal-hero/index.d.ts +0 -6
  43. package/dist/types-ts4.5/common/utils/analytics/analytics.codegen.d.ts +0 -75
  44. package/dist/types-ts4.5/common/utils/analytics/components.d.ts +0 -7
  45. package/dist/types-ts4.5/common/utils/analytics/context.d.ts +0 -29
  46. package/dist/types-ts4.5/common/utils/errors/index.d.ts +0 -10
  47. package/dist/types-ts4.5/common/utils/form/index.d.ts +0 -7
  48. package/dist/types-ts4.5/common/utils/locale/fetch-messages-for-locale.d.ts +0 -2
  49. package/dist/types-ts4.5/controllers/callback-context/main.d.ts +0 -19
  50. package/dist/types-ts4.5/controllers/create-field/main.d.ts +0 -6
  51. package/dist/types-ts4.5/controllers/create-field/types.d.ts +0 -28
  52. package/dist/types-ts4.5/controllers/edit-post-create-context/index.d.ts +0 -32
  53. package/dist/types-ts4.5/controllers/exit-warning-modal-context/index.d.ts +0 -14
  54. package/dist/types-ts4.5/controllers/form-context/main.d.ts +0 -19
  55. package/dist/types-ts4.5/controllers/plugin-context/index.d.ts +0 -21
  56. package/dist/types-ts4.5/entry-points/async-select.d.ts +0 -1
  57. package/dist/types-ts4.5/entry-points/callback-context.d.ts +0 -1
  58. package/dist/types-ts4.5/entry-points/create-field.d.ts +0 -1
  59. package/dist/types-ts4.5/entry-points/create-form.d.ts +0 -2
  60. package/dist/types-ts4.5/entry-points/exit-warning-modal.d.ts +0 -1
  61. package/dist/types-ts4.5/entry-points/final-form.d.ts +0 -1
  62. package/dist/types-ts4.5/entry-points/form-loader.d.ts +0 -1
  63. package/dist/types-ts4.5/entry-points/form-spy.d.ts +0 -1
  64. package/dist/types-ts4.5/entry-points/icons.d.ts +0 -1
  65. package/dist/types-ts4.5/entry-points/inline-create.d.ts +0 -1
  66. package/dist/types-ts4.5/entry-points/modal-create.d.ts +0 -1
  67. package/dist/types-ts4.5/entry-points/select.d.ts +0 -2
  68. package/dist/types-ts4.5/entry-points/text-field.d.ts +0 -1
  69. package/dist/types-ts4.5/entry-points/types.d.ts +0 -1
  70. package/dist/types-ts4.5/entry-points/user-picker.d.ts +0 -1
  71. package/dist/types-ts4.5/i18n/cs.d.ts +0 -23
  72. package/dist/types-ts4.5/i18n/da.d.ts +0 -23
  73. package/dist/types-ts4.5/i18n/de.d.ts +0 -23
  74. package/dist/types-ts4.5/i18n/en.d.ts +0 -23
  75. package/dist/types-ts4.5/i18n/en_GB.d.ts +0 -23
  76. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +0 -23
  77. package/dist/types-ts4.5/i18n/es.d.ts +0 -23
  78. package/dist/types-ts4.5/i18n/fi.d.ts +0 -23
  79. package/dist/types-ts4.5/i18n/fr.d.ts +0 -23
  80. package/dist/types-ts4.5/i18n/hr.d.ts +0 -23
  81. package/dist/types-ts4.5/i18n/hu.d.ts +0 -23
  82. package/dist/types-ts4.5/i18n/it.d.ts +0 -23
  83. package/dist/types-ts4.5/i18n/ja.d.ts +0 -23
  84. package/dist/types-ts4.5/i18n/ko.d.ts +0 -23
  85. package/dist/types-ts4.5/i18n/nb.d.ts +0 -23
  86. package/dist/types-ts4.5/i18n/nl.d.ts +0 -23
  87. package/dist/types-ts4.5/i18n/pl.d.ts +0 -23
  88. package/dist/types-ts4.5/i18n/pt_BR.d.ts +0 -23
  89. package/dist/types-ts4.5/i18n/ru.d.ts +0 -23
  90. package/dist/types-ts4.5/i18n/sk.d.ts +0 -23
  91. package/dist/types-ts4.5/i18n/sl.d.ts +0 -23
  92. package/dist/types-ts4.5/i18n/sr_RS.d.ts +0 -23
  93. package/dist/types-ts4.5/i18n/sr_YR.d.ts +0 -23
  94. package/dist/types-ts4.5/i18n/sv.d.ts +0 -23
  95. package/dist/types-ts4.5/i18n/th.d.ts +0 -23
  96. package/dist/types-ts4.5/i18n/tr.d.ts +0 -23
  97. package/dist/types-ts4.5/i18n/uk.d.ts +0 -23
  98. package/dist/types-ts4.5/i18n/vi.d.ts +0 -23
  99. package/dist/types-ts4.5/i18n/zh.d.ts +0 -23
  100. package/dist/types-ts4.5/i18n/zh_TW.d.ts +0 -23
  101. package/dist/types-ts4.5/index.d.ts +0 -35
  102. package/dist/types-ts4.5/ui/create-form/async-select/main.d.ts +0 -10
  103. package/dist/types-ts4.5/ui/create-form/async-select/types.d.ts +0 -23
  104. package/dist/types-ts4.5/ui/create-form/form-footer/edit-button/index.d.ts +0 -2
  105. package/dist/types-ts4.5/ui/create-form/form-footer/edit-button/messages.d.ts +0 -7
  106. package/dist/types-ts4.5/ui/create-form/form-footer/main.d.ts +0 -11
  107. package/dist/types-ts4.5/ui/create-form/form-footer/messages.d.ts +0 -12
  108. package/dist/types-ts4.5/ui/create-form/form-footer/submit-button/index.d.ts +0 -2
  109. package/dist/types-ts4.5/ui/create-form/form-loader/main.d.ts +0 -6
  110. package/dist/types-ts4.5/ui/create-form/form-spy/index.d.ts +0 -12
  111. package/dist/types-ts4.5/ui/create-form/main.d.ts +0 -55
  112. package/dist/types-ts4.5/ui/create-form/select/main.d.ts +0 -19
  113. package/dist/types-ts4.5/ui/create-form/select/messages.d.ts +0 -7
  114. package/dist/types-ts4.5/ui/create-form/select/types.d.ts +0 -27
  115. package/dist/types-ts4.5/ui/create-form/textfield/main.d.ts +0 -9
  116. package/dist/types-ts4.5/ui/create-form/textfield/types.d.ts +0 -14
  117. package/dist/types-ts4.5/ui/create-form/types.d.ts +0 -6
  118. package/dist/types-ts4.5/ui/create-form/user-picker/main.d.ts +0 -6
  119. package/dist/types-ts4.5/ui/create-form/user-picker/types.d.ts +0 -23
  120. package/dist/types-ts4.5/ui/create-form/utils/index.d.ts +0 -13
  121. package/dist/types-ts4.5/ui/inline-create/index.d.ts +0 -4
  122. package/dist/types-ts4.5/ui/inline-create/inline-analytics/index.d.ts +0 -9
  123. package/dist/types-ts4.5/ui/inline-create/main.d.ts +0 -4
  124. package/dist/types-ts4.5/ui/modal-create/index.d.ts +0 -4
  125. package/dist/types-ts4.5/ui/modal-create/main.d.ts +0 -4
  126. package/dist/types-ts4.5/ui/modal-create/messages.d.ts +0 -7
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const SubmitButton: () => React.JSX.Element;
@@ -1,6 +0,0 @@
1
- import { type SpinnerProps } from '@atlaskit/spinner';
2
- /**
3
- * Wrapper component for the Spinner, shows while the form
4
- * performs async functions on load.
5
- */
6
- export declare const CreateFormLoader: ({ size }: Partial<SpinnerProps>) => JSX.Element;
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- export type FormSpyProps<T> = {
3
- children: ({ values }: {
4
- values: T;
5
- }) => React.ReactNode;
6
- };
7
- /**
8
- * Lightweight wrapper around the react-final-form
9
- * FormSpy component so that we can control selectively
10
- * how much of the API we are commited to.
11
- */
12
- export declare const FormSpy: <T extends Record<string, unknown>>({ children, }: FormSpyProps<T>) => React.JSX.Element;
@@ -1,55 +0,0 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
- import { type ReactNode } from 'react';
6
- type ReservedFields = {
7
- [Field in (typeof RESERVED_FIELDS)[number]]?: unknown;
8
- };
9
- declare const RESERVED_FIELDS: readonly [
10
- '__post_create__'
11
- ];
12
- type DisallowReservedFields<T> = T & {
13
- [Field in (typeof RESERVED_FIELDS)[number]]?: never;
14
- };
15
- type OmitReservedFields<T> = Omit<T, keyof ReservedFields>;
16
- type Errors = Record<string, string>;
17
- export interface CreateFormProps<FormData> {
18
- /**
19
- * Should resolve to void, or resolve to an object of
20
- * keys (field names) with error messages (key values)
21
- */
22
- onSubmit: (data: OmitReservedFields<FormData>) => void | Errors | Promise<void | Errors>;
23
- /**
24
- * Children to render in the form (form fields)
25
- */
26
- children: ReactNode;
27
- /**
28
- * Test id to render on the form element
29
- */
30
- testId?: string;
31
- /**
32
- * Callback when the cancel button is fired
33
- */
34
- onCancel?: () => void;
35
- /**
36
- * Renders a spinner when true
37
- */
38
- isLoading?: boolean;
39
- /**
40
- * Hides the rendering of the footer buttons
41
- */
42
- hideFooter?: boolean;
43
- /**
44
- * Hides the "Required fields are marked with an asterisk" message
45
- */
46
- hideRequiredFieldMessage?: boolean;
47
- /**
48
- * Values to initialise the forms initial state with
49
- * Should not include values for reserved fields
50
- */
51
- initialValues?: DisallowReservedFields<FormData>;
52
- }
53
- export declare const TEST_ID = "link-create-form";
54
- export declare const CreateForm: <FormData extends Record<string, any> = {}>({ children, testId, onSubmit, onCancel, isLoading, hideFooter, hideRequiredFieldMessage, initialValues, }: CreateFormProps<FormData>) => JSX.Element;
55
- export {};
@@ -1,19 +0,0 @@
1
- import { type PropsWithChildren } from 'react';
2
- import { type OptionProps, type OptionType, type SingleValueProps } from '@atlaskit/select';
3
- import { type SelectProps, type SitePickerOptionType } from './types';
4
- export declare const TEST_ID = "link-create-select";
5
- /**
6
- * A select component utilising the Atlaskit Select and CreateField.
7
- * Validation is handled by the form on form submission. Any
8
- * errors returned by the handleSubmit function passed to the form <Form> that
9
- * have a key matching the `name` of this field are shown below the field.
10
- */
11
- export declare function Select<T = OptionType>({ id, name, label, isRequired, validators, validationHelpText, testId, ...restProps }: SelectProps<T>): JSX.Element;
12
- export type SiteSelectProps = {
13
- testId?: string;
14
- options?: SitePickerOptionType[];
15
- name?: string;
16
- };
17
- export declare const SiteSelect: ({ options, name, testId }: SiteSelectProps) => JSX.Element;
18
- export declare const SitePickerOption: ({ children, ...props }: PropsWithChildren<OptionProps<SitePickerOptionType, false>>) => JSX.Element;
19
- export declare const SitePickerSingleValue: ({ children, ...props }: PropsWithChildren<SingleValueProps<SitePickerOptionType, false>>) => JSX.Element;
@@ -1,7 +0,0 @@
1
- export declare const messages: {
2
- siteLabel: {
3
- id: string;
4
- defaultMessage: string;
5
- description: string;
6
- };
7
- };
@@ -1,27 +0,0 @@
1
- import { type SelectProps as AKSelectProps, type OptionType } from '@atlaskit/select';
2
- import { type Validator } from '../../../common/types';
3
- export type SelectProps<T = OptionType> = AKSelectProps<T> & {
4
- /** Name passed to the <Field> */
5
- name: string;
6
- /** This should be properly internationalization-ed */
7
- label: string;
8
- /**
9
- * Optional text below the field explaining any requirements for a valid value.
10
- * eg. "Must be 4 or more letters"
11
- */
12
- validationHelpText?: string;
13
- testId?: string;
14
- /** Will display a red astrix next to the field title if true */
15
- isRequired?: boolean;
16
- /** Validators for this field */
17
- validators?: Validator[];
18
- };
19
- export type SitePickerOptionValue = {
20
- avatarUrl?: string;
21
- cloudId: string;
22
- url: string;
23
- };
24
- export type SitePickerOptionType = {
25
- label: string;
26
- value: SitePickerOptionValue;
27
- };
@@ -1,9 +0,0 @@
1
- import { type TextFieldProps } from './types';
2
- export declare const TEST_ID = "link-create-text-field";
3
- /**
4
- * A text field utilising the Atlaskit Textfield and CreateField.
5
- * Validation is handled by the form as it is on form submission. Any errors returned by
6
- * the handleSubmit function passed to the form <Form> that have a key matching the `name`
7
- * of this text field are shown above the field.
8
- */
9
- export declare const TextField: ({ id, name, label, isRequired, validators, validationHelpText, testId, ...restProps }: TextFieldProps) => JSX.Element;
@@ -1,14 +0,0 @@
1
- import { type TextFieldProps as AKTextFieldProps } from '@atlaskit/textfield';
2
- import { type Validator } from '../../../common/types';
3
- export type TextFieldProps = Omit<AKTextFieldProps, 'name'> & {
4
- /** Name passed to the <Field>.*/
5
- name: string;
6
- label?: string;
7
- /**
8
- * Optional text below the textfield explaining any requirements for a valid value.
9
- * eg. "Must be 4 or more letters"
10
- */
11
- validationHelpText?: string;
12
- /** Validators for this field */
13
- validators?: Validator[];
14
- };
@@ -1,6 +0,0 @@
1
- export type Validator = {
2
- /** Return true when the given input is valid */
3
- isValid: (val: unknown) => boolean;
4
- /** An error message is used to tell a user that the field input is invalid. For example, an error message could be 'Invalid username, needs to be more than 4 characters'. */
5
- errorMessage: string;
6
- };
@@ -1,6 +0,0 @@
1
- import { type UserPickerProps } from './types';
2
- export declare const TEST_ID = "link-create-user-picker";
3
- /**
4
- * A user picker utilising the SmartUserPicker.
5
- */
6
- export declare const UserPicker: ({ productKey, siteId, name, label, placeholder, validators, testId, defaultValue, }: UserPickerProps) => JSX.Element;
@@ -1,23 +0,0 @@
1
- import { type Validator } from '../../../common/types';
2
- export type UserPickerProps = {
3
- /** Name to pass into the <Field> */
4
- name: string;
5
- /** Refers to a product identifier, Jira, Confluence, Townsquare, ect. */
6
- productKey: string;
7
- /** Identifier for the product's tenant, also known as tenantId or cloudId */
8
- siteId: string;
9
- /** The label text above the component */
10
- label?: string;
11
- /** Placeholder text to display in the text field whenever it is empty. */
12
- placeholder?: string;
13
- /** Validators for this field */
14
- validators?: Validator[];
15
- testId?: string;
16
- defaultValue: User | undefined;
17
- };
18
- type User = {
19
- id: string;
20
- name?: string;
21
- avatarUrl?: string;
22
- };
23
- export {};
@@ -1,13 +0,0 @@
1
- import { type ValidatorMap } from '../../../common/types';
2
- /** Map of field names to errors for that field (or undefined if no error for that field) */
3
- export type ValidatorResults = {
4
- [name: string]: string | undefined;
5
- };
6
- /**
7
- * Returns an object where the keys are names of form fields, and values are a string if the field
8
- * has an error, or undefined if the field is valid.
9
- */
10
- export declare function validateFormData({ data, validators, }: {
11
- data: Record<string, unknown>;
12
- validators: ValidatorMap;
13
- }): ValidatorResults;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import type { LinkCreateProps } from '../../common/types';
3
- declare const ComposedLinkCreate: React.MemoExoticComponent<(props: LinkCreateProps) => React.JSX.Element>;
4
- export default ComposedLinkCreate;
@@ -1,9 +0,0 @@
1
- import React, { type PropsWithChildren } from 'react';
2
- import type { AnalyticsEventAttributes } from '../../../common/utils/analytics/analytics.codegen';
3
- type InlineAnalyticsProps = {
4
- screen: keyof {
5
- [Key in keyof AnalyticsEventAttributes as Key extends `screen.${infer ScreenName}.viewed` ? ScreenName : never]: any;
6
- };
7
- };
8
- export declare const InlineAnalytics: ({ screen, children, }: PropsWithChildren<InlineAnalyticsProps>) => React.JSX.Element;
9
- export {};
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import type { LinkCreateProps } from '../../common/types';
3
- declare const InlineCreate: (props: LinkCreateProps) => React.JSX.Element;
4
- export default InlineCreate;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { type LinkCreateWithModalProps } from '../../common/types';
3
- declare const ComposedLinkCreate: React.MemoExoticComponent<(props: LinkCreateWithModalProps) => React.JSX.Element>;
4
- export default ComposedLinkCreate;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import type { LinkCreateWithModalProps } from '../../common/types';
3
- declare const LinkCreateModal: (props: LinkCreateWithModalProps) => React.JSX.Element;
4
- export default LinkCreateModal;
@@ -1,7 +0,0 @@
1
- export declare const messages: {
2
- heading: {
3
- id: string;
4
- defaultMessage: string;
5
- description: string;
6
- };
7
- };