@atlaskit/editor-plugin-extension 13.5.7 → 13.5.9

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 (29) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/editor-actions/actions.js +16 -16
  3. package/dist/cjs/pm-plugins/macro/actions.js +21 -21
  4. package/dist/cjs/pm-plugins/main.js +22 -22
  5. package/dist/cjs/pm-plugins/toolbar.js +15 -13
  6. package/dist/cjs/pm-plugins/update-edit-button.js +16 -16
  7. package/dist/cjs/pm-plugins/utils.js +36 -36
  8. package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +30 -30
  9. package/dist/cjs/ui/ConfigPanel/Fields/CustomSelect.js +17 -17
  10. package/dist/cjs/ui/ConfigPanel/Fields/UserSelect.js +20 -20
  11. package/dist/cjs/ui/ConfigPanel/FormErrorBoundary.js +7 -7
  12. package/dist/cjs/ui/ConfigPanel/transformers.js +108 -107
  13. package/dist/cjs/ui/context-panel.js +34 -33
  14. package/dist/cjs/ui/useConfigPanelPluginHook.js +25 -25
  15. package/dist/es2019/pm-plugins/toolbar.js +10 -7
  16. package/dist/esm/editor-actions/actions.js +16 -16
  17. package/dist/esm/pm-plugins/macro/actions.js +21 -21
  18. package/dist/esm/pm-plugins/main.js +22 -22
  19. package/dist/esm/pm-plugins/toolbar.js +15 -13
  20. package/dist/esm/pm-plugins/update-edit-button.js +16 -16
  21. package/dist/esm/pm-plugins/utils.js +36 -36
  22. package/dist/esm/ui/ConfigPanel/ConfigPanel.js +29 -29
  23. package/dist/esm/ui/ConfigPanel/Fields/CustomSelect.js +16 -16
  24. package/dist/esm/ui/ConfigPanel/Fields/UserSelect.js +19 -19
  25. package/dist/esm/ui/ConfigPanel/FormErrorBoundary.js +7 -7
  26. package/dist/esm/ui/ConfigPanel/transformers.js +108 -107
  27. package/dist/esm/ui/context-panel.js +34 -33
  28. package/dist/esm/ui/useConfigPanelPluginHook.js +24 -24
  29. package/package.json +7 -7
@@ -184,13 +184,13 @@ var ConfigPanel = /*#__PURE__*/function (_React$Component) {
184
184
  });
185
185
  _defineProperty(_this, "handleSubmit", /*#__PURE__*/function () {
186
186
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(formData) {
187
- var _this$props, fields, extensionManifest, onChange, autoSaveReject, serializedData;
188
- return _regeneratorRuntime.wrap(function _callee$(_context) {
187
+ var _this$props, fields, extensionManifest, onChange, autoSaveReject, serializedData, _t;
188
+ return _regeneratorRuntime.wrap(function (_context) {
189
189
  while (1) switch (_context.prev = _context.next) {
190
190
  case 0:
191
191
  _this$props = _this.props, fields = _this$props.fields, extensionManifest = _this$props.extensionManifest, onChange = _this$props.onChange, autoSaveReject = _this$props.autoSaveReject;
192
192
  if (!(!extensionManifest || !fields)) {
193
- _context.next = 4;
193
+ _context.next = 1;
194
194
  break;
195
195
  }
196
196
  if (!extensionManifest) {
@@ -199,39 +199,39 @@ var ConfigPanel = /*#__PURE__*/function (_React$Component) {
199
199
  autoSaveReject === null || autoSaveReject === void 0 || autoSaveReject(new Error('Config fields not loaded'));
200
200
  }
201
201
  return _context.abrupt("return");
202
- case 4:
203
- _context.prev = 4;
204
- _context.next = 7;
202
+ case 1:
203
+ _context.prev = 1;
204
+ _context.next = 2;
205
205
  return serialize(extensionManifest, _this.backfillTabFormData(fields, formData, _this.state.currentParameters), fields);
206
- case 7:
206
+ case 2:
207
207
  serializedData = _context.sent;
208
208
  if (!editorExperiment('platform_editor_offline_editing_web', true, {
209
209
  exposure: true
210
210
  })) {
211
- _context.next = 13;
211
+ _context.next = 4;
212
212
  break;
213
213
  }
214
- _context.next = 11;
214
+ _context.next = 3;
215
215
  return onChange(serializedData);
216
- case 11:
217
- _context.next = 14;
216
+ case 3:
217
+ _context.next = 5;
218
218
  break;
219
- case 13:
219
+ case 4:
220
220
  onChange(serializedData);
221
- case 14:
222
- _context.next = 20;
221
+ case 5:
222
+ _context.next = 7;
223
223
  break;
224
- case 16:
225
- _context.prev = 16;
226
- _context.t0 = _context["catch"](4);
227
- autoSaveReject === null || autoSaveReject === void 0 || autoSaveReject(_context.t0);
224
+ case 6:
225
+ _context.prev = 6;
226
+ _t = _context["catch"](1);
227
+ autoSaveReject === null || autoSaveReject === void 0 || autoSaveReject(_t);
228
228
  // eslint-disable-next-line no-console
229
- console.error("Error serializing parameters", _context.t0);
230
- case 20:
229
+ console.error("Error serializing parameters", _t);
230
+ case 7:
231
231
  case "end":
232
232
  return _context.stop();
233
233
  }
234
- }, _callee, null, [[4, 16]]);
234
+ }, _callee, null, [[1, 6]]);
235
235
  }));
236
236
  return function (_x) {
237
237
  return _ref3.apply(this, arguments);
@@ -240,18 +240,18 @@ var ConfigPanel = /*#__PURE__*/function (_React$Component) {
240
240
  _defineProperty(_this, "parseParameters", /*#__PURE__*/function () {
241
241
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(fields, parameters) {
242
242
  var extensionManifest, currentParameters;
243
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
243
+ return _regeneratorRuntime.wrap(function (_context2) {
244
244
  while (1) switch (_context2.prev = _context2.next) {
245
245
  case 0:
246
246
  extensionManifest = _this.props.extensionManifest;
247
247
  if (!(!extensionManifest || !fields || fields.length === 0)) {
248
- _context2.next = 3;
248
+ _context2.next = 1;
249
249
  break;
250
250
  }
251
251
  return _context2.abrupt("return");
252
- case 3:
252
+ case 1:
253
253
  if (!(typeof parameters === 'undefined')) {
254
- _context2.next = 6;
254
+ _context2.next = 2;
255
255
  break;
256
256
  }
257
257
  _this.setState({
@@ -259,16 +259,16 @@ var ConfigPanel = /*#__PURE__*/function (_React$Component) {
259
259
  hasParsedParameters: true
260
260
  });
261
261
  return _context2.abrupt("return");
262
- case 6:
263
- _context2.next = 8;
262
+ case 2:
263
+ _context2.next = 3;
264
264
  return deserialize(extensionManifest, parameters, fields);
265
- case 8:
265
+ case 3:
266
266
  currentParameters = _context2.sent;
267
267
  _this.setState({
268
268
  currentParameters: currentParameters,
269
269
  hasParsedParameters: true
270
270
  });
271
- case 10:
271
+ case 4:
272
272
  case "end":
273
273
  return _context2.stop();
274
274
  }
@@ -60,35 +60,35 @@ function CustomSelect(_ref2) {
60
60
  }
61
61
  function _fetchResolver() {
62
62
  _fetchResolver = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
63
- var _resolver, _options;
64
- return _regeneratorRuntime.wrap(function _callee$(_context) {
63
+ var _resolver, _options, _t;
64
+ return _regeneratorRuntime.wrap(function (_context) {
65
65
  while (1) switch (_context.prev = _context.next) {
66
66
  case 0:
67
67
  setLoading(true);
68
68
  _context.prev = 1;
69
69
  _resolver = getCustomFieldResolver(extensionManifest, field.options.resolver);
70
70
  if (!cancel) {
71
- _context.next = 5;
71
+ _context.next = 2;
72
72
  break;
73
73
  }
74
74
  return _context.abrupt("return");
75
- case 5:
75
+ case 2:
76
76
  setResolver(function () {
77
77
  return _resolver;
78
78
  });
79
79
 
80
80
  // fetch the default values
81
- _context.next = 8;
81
+ _context.next = 3;
82
82
  return _resolver(undefined, fieldDefaultValue, parameters);
83
- case 8:
83
+ case 3:
84
84
  _options = _context.sent;
85
85
  setDefaultOptions(_options);
86
86
  if (!cancel) {
87
- _context.next = 12;
87
+ _context.next = 4;
88
88
  break;
89
89
  }
90
90
  return _context.abrupt("return");
91
- case 12:
91
+ case 4:
92
92
  // filter returned values to match the defaultValue
93
93
  if (fieldDefaultValue && isMultiple) {
94
94
  setDefaultValue(_options.filter(function (option) {
@@ -100,20 +100,20 @@ function CustomSelect(_ref2) {
100
100
  return fieldDefaultValue === option.value;
101
101
  }));
102
102
  }
103
- _context.next = 19;
103
+ _context.next = 6;
104
104
  break;
105
- case 16:
106
- _context.prev = 16;
107
- _context.t0 = _context["catch"](1);
105
+ case 5:
106
+ _context.prev = 5;
107
+ _t = _context["catch"](1);
108
108
  // eslint-disable-next-line no-console
109
- console.error(_context.t0);
110
- case 19:
109
+ console.error(_t);
110
+ case 6:
111
111
  setLoading(false);
112
- case 20:
112
+ case 7:
113
113
  case "end":
114
114
  return _context.stop();
115
115
  }
116
- }, _callee, null, [[1, 16]]);
116
+ }, _callee, null, [[1, 5]]);
117
117
  }));
118
118
  return _fetchResolver.apply(this, arguments);
119
119
  }
@@ -98,10 +98,10 @@ function SafeSmartUserPicker(_ref) {
98
98
  function _hydrate() {
99
99
  _hydrate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
100
100
  var hydrated;
101
- return _regeneratorRuntime.wrap(function _callee$(_context) {
101
+ return _regeneratorRuntime.wrap(function (_context) {
102
102
  while (1) switch (_context.prev = _context.next) {
103
103
  case 0:
104
- _context.next = 2;
104
+ _context.next = 1;
105
105
  return hydrateDefaultValues(undefined,
106
106
  // no need to override baseUrl
107
107
  makeCompat(safeValue), productKey, undefined,
@@ -109,16 +109,16 @@ function SafeSmartUserPicker(_ref) {
109
109
  {
110
110
  tenantId: siteId
111
111
  });
112
- case 2:
112
+ case 1:
113
113
  hydrated = _context.sent;
114
114
  if (!(cancel || !isOptionData(hydrated))) {
115
- _context.next = 5;
115
+ _context.next = 2;
116
116
  break;
117
117
  }
118
118
  return _context.abrupt("return");
119
- case 5:
119
+ case 2:
120
120
  setUnsafeValue(hydrated);
121
- case 6:
121
+ case 3:
122
122
  case "end":
123
123
  return _context.stop();
124
124
  }
@@ -185,34 +185,34 @@ export default function UserSelect(_ref2) {
185
185
  }
186
186
  function _fetchContext() {
187
187
  _fetchContext = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
188
- var _context2;
189
- return _regeneratorRuntime.wrap(function _callee2$(_context3) {
188
+ var _context2, _t;
189
+ return _regeneratorRuntime.wrap(function (_context3) {
190
190
  while (1) switch (_context3.prev = _context3.next) {
191
191
  case 0:
192
192
  _context3.prev = 0;
193
- _context3.next = 3;
193
+ _context3.next = 1;
194
194
  return getUserFieldContextProvider(extensionManifest, field.options.provider)();
195
- case 3:
195
+ case 1:
196
196
  _context2 = _context3.sent;
197
197
  if (!cancel) {
198
- _context3.next = 6;
198
+ _context3.next = 2;
199
199
  break;
200
200
  }
201
201
  return _context3.abrupt("return");
202
- case 6:
202
+ case 2:
203
203
  setContext(_context2);
204
- _context3.next = 12;
204
+ _context3.next = 4;
205
205
  break;
206
- case 9:
207
- _context3.prev = 9;
208
- _context3.t0 = _context3["catch"](0);
206
+ case 3:
207
+ _context3.prev = 3;
208
+ _t = _context3["catch"](0);
209
209
  // eslint-disable-next-line no-console
210
- console.error(_context3.t0);
211
- case 12:
210
+ console.error(_t);
211
+ case 4:
212
212
  case "end":
213
213
  return _context3.stop();
214
214
  }
215
- }, _callee2, null, [[0, 9]]);
215
+ }, _callee2, null, [[0, 3]]);
216
216
  }));
217
217
  return _fetchContext.apply(this, arguments);
218
218
  }
@@ -30,26 +30,26 @@ var FormErrorBoundaryInner = /*#__PURE__*/function (_React$Component) {
30
30
  });
31
31
  _defineProperty(_this, "getProductName", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
32
32
  var contextIdentifierProvider, context;
33
- return _regeneratorRuntime.wrap(function _callee$(_context) {
33
+ return _regeneratorRuntime.wrap(function (_context) {
34
34
  while (1) switch (_context.prev = _context.next) {
35
35
  case 0:
36
36
  contextIdentifierProvider = _this.props.contextIdentifierProvider;
37
37
  if (!contextIdentifierProvider) {
38
- _context.next = 7;
38
+ _context.next = 2;
39
39
  break;
40
40
  }
41
- _context.next = 4;
41
+ _context.next = 1;
42
42
  return contextIdentifierProvider;
43
- case 4:
43
+ case 1:
44
44
  context = _context.sent;
45
45
  if (!context.product) {
46
- _context.next = 7;
46
+ _context.next = 2;
47
47
  break;
48
48
  }
49
49
  return _context.abrupt("return", context.product);
50
- case 7:
50
+ case 2:
51
51
  return _context.abrupt("return", 'atlaskit');
52
- case 8:
52
+ case 3:
53
53
  case "end":
54
54
  return _context.stop();
55
55
  }