@atlaskit/editor-core 187.16.1 → 187.17.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/create-editor/ReactEditorViewInternal.js +5 -1
- package/dist/cjs/plugins/base/index.js +0 -8
- package/dist/cjs/plugins/better-type-history/index.js +34 -0
- package/dist/cjs/plugins/{base/pm-plugins/better-type-history.js → better-type-history/pm-plugins/main.js} +4 -5
- package/dist/cjs/plugins/better-type-history/pm-plugins/plugin-key.js +9 -0
- package/dist/cjs/plugins/index.js +7 -0
- package/dist/cjs/plugins/insert-block/ui/ToolbarInsertBlock/index.js +34 -42
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +2 -2
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +4 -14
- package/dist/cjs/plugins/paste/pm-plugins/main.js +7 -7
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +3 -1
- package/dist/es2019/plugins/base/index.js +0 -7
- package/dist/es2019/plugins/better-type-history/index.js +24 -0
- package/dist/es2019/plugins/{base/pm-plugins/better-type-history.js → better-type-history/pm-plugins/main.js} +1 -2
- package/dist/es2019/plugins/better-type-history/pm-plugins/plugin-key.js +2 -0
- package/dist/es2019/plugins/index.js +1 -0
- package/dist/es2019/plugins/insert-block/ui/ToolbarInsertBlock/index.js +2 -11
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +2 -2
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +2 -14
- package/dist/es2019/plugins/paste/pm-plugins/main.js +7 -7
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/ReactEditorViewInternal.js +5 -1
- package/dist/esm/plugins/base/index.js +0 -8
- package/dist/esm/plugins/better-type-history/index.js +26 -0
- package/dist/esm/plugins/{base/pm-plugins/better-type-history.js → better-type-history/pm-plugins/main.js} +1 -2
- package/dist/esm/plugins/better-type-history/pm-plugins/plugin-key.js +2 -0
- package/dist/esm/plugins/index.js +1 -0
- package/dist/esm/plugins/insert-block/ui/ToolbarInsertBlock/index.js +34 -42
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +2 -2
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.js +3 -13
- package/dist/esm/plugins/paste/pm-plugins/main.js +7 -7
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/ReactEditorViewInternal.d.ts +1 -0
- package/dist/types/plugins/better-type-history/index.d.ts +13 -0
- package/dist/types/plugins/{base/pm-plugins/better-type-history.d.ts → better-type-history/pm-plugins/main.d.ts} +0 -2
- package/dist/types/plugins/better-type-history/pm-plugins/plugin-key.d.ts +2 -0
- package/dist/types/plugins/index.d.ts +1 -0
- package/dist/types/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +2 -7
- package/dist/types/plugins/paste/index.d.ts +4 -2
- package/dist/types-ts4.5/create-editor/ReactEditorViewInternal.d.ts +1 -0
- package/dist/types-ts4.5/plugins/better-type-history/index.d.ts +13 -0
- package/dist/types-ts4.5/plugins/{base/pm-plugins/better-type-history.d.ts → better-type-history/pm-plugins/main.d.ts} +0 -2
- package/dist/types-ts4.5/plugins/better-type-history/pm-plugins/plugin-key.d.ts +2 -0
- package/dist/types-ts4.5/plugins/index.d.ts +1 -0
- package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/ResizableMediaSingleNext.d.ts +2 -7
- package/dist/types-ts4.5/plugins/paste/index.d.ts +4 -2
- package/package.json +4 -4
- package/report.api.md +3 -1
- package/tmp/api-report-tmp.d.ts +3 -1
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/resizable-media-single-messages.js +0 -15
- package/dist/cjs/ui/Resizer/ResizeLabel/index.js +0 -20
- package/dist/cjs/ui/Resizer/ResizeLabel/styles.js +0 -17
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/resizable-media-single-messages.js +0 -8
- package/dist/es2019/ui/Resizer/ResizeLabel/index.js +0 -12
- package/dist/es2019/ui/Resizer/ResizeLabel/styles.js +0 -25
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/resizable-media-single-messages.js +0 -8
- package/dist/esm/ui/Resizer/ResizeLabel/index.js +0 -12
- package/dist/esm/ui/Resizer/ResizeLabel/styles.js +0 -7
- package/dist/types/plugins/media/ui/ResizableMediaSingle/resizable-media-single-messages.d.ts +0 -7
- package/dist/types/ui/Resizer/ResizeLabel/index.d.ts +0 -8
- package/dist/types/ui/Resizer/ResizeLabel/styles.d.ts +0 -3
- package/dist/types-ts4.5/plugins/media/ui/ResizableMediaSingle/resizable-media-single-messages.d.ts +0 -7
- package/dist/types-ts4.5/ui/Resizer/ResizeLabel/index.d.ts +0 -8
- package/dist/types-ts4.5/ui/Resizer/ResizeLabel/styles.d.ts +0 -3
|
@@ -9,9 +9,6 @@ import { nonWrappedLayouts, setNodeSelection } from '@atlaskit/editor-common/uti
|
|
|
9
9
|
import { akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
10
10
|
import { wrapperStyle } from './styled';
|
|
11
11
|
import { ResizerNext } from '@atlaskit/editor-common/resizer';
|
|
12
|
-
import ResizeLabel from '../../../../ui/Resizer/ResizeLabel';
|
|
13
|
-
import { injectIntl } from 'react-intl-next';
|
|
14
|
-
import { messages } from './resizable-media-single-messages';
|
|
15
12
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
16
13
|
import classnames from 'classnames';
|
|
17
14
|
import { richMediaClassName, resizerStyles } from '@atlaskit/editor-common/styles';
|
|
@@ -391,7 +388,6 @@ class ResizableMediaSingleNext extends React.Component {
|
|
|
391
388
|
fullWidthMode,
|
|
392
389
|
selected,
|
|
393
390
|
children,
|
|
394
|
-
intl,
|
|
395
391
|
lineLength
|
|
396
392
|
} = this.props;
|
|
397
393
|
const {
|
|
@@ -414,8 +410,6 @@ class ResizableMediaSingleNext extends React.Component {
|
|
|
414
410
|
'rich-media-wrapped': layout === 'wrap-left' || layout === 'wrap-right'
|
|
415
411
|
});
|
|
416
412
|
const resizerNextClassName = classnames(className, resizerStyles);
|
|
417
|
-
const showSizeGuide = selected || isResizing;
|
|
418
|
-
const label = layout === 'full-width' ? intl.formatMessage(messages.fullWidthImage) : `${this.state.size.width} x ${this.state.size.height}`;
|
|
419
413
|
const maxWidth = this.calcMaxWidth(lineLength, containerWidth, fullWidthMode);
|
|
420
414
|
return jsx("div", {
|
|
421
415
|
ref: this.saveWrapper,
|
|
@@ -441,13 +435,7 @@ class ResizableMediaSingleNext extends React.Component {
|
|
|
441
435
|
snap: this.state.snaps,
|
|
442
436
|
resizeRatio: nonWrappedLayouts.includes(layout) ? 2 : 1,
|
|
443
437
|
"data-testid": resizerNextTestId
|
|
444
|
-
},
|
|
445
|
-
label: label,
|
|
446
|
-
containerWidth: this.state.size.width
|
|
447
|
-
}), children));
|
|
438
|
+
}, children));
|
|
448
439
|
}
|
|
449
440
|
}
|
|
450
|
-
|
|
451
|
-
// for testing purpose
|
|
452
|
-
export { ResizableMediaSingleNext as UnwrappedResizableMediaSingleNext };
|
|
453
|
-
export default injectIntl(ResizableMediaSingleNext);
|
|
441
|
+
export default ResizableMediaSingleNext;
|
|
@@ -21,7 +21,6 @@ import { upgradeTextToLists, splitParagraphs } from '../../list/transforms';
|
|
|
21
21
|
import { md } from '@atlaskit/editor-common/paste';
|
|
22
22
|
import { transformSliceToDecisionList } from '../../tasks-and-decisions/utils';
|
|
23
23
|
import { containsAnyAnnotations, stripNonExistingAnnotations } from '../../annotation/utils';
|
|
24
|
-
import { pluginKey as betterTypePluginKey } from '../../base/pm-plugins/better-type-history';
|
|
25
24
|
import { clipboardTextSerializer } from './clipboard-text-serializer';
|
|
26
25
|
import { htmlHasIncompleteTable, tryRebuildCompleteTableHtml, isPastedFromTinyMCEConfluence } from '../util/tinyMCE';
|
|
27
26
|
import { handlePaste as handlePasteTable } from '@atlaskit/editor-tables/utils';
|
|
@@ -178,8 +177,9 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
178
177
|
});
|
|
179
178
|
return tableExists;
|
|
180
179
|
});
|
|
181
|
-
if (!isPastingTextInsidePlaceholderText && !isPastingTable && !isPastingOverLayoutColumns) {
|
|
182
|
-
|
|
180
|
+
if (!isPastingTextInsidePlaceholderText && !isPastingTable && !isPastingOverLayoutColumns && pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.dependencies.betterTypeHistory) {
|
|
181
|
+
var _pluginInjectionApi$d;
|
|
182
|
+
tr = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.betterTypeHistory) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.actions.flagPasteEvent(tr);
|
|
183
183
|
}
|
|
184
184
|
addLinkMetadata(view.state.selection, tr, {
|
|
185
185
|
action: isPlainText ? ACTION.PASTED_AS_PLAIN : ACTION.PASTED,
|
|
@@ -207,14 +207,14 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
207
207
|
// force a "paste as plain text" action by clearing the markdownSlice.
|
|
208
208
|
markdownSlice = !((_markdownSlice = markdownSlice) !== null && _markdownSlice !== void 0 && _markdownSlice.size) ? undefined : markdownSlice;
|
|
209
209
|
if (markdownSlice) {
|
|
210
|
-
var _pluginInjectionApi$
|
|
210
|
+
var _pluginInjectionApi$d2, _pluginInjectionApi$d3;
|
|
211
211
|
// linkify text prior to converting to macro
|
|
212
212
|
if (handlePasteLinkOnSelectedTextWithAnalytics(view, event, markdownSlice, PasteTypes.markdown)(state, dispatch)) {
|
|
213
213
|
return true;
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
// run macro autoconvert prior to other conversions
|
|
217
|
-
if (handleMacroAutoConvert(text, markdownSlice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
217
|
+
if (handleMacroAutoConvert(text, markdownSlice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d2 = pluginInjectionApi.dependencies.card) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : (_pluginInjectionApi$d3 = _pluginInjectionApi$d2.actions) === null || _pluginInjectionApi$d3 === void 0 ? void 0 : _pluginInjectionApi$d3.queueCardsFromChangedTr, cardOptions, extensionAutoConverter)(state, dispatch, view)) {
|
|
218
218
|
// TODO: handleMacroAutoConvert dispatch twice, so we can't use the helper
|
|
219
219
|
sendPasteAnalyticsEvent(view, event, markdownSlice, {
|
|
220
220
|
type: PasteTypes.markdown
|
|
@@ -281,7 +281,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
281
281
|
|
|
282
282
|
// finally, handle rich-text copy-paste
|
|
283
283
|
if (isRichText) {
|
|
284
|
-
var _pluginInjectionApi$
|
|
284
|
+
var _pluginInjectionApi$d4, _pluginInjectionApi$d5;
|
|
285
285
|
// linkify the text where possible
|
|
286
286
|
slice = linkifyContent(state.schema)(slice);
|
|
287
287
|
if (handlePasteLinkOnSelectedTextWithAnalytics(view, event, slice, PasteTypes.richText)(state, dispatch)) {
|
|
@@ -289,7 +289,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
289
289
|
}
|
|
290
290
|
|
|
291
291
|
// run macro autoconvert prior to other conversions
|
|
292
|
-
if (handleMacroAutoConvert(text, slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
292
|
+
if (handleMacroAutoConvert(text, slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d4 = pluginInjectionApi.dependencies.card) === null || _pluginInjectionApi$d4 === void 0 ? void 0 : (_pluginInjectionApi$d5 = _pluginInjectionApi$d4.actions) === null || _pluginInjectionApi$d5 === void 0 ? void 0 : _pluginInjectionApi$d5.queueCardsFromChangedTr, cardOptions, extensionAutoConverter)(state, dispatch, view)) {
|
|
293
293
|
// TODO: handleMacroAutoConvert dispatch twice, so we can't use the helper
|
|
294
294
|
sendPasteAnalyticsEvent(view, event, slice, {
|
|
295
295
|
type: PasteTypes.richText
|
package/dist/es2019/version.json
CHANGED
|
@@ -103,6 +103,9 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
103
103
|
var _this$view;
|
|
104
104
|
return (_this$view = _this.view) === null || _this$view === void 0 ? void 0 : _this$view.state;
|
|
105
105
|
});
|
|
106
|
+
_defineProperty(_assertThisInitialized(_this), "getEditorView", function () {
|
|
107
|
+
return _this.view;
|
|
108
|
+
});
|
|
106
109
|
_defineProperty(_assertThisInitialized(_this), "formatFullWidthAppearance", function (appearance) {
|
|
107
110
|
if (appearance === 'full-width') {
|
|
108
111
|
return FULL_WIDTH_MODE.FULL_WIDTH;
|
|
@@ -523,7 +526,8 @@ export var ReactEditorView = /*#__PURE__*/function (_React$Component) {
|
|
|
523
526
|
});
|
|
524
527
|
_defineProperty(_assertThisInitialized(_this), "editor", _this.createEditor(_this.props.editorProps.assistiveLabel));
|
|
525
528
|
_this.pluginInjectionAPI = new EditorPluginInjectionAPI({
|
|
526
|
-
getEditorState: _this.getEditorState
|
|
529
|
+
getEditorState: _this.getEditorState,
|
|
530
|
+
getEditorView: _this.getEditorView
|
|
527
531
|
});
|
|
528
532
|
_this.eventDispatcher = new EventDispatcher();
|
|
529
533
|
_this.dispatch = createDispatch(_this.eventDispatcher);
|
|
@@ -12,7 +12,6 @@ import disableSpellcheckingPlugin from './pm-plugins/disable-spell-checking';
|
|
|
12
12
|
import contextIdentifierPlugin from './pm-plugins/context-identifier';
|
|
13
13
|
import newlinePreserveMarksPlugin from './pm-plugins/newline-preserve-marks';
|
|
14
14
|
import inlineCursorTargetPlugin from './pm-plugins/inline-cursor-target';
|
|
15
|
-
import betterTypeHistoryPlugin from './pm-plugins/better-type-history';
|
|
16
15
|
import scrollGutter from './pm-plugins/scroll-gutter';
|
|
17
16
|
import { keymap } from '@atlaskit/editor-common/keymaps';
|
|
18
17
|
import frozenEditor from './pm-plugins/frozen-editor';
|
|
@@ -89,13 +88,6 @@ var basePlugin = function basePlugin(options, api) {
|
|
|
89
88
|
providerFactory = _ref4.providerFactory;
|
|
90
89
|
return contextIdentifierPlugin(dispatch, providerFactory);
|
|
91
90
|
}
|
|
92
|
-
}, {
|
|
93
|
-
name: 'betterTypeHistory',
|
|
94
|
-
plugin: function plugin(_ref5) {
|
|
95
|
-
var dispatch = _ref5.dispatch,
|
|
96
|
-
providerFactory = _ref5.providerFactory;
|
|
97
|
-
return betterTypeHistoryPlugin();
|
|
98
|
-
}
|
|
99
91
|
});
|
|
100
92
|
if (options && options.allowScrollGutter) {
|
|
101
93
|
plugins.push({
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import createPlugin from './pm-plugins/main';
|
|
2
|
+
import { pluginKey } from './pm-plugins/plugin-key';
|
|
3
|
+
/**
|
|
4
|
+
* This plugin is aiming to improve undo behaviour for some of our more custom applications, very specific text
|
|
5
|
+
* paste events, splitting blocks of text, new lines.
|
|
6
|
+
*/
|
|
7
|
+
var betterTypeHistory = function betterTypeHistory() {
|
|
8
|
+
return {
|
|
9
|
+
name: 'betterTypeHistory',
|
|
10
|
+
actions: {
|
|
11
|
+
flagPasteEvent: function flagPasteEvent(tr) {
|
|
12
|
+
tr.setMeta(pluginKey, true);
|
|
13
|
+
return tr;
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
pmPlugins: function pmPlugins() {
|
|
17
|
+
return [{
|
|
18
|
+
name: 'betterTypeHistory',
|
|
19
|
+
plugin: function plugin() {
|
|
20
|
+
return createPlugin();
|
|
21
|
+
}
|
|
22
|
+
}];
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export default betterTypeHistory;
|
|
@@ -3,8 +3,8 @@ import { TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
|
3
3
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
4
4
|
import { closeHistory } from '@atlaskit/editor-prosemirror/history';
|
|
5
5
|
import { ReplaceStep, ReplaceAroundStep } from '@atlaskit/editor-prosemirror/transform';
|
|
6
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
7
6
|
import { extractSliceFromStep } from '../../../utils/step';
|
|
7
|
+
import { pluginKey } from './plugin-key';
|
|
8
8
|
var getEnterKeyboardActionStep = function getEnterKeyboardActionStep(trs) {
|
|
9
9
|
var firstTr = trs.length === 1 && trs[0];
|
|
10
10
|
if (!firstTr || !firstTr.docChanged || !firstTr.isGeneric || !(firstTr.selection instanceof TextSelection)) {
|
|
@@ -33,7 +33,6 @@ var isSliceAddingNewlineChar = function isSliceAddingNewlineChar(slice, schema)
|
|
|
33
33
|
var newLine = Fragment.from(schema.text('\n'));
|
|
34
34
|
return slice.content.eq(newLine);
|
|
35
35
|
};
|
|
36
|
-
export var pluginKey = new PluginKey('betterTypeHistoryPlugin');
|
|
37
36
|
export default (function () {
|
|
38
37
|
return new SafePlugin({
|
|
39
38
|
key: pluginKey,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { default as basePlugin } from './base';
|
|
2
2
|
export { default as blockTypePlugin } from './block-type';
|
|
3
3
|
export { pluginKey as blockPluginStateKey } from './block-type';
|
|
4
|
+
export { default as betterTypeHistoryPlugin } from './better-type-history';
|
|
4
5
|
export { default as clearMarksOnChangeToEmptyDocumentPlugin } from './clear-marks-on-change-to-empty-document';
|
|
5
6
|
export { default as codeBlockPlugin } from './code-block';
|
|
6
7
|
export { default as collabEditPlugin } from './collab-edit';
|
|
@@ -17,7 +17,6 @@ import ReactDOM from 'react-dom';
|
|
|
17
17
|
import { injectIntl } from 'react-intl-next';
|
|
18
18
|
import { EmojiPicker as AkEmojiPicker } from '@atlaskit/emoji/picker';
|
|
19
19
|
import { Popup } from '@atlaskit/editor-common/ui';
|
|
20
|
-
import { pluginCommandToPMCommand } from '@atlaskit/editor-common/preset';
|
|
21
20
|
import ToolbarButton from '../../../../ui/ToolbarButton';
|
|
22
21
|
import { separatorStyles, buttonGroupStyle, wrapperStyle } from '@atlaskit/editor-common/styles';
|
|
23
22
|
import { insertDate } from '../../../date/actions';
|
|
@@ -167,22 +166,15 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
167
166
|
}
|
|
168
167
|
});
|
|
169
168
|
_defineProperty(_assertThisInitialized(_this), "toggleLinkPanel", function (inputMethod) {
|
|
170
|
-
var _pluginInjectionApi$d, _pluginInjectionApi$d2;
|
|
171
|
-
var
|
|
172
|
-
|
|
173
|
-
pluginInjectionApi = _this$props.pluginInjectionApi;
|
|
174
|
-
var state = editorView.state,
|
|
175
|
-
dispatch = editorView.dispatch;
|
|
176
|
-
|
|
177
|
-
// We should update this to use `pluginInjectionApi.executeCommand` once available
|
|
178
|
-
pluginCommandToPMCommand(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d === void 0 ? void 0 : (_pluginInjectionApi$d2 = _pluginInjectionApi$d.hyperlink) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.commands.showLinkToolbar(inputMethod))(state, dispatch);
|
|
179
|
-
return true;
|
|
169
|
+
var _pluginInjectionApi$e, _pluginInjectionApi$d, _pluginInjectionApi$d2;
|
|
170
|
+
var pluginInjectionApi = _this.props.pluginInjectionApi;
|
|
171
|
+
return (_pluginInjectionApi$e = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : pluginInjectionApi.executeCommand(pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies) === null || _pluginInjectionApi$d === void 0 ? void 0 : (_pluginInjectionApi$d2 = _pluginInjectionApi$d.hyperlink) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : _pluginInjectionApi$d2.commands.showLinkToolbar(inputMethod))) !== null && _pluginInjectionApi$e !== void 0 ? _pluginInjectionApi$e : false;
|
|
180
172
|
});
|
|
181
173
|
_defineProperty(_assertThisInitialized(_this), "insertMention", function (inputMethod) {
|
|
182
174
|
var _pluginInjectionApi$d3;
|
|
183
|
-
var _this$
|
|
184
|
-
editorView = _this$
|
|
185
|
-
pluginInjectionApi = _this$
|
|
175
|
+
var _this$props = _this.props,
|
|
176
|
+
editorView = _this$props.editorView,
|
|
177
|
+
pluginInjectionApi = _this$props.pluginInjectionApi;
|
|
186
178
|
if (!editorView) {
|
|
187
179
|
return true;
|
|
188
180
|
}
|
|
@@ -195,9 +187,9 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
195
187
|
});
|
|
196
188
|
_defineProperty(_assertThisInitialized(_this), "insertTable", function (inputMethod) {
|
|
197
189
|
var _pluginInjectionApi$d4, _pluginInjectionApi$d5, _pluginInjectionApi$d6, _pluginInjectionApi$d7;
|
|
198
|
-
var _this$
|
|
199
|
-
pluginInjectionApi = _this$
|
|
200
|
-
editorView = _this$
|
|
190
|
+
var _this$props2 = _this.props,
|
|
191
|
+
pluginInjectionApi = _this$props2.pluginInjectionApi,
|
|
192
|
+
editorView = _this$props2.editorView;
|
|
201
193
|
var state = editorView.state,
|
|
202
194
|
dispatch = editorView.dispatch;
|
|
203
195
|
return (_pluginInjectionApi$d4 = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d5 = pluginInjectionApi.dependencies.table) === null || _pluginInjectionApi$d5 === void 0 ? void 0 : (_pluginInjectionApi$d6 = (_pluginInjectionApi$d7 = _pluginInjectionApi$d5.actions).insertTable) === null || _pluginInjectionApi$d6 === void 0 ? void 0 : _pluginInjectionApi$d6.call(_pluginInjectionApi$d7, {
|
|
@@ -231,9 +223,9 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
231
223
|
return true;
|
|
232
224
|
});
|
|
233
225
|
_defineProperty(_assertThisInitialized(_this), "openMediaPicker", function (inputMethod) {
|
|
234
|
-
var _this$
|
|
235
|
-
onShowMediaPicker = _this$
|
|
236
|
-
dispatchAnalyticsEvent = _this$
|
|
226
|
+
var _this$props3 = _this.props,
|
|
227
|
+
onShowMediaPicker = _this$props3.onShowMediaPicker,
|
|
228
|
+
dispatchAnalyticsEvent = _this$props3.dispatchAnalyticsEvent;
|
|
237
229
|
if (onShowMediaPicker) {
|
|
238
230
|
onShowMediaPicker();
|
|
239
231
|
if (dispatchAnalyticsEvent) {
|
|
@@ -260,11 +252,11 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
260
252
|
};
|
|
261
253
|
});
|
|
262
254
|
_defineProperty(_assertThisInitialized(_this), "insertHorizontalRule", function (inputMethod) {
|
|
263
|
-
var _this$
|
|
264
|
-
_this$
|
|
265
|
-
state = _this$
|
|
266
|
-
dispatch = _this$
|
|
267
|
-
featureFlags = _this$
|
|
255
|
+
var _this$props4 = _this.props,
|
|
256
|
+
_this$props4$editorVi = _this$props4.editorView,
|
|
257
|
+
state = _this$props4$editorVi.state,
|
|
258
|
+
dispatch = _this$props4$editorVi.dispatch,
|
|
259
|
+
featureFlags = _this$props4.featureFlags;
|
|
268
260
|
return insertHorizontalRule(inputMethod, featureFlags)(state, dispatch);
|
|
269
261
|
});
|
|
270
262
|
_defineProperty(_assertThisInitialized(_this), "insertExpand", function () {
|
|
@@ -275,9 +267,9 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
275
267
|
});
|
|
276
268
|
_defineProperty(_assertThisInitialized(_this), "insertBlockType", function (itemName) {
|
|
277
269
|
return function () {
|
|
278
|
-
var _this$
|
|
279
|
-
editorView = _this$
|
|
280
|
-
onInsertBlockType = _this$
|
|
270
|
+
var _this$props5 = _this.props,
|
|
271
|
+
editorView = _this$props5.editorView,
|
|
272
|
+
onInsertBlockType = _this$props5.onInsertBlockType;
|
|
281
273
|
var state = editorView.state,
|
|
282
274
|
dispatch = editorView.dispatch;
|
|
283
275
|
onInsertBlockType(itemName)(state, dispatch);
|
|
@@ -296,11 +288,11 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
296
288
|
_defineProperty(_assertThisInitialized(_this), "onItemActivated", function (_ref2) {
|
|
297
289
|
var item = _ref2.item,
|
|
298
290
|
inputMethod = _ref2.inputMethod;
|
|
299
|
-
var _this$
|
|
300
|
-
editorView = _this$
|
|
301
|
-
editorActions = _this$
|
|
302
|
-
handleImageUpload = _this$
|
|
303
|
-
expandEnabled = _this$
|
|
291
|
+
var _this$props6 = _this.props,
|
|
292
|
+
editorView = _this$props6.editorView,
|
|
293
|
+
editorActions = _this$props6.editorActions,
|
|
294
|
+
handleImageUpload = _this$props6.handleImageUpload,
|
|
295
|
+
expandEnabled = _this$props6.expandEnabled;
|
|
304
296
|
|
|
305
297
|
// need to do this before inserting nodes so scrollIntoView works properly
|
|
306
298
|
if (!editorView.hasFocus()) {
|
|
@@ -416,12 +408,12 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
416
408
|
key: "renderPopup",
|
|
417
409
|
value: function renderPopup() {
|
|
418
410
|
var emojiPickerOpen = this.state.emojiPickerOpen;
|
|
419
|
-
var _this$
|
|
420
|
-
popupsMountPoint = _this$
|
|
421
|
-
popupsBoundariesElement = _this$
|
|
422
|
-
popupsScrollableElement = _this$
|
|
423
|
-
emojiProvider = _this$
|
|
424
|
-
replacePlusMenuWithElementBrowser = _this$
|
|
411
|
+
var _this$props7 = this.props,
|
|
412
|
+
popupsMountPoint = _this$props7.popupsMountPoint,
|
|
413
|
+
popupsBoundariesElement = _this$props7.popupsBoundariesElement,
|
|
414
|
+
popupsScrollableElement = _this$props7.popupsScrollableElement,
|
|
415
|
+
emojiProvider = _this$props7.emojiProvider,
|
|
416
|
+
replacePlusMenuWithElementBrowser = _this$props7.replacePlusMenuWithElementBrowser;
|
|
425
417
|
var dropdownEmoji = this.state.dropdownItems.some(function (_ref4) {
|
|
426
418
|
var name = _ref4.value.name;
|
|
427
419
|
return name === 'emoji';
|
|
@@ -457,9 +449,9 @@ export var ToolbarInsertBlock = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
457
449
|
buttons = _this$state.buttons,
|
|
458
450
|
dropdownItems = _this$state.dropdownItems,
|
|
459
451
|
emojiPickerOpen = _this$state.emojiPickerOpen;
|
|
460
|
-
var _this$
|
|
461
|
-
isDisabled = _this$
|
|
462
|
-
isReducedSpacing = _this$
|
|
452
|
+
var _this$props8 = this.props,
|
|
453
|
+
isDisabled = _this$props8.isDisabled,
|
|
454
|
+
isReducedSpacing = _this$props8.isReducedSpacing;
|
|
463
455
|
if (buttons.length === 0 && dropdownItems.length === 0) {
|
|
464
456
|
return null;
|
|
465
457
|
}
|
|
@@ -386,7 +386,7 @@ var MediaSingleNode = /*#__PURE__*/function (_Component) {
|
|
|
386
386
|
gutterOffset: MEDIA_SINGLE_GUTTER_SIZE
|
|
387
387
|
})
|
|
388
388
|
};
|
|
389
|
-
var
|
|
389
|
+
var resizableMediaSingleProps = _objectSpread({
|
|
390
390
|
view: view,
|
|
391
391
|
getPos: getPos,
|
|
392
392
|
updateSize: this.updateSize,
|
|
@@ -420,7 +420,7 @@ var MediaSingleNode = /*#__PURE__*/function (_Component) {
|
|
|
420
420
|
ref: this.captionPlaceHolderRef,
|
|
421
421
|
onClick: this.clickPlaceholder
|
|
422
422
|
}));
|
|
423
|
-
return canResize ? getBooleanFF('platform.editor.media.extended-resize-experience') ? jsx(ResizableMediaSingleNext,
|
|
423
|
+
return canResize ? getBooleanFF('platform.editor.media.extended-resize-experience') ? jsx(ResizableMediaSingleNext, resizableMediaSingleProps, MediaChildren) : jsx(ResizableMediaSingle, _extends({}, resizableMediaSingleProps, {
|
|
424
424
|
lineLength: contentWidthForLegacyExperience
|
|
425
425
|
}), MediaChildren) : jsx(MediaSingle, mediaSingleProps, MediaChildren);
|
|
426
426
|
}
|
|
@@ -20,9 +20,6 @@ import { nonWrappedLayouts, setNodeSelection } from '@atlaskit/editor-common/uti
|
|
|
20
20
|
import { akEditorFullWidthLayoutWidth, akEditorGutterPadding, akEditorDefaultLayoutWidth } from '@atlaskit/editor-shared-styles';
|
|
21
21
|
import { wrapperStyle } from './styled';
|
|
22
22
|
import { ResizerNext } from '@atlaskit/editor-common/resizer';
|
|
23
|
-
import ResizeLabel from '../../../../ui/Resizer/ResizeLabel';
|
|
24
|
-
import { injectIntl } from 'react-intl-next';
|
|
25
|
-
import { messages } from './resizable-media-single-messages';
|
|
26
23
|
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
27
24
|
import classnames from 'classnames';
|
|
28
25
|
import { richMediaClassName, resizerStyles } from '@atlaskit/editor-common/styles';
|
|
@@ -467,7 +464,6 @@ var ResizableMediaSingleNext = /*#__PURE__*/function (_React$Component) {
|
|
|
467
464
|
fullWidthMode = _this$props8.fullWidthMode,
|
|
468
465
|
selected = _this$props8.selected,
|
|
469
466
|
children = _this$props8.children,
|
|
470
|
-
intl = _this$props8.intl,
|
|
471
467
|
lineLength = _this$props8.lineLength;
|
|
472
468
|
var _this$state = this.state,
|
|
473
469
|
isResizing = _this$state.isResizing,
|
|
@@ -488,8 +484,6 @@ var ResizableMediaSingleNext = /*#__PURE__*/function (_React$Component) {
|
|
|
488
484
|
'rich-media-wrapped': layout === 'wrap-left' || layout === 'wrap-right'
|
|
489
485
|
});
|
|
490
486
|
var resizerNextClassName = classnames(className, resizerStyles);
|
|
491
|
-
var showSizeGuide = selected || isResizing;
|
|
492
|
-
var label = layout === 'full-width' ? intl.formatMessage(messages.fullWidthImage) : "".concat(this.state.size.width, " x ").concat(this.state.size.height);
|
|
493
487
|
var maxWidth = this.calcMaxWidth(lineLength, containerWidth, fullWidthMode);
|
|
494
488
|
return jsx("div", {
|
|
495
489
|
ref: this.saveWrapper,
|
|
@@ -515,13 +509,9 @@ var ResizableMediaSingleNext = /*#__PURE__*/function (_React$Component) {
|
|
|
515
509
|
snap: this.state.snaps,
|
|
516
510
|
resizeRatio: nonWrappedLayouts.includes(layout) ? 2 : 1,
|
|
517
511
|
"data-testid": resizerNextTestId
|
|
518
|
-
},
|
|
519
|
-
label: label,
|
|
520
|
-
containerWidth: this.state.size.width
|
|
521
|
-
}), children));
|
|
512
|
+
}, children));
|
|
522
513
|
}
|
|
523
514
|
}]);
|
|
524
515
|
return ResizableMediaSingleNext;
|
|
525
|
-
}(React.Component);
|
|
526
|
-
export
|
|
527
|
-
export default injectIntl(ResizableMediaSingleNext);
|
|
516
|
+
}(React.Component);
|
|
517
|
+
export default ResizableMediaSingleNext;
|
|
@@ -23,7 +23,6 @@ import { upgradeTextToLists, splitParagraphs } from '../../list/transforms';
|
|
|
23
23
|
import { md } from '@atlaskit/editor-common/paste';
|
|
24
24
|
import { transformSliceToDecisionList } from '../../tasks-and-decisions/utils';
|
|
25
25
|
import { containsAnyAnnotations, stripNonExistingAnnotations } from '../../annotation/utils';
|
|
26
|
-
import { pluginKey as betterTypePluginKey } from '../../base/pm-plugins/better-type-history';
|
|
27
26
|
import { clipboardTextSerializer } from './clipboard-text-serializer';
|
|
28
27
|
import { htmlHasIncompleteTable, tryRebuildCompleteTableHtml, isPastedFromTinyMCEConfluence } from '../util/tinyMCE';
|
|
29
28
|
import { handlePaste as handlePasteTable } from '@atlaskit/editor-tables/utils';
|
|
@@ -198,8 +197,9 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
198
197
|
});
|
|
199
198
|
return tableExists;
|
|
200
199
|
});
|
|
201
|
-
if (!isPastingTextInsidePlaceholderText && !isPastingTable && !isPastingOverLayoutColumns) {
|
|
202
|
-
|
|
200
|
+
if (!isPastingTextInsidePlaceholderText && !isPastingTable && !isPastingOverLayoutColumns && pluginInjectionApi !== null && pluginInjectionApi !== void 0 && pluginInjectionApi.dependencies.betterTypeHistory) {
|
|
201
|
+
var _pluginInjectionApi$d;
|
|
202
|
+
tr = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d = pluginInjectionApi.dependencies.betterTypeHistory) === null || _pluginInjectionApi$d === void 0 ? void 0 : _pluginInjectionApi$d.actions.flagPasteEvent(tr);
|
|
203
203
|
}
|
|
204
204
|
addLinkMetadata(view.state.selection, tr, {
|
|
205
205
|
action: isPlainText ? ACTION.PASTED_AS_PLAIN : ACTION.PASTED,
|
|
@@ -227,14 +227,14 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
227
227
|
// force a "paste as plain text" action by clearing the markdownSlice.
|
|
228
228
|
markdownSlice = !((_markdownSlice = markdownSlice) !== null && _markdownSlice !== void 0 && _markdownSlice.size) ? undefined : markdownSlice;
|
|
229
229
|
if (markdownSlice) {
|
|
230
|
-
var _pluginInjectionApi$
|
|
230
|
+
var _pluginInjectionApi$d2, _pluginInjectionApi$d3;
|
|
231
231
|
// linkify text prior to converting to macro
|
|
232
232
|
if (handlePasteLinkOnSelectedTextWithAnalytics(view, event, markdownSlice, PasteTypes.markdown)(state, dispatch)) {
|
|
233
233
|
return true;
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
// run macro autoconvert prior to other conversions
|
|
237
|
-
if (handleMacroAutoConvert(text, markdownSlice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
237
|
+
if (handleMacroAutoConvert(text, markdownSlice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d2 = pluginInjectionApi.dependencies.card) === null || _pluginInjectionApi$d2 === void 0 ? void 0 : (_pluginInjectionApi$d3 = _pluginInjectionApi$d2.actions) === null || _pluginInjectionApi$d3 === void 0 ? void 0 : _pluginInjectionApi$d3.queueCardsFromChangedTr, cardOptions, extensionAutoConverter)(state, dispatch, view)) {
|
|
238
238
|
// TODO: handleMacroAutoConvert dispatch twice, so we can't use the helper
|
|
239
239
|
sendPasteAnalyticsEvent(view, event, markdownSlice, {
|
|
240
240
|
type: PasteTypes.markdown
|
|
@@ -299,7 +299,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
299
299
|
|
|
300
300
|
// finally, handle rich-text copy-paste
|
|
301
301
|
if (isRichText) {
|
|
302
|
-
var _pluginInjectionApi$
|
|
302
|
+
var _pluginInjectionApi$d4, _pluginInjectionApi$d5;
|
|
303
303
|
// linkify the text where possible
|
|
304
304
|
slice = linkifyContent(state.schema)(slice);
|
|
305
305
|
if (handlePasteLinkOnSelectedTextWithAnalytics(view, event, slice, PasteTypes.richText)(state, dispatch)) {
|
|
@@ -307,7 +307,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
307
307
|
}
|
|
308
308
|
|
|
309
309
|
// run macro autoconvert prior to other conversions
|
|
310
|
-
if (handleMacroAutoConvert(text, slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$
|
|
310
|
+
if (handleMacroAutoConvert(text, slice, pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$d4 = pluginInjectionApi.dependencies.card) === null || _pluginInjectionApi$d4 === void 0 ? void 0 : (_pluginInjectionApi$d5 = _pluginInjectionApi$d4.actions) === null || _pluginInjectionApi$d5 === void 0 ? void 0 : _pluginInjectionApi$d5.queueCardsFromChangedTr, cardOptions, extensionAutoConverter)(state, dispatch, view)) {
|
|
311
311
|
// TODO: handleMacroAutoConvert dispatch twice, so we can't use the helper
|
|
312
312
|
sendPasteAnalyticsEvent(view, event, slice, {
|
|
313
313
|
type: PasteTypes.richText
|
package/dist/esm/version.json
CHANGED
|
@@ -85,6 +85,7 @@ export declare class ReactEditorView<T = {}> extends React.Component<EditorViewP
|
|
|
85
85
|
private isTransactionTrackingExplicitlyDisabled;
|
|
86
86
|
constructor(props: EditorViewProps & WrappedComponentProps & T, context: EditorReactContext);
|
|
87
87
|
getEditorState: () => EditorState | undefined;
|
|
88
|
+
getEditorView: () => EditorView | undefined;
|
|
88
89
|
UNSAFE_componentWillReceiveProps(nextProps: EditorViewProps): void;
|
|
89
90
|
formatFullWidthAppearance: (appearance: EditorAppearance | undefined) => FULL_WIDTH_MODE;
|
|
90
91
|
resetEditorState: ({ doc, shouldScrollToBottom, }: {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
export type BetterTypeHistoryAPI = {
|
|
4
|
+
flagPasteEvent: (transaction: Transaction) => Transaction;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* This plugin is aiming to improve undo behaviour for some of our more custom applications, very specific text
|
|
8
|
+
* paste events, splitting blocks of text, new lines.
|
|
9
|
+
*/
|
|
10
|
+
declare const betterTypeHistory: NextEditorPlugin<'betterTypeHistory', {
|
|
11
|
+
actions: BetterTypeHistoryAPI;
|
|
12
|
+
}>;
|
|
13
|
+
export default betterTypeHistory;
|
|
@@ -2,6 +2,7 @@ export { default as basePlugin } from './base';
|
|
|
2
2
|
export { default as blockTypePlugin } from './block-type';
|
|
3
3
|
export { pluginKey as blockPluginStateKey } from './block-type';
|
|
4
4
|
export type { BlockTypeState } from './block-type';
|
|
5
|
+
export { default as betterTypeHistoryPlugin } from './better-type-history';
|
|
5
6
|
export { default as clearMarksOnChangeToEmptyDocumentPlugin } from './clear-marks-on-change-to-empty-document';
|
|
6
7
|
export { default as codeBlockPlugin } from './code-block';
|
|
7
8
|
export { default as collabEditPlugin } from './collab-edit';
|
|
@@ -6,7 +6,6 @@ import type { RichMediaLayout as MediaSingleLayout } from '@atlaskit/adf-schema'
|
|
|
6
6
|
import type { MediaClientConfig } from '@atlaskit/media-core';
|
|
7
7
|
import type { Props } from './types';
|
|
8
8
|
import type { Dimensions, HandleResize, HandleResizeStart, Position, Snap } from '@atlaskit/editor-common/resizer';
|
|
9
|
-
import type { WrappedComponentProps } from 'react-intl-next';
|
|
10
9
|
import type { GuidelineConfig, GuidelineSnapsReference } from '@atlaskit/editor-common/guideline';
|
|
11
10
|
type State = {
|
|
12
11
|
offsetLeft: number;
|
|
@@ -17,7 +16,7 @@ type State = {
|
|
|
17
16
|
snaps: Snap;
|
|
18
17
|
};
|
|
19
18
|
export declare const resizerNextTestId = "mediaSingle.resizerNext.testid";
|
|
20
|
-
type ResizableMediaSingleNextProps = Props
|
|
19
|
+
type ResizableMediaSingleNextProps = Props;
|
|
21
20
|
declare class ResizableMediaSingleNext extends React.Component<ResizableMediaSingleNextProps, State> {
|
|
22
21
|
private guidelines;
|
|
23
22
|
constructor(props: ResizableMediaSingleNextProps);
|
|
@@ -72,8 +71,4 @@ declare class ResizableMediaSingleNext extends React.Component<ResizableMediaSin
|
|
|
72
71
|
handleResizeStop: HandleResize;
|
|
73
72
|
render(): jsx.JSX.Element;
|
|
74
73
|
}
|
|
75
|
-
export
|
|
76
|
-
declare const _default: React.FC<import("react-intl-next").WithIntlProps<ResizableMediaSingleNextProps>> & {
|
|
77
|
-
WrappedComponent: React.ComponentType<ResizableMediaSingleNextProps>;
|
|
78
|
-
};
|
|
79
|
-
export default _default;
|
|
74
|
+
export default ResizableMediaSingleNext;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
-
import { CardOptions } from '@atlaskit/editor-common/card';
|
|
1
|
+
import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { CardOptions } from '@atlaskit/editor-common/card';
|
|
3
3
|
import type featureFlagsPlugin from '@atlaskit/editor-plugin-feature-flags';
|
|
4
4
|
import type { cardPlugin } from '@atlaskit/editor-plugin-card';
|
|
5
|
+
import type betterTypeHistoryPlugin from '../better-type-history';
|
|
5
6
|
export type PastePluginOptions = {
|
|
6
7
|
cardOptions?: CardOptions;
|
|
7
8
|
sanitizePrivateContent?: boolean;
|
|
@@ -10,6 +11,7 @@ declare const pastePlugin: NextEditorPlugin<'paste', {
|
|
|
10
11
|
pluginConfiguration: PastePluginOptions;
|
|
11
12
|
dependencies: [
|
|
12
13
|
typeof featureFlagsPlugin,
|
|
14
|
+
typeof betterTypeHistoryPlugin,
|
|
13
15
|
OptionalPlugin<typeof cardPlugin>
|
|
14
16
|
];
|
|
15
17
|
}>;
|
|
@@ -85,6 +85,7 @@ export declare class ReactEditorView<T = {}> extends React.Component<EditorViewP
|
|
|
85
85
|
private isTransactionTrackingExplicitlyDisabled;
|
|
86
86
|
constructor(props: EditorViewProps & WrappedComponentProps & T, context: EditorReactContext);
|
|
87
87
|
getEditorState: () => EditorState | undefined;
|
|
88
|
+
getEditorView: () => EditorView | undefined;
|
|
88
89
|
UNSAFE_componentWillReceiveProps(nextProps: EditorViewProps): void;
|
|
89
90
|
formatFullWidthAppearance: (appearance: EditorAppearance | undefined) => FULL_WIDTH_MODE;
|
|
90
91
|
resetEditorState: ({ doc, shouldScrollToBottom, }: {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NextEditorPlugin } from '@atlaskit/editor-common/types';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
export type BetterTypeHistoryAPI = {
|
|
4
|
+
flagPasteEvent: (transaction: Transaction) => Transaction;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* This plugin is aiming to improve undo behaviour for some of our more custom applications, very specific text
|
|
8
|
+
* paste events, splitting blocks of text, new lines.
|
|
9
|
+
*/
|
|
10
|
+
declare const betterTypeHistory: NextEditorPlugin<'betterTypeHistory', {
|
|
11
|
+
actions: BetterTypeHistoryAPI;
|
|
12
|
+
}>;
|
|
13
|
+
export default betterTypeHistory;
|