@atlaskit/editor-core 187.46.1 → 187.47.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 (89) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/cjs/index.js +3 -3
  3. package/dist/cjs/plugins/caption/pm-plugins/keymap.js +1 -1
  4. package/dist/cjs/plugins/code-block/pm-plugins/main.js +7 -7
  5. package/dist/cjs/plugins/expand/commands.js +2 -2
  6. package/dist/cjs/plugins/expand/index.js +6 -2
  7. package/dist/cjs/plugins/expand/nodeviews/index.js +26 -23
  8. package/dist/cjs/plugins/expand/pm-plugins/keymap.js +10 -12
  9. package/dist/cjs/plugins/expand/pm-plugins/main.js +9 -6
  10. package/dist/cjs/plugins/extension/pm-plugins/main.js +8 -9
  11. package/dist/cjs/plugins/layout/pm-plugins/main.js +2 -2
  12. package/dist/cjs/plugins/media/toolbar/commands.js +1 -1
  13. package/dist/cjs/plugins/panel/pm-plugins/main.js +2 -2
  14. package/dist/cjs/plugins/paste/handlers.js +3 -3
  15. package/dist/cjs/plugins/selection/commands.js +27 -14
  16. package/dist/cjs/plugins/selection/gap-cursor/utils/place-gap-cursor.js +1 -1
  17. package/dist/cjs/plugins/selection/index.js +13 -1
  18. package/dist/cjs/plugins/selection/utils.js +11 -25
  19. package/dist/cjs/plugins/tasks-and-decisions/commands.js +2 -2
  20. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/main.js +2 -3
  21. package/dist/cjs/test-utils.js +1 -1
  22. package/dist/cjs/version-wrapper.js +1 -1
  23. package/dist/es2019/index.js +1 -1
  24. package/dist/es2019/plugins/caption/pm-plugins/keymap.js +1 -1
  25. package/dist/es2019/plugins/code-block/pm-plugins/main.js +1 -1
  26. package/dist/es2019/plugins/expand/commands.js +1 -1
  27. package/dist/es2019/plugins/expand/index.js +4 -2
  28. package/dist/es2019/plugins/expand/nodeviews/index.js +24 -19
  29. package/dist/es2019/plugins/expand/pm-plugins/keymap.js +6 -6
  30. package/dist/es2019/plugins/expand/pm-plugins/main.js +6 -4
  31. package/dist/es2019/plugins/extension/pm-plugins/main.js +1 -2
  32. package/dist/es2019/plugins/layout/pm-plugins/main.js +1 -1
  33. package/dist/es2019/plugins/media/toolbar/commands.js +1 -1
  34. package/dist/es2019/plugins/panel/pm-plugins/main.js +1 -1
  35. package/dist/es2019/plugins/paste/handlers.js +1 -1
  36. package/dist/es2019/plugins/selection/commands.js +17 -6
  37. package/dist/es2019/plugins/selection/gap-cursor/utils/place-gap-cursor.js +1 -1
  38. package/dist/es2019/plugins/selection/index.js +13 -1
  39. package/dist/es2019/plugins/selection/utils.js +2 -21
  40. package/dist/es2019/plugins/tasks-and-decisions/commands.js +1 -1
  41. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/main.js +1 -1
  42. package/dist/es2019/test-utils.js +1 -1
  43. package/dist/es2019/version-wrapper.js +1 -1
  44. package/dist/esm/index.js +1 -1
  45. package/dist/esm/plugins/caption/pm-plugins/keymap.js +1 -1
  46. package/dist/esm/plugins/code-block/pm-plugins/main.js +1 -1
  47. package/dist/esm/plugins/expand/commands.js +1 -1
  48. package/dist/esm/plugins/expand/index.js +6 -2
  49. package/dist/esm/plugins/expand/nodeviews/index.js +24 -21
  50. package/dist/esm/plugins/expand/pm-plugins/keymap.js +6 -8
  51. package/dist/esm/plugins/expand/pm-plugins/main.js +6 -3
  52. package/dist/esm/plugins/extension/pm-plugins/main.js +1 -2
  53. package/dist/esm/plugins/layout/pm-plugins/main.js +1 -1
  54. package/dist/esm/plugins/media/toolbar/commands.js +1 -1
  55. package/dist/esm/plugins/panel/pm-plugins/main.js +1 -1
  56. package/dist/esm/plugins/paste/handlers.js +1 -1
  57. package/dist/esm/plugins/selection/commands.js +18 -6
  58. package/dist/esm/plugins/selection/gap-cursor/utils/place-gap-cursor.js +1 -1
  59. package/dist/esm/plugins/selection/index.js +13 -1
  60. package/dist/esm/plugins/selection/utils.js +2 -21
  61. package/dist/esm/plugins/tasks-and-decisions/commands.js +1 -1
  62. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/main.js +1 -1
  63. package/dist/esm/test-utils.js +1 -1
  64. package/dist/esm/version-wrapper.js +1 -1
  65. package/dist/types/index.d.ts +1 -1
  66. package/dist/types/labs/next/presets/default.d.ts +9 -5
  67. package/dist/types/plugins/expand/index.d.ts +6 -1
  68. package/dist/types/plugins/expand/nodeviews/index.d.ts +7 -3
  69. package/dist/types/plugins/expand/pm-plugins/keymap.d.ts +3 -1
  70. package/dist/types/plugins/expand/pm-plugins/main.d.ts +3 -2
  71. package/dist/types/plugins/panel/pm-plugins/main.d.ts +3 -3
  72. package/dist/types/plugins/selection/commands.d.ts +4 -2
  73. package/dist/types/plugins/selection/index.d.ts +5 -2
  74. package/dist/types/plugins/selection/utils.d.ts +2 -7
  75. package/dist/types/test-utils.d.ts +1 -1
  76. package/dist/types-ts4.5/index.d.ts +1 -1
  77. package/dist/types-ts4.5/labs/next/presets/default.d.ts +9 -5
  78. package/dist/types-ts4.5/plugins/expand/index.d.ts +3 -1
  79. package/dist/types-ts4.5/plugins/expand/nodeviews/index.d.ts +7 -3
  80. package/dist/types-ts4.5/plugins/expand/pm-plugins/keymap.d.ts +3 -1
  81. package/dist/types-ts4.5/plugins/expand/pm-plugins/main.d.ts +3 -2
  82. package/dist/types-ts4.5/plugins/panel/pm-plugins/main.d.ts +3 -3
  83. package/dist/types-ts4.5/plugins/selection/commands.d.ts +4 -2
  84. package/dist/types-ts4.5/plugins/selection/index.d.ts +5 -2
  85. package/dist/types-ts4.5/plugins/selection/utils.d.ts +2 -7
  86. package/dist/types-ts4.5/test-utils.d.ts +1 -1
  87. package/package.json +2 -2
  88. package/report.api.md +1 -3
  89. package/tmp/api-report-tmp.d.ts +1 -4
@@ -75,7 +75,7 @@ export type { Command, EditorPlugin, EditorProps, EditorInstance, CommandDispatc
75
75
  export { default as EditorActions } from './actions';
76
76
  export type { MacroProvider, MacroAttributes, ExtensionType, CardProvider, } from '@atlaskit/editor-common/provider-factory';
77
77
  export { PortalProvider, PortalProviderAPI, PortalRenderer, } from '@atlaskit/editor-common/portal-provider';
78
- export { GapCursorSelection, Side as GapCursorSide, } from './plugins/selection/gap-cursor-selection';
78
+ export { GapCursorSelection, Side as GapCursorSide, } from '@atlaskit/editor-common/selection';
79
79
  export type { HistoryPluginState } from './plugins/history/types';
80
80
  export type { MentionPluginState } from './plugins/mentions/types';
81
81
  export type { TOOLBAR_MENU_TYPE as InsertBlockInputMethodToolbar } from './plugins/insert-block/ui/ToolbarInsertBlock/types';
@@ -8,7 +8,7 @@ import type { PlaceholderPluginOptions } from '@atlaskit/editor-plugin-placehold
8
8
  import type { AnnotationProviders } from '../../../plugins/annotation';
9
9
  import type { TextFormattingOptions, HyperlinkPluginOptions, QuickInsertPluginOptions } from '@atlaskit/editor-common/types';
10
10
  import type { CodeBlockOptions } from '../../../plugins/code-block/types';
11
- import type { SelectionPluginOptions } from '../../../plugins/selection/types';
11
+ import type { SelectionPluginOptions } from '@atlaskit/editor-common/selection';
12
12
  import type { CardOptions } from '@atlaskit/editor-common/card';
13
13
  import type { TypeAheadPluginOptions } from '../../../plugins/type-ahead';
14
14
  import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
@@ -60,11 +60,13 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
60
60
  insertCodeBlock: (inputMethod: import("@atlaskit/editor-common/analytics").INPUT_METHOD) => import("@atlaskit/editor-common/types").Command;
61
61
  };
62
62
  }, CodeBlockOptions>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"selection", {
63
- pluginConfiguration: SelectionPluginOptions | undefined;
63
+ pluginConfiguration: import("../../../plugins/selection/types").SelectionPluginOptions | undefined;
64
64
  commands: {
65
65
  displayGapCursor: (toggle: boolean) => import("@atlaskit/editor-common/types").EditorCommand;
66
+ selectNearNode: import("@atlaskit/editor-common/types").EditorCommandWithMetadata;
66
67
  };
67
- }, SelectionPluginOptions | undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"floatingToolbar", {
68
+ sharedState: import("@atlaskit/editor-common/selection").SelectionSharedState;
69
+ }, import("../../../plugins/selection/types").SelectionPluginOptions | undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"floatingToolbar", {
68
70
  dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
69
71
  pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
70
72
  sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
@@ -268,11 +270,13 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
268
270
  insertCodeBlock: (inputMethod: import("@atlaskit/editor-common/analytics").INPUT_METHOD) => import("@atlaskit/editor-common/types").Command;
269
271
  };
270
272
  }, CodeBlockOptions>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"selection", {
271
- pluginConfiguration: SelectionPluginOptions | undefined;
273
+ pluginConfiguration: import("../../../plugins/selection/types").SelectionPluginOptions | undefined;
272
274
  commands: {
273
275
  displayGapCursor: (toggle: boolean) => import("@atlaskit/editor-common/types").EditorCommand;
276
+ selectNearNode: import("@atlaskit/editor-common/types").EditorCommandWithMetadata;
274
277
  };
275
- }, SelectionPluginOptions | undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"floatingToolbar", {
278
+ sharedState: import("@atlaskit/editor-common/selection").SelectionSharedState;
279
+ }, import("../../../plugins/selection/types").SelectionPluginOptions | undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"floatingToolbar", {
276
280
  dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
277
281
  pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
278
282
  sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
@@ -2,13 +2,18 @@ import type { NextEditorPlugin, EditorProps } from '../../types';
2
2
  import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
3
3
  import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
4
4
  import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
5
+ import type { SelectionPlugin } from '../selection';
5
6
  interface ExpandPluginOptions extends LongPressSelectionPluginOptions {
6
7
  allowInsertion?: boolean;
7
8
  appearance?: EditorProps['appearance'];
8
9
  }
9
10
  declare const expandPlugin: NextEditorPlugin<'expand', {
10
11
  pluginConfiguration: ExpandPluginOptions | undefined;
11
- dependencies: [FeatureFlagsPlugin, typeof decorationsPlugin];
12
+ dependencies: [
13
+ FeatureFlagsPlugin,
14
+ typeof decorationsPlugin,
15
+ SelectionPlugin
16
+ ];
12
17
  }>;
13
18
  interface ExpandEditorProps {
14
19
  allowExpand?: EditorProps['allowExpand'];
@@ -2,8 +2,10 @@ import type { IntlShape } from 'react-intl-next';
2
2
  import type { EditorView, NodeView, Decoration } from '@atlaskit/editor-prosemirror/view';
3
3
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { getPosHandlerNode, getPosHandler } from '../../../nodeviews/';
5
- import type { FeatureFlags } from '@atlaskit/editor-common/types';
5
+ import type { FeatureFlags, ExtractInjectionAPI, EditorCommandWithMetadata } from '@atlaskit/editor-common/types';
6
+ import type expandPlugin from '../index';
6
7
  export declare class ExpandNodeView implements NodeView {
8
+ private selectNearNode;
7
9
  node: PmNode;
8
10
  view: EditorView;
9
11
  dom: HTMLElement;
@@ -17,7 +19,8 @@ export declare class ExpandNodeView implements NodeView {
17
19
  allowInteractiveExpand: boolean;
18
20
  isMobile: boolean;
19
21
  featureFlags: FeatureFlags;
20
- constructor(node: PmNode, view: EditorView, getPos: getPosHandlerNode, getIntl: () => IntlShape, isMobile: boolean, featureFlags: FeatureFlags);
22
+ api: ExtractInjectionAPI<typeof expandPlugin> | undefined;
23
+ constructor(node: PmNode, view: EditorView, getPos: getPosHandlerNode, getIntl: () => IntlShape, isMobile: boolean, featureFlags: FeatureFlags, selectNearNode: EditorCommandWithMetadata | undefined, api: ExtractInjectionAPI<typeof expandPlugin> | undefined);
21
24
  private initHandlers;
22
25
  private focusTitle;
23
26
  private handleIconKeyDown;
@@ -43,8 +46,9 @@ export declare class ExpandNodeView implements NodeView {
43
46
  update(node: PmNode, _decorations: readonly Decoration[]): boolean;
44
47
  destroy(): void;
45
48
  }
46
- export default function ({ getIntl, isMobile, featureFlags, }: {
49
+ export default function ({ getIntl, isMobile, featureFlags, api, }: {
47
50
  getIntl: () => IntlShape;
48
51
  isMobile: boolean;
49
52
  featureFlags: FeatureFlags;
53
+ api: ExtractInjectionAPI<typeof expandPlugin> | undefined;
50
54
  }): (node: PmNode, view: EditorView, getPos: getPosHandler) => NodeView;
@@ -1,2 +1,4 @@
1
1
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- export declare function expandKeymap(): SafePlugin;
2
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import type expandPlugin from '../index';
4
+ export declare function expandKeymap(api: ExtractInjectionAPI<typeof expandPlugin> | undefined): SafePlugin;
@@ -2,6 +2,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import type { Dispatch } from '../../../event-dispatcher';
3
3
  import type { EditorProps } from '../../../types';
4
4
  import type { IntlShape } from 'react-intl-next';
5
- import type { FeatureFlags } from '@atlaskit/editor-common/types';
5
+ import type { FeatureFlags, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
+ import type expandPlugin from '../index';
6
7
  export declare function containsClass(element: Element | null, className: string): boolean;
7
- export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorProps['appearance'], useLongPressSelection: boolean | undefined, featureFlags: FeatureFlags) => SafePlugin<import("..").ExpandPluginState>;
8
+ export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorProps['appearance'], useLongPressSelection: boolean | undefined, featureFlags: FeatureFlags, api: ExtractInjectionAPI<typeof expandPlugin> | undefined) => SafePlugin<import("../types").ExpandPluginState>;
@@ -1,7 +1,7 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
3
- import { PanelPluginOptions } from '../types';
4
- import { Dispatch } from '../../../event-dispatcher';
2
+ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
3
+ import type { PanelPluginOptions } from '../types';
4
+ import type { Dispatch } from '../../../event-dispatcher';
5
5
  export type PanelOptions = {
6
6
  color?: string;
7
7
  emoji?: string;
@@ -1,8 +1,10 @@
1
1
  import { Selection } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
3
- import type { Command } from '@atlaskit/editor-common/types';
3
+ import type { Command } from '../../types';
4
4
  import { RelativeSelectionPos } from './types';
5
- export declare const setSelectionRelativeToNode: (selectionRelativeToNode?: RelativeSelectionPos, selection?: Selection | null) => Command;
5
+ import type { EditorCommandWithMetadata } from '@atlaskit/editor-common/types';
6
+ export declare const selectNearNode: EditorCommandWithMetadata;
7
+ export declare const setSelectionRelativeToNode: (selectionRelativeToNode?: RelativeSelectionPos, selection?: Selection | null) => import("@atlaskit/editor-common/types").Command;
6
8
  export declare const arrowRight: Command;
7
9
  export declare const arrowLeft: Command;
8
10
  export declare const setSelectionInsideAtNodeEnd: (selectionRelativeToNode: RelativeSelectionPos, node: PmNode, from: number, to: number) => Command;
@@ -1,10 +1,13 @@
1
- import type { EditorCommand, NextEditorPlugin } from '@atlaskit/editor-common/types';
1
+ import type { EditorCommand, NextEditorPlugin, EditorCommandWithMetadata } from '@atlaskit/editor-common/types';
2
+ import type { SelectionSharedState } from '@atlaskit/editor-common/selection';
2
3
  import type { SelectionPluginOptions } from './types';
3
- type SelectionPlugin = NextEditorPlugin<'selection', {
4
+ export type SelectionPlugin = NextEditorPlugin<'selection', {
4
5
  pluginConfiguration: SelectionPluginOptions | undefined;
5
6
  commands: {
6
7
  displayGapCursor: (toggle: boolean) => EditorCommand;
8
+ selectNearNode: EditorCommandWithMetadata;
7
9
  };
10
+ sharedState: SelectionSharedState;
8
11
  }>;
9
12
  export declare const selectionPlugin: SelectionPlugin;
10
13
  export default selectionPlugin;
@@ -1,14 +1,9 @@
1
1
  import type { Transaction, ReadonlyTransaction, EditorState } from '@atlaskit/editor-prosemirror/state';
2
2
  import { Selection } from '@atlaskit/editor-prosemirror/state';
3
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
3
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
5
4
  import type { Node as PmNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
6
5
  import type { ContentNodeWithPos, NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
7
- import { getNodeSelectionAnalyticsPayload, getAllSelectionAnalyticsPayload, getRangeSelectionAnalyticsPayload, getCellSelectionAnalyticsPayload } from '@atlaskit/editor-common/selection';
8
- export declare function createSelectionClickHandler(nodes: string[], isValidTarget: (target: HTMLElement) => boolean, options: {
9
- useLongPressSelection: boolean;
10
- getNodeSelectionPos?: (state: EditorState, nodePos: number) => number;
11
- }): (view: EditorView, pos: number, node: PmNode, nodePos: number, event: MouseEvent, direct: boolean) => boolean;
6
+ import { getNodeSelectionAnalyticsPayload, getAllSelectionAnalyticsPayload, getRangeSelectionAnalyticsPayload, getCellSelectionAnalyticsPayload, createSelectionClickHandler } from '@atlaskit/editor-common/selection';
12
7
  export declare const getDecorations: (tr: Transaction | ReadonlyTransaction) => DecorationSet;
13
8
  /**
14
9
  * Use `getNodesToDecorateFromSelection` to collect and return
@@ -60,4 +55,4 @@ export declare const findFirstChildNodeToSelect: (parent: PmNode) => NodeWithPos
60
55
  export declare const findLastChildNodeToSelect: (parent: PmNode) => NodeWithPos | undefined;
61
56
  export declare const isSelectionAtStartOfParentNode: ($pos: ResolvedPos, selection: Selection) => boolean;
62
57
  export declare const isSelectionAtEndOfParentNode: ($pos: ResolvedPos, selection: Selection) => boolean;
63
- export { getNodeSelectionAnalyticsPayload, getAllSelectionAnalyticsPayload, getRangeSelectionAnalyticsPayload, getCellSelectionAnalyticsPayload, };
58
+ export { getNodeSelectionAnalyticsPayload, getAllSelectionAnalyticsPayload, getRangeSelectionAnalyticsPayload, getCellSelectionAnalyticsPayload, createSelectionClickHandler, };
@@ -30,7 +30,7 @@ export declare const createPMSchemaAndPlugins: (inputPreset?: EditorPresetBuilde
30
30
  }) => PluginData;
31
31
  export { EventDispatcher } from './event-dispatcher';
32
32
  export type { Dispatch } from './event-dispatcher';
33
- export { GapCursorSelection, Side as GapCursorSide, } from './plugins/selection/gap-cursor/selection';
33
+ export { GapCursorSelection, Side as GapCursorSide, } from '@atlaskit/editor-common/selection';
34
34
  export declare function setTextSelection(view: EditorView, anchor: number, head?: number): void;
35
35
  /**
36
36
  * Given a selector, checks if an element matching the selector exists in the
@@ -75,7 +75,7 @@ export type { Command, EditorPlugin, EditorProps, EditorInstance, CommandDispatc
75
75
  export { default as EditorActions } from './actions';
76
76
  export type { MacroProvider, MacroAttributes, ExtensionType, CardProvider, } from '@atlaskit/editor-common/provider-factory';
77
77
  export { PortalProvider, PortalProviderAPI, PortalRenderer, } from '@atlaskit/editor-common/portal-provider';
78
- export { GapCursorSelection, Side as GapCursorSide, } from './plugins/selection/gap-cursor-selection';
78
+ export { GapCursorSelection, Side as GapCursorSide, } from '@atlaskit/editor-common/selection';
79
79
  export type { HistoryPluginState } from './plugins/history/types';
80
80
  export type { MentionPluginState } from './plugins/mentions/types';
81
81
  export type { TOOLBAR_MENU_TYPE as InsertBlockInputMethodToolbar } from './plugins/insert-block/ui/ToolbarInsertBlock/types';
@@ -8,7 +8,7 @@ import type { PlaceholderPluginOptions } from '@atlaskit/editor-plugin-placehold
8
8
  import type { AnnotationProviders } from '../../../plugins/annotation';
9
9
  import type { TextFormattingOptions, HyperlinkPluginOptions, QuickInsertPluginOptions } from '@atlaskit/editor-common/types';
10
10
  import type { CodeBlockOptions } from '../../../plugins/code-block/types';
11
- import type { SelectionPluginOptions } from '../../../plugins/selection/types';
11
+ import type { SelectionPluginOptions } from '@atlaskit/editor-common/selection';
12
12
  import type { CardOptions } from '@atlaskit/editor-common/card';
13
13
  import type { TypeAheadPluginOptions } from '../../../plugins/type-ahead';
14
14
  import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
@@ -84,11 +84,13 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
84
84
  };
85
85
  }, CodeBlockOptions>,
86
86
  import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"selection", {
87
- pluginConfiguration: SelectionPluginOptions | undefined;
87
+ pluginConfiguration: import("../../../plugins/selection/types").SelectionPluginOptions | undefined;
88
88
  commands: {
89
89
  displayGapCursor: (toggle: boolean) => import("@atlaskit/editor-common/types").EditorCommand;
90
+ selectNearNode: import("@atlaskit/editor-common/types").EditorCommandWithMetadata;
90
91
  };
91
- }, SelectionPluginOptions | undefined>,
92
+ sharedState: import("@atlaskit/editor-common/selection").SelectionSharedState;
93
+ }, import("../../../plugins/selection/types").SelectionPluginOptions | undefined>,
92
94
  import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"floatingToolbar", {
93
95
  dependencies: [
94
96
  import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
@@ -363,11 +365,13 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
363
365
  };
364
366
  }, CodeBlockOptions>,
365
367
  import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"selection", {
366
- pluginConfiguration: SelectionPluginOptions | undefined;
368
+ pluginConfiguration: import("../../../plugins/selection/types").SelectionPluginOptions | undefined;
367
369
  commands: {
368
370
  displayGapCursor: (toggle: boolean) => import("@atlaskit/editor-common/types").EditorCommand;
371
+ selectNearNode: import("@atlaskit/editor-common/types").EditorCommandWithMetadata;
369
372
  };
370
- }, SelectionPluginOptions | undefined>,
373
+ sharedState: import("@atlaskit/editor-common/selection").SelectionSharedState;
374
+ }, import("../../../plugins/selection/types").SelectionPluginOptions | undefined>,
371
375
  import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"floatingToolbar", {
372
376
  dependencies: [
373
377
  import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
@@ -2,6 +2,7 @@ import type { NextEditorPlugin, EditorProps } from '../../types';
2
2
  import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
3
3
  import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
4
4
  import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
5
+ import type { SelectionPlugin } from '../selection';
5
6
  interface ExpandPluginOptions extends LongPressSelectionPluginOptions {
6
7
  allowInsertion?: boolean;
7
8
  appearance?: EditorProps['appearance'];
@@ -10,7 +11,8 @@ declare const expandPlugin: NextEditorPlugin<'expand', {
10
11
  pluginConfiguration: ExpandPluginOptions | undefined;
11
12
  dependencies: [
12
13
  FeatureFlagsPlugin,
13
- typeof decorationsPlugin
14
+ typeof decorationsPlugin,
15
+ SelectionPlugin
14
16
  ];
15
17
  }>;
16
18
  interface ExpandEditorProps {
@@ -2,8 +2,10 @@ import type { IntlShape } from 'react-intl-next';
2
2
  import type { EditorView, NodeView, Decoration } from '@atlaskit/editor-prosemirror/view';
3
3
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
4
4
  import type { getPosHandlerNode, getPosHandler } from '../../../nodeviews/';
5
- import type { FeatureFlags } from '@atlaskit/editor-common/types';
5
+ import type { FeatureFlags, ExtractInjectionAPI, EditorCommandWithMetadata } from '@atlaskit/editor-common/types';
6
+ import type expandPlugin from '../index';
6
7
  export declare class ExpandNodeView implements NodeView {
8
+ private selectNearNode;
7
9
  node: PmNode;
8
10
  view: EditorView;
9
11
  dom: HTMLElement;
@@ -17,7 +19,8 @@ export declare class ExpandNodeView implements NodeView {
17
19
  allowInteractiveExpand: boolean;
18
20
  isMobile: boolean;
19
21
  featureFlags: FeatureFlags;
20
- constructor(node: PmNode, view: EditorView, getPos: getPosHandlerNode, getIntl: () => IntlShape, isMobile: boolean, featureFlags: FeatureFlags);
22
+ api: ExtractInjectionAPI<typeof expandPlugin> | undefined;
23
+ constructor(node: PmNode, view: EditorView, getPos: getPosHandlerNode, getIntl: () => IntlShape, isMobile: boolean, featureFlags: FeatureFlags, selectNearNode: EditorCommandWithMetadata | undefined, api: ExtractInjectionAPI<typeof expandPlugin> | undefined);
21
24
  private initHandlers;
22
25
  private focusTitle;
23
26
  private handleIconKeyDown;
@@ -43,8 +46,9 @@ export declare class ExpandNodeView implements NodeView {
43
46
  update(node: PmNode, _decorations: readonly Decoration[]): boolean;
44
47
  destroy(): void;
45
48
  }
46
- export default function ({ getIntl, isMobile, featureFlags, }: {
49
+ export default function ({ getIntl, isMobile, featureFlags, api, }: {
47
50
  getIntl: () => IntlShape;
48
51
  isMobile: boolean;
49
52
  featureFlags: FeatureFlags;
53
+ api: ExtractInjectionAPI<typeof expandPlugin> | undefined;
50
54
  }): (node: PmNode, view: EditorView, getPos: getPosHandler) => NodeView;
@@ -1,2 +1,4 @@
1
1
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- export declare function expandKeymap(): SafePlugin;
2
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import type expandPlugin from '../index';
4
+ export declare function expandKeymap(api: ExtractInjectionAPI<typeof expandPlugin> | undefined): SafePlugin;
@@ -2,6 +2,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import type { Dispatch } from '../../../event-dispatcher';
3
3
  import type { EditorProps } from '../../../types';
4
4
  import type { IntlShape } from 'react-intl-next';
5
- import type { FeatureFlags } from '@atlaskit/editor-common/types';
5
+ import type { FeatureFlags, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
+ import type expandPlugin from '../index';
6
7
  export declare function containsClass(element: Element | null, className: string): boolean;
7
- export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorProps['appearance'], useLongPressSelection: boolean | undefined, featureFlags: FeatureFlags) => SafePlugin<import("..").ExpandPluginState>;
8
+ export declare const createPlugin: (dispatch: Dispatch, getIntl: () => IntlShape, appearance: EditorProps['appearance'], useLongPressSelection: boolean | undefined, featureFlags: FeatureFlags, api: ExtractInjectionAPI<typeof expandPlugin> | undefined) => SafePlugin<import("../types").ExpandPluginState>;
@@ -1,7 +1,7 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
3
- import { PanelPluginOptions } from '../types';
4
- import { Dispatch } from '../../../event-dispatcher';
2
+ import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
3
+ import type { PanelPluginOptions } from '../types';
4
+ import type { Dispatch } from '../../../event-dispatcher';
5
5
  export type PanelOptions = {
6
6
  color?: string;
7
7
  emoji?: string;
@@ -1,8 +1,10 @@
1
1
  import { Selection } from '@atlaskit/editor-prosemirror/state';
2
2
  import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
3
- import type { Command } from '@atlaskit/editor-common/types';
3
+ import type { Command } from '../../types';
4
4
  import { RelativeSelectionPos } from './types';
5
- export declare const setSelectionRelativeToNode: (selectionRelativeToNode?: RelativeSelectionPos, selection?: Selection | null) => Command;
5
+ import type { EditorCommandWithMetadata } from '@atlaskit/editor-common/types';
6
+ export declare const selectNearNode: EditorCommandWithMetadata;
7
+ export declare const setSelectionRelativeToNode: (selectionRelativeToNode?: RelativeSelectionPos, selection?: Selection | null) => import("@atlaskit/editor-common/types").Command;
6
8
  export declare const arrowRight: Command;
7
9
  export declare const arrowLeft: Command;
8
10
  export declare const setSelectionInsideAtNodeEnd: (selectionRelativeToNode: RelativeSelectionPos, node: PmNode, from: number, to: number) => Command;
@@ -1,10 +1,13 @@
1
- import type { EditorCommand, NextEditorPlugin } from '@atlaskit/editor-common/types';
1
+ import type { EditorCommand, NextEditorPlugin, EditorCommandWithMetadata } from '@atlaskit/editor-common/types';
2
+ import type { SelectionSharedState } from '@atlaskit/editor-common/selection';
2
3
  import type { SelectionPluginOptions } from './types';
3
- type SelectionPlugin = NextEditorPlugin<'selection', {
4
+ export type SelectionPlugin = NextEditorPlugin<'selection', {
4
5
  pluginConfiguration: SelectionPluginOptions | undefined;
5
6
  commands: {
6
7
  displayGapCursor: (toggle: boolean) => EditorCommand;
8
+ selectNearNode: EditorCommandWithMetadata;
7
9
  };
10
+ sharedState: SelectionSharedState;
8
11
  }>;
9
12
  export declare const selectionPlugin: SelectionPlugin;
10
13
  export default selectionPlugin;
@@ -1,14 +1,9 @@
1
1
  import type { Transaction, ReadonlyTransaction, EditorState } from '@atlaskit/editor-prosemirror/state';
2
2
  import { Selection } from '@atlaskit/editor-prosemirror/state';
3
- import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
3
  import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
5
4
  import type { Node as PmNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
6
5
  import type { ContentNodeWithPos, NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
7
- import { getNodeSelectionAnalyticsPayload, getAllSelectionAnalyticsPayload, getRangeSelectionAnalyticsPayload, getCellSelectionAnalyticsPayload } from '@atlaskit/editor-common/selection';
8
- export declare function createSelectionClickHandler(nodes: string[], isValidTarget: (target: HTMLElement) => boolean, options: {
9
- useLongPressSelection: boolean;
10
- getNodeSelectionPos?: (state: EditorState, nodePos: number) => number;
11
- }): (view: EditorView, pos: number, node: PmNode, nodePos: number, event: MouseEvent, direct: boolean) => boolean;
6
+ import { getNodeSelectionAnalyticsPayload, getAllSelectionAnalyticsPayload, getRangeSelectionAnalyticsPayload, getCellSelectionAnalyticsPayload, createSelectionClickHandler } from '@atlaskit/editor-common/selection';
12
7
  export declare const getDecorations: (tr: Transaction | ReadonlyTransaction) => DecorationSet;
13
8
  /**
14
9
  * Use `getNodesToDecorateFromSelection` to collect and return
@@ -60,4 +55,4 @@ export declare const findFirstChildNodeToSelect: (parent: PmNode) => NodeWithPos
60
55
  export declare const findLastChildNodeToSelect: (parent: PmNode) => NodeWithPos | undefined;
61
56
  export declare const isSelectionAtStartOfParentNode: ($pos: ResolvedPos, selection: Selection) => boolean;
62
57
  export declare const isSelectionAtEndOfParentNode: ($pos: ResolvedPos, selection: Selection) => boolean;
63
- export { getNodeSelectionAnalyticsPayload, getAllSelectionAnalyticsPayload, getRangeSelectionAnalyticsPayload, getCellSelectionAnalyticsPayload, };
58
+ export { getNodeSelectionAnalyticsPayload, getAllSelectionAnalyticsPayload, getRangeSelectionAnalyticsPayload, getCellSelectionAnalyticsPayload, createSelectionClickHandler, };
@@ -30,7 +30,7 @@ export declare const createPMSchemaAndPlugins: (inputPreset?: EditorPresetBuilde
30
30
  }) => PluginData;
31
31
  export { EventDispatcher } from './event-dispatcher';
32
32
  export type { Dispatch } from './event-dispatcher';
33
- export { GapCursorSelection, Side as GapCursorSide, } from './plugins/selection/gap-cursor/selection';
33
+ export { GapCursorSelection, Side as GapCursorSide, } from '@atlaskit/editor-common/selection';
34
34
  export declare function setTextSelection(view: EditorView, anchor: number, head?: number): void;
35
35
  /**
36
36
  * Given a selector, checks if an element matching the selector exists in the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.46.1",
3
+ "version": "187.47.0",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -55,7 +55,7 @@
55
55
  "@atlaskit/code": "^14.6.0",
56
56
  "@atlaskit/date": "^0.10.0",
57
57
  "@atlaskit/datetime-picker": "^12.10.0",
58
- "@atlaskit/editor-common": "^75.6.0",
58
+ "@atlaskit/editor-common": "^75.7.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",
package/report.api.md CHANGED
@@ -144,6 +144,7 @@ import type { ResolvedEditorState } from '@atlaskit/editor-common/collab';
144
144
  import type { RichMediaLayout } from '@atlaskit/adf-schema';
145
145
  import type { Schema } from '@atlaskit/editor-prosemirror/model';
146
146
  import type { SearchProvider } from '@atlaskit/editor-common/provider-factory';
147
+ import type { SelectionPluginOptions } from '@atlaskit/editor-common/selection';
147
148
  import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
148
149
  import { setTextSelection } from '@atlaskit/editor-common/utils';
149
150
  import type { SEVERITY } from '@atlaskit/editor-common/utils';
@@ -1850,9 +1851,6 @@ export interface SelectionDataState {
1850
1851
  // @public (undocumented)
1851
1852
  export const selectionPluginKey: PluginKey<any>;
1852
1853
 
1853
- // @public (undocumented)
1854
- interface SelectionPluginOptions extends LongPressSelectionPluginOptions {}
1855
-
1856
1854
  // @public (undocumented)
1857
1855
  type SetEditorAPI = (editorApi: PublicPluginAPI<any>) => void;
1858
1856
 
@@ -133,6 +133,7 @@ import type { ResolvedEditorState } from '@atlaskit/editor-common/collab';
133
133
  import type { RichMediaLayout } from '@atlaskit/adf-schema';
134
134
  import type { Schema } from '@atlaskit/editor-prosemirror/model';
135
135
  import type { SearchProvider } from '@atlaskit/editor-common/provider-factory';
136
+ import type { SelectionPluginOptions } from '@atlaskit/editor-common/selection';
136
137
  import { SelectItemMode } from '@atlaskit/editor-common/type-ahead';
137
138
  import { setTextSelection } from '@atlaskit/editor-common/utils';
138
139
  import type { SEVERITY } from '@atlaskit/editor-common/utils';
@@ -1661,10 +1662,6 @@ export interface SelectionDataState {
1661
1662
  // @public (undocumented)
1662
1663
  export const selectionPluginKey: PluginKey<any>;
1663
1664
 
1664
- // @public (undocumented)
1665
- interface SelectionPluginOptions extends LongPressSelectionPluginOptions {
1666
- }
1667
-
1668
1665
  // @public (undocumented)
1669
1666
  type SetEditorAPI = (editorApi: PublicPluginAPI<any>) => void;
1670
1667