@atlaskit/link-create 1.5.0 → 1.6.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 (83) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/analytics.spec.yaml +14 -0
  3. package/dist/cjs/common/ui/Button/index.js +37 -0
  4. package/dist/cjs/common/ui/error-boundary-modal/index.js +30 -0
  5. package/dist/cjs/common/utils/analytics/analytics.codegen.js +1 -1
  6. package/dist/cjs/common/utils/analytics/components.js +20 -0
  7. package/dist/cjs/controllers/edit-post-create-context/index.js +14 -3
  8. package/dist/cjs/controllers/plugin-context/index.js +1 -1
  9. package/dist/cjs/ui/create-form/main.js +24 -6
  10. package/dist/cjs/ui/link-create/confirm-dismiss-dialog/main.js +18 -5
  11. package/dist/cjs/ui/link-create/edit-modal/index.js +12 -3
  12. package/dist/cjs/ui/link-create/error-boundary/error-boundary-base/index.js +4 -7
  13. package/dist/cjs/ui/link-create/error-boundary/index.js +4 -3
  14. package/dist/cjs/ui/link-create/main.js +53 -6
  15. package/dist/cjs/ui/main.js +12 -1
  16. package/dist/es2019/common/ui/Button/index.js +27 -0
  17. package/dist/es2019/common/ui/error-boundary-modal/index.js +22 -0
  18. package/dist/es2019/common/utils/analytics/analytics.codegen.js +1 -1
  19. package/dist/es2019/common/utils/analytics/components.js +15 -0
  20. package/dist/es2019/controllers/edit-post-create-context/index.js +11 -4
  21. package/dist/es2019/controllers/plugin-context/index.js +1 -1
  22. package/dist/es2019/ui/create-form/main.js +20 -3
  23. package/dist/es2019/ui/link-create/confirm-dismiss-dialog/main.js +17 -4
  24. package/dist/es2019/ui/link-create/edit-modal/index.js +13 -3
  25. package/dist/es2019/ui/link-create/error-boundary/error-boundary-base/index.js +4 -4
  26. package/dist/es2019/ui/link-create/error-boundary/index.js +4 -3
  27. package/dist/es2019/ui/link-create/main.js +38 -6
  28. package/dist/es2019/ui/main.js +12 -1
  29. package/dist/esm/common/ui/Button/index.js +27 -0
  30. package/dist/esm/common/ui/error-boundary-modal/index.js +21 -0
  31. package/dist/esm/common/utils/analytics/analytics.codegen.js +1 -1
  32. package/dist/esm/common/utils/analytics/components.js +13 -0
  33. package/dist/esm/controllers/edit-post-create-context/index.js +15 -4
  34. package/dist/esm/controllers/plugin-context/index.js +1 -1
  35. package/dist/esm/ui/create-form/main.js +24 -5
  36. package/dist/esm/ui/link-create/confirm-dismiss-dialog/main.js +17 -4
  37. package/dist/esm/ui/link-create/edit-modal/index.js +12 -3
  38. package/dist/esm/ui/link-create/error-boundary/error-boundary-base/index.js +4 -4
  39. package/dist/esm/ui/link-create/error-boundary/index.js +4 -3
  40. package/dist/esm/ui/link-create/main.js +54 -7
  41. package/dist/esm/ui/main.js +12 -1
  42. package/dist/types/common/types.d.ts +14 -0
  43. package/dist/types/common/ui/Button/index.d.ts +5 -0
  44. package/dist/types/common/ui/error-boundary-modal/index.d.ts +11 -0
  45. package/dist/types/common/utils/analytics/analytics.codegen.d.ts +6 -2
  46. package/dist/types/common/utils/analytics/components.d.ts +8 -0
  47. package/dist/types/controllers/edit-post-create-context/index.d.ts +23 -3
  48. package/dist/types/controllers/plugin-context/index.d.ts +4 -1
  49. package/dist/types/ui/create-form/main.d.ts +18 -2
  50. package/dist/types/ui/link-create/edit-modal/index.d.ts +8 -4
  51. package/dist/types/ui/link-create/error-boundary/error-boundary-base/index.d.ts +3 -3
  52. package/dist/types/ui/link-create/error-boundary/index.d.ts +5 -1
  53. package/dist/types/ui/link-create/main.d.ts +3 -3
  54. package/dist/types-ts4.5/common/types.d.ts +14 -0
  55. package/dist/types-ts4.5/common/ui/Button/index.d.ts +5 -0
  56. package/dist/types-ts4.5/common/ui/error-boundary-modal/index.d.ts +11 -0
  57. package/dist/types-ts4.5/common/utils/analytics/analytics.codegen.d.ts +6 -2
  58. package/dist/types-ts4.5/common/utils/analytics/components.d.ts +8 -0
  59. package/dist/types-ts4.5/controllers/edit-post-create-context/index.d.ts +23 -3
  60. package/dist/types-ts4.5/controllers/plugin-context/index.d.ts +4 -1
  61. package/dist/types-ts4.5/ui/create-form/main.d.ts +20 -2
  62. package/dist/types-ts4.5/ui/link-create/edit-modal/index.d.ts +8 -4
  63. package/dist/types-ts4.5/ui/link-create/error-boundary/error-boundary-base/index.d.ts +3 -3
  64. package/dist/types-ts4.5/ui/link-create/error-boundary/index.d.ts +5 -1
  65. package/dist/types-ts4.5/ui/link-create/main.d.ts +3 -3
  66. package/package.json +6 -3
  67. package/report.api.md +25 -4
  68. package/tmp/api-report-tmp.d.ts +25 -4
  69. /package/dist/cjs/{ui/link-create/error-boundary → common/ui}/error-boundary-ui/error-svg/index.js +0 -0
  70. /package/dist/cjs/{ui/link-create/error-boundary → common/ui}/error-boundary-ui/index.js +0 -0
  71. /package/dist/cjs/{ui/link-create/error-boundary → common/ui}/error-boundary-ui/messages.js +0 -0
  72. /package/dist/es2019/{ui/link-create/error-boundary → common/ui}/error-boundary-ui/error-svg/index.js +0 -0
  73. /package/dist/es2019/{ui/link-create/error-boundary → common/ui}/error-boundary-ui/index.js +0 -0
  74. /package/dist/es2019/{ui/link-create/error-boundary → common/ui}/error-boundary-ui/messages.js +0 -0
  75. /package/dist/esm/{ui/link-create/error-boundary → common/ui}/error-boundary-ui/error-svg/index.js +0 -0
  76. /package/dist/esm/{ui/link-create/error-boundary → common/ui}/error-boundary-ui/index.js +0 -0
  77. /package/dist/esm/{ui/link-create/error-boundary → common/ui}/error-boundary-ui/messages.js +0 -0
  78. /package/dist/types/{ui/link-create/error-boundary → common/ui}/error-boundary-ui/error-svg/index.d.ts +0 -0
  79. /package/dist/types/{ui/link-create/error-boundary → common/ui}/error-boundary-ui/index.d.ts +0 -0
  80. /package/dist/types/{ui/link-create/error-boundary → common/ui}/error-boundary-ui/messages.d.ts +0 -0
  81. /package/dist/types-ts4.5/{ui/link-create/error-boundary → common/ui}/error-boundary-ui/error-svg/index.d.ts +0 -0
  82. /package/dist/types-ts4.5/{ui/link-create/error-boundary → common/ui}/error-boundary-ui/index.d.ts +0 -0
  83. /package/dist/types-ts4.5/{ui/link-create/error-boundary → common/ui}/error-boundary-ui/messages.d.ts +0 -0
package/report.api.md CHANGED
@@ -83,16 +83,14 @@ export function CreateFormLoader({
83
83
  export interface CreateFormProps<FormData> {
84
84
  // (undocumented)
85
85
  children: ReactNode;
86
- // (undocumented)
87
86
  hideFooter?: boolean;
88
- // (undocumented)
89
- initialValues?: FormData;
87
+ initialValues?: DisallowReservedFields<FormData>;
90
88
  // (undocumented)
91
89
  isLoading?: boolean;
92
90
  // (undocumented)
93
91
  onCancel?: () => void;
94
92
  // (undocumented)
95
- onSubmit: (data: FormData) => void;
93
+ onSubmit: (data: OmitReservedFields<FormData>) => void;
96
94
  // (undocumented)
97
95
  testId?: string;
98
96
  }
@@ -106,6 +104,17 @@ export type CreatePayload = {
106
104
  data?: Record<string, unknown>;
107
105
  };
108
106
 
107
+ // @public (undocumented)
108
+ type DisallowReservedFields<T> = T & {
109
+ [Field in (typeof RESERVED_FIELDS)[number]]?: never;
110
+ };
111
+
112
+ // @public (undocumented)
113
+ type EditViewProps = {
114
+ payload: CreatePayload;
115
+ onClose: () => void;
116
+ };
117
+
109
118
  // @public
110
119
  export const FormSpy: <T extends Record<string, unknown>>({
111
120
  children,
@@ -135,6 +144,7 @@ interface LinkCreateCallbackProviderProps {
135
144
 
136
145
  // @public (undocumented)
137
146
  export interface LinkCreatePlugin {
147
+ editView?: ({ payload, onClose }: EditViewProps) => JSX.Element;
138
148
  form: ReactNode;
139
149
  group: Group;
140
150
  icon: string;
@@ -163,6 +173,17 @@ export interface LinkCreateWithModalProps
163
173
  modalTitle?: string;
164
174
  }
165
175
 
176
+ // @public (undocumented)
177
+ type OmitReservedFields<T> = Omit<T, keyof ReservedFields>;
178
+
179
+ // @public (undocumented)
180
+ const RESERVED_FIELDS: readonly ['__post_create__'];
181
+
182
+ // @public (undocumented)
183
+ type ReservedFields = {
184
+ [Field in (typeof RESERVED_FIELDS)[number]]?: unknown;
185
+ };
186
+
166
187
  // @public
167
188
  export function Select<T = OptionType>({
168
189
  id,
@@ -46,16 +46,14 @@ export function CreateFormLoader({ size }: Partial<SpinnerProps>): jsx.JSX.Eleme
46
46
  export interface CreateFormProps<FormData> {
47
47
  // (undocumented)
48
48
  children: ReactNode;
49
- // (undocumented)
50
49
  hideFooter?: boolean;
51
- // (undocumented)
52
- initialValues?: FormData;
50
+ initialValues?: DisallowReservedFields<FormData>;
53
51
  // (undocumented)
54
52
  isLoading?: boolean;
55
53
  // (undocumented)
56
54
  onCancel?: () => void;
57
55
  // (undocumented)
58
- onSubmit: (data: FormData) => void;
56
+ onSubmit: (data: OmitReservedFields<FormData>) => void;
59
57
  // (undocumented)
60
58
  testId?: string;
61
59
  }
@@ -69,6 +67,17 @@ export type CreatePayload = {
69
67
  data?: Record<string, unknown>;
70
68
  };
71
69
 
70
+ // @public (undocumented)
71
+ type DisallowReservedFields<T> = T & {
72
+ [Field in (typeof RESERVED_FIELDS)[number]]?: never;
73
+ };
74
+
75
+ // @public (undocumented)
76
+ type EditViewProps = {
77
+ payload: CreatePayload;
78
+ onClose: () => void;
79
+ };
80
+
72
81
  // @public
73
82
  export const FormSpy: <T extends Record<string, unknown>>({ children, }: FormSpyProps<T>) => JSX.Element;
74
83
 
@@ -98,6 +107,7 @@ interface LinkCreateCallbackProviderProps {
98
107
 
99
108
  // @public (undocumented)
100
109
  export interface LinkCreatePlugin {
110
+ editView?: ({ payload, onClose }: EditViewProps) => JSX.Element;
101
111
  form: ReactNode;
102
112
  group: Group;
103
113
  icon: string;
@@ -124,6 +134,17 @@ export interface LinkCreateWithModalProps extends LinkCreateProps, Partial<Pick<
124
134
  modalTitle?: string;
125
135
  }
126
136
 
137
+ // @public (undocumented)
138
+ type OmitReservedFields<T> = Omit<T, keyof ReservedFields>;
139
+
140
+ // @public (undocumented)
141
+ const RESERVED_FIELDS: readonly ["__post_create__"];
142
+
143
+ // @public (undocumented)
144
+ type ReservedFields = {
145
+ [Field in (typeof RESERVED_FIELDS)[number]]?: unknown;
146
+ };
147
+
127
148
  // @public
128
149
  export function Select<T = OptionType>({ id, name, label, isRequired, validators, validationHelpText, testId, ...restProps }: SelectProps<T>): jsx.JSX.Element;
129
150