@atlaskit/editor-plugin-tasks-and-decisions 6.3.2 → 6.4.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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/editor-plugin-tasks-and-decisions
2
2
 
3
+ ## 6.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`8ce4178519d92`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8ce4178519d92) -
8
+ Added ignore mutation for decision node view
9
+
10
+ ## 6.3.3
11
+
12
+ ### Patch Changes
13
+
14
+ - [`57b19274b9fdd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/57b19274b9fdd) -
15
+ EDITOR-1373 Bump adf-schema version
16
+ - Updated dependencies
17
+
3
18
  ## 6.3.2
4
19
 
5
20
  ### Patch Changes
@@ -9,6 +9,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
11
  var _model = require("@atlaskit/editor-prosemirror/model");
12
+ var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
12
13
  var _decisionItemNodeSpec = require("./decisionItemNodeSpec");
13
14
  /**
14
15
  * NodeView for the DecisionItem node.
@@ -66,5 +67,30 @@ var DecisionItemNodeView = exports.DecisionItemNodeView = /*#__PURE__*/function
66
67
  this.updateHasChildren(node);
67
68
  return true;
68
69
  }
70
+
71
+ /**
72
+ * Determines whether a mutation should be ignored by ProseMirror.
73
+ * This prevents unnecessary node view destruction during DOM changes that don't affect our content.
74
+ * @param mutation - The DOM mutation record or selection change
75
+ * @returns true if the mutation should be ignored, false if it should be processed
76
+ * @example
77
+ * // Mutation outside contentDOM will be ignored
78
+ * const shouldIgnore = decisionItemNodeView.ignoreMutation(mutationRecord);
79
+ */
80
+ }, {
81
+ key: "ignoreMutation",
82
+ value: function ignoreMutation(mutation) {
83
+ // This was discovered while implementing the platform_editor_debounce_portal_provider experiment
84
+ // And there will only be an issue if the experiment is enabled.
85
+ // As such, this fix is behind this experiment.
86
+ if (!(0, _expVal.expVal)('platform_editor_debounce_portal_provider', 'isEnabled', false)) {
87
+ return false; // Let ProseMirror handle all mutations when experiment is disabled
88
+ }
89
+ if (!this.contentDOM) {
90
+ return true;
91
+ }
92
+ // Ignore mutations that don't target our contentDOM and aren't selection changes
93
+ return !this.contentDOM.contains(mutation.target) && mutation.type !== 'selection';
94
+ }
69
95
  }]);
70
96
  }();
@@ -1,5 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
3
+ import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
3
4
  import { decisionItemToDOM } from './decisionItemNodeSpec';
4
5
 
5
6
  /**
@@ -54,4 +55,27 @@ export class DecisionItemNodeView {
54
55
  this.updateHasChildren(node);
55
56
  return true;
56
57
  }
58
+
59
+ /**
60
+ * Determines whether a mutation should be ignored by ProseMirror.
61
+ * This prevents unnecessary node view destruction during DOM changes that don't affect our content.
62
+ * @param mutation - The DOM mutation record or selection change
63
+ * @returns true if the mutation should be ignored, false if it should be processed
64
+ * @example
65
+ * // Mutation outside contentDOM will be ignored
66
+ * const shouldIgnore = decisionItemNodeView.ignoreMutation(mutationRecord);
67
+ */
68
+ ignoreMutation(mutation) {
69
+ // This was discovered while implementing the platform_editor_debounce_portal_provider experiment
70
+ // And there will only be an issue if the experiment is enabled.
71
+ // As such, this fix is behind this experiment.
72
+ if (!expVal('platform_editor_debounce_portal_provider', 'isEnabled', false)) {
73
+ return false; // Let ProseMirror handle all mutations when experiment is disabled
74
+ }
75
+ if (!this.contentDOM) {
76
+ return true;
77
+ }
78
+ // Ignore mutations that don't target our contentDOM and aren't selection changes
79
+ return !this.contentDOM.contains(mutation.target) && mutation.type !== 'selection';
80
+ }
57
81
  }
@@ -2,6 +2,7 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
3
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
5
+ import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
5
6
  import { decisionItemToDOM } from './decisionItemNodeSpec';
6
7
 
7
8
  /**
@@ -60,5 +61,30 @@ export var DecisionItemNodeView = /*#__PURE__*/function () {
60
61
  this.updateHasChildren(node);
61
62
  return true;
62
63
  }
64
+
65
+ /**
66
+ * Determines whether a mutation should be ignored by ProseMirror.
67
+ * This prevents unnecessary node view destruction during DOM changes that don't affect our content.
68
+ * @param mutation - The DOM mutation record or selection change
69
+ * @returns true if the mutation should be ignored, false if it should be processed
70
+ * @example
71
+ * // Mutation outside contentDOM will be ignored
72
+ * const shouldIgnore = decisionItemNodeView.ignoreMutation(mutationRecord);
73
+ */
74
+ }, {
75
+ key: "ignoreMutation",
76
+ value: function ignoreMutation(mutation) {
77
+ // This was discovered while implementing the platform_editor_debounce_portal_provider experiment
78
+ // And there will only be an issue if the experiment is enabled.
79
+ // As such, this fix is behind this experiment.
80
+ if (!expVal('platform_editor_debounce_portal_provider', 'isEnabled', false)) {
81
+ return false; // Let ProseMirror handle all mutations when experiment is disabled
82
+ }
83
+ if (!this.contentDOM) {
84
+ return true;
85
+ }
86
+ // Ignore mutations that don't target our contentDOM and aren't selection changes
87
+ return !this.contentDOM.contains(mutation.target) && mutation.type !== 'selection';
88
+ }
63
89
  }]);
64
90
  }();
@@ -34,4 +34,17 @@ export declare class DecisionItemNodeView implements NodeView {
34
34
  * @returns {boolean} - Returns true if the view was updated successfully.
35
35
  */
36
36
  update(node: PMNode): boolean;
37
+ /**
38
+ * Determines whether a mutation should be ignored by ProseMirror.
39
+ * This prevents unnecessary node view destruction during DOM changes that don't affect our content.
40
+ * @param mutation - The DOM mutation record or selection change
41
+ * @returns true if the mutation should be ignored, false if it should be processed
42
+ * @example
43
+ * // Mutation outside contentDOM will be ignored
44
+ * const shouldIgnore = decisionItemNodeView.ignoreMutation(mutationRecord);
45
+ */
46
+ ignoreMutation(mutation: MutationRecord | {
47
+ type: 'selection';
48
+ target: Node;
49
+ }): boolean;
37
50
  }
@@ -34,4 +34,17 @@ export declare class DecisionItemNodeView implements NodeView {
34
34
  * @returns {boolean} - Returns true if the view was updated successfully.
35
35
  */
36
36
  update(node: PMNode): boolean;
37
+ /**
38
+ * Determines whether a mutation should be ignored by ProseMirror.
39
+ * This prevents unnecessary node view destruction during DOM changes that don't affect our content.
40
+ * @param mutation - The DOM mutation record or selection change
41
+ * @returns true if the mutation should be ignored, false if it should be processed
42
+ * @example
43
+ * // Mutation outside contentDOM will be ignored
44
+ * const shouldIgnore = decisionItemNodeView.ignoreMutation(mutationRecord);
45
+ */
46
+ ignoreMutation(mutation: MutationRecord | {
47
+ type: 'selection';
48
+ target: Node;
49
+ }): boolean;
37
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-tasks-and-decisions",
3
- "version": "6.3.2",
3
+ "version": "6.4.0",
4
4
  "description": "Tasks and decisions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -32,7 +32,7 @@
32
32
  ".": "./src/index.ts"
33
33
  },
34
34
  "dependencies": {
35
- "@atlaskit/adf-schema": "^50.2.0",
35
+ "@atlaskit/adf-schema": "^50.2.1",
36
36
  "@atlaskit/analytics-namespaced-context": "^7.0.0",
37
37
  "@atlaskit/analytics-next": "^11.1.0",
38
38
  "@atlaskit/css": "^0.12.0",
@@ -49,14 +49,14 @@
49
49
  "@atlaskit/primitives": "^14.11.0",
50
50
  "@atlaskit/prosemirror-input-rules": "^3.4.0",
51
51
  "@atlaskit/task-decision": "^19.2.0",
52
- "@atlaskit/tmp-editor-statsig": "^11.2.0",
52
+ "@atlaskit/tmp-editor-statsig": "^11.3.0",
53
53
  "@atlaskit/tokens": "^6.0.0",
54
54
  "@babel/runtime": "^7.0.0",
55
55
  "@compiled/react": "^0.18.3",
56
56
  "bind-event-listener": "^3.0.0"
57
57
  },
58
58
  "peerDependencies": {
59
- "@atlaskit/editor-common": "^107.25.0",
59
+ "@atlaskit/editor-common": "^107.26.0",
60
60
  "react": "^18.2.0",
61
61
  "react-dom": "^18.2.0",
62
62
  "react-intl-next": "npm:react-intl@^5.18.1"