@atlaskit/editor-common 114.48.0 → 114.49.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 +26 -0
- package/dist/cjs/block-menu/index.js +6 -0
- package/dist/cjs/block-menu/key.js +4 -1
- package/dist/cjs/clipboard/index.js +43 -42
- package/dist/cjs/element-browser/components/ElementList/ElementList.js +4 -1
- package/dist/cjs/extensibility/ExtensionComponent.js +15 -15
- package/dist/cjs/extensions/combine-extension-providers.js +7 -7
- package/dist/cjs/extensions/default-extension-provider.js +25 -28
- package/dist/cjs/extensions/extension-handlers.js +8 -8
- package/dist/cjs/extensions/manifest-helpers.js +7 -7
- package/dist/cjs/extensions/module-helpers.js +10 -10
- package/dist/cjs/floating-toolbar/DropdownMenuExtensionItems.js +17 -18
- package/dist/cjs/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +2 -1
- package/dist/cjs/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +92 -97
- package/dist/cjs/link/LinkSearch/index.js +47 -54
- package/dist/cjs/monitoring/error.js +15 -15
- package/dist/cjs/provider-helpers/combine-providers.js +24 -26
- package/dist/cjs/safe-plugin/index.js +2 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/user-preferences/user-preferences-provider.js +8 -8
- package/dist/cjs/utils/index.js +6 -0
- package/dist/cjs/utils/node-type-utils.js +21 -1
- package/dist/cjs/utils/processRawValue.js +15 -0
- package/dist/es2019/block-menu/index.js +1 -1
- package/dist/es2019/block-menu/key.js +3 -0
- package/dist/es2019/element-browser/components/ElementList/ElementList.js +4 -1
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/index.js +1 -1
- package/dist/es2019/utils/node-type-utils.js +20 -1
- package/dist/es2019/utils/processRawValue.js +17 -1
- package/dist/esm/block-menu/index.js +1 -1
- package/dist/esm/block-menu/key.js +3 -0
- package/dist/esm/clipboard/index.js +42 -41
- package/dist/esm/element-browser/components/ElementList/ElementList.js +4 -1
- package/dist/esm/extensibility/ExtensionComponent.js +14 -14
- package/dist/esm/extensions/combine-extension-providers.js +7 -7
- package/dist/esm/extensions/default-extension-provider.js +25 -28
- package/dist/esm/extensions/extension-handlers.js +8 -8
- package/dist/esm/extensions/manifest-helpers.js +7 -7
- package/dist/esm/extensions/module-helpers.js +10 -10
- package/dist/esm/floating-toolbar/DropdownMenuExtensionItems.js +16 -17
- package/dist/esm/hooks/useSharedPluginStateSelector/useSharedPluginStateSelector.js +2 -1
- package/dist/esm/link/LinkPicker/HyperlinkAddToolbar/HyperlinkAddToolbar.js +91 -96
- package/dist/esm/link/LinkSearch/index.js +47 -54
- package/dist/esm/monitoring/error.js +14 -14
- package/dist/esm/provider-helpers/combine-providers.js +24 -26
- package/dist/esm/safe-plugin/index.js +2 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/user-preferences/user-preferences-provider.js +8 -8
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/node-type-utils.js +20 -1
- package/dist/esm/utils/processRawValue.js +16 -1
- package/dist/types/block-menu/index.d.ts +1 -1
- package/dist/types/block-menu/key.d.ts +3 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/node-type-utils.d.ts +7 -1
- package/dist/types-ts4.5/block-menu/index.d.ts +1 -1
- package/dist/types-ts4.5/block-menu/key.d.ts +3 -0
- package/dist/types-ts4.5/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/node-type-utils.d.ts +7 -1
- package/package.json +6 -6
|
@@ -29,51 +29,52 @@ var isExtensionNode = function isExtensionNode(node) {
|
|
|
29
29
|
};
|
|
30
30
|
export var copyToClipboard = /*#__PURE__*/function () {
|
|
31
31
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(textToCopy) {
|
|
32
|
-
|
|
32
|
+
var _t, _t2;
|
|
33
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
33
34
|
while (1) switch (_context.prev = _context.next) {
|
|
34
35
|
case 0:
|
|
35
36
|
if (!isClipboardApiSupported()) {
|
|
36
|
-
_context.next =
|
|
37
|
+
_context.next = 5;
|
|
37
38
|
break;
|
|
38
39
|
}
|
|
39
40
|
_context.prev = 1;
|
|
40
|
-
_context.next =
|
|
41
|
+
_context.next = 2;
|
|
41
42
|
return navigator.clipboard.writeText(textToCopy);
|
|
42
|
-
case
|
|
43
|
-
_context.next =
|
|
43
|
+
case 2:
|
|
44
|
+
_context.next = 4;
|
|
44
45
|
break;
|
|
45
|
-
case
|
|
46
|
-
_context.prev =
|
|
47
|
-
|
|
46
|
+
case 3:
|
|
47
|
+
_context.prev = 3;
|
|
48
|
+
_t = _context["catch"](1);
|
|
48
49
|
throw new Error('Clipboard api is not supported');
|
|
49
|
-
case
|
|
50
|
-
_context.next =
|
|
50
|
+
case 4:
|
|
51
|
+
_context.next = 11;
|
|
51
52
|
break;
|
|
52
|
-
case
|
|
53
|
+
case 5:
|
|
53
54
|
if (!isIEClipboardApiSupported()) {
|
|
54
|
-
_context.next =
|
|
55
|
+
_context.next = 10;
|
|
55
56
|
break;
|
|
56
57
|
}
|
|
57
|
-
_context.prev =
|
|
58
|
-
_context.next =
|
|
58
|
+
_context.prev = 6;
|
|
59
|
+
_context.next = 7;
|
|
59
60
|
return window.clipboardData.setData('text', textToCopy);
|
|
60
|
-
case
|
|
61
|
-
_context.next =
|
|
61
|
+
case 7:
|
|
62
|
+
_context.next = 9;
|
|
62
63
|
break;
|
|
63
|
-
case
|
|
64
|
-
_context.prev =
|
|
65
|
-
|
|
64
|
+
case 8:
|
|
65
|
+
_context.prev = 8;
|
|
66
|
+
_t2 = _context["catch"](6);
|
|
66
67
|
throw new Error('IE clipboard api is not supported');
|
|
67
|
-
case
|
|
68
|
-
_context.next =
|
|
68
|
+
case 9:
|
|
69
|
+
_context.next = 11;
|
|
69
70
|
break;
|
|
70
|
-
case
|
|
71
|
+
case 10:
|
|
71
72
|
throw new Error('Clipboard api is not supported');
|
|
72
|
-
case
|
|
73
|
+
case 11:
|
|
73
74
|
case "end":
|
|
74
75
|
return _context.stop();
|
|
75
76
|
}
|
|
76
|
-
}, _callee, null, [[1,
|
|
77
|
+
}, _callee, null, [[1, 3], [6, 8]]);
|
|
77
78
|
}));
|
|
78
79
|
return function copyToClipboard(_x) {
|
|
79
80
|
return _ref.apply(this, arguments);
|
|
@@ -81,12 +82,12 @@ export var copyToClipboard = /*#__PURE__*/function () {
|
|
|
81
82
|
}();
|
|
82
83
|
export var copyHTMLToClipboard = /*#__PURE__*/function () {
|
|
83
84
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(elementToCopy, plainTextToCopy) {
|
|
84
|
-
var data;
|
|
85
|
-
return _regeneratorRuntime.wrap(function
|
|
85
|
+
var data, _t3;
|
|
86
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
86
87
|
while (1) switch (_context2.prev = _context2.next) {
|
|
87
88
|
case 0:
|
|
88
89
|
if (!(isClipboardApiSupported() && typeof ClipboardItem !== 'undefined')) {
|
|
89
|
-
_context2.next =
|
|
90
|
+
_context2.next = 5;
|
|
90
91
|
break;
|
|
91
92
|
}
|
|
92
93
|
_context2.prev = 1;
|
|
@@ -98,19 +99,19 @@ export var copyHTMLToClipboard = /*#__PURE__*/function () {
|
|
|
98
99
|
type: 'text/html'
|
|
99
100
|
})
|
|
100
101
|
}); // @ts-ignore
|
|
101
|
-
_context2.next =
|
|
102
|
+
_context2.next = 2;
|
|
102
103
|
return navigator.clipboard.write([data]);
|
|
103
|
-
case
|
|
104
|
-
_context2.next =
|
|
104
|
+
case 2:
|
|
105
|
+
_context2.next = 4;
|
|
105
106
|
break;
|
|
106
|
-
case
|
|
107
|
-
_context2.prev =
|
|
108
|
-
|
|
107
|
+
case 3:
|
|
108
|
+
_context2.prev = 3;
|
|
109
|
+
_t3 = _context2["catch"](1);
|
|
109
110
|
throw new Error('Clipboard api is not supported');
|
|
110
|
-
case
|
|
111
|
-
_context2.next =
|
|
111
|
+
case 4:
|
|
112
|
+
_context2.next = 6;
|
|
112
113
|
break;
|
|
113
|
-
case
|
|
114
|
+
case 5:
|
|
114
115
|
if (!!document && (typeof document === "undefined" ? "undefined" : _typeof(document)) === 'object') {
|
|
115
116
|
try {
|
|
116
117
|
// ED-17083 extension copy seems have issue with ClipboardItem API
|
|
@@ -121,11 +122,11 @@ export var copyHTMLToClipboard = /*#__PURE__*/function () {
|
|
|
121
122
|
console.log(error);
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
|
-
case
|
|
125
|
+
case 6:
|
|
125
126
|
case "end":
|
|
126
127
|
return _context2.stop();
|
|
127
128
|
}
|
|
128
|
-
}, _callee2, null, [[1,
|
|
129
|
+
}, _callee2, null, [[1, 3]]);
|
|
129
130
|
}));
|
|
130
131
|
return function copyHTMLToClipboard(_x2, _x3) {
|
|
131
132
|
return _ref2.apply(this, arguments);
|
|
@@ -137,7 +138,7 @@ export var copyHTMLToClipboard = /*#__PURE__*/function () {
|
|
|
137
138
|
export var copyHTMLToClipboardPolyfill = /*#__PURE__*/function () {
|
|
138
139
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(elementToCopy, plainTextToCopy) {
|
|
139
140
|
var dt;
|
|
140
|
-
return _regeneratorRuntime.wrap(function
|
|
141
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
141
142
|
while (1) switch (_context3.prev = _context3.next) {
|
|
142
143
|
case 0:
|
|
143
144
|
dt = new clipboard.ClipboardItem({
|
|
@@ -148,9 +149,9 @@ export var copyHTMLToClipboardPolyfill = /*#__PURE__*/function () {
|
|
|
148
149
|
type: 'text/plain'
|
|
149
150
|
})
|
|
150
151
|
});
|
|
151
|
-
_context3.next =
|
|
152
|
+
_context3.next = 1;
|
|
152
153
|
return clipboard.write([dt]);
|
|
153
|
-
case
|
|
154
|
+
case 1:
|
|
154
155
|
case "end":
|
|
155
156
|
return _context3.stop();
|
|
156
157
|
}
|
|
@@ -412,11 +412,14 @@ export function ElementItem(_ref6) {
|
|
|
412
412
|
id: "searched-item-".concat(index),
|
|
413
413
|
isDisabled: isDisabled,
|
|
414
414
|
role: role
|
|
415
|
+
// @ts-expect-error -- see A11Y-30538
|
|
416
|
+
,
|
|
417
|
+
tabIndex: expValEquals('platform_editor_fix_a11y_tab_focus_insertion_menu', 'isEnabled', true) ? -1 : undefined
|
|
415
418
|
}, jsx(ItemContent
|
|
416
419
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
417
420
|
, {
|
|
418
421
|
style: inlineMode ? null : itemStyleOverrides,
|
|
419
|
-
tabIndex: 0,
|
|
422
|
+
tabIndex: expValEquals('platform_editor_fix_a11y_tab_focus_insertion_menu', 'isEnabled', true) ? undefined : 0,
|
|
420
423
|
title: title,
|
|
421
424
|
description: description,
|
|
422
425
|
keyshortcut: keyshortcut,
|
|
@@ -98,44 +98,44 @@ var ExtensionComponentInner = /*#__PURE__*/function (_Component) {
|
|
|
98
98
|
* handler which only handles `render`/component concerns.
|
|
99
99
|
*/
|
|
100
100
|
_defineProperty(_this, "parsePrivateNodePropsIfNeeded", /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
101
|
-
var _this$props$node$attr, extensionType, extensionKey, privateProps;
|
|
102
|
-
return _regeneratorRuntime.wrap(function
|
|
101
|
+
var _this$props$node$attr, extensionType, extensionKey, privateProps, _t;
|
|
102
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
103
103
|
while (1) switch (_context.prev = _context.next) {
|
|
104
104
|
case 0:
|
|
105
105
|
if (!(_this.privatePropsParsed || !_this.props.extensionProvider)) {
|
|
106
|
-
_context.next =
|
|
106
|
+
_context.next = 1;
|
|
107
107
|
break;
|
|
108
108
|
}
|
|
109
109
|
return _context.abrupt("return");
|
|
110
|
-
case
|
|
110
|
+
case 1:
|
|
111
111
|
_this.privatePropsParsed = true;
|
|
112
112
|
_this$props$node$attr = _this.props.node.attrs, extensionType = _this$props$node$attr.extensionType, extensionKey = _this$props$node$attr.extensionKey;
|
|
113
113
|
/**
|
|
114
114
|
* getExtensionModuleNodePrivateProps can throw if there are issues in the
|
|
115
115
|
* manifest
|
|
116
116
|
*/
|
|
117
|
-
_context.prev =
|
|
118
|
-
_context.next =
|
|
117
|
+
_context.prev = 2;
|
|
118
|
+
_context.next = 3;
|
|
119
119
|
return _this.getExtensionModuleNodePrivateProps(_this.props.extensionProvider, extensionType, extensionKey);
|
|
120
|
-
case
|
|
120
|
+
case 3:
|
|
121
121
|
privateProps = _context.sent;
|
|
122
122
|
_this.setState({
|
|
123
123
|
_privateProps: privateProps
|
|
124
124
|
});
|
|
125
|
-
_context.next =
|
|
125
|
+
_context.next = 5;
|
|
126
126
|
break;
|
|
127
|
-
case
|
|
128
|
-
_context.prev =
|
|
129
|
-
|
|
127
|
+
case 4:
|
|
128
|
+
_context.prev = 4;
|
|
129
|
+
_t = _context["catch"](2);
|
|
130
130
|
// eslint-disable-next-line no-console
|
|
131
|
-
console.error('Provided extension handler has thrown an error\n',
|
|
131
|
+
console.error('Provided extension handler has thrown an error\n', _t);
|
|
132
132
|
/** We don't want this error to block renderer */
|
|
133
133
|
/** We keep rendering the default content */
|
|
134
|
-
case
|
|
134
|
+
case 5:
|
|
135
135
|
case "end":
|
|
136
136
|
return _context.stop();
|
|
137
137
|
}
|
|
138
|
-
}, _callee, null, [[
|
|
138
|
+
}, _callee, null, [[2, 4]]);
|
|
139
139
|
})));
|
|
140
140
|
_defineProperty(_this, "handleExtension", function (pmNode, actions) {
|
|
141
141
|
var _pmNode$marks;
|
|
@@ -19,26 +19,26 @@ export default (function (extensionProviders) {
|
|
|
19
19
|
},
|
|
20
20
|
preload: function preload() {
|
|
21
21
|
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
22
|
-
return _regeneratorRuntime.wrap(function
|
|
22
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
23
23
|
while (1) switch (_context.prev = _context.next) {
|
|
24
24
|
case 0:
|
|
25
25
|
if (!(providersCache.length === 0)) {
|
|
26
|
-
_context.next =
|
|
26
|
+
_context.next = 2;
|
|
27
27
|
break;
|
|
28
28
|
}
|
|
29
|
-
_context.next =
|
|
29
|
+
_context.next = 1;
|
|
30
30
|
return Promise.all(extensionProviders.map(function (provider) {
|
|
31
31
|
return Promise.resolve(provider);
|
|
32
32
|
}));
|
|
33
|
-
case
|
|
33
|
+
case 1:
|
|
34
34
|
providersCache = _context.sent;
|
|
35
|
-
case
|
|
36
|
-
_context.next =
|
|
35
|
+
case 2:
|
|
36
|
+
_context.next = 3;
|
|
37
37
|
return Promise.all(providersCache.map(function (provider) {
|
|
38
38
|
var _provider$preload;
|
|
39
39
|
return provider === null || provider === void 0 || (_provider$preload = provider.preload) === null || _provider$preload === void 0 ? void 0 : _provider$preload.call(provider);
|
|
40
40
|
}));
|
|
41
|
-
case
|
|
41
|
+
case 3:
|
|
42
42
|
case "end":
|
|
43
43
|
return _context.stop();
|
|
44
44
|
}
|
|
@@ -31,12 +31,12 @@ var DefaultExtensionProvider = /*#__PURE__*/function () {
|
|
|
31
31
|
value: function () {
|
|
32
32
|
var _preload = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
33
33
|
var preloadCalls, _iterator, _step, _manifest$modules, manifest, nodes;
|
|
34
|
-
return _regeneratorRuntime.wrap(function
|
|
34
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
35
35
|
while (1) switch (_context.prev = _context.next) {
|
|
36
36
|
case 0:
|
|
37
|
-
_context.next =
|
|
37
|
+
_context.next = 1;
|
|
38
38
|
return this.getExtensions();
|
|
39
|
-
case
|
|
39
|
+
case 1:
|
|
40
40
|
this.manifestsCache = _context.sent;
|
|
41
41
|
preloadCalls = [];
|
|
42
42
|
_iterator = _createForOfIteratorHelper(this.manifestsCache);
|
|
@@ -56,9 +56,9 @@ var DefaultExtensionProvider = /*#__PURE__*/function () {
|
|
|
56
56
|
} finally {
|
|
57
57
|
_iterator.f();
|
|
58
58
|
}
|
|
59
|
-
_context.next =
|
|
59
|
+
_context.next = 2;
|
|
60
60
|
return Promise.allSettled(preloadCalls);
|
|
61
|
-
case
|
|
61
|
+
case 2:
|
|
62
62
|
case "end":
|
|
63
63
|
return _context.stop();
|
|
64
64
|
}
|
|
@@ -81,18 +81,16 @@ var DefaultExtensionProvider = /*#__PURE__*/function () {
|
|
|
81
81
|
key: "getExtension",
|
|
82
82
|
value: function () {
|
|
83
83
|
var _getExtension = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(type, key) {
|
|
84
|
-
|
|
84
|
+
var _t;
|
|
85
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
85
86
|
while (1) switch (_context2.prev = _context2.next) {
|
|
86
87
|
case 0:
|
|
87
|
-
|
|
88
|
-
_context2.next =
|
|
88
|
+
_t = this;
|
|
89
|
+
_context2.next = 1;
|
|
89
90
|
return this.manifestsPromise;
|
|
90
|
-
case
|
|
91
|
-
_context2.
|
|
92
|
-
|
|
93
|
-
_context2.t3 = key;
|
|
94
|
-
return _context2.abrupt("return", _context2.t0.getExtensionFromManifest.call(_context2.t0, _context2.t1, _context2.t2, _context2.t3));
|
|
95
|
-
case 7:
|
|
91
|
+
case 1:
|
|
92
|
+
return _context2.abrupt("return", _t.getExtensionFromManifest.call(_t, _context2.sent, type, key));
|
|
93
|
+
case 2:
|
|
96
94
|
case "end":
|
|
97
95
|
return _context2.stop();
|
|
98
96
|
}
|
|
@@ -119,17 +117,17 @@ var DefaultExtensionProvider = /*#__PURE__*/function () {
|
|
|
119
117
|
value: function () {
|
|
120
118
|
var _search = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(keyword) {
|
|
121
119
|
var extensions;
|
|
122
|
-
return _regeneratorRuntime.wrap(function
|
|
120
|
+
return _regeneratorRuntime.wrap(function (_context3) {
|
|
123
121
|
while (1) switch (_context3.prev = _context3.next) {
|
|
124
122
|
case 0:
|
|
125
|
-
_context3.next =
|
|
123
|
+
_context3.next = 1;
|
|
126
124
|
return this.manifestsPromise;
|
|
127
|
-
case
|
|
125
|
+
case 1:
|
|
128
126
|
extensions = _context3.sent.filter(function (manifest) {
|
|
129
127
|
return manifest.title.toLowerCase().includes(keyword.toLowerCase());
|
|
130
128
|
});
|
|
131
129
|
return _context3.abrupt("return", extensions);
|
|
132
|
-
case
|
|
130
|
+
case 2:
|
|
133
131
|
case "end":
|
|
134
132
|
return _context3.stop();
|
|
135
133
|
}
|
|
@@ -144,24 +142,23 @@ var DefaultExtensionProvider = /*#__PURE__*/function () {
|
|
|
144
142
|
key: "getAutoConverter",
|
|
145
143
|
value: function () {
|
|
146
144
|
var _getAutoConverter = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
|
147
|
-
var autoConverters;
|
|
148
|
-
return _regeneratorRuntime.wrap(function
|
|
145
|
+
var autoConverters, _t2;
|
|
146
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
149
147
|
while (1) switch (_context4.prev = _context4.next) {
|
|
150
148
|
case 0:
|
|
151
149
|
if (!this.autoConvertHandlers) {
|
|
152
|
-
_context4.next =
|
|
150
|
+
_context4.next = 1;
|
|
153
151
|
break;
|
|
154
152
|
}
|
|
155
153
|
return _context4.abrupt("return", this.autoConvertHandlers);
|
|
156
|
-
case
|
|
157
|
-
|
|
158
|
-
_context4.next =
|
|
154
|
+
case 1:
|
|
155
|
+
_t2 = getAutoConvertPatternsFromModule;
|
|
156
|
+
_context4.next = 2;
|
|
159
157
|
return this.manifestsPromise;
|
|
160
|
-
case
|
|
161
|
-
|
|
162
|
-
autoConverters = (0, _context4.t0)(_context4.t1);
|
|
158
|
+
case 2:
|
|
159
|
+
autoConverters = _t2(_context4.sent);
|
|
163
160
|
return _context4.abrupt("return", autoConverters);
|
|
164
|
-
case
|
|
161
|
+
case 3:
|
|
165
162
|
case "end":
|
|
166
163
|
return _context4.stop();
|
|
167
164
|
}
|
|
@@ -39,16 +39,16 @@ function _getExtensionModuleNode() {
|
|
|
39
39
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Generic extension types; any required for provider compatibility
|
|
40
40
|
) {
|
|
41
41
|
var _getExtensionKeyAndNo5, _getExtensionKeyAndNo6, extKey, nodeKey, manifest;
|
|
42
|
-
return _regeneratorRuntime.wrap(function
|
|
42
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
43
43
|
while (1) switch (_context.prev = _context.next) {
|
|
44
44
|
case 0:
|
|
45
45
|
_getExtensionKeyAndNo5 = getExtensionKeyAndNodeKey(extensionKey, extensionType), _getExtensionKeyAndNo6 = _slicedToArray(_getExtensionKeyAndNo5, 2), extKey = _getExtensionKeyAndNo6[0], nodeKey = _getExtensionKeyAndNo6[1];
|
|
46
|
-
_context.next =
|
|
46
|
+
_context.next = 1;
|
|
47
47
|
return extensionProvider.getExtension(extensionType, extKey);
|
|
48
|
-
case
|
|
48
|
+
case 1:
|
|
49
49
|
manifest = _context.sent;
|
|
50
50
|
return _context.abrupt("return", getNodeFromManifest(manifest, extKey, nodeKey, extensionType, extensionKey));
|
|
51
|
-
case
|
|
51
|
+
case 2:
|
|
52
52
|
case "end":
|
|
53
53
|
return _context.stop();
|
|
54
54
|
}
|
|
@@ -83,12 +83,12 @@ export function getExtensionModuleNodePrivateProps(_x4, _x5, _x6) {
|
|
|
83
83
|
function _getExtensionModuleNodePrivateProps() {
|
|
84
84
|
_getExtensionModuleNodePrivateProps = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(extensionProvider, extensionType, extensionKey) {
|
|
85
85
|
var moduleNode;
|
|
86
|
-
return _regeneratorRuntime.wrap(function
|
|
86
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
87
87
|
while (1) switch (_context2.prev = _context2.next) {
|
|
88
88
|
case 0:
|
|
89
|
-
_context2.next =
|
|
89
|
+
_context2.next = 1;
|
|
90
90
|
return getExtensionModuleNode(extensionProvider, extensionType, extensionKey);
|
|
91
|
-
case
|
|
91
|
+
case 1:
|
|
92
92
|
moduleNode = _context2.sent;
|
|
93
93
|
return _context2.abrupt("return", Object.keys(moduleNode).filter(function (key) {
|
|
94
94
|
return key.startsWith('__');
|
|
@@ -98,7 +98,7 @@ function _getExtensionModuleNodePrivateProps() {
|
|
|
98
98
|
acc[key] = moduleNode[key];
|
|
99
99
|
return acc;
|
|
100
100
|
}, {}));
|
|
101
|
-
case
|
|
101
|
+
case 2:
|
|
102
102
|
case "end":
|
|
103
103
|
return _context2.stop();
|
|
104
104
|
}
|
|
@@ -41,16 +41,16 @@ export var resolveImportSync = function resolveImportSync(importedModule) {
|
|
|
41
41
|
};
|
|
42
42
|
export var resolveImport = /*#__PURE__*/function () {
|
|
43
43
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(importPromise) {
|
|
44
|
-
|
|
44
|
+
var _t;
|
|
45
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
45
46
|
while (1) switch (_context.prev = _context.next) {
|
|
46
47
|
case 0:
|
|
47
|
-
|
|
48
|
-
_context.next =
|
|
48
|
+
_t = resolveImportSync;
|
|
49
|
+
_context.next = 1;
|
|
49
50
|
return importPromise;
|
|
50
|
-
case
|
|
51
|
-
_context.
|
|
52
|
-
|
|
53
|
-
case 5:
|
|
51
|
+
case 1:
|
|
52
|
+
return _context.abrupt("return", _t(_context.sent));
|
|
53
|
+
case 2:
|
|
54
54
|
case "end":
|
|
55
55
|
return _context.stop();
|
|
56
56
|
}
|
|
@@ -64,20 +64,20 @@ function _getAutoConvertPatternsFromModule() {
|
|
|
64
64
|
_getAutoConvertPatternsFromModule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(extensions) {
|
|
65
65
|
var _ref2;
|
|
66
66
|
var items;
|
|
67
|
-
return _regeneratorRuntime.wrap(function
|
|
67
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
68
68
|
while (1) switch (_context.prev = _context.next) {
|
|
69
69
|
case 0:
|
|
70
|
-
_context.next =
|
|
70
|
+
_context.next = 1;
|
|
71
71
|
return Promise.all(extensions.map(function (manifest) {
|
|
72
72
|
if (manifest.modules.autoConvert && manifest.modules.autoConvert.url) {
|
|
73
73
|
return manifest.modules.autoConvert.url;
|
|
74
74
|
}
|
|
75
75
|
return [];
|
|
76
76
|
}));
|
|
77
|
-
case
|
|
77
|
+
case 1:
|
|
78
78
|
items = _context.sent;
|
|
79
79
|
return _context.abrupt("return", (_ref2 = []).concat.apply(_ref2, _toConsumableArray(items)));
|
|
80
|
-
case
|
|
80
|
+
case 2:
|
|
81
81
|
case "end":
|
|
82
82
|
return _context.stop();
|
|
83
83
|
}
|
|
@@ -113,19 +113,19 @@ export function getExtensionAutoConvertersFromProvider(_x2) {
|
|
|
113
113
|
function _getExtensionAutoConvertersFromProvider() {
|
|
114
114
|
_getExtensionAutoConvertersFromProvider = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(extensionProviderPromise) {
|
|
115
115
|
var extensionProvider, extensionAutoConverters;
|
|
116
|
-
return _regeneratorRuntime.wrap(function
|
|
116
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
117
117
|
while (1) switch (_context2.prev = _context2.next) {
|
|
118
118
|
case 0:
|
|
119
|
-
_context2.next =
|
|
119
|
+
_context2.next = 1;
|
|
120
120
|
return extensionProviderPromise;
|
|
121
|
-
case
|
|
121
|
+
case 1:
|
|
122
122
|
extensionProvider = _context2.sent;
|
|
123
|
-
_context2.next =
|
|
123
|
+
_context2.next = 2;
|
|
124
124
|
return extensionProvider.getAutoConverter();
|
|
125
|
-
case
|
|
125
|
+
case 2:
|
|
126
126
|
extensionAutoConverters = _context2.sent;
|
|
127
127
|
return _context2.abrupt("return", createAutoConverterRunner(extensionAutoConverters));
|
|
128
|
-
case
|
|
128
|
+
case 3:
|
|
129
129
|
case "end":
|
|
130
130
|
return _context2.stop();
|
|
131
131
|
}
|
|
@@ -16,21 +16,21 @@ var isDefaultExport = function isDefaultExport(mod) {
|
|
|
16
16
|
var resolveExtensionIcon = /*#__PURE__*/function () {
|
|
17
17
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(getIcon) {
|
|
18
18
|
var maybeIcon;
|
|
19
|
-
return _regeneratorRuntime.wrap(function
|
|
19
|
+
return _regeneratorRuntime.wrap(function (_context) {
|
|
20
20
|
while (1) switch (_context.prev = _context.next) {
|
|
21
21
|
case 0:
|
|
22
22
|
if (getIcon) {
|
|
23
|
-
_context.next =
|
|
23
|
+
_context.next = 1;
|
|
24
24
|
break;
|
|
25
25
|
}
|
|
26
26
|
return _context.abrupt("return", noop);
|
|
27
|
-
case
|
|
28
|
-
_context.next =
|
|
27
|
+
case 1:
|
|
28
|
+
_context.next = 2;
|
|
29
29
|
return getIcon();
|
|
30
|
-
case
|
|
30
|
+
case 2:
|
|
31
31
|
maybeIcon = _context.sent;
|
|
32
32
|
return _context.abrupt("return", isDefaultExport(maybeIcon) ? maybeIcon.default : maybeIcon);
|
|
33
|
-
case
|
|
33
|
+
case 3:
|
|
34
34
|
case "end":
|
|
35
35
|
return _context.stop();
|
|
36
36
|
}
|
|
@@ -133,25 +133,24 @@ export var DropdownMenuExtensionItems = function DropdownMenuExtensionItems(prop
|
|
|
133
133
|
}
|
|
134
134
|
function _getExtensions() {
|
|
135
135
|
_getExtensions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
136
|
-
var provider;
|
|
137
|
-
return _regeneratorRuntime.wrap(function
|
|
136
|
+
var provider, _t;
|
|
137
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
138
138
|
while (1) switch (_context2.prev = _context2.next) {
|
|
139
139
|
case 0:
|
|
140
|
-
_context2.next =
|
|
140
|
+
_context2.next = 1;
|
|
141
141
|
return extension.extensionProvider;
|
|
142
|
-
case
|
|
142
|
+
case 1:
|
|
143
143
|
provider = _context2.sent;
|
|
144
144
|
if (!provider) {
|
|
145
|
-
_context2.next =
|
|
145
|
+
_context2.next = 3;
|
|
146
146
|
break;
|
|
147
147
|
}
|
|
148
|
-
|
|
149
|
-
_context2.next =
|
|
148
|
+
_t = setExtensions;
|
|
149
|
+
_context2.next = 2;
|
|
150
150
|
return provider.getExtensions();
|
|
151
|
-
case
|
|
152
|
-
_context2.
|
|
153
|
-
|
|
154
|
-
case 9:
|
|
151
|
+
case 2:
|
|
152
|
+
_t(_context2.sent);
|
|
153
|
+
case 3:
|
|
155
154
|
case "end":
|
|
156
155
|
return _context2.stop();
|
|
157
156
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _toArray from "@babel/runtime/helpers/toArray";
|
|
4
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
4
5
|
import { useState, useCallback, useMemo } from 'react';
|
|
5
6
|
import get from 'lodash/get';
|
|
6
7
|
import isEqual from 'lodash/isEqual';
|
|
@@ -87,7 +88,7 @@ export function useSharedPluginStateSelector(api, plugin) {
|
|
|
87
88
|
var _plugin$split = plugin.split('.'),
|
|
88
89
|
_plugin$split2 = _toArray(_plugin$split),
|
|
89
90
|
pluginName = _plugin$split2[0],
|
|
90
|
-
properties = _plugin$split2.slice(1);
|
|
91
|
+
properties = _arrayLikeToArray(_plugin$split2).slice(1);
|
|
91
92
|
if (!pluginState || (properties === null || properties === void 0 ? void 0 : properties.length) === 0) {
|
|
92
93
|
return undefined;
|
|
93
94
|
}
|