@atlaskit/editor-core 207.16.0 → 207.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/dist/cjs/ui/Appearance/Chromeless.js +1 -0
- package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +36 -18
- package/dist/cjs/ui/EditorContentContainer/EditorContentContainer.js +3 -3
- package/dist/cjs/ui/EditorContentContainer/styles/statusStyles.js +208 -0
- package/dist/cjs/utils/validateNodes.js +46 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/ui/Appearance/Chromeless.js +1 -0
- package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +36 -18
- package/dist/es2019/ui/EditorContentContainer/EditorContentContainer.js +9 -2
- package/dist/es2019/ui/EditorContentContainer/styles/statusStyles.js +201 -0
- package/dist/es2019/utils/validateNodes.js +43 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/ui/Appearance/Chromeless.js +1 -0
- package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +36 -18
- package/dist/esm/ui/EditorContentContainer/EditorContentContainer.js +3 -3
- package/dist/esm/ui/EditorContentContainer/styles/statusStyles.js +201 -0
- package/dist/esm/utils/validateNodes.js +47 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/ui/EditorContentContainer/styles/statusStyles.d.ts +6 -0
- package/dist/types-ts4.5/ui/EditorContentContainer/styles/statusStyles.d.ts +6 -0
- package/package.json +5 -6
|
@@ -1,6 +1,52 @@
|
|
|
1
|
+
import { Mark } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
3
|
+
|
|
4
|
+
// We don't want to use memoize from lodash, because we need to use WeakMap or WeakSet
|
|
5
|
+
// to avoid memory leaks, but lodash allow to change the cache type only globally
|
|
6
|
+
// like `memoize.Cache = WeakMap`, and we don't want to do that.
|
|
7
|
+
// So we use our own cache implementation.
|
|
8
|
+
var cache = new WeakSet();
|
|
9
|
+
|
|
10
|
+
// See https://github.com/ProseMirror/prosemirror-model/blob/20d26c9843d6a69a1d417d937c401537ee0b2342/src/node.ts#L303
|
|
11
|
+
function checkNode(node) {
|
|
12
|
+
if (cache.has(node)) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// @ts-expect-error - This is internal ProseMirror API, but we okay with it
|
|
17
|
+
node.type.checkContent(node.content);
|
|
18
|
+
// @ts-expect-error - This is internal ProseMirror API, but we okay with it
|
|
19
|
+
node.type.checkAttrs(node.attrs);
|
|
20
|
+
var copy = Mark.none;
|
|
21
|
+
for (var i = 0; i < node.marks.length; i++) {
|
|
22
|
+
var mark = node.marks[i];
|
|
23
|
+
// @ts-expect-error - This is internal ProseMirror API, but we okay with it
|
|
24
|
+
mark.type.checkAttrs(mark.attrs);
|
|
25
|
+
copy = mark.addToSet(copy);
|
|
26
|
+
}
|
|
27
|
+
if (!Mark.sameSet(copy, node.marks)) {
|
|
28
|
+
throw new RangeError("Invalid collection of marks for node ".concat(node.type.name, ": ").concat(node.marks.map(function (m) {
|
|
29
|
+
return m.type.name;
|
|
30
|
+
})));
|
|
31
|
+
}
|
|
32
|
+
node.content.forEach(function (node) {
|
|
33
|
+
return checkNode(node);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
// The set value should be added in the end of the function,
|
|
37
|
+
// because any previous check can throw an error,
|
|
38
|
+
// and we don't want to add invalid node to the cache.
|
|
39
|
+
cache.add(node);
|
|
40
|
+
}
|
|
1
41
|
export var validNode = function validNode(node) {
|
|
2
42
|
try {
|
|
3
|
-
|
|
43
|
+
if (editorExperiment('platform_editor_memoized_node_check', true, {
|
|
44
|
+
exposure: true
|
|
45
|
+
})) {
|
|
46
|
+
checkNode(node);
|
|
47
|
+
} else {
|
|
48
|
+
node.check();
|
|
49
|
+
}
|
|
4
50
|
} catch (error) {
|
|
5
51
|
return false;
|
|
6
52
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "207.
|
|
2
|
+
export var version = "207.17.1";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const statusStyles: import("@emotion/react").SerializedStyles;
|
|
2
|
+
export declare const statusStylesMixin_fg_platform_component_visual_refresh: import("@emotion/react").SerializedStyles;
|
|
3
|
+
export declare const statusStylesMixin_without_fg_platform_component_visual_refresh: import("@emotion/react").SerializedStyles;
|
|
4
|
+
export declare const vanillaStatusStyles: import("@emotion/react").SerializedStyles;
|
|
5
|
+
export declare const vanillaStatusStylesMixin_fg_platform_component_visual_refresh: import("@emotion/react").SerializedStyles;
|
|
6
|
+
export declare const vanillaStatusStylesMixin_without_fg_platform_component_visual_refresh: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const statusStyles: import("@emotion/react").SerializedStyles;
|
|
2
|
+
export declare const statusStylesMixin_fg_platform_component_visual_refresh: import("@emotion/react").SerializedStyles;
|
|
3
|
+
export declare const statusStylesMixin_without_fg_platform_component_visual_refresh: import("@emotion/react").SerializedStyles;
|
|
4
|
+
export declare const vanillaStatusStyles: import("@emotion/react").SerializedStyles;
|
|
5
|
+
export declare const vanillaStatusStylesMixin_fg_platform_component_visual_refresh: import("@emotion/react").SerializedStyles;
|
|
6
|
+
export declare const vanillaStatusStylesMixin_without_fg_platform_component_visual_refresh: import("@emotion/react").SerializedStyles;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-core",
|
|
3
|
-
"version": "207.
|
|
3
|
+
"version": "207.17.1",
|
|
4
4
|
"description": "A package contains Atlassian editor core functionality",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@atlaskit/platform-feature-flags-react": "^0.2.0",
|
|
63
63
|
"@atlaskit/react-ufo": "^3.13.0",
|
|
64
64
|
"@atlaskit/task-decision": "^19.2.0",
|
|
65
|
-
"@atlaskit/tmp-editor-statsig": "^5.
|
|
65
|
+
"@atlaskit/tmp-editor-statsig": "^5.14.0",
|
|
66
66
|
"@atlaskit/tokens": "^5.1.0",
|
|
67
67
|
"@atlaskit/tooltip": "^20.3.0",
|
|
68
68
|
"@atlaskit/width-detector": "^5.0.0",
|
|
@@ -596,10 +596,6 @@
|
|
|
596
596
|
"type": "boolean",
|
|
597
597
|
"referenceOnly": true
|
|
598
598
|
},
|
|
599
|
-
"platform_editor_controls_patch_analytics": {
|
|
600
|
-
"type": "boolean",
|
|
601
|
-
"referenceOnly": true
|
|
602
|
-
},
|
|
603
599
|
"platform_editor_refactor_view_more": {
|
|
604
600
|
"type": "boolean",
|
|
605
601
|
"referenceOnly": true
|
|
@@ -607,6 +603,9 @@
|
|
|
607
603
|
"confluence_team_presence_scroll_to_pointer": {
|
|
608
604
|
"type": "boolean"
|
|
609
605
|
},
|
|
606
|
+
"platform_editor_fix_table_width_inline_comment": {
|
|
607
|
+
"type": "boolean"
|
|
608
|
+
},
|
|
610
609
|
"platform_editor_interaction_api_refactor": {
|
|
611
610
|
"type": "boolean"
|
|
612
611
|
},
|