@atlaskit/editor-plugin-layout 6.1.4 → 6.2.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
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-layout
|
|
2
2
|
|
|
3
|
+
## 6.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`50292b8ecd09e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/50292b8ecd09e) -
|
|
8
|
+
Add @atlaskit/editor-toolbar-plugin as an optional dependency and enable overflow menu
|
|
9
|
+
|
|
3
10
|
## 6.1.4
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/dist/cjs/ui/toolbar.js
CHANGED
|
@@ -11,6 +11,7 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
11
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
12
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
13
13
|
var _messages = _interopRequireWildcard(require("@atlaskit/editor-common/messages"));
|
|
14
|
+
var _toolbarFlagCheck = require("@atlaskit/editor-common/toolbar-flag-check");
|
|
14
15
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
15
16
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
16
17
|
var _copy = _interopRequireDefault(require("@atlaskit/icon/core/copy"));
|
|
@@ -222,6 +223,7 @@ var buildToolbar = exports.buildToolbar = function buildToolbar(state, intl, pos
|
|
|
222
223
|
hoverDecoration = _ref2.hoverDecoration;
|
|
223
224
|
var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
224
225
|
var node = state.doc.nodeAt(pos);
|
|
226
|
+
var toolbarFlagsEnabled = (0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
|
|
225
227
|
if (node) {
|
|
226
228
|
var currentLayout = (0, _actions.getPresetLayout)(node);
|
|
227
229
|
var separator = {
|
|
@@ -309,7 +311,7 @@ var buildToolbar = exports.buildToolbar = function buildToolbar(state, intl, pos
|
|
|
309
311
|
return buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI);
|
|
310
312
|
})), (0, _toConsumableArray2.default)(addSidebarLayouts ? SIDEBAR_LAYOUT_TYPES.map(function (i) {
|
|
311
313
|
return buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI);
|
|
312
|
-
}) : []))), (0, _toConsumableArray2.default)(
|
|
314
|
+
}) : []))), (0, _toConsumableArray2.default)(toolbarFlagsEnabled ? [fullHeightSeparator, overflowMenu] : [separator, copyButton, separator, deleteButton])),
|
|
313
315
|
scrollable: true
|
|
314
316
|
};
|
|
315
317
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
3
3
|
import commonMessages, { layoutMessages, layoutMessages as toolbarMessages } from '@atlaskit/editor-common/messages';
|
|
4
|
+
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
4
5
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
5
6
|
import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
6
7
|
import CopyIcon from '@atlaskit/icon/core/copy';
|
|
@@ -207,6 +208,7 @@ export const buildToolbar = (state, intl, pos, _allowBreakout, addSidebarLayouts
|
|
|
207
208
|
} = (_api$decorations$acti = api === null || api === void 0 ? void 0 : (_api$decorations = api.decorations) === null || _api$decorations === void 0 ? void 0 : _api$decorations.actions) !== null && _api$decorations$acti !== void 0 ? _api$decorations$acti : {};
|
|
208
209
|
const editorAnalyticsAPI = api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
209
210
|
const node = state.doc.nodeAt(pos);
|
|
211
|
+
const toolbarFlagsEnabled = areToolbarFlagsEnabled(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
|
|
210
212
|
if (node) {
|
|
211
213
|
const currentLayout = getPresetLayout(node);
|
|
212
214
|
const separator = {
|
|
@@ -288,7 +290,7 @@ export const buildToolbar = (state, intl, pos, _allowBreakout, addSidebarLayouts
|
|
|
288
290
|
deleteButton,
|
|
289
291
|
currentLayout,
|
|
290
292
|
allowAdvancedSingleColumnLayout
|
|
291
|
-
}) : [...layoutTypes.map(i => buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI)), ...(addSidebarLayouts ? SIDEBAR_LAYOUT_TYPES.map(i => buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI)) : [])]), ...(
|
|
293
|
+
}) : [...layoutTypes.map(i => buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI)), ...(addSidebarLayouts ? SIDEBAR_LAYOUT_TYPES.map(i => buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI)) : [])]), ...(toolbarFlagsEnabled ? [fullHeightSeparator, overflowMenu] : [separator, copyButton, separator, deleteButton])],
|
|
292
294
|
scrollable: true
|
|
293
295
|
};
|
|
294
296
|
}
|
package/dist/esm/ui/toolbar.js
CHANGED
|
@@ -5,6 +5,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
7
7
|
import commonMessages, { layoutMessages, layoutMessages as toolbarMessages } from '@atlaskit/editor-common/messages';
|
|
8
|
+
import { areToolbarFlagsEnabled } from '@atlaskit/editor-common/toolbar-flag-check';
|
|
8
9
|
import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
|
|
9
10
|
import { akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
10
11
|
import CopyIcon from '@atlaskit/icon/core/copy';
|
|
@@ -213,6 +214,7 @@ export var buildToolbar = function buildToolbar(state, intl, pos, _allowBreakout
|
|
|
213
214
|
hoverDecoration = _ref2.hoverDecoration;
|
|
214
215
|
var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
|
|
215
216
|
var node = state.doc.nodeAt(pos);
|
|
217
|
+
var toolbarFlagsEnabled = areToolbarFlagsEnabled(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
|
|
216
218
|
if (node) {
|
|
217
219
|
var currentLayout = getPresetLayout(node);
|
|
218
220
|
var separator = {
|
|
@@ -300,7 +302,7 @@ export var buildToolbar = function buildToolbar(state, intl, pos, _allowBreakout
|
|
|
300
302
|
return buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI);
|
|
301
303
|
})), _toConsumableArray(addSidebarLayouts ? SIDEBAR_LAYOUT_TYPES.map(function (i) {
|
|
302
304
|
return buildLayoutButton(intl, i, currentLayout, editorAnalyticsAPI);
|
|
303
|
-
}) : []))), _toConsumableArray(
|
|
305
|
+
}) : []))), _toConsumableArray(toolbarFlagsEnabled ? [fullHeightSeparator, overflowMenu] : [separator, copyButton, separator, deleteButton])),
|
|
304
306
|
scrollable: true
|
|
305
307
|
};
|
|
306
308
|
}
|
|
@@ -6,6 +6,7 @@ import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabl
|
|
|
6
6
|
import type { GuidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
7
7
|
import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
|
|
8
8
|
import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
9
|
+
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
|
|
9
10
|
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
10
11
|
import type { insertLayoutColumnsWithAnalytics } from './pm-plugins/actions';
|
|
11
12
|
import type { LayoutPluginOptions } from './types';
|
|
@@ -17,7 +18,8 @@ export type LayoutPluginDependencies = [
|
|
|
17
18
|
OptionalPlugin<EditorDisabledPlugin>,
|
|
18
19
|
OptionalPlugin<GuidelinePlugin>,
|
|
19
20
|
OptionalPlugin<InteractionPlugin>,
|
|
20
|
-
OptionalPlugin<BlockMenuPlugin
|
|
21
|
+
OptionalPlugin<BlockMenuPlugin>,
|
|
22
|
+
OptionalPlugin<ToolbarPlugin>
|
|
21
23
|
];
|
|
22
24
|
export type LayoutPlugin = NextEditorPlugin<'layout', {
|
|
23
25
|
actions: {
|
|
@@ -6,6 +6,7 @@ import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabl
|
|
|
6
6
|
import type { GuidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
7
7
|
import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
|
|
8
8
|
import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
9
|
+
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
|
|
9
10
|
import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
|
|
10
11
|
import type { insertLayoutColumnsWithAnalytics } from './pm-plugins/actions';
|
|
11
12
|
import type { LayoutPluginOptions } from './types';
|
|
@@ -17,7 +18,8 @@ export type LayoutPluginDependencies = [
|
|
|
17
18
|
OptionalPlugin<EditorDisabledPlugin>,
|
|
18
19
|
OptionalPlugin<GuidelinePlugin>,
|
|
19
20
|
OptionalPlugin<InteractionPlugin>,
|
|
20
|
-
OptionalPlugin<BlockMenuPlugin
|
|
21
|
+
OptionalPlugin<BlockMenuPlugin>,
|
|
22
|
+
OptionalPlugin<ToolbarPlugin>
|
|
21
23
|
];
|
|
22
24
|
export type LayoutPlugin = NextEditorPlugin<'layout', {
|
|
23
25
|
actions: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-layout",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "Layout plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"@atlaskit/editor-plugin-guideline": "^6.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-interaction": "^9.0.0",
|
|
39
39
|
"@atlaskit/editor-plugin-selection": "^6.1.0",
|
|
40
|
+
"@atlaskit/editor-plugin-toolbar": "^3.4.0",
|
|
40
41
|
"@atlaskit/editor-plugin-width": "^7.0.0",
|
|
41
42
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
42
43
|
"@atlaskit/editor-shared-styles": "^3.8.0",
|