@atlaskit/editor-plugin-code-block 3.2.2 → 3.2.4

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,25 @@
1
1
  # @atlaskit/editor-plugin-code-block
2
2
 
3
+ ## 3.2.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#126818](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/126818)
8
+ [`197b047fbe6e6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/197b047fbe6e6) -
9
+ ED-24245 - Adding analytics TRACK event that is triggered when the user clicks the toggle word
10
+ wrap button on the code block floating toolbar.
11
+
12
+ ## 3.2.3
13
+
14
+ ### Patch Changes
15
+
16
+ - [#125133](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/125133)
17
+ [`d804e5dd3216b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d804e5dd3216b) -
18
+ ED-24226 - Add state to manage the toggle word wrap state of code blocks. New WeakMap added in
19
+ editor-common/src/code-block, as word wrap state is shared throughout the editor. Covers regular
20
+ changes to code block by the user via the node view update function. Covers breakout of code block
21
+ node. Does not cover drag&drop & cut&paste edge cases.
22
+
3
23
  ## 3.2.2
4
24
 
5
25
  ### Patch Changes
@@ -7,17 +7,20 @@ exports.copyContentToClipboard = exports.changeLanguage = void 0;
7
7
  exports.createInsertCodeBlockTransaction = createInsertCodeBlockTransaction;
8
8
  exports.ignoreFollowingMutations = void 0;
9
9
  exports.insertCodeBlockWithAnalytics = insertCodeBlockWithAnalytics;
10
- exports.wrapCodeBlock = exports.resetShouldIgnoreFollowingMutations = exports.resetCopiedState = exports.removeCodeBlock = void 0;
10
+ exports.toggleWordWrapStateForCodeBlockNode = exports.resetShouldIgnoreFollowingMutations = exports.resetCopiedState = exports.removeCodeBlock = void 0;
11
11
  var _analytics = require("@atlaskit/editor-common/analytics");
12
12
  var _clipboard = require("@atlaskit/editor-common/clipboard");
13
+ var _codeBlock = require("@atlaskit/editor-common/code-block");
13
14
  var _editorAnalytics = require("@atlaskit/editor-common/editor-analytics");
14
15
  var _insert = require("@atlaskit/editor-common/insert");
15
16
  var _state = require("@atlaskit/editor-prosemirror/state");
16
17
  var _utils = require("@atlaskit/editor-prosemirror/utils");
18
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
19
  var _pluginKey = require("./plugin-key");
18
20
  var _actions = require("./pm-plugins/actions");
19
21
  var _codeBlockCopySelectionPlugin = require("./pm-plugins/codeBlockCopySelectionPlugin");
20
22
  var _transformToCodeBlock = require("./transform-to-code-block");
23
+ var _utils2 = require("./utils");
21
24
  var removeCodeBlock = exports.removeCodeBlock = function removeCodeBlock(state, dispatch) {
22
25
  var nodes = state.schema.nodes,
23
26
  tr = state.tr;
@@ -32,11 +35,6 @@ var removeCodeBlock = exports.removeCodeBlock = function removeCodeBlock(state,
32
35
  }
33
36
  return true;
34
37
  };
35
-
36
- // we will be hooking the button up in this follow up card ED-24222
37
- var wrapCodeBlock = exports.wrapCodeBlock = function wrapCodeBlock(state, dispatch) {
38
- return false;
39
- };
40
38
  var changeLanguage = exports.changeLanguage = function changeLanguage(editorAnalyticsAPI) {
41
39
  return function (language) {
42
40
  return function (state, dispatch) {
@@ -203,4 +201,44 @@ function insertCodeBlockWithAnalytics(inputMethod, analyticsAPI) {
203
201
  }
204
202
  return true;
205
203
  });
206
- }
204
+ }
205
+
206
+ /**
207
+ * Add the given node to the codeBlockWrappedStates WeakMap with the toggle boolean value.
208
+ */
209
+ var toggleWordWrapStateForCodeBlockNode = exports.toggleWordWrapStateForCodeBlockNode = function toggleWordWrapStateForCodeBlockNode(editorAnalyticsAPI) {
210
+ return function (state, dispatch) {
211
+ var _findCodeBlock;
212
+ if (!(0, _platformFeatureFlags.fg)('editor_support_code_block_wrapping')) {
213
+ return false;
214
+ }
215
+ var codeBlockNode = (_findCodeBlock = (0, _utils2.findCodeBlock)(state)) === null || _findCodeBlock === void 0 ? void 0 : _findCodeBlock.node;
216
+ var tr = state.tr;
217
+ if (!_codeBlock.codeBlockWrappedStates || !codeBlockNode) {
218
+ return false;
219
+ }
220
+ var updatedToggleState = !(0, _codeBlock.isCodeBlockWordWrapEnabled)(codeBlockNode);
221
+ _codeBlock.codeBlockWrappedStates.set(codeBlockNode, updatedToggleState);
222
+
223
+ // TODO: Remove in ED-24222. Leaving here for demo purposes.
224
+ // eslint-disable-next-line no-console
225
+ console.log("Code Block Word Wrap: Updating codeBlockWrappedStates with: ".concat(updatedToggleState));
226
+ if (dispatch) {
227
+ var payload = {
228
+ action: _analytics.ACTION.TOGGLE_CODE_BLOCK_WRAP,
229
+ actionSubject: _analytics.ACTION_SUBJECT.CODE_BLOCK,
230
+ attributes: {
231
+ platform: _analytics.PLATFORMS.WEB,
232
+ mode: _analytics.MODE.EDITOR,
233
+ wordWrapEnabled: updatedToggleState
234
+ },
235
+ eventType: _analytics.EVENT_TYPE.TRACK
236
+ };
237
+
238
+ // TODO: ED-24320 should convert this to attachAnalyticsEvent if it is dispatching a transaction here.
239
+ editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.fireAnalyticsEvent(payload);
240
+ dispatch(tr);
241
+ }
242
+ return true;
243
+ };
244
+ };
@@ -9,6 +9,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
  var _rafSchd = _interopRequireDefault(require("raf-schd"));
12
+ var _codeBlock = require("@atlaskit/editor-common/code-block");
12
13
  var _utils = require("@atlaskit/editor-common/utils");
13
14
  var _model = require("@atlaskit/editor-prosemirror/model");
14
15
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
@@ -142,6 +143,9 @@ var CodeBlockView = exports.CodeBlockView = /*#__PURE__*/function () {
142
143
  return false;
143
144
  }
144
145
  if (node !== this.node) {
146
+ if ((0, _platformFeatureFlags.fg)('editor_support_code_block_wrapping')) {
147
+ (0, _codeBlock.transferCodeBlockWrappedValue)(this.node, node);
148
+ }
145
149
  if (node.attrs.language !== this.node.attrs.language) {
146
150
  this.contentDOM.setAttribute('data-language', node.attrs.language || '');
147
151
  }
@@ -105,7 +105,8 @@ var getToolbarConfig = exports.getToolbarConfig = function getToolbarConfig() {
105
105
  id: 'editor.codeBlock.wrap',
106
106
  type: 'button',
107
107
  icon: _WrapIcon.WrapIcon,
108
- onClick: _actions.wrapCodeBlock,
108
+ onClick: (0, _actions.toggleWordWrapStateForCodeBlockNode)(editorAnalyticsAPI),
109
+ // Hooking up here for demo purposes. To be revisited with ED-24222.
109
110
  title: formatMessage(_messages.codeBlockButtonMessages.wrapCode),
110
111
  tabIndex: null
111
112
  };
@@ -1,13 +1,16 @@
1
- import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
1
+ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, MODE, PLATFORMS } from '@atlaskit/editor-common/analytics';
2
2
  import { copyToClipboard } from '@atlaskit/editor-common/clipboard';
3
+ import { codeBlockWrappedStates, isCodeBlockWordWrapEnabled } from '@atlaskit/editor-common/code-block';
3
4
  import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
4
5
  import { shouldSplitSelectedNodeOnNodeInsertion } from '@atlaskit/editor-common/insert';
5
6
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
6
7
  import { findParentNodeOfType, findSelectedNodeOfType, isNodeSelection, removeParentNodeOfType, removeSelectedNode, safeInsert } from '@atlaskit/editor-prosemirror/utils';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
7
9
  import { pluginKey } from './plugin-key';
8
10
  import { ACTIONS } from './pm-plugins/actions';
9
11
  import { copySelectionPluginKey } from './pm-plugins/codeBlockCopySelectionPlugin';
10
12
  import { transformToCodeBlockAction } from './transform-to-code-block';
13
+ import { findCodeBlock } from './utils';
11
14
  export const removeCodeBlock = (state, dispatch) => {
12
15
  const {
13
16
  schema: {
@@ -26,11 +29,6 @@ export const removeCodeBlock = (state, dispatch) => {
26
29
  }
27
30
  return true;
28
31
  };
29
-
30
- // we will be hooking the button up in this follow up card ED-24222
31
- export const wrapCodeBlock = (state, dispatch) => {
32
- return false;
33
- };
34
32
  export const changeLanguage = editorAnalyticsAPI => language => (state, dispatch) => {
35
33
  var _pluginKey$getState;
36
34
  const {
@@ -213,4 +211,44 @@ export function insertCodeBlockWithAnalytics(inputMethod, analyticsAPI) {
213
211
  }
214
212
  return true;
215
213
  });
216
- }
214
+ }
215
+
216
+ /**
217
+ * Add the given node to the codeBlockWrappedStates WeakMap with the toggle boolean value.
218
+ */
219
+ export const toggleWordWrapStateForCodeBlockNode = editorAnalyticsAPI => (state, dispatch) => {
220
+ var _findCodeBlock;
221
+ if (!fg('editor_support_code_block_wrapping')) {
222
+ return false;
223
+ }
224
+ const codeBlockNode = (_findCodeBlock = findCodeBlock(state)) === null || _findCodeBlock === void 0 ? void 0 : _findCodeBlock.node;
225
+ const {
226
+ tr
227
+ } = state;
228
+ if (!codeBlockWrappedStates || !codeBlockNode) {
229
+ return false;
230
+ }
231
+ const updatedToggleState = !isCodeBlockWordWrapEnabled(codeBlockNode);
232
+ codeBlockWrappedStates.set(codeBlockNode, updatedToggleState);
233
+
234
+ // TODO: Remove in ED-24222. Leaving here for demo purposes.
235
+ // eslint-disable-next-line no-console
236
+ console.log(`Code Block Word Wrap: Updating codeBlockWrappedStates with: ${updatedToggleState}`);
237
+ if (dispatch) {
238
+ const payload = {
239
+ action: ACTION.TOGGLE_CODE_BLOCK_WRAP,
240
+ actionSubject: ACTION_SUBJECT.CODE_BLOCK,
241
+ attributes: {
242
+ platform: PLATFORMS.WEB,
243
+ mode: MODE.EDITOR,
244
+ wordWrapEnabled: updatedToggleState
245
+ },
246
+ eventType: EVENT_TYPE.TRACK
247
+ };
248
+
249
+ // TODO: ED-24320 should convert this to attachAnalyticsEvent if it is dispatching a transaction here.
250
+ editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 ? void 0 : editorAnalyticsAPI.fireAnalyticsEvent(payload);
251
+ dispatch(tr);
252
+ }
253
+ return true;
254
+ };
@@ -1,5 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import rafSchedule from 'raf-schd';
3
+ import { transferCodeBlockWrappedValue } from '@atlaskit/editor-common/code-block';
3
4
  import { browser } from '@atlaskit/editor-common/utils';
4
5
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
5
6
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -119,6 +120,9 @@ export class CodeBlockView {
119
120
  return false;
120
121
  }
121
122
  if (node !== this.node) {
123
+ if (fg('editor_support_code_block_wrapping')) {
124
+ transferCodeBlockWrappedValue(this.node, node);
125
+ }
122
126
  if (node.attrs.language !== this.node.attrs.language) {
123
127
  this.contentDOM.setAttribute('data-language', node.attrs.language || '');
124
128
  }
@@ -3,7 +3,7 @@ import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
3
3
  import CopyIcon from '@atlaskit/icon/glyph/copy';
4
4
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
5
5
  import { fg } from '@atlaskit/platform-feature-flags';
6
- import { changeLanguage, copyContentToClipboard, removeCodeBlock, resetCopiedState, wrapCodeBlock } from './actions';
6
+ import { changeLanguage, copyContentToClipboard, removeCodeBlock, resetCopiedState, toggleWordWrapStateForCodeBlockNode } from './actions';
7
7
  import { createLanguageList, DEFAULT_LANGUAGES, getLanguageIdentifier } from './language-list';
8
8
  import { pluginKey } from './plugin-key';
9
9
  import { provideVisualFeedbackForCopyButton, removeVisualFeedbackForCopyButton } from './pm-plugins/codeBlockCopySelectionPlugin';
@@ -86,7 +86,8 @@ export const getToolbarConfig = (allowCopyToClipboard = false, api) => (state, {
86
86
  id: 'editor.codeBlock.wrap',
87
87
  type: 'button',
88
88
  icon: WrapIcon,
89
- onClick: wrapCodeBlock,
89
+ onClick: toggleWordWrapStateForCodeBlockNode(editorAnalyticsAPI),
90
+ // Hooking up here for demo purposes. To be revisited with ED-24222.
90
91
  title: formatMessage(codeBlockButtonMessages.wrapCode),
91
92
  tabIndex: null
92
93
  };
@@ -1,13 +1,16 @@
1
- import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
1
+ import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, MODE, PLATFORMS } from '@atlaskit/editor-common/analytics';
2
2
  import { copyToClipboard } from '@atlaskit/editor-common/clipboard';
3
+ import { codeBlockWrappedStates, isCodeBlockWordWrapEnabled } from '@atlaskit/editor-common/code-block';
3
4
  import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
4
5
  import { shouldSplitSelectedNodeOnNodeInsertion } from '@atlaskit/editor-common/insert';
5
6
  import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
6
7
  import { findParentNodeOfType, findSelectedNodeOfType, isNodeSelection, removeParentNodeOfType, removeSelectedNode, safeInsert } from '@atlaskit/editor-prosemirror/utils';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
7
9
  import { pluginKey } from './plugin-key';
8
10
  import { ACTIONS } from './pm-plugins/actions';
9
11
  import { copySelectionPluginKey } from './pm-plugins/codeBlockCopySelectionPlugin';
10
12
  import { transformToCodeBlockAction } from './transform-to-code-block';
13
+ import { findCodeBlock } from './utils';
11
14
  export var removeCodeBlock = function removeCodeBlock(state, dispatch) {
12
15
  var nodes = state.schema.nodes,
13
16
  tr = state.tr;
@@ -22,11 +25,6 @@ export var removeCodeBlock = function removeCodeBlock(state, dispatch) {
22
25
  }
23
26
  return true;
24
27
  };
25
-
26
- // we will be hooking the button up in this follow up card ED-24222
27
- export var wrapCodeBlock = function wrapCodeBlock(state, dispatch) {
28
- return false;
29
- };
30
28
  export var changeLanguage = function changeLanguage(editorAnalyticsAPI) {
31
29
  return function (language) {
32
30
  return function (state, dispatch) {
@@ -193,4 +191,44 @@ export function insertCodeBlockWithAnalytics(inputMethod, analyticsAPI) {
193
191
  }
194
192
  return true;
195
193
  });
196
- }
194
+ }
195
+
196
+ /**
197
+ * Add the given node to the codeBlockWrappedStates WeakMap with the toggle boolean value.
198
+ */
199
+ export var toggleWordWrapStateForCodeBlockNode = function toggleWordWrapStateForCodeBlockNode(editorAnalyticsAPI) {
200
+ return function (state, dispatch) {
201
+ var _findCodeBlock;
202
+ if (!fg('editor_support_code_block_wrapping')) {
203
+ return false;
204
+ }
205
+ var codeBlockNode = (_findCodeBlock = findCodeBlock(state)) === null || _findCodeBlock === void 0 ? void 0 : _findCodeBlock.node;
206
+ var tr = state.tr;
207
+ if (!codeBlockWrappedStates || !codeBlockNode) {
208
+ return false;
209
+ }
210
+ var updatedToggleState = !isCodeBlockWordWrapEnabled(codeBlockNode);
211
+ codeBlockWrappedStates.set(codeBlockNode, updatedToggleState);
212
+
213
+ // TODO: Remove in ED-24222. Leaving here for demo purposes.
214
+ // eslint-disable-next-line no-console
215
+ console.log("Code Block Word Wrap: Updating codeBlockWrappedStates with: ".concat(updatedToggleState));
216
+ if (dispatch) {
217
+ var payload = {
218
+ action: ACTION.TOGGLE_CODE_BLOCK_WRAP,
219
+ actionSubject: ACTION_SUBJECT.CODE_BLOCK,
220
+ attributes: {
221
+ platform: PLATFORMS.WEB,
222
+ mode: MODE.EDITOR,
223
+ wordWrapEnabled: updatedToggleState
224
+ },
225
+ eventType: EVENT_TYPE.TRACK
226
+ };
227
+
228
+ // TODO: ED-24320 should convert this to attachAnalyticsEvent if it is dispatching a transaction here.
229
+ editorAnalyticsAPI === null || editorAnalyticsAPI === void 0 || editorAnalyticsAPI.fireAnalyticsEvent(payload);
230
+ dispatch(tr);
231
+ }
232
+ return true;
233
+ };
234
+ };
@@ -2,6 +2,7 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  import rafSchedule from 'raf-schd';
5
+ import { transferCodeBlockWrappedValue } from '@atlaskit/editor-common/code-block';
5
6
  import { browser } from '@atlaskit/editor-common/utils';
6
7
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
7
8
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -135,6 +136,9 @@ export var CodeBlockView = /*#__PURE__*/function () {
135
136
  return false;
136
137
  }
137
138
  if (node !== this.node) {
139
+ if (fg('editor_support_code_block_wrapping')) {
140
+ transferCodeBlockWrappedValue(this.node, node);
141
+ }
138
142
  if (node.attrs.language !== this.node.attrs.language) {
139
143
  this.contentDOM.setAttribute('data-language', node.attrs.language || '');
140
144
  }
@@ -3,7 +3,7 @@ import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
3
3
  import CopyIcon from '@atlaskit/icon/glyph/copy';
4
4
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
5
5
  import { fg } from '@atlaskit/platform-feature-flags';
6
- import { changeLanguage, copyContentToClipboard, removeCodeBlock, resetCopiedState, wrapCodeBlock } from './actions';
6
+ import { changeLanguage, copyContentToClipboard, removeCodeBlock, resetCopiedState, toggleWordWrapStateForCodeBlockNode } from './actions';
7
7
  import { createLanguageList, DEFAULT_LANGUAGES, getLanguageIdentifier } from './language-list';
8
8
  import { pluginKey } from './plugin-key';
9
9
  import { provideVisualFeedbackForCopyButton, removeVisualFeedbackForCopyButton } from './pm-plugins/codeBlockCopySelectionPlugin';
@@ -95,7 +95,8 @@ export var getToolbarConfig = function getToolbarConfig() {
95
95
  id: 'editor.codeBlock.wrap',
96
96
  type: 'button',
97
97
  icon: WrapIcon,
98
- onClick: wrapCodeBlock,
98
+ onClick: toggleWordWrapStateForCodeBlockNode(editorAnalyticsAPI),
99
+ // Hooking up here for demo purposes. To be revisited with ED-24222.
99
100
  title: formatMessage(codeBlockButtonMessages.wrapCode),
100
101
  tabIndex: null
101
102
  };
@@ -2,7 +2,6 @@ import type { EditorAnalyticsAPI, INPUT_METHOD } from '@atlaskit/editor-common/a
2
2
  import type { Command } from '@atlaskit/editor-common/types';
3
3
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
4
  export declare const removeCodeBlock: Command;
5
- export declare const wrapCodeBlock: Command;
6
5
  export declare const changeLanguage: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (language: string) => Command;
7
6
  export declare const copyContentToClipboard: Command;
8
7
  export declare const resetCopiedState: Command;
@@ -17,3 +16,7 @@ export declare function createInsertCodeBlockTransaction({ state }: {
17
16
  state: EditorState;
18
17
  }): import("prosemirror-state").Transaction;
19
18
  export declare function insertCodeBlockWithAnalytics(inputMethod: INPUT_METHOD, analyticsAPI?: EditorAnalyticsAPI): Command;
19
+ /**
20
+ * Add the given node to the codeBlockWrappedStates WeakMap with the toggle boolean value.
21
+ */
22
+ export declare const toggleWordWrapStateForCodeBlockNode: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
@@ -2,7 +2,7 @@ import type { IntlShape } from 'react-intl-next';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
4
  import type { CodeBlockPlugin } from '../index';
5
- import type { CodeBlockState } from './main-state';
5
+ import { type CodeBlockState } from './main-state';
6
6
  export declare const createPlugin: ({ useLongPressSelection, getIntl, allowCompositionInputOverride, api, isWrapped, }: {
7
7
  useLongPressSelection?: boolean | undefined;
8
8
  getIntl: () => IntlShape;
@@ -2,7 +2,6 @@ import type { EditorAnalyticsAPI, INPUT_METHOD } from '@atlaskit/editor-common/a
2
2
  import type { Command } from '@atlaskit/editor-common/types';
3
3
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
4
  export declare const removeCodeBlock: Command;
5
- export declare const wrapCodeBlock: Command;
6
5
  export declare const changeLanguage: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (language: string) => Command;
7
6
  export declare const copyContentToClipboard: Command;
8
7
  export declare const resetCopiedState: Command;
@@ -17,3 +16,7 @@ export declare function createInsertCodeBlockTransaction({ state }: {
17
16
  state: EditorState;
18
17
  }): import("prosemirror-state").Transaction;
19
18
  export declare function insertCodeBlockWithAnalytics(inputMethod: INPUT_METHOD, analyticsAPI?: EditorAnalyticsAPI): Command;
19
+ /**
20
+ * Add the given node to the codeBlockWrappedStates WeakMap with the toggle boolean value.
21
+ */
22
+ export declare const toggleWordWrapStateForCodeBlockNode: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => Command;
@@ -2,7 +2,7 @@ import type { IntlShape } from 'react-intl-next';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
4
  import type { CodeBlockPlugin } from '../index';
5
- import type { CodeBlockState } from './main-state';
5
+ import { type CodeBlockState } from './main-state';
6
6
  export declare const createPlugin: ({ useLongPressSelection, getIntl, allowCompositionInputOverride, api, isWrapped, }: {
7
7
  useLongPressSelection?: boolean | undefined;
8
8
  getIntl: () => IntlShape;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-code-block",
3
- "version": "3.2.2",
3
+ "version": "3.2.4",
4
4
  "description": "Code block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,13 +35,13 @@
35
35
  "dependencies": {
36
36
  "@atlaskit/adf-schema": "^40.3.0",
37
37
  "@atlaskit/code": "^15.4.0",
38
- "@atlaskit/editor-common": "^87.0.0",
38
+ "@atlaskit/editor-common": "^87.3.0",
39
39
  "@atlaskit/editor-plugin-analytics": "^1.6.0",
40
40
  "@atlaskit/editor-plugin-composition": "^1.2.0",
41
41
  "@atlaskit/editor-plugin-decorations": "^1.2.0",
42
42
  "@atlaskit/editor-plugin-editor-disabled": "^1.2.0",
43
43
  "@atlaskit/editor-prosemirror": "5.0.1",
44
- "@atlaskit/icon": "^22.8.0",
44
+ "@atlaskit/icon": "^22.10.0",
45
45
  "@atlaskit/platform-feature-flags": "^0.3.0",
46
46
  "@atlaskit/prosemirror-input-rules": "^3.2.0",
47
47
  "@babel/runtime": "^7.0.0",