@atlaskit/editor-core 188.13.6 → 189.0.1
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 +17 -0
- package/dist/cjs/labs/next/presets/default.js +2 -2
- package/dist/cjs/labs/next/presets/universal.js +6 -0
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/ui/Addon/click-area-helper.js +1 -0
- package/dist/cjs/ui/ContentStyles/index.js +12 -11
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/labs/next/presets/default.js +1 -1
- package/dist/es2019/labs/next/presets/universal.js +6 -0
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/ui/Addon/click-area-helper.js +1 -0
- package/dist/es2019/ui/ContentStyles/index.js +2 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/labs/next/presets/default.js +1 -1
- package/dist/esm/labs/next/presets/universal.js +6 -0
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/ui/Addon/click-area-helper.js +1 -0
- package/dist/esm/ui/ContentStyles/index.js +3 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/labs/next/presets/default.d.ts +4 -4
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/labs/next/presets/default.d.ts +4 -4
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/package.json +9 -4
- package/dist/cjs/plugins/submit-editor/index.js +0 -64
- package/dist/es2019/plugins/submit-editor/index.js +0 -53
- package/dist/esm/plugins/submit-editor/index.js +0 -56
- package/dist/types/plugins/submit-editor/index.d.ts +0 -14
- package/dist/types-ts4.5/plugins/submit-editor/index.d.ts +0 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 189.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#39920](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39920) [`c08ab6beb65`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c08ab6beb65) - [ux] Adding new plugin for paste options toolbar. Also making required changes for the new toolbar in folating-toolbar plugin and paste plugin.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 189.0.0
|
|
11
|
+
|
|
12
|
+
### Major Changes
|
|
13
|
+
|
|
14
|
+
- [#42052](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42052) [`12b16804202`](https://bitbucket.org/atlassian/atlassian-frontend/commits/12b16804202) - Decoupled submit-editor plugin, used to allow mod+Enter keyboard shortcut to trigger saving the editor content, from editor-core
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 188.13.6
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -18,7 +18,7 @@ var _editorPluginBase = require("@atlaskit/editor-plugin-base");
|
|
|
18
18
|
var _editorPluginFocus = require("@atlaskit/editor-plugin-focus");
|
|
19
19
|
var _editorPluginEditorDisabled = require("@atlaskit/editor-plugin-editor-disabled");
|
|
20
20
|
var _editorPluginTypeAhead = require("@atlaskit/editor-plugin-type-ahead");
|
|
21
|
-
var
|
|
21
|
+
var _editorPluginSubmitEditor = require("@atlaskit/editor-plugin-submit-editor");
|
|
22
22
|
var _fakeTextCursor = _interopRequireDefault(require("../../../plugins/fake-text-cursor"));
|
|
23
23
|
var _editorPluginFeatureFlags = require("@atlaskit/editor-plugin-feature-flags");
|
|
24
24
|
var _editorPluginCopyButton = require("@atlaskit/editor-plugin-copy-button");
|
|
@@ -78,7 +78,7 @@ function createDefaultPreset(options) {
|
|
|
78
78
|
return builder;
|
|
79
79
|
}).add([_editorPluginHyperlink.hyperlinkPlugin, options.hyperlinkOptions]).add([_editorPluginTextFormatting.textFormattingPlugin, options.textFormatting]).add(_editorPluginWidth.widthPlugin).add([_editorPluginQuickInsert.quickInsertPlugin, options.quickInsert]).add([_editorPluginTypeAhead.typeAheadPlugin, options.typeAhead || {
|
|
80
80
|
createAnalyticsEvent: options.createAnalyticsEvent
|
|
81
|
-
}]).add([_editorPluginPlaceholder.placeholderPlugin, options.placeholder]).add(_editorPluginUnsupportedContent.unsupportedContentPlugin).add(_editorPluginEditorDisabled.editorDisabledPlugin).add([
|
|
81
|
+
}]).add([_editorPluginPlaceholder.placeholderPlugin, options.placeholder]).add(_editorPluginUnsupportedContent.unsupportedContentPlugin).add(_editorPluginEditorDisabled.editorDisabledPlugin).add([_editorPluginSubmitEditor.submitEditorPlugin, options.submitEditor]).add(_fakeTextCursor.default).add(_editorPluginCopyButton.copyButtonPlugin).add(_editorPluginFloatingToolbar.floatingToolbarPlugin).add([_editorPluginSelection.selectionPlugin, options.selection]).add([_codeBlock.default, options.codeBlock || {
|
|
82
82
|
appearance: 'full-page'
|
|
83
83
|
}]);
|
|
84
84
|
return preset;
|
|
@@ -17,6 +17,7 @@ var _editorPluginHelpDialog = require("@atlaskit/editor-plugin-help-dialog");
|
|
|
17
17
|
var _editorPluginMedia = require("@atlaskit/editor-plugin-media");
|
|
18
18
|
var _editorPluginRule = require("@atlaskit/editor-plugin-rule");
|
|
19
19
|
var _editorPluginEmoji = require("@atlaskit/editor-plugin-emoji");
|
|
20
|
+
var _editorPluginPasteOptionsToolbar = require("@atlaskit/editor-plugin-paste-options-toolbar");
|
|
20
21
|
var _editorPluginList = require("@atlaskit/editor-plugin-list");
|
|
21
22
|
var _editorPluginImageUpload = require("@atlaskit/editor-plugin-image-upload");
|
|
22
23
|
var _editorPluginGuideline = require("@atlaskit/editor-plugin-guideline");
|
|
@@ -400,6 +401,11 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
400
401
|
return builder.add(plugin);
|
|
401
402
|
}
|
|
402
403
|
return builder;
|
|
404
|
+
}).maybeAdd(_editorPluginPasteOptionsToolbar.pasteOptionsToolbarPlugin, function (plugin, builder) {
|
|
405
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.paste-options-toolbar')) {
|
|
406
|
+
return builder.add(plugin);
|
|
407
|
+
}
|
|
408
|
+
return builder;
|
|
403
409
|
}).add([_plugins.codeBidiWarningPlugin, {
|
|
404
410
|
appearance: appearance
|
|
405
411
|
}])
|
|
@@ -185,12 +185,6 @@ Object.defineProperty(exports, "placeholderTextPlugin", {
|
|
|
185
185
|
return _placeholderText.default;
|
|
186
186
|
}
|
|
187
187
|
});
|
|
188
|
-
Object.defineProperty(exports, "submitEditorPlugin", {
|
|
189
|
-
enumerable: true,
|
|
190
|
-
get: function get() {
|
|
191
|
-
return _submitEditor.default;
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
188
|
Object.defineProperty(exports, "tasksAndDecisionsPlugin", {
|
|
195
189
|
enumerable: true,
|
|
196
190
|
get: function get() {
|
|
@@ -235,7 +229,6 @@ var _maxContentSize = _interopRequireDefault(require("./max-content-size"));
|
|
|
235
229
|
var _panel = _interopRequireDefault(require("./panel"));
|
|
236
230
|
var _paste = _interopRequireDefault(require("./paste"));
|
|
237
231
|
var _placeholderText = _interopRequireDefault(require("./placeholder-text"));
|
|
238
|
-
var _submitEditor = _interopRequireDefault(require("./submit-editor"));
|
|
239
232
|
var _tasksAndDecisions = _interopRequireDefault(require("./tasks-and-decisions"));
|
|
240
233
|
var _textColor = _interopRequireDefault(require("./text-color"));
|
|
241
234
|
var _breakout = _interopRequireDefault(require("./breakout"));
|
|
@@ -97,6 +97,7 @@ var outsideProsemirrorEditorClickHandler = function outsideProsemirrorEditorClic
|
|
|
97
97
|
var isEditorFocused = !!(view !== null && view !== void 0 && (_view$hasFocus2 = view.hasFocus) !== null && _view$hasFocus2 !== void 0 && _view$hasFocus2.call(view));
|
|
98
98
|
var isBottomAreaClicked = event.clientY > dom.getBoundingClientRect().bottom;
|
|
99
99
|
if (isBottomAreaClicked) {
|
|
100
|
+
tr.setMeta('outsideProsemirrorEditorClicked', true);
|
|
100
101
|
(0, _commands.addParagraphAtEnd)(tr);
|
|
101
102
|
}
|
|
102
103
|
(0, _selection.setSelectionTopLevelBlocks)(tr, event, dom, view.posAtCoords.bind(view), isEditorFocused);
|
|
@@ -15,16 +15,17 @@ var _mention = require("@atlaskit/editor-common/mention");
|
|
|
15
15
|
var _styles2 = require("../../plugins/collab-edit/styles");
|
|
16
16
|
var _commonStyles = require("@atlaskit/editor-plugin-table/ui/common-styles");
|
|
17
17
|
var _styles3 = require("@atlaskit/editor-plugin-block-type/styles");
|
|
18
|
-
var _styles4 = require("
|
|
18
|
+
var _styles4 = require("@atlaskit/editor-plugin-paste-options-toolbar/styles");
|
|
19
|
+
var _styles5 = require("../../plugins/code-block/styles");
|
|
19
20
|
var _media = require("./media");
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var
|
|
21
|
+
var _styles6 = require("../../plugins/layout/styles");
|
|
22
|
+
var _styles7 = require("../../plugins/panel/styles");
|
|
23
|
+
var _styles8 = require("../../plugins/fake-text-cursor/styles");
|
|
24
|
+
var _styles9 = require("../../plugins/placeholder-text/styles");
|
|
25
|
+
var _styles10 = require("../../plugins/extension/ui/styles");
|
|
26
|
+
var _styles11 = require("../../plugins/expand/ui/styles");
|
|
27
|
+
var _styles12 = require("../../plugins/find-replace/styles");
|
|
28
|
+
var _styles13 = require("../../plugins/tasks-and-decisions/styles");
|
|
28
29
|
var _status = require("./status");
|
|
29
30
|
var _date = require("./date");
|
|
30
31
|
var _getInlineNodeViewProducer = require("../../nodeviews/getInlineNodeViewProducer.styles");
|
|
@@ -45,9 +46,9 @@ var listsStyles = (0, _react2.css)(_templateObject4 || (_templateObject4 = (0, _
|
|
|
45
46
|
var emojiStyles = (0, _react2.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n .", " {\n display: inline-block;\n\n .", " {\n cursor: pointer;\n\n &.", " > span {\n /** needed for selection style to cover custom emoji image properly */\n display: flex;\n }\n }\n\n &.", " {\n .", ",\n .", " {\n border-radius: 2px;\n ", "\n }\n }\n }\n"])), _emoji.EmojiSharedCssClassName.EMOJI_CONTAINER, _emoji.EmojiSharedCssClassName.EMOJI_NODE, _emoji.EmojiSharedCssClassName.EMOJI_IMAGE, _editorSharedStyles.akEditorSelectedNodeClassName, _emoji.EmojiSharedCssClassName.EMOJI_SPRITE, _emoji.EmojiSharedCssClassName.EMOJI_IMAGE, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Blanket, _editorSharedStyles.SelectionStyle.BoxShadow]));
|
|
46
47
|
var placeholderStyles = exports.placeholderStyles = (0, _react2.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror .placeholder-decoration {\n color: ", ";\n width: 100%;\n pointer-events: none;\n user-select: none;\n\n .placeholder-android {\n pointer-events: none;\n outline: none;\n user-select: none;\n position: absolute;\n }\n }\n"])), "var(--ds-text-subtlest, ".concat(_colors.N200, ")"));
|
|
47
48
|
var contentStyles = function contentStyles(props) {
|
|
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
|
+
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\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
50
|
theme: props.theme
|
|
50
|
-
}), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)",
|
|
51
|
+
}), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles9.placeholderTextStyles, placeholderStyles, (0, _styles5.codeBlockStyles)(props), (0, _styles3.blocktypeStyles)(props), (0, _styles.codeMarkSharedStyles)(props), _styles.textColorStyles, listsStyles, ruleStyles(props), _media.mediaStyles, (0, _styles6.layoutStyles)(props), _styles2.telepointerStyle, _selection.gapCursorStyles, (0, _commonStyles.tableStyles)(props), (0, _styles7.panelStyles)(props), _styles8.fakeCursorStyles, mentionsStyles, emojiStyles, _styles.tasksAndDecisionsStyles, _styles.gridStyles, linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _styles10.extensionStyles, (0, _styles11.expandStyles)(props), _styles12.findReplaceStyles, _styles4.textHighlightStyle, _styles13.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
52
|
};
|
|
52
53
|
var createEditorContentStyle = exports.createEditorContentStyle = function createEditorContentStyle(styles) {
|
|
53
54
|
return /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = exports.name = "@atlaskit/editor-core";
|
|
8
|
-
var version = exports.version = "
|
|
8
|
+
var version = exports.version = "189.0.1";
|
|
9
9
|
var nextMajorVersion = exports.nextMajorVersion = function nextMajorVersion() {
|
|
10
10
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
11
11
|
};
|
|
@@ -12,7 +12,7 @@ import { basePlugin } from '@atlaskit/editor-plugin-base';
|
|
|
12
12
|
import { focusPlugin } from '@atlaskit/editor-plugin-focus';
|
|
13
13
|
import { editorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
14
14
|
import { typeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
|
|
15
|
-
import submitEditorPlugin from '
|
|
15
|
+
import { submitEditorPlugin } from '@atlaskit/editor-plugin-submit-editor';
|
|
16
16
|
import fakeTextCursorPlugin from '../../../plugins/fake-text-cursor';
|
|
17
17
|
import { featureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
18
18
|
import { copyButtonPlugin } from '@atlaskit/editor-plugin-copy-button';
|
|
@@ -8,6 +8,7 @@ import { helpDialogPlugin } from '@atlaskit/editor-plugin-help-dialog';
|
|
|
8
8
|
import { mediaPlugin } from '@atlaskit/editor-plugin-media';
|
|
9
9
|
import { rulePlugin } from '@atlaskit/editor-plugin-rule';
|
|
10
10
|
import { emojiPlugin } from '@atlaskit/editor-plugin-emoji';
|
|
11
|
+
import { pasteOptionsToolbarPlugin } from '@atlaskit/editor-plugin-paste-options-toolbar';
|
|
11
12
|
import { listPlugin } from '@atlaskit/editor-plugin-list';
|
|
12
13
|
import { imageUploadPlugin } from '@atlaskit/editor-plugin-image-upload';
|
|
13
14
|
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
@@ -397,6 +398,11 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
397
398
|
return builder.add(plugin);
|
|
398
399
|
}
|
|
399
400
|
return builder;
|
|
401
|
+
}).maybeAdd(pasteOptionsToolbarPlugin, (plugin, builder) => {
|
|
402
|
+
if (getBooleanFF('platform.editor.paste-options-toolbar')) {
|
|
403
|
+
return builder.add(plugin);
|
|
404
|
+
}
|
|
405
|
+
return builder;
|
|
400
406
|
}).add([codeBidiWarningPlugin, {
|
|
401
407
|
appearance
|
|
402
408
|
}])
|
|
@@ -12,7 +12,6 @@ export { default as maxContentSizePlugin } from './max-content-size';
|
|
|
12
12
|
export { default as panelPlugin } from './panel';
|
|
13
13
|
export { default as pastePlugin } from './paste';
|
|
14
14
|
export { default as placeholderTextPlugin } from './placeholder-text';
|
|
15
|
-
export { default as submitEditorPlugin } from './submit-editor';
|
|
16
15
|
export { default as tasksAndDecisionsPlugin } from './tasks-and-decisions';
|
|
17
16
|
export { default as textColorPlugin } from './text-color';
|
|
18
17
|
export { default as breakoutPlugin } from './breakout';
|
|
@@ -96,6 +96,7 @@ const outsideProsemirrorEditorClickHandler = (view, event) => {
|
|
|
96
96
|
const isEditorFocused = !!(view !== null && view !== void 0 && (_view$hasFocus2 = view.hasFocus) !== null && _view$hasFocus2 !== void 0 && _view$hasFocus2.call(view));
|
|
97
97
|
const isBottomAreaClicked = event.clientY > dom.getBoundingClientRect().bottom;
|
|
98
98
|
if (isBottomAreaClicked) {
|
|
99
|
+
tr.setMeta('outsideProsemirrorEditorClicked', true);
|
|
99
100
|
addParagraphAtEnd(tr);
|
|
100
101
|
}
|
|
101
102
|
setSelectionTopLevelBlocks(tr, event, dom, view.posAtCoords.bind(view), isEditorFocused);
|
|
@@ -7,6 +7,7 @@ import { MentionSharedCssClassName } from '@atlaskit/editor-common/mention';
|
|
|
7
7
|
import { telepointerStyle } from '../../plugins/collab-edit/styles';
|
|
8
8
|
import { tableStyles } from '@atlaskit/editor-plugin-table/ui/common-styles';
|
|
9
9
|
import { blocktypeStyles } from '@atlaskit/editor-plugin-block-type/styles';
|
|
10
|
+
import { textHighlightStyle } from '@atlaskit/editor-plugin-paste-options-toolbar/styles';
|
|
10
11
|
import { codeBlockStyles } from '../../plugins/code-block/styles';
|
|
11
12
|
import { mediaStyles } from './media';
|
|
12
13
|
import { layoutStyles } from '../../plugins/layout/styles';
|
|
@@ -193,6 +194,7 @@ const contentStyles = props => css`
|
|
|
193
194
|
${extensionStyles}
|
|
194
195
|
${expandStyles(props)}
|
|
195
196
|
${findReplaceStyles}
|
|
197
|
+
${textHighlightStyle}
|
|
196
198
|
${taskDecisionStyles}
|
|
197
199
|
${statusStyles}
|
|
198
200
|
${annotationSharedStyles(props)}
|
|
@@ -12,7 +12,7 @@ import { basePlugin } from '@atlaskit/editor-plugin-base';
|
|
|
12
12
|
import { focusPlugin } from '@atlaskit/editor-plugin-focus';
|
|
13
13
|
import { editorDisabledPlugin } from '@atlaskit/editor-plugin-editor-disabled';
|
|
14
14
|
import { typeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
|
|
15
|
-
import submitEditorPlugin from '
|
|
15
|
+
import { submitEditorPlugin } from '@atlaskit/editor-plugin-submit-editor';
|
|
16
16
|
import fakeTextCursorPlugin from '../../../plugins/fake-text-cursor';
|
|
17
17
|
import { featureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
18
18
|
import { copyButtonPlugin } from '@atlaskit/editor-plugin-copy-button';
|
|
@@ -12,6 +12,7 @@ import { helpDialogPlugin } from '@atlaskit/editor-plugin-help-dialog';
|
|
|
12
12
|
import { mediaPlugin } from '@atlaskit/editor-plugin-media';
|
|
13
13
|
import { rulePlugin } from '@atlaskit/editor-plugin-rule';
|
|
14
14
|
import { emojiPlugin } from '@atlaskit/editor-plugin-emoji';
|
|
15
|
+
import { pasteOptionsToolbarPlugin } from '@atlaskit/editor-plugin-paste-options-toolbar';
|
|
15
16
|
import { listPlugin } from '@atlaskit/editor-plugin-list';
|
|
16
17
|
import { imageUploadPlugin } from '@atlaskit/editor-plugin-image-upload';
|
|
17
18
|
import { guidelinePlugin } from '@atlaskit/editor-plugin-guideline';
|
|
@@ -393,6 +394,11 @@ export default function createUniversalPreset(appearance, props, featureFlags, p
|
|
|
393
394
|
return builder.add(plugin);
|
|
394
395
|
}
|
|
395
396
|
return builder;
|
|
397
|
+
}).maybeAdd(pasteOptionsToolbarPlugin, function (plugin, builder) {
|
|
398
|
+
if (getBooleanFF('platform.editor.paste-options-toolbar')) {
|
|
399
|
+
return builder.add(plugin);
|
|
400
|
+
}
|
|
401
|
+
return builder;
|
|
396
402
|
}).add([codeBidiWarningPlugin, {
|
|
397
403
|
appearance: appearance
|
|
398
404
|
}])
|
|
@@ -12,7 +12,6 @@ export { default as maxContentSizePlugin } from './max-content-size';
|
|
|
12
12
|
export { default as panelPlugin } from './panel';
|
|
13
13
|
export { default as pastePlugin } from './paste';
|
|
14
14
|
export { default as placeholderTextPlugin } from './placeholder-text';
|
|
15
|
-
export { default as submitEditorPlugin } from './submit-editor';
|
|
16
15
|
export { default as tasksAndDecisionsPlugin } from './tasks-and-decisions';
|
|
17
16
|
export { default as textColorPlugin } from './text-color';
|
|
18
17
|
export { default as breakoutPlugin } from './breakout';
|
|
@@ -92,6 +92,7 @@ var outsideProsemirrorEditorClickHandler = function outsideProsemirrorEditorClic
|
|
|
92
92
|
var isEditorFocused = !!(view !== null && view !== void 0 && (_view$hasFocus2 = view.hasFocus) !== null && _view$hasFocus2 !== void 0 && _view$hasFocus2.call(view));
|
|
93
93
|
var isBottomAreaClicked = event.clientY > dom.getBoundingClientRect().bottom;
|
|
94
94
|
if (isBottomAreaClicked) {
|
|
95
|
+
tr.setMeta('outsideProsemirrorEditorClicked', true);
|
|
95
96
|
addParagraphAtEnd(tr);
|
|
96
97
|
}
|
|
97
98
|
setSelectionTopLevelBlocks(tr, event, dom, view.posAtCoords.bind(view), isEditorFocused);
|
|
@@ -9,6 +9,7 @@ import { MentionSharedCssClassName } from '@atlaskit/editor-common/mention';
|
|
|
9
9
|
import { telepointerStyle } from '../../plugins/collab-edit/styles';
|
|
10
10
|
import { tableStyles } from '@atlaskit/editor-plugin-table/ui/common-styles';
|
|
11
11
|
import { blocktypeStyles } from '@atlaskit/editor-plugin-block-type/styles';
|
|
12
|
+
import { textHighlightStyle } from '@atlaskit/editor-plugin-paste-options-toolbar/styles';
|
|
12
13
|
import { codeBlockStyles } from '../../plugins/code-block/styles';
|
|
13
14
|
import { mediaStyles } from './media';
|
|
14
15
|
import { layoutStyles } from '../../plugins/layout/styles';
|
|
@@ -37,9 +38,9 @@ var listsStyles = css(_templateObject4 || (_templateObject4 = _taggedTemplateLit
|
|
|
37
38
|
var emojiStyles = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n .", " {\n display: inline-block;\n\n .", " {\n cursor: pointer;\n\n &.", " > span {\n /** needed for selection style to cover custom emoji image properly */\n display: flex;\n }\n }\n\n &.", " {\n .", ",\n .", " {\n border-radius: 2px;\n ", "\n }\n }\n }\n"])), EmojiSharedCssClassName.EMOJI_CONTAINER, EmojiSharedCssClassName.EMOJI_NODE, EmojiSharedCssClassName.EMOJI_IMAGE, akEditorSelectedNodeClassName, EmojiSharedCssClassName.EMOJI_SPRITE, EmojiSharedCssClassName.EMOJI_IMAGE, getSelectionStyles([SelectionStyle.Blanket, SelectionStyle.BoxShadow]));
|
|
38
39
|
export var placeholderStyles = css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n .ProseMirror .placeholder-decoration {\n color: ", ";\n width: 100%;\n pointer-events: none;\n user-select: none;\n\n .placeholder-android {\n pointer-events: none;\n outline: none;\n user-select: none;\n position: absolute;\n }\n }\n"])), "var(--ds-text-subtlest, ".concat(N200, ")"));
|
|
39
40
|
var contentStyles = function contentStyles(props) {
|
|
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
|
+
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\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
42
|
theme: props.theme
|
|
42
|
-
}), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", placeholderTextStyles, placeholderStyles, codeBlockStyles(props), blocktypeStyles(props), codeMarkSharedStyles(props), textColorStyles, listsStyles, ruleStyles(props), mediaStyles, layoutStyles(props), telepointerStyle, gapCursorStyles, tableStyles(props), panelStyles(props), fakeCursorStyles, mentionsStyles, emojiStyles, tasksAndDecisionsStyles, gridStyles, linkStyles, blockMarksSharedStyles, dateSharedStyle, extensionStyles, expandStyles(props), findReplaceStyles, taskDecisionStyles, statusStyles, annotationSharedStyles(props), smartCardStyles, smartCardSharedStyles, dateStyles, embedCardStyles, unsupportedStyles, resizerStyles, MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
43
|
+
}), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", placeholderTextStyles, placeholderStyles, codeBlockStyles(props), blocktypeStyles(props), codeMarkSharedStyles(props), textColorStyles, listsStyles, ruleStyles(props), mediaStyles, layoutStyles(props), telepointerStyle, gapCursorStyles, tableStyles(props), panelStyles(props), fakeCursorStyles, 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
44
|
};
|
|
44
45
|
export var createEditorContentStyle = function createEditorContentStyle(styles) {
|
|
45
46
|
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
@@ -144,7 +144,7 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
144
144
|
processCopyButtonItems: (state: import("prosemirror-state").EditorState) => (items: import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[], hoverDecoration: ((nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command) | undefined) => import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[];
|
|
145
145
|
};
|
|
146
146
|
}, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"fakeTextCursor", {}, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"submitEditor", {
|
|
147
|
-
pluginConfiguration:
|
|
147
|
+
pluginConfiguration: import("@atlaskit/editor-plugin-submit-editor").SubmitEditorPluginOptions | undefined;
|
|
148
148
|
dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"media", {
|
|
149
149
|
pluginConfiguration: import("@atlaskit/editor-plugin-media/types").MediaOptions | undefined;
|
|
150
150
|
dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
@@ -270,7 +270,7 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
270
270
|
insertMediaAsMediaSingle: import("@atlaskit/editor-plugin-media/types").InsertMediaAsMediaSingle;
|
|
271
271
|
};
|
|
272
272
|
}, import("@atlaskit/editor-plugin-media/types").MediaOptions | undefined>>];
|
|
273
|
-
},
|
|
273
|
+
}, import("@atlaskit/editor-plugin-submit-editor").SubmitEditorPluginOptions | undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorDisabled", {
|
|
274
274
|
sharedState: import("@atlaskit/editor-plugin-editor-disabled").EditorDisabledPluginState;
|
|
275
275
|
}, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"unsupportedContent", {}, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"placeholder", {
|
|
276
276
|
pluginConfiguration: PlaceholderPluginOptions | undefined;
|
|
@@ -595,7 +595,7 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
595
595
|
processCopyButtonItems: (state: import("prosemirror-state").EditorState) => (items: import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[], hoverDecoration: ((nodeType: import("prosemirror-model").NodeType | import("prosemirror-model").NodeType[], add: boolean, className?: string | undefined) => import("@atlaskit/editor-common/types").Command) | undefined) => import("@atlaskit/editor-common/types").FloatingToolbarItem<import("@atlaskit/editor-common/types").Command>[];
|
|
596
596
|
};
|
|
597
597
|
}, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"fakeTextCursor", {}, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"submitEditor", {
|
|
598
|
-
pluginConfiguration:
|
|
598
|
+
pluginConfiguration: import("@atlaskit/editor-plugin-submit-editor").SubmitEditorPluginOptions | undefined;
|
|
599
599
|
dependencies: [import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"media", {
|
|
600
600
|
pluginConfiguration: import("@atlaskit/editor-plugin-media/types").MediaOptions | undefined;
|
|
601
601
|
dependencies: [import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"featureFlags", {
|
|
@@ -721,7 +721,7 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
721
721
|
insertMediaAsMediaSingle: import("@atlaskit/editor-plugin-media/types").InsertMediaAsMediaSingle;
|
|
722
722
|
};
|
|
723
723
|
}, import("@atlaskit/editor-plugin-media/types").MediaOptions | undefined>>];
|
|
724
|
-
},
|
|
724
|
+
}, import("@atlaskit/editor-plugin-submit-editor").SubmitEditorPluginOptions | undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorDisabled", {
|
|
725
725
|
sharedState: import("@atlaskit/editor-plugin-editor-disabled").EditorDisabledPluginState;
|
|
726
726
|
}, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"unsupportedContent", {}, undefined>, import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"placeholder", {
|
|
727
727
|
pluginConfiguration: PlaceholderPluginOptions | undefined;
|
|
@@ -12,7 +12,6 @@ export { default as maxContentSizePlugin } from './max-content-size';
|
|
|
12
12
|
export { default as panelPlugin } from './panel';
|
|
13
13
|
export { default as pastePlugin } from './paste';
|
|
14
14
|
export { default as placeholderTextPlugin } from './placeholder-text';
|
|
15
|
-
export { default as submitEditorPlugin } from './submit-editor';
|
|
16
15
|
export { default as tasksAndDecisionsPlugin } from './tasks-and-decisions';
|
|
17
16
|
export { default as textColorPlugin } from './text-color';
|
|
18
17
|
export { default as breakoutPlugin } from './breakout';
|
|
@@ -192,7 +192,7 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
192
192
|
}, undefined>,
|
|
193
193
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"fakeTextCursor", {}, undefined>,
|
|
194
194
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"submitEditor", {
|
|
195
|
-
pluginConfiguration:
|
|
195
|
+
pluginConfiguration: import("@atlaskit/editor-plugin-submit-editor").SubmitEditorPluginOptions | undefined;
|
|
196
196
|
dependencies: [
|
|
197
197
|
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"media", {
|
|
198
198
|
pluginConfiguration: import("@atlaskit/editor-plugin-media/types").MediaOptions | undefined;
|
|
@@ -353,7 +353,7 @@ export declare function createDefaultPreset(options: EditorPresetProps & Default
|
|
|
353
353
|
};
|
|
354
354
|
}, import("@atlaskit/editor-plugin-media/types").MediaOptions | undefined>>
|
|
355
355
|
];
|
|
356
|
-
},
|
|
356
|
+
}, import("@atlaskit/editor-plugin-submit-editor").SubmitEditorPluginOptions | undefined>,
|
|
357
357
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorDisabled", {
|
|
358
358
|
sharedState: import("@atlaskit/editor-plugin-editor-disabled").EditorDisabledPluginState;
|
|
359
359
|
}, undefined>,
|
|
@@ -763,7 +763,7 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
763
763
|
}, undefined>,
|
|
764
764
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"fakeTextCursor", {}, undefined>,
|
|
765
765
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"submitEditor", {
|
|
766
|
-
pluginConfiguration:
|
|
766
|
+
pluginConfiguration: import("@atlaskit/editor-plugin-submit-editor").SubmitEditorPluginOptions | undefined;
|
|
767
767
|
dependencies: [
|
|
768
768
|
import("@atlaskit/editor-common/types").OptionalPlugin<import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"media", {
|
|
769
769
|
pluginConfiguration: import("@atlaskit/editor-plugin-media/types").MediaOptions | undefined;
|
|
@@ -924,7 +924,7 @@ export declare function useDefaultPreset(props: EditorPresetProps & DefaultPrese
|
|
|
924
924
|
};
|
|
925
925
|
}, import("@atlaskit/editor-plugin-media/types").MediaOptions | undefined>>
|
|
926
926
|
];
|
|
927
|
-
},
|
|
927
|
+
}, import("@atlaskit/editor-plugin-submit-editor").SubmitEditorPluginOptions | undefined>,
|
|
928
928
|
import("@atlaskit/editor-common/types").NextEditorPluginFunctionOptionalConfigDefinition<"editorDisabled", {
|
|
929
929
|
sharedState: import("@atlaskit/editor-plugin-editor-disabled").EditorDisabledPluginState;
|
|
930
930
|
}, undefined>,
|
|
@@ -12,7 +12,6 @@ export { default as maxContentSizePlugin } from './max-content-size';
|
|
|
12
12
|
export { default as panelPlugin } from './panel';
|
|
13
13
|
export { default as pastePlugin } from './paste';
|
|
14
14
|
export { default as placeholderTextPlugin } from './placeholder-text';
|
|
15
|
-
export { default as submitEditorPlugin } from './submit-editor';
|
|
16
15
|
export { default as tasksAndDecisionsPlugin } from './tasks-and-decisions';
|
|
17
16
|
export { default as textColorPlugin } from './text-color';
|
|
18
17
|
export { default as breakoutPlugin } from './breakout';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "189.0.1",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@atlaskit/code": "^14.6.0",
|
|
54
54
|
"@atlaskit/date": "^0.10.0",
|
|
55
55
|
"@atlaskit/datetime-picker": "^12.10.0",
|
|
56
|
-
"@atlaskit/editor-common": "^76.
|
|
56
|
+
"@atlaskit/editor-common": "^76.14.0",
|
|
57
57
|
"@atlaskit/editor-json-transformer": "^8.10.0",
|
|
58
58
|
"@atlaskit/editor-markdown-transformer": "^5.2.5",
|
|
59
59
|
"@atlaskit/editor-palette": "1.5.1",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"@atlaskit/editor-plugin-emoji": "^0.4.0",
|
|
76
76
|
"@atlaskit/editor-plugin-extension": "^0.2.0",
|
|
77
77
|
"@atlaskit/editor-plugin-feature-flags": "^1.0.0",
|
|
78
|
-
"@atlaskit/editor-plugin-floating-toolbar": "^0.
|
|
78
|
+
"@atlaskit/editor-plugin-floating-toolbar": "^0.7.0",
|
|
79
79
|
"@atlaskit/editor-plugin-focus": "^0.2.0",
|
|
80
80
|
"@atlaskit/editor-plugin-grid": "^0.3.0",
|
|
81
81
|
"@atlaskit/editor-plugin-guideline": "^0.5.0",
|
|
@@ -87,6 +87,7 @@
|
|
|
87
87
|
"@atlaskit/editor-plugin-media": "^0.3.0",
|
|
88
88
|
"@atlaskit/editor-plugin-mentions": "^0.1.0",
|
|
89
89
|
"@atlaskit/editor-plugin-paste": "^0.1.0",
|
|
90
|
+
"@atlaskit/editor-plugin-paste-options-toolbar": "^0.2.0",
|
|
90
91
|
"@atlaskit/editor-plugin-placeholder": "^0.1.0",
|
|
91
92
|
"@atlaskit/editor-plugin-quick-insert": "^0.2.0",
|
|
92
93
|
"@atlaskit/editor-plugin-rule": "^0.1.0",
|
|
@@ -95,6 +96,7 @@
|
|
|
95
96
|
"@atlaskit/editor-plugin-selection": "^0.1.0",
|
|
96
97
|
"@atlaskit/editor-plugin-selection-toolbar": "^0.1.0",
|
|
97
98
|
"@atlaskit/editor-plugin-status": "^0.1.0",
|
|
99
|
+
"@atlaskit/editor-plugin-submit-editor": "^0.1.0",
|
|
98
100
|
"@atlaskit/editor-plugin-table": "^5.3.0",
|
|
99
101
|
"@atlaskit/editor-plugin-text-formatting": "^0.4.0",
|
|
100
102
|
"@atlaskit/editor-plugin-type-ahead": "^0.7.0",
|
|
@@ -163,7 +165,7 @@
|
|
|
163
165
|
"@atlaskit/inline-dialog": "^13.6.0",
|
|
164
166
|
"@atlaskit/link-analytics": "^8.3.0",
|
|
165
167
|
"@atlaskit/link-provider": "^1.6.0",
|
|
166
|
-
"@atlaskit/link-test-helpers": "^6.
|
|
168
|
+
"@atlaskit/link-test-helpers": "^6.2.0",
|
|
167
169
|
"@atlaskit/media-core": "^34.1.0",
|
|
168
170
|
"@atlaskit/media-integration-test-helpers": "^3.0.0",
|
|
169
171
|
"@atlaskit/media-test-helpers": "^33.0.0",
|
|
@@ -320,6 +322,9 @@
|
|
|
320
322
|
},
|
|
321
323
|
"platform.editor.enable-selection-toolbar_ucdwd": {
|
|
322
324
|
"type": "boolean"
|
|
325
|
+
},
|
|
326
|
+
"platform.editor.paste-options-toolbar": {
|
|
327
|
+
"type": "boolean"
|
|
323
328
|
}
|
|
324
329
|
}
|
|
325
330
|
}
|
|
@@ -1,64 +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.createPlugin = createPlugin;
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
|
-
var _keymap2 = require("@atlaskit/editor-prosemirror/keymap");
|
|
11
|
-
var _keymaps = require("@atlaskit/editor-common/keymaps");
|
|
12
|
-
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
13
|
-
var _consts = require("../analytics/consts");
|
|
14
|
-
function createPlugin(eventDispatch, api, onSave) {
|
|
15
|
-
if (!onSave) {
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
return (0, _keymap2.keymap)((0, _defineProperty2.default)({}, "".concat(_keymaps.submit.common), function _(state, _dispatch, editorView) {
|
|
19
|
-
var _api$media;
|
|
20
|
-
var mediaState = api === null || api === void 0 || (_api$media = api.media) === null || _api$media === void 0 || (_api$media = _api$media.sharedState) === null || _api$media === void 0 ? void 0 : _api$media.currentState();
|
|
21
|
-
if (mediaState && mediaState.waitForMediaUpload && !mediaState.allUploadsFinished) {
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
if (!editorView) {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
eventDispatch(_consts.analyticsEventKey, analyticsPayload(state));
|
|
28
|
-
onSave(editorView);
|
|
29
|
-
return true;
|
|
30
|
-
}));
|
|
31
|
-
}
|
|
32
|
-
var analyticsPayload = function analyticsPayload(state) {
|
|
33
|
-
return {
|
|
34
|
-
payload: {
|
|
35
|
-
action: _analytics.ACTION.STOPPED,
|
|
36
|
-
actionSubject: _analytics.ACTION_SUBJECT.EDITOR,
|
|
37
|
-
actionSubjectId: _analytics.ACTION_SUBJECT_ID.SAVE,
|
|
38
|
-
attributes: {
|
|
39
|
-
inputMethod: _analytics.INPUT_METHOD.SHORTCUT,
|
|
40
|
-
documentSize: state.doc.nodeSize
|
|
41
|
-
// TODO add individual node counts - tables, headings, lists, mediaSingles, mediaGroups, mediaCards, panels, extensions, decisions, action, codeBlocks
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
eventType: _analytics.EVENT_TYPE.UI
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
var submitEditorPlugin = function submitEditorPlugin(_ref) {
|
|
49
|
-
var onSave = _ref.config,
|
|
50
|
-
api = _ref.api;
|
|
51
|
-
return {
|
|
52
|
-
name: 'submitEditor',
|
|
53
|
-
pmPlugins: function pmPlugins() {
|
|
54
|
-
return [{
|
|
55
|
-
name: 'submitEditor',
|
|
56
|
-
plugin: function plugin(_ref2) {
|
|
57
|
-
var dispatch = _ref2.dispatch;
|
|
58
|
-
return createPlugin(dispatch, api, onSave);
|
|
59
|
-
}
|
|
60
|
-
}];
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
var _default = exports.default = submitEditorPlugin;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
2
|
-
import { submit } from '@atlaskit/editor-common/keymaps';
|
|
3
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { analyticsEventKey } from '../analytics/consts';
|
|
5
|
-
export function createPlugin(eventDispatch, api, onSave) {
|
|
6
|
-
if (!onSave) {
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
return keymap({
|
|
10
|
-
[`${submit.common}`]: (state, _dispatch, editorView) => {
|
|
11
|
-
var _api$media, _api$media$sharedStat;
|
|
12
|
-
const mediaState = api === null || api === void 0 ? void 0 : (_api$media = api.media) === null || _api$media === void 0 ? void 0 : (_api$media$sharedStat = _api$media.sharedState) === null || _api$media$sharedStat === void 0 ? void 0 : _api$media$sharedStat.currentState();
|
|
13
|
-
if (mediaState && mediaState.waitForMediaUpload && !mediaState.allUploadsFinished) {
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
if (!editorView) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
eventDispatch(analyticsEventKey, analyticsPayload(state));
|
|
20
|
-
onSave(editorView);
|
|
21
|
-
return true;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
const analyticsPayload = state => ({
|
|
26
|
-
payload: {
|
|
27
|
-
action: ACTION.STOPPED,
|
|
28
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
29
|
-
actionSubjectId: ACTION_SUBJECT_ID.SAVE,
|
|
30
|
-
attributes: {
|
|
31
|
-
inputMethod: INPUT_METHOD.SHORTCUT,
|
|
32
|
-
documentSize: state.doc.nodeSize
|
|
33
|
-
// TODO add individual node counts - tables, headings, lists, mediaSingles, mediaGroups, mediaCards, panels, extensions, decisions, action, codeBlocks
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
eventType: EVENT_TYPE.UI
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
const submitEditorPlugin = ({
|
|
40
|
-
config: onSave,
|
|
41
|
-
api
|
|
42
|
-
}) => ({
|
|
43
|
-
name: 'submitEditor',
|
|
44
|
-
pmPlugins() {
|
|
45
|
-
return [{
|
|
46
|
-
name: 'submitEditor',
|
|
47
|
-
plugin: ({
|
|
48
|
-
dispatch
|
|
49
|
-
}) => createPlugin(dispatch, api, onSave)
|
|
50
|
-
}];
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
export default submitEditorPlugin;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import { keymap } from '@atlaskit/editor-prosemirror/keymap';
|
|
3
|
-
import { submit } from '@atlaskit/editor-common/keymaps';
|
|
4
|
-
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE, INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
5
|
-
import { analyticsEventKey } from '../analytics/consts';
|
|
6
|
-
export function createPlugin(eventDispatch, api, onSave) {
|
|
7
|
-
if (!onSave) {
|
|
8
|
-
return;
|
|
9
|
-
}
|
|
10
|
-
return keymap(_defineProperty({}, "".concat(submit.common), function _(state, _dispatch, editorView) {
|
|
11
|
-
var _api$media;
|
|
12
|
-
var mediaState = api === null || api === void 0 || (_api$media = api.media) === null || _api$media === void 0 || (_api$media = _api$media.sharedState) === null || _api$media === void 0 ? void 0 : _api$media.currentState();
|
|
13
|
-
if (mediaState && mediaState.waitForMediaUpload && !mediaState.allUploadsFinished) {
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
if (!editorView) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
eventDispatch(analyticsEventKey, analyticsPayload(state));
|
|
20
|
-
onSave(editorView);
|
|
21
|
-
return true;
|
|
22
|
-
}));
|
|
23
|
-
}
|
|
24
|
-
var analyticsPayload = function analyticsPayload(state) {
|
|
25
|
-
return {
|
|
26
|
-
payload: {
|
|
27
|
-
action: ACTION.STOPPED,
|
|
28
|
-
actionSubject: ACTION_SUBJECT.EDITOR,
|
|
29
|
-
actionSubjectId: ACTION_SUBJECT_ID.SAVE,
|
|
30
|
-
attributes: {
|
|
31
|
-
inputMethod: INPUT_METHOD.SHORTCUT,
|
|
32
|
-
documentSize: state.doc.nodeSize
|
|
33
|
-
// TODO add individual node counts - tables, headings, lists, mediaSingles, mediaGroups, mediaCards, panels, extensions, decisions, action, codeBlocks
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
eventType: EVENT_TYPE.UI
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
var submitEditorPlugin = function submitEditorPlugin(_ref) {
|
|
41
|
-
var onSave = _ref.config,
|
|
42
|
-
api = _ref.api;
|
|
43
|
-
return {
|
|
44
|
-
name: 'submitEditor',
|
|
45
|
-
pmPlugins: function pmPlugins() {
|
|
46
|
-
return [{
|
|
47
|
-
name: 'submitEditor',
|
|
48
|
-
plugin: function plugin(_ref2) {
|
|
49
|
-
var dispatch = _ref2.dispatch;
|
|
50
|
-
return createPlugin(dispatch, api, onSave);
|
|
51
|
-
}
|
|
52
|
-
}];
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
};
|
|
56
|
-
export default submitEditorPlugin;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
import type { Dispatch } from '../../event-dispatcher';
|
|
4
|
-
import type { EditorProps } from '../../types/editor-props';
|
|
5
|
-
import type { NextEditorPlugin, OptionalPlugin, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
|
-
import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
|
|
7
|
-
export declare function createPlugin(eventDispatch: Dispatch, api: ExtractInjectionAPI<SubmitEditorPlugin> | undefined, onSave?: (editorView: EditorView) => void): SafePlugin | undefined;
|
|
8
|
-
type Config = EditorProps['onSave'];
|
|
9
|
-
type SubmitEditorPlugin = NextEditorPlugin<'submitEditor', {
|
|
10
|
-
pluginConfiguration: Config | undefined;
|
|
11
|
-
dependencies: [OptionalPlugin<MediaPlugin>];
|
|
12
|
-
}>;
|
|
13
|
-
declare const submitEditorPlugin: SubmitEditorPlugin;
|
|
14
|
-
export default submitEditorPlugin;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
3
|
-
import type { Dispatch } from '../../event-dispatcher';
|
|
4
|
-
import type { EditorProps } from '../../types/editor-props';
|
|
5
|
-
import type { NextEditorPlugin, OptionalPlugin, ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
6
|
-
import type { MediaPlugin } from '@atlaskit/editor-plugin-media';
|
|
7
|
-
export declare function createPlugin(eventDispatch: Dispatch, api: ExtractInjectionAPI<SubmitEditorPlugin> | undefined, onSave?: (editorView: EditorView) => void): SafePlugin | undefined;
|
|
8
|
-
type Config = EditorProps['onSave'];
|
|
9
|
-
type SubmitEditorPlugin = NextEditorPlugin<'submitEditor', {
|
|
10
|
-
pluginConfiguration: Config | undefined;
|
|
11
|
-
dependencies: [
|
|
12
|
-
OptionalPlugin<MediaPlugin>
|
|
13
|
-
];
|
|
14
|
-
}>;
|
|
15
|
-
declare const submitEditorPlugin: SubmitEditorPlugin;
|
|
16
|
-
export default submitEditorPlugin;
|