@atlaskit/editor-plugin-extension 13.5.8 → 13.5.10
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 +14 -0
- package/dist/cjs/editor-actions/actions.js +16 -16
- package/dist/cjs/pm-plugins/macro/actions.js +21 -21
- package/dist/cjs/pm-plugins/main.js +22 -22
- package/dist/cjs/pm-plugins/toolbar.js +15 -13
- package/dist/cjs/pm-plugins/update-edit-button.js +16 -16
- package/dist/cjs/pm-plugins/utils.js +36 -36
- package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +30 -30
- package/dist/cjs/ui/ConfigPanel/Fields/CustomSelect.js +17 -17
- package/dist/cjs/ui/ConfigPanel/Fields/UserSelect.js +20 -20
- package/dist/cjs/ui/ConfigPanel/FormErrorBoundary.js +7 -7
- package/dist/cjs/ui/ConfigPanel/transformers.js +108 -107
- package/dist/cjs/ui/context-panel.js +34 -33
- package/dist/cjs/ui/useConfigPanelPluginHook.js +25 -25
- package/dist/es2019/pm-plugins/toolbar.js +10 -7
- package/dist/esm/editor-actions/actions.js +16 -16
- package/dist/esm/pm-plugins/macro/actions.js +21 -21
- package/dist/esm/pm-plugins/main.js +22 -22
- package/dist/esm/pm-plugins/toolbar.js +15 -13
- package/dist/esm/pm-plugins/update-edit-button.js +16 -16
- package/dist/esm/pm-plugins/utils.js +36 -36
- package/dist/esm/ui/ConfigPanel/ConfigPanel.js +29 -29
- package/dist/esm/ui/ConfigPanel/Fields/CustomSelect.js +16 -16
- package/dist/esm/ui/ConfigPanel/Fields/UserSelect.js +19 -19
- package/dist/esm/ui/ConfigPanel/FormErrorBoundary.js +7 -7
- package/dist/esm/ui/ConfigPanel/transformers.js +108 -107
- package/dist/esm/ui/context-panel.js +34 -33
- package/dist/esm/ui/useConfigPanelPluginHook.js +24 -24
- package/package.json +8 -8
|
@@ -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
|
|
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 =
|
|
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
|
|
203
|
-
_context.prev =
|
|
204
|
-
_context.next =
|
|
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
|
|
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 =
|
|
211
|
+
_context.next = 4;
|
|
212
212
|
break;
|
|
213
213
|
}
|
|
214
|
-
_context.next =
|
|
214
|
+
_context.next = 3;
|
|
215
215
|
return onChange(serializedData);
|
|
216
|
-
case
|
|
217
|
-
_context.next =
|
|
216
|
+
case 3:
|
|
217
|
+
_context.next = 5;
|
|
218
218
|
break;
|
|
219
|
-
case
|
|
219
|
+
case 4:
|
|
220
220
|
onChange(serializedData);
|
|
221
|
-
case
|
|
222
|
-
_context.next =
|
|
221
|
+
case 5:
|
|
222
|
+
_context.next = 7;
|
|
223
223
|
break;
|
|
224
|
-
case
|
|
225
|
-
_context.prev =
|
|
226
|
-
|
|
227
|
-
autoSaveReject === null || autoSaveReject === void 0 || autoSaveReject(
|
|
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",
|
|
230
|
-
case
|
|
229
|
+
console.error("Error serializing parameters", _t);
|
|
230
|
+
case 7:
|
|
231
231
|
case "end":
|
|
232
232
|
return _context.stop();
|
|
233
233
|
}
|
|
234
|
-
}, _callee, null, [[
|
|
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
|
|
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 =
|
|
248
|
+
_context2.next = 1;
|
|
249
249
|
break;
|
|
250
250
|
}
|
|
251
251
|
return _context2.abrupt("return");
|
|
252
|
-
case
|
|
252
|
+
case 1:
|
|
253
253
|
if (!(typeof parameters === 'undefined')) {
|
|
254
|
-
_context2.next =
|
|
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
|
|
263
|
-
_context2.next =
|
|
262
|
+
case 2:
|
|
263
|
+
_context2.next = 3;
|
|
264
264
|
return deserialize(extensionManifest, parameters, fields);
|
|
265
|
-
case
|
|
265
|
+
case 3:
|
|
266
266
|
currentParameters = _context2.sent;
|
|
267
267
|
_this.setState({
|
|
268
268
|
currentParameters: currentParameters,
|
|
269
269
|
hasParsedParameters: true
|
|
270
270
|
});
|
|
271
|
-
case
|
|
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
|
|
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 =
|
|
71
|
+
_context.next = 2;
|
|
72
72
|
break;
|
|
73
73
|
}
|
|
74
74
|
return _context.abrupt("return");
|
|
75
|
-
case
|
|
75
|
+
case 2:
|
|
76
76
|
setResolver(function () {
|
|
77
77
|
return _resolver;
|
|
78
78
|
});
|
|
79
79
|
|
|
80
80
|
// fetch the default values
|
|
81
|
-
_context.next =
|
|
81
|
+
_context.next = 3;
|
|
82
82
|
return _resolver(undefined, fieldDefaultValue, parameters);
|
|
83
|
-
case
|
|
83
|
+
case 3:
|
|
84
84
|
_options = _context.sent;
|
|
85
85
|
setDefaultOptions(_options);
|
|
86
86
|
if (!cancel) {
|
|
87
|
-
_context.next =
|
|
87
|
+
_context.next = 4;
|
|
88
88
|
break;
|
|
89
89
|
}
|
|
90
90
|
return _context.abrupt("return");
|
|
91
|
-
case
|
|
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 =
|
|
103
|
+
_context.next = 6;
|
|
104
104
|
break;
|
|
105
|
-
case
|
|
106
|
-
_context.prev =
|
|
107
|
-
|
|
105
|
+
case 5:
|
|
106
|
+
_context.prev = 5;
|
|
107
|
+
_t = _context["catch"](1);
|
|
108
108
|
// eslint-disable-next-line no-console
|
|
109
|
-
console.error(
|
|
110
|
-
case
|
|
109
|
+
console.error(_t);
|
|
110
|
+
case 6:
|
|
111
111
|
setLoading(false);
|
|
112
|
-
case
|
|
112
|
+
case 7:
|
|
113
113
|
case "end":
|
|
114
114
|
return _context.stop();
|
|
115
115
|
}
|
|
116
|
-
}, _callee, null, [[1,
|
|
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
|
|
101
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
102
102
|
while (1) switch (_context.prev = _context.next) {
|
|
103
103
|
case 0:
|
|
104
|
-
_context.next =
|
|
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
|
|
112
|
+
case 1:
|
|
113
113
|
hydrated = _context.sent;
|
|
114
114
|
if (!(cancel || !isOptionData(hydrated))) {
|
|
115
|
-
_context.next =
|
|
115
|
+
_context.next = 2;
|
|
116
116
|
break;
|
|
117
117
|
}
|
|
118
118
|
return _context.abrupt("return");
|
|
119
|
-
case
|
|
119
|
+
case 2:
|
|
120
120
|
setUnsafeValue(hydrated);
|
|
121
|
-
case
|
|
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
|
|
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 =
|
|
193
|
+
_context3.next = 1;
|
|
194
194
|
return getUserFieldContextProvider(extensionManifest, field.options.provider)();
|
|
195
|
-
case
|
|
195
|
+
case 1:
|
|
196
196
|
_context2 = _context3.sent;
|
|
197
197
|
if (!cancel) {
|
|
198
|
-
_context3.next =
|
|
198
|
+
_context3.next = 2;
|
|
199
199
|
break;
|
|
200
200
|
}
|
|
201
201
|
return _context3.abrupt("return");
|
|
202
|
-
case
|
|
202
|
+
case 2:
|
|
203
203
|
setContext(_context2);
|
|
204
|
-
_context3.next =
|
|
204
|
+
_context3.next = 4;
|
|
205
205
|
break;
|
|
206
|
-
case
|
|
207
|
-
_context3.prev =
|
|
208
|
-
|
|
206
|
+
case 3:
|
|
207
|
+
_context3.prev = 3;
|
|
208
|
+
_t = _context3["catch"](0);
|
|
209
209
|
// eslint-disable-next-line no-console
|
|
210
|
-
console.error(
|
|
211
|
-
case
|
|
210
|
+
console.error(_t);
|
|
211
|
+
case 4:
|
|
212
212
|
case "end":
|
|
213
213
|
return _context3.stop();
|
|
214
214
|
}
|
|
215
|
-
}, _callee2, null, [[0,
|
|
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
|
|
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 =
|
|
38
|
+
_context.next = 2;
|
|
39
39
|
break;
|
|
40
40
|
}
|
|
41
|
-
_context.next =
|
|
41
|
+
_context.next = 1;
|
|
42
42
|
return contextIdentifierProvider;
|
|
43
|
-
case
|
|
43
|
+
case 1:
|
|
44
44
|
context = _context.sent;
|
|
45
45
|
if (!context.product) {
|
|
46
|
-
_context.next =
|
|
46
|
+
_context.next = 2;
|
|
47
47
|
break;
|
|
48
48
|
}
|
|
49
49
|
return _context.abrupt("return", context.product);
|
|
50
|
-
case
|
|
50
|
+
case 2:
|
|
51
51
|
return _context.abrupt("return", 'atlaskit');
|
|
52
|
-
case
|
|
52
|
+
case 3:
|
|
53
53
|
case "end":
|
|
54
54
|
return _context.stop();
|
|
55
55
|
}
|