@atlaskit/editor-core 188.12.2 → 188.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/create-editor/sort-by-order.js +13 -20
  3. package/dist/cjs/plugins/annotation/utils.js +23 -43
  4. package/dist/cjs/plugins/code-block/utils.js +18 -43
  5. package/dist/cjs/plugins/paste/actions.js +1 -0
  6. package/dist/cjs/plugins/paste/handlers.js +36 -18
  7. package/dist/cjs/plugins/paste/plugin.js +12 -0
  8. package/dist/cjs/plugins/paste/pm-plugins/analytics.js +6 -6
  9. package/dist/cjs/plugins/paste/pm-plugins/main.js +72 -53
  10. package/dist/cjs/plugins/paste/reducer.js +6 -0
  11. package/dist/cjs/plugins/paste/util/index.js +2 -2
  12. package/dist/cjs/plugins/rank.js +2 -27
  13. package/dist/cjs/plugins/tasks-and-decisions/utils.js +8 -12
  14. package/dist/cjs/version-wrapper.js +1 -1
  15. package/dist/es2019/create-editor/sort-by-order.js +1 -17
  16. package/dist/es2019/plugins/annotation/utils.js +6 -43
  17. package/dist/es2019/plugins/code-block/utils.js +1 -44
  18. package/dist/es2019/plugins/paste/actions.js +1 -0
  19. package/dist/es2019/plugins/paste/handlers.js +18 -3
  20. package/dist/es2019/plugins/paste/plugin.js +12 -0
  21. package/dist/es2019/plugins/paste/pm-plugins/analytics.js +3 -3
  22. package/dist/es2019/plugins/paste/pm-plugins/main.js +30 -13
  23. package/dist/es2019/plugins/paste/reducer.js +7 -0
  24. package/dist/es2019/plugins/paste/util/index.js +1 -1
  25. package/dist/es2019/plugins/rank.js +2 -27
  26. package/dist/es2019/plugins/tasks-and-decisions/utils.js +2 -12
  27. package/dist/es2019/version-wrapper.js +1 -1
  28. package/dist/esm/create-editor/sort-by-order.js +1 -17
  29. package/dist/esm/plugins/annotation/utils.js +8 -37
  30. package/dist/esm/plugins/code-block/utils.js +1 -42
  31. package/dist/esm/plugins/paste/actions.js +1 -0
  32. package/dist/esm/plugins/paste/handlers.js +23 -3
  33. package/dist/esm/plugins/paste/plugin.js +12 -0
  34. package/dist/esm/plugins/paste/pm-plugins/analytics.js +3 -3
  35. package/dist/esm/plugins/paste/pm-plugins/main.js +30 -13
  36. package/dist/esm/plugins/paste/reducer.js +6 -0
  37. package/dist/esm/plugins/paste/util/index.js +1 -1
  38. package/dist/esm/plugins/rank.js +2 -27
  39. package/dist/esm/plugins/tasks-and-decisions/utils.js +2 -12
  40. package/dist/esm/version-wrapper.js +1 -1
  41. package/dist/types/create-editor/sort-by-order.d.ts +1 -14
  42. package/dist/types/plugins/annotation/utils.d.ts +3 -3
  43. package/dist/types/plugins/code-block/utils.d.ts +1 -6
  44. package/dist/types/plugins/paste/actions.d.ts +8 -2
  45. package/dist/types/plugins/paste/handlers.d.ts +2 -2
  46. package/dist/types/plugins/paste/pm-plugins/analytics.d.ts +1 -1
  47. package/dist/types/plugins/paste/pm-plugins/main.d.ts +2 -2
  48. package/dist/types/plugins/paste/reducer.d.ts +2 -2
  49. package/dist/types/plugins/rank.d.ts +2 -6
  50. package/dist/types/plugins/tasks-and-decisions/utils.d.ts +2 -3
  51. package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
  52. package/dist/types/ui/ContentStyles/index.d.ts +2 -2
  53. package/dist/types-ts4.5/create-editor/sort-by-order.d.ts +1 -14
  54. package/dist/types-ts4.5/plugins/annotation/utils.d.ts +3 -3
  55. package/dist/types-ts4.5/plugins/code-block/utils.d.ts +1 -6
  56. package/dist/types-ts4.5/plugins/paste/actions.d.ts +8 -2
  57. package/dist/types-ts4.5/plugins/paste/handlers.d.ts +2 -2
  58. package/dist/types-ts4.5/plugins/paste/pm-plugins/analytics.d.ts +1 -1
  59. package/dist/types-ts4.5/plugins/paste/pm-plugins/main.d.ts +2 -2
  60. package/dist/types-ts4.5/plugins/paste/reducer.d.ts +2 -2
  61. package/dist/types-ts4.5/plugins/rank.d.ts +2 -6
  62. package/dist/types-ts4.5/plugins/tasks-and-decisions/utils.d.ts +2 -3
  63. package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +1 -1
  64. package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
  65. package/package.json +3 -3
@@ -3,28 +3,28 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
3
  import uuid from 'uuid';
4
4
  import { MarkdownTransformer } from '@atlaskit/editor-markdown-transformer';
5
5
  import { addLinkMetadata } from '@atlaskit/editor-common/card';
6
- import { mapChildren } from '../../../utils/slice';
6
+ import { containsAnyAnnotations, extractSliceFromStep, linkifyContent, mapChildren, measureRender } from '@atlaskit/editor-common/utils';
7
+ import { handlePaste as handlePasteTable } from '@atlaskit/editor-tables/utils';
7
8
  import { getExtensionAutoConvertersFromProvider } from '@atlaskit/editor-common/extensions';
8
- import { isPastedFile as isPastedFileFromEvent, md } from '@atlaskit/editor-common/paste';
9
+ import { ACTION, INPUT_METHOD, PasteTypes } from '@atlaskit/editor-common/analytics';
10
+ import { md, isPastedFile as isPastedFileFromEvent } from '@atlaskit/editor-common/paste';
9
11
  import { transformSliceForMedia, transformSliceToCorrectMediaWrapper, transformSliceToMediaSingleWithNewExperience, unwrapNestedMediaElements } from '../plugins/media';
10
- import { escapeLinks, htmlContainsSingleFile, isPastedFromWord, isPastedFromExcel, htmlHasInvalidLinkTags, removeDuplicateInvalidLinks, transformUnsupportedBlockCardToInline } from '../util';
11
- import { linkifyContent, measureRender } from '@atlaskit/editor-common/utils';
12
- import { transformSliceNestedExpandToExpand } from '../../expand/utils';
12
+ import { escapeLinks, htmlContainsSingleFile, isPastedFromWord, isPastedFromExcel, htmlHasInvalidLinkTags, removeDuplicateInvalidLinks, transformUnsupportedBlockCardToInline, getPasteSource } from '../util';
13
+ import { transformSliceNestedExpandToExpand, transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark, transformSliceToDecisionList } from '@atlaskit/editor-common/transforms';
13
14
  import { handleMacroAutoConvert, handleMention, handleParagraphBlockMarks } from '../handlers';
14
- import { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark } from '../../code-block/utils';
15
15
  import { createPasteMeasurePayload, getContentNodeTypes, handlePasteAsPlainTextWithAnalytics, handlePasteIntoTaskAndDecisionWithAnalytics, handleCodeBlockWithAnalytics, handleMediaSingleWithAnalytics, handlePastePreservingMarksWithAnalytics, handleMarkdownWithAnalytics, handleRichTextWithAnalytics, handleExpandWithAnalytics, handleSelectedTableWithAnalytics, handlePasteLinkOnSelectedTextWithAnalytics, sendPasteAnalyticsEvent, handlePasteIntoCaptionWithAnalytics, handlePastePanelOrDecisionIntoListWithAnalytics, handlePasteNonNestableBlockNodesIntoListWithAnalytics } from './analytics';
16
- import { ACTION, analyticsPluginKey, INPUT_METHOD, PasteTypes } from '../../analytics';
16
+ // TODO: ED-20519 It requires full analytics extraction to use the plugin injection API
17
+ import { analyticsPluginKey } from '../../analytics';
17
18
  import { isInsideBlockQuote, insideTable, measurements } from '../../../utils';
18
19
  import { upgradeTextToLists, splitParagraphs } from '../commands';
19
- import { transformSliceToDecisionList } from '../../tasks-and-decisions/utils';
20
- import { containsAnyAnnotations, stripNonExistingAnnotations } from '../../annotation/utils';
20
+ // TODO: ED-20519 It requires annotation extraction to use the plugin injection API
21
+ import { stripNonExistingAnnotations } from '../../annotation/utils';
21
22
  import { clipboardTextSerializer } from './clipboard-text-serializer';
22
23
  import { htmlHasIncompleteTable, tryRebuildCompleteTableHtml, isPastedFromTinyMCEConfluence } from '../util/tinyMCE';
23
- import { handlePaste as handlePasteTable } from '@atlaskit/editor-tables/utils';
24
- import { extractSliceFromStep } from '../../../utils/step';
25
24
  import { pluginKey as stateKey, createPluginState } from './plugin-factory';
26
25
  export { pluginKey as stateKey } from './plugin-factory';
27
26
  import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
27
+ import { PastePluginActionTypes } from '../actions';
28
28
  export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pluginInjectionApi, cardOptions, sanitizePrivateContent, providerFactory) {
29
29
  const atlassianMarkDownParser = new MarkdownTransformer(schema, md);
30
30
  function getMarkdownSlice(text, openStart, openEnd) {
@@ -62,7 +62,8 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
62
62
  return new SafePlugin({
63
63
  key: stateKey,
64
64
  state: createPluginState(dispatch, {
65
- pastedMacroPositions: {}
65
+ pastedMacroPositions: {},
66
+ lastContentPasted: null
66
67
  }),
67
68
  props: {
68
69
  // For serialising to plain text
@@ -145,7 +146,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
145
146
  }
146
147
  // creating a custom dispatch because we want to add a meta whenever we do a paste.
147
148
  const dispatch = tr => {
148
- var _state$doc$resolve$no;
149
+ var _state$doc$resolve$no, _input;
149
150
  // https://product-fabric.atlassian.net/browse/ED-12633
150
151
  // don't add closeHistory call if we're pasting a text inside placeholder text as we want the whole action
151
152
  // to be atomic
@@ -182,6 +183,22 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
182
183
  action: isPlainText ? ACTION.PASTED_AS_PLAIN : ACTION.PASTED,
183
184
  inputMethod: INPUT_METHOD.CLIPBOARD
184
185
  });
186
+ const pasteStartPos = Math.min(state.selection.anchor, state.selection.head);
187
+ const pasteEndPos = tr.selection.to;
188
+ const contentPasted = {
189
+ pasteStartPos,
190
+ pasteEndPos,
191
+ text,
192
+ isShiftPressed: Boolean(view.shiftKey || ((_input = view.input) === null || _input === void 0 ? void 0 : _input.shiftKey)),
193
+ isPlainText: Boolean(isPlainText),
194
+ pastedSlice: tr.doc.slice(pasteStartPos, pasteEndPos),
195
+ pastedAt: Date.now(),
196
+ pasteSource: getPasteSource(event)
197
+ };
198
+ tr.setMeta(stateKey, {
199
+ type: PastePluginActionTypes.ON_PASTE,
200
+ contentPasted
201
+ });
185
202
  view.dispatch(tr);
186
203
  };
187
204
  slice = handleParagraphBlockMarks(state, slice);
@@ -19,6 +19,13 @@ export const reducer = (state, action) => {
19
19
  pastedMacroPositions: filteredMacroPositions
20
20
  };
21
21
  }
22
+ case ActionTypes.ON_PASTE:
23
+ {
24
+ return {
25
+ ...state,
26
+ lastContentPasted: action.contentPasted
27
+ };
28
+ }
22
29
  default:
23
30
  return state;
24
31
  }
@@ -4,7 +4,7 @@ import { ACTION_SUBJECT, addAnalytics, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION }
4
4
  import { TextSelection, NodeSelection } from '@atlaskit/editor-prosemirror/state';
5
5
  import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
6
6
  import { getSelectedTableInfo, isTableSelected } from '@atlaskit/editor-tables/utils';
7
- import { sortByOrderWithTypeName } from '../../../create-editor/sort-by-order';
7
+ import { sortByOrderWithTypeName } from '@atlaskit/editor-common/legacy-rank-plugins';
8
8
  import { isSupportedInParent, mapChildren } from '@atlaskit/editor-common/utils';
9
9
  export function isPastedFromWord(html) {
10
10
  return !!html && html.indexOf('urn:schemas-microsoft-com:office:word') >= 0;
@@ -1,27 +1,2 @@
1
- export default {
2
- plugins: ['featureFlagsContextPlugin', 'compositionPlugin', 'inlineCursorTargetPlugin', 'typeAhead', 'typeAheadInsertItem', 'focusHandlerPlugin', 'frozenEditor', 'submitEditor', 'saveOnEnter', 'customAutoformatting', 'newlinePreserveMarksPlugin', 'imageUpload', 'imageUploadInputRule', 'clipboard', 'paste', 'pasteKeymap', 'mention', 'mentionInputRule', 'mentionKeymap', 'emoji', 'placeholderText', 'emojiInputRule', 'emojiKeymap', 'emojiAsciiInputRule', 'blockType', 'quickInsert', 'tasksAndDecisions', 'blockTypeInputRule', 'tasksAndDecisionsInputRule', 'list', 'typeAheadKeymap', 'typeAheadInputRule', 'date',
3
- // Needs to be before indentation to handle tab into input field
4
- 'dateKeymap',
5
- // This should be always after `typeAheadKeymap` & `emojiKeymap`
6
- 'indentationKeymap', 'textColor', 'alignmentPlugin', 'listInputRule', 'listKeymap', 'codeBlock', 'codeBlockIDEKeyBindings', 'codeBlockKeyMap', 'textFormatting', 'textFormattingCursor', 'textFormattingInputRule', 'textFormattingSmartRule', 'textFormattingClear', 'textFormattingKeymap',
7
- // task/decisions keymap needs to be above table keymap so can indent actions in a table
8
- 'tasksAndDecisionsKeyMap',
9
- // expand and table keymaps need to be above selection keymap to add their custom selection behaviour:
10
- // https://product-fabric.atlassian.net/wiki/spaces/E/pages/1113098008/Selection+Guide#Special-Cases
11
- 'expandKeymap', 'tableSelectionKeymap', 'tableKeymap', 'captionKeymap',
12
- // media keymap above selection keymap to allow navigating past the mediaSingle node
13
- 'mediaKeymap',
14
- // selection keymap needs to be above gap cursor keymap so it can set node selections from
15
- // left/right arrows
16
- 'selectionKeymap', 'gapCursorKeymap', 'gapCursor', 'syncUrlText', 'fakeCursorToolbarPlugin', 'hyperLink', 'table', 'tableDecorations', 'hyperlinkInputRule', 'tablePMColResizing', 'hyperlinkKeymap', 'tableColResizing', 'undoRedoKeyMap', 'blockTypeKeyMap', 'tableEditing', 'filterStepsPlugin', 'pmCollab', 'collab', 'ruleInputRule', 'ruleKeymap', 'panel', 'media', 'mediaSingleKeymap', 'mediaEditor', 'unsupportedContent', 'jiraIssue', 'fakeTextCursor', 'helpDialog', 'helpDialogKeymap', 'macro', 'expand', 'extension', 'layout', 'contextPanel', 'selectionToolbar', 'floatingToolbar', 'clearMarksOnChange', 'reactNodeView', 'history', 'undoRedoPlugin', 'codeBlockIndent', 'placeholder', 'width', 'maxContentSize', 'multilineContent', 'grid', 'mobileDimensions', 'scrollGutterPlugin', 'analytics', 'findReplace', 'selection', 'avatarGroup', 'viewUpdateSubscription', 'beforePrimaryToolbar', 'inlineCode'],
17
- nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'rule', 'panel', 'mention', 'confluenceUnsupportedBlock', 'confluenceUnsupportedInline', 'unsupportedBlock', 'unsupportedInline', 'confluenceJiraIssue', 'hardBreak', 'emoji', 'placeholder', 'mediaSingle', 'mediaGroup', 'table', 'expand', 'nestedExpand', 'media', 'tableHeader', 'decisionList', 'tableRow', 'decisionItem', 'tableCell', 'taskList', 'taskItem', 'extension', 'bodiedExtension', 'inlineExtension', 'layoutSection', 'layoutColumn', 'inlineCard', 'blockCard', 'embedCard'],
18
- marks: [
19
- // Fragment mark is both for inline and block elements
20
- 'fragment',
21
- // Inline marks
22
- 'link', 'em', 'strong', 'textColor', 'strike', 'subsup', 'underline', 'code', 'typeAheadQuery',
23
- // Block marks
24
- 'alignment', 'breakout', 'indentation', 'annotation', 'dataConsumer', 'border',
25
- // Unsupported mark
26
- 'unsupportedMark', 'unsupportedNodeAttribute']
27
- };
1
+ import { rankEditorPlugins } from '@atlaskit/editor-common/legacy-rank-plugins';
2
+ export default rankEditorPlugins;
@@ -1,16 +1,6 @@
1
- import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
2
1
  import { NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
3
-
4
- // If slice is decisionItem, wrap it inside a decisionList. This prevents an
5
- // additional newline from being pasted along with the selected decision item.
6
- export const transformSliceToDecisionList = (slice, schema) => {
7
- const node = slice.content.firstChild;
8
- if (slice.content.childCount === 1 && node && node.type.name === 'decisionItem') {
9
- const decisionListWrapperNode = schema.nodes.decisionList.create({}, node);
10
- return new Slice(Fragment.from(decisionListWrapperNode), slice.openStart, slice.openEnd);
11
- }
12
- return slice;
13
- };
2
+ import { transformSliceToDecisionList } from '@atlaskit/editor-common/transforms';
3
+ export { transformSliceToDecisionList };
14
4
  function isTaskListNode(node) {
15
5
  return Boolean(node && node.type && 'taskList' === node.type.name);
16
6
  }
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "188.12.2";
2
+ export const version = "188.13.0";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,17 +1 @@
1
- import Ranks from '../plugins/rank';
2
- export function sortByOrder(item) {
3
- return function (a, b) {
4
- return Ranks[item].indexOf(a.name) - Ranks[item].indexOf(b.name);
5
- };
6
- }
7
-
8
- // while functionally the same, in order to avoid potentially rewriting the ~10
9
- // existing implementations of the above function I decided creating a separate
10
- // function avoided that whole mess. If someone can think of a better way to implement
11
- // the above and below into a single function please do so
12
-
13
- export function sortByOrderWithTypeName(item) {
14
- return function (a, b) {
15
- return Ranks[item].indexOf(a.type.name) - Ranks[item].indexOf(b.type.name);
16
- };
17
- }
1
+ export { sortByOrder, sortByOrderWithTypeName } from '@atlaskit/editor-common/legacy-rank-plugins';
@@ -1,11 +1,16 @@
1
1
  import { PluginKey, TextSelection, AllSelection } from '@atlaskit/editor-prosemirror/state';
2
2
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
3
3
  import { AnnotationSharedClassNames } from '@atlaskit/editor-common/styles';
4
- import { canApplyAnnotationOnRange, getAnnotationIdsFromRange } from '@atlaskit/editor-common/utils';
4
+ import { canApplyAnnotationOnRange, getAnnotationIdsFromRange, isText, isParagraph, hasAnnotationMark, containsAnyAnnotations } from '@atlaskit/editor-common/utils';
5
5
  import { AnnotationTypes } from '@atlaskit/adf-schema';
6
6
  import { AnnotationSelectionType } from './types';
7
- import { isText, isParagraph, sum } from '../../utils';
8
- import { ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, ACTION } from '../analytics';
7
+ import { ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, ACTION } from '@atlaskit/editor-common/analytics';
8
+ export { hasAnnotationMark, containsAnyAnnotations };
9
+ function sum(arr, f) {
10
+ return arr.reduce(function (val, x) {
11
+ return val + f(x);
12
+ }, 0);
13
+ }
9
14
  /**
10
15
  * Finds the marks in the nodes to the left and right.
11
16
  * @param $pos Position to center search around
@@ -285,14 +290,6 @@ export function hasInvalidWhitespaceNode(selection, schema) {
285
290
  return foundInvalidWhitespace;
286
291
  }
287
292
 
288
- /*
289
- * verifies if node contains annotation mark
290
- */
291
- export function hasAnnotationMark(node, state) {
292
- var annotationMark = state.schema.marks.annotation;
293
- return !!(annotationMark && node && node.marks.length && annotationMark.isInSet(node.marks));
294
- }
295
-
296
293
  /*
297
294
  * verifies that the annotation exists by the given id
298
295
  */
@@ -301,32 +298,6 @@ export function annotationExists(annotationId, state) {
301
298
  return !!(commentsPluginState !== null && commentsPluginState !== void 0 && commentsPluginState.annotations) && Object.keys(commentsPluginState.annotations).includes(annotationId);
302
299
  }
303
300
 
304
- /*
305
- * verifies that slice contains any annotations
306
- */
307
- export function containsAnyAnnotations(slice, state) {
308
- if (!slice.content.size) {
309
- return false;
310
- }
311
- var hasAnnotation = false;
312
- slice.content.forEach(function (node) {
313
- hasAnnotation = hasAnnotation || hasAnnotationMark(node, state);
314
- // return early if annotation found already
315
- if (hasAnnotation) {
316
- return true;
317
- }
318
- // check annotations in descendants
319
- node.descendants(function (node) {
320
- if (hasAnnotationMark(node, state)) {
321
- hasAnnotation = true;
322
- return false;
323
- }
324
- return true;
325
- });
326
- });
327
- return hasAnnotation;
328
- }
329
-
330
301
  /*
331
302
  * remove annotations that dont exsist in plugin state from slice
332
303
  */
@@ -1,42 +1 @@
1
- import { Slice, Fragment } from '@atlaskit/editor-prosemirror/model';
2
- import { mapSlice } from '../../utils/slice';
3
- import { findSelectedNodeOfType, findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
4
- function joinCodeBlocks(left, right) {
5
- var textContext = "".concat(left.textContent, "\n").concat(right.textContent);
6
- return left.type.create(left.attrs, left.type.schema.text(textContext));
7
- }
8
- function mergeAdjacentCodeBlocks(fragment) {
9
- var children = [];
10
- fragment.forEach(function (maybeCodeBlock) {
11
- if (maybeCodeBlock.type === maybeCodeBlock.type.schema.nodes.codeBlock) {
12
- var peekAtPrevious = children[children.length - 1];
13
- if (peekAtPrevious && peekAtPrevious.type === maybeCodeBlock.type) {
14
- return children.push(joinCodeBlocks(children.pop(), maybeCodeBlock));
15
- }
16
- }
17
- return children.push(maybeCodeBlock);
18
- });
19
- return Fragment.from(children);
20
- }
21
- export function transformSliceToJoinAdjacentCodeBlocks(slice) {
22
- slice = mapSlice(slice, function (node) {
23
- return node.isBlock && !node.isTextblock ? node.copy(mergeAdjacentCodeBlocks(node.content)) : node;
24
- });
25
- // mapSlice won't be able to merge adjacent top-level code-blocks
26
- return new Slice(mergeAdjacentCodeBlocks(slice.content), slice.openStart, slice.openEnd);
27
- }
28
- export var transformSingleLineCodeBlockToCodeMark = function transformSingleLineCodeBlockToCodeMark(slice, schema) {
29
- if (slice.content.childCount === 1 && (slice.openStart || slice.openEnd)) {
30
- var maybeCodeBlock = slice.content.firstChild;
31
- if (maybeCodeBlock && maybeCodeBlock.type === schema.nodes.codeBlock) {
32
- if (maybeCodeBlock.textContent && maybeCodeBlock.textContent.indexOf('\n') === -1) {
33
- return new Slice(Fragment.from(schema.text(maybeCodeBlock.textContent, [schema.marks.code.create()])), 0, 0);
34
- }
35
- }
36
- }
37
- return slice;
38
- };
39
- export var findCodeBlock = function findCodeBlock(state, selection) {
40
- var codeBlock = state.schema.nodes.codeBlock;
41
- return findSelectedNodeOfType(codeBlock)(selection || state.selection) || findParentNodeOfType(codeBlock)(selection || state.selection);
42
- };
1
+ export { findCodeBlock, transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark } from '@atlaskit/editor-common/transforms';
@@ -1,5 +1,6 @@
1
1
  export var PastePluginActionTypes = /*#__PURE__*/function (PastePluginActionTypes) {
2
2
  PastePluginActionTypes["START_TRACKING_PASTED_MACRO_POSITIONS"] = "START_TRACKING_PASTED_MACRO_POSITIONS";
3
3
  PastePluginActionTypes["STOP_TRACKING_PASTED_MACRO_POSITIONS"] = "STOP_TRACKING_PASTED_MACRO_POSITIONS";
4
+ PastePluginActionTypes["ON_PASTE"] = "ON_PASTE";
4
5
  return PastePluginActionTypes;
5
6
  }({});
@@ -12,17 +12,37 @@ import { TextSelection, NodeSelection } from '@atlaskit/editor-prosemirror/state
12
12
  import { canInsert, findParentNodeOfType, findParentNodeOfTypeClosestToPos, hasParentNodeOfType, safeInsert } from '@atlaskit/editor-prosemirror/utils';
13
13
  import uuid from 'uuid/v4';
14
14
  import { replaceSelectedTable } from '@atlaskit/editor-tables/utils';
15
- import { compose, insideTable, isParagraph, isText, isLinkMark, insideTableCell, isInListItem } from '../../utils';
16
- import { mapSlice } from '../../utils/slice';
15
+ import { canLinkBeCreatedInRange, insideTableCell, isInListItem, isLinkMark, isListItemNode, isListNode, isParagraph, isText, linkifyContent, mapSlice } from '@atlaskit/editor-common/utils';
16
+ import { insideTable } from '@atlaskit/editor-common/core-utils';
17
17
  import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
18
18
  import { GapCursorSelection, Side } from '@atlaskit/editor-common/selection';
19
+ // TODO: ED-20519 Needs Macro extraction
19
20
  import { runMacroAutoConvert } from '../macro';
20
21
  import { addReplaceSelectedTableAnalytics, applyTextMarksToSlice, hasOnlyNodesOfType } from './util';
21
- import { linkifyContent, isListItemNode, isListNode, canLinkBeCreatedInRange } from '@atlaskit/editor-common/utils';
22
22
  import { insertSliceForLists } from './edge-cases';
23
23
  import { startTrackingPastedMacroPositions, stopTrackingPastedMacroPositions } from './commands';
24
24
  import { getPluginState as getPastePluginState } from './pm-plugins/plugin-factory';
25
25
  import { anyMarkActive } from '@atlaskit/editor-common/mark';
26
+
27
+ /** Helper type for single arg function */
28
+
29
+ /**
30
+ * Compose 1 to n functions.
31
+ * @param func first function
32
+ * @param funcs additional functions
33
+ */
34
+ function compose(func) {
35
+ for (var _len = arguments.length, funcs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
36
+ funcs[_key - 1] = arguments[_key];
37
+ }
38
+ var allFuncs = [func].concat(funcs);
39
+ return function composed(raw) {
40
+ return allFuncs.reduceRight(function (memo, func) {
41
+ return func(memo);
42
+ }, raw);
43
+ };
44
+ }
45
+
26
46
  // remove text attribute from mention for copy/paste (GDPR)
27
47
  export function handleMention(slice, schema) {
28
48
  return mapSlice(slice, function (node) {
@@ -1,4 +1,5 @@
1
1
  import { createPlugin } from './pm-plugins/main';
2
+ import { pluginKey } from './pm-plugins/plugin-factory';
2
3
  export var pastePlugin = function pastePlugin(_ref) {
3
4
  var _api$featureFlags;
4
5
  var config = _ref.config,
@@ -20,6 +21,17 @@ export var pastePlugin = function pastePlugin(_ref) {
20
21
  return createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, api, cardOptions, sanitizePrivateContent, providerFactory);
21
22
  }
22
23
  }];
24
+ },
25
+ getSharedState: function getSharedState(editorState) {
26
+ if (!editorState) {
27
+ return {
28
+ lastContentPasted: null
29
+ };
30
+ }
31
+ var pluginState = pluginKey.getState(editorState);
32
+ return {
33
+ lastContentPasted: pluginState.lastContentPasted
34
+ };
23
35
  }
24
36
  };
25
37
  };
@@ -2,12 +2,12 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
4
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
- import { ACTION, INPUT_METHOD, EVENT_TYPE, ACTION_SUBJECT, ACTION_SUBJECT_ID, addAnalytics, PasteTypes, PasteContents } from '../../analytics';
5
+ import { ACTION, INPUT_METHOD, EVENT_TYPE, ACTION_SUBJECT, ACTION_SUBJECT_ID, PasteTypes, PasteContents } from '@atlaskit/editor-common/analytics';
6
+ import { addAnalytics } from '../../analytics';
6
7
  import { getPasteSource } from '../util';
7
8
  import { handlePasteAsPlainText, handlePasteIntoTaskOrDecisionOrPanel, handleCodeBlock, handleMediaSingle, handlePastePreservingMarks, handleMarkdown, handleRichText, handleExpandPasteInTable, handleSelectedTable, handlePasteLinkOnSelectedText, handlePasteIntoCaption, handlePastePanelOrDecisionContentIntoList, handlePasteNonNestableBlockNodesIntoList } from '../handlers';
8
9
  import { findParentNode } from '@atlaskit/editor-prosemirror/utils';
9
- import { mapSlice } from '../../../utils/slice';
10
- import { getLinkDomain } from '@atlaskit/editor-common/utils';
10
+ import { getLinkDomain, mapSlice } from '@atlaskit/editor-common/utils';
11
11
  var contentToPasteContent = {
12
12
  url: PasteContents.url,
13
13
  paragraph: PasteContents.text,
@@ -5,28 +5,28 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
5
5
  import uuid from 'uuid';
6
6
  import { MarkdownTransformer } from '@atlaskit/editor-markdown-transformer';
7
7
  import { addLinkMetadata } from '@atlaskit/editor-common/card';
8
- import { mapChildren } from '../../../utils/slice';
8
+ import { containsAnyAnnotations, extractSliceFromStep, linkifyContent, mapChildren, measureRender } from '@atlaskit/editor-common/utils';
9
+ import { handlePaste as handlePasteTable } from '@atlaskit/editor-tables/utils';
9
10
  import { getExtensionAutoConvertersFromProvider } from '@atlaskit/editor-common/extensions';
10
- import { isPastedFile as isPastedFileFromEvent, md } from '@atlaskit/editor-common/paste';
11
+ import { ACTION, INPUT_METHOD, PasteTypes } from '@atlaskit/editor-common/analytics';
12
+ import { md, isPastedFile as isPastedFileFromEvent } from '@atlaskit/editor-common/paste';
11
13
  import { transformSliceForMedia, transformSliceToCorrectMediaWrapper, transformSliceToMediaSingleWithNewExperience, unwrapNestedMediaElements } from '../plugins/media';
12
- import { escapeLinks, htmlContainsSingleFile, isPastedFromWord, isPastedFromExcel, htmlHasInvalidLinkTags, removeDuplicateInvalidLinks, transformUnsupportedBlockCardToInline } from '../util';
13
- import { linkifyContent, measureRender } from '@atlaskit/editor-common/utils';
14
- import { transformSliceNestedExpandToExpand } from '../../expand/utils';
14
+ import { escapeLinks, htmlContainsSingleFile, isPastedFromWord, isPastedFromExcel, htmlHasInvalidLinkTags, removeDuplicateInvalidLinks, transformUnsupportedBlockCardToInline, getPasteSource } from '../util';
15
+ import { transformSliceNestedExpandToExpand, transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark, transformSliceToDecisionList } from '@atlaskit/editor-common/transforms';
15
16
  import { handleMacroAutoConvert, handleMention, handleParagraphBlockMarks } from '../handlers';
16
- import { transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark } from '../../code-block/utils';
17
17
  import { createPasteMeasurePayload, getContentNodeTypes, handlePasteAsPlainTextWithAnalytics, handlePasteIntoTaskAndDecisionWithAnalytics, handleCodeBlockWithAnalytics, handleMediaSingleWithAnalytics, handlePastePreservingMarksWithAnalytics, handleMarkdownWithAnalytics, handleRichTextWithAnalytics, handleExpandWithAnalytics, handleSelectedTableWithAnalytics, handlePasteLinkOnSelectedTextWithAnalytics, sendPasteAnalyticsEvent, handlePasteIntoCaptionWithAnalytics, handlePastePanelOrDecisionIntoListWithAnalytics, handlePasteNonNestableBlockNodesIntoListWithAnalytics } from './analytics';
18
- import { ACTION, analyticsPluginKey, INPUT_METHOD, PasteTypes } from '../../analytics';
18
+ // TODO: ED-20519 It requires full analytics extraction to use the plugin injection API
19
+ import { analyticsPluginKey } from '../../analytics';
19
20
  import { isInsideBlockQuote, insideTable, measurements } from '../../../utils';
20
21
  import { upgradeTextToLists, splitParagraphs } from '../commands';
21
- import { transformSliceToDecisionList } from '../../tasks-and-decisions/utils';
22
- import { containsAnyAnnotations, stripNonExistingAnnotations } from '../../annotation/utils';
22
+ // TODO: ED-20519 It requires annotation extraction to use the plugin injection API
23
+ import { stripNonExistingAnnotations } from '../../annotation/utils';
23
24
  import { clipboardTextSerializer } from './clipboard-text-serializer';
24
25
  import { htmlHasIncompleteTable, tryRebuildCompleteTableHtml, isPastedFromTinyMCEConfluence } from '../util/tinyMCE';
25
- import { handlePaste as handlePasteTable } from '@atlaskit/editor-tables/utils';
26
- import { extractSliceFromStep } from '../../../utils/step';
27
26
  import { pluginKey as stateKey, createPluginState } from './plugin-factory';
28
27
  export { pluginKey as stateKey } from './plugin-factory';
29
28
  import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
29
+ import { PastePluginActionTypes } from '../actions';
30
30
  export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pluginInjectionApi, cardOptions, sanitizePrivateContent, providerFactory) {
31
31
  var atlassianMarkDownParser = new MarkdownTransformer(schema, md);
32
32
  function getMarkdownSlice(text, openStart, openEnd) {
@@ -87,7 +87,8 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
87
87
  return new SafePlugin({
88
88
  key: stateKey,
89
89
  state: createPluginState(dispatch, {
90
- pastedMacroPositions: {}
90
+ pastedMacroPositions: {},
91
+ lastContentPasted: null
91
92
  }),
92
93
  props: {
93
94
  // For serialising to plain text
@@ -167,7 +168,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
167
168
  }
168
169
  // creating a custom dispatch because we want to add a meta whenever we do a paste.
169
170
  var dispatch = function dispatch(tr) {
170
- var _state$doc$resolve$no;
171
+ var _state$doc$resolve$no, _input;
171
172
  // https://product-fabric.atlassian.net/browse/ED-12633
172
173
  // don't add closeHistory call if we're pasting a text inside placeholder text as we want the whole action
173
174
  // to be atomic
@@ -202,6 +203,22 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
202
203
  action: isPlainText ? ACTION.PASTED_AS_PLAIN : ACTION.PASTED,
203
204
  inputMethod: INPUT_METHOD.CLIPBOARD
204
205
  });
206
+ var pasteStartPos = Math.min(state.selection.anchor, state.selection.head);
207
+ var pasteEndPos = tr.selection.to;
208
+ var contentPasted = {
209
+ pasteStartPos: pasteStartPos,
210
+ pasteEndPos: pasteEndPos,
211
+ text: text,
212
+ isShiftPressed: Boolean(view.shiftKey || ((_input = view.input) === null || _input === void 0 ? void 0 : _input.shiftKey)),
213
+ isPlainText: Boolean(isPlainText),
214
+ pastedSlice: tr.doc.slice(pasteStartPos, pasteEndPos),
215
+ pastedAt: Date.now(),
216
+ pasteSource: getPasteSource(event)
217
+ };
218
+ tr.setMeta(stateKey, {
219
+ type: PastePluginActionTypes.ON_PASTE,
220
+ contentPasted: contentPasted
221
+ });
205
222
  view.dispatch(tr);
206
223
  };
207
224
  slice = handleParagraphBlockMarks(state, slice);
@@ -22,6 +22,12 @@ export var reducer = function reducer(state, action) {
22
22
  pastedMacroPositions: filteredMacroPositions
23
23
  });
24
24
  }
25
+ case ActionTypes.ON_PASTE:
26
+ {
27
+ return _objectSpread(_objectSpread({}, state), {}, {
28
+ lastContentPasted: action.contentPasted
29
+ });
30
+ }
25
31
  default:
26
32
  return state;
27
33
  }
@@ -5,7 +5,7 @@ import { ACTION_SUBJECT, addAnalytics, EVENT_TYPE, INPUT_METHOD, TABLE_ACTION }
5
5
  import { TextSelection, NodeSelection } from '@atlaskit/editor-prosemirror/state';
6
6
  import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
7
7
  import { getSelectedTableInfo, isTableSelected } from '@atlaskit/editor-tables/utils';
8
- import { sortByOrderWithTypeName } from '../../../create-editor/sort-by-order';
8
+ import { sortByOrderWithTypeName } from '@atlaskit/editor-common/legacy-rank-plugins';
9
9
  import { isSupportedInParent, mapChildren } from '@atlaskit/editor-common/utils';
10
10
  export function isPastedFromWord(html) {
11
11
  return !!html && html.indexOf('urn:schemas-microsoft-com:office:word') >= 0;
@@ -1,27 +1,2 @@
1
- export default {
2
- plugins: ['featureFlagsContextPlugin', 'compositionPlugin', 'inlineCursorTargetPlugin', 'typeAhead', 'typeAheadInsertItem', 'focusHandlerPlugin', 'frozenEditor', 'submitEditor', 'saveOnEnter', 'customAutoformatting', 'newlinePreserveMarksPlugin', 'imageUpload', 'imageUploadInputRule', 'clipboard', 'paste', 'pasteKeymap', 'mention', 'mentionInputRule', 'mentionKeymap', 'emoji', 'placeholderText', 'emojiInputRule', 'emojiKeymap', 'emojiAsciiInputRule', 'blockType', 'quickInsert', 'tasksAndDecisions', 'blockTypeInputRule', 'tasksAndDecisionsInputRule', 'list', 'typeAheadKeymap', 'typeAheadInputRule', 'date',
3
- // Needs to be before indentation to handle tab into input field
4
- 'dateKeymap',
5
- // This should be always after `typeAheadKeymap` & `emojiKeymap`
6
- 'indentationKeymap', 'textColor', 'alignmentPlugin', 'listInputRule', 'listKeymap', 'codeBlock', 'codeBlockIDEKeyBindings', 'codeBlockKeyMap', 'textFormatting', 'textFormattingCursor', 'textFormattingInputRule', 'textFormattingSmartRule', 'textFormattingClear', 'textFormattingKeymap',
7
- // task/decisions keymap needs to be above table keymap so can indent actions in a table
8
- 'tasksAndDecisionsKeyMap',
9
- // expand and table keymaps need to be above selection keymap to add their custom selection behaviour:
10
- // https://product-fabric.atlassian.net/wiki/spaces/E/pages/1113098008/Selection+Guide#Special-Cases
11
- 'expandKeymap', 'tableSelectionKeymap', 'tableKeymap', 'captionKeymap',
12
- // media keymap above selection keymap to allow navigating past the mediaSingle node
13
- 'mediaKeymap',
14
- // selection keymap needs to be above gap cursor keymap so it can set node selections from
15
- // left/right arrows
16
- 'selectionKeymap', 'gapCursorKeymap', 'gapCursor', 'syncUrlText', 'fakeCursorToolbarPlugin', 'hyperLink', 'table', 'tableDecorations', 'hyperlinkInputRule', 'tablePMColResizing', 'hyperlinkKeymap', 'tableColResizing', 'undoRedoKeyMap', 'blockTypeKeyMap', 'tableEditing', 'filterStepsPlugin', 'pmCollab', 'collab', 'ruleInputRule', 'ruleKeymap', 'panel', 'media', 'mediaSingleKeymap', 'mediaEditor', 'unsupportedContent', 'jiraIssue', 'fakeTextCursor', 'helpDialog', 'helpDialogKeymap', 'macro', 'expand', 'extension', 'layout', 'contextPanel', 'selectionToolbar', 'floatingToolbar', 'clearMarksOnChange', 'reactNodeView', 'history', 'undoRedoPlugin', 'codeBlockIndent', 'placeholder', 'width', 'maxContentSize', 'multilineContent', 'grid', 'mobileDimensions', 'scrollGutterPlugin', 'analytics', 'findReplace', 'selection', 'avatarGroup', 'viewUpdateSubscription', 'beforePrimaryToolbar', 'inlineCode'],
17
- nodes: ['doc', 'paragraph', 'text', 'bulletList', 'orderedList', 'listItem', 'heading', 'blockquote', 'codeBlock', 'rule', 'panel', 'mention', 'confluenceUnsupportedBlock', 'confluenceUnsupportedInline', 'unsupportedBlock', 'unsupportedInline', 'confluenceJiraIssue', 'hardBreak', 'emoji', 'placeholder', 'mediaSingle', 'mediaGroup', 'table', 'expand', 'nestedExpand', 'media', 'tableHeader', 'decisionList', 'tableRow', 'decisionItem', 'tableCell', 'taskList', 'taskItem', 'extension', 'bodiedExtension', 'inlineExtension', 'layoutSection', 'layoutColumn', 'inlineCard', 'blockCard', 'embedCard'],
18
- marks: [
19
- // Fragment mark is both for inline and block elements
20
- 'fragment',
21
- // Inline marks
22
- 'link', 'em', 'strong', 'textColor', 'strike', 'subsup', 'underline', 'code', 'typeAheadQuery',
23
- // Block marks
24
- 'alignment', 'breakout', 'indentation', 'annotation', 'dataConsumer', 'border',
25
- // Unsupported mark
26
- 'unsupportedMark', 'unsupportedNodeAttribute']
27
- };
1
+ import { rankEditorPlugins } from '@atlaskit/editor-common/legacy-rank-plugins';
2
+ export default rankEditorPlugins;
@@ -1,16 +1,6 @@
1
- import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
2
1
  import { NodeSelection, Selection, TextSelection } from '@atlaskit/editor-prosemirror/state';
3
-
4
- // If slice is decisionItem, wrap it inside a decisionList. This prevents an
5
- // additional newline from being pasted along with the selected decision item.
6
- export var transformSliceToDecisionList = function transformSliceToDecisionList(slice, schema) {
7
- var node = slice.content.firstChild;
8
- if (slice.content.childCount === 1 && node && node.type.name === 'decisionItem') {
9
- var decisionListWrapperNode = schema.nodes.decisionList.create({}, node);
10
- return new Slice(Fragment.from(decisionListWrapperNode), slice.openStart, slice.openEnd);
11
- }
12
- return slice;
13
- };
2
+ import { transformSliceToDecisionList } from '@atlaskit/editor-common/transforms';
3
+ export { transformSliceToDecisionList };
14
4
  function isTaskListNode(node) {
15
5
  return Boolean(node && node.type && 'taskList' === node.type.name);
16
6
  }
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "188.12.2";
2
+ export var version = "188.13.0";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,14 +1 @@
1
- export declare function sortByOrder(item: 'plugins' | 'nodes' | 'marks'): (a: {
2
- name: string;
3
- }, b: {
4
- name: string;
5
- }) => number;
6
- export declare function sortByOrderWithTypeName(item: 'plugins' | 'nodes' | 'marks'): (a: {
7
- type: {
8
- name: string;
9
- };
10
- }, b: {
11
- type: {
12
- name: string;
13
- };
14
- }) => number;
1
+ export { sortByOrder, sortByOrderWithTypeName, } from '@atlaskit/editor-common/legacy-rank-plugins';
@@ -2,11 +2,13 @@ import type { ResolvedPos, Mark, Node, Slice, Schema } from '@atlaskit/editor-pr
2
2
  import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
3
3
  import { PluginKey, TextSelection, AllSelection } from '@atlaskit/editor-prosemirror/state';
4
4
  import { Decoration } from '@atlaskit/editor-prosemirror/view';
5
+ import { hasAnnotationMark, containsAnyAnnotations } from '@atlaskit/editor-common/utils';
5
6
  import type { AnnotationInfo } from './types';
6
7
  import { AnnotationSelectionType } from './types';
7
8
  import type { InlineCommentPluginState } from './pm-plugins/types';
8
- import type { INPUT_METHOD } from '../analytics';
9
9
  import type { AnalyticsEventPayloadCallback } from '../analytics/utils';
10
+ import type { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
11
+ export { hasAnnotationMark, containsAnyAnnotations };
10
12
  /**
11
13
  * Finds the marks in the nodes to the left and right.
12
14
  * @param $pos Position to center search around
@@ -34,7 +36,5 @@ export declare const hasInvalidNodes: (state: EditorState) => boolean;
34
36
  * This is to conform to Confluence annotation specifications
35
37
  */
36
38
  export declare function hasInvalidWhitespaceNode(selection: TextSelection | AllSelection, schema: Schema): boolean;
37
- export declare function hasAnnotationMark(node: Node, state: EditorState): boolean;
38
39
  export declare function annotationExists(annotationId: string, state: EditorState): boolean;
39
- export declare function containsAnyAnnotations(slice: Slice, state: EditorState): boolean;
40
40
  export declare function stripNonExistingAnnotations(slice: Slice, state: EditorState): false | undefined;
@@ -1,6 +1 @@
1
- import type { Schema } from '@atlaskit/editor-prosemirror/model';
2
- import { Slice } from '@atlaskit/editor-prosemirror/model';
3
- import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
4
- export declare function transformSliceToJoinAdjacentCodeBlocks(slice: Slice): Slice;
5
- export declare const transformSingleLineCodeBlockToCodeMark: (slice: Slice, schema: Schema) => Slice;
6
- export declare const findCodeBlock: (state: EditorState, selection?: Selection | null) => import("prosemirror-utils/dist/types").FindResult;
1
+ export { findCodeBlock, transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark, } from '@atlaskit/editor-common/transforms';