@atlaskit/editor-core 190.1.19 → 190.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/afm-cc/tsconfig.json +3 -0
- package/dist/cjs/create-editor/ErrorBoundary.js +9 -5
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/plugins/paste/pm-plugins/main.js +14 -10
- package/dist/cjs/presets/default.js +2 -2
- package/dist/cjs/presets/universal.js +2 -1
- package/dist/cjs/utils/index.js +12 -18
- package/dist/cjs/utils/performance/measure-enum.js +1 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/create-editor/ErrorBoundary.js +10 -7
- package/dist/es2019/index.js +14 -1
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/plugins/paste/pm-plugins/main.js +11 -5
- package/dist/es2019/presets/default.js +1 -1
- package/dist/es2019/presets/universal.js +2 -1
- package/dist/es2019/utils/index.js +0 -7
- package/dist/es2019/utils/performance/measure-enum.js +1 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/create-editor/ErrorBoundary.js +10 -7
- package/dist/esm/index.js +14 -1
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/plugins/paste/pm-plugins/main.js +9 -5
- package/dist/esm/presets/default.js +1 -1
- package/dist/esm/presets/universal.js +2 -1
- package/dist/esm/utils/index.js +0 -5
- package/dist/esm/utils/performance/measure-enum.js +1 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/index.d.ts +15 -2
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/plugins/paste/pm-plugins/main.d.ts +2 -0
- package/dist/types/presets/default.d.ts +1 -1
- package/dist/types/types/editor-props.d.ts +1 -1
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/utils/index.d.ts +0 -1
- package/dist/types/utils/performance/measure-enum.d.ts +0 -1
- package/dist/types-ts4.5/index.d.ts +15 -2
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/plugins/paste/pm-plugins/main.d.ts +2 -0
- package/dist/types-ts4.5/presets/default.d.ts +1 -1
- package/dist/types-ts4.5/types/editor-props.d.ts +1 -1
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
- package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types-ts4.5/utils/index.d.ts +0 -1
- package/dist/types-ts4.5/utils/performance/measure-enum.d.ts +0 -1
- package/package.json +10 -4
- package/dist/cjs/plugins/annotation/commands/index.js +0 -150
- package/dist/cjs/plugins/annotation/commands/transform.js +0 -86
- package/dist/cjs/plugins/annotation/index.js +0 -130
- package/dist/cjs/plugins/annotation/nodeviews/index.js +0 -59
- package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +0 -243
- package/dist/cjs/plugins/annotation/pm-plugins/keymap.js +0 -15
- package/dist/cjs/plugins/annotation/pm-plugins/plugin-factory.js +0 -107
- package/dist/cjs/plugins/annotation/pm-plugins/reducer.js +0 -84
- package/dist/cjs/plugins/annotation/pm-plugins/types.js +0 -17
- package/dist/cjs/plugins/annotation/toolbar.js +0 -59
- package/dist/cjs/plugins/annotation/types.js +0 -20
- package/dist/cjs/plugins/annotation/ui/AnnotationViewWrapper.js +0 -38
- package/dist/cjs/plugins/annotation/ui/InlineCommentView.js +0 -149
- package/dist/cjs/plugins/annotation/update-provider.js +0 -36
- package/dist/cjs/plugins/annotation/utils.js +0 -372
- package/dist/es2019/plugins/annotation/commands/index.js +0 -123
- package/dist/es2019/plugins/annotation/commands/transform.js +0 -64
- package/dist/es2019/plugins/annotation/index.js +0 -125
- package/dist/es2019/plugins/annotation/nodeviews/index.js +0 -31
- package/dist/es2019/plugins/annotation/pm-plugins/inline-comment.js +0 -178
- package/dist/es2019/plugins/annotation/pm-plugins/keymap.js +0 -9
- package/dist/es2019/plugins/annotation/pm-plugins/plugin-factory.js +0 -108
- package/dist/es2019/plugins/annotation/pm-plugins/reducer.js +0 -94
- package/dist/es2019/plugins/annotation/pm-plugins/types.js +0 -11
- package/dist/es2019/plugins/annotation/toolbar.js +0 -53
- package/dist/es2019/plugins/annotation/types.js +0 -14
- package/dist/es2019/plugins/annotation/ui/AnnotationViewWrapper.js +0 -14
- package/dist/es2019/plugins/annotation/ui/InlineCommentView.js +0 -147
- package/dist/es2019/plugins/annotation/update-provider.js +0 -9
- package/dist/es2019/plugins/annotation/utils.js +0 -334
- package/dist/esm/plugins/annotation/commands/index.js +0 -143
- package/dist/esm/plugins/annotation/commands/transform.js +0 -80
- package/dist/esm/plugins/annotation/index.js +0 -118
- package/dist/esm/plugins/annotation/nodeviews/index.js +0 -52
- package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +0 -236
- package/dist/esm/plugins/annotation/pm-plugins/keymap.js +0 -9
- package/dist/esm/plugins/annotation/pm-plugins/plugin-factory.js +0 -101
- package/dist/esm/plugins/annotation/pm-plugins/reducer.js +0 -77
- package/dist/esm/plugins/annotation/pm-plugins/types.js +0 -11
- package/dist/esm/plugins/annotation/toolbar.js +0 -52
- package/dist/esm/plugins/annotation/types.js +0 -14
- package/dist/esm/plugins/annotation/ui/AnnotationViewWrapper.js +0 -31
- package/dist/esm/plugins/annotation/ui/InlineCommentView.js +0 -144
- package/dist/esm/plugins/annotation/update-provider.js +0 -29
- package/dist/esm/plugins/annotation/utils.js +0 -345
- package/dist/types/plugins/annotation/commands/index.d.ts +0 -15
- package/dist/types/plugins/annotation/commands/transform.d.ts +0 -11
- package/dist/types/plugins/annotation/index.d.ts +0 -15
- package/dist/types/plugins/annotation/nodeviews/index.d.ts +0 -11
- package/dist/types/plugins/annotation/pm-plugins/inline-comment.d.ts +0 -3
- package/dist/types/plugins/annotation/pm-plugins/keymap.d.ts +0 -3
- package/dist/types/plugins/annotation/pm-plugins/plugin-factory.d.ts +0 -2
- package/dist/types/plugins/annotation/pm-plugins/reducer.d.ts +0 -3
- package/dist/types/plugins/annotation/pm-plugins/types.d.ts +0 -78
- package/dist/types/plugins/annotation/toolbar.d.ts +0 -5
- package/dist/types/plugins/annotation/types.d.ts +0 -86
- package/dist/types/plugins/annotation/ui/AnnotationViewWrapper.d.ts +0 -10
- package/dist/types/plugins/annotation/ui/InlineCommentView.d.ts +0 -13
- package/dist/types/plugins/annotation/update-provider.d.ts +0 -12
- package/dist/types/plugins/annotation/utils.d.ts +0 -45
- package/dist/types-ts4.5/plugins/annotation/commands/index.d.ts +0 -15
- package/dist/types-ts4.5/plugins/annotation/commands/transform.d.ts +0 -11
- package/dist/types-ts4.5/plugins/annotation/index.d.ts +0 -17
- package/dist/types-ts4.5/plugins/annotation/nodeviews/index.d.ts +0 -11
- package/dist/types-ts4.5/plugins/annotation/pm-plugins/inline-comment.d.ts +0 -3
- package/dist/types-ts4.5/plugins/annotation/pm-plugins/keymap.d.ts +0 -3
- package/dist/types-ts4.5/plugins/annotation/pm-plugins/plugin-factory.d.ts +0 -2
- package/dist/types-ts4.5/plugins/annotation/pm-plugins/reducer.d.ts +0 -3
- package/dist/types-ts4.5/plugins/annotation/pm-plugins/types.d.ts +0 -78
- package/dist/types-ts4.5/plugins/annotation/toolbar.d.ts +0 -5
- package/dist/types-ts4.5/plugins/annotation/types.d.ts +0 -86
- package/dist/types-ts4.5/plugins/annotation/ui/AnnotationViewWrapper.d.ts +0 -10
- package/dist/types-ts4.5/plugins/annotation/ui/InlineCommentView.d.ts +0 -13
- package/dist/types-ts4.5/plugins/annotation/update-provider.d.ts +0 -12
- package/dist/types-ts4.5/plugins/annotation/utils.d.ts +0 -45
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 190.1.23
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#63348](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63348) [`2d6eebf2ed74`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2d6eebf2ed74) - Extract annotation plugin from editor-core to @atlaskit/editor-plugin-annotation.
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
|
|
10
|
+
## 190.1.20
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#63392](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/63392) [`7240ee0cf279`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7240ee0cf279) - [ED-21646] Only rerender once in error boundary to avoid overreporting and infinite rerendering
|
|
15
|
+
- [#62416](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/62416) [`9f3c36680d89`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9f3c36680d89) - [ux] Updated table context menu styling.
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 190.1.19
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -16,13 +16,13 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
16
16
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
17
17
|
var _react = _interopRequireDefault(require("react"));
|
|
18
18
|
var _uuid = _interopRequireDefault(require("uuid"));
|
|
19
|
+
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
20
|
+
var _monitoring = require("@atlaskit/editor-common/monitoring");
|
|
19
21
|
var _ufo = require("@atlaskit/editor-common/ufo");
|
|
20
22
|
var _ui = require("@atlaskit/editor-common/ui");
|
|
21
23
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
22
|
-
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
23
24
|
var _documentLogger = require("../utils/document-logger");
|
|
24
25
|
var _WithEditorView = require("./WithEditorView");
|
|
25
|
-
var _monitoring = require("@atlaskit/editor-common/monitoring");
|
|
26
26
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
27
27
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
28
28
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
@@ -151,6 +151,10 @@ var ErrorBoundaryWithEditorView = exports.ErrorBoundaryWithEditorView = /*#__PUR
|
|
|
151
151
|
key: "componentDidCatch",
|
|
152
152
|
value: function componentDidCatch(error, errorInfo) {
|
|
153
153
|
var _this2 = this;
|
|
154
|
+
// Only report and re-render once, to avoid over-reporting errors and infinite rerendering
|
|
155
|
+
if (this.state.error) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
154
158
|
if (this.props.errorTracking) {
|
|
155
159
|
this.sendErrorData({
|
|
156
160
|
error: error,
|
|
@@ -159,13 +163,13 @@ var ErrorBoundaryWithEditorView = exports.ErrorBoundaryWithEditorView = /*#__PUR
|
|
|
159
163
|
});
|
|
160
164
|
}
|
|
161
165
|
|
|
162
|
-
//
|
|
163
|
-
//
|
|
166
|
+
// Update state to allow a re-render to attempt graceful recovery (in the event that
|
|
167
|
+
// the error was caused by a race condition or is intermittent)
|
|
164
168
|
this.setState({
|
|
165
169
|
error: error
|
|
166
170
|
}, function () {
|
|
167
171
|
if (_this2.props.rethrow) {
|
|
168
|
-
// Now that a re-render has
|
|
172
|
+
// Now that a re-render has occurred, we re-throw to allow product error boundaries
|
|
169
173
|
// to catch and handle the error too.
|
|
170
174
|
//
|
|
171
175
|
// Note that when rethrowing inside a error boundary, the stack trace
|
package/dist/cjs/index.js
CHANGED
|
@@ -172,7 +172,7 @@ var _ContextPanel = _interopRequireDefault(require("./ui/ContextPanel"));
|
|
|
172
172
|
var _resource = require("@atlaskit/emoji/resource");
|
|
173
173
|
var _resource2 = require("@atlaskit/mention/resource");
|
|
174
174
|
var _teamResource = require("@atlaskit/mention/team-resource");
|
|
175
|
-
var _annotation = require("
|
|
175
|
+
var _annotation = require("@atlaskit/editor-common/annotation");
|
|
176
176
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
177
177
|
var _utils = require("./utils");
|
|
178
178
|
var _actions = _interopRequireDefault(require("./actions"));
|
|
@@ -4,12 +4,6 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
Object.defineProperty(exports, "annotationPlugin", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: function get() {
|
|
10
|
-
return _annotation.default;
|
|
11
|
-
}
|
|
12
|
-
});
|
|
13
7
|
Object.defineProperty(exports, "avatarGroupPlugin", {
|
|
14
8
|
enumerable: true,
|
|
15
9
|
get: function get() {
|
|
@@ -62,7 +56,6 @@ var _collabEdit = _interopRequireDefault(require("./collab-edit"));
|
|
|
62
56
|
var _extension = _interopRequireDefault(require("./extension"));
|
|
63
57
|
var _jiraIssue = _interopRequireDefault(require("./jira-issue"));
|
|
64
58
|
var _paste = _interopRequireDefault(require("./paste"));
|
|
65
|
-
var _annotation = _interopRequireDefault(require("./annotation"));
|
|
66
59
|
var _feedbackDialog = _interopRequireDefault(require("./feedback-dialog"));
|
|
67
60
|
var _findReplace = _interopRequireDefault(require("./find-replace"));
|
|
68
61
|
var _avatarGroup = _interopRequireDefault(require("./avatar-group"));
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.createPlugin = createPlugin;
|
|
8
|
+
exports.isInsideBlockQuote = void 0;
|
|
8
9
|
Object.defineProperty(exports, "stateKey", {
|
|
9
10
|
enumerable: true,
|
|
10
11
|
get: function get() {
|
|
@@ -28,16 +29,18 @@ var _util = require("../util");
|
|
|
28
29
|
var _transforms = require("@atlaskit/editor-common/transforms");
|
|
29
30
|
var _handlers = require("../handlers");
|
|
30
31
|
var _analytics2 = require("./analytics");
|
|
31
|
-
var
|
|
32
|
+
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
32
33
|
var _commands = require("../commands");
|
|
33
|
-
var _utils4 = require("../../annotation/utils");
|
|
34
34
|
var _clipboardTextSerializer = require("./clipboard-text-serializer");
|
|
35
35
|
var _tinyMCE = require("../util/tinyMCE");
|
|
36
36
|
var _pluginFactory = require("./plugin-factory");
|
|
37
|
-
var
|
|
37
|
+
var _utils3 = require("@atlaskit/editor-prosemirror/utils");
|
|
38
38
|
var _actions = require("../actions");
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
var isInsideBlockQuote = exports.isInsideBlockQuote = function isInsideBlockQuote(state) {
|
|
40
|
+
var blockquote = state.schema.nodes.blockquote;
|
|
41
|
+
return (0, _utils3.hasParentNodeOfType)(blockquote)(state.selection);
|
|
42
|
+
};
|
|
43
|
+
var PASTE = 'Editor Paste Plugin Paste Duration';
|
|
41
44
|
function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pluginInjectionApi, cardOptions, sanitizePrivateContent, providerFactory) {
|
|
42
45
|
var _pluginInjectionApi$a;
|
|
43
46
|
var editorAnalyticsAPI = pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions;
|
|
@@ -180,7 +183,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
180
183
|
if (pasteTrackingEnabled) {
|
|
181
184
|
var content = (0, _analytics2.getContentNodeTypes)(slice.content);
|
|
182
185
|
var pasteId = (0, _uuid.default)();
|
|
183
|
-
var measureName = "".concat(
|
|
186
|
+
var measureName = "".concat(PASTE, "_").concat(pasteId);
|
|
184
187
|
(0, _utils.measureRender)(measureName, function (_ref) {
|
|
185
188
|
var duration = _ref.duration,
|
|
186
189
|
distortedDuration = _ref.distortedDuration;
|
|
@@ -207,7 +210,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
207
210
|
// Don't add closeHistory if we're pasting over layout columns, as we will appendTransaction
|
|
208
211
|
// to cleanup the layout's structure and we want to keep the paste and re-structuring as
|
|
209
212
|
// one event.
|
|
210
|
-
var isPastingOverLayoutColumns = (0,
|
|
213
|
+
var isPastingOverLayoutColumns = (0, _utils3.hasParentNodeOfType)(state.schema.nodes.layoutColumn)(state.selection);
|
|
211
214
|
|
|
212
215
|
// don't add closeHistory call if we're pasting a table, as some tables may involve additional
|
|
213
216
|
// appendedTransactions to repair them (if they're partial or incomplete) and we don't want
|
|
@@ -323,7 +326,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
323
326
|
}
|
|
324
327
|
return (0, _analytics2.handleMarkdownWithAnalytics)(view, event, markdownSlice, pluginInjectionApi)(state, dispatch);
|
|
325
328
|
}
|
|
326
|
-
if (isRichText &&
|
|
329
|
+
if (isRichText && isInsideBlockQuote(state)) {
|
|
327
330
|
//If pasting inside blockquote
|
|
328
331
|
//Skip the blockquote node and keep remaining nodes as they are
|
|
329
332
|
var blockquote = schema.nodes.blockquote;
|
|
@@ -370,7 +373,8 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
370
373
|
// remove annotation marks from the pasted data if they are not present in the document
|
|
371
374
|
// for the cases when they are pasted from external pages
|
|
372
375
|
if (slice.content.size && (0, _utils.containsAnyAnnotations)(slice, state)) {
|
|
373
|
-
|
|
376
|
+
var _pluginInjectionApi$a3;
|
|
377
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 || (_pluginInjectionApi$a3 = pluginInjectionApi.annotation) === null || _pluginInjectionApi$a3 === void 0 || _pluginInjectionApi$a3.actions.stripNonExistingAnnotations(slice, state);
|
|
374
378
|
}
|
|
375
379
|
|
|
376
380
|
// ED-4732
|
|
@@ -397,7 +401,7 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
397
401
|
if ((0, _analytics2.handleExpandWithAnalytics)(editorAnalyticsAPI)(view, event, slice)(state, dispatch)) {
|
|
398
402
|
return true;
|
|
399
403
|
}
|
|
400
|
-
if (!(0,
|
|
404
|
+
if (!(0, _coreUtils.insideTable)(state)) {
|
|
401
405
|
slice = (0, _transforms.transformSliceNestedExpandToExpand)(slice, state.schema);
|
|
402
406
|
}
|
|
403
407
|
|
|
@@ -25,7 +25,7 @@ var _editorPluginFloatingToolbar = require("@atlaskit/editor-plugin-floating-too
|
|
|
25
25
|
var _editorPluginClipboard = require("@atlaskit/editor-plugin-clipboard");
|
|
26
26
|
var _editorPluginAnalytics = require("@atlaskit/editor-plugin-analytics");
|
|
27
27
|
var _editorPluginPlaceholder = require("@atlaskit/editor-plugin-placeholder");
|
|
28
|
-
var
|
|
28
|
+
var _editorPluginAnnotation = require("@atlaskit/editor-plugin-annotation");
|
|
29
29
|
var _editorPluginComposition = require("@atlaskit/editor-plugin-composition");
|
|
30
30
|
var _editorPluginQuickInsert = require("@atlaskit/editor-plugin-quick-insert");
|
|
31
31
|
var _editorPluginSelection = require("@atlaskit/editor-plugin-selection");
|
|
@@ -61,7 +61,7 @@ function createDefaultPreset(options) {
|
|
|
61
61
|
return builder.add(p);
|
|
62
62
|
}
|
|
63
63
|
return builder;
|
|
64
|
-
}).add([_editorPluginBlockType.blockTypePlugin, options.blockType]).add(_editorPluginClearMarksOnEmptyDoc.clearMarksOnEmptyDocPlugin).maybeAdd(
|
|
64
|
+
}).add([_editorPluginBlockType.blockTypePlugin, options.blockType]).add(_editorPluginClearMarksOnEmptyDoc.clearMarksOnEmptyDocPlugin).maybeAdd(_editorPluginAnnotation.annotationPlugin, function (p, builder) {
|
|
65
65
|
if (options.annotationProviders) {
|
|
66
66
|
return builder.add([p, options.annotationProviders]);
|
|
67
67
|
}
|
|
@@ -46,6 +46,7 @@ var _editorPluginToolbarListsIndentation = require("@atlaskit/editor-plugin-tool
|
|
|
46
46
|
var _editorPluginCustomAutoformat = require("@atlaskit/editor-plugin-custom-autoformat");
|
|
47
47
|
var _editorPluginAlignment = require("@atlaskit/editor-plugin-alignment");
|
|
48
48
|
var _editorPluginDataConsumer = require("@atlaskit/editor-plugin-data-consumer");
|
|
49
|
+
var _editorPluginAnnotation = require("@atlaskit/editor-plugin-annotation");
|
|
49
50
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
50
51
|
var _plugins = require("../plugins");
|
|
51
52
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
@@ -283,7 +284,7 @@ function createUniversalPreset(appearance, props, featureFlags, prevAppearance,
|
|
|
283
284
|
}]);
|
|
284
285
|
}
|
|
285
286
|
return builder;
|
|
286
|
-
}).maybeAdd(
|
|
287
|
+
}).maybeAdd(_editorPluginAnnotation.annotationPlugin, function (plugin, builder) {
|
|
287
288
|
// See default list for when adding annotations with a provider
|
|
288
289
|
if (!props.annotationProviders && props.allowConfluenceInlineComment) {
|
|
289
290
|
return builder.add([plugin, undefined]);
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -13,7 +13,7 @@ Object.defineProperty(exports, "SetAttrsStep", {
|
|
|
13
13
|
Object.defineProperty(exports, "checkNodeDown", {
|
|
14
14
|
enumerable: true,
|
|
15
15
|
get: function get() {
|
|
16
|
-
return
|
|
16
|
+
return _utils.checkNodeDown;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "getNodesCount", {
|
|
@@ -32,32 +32,31 @@ Object.defineProperty(exports, "insideTable", {
|
|
|
32
32
|
Object.defineProperty(exports, "insideTableCell", {
|
|
33
33
|
enumerable: true,
|
|
34
34
|
get: function get() {
|
|
35
|
-
return
|
|
35
|
+
return _utils.insideTableCell;
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
38
|
Object.defineProperty(exports, "isElementInTableCell", {
|
|
39
39
|
enumerable: true,
|
|
40
40
|
get: function get() {
|
|
41
|
-
return
|
|
41
|
+
return _utils.isElementInTableCell;
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "isEmptyNode", {
|
|
45
45
|
enumerable: true,
|
|
46
46
|
get: function get() {
|
|
47
|
-
return
|
|
47
|
+
return _utils.isEmptyNode;
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
50
|
Object.defineProperty(exports, "isInListItem", {
|
|
51
51
|
enumerable: true,
|
|
52
52
|
get: function get() {
|
|
53
|
-
return
|
|
53
|
+
return _utils.isInListItem;
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
|
-
exports.isInsideBlockQuote = void 0;
|
|
57
56
|
Object.defineProperty(exports, "isLastItemMediaGroup", {
|
|
58
57
|
enumerable: true,
|
|
59
58
|
get: function get() {
|
|
60
|
-
return
|
|
59
|
+
return _utils.isLastItemMediaGroup;
|
|
61
60
|
}
|
|
62
61
|
});
|
|
63
62
|
Object.defineProperty(exports, "isLinkMark", {
|
|
@@ -76,7 +75,7 @@ Object.defineProperty(exports, "isParagraph", {
|
|
|
76
75
|
Object.defineProperty(exports, "isSelectionInsideLastNodeInDocument", {
|
|
77
76
|
enumerable: true,
|
|
78
77
|
get: function get() {
|
|
79
|
-
return
|
|
78
|
+
return _utils.isSelectionInsideLastNodeInDocument;
|
|
80
79
|
}
|
|
81
80
|
});
|
|
82
81
|
exports.isTemporary = void 0;
|
|
@@ -89,7 +88,7 @@ Object.defineProperty(exports, "isText", {
|
|
|
89
88
|
Object.defineProperty(exports, "isTextSelection", {
|
|
90
89
|
enumerable: true,
|
|
91
90
|
get: function get() {
|
|
92
|
-
return
|
|
91
|
+
return _utils.isTextSelection;
|
|
93
92
|
}
|
|
94
93
|
});
|
|
95
94
|
Object.defineProperty(exports, "measurements", {
|
|
@@ -101,7 +100,7 @@ Object.defineProperty(exports, "measurements", {
|
|
|
101
100
|
Object.defineProperty(exports, "nodeToJSON", {
|
|
102
101
|
enumerable: true,
|
|
103
102
|
get: function get() {
|
|
104
|
-
return
|
|
103
|
+
return _utils.nodeToJSON;
|
|
105
104
|
}
|
|
106
105
|
});
|
|
107
106
|
Object.defineProperty(exports, "nodesBetweenChanged", {
|
|
@@ -113,7 +112,7 @@ Object.defineProperty(exports, "nodesBetweenChanged", {
|
|
|
113
112
|
Object.defineProperty(exports, "nonNullable", {
|
|
114
113
|
enumerable: true,
|
|
115
114
|
get: function get() {
|
|
116
|
-
return
|
|
115
|
+
return _utils.nonNullable;
|
|
117
116
|
}
|
|
118
117
|
});
|
|
119
118
|
Object.defineProperty(exports, "setNodeSelection", {
|
|
@@ -133,13 +132,12 @@ exports.sum = sum;
|
|
|
133
132
|
Object.defineProperty(exports, "toJSON", {
|
|
134
133
|
enumerable: true,
|
|
135
134
|
get: function get() {
|
|
136
|
-
return
|
|
135
|
+
return _utils.toJSON;
|
|
137
136
|
}
|
|
138
137
|
});
|
|
139
138
|
exports.whichTransitionEvent = whichTransitionEvent;
|
|
140
139
|
var _commands = require("@atlaskit/editor-prosemirror/commands");
|
|
141
|
-
var _utils = require("@atlaskit/editor-
|
|
142
|
-
var _utils2 = require("@atlaskit/editor-common/utils");
|
|
140
|
+
var _utils = require("@atlaskit/editor-common/utils");
|
|
143
141
|
var _coreUtils = require("@atlaskit/editor-common/core-utils");
|
|
144
142
|
var _document = require("./document");
|
|
145
143
|
var _nodes = require("./nodes");
|
|
@@ -234,10 +232,6 @@ var isTemporary = exports.isTemporary = function isTemporary(id) {
|
|
|
234
232
|
var hasOpenEnd = exports.hasOpenEnd = function hasOpenEnd(slice) {
|
|
235
233
|
return slice.openStart > 0 || slice.openEnd > 0;
|
|
236
234
|
};
|
|
237
|
-
var isInsideBlockQuote = exports.isInsideBlockQuote = function isInsideBlockQuote(state) {
|
|
238
|
-
var blockquote = state.schema.nodes.blockquote;
|
|
239
|
-
return (0, _utils.hasParentNodeOfType)(blockquote)(state.selection);
|
|
240
|
-
};
|
|
241
235
|
function sum(arr, f) {
|
|
242
236
|
return arr.reduce(function (val, x) {
|
|
243
237
|
return val + f(x);
|
|
@@ -8,6 +8,5 @@ var _default = exports.default = {
|
|
|
8
8
|
EDITOR_MOUNTED: 'Editor Component Mount Time',
|
|
9
9
|
PROSEMIRROR_RENDERED: 'ProseMirror Render Time',
|
|
10
10
|
PROSEMIRROR_CONTENT_RENDERED: 'ProseMirror Content Render Time',
|
|
11
|
-
ON_EDITOR_READY_CALLBACK: 'onEditorReady Callback Duration'
|
|
12
|
-
PASTE: 'Editor Paste Plugin Paste Duration'
|
|
11
|
+
ON_EDITOR_READY_CALLBACK: 'onEditorReady Callback Duration'
|
|
13
12
|
};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import uuid from 'uuid';
|
|
4
|
+
import { ACTION, ACTION_SUBJECT, editorAnalyticsChannel, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
5
|
+
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
4
6
|
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
5
7
|
import { IntlErrorBoundary } from '@atlaskit/editor-common/ui';
|
|
6
|
-
import { sniffUserBrowserExtensions } from '@atlaskit/editor-common/utils';
|
|
7
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, editorAnalyticsChannel } from '@atlaskit/editor-common/analytics';
|
|
8
|
+
import { isOutdatedBrowser, sniffUserBrowserExtensions } from '@atlaskit/editor-common/utils';
|
|
8
9
|
import { getDocStructure } from '../utils/document-logger';
|
|
9
10
|
import { WithEditorView } from './WithEditorView';
|
|
10
|
-
import { isOutdatedBrowser } from '@atlaskit/editor-common/utils';
|
|
11
|
-
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
12
11
|
export class ErrorBoundaryWithEditorView extends React.Component {
|
|
13
12
|
constructor(props) {
|
|
14
13
|
super(props);
|
|
@@ -99,6 +98,10 @@ export class ErrorBoundaryWithEditorView extends React.Component {
|
|
|
99
98
|
}
|
|
100
99
|
}
|
|
101
100
|
componentDidCatch(error, errorInfo) {
|
|
101
|
+
// Only report and re-render once, to avoid over-reporting errors and infinite rerendering
|
|
102
|
+
if (this.state.error) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
102
105
|
if (this.props.errorTracking) {
|
|
103
106
|
this.sendErrorData({
|
|
104
107
|
error,
|
|
@@ -107,13 +110,13 @@ export class ErrorBoundaryWithEditorView extends React.Component {
|
|
|
107
110
|
});
|
|
108
111
|
}
|
|
109
112
|
|
|
110
|
-
//
|
|
111
|
-
//
|
|
113
|
+
// Update state to allow a re-render to attempt graceful recovery (in the event that
|
|
114
|
+
// the error was caused by a race condition or is intermittent)
|
|
112
115
|
this.setState({
|
|
113
116
|
error
|
|
114
117
|
}, () => {
|
|
115
118
|
if (this.props.rethrow) {
|
|
116
|
-
// Now that a re-render has
|
|
119
|
+
// Now that a re-render has occurred, we re-throw to allow product error boundaries
|
|
117
120
|
// to catch and handle the error too.
|
|
118
121
|
//
|
|
119
122
|
// Note that when rethrowing inside a error boundary, the stack trace
|
package/dist/es2019/index.js
CHANGED
|
@@ -11,7 +11,20 @@ export { default as ContextPanel } from './ui/ContextPanel';
|
|
|
11
11
|
export { EmojiResource } from '@atlaskit/emoji/resource';
|
|
12
12
|
export { MentionResource } from '@atlaskit/mention/resource';
|
|
13
13
|
export { TeamMentionResource } from '@atlaskit/mention/team-resource';
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated
|
|
16
|
+
* DO NOT USE THIS WILL BE REMOVED SOON AND IS UNSAFE.
|
|
17
|
+
* This is here while we work to extract the annotation plugin.
|
|
18
|
+
* Please use the export from `@atlaskit/editor-common/annotation`.
|
|
19
|
+
*/
|
|
20
|
+
export { AnnotationUpdateEmitter } from '@atlaskit/editor-common/annotation';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated
|
|
24
|
+
* DO NOT USE THIS WILL BE REMOVED SOON AND IS UNSAFE.
|
|
25
|
+
* This is here while we work to extract the annotation plugin.
|
|
26
|
+
* Please use the export from `@atlaskit/editor-plugin-annotation`.
|
|
27
|
+
*/
|
|
15
28
|
|
|
16
29
|
// Used in mobile bridge
|
|
17
30
|
|
|
@@ -2,7 +2,6 @@ export { default as collabEditPlugin } from './collab-edit';
|
|
|
2
2
|
export { default as extensionPlugin } from './extension';
|
|
3
3
|
export { default as jiraIssuePlugin } from './jira-issue';
|
|
4
4
|
export { default as pastePlugin } from './paste';
|
|
5
|
-
export { default as annotationPlugin } from './annotation';
|
|
6
5
|
export { default as feedbackDialogPlugin } from './feedback-dialog';
|
|
7
6
|
export { default as findReplacePlugin } from './find-replace';
|
|
8
7
|
export { default as avatarGroupPlugin } from './avatar-group';
|
|
@@ -13,16 +13,21 @@ import { escapeLinks, htmlContainsSingleFile, isPastedFromWord, isPastedFromExce
|
|
|
13
13
|
import { transformSliceNestedExpandToExpand, transformSliceToJoinAdjacentCodeBlocks, transformSingleLineCodeBlockToCodeMark, transformSliceToDecisionList } from '@atlaskit/editor-common/transforms';
|
|
14
14
|
import { handleMacroAutoConvert, handleMention, handleParagraphBlockMarks } from '../handlers';
|
|
15
15
|
import { createPasteMeasurePayload, getContentNodeTypes, handlePasteAsPlainTextWithAnalytics, handlePasteIntoTaskAndDecisionWithAnalytics, handleCodeBlockWithAnalytics, handleMediaSingleWithAnalytics, handlePastePreservingMarksWithAnalytics, handleMarkdownWithAnalytics, handleRichTextWithAnalytics, handleExpandWithAnalytics, handleSelectedTableWithAnalytics, handlePasteLinkOnSelectedTextWithAnalytics, sendPasteAnalyticsEvent, handlePasteIntoCaptionWithAnalytics, handlePastePanelOrDecisionIntoListWithAnalytics, handlePasteNonNestableBlockNodesIntoListWithAnalytics } from './analytics';
|
|
16
|
-
import {
|
|
16
|
+
import { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
17
17
|
import { upgradeTextToLists, splitParagraphs } from '../commands';
|
|
18
|
-
// TODO: ED-20519 It requires annotation extraction to use the plugin injection API
|
|
19
|
-
import { stripNonExistingAnnotations } from '../../annotation/utils';
|
|
20
18
|
import { clipboardTextSerializer } from './clipboard-text-serializer';
|
|
21
19
|
import { htmlHasIncompleteTable, tryRebuildCompleteTableHtml, isPastedFromTinyMCEConfluence } from '../util/tinyMCE';
|
|
22
20
|
import { pluginKey as stateKey, createPluginState } from './plugin-factory';
|
|
23
21
|
export { pluginKey as stateKey } from './plugin-factory';
|
|
24
22
|
import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
25
23
|
import { PastePluginActionTypes } from '../actions';
|
|
24
|
+
export const isInsideBlockQuote = state => {
|
|
25
|
+
const {
|
|
26
|
+
blockquote
|
|
27
|
+
} = state.schema.nodes;
|
|
28
|
+
return hasParentNodeOfType(blockquote)(state.selection);
|
|
29
|
+
};
|
|
30
|
+
const PASTE = 'Editor Paste Plugin Paste Duration';
|
|
26
31
|
export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pluginInjectionApi, cardOptions, sanitizePrivateContent, providerFactory) {
|
|
27
32
|
var _pluginInjectionApi$a;
|
|
28
33
|
const editorAnalyticsAPI = pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a = pluginInjectionApi.analytics) === null || _pluginInjectionApi$a === void 0 ? void 0 : _pluginInjectionApi$a.actions;
|
|
@@ -144,7 +149,7 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
144
149
|
if (pasteTrackingEnabled) {
|
|
145
150
|
const content = getContentNodeTypes(slice.content);
|
|
146
151
|
const pasteId = uuid();
|
|
147
|
-
const measureName = `${
|
|
152
|
+
const measureName = `${PASTE}_${pasteId}`;
|
|
148
153
|
measureRender(measureName, ({
|
|
149
154
|
duration,
|
|
150
155
|
distortedDuration
|
|
@@ -339,7 +344,8 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
339
344
|
// remove annotation marks from the pasted data if they are not present in the document
|
|
340
345
|
// for the cases when they are pasted from external pages
|
|
341
346
|
if (slice.content.size && containsAnyAnnotations(slice, state)) {
|
|
342
|
-
|
|
347
|
+
var _pluginInjectionApi$a4;
|
|
348
|
+
pluginInjectionApi === null || pluginInjectionApi === void 0 ? void 0 : (_pluginInjectionApi$a4 = pluginInjectionApi.annotation) === null || _pluginInjectionApi$a4 === void 0 ? void 0 : _pluginInjectionApi$a4.actions.stripNonExistingAnnotations(slice, state);
|
|
343
349
|
}
|
|
344
350
|
|
|
345
351
|
// ED-4732
|
|
@@ -19,7 +19,7 @@ import { floatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar'
|
|
|
19
19
|
import { clipboardPlugin } from '@atlaskit/editor-plugin-clipboard';
|
|
20
20
|
import { analyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
21
21
|
import { placeholderPlugin } from '@atlaskit/editor-plugin-placeholder';
|
|
22
|
-
import annotationPlugin from '
|
|
22
|
+
import { annotationPlugin } from '@atlaskit/editor-plugin-annotation';
|
|
23
23
|
import { compositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
24
24
|
import { quickInsertPlugin } from '@atlaskit/editor-plugin-quick-insert';
|
|
25
25
|
import { selectionPlugin } from '@atlaskit/editor-plugin-selection';
|
|
@@ -36,8 +36,9 @@ import { toolbarListsIndentationPlugin } from '@atlaskit/editor-plugin-toolbar-l
|
|
|
36
36
|
import { customAutoformatPlugin } from '@atlaskit/editor-plugin-custom-autoformat';
|
|
37
37
|
import { alignmentPlugin } from '@atlaskit/editor-plugin-alignment';
|
|
38
38
|
import { dataConsumerPlugin } from '@atlaskit/editor-plugin-data-consumer';
|
|
39
|
+
import { annotationPlugin } from '@atlaskit/editor-plugin-annotation';
|
|
39
40
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
40
|
-
import {
|
|
41
|
+
import { avatarGroupPlugin, beforePrimaryToolbarPlugin, collabEditPlugin, extensionPlugin, feedbackDialogPlugin, findReplacePlugin, jiraIssuePlugin } from '../plugins';
|
|
41
42
|
import { shouldForceTracking } from '@atlaskit/editor-common/utils';
|
|
42
43
|
import { isFullPage as fullPageCheck } from '../utils/is-full-page';
|
|
43
44
|
import { createDefaultPreset } from './default';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { toggleMark } from '@atlaskit/editor-prosemirror/commands';
|
|
2
|
-
import { hasParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
3
2
|
export { isEmptyNode, isSelectionInsideLastNodeInDocument, checkNodeDown, insideTableCell, isInListItem, toJSON, nodeToJSON } from '@atlaskit/editor-common/utils';
|
|
4
3
|
export { insideTable } from '@atlaskit/editor-common/core-utils';
|
|
5
4
|
export { nodesBetweenChanged, getNodesCount } from './document';
|
|
@@ -94,12 +93,6 @@ export const isTemporary = id => {
|
|
|
94
93
|
export const hasOpenEnd = slice => {
|
|
95
94
|
return slice.openStart > 0 || slice.openEnd > 0;
|
|
96
95
|
};
|
|
97
|
-
export const isInsideBlockQuote = state => {
|
|
98
|
-
const {
|
|
99
|
-
blockquote
|
|
100
|
-
} = state.schema.nodes;
|
|
101
|
-
return hasParentNodeOfType(blockquote)(state.selection);
|
|
102
|
-
};
|
|
103
96
|
export { isTextSelection, isElementInTableCell, isLastItemMediaGroup, nonNullable } from '@atlaskit/editor-common/utils';
|
|
104
97
|
export function sum(arr, f) {
|
|
105
98
|
return arr.reduce((val, x) => val + f(x), 0);
|
|
@@ -2,6 +2,5 @@ export default {
|
|
|
2
2
|
EDITOR_MOUNTED: 'Editor Component Mount Time',
|
|
3
3
|
PROSEMIRROR_RENDERED: 'ProseMirror Render Time',
|
|
4
4
|
PROSEMIRROR_CONTENT_RENDERED: 'ProseMirror Content Render Time',
|
|
5
|
-
ON_EDITOR_READY_CALLBACK: 'onEditorReady Callback Duration'
|
|
6
|
-
PASTE: 'Editor Paste Plugin Paste Duration'
|
|
5
|
+
ON_EDITOR_READY_CALLBACK: 'onEditorReady Callback Duration'
|
|
7
6
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "190.1.
|
|
2
|
+
export const version = "190.1.23";
|
|
@@ -13,14 +13,13 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
|
|
|
13
13
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
14
14
|
import React from 'react';
|
|
15
15
|
import uuid from 'uuid';
|
|
16
|
+
import { ACTION, ACTION_SUBJECT, editorAnalyticsChannel, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
17
|
+
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
16
18
|
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
17
19
|
import { IntlErrorBoundary } from '@atlaskit/editor-common/ui';
|
|
18
|
-
import { sniffUserBrowserExtensions } from '@atlaskit/editor-common/utils';
|
|
19
|
-
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, editorAnalyticsChannel } from '@atlaskit/editor-common/analytics';
|
|
20
|
+
import { isOutdatedBrowser, sniffUserBrowserExtensions } from '@atlaskit/editor-common/utils';
|
|
20
21
|
import { getDocStructure } from '../utils/document-logger';
|
|
21
22
|
import { WithEditorView } from './WithEditorView';
|
|
22
|
-
import { isOutdatedBrowser } from '@atlaskit/editor-common/utils';
|
|
23
|
-
import { logException } from '@atlaskit/editor-common/monitoring';
|
|
24
23
|
export var ErrorBoundaryWithEditorView = /*#__PURE__*/function (_React$Component) {
|
|
25
24
|
_inherits(ErrorBoundaryWithEditorView, _React$Component);
|
|
26
25
|
var _super = _createSuper(ErrorBoundaryWithEditorView);
|
|
@@ -145,6 +144,10 @@ export var ErrorBoundaryWithEditorView = /*#__PURE__*/function (_React$Component
|
|
|
145
144
|
key: "componentDidCatch",
|
|
146
145
|
value: function componentDidCatch(error, errorInfo) {
|
|
147
146
|
var _this2 = this;
|
|
147
|
+
// Only report and re-render once, to avoid over-reporting errors and infinite rerendering
|
|
148
|
+
if (this.state.error) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
148
151
|
if (this.props.errorTracking) {
|
|
149
152
|
this.sendErrorData({
|
|
150
153
|
error: error,
|
|
@@ -153,13 +156,13 @@ export var ErrorBoundaryWithEditorView = /*#__PURE__*/function (_React$Component
|
|
|
153
156
|
});
|
|
154
157
|
}
|
|
155
158
|
|
|
156
|
-
//
|
|
157
|
-
//
|
|
159
|
+
// Update state to allow a re-render to attempt graceful recovery (in the event that
|
|
160
|
+
// the error was caused by a race condition or is intermittent)
|
|
158
161
|
this.setState({
|
|
159
162
|
error: error
|
|
160
163
|
}, function () {
|
|
161
164
|
if (_this2.props.rethrow) {
|
|
162
|
-
// Now that a re-render has
|
|
165
|
+
// Now that a re-render has occurred, we re-throw to allow product error boundaries
|
|
163
166
|
// to catch and handle the error too.
|
|
164
167
|
//
|
|
165
168
|
// Note that when rethrowing inside a error boundary, the stack trace
|
package/dist/esm/index.js
CHANGED
|
@@ -11,7 +11,20 @@ export { default as ContextPanel } from './ui/ContextPanel';
|
|
|
11
11
|
export { EmojiResource } from '@atlaskit/emoji/resource';
|
|
12
12
|
export { MentionResource } from '@atlaskit/mention/resource';
|
|
13
13
|
export { TeamMentionResource } from '@atlaskit/mention/team-resource';
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated
|
|
16
|
+
* DO NOT USE THIS WILL BE REMOVED SOON AND IS UNSAFE.
|
|
17
|
+
* This is here while we work to extract the annotation plugin.
|
|
18
|
+
* Please use the export from `@atlaskit/editor-common/annotation`.
|
|
19
|
+
*/
|
|
20
|
+
export { AnnotationUpdateEmitter } from '@atlaskit/editor-common/annotation';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated
|
|
24
|
+
* DO NOT USE THIS WILL BE REMOVED SOON AND IS UNSAFE.
|
|
25
|
+
* This is here while we work to extract the annotation plugin.
|
|
26
|
+
* Please use the export from `@atlaskit/editor-plugin-annotation`.
|
|
27
|
+
*/
|
|
15
28
|
|
|
16
29
|
// Used in mobile bridge
|
|
17
30
|
|
|
@@ -2,7 +2,6 @@ export { default as collabEditPlugin } from './collab-edit';
|
|
|
2
2
|
export { default as extensionPlugin } from './extension';
|
|
3
3
|
export { default as jiraIssuePlugin } from './jira-issue';
|
|
4
4
|
export { default as pastePlugin } from './paste';
|
|
5
|
-
export { default as annotationPlugin } from './annotation';
|
|
6
5
|
export { default as feedbackDialogPlugin } from './feedback-dialog';
|
|
7
6
|
export { default as findReplacePlugin } from './find-replace';
|
|
8
7
|
export { default as avatarGroupPlugin } from './avatar-group';
|