@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.
@@ -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
- node.check(); // this will throw an error if the node is invalid
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.16.0";
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.16.0",
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.13.0",
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
  },