@atlaskit/editor-plugin-code-block-advanced 5.2.1 → 5.2.3
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 +17 -0
- package/dist/cjs/codeBlockAdvancedPlugin.js +2 -1
- package/dist/cjs/nodeviews/languages/languageMap.js +11 -16
- package/dist/es2019/codeBlockAdvancedPlugin.js +3 -2
- package/dist/es2019/nodeviews/languages/languageMap.js +9 -14
- package/dist/esm/codeBlockAdvancedPlugin.js +3 -2
- package/dist/esm/nodeviews/languages/languageMap.js +9 -14
- package/package.json +7 -7
- package/src/codeBlockAdvancedPlugin.tsx +5 -1
- package/src/nodeviews/languages/languageMap.ts +11 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-code-block-advanced
|
|
2
2
|
|
|
3
|
+
## 5.2.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b878645133984`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b878645133984) -
|
|
8
|
+
[ux] Adds revised ranks to use in Turn into menu. It will group the headings together at the top
|
|
9
|
+
of the menu.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 5.2.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`842f254deb366`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/842f254deb366) -
|
|
17
|
+
clean up platform_editor_code_syntax_highlight_actionscript
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 5.2.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.codeBlockAdvancedPlugin = void 0;
|
|
7
7
|
var _blockMenu = require("@atlaskit/editor-common/block-menu");
|
|
8
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
9
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
9
10
|
var _codeBlockNodeWithToDOMFixed = require("./nodeviews/codeBlockNodeWithToDOMFixed");
|
|
10
11
|
var _main = require("./pm-plugins/main");
|
|
@@ -20,7 +21,7 @@ var codeBlockAdvancedPlugin = exports.codeBlockAdvancedPlugin = function codeBlo
|
|
|
20
21
|
parent: {
|
|
21
22
|
type: 'block-menu-section',
|
|
22
23
|
key: _blockMenu.FORMAT_MENU_ITEM.key,
|
|
23
|
-
rank: _blockMenu.FORMAT_NESTED_MENU_RANK[_blockMenu.FORMAT_CODE_BLOCK_MENU_ITEM.key]
|
|
24
|
+
rank: (0, _platformFeatureFlags.fg)('platform_editor_block_menu_format_rank_revised') ? _blockMenu.FORMAT_NESTED_MENU_RANK_REVISED[_blockMenu.FORMAT_CODE_BLOCK_MENU_ITEM.key] : _blockMenu.FORMAT_NESTED_MENU_RANK[_blockMenu.FORMAT_CODE_BLOCK_MENU_ITEM.key]
|
|
24
25
|
},
|
|
25
26
|
component: (0, _createCodeBlockMenuItem.createCodeBlockMenuItem)(api)
|
|
26
27
|
}]);
|
|
@@ -8,7 +8,6 @@ exports.mapLanguageToCodeMirror = void 0;
|
|
|
8
8
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
9
|
var _language = require("@codemirror/language");
|
|
10
10
|
var _languageData = require("@codemirror/language-data");
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
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" != (0, _typeof2.default)(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); }
|
|
13
12
|
// getLanguageIdentifier defines `language.alias[0]`
|
|
14
13
|
var mapLanguageToCodeMirror = exports.mapLanguageToCodeMirror = function mapLanguageToCodeMirror(language) {
|
|
@@ -113,21 +112,17 @@ var mapLanguageToCodeMirror = exports.mapLanguageToCodeMirror = function mapLang
|
|
|
113
112
|
}
|
|
114
113
|
});
|
|
115
114
|
case 'actionscript':
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
return
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
});
|
|
128
|
-
} else {
|
|
129
|
-
return undefined;
|
|
130
|
-
}
|
|
115
|
+
return _language.LanguageDescription.of({
|
|
116
|
+
name: 'ActionScript',
|
|
117
|
+
load: function load() {
|
|
118
|
+
return Promise.resolve().then(function () {
|
|
119
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_@atlaskit/editor-plugin-code-block-advanced-lang-actionscript" */
|
|
120
|
+
'./actionscript/languageSupport'));
|
|
121
|
+
}).then(function (m) {
|
|
122
|
+
return m.actionscriptLanguageSupport();
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
});
|
|
131
126
|
default:
|
|
132
127
|
return _languageData.languages.find(function (l) {
|
|
133
128
|
return l.alias.includes(language) || l.name.toLowerCase() === (language === null || language === void 0 ? void 0 : language.toLowerCase());
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { FORMAT_MENU_ITEM, FORMAT_CODE_BLOCK_MENU_ITEM, FORMAT_NESTED_MENU_RANK } from '@atlaskit/editor-common/block-menu';
|
|
1
|
+
import { FORMAT_MENU_ITEM, FORMAT_CODE_BLOCK_MENU_ITEM, FORMAT_NESTED_MENU_RANK, FORMAT_NESTED_MENU_RANK_REVISED } from '@atlaskit/editor-common/block-menu';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
3
4
|
import { codeBlockNodeWithFixedToDOM } from './nodeviews/codeBlockNodeWithToDOMFixed';
|
|
4
5
|
import { createPlugin } from './pm-plugins/main';
|
|
@@ -15,7 +16,7 @@ export const codeBlockAdvancedPlugin = ({
|
|
|
15
16
|
parent: {
|
|
16
17
|
type: 'block-menu-section',
|
|
17
18
|
key: FORMAT_MENU_ITEM.key,
|
|
18
|
-
rank: FORMAT_NESTED_MENU_RANK[FORMAT_CODE_BLOCK_MENU_ITEM.key]
|
|
19
|
+
rank: fg('platform_editor_block_menu_format_rank_revised') ? FORMAT_NESTED_MENU_RANK_REVISED[FORMAT_CODE_BLOCK_MENU_ITEM.key] : FORMAT_NESTED_MENU_RANK[FORMAT_CODE_BLOCK_MENU_ITEM.key]
|
|
19
20
|
},
|
|
20
21
|
component: createCodeBlockMenuItem(api)
|
|
21
22
|
}]);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LanguageDescription, LanguageSupport } from '@codemirror/language';
|
|
2
2
|
import { languages } from '@codemirror/language-data';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
// getLanguageIdentifier defines `language.alias[0]`
|
|
5
4
|
export const mapLanguageToCodeMirror = language => {
|
|
6
5
|
if (!language || language === 'none') {
|
|
@@ -92,19 +91,15 @@ export const mapLanguageToCodeMirror = language => {
|
|
|
92
91
|
}
|
|
93
92
|
});
|
|
94
93
|
case 'actionscript':
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
});
|
|
105
|
-
} else {
|
|
106
|
-
return undefined;
|
|
107
|
-
}
|
|
94
|
+
return LanguageDescription.of({
|
|
95
|
+
name: 'ActionScript',
|
|
96
|
+
load() {
|
|
97
|
+
return import( /* webpackChunkName: "@atlaskit-internal_@atlaskit/editor-plugin-code-block-advanced-lang-actionscript" */
|
|
98
|
+
'./actionscript/languageSupport').then(m => {
|
|
99
|
+
return m.actionscriptLanguageSupport();
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
});
|
|
108
103
|
default:
|
|
109
104
|
return languages.find(l => {
|
|
110
105
|
return l.alias.includes(language) || l.name.toLowerCase() === (language === null || language === void 0 ? void 0 : language.toLowerCase());
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { FORMAT_MENU_ITEM, FORMAT_CODE_BLOCK_MENU_ITEM, FORMAT_NESTED_MENU_RANK } from '@atlaskit/editor-common/block-menu';
|
|
1
|
+
import { FORMAT_MENU_ITEM, FORMAT_CODE_BLOCK_MENU_ITEM, FORMAT_NESTED_MENU_RANK, FORMAT_NESTED_MENU_RANK_REVISED } from '@atlaskit/editor-common/block-menu';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
3
4
|
import { codeBlockNodeWithFixedToDOM } from './nodeviews/codeBlockNodeWithToDOMFixed';
|
|
4
5
|
import { createPlugin } from './pm-plugins/main';
|
|
@@ -14,7 +15,7 @@ export var codeBlockAdvancedPlugin = function codeBlockAdvancedPlugin(_ref) {
|
|
|
14
15
|
parent: {
|
|
15
16
|
type: 'block-menu-section',
|
|
16
17
|
key: FORMAT_MENU_ITEM.key,
|
|
17
|
-
rank: FORMAT_NESTED_MENU_RANK[FORMAT_CODE_BLOCK_MENU_ITEM.key]
|
|
18
|
+
rank: fg('platform_editor_block_menu_format_rank_revised') ? FORMAT_NESTED_MENU_RANK_REVISED[FORMAT_CODE_BLOCK_MENU_ITEM.key] : FORMAT_NESTED_MENU_RANK[FORMAT_CODE_BLOCK_MENU_ITEM.key]
|
|
18
19
|
},
|
|
19
20
|
component: createCodeBlockMenuItem(api)
|
|
20
21
|
}]);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LanguageDescription, LanguageSupport } from '@codemirror/language';
|
|
2
2
|
import { languages } from '@codemirror/language-data';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
// getLanguageIdentifier defines `language.alias[0]`
|
|
5
4
|
export var mapLanguageToCodeMirror = function mapLanguageToCodeMirror(language) {
|
|
6
5
|
if (!language || language === 'none') {
|
|
@@ -98,19 +97,15 @@ export var mapLanguageToCodeMirror = function mapLanguageToCodeMirror(language)
|
|
|
98
97
|
}
|
|
99
98
|
});
|
|
100
99
|
case 'actionscript':
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
});
|
|
111
|
-
} else {
|
|
112
|
-
return undefined;
|
|
113
|
-
}
|
|
100
|
+
return LanguageDescription.of({
|
|
101
|
+
name: 'ActionScript',
|
|
102
|
+
load: function load() {
|
|
103
|
+
return import( /* webpackChunkName: "@atlaskit-internal_@atlaskit/editor-plugin-code-block-advanced-lang-actionscript" */
|
|
104
|
+
'./actionscript/languageSupport').then(function (m) {
|
|
105
|
+
return m.actionscriptLanguageSupport();
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
});
|
|
114
109
|
default:
|
|
115
110
|
return languages.find(function (l) {
|
|
116
111
|
return l.alias.includes(language) || l.name.toLowerCase() === (language === null || language === void 0 ? void 0 : language.toLowerCase());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-code-block-advanced",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.3",
|
|
4
4
|
"description": "CodeBlockAdvanced plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"atlaskit:src": "src/index.ts",
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@atlaskit/adf-schema": "^51.1.2",
|
|
32
|
-
"@atlaskit/editor-plugin-block-menu": "^3.
|
|
32
|
+
"@atlaskit/editor-plugin-block-menu": "^3.2.0",
|
|
33
33
|
"@atlaskit/editor-plugin-code-block": "^7.2.0",
|
|
34
34
|
"@atlaskit/editor-plugin-editor-disabled": "^5.0.0",
|
|
35
35
|
"@atlaskit/editor-plugin-find-replace": "^5.0.0",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"@atlaskit/editor-plugin-selection-marker": "^5.0.0",
|
|
38
38
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
39
39
|
"@atlaskit/editor-toolbar": "^0.9.0",
|
|
40
|
-
"@atlaskit/icon": "^28.
|
|
40
|
+
"@atlaskit/icon": "^28.2.0",
|
|
41
41
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
42
|
-
"@atlaskit/tmp-editor-statsig": "^12.
|
|
42
|
+
"@atlaskit/tmp-editor-statsig": "^12.28.0",
|
|
43
43
|
"@atlaskit/tokens": "^6.3.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
45
45
|
"@codemirror/autocomplete": "6.18.4",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"codemirror-lang-elixir": "4.0.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@atlaskit/editor-common": "^109.
|
|
58
|
+
"@atlaskit/editor-common": "^109.11.0",
|
|
59
59
|
"react": "^18.2.0",
|
|
60
60
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
61
61
|
},
|
|
@@ -102,10 +102,10 @@
|
|
|
102
102
|
"platform_editor_breakout_resizing_hello_release": {
|
|
103
103
|
"type": "boolean"
|
|
104
104
|
},
|
|
105
|
-
"
|
|
105
|
+
"platform_editor_adf_with_localid": {
|
|
106
106
|
"type": "boolean"
|
|
107
107
|
},
|
|
108
|
-
"
|
|
108
|
+
"platform_editor_block_menu_format_rank_revised": {
|
|
109
109
|
"type": "boolean"
|
|
110
110
|
}
|
|
111
111
|
}
|
|
@@ -2,7 +2,9 @@ import {
|
|
|
2
2
|
FORMAT_MENU_ITEM,
|
|
3
3
|
FORMAT_CODE_BLOCK_MENU_ITEM,
|
|
4
4
|
FORMAT_NESTED_MENU_RANK,
|
|
5
|
+
FORMAT_NESTED_MENU_RANK_REVISED,
|
|
5
6
|
} from '@atlaskit/editor-common/block-menu';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
8
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
7
9
|
|
|
8
10
|
import type { CodeBlockAdvancedPlugin } from './codeBlockAdvancedPluginType';
|
|
@@ -19,7 +21,9 @@ export const codeBlockAdvancedPlugin: CodeBlockAdvancedPlugin = ({ api, config }
|
|
|
19
21
|
parent: {
|
|
20
22
|
type: 'block-menu-section' as const,
|
|
21
23
|
key: FORMAT_MENU_ITEM.key,
|
|
22
|
-
rank:
|
|
24
|
+
rank: fg('platform_editor_block_menu_format_rank_revised')
|
|
25
|
+
? FORMAT_NESTED_MENU_RANK_REVISED[FORMAT_CODE_BLOCK_MENU_ITEM.key]
|
|
26
|
+
: FORMAT_NESTED_MENU_RANK[FORMAT_CODE_BLOCK_MENU_ITEM.key],
|
|
23
27
|
},
|
|
24
28
|
component: createCodeBlockMenuItem(api),
|
|
25
29
|
},
|
|
@@ -2,7 +2,6 @@ import { LanguageDescription, LanguageSupport } from '@codemirror/language';
|
|
|
2
2
|
import { languages } from '@codemirror/language-data';
|
|
3
3
|
|
|
4
4
|
import type { LanguageAlias } from '@atlaskit/code';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
|
|
7
6
|
type LanguageAliasValue = LanguageAlias[0];
|
|
8
7
|
|
|
@@ -103,21 +102,17 @@ export const mapLanguageToCodeMirror = (language: LanguageAliasValue) => {
|
|
|
103
102
|
},
|
|
104
103
|
});
|
|
105
104
|
case 'actionscript':
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
});
|
|
118
|
-
} else {
|
|
119
|
-
return undefined;
|
|
120
|
-
}
|
|
105
|
+
return LanguageDescription.of({
|
|
106
|
+
name: 'ActionScript',
|
|
107
|
+
load() {
|
|
108
|
+
return import(
|
|
109
|
+
/* webpackChunkName: "@atlaskit-internal_@atlaskit/editor-plugin-code-block-advanced-lang-actionscript" */
|
|
110
|
+
'./actionscript/languageSupport'
|
|
111
|
+
).then((m) => {
|
|
112
|
+
return m.actionscriptLanguageSupport();
|
|
113
|
+
});
|
|
114
|
+
},
|
|
115
|
+
});
|
|
121
116
|
default:
|
|
122
117
|
return languages.find((l) => {
|
|
123
118
|
return l.alias.includes(language) || l.name.toLowerCase() === language?.toLowerCase();
|