@atlaskit/editor-plugin-synced-block 4.0.1 → 4.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/editor-plugin-synced-block
2
2
 
3
+ ## 4.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`aa14795cecd60`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/aa14795cecd60) -
8
+ EDITOR-2350 Pass media options to sync block nested renderer.
9
+
10
+ ## 4.1.0
11
+
12
+ ### Minor Changes
13
+
14
+ - [`261fa27c56fd0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/261fa27c56fd0) -
15
+ EDITOR-2533 implement retry function for sync-block renderer
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 4.0.1
4
22
 
5
23
  ### Patch Changes
@@ -22,7 +22,7 @@ var createSyncedBlock = exports.createSyncedBlock = function createSyncedBlock(_
22
22
 
23
23
  // If the selection is empty, we want to insert the sync block on a new line
24
24
  if (tr.selection.empty) {
25
- var storeSyncBlockNode = syncBlockStore.createSyncBlockNode();
25
+ var storeSyncBlockNode = syncBlockStore.createBodiedSyncBlockNode();
26
26
  var paragraphNode = paragraph.createAndFill({});
27
27
  var newBodiedSyncBlockNode = bodiedSyncBlock.createAndFill(_objectSpread({}, storeSyncBlockNode.attrs), paragraphNode ? [paragraphNode] : []);
28
28
  if (!newBodiedSyncBlockNode) {
@@ -39,7 +39,7 @@ var createSyncedBlock = exports.createSyncedBlock = function createSyncedBlock(_
39
39
  // TODO: EDITOR-1665 - Raise an error analytics event
40
40
  return false;
41
41
  } else {
42
- var _storeSyncBlockNode = syncBlockStore.createSyncBlockNode();
42
+ var _storeSyncBlockNode = syncBlockStore.createBodiedSyncBlockNode();
43
43
  var _newBodiedSyncBlockNode = bodiedSyncBlock.createAndFill(_objectSpread({}, _storeSyncBlockNode.attrs), conversionInfo.contentToInclude);
44
44
  if (!_newBodiedSyncBlockNode) {
45
45
  return false;
@@ -41,23 +41,26 @@ var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
41
41
  value: function render() {
42
42
  var _this$options,
43
43
  _this$options2,
44
- _this$options3,
45
44
  _this2 = this;
46
- if (!((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.getSyncedBlockRenderer)) {
45
+ if (!((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.syncedBlockRenderer)) {
46
+ return null;
47
+ }
48
+ var _this$node$attrs = this.node.attrs,
49
+ resourceId = _this$node$attrs.resourceId,
50
+ localId = _this$node$attrs.localId;
51
+ if (!resourceId || !localId) {
47
52
  return null;
48
53
  }
49
54
 
50
55
  // get document node from data provider
51
-
52
56
  return /*#__PURE__*/_react.default.createElement(_SyncBlockRendererWrapper.SyncBlockRendererWrapper, {
53
57
  localId: this.node.attrs.localId,
54
- getSyncedBlockRenderer: (_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.getSyncedBlockRenderer,
55
- syncBlockRendererDataProviders: (_this$options3 = this.options) === null || _this$options3 === void 0 ? void 0 : _this$options3.syncBlockRendererDataProviders,
56
- useFetchSyncBlockData: function useFetchSyncBlockData() {
57
- return (0, _editorSyncedBlockProvider.useFetchSyncBlockData)(_this2.syncBlockStore, _this2.node);
58
- },
58
+ syncedBlockRenderer: (_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.syncedBlockRenderer,
59
59
  useFetchSyncBlockTitle: function useFetchSyncBlockTitle() {
60
60
  return (0, _editorSyncedBlockProvider.useFetchSyncBlockTitle)(_this2.syncBlockStore, _this2.node);
61
+ },
62
+ useFetchSyncBlockData: function useFetchSyncBlockData() {
63
+ return (0, _editorSyncedBlockProvider.useFetchSyncBlockData)(_this2.syncBlockStore, resourceId, localId);
61
64
  }
62
65
  });
63
66
  }
@@ -65,9 +68,6 @@ var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
65
68
  key: "destroy",
66
69
  value: function destroy() {
67
70
  var _this$unsubscribe;
68
- if (this.fetchIntervalId) {
69
- window.clearInterval(this.fetchIntervalId);
70
- }
71
71
  (_this$unsubscribe = this.unsubscribe) === null || _this$unsubscribe === void 0 || _this$unsubscribe.call(this);
72
72
  _superPropGet(SyncBlock, "destroy", this, 3)([]);
73
73
  }
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.SyncBlockRefresher = void 0;
6
+ exports.SyncBlockRefresher = exports.SYNC_BLOCK_FETCH_INTERVAL = void 0;
7
7
  var _react = require("react");
8
- var REFRESH_INTERVAL = 3000;
8
+ var SYNC_BLOCK_FETCH_INTERVAL = exports.SYNC_BLOCK_FETCH_INTERVAL = 3000;
9
9
 
10
10
  // Component that refreshes synced block subscriptions at regular intervals
11
11
  // this is a workaround for the subscription mechanism not being real-time
@@ -18,7 +18,7 @@ var SyncBlockRefresher = exports.SyncBlockRefresher = function SyncBlockRefreshe
18
18
  if (((_document = document) === null || _document === void 0 ? void 0 : _document.visibilityState) === 'visible') {
19
19
  syncBlockStoreManager.refreshSubscriptions();
20
20
  }
21
- }, REFRESH_INTERVAL);
21
+ }, SYNC_BLOCK_FETCH_INTERVAL);
22
22
  return function () {
23
23
  window.clearInterval(interval);
24
24
  };
@@ -10,9 +10,8 @@ var _syncBlock = require("@atlaskit/editor-common/sync-block");
10
10
  var _SyncBlockLabel = require("./SyncBlockLabel");
11
11
  var SyncBlockRendererWrapperDataId = 'sync-block-plugin-renderer-wrapper';
12
12
  var SyncBlockRendererWrapperComponent = function SyncBlockRendererWrapperComponent(_ref) {
13
- var getSyncedBlockRenderer = _ref.getSyncedBlockRenderer,
13
+ var syncedBlockRenderer = _ref.syncedBlockRenderer,
14
14
  useFetchSyncBlockData = _ref.useFetchSyncBlockData,
15
- syncBlockRendererDataProviders = _ref.syncBlockRendererDataProviders,
16
15
  localId = _ref.localId,
17
16
  useFetchSyncBlockTitle = _ref.useFetchSyncBlockTitle;
18
17
  return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
@@ -20,8 +19,7 @@ var SyncBlockRendererWrapperComponent = function SyncBlockRendererWrapperCompone
20
19
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
21
20
  ,
22
21
  className: _syncBlock.SyncBlockSharedCssClassName.renderer
23
- }, getSyncedBlockRenderer({
24
- syncBlockRendererDataProviders: syncBlockRendererDataProviders,
22
+ }, syncedBlockRenderer({
25
23
  useFetchSyncBlockData: useFetchSyncBlockData
26
24
  })), /*#__PURE__*/_react.default.createElement(_SyncBlockLabel.SyncBlockLabel, {
27
25
  isSource: false,
@@ -18,7 +18,7 @@ export const createSyncedBlock = ({
18
18
 
19
19
  // If the selection is empty, we want to insert the sync block on a new line
20
20
  if (tr.selection.empty) {
21
- const storeSyncBlockNode = syncBlockStore.createSyncBlockNode();
21
+ const storeSyncBlockNode = syncBlockStore.createBodiedSyncBlockNode();
22
22
  const paragraphNode = paragraph.createAndFill({});
23
23
  const newBodiedSyncBlockNode = bodiedSyncBlock.createAndFill({
24
24
  ...storeSyncBlockNode.attrs
@@ -37,7 +37,7 @@ export const createSyncedBlock = ({
37
37
  // TODO: EDITOR-1665 - Raise an error analytics event
38
38
  return false;
39
39
  } else {
40
- const storeSyncBlockNode = syncBlockStore.createSyncBlockNode();
40
+ const storeSyncBlockNode = syncBlockStore.createBodiedSyncBlockNode();
41
41
  const newBodiedSyncBlockNode = bodiedSyncBlock.createAndFill({
42
42
  ...storeSyncBlockNode.attrs
43
43
  }, conversionInfo.contentToInclude);
@@ -15,26 +15,28 @@ class SyncBlock extends ReactNodeView {
15
15
  return domRef;
16
16
  }
17
17
  render() {
18
- var _this$options, _this$options2, _this$options3;
19
- if (!((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.getSyncedBlockRenderer)) {
18
+ var _this$options, _this$options2;
19
+ if (!((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.syncedBlockRenderer)) {
20
+ return null;
21
+ }
22
+ const {
23
+ resourceId,
24
+ localId
25
+ } = this.node.attrs;
26
+ if (!resourceId || !localId) {
20
27
  return null;
21
28
  }
22
29
 
23
30
  // get document node from data provider
24
-
25
31
  return /*#__PURE__*/React.createElement(SyncBlockRendererWrapper, {
26
32
  localId: this.node.attrs.localId,
27
- getSyncedBlockRenderer: (_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.getSyncedBlockRenderer,
28
- syncBlockRendererDataProviders: (_this$options3 = this.options) === null || _this$options3 === void 0 ? void 0 : _this$options3.syncBlockRendererDataProviders,
29
- useFetchSyncBlockData: () => useFetchSyncBlockData(this.syncBlockStore, this.node),
30
- useFetchSyncBlockTitle: () => useFetchSyncBlockTitle(this.syncBlockStore, this.node)
33
+ syncedBlockRenderer: (_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.syncedBlockRenderer,
34
+ useFetchSyncBlockTitle: () => useFetchSyncBlockTitle(this.syncBlockStore, this.node),
35
+ useFetchSyncBlockData: () => useFetchSyncBlockData(this.syncBlockStore, resourceId, localId)
31
36
  });
32
37
  }
33
38
  destroy() {
34
39
  var _this$unsubscribe;
35
- if (this.fetchIntervalId) {
36
- window.clearInterval(this.fetchIntervalId);
37
- }
38
40
  (_this$unsubscribe = this.unsubscribe) === null || _this$unsubscribe === void 0 ? void 0 : _this$unsubscribe.call(this);
39
41
  super.destroy();
40
42
  }
@@ -1,5 +1,5 @@
1
1
  import { useEffect } from 'react';
2
- const REFRESH_INTERVAL = 3000;
2
+ export const SYNC_BLOCK_FETCH_INTERVAL = 3000;
3
3
 
4
4
  // Component that refreshes synced block subscriptions at regular intervals
5
5
  // this is a workaround for the subscription mechanism not being real-time
@@ -13,7 +13,7 @@ export const SyncBlockRefresher = ({
13
13
  if (((_document = document) === null || _document === void 0 ? void 0 : _document.visibilityState) === 'visible') {
14
14
  syncBlockStoreManager.refreshSubscriptions();
15
15
  }
16
- }, REFRESH_INTERVAL);
16
+ }, SYNC_BLOCK_FETCH_INTERVAL);
17
17
  return () => {
18
18
  window.clearInterval(interval);
19
19
  };
@@ -3,9 +3,8 @@ import { SyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block'
3
3
  import { SyncBlockLabel } from './SyncBlockLabel';
4
4
  const SyncBlockRendererWrapperDataId = 'sync-block-plugin-renderer-wrapper';
5
5
  const SyncBlockRendererWrapperComponent = ({
6
- getSyncedBlockRenderer,
6
+ syncedBlockRenderer,
7
7
  useFetchSyncBlockData,
8
- syncBlockRendererDataProviders,
9
8
  localId,
10
9
  useFetchSyncBlockTitle
11
10
  }) => {
@@ -14,8 +13,7 @@ const SyncBlockRendererWrapperComponent = ({
14
13
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
15
14
  ,
16
15
  className: SyncBlockSharedCssClassName.renderer
17
- }, getSyncedBlockRenderer({
18
- syncBlockRendererDataProviders,
16
+ }, syncedBlockRenderer({
19
17
  useFetchSyncBlockData
20
18
  })), /*#__PURE__*/React.createElement(SyncBlockLabel, {
21
19
  isSource: false,
@@ -15,7 +15,7 @@ export var createSyncedBlock = function createSyncedBlock(_ref) {
15
15
 
16
16
  // If the selection is empty, we want to insert the sync block on a new line
17
17
  if (tr.selection.empty) {
18
- var storeSyncBlockNode = syncBlockStore.createSyncBlockNode();
18
+ var storeSyncBlockNode = syncBlockStore.createBodiedSyncBlockNode();
19
19
  var paragraphNode = paragraph.createAndFill({});
20
20
  var newBodiedSyncBlockNode = bodiedSyncBlock.createAndFill(_objectSpread({}, storeSyncBlockNode.attrs), paragraphNode ? [paragraphNode] : []);
21
21
  if (!newBodiedSyncBlockNode) {
@@ -32,7 +32,7 @@ export var createSyncedBlock = function createSyncedBlock(_ref) {
32
32
  // TODO: EDITOR-1665 - Raise an error analytics event
33
33
  return false;
34
34
  } else {
35
- var _storeSyncBlockNode = syncBlockStore.createSyncBlockNode();
35
+ var _storeSyncBlockNode = syncBlockStore.createBodiedSyncBlockNode();
36
36
  var _newBodiedSyncBlockNode = bodiedSyncBlock.createAndFill(_objectSpread({}, _storeSyncBlockNode.attrs), conversionInfo.contentToInclude);
37
37
  if (!_newBodiedSyncBlockNode) {
38
38
  return false;
@@ -34,23 +34,26 @@ var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
34
34
  value: function render() {
35
35
  var _this$options,
36
36
  _this$options2,
37
- _this$options3,
38
37
  _this2 = this;
39
- if (!((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.getSyncedBlockRenderer)) {
38
+ if (!((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.syncedBlockRenderer)) {
39
+ return null;
40
+ }
41
+ var _this$node$attrs = this.node.attrs,
42
+ resourceId = _this$node$attrs.resourceId,
43
+ localId = _this$node$attrs.localId;
44
+ if (!resourceId || !localId) {
40
45
  return null;
41
46
  }
42
47
 
43
48
  // get document node from data provider
44
-
45
49
  return /*#__PURE__*/React.createElement(SyncBlockRendererWrapper, {
46
50
  localId: this.node.attrs.localId,
47
- getSyncedBlockRenderer: (_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.getSyncedBlockRenderer,
48
- syncBlockRendererDataProviders: (_this$options3 = this.options) === null || _this$options3 === void 0 ? void 0 : _this$options3.syncBlockRendererDataProviders,
49
- useFetchSyncBlockData: function useFetchSyncBlockData() {
50
- return _useFetchSyncBlockData(_this2.syncBlockStore, _this2.node);
51
- },
51
+ syncedBlockRenderer: (_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.syncedBlockRenderer,
52
52
  useFetchSyncBlockTitle: function useFetchSyncBlockTitle() {
53
53
  return _useFetchSyncBlockTitle(_this2.syncBlockStore, _this2.node);
54
+ },
55
+ useFetchSyncBlockData: function useFetchSyncBlockData() {
56
+ return _useFetchSyncBlockData(_this2.syncBlockStore, resourceId, localId);
54
57
  }
55
58
  });
56
59
  }
@@ -58,9 +61,6 @@ var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
58
61
  key: "destroy",
59
62
  value: function destroy() {
60
63
  var _this$unsubscribe;
61
- if (this.fetchIntervalId) {
62
- window.clearInterval(this.fetchIntervalId);
63
- }
64
64
  (_this$unsubscribe = this.unsubscribe) === null || _this$unsubscribe === void 0 || _this$unsubscribe.call(this);
65
65
  _superPropGet(SyncBlock, "destroy", this, 3)([]);
66
66
  }
@@ -1,5 +1,5 @@
1
1
  import { useEffect } from 'react';
2
- var REFRESH_INTERVAL = 3000;
2
+ export var SYNC_BLOCK_FETCH_INTERVAL = 3000;
3
3
 
4
4
  // Component that refreshes synced block subscriptions at regular intervals
5
5
  // this is a workaround for the subscription mechanism not being real-time
@@ -12,7 +12,7 @@ export var SyncBlockRefresher = function SyncBlockRefresher(_ref) {
12
12
  if (((_document = document) === null || _document === void 0 ? void 0 : _document.visibilityState) === 'visible') {
13
13
  syncBlockStoreManager.refreshSubscriptions();
14
14
  }
15
- }, REFRESH_INTERVAL);
15
+ }, SYNC_BLOCK_FETCH_INTERVAL);
16
16
  return function () {
17
17
  window.clearInterval(interval);
18
18
  };
@@ -3,9 +3,8 @@ import { SyncBlockSharedCssClassName } from '@atlaskit/editor-common/sync-block'
3
3
  import { SyncBlockLabel } from './SyncBlockLabel';
4
4
  var SyncBlockRendererWrapperDataId = 'sync-block-plugin-renderer-wrapper';
5
5
  var SyncBlockRendererWrapperComponent = function SyncBlockRendererWrapperComponent(_ref) {
6
- var getSyncedBlockRenderer = _ref.getSyncedBlockRenderer,
6
+ var syncedBlockRenderer = _ref.syncedBlockRenderer,
7
7
  useFetchSyncBlockData = _ref.useFetchSyncBlockData,
8
- syncBlockRendererDataProviders = _ref.syncBlockRendererDataProviders,
9
8
  localId = _ref.localId,
10
9
  useFetchSyncBlockTitle = _ref.useFetchSyncBlockTitle;
11
10
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
@@ -13,8 +12,7 @@ var SyncBlockRendererWrapperComponent = function SyncBlockRendererWrapperCompone
13
12
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
14
13
  ,
15
14
  className: SyncBlockSharedCssClassName.renderer
16
- }, getSyncedBlockRenderer({
17
- syncBlockRendererDataProviders: syncBlockRendererDataProviders,
15
+ }, syncedBlockRenderer({
18
16
  useFetchSyncBlockData: useFetchSyncBlockData
19
17
  })), /*#__PURE__*/React.createElement(SyncBlockLabel, {
20
18
  isSource: false,
@@ -1,5 +1,4 @@
1
1
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
2
- import type { SyncedBlockRendererDataProviders } from '@atlaskit/editor-common/provider-factory';
3
2
  import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
4
3
  import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
5
4
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
@@ -9,7 +8,7 @@ import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
9
8
  import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
10
9
  import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
11
10
  import type { EditorView } from '@atlaskit/editor-prosemirror/dist/types/view';
12
- import type { SyncBlockInstance, SyncBlockDataProvider } from '@atlaskit/editor-synced-block-provider';
11
+ import type { SyncBlockDataProvider, UseFetchSyncBlockDataResult } from '@atlaskit/editor-synced-block-provider';
13
12
  export type SyncedBlockEditorProps = {
14
13
  defaultDocument: JSONDocNode;
15
14
  onChange: (editorView: EditorView, meta: {
@@ -33,13 +32,11 @@ export type SyncedBlockEditorProps = {
33
32
  popupsMountPoint: HTMLElement;
34
33
  };
35
34
  export type SyncedBlockRendererProps = {
36
- syncBlockRendererDataProviders: SyncedBlockRendererDataProviders;
37
- useFetchSyncBlockData: () => SyncBlockInstance | null;
35
+ useFetchSyncBlockData: () => UseFetchSyncBlockDataResult;
38
36
  };
39
37
  export type SyncedBlockPluginOptions = {
40
- getSyncedBlockRenderer: (props: SyncedBlockRendererProps) => React.JSX.Element;
41
38
  syncBlockDataProvider: SyncBlockDataProvider;
42
- syncBlockRendererDataProviders: SyncedBlockRendererDataProviders;
39
+ syncedBlockRenderer: (props: SyncedBlockRendererProps) => React.JSX.Element;
43
40
  };
44
41
  export type SyncedBlockPlugin = NextEditorPlugin<'syncedBlock', {
45
42
  actions: {
@@ -4,5 +4,5 @@ type SyncBlockLabelProps = {
4
4
  localId: string;
5
5
  useFetchSyncBlockTitle?: () => string | undefined;
6
6
  };
7
- export declare const SyncBlockLabel: React.MemoExoticComponent<({ isSource, useFetchSyncBlockTitle, localId }: SyncBlockLabelProps) => React.JSX.Element>;
7
+ export declare const SyncBlockLabel: React.MemoExoticComponent<({ isSource, useFetchSyncBlockTitle, localId, }: SyncBlockLabelProps) => React.JSX.Element>;
8
8
  export {};
@@ -1,4 +1,5 @@
1
1
  import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
2
+ export declare const SYNC_BLOCK_FETCH_INTERVAL = 3000;
2
3
  export declare const SyncBlockRefresher: ({ syncBlockStoreManager, }: {
3
4
  syncBlockStoreManager: SyncBlockStoreManager;
4
5
  }) => null;
@@ -1,13 +1,11 @@
1
1
  import React from 'react';
2
- import type { SyncedBlockRendererDataProviders } from '@atlaskit/editor-common/provider-factory';
3
- import type { SyncBlockInstance } from '@atlaskit/editor-synced-block-provider';
2
+ import type { UseFetchSyncBlockDataResult } from '@atlaskit/editor-synced-block-provider';
4
3
  import type { SyncedBlockRendererProps } from '../syncedBlockPluginType';
5
4
  type Props = {
6
- getSyncedBlockRenderer: (props: SyncedBlockRendererProps) => React.JSX.Element;
5
+ syncedBlockRenderer: (props: SyncedBlockRendererProps) => React.JSX.Element;
7
6
  localId: string;
8
- syncBlockRendererDataProviders: SyncedBlockRendererDataProviders;
9
- useFetchSyncBlockData: () => SyncBlockInstance | null;
7
+ useFetchSyncBlockData: () => UseFetchSyncBlockDataResult;
10
8
  useFetchSyncBlockTitle: () => string | undefined;
11
9
  };
12
- export declare const SyncBlockRendererWrapper: React.MemoExoticComponent<({ getSyncedBlockRenderer, useFetchSyncBlockData, syncBlockRendererDataProviders, localId, useFetchSyncBlockTitle, }: Props) => React.JSX.Element>;
10
+ export declare const SyncBlockRendererWrapper: React.MemoExoticComponent<({ syncedBlockRenderer, useFetchSyncBlockData, localId, useFetchSyncBlockTitle, }: Props) => React.JSX.Element>;
13
11
  export {};
@@ -1,5 +1,4 @@
1
1
  import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
2
- import type { SyncedBlockRendererDataProviders } from '@atlaskit/editor-common/provider-factory';
3
2
  import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
4
3
  import type { JSONDocNode } from '@atlaskit/editor-json-transformer';
5
4
  import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
@@ -9,7 +8,7 @@ import type { DecorationsPlugin } from '@atlaskit/editor-plugin-decorations';
9
8
  import type { FloatingToolbarPlugin } from '@atlaskit/editor-plugin-floating-toolbar';
10
9
  import type { SelectionPlugin } from '@atlaskit/editor-plugin-selection';
11
10
  import type { EditorView } from '@atlaskit/editor-prosemirror/dist/types/view';
12
- import type { SyncBlockInstance, SyncBlockDataProvider } from '@atlaskit/editor-synced-block-provider';
11
+ import type { SyncBlockDataProvider, UseFetchSyncBlockDataResult } from '@atlaskit/editor-synced-block-provider';
13
12
  export type SyncedBlockEditorProps = {
14
13
  defaultDocument: JSONDocNode;
15
14
  onChange: (editorView: EditorView, meta: {
@@ -33,13 +32,11 @@ export type SyncedBlockEditorProps = {
33
32
  popupsMountPoint: HTMLElement;
34
33
  };
35
34
  export type SyncedBlockRendererProps = {
36
- syncBlockRendererDataProviders: SyncedBlockRendererDataProviders;
37
- useFetchSyncBlockData: () => SyncBlockInstance | null;
35
+ useFetchSyncBlockData: () => UseFetchSyncBlockDataResult;
38
36
  };
39
37
  export type SyncedBlockPluginOptions = {
40
- getSyncedBlockRenderer: (props: SyncedBlockRendererProps) => React.JSX.Element;
41
38
  syncBlockDataProvider: SyncBlockDataProvider;
42
- syncBlockRendererDataProviders: SyncedBlockRendererDataProviders;
39
+ syncedBlockRenderer: (props: SyncedBlockRendererProps) => React.JSX.Element;
43
40
  };
44
41
  export type SyncedBlockPlugin = NextEditorPlugin<'syncedBlock', {
45
42
  actions: {
@@ -4,5 +4,5 @@ type SyncBlockLabelProps = {
4
4
  localId: string;
5
5
  useFetchSyncBlockTitle?: () => string | undefined;
6
6
  };
7
- export declare const SyncBlockLabel: React.MemoExoticComponent<({ isSource, useFetchSyncBlockTitle, localId }: SyncBlockLabelProps) => React.JSX.Element>;
7
+ export declare const SyncBlockLabel: React.MemoExoticComponent<({ isSource, useFetchSyncBlockTitle, localId, }: SyncBlockLabelProps) => React.JSX.Element>;
8
8
  export {};
@@ -1,4 +1,5 @@
1
1
  import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
2
+ export declare const SYNC_BLOCK_FETCH_INTERVAL = 3000;
2
3
  export declare const SyncBlockRefresher: ({ syncBlockStoreManager, }: {
3
4
  syncBlockStoreManager: SyncBlockStoreManager;
4
5
  }) => null;
@@ -1,13 +1,11 @@
1
1
  import React from 'react';
2
- import type { SyncedBlockRendererDataProviders } from '@atlaskit/editor-common/provider-factory';
3
- import type { SyncBlockInstance } from '@atlaskit/editor-synced-block-provider';
2
+ import type { UseFetchSyncBlockDataResult } from '@atlaskit/editor-synced-block-provider';
4
3
  import type { SyncedBlockRendererProps } from '../syncedBlockPluginType';
5
4
  type Props = {
6
- getSyncedBlockRenderer: (props: SyncedBlockRendererProps) => React.JSX.Element;
5
+ syncedBlockRenderer: (props: SyncedBlockRendererProps) => React.JSX.Element;
7
6
  localId: string;
8
- syncBlockRendererDataProviders: SyncedBlockRendererDataProviders;
9
- useFetchSyncBlockData: () => SyncBlockInstance | null;
7
+ useFetchSyncBlockData: () => UseFetchSyncBlockDataResult;
10
8
  useFetchSyncBlockTitle: () => string | undefined;
11
9
  };
12
- export declare const SyncBlockRendererWrapper: React.MemoExoticComponent<({ getSyncedBlockRenderer, useFetchSyncBlockData, syncBlockRendererDataProviders, localId, useFetchSyncBlockTitle, }: Props) => React.JSX.Element>;
10
+ export declare const SyncBlockRendererWrapper: React.MemoExoticComponent<({ syncedBlockRenderer, useFetchSyncBlockData, localId, useFetchSyncBlockTitle, }: Props) => React.JSX.Element>;
13
11
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-synced-block",
3
- "version": "4.0.1",
3
+ "version": "4.1.1",
4
4
  "description": "SyncedBlock plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -38,7 +38,7 @@
38
38
  "@atlaskit/editor-plugin-selection": "^6.1.0",
39
39
  "@atlaskit/editor-prosemirror": "7.0.0",
40
40
  "@atlaskit/editor-shared-styles": "^3.8.0",
41
- "@atlaskit/editor-synced-block-provider": "^2.5.0",
41
+ "@atlaskit/editor-synced-block-provider": "^2.6.0",
42
42
  "@atlaskit/editor-tables": "^2.9.0",
43
43
  "@atlaskit/editor-toolbar": "^0.17.0",
44
44
  "@atlaskit/icon": "28.5.3",
@@ -52,7 +52,7 @@
52
52
  "react-intl-next": "npm:react-intl@^5.18.1"
53
53
  },
54
54
  "peerDependencies": {
55
- "@atlaskit/editor-common": "^110.21.0",
55
+ "@atlaskit/editor-common": "^110.22.0",
56
56
  "react": "^18.2.0"
57
57
  },
58
58
  "devDependencies": {