@atlaskit/editor-plugin-extension 10.1.17 → 11.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.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/pm-plugins/toolbar.js +1 -1
- package/dist/cjs/ui/ConfigPanel/Fields/CustomSelect.js +13 -16
- package/dist/cjs/ui/ConfigPanel/Fields/UserSelect.js +10 -14
- package/dist/cjs/ui/ConfigPanel/transformers.js +26 -32
- package/dist/es2019/pm-plugins/toolbar.js +2 -2
- package/dist/es2019/ui/ConfigPanel/Fields/CustomSelect.js +1 -1
- package/dist/es2019/ui/ConfigPanel/Fields/UserSelect.js +1 -1
- package/dist/es2019/ui/ConfigPanel/transformers.js +2 -2
- package/dist/esm/pm-plugins/toolbar.js +2 -2
- package/dist/esm/ui/ConfigPanel/Fields/CustomSelect.js +13 -16
- package/dist/esm/ui/ConfigPanel/Fields/UserSelect.js +10 -14
- package/dist/esm/ui/ConfigPanel/transformers.js +26 -32
- package/package.json +14 -12
package/CHANGELOG.md
CHANGED
|
@@ -354,7 +354,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(_ref
|
|
|
354
354
|
|
|
355
355
|
// If this is a native-embed extension, skip providing a toolbar config to allow
|
|
356
356
|
// the native-embed plugin to provide a custom toolbar config.
|
|
357
|
-
if ((extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node.attrs.extensionType) === _extensions.NATIVE_EMBED_EXTENSION_TYPE) {
|
|
357
|
+
if ((extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node.attrs.extensionType) === _extensions.NATIVE_EMBED_EXTENSION_TYPE && extensionObj !== null && extensionObj !== void 0 && extensionObj.node.attrs.extensionKey.includes(_extensions.NATIVE_EMBED_EXTENSION_KEY)) {
|
|
358
358
|
return;
|
|
359
359
|
}
|
|
360
360
|
|
|
@@ -75,32 +75,29 @@ function CustomSelect(_ref2) {
|
|
|
75
75
|
case 0:
|
|
76
76
|
setLoading(true);
|
|
77
77
|
_context.prev = 1;
|
|
78
|
-
|
|
79
|
-
return (0, _extensions.getCustomFieldResolver)(extensionManifest, field.options.resolver);
|
|
80
|
-
case 4:
|
|
81
|
-
_resolver = _context.sent;
|
|
78
|
+
_resolver = (0, _extensions.getCustomFieldResolver)(extensionManifest, field.options.resolver);
|
|
82
79
|
if (!cancel) {
|
|
83
|
-
_context.next =
|
|
80
|
+
_context.next = 5;
|
|
84
81
|
break;
|
|
85
82
|
}
|
|
86
83
|
return _context.abrupt("return");
|
|
87
|
-
case
|
|
84
|
+
case 5:
|
|
88
85
|
setResolver(function () {
|
|
89
86
|
return _resolver;
|
|
90
87
|
});
|
|
91
88
|
|
|
92
89
|
// fetch the default values
|
|
93
|
-
_context.next =
|
|
90
|
+
_context.next = 8;
|
|
94
91
|
return _resolver(undefined, fieldDefaultValue, parameters);
|
|
95
|
-
case
|
|
92
|
+
case 8:
|
|
96
93
|
_options = _context.sent;
|
|
97
94
|
setDefaultOptions(_options);
|
|
98
95
|
if (!cancel) {
|
|
99
|
-
_context.next =
|
|
96
|
+
_context.next = 12;
|
|
100
97
|
break;
|
|
101
98
|
}
|
|
102
99
|
return _context.abrupt("return");
|
|
103
|
-
case
|
|
100
|
+
case 12:
|
|
104
101
|
// filter returned values to match the defaultValue
|
|
105
102
|
if (fieldDefaultValue && isMultiple) {
|
|
106
103
|
setDefaultValue(_options.filter(function (option) {
|
|
@@ -112,20 +109,20 @@ function CustomSelect(_ref2) {
|
|
|
112
109
|
return fieldDefaultValue === option.value;
|
|
113
110
|
}));
|
|
114
111
|
}
|
|
115
|
-
_context.next =
|
|
112
|
+
_context.next = 19;
|
|
116
113
|
break;
|
|
117
|
-
case
|
|
118
|
-
_context.prev =
|
|
114
|
+
case 16:
|
|
115
|
+
_context.prev = 16;
|
|
119
116
|
_context.t0 = _context["catch"](1);
|
|
120
117
|
// eslint-disable-next-line no-console
|
|
121
118
|
console.error(_context.t0);
|
|
122
|
-
case
|
|
119
|
+
case 19:
|
|
123
120
|
setLoading(false);
|
|
124
|
-
case
|
|
121
|
+
case 20:
|
|
125
122
|
case "end":
|
|
126
123
|
return _context.stop();
|
|
127
124
|
}
|
|
128
|
-
}, _callee, null, [[1,
|
|
125
|
+
}, _callee, null, [[1, 16]]);
|
|
129
126
|
}));
|
|
130
127
|
return _fetchResolver.apply(this, arguments);
|
|
131
128
|
}
|
|
@@ -200,32 +200,28 @@ function UserSelect(_ref2) {
|
|
|
200
200
|
case 0:
|
|
201
201
|
_context3.prev = 0;
|
|
202
202
|
_context3.next = 3;
|
|
203
|
-
return (0, _extensions.getUserFieldContextProvider)(extensionManifest, field.options.provider);
|
|
203
|
+
return (0, _extensions.getUserFieldContextProvider)(extensionManifest, field.options.provider)();
|
|
204
204
|
case 3:
|
|
205
|
-
_context3.t0 = _context3.sent;
|
|
206
|
-
_context3.next = 6;
|
|
207
|
-
return (0, _context3.t0)();
|
|
208
|
-
case 6:
|
|
209
205
|
_context2 = _context3.sent;
|
|
210
206
|
if (!cancel) {
|
|
211
|
-
_context3.next =
|
|
207
|
+
_context3.next = 6;
|
|
212
208
|
break;
|
|
213
209
|
}
|
|
214
210
|
return _context3.abrupt("return");
|
|
215
|
-
case
|
|
211
|
+
case 6:
|
|
216
212
|
setContext(_context2);
|
|
217
|
-
_context3.next =
|
|
213
|
+
_context3.next = 12;
|
|
218
214
|
break;
|
|
219
|
-
case
|
|
220
|
-
_context3.prev =
|
|
221
|
-
_context3.
|
|
215
|
+
case 9:
|
|
216
|
+
_context3.prev = 9;
|
|
217
|
+
_context3.t0 = _context3["catch"](0);
|
|
222
218
|
// eslint-disable-next-line no-console
|
|
223
|
-
console.error(_context3.
|
|
224
|
-
case
|
|
219
|
+
console.error(_context3.t0);
|
|
220
|
+
case 12:
|
|
225
221
|
case "end":
|
|
226
222
|
return _context3.stop();
|
|
227
223
|
}
|
|
228
|
-
}, _callee2, null, [[0,
|
|
224
|
+
}, _callee2, null, [[0, 9]]);
|
|
229
225
|
}));
|
|
230
226
|
return _fetchContext.apply(this, arguments);
|
|
231
227
|
}
|
|
@@ -194,44 +194,41 @@ var serializeFieldset = /*#__PURE__*/function () {
|
|
|
194
194
|
while (1) switch (_context3.prev = _context3.next) {
|
|
195
195
|
case 0:
|
|
196
196
|
_context3.prev = 0;
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
case 3:
|
|
200
|
-
fieldSerializer = _context3.sent;
|
|
201
|
-
_context3.next = 10;
|
|
197
|
+
fieldSerializer = (0, _extensions.getFieldSerializer)(manifest, field.options.transformer);
|
|
198
|
+
_context3.next = 8;
|
|
202
199
|
break;
|
|
203
|
-
case
|
|
204
|
-
_context3.prev =
|
|
200
|
+
case 4:
|
|
201
|
+
_context3.prev = 4;
|
|
205
202
|
_context3.t0 = _context3["catch"](0);
|
|
206
203
|
if (!(data[field.name] !== undefined)) {
|
|
207
|
-
_context3.next =
|
|
204
|
+
_context3.next = 8;
|
|
208
205
|
break;
|
|
209
206
|
}
|
|
210
207
|
throw _context3.t0;
|
|
211
|
-
case
|
|
208
|
+
case 8:
|
|
212
209
|
if (fieldSerializer) {
|
|
213
|
-
_context3.next =
|
|
210
|
+
_context3.next = 10;
|
|
214
211
|
break;
|
|
215
212
|
}
|
|
216
213
|
return _context3.abrupt("return");
|
|
217
|
-
case
|
|
214
|
+
case 10:
|
|
218
215
|
fieldsetFields = field.fields;
|
|
219
216
|
fieldParams = extract(data[field.name], field, {
|
|
220
217
|
useDefaultValue: true
|
|
221
218
|
}) || {};
|
|
222
|
-
_context3.next =
|
|
219
|
+
_context3.next = 14;
|
|
223
220
|
return serialize(manifest, fieldParams, fieldsetFields, {
|
|
224
221
|
depth: depth + 1,
|
|
225
222
|
parentType: 'fieldset'
|
|
226
223
|
});
|
|
227
|
-
case
|
|
224
|
+
case 14:
|
|
228
225
|
extracted = _context3.sent;
|
|
229
226
|
return _context3.abrupt("return", (0, _defineProperty2.default)({}, field.name, fieldSerializer(extracted)));
|
|
230
|
-
case
|
|
227
|
+
case 16:
|
|
231
228
|
case "end":
|
|
232
229
|
return _context3.stop();
|
|
233
230
|
}
|
|
234
|
-
}, _callee3, null, [[0,
|
|
231
|
+
}, _callee3, null, [[0, 4]]);
|
|
235
232
|
}));
|
|
236
233
|
return function serializeFieldset(_x5, _x6, _x7, _x8) {
|
|
237
234
|
return _ref3.apply(this, arguments);
|
|
@@ -527,38 +524,35 @@ var _deserialize = exports.deserialize = /*#__PURE__*/function () {
|
|
|
527
524
|
return _context8.abrupt("return", 0);
|
|
528
525
|
case 8:
|
|
529
526
|
if (!((0, _extensions.isFieldset)(field) && depth === 0)) {
|
|
530
|
-
_context8.next =
|
|
527
|
+
_context8.next = 22;
|
|
531
528
|
break;
|
|
532
529
|
}
|
|
533
|
-
|
|
534
|
-
return (0, _extensions.getFieldDeserializer)(manifest, field.options.transformer);
|
|
535
|
-
case 11:
|
|
536
|
-
fieldDeserializer = _context8.sent;
|
|
530
|
+
fieldDeserializer = (0, _extensions.getFieldDeserializer)(manifest, field.options.transformer);
|
|
537
531
|
if (!fieldDeserializer) {
|
|
538
|
-
_context8.next =
|
|
532
|
+
_context8.next = 22;
|
|
539
533
|
break;
|
|
540
534
|
}
|
|
541
|
-
_context8.prev =
|
|
535
|
+
_context8.prev = 11;
|
|
542
536
|
value = fieldDeserializer(value);
|
|
543
|
-
_context8.next =
|
|
537
|
+
_context8.next = 19;
|
|
544
538
|
break;
|
|
545
|
-
case
|
|
546
|
-
_context8.prev =
|
|
547
|
-
_context8.t0 = _context8["catch"](
|
|
539
|
+
case 15:
|
|
540
|
+
_context8.prev = 15;
|
|
541
|
+
_context8.t0 = _context8["catch"](11);
|
|
548
542
|
errors.push((0, _defineProperty2.default)({}, name, _context8.t0 instanceof Error ? _context8.t0.message : String(_context8.t0)));
|
|
549
543
|
return _context8.abrupt("return", 0);
|
|
550
|
-
case
|
|
551
|
-
_context8.next =
|
|
544
|
+
case 19:
|
|
545
|
+
_context8.next = 21;
|
|
552
546
|
return _deserialize(manifest, value, field.fields, depth + 1);
|
|
553
|
-
case
|
|
547
|
+
case 21:
|
|
554
548
|
value = _context8.sent;
|
|
555
|
-
case
|
|
549
|
+
case 22:
|
|
556
550
|
result.push((0, _defineProperty2.default)({}, name, value));
|
|
557
|
-
case
|
|
551
|
+
case 23:
|
|
558
552
|
case "end":
|
|
559
553
|
return _context8.stop();
|
|
560
554
|
}
|
|
561
|
-
}, _loop2, null, [[
|
|
555
|
+
}, _loop2, null, [[11, 15]]);
|
|
562
556
|
});
|
|
563
557
|
_iterator2.s();
|
|
564
558
|
case 9:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { INPUT_METHOD, ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
3
|
-
import { messages, NATIVE_EMBED_EXTENSION_TYPE } from '@atlaskit/editor-common/extensions';
|
|
3
|
+
import { messages, NATIVE_EMBED_EXTENSION_KEY, NATIVE_EMBED_EXTENSION_TYPE } from '@atlaskit/editor-common/extensions';
|
|
4
4
|
import commonMessages from '@atlaskit/editor-common/messages';
|
|
5
5
|
import { BODIED_EXT_MBE_MARGIN_TOP } from '@atlaskit/editor-common/styles';
|
|
6
6
|
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
@@ -359,7 +359,7 @@ export const getToolbarConfig = ({
|
|
|
359
359
|
|
|
360
360
|
// If this is a native-embed extension, skip providing a toolbar config to allow
|
|
361
361
|
// the native-embed plugin to provide a custom toolbar config.
|
|
362
|
-
if ((extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node.attrs.extensionType) === NATIVE_EMBED_EXTENSION_TYPE) {
|
|
362
|
+
if ((extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node.attrs.extensionType) === NATIVE_EMBED_EXTENSION_TYPE && extensionObj !== null && extensionObj !== void 0 && extensionObj.node.attrs.extensionKey.includes(NATIVE_EMBED_EXTENSION_KEY)) {
|
|
363
363
|
return;
|
|
364
364
|
}
|
|
365
365
|
|
|
@@ -49,7 +49,7 @@ function CustomSelect({
|
|
|
49
49
|
async function fetchResolver() {
|
|
50
50
|
setLoading(true);
|
|
51
51
|
try {
|
|
52
|
-
const resolver =
|
|
52
|
+
const resolver = getCustomFieldResolver(extensionManifest, field.options.resolver);
|
|
53
53
|
if (cancel) {
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
@@ -149,7 +149,7 @@ export default function UserSelect({
|
|
|
149
149
|
let cancel = false;
|
|
150
150
|
async function fetchContext() {
|
|
151
151
|
try {
|
|
152
|
-
const context = await
|
|
152
|
+
const context = await getUserFieldContextProvider(extensionManifest, field.options.provider)();
|
|
153
153
|
if (cancel) {
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
@@ -102,7 +102,7 @@ export const serialize = async (manifest, data, fields, options = {}) => {
|
|
|
102
102
|
const serializeFieldset = async (manifest, field, data, depth) => {
|
|
103
103
|
let fieldSerializer;
|
|
104
104
|
try {
|
|
105
|
-
fieldSerializer =
|
|
105
|
+
fieldSerializer = getFieldSerializer(manifest, field.options.transformer);
|
|
106
106
|
} catch (ex) {
|
|
107
107
|
// We only throw if there is data that may be lost
|
|
108
108
|
if (data[field.name] !== undefined) {
|
|
@@ -317,7 +317,7 @@ export const deserialize = async (manifest, data, fields, depth = 0) => {
|
|
|
317
317
|
// WARNING: don't recursively serialize, limit to depth < 1
|
|
318
318
|
// deserializable?
|
|
319
319
|
if (isFieldset(field) && depth === 0) {
|
|
320
|
-
const fieldDeserializer =
|
|
320
|
+
const fieldDeserializer = getFieldDeserializer(manifest, field.options.transformer);
|
|
321
321
|
if (fieldDeserializer) {
|
|
322
322
|
try {
|
|
323
323
|
value = fieldDeserializer(value);
|
|
@@ -4,7 +4,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
4
4
|
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; }
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { INPUT_METHOD, ACTION, ACTION_SUBJECT, EVENT_TYPE, ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
|
|
7
|
-
import { messages, NATIVE_EMBED_EXTENSION_TYPE } from '@atlaskit/editor-common/extensions';
|
|
7
|
+
import { messages, NATIVE_EMBED_EXTENSION_KEY, NATIVE_EMBED_EXTENSION_TYPE } from '@atlaskit/editor-common/extensions';
|
|
8
8
|
import commonMessages from '@atlaskit/editor-common/messages';
|
|
9
9
|
import { BODIED_EXT_MBE_MARGIN_TOP } from '@atlaskit/editor-common/styles';
|
|
10
10
|
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
@@ -348,7 +348,7 @@ export var getToolbarConfig = function getToolbarConfig(_ref2) {
|
|
|
348
348
|
|
|
349
349
|
// If this is a native-embed extension, skip providing a toolbar config to allow
|
|
350
350
|
// the native-embed plugin to provide a custom toolbar config.
|
|
351
|
-
if ((extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node.attrs.extensionType) === NATIVE_EMBED_EXTENSION_TYPE) {
|
|
351
|
+
if ((extensionObj === null || extensionObj === void 0 ? void 0 : extensionObj.node.attrs.extensionType) === NATIVE_EMBED_EXTENSION_TYPE && extensionObj !== null && extensionObj !== void 0 && extensionObj.node.attrs.extensionKey.includes(NATIVE_EMBED_EXTENSION_KEY)) {
|
|
352
352
|
return;
|
|
353
353
|
}
|
|
354
354
|
|
|
@@ -66,32 +66,29 @@ function CustomSelect(_ref2) {
|
|
|
66
66
|
case 0:
|
|
67
67
|
setLoading(true);
|
|
68
68
|
_context.prev = 1;
|
|
69
|
-
|
|
70
|
-
return getCustomFieldResolver(extensionManifest, field.options.resolver);
|
|
71
|
-
case 4:
|
|
72
|
-
_resolver = _context.sent;
|
|
69
|
+
_resolver = getCustomFieldResolver(extensionManifest, field.options.resolver);
|
|
73
70
|
if (!cancel) {
|
|
74
|
-
_context.next =
|
|
71
|
+
_context.next = 5;
|
|
75
72
|
break;
|
|
76
73
|
}
|
|
77
74
|
return _context.abrupt("return");
|
|
78
|
-
case
|
|
75
|
+
case 5:
|
|
79
76
|
setResolver(function () {
|
|
80
77
|
return _resolver;
|
|
81
78
|
});
|
|
82
79
|
|
|
83
80
|
// fetch the default values
|
|
84
|
-
_context.next =
|
|
81
|
+
_context.next = 8;
|
|
85
82
|
return _resolver(undefined, fieldDefaultValue, parameters);
|
|
86
|
-
case
|
|
83
|
+
case 8:
|
|
87
84
|
_options = _context.sent;
|
|
88
85
|
setDefaultOptions(_options);
|
|
89
86
|
if (!cancel) {
|
|
90
|
-
_context.next =
|
|
87
|
+
_context.next = 12;
|
|
91
88
|
break;
|
|
92
89
|
}
|
|
93
90
|
return _context.abrupt("return");
|
|
94
|
-
case
|
|
91
|
+
case 12:
|
|
95
92
|
// filter returned values to match the defaultValue
|
|
96
93
|
if (fieldDefaultValue && isMultiple) {
|
|
97
94
|
setDefaultValue(_options.filter(function (option) {
|
|
@@ -103,20 +100,20 @@ function CustomSelect(_ref2) {
|
|
|
103
100
|
return fieldDefaultValue === option.value;
|
|
104
101
|
}));
|
|
105
102
|
}
|
|
106
|
-
_context.next =
|
|
103
|
+
_context.next = 19;
|
|
107
104
|
break;
|
|
108
|
-
case
|
|
109
|
-
_context.prev =
|
|
105
|
+
case 16:
|
|
106
|
+
_context.prev = 16;
|
|
110
107
|
_context.t0 = _context["catch"](1);
|
|
111
108
|
// eslint-disable-next-line no-console
|
|
112
109
|
console.error(_context.t0);
|
|
113
|
-
case
|
|
110
|
+
case 19:
|
|
114
111
|
setLoading(false);
|
|
115
|
-
case
|
|
112
|
+
case 20:
|
|
116
113
|
case "end":
|
|
117
114
|
return _context.stop();
|
|
118
115
|
}
|
|
119
|
-
}, _callee, null, [[1,
|
|
116
|
+
}, _callee, null, [[1, 16]]);
|
|
120
117
|
}));
|
|
121
118
|
return _fetchResolver.apply(this, arguments);
|
|
122
119
|
}
|
|
@@ -191,32 +191,28 @@ export default function UserSelect(_ref2) {
|
|
|
191
191
|
case 0:
|
|
192
192
|
_context3.prev = 0;
|
|
193
193
|
_context3.next = 3;
|
|
194
|
-
return getUserFieldContextProvider(extensionManifest, field.options.provider);
|
|
194
|
+
return getUserFieldContextProvider(extensionManifest, field.options.provider)();
|
|
195
195
|
case 3:
|
|
196
|
-
_context3.t0 = _context3.sent;
|
|
197
|
-
_context3.next = 6;
|
|
198
|
-
return (0, _context3.t0)();
|
|
199
|
-
case 6:
|
|
200
196
|
_context2 = _context3.sent;
|
|
201
197
|
if (!cancel) {
|
|
202
|
-
_context3.next =
|
|
198
|
+
_context3.next = 6;
|
|
203
199
|
break;
|
|
204
200
|
}
|
|
205
201
|
return _context3.abrupt("return");
|
|
206
|
-
case
|
|
202
|
+
case 6:
|
|
207
203
|
setContext(_context2);
|
|
208
|
-
_context3.next =
|
|
204
|
+
_context3.next = 12;
|
|
209
205
|
break;
|
|
210
|
-
case
|
|
211
|
-
_context3.prev =
|
|
212
|
-
_context3.
|
|
206
|
+
case 9:
|
|
207
|
+
_context3.prev = 9;
|
|
208
|
+
_context3.t0 = _context3["catch"](0);
|
|
213
209
|
// eslint-disable-next-line no-console
|
|
214
|
-
console.error(_context3.
|
|
215
|
-
case
|
|
210
|
+
console.error(_context3.t0);
|
|
211
|
+
case 12:
|
|
216
212
|
case "end":
|
|
217
213
|
return _context3.stop();
|
|
218
214
|
}
|
|
219
|
-
}, _callee2, null, [[0,
|
|
215
|
+
}, _callee2, null, [[0, 9]]);
|
|
220
216
|
}));
|
|
221
217
|
return _fetchContext.apply(this, arguments);
|
|
222
218
|
}
|
|
@@ -187,44 +187,41 @@ var serializeFieldset = /*#__PURE__*/function () {
|
|
|
187
187
|
while (1) switch (_context3.prev = _context3.next) {
|
|
188
188
|
case 0:
|
|
189
189
|
_context3.prev = 0;
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
case 3:
|
|
193
|
-
fieldSerializer = _context3.sent;
|
|
194
|
-
_context3.next = 10;
|
|
190
|
+
fieldSerializer = getFieldSerializer(manifest, field.options.transformer);
|
|
191
|
+
_context3.next = 8;
|
|
195
192
|
break;
|
|
196
|
-
case
|
|
197
|
-
_context3.prev =
|
|
193
|
+
case 4:
|
|
194
|
+
_context3.prev = 4;
|
|
198
195
|
_context3.t0 = _context3["catch"](0);
|
|
199
196
|
if (!(data[field.name] !== undefined)) {
|
|
200
|
-
_context3.next =
|
|
197
|
+
_context3.next = 8;
|
|
201
198
|
break;
|
|
202
199
|
}
|
|
203
200
|
throw _context3.t0;
|
|
204
|
-
case
|
|
201
|
+
case 8:
|
|
205
202
|
if (fieldSerializer) {
|
|
206
|
-
_context3.next =
|
|
203
|
+
_context3.next = 10;
|
|
207
204
|
break;
|
|
208
205
|
}
|
|
209
206
|
return _context3.abrupt("return");
|
|
210
|
-
case
|
|
207
|
+
case 10:
|
|
211
208
|
fieldsetFields = field.fields;
|
|
212
209
|
fieldParams = extract(data[field.name], field, {
|
|
213
210
|
useDefaultValue: true
|
|
214
211
|
}) || {};
|
|
215
|
-
_context3.next =
|
|
212
|
+
_context3.next = 14;
|
|
216
213
|
return serialize(manifest, fieldParams, fieldsetFields, {
|
|
217
214
|
depth: depth + 1,
|
|
218
215
|
parentType: 'fieldset'
|
|
219
216
|
});
|
|
220
|
-
case
|
|
217
|
+
case 14:
|
|
221
218
|
extracted = _context3.sent;
|
|
222
219
|
return _context3.abrupt("return", _defineProperty({}, field.name, fieldSerializer(extracted)));
|
|
223
|
-
case
|
|
220
|
+
case 16:
|
|
224
221
|
case "end":
|
|
225
222
|
return _context3.stop();
|
|
226
223
|
}
|
|
227
|
-
}, _callee3, null, [[0,
|
|
224
|
+
}, _callee3, null, [[0, 4]]);
|
|
228
225
|
}));
|
|
229
226
|
return function serializeFieldset(_x5, _x6, _x7, _x8) {
|
|
230
227
|
return _ref3.apply(this, arguments);
|
|
@@ -520,38 +517,35 @@ var _deserialize = /*#__PURE__*/function () {
|
|
|
520
517
|
return _context8.abrupt("return", 0);
|
|
521
518
|
case 8:
|
|
522
519
|
if (!(isFieldset(field) && depth === 0)) {
|
|
523
|
-
_context8.next =
|
|
520
|
+
_context8.next = 22;
|
|
524
521
|
break;
|
|
525
522
|
}
|
|
526
|
-
|
|
527
|
-
return getFieldDeserializer(manifest, field.options.transformer);
|
|
528
|
-
case 11:
|
|
529
|
-
fieldDeserializer = _context8.sent;
|
|
523
|
+
fieldDeserializer = getFieldDeserializer(manifest, field.options.transformer);
|
|
530
524
|
if (!fieldDeserializer) {
|
|
531
|
-
_context8.next =
|
|
525
|
+
_context8.next = 22;
|
|
532
526
|
break;
|
|
533
527
|
}
|
|
534
|
-
_context8.prev =
|
|
528
|
+
_context8.prev = 11;
|
|
535
529
|
value = fieldDeserializer(value);
|
|
536
|
-
_context8.next =
|
|
530
|
+
_context8.next = 19;
|
|
537
531
|
break;
|
|
538
|
-
case
|
|
539
|
-
_context8.prev =
|
|
540
|
-
_context8.t0 = _context8["catch"](
|
|
532
|
+
case 15:
|
|
533
|
+
_context8.prev = 15;
|
|
534
|
+
_context8.t0 = _context8["catch"](11);
|
|
541
535
|
errors.push(_defineProperty({}, name, _context8.t0 instanceof Error ? _context8.t0.message : String(_context8.t0)));
|
|
542
536
|
return _context8.abrupt("return", 0);
|
|
543
|
-
case
|
|
544
|
-
_context8.next =
|
|
537
|
+
case 19:
|
|
538
|
+
_context8.next = 21;
|
|
545
539
|
return _deserialize(manifest, value, field.fields, depth + 1);
|
|
546
|
-
case
|
|
540
|
+
case 21:
|
|
547
541
|
value = _context8.sent;
|
|
548
|
-
case
|
|
542
|
+
case 22:
|
|
549
543
|
result.push(_defineProperty({}, name, value));
|
|
550
|
-
case
|
|
544
|
+
case 23:
|
|
551
545
|
case "end":
|
|
552
546
|
return _context8.stop();
|
|
553
547
|
}
|
|
554
|
-
}, _loop2, null, [[
|
|
548
|
+
}, _loop2, null, [[11, 15]]);
|
|
555
549
|
});
|
|
556
550
|
_iterator2.s();
|
|
557
551
|
case 9:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-extension",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0",
|
|
4
4
|
"description": "editor-plugin-extension plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -30,14 +30,16 @@
|
|
|
30
30
|
"@atlaskit/checkbox": "^17.3.0",
|
|
31
31
|
"@atlaskit/datetime-picker": "^17.5.0",
|
|
32
32
|
"@atlaskit/editor-json-transformer": "^8.31.0",
|
|
33
|
-
"@atlaskit/editor-plugin-analytics": "^
|
|
34
|
-
"@atlaskit/editor-plugin-connectivity": "^
|
|
35
|
-
"@atlaskit/editor-plugin-context-identifier": "^
|
|
36
|
-
"@atlaskit/editor-plugin-context-panel": "^
|
|
37
|
-
"@atlaskit/editor-plugin-
|
|
38
|
-
"@atlaskit/editor-plugin-
|
|
39
|
-
"@atlaskit/editor-plugin-
|
|
40
|
-
"@atlaskit/editor-plugin-
|
|
33
|
+
"@atlaskit/editor-plugin-analytics": "^8.0.0",
|
|
34
|
+
"@atlaskit/editor-plugin-connectivity": "^8.0.0",
|
|
35
|
+
"@atlaskit/editor-plugin-context-identifier": "^8.0.0",
|
|
36
|
+
"@atlaskit/editor-plugin-context-panel": "^10.0.0",
|
|
37
|
+
"@atlaskit/editor-plugin-copy-button": "^8.0.0",
|
|
38
|
+
"@atlaskit/editor-plugin-decorations": "^8.0.0",
|
|
39
|
+
"@atlaskit/editor-plugin-feature-flags": "^7.0.0",
|
|
40
|
+
"@atlaskit/editor-plugin-mentions": "^10.0.0",
|
|
41
|
+
"@atlaskit/editor-plugin-toolbar": "^5.0.0",
|
|
42
|
+
"@atlaskit/editor-plugin-width": "^9.0.0",
|
|
41
43
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
42
44
|
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
43
45
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
@@ -58,9 +60,9 @@
|
|
|
58
60
|
"@atlaskit/textarea": "^8.2.0",
|
|
59
61
|
"@atlaskit/textfield": "^8.2.0",
|
|
60
62
|
"@atlaskit/theme": "^22.0.0",
|
|
61
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
63
|
+
"@atlaskit/tmp-editor-statsig": "^35.10.0",
|
|
62
64
|
"@atlaskit/toggle": "^15.2.0",
|
|
63
|
-
"@atlaskit/tokens": "^11.
|
|
65
|
+
"@atlaskit/tokens": "^11.1.0",
|
|
64
66
|
"@atlaskit/tooltip": "^20.14.0",
|
|
65
67
|
"@babel/runtime": "^7.0.0",
|
|
66
68
|
"@emotion/react": "^11.7.1",
|
|
@@ -72,7 +74,7 @@
|
|
|
72
74
|
"uuid": "^3.1.0"
|
|
73
75
|
},
|
|
74
76
|
"peerDependencies": {
|
|
75
|
-
"@atlaskit/editor-common": "^
|
|
77
|
+
"@atlaskit/editor-common": "^112.0.0",
|
|
76
78
|
"react": "^18.2.0",
|
|
77
79
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
78
80
|
},
|