@atlaskit/editor-core 197.4.1 → 197.4.2
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 +16 -0
- package/afm-cc/tsconfig.json +3 -0
- package/afm-jira/tsconfig.json +3 -0
- package/dist/cjs/actions/index.js +9 -7
- package/dist/cjs/actions/temp-is-empty-document.js +31 -0
- package/dist/cjs/actions/temp-nodes-by-localids.js +41 -0
- package/dist/cjs/actions/temp-to-json.js +18 -0
- package/dist/cjs/composable-editor/hooks/useEditorMeasuresConstructor.js +2 -2
- package/dist/cjs/composable-editor/utils/editorMeasureTTICallback.js +2 -2
- package/dist/cjs/create-editor/create-editor.js +2 -2
- package/dist/cjs/ui/ContentStyles/index.js +2 -4
- package/dist/cjs/utils/performance/components/RenderTracking.js +2 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/actions/index.js +3 -1
- package/dist/es2019/actions/temp-is-empty-document.js +24 -0
- package/dist/es2019/actions/temp-nodes-by-localids.js +34 -0
- package/dist/es2019/actions/temp-to-json.js +11 -0
- package/dist/es2019/composable-editor/hooks/useEditorMeasuresConstructor.js +1 -1
- package/dist/es2019/composable-editor/utils/editorMeasureTTICallback.js +1 -1
- package/dist/es2019/create-editor/create-editor.js +1 -1
- package/dist/es2019/ui/ContentStyles/index.js +0 -3
- package/dist/es2019/utils/performance/components/RenderTracking.js +1 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/actions/index.js +3 -1
- package/dist/esm/actions/temp-is-empty-document.js +24 -0
- package/dist/esm/actions/temp-nodes-by-localids.js +35 -0
- package/dist/esm/actions/temp-to-json.js +11 -0
- package/dist/esm/composable-editor/hooks/useEditorMeasuresConstructor.js +1 -1
- package/dist/esm/composable-editor/utils/editorMeasureTTICallback.js +1 -1
- package/dist/esm/create-editor/create-editor.js +1 -1
- package/dist/esm/ui/ContentStyles/index.js +2 -4
- package/dist/esm/utils/performance/components/RenderTracking.js +1 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/actions/index.d.ts +1 -1
- package/dist/types/actions/temp-is-empty-document.d.ts +15 -0
- package/dist/types/actions/temp-nodes-by-localids.d.ts +7 -0
- package/dist/types/actions/temp-to-json.d.ts +3 -0
- package/dist/types/create-editor/ReactEditorView.d.ts +1 -1
- package/dist/types/create-editor/create-editor.d.ts +2 -2
- package/dist/types/types/editor-props.d.ts +1 -1
- package/dist/types-ts4.5/actions/index.d.ts +1 -1
- package/dist/types-ts4.5/actions/temp-is-empty-document.d.ts +15 -0
- package/dist/types-ts4.5/actions/temp-nodes-by-localids.d.ts +7 -0
- package/dist/types-ts4.5/actions/temp-to-json.d.ts +3 -0
- package/dist/types-ts4.5/create-editor/ReactEditorView.d.ts +1 -1
- package/dist/types-ts4.5/create-editor/create-editor.d.ts +2 -2
- package/dist/types-ts4.5/types/editor-props.d.ts +1 -1
- package/package.json +4 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 197.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#138801](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/138801)
|
|
8
|
+
[`eeb1f7ad41211`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/eeb1f7ad41211) -
|
|
9
|
+
Adding new entry-points to editor-common to optimise bundle size and move away from "utils"
|
|
10
|
+
entry-point.
|
|
11
|
+
- [#138699](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/138699)
|
|
12
|
+
[`aa5140e59db5a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/aa5140e59db5a) -
|
|
13
|
+
Cleanup feature flag moving styles from editor-core to tables plugin.
|
|
14
|
+
- [#138414](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/138414)
|
|
15
|
+
[`24d09e931c13b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/24d09e931c13b) -
|
|
16
|
+
Added lazy node experiment to test bases
|
|
17
|
+
- Updated dependencies
|
|
18
|
+
|
|
3
19
|
## 197.4.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
package/afm-jira/tsconfig.json
CHANGED
|
@@ -11,16 +11,18 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
|
|
|
11
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
13
|
var _processRawValue = require("@atlaskit/editor-common/process-raw-value");
|
|
14
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
15
14
|
var _analytics = require("@atlaskit/editor-common/utils/analytics");
|
|
16
15
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
17
16
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
18
|
-
var
|
|
17
|
+
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
19
18
|
var _eventDispatcher = require("../event-dispatcher");
|
|
20
19
|
var _action = require("../utils/action");
|
|
21
20
|
var _deprecationWarnings = _interopRequireDefault(require("../utils/deprecation-warnings"));
|
|
22
21
|
var _nodesByLocalIds = require("../utils/nodes-by-localIds");
|
|
23
22
|
var _processRawFragmentValue = require("../utils/processRawFragmentValue");
|
|
23
|
+
var _tempIsEmptyDocument = require("./temp-is-empty-document");
|
|
24
|
+
var _tempNodesByLocalids = require("./temp-nodes-by-localids");
|
|
25
|
+
var _tempToJson = require("./temp-to-json");
|
|
24
26
|
// TODO: ED-21786
|
|
25
27
|
// Please, do not copy or use this kind of code below
|
|
26
28
|
// @ts-ignore
|
|
@@ -232,7 +234,7 @@ var EditorActions = exports.default = /*#__PURE__*/function () {
|
|
|
232
234
|
return (0, _action.getEditorValueWithMedia)(editorView);
|
|
233
235
|
case 5:
|
|
234
236
|
doc = _context2.sent;
|
|
235
|
-
json = (0,
|
|
237
|
+
json = (0, _tempToJson.toJSON)(doc);
|
|
236
238
|
if (this.contentEncode) {
|
|
237
239
|
_context2.next = 9;
|
|
238
240
|
break;
|
|
@@ -258,7 +260,7 @@ var EditorActions = exports.default = /*#__PURE__*/function () {
|
|
|
258
260
|
var _this$editorView;
|
|
259
261
|
if ((_this$editorView = this.editorView) !== null && _this$editorView !== void 0 && _this$editorView.state) {
|
|
260
262
|
var _this$editorView2;
|
|
261
|
-
var nodes = (0,
|
|
263
|
+
var nodes = (0, _tempNodesByLocalids.findNodePosByLocalIds)((_this$editorView2 = this.editorView) === null || _this$editorView2 === void 0 ? void 0 : _this$editorView2.state, [id]);
|
|
262
264
|
var node = nodes.length >= 1 ? nodes[0] : undefined;
|
|
263
265
|
return node === null || node === void 0 ? void 0 : node.node;
|
|
264
266
|
}
|
|
@@ -288,7 +290,7 @@ var EditorActions = exports.default = /*#__PURE__*/function () {
|
|
|
288
290
|
if (selection instanceof _state.NodeSelection) {
|
|
289
291
|
return selection.node;
|
|
290
292
|
}
|
|
291
|
-
return (_findParentNode = (0,
|
|
293
|
+
return (_findParentNode = (0, _utils.findParentNode)(function (node) {
|
|
292
294
|
return Boolean(node.type.spec.selectable);
|
|
293
295
|
})(selection)) === null || _findParentNode === void 0 ? void 0 : _findParentNode.node;
|
|
294
296
|
}
|
|
@@ -301,7 +303,7 @@ var EditorActions = exports.default = /*#__PURE__*/function () {
|
|
|
301
303
|
if (!this.editorView) {
|
|
302
304
|
return true;
|
|
303
305
|
}
|
|
304
|
-
return (0,
|
|
306
|
+
return (0, _tempIsEmptyDocument.isEmptyDocument)(this.editorView.state.doc);
|
|
305
307
|
}
|
|
306
308
|
}, {
|
|
307
309
|
key: "replaceDocument",
|
|
@@ -347,7 +349,7 @@ var EditorActions = exports.default = /*#__PURE__*/function () {
|
|
|
347
349
|
}
|
|
348
350
|
|
|
349
351
|
// try to find a place in the document where to insert a node if its not allowed at the cursor position by schema
|
|
350
|
-
this.editorView.dispatch((0,
|
|
352
|
+
this.editorView.dispatch((0, _utils.safeInsert)(content, undefined, tryToReplace)(state.tr).scrollIntoView());
|
|
351
353
|
return true;
|
|
352
354
|
}
|
|
353
355
|
}, {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isEmptyDocument = isEmptyDocument;
|
|
7
|
+
exports.isEmptyParagraph = isEmptyParagraph;
|
|
8
|
+
/**
|
|
9
|
+
* Temporary file which extracts function from `editor-common`.
|
|
10
|
+
*
|
|
11
|
+
* Eventually we will deprecate and delete EditorActions. This is here to
|
|
12
|
+
* help decouple it from editor-common
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Checks if node is an empty paragraph.
|
|
17
|
+
*/
|
|
18
|
+
function isEmptyParagraph(node) {
|
|
19
|
+
return !!node && node.type.name === 'paragraph' && !node.childCount;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Checks if a node looks like an empty document
|
|
24
|
+
*/
|
|
25
|
+
function isEmptyDocument(node) {
|
|
26
|
+
var nodeChild = node.content.firstChild;
|
|
27
|
+
if (node.childCount !== 1 || !nodeChild) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
return isEmptyParagraph(nodeChild);
|
|
31
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.findNodePosByLocalIds = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Temporary file which extracts function from `editor-common`.
|
|
9
|
+
*
|
|
10
|
+
* Eventually we will deprecate and delete EditorActions. This is here to
|
|
11
|
+
* help decouple it from editor-common
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
var findNodePosByLocalIds = exports.findNodePosByLocalIds = function findNodePosByLocalIds(state, ids) {
|
|
15
|
+
var _state$doc$attrs;
|
|
16
|
+
var option = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
17
|
+
if (ids.length === 0) {
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
var nodes = [];
|
|
21
|
+
var localIdSet = new Set(ids);
|
|
22
|
+
if (option.includeDocNode && localIdSet.has((_state$doc$attrs = state.doc.attrs) === null || _state$doc$attrs === void 0 ? void 0 : _state$doc$attrs.localId)) {
|
|
23
|
+
nodes.push({
|
|
24
|
+
node: state.doc,
|
|
25
|
+
pos: 0
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
state.doc.descendants(function (node, pos) {
|
|
29
|
+
var _node$attrs;
|
|
30
|
+
if (localIdSet.has((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId)) {
|
|
31
|
+
nodes.push({
|
|
32
|
+
node: node,
|
|
33
|
+
pos: pos
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// stop traversing once we found all the nodes
|
|
38
|
+
return localIdSet.size !== nodes.length;
|
|
39
|
+
});
|
|
40
|
+
return nodes;
|
|
41
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.toJSON = toJSON;
|
|
7
|
+
var _editorJsonTransformer = require("@atlaskit/editor-json-transformer");
|
|
8
|
+
/**
|
|
9
|
+
* Temporary file which extracts function from `editor-common`.
|
|
10
|
+
*
|
|
11
|
+
* Eventually we will deprecate and delete EditorActions. This is here to
|
|
12
|
+
* help decouple it from editor-common
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
var transformer = new _editorJsonTransformer.JSONTransformer();
|
|
16
|
+
function toJSON(node) {
|
|
17
|
+
return transformer.encode(node);
|
|
18
|
+
}
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = useEditorConstructor;
|
|
8
8
|
var _hooks = require("@atlaskit/editor-common/hooks");
|
|
9
9
|
var _performanceMeasures = require("@atlaskit/editor-common/performance-measures");
|
|
10
|
-
var
|
|
10
|
+
var _measureTti = require("@atlaskit/editor-common/performance/measure-tti");
|
|
11
11
|
var _measureEnum = _interopRequireDefault(require("../../utils/performance/measure-enum"));
|
|
12
12
|
var _editorMeasureTTICallback = _interopRequireDefault(require("../utils/editorMeasureTTICallback"));
|
|
13
13
|
/**
|
|
@@ -32,7 +32,7 @@ function useEditorConstructor(performanceTracking, featureFlags, getExperienceSt
|
|
|
32
32
|
(0, _performanceMeasures.startMeasure)(_measureEnum.default.EDITOR_MOUNTED);
|
|
33
33
|
if (performanceTracking !== null && performanceTracking !== void 0 && (_performanceTracking$ = performanceTracking.ttiTracking) !== null && _performanceTracking$ !== void 0 && _performanceTracking$.enabled || featureFlags !== null && featureFlags !== void 0 && featureFlags.ufo) {
|
|
34
34
|
var _performanceTracking$2, _performanceTracking$3;
|
|
35
|
-
(0,
|
|
35
|
+
(0, _measureTti.measureTTI)(function (tti, ttiFromInvocation, canceled, distortedDuration) {
|
|
36
36
|
(0, _editorMeasureTTICallback.default)(tti, ttiFromInvocation, canceled, distortedDuration, performanceTracking, featureFlags, createAnalyticsEvent, getExperienceStore());
|
|
37
37
|
}, performanceTracking === null || performanceTracking === void 0 || (_performanceTracking$2 = performanceTracking.ttiTracking) === null || _performanceTracking$2 === void 0 ? void 0 : _performanceTracking$2.ttiIdleThreshold, performanceTracking === null || performanceTracking === void 0 || (_performanceTracking$3 = performanceTracking.ttiTracking) === null || _performanceTracking$3 === void 0 ? void 0 : _performanceTracking$3.ttiCancelTimeout);
|
|
38
38
|
}
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = editorMeasureTTICallback;
|
|
7
7
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
8
|
+
var _measureTti = require("@atlaskit/editor-common/performance/measure-tti");
|
|
8
9
|
var _ufo = require("@atlaskit/editor-common/ufo");
|
|
9
|
-
var _utils = require("@atlaskit/editor-common/utils");
|
|
10
10
|
function editorMeasureTTICallback(tti, ttiFromInvocation, canceled, distortedDuration, performanceTracking, featureFlags, createAnalyticsEvent, experienceStore) {
|
|
11
11
|
var _performanceTracking$;
|
|
12
12
|
if (performanceTracking !== null && performanceTracking !== void 0 && (_performanceTracking$ = performanceTracking.ttiTracking) !== null && _performanceTracking$ !== void 0 && _performanceTracking$.enabled && createAnalyticsEvent) {
|
|
@@ -30,7 +30,7 @@ function editorMeasureTTICallback(tti, ttiFromInvocation, canceled, distortedDur
|
|
|
30
30
|
ttiSeverityDegradedThreshold = _ttiTracking2.ttiSeverityDegradedThreshold,
|
|
31
31
|
ttiFromInvocationSeverityNormalThreshold = _ttiTracking2.ttiFromInvocationSeverityNormalThreshold,
|
|
32
32
|
ttiFromInvocationSeverityDegradedThreshold = _ttiTracking2.ttiFromInvocationSeverityDegradedThreshold;
|
|
33
|
-
var _getTTISeverity = (0,
|
|
33
|
+
var _getTTISeverity = (0, _measureTti.getTTISeverity)(tti, ttiFromInvocation, ttiSeverityNormalThreshold, ttiSeverityDegradedThreshold, ttiFromInvocationSeverityNormalThreshold, ttiFromInvocationSeverityDegradedThreshold),
|
|
34
34
|
ttiSeverity = _getTTISeverity.ttiSeverity,
|
|
35
35
|
ttiFromInvocationSeverity = _getTTISeverity.ttiFromInvocationSeverity;
|
|
36
36
|
ttiEvent.payload.attributes.ttiSeverity = ttiSeverity;
|
|
@@ -10,7 +10,7 @@ exports.fixExcludes = fixExcludes;
|
|
|
10
10
|
exports.processPluginsList = processPluginsList;
|
|
11
11
|
exports.sortByRank = sortByRank;
|
|
12
12
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
var
|
|
13
|
+
var _errorReporter = require("@atlaskit/editor-common/error-reporter");
|
|
14
14
|
var _instrumentedPlugin = require("../utils/performance/instrumented-plugin");
|
|
15
15
|
var _sortByOrder = require("./sort-by-order");
|
|
16
16
|
function sortByRank(a, b) {
|
|
@@ -140,7 +140,7 @@ function createPMPlugins(config) {
|
|
|
140
140
|
}).map(instrumentPlugin);
|
|
141
141
|
}
|
|
142
142
|
function createErrorReporter(errorReporterHandler) {
|
|
143
|
-
var errorReporter = new
|
|
143
|
+
var errorReporter = new _errorReporter.ErrorReporter();
|
|
144
144
|
if (errorReporterHandler) {
|
|
145
145
|
errorReporter.handler = errorReporterHandler;
|
|
146
146
|
}
|
|
@@ -20,9 +20,7 @@ var _styles2 = require("@atlaskit/editor-plugins/block-type/styles");
|
|
|
20
20
|
var _styles3 = require("@atlaskit/editor-plugins/find-replace/styles");
|
|
21
21
|
var _styles4 = require("@atlaskit/editor-plugins/paste-options-toolbar/styles");
|
|
22
22
|
var _styles5 = require("@atlaskit/editor-plugins/placeholder-text/styles");
|
|
23
|
-
var _commonStyles = require("@atlaskit/editor-plugins/table/ui/common-styles");
|
|
24
23
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
25
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
26
24
|
var _colors = require("@atlaskit/theme/colors");
|
|
27
25
|
var _tokens = require("@atlaskit/tokens");
|
|
28
26
|
var _getInlineNodeViewProducer = require("../../nodeviews/getInlineNodeViewProducer.styles");
|
|
@@ -76,9 +74,9 @@ var placeholderStyles = exports.placeholderStyles = (0, _react2.css)({
|
|
|
76
74
|
}
|
|
77
75
|
});
|
|
78
76
|
var contentStyles = function contentStyles(props) {
|
|
79
|
-
return (0, _react2.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\toutline: none;\n\t\tfont-size: ", "px;\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t}\n\n\t.ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n\t\tpointer-events: none;\n\t\topacity: 0.7;\n\t}\n\n\t.ProseMirror-hideselection *::selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-hideselection *::-moz-selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-selectednode {\n\t\toutline: none;\n\t}\n\n\t.ProseMirror-selectednode:empty {\n\t\toutline: 2px solid ", ";\n\t}\n\n\t", "\n\t", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n\t", "\n\t", "\n
|
|
77
|
+
return (0, _react2.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n\t.ProseMirror {\n\t\toutline: none;\n\t\tfont-size: ", "px;\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t}\n\n\t.ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n\t\tpointer-events: none;\n\t\topacity: 0.7;\n\t}\n\n\t.ProseMirror-hideselection *::selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-hideselection *::-moz-selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-selectednode {\n\t\toutline: none;\n\t}\n\n\t.ProseMirror-selectednode:empty {\n\t\toutline: 2px solid ", ";\n\t}\n\n\t", "\n\t", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n\t", "\n\t", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n\t\tbox-sizing: border-box;\n\t}\n\n\t.mediaGroupView-content-wrap ul {\n\t\tpadding: 0;\n\t}\n\n\t/** Needed to override any cleared floats, e.g. image wrapping */\n\n\tdiv.fabric-editor-block-mark[class^='fabric-editor-align'] {\n\t\tclear: none !important;\n\t}\n\n\t.fabric-editor-align-end {\n\t\ttext-align: right;\n\t}\n\n\t.fabric-editor-align-start {\n\t\ttext-align: left;\n\t}\n\n\t.fabric-editor-align-center {\n\t\ttext-align: center;\n\t}\n\n\t// For FullPage only when inside a table\n\t// Related code all lives inside: packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts\n\t// In the \"editorContentAreaContainerStyle\" function\n\t.fabric-editor--full-width-mode {\n\t\t.pm-table-container {\n\t\t\t.code-block,\n\t\t\t.extension-container,\n\t\t\t.multiBodiedExtension--container {\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t}\n\t}\n\n\t.pm-table-header-content-wrap :not(.fabric-editor-alignment),\n\t.pm-table-header-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark,\n\t.pm-table-cell-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark {\n\t\tp:first-of-type {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.pm-table-cell-content-wrap .mediaGroupView-content-wrap {\n\t\tclear: both;\n\t}\n\n\t.hyperlink-floating-toolbar,\n\t.", " {\n\t\tpadding: 0;\n\t}\n\n\t/* Link icon in the Atlaskit package\n is bigger than the others\n */\n\t.hyperlink-open-link {\n\t\tsvg {\n\t\t\tmax-width: 18px;\n\t\t}\n\t\t&[href] {\n\t\t\tpadding: 0 4px;\n\t\t}\n\t}\n"])), (0, _editorSharedStyles.editorFontSize)({
|
|
80
78
|
theme: props.theme
|
|
81
|
-
}), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles5.placeholderTextStyles, placeholderStyles, (0, _codeBlock.codeBlockStyles)(), (0, _styles2.blocktypeStyles)(), (0, _styles.codeMarkSharedStyles)(), _styles.textColorStyles, (0, _styles.backgroundColorStyles)(), listsStyles, ruleStyles(), _media.mediaStyles, (0, _layout.layoutStyles)(props.viewMode), _collab.telepointerStyle, _selection.gapCursorStyles, (0,
|
|
79
|
+
}), _styles.whitespaceSharedStyles, _styles.paragraphSharedStyles, _styles.listsSharedStyles, _styles.indentationSharedStyles, _styles.shadowSharedStyle, _getInlineNodeViewProducer.InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", _styles5.placeholderTextStyles, placeholderStyles, (0, _codeBlock.codeBlockStyles)(), (0, _styles2.blocktypeStyles)(), (0, _styles.codeMarkSharedStyles)(), _styles.textColorStyles, (0, _styles.backgroundColorStyles)(), listsStyles, ruleStyles(), _media.mediaStyles, (0, _layout.layoutStyles)(props.viewMode), _collab.telepointerStyle, _selection.gapCursorStyles, (0, _panel.panelStyles)(), mentionsStyles, emojiStyles, _styles.tasksAndDecisionsStyles, _styles.gridStyles, linkStyles, _styles.blockMarksSharedStyles, _styles.dateSharedStyle, _extension.extensionStyles, (0, _expand.expandStyles)(), _styles3.findReplaceStyles, _styles4.textHighlightStyle, _tasksAndDecisions.taskDecisionStyles, _status.statusStyles, (0, _styles.annotationSharedStyles)(), (0, _styles.smartCardStyles)(), _styles.smartCardSharedStyles, _date.dateStyles, _styles.embedCardStyles, _styles.unsupportedStyles, _styles.resizerStyles, (0, _aiPanels.aiPanelStyles)(props.colorMode), _styles.MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
82
80
|
};
|
|
83
81
|
var createEditorContentStyle = exports.createEditorContentStyle = function createEditorContentStyle(styles) {
|
|
84
82
|
return /*#__PURE__*/_react.default.forwardRef(function (props, ref) {
|
|
@@ -8,12 +8,12 @@ exports.RenderTracking = RenderTracking;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _debounce = _interopRequireDefault(require("lodash/debounce"));
|
|
10
10
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
11
|
-
var
|
|
11
|
+
var _useComponentRenderTracking = require("@atlaskit/editor-common/use-component-render-tracking");
|
|
12
12
|
function RenderTracking(props) {
|
|
13
13
|
var debouncedHandleAnalyticsEvent = (0, _react.useMemo)(function () {
|
|
14
14
|
return (0, _debounce.default)(props.handleAnalyticsEvent, 500);
|
|
15
15
|
}, [props.handleAnalyticsEvent]);
|
|
16
|
-
(0,
|
|
16
|
+
(0, _useComponentRenderTracking.useComponentRenderTracking)({
|
|
17
17
|
onRender: function onRender(_ref) {
|
|
18
18
|
var renderCount = _ref.renderCount,
|
|
19
19
|
propsDifference = _ref.propsDifference;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { processRawValue } from '@atlaskit/editor-common/process-raw-value';
|
|
3
|
-
import { findNodePosByLocalIds, isEmptyDocument, toJSON } from '@atlaskit/editor-common/utils';
|
|
4
3
|
import { analyticsEventKey } from '@atlaskit/editor-common/utils/analytics';
|
|
5
4
|
import { Node } from '@atlaskit/editor-prosemirror/model';
|
|
6
5
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -10,6 +9,9 @@ import { getEditorValueWithMedia } from '../utils/action';
|
|
|
10
9
|
import deprecationWarnings from '../utils/deprecation-warnings';
|
|
11
10
|
import { findNodePosByFragmentLocalIds } from '../utils/nodes-by-localIds';
|
|
12
11
|
import { processRawFragmentValue } from '../utils/processRawFragmentValue';
|
|
12
|
+
import { isEmptyDocument } from './temp-is-empty-document';
|
|
13
|
+
import { findNodePosByLocalIds } from './temp-nodes-by-localids';
|
|
14
|
+
import { toJSON } from './temp-to-json';
|
|
13
15
|
|
|
14
16
|
// TODO: ED-21786
|
|
15
17
|
// Please, do not copy or use this kind of code below
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Temporary file which extracts function from `editor-common`.
|
|
3
|
+
*
|
|
4
|
+
* Eventually we will deprecate and delete EditorActions. This is here to
|
|
5
|
+
* help decouple it from editor-common
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Checks if node is an empty paragraph.
|
|
10
|
+
*/
|
|
11
|
+
export function isEmptyParagraph(node) {
|
|
12
|
+
return !!node && node.type.name === 'paragraph' && !node.childCount;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Checks if a node looks like an empty document
|
|
17
|
+
*/
|
|
18
|
+
export function isEmptyDocument(node) {
|
|
19
|
+
const nodeChild = node.content.firstChild;
|
|
20
|
+
if (node.childCount !== 1 || !nodeChild) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
return isEmptyParagraph(nodeChild);
|
|
24
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Temporary file which extracts function from `editor-common`.
|
|
3
|
+
*
|
|
4
|
+
* Eventually we will deprecate and delete EditorActions. This is here to
|
|
5
|
+
* help decouple it from editor-common
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export const findNodePosByLocalIds = (state, ids, option = {}) => {
|
|
9
|
+
var _state$doc$attrs;
|
|
10
|
+
if (ids.length === 0) {
|
|
11
|
+
return [];
|
|
12
|
+
}
|
|
13
|
+
const nodes = [];
|
|
14
|
+
const localIdSet = new Set(ids);
|
|
15
|
+
if (option.includeDocNode && localIdSet.has((_state$doc$attrs = state.doc.attrs) === null || _state$doc$attrs === void 0 ? void 0 : _state$doc$attrs.localId)) {
|
|
16
|
+
nodes.push({
|
|
17
|
+
node: state.doc,
|
|
18
|
+
pos: 0
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
state.doc.descendants((node, pos) => {
|
|
22
|
+
var _node$attrs;
|
|
23
|
+
if (localIdSet.has((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId)) {
|
|
24
|
+
nodes.push({
|
|
25
|
+
node,
|
|
26
|
+
pos
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// stop traversing once we found all the nodes
|
|
31
|
+
return localIdSet.size !== nodes.length;
|
|
32
|
+
});
|
|
33
|
+
return nodes;
|
|
34
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Temporary file which extracts function from `editor-common`.
|
|
3
|
+
*
|
|
4
|
+
* Eventually we will deprecate and delete EditorActions. This is here to
|
|
5
|
+
* help decouple it from editor-common
|
|
6
|
+
*/
|
|
7
|
+
import { JSONTransformer } from '@atlaskit/editor-json-transformer';
|
|
8
|
+
const transformer = new JSONTransformer();
|
|
9
|
+
export function toJSON(node) {
|
|
10
|
+
return transformer.encode(node);
|
|
11
|
+
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { useConstructor } from '@atlaskit/editor-common/hooks';
|
|
7
7
|
import { startMeasure } from '@atlaskit/editor-common/performance-measures';
|
|
8
|
-
import { measureTTI } from '@atlaskit/editor-common/
|
|
8
|
+
import { measureTTI } from '@atlaskit/editor-common/performance/measure-tti';
|
|
9
9
|
import measurements from '../../utils/performance/measure-enum';
|
|
10
10
|
import editorMeasureTTICallback from '../utils/editorMeasureTTICallback';
|
|
11
11
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { getTTISeverity } from '@atlaskit/editor-common/performance/measure-tti';
|
|
2
3
|
import { EditorExperience } from '@atlaskit/editor-common/ufo';
|
|
3
|
-
import { getTTISeverity } from '@atlaskit/editor-common/utils';
|
|
4
4
|
export default function editorMeasureTTICallback(tti, ttiFromInvocation, canceled, distortedDuration, performanceTracking, featureFlags, createAnalyticsEvent, experienceStore) {
|
|
5
5
|
var _performanceTracking$;
|
|
6
6
|
if (performanceTracking !== null && performanceTracking !== void 0 && (_performanceTracking$ = performanceTracking.ttiTracking) !== null && _performanceTracking$ !== void 0 && _performanceTracking$.enabled && createAnalyticsEvent) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ErrorReporter } from '@atlaskit/editor-common/
|
|
1
|
+
import { ErrorReporter } from '@atlaskit/editor-common/error-reporter';
|
|
2
2
|
import { InstrumentedPlugin } from '../utils/performance/instrumented-plugin';
|
|
3
3
|
import { sortByOrder } from './sort-by-order';
|
|
4
4
|
export function sortByRank(a, b) {
|
|
@@ -22,9 +22,7 @@ import { blocktypeStyles } from '@atlaskit/editor-plugins/block-type/styles';
|
|
|
22
22
|
import { findReplaceStyles } from '@atlaskit/editor-plugins/find-replace/styles';
|
|
23
23
|
import { textHighlightStyle } from '@atlaskit/editor-plugins/paste-options-toolbar/styles';
|
|
24
24
|
import { placeholderTextStyles } from '@atlaskit/editor-plugins/placeholder-text/styles';
|
|
25
|
-
import { tableStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
|
|
26
25
|
import { akEditorDeleteBackgroundWithOpacity, akEditorDeleteBorder, akEditorSelectedBorderColor, akEditorSelectedBorderSize, akEditorSelectedNodeClassName, blockNodesVerticalMargin, editorFontSize, getSelectionStyles, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
27
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
28
26
|
import { N200, N30A, N500 } from '@atlaskit/theme/colors';
|
|
29
27
|
import { useThemeObserver } from '@atlaskit/tokens';
|
|
30
28
|
import { InlineNodeViewSharedStyles } from '../../nodeviews/getInlineNodeViewProducer.styles';
|
|
@@ -200,7 +198,6 @@ const contentStyles = props => css`
|
|
|
200
198
|
${layoutStyles(props.viewMode)}
|
|
201
199
|
${telepointerStyle}
|
|
202
200
|
${gapCursorStyles};
|
|
203
|
-
${fg('platform_editor_move_table_styles_to_plugin') ? undefined : tableStyles(props)}
|
|
204
201
|
${panelStyles()}
|
|
205
202
|
${mentionsStyles}
|
|
206
203
|
${emojiStyles}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import debounce from 'lodash/debounce';
|
|
3
3
|
import { EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { useComponentRenderTracking } from '@atlaskit/editor-common/
|
|
4
|
+
import { useComponentRenderTracking } from '@atlaskit/editor-common/use-component-render-tracking';
|
|
5
5
|
export function RenderTracking(props) {
|
|
6
6
|
const debouncedHandleAnalyticsEvent = useMemo(() => debounce(props.handleAnalyticsEvent, 500), [props.handleAnalyticsEvent]);
|
|
7
7
|
useComponentRenderTracking({
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "197.4.
|
|
2
|
+
export const version = "197.4.2";
|
|
@@ -4,7 +4,6 @@ import _createClass from "@babel/runtime/helpers/createClass";
|
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
6
|
import { processRawValue } from '@atlaskit/editor-common/process-raw-value';
|
|
7
|
-
import { findNodePosByLocalIds, isEmptyDocument, toJSON } from '@atlaskit/editor-common/utils';
|
|
8
7
|
import { analyticsEventKey } from '@atlaskit/editor-common/utils/analytics';
|
|
9
8
|
import { Node } from '@atlaskit/editor-prosemirror/model';
|
|
10
9
|
import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -14,6 +13,9 @@ import { getEditorValueWithMedia } from '../utils/action';
|
|
|
14
13
|
import deprecationWarnings from '../utils/deprecation-warnings';
|
|
15
14
|
import { findNodePosByFragmentLocalIds } from '../utils/nodes-by-localIds';
|
|
16
15
|
import { processRawFragmentValue } from '../utils/processRawFragmentValue';
|
|
16
|
+
import { isEmptyDocument } from './temp-is-empty-document';
|
|
17
|
+
import { findNodePosByLocalIds } from './temp-nodes-by-localids';
|
|
18
|
+
import { toJSON } from './temp-to-json';
|
|
17
19
|
|
|
18
20
|
// TODO: ED-21786
|
|
19
21
|
// Please, do not copy or use this kind of code below
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Temporary file which extracts function from `editor-common`.
|
|
3
|
+
*
|
|
4
|
+
* Eventually we will deprecate and delete EditorActions. This is here to
|
|
5
|
+
* help decouple it from editor-common
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Checks if node is an empty paragraph.
|
|
10
|
+
*/
|
|
11
|
+
export function isEmptyParagraph(node) {
|
|
12
|
+
return !!node && node.type.name === 'paragraph' && !node.childCount;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Checks if a node looks like an empty document
|
|
17
|
+
*/
|
|
18
|
+
export function isEmptyDocument(node) {
|
|
19
|
+
var nodeChild = node.content.firstChild;
|
|
20
|
+
if (node.childCount !== 1 || !nodeChild) {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
return isEmptyParagraph(nodeChild);
|
|
24
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Temporary file which extracts function from `editor-common`.
|
|
3
|
+
*
|
|
4
|
+
* Eventually we will deprecate and delete EditorActions. This is here to
|
|
5
|
+
* help decouple it from editor-common
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export var findNodePosByLocalIds = function findNodePosByLocalIds(state, ids) {
|
|
9
|
+
var _state$doc$attrs;
|
|
10
|
+
var option = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
11
|
+
if (ids.length === 0) {
|
|
12
|
+
return [];
|
|
13
|
+
}
|
|
14
|
+
var nodes = [];
|
|
15
|
+
var localIdSet = new Set(ids);
|
|
16
|
+
if (option.includeDocNode && localIdSet.has((_state$doc$attrs = state.doc.attrs) === null || _state$doc$attrs === void 0 ? void 0 : _state$doc$attrs.localId)) {
|
|
17
|
+
nodes.push({
|
|
18
|
+
node: state.doc,
|
|
19
|
+
pos: 0
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
state.doc.descendants(function (node, pos) {
|
|
23
|
+
var _node$attrs;
|
|
24
|
+
if (localIdSet.has((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.localId)) {
|
|
25
|
+
nodes.push({
|
|
26
|
+
node: node,
|
|
27
|
+
pos: pos
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// stop traversing once we found all the nodes
|
|
32
|
+
return localIdSet.size !== nodes.length;
|
|
33
|
+
});
|
|
34
|
+
return nodes;
|
|
35
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Temporary file which extracts function from `editor-common`.
|
|
3
|
+
*
|
|
4
|
+
* Eventually we will deprecate and delete EditorActions. This is here to
|
|
5
|
+
* help decouple it from editor-common
|
|
6
|
+
*/
|
|
7
|
+
import { JSONTransformer } from '@atlaskit/editor-json-transformer';
|
|
8
|
+
var transformer = new JSONTransformer();
|
|
9
|
+
export function toJSON(node) {
|
|
10
|
+
return transformer.encode(node);
|
|
11
|
+
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { useConstructor } from '@atlaskit/editor-common/hooks';
|
|
7
7
|
import { startMeasure } from '@atlaskit/editor-common/performance-measures';
|
|
8
|
-
import { measureTTI } from '@atlaskit/editor-common/
|
|
8
|
+
import { measureTTI } from '@atlaskit/editor-common/performance/measure-tti';
|
|
9
9
|
import measurements from '../../utils/performance/measure-enum';
|
|
10
10
|
import editorMeasureTTICallback from '../utils/editorMeasureTTICallback';
|
|
11
11
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ACTION, ACTION_SUBJECT, EVENT_TYPE, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
|
|
2
|
+
import { getTTISeverity } from '@atlaskit/editor-common/performance/measure-tti';
|
|
2
3
|
import { EditorExperience } from '@atlaskit/editor-common/ufo';
|
|
3
|
-
import { getTTISeverity } from '@atlaskit/editor-common/utils';
|
|
4
4
|
export default function editorMeasureTTICallback(tti, ttiFromInvocation, canceled, distortedDuration, performanceTracking, featureFlags, createAnalyticsEvent, experienceStore) {
|
|
5
5
|
var _performanceTracking$;
|
|
6
6
|
if (performanceTracking !== null && performanceTracking !== void 0 && (_performanceTracking$ = performanceTracking.ttiTracking) !== null && _performanceTracking$ !== void 0 && _performanceTracking$.enabled && createAnalyticsEvent) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
-
import { ErrorReporter } from '@atlaskit/editor-common/
|
|
2
|
+
import { ErrorReporter } from '@atlaskit/editor-common/error-reporter';
|
|
3
3
|
import { InstrumentedPlugin } from '../utils/performance/instrumented-plugin';
|
|
4
4
|
import { sortByOrder } from './sort-by-order';
|
|
5
5
|
export function sortByRank(a, b) {
|
|
@@ -24,9 +24,7 @@ import { blocktypeStyles } from '@atlaskit/editor-plugins/block-type/styles';
|
|
|
24
24
|
import { findReplaceStyles } from '@atlaskit/editor-plugins/find-replace/styles';
|
|
25
25
|
import { textHighlightStyle } from '@atlaskit/editor-plugins/paste-options-toolbar/styles';
|
|
26
26
|
import { placeholderTextStyles } from '@atlaskit/editor-plugins/placeholder-text/styles';
|
|
27
|
-
import { tableStyles } from '@atlaskit/editor-plugins/table/ui/common-styles';
|
|
28
27
|
import { akEditorDeleteBackgroundWithOpacity, akEditorDeleteBorder, akEditorSelectedBorderColor, akEditorSelectedBorderSize, akEditorSelectedNodeClassName, blockNodesVerticalMargin, editorFontSize, getSelectionStyles, SelectionStyle } from '@atlaskit/editor-shared-styles';
|
|
29
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
30
28
|
import { N200, N30A, N500 } from '@atlaskit/theme/colors';
|
|
31
29
|
import { useThemeObserver } from '@atlaskit/tokens';
|
|
32
30
|
import { InlineNodeViewSharedStyles } from '../../nodeviews/getInlineNodeViewProducer.styles';
|
|
@@ -69,9 +67,9 @@ export var placeholderStyles = css({
|
|
|
69
67
|
}
|
|
70
68
|
});
|
|
71
69
|
var contentStyles = function contentStyles(props) {
|
|
72
|
-
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n\t.ProseMirror {\n\t\toutline: none;\n\t\tfont-size: ", "px;\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t}\n\n\t.ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n\t\tpointer-events: none;\n\t\topacity: 0.7;\n\t}\n\n\t.ProseMirror-hideselection *::selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-hideselection *::-moz-selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-selectednode {\n\t\toutline: none;\n\t}\n\n\t.ProseMirror-selectednode:empty {\n\t\toutline: 2px solid ", ";\n\t}\n\n\t", "\n\t", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n\t", "\n\t", "\n
|
|
70
|
+
return css(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n\t.ProseMirror {\n\t\toutline: none;\n\t\tfont-size: ", "px;\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t\t", ";\n\t}\n\n\t.ProseMirror[contenteditable='false'] .taskItemView-content-wrap {\n\t\tpointer-events: none;\n\t\topacity: 0.7;\n\t}\n\n\t.ProseMirror-hideselection *::selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-hideselection *::-moz-selection {\n\t\tbackground: transparent;\n\t}\n\n\t.ProseMirror-selectednode {\n\t\toutline: none;\n\t}\n\n\t.ProseMirror-selectednode:empty {\n\t\toutline: 2px solid ", ";\n\t}\n\n\t", "\n\t", "\n ", "\n\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", ";\n\t", "\n\t", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n\n .panelView-content-wrap {\n\t\tbox-sizing: border-box;\n\t}\n\n\t.mediaGroupView-content-wrap ul {\n\t\tpadding: 0;\n\t}\n\n\t/** Needed to override any cleared floats, e.g. image wrapping */\n\n\tdiv.fabric-editor-block-mark[class^='fabric-editor-align'] {\n\t\tclear: none !important;\n\t}\n\n\t.fabric-editor-align-end {\n\t\ttext-align: right;\n\t}\n\n\t.fabric-editor-align-start {\n\t\ttext-align: left;\n\t}\n\n\t.fabric-editor-align-center {\n\t\ttext-align: center;\n\t}\n\n\t// For FullPage only when inside a table\n\t// Related code all lives inside: packages/editor/editor-core/src/ui/Appearance/FullPage/StyledComponents.ts\n\t// In the \"editorContentAreaContainerStyle\" function\n\t.fabric-editor--full-width-mode {\n\t\t.pm-table-container {\n\t\t\t.code-block,\n\t\t\t.extension-container,\n\t\t\t.multiBodiedExtension--container {\n\t\t\t\tmax-width: 100%;\n\t\t\t}\n\t\t}\n\t}\n\n\t.pm-table-header-content-wrap :not(.fabric-editor-alignment),\n\t.pm-table-header-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark,\n\t.pm-table-cell-content-wrap :not(p, .fabric-editor-block-mark) + div.fabric-editor-block-mark {\n\t\tp:first-of-type {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\t.pm-table-cell-content-wrap .mediaGroupView-content-wrap {\n\t\tclear: both;\n\t}\n\n\t.hyperlink-floating-toolbar,\n\t.", " {\n\t\tpadding: 0;\n\t}\n\n\t/* Link icon in the Atlaskit package\n is bigger than the others\n */\n\t.hyperlink-open-link {\n\t\tsvg {\n\t\t\tmax-width: 18px;\n\t\t}\n\t\t&[href] {\n\t\t\tpadding: 0 4px;\n\t\t}\n\t}\n"])), editorFontSize({
|
|
73
71
|
theme: props.theme
|
|
74
|
-
}), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", placeholderTextStyles, placeholderStyles, codeBlockStyles(), blocktypeStyles(), codeMarkSharedStyles(), textColorStyles, backgroundColorStyles(), listsStyles, ruleStyles(), mediaStyles, layoutStyles(props.viewMode), telepointerStyle, gapCursorStyles,
|
|
72
|
+
}), whitespaceSharedStyles, paragraphSharedStyles, listsSharedStyles, indentationSharedStyles, shadowSharedStyle, InlineNodeViewSharedStyles, "var(--ds-border-focused, #8cf)", placeholderTextStyles, placeholderStyles, codeBlockStyles(), blocktypeStyles(), codeMarkSharedStyles(), textColorStyles, backgroundColorStyles(), listsStyles, ruleStyles(), mediaStyles, layoutStyles(props.viewMode), telepointerStyle, gapCursorStyles, panelStyles(), mentionsStyles, emojiStyles, tasksAndDecisionsStyles, gridStyles, linkStyles, blockMarksSharedStyles, dateSharedStyle, extensionStyles, expandStyles(), findReplaceStyles, textHighlightStyle, taskDecisionStyles, statusStyles, annotationSharedStyles(), smartCardStyles(), smartCardSharedStyles, dateStyles, embedCardStyles, unsupportedStyles, resizerStyles, aiPanelStyles(props.colorMode), MediaSharedClassNames.FLOATING_TOOLBAR_COMPONENT);
|
|
75
73
|
};
|
|
76
74
|
export var createEditorContentStyle = function createEditorContentStyle(styles) {
|
|
77
75
|
return /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import debounce from 'lodash/debounce';
|
|
3
3
|
import { EVENT_TYPE } from '@atlaskit/editor-common/analytics';
|
|
4
|
-
import { useComponentRenderTracking } from '@atlaskit/editor-common/
|
|
4
|
+
import { useComponentRenderTracking } from '@atlaskit/editor-common/use-component-render-tracking';
|
|
5
5
|
export function RenderTracking(props) {
|
|
6
6
|
var debouncedHandleAnalyticsEvent = useMemo(function () {
|
|
7
7
|
return debounce(props.handleAnalyticsEvent, 500);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "197.4.
|
|
2
|
+
export var version = "197.4.2";
|
|
@@ -31,7 +31,7 @@ export default class EditorActions<T = any> implements EditorActionsOptions<T> {
|
|
|
31
31
|
*
|
|
32
32
|
* WARNING: this may be called repeatedly, async with care
|
|
33
33
|
*/
|
|
34
|
-
getValue(): Promise<
|
|
34
|
+
getValue(): Promise<import("@atlaskit/editor-json-transformer").JSONDocNode | T | undefined>;
|
|
35
35
|
getNodeByLocalId(id: string): Node | undefined;
|
|
36
36
|
getNodeByFragmentLocalId(id: string): Node | undefined;
|
|
37
37
|
/**
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Temporary file which extracts function from `editor-common`.
|
|
3
|
+
*
|
|
4
|
+
* Eventually we will deprecate and delete EditorActions. This is here to
|
|
5
|
+
* help decouple it from editor-common
|
|
6
|
+
*/
|
|
7
|
+
import { type Node } from '@atlaskit/editor-prosemirror/model';
|
|
8
|
+
/**
|
|
9
|
+
* Checks if node is an empty paragraph.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isEmptyParagraph(node?: Node | null): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Checks if a node looks like an empty document
|
|
14
|
+
*/
|
|
15
|
+
export declare function isEmptyDocument(node: Node): boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
|
+
type FindNodesByIdsOption = {
|
|
4
|
+
includeDocNode?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const findNodePosByLocalIds: (state: EditorState, ids: string[], option?: FindNodesByIdsOption) => NodeWithPos[];
|
|
7
|
+
export {};
|
|
@@ -4,12 +4,12 @@ import type { WrappedComponentProps } from 'react-intl-next';
|
|
|
4
4
|
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
|
|
5
5
|
import { FULL_WIDTH_MODE } from '@atlaskit/editor-common/analytics';
|
|
6
6
|
import type { AnalyticsEventPayload, DispatchAnalyticsEvent, FireAnalyticsCallback } from '@atlaskit/editor-common/analytics';
|
|
7
|
+
import type { ErrorReporter } from '@atlaskit/editor-common/error-reporter';
|
|
7
8
|
import type { AllEditorPresetPluginTypes, EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
8
9
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
9
10
|
import type { PortalProviderAPI } from '@atlaskit/editor-common/src/portal';
|
|
10
11
|
import type { PublicPluginAPI, Transformer } from '@atlaskit/editor-common/types';
|
|
11
12
|
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
12
|
-
import type { ErrorReporter } from '@atlaskit/editor-common/utils';
|
|
13
13
|
import { type SEVERITY } from '@atlaskit/editor-common/utils/analytics';
|
|
14
14
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
15
15
|
import { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ErrorReporter } from '@atlaskit/editor-common/error-reporter';
|
|
2
|
+
import type { ErrorReportingHandler } from '@atlaskit/editor-common/error-reporter';
|
|
1
3
|
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { ErrorReporter } from '@atlaskit/editor-common/utils';
|
|
3
|
-
import type { ErrorReportingHandler } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import type { MarkSpec } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import type { EditorConfig, EditorPlugin, PMPluginCreateConfig } from '../types';
|
|
6
6
|
export declare function sortByRank(a: {
|
|
@@ -2,13 +2,13 @@ import type { ReactElement } from 'react';
|
|
|
2
2
|
import type { ActivityProvider } from '@atlaskit/activity-provider';
|
|
3
3
|
import type { CardOptions } from '@atlaskit/editor-common/card';
|
|
4
4
|
import type { CollabEditOptions } from '@atlaskit/editor-common/collab';
|
|
5
|
+
import type { ErrorReportingHandler } from '@atlaskit/editor-common/error-reporter';
|
|
5
6
|
import type { ExtensionHandlers, ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
6
7
|
import type { AllEditorPresetPluginTypes, AllPluginNames, EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
7
8
|
import type { ContextIdentifierProvider, Providers, SearchProvider } from '@atlaskit/editor-common/provider-factory';
|
|
8
9
|
import type { FeedbackInfo, LinkingOptions, QuickInsertOptions, TextFormattingOptions, Transformer } from '@atlaskit/editor-common/types';
|
|
9
10
|
import type { UseStickyToolbarType } from '@atlaskit/editor-common/ui';
|
|
10
11
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
11
|
-
import type { ErrorReportingHandler } from '@atlaskit/editor-common/utils';
|
|
12
12
|
import type { AnnotationProviders } from '@atlaskit/editor-plugins/annotation';
|
|
13
13
|
import type { BlockTypePluginOptions } from '@atlaskit/editor-plugins/block-type';
|
|
14
14
|
import type { CodeBlockOptions } from '@atlaskit/editor-plugins/code-block';
|
|
@@ -31,7 +31,7 @@ export default class EditorActions<T = any> implements EditorActionsOptions<T> {
|
|
|
31
31
|
*
|
|
32
32
|
* WARNING: this may be called repeatedly, async with care
|
|
33
33
|
*/
|
|
34
|
-
getValue(): Promise<
|
|
34
|
+
getValue(): Promise<import("@atlaskit/editor-json-transformer").JSONDocNode | T | undefined>;
|
|
35
35
|
getNodeByLocalId(id: string): Node | undefined;
|
|
36
36
|
getNodeByFragmentLocalId(id: string): Node | undefined;
|
|
37
37
|
/**
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Temporary file which extracts function from `editor-common`.
|
|
3
|
+
*
|
|
4
|
+
* Eventually we will deprecate and delete EditorActions. This is here to
|
|
5
|
+
* help decouple it from editor-common
|
|
6
|
+
*/
|
|
7
|
+
import { type Node } from '@atlaskit/editor-prosemirror/model';
|
|
8
|
+
/**
|
|
9
|
+
* Checks if node is an empty paragraph.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isEmptyParagraph(node?: Node | null): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Checks if a node looks like an empty document
|
|
14
|
+
*/
|
|
15
|
+
export declare function isEmptyDocument(node: Node): boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import type { NodeWithPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
|
+
type FindNodesByIdsOption = {
|
|
4
|
+
includeDocNode?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export declare const findNodePosByLocalIds: (state: EditorState, ids: string[], option?: FindNodesByIdsOption) => NodeWithPos[];
|
|
7
|
+
export {};
|
|
@@ -4,12 +4,12 @@ import type { WrappedComponentProps } from 'react-intl-next';
|
|
|
4
4
|
import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next/types';
|
|
5
5
|
import { FULL_WIDTH_MODE } from '@atlaskit/editor-common/analytics';
|
|
6
6
|
import type { AnalyticsEventPayload, DispatchAnalyticsEvent, FireAnalyticsCallback } from '@atlaskit/editor-common/analytics';
|
|
7
|
+
import type { ErrorReporter } from '@atlaskit/editor-common/error-reporter';
|
|
7
8
|
import type { AllEditorPresetPluginTypes, EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
8
9
|
import type { ProviderFactory } from '@atlaskit/editor-common/provider-factory';
|
|
9
10
|
import type { PortalProviderAPI } from '@atlaskit/editor-common/src/portal';
|
|
10
11
|
import type { PublicPluginAPI, Transformer } from '@atlaskit/editor-common/types';
|
|
11
12
|
import { ExperienceStore } from '@atlaskit/editor-common/ufo';
|
|
12
|
-
import type { ErrorReporter } from '@atlaskit/editor-common/utils';
|
|
13
13
|
import { type SEVERITY } from '@atlaskit/editor-common/utils/analytics';
|
|
14
14
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
15
15
|
import { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ErrorReporter } from '@atlaskit/editor-common/error-reporter';
|
|
2
|
+
import type { ErrorReportingHandler } from '@atlaskit/editor-common/error-reporter';
|
|
1
3
|
import type { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
2
|
-
import { ErrorReporter } from '@atlaskit/editor-common/utils';
|
|
3
|
-
import type { ErrorReportingHandler } from '@atlaskit/editor-common/utils';
|
|
4
4
|
import type { MarkSpec } from '@atlaskit/editor-prosemirror/model';
|
|
5
5
|
import type { EditorConfig, EditorPlugin, PMPluginCreateConfig } from '../types';
|
|
6
6
|
export declare function sortByRank(a: {
|
|
@@ -2,13 +2,13 @@ import type { ReactElement } from 'react';
|
|
|
2
2
|
import type { ActivityProvider } from '@atlaskit/activity-provider';
|
|
3
3
|
import type { CardOptions } from '@atlaskit/editor-common/card';
|
|
4
4
|
import type { CollabEditOptions } from '@atlaskit/editor-common/collab';
|
|
5
|
+
import type { ErrorReportingHandler } from '@atlaskit/editor-common/error-reporter';
|
|
5
6
|
import type { ExtensionHandlers, ExtensionProvider } from '@atlaskit/editor-common/extensions';
|
|
6
7
|
import type { AllEditorPresetPluginTypes, AllPluginNames, EditorPresetBuilder } from '@atlaskit/editor-common/preset';
|
|
7
8
|
import type { ContextIdentifierProvider, Providers, SearchProvider } from '@atlaskit/editor-common/provider-factory';
|
|
8
9
|
import type { FeedbackInfo, LinkingOptions, QuickInsertOptions, TextFormattingOptions, Transformer } from '@atlaskit/editor-common/types';
|
|
9
10
|
import type { UseStickyToolbarType } from '@atlaskit/editor-common/ui';
|
|
10
11
|
import type { MenuItem } from '@atlaskit/editor-common/ui-menu';
|
|
11
|
-
import type { ErrorReportingHandler } from '@atlaskit/editor-common/utils';
|
|
12
12
|
import type { AnnotationProviders } from '@atlaskit/editor-plugins/annotation';
|
|
13
13
|
import type { BlockTypePluginOptions } from '@atlaskit/editor-plugins/block-type';
|
|
14
14
|
import type { CodeBlockOptions } from '@atlaskit/editor-plugins/code-block';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "197.4.
|
|
3
|
+
"version": "197.4.2",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -43,7 +43,8 @@
|
|
|
43
43
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
44
44
|
"@atlaskit/analytics-next-stable-react-context": "1.0.1",
|
|
45
45
|
"@atlaskit/button": "^20.1.0",
|
|
46
|
-
"@atlaskit/editor-common": "^88.
|
|
46
|
+
"@atlaskit/editor-common": "^88.13.0",
|
|
47
|
+
"@atlaskit/editor-json-transformer": "^8.18.0",
|
|
47
48
|
"@atlaskit/editor-plugins": "^4.4.0",
|
|
48
49
|
"@atlaskit/editor-prosemirror": "5.0.1",
|
|
49
50
|
"@atlaskit/editor-shared-styles": "^2.13.0",
|
|
@@ -84,7 +85,6 @@
|
|
|
84
85
|
"@atlaskit/adf-utils": "^19.8.0",
|
|
85
86
|
"@atlaskit/analytics-listeners": "^8.11.0",
|
|
86
87
|
"@atlaskit/collab-provider": "9.40.0",
|
|
87
|
-
"@atlaskit/editor-json-transformer": "^8.18.0",
|
|
88
88
|
"@atlaskit/editor-plugin-annotation": "1.19.4",
|
|
89
89
|
"@atlaskit/editor-plugin-card": "^2.15.0",
|
|
90
90
|
"@atlaskit/editor-plugin-editor-viewmode": "^2.1.0",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"@atlaskit/util-data-test": "^17.9.0",
|
|
106
106
|
"@atlaskit/visual-regression": "*",
|
|
107
107
|
"@atlassian/adf-schema-json": "^1.22.0",
|
|
108
|
-
"@atlassian/search-provider": "2.4.
|
|
108
|
+
"@atlassian/search-provider": "2.4.122",
|
|
109
109
|
"@emotion/jest": "^11.8.0",
|
|
110
110
|
"@storybook/addon-knobs": "^5.3.18",
|
|
111
111
|
"@testing-library/react": "^12.1.5",
|
|
@@ -238,9 +238,6 @@
|
|
|
238
238
|
"editor-fix-esc-main-toolbar-navigation": {
|
|
239
239
|
"type": "boolean"
|
|
240
240
|
},
|
|
241
|
-
"platform_editor_move_table_styles_to_plugin": {
|
|
242
|
-
"type": "boolean"
|
|
243
|
-
},
|
|
244
241
|
"platform_editor_lazy-node-views": {
|
|
245
242
|
"type": "boolean",
|
|
246
243
|
"referenceOnly": true
|