@atlaskit/editor-plugin-code-block 1.3.3 → 1.4.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 CHANGED
@@ -1,5 +1,27 @@
1
1
  # @atlaskit/editor-plugin-code-block
2
2
 
3
+ ## 1.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#114156](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/114156)
8
+ [`bc6a63af2d1d0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bc6a63af2d1d0) -
9
+ Bump adf-schema to 37.0.0 and adf-schema-json to 1.16.0
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 1.3.4
16
+
17
+ ### Patch Changes
18
+
19
+ - [#110390](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/110390)
20
+ [`bead123202369`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bead123202369) -
21
+ [ux] [ED-23642] Reordering the typeahead so that date, status, code block & info panel are above
22
+ the fold (in the top 5 results)
23
+ - Updated dependencies
24
+
3
25
  ## 1.3.3
4
26
 
5
27
  ### Patch Changes
@@ -85,13 +85,14 @@ var codeBlockPlugin = function codeBlockPlugin(_ref) {
85
85
  },
86
86
  pluginsOptions: {
87
87
  quickInsert: function quickInsert(_ref5) {
88
+ var _options$getEditorFea;
88
89
  var formatMessage = _ref5.formatMessage;
89
90
  return [{
90
91
  id: 'codeblock',
91
92
  title: formatMessage(_messages.blockTypeMessages.codeblock),
92
93
  description: formatMessage(_messages.blockTypeMessages.codeblockDescription),
93
94
  keywords: ['code block'],
94
- priority: 700,
95
+ priority: options !== null && options !== void 0 && (_options$getEditorFea = options.getEditorFeatureFlags) !== null && _options$getEditorFea !== void 0 && _options$getEditorFea.call(options).platformEditorTypeaheadImprovedRelevancy ? 400 : 700,
95
96
  keyshortcut: '```',
96
97
  icon: function icon() {
97
98
  return /*#__PURE__*/_react.default.createElement(_quickInsert.IconCode, null);
@@ -74,31 +74,34 @@ const codeBlockPlugin = ({
74
74
  pluginsOptions: {
75
75
  quickInsert: ({
76
76
  formatMessage
77
- }) => [{
78
- id: 'codeblock',
79
- title: formatMessage(blockTypeMessages.codeblock),
80
- description: formatMessage(blockTypeMessages.codeblockDescription),
81
- keywords: ['code block'],
82
- priority: 700,
83
- keyshortcut: '```',
84
- icon: () => /*#__PURE__*/React.createElement(IconCode, null),
85
- action(_insert, state) {
86
- var _api$analytics3;
87
- const tr = createInsertCodeBlockTransaction({
88
- state
89
- });
90
- api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions.attachAnalyticsEvent({
91
- action: ACTION.INSERTED,
92
- actionSubject: ACTION_SUBJECT.DOCUMENT,
93
- actionSubjectId: ACTION_SUBJECT_ID.CODE_BLOCK,
94
- attributes: {
95
- inputMethod: INPUT_METHOD.QUICK_INSERT
96
- },
97
- eventType: EVENT_TYPE.TRACK
98
- })(tr);
99
- return tr;
100
- }
101
- }],
77
+ }) => {
78
+ var _options$getEditorFea;
79
+ return [{
80
+ id: 'codeblock',
81
+ title: formatMessage(blockTypeMessages.codeblock),
82
+ description: formatMessage(blockTypeMessages.codeblockDescription),
83
+ keywords: ['code block'],
84
+ priority: options !== null && options !== void 0 && (_options$getEditorFea = options.getEditorFeatureFlags) !== null && _options$getEditorFea !== void 0 && _options$getEditorFea.call(options).platformEditorTypeaheadImprovedRelevancy ? 400 : 700,
85
+ keyshortcut: '```',
86
+ icon: () => /*#__PURE__*/React.createElement(IconCode, null),
87
+ action(_insert, state) {
88
+ var _api$analytics3;
89
+ const tr = createInsertCodeBlockTransaction({
90
+ state
91
+ });
92
+ api === null || api === void 0 ? void 0 : (_api$analytics3 = api.analytics) === null || _api$analytics3 === void 0 ? void 0 : _api$analytics3.actions.attachAnalyticsEvent({
93
+ action: ACTION.INSERTED,
94
+ actionSubject: ACTION_SUBJECT.DOCUMENT,
95
+ actionSubjectId: ACTION_SUBJECT_ID.CODE_BLOCK,
96
+ attributes: {
97
+ inputMethod: INPUT_METHOD.QUICK_INSERT
98
+ },
99
+ eventType: EVENT_TYPE.TRACK
100
+ })(tr);
101
+ return tr;
102
+ }
103
+ }];
104
+ },
102
105
  floatingToolbar: getToolbarConfig(options === null || options === void 0 ? void 0 : options.allowCopyToClipboard, api)
103
106
  }
104
107
  });
@@ -78,13 +78,14 @@ var codeBlockPlugin = function codeBlockPlugin(_ref) {
78
78
  },
79
79
  pluginsOptions: {
80
80
  quickInsert: function quickInsert(_ref5) {
81
+ var _options$getEditorFea;
81
82
  var formatMessage = _ref5.formatMessage;
82
83
  return [{
83
84
  id: 'codeblock',
84
85
  title: formatMessage(blockTypeMessages.codeblock),
85
86
  description: formatMessage(blockTypeMessages.codeblockDescription),
86
87
  keywords: ['code block'],
87
- priority: 700,
88
+ priority: options !== null && options !== void 0 && (_options$getEditorFea = options.getEditorFeatureFlags) !== null && _options$getEditorFea !== void 0 && _options$getEditorFea.call(options).platformEditorTypeaheadImprovedRelevancy ? 400 : 700,
88
89
  keyshortcut: '```',
89
90
  icon: function icon() {
90
91
  return /*#__PURE__*/React.createElement(IconCode, null);
@@ -1,6 +1,7 @@
1
- import type { EditorAppearance, LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
1
+ import type { EditorAppearance, GetEditorFeatureFlags, LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
2
2
  export interface CodeBlockOptions extends LongPressSelectionPluginOptions {
3
3
  allowCopyToClipboard?: boolean;
4
4
  allowCompositionInputOverride?: boolean;
5
5
  appearance?: EditorAppearance | undefined;
6
+ getEditorFeatureFlags?: GetEditorFeatureFlags;
6
7
  }
@@ -1,6 +1,7 @@
1
- import type { EditorAppearance, LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
1
+ import type { EditorAppearance, GetEditorFeatureFlags, LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
2
2
  export interface CodeBlockOptions extends LongPressSelectionPluginOptions {
3
3
  allowCopyToClipboard?: boolean;
4
4
  allowCompositionInputOverride?: boolean;
5
5
  appearance?: EditorAppearance | undefined;
6
+ getEditorFeatureFlags?: GetEditorFeatureFlags;
6
7
  }
package/package.json CHANGED
@@ -1,103 +1,103 @@
1
1
  {
2
- "name": "@atlaskit/editor-plugin-code-block",
3
- "version": "1.3.3",
4
- "description": "Code block plugin for @atlaskit/editor-core",
5
- "author": "Atlassian Pty Ltd",
6
- "license": "Apache-2.0",
7
- "publishConfig": {
8
- "registry": "https://registry.npmjs.org/"
9
- },
10
- "atlassian": {
11
- "team": "Editor: Scarlet",
12
- "singleton": true,
13
- "inPublicMirror": false,
14
- "releaseModel": "continuous",
15
- "runReact18": false
16
- },
17
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
18
- "main": "dist/cjs/index.js",
19
- "module": "dist/esm/index.js",
20
- "module:es2019": "dist/es2019/index.js",
21
- "types": "dist/types/index.d.ts",
22
- "typesVersions": {
23
- ">=4.5 <4.9": {
24
- "*": [
25
- "dist/types-ts4.5/*",
26
- "dist/types-ts4.5/index.d.ts"
27
- ]
28
- }
29
- },
30
- "sideEffects": false,
31
- "atlaskit:src": "src/index.ts",
32
- "af:exports": {
33
- ".": "./src/index.ts"
34
- },
35
- "dependencies": {
36
- "@atlaskit/adf-schema": "^36.10.7",
37
- "@atlaskit/code": "^15.2.0",
38
- "@atlaskit/editor-common": "^82.0.0",
39
- "@atlaskit/editor-plugin-analytics": "^1.2.0",
40
- "@atlaskit/editor-plugin-composition": "^1.1.0",
41
- "@atlaskit/editor-plugin-decorations": "^1.1.0",
42
- "@atlaskit/editor-plugin-editor-disabled": "^1.1.0",
43
- "@atlaskit/editor-prosemirror": "4.0.1",
44
- "@atlaskit/icon": "^22.3.0",
45
- "@atlaskit/platform-feature-flags": "^0.2.0",
46
- "@atlaskit/prosemirror-input-rules": "^3.1.0",
47
- "@babel/runtime": "^7.0.0",
48
- "raf-schd": "^4.0.3"
49
- },
50
- "peerDependencies": {
51
- "react": "^16.8.0",
52
- "react-intl-next": "npm:react-intl@^5.18.1"
53
- },
54
- "devDependencies": {
55
- "typescript": "~5.4.2"
56
- },
57
- "techstack": {
58
- "@atlassian/frontend": {
59
- "import-structure": [
60
- "atlassian-conventions"
61
- ],
62
- "circular-dependencies": [
63
- "file-and-folder-level"
64
- ]
65
- },
66
- "@repo/internal": {
67
- "dom-events": "use-bind-event-listener",
68
- "analytics": [
69
- "analytics-next"
70
- ],
71
- "design-tokens": [
72
- "color"
73
- ],
74
- "theming": [
75
- "react-context"
76
- ],
77
- "ui-components": [
78
- "lite-mode"
79
- ],
80
- "deprecation": "no-deprecated-imports",
81
- "styling": [
82
- "emotion",
83
- "emotion"
84
- ],
85
- "imports": [
86
- "import-no-extraneous-disable-for-examples-and-docs"
87
- ]
88
- }
89
- },
90
- "stricter": {
91
- "no-unused-dependencies": {
92
- "checkDevDependencies": true
93
- }
94
- },
95
- "platform-feature-flags": {
96
- "platform.editor.live-view.disable-editing-in-view-mode_fi1rx": {
97
- "type": "boolean"
98
- },
99
- "platform.editor.codeblock-preserve-newlines_54r3m": {
100
- "type": "boolean"
101
- }
102
- }
103
- }
2
+ "name": "@atlaskit/editor-plugin-code-block",
3
+ "version": "1.4.0",
4
+ "description": "Code block plugin for @atlaskit/editor-core",
5
+ "author": "Atlassian Pty Ltd",
6
+ "license": "Apache-2.0",
7
+ "publishConfig": {
8
+ "registry": "https://registry.npmjs.org/"
9
+ },
10
+ "atlassian": {
11
+ "team": "Editor: Scarlet",
12
+ "singleton": true,
13
+ "inPublicMirror": false,
14
+ "releaseModel": "continuous",
15
+ "runReact18": false
16
+ },
17
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
18
+ "main": "dist/cjs/index.js",
19
+ "module": "dist/esm/index.js",
20
+ "module:es2019": "dist/es2019/index.js",
21
+ "types": "dist/types/index.d.ts",
22
+ "typesVersions": {
23
+ ">=4.5 <4.9": {
24
+ "*": [
25
+ "dist/types-ts4.5/*",
26
+ "dist/types-ts4.5/index.d.ts"
27
+ ]
28
+ }
29
+ },
30
+ "sideEffects": false,
31
+ "atlaskit:src": "src/index.ts",
32
+ "af:exports": {
33
+ ".": "./src/index.ts"
34
+ },
35
+ "dependencies": {
36
+ "@atlaskit/adf-schema": "^37.0.0",
37
+ "@atlaskit/code": "^15.3.0",
38
+ "@atlaskit/editor-common": "^82.12.0",
39
+ "@atlaskit/editor-plugin-analytics": "^1.3.0",
40
+ "@atlaskit/editor-plugin-composition": "^1.1.0",
41
+ "@atlaskit/editor-plugin-decorations": "^1.1.0",
42
+ "@atlaskit/editor-plugin-editor-disabled": "^1.1.0",
43
+ "@atlaskit/editor-prosemirror": "4.0.1",
44
+ "@atlaskit/icon": "^22.4.0",
45
+ "@atlaskit/platform-feature-flags": "^0.2.0",
46
+ "@atlaskit/prosemirror-input-rules": "^3.1.0",
47
+ "@babel/runtime": "^7.0.0",
48
+ "raf-schd": "^4.0.3"
49
+ },
50
+ "peerDependencies": {
51
+ "react": "^16.8.0",
52
+ "react-intl-next": "npm:react-intl@^5.18.1"
53
+ },
54
+ "devDependencies": {
55
+ "typescript": "~5.4.2"
56
+ },
57
+ "techstack": {
58
+ "@atlassian/frontend": {
59
+ "import-structure": [
60
+ "atlassian-conventions"
61
+ ],
62
+ "circular-dependencies": [
63
+ "file-and-folder-level"
64
+ ]
65
+ },
66
+ "@repo/internal": {
67
+ "dom-events": "use-bind-event-listener",
68
+ "analytics": [
69
+ "analytics-next"
70
+ ],
71
+ "design-tokens": [
72
+ "color"
73
+ ],
74
+ "theming": [
75
+ "react-context"
76
+ ],
77
+ "ui-components": [
78
+ "lite-mode"
79
+ ],
80
+ "deprecation": "no-deprecated-imports",
81
+ "styling": [
82
+ "emotion",
83
+ "emotion"
84
+ ],
85
+ "imports": [
86
+ "import-no-extraneous-disable-for-examples-and-docs"
87
+ ]
88
+ }
89
+ },
90
+ "stricter": {
91
+ "no-unused-dependencies": {
92
+ "checkDevDependencies": true
93
+ }
94
+ },
95
+ "platform-feature-flags": {
96
+ "platform.editor.live-view.disable-editing-in-view-mode_fi1rx": {
97
+ "type": "boolean"
98
+ },
99
+ "platform.editor.codeblock-preserve-newlines_54r3m": {
100
+ "type": "boolean"
101
+ }
102
+ }
103
+ }