@atlaskit/editor-core 187.34.1 → 187.35.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 +17 -0
- package/dist/cjs/index.js +10 -42
- package/dist/cjs/plugins/block-type/commands/block-type.js +19 -211
- package/dist/cjs/plugins/block-type/commands/index.js +2 -28
- package/dist/cjs/plugins/block-type/index.js +21 -4
- package/dist/cjs/plugins/block-type/pm-plugins/input-rule.js +9 -64
- package/dist/cjs/plugins/block-type/pm-plugins/keymap.js +1 -1
- package/dist/cjs/plugins/code-block/actions.js +83 -6
- package/dist/cjs/plugins/code-block/index.js +27 -12
- package/dist/cjs/plugins/code-block/pm-plugins/input-rule.js +68 -0
- package/dist/cjs/plugins/copy-button/commands.js +2 -1
- package/dist/cjs/plugins/date/ui/DatePicker/index.js +3 -2
- package/dist/cjs/plugins/expand/commands.js +3 -3
- package/dist/cjs/plugins/expand/index.js +2 -2
- package/dist/cjs/plugins/index.js +1 -7
- package/dist/cjs/plugins/insert-block/index.js +34 -29
- package/dist/cjs/plugins/panel/actions.js +26 -2
- package/dist/cjs/plugins/panel/index.js +9 -5
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/index.js +16 -2
- package/dist/es2019/plugins/block-type/commands/block-type.js +15 -217
- package/dist/es2019/plugins/block-type/commands/index.js +1 -3
- package/dist/es2019/plugins/block-type/index.js +21 -4
- package/dist/es2019/plugins/block-type/pm-plugins/input-rule.js +3 -56
- package/dist/es2019/plugins/block-type/pm-plugins/keymap.js +2 -2
- package/dist/es2019/plugins/code-block/actions.js +84 -3
- package/dist/es2019/plugins/code-block/index.js +22 -7
- package/dist/es2019/plugins/code-block/pm-plugins/input-rule.js +60 -0
- package/dist/es2019/plugins/copy-button/commands.js +2 -1
- package/dist/es2019/plugins/date/ui/DatePicker/index.js +3 -2
- package/dist/es2019/plugins/expand/commands.js +1 -1
- package/dist/es2019/plugins/expand/index.js +1 -1
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/plugins/insert-block/index.js +47 -42
- package/dist/es2019/plugins/panel/actions.js +26 -2
- package/dist/es2019/plugins/panel/index.js +8 -4
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/index.js +16 -2
- package/dist/esm/plugins/block-type/commands/block-type.js +17 -205
- package/dist/esm/plugins/block-type/commands/index.js +1 -3
- package/dist/esm/plugins/block-type/index.js +21 -4
- package/dist/esm/plugins/block-type/pm-plugins/input-rule.js +3 -58
- package/dist/esm/plugins/block-type/pm-plugins/keymap.js +2 -2
- package/dist/esm/plugins/code-block/actions.js +76 -3
- package/dist/esm/plugins/code-block/index.js +25 -11
- package/dist/esm/plugins/code-block/pm-plugins/input-rule.js +62 -0
- package/dist/esm/plugins/copy-button/commands.js +2 -1
- package/dist/esm/plugins/date/ui/DatePicker/index.js +3 -2
- package/dist/esm/plugins/expand/commands.js +1 -1
- package/dist/esm/plugins/expand/index.js +1 -1
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/plugins/insert-block/index.js +27 -22
- package/dist/esm/plugins/panel/actions.js +24 -2
- package/dist/esm/plugins/panel/index.js +8 -4
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/index.d.ts +16 -3
- package/dist/types/labs/next/presets/default.d.ts +6 -0
- package/dist/types/plugins/block-type/commands/block-type.d.ts +1 -25
- package/dist/types/plugins/block-type/commands/index.d.ts +1 -3
- package/dist/types/plugins/block-type/index.d.ts +10 -2
- package/dist/types/plugins/code-block/actions.d.ts +11 -0
- package/dist/types/plugins/code-block/index.d.ts +6 -1
- package/dist/types/plugins/code-block/pm-plugins/input-rule.d.ts +3 -0
- package/dist/types/plugins/date/ui/DatePicker/index.d.ts +2 -2
- package/dist/types/plugins/index.d.ts +0 -2
- package/dist/types/plugins/insert-block/types.d.ts +7 -1
- package/dist/types/plugins/panel/actions.d.ts +4 -1
- package/dist/types/plugins/panel/index.d.ts +11 -2
- package/dist/types-ts4.5/index.d.ts +16 -3
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +6 -0
- package/dist/types-ts4.5/plugins/block-type/commands/block-type.d.ts +1 -25
- package/dist/types-ts4.5/plugins/block-type/commands/index.d.ts +1 -3
- package/dist/types-ts4.5/plugins/block-type/index.d.ts +10 -2
- package/dist/types-ts4.5/plugins/code-block/actions.d.ts +11 -0
- package/dist/types-ts4.5/plugins/code-block/index.d.ts +6 -1
- package/dist/types-ts4.5/plugins/code-block/pm-plugins/input-rule.d.ts +3 -0
- package/dist/types-ts4.5/plugins/date/ui/DatePicker/index.d.ts +2 -2
- package/dist/types-ts4.5/plugins/index.d.ts +0 -2
- package/dist/types-ts4.5/plugins/insert-block/types.d.ts +7 -1
- package/dist/types-ts4.5/plugins/panel/actions.d.ts +4 -1
- package/dist/types-ts4.5/plugins/panel/index.d.ts +9 -2
- package/package.json +5 -5
- package/report.api.md +62 -23
- package/tmp/api-report-tmp.d.ts +49 -15
- package/dist/cjs/plugins/block-type/commands/insert-block.js +0 -60
- package/dist/es2019/plugins/block-type/commands/insert-block.js +0 -55
- package/dist/esm/plugins/block-type/commands/insert-block.js +0 -53
- package/dist/types/plugins/block-type/commands/insert-block.d.ts +0 -5
- package/dist/types-ts4.5/plugins/block-type/commands/insert-block.d.ts +0 -5
- /package/dist/cjs/plugins/{block-type/commands → code-block}/transform-to-code-block.js +0 -0
- /package/dist/es2019/plugins/{block-type/commands → code-block}/transform-to-code-block.js +0 -0
- /package/dist/esm/plugins/{block-type/commands → code-block}/transform-to-code-block.js +0 -0
- /package/dist/types/plugins/{block-type/commands → code-block}/transform-to-code-block.d.ts +0 -0
- /package/dist/types-ts4.5/plugins/{block-type/commands → code-block}/transform-to-code-block.d.ts +0 -0
|
@@ -56,6 +56,9 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
56
56
|
}, import("@atlaskit/editor-common/types").FeatureFlags>];
|
|
57
57
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
58
58
|
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>];
|
|
59
|
+
actions: {
|
|
60
|
+
insertCodeBlock: (inputMethod: import("@atlaskit/editor-common/analytics").INPUT_METHOD) => import("@atlaskit/editor-common/types").Command;
|
|
61
|
+
};
|
|
59
62
|
}, CodeBlockOptions>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"selection", {
|
|
60
63
|
pluginConfiguration: SelectionPluginOptions | undefined;
|
|
61
64
|
}, SelectionPluginOptions | undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"floatingToolbar", {
|
|
@@ -181,6 +184,9 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
181
184
|
}, import("@atlaskit/editor-common/types").FeatureFlags>];
|
|
182
185
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
183
186
|
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>];
|
|
187
|
+
actions: {
|
|
188
|
+
insertCodeBlock: (inputMethod: import("@atlaskit/editor-common/analytics").INPUT_METHOD) => import("@atlaskit/editor-common/types").Command;
|
|
189
|
+
};
|
|
184
190
|
}, CodeBlockOptions>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"selection", {
|
|
185
191
|
pluginConfiguration: SelectionPluginOptions | undefined;
|
|
186
192
|
}, SelectionPluginOptions | undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"floatingToolbar", {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
3
1
|
import type { HeadingLevelsAndNormalText, Command } from '@atlaskit/editor-common/types';
|
|
4
2
|
import type { INPUT_METHOD, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
5
3
|
export type InputMethod = INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FORMATTING | INPUT_METHOD.KEYBOARD;
|
|
@@ -9,7 +7,6 @@ export declare function setNormalText(): Command;
|
|
|
9
7
|
export declare function setNormalTextWithAnalytics(inputMethod: InputMethod, editorAnalyticsApi: EditorAnalyticsAPI | undefined): Command;
|
|
10
8
|
export declare function setHeading(level: HeadingLevelsAndNormalText): Command;
|
|
11
9
|
export declare const setHeadingWithAnalytics: (newHeadingLevel: HeadingLevelsAndNormalText, inputMethod: InputMethod, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
12
|
-
export declare function insertBlockType(name: string): Command;
|
|
13
10
|
/**
|
|
14
11
|
*
|
|
15
12
|
* @param name - block type name
|
|
@@ -18,26 +15,5 @@ export declare function insertBlockType(name: string): Command;
|
|
|
18
15
|
* otherwise Editor becomes very sad and crashes
|
|
19
16
|
* @returns - command that inserts block type
|
|
20
17
|
*/
|
|
21
|
-
export declare const
|
|
22
|
-
/**
|
|
23
|
-
* This function creates a new transaction that wraps the current selection
|
|
24
|
-
* in the specified node type if it results in a valid transaction.
|
|
25
|
-
* If not valid, it performs a safe insert operation.
|
|
26
|
-
*
|
|
27
|
-
* Example of when wrapping might not be valid is when attempting to wrap
|
|
28
|
-
* content that is already inside a panel with another panel
|
|
29
|
-
*/
|
|
30
|
-
export declare function createWrapSelectionTransaction({ state, type, nodeAttributes, }: {
|
|
31
|
-
state: EditorState;
|
|
32
|
-
type: NodeType;
|
|
33
|
-
nodeAttributes?: Record<string, any>;
|
|
34
|
-
}): import("prosemirror-state").Transaction;
|
|
35
|
-
/**
|
|
36
|
-
* This function creates a new transaction that inserts a code block,
|
|
37
|
-
* if there is text selected it will wrap the current selection if not it will
|
|
38
|
-
* append the codeblock to the end of the document.
|
|
39
|
-
*/
|
|
40
|
-
export declare function createInsertCodeBlockTransaction({ state, }: {
|
|
41
|
-
state: EditorState;
|
|
42
|
-
}): import("prosemirror-state").Transaction;
|
|
18
|
+
export declare const insertBlockQuoteWithAnalytics: (inputMethod: InputMethod, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
43
19
|
export declare const cleanUpAtTheStartOfDocument: Command;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
export { cleanUpAtTheStartOfDocument,
|
|
1
|
+
export { cleanUpAtTheStartOfDocument, insertBlockQuoteWithAnalytics, setBlockType, setBlockTypeWithAnalytics, setHeading, setHeadingWithAnalytics, setNormalText, setNormalTextWithAnalytics, } from './block-type';
|
|
2
2
|
export type { InputMethod } from './block-type';
|
|
3
|
-
export { insertBlock } from './insert-block';
|
|
4
|
-
export { isConvertableToCodeBlock, transformToCodeBlockAction, } from './transform-to-code-block';
|
|
5
3
|
export { deleteAndMoveCursor } from './delete-and-move-cursor';
|
|
6
4
|
export { deleteBlockContent } from './delete-block-content';
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { NextEditorPlugin, OptionalPlugin, Command } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
|
+
import type { BlockTypeState } from './pm-plugins/main';
|
|
3
4
|
import type { BlockTypePluginOptions } from './types';
|
|
4
|
-
|
|
5
|
+
import type { InputMethod } from './commands/block-type';
|
|
6
|
+
export type BlockTypePlugin = NextEditorPlugin<'blockType', {
|
|
5
7
|
pluginConfiguration: BlockTypePluginOptions | undefined;
|
|
6
8
|
dependencies: [OptionalPlugin<typeof analyticsPlugin>];
|
|
9
|
+
sharedState: BlockTypeState | undefined;
|
|
10
|
+
actions: {
|
|
11
|
+
insertBlockQuote: (inputMethod: InputMethod) => Command;
|
|
12
|
+
setBlockType: (name: string, inputMethod: InputMethod) => Command;
|
|
13
|
+
};
|
|
7
14
|
}>;
|
|
15
|
+
declare const blockTypePlugin: BlockTypePlugin;
|
|
8
16
|
export default blockTypePlugin;
|
|
9
17
|
export { pluginKey } from './pm-plugins/main';
|
|
10
18
|
export type { BlockTypeState } from './pm-plugins/main';
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
1
2
|
import type { Command } from '../../types';
|
|
3
|
+
import type { INPUT_METHOD, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
4
|
export declare const removeCodeBlock: Command;
|
|
3
5
|
export declare const changeLanguage: (language: string) => Command;
|
|
4
6
|
export declare const copyContentToClipboard: Command;
|
|
5
7
|
export declare const resetCopiedState: Command;
|
|
6
8
|
export declare const ignoreFollowingMutations: Command;
|
|
7
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;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { NextEditorPlugin, OptionalPlugin, Command } from '@atlaskit/editor-common/types';
|
|
2
3
|
import type { CodeBlockOptions } from './types';
|
|
3
4
|
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
4
5
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
@@ -10,5 +11,9 @@ declare const codeBlockPlugin: NextEditorPlugin<'codeBlock', {
|
|
|
10
11
|
typeof compositionPlugin,
|
|
11
12
|
OptionalPlugin<typeof analyticsPlugin>
|
|
12
13
|
];
|
|
14
|
+
actions: {
|
|
15
|
+
insertCodeBlock: (inputMethod: INPUT_METHOD) => Command;
|
|
16
|
+
};
|
|
13
17
|
}>;
|
|
14
18
|
export default codeBlockPlugin;
|
|
19
|
+
export type CodeBlockPlugin = typeof codeBlockPlugin;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
export declare function createCodeBlockInputRule(schema: Schema, editorAnalyticsAPI?: EditorAnalyticsAPI): import("@atlaskit/editor-common/safe-plugin").SafePlugin<any>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { WeekDay } from '@atlaskit/calendar/types';
|
|
4
|
-
import { DateType } from '../../types';
|
|
4
|
+
import type { DateType } from '../../types';
|
|
5
5
|
import { INPUT_METHOD } from '../../../analytics/types/enums';
|
|
6
6
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
7
|
-
import { WrappedComponentProps } from 'react-intl-next';
|
|
7
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
8
8
|
export interface Props {
|
|
9
9
|
element: HTMLElement | null;
|
|
10
10
|
closeDatePicker: () => void;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export { basePlugin } from './base';
|
|
2
2
|
export { default as blockTypePlugin } from './block-type';
|
|
3
|
-
export { pluginKey as blockPluginStateKey } from './block-type';
|
|
4
|
-
export type { BlockTypeState } from './block-type';
|
|
5
3
|
export { default as betterTypeHistoryPlugin } from './better-type-history';
|
|
6
4
|
export { default as clearMarksOnChangeToEmptyDocumentPlugin } from './clear-marks-on-change-to-empty-document';
|
|
7
5
|
export { default as codeBlockPlugin } from './code-block';
|
|
@@ -8,14 +8,20 @@ import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
|
8
8
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
9
9
|
import type mentionsPlugin from '../mentions';
|
|
10
10
|
import type quickInsertPlugin from '../quick-insert';
|
|
11
|
+
import type blockTypePlugin from '../block-type';
|
|
12
|
+
import type codeBlockPlugin from '../code-block';
|
|
13
|
+
import type panelPlugin from '../panel';
|
|
11
14
|
export type InsertBlockPluginDependencies = [
|
|
12
15
|
typeof featureFlagsPlugin,
|
|
13
16
|
OptionalPlugin<typeof tablesPlugin>,
|
|
14
17
|
OptionalPlugin<typeof hyperlinkPlugin>,
|
|
15
18
|
OptionalPlugin<typeof datePlugin>,
|
|
19
|
+
OptionalPlugin<typeof blockTypePlugin>,
|
|
16
20
|
OptionalPlugin<typeof analyticsPlugin>,
|
|
17
21
|
OptionalPlugin<ImageUploadPlugin>,
|
|
18
22
|
OptionalPlugin<typeof mentionsPlugin>,
|
|
19
23
|
OptionalPlugin<EmojiPlugin>,
|
|
20
|
-
OptionalPlugin<typeof quickInsertPlugin
|
|
24
|
+
OptionalPlugin<typeof quickInsertPlugin>,
|
|
25
|
+
OptionalPlugin<typeof codeBlockPlugin>,
|
|
26
|
+
OptionalPlugin<typeof panelPlugin>
|
|
21
27
|
];
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { PanelType } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { Command } from '../../types';
|
|
3
|
+
import { INPUT_METHOD } from '../analytics';
|
|
3
4
|
import type { PanelOptions } from './pm-plugins/main';
|
|
5
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
6
|
export type DomAtPos = (pos: number) => {
|
|
5
7
|
node: HTMLElement;
|
|
6
8
|
offset: number;
|
|
7
9
|
};
|
|
8
10
|
export declare const removePanel: () => Command;
|
|
9
11
|
export declare const changePanelType: (panelType: PanelType, panelOptions?: PanelOptions, allowCustomPanel?: boolean) => Command;
|
|
12
|
+
export declare function insertPanelWithAnalytics(inputMethod: INPUT_METHOD, analyticsAPI?: EditorAnalyticsAPI): import("@atlaskit/editor-common/types").Command;
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
-
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { Command, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import { INPUT_METHOD } from '../analytics';
|
|
2
3
|
import type { PanelPluginOptions } from './types';
|
|
3
4
|
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
5
|
+
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
6
|
declare const panelPlugin: NextEditorPlugin<'panel', {
|
|
5
7
|
pluginConfiguration: PanelPluginOptions | undefined;
|
|
6
|
-
dependencies: [
|
|
8
|
+
dependencies: [
|
|
9
|
+
typeof decorationsPlugin,
|
|
10
|
+
OptionalPlugin<typeof analyticsPlugin>
|
|
11
|
+
];
|
|
12
|
+
actions: {
|
|
13
|
+
insertPanel: (inputMethod: INPUT_METHOD) => Command;
|
|
14
|
+
};
|
|
7
15
|
}>;
|
|
8
16
|
export default panelPlugin;
|
|
17
|
+
export type PanelPlugin = typeof panelPlugin;
|
|
@@ -24,12 +24,25 @@ export { textColorPluginKey } from './plugins/text-color';
|
|
|
24
24
|
export type { TextColorPluginState } from './plugins/text-color';
|
|
25
25
|
export { changeColor } from './plugins/text-color/commands/change-color';
|
|
26
26
|
export { insertHorizontalRule } from './plugins/rule/commands';
|
|
27
|
-
export {
|
|
28
|
-
|
|
27
|
+
export type { BlockTypeState } from './plugins/block-type/pm-plugins/main';
|
|
28
|
+
/**
|
|
29
|
+
* @private
|
|
30
|
+
* @deprecated DO NOT USE, temporary solution while decoupling plugins from editor-core
|
|
31
|
+
*/
|
|
32
|
+
export type { BlockTypePlugin } from './plugins/block-type';
|
|
33
|
+
/**
|
|
34
|
+
* @private
|
|
35
|
+
* @deprecated DO NOT USE, temporary solution while decoupling plugins from editor-core
|
|
36
|
+
*/
|
|
37
|
+
export type { CodeBlockPlugin } from './plugins/code-block';
|
|
38
|
+
/**
|
|
39
|
+
* @private
|
|
40
|
+
* @deprecated DO NOT USE, temporary solution while decoupling plugins from editor-core
|
|
41
|
+
*/
|
|
42
|
+
export type { PanelPlugin } from './plugins/panel';
|
|
29
43
|
export { subscribeToToolbarAndPickerUpdates } from './plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates';
|
|
30
44
|
export { subscribeTypeAheadUpdates } from './plugins/view-update-subscription/subscribe/type-ahead-updates';
|
|
31
45
|
export type { InputMethodToolbar as TextFormattingInputMethodToolbar, InputMethodBasic as TextFormattingInputMethodBasic, } from '@atlaskit/editor-common/types';
|
|
32
|
-
export { insertBlockType, insertBlockTypesWithAnalytics, setBlockType, setBlockTypeWithAnalytics, } from './plugins/block-type/commands';
|
|
33
46
|
export type { InputMethod as BlockTypeInputMethod } from './plugins/block-type/commands';
|
|
34
47
|
export { createTable } from '@atlaskit/editor-plugin-table/commands';
|
|
35
48
|
export { insertTaskDecisionCommand } from './plugins/tasks-and-decisions/commands';
|
|
@@ -77,6 +77,9 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
77
77
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
78
78
|
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>
|
|
79
79
|
];
|
|
80
|
+
actions: {
|
|
81
|
+
insertCodeBlock: (inputMethod: import("@atlaskit/editor-common/analytics").INPUT_METHOD) => import("@atlaskit/editor-common/types").Command;
|
|
82
|
+
};
|
|
80
83
|
}, CodeBlockOptions>,
|
|
81
84
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"selection", {
|
|
82
85
|
pluginConfiguration: SelectionPluginOptions | undefined;
|
|
@@ -250,6 +253,9 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
250
253
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
251
254
|
}, import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions>>
|
|
252
255
|
];
|
|
256
|
+
actions: {
|
|
257
|
+
insertCodeBlock: (inputMethod: import("@atlaskit/editor-common/analytics").INPUT_METHOD) => import("@atlaskit/editor-common/types").Command;
|
|
258
|
+
};
|
|
253
259
|
}, CodeBlockOptions>,
|
|
254
260
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"selection", {
|
|
255
261
|
pluginConfiguration: SelectionPluginOptions | undefined;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { NodeType } from '@atlaskit/editor-prosemirror/model';
|
|
3
1
|
import type { HeadingLevelsAndNormalText, Command } from '@atlaskit/editor-common/types';
|
|
4
2
|
import type { INPUT_METHOD, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
5
3
|
export type InputMethod = INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.SHORTCUT | INPUT_METHOD.FORMATTING | INPUT_METHOD.KEYBOARD;
|
|
@@ -9,7 +7,6 @@ export declare function setNormalText(): Command;
|
|
|
9
7
|
export declare function setNormalTextWithAnalytics(inputMethod: InputMethod, editorAnalyticsApi: EditorAnalyticsAPI | undefined): Command;
|
|
10
8
|
export declare function setHeading(level: HeadingLevelsAndNormalText): Command;
|
|
11
9
|
export declare const setHeadingWithAnalytics: (newHeadingLevel: HeadingLevelsAndNormalText, inputMethod: InputMethod, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
12
|
-
export declare function insertBlockType(name: string): Command;
|
|
13
10
|
/**
|
|
14
11
|
*
|
|
15
12
|
* @param name - block type name
|
|
@@ -18,26 +15,5 @@ export declare function insertBlockType(name: string): Command;
|
|
|
18
15
|
* otherwise Editor becomes very sad and crashes
|
|
19
16
|
* @returns - command that inserts block type
|
|
20
17
|
*/
|
|
21
|
-
export declare const
|
|
22
|
-
/**
|
|
23
|
-
* This function creates a new transaction that wraps the current selection
|
|
24
|
-
* in the specified node type if it results in a valid transaction.
|
|
25
|
-
* If not valid, it performs a safe insert operation.
|
|
26
|
-
*
|
|
27
|
-
* Example of when wrapping might not be valid is when attempting to wrap
|
|
28
|
-
* content that is already inside a panel with another panel
|
|
29
|
-
*/
|
|
30
|
-
export declare function createWrapSelectionTransaction({ state, type, nodeAttributes, }: {
|
|
31
|
-
state: EditorState;
|
|
32
|
-
type: NodeType;
|
|
33
|
-
nodeAttributes?: Record<string, any>;
|
|
34
|
-
}): import("prosemirror-state").Transaction;
|
|
35
|
-
/**
|
|
36
|
-
* This function creates a new transaction that inserts a code block,
|
|
37
|
-
* if there is text selected it will wrap the current selection if not it will
|
|
38
|
-
* append the codeblock to the end of the document.
|
|
39
|
-
*/
|
|
40
|
-
export declare function createInsertCodeBlockTransaction({ state, }: {
|
|
41
|
-
state: EditorState;
|
|
42
|
-
}): import("prosemirror-state").Transaction;
|
|
18
|
+
export declare const insertBlockQuoteWithAnalytics: (inputMethod: InputMethod, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => Command;
|
|
43
19
|
export declare const cleanUpAtTheStartOfDocument: Command;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
export { cleanUpAtTheStartOfDocument,
|
|
1
|
+
export { cleanUpAtTheStartOfDocument, insertBlockQuoteWithAnalytics, setBlockType, setBlockTypeWithAnalytics, setHeading, setHeadingWithAnalytics, setNormalText, setNormalTextWithAnalytics, } from './block-type';
|
|
2
2
|
export type { InputMethod } from './block-type';
|
|
3
|
-
export { insertBlock } from './insert-block';
|
|
4
|
-
export { isConvertableToCodeBlock, transformToCodeBlockAction, } from './transform-to-code-block';
|
|
5
3
|
export { deleteAndMoveCursor } from './delete-and-move-cursor';
|
|
6
4
|
export { deleteBlockContent } from './delete-block-content';
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { NextEditorPlugin, OptionalPlugin, Command } from '@atlaskit/editor-common/types';
|
|
2
2
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
|
+
import type { BlockTypeState } from './pm-plugins/main';
|
|
3
4
|
import type { BlockTypePluginOptions } from './types';
|
|
4
|
-
|
|
5
|
+
import type { InputMethod } from './commands/block-type';
|
|
6
|
+
export type BlockTypePlugin = NextEditorPlugin<'blockType', {
|
|
5
7
|
pluginConfiguration: BlockTypePluginOptions | undefined;
|
|
6
8
|
dependencies: [
|
|
7
9
|
OptionalPlugin<typeof analyticsPlugin>
|
|
8
10
|
];
|
|
11
|
+
sharedState: BlockTypeState | undefined;
|
|
12
|
+
actions: {
|
|
13
|
+
insertBlockQuote: (inputMethod: InputMethod) => Command;
|
|
14
|
+
setBlockType: (name: string, inputMethod: InputMethod) => Command;
|
|
15
|
+
};
|
|
9
16
|
}>;
|
|
17
|
+
declare const blockTypePlugin: BlockTypePlugin;
|
|
10
18
|
export default blockTypePlugin;
|
|
11
19
|
export { pluginKey } from './pm-plugins/main';
|
|
12
20
|
export type { BlockTypeState } from './pm-plugins/main';
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
1
2
|
import type { Command } from '../../types';
|
|
3
|
+
import type { INPUT_METHOD, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
2
4
|
export declare const removeCodeBlock: Command;
|
|
3
5
|
export declare const changeLanguage: (language: string) => Command;
|
|
4
6
|
export declare const copyContentToClipboard: Command;
|
|
5
7
|
export declare const resetCopiedState: Command;
|
|
6
8
|
export declare const ignoreFollowingMutations: Command;
|
|
7
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;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import type { NextEditorPlugin, OptionalPlugin, Command } from '@atlaskit/editor-common/types';
|
|
2
3
|
import type { CodeBlockOptions } from './types';
|
|
3
4
|
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
4
5
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
@@ -10,5 +11,9 @@ declare const codeBlockPlugin: NextEditorPlugin<'codeBlock', {
|
|
|
10
11
|
typeof compositionPlugin,
|
|
11
12
|
OptionalPlugin<typeof analyticsPlugin>
|
|
12
13
|
];
|
|
14
|
+
actions: {
|
|
15
|
+
insertCodeBlock: (inputMethod: INPUT_METHOD) => Command;
|
|
16
|
+
};
|
|
13
17
|
}>;
|
|
14
18
|
export default codeBlockPlugin;
|
|
19
|
+
export type CodeBlockPlugin = typeof codeBlockPlugin;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Schema } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
3
|
+
export declare function createCodeBlockInputRule(schema: Schema, editorAnalyticsAPI?: EditorAnalyticsAPI): import("@atlaskit/editor-common/safe-plugin").SafePlugin<any>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import type { WeekDay } from '@atlaskit/calendar/types';
|
|
4
|
-
import { DateType } from '../../types';
|
|
4
|
+
import type { DateType } from '../../types';
|
|
5
5
|
import { INPUT_METHOD } from '../../../analytics/types/enums';
|
|
6
6
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
7
|
-
import { WrappedComponentProps } from 'react-intl-next';
|
|
7
|
+
import type { WrappedComponentProps } from 'react-intl-next';
|
|
8
8
|
export interface Props {
|
|
9
9
|
element: HTMLElement | null;
|
|
10
10
|
closeDatePicker: () => void;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export { basePlugin } from './base';
|
|
2
2
|
export { default as blockTypePlugin } from './block-type';
|
|
3
|
-
export { pluginKey as blockPluginStateKey } from './block-type';
|
|
4
|
-
export type { BlockTypeState } from './block-type';
|
|
5
3
|
export { default as betterTypeHistoryPlugin } from './better-type-history';
|
|
6
4
|
export { default as clearMarksOnChangeToEmptyDocumentPlugin } from './clear-marks-on-change-to-empty-document';
|
|
7
5
|
export { default as codeBlockPlugin } from './code-block';
|
|
@@ -8,14 +8,20 @@ import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
|
8
8
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
9
9
|
import type mentionsPlugin from '../mentions';
|
|
10
10
|
import type quickInsertPlugin from '../quick-insert';
|
|
11
|
+
import type blockTypePlugin from '../block-type';
|
|
12
|
+
import type codeBlockPlugin from '../code-block';
|
|
13
|
+
import type panelPlugin from '../panel';
|
|
11
14
|
export type InsertBlockPluginDependencies = [
|
|
12
15
|
typeof featureFlagsPlugin,
|
|
13
16
|
OptionalPlugin<typeof tablesPlugin>,
|
|
14
17
|
OptionalPlugin<typeof hyperlinkPlugin>,
|
|
15
18
|
OptionalPlugin<typeof datePlugin>,
|
|
19
|
+
OptionalPlugin<typeof blockTypePlugin>,
|
|
16
20
|
OptionalPlugin<typeof analyticsPlugin>,
|
|
17
21
|
OptionalPlugin<ImageUploadPlugin>,
|
|
18
22
|
OptionalPlugin<typeof mentionsPlugin>,
|
|
19
23
|
OptionalPlugin<EmojiPlugin>,
|
|
20
|
-
OptionalPlugin<typeof quickInsertPlugin
|
|
24
|
+
OptionalPlugin<typeof quickInsertPlugin>,
|
|
25
|
+
OptionalPlugin<typeof codeBlockPlugin>,
|
|
26
|
+
OptionalPlugin<typeof panelPlugin>
|
|
21
27
|
];
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { PanelType } from '@atlaskit/adf-schema';
|
|
2
2
|
import type { Command } from '../../types';
|
|
3
|
+
import { INPUT_METHOD } from '../analytics';
|
|
3
4
|
import type { PanelOptions } from './pm-plugins/main';
|
|
5
|
+
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
4
6
|
export type DomAtPos = (pos: number) => {
|
|
5
7
|
node: HTMLElement;
|
|
6
8
|
offset: number;
|
|
7
9
|
};
|
|
8
10
|
export declare const removePanel: () => Command;
|
|
9
11
|
export declare const changePanelType: (panelType: PanelType, panelOptions?: PanelOptions, allowCustomPanel?: boolean) => Command;
|
|
12
|
+
export declare function insertPanelWithAnalytics(inputMethod: INPUT_METHOD, analyticsAPI?: EditorAnalyticsAPI): import("@atlaskit/editor-common/types").Command;
|
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { Command, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import { INPUT_METHOD } from '../analytics';
|
|
2
3
|
import type { PanelPluginOptions } from './types';
|
|
3
4
|
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
5
|
+
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
4
6
|
declare const panelPlugin: NextEditorPlugin<'panel', {
|
|
5
7
|
pluginConfiguration: PanelPluginOptions | undefined;
|
|
6
8
|
dependencies: [
|
|
7
|
-
typeof decorationsPlugin
|
|
9
|
+
typeof decorationsPlugin,
|
|
10
|
+
OptionalPlugin<typeof analyticsPlugin>
|
|
8
11
|
];
|
|
12
|
+
actions: {
|
|
13
|
+
insertPanel: (inputMethod: INPUT_METHOD) => Command;
|
|
14
|
+
};
|
|
9
15
|
}>;
|
|
10
16
|
export default panelPlugin;
|
|
17
|
+
export type PanelPlugin = typeof panelPlugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "187.
|
|
3
|
+
"version": "187.35.0",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
"@atlaskit/avatar": "^21.3.0",
|
|
51
51
|
"@atlaskit/avatar-group": "^9.4.0",
|
|
52
52
|
"@atlaskit/button": "^16.9.0",
|
|
53
|
-
"@atlaskit/calendar": "^13.
|
|
53
|
+
"@atlaskit/calendar": "^13.3.0",
|
|
54
54
|
"@atlaskit/checkbox": "^12.6.0",
|
|
55
55
|
"@atlaskit/code": "^14.6.0",
|
|
56
56
|
"@atlaskit/date": "^0.10.0",
|
|
57
57
|
"@atlaskit/datetime-picker": "^12.8.0",
|
|
58
|
-
"@atlaskit/editor-common": "^74.
|
|
58
|
+
"@atlaskit/editor-common": "^74.56.0",
|
|
59
59
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
60
60
|
"@atlaskit/editor-markdown-transformer": "^5.2.5",
|
|
61
61
|
"@atlaskit/editor-palette": "1.5.1",
|
|
@@ -90,8 +90,8 @@
|
|
|
90
90
|
"@atlaskit/locale": "^2.5.0",
|
|
91
91
|
"@atlaskit/logo": "^13.14.0",
|
|
92
92
|
"@atlaskit/media-card": "^76.1.0",
|
|
93
|
-
"@atlaskit/media-client": "^23.
|
|
94
|
-
"@atlaskit/media-common": "^8.
|
|
93
|
+
"@atlaskit/media-client": "^23.2.0",
|
|
94
|
+
"@atlaskit/media-common": "^8.2.0",
|
|
95
95
|
"@atlaskit/media-filmstrip": "^47.0.0",
|
|
96
96
|
"@atlaskit/media-picker": "^66.2.0",
|
|
97
97
|
"@atlaskit/media-ui": "^24.0.0",
|