@atlaskit/editor-core 190.1.7 → 190.1.8

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 (92) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/afm-cc/tsconfig.json +3 -0
  3. package/dist/cjs/plugins/index.js +0 -7
  4. package/dist/cjs/presets/universal.js +2 -1
  5. package/dist/cjs/ui/Addon/ClickAreaInline/index.js +1 -1
  6. package/dist/cjs/utils/action.js +0 -28
  7. package/dist/cjs/version-wrapper.js +1 -1
  8. package/dist/es2019/plugins/index.js +0 -1
  9. package/dist/es2019/presets/universal.js +2 -1
  10. package/dist/es2019/ui/Addon/ClickAreaInline/index.js +1 -1
  11. package/dist/es2019/utils/action.js +0 -28
  12. package/dist/es2019/version-wrapper.js +1 -1
  13. package/dist/esm/plugins/index.js +0 -1
  14. package/dist/esm/presets/universal.js +2 -1
  15. package/dist/esm/ui/Addon/ClickAreaInline/index.js +1 -1
  16. package/dist/esm/utils/action.js +0 -28
  17. package/dist/esm/version-wrapper.js +1 -1
  18. package/dist/types/plugins/index.d.ts +0 -1
  19. package/dist/types/utils/action.d.ts +0 -6
  20. package/dist/types-ts4.5/plugins/index.d.ts +0 -1
  21. package/dist/types-ts4.5/utils/action.d.ts +0 -6
  22. package/package.json +2 -1
  23. package/dist/cjs/commands/index.js +0 -42
  24. package/dist/cjs/plugins/alignment/commands/index.js +0 -36
  25. package/dist/cjs/plugins/alignment/index.js +0 -70
  26. package/dist/cjs/plugins/alignment/pm-plugins/keymap.js +0 -14
  27. package/dist/cjs/plugins/alignment/pm-plugins/main.js +0 -45
  28. package/dist/cjs/plugins/alignment/pm-plugins/types.js +0 -5
  29. package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/icon-map.js +0 -36
  30. package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/index.js +0 -169
  31. package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/messages.js +0 -29
  32. package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/styles.js +0 -13
  33. package/dist/cjs/plugins/alignment/utils/index.js +0 -27
  34. package/dist/cjs/ui/Alignment/AlignmentButton/index.js +0 -71
  35. package/dist/cjs/ui/Alignment/index.js +0 -74
  36. package/dist/cjs/ui/Alignment/styles.js +0 -11
  37. package/dist/es2019/commands/index.js +0 -1
  38. package/dist/es2019/plugins/alignment/commands/index.js +0 -30
  39. package/dist/es2019/plugins/alignment/index.js +0 -58
  40. package/dist/es2019/plugins/alignment/pm-plugins/keymap.js +0 -8
  41. package/dist/es2019/plugins/alignment/pm-plugins/main.js +0 -34
  42. package/dist/es2019/plugins/alignment/pm-plugins/types.js +0 -1
  43. package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/icon-map.js +0 -30
  44. package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/index.js +0 -140
  45. package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/messages.js +0 -23
  46. package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/styles.js +0 -14
  47. package/dist/es2019/plugins/alignment/utils/index.js +0 -15
  48. package/dist/es2019/ui/Alignment/AlignmentButton/index.js +0 -44
  49. package/dist/es2019/ui/Alignment/index.js +0 -54
  50. package/dist/es2019/ui/Alignment/styles.js +0 -7
  51. package/dist/esm/commands/index.js +0 -1
  52. package/dist/esm/plugins/alignment/commands/index.js +0 -30
  53. package/dist/esm/plugins/alignment/index.js +0 -63
  54. package/dist/esm/plugins/alignment/pm-plugins/keymap.js +0 -8
  55. package/dist/esm/plugins/alignment/pm-plugins/main.js +0 -36
  56. package/dist/esm/plugins/alignment/pm-plugins/types.js +0 -1
  57. package/dist/esm/plugins/alignment/ui/ToolbarAlignment/icon-map.js +0 -29
  58. package/dist/esm/plugins/alignment/ui/ToolbarAlignment/index.js +0 -163
  59. package/dist/esm/plugins/alignment/ui/ToolbarAlignment/messages.js +0 -23
  60. package/dist/esm/plugins/alignment/ui/ToolbarAlignment/styles.js +0 -6
  61. package/dist/esm/plugins/alignment/utils/index.js +0 -21
  62. package/dist/esm/ui/Alignment/AlignmentButton/index.js +0 -62
  63. package/dist/esm/ui/Alignment/index.js +0 -68
  64. package/dist/esm/ui/Alignment/styles.js +0 -4
  65. package/dist/types/commands/index.d.ts +0 -1
  66. package/dist/types/plugins/alignment/commands/index.d.ts +0 -4
  67. package/dist/types/plugins/alignment/index.d.ts +0 -5
  68. package/dist/types/plugins/alignment/pm-plugins/keymap.d.ts +0 -2
  69. package/dist/types/plugins/alignment/pm-plugins/main.d.ts +0 -8
  70. package/dist/types/plugins/alignment/pm-plugins/types.d.ts +0 -5
  71. package/dist/types/plugins/alignment/ui/ToolbarAlignment/icon-map.d.ts +0 -6
  72. package/dist/types/plugins/alignment/ui/ToolbarAlignment/index.d.ts +0 -33
  73. package/dist/types/plugins/alignment/ui/ToolbarAlignment/messages.d.ts +0 -22
  74. package/dist/types/plugins/alignment/ui/ToolbarAlignment/styles.d.ts +0 -3
  75. package/dist/types/plugins/alignment/utils/index.d.ts +0 -3
  76. package/dist/types/ui/Alignment/AlignmentButton/index.d.ts +0 -17
  77. package/dist/types/ui/Alignment/index.d.ts +0 -12
  78. package/dist/types/ui/Alignment/styles.d.ts +0 -1
  79. package/dist/types-ts4.5/commands/index.d.ts +0 -1
  80. package/dist/types-ts4.5/plugins/alignment/commands/index.d.ts +0 -4
  81. package/dist/types-ts4.5/plugins/alignment/index.d.ts +0 -5
  82. package/dist/types-ts4.5/plugins/alignment/pm-plugins/keymap.d.ts +0 -2
  83. package/dist/types-ts4.5/plugins/alignment/pm-plugins/main.d.ts +0 -8
  84. package/dist/types-ts4.5/plugins/alignment/pm-plugins/types.d.ts +0 -5
  85. package/dist/types-ts4.5/plugins/alignment/ui/ToolbarAlignment/icon-map.d.ts +0 -6
  86. package/dist/types-ts4.5/plugins/alignment/ui/ToolbarAlignment/index.d.ts +0 -33
  87. package/dist/types-ts4.5/plugins/alignment/ui/ToolbarAlignment/messages.d.ts +0 -22
  88. package/dist/types-ts4.5/plugins/alignment/ui/ToolbarAlignment/styles.d.ts +0 -3
  89. package/dist/types-ts4.5/plugins/alignment/utils/index.d.ts +0 -3
  90. package/dist/types-ts4.5/ui/Alignment/AlignmentButton/index.d.ts +0 -17
  91. package/dist/types-ts4.5/ui/Alignment/index.d.ts +0 -12
  92. package/dist/types-ts4.5/ui/Alignment/styles.d.ts +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 190.1.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [#62199](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/62199) [`755cef0498e0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/755cef0498e0) - Extract editor alignment to new package @atlaskit/editor-plugin-alignment
8
+ - Updated dependencies
9
+
3
10
  ## 190.1.7
4
11
 
5
12
  ### Patch Changes
@@ -58,6 +58,9 @@
58
58
  {
59
59
  "path": "../../editor-markdown-transformer/afm-cc/tsconfig.json"
60
60
  },
61
+ {
62
+ "path": "../../editor-plugin-alignment/afm-cc/tsconfig.json"
63
+ },
61
64
  {
62
65
  "path": "../../editor-plugin-analytics/afm-cc/tsconfig.json"
63
66
  },
@@ -4,12 +4,6 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- Object.defineProperty(exports, "alignmentPlugin", {
8
- enumerable: true,
9
- get: function get() {
10
- return _alignment.default;
11
- }
12
- });
13
7
  Object.defineProperty(exports, "annotationPlugin", {
14
8
  enumerable: true,
15
9
  get: function get() {
@@ -93,7 +87,6 @@ var _extension = _interopRequireDefault(require("./extension"));
93
87
  var _jiraIssue = _interopRequireDefault(require("./jira-issue"));
94
88
  var _paste = _interopRequireDefault(require("./paste"));
95
89
  var _breakout = _interopRequireDefault(require("./breakout"));
96
- var _alignment = _interopRequireDefault(require("./alignment"));
97
90
  var _dataConsumer = _interopRequireDefault(require("./data-consumer"));
98
91
  var _annotation = _interopRequireDefault(require("./annotation"));
99
92
  var _customAutoformat = _interopRequireDefault(require("./custom-autoformat"));
@@ -42,6 +42,7 @@ var _editorPluginTable = require("@atlaskit/editor-plugin-table");
42
42
  var _editorPluginTasksAndDecisions = require("@atlaskit/editor-plugin-tasks-and-decisions");
43
43
  var _editorPluginTextColor = require("@atlaskit/editor-plugin-text-color");
44
44
  var _editorPluginToolbarListsIndentation = require("@atlaskit/editor-plugin-toolbar-lists-indentation");
45
+ var _editorPluginAlignment = require("@atlaskit/editor-plugin-alignment");
45
46
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
46
47
  var _plugins = require("../plugins");
47
48
  var _utils = require("@atlaskit/editor-common/utils");
@@ -85,7 +86,7 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
85
86
  }]);
86
87
  }
87
88
  return builder;
88
- }).maybeAdd(_plugins.alignmentPlugin, function (plugin, builder) {
89
+ }).maybeAdd(_editorPluginAlignment.alignmentPlugin, function (plugin, builder) {
89
90
  if (props.allowTextAlignment) {
90
91
  return builder.add(plugin);
91
92
  }
@@ -8,7 +8,7 @@ exports.default = exports.ClickAreaInline = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
  var _react2 = require("@emotion/react");
11
- var _commands = require("../../../commands");
11
+ var _commands = require("@atlaskit/editor-common/commands");
12
12
  var _templateObject;
13
13
  /** @jsx jsx */
14
14
  var clickArea = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n flex-grow: 1;\n"])));
@@ -5,11 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.__temporaryFixForConfigPanel = __temporaryFixForConfigPanel;
8
- exports.cascadeCommands = cascadeCommands;
9
8
  exports.getEditorValueWithMedia = getEditorValueWithMedia;
10
9
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
12
- var _state = require("@atlaskit/editor-prosemirror/state");
13
11
  var _pluginKey = require("../plugins/extension/plugin-key");
14
12
  var _commands = require("../plugins/extension/commands");
15
13
  // TODO: ED-15663
@@ -50,10 +48,6 @@ function _temporaryFixForConfigPanel() {
50
48
  function getEditorValueWithMedia(_x2) {
51
49
  return _getEditorValueWithMedia.apply(this, arguments);
52
50
  }
53
- /**
54
- * Iterates over the commands one after the other,
55
- * passes the tr through and dispatches the cumulated transaction
56
- */
57
51
  function _getEditorValueWithMedia() {
58
52
  _getEditorValueWithMedia = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(editorView) {
59
53
  var mediaPluginState;
@@ -76,26 +70,4 @@ function _getEditorValueWithMedia() {
76
70
  }, _callee2);
77
71
  }));
78
72
  return _getEditorValueWithMedia.apply(this, arguments);
79
- }
80
- function cascadeCommands(cmds) {
81
- return function (state, dispatch) {
82
- var baseTr = state.tr;
83
- var shouldDispatch = false;
84
- var onDispatchAction = function onDispatchAction(tr) {
85
- var selectionJSON = tr.selection.toJSON();
86
- baseTr.setSelection(_state.Selection.fromJSON(baseTr.doc, selectionJSON));
87
- tr.steps.forEach(function (st) {
88
- baseTr.step(st);
89
- });
90
- shouldDispatch = true;
91
- };
92
- cmds.forEach(function (cmd) {
93
- return cmd(state, onDispatchAction);
94
- });
95
- if (dispatch && shouldDispatch) {
96
- dispatch(baseTr);
97
- return true;
98
- }
99
- return false;
100
- };
101
73
  }
@@ -5,4 +5,4 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
- var version = exports.version = "190.1.7";
8
+ var version = exports.version = "190.1.8";
@@ -3,7 +3,6 @@ export { default as extensionPlugin } from './extension';
3
3
  export { default as jiraIssuePlugin } from './jira-issue';
4
4
  export { default as pastePlugin } from './paste';
5
5
  export { default as breakoutPlugin } from './breakout';
6
- export { default as alignmentPlugin } from './alignment';
7
6
  export { default as dataConsumerMarkPlugin } from './data-consumer';
8
7
  export { default as annotationPlugin } from './annotation';
9
8
  export { default as customAutoformatPlugin } from './custom-autoformat';
@@ -32,8 +32,9 @@ import { tablesPlugin } from '@atlaskit/editor-plugin-table';
32
32
  import { tasksAndDecisionsPlugin } from '@atlaskit/editor-plugin-tasks-and-decisions';
33
33
  import { textColorPlugin } from '@atlaskit/editor-plugin-text-color';
34
34
  import { toolbarListsIndentationPlugin } from '@atlaskit/editor-plugin-toolbar-lists-indentation';
35
+ import { alignmentPlugin } from '@atlaskit/editor-plugin-alignment';
35
36
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
36
- import { alignmentPlugin, annotationPlugin, avatarGroupPlugin, beforePrimaryToolbarPlugin, breakoutPlugin, collabEditPlugin, customAutoformatPlugin, dataConsumerMarkPlugin, extensionPlugin, feedbackDialogPlugin, findReplacePlugin, jiraIssuePlugin } from '../plugins';
37
+ import { annotationPlugin, avatarGroupPlugin, beforePrimaryToolbarPlugin, breakoutPlugin, collabEditPlugin, customAutoformatPlugin, dataConsumerMarkPlugin, extensionPlugin, feedbackDialogPlugin, findReplacePlugin, jiraIssuePlugin } from '../plugins';
37
38
  import { shouldForceTracking } from '@atlaskit/editor-common/utils';
38
39
  import { isFullPage as fullPageCheck } from '../utils/is-full-page';
39
40
  import { createDefaultPreset } from './default';
@@ -1,7 +1,7 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
- import { createParagraphAtEnd } from '../../../commands';
4
+ import { createParagraphAtEnd } from '@atlaskit/editor-common/commands';
5
5
  const clickArea = css`
6
6
  flex-grow: 1;
7
7
  `;
@@ -1,4 +1,3 @@
1
- import { Selection } from '@atlaskit/editor-prosemirror/state';
2
1
  import { pluginKey as extensionPluginKey } from '../plugins/extension/plugin-key';
3
2
  import { forceAutoSave } from '../plugins/extension/commands';
4
3
  // TODO: ED-15663
@@ -24,31 +23,4 @@ export async function getEditorValueWithMedia(editorView) {
24
23
  await mediaPluginState.waitForPendingTasks();
25
24
  }
26
25
  return editorView.state.doc;
27
- }
28
-
29
- /**
30
- * Iterates over the commands one after the other,
31
- * passes the tr through and dispatches the cumulated transaction
32
- */
33
- export function cascadeCommands(cmds) {
34
- return (state, dispatch) => {
35
- let {
36
- tr: baseTr
37
- } = state;
38
- let shouldDispatch = false;
39
- const onDispatchAction = tr => {
40
- const selectionJSON = tr.selection.toJSON();
41
- baseTr.setSelection(Selection.fromJSON(baseTr.doc, selectionJSON));
42
- tr.steps.forEach(st => {
43
- baseTr.step(st);
44
- });
45
- shouldDispatch = true;
46
- };
47
- cmds.forEach(cmd => cmd(state, onDispatchAction));
48
- if (dispatch && shouldDispatch) {
49
- dispatch(baseTr);
50
- return true;
51
- }
52
- return false;
53
- };
54
26
  }
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "190.1.7";
2
+ export const version = "190.1.8";
@@ -3,7 +3,6 @@ export { default as extensionPlugin } from './extension';
3
3
  export { default as jiraIssuePlugin } from './jira-issue';
4
4
  export { default as pastePlugin } from './paste';
5
5
  export { default as breakoutPlugin } from './breakout';
6
- export { default as alignmentPlugin } from './alignment';
7
6
  export { default as dataConsumerMarkPlugin } from './data-consumer';
8
7
  export { default as annotationPlugin } from './annotation';
9
8
  export { default as customAutoformatPlugin } from './custom-autoformat';
@@ -36,8 +36,9 @@ import { tablesPlugin } from '@atlaskit/editor-plugin-table';
36
36
  import { tasksAndDecisionsPlugin } from '@atlaskit/editor-plugin-tasks-and-decisions';
37
37
  import { textColorPlugin } from '@atlaskit/editor-plugin-text-color';
38
38
  import { toolbarListsIndentationPlugin } from '@atlaskit/editor-plugin-toolbar-lists-indentation';
39
+ import { alignmentPlugin } from '@atlaskit/editor-plugin-alignment';
39
40
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
40
- import { alignmentPlugin, annotationPlugin, avatarGroupPlugin, beforePrimaryToolbarPlugin, breakoutPlugin, collabEditPlugin, customAutoformatPlugin, dataConsumerMarkPlugin, extensionPlugin, feedbackDialogPlugin, findReplacePlugin, jiraIssuePlugin } from '../plugins';
41
+ import { annotationPlugin, avatarGroupPlugin, beforePrimaryToolbarPlugin, breakoutPlugin, collabEditPlugin, customAutoformatPlugin, dataConsumerMarkPlugin, extensionPlugin, feedbackDialogPlugin, findReplacePlugin, jiraIssuePlugin } from '../plugins';
41
42
  import { shouldForceTracking } from '@atlaskit/editor-common/utils';
42
43
  import { isFullPage as fullPageCheck } from '../utils/is-full-page';
43
44
  import { createDefaultPreset } from './default';
@@ -3,7 +3,7 @@ var _templateObject;
3
3
  /** @jsx jsx */
4
4
  import React from 'react';
5
5
  import { css, jsx } from '@emotion/react';
6
- import { createParagraphAtEnd } from '../../../commands';
6
+ import { createParagraphAtEnd } from '@atlaskit/editor-common/commands';
7
7
  var clickArea = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n flex-grow: 1;\n"])));
8
8
  export var ClickAreaInline = function ClickAreaInline(_ref) {
9
9
  var editorView = _ref.editorView,
@@ -1,6 +1,5 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
- import { Selection } from '@atlaskit/editor-prosemirror/state';
4
3
  import { pluginKey as extensionPluginKey } from '../plugins/extension/plugin-key';
5
4
  import { forceAutoSave } from '../plugins/extension/commands';
6
5
  // TODO: ED-15663
@@ -41,11 +40,6 @@ function _temporaryFixForConfigPanel() {
41
40
  export function getEditorValueWithMedia(_x2) {
42
41
  return _getEditorValueWithMedia.apply(this, arguments);
43
42
  }
44
-
45
- /**
46
- * Iterates over the commands one after the other,
47
- * passes the tr through and dispatches the cumulated transaction
48
- */
49
43
  function _getEditorValueWithMedia() {
50
44
  _getEditorValueWithMedia = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(editorView) {
51
45
  var mediaPluginState;
@@ -68,26 +62,4 @@ function _getEditorValueWithMedia() {
68
62
  }, _callee2);
69
63
  }));
70
64
  return _getEditorValueWithMedia.apply(this, arguments);
71
- }
72
- export function cascadeCommands(cmds) {
73
- return function (state, dispatch) {
74
- var baseTr = state.tr;
75
- var shouldDispatch = false;
76
- var onDispatchAction = function onDispatchAction(tr) {
77
- var selectionJSON = tr.selection.toJSON();
78
- baseTr.setSelection(Selection.fromJSON(baseTr.doc, selectionJSON));
79
- tr.steps.forEach(function (st) {
80
- baseTr.step(st);
81
- });
82
- shouldDispatch = true;
83
- };
84
- cmds.forEach(function (cmd) {
85
- return cmd(state, onDispatchAction);
86
- });
87
- if (dispatch && shouldDispatch) {
88
- dispatch(baseTr);
89
- return true;
90
- }
91
- return false;
92
- };
93
65
  }
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "190.1.7";
2
+ export var version = "190.1.8";
@@ -3,7 +3,6 @@ export { default as extensionPlugin } from './extension';
3
3
  export { default as jiraIssuePlugin } from './jira-issue';
4
4
  export { default as pastePlugin } from './paste';
5
5
  export { default as breakoutPlugin } from './breakout';
6
- export { default as alignmentPlugin } from './alignment';
7
6
  export { default as dataConsumerMarkPlugin } from './data-consumer';
8
7
  export { default as annotationPlugin } from './annotation';
9
8
  export { default as customAutoformatPlugin } from './custom-autoformat';
@@ -1,9 +1,3 @@
1
1
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
- import type { Command } from '../types/command';
3
2
  export declare function __temporaryFixForConfigPanel(editorView: EditorView): Promise<void>;
4
3
  export declare function getEditorValueWithMedia(editorView: EditorView): Promise<import("prosemirror-model").Node>;
5
- /**
6
- * Iterates over the commands one after the other,
7
- * passes the tr through and dispatches the cumulated transaction
8
- */
9
- export declare function cascadeCommands(cmds: Command[]): Command;
@@ -3,7 +3,6 @@ export { default as extensionPlugin } from './extension';
3
3
  export { default as jiraIssuePlugin } from './jira-issue';
4
4
  export { default as pastePlugin } from './paste';
5
5
  export { default as breakoutPlugin } from './breakout';
6
- export { default as alignmentPlugin } from './alignment';
7
6
  export { default as dataConsumerMarkPlugin } from './data-consumer';
8
7
  export { default as annotationPlugin } from './annotation';
9
8
  export { default as customAutoformatPlugin } from './custom-autoformat';
@@ -1,9 +1,3 @@
1
1
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
2
- import type { Command } from '../types/command';
3
2
  export declare function __temporaryFixForConfigPanel(editorView: EditorView): Promise<void>;
4
3
  export declare function getEditorValueWithMedia(editorView: EditorView): Promise<import("prosemirror-model").Node>;
5
- /**
6
- * Iterates over the commands one after the other,
7
- * passes the tr through and dispatches the cumulated transaction
8
- */
9
- export declare function cascadeCommands(cmds: Command[]): Command;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "190.1.7",
3
+ "version": "190.1.8",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -54,6 +54,7 @@
54
54
  "@atlaskit/editor-common": "^76.27.0",
55
55
  "@atlaskit/editor-json-transformer": "^8.10.0",
56
56
  "@atlaskit/editor-markdown-transformer": "^5.2.5",
57
+ "@atlaskit/editor-plugin-alignment": "^0.1.0",
57
58
  "@atlaskit/editor-plugin-analytics": "^0.4.0",
58
59
  "@atlaskit/editor-plugin-base": "^0.2.0",
59
60
  "@atlaskit/editor-plugin-better-type-history": "^0.1.0",
@@ -1,42 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "addParagraphAtEnd", {
7
- enumerable: true,
8
- get: function get() {
9
- return _commands.addParagraphAtEnd;
10
- }
11
- });
12
- Object.defineProperty(exports, "changeImageAlignment", {
13
- enumerable: true,
14
- get: function get() {
15
- return _commands.changeImageAlignment;
16
- }
17
- });
18
- Object.defineProperty(exports, "clearEditorContent", {
19
- enumerable: true,
20
- get: function get() {
21
- return _commands.clearEditorContent;
22
- }
23
- });
24
- Object.defineProperty(exports, "createParagraphAtEnd", {
25
- enumerable: true,
26
- get: function get() {
27
- return _commands.createParagraphAtEnd;
28
- }
29
- });
30
- Object.defineProperty(exports, "createToggleBlockMarkOnRange", {
31
- enumerable: true,
32
- get: function get() {
33
- return _commands.createToggleBlockMarkOnRange;
34
- }
35
- });
36
- Object.defineProperty(exports, "toggleBlockMark", {
37
- enumerable: true,
38
- get: function get() {
39
- return _commands.toggleBlockMark;
40
- }
41
- });
42
- var _commands = require("@atlaskit/editor-common/commands");
@@ -1,36 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.isAlignable = exports.changeAlignment = void 0;
7
- var _commands = require("../../../commands");
8
- var _action = require("../../../utils/action");
9
- var isAlignable = exports.isAlignable = function isAlignable(align) {
10
- return function (state, dispatch) {
11
- var _state$schema = state.schema,
12
- _state$schema$nodes = _state$schema.nodes,
13
- paragraph = _state$schema$nodes.paragraph,
14
- heading = _state$schema$nodes.heading,
15
- alignment = _state$schema.marks.alignment;
16
- return (0, _commands.toggleBlockMark)(alignment, function () {
17
- return !align ? undefined : align === 'start' ? false : {
18
- align: align
19
- };
20
- }, [paragraph, heading])(state, dispatch);
21
- };
22
- };
23
- var changeAlignment = exports.changeAlignment = function changeAlignment(align) {
24
- return function (state, dispatch) {
25
- var _state$schema2 = state.schema,
26
- _state$schema2$nodes = _state$schema2.nodes,
27
- paragraph = _state$schema2$nodes.paragraph,
28
- heading = _state$schema2$nodes.heading,
29
- alignment = _state$schema2.marks.alignment;
30
- return (0, _action.cascadeCommands)([(0, _commands.changeImageAlignment)(align), (0, _commands.toggleBlockMark)(alignment, function () {
31
- return !align ? undefined : align === 'start' ? false : {
32
- align: align
33
- };
34
- }, [paragraph, heading])])(state, dispatch);
35
- };
36
- };
@@ -1,70 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.defaultConfig = exports.default = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _adfSchema = require("@atlaskit/adf-schema");
10
- var _WithPluginState = _interopRequireDefault(require("../../ui/WithPluginState"));
11
- var _main = require("./pm-plugins/main");
12
- var _commands = require("./commands");
13
- var _ToolbarAlignment = _interopRequireDefault(require("./ui/ToolbarAlignment"));
14
- var _keymap = require("./pm-plugins/keymap");
15
- var defaultConfig = exports.defaultConfig = {
16
- align: 'start'
17
- };
18
- var alignmentPlugin = function alignmentPlugin() {
19
- return {
20
- name: 'alignment',
21
- marks: function marks() {
22
- return [{
23
- name: 'alignment',
24
- mark: _adfSchema.alignment
25
- }];
26
- },
27
- pmPlugins: function pmPlugins() {
28
- return [{
29
- name: 'alignmentPlugin',
30
- plugin: function plugin(_ref) {
31
- var dispatch = _ref.dispatch;
32
- return (0, _main.createPlugin)(dispatch, defaultConfig);
33
- }
34
- }, {
35
- name: 'annotationKeymap',
36
- plugin: function plugin() {
37
- return (0, _keymap.keymapPlugin)();
38
- }
39
- }];
40
- },
41
- primaryToolbarComponent: function primaryToolbarComponent(_ref2) {
42
- var editorView = _ref2.editorView,
43
- popupsMountPoint = _ref2.popupsMountPoint,
44
- popupsBoundariesElement = _ref2.popupsBoundariesElement,
45
- popupsScrollableElement = _ref2.popupsScrollableElement,
46
- disabled = _ref2.disabled,
47
- isToolbarReducedSpacing = _ref2.isToolbarReducedSpacing;
48
- return /*#__PURE__*/_react.default.createElement(_WithPluginState.default, {
49
- plugins: {
50
- align: _main.pluginKey
51
- },
52
- render: function render(_ref3) {
53
- var align = _ref3.align;
54
- return /*#__PURE__*/_react.default.createElement(_ToolbarAlignment.default, {
55
- pluginState: align,
56
- isReducedSpacing: isToolbarReducedSpacing,
57
- changeAlignment: function changeAlignment(align) {
58
- return (0, _commands.changeAlignment)(align)(editorView.state, editorView.dispatch);
59
- },
60
- disabled: disabled || !align.isEnabled,
61
- popupsMountPoint: popupsMountPoint,
62
- popupsBoundariesElement: popupsBoundariesElement,
63
- popupsScrollableElement: popupsScrollableElement
64
- });
65
- }
66
- });
67
- }
68
- };
69
- };
70
- var _default = exports.default = alignmentPlugin;
@@ -1,14 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.keymapPlugin = keymapPlugin;
7
- var _keymap = require("@atlaskit/editor-prosemirror/keymap");
8
- var _keymaps = require("../../../keymaps");
9
- var _commands = require("../commands");
10
- function keymapPlugin() {
11
- var list = {};
12
- (0, _keymaps.bindKeymapWithCommand)(_keymaps.alignLeft.common, (0, _commands.changeAlignment)('start'), list);
13
- return (0, _keymap.keymap)(list);
14
- }
@@ -1,45 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.createInitialPluginState = createInitialPluginState;
8
- exports.createPlugin = createPlugin;
9
- exports.pluginKey = void 0;
10
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
- var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
12
- var _state = require("@atlaskit/editor-prosemirror/state");
13
- var _commands = require("../commands");
14
- var _utils = require("../utils");
15
- 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; }
16
- 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) { (0, _defineProperty2.default)(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; }
17
- function createInitialPluginState(editorState, pluginConfig) {
18
- return {
19
- align: (0, _utils.getActiveAlignment)(editorState) || pluginConfig.align,
20
- isEnabled: true
21
- };
22
- }
23
- var pluginKey = exports.pluginKey = new _state.PluginKey('alignmentPlugin');
24
- function createPlugin(dispatch, pluginConfig) {
25
- return new _safePlugin.SafePlugin({
26
- key: pluginKey,
27
- state: {
28
- init: function init(_config, editorState) {
29
- return createInitialPluginState(editorState, pluginConfig);
30
- },
31
- apply: function apply(_tr, state, _prevState, nextState) {
32
- var nextPluginState = (0, _utils.getActiveAlignment)(nextState);
33
- var isEnabled = (0, _commands.isAlignable)(nextPluginState)(nextState);
34
- var newState = _objectSpread(_objectSpread({}, state), {}, {
35
- align: nextPluginState,
36
- isEnabled: isEnabled
37
- });
38
- if (nextPluginState !== state.align || isEnabled !== state.isEnabled) {
39
- dispatch(pluginKey, newState);
40
- }
41
- return newState;
42
- }
43
- }
44
- });
45
- }
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,36 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.IconMap = void 0;
8
- var _alignLeft = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/align-left"));
9
- var _alignRight = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/align-right"));
10
- var _alignCenter = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/align-center"));
11
- var _reactIntlNext = require("react-intl-next");
12
- var _messages = require("./messages");
13
- var _react = _interopRequireDefault(require("react"));
14
- var iconAndMessageMap = {
15
- start: {
16
- Component: _alignLeft.default,
17
- label: _messages.messages.alignLeft
18
- },
19
- end: {
20
- Component: _alignRight.default,
21
- label: _messages.messages.alignRight
22
- },
23
- center: {
24
- Component: _alignCenter.default,
25
- label: _messages.messages.alignCenter
26
- }
27
- };
28
- var IconMap = exports.IconMap = function IconMap(props) {
29
- var _iconAndMessageMap$pr = iconAndMessageMap[props.alignment],
30
- Component = _iconAndMessageMap$pr.Component,
31
- label = _iconAndMessageMap$pr.label;
32
- var intl = (0, _reactIntlNext.useIntl)();
33
- return /*#__PURE__*/_react.default.createElement(Component, {
34
- label: intl.formatMessage(label)
35
- });
36
- };