@atlaskit/editor-plugin-block-type 3.14.2 → 3.14.4
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 +20 -0
- package/dist/cjs/plugin/pm-plugins/main.js +6 -6
- package/dist/cjs/plugin/styles.js +2 -2
- package/dist/cjs/plugin/ui/ToolbarBlockType/blocktype-button.js +10 -2
- package/dist/es2019/plugin/pm-plugins/main.js +1 -1
- package/dist/es2019/plugin/styles.js +2 -2
- package/dist/es2019/plugin/ui/ToolbarBlockType/blocktype-button.js +10 -2
- package/dist/esm/plugin/pm-plugins/main.js +1 -1
- package/dist/esm/plugin/styles.js +2 -2
- package/dist/esm/plugin/ui/ToolbarBlockType/blocktype-button.js +10 -2
- package/package.json +3 -7
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,25 @@
|
|
1
1
|
# @atlaskit/editor-plugin-block-type
|
2
2
|
|
3
|
+
## 3.14.4
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- [#136367](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/136367)
|
8
|
+
[`4d9450a7e1283`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4d9450a7e1283) -
|
9
|
+
[ux] Update new icons (text color, highlight, text style) with design change
|
10
|
+
- [#136348](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/136348)
|
11
|
+
[`fb4fb56f1da7c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fb4fb56f1da7c) -
|
12
|
+
Use optimised entry-points on editor-common for browser.
|
13
|
+
- Updated dependencies
|
14
|
+
|
15
|
+
## 3.14.3
|
16
|
+
|
17
|
+
### Patch Changes
|
18
|
+
|
19
|
+
- [#136078](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/136078)
|
20
|
+
[`09414d7233497`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/09414d7233497) -
|
21
|
+
ED-24507 Switch nested dnd FG to experiment and include padding changes"
|
22
|
+
|
3
23
|
## 3.14.2
|
4
24
|
|
5
25
|
### Patch Changes
|
@@ -7,13 +7,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
7
7
|
exports.pluginKey = exports.createPlugin = void 0;
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
9
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
10
|
+
var _browser = require("@atlaskit/editor-common/browser");
|
10
11
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
11
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
12
12
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
13
13
|
var _blockTypes = require("../block-types");
|
14
14
|
var _commands = require("../commands");
|
15
15
|
var _consts = require("../consts");
|
16
|
-
var
|
16
|
+
var _utils = require("../utils");
|
17
17
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
18
18
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
19
19
|
var blockTypeForNode = function blockTypeForNode(node, schema) {
|
@@ -102,7 +102,7 @@ var createPlugin = exports.createPlugin = function createPlugin(editorAPI, dispa
|
|
102
102
|
});
|
103
103
|
return {
|
104
104
|
currentBlockType: detectBlockType(availableBlockTypes, state),
|
105
|
-
blockTypesDisabled: (0,
|
105
|
+
blockTypesDisabled: (0, _utils.areBlockTypesDisabled)(state),
|
106
106
|
availableBlockTypes: availableBlockTypes,
|
107
107
|
availableWrapperBlockTypes: availableWrapperBlockTypes
|
108
108
|
};
|
@@ -110,7 +110,7 @@ var createPlugin = exports.createPlugin = function createPlugin(editorAPI, dispa
|
|
110
110
|
apply: function apply(_tr, oldPluginState, _oldState, newState) {
|
111
111
|
var newPluginState = _objectSpread(_objectSpread({}, oldPluginState), {}, {
|
112
112
|
currentBlockType: detectBlockType(oldPluginState.availableBlockTypes, newState),
|
113
|
-
blockTypesDisabled: (0,
|
113
|
+
blockTypesDisabled: (0, _utils.areBlockTypesDisabled)(newState)
|
114
114
|
});
|
115
115
|
if (newPluginState.currentBlockType !== oldPluginState.currentBlockType || newPluginState.blockTypesDisabled !== oldPluginState.blockTypesDisabled) {
|
116
116
|
dispatch(pluginKey, newPluginState);
|
@@ -129,10 +129,10 @@ var createPlugin = exports.createPlugin = function createPlugin(editorAPI, dispa
|
|
129
129
|
handleKeyDown: function handleKeyDown(view, event) {
|
130
130
|
var headingLevel = _consts.HEADING_KEYS.indexOf(event.keyCode);
|
131
131
|
if (headingLevel > -1 && event.altKey) {
|
132
|
-
if (
|
132
|
+
if (_browser.browser.mac && event.metaKey) {
|
133
133
|
var _editorAPI$core$actio, _editorAPI$core;
|
134
134
|
return (_editorAPI$core$actio = editorAPI === null || editorAPI === void 0 || (_editorAPI$core = editorAPI.core) === null || _editorAPI$core === void 0 ? void 0 : _editorAPI$core.actions.execute(autoformatHeading(headingLevel, editorAnalyticsApi))) !== null && _editorAPI$core$actio !== void 0 ? _editorAPI$core$actio : false;
|
135
|
-
} else if (!
|
135
|
+
} else if (!_browser.browser.mac && event.ctrlKey && altKeyLocation !== event.DOM_KEY_LOCATION_RIGHT) {
|
136
136
|
var _editorAPI$core$actio2, _editorAPI$core2;
|
137
137
|
return (_editorAPI$core$actio2 = editorAPI === null || editorAPI === void 0 || (_editorAPI$core2 = editorAPI.core) === null || _editorAPI$core2 === void 0 ? void 0 : _editorAPI$core2.actions.execute(autoformatHeading(headingLevel, editorAnalyticsApi))) !== null && _editorAPI$core$actio2 !== void 0 ? _editorAPI$core$actio2 : false;
|
138
138
|
}
|
@@ -8,9 +8,9 @@ exports.blocktypeStyles = void 0;
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
9
9
|
var _react = require("@emotion/react");
|
10
10
|
var _styles = require("@atlaskit/editor-common/styles");
|
11
|
-
var
|
11
|
+
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
12
12
|
var _templateObject; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
13
13
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Imports are not safe in an object syntax
|
14
14
|
var blocktypeStyles = exports.blocktypeStyles = function blocktypeStyles() {
|
15
|
-
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\t", ";\n\t\t", ";\n\t}\n"])), (0,
|
15
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\t", ";\n\t\t", ";\n\t}\n"])), (0, _experiments.editorExperiment)('nested-dnd', true) ? _styles.blockquoteSharedStylesNew : _styles.blockquoteSharedStyles, (0, _styles.headingsSharedStyles)());
|
16
16
|
};
|
@@ -12,7 +12,9 @@ var _messages = require("@atlaskit/editor-common/messages");
|
|
12
12
|
var _styles = require("@atlaskit/editor-common/styles");
|
13
13
|
var _uiMenu = require("@atlaskit/editor-common/ui-menu");
|
14
14
|
var _textStyleEditorTextStyle = _interopRequireDefault(require("@atlaskit/icon/core/migration/text-style--editor-text-style"));
|
15
|
+
var _text = _interopRequireDefault(require("@atlaskit/icon/core/text"));
|
15
16
|
var _chevronDown = _interopRequireDefault(require("@atlaskit/icon/utility/migration/chevron-down"));
|
17
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
16
18
|
var _blockTypes = require("../../block-types");
|
17
19
|
var _styled = require("./styled");
|
18
20
|
/**
|
@@ -45,11 +47,17 @@ var BlockTypeButton = exports.BlockTypeButton = function BlockTypeButton(props)
|
|
45
47
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
46
48
|
css: [_styles.wrapperStyle, props.isSmall && _styled.wrapperSmallStyle],
|
47
49
|
"data-testid": "toolbar-block-type-text-styles-icon"
|
48
|
-
}, (0, _react2.jsx)(_react.default.Fragment, null, props.isSmall && (
|
50
|
+
}, (0, _react2.jsx)(_react.default.Fragment, null, props.isSmall && (
|
51
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-registration
|
52
|
+
(0, _platformFeatureFlags.fg)('platform.design-system-team.enable-new-icons') ? (0, _react2.jsx)(_text.default, {
|
49
53
|
label: labelTextStyles,
|
50
54
|
spacing: "spacious",
|
51
55
|
color: "currentColor"
|
52
|
-
})
|
56
|
+
}) : (0, _react2.jsx)(_textStyleEditorTextStyle.default, {
|
57
|
+
color: "currentColor",
|
58
|
+
spacing: "spacious",
|
59
|
+
label: labelTextStyles
|
60
|
+
})), (0, _react2.jsx)("span", {
|
53
61
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
54
62
|
css: _styles.expandIconContainerStyle
|
55
63
|
}, (0, _react2.jsx)(_chevronDown.default, {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
2
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
2
3
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
3
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
4
4
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
5
5
|
import { BLOCK_QUOTE, CODE_BLOCK, HEADING_1, HEADING_2, HEADING_3, HEADING_4, HEADING_5, HEADING_6, HEADINGS_BY_LEVEL, NORMAL_TEXT, OTHER, PANEL, TEXT_BLOCK_TYPES, WRAPPER_BLOCK_TYPES } from '../block-types';
|
6
6
|
import { setHeadingWithAnalytics, setNormalTextWithAnalytics } from '../commands';
|
@@ -1,12 +1,12 @@
|
|
1
1
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
2
2
|
import { css } from '@emotion/react';
|
3
3
|
import { blockquoteSharedStyles, blockquoteSharedStylesNew, headingsSharedStyles } from '@atlaskit/editor-common/styles';
|
4
|
-
import {
|
4
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
5
5
|
|
6
6
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Imports are not safe in an object syntax
|
7
7
|
export const blocktypeStyles = () => css`
|
8
8
|
.ProseMirror {
|
9
|
-
${
|
9
|
+
${editorExperiment('nested-dnd', true) ? blockquoteSharedStylesNew : blockquoteSharedStyles};
|
10
10
|
${headingsSharedStyles()};
|
11
11
|
}
|
12
12
|
`;
|
@@ -11,7 +11,9 @@ import { toolbarMessages } from '@atlaskit/editor-common/messages';
|
|
11
11
|
import { expandIconContainerStyle, wrapperStyle } from '@atlaskit/editor-common/styles';
|
12
12
|
import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
13
13
|
import TextStyleIcon from '@atlaskit/icon/core/migration/text-style--editor-text-style';
|
14
|
+
import TextIcon from '@atlaskit/icon/core/text';
|
14
15
|
import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
|
16
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
15
17
|
import { NORMAL_TEXT } from '../../block-types';
|
16
18
|
import { buttonContentReducedSpacingStyle, buttonContentStyle, wrapperSmallStyle } from './styled';
|
17
19
|
export const BlockTypeButton = props => {
|
@@ -37,11 +39,17 @@ export const BlockTypeButton = props => {
|
|
37
39
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
38
40
|
css: [wrapperStyle, props.isSmall && wrapperSmallStyle],
|
39
41
|
"data-testid": "toolbar-block-type-text-styles-icon"
|
40
|
-
}, jsx(React.Fragment, null, props.isSmall &&
|
42
|
+
}, jsx(React.Fragment, null, props.isSmall && (
|
43
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-registration
|
44
|
+
fg('platform.design-system-team.enable-new-icons') ? jsx(TextIcon, {
|
41
45
|
label: labelTextStyles,
|
42
46
|
spacing: "spacious",
|
43
47
|
color: "currentColor"
|
44
|
-
})
|
48
|
+
}) : jsx(TextStyleIcon, {
|
49
|
+
color: "currentColor",
|
50
|
+
spacing: "spacious",
|
51
|
+
label: labelTextStyles
|
52
|
+
})), jsx("span", {
|
45
53
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
46
54
|
css: expandIconContainerStyle
|
47
55
|
}, jsx(ChevronDownIcon, {
|
@@ -2,8 +2,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
4
4
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
5
|
+
import { browser } from '@atlaskit/editor-common/browser';
|
5
6
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
6
|
-
import { browser } from '@atlaskit/editor-common/utils';
|
7
7
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
8
8
|
import { BLOCK_QUOTE, CODE_BLOCK, HEADING_1, HEADING_2, HEADING_3, HEADING_4, HEADING_5, HEADING_6, HEADINGS_BY_LEVEL, NORMAL_TEXT, OTHER, PANEL, TEXT_BLOCK_TYPES, WRAPPER_BLOCK_TYPES } from '../block-types';
|
9
9
|
import { setHeadingWithAnalytics, setNormalTextWithAnalytics } from '../commands';
|
@@ -3,9 +3,9 @@ var _templateObject;
|
|
3
3
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
4
4
|
import { css } from '@emotion/react';
|
5
5
|
import { blockquoteSharedStyles, blockquoteSharedStylesNew, headingsSharedStyles } from '@atlaskit/editor-common/styles';
|
6
|
-
import {
|
6
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
7
7
|
|
8
8
|
// eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- Imports are not safe in an object syntax
|
9
9
|
export var blocktypeStyles = function blocktypeStyles() {
|
10
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t.ProseMirror {\n\t\t", ";\n\t\t", ";\n\t}\n"])),
|
10
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t.ProseMirror {\n\t\t", ";\n\t\t", ";\n\t}\n"])), editorExperiment('nested-dnd', true) ? blockquoteSharedStylesNew : blockquoteSharedStyles, headingsSharedStyles());
|
11
11
|
};
|
@@ -11,7 +11,9 @@ import { toolbarMessages } from '@atlaskit/editor-common/messages';
|
|
11
11
|
import { expandIconContainerStyle, wrapperStyle } from '@atlaskit/editor-common/styles';
|
12
12
|
import { ToolbarButton } from '@atlaskit/editor-common/ui-menu';
|
13
13
|
import TextStyleIcon from '@atlaskit/icon/core/migration/text-style--editor-text-style';
|
14
|
+
import TextIcon from '@atlaskit/icon/core/text';
|
14
15
|
import ChevronDownIcon from '@atlaskit/icon/utility/migration/chevron-down';
|
16
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
15
17
|
import { NORMAL_TEXT } from '../../block-types';
|
16
18
|
import { buttonContentReducedSpacingStyle, buttonContentStyle, wrapperSmallStyle } from './styled';
|
17
19
|
export var BlockTypeButton = function BlockTypeButton(props) {
|
@@ -37,11 +39,17 @@ export var BlockTypeButton = function BlockTypeButton(props) {
|
|
37
39
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
38
40
|
css: [wrapperStyle, props.isSmall && wrapperSmallStyle],
|
39
41
|
"data-testid": "toolbar-block-type-text-styles-icon"
|
40
|
-
}, jsx(React.Fragment, null, props.isSmall &&
|
42
|
+
}, jsx(React.Fragment, null, props.isSmall && (
|
43
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-registration
|
44
|
+
fg('platform.design-system-team.enable-new-icons') ? jsx(TextIcon, {
|
41
45
|
label: labelTextStyles,
|
42
46
|
spacing: "spacious",
|
43
47
|
color: "currentColor"
|
44
|
-
})
|
48
|
+
}) : jsx(TextStyleIcon, {
|
49
|
+
color: "currentColor",
|
50
|
+
spacing: "spacious",
|
51
|
+
label: labelTextStyles
|
52
|
+
})), jsx("span", {
|
45
53
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
46
54
|
css: expandIconContainerStyle
|
47
55
|
}, jsx(ChevronDownIcon, {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaskit/editor-plugin-block-type",
|
3
|
-
"version": "3.14.
|
3
|
+
"version": "3.14.4",
|
4
4
|
"description": "BlockType plugin for @atlaskit/editor-core",
|
5
5
|
"author": "Atlassian Pty Ltd",
|
6
6
|
"license": "Apache-2.0",
|
@@ -10,8 +10,6 @@
|
|
10
10
|
"atlassian": {
|
11
11
|
"team": "Editor: Lego",
|
12
12
|
"singleton": true,
|
13
|
-
"inPublicMirror": false,
|
14
|
-
"releaseModel": "continuous",
|
15
13
|
"runReact18": false
|
16
14
|
},
|
17
15
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
@@ -36,7 +34,7 @@
|
|
36
34
|
},
|
37
35
|
"dependencies": {
|
38
36
|
"@atlaskit/adf-schema": "^40.9.0",
|
39
|
-
"@atlaskit/editor-common": "^88.
|
37
|
+
"@atlaskit/editor-common": "^88.8.0",
|
40
38
|
"@atlaskit/editor-plugin-analytics": "^1.8.0",
|
41
39
|
"@atlaskit/editor-plugin-primary-toolbar": "^2.0.0",
|
42
40
|
"@atlaskit/editor-prosemirror": "5.0.1",
|
@@ -46,6 +44,7 @@
|
|
46
44
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
47
45
|
"@atlaskit/prosemirror-input-rules": "^3.2.0",
|
48
46
|
"@atlaskit/theme": "^13.0.0",
|
47
|
+
"@atlaskit/tmp-editor-statsig": "*",
|
49
48
|
"@atlaskit/tokens": "^1.59.0",
|
50
49
|
"@babel/runtime": "^7.0.0",
|
51
50
|
"@emotion/react": "^11.7.1"
|
@@ -102,9 +101,6 @@
|
|
102
101
|
}
|
103
102
|
},
|
104
103
|
"platform-feature-flags": {
|
105
|
-
"platform_editor_element_padding_changes_gate": {
|
106
|
-
"type": "boolean"
|
107
|
-
},
|
108
104
|
"editor_nest_media_and_codeblock_in_quotes_jira": {
|
109
105
|
"type": "boolean"
|
110
106
|
}
|