@atlaskit/editor-core 187.28.0 → 187.28.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/cjs/create-editor/ReactEditorViewInternal.js +3 -3
  3. package/dist/cjs/create-editor/create-plugins-list.js +2 -2
  4. package/dist/cjs/index.js +0 -7
  5. package/dist/cjs/labs/next/presets/default.js +2 -2
  6. package/dist/cjs/plugins/base/index.js +7 -126
  7. package/dist/cjs/plugins/base/plugin.js +140 -0
  8. package/dist/cjs/plugins/base/pm-plugins/scroll-gutter.js +3 -9
  9. package/dist/cjs/plugins/index.js +2 -2
  10. package/dist/cjs/plugins/list/index.js +17 -0
  11. package/dist/cjs/plugins/list/utils/find.js +4 -3
  12. package/dist/cjs/plugins/media/toolbar/index.js +1 -1
  13. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +7 -2
  14. package/dist/cjs/plugins/media/utils/media-single.js +7 -5
  15. package/dist/cjs/plugins/paste/handlers.js +27 -3
  16. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +2 -2
  17. package/dist/cjs/plugins/paste/pm-plugins/main.js +2 -2
  18. package/dist/cjs/plugins/toolbar-lists-indentation/index.js +58 -36
  19. package/dist/cjs/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +6 -6
  20. package/dist/cjs/plugins/toolbar-lists-indentation/ui/index.js +3 -3
  21. package/dist/cjs/plugins/toolbar-lists-indentation/ui/onItemActivated.js +8 -9
  22. package/dist/cjs/test-utils.js +2 -2
  23. package/dist/cjs/ui/ContentStyles/index.js +19 -18
  24. package/dist/cjs/ui/ToolbarFeedback/index.js +22 -16
  25. package/dist/cjs/version-wrapper.js +1 -1
  26. package/dist/es2019/create-editor/ReactEditorViewInternal.js +3 -3
  27. package/dist/es2019/create-editor/create-plugins-list.js +1 -1
  28. package/dist/es2019/index.js +0 -1
  29. package/dist/es2019/labs/next/presets/default.js +1 -1
  30. package/dist/es2019/plugins/base/index.js +2 -104
  31. package/dist/es2019/plugins/base/plugin.js +109 -0
  32. package/dist/es2019/plugins/base/pm-plugins/scroll-gutter.js +1 -4
  33. package/dist/es2019/plugins/index.js +1 -1
  34. package/dist/es2019/plugins/list/index.js +19 -0
  35. package/dist/es2019/plugins/list/utils/find.js +2 -2
  36. package/dist/es2019/plugins/media/toolbar/index.js +2 -2
  37. package/dist/es2019/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +9 -4
  38. package/dist/es2019/plugins/media/utils/media-single.js +3 -4
  39. package/dist/es2019/plugins/paste/handlers.js +27 -3
  40. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +2 -2
  41. package/dist/es2019/plugins/paste/pm-plugins/main.js +2 -2
  42. package/dist/es2019/plugins/toolbar-lists-indentation/index.js +62 -38
  43. package/dist/es2019/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +6 -6
  44. package/dist/es2019/plugins/toolbar-lists-indentation/ui/index.js +3 -3
  45. package/dist/es2019/plugins/toolbar-lists-indentation/ui/onItemActivated.js +5 -6
  46. package/dist/es2019/test-utils.js +1 -1
  47. package/dist/es2019/ui/ContentStyles/index.js +25 -3
  48. package/dist/es2019/ui/ToolbarFeedback/index.js +14 -9
  49. package/dist/es2019/version-wrapper.js +1 -1
  50. package/dist/esm/create-editor/ReactEditorViewInternal.js +3 -3
  51. package/dist/esm/create-editor/create-plugins-list.js +1 -1
  52. package/dist/esm/index.js +0 -1
  53. package/dist/esm/labs/next/presets/default.js +1 -1
  54. package/dist/esm/plugins/base/index.js +2 -123
  55. package/dist/esm/plugins/base/plugin.js +128 -0
  56. package/dist/esm/plugins/base/pm-plugins/scroll-gutter.js +1 -4
  57. package/dist/esm/plugins/index.js +1 -1
  58. package/dist/esm/plugins/list/index.js +19 -0
  59. package/dist/esm/plugins/list/utils/find.js +2 -2
  60. package/dist/esm/plugins/media/toolbar/index.js +2 -2
  61. package/dist/esm/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +9 -4
  62. package/dist/esm/plugins/media/utils/media-single.js +5 -4
  63. package/dist/esm/plugins/paste/handlers.js +25 -3
  64. package/dist/esm/plugins/paste/pm-plugins/analytics.js +2 -2
  65. package/dist/esm/plugins/paste/pm-plugins/main.js +2 -2
  66. package/dist/esm/plugins/toolbar-lists-indentation/index.js +60 -37
  67. package/dist/esm/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.js +6 -6
  68. package/dist/esm/plugins/toolbar-lists-indentation/ui/index.js +3 -3
  69. package/dist/esm/plugins/toolbar-lists-indentation/ui/onItemActivated.js +5 -6
  70. package/dist/esm/test-utils.js +1 -1
  71. package/dist/esm/ui/ContentStyles/index.js +6 -5
  72. package/dist/esm/ui/ToolbarFeedback/index.js +20 -14
  73. package/dist/esm/version-wrapper.js +1 -1
  74. package/dist/types/index.d.ts +0 -1
  75. package/dist/types/plugins/base/index.d.ts +4 -16
  76. package/dist/types/plugins/base/plugin.d.ts +23 -0
  77. package/dist/types/plugins/base/pm-plugins/scroll-gutter.d.ts +0 -3
  78. package/dist/types/plugins/index.d.ts +1 -1
  79. package/dist/types/plugins/list/types.d.ts +1 -8
  80. package/dist/types/plugins/list/utils/find.d.ts +1 -1
  81. package/dist/types/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +1 -0
  82. package/dist/types/plugins/media/utils/media-single.d.ts +1 -0
  83. package/dist/types/plugins/paste/handlers.d.ts +4 -2
  84. package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +2 -1
  85. package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +5 -2
  86. package/dist/types/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.d.ts +4 -1
  87. package/dist/types/plugins/toolbar-lists-indentation/ui/index.d.ts +3 -3
  88. package/dist/types/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +3 -2
  89. package/dist/types/ui/ToolbarFeedback/index.d.ts +1 -19
  90. package/dist/types-ts4.5/index.d.ts +0 -1
  91. package/dist/types-ts4.5/plugins/base/index.d.ts +4 -18
  92. package/dist/types-ts4.5/plugins/base/plugin.d.ts +25 -0
  93. package/dist/types-ts4.5/plugins/base/pm-plugins/scroll-gutter.d.ts +0 -3
  94. package/dist/types-ts4.5/plugins/index.d.ts +1 -1
  95. package/dist/types-ts4.5/plugins/list/types.d.ts +1 -8
  96. package/dist/types-ts4.5/plugins/list/utils/find.d.ts +1 -1
  97. package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +1 -0
  98. package/dist/types-ts4.5/plugins/media/utils/media-single.d.ts +1 -0
  99. package/dist/types-ts4.5/plugins/paste/handlers.d.ts +4 -2
  100. package/dist/types-ts4.5/plugins/paste/pm-plugins/analytics.d.ts +2 -1
  101. package/dist/types-ts4.5/plugins/toolbar-lists-indentation/index.d.ts +5 -2
  102. package/dist/types-ts4.5/plugins/toolbar-lists-indentation/pm-plugins/indentation-buttons.d.ts +4 -1
  103. package/dist/types-ts4.5/plugins/toolbar-lists-indentation/ui/index.d.ts +3 -3
  104. package/dist/types-ts4.5/plugins/toolbar-lists-indentation/ui/onItemActivated.d.ts +3 -2
  105. package/dist/types-ts4.5/ui/ToolbarFeedback/index.d.ts +1 -19
  106. package/package.json +2 -2
  107. package/report.api.md +4 -58
  108. package/tmp/api-report-tmp.d.ts +4 -47
  109. package/dist/cjs/plugins/list/styles.js +0 -15
  110. package/dist/cjs/utils/list-commands.js +0 -17
  111. package/dist/cjs/utils/lists.js +0 -31
  112. package/dist/es2019/plugins/list/styles.js +0 -26
  113. package/dist/es2019/utils/list-commands.js +0 -11
  114. package/dist/es2019/utils/lists.js +0 -26
  115. package/dist/esm/plugins/list/styles.js +0 -7
  116. package/dist/esm/utils/list-commands.js +0 -11
  117. package/dist/esm/utils/lists.js +0 -24
  118. package/dist/types/plugins/list/styles.d.ts +0 -1
  119. package/dist/types/utils/list-commands.d.ts +0 -6
  120. package/dist/types/utils/lists.d.ts +0 -2
  121. package/dist/types-ts4.5/plugins/list/styles.d.ts +0 -1
  122. package/dist/types-ts4.5/utils/list-commands.d.ts +0 -6
  123. package/dist/types-ts4.5/utils/lists.d.ts +0 -2
@@ -1,11 +1,4 @@
1
- import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
2
1
  import type { FeatureFlags } from '@atlaskit/editor-common/types';
2
+ export type { ListState } from '@atlaskit/editor-plugin-list';
3
3
  export declare const MAX_NESTED_LIST_INDENTATION = 6;
4
- export interface ListState {
5
- bulletListActive: boolean;
6
- bulletListDisabled: boolean;
7
- orderedListActive: boolean;
8
- orderedListDisabled: boolean;
9
- decorationSet: DecorationSet;
10
- }
11
4
  export type ListPluginOptions = Pick<FeatureFlags, 'restartNumberedLists'>;
@@ -7,4 +7,4 @@ export declare function findFirstParentListItemNode($pos: ResolvedPos): {
7
7
  pos: number;
8
8
  node: PMNode;
9
9
  } | null;
10
- export declare function findRootParentListNode($pos: ResolvedPos): ResolvedPos | null;
10
+ export declare const findRootParentListNode: ($pos: ResolvedPos) => ResolvedPos | null;
@@ -46,6 +46,7 @@ declare class ResizableMediaSingleNext extends React.Component<ResizableMediaSin
46
46
  private setIsResizing;
47
47
  private updateSizeInPluginState;
48
48
  private calcMaxWidth;
49
+ private calcMinWidth;
49
50
  private getRelativeGuides;
50
51
  updateActiveGuidelines: (width: number | undefined, guidelines: GuidelineConfig[], guidelineSnapsReference: GuidelineSnapsReference) => void;
51
52
  calculateSizeState: (size: Position & Dimensions, delta: Dimensions, onResizeStop?: boolean) => {
@@ -19,4 +19,5 @@ export declare const insertMediaSingleNode: (view: EditorView, mediaState: Media
19
19
  export declare const createMediaSingleNode: (schema: Schema, collection: string, maxWidth?: number, minWidth?: number, alignLeftOnInsert?: boolean) => (mediaState: MediaSingleState) => PMNode;
20
20
  export declare function transformSliceForMedia(slice: Slice, schema: Schema): (selection: Selection) => Slice;
21
21
  export declare function isCaptionNode(editorView: EditorView): boolean;
22
+ export declare const isVideo: (fileType?: string) => boolean;
22
23
  export declare const getParentWidthForNestedMediaSingleNode: (resolvedPos: ResolvedPos, view: EditorView) => number | null;
@@ -1,15 +1,17 @@
1
1
  import { Slice } from '@atlaskit/editor-prosemirror/model';
2
2
  import type { Schema } from '@atlaskit/editor-prosemirror/model';
3
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
+ import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { ExtensionAutoConvertHandler } from '@atlaskit/editor-common/extensions';
5
5
  import type { Command } from '../../types';
6
6
  import type { InputMethodInsertMedia } from '../analytics';
7
7
  import type { QueueCardsFromTransactionAction, CardOptions } from '@atlaskit/editor-common/card';
8
8
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
9
+ import type { FindRootParentListNode } from '@atlaskit/editor-plugin-list';
9
10
  export declare function handleMention(slice: Slice, schema: Schema): Slice;
10
11
  export declare function handlePasteIntoTaskOrDecisionOrPanel(slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined): Command;
11
12
  export declare function handlePasteNonNestableBlockNodesIntoList(slice: Slice): Command;
12
- export declare function handlePastePanelOrDecisionContentIntoList(slice: Slice): Command;
13
+ export declare const doesSelectionWhichStartsOrEndsInListContainEntireList: (selection: Selection, findRootParentListNode: FindRootParentListNode | undefined) => boolean;
14
+ export declare function handlePastePanelOrDecisionContentIntoList(slice: Slice, findRootParentListNode: FindRootParentListNode | undefined): Command;
13
15
  export declare function handlePasteLinkOnSelectedText(slice: Slice): Command;
14
16
  export declare function handlePasteAsPlainText(slice: Slice, _event: ClipboardEvent): Command;
15
17
  export declare function handlePastePreservingMarks(slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined): Command;
@@ -4,6 +4,7 @@ import type { Slice, Fragment, Schema } from '@atlaskit/editor-prosemirror/model
4
4
  import type { ExtractInjectionAPI, Command } from '@atlaskit/editor-common/types';
5
5
  import type pastePlugin from '../';
6
6
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
7
+ import type { FindRootParentListNode } from '@atlaskit/editor-plugin-list';
7
8
  type PasteContext = {
8
9
  type: PasteType;
9
10
  asPlain?: boolean;
@@ -29,7 +30,7 @@ export declare const handleMediaSingleWithAnalytics: (view: EditorView, event: C
29
30
  export declare const handlePastePreservingMarksWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
30
31
  export declare const handleMarkdownWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
31
32
  export declare const handleRichTextWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
32
- export declare const handlePastePanelOrDecisionIntoListWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
33
+ export declare const handlePastePanelOrDecisionIntoListWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, findRootParentListNode: FindRootParentListNode | undefined) => Command;
33
34
  export declare const handlePasteNonNestableBlockNodesIntoListWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
34
35
  export declare const handleExpandWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
35
36
  export declare const handleSelectedTableWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
@@ -1,7 +1,8 @@
1
- import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
1
+ import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
2
  import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
3
3
  import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
4
- import type { OptionalPlugin } from '@atlaskit/editor-common/types';
4
+ import type { ListPlugin } from '@atlaskit/editor-plugin-list';
5
+ import type { IndentationButtons } from './pm-plugins/indentation-buttons';
5
6
  type Config = {
6
7
  showIndentationButtons: boolean;
7
8
  allowHeadingAndParagraphIndentation: boolean;
@@ -10,7 +11,9 @@ declare const toolbarListsIndentationPlugin: NextEditorPlugin<'toolbarListsInden
10
11
  pluginConfiguration: Config;
11
12
  dependencies: [
12
13
  typeof featureFlagsPlugin,
14
+ ListPlugin,
13
15
  OptionalPlugin<typeof analyticsPlugin>
14
16
  ];
17
+ sharedState: IndentationButtons | undefined;
15
18
  }>;
16
19
  export default toolbarListsIndentationPlugin;
@@ -1,14 +1,17 @@
1
1
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import type { Dispatch } from '../../../event-dispatcher';
4
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
5
+ import type toolbarListsIndentationPlugin from '../index';
4
6
  export interface IndentationButtons {
5
7
  indentDisabled: boolean;
6
8
  outdentDisabled: boolean;
7
9
  node: null | 'paragraph_heading' | 'list' | 'taskList';
8
10
  }
9
11
  export declare const pluginKey: PluginKey<IndentationButtons>;
10
- export declare const createPlugin: ({ dispatch, showIndentationButtons, allowHeadingAndParagraphIndentation, }: {
12
+ export declare const createPlugin: ({ dispatch, showIndentationButtons, allowHeadingAndParagraphIndentation, api, }: {
11
13
  dispatch: Dispatch;
12
14
  showIndentationButtons: boolean;
13
15
  allowHeadingAndParagraphIndentation: boolean;
16
+ api: ExtractInjectionAPI<typeof toolbarListsIndentationPlugin> | undefined;
14
17
  }) => SafePlugin<IndentationButtons>;
@@ -1,8 +1,8 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- import type { FeatureFlags } from '@atlaskit/editor-common/types';
5
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
+ import type { ExtractInjectionAPI, FeatureFlags } from '@atlaskit/editor-common/types';
5
+ import type toolbarListsIndentationPlugin from '../index';
6
6
  export interface Props {
7
7
  editorView: EditorView;
8
8
  featureFlags: FeatureFlags;
@@ -19,6 +19,6 @@ export interface Props {
19
19
  showIndentationButtons?: boolean;
20
20
  indentDisabled?: boolean;
21
21
  outdentDisabled?: boolean;
22
- editorAnalyticsAPI?: EditorAnalyticsAPI;
22
+ pluginInjectionApi?: ExtractInjectionAPI<typeof toolbarListsIndentationPlugin> | undefined;
23
23
  }
24
24
  export default function ToolbarListsIndentation(props: Props): jsx.JSX.Element;
@@ -1,8 +1,9 @@
1
1
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
2
  import type { FeatureFlags } from '@atlaskit/editor-common/types';
3
3
  import type { ButtonName } from '../types';
4
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
5
- export declare const onItemActivated: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ buttonName, editorView, featureFlags, }: {
4
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
5
+ import type toolbarListsIndentationPlugin from '../index';
6
+ export declare const onItemActivated: (pluginInjectionApi: ExtractInjectionAPI<typeof toolbarListsIndentationPlugin> | undefined) => ({ buttonName, editorView, featureFlags, }: {
6
7
  featureFlags: FeatureFlags;
7
8
  buttonName: ButtonName;
8
9
  editorView: EditorView;
@@ -1,7 +1,5 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
- import { PureComponent } from 'react';
4
- import PropTypes from 'prop-types';
5
3
  export type EditorProduct = 'bitbucket' | 'jira' | 'confluence' | 'stride' | undefined;
6
4
  export interface Props {
7
5
  /** @deprecated To pass package version use feedbackInfo property – <Editor feedbackInfo={{ packageVersion }} /> */
@@ -26,20 +24,4 @@ declare global {
26
24
  ATL_JQ_PAGE_PROPS: any;
27
25
  }
28
26
  }
29
- export default class ToolbarFeedback extends PureComponent<Props, State> {
30
- static contextTypes: {
31
- editorActions: PropTypes.Validator<object>;
32
- };
33
- state: State;
34
- constructor(props: Props);
35
- private handleRef;
36
- showJiraCollectorDialogCallback?: () => void;
37
- private getFeedbackInfo;
38
- render(): jsx.JSX.Element | null;
39
- private collectFeedback;
40
- private toggleShowOptOutOption;
41
- private openJiraIssueCollector;
42
- private openFeedbackPopup;
43
- private openLearnMorePage;
44
- private hasJquery;
45
- }
27
+ export default function ToolbarFeedback(props: Props): jsx.JSX.Element;
@@ -63,7 +63,6 @@ export { INPUT_METHOD, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, }
63
63
  export type { AnalyticsEventPayload } from '@atlaskit/editor-common/analytics';
64
64
  export { setKeyboardHeight, setMobilePaddingTop, setIsExpanded, } from './plugins/mobile-dimensions/commands';
65
65
  export { setTextSelection, dedupe, getNodesCount, measurements } from './utils';
66
- export { getListCommands } from './utils/list-commands';
67
66
  export { ReactEditorView, BaseReactEditorView } from './create-editor';
68
67
  export { getDefaultPresetOptionsFromEditorProps } from './create-editor';
69
68
  export type { Command, EditorPlugin, EditorProps, EditorInstance, CommandDispatch, } from './types';
@@ -1,19 +1,5 @@
1
- import type { NextEditorPlugin } from '../../types';
1
+ import basePlugin from './plugin';
2
+ import type { BasePlugin, BasePluginState, BasePluginOptions } from './plugin';
2
3
  import type { ScrollGutterPluginOptions } from './pm-plugins/scroll-gutter';
3
- import type { InputTracking, BrowserFreezetracking } from '../../types/performance-tracking';
4
- import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
5
- export interface BasePluginOptions {
6
- allowScrollGutter?: ScrollGutterPluginOptions;
7
- allowInlineCursorTarget?: boolean;
8
- inputTracking?: InputTracking;
9
- browserFreezeTracking?: BrowserFreezetracking;
10
- ufo?: boolean;
11
- }
12
- export declare const isChromeWithSelectionBug: any;
13
- declare const basePlugin: NextEditorPlugin<'base', {
14
- pluginConfiguration: BasePluginOptions | undefined;
15
- dependencies: [
16
- typeof featureFlagsPlugin
17
- ];
18
- }>;
19
- export default basePlugin;
4
+ export { basePlugin };
5
+ export type { BasePlugin, BasePluginState, BasePluginOptions, ScrollGutterPluginOptions, };
@@ -0,0 +1,25 @@
1
+ import type { NextEditorPlugin } from '../../types';
2
+ import type { ScrollGutterPluginOptions } from './pm-plugins/scroll-gutter';
3
+ import type { InputTracking, BrowserFreezetracking } from '../../types/performance-tracking';
4
+ import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
5
+ import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
6
+ export interface BasePluginOptions {
7
+ allowScrollGutter?: ScrollGutterPluginOptions;
8
+ allowInlineCursorTarget?: boolean;
9
+ inputTracking?: InputTracking;
10
+ browserFreezeTracking?: BrowserFreezetracking;
11
+ ufo?: boolean;
12
+ }
13
+ export type BasePluginState = {
14
+ contextIdentifier: ContextIdentifierProvider | undefined;
15
+ };
16
+ export type BasePlugin = NextEditorPlugin<'base', {
17
+ pluginConfiguration: BasePluginOptions | undefined;
18
+ dependencies: [
19
+ typeof featureFlagsPlugin
20
+ ];
21
+ sharedState: BasePluginState;
22
+ }>;
23
+ export declare const isChromeWithSelectionBug: any;
24
+ declare const basePlugin: BasePlugin;
25
+ export default basePlugin;
@@ -1,8 +1,5 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
3
- export declare const GUTTER_SIZE_IN_PX = 120;
4
- export declare const GUTTER_SIZE_MOBILE_IN_PX = 36;
5
- export declare const GUTTER_SELECTOR = "#editor-scroll-gutter";
6
3
  export type ScrollGutterPluginOptions = {
7
4
  /** Element the page uses for scrolling */
8
5
  getScrollElement?: (view: EditorView) => HTMLElement | null;
@@ -1,4 +1,4 @@
1
- export { default as basePlugin } from './base';
1
+ export { basePlugin } from './base';
2
2
  export { default as blockTypePlugin } from './block-type';
3
3
  export { pluginKey as blockPluginStateKey } from './block-type';
4
4
  export type { BlockTypeState } from './block-type';
@@ -1,11 +1,4 @@
1
- import type { DecorationSet } from '@atlaskit/editor-prosemirror/view';
2
1
  import type { FeatureFlags } from '@atlaskit/editor-common/types';
2
+ export type { ListState } from '@atlaskit/editor-plugin-list';
3
3
  export declare const MAX_NESTED_LIST_INDENTATION = 6;
4
- export interface ListState {
5
- bulletListActive: boolean;
6
- bulletListDisabled: boolean;
7
- orderedListActive: boolean;
8
- orderedListDisabled: boolean;
9
- decorationSet: DecorationSet;
10
- }
11
4
  export type ListPluginOptions = Pick<FeatureFlags, 'restartNumberedLists'>;
@@ -7,4 +7,4 @@ export declare function findFirstParentListItemNode($pos: ResolvedPos): {
7
7
  pos: number;
8
8
  node: PMNode;
9
9
  } | null;
10
- export declare function findRootParentListNode($pos: ResolvedPos): ResolvedPos | null;
10
+ export declare const findRootParentListNode: ($pos: ResolvedPos) => ResolvedPos | null;
@@ -46,6 +46,7 @@ declare class ResizableMediaSingleNext extends React.Component<ResizableMediaSin
46
46
  private setIsResizing;
47
47
  private updateSizeInPluginState;
48
48
  private calcMaxWidth;
49
+ private calcMinWidth;
49
50
  private getRelativeGuides;
50
51
  updateActiveGuidelines: (width: number | undefined, guidelines: GuidelineConfig[], guidelineSnapsReference: GuidelineSnapsReference) => void;
51
52
  calculateSizeState: (size: Position & Dimensions, delta: Dimensions, onResizeStop?: boolean) => {
@@ -19,4 +19,5 @@ export declare const insertMediaSingleNode: (view: EditorView, mediaState: Media
19
19
  export declare const createMediaSingleNode: (schema: Schema, collection: string, maxWidth?: number, minWidth?: number, alignLeftOnInsert?: boolean) => (mediaState: MediaSingleState) => PMNode;
20
20
  export declare function transformSliceForMedia(slice: Slice, schema: Schema): (selection: Selection) => Slice;
21
21
  export declare function isCaptionNode(editorView: EditorView): boolean;
22
+ export declare const isVideo: (fileType?: string) => boolean;
22
23
  export declare const getParentWidthForNestedMediaSingleNode: (resolvedPos: ResolvedPos, view: EditorView) => number | null;
@@ -1,15 +1,17 @@
1
1
  import { Slice } from '@atlaskit/editor-prosemirror/model';
2
2
  import type { Schema } from '@atlaskit/editor-prosemirror/model';
3
- import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
+ import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
4
4
  import type { ExtensionAutoConvertHandler } from '@atlaskit/editor-common/extensions';
5
5
  import type { Command } from '../../types';
6
6
  import type { InputMethodInsertMedia } from '../analytics';
7
7
  import type { QueueCardsFromTransactionAction, CardOptions } from '@atlaskit/editor-common/card';
8
8
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
9
+ import type { FindRootParentListNode } from '@atlaskit/editor-plugin-list';
9
10
  export declare function handleMention(slice: Slice, schema: Schema): Slice;
10
11
  export declare function handlePasteIntoTaskOrDecisionOrPanel(slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined): Command;
11
12
  export declare function handlePasteNonNestableBlockNodesIntoList(slice: Slice): Command;
12
- export declare function handlePastePanelOrDecisionContentIntoList(slice: Slice): Command;
13
+ export declare const doesSelectionWhichStartsOrEndsInListContainEntireList: (selection: Selection, findRootParentListNode: FindRootParentListNode | undefined) => boolean;
14
+ export declare function handlePastePanelOrDecisionContentIntoList(slice: Slice, findRootParentListNode: FindRootParentListNode | undefined): Command;
13
15
  export declare function handlePasteLinkOnSelectedText(slice: Slice): Command;
14
16
  export declare function handlePasteAsPlainText(slice: Slice, _event: ClipboardEvent): Command;
15
17
  export declare function handlePastePreservingMarks(slice: Slice, queueCardsFromChangedTr: QueueCardsFromTransactionAction | undefined): Command;
@@ -4,6 +4,7 @@ import type { Slice, Fragment, Schema } from '@atlaskit/editor-prosemirror/model
4
4
  import type { ExtractInjectionAPI, Command } from '@atlaskit/editor-common/types';
5
5
  import type pastePlugin from '../';
6
6
  import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
7
+ import type { FindRootParentListNode } from '@atlaskit/editor-plugin-list';
7
8
  type PasteContext = {
8
9
  type: PasteType;
9
10
  asPlain?: boolean;
@@ -29,7 +30,7 @@ export declare const handleMediaSingleWithAnalytics: (view: EditorView, event: C
29
30
  export declare const handlePastePreservingMarksWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, type: PasteType, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
30
31
  export declare const handleMarkdownWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
31
32
  export declare const handleRichTextWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, pluginInjectionApi: ExtractInjectionAPI<typeof pastePlugin> | undefined) => Command;
32
- export declare const handlePastePanelOrDecisionIntoListWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
33
+ export declare const handlePastePanelOrDecisionIntoListWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice, findRootParentListNode: FindRootParentListNode | undefined) => Command;
33
34
  export declare const handlePasteNonNestableBlockNodesIntoListWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
34
35
  export declare const handleExpandWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
35
36
  export declare const handleSelectedTableWithAnalytics: (view: EditorView, event: ClipboardEvent, slice: Slice) => Command;
@@ -1,7 +1,8 @@
1
- import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
1
+ import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
2
2
  import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
3
3
  import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
4
- import type { OptionalPlugin } from '@atlaskit/editor-common/types';
4
+ import type { ListPlugin } from '@atlaskit/editor-plugin-list';
5
+ import type { IndentationButtons } from './pm-plugins/indentation-buttons';
5
6
  type Config = {
6
7
  showIndentationButtons: boolean;
7
8
  allowHeadingAndParagraphIndentation: boolean;
@@ -10,7 +11,9 @@ declare const toolbarListsIndentationPlugin: NextEditorPlugin<'toolbarListsInden
10
11
  pluginConfiguration: Config;
11
12
  dependencies: [
12
13
  typeof featureFlagsPlugin,
14
+ ListPlugin,
13
15
  OptionalPlugin<typeof analyticsPlugin>
14
16
  ];
17
+ sharedState: IndentationButtons | undefined;
15
18
  }>;
16
19
  export default toolbarListsIndentationPlugin;
@@ -1,14 +1,17 @@
1
1
  import { PluginKey } from '@atlaskit/editor-prosemirror/state';
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import type { Dispatch } from '../../../event-dispatcher';
4
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
5
+ import type toolbarListsIndentationPlugin from '../index';
4
6
  export interface IndentationButtons {
5
7
  indentDisabled: boolean;
6
8
  outdentDisabled: boolean;
7
9
  node: null | 'paragraph_heading' | 'list' | 'taskList';
8
10
  }
9
11
  export declare const pluginKey: PluginKey<IndentationButtons>;
10
- export declare const createPlugin: ({ dispatch, showIndentationButtons, allowHeadingAndParagraphIndentation, }: {
12
+ export declare const createPlugin: ({ dispatch, showIndentationButtons, allowHeadingAndParagraphIndentation, api, }: {
11
13
  dispatch: Dispatch;
12
14
  showIndentationButtons: boolean;
13
15
  allowHeadingAndParagraphIndentation: boolean;
16
+ api: ExtractInjectionAPI<typeof toolbarListsIndentationPlugin> | undefined;
14
17
  }) => SafePlugin<IndentationButtons>;
@@ -1,8 +1,8 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
3
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
4
- import type { FeatureFlags } from '@atlaskit/editor-common/types';
5
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
+ import type { ExtractInjectionAPI, FeatureFlags } from '@atlaskit/editor-common/types';
5
+ import type toolbarListsIndentationPlugin from '../index';
6
6
  export interface Props {
7
7
  editorView: EditorView;
8
8
  featureFlags: FeatureFlags;
@@ -19,6 +19,6 @@ export interface Props {
19
19
  showIndentationButtons?: boolean;
20
20
  indentDisabled?: boolean;
21
21
  outdentDisabled?: boolean;
22
- editorAnalyticsAPI?: EditorAnalyticsAPI;
22
+ pluginInjectionApi?: ExtractInjectionAPI<typeof toolbarListsIndentationPlugin> | undefined;
23
23
  }
24
24
  export default function ToolbarListsIndentation(props: Props): jsx.JSX.Element;
@@ -1,8 +1,9 @@
1
1
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
2
  import type { FeatureFlags } from '@atlaskit/editor-common/types';
3
3
  import type { ButtonName } from '../types';
4
- import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
5
- export declare const onItemActivated: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => ({ buttonName, editorView, featureFlags, }: {
4
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
5
+ import type toolbarListsIndentationPlugin from '../index';
6
+ export declare const onItemActivated: (pluginInjectionApi: ExtractInjectionAPI<typeof toolbarListsIndentationPlugin> | undefined) => ({ buttonName, editorView, featureFlags, }: {
6
7
  featureFlags: FeatureFlags;
7
8
  buttonName: ButtonName;
8
9
  editorView: EditorView;
@@ -1,7 +1,5 @@
1
1
  /** @jsx jsx */
2
2
  import { jsx } from '@emotion/react';
3
- import { PureComponent } from 'react';
4
- import PropTypes from 'prop-types';
5
3
  export type EditorProduct = 'bitbucket' | 'jira' | 'confluence' | 'stride' | undefined;
6
4
  export interface Props {
7
5
  /** @deprecated To pass package version use feedbackInfo property – <Editor feedbackInfo={{ packageVersion }} /> */
@@ -26,20 +24,4 @@ declare global {
26
24
  ATL_JQ_PAGE_PROPS: any;
27
25
  }
28
26
  }
29
- export default class ToolbarFeedback extends PureComponent<Props, State> {
30
- static contextTypes: {
31
- editorActions: PropTypes.Validator<object>;
32
- };
33
- state: State;
34
- constructor(props: Props);
35
- private handleRef;
36
- showJiraCollectorDialogCallback?: () => void;
37
- private getFeedbackInfo;
38
- render(): jsx.JSX.Element | null;
39
- private collectFeedback;
40
- private toggleShowOptOutOption;
41
- private openJiraIssueCollector;
42
- private openFeedbackPopup;
43
- private openLearnMorePage;
44
- private hasJquery;
45
- }
27
+ export default function ToolbarFeedback(props: Props): jsx.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "187.28.0",
3
+ "version": "187.28.2",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -73,7 +73,7 @@
73
73
  "@atlaskit/editor-plugin-guideline": "^0.3.4",
74
74
  "@atlaskit/editor-plugin-hyperlink": "^0.3.0",
75
75
  "@atlaskit/editor-plugin-image-upload": "^0.1.0",
76
- "@atlaskit/editor-plugin-list": "^0.1.0",
76
+ "@atlaskit/editor-plugin-list": "^0.2.0",
77
77
  "@atlaskit/editor-plugin-table": "^2.10.0",
78
78
  "@atlaskit/editor-plugin-text-formatting": "^0.2.0",
79
79
  "@atlaskit/editor-plugin-width": "^0.1.0",
package/report.api.md CHANGED
@@ -51,7 +51,7 @@ import type { DirectEditorProps } from '@atlaskit/editor-prosemirror/view';
51
51
  import { Dispatch } from '@atlaskit/editor-common/event-dispatcher';
52
52
  import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
53
53
  import type { EditorActionsOptions } from '@atlaskit/editor-common/types';
54
- import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
54
+ import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
55
55
  import { EditorAppearance } from '@atlaskit/editor-common/types';
56
56
  import type { EditorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
57
57
  import { FeatureFlags as EditorFeatureFlags } from '@atlaskit/editor-common/types';
@@ -61,7 +61,6 @@ import { EditorReactContext } from '@atlaskit/editor-common/types';
61
61
  import type { EditorSelectionAPI } from '@atlaskit/editor-common/selection';
62
62
  import { EditorState } from '@atlaskit/editor-prosemirror/state';
63
63
  import { EditorView } from '@atlaskit/editor-prosemirror/view';
64
- import { EditorView as EditorView_2 } from 'prosemirror-view';
65
64
  import { EmojiResource } from '@atlaskit/emoji/resource';
66
65
  import { EmptyStateHandler } from '@atlaskit/editor-common/types';
67
66
  import type { ErrorReporter } from '@atlaskit/editor-common/utils';
@@ -94,6 +93,7 @@ import { JSONDocNode } from '@atlaskit/editor-json-transformer/types';
94
93
  import { jsx } from '@emotion/react';
95
94
  import { lightModeStatusColorPalette } from '@atlaskit/editor-common/ui-color';
96
95
  import type { LinkingOptions } from '@atlaskit/editor-common/types';
96
+ import { ListState } from '@atlaskit/editor-plugin-list';
97
97
  import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
98
98
  import { MacroAttributes } from '@atlaskit/editor-common/provider-factory';
99
99
  import { MacroProvider } from '@atlaskit/editor-common/provider-factory';
@@ -131,7 +131,6 @@ import PropTypes from 'prop-types';
131
131
  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
- import { PureComponent } from 'react';
135
134
  import { QuickInsertItem } from '@atlaskit/editor-common/provider-factory';
136
135
  import type { QuickInsertOptions } from '@atlaskit/editor-common/types';
137
136
  import type { QuickInsertPluginOptions } from '@atlaskit/editor-common/types';
@@ -1053,25 +1052,6 @@ export function getDefaultPresetOptionsFromEditorProps(
1053
1052
  createAnalyticsEvent?: CreateUIAnalyticsEvent,
1054
1053
  ): EditorPresetProps & DefaultPresetPluginOptions & EditorPluginFeatureProps;
1055
1054
 
1056
- // @public (undocumented)
1057
- export const getListCommands: () => {
1058
- indentList: (
1059
- editorAnalyticsAPI: EditorAnalyticsAPI | undefined,
1060
- ) => (inputMethod?: INPUT_METHOD | INPUT_METHOD) => Command;
1061
- outdentList: (
1062
- editorAnalyticsAPI: EditorAnalyticsAPI | undefined,
1063
- ) => (
1064
- inputMethod: (INPUT_METHOD | INPUT_METHOD) | undefined,
1065
- featureFlags: EditorFeatureFlags,
1066
- ) => Command;
1067
- toggleOrderedList: (
1068
- editorAnalyticsAPI: EditorAnalyticsAPI | undefined,
1069
- ) => (view: EditorView_2, inputMethod?: ListInputMethod) => boolean;
1070
- toggleBulletList: (
1071
- editorAnalyticsAPI: EditorAnalyticsAPI | undefined,
1072
- ) => (view: EditorView_2, inputMethod?: ListInputMethod) => boolean;
1073
- };
1074
-
1075
1055
  // @public (undocumented)
1076
1056
  export function getNodesCount(node: Node_2): Record<string, number>;
1077
1057
 
@@ -1208,19 +1188,7 @@ type Listener = (data: any) => void;
1208
1188
  // @public (undocumented)
1209
1189
  export type ListInputMethod = INPUT_METHOD.KEYBOARD | INPUT_METHOD.TOOLBAR;
1210
1190
 
1211
- // @public (undocumented)
1212
- export interface ListState {
1213
- // (undocumented)
1214
- bulletListActive: boolean;
1215
- // (undocumented)
1216
- bulletListDisabled: boolean;
1217
- // (undocumented)
1218
- decorationSet: DecorationSet;
1219
- // (undocumented)
1220
- orderedListActive: boolean;
1221
- // (undocumented)
1222
- orderedListDisabled: boolean;
1223
- }
1191
+ export { ListState };
1224
1192
 
1225
1193
  // @public (undocumented)
1226
1194
  export const listStateKey: PluginKey<ListState>;
@@ -1959,16 +1927,6 @@ interface SimpleEntry {
1959
1927
  // @public (undocumented)
1960
1928
  interface State {}
1961
1929
 
1962
- // @public (undocumented)
1963
- interface State_2 {
1964
- // (undocumented)
1965
- jiraIssueCollectorScriptLoading: boolean;
1966
- // (undocumented)
1967
- showOptOutOption?: boolean;
1968
- // (undocumented)
1969
- target?: HTMLElement;
1970
- }
1971
-
1972
1930
  // @public (undocumented)
1973
1931
  export const statusMessages: {
1974
1932
  placeholder: {
@@ -2080,19 +2038,7 @@ interface TextSelectionData {
2080
2038
  }
2081
2039
 
2082
2040
  // @public (undocumented)
2083
- export class ToolbarFeedback extends PureComponent<Props_3, State_2> {
2084
- constructor(props: Props_3);
2085
- // (undocumented)
2086
- static contextTypes: {
2087
- editorActions: PropTypes.Validator<object>;
2088
- };
2089
- // (undocumented)
2090
- render(): jsx.JSX.Element | null;
2091
- // (undocumented)
2092
- showJiraCollectorDialogCallback?: () => void;
2093
- // (undocumented)
2094
- state: State_2;
2095
- }
2041
+ export function ToolbarFeedback(props: Props_3): jsx.JSX.Element;
2096
2042
 
2097
2043
  // @public (undocumented)
2098
2044
  export const ToolbarHelp: React_2.FC<