@atlaskit/editor-plugin-synced-block 5.3.34 → 5.3.35

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,12 @@
1
1
  # @atlaskit/editor-plugin-synced-block
2
2
 
3
+ ## 5.3.35
4
+
5
+ ### Patch Changes
6
+
7
+ - [`d144f08676a16`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d144f08676a16) -
8
+ [EDITOR-5528] Remove lazy loading for bodiedSyncBlock node
9
+
3
10
  ## 5.3.34
4
11
 
5
12
  ### Patch Changes
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.bodiedSyncBlockNodeView = 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
10
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
@@ -17,6 +17,7 @@ var _reactNodeView = _interopRequireDefault(require("@atlaskit/editor-common/rea
17
17
  var _syncBlock = require("@atlaskit/editor-common/sync-block");
18
18
  var _editorPluginConnectivity = require("@atlaskit/editor-plugin-connectivity");
19
19
  var _model = require("@atlaskit/editor-prosemirror/model");
20
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
21
  var _BodiedSyncBlockWrapper = require("../ui/BodiedSyncBlockWrapper");
21
22
  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)); }
22
23
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
@@ -26,12 +27,13 @@ var toDOM = function toDOM() {
26
27
  contenteditable: true
27
28
  }, 0];
28
29
  };
29
- var BodiedSyncBlock = /*#__PURE__*/function (_ReactNodeView) {
30
+ var BodiedSyncBlock = exports.BodiedSyncBlock = /*#__PURE__*/function (_ReactNodeView) {
30
31
  function BodiedSyncBlock(props) {
31
32
  var _this;
32
33
  (0, _classCallCheck2.default)(this, BodiedSyncBlock);
33
34
  _this = _callSuper(this, BodiedSyncBlock, [props.node, props.view, props.getPos, props.portalProviderAPI, props.eventDispatcher, props]);
34
35
  _this.api = props.api;
36
+ _this.syncBlockStore = props.syncBlockStore;
35
37
  _this.handleConnectivityModeChange();
36
38
  _this.handleViewModeChange();
37
39
  return _this;
@@ -91,8 +93,9 @@ var BodiedSyncBlock = /*#__PURE__*/function (_ReactNodeView) {
91
93
  }, {
92
94
  key: "render",
93
95
  value: function render(_props, forwardRef) {
94
- var _this$api5, _this$api6;
95
- var syncBlockStore = (_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;
96
+ var _this$api$syncedBlock, _this$api5, _this$api6;
97
+ // Use passed syncBlockStore for SSR where sharedState.currentState() is delayed
98
+ 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;
96
99
  if (!syncBlockStore) {
97
100
  return null;
98
101
  }
@@ -112,10 +115,12 @@ var BodiedSyncBlock = /*#__PURE__*/function (_ReactNodeView) {
112
115
  var _DOMSerializer$render = _model.DOMSerializer.renderSpec(document, toDOM()),
113
116
  dom = _DOMSerializer$render.dom,
114
117
  contentDOM = _DOMSerializer$render.contentDOM;
115
- if (dom instanceof HTMLElement) {
118
+ // In SSR, the first check won't work, so fallback to nodeType check
119
+ if (dom instanceof HTMLElement || dom.nodeType === 1 && (0, _platformFeatureFlags.fg)('platform_synced_block_patch_5')) {
116
120
  this.updateContentEditable({
117
121
  contentDOM: contentDOM
118
122
  });
123
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
119
124
  return {
120
125
  dom: dom,
121
126
  contentDOM: contentDOM
@@ -138,7 +143,8 @@ var BodiedSyncBlock = /*#__PURE__*/function (_ReactNodeView) {
138
143
  var bodiedSyncBlockNodeView = exports.bodiedSyncBlockNodeView = function bodiedSyncBlockNodeView(_ref4) {
139
144
  var pluginOptions = _ref4.pluginOptions,
140
145
  pmPluginFactoryParams = _ref4.pmPluginFactoryParams,
141
- api = _ref4.api;
146
+ api = _ref4.api,
147
+ syncBlockStore = _ref4.syncBlockStore;
142
148
  return function (node, view, getPos) {
143
149
  var portalProviderAPI = pmPluginFactoryParams.portalProviderAPI,
144
150
  eventDispatcher = pmPluginFactoryParams.eventDispatcher;
@@ -149,7 +155,8 @@ var bodiedSyncBlockNodeView = exports.bodiedSyncBlockNodeView = function bodiedS
149
155
  view: view,
150
156
  getPos: getPos,
151
157
  portalProviderAPI: portalProviderAPI,
152
- eventDispatcher: eventDispatcher
158
+ eventDispatcher: eventDispatcher,
159
+ syncBlockStore: syncBlockStore
153
160
  }).init();
154
161
  };
155
162
  };
@@ -20,6 +20,7 @@ var _view = require("@atlaskit/editor-prosemirror/view");
20
20
  var _editorSyncedBlockProvider = require("@atlaskit/editor-synced-block-provider");
21
21
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
22
22
  var _bodiedLazySyncedBlock = require("../nodeviews/bodiedLazySyncedBlock");
23
+ var _bodiedSyncedBlock = require("../nodeviews/bodiedSyncedBlock");
23
24
  var _syncedBlock = require("../nodeviews/syncedBlock");
24
25
  var _types = require("../types");
25
26
  var _handleBodiedSyncBlockCreation = require("./utils/handle-bodied-sync-block-creation");
@@ -339,7 +340,12 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
339
340
  }).init()
340
341
  );
341
342
  },
342
- bodiedSyncBlock: (0, _bodiedLazySyncedBlock.lazyBodiedSyncBlockView)({
343
+ bodiedSyncBlock: (0, _platformFeatureFlags.fg)('platform_synced_block_patch_5') ? (0, _bodiedSyncedBlock.bodiedSyncBlockNodeView)({
344
+ pluginOptions: options,
345
+ pmPluginFactoryParams: pmPluginFactoryParams,
346
+ api: api,
347
+ syncBlockStore: syncBlockStore
348
+ }) : (0, _bodiedLazySyncedBlock.lazyBodiedSyncBlockView)({
343
349
  pluginOptions: options,
344
350
  pmPluginFactoryParams: pmPluginFactoryParams,
345
351
  api: api
@@ -5,15 +5,17 @@ import ReactNodeView from '@atlaskit/editor-common/react-node-view';
5
5
  import { BodiedSyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block';
6
6
  import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
7
7
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
8
9
  import { BodiedSyncBlockWrapper } from '../ui/BodiedSyncBlockWrapper';
9
10
  const toDOM = () => ['div', {
10
11
  class: BodiedSyncBlockSharedCssClassName.content,
11
12
  contenteditable: true
12
13
  }, 0];
13
- class BodiedSyncBlock extends ReactNodeView {
14
+ export class BodiedSyncBlock extends ReactNodeView {
14
15
  constructor(props) {
15
16
  super(props.node, props.view, props.getPos, props.portalProviderAPI, props.eventDispatcher, props);
16
17
  this.api = props.api;
18
+ this.syncBlockStore = props.syncBlockStore;
17
19
  this.handleConnectivityModeChange();
18
20
  this.handleViewModeChange();
19
21
  }
@@ -62,8 +64,9 @@ class BodiedSyncBlock extends ReactNodeView {
62
64
  return domRef;
63
65
  }
64
66
  render(_props, forwardRef) {
65
- var _this$api5, _this$api5$syncedBloc, _this$api5$syncedBloc2, _this$api6, _this$api6$analytics;
66
- const syncBlockStore = (_this$api5 = this.api) === null || _this$api5 === void 0 ? void 0 : (_this$api5$syncedBloc = _this$api5.syncedBlock.sharedState) === null || _this$api5$syncedBloc === void 0 ? void 0 : (_this$api5$syncedBloc2 = _this$api5$syncedBloc.currentState()) === null || _this$api5$syncedBloc2 === void 0 ? void 0 : _this$api5$syncedBloc2.syncBlockStore;
67
+ var _this$api$syncedBlock, _this$api5, _this$api5$syncedBloc, _this$api5$syncedBloc2, _this$api6, _this$api6$analytics;
68
+ // Use passed syncBlockStore for SSR where sharedState.currentState() is delayed
69
+ const syncBlockStore = (_this$api$syncedBlock = (_this$api5 = this.api) === null || _this$api5 === void 0 ? void 0 : (_this$api5$syncedBloc = _this$api5.syncedBlock.sharedState) === null || _this$api5$syncedBloc === void 0 ? void 0 : (_this$api5$syncedBloc2 = _this$api5$syncedBloc.currentState()) === null || _this$api5$syncedBloc2 === void 0 ? void 0 : _this$api5$syncedBloc2.syncBlockStore) !== null && _this$api$syncedBlock !== void 0 ? _this$api$syncedBlock : this.syncBlockStore;
67
70
  if (!syncBlockStore) {
68
71
  return null;
69
72
  }
@@ -82,12 +85,14 @@ class BodiedSyncBlock extends ReactNodeView {
82
85
  dom,
83
86
  contentDOM
84
87
  } = DOMSerializer.renderSpec(document, toDOM());
85
- if (dom instanceof HTMLElement) {
88
+ // In SSR, the first check won't work, so fallback to nodeType check
89
+ if (dom instanceof HTMLElement || dom.nodeType === 1 && fg('platform_synced_block_patch_5')) {
86
90
  this.updateContentEditable({
87
91
  contentDOM
88
92
  });
93
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
89
94
  return {
90
- dom,
95
+ dom: dom,
91
96
  contentDOM
92
97
  };
93
98
  }
@@ -105,7 +110,8 @@ class BodiedSyncBlock extends ReactNodeView {
105
110
  export const bodiedSyncBlockNodeView = ({
106
111
  pluginOptions,
107
112
  pmPluginFactoryParams,
108
- api
113
+ api,
114
+ syncBlockStore
109
115
  }) => (node, view, getPos) => {
110
116
  const {
111
117
  portalProviderAPI,
@@ -118,6 +124,7 @@ export const bodiedSyncBlockNodeView = ({
118
124
  view,
119
125
  getPos,
120
126
  portalProviderAPI,
121
- eventDispatcher
127
+ eventDispatcher,
128
+ syncBlockStore
122
129
  }).init();
123
130
  };
@@ -10,6 +10,7 @@ import { DecorationSet, Decoration } from '@atlaskit/editor-prosemirror/view';
10
10
  import { convertPMNodesToSyncBlockNodes, rebaseTransaction } from '@atlaskit/editor-synced-block-provider';
11
11
  import { fg } from '@atlaskit/platform-feature-flags';
12
12
  import { lazyBodiedSyncBlockView } from '../nodeviews/bodiedLazySyncedBlock';
13
+ import { bodiedSyncBlockNodeView } from '../nodeviews/bodiedSyncedBlock';
13
14
  import { SyncBlock as SyncBlockView } from '../nodeviews/syncedBlock';
14
15
  import { FLAG_ID } from '../types';
15
16
  import { handleBodiedSyncBlockCreation } from './utils/handle-bodied-sync-block-creation';
@@ -300,7 +301,12 @@ export const createPlugin = (options, pmPluginFactoryParams, syncBlockStore, api
300
301
  eventDispatcher: pmPluginFactoryParams.eventDispatcher,
301
302
  syncBlockStore: syncBlockStore
302
303
  }).init(),
303
- bodiedSyncBlock: lazyBodiedSyncBlockView({
304
+ bodiedSyncBlock: fg('platform_synced_block_patch_5') ? bodiedSyncBlockNodeView({
305
+ pluginOptions: options,
306
+ pmPluginFactoryParams,
307
+ api,
308
+ syncBlockStore
309
+ }) : lazyBodiedSyncBlockView({
304
310
  pluginOptions: options,
305
311
  pmPluginFactoryParams,
306
312
  api
@@ -12,6 +12,7 @@ import ReactNodeView from '@atlaskit/editor-common/react-node-view';
12
12
  import { BodiedSyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block';
13
13
  import { isOfflineMode } from '@atlaskit/editor-plugin-connectivity';
14
14
  import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
15
+ import { fg } from '@atlaskit/platform-feature-flags';
15
16
  import { BodiedSyncBlockWrapper } from '../ui/BodiedSyncBlockWrapper';
16
17
  var toDOM = function toDOM() {
17
18
  return ['div', {
@@ -19,12 +20,13 @@ var toDOM = function toDOM() {
19
20
  contenteditable: true
20
21
  }, 0];
21
22
  };
22
- var BodiedSyncBlock = /*#__PURE__*/function (_ReactNodeView) {
23
+ export var BodiedSyncBlock = /*#__PURE__*/function (_ReactNodeView) {
23
24
  function BodiedSyncBlock(props) {
24
25
  var _this;
25
26
  _classCallCheck(this, BodiedSyncBlock);
26
27
  _this = _callSuper(this, BodiedSyncBlock, [props.node, props.view, props.getPos, props.portalProviderAPI, props.eventDispatcher, props]);
27
28
  _this.api = props.api;
29
+ _this.syncBlockStore = props.syncBlockStore;
28
30
  _this.handleConnectivityModeChange();
29
31
  _this.handleViewModeChange();
30
32
  return _this;
@@ -84,8 +86,9 @@ var BodiedSyncBlock = /*#__PURE__*/function (_ReactNodeView) {
84
86
  }, {
85
87
  key: "render",
86
88
  value: function render(_props, forwardRef) {
87
- var _this$api5, _this$api6;
88
- var syncBlockStore = (_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;
89
+ var _this$api$syncedBlock, _this$api5, _this$api6;
90
+ // Use passed syncBlockStore for SSR where sharedState.currentState() is delayed
91
+ 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;
89
92
  if (!syncBlockStore) {
90
93
  return null;
91
94
  }
@@ -105,10 +108,12 @@ var BodiedSyncBlock = /*#__PURE__*/function (_ReactNodeView) {
105
108
  var _DOMSerializer$render = DOMSerializer.renderSpec(document, toDOM()),
106
109
  dom = _DOMSerializer$render.dom,
107
110
  contentDOM = _DOMSerializer$render.contentDOM;
108
- if (dom instanceof HTMLElement) {
111
+ // In SSR, the first check won't work, so fallback to nodeType check
112
+ if (dom instanceof HTMLElement || dom.nodeType === 1 && fg('platform_synced_block_patch_5')) {
109
113
  this.updateContentEditable({
110
114
  contentDOM: contentDOM
111
115
  });
116
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
112
117
  return {
113
118
  dom: dom,
114
119
  contentDOM: contentDOM
@@ -131,7 +136,8 @@ var BodiedSyncBlock = /*#__PURE__*/function (_ReactNodeView) {
131
136
  export var bodiedSyncBlockNodeView = function bodiedSyncBlockNodeView(_ref4) {
132
137
  var pluginOptions = _ref4.pluginOptions,
133
138
  pmPluginFactoryParams = _ref4.pmPluginFactoryParams,
134
- api = _ref4.api;
139
+ api = _ref4.api,
140
+ syncBlockStore = _ref4.syncBlockStore;
135
141
  return function (node, view, getPos) {
136
142
  var portalProviderAPI = pmPluginFactoryParams.portalProviderAPI,
137
143
  eventDispatcher = pmPluginFactoryParams.eventDispatcher;
@@ -142,7 +148,8 @@ export var bodiedSyncBlockNodeView = function bodiedSyncBlockNodeView(_ref4) {
142
148
  view: view,
143
149
  getPos: getPos,
144
150
  portalProviderAPI: portalProviderAPI,
145
- eventDispatcher: eventDispatcher
151
+ eventDispatcher: eventDispatcher,
152
+ syncBlockStore: syncBlockStore
146
153
  }).init();
147
154
  };
148
155
  };
@@ -18,6 +18,7 @@ import { DecorationSet, Decoration } from '@atlaskit/editor-prosemirror/view';
18
18
  import { convertPMNodesToSyncBlockNodes, rebaseTransaction } from '@atlaskit/editor-synced-block-provider';
19
19
  import { fg } from '@atlaskit/platform-feature-flags';
20
20
  import { lazyBodiedSyncBlockView } from '../nodeviews/bodiedLazySyncedBlock';
21
+ import { bodiedSyncBlockNodeView } from '../nodeviews/bodiedSyncedBlock';
21
22
  import { SyncBlock as SyncBlockView } from '../nodeviews/syncedBlock';
22
23
  import { FLAG_ID } from '../types';
23
24
  import { handleBodiedSyncBlockCreation } from './utils/handle-bodied-sync-block-creation';
@@ -332,7 +333,12 @@ export var createPlugin = function createPlugin(options, pmPluginFactoryParams,
332
333
  }).init()
333
334
  );
334
335
  },
335
- bodiedSyncBlock: lazyBodiedSyncBlockView({
336
+ bodiedSyncBlock: fg('platform_synced_block_patch_5') ? bodiedSyncBlockNodeView({
337
+ pluginOptions: options,
338
+ pmPluginFactoryParams: pmPluginFactoryParams,
339
+ api: api,
340
+ syncBlockStore: syncBlockStore
341
+ }) : lazyBodiedSyncBlockView({
336
342
  pluginOptions: options,
337
343
  pmPluginFactoryParams: pmPluginFactoryParams,
338
344
  api: api
@@ -1,10 +1,12 @@
1
+ import React from 'react';
1
2
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
2
3
  import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
3
- import type { ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
4
+ import type { ForwardRef, ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
4
5
  import ReactNodeView, { type getPosHandler } from '@atlaskit/editor-common/react-node-view';
5
6
  import type { ExtractInjectionAPI, PMPluginFactoryParams } from '@atlaskit/editor-common/types';
6
7
  import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
7
8
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
9
+ import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
8
10
  import type { SyncedBlockPlugin, SyncedBlockPluginOptions } from '../syncedBlockPluginType';
9
11
  export interface BodiedSyncBlockNodeViewProps extends ReactComponentProps {
10
12
  api?: ExtractInjectionAPI<SyncedBlockPlugin>;
@@ -13,11 +15,30 @@ export interface BodiedSyncBlockNodeViewProps extends ReactComponentProps {
13
15
  node: PMNode;
14
16
  pluginOptions: SyncedBlockPluginOptions | undefined;
15
17
  portalProviderAPI: PortalProviderAPI;
18
+ syncBlockStore?: SyncBlockStoreManager;
16
19
  view: EditorView;
17
20
  }
21
+ export declare class BodiedSyncBlock extends ReactNodeView<BodiedSyncBlockNodeViewProps> {
22
+ private cleanupConnectivityModeListener?;
23
+ private cleanupViewModeListener?;
24
+ private api?;
25
+ private syncBlockStore?;
26
+ constructor(props: BodiedSyncBlockNodeViewProps);
27
+ private updateContentEditable;
28
+ private handleConnectivityModeChange;
29
+ private handleViewModeChange;
30
+ createDomRef(): HTMLElement;
31
+ render(_props: never, forwardRef: ForwardRef): React.JSX.Element | null;
32
+ getContentDOM(): {
33
+ dom: HTMLElement;
34
+ contentDOM: HTMLElement | undefined;
35
+ } | undefined;
36
+ destroy(): void;
37
+ }
18
38
  export interface BodiedSyncBlockNodeViewProperties {
19
39
  api?: ExtractInjectionAPI<SyncedBlockPlugin>;
20
40
  pluginOptions: SyncedBlockPluginOptions | undefined;
21
41
  pmPluginFactoryParams: PMPluginFactoryParams;
42
+ syncBlockStore?: SyncBlockStoreManager;
22
43
  }
23
44
  export declare const bodiedSyncBlockNodeView: (props: BodiedSyncBlockNodeViewProperties) => (node: PMNode, view: EditorView, getPos: getPosHandler) => ReactNodeView<BodiedSyncBlockNodeViewProps>;
@@ -1,10 +1,12 @@
1
+ import React from 'react';
1
2
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
2
3
  import type { PortalProviderAPI } from '@atlaskit/editor-common/portal';
3
- import type { ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
4
+ import type { ForwardRef, ReactComponentProps } from '@atlaskit/editor-common/react-node-view';
4
5
  import ReactNodeView, { type getPosHandler } from '@atlaskit/editor-common/react-node-view';
5
6
  import type { ExtractInjectionAPI, PMPluginFactoryParams } from '@atlaskit/editor-common/types';
6
7
  import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
7
8
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
9
+ import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
8
10
  import type { SyncedBlockPlugin, SyncedBlockPluginOptions } from '../syncedBlockPluginType';
9
11
  export interface BodiedSyncBlockNodeViewProps extends ReactComponentProps {
10
12
  api?: ExtractInjectionAPI<SyncedBlockPlugin>;
@@ -13,11 +15,30 @@ export interface BodiedSyncBlockNodeViewProps extends ReactComponentProps {
13
15
  node: PMNode;
14
16
  pluginOptions: SyncedBlockPluginOptions | undefined;
15
17
  portalProviderAPI: PortalProviderAPI;
18
+ syncBlockStore?: SyncBlockStoreManager;
16
19
  view: EditorView;
17
20
  }
21
+ export declare class BodiedSyncBlock extends ReactNodeView<BodiedSyncBlockNodeViewProps> {
22
+ private cleanupConnectivityModeListener?;
23
+ private cleanupViewModeListener?;
24
+ private api?;
25
+ private syncBlockStore?;
26
+ constructor(props: BodiedSyncBlockNodeViewProps);
27
+ private updateContentEditable;
28
+ private handleConnectivityModeChange;
29
+ private handleViewModeChange;
30
+ createDomRef(): HTMLElement;
31
+ render(_props: never, forwardRef: ForwardRef): React.JSX.Element | null;
32
+ getContentDOM(): {
33
+ dom: HTMLElement;
34
+ contentDOM: HTMLElement | undefined;
35
+ } | undefined;
36
+ destroy(): void;
37
+ }
18
38
  export interface BodiedSyncBlockNodeViewProperties {
19
39
  api?: ExtractInjectionAPI<SyncedBlockPlugin>;
20
40
  pluginOptions: SyncedBlockPluginOptions | undefined;
21
41
  pmPluginFactoryParams: PMPluginFactoryParams;
42
+ syncBlockStore?: SyncBlockStoreManager;
22
43
  }
23
44
  export declare const bodiedSyncBlockNodeView: (props: BodiedSyncBlockNodeViewProperties) => (node: PMNode, view: EditorView, getPos: getPosHandler) => ReactNodeView<BodiedSyncBlockNodeViewProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-synced-block",
3
- "version": "5.3.34",
3
+ "version": "5.3.35",
4
4
  "description": "SyncedBlock plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",