@atlaskit/editor-core 189.3.1 → 189.3.3

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 (63) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/plugins/code-block/actions.js +1 -1
  3. package/dist/cjs/plugins/code-block/ide-ux/line-handling.js +1 -1
  4. package/dist/cjs/plugins/code-block/pm-plugins/ide-ux.js +1 -1
  5. package/dist/cjs/plugins/code-block/pm-plugins/keymaps.js +7 -4
  6. package/dist/cjs/plugins/code-block/toolbar.js +5 -3
  7. package/dist/cjs/plugins/code-block/utils.js +5 -1
  8. package/dist/cjs/plugins/expand/index.js +3 -3
  9. package/dist/cjs/plugins/feedback-dialog/index.js +3 -3
  10. package/dist/cjs/plugins/find-replace/ui/Find.js +15 -12
  11. package/dist/cjs/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +2 -2
  12. package/dist/cjs/plugins/tasks-and-decisions/ui/ToolbarTask/index.js +2 -2
  13. package/dist/cjs/{plugins/code-block/styles.js → ui/ContentStyles/code-block.js} +1 -2
  14. package/dist/cjs/ui/ContentStyles/index.js +7 -7
  15. package/dist/cjs/utils/index.js +0 -53
  16. package/dist/cjs/version-wrapper.js +1 -1
  17. package/dist/es2019/plugins/code-block/actions.js +1 -1
  18. package/dist/es2019/plugins/code-block/ide-ux/line-handling.js +1 -1
  19. package/dist/es2019/plugins/code-block/pm-plugins/ide-ux.js +1 -1
  20. package/dist/es2019/plugins/code-block/pm-plugins/keymaps.js +5 -2
  21. package/dist/es2019/plugins/code-block/toolbar.js +1 -2
  22. package/dist/es2019/plugins/code-block/utils.js +4 -1
  23. package/dist/es2019/plugins/expand/index.js +1 -1
  24. package/dist/es2019/plugins/feedback-dialog/index.js +1 -1
  25. package/dist/es2019/plugins/find-replace/ui/Find.js +14 -11
  26. package/dist/es2019/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -1
  27. package/dist/es2019/plugins/tasks-and-decisions/ui/ToolbarTask/index.js +1 -1
  28. package/dist/es2019/{plugins/code-block/styles.js → ui/ContentStyles/code-block.js} +5 -6
  29. package/dist/es2019/ui/ContentStyles/index.js +1 -1
  30. package/dist/es2019/utils/index.js +0 -36
  31. package/dist/es2019/version-wrapper.js +1 -1
  32. package/dist/esm/plugins/code-block/actions.js +1 -1
  33. package/dist/esm/plugins/code-block/ide-ux/line-handling.js +1 -1
  34. package/dist/esm/plugins/code-block/pm-plugins/ide-ux.js +1 -1
  35. package/dist/esm/plugins/code-block/pm-plugins/keymaps.js +5 -2
  36. package/dist/esm/plugins/code-block/toolbar.js +1 -2
  37. package/dist/esm/plugins/code-block/utils.js +4 -1
  38. package/dist/esm/plugins/expand/index.js +1 -1
  39. package/dist/esm/plugins/feedback-dialog/index.js +1 -1
  40. package/dist/esm/plugins/find-replace/ui/Find.js +15 -12
  41. package/dist/esm/plugins/tasks-and-decisions/ui/ToolbarDecision/index.js +1 -1
  42. package/dist/esm/plugins/tasks-and-decisions/ui/ToolbarTask/index.js +1 -1
  43. package/dist/esm/{plugins/code-block/styles.js → ui/ContentStyles/code-block.js} +2 -3
  44. package/dist/esm/ui/ContentStyles/index.js +1 -1
  45. package/dist/esm/utils/index.js +0 -50
  46. package/dist/esm/version-wrapper.js +1 -1
  47. package/dist/types/plugins/code-block/actions.d.ts +1 -1
  48. package/dist/types/plugins/code-block/nodeviews/code-block.d.ts +1 -1
  49. package/dist/types/plugins/code-block/pm-plugins/ide-ux.d.ts +1 -1
  50. package/dist/types/plugins/code-block/pm-plugins/main.d.ts +2 -2
  51. package/dist/types/plugins/code-block/types.d.ts +1 -2
  52. package/dist/types/plugins/code-block/utils.d.ts +3 -0
  53. package/dist/{types-ts4.5/plugins/code-block/styles.d.ts → types/ui/ContentStyles/code-block.d.ts} +1 -1
  54. package/dist/types/utils/index.d.ts +2 -18
  55. package/dist/types-ts4.5/plugins/code-block/actions.d.ts +1 -1
  56. package/dist/types-ts4.5/plugins/code-block/nodeviews/code-block.d.ts +1 -1
  57. package/dist/types-ts4.5/plugins/code-block/pm-plugins/ide-ux.d.ts +1 -1
  58. package/dist/types-ts4.5/plugins/code-block/pm-plugins/main.d.ts +2 -2
  59. package/dist/types-ts4.5/plugins/code-block/types.d.ts +1 -2
  60. package/dist/types-ts4.5/plugins/code-block/utils.d.ts +3 -0
  61. package/dist/{types/plugins/code-block/styles.d.ts → types-ts4.5/ui/ContentStyles/code-block.d.ts} +1 -1
  62. package/dist/types-ts4.5/utils/index.d.ts +2 -39
  63. package/package.json +4 -4
@@ -8,7 +8,7 @@ import { telepointerStyle } from '../../plugins/collab-edit/styles';
8
8
  import { tableStyles } from '@atlaskit/editor-plugin-table/ui/common-styles';
9
9
  import { blocktypeStyles } from '@atlaskit/editor-plugin-block-type/styles';
10
10
  import { textHighlightStyle } from '@atlaskit/editor-plugin-paste-options-toolbar/styles';
11
- import { codeBlockStyles } from '../../plugins/code-block/styles';
11
+ import { codeBlockStyles } from './code-block';
12
12
  import { mediaStyles } from './media';
13
13
  import { layoutStyles } from './layout';
14
14
  import { panelStyles } from './panel';
@@ -12,9 +12,6 @@ function isMarkTypeCompatibleWithMark(markType, mark) {
12
12
  function isMarkTypeAllowedInNode(markType, state) {
13
13
  return toggleMark(markType)(state);
14
14
  }
15
- export function getCursor(selection) {
16
- return selection.$cursor || undefined;
17
- }
18
15
 
19
16
  /**
20
17
  * Check if a mark is allowed at the current selection / cursor based on a given state.
@@ -104,39 +101,6 @@ export const isInsideBlockQuote = state => {
104
101
  return hasParentNodeOfType(blockquote)(state.selection);
105
102
  };
106
103
  export { isTextSelection, isElementInTableCell, isLastItemMediaGroup, nonNullable } from '@atlaskit/editor-common/utils';
107
-
108
- /** Helper type for single arg function */
109
-
110
- /**
111
- * Compose 1 to n functions.
112
- * @param func first function
113
- * @param funcs additional functions
114
- */
115
- export function compose(func, ...funcs) {
116
- const allFuncs = [func, ...funcs];
117
- return function composed(raw) {
118
- return allFuncs.reduceRight((memo, func) => func(memo), raw);
119
- };
120
- }
121
-
122
- // one function
123
-
124
- // two function
125
-
126
- // three function
127
-
128
- // If needed add more than 3 function
129
- // Generic
130
- // rest
131
- export function pipe(...fns) {
132
- if (fns.length === 0) {
133
- return a => a;
134
- }
135
- if (fns.length === 1) {
136
- return fns[0];
137
- }
138
- return fns.reduce((prevFn, nextFn) => (...args) => nextFn(prevFn(...args)));
139
- }
140
104
  export function sum(arr, f) {
141
105
  return arr.reduce((val, x) => val + f(x), 0);
142
106
  }
@@ -1,5 +1,5 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "189.3.1";
2
+ export const version = "189.3.3";
3
3
  export const nextMajorVersion = () => {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -3,7 +3,7 @@ import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
3
3
  import { pluginKey } from './plugin-key';
4
4
  import { copySelectionPluginKey } from './pm-plugins/codeBlockCopySelectionPlugin';
5
5
  import { ACTIONS } from './pm-plugins/actions';
6
- import { copyToClipboard } from '../../utils/clipboard';
6
+ import { copyToClipboard } from '@atlaskit/editor-common/clipboard';
7
7
  import { shouldSplitSelectedNodeOnNodeInsertion } from '@atlaskit/editor-common/insert';
8
8
  import { transformToCodeBlockAction } from './transform-to-code-block';
9
9
  import { withAnalytics } from '@atlaskit/editor-common/editor-analytics';
@@ -1,4 +1,4 @@
1
- import { getCursor } from '../../../utils';
1
+ import { getCursor } from '../utils';
2
2
  export var isSelectionEntirelyInsideCodeBlock = function isSelectionEntirelyInsideCodeBlock(state) {
3
3
  return state.selection.$from.sameParent(state.selection.$to) && state.selection.$from.parent.type === state.schema.nodes.codeBlock;
4
4
  };
@@ -2,7 +2,7 @@ import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import { TextSelection } from '@atlaskit/editor-prosemirror/state';
3
3
  import { keydownHandler } from '@atlaskit/editor-prosemirror/keymap';
4
4
  import { setTextSelection } from '@atlaskit/editor-prosemirror/utils';
5
- import { getCursor } from '../../../utils';
5
+ import { getCursor } from '../utils';
6
6
  import { filterCommand as filter } from '@atlaskit/editor-common/utils';
7
7
  import { isCursorBeforeClosingCharacter, isClosingCharacter } from '../ide-ux/paired-character-handling';
8
8
  import { getAutoClosingBracketInfo, shouldAutoCloseBracket } from '../ide-ux/bracket-handling';
@@ -1,7 +1,8 @@
1
1
  import { keymap } from '@atlaskit/editor-prosemirror/keymap';
2
2
  import { Selection } from '@atlaskit/editor-prosemirror/state';
3
3
  import { findParentNodeOfTypeClosestToPos, hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
4
- import { getCursor, isEmptyNode, pipe } from '../../../utils';
4
+ import { getCursor } from '../utils';
5
+ import { isEmptyNode } from '@atlaskit/editor-common/utils';
5
6
  var deleteCurrentItem = function deleteCurrentItem($from) {
6
7
  return function (tr) {
7
8
  return tr.delete($from.before($from.depth), $from.after($from.depth));
@@ -40,7 +41,9 @@ export function keymapPlugin(schema) {
40
41
  if ($cursor.node && isEmptyNode(schema)($cursor.node()) && (hasParentNodeOfType(layoutColumn)(state.selection) || hasParentNodeOfType(table)(state.selection))) {
41
42
  var tr = state.tr;
42
43
  var insertPos = $cursor.pos;
43
- dispatch(pipe(deleteCurrentItem($cursor), setTextSelection(insertPos))(tr).scrollIntoView());
44
+ deleteCurrentItem($cursor)(tr);
45
+ setTextSelection(insertPos)(tr);
46
+ dispatch(tr.scrollIntoView());
44
47
  return true;
45
48
  }
46
49
 
@@ -3,8 +3,7 @@ import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
3
3
  import CopyIcon from '@atlaskit/icon/glyph/copy';
4
4
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
5
5
  import { removeCodeBlock, changeLanguage, copyContentToClipboard, resetCopiedState } from './actions';
6
- import commonMessages from '../../messages';
7
- import { codeBlockButtonMessages } from '@atlaskit/editor-common/messages';
6
+ import commonMessages, { codeBlockButtonMessages } from '@atlaskit/editor-common/messages';
8
7
  import { provideVisualFeedbackForCopyButton, removeVisualFeedbackForCopyButton } from './pm-plugins/codeBlockCopySelectionPlugin';
9
8
  import { pluginKey } from './plugin-key';
10
9
  import { createLanguageList, getLanguageIdentifier, DEFAULT_LANGUAGES } from './language-list';
@@ -1 +1,4 @@
1
- export { findCodeBlock, transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark } from '@atlaskit/editor-common/transforms';
1
+ export { findCodeBlock, transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark } from '@atlaskit/editor-common/transforms';
2
+ export function getCursor(selection) {
3
+ return selection.$cursor || undefined;
4
+ }
@@ -7,7 +7,7 @@ import { IconExpand } from '@atlaskit/editor-common/quick-insert';
7
7
  import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
8
8
  import { getToolbarConfig } from './toolbar';
9
9
  import { createExpandNode, insertExpand } from './commands';
10
- import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
10
+ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
11
11
  import { createWrapSelectionTransaction } from '@atlaskit/editor-common/utils';
12
12
  var expandPlugin = function expandPlugin(_ref) {
13
13
  var _api$featureFlags, _api$analytics;
@@ -9,7 +9,7 @@ import { IconFeedback } from '@atlaskit/editor-common/quick-insert';
9
9
  import { version as coreVersion } from '../../version-wrapper';
10
10
  import { ACTION, ACTION_SUBJECT, INPUT_METHOD, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
11
11
  import loadJiraCollectorDialogScript from './loadJiraCollectorDialogScript';
12
- import { messages } from '../insert-block/ui/ToolbarInsertBlock/messages';
12
+ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
13
13
  var showJiraCollectorDialog;
14
14
  var feedbackInfoHash;
15
15
  var defaultFeedbackInfo;
@@ -21,6 +21,7 @@ import { countStyles, sectionWrapperStyles } from './styles';
21
21
  import { TRIGGER_METHOD } from '@atlaskit/editor-common/analytics';
22
22
  import { FindReplaceTooltipButton } from './FindReplaceTooltipButton';
23
23
  import rafSchd from 'raf-schd';
24
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
24
25
  export var FIND_DEBOUNCE_MS = 100;
25
26
  var messages = defineMessages({
26
27
  find: {
@@ -214,19 +215,21 @@ var Find = /*#__PURE__*/function (_React$Component) {
214
215
  }, {
215
216
  key: "componentDidUpdate",
216
217
  value: function componentDidUpdate(prevProps) {
217
- var _this$state2,
218
- _this3 = this;
218
+ var _this3 = this;
219
219
  // focus on update if find text did not change
220
- if (this.props.findText === ((_this$state2 = this.state) === null || _this$state2 === void 0 ? void 0 : _this$state2.localFindText)) {
221
- this.focusFindTextfield();
222
- }
223
- if (this.props.findText !== prevProps.findText) {
224
- this.syncFindText(function () {
225
- // focus after input is synced if find text provided
226
- if (_this3.props.findText) {
227
- _this3.focusFindTextfield();
228
- }
229
- });
220
+ if (!getBooleanFF('platform.editor.a11y-find-replace')) {
221
+ var _this$state2;
222
+ if (this.props.findText === ((_this$state2 = this.state) === null || _this$state2 === void 0 ? void 0 : _this$state2.localFindText)) {
223
+ this.focusFindTextfield();
224
+ }
225
+ if (this.props.findText !== prevProps.findText) {
226
+ this.syncFindText(function () {
227
+ // focus after input is synced if find text provided
228
+ if (_this3.props.findText) {
229
+ _this3.focusFindTextfield();
230
+ }
231
+ });
232
+ }
230
233
  }
231
234
  }
232
235
  }, {
@@ -11,7 +11,7 @@ import React, { PureComponent } from 'react';
11
11
  import { injectIntl } from 'react-intl-next';
12
12
  import DecisionIcon from '@atlaskit/icon/glyph/editor/decision';
13
13
  import ToolbarButton, { TOOLBAR_BUTTON } from '../../../../ui/ToolbarButton';
14
- import { messages } from '../../../insert-block/ui/ToolbarInsertBlock/messages';
14
+ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
15
15
  import { insertTaskDecisionCommand } from '../../commands';
16
16
  export var ToolbarDecision = /*#__PURE__*/function (_PureComponent) {
17
17
  _inherits(ToolbarDecision, _PureComponent);
@@ -11,7 +11,7 @@ import React, { PureComponent } from 'react';
11
11
  import { injectIntl } from 'react-intl-next';
12
12
  import TaskIcon from '@atlaskit/icon/glyph/editor/task';
13
13
  import ToolbarButton, { TOOLBAR_BUTTON } from '../../../../ui/ToolbarButton';
14
- import { messages } from '../../../insert-block/ui/ToolbarInsertBlock/messages';
14
+ import { toolbarInsertBlockMessages as messages } from '@atlaskit/editor-common/messages';
15
15
  import { insertTaskDecisionCommand } from '../../commands';
16
16
  export var ToolbarTask = /*#__PURE__*/function (_PureComponent) {
17
17
  _inherits(ToolbarTask, _PureComponent);
@@ -3,11 +3,10 @@ var _templateObject, _templateObject2;
3
3
  import { css } from '@emotion/react';
4
4
  import { R75 } from '@atlaskit/theme/colors';
5
5
  import { akEditorDeleteBackground, akEditorDeleteBorder, akEditorSelectedBorderSize, akEditorDeleteIconColor, SelectionStyle, getSelectionStyles, akEditorSelectedNodeClassName, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
6
- import { codeBlockClassNames } from './ui/class-names';
7
- import { codeBlockSharedStyles } from '@atlaskit/editor-common/styles';
6
+ import { codeBlockSharedStyles, CodeBlockSharedCssClassName } from '@atlaskit/editor-common/styles';
8
7
  var GutterDangerOverlay = function GutterDangerOverlay() {
9
8
  return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n &::after {\n height: 100%;\n content: '';\n position: absolute;\n left: 0;\n top: 0;\n width: 24px;\n background-color: ", ";\n }\n"])), "var(--ds-blanket-danger, none)");
10
9
  };
11
10
  export var codeBlockStyles = function codeBlockStyles(props) {
12
- return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ProseMirror {\n ", "\n }\n\n .ProseMirror li {\n /* if same list item has multiple code blocks we need top margin for all but first */\n > .code-block {\n margin: ", " 0 0 0;\n }\n > .code-block:first-child,\n > .ProseMirror-gapcursor:first-child + .code-block {\n margin-top: 0;\n }\n\n > div:last-of-type.code-block {\n margin-bottom: ", ";\n }\n }\n\n .ProseMirror .code-block.", ":not(.danger) {\n ", "\n }\n\n /* Danger when top level node */\n .ProseMirror .danger.code-block {\n box-shadow: 0 0 0 ", "px\n ", ";\n\n .", " {\n background-color: ", ";\n color: ", ";\n ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n\n /* Danger when nested node */\n .ProseMirror .danger .code-block {\n .", " {\n background-color: ", ";\n color: ", ";\n ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n"])), codeBlockSharedStyles(props), blockNodesVerticalMargin, blockNodesVerticalMargin, akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket]), akEditorSelectedBorderSize, "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), codeBlockClassNames.gutter, "var(--ds-background-danger, ".concat(R75, ")"), "var(--ds-text-danger, ".concat(akEditorDeleteIconColor, ")"), GutterDangerOverlay(), codeBlockClassNames.content, "var(--ds-blanket-danger, ".concat(akEditorDeleteBackground, ")"), codeBlockClassNames.gutter, "var(--ds-background-danger, rgba(255, 143, 115, 0.5))", "var(--ds-text-danger, ".concat(akEditorDeleteIconColor, ")"), GutterDangerOverlay(), codeBlockClassNames.content, "var(--ds-blanket-danger, rgba(255, 189, 173, 0.5))");
11
+ return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n .ProseMirror {\n ", "\n }\n\n .ProseMirror li {\n /* if same list item has multiple code blocks we need top margin for all but first */\n > .code-block {\n margin: ", " 0 0 0;\n }\n > .code-block:first-child,\n > .ProseMirror-gapcursor:first-child + .code-block {\n margin-top: 0;\n }\n\n > div:last-of-type.code-block {\n margin-bottom: ", ";\n }\n }\n\n .ProseMirror .code-block.", ":not(.danger) {\n ", "\n }\n\n /* Danger when top level node */\n .ProseMirror .danger.code-block {\n box-shadow: 0 0 0 ", "px\n ", ";\n\n .", " {\n background-color: ", ";\n color: ", ";\n ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n\n /* Danger when nested node */\n .ProseMirror .danger .code-block {\n .", " {\n background-color: ", ";\n color: ", ";\n ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n"])), codeBlockSharedStyles(props), blockNodesVerticalMargin, blockNodesVerticalMargin, akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket]), akEditorSelectedBorderSize, "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-danger, ".concat(R75, ")"), "var(--ds-text-danger, ".concat(akEditorDeleteIconColor, ")"), GutterDangerOverlay(), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-blanket-danger, ".concat(akEditorDeleteBackground, ")"), CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-danger, rgba(255, 143, 115, 0.5))", "var(--ds-text-danger, ".concat(akEditorDeleteIconColor, ")"), GutterDangerOverlay(), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-blanket-danger, rgba(255, 189, 173, 0.5))");
13
12
  };
@@ -10,7 +10,7 @@ import { telepointerStyle } from '../../plugins/collab-edit/styles';
10
10
  import { tableStyles } from '@atlaskit/editor-plugin-table/ui/common-styles';
11
11
  import { blocktypeStyles } from '@atlaskit/editor-plugin-block-type/styles';
12
12
  import { textHighlightStyle } from '@atlaskit/editor-plugin-paste-options-toolbar/styles';
13
- import { codeBlockStyles } from '../../plugins/code-block/styles';
13
+ import { codeBlockStyles } from './code-block';
14
14
  import { mediaStyles } from './media';
15
15
  import { layoutStyles } from './layout';
16
16
  import { panelStyles } from './panel';
@@ -12,9 +12,6 @@ function isMarkTypeCompatibleWithMark(markType, mark) {
12
12
  function isMarkTypeAllowedInNode(markType, state) {
13
13
  return toggleMark(markType)(state);
14
14
  }
15
- export function getCursor(selection) {
16
- return selection.$cursor || undefined;
17
- }
18
15
 
19
16
  /**
20
17
  * Check if a mark is allowed at the current selection / cursor based on a given state.
@@ -102,53 +99,6 @@ export var isInsideBlockQuote = function isInsideBlockQuote(state) {
102
99
  return hasParentNodeOfType(blockquote)(state.selection);
103
100
  };
104
101
  export { isTextSelection, isElementInTableCell, isLastItemMediaGroup, nonNullable } from '@atlaskit/editor-common/utils';
105
-
106
- /** Helper type for single arg function */
107
-
108
- /**
109
- * Compose 1 to n functions.
110
- * @param func first function
111
- * @param funcs additional functions
112
- */
113
- export function compose(func) {
114
- for (var _len = arguments.length, funcs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
115
- funcs[_key - 1] = arguments[_key];
116
- }
117
- var allFuncs = [func].concat(funcs);
118
- return function composed(raw) {
119
- return allFuncs.reduceRight(function (memo, func) {
120
- return func(memo);
121
- }, raw);
122
- };
123
- }
124
-
125
- // one function
126
-
127
- // two function
128
-
129
- // three function
130
-
131
- // If needed add more than 3 function
132
- // Generic
133
- // rest
134
- export function pipe() {
135
- for (var _len2 = arguments.length, fns = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
136
- fns[_key2] = arguments[_key2];
137
- }
138
- if (fns.length === 0) {
139
- return function (a) {
140
- return a;
141
- };
142
- }
143
- if (fns.length === 1) {
144
- return fns[0];
145
- }
146
- return fns.reduce(function (prevFn, nextFn) {
147
- return function () {
148
- return nextFn(prevFn.apply(void 0, arguments));
149
- };
150
- });
151
- }
152
102
  export function sum(arr, f) {
153
103
  return arr.reduce(function (val, x) {
154
104
  return val + f(x);
@@ -1,5 +1,5 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "189.3.1";
2
+ export var version = "189.3.3";
3
3
  export var nextMajorVersion = function nextMajorVersion() {
4
4
  return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
- import type { Command } from '../../types';
2
+ import type { Command } from '@atlaskit/editor-common/types';
3
3
  import type { INPUT_METHOD, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
4
  export declare const removeCodeBlock: Command;
5
5
  export declare const changeLanguage: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (language: string) => Command;
@@ -1,6 +1,6 @@
1
1
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
2
  import type { Node } from '@atlaskit/editor-prosemirror/model';
3
- import type { getPosHandlerNode, getPosHandler } from '../../../nodeviews/';
3
+ import type { getPosHandlerNode, getPosHandler } from '@atlaskit/editor-common/types';
4
4
  export declare class CodeBlockView {
5
5
  node: Node;
6
6
  dom: HTMLElement;
@@ -1,5 +1,5 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type codeBlockPlugin from '../';
3
2
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import type codeBlockPlugin from '../';
4
4
  declare const ideUX: (pluginInjectionApi: ExtractInjectionAPI<typeof codeBlockPlugin> | undefined) => SafePlugin<any>;
5
5
  export default ideUX;
@@ -1,10 +1,10 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import type { IntlShape } from 'react-intl-next';
3
- import type { EditorProps } from '../../../types';
3
+ import type { EditorAppearance } from '@atlaskit/editor-common/types';
4
4
  import type { CodeBlockState } from './main-state';
5
5
  export declare const createPlugin: ({ useLongPressSelection, getIntl, appearance, allowCompositionInputOverride, }: {
6
6
  useLongPressSelection?: boolean | undefined;
7
7
  getIntl: () => IntlShape;
8
- appearance: EditorProps['appearance'];
8
+ appearance: EditorAppearance;
9
9
  allowCompositionInputOverride?: boolean | undefined;
10
10
  }) => SafePlugin<CodeBlockState>;
@@ -1,5 +1,4 @@
1
- import type { EditorAppearance } from '../../types';
2
- import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
1
+ import type { LongPressSelectionPluginOptions, EditorAppearance } from '@atlaskit/editor-common/types';
3
2
  export interface CodeBlockOptions extends LongPressSelectionPluginOptions {
4
3
  allowCopyToClipboard?: boolean;
5
4
  allowCompositionInputOverride?: boolean;
@@ -1 +1,4 @@
1
1
  export { findCodeBlock, transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark, } from '@atlaskit/editor-common/transforms';
2
+ import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
3
+ import type { Selection } from '@atlaskit/editor-prosemirror/state';
4
+ export declare function getCursor(selection: Selection): ResolvedPos | undefined;
@@ -1,2 +1,2 @@
1
- import { ThemeProps } from '@atlaskit/theme/types';
1
+ import type { ThemeProps } from '@atlaskit/theme/types';
2
2
  export declare const codeBlockStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
@@ -1,5 +1,5 @@
1
- import type { MarkType, ResolvedPos, Slice } from '@atlaskit/editor-prosemirror/model';
2
- import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
1
+ import type { MarkType, Slice } from '@atlaskit/editor-prosemirror/model';
2
+ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
3
  import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
4
4
  export { isEmptyNode, isSelectionInsideLastNodeInDocument, checkNodeDown, insideTableCell, isInListItem, toJSON, nodeToJSON, } from '@atlaskit/editor-common/utils';
5
5
  export { insideTable } from '@atlaskit/editor-common/core-utils';
@@ -8,7 +8,6 @@ export { isParagraph, isText, isLinkMark } from './nodes';
8
8
  export { setNodeSelection, setTextSelection } from './selection';
9
9
  export type { JSONDocNode };
10
10
  export { default as measurements } from './performance/measure-enum';
11
- export declare function getCursor(selection: Selection): ResolvedPos | undefined;
12
11
  /**
13
12
  * Check if a mark is allowed at the current selection / cursor based on a given state.
14
13
  * This method looks at both the currently active marks on the transaction, as well as
@@ -25,20 +24,5 @@ export declare const isTemporary: (id: string) => boolean;
25
24
  export declare const hasOpenEnd: (slice: Slice) => boolean;
26
25
  export declare const isInsideBlockQuote: (state: EditorState) => boolean;
27
26
  export { isTextSelection, isElementInTableCell, isLastItemMediaGroup, nonNullable, } from '@atlaskit/editor-common/utils';
28
- /** Helper type for single arg function */
29
- type Func<A, B> = (a: A) => B;
30
- type FuncN<A extends any[], B> = (...args: A) => B;
31
- /**
32
- * Compose 1 to n functions.
33
- * @param func first function
34
- * @param funcs additional functions
35
- */
36
- export declare function compose<F1 extends Func<any, any>, FN extends Array<Func<any, any>>, R extends FN extends [] ? F1 : FN extends [Func<infer A, any>] ? (a: A) => ReturnType<F1> : FN extends [any, Func<infer A, any>] ? (a: A) => ReturnType<F1> : FN extends [any, any, Func<infer A, any>] ? (a: A) => ReturnType<F1> : FN extends [any, any, any, Func<infer A, any>] ? (a: A) => ReturnType<F1> : FN extends [any, any, any, any, Func<infer A, any>] ? (a: A) => ReturnType<F1> : Func<any, ReturnType<F1>>>(func: F1, ...funcs: FN): R;
37
- export declare function pipe(): <R>(a: R) => R;
38
- export declare function pipe<F extends Function>(f: F): F;
39
- export declare function pipe<F1 extends FuncN<any, any>>(f1: F1): (...args: Parameters<F1>) => ReturnType<F1>;
40
- export declare function pipe<F1 extends FuncN<any, any>, F2 extends Func<ReturnType<F1>, any>>(f1: F1, f2: F2): (...args: Parameters<F1>) => ReturnType<F2>;
41
- export declare function pipe<F1 extends FuncN<any, any>, F2 extends Func<ReturnType<F1>, any>, F3 extends Func<ReturnType<F2>, any>>(f1: F1, f2: F2, f3: F3): (...args: Parameters<F1>) => ReturnType<F3>;
42
- export declare function pipe<F1 extends FuncN<any, any>, F2 extends Func<ReturnType<F1>, any>, F3 extends Func<ReturnType<F2>, any>, FN extends Array<Func<any, any>>>(f1: F1, f2: F2, f3: F3, ...fn: FN): (...args: Parameters<F1>) => any;
43
27
  export declare function sum<T>(arr: Array<T>, f: (val: T) => number): number;
44
28
  export { SetAttrsStep } from '@atlaskit/adf-schema/steps';
@@ -1,5 +1,5 @@
1
1
  import type { EditorState } from '@atlaskit/editor-prosemirror/state';
2
- import type { Command } from '../../types';
2
+ import type { Command } from '@atlaskit/editor-common/types';
3
3
  import type { INPUT_METHOD, EditorAnalyticsAPI } from '@atlaskit/editor-common/analytics';
4
4
  export declare const removeCodeBlock: Command;
5
5
  export declare const changeLanguage: (editorAnalyticsAPI: EditorAnalyticsAPI | undefined) => (language: string) => Command;
@@ -1,6 +1,6 @@
1
1
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
2
  import type { Node } from '@atlaskit/editor-prosemirror/model';
3
- import type { getPosHandlerNode, getPosHandler } from '../../../nodeviews/';
3
+ import type { getPosHandlerNode, getPosHandler } from '@atlaskit/editor-common/types';
4
4
  export declare class CodeBlockView {
5
5
  node: Node;
6
6
  dom: HTMLElement;
@@ -1,5 +1,5 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
- import type codeBlockPlugin from '../';
3
2
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
3
+ import type codeBlockPlugin from '../';
4
4
  declare const ideUX: (pluginInjectionApi: ExtractInjectionAPI<typeof codeBlockPlugin> | undefined) => SafePlugin<any>;
5
5
  export default ideUX;
@@ -1,10 +1,10 @@
1
1
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
2
2
  import type { IntlShape } from 'react-intl-next';
3
- import type { EditorProps } from '../../../types';
3
+ import type { EditorAppearance } from '@atlaskit/editor-common/types';
4
4
  import type { CodeBlockState } from './main-state';
5
5
  export declare const createPlugin: ({ useLongPressSelection, getIntl, appearance, allowCompositionInputOverride, }: {
6
6
  useLongPressSelection?: boolean | undefined;
7
7
  getIntl: () => IntlShape;
8
- appearance: EditorProps['appearance'];
8
+ appearance: EditorAppearance;
9
9
  allowCompositionInputOverride?: boolean | undefined;
10
10
  }) => SafePlugin<CodeBlockState>;
@@ -1,5 +1,4 @@
1
- import type { EditorAppearance } from '../../types';
2
- import type { LongPressSelectionPluginOptions } from '@atlaskit/editor-common/types';
1
+ import type { LongPressSelectionPluginOptions, EditorAppearance } from '@atlaskit/editor-common/types';
3
2
  export interface CodeBlockOptions extends LongPressSelectionPluginOptions {
4
3
  allowCopyToClipboard?: boolean;
5
4
  allowCompositionInputOverride?: boolean;
@@ -1 +1,4 @@
1
1
  export { findCodeBlock, transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark, } from '@atlaskit/editor-common/transforms';
2
+ import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
3
+ import type { Selection } from '@atlaskit/editor-prosemirror/state';
4
+ export declare function getCursor(selection: Selection): ResolvedPos | undefined;
@@ -1,2 +1,2 @@
1
- import { ThemeProps } from '@atlaskit/theme/types';
1
+ import type { ThemeProps } from '@atlaskit/theme/types';
2
2
  export declare const codeBlockStyles: (props: ThemeProps) => import("@emotion/react").SerializedStyles;
@@ -1,5 +1,5 @@
1
- import type { MarkType, ResolvedPos, Slice } from '@atlaskit/editor-prosemirror/model';
2
- import type { EditorState, Selection } from '@atlaskit/editor-prosemirror/state';
1
+ import type { MarkType, Slice } from '@atlaskit/editor-prosemirror/model';
2
+ import type { EditorState } from '@atlaskit/editor-prosemirror/state';
3
3
  import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
4
4
  export { isEmptyNode, isSelectionInsideLastNodeInDocument, checkNodeDown, insideTableCell, isInListItem, toJSON, nodeToJSON, } from '@atlaskit/editor-common/utils';
5
5
  export { insideTable } from '@atlaskit/editor-common/core-utils';
@@ -8,7 +8,6 @@ export { isParagraph, isText, isLinkMark } from './nodes';
8
8
  export { setNodeSelection, setTextSelection } from './selection';
9
9
  export type { JSONDocNode };
10
10
  export { default as measurements } from './performance/measure-enum';
11
- export declare function getCursor(selection: Selection): ResolvedPos | undefined;
12
11
  /**
13
12
  * Check if a mark is allowed at the current selection / cursor based on a given state.
14
13
  * This method looks at both the currently active marks on the transaction, as well as
@@ -25,41 +24,5 @@ export declare const isTemporary: (id: string) => boolean;
25
24
  export declare const hasOpenEnd: (slice: Slice) => boolean;
26
25
  export declare const isInsideBlockQuote: (state: EditorState) => boolean;
27
26
  export { isTextSelection, isElementInTableCell, isLastItemMediaGroup, nonNullable, } from '@atlaskit/editor-common/utils';
28
- /** Helper type for single arg function */
29
- type Func<A, B> = (a: A) => B;
30
- type FuncN<A extends any[], B> = (...args: A) => B;
31
- /**
32
- * Compose 1 to n functions.
33
- * @param func first function
34
- * @param funcs additional functions
35
- */
36
- export declare function compose<F1 extends Func<any, any>, FN extends Array<Func<any, any>>, R extends FN extends [
37
- ] ? F1 : FN extends [
38
- Func<infer A, any>
39
- ] ? (a: A) => ReturnType<F1> : FN extends [
40
- any,
41
- Func<infer A, any>
42
- ] ? (a: A) => ReturnType<F1> : FN extends [
43
- any,
44
- any,
45
- Func<infer A, any>
46
- ] ? (a: A) => ReturnType<F1> : FN extends [
47
- any,
48
- any,
49
- any,
50
- Func<infer A, any>
51
- ] ? (a: A) => ReturnType<F1> : FN extends [
52
- any,
53
- any,
54
- any,
55
- any,
56
- Func<infer A, any>
57
- ] ? (a: A) => ReturnType<F1> : Func<any, ReturnType<F1>>>(func: F1, ...funcs: FN): R;
58
- export declare function pipe(): <R>(a: R) => R;
59
- export declare function pipe<F extends Function>(f: F): F;
60
- export declare function pipe<F1 extends FuncN<any, any>>(f1: F1): (...args: Parameters<F1>) => ReturnType<F1>;
61
- export declare function pipe<F1 extends FuncN<any, any>, F2 extends Func<ReturnType<F1>, any>>(f1: F1, f2: F2): (...args: Parameters<F1>) => ReturnType<F2>;
62
- export declare function pipe<F1 extends FuncN<any, any>, F2 extends Func<ReturnType<F1>, any>, F3 extends Func<ReturnType<F2>, any>>(f1: F1, f2: F2, f3: F3): (...args: Parameters<F1>) => ReturnType<F3>;
63
- export declare function pipe<F1 extends FuncN<any, any>, F2 extends Func<ReturnType<F1>, any>, F3 extends Func<ReturnType<F2>, any>, FN extends Array<Func<any, any>>>(f1: F1, f2: F2, f3: F3, ...fn: FN): (...args: Parameters<F1>) => any;
64
27
  export declare function sum<T>(arr: Array<T>, f: (val: T) => number): number;
65
28
  export { SetAttrsStep } from '@atlaskit/adf-schema/steps';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "189.3.1",
3
+ "version": "189.3.3",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -237,9 +237,6 @@
237
237
  "platform.editor.custom-table-width": {
238
238
  "type": "boolean"
239
239
  },
240
- "platform.linking-platform.editor.fix-link-insert-analytics": {
241
- "type": "boolean"
242
- },
243
240
  "platform.editor.table-sticky-scrollbar": {
244
241
  "type": "boolean"
245
242
  },
@@ -323,6 +320,9 @@
323
320
  },
324
321
  "platform.editor.multi-bodied-extension_0rygg": {
325
322
  "type": "boolean"
323
+ },
324
+ "platform.editor.a11y-find-replace": {
325
+ "type": "boolean"
326
326
  }
327
327
  }
328
328
  }