@atlaskit/editor-plugin-block-type 10.3.4 → 10.3.5
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 +8 -0
- package/dist/cjs/ui/HeadingBlockMenuItem.js +5 -2
- package/dist/cjs/ui/ParagraphBlockMenuItem.js +3 -3
- package/dist/cjs/ui/QuoteBlockMenuItem.js +3 -3
- package/dist/es2019/ui/HeadingBlockMenuItem.js +5 -2
- package/dist/es2019/ui/ParagraphBlockMenuItem.js +3 -3
- package/dist/es2019/ui/QuoteBlockMenuItem.js +3 -3
- package/dist/esm/ui/HeadingBlockMenuItem.js +5 -2
- package/dist/esm/ui/ParagraphBlockMenuItem.js +3 -3
- package/dist/esm/ui/QuoteBlockMenuItem.js +3 -3
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-type
|
|
2
2
|
|
|
3
|
+
## 10.3.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`9cb0ce7857313`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9cb0ce7857313) -
|
|
8
|
+
[ux] Fix contextual transform options for single node selections.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 10.3.4
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -18,6 +18,7 @@ var _textHeadingThree = _interopRequireDefault(require("@atlaskit/icon-lab/core/
|
|
|
18
18
|
var _textHeadingTwo = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-heading-two"));
|
|
19
19
|
var headingIcons = [_textHeadingOne.default, _textHeadingTwo.default, _textHeadingThree.default, _textHeadingFour.default, _textHeadingFive.default, _textHeadingSix.default];
|
|
20
20
|
var headingMessages = [_messages.blockTypeMessages.heading1, _messages.blockTypeMessages.heading2, _messages.blockTypeMessages.heading3, _messages.blockTypeMessages.heading4, _messages.blockTypeMessages.heading5, _messages.blockTypeMessages.heading6];
|
|
21
|
+
var NODE_NAME = 'heading';
|
|
21
22
|
var HeadingBlockMenuItem = function HeadingBlockMenuItem(_ref) {
|
|
22
23
|
var _api$blockMenu2;
|
|
23
24
|
var level = _ref.level,
|
|
@@ -35,7 +36,7 @@ var HeadingBlockMenuItem = function HeadingBlockMenuItem(_ref) {
|
|
|
35
36
|
var command = api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.transformNode(tr.doc.type.schema.nodes.heading, {
|
|
36
37
|
inputMethod: inputMethod,
|
|
37
38
|
triggeredFrom: triggeredFrom,
|
|
38
|
-
targetTypeName: "
|
|
39
|
+
targetTypeName: "".concat(NODE_NAME).concat(level),
|
|
39
40
|
targetAttrs: {
|
|
40
41
|
level: level
|
|
41
42
|
}
|
|
@@ -45,7 +46,9 @@ var HeadingBlockMenuItem = function HeadingBlockMenuItem(_ref) {
|
|
|
45
46
|
}) : null;
|
|
46
47
|
});
|
|
47
48
|
};
|
|
48
|
-
var isTransfromToPanelDisabled = api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(
|
|
49
|
+
var isTransfromToPanelDisabled = api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(NODE_NAME, {
|
|
50
|
+
level: level
|
|
51
|
+
});
|
|
49
52
|
if (isTransfromToPanelDisabled) {
|
|
50
53
|
return null;
|
|
51
54
|
}
|
|
@@ -11,7 +11,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
11
11
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
12
12
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
13
13
|
var _textParagraph = _interopRequireDefault(require("@atlaskit/icon-lab/core/text-paragraph"));
|
|
14
|
-
var
|
|
14
|
+
var NODE_NAME = 'paragraph';
|
|
15
15
|
var ParagraphBlockMenuItem = function ParagraphBlockMenuItem(_ref) {
|
|
16
16
|
var _api$blockMenu2;
|
|
17
17
|
var api = _ref.api;
|
|
@@ -26,14 +26,14 @@ var ParagraphBlockMenuItem = function ParagraphBlockMenuItem(_ref) {
|
|
|
26
26
|
var command = api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.transformNode(tr.doc.type.schema.nodes.paragraph, {
|
|
27
27
|
inputMethod: inputMethod,
|
|
28
28
|
triggeredFrom: triggeredFrom,
|
|
29
|
-
targetTypeName:
|
|
29
|
+
targetTypeName: NODE_NAME
|
|
30
30
|
});
|
|
31
31
|
return command ? command({
|
|
32
32
|
tr: tr
|
|
33
33
|
}) : null;
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
|
-
var isTransfromToPanelDisabled = api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(
|
|
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
37
|
if (isTransfromToPanelDisabled) {
|
|
38
38
|
return null;
|
|
39
39
|
}
|
|
@@ -11,7 +11,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
|
|
|
11
11
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
12
12
|
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
13
13
|
var _quotationMark = _interopRequireDefault(require("@atlaskit/icon/core/quotation-mark"));
|
|
14
|
-
var
|
|
14
|
+
var NODE_NAME = 'blockquote';
|
|
15
15
|
var QuoteBlockMenuItem = function QuoteBlockMenuItem(_ref) {
|
|
16
16
|
var _api$blockMenu2;
|
|
17
17
|
var api = _ref.api;
|
|
@@ -26,14 +26,14 @@ var QuoteBlockMenuItem = function QuoteBlockMenuItem(_ref) {
|
|
|
26
26
|
var command = api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.transformNode(tr.doc.type.schema.nodes.blockquote, {
|
|
27
27
|
inputMethod: inputMethod,
|
|
28
28
|
triggeredFrom: triggeredFrom,
|
|
29
|
-
targetTypeName:
|
|
29
|
+
targetTypeName: NODE_NAME
|
|
30
30
|
});
|
|
31
31
|
return command ? command({
|
|
32
32
|
tr: tr
|
|
33
33
|
}) : null;
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
|
-
var isTransfromToPanelDisabled = api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(
|
|
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
37
|
if (isTransfromToPanelDisabled) {
|
|
38
38
|
return null;
|
|
39
39
|
}
|
|
@@ -11,6 +11,7 @@ import TextHeadingThreeIcon from '@atlaskit/icon-lab/core/text-heading-three';
|
|
|
11
11
|
import TextHeadingTwoIcon from '@atlaskit/icon-lab/core/text-heading-two';
|
|
12
12
|
const headingIcons = [TextHeadingOneIcon, TextHeadingTwoIcon, TextHeadingThreeIcon, TextHeadingFourIcon, TextHeadingFiveIcon, TextHeadingSixIcon];
|
|
13
13
|
const headingMessages = [blockTypeMessages.heading1, blockTypeMessages.heading2, blockTypeMessages.heading3, blockTypeMessages.heading4, blockTypeMessages.heading5, blockTypeMessages.heading6];
|
|
14
|
+
const NODE_NAME = 'heading';
|
|
14
15
|
const HeadingBlockMenuItem = ({
|
|
15
16
|
level,
|
|
16
17
|
api
|
|
@@ -31,7 +32,7 @@ const HeadingBlockMenuItem = ({
|
|
|
31
32
|
const command = api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.transformNode(tr.doc.type.schema.nodes.heading, {
|
|
32
33
|
inputMethod,
|
|
33
34
|
triggeredFrom,
|
|
34
|
-
targetTypeName:
|
|
35
|
+
targetTypeName: `${NODE_NAME}${level}`,
|
|
35
36
|
targetAttrs: {
|
|
36
37
|
level
|
|
37
38
|
}
|
|
@@ -41,7 +42,9 @@ const HeadingBlockMenuItem = ({
|
|
|
41
42
|
}) : null;
|
|
42
43
|
});
|
|
43
44
|
};
|
|
44
|
-
const isTransfromToPanelDisabled = api === null || api === void 0 ? void 0 : (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(
|
|
45
|
+
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, {
|
|
46
|
+
level
|
|
47
|
+
});
|
|
45
48
|
if (isTransfromToPanelDisabled) {
|
|
46
49
|
return null;
|
|
47
50
|
}
|
|
@@ -4,7 +4,7 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
4
4
|
import { blockMenuMessages } from '@atlaskit/editor-common/messages';
|
|
5
5
|
import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
6
6
|
import TextParagraphIcon from '@atlaskit/icon-lab/core/text-paragraph';
|
|
7
|
-
const
|
|
7
|
+
const NODE_NAME = 'paragraph';
|
|
8
8
|
const ParagraphBlockMenuItem = ({
|
|
9
9
|
api
|
|
10
10
|
}) => {
|
|
@@ -22,14 +22,14 @@ const ParagraphBlockMenuItem = ({
|
|
|
22
22
|
const command = api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.transformNode(tr.doc.type.schema.nodes.paragraph, {
|
|
23
23
|
inputMethod,
|
|
24
24
|
triggeredFrom,
|
|
25
|
-
targetTypeName:
|
|
25
|
+
targetTypeName: NODE_NAME
|
|
26
26
|
});
|
|
27
27
|
return command ? command({
|
|
28
28
|
tr
|
|
29
29
|
}) : null;
|
|
30
30
|
});
|
|
31
31
|
};
|
|
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(
|
|
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
33
|
if (isTransfromToPanelDisabled) {
|
|
34
34
|
return null;
|
|
35
35
|
}
|
|
@@ -4,7 +4,7 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
4
4
|
import { blockTypeMessages } from '@atlaskit/editor-common/messages';
|
|
5
5
|
import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
6
6
|
import QuotationMarkIcon from '@atlaskit/icon/core/quotation-mark';
|
|
7
|
-
const
|
|
7
|
+
const NODE_NAME = 'blockquote';
|
|
8
8
|
const QuoteBlockMenuItem = ({
|
|
9
9
|
api
|
|
10
10
|
}) => {
|
|
@@ -22,14 +22,14 @@ const QuoteBlockMenuItem = ({
|
|
|
22
22
|
const command = api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.transformNode(tr.doc.type.schema.nodes.blockquote, {
|
|
23
23
|
inputMethod,
|
|
24
24
|
triggeredFrom,
|
|
25
|
-
targetTypeName:
|
|
25
|
+
targetTypeName: NODE_NAME
|
|
26
26
|
});
|
|
27
27
|
return command ? command({
|
|
28
28
|
tr
|
|
29
29
|
}) : null;
|
|
30
30
|
});
|
|
31
31
|
};
|
|
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(
|
|
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
33
|
if (isTransfromToPanelDisabled) {
|
|
34
34
|
return null;
|
|
35
35
|
}
|
|
@@ -11,6 +11,7 @@ import TextHeadingThreeIcon from '@atlaskit/icon-lab/core/text-heading-three';
|
|
|
11
11
|
import TextHeadingTwoIcon from '@atlaskit/icon-lab/core/text-heading-two';
|
|
12
12
|
var headingIcons = [TextHeadingOneIcon, TextHeadingTwoIcon, TextHeadingThreeIcon, TextHeadingFourIcon, TextHeadingFiveIcon, TextHeadingSixIcon];
|
|
13
13
|
var headingMessages = [blockTypeMessages.heading1, blockTypeMessages.heading2, blockTypeMessages.heading3, blockTypeMessages.heading4, blockTypeMessages.heading5, blockTypeMessages.heading6];
|
|
14
|
+
var NODE_NAME = 'heading';
|
|
14
15
|
var HeadingBlockMenuItem = function HeadingBlockMenuItem(_ref) {
|
|
15
16
|
var _api$blockMenu2;
|
|
16
17
|
var level = _ref.level,
|
|
@@ -28,7 +29,7 @@ var HeadingBlockMenuItem = function HeadingBlockMenuItem(_ref) {
|
|
|
28
29
|
var command = api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.transformNode(tr.doc.type.schema.nodes.heading, {
|
|
29
30
|
inputMethod: inputMethod,
|
|
30
31
|
triggeredFrom: triggeredFrom,
|
|
31
|
-
targetTypeName: "
|
|
32
|
+
targetTypeName: "".concat(NODE_NAME).concat(level),
|
|
32
33
|
targetAttrs: {
|
|
33
34
|
level: level
|
|
34
35
|
}
|
|
@@ -38,7 +39,9 @@ var HeadingBlockMenuItem = function HeadingBlockMenuItem(_ref) {
|
|
|
38
39
|
}) : null;
|
|
39
40
|
});
|
|
40
41
|
};
|
|
41
|
-
var isTransfromToPanelDisabled = api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(
|
|
42
|
+
var isTransfromToPanelDisabled = api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(NODE_NAME, {
|
|
43
|
+
level: level
|
|
44
|
+
});
|
|
42
45
|
if (isTransfromToPanelDisabled) {
|
|
43
46
|
return null;
|
|
44
47
|
}
|
|
@@ -4,7 +4,7 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
4
4
|
import { blockMenuMessages } from '@atlaskit/editor-common/messages';
|
|
5
5
|
import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
6
6
|
import TextParagraphIcon from '@atlaskit/icon-lab/core/text-paragraph';
|
|
7
|
-
var
|
|
7
|
+
var NODE_NAME = 'paragraph';
|
|
8
8
|
var ParagraphBlockMenuItem = function ParagraphBlockMenuItem(_ref) {
|
|
9
9
|
var _api$blockMenu2;
|
|
10
10
|
var api = _ref.api;
|
|
@@ -19,14 +19,14 @@ var ParagraphBlockMenuItem = function ParagraphBlockMenuItem(_ref) {
|
|
|
19
19
|
var command = api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.transformNode(tr.doc.type.schema.nodes.paragraph, {
|
|
20
20
|
inputMethod: inputMethod,
|
|
21
21
|
triggeredFrom: triggeredFrom,
|
|
22
|
-
targetTypeName:
|
|
22
|
+
targetTypeName: NODE_NAME
|
|
23
23
|
});
|
|
24
24
|
return command ? command({
|
|
25
25
|
tr: tr
|
|
26
26
|
}) : null;
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
|
-
var isTransfromToPanelDisabled = api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(
|
|
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
30
|
if (isTransfromToPanelDisabled) {
|
|
31
31
|
return null;
|
|
32
32
|
}
|
|
@@ -4,7 +4,7 @@ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
|
4
4
|
import { blockTypeMessages } from '@atlaskit/editor-common/messages';
|
|
5
5
|
import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
6
6
|
import QuotationMarkIcon from '@atlaskit/icon/core/quotation-mark';
|
|
7
|
-
var
|
|
7
|
+
var NODE_NAME = 'blockquote';
|
|
8
8
|
var QuoteBlockMenuItem = function QuoteBlockMenuItem(_ref) {
|
|
9
9
|
var _api$blockMenu2;
|
|
10
10
|
var api = _ref.api;
|
|
@@ -19,14 +19,14 @@ var QuoteBlockMenuItem = function QuoteBlockMenuItem(_ref) {
|
|
|
19
19
|
var command = api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.transformNode(tr.doc.type.schema.nodes.blockquote, {
|
|
20
20
|
inputMethod: inputMethod,
|
|
21
21
|
triggeredFrom: triggeredFrom,
|
|
22
|
-
targetTypeName:
|
|
22
|
+
targetTypeName: NODE_NAME
|
|
23
23
|
});
|
|
24
24
|
return command ? command({
|
|
25
25
|
tr: tr
|
|
26
26
|
}) : null;
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
|
-
var isTransfromToPanelDisabled = api === null || api === void 0 || (_api$blockMenu2 = api.blockMenu) === null || _api$blockMenu2 === void 0 ? void 0 : _api$blockMenu2.actions.isTransformOptionDisabled(
|
|
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
30
|
if (isTransfromToPanelDisabled) {
|
|
31
31
|
return null;
|
|
32
32
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-type",
|
|
3
|
-
"version": "10.3.
|
|
3
|
+
"version": "10.3.5",
|
|
4
4
|
"description": "BlockType plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
52
52
|
"@atlaskit/prosemirror-input-rules": "^3.6.0",
|
|
53
53
|
"@atlaskit/theme": "^21.0.0",
|
|
54
|
-
"@atlaskit/tmp-editor-statsig": "^16.
|
|
54
|
+
"@atlaskit/tmp-editor-statsig": "^16.2.0",
|
|
55
55
|
"@atlaskit/tokens": "^9.0.0",
|
|
56
56
|
"@babel/runtime": "^7.0.0",
|
|
57
57
|
"@emotion/react": "^11.7.1"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@atlaskit/editor-common": "^110.
|
|
60
|
+
"@atlaskit/editor-common": "^110.49.0",
|
|
61
61
|
"react": "^18.2.0",
|
|
62
62
|
"react-dom": "^18.2.0",
|
|
63
63
|
"react-intl-next": "npm:react-intl@^5.18.1"
|