@atlaskit/editor-plugin-code-block 5.0.12 → 5.0.13

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,13 @@
1
1
  # @atlaskit/editor-plugin-code-block
2
2
 
3
+ ## 5.0.13
4
+
5
+ ### Patch Changes
6
+
7
+ - [`265c1bf0cefa4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/265c1bf0cefa4) -
8
+ Sorted type and interface props to improve Atlaskit docs
9
+ - Updated dependencies
10
+
3
11
  ## 5.0.12
4
12
 
5
13
  ### Patch Changes
@@ -19,13 +19,13 @@ type CodeBlockDependencies = [
19
19
  OptionalPlugin<EditorViewModePlugin>
20
20
  ];
21
21
  export type CodeBlockPlugin = NextEditorPlugin<'codeBlock', {
22
- pluginConfiguration: CodeBlockPluginOptions | undefined;
22
+ actions: {
23
+ insertCodeBlock: (inputMethod: INPUT_METHOD) => Command;
24
+ };
23
25
  dependencies: CodeBlockDependencies;
26
+ pluginConfiguration: CodeBlockPluginOptions | undefined;
24
27
  sharedState: {
25
28
  copyButtonHoverNode: PMNode;
26
29
  } | undefined;
27
- actions: {
28
- insertCodeBlock: (inputMethod: INPUT_METHOD) => Command;
29
- };
30
30
  }>;
31
31
  export {};
@@ -22,8 +22,8 @@ export declare class CodeBlockView {
22
22
  private maintainDynamicGutterSize;
23
23
  update(node: PMNode): boolean;
24
24
  ignoreMutation(record: MutationRecord | {
25
- type: 'selection';
26
25
  target: Node;
26
+ type: 'selection';
27
27
  }): boolean;
28
28
  destroy(): void;
29
29
  }
@@ -4,8 +4,8 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
5
5
  export declare const copySelectionPluginKey: PluginKey<any>;
6
6
  type CodeBlockCopySelectionPluginState = {
7
- decorationStartAndEnd?: [start: number, end: number];
8
7
  codeBlockNode?: PMNode;
8
+ decorationStartAndEnd?: [start: number, end: number];
9
9
  };
10
10
  export declare function codeBlockCopySelectionPlugin(): SafePlugin<CodeBlockCopySelectionPluginState>;
11
11
  export declare function provideVisualFeedbackForCopyButton(state: EditorState, dispatch?: (tr: Transaction) => void): boolean;
@@ -1,10 +1,10 @@
1
1
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
3
3
  export type CodeBlockState = {
4
- pos: number | null;
5
4
  contentCopied: boolean;
5
+ decorations: DecorationSet;
6
6
  isNodeSelected: boolean;
7
+ pos: number | null;
7
8
  shouldIgnoreFollowingMutations: boolean;
8
- decorations: DecorationSet;
9
9
  };
10
10
  export declare const getPluginState: (state: EditorState) => CodeBlockState;
@@ -5,9 +5,9 @@ import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
5
5
  import type { CodeBlockPlugin } from '../index';
6
6
  import { type CodeBlockState } from './main-state';
7
7
  export declare const createPlugin: ({ useLongPressSelection, getIntl, allowCompositionInputOverride, api, }: {
8
- useLongPressSelection?: boolean;
9
- getIntl: () => IntlShape;
10
8
  allowCompositionInputOverride?: boolean;
11
9
  api?: ExtractInjectionAPI<CodeBlockPlugin>;
12
10
  decorations?: DecorationSet;
11
+ getIntl: () => IntlShape;
12
+ useLongPressSelection?: boolean;
13
13
  }) => SafePlugin<CodeBlockState>;
@@ -1,7 +1,7 @@
1
1
  import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
2
2
  export interface CodeBlockPluginOptions extends LongPressSelectionPluginOptions {
3
- allowCopyToClipboard?: boolean;
4
3
  allowCompositionInputOverride?: boolean;
4
+ allowCopyToClipboard?: boolean;
5
5
  overrideLanguageName?: (name: string) => string;
6
6
  }
7
7
  /**
@@ -11,6 +11,6 @@ export interface CodeBlockPluginOptions extends LongPressSelectionPluginOptions
11
11
  */
12
12
  export type CodeBlockOptions = CodeBlockPluginOptions;
13
13
  export type CodeBlockLineAttributes = {
14
- lineStart: number;
15
14
  lineNumber: number;
15
+ lineStart: number;
16
16
  };
@@ -19,13 +19,13 @@ type CodeBlockDependencies = [
19
19
  OptionalPlugin<EditorViewModePlugin>
20
20
  ];
21
21
  export type CodeBlockPlugin = NextEditorPlugin<'codeBlock', {
22
- pluginConfiguration: CodeBlockPluginOptions | undefined;
22
+ actions: {
23
+ insertCodeBlock: (inputMethod: INPUT_METHOD) => Command;
24
+ };
23
25
  dependencies: CodeBlockDependencies;
26
+ pluginConfiguration: CodeBlockPluginOptions | undefined;
24
27
  sharedState: {
25
28
  copyButtonHoverNode: PMNode;
26
29
  } | undefined;
27
- actions: {
28
- insertCodeBlock: (inputMethod: INPUT_METHOD) => Command;
29
- };
30
30
  }>;
31
31
  export {};
@@ -22,8 +22,8 @@ export declare class CodeBlockView {
22
22
  private maintainDynamicGutterSize;
23
23
  update(node: PMNode): boolean;
24
24
  ignoreMutation(record: MutationRecord | {
25
- type: 'selection';
26
25
  target: Node;
26
+ type: 'selection';
27
27
  }): boolean;
28
28
  destroy(): void;
29
29
  }
@@ -4,11 +4,11 @@ import { PluginKey } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
5
5
  export declare const copySelectionPluginKey: PluginKey<any>;
6
6
  type CodeBlockCopySelectionPluginState = {
7
+ codeBlockNode?: PMNode;
7
8
  decorationStartAndEnd?: [
8
9
  start: number,
9
10
  end: number
10
11
  ];
11
- codeBlockNode?: PMNode;
12
12
  };
13
13
  export declare function codeBlockCopySelectionPlugin(): SafePlugin<CodeBlockCopySelectionPluginState>;
14
14
  export declare function provideVisualFeedbackForCopyButton(state: EditorState, dispatch?: (tr: Transaction) => void): boolean;
@@ -1,10 +1,10 @@
1
1
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
3
3
  export type CodeBlockState = {
4
- pos: number | null;
5
4
  contentCopied: boolean;
5
+ decorations: DecorationSet;
6
6
  isNodeSelected: boolean;
7
+ pos: number | null;
7
8
  shouldIgnoreFollowingMutations: boolean;
8
- decorations: DecorationSet;
9
9
  };
10
10
  export declare const getPluginState: (state: EditorState) => CodeBlockState;
@@ -5,9 +5,9 @@ import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
5
5
  import type { CodeBlockPlugin } from '../index';
6
6
  import { type CodeBlockState } from './main-state';
7
7
  export declare const createPlugin: ({ useLongPressSelection, getIntl, allowCompositionInputOverride, api, }: {
8
- useLongPressSelection?: boolean;
9
- getIntl: () => IntlShape;
10
8
  allowCompositionInputOverride?: boolean;
11
9
  api?: ExtractInjectionAPI<CodeBlockPlugin>;
12
10
  decorations?: DecorationSet;
11
+ getIntl: () => IntlShape;
12
+ useLongPressSelection?: boolean;
13
13
  }) => SafePlugin<CodeBlockState>;
@@ -1,7 +1,7 @@
1
1
  import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
2
2
  export interface CodeBlockPluginOptions extends LongPressSelectionPluginOptions {
3
- allowCopyToClipboard?: boolean;
4
3
  allowCompositionInputOverride?: boolean;
4
+ allowCopyToClipboard?: boolean;
5
5
  overrideLanguageName?: (name: string) => string;
6
6
  }
7
7
  /**
@@ -11,6 +11,6 @@ export interface CodeBlockPluginOptions extends LongPressSelectionPluginOptions
11
11
  */
12
12
  export type CodeBlockOptions = CodeBlockPluginOptions;
13
13
  export type CodeBlockLineAttributes = {
14
- lineStart: number;
15
14
  lineNumber: number;
15
+ lineStart: number;
16
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-code-block",
3
- "version": "5.0.12",
3
+ "version": "5.0.13",
4
4
  "description": "Code block plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -42,11 +42,11 @@
42
42
  "@atlaskit/icon": "^28.0.0",
43
43
  "@atlaskit/platform-feature-flags": "^1.1.0",
44
44
  "@atlaskit/prosemirror-input-rules": "^3.4.0",
45
- "@atlaskit/tmp-editor-statsig": "^11.3.0",
45
+ "@atlaskit/tmp-editor-statsig": "^11.5.0",
46
46
  "@babel/runtime": "^7.0.0"
47
47
  },
48
48
  "peerDependencies": {
49
- "@atlaskit/editor-common": "^107.26.0",
49
+ "@atlaskit/editor-common": "^107.28.0",
50
50
  "react": "^18.2.0",
51
51
  "react-intl-next": "npm:react-intl@^5.18.1"
52
52
  },