@atlaskit/editor-plugin-code-block 0.1.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 +1 -0
- package/LICENSE.md +13 -0
- package/README.md +30 -0
- package/dist/cjs/actions.js +201 -0
- package/dist/cjs/ide-ux/bracket-handling.js +35 -0
- package/dist/cjs/ide-ux/commands.js +115 -0
- package/dist/cjs/ide-ux/line-handling.js +81 -0
- package/dist/cjs/ide-ux/paired-character-handling.js +23 -0
- package/dist/cjs/ide-ux/quote-handling.js +40 -0
- package/dist/cjs/index.js +13 -0
- package/dist/cjs/language-list.js +62 -0
- package/dist/cjs/nodeviews/code-block.js +153 -0
- package/dist/cjs/plugin-key.js +8 -0
- package/dist/cjs/plugin.js +120 -0
- package/dist/cjs/pm-plugins/actions.js +10 -0
- package/dist/cjs/pm-plugins/codeBlockCopySelectionPlugin.js +113 -0
- package/dist/cjs/pm-plugins/ide-ux.js +132 -0
- package/dist/cjs/pm-plugins/input-rule.js +68 -0
- package/dist/cjs/pm-plugins/keymaps.js +66 -0
- package/dist/cjs/pm-plugins/main-state.js +10 -0
- package/dist/cjs/pm-plugins/main.js +114 -0
- package/dist/cjs/refresh-browser-selection.js +29 -0
- package/dist/cjs/toolbar.js +131 -0
- package/dist/cjs/transform-to-code-block.js +84 -0
- package/dist/cjs/types.js +5 -0
- package/dist/cjs/ui/class-names.js +15 -0
- package/dist/cjs/utils.js +28 -0
- package/dist/es2019/actions.js +211 -0
- package/dist/es2019/ide-ux/bracket-handling.js +27 -0
- package/dist/es2019/ide-ux/commands.js +115 -0
- package/dist/es2019/ide-ux/line-handling.js +75 -0
- package/dist/es2019/ide-ux/paired-character-handling.js +12 -0
- package/dist/es2019/ide-ux/quote-handling.js +32 -0
- package/dist/es2019/index.js +1 -0
- package/dist/es2019/language-list.js +51 -0
- package/dist/es2019/nodeviews/code-block.js +126 -0
- package/dist/es2019/plugin-key.js +2 -0
- package/dist/es2019/plugin.js +104 -0
- package/dist/es2019/pm-plugins/actions.js +4 -0
- package/dist/es2019/pm-plugins/codeBlockCopySelectionPlugin.js +101 -0
- package/dist/es2019/pm-plugins/ide-ux.js +135 -0
- package/dist/es2019/pm-plugins/input-rule.js +60 -0
- package/dist/es2019/pm-plugins/keymaps.js +58 -0
- package/dist/es2019/pm-plugins/main-state.js +2 -0
- package/dist/es2019/pm-plugins/main.js +102 -0
- package/dist/es2019/refresh-browser-selection.js +25 -0
- package/dist/es2019/toolbar.js +108 -0
- package/dist/es2019/transform-to-code-block.js +79 -0
- package/dist/es2019/types.js +1 -0
- package/dist/es2019/ui/class-names.js +9 -0
- package/dist/es2019/utils.js +4 -0
- package/dist/esm/actions.js +191 -0
- package/dist/esm/ide-ux/bracket-handling.js +29 -0
- package/dist/esm/ide-ux/commands.js +107 -0
- package/dist/esm/ide-ux/line-handling.js +73 -0
- package/dist/esm/ide-ux/paired-character-handling.js +16 -0
- package/dist/esm/ide-ux/quote-handling.js +34 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/language-list.js +52 -0
- package/dist/esm/nodeviews/code-block.js +146 -0
- package/dist/esm/plugin-key.js +2 -0
- package/dist/esm/plugin.js +113 -0
- package/dist/esm/pm-plugins/actions.js +4 -0
- package/dist/esm/pm-plugins/codeBlockCopySelectionPlugin.js +103 -0
- package/dist/esm/pm-plugins/ide-ux.js +126 -0
- package/dist/esm/pm-plugins/input-rule.js +62 -0
- package/dist/esm/pm-plugins/keymaps.js +59 -0
- package/dist/esm/pm-plugins/main-state.js +4 -0
- package/dist/esm/pm-plugins/main.js +107 -0
- package/dist/esm/refresh-browser-selection.js +25 -0
- package/dist/esm/toolbar.js +121 -0
- package/dist/esm/transform-to-code-block.js +77 -0
- package/dist/esm/types.js +1 -0
- package/dist/esm/ui/class-names.js +9 -0
- package/dist/esm/utils.js +4 -0
- package/dist/types/actions.d.ts +18 -0
- package/dist/types/ide-ux/bracket-handling.d.ts +12 -0
- package/dist/types/ide-ux/commands.d.ts +7 -0
- package/dist/types/ide-ux/line-handling.d.ts +25 -0
- package/dist/types/ide-ux/paired-character-handling.d.ts +2 -0
- package/dist/types/ide-ux/quote-handling.d.ts +12 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/language-list.d.ts +942 -0
- package/dist/types/nodeviews/code-block.d.ts +21 -0
- package/dist/types/plugin-key.d.ts +2 -0
- package/dist/types/plugin.d.ts +19 -0
- package/dist/types/pm-plugins/actions.d.ts +4 -0
- package/dist/types/pm-plugins/codeBlockCopySelectionPlugin.d.ts +11 -0
- package/dist/types/pm-plugins/ide-ux.d.ts +5 -0
- package/dist/types/pm-plugins/input-rule.d.ts +3 -0
- package/dist/types/pm-plugins/keymaps.d.ts +4 -0
- package/dist/types/pm-plugins/main-state.d.ts +8 -0
- package/dist/types/pm-plugins/main.d.ts +10 -0
- package/dist/types/refresh-browser-selection.d.ts +5 -0
- package/dist/types/toolbar.d.ts +14 -0
- package/dist/types/transform-to-code-block.d.ts +3 -0
- package/dist/types/types.d.ts +6 -0
- package/dist/types/ui/class-names.d.ts +8 -0
- package/dist/types/utils.d.ts +4 -0
- package/dist/types-ts4.5/actions.d.ts +18 -0
- package/dist/types-ts4.5/ide-ux/bracket-handling.d.ts +12 -0
- package/dist/types-ts4.5/ide-ux/commands.d.ts +7 -0
- package/dist/types-ts4.5/ide-ux/line-handling.d.ts +25 -0
- package/dist/types-ts4.5/ide-ux/paired-character-handling.d.ts +2 -0
- package/dist/types-ts4.5/ide-ux/quote-handling.d.ts +12 -0
- package/dist/types-ts4.5/index.d.ts +3 -0
- package/dist/types-ts4.5/language-list.d.ts +1641 -0
- package/dist/types-ts4.5/nodeviews/code-block.d.ts +21 -0
- package/dist/types-ts4.5/plugin-key.d.ts +2 -0
- package/dist/types-ts4.5/plugin.d.ts +19 -0
- package/dist/types-ts4.5/pm-plugins/actions.d.ts +4 -0
- package/dist/types-ts4.5/pm-plugins/codeBlockCopySelectionPlugin.d.ts +14 -0
- package/dist/types-ts4.5/pm-plugins/ide-ux.d.ts +5 -0
- package/dist/types-ts4.5/pm-plugins/input-rule.d.ts +3 -0
- package/dist/types-ts4.5/pm-plugins/keymaps.d.ts +4 -0
- package/dist/types-ts4.5/pm-plugins/main-state.d.ts +8 -0
- package/dist/types-ts4.5/pm-plugins/main.d.ts +10 -0
- package/dist/types-ts4.5/refresh-browser-selection.d.ts +5 -0
- package/dist/types-ts4.5/toolbar.d.ts +14 -0
- package/dist/types-ts4.5/transform-to-code-block.d.ts +3 -0
- package/dist/types-ts4.5/types.d.ts +6 -0
- package/dist/types-ts4.5/ui/class-names.d.ts +8 -0
- package/dist/types-ts4.5/utils.d.ts +4 -0
- package/package.json +99 -0
- package/report.api.md +73 -0
- package/tmp/api-report-tmp.d.ts +45 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { getPosHandler, getPosHandlerNode } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
export declare class CodeBlockView {
|
|
5
|
+
node: Node;
|
|
6
|
+
dom: HTMLElement;
|
|
7
|
+
contentDOM: HTMLElement;
|
|
8
|
+
lineNumberGutter: HTMLElement;
|
|
9
|
+
getPos: getPosHandlerNode;
|
|
10
|
+
view: EditorView;
|
|
11
|
+
constructor(node: Node, view: EditorView, getPos: getPosHandlerNode);
|
|
12
|
+
updateDOMAndSelection(savedInnerHTML: string, newCursorPosition: number): void;
|
|
13
|
+
coalesceDOMElements(): void;
|
|
14
|
+
private ensureLineNumbers;
|
|
15
|
+
update(node: Node): boolean;
|
|
16
|
+
ignoreMutation(record: MutationRecord | {
|
|
17
|
+
type: 'selection';
|
|
18
|
+
target: Element;
|
|
19
|
+
}): boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare const codeBlockNodeView: (node: Node, view: EditorView, getPos: getPosHandler) => CodeBlockView;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { Command, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
|
+
import type { compositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
5
|
+
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
6
|
+
import type { CodeBlockOptions } from './types';
|
|
7
|
+
export type CodeBlockPlugin = NextEditorPlugin<'codeBlock', {
|
|
8
|
+
pluginConfiguration: CodeBlockOptions;
|
|
9
|
+
dependencies: [
|
|
10
|
+
typeof decorationsPlugin,
|
|
11
|
+
typeof compositionPlugin,
|
|
12
|
+
OptionalPlugin<typeof analyticsPlugin>
|
|
13
|
+
];
|
|
14
|
+
actions: {
|
|
15
|
+
insertCodeBlock: (inputMethod: INPUT_METHOD) => Command;
|
|
16
|
+
};
|
|
17
|
+
}>;
|
|
18
|
+
declare const codeBlockPlugin: CodeBlockPlugin;
|
|
19
|
+
export default codeBlockPlugin;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
export declare const copySelectionPluginKey: PluginKey<any>;
|
|
5
|
+
type CodeBlockCopySelectionPluginState = {
|
|
6
|
+
decorationStartAndEnd?: [
|
|
7
|
+
start: number,
|
|
8
|
+
end: number
|
|
9
|
+
];
|
|
10
|
+
};
|
|
11
|
+
export declare function codeBlockCopySelectionPlugin(): SafePlugin<CodeBlockCopySelectionPluginState>;
|
|
12
|
+
export declare function provideVisualFeedbackForCopyButton(state: EditorState, dispatch?: (tr: Transaction) => void): boolean;
|
|
13
|
+
export declare function removeVisualFeedbackForCopyButton(state: EditorState, dispatch?: (tr: Transaction) => void): boolean;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
+
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
3
|
+
import type { CodeBlockPlugin } from '../index';
|
|
4
|
+
declare const ideUX: (pluginInjectionApi: ExtractInjectionAPI<CodeBlockPlugin> | undefined) => SafePlugin<any>;
|
|
5
|
+
export default ideUX;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
export declare function createCodeBlockInputRule(schema: Schema, editorAnalyticsAPI?: EditorAnalyticsAPI): import("@atlaskit/editor-common/safe-plugin").SafePlugin<any>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
export type CodeBlockState = {
|
|
3
|
+
pos: number | null;
|
|
4
|
+
contentCopied: boolean;
|
|
5
|
+
isNodeSelected: boolean;
|
|
6
|
+
shouldIgnoreFollowingMutations: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const getPluginState: (state: EditorState) => CodeBlockState;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
3
|
+
import type { EditorAppearance } from '@atlaskit/editor-common/types';
|
|
4
|
+
import type { CodeBlockState } from './main-state';
|
|
5
|
+
export declare const createPlugin: ({ useLongPressSelection, getIntl, appearance, allowCompositionInputOverride, }: {
|
|
6
|
+
useLongPressSelection?: boolean | undefined;
|
|
7
|
+
getIntl: () => IntlShape;
|
|
8
|
+
appearance: EditorAppearance;
|
|
9
|
+
allowCompositionInputOverride?: boolean | undefined;
|
|
10
|
+
}) => SafePlugin<CodeBlockState>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
declare const refreshBrowserSelection: () => void;
|
|
3
|
+
declare const refreshBrowserSelectionOnChange: (transaction: Readonly<Transaction>, editorState: EditorState) => void;
|
|
4
|
+
export default refreshBrowserSelectionOnChange;
|
|
5
|
+
export { refreshBrowserSelection };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ExtractInjectionAPI, FloatingToolbarHandler, SelectOption } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { CodeBlockPlugin } from './index';
|
|
3
|
+
export declare const messages: {
|
|
4
|
+
selectLanguage: {
|
|
5
|
+
id: string;
|
|
6
|
+
defaultMessage: string;
|
|
7
|
+
description: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare const getToolbarConfig: (allowCopyToClipboard: boolean | undefined, api: ExtractInjectionAPI<CodeBlockPlugin> | undefined) => FloatingToolbarHandler;
|
|
11
|
+
/**
|
|
12
|
+
* Filters language list based on both name and alias properties.
|
|
13
|
+
*/
|
|
14
|
+
export declare const languageListFilter: (option: SelectOption, rawInput: string) => any;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
export declare function transformToCodeBlockAction(state: EditorState, start: number, attrs?: any): Transaction;
|
|
3
|
+
export declare function isConvertableToCodeBlock(state: EditorState): boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { EditorAppearance, LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
|
|
2
|
+
export interface CodeBlockOptions extends LongPressSelectionPluginOptions {
|
|
3
|
+
allowCopyToClipboard?: boolean;
|
|
4
|
+
allowCompositionInputOverride?: boolean;
|
|
5
|
+
appearance?: EditorAppearance | undefined;
|
|
6
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { findCodeBlock, transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark, } from '@atlaskit/editor-common/transforms';
|
|
2
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
3
|
+
import type { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
+
export declare function getCursor(selection: Selection): ResolvedPos | undefined;
|
package/package.json
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/editor-plugin-code-block",
|
|
3
|
+
"version": "0.1.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
|
+
"inPublicMirror": false,
|
|
13
|
+
"releaseModel": "continuous"
|
|
14
|
+
},
|
|
15
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend",
|
|
16
|
+
"main": "dist/cjs/index.js",
|
|
17
|
+
"module": "dist/esm/index.js",
|
|
18
|
+
"module:es2019": "dist/es2019/index.js",
|
|
19
|
+
"types": "dist/types/index.d.ts",
|
|
20
|
+
"typesVersions": {
|
|
21
|
+
">=4.5 <4.9": {
|
|
22
|
+
"*": [
|
|
23
|
+
"dist/types-ts4.5/*",
|
|
24
|
+
"dist/types-ts4.5/index.d.ts"
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"sideEffects": false,
|
|
29
|
+
"atlaskit:src": "src/index.ts",
|
|
30
|
+
"af:exports": {
|
|
31
|
+
".": "./src/index.ts"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@atlaskit/adf-schema": "^32.0.0",
|
|
35
|
+
"@atlaskit/code": "^14.6.0",
|
|
36
|
+
"@atlaskit/editor-common": "^76.18.0",
|
|
37
|
+
"@atlaskit/editor-plugin-analytics": "^0.3.0",
|
|
38
|
+
"@atlaskit/editor-plugin-composition": "^0.1.0",
|
|
39
|
+
"@atlaskit/editor-plugin-decorations": "^0.2.0",
|
|
40
|
+
"@atlaskit/editor-prosemirror": "1.1.0",
|
|
41
|
+
"@atlaskit/icon": "^21.12.0",
|
|
42
|
+
"@atlaskit/prosemirror-input-rules": "^2.4.0",
|
|
43
|
+
"@babel/runtime": "^7.0.0",
|
|
44
|
+
"raf-schd": "^4.0.3"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"react": "^16.8.0",
|
|
48
|
+
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@af/integration-testing": "*",
|
|
52
|
+
"@af/visual-regression": "*",
|
|
53
|
+
"@atlaskit/ssr": "*",
|
|
54
|
+
"@atlaskit/visual-regression": "*",
|
|
55
|
+
"@atlaskit/webdriver-runner": "*",
|
|
56
|
+
"@atlassian/atlassian-frontend-prettier-config-1.0.0": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.0",
|
|
57
|
+
"@testing-library/react": "^12.1.5",
|
|
58
|
+
"raf-stub": "^2.0.1",
|
|
59
|
+
"react-dom": "^16.8.0",
|
|
60
|
+
"typescript": "~4.9.5",
|
|
61
|
+
"wait-for-expect": "^1.2.0"
|
|
62
|
+
},
|
|
63
|
+
"techstack": {
|
|
64
|
+
"@atlassian/frontend": {
|
|
65
|
+
"import-structure": [
|
|
66
|
+
"atlassian-conventions"
|
|
67
|
+
],
|
|
68
|
+
"circular-dependencies": [
|
|
69
|
+
"file-and-folder-level"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"@repo/internal": {
|
|
73
|
+
"dom-events": "use-bind-event-listener",
|
|
74
|
+
"analytics": [
|
|
75
|
+
"analytics-next"
|
|
76
|
+
],
|
|
77
|
+
"design-tokens": [
|
|
78
|
+
"color"
|
|
79
|
+
],
|
|
80
|
+
"theming": [
|
|
81
|
+
"react-context"
|
|
82
|
+
],
|
|
83
|
+
"ui-components": [
|
|
84
|
+
"lite-mode"
|
|
85
|
+
],
|
|
86
|
+
"deprecation": [
|
|
87
|
+
"no-deprecated-imports"
|
|
88
|
+
],
|
|
89
|
+
"styling": [
|
|
90
|
+
"static",
|
|
91
|
+
"emotion"
|
|
92
|
+
],
|
|
93
|
+
"imports": [
|
|
94
|
+
"import-no-extraneous-disable-for-examples-and-docs"
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.0"
|
|
99
|
+
}
|
package/report.api.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<!-- API Report Version: 2.3 -->
|
|
2
|
+
|
|
3
|
+
## API Report File for "@atlaskit/editor-plugin-code-block"
|
|
4
|
+
|
|
5
|
+
> Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/).
|
|
6
|
+
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
7
|
+
|
|
8
|
+
### Table of contents
|
|
9
|
+
|
|
10
|
+
- [Main Entry Types](#main-entry-types)
|
|
11
|
+
- [Peer Dependencies](#peer-dependencies)
|
|
12
|
+
|
|
13
|
+
### Main Entry Types
|
|
14
|
+
|
|
15
|
+
<!--SECTION START: Main Entry Types-->
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
19
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
20
|
+
import type { compositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
21
|
+
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
22
|
+
import type { EditorAppearance } from '@atlaskit/editor-common/types';
|
|
23
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
24
|
+
import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
|
|
25
|
+
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
26
|
+
import type { OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
27
|
+
|
|
28
|
+
// @public (undocumented)
|
|
29
|
+
export interface CodeBlockOptions extends LongPressSelectionPluginOptions {
|
|
30
|
+
// (undocumented)
|
|
31
|
+
allowCompositionInputOverride?: boolean;
|
|
32
|
+
// (undocumented)
|
|
33
|
+
allowCopyToClipboard?: boolean;
|
|
34
|
+
// (undocumented)
|
|
35
|
+
appearance?: EditorAppearance | undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// @public (undocumented)
|
|
39
|
+
export type CodeBlockPlugin = NextEditorPlugin<
|
|
40
|
+
'codeBlock',
|
|
41
|
+
{
|
|
42
|
+
pluginConfiguration: CodeBlockOptions;
|
|
43
|
+
dependencies: [
|
|
44
|
+
typeof decorationsPlugin,
|
|
45
|
+
typeof compositionPlugin,
|
|
46
|
+
OptionalPlugin<typeof analyticsPlugin>,
|
|
47
|
+
];
|
|
48
|
+
actions: {
|
|
49
|
+
insertCodeBlock: (inputMethod: INPUT_METHOD) => Command;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
>;
|
|
53
|
+
|
|
54
|
+
// @public (undocumented)
|
|
55
|
+
export const codeBlockPlugin: CodeBlockPlugin;
|
|
56
|
+
|
|
57
|
+
// (No @packageDocumentation comment for this package)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
<!--SECTION END: Main Entry Types-->
|
|
61
|
+
|
|
62
|
+
### Peer Dependencies
|
|
63
|
+
|
|
64
|
+
<!--SECTION START: Peer Dependencies-->
|
|
65
|
+
|
|
66
|
+
```json
|
|
67
|
+
{
|
|
68
|
+
"react": "^16.8.0",
|
|
69
|
+
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
<!--SECTION END: Peer Dependencies-->
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
## API Report File for "@atlaskit/editor-plugin-code-block"
|
|
2
|
+
|
|
3
|
+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
|
|
7
|
+
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
8
|
+
import type { Command } from '@atlaskit/editor-common/types';
|
|
9
|
+
import type { compositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
10
|
+
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
11
|
+
import type { EditorAppearance } from '@atlaskit/editor-common/types';
|
|
12
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
13
|
+
import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
|
|
14
|
+
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
15
|
+
import type { OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
16
|
+
|
|
17
|
+
// @public (undocumented)
|
|
18
|
+
export interface CodeBlockOptions extends LongPressSelectionPluginOptions {
|
|
19
|
+
// (undocumented)
|
|
20
|
+
allowCompositionInputOverride?: boolean;
|
|
21
|
+
// (undocumented)
|
|
22
|
+
allowCopyToClipboard?: boolean;
|
|
23
|
+
// (undocumented)
|
|
24
|
+
appearance?: EditorAppearance | undefined;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// @public (undocumented)
|
|
28
|
+
export type CodeBlockPlugin = NextEditorPlugin<'codeBlock', {
|
|
29
|
+
pluginConfiguration: CodeBlockOptions;
|
|
30
|
+
dependencies: [
|
|
31
|
+
typeof decorationsPlugin,
|
|
32
|
+
typeof compositionPlugin,
|
|
33
|
+
OptionalPlugin<typeof analyticsPlugin>
|
|
34
|
+
];
|
|
35
|
+
actions: {
|
|
36
|
+
insertCodeBlock: (inputMethod: INPUT_METHOD) => Command;
|
|
37
|
+
};
|
|
38
|
+
}>;
|
|
39
|
+
|
|
40
|
+
// @public (undocumented)
|
|
41
|
+
export const codeBlockPlugin: CodeBlockPlugin;
|
|
42
|
+
|
|
43
|
+
// (No @packageDocumentation comment for this package)
|
|
44
|
+
|
|
45
|
+
```
|