@atlaskit/editor-common 110.36.7 → 110.37.0
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 +22 -0
- package/dist/cjs/messages/context-panel.js +5 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/preset/core-plugin/index.js +14 -4
- package/dist/cjs/preset/core-plugin/requestDocument.js +12 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/commands.js +2 -2
- package/dist/es2019/messages/context-panel.js +5 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/preset/core-plugin/index.js +15 -5
- package/dist/es2019/preset/core-plugin/requestDocument.js +11 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/commands.js +2 -2
- package/dist/esm/messages/context-panel.js +5 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/preset/core-plugin/index.js +15 -5
- package/dist/esm/preset/core-plugin/requestDocument.js +11 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/commands.js +2 -2
- package/dist/types/messages/context-panel.d.ts +5 -0
- package/dist/types/preset/core-plugin/requestDocument.d.ts +1 -0
- package/dist/types/types/next-editor-plugin.d.ts +13 -0
- package/dist/types-ts4.5/messages/context-panel.d.ts +5 -0
- package/dist/types-ts4.5/preset/core-plugin/requestDocument.d.ts +1 -0
- package/dist/types-ts4.5/types/next-editor-plugin.d.ts +13 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 110.37.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`68206f30ef7be`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/68206f30ef7be) -
|
|
8
|
+
EDITOR-3577 - Pass doc and selection as additional context for comment when editing page
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 110.36.8
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`00c08e3995cb2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/00c08e3995cb2) -
|
|
19
|
+
Clean up platform_editor_block_menu_empty_line
|
|
20
|
+
- [`32da92aaf953d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/32da92aaf953d) -
|
|
21
|
+
Fix scrollable-region-focusable accessibility violation by adding tabIndex to context panel
|
|
22
|
+
content
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
|
|
3
25
|
## 110.36.7
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -10,5 +10,10 @@ var contextPanelMessages = exports.contextPanelMessages = (0, _reactIntlNext.def
|
|
|
10
10
|
id: 'fabric.editor.contextPanel.panelLabel',
|
|
11
11
|
defaultMessage: 'Context panel',
|
|
12
12
|
description: 'Label for the context panel'
|
|
13
|
+
},
|
|
14
|
+
panelContentLabel: {
|
|
15
|
+
id: 'fabric.editor.contextPanel.panelContentLabel',
|
|
16
|
+
defaultMessage: 'Scrollable context panel content',
|
|
17
|
+
description: 'Label for the context panel content'
|
|
13
18
|
}
|
|
14
19
|
});
|
|
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
19
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
20
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
21
21
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
22
|
-
var packageVersion = "
|
|
22
|
+
var packageVersion = "110.36.8";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -18,6 +18,7 @@ var corePlugin = exports.corePlugin = function corePlugin(_ref) {
|
|
|
18
18
|
var config = _ref.config;
|
|
19
19
|
// Create the document request throttler per editor (rather than at a module level)
|
|
20
20
|
var scheduleDocumentRequest = (0, _requestDocument.createThrottleSchedule)(_requestDocument.returnDocumentRequest);
|
|
21
|
+
var scheduleDocumentRequestNoThrowError = (0, _requestDocument.createThrottleSchedule)(_requestDocument.returnDocumentRequestNoThrowError);
|
|
21
22
|
return {
|
|
22
23
|
name: 'core',
|
|
23
24
|
getSharedState: function getSharedState(state) {
|
|
@@ -122,17 +123,26 @@ var corePlugin = exports.corePlugin = function corePlugin(_ref) {
|
|
|
122
123
|
var view = (_config$getEditorView = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView !== void 0 ? _config$getEditorView : null;
|
|
123
124
|
scheduleDocumentRequest(view, onReceive, options === null || options === void 0 ? void 0 : options.transformer, config === null || config === void 0 ? void 0 : config.fireAnalyticsEvent, options === null || options === void 0 ? void 0 : options.alwaysFire);
|
|
124
125
|
},
|
|
126
|
+
requestDocumentAsync: function requestDocumentAsync(options) {
|
|
127
|
+
return new Promise(function (resolve) {
|
|
128
|
+
var _config$getEditorView2;
|
|
129
|
+
var view = (_config$getEditorView2 = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView2 !== void 0 ? _config$getEditorView2 : null;
|
|
130
|
+
scheduleDocumentRequestNoThrowError(view, function (doc) {
|
|
131
|
+
resolve(doc);
|
|
132
|
+
}, options === null || options === void 0 ? void 0 : options.transformer, config === null || config === void 0 ? void 0 : config.fireAnalyticsEvent, true);
|
|
133
|
+
});
|
|
134
|
+
},
|
|
125
135
|
createTransformer: function createTransformer(cb) {
|
|
126
|
-
var _config$
|
|
127
|
-
var view = (_config$
|
|
136
|
+
var _config$getEditorView3;
|
|
137
|
+
var view = (_config$getEditorView3 = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView3 !== void 0 ? _config$getEditorView3 : null;
|
|
128
138
|
if (!(view !== null && view !== void 0 && view.state.schema)) {
|
|
129
139
|
return undefined;
|
|
130
140
|
}
|
|
131
141
|
return cb(view === null || view === void 0 ? void 0 : view.state.schema);
|
|
132
142
|
},
|
|
133
143
|
getAnchorIdForNode: function getAnchorIdForNode(node, pos) {
|
|
134
|
-
var _config$
|
|
135
|
-
var view = (_config$
|
|
144
|
+
var _config$getEditorView4;
|
|
145
|
+
var view = (_config$getEditorView4 = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView4 !== void 0 ? _config$getEditorView4 : null;
|
|
136
146
|
if (!view) {
|
|
137
147
|
return undefined;
|
|
138
148
|
}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.createThrottleSchedule = createThrottleSchedule;
|
|
8
8
|
exports.returnDocumentRequest = returnDocumentRequest;
|
|
9
|
+
exports.returnDocumentRequestNoThrowError = returnDocumentRequestNoThrowError;
|
|
9
10
|
exports.toJSON = toJSON;
|
|
10
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
12
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -69,7 +70,9 @@ function createThrottleSchedule(callback) {
|
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
72
|
-
function returnDocumentRequest(editorView, callback, transformer, fireAnalyticsEvent,
|
|
73
|
+
function returnDocumentRequest(editorView, callback, transformer, fireAnalyticsEvent,
|
|
74
|
+
// eslint-disable-next-line no-unused-vars
|
|
75
|
+
_alwaysFire) {
|
|
73
76
|
var _editorView$state;
|
|
74
77
|
var _ref = (_editorView$state = editorView === null || editorView === void 0 ? void 0 : editorView.state) !== null && _editorView$state !== void 0 ? _editorView$state : {},
|
|
75
78
|
doc = _ref.doc,
|
|
@@ -98,4 +101,12 @@ function returnDocumentRequest(editorView, callback, transformer, fireAnalyticsE
|
|
|
98
101
|
});
|
|
99
102
|
throw e;
|
|
100
103
|
}
|
|
104
|
+
}
|
|
105
|
+
function returnDocumentRequestNoThrowError(editorView, callback, transformer, fireAnalyticsEvent, _alwaysFire) {
|
|
106
|
+
try {
|
|
107
|
+
return returnDocumentRequest(editorView, callback, transformer, fireAnalyticsEvent, _alwaysFire);
|
|
108
|
+
// eslint-disable-next-line no-unused-vars
|
|
109
|
+
} catch (_) {
|
|
110
|
+
callback(undefined);
|
|
111
|
+
}
|
|
101
112
|
}
|
|
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
24
24
|
* @jsx jsx
|
|
25
25
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "
|
|
27
|
+
var packageVersion = "110.36.8";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -193,7 +193,7 @@ function canMoveUp(state) {
|
|
|
193
193
|
if (selection instanceof _state.NodeSelection && (0, _nodes.isMediaNode)(selection.node)) {
|
|
194
194
|
return true;
|
|
195
195
|
}
|
|
196
|
-
if (selection instanceof _state.TextSelection && !(
|
|
196
|
+
if (selection instanceof _state.TextSelection && !(0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) {
|
|
197
197
|
if (!selection.empty) {
|
|
198
198
|
return true;
|
|
199
199
|
}
|
|
@@ -209,7 +209,7 @@ function canMoveDown(state) {
|
|
|
209
209
|
if (selection instanceof _state.NodeSelection && (0, _nodes.isMediaNode)(selection.node)) {
|
|
210
210
|
return true;
|
|
211
211
|
}
|
|
212
|
-
if (selection instanceof _state.TextSelection && !(
|
|
212
|
+
if (selection instanceof _state.TextSelection && !(0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) {
|
|
213
213
|
if (!selection.empty) {
|
|
214
214
|
return true;
|
|
215
215
|
}
|
|
@@ -4,5 +4,10 @@ export const contextPanelMessages = defineMessages({
|
|
|
4
4
|
id: 'fabric.editor.contextPanel.panelLabel',
|
|
5
5
|
defaultMessage: 'Context panel',
|
|
6
6
|
description: 'Label for the context panel'
|
|
7
|
+
},
|
|
8
|
+
panelContentLabel: {
|
|
9
|
+
id: 'fabric.editor.contextPanel.panelContentLabel',
|
|
10
|
+
defaultMessage: 'Scrollable context panel content',
|
|
11
|
+
description: 'Label for the context panel content'
|
|
7
12
|
}
|
|
8
13
|
});
|
|
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
|
|
|
4
4
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
5
5
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
6
6
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
7
|
-
const packageVersion = "
|
|
7
|
+
const packageVersion = "110.36.8";
|
|
8
8
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
9
9
|
// Remove URL as it has UGC
|
|
10
10
|
// Ignored via go/ees007
|
|
@@ -3,7 +3,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
3
3
|
import { getNodeIdProvider } from '../../node-anchor/node-anchor-provider';
|
|
4
4
|
import { processRawFragmentValue, processRawValue, processRawValueWithoutValidation } from '../../utils/processRawValue';
|
|
5
5
|
import { editorCommandToPMCommand } from '../editor-commands';
|
|
6
|
-
import { createThrottleSchedule, returnDocumentRequest } from './requestDocument';
|
|
6
|
+
import { createThrottleSchedule, returnDocumentRequest, returnDocumentRequestNoThrowError } from './requestDocument';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Core plugin that is always included in the preset.
|
|
@@ -14,6 +14,7 @@ export const corePlugin = ({
|
|
|
14
14
|
}) => {
|
|
15
15
|
// Create the document request throttler per editor (rather than at a module level)
|
|
16
16
|
const scheduleDocumentRequest = createThrottleSchedule(returnDocumentRequest);
|
|
17
|
+
const scheduleDocumentRequestNoThrowError = createThrottleSchedule(returnDocumentRequestNoThrowError);
|
|
17
18
|
return {
|
|
18
19
|
name: 'core',
|
|
19
20
|
getSharedState(state) {
|
|
@@ -124,17 +125,26 @@ export const corePlugin = ({
|
|
|
124
125
|
const view = (_config$getEditorView = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView !== void 0 ? _config$getEditorView : null;
|
|
125
126
|
scheduleDocumentRequest(view, onReceive, options === null || options === void 0 ? void 0 : options.transformer, config === null || config === void 0 ? void 0 : config.fireAnalyticsEvent, options === null || options === void 0 ? void 0 : options.alwaysFire);
|
|
126
127
|
},
|
|
128
|
+
requestDocumentAsync: options => {
|
|
129
|
+
return new Promise(resolve => {
|
|
130
|
+
var _config$getEditorView2;
|
|
131
|
+
const view = (_config$getEditorView2 = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView2 !== void 0 ? _config$getEditorView2 : null;
|
|
132
|
+
scheduleDocumentRequestNoThrowError(view, doc => {
|
|
133
|
+
resolve(doc);
|
|
134
|
+
}, options === null || options === void 0 ? void 0 : options.transformer, config === null || config === void 0 ? void 0 : config.fireAnalyticsEvent, true);
|
|
135
|
+
});
|
|
136
|
+
},
|
|
127
137
|
createTransformer(cb) {
|
|
128
|
-
var _config$
|
|
129
|
-
const view = (_config$
|
|
138
|
+
var _config$getEditorView3;
|
|
139
|
+
const view = (_config$getEditorView3 = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView3 !== void 0 ? _config$getEditorView3 : null;
|
|
130
140
|
if (!(view !== null && view !== void 0 && view.state.schema)) {
|
|
131
141
|
return undefined;
|
|
132
142
|
}
|
|
133
143
|
return cb(view === null || view === void 0 ? void 0 : view.state.schema);
|
|
134
144
|
},
|
|
135
145
|
getAnchorIdForNode(node, pos) {
|
|
136
|
-
var _config$
|
|
137
|
-
const view = (_config$
|
|
146
|
+
var _config$getEditorView4;
|
|
147
|
+
const view = (_config$getEditorView4 = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView4 !== void 0 ? _config$getEditorView4 : null;
|
|
138
148
|
if (!view) {
|
|
139
149
|
return undefined;
|
|
140
150
|
}
|
|
@@ -50,7 +50,9 @@ export function createThrottleSchedule(callback) {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
53
|
-
export function returnDocumentRequest(editorView, callback, transformer, fireAnalyticsEvent,
|
|
53
|
+
export function returnDocumentRequest(editorView, callback, transformer, fireAnalyticsEvent,
|
|
54
|
+
// eslint-disable-next-line no-unused-vars
|
|
55
|
+
_alwaysFire) {
|
|
54
56
|
var _editorView$state;
|
|
55
57
|
const {
|
|
56
58
|
doc,
|
|
@@ -80,4 +82,12 @@ export function returnDocumentRequest(editorView, callback, transformer, fireAna
|
|
|
80
82
|
});
|
|
81
83
|
throw e;
|
|
82
84
|
}
|
|
85
|
+
}
|
|
86
|
+
export function returnDocumentRequestNoThrowError(editorView, callback, transformer, fireAnalyticsEvent, _alwaysFire) {
|
|
87
|
+
try {
|
|
88
|
+
return returnDocumentRequest(editorView, callback, transformer, fireAnalyticsEvent, _alwaysFire);
|
|
89
|
+
// eslint-disable-next-line no-unused-vars
|
|
90
|
+
} catch (_) {
|
|
91
|
+
callback(undefined);
|
|
92
|
+
}
|
|
83
93
|
}
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "
|
|
17
|
+
const packageVersion = "110.36.8";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -186,7 +186,7 @@ function canMoveUp(state) {
|
|
|
186
186
|
if (selection instanceof NodeSelection && isMediaNode(selection.node)) {
|
|
187
187
|
return true;
|
|
188
188
|
}
|
|
189
|
-
if (selection instanceof TextSelection && !
|
|
189
|
+
if (selection instanceof TextSelection && !expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
|
|
190
190
|
if (!selection.empty) {
|
|
191
191
|
return true;
|
|
192
192
|
}
|
|
@@ -204,7 +204,7 @@ function canMoveDown(state) {
|
|
|
204
204
|
if (selection instanceof NodeSelection && isMediaNode(selection.node)) {
|
|
205
205
|
return true;
|
|
206
206
|
}
|
|
207
|
-
if (selection instanceof TextSelection && !
|
|
207
|
+
if (selection instanceof TextSelection && !expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
|
|
208
208
|
if (!selection.empty) {
|
|
209
209
|
return true;
|
|
210
210
|
}
|
|
@@ -4,5 +4,10 @@ export var contextPanelMessages = defineMessages({
|
|
|
4
4
|
id: 'fabric.editor.contextPanel.panelLabel',
|
|
5
5
|
defaultMessage: 'Context panel',
|
|
6
6
|
description: 'Label for the context panel'
|
|
7
|
+
},
|
|
8
|
+
panelContentLabel: {
|
|
9
|
+
id: 'fabric.editor.contextPanel.panelContentLabel',
|
|
10
|
+
defaultMessage: 'Scrollable context panel content',
|
|
11
|
+
description: 'Label for the context panel content'
|
|
7
12
|
}
|
|
8
13
|
});
|
|
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
|
|
|
10
10
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
11
11
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
12
12
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
13
|
-
var packageVersion = "
|
|
13
|
+
var packageVersion = "110.36.8";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// Ignored via go/ees007
|
|
@@ -3,7 +3,7 @@ import { fg } from '@atlaskit/platform-feature-flags';
|
|
|
3
3
|
import { getNodeIdProvider } from '../../node-anchor/node-anchor-provider';
|
|
4
4
|
import { processRawFragmentValue, processRawValue, processRawValueWithoutValidation } from '../../utils/processRawValue';
|
|
5
5
|
import { editorCommandToPMCommand } from '../editor-commands';
|
|
6
|
-
import { createThrottleSchedule, returnDocumentRequest } from './requestDocument';
|
|
6
|
+
import { createThrottleSchedule, returnDocumentRequest, returnDocumentRequestNoThrowError } from './requestDocument';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Core plugin that is always included in the preset.
|
|
@@ -13,6 +13,7 @@ export var corePlugin = function corePlugin(_ref) {
|
|
|
13
13
|
var config = _ref.config;
|
|
14
14
|
// Create the document request throttler per editor (rather than at a module level)
|
|
15
15
|
var scheduleDocumentRequest = createThrottleSchedule(returnDocumentRequest);
|
|
16
|
+
var scheduleDocumentRequestNoThrowError = createThrottleSchedule(returnDocumentRequestNoThrowError);
|
|
16
17
|
return {
|
|
17
18
|
name: 'core',
|
|
18
19
|
getSharedState: function getSharedState(state) {
|
|
@@ -117,17 +118,26 @@ export var corePlugin = function corePlugin(_ref) {
|
|
|
117
118
|
var view = (_config$getEditorView = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView !== void 0 ? _config$getEditorView : null;
|
|
118
119
|
scheduleDocumentRequest(view, onReceive, options === null || options === void 0 ? void 0 : options.transformer, config === null || config === void 0 ? void 0 : config.fireAnalyticsEvent, options === null || options === void 0 ? void 0 : options.alwaysFire);
|
|
119
120
|
},
|
|
121
|
+
requestDocumentAsync: function requestDocumentAsync(options) {
|
|
122
|
+
return new Promise(function (resolve) {
|
|
123
|
+
var _config$getEditorView2;
|
|
124
|
+
var view = (_config$getEditorView2 = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView2 !== void 0 ? _config$getEditorView2 : null;
|
|
125
|
+
scheduleDocumentRequestNoThrowError(view, function (doc) {
|
|
126
|
+
resolve(doc);
|
|
127
|
+
}, options === null || options === void 0 ? void 0 : options.transformer, config === null || config === void 0 ? void 0 : config.fireAnalyticsEvent, true);
|
|
128
|
+
});
|
|
129
|
+
},
|
|
120
130
|
createTransformer: function createTransformer(cb) {
|
|
121
|
-
var _config$
|
|
122
|
-
var view = (_config$
|
|
131
|
+
var _config$getEditorView3;
|
|
132
|
+
var view = (_config$getEditorView3 = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView3 !== void 0 ? _config$getEditorView3 : null;
|
|
123
133
|
if (!(view !== null && view !== void 0 && view.state.schema)) {
|
|
124
134
|
return undefined;
|
|
125
135
|
}
|
|
126
136
|
return cb(view === null || view === void 0 ? void 0 : view.state.schema);
|
|
127
137
|
},
|
|
128
138
|
getAnchorIdForNode: function getAnchorIdForNode(node, pos) {
|
|
129
|
-
var _config$
|
|
130
|
-
var view = (_config$
|
|
139
|
+
var _config$getEditorView4;
|
|
140
|
+
var view = (_config$getEditorView4 = config === null || config === void 0 ? void 0 : config.getEditorView()) !== null && _config$getEditorView4 !== void 0 ? _config$getEditorView4 : null;
|
|
131
141
|
if (!view) {
|
|
132
142
|
return undefined;
|
|
133
143
|
}
|
|
@@ -60,7 +60,9 @@ export function createThrottleSchedule(callback) {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
63
|
-
export function returnDocumentRequest(editorView, callback, transformer, fireAnalyticsEvent,
|
|
63
|
+
export function returnDocumentRequest(editorView, callback, transformer, fireAnalyticsEvent,
|
|
64
|
+
// eslint-disable-next-line no-unused-vars
|
|
65
|
+
_alwaysFire) {
|
|
64
66
|
var _editorView$state;
|
|
65
67
|
var _ref = (_editorView$state = editorView === null || editorView === void 0 ? void 0 : editorView.state) !== null && _editorView$state !== void 0 ? _editorView$state : {},
|
|
66
68
|
doc = _ref.doc,
|
|
@@ -89,4 +91,12 @@ export function returnDocumentRequest(editorView, callback, transformer, fireAna
|
|
|
89
91
|
});
|
|
90
92
|
throw e;
|
|
91
93
|
}
|
|
94
|
+
}
|
|
95
|
+
export function returnDocumentRequestNoThrowError(editorView, callback, transformer, fireAnalyticsEvent, _alwaysFire) {
|
|
96
|
+
try {
|
|
97
|
+
return returnDocumentRequest(editorView, callback, transformer, fireAnalyticsEvent, _alwaysFire);
|
|
98
|
+
// eslint-disable-next-line no-unused-vars
|
|
99
|
+
} catch (_) {
|
|
100
|
+
callback(undefined);
|
|
101
|
+
}
|
|
92
102
|
}
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "
|
|
24
|
+
var packageVersion = "110.36.8";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
|
@@ -180,7 +180,7 @@ function canMoveUp(state) {
|
|
|
180
180
|
if (selection instanceof NodeSelection && isMediaNode(selection.node)) {
|
|
181
181
|
return true;
|
|
182
182
|
}
|
|
183
|
-
if (selection instanceof TextSelection && !
|
|
183
|
+
if (selection instanceof TextSelection && !expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
|
|
184
184
|
if (!selection.empty) {
|
|
185
185
|
return true;
|
|
186
186
|
}
|
|
@@ -196,7 +196,7 @@ function canMoveDown(state) {
|
|
|
196
196
|
if (selection instanceof NodeSelection && isMediaNode(selection.node)) {
|
|
197
197
|
return true;
|
|
198
198
|
}
|
|
199
|
-
if (selection instanceof TextSelection && !
|
|
199
|
+
if (selection instanceof TextSelection && !expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
|
|
200
200
|
if (!selection.empty) {
|
|
201
201
|
return true;
|
|
202
202
|
}
|
|
@@ -9,3 +9,4 @@ export declare function toJSON(node: PMNode): JSONDocNode;
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function createThrottleSchedule<GenericTransformer extends Transformer<any> = Transformer<JSONDocNode>>(callback: typeof returnDocumentRequest<GenericTransformer>): (editorView: EditorView | null, callback: GenericTransformer extends undefined ? DefaultTransformerResultCallback : InferTransformerResultCallback<GenericTransformer>, transformer?: GenericTransformer | undefined, fireAnalyticsEvent?: FireAnalyticsCallback | undefined, _alwaysFire?: boolean | undefined) => void;
|
|
11
11
|
export declare function returnDocumentRequest<GenericTransformer extends Transformer<any> | undefined>(editorView: EditorView | null, callback: GenericTransformer extends undefined ? DefaultTransformerResultCallback : InferTransformerResultCallback<GenericTransformer>, transformer?: GenericTransformer, fireAnalyticsEvent?: FireAnalyticsCallback, _alwaysFire?: boolean): undefined;
|
|
12
|
+
export declare function returnDocumentRequestNoThrowError<GenericTransformer extends Transformer<any> | undefined>(editorView: EditorView | null, callback: GenericTransformer extends undefined ? DefaultTransformerResultCallback : InferTransformerResultCallback<GenericTransformer>, transformer?: GenericTransformer, fireAnalyticsEvent?: FireAnalyticsCallback, _alwaysFire?: boolean): undefined;
|
|
@@ -92,6 +92,19 @@ export type CorePlugin = NextEditorPlugin<'core', {
|
|
|
92
92
|
alwaysFire?: boolean;
|
|
93
93
|
transformer?: GenericTransformer;
|
|
94
94
|
}): void;
|
|
95
|
+
/**
|
|
96
|
+
* Request the editor document asynchronously.
|
|
97
|
+
*
|
|
98
|
+
* A transformer can be created using `createTransformer`.
|
|
99
|
+
*
|
|
100
|
+
* @param options Options for document request
|
|
101
|
+
* @param options.transformer Pass a transformer for the document to be transformed into a different format.
|
|
102
|
+
*
|
|
103
|
+
* @returns (Promise) Promise that resolves to the document. Document type based on the transformer.
|
|
104
|
+
*/
|
|
105
|
+
requestDocumentAsync: <GenericTransformer extends Transformer<any> = Transformer<JSONDocNode>>(options?: {
|
|
106
|
+
transformer?: GenericTransformer;
|
|
107
|
+
}) => Promise<TransformerResult<GenericTransformer> | undefined>;
|
|
95
108
|
/**
|
|
96
109
|
* Scroll to a specific position in the editor using native Element.scrollIntoView
|
|
97
110
|
*
|
|
@@ -9,3 +9,4 @@ export declare function toJSON(node: PMNode): JSONDocNode;
|
|
|
9
9
|
*/
|
|
10
10
|
export declare function createThrottleSchedule<GenericTransformer extends Transformer<any> = Transformer<JSONDocNode>>(callback: typeof returnDocumentRequest<GenericTransformer>): (editorView: EditorView | null, callback: GenericTransformer extends undefined ? DefaultTransformerResultCallback : InferTransformerResultCallback<GenericTransformer>, transformer?: GenericTransformer | undefined, fireAnalyticsEvent?: FireAnalyticsCallback | undefined, _alwaysFire?: boolean | undefined) => void;
|
|
11
11
|
export declare function returnDocumentRequest<GenericTransformer extends Transformer<any> | undefined>(editorView: EditorView | null, callback: GenericTransformer extends undefined ? DefaultTransformerResultCallback : InferTransformerResultCallback<GenericTransformer>, transformer?: GenericTransformer, fireAnalyticsEvent?: FireAnalyticsCallback, _alwaysFire?: boolean): undefined;
|
|
12
|
+
export declare function returnDocumentRequestNoThrowError<GenericTransformer extends Transformer<any> | undefined>(editorView: EditorView | null, callback: GenericTransformer extends undefined ? DefaultTransformerResultCallback : InferTransformerResultCallback<GenericTransformer>, transformer?: GenericTransformer, fireAnalyticsEvent?: FireAnalyticsCallback, _alwaysFire?: boolean): undefined;
|
|
@@ -92,6 +92,19 @@ export type CorePlugin = NextEditorPlugin<'core', {
|
|
|
92
92
|
alwaysFire?: boolean;
|
|
93
93
|
transformer?: GenericTransformer;
|
|
94
94
|
}): void;
|
|
95
|
+
/**
|
|
96
|
+
* Request the editor document asynchronously.
|
|
97
|
+
*
|
|
98
|
+
* A transformer can be created using `createTransformer`.
|
|
99
|
+
*
|
|
100
|
+
* @param options Options for document request
|
|
101
|
+
* @param options.transformer Pass a transformer for the document to be transformed into a different format.
|
|
102
|
+
*
|
|
103
|
+
* @returns (Promise) Promise that resolves to the document. Document type based on the transformer.
|
|
104
|
+
*/
|
|
105
|
+
requestDocumentAsync: <GenericTransformer extends Transformer<any> = Transformer<JSONDocNode>>(options?: {
|
|
106
|
+
transformer?: GenericTransformer;
|
|
107
|
+
}) => Promise<TransformerResult<GenericTransformer> | undefined>;
|
|
95
108
|
/**
|
|
96
109
|
* Scroll to a specific position in the editor using native Element.scrollIntoView
|
|
97
110
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "110.
|
|
3
|
+
"version": "110.37.0",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@atlaskit/media-file-preview": "^0.15.0",
|
|
63
63
|
"@atlaskit/media-picker": "^70.1.0",
|
|
64
64
|
"@atlaskit/media-ui": "^28.7.0",
|
|
65
|
-
"@atlaskit/media-viewer": "^52.
|
|
65
|
+
"@atlaskit/media-viewer": "^52.5.0",
|
|
66
66
|
"@atlaskit/mention": "^24.4.0",
|
|
67
67
|
"@atlaskit/menu": "^8.4.0",
|
|
68
68
|
"@atlaskit/onboarding": "^14.4.0",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@atlaskit/task-decision": "^19.2.0",
|
|
82
82
|
"@atlaskit/textfield": "^8.1.0",
|
|
83
83
|
"@atlaskit/theme": "^21.0.0",
|
|
84
|
-
"@atlaskit/tmp-editor-statsig": "^14.
|
|
84
|
+
"@atlaskit/tmp-editor-statsig": "^14.4.0",
|
|
85
85
|
"@atlaskit/tokens": "^8.4.0",
|
|
86
86
|
"@atlaskit/tooltip": "^20.10.0",
|
|
87
87
|
"@atlaskit/width-detector": "^5.0.0",
|