@atlaskit/link-create 0.9.1 → 1.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 (101) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/analytics.spec.yaml +9 -0
  3. package/dist/cjs/common/utils/analytics/analytics.codegen.js +1 -1
  4. package/dist/cjs/controllers/callback-context/main.js +22 -3
  5. package/dist/cjs/controllers/create-field/index.js +12 -0
  6. package/dist/cjs/controllers/create-field/main.js +62 -0
  7. package/dist/cjs/index.js +12 -0
  8. package/dist/cjs/ui/create-form/async-select/main.js +117 -35
  9. package/dist/cjs/ui/create-form/form-footer/main.js +9 -2
  10. package/dist/cjs/ui/create-form/form-spy/index.js +27 -0
  11. package/dist/cjs/ui/create-form/index.js +15 -1
  12. package/dist/cjs/ui/create-form/main.js +20 -10
  13. package/dist/cjs/ui/create-form/select/index.js +12 -0
  14. package/dist/cjs/ui/create-form/select/main.js +50 -0
  15. package/dist/cjs/ui/create-form/select/types.js +5 -0
  16. package/dist/cjs/ui/create-form/textfield/main.js +26 -48
  17. package/dist/cjs/ui/index.js +15 -1
  18. package/dist/cjs/ui/link-create/main.js +3 -3
  19. package/dist/cjs/version.json +1 -1
  20. package/dist/es2019/common/utils/analytics/analytics.codegen.js +1 -1
  21. package/dist/es2019/controllers/callback-context/main.js +6 -1
  22. package/dist/es2019/controllers/create-field/index.js +1 -0
  23. package/dist/es2019/controllers/create-field/main.js +57 -0
  24. package/dist/es2019/index.js +1 -1
  25. package/dist/es2019/ui/create-form/async-select/main.js +75 -34
  26. package/dist/es2019/ui/create-form/form-footer/main.js +9 -2
  27. package/dist/es2019/ui/create-form/form-spy/index.js +18 -0
  28. package/dist/es2019/ui/create-form/index.js +3 -1
  29. package/dist/es2019/ui/create-form/main.js +25 -16
  30. package/dist/es2019/ui/create-form/select/index.js +1 -0
  31. package/dist/es2019/ui/create-form/select/main.js +40 -0
  32. package/dist/es2019/ui/create-form/textfield/main.js +24 -48
  33. package/dist/es2019/ui/index.js +3 -1
  34. package/dist/es2019/ui/link-create/main.js +3 -3
  35. package/dist/es2019/version.json +1 -1
  36. package/dist/esm/common/utils/analytics/analytics.codegen.js +1 -1
  37. package/dist/esm/controllers/callback-context/main.js +22 -3
  38. package/dist/esm/controllers/create-field/index.js +1 -0
  39. package/dist/esm/controllers/create-field/main.js +56 -0
  40. package/dist/esm/controllers/create-field/types.js +1 -0
  41. package/dist/esm/index.js +1 -1
  42. package/dist/esm/ui/create-form/async-select/main.js +118 -36
  43. package/dist/esm/ui/create-form/form-footer/main.js +9 -2
  44. package/dist/esm/ui/create-form/form-spy/index.js +19 -0
  45. package/dist/esm/ui/create-form/index.js +3 -1
  46. package/dist/esm/ui/create-form/main.js +19 -8
  47. package/dist/esm/ui/create-form/select/index.js +1 -0
  48. package/dist/esm/ui/create-form/select/main.js +42 -0
  49. package/dist/esm/ui/create-form/select/types.js +1 -0
  50. package/dist/esm/ui/create-form/textfield/main.js +25 -47
  51. package/dist/esm/ui/index.js +3 -1
  52. package/dist/esm/ui/link-create/main.js +3 -3
  53. package/dist/esm/version.json +1 -1
  54. package/dist/types/common/utils/analytics/analytics.codegen.d.ts +5 -1
  55. package/dist/types/common/utils/form/index.d.ts +2 -2
  56. package/dist/types/controllers/callback-context/main.d.ts +1 -1
  57. package/dist/types/controllers/create-field/index.d.ts +1 -0
  58. package/dist/types/controllers/create-field/main.d.ts +3 -0
  59. package/dist/types/controllers/create-field/types.d.ts +24 -0
  60. package/dist/types/index.d.ts +1 -1
  61. package/dist/types/ui/create-form/async-select/main.d.ts +5 -5
  62. package/dist/types/ui/create-form/async-select/types.d.ts +9 -4
  63. package/dist/types/ui/create-form/form-spy/index.d.ts +12 -0
  64. package/dist/types/ui/create-form/index.d.ts +2 -0
  65. package/dist/types/ui/create-form/main.d.ts +2 -1
  66. package/dist/types/ui/create-form/select/index.d.ts +1 -0
  67. package/dist/types/ui/create-form/select/main.d.ts +12 -0
  68. package/dist/types/ui/create-form/select/types.d.ts +18 -0
  69. package/dist/types/ui/create-form/textfield/main.d.ts +2 -1
  70. package/dist/types/ui/index.d.ts +2 -0
  71. package/dist/types-ts4.5/common/utils/analytics/analytics.codegen.d.ts +5 -1
  72. package/dist/types-ts4.5/common/utils/form/index.d.ts +2 -2
  73. package/dist/types-ts4.5/controllers/callback-context/main.d.ts +1 -1
  74. package/dist/types-ts4.5/controllers/create-field/index.d.ts +1 -0
  75. package/dist/types-ts4.5/controllers/create-field/main.d.ts +3 -0
  76. package/dist/types-ts4.5/controllers/create-field/types.d.ts +24 -0
  77. package/dist/types-ts4.5/index.d.ts +1 -1
  78. package/dist/types-ts4.5/ui/create-form/async-select/main.d.ts +5 -5
  79. package/dist/types-ts4.5/ui/create-form/async-select/types.d.ts +9 -4
  80. package/dist/types-ts4.5/ui/create-form/form-spy/index.d.ts +12 -0
  81. package/dist/types-ts4.5/ui/create-form/index.d.ts +2 -0
  82. package/dist/types-ts4.5/ui/create-form/main.d.ts +2 -1
  83. package/dist/types-ts4.5/ui/create-form/select/index.d.ts +1 -0
  84. package/dist/types-ts4.5/ui/create-form/select/main.d.ts +12 -0
  85. package/dist/types-ts4.5/ui/create-form/select/types.d.ts +18 -0
  86. package/dist/types-ts4.5/ui/create-form/textfield/main.d.ts +2 -1
  87. package/dist/types-ts4.5/ui/index.d.ts +2 -0
  88. package/example-helpers/mock-plugin-form.tsx +3 -4
  89. package/package.json +6 -3
  90. package/report.api.md +55 -12
  91. package/tmp/api-report-tmp.d.ts +164 -0
  92. package/dist/cjs/ui/group-selection/index.js +0 -22
  93. package/dist/es2019/ui/group-selection/index.js +0 -16
  94. package/dist/esm/ui/group-selection/index.js +0 -15
  95. package/dist/types/ui/group-selection/index.d.ts +0 -4
  96. package/dist/types/ui/group-selection/types.d.ts +0 -12
  97. package/dist/types-ts4.5/ui/group-selection/index.d.ts +0 -4
  98. package/dist/types-ts4.5/ui/group-selection/types.d.ts +0 -12
  99. /package/dist/cjs/{ui/group-selection → controllers/create-field}/types.js +0 -0
  100. /package/dist/es2019/{ui/group-selection → controllers/create-field}/types.js +0 -0
  101. /package/dist/{esm/ui/group-selection → es2019/ui/create-form/select}/types.js +0 -0
@@ -0,0 +1,164 @@
1
+ ## API Report File for "@atlaskit/link-create"
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 { AsyncSelectProps as AsyncSelectProps_2 } from '@atlaskit/select';
10
+ import { GroupType } from '@atlaskit/select';
11
+ import { jsx } from '@emotion/react';
12
+ import { MemoExoticComponent } from 'react';
13
+ import { ModalDialogProps } from '@atlaskit/modal-dialog';
14
+ import { OptionType } from '@atlaskit/select';
15
+ import { default as React_2 } from 'react';
16
+ import { ReactNode } from 'react';
17
+ import { SelectProps as SelectProps_2 } from '@atlaskit/select';
18
+ import { SpinnerProps } from '@atlaskit/spinner';
19
+ import { TextFieldProps as TextFieldProps_2 } from '@atlaskit/textfield';
20
+
21
+ // @public
22
+ export function AsyncSelect<T = OptionType>({ id, name, label, isRequired, validators, validationHelpText, testId, defaultOption: propsDefaultValue, loadOptions, ...restProps }: AsyncSelectProps<T>): jsx.JSX.Element;
23
+
24
+ // @public (undocumented)
25
+ type AsyncSelectProps<T = OptionType> = Omit<AsyncSelectProps_2<T>, 'loadOptions'> & {
26
+ name: string;
27
+ label: string;
28
+ validationHelpText?: string;
29
+ testId?: string;
30
+ isRequired?: boolean;
31
+ validators?: Validator[];
32
+ loadOptions?: (inputValue: string) => Promise<GroupType<T>[] | T[]>;
33
+ };
34
+
35
+ // @public (undocumented)
36
+ const ComposedLinkCreate: MemoExoticComponent<(props: LinkCreateWithModalProps) => jsx.JSX.Element>;
37
+ export default ComposedLinkCreate;
38
+
39
+ // @public (undocumented)
40
+ export const CreateForm: <FormData_1 extends Record<string, any> = {}>({ children, testId, onSubmit, onCancel, isLoading, hideFooter, initialValues, }: CreateFormProps<FormData_1>) => jsx.JSX.Element;
41
+
42
+ // @public (undocumented)
43
+ export function CreateFormLoader({ size }: Partial<SpinnerProps>): jsx.JSX.Element;
44
+
45
+ // @public (undocumented)
46
+ export interface CreateFormProps<FormData> {
47
+ // (undocumented)
48
+ children: ReactNode;
49
+ // (undocumented)
50
+ hideFooter?: boolean;
51
+ // (undocumented)
52
+ initialValues?: FormData;
53
+ // (undocumented)
54
+ isLoading?: boolean;
55
+ // (undocumented)
56
+ onCancel?: () => void;
57
+ // (undocumented)
58
+ onSubmit: (data: FormData) => void;
59
+ // (undocumented)
60
+ testId?: string;
61
+ }
62
+
63
+ // @public
64
+ export type CreatePayload = {
65
+ url: string;
66
+ objectId: string;
67
+ objectType: string;
68
+ data?: Record<string, unknown>;
69
+ };
70
+
71
+ // @public
72
+ export const FormSpy: <T extends Record<string, unknown>>({ children, }: FormSpyProps<T>) => JSX.Element;
73
+
74
+ // @public (undocumented)
75
+ type FormSpyProps<T> = {
76
+ children: ({ values }: {
77
+ values: T;
78
+ }) => React_2.ReactNode;
79
+ };
80
+
81
+ // @public (undocumented)
82
+ interface Group {
83
+ icon: string;
84
+ key: string;
85
+ label: string;
86
+ }
87
+
88
+ // @public (undocumented)
89
+ export const LinkCreateCallbackProvider: React_2.FC<LinkCreateCallbackProviderProps>;
90
+
91
+ // @public (undocumented)
92
+ interface LinkCreateCallbackProviderProps {
93
+ onCancel?: () => void;
94
+ onCreate?: (result: CreatePayload) => Promise<void> | void;
95
+ onFailure?: (error: Error) => void;
96
+ }
97
+
98
+ // @public (undocumented)
99
+ export interface LinkCreatePlugin {
100
+ form: ReactNode;
101
+ group: Group;
102
+ icon: string;
103
+ key: string;
104
+ label: string;
105
+ }
106
+
107
+ // @public (undocumented)
108
+ export interface LinkCreateProps {
109
+ entityKey: string;
110
+ groupKey?: string;
111
+ onCancel?: () => void;
112
+ onCreate?: (payload: CreatePayload) => Promise<void> | void;
113
+ onFailure?: (error: unknown) => void;
114
+ // (undocumented)
115
+ plugins: LinkCreatePlugin[];
116
+ testId?: string;
117
+ triggeredFrom?: string;
118
+ }
119
+
120
+ // @public (undocumented)
121
+ export interface LinkCreateWithModalProps extends LinkCreateProps, Partial<Pick<ModalDialogProps, 'onCloseComplete' | 'onOpenComplete'>> {
122
+ active?: boolean;
123
+ modalTitle?: string;
124
+ }
125
+
126
+ // @public
127
+ export function Select<T = OptionType>({ id, name, label, isRequired, validators, validationHelpText, testId, ...restProps }: SelectProps<T>): jsx.JSX.Element;
128
+
129
+ // @public (undocumented)
130
+ type SelectProps<T = OptionType> = SelectProps_2<T> & {
131
+ name: string;
132
+ label: string;
133
+ validationHelpText?: string;
134
+ testId?: string;
135
+ isRequired?: boolean;
136
+ validators?: Validator[];
137
+ };
138
+
139
+ // @public
140
+ export function TextField({ id, name, label, isRequired, validators, validationHelpText, testId, ...restProps }: TextFieldProps): jsx.JSX.Element;
141
+
142
+ // @public (undocumented)
143
+ type TextFieldProps = Omit<TextFieldProps_2, 'name'> & {
144
+ name: string;
145
+ label?: string;
146
+ validationHelpText?: string;
147
+ validators?: Validator[];
148
+ };
149
+
150
+ // @public (undocumented)
151
+ export const useLinkCreateCallback: () => LinkCreateCallbackProviderProps;
152
+
153
+ // @public (undocumented)
154
+ export type Validator = {
155
+ isValid: (val: unknown) => boolean;
156
+ errorMessage: string;
157
+ };
158
+
159
+ // @public
160
+ export type ValidatorMap = Record<string, Validator[]>;
161
+
162
+ // (No @packageDocumentation comment for this package)
163
+
164
+ ```
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = GroupSelect;
7
- var _react = require("@emotion/react");
8
- /** @jsx jsx */
9
-
10
- var containerStyles = (0, _react.css)({
11
- padding: '8px',
12
- border: '1px solid',
13
- borderRadius: '4px'
14
- });
15
- function GroupSelect(_ref) {
16
- var testId = _ref.testId,
17
- groups = _ref.groups;
18
- return (0, _react.jsx)("div", {
19
- css: [containerStyles],
20
- "data-testid": testId
21
- }, "Not build yet");
22
- }
@@ -1,16 +0,0 @@
1
- /** @jsx jsx */
2
- import { css, jsx } from '@emotion/react';
3
- const containerStyles = css({
4
- padding: '8px',
5
- border: '1px solid',
6
- borderRadius: '4px'
7
- });
8
- export default function GroupSelect({
9
- testId,
10
- groups
11
- }) {
12
- return jsx("div", {
13
- css: [containerStyles],
14
- "data-testid": testId
15
- }, "Not build yet");
16
- }
@@ -1,15 +0,0 @@
1
- /** @jsx jsx */
2
- import { css, jsx } from '@emotion/react';
3
- var containerStyles = css({
4
- padding: '8px',
5
- border: '1px solid',
6
- borderRadius: '4px'
7
- });
8
- export default function GroupSelect(_ref) {
9
- var testId = _ref.testId,
10
- groups = _ref.groups;
11
- return jsx("div", {
12
- css: [containerStyles],
13
- "data-testid": testId
14
- }, "Not build yet");
15
- }
@@ -1,4 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/react';
3
- import { GroupSelectProps } from './types';
4
- export default function GroupSelect({ testId, groups }: GroupSelectProps): jsx.JSX.Element;
@@ -1,12 +0,0 @@
1
- import { Group } from '../../common/types';
2
- export interface GroupSelectProps {
3
- /**
4
- * A `testId` prop is provided for specified elements, which is a unique
5
- * string that appears as a data attribute `data-testid` in the rendered code,
6
- * serving as a hook for automated tests */
7
- testId?: string;
8
- /**
9
- * Available groups to display
10
- */
11
- groups: Group[];
12
- }
@@ -1,4 +0,0 @@
1
- /** @jsx jsx */
2
- import { jsx } from '@emotion/react';
3
- import { GroupSelectProps } from './types';
4
- export default function GroupSelect({ testId, groups }: GroupSelectProps): jsx.JSX.Element;
@@ -1,12 +0,0 @@
1
- import { Group } from '../../common/types';
2
- export interface GroupSelectProps {
3
- /**
4
- * A `testId` prop is provided for specified elements, which is a unique
5
- * string that appears as a data attribute `data-testid` in the rendered code,
6
- * serving as a hook for automated tests */
7
- testId?: string;
8
- /**
9
- * Available groups to display
10
- */
11
- groups: Group[];
12
- }