@atlaskit/editor-core 187.25.1 → 187.25.3
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 +13 -0
- package/dist/cjs/labs/next/presets/default.js +2 -2
- package/dist/cjs/plugins/code-block/pm-plugins/ide-ux.js +2 -1
- package/dist/cjs/plugins/placeholder/index.js +6 -5
- package/dist/cjs/plugins/quick-insert/commands.js +0 -3
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/labs/next/presets/default.js +1 -1
- package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +2 -1
- package/dist/es2019/plugins/placeholder/index.js +6 -5
- package/dist/es2019/plugins/quick-insert/commands.js +0 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/labs/next/presets/default.js +1 -1
- package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +2 -1
- package/dist/esm/plugins/placeholder/index.js +6 -5
- package/dist/esm/plugins/quick-insert/commands.js +0 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/editor-next/hooks/useProviderFactory.d.ts +1 -1
- package/dist/types/editor-next/utils/handleProviders.d.ts +1 -2
- package/dist/types/index.d.ts +10 -3
- package/dist/types/labs/next/presets/default.d.ts +9 -10
- package/dist/types/plugins/code-block/index.d.ts +1 -1
- package/dist/types/plugins/placeholder/index.d.ts +1 -1
- package/dist/types/plugins/quick-insert/api.d.ts +1 -1
- package/dist/types/plugins/quick-insert/commands.d.ts +1 -1
- package/dist/types/plugins/quick-insert/index.d.ts +6 -5
- package/dist/types/plugins/quick-insert/plugin-key.d.ts +1 -1
- package/dist/types/plugins/quick-insert/search.d.ts +2 -2
- package/dist/types/plugins/quick-insert/types.d.ts +2 -22
- package/dist/types/types/editor-props.d.ts +1 -2
- package/dist/types/utils/prepare-quick-insert-provider.d.ts +4 -4
- package/dist/types-ts4.5/editor-next/hooks/useProviderFactory.d.ts +1 -1
- package/dist/types-ts4.5/editor-next/utils/handleProviders.d.ts +1 -2
- package/dist/types-ts4.5/index.d.ts +10 -3
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +9 -10
- package/dist/types-ts4.5/plugins/code-block/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/placeholder/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/quick-insert/api.d.ts +1 -1
- package/dist/types-ts4.5/plugins/quick-insert/commands.d.ts +1 -1
- package/dist/types-ts4.5/plugins/quick-insert/index.d.ts +6 -5
- package/dist/types-ts4.5/plugins/quick-insert/plugin-key.d.ts +1 -1
- package/dist/types-ts4.5/plugins/quick-insert/search.d.ts +2 -2
- package/dist/types-ts4.5/plugins/quick-insert/types.d.ts +2 -22
- package/dist/types-ts4.5/types/editor-props.d.ts +1 -2
- package/dist/types-ts4.5/utils/prepare-quick-insert-provider.d.ts +4 -4
- package/package.json +2 -1
- package/report.api.md +15 -48
- package/tmp/api-report-tmp.d.ts +15 -46
- package/dist/cjs/plugins/composition/index.js +0 -33
- package/dist/cjs/plugins/composition/pm-plugins/main.js +0 -69
- package/dist/cjs/plugins/composition/pm-plugins/plugin-key.js +0 -9
- package/dist/es2019/plugins/composition/index.js +0 -23
- package/dist/es2019/plugins/composition/pm-plugins/main.js +0 -60
- package/dist/es2019/plugins/composition/pm-plugins/plugin-key.js +0 -2
- package/dist/esm/plugins/composition/index.js +0 -25
- package/dist/esm/plugins/composition/pm-plugins/main.js +0 -62
- package/dist/esm/plugins/composition/pm-plugins/plugin-key.js +0 -2
- package/dist/types/plugins/composition/index.d.ts +0 -8
- package/dist/types/plugins/composition/pm-plugins/main.d.ts +0 -4
- package/dist/types/plugins/composition/pm-plugins/plugin-key.d.ts +0 -6
- package/dist/types-ts4.5/plugins/composition/index.d.ts +0 -8
- package/dist/types-ts4.5/plugins/composition/pm-plugins/main.d.ts +0 -4
- package/dist/types-ts4.5/plugins/composition/pm-plugins/plugin-key.d.ts +0 -6
|
@@ -6,8 +6,7 @@ import type { EditorPresetProps } from './types';
|
|
|
6
6
|
import type { BlockTypePluginOptions } from '../../../plugins/block-type/types';
|
|
7
7
|
import type { PlaceholderPluginOptions } from '../../../plugins/placeholder';
|
|
8
8
|
import type { AnnotationProviders } from '../../../plugins/annotation';
|
|
9
|
-
import type { TextFormattingOptions, HyperlinkPluginOptions } from '@atlaskit/editor-common/types';
|
|
10
|
-
import type { QuickInsertPluginOptions } from '../../../plugins/quick-insert';
|
|
9
|
+
import type { TextFormattingOptions, HyperlinkPluginOptions, QuickInsertPluginOptions } from '@atlaskit/editor-common/types';
|
|
11
10
|
import type { CodeBlockOptions } from '../../../plugins/code-block/types';
|
|
12
11
|
import type { SelectionPluginOptions } from '../../../plugins/selection/types';
|
|
13
12
|
import type { CardOptions } from '@atlaskit/editor-common/card';
|
|
@@ -67,9 +66,9 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
67
66
|
};
|
|
68
67
|
}>,
|
|
69
68
|
(config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"composition", {
|
|
70
|
-
sharedState: import("
|
|
69
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
71
70
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"composition", {
|
|
72
|
-
sharedState: import("
|
|
71
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
73
72
|
}>,
|
|
74
73
|
import("@atlaskit/editor-common/types").OptionalPlugin<(config: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"analytics", {
|
|
75
74
|
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
@@ -122,9 +121,9 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
122
121
|
};
|
|
123
122
|
}>,
|
|
124
123
|
(config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"composition", {
|
|
125
|
-
sharedState: import("
|
|
124
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
126
125
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"composition", {
|
|
127
|
-
sharedState: import("
|
|
126
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
128
127
|
}>,
|
|
129
128
|
import("@atlaskit/editor-common/types").OptionalPlugin<(config: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"analytics", {
|
|
130
129
|
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
@@ -532,9 +531,9 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
532
531
|
};
|
|
533
532
|
}>,
|
|
534
533
|
(config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"composition", {
|
|
535
|
-
sharedState: import("
|
|
534
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
536
535
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"composition", {
|
|
537
|
-
sharedState: import("
|
|
536
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
538
537
|
}>,
|
|
539
538
|
import("@atlaskit/editor-common/types").OptionalPlugin<(config: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"analytics", {
|
|
540
539
|
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
@@ -587,9 +586,9 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
587
586
|
};
|
|
588
587
|
}>,
|
|
589
588
|
(config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"composition", {
|
|
590
|
-
sharedState: import("
|
|
589
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
591
590
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"composition", {
|
|
592
|
-
sharedState: import("
|
|
591
|
+
sharedState: import("@atlaskit/editor-plugin-composition").CompositionState;
|
|
593
592
|
}>,
|
|
594
593
|
import("@atlaskit/editor-common/types").OptionalPlugin<(config: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"analytics", {
|
|
595
594
|
pluginConfiguration: import("@atlaskit/editor-plugin-analytics").AnalyticsPluginOptions;
|
|
@@ -2,7 +2,7 @@ import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/t
|
|
|
2
2
|
import type { CodeBlockOptions } from './types';
|
|
3
3
|
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
4
4
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
5
|
-
import type compositionPlugin from '
|
|
5
|
+
import type { compositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
6
6
|
declare const codeBlockPlugin: NextEditorPlugin<'codeBlock', {
|
|
7
7
|
pluginConfiguration: CodeBlockOptions;
|
|
8
8
|
dependencies: [
|
|
@@ -5,7 +5,7 @@ import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
|
5
5
|
import type { NextEditorPlugin, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { focusPlugin } from '@atlaskit/editor-plugin-focus';
|
|
7
7
|
export declare const pluginKey: PluginKey<any>;
|
|
8
|
-
import type compositionPlugin from '
|
|
8
|
+
import type { compositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
9
9
|
export declare const placeholderTestId = "placeholder-test-id";
|
|
10
10
|
export declare function createPlaceholderDecoration(editorState: EditorState, placeholderText: string, pos?: number): DecorationSet;
|
|
11
11
|
export declare function createPlugin(defaultPlaceholderText?: string, bracketPlaceholderText?: string, api?: ExtractInjectionAPI<typeof placeholderPlugin>): SafePlugin | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
2
2
|
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
-
import type { QuickInsertPluginOptions } from '
|
|
3
|
+
import type { QuickInsertPluginOptions } from '@atlaskit/editor-common/types';
|
|
4
4
|
export declare const createQuickInsertTools: (editorView: EditorView) => {
|
|
5
5
|
getItems: (query: string, options?: QuickInsertPluginOptions) => QuickInsertItem[];
|
|
6
6
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { QuickInsertItem } from '@atlaskit/editor-common/
|
|
1
|
+
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
2
2
|
import type { Command } from '../../types';
|
|
3
3
|
export declare const openElementBrowserModal: () => Command;
|
|
4
4
|
export declare const closeElementBrowserModal: () => Command;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { IntlShape } from 'react-intl-next';
|
|
2
|
-
import { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
-
import { NextEditorPlugin } from '../../types';
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
+
import type { NextEditorPlugin } from '../../types';
|
|
4
4
|
import { pluginKey } from './plugin-key';
|
|
5
|
-
import { QuickInsertHandler
|
|
6
|
-
|
|
5
|
+
import type { QuickInsertHandler } from './types';
|
|
6
|
+
import type { QuickInsertPluginOptions } from '@atlaskit/editor-common/types';
|
|
7
|
+
export type { QuickInsertHandler, QuickInsertPluginOptions };
|
|
7
8
|
export { pluginKey };
|
|
8
9
|
declare const quickInsertPlugin: NextEditorPlugin<'quickInsert', {
|
|
9
10
|
pluginConfiguration: QuickInsertPluginOptions | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
-
import { QuickInsertPluginState, QuickInsertPluginOptions } from '
|
|
1
|
+
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
2
|
+
import type { QuickInsertPluginState, QuickInsertPluginOptions } from '@atlaskit/editor-common/types';
|
|
3
3
|
export declare function find(query: string, items: QuickInsertItem[]): QuickInsertItem[];
|
|
4
4
|
export declare const searchQuickInsertItems: (quickInsertState?: QuickInsertPluginState, options?: QuickInsertPluginOptions) => (query?: string, category?: string) => QuickInsertItem[];
|
|
5
5
|
export declare const getFeaturedQuickInsertItems: ({ providedItems, lazyDefaultItems }: QuickInsertPluginState, options?: QuickInsertPluginOptions) => () => QuickInsertItem[];
|
|
@@ -1,24 +1,4 @@
|
|
|
1
|
-
import { IntlShape } from 'react-intl-next';
|
|
2
|
-
import { QuickInsertItem
|
|
1
|
+
import type { IntlShape } from 'react-intl-next';
|
|
2
|
+
import type { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
3
3
|
export type { IconProps } from '@atlaskit/editor-common/types';
|
|
4
|
-
import { EmptyStateHandler } from '../../types/empty-state-handler';
|
|
5
|
-
export type { QuickInsertActionInsert, QuickInsertItem, QuickInsertProvider, } from '@atlaskit/editor-common/provider-factory';
|
|
6
|
-
export type QuickInsertOptions = boolean | {
|
|
7
|
-
provider: Promise<QuickInsertProvider>;
|
|
8
|
-
};
|
|
9
4
|
export type QuickInsertHandler = Array<QuickInsertItem> | ((intl: IntlShape) => Array<QuickInsertItem>);
|
|
10
|
-
export type QuickInsertPluginState = {
|
|
11
|
-
isElementBrowserModalOpen: boolean;
|
|
12
|
-
lazyDefaultItems: () => QuickInsertItem[];
|
|
13
|
-
providedItems?: QuickInsertItem[];
|
|
14
|
-
provider?: QuickInsertProvider;
|
|
15
|
-
emptyStateHandler?: EmptyStateHandler;
|
|
16
|
-
};
|
|
17
|
-
export type QuickInsertPluginStateKeys = keyof QuickInsertPluginState;
|
|
18
|
-
export interface QuickInsertPluginOptions {
|
|
19
|
-
headless?: boolean;
|
|
20
|
-
disableDefaultItems?: boolean;
|
|
21
|
-
enableElementBrowser?: boolean;
|
|
22
|
-
elementBrowserHelpUrl?: string;
|
|
23
|
-
emptyStateHandler?: EmptyStateHandler;
|
|
24
|
-
}
|
|
@@ -6,7 +6,7 @@ import type { CardOptions } from '@atlaskit/editor-common/card';
|
|
|
6
6
|
import type { ExtensionHandlers, ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
7
7
|
import type { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
8
8
|
import type { ContextIdentifierProvider, Providers, SearchProvider } from '@atlaskit/editor-common/provider-factory';
|
|
9
|
-
import type { AllEditorPresetPluginTypes, Transformer, LinkingOptions, TextFormattingOptions } from '@atlaskit/editor-common/types';
|
|
9
|
+
import type { AllEditorPresetPluginTypes, Transformer, LinkingOptions, TextFormattingOptions, QuickInsertOptions } from '@atlaskit/editor-common/types';
|
|
10
10
|
import type { ErrorReportingHandler } from '@atlaskit/editor-common/utils';
|
|
11
11
|
import type { PluginConfig as TablesPluginConfig } from '@atlaskit/editor-plugin-table/types';
|
|
12
12
|
import type { MentionProvider } from '@atlaskit/mention/resource';
|
|
@@ -23,7 +23,6 @@ import type { MediaOptions, MediaState } from '../plugins/media/types';
|
|
|
23
23
|
import type { MentionPluginConfig } from '../plugins/mentions/types';
|
|
24
24
|
import type { PanelPluginConfig } from '../plugins/panel/types';
|
|
25
25
|
import type { PlaceholderTextOptions } from '../plugins/placeholder-text/types';
|
|
26
|
-
import type { QuickInsertOptions } from '../plugins/quick-insert/types';
|
|
27
26
|
import type { TextColorPluginConfig } from '../plugins/text-color/pm-plugins/main';
|
|
28
27
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
29
28
|
import type { EditorAppearance } from './editor-appearance';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
2
|
-
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
|
|
3
|
-
import { QuickInsertProvider } from '@atlaskit/editor-common/provider-factory';
|
|
4
|
-
import EditorActions from '../actions';
|
|
5
|
-
import { QuickInsertOptions } from '
|
|
2
|
+
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
|
|
3
|
+
import type { QuickInsertProvider } from '@atlaskit/editor-common/provider-factory';
|
|
4
|
+
import type EditorActions from '../actions';
|
|
5
|
+
import type { QuickInsertOptions } from '@atlaskit/editor-common/types';
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
8
8
|
* Used to combine the quickInsert provider and extension provider (if available)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "187.25.
|
|
3
|
+
"version": "187.25.3",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
"@atlaskit/editor-palette": "1.5.1",
|
|
62
62
|
"@atlaskit/editor-plugin-analytics": "^0.1.0",
|
|
63
63
|
"@atlaskit/editor-plugin-card": "^0.4.0",
|
|
64
|
+
"@atlaskit/editor-plugin-composition": "^0.0.1",
|
|
64
65
|
"@atlaskit/editor-plugin-content-insertion": "^0.0.8",
|
|
65
66
|
"@atlaskit/editor-plugin-context-panel": "^0.1.0",
|
|
66
67
|
"@atlaskit/editor-plugin-decorations": "^0.1.0",
|
package/report.api.md
CHANGED
|
@@ -89,7 +89,7 @@ import type { HyperlinkPluginOptions } from '@atlaskit/editor-common/types';
|
|
|
89
89
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
90
90
|
import type { InputMethodInsertMedia } from '@atlaskit/editor-common/analytics';
|
|
91
91
|
import { InputTracking } from '@atlaskit/editor-common/types';
|
|
92
|
-
import { IntlShape } from 'react-intl-next';
|
|
92
|
+
import type { IntlShape } from 'react-intl-next';
|
|
93
93
|
import { JSONDocNode } from '@atlaskit/editor-json-transformer/types';
|
|
94
94
|
import { jsx } from '@emotion/react';
|
|
95
95
|
import { lightModeStatusColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
@@ -132,9 +132,10 @@ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
|
132
132
|
import type { Providers } from '@atlaskit/editor-common/provider-factory';
|
|
133
133
|
import type { PublicPluginAPI } from '@atlaskit/editor-common/types';
|
|
134
134
|
import { PureComponent } from 'react';
|
|
135
|
-
import { QuickInsertActionInsert } from '@atlaskit/editor-common/provider-factory';
|
|
136
135
|
import { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
137
|
-
import {
|
|
136
|
+
import type { QuickInsertOptions } from '@atlaskit/editor-common/types';
|
|
137
|
+
import type { QuickInsertPluginOptions } from '@atlaskit/editor-common/types';
|
|
138
|
+
import type { QuickInsertPluginState } from '@atlaskit/editor-common/types';
|
|
138
139
|
import { QuickInsertProvider } from '@atlaskit/editor-common/provider-factory';
|
|
139
140
|
import { default as React_2 } from 'react';
|
|
140
141
|
import type { ReactElement } from 'react';
|
|
@@ -157,8 +158,8 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
|
157
158
|
import { TransactionTracking } from '@atlaskit/editor-common/types';
|
|
158
159
|
import type { Transformer as Transformer_2 } from '@atlaskit/editor-common/types';
|
|
159
160
|
import type { TypeAheadHandler } from '@atlaskit/editor-common/types';
|
|
160
|
-
import
|
|
161
|
-
import type { TypeAheadItem as TypeAheadItem_2 } from '@atlaskit/editor-common/
|
|
161
|
+
import { TypeAheadItem } from '@atlaskit/editor-common/provider-factory';
|
|
162
|
+
import type { TypeAheadItem as TypeAheadItem_2 } from '@atlaskit/editor-common/types';
|
|
162
163
|
import type { TypeAheadStats } from '@atlaskit/editor-common/types';
|
|
163
164
|
import { UIComponentFactory } from '@atlaskit/editor-common/types';
|
|
164
165
|
import { UploadEndEventPayload } from '@atlaskit/media-picker/types';
|
|
@@ -412,8 +413,8 @@ export const createTypeAheadTools: (editorView: EditorView) => {
|
|
|
412
413
|
close: (options?: CloseOptions) => boolean;
|
|
413
414
|
openMention: (inputMethod: TypeAheadInputMethod) => boolean;
|
|
414
415
|
searchMention: (query?: string) => {
|
|
415
|
-
type: (appendValue: string) => Promise<
|
|
416
|
-
result: () => Promise<
|
|
416
|
+
type: (appendValue: string) => Promise<TypeAheadItem[]> | undefined;
|
|
417
|
+
result: () => Promise<TypeAheadItem[] | undefined>;
|
|
417
418
|
close: (options?: CloseOptions) => boolean;
|
|
418
419
|
insert: ({
|
|
419
420
|
index,
|
|
@@ -425,8 +426,8 @@ export const createTypeAheadTools: (editorView: EditorView) => {
|
|
|
425
426
|
};
|
|
426
427
|
openQuickInsert: (inputMethod: TypeAheadInputMethod) => boolean;
|
|
427
428
|
searchQuickInsert: (query?: string) => {
|
|
428
|
-
type: (appendValue: string) => Promise<
|
|
429
|
-
result: () => Promise<
|
|
429
|
+
type: (appendValue: string) => Promise<TypeAheadItem[]> | undefined;
|
|
430
|
+
result: () => Promise<TypeAheadItem[] | undefined>;
|
|
430
431
|
close: (options?: CloseOptions) => boolean;
|
|
431
432
|
insert: ({
|
|
432
433
|
index,
|
|
@@ -438,8 +439,8 @@ export const createTypeAheadTools: (editorView: EditorView) => {
|
|
|
438
439
|
};
|
|
439
440
|
openEmoji: (inputMethod: TypeAheadInputMethod) => boolean;
|
|
440
441
|
searchEmoji: (query?: string) => {
|
|
441
|
-
type: (appendValue: string) => Promise<
|
|
442
|
-
result: () => Promise<
|
|
442
|
+
type: (appendValue: string) => Promise<TypeAheadItem[]> | undefined;
|
|
443
|
+
result: () => Promise<TypeAheadItem[] | undefined>;
|
|
443
444
|
close: (options?: CloseOptions) => boolean;
|
|
444
445
|
insert: ({
|
|
445
446
|
index,
|
|
@@ -1160,9 +1161,9 @@ export const insertHorizontalRule: (
|
|
|
1160
1161
|
|
|
1161
1162
|
// @public (undocumented)
|
|
1162
1163
|
type InsertItemProps = {
|
|
1163
|
-
contentItem:
|
|
1164
|
+
contentItem: TypeAheadItem;
|
|
1164
1165
|
query: string;
|
|
1165
|
-
sourceListItem:
|
|
1166
|
+
sourceListItem: TypeAheadItem[];
|
|
1166
1167
|
};
|
|
1167
1168
|
|
|
1168
1169
|
// @public (undocumented)
|
|
@@ -1762,8 +1763,6 @@ type Props_5 = {
|
|
|
1762
1763
|
// @public (undocumented)
|
|
1763
1764
|
type ProsemirrorGetPosHandler = () => number | undefined;
|
|
1764
1765
|
|
|
1765
|
-
export { QuickInsertActionInsert };
|
|
1766
|
-
|
|
1767
1766
|
// @public (undocumented)
|
|
1768
1767
|
type QuickInsertHandler =
|
|
1769
1768
|
| ((intl: IntlShape) => Array<QuickInsertItem>)
|
|
@@ -1771,41 +1770,9 @@ type QuickInsertHandler =
|
|
|
1771
1770
|
|
|
1772
1771
|
export { QuickInsertItem };
|
|
1773
1772
|
|
|
1774
|
-
export { QuickInsertItemId };
|
|
1775
|
-
|
|
1776
|
-
// @public (undocumented)
|
|
1777
|
-
type QuickInsertOptions =
|
|
1778
|
-
| boolean
|
|
1779
|
-
| {
|
|
1780
|
-
provider: Promise<QuickInsertProvider>;
|
|
1781
|
-
};
|
|
1782
|
-
|
|
1783
1773
|
// @public (undocumented)
|
|
1784
1774
|
export const quickInsertPluginKey: PluginKey<QuickInsertPluginState>;
|
|
1785
1775
|
|
|
1786
|
-
// @public (undocumented)
|
|
1787
|
-
interface QuickInsertPluginOptions {
|
|
1788
|
-
// (undocumented)
|
|
1789
|
-
disableDefaultItems?: boolean;
|
|
1790
|
-
// (undocumented)
|
|
1791
|
-
elementBrowserHelpUrl?: string;
|
|
1792
|
-
// (undocumented)
|
|
1793
|
-
emptyStateHandler?: EmptyStateHandler;
|
|
1794
|
-
// (undocumented)
|
|
1795
|
-
enableElementBrowser?: boolean;
|
|
1796
|
-
// (undocumented)
|
|
1797
|
-
headless?: boolean;
|
|
1798
|
-
}
|
|
1799
|
-
|
|
1800
|
-
// @public (undocumented)
|
|
1801
|
-
export type QuickInsertPluginState = {
|
|
1802
|
-
isElementBrowserModalOpen: boolean;
|
|
1803
|
-
lazyDefaultItems: () => QuickInsertItem[];
|
|
1804
|
-
providedItems?: QuickInsertItem[];
|
|
1805
|
-
provider?: QuickInsertProvider;
|
|
1806
|
-
emptyStateHandler?: EmptyStateHandler;
|
|
1807
|
-
};
|
|
1808
|
-
|
|
1809
1776
|
export { QuickInsertProvider };
|
|
1810
1777
|
|
|
1811
1778
|
// @public (undocumented)
|
|
@@ -2174,7 +2141,7 @@ export type TypeAheadPluginState = {
|
|
|
2174
2141
|
decorationElement: HTMLElement | null;
|
|
2175
2142
|
typeAheadHandlers: Array<TypeAheadHandler>;
|
|
2176
2143
|
query: string;
|
|
2177
|
-
items: Array<
|
|
2144
|
+
items: Array<TypeAheadItem_2>;
|
|
2178
2145
|
triggerHandler?: TypeAheadHandler;
|
|
2179
2146
|
selectedIndex: number;
|
|
2180
2147
|
stats: TypeAheadStatsSerializable | null;
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -78,7 +78,7 @@ import type { HyperlinkPluginOptions } from '@atlaskit/editor-common/types';
|
|
|
78
78
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
79
79
|
import type { InputMethodInsertMedia } from '@atlaskit/editor-common/analytics';
|
|
80
80
|
import { InputTracking } from '@atlaskit/editor-common/types';
|
|
81
|
-
import { IntlShape } from 'react-intl-next';
|
|
81
|
+
import type { IntlShape } from 'react-intl-next';
|
|
82
82
|
import { JSONDocNode } from '@atlaskit/editor-json-transformer/types';
|
|
83
83
|
import { jsx } from '@emotion/react';
|
|
84
84
|
import { lightModeStatusColorPalette } from '@atlaskit/editor-common/ui-color';
|
|
@@ -121,9 +121,10 @@ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
|
121
121
|
import type { Providers } from '@atlaskit/editor-common/provider-factory';
|
|
122
122
|
import type { PublicPluginAPI } from '@atlaskit/editor-common/types';
|
|
123
123
|
import { PureComponent } from 'react';
|
|
124
|
-
import { QuickInsertActionInsert } from '@atlaskit/editor-common/provider-factory';
|
|
125
124
|
import { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
|
|
126
|
-
import {
|
|
125
|
+
import type { QuickInsertOptions } from '@atlaskit/editor-common/types';
|
|
126
|
+
import type { QuickInsertPluginOptions } from '@atlaskit/editor-common/types';
|
|
127
|
+
import type { QuickInsertPluginState } from '@atlaskit/editor-common/types';
|
|
127
128
|
import { QuickInsertProvider } from '@atlaskit/editor-common/provider-factory';
|
|
128
129
|
import { default as React_2 } from 'react';
|
|
129
130
|
import type { ReactElement } from 'react';
|
|
@@ -146,8 +147,8 @@ import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
|
146
147
|
import { TransactionTracking } from '@atlaskit/editor-common/types';
|
|
147
148
|
import type { Transformer as Transformer_2 } from '@atlaskit/editor-common/types';
|
|
148
149
|
import type { TypeAheadHandler } from '@atlaskit/editor-common/types';
|
|
149
|
-
import
|
|
150
|
-
import type { TypeAheadItem as TypeAheadItem_2 } from '@atlaskit/editor-common/
|
|
150
|
+
import { TypeAheadItem } from '@atlaskit/editor-common/provider-factory';
|
|
151
|
+
import type { TypeAheadItem as TypeAheadItem_2 } from '@atlaskit/editor-common/types';
|
|
151
152
|
import type { TypeAheadStats } from '@atlaskit/editor-common/types';
|
|
152
153
|
import { UIComponentFactory } from '@atlaskit/editor-common/types';
|
|
153
154
|
import { UploadEndEventPayload } from '@atlaskit/media-picker/types';
|
|
@@ -388,8 +389,8 @@ export const createTypeAheadTools: (editorView: EditorView) => {
|
|
|
388
389
|
close: (options?: CloseOptions) => boolean;
|
|
389
390
|
openMention: (inputMethod: TypeAheadInputMethod) => boolean;
|
|
390
391
|
searchMention: (query?: string) => {
|
|
391
|
-
type: (appendValue: string) => Promise<
|
|
392
|
-
result: () => Promise<
|
|
392
|
+
type: (appendValue: string) => Promise<TypeAheadItem[]> | undefined;
|
|
393
|
+
result: () => Promise<TypeAheadItem[] | undefined>;
|
|
393
394
|
close: (options?: CloseOptions) => boolean;
|
|
394
395
|
insert: ({ index, mode }: {
|
|
395
396
|
index: number;
|
|
@@ -398,8 +399,8 @@ export const createTypeAheadTools: (editorView: EditorView) => {
|
|
|
398
399
|
};
|
|
399
400
|
openQuickInsert: (inputMethod: TypeAheadInputMethod) => boolean;
|
|
400
401
|
searchQuickInsert: (query?: string) => {
|
|
401
|
-
type: (appendValue: string) => Promise<
|
|
402
|
-
result: () => Promise<
|
|
402
|
+
type: (appendValue: string) => Promise<TypeAheadItem[]> | undefined;
|
|
403
|
+
result: () => Promise<TypeAheadItem[] | undefined>;
|
|
403
404
|
close: (options?: CloseOptions) => boolean;
|
|
404
405
|
insert: ({ index, mode }: {
|
|
405
406
|
index: number;
|
|
@@ -408,8 +409,8 @@ export const createTypeAheadTools: (editorView: EditorView) => {
|
|
|
408
409
|
};
|
|
409
410
|
openEmoji: (inputMethod: TypeAheadInputMethod) => boolean;
|
|
410
411
|
searchEmoji: (query?: string) => {
|
|
411
|
-
type: (appendValue: string) => Promise<
|
|
412
|
-
result: () => Promise<
|
|
412
|
+
type: (appendValue: string) => Promise<TypeAheadItem[]> | undefined;
|
|
413
|
+
result: () => Promise<TypeAheadItem[] | undefined>;
|
|
413
414
|
close: (options?: CloseOptions) => boolean;
|
|
414
415
|
insert: ({ index, mode }: {
|
|
415
416
|
index: number;
|
|
@@ -1044,9 +1045,9 @@ export const insertHorizontalRule: (inputMethod: INPUT_METHOD.FORMATTING | INPUT
|
|
|
1044
1045
|
|
|
1045
1046
|
// @public (undocumented)
|
|
1046
1047
|
type InsertItemProps = {
|
|
1047
|
-
contentItem:
|
|
1048
|
+
contentItem: TypeAheadItem;
|
|
1048
1049
|
query: string;
|
|
1049
|
-
sourceListItem:
|
|
1050
|
+
sourceListItem: TypeAheadItem[];
|
|
1050
1051
|
};
|
|
1051
1052
|
|
|
1052
1053
|
// @public (undocumented)
|
|
@@ -1574,46 +1575,14 @@ type Props_5 = {
|
|
|
1574
1575
|
// @public (undocumented)
|
|
1575
1576
|
type ProsemirrorGetPosHandler = () => number | undefined;
|
|
1576
1577
|
|
|
1577
|
-
export { QuickInsertActionInsert }
|
|
1578
|
-
|
|
1579
1578
|
// @public (undocumented)
|
|
1580
1579
|
type QuickInsertHandler = ((intl: IntlShape) => Array<QuickInsertItem>) | Array<QuickInsertItem>;
|
|
1581
1580
|
|
|
1582
1581
|
export { QuickInsertItem }
|
|
1583
1582
|
|
|
1584
|
-
export { QuickInsertItemId }
|
|
1585
|
-
|
|
1586
|
-
// @public (undocumented)
|
|
1587
|
-
type QuickInsertOptions = boolean | {
|
|
1588
|
-
provider: Promise<QuickInsertProvider>;
|
|
1589
|
-
};
|
|
1590
|
-
|
|
1591
1583
|
// @public (undocumented)
|
|
1592
1584
|
export const quickInsertPluginKey: PluginKey<QuickInsertPluginState>;
|
|
1593
1585
|
|
|
1594
|
-
// @public (undocumented)
|
|
1595
|
-
interface QuickInsertPluginOptions {
|
|
1596
|
-
// (undocumented)
|
|
1597
|
-
disableDefaultItems?: boolean;
|
|
1598
|
-
// (undocumented)
|
|
1599
|
-
elementBrowserHelpUrl?: string;
|
|
1600
|
-
// (undocumented)
|
|
1601
|
-
emptyStateHandler?: EmptyStateHandler;
|
|
1602
|
-
// (undocumented)
|
|
1603
|
-
enableElementBrowser?: boolean;
|
|
1604
|
-
// (undocumented)
|
|
1605
|
-
headless?: boolean;
|
|
1606
|
-
}
|
|
1607
|
-
|
|
1608
|
-
// @public (undocumented)
|
|
1609
|
-
export type QuickInsertPluginState = {
|
|
1610
|
-
isElementBrowserModalOpen: boolean;
|
|
1611
|
-
lazyDefaultItems: () => QuickInsertItem[];
|
|
1612
|
-
providedItems?: QuickInsertItem[];
|
|
1613
|
-
provider?: QuickInsertProvider;
|
|
1614
|
-
emptyStateHandler?: EmptyStateHandler;
|
|
1615
|
-
};
|
|
1616
|
-
|
|
1617
1586
|
export { QuickInsertProvider }
|
|
1618
1587
|
|
|
1619
1588
|
// @public (undocumented)
|
|
@@ -1934,7 +1903,7 @@ export type TypeAheadPluginState = {
|
|
|
1934
1903
|
decorationElement: HTMLElement | null;
|
|
1935
1904
|
typeAheadHandlers: Array<TypeAheadHandler>;
|
|
1936
1905
|
query: string;
|
|
1937
|
-
items: Array<
|
|
1906
|
+
items: Array<TypeAheadItem_2>;
|
|
1938
1907
|
triggerHandler?: TypeAheadHandler;
|
|
1939
1908
|
selectedIndex: number;
|
|
1940
1909
|
stats: TypeAheadStatsSerializable | null;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _main = _interopRequireDefault(require("./pm-plugins/main"));
|
|
9
|
-
var _pluginKey = require("./pm-plugins/plugin-key");
|
|
10
|
-
var composition = function composition() {
|
|
11
|
-
return {
|
|
12
|
-
name: 'composition',
|
|
13
|
-
getSharedState: function getSharedState(editorState) {
|
|
14
|
-
var _pluginKey$getState;
|
|
15
|
-
if (!editorState) {
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
return {
|
|
19
|
-
isComposing: !!((_pluginKey$getState = _pluginKey.pluginKey.getState(editorState)) !== null && _pluginKey$getState !== void 0 && _pluginKey$getState.isComposing)
|
|
20
|
-
};
|
|
21
|
-
},
|
|
22
|
-
pmPlugins: function pmPlugins() {
|
|
23
|
-
return [{
|
|
24
|
-
name: 'composition',
|
|
25
|
-
plugin: function plugin() {
|
|
26
|
-
return (0, _main.default)();
|
|
27
|
-
}
|
|
28
|
-
}];
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
var _default = composition;
|
|
33
|
-
exports.default = _default;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
8
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
9
|
-
var _pluginKey = require("./plugin-key");
|
|
10
|
-
var isLinux = function isLinux() {
|
|
11
|
-
return navigator.userAgent.indexOf('Linux') >= 0;
|
|
12
|
-
};
|
|
13
|
-
var _default = function _default() {
|
|
14
|
-
return new _safePlugin.SafePlugin({
|
|
15
|
-
key: _pluginKey.pluginKey,
|
|
16
|
-
state: {
|
|
17
|
-
init: function init() {
|
|
18
|
-
return {
|
|
19
|
-
isComposing: false,
|
|
20
|
-
zeroWidthSpacePos: undefined
|
|
21
|
-
};
|
|
22
|
-
},
|
|
23
|
-
apply: function apply(tr, value) {
|
|
24
|
-
var isComposing = tr.getMeta(_pluginKey.pluginKey);
|
|
25
|
-
var zeroWidthSpacePos = tr.getMeta('zeroWidthSpacePos');
|
|
26
|
-
if (typeof isComposing === 'undefined') {
|
|
27
|
-
return value;
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
isComposing: isComposing,
|
|
31
|
-
zeroWidthSpacePos: zeroWidthSpacePos
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
props: {
|
|
36
|
-
handleDOMEvents: {
|
|
37
|
-
compositionstart: function compositionstart(view, event) {
|
|
38
|
-
var tr = view.state.tr;
|
|
39
|
-
tr.setMeta(_pluginKey.pluginKey, true);
|
|
40
|
-
|
|
41
|
-
// only apply for linux and cursor is at start of line
|
|
42
|
-
if (isLinux() && view.state.selection.$from.parentOffset === 0) {
|
|
43
|
-
tr.insertText(_utils.ZERO_WIDTH_SPACE);
|
|
44
|
-
|
|
45
|
-
// remember the position of inserted zero width space
|
|
46
|
-
tr.setMeta('zeroWidthSpacePos', view.state.selection.$from.pos);
|
|
47
|
-
}
|
|
48
|
-
view.dispatch(tr);
|
|
49
|
-
return false;
|
|
50
|
-
},
|
|
51
|
-
compositionend: function compositionend(view, event) {
|
|
52
|
-
var tr = view.state.tr;
|
|
53
|
-
tr.setMeta(_pluginKey.pluginKey, false);
|
|
54
|
-
if (isLinux()) {
|
|
55
|
-
var _pluginKey$getState;
|
|
56
|
-
var zeroWidthSpacePos = (_pluginKey$getState = _pluginKey.pluginKey.getState(view.state)) === null || _pluginKey$getState === void 0 ? void 0 : _pluginKey$getState.zeroWidthSpacePos;
|
|
57
|
-
if (typeof zeroWidthSpacePos !== 'undefined') {
|
|
58
|
-
tr.deleteRange(zeroWidthSpacePos, zeroWidthSpacePos + 1);
|
|
59
|
-
}
|
|
60
|
-
tr.setMeta('zeroWidthSpacePos', undefined);
|
|
61
|
-
}
|
|
62
|
-
view.dispatch(tr);
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
exports.default = _default;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.pluginKey = void 0;
|
|
7
|
-
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
8
|
-
var pluginKey = new _state.PluginKey('compositionPlugin');
|
|
9
|
-
exports.pluginKey = pluginKey;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import createPlugin from './pm-plugins/main';
|
|
2
|
-
import { pluginKey } from './pm-plugins/plugin-key';
|
|
3
|
-
const composition = () => {
|
|
4
|
-
return {
|
|
5
|
-
name: 'composition',
|
|
6
|
-
getSharedState(editorState) {
|
|
7
|
-
var _pluginKey$getState;
|
|
8
|
-
if (!editorState) {
|
|
9
|
-
return undefined;
|
|
10
|
-
}
|
|
11
|
-
return {
|
|
12
|
-
isComposing: !!((_pluginKey$getState = pluginKey.getState(editorState)) !== null && _pluginKey$getState !== void 0 && _pluginKey$getState.isComposing)
|
|
13
|
-
};
|
|
14
|
-
},
|
|
15
|
-
pmPlugins() {
|
|
16
|
-
return [{
|
|
17
|
-
name: 'composition',
|
|
18
|
-
plugin: () => createPlugin()
|
|
19
|
-
}];
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export default composition;
|