@atlaskit/editor-plugin-extension 9.1.0 → 9.1.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
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-extension
|
|
2
2
|
|
|
3
|
+
## 9.1.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`a4e1e3ad335eb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a4e1e3ad335eb) -
|
|
8
|
+
Add editor-plugin-toolbar as a dependency and add a check for it to enable new floating toolbar
|
|
9
|
+
|
|
10
|
+
## 9.1.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [`c28cd65d12c24`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c28cd65d12c24) -
|
|
15
|
+
EDITOR-2447 Bump adf-schema to 51.3.1
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 9.1.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
|
@@ -11,6 +11,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
11
11
|
var _extensions = require("@atlaskit/editor-common/extensions");
|
|
12
12
|
var _messages = _interopRequireDefault(require("@atlaskit/editor-common/messages"));
|
|
13
13
|
var _styles = require("@atlaskit/editor-common/styles");
|
|
14
|
+
var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
|
|
14
15
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
15
16
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
16
17
|
var _contentWidthNarrow = _interopRequireDefault(require("@atlaskit/icon/core/content-width-narrow"));
|
|
@@ -178,14 +179,16 @@ var breakoutDropdownOptions = function breakoutDropdownOptions(state, formatMess
|
|
|
178
179
|
}
|
|
179
180
|
}];
|
|
180
181
|
};
|
|
181
|
-
var breakoutOptions = function breakoutOptions(state, formatMessage, extensionState, breakoutEnabled, editorAnalyticsAPI) {
|
|
182
|
-
return (0,
|
|
182
|
+
var breakoutOptions = function breakoutOptions(state, formatMessage, extensionState, breakoutEnabled, editorAnalyticsAPI, api) {
|
|
183
|
+
return (0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean(api === null || api === void 0 ? void 0 : api.toolbar)) ? breakoutDropdownOptions(state, formatMessage, breakoutEnabled, editorAnalyticsAPI) : breakoutButtonListOptions(state, formatMessage, extensionState, breakoutEnabled, editorAnalyticsAPI);
|
|
183
184
|
};
|
|
184
185
|
var editButton = function editButton(formatMessage, extensionState, applyChangeToContextPanel, editorAnalyticsAPI) {
|
|
185
186
|
var isDisabled = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
187
|
+
var api = arguments.length > 5 ? arguments[5] : undefined;
|
|
186
188
|
if (!extensionState.showEditButton) {
|
|
187
189
|
return [];
|
|
188
190
|
}
|
|
191
|
+
var toolbarFlagsEnabled = (0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
|
|
189
192
|
var editButtonItems = [{
|
|
190
193
|
id: 'editor.extension.edit',
|
|
191
194
|
type: 'button',
|
|
@@ -206,7 +209,7 @@ var editButton = function editButton(formatMessage, extensionState, applyChangeT
|
|
|
206
209
|
disabled: isDisabled,
|
|
207
210
|
isRadioButton: (0, _expValEquals.expValEquals)('platform_editor_august_a11y', 'isEnabled', true) ? false : undefined
|
|
208
211
|
}];
|
|
209
|
-
if (
|
|
212
|
+
if (toolbarFlagsEnabled) {
|
|
210
213
|
editButtonItems.push({
|
|
211
214
|
type: 'separator',
|
|
212
215
|
fullHeight: true
|
|
@@ -270,8 +273,8 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig(_ref
|
|
|
270
273
|
return;
|
|
271
274
|
}
|
|
272
275
|
var nodeType = [state.schema.nodes.extension, state.schema.nodes.inlineExtension, state.schema.nodes.bodiedExtension, state.schema.nodes.multiBodiedExtension];
|
|
273
|
-
var editButtonItems = editButton(formatMessage, extensionState, applyChangeToContextPanel, editorAnalyticsAPI, (0, _experiments.editorExperiment)('platform_editor_offline_editing_web', true) && (extensionApi === null || extensionApi === void 0 || (_extensionApi$connect = extensionApi.connectivity) === null || _extensionApi$connect === void 0 || (_extensionApi$connect = _extensionApi$connect.sharedState) === null || _extensionApi$connect === void 0 || (_extensionApi$connect = _extensionApi$connect.currentState()) === null || _extensionApi$connect === void 0 ? void 0 : _extensionApi$connect.mode) === 'offline');
|
|
274
|
-
var breakoutItems = breakoutOptions(state, formatMessage, extensionState, breakoutEnabled, editorAnalyticsAPI);
|
|
276
|
+
var editButtonItems = editButton(formatMessage, extensionState, applyChangeToContextPanel, editorAnalyticsAPI, (0, _experiments.editorExperiment)('platform_editor_offline_editing_web', true) && (extensionApi === null || extensionApi === void 0 || (_extensionApi$connect = extensionApi.connectivity) === null || _extensionApi$connect === void 0 || (_extensionApi$connect = _extensionApi$connect.sharedState) === null || _extensionApi$connect === void 0 || (_extensionApi$connect = _extensionApi$connect.currentState()) === null || _extensionApi$connect === void 0 ? void 0 : _extensionApi$connect.mode) === 'offline', extensionApi);
|
|
277
|
+
var breakoutItems = breakoutOptions(state, formatMessage, extensionState, breakoutEnabled, editorAnalyticsAPI, extensionApi);
|
|
275
278
|
var extensionObj = (0, _utils3.getSelectedExtension)(state, true);
|
|
276
279
|
|
|
277
280
|
// Check if we need to show confirm dialog for delete button
|
|
@@ -3,6 +3,7 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
3
3
|
import { messages } 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
|
+
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
6
7
|
import { getChildrenInfo, getNodeName, isReferencedSource } from '@atlaskit/editor-common/utils';
|
|
7
8
|
import { findParentNodeOfType, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
8
9
|
import ContentWidthNarrowIcon from '@atlaskit/icon/core/content-width-narrow';
|
|
@@ -177,13 +178,14 @@ const breakoutDropdownOptions = (state, formatMessage, breakoutEnabled, editorAn
|
|
|
177
178
|
})
|
|
178
179
|
}];
|
|
179
180
|
};
|
|
180
|
-
const breakoutOptions = (state, formatMessage, extensionState, breakoutEnabled, editorAnalyticsAPI) => {
|
|
181
|
-
return
|
|
181
|
+
const breakoutOptions = (state, formatMessage, extensionState, breakoutEnabled, editorAnalyticsAPI, api) => {
|
|
182
|
+
return areToolbarFlagsEnabled(Boolean(api === null || api === void 0 ? void 0 : api.toolbar)) ? breakoutDropdownOptions(state, formatMessage, breakoutEnabled, editorAnalyticsAPI) : breakoutButtonListOptions(state, formatMessage, extensionState, breakoutEnabled, editorAnalyticsAPI);
|
|
182
183
|
};
|
|
183
|
-
const editButton = (formatMessage, extensionState, applyChangeToContextPanel, editorAnalyticsAPI, isDisabled = false) => {
|
|
184
|
+
const editButton = (formatMessage, extensionState, applyChangeToContextPanel, editorAnalyticsAPI, isDisabled = false, api) => {
|
|
184
185
|
if (!extensionState.showEditButton) {
|
|
185
186
|
return [];
|
|
186
187
|
}
|
|
188
|
+
const toolbarFlagsEnabled = areToolbarFlagsEnabled(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
|
|
187
189
|
const editButtonItems = [{
|
|
188
190
|
id: 'editor.extension.edit',
|
|
189
191
|
type: 'button',
|
|
@@ -205,7 +207,7 @@ const editButton = (formatMessage, extensionState, applyChangeToContextPanel, ed
|
|
|
205
207
|
disabled: isDisabled,
|
|
206
208
|
isRadioButton: expValEquals('platform_editor_august_a11y', 'isEnabled', true) ? false : undefined
|
|
207
209
|
}];
|
|
208
|
-
if (
|
|
210
|
+
if (toolbarFlagsEnabled) {
|
|
209
211
|
editButtonItems.push({
|
|
210
212
|
type: 'separator',
|
|
211
213
|
fullHeight: true
|
|
@@ -273,8 +275,8 @@ export const getToolbarConfig = ({
|
|
|
273
275
|
return;
|
|
274
276
|
}
|
|
275
277
|
const nodeType = [state.schema.nodes.extension, state.schema.nodes.inlineExtension, state.schema.nodes.bodiedExtension, state.schema.nodes.multiBodiedExtension];
|
|
276
|
-
const editButtonItems = editButton(formatMessage, extensionState, applyChangeToContextPanel, editorAnalyticsAPI, editorExperiment('platform_editor_offline_editing_web', true) && (extensionApi === null || extensionApi === void 0 ? void 0 : (_extensionApi$connect = extensionApi.connectivity) === null || _extensionApi$connect === void 0 ? void 0 : (_extensionApi$connect2 = _extensionApi$connect.sharedState) === null || _extensionApi$connect2 === void 0 ? void 0 : (_extensionApi$connect3 = _extensionApi$connect2.currentState()) === null || _extensionApi$connect3 === void 0 ? void 0 : _extensionApi$connect3.mode) === 'offline');
|
|
277
|
-
const breakoutItems = breakoutOptions(state, formatMessage, extensionState, breakoutEnabled, editorAnalyticsAPI);
|
|
278
|
+
const editButtonItems = editButton(formatMessage, extensionState, applyChangeToContextPanel, editorAnalyticsAPI, editorExperiment('platform_editor_offline_editing_web', true) && (extensionApi === null || extensionApi === void 0 ? void 0 : (_extensionApi$connect = extensionApi.connectivity) === null || _extensionApi$connect === void 0 ? void 0 : (_extensionApi$connect2 = _extensionApi$connect.sharedState) === null || _extensionApi$connect2 === void 0 ? void 0 : (_extensionApi$connect3 = _extensionApi$connect2.currentState()) === null || _extensionApi$connect3 === void 0 ? void 0 : _extensionApi$connect3.mode) === 'offline', extensionApi);
|
|
279
|
+
const breakoutItems = breakoutOptions(state, formatMessage, extensionState, breakoutEnabled, editorAnalyticsAPI, extensionApi);
|
|
278
280
|
const extensionObj = getSelectedExtension(state, true);
|
|
279
281
|
|
|
280
282
|
// Check if we need to show confirm dialog for delete button
|
|
@@ -4,6 +4,7 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
4
4
|
import { messages } from '@atlaskit/editor-common/extensions';
|
|
5
5
|
import commonMessages from '@atlaskit/editor-common/messages';
|
|
6
6
|
import { BODIED_EXT_MBE_MARGIN_TOP } from '@atlaskit/editor-common/styles';
|
|
7
|
+
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
7
8
|
import { getChildrenInfo as _getChildrenInfo, getNodeName, isReferencedSource } from '@atlaskit/editor-common/utils';
|
|
8
9
|
import { findParentNodeOfType, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
9
10
|
import ContentWidthNarrowIcon from '@atlaskit/icon/core/content-width-narrow';
|
|
@@ -172,14 +173,16 @@ var breakoutDropdownOptions = function breakoutDropdownOptions(state, formatMess
|
|
|
172
173
|
}
|
|
173
174
|
}];
|
|
174
175
|
};
|
|
175
|
-
var breakoutOptions = function breakoutOptions(state, formatMessage, extensionState, breakoutEnabled, editorAnalyticsAPI) {
|
|
176
|
-
return
|
|
176
|
+
var breakoutOptions = function breakoutOptions(state, formatMessage, extensionState, breakoutEnabled, editorAnalyticsAPI, api) {
|
|
177
|
+
return areToolbarFlagsEnabled(Boolean(api === null || api === void 0 ? void 0 : api.toolbar)) ? breakoutDropdownOptions(state, formatMessage, breakoutEnabled, editorAnalyticsAPI) : breakoutButtonListOptions(state, formatMessage, extensionState, breakoutEnabled, editorAnalyticsAPI);
|
|
177
178
|
};
|
|
178
179
|
var editButton = function editButton(formatMessage, extensionState, applyChangeToContextPanel, editorAnalyticsAPI) {
|
|
179
180
|
var isDisabled = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
|
181
|
+
var api = arguments.length > 5 ? arguments[5] : undefined;
|
|
180
182
|
if (!extensionState.showEditButton) {
|
|
181
183
|
return [];
|
|
182
184
|
}
|
|
185
|
+
var toolbarFlagsEnabled = areToolbarFlagsEnabled(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
|
|
183
186
|
var editButtonItems = [{
|
|
184
187
|
id: 'editor.extension.edit',
|
|
185
188
|
type: 'button',
|
|
@@ -200,7 +203,7 @@ var editButton = function editButton(formatMessage, extensionState, applyChangeT
|
|
|
200
203
|
disabled: isDisabled,
|
|
201
204
|
isRadioButton: expValEquals('platform_editor_august_a11y', 'isEnabled', true) ? false : undefined
|
|
202
205
|
}];
|
|
203
|
-
if (
|
|
206
|
+
if (toolbarFlagsEnabled) {
|
|
204
207
|
editButtonItems.push({
|
|
205
208
|
type: 'separator',
|
|
206
209
|
fullHeight: true
|
|
@@ -264,8 +267,8 @@ export var getToolbarConfig = function getToolbarConfig(_ref) {
|
|
|
264
267
|
return;
|
|
265
268
|
}
|
|
266
269
|
var nodeType = [state.schema.nodes.extension, state.schema.nodes.inlineExtension, state.schema.nodes.bodiedExtension, state.schema.nodes.multiBodiedExtension];
|
|
267
|
-
var editButtonItems = editButton(formatMessage, extensionState, applyChangeToContextPanel, editorAnalyticsAPI, editorExperiment('platform_editor_offline_editing_web', true) && (extensionApi === null || extensionApi === void 0 || (_extensionApi$connect = extensionApi.connectivity) === null || _extensionApi$connect === void 0 || (_extensionApi$connect = _extensionApi$connect.sharedState) === null || _extensionApi$connect === void 0 || (_extensionApi$connect = _extensionApi$connect.currentState()) === null || _extensionApi$connect === void 0 ? void 0 : _extensionApi$connect.mode) === 'offline');
|
|
268
|
-
var breakoutItems = breakoutOptions(state, formatMessage, extensionState, breakoutEnabled, editorAnalyticsAPI);
|
|
270
|
+
var editButtonItems = editButton(formatMessage, extensionState, applyChangeToContextPanel, editorAnalyticsAPI, editorExperiment('platform_editor_offline_editing_web', true) && (extensionApi === null || extensionApi === void 0 || (_extensionApi$connect = extensionApi.connectivity) === null || _extensionApi$connect === void 0 || (_extensionApi$connect = _extensionApi$connect.sharedState) === null || _extensionApi$connect === void 0 || (_extensionApi$connect = _extensionApi$connect.currentState()) === null || _extensionApi$connect === void 0 ? void 0 : _extensionApi$connect.mode) === 'offline', extensionApi);
|
|
271
|
+
var breakoutItems = breakoutOptions(state, formatMessage, extensionState, breakoutEnabled, editorAnalyticsAPI, extensionApi);
|
|
269
272
|
var extensionObj = getSelectedExtension(state, true);
|
|
270
273
|
|
|
271
274
|
// Check if we need to show confirm dialog for delete button
|
|
@@ -10,6 +10,7 @@ import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugin-context-id
|
|
|
10
10
|
import type { ApplyChangeHandler, ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
|
|
11
11
|
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
12
12
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
13
|
+
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
|
|
13
14
|
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
14
15
|
import type { Fragment, Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
15
16
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -73,7 +74,8 @@ export type ExtensionPluginDependencies = [
|
|
|
73
74
|
DecorationsPlugin,
|
|
74
75
|
OptionalPlugin<ContextPanelPlugin>,
|
|
75
76
|
OptionalPlugin<ContextIdentifierPlugin>,
|
|
76
|
-
OptionalPlugin<ConnectivityPlugin
|
|
77
|
+
OptionalPlugin<ConnectivityPlugin>,
|
|
78
|
+
OptionalPlugin<ToolbarPlugin>
|
|
77
79
|
];
|
|
78
80
|
export type ExtensionPluginActions = {
|
|
79
81
|
api: () => ExtensionAPI;
|
|
@@ -10,6 +10,7 @@ import type { ContextIdentifierPlugin } from '@atlaskit/editor-plugin-context-id
|
|
|
10
10
|
import type { ApplyChangeHandler, ContextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
|
|
11
11
|
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
12
12
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
13
|
+
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
|
|
13
14
|
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
14
15
|
import type { Fragment, Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
15
16
|
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -73,7 +74,8 @@ export type ExtensionPluginDependencies = [
|
|
|
73
74
|
DecorationsPlugin,
|
|
74
75
|
OptionalPlugin<ContextPanelPlugin>,
|
|
75
76
|
OptionalPlugin<ContextIdentifierPlugin>,
|
|
76
|
-
OptionalPlugin<ConnectivityPlugin
|
|
77
|
+
OptionalPlugin<ConnectivityPlugin>,
|
|
78
|
+
OptionalPlugin<ToolbarPlugin>
|
|
77
79
|
];
|
|
78
80
|
export type ExtensionPluginActions = {
|
|
79
81
|
api: () => ExtensionAPI;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-extension",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.2",
|
|
4
4
|
"description": "editor-plugin-extension plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
],
|
|
22
22
|
"atlaskit:src": "src/index.ts",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@atlaskit/adf-schema": "^51.3.
|
|
24
|
+
"@atlaskit/adf-schema": "^51.3.1",
|
|
25
25
|
"@atlaskit/adf-utils": "^19.25.0",
|
|
26
26
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
27
|
-
"@atlaskit/avatar": "^25.
|
|
27
|
+
"@atlaskit/avatar": "^25.5.0",
|
|
28
28
|
"@atlaskit/button": "^23.5.0",
|
|
29
29
|
"@atlaskit/checkbox": "^17.1.0",
|
|
30
30
|
"@atlaskit/datetime-picker": "^17.1.0",
|
|
@@ -35,9 +35,10 @@
|
|
|
35
35
|
"@atlaskit/editor-plugin-context-panel": "^8.0.0",
|
|
36
36
|
"@atlaskit/editor-plugin-decorations": "^6.1.0",
|
|
37
37
|
"@atlaskit/editor-plugin-feature-flags": "^5.0.0",
|
|
38
|
+
"@atlaskit/editor-plugin-toolbar": "^3.4.0",
|
|
38
39
|
"@atlaskit/editor-plugin-width": "^7.0.0",
|
|
39
40
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
40
|
-
"@atlaskit/editor-shared-styles": "^3.
|
|
41
|
+
"@atlaskit/editor-shared-styles": "^3.8.0",
|
|
41
42
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
42
43
|
"@atlaskit/empty-state": "^10.1.0",
|
|
43
44
|
"@atlaskit/form": "^14.2.0",
|
|
@@ -55,10 +56,10 @@
|
|
|
55
56
|
"@atlaskit/textarea": "^8.0.0",
|
|
56
57
|
"@atlaskit/textfield": "^8.0.0",
|
|
57
58
|
"@atlaskit/theme": "^21.0.0",
|
|
58
|
-
"@atlaskit/tmp-editor-statsig": "^13.
|
|
59
|
+
"@atlaskit/tmp-editor-statsig": "^13.18.0",
|
|
59
60
|
"@atlaskit/toggle": "^15.1.0",
|
|
60
61
|
"@atlaskit/tokens": "^7.0.0",
|
|
61
|
-
"@atlaskit/tooltip": "^20.
|
|
62
|
+
"@atlaskit/tooltip": "^20.6.0",
|
|
62
63
|
"@babel/runtime": "^7.0.0",
|
|
63
64
|
"@emotion/react": "^11.7.1",
|
|
64
65
|
"bind-event-listener": "^3.0.0",
|
|
@@ -69,7 +70,7 @@
|
|
|
69
70
|
"uuid": "^3.1.0"
|
|
70
71
|
},
|
|
71
72
|
"peerDependencies": {
|
|
72
|
-
"@atlaskit/editor-common": "^110.
|
|
73
|
+
"@atlaskit/editor-common": "^110.18.0",
|
|
73
74
|
"react": "^18.2.0",
|
|
74
75
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
75
76
|
},
|