@atlaskit/editor-plugin-extension 5.2.5 → 5.2.6

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 (70) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/cjs/extensionPlugin.js +1 -1
  3. package/dist/cjs/pm-plugins/toolbar.js +5 -3
  4. package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +29 -10
  5. package/dist/cjs/ui/ConfigPanel/ConfigPanelFieldsLoader.js +7 -1
  6. package/dist/cjs/ui/ConfigPanel/Fields/Boolean.js +8 -4
  7. package/dist/cjs/ui/ConfigPanel/Fields/CheckboxGroup.js +4 -2
  8. package/dist/cjs/ui/ConfigPanel/Fields/ColorPicker.js +4 -2
  9. package/dist/cjs/ui/ConfigPanel/Fields/CustomSelect.js +4 -2
  10. package/dist/cjs/ui/ConfigPanel/Fields/Date.js +4 -2
  11. package/dist/cjs/ui/ConfigPanel/Fields/DateRange.js +10 -5
  12. package/dist/cjs/ui/ConfigPanel/Fields/Fieldset.js +2 -1
  13. package/dist/cjs/ui/ConfigPanel/Fields/Number.js +4 -2
  14. package/dist/cjs/ui/ConfigPanel/Fields/RadioGroup.js +2 -1
  15. package/dist/cjs/ui/ConfigPanel/Fields/Select.js +2 -1
  16. package/dist/cjs/ui/ConfigPanel/Fields/String.js +4 -2
  17. package/dist/cjs/ui/ConfigPanel/Fields/UserSelect.js +5 -3
  18. package/dist/cjs/ui/ConfigPanel/FormContent.js +18 -5
  19. package/dist/cjs/ui/ConfigPanel/LoadingState.js +28 -1
  20. package/dist/es2019/extensionPlugin.js +1 -1
  21. package/dist/es2019/pm-plugins/toolbar.js +5 -4
  22. package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +18 -6
  23. package/dist/es2019/ui/ConfigPanel/ConfigPanelFieldsLoader.js +7 -1
  24. package/dist/es2019/ui/ConfigPanel/Fields/Boolean.js +8 -4
  25. package/dist/es2019/ui/ConfigPanel/Fields/CheckboxGroup.js +4 -2
  26. package/dist/es2019/ui/ConfigPanel/Fields/ColorPicker.js +4 -2
  27. package/dist/es2019/ui/ConfigPanel/Fields/CustomSelect.js +4 -2
  28. package/dist/es2019/ui/ConfigPanel/Fields/Date.js +4 -2
  29. package/dist/es2019/ui/ConfigPanel/Fields/DateRange.js +10 -5
  30. package/dist/es2019/ui/ConfigPanel/Fields/Fieldset.js +2 -1
  31. package/dist/es2019/ui/ConfigPanel/Fields/Number.js +4 -2
  32. package/dist/es2019/ui/ConfigPanel/Fields/RadioGroup.js +2 -1
  33. package/dist/es2019/ui/ConfigPanel/Fields/Select.js +2 -1
  34. package/dist/es2019/ui/ConfigPanel/Fields/String.js +4 -2
  35. package/dist/es2019/ui/ConfigPanel/Fields/UserSelect.js +5 -3
  36. package/dist/es2019/ui/ConfigPanel/FormContent.js +19 -5
  37. package/dist/es2019/ui/ConfigPanel/LoadingState.js +26 -1
  38. package/dist/esm/extensionPlugin.js +1 -1
  39. package/dist/esm/pm-plugins/toolbar.js +5 -3
  40. package/dist/esm/ui/ConfigPanel/ConfigPanel.js +29 -10
  41. package/dist/esm/ui/ConfigPanel/ConfigPanelFieldsLoader.js +7 -1
  42. package/dist/esm/ui/ConfigPanel/Fields/Boolean.js +8 -4
  43. package/dist/esm/ui/ConfigPanel/Fields/CheckboxGroup.js +4 -2
  44. package/dist/esm/ui/ConfigPanel/Fields/ColorPicker.js +4 -2
  45. package/dist/esm/ui/ConfigPanel/Fields/CustomSelect.js +4 -2
  46. package/dist/esm/ui/ConfigPanel/Fields/Date.js +4 -2
  47. package/dist/esm/ui/ConfigPanel/Fields/DateRange.js +10 -5
  48. package/dist/esm/ui/ConfigPanel/Fields/Fieldset.js +2 -1
  49. package/dist/esm/ui/ConfigPanel/Fields/Number.js +4 -2
  50. package/dist/esm/ui/ConfigPanel/Fields/RadioGroup.js +2 -1
  51. package/dist/esm/ui/ConfigPanel/Fields/Select.js +2 -1
  52. package/dist/esm/ui/ConfigPanel/Fields/String.js +4 -2
  53. package/dist/esm/ui/ConfigPanel/Fields/UserSelect.js +5 -3
  54. package/dist/esm/ui/ConfigPanel/FormContent.js +18 -5
  55. package/dist/esm/ui/ConfigPanel/LoadingState.js +28 -1
  56. package/dist/types/extensionPluginType.d.ts +3 -1
  57. package/dist/types/pm-plugins/toolbar.d.ts +2 -1
  58. package/dist/types/ui/ConfigPanel/ConfigPanel.d.ts +4 -3
  59. package/dist/types/ui/ConfigPanel/ConfigPanelFieldsLoader.d.ts +2 -2
  60. package/dist/types/ui/ConfigPanel/FormContent.d.ts +1 -1
  61. package/dist/types/ui/ConfigPanel/LoadingState.d.ts +3 -1
  62. package/dist/types/ui/ConfigPanel/types.d.ts +1 -0
  63. package/dist/types-ts4.5/extensionPluginType.d.ts +3 -1
  64. package/dist/types-ts4.5/pm-plugins/toolbar.d.ts +3 -1
  65. package/dist/types-ts4.5/ui/ConfigPanel/ConfigPanel.d.ts +4 -3
  66. package/dist/types-ts4.5/ui/ConfigPanel/ConfigPanelFieldsLoader.d.ts +2 -2
  67. package/dist/types-ts4.5/ui/ConfigPanel/FormContent.d.ts +1 -1
  68. package/dist/types-ts4.5/ui/ConfigPanel/LoadingState.d.ts +3 -1
  69. package/dist/types-ts4.5/ui/ConfigPanel/types.d.ts +1 -0
  70. package/package.json +7 -6
@@ -55,14 +55,16 @@ function Checkbox(_ref) {
55
55
  _field$isRequired = field.isRequired,
56
56
  isRequired = _field$isRequired === void 0 ? false : _field$isRequired,
57
57
  _field$defaultValue = field.defaultValue,
58
- defaultValue = _field$defaultValue === void 0 ? false : _field$defaultValue;
58
+ defaultValue = _field$defaultValue === void 0 ? false : _field$defaultValue,
59
+ isDisabled = field.isDisabled;
59
60
  return jsx(Field, {
60
61
  name: name,
61
62
  isRequired: isRequired,
62
63
  validate: function validate(value) {
63
64
  return _validate(value, isRequired);
64
65
  },
65
- defaultValue: defaultValue
66
+ defaultValue: defaultValue,
67
+ isDisabled: isDisabled
66
68
  }, function (_ref2) {
67
69
  var fieldProps = _ref2.fieldProps,
68
70
  error = _ref2.error;
@@ -92,7 +94,8 @@ function Toggle(_ref3) {
92
94
  _field$isRequired2 = field.isRequired,
93
95
  isRequired = _field$isRequired2 === void 0 ? false : _field$isRequired2,
94
96
  _field$defaultValue2 = field.defaultValue,
95
- defaultValue = _field$defaultValue2 === void 0 ? false : _field$defaultValue2;
97
+ defaultValue = _field$defaultValue2 === void 0 ? false : _field$defaultValue2,
98
+ isDisabled = field.isDisabled;
96
99
  return jsx(Field, {
97
100
  name: name,
98
101
  isRequired: isRequired,
@@ -100,7 +103,8 @@ function Toggle(_ref3) {
100
103
  return _validate(value, isRequired);
101
104
  },
102
105
  defaultValue: defaultValue,
103
- testId: "config-panel-toggle-".concat(name)
106
+ testId: "config-panel-toggle-".concat(name),
107
+ isDisabled: isDisabled
104
108
  }, function (_ref4) {
105
109
  var fieldProps = _ref4.fieldProps,
106
110
  error = _ref4.error;
@@ -79,7 +79,8 @@ export default function CheckboxGroup(_ref3) {
79
79
  defaultValue = field.defaultValue,
80
80
  _field$isRequired = field.isRequired,
81
81
  isRequired = _field$isRequired === void 0 ? false : _field$isRequired,
82
- options = field.items;
82
+ options = field.items,
83
+ isDisabled = field.isDisabled;
83
84
  var label = jsx(Fragment, null, labelBase, isRequired ? jsx("span", {
84
85
  css: requiredIndicatorStyles,
85
86
  "aria-hidden": "true"
@@ -93,7 +94,8 @@ export default function CheckboxGroup(_ref3) {
93
94
  defaultValue: defaultValue,
94
95
  validate: function validate(value) {
95
96
  return _validate(value, isRequired);
96
- }
97
+ },
98
+ isDisabled: isDisabled
97
99
  }, function (props) {
98
100
  return jsx(CheckboxGroupInner, _extends({
99
101
  label: label,
@@ -376,7 +376,8 @@ var ColorPickerField = function ColorPickerField(_ref) {
376
376
  featureFlags = _ref.featureFlags;
377
377
  var label = field.label,
378
378
  defaultValue = field.defaultValue,
379
- isRequired = field.isRequired;
379
+ isRequired = field.isRequired,
380
+ isDisabled = field.isDisabled;
380
381
  return jsx(Field, {
381
382
  name: name,
382
383
  isRequired: isRequired,
@@ -384,7 +385,8 @@ var ColorPickerField = function ColorPickerField(_ref) {
384
385
  testId: "config-panel-color-picker-".concat(name),
385
386
  validate: function validate(value) {
386
387
  return _validate(field, value || '');
387
- }
388
+ },
389
+ isDisabled: isDisabled
388
390
  }, function (_ref2) {
389
391
  var fieldProps = _ref2.fieldProps,
390
392
  error = _ref2.error;
@@ -35,7 +35,8 @@ function CustomSelect(_ref2) {
35
35
  isMultiple = field.isMultiple,
36
36
  isRequired = field.isRequired,
37
37
  label = field.label,
38
- options = field.options;
38
+ options = field.options,
39
+ isDisabled = field.isDisabled;
39
40
  var _useState = useState(true),
40
41
  _useState2 = _slicedToArray(_useState, 2),
41
42
  loading = _useState2[0],
@@ -141,7 +142,8 @@ function CustomSelect(_ref2) {
141
142
  validate: function validate(value) {
142
143
  return _validate(field, value);
143
144
  },
144
- testId: "config-panel-custom-select-".concat(name)
145
+ testId: "config-panel-custom-select-".concat(name),
146
+ isDisabled: isDisabled
145
147
  }, function (_ref3) {
146
148
  var fieldProps = _ref3.fieldProps,
147
149
  error = _ref3.error;
@@ -15,7 +15,8 @@ function Date(_ref) {
15
15
  var label = field.label,
16
16
  description = field.description,
17
17
  defaultValue = field.defaultValue,
18
- isRequired = field.isRequired;
18
+ isRequired = field.isRequired,
19
+ isDisabled = field.isDisabled;
19
20
  return /*#__PURE__*/React.createElement(Field, {
20
21
  name: name,
21
22
  label: label,
@@ -24,7 +25,8 @@ function Date(_ref) {
24
25
  validate: function validate(value) {
25
26
  return _validate(field, value);
26
27
  },
27
- testId: "config-panel-date-picker-".concat(name)
28
+ testId: "config-panel-date-picker-".concat(name),
29
+ isDisabled: isDisabled
28
30
  }, function (_ref2) {
29
31
  var fieldProps = _ref2.fieldProps,
30
32
  error = _ref2.error;
@@ -42,7 +42,8 @@ var DateField = function DateField(_ref) {
42
42
  fieldName = _ref.fieldName,
43
43
  onFieldChange = _ref.onFieldChange,
44
44
  intl = _ref.intl,
45
- isRequired = _ref.isRequired;
45
+ isRequired = _ref.isRequired,
46
+ isDisabled = _ref.isDisabled;
46
47
  return jsx("div", {
47
48
  css: horizontalFieldWrapperStyles,
48
49
  key: fieldName
@@ -55,7 +56,8 @@ var DateField = function DateField(_ref) {
55
56
  return validateRequired({
56
57
  isRequired: isRequired
57
58
  }, value);
58
- }
59
+ },
60
+ isDisabled: isDisabled
59
61
  }, function (_ref2) {
60
62
  var fieldProps = _ref2.fieldProps,
61
63
  error = _ref2.error;
@@ -120,7 +122,8 @@ var DateRange = function DateRange(_ref3) {
120
122
  validate: function validate(value) {
121
123
  return _validate(field, value || '');
122
124
  },
123
- testId: "config-panel-date-range-".concat(name)
125
+ testId: "config-panel-date-range-".concat(name),
126
+ isDisabled: field.isDisabled
124
127
  }, function (_ref5) {
125
128
  var fieldProps = _ref5.fieldProps,
126
129
  error = _ref5.error;
@@ -157,14 +160,16 @@ var DateRange = function DateRange(_ref3) {
157
160
  fieldName: "from",
158
161
  onFieldChange: onFieldChange,
159
162
  intl: intl,
160
- isRequired: field.isRequired
163
+ isRequired: field.isRequired,
164
+ isDisabled: field.isDisabled
161
165
  }), jsx(DateField, {
162
166
  scope: name,
163
167
  parentField: field,
164
168
  fieldName: "to",
165
169
  onFieldChange: onFieldChange,
166
170
  intl: intl,
167
- isRequired: field.isRequired
171
+ isRequired: field.isRequired,
172
+ isDisabled: field.isDisabled
168
173
  })), jsx(FieldMessages, {
169
174
  description: field.description
170
175
  }));
@@ -252,7 +252,8 @@ var FieldsetField = /*#__PURE__*/function (_React$Component) {
252
252
  canRemoveFields: field.options.isDynamic && visibleFields.size > 1,
253
253
  onClickRemove: this.onClickRemove,
254
254
  onFieldChange: onFieldChange,
255
- firstVisibleFieldName: firstVisibleFieldName
255
+ firstVisibleFieldName: firstVisibleFieldName,
256
+ isDisabled: field.isDisabled
256
257
  }), children && jsx("div", {
257
258
  css: actionsWrapperStyles,
258
259
  "data-testId": "fieldset-actions"
@@ -15,7 +15,8 @@ export default function Number(_ref) {
15
15
  var label = field.label,
16
16
  description = field.description,
17
17
  defaultValue = field.defaultValue,
18
- isRequired = field.isRequired;
18
+ isRequired = field.isRequired,
19
+ isDisabled = field.isDisabled;
19
20
  function validateNumber(value) {
20
21
  var error = validate(field, value || '');
21
22
  if (error) {
@@ -35,7 +36,8 @@ export default function Number(_ref) {
35
36
  defaultValue: defaultValue === undefined ? '' : String(defaultValue),
36
37
  isRequired: isRequired,
37
38
  validate: validateNumber,
38
- testId: "config-panel-number-".concat(name)
39
+ testId: "config-panel-number-".concat(name),
40
+ isDisabled: isDisabled
39
41
  }, function (_ref2) {
40
42
  var fieldProps = _ref2.fieldProps,
41
43
  error = _ref2.error,
@@ -25,7 +25,8 @@ export default function RadioField(_ref) {
25
25
  validate: function validate(value) {
26
26
  return _validate(field, value);
27
27
  },
28
- testId: "config-panel-radio-group-".concat(field.name)
28
+ testId: "config-panel-radio-group-".concat(field.name),
29
+ isDisabled: field.isDisabled
29
30
  }, function (_ref2) {
30
31
  var fieldProps = _ref2.fieldProps,
31
32
  error = _ref2.error;
@@ -28,7 +28,8 @@ export default function SelectField(_ref) {
28
28
  // Ignored via go/ees005
29
29
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
30
30
  return _validate(field, value);
31
- }
31
+ },
32
+ isDisabled: field.isDisabled
32
33
  }, function (_ref2) {
33
34
  var fieldProps = _ref2.fieldProps,
34
35
  error = _ref2.error;
@@ -16,7 +16,8 @@ export default function String(_ref) {
16
16
  var label = field.label,
17
17
  description = field.description,
18
18
  defaultValue = field.defaultValue,
19
- isRequired = field.isRequired;
19
+ isRequired = field.isRequired,
20
+ isDisabled = field.isDisabled;
20
21
  return /*#__PURE__*/React.createElement(Field, {
21
22
  name: name,
22
23
  label: label,
@@ -25,7 +26,8 @@ export default function String(_ref) {
25
26
  validate: function validate(value) {
26
27
  return _validate(field, value || '');
27
28
  },
28
- testId: "config-panel-string-".concat(name)
29
+ testId: "config-panel-string-".concat(name),
30
+ isDisabled: isDisabled
29
31
  }, function (_ref2) {
30
32
  var fieldProps = _ref2.fieldProps,
31
33
  error = _ref2.error,
@@ -172,7 +172,8 @@ export default function UserSelect(_ref2) {
172
172
  defaultValue = field.defaultValue,
173
173
  description = field.description,
174
174
  isRequired = field.isRequired,
175
- options = field.options;
175
+ options = field.options,
176
+ isDisabled = field.isDisabled;
176
177
  var type = options.provider.type;
177
178
  useEffect(function () {
178
179
  var cancel = false;
@@ -229,7 +230,8 @@ export default function UserSelect(_ref2) {
229
230
  validate: function validate(value) {
230
231
  return _validate(field, value);
231
232
  },
232
- testId: "config-panel-user-select-".concat(name)
233
+ testId: "config-panel-user-select-".concat(name),
234
+ isDisabled: isDisabled
233
235
  }, function (_ref3) {
234
236
  var fieldProps = _ref3.fieldProps,
235
237
  error = _ref3.error,
@@ -239,7 +241,7 @@ export default function UserSelect(_ref2) {
239
241
  return /*#__PURE__*/React.createElement(UnhandledType, {
240
242
  key: name,
241
243
  field: field,
242
- errorMessage: "Field \"".concat(name, "\" can't be renderered. Missing provider for \"").concat(type, "\".")
244
+ errorMessage: "Field \"".concat(name, "\" can't be rendered. Missing provider for \"").concat(type, "\".")
243
245
  });
244
246
  }
245
247
  function onChange(newValue) {
@@ -3,6 +3,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  import React from 'react';
5
5
  import { isFieldset } from '@atlaskit/editor-common/extensions';
6
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
6
7
  import Boolean from './Fields/Boolean';
7
8
  import ColorPicker from './Fields/ColorPicker';
8
9
  import CustomSelect from './Fields/CustomSelect';
@@ -139,7 +140,8 @@ export function FieldComponent(_ref) {
139
140
  parameters: resolvedParameters,
140
141
  onFieldChange: onFieldChange,
141
142
  extensionManifest: extensionManifest,
142
- featureFlags: featureFlags
143
+ featureFlags: featureFlags,
144
+ isDisabled: field.isDisabled
143
145
  }));
144
146
  }
145
147
  case 'tab-group':
@@ -157,7 +159,8 @@ export function FieldComponent(_ref) {
157
159
  parameters: tabParameters,
158
160
  onFieldChange: onFieldChange,
159
161
  extensionManifest: extensionManifest,
160
- featureFlags: featureFlags
162
+ featureFlags: featureFlags,
163
+ isDisabled: field.isDisabled
161
164
  });
162
165
  };
163
166
  return /*#__PURE__*/React.createElement(TabGroup, {
@@ -191,12 +194,22 @@ export default function FormContent(_ref3) {
191
194
  onFieldChange = _ref3.onFieldChange,
192
195
  firstVisibleFieldName = _ref3.firstVisibleFieldName,
193
196
  contextIdentifierProvider = _ref3.contextIdentifierProvider,
194
- featureFlags = _ref3.featureFlags;
197
+ featureFlags = _ref3.featureFlags,
198
+ isDisabled = _ref3.isDisabled;
199
+ var mappedFields = fields;
200
+ if (editorExperiment('platform_editor_offline_editing_web', true)) {
201
+ mappedFields = fields.map(function (field) {
202
+ var _field$isDisabled;
203
+ return _objectSpread(_objectSpread({}, field), {}, {
204
+ isDisabled: (_field$isDisabled = field.isDisabled) !== null && _field$isDisabled !== void 0 ? _field$isDisabled : isDisabled
205
+ });
206
+ });
207
+ }
195
208
  return /*#__PURE__*/React.createElement(FormErrorBoundary, {
196
209
  contextIdentifierProvider: contextIdentifierProvider,
197
210
  extensionKey: extensionManifest.key,
198
- fields: fields
199
- }, fields.map(function (field) {
211
+ fields: mappedFields
212
+ }, mappedFields.map(function (field) {
200
213
  var fieldElement = /*#__PURE__*/React.createElement(FieldComponent, {
201
214
  field: field,
202
215
  parameters: parameters || {},
@@ -4,13 +4,37 @@
4
4
  */
5
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
6
  import { css, jsx } from '@emotion/react';
7
+ import { injectIntl } from 'react-intl-next';
8
+ import { messages } from '@atlaskit/editor-common/extensions';
9
+ import SectionMessage from '@atlaskit/section-message';
7
10
  import Spinner from '@atlaskit/spinner';
11
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
8
12
  var spinnerWrapperStyles = css({
9
13
  display: 'flex',
10
14
  justifyContent: 'center',
11
15
  marginTop: "var(--ds-space-800, 64px)"
12
16
  });
13
- var LoadingState = function LoadingState() {
17
+ var errorWrapperStyles = css({
18
+ marginTop: "var(--ds-space-400, 32px)" // Add some padding to the top to make sure we place this below the offline status banner
19
+ });
20
+ var LoadingStateWithErrorHandling = injectIntl(function (props) {
21
+ if (props.error) {
22
+ return jsx("div", {
23
+ css: errorWrapperStyles,
24
+ "data-testid": "ConfigPanelLoadingError"
25
+ }, jsx(SectionMessage, {
26
+ appearance: "error"
27
+ }, props.intl.formatMessage(messages.panelLoadingError)));
28
+ }
29
+ return jsx("div", {
30
+ css: spinnerWrapperStyles,
31
+ "data-testid": "ConfigPanelLoading"
32
+ }, jsx(Spinner, {
33
+ size: "small",
34
+ interactionName: "config-panel-spinner"
35
+ }));
36
+ });
37
+ var LoadingStateWithoutErrorHandling = function LoadingStateWithoutErrorHandling() {
14
38
  return jsx("div", {
15
39
  css: spinnerWrapperStyles,
16
40
  "data-testid": "ConfigPanelLoading"
@@ -19,4 +43,7 @@ var LoadingState = function LoadingState() {
19
43
  interactionName: "config-panel-spinner"
20
44
  }));
21
45
  };
46
+ var LoadingState = function LoadingState(props) {
47
+ return editorExperiment('platform_editor_offline_editing_web', true) ? LoadingStateWithErrorHandling(props) : LoadingStateWithoutErrorHandling();
48
+ };
22
49
  export default LoadingState;
@@ -4,6 +4,7 @@ import type { ExtensionAPI, ExtensionHandlers, ExtensionProvider, Parameters, Tr
4
4
  import type { MacroProvider } from '@atlaskit/editor-common/provider-factory';
5
5
  import type { EditorAppearance, LongPressSelectionPluginOptions, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
6
6
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
7
+ import { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
7
8
  import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugin-context-identifier';
8
9
  import type { ApplyChangeHandler, ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
9
10
  import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
@@ -66,7 +67,8 @@ export type ExtensionPluginDependencies = [
66
67
  WidthPlugin,
67
68
  DecorationsPlugin,
68
69
  OptionalPlugin<ContextPanelPlugin>,
69
- OptionalPlugin<ContextIdentifierPlugin>
70
+ OptionalPlugin<ContextIdentifierPlugin>,
71
+ OptionalPlugin<ConnectivityPlugin>
70
72
  ];
71
73
  export type ExtensionPluginActions = {
72
74
  editSelectedExtension: () => boolean;
@@ -1,6 +1,7 @@
1
1
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
2
  import type { FloatingToolbarHandler, PublicPluginAPI } from '@atlaskit/editor-common/types';
3
3
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
4
+ import { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
4
5
  import type { ApplyChangeHandler, ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
5
6
  import type { DecorationsPlugin, HoverDecorationHandler } from '@atlaskit/editor-plugin-decorations';
6
7
  interface GetToolbarConfigProps {
@@ -8,7 +9,7 @@ interface GetToolbarConfigProps {
8
9
  hoverDecoration?: HoverDecorationHandler | undefined;
9
10
  applyChangeToContextPanel?: ApplyChangeHandler | undefined;
10
11
  editorAnalyticsAPI?: EditorAnalyticsAPI | undefined;
11
- extensionApi?: PublicPluginAPI<[ContextPanelPlugin, AnalyticsPlugin, DecorationsPlugin]> | undefined;
12
+ extensionApi?: PublicPluginAPI<[ContextPanelPlugin, AnalyticsPlugin, DecorationsPlugin, ConnectivityPlugin]> | undefined;
12
13
  }
13
14
  export declare const getToolbarConfig: ({ breakoutEnabled, hoverDecoration, applyChangeToContextPanel, editorAnalyticsAPI, extensionApi, }: GetToolbarConfigProps) => FloatingToolbarHandler;
14
15
  export {};
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
- import type { ExtensionManifest, FieldDefinition, OnSaveCallback, Parameters } from '@atlaskit/editor-common/extensions';
3
+ import type { ExtensionManifest, FieldDefinition, OnSaveCallback, OnSaveCallbackAsync, Parameters } from '@atlaskit/editor-common/extensions';
4
4
  import type { ExtractInjectionAPI, FeatureFlags } from '@atlaskit/editor-common/types';
5
5
  import type { ExtensionPlugin, RejectSave } from '../../extensionPluginType';
6
6
  declare const result: React.ForwardRefExoticComponent<Omit<Omit<{
@@ -11,12 +11,13 @@ declare const result: React.ForwardRefExoticComponent<Omit<Omit<{
11
11
  autoSaveReject?: RejectSave | undefined;
12
12
  showHeader?: boolean | undefined;
13
13
  closeOnEsc?: boolean | undefined;
14
- onChange: OnSaveCallback;
15
- onCancel: () => void;
14
+ onChange: OnSaveCallback | OnSaveCallbackAsync;
15
+ onCancel: () => void | Promise<void>;
16
16
  errorMessage: string | null;
17
17
  isLoading?: boolean | undefined;
18
18
  featureFlags?: FeatureFlags | undefined;
19
19
  api: ExtractInjectionAPI<ExtensionPlugin> | undefined;
20
20
  usingObjectSidebarPanel?: boolean | undefined;
21
+ disableFields?: boolean | undefined;
21
22
  }, keyof WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "ref"> & React.RefAttributes<any>>;
22
23
  export default result;
@@ -14,8 +14,8 @@ export type PublicProps = {
14
14
  closeOnEsc?: boolean;
15
15
  showHeader?: boolean;
16
16
  featureFlags?: FeatureFlags;
17
- onChange: (data: Parameters) => void;
18
- onCancel: () => void;
17
+ onChange: (data: Parameters) => void | Promise<void>;
18
+ onCancel: () => void | Promise<void>;
19
19
  api: ExtractInjectionAPI<ExtensionPlugin> | undefined;
20
20
  usingObjectSidebarPanel?: boolean;
21
21
  };
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import type { FieldComponentProps, FormContentProps } from './types';
3
3
  export declare function FieldComponent({ field, parameters, parentName, extensionManifest, firstVisibleFieldName, onFieldChange, featureFlags, }: FieldComponentProps): React.JSX.Element;
4
- export default function FormContent({ fields, parentName, parameters, extensionManifest, canRemoveFields, onClickRemove, onFieldChange, firstVisibleFieldName, contextIdentifierProvider, featureFlags, }: FormContentProps): React.JSX.Element;
4
+ export default function FormContent({ fields, parentName, parameters, extensionManifest, canRemoveFields, onClickRemove, onFieldChange, firstVisibleFieldName, contextIdentifierProvider, featureFlags, isDisabled, }: FormContentProps): React.JSX.Element;
@@ -1,7 +1,9 @@
1
+ /// <reference types="react" />
1
2
  /**
2
3
  * @jsxRuntime classic
3
4
  * @jsx jsx
4
5
  */
5
6
  import { jsx } from '@emotion/react';
6
- declare const LoadingState: () => jsx.JSX.Element;
7
+ import type { LoadingComponentProps } from 'react-loadable';
8
+ declare const LoadingState: (props: Partial<LoadingComponentProps>) => string | number | boolean | Iterable<import("react").ReactNode> | jsx.JSX.Element | null | undefined;
7
9
  export default LoadingState;
@@ -33,4 +33,5 @@ export interface FormContentProps {
33
33
  firstVisibleFieldName?: string;
34
34
  contextIdentifierProvider?: ContextIdentifierProvider;
35
35
  featureFlags?: FeatureFlags;
36
+ isDisabled?: boolean;
36
37
  }
@@ -4,6 +4,7 @@ import type { ExtensionAPI, ExtensionHandlers, ExtensionProvider, Parameters, Tr
4
4
  import type { MacroProvider } from '@atlaskit/editor-common/provider-factory';
5
5
  import type { EditorAppearance, LongPressSelectionPluginOptions, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
6
6
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
7
+ import { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
7
8
  import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugin-context-identifier';
8
9
  import type { ApplyChangeHandler, ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
9
10
  import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
@@ -66,7 +67,8 @@ export type ExtensionPluginDependencies = [
66
67
  WidthPlugin,
67
68
  DecorationsPlugin,
68
69
  OptionalPlugin<ContextPanelPlugin>,
69
- OptionalPlugin<ContextIdentifierPlugin>
70
+ OptionalPlugin<ContextIdentifierPlugin>,
71
+ OptionalPlugin<ConnectivityPlugin>
70
72
  ];
71
73
  export type ExtensionPluginActions = {
72
74
  editSelectedExtension: () => boolean;
@@ -1,6 +1,7 @@
1
1
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
2
  import type { FloatingToolbarHandler, PublicPluginAPI } from '@atlaskit/editor-common/types';
3
3
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
4
+ import { ConnectivityPlugin } from '@atlaskit/editor-plugin-connectivity';
4
5
  import type { ApplyChangeHandler, ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
5
6
  import type { DecorationsPlugin, HoverDecorationHandler } from '@atlaskit/editor-plugin-decorations';
6
7
  interface GetToolbarConfigProps {
@@ -11,7 +12,8 @@ interface GetToolbarConfigProps {
11
12
  extensionApi?: PublicPluginAPI<[
12
13
  ContextPanelPlugin,
13
14
  AnalyticsPlugin,
14
- DecorationsPlugin
15
+ DecorationsPlugin,
16
+ ConnectivityPlugin
15
17
  ]> | undefined;
16
18
  }
17
19
  export declare const getToolbarConfig: ({ breakoutEnabled, hoverDecoration, applyChangeToContextPanel, editorAnalyticsAPI, extensionApi, }: GetToolbarConfigProps) => FloatingToolbarHandler;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
3
- import type { ExtensionManifest, FieldDefinition, OnSaveCallback, Parameters } from '@atlaskit/editor-common/extensions';
3
+ import type { ExtensionManifest, FieldDefinition, OnSaveCallback, OnSaveCallbackAsync, Parameters } from '@atlaskit/editor-common/extensions';
4
4
  import type { ExtractInjectionAPI, FeatureFlags } from '@atlaskit/editor-common/types';
5
5
  import type { ExtensionPlugin, RejectSave } from '../../extensionPluginType';
6
6
  declare const result: React.ForwardRefExoticComponent<Omit<Omit<{
@@ -11,12 +11,13 @@ declare const result: React.ForwardRefExoticComponent<Omit<Omit<{
11
11
  autoSaveReject?: RejectSave | undefined;
12
12
  showHeader?: boolean | undefined;
13
13
  closeOnEsc?: boolean | undefined;
14
- onChange: OnSaveCallback;
15
- onCancel: () => void;
14
+ onChange: OnSaveCallback | OnSaveCallbackAsync;
15
+ onCancel: () => void | Promise<void>;
16
16
  errorMessage: string | null;
17
17
  isLoading?: boolean | undefined;
18
18
  featureFlags?: FeatureFlags | undefined;
19
19
  api: ExtractInjectionAPI<ExtensionPlugin> | undefined;
20
20
  usingObjectSidebarPanel?: boolean | undefined;
21
+ disableFields?: boolean | undefined;
21
22
  }, keyof WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "ref"> & React.RefAttributes<any>>;
22
23
  export default result;
@@ -14,8 +14,8 @@ export type PublicProps = {
14
14
  closeOnEsc?: boolean;
15
15
  showHeader?: boolean;
16
16
  featureFlags?: FeatureFlags;
17
- onChange: (data: Parameters) => void;
18
- onCancel: () => void;
17
+ onChange: (data: Parameters) => void | Promise<void>;
18
+ onCancel: () => void | Promise<void>;
19
19
  api: ExtractInjectionAPI<ExtensionPlugin> | undefined;
20
20
  usingObjectSidebarPanel?: boolean;
21
21
  };
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import type { FieldComponentProps, FormContentProps } from './types';
3
3
  export declare function FieldComponent({ field, parameters, parentName, extensionManifest, firstVisibleFieldName, onFieldChange, featureFlags, }: FieldComponentProps): React.JSX.Element;
4
- export default function FormContent({ fields, parentName, parameters, extensionManifest, canRemoveFields, onClickRemove, onFieldChange, firstVisibleFieldName, contextIdentifierProvider, featureFlags, }: FormContentProps): React.JSX.Element;
4
+ export default function FormContent({ fields, parentName, parameters, extensionManifest, canRemoveFields, onClickRemove, onFieldChange, firstVisibleFieldName, contextIdentifierProvider, featureFlags, isDisabled, }: FormContentProps): React.JSX.Element;
@@ -1,7 +1,9 @@
1
+ /// <reference types="react" />
1
2
  /**
2
3
  * @jsxRuntime classic
3
4
  * @jsx jsx
4
5
  */
5
6
  import { jsx } from '@emotion/react';
6
- declare const LoadingState: () => jsx.JSX.Element;
7
+ import type { LoadingComponentProps } from 'react-loadable';
8
+ declare const LoadingState: (props: Partial<LoadingComponentProps>) => string | number | boolean | Iterable<import("react").ReactNode> | jsx.JSX.Element | null | undefined;
7
9
  export default LoadingState;
@@ -36,4 +36,5 @@ export interface FormContentProps {
36
36
  firstVisibleFieldName?: string;
37
37
  contextIdentifierProvider?: ContextIdentifierProvider;
38
38
  featureFlags?: FeatureFlags;
39
+ isDisabled?: boolean;
39
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-extension",
3
- "version": "5.2.5",
3
+ "version": "5.2.6",
4
4
  "description": "editor-plugin-extension plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -30,11 +30,12 @@
30
30
  "@atlaskit/analytics-next": "^11.0.0",
31
31
  "@atlaskit/avatar": "^25.0.0",
32
32
  "@atlaskit/button": "^23.0.0",
33
- "@atlaskit/checkbox": "^17.0.0",
33
+ "@atlaskit/checkbox": "^17.1.0",
34
34
  "@atlaskit/datetime-picker": "^17.0.0",
35
- "@atlaskit/editor-common": "^103.12.0",
35
+ "@atlaskit/editor-common": "^103.15.0",
36
36
  "@atlaskit/editor-json-transformer": "^8.24.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^2.2.0",
38
+ "@atlaskit/editor-plugin-connectivity": "^2.0.0",
38
39
  "@atlaskit/editor-plugin-context-identifier": "^2.1.0",
39
40
  "@atlaskit/editor-plugin-context-panel": "^4.0.0",
40
41
  "@atlaskit/editor-plugin-decorations": "^2.0.0",
@@ -49,16 +50,16 @@
49
50
  "@atlaskit/icon": "^25.6.0",
50
51
  "@atlaskit/platform-feature-flags": "^1.1.0",
51
52
  "@atlaskit/primitives": "^14.4.0",
52
- "@atlaskit/radio": "^8.0.0",
53
+ "@atlaskit/radio": "^8.1.0",
53
54
  "@atlaskit/section-message": "^8.2.0",
54
- "@atlaskit/select": "^20.3.0",
55
+ "@atlaskit/select": "^20.4.0",
55
56
  "@atlaskit/smart-user-picker": "^8.0.0",
56
57
  "@atlaskit/spinner": "^18.0.0",
57
58
  "@atlaskit/tabs": "^18.0.0",
58
59
  "@atlaskit/textarea": "^8.0.0",
59
60
  "@atlaskit/textfield": "^8.0.0",
60
61
  "@atlaskit/theme": "^18.0.0",
61
- "@atlaskit/tmp-editor-statsig": "^4.12.0",
62
+ "@atlaskit/tmp-editor-statsig": "^4.13.0",
62
63
  "@atlaskit/toggle": "^15.0.0",
63
64
  "@atlaskit/tokens": "^4.8.0",
64
65
  "@atlaskit/tooltip": "^20.0.0",