@atlaskit/editor-core 189.6.5 → 189.6.8

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,18 @@
1
1
  # @atlaskit/editor-core
2
2
 
3
+ ## 189.6.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [#59951](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/59951) [`a42a17e8af1b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a42a17e8af1b) - ED-21106: Remove nonPrivacySafeAttributes from editor operational events
8
+
9
+ ## 189.6.6
10
+
11
+ ### Patch Changes
12
+
13
+ - [#60153](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/60153) [`5764d44cc93b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5764d44cc93b) - Cleaned references for feature flag: platform.editor.table.overflow-state-analytics
14
+ - [#60143](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/60143) [`2088c0f833e1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2088c0f833e1) - Memonized the Editor feature flags to avoid unnecessary re-renders on Confluence
15
+
3
16
  ## 189.6.5
4
17
 
5
18
  ### Patch Changes
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.ComposableEditor = ComposableEditor;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
8
9
  var _react = require("react");
9
10
  var _react2 = require("@emotion/react");
10
11
  var _v = _interopRequireDefault(require("uuid/v4"));
@@ -13,6 +14,7 @@ var _analytics = require("@atlaskit/editor-common/analytics");
13
14
  var _ufo = require("@atlaskit/editor-common/ufo");
14
15
  var _utils = require("@atlaskit/editor-common/utils");
15
16
  var _editorPluginBase = require("@atlaskit/editor-plugin-base");
17
+ var _isEqual = _interopRequireDefault(require("lodash/isEqual"));
16
18
  var _actions = _interopRequireDefault(require("../actions"));
17
19
  var _featureFlagsFromProps = require("../create-editor/feature-flags-from-props");
18
20
  var _versionWrapper = require("../version-wrapper");
@@ -110,6 +112,13 @@ function Editor(passedProps) {
110
112
  providerFactory: providerFactory
111
113
  });
112
114
  }
115
+ var useMemoEditorFeatureFlags = function useMemoEditorFeatureFlags(featureFlags) {
116
+ var ffRef = (0, _react.useRef)(featureFlags);
117
+ if (!(0, _isEqual.default)(ffRef.current, featureFlags)) {
118
+ ffRef.current = featureFlags;
119
+ }
120
+ return ffRef.current;
121
+ };
113
122
  function ComposableEditor(props) {
114
123
  var editorSessionId = (0, _react.useRef)((0, _v.default)());
115
124
  var data = (0, _react.useMemo)(function () {
@@ -121,11 +130,14 @@ function ComposableEditor(props) {
121
130
  editorSessionId: editorSessionId.current
122
131
  };
123
132
  }, [props.appearance]);
133
+ var memodEditorFeatureFlags = useMemoEditorFeatureFlags(props.featureFlags);
124
134
  return (0, _react2.jsx)(_analyticsNamespacedContext.FabricEditorAnalyticsContext
125
135
  // @ts-expect-error Type 'string' is not assignable to type '"editorCore" | "renderer"'.
126
136
  , {
127
137
  data: data
128
- }, (0, _react2.jsx)(Editor, props));
138
+ }, (0, _react2.jsx)(Editor, (0, _extends2.default)({}, props, {
139
+ featureFlags: memodEditorFeatureFlags
140
+ })));
129
141
  }
130
142
  ComposableEditor.propTypes = {
131
143
  minHeight: function minHeight(_ref) {
@@ -76,9 +76,6 @@ var ErrorBoundaryWithEditorView = exports.ErrorBoundaryWithEditorView = /*#__PUR
76
76
  eventType: _analytics.EVENT_TYPE.OPERATIONAL,
77
77
  attributes: {
78
78
  errorId: sharedId
79
- },
80
- nonPrivacySafeAttributes: {
81
- errorStack: errorStack
82
79
  }
83
80
  });
84
81
  if (_this.featureFlags.ufo && _this.props.editorView) {
@@ -65,9 +65,6 @@ function InlineCommentView(_ref) {
65
65
  position: position,
66
66
  docSize: editorView.state.doc.nodeSize,
67
67
  error: error.toString()
68
- },
69
- nonPrivacySafeAttributes: {
70
- errorStack: error.stack || undefined
71
68
  }
72
69
  };
73
70
  dispatchAnalyticsEvent(payload);
@@ -25,9 +25,6 @@ var freezeUnsafeTransactionProperties = exports.freezeUnsafeTransactionPropertie
25
25
  eventType: _analytics.EVENT_TYPE.OPERATIONAL,
26
26
  attributes: {
27
27
  pluginKey: pluginKey || 'unknown'
28
- },
29
- nonPrivacySafeAttributes: {
30
- stack: new Error().stack
31
28
  }
32
29
  });
33
30
  }
@@ -5,4 +5,4 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = exports.name = void 0;
7
7
  var name = exports.name = "@atlaskit/editor-core";
8
- var version = exports.version = "189.6.5";
8
+ var version = exports.version = "189.6.8";
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  /** @jsx jsx */
2
3
  import { useRef, useCallback, useMemo } from 'react';
3
4
  import { jsx } from '@emotion/react';
@@ -7,6 +8,7 @@ import { ACTION, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
7
8
  import { EditorExperience, ExperienceStore } from '@atlaskit/editor-common/ufo';
8
9
  import { getAnalyticsAppearance, startMeasure, stopMeasure } from '@atlaskit/editor-common/utils';
9
10
  import { basePlugin } from '@atlaskit/editor-plugin-base';
11
+ import isEqual from 'lodash/isEqual';
10
12
  import EditorActions from '../actions';
11
13
  import { createFeatureFlagsFromProps } from '../create-editor/feature-flags-from-props';
12
14
  import { name, version } from '../version-wrapper';
@@ -105,6 +107,13 @@ function Editor(passedProps) {
105
107
  providerFactory: providerFactory
106
108
  });
107
109
  }
110
+ const useMemoEditorFeatureFlags = featureFlags => {
111
+ const ffRef = useRef(featureFlags);
112
+ if (!isEqual(ffRef.current, featureFlags)) {
113
+ ffRef.current = featureFlags;
114
+ }
115
+ return ffRef.current;
116
+ };
108
117
  export function ComposableEditor(props) {
109
118
  const editorSessionId = useRef(uuid());
110
119
  const data = useMemo(() => {
@@ -116,11 +125,14 @@ export function ComposableEditor(props) {
116
125
  editorSessionId: editorSessionId.current
117
126
  };
118
127
  }, [props.appearance]);
128
+ const memodEditorFeatureFlags = useMemoEditorFeatureFlags(props.featureFlags);
119
129
  return jsx(FabricEditorAnalyticsContext
120
130
  // @ts-expect-error Type 'string' is not assignable to type '"editorCore" | "renderer"'.
121
131
  , {
122
132
  data: data
123
- }, jsx(Editor, props));
133
+ }, jsx(Editor, _extends({}, props, {
134
+ featureFlags: memodEditorFeatureFlags
135
+ })));
124
136
  }
125
137
  ComposableEditor.propTypes = {
126
138
  minHeight: ({
@@ -50,9 +50,6 @@ export class ErrorBoundaryWithEditorView extends React.Component {
50
50
  eventType: EVENT_TYPE.OPERATIONAL,
51
51
  attributes: {
52
52
  errorId: sharedId
53
- },
54
- nonPrivacySafeAttributes: {
55
- errorStack
56
53
  }
57
54
  });
58
55
  if (this.featureFlags.ufo && this.props.editorView) {
@@ -67,9 +67,6 @@ export function InlineCommentView({
67
67
  position,
68
68
  docSize: editorView.state.doc.nodeSize,
69
69
  error: error.toString()
70
- },
71
- nonPrivacySafeAttributes: {
72
- errorStack: error.stack || undefined
73
70
  }
74
71
  };
75
72
  dispatchAnalyticsEvent(payload);
@@ -16,9 +16,6 @@ export const freezeUnsafeTransactionProperties = ({
16
16
  eventType: EVENT_TYPE.OPERATIONAL,
17
17
  attributes: {
18
18
  pluginKey: pluginKey || 'unknown'
19
- },
20
- nonPrivacySafeAttributes: {
21
- stack: new Error().stack
22
19
  }
23
20
  });
24
21
  }
@@ -1,2 +1,2 @@
1
1
  export const name = "@atlaskit/editor-core";
2
- export const version = "189.6.5";
2
+ export const version = "189.6.8";
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  /** @jsx jsx */
2
3
  import { useRef, useCallback, useMemo } from 'react';
3
4
  import { jsx } from '@emotion/react';
@@ -7,6 +8,7 @@ import { ACTION, fireAnalyticsEvent } from '@atlaskit/editor-common/analytics';
7
8
  import { EditorExperience, ExperienceStore } from '@atlaskit/editor-common/ufo';
8
9
  import { getAnalyticsAppearance, startMeasure, stopMeasure } from '@atlaskit/editor-common/utils';
9
10
  import { basePlugin } from '@atlaskit/editor-plugin-base';
11
+ import isEqual from 'lodash/isEqual';
10
12
  import EditorActions from '../actions';
11
13
  import { createFeatureFlagsFromProps } from '../create-editor/feature-flags-from-props';
12
14
  import { name, version } from '../version-wrapper';
@@ -103,6 +105,13 @@ function Editor(passedProps) {
103
105
  providerFactory: providerFactory
104
106
  });
105
107
  }
108
+ var useMemoEditorFeatureFlags = function useMemoEditorFeatureFlags(featureFlags) {
109
+ var ffRef = useRef(featureFlags);
110
+ if (!isEqual(ffRef.current, featureFlags)) {
111
+ ffRef.current = featureFlags;
112
+ }
113
+ return ffRef.current;
114
+ };
106
115
  export function ComposableEditor(props) {
107
116
  var editorSessionId = useRef(uuid());
108
117
  var data = useMemo(function () {
@@ -114,11 +123,14 @@ export function ComposableEditor(props) {
114
123
  editorSessionId: editorSessionId.current
115
124
  };
116
125
  }, [props.appearance]);
126
+ var memodEditorFeatureFlags = useMemoEditorFeatureFlags(props.featureFlags);
117
127
  return jsx(FabricEditorAnalyticsContext
118
128
  // @ts-expect-error Type 'string' is not assignable to type '"editorCore" | "renderer"'.
119
129
  , {
120
130
  data: data
121
- }, jsx(Editor, props));
131
+ }, jsx(Editor, _extends({}, props, {
132
+ featureFlags: memodEditorFeatureFlags
133
+ })));
122
134
  }
123
135
  ComposableEditor.propTypes = {
124
136
  minHeight: function minHeight(_ref) {
@@ -70,9 +70,6 @@ export var ErrorBoundaryWithEditorView = /*#__PURE__*/function (_React$Component
70
70
  eventType: EVENT_TYPE.OPERATIONAL,
71
71
  attributes: {
72
72
  errorId: sharedId
73
- },
74
- nonPrivacySafeAttributes: {
75
- errorStack: errorStack
76
73
  }
77
74
  });
78
75
  if (_this.featureFlags.ufo && _this.props.editorView) {
@@ -60,9 +60,6 @@ export function InlineCommentView(_ref) {
60
60
  position: position,
61
61
  docSize: editorView.state.doc.nodeSize,
62
62
  error: error.toString()
63
- },
64
- nonPrivacySafeAttributes: {
65
- errorStack: error.stack || undefined
66
63
  }
67
64
  };
68
65
  dispatchAnalyticsEvent(payload);
@@ -19,9 +19,6 @@ export var freezeUnsafeTransactionProperties = function freezeUnsafeTransactionP
19
19
  eventType: EVENT_TYPE.OPERATIONAL,
20
20
  attributes: {
21
21
  pluginKey: pluginKey || 'unknown'
22
- },
23
- nonPrivacySafeAttributes: {
24
- stack: new Error().stack
25
22
  }
26
23
  });
27
24
  }
@@ -1,2 +1,2 @@
1
1
  export var name = "@atlaskit/editor-core";
2
- export var version = "189.6.5";
2
+ export var version = "189.6.8";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-core",
3
- "version": "189.6.5",
3
+ "version": "189.6.8",
4
4
  "description": "A package contains Atlassian editor core functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -288,10 +288,6 @@
288
288
  "platform.editor.table.drag-and-drop": {
289
289
  "type": "boolean"
290
290
  },
291
- "platform.editor.table.overflow-state-analytics": {
292
- "type": "boolean",
293
- "referenceOnly": "true"
294
- },
295
291
  "platform.editor.table.increase-shadow-visibility_lh89r": {
296
292
  "type": "boolean",
297
293
  "referenceOnly": "true"