@atlaskit/editor-plugin-code-block 5.0.13 → 6.0.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 +16 -0
- package/dist/cjs/codeBlockPlugin.js +16 -0
- package/dist/cjs/ui/CodeBlockMenuItem.js +51 -0
- package/dist/es2019/codeBlockPlugin.js +16 -0
- package/dist/es2019/ui/CodeBlockMenuItem.js +42 -0
- package/dist/esm/codeBlockPlugin.js +16 -0
- package/dist/esm/ui/CodeBlockMenuItem.js +42 -0
- package/dist/types/codeBlockPluginType.d.ts +5 -1
- package/dist/types/ui/CodeBlockMenuItem.d.ts +4 -0
- package/dist/types-ts4.5/codeBlockPluginType.d.ts +5 -1
- package/dist/types-ts4.5/ui/CodeBlockMenuItem.d.ts +4 -0
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-code-block
|
|
2
2
|
|
|
3
|
+
## 6.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`e882e86092666`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e882e86092666) -
|
|
8
|
+
[ux] Register expand, layout and code block itmes in block menu. Update panel item.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 5.0.14
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`a2cd8c46a3e94`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a2cd8c46a3e94) -
|
|
16
|
+
EDITOR-1442 Bump adf-schema
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 5.0.13
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -9,9 +9,11 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _react = _interopRequireDefault(require("react"));
|
|
10
10
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
11
11
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
12
|
+
var _blockMenu = require("@atlaskit/editor-common/block-menu");
|
|
12
13
|
var _messages = require("@atlaskit/editor-common/messages");
|
|
13
14
|
var _quickInsert = require("@atlaskit/editor-common/quick-insert");
|
|
14
15
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
|
+
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
15
17
|
var _editorCommands = require("./editor-commands");
|
|
16
18
|
var _codeBlockAutoFullStopTransformPlugin = require("./pm-plugins/codeBlockAutoFullStopTransformPlugin");
|
|
17
19
|
var _codeBlockCopySelectionPlugin = require("./pm-plugins/codeBlockCopySelectionPlugin");
|
|
@@ -21,11 +23,25 @@ var _keymaps = _interopRequireDefault(require("./pm-plugins/keymaps"));
|
|
|
21
23
|
var _main = require("./pm-plugins/main");
|
|
22
24
|
var _refreshBrowserSelection = _interopRequireDefault(require("./pm-plugins/refresh-browser-selection"));
|
|
23
25
|
var _toolbar = require("./pm-plugins/toolbar");
|
|
26
|
+
var _CodeBlockMenuItem = require("./ui/CodeBlockMenuItem");
|
|
24
27
|
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; }
|
|
25
28
|
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; }
|
|
26
29
|
var codeBlockPlugin = function codeBlockPlugin(_ref) {
|
|
27
30
|
var options = _ref.config,
|
|
28
31
|
api = _ref.api;
|
|
32
|
+
if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) {
|
|
33
|
+
var _api$blockMenu;
|
|
34
|
+
api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 || _api$blockMenu.actions.registerBlockMenuComponents([{
|
|
35
|
+
type: 'block-menu-item',
|
|
36
|
+
key: _blockMenu.FORMAT_CODE_BLOCK_MENU_ITEM.key,
|
|
37
|
+
parent: {
|
|
38
|
+
type: 'block-menu-section',
|
|
39
|
+
key: _blockMenu.FORMAT_MENU_ITEM.key,
|
|
40
|
+
rank: _blockMenu.FORMAT_NESTED_MENU_RANK[_blockMenu.FORMAT_CODE_BLOCK_MENU_ITEM.key]
|
|
41
|
+
},
|
|
42
|
+
component: (0, _CodeBlockMenuItem.createCodeBlockMenuItem)(api)
|
|
43
|
+
}]);
|
|
44
|
+
}
|
|
29
45
|
return {
|
|
30
46
|
name: 'codeBlock',
|
|
31
47
|
nodes: function nodes() {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.createCodeBlockMenuItem = void 0;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _reactIntlNext = require("react-intl-next");
|
|
11
|
+
var _messages = require("@atlaskit/editor-common/messages");
|
|
12
|
+
var _useSharedPluginStateSelector = require("@atlaskit/editor-common/use-shared-plugin-state-selector");
|
|
13
|
+
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
14
|
+
var _editorToolbar = require("@atlaskit/editor-toolbar");
|
|
15
|
+
var _angleBrackets = _interopRequireDefault(require("@atlaskit/icon/core/angle-brackets"));
|
|
16
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
17
|
+
var nodeName = 'codeBlock';
|
|
18
|
+
var CodeBlockMenuItem = function CodeBlockMenuItem(_ref) {
|
|
19
|
+
var api = _ref.api;
|
|
20
|
+
var _useIntl = (0, _reactIntlNext.useIntl)(),
|
|
21
|
+
formatMessage = _useIntl.formatMessage;
|
|
22
|
+
var selection = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'selection.selection');
|
|
23
|
+
var isCodeBlockSelected = (0, _react.useMemo)(function () {
|
|
24
|
+
if (!selection) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
if (selection instanceof _state.NodeSelection) {
|
|
28
|
+
// Note: we are checking for any type of panel, not just of type infopanel
|
|
29
|
+
return selection.node.type.name === nodeName;
|
|
30
|
+
}
|
|
31
|
+
return false;
|
|
32
|
+
}, [selection]);
|
|
33
|
+
var handleClick = function handleClick() {
|
|
34
|
+
var _api$blockMenu;
|
|
35
|
+
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.formatNode(nodeName));
|
|
36
|
+
};
|
|
37
|
+
return /*#__PURE__*/_react.default.createElement(_editorToolbar.ToolbarDropdownItem, {
|
|
38
|
+
onClick: handleClick,
|
|
39
|
+
isSelected: isCodeBlockSelected,
|
|
40
|
+
elemBefore: /*#__PURE__*/_react.default.createElement(_angleBrackets.default, {
|
|
41
|
+
label: ""
|
|
42
|
+
})
|
|
43
|
+
}, formatMessage(_messages.blockMenuMessages.codeBlock));
|
|
44
|
+
};
|
|
45
|
+
var createCodeBlockMenuItem = exports.createCodeBlockMenuItem = function createCodeBlockMenuItem(api) {
|
|
46
|
+
return function () {
|
|
47
|
+
return /*#__PURE__*/_react.default.createElement(CodeBlockMenuItem, {
|
|
48
|
+
api: api
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { codeBlock, codeBlockWithLocalId } from '@atlaskit/adf-schema';
|
|
3
3
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
+
import { FORMAT_MENU_ITEM, FORMAT_CODE_BLOCK_MENU_ITEM, FORMAT_NESTED_MENU_RANK } from '@atlaskit/editor-common/block-menu';
|
|
4
5
|
import { blockTypeMessages } from '@atlaskit/editor-common/messages';
|
|
5
6
|
import { IconCode } from '@atlaskit/editor-common/quick-insert';
|
|
6
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
7
9
|
import { createInsertCodeBlockTransaction, insertCodeBlockWithAnalytics } from './editor-commands';
|
|
8
10
|
import { codeBlockAutoFullStopTransformPlugin } from './pm-plugins/codeBlockAutoFullStopTransformPlugin';
|
|
9
11
|
import { codeBlockCopySelectionPlugin, copySelectionPluginKey } from './pm-plugins/codeBlockCopySelectionPlugin';
|
|
@@ -13,10 +15,24 @@ import keymap from './pm-plugins/keymaps';
|
|
|
13
15
|
import { createPlugin } from './pm-plugins/main';
|
|
14
16
|
import refreshBrowserSelectionOnChange from './pm-plugins/refresh-browser-selection';
|
|
15
17
|
import { getToolbarConfig } from './pm-plugins/toolbar';
|
|
18
|
+
import { createCodeBlockMenuItem } from './ui/CodeBlockMenuItem';
|
|
16
19
|
const codeBlockPlugin = ({
|
|
17
20
|
config: options,
|
|
18
21
|
api
|
|
19
22
|
}) => {
|
|
23
|
+
if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
|
|
24
|
+
var _api$blockMenu;
|
|
25
|
+
api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.actions.registerBlockMenuComponents([{
|
|
26
|
+
type: 'block-menu-item',
|
|
27
|
+
key: FORMAT_CODE_BLOCK_MENU_ITEM.key,
|
|
28
|
+
parent: {
|
|
29
|
+
type: 'block-menu-section',
|
|
30
|
+
key: FORMAT_MENU_ITEM.key,
|
|
31
|
+
rank: FORMAT_NESTED_MENU_RANK[FORMAT_CODE_BLOCK_MENU_ITEM.key]
|
|
32
|
+
},
|
|
33
|
+
component: createCodeBlockMenuItem(api)
|
|
34
|
+
}]);
|
|
35
|
+
}
|
|
20
36
|
return {
|
|
21
37
|
name: 'codeBlock',
|
|
22
38
|
nodes() {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl-next';
|
|
3
|
+
import { blockMenuMessages } from '@atlaskit/editor-common/messages';
|
|
4
|
+
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
5
|
+
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
+
import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
7
|
+
import AngleBracketsIcon from '@atlaskit/icon/core/angle-brackets';
|
|
8
|
+
const nodeName = 'codeBlock';
|
|
9
|
+
const CodeBlockMenuItem = ({
|
|
10
|
+
api
|
|
11
|
+
}) => {
|
|
12
|
+
const {
|
|
13
|
+
formatMessage
|
|
14
|
+
} = useIntl();
|
|
15
|
+
const selection = useSharedPluginStateSelector(api, 'selection.selection');
|
|
16
|
+
const isCodeBlockSelected = useMemo(() => {
|
|
17
|
+
if (!selection) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
if (selection instanceof NodeSelection) {
|
|
21
|
+
// Note: we are checking for any type of panel, not just of type infopanel
|
|
22
|
+
return selection.node.type.name === nodeName;
|
|
23
|
+
}
|
|
24
|
+
return false;
|
|
25
|
+
}, [selection]);
|
|
26
|
+
const handleClick = () => {
|
|
27
|
+
var _api$blockMenu;
|
|
28
|
+
api === null || api === void 0 ? void 0 : api.core.actions.execute(api === null || api === void 0 ? void 0 : (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.formatNode(nodeName));
|
|
29
|
+
};
|
|
30
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
31
|
+
onClick: handleClick,
|
|
32
|
+
isSelected: isCodeBlockSelected,
|
|
33
|
+
elemBefore: /*#__PURE__*/React.createElement(AngleBracketsIcon, {
|
|
34
|
+
label: ""
|
|
35
|
+
})
|
|
36
|
+
}, formatMessage(blockMenuMessages.codeBlock));
|
|
37
|
+
};
|
|
38
|
+
export const createCodeBlockMenuItem = api => {
|
|
39
|
+
return () => /*#__PURE__*/React.createElement(CodeBlockMenuItem, {
|
|
40
|
+
api: api
|
|
41
|
+
});
|
|
42
|
+
};
|
|
@@ -4,9 +4,11 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { codeBlock, codeBlockWithLocalId } from '@atlaskit/adf-schema';
|
|
6
6
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
7
|
+
import { FORMAT_MENU_ITEM, FORMAT_CODE_BLOCK_MENU_ITEM, FORMAT_NESTED_MENU_RANK } from '@atlaskit/editor-common/block-menu';
|
|
7
8
|
import { blockTypeMessages } from '@atlaskit/editor-common/messages';
|
|
8
9
|
import { IconCode } from '@atlaskit/editor-common/quick-insert';
|
|
9
10
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
10
12
|
import { createInsertCodeBlockTransaction, insertCodeBlockWithAnalytics } from './editor-commands';
|
|
11
13
|
import { codeBlockAutoFullStopTransformPlugin } from './pm-plugins/codeBlockAutoFullStopTransformPlugin';
|
|
12
14
|
import { codeBlockCopySelectionPlugin, copySelectionPluginKey } from './pm-plugins/codeBlockCopySelectionPlugin';
|
|
@@ -16,9 +18,23 @@ import keymap from './pm-plugins/keymaps';
|
|
|
16
18
|
import { createPlugin } from './pm-plugins/main';
|
|
17
19
|
import refreshBrowserSelectionOnChange from './pm-plugins/refresh-browser-selection';
|
|
18
20
|
import { getToolbarConfig } from './pm-plugins/toolbar';
|
|
21
|
+
import { createCodeBlockMenuItem } from './ui/CodeBlockMenuItem';
|
|
19
22
|
var codeBlockPlugin = function codeBlockPlugin(_ref) {
|
|
20
23
|
var options = _ref.config,
|
|
21
24
|
api = _ref.api;
|
|
25
|
+
if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
|
|
26
|
+
var _api$blockMenu;
|
|
27
|
+
api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 || _api$blockMenu.actions.registerBlockMenuComponents([{
|
|
28
|
+
type: 'block-menu-item',
|
|
29
|
+
key: FORMAT_CODE_BLOCK_MENU_ITEM.key,
|
|
30
|
+
parent: {
|
|
31
|
+
type: 'block-menu-section',
|
|
32
|
+
key: FORMAT_MENU_ITEM.key,
|
|
33
|
+
rank: FORMAT_NESTED_MENU_RANK[FORMAT_CODE_BLOCK_MENU_ITEM.key]
|
|
34
|
+
},
|
|
35
|
+
component: createCodeBlockMenuItem(api)
|
|
36
|
+
}]);
|
|
37
|
+
}
|
|
22
38
|
return {
|
|
23
39
|
name: 'codeBlock',
|
|
24
40
|
nodes: function nodes() {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { useIntl } from 'react-intl-next';
|
|
3
|
+
import { blockMenuMessages } from '@atlaskit/editor-common/messages';
|
|
4
|
+
import { useSharedPluginStateSelector } from '@atlaskit/editor-common/use-shared-plugin-state-selector';
|
|
5
|
+
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
6
|
+
import { ToolbarDropdownItem } from '@atlaskit/editor-toolbar';
|
|
7
|
+
import AngleBracketsIcon from '@atlaskit/icon/core/angle-brackets';
|
|
8
|
+
var nodeName = 'codeBlock';
|
|
9
|
+
var CodeBlockMenuItem = function CodeBlockMenuItem(_ref) {
|
|
10
|
+
var api = _ref.api;
|
|
11
|
+
var _useIntl = useIntl(),
|
|
12
|
+
formatMessage = _useIntl.formatMessage;
|
|
13
|
+
var selection = useSharedPluginStateSelector(api, 'selection.selection');
|
|
14
|
+
var isCodeBlockSelected = useMemo(function () {
|
|
15
|
+
if (!selection) {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
if (selection instanceof NodeSelection) {
|
|
19
|
+
// Note: we are checking for any type of panel, not just of type infopanel
|
|
20
|
+
return selection.node.type.name === nodeName;
|
|
21
|
+
}
|
|
22
|
+
return false;
|
|
23
|
+
}, [selection]);
|
|
24
|
+
var handleClick = function handleClick() {
|
|
25
|
+
var _api$blockMenu;
|
|
26
|
+
api === null || api === void 0 || api.core.actions.execute(api === null || api === void 0 || (_api$blockMenu = api.blockMenu) === null || _api$blockMenu === void 0 ? void 0 : _api$blockMenu.commands.formatNode(nodeName));
|
|
27
|
+
};
|
|
28
|
+
return /*#__PURE__*/React.createElement(ToolbarDropdownItem, {
|
|
29
|
+
onClick: handleClick,
|
|
30
|
+
isSelected: isCodeBlockSelected,
|
|
31
|
+
elemBefore: /*#__PURE__*/React.createElement(AngleBracketsIcon, {
|
|
32
|
+
label: ""
|
|
33
|
+
})
|
|
34
|
+
}, formatMessage(blockMenuMessages.codeBlock));
|
|
35
|
+
};
|
|
36
|
+
export var createCodeBlockMenuItem = function createCodeBlockMenuItem(api) {
|
|
37
|
+
return function () {
|
|
38
|
+
return /*#__PURE__*/React.createElement(CodeBlockMenuItem, {
|
|
39
|
+
api: api
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { Command, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
|
+
import type { BlockMenuPlugin } from '@atlaskit/editor-plugin-block-menu';
|
|
4
5
|
import type { CompositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
5
6
|
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
6
7
|
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
7
8
|
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
|
|
8
9
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
9
10
|
import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
|
|
11
|
+
import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
10
12
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
11
13
|
import type { CodeBlockPluginOptions } from './types';
|
|
12
14
|
type CodeBlockDependencies = [
|
|
@@ -16,7 +18,9 @@ type CodeBlockDependencies = [
|
|
|
16
18
|
OptionalPlugin<EditorDisabledPlugin>,
|
|
17
19
|
OptionalPlugin<FeatureFlagsPlugin>,
|
|
18
20
|
OptionalPlugin<InteractionPlugin>,
|
|
19
|
-
OptionalPlugin<EditorViewModePlugin
|
|
21
|
+
OptionalPlugin<EditorViewModePlugin>,
|
|
22
|
+
OptionalPlugin<BlockMenuPlugin>,
|
|
23
|
+
OptionalPlugin<SelectionPlugin>
|
|
20
24
|
];
|
|
21
25
|
export type CodeBlockPlugin = NextEditorPlugin<'codeBlock', {
|
|
22
26
|
actions: {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { CodeBlockPlugin } from '../codeBlockPluginType';
|
|
4
|
+
export declare const createCodeBlockMenuItem: (api: ExtractInjectionAPI<CodeBlockPlugin>) => () => React.JSX.Element;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import type { Command, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
|
+
import type { BlockMenuPlugin } from '@atlaskit/editor-plugin-block-menu';
|
|
4
5
|
import type { CompositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
5
6
|
import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
6
7
|
import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
7
8
|
import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmode';
|
|
8
9
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
9
10
|
import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
|
|
11
|
+
import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
10
12
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
11
13
|
import type { CodeBlockPluginOptions } from './types';
|
|
12
14
|
type CodeBlockDependencies = [
|
|
@@ -16,7 +18,9 @@ type CodeBlockDependencies = [
|
|
|
16
18
|
OptionalPlugin<EditorDisabledPlugin>,
|
|
17
19
|
OptionalPlugin<FeatureFlagsPlugin>,
|
|
18
20
|
OptionalPlugin<InteractionPlugin>,
|
|
19
|
-
OptionalPlugin<EditorViewModePlugin
|
|
21
|
+
OptionalPlugin<EditorViewModePlugin>,
|
|
22
|
+
OptionalPlugin<BlockMenuPlugin>,
|
|
23
|
+
OptionalPlugin<SelectionPlugin>
|
|
20
24
|
];
|
|
21
25
|
export type CodeBlockPlugin = NextEditorPlugin<'codeBlock', {
|
|
22
26
|
actions: {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { CodeBlockPlugin } from '../codeBlockPluginType';
|
|
4
|
+
export declare const createCodeBlockMenuItem: (api: ExtractInjectionAPI<CodeBlockPlugin>) => () => React.JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-code-block",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "Code block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -26,27 +26,27 @@
|
|
|
26
26
|
},
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"atlaskit:src": "src/index.ts",
|
|
29
|
-
"af:exports": {
|
|
30
|
-
".": "./src/index.ts"
|
|
31
|
-
},
|
|
32
29
|
"dependencies": {
|
|
33
|
-
"@atlaskit/adf-schema": "^50.2.
|
|
30
|
+
"@atlaskit/adf-schema": "^50.2.3",
|
|
34
31
|
"@atlaskit/code": "^17.2.0",
|
|
35
|
-
"@atlaskit/editor-plugin-analytics": "^
|
|
36
|
-
"@atlaskit/editor-plugin-
|
|
37
|
-
"@atlaskit/editor-plugin-
|
|
38
|
-
"@atlaskit/editor-plugin-
|
|
39
|
-
"@atlaskit/editor-plugin-editor-
|
|
40
|
-
"@atlaskit/editor-plugin-
|
|
32
|
+
"@atlaskit/editor-plugin-analytics": "^4.0.0",
|
|
33
|
+
"@atlaskit/editor-plugin-block-menu": "^1.0.0",
|
|
34
|
+
"@atlaskit/editor-plugin-composition": "^3.0.0",
|
|
35
|
+
"@atlaskit/editor-plugin-decorations": "^4.0.0",
|
|
36
|
+
"@atlaskit/editor-plugin-editor-disabled": "^4.0.0",
|
|
37
|
+
"@atlaskit/editor-plugin-editor-viewmode": "^6.0.0",
|
|
38
|
+
"@atlaskit/editor-plugin-interaction": "^6.0.0",
|
|
39
|
+
"@atlaskit/editor-plugin-selection": "^4.0.0",
|
|
41
40
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
42
|
-
"@atlaskit/
|
|
41
|
+
"@atlaskit/editor-toolbar": "^0.6.0",
|
|
42
|
+
"@atlaskit/icon": "^28.1.0",
|
|
43
43
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
44
44
|
"@atlaskit/prosemirror-input-rules": "^3.4.0",
|
|
45
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
45
|
+
"@atlaskit/tmp-editor-statsig": "^12.0.0",
|
|
46
46
|
"@babel/runtime": "^7.0.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@atlaskit/editor-common": "^
|
|
49
|
+
"@atlaskit/editor-common": "^108.0.0",
|
|
50
50
|
"react": "^18.2.0",
|
|
51
51
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
52
52
|
},
|