@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.
Files changed (126) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/LICENSE.md +13 -0
  3. package/README.md +30 -0
  4. package/dist/cjs/actions.js +201 -0
  5. package/dist/cjs/ide-ux/bracket-handling.js +35 -0
  6. package/dist/cjs/ide-ux/commands.js +115 -0
  7. package/dist/cjs/ide-ux/line-handling.js +81 -0
  8. package/dist/cjs/ide-ux/paired-character-handling.js +23 -0
  9. package/dist/cjs/ide-ux/quote-handling.js +40 -0
  10. package/dist/cjs/index.js +13 -0
  11. package/dist/cjs/language-list.js +62 -0
  12. package/dist/cjs/nodeviews/code-block.js +153 -0
  13. package/dist/cjs/plugin-key.js +8 -0
  14. package/dist/cjs/plugin.js +120 -0
  15. package/dist/cjs/pm-plugins/actions.js +10 -0
  16. package/dist/cjs/pm-plugins/codeBlockCopySelectionPlugin.js +113 -0
  17. package/dist/cjs/pm-plugins/ide-ux.js +132 -0
  18. package/dist/cjs/pm-plugins/input-rule.js +68 -0
  19. package/dist/cjs/pm-plugins/keymaps.js +66 -0
  20. package/dist/cjs/pm-plugins/main-state.js +10 -0
  21. package/dist/cjs/pm-plugins/main.js +114 -0
  22. package/dist/cjs/refresh-browser-selection.js +29 -0
  23. package/dist/cjs/toolbar.js +131 -0
  24. package/dist/cjs/transform-to-code-block.js +84 -0
  25. package/dist/cjs/types.js +5 -0
  26. package/dist/cjs/ui/class-names.js +15 -0
  27. package/dist/cjs/utils.js +28 -0
  28. package/dist/es2019/actions.js +211 -0
  29. package/dist/es2019/ide-ux/bracket-handling.js +27 -0
  30. package/dist/es2019/ide-ux/commands.js +115 -0
  31. package/dist/es2019/ide-ux/line-handling.js +75 -0
  32. package/dist/es2019/ide-ux/paired-character-handling.js +12 -0
  33. package/dist/es2019/ide-ux/quote-handling.js +32 -0
  34. package/dist/es2019/index.js +1 -0
  35. package/dist/es2019/language-list.js +51 -0
  36. package/dist/es2019/nodeviews/code-block.js +126 -0
  37. package/dist/es2019/plugin-key.js +2 -0
  38. package/dist/es2019/plugin.js +104 -0
  39. package/dist/es2019/pm-plugins/actions.js +4 -0
  40. package/dist/es2019/pm-plugins/codeBlockCopySelectionPlugin.js +101 -0
  41. package/dist/es2019/pm-plugins/ide-ux.js +135 -0
  42. package/dist/es2019/pm-plugins/input-rule.js +60 -0
  43. package/dist/es2019/pm-plugins/keymaps.js +58 -0
  44. package/dist/es2019/pm-plugins/main-state.js +2 -0
  45. package/dist/es2019/pm-plugins/main.js +102 -0
  46. package/dist/es2019/refresh-browser-selection.js +25 -0
  47. package/dist/es2019/toolbar.js +108 -0
  48. package/dist/es2019/transform-to-code-block.js +79 -0
  49. package/dist/es2019/types.js +1 -0
  50. package/dist/es2019/ui/class-names.js +9 -0
  51. package/dist/es2019/utils.js +4 -0
  52. package/dist/esm/actions.js +191 -0
  53. package/dist/esm/ide-ux/bracket-handling.js +29 -0
  54. package/dist/esm/ide-ux/commands.js +107 -0
  55. package/dist/esm/ide-ux/line-handling.js +73 -0
  56. package/dist/esm/ide-ux/paired-character-handling.js +16 -0
  57. package/dist/esm/ide-ux/quote-handling.js +34 -0
  58. package/dist/esm/index.js +1 -0
  59. package/dist/esm/language-list.js +52 -0
  60. package/dist/esm/nodeviews/code-block.js +146 -0
  61. package/dist/esm/plugin-key.js +2 -0
  62. package/dist/esm/plugin.js +113 -0
  63. package/dist/esm/pm-plugins/actions.js +4 -0
  64. package/dist/esm/pm-plugins/codeBlockCopySelectionPlugin.js +103 -0
  65. package/dist/esm/pm-plugins/ide-ux.js +126 -0
  66. package/dist/esm/pm-plugins/input-rule.js +62 -0
  67. package/dist/esm/pm-plugins/keymaps.js +59 -0
  68. package/dist/esm/pm-plugins/main-state.js +4 -0
  69. package/dist/esm/pm-plugins/main.js +107 -0
  70. package/dist/esm/refresh-browser-selection.js +25 -0
  71. package/dist/esm/toolbar.js +121 -0
  72. package/dist/esm/transform-to-code-block.js +77 -0
  73. package/dist/esm/types.js +1 -0
  74. package/dist/esm/ui/class-names.js +9 -0
  75. package/dist/esm/utils.js +4 -0
  76. package/dist/types/actions.d.ts +18 -0
  77. package/dist/types/ide-ux/bracket-handling.d.ts +12 -0
  78. package/dist/types/ide-ux/commands.d.ts +7 -0
  79. package/dist/types/ide-ux/line-handling.d.ts +25 -0
  80. package/dist/types/ide-ux/paired-character-handling.d.ts +2 -0
  81. package/dist/types/ide-ux/quote-handling.d.ts +12 -0
  82. package/dist/types/index.d.ts +3 -0
  83. package/dist/types/language-list.d.ts +942 -0
  84. package/dist/types/nodeviews/code-block.d.ts +21 -0
  85. package/dist/types/plugin-key.d.ts +2 -0
  86. package/dist/types/plugin.d.ts +19 -0
  87. package/dist/types/pm-plugins/actions.d.ts +4 -0
  88. package/dist/types/pm-plugins/codeBlockCopySelectionPlugin.d.ts +11 -0
  89. package/dist/types/pm-plugins/ide-ux.d.ts +5 -0
  90. package/dist/types/pm-plugins/input-rule.d.ts +3 -0
  91. package/dist/types/pm-plugins/keymaps.d.ts +4 -0
  92. package/dist/types/pm-plugins/main-state.d.ts +8 -0
  93. package/dist/types/pm-plugins/main.d.ts +10 -0
  94. package/dist/types/refresh-browser-selection.d.ts +5 -0
  95. package/dist/types/toolbar.d.ts +14 -0
  96. package/dist/types/transform-to-code-block.d.ts +3 -0
  97. package/dist/types/types.d.ts +6 -0
  98. package/dist/types/ui/class-names.d.ts +8 -0
  99. package/dist/types/utils.d.ts +4 -0
  100. package/dist/types-ts4.5/actions.d.ts +18 -0
  101. package/dist/types-ts4.5/ide-ux/bracket-handling.d.ts +12 -0
  102. package/dist/types-ts4.5/ide-ux/commands.d.ts +7 -0
  103. package/dist/types-ts4.5/ide-ux/line-handling.d.ts +25 -0
  104. package/dist/types-ts4.5/ide-ux/paired-character-handling.d.ts +2 -0
  105. package/dist/types-ts4.5/ide-ux/quote-handling.d.ts +12 -0
  106. package/dist/types-ts4.5/index.d.ts +3 -0
  107. package/dist/types-ts4.5/language-list.d.ts +1641 -0
  108. package/dist/types-ts4.5/nodeviews/code-block.d.ts +21 -0
  109. package/dist/types-ts4.5/plugin-key.d.ts +2 -0
  110. package/dist/types-ts4.5/plugin.d.ts +19 -0
  111. package/dist/types-ts4.5/pm-plugins/actions.d.ts +4 -0
  112. package/dist/types-ts4.5/pm-plugins/codeBlockCopySelectionPlugin.d.ts +14 -0
  113. package/dist/types-ts4.5/pm-plugins/ide-ux.d.ts +5 -0
  114. package/dist/types-ts4.5/pm-plugins/input-rule.d.ts +3 -0
  115. package/dist/types-ts4.5/pm-plugins/keymaps.d.ts +4 -0
  116. package/dist/types-ts4.5/pm-plugins/main-state.d.ts +8 -0
  117. package/dist/types-ts4.5/pm-plugins/main.d.ts +10 -0
  118. package/dist/types-ts4.5/refresh-browser-selection.d.ts +5 -0
  119. package/dist/types-ts4.5/toolbar.d.ts +14 -0
  120. package/dist/types-ts4.5/transform-to-code-block.d.ts +3 -0
  121. package/dist/types-ts4.5/types.d.ts +6 -0
  122. package/dist/types-ts4.5/ui/class-names.d.ts +8 -0
  123. package/dist/types-ts4.5/utils.d.ts +4 -0
  124. package/package.json +99 -0
  125. package/report.api.md +73 -0
  126. package/tmp/api-report-tmp.d.ts +45 -0
@@ -0,0 +1,121 @@
1
+ import { defineMessages } from 'react-intl-next';
2
+ import commonMessages, { codeBlockButtonMessages } from '@atlaskit/editor-common/messages';
3
+ import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
4
+ import CopyIcon from '@atlaskit/icon/glyph/copy';
5
+ import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
6
+ import { changeLanguage, copyContentToClipboard, removeCodeBlock, resetCopiedState } from './actions';
7
+ import { createLanguageList, DEFAULT_LANGUAGES, getLanguageIdentifier } from './language-list';
8
+ import { pluginKey } from './plugin-key';
9
+ import { provideVisualFeedbackForCopyButton, removeVisualFeedbackForCopyButton } from './pm-plugins/codeBlockCopySelectionPlugin';
10
+ export var messages = defineMessages({
11
+ selectLanguage: {
12
+ id: 'fabric.editor.selectLanguage',
13
+ defaultMessage: 'Select language',
14
+ description: 'Code blocks display software code. A prompt to select the software language the code is written in.'
15
+ }
16
+ });
17
+ var languageList = createLanguageList(DEFAULT_LANGUAGES);
18
+ export var getToolbarConfig = function getToolbarConfig() {
19
+ var allowCopyToClipboard = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
20
+ var api = arguments.length > 1 ? arguments[1] : undefined;
21
+ return function (state, _ref) {
22
+ var _api$decorations$acti, _api$analytics, _codeBlockState$pos, _node$attrs;
23
+ var formatMessage = _ref.formatMessage;
24
+ var _ref2 = (_api$decorations$acti = api === null || api === void 0 ? void 0 : api.decorations.actions) !== null && _api$decorations$acti !== void 0 ? _api$decorations$acti : {},
25
+ hoverDecoration = _ref2.hoverDecoration;
26
+ var editorAnalyticsAPI = api === null || api === void 0 || (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions;
27
+ var codeBlockState = pluginKey.getState(state);
28
+ var pos = (_codeBlockState$pos = codeBlockState === null || codeBlockState === void 0 ? void 0 : codeBlockState.pos) !== null && _codeBlockState$pos !== void 0 ? _codeBlockState$pos : null;
29
+ if (!codeBlockState || pos === null) {
30
+ return;
31
+ }
32
+ var node = state.doc.nodeAt(pos);
33
+ var nodeType = state.schema.nodes.codeBlock;
34
+ if ((node === null || node === void 0 ? void 0 : node.type) !== nodeType) {
35
+ return;
36
+ }
37
+ var language = node === null || node === void 0 || (_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.language;
38
+ var options = languageList.map(function (lang) {
39
+ return {
40
+ label: lang.name,
41
+ value: getLanguageIdentifier(lang),
42
+ alias: lang.alias
43
+ };
44
+ });
45
+
46
+ // If language is not undefined search for it in the value and then search in the aliases
47
+ var defaultValue = language ? options.find(function (option) {
48
+ return option.value === language;
49
+ }) || options.find(function (option) {
50
+ return option.alias.includes(language);
51
+ }) : null;
52
+ var languageSelect = {
53
+ id: 'editor.codeBlock.languageOptions',
54
+ type: 'select',
55
+ selectType: 'list',
56
+ onChange: function onChange(option) {
57
+ return changeLanguage(editorAnalyticsAPI)(option.value);
58
+ },
59
+ defaultValue: defaultValue,
60
+ placeholder: formatMessage(messages.selectLanguage),
61
+ options: options,
62
+ filterOption: languageListFilter
63
+ };
64
+ var separator = {
65
+ type: 'separator'
66
+ };
67
+ var copyToClipboardItems = !allowCopyToClipboard ? [] : [{
68
+ id: 'editor.codeBlock.copy',
69
+ type: 'button',
70
+ appearance: 'subtle',
71
+ icon: CopyIcon,
72
+ // note: copyContentToClipboard contains logic that also removes the
73
+ // visual feedback for the copy button
74
+ onClick: copyContentToClipboard,
75
+ title: formatMessage(codeBlockState.contentCopied ? codeBlockButtonMessages.copiedCodeToClipboard : codeBlockButtonMessages.copyCodeToClipboard),
76
+ onMouseEnter: provideVisualFeedbackForCopyButton,
77
+ // note: resetCopiedState contains logic that also removes the
78
+ // visual feedback for the copy button
79
+ onMouseLeave: resetCopiedState,
80
+ onFocus: provideVisualFeedbackForCopyButton,
81
+ onBlur: removeVisualFeedbackForCopyButton,
82
+ hideTooltipOnClick: false,
83
+ disabled: codeBlockState.isNodeSelected,
84
+ tabIndex: null
85
+ }, separator];
86
+ var deleteButton = {
87
+ id: 'editor.codeBlock.delete',
88
+ type: 'button',
89
+ appearance: 'danger',
90
+ icon: RemoveIcon,
91
+ onMouseEnter: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true),
92
+ onMouseLeave: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false),
93
+ onFocus: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, true),
94
+ onBlur: hoverDecoration === null || hoverDecoration === void 0 ? void 0 : hoverDecoration(nodeType, false),
95
+ onClick: removeCodeBlock,
96
+ title: formatMessage(commonMessages.remove),
97
+ tabIndex: null
98
+ };
99
+ return {
100
+ title: 'CodeBlock floating controls',
101
+ getDomRef: function getDomRef(view) {
102
+ return findDomRefAtPos(pos, view.domAtPos.bind(view));
103
+ },
104
+ nodeType: nodeType,
105
+ items: [languageSelect, separator].concat(copyToClipboardItems, [deleteButton]),
106
+ scrollable: true
107
+ };
108
+ };
109
+ };
110
+
111
+ /**
112
+ * Filters language list based on both name and alias properties.
113
+ */
114
+ export var languageListFilter = function languageListFilter(option, rawInput) {
115
+ var _ref3 = option,
116
+ data = _ref3.data;
117
+ var searchString = rawInput.toLowerCase();
118
+ return data.label.toLowerCase().includes(searchString) || data.alias.some(function (alias) {
119
+ return alias.toLowerCase() === searchString;
120
+ });
121
+ };
@@ -0,0 +1,77 @@
1
+ import { GapCursorSelection } from '@atlaskit/editor-common/selection';
2
+ import { mapSlice, timestampToString } from '@atlaskit/editor-common/utils';
3
+ import { Fragment } from '@atlaskit/editor-prosemirror/model';
4
+ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
5
+ export function transformToCodeBlockAction(state, start, attrs) {
6
+ var startOfCodeBlockText = state.selection.$from;
7
+ var endPosition = state.selection.empty && !(state.selection instanceof GapCursorSelection) ? startOfCodeBlockText.end() : state.selection.$to.pos;
8
+ var startLinePosition = startOfCodeBlockText.start();
9
+ //when cmd+A is used to select the content. start position should be 0.
10
+ var parentStartPosition = startOfCodeBlockText.depth === 0 ? 0 : startOfCodeBlockText.before();
11
+ var contentSlice = state.doc.slice(startOfCodeBlockText.pos, endPosition);
12
+ var codeBlockSlice = mapSlice(contentSlice, function (node, parent, index) {
13
+ if (node.type === state.schema.nodes.hardBreak) {
14
+ return state.schema.text('\n');
15
+ }
16
+ if (node.isText) {
17
+ return node.mark([]);
18
+ }
19
+ if (node.isInline) {
20
+ // Convert dates
21
+ if (node.attrs.timestamp) {
22
+ return state.schema.text(timestampToString(node.attrs.timestamp, null));
23
+ }
24
+ // Convert links
25
+ if (node.attrs.url) {
26
+ return state.schema.text(node.attrs.url);
27
+ }
28
+ return node.attrs.text ? state.schema.text(node.attrs.text) : null;
29
+ }
30
+
31
+ // if the current node is the last child of the Slice exit early to prevent
32
+ // adding additional line breaks
33
+ if (contentSlice.content.childCount - 1 === index) {
34
+ return node.content;
35
+ }
36
+
37
+ //useful to decide whether to append line breaks when the content has list items.
38
+ var isParentLastChild = parent && contentSlice.content.childCount - 1 === index;
39
+
40
+ // add line breaks at the end of each paragraph to mimic layout of selected content
41
+ // do not add line breaks when the 'paragraph' parent is last child.
42
+ if (node.content.childCount && node.type === state.schema.nodes.paragraph && !isParentLastChild) {
43
+ return node.content.append(Fragment.from(state.schema.text('\n\n')));
44
+ }
45
+ return node.content.childCount ? node.content : null;
46
+ });
47
+ var tr = state.tr;
48
+
49
+ // Replace current block node
50
+ var startMapped = startLinePosition === start ? parentStartPosition : start;
51
+ var codeBlock = state.schema.nodes.codeBlock;
52
+ var codeBlockNode = codeBlock.createChecked(attrs, codeBlockSlice.content);
53
+ tr.replaceWith(startMapped, Math.min(endPosition, tr.doc.content.size), codeBlockNode);
54
+
55
+ // Reposition cursor when inserting into layouts or table headers
56
+ var mapped = tr.doc.resolve(tr.mapping.map(startMapped) + 1);
57
+ var selection = TextSelection.findFrom(mapped, state.selection instanceof GapCursorSelection ? -1 : 1, true);
58
+ if (selection) {
59
+ return tr.setSelection(selection);
60
+ }
61
+ return tr.setSelection(TextSelection.create(tr.doc, Math.min(start + startOfCodeBlockText.node().nodeSize - 1, tr.doc.content.size)));
62
+ }
63
+ export function isConvertableToCodeBlock(state) {
64
+ // Before a document is loaded, there is no selection.
65
+ if (!state.selection) {
66
+ return false;
67
+ }
68
+ var $from = state.selection.$from;
69
+ var node = $from.parent;
70
+ if (!node.isTextblock || node.type === state.schema.nodes.codeBlock) {
71
+ return false;
72
+ }
73
+ var parentDepth = $from.depth - 1;
74
+ var parentNode = $from.node(parentDepth);
75
+ var index = $from.index(parentDepth);
76
+ return parentNode.canReplaceWith(index, index + 1, state.schema.nodes.codeBlock);
77
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import { CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
2
+ export var codeBlockClassNames = {
3
+ container: CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER,
4
+ start: CodeBlockSharedCssClassName.CODEBLOCK_START,
5
+ end: CodeBlockSharedCssClassName.CODEBLOCK_END,
6
+ contentWrapper: CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER,
7
+ gutter: CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER,
8
+ content: CodeBlockSharedCssClassName.CODEBLOCK_CONTENT
9
+ };
@@ -0,0 +1,4 @@
1
+ export { findCodeBlock, transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark } from '@atlaskit/editor-common/transforms';
2
+ export function getCursor(selection) {
3
+ return selection.$cursor || undefined;
4
+ }
@@ -0,0 +1,18 @@
1
+ import type { EditorAnalyticsAPI, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
2
+ import type { Command } from '@atlaskit/editor-common/types';
3
+ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
+ export declare const removeCodeBlock: Command;
5
+ export declare const changeLanguage: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (language: string) => Command;
6
+ export declare const copyContentToClipboard: Command;
7
+ export declare const resetCopiedState: Command;
8
+ export declare const ignoreFollowingMutations: Command;
9
+ export declare const resetShouldIgnoreFollowingMutations: Command;
10
+ /**
11
+ * This function creates a new transaction that inserts a code block,
12
+ * if there is text selected it will wrap the current selection if not it will
13
+ * append the codeblock to the end of the document.
14
+ */
15
+ export declare function createInsertCodeBlockTransaction({ state, }: {
16
+ state: EditorState;
17
+ }): import("prosemirror-state").Transaction;
18
+ export declare function insertCodeBlockWithAnalytics(inputMethod: INPUT_METHOD, analyticsAPI?: EditorAnalyticsAPI): Command;
@@ -0,0 +1,12 @@
1
+ export declare const BRACKET_MAP: {
2
+ '{': string;
3
+ '[': string;
4
+ '(': string;
5
+ };
6
+ export type BracketMapKey = keyof typeof BRACKET_MAP;
7
+ export declare const shouldAutoCloseBracket: (before: string, after: string) => boolean;
8
+ export declare const getAutoClosingBracketInfo: (before: string, after: string) => {
9
+ left: "{" | "[" | "(" | undefined;
10
+ right: string | undefined;
11
+ hasTrailingMatchingBracket: boolean;
12
+ };
@@ -0,0 +1,7 @@
1
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
2
+ import type { CommandDispatch } from '@atlaskit/editor-common/types';
3
+ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
4
+ export declare const indent: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (state: EditorState, dispatch?: CommandDispatch) => boolean;
5
+ export declare const outdent: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (state: EditorState, dispatch?: CommandDispatch) => boolean;
6
+ export declare function insertIndent(state: EditorState, dispatch: CommandDispatch): boolean;
7
+ export declare function insertNewlineWithIndent(state: EditorState, dispatch?: CommandDispatch): boolean;
@@ -0,0 +1,25 @@
1
+ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
+ export declare const isSelectionEntirelyInsideCodeBlock: (state: EditorState) => boolean;
3
+ export declare const isCursorInsideCodeBlock: (state: EditorState) => boolean;
4
+ export declare const getStartOfCurrentLine: (state: EditorState) => {
5
+ text: string;
6
+ pos: number;
7
+ };
8
+ export declare const getEndOfCurrentLine: (state: EditorState) => {
9
+ text: string;
10
+ pos: number;
11
+ };
12
+ export declare function getLinesFromSelection(state: EditorState): {
13
+ text: string;
14
+ start: number;
15
+ end: number;
16
+ };
17
+ export declare const forEachLine: (text: string, callback: (line: string, offset: number) => void) => void;
18
+ export declare const getLineInfo: (line: string) => {
19
+ indentToken: {
20
+ token: string;
21
+ size: number;
22
+ regex: RegExp;
23
+ };
24
+ indentText: string;
25
+ };
@@ -0,0 +1,2 @@
1
+ export declare const isCursorBeforeClosingCharacter: (after: string) => boolean;
2
+ export declare const isClosingCharacter: (text: string) => boolean;
@@ -0,0 +1,12 @@
1
+ export declare const QUOTE_MAP: {
2
+ "'": string;
3
+ '"': string;
4
+ '`': string;
5
+ };
6
+ export type QuoteMapKey = keyof typeof QUOTE_MAP;
7
+ export declare const shouldAutoCloseQuote: (before: string, after: string) => boolean;
8
+ export declare const getAutoClosingQuoteInfo: (before: string, after: string) => {
9
+ left: "'" | "\"" | "`" | undefined;
10
+ right: string | undefined;
11
+ hasTrailingMatchingQuote: boolean;
12
+ };
@@ -0,0 +1,3 @@
1
+ export { default as codeBlockPlugin } from './plugin';
2
+ export type { CodeBlockPlugin } from './plugin';
3
+ export type { CodeBlockOptions } from './types';