@atlaskit/editor-core 185.2.25 → 185.2.26

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 (154) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cjs/editor-next/editor-internal.js +3 -3
  3. package/dist/cjs/index.js +4 -4
  4. package/dist/cjs/labs/next/Editor.js +3 -3
  5. package/dist/cjs/nodeviews/index.js +1 -16
  6. package/dist/cjs/plugins/annotation/index.js +31 -21
  7. package/dist/cjs/plugins/annotation/nodeviews/index.js +2 -2
  8. package/dist/cjs/plugins/base/index.js +0 -6
  9. package/dist/cjs/plugins/caption/index.js +1 -2
  10. package/dist/cjs/plugins/caption/nodeviews/index.js +3 -3
  11. package/dist/cjs/plugins/caption/pm-plugins/main.js +4 -2
  12. package/dist/cjs/plugins/card/nodeviews/embedCard.js +4 -4
  13. package/dist/cjs/plugins/extension/nodeviews/extension.js +2 -2
  14. package/dist/cjs/plugins/jira-issue/index.js +2 -2
  15. package/dist/cjs/plugins/media/index.js +2 -2
  16. package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +25 -19
  17. package/dist/cjs/plugins/media/nodeviews/mediaInline.js +3 -3
  18. package/dist/cjs/plugins/media/nodeviews/mediaNodeView/index.js +16 -10
  19. package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -2
  20. package/dist/cjs/plugins/media/pm-plugins/main.js +25 -8
  21. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/decisionItem.js +2 -2
  22. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +2 -2
  23. package/dist/cjs/plugins/unsupported-content/index.js +6 -4
  24. package/dist/cjs/test-utils.js +0 -7
  25. package/dist/cjs/version-wrapper.js +1 -1
  26. package/dist/cjs/version.json +1 -1
  27. package/dist/es2019/editor-next/editor-internal.js +1 -1
  28. package/dist/es2019/index.js +1 -1
  29. package/dist/es2019/labs/next/Editor.js +1 -1
  30. package/dist/es2019/nodeviews/index.js +1 -2
  31. package/dist/es2019/plugins/annotation/index.js +34 -23
  32. package/dist/es2019/plugins/annotation/nodeviews/index.js +1 -1
  33. package/dist/es2019/plugins/base/index.js +0 -4
  34. package/dist/es2019/plugins/caption/index.js +1 -4
  35. package/dist/es2019/plugins/caption/nodeviews/index.js +2 -2
  36. package/dist/es2019/plugins/caption/pm-plugins/main.js +4 -2
  37. package/dist/es2019/plugins/card/nodeviews/embedCard.js +2 -2
  38. package/dist/es2019/plugins/extension/nodeviews/extension.js +1 -1
  39. package/dist/es2019/plugins/jira-issue/index.js +1 -1
  40. package/dist/es2019/plugins/media/index.js +2 -2
  41. package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +21 -14
  42. package/dist/es2019/plugins/media/nodeviews/mediaInline.js +2 -2
  43. package/dist/es2019/plugins/media/nodeviews/mediaNodeView/index.js +13 -9
  44. package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +1 -1
  45. package/dist/es2019/plugins/media/pm-plugins/main.js +28 -11
  46. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
  47. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
  48. package/dist/es2019/plugins/unsupported-content/index.js +1 -1
  49. package/dist/es2019/test-utils.js +0 -1
  50. package/dist/es2019/version-wrapper.js +1 -1
  51. package/dist/es2019/version.json +1 -1
  52. package/dist/esm/editor-next/editor-internal.js +1 -1
  53. package/dist/esm/index.js +1 -1
  54. package/dist/esm/labs/next/Editor.js +1 -1
  55. package/dist/esm/nodeviews/index.js +1 -2
  56. package/dist/esm/plugins/annotation/index.js +32 -22
  57. package/dist/esm/plugins/annotation/nodeviews/index.js +1 -1
  58. package/dist/esm/plugins/base/index.js +0 -6
  59. package/dist/esm/plugins/caption/index.js +1 -2
  60. package/dist/esm/plugins/caption/nodeviews/index.js +2 -2
  61. package/dist/esm/plugins/caption/pm-plugins/main.js +4 -2
  62. package/dist/esm/plugins/card/nodeviews/embedCard.js +4 -4
  63. package/dist/esm/plugins/extension/nodeviews/extension.js +1 -1
  64. package/dist/esm/plugins/jira-issue/index.js +1 -1
  65. package/dist/esm/plugins/media/index.js +2 -2
  66. package/dist/esm/plugins/media/nodeviews/mediaGroup.js +24 -18
  67. package/dist/esm/plugins/media/nodeviews/mediaInline.js +2 -2
  68. package/dist/esm/plugins/media/nodeviews/mediaNodeView/index.js +15 -9
  69. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +1 -1
  70. package/dist/esm/plugins/media/pm-plugins/main.js +26 -9
  71. package/dist/esm/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
  72. package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
  73. package/dist/esm/plugins/unsupported-content/index.js +1 -1
  74. package/dist/esm/test-utils.js +0 -1
  75. package/dist/esm/version-wrapper.js +1 -1
  76. package/dist/esm/version.json +1 -1
  77. package/dist/types/create-editor/ReactEditorViewInternal.d.ts +1 -1
  78. package/dist/types/index.d.ts +1 -1
  79. package/dist/types/labs/next/internal/components/EditorInternal.d.ts +2 -2
  80. package/dist/types/labs/next/internal/editor-props-type.d.ts +1 -1
  81. package/dist/types/labs/next/internal/hooks/use-editor/create-editor.d.ts +1 -1
  82. package/dist/types/nodeviews/index.d.ts +0 -2
  83. package/dist/types/plugins/annotation/index.d.ts +3 -1
  84. package/dist/types/plugins/annotation/nodeviews/index.d.ts +2 -1
  85. package/dist/types/plugins/annotation/pm-plugins/types.d.ts +2 -2
  86. package/dist/types/plugins/caption/index.d.ts +1 -1
  87. package/dist/types/plugins/caption/nodeviews/index.d.ts +7 -4
  88. package/dist/types/plugins/caption/pm-plugins/main.d.ts +5 -4
  89. package/dist/types/plugins/card/nodeviews/embedCard.d.ts +2 -2
  90. package/dist/types/plugins/extension/nodeviews/extension.d.ts +3 -2
  91. package/dist/types/plugins/extension/pm-plugins/main.d.ts +2 -2
  92. package/dist/types/plugins/media/index.d.ts +3 -1
  93. package/dist/types/plugins/media/nodeviews/mediaGroup.d.ts +5 -3
  94. package/dist/types/plugins/media/nodeviews/mediaInline.d.ts +6 -3
  95. package/dist/types/plugins/media/nodeviews/mediaNodeView/index.d.ts +6 -4
  96. package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +2 -2
  97. package/dist/types/plugins/media/types.d.ts +4 -0
  98. package/dist/types/plugins/tasks-and-decisions/nodeviews/decisionItem.d.ts +1 -1
  99. package/dist/types/plugins/tasks-and-decisions/nodeviews/taskItem.d.ts +1 -1
  100. package/dist/types/plugins/tasks-and-decisions/pm-plugins/main.d.ts +1 -1
  101. package/dist/types/test-utils.d.ts +0 -1
  102. package/dist/types-ts4.5/create-editor/ReactEditorViewInternal.d.ts +1 -1
  103. package/dist/types-ts4.5/index.d.ts +1 -1
  104. package/dist/types-ts4.5/labs/next/internal/components/EditorInternal.d.ts +2 -2
  105. package/dist/types-ts4.5/labs/next/internal/editor-props-type.d.ts +1 -1
  106. package/dist/types-ts4.5/labs/next/internal/hooks/use-editor/create-editor.d.ts +1 -1
  107. package/dist/types-ts4.5/nodeviews/index.d.ts +0 -2
  108. package/dist/types-ts4.5/plugins/annotation/index.d.ts +3 -1
  109. package/dist/types-ts4.5/plugins/annotation/nodeviews/index.d.ts +2 -1
  110. package/dist/types-ts4.5/plugins/annotation/pm-plugins/types.d.ts +2 -2
  111. package/dist/types-ts4.5/plugins/caption/index.d.ts +1 -1
  112. package/dist/types-ts4.5/plugins/caption/nodeviews/index.d.ts +7 -4
  113. package/dist/types-ts4.5/plugins/caption/pm-plugins/main.d.ts +5 -4
  114. package/dist/types-ts4.5/plugins/card/nodeviews/embedCard.d.ts +2 -2
  115. package/dist/types-ts4.5/plugins/extension/nodeviews/extension.d.ts +3 -2
  116. package/dist/types-ts4.5/plugins/extension/pm-plugins/main.d.ts +2 -2
  117. package/dist/types-ts4.5/plugins/media/index.d.ts +3 -1
  118. package/dist/types-ts4.5/plugins/media/nodeviews/mediaGroup.d.ts +5 -3
  119. package/dist/types-ts4.5/plugins/media/nodeviews/mediaInline.d.ts +6 -3
  120. package/dist/types-ts4.5/plugins/media/nodeviews/mediaNodeView/index.d.ts +6 -4
  121. package/dist/types-ts4.5/plugins/media/nodeviews/mediaSingle.d.ts +2 -2
  122. package/dist/types-ts4.5/plugins/media/types.d.ts +4 -0
  123. package/dist/types-ts4.5/plugins/tasks-and-decisions/nodeviews/decisionItem.d.ts +1 -1
  124. package/dist/types-ts4.5/plugins/tasks-and-decisions/nodeviews/taskItem.d.ts +1 -1
  125. package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/main.d.ts +1 -1
  126. package/dist/types-ts4.5/test-utils.d.ts +0 -1
  127. package/package.json +2 -2
  128. package/report.api.md +20 -85
  129. package/tmp/api-report-tmp.d.ts +18 -68
  130. package/dist/cjs/nodeviews/ReactNodeView.js +0 -224
  131. package/dist/cjs/nodeviews/SelectionBasedNodeView.js +0 -169
  132. package/dist/cjs/plugins/base/pm-plugins/react-nodeview.js +0 -72
  133. package/dist/cjs/ui/PortalProvider/PortalProviderThemesProvider.js +0 -43
  134. package/dist/cjs/ui/PortalProvider/index.js +0 -252
  135. package/dist/es2019/nodeviews/ReactNodeView.js +0 -170
  136. package/dist/es2019/nodeviews/SelectionBasedNodeView.js +0 -158
  137. package/dist/es2019/plugins/base/pm-plugins/react-nodeview.js +0 -48
  138. package/dist/es2019/ui/PortalProvider/PortalProviderThemesProvider.js +0 -37
  139. package/dist/es2019/ui/PortalProvider/index.js +0 -184
  140. package/dist/esm/nodeviews/ReactNodeView.js +0 -217
  141. package/dist/esm/nodeviews/SelectionBasedNodeView.js +0 -163
  142. package/dist/esm/plugins/base/pm-plugins/react-nodeview.js +0 -62
  143. package/dist/esm/ui/PortalProvider/PortalProviderThemesProvider.js +0 -36
  144. package/dist/esm/ui/PortalProvider/index.js +0 -242
  145. package/dist/types/nodeviews/ReactNodeView.d.ts +0 -52
  146. package/dist/types/nodeviews/SelectionBasedNodeView.d.ts +0 -53
  147. package/dist/types/plugins/base/pm-plugins/react-nodeview.d.ts +0 -13
  148. package/dist/types/ui/PortalProvider/PortalProviderThemesProvider.d.ts +0 -6
  149. package/dist/types/ui/PortalProvider/index.d.ts +0 -51
  150. package/dist/types-ts4.5/nodeviews/ReactNodeView.d.ts +0 -52
  151. package/dist/types-ts4.5/nodeviews/SelectionBasedNodeView.d.ts +0 -53
  152. package/dist/types-ts4.5/plugins/base/pm-plugins/react-nodeview.d.ts +0 -13
  153. package/dist/types-ts4.5/ui/PortalProvider/PortalProviderThemesProvider.d.ts +0 -6
  154. package/dist/types-ts4.5/ui/PortalProvider/index.d.ts +0 -51
@@ -1,9 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import { EditorView } from 'prosemirror-view';
3
3
  import { Node as PMNode } from 'prosemirror-model';
4
- import { getPosHandler, ForwardRef, SelectionBasedNodeView } from '../../../nodeviews/';
5
- import { PortalProviderAPI } from '../../../ui/PortalProvider';
6
- import { EventDispatcher } from '../../../event-dispatcher';
4
+ import { getPosHandler, ForwardRef } from '../../../nodeviews/';
5
+ import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
6
+ import { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
7
+ import { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
8
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
9
+ import type captionPlugin from '../index';
7
10
  export declare class CaptionNodeView extends SelectionBasedNodeView {
8
11
  private selected;
9
12
  createDomRef(): HTMLElement;
@@ -13,4 +16,4 @@ export declare class CaptionNodeView extends SelectionBasedNodeView {
13
16
  render(_props: never, forwardRef: ForwardRef): JSX.Element;
14
17
  viewShouldUpdate(nextNode: PMNode): boolean;
15
18
  }
16
- export default function captionNodeView(portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher): (node: PMNode, view: EditorView, getPos: getPosHandler) => CaptionNodeView;
19
+ export default function captionNodeView(portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginInjectionApi: ExtractInjectionAPI<typeof captionPlugin> | undefined): (node: PMNode, view: EditorView, getPos: getPosHandler) => CaptionNodeView;
@@ -1,7 +1,8 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import { PortalProviderAPI } from '../../../ui/PortalProvider';
3
- import { Dispatch, EventDispatcher } from '../../../event-dispatcher';
2
+ import { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
3
+ import { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
4
4
  import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
5
- import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
6
- declare const _default: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, dispatch: Dispatch, analyticsApi: EditorAnalyticsAPI | undefined) => SafePlugin<any, any>;
5
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
6
+ import type captionPlugin from '../index';
7
+ declare const _default: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, dispatch: Dispatch, pluginInjectionApi: ExtractInjectionAPI<typeof captionPlugin> | undefined) => SafePlugin<any, any>;
7
8
  export default _default;
@@ -3,7 +3,7 @@ import { Node as PMNode } from 'prosemirror-model';
3
3
  import PropTypes from 'prop-types';
4
4
  import { SmartCardProps } from './genericCard';
5
5
  import { RichMediaLayout } from '@atlaskit/adf-schema';
6
- import { SelectionBasedNodeView } from '../../../nodeviews/';
6
+ import ReactNodeView from '@atlaskit/editor-common/react-node-view';
7
7
  export type EmbedCardState = {
8
8
  hasPreview: boolean;
9
9
  liveHeight?: number;
@@ -39,7 +39,7 @@ export declare class EmbedCardComponent extends React.PureComponent<SmartCardPro
39
39
  render(): JSX.Element;
40
40
  }
41
41
  export type EmbedCardNodeViewProps = Pick<SmartCardProps, 'eventDispatcher' | 'allowResizing' | 'platform' | 'fullWidthMode' | 'dispatchAnalyticsEvent' | 'pluginInjectionApi'>;
42
- export declare class EmbedCard extends SelectionBasedNodeView<EmbedCardNodeViewProps> {
42
+ export declare class EmbedCard extends ReactNodeView<EmbedCardNodeViewProps> {
43
43
  viewShouldUpdate(nextNode: PMNode): boolean;
44
44
  createDomRef(): HTMLElement;
45
45
  render(): JSX.Element;
@@ -5,8 +5,9 @@ import type { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
5
5
  import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
6
6
  import { PluginInjectionAPIWithDependency } from '@atlaskit/editor-common/types';
7
7
  import { EditorAppearance } from '../../../types/editor-appearance';
8
- import { ForwardRef, getPosHandler, ReactNodeView } from '../../../nodeviews';
9
- import { PortalProviderAPI } from '../../../ui/PortalProvider';
8
+ import { ForwardRef, getPosHandler } from '../../../nodeviews';
9
+ import ReactNodeView from '@atlaskit/editor-common/react-node-view';
10
+ import { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
10
11
  import { EventDispatcher } from '../../../event-dispatcher';
11
12
  import type { widthPlugin } from '@atlaskit/editor-plugin-width';
12
13
  interface ExtensionNodeViewOptions {
@@ -6,8 +6,8 @@ import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
6
6
  import type { ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
7
7
  import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
8
8
  import { EditorAppearance } from '../../../types/editor-appearance';
9
- import { Dispatch, EventDispatcher } from '../../../event-dispatcher';
10
- import { PortalProviderAPI } from '../../../ui/PortalProvider';
9
+ import { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
10
+ import { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
11
11
  import { getPluginState, createCommand } from '../plugin-factory';
12
12
  import { pluginKey } from '../plugin-key';
13
13
  import type extensionPlugin from '../index';
@@ -10,6 +10,7 @@ import type { widthPlugin } from '@atlaskit/editor-plugin-width';
10
10
  import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
11
11
  import { MediaPluginState } from './pm-plugins/types';
12
12
  import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
13
+ import type editorDisabled from '../editor-disabled';
13
14
  export type { MediaState, MediaProvider, CustomMediaPicker };
14
15
  export { insertMediaSingleNode } from './utils/media-single';
15
16
  declare const mediaPlugin: NextEditorPlugin<'media', {
@@ -20,7 +21,8 @@ declare const mediaPlugin: NextEditorPlugin<'media', {
20
21
  typeof gridPlugin,
21
22
  typeof widthPlugin,
22
23
  typeof decorationsPlugin,
23
- FloatingToolbarPlugin
24
+ FloatingToolbarPlugin,
25
+ typeof editorDisabled
24
26
  ];
25
27
  sharedState: MediaPluginState | null;
26
28
  }>;
@@ -4,11 +4,13 @@ import { MediaClientConfig } from '@atlaskit/media-core';
4
4
  import { Node as PMNode } from 'prosemirror-model';
5
5
  import { EditorView, NodeView } from 'prosemirror-view';
6
6
  import React from 'react';
7
- import { EventDispatcher } from '../../../event-dispatcher';
7
+ import { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
8
8
  import { getPosHandler } from '../../../nodeviews/';
9
- import { PortalProviderAPI } from '../../../ui/PortalProvider';
9
+ import { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
10
10
  import { MediaOptions } from '../types';
11
11
  import { WrappedComponentProps } from 'react-intl-next';
12
+ import type mediaPlugin from '../index';
13
+ import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
12
14
  export type MediaGroupProps = {
13
15
  forwardRef?: (ref: HTMLElement) => void;
14
16
  node: PMNode;
@@ -30,4 +32,4 @@ declare const IntlMediaGroup: React.FC<import("react-intl-next").WithIntlProps<M
30
32
  WrappedComponent: React.ComponentType<MediaGroupProps>;
31
33
  };
32
34
  export default IntlMediaGroup;
33
- export declare const ReactMediaGroupNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions?: MediaOptions) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
35
+ export declare const ReactMediaGroupNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, mediaOptions: MediaOptions | undefined, pluginInjectionApi: ExtractInjectionAPI<typeof mediaPlugin> | undefined) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
@@ -2,14 +2,17 @@ import { Node as PMNode } from 'prosemirror-model';
2
2
  import { EditorView, NodeView } from 'prosemirror-view';
3
3
  import React from 'react';
4
4
  import { EventDispatcher } from '../../../event-dispatcher';
5
- import { getPosHandler, ProsemirrorGetPosHandler, SelectionBasedNodeView } from '../../../nodeviews/';
5
+ import { getPosHandler, ProsemirrorGetPosHandler } from '../../../nodeviews/';
6
+ import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
6
7
  import { FileIdentifier } from '@atlaskit/media-client';
7
8
  import { ProviderFactory, ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
8
9
  import type { MediaProvider } from '@atlaskit/editor-common/provider-factory';
9
- import { PortalProviderAPI } from '../../../../src/ui/PortalProvider';
10
+ import { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
10
11
  import { MediaPluginState } from '../pm-plugins/types';
11
12
  import { MediaNodeUpdater } from './mediaNodeUpdater';
12
13
  import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
14
+ import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
15
+ import type mediaPlugin from '../index';
13
16
  export interface MediaInlineProps {
14
17
  mediaProvider: Promise<MediaProvider>;
15
18
  identifier: FileIdentifier;
@@ -44,4 +47,4 @@ export declare class MediaInlineNodeView extends SelectionBasedNodeView<MediaInl
44
47
  viewShouldUpdate(nextNode: PMNode): boolean;
45
48
  render(props: MediaInlineNodeViewProps): JSX.Element;
46
49
  }
47
- export declare const ReactMediaInlineNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, dispatchAnalyticsEvent?: DispatchAnalyticsEvent) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
50
+ export declare const ReactMediaInlineNode: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, pluginInjectionApi: ExtractInjectionAPI<typeof mediaPlugin> | undefined, dispatchAnalyticsEvent?: DispatchAnalyticsEvent) => (node: PMNode, view: EditorView, getPos: getPosHandler) => NodeView;
@@ -3,18 +3,20 @@ import { MediaADFAttrs } from '@atlaskit/adf-schema';
3
3
  import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
4
4
  import type { Providers, MediaProvider, ContextIdentifierProvider } from '@atlaskit/editor-common/provider-factory';
5
5
  import { Node as PMNode } from 'prosemirror-model';
6
- import { EditorView } from 'prosemirror-view';
6
+ import { EditorView, Decoration } from 'prosemirror-view';
7
7
  import { EventDispatcher } from '../../../../event-dispatcher';
8
- import { getPosHandler, SelectionBasedNodeView } from '../../../../nodeviews';
9
- import { PortalProviderAPI } from '../../../../ui/PortalProvider';
8
+ import { getPosHandler } from '../../../../nodeviews';
9
+ import { SelectionBasedNodeView } from '@atlaskit/editor-common/selection-based-node-view';
10
+ import { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
10
11
  import type { WidthPluginState } from '@atlaskit/editor-plugin-width';
11
12
  import { MediaOptions } from '../../types';
12
13
  import { MediaNodeViewProps } from '../types';
13
14
  import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
14
15
  import type mediaPlugin from '../../index';
15
16
  declare class MediaNodeView extends SelectionBasedNodeView<MediaNodeViewProps> {
17
+ private isSelected;
16
18
  createDomRef(): HTMLElement;
17
- viewShouldUpdate(nextNode: PMNode): boolean;
19
+ viewShouldUpdate(nextNode: PMNode, decorations: Decoration[]): boolean;
18
20
  stopEvent(event: Event): boolean;
19
21
  getAttrs(): MediaADFAttrs;
20
22
  isMediaBlobUrl(): boolean;
@@ -11,12 +11,12 @@ import { CardEvent } from '@atlaskit/media-card';
11
11
  import { MediaClientConfig } from '@atlaskit/media-core';
12
12
  import { getPosHandler, ForwardRef } from '../../../nodeviews/';
13
13
  import { EventDispatcher } from '../../../event-dispatcher';
14
- import { PortalProviderAPI } from '../../../ui/PortalProvider';
14
+ import { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
15
15
  import { MediaOptions } from '../types';
16
16
  import { MediaSingleNodeProps, MediaSingleNodeViewProps } from './types';
17
17
  import { MediaNodeUpdater } from './mediaNodeUpdater';
18
18
  import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
19
- import ReactNodeView from '../../../nodeviews/ReactNodeView';
19
+ import ReactNodeView from '@atlaskit/editor-common/react-node-view';
20
20
  import type mediaPlugin from '../index';
21
21
  export interface MediaSingleNodeState {
22
22
  width?: number;
@@ -100,3 +100,7 @@ export type MediaFloatingToolbarOptions = {
100
100
  altTextValidator?: (value: string) => string[];
101
101
  getEditorFeatureFlags?: GetEditorFeatureFlags;
102
102
  };
103
+ export type MediaDecorationSpec = {
104
+ type: 'media';
105
+ selected: boolean;
106
+ };
@@ -1,5 +1,5 @@
1
1
  import { NodeView } from 'prosemirror-view';
2
2
  import { EventDispatcher } from '../../../event-dispatcher';
3
3
  import { getPosHandler } from '../../../nodeviews';
4
- import { PortalProviderAPI } from '../../../ui/PortalProvider';
4
+ import { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
5
5
  export declare const decisionItemNodeView: (portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher) => (node: any, view: any, getPos: getPosHandler) => NodeView;
@@ -2,7 +2,7 @@ import { NodeView } from 'prosemirror-view';
2
2
  import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
3
3
  import { EventDispatcher } from '../../../event-dispatcher';
4
4
  import { getPosHandler } from '../../../nodeviews';
5
- import { PortalProviderAPI } from '../../../ui/PortalProvider';
5
+ import { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
6
6
  export interface Props {
7
7
  providerFactory: ProviderFactory;
8
8
  }
@@ -1,5 +1,5 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
3
3
  import { Dispatch, EventDispatcher } from '../../../event-dispatcher';
4
- import { PortalProviderAPI } from '../../../ui/PortalProvider';
4
+ import { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
5
5
  export declare function createPlugin(portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, providerFactory: ProviderFactory, dispatch: Dispatch, useLongPressSelection?: boolean): SafePlugin<any, any>;
@@ -27,7 +27,6 @@ type PluginData = {
27
27
  export declare const createPMSchemaAndPlugins: (inputPreset?: EditorPresetBuilder<string[], AllEditorPresetPluginTypes[]>) => (pluginFactoryParams: Omit<LightPMPluginFactoryParams, 'schema'> & {
28
28
  pluginInjectionAPI: EditorPluginInjectionAPI;
29
29
  }) => PluginData;
30
- export { PortalProviderAPI } from './ui/PortalProvider';
31
30
  export { EventDispatcher } from './event-dispatcher';
32
31
  export type { Dispatch } from './event-dispatcher';
33
32
  export { GapCursorSelection, Side as GapCursorSide, } from './plugins/selection/gap-cursor/selection';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "185.2.25",
3
+ "version": "185.2.26",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -49,7 +49,7 @@
49
49
  "@atlaskit/code": "^14.6.0",
50
50
  "@atlaskit/date": "^0.10.0",
51
51
  "@atlaskit/datetime-picker": "^12.7.0",
52
- "@atlaskit/editor-common": "^74.7.0",
52
+ "@atlaskit/editor-common": "^74.8.0",
53
53
  "@atlaskit/editor-json-transformer": "^8.9.0",
54
54
  "@atlaskit/editor-markdown-transformer": "^5.2.0",
55
55
  "@atlaskit/editor-palette": "1.5.0",
package/report.api.md CHANGED
@@ -121,6 +121,9 @@ import { PerformanceTracking } from '@atlaskit/editor-common/types';
121
121
  import { PluginConfig } from '@atlaskit/editor-plugin-table/types';
122
122
  import { PluginKey } from 'prosemirror-state';
123
123
  import { PMPlugin } from '@atlaskit/editor-common/types';
124
+ import { PortalProvider } from '@atlaskit/editor-common/portal-provider';
125
+ import { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
126
+ import { PortalRenderer } from '@atlaskit/editor-common/portal-provider';
124
127
  import { PositionType } from '@atlaskit/tooltip/types';
125
128
  import { PresenceProvider } from '@atlaskit/mention/resource';
126
129
  import { PresenceResource } from '@atlaskit/mention/resource';
@@ -147,7 +150,6 @@ import { setTextSelection } from '@atlaskit/editor-common/utils';
147
150
  import { SEVERITY } from '@atlaskit/editor-common/utils';
148
151
  import { TaskDecisionProvider } from '@atlaskit/task-decision';
149
152
  import { TeamMentionResource } from '@atlaskit/mention/team-resource';
150
- import type { ThemeModes } from '@atlaskit/theme/types';
151
153
  import { ToolbarUIComponentFactory } from '@atlaskit/editor-common/types';
152
154
  import { Transaction } from 'prosemirror-state';
153
155
  import { TransactionTracking } from '@atlaskit/editor-common/types';
@@ -259,16 +261,6 @@ interface BasePluginOptions {
259
261
  ufo?: boolean;
260
262
  }
261
263
 
262
- // @public (undocumented)
263
- type BasePortalProviderProps = {
264
- render: (
265
- portalProviderAPI: PortalProviderAPI,
266
- ) => JSX.Element | React_2.ReactChild | null;
267
- onAnalyticsEvent?: FireAnalyticsCallback;
268
- useAnalyticsContext?: boolean;
269
- themeMode?: ThemeModes;
270
- } & WrappedComponentProps;
271
-
272
264
  // @public (undocumented)
273
265
  export class BaseReactEditorView<T = {}> extends ReactEditorView_2<T> {}
274
266
 
@@ -778,6 +770,19 @@ type EditorContextProps = {
778
770
  editorActions?: EditorActions;
779
771
  };
780
772
 
773
+ // @public (undocumented)
774
+ const editorDisabledPlugin: NextEditorPlugin<
775
+ 'editorDisabled',
776
+ {
777
+ sharedState: EditorDisabledPluginState;
778
+ }
779
+ >;
780
+
781
+ // @public (undocumented)
782
+ type EditorDisabledPluginState = {
783
+ editorDisabled: boolean;
784
+ };
785
+
781
786
  export { EditorFeatureFlags };
782
787
 
783
788
  // @public (undocumented)
@@ -1561,6 +1566,7 @@ export const mediaPlugin: NextEditorPlugin<
1561
1566
  typeof widthPlugin,
1562
1567
  typeof decorationsPlugin,
1563
1568
  FloatingToolbarPlugin,
1569
+ typeof editorDisabledPlugin,
1564
1570
  ];
1565
1571
  sharedState: MediaPluginState | null;
1566
1572
  }
@@ -1799,13 +1805,6 @@ type MobileUploadEndEventPayload = {
1799
1805
  };
1800
1806
  };
1801
1807
 
1802
- // @public (undocumented)
1803
- type MountedPortal = {
1804
- children: () => React_2.ReactChild | null;
1805
- hasAnalyticsContext: boolean;
1806
- hasIntlContext: boolean;
1807
- };
1808
-
1809
1808
  // @public (undocumented)
1810
1809
  const name_2: string;
1811
1810
  export { name_2 as name };
@@ -1923,75 +1922,11 @@ interface PlaceholderTextOptions {
1923
1922
  allowInserting?: boolean;
1924
1923
  }
1925
1924
 
1926
- // @public (undocumented)
1927
- export const PortalProvider: React_2.FC<
1928
- WithIntlProps<BasePortalProviderProps>
1929
- > & {
1930
- WrappedComponent: React_2.ComponentType<BasePortalProviderProps>;
1931
- };
1932
-
1933
- // @public (undocumented)
1934
- export class PortalProviderAPI extends EventDispatcher {
1935
- constructor(
1936
- intl: IntlShape,
1937
- onAnalyticsEvent?: FireAnalyticsCallback,
1938
- analyticsContext?: boolean,
1939
- themeMode?: ThemeModes,
1940
- );
1941
- // (undocumented)
1942
- context: any;
1943
- // (undocumented)
1944
- forceUpdate({
1945
- intl,
1946
- themeMode,
1947
- }: {
1948
- intl: IntlShape;
1949
- themeMode: ThemeModes | undefined;
1950
- }): void;
1951
- // (undocumented)
1952
- intl: IntlShape;
1953
- // (undocumented)
1954
- onAnalyticsEvent?: FireAnalyticsCallback;
1955
- // (undocumented)
1956
- portals: Map<HTMLElement, MountedPortal>;
1957
- // (undocumented)
1958
- remove(container: HTMLElement): void;
1959
- // (undocumented)
1960
- render(
1961
- children: () => JSX.Element | React_2.ReactChild | null,
1962
- container: HTMLElement,
1963
- hasAnalyticsContext?: boolean,
1964
- hasIntlContext?: boolean,
1965
- ): void;
1966
- // (undocumented)
1967
- setContext: (context: any) => void;
1968
- // (undocumented)
1969
- themeMode?: ThemeModes;
1970
- // (undocumented)
1971
- useAnalyticsContext?: boolean;
1972
- }
1973
-
1974
- // @public (undocumented)
1975
- export class PortalRenderer extends React_2.Component<
1976
- {
1977
- portalProviderAPI: PortalProviderAPI;
1978
- },
1979
- PortalRendererState
1980
- > {
1981
- constructor(props: { portalProviderAPI: PortalProviderAPI });
1982
- // (undocumented)
1983
- handleUpdate: (portals: Portals) => void;
1984
- // (undocumented)
1985
- render(): JSX.Element;
1986
- }
1925
+ export { PortalProvider };
1987
1926
 
1988
- // @public (undocumented)
1989
- type PortalRendererState = {
1990
- portals: Portals;
1991
- };
1927
+ export { PortalProviderAPI };
1992
1928
 
1993
- // @public (undocumented)
1994
- type Portals = Map<HTMLElement, React_2.ReactChild>;
1929
+ export { PortalRenderer };
1995
1930
 
1996
1931
  // @public (undocumented)
1997
1932
  type Predicate = (state: EditorState, view?: EditorView) => boolean;
@@ -110,6 +110,9 @@ import { PerformanceTracking } from '@atlaskit/editor-common/types';
110
110
  import { PluginConfig } from '@atlaskit/editor-plugin-table/types';
111
111
  import { PluginKey } from 'prosemirror-state';
112
112
  import { PMPlugin } from '@atlaskit/editor-common/types';
113
+ import { PortalProvider } from '@atlaskit/editor-common/portal-provider';
114
+ import { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
115
+ import { PortalRenderer } from '@atlaskit/editor-common/portal-provider';
113
116
  import { PositionType } from '@atlaskit/tooltip/types';
114
117
  import { PresenceProvider } from '@atlaskit/mention/resource';
115
118
  import { PresenceResource } from '@atlaskit/mention/resource';
@@ -136,7 +139,6 @@ import { setTextSelection } from '@atlaskit/editor-common/utils';
136
139
  import { SEVERITY } from '@atlaskit/editor-common/utils';
137
140
  import { TaskDecisionProvider } from '@atlaskit/task-decision';
138
141
  import { TeamMentionResource } from '@atlaskit/mention/team-resource';
139
- import type { ThemeModes } from '@atlaskit/theme/types';
140
142
  import { ToolbarUIComponentFactory } from '@atlaskit/editor-common/types';
141
143
  import { Transaction } from 'prosemirror-state';
142
144
  import { TransactionTracking } from '@atlaskit/editor-common/types';
@@ -246,14 +248,6 @@ interface BasePluginOptions {
246
248
  ufo?: boolean;
247
249
  }
248
250
 
249
- // @public (undocumented)
250
- type BasePortalProviderProps = {
251
- render: (portalProviderAPI: PortalProviderAPI) => JSX.Element | React_2.ReactChild | null;
252
- onAnalyticsEvent?: FireAnalyticsCallback;
253
- useAnalyticsContext?: boolean;
254
- themeMode?: ThemeModes;
255
- } & WrappedComponentProps;
256
-
257
251
  // @public (undocumented)
258
252
  export class BaseReactEditorView<T = {}> extends ReactEditorView_2<T> {
259
253
  }
@@ -711,6 +705,16 @@ type EditorContextProps = {
711
705
  editorActions?: EditorActions;
712
706
  };
713
707
 
708
+ // @public (undocumented)
709
+ const editorDisabledPlugin: NextEditorPlugin<'editorDisabled', {
710
+ sharedState: EditorDisabledPluginState;
711
+ }>;
712
+
713
+ // @public (undocumented)
714
+ type EditorDisabledPluginState = {
715
+ editorDisabled: boolean;
716
+ };
717
+
714
718
  export { EditorFeatureFlags }
715
719
 
716
720
  // @public (undocumented)
@@ -1394,7 +1398,8 @@ export const mediaPlugin: NextEditorPlugin<'media', {
1394
1398
  typeof gridPlugin,
1395
1399
  typeof widthPlugin,
1396
1400
  typeof decorationsPlugin,
1397
- FloatingToolbarPlugin
1401
+ FloatingToolbarPlugin,
1402
+ typeof editorDisabledPlugin
1398
1403
  ];
1399
1404
  sharedState: MediaPluginState | null;
1400
1405
  }>;
@@ -1599,13 +1604,6 @@ type MobileUploadEndEventPayload = {
1599
1604
  };
1600
1605
  };
1601
1606
 
1602
- // @public (undocumented)
1603
- type MountedPortal = {
1604
- children: () => React_2.ReactChild | null;
1605
- hasAnalyticsContext: boolean;
1606
- hasIntlContext: boolean;
1607
- };
1608
-
1609
1607
  // @public (undocumented)
1610
1608
  const name_2: string;
1611
1609
  export { name_2 as name }
@@ -1711,59 +1709,11 @@ interface PlaceholderTextOptions {
1711
1709
  allowInserting?: boolean;
1712
1710
  }
1713
1711
 
1714
- // @public (undocumented)
1715
- export const PortalProvider: React_2.FC<WithIntlProps<BasePortalProviderProps>> & {
1716
- WrappedComponent: React_2.ComponentType<BasePortalProviderProps>;
1717
- };
1712
+ export { PortalProvider }
1718
1713
 
1719
- // @public (undocumented)
1720
- export class PortalProviderAPI extends EventDispatcher {
1721
- constructor(intl: IntlShape, onAnalyticsEvent?: FireAnalyticsCallback, analyticsContext?: boolean, themeMode?: ThemeModes);
1722
- // (undocumented)
1723
- context: any;
1724
- // (undocumented)
1725
- forceUpdate({ intl, themeMode, }: {
1726
- intl: IntlShape;
1727
- themeMode: ThemeModes | undefined;
1728
- }): void;
1729
- // (undocumented)
1730
- intl: IntlShape;
1731
- // (undocumented)
1732
- onAnalyticsEvent?: FireAnalyticsCallback;
1733
- // (undocumented)
1734
- portals: Map<HTMLElement, MountedPortal>;
1735
- // (undocumented)
1736
- remove(container: HTMLElement): void;
1737
- // (undocumented)
1738
- render(children: () => JSX.Element | React_2.ReactChild | null, container: HTMLElement, hasAnalyticsContext?: boolean, hasIntlContext?: boolean): void;
1739
- // (undocumented)
1740
- setContext: (context: any) => void;
1741
- // (undocumented)
1742
- themeMode?: ThemeModes;
1743
- // (undocumented)
1744
- useAnalyticsContext?: boolean;
1745
- }
1714
+ export { PortalProviderAPI }
1746
1715
 
1747
- // @public (undocumented)
1748
- export class PortalRenderer extends React_2.Component<{
1749
- portalProviderAPI: PortalProviderAPI;
1750
- }, PortalRendererState> {
1751
- constructor(props: {
1752
- portalProviderAPI: PortalProviderAPI;
1753
- });
1754
- // (undocumented)
1755
- handleUpdate: (portals: Portals) => void;
1756
- // (undocumented)
1757
- render(): JSX.Element;
1758
- }
1759
-
1760
- // @public (undocumented)
1761
- type PortalRendererState = {
1762
- portals: Portals;
1763
- };
1764
-
1765
- // @public (undocumented)
1766
- type Portals = Map<HTMLElement, React_2.ReactChild>;
1716
+ export { PortalRenderer }
1767
1717
 
1768
1718
  // @public (undocumented)
1769
1719
  type Predicate = (state: EditorState, view?: EditorView) => boolean;