@atlaskit/editor-plugin-code-block 10.0.32 → 10.0.34
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 +18 -0
- package/dist/cjs/nodeviews/code-block.js +1 -2
- package/dist/cjs/pm-plugins/codeBlockAutoFullStopTransformPlugin.js +1 -2
- package/dist/cjs/pm-plugins/main.js +1 -1
- package/dist/cjs/pm-plugins/refresh-browser-selection.js +1 -2
- package/dist/cjs/ui/CodeBlockMenuItem.js +1 -7
- package/dist/es2019/nodeviews/code-block.js +2 -3
- package/dist/es2019/pm-plugins/codeBlockAutoFullStopTransformPlugin.js +2 -3
- package/dist/es2019/pm-plugins/main.js +2 -2
- package/dist/es2019/pm-plugins/refresh-browser-selection.js +2 -3
- package/dist/es2019/ui/CodeBlockMenuItem.js +1 -7
- package/dist/esm/nodeviews/code-block.js +2 -3
- package/dist/esm/pm-plugins/codeBlockAutoFullStopTransformPlugin.js +2 -3
- package/dist/esm/pm-plugins/main.js +2 -2
- package/dist/esm/pm-plugins/refresh-browser-selection.js +2 -3
- package/dist/esm/ui/CodeBlockMenuItem.js +1 -7
- package/package.json +4 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-code-block
|
|
2
2
|
|
|
3
|
+
## 10.0.34
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`1bd298ad0a152`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1bd298ad0a152) -
|
|
8
|
+
[ux] EDITOR-6280 Clean up platform_editor_block_menu_v2_patch_3 to fix icon and copy in jira block
|
|
9
|
+
menu
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 10.0.33
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`73b2fc243f544`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/73b2fc243f544) -
|
|
17
|
+
Cleaning up getBrowserInfo which was behind experiment platform_editor_hydratable_ui and is now
|
|
18
|
+
rolled out
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 10.0.32
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -12,7 +12,6 @@ var _browser = require("@atlaskit/editor-common/browser");
|
|
|
12
12
|
var _codeBlock = require("@atlaskit/editor-common/code-block");
|
|
13
13
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
14
14
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
16
15
|
var _editorCommands = require("../editor-commands");
|
|
17
16
|
var _mainState = require("../pm-plugins/main-state");
|
|
18
17
|
var _classNames = require("../ui/class-names");
|
|
@@ -173,7 +172,7 @@ var CodeBlockView = exports.CodeBlockView = /*#__PURE__*/function () {
|
|
|
173
172
|
}
|
|
174
173
|
this.node = node;
|
|
175
174
|
this.maintainDynamicGutterSize();
|
|
176
|
-
var browser = (0,
|
|
175
|
+
var browser = (0, _browser.getBrowserInfo)();
|
|
177
176
|
if (browser.android) {
|
|
178
177
|
this.coalesceDOMElements();
|
|
179
178
|
(0, _editorCommands.resetShouldIgnoreFollowingMutations)(this.view.state, this.view.dispatch);
|
|
@@ -10,7 +10,6 @@ var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
|
10
10
|
var _transforms = require("@atlaskit/editor-common/transforms");
|
|
11
11
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
12
12
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
14
13
|
var codeBlockAutoFullStopTransformPluginKey = exports.codeBlockAutoFullStopTransformPluginKey = new _state.PluginKey('codeBlockAutoFullStopTransformPluginKey');
|
|
15
14
|
function codeBlockAutoFullStopTransformPlugin() {
|
|
16
15
|
return new _safePlugin.SafePlugin({
|
|
@@ -28,7 +27,7 @@ function codeBlockAutoFullStopTransformPlugin() {
|
|
|
28
27
|
fromNew = _trNew$selection.from,
|
|
29
28
|
toNew = _trNew$selection.to;
|
|
30
29
|
var isCodeBlock = !!(0, _transforms.findCodeBlock)(oldState, trOld.selection) && !!(0, _transforms.findCodeBlock)(newState, trNew.selection);
|
|
31
|
-
var browser = (0,
|
|
30
|
+
var browser = (0, _browser.getBrowserInfo)();
|
|
32
31
|
/**
|
|
33
32
|
* Mac will auto insert a fullstop when the user double taps the space key after some content.
|
|
34
33
|
* Line number decorators are assumed content so on new lines the fullstop is inserted.
|
|
@@ -47,7 +47,7 @@ var createPlugin = exports.createPlugin = function createPlugin(_ref) {
|
|
|
47
47
|
var keyEvent = event;
|
|
48
48
|
var eventInputType = keyEvent.inputType;
|
|
49
49
|
var eventText = keyEvent.data;
|
|
50
|
-
var browser = (0,
|
|
50
|
+
var browser = (0, _browser.getBrowserInfo)();
|
|
51
51
|
if (browser.ios && event.composed &&
|
|
52
52
|
// insertParagraph will be the input type when the enter key is pressed.
|
|
53
53
|
eventInputType === 'insertParagraph' && (0, _transforms.findCodeBlock)(view.state, view.state.selection)) {
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.refreshBrowserSelection = exports.default = void 0;
|
|
7
7
|
var _browser = require("@atlaskit/editor-common/browser");
|
|
8
|
-
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
9
8
|
var _pluginKey = require("./plugin-key");
|
|
10
9
|
// Workaround for a firefox issue where dom selection is off sync
|
|
11
10
|
// https://product-fabric.atlassian.net/browse/ED-12442
|
|
@@ -21,7 +20,7 @@ var refreshBrowserSelection = exports.refreshBrowserSelection = function refresh
|
|
|
21
20
|
};
|
|
22
21
|
var refreshBrowserSelectionOnChange = function refreshBrowserSelectionOnChange(transaction, editorState) {
|
|
23
22
|
var _pluginKey$getState;
|
|
24
|
-
var browser = (0,
|
|
23
|
+
var browser = (0, _browser.getBrowserInfo)();
|
|
25
24
|
if (browser.gecko && transaction.docChanged &&
|
|
26
25
|
// codeblockState.pos should be set if current selection is in a codeblock.
|
|
27
26
|
typeof ((_pluginKey$getState = _pluginKey.pluginKey.getState(editorState)) === null || _pluginKey$getState === void 0 ? void 0 : _pluginKey$getState.pos) === 'number') {
|
|
@@ -11,7 +11,6 @@ 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 _angleBrackets = _interopRequireDefault(require("@atlaskit/icon/core/angle-brackets"));
|
|
14
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
14
|
var NODE_NAME = 'codeBlock';
|
|
16
15
|
var CodeBlockMenuItem = function CodeBlockMenuItem(_ref) {
|
|
17
16
|
var api = _ref.api;
|
|
@@ -33,16 +32,11 @@ var CodeBlockMenuItem = function CodeBlockMenuItem(_ref) {
|
|
|
33
32
|
}) : null;
|
|
34
33
|
});
|
|
35
34
|
};
|
|
36
|
-
|
|
37
|
-
// [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
|
|
38
|
-
// Adds size="small" to icons for better visual consistency in block menu.
|
|
39
|
-
// To clean up: remove conditional, keep only size="small" version.
|
|
40
|
-
var iconSize = (0, _platformFeatureFlags.fg)('platform_editor_block_menu_v2_patch_3') ? 'small' : undefined;
|
|
41
35
|
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
|
|
42
36
|
onClick: handleClick,
|
|
43
37
|
elemBefore: /*#__PURE__*/_react.default.createElement(_angleBrackets.default, {
|
|
44
38
|
label: "",
|
|
45
|
-
size:
|
|
39
|
+
size: "small"
|
|
46
40
|
})
|
|
47
41
|
}, formatMessage(_messages.blockMenuMessages.codeBlock));
|
|
48
42
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import {
|
|
2
|
+
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
3
3
|
import { codeBlockWrappedStates, defaultWordWrapState } from '@atlaskit/editor-common/code-block';
|
|
4
4
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
6
|
import { resetShouldIgnoreFollowingMutations } from '../editor-commands';
|
|
8
7
|
import { getPluginState } from '../pm-plugins/main-state';
|
|
9
8
|
import { codeBlockClassNames } from '../ui/class-names';
|
|
@@ -150,7 +149,7 @@ export class CodeBlockView {
|
|
|
150
149
|
}
|
|
151
150
|
this.node = node;
|
|
152
151
|
this.maintainDynamicGutterSize();
|
|
153
|
-
const browser =
|
|
152
|
+
const browser = getBrowserInfo();
|
|
154
153
|
if (browser.android) {
|
|
155
154
|
this.coalesceDOMElements();
|
|
156
155
|
resetShouldIgnoreFollowingMutations(this.view.state, this.view.dispatch);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import { findCodeBlock } from '@atlaskit/editor-common/transforms';
|
|
4
4
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
6
|
export const codeBlockAutoFullStopTransformPluginKey = new PluginKey('codeBlockAutoFullStopTransformPluginKey');
|
|
8
7
|
export function codeBlockAutoFullStopTransformPlugin() {
|
|
9
8
|
return new SafePlugin({
|
|
@@ -28,7 +27,7 @@ export function codeBlockAutoFullStopTransformPlugin() {
|
|
|
28
27
|
to: toNew
|
|
29
28
|
} = trNew.selection;
|
|
30
29
|
const isCodeBlock = !!findCodeBlock(oldState, trOld.selection) && !!findCodeBlock(newState, trNew.selection);
|
|
31
|
-
const browser =
|
|
30
|
+
const browser = getBrowserInfo();
|
|
32
31
|
/**
|
|
33
32
|
* Mac will auto insert a fullstop when the user double taps the space key after some content.
|
|
34
33
|
* Line number decorators are assumed content so on new lines the fullstop is inserted.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
2
2
|
import { updateCodeBlockWrappedStateNodeKeys } from '@atlaskit/editor-common/code-block';
|
|
3
3
|
import { blockTypeMessages } from '@atlaskit/editor-common/messages';
|
|
4
4
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
@@ -36,7 +36,7 @@ export const createPlugin = ({
|
|
|
36
36
|
const keyEvent = event;
|
|
37
37
|
const eventInputType = keyEvent.inputType;
|
|
38
38
|
const eventText = keyEvent.data;
|
|
39
|
-
const browser =
|
|
39
|
+
const browser = getBrowserInfo();
|
|
40
40
|
if (browser.ios && event.composed &&
|
|
41
41
|
// insertParagraph will be the input type when the enter key is pressed.
|
|
42
42
|
eventInputType === 'insertParagraph' && findCodeBlock(view.state, view.state.selection)) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
1
|
+
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
3
2
|
import { pluginKey } from './plugin-key';
|
|
4
3
|
|
|
5
4
|
// Workaround for a firefox issue where dom selection is off sync
|
|
@@ -16,7 +15,7 @@ const refreshBrowserSelection = () => {
|
|
|
16
15
|
};
|
|
17
16
|
const refreshBrowserSelectionOnChange = (transaction, editorState) => {
|
|
18
17
|
var _pluginKey$getState;
|
|
19
|
-
const browser =
|
|
18
|
+
const browser = getBrowserInfo();
|
|
20
19
|
if (browser.gecko && transaction.docChanged &&
|
|
21
20
|
// codeblockState.pos should be set if current selection is in a codeblock.
|
|
22
21
|
typeof ((_pluginKey$getState = pluginKey.getState(editorState)) === null || _pluginKey$getState === void 0 ? void 0 : _pluginKey$getState.pos) === 'number') {
|
|
@@ -4,7 +4,6 @@ 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 AngleBracketsIcon from '@atlaskit/icon/core/angle-brackets';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
const NODE_NAME = 'codeBlock';
|
|
9
8
|
const CodeBlockMenuItem = ({
|
|
10
9
|
api
|
|
@@ -29,16 +28,11 @@ const CodeBlockMenuItem = ({
|
|
|
29
28
|
}) : null;
|
|
30
29
|
});
|
|
31
30
|
};
|
|
32
|
-
|
|
33
|
-
// [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
|
|
34
|
-
// Adds size="small" to icons for better visual consistency in block menu.
|
|
35
|
-
// To clean up: remove conditional, keep only size="small" version.
|
|
36
|
-
const iconSize = fg('platform_editor_block_menu_v2_patch_3') ? 'small' : undefined;
|
|
37
31
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
38
32
|
onClick: handleClick,
|
|
39
33
|
elemBefore: /*#__PURE__*/React.createElement(AngleBracketsIcon, {
|
|
40
34
|
label: "",
|
|
41
|
-
size:
|
|
35
|
+
size: "small"
|
|
42
36
|
})
|
|
43
37
|
}, formatMessage(blockMenuMessages.codeBlock));
|
|
44
38
|
};
|
|
@@ -3,11 +3,10 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
4
|
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; }
|
|
5
5
|
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; }
|
|
6
|
-
import {
|
|
6
|
+
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
7
7
|
import { codeBlockWrappedStates, defaultWordWrapState } from '@atlaskit/editor-common/code-block';
|
|
8
8
|
import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
|
|
9
9
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
10
|
import { resetShouldIgnoreFollowingMutations } from '../editor-commands';
|
|
12
11
|
import { getPluginState } from '../pm-plugins/main-state';
|
|
13
12
|
import { codeBlockClassNames } from '../ui/class-names';
|
|
@@ -167,7 +166,7 @@ export var CodeBlockView = /*#__PURE__*/function () {
|
|
|
167
166
|
}
|
|
168
167
|
this.node = node;
|
|
169
168
|
this.maintainDynamicGutterSize();
|
|
170
|
-
var browser =
|
|
169
|
+
var browser = getBrowserInfo();
|
|
171
170
|
if (browser.android) {
|
|
172
171
|
this.coalesceDOMElements();
|
|
173
172
|
resetShouldIgnoreFollowingMutations(this.view.state, this.view.dispatch);
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
2
2
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
3
|
import { findCodeBlock } from '@atlaskit/editor-common/transforms';
|
|
4
4
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
7
6
|
export var codeBlockAutoFullStopTransformPluginKey = new PluginKey('codeBlockAutoFullStopTransformPluginKey');
|
|
8
7
|
export function codeBlockAutoFullStopTransformPlugin() {
|
|
9
8
|
return new SafePlugin({
|
|
@@ -21,7 +20,7 @@ export function codeBlockAutoFullStopTransformPlugin() {
|
|
|
21
20
|
fromNew = _trNew$selection.from,
|
|
22
21
|
toNew = _trNew$selection.to;
|
|
23
22
|
var isCodeBlock = !!findCodeBlock(oldState, trOld.selection) && !!findCodeBlock(newState, trNew.selection);
|
|
24
|
-
var browser =
|
|
23
|
+
var browser = getBrowserInfo();
|
|
25
24
|
/**
|
|
26
25
|
* Mac will auto insert a fullstop when the user double taps the space key after some content.
|
|
27
26
|
* Line number decorators are assumed content so on new lines the fullstop is inserted.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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
|
-
import {
|
|
4
|
+
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
5
5
|
import { updateCodeBlockWrappedStateNodeKeys } from '@atlaskit/editor-common/code-block';
|
|
6
6
|
import { blockTypeMessages } from '@atlaskit/editor-common/messages';
|
|
7
7
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
@@ -40,7 +40,7 @@ export var createPlugin = function createPlugin(_ref) {
|
|
|
40
40
|
var keyEvent = event;
|
|
41
41
|
var eventInputType = keyEvent.inputType;
|
|
42
42
|
var eventText = keyEvent.data;
|
|
43
|
-
var browser =
|
|
43
|
+
var browser = getBrowserInfo();
|
|
44
44
|
if (browser.ios && event.composed &&
|
|
45
45
|
// insertParagraph will be the input type when the enter key is pressed.
|
|
46
46
|
eventInputType === 'insertParagraph' && findCodeBlock(view.state, view.state.selection)) {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
1
|
+
import { getBrowserInfo } from '@atlaskit/editor-common/browser';
|
|
3
2
|
import { pluginKey } from './plugin-key';
|
|
4
3
|
|
|
5
4
|
// Workaround for a firefox issue where dom selection is off sync
|
|
@@ -16,7 +15,7 @@ var refreshBrowserSelection = function refreshBrowserSelection() {
|
|
|
16
15
|
};
|
|
17
16
|
var refreshBrowserSelectionOnChange = function refreshBrowserSelectionOnChange(transaction, editorState) {
|
|
18
17
|
var _pluginKey$getState;
|
|
19
|
-
var browser =
|
|
18
|
+
var browser = getBrowserInfo();
|
|
20
19
|
if (browser.gecko && transaction.docChanged &&
|
|
21
20
|
// codeblockState.pos should be set if current selection is in a codeblock.
|
|
22
21
|
typeof ((_pluginKey$getState = pluginKey.getState(editorState)) === null || _pluginKey$getState === void 0 ? void 0 : _pluginKey$getState.pos) === 'number') {
|
|
@@ -4,7 +4,6 @@ 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 AngleBracketsIcon from '@atlaskit/icon/core/angle-brackets';
|
|
7
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
7
|
var NODE_NAME = 'codeBlock';
|
|
9
8
|
var CodeBlockMenuItem = function CodeBlockMenuItem(_ref) {
|
|
10
9
|
var api = _ref.api;
|
|
@@ -26,16 +25,11 @@ var CodeBlockMenuItem = function CodeBlockMenuItem(_ref) {
|
|
|
26
25
|
}) : null;
|
|
27
26
|
});
|
|
28
27
|
};
|
|
29
|
-
|
|
30
|
-
// [FEATURE FLAG: platform_editor_block_menu_v2_patch_3]
|
|
31
|
-
// Adds size="small" to icons for better visual consistency in block menu.
|
|
32
|
-
// To clean up: remove conditional, keep only size="small" version.
|
|
33
|
-
var iconSize = fg('platform_editor_block_menu_v2_patch_3') ? 'small' : undefined;
|
|
34
28
|
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
35
29
|
onClick: handleClick,
|
|
36
30
|
elemBefore: /*#__PURE__*/React.createElement(AngleBracketsIcon, {
|
|
37
31
|
label: "",
|
|
38
|
-
size:
|
|
32
|
+
size: "small"
|
|
39
33
|
})
|
|
40
34
|
}, formatMessage(blockMenuMessages.codeBlock));
|
|
41
35
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-code-block",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.34",
|
|
4
4
|
"description": "Code block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -40,14 +40,14 @@
|
|
|
40
40
|
"@atlaskit/editor-plugin-toolbar": "^5.1.0",
|
|
41
41
|
"@atlaskit/editor-prosemirror": "^7.3.0",
|
|
42
42
|
"@atlaskit/editor-toolbar": "^0.20.0",
|
|
43
|
-
"@atlaskit/icon": "^34.
|
|
43
|
+
"@atlaskit/icon": "^34.1.0",
|
|
44
44
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
45
45
|
"@atlaskit/prosemirror-input-rules": "^3.6.0",
|
|
46
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
46
|
+
"@atlaskit/tmp-editor-statsig": "^62.2.0",
|
|
47
47
|
"@babel/runtime": "^7.0.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@atlaskit/editor-common": "^112.
|
|
50
|
+
"@atlaskit/editor-common": "^112.21.0",
|
|
51
51
|
"react": "^18.2.0",
|
|
52
52
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
53
53
|
},
|
|
@@ -98,9 +98,6 @@
|
|
|
98
98
|
},
|
|
99
99
|
"platform_editor_adf_with_localid": {
|
|
100
100
|
"type": "boolean"
|
|
101
|
-
},
|
|
102
|
-
"platform_editor_block_menu_v2_patch_3": {
|
|
103
|
-
"type": "boolean"
|
|
104
101
|
}
|
|
105
102
|
}
|
|
106
103
|
}
|