@atlaskit/editor-core 188.11.4 → 188.12.1

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 (116) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cjs/labs/next/presets/universal.js +15 -3
  3. package/dist/cjs/plugins/annotation/index.js +12 -1
  4. package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +2 -1
  5. package/dist/cjs/plugins/annotation/pm-plugins/plugin-factory.js +5 -0
  6. package/dist/cjs/plugins/annotation/pm-plugins/reducer.js +2 -1
  7. package/dist/cjs/plugins/annotation/toolbar.js +2 -156
  8. package/dist/cjs/plugins/index.js +0 -7
  9. package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +33 -31
  10. package/dist/cjs/plugins/layout/actions.js +20 -17
  11. package/dist/cjs/plugins/layout/index.js +6 -2
  12. package/dist/cjs/plugins/panel/index.js +1 -1
  13. package/dist/cjs/plugins/panel/toolbar.js +9 -7
  14. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +0 -6
  15. package/dist/cjs/plugins/rank.js +1 -1
  16. package/dist/cjs/plugins/tasks-and-decisions/index.js +1 -1
  17. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/keymaps.js +104 -90
  18. package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -2
  19. package/dist/cjs/plugins/undo-redo/index.js +7 -16
  20. package/dist/cjs/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +59 -75
  21. package/dist/cjs/version-wrapper.js +1 -1
  22. package/dist/es2019/labs/next/presets/universal.js +14 -2
  23. package/dist/es2019/plugins/annotation/index.js +14 -1
  24. package/dist/es2019/plugins/annotation/pm-plugins/inline-comment.js +2 -1
  25. package/dist/es2019/plugins/annotation/pm-plugins/plugin-factory.js +6 -0
  26. package/dist/es2019/plugins/annotation/pm-plugins/reducer.js +2 -1
  27. package/dist/es2019/plugins/annotation/toolbar.js +1 -156
  28. package/dist/es2019/plugins/index.js +0 -1
  29. package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +4 -3
  30. package/dist/es2019/plugins/layout/actions.js +4 -3
  31. package/dist/es2019/plugins/layout/index.js +63 -57
  32. package/dist/es2019/plugins/panel/index.js +1 -1
  33. package/dist/es2019/plugins/panel/toolbar.js +9 -7
  34. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +1 -4
  35. package/dist/es2019/plugins/rank.js +1 -1
  36. package/dist/es2019/plugins/tasks-and-decisions/index.js +1 -1
  37. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/keymaps.js +22 -14
  38. package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -2
  39. package/dist/es2019/plugins/undo-redo/index.js +6 -17
  40. package/dist/es2019/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +60 -61
  41. package/dist/es2019/version-wrapper.js +1 -1
  42. package/dist/esm/labs/next/presets/universal.js +14 -2
  43. package/dist/esm/plugins/annotation/index.js +12 -1
  44. package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +2 -1
  45. package/dist/esm/plugins/annotation/pm-plugins/plugin-factory.js +5 -0
  46. package/dist/esm/plugins/annotation/pm-plugins/reducer.js +2 -1
  47. package/dist/esm/plugins/annotation/toolbar.js +1 -156
  48. package/dist/esm/plugins/index.js +0 -1
  49. package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +33 -31
  50. package/dist/esm/plugins/layout/actions.js +15 -12
  51. package/dist/esm/plugins/layout/index.js +7 -3
  52. package/dist/esm/plugins/panel/index.js +1 -1
  53. package/dist/esm/plugins/panel/toolbar.js +9 -7
  54. package/dist/esm/plugins/paste/pm-plugins/analytics.js +1 -6
  55. package/dist/esm/plugins/rank.js +1 -1
  56. package/dist/esm/plugins/tasks-and-decisions/index.js +1 -1
  57. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/keymaps.js +104 -90
  58. package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +4 -2
  59. package/dist/esm/plugins/undo-redo/index.js +6 -16
  60. package/dist/esm/plugins/undo-redo/ui/ToolbarUndoRedo/index.js +56 -74
  61. package/dist/esm/version-wrapper.js +1 -1
  62. package/dist/types/plugins/annotation/pm-plugins/types.d.ts +1 -0
  63. package/dist/types/plugins/index.d.ts +0 -1
  64. package/dist/types/plugins/insert-block/types.d.ts +3 -1
  65. package/dist/types/plugins/layout/actions.d.ts +2 -1
  66. package/dist/types/plugins/layout/index.d.ts +4 -0
  67. package/dist/types/plugins/panel/index.d.ts +2 -2
  68. package/dist/types/plugins/panel/toolbar.d.ts +5 -3
  69. package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +0 -1
  70. package/dist/types/plugins/tasks-and-decisions/pm-plugins/keymaps.d.ts +7 -4
  71. package/dist/types/plugins/tasks-and-decisions/types.d.ts +5 -1
  72. package/dist/types/plugins/undo-redo/types.d.ts +2 -1
  73. package/dist/types/plugins/undo-redo/ui/ToolbarUndoRedo/index.d.ts +2 -6
  74. package/dist/types-ts4.5/plugins/annotation/pm-plugins/types.d.ts +1 -0
  75. package/dist/types-ts4.5/plugins/index.d.ts +0 -1
  76. package/dist/types-ts4.5/plugins/insert-block/types.d.ts +3 -1
  77. package/dist/types-ts4.5/plugins/layout/actions.d.ts +2 -1
  78. package/dist/types-ts4.5/plugins/layout/index.d.ts +4 -0
  79. package/dist/types-ts4.5/plugins/panel/index.d.ts +2 -2
  80. package/dist/types-ts4.5/plugins/panel/toolbar.d.ts +5 -3
  81. package/dist/types-ts4.5/plugins/paste/pm-plugins/analytics.d.ts +0 -1
  82. package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/keymaps.d.ts +7 -4
  83. package/dist/types-ts4.5/plugins/tasks-and-decisions/types.d.ts +3 -1
  84. package/dist/types-ts4.5/plugins/undo-redo/types.d.ts +3 -1
  85. package/dist/types-ts4.5/plugins/undo-redo/ui/ToolbarUndoRedo/index.d.ts +2 -6
  86. package/package.json +8 -3
  87. package/dist/cjs/plugins/history/actions.js +0 -10
  88. package/dist/cjs/plugins/history/index.js +0 -75
  89. package/dist/cjs/plugins/history/pm-history-types.js +0 -5
  90. package/dist/cjs/plugins/history/reducer.js +0 -18
  91. package/dist/cjs/plugins/history/types.js +0 -5
  92. package/dist/cjs/plugins/history/utils.js +0 -19
  93. package/dist/es2019/plugins/history/actions.js +0 -4
  94. package/dist/es2019/plugins/history/index.js +0 -61
  95. package/dist/es2019/plugins/history/pm-history-types.js +0 -1
  96. package/dist/es2019/plugins/history/reducer.js +0 -12
  97. package/dist/es2019/plugins/history/types.js +0 -1
  98. package/dist/es2019/plugins/history/utils.js +0 -11
  99. package/dist/esm/plugins/history/actions.js +0 -4
  100. package/dist/esm/plugins/history/index.js +0 -68
  101. package/dist/esm/plugins/history/pm-history-types.js +0 -1
  102. package/dist/esm/plugins/history/reducer.js +0 -12
  103. package/dist/esm/plugins/history/types.js +0 -1
  104. package/dist/esm/plugins/history/utils.js +0 -13
  105. package/dist/types/plugins/history/actions.d.ts +0 -8
  106. package/dist/types/plugins/history/index.d.ts +0 -13
  107. package/dist/types/plugins/history/pm-history-types.d.ts +0 -17
  108. package/dist/types/plugins/history/reducer.d.ts +0 -4
  109. package/dist/types/plugins/history/types.d.ts +0 -4
  110. package/dist/types/plugins/history/utils.d.ts +0 -4
  111. package/dist/types-ts4.5/plugins/history/actions.d.ts +0 -8
  112. package/dist/types-ts4.5/plugins/history/index.d.ts +0 -13
  113. package/dist/types-ts4.5/plugins/history/pm-history-types.d.ts +0 -17
  114. package/dist/types-ts4.5/plugins/history/reducer.d.ts +0 -4
  115. package/dist/types-ts4.5/plugins/history/types.d.ts +0 -4
  116. package/dist/types-ts4.5/plugins/history/utils.d.ts +0 -4
@@ -1,6 +1,7 @@
1
1
  import type { Node } from '@atlaskit/editor-prosemirror/model';
2
2
  import type { Command } from '../../types/command';
3
3
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
4
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
5
  import type { Change, PresetLayout } from './types';
5
6
  import type { TOOLBAR_MENU_TYPE } from '@atlaskit/editor-common/types';
6
7
  export declare const ONE_COL_LAYOUTS: PresetLayout[];
@@ -14,7 +15,7 @@ export declare const getPresetLayout: (section: Node) => PresetLayout | undefine
14
15
  export declare const getSelectedLayout: (maybeLayoutSection: Node | undefined, current: PresetLayout) => PresetLayout;
15
16
  export declare const createDefaultLayoutSection: (state: EditorState) => Node;
16
17
  export declare const insertLayoutColumns: Command;
17
- export declare const insertLayoutColumnsWithAnalytics: (inputMethod: TOOLBAR_MENU_TYPE) => Command;
18
+ export declare const insertLayoutColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: TOOLBAR_MENU_TYPE) => Command;
18
19
  export declare function forceSectionToPresetLayout(state: EditorState, node: Node, pos: number, presetLayout: PresetLayout): Transaction;
19
20
  export declare const setPresetLayout: (layout: PresetLayout) => Command;
20
21
  export declare const fixColumnSizes: (changedTr: Transaction, state: EditorState) => Change | undefined;
@@ -1,4 +1,5 @@
1
1
  import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
+ import { insertLayoutColumnsWithAnalytics } from './actions';
2
3
  import { pluginKey } from './pm-plugins/plugin-key';
3
4
  import type { LayoutPluginOptions } from './types';
4
5
  import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
@@ -7,6 +8,9 @@ export { pluginKey };
7
8
  export type LayoutPlugin = NextEditorPlugin<'layout', {
8
9
  pluginConfiguration: LayoutPluginOptions | undefined;
9
10
  dependencies: [DecorationsPlugin, OptionalPlugin<AnalyticsPlugin>];
11
+ actions: {
12
+ insertLayoutColumns: ReturnType<typeof insertLayoutColumnsWithAnalytics>;
13
+ };
10
14
  }>;
11
15
  declare const layoutPlugin: LayoutPlugin;
12
16
  export default layoutPlugin;
@@ -3,7 +3,7 @@ import { INPUT_METHOD } from '../analytics';
3
3
  import type { PanelPluginOptions } from './types';
4
4
  import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
5
5
  import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
6
- declare const panelPlugin: NextEditorPlugin<'panel', {
6
+ export type PanelPlugin = NextEditorPlugin<'panel', {
7
7
  pluginConfiguration: PanelPluginOptions | undefined;
8
8
  dependencies: [
9
9
  typeof decorationsPlugin,
@@ -13,5 +13,5 @@ declare const panelPlugin: NextEditorPlugin<'panel', {
13
13
  insertPanel: (inputMethod: INPUT_METHOD) => Command;
14
14
  };
15
15
  }>;
16
+ declare const panelPlugin: PanelPlugin;
16
17
  export default panelPlugin;
17
- export type PanelPlugin = typeof panelPlugin;
@@ -1,4 +1,4 @@
1
- import type { FloatingToolbarConfig, FloatingToolbarItem } from '@atlaskit/editor-common/types';
1
+ import type { FloatingToolbarConfig, FloatingToolbarItem, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
2
  import type { EmojiInfo, PanelPluginOptions } from './types';
3
3
  import type { IntlShape } from 'react-intl-next';
4
4
  import type { HoverDecorationHandler } from '@atlaskit/editor-plugin-decorations';
@@ -7,8 +7,10 @@ import type { NodeType } from '@atlaskit/editor-prosemirror/model';
7
7
  import type { Command } from '../../types';
8
8
  import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
9
9
  import { PanelType } from '@atlaskit/adf-schema';
10
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
11
+ import type { PanelPlugin } from './index';
10
12
  export declare const panelIconMap: {
11
13
  [key in Exclude<PanelType, PanelType.CUSTOM>]: EmojiInfo;
12
14
  };
13
- export declare const getToolbarItems: (formatMessage: IntlShape['formatMessage'], panelNodeType: NodeType, isCustomPanelEnabled: boolean, isCustomPanelEditable: boolean, providerFactory: ProviderFactory, hoverDecoration: HoverDecorationHandler | undefined, activePanelType?: string, activePanelColor?: string, activePanelIcon?: string, state?: EditorState) => FloatingToolbarItem<Command>[];
14
- export declare const getToolbarConfig: (state: EditorState, intl: IntlShape, options: PanelPluginOptions | undefined, providerFactory: ProviderFactory, hoverDecoration: HoverDecorationHandler | undefined) => FloatingToolbarConfig | undefined;
15
+ export declare const getToolbarItems: (formatMessage: IntlShape['formatMessage'], panelNodeType: NodeType, isCustomPanelEnabled: boolean, isCustomPanelEditable: boolean, providerFactory: ProviderFactory, hoverDecoration: HoverDecorationHandler | undefined, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, activePanelType?: string, activePanelColor?: string, activePanelIcon?: string, state?: EditorState) => FloatingToolbarItem<Command>[];
16
+ export declare const getToolbarConfig: (state: EditorState, intl: IntlShape, options: PanelPluginOptions | undefined, providerFactory: ProviderFactory, api: ExtractInjectionAPI<PanelPlugin> | undefined) => FloatingToolbarConfig | undefined;
@@ -21,7 +21,6 @@ export declare function getContent({ schema, slice }: GetContentProps): PasteCon
21
21
  export declare function getMediaTraceId(slice: Slice): undefined;
22
22
  export declare function createPasteAnalyticsPayload(view: EditorView, event: ClipboardEvent, slice: Slice, pasteContext: PasteContext): AnalyticsEventPayload;
23
23
  export declare function sendPasteAnalyticsEvent(view: EditorView, event: ClipboardEvent, slice: Slice, pasteContext: PasteContext): void;
24
- export declare function pasteCommandWithAnalytics(view: EditorView, event: ClipboardEvent, slice: Slice, pasteContext: PasteContext): import("../../analytics").HigherOrderCommand;
25
24
  export declare const handlePasteAsPlainTextWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
26
25
  export declare const handlePasteIntoTaskAndDecisionWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
27
26
  export declare const handlePasteIntoCaptionWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType) => Command;
@@ -1,8 +1,11 @@
1
1
  import type { Schema } from '@atlaskit/editor-prosemirror/model';
2
2
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- import { INPUT_METHOD } from '../../analytics';
3
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
5
+ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
6
+ import type { TaskAndDecisionsPlugin } from '../types';
4
7
  type IndentationInputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
5
- export declare const getUnindentCommand: (inputMethod?: IndentationInputMethod) => import("@atlaskit/editor-common/types").Command;
6
- export declare const getIndentCommand: (inputMethod?: IndentationInputMethod) => import("@atlaskit/editor-common/types").Command;
7
- export declare function keymapPlugin(schema: Schema, allowNestedTasks?: boolean, consumeTabs?: boolean): SafePlugin | undefined;
8
+ export declare const getUnindentCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod?: IndentationInputMethod) => import("@atlaskit/editor-common/types").Command;
9
+ export declare const getIndentCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod?: IndentationInputMethod) => import("@atlaskit/editor-common/types").Command;
10
+ export declare function keymapPlugin(schema: Schema, api: ExtractInjectionAPI<TaskAndDecisionsPlugin> | undefined, allowNestedTasks?: boolean, consumeTabs?: boolean): SafePlugin | undefined;
8
11
  export default keymapPlugin;
@@ -4,6 +4,7 @@ import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/stat
4
4
  import type { INPUT_METHOD, USER_CONTEXT } from '@atlaskit/editor-common/analytics';
5
5
  import type { NextEditorPlugin, OptionalPlugin, LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
6
6
  import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
7
+ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
7
8
  export type TaskDecisionListType = 'taskList' | 'decisionList';
8
9
  export type TaskDecisionInputMethod = INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.FORMATTING | INPUT_METHOD.KEYBOARD;
9
10
  export type ContextData = {
@@ -27,5 +28,8 @@ export interface TaskDecisionPluginOptions extends LongPressSelectionPluginOptio
27
28
  }
28
29
  export type TaskAndDecisionsPlugin = NextEditorPlugin<'taskDecision', {
29
30
  pluginConfiguration: TaskDecisionPluginOptions | undefined;
30
- dependencies: [OptionalPlugin<TypeAheadPlugin>];
31
+ dependencies: [
32
+ OptionalPlugin<TypeAheadPlugin>,
33
+ OptionalPlugin<AnalyticsPlugin>
34
+ ];
31
35
  }>;
@@ -1,5 +1,6 @@
1
1
  import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
2
  import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
3
+ import type { HistoryPlugin } from '@atlaskit/editor-plugin-history';
3
4
  export type UndoRedoPlugin = NextEditorPlugin<'undoRedoPlugin', {
4
- dependencies: [TypeAheadPlugin];
5
+ dependencies: [TypeAheadPlugin, HistoryPlugin];
5
6
  }>;
@@ -1,9 +1,8 @@
1
+ /// <reference types="react" />
1
2
  /** @jsx jsx */
2
- import { PureComponent } from 'react';
3
3
  import { jsx } from '@emotion/react';
4
4
  import type { WrappedComponentProps } from 'react-intl-next';
5
5
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
- import type { HistoryPluginState } from '../../../history/types';
7
6
  import type { UndoRedoPlugin } from '../../types';
8
7
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
9
8
  export interface Props {
@@ -11,13 +10,10 @@ export interface Props {
11
10
  redoDisabled?: boolean;
12
11
  disabled?: boolean;
13
12
  isReducedSpacing?: boolean;
14
- historyState: HistoryPluginState;
15
13
  editorView: EditorView;
16
14
  api: ExtractInjectionAPI<UndoRedoPlugin> | undefined;
17
15
  }
18
- export declare class ToolbarUndoRedo extends PureComponent<Props & WrappedComponentProps> {
19
- render(): jsx.JSX.Element;
20
- }
16
+ export declare const ToolbarUndoRedo: ({ disabled, isReducedSpacing, editorView, api, intl: { formatMessage }, }: Props & WrappedComponentProps) => jsx.JSX.Element;
21
17
  declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
22
18
  WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps<"intl">>;
23
19
  };
@@ -71,4 +71,5 @@ export type InlineCommentPluginState = {
71
71
  bookmark?: SelectionBookmark;
72
72
  disallowOnWhitespace: boolean;
73
73
  isVisible: boolean;
74
+ skipSelectionHandling: boolean;
74
75
  };
@@ -24,7 +24,6 @@ export { default as annotationPlugin } from './annotation';
24
24
  export { default as analyticsPlugin } from './analytics';
25
25
  export { default as customAutoformatPlugin } from './custom-autoformat';
26
26
  export { default as feedbackDialogPlugin } from './feedback-dialog';
27
- export { default as historyPlugin } from './history';
28
27
  export { default as expandPlugin, isExpandInsertionEnabled } from './expand';
29
28
  export { default as mobileDimensionsPlugin } from './mobile-dimensions';
30
29
  export { default as findReplacePlugin } from './find-replace';
@@ -10,6 +10,7 @@ import type { QuickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
10
10
  import type { BlockTypePlugin } from '@atlaskit/editor-plugin-block-type';
11
11
  import type codeBlockPlugin from '../code-block';
12
12
  import type panelPlugin from '../panel';
13
+ import type { LayoutPlugin } from '../layout';
13
14
  import type { RulePlugin } from '@atlaskit/editor-plugin-rule';
14
15
  import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
15
16
  import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
@@ -31,5 +32,6 @@ export type InsertBlockPluginDependencies = [
31
32
  OptionalPlugin<typeof panelPlugin>,
32
33
  OptionalPlugin<MediaPlugin>,
33
34
  OptionalPlugin<MentionsPlugin>,
34
- OptionalPlugin<StatusPlugin>
35
+ OptionalPlugin<StatusPlugin>,
36
+ OptionalPlugin<LayoutPlugin>
35
37
  ];
@@ -1,6 +1,7 @@
1
1
  import type { Node } from '@atlaskit/editor-prosemirror/model';
2
2
  import type { Command } from '../../types/command';
3
3
  import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
4
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
5
  import type { Change, PresetLayout } from './types';
5
6
  import type { TOOLBAR_MENU_TYPE } from '@atlaskit/editor-common/types';
6
7
  export declare const ONE_COL_LAYOUTS: PresetLayout[];
@@ -14,7 +15,7 @@ export declare const getPresetLayout: (section: Node) => PresetLayout | undefine
14
15
  export declare const getSelectedLayout: (maybeLayoutSection: Node | undefined, current: PresetLayout) => PresetLayout;
15
16
  export declare const createDefaultLayoutSection: (state: EditorState) => Node;
16
17
  export declare const insertLayoutColumns: Command;
17
- export declare const insertLayoutColumnsWithAnalytics: (inputMethod: TOOLBAR_MENU_TYPE) => Command;
18
+ export declare const insertLayoutColumnsWithAnalytics: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod: TOOLBAR_MENU_TYPE) => Command;
18
19
  export declare function forceSectionToPresetLayout(state: EditorState, node: Node, pos: number, presetLayout: PresetLayout): Transaction;
19
20
  export declare const setPresetLayout: (layout: PresetLayout) => Command;
20
21
  export declare const fixColumnSizes: (changedTr: Transaction, state: EditorState) => Change | undefined;
@@ -1,4 +1,5 @@
1
1
  import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
+ import { insertLayoutColumnsWithAnalytics } from './actions';
2
3
  import { pluginKey } from './pm-plugins/plugin-key';
3
4
  import type { LayoutPluginOptions } from './types';
4
5
  import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
@@ -10,6 +11,9 @@ export type LayoutPlugin = NextEditorPlugin<'layout', {
10
11
  DecorationsPlugin,
11
12
  OptionalPlugin<AnalyticsPlugin>
12
13
  ];
14
+ actions: {
15
+ insertLayoutColumns: ReturnType<typeof insertLayoutColumnsWithAnalytics>;
16
+ };
13
17
  }>;
14
18
  declare const layoutPlugin: LayoutPlugin;
15
19
  export default layoutPlugin;
@@ -3,7 +3,7 @@ import { INPUT_METHOD } from '../analytics';
3
3
  import type { PanelPluginOptions } from './types';
4
4
  import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
5
5
  import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
6
- declare const panelPlugin: NextEditorPlugin<'panel', {
6
+ export type PanelPlugin = NextEditorPlugin<'panel', {
7
7
  pluginConfiguration: PanelPluginOptions | undefined;
8
8
  dependencies: [
9
9
  typeof decorationsPlugin,
@@ -13,5 +13,5 @@ declare const panelPlugin: NextEditorPlugin<'panel', {
13
13
  insertPanel: (inputMethod: INPUT_METHOD) => Command;
14
14
  };
15
15
  }>;
16
+ declare const panelPlugin: PanelPlugin;
16
17
  export default panelPlugin;
17
- export type PanelPlugin = typeof panelPlugin;
@@ -1,4 +1,4 @@
1
- import type { FloatingToolbarConfig, FloatingToolbarItem } from '@atlaskit/editor-common/types';
1
+ import type { FloatingToolbarConfig, FloatingToolbarItem, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
2
2
  import type { EmojiInfo, PanelPluginOptions } from './types';
3
3
  import type { IntlShape } from 'react-intl-next';
4
4
  import type { HoverDecorationHandler } from '@atlaskit/editor-plugin-decorations';
@@ -7,8 +7,10 @@ import type { NodeType } from '@atlaskit/editor-prosemirror/model';
7
7
  import type { Command } from '../../types';
8
8
  import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
9
9
  import { PanelType } from '@atlaskit/adf-schema';
10
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
11
+ import type { PanelPlugin } from './index';
10
12
  export declare const panelIconMap: {
11
13
  [key in Exclude<PanelType, PanelType.CUSTOM>]: EmojiInfo;
12
14
  };
13
- export declare const getToolbarItems: (formatMessage: IntlShape['formatMessage'], panelNodeType: NodeType, isCustomPanelEnabled: boolean, isCustomPanelEditable: boolean, providerFactory: ProviderFactory, hoverDecoration: HoverDecorationHandler | undefined, activePanelType?: string, activePanelColor?: string, activePanelIcon?: string, state?: EditorState) => FloatingToolbarItem<Command>[];
14
- export declare const getToolbarConfig: (state: EditorState, intl: IntlShape, options: PanelPluginOptions | undefined, providerFactory: ProviderFactory, hoverDecoration: HoverDecorationHandler | undefined) => FloatingToolbarConfig | undefined;
15
+ export declare const getToolbarItems: (formatMessage: IntlShape['formatMessage'], panelNodeType: NodeType, isCustomPanelEnabled: boolean, isCustomPanelEditable: boolean, providerFactory: ProviderFactory, hoverDecoration: HoverDecorationHandler | undefined, editorAnalyticsAPI: EditorAnalyticsAPI | undefined, activePanelType?: string, activePanelColor?: string, activePanelIcon?: string, state?: EditorState) => FloatingToolbarItem<Command>[];
16
+ export declare const getToolbarConfig: (state: EditorState, intl: IntlShape, options: PanelPluginOptions | undefined, providerFactory: ProviderFactory, api: ExtractInjectionAPI<PanelPlugin> | undefined) => FloatingToolbarConfig | undefined;
@@ -21,7 +21,6 @@ export declare function getContent({ schema, slice }: GetContentProps): PasteCon
21
21
  export declare function getMediaTraceId(slice: Slice): undefined;
22
22
  export declare function createPasteAnalyticsPayload(view: EditorView, event: ClipboardEvent, slice: Slice, pasteContext: PasteContext): AnalyticsEventPayload;
23
23
  export declare function sendPasteAnalyticsEvent(view: EditorView, event: ClipboardEvent, slice: Slice, pasteContext: PasteContext): void;
24
- export declare function pasteCommandWithAnalytics(view: EditorView, event: ClipboardEvent, slice: Slice, pasteContext: PasteContext): import("../../analytics").HigherOrderCommand;
25
24
  export declare const handlePasteAsPlainTextWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
26
25
  export declare const handlePasteIntoTaskAndDecisionWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
27
26
  export declare const handlePasteIntoCaptionWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType) => Command;
@@ -1,8 +1,11 @@
1
1
  import type { Schema } from '@atlaskit/editor-prosemirror/model';
2
2
  import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- import { INPUT_METHOD } from '../../analytics';
3
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
4
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
5
+ import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
6
+ import type { TaskAndDecisionsPlugin } from '../types';
4
7
  type IndentationInputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
5
- export declare const getUnindentCommand: (inputMethod?: IndentationInputMethod) => import("@atlaskit/editor-common/types").Command;
6
- export declare const getIndentCommand: (inputMethod?: IndentationInputMethod) => import("@atlaskit/editor-common/types").Command;
7
- export declare function keymapPlugin(schema: Schema, allowNestedTasks?: boolean, consumeTabs?: boolean): SafePlugin | undefined;
8
+ export declare const getUnindentCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod?: IndentationInputMethod) => import("@atlaskit/editor-common/types").Command;
9
+ export declare const getIndentCommand: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (inputMethod?: IndentationInputMethod) => import("@atlaskit/editor-common/types").Command;
10
+ export declare function keymapPlugin(schema: Schema, api: ExtractInjectionAPI<TaskAndDecisionsPlugin> | undefined, allowNestedTasks?: boolean, consumeTabs?: boolean): SafePlugin | undefined;
8
11
  export default keymapPlugin;
@@ -4,6 +4,7 @@ import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/stat
4
4
  import type { INPUT_METHOD, USER_CONTEXT } from '@atlaskit/editor-common/analytics';
5
5
  import type { NextEditorPlugin, OptionalPlugin, LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
6
6
  import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
7
+ import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
7
8
  export type TaskDecisionListType = 'taskList' | 'decisionList';
8
9
  export type TaskDecisionInputMethod = INPUT_METHOD.TOOLBAR | INPUT_METHOD.INSERT_MENU | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.FORMATTING | INPUT_METHOD.KEYBOARD;
9
10
  export type ContextData = {
@@ -28,6 +29,7 @@ export interface TaskDecisionPluginOptions extends LongPressSelectionPluginOptio
28
29
  export type TaskAndDecisionsPlugin = NextEditorPlugin<'taskDecision', {
29
30
  pluginConfiguration: TaskDecisionPluginOptions | undefined;
30
31
  dependencies: [
31
- OptionalPlugin<TypeAheadPlugin>
32
+ OptionalPlugin<TypeAheadPlugin>,
33
+ OptionalPlugin<AnalyticsPlugin>
32
34
  ];
33
35
  }>;
@@ -1,7 +1,9 @@
1
1
  import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
2
2
  import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
3
+ import type { HistoryPlugin } from '@atlaskit/editor-plugin-history';
3
4
  export type UndoRedoPlugin = NextEditorPlugin<'undoRedoPlugin', {
4
5
  dependencies: [
5
- TypeAheadPlugin
6
+ TypeAheadPlugin,
7
+ HistoryPlugin
6
8
  ];
7
9
  }>;
@@ -1,9 +1,8 @@
1
+ /// <reference types="react" />
1
2
  /** @jsx jsx */
2
- import { PureComponent } from 'react';
3
3
  import { jsx } from '@emotion/react';
4
4
  import type { WrappedComponentProps } from 'react-intl-next';
5
5
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
6
- import type { HistoryPluginState } from '../../../history/types';
7
6
  import type { UndoRedoPlugin } from '../../types';
8
7
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
9
8
  export interface Props {
@@ -11,13 +10,10 @@ export interface Props {
11
10
  redoDisabled?: boolean;
12
11
  disabled?: boolean;
13
12
  isReducedSpacing?: boolean;
14
- historyState: HistoryPluginState;
15
13
  editorView: EditorView;
16
14
  api: ExtractInjectionAPI<UndoRedoPlugin> | undefined;
17
15
  }
18
- export declare class ToolbarUndoRedo extends PureComponent<Props & WrappedComponentProps> {
19
- render(): jsx.JSX.Element;
20
- }
16
+ export declare const ToolbarUndoRedo: ({ disabled, isReducedSpacing, editorView, api, intl: { formatMessage }, }: Props & WrappedComponentProps) => jsx.JSX.Element;
21
17
  declare const _default: import("react").FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
22
18
  WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps<"intl">>;
23
19
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "188.11.4",
3
+ "version": "188.12.1",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -80,6 +80,7 @@
80
80
  "@atlaskit/editor-plugin-grid": "^0.3.0",
81
81
  "@atlaskit/editor-plugin-guideline": "^0.5.0",
82
82
  "@atlaskit/editor-plugin-help-dialog": "^0.2.0",
83
+ "@atlaskit/editor-plugin-history": "^0.1.0",
83
84
  "@atlaskit/editor-plugin-hyperlink": "^0.5.0",
84
85
  "@atlaskit/editor-plugin-image-upload": "^0.2.0",
85
86
  "@atlaskit/editor-plugin-list": "^1.3.0",
@@ -92,6 +93,7 @@
92
93
  "@atlaskit/editor-plugin-save-on-enter": "^0.1.0",
93
94
  "@atlaskit/editor-plugin-scroll-into-view": "^0.1.0",
94
95
  "@atlaskit/editor-plugin-selection": "^0.1.0",
96
+ "@atlaskit/editor-plugin-selection-toolbar": "^0.1.0",
95
97
  "@atlaskit/editor-plugin-status": "^0.1.0",
96
98
  "@atlaskit/editor-plugin-table": "^5.3.0",
97
99
  "@atlaskit/editor-plugin-text-formatting": "^0.4.0",
@@ -106,7 +108,7 @@
106
108
  "@atlaskit/form": "^8.11.0",
107
109
  "@atlaskit/icon": "^21.12.0",
108
110
  "@atlaskit/logo": "^13.14.0",
109
- "@atlaskit/media-card": "^77.1.0",
111
+ "@atlaskit/media-card": "^77.2.0",
110
112
  "@atlaskit/media-client": "^24.0.0",
111
113
  "@atlaskit/media-common": "^9.0.0",
112
114
  "@atlaskit/mention": "^22.1.0",
@@ -116,7 +118,7 @@
116
118
  "@atlaskit/radio": "^5.6.0",
117
119
  "@atlaskit/section-message": "^6.4.0",
118
120
  "@atlaskit/select": "^16.7.0",
119
- "@atlaskit/smart-card": "^26.35.0",
121
+ "@atlaskit/smart-card": "^26.37.0",
120
122
  "@atlaskit/smart-user-picker": "^6.3.0",
121
123
  "@atlaskit/spinner": "^15.6.0",
122
124
  "@atlaskit/tabs": "^13.4.0",
@@ -315,6 +317,9 @@
315
317
  "platform.editor.table-update-colwidths-after-column-is-deleted": {
316
318
  "type": "boolean",
317
319
  "referenceOnly": "true"
320
+ },
321
+ "platform.editor.enable-selection-toolbar_ucdwd": {
322
+ "type": "boolean"
318
323
  }
319
324
  }
320
325
  }
@@ -1,10 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.HistoryActionTypes = void 0;
7
- var HistoryActionTypes = exports.HistoryActionTypes = /*#__PURE__*/function (HistoryActionTypes) {
8
- HistoryActionTypes["UPDATE"] = "UPDATE";
9
- return HistoryActionTypes;
10
- }({});
@@ -1,75 +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.historyPluginKey = exports.default = void 0;
8
- var _pluginStateFactory = require("../../utils/plugin-state-factory");
9
- var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
10
- var _state = require("@atlaskit/editor-prosemirror/state");
11
- var _reducer = _interopRequireDefault(require("./reducer"));
12
- var _actions = require("./actions");
13
- var _utils = require("./utils");
14
- /**
15
- * Plugin that keeps track of whether undo and redo are currently available
16
- * This is needed so we can enable/disable controls appropriately
17
- *
18
- * Actual undo/redo functionality is handled by prosemirror-history:
19
- * https://github.com/ProseMirror/prosemirror-history
20
- */
21
-
22
- var historyPluginKey = exports.historyPluginKey = new _state.PluginKey('historyPlugin');
23
- var getInitialState = function getInitialState() {
24
- return {
25
- canUndo: false,
26
- canRedo: false
27
- };
28
- };
29
- var _pluginFactory = (0, _pluginStateFactory.pluginFactory)(historyPluginKey, _reducer.default),
30
- createPluginState = _pluginFactory.createPluginState,
31
- getPluginState = _pluginFactory.getPluginState;
32
- var createPlugin = function createPlugin(dispatch) {
33
- return new _safePlugin.SafePlugin({
34
- state: createPluginState(dispatch, getInitialState),
35
- key: historyPluginKey,
36
- appendTransaction: function appendTransaction(transactions, oldState, newState) {
37
- if (transactions.find(function (tr) {
38
- return tr.docChanged && tr.getMeta('addToHistory') !== false;
39
- })) {
40
- var pmHistoryPluginState = (0, _utils.getPmHistoryPluginState)(newState);
41
- if (!pmHistoryPluginState) {
42
- return;
43
- }
44
- var canUndo = pmHistoryPluginState.done.eventCount > 0;
45
- var canRedo = pmHistoryPluginState.undone.eventCount > 0;
46
- var _getPluginState = getPluginState(newState),
47
- prevCanUndo = _getPluginState.canUndo,
48
- prevCanRedo = _getPluginState.canRedo;
49
- if (canUndo !== prevCanUndo || canRedo !== prevCanRedo) {
50
- var action = {
51
- type: _actions.HistoryActionTypes.UPDATE,
52
- canUndo: canUndo,
53
- canRedo: canRedo
54
- };
55
- return newState.tr.setMeta(historyPluginKey, action);
56
- }
57
- }
58
- }
59
- });
60
- };
61
- var historyPlugin = function historyPlugin() {
62
- return {
63
- name: 'history',
64
- pmPlugins: function pmPlugins() {
65
- return [{
66
- name: 'history',
67
- plugin: function plugin(_ref) {
68
- var dispatch = _ref.dispatch;
69
- return createPlugin(dispatch);
70
- }
71
- }];
72
- }
73
- };
74
- };
75
- var _default = exports.default = historyPlugin;
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,18 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _actions = require("./actions");
8
- var reducer = function reducer(state, action) {
9
- switch (action.type) {
10
- case _actions.HistoryActionTypes.UPDATE:
11
- return {
12
- canUndo: action.canUndo,
13
- canRedo: action.canRedo
14
- };
15
- }
16
- return state;
17
- };
18
- var _default = exports.default = reducer;
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getPmHistoryPluginState = exports.getPmHistoryPlugin = void 0;
7
- var _utils = require("@atlaskit/editor-common/utils");
8
- var getPmHistoryPlugin = exports.getPmHistoryPlugin = function getPmHistoryPlugin(state) {
9
- return state.plugins.find(function (plugin) {
10
- return plugin.key === _utils.pmHistoryPluginKey;
11
- });
12
- };
13
- var getPmHistoryPluginState = exports.getPmHistoryPluginState = function getPmHistoryPluginState(state) {
14
- var pmHistoryPlugin = getPmHistoryPlugin(state);
15
- if (!pmHistoryPlugin) {
16
- return;
17
- }
18
- return pmHistoryPlugin.getState(state);
19
- };
@@ -1,4 +0,0 @@
1
- export let HistoryActionTypes = /*#__PURE__*/function (HistoryActionTypes) {
2
- HistoryActionTypes["UPDATE"] = "UPDATE";
3
- return HistoryActionTypes;
4
- }({});
@@ -1,61 +0,0 @@
1
- import { pluginFactory } from '../../utils/plugin-state-factory';
2
- import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
- import { PluginKey } from '@atlaskit/editor-prosemirror/state';
4
- import reducer from './reducer';
5
- import { HistoryActionTypes } from './actions';
6
- import { getPmHistoryPluginState } from './utils';
7
- /**
8
- * Plugin that keeps track of whether undo and redo are currently available
9
- * This is needed so we can enable/disable controls appropriately
10
- *
11
- * Actual undo/redo functionality is handled by prosemirror-history:
12
- * https://github.com/ProseMirror/prosemirror-history
13
- */
14
-
15
- export const historyPluginKey = new PluginKey('historyPlugin');
16
- const getInitialState = () => ({
17
- canUndo: false,
18
- canRedo: false
19
- });
20
- const {
21
- createPluginState,
22
- getPluginState
23
- } = pluginFactory(historyPluginKey, reducer);
24
- const createPlugin = dispatch => new SafePlugin({
25
- state: createPluginState(dispatch, getInitialState),
26
- key: historyPluginKey,
27
- appendTransaction: (transactions, oldState, newState) => {
28
- if (transactions.find(tr => tr.docChanged && tr.getMeta('addToHistory') !== false)) {
29
- const pmHistoryPluginState = getPmHistoryPluginState(newState);
30
- if (!pmHistoryPluginState) {
31
- return;
32
- }
33
- const canUndo = pmHistoryPluginState.done.eventCount > 0;
34
- const canRedo = pmHistoryPluginState.undone.eventCount > 0;
35
- const {
36
- canUndo: prevCanUndo,
37
- canRedo: prevCanRedo
38
- } = getPluginState(newState);
39
- if (canUndo !== prevCanUndo || canRedo !== prevCanRedo) {
40
- const action = {
41
- type: HistoryActionTypes.UPDATE,
42
- canUndo,
43
- canRedo
44
- };
45
- return newState.tr.setMeta(historyPluginKey, action);
46
- }
47
- }
48
- }
49
- });
50
- const historyPlugin = () => ({
51
- name: 'history',
52
- pmPlugins() {
53
- return [{
54
- name: 'history',
55
- plugin: ({
56
- dispatch
57
- }) => createPlugin(dispatch)
58
- }];
59
- }
60
- });
61
- export default historyPlugin;
@@ -1 +0,0 @@
1
- export {};
@@ -1,12 +0,0 @@
1
- import { HistoryActionTypes } from './actions';
2
- const reducer = (state, action) => {
3
- switch (action.type) {
4
- case HistoryActionTypes.UPDATE:
5
- return {
6
- canUndo: action.canUndo,
7
- canRedo: action.canRedo
8
- };
9
- }
10
- return state;
11
- };
12
- export default reducer;
@@ -1 +0,0 @@
1
- export {};