@atlaskit/link-create 2.3.0 → 2.4.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/link-create
2
2
 
3
+ ## 2.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#108443](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108443)
8
+ [`457df84a02af1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/457df84a02af1) -
9
+ [ux] ErrorBoundary outside InlineCreate displays error inline
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
3
15
  ## 2.3.0
4
16
 
5
17
  ### Minor Changes
package/LICENSE.md CHANGED
@@ -1,13 +1,11 @@
1
1
  Copyright 2022 Atlassian Pty Ltd
2
2
 
3
- Licensed under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License.
5
- You may obtain a copy of the License at
3
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
4
+ compliance with the License. You may obtain a copy of the License at
6
5
 
7
6
  http://www.apache.org/licenses/LICENSE-2.0
8
7
 
9
- Unless required by applicable law or agreed to in writing, software
10
- distributed under the License is distributed on an "AS IS" BASIS,
11
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- See the License for the specific language governing permissions and
13
- limitations under the License.
8
+ Unless required by applicable law or agreed to in writing, software distributed under the License is
9
+ distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
10
+ implied. See the License for the specific language governing permissions and limitations under the
11
+ License.
@@ -13,7 +13,7 @@ var CREATE_FORM_MIN_HEIGHT_IN_PX = exports.CREATE_FORM_MIN_HEIGHT_IN_PX = '200';
13
13
  var LINK_CREATE_FORM_POST_CREATE_FIELD = exports.LINK_CREATE_FORM_POST_CREATE_FIELD = '__post_create__';
14
14
  var PACKAGE_DATA = exports.PACKAGE_DATA = {
15
15
  packageName: "@atlaskit/link-create" || '',
16
- packageVersion: "2.3.0" || '',
16
+ packageVersion: "2.4.0" || '',
17
17
  component: COMPONENT_NAME,
18
18
  componentName: COMPONENT_NAME
19
19
  };
@@ -14,7 +14,7 @@ var _excluded = ["fieldId"];
14
14
  /** @jsx jsx */
15
15
  var TEST_ID = exports.TEST_ID = 'link-create-user-picker';
16
16
  var DEFAULT_DEBOUNCE_TIME = 400;
17
- var UserPickerWidth = "100%";
17
+ var UserPickerWidth = '100%';
18
18
 
19
19
  /**
20
20
  * A user picker utilising the SmartUserPicker.
@@ -11,7 +11,6 @@ var _analyticsNext = require("@atlaskit/analytics-next");
11
11
  var _intlMessagesProvider = require("@atlaskit/intl-messages-provider");
12
12
  var _constants = require("../../common/constants");
13
13
  var _errorBoundary = require("../../common/ui/error-boundary");
14
- var _errorBoundaryModal = require("../../common/ui/error-boundary-modal");
15
14
  var _experienceTracker = require("../../common/ui/experience-tracker");
16
15
  var _analytics = require("../../common/utils/analytics");
17
16
  var _fetchMessagesForLocale = require("../../common/utils/locale/fetch-messages-for-locale");
@@ -20,12 +19,7 @@ var _main = _interopRequireDefault(require("./main"));
20
19
  /** @jsx jsx */
21
20
 
22
21
  var LinkCreateWithAnalyticsContext = (0, _analytics.withLinkCreateAnalyticsContext)( /*#__PURE__*/(0, _react.memo)(function (props) {
23
- return (0, _react2.jsx)(_experienceTracker.Experience, null, (0, _react2.jsx)(_errorBoundary.ErrorBoundary, {
24
- errorComponent: (0, _react2.jsx)(_errorBoundaryModal.ErrorBoundaryModal, {
25
- active: props.active,
26
- onClose: props.onCancel
27
- })
28
- }, (0, _react2.jsx)(_main.default, props)));
22
+ return (0, _react2.jsx)(_experienceTracker.Experience, null, (0, _react2.jsx)(_errorBoundary.ErrorBoundary, null, (0, _react2.jsx)(_main.default, props)));
29
23
  }));
30
24
  var ComposedLinkCreate = /*#__PURE__*/(0, _react.memo)(function (props) {
31
25
  return (0, _react2.jsx)(_analyticsNext.AnalyticsContext, {
@@ -7,7 +7,7 @@ export const CREATE_FORM_MIN_HEIGHT_IN_PX = '200';
7
7
  export const LINK_CREATE_FORM_POST_CREATE_FIELD = '__post_create__';
8
8
  export const PACKAGE_DATA = {
9
9
  packageName: "@atlaskit/link-create" || '',
10
- packageVersion: "2.3.0" || '',
10
+ packageVersion: "2.4.0" || '',
11
11
  component: COMPONENT_NAME,
12
12
  componentName: COMPONENT_NAME
13
13
  };
@@ -4,7 +4,7 @@ import SmartUserPicker from '@atlaskit/smart-user-picker';
4
4
  import { CreateField } from '../../../controllers/create-field';
5
5
  export const TEST_ID = 'link-create-user-picker';
6
6
  const DEFAULT_DEBOUNCE_TIME = 400;
7
- const UserPickerWidth = "100%";
7
+ const UserPickerWidth = '100%';
8
8
 
9
9
  /**
10
10
  * A user picker utilising the SmartUserPicker.
@@ -5,19 +5,13 @@ import { AnalyticsContext } from '@atlaskit/analytics-next';
5
5
  import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
6
6
  import { PACKAGE_DATA } from '../../common/constants';
7
7
  import { ErrorBoundary } from '../../common/ui/error-boundary';
8
- import { ErrorBoundaryModal } from '../../common/ui/error-boundary-modal';
9
8
  import { Experience } from '../../common/ui/experience-tracker';
10
9
  import { withLinkCreateAnalyticsContext } from '../../common/utils/analytics';
11
10
  import { fetchMessagesForLocale } from '../../common/utils/locale/fetch-messages-for-locale';
12
11
  import i18nEN from '../../i18n/en';
13
12
  import InlineCreate from './main';
14
13
  const LinkCreateWithAnalyticsContext = withLinkCreateAnalyticsContext( /*#__PURE__*/memo(props => {
15
- return jsx(Experience, null, jsx(ErrorBoundary, {
16
- errorComponent: jsx(ErrorBoundaryModal, {
17
- active: props.active,
18
- onClose: props.onCancel
19
- })
20
- }, jsx(InlineCreate, props)));
14
+ return jsx(Experience, null, jsx(ErrorBoundary, null, jsx(InlineCreate, props)));
21
15
  }));
22
16
  const ComposedLinkCreate = /*#__PURE__*/memo(props => {
23
17
  return jsx(AnalyticsContext, {
@@ -7,7 +7,7 @@ export var CREATE_FORM_MIN_HEIGHT_IN_PX = '200';
7
7
  export var LINK_CREATE_FORM_POST_CREATE_FIELD = '__post_create__';
8
8
  export var PACKAGE_DATA = {
9
9
  packageName: "@atlaskit/link-create" || '',
10
- packageVersion: "2.3.0" || '',
10
+ packageVersion: "2.4.0" || '',
11
11
  component: COMPONENT_NAME,
12
12
  componentName: COMPONENT_NAME
13
13
  };
@@ -6,7 +6,7 @@ import SmartUserPicker from '@atlaskit/smart-user-picker';
6
6
  import { CreateField } from '../../../controllers/create-field';
7
7
  export var TEST_ID = 'link-create-user-picker';
8
8
  var DEFAULT_DEBOUNCE_TIME = 400;
9
- var UserPickerWidth = "100%";
9
+ var UserPickerWidth = '100%';
10
10
 
11
11
  /**
12
12
  * A user picker utilising the SmartUserPicker.
@@ -5,19 +5,13 @@ import { AnalyticsContext } from '@atlaskit/analytics-next';
5
5
  import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
6
6
  import { PACKAGE_DATA } from '../../common/constants';
7
7
  import { ErrorBoundary } from '../../common/ui/error-boundary';
8
- import { ErrorBoundaryModal } from '../../common/ui/error-boundary-modal';
9
8
  import { Experience } from '../../common/ui/experience-tracker';
10
9
  import { withLinkCreateAnalyticsContext } from '../../common/utils/analytics';
11
10
  import { fetchMessagesForLocale } from '../../common/utils/locale/fetch-messages-for-locale';
12
11
  import i18nEN from '../../i18n/en';
13
12
  import InlineCreate from './main';
14
13
  var LinkCreateWithAnalyticsContext = withLinkCreateAnalyticsContext( /*#__PURE__*/memo(function (props) {
15
- return jsx(Experience, null, jsx(ErrorBoundary, {
16
- errorComponent: jsx(ErrorBoundaryModal, {
17
- active: props.active,
18
- onClose: props.onCancel
19
- })
20
- }, jsx(InlineCreate, props)));
14
+ return jsx(Experience, null, jsx(ErrorBoundary, null, jsx(InlineCreate, props)));
21
15
  }));
22
16
  var ComposedLinkCreate = /*#__PURE__*/memo(function (props) {
23
17
  return jsx(AnalyticsContext, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/link-create",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "description": "The driver component of meta creation flow",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -46,7 +46,7 @@
46
46
  "@atlaskit/intl-messages-provider": "^1.0.2",
47
47
  "@atlaskit/linking-common": "^5.7.0",
48
48
  "@atlaskit/modal-dialog": "^12.13.0",
49
- "@atlaskit/primitives": "^6.5.0",
49
+ "@atlaskit/primitives": "^7.0.0",
50
50
  "@atlaskit/select": "^17.10.0",
51
51
  "@atlaskit/smart-user-picker": "^6.9.0",
52
52
  "@atlaskit/spinner": "^16.1.0",
package/report.api.md CHANGED
@@ -2,7 +2,8 @@
2
2
 
3
3
  ## API Report File for "@atlaskit/link-create"
4
4
 
5
- > Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
5
+ > Do not edit this file. This report is auto-generated using
6
+ > [API Extractor](https://api-extractor.com/).
6
7
  > [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
7
8
 
8
9
  ### Table of contents
@@ -32,85 +33,76 @@ import { TextFieldProps as TextFieldProps_2 } from '@atlaskit/textfield';
32
33
 
33
34
  // @public
34
35
  export function AsyncSelect<T = OptionType>({
35
- id,
36
- name,
37
- label,
38
- isRequired,
39
- validators,
40
- validationHelpText,
41
- testId,
42
- defaultOption: propsDefaultValue,
43
- loadOptions: loadOptionsFn,
44
- ...restProps
36
+ id,
37
+ name,
38
+ label,
39
+ isRequired,
40
+ validators,
41
+ validationHelpText,
42
+ testId,
43
+ defaultOption: propsDefaultValue,
44
+ loadOptions: loadOptionsFn,
45
+ ...restProps
45
46
  }: AsyncSelectProps<T>): jsx.JSX.Element;
46
47
 
47
48
  // @public (undocumented)
48
- type AsyncSelectProps<T = OptionType> = Omit<
49
- AsyncSelectProps_2<T>,
50
- 'loadOptions'
51
- > & {
52
- name: string;
53
- label: string;
54
- validationHelpText?: string;
55
- testId?: string;
56
- isRequired?: boolean;
57
- validators?: Validator[];
58
- loadOptions?: (inputValue: string) => Promise<GroupType<T>[] | T[]>;
49
+ type AsyncSelectProps<T = OptionType> = Omit<AsyncSelectProps_2<T>, 'loadOptions'> & {
50
+ name: string;
51
+ label: string;
52
+ validationHelpText?: string;
53
+ testId?: string;
54
+ isRequired?: boolean;
55
+ validators?: Validator[];
56
+ loadOptions?: (inputValue: string) => Promise<GroupType<T>[] | T[]>;
59
57
  };
60
58
 
61
59
  // @public (undocumented)
62
- const ComposedLinkCreate: MemoExoticComponent<
63
- (props: LinkCreateWithModalProps) => jsx.JSX.Element
64
- >;
60
+ const ComposedLinkCreate: MemoExoticComponent<(props: LinkCreateWithModalProps) => jsx.JSX.Element>;
65
61
  export default ComposedLinkCreate;
66
62
 
67
63
  // @public (undocumented)
68
64
  export const CreateForm: <FormData_1 extends Record<string, any> = {}>({
69
- children,
70
- testId,
71
- onSubmit,
72
- onCancel,
73
- isLoading,
74
- hideFooter,
75
- initialValues,
65
+ children,
66
+ testId,
67
+ onSubmit,
68
+ onCancel,
69
+ isLoading,
70
+ hideFooter,
71
+ initialValues,
76
72
  }: CreateFormProps<FormData_1>) => jsx.JSX.Element;
77
73
 
78
74
  // @public
79
- export function CreateFormLoader({
80
- size,
81
- }: Partial<SpinnerProps>): jsx.JSX.Element;
75
+ export function CreateFormLoader({ size }: Partial<SpinnerProps>): jsx.JSX.Element;
82
76
 
83
77
  // @public (undocumented)
84
78
  export interface CreateFormProps<FormData> {
85
- children: ReactNode;
86
- hideFooter?: boolean;
87
- initialValues?: DisallowReservedFields<FormData>;
88
- isLoading?: boolean;
89
- onCancel?: () => void;
90
- onSubmit: (
91
- data: OmitReservedFields<FormData>,
92
- ) => Errors | Promise<Errors | void> | void;
93
- testId?: string;
79
+ children: ReactNode;
80
+ hideFooter?: boolean;
81
+ initialValues?: DisallowReservedFields<FormData>;
82
+ isLoading?: boolean;
83
+ onCancel?: () => void;
84
+ onSubmit: (data: OmitReservedFields<FormData>) => Errors | Promise<Errors | void> | void;
85
+ testId?: string;
94
86
  }
95
87
 
96
88
  // @public
97
89
  export type CreatePayload = {
98
- url: string;
99
- ari?: string | undefined;
100
- objectId: string;
101
- objectType: string;
102
- data?: Record<string, unknown>;
90
+ url: string;
91
+ ari?: string | undefined;
92
+ objectId: string;
93
+ objectType: string;
94
+ data?: Record<string, unknown>;
103
95
  };
104
96
 
105
97
  // @public (undocumented)
106
98
  type DisallowReservedFields<T> = T & {
107
- [Field in (typeof RESERVED_FIELDS)[number]]?: never;
99
+ [Field in (typeof RESERVED_FIELDS)[number]]?: never;
108
100
  };
109
101
 
110
102
  // @public (undocumented)
111
103
  export type EditViewProps = {
112
- payload: CreatePayload;
113
- onClose: () => void;
104
+ payload: CreatePayload;
105
+ onClose: () => void;
114
106
  };
115
107
 
116
108
  // @public (undocumented)
@@ -120,19 +112,19 @@ export { FORM_ERROR };
120
112
 
121
113
  // @public
122
114
  export const FormSpy: <T extends Record<string, unknown>>({
123
- children,
115
+ children,
124
116
  }: FormSpyProps<T>) => JSX.Element;
125
117
 
126
118
  // @public (undocumented)
127
119
  type FormSpyProps<T> = {
128
- children: ({ values }: { values: T }) => React_2.ReactNode;
120
+ children: ({ values }: { values: T }) => React_2.ReactNode;
129
121
  };
130
122
 
131
123
  // @public (undocumented)
132
124
  interface Group {
133
- icon: string;
134
- key: string;
135
- label: string;
125
+ icon: string;
126
+ key: string;
127
+ label: string;
136
128
  }
137
129
 
138
130
  // @public (undocumented)
@@ -140,41 +132,41 @@ export const LinkCreateCallbackProvider: React_2.FC<LinkCreateCallbackProviderPr
140
132
 
141
133
  // @public (undocumented)
142
134
  interface LinkCreateCallbackProviderProps {
143
- onCancel?: () => void;
144
- onCreate?: (result: CreatePayload) => Promise<void> | void;
145
- onFailure?: (error: unknown) => void;
135
+ onCancel?: () => void;
136
+ onCreate?: (result: CreatePayload) => Promise<void> | void;
137
+ onFailure?: (error: unknown) => void;
146
138
  }
147
139
 
148
140
  // @public (undocumented)
149
141
  export interface LinkCreatePlugin {
150
- editView?: ({ payload, onClose }: EditViewProps) => JSX.Element;
151
- form: ReactNode;
152
- group: Group;
153
- icon: string;
154
- key: string;
155
- label: string;
142
+ editView?: ({ payload, onClose }: EditViewProps) => JSX.Element;
143
+ form: ReactNode;
144
+ group: Group;
145
+ icon: string;
146
+ key: string;
147
+ label: string;
156
148
  }
157
149
 
158
150
  // @public (undocumented)
159
151
  export interface LinkCreateProps {
160
- entityKey: string;
161
- groupKey?: string;
162
- onCancel?: () => void;
163
- onComplete?: () => void;
164
- onCreate?: (payload: CreatePayload) => Promise<void> | void;
165
- onFailure?: (error: unknown) => void;
166
- // (undocumented)
167
- plugins: LinkCreatePlugin[];
168
- testId?: string;
169
- triggeredFrom?: string;
152
+ entityKey: string;
153
+ groupKey?: string;
154
+ onCancel?: () => void;
155
+ onComplete?: () => void;
156
+ onCreate?: (payload: CreatePayload) => Promise<void> | void;
157
+ onFailure?: (error: unknown) => void;
158
+ // (undocumented)
159
+ plugins: LinkCreatePlugin[];
160
+ testId?: string;
161
+ triggeredFrom?: string;
170
162
  }
171
163
 
172
164
  // @public (undocumented)
173
165
  export interface LinkCreateWithModalProps
174
- extends LinkCreateProps,
175
- Partial<Pick<ModalDialogProps, 'onCloseComplete' | 'onOpenComplete'>> {
176
- active?: boolean;
177
- modalTitle?: string;
166
+ extends LinkCreateProps,
167
+ Partial<Pick<ModalDialogProps, 'onCloseComplete' | 'onOpenComplete'>> {
168
+ active?: boolean;
169
+ modalTitle?: string;
178
170
  }
179
171
 
180
172
  // @public (undocumented)
@@ -185,49 +177,49 @@ const RESERVED_FIELDS: readonly ['__post_create__'];
185
177
 
186
178
  // @public (undocumented)
187
179
  type ReservedFields = {
188
- [Field in (typeof RESERVED_FIELDS)[number]]?: unknown;
180
+ [Field in (typeof RESERVED_FIELDS)[number]]?: unknown;
189
181
  };
190
182
 
191
183
  // @public
192
184
  export function Select<T = OptionType>({
193
- id,
194
- name,
195
- label,
196
- isRequired,
197
- validators,
198
- validationHelpText,
199
- testId,
200
- ...restProps
185
+ id,
186
+ name,
187
+ label,
188
+ isRequired,
189
+ validators,
190
+ validationHelpText,
191
+ testId,
192
+ ...restProps
201
193
  }: SelectProps<T>): jsx.JSX.Element;
202
194
 
203
195
  // @public (undocumented)
204
196
  type SelectProps<T = OptionType> = SelectProps_2<T> & {
205
- name: string;
206
- label: string;
207
- validationHelpText?: string;
208
- testId?: string;
209
- isRequired?: boolean;
210
- validators?: Validator[];
197
+ name: string;
198
+ label: string;
199
+ validationHelpText?: string;
200
+ testId?: string;
201
+ isRequired?: boolean;
202
+ validators?: Validator[];
211
203
  };
212
204
 
213
205
  // @public
214
206
  export function TextField({
215
- id,
216
- name,
217
- label,
218
- isRequired,
219
- validators,
220
- validationHelpText,
221
- testId,
222
- ...restProps
207
+ id,
208
+ name,
209
+ label,
210
+ isRequired,
211
+ validators,
212
+ validationHelpText,
213
+ testId,
214
+ ...restProps
223
215
  }: TextFieldProps): jsx.JSX.Element;
224
216
 
225
217
  // @public (undocumented)
226
218
  type TextFieldProps = Omit<TextFieldProps_2, 'name'> & {
227
- name: string;
228
- label?: string;
229
- validationHelpText?: string;
230
- validators?: Validator[];
219
+ name: string;
220
+ label?: string;
221
+ validationHelpText?: string;
222
+ validators?: Validator[];
231
223
  };
232
224
 
233
225
  // @public (undocumented)
@@ -235,8 +227,8 @@ export const useLinkCreateCallback: () => LinkCreateCallbackProviderProps;
235
227
 
236
228
  // @public (undocumented)
237
229
  export type Validator = {
238
- isValid: (val: unknown) => boolean;
239
- errorMessage: string;
230
+ isValid: (val: unknown) => boolean;
231
+ errorMessage: string;
240
232
  };
241
233
 
242
234
  // @public
@@ -253,8 +245,8 @@ export type ValidatorMap = Record<string, Validator[]>;
253
245
 
254
246
  ```json
255
247
  {
256
- "react": "^16.8.0",
257
- "react-intl-next": "npm:react-intl@^5.18.1"
248
+ "react": "^16.8.0",
249
+ "react-intl-next": "npm:react-intl@^5.18.1"
258
250
  }
259
251
  ```
260
252