@atlaskit/editor-plugin-synced-block 11.0.0 → 11.0.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.
Files changed (29) hide show
  1. package/AGENTS.md +3 -3
  2. package/CHANGELOG.md +13 -0
  3. package/dist/cjs/nodeviews/bodiedSyncedBlock.js +25 -193
  4. package/dist/cjs/nodeviews/syncedBlock.js +4 -25
  5. package/dist/cjs/pm-plugins/main.js +64 -130
  6. package/dist/cjs/pm-plugins/menu-and-toolbar-experiences.js +2 -7
  7. package/dist/cjs/pm-plugins/utils/has-synced-blocks.js +2 -2
  8. package/dist/cjs/syncedBlockPlugin.js +3 -12
  9. package/dist/es2019/nodeviews/bodiedSyncedBlock.js +9 -150
  10. package/dist/es2019/nodeviews/syncedBlock.js +3 -17
  11. package/dist/es2019/pm-plugins/main.js +65 -133
  12. package/dist/es2019/pm-plugins/menu-and-toolbar-experiences.js +2 -7
  13. package/dist/es2019/pm-plugins/utils/has-synced-blocks.js +2 -2
  14. package/dist/es2019/syncedBlockPlugin.js +3 -12
  15. package/dist/esm/nodeviews/bodiedSyncedBlock.js +24 -192
  16. package/dist/esm/nodeviews/syncedBlock.js +4 -25
  17. package/dist/esm/pm-plugins/main.js +65 -131
  18. package/dist/esm/pm-plugins/menu-and-toolbar-experiences.js +2 -7
  19. package/dist/esm/pm-plugins/utils/has-synced-blocks.js +2 -2
  20. package/dist/esm/syncedBlockPlugin.js +3 -12
  21. package/dist/types/nodeviews/bodiedSyncedBlock.d.ts +1 -13
  22. package/dist/types/pm-plugins/main.d.ts +6 -10
  23. package/dist/types/pm-plugins/utils/has-synced-blocks.d.ts +2 -2
  24. package/dist/types/types/index.d.ts +1 -2
  25. package/package.json +4 -4
  26. package/dist/cjs/ui/BodiedSyncBlockWrapper.js +0 -25
  27. package/dist/es2019/ui/BodiedSyncBlockWrapper.js +0 -19
  28. package/dist/esm/ui/BodiedSyncBlockWrapper.js +0 -18
  29. package/dist/types/ui/BodiedSyncBlockWrapper.d.ts +0 -9
package/AGENTS.md CHANGED
@@ -39,7 +39,7 @@ src/
39
39
  │ └── bodiedSyncedBlock.tsx # NodeView for source (bodiedSyncBlock) — nested editor with content
40
40
  ├── pm-plugins/
41
41
  │ ├── main.ts # Core state machine: lifecycle, creation, deletion, cache,
42
- │ │ status decoration apply path (gated by editor_synced_block_perf)
42
+ │ │ status decoration apply path
43
43
  │ ├── menu-and-toolbar-experiences.ts # Experience tracking for menu/toolbar interactions
44
44
  │ └── utils/
45
45
  │ ├── track-sync-blocks.ts # Tracks mutations, updates shared state
@@ -61,7 +61,7 @@ src/
61
61
  │ ├── DeleteConfirmationModal.tsx # Deletion confirmation dialog
62
62
  │ ├── SyncBlockRefresher.tsx # Periodic data refresh from backend
63
63
  │ ├── SyncBlockLabel.tsx # Source/reference label chrome
64
- │ ├── BodiedSyncBlockWrapper.tsx / SyncBlockRendererWrapper.tsx # Node-view wrappers
64
+ │ ├── SyncBlockRendererWrapper.tsx # Node-view wrapper
65
65
  │ ├── SyncBlockSSRReactContextsProvider.tsx # Supplies React contexts during SSR
66
66
  │ └── Flag.tsx # Error/info flags (offline, copy notifications)
67
67
  └── types/
@@ -80,7 +80,7 @@ from outside the plugin lifecycle:
80
80
 
81
81
  ### Lazy Init & Perf (EDITOR-6928 / EDITOR-6930)
82
82
 
83
- Behind the `editor_synced_block_perf` experiment, `main.ts`:
83
+ `main.ts`:
84
84
 
85
85
  - Skips creating synced-block plugin state and node-views for documents with no synced blocks
86
86
  (`hasSyncedBlocks(doc)`).
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @atlaskit/editor-plugin-synced-block
2
2
 
3
+ ## 11.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`72f7cec91a1d4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/72f7cec91a1d4) -
8
+ Remove the `editor_synced_block_perf` experiment. The lazy node-view init and cached
9
+ status-decoration apply path are now always on, and the legacy full-document `descendants()`
10
+ decoration walk has been removed.
11
+ - [`72f7cec91a1d4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/72f7cec91a1d4) -
12
+ Remove the `platform_synced_block_use_new_source_nodeview` experiment. The new source node view is
13
+ now always used and the superseded implementation has been deleted.
14
+ - Updated dependencies
15
+
3
16
  ## 11.0.0
4
17
 
5
18
  ### Patch Changes
@@ -4,187 +4,19 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.bodiedSyncBlockNodeViewOld = exports.bodiedSyncBlockNodeView = exports.BodiedSyncBlock = void 0;
7
+ exports.bodiedSyncBlockNodeView = exports.BodiedSyncBlock = void 0;
8
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
9
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
11
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
12
- var _get2 = _interopRequireDefault(require("@babel/runtime/helpers/get"));
13
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
14
10
  var _react = _interopRequireDefault(require("react"));
15
11
  var _analytics = require("@atlaskit/editor-common/analytics");
16
12
  var _coreUtils = require("@atlaskit/editor-common/core-utils");
17
13
  var _errorBoundary = require("@atlaskit/editor-common/error-boundary");
18
- var _reactNodeView = _interopRequireDefault(require("@atlaskit/editor-common/react-node-view"));
19
14
  var _syncBlock = require("@atlaskit/editor-common/sync-block");
20
15
  var _editorPluginConnectivity = require("@atlaskit/editor-plugin-connectivity");
21
16
  var _model = require("@atlaskit/editor-prosemirror/model");
22
17
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
23
- var _BodiedSyncBlockWrapper = require("../ui/BodiedSyncBlockWrapper");
24
18
  var _SyncBlockLabel = require("../ui/SyncBlockLabel");
25
19
  var _isEmptySourceSyncBlock = require("./isEmptySourceSyncBlock");
26
- function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
27
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
28
- function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
29
- var toDOMOld = function toDOMOld() {
30
- return ['div', {
31
- class: _syncBlock.BodiedSyncBlockSharedCssClassName.content,
32
- contenteditable: true
33
- }, 0];
34
- };
35
- var BodiedSyncBlockOld = /*#__PURE__*/function (_ReactNodeView) {
36
- function BodiedSyncBlockOld(props) {
37
- var _this;
38
- (0, _classCallCheck2.default)(this, BodiedSyncBlockOld);
39
- _this = _callSuper(this, BodiedSyncBlockOld, [props.node, props.view, props.getPos, props.portalProviderAPI, props.eventDispatcher, props]);
40
- _this.api = props.api;
41
- _this.syncBlockStore = props.syncBlockStore;
42
- _this.handleConnectivityModeChange();
43
- _this.handleViewModeChange();
44
- return _this;
45
- }
46
- (0, _inherits2.default)(BodiedSyncBlockOld, _ReactNodeView);
47
- return (0, _createClass2.default)(BodiedSyncBlockOld, [{
48
- key: "updateContentEditable",
49
- value: function updateContentEditable(_ref) {
50
- var _this$api, _this$api2;
51
- var contentDOM = _ref.contentDOM,
52
- nextConnectivityMode = _ref.nextConnectivityMode,
53
- nextViewMode = _ref.nextViewMode;
54
- var connectivityMode = nextConnectivityMode !== null && nextConnectivityMode !== void 0 ? nextConnectivityMode : (_this$api = this.api) === null || _this$api === void 0 || (_this$api = _this$api.connectivity) === null || _this$api === void 0 || (_this$api = _this$api.sharedState) === null || _this$api === void 0 || (_this$api = _this$api.currentState()) === null || _this$api === void 0 ? void 0 : _this$api.mode;
55
- var viewMode = nextViewMode !== null && nextViewMode !== void 0 ? nextViewMode : (_this$api2 = this.api) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.editorViewMode) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.sharedState) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.currentState()) === null || _this$api2 === void 0 ? void 0 : _this$api2.mode;
56
- var isOnline = !(0, _editorPluginConnectivity.isOfflineMode)(connectivityMode);
57
- var isEditMode = viewMode !== 'view';
58
- var shouldBeEditable = isOnline && isEditMode;
59
- contentDOM === null || contentDOM === void 0 || contentDOM.setAttribute('contenteditable', shouldBeEditable ? 'true' : 'false');
60
- }
61
- }, {
62
- key: "handleConnectivityModeChange",
63
- value: function handleConnectivityModeChange() {
64
- var _this$api3,
65
- _this2 = this;
66
- if ((_this$api3 = this.api) !== null && _this$api3 !== void 0 && _this$api3.connectivity) {
67
- this.cleanupConnectivityModeListener = this.api.connectivity.sharedState.onChange(function (_ref2) {
68
- var nextSharedState = _ref2.nextSharedState;
69
- _this2.updateContentEditable({
70
- contentDOM: _this2.contentDOM,
71
- nextConnectivityMode: nextSharedState.mode
72
- });
73
- });
74
- }
75
- }
76
- }, {
77
- key: "handleViewModeChange",
78
- value: function handleViewModeChange() {
79
- var _this$api4,
80
- _this3 = this;
81
- if ((_this$api4 = this.api) !== null && _this$api4 !== void 0 && _this$api4.editorViewMode) {
82
- this.cleanupViewModeListener = this.api.editorViewMode.sharedState.onChange(function (_ref3) {
83
- var nextSharedState = _ref3.nextSharedState;
84
- _this3.updateContentEditable({
85
- contentDOM: _this3.contentDOM,
86
- nextViewMode: nextSharedState === null || nextSharedState === void 0 ? void 0 : nextSharedState.mode
87
- });
88
- });
89
- }
90
- }
91
- }, {
92
- key: "createDomRef",
93
- value: function createDomRef() {
94
- // eslint-disable-next-line @atlaskit/platform/no-direct-document-usage -- NodeView DOM must be created against active runtime document
95
- var domRef = document.createElement('div');
96
- domRef.classList.add(_syncBlock.BodiedSyncBlockSharedCssClassName.prefix);
97
- domRef.classList.toggle(_syncBlock.BodiedSyncBlockSharedCssClassName.empty, (0, _isEmptySourceSyncBlock.isEmptySourceSyncBlock)(this.node));
98
- return domRef;
99
- }
100
-
101
- /**
102
- * Keeps the empty marker class in sync so the source placeholder can be shown purely from
103
- * document state. See `isEmptySourceSyncBlock` for why the DOM is not used to decide this.
104
- */
105
- }, {
106
- key: "update",
107
- value: function update(node, decorations) {
108
- var updated = _superPropGet(BodiedSyncBlockOld, "update", this, 3)([node, decorations]);
109
- if (updated) {
110
- // `ReactNodeView`'s `dom` getter throws rather than returning nullish once the view is
111
- // destroyed, so optional chaining here would be misleading. `super.update()` only
112
- // returns true while the view is still mounted, so the ref is guaranteed.
113
- this.dom.classList.toggle(_syncBlock.BodiedSyncBlockSharedCssClassName.empty, (0, _isEmptySourceSyncBlock.isEmptySourceSyncBlock)(this.node));
114
- }
115
- return updated;
116
- }
117
- }, {
118
- key: "render",
119
- value: function render(_props, forwardRef) {
120
- var _this$api$syncedBlock, _this$api5, _this$api6;
121
- // Use passed syncBlockStore for SSR where sharedState.currentState() is delayed
122
- var syncBlockStore = (_this$api$syncedBlock = (_this$api5 = this.api) === null || _this$api5 === void 0 || (_this$api5 = _this$api5.syncedBlock.sharedState) === null || _this$api5 === void 0 || (_this$api5 = _this$api5.currentState()) === null || _this$api5 === void 0 ? void 0 : _this$api5.syncBlockStore) !== null && _this$api$syncedBlock !== void 0 ? _this$api$syncedBlock : this.syncBlockStore;
123
- if (!syncBlockStore) {
124
- return null;
125
- }
126
- return /*#__PURE__*/_react.default.createElement(_errorBoundary.ErrorBoundary, {
127
- component: _analytics.ACTION_SUBJECT.SYNCED_BLOCK,
128
- dispatchAnalyticsEvent: (_this$api6 = this.api) === null || _this$api6 === void 0 || (_this$api6 = _this$api6.analytics) === null || _this$api6 === void 0 ? void 0 : _this$api6.actions.fireAnalyticsEvent,
129
- fallbackComponent: null
130
- }, /*#__PURE__*/_react.default.createElement(_BodiedSyncBlockWrapper.BodiedSyncBlockWrapper, {
131
- ref: forwardRef,
132
- syncBlockStore: syncBlockStore,
133
- node: this.node
134
- }));
135
- }
136
- }, {
137
- key: "getContentDOM",
138
- value: function getContentDOM() {
139
- // eslint-disable-next-line @atlaskit/platform/no-direct-document-usage -- NodeView serialization must target active runtime document
140
- var _DOMSerializer$render = _model.DOMSerializer.renderSpec(document, toDOMOld()),
141
- dom = _DOMSerializer$render.dom,
142
- contentDOM = _DOMSerializer$render.contentDOM;
143
- // In SSR, the first check won't work, so fallback to nodeType check
144
- if (dom instanceof HTMLElement || dom.nodeType === 1) {
145
- this.updateContentEditable({
146
- contentDOM: contentDOM
147
- });
148
- // eslint-disable-next-line @atlaskit/editor/no-as-casting
149
- return {
150
- dom: dom,
151
- contentDOM: contentDOM
152
- };
153
- }
154
- return undefined;
155
- }
156
- }, {
157
- key: "destroy",
158
- value: function destroy() {
159
- if (this.cleanupConnectivityModeListener) {
160
- this.cleanupConnectivityModeListener();
161
- }
162
- if (this.cleanupViewModeListener) {
163
- this.cleanupViewModeListener();
164
- }
165
- }
166
- }]);
167
- }(_reactNodeView.default);
168
- var bodiedSyncBlockNodeViewOld = exports.bodiedSyncBlockNodeViewOld = function bodiedSyncBlockNodeViewOld(_ref4) {
169
- var pluginOptions = _ref4.pluginOptions,
170
- pmPluginFactoryParams = _ref4.pmPluginFactoryParams,
171
- api = _ref4.api,
172
- syncBlockStore = _ref4.syncBlockStore;
173
- return function (node, view, getPos) {
174
- var portalProviderAPI = pmPluginFactoryParams.portalProviderAPI,
175
- eventDispatcher = pmPluginFactoryParams.eventDispatcher;
176
- return new BodiedSyncBlockOld({
177
- api: api,
178
- pluginOptions: pluginOptions,
179
- node: node,
180
- view: view,
181
- getPos: getPos,
182
- portalProviderAPI: portalProviderAPI,
183
- eventDispatcher: eventDispatcher,
184
- syncBlockStore: syncBlockStore
185
- }).init();
186
- };
187
- };
188
20
  var toDOM = function toDOM(node) {
189
21
  return ['div', {
190
22
  class: "".concat(_syncBlock.BodiedSyncBlockSharedCssClassName.prefix, " bodiedSyncBlockView-content-wrap"),
@@ -197,7 +29,7 @@ var toDOM = function toDOM(node) {
197
29
  };
198
30
  var BodiedSyncBlock = exports.BodiedSyncBlock = /*#__PURE__*/function () {
199
31
  function BodiedSyncBlock(node, view, getPos, api, nodeViewPortalProviderAPI) {
200
- var _this4 = this;
32
+ var _this = this;
201
33
  (0, _classCallCheck2.default)(this, BodiedSyncBlock);
202
34
  this.node = node;
203
35
  this.view = view;
@@ -205,9 +37,9 @@ var BodiedSyncBlock = exports.BodiedSyncBlock = /*#__PURE__*/function () {
205
37
  this.api = api;
206
38
  this.nodeViewPortalProviderAPI = nodeViewPortalProviderAPI;
207
39
  // eslint-disable-next-line @atlaskit/platform/no-direct-document-usage -- NodeView serialization must target active runtime document
208
- var _DOMSerializer$render2 = _model.DOMSerializer.renderSpec(document, toDOM(this.node)),
209
- dom = _DOMSerializer$render2.dom,
210
- contentDOM = _DOMSerializer$render2.contentDOM;
40
+ var _DOMSerializer$render = _model.DOMSerializer.renderSpec(document, toDOM(this.node)),
41
+ dom = _DOMSerializer$render.dom,
42
+ contentDOM = _DOMSerializer$render.contentDOM;
211
43
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
212
44
  this.dom = dom;
213
45
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
@@ -231,11 +63,11 @@ var BodiedSyncBlock = exports.BodiedSyncBlock = /*#__PURE__*/function () {
231
63
  }
232
64
  this.labelKey = crypto.randomUUID();
233
65
  this.nodeViewPortalProviderAPI.render(function () {
234
- var _this4$api;
66
+ var _this$api;
235
67
  return /*#__PURE__*/_react.default.createElement(_errorBoundary.ErrorBoundary, {
236
68
  component: _analytics.ACTION_SUBJECT.SYNCED_BLOCK,
237
69
  componentId: _analytics.ACTION_SUBJECT_ID.SYNCED_BLOCK_LABEL,
238
- dispatchAnalyticsEvent: (_this4$api = _this4.api) === null || _this4$api === void 0 || (_this4$api = _this4$api.analytics) === null || _this4$api === void 0 ? void 0 : _this4$api.actions.fireAnalyticsEvent,
70
+ dispatchAnalyticsEvent: (_this$api = _this.api) === null || _this$api === void 0 || (_this$api = _this$api.analytics) === null || _this$api === void 0 ? void 0 : _this$api.actions.fireAnalyticsEvent,
239
71
  fallbackComponent: null
240
72
  }, /*#__PURE__*/_react.default.createElement(_SyncBlockLabel.SyncBlockLabel, {
241
73
  isSource: true,
@@ -252,12 +84,12 @@ var BodiedSyncBlock = exports.BodiedSyncBlock = /*#__PURE__*/function () {
252
84
  }
253
85
  return (0, _createClass2.default)(BodiedSyncBlock, [{
254
86
  key: "updateContentEditable",
255
- value: function updateContentEditable(_ref5) {
256
- var _this$api7, _this$api8;
257
- var nextConnectivityMode = _ref5.nextConnectivityMode,
258
- nextViewMode = _ref5.nextViewMode;
259
- var connectivityMode = nextConnectivityMode !== null && nextConnectivityMode !== void 0 ? nextConnectivityMode : (_this$api7 = this.api) === null || _this$api7 === void 0 || (_this$api7 = _this$api7.connectivity) === null || _this$api7 === void 0 || (_this$api7 = _this$api7.sharedState) === null || _this$api7 === void 0 || (_this$api7 = _this$api7.currentState()) === null || _this$api7 === void 0 ? void 0 : _this$api7.mode;
260
- var viewMode = nextViewMode !== null && nextViewMode !== void 0 ? nextViewMode : (_this$api8 = this.api) === null || _this$api8 === void 0 || (_this$api8 = _this$api8.editorViewMode) === null || _this$api8 === void 0 || (_this$api8 = _this$api8.sharedState) === null || _this$api8 === void 0 || (_this$api8 = _this$api8.currentState()) === null || _this$api8 === void 0 ? void 0 : _this$api8.mode;
87
+ value: function updateContentEditable(_ref) {
88
+ var _this$api2, _this$api3;
89
+ var nextConnectivityMode = _ref.nextConnectivityMode,
90
+ nextViewMode = _ref.nextViewMode;
91
+ var connectivityMode = nextConnectivityMode !== null && nextConnectivityMode !== void 0 ? nextConnectivityMode : (_this$api2 = this.api) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.connectivity) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.sharedState) === null || _this$api2 === void 0 || (_this$api2 = _this$api2.currentState()) === null || _this$api2 === void 0 ? void 0 : _this$api2.mode;
92
+ var viewMode = nextViewMode !== null && nextViewMode !== void 0 ? nextViewMode : (_this$api3 = this.api) === null || _this$api3 === void 0 || (_this$api3 = _this$api3.editorViewMode) === null || _this$api3 === void 0 || (_this$api3 = _this$api3.sharedState) === null || _this$api3 === void 0 || (_this$api3 = _this$api3.currentState()) === null || _this$api3 === void 0 ? void 0 : _this$api3.mode;
261
93
  var isOnline = !(0, _editorPluginConnectivity.isOfflineMode)(connectivityMode);
262
94
  var isEditMode = viewMode !== 'view';
263
95
  var shouldBeEditable = isOnline && isEditMode;
@@ -266,12 +98,12 @@ var BodiedSyncBlock = exports.BodiedSyncBlock = /*#__PURE__*/function () {
266
98
  }, {
267
99
  key: "handleConnectivityModeChange",
268
100
  value: function handleConnectivityModeChange() {
269
- var _this$api9,
270
- _this5 = this;
271
- if ((_this$api9 = this.api) !== null && _this$api9 !== void 0 && _this$api9.connectivity) {
272
- this.cleanupConnectivityModeListener = this.api.connectivity.sharedState.onChange(function (_ref6) {
273
- var nextSharedState = _ref6.nextSharedState;
274
- _this5.updateContentEditable({
101
+ var _this$api4,
102
+ _this2 = this;
103
+ if ((_this$api4 = this.api) !== null && _this$api4 !== void 0 && _this$api4.connectivity) {
104
+ this.cleanupConnectivityModeListener = this.api.connectivity.sharedState.onChange(function (_ref2) {
105
+ var nextSharedState = _ref2.nextSharedState;
106
+ _this2.updateContentEditable({
275
107
  nextConnectivityMode: nextSharedState.mode
276
108
  });
277
109
  });
@@ -280,12 +112,12 @@ var BodiedSyncBlock = exports.BodiedSyncBlock = /*#__PURE__*/function () {
280
112
  }, {
281
113
  key: "handleViewModeChange",
282
114
  value: function handleViewModeChange() {
283
- var _this$api0,
284
- _this6 = this;
285
- if ((_this$api0 = this.api) !== null && _this$api0 !== void 0 && _this$api0.editorViewMode) {
286
- this.cleanupViewModeListener = this.api.editorViewMode.sharedState.onChange(function (_ref7) {
287
- var nextSharedState = _ref7.nextSharedState;
288
- _this6.updateContentEditable({
115
+ var _this$api5,
116
+ _this3 = this;
117
+ if ((_this$api5 = this.api) !== null && _this$api5 !== void 0 && _this$api5.editorViewMode) {
118
+ this.cleanupViewModeListener = this.api.editorViewMode.sharedState.onChange(function (_ref3) {
119
+ var nextSharedState = _ref3.nextSharedState;
120
+ _this3.updateContentEditable({
289
121
  nextViewMode: nextSharedState === null || nextSharedState === void 0 ? void 0 : nextSharedState.mode
290
122
  });
291
123
  });
@@ -19,7 +19,6 @@ var _reactNodeView = _interopRequireDefault(require("@atlaskit/editor-common/rea
19
19
  var _syncBlock = require("@atlaskit/editor-common/sync-block");
20
20
  var _state = require("@atlaskit/editor-prosemirror/state");
21
21
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
22
- var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
23
22
  var _editorCommands = require("../editor-commands");
24
23
  var _SyncBlockRendererWrapper = require("../ui/SyncBlockRendererWrapper");
25
24
  var _SyncBlockSSRReactContextsProvider = require("../ui/SyncBlockSSRReactContextsProvider");
@@ -194,12 +193,7 @@ var SyncBlock = exports.SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
194
193
  }, {
195
194
  key: "render",
196
195
  value: function render(_ref) {
197
- var _this$options,
198
- _this$api$syncedBlock2,
199
- _this$api2,
200
- _this$api3,
201
- _this2 = this,
202
- _this$options2;
196
+ var _this$options, _this$api$syncedBlock2, _this$api2, _this$api3, _this$options2;
203
197
  var getPos = _ref.getPos;
204
198
  if (!((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.syncedBlockRenderer)) {
205
199
  return null;
@@ -215,10 +209,6 @@ var SyncBlock = exports.SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
215
209
  return null;
216
210
  }
217
211
 
218
- // Use expValEqualsNoExposure — the exposure is already fired once at plugin
219
- // creation time in syncedBlockPlugin.tsx and main.ts createPlugin().
220
- var isPerfEnabled = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('editor_synced_block_perf', 'isEnabled', true);
221
-
222
212
  // get document node from data provider
223
213
  return /*#__PURE__*/_react.default.createElement(_SyncBlockSSRReactContextsProvider.SyncBlockSSRReactContextsProvider, {
224
214
  intl: this.intl
@@ -226,20 +216,9 @@ var SyncBlock = exports.SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
226
216
  component: _analytics.ACTION_SUBJECT.SYNCED_BLOCK,
227
217
  dispatchAnalyticsEvent: (_this$api3 = this.api) === null || _this$api3 === void 0 || (_this$api3 = _this$api3.analytics) === null || _this$api3 === void 0 ? void 0 : _this$api3.actions.fireAnalyticsEvent,
228
218
  fallbackComponent: null
229
- }, /*#__PURE__*/_react.default.createElement(_syncBlock.SyncBlockActionsProvider
230
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
231
- , {
232
- removeSyncBlock: isPerfEnabled ? this.removeSyncBlockStable : function () {
233
- var pos = getPos();
234
- if (pos !== undefined) {
235
- (0, _editorCommands.removeSyncedBlockAtPos)(_this2.api, pos);
236
- }
237
- }
238
- // eslint-disable-next-line @atlassian/perf-linting/no-unstable-inline-props -- Ignored via go/ees017 (to be fixed)
239
- ,
240
- fetchSyncBlockSourceInfo: isPerfEnabled ? this.fetchSyncBlockSourceInfoStable : function (sourceAri) {
241
- return syncBlockStore.referenceManager.fetchSyncBlockSourceInfoBySourceAri(sourceAri);
242
- }
219
+ }, /*#__PURE__*/_react.default.createElement(_syncBlock.SyncBlockActionsProvider, {
220
+ removeSyncBlock: this.removeSyncBlockStable,
221
+ fetchSyncBlockSourceInfo: this.fetchSyncBlockSourceInfoStable
243
222
  }, /*#__PURE__*/_react.default.createElement(_SyncBlockRendererWrapper.SyncBlockRendererWrapper, {
244
223
  localId: localId,
245
224
  resourceId: resourceId,