@atlaskit/editor-core 185.2.24 → 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.
- package/CHANGELOG.md +14 -0
- package/dist/cjs/editor-next/editor-internal.js +3 -3
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/labs/next/Editor.js +3 -3
- package/dist/cjs/labs/next/presets/universal.js +6 -5
- package/dist/cjs/nodeviews/index.js +1 -16
- package/dist/cjs/plugins/annotation/index.js +31 -21
- package/dist/cjs/plugins/annotation/nodeviews/index.js +2 -2
- package/dist/cjs/plugins/base/index.js +0 -6
- package/dist/cjs/plugins/caption/index.js +1 -2
- package/dist/cjs/plugins/caption/nodeviews/index.js +3 -3
- package/dist/cjs/plugins/caption/pm-plugins/main.js +4 -2
- package/dist/cjs/plugins/card/nodeviews/embedCard.js +4 -4
- package/dist/cjs/plugins/extension/actions.js +6 -4
- package/dist/cjs/plugins/extension/commands.js +19 -16
- package/dist/cjs/plugins/extension/context-panel.js +4 -4
- package/dist/cjs/plugins/extension/extension-api.js +1 -1
- package/dist/cjs/plugins/extension/index.js +11 -4
- package/dist/cjs/plugins/extension/nodeviews/extension.js +2 -2
- package/dist/cjs/plugins/extension/pm-plugins/keymap.js +2 -2
- package/dist/cjs/plugins/extension/pm-plugins/main.js +10 -5
- package/dist/cjs/plugins/extension/toolbar.js +8 -6
- package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +11 -6
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +5 -2
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/plugins/jira-issue/index.js +2 -2
- package/dist/cjs/plugins/media/index.js +2 -2
- package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +25 -19
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +3 -3
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/index.js +16 -10
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -2
- package/dist/cjs/plugins/media/pm-plugins/main.js +25 -8
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/decisionItem.js +2 -2
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +2 -2
- package/dist/cjs/plugins/unsupported-content/index.js +6 -4
- package/dist/cjs/test-utils.js +0 -7
- package/dist/cjs/ui/ContextPanel/index.js +9 -2
- package/dist/cjs/utils/action.js +1 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/editor-next/editor-internal.js +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/labs/next/Editor.js +1 -1
- package/dist/es2019/labs/next/presets/universal.js +7 -6
- package/dist/es2019/nodeviews/index.js +1 -2
- package/dist/es2019/plugins/annotation/index.js +34 -23
- package/dist/es2019/plugins/annotation/nodeviews/index.js +1 -1
- package/dist/es2019/plugins/base/index.js +0 -4
- package/dist/es2019/plugins/caption/index.js +1 -4
- package/dist/es2019/plugins/caption/nodeviews/index.js +2 -2
- package/dist/es2019/plugins/caption/pm-plugins/main.js +4 -2
- package/dist/es2019/plugins/card/nodeviews/embedCard.js +2 -2
- package/dist/es2019/plugins/extension/actions.js +6 -4
- package/dist/es2019/plugins/extension/commands.js +6 -7
- package/dist/es2019/plugins/extension/context-panel.js +4 -4
- package/dist/es2019/plugins/extension/extension-api.js +1 -1
- package/dist/es2019/plugins/extension/index.js +11 -4
- package/dist/es2019/plugins/extension/nodeviews/extension.js +1 -1
- package/dist/es2019/plugins/extension/pm-plugins/keymap.js +2 -2
- package/dist/es2019/plugins/extension/pm-plugins/main.js +10 -5
- package/dist/es2019/plugins/extension/toolbar.js +8 -4
- package/dist/es2019/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +11 -6
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +5 -2
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/plugins/jira-issue/index.js +1 -1
- package/dist/es2019/plugins/media/index.js +2 -2
- package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +21 -14
- package/dist/es2019/plugins/media/nodeviews/mediaInline.js +2 -2
- package/dist/es2019/plugins/media/nodeviews/mediaNodeView/index.js +13 -9
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/es2019/plugins/media/pm-plugins/main.js +28 -11
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
- package/dist/es2019/plugins/unsupported-content/index.js +1 -1
- package/dist/es2019/test-utils.js +0 -1
- package/dist/es2019/ui/ContextPanel/index.js +8 -1
- package/dist/es2019/utils/action.js +1 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/editor-next/editor-internal.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/labs/next/Editor.js +1 -1
- package/dist/esm/labs/next/presets/universal.js +7 -6
- package/dist/esm/nodeviews/index.js +1 -2
- package/dist/esm/plugins/annotation/index.js +32 -22
- package/dist/esm/plugins/annotation/nodeviews/index.js +1 -1
- package/dist/esm/plugins/base/index.js +0 -6
- package/dist/esm/plugins/caption/index.js +1 -2
- package/dist/esm/plugins/caption/nodeviews/index.js +2 -2
- package/dist/esm/plugins/caption/pm-plugins/main.js +4 -2
- package/dist/esm/plugins/card/nodeviews/embedCard.js +4 -4
- package/dist/esm/plugins/extension/actions.js +6 -4
- package/dist/esm/plugins/extension/commands.js +18 -15
- package/dist/esm/plugins/extension/context-panel.js +4 -4
- package/dist/esm/plugins/extension/extension-api.js +1 -1
- package/dist/esm/plugins/extension/index.js +11 -4
- package/dist/esm/plugins/extension/nodeviews/extension.js +1 -1
- package/dist/esm/plugins/extension/pm-plugins/keymap.js +2 -2
- package/dist/esm/plugins/extension/pm-plugins/main.js +10 -5
- package/dist/esm/plugins/extension/toolbar.js +8 -6
- package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +11 -6
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +5 -2
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/plugins/jira-issue/index.js +1 -1
- package/dist/esm/plugins/media/index.js +2 -2
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +24 -18
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +2 -2
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/index.js +15 -9
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/esm/plugins/media/pm-plugins/main.js +26 -9
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
- package/dist/esm/plugins/unsupported-content/index.js +1 -1
- package/dist/esm/test-utils.js +0 -1
- package/dist/esm/ui/ContextPanel/index.js +8 -1
- package/dist/esm/utils/action.js +1 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/ReactEditorViewInternal.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/labs/next/internal/components/EditorInternal.d.ts +2 -2
- package/dist/types/labs/next/internal/editor-props-type.d.ts +1 -1
- package/dist/types/labs/next/internal/hooks/use-editor/create-editor.d.ts +1 -1
- package/dist/types/labs/next/presets/cxhtml.d.ts +18 -2
- package/dist/types/labs/next/presets/default.d.ts +36 -4
- package/dist/types/labs/next/presets/mobile.d.ts +18 -2
- package/dist/types/nodeviews/index.d.ts +0 -2
- package/dist/types/plugins/annotation/index.d.ts +3 -1
- package/dist/types/plugins/annotation/nodeviews/index.d.ts +2 -1
- package/dist/types/plugins/annotation/pm-plugins/types.d.ts +2 -2
- package/dist/types/plugins/caption/index.d.ts +1 -1
- package/dist/types/plugins/caption/nodeviews/index.d.ts +7 -4
- package/dist/types/plugins/caption/pm-plugins/main.d.ts +5 -4
- package/dist/types/plugins/card/nodeviews/embedCard.d.ts +2 -2
- package/dist/types/plugins/extension/actions.d.ts +2 -1
- package/dist/types/plugins/extension/commands.d.ts +4 -3
- package/dist/types/plugins/extension/context-panel.d.ts +2 -1
- package/dist/types/plugins/extension/extension-api.d.ts +2 -0
- package/dist/types/plugins/extension/index.d.ts +4 -2
- package/dist/types/plugins/extension/nodeviews/extension.d.ts +3 -2
- package/dist/types/plugins/extension/pm-plugins/keymap.d.ts +2 -1
- package/dist/types/plugins/extension/pm-plugins/main.d.ts +5 -3
- package/dist/types/plugins/extension/toolbar.d.ts +8 -1
- package/dist/types/plugins/extension/types.d.ts +2 -0
- package/dist/types/plugins/floating-toolbar/ui/ExtensionsPlaceholder.d.ts +2 -0
- package/dist/types/plugins/floating-toolbar/ui/Toolbar.d.ts +7 -3
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/plugins/media/index.d.ts +3 -1
- package/dist/types/plugins/media/nodeviews/mediaGroup.d.ts +5 -3
- package/dist/types/plugins/media/nodeviews/mediaInline.d.ts +6 -3
- package/dist/types/plugins/media/nodeviews/mediaNodeView/index.d.ts +6 -4
- package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +2 -2
- package/dist/types/plugins/media/types.d.ts +4 -0
- package/dist/types/plugins/tasks-and-decisions/nodeviews/decisionItem.d.ts +1 -1
- package/dist/types/plugins/tasks-and-decisions/nodeviews/taskItem.d.ts +1 -1
- package/dist/types/plugins/tasks-and-decisions/pm-plugins/main.d.ts +1 -1
- package/dist/types/test-utils.d.ts +0 -1
- package/dist/types-ts4.5/create-editor/ReactEditorViewInternal.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/labs/next/internal/components/EditorInternal.d.ts +2 -2
- package/dist/types-ts4.5/labs/next/internal/editor-props-type.d.ts +1 -1
- package/dist/types-ts4.5/labs/next/internal/hooks/use-editor/create-editor.d.ts +1 -1
- package/dist/types-ts4.5/labs/next/presets/cxhtml.d.ts +20 -2
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +40 -4
- package/dist/types-ts4.5/labs/next/presets/mobile.d.ts +20 -2
- package/dist/types-ts4.5/nodeviews/index.d.ts +0 -2
- package/dist/types-ts4.5/plugins/annotation/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/annotation/nodeviews/index.d.ts +2 -1
- package/dist/types-ts4.5/plugins/annotation/pm-plugins/types.d.ts +2 -2
- package/dist/types-ts4.5/plugins/caption/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/caption/nodeviews/index.d.ts +7 -4
- package/dist/types-ts4.5/plugins/caption/pm-plugins/main.d.ts +5 -4
- package/dist/types-ts4.5/plugins/card/nodeviews/embedCard.d.ts +2 -2
- package/dist/types-ts4.5/plugins/extension/actions.d.ts +2 -1
- package/dist/types-ts4.5/plugins/extension/commands.d.ts +4 -3
- package/dist/types-ts4.5/plugins/extension/context-panel.d.ts +2 -1
- package/dist/types-ts4.5/plugins/extension/extension-api.d.ts +2 -0
- package/dist/types-ts4.5/plugins/extension/index.d.ts +4 -2
- package/dist/types-ts4.5/plugins/extension/nodeviews/extension.d.ts +3 -2
- package/dist/types-ts4.5/plugins/extension/pm-plugins/keymap.d.ts +2 -1
- package/dist/types-ts4.5/plugins/extension/pm-plugins/main.d.ts +5 -3
- package/dist/types-ts4.5/plugins/extension/toolbar.d.ts +8 -1
- package/dist/types-ts4.5/plugins/extension/types.d.ts +2 -0
- package/dist/types-ts4.5/plugins/floating-toolbar/ui/ExtensionsPlaceholder.d.ts +2 -0
- package/dist/types-ts4.5/plugins/floating-toolbar/ui/Toolbar.d.ts +7 -3
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/media/index.d.ts +3 -1
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaGroup.d.ts +5 -3
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaInline.d.ts +6 -3
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaNodeView/index.d.ts +6 -4
- package/dist/types-ts4.5/plugins/media/nodeviews/mediaSingle.d.ts +2 -2
- package/dist/types-ts4.5/plugins/media/types.d.ts +4 -0
- package/dist/types-ts4.5/plugins/tasks-and-decisions/nodeviews/decisionItem.d.ts +1 -1
- package/dist/types-ts4.5/plugins/tasks-and-decisions/nodeviews/taskItem.d.ts +1 -1
- package/dist/types-ts4.5/plugins/tasks-and-decisions/pm-plugins/main.d.ts +1 -1
- package/dist/types-ts4.5/test-utils.d.ts +0 -1
- package/package.json +3 -2
- package/report.api.md +20 -85
- package/tmp/api-report-tmp.d.ts +18 -68
- package/dist/cjs/nodeviews/ReactNodeView.js +0 -224
- package/dist/cjs/nodeviews/SelectionBasedNodeView.js +0 -169
- package/dist/cjs/plugins/base/pm-plugins/react-nodeview.js +0 -72
- package/dist/cjs/plugins/context-panel/index.js +0 -66
- package/dist/cjs/plugins/context-panel/transforms.js +0 -13
- package/dist/cjs/plugins/context-panel/types.js +0 -5
- package/dist/cjs/ui/PortalProvider/PortalProviderThemesProvider.js +0 -43
- package/dist/cjs/ui/PortalProvider/index.js +0 -252
- package/dist/es2019/nodeviews/ReactNodeView.js +0 -170
- package/dist/es2019/nodeviews/SelectionBasedNodeView.js +0 -158
- package/dist/es2019/plugins/base/pm-plugins/react-nodeview.js +0 -48
- package/dist/es2019/plugins/context-panel/index.js +0 -45
- package/dist/es2019/plugins/context-panel/transforms.js +0 -4
- package/dist/es2019/plugins/context-panel/types.js +0 -1
- package/dist/es2019/ui/PortalProvider/PortalProviderThemesProvider.js +0 -37
- package/dist/es2019/ui/PortalProvider/index.js +0 -184
- package/dist/esm/nodeviews/ReactNodeView.js +0 -217
- package/dist/esm/nodeviews/SelectionBasedNodeView.js +0 -163
- package/dist/esm/plugins/base/pm-plugins/react-nodeview.js +0 -62
- package/dist/esm/plugins/context-panel/index.js +0 -57
- package/dist/esm/plugins/context-panel/transforms.js +0 -6
- package/dist/esm/plugins/context-panel/types.js +0 -1
- package/dist/esm/ui/PortalProvider/PortalProviderThemesProvider.js +0 -36
- package/dist/esm/ui/PortalProvider/index.js +0 -242
- package/dist/types/nodeviews/ReactNodeView.d.ts +0 -52
- package/dist/types/nodeviews/SelectionBasedNodeView.d.ts +0 -53
- package/dist/types/plugins/base/pm-plugins/react-nodeview.d.ts +0 -13
- package/dist/types/plugins/context-panel/index.d.ts +0 -11
- package/dist/types/plugins/context-panel/transforms.d.ts +0 -2
- package/dist/types/plugins/context-panel/types.d.ts +0 -1
- package/dist/types/ui/PortalProvider/PortalProviderThemesProvider.d.ts +0 -6
- package/dist/types/ui/PortalProvider/index.d.ts +0 -51
- package/dist/types-ts4.5/nodeviews/ReactNodeView.d.ts +0 -52
- package/dist/types-ts4.5/nodeviews/SelectionBasedNodeView.d.ts +0 -53
- package/dist/types-ts4.5/plugins/base/pm-plugins/react-nodeview.d.ts +0 -13
- package/dist/types-ts4.5/plugins/context-panel/index.d.ts +0 -11
- package/dist/types-ts4.5/plugins/context-panel/transforms.d.ts +0 -2
- package/dist/types-ts4.5/plugins/context-panel/types.d.ts +0 -1
- package/dist/types-ts4.5/ui/PortalProvider/PortalProviderThemesProvider.d.ts +0 -6
- package/dist/types-ts4.5/ui/PortalProvider/index.d.ts +0 -51
|
@@ -11,7 +11,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
11
11
|
import React from 'react';
|
|
12
12
|
import ReactDOM from 'react-dom';
|
|
13
13
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
14
|
-
import { NodeSelection } from 'prosemirror-state';
|
|
14
|
+
import { NodeSelection, TextSelection, AllSelection } from 'prosemirror-state';
|
|
15
15
|
import { insertPoint } from 'prosemirror-transform';
|
|
16
16
|
import { Decoration, DecorationSet } from 'prosemirror-view';
|
|
17
17
|
import { ErrorReporter, browser } from '@atlaskit/editor-common/utils';
|
|
@@ -32,6 +32,7 @@ import { isInListItem } from '../../../utils';
|
|
|
32
32
|
import { CAPTION_PLACEHOLDER_ID } from '../ui/CaptionPlaceholder';
|
|
33
33
|
import { RawIntlProvider } from 'react-intl-next';
|
|
34
34
|
import { MediaTaskManager } from './mediaTaskManager';
|
|
35
|
+
import { CellSelection } from '@atlaskit/editor-tables/cell-selection';
|
|
35
36
|
export { stateKey } from './plugin-key';
|
|
36
37
|
export var MEDIA_CONTENT_WRAP_CLASS_NAME = 'media-content-wrap';
|
|
37
38
|
var createDropPlaceholder = function createDropPlaceholder(intl, allowDropLine) {
|
|
@@ -621,7 +622,6 @@ export var createPlugin = function createPlugin(_schema, options, reactContext,
|
|
|
621
622
|
// we shift it to the media single parent as other code is opinionated about
|
|
622
623
|
// the selection landing there. In particular the caption insertion and selection
|
|
623
624
|
// action.
|
|
624
|
-
|
|
625
625
|
return newState.tr.setSelection(NodeSelection.create(newState.doc, transaction.selection.$from.pos - 1));
|
|
626
626
|
}
|
|
627
627
|
}
|
|
@@ -645,12 +645,29 @@ export var createPlugin = function createPlugin(_schema, options, reactContext,
|
|
|
645
645
|
},
|
|
646
646
|
props: {
|
|
647
647
|
decorations: function decorations(state) {
|
|
648
|
+
// Use this to indicate that the media node is selected
|
|
649
|
+
var mediaNodes = [];
|
|
650
|
+
var schema = state.schema,
|
|
651
|
+
$anchor = state.selection.$anchor,
|
|
652
|
+
doc = state.doc;
|
|
653
|
+
|
|
654
|
+
// Find any media nodes in the current selection
|
|
655
|
+
if (state.selection instanceof TextSelection || state.selection instanceof AllSelection || state.selection instanceof NodeSelection || state.selection instanceof CellSelection) {
|
|
656
|
+
doc.nodesBetween(state.selection.from, state.selection.to, function (node, pos) {
|
|
657
|
+
if (node.type === schema.nodes.media) {
|
|
658
|
+
mediaNodes.push(Decoration.node(pos, pos + node.nodeSize, {}, {
|
|
659
|
+
type: 'media',
|
|
660
|
+
selected: true
|
|
661
|
+
}));
|
|
662
|
+
return false;
|
|
663
|
+
}
|
|
664
|
+
return true;
|
|
665
|
+
});
|
|
666
|
+
}
|
|
648
667
|
var pluginState = getMediaPluginState(state);
|
|
649
668
|
if (!pluginState.showDropzone) {
|
|
650
|
-
return;
|
|
669
|
+
return DecorationSet.create(state.doc, mediaNodes);
|
|
651
670
|
}
|
|
652
|
-
var schema = state.schema,
|
|
653
|
-
$anchor = state.selection.$anchor;
|
|
654
671
|
|
|
655
672
|
// When a media is already selected
|
|
656
673
|
if (state.selection instanceof NodeSelection) {
|
|
@@ -659,20 +676,20 @@ export var createPlugin = function createPlugin(_schema, options, reactContext,
|
|
|
659
676
|
var deco = Decoration.node(state.selection.from, state.selection.to, {
|
|
660
677
|
class: 'richMedia-selected'
|
|
661
678
|
});
|
|
662
|
-
return DecorationSet.create(state.doc, [deco]);
|
|
679
|
+
return DecorationSet.create(state.doc, [deco].concat(mediaNodes));
|
|
663
680
|
}
|
|
664
|
-
return;
|
|
681
|
+
return DecorationSet.create(state.doc, mediaNodes);
|
|
665
682
|
}
|
|
666
683
|
var pos = $anchor.pos;
|
|
667
684
|
if ($anchor.parent.type !== schema.nodes.paragraph && $anchor.parent.type !== schema.nodes.codeBlock) {
|
|
668
685
|
pos = insertPoint(state.doc, pos, schema.nodes.mediaGroup);
|
|
669
686
|
}
|
|
670
687
|
if (pos === null || pos === undefined) {
|
|
671
|
-
return;
|
|
688
|
+
return DecorationSet.create(state.doc, mediaNodes);
|
|
672
689
|
}
|
|
673
690
|
var dropPlaceholders = [Decoration.widget(pos, dropPlaceholder, {
|
|
674
691
|
key: 'drop-placeholder'
|
|
675
|
-
})];
|
|
692
|
+
})].concat(mediaNodes);
|
|
676
693
|
return DecorationSet.create(state.doc, dropPlaceholders);
|
|
677
694
|
},
|
|
678
695
|
nodeViews: options.nodeViews,
|
|
@@ -7,7 +7,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
7
7
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
8
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import
|
|
10
|
+
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
11
11
|
import DecisionItem from '../ui/Decision';
|
|
12
12
|
import { isTypeAheadOpen } from '../../type-ahead/utils';
|
|
13
13
|
var Decision = /*#__PURE__*/function (_ReactNodeView) {
|
|
@@ -13,7 +13,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import { AnalyticsListener } from '@atlaskit/analytics-next';
|
|
15
15
|
import { SetAttrsStep } from '@atlaskit/adf-schema/steps';
|
|
16
|
-
import
|
|
16
|
+
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
17
17
|
import WithPluginState from '../../../ui/WithPluginState';
|
|
18
18
|
import { stateKey as taskPluginKey } from '../pm-plugins/plugin-key';
|
|
19
19
|
import TaskItem from '../ui/Task';
|
|
@@ -3,7 +3,7 @@ import { PluginKey } from 'prosemirror-state';
|
|
|
3
3
|
import { confluenceUnsupportedBlock, confluenceUnsupportedInline, unsupportedBlock, unsupportedInline, unsupportedMark, unsupportedNodeAttribute } from '@atlaskit/adf-schema';
|
|
4
4
|
import { UnsupportedBlock } from '@atlaskit/editor-common/ui';
|
|
5
5
|
import { UnsupportedInlineNodeView } from './unsupported-inline-node-view';
|
|
6
|
-
import
|
|
6
|
+
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
7
7
|
import { getInlineNodeViewProducer } from '@atlaskit/editor-common/react-node-view';
|
|
8
8
|
export var pluginKey = new PluginKey('unsupportedContentPlugin');
|
|
9
9
|
var createPlugin = function createPlugin(pmPluginFactoryParams) {
|
package/dist/esm/test-utils.js
CHANGED
|
@@ -90,7 +90,6 @@ export var createPMSchemaAndPlugins = function createPMSchemaAndPlugins() {
|
|
|
90
90
|
};
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
|
-
export { PortalProviderAPI } from './ui/PortalProvider';
|
|
94
93
|
export { EventDispatcher } from './event-dispatcher';
|
|
95
94
|
export { GapCursorSelection, Side as GapCursorSide } from './plugins/selection/gap-cursor/selection';
|
|
96
95
|
export function setTextSelection(view, anchor, head) {
|
|
@@ -22,7 +22,6 @@ import { N30 } from '@atlaskit/theme/colors';
|
|
|
22
22
|
import { akEditorSwoopCubicBezier, akEditorDefaultLayoutWidth, akEditorWideLayoutWidth, akEditorBreakoutPadding, akEditorContextPanelWidth, ATLASSIAN_NAVIGATION_HEIGHT } from '@atlaskit/editor-shared-styles';
|
|
23
23
|
import { ContextPanelConsumer } from '@atlaskit/editor-common/ui';
|
|
24
24
|
import WithPluginState from '../WithPluginState';
|
|
25
|
-
import { pluginKey as contextPanelPluginKey } from '../../plugins/context-panel';
|
|
26
25
|
import WithEditorActions from '../WithEditorActions';
|
|
27
26
|
import { getChildBreakoutModes } from '../../utils/document';
|
|
28
27
|
import { WidthContext } from '@atlaskit/editor-common/ui';
|
|
@@ -170,6 +169,14 @@ var widthPluginKey = {
|
|
|
170
169
|
return state['widthPlugin$'];
|
|
171
170
|
}
|
|
172
171
|
};
|
|
172
|
+
|
|
173
|
+
// @ts-ignore
|
|
174
|
+
var contextPanelPluginKey = {
|
|
175
|
+
key: 'contextPanelPluginKey$',
|
|
176
|
+
getState: function getState(state) {
|
|
177
|
+
return state['contextPanelPluginKey$'];
|
|
178
|
+
}
|
|
179
|
+
};
|
|
173
180
|
function ContextPanelWithActions(_ref2) {
|
|
174
181
|
var actions = _ref2.actions,
|
|
175
182
|
props = _objectWithoutProperties(_ref2, _excluded);
|
package/dist/esm/utils/action.js
CHANGED
|
@@ -20,7 +20,7 @@ function _temporaryFixForConfigPanel() {
|
|
|
20
20
|
}
|
|
21
21
|
_context.next = 4;
|
|
22
22
|
return new Promise(function (resolve) {
|
|
23
|
-
forceAutoSave(resolve)(editorView.state, editorView.dispatch);
|
|
23
|
+
forceAutoSave(extensionPluginState.applyChangeToContextPanel)(resolve)(editorView.state, editorView.dispatch);
|
|
24
24
|
});
|
|
25
25
|
case 4:
|
|
26
26
|
case "end":
|
package/dist/esm/version.json
CHANGED
|
@@ -13,7 +13,7 @@ import { Dispatch, EventDispatcher } from '../event-dispatcher';
|
|
|
13
13
|
import { AnalyticsEventPayload, DispatchAnalyticsEvent, FULL_WIDTH_MODE } from '@atlaskit/editor-common/analytics';
|
|
14
14
|
import { EditorAppearance, EditorConfig, EditorReactContext, EditorPlugin, EditorProps } from '../types';
|
|
15
15
|
import type { EditorNextProps } from '../types/editor-props';
|
|
16
|
-
import { PortalProviderAPI } from '
|
|
16
|
+
import { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
17
17
|
import { SEVERITY } from '@atlaskit/editor-common/utils';
|
|
18
18
|
import { TransactionTracker } from '../utils/performance/track-transactions';
|
|
19
19
|
import type { FireAnalyticsCallback } from '@atlaskit/editor-common/analytics';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -68,7 +68,7 @@ export { getDefaultPresetOptionsFromEditorProps } from './create-editor';
|
|
|
68
68
|
export type { Command, EditorPlugin, EditorProps, EditorInstance, CommandDispatch, } from './types';
|
|
69
69
|
export { default as EditorActions } from './actions';
|
|
70
70
|
export type { MacroProvider, MacroAttributes, ExtensionType, CardProvider, } from '@atlaskit/editor-common/provider-factory';
|
|
71
|
-
export { PortalProvider, PortalProviderAPI, PortalRenderer, } from '
|
|
71
|
+
export { PortalProvider, PortalProviderAPI, PortalRenderer, } from '@atlaskit/editor-common/portal-provider';
|
|
72
72
|
export { GapCursorSelection, Side as GapCursorSide, } from './plugins/selection/gap-cursor-selection';
|
|
73
73
|
export type { HistoryPluginState } from './plugins/history/types';
|
|
74
74
|
export type { MentionPluginState } from './plugins/mentions/types';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
export declare const EditorInternal: React.FC<import("react-intl-next").WithIntlProps<import("../editor-props-type").EditorProps & {
|
|
4
|
-
portalProviderAPI: import("
|
|
4
|
+
portalProviderAPI: import("@atlaskit/editor-common/portal-provider").PortalProviderAPI;
|
|
5
5
|
} & WrappedComponentProps<"intl">>> & {
|
|
6
6
|
WrappedComponent: React.ComponentType<import("../editor-props-type").EditorProps & {
|
|
7
|
-
portalProviderAPI: import("
|
|
7
|
+
portalProviderAPI: import("@atlaskit/editor-common/portal-provider").PortalProviderAPI;
|
|
8
8
|
} & WrappedComponentProps<"intl">>;
|
|
9
9
|
};
|
|
@@ -4,7 +4,7 @@ import EditorActions from '../../../actions';
|
|
|
4
4
|
import { Transformer } from '@atlaskit/editor-common/types';
|
|
5
5
|
import { EditorPlugin } from '../../../types';
|
|
6
6
|
import { FireAnalyticsCallback } from '../../../plugins/analytics';
|
|
7
|
-
import { PortalProviderAPI } from '
|
|
7
|
+
import { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
8
8
|
export type EditorProps = {
|
|
9
9
|
plugins?: Array<EditorPlugin>;
|
|
10
10
|
transformer?: (schema: Schema) => Transformer<any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
2
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
3
3
|
import EditorActions from '../../../../../actions';
|
|
4
|
-
import { PortalProviderAPI } from '
|
|
4
|
+
import { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
5
5
|
import { EditorSharedConfig } from '../../context/shared-config';
|
|
6
6
|
import { EditorPropsExtended } from '../../editor-props-type';
|
|
7
7
|
import { FeatureFlags } from '../../../../../types/feature-flags';
|
|
@@ -117,7 +117,15 @@ export declare function useCXHTMLPreset({ mentionProvider, mediaProvider, placeh
|
|
|
117
117
|
hoverDecoration: (nodeType: import("prosemirror-model").NodeType<any> | import("prosemirror-model").NodeType<any>[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
118
118
|
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
119
119
|
};
|
|
120
|
-
}
|
|
120
|
+
}>, import("@atlaskit/editor-common/types").OptionalPlugin<(config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"contextPanel", {
|
|
121
|
+
actions: {
|
|
122
|
+
applyChange: (tr: import("prosemirror-state").Transaction<any>) => import("prosemirror-state").Transaction<any>;
|
|
123
|
+
};
|
|
124
|
+
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"contextPanel", {
|
|
125
|
+
actions: {
|
|
126
|
+
applyChange: (tr: import("prosemirror-state").Transaction<any>) => import("prosemirror-state").Transaction<any>;
|
|
127
|
+
};
|
|
128
|
+
}>>];
|
|
121
129
|
actions: {
|
|
122
130
|
forceFocusSelector: import("@atlaskit/editor-plugin-floating-toolbar").ForceFocusSelector;
|
|
123
131
|
};
|
|
@@ -140,7 +148,15 @@ export declare function useCXHTMLPreset({ mentionProvider, mediaProvider, placeh
|
|
|
140
148
|
hoverDecoration: (nodeType: import("prosemirror-model").NodeType<any> | import("prosemirror-model").NodeType<any>[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
141
149
|
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
142
150
|
};
|
|
143
|
-
}
|
|
151
|
+
}>, import("@atlaskit/editor-common/types").OptionalPlugin<(config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"contextPanel", {
|
|
152
|
+
actions: {
|
|
153
|
+
applyChange: (tr: import("prosemirror-state").Transaction<any>) => import("prosemirror-state").Transaction<any>;
|
|
154
|
+
};
|
|
155
|
+
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"contextPanel", {
|
|
156
|
+
actions: {
|
|
157
|
+
applyChange: (tr: import("prosemirror-state").Transaction<any>) => import("prosemirror-state").Transaction<any>;
|
|
158
|
+
};
|
|
159
|
+
}>>];
|
|
144
160
|
actions: {
|
|
145
161
|
forceFocusSelector: import("@atlaskit/editor-plugin-floating-toolbar").ForceFocusSelector;
|
|
146
162
|
};
|
|
@@ -146,7 +146,15 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
146
146
|
hoverDecoration: (nodeType: import("prosemirror-model").NodeType<any> | import("prosemirror-model").NodeType<any>[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
147
147
|
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
148
148
|
};
|
|
149
|
-
}
|
|
149
|
+
}>, import("@atlaskit/editor-common/types").OptionalPlugin<(config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"contextPanel", {
|
|
150
|
+
actions: {
|
|
151
|
+
applyChange: (tr: import("prosemirror-state").Transaction<any>) => import("prosemirror-state").Transaction<any>;
|
|
152
|
+
};
|
|
153
|
+
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"contextPanel", {
|
|
154
|
+
actions: {
|
|
155
|
+
applyChange: (tr: import("prosemirror-state").Transaction<any>) => import("prosemirror-state").Transaction<any>;
|
|
156
|
+
};
|
|
157
|
+
}>>];
|
|
150
158
|
actions: {
|
|
151
159
|
forceFocusSelector: import("@atlaskit/editor-plugin-floating-toolbar").ForceFocusSelector;
|
|
152
160
|
};
|
|
@@ -169,7 +177,15 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
169
177
|
hoverDecoration: (nodeType: import("prosemirror-model").NodeType<any> | import("prosemirror-model").NodeType<any>[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
170
178
|
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
171
179
|
};
|
|
172
|
-
}
|
|
180
|
+
}>, import("@atlaskit/editor-common/types").OptionalPlugin<(config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"contextPanel", {
|
|
181
|
+
actions: {
|
|
182
|
+
applyChange: (tr: import("prosemirror-state").Transaction<any>) => import("prosemirror-state").Transaction<any>;
|
|
183
|
+
};
|
|
184
|
+
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"contextPanel", {
|
|
185
|
+
actions: {
|
|
186
|
+
applyChange: (tr: import("prosemirror-state").Transaction<any>) => import("prosemirror-state").Transaction<any>;
|
|
187
|
+
};
|
|
188
|
+
}>>];
|
|
173
189
|
actions: {
|
|
174
190
|
forceFocusSelector: import("@atlaskit/editor-plugin-floating-toolbar").ForceFocusSelector;
|
|
175
191
|
};
|
|
@@ -381,7 +397,15 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
381
397
|
hoverDecoration: (nodeType: import("prosemirror-model").NodeType<any> | import("prosemirror-model").NodeType<any>[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
382
398
|
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
383
399
|
};
|
|
384
|
-
}
|
|
400
|
+
}>, import("@atlaskit/editor-common/types").OptionalPlugin<(config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"contextPanel", {
|
|
401
|
+
actions: {
|
|
402
|
+
applyChange: (tr: import("prosemirror-state").Transaction<any>) => import("prosemirror-state").Transaction<any>;
|
|
403
|
+
};
|
|
404
|
+
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"contextPanel", {
|
|
405
|
+
actions: {
|
|
406
|
+
applyChange: (tr: import("prosemirror-state").Transaction<any>) => import("prosemirror-state").Transaction<any>;
|
|
407
|
+
};
|
|
408
|
+
}>>];
|
|
385
409
|
actions: {
|
|
386
410
|
forceFocusSelector: import("@atlaskit/editor-plugin-floating-toolbar").ForceFocusSelector;
|
|
387
411
|
};
|
|
@@ -404,7 +428,15 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
404
428
|
hoverDecoration: (nodeType: import("prosemirror-model").NodeType<any> | import("prosemirror-model").NodeType<any>[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
405
429
|
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
406
430
|
};
|
|
407
|
-
}
|
|
431
|
+
}>, import("@atlaskit/editor-common/types").OptionalPlugin<(config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"contextPanel", {
|
|
432
|
+
actions: {
|
|
433
|
+
applyChange: (tr: import("prosemirror-state").Transaction<any>) => import("prosemirror-state").Transaction<any>;
|
|
434
|
+
};
|
|
435
|
+
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"contextPanel", {
|
|
436
|
+
actions: {
|
|
437
|
+
applyChange: (tr: import("prosemirror-state").Transaction<any>) => import("prosemirror-state").Transaction<any>;
|
|
438
|
+
};
|
|
439
|
+
}>>];
|
|
408
440
|
actions: {
|
|
409
441
|
forceFocusSelector: import("@atlaskit/editor-plugin-floating-toolbar").ForceFocusSelector;
|
|
410
442
|
};
|
|
@@ -120,7 +120,15 @@ export declare function useMobilePreset({ media, placeholder, maxContentSize, cr
|
|
|
120
120
|
hoverDecoration: (nodeType: import("prosemirror-model").NodeType<any> | import("prosemirror-model").NodeType<any>[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
121
121
|
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
122
122
|
};
|
|
123
|
-
}
|
|
123
|
+
}>, import("@atlaskit/editor-common/types").OptionalPlugin<(config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"contextPanel", {
|
|
124
|
+
actions: {
|
|
125
|
+
applyChange: (tr: import("prosemirror-state").Transaction<any>) => import("prosemirror-state").Transaction<any>;
|
|
126
|
+
};
|
|
127
|
+
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"contextPanel", {
|
|
128
|
+
actions: {
|
|
129
|
+
applyChange: (tr: import("prosemirror-state").Transaction<any>) => import("prosemirror-state").Transaction<any>;
|
|
130
|
+
};
|
|
131
|
+
}>>];
|
|
124
132
|
actions: {
|
|
125
133
|
forceFocusSelector: import("@atlaskit/editor-plugin-floating-toolbar").ForceFocusSelector;
|
|
126
134
|
};
|
|
@@ -143,7 +151,15 @@ export declare function useMobilePreset({ media, placeholder, maxContentSize, cr
|
|
|
143
151
|
hoverDecoration: (nodeType: import("prosemirror-model").NodeType<any> | import("prosemirror-model").NodeType<any>[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
144
152
|
removeDecoration: import("@atlaskit/editor-common/types").Command;
|
|
145
153
|
};
|
|
146
|
-
}
|
|
154
|
+
}>, import("@atlaskit/editor-common/types").OptionalPlugin<(config?: undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"contextPanel", {
|
|
155
|
+
actions: {
|
|
156
|
+
applyChange: (tr: import("prosemirror-state").Transaction<any>) => import("prosemirror-state").Transaction<any>;
|
|
157
|
+
};
|
|
158
|
+
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"contextPanel", {
|
|
159
|
+
actions: {
|
|
160
|
+
applyChange: (tr: import("prosemirror-state").Transaction<any>) => import("prosemirror-state").Transaction<any>;
|
|
161
|
+
};
|
|
162
|
+
}>>];
|
|
147
163
|
actions: {
|
|
148
164
|
forceFocusSelector: import("@atlaskit/editor-plugin-floating-toolbar").ForceFocusSelector;
|
|
149
165
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
1
|
+
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
2
|
import { AnnotationProviders, InlineCommentAnnotationProvider, AnnotationInfo, AnnotationState, InlineCommentState, InlineCommentCreateComponentProps, InlineCommentViewComponentProps, AnnotationTypeProvider } from './types';
|
|
3
3
|
import { UpdateEvent, AnnotationUpdateEmitter } from './update-provider';
|
|
4
|
+
import type { InlineCommentPluginState } from './pm-plugins/types';
|
|
4
5
|
declare const annotationPlugin: NextEditorPlugin<'annotation', {
|
|
5
6
|
pluginConfiguration: AnnotationProviders | undefined;
|
|
7
|
+
sharedState: InlineCommentPluginState | undefined;
|
|
6
8
|
}>;
|
|
7
9
|
export default annotationPlugin;
|
|
8
10
|
export { AnnotationUpdateEmitter };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
2
|
+
import { ForwardRef } from '../../../nodeviews';
|
|
3
|
+
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
3
4
|
export declare class AnnotationNodeView extends ReactNodeView {
|
|
4
5
|
createDomRef(): HTMLSpanElement;
|
|
5
6
|
getContentDOM(): {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DecorationSet } from 'prosemirror-view';
|
|
2
2
|
import { EditorState, SelectionBookmark } from 'prosemirror-state';
|
|
3
|
-
import { PortalProviderAPI } from '
|
|
4
|
-
import { Dispatch, EventDispatcher } from '
|
|
3
|
+
import { PortalProviderAPI } from '@atlaskit/editor-common/portal-provider';
|
|
4
|
+
import { Dispatch, EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
5
5
|
import { InlineCommentAnnotationProvider, AnnotationInfo } from '../types';
|
|
6
6
|
export declare enum ACTIONS {
|
|
7
7
|
UPDATE_INLINE_COMMENT_STATE = 0,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
-
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
2
|
+
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
3
3
|
declare const captionPlugin: NextEditorPlugin<'caption', {
|
|
4
4
|
dependencies: [typeof analyticsPlugin];
|
|
5
5
|
}>;
|
|
@@ -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
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
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 '
|
|
3
|
-
import { Dispatch, EventDispatcher } from '
|
|
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 {
|
|
6
|
-
|
|
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
|
|
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
|
|
42
|
+
export declare class EmbedCard extends ReactNodeView<EmbedCardNodeViewProps> {
|
|
43
43
|
viewShouldUpdate(nextNode: PMNode): boolean;
|
|
44
44
|
createDomRef(): HTMLElement;
|
|
45
45
|
render(): JSX.Element;
|
|
@@ -6,6 +6,7 @@ import { MacroProvider } from '@atlaskit/editor-common/provider-factory';
|
|
|
6
6
|
export { transformSliceToRemoveOpenBodiedExtension } from '@atlaskit/editor-common/transforms';
|
|
7
7
|
import { Command, CommandDispatch } from '../../types';
|
|
8
8
|
import EditorActions from '../../actions';
|
|
9
|
+
import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
|
|
9
10
|
export declare const buildExtensionNode: <S extends Schema<any, any>>(type: 'inlineExtension' | 'extension' | 'bodiedExtension', schema: S, attrs: object, content?: Fragment, marks?: Mark<S>[] | undefined) => PmNode<Schema<any, any>>;
|
|
10
11
|
export declare const performNodeUpdate: (type: 'inlineExtension' | 'extension' | 'bodiedExtension', newAttrs: object, content: Fragment<any>, marks: Mark[], shouldScrollIntoView: boolean) => Command;
|
|
11
12
|
export declare const updateExtensionParams: (updateExtension: UpdateExtension<object>, node: {
|
|
@@ -13,4 +14,4 @@ export declare const updateExtensionParams: (updateExtension: UpdateExtension<ob
|
|
|
13
14
|
pos: number;
|
|
14
15
|
}, actions: ExtensionAPI) => (state: EditorState, dispatch?: CommandDispatch, view?: EditorView) => Promise<boolean>;
|
|
15
16
|
export declare const editSelectedExtension: (editorActions: EditorActions) => boolean;
|
|
16
|
-
export declare const editExtension: (macroProvider: MacroProvider | null, updateExtension?: Promise<UpdateExtension<object> | void>) => Command;
|
|
17
|
+
export declare const editExtension: (macroProvider: MacroProvider | null, applyChangeToContextPanel: ApplyChangeHandler | undefined, updateExtension?: Promise<UpdateExtension<object> | void>) => Command;
|
|
@@ -2,10 +2,11 @@ import { ExtensionLayout } from '@atlaskit/adf-schema';
|
|
|
2
2
|
import { Node as PMNode } from 'prosemirror-model';
|
|
3
3
|
import { ExtensionState } from './types';
|
|
4
4
|
import { Parameters, TransformBefore, TransformAfter } from '@atlaskit/editor-common/src/extensions';
|
|
5
|
+
import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
|
|
5
6
|
export declare function updateState(state: Partial<ExtensionState>): import("@atlaskit/editor-common/types").Command;
|
|
6
|
-
export declare function setEditingContextToContextPanel<T extends Parameters = Parameters>(processParametersBefore: TransformBefore<T>, processParametersAfter: TransformAfter<T
|
|
7
|
-
export declare const clearEditingContext: import("@atlaskit/editor-common/types").Command;
|
|
8
|
-
export declare const forceAutoSave: (resolve: () => void, reject?: ((reason?: any) => void) | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
7
|
+
export declare function setEditingContextToContextPanel<T extends Parameters = Parameters>(processParametersBefore: TransformBefore<T>, processParametersAfter: TransformAfter<T>, applyChangeToContextPanel: ApplyChangeHandler | undefined): import("@atlaskit/editor-common/types").Command;
|
|
8
|
+
export declare const clearEditingContext: (applyChangeToContextPanel: ApplyChangeHandler | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
9
|
+
export declare const forceAutoSave: (applyChangeToContextPanel: ApplyChangeHandler | undefined) => (resolve: () => void, reject?: ((reason?: any) => void) | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
9
10
|
export declare const updateExtensionLayout: (layout: ExtensionLayout) => import("@atlaskit/editor-common/types").Command;
|
|
10
11
|
export declare const removeExtension: () => import("@atlaskit/editor-common/types").Command;
|
|
11
12
|
export declare const removeDescendantNodes: (sourceNode?: PMNode) => import("@atlaskit/editor-common/types").Command;
|
|
@@ -3,5 +3,6 @@ import { EditorState } from 'prosemirror-state';
|
|
|
3
3
|
import { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
4
|
import type { EditorView } from 'prosemirror-view';
|
|
5
5
|
import type { ContentNodeWithPos } from 'prosemirror-utils';
|
|
6
|
-
|
|
6
|
+
import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
|
|
7
|
+
export declare const getContextPanel: (allowAutoSave?: boolean, featureFlags?: FeatureFlags, applyChange?: ApplyChangeHandler) => (state: EditorState) => JSX.Element | undefined;
|
|
7
8
|
export declare function onChangeAction(editorView: EditorView, updatedParameters: object | undefined, oldParameters: object | undefined, nodeWithPos: ContentNodeWithPos, onSaving?: () => void): Promise<void>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ExtensionAPI } from '@atlaskit/editor-common/extensions';
|
|
2
2
|
import type { EditorView } from 'prosemirror-view';
|
|
3
3
|
import { MacroProvider } from '../macro';
|
|
4
|
+
import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
|
|
4
5
|
interface EditInLegacyMacroBrowserArgs {
|
|
5
6
|
view: EditorView;
|
|
6
7
|
macroProvider?: MacroProvider;
|
|
@@ -8,6 +9,7 @@ interface EditInLegacyMacroBrowserArgs {
|
|
|
8
9
|
export declare const getEditInLegacyMacroBrowser: ({ view, macroProvider, }: EditInLegacyMacroBrowserArgs) => () => void;
|
|
9
10
|
interface CreateExtensionAPIOptions {
|
|
10
11
|
editorView: EditorView;
|
|
12
|
+
applyChange: ApplyChangeHandler | undefined;
|
|
11
13
|
editInLegacyMacroBrowser?: () => void;
|
|
12
14
|
}
|
|
13
15
|
export declare const createExtensionAPI: (options: CreateExtensionAPIOptions) => ExtensionAPI;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ExtensionHandlers } from '@atlaskit/editor-common/extensions';
|
|
2
2
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
3
|
-
import { NextEditorPlugin, EditorAppearance } from '
|
|
3
|
+
import { NextEditorPlugin, EditorAppearance, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
4
4
|
import { LongPressSelectionPluginOptions } from '../selection/types';
|
|
5
5
|
import type { widthPlugin } from '@atlaskit/editor-plugin-width';
|
|
6
6
|
import type { decorationsPlugin } from '@atlaskit/editor-plugin-decorations';
|
|
7
|
+
import type { contextPanelPlugin } from '@atlaskit/editor-plugin-context-panel';
|
|
7
8
|
interface ExtensionPluginOptions extends LongPressSelectionPluginOptions {
|
|
8
9
|
allowAutoSave?: boolean;
|
|
9
10
|
breakoutEnabled?: boolean;
|
|
@@ -15,7 +16,8 @@ declare const extensionPlugin: NextEditorPlugin<'extension', {
|
|
|
15
16
|
dependencies: [
|
|
16
17
|
typeof featureFlagsPlugin,
|
|
17
18
|
typeof widthPlugin,
|
|
18
|
-
typeof decorationsPlugin
|
|
19
|
+
typeof decorationsPlugin,
|
|
20
|
+
OptionalPlugin<typeof contextPanelPlugin>
|
|
19
21
|
];
|
|
20
22
|
}>;
|
|
21
23
|
export default extensionPlugin;
|
|
@@ -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
|
|
9
|
-
import
|
|
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 {
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
|
|
2
|
+
import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
|
|
3
|
+
export default function keymapPlugin(applyChange: ApplyChangeHandler | undefined): SafePlugin;
|
|
@@ -6,18 +6,20 @@ 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 '
|
|
10
|
-
import { PortalProviderAPI } from '
|
|
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';
|
|
14
|
+
import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
|
|
14
15
|
export declare const createExtensionProviderHandler: (view: EditorView) => (name: string, provider?: Promise<ExtensionProvider>) => Promise<void>;
|
|
15
16
|
export declare const createContextIdentifierProviderHandler: (view: EditorView) => (name: string, provider?: Promise<ContextIdentifierProvider>) => Promise<void>;
|
|
16
|
-
export declare const handleUpdate: ({ view, prevState, domAtPos, extensionHandlers, }: {
|
|
17
|
+
export declare const handleUpdate: ({ view, prevState, domAtPos, extensionHandlers, applyChange, }: {
|
|
17
18
|
view: EditorView;
|
|
18
19
|
prevState: EditorState;
|
|
19
20
|
domAtPos: EditorView['domAtPos'];
|
|
20
21
|
extensionHandlers: ExtensionHandlers;
|
|
22
|
+
applyChange: ApplyChangeHandler | undefined;
|
|
21
23
|
}) => true | undefined;
|
|
22
24
|
declare const createPlugin: (dispatch: Dispatch, providerFactory: ProviderFactory, extensionHandlers: ExtensionHandlers, portalProviderAPI: PortalProviderAPI, eventDispatcher: EventDispatcher, pluginInjectionApi: ExtractInjectionAPI<typeof extensionPlugin> | undefined, useLongPressSelection?: boolean, options?: {
|
|
23
25
|
appearance?: EditorAppearance;
|