@atlaskit/editor-core 185.1.6 → 185.2.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.
- package/CHANGELOG.md +13 -0
- package/dist/cjs/actions/index.js +2 -2
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +1 -2
- package/dist/cjs/index.js +0 -6
- package/dist/cjs/labs/next/internal/hooks/use-editor/create-editor.js +1 -1
- package/dist/cjs/messages.js +6 -56
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.styles.js +2 -2
- package/dist/cjs/plugins/base/pm-plugins/scroll-gutter.js +1 -1
- package/dist/cjs/plugins/card/nodeviews/blockCard.js +2 -2
- package/dist/cjs/plugins/card/nodeviews/embedCard.js +4 -4
- package/dist/cjs/plugins/card/pm-plugins/doc.js +9 -11
- package/dist/cjs/plugins/card/pm-plugins/keymap.js +3 -6
- package/dist/cjs/plugins/card/pm-plugins/main.js +2 -2
- package/dist/cjs/plugins/card/toolbar.js +12 -15
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +4 -6
- package/dist/cjs/plugins/card/ui/ResizableEmbedCard.js +7 -10
- package/dist/cjs/plugins/card/utils.js +3 -4
- package/dist/cjs/plugins/clear-marks-on-change-to-empty-document/index.js +1 -1
- package/dist/cjs/plugins/custom-autoformat/doc.js +1 -1
- package/dist/cjs/plugins/date/pm-plugins/main.js +2 -2
- package/dist/cjs/plugins/emoji/index.js +2 -2
- package/dist/cjs/plugins/floating-toolbar/index.js +1 -1
- package/dist/cjs/plugins/hyperlink/Toolbar.js +8 -8
- package/dist/cjs/plugins/hyperlink/commands.js +2 -3
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +2 -2
- package/dist/cjs/plugins/layout/actions.js +1 -1
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -3
- package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -2
- package/dist/cjs/plugins/media/toolbar/index.js +9 -8
- package/dist/cjs/plugins/media/toolbar/linking-toolbar-appearance.js +4 -3
- package/dist/cjs/plugins/media/toolbar/linking.js +3 -3
- package/dist/cjs/plugins/media/ui/MediaLinkingToolbar.js +1 -1
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +6 -8
- package/dist/cjs/plugins/media/utils/media-files.js +8 -7
- package/dist/cjs/plugins/mentions/pm-plugins/main.js +2 -2
- package/dist/cjs/plugins/placeholder/index.js +2 -3
- package/dist/cjs/plugins/status/plugin.js +2 -2
- package/dist/cjs/plugins/unsupported-content/index.js +3 -3
- package/dist/cjs/ui/Appearance/Chromeless.js +4 -2
- package/dist/cjs/ui/Appearance/Comment/Comment.js +4 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +2 -1
- package/dist/cjs/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/cjs/ui/Appearance/Mobile.js +4 -2
- package/dist/cjs/ui/AppearanceComponents/Mobile.js +6 -3
- package/dist/cjs/ui/ContentStyles/index.js +5 -3
- package/dist/cjs/ui/LinkSearch/ToolbarComponents.js +4 -11
- package/dist/cjs/utils/document.js +7 -249
- package/dist/cjs/utils/index.js +1 -23
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +2 -1
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +1 -1
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/labs/next/internal/hooks/use-editor/create-editor.js +1 -1
- package/dist/es2019/messages.js +2 -54
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/es2019/plugins/base/pm-plugins/scroll-gutter.js +1 -1
- package/dist/es2019/plugins/card/nodeviews/blockCard.js +1 -1
- package/dist/es2019/plugins/card/nodeviews/embedCard.js +1 -1
- package/dist/es2019/plugins/card/pm-plugins/doc.js +2 -3
- package/dist/es2019/plugins/card/pm-plugins/keymap.js +3 -3
- package/dist/es2019/plugins/card/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/card/toolbar.js +7 -9
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +3 -4
- package/dist/es2019/plugins/card/ui/ResizableEmbedCard.js +1 -4
- package/dist/es2019/plugins/card/utils.js +1 -2
- package/dist/es2019/plugins/clear-marks-on-change-to-empty-document/index.js +1 -1
- package/dist/es2019/plugins/custom-autoformat/doc.js +1 -1
- package/dist/es2019/plugins/date/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/emoji/index.js +1 -1
- package/dist/es2019/plugins/floating-toolbar/index.js +1 -1
- package/dist/es2019/plugins/hyperlink/Toolbar.js +3 -3
- package/dist/es2019/plugins/hyperlink/commands.js +1 -2
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +1 -1
- package/dist/es2019/plugins/layout/actions.js +1 -1
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -1
- package/dist/es2019/plugins/media/toolbar/index.js +9 -8
- package/dist/es2019/plugins/media/toolbar/linking-toolbar-appearance.js +2 -1
- package/dist/es2019/plugins/media/toolbar/linking.js +1 -1
- package/dist/es2019/plugins/media/ui/MediaLinkingToolbar.js +1 -1
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +2 -4
- package/dist/es2019/plugins/media/utils/media-files.js +4 -3
- package/dist/es2019/plugins/mentions/pm-plugins/main.js +1 -1
- package/dist/es2019/plugins/placeholder/index.js +1 -1
- package/dist/es2019/plugins/status/plugin.js +1 -1
- package/dist/es2019/plugins/unsupported-content/index.js +1 -1
- package/dist/es2019/ui/Appearance/Chromeless.js +4 -2
- package/dist/es2019/ui/Appearance/Comment/Comment.js +4 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +2 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/es2019/ui/Appearance/Mobile.js +4 -2
- package/dist/es2019/ui/AppearanceComponents/Mobile.js +6 -3
- package/dist/es2019/ui/ContentStyles/index.js +5 -3
- package/dist/es2019/ui/LinkSearch/ToolbarComponents.js +1 -4
- package/dist/es2019/utils/document.js +3 -244
- package/dist/es2019/utils/index.js +1 -4
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +2 -1
- package/dist/esm/create-editor/ReactEditorViewInternal.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/labs/next/internal/hooks/use-editor/create-editor.js +1 -1
- package/dist/esm/messages.js +2 -54
- package/dist/esm/nodeviews/getInlineNodeViewProducer.styles.js +1 -1
- package/dist/esm/plugins/base/pm-plugins/scroll-gutter.js +1 -1
- package/dist/esm/plugins/card/nodeviews/blockCard.js +1 -1
- package/dist/esm/plugins/card/nodeviews/embedCard.js +1 -1
- package/dist/esm/plugins/card/pm-plugins/doc.js +2 -3
- package/dist/esm/plugins/card/pm-plugins/keymap.js +3 -3
- package/dist/esm/plugins/card/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/card/toolbar.js +7 -9
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +3 -4
- package/dist/esm/plugins/card/ui/ResizableEmbedCard.js +1 -4
- package/dist/esm/plugins/card/utils.js +1 -2
- package/dist/esm/plugins/clear-marks-on-change-to-empty-document/index.js +1 -1
- package/dist/esm/plugins/custom-autoformat/doc.js +1 -1
- package/dist/esm/plugins/date/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/emoji/index.js +1 -1
- package/dist/esm/plugins/floating-toolbar/index.js +1 -1
- package/dist/esm/plugins/hyperlink/Toolbar.js +3 -3
- package/dist/esm/plugins/hyperlink/commands.js +1 -2
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/index.js +1 -1
- package/dist/esm/plugins/layout/actions.js +1 -1
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +1 -1
- package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +1 -1
- package/dist/esm/plugins/media/toolbar/index.js +9 -8
- package/dist/esm/plugins/media/toolbar/linking-toolbar-appearance.js +2 -1
- package/dist/esm/plugins/media/toolbar/linking.js +1 -1
- package/dist/esm/plugins/media/ui/MediaLinkingToolbar.js +1 -1
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +2 -4
- package/dist/esm/plugins/media/utils/media-files.js +4 -3
- package/dist/esm/plugins/mentions/pm-plugins/main.js +1 -1
- package/dist/esm/plugins/placeholder/index.js +1 -1
- package/dist/esm/plugins/status/plugin.js +1 -1
- package/dist/esm/plugins/unsupported-content/index.js +1 -1
- package/dist/esm/ui/Appearance/Chromeless.js +4 -2
- package/dist/esm/ui/Appearance/Comment/Comment.js +4 -2
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +2 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageContentArea.js +2 -1
- package/dist/esm/ui/Appearance/Mobile.js +4 -2
- package/dist/esm/ui/AppearanceComponents/Mobile.js +6 -3
- package/dist/esm/ui/ContentStyles/index.js +5 -3
- package/dist/esm/ui/LinkSearch/ToolbarComponents.js +1 -4
- package/dist/esm/utils/document.js +6 -240
- package/dist/esm/utils/index.js +1 -4
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/index.d.ts +1 -2
- package/dist/types/labs/next/presets/cxhtml.d.ts +3 -3
- package/dist/types/labs/next/presets/default.d.ts +1 -1
- package/dist/types/labs/next/presets/mobile.d.ts +3 -3
- package/dist/types/messages.d.ts +2 -53
- package/dist/types/plugins/card/nodeviews/blockCard.d.ts +1 -1
- package/dist/types/plugins/card/nodeviews/genericCard.d.ts +3 -3
- package/dist/types/plugins/card/nodeviews/inlineCard.d.ts +1 -1
- package/dist/types/plugins/card/toolbar.d.ts +1 -1
- package/dist/types/plugins/card/types.d.ts +1 -1
- package/dist/types/plugins/card/ui/EditLinkToolbar.d.ts +1 -1
- package/dist/types/plugins/card/ui/ResizableEmbedCard.d.ts +1 -1
- package/dist/types/plugins/date/nodeviews/date.d.ts +1 -1
- package/dist/types/plugins/emoji/nodeviews/emoji.d.ts +1 -1
- package/dist/types/plugins/floating-toolbar/ui/Toolbar.d.ts +1 -1
- package/dist/types/plugins/hyperlink/Toolbar.d.ts +1 -1
- package/dist/types/plugins/hyperlink/commands.d.ts +2 -3
- package/dist/types/plugins/hyperlink/index.d.ts +1 -1
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +1 -1
- package/dist/types/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +1 -1
- package/dist/types/plugins/media/ui/ResizableMediaSingle/types.d.ts +0 -15
- package/dist/types/plugins/media/utils/media-files.d.ts +1 -1
- package/dist/types/plugins/mentions/nodeviews/mention.d.ts +1 -1
- package/dist/types/plugins/status/nodeviews/status.d.ts +1 -1
- package/dist/types/plugins/unsupported-content/unsupported-inline-node-view.d.ts +1 -1
- package/dist/types/types/editor-props.d.ts +1 -1
- package/dist/types/ui/Appearance/FullPage/FullPageContentArea.d.ts +2 -0
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +5 -364
- package/dist/types/ui/Appearance/Mobile.d.ts +1 -1
- package/dist/types/ui/AppearanceComponents/Mobile.d.ts +2 -0
- package/dist/types/ui/ContentStyles/index.d.ts +3 -3
- package/dist/types/ui/LinkSearch/ToolbarComponents.d.ts +0 -4
- package/dist/types/utils/document.d.ts +0 -12
- package/dist/types/utils/index.d.ts +1 -2
- package/dist/types-ts4.5/index.d.ts +1 -2
- package/dist/types-ts4.5/labs/next/presets/cxhtml.d.ts +3 -3
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +1 -1
- package/dist/types-ts4.5/labs/next/presets/mobile.d.ts +3 -3
- package/dist/types-ts4.5/messages.d.ts +2 -53
- package/dist/types-ts4.5/plugins/card/nodeviews/blockCard.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/nodeviews/genericCard.d.ts +3 -3
- package/dist/types-ts4.5/plugins/card/nodeviews/inlineCard.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/toolbar.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/ui/EditLinkToolbar.d.ts +1 -1
- package/dist/types-ts4.5/plugins/card/ui/ResizableEmbedCard.d.ts +1 -1
- package/dist/types-ts4.5/plugins/date/nodeviews/date.d.ts +1 -1
- package/dist/types-ts4.5/plugins/emoji/nodeviews/emoji.d.ts +1 -1
- package/dist/types-ts4.5/plugins/floating-toolbar/ui/Toolbar.d.ts +1 -1
- package/dist/types-ts4.5/plugins/hyperlink/Toolbar.d.ts +1 -1
- package/dist/types-ts4.5/plugins/hyperlink/commands.d.ts +2 -3
- package/dist/types-ts4.5/plugins/hyperlink/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.d.ts +1 -1
- package/dist/types-ts4.5/plugins/hyperlink/ui/HyperlinkAddToolbar/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/types.d.ts +0 -15
- package/dist/types-ts4.5/plugins/media/utils/media-files.d.ts +1 -1
- package/dist/types-ts4.5/plugins/mentions/nodeviews/mention.d.ts +1 -1
- package/dist/types-ts4.5/plugins/status/nodeviews/status.d.ts +1 -1
- package/dist/types-ts4.5/plugins/unsupported-content/unsupported-inline-node-view.d.ts +1 -1
- package/dist/types-ts4.5/types/editor-props.d.ts +1 -1
- package/dist/types-ts4.5/ui/Appearance/FullPage/FullPageContentArea.d.ts +2 -0
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +5 -364
- package/dist/types-ts4.5/ui/Appearance/Mobile.d.ts +1 -1
- package/dist/types-ts4.5/ui/AppearanceComponents/Mobile.d.ts +2 -0
- package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +3 -3
- package/dist/types-ts4.5/ui/LinkSearch/ToolbarComponents.d.ts +0 -4
- package/dist/types-ts4.5/utils/document.d.ts +0 -12
- package/dist/types-ts4.5/utils/index.d.ts +1 -2
- package/package.json +9 -10
- package/report.api.md +9 -34
- package/tmp/api-report-tmp.d.ts +7 -33
- package/dist/cjs/nodeviews/getInlineNodeViewProducer.js +0 -227
- package/dist/cjs/plugins/hyperlink/types.js +0 -5
- package/dist/cjs/ui/MediaAndEmbedsToolbar/index.js +0 -152
- package/dist/cjs/ui/Resizer/index.js +0 -210
- package/dist/cjs/ui/Resizer/styled.js +0 -15
- package/dist/cjs/ui/Resizer/types.js +0 -5
- package/dist/cjs/ui/Resizer/utils.js +0 -21
- package/dist/cjs/utils/filter/privacy-filter.js +0 -55
- package/dist/cjs/utils/linking-utils.js +0 -84
- package/dist/cjs/utils/rich-media-utils.js +0 -130
- package/dist/es2019/nodeviews/getInlineNodeViewProducer.js +0 -221
- package/dist/es2019/plugins/hyperlink/types.js +0 -1
- package/dist/es2019/ui/MediaAndEmbedsToolbar/index.js +0 -159
- package/dist/es2019/ui/Resizer/index.js +0 -191
- package/dist/es2019/ui/Resizer/styled.js +0 -15
- package/dist/es2019/ui/Resizer/types.js +0 -1
- package/dist/es2019/ui/Resizer/utils.js +0 -12
- package/dist/es2019/utils/filter/privacy-filter.js +0 -47
- package/dist/es2019/utils/linking-utils.js +0 -74
- package/dist/es2019/utils/rich-media-utils.js +0 -108
- package/dist/esm/nodeviews/getInlineNodeViewProducer.js +0 -217
- package/dist/esm/plugins/hyperlink/types.js +0 -1
- package/dist/esm/ui/MediaAndEmbedsToolbar/index.js +0 -144
- package/dist/esm/ui/Resizer/index.js +0 -203
- package/dist/esm/ui/Resizer/styled.js +0 -7
- package/dist/esm/ui/Resizer/types.js +0 -1
- package/dist/esm/ui/Resizer/utils.js +0 -12
- package/dist/esm/utils/filter/privacy-filter.js +0 -48
- package/dist/esm/utils/linking-utils.js +0 -74
- package/dist/esm/utils/rich-media-utils.js +0 -117
- package/dist/types/nodeviews/getInlineNodeViewProducer.d.ts +0 -24
- package/dist/types/plugins/hyperlink/types.d.ts +0 -35
- package/dist/types/ui/MediaAndEmbedsToolbar/index.d.ts +0 -9
- package/dist/types/ui/Resizer/index.d.ts +0 -41
- package/dist/types/ui/Resizer/styled.d.ts +0 -2
- package/dist/types/ui/Resizer/types.d.ts +0 -26
- package/dist/types/ui/Resizer/utils.d.ts +0 -6
- package/dist/types/utils/filter/privacy-filter.d.ts +0 -9
- package/dist/types/utils/linking-utils.d.ts +0 -14
- package/dist/types/utils/rich-media-utils.d.ts +0 -8
- package/dist/types-ts4.5/nodeviews/getInlineNodeViewProducer.d.ts +0 -24
- package/dist/types-ts4.5/plugins/hyperlink/types.d.ts +0 -35
- package/dist/types-ts4.5/ui/MediaAndEmbedsToolbar/index.d.ts +0 -9
- package/dist/types-ts4.5/ui/Resizer/index.d.ts +0 -41
- package/dist/types-ts4.5/ui/Resizer/styled.d.ts +0 -2
- package/dist/types-ts4.5/ui/Resizer/types.d.ts +0 -26
- package/dist/types-ts4.5/ui/Resizer/utils.d.ts +0 -6
- package/dist/types-ts4.5/utils/filter/privacy-filter.d.ts +0 -9
- package/dist/types-ts4.5/utils/linking-utils.d.ts +0 -14
- package/dist/types-ts4.5/utils/rich-media-utils.d.ts +0 -8
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { sanitizeNodeForPrivacy } from '../utils/filter/privacy-filter';
|
|
5
|
-
import { isEmptyParagraph, validateADFEntity, findAndTrackUnsupportedContentNodes } from '@atlaskit/editor-common/utils';
|
|
2
|
+
import { Fragment } from 'prosemirror-model';
|
|
3
|
+
import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
|
|
6
4
|
import { getBreakoutMode } from './node-width';
|
|
7
|
-
import {
|
|
5
|
+
import { processRawValue, hasDocAsParent, getStepRange } from '@atlaskit/editor-common/utils';
|
|
8
6
|
|
|
9
7
|
/**
|
|
10
8
|
* Returns false if node contains only empty inline nodes and hardBreaks.
|
|
@@ -49,25 +47,6 @@ export function isNodeEmpty(node) {
|
|
|
49
47
|
return !!childNode.childCount && !(childNode.childCount === 1 && isEmptyParagraph(childNode.firstChild)) || childNode.isAtom;
|
|
50
48
|
}).length;
|
|
51
49
|
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Checks if a node looks like an empty document
|
|
55
|
-
*/
|
|
56
|
-
export function isEmptyDocument(node) {
|
|
57
|
-
var nodeChild = node.content.firstChild;
|
|
58
|
-
if (node.childCount !== 1 || !nodeChild) {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
return isEmptyParagraph(nodeChild);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// Checks to see if the parent node is the document, ie not contained within another entity
|
|
65
|
-
export function hasDocAsParent($anchor) {
|
|
66
|
-
return $anchor.depth === 1;
|
|
67
|
-
}
|
|
68
|
-
export function isProseMirrorSchemaCheckError(error) {
|
|
69
|
-
return error instanceof RangeError && (!!error.message.match(/^Invalid collection of marks for node/) || !!error.message.match(/^Invalid content for node/));
|
|
70
|
-
}
|
|
71
50
|
export function isInEmptyLine(state) {
|
|
72
51
|
var selection = state.selection;
|
|
73
52
|
var _ref = selection,
|
|
@@ -82,24 +61,6 @@ export function isInEmptyLine(state) {
|
|
|
82
61
|
}
|
|
83
62
|
return isEmptyParagraph(node) && hasDocAsParent($anchor);
|
|
84
63
|
}
|
|
85
|
-
export function bracketTyped(state) {
|
|
86
|
-
var selection = state.selection;
|
|
87
|
-
var _ref2 = selection,
|
|
88
|
-
$cursor = _ref2.$cursor,
|
|
89
|
-
$anchor = _ref2.$anchor;
|
|
90
|
-
if (!$cursor) {
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
var node = $cursor.nodeBefore;
|
|
94
|
-
if (!node) {
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
if (node.type.name === 'text' && node.text === '{') {
|
|
98
|
-
var paragraphNode = $anchor.node();
|
|
99
|
-
return paragraphNode.marks.length === 0 && hasDocAsParent($anchor);
|
|
100
|
-
}
|
|
101
|
-
return false;
|
|
102
|
-
}
|
|
103
64
|
export function processRawFragmentValue(schema, value, providerFactory, sanitizePrivateContent, contentTransformer, dispatchAnalyticsEvent) {
|
|
104
65
|
if (!value) {
|
|
105
66
|
return;
|
|
@@ -114,201 +75,6 @@ export function processRawFragmentValue(schema, value, providerFactory, sanitize
|
|
|
114
75
|
}
|
|
115
76
|
return Fragment.from(adfEntities);
|
|
116
77
|
}
|
|
117
|
-
export function processRawValue(schema, value, providerFactory, sanitizePrivateContent, contentTransformer, dispatchAnalyticsEvent) {
|
|
118
|
-
if (!value) {
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
var node;
|
|
122
|
-
if (typeof value === 'string') {
|
|
123
|
-
try {
|
|
124
|
-
if (contentTransformer) {
|
|
125
|
-
var doc = contentTransformer.parse(value);
|
|
126
|
-
node = doc.toJSON();
|
|
127
|
-
} else {
|
|
128
|
-
node = JSON.parse(value);
|
|
129
|
-
}
|
|
130
|
-
} catch (e) {
|
|
131
|
-
// eslint-disable-next-line no-console
|
|
132
|
-
console.error("Error processing value: ".concat(value, " isn't a valid JSON"));
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
|
-
} else {
|
|
136
|
-
node = value;
|
|
137
|
-
}
|
|
138
|
-
if (Array.isArray(node)) {
|
|
139
|
-
// eslint-disable-next-line no-console
|
|
140
|
-
console.error("Error processing value: ".concat(node, " is an array, but it must be an object."));
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
try {
|
|
144
|
-
// ProseMirror always require a child under doc
|
|
145
|
-
if (node.type === 'doc') {
|
|
146
|
-
if (Array.isArray(node.content) && node.content.length === 0) {
|
|
147
|
-
node.content.push({
|
|
148
|
-
type: 'paragraph',
|
|
149
|
-
content: []
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
// Just making sure doc is always valid
|
|
153
|
-
if (!node.version) {
|
|
154
|
-
node.version = 1;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
if (contentTransformer) {
|
|
158
|
-
return Node.fromJSON(schema, node);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// link mark on mediaSingle is deprecated, need to move link mark to child media node
|
|
162
|
-
// https://product-fabric.atlassian.net/browse/ED-14043
|
|
163
|
-
var _transformMediaLinkMa = transformMediaLinkMarks(node),
|
|
164
|
-
transformedAdf = _transformMediaLinkMa.transformedAdf,
|
|
165
|
-
isTransformed = _transformMediaLinkMa.isTransformed;
|
|
166
|
-
if (isTransformed && dispatchAnalyticsEvent) {
|
|
167
|
-
dispatchAnalyticsEvent({
|
|
168
|
-
action: ACTION.MEDIA_LINK_TRANSFORMED,
|
|
169
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
170
|
-
eventType: EVENT_TYPE.OPERATIONAL
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
// See: HOT-97965 https://product-fabric.atlassian.net/browse/ED-14400
|
|
175
|
-
// We declared in code mark spec that links and marks should not co-exist on
|
|
176
|
-
// text nodes. This util strips code marks from bad text nodes and preserves links.
|
|
177
|
-
// Otherwise, prosemirror will try to repair the invalid document by stripping links
|
|
178
|
-
// and preserving code marks during content changes.
|
|
179
|
-
var _transformTextLinkCod = transformTextLinkCodeMarks(transformedAdf);
|
|
180
|
-
transformedAdf = _transformTextLinkCod.transformedAdf;
|
|
181
|
-
isTransformed = _transformTextLinkCod.isTransformed;
|
|
182
|
-
if (isTransformed && dispatchAnalyticsEvent) {
|
|
183
|
-
dispatchAnalyticsEvent({
|
|
184
|
-
action: ACTION.TEXT_LINK_MARK_TRANSFORMED,
|
|
185
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
186
|
-
eventType: EVENT_TYPE.OPERATIONAL
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
var discardedMarks = [];
|
|
190
|
-
var _transformDedupeMarks = transformDedupeMarks(transformedAdf);
|
|
191
|
-
transformedAdf = _transformDedupeMarks.transformedAdf;
|
|
192
|
-
isTransformed = _transformDedupeMarks.isTransformed;
|
|
193
|
-
discardedMarks = _transformDedupeMarks.discardedMarks;
|
|
194
|
-
if (isTransformed && dispatchAnalyticsEvent) {
|
|
195
|
-
dispatchAnalyticsEvent({
|
|
196
|
-
action: ACTION.DEDUPE_MARKS_TRANSFORMED_V2,
|
|
197
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
198
|
-
eventType: EVENT_TYPE.OPERATIONAL,
|
|
199
|
-
attributes: {
|
|
200
|
-
/** UGC WARNING
|
|
201
|
-
*
|
|
202
|
-
* DO NOT include the `mark` attributes inside, we map here to only
|
|
203
|
-
* extract the mark type as that is the only non-UGC safe information
|
|
204
|
-
* that we can add to event-attributes
|
|
205
|
-
*
|
|
206
|
-
*/
|
|
207
|
-
discardedMarkTypes: discardedMarks.map(function (mark) {
|
|
208
|
-
return mark.type;
|
|
209
|
-
})
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
var _transformNodesMissin = transformNodesMissingContent(transformedAdf);
|
|
214
|
-
transformedAdf = _transformNodesMissin.transformedAdf;
|
|
215
|
-
isTransformed = _transformNodesMissin.isTransformed;
|
|
216
|
-
if (isTransformed && dispatchAnalyticsEvent) {
|
|
217
|
-
dispatchAnalyticsEvent({
|
|
218
|
-
action: ACTION.NODES_MISSING_CONTENT_TRANSFORMED,
|
|
219
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
220
|
-
eventType: EVENT_TYPE.OPERATIONAL
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
var _transformIndentation = transformIndentationMarks(transformedAdf);
|
|
224
|
-
transformedAdf = _transformIndentation.transformedAdf;
|
|
225
|
-
isTransformed = _transformIndentation.isTransformed;
|
|
226
|
-
if (isTransformed && dispatchAnalyticsEvent) {
|
|
227
|
-
dispatchAnalyticsEvent({
|
|
228
|
-
action: ACTION.INDENTATION_MARKS_TRANSFORMED,
|
|
229
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
230
|
-
eventType: EVENT_TYPE.OPERATIONAL
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
var _transformInvalidMedi = transformInvalidMediaContent(transformedAdf);
|
|
234
|
-
transformedAdf = _transformInvalidMedi.transformedAdf;
|
|
235
|
-
isTransformed = _transformInvalidMedi.isTransformed;
|
|
236
|
-
if (isTransformed && dispatchAnalyticsEvent) {
|
|
237
|
-
dispatchAnalyticsEvent({
|
|
238
|
-
action: ACTION.INVALID_MEDIA_CONTENT_TRANSFORMED,
|
|
239
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
240
|
-
eventType: EVENT_TYPE.OPERATIONAL
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
var entity = validateADFEntity(schema, transformedAdf || node, dispatchAnalyticsEvent);
|
|
244
|
-
var newEntity = maySanitizePrivateContent(entity, providerFactory, sanitizePrivateContent);
|
|
245
|
-
var parsedDoc = Node.fromJSON(schema, newEntity);
|
|
246
|
-
|
|
247
|
-
// throws an error if the document is invalid
|
|
248
|
-
try {
|
|
249
|
-
parsedDoc.check();
|
|
250
|
-
} catch (err) {
|
|
251
|
-
if (dispatchAnalyticsEvent) {
|
|
252
|
-
dispatchAnalyticsEvent({
|
|
253
|
-
action: ACTION.INVALID_PROSEMIRROR_DOCUMENT,
|
|
254
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
255
|
-
eventType: EVENT_TYPE.OPERATIONAL,
|
|
256
|
-
attributes: {
|
|
257
|
-
errorStack: err instanceof Error ? err.stack : String(err)
|
|
258
|
-
}
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
throw err;
|
|
262
|
-
}
|
|
263
|
-
if (dispatchAnalyticsEvent) {
|
|
264
|
-
findAndTrackUnsupportedContentNodes(parsedDoc, schema, dispatchAnalyticsEvent);
|
|
265
|
-
}
|
|
266
|
-
return parsedDoc;
|
|
267
|
-
} catch (e) {
|
|
268
|
-
if (dispatchAnalyticsEvent) {
|
|
269
|
-
dispatchAnalyticsEvent({
|
|
270
|
-
action: ACTION.DOCUMENT_PROCESSING_ERROR,
|
|
271
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
272
|
-
eventType: EVENT_TYPE.OPERATIONAL,
|
|
273
|
-
nonPrivacySafeAttributes: {
|
|
274
|
-
errorStack: e instanceof Error ? e.stack : String(e)
|
|
275
|
-
}
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
// eslint-disable-next-line no-console
|
|
280
|
-
console.error("Error processing document:\n".concat(e instanceof Error ? e.message : String(e), "\n\n"), JSON.stringify(node));
|
|
281
|
-
if (isProseMirrorSchemaCheckError(e)) {
|
|
282
|
-
throw e;
|
|
283
|
-
}
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
var maySanitizePrivateContent = function maySanitizePrivateContent(entity, providerFactory, sanitizePrivateContent) {
|
|
288
|
-
if (sanitizePrivateContent && providerFactory) {
|
|
289
|
-
return sanitizeNodeForPrivacy(entity, providerFactory);
|
|
290
|
-
}
|
|
291
|
-
return entity;
|
|
292
|
-
};
|
|
293
|
-
export var getStepRange = function getStepRange(transaction) {
|
|
294
|
-
var from = -1;
|
|
295
|
-
var to = -1;
|
|
296
|
-
transaction.mapping.maps.forEach(function (stepMap, index) {
|
|
297
|
-
stepMap.forEach(function (oldStart, oldEnd) {
|
|
298
|
-
var newStart = transaction.mapping.slice(index).map(oldStart, -1);
|
|
299
|
-
var newEnd = transaction.mapping.slice(index).map(oldEnd);
|
|
300
|
-
from = newStart < from || from === -1 ? newStart : from;
|
|
301
|
-
to = newEnd > to || to === -1 ? newEnd : to;
|
|
302
|
-
});
|
|
303
|
-
});
|
|
304
|
-
if (from !== -1) {
|
|
305
|
-
return {
|
|
306
|
-
from: from,
|
|
307
|
-
to: to
|
|
308
|
-
};
|
|
309
|
-
}
|
|
310
|
-
return null;
|
|
311
|
-
};
|
|
312
78
|
|
|
313
79
|
/**
|
|
314
80
|
* Find the farthest node given a condition
|
|
@@ -334,9 +100,9 @@ export var findFarthestParentNode = function findFarthestParentNode(predicate) {
|
|
|
334
100
|
export var isSelectionEndOfParagraph = function isSelectionEndOfParagraph(state) {
|
|
335
101
|
return state.selection.$to.parent.type === state.schema.nodes.paragraph && state.selection.$to.pos === state.doc.resolve(state.selection.$to.pos).end();
|
|
336
102
|
};
|
|
337
|
-
export function getChangedNodesIn(
|
|
338
|
-
var tr =
|
|
339
|
-
doc =
|
|
103
|
+
export function getChangedNodesIn(_ref2) {
|
|
104
|
+
var tr = _ref2.tr,
|
|
105
|
+
doc = _ref2.doc;
|
|
340
106
|
var nodes = [];
|
|
341
107
|
var stepRange = getStepRange(tr);
|
|
342
108
|
if (!stepRange) {
|
package/dist/esm/utils/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { isNodeEmpty } from './document';
|
|
|
7
7
|
import { atTheBeginningOfDoc, atTheEndOfDoc } from './prosemirror/position';
|
|
8
8
|
import { isMediaNode } from '@atlaskit/editor-common/utils';
|
|
9
9
|
export { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
10
|
-
export { hasVisibleContent, isNodeEmpty,
|
|
10
|
+
export { hasVisibleContent, isNodeEmpty, findFarthestParentNode, isSelectionEndOfParagraph, nodesBetweenChanged, getNodesCount } from './document';
|
|
11
11
|
export { sanitiseMarksInSelection } from './mark';
|
|
12
12
|
export { isParagraph, isText, isLinkMark } from './nodes';
|
|
13
13
|
export { setNodeSelection, setGapCursorSelection, setTextSelection } from './selection';
|
|
@@ -274,9 +274,6 @@ export var insideTableCell = function insideTableCell(state) {
|
|
|
274
274
|
tableHeader = _state$schema$nodes2.tableHeader;
|
|
275
275
|
return hasParentNodeOfType([tableCell, tableHeader])(state.selection);
|
|
276
276
|
};
|
|
277
|
-
export var isInLayoutColumn = function isInLayoutColumn(state) {
|
|
278
|
-
return hasParentNodeOfType(state.schema.nodes.layoutSection)(state.selection);
|
|
279
|
-
};
|
|
280
277
|
export var isInListItem = function isInListItem(state) {
|
|
281
278
|
return hasParentNodeOfType(state.schema.nodes.listItem)(state.selection);
|
|
282
279
|
};
|
package/dist/esm/version.json
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -57,12 +57,11 @@ export { pluginKey as quickInsertPluginKey, memoProcessItems as processQuickInse
|
|
|
57
57
|
export type { QuickInsertPluginState } from './plugins/quick-insert';
|
|
58
58
|
export type { TypeAheadItem } from './plugins/type-ahead/types';
|
|
59
59
|
export { insertLink, insertLinkWithAnalyticsMobileNative, insertLinkWithAnalytics, isTextAtPos, isLinkAtPos, updateLink, } from './plugins/hyperlink/commands';
|
|
60
|
-
export type { LinkInputType as LinkInputMethod } from './plugins/hyperlink/types';
|
|
61
60
|
export { historyPluginKey } from './plugins/history';
|
|
62
61
|
export { INPUT_METHOD, ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, } from './plugins/analytics';
|
|
63
62
|
export type { AnalyticsEventPayload } from './plugins/analytics';
|
|
64
63
|
export { setKeyboardHeight, setMobilePaddingTop, setIsExpanded, } from './plugins/mobile-dimensions/commands';
|
|
65
|
-
export { setTextSelection, dedupe, getNodesCount, measurements, hasVisibleContent,
|
|
64
|
+
export { setTextSelection, dedupe, getNodesCount, measurements, hasVisibleContent, } from './utils';
|
|
66
65
|
export { getListCommands } from './utils/list-commands';
|
|
67
66
|
export { ReactEditorView, BaseReactEditorView } from './create-editor';
|
|
68
67
|
export { getDefaultPresetOptionsFromEditorProps } from './create-editor';
|
|
@@ -162,8 +162,8 @@ export declare function useCXHTMLPreset({ mentionProvider, mediaProvider, placeh
|
|
|
162
162
|
pluginConfiguration: import("../../../plugins/text-formatting/types").TextFormattingOptions | undefined;
|
|
163
163
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"textFormatting", {
|
|
164
164
|
pluginConfiguration: import("../../../plugins/text-formatting/types").TextFormattingOptions | undefined;
|
|
165
|
-
}>, (config?: import("
|
|
166
|
-
pluginConfiguration: import("
|
|
165
|
+
}>, (config?: import("@atlaskit/editor-common/types").HyperlinkPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"hyperlink", {
|
|
166
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").HyperlinkPluginOptions | undefined;
|
|
167
167
|
dependencies: [(config: import("@atlaskit/editor-common/types").FeatureFlags, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"featureFlags", {
|
|
168
168
|
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
169
169
|
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
@@ -200,7 +200,7 @@ export declare function useCXHTMLPreset({ mentionProvider, mediaProvider, placeh
|
|
|
200
200
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
201
201
|
}>>];
|
|
202
202
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"hyperlink", {
|
|
203
|
-
pluginConfiguration: import("
|
|
203
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").HyperlinkPluginOptions | undefined;
|
|
204
204
|
dependencies: [(config: import("@atlaskit/editor-common/types").FeatureFlags, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"featureFlags", {
|
|
205
205
|
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
206
206
|
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
@@ -13,7 +13,7 @@ import { CodeBlockOptions } from '../../../plugins/code-block/types';
|
|
|
13
13
|
import { SelectionPluginOptions } from '../../../plugins/selection/types';
|
|
14
14
|
import { CardOptions } from '@atlaskit/editor-common/card';
|
|
15
15
|
import { TypeAheadPluginOptions } from '../../../plugins/type-ahead';
|
|
16
|
-
import { HyperlinkPluginOptions } from '
|
|
16
|
+
import type { HyperlinkPluginOptions } from '@atlaskit/editor-common/types';
|
|
17
17
|
import { EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
18
18
|
export type DefaultPresetPluginOptions = {
|
|
19
19
|
paste: PastePluginOptions;
|
|
@@ -165,8 +165,8 @@ export declare function useMobilePreset({ media, placeholder, maxContentSize, cr
|
|
|
165
165
|
pluginConfiguration: import("../../../plugins/text-formatting/types").TextFormattingOptions | undefined;
|
|
166
166
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"textFormatting", {
|
|
167
167
|
pluginConfiguration: import("../../../plugins/text-formatting/types").TextFormattingOptions | undefined;
|
|
168
|
-
}>, (config?: import("
|
|
169
|
-
pluginConfiguration: import("
|
|
168
|
+
}>, (config?: import("@atlaskit/editor-common/types").HyperlinkPluginOptions | undefined, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"hyperlink", {
|
|
169
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").HyperlinkPluginOptions | undefined;
|
|
170
170
|
dependencies: [(config: import("@atlaskit/editor-common/types").FeatureFlags, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"featureFlags", {
|
|
171
171
|
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
172
172
|
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
@@ -203,7 +203,7 @@ export declare function useMobilePreset({ media, placeholder, maxContentSize, cr
|
|
|
203
203
|
actions: import("@atlaskit/editor-common/analytics").EditorAnalyticsAPI;
|
|
204
204
|
}>>];
|
|
205
205
|
}> | undefined) => import("@atlaskit/editor-common/types").DefaultEditorPlugin<"hyperlink", {
|
|
206
|
-
pluginConfiguration: import("
|
|
206
|
+
pluginConfiguration: import("@atlaskit/editor-common/types").HyperlinkPluginOptions | undefined;
|
|
207
207
|
dependencies: [(config: import("@atlaskit/editor-common/types").FeatureFlags, api?: import("@atlaskit/editor-common/types").PluginInjectionAPI<"featureFlags", {
|
|
208
208
|
pluginConfiguration: import("@atlaskit/editor-common/types").FeatureFlags;
|
|
209
209
|
sharedState: import("@atlaskit/editor-common/types").FeatureFlags;
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -1,59 +1,8 @@
|
|
|
1
|
-
import commonMessages, { linkMessages } from '@atlaskit/editor-common/messages';
|
|
1
|
+
import commonMessages, { linkMessages, linkToolbarMessages } from '@atlaskit/editor-common/messages';
|
|
2
2
|
import { messages as statusMessages } from './plugins/status/nodeviews/messages';
|
|
3
3
|
import { messages as dateMessages } from './plugins/date/nodeviews/messages';
|
|
4
4
|
export { linkMessages };
|
|
5
5
|
export { statusMessages };
|
|
6
6
|
export { dateMessages };
|
|
7
|
-
export
|
|
8
|
-
addLink: {
|
|
9
|
-
id: string;
|
|
10
|
-
defaultMessage: string;
|
|
11
|
-
description: string;
|
|
12
|
-
};
|
|
13
|
-
unableToOpenLink: {
|
|
14
|
-
id: string;
|
|
15
|
-
defaultMessage: string;
|
|
16
|
-
description: string;
|
|
17
|
-
};
|
|
18
|
-
unlink: {
|
|
19
|
-
id: string;
|
|
20
|
-
defaultMessage: string;
|
|
21
|
-
description: string;
|
|
22
|
-
};
|
|
23
|
-
editLink: {
|
|
24
|
-
id: string;
|
|
25
|
-
defaultMessage: string;
|
|
26
|
-
description: string;
|
|
27
|
-
};
|
|
28
|
-
placeholder: {
|
|
29
|
-
id: string;
|
|
30
|
-
defaultMessage: string;
|
|
31
|
-
description: string;
|
|
32
|
-
};
|
|
33
|
-
linkPlaceholder: {
|
|
34
|
-
id: string;
|
|
35
|
-
defaultMessage: string;
|
|
36
|
-
description: string;
|
|
37
|
-
};
|
|
38
|
-
linkAddress: {
|
|
39
|
-
id: string;
|
|
40
|
-
defaultMessage: string;
|
|
41
|
-
description: string;
|
|
42
|
-
};
|
|
43
|
-
invalidLink: {
|
|
44
|
-
id: string;
|
|
45
|
-
defaultMessage: string;
|
|
46
|
-
description: string;
|
|
47
|
-
};
|
|
48
|
-
emptyLink: {
|
|
49
|
-
id: string;
|
|
50
|
-
defaultMessage: string;
|
|
51
|
-
description: string;
|
|
52
|
-
};
|
|
53
|
-
settingsLink: {
|
|
54
|
-
id: string;
|
|
55
|
-
defaultMessage: string;
|
|
56
|
-
description: string;
|
|
57
|
-
};
|
|
58
|
-
};
|
|
7
|
+
export { linkToolbarMessages };
|
|
59
8
|
export default commonMessages;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { SmartCardProps } from './genericCard';
|
|
4
|
-
import
|
|
4
|
+
import ReactNodeView from '@atlaskit/editor-common/react-node-view';
|
|
5
5
|
export declare class BlockCardComponent extends React.PureComponent<SmartCardProps> {
|
|
6
6
|
private scrollContainer?;
|
|
7
7
|
onClick: () => void;
|
|
@@ -4,9 +4,9 @@ import { EditorView } from 'prosemirror-view';
|
|
|
4
4
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
5
|
import { CardPlatform } from '@atlaskit/smart-card';
|
|
6
6
|
import { SmartCardContext } from '@atlaskit/link-provider';
|
|
7
|
-
import { getPosHandler, ReactComponentProps } from '
|
|
8
|
-
import { EventDispatcher } from '
|
|
9
|
-
import { DispatchAnalyticsEvent } from '
|
|
7
|
+
import { getPosHandler, ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
|
|
8
|
+
import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
9
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
10
10
|
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
11
11
|
import type cardPlugin from '../index';
|
|
12
12
|
export type EditorContext<T> = React.Context<T> & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { SmartCardProps } from './genericCard';
|
|
4
|
-
import { InlineNodeViewComponentProps } from '
|
|
4
|
+
import type { InlineNodeViewComponentProps } from '@atlaskit/editor-common/react-node-view';
|
|
5
5
|
export declare class InlineCardComponent extends React.PureComponent<SmartCardProps> {
|
|
6
6
|
private scrollContainer?;
|
|
7
7
|
private onClick;
|
|
@@ -2,7 +2,7 @@ import { CardPlatform } from '@atlaskit/smart-card';
|
|
|
2
2
|
import type { Command, FloatingToolbarHandler } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { CardOptions } from '@atlaskit/editor-common/card';
|
|
4
4
|
import { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
|
-
import { LinkPickerOptions } from '
|
|
5
|
+
import { LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
6
6
|
import type { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
8
8
|
import type cardPlugin from './index';
|
|
@@ -4,7 +4,7 @@ import { SmartLinkEvents } from '@atlaskit/smart-card';
|
|
|
4
4
|
import { CreateUIAnalyticsEvent, UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
5
|
import { CardOptions } from '@atlaskit/editor-common/card';
|
|
6
6
|
import type { EditorAppearance } from '@atlaskit/editor-common/types';
|
|
7
|
-
import { LinkPickerOptions } from '
|
|
7
|
+
import { LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
8
8
|
export type CardInfo = {
|
|
9
9
|
title?: string;
|
|
10
10
|
url?: string;
|
|
@@ -3,7 +3,7 @@ import { EditorView } from 'prosemirror-view';
|
|
|
3
3
|
import { Node } from 'prosemirror-model';
|
|
4
4
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
5
5
|
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
6
|
-
import { LinkPickerOptions } from '
|
|
6
|
+
import type { LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
7
7
|
import type { Command, FloatingToolbarItem, FloatingToolbarConfig } from '@atlaskit/editor-common/types';
|
|
8
8
|
import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
9
9
|
import { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import { RichMediaLayout } from '@atlaskit/adf-schema';
|
|
5
|
-
import {
|
|
5
|
+
import { ResizerProps } from '@atlaskit/editor-common/ui';
|
|
6
6
|
type State = {
|
|
7
7
|
offsetLeft: number;
|
|
8
8
|
resizedPctWidth?: number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { InlineNodeViewComponentProps } from '
|
|
2
|
+
import type { InlineNodeViewComponentProps } from '@atlaskit/editor-common/react-node-view';
|
|
3
3
|
export declare function DateNodeView(props: InlineNodeViewComponentProps): JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
3
|
-
import type { InlineNodeViewComponentProps } from '
|
|
3
|
+
import type { InlineNodeViewComponentProps } from '@atlaskit/editor-common/react-node-view';
|
|
4
4
|
export type Props = InlineNodeViewComponentProps & {
|
|
5
5
|
providerFactory: ProviderFactory;
|
|
6
6
|
};
|
|
@@ -4,7 +4,7 @@ import { EditorView } from 'prosemirror-view';
|
|
|
4
4
|
import { Node } from 'prosemirror-model';
|
|
5
5
|
import type { ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
6
6
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
7
|
-
import { DispatchAnalyticsEvent } from '
|
|
7
|
+
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
8
8
|
import { FloatingToolbarItem } from '../types';
|
|
9
9
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
10
10
|
import { FeatureFlags, PluginInjectionAPIWithDependency } from '@atlaskit/editor-common/types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FloatingToolbarHandler } from '../floating-toolbar/types';
|
|
2
|
-
import { HyperlinkPluginOptions } from '
|
|
2
|
+
import type { HyperlinkPluginOptions } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
4
4
|
import { EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
export declare const getToolbarConfig: (options: HyperlinkPluginOptions, featureFlags: FeatureFlags, editorAnalyticsApi: EditorAnalyticsAPI | undefined) => FloatingToolbarHandler;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
2
|
-
import { Command } from '../../types';
|
|
3
2
|
import { Predicate } from '../../utils/commands';
|
|
4
3
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
|
-
import { LinkInputType } from '
|
|
4
|
+
import type { Command, LinkInputType } from '@atlaskit/editor-common/types';
|
|
6
5
|
export declare function isTextAtPos(pos: number): Predicate;
|
|
7
6
|
export declare function isLinkAtPos(pos: number): Predicate;
|
|
8
7
|
export declare function setLinkHref(href: string, pos: number, to?: number, isTabPressed?: boolean): Command;
|
|
9
8
|
export declare function updateLink(href: string, text: string, pos: number, to?: number): Command;
|
|
10
9
|
export declare function insertLink(from: number, to: number, incomingHref: string, incomingTitle?: string, displayText?: string, source?: LinkInputType, sourceEvent?: UIAnalyticsEvent | null | undefined): Command;
|
|
11
10
|
export declare const insertLinkWithAnalytics: (inputMethod: LinkInputType, from: number, to: number, href: string, title?: string, displayText?: string, cardsAvailable?: boolean, sourceEvent?: UIAnalyticsEvent | null | undefined) => Command;
|
|
12
|
-
export declare const insertLinkWithAnalyticsMobileNative: (inputMethod: LinkInputType, from: number, to: number, href: string, title?: string, displayText?: string) => Command;
|
|
11
|
+
export declare const insertLinkWithAnalyticsMobileNative: (inputMethod: LinkInputType, from: number, to: number, href: string, title?: string, displayText?: string) => import("../..").Command;
|
|
13
12
|
export declare function removeLink(pos: number): Command;
|
|
14
13
|
export declare function editInsertedLink(): Command;
|
|
15
14
|
export declare function showLinkToolbar(inputMethod?: INPUT_METHOD.TOOLBAR | INPUT_METHOD.QUICK_INSERT | INPUT_METHOD.SHORTCUT | INPUT_METHOD.INSERT_MENU): Command;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
-
import { HyperlinkPluginOptions } from '
|
|
2
|
+
import type { HyperlinkPluginOptions } from '@atlaskit/editor-common/types';
|
|
3
3
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
4
4
|
import type { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
5
5
|
declare const hyperlinkPlugin: NextEditorPlugin<'hyperlink', {
|
|
@@ -9,7 +9,7 @@ import { WithAnalyticsEventsProps } from '@atlaskit/analytics-next';
|
|
|
9
9
|
import { LinkSearchListItemData } from '../../../../ui/LinkSearch/types';
|
|
10
10
|
import { HyperlinkState } from '../../pm-plugins/main';
|
|
11
11
|
import { EditorView } from 'prosemirror-view';
|
|
12
|
-
import { LinkInputType } from '
|
|
12
|
+
import type { LinkInputType } from '@atlaskit/editor-common/types';
|
|
13
13
|
export declare const RECENT_SEARCH_LIST_SIZE = 5;
|
|
14
14
|
export declare const messages: {
|
|
15
15
|
displayText: {
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { EditorView } from 'prosemirror-view';
|
|
3
3
|
import { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
4
4
|
import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
|
|
5
|
-
import { LinkInputType, LinkPickerOptions } from '
|
|
5
|
+
import type { LinkInputType, LinkPickerOptions } from '@atlaskit/editor-common/types';
|
|
6
6
|
import { EditorLinkPickerProps } from '../EditorLinkPicker';
|
|
7
7
|
import { FeatureFlags } from '@atlaskit/editor-common/types';
|
|
8
8
|
export interface Props extends Pick<EditorLinkPickerProps, 'onCancel' | 'invokeMethod'> {
|
|
@@ -5,7 +5,6 @@ import type { GridType } from '@atlaskit/editor-common/types';
|
|
|
5
5
|
import { EditorView } from 'prosemirror-view';
|
|
6
6
|
import { getPosHandler } from '../../../../nodeviews/types';
|
|
7
7
|
import type { DispatchAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
8
|
-
import { ResolvedPos } from 'prosemirror-model';
|
|
9
8
|
export type EnabledHandles = {
|
|
10
9
|
left?: boolean;
|
|
11
10
|
right?: boolean;
|
|
@@ -24,17 +23,3 @@ export type Props = MediaSingleProps & {
|
|
|
24
23
|
fullWidthMode?: boolean;
|
|
25
24
|
dispatchAnalyticsEvent: DispatchAnalyticsEvent;
|
|
26
25
|
};
|
|
27
|
-
export interface SnapPointsProps {
|
|
28
|
-
$pos?: ResolvedPos | null;
|
|
29
|
-
akEditorWideLayoutWidth: number;
|
|
30
|
-
allowBreakoutSnapPoints?: boolean;
|
|
31
|
-
containerWidth: number;
|
|
32
|
-
gridSize: number;
|
|
33
|
-
gridWidth: number;
|
|
34
|
-
insideInlineLike: boolean;
|
|
35
|
-
insideLayout: boolean;
|
|
36
|
-
isVideoFile: boolean;
|
|
37
|
-
lineLength: number;
|
|
38
|
-
offsetLeft: number;
|
|
39
|
-
wrappedLayout: boolean;
|
|
40
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EditorState } from 'prosemirror-state';
|
|
2
2
|
import { EditorView } from 'prosemirror-view';
|
|
3
3
|
import { MediaState } from '../types';
|
|
4
|
-
import { InputMethodInsertMedia } from '
|
|
4
|
+
import { InputMethodInsertMedia } from '@atlaskit/editor-common/analytics';
|
|
5
5
|
export interface Range {
|
|
6
6
|
start: number;
|
|
7
7
|
end: number;
|