@atlaskit/editor-plugin-synced-block 4.2.14 → 4.2.15

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,13 @@
1
1
  # @atlaskit/editor-plugin-synced-block
2
2
 
3
+ ## 4.2.15
4
+
5
+ ### Patch Changes
6
+
7
+ - [`a9159bf9608a8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a9159bf9608a8) -
8
+ [ux] Fix edit link disabled on reference sync block by setting syncBlockStore in nodeview from
9
+ plugin state
10
+
3
11
  ## 4.2.14
4
12
 
5
13
  ### Patch Changes
@@ -28,7 +28,6 @@ var BodiedSyncBlock = /*#__PURE__*/function (_ReactNodeView) {
28
28
  var _this;
29
29
  (0, _classCallCheck2.default)(this, BodiedSyncBlock);
30
30
  _this = _callSuper(this, BodiedSyncBlock, [props.node, props.view, props.getPos, props.portalProviderAPI, props.eventDispatcher, props]);
31
- _this.syncBlockStore = props.syncBlockStore;
32
31
  _this.api = props.api;
33
32
  _this.handleConnectivityModeChange();
34
33
  _this.handleViewModeChange();
@@ -89,9 +88,14 @@ var BodiedSyncBlock = /*#__PURE__*/function (_ReactNodeView) {
89
88
  }, {
90
89
  key: "render",
91
90
  value: function render(_props, forwardRef) {
91
+ var _this$api5;
92
+ 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;
93
+ if (!syncBlockStore) {
94
+ return null;
95
+ }
92
96
  return /*#__PURE__*/_react.default.createElement(_BodiedSyncBlockWrapper.BodiedSyncBlockWrapper, {
93
97
  ref: forwardRef,
94
- syncBlockStore: this.syncBlockStore,
98
+ syncBlockStore: syncBlockStore,
95
99
  node: this.node
96
100
  });
97
101
  }
@@ -127,8 +131,7 @@ var BodiedSyncBlock = /*#__PURE__*/function (_ReactNodeView) {
127
131
  var bodiedSyncBlockNodeView = exports.bodiedSyncBlockNodeView = function bodiedSyncBlockNodeView(_ref4) {
128
132
  var pluginOptions = _ref4.pluginOptions,
129
133
  pmPluginFactoryParams = _ref4.pmPluginFactoryParams,
130
- api = _ref4.api,
131
- syncBlockStore = _ref4.syncBlockStore;
134
+ api = _ref4.api;
132
135
  return function (node, view, getPos) {
133
136
  var portalProviderAPI = pmPluginFactoryParams.portalProviderAPI,
134
137
  eventDispatcher = pmPluginFactoryParams.eventDispatcher;
@@ -139,8 +142,7 @@ var bodiedSyncBlockNodeView = exports.bodiedSyncBlockNodeView = function bodiedS
139
142
  view: view,
140
143
  getPos: getPos,
141
144
  portalProviderAPI: portalProviderAPI,
142
- eventDispatcher: eventDispatcher,
143
- syncBlockStore: syncBlockStore
145
+ eventDispatcher: eventDispatcher
144
146
  }).init();
145
147
  };
146
148
  };
@@ -25,7 +25,7 @@ var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
25
25
  (0, _classCallCheck2.default)(this, SyncBlock);
26
26
  _this = _callSuper(this, SyncBlock, [props.node, props.view, props.getPos, props.portalProviderAPI, props.eventDispatcher, props]);
27
27
  _this.options = props.options;
28
- _this.syncBlockStore = props.syncBlockStore;
28
+ _this.api = props.api;
29
29
  return _this;
30
30
  }
31
31
  (0, _inherits2.default)(SyncBlock, _ReactNodeView);
@@ -40,6 +40,7 @@ var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
40
40
  key: "render",
41
41
  value: function render() {
42
42
  var _this$options,
43
+ _this$api,
43
44
  _this$options2,
44
45
  _this2 = this;
45
46
  if (!((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.syncedBlockRenderer)) {
@@ -51,16 +52,20 @@ var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
51
52
  if (!resourceId || !localId) {
52
53
  return null;
53
54
  }
55
+ var syncBlockStore = (_this$api = this.api) === null || _this$api === void 0 || (_this$api = _this$api.syncedBlock) === null || _this$api === void 0 || (_this$api = _this$api.sharedState.currentState()) === null || _this$api === void 0 ? void 0 : _this$api.syncBlockStore;
56
+ if (!syncBlockStore) {
57
+ return null;
58
+ }
54
59
 
55
60
  // get document node from data provider
56
61
  return /*#__PURE__*/_react.default.createElement(_SyncBlockRendererWrapper.SyncBlockRendererWrapper, {
57
62
  localId: this.node.attrs.localId,
58
63
  syncedBlockRenderer: (_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.syncedBlockRenderer,
59
64
  useFetchSyncBlockTitle: function useFetchSyncBlockTitle() {
60
- return (0, _editorSyncedBlockProvider.useFetchSyncBlockTitle)(_this2.syncBlockStore, _this2.node);
65
+ return (0, _editorSyncedBlockProvider.useFetchSyncBlockTitle)(syncBlockStore, _this2.node);
61
66
  },
62
67
  useFetchSyncBlockData: function useFetchSyncBlockData() {
63
- return (0, _editorSyncedBlockProvider.useFetchSyncBlockData)(_this2.syncBlockStore, resourceId, localId);
68
+ return (0, _editorSyncedBlockProvider.useFetchSyncBlockData)(syncBlockStore, resourceId, localId);
64
69
  }
65
70
  });
66
71
  }
@@ -76,8 +81,7 @@ var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
76
81
  var syncBlockNodeView = exports.syncBlockNodeView = function syncBlockNodeView(_ref) {
77
82
  var options = _ref.options,
78
83
  pmPluginFactoryParams = _ref.pmPluginFactoryParams,
79
- api = _ref.api,
80
- syncBlockStore = _ref.syncBlockStore;
84
+ api = _ref.api;
81
85
  return function (node, view, getPos) {
82
86
  var portalProviderAPI = pmPluginFactoryParams.portalProviderAPI,
83
87
  eventDispatcher = pmPluginFactoryParams.eventDispatcher;
@@ -88,8 +92,7 @@ var syncBlockNodeView = exports.syncBlockNodeView = function syncBlockNodeView(_
88
92
  view: view,
89
93
  getPos: getPos,
90
94
  portalProviderAPI: portalProviderAPI,
91
- eventDispatcher: eventDispatcher,
92
- syncBlockStore: syncBlockStore
95
+ eventDispatcher: eventDispatcher
93
96
  }).init();
94
97
  };
95
98
  };
@@ -31,7 +31,8 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
31
31
  syncBlockStore.referenceManager.fetchSyncBlocksData((0, _editorSyncedBlockProvider.convertPMNodesToSyncBlockNodes)(syncBlockNodes));
32
32
  return {
33
33
  selectionDecorationSet: (0, _selectionDecorations.calculateDecorations)(instance.doc, instance.selection, instance.schema),
34
- showFlag: false
34
+ showFlag: false,
35
+ syncBlockStore: syncBlockStore
35
36
  };
36
37
  },
37
38
  apply: function apply(tr, currentPluginState, oldEditorState) {
@@ -45,7 +46,8 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
45
46
  }
46
47
  return {
47
48
  showFlag: (_meta$showFlag = meta === null || meta === void 0 ? void 0 : meta.showFlag) !== null && _meta$showFlag !== void 0 ? _meta$showFlag : showFlag,
48
- selectionDecorationSet: newDecorationSet
49
+ selectionDecorationSet: newDecorationSet,
50
+ syncBlockStore: syncBlockStore
49
51
  };
50
52
  }
51
53
  },
@@ -54,14 +56,12 @@ var createPlugin = exports.createPlugin = function createPlugin(options, pmPlugi
54
56
  syncBlock: (0, _lazySyncedBlock.lazySyncBlockView)({
55
57
  options: options,
56
58
  pmPluginFactoryParams: pmPluginFactoryParams,
57
- api: api,
58
- syncBlockStore: syncBlockStore
59
+ api: api
59
60
  }),
60
61
  bodiedSyncBlock: (0, _bodiedLazySyncedBlock.lazyBodiedSyncBlockView)({
61
62
  pluginOptions: options,
62
63
  pmPluginFactoryParams: pmPluginFactoryParams,
63
- api: api,
64
- syncBlockStore: syncBlockStore
64
+ api: api
65
65
  })
66
66
  },
67
67
  decorations: function decorations(state) {
@@ -113,9 +113,11 @@ var syncedBlockPlugin = exports.syncedBlockPlugin = function syncedBlockPlugin(_
113
113
  return;
114
114
  }
115
115
  var _syncedBlockPluginKey = _main.syncedBlockPluginKey.getState(editorState),
116
- showFlag = _syncedBlockPluginKey.showFlag;
116
+ showFlag = _syncedBlockPluginKey.showFlag,
117
+ currentSyncBlockStore = _syncedBlockPluginKey.syncBlockStore;
117
118
  return {
118
- showFlag: showFlag
119
+ showFlag: showFlag,
120
+ syncBlockStore: currentSyncBlockStore
119
121
  };
120
122
  }
121
123
  };
@@ -10,7 +10,6 @@ const toDOM = () => ['div', {
10
10
  class BodiedSyncBlock extends ReactNodeView {
11
11
  constructor(props) {
12
12
  super(props.node, props.view, props.getPos, props.portalProviderAPI, props.eventDispatcher, props);
13
- this.syncBlockStore = props.syncBlockStore;
14
13
  this.api = props.api;
15
14
  this.handleConnectivityModeChange();
16
15
  this.handleViewModeChange();
@@ -60,9 +59,14 @@ class BodiedSyncBlock extends ReactNodeView {
60
59
  return domRef;
61
60
  }
62
61
  render(_props, forwardRef) {
62
+ var _this$api5, _this$api5$syncedBloc, _this$api5$syncedBloc2;
63
+ 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;
64
+ if (!syncBlockStore) {
65
+ return null;
66
+ }
63
67
  return /*#__PURE__*/React.createElement(BodiedSyncBlockWrapper, {
64
68
  ref: forwardRef,
65
- syncBlockStore: this.syncBlockStore,
69
+ syncBlockStore: syncBlockStore,
66
70
  node: this.node
67
71
  });
68
72
  }
@@ -94,8 +98,7 @@ class BodiedSyncBlock extends ReactNodeView {
94
98
  export const bodiedSyncBlockNodeView = ({
95
99
  pluginOptions,
96
100
  pmPluginFactoryParams,
97
- api,
98
- syncBlockStore
101
+ api
99
102
  }) => (node, view, getPos) => {
100
103
  const {
101
104
  portalProviderAPI,
@@ -108,7 +111,6 @@ export const bodiedSyncBlockNodeView = ({
108
111
  view,
109
112
  getPos,
110
113
  portalProviderAPI,
111
- eventDispatcher,
112
- syncBlockStore
114
+ eventDispatcher
113
115
  }).init();
114
116
  };
@@ -7,7 +7,7 @@ class SyncBlock extends ReactNodeView {
7
7
  constructor(props) {
8
8
  super(props.node, props.view, props.getPos, props.portalProviderAPI, props.eventDispatcher, props);
9
9
  this.options = props.options;
10
- this.syncBlockStore = props.syncBlockStore;
10
+ this.api = props.api;
11
11
  }
12
12
  createDomRef() {
13
13
  const domRef = document.createElement('div');
@@ -15,7 +15,7 @@ class SyncBlock extends ReactNodeView {
15
15
  return domRef;
16
16
  }
17
17
  render() {
18
- var _this$options, _this$options2;
18
+ var _this$options, _this$api, _this$api$syncedBlock, _this$api$syncedBlock2, _this$options2;
19
19
  if (!((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.syncedBlockRenderer)) {
20
20
  return null;
21
21
  }
@@ -26,13 +26,17 @@ class SyncBlock extends ReactNodeView {
26
26
  if (!resourceId || !localId) {
27
27
  return null;
28
28
  }
29
+ const syncBlockStore = (_this$api = this.api) === null || _this$api === void 0 ? void 0 : (_this$api$syncedBlock = _this$api.syncedBlock) === null || _this$api$syncedBlock === void 0 ? void 0 : (_this$api$syncedBlock2 = _this$api$syncedBlock.sharedState.currentState()) === null || _this$api$syncedBlock2 === void 0 ? void 0 : _this$api$syncedBlock2.syncBlockStore;
30
+ if (!syncBlockStore) {
31
+ return null;
32
+ }
29
33
 
30
34
  // get document node from data provider
31
35
  return /*#__PURE__*/React.createElement(SyncBlockRendererWrapper, {
32
36
  localId: this.node.attrs.localId,
33
37
  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)
38
+ useFetchSyncBlockTitle: () => useFetchSyncBlockTitle(syncBlockStore, this.node),
39
+ useFetchSyncBlockData: () => useFetchSyncBlockData(syncBlockStore, resourceId, localId)
36
40
  });
37
41
  }
38
42
  destroy() {
@@ -44,8 +48,7 @@ class SyncBlock extends ReactNodeView {
44
48
  export const syncBlockNodeView = ({
45
49
  options,
46
50
  pmPluginFactoryParams,
47
- api,
48
- syncBlockStore
51
+ api
49
52
  }) => (node, view, getPos) => {
50
53
  const {
51
54
  portalProviderAPI,
@@ -58,7 +61,6 @@ export const syncBlockNodeView = ({
58
61
  view,
59
62
  getPos,
60
63
  portalProviderAPI,
61
- eventDispatcher,
62
- syncBlockStore
64
+ eventDispatcher
63
65
  }).init();
64
66
  };
@@ -23,7 +23,8 @@ export const createPlugin = (options, pmPluginFactoryParams, syncBlockStore, api
23
23
  syncBlockStore.referenceManager.fetchSyncBlocksData(convertPMNodesToSyncBlockNodes(syncBlockNodes));
24
24
  return {
25
25
  selectionDecorationSet: calculateDecorations(instance.doc, instance.selection, instance.schema),
26
- showFlag: false
26
+ showFlag: false,
27
+ syncBlockStore: syncBlockStore
27
28
  };
28
29
  },
29
30
  apply: (tr, currentPluginState, oldEditorState) => {
@@ -39,7 +40,8 @@ export const createPlugin = (options, pmPluginFactoryParams, syncBlockStore, api
39
40
  }
40
41
  return {
41
42
  showFlag: (_meta$showFlag = meta === null || meta === void 0 ? void 0 : meta.showFlag) !== null && _meta$showFlag !== void 0 ? _meta$showFlag : showFlag,
42
- selectionDecorationSet: newDecorationSet
43
+ selectionDecorationSet: newDecorationSet,
44
+ syncBlockStore: syncBlockStore
43
45
  };
44
46
  }
45
47
  },
@@ -48,14 +50,12 @@ export const createPlugin = (options, pmPluginFactoryParams, syncBlockStore, api
48
50
  syncBlock: lazySyncBlockView({
49
51
  options,
50
52
  pmPluginFactoryParams,
51
- api,
52
- syncBlockStore
53
+ api
53
54
  }),
54
55
  bodiedSyncBlock: lazyBodiedSyncBlockView({
55
56
  pluginOptions: options,
56
57
  pmPluginFactoryParams,
57
- api,
58
- syncBlockStore
58
+ api
59
59
  })
60
60
  },
61
61
  decorations: state => {
@@ -95,10 +95,12 @@ export const syncedBlockPlugin = ({
95
95
  return;
96
96
  }
97
97
  const {
98
- showFlag
98
+ showFlag,
99
+ syncBlockStore: currentSyncBlockStore
99
100
  } = syncedBlockPluginKey.getState(editorState);
100
101
  return {
101
- showFlag
102
+ showFlag,
103
+ syncBlockStore: currentSyncBlockStore
102
104
  };
103
105
  }
104
106
  };
@@ -21,7 +21,6 @@ var BodiedSyncBlock = /*#__PURE__*/function (_ReactNodeView) {
21
21
  var _this;
22
22
  _classCallCheck(this, BodiedSyncBlock);
23
23
  _this = _callSuper(this, BodiedSyncBlock, [props.node, props.view, props.getPos, props.portalProviderAPI, props.eventDispatcher, props]);
24
- _this.syncBlockStore = props.syncBlockStore;
25
24
  _this.api = props.api;
26
25
  _this.handleConnectivityModeChange();
27
26
  _this.handleViewModeChange();
@@ -82,9 +81,14 @@ var BodiedSyncBlock = /*#__PURE__*/function (_ReactNodeView) {
82
81
  }, {
83
82
  key: "render",
84
83
  value: function render(_props, forwardRef) {
84
+ var _this$api5;
85
+ 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;
86
+ if (!syncBlockStore) {
87
+ return null;
88
+ }
85
89
  return /*#__PURE__*/React.createElement(BodiedSyncBlockWrapper, {
86
90
  ref: forwardRef,
87
- syncBlockStore: this.syncBlockStore,
91
+ syncBlockStore: syncBlockStore,
88
92
  node: this.node
89
93
  });
90
94
  }
@@ -120,8 +124,7 @@ var BodiedSyncBlock = /*#__PURE__*/function (_ReactNodeView) {
120
124
  export var bodiedSyncBlockNodeView = function bodiedSyncBlockNodeView(_ref4) {
121
125
  var pluginOptions = _ref4.pluginOptions,
122
126
  pmPluginFactoryParams = _ref4.pmPluginFactoryParams,
123
- api = _ref4.api,
124
- syncBlockStore = _ref4.syncBlockStore;
127
+ api = _ref4.api;
125
128
  return function (node, view, getPos) {
126
129
  var portalProviderAPI = pmPluginFactoryParams.portalProviderAPI,
127
130
  eventDispatcher = pmPluginFactoryParams.eventDispatcher;
@@ -132,8 +135,7 @@ export var bodiedSyncBlockNodeView = function bodiedSyncBlockNodeView(_ref4) {
132
135
  view: view,
133
136
  getPos: getPos,
134
137
  portalProviderAPI: portalProviderAPI,
135
- eventDispatcher: eventDispatcher,
136
- syncBlockStore: syncBlockStore
138
+ eventDispatcher: eventDispatcher
137
139
  }).init();
138
140
  };
139
141
  };
@@ -18,7 +18,7 @@ var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
18
18
  _classCallCheck(this, SyncBlock);
19
19
  _this = _callSuper(this, SyncBlock, [props.node, props.view, props.getPos, props.portalProviderAPI, props.eventDispatcher, props]);
20
20
  _this.options = props.options;
21
- _this.syncBlockStore = props.syncBlockStore;
21
+ _this.api = props.api;
22
22
  return _this;
23
23
  }
24
24
  _inherits(SyncBlock, _ReactNodeView);
@@ -33,6 +33,7 @@ var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
33
33
  key: "render",
34
34
  value: function render() {
35
35
  var _this$options,
36
+ _this$api,
36
37
  _this$options2,
37
38
  _this2 = this;
38
39
  if (!((_this$options = this.options) !== null && _this$options !== void 0 && _this$options.syncedBlockRenderer)) {
@@ -44,16 +45,20 @@ var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
44
45
  if (!resourceId || !localId) {
45
46
  return null;
46
47
  }
48
+ var syncBlockStore = (_this$api = this.api) === null || _this$api === void 0 || (_this$api = _this$api.syncedBlock) === null || _this$api === void 0 || (_this$api = _this$api.sharedState.currentState()) === null || _this$api === void 0 ? void 0 : _this$api.syncBlockStore;
49
+ if (!syncBlockStore) {
50
+ return null;
51
+ }
47
52
 
48
53
  // get document node from data provider
49
54
  return /*#__PURE__*/React.createElement(SyncBlockRendererWrapper, {
50
55
  localId: this.node.attrs.localId,
51
56
  syncedBlockRenderer: (_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2.syncedBlockRenderer,
52
57
  useFetchSyncBlockTitle: function useFetchSyncBlockTitle() {
53
- return _useFetchSyncBlockTitle(_this2.syncBlockStore, _this2.node);
58
+ return _useFetchSyncBlockTitle(syncBlockStore, _this2.node);
54
59
  },
55
60
  useFetchSyncBlockData: function useFetchSyncBlockData() {
56
- return _useFetchSyncBlockData(_this2.syncBlockStore, resourceId, localId);
61
+ return _useFetchSyncBlockData(syncBlockStore, resourceId, localId);
57
62
  }
58
63
  });
59
64
  }
@@ -69,8 +74,7 @@ var SyncBlock = /*#__PURE__*/function (_ReactNodeView) {
69
74
  export var syncBlockNodeView = function syncBlockNodeView(_ref) {
70
75
  var options = _ref.options,
71
76
  pmPluginFactoryParams = _ref.pmPluginFactoryParams,
72
- api = _ref.api,
73
- syncBlockStore = _ref.syncBlockStore;
77
+ api = _ref.api;
74
78
  return function (node, view, getPos) {
75
79
  var portalProviderAPI = pmPluginFactoryParams.portalProviderAPI,
76
80
  eventDispatcher = pmPluginFactoryParams.eventDispatcher;
@@ -81,8 +85,7 @@ export var syncBlockNodeView = function syncBlockNodeView(_ref) {
81
85
  view: view,
82
86
  getPos: getPos,
83
87
  portalProviderAPI: portalProviderAPI,
84
- eventDispatcher: eventDispatcher,
85
- syncBlockStore: syncBlockStore
88
+ eventDispatcher: eventDispatcher
86
89
  }).init();
87
90
  };
88
91
  };
@@ -25,7 +25,8 @@ export var createPlugin = function createPlugin(options, pmPluginFactoryParams,
25
25
  syncBlockStore.referenceManager.fetchSyncBlocksData(convertPMNodesToSyncBlockNodes(syncBlockNodes));
26
26
  return {
27
27
  selectionDecorationSet: calculateDecorations(instance.doc, instance.selection, instance.schema),
28
- showFlag: false
28
+ showFlag: false,
29
+ syncBlockStore: syncBlockStore
29
30
  };
30
31
  },
31
32
  apply: function apply(tr, currentPluginState, oldEditorState) {
@@ -39,7 +40,8 @@ export var createPlugin = function createPlugin(options, pmPluginFactoryParams,
39
40
  }
40
41
  return {
41
42
  showFlag: (_meta$showFlag = meta === null || meta === void 0 ? void 0 : meta.showFlag) !== null && _meta$showFlag !== void 0 ? _meta$showFlag : showFlag,
42
- selectionDecorationSet: newDecorationSet
43
+ selectionDecorationSet: newDecorationSet,
44
+ syncBlockStore: syncBlockStore
43
45
  };
44
46
  }
45
47
  },
@@ -48,14 +50,12 @@ export var createPlugin = function createPlugin(options, pmPluginFactoryParams,
48
50
  syncBlock: lazySyncBlockView({
49
51
  options: options,
50
52
  pmPluginFactoryParams: pmPluginFactoryParams,
51
- api: api,
52
- syncBlockStore: syncBlockStore
53
+ api: api
53
54
  }),
54
55
  bodiedSyncBlock: lazyBodiedSyncBlockView({
55
56
  pluginOptions: options,
56
57
  pmPluginFactoryParams: pmPluginFactoryParams,
57
- api: api,
58
- syncBlockStore: syncBlockStore
58
+ api: api
59
59
  })
60
60
  },
61
61
  decorations: function decorations(state) {
@@ -106,9 +106,11 @@ export var syncedBlockPlugin = function syncedBlockPlugin(_ref) {
106
106
  return;
107
107
  }
108
108
  var _syncedBlockPluginKey = syncedBlockPluginKey.getState(editorState),
109
- showFlag = _syncedBlockPluginKey.showFlag;
109
+ showFlag = _syncedBlockPluginKey.showFlag,
110
+ currentSyncBlockStore = _syncedBlockPluginKey.syncBlockStore;
110
111
  return {
111
- showFlag: showFlag
112
+ showFlag: showFlag,
113
+ syncBlockStore: currentSyncBlockStore
112
114
  };
113
115
  }
114
116
  };
@@ -5,7 +5,6 @@ import ReactNodeView, { type getPosHandler } from '@atlaskit/editor-common/react
5
5
  import type { ExtractInjectionAPI, PMPluginFactoryParams } from '@atlaskit/editor-common/types';
6
6
  import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
7
7
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
- import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
9
8
  import type { SyncedBlockPlugin, SyncedBlockPluginOptions } from '../syncedBlockPluginType';
10
9
  export interface BodiedSyncBlockNodeViewProps extends ReactComponentProps {
11
10
  api?: ExtractInjectionAPI<SyncedBlockPlugin>;
@@ -14,13 +13,11 @@ export interface BodiedSyncBlockNodeViewProps extends ReactComponentProps {
14
13
  node: PMNode;
15
14
  pluginOptions: SyncedBlockPluginOptions | undefined;
16
15
  portalProviderAPI: PortalProviderAPI;
17
- syncBlockStore: SyncBlockStoreManager;
18
16
  view: EditorView;
19
17
  }
20
18
  export interface BodiedSyncBlockNodeViewProperties {
21
19
  api?: ExtractInjectionAPI<SyncedBlockPlugin>;
22
20
  pluginOptions: SyncedBlockPluginOptions | undefined;
23
21
  pmPluginFactoryParams: PMPluginFactoryParams;
24
- syncBlockStore: SyncBlockStoreManager;
25
22
  }
26
23
  export declare const bodiedSyncBlockNodeView: (props: BodiedSyncBlockNodeViewProperties) => (node: PMNode, view: EditorView, getPos: getPosHandler) => ReactNodeView<BodiedSyncBlockNodeViewProps>;
@@ -5,7 +5,6 @@ import type { ReactComponentProps } from '@atlaskit/editor-common/react-node-vie
5
5
  import type { ExtractInjectionAPI, PMPluginFactoryParams } from '@atlaskit/editor-common/types';
6
6
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
7
7
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
- import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
9
8
  import type { SyncedBlockPlugin, SyncedBlockPluginOptions } from '../syncedBlockPluginType';
10
9
  export interface SyncBlockNodeViewProps extends ReactComponentProps {
11
10
  api?: ExtractInjectionAPI<SyncedBlockPlugin>;
@@ -15,13 +14,11 @@ export interface SyncBlockNodeViewProps extends ReactComponentProps {
15
14
  node: PMNode;
16
15
  options: SyncedBlockPluginOptions | undefined;
17
16
  portalProviderAPI: PortalProviderAPI;
18
- syncBlockStore: SyncBlockStoreManager;
19
17
  view: EditorView;
20
18
  }
21
19
  export interface SyncBlockNodeViewProperties {
22
20
  api?: ExtractInjectionAPI<SyncedBlockPlugin>;
23
21
  options: SyncedBlockPluginOptions | undefined;
24
22
  pmPluginFactoryParams: PMPluginFactoryParams;
25
- syncBlockStore: SyncBlockStoreManager;
26
23
  }
27
24
  export declare const syncBlockNodeView: (props: SyncBlockNodeViewProperties) => (node: PMNode, view: EditorView, getPos: getPosHandler) => ReactNodeView<SyncBlockNodeViewProps>;
@@ -9,6 +9,7 @@ export declare const syncedBlockPluginKey: PluginKey<any>;
9
9
  type SyncedBlockPluginState = {
10
10
  selectionDecorationSet: DecorationSet;
11
11
  showFlag: FLAG_ID | false;
12
+ syncBlockStore: SyncBlockStoreManager;
12
13
  };
13
14
  export declare const createPlugin: (options: SyncedBlockPluginOptions | undefined, pmPluginFactoryParams: PMPluginFactoryParams, syncBlockStore: SyncBlockStoreManager, api?: ExtractInjectionAPI<SyncedBlockPlugin>) => SafePlugin<SyncedBlockPluginState>;
14
15
  export {};
@@ -1,3 +1,4 @@
1
+ import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
1
2
  export declare enum FLAG_ID {
2
3
  CANNOT_DELETE_WHEN_OFFLINE = "cannot-delete-when-offline",
3
4
  CANNOT_EDIT_WHEN_OFFLINE = "cannot-edit-when-offline",
@@ -8,4 +9,8 @@ export type SyncedBlockSharedState = {
8
9
  * Whether to show a flag (usually for errors, e.g. fail to delete)
9
10
  */
10
11
  showFlag: FLAG_ID | false;
12
+ /**
13
+ * The current sync block store manager, used to manage fetching and updating sync block data
14
+ */
15
+ syncBlockStore: SyncBlockStoreManager;
11
16
  };
@@ -5,7 +5,6 @@ import ReactNodeView, { type getPosHandler } from '@atlaskit/editor-common/react
5
5
  import type { ExtractInjectionAPI, PMPluginFactoryParams } from '@atlaskit/editor-common/types';
6
6
  import { type Node as PMNode } from '@atlaskit/editor-prosemirror/model';
7
7
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
- import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
9
8
  import type { SyncedBlockPlugin, SyncedBlockPluginOptions } from '../syncedBlockPluginType';
10
9
  export interface BodiedSyncBlockNodeViewProps extends ReactComponentProps {
11
10
  api?: ExtractInjectionAPI<SyncedBlockPlugin>;
@@ -14,13 +13,11 @@ export interface BodiedSyncBlockNodeViewProps extends ReactComponentProps {
14
13
  node: PMNode;
15
14
  pluginOptions: SyncedBlockPluginOptions | undefined;
16
15
  portalProviderAPI: PortalProviderAPI;
17
- syncBlockStore: SyncBlockStoreManager;
18
16
  view: EditorView;
19
17
  }
20
18
  export interface BodiedSyncBlockNodeViewProperties {
21
19
  api?: ExtractInjectionAPI<SyncedBlockPlugin>;
22
20
  pluginOptions: SyncedBlockPluginOptions | undefined;
23
21
  pmPluginFactoryParams: PMPluginFactoryParams;
24
- syncBlockStore: SyncBlockStoreManager;
25
22
  }
26
23
  export declare const bodiedSyncBlockNodeView: (props: BodiedSyncBlockNodeViewProperties) => (node: PMNode, view: EditorView, getPos: getPosHandler) => ReactNodeView<BodiedSyncBlockNodeViewProps>;
@@ -5,7 +5,6 @@ import type { ReactComponentProps } from '@atlaskit/editor-common/react-node-vie
5
5
  import type { ExtractInjectionAPI, PMPluginFactoryParams } from '@atlaskit/editor-common/types';
6
6
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
7
7
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
8
- import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
9
8
  import type { SyncedBlockPlugin, SyncedBlockPluginOptions } from '../syncedBlockPluginType';
10
9
  export interface SyncBlockNodeViewProps extends ReactComponentProps {
11
10
  api?: ExtractInjectionAPI<SyncedBlockPlugin>;
@@ -15,13 +14,11 @@ export interface SyncBlockNodeViewProps extends ReactComponentProps {
15
14
  node: PMNode;
16
15
  options: SyncedBlockPluginOptions | undefined;
17
16
  portalProviderAPI: PortalProviderAPI;
18
- syncBlockStore: SyncBlockStoreManager;
19
17
  view: EditorView;
20
18
  }
21
19
  export interface SyncBlockNodeViewProperties {
22
20
  api?: ExtractInjectionAPI<SyncedBlockPlugin>;
23
21
  options: SyncedBlockPluginOptions | undefined;
24
22
  pmPluginFactoryParams: PMPluginFactoryParams;
25
- syncBlockStore: SyncBlockStoreManager;
26
23
  }
27
24
  export declare const syncBlockNodeView: (props: SyncBlockNodeViewProperties) => (node: PMNode, view: EditorView, getPos: getPosHandler) => ReactNodeView<SyncBlockNodeViewProps>;
@@ -9,6 +9,7 @@ export declare const syncedBlockPluginKey: PluginKey<any>;
9
9
  type SyncedBlockPluginState = {
10
10
  selectionDecorationSet: DecorationSet;
11
11
  showFlag: FLAG_ID | false;
12
+ syncBlockStore: SyncBlockStoreManager;
12
13
  };
13
14
  export declare const createPlugin: (options: SyncedBlockPluginOptions | undefined, pmPluginFactoryParams: PMPluginFactoryParams, syncBlockStore: SyncBlockStoreManager, api?: ExtractInjectionAPI<SyncedBlockPlugin>) => SafePlugin<SyncedBlockPluginState>;
14
15
  export {};
@@ -1,3 +1,4 @@
1
+ import type { SyncBlockStoreManager } from '@atlaskit/editor-synced-block-provider';
1
2
  export declare enum FLAG_ID {
2
3
  CANNOT_DELETE_WHEN_OFFLINE = "cannot-delete-when-offline",
3
4
  CANNOT_EDIT_WHEN_OFFLINE = "cannot-edit-when-offline",
@@ -8,4 +9,8 @@ export type SyncedBlockSharedState = {
8
9
  * Whether to show a flag (usually for errors, e.g. fail to delete)
9
10
  */
10
11
  showFlag: FLAG_ID | false;
12
+ /**
13
+ * The current sync block store manager, used to manage fetching and updating sync block data
14
+ */
15
+ syncBlockStore: SyncBlockStoreManager;
11
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-synced-block",
3
- "version": "4.2.14",
3
+ "version": "4.2.15",
4
4
  "description": "SyncedBlock plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",