@atlaskit/editor-plugin-layout 7.0.0 → 7.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 +14 -0
- package/dist/cjs/layoutPlugin.js +6 -1
- package/dist/cjs/ui/LayoutBlockMenuItem.js +0 -5
- package/dist/es2019/layoutPlugin.js +6 -1
- package/dist/es2019/ui/LayoutBlockMenuItem.js +0 -5
- package/dist/esm/layoutPlugin.js +6 -1
- package/dist/esm/ui/LayoutBlockMenuItem.js +0 -5
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-layout
|
|
2
2
|
|
|
3
|
+
## 7.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b909e5f47ea91`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b909e5f47ea91) -
|
|
8
|
+
EDITOR-4159 Make sure block-menu-item type component return null when tranform disabled
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 7.0.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 7.0.0
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/cjs/layoutPlugin.js
CHANGED
|
@@ -24,6 +24,7 @@ var _resizing = _interopRequireDefault(require("./pm-plugins/resizing"));
|
|
|
24
24
|
var _globalStyles = require("./ui/global-styles");
|
|
25
25
|
var _LayoutBlockMenuItem = require("./ui/LayoutBlockMenuItem");
|
|
26
26
|
var _toolbar = require("./ui/toolbar");
|
|
27
|
+
var LAYOUT_SECTION_NODE_NAME = 'layoutSection';
|
|
27
28
|
/**
|
|
28
29
|
* This function is used to set the selection into
|
|
29
30
|
* the first paragraph of the first column of a layout section.
|
|
@@ -69,7 +70,11 @@ var layoutPlugin = exports.layoutPlugin = function layoutPlugin(_ref) {
|
|
|
69
70
|
key: _blockMenu.TRANSFORM_STRUCTURE_MENU_SECTION.key,
|
|
70
71
|
rank: _blockMenu.TRANSFORM_STRUCTURE_MENU_SECTION_RANK[_blockMenu.TRANSFORM_STRUCTURE_LAYOUT_MENU_ITEM.key]
|
|
71
72
|
},
|
|
72
|
-
component: (0, _LayoutBlockMenuItem.createLayoutBlockMenuItem)(api)
|
|
73
|
+
component: (0, _LayoutBlockMenuItem.createLayoutBlockMenuItem)(api),
|
|
74
|
+
isHidden: function isHidden() {
|
|
75
|
+
var _api$blockMenu2;
|
|
76
|
+
return Boolean(api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(LAYOUT_SECTION_NODE_NAME));
|
|
77
|
+
}
|
|
73
78
|
}]);
|
|
74
79
|
}
|
|
75
80
|
return {
|
|
@@ -13,7 +13,6 @@ var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
|
13
13
|
var _layoutTwoColumns = _interopRequireDefault(require("@atlaskit/icon/core/layout-two-columns"));
|
|
14
14
|
var NODE_NAME = 'layoutSection';
|
|
15
15
|
var LayoutBlockMenuItem = function LayoutBlockMenuItem(_ref) {
|
|
16
|
-
var _api$blockMenu2;
|
|
17
16
|
var api = _ref.api;
|
|
18
17
|
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
19
18
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -33,10 +32,6 @@ var LayoutBlockMenuItem = function LayoutBlockMenuItem(_ref) {
|
|
|
33
32
|
}) : null;
|
|
34
33
|
});
|
|
35
34
|
};
|
|
36
|
-
var isTransfromToPanelDisabled = api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(NODE_NAME);
|
|
37
|
-
if (isTransfromToPanelDisabled) {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
35
|
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
|
|
41
36
|
onClick: handleClick,
|
|
42
37
|
elemBefore: /*#__PURE__*/_react.default.createElement(_layoutTwoColumns.default, {
|
|
@@ -10,6 +10,7 @@ import { findParentNode } from '@atlaskit/editor-prosemirror/utils';
|
|
|
10
10
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
11
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
12
12
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
13
|
+
const LAYOUT_SECTION_NODE_NAME = 'layoutSection';
|
|
13
14
|
import { createDefaultLayoutSection, createMultiColumnLayoutSection, insertLayoutColumnsWithAnalytics } from './pm-plugins/actions';
|
|
14
15
|
import { default as createLayoutPlugin } from './pm-plugins/main';
|
|
15
16
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
@@ -62,7 +63,11 @@ export const layoutPlugin = ({
|
|
|
62
63
|
key: TRANSFORM_STRUCTURE_MENU_SECTION.key,
|
|
63
64
|
rank: TRANSFORM_STRUCTURE_MENU_SECTION_RANK[TRANSFORM_STRUCTURE_LAYOUT_MENU_ITEM.key]
|
|
64
65
|
},
|
|
65
|
-
component: createLayoutBlockMenuItem(api)
|
|
66
|
+
component: createLayoutBlockMenuItem(api),
|
|
67
|
+
isHidden: () => {
|
|
68
|
+
var _api$blockMenu2;
|
|
69
|
+
return Boolean(api === null || api === void 0 ? void 0 : (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(LAYOUT_SECTION_NODE_NAME));
|
|
70
|
+
}
|
|
66
71
|
}]);
|
|
67
72
|
}
|
|
68
73
|
return {
|
|
@@ -8,7 +8,6 @@ const NODE_NAME = 'layoutSection';
|
|
|
8
8
|
const LayoutBlockMenuItem = ({
|
|
9
9
|
api
|
|
10
10
|
}) => {
|
|
11
|
-
var _api$blockMenu2;
|
|
12
11
|
const {
|
|
13
12
|
formatMessage
|
|
14
13
|
} = useIntl();
|
|
@@ -29,10 +28,6 @@ const LayoutBlockMenuItem = ({
|
|
|
29
28
|
}) : null;
|
|
30
29
|
});
|
|
31
30
|
};
|
|
32
|
-
const isTransfromToPanelDisabled = api === null || api === void 0 ? void 0 : (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(NODE_NAME);
|
|
33
|
-
if (isTransfromToPanelDisabled) {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
31
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
37
32
|
onClick: handleClick,
|
|
38
33
|
elemBefore: /*#__PURE__*/React.createElement(LayoutTwoColumnsIcon, {
|
package/dist/esm/layoutPlugin.js
CHANGED
|
@@ -10,6 +10,7 @@ import { findParentNode } from '@atlaskit/editor-prosemirror/utils';
|
|
|
10
10
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
11
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
12
12
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
13
|
+
var LAYOUT_SECTION_NODE_NAME = 'layoutSection';
|
|
13
14
|
import { createDefaultLayoutSection, createMultiColumnLayoutSection, insertLayoutColumnsWithAnalytics } from './pm-plugins/actions';
|
|
14
15
|
import { default as createLayoutPlugin } from './pm-plugins/main';
|
|
15
16
|
import { pluginKey } from './pm-plugins/plugin-key';
|
|
@@ -63,7 +64,11 @@ export var layoutPlugin = function layoutPlugin(_ref) {
|
|
|
63
64
|
key: TRANSFORM_STRUCTURE_MENU_SECTION.key,
|
|
64
65
|
rank: TRANSFORM_STRUCTURE_MENU_SECTION_RANK[TRANSFORM_STRUCTURE_LAYOUT_MENU_ITEM.key]
|
|
65
66
|
},
|
|
66
|
-
component: createLayoutBlockMenuItem(api)
|
|
67
|
+
component: createLayoutBlockMenuItem(api),
|
|
68
|
+
isHidden: function isHidden() {
|
|
69
|
+
var _api$blockMenu2;
|
|
70
|
+
return Boolean(api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(LAYOUT_SECTION_NODE_NAME));
|
|
71
|
+
}
|
|
67
72
|
}]);
|
|
68
73
|
}
|
|
69
74
|
return {
|
|
@@ -6,7 +6,6 @@ import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
|
6
6
|
import LayoutTwoColumnsIcon from '@atlaskit/icon/core/layout-two-columns';
|
|
7
7
|
var NODE_NAME = 'layoutSection';
|
|
8
8
|
var LayoutBlockMenuItem = function LayoutBlockMenuItem(_ref) {
|
|
9
|
-
var _api$blockMenu2;
|
|
10
9
|
var api = _ref.api;
|
|
11
10
|
var _useIntl = useIntl(),
|
|
12
11
|
formatMessage = _useIntl.formatMessage;
|
|
@@ -26,10 +25,6 @@ var LayoutBlockMenuItem = function LayoutBlockMenuItem(_ref) {
|
|
|
26
25
|
}) : null;
|
|
27
26
|
});
|
|
28
27
|
};
|
|
29
|
-
var isTransfromToPanelDisabled = api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(NODE_NAME);
|
|
30
|
-
if (isTransfromToPanelDisabled) {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
28
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
34
29
|
onClick: handleClick,
|
|
35
30
|
elemBefore: /*#__PURE__*/React.createElement(LayoutTwoColumnsIcon, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-layout",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.2",
|
|
4
4
|
"description": "Layout plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -41,17 +41,17 @@
|
|
|
41
41
|
"@atlaskit/editor-plugin-width": "^8.0.0",
|
|
42
42
|
"@atlaskit/editor-prosemirror": "^7.2.0",
|
|
43
43
|
"@atlaskit/editor-shared-styles": "^3.10.0",
|
|
44
|
-
"@atlaskit/editor-toolbar": "^0.
|
|
45
|
-
"@atlaskit/icon": "^29.
|
|
46
|
-
"@atlaskit/icon-lab": "^5.
|
|
44
|
+
"@atlaskit/editor-toolbar": "^0.19.0",
|
|
45
|
+
"@atlaskit/icon": "^29.4.0",
|
|
46
|
+
"@atlaskit/icon-lab": "^5.14.0",
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
48
|
-
"@atlaskit/tmp-editor-statsig": "^16.
|
|
49
|
-
"@atlaskit/tokens": "^9.
|
|
48
|
+
"@atlaskit/tmp-editor-statsig": "^16.11.0",
|
|
49
|
+
"@atlaskit/tokens": "^9.1.0",
|
|
50
50
|
"@babel/runtime": "^7.0.0",
|
|
51
51
|
"@emotion/react": "^11.7.1"
|
|
52
52
|
},
|
|
53
53
|
"peerDependencies": {
|
|
54
|
-
"@atlaskit/editor-common": "^111.
|
|
54
|
+
"@atlaskit/editor-common": "^111.7.0",
|
|
55
55
|
"react": "^18.2.0",
|
|
56
56
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
57
57
|
},
|