@atlaskit/editor-core 190.1.7 → 190.1.9
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 +15 -0
- package/afm-cc/tsconfig.json +6 -0
- package/dist/cjs/plugins/index.js +0 -14
- package/dist/cjs/presets/universal.js +4 -2
- package/dist/cjs/ui/Addon/ClickAreaInline/index.js +1 -1
- package/dist/cjs/ui/ContentStyles/index.js +1 -1
- package/dist/cjs/utils/action.js +0 -28
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/index.js +0 -2
- package/dist/es2019/presets/universal.js +4 -2
- package/dist/es2019/ui/Addon/ClickAreaInline/index.js +1 -1
- package/dist/es2019/ui/ContentStyles/index.js +1 -1
- package/dist/es2019/utils/action.js +0 -28
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/index.js +0 -2
- package/dist/esm/presets/universal.js +4 -2
- package/dist/esm/ui/Addon/ClickAreaInline/index.js +1 -1
- package/dist/esm/ui/ContentStyles/index.js +1 -1
- package/dist/esm/utils/action.js +0 -28
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/index.d.ts +0 -2
- package/dist/types/utils/action.d.ts +0 -6
- package/dist/types-ts4.5/plugins/index.d.ts +0 -2
- package/dist/types-ts4.5/utils/action.d.ts +0 -6
- package/package.json +4 -2
- package/tsconfig.json +1 -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/data-consumer/index.js +0 -19
- 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/data-consumer/index.js +0 -11
- 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/data-consumer/index.js +0 -13
- 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/data-consumer/index.d.ts +0 -3
- 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/data-consumer/index.d.ts +0 -3
- 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,20 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 190.1.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#62301](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/62301) [`080bf1137dda`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/080bf1137dda) - Extract data consumer plugin from editor-core to new package @atlaskit/editor-plugin-data-consumer
|
|
8
|
+
- [#61923](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/61923) [`04e38cfe9e90`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/04e38cfe9e90) - Remove legacy theming logic from all Editor plugin packages. Theming is still available via the @atlaskit/tokens package.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 190.1.8
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#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
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 190.1.7
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -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
|
},
|
|
@@ -103,6 +106,9 @@
|
|
|
103
106
|
{
|
|
104
107
|
"path": "../../editor-plugin-copy-button/afm-cc/tsconfig.json"
|
|
105
108
|
},
|
|
109
|
+
{
|
|
110
|
+
"path": "../../editor-plugin-data-consumer/afm-cc/tsconfig.json"
|
|
111
|
+
},
|
|
106
112
|
{
|
|
107
113
|
"path": "../../editor-plugin-date/afm-cc/tsconfig.json"
|
|
108
114
|
},
|
|
@@ -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() {
|
|
@@ -46,12 +40,6 @@ Object.defineProperty(exports, "customAutoformatPlugin", {
|
|
|
46
40
|
return _customAutoformat.default;
|
|
47
41
|
}
|
|
48
42
|
});
|
|
49
|
-
Object.defineProperty(exports, "dataConsumerMarkPlugin", {
|
|
50
|
-
enumerable: true,
|
|
51
|
-
get: function get() {
|
|
52
|
-
return _dataConsumer.default;
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
43
|
Object.defineProperty(exports, "extensionPlugin", {
|
|
56
44
|
enumerable: true,
|
|
57
45
|
get: function get() {
|
|
@@ -93,8 +81,6 @@ var _extension = _interopRequireDefault(require("./extension"));
|
|
|
93
81
|
var _jiraIssue = _interopRequireDefault(require("./jira-issue"));
|
|
94
82
|
var _paste = _interopRequireDefault(require("./paste"));
|
|
95
83
|
var _breakout = _interopRequireDefault(require("./breakout"));
|
|
96
|
-
var _alignment = _interopRequireDefault(require("./alignment"));
|
|
97
|
-
var _dataConsumer = _interopRequireDefault(require("./data-consumer"));
|
|
98
84
|
var _annotation = _interopRequireDefault(require("./annotation"));
|
|
99
85
|
var _customAutoformat = _interopRequireDefault(require("./custom-autoformat"));
|
|
100
86
|
var _feedbackDialog = _interopRequireDefault(require("./feedback-dialog"));
|
|
@@ -42,6 +42,8 @@ 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");
|
|
46
|
+
var _editorPluginDataConsumer = require("@atlaskit/editor-plugin-data-consumer");
|
|
45
47
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
46
48
|
var _plugins = require("../plugins");
|
|
47
49
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
@@ -78,14 +80,14 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
78
80
|
}
|
|
79
81
|
return false;
|
|
80
82
|
};
|
|
81
|
-
var finalPreset = defaultPreset.add(
|
|
83
|
+
var finalPreset = defaultPreset.add(_editorPluginDataConsumer.dataConsumerPlugin).add(_editorPluginContentInsertion.contentInsertionPlugin).maybeAdd(_plugins.breakoutPlugin, function (plugin, builder) {
|
|
82
84
|
if (props.allowBreakout && isFullPage) {
|
|
83
85
|
return builder.add([plugin, {
|
|
84
86
|
allowBreakoutButton: appearance === 'full-page'
|
|
85
87
|
}]);
|
|
86
88
|
}
|
|
87
89
|
return builder;
|
|
88
|
-
}).maybeAdd(
|
|
90
|
+
}).maybeAdd(_editorPluginAlignment.alignmentPlugin, function (plugin, builder) {
|
|
89
91
|
if (props.allowTextAlignment) {
|
|
90
92
|
return builder.add(plugin);
|
|
91
93
|
}
|
|
@@ -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"])));
|
|
@@ -47,7 +47,7 @@ var placeholderStyles = exports.placeholderStyles = (0, _react2.css)(_templateOb
|
|
|
47
47
|
var contentStyles = function contentStyles(props) {
|
|
48
48
|
return (0, _react2.css)(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid ", ";\n }\n\n ", "\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap :not(.fabric-editor-alignment),\n .pm-table-header-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark,\n .pm-table-cell-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark {\n p:first-of-type {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), (0, _editorSharedStyles.editorFontSize)({
|
|
49
49
|
theme: props.theme
|
|
50
|
-
}), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles5.placeholderTextStyles, placeholderStyles, (0, _codeBlock.codeBlockStyles)(props), (0, _styles3.blocktypeStyles)(
|
|
50
|
+
}), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles5.placeholderTextStyles, placeholderStyles, (0, _codeBlock.codeBlockStyles)(props), (0, _styles3.blocktypeStyles)(), (0, _styles.codeMarkSharedStyles)(props), _styles.textColorStyles, listsStyles, ruleStyles(props), _media.mediaStyles, (0, _layout.layoutStyles)(props), _styles2.telepointerStyle, _selection.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _panel.panelStyles)(props), mentionsStyles, emojiStyles, _styles.tasksAndDecisionsStyles, _styles.gridStyles, linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _extension.extensionStyles, (0, _expand.expandStyles)(props), _styles6.findReplaceStyles, _styles4.textHighlightStyle, _tasksAndDecisions.taskDecisionStyles, _status.statusStyles, (0, _styles.annotationSharedStyles)(props), _styles.smartCardStyles, _styles.smartCardSharedStyles, _date.dateStyles, _styles.embedCardStyles, _styles.unsupportedStyles, _styles.resizerStyles, _styles.MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
51
51
|
};
|
|
52
52
|
var createEditorContentStyle = exports.createEditorContentStyle = function createEditorContentStyle(styles) {
|
|
53
53
|
return /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
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,8 +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
|
-
export { default as dataConsumerMarkPlugin } from './data-consumer';
|
|
8
6
|
export { default as annotationPlugin } from './annotation';
|
|
9
7
|
export { default as customAutoformatPlugin } from './custom-autoformat';
|
|
10
8
|
export { default as feedbackDialogPlugin } from './feedback-dialog';
|
|
@@ -32,8 +32,10 @@ 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';
|
|
36
|
+
import { dataConsumerPlugin } from '@atlaskit/editor-plugin-data-consumer';
|
|
35
37
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
36
|
-
import {
|
|
38
|
+
import { annotationPlugin, avatarGroupPlugin, beforePrimaryToolbarPlugin, breakoutPlugin, collabEditPlugin, customAutoformatPlugin, extensionPlugin, feedbackDialogPlugin, findReplacePlugin, jiraIssuePlugin } from '../plugins';
|
|
37
39
|
import { shouldForceTracking } from '@atlaskit/editor-common/utils';
|
|
38
40
|
import { isFullPage as fullPageCheck } from '../utils/is-full-page';
|
|
39
41
|
import { createDefaultPreset } from './default';
|
|
@@ -65,7 +67,7 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
65
67
|
}
|
|
66
68
|
return false;
|
|
67
69
|
};
|
|
68
|
-
const finalPreset = defaultPreset.add(
|
|
70
|
+
const finalPreset = defaultPreset.add(dataConsumerPlugin).add(contentInsertionPlugin).maybeAdd(breakoutPlugin, (plugin, builder) => {
|
|
69
71
|
if (props.allowBreakout && isFullPage) {
|
|
70
72
|
return builder.add([plugin, {
|
|
71
73
|
allowBreakoutButton: appearance === 'full-page'
|
|
@@ -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
|
`;
|
|
@@ -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.9";
|
|
@@ -3,8 +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
|
-
export { default as dataConsumerMarkPlugin } from './data-consumer';
|
|
8
6
|
export { default as annotationPlugin } from './annotation';
|
|
9
7
|
export { default as customAutoformatPlugin } from './custom-autoformat';
|
|
10
8
|
export { default as feedbackDialogPlugin } from './feedback-dialog';
|
|
@@ -36,8 +36,10 @@ 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';
|
|
40
|
+
import { dataConsumerPlugin } from '@atlaskit/editor-plugin-data-consumer';
|
|
39
41
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
40
|
-
import {
|
|
42
|
+
import { annotationPlugin, avatarGroupPlugin, beforePrimaryToolbarPlugin, breakoutPlugin, collabEditPlugin, customAutoformatPlugin, extensionPlugin, feedbackDialogPlugin, findReplacePlugin, jiraIssuePlugin } from '../plugins';
|
|
41
43
|
import { shouldForceTracking } from '@atlaskit/editor-common/utils';
|
|
42
44
|
import { isFullPage as fullPageCheck } from '../utils/is-full-page';
|
|
43
45
|
import { createDefaultPreset } from './default';
|
|
@@ -70,7 +72,7 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
70
72
|
}
|
|
71
73
|
return false;
|
|
72
74
|
};
|
|
73
|
-
var finalPreset = defaultPreset.add(
|
|
75
|
+
var finalPreset = defaultPreset.add(dataConsumerPlugin).add(contentInsertionPlugin).maybeAdd(breakoutPlugin, function (plugin, builder) {
|
|
74
76
|
if (props.allowBreakout && isFullPage) {
|
|
75
77
|
return builder.add([plugin, {
|
|
76
78
|
allowBreakoutButton: appearance === 'full-page'
|
|
@@ -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,
|
|
@@ -39,7 +39,7 @@ export var placeholderStyles = css(_templateObject6 || (_templateObject6 = _tagg
|
|
|
39
39
|
var contentStyles = function contentStyles(props) {
|
|
40
40
|
return css(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n .ProseMirror {\n outline: none;\n font-size: ", "px;\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n ", ";\n }\n\n .ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n pointer-events: none;\n opacity: 0.7;\n }\n\n .ProseMirror-hideselection *::selection {\n background: transparent;\n }\n\n .ProseMirror-hideselection *::-moz-selection {\n background: transparent;\n }\n\n .ProseMirror-selectednode {\n outline: none;\n }\n\n .ProseMirror-selectednode:empty {\n outline: 2px solid ", ";\n }\n\n ", "\n ", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n box-sizing: border-box;\n }\n\n .mediaGroupView-content-wrap ul {\n padding: 0;\n }\n\n /** Needed to override any cleared floats, e.g. image wrapping */\n\n div.fabric-editor-block-mark[class^='fabric-editor-align'] {\n clear: none !important;\n }\n\n .fabric-editor-align-end {\n text-align: right;\n }\n\n .fabric-editor-align-start {\n text-align: left;\n }\n\n .fabric-editor-align-center {\n text-align: center;\n }\n\n .pm-table-header-content-wrap :not(.fabric-editor-alignment),\n .pm-table-header-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark,\n .pm-table-cell-content-wrap\n :not(p, .fabric-editor-block-mark)\n + div.fabric-editor-block-mark {\n p:first-of-type {\n margin-top: 0;\n }\n }\n\n .hyperlink-floating-toolbar,\n .", " {\n padding: 0;\n }\n\n /* Link icon in the Atlaskit package\n is bigger than the others\n */\n .hyperlink-open-link {\n svg {\n max-width: 18px;\n }\n &[href] {\n padding: 0 4px;\n }\n }\n"])), editorFontSize({
|
|
41
41
|
theme: props.theme
|
|
42
|
-
}), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", placeholderTextStyles, placeholderStyles, codeBlockStyles(props), blocktypeStyles(
|
|
42
|
+
}), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", placeholderTextStyles, placeholderStyles, codeBlockStyles(props), blocktypeStyles(), codeMarkSharedStyles(props), textColorStyles, listsStyles, ruleStyles(props), mediaStyles, layoutStyles(props), telepointerStyle, gapCursorStyles, tableStyles(props), panelStyles(props), mentionsStyles, emojiStyles, tasksAndDecisionsStyles, gridStyles, linkStyles, blockMarksSharedStyles, dateSharedStyle, extensionStyles, expandStyles(props), findReplaceStyles, textHighlightStyle, taskDecisionStyles, statusStyles, annotationSharedStyles(props), smartCardStyles, smartCardSharedStyles, dateStyles, embedCardStyles, unsupportedStyles, resizerStyles, MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
43
43
|
};
|
|
44
44
|
export var createEditorContentStyle = function createEditorContentStyle(styles) {
|
|
45
45
|
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
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.9";
|
|
@@ -3,8 +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
|
-
export { default as dataConsumerMarkPlugin } from './data-consumer';
|
|
8
6
|
export { default as annotationPlugin } from './annotation';
|
|
9
7
|
export { default as customAutoformatPlugin } from './custom-autoformat';
|
|
10
8
|
export { default as feedbackDialogPlugin } from './feedback-dialog';
|
|
@@ -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,8 +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
|
-
export { default as dataConsumerMarkPlugin } from './data-consumer';
|
|
8
6
|
export { default as annotationPlugin } from './annotation';
|
|
9
7
|
export { default as customAutoformatPlugin } from './custom-autoformat';
|
|
10
8
|
export { default as feedbackDialogPlugin } from './feedback-dialog';
|
|
@@ -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.9",
|
|
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",
|
|
@@ -69,6 +70,7 @@
|
|
|
69
70
|
"@atlaskit/editor-plugin-content-insertion": "^0.1.4",
|
|
70
71
|
"@atlaskit/editor-plugin-context-panel": "^0.2.0",
|
|
71
72
|
"@atlaskit/editor-plugin-copy-button": "^1.0.0",
|
|
73
|
+
"@atlaskit/editor-plugin-data-consumer": "^0.1.0",
|
|
72
74
|
"@atlaskit/editor-plugin-date": "^0.2.0",
|
|
73
75
|
"@atlaskit/editor-plugin-decorations": "^0.2.0",
|
|
74
76
|
"@atlaskit/editor-plugin-editor-disabled": "^0.2.0",
|
|
@@ -141,7 +143,7 @@
|
|
|
141
143
|
"@atlaskit/theme": "^12.6.0",
|
|
142
144
|
"@atlaskit/toggle": "^13.0.0",
|
|
143
145
|
"@atlaskit/tokens": "^1.30.0",
|
|
144
|
-
"@atlaskit/tooltip": "^18.
|
|
146
|
+
"@atlaskit/tooltip": "^18.1.0",
|
|
145
147
|
"@atlaskit/ufo": "^0.2.0",
|
|
146
148
|
"@atlaskit/width-detector": "^4.1.0",
|
|
147
149
|
"@babel/runtime": "^7.0.0",
|
package/tsconfig.json
CHANGED
|
@@ -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;
|