@atlaskit/link-create 1.15.9 → 2.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 (74) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/CONTRIBUTING.md +3 -0
  3. package/dist/cjs/controllers/callback-context/main.js +7 -14
  4. package/dist/cjs/ui/create-form/async-select/main.js +2 -5
  5. package/dist/cjs/ui/create-form/main.js +3 -4
  6. package/dist/cjs/ui/link-create/error-boundary/index.js +5 -14
  7. package/dist/cjs/ui/link-create/main.js +16 -49
  8. package/dist/cjs/ui/main.js +2 -4
  9. package/dist/es2019/controllers/callback-context/main.js +7 -14
  10. package/dist/es2019/ui/create-form/async-select/main.js +2 -5
  11. package/dist/es2019/ui/create-form/main.js +3 -4
  12. package/dist/es2019/ui/link-create/error-boundary/index.js +5 -14
  13. package/dist/es2019/ui/link-create/main.js +3 -21
  14. package/dist/es2019/ui/main.js +3 -5
  15. package/dist/esm/controllers/callback-context/main.js +7 -14
  16. package/dist/esm/ui/create-form/async-select/main.js +2 -5
  17. package/dist/esm/ui/create-form/main.js +3 -4
  18. package/dist/esm/ui/link-create/error-boundary/index.js +5 -14
  19. package/dist/esm/ui/link-create/main.js +17 -50
  20. package/dist/esm/ui/main.js +3 -5
  21. package/dist/types/common/types.d.ts +2 -2
  22. package/dist/types/common/ui/Button/index.d.ts +1 -1
  23. package/dist/types/common/ui/ModalDialog/index.d.ts +1 -1
  24. package/dist/types/common/utils/analytics/components.d.ts +1 -1
  25. package/dist/types/common/utils/analytics/context.d.ts +2 -2
  26. package/dist/types/common/utils/form/index.d.ts +1 -1
  27. package/dist/types/common/utils/locale/fetch-messages-for-locale.d.ts +1 -1
  28. package/dist/types/controllers/callback-context/main.d.ts +2 -2
  29. package/dist/types/controllers/create-field/main.d.ts +1 -1
  30. package/dist/types/controllers/create-field/types.d.ts +2 -2
  31. package/dist/types/controllers/edit-post-create-context/index.d.ts +1 -1
  32. package/dist/types/controllers/form-context/main.d.ts +2 -2
  33. package/dist/types/controllers/plugin-context/index.d.ts +1 -1
  34. package/dist/types/ui/create-form/async-select/main.d.ts +2 -2
  35. package/dist/types/ui/create-form/async-select/types.d.ts +2 -2
  36. package/dist/types/ui/create-form/form-loader/main.d.ts +1 -1
  37. package/dist/types/ui/create-form/main.d.ts +1 -1
  38. package/dist/types/ui/create-form/select/main.d.ts +2 -2
  39. package/dist/types/ui/create-form/select/types.d.ts +2 -2
  40. package/dist/types/ui/create-form/textfield/main.d.ts +1 -1
  41. package/dist/types/ui/create-form/textfield/types.d.ts +2 -2
  42. package/dist/types/ui/create-form/utils/index.d.ts +1 -1
  43. package/dist/types/ui/link-create/error-boundary/error-boundary-base/index.d.ts +1 -1
  44. package/dist/types/ui/link-create/error-boundary/index.d.ts +1 -1
  45. package/dist/types/ui/link-create/main.d.ts +1 -1
  46. package/dist/types/ui/main.d.ts +2 -2
  47. package/dist/types-ts4.5/common/types.d.ts +2 -2
  48. package/dist/types-ts4.5/common/ui/Button/index.d.ts +1 -1
  49. package/dist/types-ts4.5/common/ui/ModalDialog/index.d.ts +1 -1
  50. package/dist/types-ts4.5/common/utils/analytics/components.d.ts +1 -1
  51. package/dist/types-ts4.5/common/utils/analytics/context.d.ts +2 -2
  52. package/dist/types-ts4.5/common/utils/form/index.d.ts +1 -1
  53. package/dist/types-ts4.5/common/utils/locale/fetch-messages-for-locale.d.ts +1 -1
  54. package/dist/types-ts4.5/controllers/callback-context/main.d.ts +2 -2
  55. package/dist/types-ts4.5/controllers/create-field/main.d.ts +1 -1
  56. package/dist/types-ts4.5/controllers/create-field/types.d.ts +2 -2
  57. package/dist/types-ts4.5/controllers/edit-post-create-context/index.d.ts +1 -1
  58. package/dist/types-ts4.5/controllers/form-context/main.d.ts +2 -2
  59. package/dist/types-ts4.5/controllers/plugin-context/index.d.ts +1 -1
  60. package/dist/types-ts4.5/ui/create-form/async-select/main.d.ts +2 -2
  61. package/dist/types-ts4.5/ui/create-form/async-select/types.d.ts +2 -2
  62. package/dist/types-ts4.5/ui/create-form/form-loader/main.d.ts +1 -1
  63. package/dist/types-ts4.5/ui/create-form/main.d.ts +1 -1
  64. package/dist/types-ts4.5/ui/create-form/select/main.d.ts +2 -2
  65. package/dist/types-ts4.5/ui/create-form/select/types.d.ts +2 -2
  66. package/dist/types-ts4.5/ui/create-form/textfield/main.d.ts +1 -1
  67. package/dist/types-ts4.5/ui/create-form/textfield/types.d.ts +2 -2
  68. package/dist/types-ts4.5/ui/create-form/utils/index.d.ts +1 -1
  69. package/dist/types-ts4.5/ui/link-create/error-boundary/error-boundary-base/index.d.ts +1 -1
  70. package/dist/types-ts4.5/ui/link-create/error-boundary/index.d.ts +1 -1
  71. package/dist/types-ts4.5/ui/link-create/main.d.ts +1 -1
  72. package/dist/types-ts4.5/ui/main.d.ts +2 -2
  73. package/example-helpers/mock-plugin-form.tsx +2 -2
  74. package/package.json +8 -16
@@ -11,7 +11,6 @@ import { jsx } from '@emotion/react';
11
11
  import debounce from 'debounce-promise';
12
12
  import { useForm } from 'react-final-form';
13
13
  import { useIntl } from 'react-intl-next';
14
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
15
14
  import { AsyncSelect as AkAsyncSelect } from '@atlaskit/select';
16
15
  import messages from '../../../common/messages';
17
16
  import { useLinkCreateCallback } from '../../../controllers/callback-context';
@@ -60,9 +59,7 @@ export function AsyncSelect(_ref) {
60
59
  /**
61
60
  * This binds experience to fail if async fetch ever fails to load
62
61
  */
63
- var loadOptions = getBooleanFF('platform.linking-platform.link-create.better-observability') ?
64
- // eslint-disable-next-line react-hooks/rules-of-hooks
65
- useMemo(function () {
62
+ var loadOptions = useMemo(function () {
66
63
  if (loadOptionsFn) {
67
64
  return /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
68
65
  var _args = arguments;
@@ -87,7 +84,7 @@ export function AsyncSelect(_ref) {
87
84
  }, _callee, null, [[0, 6]]);
88
85
  }));
89
86
  }
90
- }, [intl, onFailure, loadOptionsFn, setFormErrorMessage]) : loadOptionsFn;
87
+ }, [intl, onFailure, loadOptionsFn, setFormErrorMessage]);
91
88
  useEffect(function () {
92
89
  var current = true;
93
90
  var fetch = /*#__PURE__*/function () {
@@ -13,7 +13,6 @@ import { FORM_ERROR } from 'final-form';
13
13
  import { Form, FormSpy } from 'react-final-form';
14
14
  import { useIntl } from 'react-intl-next';
15
15
  import { RequiredAsterisk } from '@atlaskit/form';
16
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
17
16
  import { Box } from '@atlaskit/primitives';
18
17
  import { CREATE_FORM_MAX_WIDTH_IN_PX, LINK_CREATE_FORM_POST_CREATE_FIELD } from '../../common/constants';
19
18
  import messages from '../../common/messages';
@@ -117,7 +116,7 @@ export var CreateForm = function CreateForm(_ref) {
117
116
  return jsx(CreateFormLoader, null);
118
117
  }
119
118
  return jsx(Form, {
120
- onSubmit: getBooleanFF('platform.linking-platform.link-create.better-observability') ? handleSubmitWithErrorHandling : handleSubmit,
119
+ onSubmit: handleSubmitWithErrorHandling,
121
120
  initialValues: initialValues,
122
121
  mutators: {
123
122
  setField: function setField(args, state, tools) {
@@ -149,7 +148,7 @@ export var CreateForm = function CreateForm(_ref) {
149
148
  });
150
149
  setShouldShowWarning(isModified);
151
150
  }
152
- }), getBooleanFF('platform.linking-platform.link-create.enable-expected-field-errors') && jsx("p", {
151
+ }), jsx("p", {
153
152
  "aria-hidden": "true"
154
153
  }, intl.formatMessage(messages.requiredFieldInstruction), ' ', jsx(RequiredAsterisk, null)), jsx(Box, null, children), !hideFooter && jsx(CreateFormFooter
155
154
  /**
@@ -158,7 +157,7 @@ export var CreateForm = function CreateForm(_ref) {
158
157
  * default to the `formErrorMessage` that we sometimes use with our own
159
158
  * "form context" (only currently used for AsyncSelect field reporting failed loading)
160
159
  */, {
161
- formErrorMessage: getBooleanFF('platform.linking-platform.link-create.better-observability') ? submitError || formErrorMessage : formErrorMessage,
160
+ formErrorMessage: submitError || formErrorMessage,
162
161
  handleCancel: handleCancel,
163
162
  testId: testId
164
163
  }));
@@ -1,7 +1,5 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
3
- import { captureException } from '@atlaskit/linking-common/sentry';
4
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
3
  import { ANALYTICS_CHANNEL } from '../../../common/constants';
6
4
  import { ErrorBoundaryUI } from '../../../common/ui/error-boundary-ui';
7
5
  import createEventPayload from '../../../common/utils/analytics/analytics.codegen';
@@ -12,24 +10,17 @@ export var ErrorBoundary = function ErrorBoundary(_ref) {
12
10
  errorComponent = _ref.errorComponent;
13
11
  var _useAnalyticsEvents = useAnalyticsEvents(),
14
12
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
15
- var experience = getBooleanFF('platform.linking-platform.link-create.better-observability') ?
16
- // eslint-disable-next-line react-hooks/rules-of-hooks
17
- useExperience() : null;
18
- var handleError = useCallback(function (error, info) {
13
+ var experience = useExperience();
14
+ var handleError = useCallback(function (error) {
19
15
  var _window;
20
- if (!getBooleanFF('platform.linking-platform.link-create.better-observability')) {
21
- // Capture exception to Sentry
22
- captureException(error, 'link-create');
23
- }
24
16
  createAnalyticsEvent(createEventPayload('operational.linkCreate.unhandledErrorCaught', {
25
17
  browserInfo: ((_window = window) === null || _window === void 0 || (_window = _window.navigator) === null || _window === void 0 ? void 0 : _window.userAgent) || 'unknown',
26
18
  error: error.name,
27
19
  componentStack: 'unknown'
28
20
  })).fire(ANALYTICS_CHANNEL);
29
- if (getBooleanFF('platform.linking-platform.link-create.better-observability')) {
30
- // Track experience as failed for SLO
31
- experience === null || experience === void 0 || experience.failure(error);
32
- }
21
+
22
+ // Track experience as failed for SLO
23
+ experience === null || experience === void 0 || experience.failure(error);
33
24
  }, [createAnalyticsEvent, experience]);
34
25
  return /*#__PURE__*/React.createElement(BaseErrorBoundary, {
35
26
  onError: handleError,
@@ -1,20 +1,19 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
2
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import _regeneratorRuntime from "@babel/runtime/regenerator";
5
5
  /** @jsx jsx */
6
6
  import { Fragment, useCallback, useLayoutEffect, useRef, useState } from 'react';
7
7
  import { jsx } from '@emotion/react';
8
8
  import { useIntl } from 'react-intl-next';
9
9
  import { ModalBody, ModalHeader, ModalTitle, ModalTransition } from '@atlaskit/modal-dialog';
10
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
11
10
  import { Box } from '@atlaskit/primitives';
12
11
  import { CREATE_FORM_MAX_WIDTH_IN_PX } from '../../common/constants';
13
12
  import { Modal } from '../../common/ui/ModalDialog';
14
13
  import { LinkCreateCallbackProvider } from '../../controllers/callback-context';
15
14
  import { EditPostCreateModalProvider } from '../../controllers/edit-post-create-context';
16
15
  import { ExitWarningModalProvider, useExitWarningModal } from '../../controllers/exit-warning-modal-context';
17
- import { FormContextProvider, useFormContext } from '../../controllers/form-context';
16
+ import { FormContextProvider } from '../../controllers/form-context';
18
17
  import { LinkCreatePluginsProvider } from '../../controllers/plugin-context';
19
18
  import { ConfirmDismissDialog } from './confirm-dismiss-dialog';
20
19
  import { EditModal } from './edit-modal';
@@ -49,38 +48,6 @@ var LinkCreateWithModal = function LinkCreateWithModal(_ref2) {
49
48
  entityKey = _ref2.entityKey,
50
49
  modalHero = _ref2.modalHero;
51
50
  var intl = useIntl();
52
- var _useFormContext = useFormContext(),
53
- setFormErrorMessage = _useFormContext.setFormErrorMessage;
54
- var handleCreate = useCallback( /*#__PURE__*/function () {
55
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(result) {
56
- return _regeneratorRuntime.wrap(function _callee$(_context) {
57
- while (1) switch (_context.prev = _context.next) {
58
- case 0:
59
- // Reset the form error message
60
- setFormErrorMessage(undefined);
61
- if (!onCreate) {
62
- _context.next = 4;
63
- break;
64
- }
65
- _context.next = 4;
66
- return onCreate(result);
67
- case 4:
68
- case "end":
69
- return _context.stop();
70
- }
71
- }, _callee);
72
- }));
73
- return function (_x) {
74
- return _ref3.apply(this, arguments);
75
- };
76
- }(), [onCreate, setFormErrorMessage]);
77
- var handleFailure = useCallback(function (error) {
78
- // Set the form error message
79
- if (error instanceof Error) {
80
- setFormErrorMessage(error.message);
81
- }
82
- onFailure && onFailure(error);
83
- }, [onFailure, setFormErrorMessage]);
84
51
  var _useExitWarningModal = useExitWarningModal(),
85
52
  getShouldShowWarning = _useExitWarningModal.getShouldShowWarning;
86
53
  var _useState = useState(false),
@@ -98,8 +65,8 @@ var LinkCreateWithModal = function LinkCreateWithModal(_ref2) {
98
65
  return setShowExitWarning(false);
99
66
  }, []);
100
67
  return jsx(LinkCreateCallbackProvider, {
101
- onCreate: getBooleanFF('platform.linking-platform.link-create.better-observability') ? onCreate : handleCreate,
102
- onFailure: getBooleanFF('platform.linking-platform.link-create.better-observability') ? onFailure : handleFailure,
68
+ onCreate: onCreate,
69
+ onFailure: onFailure,
103
70
  onCancel: handleCancel
104
71
  }, jsx(ModalTransition, null, active && jsx(Modal, {
105
72
  testId: "link-create-modal",
@@ -140,23 +107,23 @@ var LinkCreateModal = function LinkCreateModal(props) {
140
107
  }, function (pluginsProvider) {
141
108
  return jsx(EditPostCreateModalProvider, {
142
109
  active: !!props.active
143
- }, function (_ref4) {
110
+ }, function (_ref3) {
144
111
  var _pluginsProvider$acti;
145
- var setEditViewPayload = _ref4.setEditViewPayload,
146
- editViewPayload = _ref4.editViewPayload,
147
- shouldActivateEditView = _ref4.shouldActivateEditView,
148
- enableEditView = _ref4.enableEditView;
112
+ var setEditViewPayload = _ref3.setEditViewPayload,
113
+ editViewPayload = _ref3.editViewPayload,
114
+ shouldActivateEditView = _ref3.shouldActivateEditView,
115
+ enableEditView = _ref3.enableEditView;
149
116
  return jsx(FormContextProvider, {
150
117
  enableEditView: pluginsProvider !== null && pluginsProvider !== void 0 && (_pluginsProvider$acti = pluginsProvider.activePlugin) !== null && _pluginsProvider$acti !== void 0 && _pluginsProvider$acti.editView && props !== null && props !== void 0 && props.onComplete ? enableEditView : undefined
151
118
  }, jsx(ExitWarningModalProvider, null, jsx(LinkCreateWithModal, _extends({}, props, {
152
119
  active: props.active && !editViewPayload,
153
120
  onCreate: ( /*#__PURE__*/function () {
154
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(payload) {
121
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(payload) {
155
122
  var _props$onCreate;
156
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
157
- while (1) switch (_context2.prev = _context2.next) {
123
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
124
+ while (1) switch (_context.prev = _context.next) {
158
125
  case 0:
159
- _context2.next = 2;
126
+ _context.next = 2;
160
127
  return (_props$onCreate = props.onCreate) === null || _props$onCreate === void 0 ? void 0 : _props$onCreate.call(props, payload);
161
128
  case 2:
162
129
  // if onComplete exists then there is an edit flow
@@ -171,12 +138,12 @@ var LinkCreateModal = function LinkCreateModal(props) {
171
138
  }
172
139
  case 3:
173
140
  case "end":
174
- return _context2.stop();
141
+ return _context.stop();
175
142
  }
176
- }, _callee2);
143
+ }, _callee);
177
144
  }));
178
- return function (_x2) {
179
- return _ref5.apply(this, arguments);
145
+ return function (_x) {
146
+ return _ref4.apply(this, arguments);
180
147
  };
181
148
  }()),
182
149
  onCloseComplete: function onCloseComplete() {
@@ -1,9 +1,8 @@
1
1
  /** @jsx jsx */
2
- import { Fragment, memo } from 'react';
2
+ import { memo } from 'react';
3
3
  import { jsx } from '@emotion/react';
4
4
  import { AnalyticsContext } from '@atlaskit/analytics-next';
5
5
  import { IntlMessagesProvider } from '@atlaskit/intl-messages-provider';
6
- import { getBooleanFF } from '@atlaskit/platform-feature-flags';
7
6
  import { COMPONENT_NAME } from '../common/constants';
8
7
  import { ErrorBoundaryModal } from '../common/ui/error-boundary-modal';
9
8
  import { withLinkCreateAnalyticsContext } from '../common/utils/analytics';
@@ -13,8 +12,7 @@ import i18nEN from '../i18n/en';
13
12
  import LinkCreate from './link-create';
14
13
  import { ErrorBoundary } from './link-create/error-boundary';
15
14
  var LinkCreateWithAnalyticsContext = withLinkCreateAnalyticsContext( /*#__PURE__*/memo(function (props) {
16
- var ExperienceProvider = getBooleanFF('platform.linking-platform.link-create.better-observability') ? Experience : Fragment;
17
- return jsx(ExperienceProvider, null, jsx(ErrorBoundary, {
15
+ return jsx(Experience, null, jsx(ErrorBoundary, {
18
16
  errorComponent: jsx(ErrorBoundaryModal, {
19
17
  active: props.active,
20
18
  onClose: props.onCancel
@@ -23,7 +21,7 @@ var LinkCreateWithAnalyticsContext = withLinkCreateAnalyticsContext( /*#__PURE__
23
21
  }));
24
22
  export var PACKAGE_DATA = {
25
23
  packageName: "@atlaskit/link-create" || '',
26
- packageVersion: "1.15.9" || '',
24
+ packageVersion: "2.0.0" || '',
27
25
  component: COMPONENT_NAME,
28
26
  componentName: COMPONENT_NAME
29
27
  };
@@ -1,5 +1,5 @@
1
- import { ReactNode } from 'react';
2
- import { ModalDialogProps } from '@atlaskit/modal-dialog';
1
+ import { type ReactNode } from 'react';
2
+ import { type ModalDialogProps } from '@atlaskit/modal-dialog';
3
3
  /** Map of field names to a list of validators for that field */
4
4
  export type ValidatorMap = Record<string, Validator[]>;
5
5
  export type Validator = {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { AnalyticsEventAttributes } from '../../../common/utils/analytics/analytics.codegen';
2
+ import { type AnalyticsEventAttributes } from '../../../common/utils/analytics/analytics.codegen';
3
3
  export declare const Button: React.ForwardRefExoticComponent<Pick<import("@atlaskit/button").ButtonProps & React.RefAttributes<HTMLElement> & {
4
4
  actionSubjectId: "create" | "edit" | "cancel" | "confirm";
5
5
  }, "key" | keyof import("@atlaskit/button").ButtonProps | "actionSubjectId"> & React.RefAttributes<HTMLElement>>;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import ModalDialog from '@atlaskit/modal-dialog';
3
- import { AnalyticsEventAttributes } from '../../utils/analytics/analytics.codegen';
3
+ import { type AnalyticsEventAttributes } from '../../utils/analytics/analytics.codegen';
4
4
  type ModalProps = React.ComponentProps<typeof ModalDialog> & {
5
5
  screen: keyof {
6
6
  [Key in keyof AnalyticsEventAttributes as Key extends `screen.${infer ScreenName}.viewed` ? ScreenName : never]: any;
@@ -1,4 +1,4 @@
1
- import { AnalyticsEventAttributes } from './analytics.codegen';
1
+ import { type AnalyticsEventAttributes } from './analytics.codegen';
2
2
  export type ScreenViewedEventProps = {
3
3
  screen: keyof {
4
4
  [Key in keyof AnalyticsEventAttributes as Key extends `screen.${infer ScreenName}.viewed` ? ScreenName : never]: any;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { LinkCreateProps } from '../../types';
3
- import { LinkCreateAnalyticsContextType } from './analytics.codegen';
2
+ import { type LinkCreateProps } from '../../types';
3
+ import { type LinkCreateAnalyticsContextType } from './analytics.codegen';
4
4
  export type TrackAttribute = <K extends keyof LinkCreateAnalyticsContextType>(attribute: K, value: LinkCreateAnalyticsContextType[K]) => void;
5
5
  interface AnalyticsContextType {
6
6
  /**
@@ -1,4 +1,4 @@
1
- import { FieldMetaState } from 'react-final-form';
1
+ import { type FieldMetaState } from 'react-final-form';
2
2
  /**
3
3
  * This function checks if there have been changes since last submit
4
4
  * to let a Field know if it should hide the error message until
@@ -1,2 +1,2 @@
1
- import { I18NMessages } from '@atlaskit/intl-messages-provider';
1
+ import { type I18NMessages } from '@atlaskit/intl-messages-provider';
2
2
  export declare const fetchMessagesForLocale: (locale: string) => Promise<I18NMessages | undefined>;
@@ -1,5 +1,5 @@
1
- import { PropsWithChildren } from 'react';
2
- import { CreatePayload } from '../../common/types';
1
+ import { type PropsWithChildren } from 'react';
2
+ import { type CreatePayload } from '../../common/types';
3
3
  interface LinkCreateCallbackProviderProps {
4
4
  /**
5
5
  * This callback for when the resource has been successfully created.
@@ -1,4 +1,4 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
- import { CreateFieldProps } from './types';
3
+ import { type CreateFieldProps } from './types';
4
4
  export declare function CreateField({ id, name, label, isRequired, validators, validationHelpText, testId, children, }: CreateFieldProps): jsx.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { FieldInputProps } from 'react-final-form';
3
- import { Validator } from '../../common/types';
2
+ import { type FieldInputProps } from 'react-final-form';
3
+ import { type Validator } from '../../common/types';
4
4
  type FieldProps = FieldInputProps<any, HTMLElement> & {
5
5
  fieldId: string;
6
6
  isInvalid: boolean;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { CreatePayload } from '../../common/types';
2
+ import { type CreatePayload } from '../../common/types';
3
3
  type EditPostCreateModalContextValue = {
4
4
  /**
5
5
  * The created object that is current being editted in the post-create flow
@@ -1,5 +1,5 @@
1
- import React, { PropsWithChildren } from 'react';
2
- import { LinkCreateProps } from '../../common/types';
1
+ import React, { type PropsWithChildren } from 'react';
2
+ import { type LinkCreateProps } from '../../common/types';
3
3
  interface FormContextType {
4
4
  setFormErrorMessage: (errorMessage?: string) => void;
5
5
  formErrorMessage?: string;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { LinkCreatePlugin } from '../../common/types';
2
+ import { type LinkCreatePlugin } from '../../common/types';
3
3
  type LinkCreatePluginsContextValue = {
4
4
  activePlugin: LinkCreatePlugin | null;
5
5
  } | null;
@@ -1,6 +1,6 @@
1
1
  import { jsx } from '@emotion/react';
2
- import { OptionType } from '@atlaskit/select';
3
- import { AsyncSelectProps } from './types';
2
+ import { type OptionType } from '@atlaskit/select';
3
+ import { type AsyncSelectProps } from './types';
4
4
  export declare const TEST_ID = "link-create-async-select";
5
5
  /**
6
6
  * An async select utilising the Atlaskit AsyncSelect and CreateField.
@@ -1,5 +1,5 @@
1
- import { AsyncSelectProps as AKAsyncSelectProps, GroupType, OptionType } from '@atlaskit/select';
2
- import { Validator } from '../../../common/types';
1
+ import { type AsyncSelectProps as AKAsyncSelectProps, type GroupType, type OptionType } from '@atlaskit/select';
2
+ import { type Validator } from '../../../common/types';
3
3
  export type AsyncSelectProps<T = OptionType> = Omit<AKAsyncSelectProps<T>, 'loadOptions'> & {
4
4
  /** Name passed to the <Field> */
5
5
  name: string;
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
- import { SpinnerProps } from '@atlaskit/spinner';
3
+ import { type SpinnerProps } from '@atlaskit/spinner';
4
4
  /**
5
5
  * Wrapper component for the Spinner, shows while the form
6
6
  * performs async functions on load.
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import { ReactNode } from 'react';
2
+ import { type ReactNode } from 'react';
3
3
  import { jsx } from '@emotion/react';
4
4
  type ReservedFields = {
5
5
  [Field in (typeof RESERVED_FIELDS)[number]]?: unknown;
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
- import { OptionType } from '@atlaskit/select';
4
- import { SelectProps } from './types';
3
+ import { type OptionType } from '@atlaskit/select';
4
+ import { type SelectProps } from './types';
5
5
  export declare const TEST_ID = "link-create-select";
6
6
  /**
7
7
  * A select component utilising the Atlaskit Select and CreateField.
@@ -1,5 +1,5 @@
1
- import { SelectProps as AKSelectProps, OptionType } from '@atlaskit/select';
2
- import { Validator } from '../../../common/types';
1
+ import { type SelectProps as AKSelectProps, type OptionType } from '@atlaskit/select';
2
+ import { type Validator } from '../../../common/types';
3
3
  export type SelectProps<T = OptionType> = AKSelectProps<T> & {
4
4
  /** Name passed to the <Field> */
5
5
  name: string;
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
- import { TextFieldProps } from './types';
3
+ import { type TextFieldProps } from './types';
4
4
  export declare const TEST_ID = "link-create-text-field";
5
5
  /**
6
6
  * A text field utilising the Atlaskit Textfield and CreateField.
@@ -1,5 +1,5 @@
1
- import { TextFieldProps as AKTextFieldProps } from '@atlaskit/textfield';
2
- import { Validator } from '../../../common/types';
1
+ import { type TextFieldProps as AKTextFieldProps } from '@atlaskit/textfield';
2
+ import { type Validator } from '../../../common/types';
3
3
  export type TextFieldProps = Omit<AKTextFieldProps, 'name'> & {
4
4
  /** Name passed to the <Field>.*/
5
5
  name: string;
@@ -1,4 +1,4 @@
1
- import { ValidatorMap } from '../../../common/types';
1
+ import { type ValidatorMap } from '../../../common/types';
2
2
  /** Map of field names to errors for that field (or undefined if no error for that field) */
3
3
  export type ValidatorResults = {
4
4
  [name: string]: string | undefined;
@@ -1,4 +1,4 @@
1
- import { Component, ReactNode } from 'react';
1
+ import { Component, type ReactNode } from 'react';
2
2
  export type ErrorBoundaryErrorInfo = {
3
3
  componentStack: string;
4
4
  };
@@ -1,4 +1,4 @@
1
- import { PropsWithChildren } from 'react';
1
+ import { type PropsWithChildren } from 'react';
2
2
  type ErrorBoundaryProps = PropsWithChildren<{
3
3
  errorComponent?: JSX.Element;
4
4
  }>;
@@ -1,5 +1,5 @@
1
1
  import { jsx } from '@emotion/react';
2
- import { LinkCreateWithModalProps } from '../../common/types';
2
+ import { type LinkCreateWithModalProps } from '../../common/types';
3
3
  export declare const TEST_ID = "link-create";
4
4
  declare const LinkCreateModal: (props: LinkCreateWithModalProps) => jsx.JSX.Element;
5
5
  export default LinkCreateModal;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { jsx } from '@emotion/react';
3
- import { LinkCreateWithModalProps } from '../common/types';
4
- import { PackageMetaDataType } from '../common/utils/analytics/analytics.codegen';
3
+ import { type LinkCreateWithModalProps } from '../common/types';
4
+ import { type PackageMetaDataType } from '../common/utils/analytics/analytics.codegen';
5
5
  export declare const PACKAGE_DATA: PackageMetaDataType;
6
6
  declare const ComposedLinkCreate: import("react").MemoExoticComponent<(props: LinkCreateWithModalProps) => jsx.JSX.Element>;
7
7
  export default ComposedLinkCreate;
@@ -1,5 +1,5 @@
1
- import { ReactNode } from 'react';
2
- import { ModalDialogProps } from '@atlaskit/modal-dialog';
1
+ import { type ReactNode } from 'react';
2
+ import { type ModalDialogProps } from '@atlaskit/modal-dialog';
3
3
  /** Map of field names to a list of validators for that field */
4
4
  export type ValidatorMap = Record<string, Validator[]>;
5
5
  export type Validator = {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { AnalyticsEventAttributes } from '../../../common/utils/analytics/analytics.codegen';
2
+ import { type AnalyticsEventAttributes } from '../../../common/utils/analytics/analytics.codegen';
3
3
  export declare const Button: React.ForwardRefExoticComponent<Pick<import("@atlaskit/button").ButtonProps & React.RefAttributes<HTMLElement> & {
4
4
  actionSubjectId: "create" | "edit" | "cancel" | "confirm";
5
5
  }, "key" | keyof import("@atlaskit/button").ButtonProps | "actionSubjectId"> & React.RefAttributes<HTMLElement>>;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import ModalDialog from '@atlaskit/modal-dialog';
3
- import { AnalyticsEventAttributes } from '../../utils/analytics/analytics.codegen';
3
+ import { type AnalyticsEventAttributes } from '../../utils/analytics/analytics.codegen';
4
4
  type ModalProps = React.ComponentProps<typeof ModalDialog> & {
5
5
  screen: keyof {
6
6
  [Key in keyof AnalyticsEventAttributes as Key extends `screen.${infer ScreenName}.viewed` ? ScreenName : never]: any;
@@ -1,4 +1,4 @@
1
- import { AnalyticsEventAttributes } from './analytics.codegen';
1
+ import { type AnalyticsEventAttributes } from './analytics.codegen';
2
2
  export type ScreenViewedEventProps = {
3
3
  screen: keyof {
4
4
  [Key in keyof AnalyticsEventAttributes as Key extends `screen.${infer ScreenName}.viewed` ? ScreenName : never]: any;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { LinkCreateProps } from '../../types';
3
- import { LinkCreateAnalyticsContextType } from './analytics.codegen';
2
+ import { type LinkCreateProps } from '../../types';
3
+ import { type LinkCreateAnalyticsContextType } from './analytics.codegen';
4
4
  export type TrackAttribute = <K extends keyof LinkCreateAnalyticsContextType>(attribute: K, value: LinkCreateAnalyticsContextType[K]) => void;
5
5
  interface AnalyticsContextType {
6
6
  /**
@@ -1,4 +1,4 @@
1
- import { FieldMetaState } from 'react-final-form';
1
+ import { type FieldMetaState } from 'react-final-form';
2
2
  /**
3
3
  * This function checks if there have been changes since last submit
4
4
  * to let a Field know if it should hide the error message until
@@ -1,2 +1,2 @@
1
- import { I18NMessages } from '@atlaskit/intl-messages-provider';
1
+ import { type I18NMessages } from '@atlaskit/intl-messages-provider';
2
2
  export declare const fetchMessagesForLocale: (locale: string) => Promise<I18NMessages | undefined>;
@@ -1,5 +1,5 @@
1
- import { PropsWithChildren } from 'react';
2
- import { CreatePayload } from '../../common/types';
1
+ import { type PropsWithChildren } from 'react';
2
+ import { type CreatePayload } from '../../common/types';
3
3
  interface LinkCreateCallbackProviderProps {
4
4
  /**
5
5
  * This callback for when the resource has been successfully created.
@@ -1,4 +1,4 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
- import { CreateFieldProps } from './types';
3
+ import { type CreateFieldProps } from './types';
4
4
  export declare function CreateField({ id, name, label, isRequired, validators, validationHelpText, testId, children, }: CreateFieldProps): jsx.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { FieldInputProps } from 'react-final-form';
3
- import { Validator } from '../../common/types';
2
+ import { type FieldInputProps } from 'react-final-form';
3
+ import { type Validator } from '../../common/types';
4
4
  type FieldProps = FieldInputProps<any, HTMLElement> & {
5
5
  fieldId: string;
6
6
  isInvalid: boolean;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { CreatePayload } from '../../common/types';
2
+ import { type CreatePayload } from '../../common/types';
3
3
  type EditPostCreateModalContextValue = {
4
4
  /**
5
5
  * The created object that is current being editted in the post-create flow
@@ -1,5 +1,5 @@
1
- import React, { PropsWithChildren } from 'react';
2
- import { LinkCreateProps } from '../../common/types';
1
+ import React, { type PropsWithChildren } from 'react';
2
+ import { type LinkCreateProps } from '../../common/types';
3
3
  interface FormContextType {
4
4
  setFormErrorMessage: (errorMessage?: string) => void;
5
5
  formErrorMessage?: string;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { LinkCreatePlugin } from '../../common/types';
2
+ import { type LinkCreatePlugin } from '../../common/types';
3
3
  type LinkCreatePluginsContextValue = {
4
4
  activePlugin: LinkCreatePlugin | null;
5
5
  } | null;
@@ -1,6 +1,6 @@
1
1
  import { jsx } from '@emotion/react';
2
- import { OptionType } from '@atlaskit/select';
3
- import { AsyncSelectProps } from './types';
2
+ import { type OptionType } from '@atlaskit/select';
3
+ import { type AsyncSelectProps } from './types';
4
4
  export declare const TEST_ID = "link-create-async-select";
5
5
  /**
6
6
  * An async select utilising the Atlaskit AsyncSelect and CreateField.
@@ -1,5 +1,5 @@
1
- import { AsyncSelectProps as AKAsyncSelectProps, GroupType, OptionType } from '@atlaskit/select';
2
- import { Validator } from '../../../common/types';
1
+ import { type AsyncSelectProps as AKAsyncSelectProps, type GroupType, type OptionType } from '@atlaskit/select';
2
+ import { type Validator } from '../../../common/types';
3
3
  export type AsyncSelectProps<T = OptionType> = Omit<AKAsyncSelectProps<T>, 'loadOptions'> & {
4
4
  /** Name passed to the <Field> */
5
5
  name: string;
@@ -1,6 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
- import { SpinnerProps } from '@atlaskit/spinner';
3
+ import { type SpinnerProps } from '@atlaskit/spinner';
4
4
  /**
5
5
  * Wrapper component for the Spinner, shows while the form
6
6
  * performs async functions on load.