@atlaskit/editor-core 190.1.6 → 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.
- package/CHANGELOG.md +13 -0
- package/afm-cc/tsconfig.json +3 -0
- package/dist/cjs/plugins/index.js +0 -28
- package/dist/cjs/presets/universal.js +2 -16
- package/dist/cjs/ui/Addon/ClickAreaInline/index.js +1 -1
- package/dist/cjs/ui/AppearanceComponents/Mobile.js +3 -0
- package/dist/cjs/utils/action.js +0 -28
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/index.js +0 -4
- package/dist/es2019/presets/universal.js +2 -16
- package/dist/es2019/ui/Addon/ClickAreaInline/index.js +1 -1
- package/dist/es2019/ui/AppearanceComponents/Mobile.js +4 -0
- package/dist/es2019/utils/action.js +0 -28
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/index.js +0 -4
- package/dist/esm/presets/universal.js +2 -16
- package/dist/esm/ui/Addon/ClickAreaInline/index.js +1 -1
- package/dist/esm/ui/AppearanceComponents/Mobile.js +4 -0
- package/dist/esm/utils/action.js +0 -28
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/index.d.ts +0 -4
- package/dist/types/utils/action.d.ts +0 -6
- package/dist/types-ts4.5/plugins/index.d.ts +0 -4
- package/dist/types-ts4.5/utils/action.d.ts +0 -6
- package/package.json +2 -1
- package/dist/cjs/commands/index.js +0 -42
- package/dist/cjs/plugins/alignment/commands/index.js +0 -36
- package/dist/cjs/plugins/alignment/index.js +0 -70
- package/dist/cjs/plugins/alignment/pm-plugins/keymap.js +0 -14
- package/dist/cjs/plugins/alignment/pm-plugins/main.js +0 -45
- package/dist/cjs/plugins/alignment/pm-plugins/types.js +0 -5
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/icon-map.js +0 -36
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/index.js +0 -169
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/messages.js +0 -29
- package/dist/cjs/plugins/alignment/ui/ToolbarAlignment/styles.js +0 -13
- package/dist/cjs/plugins/alignment/utils/index.js +0 -27
- package/dist/cjs/plugins/mobile-dimensions/actions.js +0 -12
- package/dist/cjs/plugins/mobile-dimensions/commands.js +0 -26
- package/dist/cjs/plugins/mobile-dimensions/index.js +0 -99
- package/dist/cjs/plugins/mobile-dimensions/plugin-factory.js +0 -15
- package/dist/cjs/plugins/mobile-dimensions/reducer.js +0 -28
- package/dist/cjs/plugins/mobile-dimensions/types.js +0 -5
- package/dist/cjs/plugins/mobile-selection/content-in-selection.js +0 -24
- package/dist/cjs/plugins/mobile-selection/index.js +0 -18
- package/dist/cjs/plugins/mobile-selection/mobile-selection-plugin.js +0 -59
- package/dist/cjs/plugins/mobile-selection/types.js +0 -5
- package/dist/cjs/plugins/view-update-subscription/index.js +0 -90
- package/dist/cjs/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.js +0 -109
- package/dist/cjs/ui/Alignment/AlignmentButton/index.js +0 -71
- package/dist/cjs/ui/Alignment/index.js +0 -74
- package/dist/cjs/ui/Alignment/styles.js +0 -11
- package/dist/es2019/commands/index.js +0 -1
- package/dist/es2019/plugins/alignment/commands/index.js +0 -30
- package/dist/es2019/plugins/alignment/index.js +0 -58
- package/dist/es2019/plugins/alignment/pm-plugins/keymap.js +0 -8
- package/dist/es2019/plugins/alignment/pm-plugins/main.js +0 -34
- package/dist/es2019/plugins/alignment/pm-plugins/types.js +0 -1
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/icon-map.js +0 -30
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/index.js +0 -140
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/messages.js +0 -23
- package/dist/es2019/plugins/alignment/ui/ToolbarAlignment/styles.js +0 -14
- package/dist/es2019/plugins/alignment/utils/index.js +0 -15
- package/dist/es2019/plugins/mobile-dimensions/actions.js +0 -6
- package/dist/es2019/plugins/mobile-dimensions/commands.js +0 -14
- package/dist/es2019/plugins/mobile-dimensions/index.js +0 -88
- package/dist/es2019/plugins/mobile-dimensions/plugin-factory.js +0 -9
- package/dist/es2019/plugins/mobile-dimensions/reducer.js +0 -21
- package/dist/es2019/plugins/mobile-dimensions/types.js +0 -1
- package/dist/es2019/plugins/mobile-selection/content-in-selection.js +0 -17
- package/dist/es2019/plugins/mobile-selection/index.js +0 -1
- package/dist/es2019/plugins/mobile-selection/mobile-selection-plugin.js +0 -53
- package/dist/es2019/plugins/mobile-selection/types.js +0 -1
- package/dist/es2019/plugins/view-update-subscription/index.js +0 -73
- package/dist/es2019/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.js +0 -106
- package/dist/es2019/ui/Alignment/AlignmentButton/index.js +0 -44
- package/dist/es2019/ui/Alignment/index.js +0 -54
- package/dist/es2019/ui/Alignment/styles.js +0 -7
- package/dist/esm/commands/index.js +0 -1
- package/dist/esm/plugins/alignment/commands/index.js +0 -30
- package/dist/esm/plugins/alignment/index.js +0 -63
- package/dist/esm/plugins/alignment/pm-plugins/keymap.js +0 -8
- package/dist/esm/plugins/alignment/pm-plugins/main.js +0 -36
- package/dist/esm/plugins/alignment/pm-plugins/types.js +0 -1
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/icon-map.js +0 -29
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/index.js +0 -163
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/messages.js +0 -23
- package/dist/esm/plugins/alignment/ui/ToolbarAlignment/styles.js +0 -6
- package/dist/esm/plugins/alignment/utils/index.js +0 -21
- package/dist/esm/plugins/mobile-dimensions/actions.js +0 -6
- package/dist/esm/plugins/mobile-dimensions/commands.js +0 -20
- package/dist/esm/plugins/mobile-dimensions/index.js +0 -93
- package/dist/esm/plugins/mobile-dimensions/plugin-factory.js +0 -9
- package/dist/esm/plugins/mobile-dimensions/reducer.js +0 -21
- package/dist/esm/plugins/mobile-dimensions/types.js +0 -1
- package/dist/esm/plugins/mobile-selection/content-in-selection.js +0 -18
- package/dist/esm/plugins/mobile-selection/index.js +0 -1
- package/dist/esm/plugins/mobile-selection/mobile-selection-plugin.js +0 -53
- package/dist/esm/plugins/mobile-selection/types.js +0 -1
- package/dist/esm/plugins/view-update-subscription/index.js +0 -83
- package/dist/esm/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.js +0 -103
- package/dist/esm/ui/Alignment/AlignmentButton/index.js +0 -62
- package/dist/esm/ui/Alignment/index.js +0 -68
- package/dist/esm/ui/Alignment/styles.js +0 -4
- package/dist/types/commands/index.d.ts +0 -1
- package/dist/types/plugins/alignment/commands/index.d.ts +0 -4
- package/dist/types/plugins/alignment/index.d.ts +0 -5
- package/dist/types/plugins/alignment/pm-plugins/keymap.d.ts +0 -2
- package/dist/types/plugins/alignment/pm-plugins/main.d.ts +0 -8
- package/dist/types/plugins/alignment/pm-plugins/types.d.ts +0 -5
- package/dist/types/plugins/alignment/ui/ToolbarAlignment/icon-map.d.ts +0 -6
- package/dist/types/plugins/alignment/ui/ToolbarAlignment/index.d.ts +0 -33
- package/dist/types/plugins/alignment/ui/ToolbarAlignment/messages.d.ts +0 -22
- package/dist/types/plugins/alignment/ui/ToolbarAlignment/styles.d.ts +0 -3
- package/dist/types/plugins/alignment/utils/index.d.ts +0 -3
- package/dist/types/plugins/mobile-dimensions/actions.d.ts +0 -18
- package/dist/types/plugins/mobile-dimensions/commands.d.ts +0 -3
- package/dist/types/plugins/mobile-dimensions/index.d.ts +0 -7
- package/dist/types/plugins/mobile-dimensions/plugin-factory.d.ts +0 -5
- package/dist/types/plugins/mobile-dimensions/reducer.d.ts +0 -3
- package/dist/types/plugins/mobile-dimensions/types.d.ts +0 -8
- package/dist/types/plugins/mobile-selection/content-in-selection.d.ts +0 -5
- package/dist/types/plugins/mobile-selection/index.d.ts +0 -2
- package/dist/types/plugins/mobile-selection/mobile-selection-plugin.d.ts +0 -7
- package/dist/types/plugins/mobile-selection/types.d.ts +0 -32
- package/dist/types/plugins/view-update-subscription/index.d.ts +0 -19
- package/dist/types/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.d.ts +0 -12
- package/dist/types/ui/Alignment/AlignmentButton/index.d.ts +0 -17
- package/dist/types/ui/Alignment/index.d.ts +0 -12
- package/dist/types/ui/Alignment/styles.d.ts +0 -1
- package/dist/types-ts4.5/commands/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/alignment/commands/index.d.ts +0 -4
- package/dist/types-ts4.5/plugins/alignment/index.d.ts +0 -5
- package/dist/types-ts4.5/plugins/alignment/pm-plugins/keymap.d.ts +0 -2
- package/dist/types-ts4.5/plugins/alignment/pm-plugins/main.d.ts +0 -8
- package/dist/types-ts4.5/plugins/alignment/pm-plugins/types.d.ts +0 -5
- package/dist/types-ts4.5/plugins/alignment/ui/ToolbarAlignment/icon-map.d.ts +0 -6
- package/dist/types-ts4.5/plugins/alignment/ui/ToolbarAlignment/index.d.ts +0 -33
- package/dist/types-ts4.5/plugins/alignment/ui/ToolbarAlignment/messages.d.ts +0 -22
- package/dist/types-ts4.5/plugins/alignment/ui/ToolbarAlignment/styles.d.ts +0 -3
- package/dist/types-ts4.5/plugins/alignment/utils/index.d.ts +0 -3
- package/dist/types-ts4.5/plugins/mobile-dimensions/actions.d.ts +0 -18
- package/dist/types-ts4.5/plugins/mobile-dimensions/commands.d.ts +0 -3
- package/dist/types-ts4.5/plugins/mobile-dimensions/index.d.ts +0 -7
- package/dist/types-ts4.5/plugins/mobile-dimensions/plugin-factory.d.ts +0 -5
- package/dist/types-ts4.5/plugins/mobile-dimensions/reducer.d.ts +0 -3
- package/dist/types-ts4.5/plugins/mobile-dimensions/types.d.ts +0 -8
- package/dist/types-ts4.5/plugins/mobile-selection/content-in-selection.d.ts +0 -5
- package/dist/types-ts4.5/plugins/mobile-selection/index.d.ts +0 -2
- package/dist/types-ts4.5/plugins/mobile-selection/mobile-selection-plugin.d.ts +0 -7
- package/dist/types-ts4.5/plugins/mobile-selection/types.d.ts +0 -32
- package/dist/types-ts4.5/plugins/view-update-subscription/index.d.ts +0 -19
- package/dist/types-ts4.5/plugins/view-update-subscription/subscribe/toolbarAndPickerUpdates.d.ts +0 -12
- package/dist/types-ts4.5/ui/Alignment/AlignmentButton/index.d.ts +0 -17
- package/dist/types-ts4.5/ui/Alignment/index.d.ts +0 -12
- package/dist/types-ts4.5/ui/Alignment/styles.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
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
|
+
|
|
10
|
+
## 190.1.7
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#62176](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/62176) [`60bdfaccaa8c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/60bdfaccaa8c) - Move all mobile-only Editor plugins to editor-mobile-bridge package
|
|
15
|
+
|
|
3
16
|
## 190.1.6
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -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() {
|
|
@@ -76,18 +70,6 @@ Object.defineProperty(exports, "jiraIssuePlugin", {
|
|
|
76
70
|
return _jiraIssue.default;
|
|
77
71
|
}
|
|
78
72
|
});
|
|
79
|
-
Object.defineProperty(exports, "mobileDimensionsPlugin", {
|
|
80
|
-
enumerable: true,
|
|
81
|
-
get: function get() {
|
|
82
|
-
return _mobileDimensions.default;
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
Object.defineProperty(exports, "mobileSelectionPlugin", {
|
|
86
|
-
enumerable: true,
|
|
87
|
-
get: function get() {
|
|
88
|
-
return _mobileSelection.default;
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
73
|
Object.defineProperty(exports, "pastePlugin", {
|
|
92
74
|
enumerable: true,
|
|
93
75
|
get: function get() {
|
|
@@ -100,26 +82,16 @@ Object.defineProperty(exports, "undoRedoPlugin", {
|
|
|
100
82
|
return _undoRedo.default;
|
|
101
83
|
}
|
|
102
84
|
});
|
|
103
|
-
Object.defineProperty(exports, "viewUpdateSubscriptionPlugin", {
|
|
104
|
-
enumerable: true,
|
|
105
|
-
get: function get() {
|
|
106
|
-
return _viewUpdateSubscription.default;
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
85
|
var _collabEdit = _interopRequireDefault(require("./collab-edit"));
|
|
110
86
|
var _extension = _interopRequireDefault(require("./extension"));
|
|
111
87
|
var _jiraIssue = _interopRequireDefault(require("./jira-issue"));
|
|
112
88
|
var _paste = _interopRequireDefault(require("./paste"));
|
|
113
89
|
var _breakout = _interopRequireDefault(require("./breakout"));
|
|
114
|
-
var _alignment = _interopRequireDefault(require("./alignment"));
|
|
115
90
|
var _dataConsumer = _interopRequireDefault(require("./data-consumer"));
|
|
116
91
|
var _annotation = _interopRequireDefault(require("./annotation"));
|
|
117
92
|
var _customAutoformat = _interopRequireDefault(require("./custom-autoformat"));
|
|
118
93
|
var _feedbackDialog = _interopRequireDefault(require("./feedback-dialog"));
|
|
119
|
-
var _mobileDimensions = _interopRequireDefault(require("./mobile-dimensions"));
|
|
120
94
|
var _findReplace = _interopRequireDefault(require("./find-replace"));
|
|
121
|
-
var _mobileSelection = _interopRequireDefault(require("./mobile-selection"));
|
|
122
95
|
var _undoRedo = _interopRequireDefault(require("./undo-redo"));
|
|
123
96
|
var _avatarGroup = _interopRequireDefault(require("./avatar-group"));
|
|
124
|
-
var _viewUpdateSubscription = _interopRequireDefault(require("./view-update-subscription"));
|
|
125
97
|
var _beforePrimaryToolbar = _interopRequireDefault(require("./before-primaryToolbar"));
|
|
@@ -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(
|
|
89
|
+
}).maybeAdd(_editorPluginAlignment.alignmentPlugin, function (plugin, builder) {
|
|
89
90
|
if (props.allowTextAlignment) {
|
|
90
91
|
return builder.add(plugin);
|
|
91
92
|
}
|
|
@@ -348,16 +349,6 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
348
349
|
return builder.add(_editorPluginHistory.historyPlugin);
|
|
349
350
|
}
|
|
350
351
|
return builder;
|
|
351
|
-
}).maybeAdd(_plugins.mobileDimensionsPlugin, function (plugin, builder) {
|
|
352
|
-
if (isMobile) {
|
|
353
|
-
return builder.add(plugin);
|
|
354
|
-
}
|
|
355
|
-
return builder;
|
|
356
|
-
}).maybeAdd(_plugins.mobileSelectionPlugin, function (plugin, builder) {
|
|
357
|
-
if (isMobile) {
|
|
358
|
-
return builder.add(plugin);
|
|
359
|
-
}
|
|
360
|
-
return builder;
|
|
361
352
|
}).add([_editorPluginToolbarListsIndentation.toolbarListsIndentationPlugin, {
|
|
362
353
|
showIndentationButtons: !!props.showIndentationButtons,
|
|
363
354
|
allowHeadingAndParagraphIndentation: !!props.allowIndentation
|
|
@@ -406,11 +397,6 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
406
397
|
return builder.add(plugin);
|
|
407
398
|
}
|
|
408
399
|
return builder;
|
|
409
|
-
}).maybeAdd(_plugins.viewUpdateSubscriptionPlugin, function (plugin, builder) {
|
|
410
|
-
if (featureFlags.enableViewUpdateSubscription) {
|
|
411
|
-
return builder.add(plugin);
|
|
412
|
-
}
|
|
413
|
-
return builder;
|
|
414
400
|
}).maybeAdd(_editorPluginPasteOptionsToolbar.pasteOptionsToolbarPlugin, function (plugin, builder) {
|
|
415
401
|
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.paste-options-toolbar')) {
|
|
416
402
|
return builder.add(plugin);
|
|
@@ -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("
|
|
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"])));
|
|
@@ -18,6 +18,9 @@ var _templateObject;
|
|
|
18
18
|
/** @jsx jsx */
|
|
19
19
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
+
// Only mobile bridge is using this appearance. We have some plans to decouple the appearances from editor-core. So it doesn't make sense to move this plugin to a separated package for now.
|
|
22
|
+
// Copied packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/index.ts
|
|
23
|
+
// Copied from packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/types.ts
|
|
21
24
|
var mobileEditor = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n min-height: 30px;\n width: 100%;\n max-width: inherit;\n box-sizing: border-box;\n word-wrap: break-word;\n\n div > .ProseMirror {\n outline: none;\n white-space: pre-wrap;\n padding: 0;\n margin: 0;\n }\n"])));
|
|
22
25
|
var ContentArea = (0, _ContentStyles.createEditorContentStyle)();
|
|
23
26
|
ContentArea.displayName = 'ContentArea';
|
package/dist/cjs/utils/action.js
CHANGED
|
@@ -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
|
}
|
|
@@ -3,15 +3,11 @@ 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';
|
|
10
9
|
export { default as feedbackDialogPlugin } from './feedback-dialog';
|
|
11
|
-
export { default as mobileDimensionsPlugin } from './mobile-dimensions';
|
|
12
10
|
export { default as findReplacePlugin } from './find-replace';
|
|
13
|
-
export { default as mobileSelectionPlugin } from './mobile-selection';
|
|
14
11
|
export { default as undoRedoPlugin } from './undo-redo';
|
|
15
12
|
export { default as avatarGroupPlugin } from './avatar-group';
|
|
16
|
-
export { default as viewUpdateSubscriptionPlugin } from './view-update-subscription';
|
|
17
13
|
export { default as beforePrimaryToolbarPlugin } from './before-primaryToolbar';
|
|
@@ -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 {
|
|
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';
|
|
@@ -344,16 +345,6 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
344
345
|
return builder.add(historyPlugin);
|
|
345
346
|
}
|
|
346
347
|
return builder;
|
|
347
|
-
}).maybeAdd(mobileDimensionsPlugin, (plugin, builder) => {
|
|
348
|
-
if (isMobile) {
|
|
349
|
-
return builder.add(plugin);
|
|
350
|
-
}
|
|
351
|
-
return builder;
|
|
352
|
-
}).maybeAdd(mobileSelectionPlugin, (plugin, builder) => {
|
|
353
|
-
if (isMobile) {
|
|
354
|
-
return builder.add(plugin);
|
|
355
|
-
}
|
|
356
|
-
return builder;
|
|
357
348
|
}).add([toolbarListsIndentationPlugin, {
|
|
358
349
|
showIndentationButtons: !!props.showIndentationButtons,
|
|
359
350
|
allowHeadingAndParagraphIndentation: !!props.allowIndentation
|
|
@@ -402,11 +393,6 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
402
393
|
return builder.add(plugin);
|
|
403
394
|
}
|
|
404
395
|
return builder;
|
|
405
|
-
}).maybeAdd(viewUpdateSubscriptionPlugin, (plugin, builder) => {
|
|
406
|
-
if (featureFlags.enableViewUpdateSubscription) {
|
|
407
|
-
return builder.add(plugin);
|
|
408
|
-
}
|
|
409
|
-
return builder;
|
|
410
396
|
}).maybeAdd(pasteOptionsToolbarPlugin, (plugin, builder) => {
|
|
411
397
|
if (getBooleanFF('platform.editor.paste-options-toolbar')) {
|
|
412
398
|
return builder.add(plugin);
|
|
@@ -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 '
|
|
4
|
+
import { createParagraphAtEnd } from '@atlaskit/editor-common/commands';
|
|
5
5
|
const clickArea = css`
|
|
6
6
|
flex-grow: 1;
|
|
7
7
|
`;
|
|
@@ -6,6 +6,10 @@ import { createEditorContentStyle } from '../ContentStyles';
|
|
|
6
6
|
import { ClickAreaMobile as ClickArea } from '../Addon';
|
|
7
7
|
import { usePresetContext } from '../../presets/context';
|
|
8
8
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
9
|
+
|
|
10
|
+
// Only mobile bridge is using this appearance. We have some plans to decouple the appearances from editor-core. So it doesn't make sense to move this plugin to a separated package for now.
|
|
11
|
+
// Copied packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/index.ts
|
|
12
|
+
// Copied from packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/types.ts
|
|
9
13
|
const mobileEditor = css`
|
|
10
14
|
min-height: 30px;
|
|
11
15
|
width: 100%;
|
|
@@ -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.
|
|
2
|
+
export const version = "190.1.8";
|
|
@@ -3,15 +3,11 @@ 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';
|
|
10
9
|
export { default as feedbackDialogPlugin } from './feedback-dialog';
|
|
11
|
-
export { default as mobileDimensionsPlugin } from './mobile-dimensions';
|
|
12
10
|
export { default as findReplacePlugin } from './find-replace';
|
|
13
|
-
export { default as mobileSelectionPlugin } from './mobile-selection';
|
|
14
11
|
export { default as undoRedoPlugin } from './undo-redo';
|
|
15
12
|
export { default as avatarGroupPlugin } from './avatar-group';
|
|
16
|
-
export { default as viewUpdateSubscriptionPlugin } from './view-update-subscription';
|
|
17
13
|
export { default as beforePrimaryToolbarPlugin } from './before-primaryToolbar';
|
|
@@ -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 {
|
|
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';
|
|
@@ -340,16 +341,6 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
340
341
|
return builder.add(historyPlugin);
|
|
341
342
|
}
|
|
342
343
|
return builder;
|
|
343
|
-
}).maybeAdd(mobileDimensionsPlugin, function (plugin, builder) {
|
|
344
|
-
if (isMobile) {
|
|
345
|
-
return builder.add(plugin);
|
|
346
|
-
}
|
|
347
|
-
return builder;
|
|
348
|
-
}).maybeAdd(mobileSelectionPlugin, function (plugin, builder) {
|
|
349
|
-
if (isMobile) {
|
|
350
|
-
return builder.add(plugin);
|
|
351
|
-
}
|
|
352
|
-
return builder;
|
|
353
344
|
}).add([toolbarListsIndentationPlugin, {
|
|
354
345
|
showIndentationButtons: !!props.showIndentationButtons,
|
|
355
346
|
allowHeadingAndParagraphIndentation: !!props.allowIndentation
|
|
@@ -398,11 +389,6 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
398
389
|
return builder.add(plugin);
|
|
399
390
|
}
|
|
400
391
|
return builder;
|
|
401
|
-
}).maybeAdd(viewUpdateSubscriptionPlugin, function (plugin, builder) {
|
|
402
|
-
if (featureFlags.enableViewUpdateSubscription) {
|
|
403
|
-
return builder.add(plugin);
|
|
404
|
-
}
|
|
405
|
-
return builder;
|
|
406
392
|
}).maybeAdd(pasteOptionsToolbarPlugin, function (plugin, builder) {
|
|
407
393
|
if (getBooleanFF('platform.editor.paste-options-toolbar')) {
|
|
408
394
|
return builder.add(plugin);
|
|
@@ -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 '
|
|
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,
|
|
@@ -8,6 +8,10 @@ import { createEditorContentStyle } from '../ContentStyles';
|
|
|
8
8
|
import { ClickAreaMobile as ClickArea } from '../Addon';
|
|
9
9
|
import { usePresetContext } from '../../presets/context';
|
|
10
10
|
import { useSharedPluginState } from '@atlaskit/editor-common/hooks';
|
|
11
|
+
|
|
12
|
+
// Only mobile bridge is using this appearance. We have some plans to decouple the appearances from editor-core. So it doesn't make sense to move this plugin to a separated package for now.
|
|
13
|
+
// Copied packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/index.ts
|
|
14
|
+
// Copied from packages/editor/editor-mobile-bridge/src/editor/editor-plugins/mobile-dimensions/types.ts
|
|
11
15
|
var mobileEditor = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n min-height: 30px;\n width: 100%;\n max-width: inherit;\n box-sizing: border-box;\n word-wrap: break-word;\n\n div > .ProseMirror {\n outline: none;\n white-space: pre-wrap;\n padding: 0;\n margin: 0;\n }\n"])));
|
|
12
16
|
var ContentArea = createEditorContentStyle();
|
|
13
17
|
ContentArea.displayName = 'ContentArea';
|
package/dist/esm/utils/action.js
CHANGED
|
@@ -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.
|
|
2
|
+
export var version = "190.1.8";
|
|
@@ -3,15 +3,11 @@ 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';
|
|
10
9
|
export { default as feedbackDialogPlugin } from './feedback-dialog';
|
|
11
|
-
export { default as mobileDimensionsPlugin } from './mobile-dimensions';
|
|
12
10
|
export { default as findReplacePlugin } from './find-replace';
|
|
13
|
-
export { default as mobileSelectionPlugin } from './mobile-selection';
|
|
14
11
|
export { default as undoRedoPlugin } from './undo-redo';
|
|
15
12
|
export { default as avatarGroupPlugin } from './avatar-group';
|
|
16
|
-
export { default as viewUpdateSubscriptionPlugin } from './view-update-subscription';
|
|
17
13
|
export { default as beforePrimaryToolbarPlugin } from './before-primaryToolbar';
|
|
@@ -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,15 +3,11 @@ 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';
|
|
10
9
|
export { default as feedbackDialogPlugin } from './feedback-dialog';
|
|
11
|
-
export { default as mobileDimensionsPlugin } from './mobile-dimensions';
|
|
12
10
|
export { default as findReplacePlugin } from './find-replace';
|
|
13
|
-
export { default as mobileSelectionPlugin } from './mobile-selection';
|
|
14
11
|
export { default as undoRedoPlugin } from './undo-redo';
|
|
15
12
|
export { default as avatarGroupPlugin } from './avatar-group';
|
|
16
|
-
export { default as viewUpdateSubscriptionPlugin } from './view-update-subscription';
|
|
17
13
|
export { default as beforePrimaryToolbarPlugin } from './before-primaryToolbar';
|
|
@@ -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.
|
|
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
|
-
};
|