@atlaskit/editor-plugin-code-block 6.0.2 → 7.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 +19 -0
- package/dist/cjs/pm-plugins/toolbar.js +3 -3
- package/dist/es2019/pm-plugins/toolbar.js +3 -3
- package/dist/esm/pm-plugins/toolbar.js +3 -3
- package/dist/types/codeBlockPluginType.d.ts +3 -1
- package/dist/types/ui/CodeBlockMenuItem.d.ts +1 -1
- package/dist/types-ts4.5/codeBlockPluginType.d.ts +3 -1
- package/dist/types-ts4.5/ui/CodeBlockMenuItem.d.ts +1 -1
- package/package.json +13 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-code-block
|
|
2
2
|
|
|
3
|
+
## 7.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 6.1.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`c0113eeccb2df`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c0113eeccb2df) -
|
|
14
|
+
[ux] ED-29120 add a new config option for default editor preset
|
|
15
|
+
(`toolbar.enableNewToolbarExperience`) which allows the new toolbar to be disabled. This is needed
|
|
16
|
+
for editors that can't be excluded at the experiment level.
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 6.0.2
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -82,7 +82,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig() {
|
|
|
82
82
|
var separator = {
|
|
83
83
|
type: 'separator'
|
|
84
84
|
};
|
|
85
|
-
var
|
|
85
|
+
var areAnyNewToolbarFlagsEnabled = (0, _toolbarFlagCheck.areToolbarFlagsEnabled)(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
|
|
86
86
|
var copyToClipboardItems = !allowCopyToClipboard ? [] : [{
|
|
87
87
|
id: 'editor.codeBlock.copy',
|
|
88
88
|
type: 'button',
|
|
@@ -104,7 +104,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig() {
|
|
|
104
104
|
tabIndex: null
|
|
105
105
|
}, separator];
|
|
106
106
|
var copyAndDeleteButtonMenuItems = [];
|
|
107
|
-
if (
|
|
107
|
+
if (areAnyNewToolbarFlagsEnabled) {
|
|
108
108
|
var overflowMenuOptions = [{
|
|
109
109
|
title: formatMessage(_messages.default.delete),
|
|
110
110
|
icon: (0, _delete.default)({
|
|
@@ -174,7 +174,7 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig() {
|
|
|
174
174
|
return (0, _utils.findDomRefAtPos)(pos, view.domAtPos.bind(view));
|
|
175
175
|
},
|
|
176
176
|
nodeType: nodeType,
|
|
177
|
-
items: [languageSelect].concat((0, _toConsumableArray2.default)(
|
|
177
|
+
items: [languageSelect].concat((0, _toConsumableArray2.default)(areAnyNewToolbarFlagsEnabled ? [] : [separator]), [codeBlockWrapButton], (0, _toConsumableArray2.default)(copyAndDeleteButtonMenuItems)),
|
|
178
178
|
scrollable: true
|
|
179
179
|
};
|
|
180
180
|
};
|
|
@@ -58,7 +58,7 @@ export const getToolbarConfig = (allowCopyToClipboard = false, api, overrideLang
|
|
|
58
58
|
const separator = {
|
|
59
59
|
type: 'separator'
|
|
60
60
|
};
|
|
61
|
-
const
|
|
61
|
+
const areAnyNewToolbarFlagsEnabled = areToolbarFlagsEnabled(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
|
|
62
62
|
const copyToClipboardItems = !allowCopyToClipboard ? [] : [{
|
|
63
63
|
id: 'editor.codeBlock.copy',
|
|
64
64
|
type: 'button',
|
|
@@ -80,7 +80,7 @@ export const getToolbarConfig = (allowCopyToClipboard = false, api, overrideLang
|
|
|
80
80
|
tabIndex: null
|
|
81
81
|
}, separator];
|
|
82
82
|
let copyAndDeleteButtonMenuItems = [];
|
|
83
|
-
if (
|
|
83
|
+
if (areAnyNewToolbarFlagsEnabled) {
|
|
84
84
|
const overflowMenuOptions = [{
|
|
85
85
|
title: formatMessage(commonMessages.delete),
|
|
86
86
|
icon: DeleteIcon({
|
|
@@ -148,7 +148,7 @@ export const getToolbarConfig = (allowCopyToClipboard = false, api, overrideLang
|
|
|
148
148
|
// eslint-disable-next-line @atlaskit/editor/no-as-casting
|
|
149
149
|
getDomRef: view => findDomRefAtPos(pos, view.domAtPos.bind(view)),
|
|
150
150
|
nodeType,
|
|
151
|
-
items: [languageSelect, ...(
|
|
151
|
+
items: [languageSelect, ...(areAnyNewToolbarFlagsEnabled ? [] : [separator]), codeBlockWrapButton, ...copyAndDeleteButtonMenuItems],
|
|
152
152
|
scrollable: true
|
|
153
153
|
};
|
|
154
154
|
};
|
|
@@ -73,7 +73,7 @@ export var getToolbarConfig = function getToolbarConfig() {
|
|
|
73
73
|
var separator = {
|
|
74
74
|
type: 'separator'
|
|
75
75
|
};
|
|
76
|
-
var
|
|
76
|
+
var areAnyNewToolbarFlagsEnabled = areToolbarFlagsEnabled(Boolean(api === null || api === void 0 ? void 0 : api.toolbar));
|
|
77
77
|
var copyToClipboardItems = !allowCopyToClipboard ? [] : [{
|
|
78
78
|
id: 'editor.codeBlock.copy',
|
|
79
79
|
type: 'button',
|
|
@@ -95,7 +95,7 @@ export var getToolbarConfig = function getToolbarConfig() {
|
|
|
95
95
|
tabIndex: null
|
|
96
96
|
}, separator];
|
|
97
97
|
var copyAndDeleteButtonMenuItems = [];
|
|
98
|
-
if (
|
|
98
|
+
if (areAnyNewToolbarFlagsEnabled) {
|
|
99
99
|
var overflowMenuOptions = [{
|
|
100
100
|
title: formatMessage(commonMessages.delete),
|
|
101
101
|
icon: DeleteIcon({
|
|
@@ -165,7 +165,7 @@ export var getToolbarConfig = function getToolbarConfig() {
|
|
|
165
165
|
return findDomRefAtPos(pos, view.domAtPos.bind(view));
|
|
166
166
|
},
|
|
167
167
|
nodeType: nodeType,
|
|
168
|
-
items: [languageSelect].concat(_toConsumableArray(
|
|
168
|
+
items: [languageSelect].concat(_toConsumableArray(areAnyNewToolbarFlagsEnabled ? [] : [separator]), [codeBlockWrapButton], _toConsumableArray(copyAndDeleteButtonMenuItems)),
|
|
169
169
|
scrollable: true
|
|
170
170
|
};
|
|
171
171
|
};
|
|
@@ -9,6 +9,7 @@ import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmo
|
|
|
9
9
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
10
10
|
import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
|
|
11
11
|
import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
12
|
+
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
|
|
12
13
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
13
14
|
import type { CodeBlockPluginOptions } from './types';
|
|
14
15
|
type CodeBlockDependencies = [
|
|
@@ -20,7 +21,8 @@ type CodeBlockDependencies = [
|
|
|
20
21
|
OptionalPlugin<InteractionPlugin>,
|
|
21
22
|
OptionalPlugin<EditorViewModePlugin>,
|
|
22
23
|
OptionalPlugin<BlockMenuPlugin>,
|
|
23
|
-
OptionalPlugin<SelectionPlugin
|
|
24
|
+
OptionalPlugin<SelectionPlugin>,
|
|
25
|
+
OptionalPlugin<ToolbarPlugin>
|
|
24
26
|
];
|
|
25
27
|
export type CodeBlockPlugin = NextEditorPlugin<'codeBlock', {
|
|
26
28
|
actions: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { CodeBlockPlugin } from '../codeBlockPluginType';
|
|
4
|
-
export declare const createCodeBlockMenuItem: (api: ExtractInjectionAPI<CodeBlockPlugin>) => () => React.JSX.Element;
|
|
4
|
+
export declare const createCodeBlockMenuItem: (api: ExtractInjectionAPI<CodeBlockPlugin> | undefined) => () => React.JSX.Element;
|
|
@@ -9,6 +9,7 @@ import type { EditorViewModePlugin } from '@atlaskit/editor-plugin-editor-viewmo
|
|
|
9
9
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
10
10
|
import type { InteractionPlugin } from '@atlaskit/editor-plugin-interaction';
|
|
11
11
|
import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
12
|
+
import type { ToolbarPlugin } from '@atlaskit/editor-plugin-toolbar';
|
|
12
13
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
13
14
|
import type { CodeBlockPluginOptions } from './types';
|
|
14
15
|
type CodeBlockDependencies = [
|
|
@@ -20,7 +21,8 @@ type CodeBlockDependencies = [
|
|
|
20
21
|
OptionalPlugin<InteractionPlugin>,
|
|
21
22
|
OptionalPlugin<EditorViewModePlugin>,
|
|
22
23
|
OptionalPlugin<BlockMenuPlugin>,
|
|
23
|
-
OptionalPlugin<SelectionPlugin
|
|
24
|
+
OptionalPlugin<SelectionPlugin>,
|
|
25
|
+
OptionalPlugin<ToolbarPlugin>
|
|
24
26
|
];
|
|
25
27
|
export type CodeBlockPlugin = NextEditorPlugin<'codeBlock', {
|
|
26
28
|
actions: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type { CodeBlockPlugin } from '../codeBlockPluginType';
|
|
4
|
-
export declare const createCodeBlockMenuItem: (api: ExtractInjectionAPI<CodeBlockPlugin>) => () => React.JSX.Element;
|
|
4
|
+
export declare const createCodeBlockMenuItem: (api: ExtractInjectionAPI<CodeBlockPlugin> | undefined) => () => 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": "7.0.0",
|
|
4
4
|
"description": "Code block plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -27,26 +27,27 @@
|
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"atlaskit:src": "src/index.ts",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@atlaskit/adf-schema": "^
|
|
30
|
+
"@atlaskit/adf-schema": "^51.0.0",
|
|
31
31
|
"@atlaskit/code": "^17.2.0",
|
|
32
|
-
"@atlaskit/editor-plugin-analytics": "^
|
|
33
|
-
"@atlaskit/editor-plugin-block-menu": "^
|
|
34
|
-
"@atlaskit/editor-plugin-composition": "^
|
|
35
|
-
"@atlaskit/editor-plugin-decorations": "^
|
|
36
|
-
"@atlaskit/editor-plugin-editor-disabled": "^
|
|
37
|
-
"@atlaskit/editor-plugin-editor-viewmode": "^
|
|
38
|
-
"@atlaskit/editor-plugin-interaction": "^
|
|
39
|
-
"@atlaskit/editor-plugin-selection": "^
|
|
32
|
+
"@atlaskit/editor-plugin-analytics": "^5.0.0",
|
|
33
|
+
"@atlaskit/editor-plugin-block-menu": "^2.0.0",
|
|
34
|
+
"@atlaskit/editor-plugin-composition": "^4.0.0",
|
|
35
|
+
"@atlaskit/editor-plugin-decorations": "^5.0.0",
|
|
36
|
+
"@atlaskit/editor-plugin-editor-disabled": "^5.0.0",
|
|
37
|
+
"@atlaskit/editor-plugin-editor-viewmode": "^7.0.0",
|
|
38
|
+
"@atlaskit/editor-plugin-interaction": "^7.0.0",
|
|
39
|
+
"@atlaskit/editor-plugin-selection": "^5.0.0",
|
|
40
|
+
"@atlaskit/editor-plugin-toolbar": "^2.0.0",
|
|
40
41
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
41
42
|
"@atlaskit/editor-toolbar": "^0.8.0",
|
|
42
43
|
"@atlaskit/icon": "^28.1.0",
|
|
43
44
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
44
45
|
"@atlaskit/prosemirror-input-rules": "^3.4.0",
|
|
45
|
-
"@atlaskit/tmp-editor-statsig": "^12.
|
|
46
|
+
"@atlaskit/tmp-editor-statsig": "^12.9.0",
|
|
46
47
|
"@babel/runtime": "^7.0.0"
|
|
47
48
|
},
|
|
48
49
|
"peerDependencies": {
|
|
49
|
-
"@atlaskit/editor-common": "^
|
|
50
|
+
"@atlaskit/editor-common": "^109.0.0",
|
|
50
51
|
"react": "^18.2.0",
|
|
51
52
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
52
53
|
},
|