@atlaskit/editor-plugin-panel 10.0.1 → 10.0.2
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 +6 -0
- package/dist/cjs/panelPlugin.js +16 -6
- package/dist/es2019/panelPlugin.js +15 -6
- package/dist/esm/panelPlugin.js +16 -6
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
package/dist/cjs/panelPlugin.js
CHANGED
|
@@ -26,7 +26,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
26
26
|
var PANEL_NODE_NAME = 'panel';
|
|
27
27
|
var panelPlugin = function panelPlugin(_ref) {
|
|
28
28
|
var _ref$config = _ref.config,
|
|
29
|
-
|
|
29
|
+
_ref$config2 = _ref$config === void 0 ? {} : _ref$config,
|
|
30
|
+
_ref$config2$allowCus = _ref$config2.allowCustomPanel,
|
|
31
|
+
allowCustomPanel = _ref$config2$allowCus === void 0 ? false : _ref$config2$allowCus,
|
|
32
|
+
_ref$config2$allowCus2 = _ref$config2.allowCustomPanelEdit,
|
|
33
|
+
allowCustomPanelEdit = _ref$config2$allowCus2 === void 0 ? false : _ref$config2$allowCus2,
|
|
30
34
|
api = _ref.api;
|
|
31
35
|
if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) {
|
|
32
36
|
var _api$blockMenu;
|
|
@@ -51,14 +55,14 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
51
55
|
if ((0, _platformFeatureFlags.fg)('platform_editor_adf_with_localid')) {
|
|
52
56
|
return [{
|
|
53
57
|
name: 'panel',
|
|
54
|
-
node: _objectSpread(_objectSpread({}, (0, _adfSchema.extendedPanelWithLocalId)(!!
|
|
58
|
+
node: _objectSpread(_objectSpread({}, (0, _adfSchema.extendedPanelWithLocalId)(!!allowCustomPanel)), {}, {
|
|
55
59
|
definingAsContext: true
|
|
56
60
|
})
|
|
57
61
|
}];
|
|
58
62
|
}
|
|
59
63
|
return [{
|
|
60
64
|
name: 'panel',
|
|
61
|
-
node: (0, _adfSchema.extendedPanel)(!!
|
|
65
|
+
node: (0, _adfSchema.extendedPanel)(!!allowCustomPanel)
|
|
62
66
|
}];
|
|
63
67
|
},
|
|
64
68
|
pmPlugins: function pmPlugins() {
|
|
@@ -68,7 +72,10 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
68
72
|
var providerFactory = _ref2.providerFactory,
|
|
69
73
|
dispatch = _ref2.dispatch,
|
|
70
74
|
nodeViewPortalProviderAPI = _ref2.nodeViewPortalProviderAPI;
|
|
71
|
-
return (0, _main.createPlugin)(dispatch, providerFactory,
|
|
75
|
+
return (0, _main.createPlugin)(dispatch, providerFactory, {
|
|
76
|
+
allowCustomPanel: allowCustomPanel,
|
|
77
|
+
allowCustomPanelEdit: allowCustomPanelEdit
|
|
78
|
+
}, api, nodeViewPortalProviderAPI);
|
|
72
79
|
}
|
|
73
80
|
}, {
|
|
74
81
|
name: 'panelKeyMap',
|
|
@@ -194,7 +201,7 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
194
201
|
});
|
|
195
202
|
}
|
|
196
203
|
}];
|
|
197
|
-
if (
|
|
204
|
+
if (allowCustomPanel && allowCustomPanelEdit) {
|
|
198
205
|
quickInsertOptions.push({
|
|
199
206
|
id: 'custompanel',
|
|
200
207
|
title: formatMessage(_messages.blockTypeMessages.customPanel),
|
|
@@ -226,7 +233,10 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
226
233
|
return quickInsertOptions;
|
|
227
234
|
},
|
|
228
235
|
floatingToolbar: function floatingToolbar(state, intl, providerFactory) {
|
|
229
|
-
return (0, _toolbar.getToolbarConfig)(state, intl,
|
|
236
|
+
return (0, _toolbar.getToolbarConfig)(state, intl, {
|
|
237
|
+
allowCustomPanel: allowCustomPanel,
|
|
238
|
+
allowCustomPanelEdit: allowCustomPanelEdit
|
|
239
|
+
}, providerFactory, api);
|
|
230
240
|
}
|
|
231
241
|
}
|
|
232
242
|
};
|
|
@@ -15,7 +15,10 @@ import { createPanelBlockMenuItem } from './ui/panelBlockMenuItem';
|
|
|
15
15
|
import { getToolbarConfig } from './ui/toolbar';
|
|
16
16
|
const PANEL_NODE_NAME = 'panel';
|
|
17
17
|
const panelPlugin = ({
|
|
18
|
-
config:
|
|
18
|
+
config: {
|
|
19
|
+
allowCustomPanel = false,
|
|
20
|
+
allowCustomPanelEdit = false
|
|
21
|
+
} = {},
|
|
19
22
|
api
|
|
20
23
|
}) => {
|
|
21
24
|
if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
|
|
@@ -42,14 +45,14 @@ const panelPlugin = ({
|
|
|
42
45
|
return [{
|
|
43
46
|
name: 'panel',
|
|
44
47
|
node: {
|
|
45
|
-
...extendedPanelWithLocalId(!!
|
|
48
|
+
...extendedPanelWithLocalId(!!allowCustomPanel),
|
|
46
49
|
definingAsContext: true
|
|
47
50
|
}
|
|
48
51
|
}];
|
|
49
52
|
}
|
|
50
53
|
return [{
|
|
51
54
|
name: 'panel',
|
|
52
|
-
node: extendedPanel(!!
|
|
55
|
+
node: extendedPanel(!!allowCustomPanel)
|
|
53
56
|
}];
|
|
54
57
|
},
|
|
55
58
|
pmPlugins() {
|
|
@@ -59,7 +62,10 @@ const panelPlugin = ({
|
|
|
59
62
|
providerFactory,
|
|
60
63
|
dispatch,
|
|
61
64
|
nodeViewPortalProviderAPI
|
|
62
|
-
}) => createPlugin(dispatch, providerFactory,
|
|
65
|
+
}) => createPlugin(dispatch, providerFactory, {
|
|
66
|
+
allowCustomPanel,
|
|
67
|
+
allowCustomPanelEdit
|
|
68
|
+
}, api, nodeViewPortalProviderAPI)
|
|
63
69
|
}, {
|
|
64
70
|
name: 'panelKeyMap',
|
|
65
71
|
plugin: () => keymap()
|
|
@@ -173,7 +179,7 @@ const panelPlugin = ({
|
|
|
173
179
|
});
|
|
174
180
|
}
|
|
175
181
|
}];
|
|
176
|
-
if (
|
|
182
|
+
if (allowCustomPanel && allowCustomPanelEdit) {
|
|
177
183
|
quickInsertOptions.push({
|
|
178
184
|
id: 'custompanel',
|
|
179
185
|
title: formatMessage(blockTypeMessages.customPanel),
|
|
@@ -202,7 +208,10 @@ const panelPlugin = ({
|
|
|
202
208
|
}
|
|
203
209
|
return quickInsertOptions;
|
|
204
210
|
},
|
|
205
|
-
floatingToolbar: (state, intl, providerFactory) => getToolbarConfig(state, intl,
|
|
211
|
+
floatingToolbar: (state, intl, providerFactory) => getToolbarConfig(state, intl, {
|
|
212
|
+
allowCustomPanel,
|
|
213
|
+
allowCustomPanelEdit
|
|
214
|
+
}, providerFactory, api)
|
|
206
215
|
}
|
|
207
216
|
};
|
|
208
217
|
};
|
package/dist/esm/panelPlugin.js
CHANGED
|
@@ -19,7 +19,11 @@ import { getToolbarConfig } from './ui/toolbar';
|
|
|
19
19
|
var PANEL_NODE_NAME = 'panel';
|
|
20
20
|
var panelPlugin = function panelPlugin(_ref) {
|
|
21
21
|
var _ref$config = _ref.config,
|
|
22
|
-
|
|
22
|
+
_ref$config2 = _ref$config === void 0 ? {} : _ref$config,
|
|
23
|
+
_ref$config2$allowCus = _ref$config2.allowCustomPanel,
|
|
24
|
+
allowCustomPanel = _ref$config2$allowCus === void 0 ? false : _ref$config2$allowCus,
|
|
25
|
+
_ref$config2$allowCus2 = _ref$config2.allowCustomPanelEdit,
|
|
26
|
+
allowCustomPanelEdit = _ref$config2$allowCus2 === void 0 ? false : _ref$config2$allowCus2,
|
|
23
27
|
api = _ref.api;
|
|
24
28
|
if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
|
|
25
29
|
var _api$blockMenu;
|
|
@@ -44,14 +48,14 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
44
48
|
if (fg('platform_editor_adf_with_localid')) {
|
|
45
49
|
return [{
|
|
46
50
|
name: 'panel',
|
|
47
|
-
node: _objectSpread(_objectSpread({}, extendedPanelWithLocalId(!!
|
|
51
|
+
node: _objectSpread(_objectSpread({}, extendedPanelWithLocalId(!!allowCustomPanel)), {}, {
|
|
48
52
|
definingAsContext: true
|
|
49
53
|
})
|
|
50
54
|
}];
|
|
51
55
|
}
|
|
52
56
|
return [{
|
|
53
57
|
name: 'panel',
|
|
54
|
-
node: extendedPanel(!!
|
|
58
|
+
node: extendedPanel(!!allowCustomPanel)
|
|
55
59
|
}];
|
|
56
60
|
},
|
|
57
61
|
pmPlugins: function pmPlugins() {
|
|
@@ -61,7 +65,10 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
61
65
|
var providerFactory = _ref2.providerFactory,
|
|
62
66
|
dispatch = _ref2.dispatch,
|
|
63
67
|
nodeViewPortalProviderAPI = _ref2.nodeViewPortalProviderAPI;
|
|
64
|
-
return createPlugin(dispatch, providerFactory,
|
|
68
|
+
return createPlugin(dispatch, providerFactory, {
|
|
69
|
+
allowCustomPanel: allowCustomPanel,
|
|
70
|
+
allowCustomPanelEdit: allowCustomPanelEdit
|
|
71
|
+
}, api, nodeViewPortalProviderAPI);
|
|
65
72
|
}
|
|
66
73
|
}, {
|
|
67
74
|
name: 'panelKeyMap',
|
|
@@ -187,7 +194,7 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
187
194
|
});
|
|
188
195
|
}
|
|
189
196
|
}];
|
|
190
|
-
if (
|
|
197
|
+
if (allowCustomPanel && allowCustomPanelEdit) {
|
|
191
198
|
quickInsertOptions.push({
|
|
192
199
|
id: 'custompanel',
|
|
193
200
|
title: formatMessage(blockTypeMessages.customPanel),
|
|
@@ -219,7 +226,10 @@ var panelPlugin = function panelPlugin(_ref) {
|
|
|
219
226
|
return quickInsertOptions;
|
|
220
227
|
},
|
|
221
228
|
floatingToolbar: function floatingToolbar(state, intl, providerFactory) {
|
|
222
|
-
return getToolbarConfig(state, intl,
|
|
229
|
+
return getToolbarConfig(state, intl, {
|
|
230
|
+
allowCustomPanel: allowCustomPanel,
|
|
231
|
+
allowCustomPanelEdit: allowCustomPanelEdit
|
|
232
|
+
}, providerFactory, api);
|
|
223
233
|
}
|
|
224
234
|
}
|
|
225
235
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-panel",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.2",
|
|
4
4
|
"description": "Panel plugin for @atlaskit/editor-core.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"@atlaskit/icon": "^32.0.0",
|
|
43
43
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
44
44
|
"@atlaskit/theme": "^22.0.0",
|
|
45
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
45
|
+
"@atlaskit/tmp-editor-statsig": "^37.0.0",
|
|
46
46
|
"@atlaskit/tokens": "^11.1.0",
|
|
47
47
|
"@babel/runtime": "^7.0.0",
|
|
48
48
|
"uuid": "^3.1.0"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@atlaskit/editor-common": "^112.
|
|
51
|
+
"@atlaskit/editor-common": "^112.2.0",
|
|
52
52
|
"react": "^18.2.0",
|
|
53
53
|
"react-dom": "^18.2.0",
|
|
54
54
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -90,6 +90,9 @@
|
|
|
90
90
|
}
|
|
91
91
|
},
|
|
92
92
|
"platform-feature-flags": {
|
|
93
|
+
"platform_editor_element_browser_analytic": {
|
|
94
|
+
"type": "boolean"
|
|
95
|
+
},
|
|
93
96
|
"platform_editor_nested_dnd_styles_changes": {
|
|
94
97
|
"type": "boolean"
|
|
95
98
|
},
|