@atlaskit/editor-core 185.12.0 → 185.12.2
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 +12 -0
- package/dist/cjs/plugins/block-type/commands/block-type.js +79 -44
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +4 -3
- package/dist/cjs/plugins/card/ui/EditorSmartCardEventsNext.js +15 -36
- package/dist/cjs/plugins/code-block/index.js +7 -3
- package/dist/cjs/plugins/expand/commands.js +6 -2
- package/dist/cjs/plugins/expand/index.js +5 -1
- package/dist/cjs/plugins/hyperlink/Toolbar.js +1 -0
- package/dist/cjs/plugins/panel/index.js +81 -43
- package/dist/cjs/plugins/quick-insert/commands.js +2 -0
- package/dist/cjs/ui/ElementBrowser/InsertMenu.js +10 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/plugins/block-type/commands/block-type.js +86 -51
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +4 -3
- package/dist/es2019/plugins/card/ui/EditorSmartCardEventsNext.js +21 -35
- package/dist/es2019/plugins/code-block/index.js +7 -2
- package/dist/es2019/plugins/expand/commands.js +6 -2
- package/dist/es2019/plugins/expand/index.js +5 -1
- package/dist/es2019/plugins/hyperlink/Toolbar.js +1 -0
- package/dist/es2019/plugins/panel/index.js +82 -41
- package/dist/es2019/plugins/quick-insert/commands.js +2 -0
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +10 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/plugins/block-type/commands/block-type.js +76 -43
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +4 -3
- package/dist/esm/plugins/card/ui/EditorSmartCardEventsNext.js +15 -36
- package/dist/esm/plugins/code-block/index.js +7 -2
- package/dist/esm/plugins/expand/commands.js +6 -2
- package/dist/esm/plugins/expand/index.js +5 -1
- package/dist/esm/plugins/hyperlink/Toolbar.js +1 -0
- package/dist/esm/plugins/panel/index.js +81 -43
- package/dist/esm/plugins/quick-insert/commands.js +2 -0
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +10 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/plugins/block-type/commands/block-type.d.ts +25 -0
- package/dist/types/plugins/card/types.d.ts +2 -3
- package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +2 -2
- package/dist/types-ts4.5/plugins/block-type/commands/block-type.d.ts +25 -0
- package/dist/types-ts4.5/plugins/card/types.d.ts +2 -3
- package/dist/types-ts4.5/plugins/card/ui/EditLinkToolbar.d.ts +2 -2
- package/package.json +2 -2
|
@@ -4,7 +4,7 @@ import { EditorState } from 'prosemirror-state';
|
|
|
4
4
|
import { EditorView } from 'prosemirror-view';
|
|
5
5
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
6
6
|
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
7
|
-
import type { LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
7
|
+
import type { LinkInputType, LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
8
8
|
import type { Command, FloatingToolbarItem, FloatingToolbarConfig, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
9
9
|
import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
10
10
|
import { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
@@ -16,7 +16,7 @@ export type EditLinkToolbarProps = {
|
|
|
16
16
|
url: string | undefined;
|
|
17
17
|
text: string;
|
|
18
18
|
node: Node;
|
|
19
|
-
onSubmit?: (href: string, text?: string, analytic?: UIAnalyticsEvent | null | undefined) => void;
|
|
19
|
+
onSubmit?: (href: string, text?: string, inputMethod?: LinkInputType, analytic?: UIAnalyticsEvent | null | undefined) => void;
|
|
20
20
|
linkPickerOptions?: LinkPickerOptions;
|
|
21
21
|
featureFlags: FeatureFlags;
|
|
22
22
|
forceFocusSelector: ForceFocusSelector | undefined;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/// <reference path="../../../../../../../../typings/prosemirror.d.ts" />
|
|
2
|
+
/// <reference path="../../../../../../../../typings/prosemirror-state.d.ts" />
|
|
3
|
+
import { EditorState } from 'prosemirror-state';
|
|
4
|
+
import { NodeType } from 'prosemirror-model';
|
|
1
5
|
import { Command } from '../../../types';
|
|
2
6
|
import { HeadingLevelsAndNormalText } from '../types';
|
|
3
7
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
@@ -19,4 +23,25 @@ export declare function insertBlockType(name: string): Command;
|
|
|
19
23
|
* @returns - command that inserts block type
|
|
20
24
|
*/
|
|
21
25
|
export declare const insertBlockTypesWithAnalytics: (name: string, inputMethod: InputMethod, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
26
|
+
/**
|
|
27
|
+
* This function creates a new transaction that wraps the current selection
|
|
28
|
+
* in the specified node type if it results in a valid transaction.
|
|
29
|
+
* If not valid, it performs a safe insert operation.
|
|
30
|
+
*
|
|
31
|
+
* Example of when wrapping might not be valid is when attempting to wrap
|
|
32
|
+
* content that is already inside a panel with another panel
|
|
33
|
+
*/
|
|
34
|
+
export declare function createWrapSelectionTransaction({ state, type, nodeAttributes, }: {
|
|
35
|
+
state: EditorState;
|
|
36
|
+
type: NodeType;
|
|
37
|
+
nodeAttributes?: Record<string, any>;
|
|
38
|
+
}): import("prosemirror-state").Transaction;
|
|
39
|
+
/**
|
|
40
|
+
* This function creates a new transaction that inserts a code block,
|
|
41
|
+
* if there is text selected it will wrap the current selection if not it will
|
|
42
|
+
* append the codeblock to the end of the document.
|
|
43
|
+
*/
|
|
44
|
+
export declare function createInsertCodeBlockTransaction({ state, }: {
|
|
45
|
+
state: EditorState;
|
|
46
|
+
}): import("prosemirror-state").Transaction;
|
|
22
47
|
export declare const cleanUpAtTheStartOfDocument: Command;
|
|
@@ -64,7 +64,7 @@ export type Request = {
|
|
|
64
64
|
*/
|
|
65
65
|
sourceEvent?: UIAnalyticsEvent | null | undefined;
|
|
66
66
|
};
|
|
67
|
-
type Metadata<T = {}> = {
|
|
67
|
+
export type Metadata<T = {}> = {
|
|
68
68
|
url: string;
|
|
69
69
|
display: string;
|
|
70
70
|
isUndo?: boolean;
|
|
@@ -74,7 +74,7 @@ type Metadata<T = {}> = {
|
|
|
74
74
|
sourceEvent?: unknown;
|
|
75
75
|
nodeContext?: string;
|
|
76
76
|
} & T;
|
|
77
|
-
type UpdateMetadata = {
|
|
77
|
+
export type UpdateMetadata = {
|
|
78
78
|
previousDisplay?: string;
|
|
79
79
|
};
|
|
80
80
|
export type SmartLinkEventsNext = {
|
|
@@ -162,4 +162,3 @@ export type SetCardLayoutAndDatasourceTableRef = {
|
|
|
162
162
|
datasourceTableRef?: HTMLElement;
|
|
163
163
|
};
|
|
164
164
|
export type CardPluginAction = SetProvider | Queue | Resolve | Register | ShowLinkToolbar | HideLinkToolbar | ShowDatasourceModal | HideDatasourceModal | RegisterSmartCardEvents | RegisterSmartCardEventsNext | SetDatasourceTableRef | SetCardLayout | SetCardLayoutAndDatasourceTableRef;
|
|
165
|
-
export {};
|
|
@@ -4,7 +4,7 @@ import { EditorState } from 'prosemirror-state';
|
|
|
4
4
|
import { EditorView } from 'prosemirror-view';
|
|
5
5
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
6
6
|
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
7
|
-
import type { LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
7
|
+
import type { LinkInputType, LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
8
8
|
import type { Command, FloatingToolbarItem, FloatingToolbarConfig, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
9
9
|
import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
10
10
|
import { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
@@ -16,7 +16,7 @@ export type EditLinkToolbarProps = {
|
|
|
16
16
|
url: string | undefined;
|
|
17
17
|
text: string;
|
|
18
18
|
node: Node;
|
|
19
|
-
onSubmit?: (href: string, text?: string, analytic?: UIAnalyticsEvent | null | undefined) => void;
|
|
19
|
+
onSubmit?: (href: string, text?: string, inputMethod?: LinkInputType, analytic?: UIAnalyticsEvent | null | undefined) => void;
|
|
20
20
|
linkPickerOptions?: LinkPickerOptions;
|
|
21
21
|
featureFlags: FeatureFlags;
|
|
22
22
|
forceFocusSelector: ForceFocusSelector | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "185.12.
|
|
3
|
+
"version": "185.12.2",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@atlaskit/icon-object": "^6.3.0",
|
|
78
78
|
"@atlaskit/link-analytics": "^8.2.0",
|
|
79
79
|
"@atlaskit/link-datasource": "^0.28.0",
|
|
80
|
-
"@atlaskit/link-picker": "^1.
|
|
80
|
+
"@atlaskit/link-picker": "^1.27.0",
|
|
81
81
|
"@atlaskit/locale": "^2.5.0",
|
|
82
82
|
"@atlaskit/logo": "^13.14.0",
|
|
83
83
|
"@atlaskit/media-card": "^76.1.0",
|